@bcts/dcbor 1.0.0-alpha.15 → 1.0.0-alpha.17

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.
@@ -8,14 +8,14 @@ var bctsDcbor = (function(exports) {
8
8
  var __getProtoOf = Object.getPrototypeOf;
9
9
  var __hasOwnProp = Object.prototype.hasOwnProperty;
10
10
  var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
11
- var __copyProps = (to, from$1, except, desc) => {
12
- if (from$1 && typeof from$1 === "object" || typeof from$1 === "function") {
13
- for (var keys = __getOwnPropNames(from$1), i = 0, n = keys.length, key; i < n; i++) {
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
14
14
  key = keys[i];
15
15
  if (!__hasOwnProp.call(to, key) && key !== except) {
16
16
  __defProp(to, key, {
17
- get: ((k) => from$1[k]).bind(null, key),
18
- enumerable: !(desc = __getOwnPropDesc(from$1, key)) || desc.enumerable
17
+ get: ((k) => from[k]).bind(null, key),
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
19
  });
20
20
  }
21
21
  }
@@ -120,14 +120,14 @@ var bctsDcbor = (function(exports) {
120
120
  };
121
121
  GenericCollection.prototype.forEach = function(callback) {
122
122
  var thisp = arguments[1];
123
- return this.reduce(function(undefined$1, value, key, object, depth) {
123
+ return this.reduce(function(undefined, value, key, object, depth) {
124
124
  callback.call(thisp, value, key, object, depth);
125
125
  }, void 0);
126
126
  };
127
127
  GenericCollection.prototype.map = function(callback) {
128
128
  var thisp = arguments[1];
129
129
  var result = [];
130
- this.reduce(function(undefined$1, value, key, object, depth) {
130
+ this.reduce(function(undefined, value, key, object, depth) {
131
131
  result.push(callback.call(thisp, value, key, object, depth));
132
132
  }, void 0);
133
133
  return result;
@@ -135,7 +135,7 @@ var bctsDcbor = (function(exports) {
135
135
  GenericCollection.prototype.enumerate = function(start) {
136
136
  if (start == null) start = 0;
137
137
  var result = [];
138
- this.reduce(function(undefined$1, value) {
138
+ this.reduce(function(undefined, value) {
139
139
  result.push([start++, value]);
140
140
  }, void 0);
141
141
  return result;
@@ -162,7 +162,7 @@ var bctsDcbor = (function(exports) {
162
162
  };
163
163
  GenericCollection.prototype.toObject = function() {
164
164
  var object = {};
165
- this.reduce(function(undefined$1, value, key) {
165
+ this.reduce(function(undefined, value, key) {
166
166
  object[key] = value;
167
167
  }, void 0);
168
168
  return object;
@@ -173,7 +173,7 @@ var bctsDcbor = (function(exports) {
173
173
  GenericCollection.prototype.filter = function(callback) {
174
174
  var thisp = arguments[1];
175
175
  var result = this.constructClone();
176
- this.reduce(function(undefined$1, value, key, object, depth) {
176
+ this.reduce(function(undefined, value, key, object, depth) {
177
177
  if (callback.call(thisp, value, key, object, depth)) result.add(value, key);
178
178
  }, void 0);
179
179
  return result;
@@ -225,7 +225,7 @@ var bctsDcbor = (function(exports) {
225
225
  GenericCollection.prototype.average = function(zero) {
226
226
  var sum = zero === void 0 ? 0 : zero;
227
227
  var count = zero === void 0 ? 0 : zero;
228
- this.reduce(function(undefined$1, value) {
228
+ this.reduce(function(undefined, value) {
229
229
  sum += value;
230
230
  count += 1;
231
231
  }, void 0);
@@ -906,8 +906,8 @@ var bctsDcbor = (function(exports) {
906
906
  };
907
907
  Object.addEach = function(target, source, overrides) {
908
908
  var overridesExistingProperty = arguments.length === 3 ? overrides : true;
909
- if (!source) {} else if (typeof source.forEach === "function" && !source.hasOwnProperty("forEach")) if (source.isMap === true) source.forEach(function(value, key$1) {
910
- target[key$1] = value;
909
+ if (!source) {} else if (typeof source.forEach === "function" && !source.hasOwnProperty("forEach")) if (source.isMap === true) source.forEach(function(value, key) {
910
+ target[key] = value;
911
911
  });
912
912
  else source.forEach(function(pair) {
913
913
  target[pair[0]] = pair[1];
@@ -918,8 +918,8 @@ var bctsDcbor = (function(exports) {
918
918
  };
919
919
  Object.defineEach = function(target, source, overrides, configurable, enumerable, writable) {
920
920
  var overridesExistingProperty = arguments.length === 3 ? overrides : true;
921
- if (!source) {} else if (typeof source.forEach === "function" && !source.hasOwnProperty("forEach")) if (source.isMap === true) source.forEach(function(value, key$1) {
922
- Object.defineProperty(target, key$1, {
921
+ if (!source) {} else if (typeof source.forEach === "function" && !source.hasOwnProperty("forEach")) if (source.isMap === true) source.forEach(function(value, key) {
922
+ Object.defineProperty(target, key, {
923
923
  value,
924
924
  writable,
925
925
  configurable,
@@ -1194,10 +1194,10 @@ var bctsDcbor = (function(exports) {
1194
1194
  if (this === that) return 0;
1195
1195
  if (!that) return 1;
1196
1196
  var length = Math.min(this.length, that.length);
1197
- var comparison = this.zip(that).reduce(function(comparison$1, pair, index) {
1198
- if (comparison$1 === 0) if (index >= length) return comparison$1;
1197
+ var comparison = this.zip(that).reduce(function(comparison, pair, index) {
1198
+ if (comparison === 0) if (index >= length) return comparison;
1199
1199
  else return compare(pair[0], pair[1]);
1200
- else return comparison$1;
1200
+ else return comparison;
1201
1201
  }, 0);
1202
1202
  if (comparison === 0) return this.length - that.length;
1203
1203
  return comparison;
@@ -1547,7 +1547,7 @@ var bctsDcbor = (function(exports) {
1547
1547
  };
1548
1548
  GenericSet.prototype.forEach = function(callback) {
1549
1549
  var thisp = arguments[1];
1550
- return this.reduce(function(undefined$1, value, key, object, depth) {
1550
+ return this.reduce(function(undefined, value, key, object, depth) {
1551
1551
  callback.call(thisp, value, value, object, depth);
1552
1552
  }, void 0);
1553
1553
  };
@@ -1608,19 +1608,19 @@ var bctsDcbor = (function(exports) {
1608
1608
  List.prototype.find = function(value, equals, index) {
1609
1609
  equals = equals || this.contentEquals;
1610
1610
  var head = this.head;
1611
- var at$1 = this.scan(index, head.next);
1612
- while (at$1 !== head) {
1613
- if (equals(at$1.value, value)) return at$1;
1614
- at$1 = at$1.next;
1611
+ var at = this.scan(index, head.next);
1612
+ while (at !== head) {
1613
+ if (equals(at.value, value)) return at;
1614
+ at = at.next;
1615
1615
  }
1616
1616
  };
1617
1617
  List.prototype.findLast = function(value, equals, index) {
1618
1618
  equals = equals || this.contentEquals;
1619
1619
  var head = this.head;
1620
- var at$1 = this.scan(index, head.prev);
1621
- while (at$1 !== head) {
1622
- if (equals(at$1.value, value)) return at$1;
1623
- at$1 = at$1.prev;
1620
+ var at = this.scan(index, head.prev);
1621
+ while (at !== head) {
1622
+ if (equals(at.value, value)) return at;
1623
+ at = at.prev;
1624
1624
  }
1625
1625
  };
1626
1626
  List.prototype.has = function(value, equals) {
@@ -1643,14 +1643,14 @@ var bctsDcbor = (function(exports) {
1643
1643
  List.prototype.deleteAll = function(value, equals) {
1644
1644
  equals = equals || this.contentEquals;
1645
1645
  var head = this.head;
1646
- var at$1 = head.next;
1646
+ var at = head.next;
1647
1647
  var count = 0;
1648
- while (at$1 !== head) {
1649
- if (equals(value, at$1.value)) {
1650
- at$1["delete"]();
1648
+ while (at !== head) {
1649
+ if (equals(value, at.value)) {
1650
+ at["delete"]();
1651
1651
  count++;
1652
1652
  }
1653
- at$1 = at$1.next;
1653
+ at = at.next;
1654
1654
  }
1655
1655
  this.length -= count;
1656
1656
  return count;
@@ -1678,12 +1678,12 @@ var bctsDcbor = (function(exports) {
1678
1678
  this.length += arguments.length;
1679
1679
  };
1680
1680
  List.prototype.unshift = function() {
1681
- var at$1 = this.head;
1681
+ var at = this.head;
1682
1682
  for (var i = 0; i < arguments.length; i++) {
1683
1683
  var value = arguments[i];
1684
1684
  var node = new this.Node(value);
1685
- at$1.addAfter(node);
1686
- at$1 = node;
1685
+ at.addAfter(node);
1686
+ at = node;
1687
1687
  }
1688
1688
  this.length += arguments.length;
1689
1689
  };
@@ -1728,41 +1728,41 @@ var bctsDcbor = (function(exports) {
1728
1728
  List.prototype.one = function() {
1729
1729
  return this.peek();
1730
1730
  };
1731
- List.prototype.scan = function(at$1, fallback) {
1731
+ List.prototype.scan = function(at, fallback) {
1732
1732
  var head = this.head;
1733
- if (typeof at$1 === "number") {
1734
- var count = at$1;
1733
+ if (typeof at === "number") {
1734
+ var count = at;
1735
1735
  if (count >= 0) {
1736
- at$1 = head.next;
1736
+ at = head.next;
1737
1737
  while (count) {
1738
1738
  count--;
1739
- at$1 = at$1.next;
1740
- if (at$1 == head) break;
1739
+ at = at.next;
1740
+ if (at == head) break;
1741
1741
  }
1742
1742
  } else {
1743
- at$1 = head;
1743
+ at = head;
1744
1744
  while (count < 0) {
1745
1745
  count++;
1746
- at$1 = at$1.prev;
1747
- if (at$1 == head) break;
1746
+ at = at.prev;
1747
+ if (at == head) break;
1748
1748
  }
1749
1749
  }
1750
- return at$1;
1751
- } else return at$1 || fallback;
1750
+ return at;
1751
+ } else return at || fallback;
1752
1752
  };
1753
- List.prototype.slice = function(at$1, end) {
1753
+ List.prototype.slice = function(at, end) {
1754
1754
  var sliced = [];
1755
1755
  var head = this.head;
1756
- at$1 = this.scan(at$1, head.next);
1756
+ at = this.scan(at, head.next);
1757
1757
  end = this.scan(end, head);
1758
- while (at$1 !== end && at$1 !== head) {
1759
- sliced.push(at$1.value);
1760
- at$1 = at$1.next;
1758
+ while (at !== end && at !== head) {
1759
+ sliced.push(at.value);
1760
+ at = at.next;
1761
1761
  }
1762
1762
  return sliced;
1763
1763
  };
1764
- List.prototype.splice = function(at$1, length) {
1765
- return this.swap(at$1, length, Array.prototype.slice.call(arguments, 2));
1764
+ List.prototype.splice = function(at, length) {
1765
+ return this.swap(at, length, Array.prototype.slice.call(arguments, 2));
1766
1766
  };
1767
1767
  List.prototype.swap = function(start, length, plus, _before, _after) {
1768
1768
  var initial = start;
@@ -1770,31 +1770,31 @@ var bctsDcbor = (function(exports) {
1770
1770
  if (length == null) length = Infinity;
1771
1771
  plus = Array.from(plus);
1772
1772
  var minus = [];
1773
- var at$1 = start;
1774
- while (length-- && length >= 0 && at$1 !== this.head) {
1775
- minus.push(at$1.value);
1776
- at$1 = at$1.next;
1773
+ var at = start;
1774
+ while (length-- && length >= 0 && at !== this.head) {
1775
+ minus.push(at.value);
1776
+ at = at.next;
1777
1777
  }
1778
1778
  _before && _before.call(this, start, plus, minus);
1779
- var at$1 = start;
1780
- for (var i = 0, at$1 = start; i < minus.length; i++, at$1 = at$1.next) at$1["delete"]();
1781
- if (initial == null && at$1 === this.head) at$1 = this.head.next;
1779
+ var at = start;
1780
+ for (var i = 0, at = start; i < minus.length; i++, at = at.next) at["delete"]();
1781
+ if (initial == null && at === this.head) at = this.head.next;
1782
1782
  for (var i = 0; i < plus.length; i++) {
1783
1783
  var node = new this.Node(plus[i]);
1784
- at$1.addBefore(node);
1784
+ at.addBefore(node);
1785
1785
  }
1786
1786
  this.length += plus.length - minus.length;
1787
1787
  _after && _after.call(this, start, plus, minus);
1788
1788
  return minus;
1789
1789
  };
1790
1790
  List.prototype.reverse = function() {
1791
- var at$1 = this.head;
1791
+ var at = this.head;
1792
1792
  do {
1793
- var temp = at$1.next;
1794
- at$1.next = at$1.prev;
1795
- at$1.prev = temp;
1796
- at$1 = at$1.next;
1797
- } while (at$1 !== this.head);
1793
+ var temp = at.next;
1794
+ at.next = at.prev;
1795
+ at.prev = temp;
1796
+ at = at.next;
1797
+ } while (at !== this.head);
1798
1798
  return this;
1799
1799
  };
1800
1800
  List.prototype.sort = function() {
@@ -1803,20 +1803,20 @@ var bctsDcbor = (function(exports) {
1803
1803
  List.prototype.reduce = function(callback, basis) {
1804
1804
  var thisp = arguments[2];
1805
1805
  var head = this.head;
1806
- var at$1 = head.next;
1807
- while (at$1 !== head) {
1808
- basis = callback.call(thisp, basis, at$1.value, at$1, this);
1809
- at$1 = at$1.next;
1806
+ var at = head.next;
1807
+ while (at !== head) {
1808
+ basis = callback.call(thisp, basis, at.value, at, this);
1809
+ at = at.next;
1810
1810
  }
1811
1811
  return basis;
1812
1812
  };
1813
1813
  List.prototype.reduceRight = function(callback, basis) {
1814
1814
  var thisp = arguments[2];
1815
1815
  var head = this.head;
1816
- var at$1 = head.prev;
1817
- while (at$1 !== head) {
1818
- basis = callback.call(thisp, basis, at$1.value, at$1, this);
1819
- at$1 = at$1.prev;
1816
+ var at = head.prev;
1817
+ while (at !== head) {
1818
+ basis = callback.call(thisp, basis, at.value, at, this);
1819
+ at = at.prev;
1820
1820
  }
1821
1821
  return basis;
1822
1822
  };
@@ -2173,8 +2173,8 @@ var bctsDcbor = (function(exports) {
2173
2173
  GenericMap.prototype["delete"] = function(key) {
2174
2174
  var item = new this.Item(key);
2175
2175
  if (this.store.has(item)) {
2176
- var from$1 = this.store.get(item).value;
2177
- if (this.dispatchesMapChanges) this.dispatchBeforeMapChange(key, from$1);
2176
+ var from = this.store.get(item).value;
2177
+ if (this.dispatchesMapChanges) this.dispatchBeforeMapChange(key, from);
2178
2178
  this.store["delete"](item);
2179
2179
  this.length--;
2180
2180
  if (this.dispatchesMapChanges) this.dispatchMapChange(key, void 0);
@@ -2185,8 +2185,8 @@ var bctsDcbor = (function(exports) {
2185
2185
  GenericMap.prototype.clear = function() {
2186
2186
  var keys, key;
2187
2187
  if (this.dispatchesMapChanges) {
2188
- this.forEach(function(value, key$1) {
2189
- this.dispatchBeforeMapChange(key$1, value);
2188
+ this.forEach(function(value, key) {
2189
+ this.dispatchBeforeMapChange(key, value);
2190
2190
  }, this);
2191
2191
  keys = this.keysArray();
2192
2192
  }
@@ -2195,13 +2195,13 @@ var bctsDcbor = (function(exports) {
2195
2195
  if (this.dispatchesMapChanges) for (var i = 0; key = keys[i]; i++) this.dispatchMapChange(key);
2196
2196
  };
2197
2197
  GenericMap.prototype.reduce = function(callback, basis, thisp) {
2198
- return this.store.reduce(function(basis$1, item) {
2199
- return callback.call(thisp, basis$1, item.value, item.key, this);
2198
+ return this.store.reduce(function(basis, item) {
2199
+ return callback.call(thisp, basis, item.value, item.key, this);
2200
2200
  }, basis, this);
2201
2201
  };
2202
2202
  GenericMap.prototype.reduceRight = function(callback, basis, thisp) {
2203
- return this.store.reduceRight(function(basis$1, item) {
2204
- return callback.call(thisp, basis$1, item.value, item.key, this);
2203
+ return this.store.reduceRight(function(basis, item) {
2204
+ return callback.call(thisp, basis, item.value, item.key, this);
2205
2205
  }, basis, this);
2206
2206
  };
2207
2207
  GenericMap.prototype.keysArray = function() {
@@ -2367,8 +2367,8 @@ var bctsDcbor = (function(exports) {
2367
2367
  Dict.prototype.reduceRight = function(callback, basis, thisp) {
2368
2368
  var self = this;
2369
2369
  var store = this.store;
2370
- basis = Object.keys(this.store).reduceRight(function(basis$1, key) {
2371
- return callback.call(thisp, basis$1, store[key], key, self);
2370
+ basis = Object.keys(this.store).reduceRight(function(basis, key) {
2371
+ return callback.call(thisp, basis, store[key], key, self);
2372
2372
  }, basis);
2373
2373
  if (this._hasProto) return callback.call(thisp, basis, this._protoValue, "__proto__", self);
2374
2374
  return basis;
@@ -2498,10 +2498,10 @@ var bctsDcbor = (function(exports) {
2498
2498
  var thisp = arguments[2];
2499
2499
  var buckets = this.buckets;
2500
2500
  var index = 0;
2501
- return buckets.reduce(function(basis$1, bucket) {
2502
- return bucket.reduce(function(basis$2, value) {
2503
- return callback.call(thisp, basis$2, value, index++, this);
2504
- }, basis$1, this);
2501
+ return buckets.reduce(function(basis, bucket) {
2502
+ return bucket.reduce(function(basis, value) {
2503
+ return callback.call(thisp, basis, value, index++, this);
2504
+ }, basis, this);
2505
2505
  }, basis, this);
2506
2506
  };
2507
2507
  FastSet.prototype.one = function() {
@@ -2533,17 +2533,17 @@ var bctsDcbor = (function(exports) {
2533
2533
  bucket = buckets.get(hash);
2534
2534
  callback.call(thisp, branch + charmap.through + charmap.branchDown + " " + hash);
2535
2535
  bucket.forEach(function(value, node) {
2536
- var branch$1, below, written;
2536
+ var branch, below, written;
2537
2537
  if (node === bucket.head.prev) {
2538
- branch$1 = charmap.fromAbove;
2538
+ branch = charmap.fromAbove;
2539
2539
  below = " ";
2540
2540
  } else {
2541
- branch$1 = charmap.fromBoth;
2541
+ branch = charmap.fromBoth;
2542
2542
  below = charmap.strafe;
2543
2543
  }
2544
2544
  logNode(node, function(line) {
2545
2545
  if (!written) {
2546
- callback.call(thisp, leader + " " + branch$1 + charmap.through + charmap.through + line);
2546
+ callback.call(thisp, leader + " " + branch + charmap.through + charmap.through + line);
2547
2547
  written = true;
2548
2548
  } else callback.call(thisp, leader + " " + below + " " + line);
2549
2549
  }, function(line) {
@@ -2729,16 +2729,16 @@ var bctsDcbor = (function(exports) {
2729
2729
  var thisp = arguments[2];
2730
2730
  var list = this.order;
2731
2731
  var index = 0;
2732
- return list.reduce(function(basis$1, value) {
2733
- return callback.call(thisp, basis$1, value, index++, this);
2732
+ return list.reduce(function(basis, value) {
2733
+ return callback.call(thisp, basis, value, index++, this);
2734
2734
  }, basis, this);
2735
2735
  };
2736
2736
  CollectionsSet.prototype.reduceRight = function(callback, basis) {
2737
2737
  var thisp = arguments[2];
2738
2738
  var list = this.order;
2739
2739
  var index = this.length - 1;
2740
- return list.reduceRight(function(basis$1, value) {
2741
- return callback.call(thisp, basis$1, value, index--, this);
2740
+ return list.reduceRight(function(basis, value) {
2741
+ return callback.call(thisp, basis, value, index--, this);
2742
2742
  }, basis, this);
2743
2743
  };
2744
2744
  CollectionsSet.prototype.iterate = function() {
@@ -2923,8 +2923,8 @@ var bctsDcbor = (function(exports) {
2923
2923
  }
2924
2924
  var Set = require__set().CollectionsSet;
2925
2925
  var GenericMap = require_generic_map();
2926
- CollectionsMap = Map = function Map$1(values, equals, hash, getDefault) {
2927
- if (!(this instanceof Map$1)) return new Map$1(values, equals, hash, getDefault);
2926
+ CollectionsMap = Map = function Map(values, equals, hash, getDefault) {
2927
+ if (!(this instanceof Map)) return new Map(values, equals, hash, getDefault);
2928
2928
  equals = equals || Object.equals;
2929
2929
  hash = hash || Object.hash;
2930
2930
  getDefault = getDefault || Function.noop;
@@ -3235,15 +3235,15 @@ var bctsDcbor = (function(exports) {
3235
3235
  return dispatchingGetter.overriddenDescriptor.value;
3236
3236
  };
3237
3237
  propertyListener.set = function dispatchingSetter(value) {
3238
- var descriptor, isActive, overriddenDescriptor$1 = dispatchingSetter.overriddenDescriptor;
3239
- if (value !== overriddenDescriptor$1.value) {
3238
+ var descriptor, isActive, overriddenDescriptor = dispatchingSetter.overriddenDescriptor;
3239
+ if (value !== overriddenDescriptor.value) {
3240
3240
  if (!(isActive = (descriptor = dispatchingSetter.descriptor).isActive)) {
3241
3241
  descriptor.isActive = true;
3242
3242
  try {
3243
- dispatchingSetter.dispatchEach(descriptor._willChangeListeners, dispatchingSetter.key, overriddenDescriptor$1.value, this);
3243
+ dispatchingSetter.dispatchEach(descriptor._willChangeListeners, dispatchingSetter.key, overriddenDescriptor.value, this);
3244
3244
  } finally {}
3245
3245
  }
3246
- overriddenDescriptor$1.value = value;
3246
+ overriddenDescriptor.value = value;
3247
3247
  if (!isActive) try {
3248
3248
  dispatchingSetter.dispatchEach(descriptor._changeListeners, dispatchingSetter.key, value, this);
3249
3249
  } finally {
@@ -3590,18 +3590,18 @@ var bctsDcbor = (function(exports) {
3590
3590
  if (this.contentEquals(value, this.root.value)) return this.root;
3591
3591
  }
3592
3592
  };
3593
- SortedSet.prototype.findGreatest = function(at$1) {
3593
+ SortedSet.prototype.findGreatest = function(at) {
3594
3594
  if (this.root) {
3595
- at$1 = at$1 || this.root;
3596
- while (at$1.right) at$1 = at$1.right;
3597
- return at$1;
3595
+ at = at || this.root;
3596
+ while (at.right) at = at.right;
3597
+ return at;
3598
3598
  }
3599
3599
  };
3600
- SortedSet.prototype.findLeast = function(at$1) {
3600
+ SortedSet.prototype.findLeast = function(at) {
3601
3601
  if (this.root) {
3602
- at$1 = at$1 || this.root;
3603
- while (at$1.left) at$1 = at$1.left;
3604
- return at$1;
3602
+ at = at || this.root;
3603
+ while (at.left) at = at.left;
3604
+ return at;
3605
3605
  }
3606
3606
  };
3607
3607
  SortedSet.prototype.findGreatestLessThanOrEqual = function(value) {
@@ -3668,8 +3668,8 @@ var bctsDcbor = (function(exports) {
3668
3668
  }
3669
3669
  return sliced;
3670
3670
  };
3671
- SortedSet.prototype.splice = function(at$1, length) {
3672
- return this.swap(at$1, length, Array.prototype.slice.call(arguments, 2));
3671
+ SortedSet.prototype.splice = function(at, length) {
3672
+ return this.swap(at, length, Array.prototype.slice.call(arguments, 2));
3673
3673
  };
3674
3674
  SortedSet.prototype.swap = function(start, length, plus) {
3675
3675
  if (start === void 0 && length === void 0) return [];
@@ -3757,16 +3757,16 @@ var bctsDcbor = (function(exports) {
3757
3757
  };
3758
3758
  SortedSet.prototype.splayIndex = function(index) {
3759
3759
  if (this.root) {
3760
- var at$1 = this.root;
3760
+ var at = this.root;
3761
3761
  var atIndex = this.root.index;
3762
- while (atIndex !== index) if (atIndex > index && at$1.left) {
3763
- at$1 = at$1.left;
3764
- atIndex -= 1 + (at$1.right ? at$1.right.length : 0);
3765
- } else if (atIndex < index && at$1.right) {
3766
- at$1 = at$1.right;
3767
- atIndex += 1 + (at$1.left ? at$1.left.length : 0);
3762
+ while (atIndex !== index) if (atIndex > index && at.left) {
3763
+ at = at.left;
3764
+ atIndex -= 1 + (at.right ? at.right.length : 0);
3765
+ } else if (atIndex < index && at.right) {
3766
+ at = at.right;
3767
+ atIndex += 1 + (at.left ? at.left.length : 0);
3768
3768
  } else break;
3769
- this.splay(at$1.value);
3769
+ this.splay(at.value);
3770
3770
  return this.root.index === index;
3771
3771
  }
3772
3772
  return false;
@@ -3779,12 +3779,12 @@ var bctsDcbor = (function(exports) {
3779
3779
  if (this.root) basis = this.root.reduceRight(callback, basis, this.length - 1, thisp, this);
3780
3780
  return basis;
3781
3781
  };
3782
- SortedSet.prototype.min = function(at$1) {
3783
- var least = this.findLeast(at$1);
3782
+ SortedSet.prototype.min = function(at) {
3783
+ var least = this.findLeast(at);
3784
3784
  if (least) return least.value;
3785
3785
  };
3786
- SortedSet.prototype.max = function(at$1) {
3787
- var greatest = this.findGreatest(at$1);
3786
+ SortedSet.prototype.max = function(at) {
3787
+ var greatest = this.findGreatest(at);
3788
3788
  if (greatest) return greatest.value;
3789
3789
  };
3790
3790
  SortedSet.prototype.one = function() {
@@ -4341,7 +4341,7 @@ var import_sorted_map = require_sorted_map();
4341
4341
  if (!Object.defineProperty || !function() {
4342
4342
  try {
4343
4343
  return Object.defineProperty({}, "x", {}), !0;
4344
- } catch (e$1) {
4344
+ } catch (e) {
4345
4345
  return !1;
4346
4346
  }
4347
4347
  }()) {
@@ -4349,7 +4349,7 @@ var import_sorted_map = require_sorted_map();
4349
4349
  Object.defineProperty = function(t, r, o) {
4350
4350
  if (e) try {
4351
4351
  return e(t, r, o);
4352
- } catch (e$1) {}
4352
+ } catch (e) {}
4353
4353
  if (t !== Object(t)) throw TypeError("Object.defineProperty called on non-object");
4354
4354
  return Object.prototype.__defineGetter__ && "get" in o && Object.prototype.__defineGetter__.call(t, r, o.get), Object.prototype.__defineSetter__ && "set" in o && Object.prototype.__defineSetter__.call(t, r, o.set), "value" in o && (t[r] = o.value), t;
4355
4355
  };
@@ -4596,7 +4596,7 @@ var import_sorted_map = require_sorted_map();
4596
4596
 
4597
4597
  //#endregion
4598
4598
  //#region src/exact.ts
4599
- var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
4599
+ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data(), 1);
4600
4600
  const hasFract = (n) => {
4601
4601
  return n % 1 !== 0;
4602
4602
  };
@@ -4930,8 +4930,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
4930
4930
  const f = binary16ToNumber(numberToBinary16(n));
4931
4931
  if (f === n) return f16CborData(f);
4932
4932
  if (n < 0) {
4933
- const u$1 = ExactU64.exactFromF32(-1 - n);
4934
- if (u$1 !== void 0) return encodeVarInt(typeof u$1 === "bigint" ? Number(u$1) : u$1, MajorType.Negative);
4933
+ const u = ExactU64.exactFromF32(-1 - n);
4934
+ if (u !== void 0) return encodeVarInt(typeof u === "bigint" ? Number(u) : u, MajorType.Negative);
4935
4935
  }
4936
4936
  const u = ExactU32.exactFromF32(n);
4937
4937
  if (u !== void 0) return encodeVarInt(u, MajorType.Unsigned);
@@ -4948,8 +4948,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
4948
4948
  const f16CborData = (value) => {
4949
4949
  const n = value;
4950
4950
  if (n < 0) {
4951
- const u$1 = ExactU64.exactFromF64(-1 - n);
4952
- if (u$1 !== void 0) return encodeVarInt(typeof u$1 === "bigint" ? Number(u$1) : u$1, MajorType.Negative);
4951
+ const u = ExactU64.exactFromF64(-1 - n);
4952
+ if (u !== void 0) return encodeVarInt(typeof u === "bigint" ? Number(u) : u, MajorType.Negative);
4953
4953
  }
4954
4954
  const u = ExactU16.exactFromF64(n);
4955
4955
  if (u !== void 0) return encodeVarInt(u, MajorType.Unsigned);
@@ -5103,9 +5103,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5103
5103
  * Stores tags with their names and optional summarizer functions.
5104
5104
  */
5105
5105
  var TagsStore = class {
5106
- #tagsByValue = /* @__PURE__ */ new Map();
5107
- #tagsByName = /* @__PURE__ */ new Map();
5108
- #summarizers = /* @__PURE__ */ new Map();
5106
+ _tagsByValue = /* @__PURE__ */ new Map();
5107
+ _tagsByName = /* @__PURE__ */ new Map();
5108
+ _summarizers = /* @__PURE__ */ new Map();
5109
5109
  constructor() {}
5110
5110
  /**
5111
5111
  * Insert a tag into the registry.
@@ -5127,11 +5127,11 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5127
5127
  insert(tag) {
5128
5128
  const name = tag.name;
5129
5129
  if (name === void 0 || name === "") throw new Error(`Tag ${tag.value} must have a non-empty name`);
5130
- const key = this.#valueKey(tag.value);
5131
- const existing = this.#tagsByValue.get(key);
5130
+ const key = this._valueKey(tag.value);
5131
+ const existing = this._tagsByValue.get(key);
5132
5132
  if (existing?.name !== void 0 && existing.name !== name) throw new Error(`Attempt to register tag: ${tag.value} '${existing.name}' with different name: '${name}'`);
5133
- this.#tagsByValue.set(key, tag);
5134
- this.#tagsByName.set(name, tag);
5133
+ this._tagsByValue.set(key, tag);
5134
+ this._tagsByName.set(name, tag);
5135
5135
  }
5136
5136
  /**
5137
5137
  * Insert multiple tags into the registry.
@@ -5165,31 +5165,31 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5165
5165
  * });
5166
5166
  * ```
5167
5167
  */
5168
- setSummarizer(tagValue$1, summarizer) {
5169
- const key = this.#valueKey(tagValue$1);
5170
- this.#summarizers.set(key, summarizer);
5168
+ setSummarizer(tagValue, summarizer) {
5169
+ const key = this._valueKey(tagValue);
5170
+ this._summarizers.set(key, summarizer);
5171
5171
  }
5172
5172
  assignedNameForTag(tag) {
5173
- const key = this.#valueKey(tag.value);
5174
- return this.#tagsByValue.get(key)?.name;
5173
+ const key = this._valueKey(tag.value);
5174
+ return this._tagsByValue.get(key)?.name;
5175
5175
  }
5176
5176
  nameForTag(tag) {
5177
5177
  return this.assignedNameForTag(tag) ?? tag.value.toString();
5178
5178
  }
5179
5179
  tagForValue(value) {
5180
- const key = this.#valueKey(value);
5181
- return this.#tagsByValue.get(key);
5180
+ const key = this._valueKey(value);
5181
+ return this._tagsByValue.get(key);
5182
5182
  }
5183
5183
  tagForName(name) {
5184
- return this.#tagsByName.get(name);
5184
+ return this._tagsByName.get(name);
5185
5185
  }
5186
5186
  nameForValue(value) {
5187
5187
  const tag = this.tagForValue(value);
5188
5188
  return tag !== void 0 ? this.nameForTag(tag) : value.toString();
5189
5189
  }
5190
5190
  summarizer(tag) {
5191
- const key = this.#valueKey(tag);
5192
- return this.#summarizers.get(key);
5191
+ const key = this._valueKey(tag);
5192
+ return this._summarizers.get(key);
5193
5193
  }
5194
5194
  /**
5195
5195
  * Create a string key for a numeric tag value.
@@ -5197,7 +5197,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5197
5197
  *
5198
5198
  * @private
5199
5199
  */
5200
- #valueKey(value) {
5200
+ _valueKey(value) {
5201
5201
  return value.toString();
5202
5202
  }
5203
5203
  };
@@ -5244,9 +5244,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5244
5244
  * Convert hex string to bytes.
5245
5245
  */
5246
5246
  const hexToBytes = (hexString) => {
5247
- const hex$1 = hexString.replace(/\s/g, "");
5248
- const bytes = new Uint8Array(hex$1.length / 2);
5249
- for (let i = 0; i < hex$1.length; i += 2) bytes[i / 2] = parseInt(hex$1.slice(i, i + 2), 16);
5247
+ const hex = hexString.replace(/\s/g, "");
5248
+ const bytes = new Uint8Array(hex.length / 2);
5249
+ for (let i = 0; i < hex.length; i += 2) bytes[i / 2] = parseInt(hex.slice(i, i + 2), 16);
5250
5250
  return bytes;
5251
5251
  };
5252
5252
  /**
@@ -5255,7 +5255,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5255
5255
  * @param cbor - CBOR value to convert
5256
5256
  * @returns Hex string
5257
5257
  */
5258
- const hex = (cbor$1) => bytesToHex(cborData(cbor$1));
5258
+ const hex = (cbor) => bytesToHex(cborData(cbor));
5259
5259
  /**
5260
5260
  * Returns the encoded hexadecimal representation of CBOR with options.
5261
5261
  *
@@ -5267,9 +5267,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5267
5267
  * @param opts - Formatting options
5268
5268
  * @returns Hex string (possibly annotated)
5269
5269
  */
5270
- const hexOpt = (cbor$1, opts = {}) => {
5271
- if (opts.annotate !== true) return hex(cbor$1);
5272
- const items = dumpItems(cbor$1, 0, opts);
5270
+ const hexOpt = (cbor, opts = {}) => {
5271
+ if (opts.annotate !== true) return hex(cbor);
5272
+ const items = dumpItems(cbor, 0, opts);
5273
5273
  const roundedNoteColumn = (items.reduce((largest, item) => {
5274
5274
  return Math.max(largest, item.formatFirstColumn().length);
5275
5275
  }, 0) + 4 & -4) - 1;
@@ -5302,35 +5302,35 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5302
5302
  /**
5303
5303
  * Generate dump items for a CBOR value (recursive).
5304
5304
  */
5305
- function dumpItems(cbor$1, level, opts) {
5305
+ function dumpItems(cbor, level, opts) {
5306
5306
  const items = [];
5307
- switch (cbor$1.type) {
5307
+ switch (cbor.type) {
5308
5308
  case MajorType.Unsigned: {
5309
- const data = cborData(cbor$1);
5310
- items.push(new DumpItem(level, [data], `unsigned(${cbor$1.value})`));
5309
+ const data = cborData(cbor);
5310
+ items.push(new DumpItem(level, [data], `unsigned(${cbor.value})`));
5311
5311
  break;
5312
5312
  }
5313
5313
  case MajorType.Negative: {
5314
- const data = cborData(cbor$1);
5315
- const actualValue = typeof cbor$1.value === "bigint" ? -1n - cbor$1.value : -1 - cbor$1.value;
5314
+ const data = cborData(cbor);
5315
+ const actualValue = typeof cbor.value === "bigint" ? -1n - cbor.value : -1 - cbor.value;
5316
5316
  items.push(new DumpItem(level, [data], `negative(${actualValue})`));
5317
5317
  break;
5318
5318
  }
5319
5319
  case MajorType.ByteString: {
5320
- const header = encodeVarInt(cbor$1.value.length, MajorType.ByteString);
5321
- items.push(new DumpItem(level, [header], `bytes(${cbor$1.value.length})`));
5322
- if (cbor$1.value.length > 0) {
5320
+ const header = encodeVarInt(cbor.value.length, MajorType.ByteString);
5321
+ items.push(new DumpItem(level, [header], `bytes(${cbor.value.length})`));
5322
+ if (cbor.value.length > 0) {
5323
5323
  let note = void 0;
5324
5324
  try {
5325
- const sanitizedText = sanitized(new TextDecoder("utf-8", { fatal: true }).decode(cbor$1.value));
5325
+ const sanitizedText = sanitized(new TextDecoder("utf-8", { fatal: true }).decode(cbor.value));
5326
5326
  if (sanitizedText !== void 0 && sanitizedText !== "") note = flanked(sanitizedText, "\"", "\"");
5327
5327
  } catch {}
5328
- items.push(new DumpItem(level + 1, [cbor$1.value], note));
5328
+ items.push(new DumpItem(level + 1, [cbor.value], note));
5329
5329
  }
5330
5330
  break;
5331
5331
  }
5332
5332
  case MajorType.Text: {
5333
- const utf8Data = new TextEncoder().encode(cbor$1.value);
5333
+ const utf8Data = new TextEncoder().encode(cbor.value);
5334
5334
  const header = encodeVarInt(utf8Data.length, MajorType.Text);
5335
5335
  const firstByte = header[0];
5336
5336
  if (firstByte === void 0) throw new CborError({
@@ -5339,61 +5339,61 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5339
5339
  });
5340
5340
  const headerData = [new Uint8Array([firstByte]), header.slice(1)];
5341
5341
  items.push(new DumpItem(level, headerData, `text(${utf8Data.length})`));
5342
- items.push(new DumpItem(level + 1, [utf8Data], flanked(cbor$1.value, "\"", "\"")));
5342
+ items.push(new DumpItem(level + 1, [utf8Data], flanked(cbor.value, "\"", "\"")));
5343
5343
  break;
5344
5344
  }
5345
5345
  case MajorType.Array: {
5346
- const header = encodeVarInt(cbor$1.value.length, MajorType.Array);
5346
+ const header = encodeVarInt(cbor.value.length, MajorType.Array);
5347
5347
  const firstByte = header[0];
5348
5348
  if (firstByte === void 0) throw new CborError({
5349
5349
  type: "Custom",
5350
5350
  message: "Invalid varint encoding"
5351
5351
  });
5352
5352
  const headerData = [new Uint8Array([firstByte]), header.slice(1)];
5353
- items.push(new DumpItem(level, headerData, `array(${cbor$1.value.length})`));
5354
- for (const item of cbor$1.value) items.push(...dumpItems(item, level + 1, opts));
5353
+ items.push(new DumpItem(level, headerData, `array(${cbor.value.length})`));
5354
+ for (const item of cbor.value) items.push(...dumpItems(item, level + 1, opts));
5355
5355
  break;
5356
5356
  }
5357
5357
  case MajorType.Map: {
5358
- const header = encodeVarInt(cbor$1.value.size, MajorType.Map);
5358
+ const header = encodeVarInt(cbor.value.size, MajorType.Map);
5359
5359
  const firstByte = header[0];
5360
5360
  if (firstByte === void 0) throw new CborError({
5361
5361
  type: "Custom",
5362
5362
  message: "Invalid varint encoding"
5363
5363
  });
5364
5364
  const headerData = [new Uint8Array([firstByte]), header.slice(1)];
5365
- items.push(new DumpItem(level, headerData, `map(${cbor$1.value.size})`));
5366
- for (const entry of cbor$1.value.entriesArray) {
5365
+ items.push(new DumpItem(level, headerData, `map(${cbor.value.size})`));
5366
+ for (const entry of cbor.value.entriesArray) {
5367
5367
  items.push(...dumpItems(entry.key, level + 1, opts));
5368
5368
  items.push(...dumpItems(entry.value, level + 1, opts));
5369
5369
  }
5370
5370
  break;
5371
5371
  }
5372
5372
  case MajorType.Tagged: {
5373
- const tagValue$1 = cbor$1.tag;
5374
- if (tagValue$1 === void 0) throw new CborError({
5373
+ const tagValue = cbor.tag;
5374
+ if (tagValue === void 0) throw new CborError({
5375
5375
  type: "Custom",
5376
5376
  message: "Tagged CBOR value must have a tag"
5377
5377
  });
5378
- const header = encodeVarInt(typeof tagValue$1 === "bigint" ? Number(tagValue$1) : tagValue$1, MajorType.Tagged);
5378
+ const header = encodeVarInt(typeof tagValue === "bigint" ? Number(tagValue) : tagValue, MajorType.Tagged);
5379
5379
  const firstByte = header[0];
5380
5380
  if (firstByte === void 0) throw new CborError({
5381
5381
  type: "Custom",
5382
5382
  message: "Invalid varint encoding"
5383
5383
  });
5384
5384
  const headerData = [new Uint8Array([firstByte]), header.slice(1)];
5385
- const noteComponents = [`tag(${tagValue$1})`];
5386
- const tag = createTag(typeof tagValue$1 === "bigint" ? Number(tagValue$1) : tagValue$1);
5385
+ const noteComponents = [`tag(${tagValue})`];
5386
+ const tag = createTag(typeof tagValue === "bigint" ? Number(tagValue) : tagValue);
5387
5387
  const tagName = opts.tagsStore?.assignedNameForTag(tag);
5388
5388
  if (tagName !== void 0) noteComponents.push(tagName);
5389
5389
  const tagNote = noteComponents.join(" ");
5390
5390
  items.push(new DumpItem(level, headerData, tagNote));
5391
- items.push(...dumpItems(cbor$1.value, level + 1, opts));
5391
+ items.push(...dumpItems(cbor.value, level + 1, opts));
5392
5392
  break;
5393
5393
  }
5394
5394
  case MajorType.Simple: {
5395
- const data = cborData(cbor$1);
5396
- const simple = cbor$1.value;
5395
+ const data = cborData(cbor);
5396
+ const simple = cbor.value;
5397
5397
  let note;
5398
5398
  if (simple.type === "True") note = "true";
5399
5399
  else if (simple.type === "False") note = "false";
@@ -5449,8 +5449,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5449
5449
  * // date(1234567890)
5450
5450
  * ```
5451
5451
  */
5452
- function diagnosticOpt(cbor$1, opts) {
5453
- return formatDiagnostic(cbor$1, {
5452
+ function diagnosticOpt(cbor, opts) {
5453
+ return formatDiagnostic(cbor, {
5454
5454
  ...DEFAULT_OPTS,
5455
5455
  ...opts
5456
5456
  });
@@ -5469,8 +5469,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5469
5469
  * // For nested structures: multi-line formatted output
5470
5470
  * ```
5471
5471
  */
5472
- function diagnostic(cbor$1) {
5473
- return diagnosticOpt(cbor$1);
5472
+ function diagnostic(cbor) {
5473
+ return diagnosticOpt(cbor);
5474
5474
  }
5475
5475
  /**
5476
5476
  * Format CBOR value using custom summarizers for tagged values.
@@ -5489,8 +5489,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5489
5489
  * // "custom-summary" (instead of full content)
5490
5490
  * ```
5491
5491
  */
5492
- function summary(cbor$1) {
5493
- return diagnosticOpt(cbor$1, {
5492
+ function summary(cbor) {
5493
+ return diagnosticOpt(cbor, {
5494
5494
  summarize: true,
5495
5495
  flat: true
5496
5496
  });
@@ -5500,16 +5500,16 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5500
5500
  *
5501
5501
  * @internal
5502
5502
  */
5503
- function formatDiagnostic(cbor$1, opts) {
5504
- switch (cbor$1.type) {
5505
- case MajorType.Unsigned: return formatUnsigned(cbor$1.value);
5506
- case MajorType.Negative: return formatNegative(cbor$1.value);
5507
- case MajorType.ByteString: return formatBytes(cbor$1.value);
5508
- case MajorType.Text: return formatText(cbor$1.value);
5509
- case MajorType.Array: return formatArray(cbor$1.value, opts);
5510
- case MajorType.Map: return formatMap(cbor$1.value, opts);
5511
- case MajorType.Tagged: return formatTagged(cbor$1.tag, cbor$1.value, opts);
5512
- case MajorType.Simple: return formatSimple(cbor$1.value);
5503
+ function formatDiagnostic(cbor, opts) {
5504
+ switch (cbor.type) {
5505
+ case MajorType.Unsigned: return formatUnsigned(cbor.value);
5506
+ case MajorType.Negative: return formatNegative(cbor.value);
5507
+ case MajorType.ByteString: return formatBytes(cbor.value);
5508
+ case MajorType.Text: return formatText(cbor.value);
5509
+ case MajorType.Array: return formatArray(cbor.value, opts);
5510
+ case MajorType.Map: return formatMap(cbor.value, opts);
5511
+ case MajorType.Tagged: return formatTagged(cbor.tag, cbor.value, opts);
5512
+ case MajorType.Simple: return formatSimple(cbor.value);
5513
5513
  }
5514
5514
  }
5515
5515
  /**
@@ -5590,9 +5590,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5590
5590
  if (opts.summarize === true) {
5591
5591
  const summarizer = resolveTagsStore(opts.tags)?.summarizer(tag);
5592
5592
  if (summarizer !== void 0) {
5593
- const result$1 = summarizer(content, opts.flat ?? false);
5594
- if (result$1.ok) return result$1.value;
5595
- else return `<error: ${result$1.error.type === "Custom" ? result$1.error.message : result$1.error.type === "WrongTag" ? `expected CBOR tag ${result$1.error.expected.value}, but got ${result$1.error.actual.value}` : result$1.error.type}>`;
5593
+ const result = summarizer(content, opts.flat ?? false);
5594
+ if (result.ok) return result.value;
5595
+ else return `<error: ${result.error.type === "Custom" ? result.error.message : result.error.type === "WrongTag" ? `expected CBOR tag ${result.error.expected.value}, but got ${result.error.actual.value}` : result.error.type}>`;
5596
5596
  }
5597
5597
  }
5598
5598
  let comment;
@@ -5695,13 +5695,13 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5695
5695
  //#endregion
5696
5696
  //#region src/decode.ts
5697
5697
  function decodeCbor(data) {
5698
- const { cbor: cbor$1, len } = decodeCborInternal(new DataView(data.buffer, data.byteOffset, data.byteLength));
5698
+ const { cbor, len } = decodeCborInternal(new DataView(data.buffer, data.byteOffset, data.byteLength));
5699
5699
  const remaining = data.length - len;
5700
5700
  if (remaining !== 0) throw new CborError({
5701
5701
  type: "UnusedData",
5702
5702
  count: remaining
5703
5703
  });
5704
- return cbor$1;
5704
+ return cbor;
5705
5705
  }
5706
5706
  function parseHeader(header) {
5707
5707
  return {
@@ -5776,26 +5776,26 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5776
5776
  const { majorType, value, varIntLen } = parseHeaderVarint(data);
5777
5777
  switch (majorType) {
5778
5778
  case MajorType.Unsigned: {
5779
- const cbor$1 = attachMethods({
5779
+ const cbor = attachMethods({
5780
5780
  isCbor: true,
5781
5781
  type: MajorType.Unsigned,
5782
5782
  value
5783
5783
  });
5784
- checkCanonicalEncoding(cbor$1, new Uint8Array(data.buffer, data.byteOffset, varIntLen));
5784
+ checkCanonicalEncoding(cbor, new Uint8Array(data.buffer, data.byteOffset, varIntLen));
5785
5785
  return {
5786
- cbor: cbor$1,
5786
+ cbor,
5787
5787
  len: varIntLen
5788
5788
  };
5789
5789
  }
5790
5790
  case MajorType.Negative: {
5791
- const cbor$1 = attachMethods({
5791
+ const cbor = attachMethods({
5792
5792
  isCbor: true,
5793
5793
  type: MajorType.Negative,
5794
5794
  value
5795
5795
  });
5796
- checkCanonicalEncoding(cbor$1, new Uint8Array(data.buffer, data.byteOffset, varIntLen));
5796
+ checkCanonicalEncoding(cbor, new Uint8Array(data.buffer, data.byteOffset, varIntLen));
5797
5797
  return {
5798
- cbor: cbor$1,
5798
+ cbor,
5799
5799
  len: varIntLen
5800
5800
  };
5801
5801
  }
@@ -5851,9 +5851,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5851
5851
  for (let i = 0; i < value; i++) {
5852
5852
  const { cbor: key, len: keyLen } = decodeCborInternal(from(data, pos));
5853
5853
  pos += keyLen;
5854
- const { cbor: value$1, len: valueLen } = decodeCborInternal(from(data, pos));
5854
+ const { cbor: value, len: valueLen } = decodeCborInternal(from(data, pos));
5855
5855
  pos += valueLen;
5856
- map.setNext(key, value$1);
5856
+ map.setNext(key, value);
5857
5857
  }
5858
5858
  return {
5859
5859
  cbor: attachMethods({
@@ -5952,8 +5952,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5952
5952
  }
5953
5953
  }
5954
5954
  }
5955
- function checkCanonicalEncoding(cbor$1, buf) {
5956
- if (!areBytesEqual(buf, isCbor(cbor$1) ? cborData(cbor$1) : encodeCbor(cbor$1))) throw new CborError({ type: "NonCanonicalNumeric" });
5955
+ function checkCanonicalEncoding(cbor, buf) {
5956
+ if (!areBytesEqual(buf, isCbor(cbor) ? cborData(cbor) : encodeCbor(cbor))) throw new CborError({ type: "NonCanonicalNumeric" });
5957
5957
  }
5958
5958
 
5959
5959
  //#endregion
@@ -5970,10 +5970,10 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
5970
5970
  * Extract native JavaScript value from CBOR.
5971
5971
  * Converts CBOR types to their JavaScript equivalents.
5972
5972
  */
5973
- const extractCbor = (cbor$1) => {
5973
+ const extractCbor = (cbor) => {
5974
5974
  let c;
5975
- if (cbor$1 instanceof Uint8Array) c = decodeCbor(cbor$1);
5976
- else c = cbor$1;
5975
+ if (cbor instanceof Uint8Array) c = decodeCbor(cbor);
5976
+ else c = cbor;
5977
5977
  switch (c.type) {
5978
5978
  case MajorType.Unsigned: return c.value;
5979
5979
  case MajorType.Negative: if (typeof c.value === "bigint") return -c.value - 1n;
@@ -6004,8 +6004,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6004
6004
  * }
6005
6005
  * ```
6006
6006
  */
6007
- const isUnsigned = (cbor$1) => {
6008
- return cbor$1.type === MajorType.Unsigned;
6007
+ const isUnsigned = (cbor) => {
6008
+ return cbor.type === MajorType.Unsigned;
6009
6009
  };
6010
6010
  /**
6011
6011
  * Check if CBOR value is a negative integer.
@@ -6013,8 +6013,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6013
6013
  * @param cbor - CBOR value to check
6014
6014
  * @returns True if value is negative integer
6015
6015
  */
6016
- const isNegative = (cbor$1) => {
6017
- return cbor$1.type === MajorType.Negative;
6016
+ const isNegative = (cbor) => {
6017
+ return cbor.type === MajorType.Negative;
6018
6018
  };
6019
6019
  /**
6020
6020
  * Check if CBOR value is any integer (unsigned or negative).
@@ -6022,8 +6022,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6022
6022
  * @param cbor - CBOR value to check
6023
6023
  * @returns True if value is an integer
6024
6024
  */
6025
- const isInteger = (cbor$1) => {
6026
- return cbor$1.type === MajorType.Unsigned || cbor$1.type === MajorType.Negative;
6025
+ const isInteger = (cbor) => {
6026
+ return cbor.type === MajorType.Unsigned || cbor.type === MajorType.Negative;
6027
6027
  };
6028
6028
  /**
6029
6029
  * Check if CBOR value is a byte string.
@@ -6031,8 +6031,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6031
6031
  * @param cbor - CBOR value to check
6032
6032
  * @returns True if value is byte string
6033
6033
  */
6034
- const isBytes = (cbor$1) => {
6035
- return cbor$1.type === MajorType.ByteString;
6034
+ const isBytes = (cbor) => {
6035
+ return cbor.type === MajorType.ByteString;
6036
6036
  };
6037
6037
  /**
6038
6038
  * Check if CBOR value is a text string.
@@ -6040,8 +6040,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6040
6040
  * @param cbor - CBOR value to check
6041
6041
  * @returns True if value is text string
6042
6042
  */
6043
- const isText = (cbor$1) => {
6044
- return cbor$1.type === MajorType.Text;
6043
+ const isText = (cbor) => {
6044
+ return cbor.type === MajorType.Text;
6045
6045
  };
6046
6046
  /**
6047
6047
  * Check if CBOR value is an array.
@@ -6049,8 +6049,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6049
6049
  * @param cbor - CBOR value to check
6050
6050
  * @returns True if value is array
6051
6051
  */
6052
- const isArray = (cbor$1) => {
6053
- return cbor$1.type === MajorType.Array;
6052
+ const isArray = (cbor) => {
6053
+ return cbor.type === MajorType.Array;
6054
6054
  };
6055
6055
  /**
6056
6056
  * Check if CBOR value is a map.
@@ -6058,8 +6058,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6058
6058
  * @param cbor - CBOR value to check
6059
6059
  * @returns True if value is map
6060
6060
  */
6061
- const isMap = (cbor$1) => {
6062
- return cbor$1.type === MajorType.Map;
6061
+ const isMap = (cbor) => {
6062
+ return cbor.type === MajorType.Map;
6063
6063
  };
6064
6064
  /**
6065
6065
  * Check if CBOR value is tagged.
@@ -6067,8 +6067,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6067
6067
  * @param cbor - CBOR value to check
6068
6068
  * @returns True if value is tagged
6069
6069
  */
6070
- const isTagged = (cbor$1) => {
6071
- return cbor$1.type === MajorType.Tagged;
6070
+ const isTagged = (cbor) => {
6071
+ return cbor.type === MajorType.Tagged;
6072
6072
  };
6073
6073
  /**
6074
6074
  * Check if CBOR value is a simple value.
@@ -6076,8 +6076,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6076
6076
  * @param cbor - CBOR value to check
6077
6077
  * @returns True if value is simple
6078
6078
  */
6079
- const isSimple = (cbor$1) => {
6080
- return cbor$1.type === MajorType.Simple;
6079
+ const isSimple = (cbor) => {
6080
+ return cbor.type === MajorType.Simple;
6081
6081
  };
6082
6082
  /**
6083
6083
  * Check if CBOR value is a boolean (true or false).
@@ -6085,9 +6085,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6085
6085
  * @param cbor - CBOR value to check
6086
6086
  * @returns True if value is boolean
6087
6087
  */
6088
- const isBoolean = (cbor$1) => {
6089
- if (cbor$1.type !== MajorType.Simple) return false;
6090
- return cbor$1.value.type === "False" || cbor$1.value.type === "True";
6088
+ const isBoolean = (cbor) => {
6089
+ if (cbor.type !== MajorType.Simple) return false;
6090
+ return cbor.value.type === "False" || cbor.value.type === "True";
6091
6091
  };
6092
6092
  /**
6093
6093
  * Check if CBOR value is null.
@@ -6095,9 +6095,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6095
6095
  * @param cbor - CBOR value to check
6096
6096
  * @returns True if value is null
6097
6097
  */
6098
- const isNull = (cbor$1) => {
6099
- if (cbor$1.type !== MajorType.Simple) return false;
6100
- return cbor$1.value.type === "Null";
6098
+ const isNull = (cbor) => {
6099
+ if (cbor.type !== MajorType.Simple) return false;
6100
+ return cbor.value.type === "Null";
6101
6101
  };
6102
6102
  /**
6103
6103
  * Check if CBOR value is a float (f16, f32, or f64).
@@ -6105,9 +6105,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6105
6105
  * @param cbor - CBOR value to check
6106
6106
  * @returns True if value is float
6107
6107
  */
6108
- const isFloat = (cbor$1) => {
6109
- if (cbor$1.type !== MajorType.Simple) return false;
6110
- return isFloat$1(cbor$1.value);
6108
+ const isFloat = (cbor) => {
6109
+ if (cbor.type !== MajorType.Simple) return false;
6110
+ return isFloat$1(cbor.value);
6111
6111
  };
6112
6112
  /**
6113
6113
  * Extract unsigned integer value if type matches.
@@ -6115,8 +6115,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6115
6115
  * @param cbor - CBOR value
6116
6116
  * @returns Unsigned integer or undefined
6117
6117
  */
6118
- const asUnsigned = (cbor$1) => {
6119
- if (cbor$1.type === MajorType.Unsigned) return cbor$1.value;
6118
+ const asUnsigned = (cbor) => {
6119
+ if (cbor.type === MajorType.Unsigned) return cbor.value;
6120
6120
  };
6121
6121
  /**
6122
6122
  * Extract negative integer value if type matches.
@@ -6124,9 +6124,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6124
6124
  * @param cbor - CBOR value
6125
6125
  * @returns Negative integer or undefined
6126
6126
  */
6127
- const asNegative = (cbor$1) => {
6128
- if (cbor$1.type === MajorType.Negative) if (typeof cbor$1.value === "bigint") return -cbor$1.value - 1n;
6129
- else return -cbor$1.value - 1;
6127
+ const asNegative = (cbor) => {
6128
+ if (cbor.type === MajorType.Negative) if (typeof cbor.value === "bigint") return -cbor.value - 1n;
6129
+ else return -cbor.value - 1;
6130
6130
  };
6131
6131
  /**
6132
6132
  * Extract any integer value (unsigned or negative) if type matches.
@@ -6134,10 +6134,10 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6134
6134
  * @param cbor - CBOR value
6135
6135
  * @returns Integer or undefined
6136
6136
  */
6137
- const asInteger = (cbor$1) => {
6138
- if (cbor$1.type === MajorType.Unsigned) return cbor$1.value;
6139
- else if (cbor$1.type === MajorType.Negative) if (typeof cbor$1.value === "bigint") return -cbor$1.value - 1n;
6140
- else return -cbor$1.value - 1;
6137
+ const asInteger = (cbor) => {
6138
+ if (cbor.type === MajorType.Unsigned) return cbor.value;
6139
+ else if (cbor.type === MajorType.Negative) if (typeof cbor.value === "bigint") return -cbor.value - 1n;
6140
+ else return -cbor.value - 1;
6141
6141
  };
6142
6142
  /**
6143
6143
  * Extract byte string value if type matches.
@@ -6145,8 +6145,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6145
6145
  * @param cbor - CBOR value
6146
6146
  * @returns Byte string or undefined
6147
6147
  */
6148
- const asBytes = (cbor$1) => {
6149
- if (cbor$1.type === MajorType.ByteString) return cbor$1.value;
6148
+ const asBytes = (cbor) => {
6149
+ if (cbor.type === MajorType.ByteString) return cbor.value;
6150
6150
  };
6151
6151
  /**
6152
6152
  * Extract text string value if type matches.
@@ -6154,8 +6154,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6154
6154
  * @param cbor - CBOR value
6155
6155
  * @returns Text string or undefined
6156
6156
  */
6157
- const asText = (cbor$1) => {
6158
- if (cbor$1.type === MajorType.Text) return cbor$1.value;
6157
+ const asText = (cbor) => {
6158
+ if (cbor.type === MajorType.Text) return cbor.value;
6159
6159
  };
6160
6160
  /**
6161
6161
  * Extract array value if type matches.
@@ -6163,8 +6163,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6163
6163
  * @param cbor - CBOR value
6164
6164
  * @returns Array or undefined
6165
6165
  */
6166
- const asArray = (cbor$1) => {
6167
- if (cbor$1.type === MajorType.Array) return cbor$1.value;
6166
+ const asArray = (cbor) => {
6167
+ if (cbor.type === MajorType.Array) return cbor.value;
6168
6168
  };
6169
6169
  /**
6170
6170
  * Extract map value if type matches.
@@ -6172,8 +6172,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6172
6172
  * @param cbor - CBOR value
6173
6173
  * @returns Map or undefined
6174
6174
  */
6175
- const asMap = (cbor$1) => {
6176
- if (cbor$1.type === MajorType.Map) return cbor$1.value;
6175
+ const asMap = (cbor) => {
6176
+ if (cbor.type === MajorType.Map) return cbor.value;
6177
6177
  };
6178
6178
  /**
6179
6179
  * Extract boolean value if type matches.
@@ -6181,10 +6181,10 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6181
6181
  * @param cbor - CBOR value
6182
6182
  * @returns Boolean or undefined
6183
6183
  */
6184
- const asBoolean = (cbor$1) => {
6185
- if (cbor$1.type !== MajorType.Simple) return;
6186
- if (cbor$1.value.type === "True") return true;
6187
- if (cbor$1.value.type === "False") return false;
6184
+ const asBoolean = (cbor) => {
6185
+ if (cbor.type !== MajorType.Simple) return;
6186
+ if (cbor.value.type === "True") return true;
6187
+ if (cbor.value.type === "False") return false;
6188
6188
  };
6189
6189
  /**
6190
6190
  * Extract float value if type matches.
@@ -6192,9 +6192,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6192
6192
  * @param cbor - CBOR value
6193
6193
  * @returns Float or undefined
6194
6194
  */
6195
- const asFloat = (cbor$1) => {
6196
- if (cbor$1.type !== MajorType.Simple) return;
6197
- const simple = cbor$1.value;
6195
+ const asFloat = (cbor) => {
6196
+ if (cbor.type !== MajorType.Simple) return;
6197
+ const simple = cbor.value;
6198
6198
  if (isFloat$1(simple)) return simple.value;
6199
6199
  };
6200
6200
  /**
@@ -6203,12 +6203,12 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6203
6203
  * @param cbor - CBOR value
6204
6204
  * @returns Number or undefined
6205
6205
  */
6206
- const asNumber = (cbor$1) => {
6207
- if (cbor$1.type === MajorType.Unsigned) return cbor$1.value;
6208
- if (cbor$1.type === MajorType.Negative) if (typeof cbor$1.value === "bigint") return -cbor$1.value - 1n;
6209
- else return -cbor$1.value - 1;
6210
- if (cbor$1.type === MajorType.Simple) {
6211
- const simple = cbor$1.value;
6206
+ const asNumber = (cbor) => {
6207
+ if (cbor.type === MajorType.Unsigned) return cbor.value;
6208
+ if (cbor.type === MajorType.Negative) if (typeof cbor.value === "bigint") return -cbor.value - 1n;
6209
+ else return -cbor.value - 1;
6210
+ if (cbor.type === MajorType.Simple) {
6211
+ const simple = cbor.value;
6212
6212
  if (isFloat$1(simple)) return simple.value;
6213
6213
  }
6214
6214
  };
@@ -6219,8 +6219,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6219
6219
  * @returns Unsigned integer
6220
6220
  * @throws {CborError} With type 'WrongType' if cbor is not an unsigned integer
6221
6221
  */
6222
- const expectUnsigned = (cbor$1) => {
6223
- const value = asUnsigned(cbor$1);
6222
+ const expectUnsigned = (cbor) => {
6223
+ const value = asUnsigned(cbor);
6224
6224
  if (value === void 0) throw new CborError({ type: "WrongType" });
6225
6225
  return value;
6226
6226
  };
@@ -6231,8 +6231,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6231
6231
  * @returns Negative integer
6232
6232
  * @throws {CborError} With type 'WrongType' if cbor is not a negative integer
6233
6233
  */
6234
- const expectNegative = (cbor$1) => {
6235
- const value = asNegative(cbor$1);
6234
+ const expectNegative = (cbor) => {
6235
+ const value = asNegative(cbor);
6236
6236
  if (value === void 0) throw new CborError({ type: "WrongType" });
6237
6237
  return value;
6238
6238
  };
@@ -6243,8 +6243,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6243
6243
  * @returns Integer
6244
6244
  * @throws {CborError} With type 'WrongType' if cbor is not an integer
6245
6245
  */
6246
- const expectInteger = (cbor$1) => {
6247
- const value = asInteger(cbor$1);
6246
+ const expectInteger = (cbor) => {
6247
+ const value = asInteger(cbor);
6248
6248
  if (value === void 0) throw new CborError({ type: "WrongType" });
6249
6249
  return value;
6250
6250
  };
@@ -6255,8 +6255,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6255
6255
  * @returns Byte string
6256
6256
  * @throws {CborError} With type 'WrongType' if cbor is not a byte string
6257
6257
  */
6258
- const expectBytes = (cbor$1) => {
6259
- const value = asBytes(cbor$1);
6258
+ const expectBytes = (cbor) => {
6259
+ const value = asBytes(cbor);
6260
6260
  if (value === void 0) throw new CborError({ type: "WrongType" });
6261
6261
  return value;
6262
6262
  };
@@ -6267,8 +6267,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6267
6267
  * @returns Text string
6268
6268
  * @throws {CborError} With type 'WrongType' if cbor is not a text string
6269
6269
  */
6270
- const expectText = (cbor$1) => {
6271
- const value = asText(cbor$1);
6270
+ const expectText = (cbor) => {
6271
+ const value = asText(cbor);
6272
6272
  if (value === void 0) throw new CborError({ type: "WrongType" });
6273
6273
  return value;
6274
6274
  };
@@ -6279,8 +6279,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6279
6279
  * @returns Array
6280
6280
  * @throws {CborError} With type 'WrongType' if cbor is not an array
6281
6281
  */
6282
- const expectArray = (cbor$1) => {
6283
- const value = asArray(cbor$1);
6282
+ const expectArray = (cbor) => {
6283
+ const value = asArray(cbor);
6284
6284
  if (value === void 0) throw new CborError({ type: "WrongType" });
6285
6285
  return value;
6286
6286
  };
@@ -6291,8 +6291,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6291
6291
  * @returns Map
6292
6292
  * @throws {CborError} With type 'WrongType' if cbor is not a map
6293
6293
  */
6294
- const expectMap = (cbor$1) => {
6295
- const value = asMap(cbor$1);
6294
+ const expectMap = (cbor) => {
6295
+ const value = asMap(cbor);
6296
6296
  if (value === void 0) throw new CborError({ type: "WrongType" });
6297
6297
  return value;
6298
6298
  };
@@ -6303,8 +6303,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6303
6303
  * @returns Boolean
6304
6304
  * @throws {CborError} With type 'WrongType' if cbor is not a boolean
6305
6305
  */
6306
- const expectBoolean = (cbor$1) => {
6307
- const value = asBoolean(cbor$1);
6306
+ const expectBoolean = (cbor) => {
6307
+ const value = asBoolean(cbor);
6308
6308
  if (value === void 0) throw new CborError({ type: "WrongType" });
6309
6309
  return value;
6310
6310
  };
@@ -6315,8 +6315,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6315
6315
  * @returns Float
6316
6316
  * @throws {CborError} With type 'WrongType' if cbor is not a float
6317
6317
  */
6318
- const expectFloat = (cbor$1) => {
6319
- const value = asFloat(cbor$1);
6318
+ const expectFloat = (cbor) => {
6319
+ const value = asFloat(cbor);
6320
6320
  if (value === void 0) throw new CborError({ type: "WrongType" });
6321
6321
  return value;
6322
6322
  };
@@ -6327,8 +6327,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6327
6327
  * @returns Number
6328
6328
  * @throws {CborError} With type 'WrongType' if cbor is not a number
6329
6329
  */
6330
- const expectNumber = (cbor$1) => {
6331
- const value = asNumber(cbor$1);
6330
+ const expectNumber = (cbor) => {
6331
+ const value = asNumber(cbor);
6332
6332
  if (value === void 0) throw new CborError({ type: "WrongType" });
6333
6333
  return value;
6334
6334
  };
@@ -6339,9 +6339,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6339
6339
  * @param index - Array index
6340
6340
  * @returns Item at index or undefined
6341
6341
  */
6342
- const arrayItem = (cbor$1, index) => {
6343
- if (cbor$1.type !== MajorType.Array) return;
6344
- const array = cbor$1.value;
6342
+ const arrayItem = (cbor, index) => {
6343
+ if (cbor.type !== MajorType.Array) return;
6344
+ const array = cbor.value;
6345
6345
  if (index < 0 || index >= array.length) return;
6346
6346
  return array[index];
6347
6347
  };
@@ -6351,9 +6351,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6351
6351
  * @param cbor - CBOR value (must be array)
6352
6352
  * @returns Array length or undefined
6353
6353
  */
6354
- const arrayLength = (cbor$1) => {
6355
- if (cbor$1.type !== MajorType.Array) return;
6356
- return cbor$1.value.length;
6354
+ const arrayLength = (cbor) => {
6355
+ if (cbor.type !== MajorType.Array) return;
6356
+ return cbor.value.length;
6357
6357
  };
6358
6358
  /**
6359
6359
  * Check if array is empty.
@@ -6361,9 +6361,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6361
6361
  * @param cbor - CBOR value (must be array)
6362
6362
  * @returns True if empty, false if not empty, undefined if not array
6363
6363
  */
6364
- const arrayIsEmpty = (cbor$1) => {
6365
- if (cbor$1.type !== MajorType.Array) return;
6366
- return cbor$1.value.length === 0;
6364
+ const arrayIsEmpty = (cbor) => {
6365
+ if (cbor.type !== MajorType.Array) return;
6366
+ return cbor.value.length === 0;
6367
6367
  };
6368
6368
  /**
6369
6369
  * Get map value by key.
@@ -6372,9 +6372,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6372
6372
  * @param key - Map key
6373
6373
  * @returns Value for key or undefined
6374
6374
  */
6375
- function mapValue(cbor$1, key) {
6376
- if (cbor$1.type !== MajorType.Map) return;
6377
- return cbor$1.value.get(key);
6375
+ function mapValue(cbor, key) {
6376
+ if (cbor.type !== MajorType.Map) return;
6377
+ return cbor.value.get(key);
6378
6378
  }
6379
6379
  /**
6380
6380
  * Check if map has key.
@@ -6383,9 +6383,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6383
6383
  * @param key - Map key
6384
6384
  * @returns True if key exists, false otherwise, undefined if not map
6385
6385
  */
6386
- function mapHas(cbor$1, key) {
6387
- if (cbor$1.type !== MajorType.Map) return;
6388
- return cbor$1.value.has(key);
6386
+ function mapHas(cbor, key) {
6387
+ if (cbor.type !== MajorType.Map) return;
6388
+ return cbor.value.has(key);
6389
6389
  }
6390
6390
  /**
6391
6391
  * Get all map keys.
@@ -6393,9 +6393,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6393
6393
  * @param cbor - CBOR value (must be map)
6394
6394
  * @returns Array of keys or undefined
6395
6395
  */
6396
- const mapKeys = (cbor$1) => {
6397
- if (cbor$1.type !== MajorType.Map) return;
6398
- return cbor$1.value.entriesArray.map((e) => e.key);
6396
+ const mapKeys = (cbor) => {
6397
+ if (cbor.type !== MajorType.Map) return;
6398
+ return cbor.value.entriesArray.map((e) => e.key);
6399
6399
  };
6400
6400
  /**
6401
6401
  * Get all map values.
@@ -6403,9 +6403,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6403
6403
  * @param cbor - CBOR value (must be map)
6404
6404
  * @returns Array of values or undefined
6405
6405
  */
6406
- const mapValues = (cbor$1) => {
6407
- if (cbor$1.type !== MajorType.Map) return;
6408
- return cbor$1.value.entriesArray.map((e) => e.value);
6406
+ const mapValues = (cbor) => {
6407
+ if (cbor.type !== MajorType.Map) return;
6408
+ return cbor.value.entriesArray.map((e) => e.value);
6409
6409
  };
6410
6410
  /**
6411
6411
  * Get map size.
@@ -6413,9 +6413,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6413
6413
  * @param cbor - CBOR value (must be map)
6414
6414
  * @returns Map size or undefined
6415
6415
  */
6416
- const mapSize = (cbor$1) => {
6417
- if (cbor$1.type !== MajorType.Map) return;
6418
- return cbor$1.value.size;
6416
+ const mapSize = (cbor) => {
6417
+ if (cbor.type !== MajorType.Map) return;
6418
+ return cbor.value.size;
6419
6419
  };
6420
6420
  /**
6421
6421
  * Check if map is empty.
@@ -6423,9 +6423,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6423
6423
  * @param cbor - CBOR value (must be map)
6424
6424
  * @returns True if empty, false if not empty, undefined if not map
6425
6425
  */
6426
- const mapIsEmpty = (cbor$1) => {
6427
- if (cbor$1.type !== MajorType.Map) return;
6428
- return cbor$1.value.size === 0;
6426
+ const mapIsEmpty = (cbor) => {
6427
+ if (cbor.type !== MajorType.Map) return;
6428
+ return cbor.value.size === 0;
6429
6429
  };
6430
6430
  /**
6431
6431
  * Get tag value from tagged CBOR.
@@ -6433,9 +6433,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6433
6433
  * @param cbor - CBOR value (must be tagged)
6434
6434
  * @returns Tag value or undefined
6435
6435
  */
6436
- const tagValue = (cbor$1) => {
6437
- if (cbor$1.type !== MajorType.Tagged) return;
6438
- return cbor$1.tag;
6436
+ const tagValue = (cbor) => {
6437
+ if (cbor.type !== MajorType.Tagged) return;
6438
+ return cbor.tag;
6439
6439
  };
6440
6440
  /**
6441
6441
  * Get content from tagged CBOR.
@@ -6443,9 +6443,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6443
6443
  * @param cbor - CBOR value (must be tagged)
6444
6444
  * @returns Tagged content or undefined
6445
6445
  */
6446
- const tagContent = (cbor$1) => {
6447
- if (cbor$1.type !== MajorType.Tagged) return;
6448
- return cbor$1.value;
6446
+ const tagContent = (cbor) => {
6447
+ if (cbor.type !== MajorType.Tagged) return;
6448
+ return cbor.value;
6449
6449
  };
6450
6450
  /**
6451
6451
  * Check if CBOR has a specific tag.
@@ -6454,9 +6454,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6454
6454
  * @param tag - Tag value to check
6455
6455
  * @returns True if has tag, false otherwise
6456
6456
  */
6457
- const hasTag = (cbor$1, tag) => {
6458
- if (cbor$1.type !== MajorType.Tagged) return false;
6459
- return cbor$1.tag === tag;
6457
+ const hasTag = (cbor, tag) => {
6458
+ if (cbor.type !== MajorType.Tagged) return false;
6459
+ return cbor.tag === tag;
6460
6460
  };
6461
6461
  /**
6462
6462
  * Extract content if has specific tag.
@@ -6465,8 +6465,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6465
6465
  * @param tag - Expected tag value
6466
6466
  * @returns Tagged content or undefined
6467
6467
  */
6468
- const getTaggedContent = (cbor$1, tag) => {
6469
- if (cbor$1.type === MajorType.Tagged && cbor$1.tag === tag) return cbor$1.value;
6468
+ const getTaggedContent = (cbor, tag) => {
6469
+ if (cbor.type === MajorType.Tagged && cbor.tag === tag) return cbor.value;
6470
6470
  };
6471
6471
  /**
6472
6472
  * Extract content if has specific tag, throwing if not.
@@ -6476,8 +6476,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6476
6476
  * @returns Tagged content
6477
6477
  * @throws {CborError} With type 'WrongType' if cbor is not tagged with the expected tag
6478
6478
  */
6479
- const expectTaggedContent = (cbor$1, tag) => {
6480
- const content = getTaggedContent(cbor$1, tag);
6479
+ const expectTaggedContent = (cbor, tag) => {
6480
+ const content = getTaggedContent(cbor, tag);
6481
6481
  if (content === void 0) throw new CborError({ type: "WrongType" });
6482
6482
  return content;
6483
6483
  };
@@ -6488,12 +6488,12 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6488
6488
  * @param cbor - CBOR value
6489
6489
  * @returns [Tag, Cbor] tuple or undefined
6490
6490
  */
6491
- const asTaggedValue = (cbor$1) => {
6492
- if (cbor$1.type !== MajorType.Tagged) return;
6491
+ const asTaggedValue = (cbor) => {
6492
+ if (cbor.type !== MajorType.Tagged) return;
6493
6493
  return [{
6494
- value: cbor$1.tag,
6495
- name: `tag-${cbor$1.tag}`
6496
- }, cbor$1.value];
6494
+ value: cbor.tag,
6495
+ name: `tag-${cbor.tag}`
6496
+ }, cbor.value];
6497
6497
  };
6498
6498
  /**
6499
6499
  * Alias for asBytes - extract byte string value if type matches.
@@ -6509,9 +6509,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6509
6509
  * @param cbor - CBOR value
6510
6510
  * @returns Array wrapper with get() method or undefined
6511
6511
  */
6512
- const asCborArray = (cbor$1) => {
6513
- if (cbor$1.type !== MajorType.Array) return;
6514
- const arr = cbor$1.value;
6512
+ const asCborArray = (cbor) => {
6513
+ if (cbor.type !== MajorType.Array) return;
6514
+ const arr = cbor.value;
6515
6515
  return {
6516
6516
  length: arr.length,
6517
6517
  get(index) {
@@ -6536,9 +6536,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6536
6536
  * @param cbor - CBOR value
6537
6537
  * @returns True if value is numeric
6538
6538
  */
6539
- const isNumber = (cbor$1) => {
6540
- if (cbor$1.type === MajorType.Unsigned || cbor$1.type === MajorType.Negative) return true;
6541
- if (cbor$1.type === MajorType.Simple) return isFloat$1(cbor$1.value);
6539
+ const isNumber = (cbor) => {
6540
+ if (cbor.type === MajorType.Unsigned || cbor.type === MajorType.Negative) return true;
6541
+ if (cbor.type === MajorType.Simple) return isFloat$1(cbor.value);
6542
6542
  return false;
6543
6543
  };
6544
6544
 
@@ -6574,13 +6574,13 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6574
6574
  * encoded CBOR representation, ensuring deterministic encoding.
6575
6575
  */
6576
6576
  var CborMap = class CborMap {
6577
- #dict;
6577
+ _dict;
6578
6578
  /**
6579
6579
  * Creates a new, empty CBOR Map.
6580
6580
  * Optionally initializes from a JavaScript Map.
6581
6581
  */
6582
6582
  constructor(map) {
6583
- this.#dict = new import_sorted_map.SortedMap(null, areBytesEqual, lexicographicallyCompareBytes);
6583
+ this._dict = new import_sorted_map.SortedMap(null, areBytesEqual, lexicographicallyCompareBytes);
6584
6584
  if (map !== void 0) for (const [key, value] of map.entries()) this.set(key, value);
6585
6585
  }
6586
6586
  /**
@@ -6598,7 +6598,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6598
6598
  const keyCbor = cbor(key);
6599
6599
  const valueCbor = cbor(value);
6600
6600
  const keyData = cborData(keyCbor);
6601
- this.#dict.set(keyData, {
6601
+ this._dict.set(keyData, {
6602
6602
  key: keyCbor,
6603
6603
  value: valueCbor
6604
6604
  });
@@ -6609,7 +6609,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6609
6609
  insert(key, value) {
6610
6610
  this.set(key, value);
6611
6611
  }
6612
- #makeKey(key) {
6612
+ _makeKey(key) {
6613
6613
  return cborData(cbor(key));
6614
6614
  }
6615
6615
  /**
@@ -6618,8 +6618,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6618
6618
  * Matches Rust's Map::get().
6619
6619
  */
6620
6620
  get(key) {
6621
- const keyData = this.#makeKey(key);
6622
- const value = this.#dict.get(keyData);
6621
+ const keyData = this._makeKey(key);
6622
+ const value = this._dict.get(keyData);
6623
6623
  if (value === void 0) return;
6624
6624
  return extractCbor(value.value);
6625
6625
  }
@@ -6638,56 +6638,56 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6638
6638
  * Matches Rust's Map::contains_key().
6639
6639
  */
6640
6640
  containsKey(key) {
6641
- const keyData = this.#makeKey(key);
6642
- return this.#dict.has(keyData);
6641
+ const keyData = this._makeKey(key);
6642
+ return this._dict.has(keyData);
6643
6643
  }
6644
6644
  delete(key) {
6645
- const keyData = this.#makeKey(key);
6646
- const existed = this.#dict.has(keyData);
6647
- this.#dict.delete(keyData);
6645
+ const keyData = this._makeKey(key);
6646
+ const existed = this._dict.has(keyData);
6647
+ this._dict.delete(keyData);
6648
6648
  return existed;
6649
6649
  }
6650
6650
  has(key) {
6651
- const keyData = this.#makeKey(key);
6652
- return this.#dict.has(keyData);
6651
+ const keyData = this._makeKey(key);
6652
+ return this._dict.has(keyData);
6653
6653
  }
6654
6654
  clear() {
6655
- this.#dict = new import_sorted_map.SortedMap(null, areBytesEqual, lexicographicallyCompareBytes);
6655
+ this._dict = new import_sorted_map.SortedMap(null, areBytesEqual, lexicographicallyCompareBytes);
6656
6656
  }
6657
6657
  /**
6658
6658
  * Returns the number of entries in the map.
6659
6659
  * Matches Rust's Map::len().
6660
6660
  */
6661
6661
  get length() {
6662
- return this.#dict.length;
6662
+ return this._dict.length;
6663
6663
  }
6664
6664
  /**
6665
6665
  * Alias for length to match JavaScript Map API.
6666
6666
  * Also matches Rust's Map::len().
6667
6667
  */
6668
6668
  get size() {
6669
- return this.#dict.length;
6669
+ return this._dict.length;
6670
6670
  }
6671
6671
  /**
6672
6672
  * Returns the number of entries in the map.
6673
6673
  * Matches Rust's Map::len().
6674
6674
  */
6675
6675
  len() {
6676
- return this.#dict.length;
6676
+ return this._dict.length;
6677
6677
  }
6678
6678
  /**
6679
6679
  * Checks if the map is empty.
6680
6680
  * Matches Rust's Map::is_empty().
6681
6681
  */
6682
6682
  isEmpty() {
6683
- return this.#dict.length === 0;
6683
+ return this._dict.length === 0;
6684
6684
  }
6685
6685
  /**
6686
6686
  * Get the entries of the map as an array.
6687
6687
  * Keys are sorted in lexicographic order of their encoded CBOR bytes.
6688
6688
  */
6689
6689
  get entriesArray() {
6690
- return this.#dict.map((value, _key) => ({
6690
+ return this._dict.map((value, _key) => ({
6691
6691
  key: value.key,
6692
6692
  value: value.value
6693
6693
  }));
@@ -6714,16 +6714,16 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6714
6714
  * Matches Rust's Map::insert_next().
6715
6715
  */
6716
6716
  setNext(key, value) {
6717
- const lastEntry = this.#dict.max();
6717
+ const lastEntry = this._dict.max();
6718
6718
  if (lastEntry === void 0) {
6719
6719
  this.set(key, value);
6720
6720
  return;
6721
6721
  }
6722
6722
  const keyCbor = cbor(key);
6723
6723
  const newKey = cborData(keyCbor);
6724
- if (this.#dict.has(newKey)) throw new CborError({ type: "DuplicateMapKey" });
6725
- if (lexicographicallyCompareBytes(newKey, this.#makeKey(lastEntry.key)) <= 0) throw new CborError({ type: "MisorderedMapKey" });
6726
- this.#dict.set(newKey, {
6724
+ if (this._dict.has(newKey)) throw new CborError({ type: "DuplicateMapKey" });
6725
+ if (lexicographicallyCompareBytes(newKey, this._makeKey(lastEntry.key)) <= 0) throw new CborError({ type: "MisorderedMapKey" });
6726
+ this._dict.set(newKey, {
6727
6727
  key: keyCbor,
6728
6728
  value: cbor(value)
6729
6729
  });
@@ -6739,17 +6739,17 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6739
6739
  const valueDebug = CborMap.formatDebug(entry.value);
6740
6740
  return `0x${bytesToHex(encodeCbor(entry.key))}: (${keyDebug}, ${valueDebug})`;
6741
6741
  }
6742
- static formatDebug(cbor$1) {
6743
- switch (cbor$1.type) {
6744
- case MajorType.Unsigned: return `unsigned(${cbor$1.value})`;
6745
- case MajorType.Negative: return `negative(${typeof cbor$1.value === "bigint" ? -cbor$1.value - 1n : -cbor$1.value - 1})`;
6746
- case MajorType.ByteString: return `bytes(${bytesToHex(cbor$1.value)})`;
6747
- case MajorType.Text: return `text("${cbor$1.value}")`;
6748
- case MajorType.Array: return `array([${cbor$1.value.map(CborMap.formatDebug).join(", ")}])`;
6749
- case MajorType.Map: return cbor$1.value.debug;
6750
- case MajorType.Tagged: return `tagged(${cbor$1.tag}, ${CborMap.formatDebug(cbor$1.value)})`;
6742
+ static formatDebug(cbor) {
6743
+ switch (cbor.type) {
6744
+ case MajorType.Unsigned: return `unsigned(${cbor.value})`;
6745
+ case MajorType.Negative: return `negative(${typeof cbor.value === "bigint" ? -cbor.value - 1n : -cbor.value - 1})`;
6746
+ case MajorType.ByteString: return `bytes(${bytesToHex(cbor.value)})`;
6747
+ case MajorType.Text: return `text("${cbor.value}")`;
6748
+ case MajorType.Array: return `array([${cbor.value.map(CborMap.formatDebug).join(", ")}])`;
6749
+ case MajorType.Map: return cbor.value.debug;
6750
+ case MajorType.Tagged: return `tagged(${cbor.tag}, ${CborMap.formatDebug(cbor.value)})`;
6751
6751
  case MajorType.Simple: {
6752
- const simple = cbor$1.value;
6752
+ const simple = cbor.value;
6753
6753
  if (typeof simple === "object" && simple !== null && "type" in simple) switch (simple.type) {
6754
6754
  case "True": return "simple(true)";
6755
6755
  case "False": return "simple(false)";
@@ -6758,7 +6758,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6758
6758
  }
6759
6759
  return "simple";
6760
6760
  }
6761
- default: return diagnostic(cbor$1);
6761
+ default: return diagnostic(cbor);
6762
6762
  }
6763
6763
  }
6764
6764
  static entryDiagnostic(entry) {
@@ -6787,20 +6787,20 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6787
6787
  /**
6788
6788
  * Types of edges in the CBOR tree traversal.
6789
6789
  */
6790
- let EdgeType = /* @__PURE__ */ function(EdgeType$1) {
6790
+ let EdgeType = /* @__PURE__ */ function(EdgeType) {
6791
6791
  /** No specific edge type (root element) */
6792
- EdgeType$1["None"] = "none";
6792
+ EdgeType["None"] = "none";
6793
6793
  /** Element within an array */
6794
- EdgeType$1["ArrayElement"] = "array_element";
6794
+ EdgeType["ArrayElement"] = "array_element";
6795
6795
  /** Key-value pair in a map (semantic unit) */
6796
- EdgeType$1["MapKeyValue"] = "map_key_value";
6796
+ EdgeType["MapKeyValue"] = "map_key_value";
6797
6797
  /** Key within a map */
6798
- EdgeType$1["MapKey"] = "map_key";
6798
+ EdgeType["MapKey"] = "map_key";
6799
6799
  /** Value within a map */
6800
- EdgeType$1["MapValue"] = "map_value";
6800
+ EdgeType["MapValue"] = "map_value";
6801
6801
  /** Content of a tagged value */
6802
- EdgeType$1["TaggedContent"] = "tagged_content";
6803
- return EdgeType$1;
6802
+ EdgeType["TaggedContent"] = "tagged_content";
6803
+ return EdgeType;
6804
6804
  }({});
6805
6805
  /**
6806
6806
  * Returns a short text label for the edge type, or undefined if no label is needed.
@@ -6911,35 +6911,35 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6911
6911
  * });
6912
6912
  * ```
6913
6913
  */
6914
- const walk = (cbor$1, initialState, visitor) => {
6915
- walkInternal(cbor$1, 0, { type: EdgeType.None }, initialState, visitor);
6914
+ const walk = (cbor, initialState, visitor) => {
6915
+ walkInternal(cbor, 0, { type: EdgeType.None }, initialState, visitor);
6916
6916
  };
6917
6917
  /**
6918
6918
  * Internal recursive walk implementation.
6919
6919
  *
6920
6920
  * @internal
6921
6921
  */
6922
- function walkInternal(cbor$1, level, edge, state, visitor, skipVisit = false) {
6922
+ function walkInternal(cbor, level, edge, state, visitor, skipVisit = false) {
6923
6923
  let currentState = state;
6924
6924
  let stopDescent = false;
6925
6925
  if (!skipVisit) {
6926
6926
  const [newState, stop] = visitor({
6927
6927
  type: "single",
6928
- cbor: cbor$1
6928
+ cbor
6929
6929
  }, level, edge, currentState);
6930
6930
  currentState = newState;
6931
6931
  stopDescent = stop;
6932
6932
  if (stopDescent) return currentState;
6933
6933
  }
6934
- switch (cbor$1.type) {
6934
+ switch (cbor.type) {
6935
6935
  case MajorType.Array:
6936
- currentState = walkArray(cbor$1, level, currentState, visitor);
6936
+ currentState = walkArray(cbor, level, currentState, visitor);
6937
6937
  break;
6938
6938
  case MajorType.Map:
6939
- currentState = walkMap(cbor$1, level, currentState, visitor);
6939
+ currentState = walkMap(cbor, level, currentState, visitor);
6940
6940
  break;
6941
6941
  case MajorType.Tagged:
6942
- currentState = walkTagged(cbor$1, level, currentState, visitor);
6942
+ currentState = walkTagged(cbor, level, currentState, visitor);
6943
6943
  break;
6944
6944
  default: break;
6945
6945
  }
@@ -6950,10 +6950,10 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6950
6950
  *
6951
6951
  * @internal
6952
6952
  */
6953
- function walkArray(cbor$1, level, state, visitor) {
6953
+ function walkArray(cbor, level, state, visitor) {
6954
6954
  let currentState = state;
6955
- for (let index = 0; index < cbor$1.value.length; index++) {
6956
- const item = cbor$1.value[index];
6955
+ for (let index = 0; index < cbor.value.length; index++) {
6956
+ const item = cbor.value[index];
6957
6957
  if (item === void 0) throw new CborError({
6958
6958
  type: "Custom",
6959
6959
  message: `Array element at index ${index} is undefined`
@@ -6975,9 +6975,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6975
6975
  *
6976
6976
  * @internal
6977
6977
  */
6978
- function walkMap(cbor$1, level, state, visitor) {
6978
+ function walkMap(cbor, level, state, visitor) {
6979
6979
  let currentState = state;
6980
- for (const entry of cbor$1.value.entriesArray) {
6980
+ for (const entry of cbor.value.entriesArray) {
6981
6981
  const { key, value } = entry;
6982
6982
  const [kvState, kvStop] = visitor({
6983
6983
  type: "keyvalue",
@@ -6997,8 +6997,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
6997
6997
  *
6998
6998
  * @internal
6999
6999
  */
7000
- function walkTagged(cbor$1, level, state, visitor) {
7001
- return walkInternal(cbor$1.value, level + 1, { type: EdgeType.TaggedContent }, state, visitor);
7000
+ function walkTagged(cbor, level, state, visitor) {
7001
+ return walkInternal(cbor.value, level + 1, { type: EdgeType.TaggedContent }, state, visitor);
7002
7002
  }
7003
7003
 
7004
7004
  //#endregion
@@ -7208,7 +7208,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
7208
7208
  }
7209
7209
  case MajorType.Map: {
7210
7210
  const entries = c.value.entriesArray;
7211
- const flatArrayBytes = concatBytes(entries.map(({ key, value: value$1 }) => concatBytes([cborData(key), cborData(value$1)])));
7211
+ const flatArrayBytes = concatBytes(entries.map(({ key, value }) => concatBytes([cborData(key), cborData(value)])));
7212
7212
  const lengthBytes = encodeVarInt(entries.length, MajorType.Map);
7213
7213
  return new Uint8Array([...lengthBytes, ...flatArrayBytes]);
7214
7214
  }
@@ -7230,15 +7230,15 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
7230
7230
  const toByteString = (data) => {
7231
7231
  return cbor(data);
7232
7232
  };
7233
- const toByteStringFromHex = (hex$1) => {
7234
- return toByteString(hexToBytes(hex$1));
7233
+ const toByteStringFromHex = (hex) => {
7234
+ return toByteString(hexToBytes(hex));
7235
7235
  };
7236
7236
  const toTaggedValue = (tag, item) => {
7237
- const tagValue$1 = typeof tag === "object" && "value" in tag ? tag.value : tag;
7237
+ const tagValue = typeof tag === "object" && "value" in tag ? tag.value : tag;
7238
7238
  return attachMethods({
7239
7239
  isCbor: true,
7240
7240
  type: MajorType.Tagged,
7241
- tag: tagValue$1,
7241
+ tag: tagValue,
7242
7242
  value: cbor(item)
7243
7243
  });
7244
7244
  };
@@ -7419,11 +7419,11 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
7419
7419
  validateTag(expectedTags) {
7420
7420
  if (this.type !== MajorType.Tagged) throw new CborError({ type: "WrongType" });
7421
7421
  const expectedValues = expectedTags.map((t) => t.value);
7422
- const tagValue$1 = this.tag;
7423
- const matchingTag = expectedTags.find((t) => t.value === tagValue$1);
7422
+ const tagValue = this.tag;
7423
+ const matchingTag = expectedTags.find((t) => t.value === tagValue);
7424
7424
  if (matchingTag === void 0) throw new CborError({
7425
7425
  type: "Custom",
7426
- message: `Wrong tag: expected ${expectedValues.join(" or ")}, got ${tagValue$1}`
7426
+ message: `Wrong tag: expected ${expectedValues.join(" or ")}, got ${tagValue}`
7427
7427
  });
7428
7428
  return matchingTag;
7429
7429
  },
@@ -7469,8 +7469,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
7469
7469
  tryFromData(data) {
7470
7470
  return decodeCbor(data);
7471
7471
  },
7472
- tryFromHex(hex$1) {
7473
- const data = hexToBytes(hex$1);
7472
+ tryFromHex(hex) {
7473
+ const data = hexToBytes(hex);
7474
7474
  return this.tryFromData(data);
7475
7475
  }
7476
7476
  };
@@ -7543,14 +7543,14 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
7543
7543
  * @returns The matching tag
7544
7544
  * @throws Error if the value is not tagged or has an unexpected tag
7545
7545
  */
7546
- const validateTag = (cbor$1, expectedTags) => {
7547
- if (cbor$1.type !== MajorType.Tagged) throw new CborError({ type: "WrongType" });
7546
+ const validateTag = (cbor, expectedTags) => {
7547
+ if (cbor.type !== MajorType.Tagged) throw new CborError({ type: "WrongType" });
7548
7548
  const expectedValues = expectedTags.map((t) => t.value);
7549
- const tagValue$1 = cbor$1.tag;
7550
- const matchingTag = expectedTags.find((t) => t.value === tagValue$1);
7549
+ const tagValue = cbor.tag;
7550
+ const matchingTag = expectedTags.find((t) => t.value === tagValue);
7551
7551
  if (matchingTag === void 0) throw new CborError({
7552
7552
  type: "Custom",
7553
- message: `Wrong tag: expected ${expectedValues.join(" or ")}, got ${tagValue$1}`
7553
+ message: `Wrong tag: expected ${expectedValues.join(" or ")}, got ${tagValue}`
7554
7554
  });
7555
7555
  return matchingTag;
7556
7556
  };
@@ -7561,9 +7561,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
7561
7561
  * @returns The untagged content
7562
7562
  * @throws Error if the value is not tagged
7563
7563
  */
7564
- const extractTaggedContent = (cbor$1) => {
7565
- if (cbor$1.type !== MajorType.Tagged) throw new CborError({ type: "WrongType" });
7566
- return cbor$1.value;
7564
+ const extractTaggedContent = (cbor) => {
7565
+ if (cbor.type !== MajorType.Tagged) throw new CborError({ type: "WrongType" });
7566
+ return cbor.value;
7567
7567
  };
7568
7568
 
7569
7569
  //#endregion
@@ -7622,7 +7622,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
7622
7622
  * ```
7623
7623
  */
7624
7624
  var CborDate = class CborDate {
7625
- #datetime;
7625
+ _datetime;
7626
7626
  /**
7627
7627
  * Creates a new `CborDate` from the given JavaScript `Date`.
7628
7628
  *
@@ -7641,7 +7641,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
7641
7641
  */
7642
7642
  static fromDatetime(dateTime) {
7643
7643
  const instance = new CborDate();
7644
- instance.#datetime = new Date(dateTime);
7644
+ instance._datetime = new Date(dateTime);
7645
7645
  return instance;
7646
7646
  }
7647
7647
  /**
@@ -7805,7 +7805,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
7805
7805
  * ```
7806
7806
  */
7807
7807
  datetime() {
7808
- return new Date(this.#datetime);
7808
+ return new Date(this._datetime);
7809
7809
  }
7810
7810
  /**
7811
7811
  * Returns the `CborDate` as the number of seconds since the Unix epoch.
@@ -7824,7 +7824,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
7824
7824
  * ```
7825
7825
  */
7826
7826
  timestamp() {
7827
- return Math.trunc(this.#datetime.getTime() / 1e3) + this.#datetime.getTime() % 1e3 / 1e3;
7827
+ return Math.trunc(this._datetime.getTime() / 1e3) + this._datetime.getTime() % 1e3 / 1e3;
7828
7828
  }
7829
7829
  /**
7830
7830
  * Add seconds to this date.
@@ -7922,18 +7922,18 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
7922
7922
  *
7923
7923
  * @throws Error if the CBOR value is not a valid timestamp
7924
7924
  */
7925
- fromUntaggedCbor(cbor$1) {
7925
+ fromUntaggedCbor(cbor) {
7926
7926
  let timestamp;
7927
- switch (cbor$1.type) {
7927
+ switch (cbor.type) {
7928
7928
  case MajorType.Unsigned:
7929
- timestamp = typeof cbor$1.value === "number" ? cbor$1.value : Number(cbor$1.value);
7929
+ timestamp = typeof cbor.value === "number" ? cbor.value : Number(cbor.value);
7930
7930
  break;
7931
7931
  case MajorType.Negative:
7932
- if (typeof cbor$1.value === "bigint") timestamp = Number(-cbor$1.value - 1n);
7933
- else timestamp = -cbor$1.value - 1;
7932
+ if (typeof cbor.value === "bigint") timestamp = Number(-cbor.value - 1n);
7933
+ else timestamp = -cbor.value - 1;
7934
7934
  break;
7935
7935
  case MajorType.Simple:
7936
- if (cbor$1.value.type === "Float") timestamp = cbor$1.value.value;
7936
+ if (cbor.value.type === "Float") timestamp = cbor.value.value;
7937
7937
  else throw new CborError({
7938
7938
  type: "Custom",
7939
7939
  message: "Invalid date CBOR: expected numeric value"
@@ -7944,7 +7944,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
7944
7944
  message: "Invalid date CBOR: expected numeric value"
7945
7945
  });
7946
7946
  }
7947
- this.#datetime = CborDate.fromTimestamp(timestamp).#datetime;
7947
+ this._datetime = CborDate.fromTimestamp(timestamp)._datetime;
7948
7948
  return this;
7949
7949
  }
7950
7950
  /**
@@ -7956,9 +7956,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
7956
7956
  *
7957
7957
  * @throws Error if the CBOR value has the wrong tag or cannot be decoded
7958
7958
  */
7959
- fromTaggedCbor(cbor$1) {
7960
- validateTag(cbor$1, this.cborTags());
7961
- const content = extractTaggedContent(cbor$1);
7959
+ fromTaggedCbor(cbor) {
7960
+ validateTag(cbor, this.cborTags());
7961
+ const content = extractTaggedContent(cbor);
7962
7962
  return this.fromUntaggedCbor(content);
7963
7963
  }
7964
7964
  /**
@@ -7967,8 +7967,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
7967
7967
  * @param cbor - Tagged CBOR value
7968
7968
  * @returns New CborDate instance
7969
7969
  */
7970
- static fromTaggedCbor(cbor$1) {
7971
- return new CborDate().fromTaggedCbor(cbor$1);
7970
+ static fromTaggedCbor(cbor) {
7971
+ return new CborDate().fromTaggedCbor(cbor);
7972
7972
  }
7973
7973
  /**
7974
7974
  * Static method to create a CborDate from untagged CBOR.
@@ -7976,8 +7976,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
7976
7976
  * @param cbor - Untagged CBOR value
7977
7977
  * @returns New CborDate instance
7978
7978
  */
7979
- static fromUntaggedCbor(cbor$1) {
7980
- return new CborDate().fromUntaggedCbor(cbor$1);
7979
+ static fromUntaggedCbor(cbor) {
7980
+ return new CborDate().fromUntaggedCbor(cbor);
7981
7981
  }
7982
7982
  /**
7983
7983
  * Implementation of the `toString` method for `CborDate`.
@@ -8002,7 +8002,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8002
8002
  * ```
8003
8003
  */
8004
8004
  toString() {
8005
- const dt = this.#datetime;
8005
+ const dt = this._datetime;
8006
8006
  if (!(dt.getUTCHours() !== 0 || dt.getUTCMinutes() !== 0 || dt.getUTCSeconds() !== 0)) {
8007
8007
  const datePart = dt.toISOString().split("T")[0];
8008
8008
  if (datePart === void 0) throw new CborError({
@@ -8019,7 +8019,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8019
8019
  * @returns true if dates represent the same moment in time
8020
8020
  */
8021
8021
  equals(other) {
8022
- return this.#datetime.getTime() === other.#datetime.getTime();
8022
+ return this._datetime.getTime() === other._datetime.getTime();
8023
8023
  }
8024
8024
  /**
8025
8025
  * Compare two dates.
@@ -8028,8 +8028,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8028
8028
  * @returns -1 if this < other, 0 if equal, 1 if this > other
8029
8029
  */
8030
8030
  compare(other) {
8031
- const thisTime = this.#datetime.getTime();
8032
- const otherTime = other.#datetime.getTime();
8031
+ const thisTime = this._datetime.getTime();
8032
+ const otherTime = other._datetime.getTime();
8033
8033
  if (thisTime < otherTime) return -1;
8034
8034
  if (thisTime > otherTime) return 1;
8035
8035
  return 0;
@@ -8043,7 +8043,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8043
8043
  return this.toString();
8044
8044
  }
8045
8045
  constructor() {
8046
- this.#datetime = /* @__PURE__ */ new Date();
8046
+ this._datetime = /* @__PURE__ */ new Date();
8047
8047
  }
8048
8048
  };
8049
8049
 
@@ -8249,9 +8249,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8249
8249
  * ```
8250
8250
  */
8251
8251
  var CborSet = class CborSet {
8252
- #map;
8252
+ _map;
8253
8253
  constructor() {
8254
- this.#map = new CborMap();
8254
+ this._map = new CborMap();
8255
8255
  }
8256
8256
  /**
8257
8257
  * Create CborSet from array.
@@ -8313,7 +8313,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8313
8313
  */
8314
8314
  insert(value) {
8315
8315
  const cborValue = encodeCborValue(value);
8316
- this.#map.set(cborValue, cborValue);
8316
+ this._map.set(cborValue, cborValue);
8317
8317
  }
8318
8318
  /**
8319
8319
  * Check if set contains an element.
@@ -8330,7 +8330,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8330
8330
  */
8331
8331
  contains(value) {
8332
8332
  const cborValue = encodeCborValue(value);
8333
- return this.#map.has(cborValue);
8333
+ return this._map.has(cborValue);
8334
8334
  }
8335
8335
  /**
8336
8336
  * Remove an element from the set.
@@ -8347,13 +8347,13 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8347
8347
  */
8348
8348
  delete(value) {
8349
8349
  const cborValue = encodeCborValue(value);
8350
- return this.#map.delete(cborValue);
8350
+ return this._map.delete(cborValue);
8351
8351
  }
8352
8352
  /**
8353
8353
  * Remove all elements from the set.
8354
8354
  */
8355
8355
  clear() {
8356
- this.#map.clear();
8356
+ this._map.clear();
8357
8357
  }
8358
8358
  /**
8359
8359
  * Get the number of elements in the set.
@@ -8361,7 +8361,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8361
8361
  * @returns Number of elements
8362
8362
  */
8363
8363
  get size() {
8364
- return this.#map.size;
8364
+ return this._map.size;
8365
8365
  }
8366
8366
  /**
8367
8367
  * Check if the set is empty.
@@ -8369,7 +8369,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8369
8369
  * @returns true if set has no elements
8370
8370
  */
8371
8371
  isEmpty() {
8372
- return this.#map.size === 0;
8372
+ return this._map.size === 0;
8373
8373
  }
8374
8374
  /**
8375
8375
  * Create a new set containing elements in this set or the other set.
@@ -8468,7 +8468,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8468
8468
  * ```
8469
8469
  */
8470
8470
  *[Symbol.iterator]() {
8471
- for (const [_, value] of this.#map) yield value;
8471
+ for (const [_, value] of this._map) yield value;
8472
8472
  }
8473
8473
  /**
8474
8474
  * Get all values as an array.
@@ -8526,8 +8526,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8526
8526
  * @param cbor - Tagged CBOR value with tag(258)
8527
8527
  * @returns Decoded CborSet instance
8528
8528
  */
8529
- static fromTaggedCborStatic(cbor$1) {
8530
- return new CborSet().fromTaggedCbor(cbor$1);
8529
+ static fromTaggedCborStatic(cbor) {
8530
+ return new CborSet().fromTaggedCbor(cbor);
8531
8531
  }
8532
8532
  /**
8533
8533
  * Convert to CBOR array (untagged).
@@ -8659,7 +8659,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8659
8659
  * ```
8660
8660
  */
8661
8661
  var ByteString = class ByteString {
8662
- #data;
8662
+ _data;
8663
8663
  /**
8664
8664
  * Creates a new `ByteString` from a Uint8Array or array of bytes.
8665
8665
  *
@@ -8675,8 +8675,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8675
8675
  * ```
8676
8676
  */
8677
8677
  constructor(data) {
8678
- if (Array.isArray(data)) this.#data = new Uint8Array(data);
8679
- else this.#data = new Uint8Array(data);
8678
+ if (Array.isArray(data)) this._data = new Uint8Array(data);
8679
+ else this._data = new Uint8Array(data);
8680
8680
  }
8681
8681
  /**
8682
8682
  * Creates a new `ByteString` from various input types.
@@ -8710,7 +8710,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8710
8710
  * ```
8711
8711
  */
8712
8712
  data() {
8713
- return this.#data;
8713
+ return this._data;
8714
8714
  }
8715
8715
  /**
8716
8716
  * Returns the length of the byte string in bytes.
@@ -8727,7 +8727,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8727
8727
  * ```
8728
8728
  */
8729
8729
  len() {
8730
- return this.#data.length;
8730
+ return this._data.length;
8731
8731
  }
8732
8732
  /**
8733
8733
  * Returns `true` if the byte string contains no bytes.
@@ -8744,7 +8744,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8744
8744
  * ```
8745
8745
  */
8746
8746
  isEmpty() {
8747
- return this.#data.length === 0;
8747
+ return this._data.length === 0;
8748
8748
  }
8749
8749
  /**
8750
8750
  * Extends the byte string with additional bytes.
@@ -8764,10 +8764,10 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8764
8764
  */
8765
8765
  extend(other) {
8766
8766
  const otherArray = Array.isArray(other) ? new Uint8Array(other) : other;
8767
- const newData = new Uint8Array(this.#data.length + otherArray.length);
8768
- newData.set(this.#data, 0);
8769
- newData.set(otherArray, this.#data.length);
8770
- this.#data = newData;
8767
+ const newData = new Uint8Array(this._data.length + otherArray.length);
8768
+ newData.set(this._data, 0);
8769
+ newData.set(otherArray, this._data.length);
8770
+ this._data = newData;
8771
8771
  }
8772
8772
  /**
8773
8773
  * Creates a new Uint8Array containing a copy of the byte string's data.
@@ -8787,7 +8787,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8787
8787
  * ```
8788
8788
  */
8789
8789
  toUint8Array() {
8790
- return new Uint8Array(this.#data);
8790
+ return new Uint8Array(this._data);
8791
8791
  }
8792
8792
  /**
8793
8793
  * Returns an iterator over the bytes in the byte string.
@@ -8813,7 +8813,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8813
8813
  * ```
8814
8814
  */
8815
8815
  iter() {
8816
- return this.#data.values();
8816
+ return this._data.values();
8817
8817
  }
8818
8818
  /**
8819
8819
  * Makes ByteString iterable.
@@ -8833,7 +8833,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8833
8833
  * ```
8834
8834
  */
8835
8835
  toCbor() {
8836
- return cbor(this.#data);
8836
+ return cbor(this._data);
8837
8837
  }
8838
8838
  /**
8839
8839
  * Attempts to convert a CBOR value into a ByteString.
@@ -8857,9 +8857,9 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8857
8857
  * }
8858
8858
  * ```
8859
8859
  */
8860
- static fromCbor(cbor$1) {
8861
- if (cbor$1.type !== MajorType.ByteString) throw new CborError({ type: "WrongType" });
8862
- return new ByteString(cbor$1.value);
8860
+ static fromCbor(cbor) {
8861
+ if (cbor.type !== MajorType.ByteString) throw new CborError({ type: "WrongType" });
8862
+ return new ByteString(cbor.value);
8863
8863
  }
8864
8864
  /**
8865
8865
  * Get element at index.
@@ -8868,7 +8868,7 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8868
8868
  * @returns Byte at index or undefined
8869
8869
  */
8870
8870
  at(index) {
8871
- return this.#data[index];
8871
+ return this._data[index];
8872
8872
  }
8873
8873
  /**
8874
8874
  * Equality comparison.
@@ -8877,8 +8877,8 @@ var import_byte_data = /* @__PURE__ */ __toESM(require_byte_data());
8877
8877
  * @returns true if equal
8878
8878
  */
8879
8879
  equals(other) {
8880
- if (this.#data.length !== other.#data.length) return false;
8881
- for (let i = 0; i < this.#data.length; i++) if (this.#data[i] !== other.#data[i]) return false;
8880
+ if (this._data.length !== other._data.length) return false;
8881
+ for (let i = 0; i < this._data.length; i++) if (this._data[i] !== other._data[i]) return false;
8882
8882
  return true;
8883
8883
  }
8884
8884
  /**