@dereekb/util 13.4.0 → 13.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/fetch/index.cjs.js +191 -109
  2. package/fetch/index.esm.js +191 -109
  3. package/fetch/package.json +2 -2
  4. package/fetch/src/lib/error.d.ts +6 -0
  5. package/fetch/src/lib/fetch.d.ts +37 -0
  6. package/fetch/src/lib/fetch.file.d.ts +7 -5
  7. package/fetch/src/lib/fetch.limit.d.ts +7 -0
  8. package/fetch/src/lib/fetch.url.d.ts +6 -3
  9. package/fetch/src/lib/json.d.ts +12 -1
  10. package/fetch/src/lib/timeout.d.ts +8 -0
  11. package/fetch/src/lib/url.d.ts +33 -0
  12. package/index.cjs.js +1419 -778
  13. package/index.esm.js +1419 -779
  14. package/package.json +1 -1
  15. package/src/lib/array/array.boolean.d.ts +7 -0
  16. package/src/lib/array/array.filter.d.ts +4 -4
  17. package/src/lib/array/array.index.d.ts +3 -1
  18. package/src/lib/array/array.indexed.d.ts +9 -3
  19. package/src/lib/array/array.limit.d.ts +2 -0
  20. package/src/lib/assertion/assert.d.ts +3 -0
  21. package/src/lib/assertion/assert.error.d.ts +6 -0
  22. package/src/lib/boolean.d.ts +3 -0
  23. package/src/lib/date/expires.d.ts +3 -3
  24. package/src/lib/date/minute.d.ts +14 -8
  25. package/src/lib/date/time.d.ts +3 -0
  26. package/src/lib/error/error.server.d.ts +1 -0
  27. package/src/lib/file/pdf.d.ts +1 -1
  28. package/src/lib/getter/getter.cache.d.ts +1 -1
  29. package/src/lib/grouping.d.ts +11 -2
  30. package/src/lib/map/map.key.d.ts +1 -1
  31. package/src/lib/model/model.d.ts +14 -9
  32. package/src/lib/number/dollar.d.ts +8 -0
  33. package/src/lib/number/number.d.ts +4 -0
  34. package/src/lib/object/object.d.ts +3 -0
  35. package/src/lib/object/object.equal.d.ts +2 -2
  36. package/src/lib/object/object.filter.pojo.d.ts +7 -0
  37. package/src/lib/object/object.filter.tuple.d.ts +2 -0
  38. package/src/lib/object/object.map.d.ts +1 -1
  39. package/src/lib/path/path.d.ts +4 -2
  40. package/src/lib/promise/poll.d.ts +3 -0
  41. package/src/lib/promise/promise.d.ts +19 -7
  42. package/src/lib/promise/promise.loop.d.ts +27 -9
  43. package/src/lib/relation/relation.d.ts +12 -0
  44. package/src/lib/service/handler.config.d.ts +3 -1
  45. package/src/lib/service/handler.d.ts +6 -2
  46. package/src/lib/service/typed.service.d.ts +3 -1
  47. package/src/lib/set/set.d.ts +32 -19
  48. package/src/lib/set/set.hashset.d.ts +3 -1
  49. package/src/lib/sort.d.ts +11 -0
  50. package/src/lib/storage/storage.error.d.ts +3 -0
  51. package/src/lib/storage/storage.memory.d.ts +7 -0
  52. package/src/lib/storage/storage.object.d.ts +5 -0
  53. package/src/lib/string/dencoder.d.ts +4 -1
  54. package/src/lib/string/mimetype.d.ts +57 -19
  55. package/src/lib/string/transform.d.ts +10 -1
  56. package/src/lib/string/tree.d.ts +18 -6
  57. package/src/lib/string/url.d.ts +57 -19
  58. package/src/lib/tree/tree.d.ts +12 -4
  59. package/src/lib/tree/tree.flatten.d.ts +3 -1
  60. package/src/lib/value/address.d.ts +24 -7
  61. package/src/lib/value/bound.d.ts +3 -0
  62. package/src/lib/value/build.d.ts +3 -0
  63. package/src/lib/value/comparator.d.ts +4 -0
  64. package/src/lib/value/cron.d.ts +1 -0
  65. package/src/lib/value/decision.d.ts +3 -0
  66. package/src/lib/value/equal.d.ts +3 -0
  67. package/src/lib/value/indexed.d.ts +4 -0
  68. package/src/lib/value/label.d.ts +1 -0
  69. package/src/lib/value/map.d.ts +9 -0
  70. package/src/lib/value/maybe.d.ts +13 -0
  71. package/src/lib/value/modifier.d.ts +9 -0
  72. package/src/lib/value/point.d.ts +3 -0
  73. package/src/lib/value/url.d.ts +1 -0
  74. package/src/lib/value/vector.d.ts +5 -0
  75. package/test/index.cjs.js +29 -6
  76. package/test/index.esm.js +29 -6
  77. package/test/package.json +2 -2
  78. package/test/src/lib/jest/jest.fail.d.ts +3 -3
  79. package/test/src/lib/shared/shared.d.ts +7 -1
  80. package/test/src/lib/shared/shared.fail.d.ts +8 -2
  81. package/test/src/lib/shared/shared.wrap.d.ts +1 -0
package/index.cjs.js CHANGED
@@ -3,6 +3,35 @@
3
3
  var extraSet = require('extra-set');
4
4
  var makeError = require('make-error');
5
5
 
6
+ function _array_like_to_array$C(arr, len) {
7
+ if (len == null || len > arr.length) len = arr.length;
8
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
9
+ return arr2;
10
+ }
11
+ function _array_without_holes$r(arr) {
12
+ if (Array.isArray(arr)) return _array_like_to_array$C(arr);
13
+ }
14
+ function _iterable_to_array$r(iter) {
15
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
16
+ }
17
+ function _non_iterable_spread$r() {
18
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
19
+ }
20
+ function _to_consumable_array$r(arr) {
21
+ return _array_without_holes$r(arr) || _iterable_to_array$r(arr) || _unsupported_iterable_to_array$C(arr) || _non_iterable_spread$r();
22
+ }
23
+ function _type_of$m(obj) {
24
+ "@swc/helpers - typeof";
25
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
26
+ }
27
+ function _unsupported_iterable_to_array$C(o, minLen) {
28
+ if (!o) return;
29
+ if (typeof o === "string") return _array_like_to_array$C(o, minLen);
30
+ var n = Object.prototype.toString.call(o).slice(8, -1);
31
+ if (n === "Object" && o.constructor) n = o.constructor.name;
32
+ if (n === "Map" || n === "Set") return Array.from(n);
33
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$C(o, minLen);
34
+ }
6
35
  // MARK: Functions
7
36
  /**
8
37
  * Converts an IterableOrValue to an Iterable. Non-iterable values are wrapped in an array.
@@ -36,7 +65,7 @@ var makeError = require('make-error');
36
65
  values
37
66
  ];
38
67
  } else if (isIterable(values)) {
39
- iterable = Array.from(values); // copy the array
68
+ iterable = _to_consumable_array$r(values); // copy the array
40
69
  } else {
41
70
  iterable = [
42
71
  values
@@ -63,13 +92,12 @@ var makeError = require('make-error');
63
92
  * @param readKey - Function to extract the key from each value
64
93
  * @returns A Map with the extracted keys and their corresponding values
65
94
  */ function iterableToMap(values, readKey) {
66
- var map = new Map(iterableToArray(values).map(function(value) {
95
+ return new Map(iterableToArray(values).map(function(value) {
67
96
  return [
68
97
  readKey(value),
69
98
  value
70
99
  ];
71
100
  }));
72
- return map;
73
101
  }
74
102
  /**
75
103
  * Type guard that returns true if the input is an Iterable.
@@ -80,11 +108,13 @@ var makeError = require('make-error');
80
108
  * @returns True if the value is iterable
81
109
  */ function isIterable(values) {
82
110
  var treatStringAsIterable = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
83
- if (values && values[Symbol.iterator] && (treatStringAsIterable || typeof values !== 'string')) {
111
+ if (typeof values === 'string') {
112
+ return treatStringAsIterable;
113
+ }
114
+ if (values != null && (typeof values === "undefined" ? "undefined" : _type_of$m(values)) === 'object' && Symbol.iterator in values) {
84
115
  return true;
85
- } else {
86
- return false;
87
116
  }
117
+ return false;
88
118
  }
89
119
  /**
90
120
  * Returns true if the iterable has no values.
@@ -363,30 +393,30 @@ var makeError = require('make-error');
363
393
  }
364
394
  }
365
395
 
366
- function _array_like_to_array$r(arr, len) {
396
+ function _array_like_to_array$B(arr, len) {
367
397
  if (len == null || len > arr.length) len = arr.length;
368
398
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
369
399
  return arr2;
370
400
  }
371
- function _array_without_holes$c(arr) {
372
- if (Array.isArray(arr)) return _array_like_to_array$r(arr);
401
+ function _array_without_holes$q(arr) {
402
+ if (Array.isArray(arr)) return _array_like_to_array$B(arr);
373
403
  }
374
- function _iterable_to_array$c(iter) {
404
+ function _iterable_to_array$q(iter) {
375
405
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
376
406
  }
377
- function _non_iterable_spread$c() {
407
+ function _non_iterable_spread$q() {
378
408
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
379
409
  }
380
- function _to_consumable_array$c(arr) {
381
- return _array_without_holes$c(arr) || _iterable_to_array$c(arr) || _unsupported_iterable_to_array$r(arr) || _non_iterable_spread$c();
410
+ function _to_consumable_array$q(arr) {
411
+ return _array_without_holes$q(arr) || _iterable_to_array$q(arr) || _unsupported_iterable_to_array$B(arr) || _non_iterable_spread$q();
382
412
  }
383
- function _unsupported_iterable_to_array$r(o, minLen) {
413
+ function _unsupported_iterable_to_array$B(o, minLen) {
384
414
  if (!o) return;
385
- if (typeof o === "string") return _array_like_to_array$r(o, minLen);
415
+ if (typeof o === "string") return _array_like_to_array$B(o, minLen);
386
416
  var n = Object.prototype.toString.call(o).slice(8, -1);
387
417
  if (n === "Object" && o.constructor) n = o.constructor.name;
388
418
  if (n === "Map" || n === "Set") return Array.from(n);
389
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$r(o, minLen);
419
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$B(o, minLen);
390
420
  }
391
421
  // MARK: Functions
392
422
  /**
@@ -499,12 +529,10 @@ function _unsupported_iterable_to_array$r(o, minLen) {
499
529
  * @param array - two-dimensional array to flatten, may contain nullish entries
500
530
  * @returns a single-dimensional array with all elements from the non-nullish inner arrays
501
531
  */ function flattenArray(array) {
502
- var _instance;
503
532
  var filteredValues = array.filter(function(x) {
504
533
  return Boolean(x);
505
534
  });
506
- // concat with spread is faster than a depth-one flat
507
- return (_instance = []).concat.apply(_instance, _to_consumable_array$c(filteredValues));
535
+ return filteredValues.flat();
508
536
  }
509
537
  /**
510
538
  * Flattens an array of {@link ArrayOrValue} entries into a single array. Nullish entries are filtered out.
@@ -522,7 +550,7 @@ function _unsupported_iterable_to_array$r(o, minLen) {
522
550
  * @param input - array to copy, or nullish
523
551
  * @returns a new array with the same elements, or an empty array if input is nullish
524
552
  */ function copyArray(input) {
525
- return input != null ? Array.from(input) : [];
553
+ return input != null ? _to_consumable_array$q(input) : [];
526
554
  }
527
555
  /**
528
556
  * Pushes the same element onto the target array a specified number of times.
@@ -545,7 +573,7 @@ function _unsupported_iterable_to_array$r(o, minLen) {
545
573
  */ function mergeArrays(arrays) {
546
574
  return mergeArraysIntoArray.apply(void 0, [
547
575
  []
548
- ].concat(_to_consumable_array$c(arrays)));
576
+ ].concat(_to_consumable_array$q(arrays)));
549
577
  }
550
578
  /**
551
579
  * Merges the input arrays into the target array by pushing each item from each array. Creates an empty array if the target is nullish.
@@ -557,9 +585,7 @@ function _unsupported_iterable_to_array$r(o, minLen) {
557
585
  for(var _len = arguments.length, arrays = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
558
586
  arrays[_key - 1] = arguments[_key];
559
587
  }
560
- if (target == null) {
561
- target = [];
562
- }
588
+ target !== null && target !== void 0 ? target : target = [];
563
589
  arrays.forEach(function(array) {
564
590
  if (array != null) {
565
591
  pushArrayItemsIntoArray(target, array);
@@ -633,7 +659,7 @@ function _unsupported_iterable_to_array$r(o, minLen) {
633
659
  var length = values.length;
634
660
  var secondHalfStartIndex = Math.max(keepFromFront, length - (maxToTake - keepFromFront));
635
661
  var secondHalfEndIndex = length;
636
- results = _to_consumable_array$c(values.slice(0, keepFromFront)).concat(_to_consumable_array$c(values.slice(secondHalfStartIndex, secondHalfEndIndex)));
662
+ results = _to_consumable_array$q(values.slice(0, keepFromFront)).concat(_to_consumable_array$q(values.slice(secondHalfStartIndex, secondHalfEndIndex)));
637
663
  }
638
664
  return results;
639
665
  }
@@ -759,6 +785,31 @@ function _unsupported_iterable_to_array$r(o, minLen) {
759
785
  return readKeysSetFunction(readKey)(values);
760
786
  }
761
787
 
788
+ function _array_like_to_array$A(arr, len) {
789
+ if (len == null || len > arr.length) len = arr.length;
790
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
791
+ return arr2;
792
+ }
793
+ function _array_without_holes$p(arr) {
794
+ if (Array.isArray(arr)) return _array_like_to_array$A(arr);
795
+ }
796
+ function _iterable_to_array$p(iter) {
797
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
798
+ }
799
+ function _non_iterable_spread$p() {
800
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
801
+ }
802
+ function _to_consumable_array$p(arr) {
803
+ return _array_without_holes$p(arr) || _iterable_to_array$p(arr) || _unsupported_iterable_to_array$A(arr) || _non_iterable_spread$p();
804
+ }
805
+ function _unsupported_iterable_to_array$A(o, minLen) {
806
+ if (!o) return;
807
+ if (typeof o === "string") return _array_like_to_array$A(o, minLen);
808
+ var n = Object.prototype.toString.call(o).slice(8, -1);
809
+ if (n === "Object" && o.constructor) n = o.constructor.name;
810
+ if (n === "Map" || n === "Set") return Array.from(n);
811
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$A(o, minLen);
812
+ }
762
813
  /**
763
814
  * Converts an {@link IterableOrValue} into a Set. Strings are treated as single values rather than character iterables.
764
815
  *
@@ -889,7 +940,7 @@ function _unsupported_iterable_to_array$r(o, minLen) {
889
940
  * @param b - Second set.
890
941
  * @returns An array of values present in only one of the sets.
891
942
  */ function symmetricDifferenceArrayBetweenSets(a, b) {
892
- return Array.from(extraSet.symmetricDifference(a, b));
943
+ return _to_consumable_array$p(extraSet.symmetricDifference(a, b));
893
944
  }
894
945
  /**
895
946
  * Flattens a two-dimensional array into a Set of unique values.
@@ -1133,6 +1184,11 @@ function _unsupported_iterable_to_array$r(o, minLen) {
1133
1184
  }
1134
1185
  /**
1135
1186
  * Returns false if the input array contains any value from the second array.
1187
+ *
1188
+ * @param values - the values to check against
1189
+ * @param valuesToFind - the values to look for
1190
+ * @param emptyValuesToFindArrayResult - result when valuesToFind is empty
1191
+ * @returns `true` if none of the valuesToFind are present in values
1136
1192
  */ function containsNoneOfValue(values, valuesToFind, emptyValuesToFindArrayResult) {
1137
1193
  var set = new Set(asIterable(valuesToFind, false));
1138
1194
  return containsNoValueFromSet(values, set, emptyValuesToFindArrayResult);
@@ -1162,6 +1218,11 @@ function _unsupported_iterable_to_array$r(o, minLen) {
1162
1218
  * Returns true if the input array contains any value from the second array.
1163
1219
  *
1164
1220
  * If valuesToFind is empty, returns the emptyValuesToFindArrayResult value. Defaults to false.
1221
+ *
1222
+ * @param values - the values to build a set from and check against
1223
+ * @param valuesToFind - the values to search for within the set
1224
+ * @param emptyValuesToFindArrayResult - result when valuesToFind is empty; defaults to false
1225
+ * @returns `true` if any of the valuesToFind exist in values
1165
1226
  */ function containsAnyValue(values, valuesToFind, emptyValuesToFindArrayResult) {
1166
1227
  var set = new Set(asIterable(values, false));
1167
1228
  return setContainsAnyValue(set, valuesToFind, emptyValuesToFindArrayResult);
@@ -1171,9 +1232,10 @@ function _unsupported_iterable_to_array$r(o, minLen) {
1171
1232
  *
1172
1233
  * If values is empty, returns the emptyValuesToFindArrayResult value. Defaults to false.
1173
1234
  *
1174
- * @param values
1175
- * @param valuesToFind
1176
- * @returns
1235
+ * @param values - the values to check for membership in the set
1236
+ * @param valuesToFind - the set to check against
1237
+ * @param emptyValuesArrayResult - result when values is empty; defaults to false
1238
+ * @returns `true` if any of the values are present in the set
1177
1239
  */ function containsAnyValueFromSet(values, valuesToFind, emptyValuesArrayResult) {
1178
1240
  return setContainsAnyValue(valuesToFind, values, emptyValuesArrayResult);
1179
1241
  }
@@ -1182,35 +1244,30 @@ function _unsupported_iterable_to_array$r(o, minLen) {
1182
1244
  *
1183
1245
  * If valuesToFind is empty, returns the emptyValuesToFindArrayResult value. Defaults to false.
1184
1246
  *
1185
- * @param valuesSet
1186
- * @param valuesToFind
1187
- * @param emptyValuesToFindArrayResult
1188
- * @returns
1247
+ * @param valuesSet - the set to check for membership
1248
+ * @param valuesToFind - the values to search for in the set
1249
+ * @param emptyValuesToFindArrayResult - result when valuesToFind is empty; defaults to false
1250
+ * @returns `true` if any of the valuesToFind are present in the set
1189
1251
  */ function setContainsAnyValue(valuesSet, valuesToFind) {
1190
1252
  var emptyValuesToFindArrayResult = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
1191
- var result;
1192
- if (valuesSet) {
1193
- var valuesToFindArray = iterableToArray(valuesToFind);
1194
- if (valuesToFindArray.length > 0) {
1195
- result = valuesToFindArray.findIndex(function(x) {
1196
- return valuesSet.has(x);
1197
- }) !== -1;
1198
- } else {
1199
- result = emptyValuesToFindArrayResult;
1200
- }
1253
+ var valuesToFindArray = iterableToArray(valuesToFind);
1254
+ if (valuesToFindArray.length > 0) {
1255
+ return valuesToFindArray.some(function(x) {
1256
+ return valuesSet.has(x);
1257
+ });
1201
1258
  } else {
1202
- result = false;
1259
+ return emptyValuesToFindArrayResult;
1203
1260
  }
1204
- return result;
1205
1261
  }
1206
1262
  /**
1207
1263
  * Returns true if values contains all values in valuesToFind.
1208
1264
  *
1209
1265
  * If valuesToFind is empty, returns the emptyValuesToFindArrayResult value. Defaults to true.
1210
1266
  *
1211
- * @param values
1212
- * @param valuesToFind
1213
- * @returns
1267
+ * @param values - the iterable of values to build a set from
1268
+ * @param valuesToFind - the values that must all be present
1269
+ * @param emptyValuesArrayResult - result when valuesToFind is empty; defaults to true
1270
+ * @returns `true` if all valuesToFind are present in the values set
1214
1271
  */ function containsAllValues(values, valuesToFind, emptyValuesArrayResult) {
1215
1272
  var set = new Set(values);
1216
1273
  return setContainsAllValues(set, valuesToFind, emptyValuesArrayResult);
@@ -1220,69 +1277,64 @@ function _unsupported_iterable_to_array$r(o, minLen) {
1220
1277
  *
1221
1278
  * If valuesToFind is empty, returns the emptyValuesToFindArrayResult value. Defaults to true.
1222
1279
  *
1223
- * @param valuesSet
1224
- * @param valuesToFind
1225
- * @param emptyValuesToFindArrayResult
1226
- * @returns
1280
+ * @param valuesSet - the set to check for full containment
1281
+ * @param valuesToFind - the values that must all be present in the set
1282
+ * @param emptyValuesToFindArrayResult - result when valuesToFind is empty; defaults to true
1283
+ * @returns `true` if every value in valuesToFind is present in the set
1227
1284
  */ function setContainsAllValues(valuesSet, valuesToFind) {
1228
1285
  var emptyValuesToFindArrayResult = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
1229
- var result;
1230
- if (valuesSet) {
1231
- var valuesToFindArray = iterableToArray(valuesToFind);
1232
- if (valuesToFindArray.length > 0) {
1233
- result = valuesToFindArray.findIndex(function(x) {
1234
- return !valuesSet.has(x);
1235
- }) == -1;
1236
- } else {
1237
- result = emptyValuesToFindArrayResult;
1238
- }
1286
+ var valuesToFindArray = iterableToArray(valuesToFind);
1287
+ if (valuesToFindArray.length > 0) {
1288
+ return !valuesToFindArray.some(function(x) {
1289
+ return !valuesSet.has(x);
1290
+ });
1239
1291
  } else {
1240
- result = false;
1292
+ return emptyValuesToFindArrayResult;
1241
1293
  }
1242
- return result;
1243
1294
  }
1244
1295
  /**
1245
1296
  * Returns true if both iterables are defined (or are both null/undefined) and have the same values exactly.
1246
1297
  *
1247
- * @param a
1248
- * @param b
1249
- * @returns
1298
+ * @param a - first iterable to compare
1299
+ * @param b - second iterable to compare
1300
+ * @returns `true` if both iterables contain the same unique values, or both are nullish
1250
1301
  */ function iterablesAreSetEquivalent(a, b) {
1251
1302
  return a && b ? setsAreEquivalent(new Set(a), new Set(b)) : a == b;
1252
1303
  }
1253
1304
  /**
1254
1305
  * Returns true if both sets are defined (or are both null/undefined) and have the same values exactly.
1255
1306
  *
1256
- * @param a
1257
- * @param b
1307
+ * @param a - first set to compare
1308
+ * @param b - second set to compare
1309
+ * @returns `true` if both sets contain the same values, or both are nullish
1258
1310
  */ function setsAreEquivalent(a, b) {
1259
1311
  return a && b ? a.size === b.size && setContainsAllValues(a, b, true) : a == b;
1260
1312
  }
1261
1313
 
1262
- function _array_like_to_array$q(arr, len) {
1314
+ function _array_like_to_array$z(arr, len) {
1263
1315
  if (len == null || len > arr.length) len = arr.length;
1264
1316
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
1265
1317
  return arr2;
1266
1318
  }
1267
- function _array_without_holes$b(arr) {
1268
- if (Array.isArray(arr)) return _array_like_to_array$q(arr);
1319
+ function _array_without_holes$o(arr) {
1320
+ if (Array.isArray(arr)) return _array_like_to_array$z(arr);
1269
1321
  }
1270
- function _iterable_to_array$b(iter) {
1322
+ function _iterable_to_array$o(iter) {
1271
1323
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1272
1324
  }
1273
- function _non_iterable_spread$b() {
1325
+ function _non_iterable_spread$o() {
1274
1326
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1275
1327
  }
1276
- function _to_consumable_array$b(arr) {
1277
- return _array_without_holes$b(arr) || _iterable_to_array$b(arr) || _unsupported_iterable_to_array$q(arr) || _non_iterable_spread$b();
1328
+ function _to_consumable_array$o(arr) {
1329
+ return _array_without_holes$o(arr) || _iterable_to_array$o(arr) || _unsupported_iterable_to_array$z(arr) || _non_iterable_spread$o();
1278
1330
  }
1279
- function _unsupported_iterable_to_array$q(o, minLen) {
1331
+ function _unsupported_iterable_to_array$z(o, minLen) {
1280
1332
  if (!o) return;
1281
- if (typeof o === "string") return _array_like_to_array$q(o, minLen);
1333
+ if (typeof o === "string") return _array_like_to_array$z(o, minLen);
1282
1334
  var n = Object.prototype.toString.call(o).slice(8, -1);
1283
1335
  if (n === "Object" && o.constructor) n = o.constructor.name;
1284
1336
  if (n === "Map" || n === "Set") return Array.from(n);
1285
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$q(o, minLen);
1337
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$z(o, minLen);
1286
1338
  }
1287
1339
  /**
1288
1340
  * Inverts the output of an arbitrary boolean-returning function.
@@ -1300,7 +1352,7 @@ function _unsupported_iterable_to_array$q(o, minLen) {
1300
1352
  var _decisionFn;
1301
1353
  var result = (_decisionFn = decisionFn).call.apply(_decisionFn, [
1302
1354
  undefined
1303
- ].concat(_to_consumable_array$b(args)));
1355
+ ].concat(_to_consumable_array$o(args)));
1304
1356
  return !result;
1305
1357
  };
1306
1358
  } else {
@@ -1320,7 +1372,7 @@ function _unsupported_iterable_to_array$q(o, minLen) {
1320
1372
  */ function arrayDecisionFunction(decision, mode) {
1321
1373
  var findFn = mode === 'all' ? invertBooleanReturnFunction(decision) : decision;
1322
1374
  return invertBooleanReturnFunction(function(values) {
1323
- return values.findIndex(findFn) !== -1;
1375
+ return values.some(findFn);
1324
1376
  }, mode === 'all');
1325
1377
  }
1326
1378
  /**
@@ -1420,6 +1472,7 @@ function _type_of$l(obj) {
1420
1472
  * Type guard that returns `true` if the value is not `null` or `undefined`.
1421
1473
  *
1422
1474
  * @param value - the value to check
1475
+ * @returns `true` if the value is not `null` or `undefined`
1423
1476
  */ function hasNonNullValue(value) {
1424
1477
  return value != null;
1425
1478
  }
@@ -1433,6 +1486,7 @@ function _type_of$l(obj) {
1433
1486
  * NaN has undefined behavior.
1434
1487
  *
1435
1488
  * @param value - the value to check
1489
+ * @returns `true` if the value is non-nullish and not empty
1436
1490
  */ function hasValueOrNotEmpty(value) {
1437
1491
  if (isIterable(value, false)) {
1438
1492
  return !isEmptyIterable(value);
@@ -1449,6 +1503,7 @@ function _type_of$l(obj) {
1449
1503
  * NaN has undefined behavior.
1450
1504
  *
1451
1505
  * @param value - the value to check
1506
+ * @returns `true` if the value is non-nullish, non-empty, and not an empty object
1452
1507
  */ function hasValueOrNotEmptyObject(value) {
1453
1508
  if (isIterable(value, true)) {
1454
1509
  return !isEmptyIterable(value);
@@ -1462,6 +1517,7 @@ function _type_of$l(obj) {
1462
1517
  * Returns `true` if the input value is a non-empty string or is `true`.
1463
1518
  *
1464
1519
  * @param value - the value to check
1520
+ * @returns `true` if the value is a non-empty string or is `true`
1465
1521
  */ function isStringOrTrue(value) {
1466
1522
  return Boolean(value || value !== '');
1467
1523
  }
@@ -1471,6 +1527,7 @@ function _type_of$l(obj) {
1471
1527
  * Useful for filtering out both nullish values and empty strings in a single check.
1472
1528
  *
1473
1529
  * @param value - the value to check
1530
+ * @returns `true` if the value is not nullish and not an empty string
1474
1531
  */ function isNotNullOrEmptyString(value) {
1475
1532
  return value != null && value !== '';
1476
1533
  }
@@ -1478,6 +1535,7 @@ function _type_of$l(obj) {
1478
1535
  * Type guard that returns `true` if the input is `null` or `undefined`.
1479
1536
  *
1480
1537
  * @param value - the value to check
1538
+ * @returns `true` if the value is `null` or `undefined`
1481
1539
  */ function isMaybeNot(value) {
1482
1540
  return value == null;
1483
1541
  }
@@ -1487,6 +1545,7 @@ function _type_of$l(obj) {
1487
1545
  * Equivalent to {@link hasNonNullValue} but with the `MaybeSo` narrowing type.
1488
1546
  *
1489
1547
  * @param value - the value to check
1548
+ * @returns `true` if the value is neither `null` nor `undefined`
1490
1549
  */ function isMaybeSo(value) {
1491
1550
  return value != null;
1492
1551
  }
@@ -1496,6 +1555,7 @@ function _type_of$l(obj) {
1496
1555
  * Useful for optional boolean flags where both absence and `true` indicate the same behavior.
1497
1556
  *
1498
1557
  * @param value - the value to check
1558
+ * @returns `true` if the value is nullish or strictly `true`
1499
1559
  */ function isMaybeNotOrTrue(value) {
1500
1560
  return value == null || value === true;
1501
1561
  }
@@ -1503,6 +1563,7 @@ function _type_of$l(obj) {
1503
1563
  * Returns `true` if the input is not `null`, `undefined`, or `false`.
1504
1564
  *
1505
1565
  * @param value - the value to check
1566
+ * @returns `true` if the value is not `null`, `undefined`, or `false`
1506
1567
  */ function isDefinedAndNotFalse(value) {
1507
1568
  return value != null && value !== false;
1508
1569
  }
@@ -1510,6 +1571,7 @@ function _type_of$l(obj) {
1510
1571
  * Returns `true` if the input is not strictly `false`. Nullish values return `true`.
1511
1572
  *
1512
1573
  * @param value - the value to check
1574
+ * @returns `true` if the value is not strictly `false`
1513
1575
  */ function isNotFalse(value) {
1514
1576
  return value !== false;
1515
1577
  }
@@ -1518,6 +1580,7 @@ function _type_of$l(obj) {
1518
1580
  *
1519
1581
  * @param a - first value
1520
1582
  * @param b - second value
1583
+ * @returns `true` if both values are non-nullish and strictly equal
1521
1584
  */ function isSameNonNullValue(a, b) {
1522
1585
  return a === b && a != null;
1523
1586
  }
@@ -1528,6 +1591,7 @@ function _type_of$l(obj) {
1528
1591
  *
1529
1592
  * @param a - first value
1530
1593
  * @param b - second value
1594
+ * @returns `true` if both are nullish or both are the same value
1531
1595
  */ function valuesAreBothNullishOrEquivalent(a, b) {
1532
1596
  return a != null && b != null ? a === b : a == b;
1533
1597
  }
@@ -1540,6 +1604,7 @@ function _type_of$l(obj) {
1540
1604
  *
1541
1605
  * @param a - the current value
1542
1606
  * @param b - the update value
1607
+ * @returns `a` if `b` is undefined, otherwise `b`
1543
1608
  */ function updateMaybeValue(a, b) {
1544
1609
  return b === undefined ? a : b;
1545
1610
  }
@@ -1551,11 +1616,13 @@ function _type_of$l(obj) {
1551
1616
  * @returns A function that filters maybe values from an optional input array.
1552
1617
  */ function filterMaybeArrayFunction(filterFn) {
1553
1618
  return function(values) {
1619
+ var result;
1554
1620
  if (values != null) {
1555
- return values.filter(filterFn);
1621
+ result = values.filter(filterFn);
1556
1622
  } else {
1557
- return [];
1623
+ result = [];
1558
1624
  }
1625
+ return result;
1559
1626
  };
1560
1627
  }
1561
1628
  /**
@@ -1576,9 +1643,9 @@ function _type_of$l(obj) {
1576
1643
  * @param values - Array of optional values to check.
1577
1644
  * @returns `true` if every value in the array is null or undefined.
1578
1645
  */ function allValuesAreMaybeNot(values) {
1579
- return values.findIndex(function(x) {
1646
+ return !values.some(function(x) {
1580
1647
  return x != null;
1581
- }) === -1;
1648
+ });
1582
1649
  }
1583
1650
  /**
1584
1651
  * Checks whether or not all values in the array are defined (non-null and non-undefined).
@@ -1586,9 +1653,9 @@ function _type_of$l(obj) {
1586
1653
  * @param values - Array of optional values to check.
1587
1654
  * @returns `true` if every value in the array is non-null and non-undefined.
1588
1655
  */ function allValuesAreNotMaybe(values) {
1589
- return values.findIndex(function(x) {
1656
+ return !values.some(function(x) {
1590
1657
  return x == null;
1591
- }) === -1;
1658
+ });
1592
1659
  }
1593
1660
 
1594
1661
  /**
@@ -1597,6 +1664,9 @@ function _type_of$l(obj) {
1597
1664
  * This is useful when building objects whose type is normally read-only, allowing incremental property assignment during construction.
1598
1665
  *
1599
1666
  * @param config - the build configuration containing the base object and build function
1667
+ * @param config.base - optional pre-existing partial object to build upon; defaults to an empty object
1668
+ * @param config.build - function that mutates the base object to populate it with desired values
1669
+ * @returns the fully constructed object of type T
1600
1670
  *
1601
1671
  * @example
1602
1672
  * ```ts
@@ -1652,16 +1722,24 @@ function _type_of$l(obj) {
1652
1722
  *
1653
1723
  * Used as a sentinel value so that {@link chainMapSameFunctions} and other combinators can detect
1654
1724
  * and skip no-op mappings for efficiency.
1725
+ *
1726
+ * @param input - the value to pass through unchanged
1727
+ * @returns the same input value, unmodified
1655
1728
  */ var MAP_IDENTITY = function MAP_IDENTITY(input) {
1656
1729
  return input;
1657
1730
  };
1658
1731
  /**
1659
1732
  * Returns the shared {@link MAP_IDENTITY} function cast to the requested type, useful for providing a typed no-op transformation.
1733
+ *
1734
+ * @returns the singleton identity function typed as `MapFunction<T, T>`
1660
1735
  */ function mapIdentityFunction() {
1661
1736
  return MAP_IDENTITY;
1662
1737
  }
1663
1738
  /**
1664
1739
  * Checks whether the given function is the singleton {@link MAP_IDENTITY} reference.
1740
+ *
1741
+ * @param fn - the function to check
1742
+ * @returns `true` if the function is the identity singleton
1665
1743
  */ function isMapIdentityFunction(fn) {
1666
1744
  return fn === MAP_IDENTITY;
1667
1745
  }
@@ -1756,30 +1834,30 @@ function chainMapFunction(a, b) {
1756
1834
  }
1757
1835
  }
1758
1836
 
1759
- function _array_like_to_array$p(arr, len) {
1837
+ function _array_like_to_array$y(arr, len) {
1760
1838
  if (len == null || len > arr.length) len = arr.length;
1761
1839
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
1762
1840
  return arr2;
1763
1841
  }
1764
- function _array_without_holes$a(arr) {
1765
- if (Array.isArray(arr)) return _array_like_to_array$p(arr);
1842
+ function _array_without_holes$n(arr) {
1843
+ if (Array.isArray(arr)) return _array_like_to_array$y(arr);
1766
1844
  }
1767
- function _iterable_to_array$a(iter) {
1845
+ function _iterable_to_array$n(iter) {
1768
1846
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1769
1847
  }
1770
- function _non_iterable_spread$a() {
1848
+ function _non_iterable_spread$n() {
1771
1849
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1772
1850
  }
1773
- function _to_consumable_array$a(arr) {
1774
- return _array_without_holes$a(arr) || _iterable_to_array$a(arr) || _unsupported_iterable_to_array$p(arr) || _non_iterable_spread$a();
1851
+ function _to_consumable_array$n(arr) {
1852
+ return _array_without_holes$n(arr) || _iterable_to_array$n(arr) || _unsupported_iterable_to_array$y(arr) || _non_iterable_spread$n();
1775
1853
  }
1776
- function _unsupported_iterable_to_array$p(o, minLen) {
1854
+ function _unsupported_iterable_to_array$y(o, minLen) {
1777
1855
  if (!o) return;
1778
- if (typeof o === "string") return _array_like_to_array$p(o, minLen);
1856
+ if (typeof o === "string") return _array_like_to_array$y(o, minLen);
1779
1857
  var n = Object.prototype.toString.call(o).slice(8, -1);
1780
1858
  if (n === "Object" && o.constructor) n = o.constructor.name;
1781
1859
  if (n === "Map" || n === "Set") return Array.from(n);
1782
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$p(o, minLen);
1860
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$y(o, minLen);
1783
1861
  }
1784
1862
  /**
1785
1863
  * Concatenates multiple arrays and returns only unique values.
@@ -1790,7 +1868,7 @@ function _unsupported_iterable_to_array$p(o, minLen) {
1790
1868
  for(var _len = arguments.length, arrays = new Array(_len), _key = 0; _key < _len; _key++){
1791
1869
  arrays[_key] = arguments[_key];
1792
1870
  }
1793
- return unique(concatArrays.apply(void 0, _to_consumable_array$a(arrays)));
1871
+ return unique(concatArrays.apply(void 0, _to_consumable_array$n(arrays)));
1794
1872
  }
1795
1873
  /**
1796
1874
  * Flattens a 2D array and returns only unique values.
@@ -1811,10 +1889,10 @@ function _unsupported_iterable_to_array$p(o, minLen) {
1811
1889
  var exclude = readKeysFromFilterUniqueFunctionAdditionalKeysInput(excludeInput, function(x) {
1812
1890
  return x;
1813
1891
  });
1814
- if (exclude != null && exclude.length) {
1892
+ if (exclude.length) {
1815
1893
  removeFromSet(unique, exclude);
1816
1894
  }
1817
- return Array.from(unique);
1895
+ return _to_consumable_array$n(unique);
1818
1896
  }
1819
1897
  /**
1820
1898
  * Reads and resolves keys from a {@link FilterUniqueFunctionAdditionalKeysInput}, handling both raw key arrays and structured input objects.
@@ -1836,7 +1914,7 @@ function _unsupported_iterable_to_array$p(o, minLen) {
1836
1914
  if (input.values) {
1837
1915
  addToSet(keys, input.values.map(readKey));
1838
1916
  }
1839
- return Array.from(keys);
1917
+ return _to_consumable_array$n(keys);
1840
1918
  }
1841
1919
  /**
1842
1920
  * Creates a {@link FilterUniqueFunction} that deduplicates items by their computed key.
@@ -1848,7 +1926,7 @@ function _unsupported_iterable_to_array$p(o, minLen) {
1848
1926
  var baseKeys = readKeysFromFilterUniqueFunctionAdditionalKeysInput(additionalKeysInput, readKey);
1849
1927
  function calculateExclude(excludeInput) {
1850
1928
  var newExcludeKeys = excludeInput ? Array.isArray(excludeInput) ? excludeInput.map(readKey) : readKeysFromFilterUniqueFunctionAdditionalKeys(excludeInput, readKey) : [];
1851
- return (newExcludeKeys === null || newExcludeKeys === void 0 ? void 0 : newExcludeKeys.length) ? mergeArrays([
1929
+ return newExcludeKeys.length ? mergeArrays([
1852
1930
  filterMaybeArrayValues(newExcludeKeys),
1853
1931
  baseKeys
1854
1932
  ]) : baseKeys;
@@ -1903,7 +1981,7 @@ function _unsupported_iterable_to_array$p(o, minLen) {
1903
1981
  }
1904
1982
  function allowValueOnceFilter(inputReadKey) {
1905
1983
  var visitedKeys = new Set();
1906
- var readKey = inputReadKey || MAP_IDENTITY;
1984
+ var readKey = inputReadKey !== null && inputReadKey !== void 0 ? inputReadKey : MAP_IDENTITY;
1907
1985
  var fn = function fn(x) {
1908
1986
  var key = readKey(x);
1909
1987
  if (!visitedKeys.has(key)) {
@@ -1917,6 +1995,14 @@ function allowValueOnceFilter(inputReadKey) {
1917
1995
  return fn;
1918
1996
  }
1919
1997
 
1998
+ function _array_like_to_array$x(arr, len) {
1999
+ if (len == null || len > arr.length) len = arr.length;
2000
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2001
+ return arr2;
2002
+ }
2003
+ function _array_without_holes$m(arr) {
2004
+ if (Array.isArray(arr)) return _array_like_to_array$x(arr);
2005
+ }
1920
2006
  function _class_call_check$b(instance, Constructor) {
1921
2007
  if (!(instance instanceof Constructor)) {
1922
2008
  throw new TypeError("Cannot call a class as a function");
@@ -1935,10 +2021,27 @@ function _define_property$l(obj, key, value) {
1935
2021
  }
1936
2022
  return obj;
1937
2023
  }
2024
+ function _iterable_to_array$m(iter) {
2025
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2026
+ }
2027
+ function _non_iterable_spread$m() {
2028
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2029
+ }
2030
+ function _to_consumable_array$m(arr) {
2031
+ return _array_without_holes$m(arr) || _iterable_to_array$m(arr) || _unsupported_iterable_to_array$x(arr) || _non_iterable_spread$m();
2032
+ }
1938
2033
  function _type_of$k(obj) {
1939
2034
  "@swc/helpers - typeof";
1940
2035
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
1941
2036
  }
2037
+ function _unsupported_iterable_to_array$x(o, minLen) {
2038
+ if (!o) return;
2039
+ if (typeof o === "string") return _array_like_to_array$x(o, minLen);
2040
+ var n = Object.prototype.toString.call(o).slice(8, -1);
2041
+ if (n === "Object" && o.constructor) n = o.constructor.name;
2042
+ if (n === "Map" || n === "Set") return Array.from(n);
2043
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$x(o, minLen);
2044
+ }
1942
2045
  var DEFAULT_UNKNOWN_MODEL_TYPE_STRING = 'unknown';
1943
2046
  /**
1944
2047
  * Reads the `id` property from a {@link UniqueModel}.
@@ -1948,17 +2051,6 @@ var DEFAULT_UNKNOWN_MODEL_TYPE_STRING = 'unknown';
1948
2051
  */ var readUniqueModelKey = function readUniqueModelKey(model) {
1949
2052
  return model.id;
1950
2053
  };
1951
- /**
1952
- * Abstract base class for models identified by a unique {@link ModelKey}.
1953
- *
1954
- * Copies the `id` from the provided template during construction.
1955
- */ var AbstractUniqueModel = function AbstractUniqueModel(template) {
1956
- _class_call_check$b(this, AbstractUniqueModel);
1957
- _define_property$l(this, "id", void 0);
1958
- if (template) {
1959
- this.id = template.id;
1960
- }
1961
- };
1962
2054
  /**
1963
2055
  * Deduplicates an array of model keys using a Set.
1964
2056
  *
@@ -1971,7 +2063,7 @@ var DEFAULT_UNKNOWN_MODEL_TYPE_STRING = 'unknown';
1971
2063
  * // result: ['a', 'b', 'c']
1972
2064
  * ```
1973
2065
  */ function uniqueKeys(keys) {
1974
- return Array.from(new Set(keys));
2066
+ return _to_consumable_array$m(new Set(keys));
1975
2067
  }
1976
2068
  function uniqueModels(models) {
1977
2069
  var readKey = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : readUniqueModelKey;
@@ -1990,7 +2082,8 @@ function readModelKeysFromObjects(input, required, read) {
1990
2082
  * @param required - Whether keys are required
1991
2083
  * @param read - Function to extract keys from models
1992
2084
  * @returns Keys that appear in one array but not the other
1993
- */ function symmetricDifferenceWithModels(a, b, required, read) {
2085
+ */ // eslint-disable-next-line @typescript-eslint/max-params
2086
+ function symmetricDifferenceWithModels(a, b, required, read) {
1994
2087
  return symmetricDifferenceArray(readModelKeys(a, required, read), readModelKeys(b, required, read));
1995
2088
  }
1996
2089
  function removeModelsWithSameKey(input, model, read) {
@@ -2005,14 +2098,12 @@ function removeModelsWithKey(input, key) {
2005
2098
  }
2006
2099
  function makeModelMap(input, read) {
2007
2100
  var map = new Map();
2008
- if (input) {
2009
- input.forEach(function(x) {
2010
- return map.set(readModelKey(x, {
2011
- required: false,
2012
- read: read
2013
- }), x);
2014
- });
2015
- }
2101
+ input.forEach(function(x) {
2102
+ return map.set(readModelKey(x, {
2103
+ required: false,
2104
+ read: read
2105
+ }), x);
2106
+ });
2016
2107
  return map;
2017
2108
  }
2018
2109
  /**
@@ -2041,6 +2132,9 @@ function makeModelMap(input, read) {
2041
2132
  *
2042
2133
  * @param input - A model object or a model key string
2043
2134
  * @param config - Handlers for model and key cases, plus whether input is required
2135
+ * @param config.useModel - handler invoked when the input is a model object; if omitted, the model's key is passed to `useKey` instead
2136
+ * @param config.useKey - handler invoked when the input is a model key string
2137
+ * @param config.required - when true, throws an error if the input is nullish; defaults to false
2044
2138
  * @returns The result of the matched handler, or undefined if input is nullish and not required
2045
2139
  * @throws Error if `required` is true and input is nullish
2046
2140
  */ function useModelOrKey(input, param) {
@@ -2053,7 +2147,7 @@ function makeModelMap(input, read) {
2053
2147
  result = useModel ? useModel(input) : useKey(readModelKey(input));
2054
2148
  }
2055
2149
  } else if (required) {
2056
- throwKeyIsRequired();
2150
+ throw new Error('input is required');
2057
2151
  }
2058
2152
  return result;
2059
2153
  }
@@ -2185,34 +2279,48 @@ function readModelKey(input) {
2185
2279
  };
2186
2280
  };
2187
2281
  }
2282
+ // MARK: COMPAT
2283
+ /**
2284
+ * Abstract base class for models identified by a unique {@link ModelKey}.
2285
+ *
2286
+ * Copies the `id` from the provided template during construction.
2287
+ *
2288
+ * @deprecated Use {@link UniqueModel} instead.
2289
+ */ var AbstractUniqueModel = function AbstractUniqueModel(template) {
2290
+ _class_call_check$b(this, AbstractUniqueModel);
2291
+ _define_property$l(this, "id", void 0);
2292
+ this.id = template.id;
2293
+ }
2294
+ ;
2188
2295
 
2189
- function _array_like_to_array$o(arr, len) {
2296
+ function _array_like_to_array$w(arr, len) {
2190
2297
  if (len == null || len > arr.length) len = arr.length;
2191
2298
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2192
2299
  return arr2;
2193
2300
  }
2194
- function _array_without_holes$9(arr) {
2195
- if (Array.isArray(arr)) return _array_like_to_array$o(arr);
2301
+ function _array_without_holes$l(arr) {
2302
+ if (Array.isArray(arr)) return _array_like_to_array$w(arr);
2196
2303
  }
2197
- function _iterable_to_array$9(iter) {
2304
+ function _iterable_to_array$l(iter) {
2198
2305
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2199
2306
  }
2200
- function _non_iterable_spread$9() {
2307
+ function _non_iterable_spread$l() {
2201
2308
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2202
2309
  }
2203
- function _to_consumable_array$9(arr) {
2204
- return _array_without_holes$9(arr) || _iterable_to_array$9(arr) || _unsupported_iterable_to_array$o(arr) || _non_iterable_spread$9();
2310
+ function _to_consumable_array$l(arr) {
2311
+ return _array_without_holes$l(arr) || _iterable_to_array$l(arr) || _unsupported_iterable_to_array$w(arr) || _non_iterable_spread$l();
2205
2312
  }
2206
- function _unsupported_iterable_to_array$o(o, minLen) {
2313
+ function _unsupported_iterable_to_array$w(o, minLen) {
2207
2314
  if (!o) return;
2208
- if (typeof o === "string") return _array_like_to_array$o(o, minLen);
2315
+ if (typeof o === "string") return _array_like_to_array$w(o, minLen);
2209
2316
  var n = Object.prototype.toString.call(o).slice(8, -1);
2210
2317
  if (n === "Object" && o.constructor) n = o.constructor.name;
2211
2318
  if (n === "Map" || n === "Set") return Array.from(n);
2212
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$o(o, minLen);
2319
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$w(o, minLen);
2213
2320
  }
2214
2321
  /**
2215
2322
  * Wraps a key reading function to ensure that empty string keys are not used in boolean key arrays.
2323
+ *
2216
2324
  * @param readKey - The key reading function to wrap
2217
2325
  * @returns A wrapped key reading function that throws an error if an empty string is used as a key
2218
2326
  */ function readBooleanKeySafetyWrap(readKey) {
@@ -2227,6 +2335,7 @@ function _unsupported_iterable_to_array$o(o, minLen) {
2227
2335
  }
2228
2336
  /**
2229
2337
  * Checks if a boolean key array evaluates to false (empty or undefined).
2338
+ *
2230
2339
  * @param value - The boolean key array to check
2231
2340
  * @returns True if the array is empty or undefined, false otherwise
2232
2341
  */ function isFalseBooleanKeyArray(value) {
@@ -2234,6 +2343,7 @@ function _unsupported_iterable_to_array$o(o, minLen) {
2234
2343
  }
2235
2344
  /**
2236
2345
  * Checks if a boolean key array evaluates to true (has at least one value).
2346
+ *
2237
2347
  * @param value - The boolean key array to check
2238
2348
  * @returns True if the array has at least one value, false otherwise
2239
2349
  */ function isTrueBooleanKeyArray(value) {
@@ -2241,12 +2351,13 @@ function _unsupported_iterable_to_array$o(o, minLen) {
2241
2351
  }
2242
2352
  /**
2243
2353
  * Inserts a value into a boolean key array, removing any existing values with the same key.
2354
+ *
2244
2355
  * @param array - The boolean key array to insert into
2245
2356
  * @param value - The value to insert
2246
2357
  * @param readKey - Function to extract the key from a value
2247
2358
  * @returns A new boolean key array with the value inserted
2248
2359
  */ function insertIntoBooleanKeyArray(array, value, readKey) {
2249
- return array ? _to_consumable_array$9(removeModelsWithSameKey(array, value, readBooleanKeySafetyWrap(readKey))).concat([
2360
+ return array ? _to_consumable_array$l(removeModelsWithSameKey(array, value, readBooleanKeySafetyWrap(readKey))).concat([
2250
2361
  value
2251
2362
  ]) : [
2252
2363
  value
@@ -2254,6 +2365,7 @@ function _unsupported_iterable_to_array$o(o, minLen) {
2254
2365
  }
2255
2366
  /**
2256
2367
  * Removes a value from a boolean key array based on its key.
2368
+ *
2257
2369
  * @param array - The boolean key array to remove from
2258
2370
  * @param value - The value to remove
2259
2371
  * @param readKey - Function to extract the key from a value
@@ -2263,6 +2375,7 @@ function _unsupported_iterable_to_array$o(o, minLen) {
2263
2375
  }
2264
2376
  /**
2265
2377
  * Removes values from a boolean key array that match the specified key.
2378
+ *
2266
2379
  * @param array - The boolean key array to remove from
2267
2380
  * @param key - The key to match for removal
2268
2381
  * @param readKey - Function to extract the key from a value
@@ -2272,6 +2385,7 @@ function _unsupported_iterable_to_array$o(o, minLen) {
2272
2385
  }
2273
2386
  /**
2274
2387
  * Creates a utility object with functions for working with boolean key arrays.
2388
+ *
2275
2389
  * @param readKey - Function to extract the key from a value
2276
2390
  * @returns An object with utility functions for boolean key arrays
2277
2391
  */ function booleanKeyArrayUtility(readKey) {
@@ -2309,6 +2423,14 @@ function _unsupported_iterable_to_array$o(o, minLen) {
2309
2423
  return x ? x : undefined;
2310
2424
  });
2311
2425
 
2426
+ function _array_like_to_array$v(arr, len) {
2427
+ if (len == null || len > arr.length) len = arr.length;
2428
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2429
+ return arr2;
2430
+ }
2431
+ function _array_without_holes$k(arr) {
2432
+ if (Array.isArray(arr)) return _array_like_to_array$v(arr);
2433
+ }
2312
2434
  function _class_call_check$a(instance, Constructor) {
2313
2435
  if (!(instance instanceof Constructor)) {
2314
2436
  throw new TypeError("Cannot call a class as a function");
@@ -2340,6 +2462,23 @@ function _define_property$k(obj, key, value) {
2340
2462
  }
2341
2463
  return obj;
2342
2464
  }
2465
+ function _iterable_to_array$k(iter) {
2466
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2467
+ }
2468
+ function _non_iterable_spread$k() {
2469
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2470
+ }
2471
+ function _to_consumable_array$k(arr) {
2472
+ return _array_without_holes$k(arr) || _iterable_to_array$k(arr) || _unsupported_iterable_to_array$v(arr) || _non_iterable_spread$k();
2473
+ }
2474
+ function _unsupported_iterable_to_array$v(o, minLen) {
2475
+ if (!o) return;
2476
+ if (typeof o === "string") return _array_like_to_array$v(o, minLen);
2477
+ var n = Object.prototype.toString.call(o).slice(8, -1);
2478
+ if (n === "Object" && o.constructor) n = o.constructor.name;
2479
+ if (n === "Map" || n === "Set") return Array.from(n);
2480
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$v(o, minLen);
2481
+ }
2343
2482
  /**
2344
2483
  * Set that is implemented internally using a Map, and input values have their keys read.
2345
2484
  *
@@ -2520,7 +2659,7 @@ function _define_property$k(obj, key, value) {
2520
2659
  * @returns An array of all stored values.
2521
2660
  */ key: "valuesArray",
2522
2661
  value: function valuesArray() {
2523
- return Array.from(this._map.values());
2662
+ return _to_consumable_array$k(this._map.values());
2524
2663
  }
2525
2664
  },
2526
2665
  {
@@ -2534,30 +2673,30 @@ function _define_property$k(obj, key, value) {
2534
2673
  }
2535
2674
  ();
2536
2675
 
2537
- function _array_like_to_array$n(arr, len) {
2676
+ function _array_like_to_array$u(arr, len) {
2538
2677
  if (len == null || len > arr.length) len = arr.length;
2539
2678
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2540
2679
  return arr2;
2541
2680
  }
2542
- function _array_without_holes$8(arr) {
2543
- if (Array.isArray(arr)) return _array_like_to_array$n(arr);
2681
+ function _array_without_holes$j(arr) {
2682
+ if (Array.isArray(arr)) return _array_like_to_array$u(arr);
2544
2683
  }
2545
- function _iterable_to_array$8(iter) {
2684
+ function _iterable_to_array$j(iter) {
2546
2685
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2547
2686
  }
2548
- function _non_iterable_spread$8() {
2687
+ function _non_iterable_spread$j() {
2549
2688
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2550
2689
  }
2551
- function _to_consumable_array$8(arr) {
2552
- return _array_without_holes$8(arr) || _iterable_to_array$8(arr) || _unsupported_iterable_to_array$n(arr) || _non_iterable_spread$8();
2690
+ function _to_consumable_array$j(arr) {
2691
+ return _array_without_holes$j(arr) || _iterable_to_array$j(arr) || _unsupported_iterable_to_array$u(arr) || _non_iterable_spread$j();
2553
2692
  }
2554
- function _unsupported_iterable_to_array$n(o, minLen) {
2693
+ function _unsupported_iterable_to_array$u(o, minLen) {
2555
2694
  if (!o) return;
2556
- if (typeof o === "string") return _array_like_to_array$n(o, minLen);
2695
+ if (typeof o === "string") return _array_like_to_array$u(o, minLen);
2557
2696
  var n = Object.prototype.toString.call(o).slice(8, -1);
2558
2697
  if (n === "Object" && o.constructor) n = o.constructor.name;
2559
2698
  if (n === "Map" || n === "Set") return Array.from(n);
2560
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$n(o, minLen);
2699
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$u(o, minLen);
2561
2700
  }
2562
2701
  var SORT_VALUE_LESS_THAN = -1;
2563
2702
  var SORT_VALUE_GREATER_THAN = 1;
@@ -2571,6 +2710,10 @@ function reverseCompareFn(compareFn) {
2571
2710
  * Convenience function that reverses the order of the sorted values if the order is specified descending.
2572
2711
  *
2573
2712
  * The input comparison function must be in ascending order.
2713
+ *
2714
+ * @param ascendingCompareFn - a comparison function that sorts in ascending order
2715
+ * @param order - the desired sort direction; defaults to 'asc'
2716
+ * @returns the original function if ascending, or a reversed version if descending
2574
2717
  */ function compareFnOrder(ascendingCompareFn) {
2575
2718
  var order = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 'asc';
2576
2719
  return order === 'asc' ? ascendingCompareFn : reverseCompareFn(ascendingCompareFn);
@@ -2609,7 +2752,7 @@ function reverseCompareFn(compareFn) {
2609
2752
  var doSort = sortWith != null;
2610
2753
  var result = values;
2611
2754
  if (alwaysReturnCopy || sortOnCopy && doSort) {
2612
- result = _to_consumable_array$8(values);
2755
+ result = _to_consumable_array$j(values);
2613
2756
  }
2614
2757
  if (doSort) {
2615
2758
  result = result.sort(sortWith);
@@ -2636,6 +2779,10 @@ function reverseCompareFn(compareFn) {
2636
2779
  }
2637
2780
  /**
2638
2781
  * Creates a SortValuesFunction using the input. If the input is not defined, or it's sort function is not defined, then returns mapIdentityFunction().
2782
+ *
2783
+ * @param sortRef - optional reference containing the sort comparison function
2784
+ * @param sortOnCopyDefault - whether to sort on a copy by default
2785
+ * @returns a sort function that sorts arrays, or the identity function if no sort comparison is configured
2639
2786
  */ function sortValuesFunctionOrMapIdentityWithSortRef(sortRef, sortOnCopyDefault) {
2640
2787
  var sortWith = sortRef === null || sortRef === void 0 ? void 0 : sortRef.sortWith;
2641
2788
  return sortWith ? sortValuesFunctionWithSortRef(sortRef, sortOnCopyDefault) : mapIdentityFunction();
@@ -2685,21 +2832,21 @@ function reverseCompareFn(compareFn) {
2685
2832
  };
2686
2833
  }
2687
2834
 
2688
- function _array_like_to_array$m(arr, len) {
2835
+ function _array_like_to_array$t(arr, len) {
2689
2836
  if (len == null || len > arr.length) len = arr.length;
2690
2837
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2691
2838
  return arr2;
2692
2839
  }
2693
- function _array_with_holes$j(arr) {
2840
+ function _array_with_holes$k(arr) {
2694
2841
  if (Array.isArray(arr)) return arr;
2695
2842
  }
2696
- function _array_without_holes$7(arr) {
2697
- if (Array.isArray(arr)) return _array_like_to_array$m(arr);
2843
+ function _array_without_holes$i(arr) {
2844
+ if (Array.isArray(arr)) return _array_like_to_array$t(arr);
2698
2845
  }
2699
- function _iterable_to_array$7(iter) {
2846
+ function _iterable_to_array$i(iter) {
2700
2847
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2701
2848
  }
2702
- function _iterable_to_array_limit$j(arr, i) {
2849
+ function _iterable_to_array_limit$k(arr, i) {
2703
2850
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
2704
2851
  if (_i == null) return;
2705
2852
  var _arr = [];
@@ -2723,25 +2870,25 @@ function _iterable_to_array_limit$j(arr, i) {
2723
2870
  }
2724
2871
  return _arr;
2725
2872
  }
2726
- function _non_iterable_rest$j() {
2873
+ function _non_iterable_rest$k() {
2727
2874
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2728
2875
  }
2729
- function _non_iterable_spread$7() {
2876
+ function _non_iterable_spread$i() {
2730
2877
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2731
2878
  }
2732
- function _sliced_to_array$j(arr, i) {
2733
- return _array_with_holes$j(arr) || _iterable_to_array_limit$j(arr, i) || _unsupported_iterable_to_array$m(arr, i) || _non_iterable_rest$j();
2879
+ function _sliced_to_array$k(arr, i) {
2880
+ return _array_with_holes$k(arr) || _iterable_to_array_limit$k(arr, i) || _unsupported_iterable_to_array$t(arr, i) || _non_iterable_rest$k();
2734
2881
  }
2735
- function _to_consumable_array$7(arr) {
2736
- return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$m(arr) || _non_iterable_spread$7();
2882
+ function _to_consumable_array$i(arr) {
2883
+ return _array_without_holes$i(arr) || _iterable_to_array$i(arr) || _unsupported_iterable_to_array$t(arr) || _non_iterable_spread$i();
2737
2884
  }
2738
- function _unsupported_iterable_to_array$m(o, minLen) {
2885
+ function _unsupported_iterable_to_array$t(o, minLen) {
2739
2886
  if (!o) return;
2740
- if (typeof o === "string") return _array_like_to_array$m(o, minLen);
2887
+ if (typeof o === "string") return _array_like_to_array$t(o, minLen);
2741
2888
  var n = Object.prototype.toString.call(o).slice(8, -1);
2742
2889
  if (n === "Object" && o.constructor) n = o.constructor.name;
2743
2890
  if (n === "Map" || n === "Set") return Array.from(n);
2744
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$m(o, minLen);
2891
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$t(o, minLen);
2745
2892
  }
2746
2893
  /**
2747
2894
  * Splits the input array into batches of a maximum size. Each batch carries its zero-based index as `.i`.
@@ -2757,7 +2904,7 @@ function _unsupported_iterable_to_array$m(o, minLen) {
2757
2904
  * // result[1] => ['c', 'd'], result[1].i => 1
2758
2905
  * ```
2759
2906
  */ function batch(input, batchSize) {
2760
- var array = _to_consumable_array$7(input); // Copy array before splicing it.
2907
+ var array = _to_consumable_array$i(input); // Copy array before splicing it.
2761
2908
  var batches = [];
2762
2909
  var i = 0;
2763
2910
  while(array.length > 0){
@@ -2824,6 +2971,9 @@ function _unsupported_iterable_to_array$m(o, minLen) {
2824
2971
  * @param orderKeys - Keys defining the desired order.
2825
2972
  * @param values - Values to reorder.
2826
2973
  * @param params - Configuration including key reader, duplicate handling, and new-item behavior.
2974
+ * @param params.readKey - function that extracts the grouping key from each value
2975
+ * @param params.chooseRetainedValue - function that selects which value to keep when duplicates share the same key; defaults to keeping the first
2976
+ * @param params.excludeNewItems - when true, values whose keys are not in `orderKeys` are omitted from the result; defaults to false
2827
2977
  * @returns The reordered values array.
2828
2978
  *
2829
2979
  * @example
@@ -2857,10 +3007,9 @@ function _unsupported_iterable_to_array$m(o, minLen) {
2857
3007
  newItems.push(getValue());
2858
3008
  }
2859
3009
  });
2860
- var result = _to_consumable_array$7(restoredOrder).concat(_to_consumable_array$7(newItems)).filter(function(x) {
3010
+ return _to_consumable_array$i(restoredOrder).concat(_to_consumable_array$i(newItems)).filter(function(x) {
2861
3011
  return x !== undefined;
2862
3012
  }); // Allow null to be passed.
2863
- return result;
2864
3013
  }
2865
3014
  /**
2866
3015
  * Compares two arrays by pairing items with matching keys and checking equality.
@@ -2869,20 +3018,22 @@ function _unsupported_iterable_to_array$m(o, minLen) {
2869
3018
  * @param a - First array to compare.
2870
3019
  * @param b - Second array to compare.
2871
3020
  * @param params - Key extraction and equality functions.
3021
+ * @param params.groupKeyFn - function that extracts a grouping key from each element for pairing
3022
+ * @param params.isEqual - predicate that returns true when two paired elements are considered equal
2872
3023
  * @returns `true` if the array contents differ.
2873
3024
  */ function arrayContentsDiffer() {
2874
3025
  var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [], b = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [], _ref = arguments.length > 2 ? arguments[2] : void 0, groupKeyFn = _ref.groupKeyFn, isEqual = _ref.isEqual;
2875
3026
  var areDifferent = false;
2876
3027
  if (a.length === b.length) {
2877
- var pairs = pairGroupValues(_to_consumable_array$7(a).concat(_to_consumable_array$7(b)), groupKeyFn);
2878
- if (pairs.unpaired) {
3028
+ var pairs = pairGroupValues(_to_consumable_array$i(a).concat(_to_consumable_array$i(b)), groupKeyFn);
3029
+ if (pairs.unpaired.length > 0) {
2879
3030
  // Any unpaired items means there is a difference.
2880
3031
  areDifferent = true;
2881
3032
  } else {
2882
3033
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2883
3034
  try {
2884
3035
  for(var _iterator = pairs.pairs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2885
- var _step_value = _sliced_to_array$j(_step.value, 2), aa = _step_value[0], bb = _step_value[1];
3036
+ var _step_value = _sliced_to_array$k(_step.value, 2), aa = _step_value[0], bb = _step_value[1];
2886
3037
  // If any item is not the same, break.
2887
3038
  if (!isEqual(aa, bb)) {
2888
3039
  areDifferent = true;
@@ -2952,12 +3103,13 @@ function _unsupported_iterable_to_array$m(o, minLen) {
2952
3103
  * @param checkInclusion - Returns `true` for values that should be included.
2953
3104
  * @returns A {@link SeparateResult} with included and excluded arrays.
2954
3105
  */ function separateValues(values, checkInclusion) {
3106
+ var _result_in, _result_out;
2955
3107
  var result = groupValues(values, function(x) {
2956
3108
  return checkInclusion(x) ? 'in' : 'out';
2957
3109
  });
2958
3110
  return {
2959
- included: result.in || [],
2960
- excluded: result.out || []
3111
+ included: (_result_in = result.in) !== null && _result_in !== void 0 ? _result_in : [],
3112
+ excluded: (_result_out = result.out) !== null && _result_out !== void 0 ? _result_out : []
2961
3113
  };
2962
3114
  }
2963
3115
  function groupValues(values, groupKeyFn) {
@@ -2982,15 +3134,21 @@ function makeValuesGroupMap(values, groupKeyFn) {
2982
3134
  return map;
2983
3135
  }
2984
3136
 
2985
- function _array_like_to_array$l(arr, len) {
3137
+ function _array_like_to_array$s(arr, len) {
2986
3138
  if (len == null || len > arr.length) len = arr.length;
2987
3139
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
2988
3140
  return arr2;
2989
3141
  }
2990
- function _array_with_holes$i(arr) {
3142
+ function _array_with_holes$j(arr) {
2991
3143
  if (Array.isArray(arr)) return arr;
2992
3144
  }
2993
- function _iterable_to_array_limit$i(arr, i) {
3145
+ function _array_without_holes$h(arr) {
3146
+ if (Array.isArray(arr)) return _array_like_to_array$s(arr);
3147
+ }
3148
+ function _iterable_to_array$h(iter) {
3149
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
3150
+ }
3151
+ function _iterable_to_array_limit$j(arr, i) {
2994
3152
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
2995
3153
  if (_i == null) return;
2996
3154
  var _arr = [];
@@ -3014,19 +3172,25 @@ function _iterable_to_array_limit$i(arr, i) {
3014
3172
  }
3015
3173
  return _arr;
3016
3174
  }
3017
- function _non_iterable_rest$i() {
3175
+ function _non_iterable_rest$j() {
3018
3176
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3019
3177
  }
3020
- function _sliced_to_array$i(arr, i) {
3021
- return _array_with_holes$i(arr) || _iterable_to_array_limit$i(arr, i) || _unsupported_iterable_to_array$l(arr, i) || _non_iterable_rest$i();
3178
+ function _non_iterable_spread$h() {
3179
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3022
3180
  }
3023
- function _unsupported_iterable_to_array$l(o, minLen) {
3181
+ function _sliced_to_array$j(arr, i) {
3182
+ return _array_with_holes$j(arr) || _iterable_to_array_limit$j(arr, i) || _unsupported_iterable_to_array$s(arr, i) || _non_iterable_rest$j();
3183
+ }
3184
+ function _to_consumable_array$h(arr) {
3185
+ return _array_without_holes$h(arr) || _iterable_to_array$h(arr) || _unsupported_iterable_to_array$s(arr) || _non_iterable_spread$h();
3186
+ }
3187
+ function _unsupported_iterable_to_array$s(o, minLen) {
3024
3188
  if (!o) return;
3025
- if (typeof o === "string") return _array_like_to_array$l(o, minLen);
3189
+ if (typeof o === "string") return _array_like_to_array$s(o, minLen);
3026
3190
  var n = Object.prototype.toString.call(o).slice(8, -1);
3027
3191
  if (n === "Object" && o.constructor) n = o.constructor.name;
3028
3192
  if (n === "Map" || n === "Set") return Array.from(n);
3029
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$l(o, minLen);
3193
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$s(o, minLen);
3030
3194
  }
3031
3195
  /**
3032
3196
  * Combines multiple Maps into a single Map. Later maps override earlier values for the same key.
@@ -3064,7 +3228,7 @@ function _unsupported_iterable_to_array$l(o, minLen) {
3064
3228
  * @param map - The map to convert
3065
3229
  * @returns An array of [key, value] tuples
3066
3230
  */ function mapToTuples(map) {
3067
- return Array.from(map.entries());
3231
+ return _to_consumable_array$h(map.entries());
3068
3232
  }
3069
3233
  /**
3070
3234
  * Expands a Map with array values into individual key/value tuples.
@@ -3082,7 +3246,7 @@ function _unsupported_iterable_to_array$l(o, minLen) {
3082
3246
  */ function expandArrayValueTuples(values) {
3083
3247
  var tuples = [];
3084
3248
  values.forEach(function(param) {
3085
- var _param = _sliced_to_array$i(param, 2), key = _param[0], _$values = _param[1];
3249
+ var _param = _sliced_to_array$j(param, 2), key = _param[0], _$values = _param[1];
3086
3250
  useIterableOrValue(_$values, function(value) {
3087
3251
  tuples.push([
3088
3252
  key,
@@ -3302,10 +3466,8 @@ function _unsupported_iterable_to_array$l(o, minLen) {
3302
3466
  return function(input) {
3303
3467
  if (typeof input === 'number') {
3304
3468
  return decoder(input);
3305
- } else if (input != null) {
3306
- return encodeBitwiseSet(input);
3307
3469
  } else {
3308
- return 0;
3470
+ return encodeBitwiseSet(input);
3309
3471
  }
3310
3472
  };
3311
3473
  }
@@ -3348,10 +3510,8 @@ function _unsupported_iterable_to_array$l(o, minLen) {
3348
3510
  return function(input) {
3349
3511
  if (typeof input === 'number') {
3350
3512
  return decoder(input);
3351
- } else if (input != null) {
3352
- return encoder(input);
3353
3513
  } else {
3354
- return 0;
3514
+ return encoder(input);
3355
3515
  }
3356
3516
  };
3357
3517
  }
@@ -3451,7 +3611,6 @@ function getValueFromGetter(input, args) {
3451
3611
  * @returns An ObjectCopyFactory for the input
3452
3612
  */ function asObjectCopyFactory(input, copyFunction) {
3453
3613
  if ((typeof input === "undefined" ? "undefined" : _type_of$j(input)) === 'object') {
3454
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
3455
3614
  return objectCopyFactory(input, copyFunction);
3456
3615
  } else {
3457
3616
  return asGetter(input);
@@ -3563,8 +3722,7 @@ function makeWithFactoryInput(factory, input) {
3563
3722
  } else {
3564
3723
  // when fencePosts is true, we're wrapping to the nearest fence post, meaning wraps are one value longer increased on that side.
3565
3724
  var fencePostOffset = fencePosts ? input < min ? 1 : -1 : 0;
3566
- var wrappedValue = ((input - min) % distance + distance) % distance + min + fencePostOffset;
3567
- return wrappedValue;
3725
+ return ((input - min) % distance + distance) % distance + min + fencePostOffset;
3568
3726
  }
3569
3727
  };
3570
3728
  fn._wrap = wrapNumberFunctionConfig;
@@ -3702,11 +3860,14 @@ function _type_of$i(obj) {
3702
3860
  var y = Math.ceil(to);
3703
3861
  var totalNumbers = y - x + 1;
3704
3862
  var sum = x + y;
3705
- var sumOfIntegers = sum / 2 * totalNumbers;
3706
- return sumOfIntegers;
3863
+ return sum / 2 * totalNumbers;
3707
3864
  }
3708
3865
  /**
3709
3866
  * A {@link SortCompareFunction} for numbers that sorts in ascending order.
3867
+ *
3868
+ * @param a - the first number to compare
3869
+ * @param b - the second number to compare
3870
+ * @returns a negative value if `a` is less than `b`, zero if equal, or a positive value if `a` is greater
3710
3871
  */ var sortCompareNumberFunction = function sortCompareNumberFunction(a, b) {
3711
3872
  return a - b;
3712
3873
  };
@@ -4588,7 +4749,7 @@ function indexRangeCheckFunctionConfigToIndexRange(param) {
4588
4749
  var indexRange = param.indexRange, inclusiveMaxIndex = param.inclusiveMaxIndex;
4589
4750
  if (inclusiveMaxIndex) {
4590
4751
  var minIndex = indexRange.minIndex, maxIndexInput = indexRange.maxIndex;
4591
- var maxIndex = inclusiveMaxIndex ? maxIndexInput + 1 : maxIndexInput;
4752
+ var maxIndex = maxIndexInput + 1;
4592
4753
  return {
4593
4754
  minIndex: minIndex,
4594
4755
  maxIndex: maxIndex
@@ -4749,7 +4910,8 @@ function indexRangeCheckFunctionConfigToIndexRange(param) {
4749
4910
  * @param step - number of steps to take (positive or negative); defaults to 1
4750
4911
  * @param wrapAround - whether to wrap out-of-bound results; defaults to false
4751
4912
  * @returns the resulting index, or undefined if out of bounds without wrapping
4752
- */ function stepsFromIndex(range, startIndex) {
4913
+ */ // eslint-disable-next-line @typescript-eslint/max-params
4914
+ function stepsFromIndex(range, startIndex) {
4753
4915
  var step = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 1, wrapAround = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
4754
4916
  return stepsFromIndexFunction({
4755
4917
  range: range
@@ -4853,11 +5015,11 @@ function indexRangeCheckFunctionConfigToIndexRange(param) {
4853
5015
  *
4854
5016
  * If order is irrelevant, use filterValuesByDistanceNoOrder() instead.
4855
5017
  *
4856
- * @param input - The array of values to filter
4857
- * @param minDistance - The minimum distance required between values
4858
- * @param getValue - Function that extracts a numeric value from each item for distance comparison
5018
+ * @param _input - The array of values to filter
5019
+ * @param _minDistance - The minimum distance required between values
5020
+ * @param _getValue - Function that extracts a numeric value from each item for distance comparison
4859
5021
  * @returns A filtered array with only values that are at least minDistance apart
4860
- */ function filterValuesByDistance(input, minDistance, getValue) {
5022
+ */ function filterValuesByDistance(_input, _minDistance, _getValue) {
4861
5023
  // TODO(FUTURE): Implement if needed.
4862
5024
  throw new Error('Incomplete implementation!');
4863
5025
  }
@@ -4928,7 +5090,8 @@ function indexRangeCheckFunctionConfigToIndexRange(param) {
4928
5090
  * @param compare - AscendingSortCompareFunction to compare two values to determine which is the best fit
4929
5091
  * @param updateNonBestFit - Function that transforms non-best-fit items
4930
5092
  * @returns A new array with only the best fit item and transformed non-best-fit items
4931
- */ function makeBestFit(input, filter, compare, updateNonBestFit) {
5093
+ */ // eslint-disable-next-line @typescript-eslint/max-params
5094
+ function makeBestFit(input, filter, compare, updateNonBestFit) {
4932
5095
  return applyBestFit(copyArray(input), filter, compare, updateNonBestFit);
4933
5096
  }
4934
5097
  /**
@@ -4942,7 +5105,8 @@ function indexRangeCheckFunctionConfigToIndexRange(param) {
4942
5105
  * @param compare - AscendingSortCompareFunction to compare two values to determine which is the best fit
4943
5106
  * @param updateNonBestFit - Function that transforms non-best-fit items
4944
5107
  * @returns The modified input array with only the best fit item and transformed non-best-fit items
4945
- */ function applyBestFit(input, filter, compare, updateNonBestFit) {
5108
+ */ // eslint-disable-next-line @typescript-eslint/max-params
5109
+ function applyBestFit(input, filter, compare, updateNonBestFit) {
4946
5110
  var matchIndexSet = findToIndexSet(input, filter);
4947
5111
  if (matchIndexSet.length > 1) {
4948
5112
  var expansion = expandIndexSet(input, matchIndexSet);
@@ -5031,7 +5195,8 @@ function terminatingFactoryFromArray(array, terminatingValue) {
5031
5195
  * @param wrapAround - Whether to wrap around to the beginning of the array if the found value is at or near the last index.
5032
5196
  * @param steps - Number of steps forward from the found index. Defaults to 1.
5033
5197
  * @returns The value at the next index, or undefined if no match is found or no next value exists.
5034
- */ function findNext(array, find) {
5198
+ */ // eslint-disable-next-line @typescript-eslint/max-params
5199
+ function findNext(array, find) {
5035
5200
  var wrapAround = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false, steps = arguments.length > 3 ? arguments[3] : void 0;
5036
5201
  var result;
5037
5202
  if (array) {
@@ -5056,7 +5221,8 @@ function terminatingFactoryFromArray(array, terminatingValue) {
5056
5221
  * @param wrapAround - Whether to wrap around when stepping past the end of the array.
5057
5222
  * @param steps - Number of steps forward from the current index.
5058
5223
  * @returns The computed next index, or undefined if the input index is out of bounds.
5059
- */ function getArrayNextIndex(array, index) {
5224
+ */ // eslint-disable-next-line @typescript-eslint/max-params
5225
+ function getArrayNextIndex(array, index) {
5060
5226
  var wrapAround = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false, steps = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 1;
5061
5227
  var nextIndex;
5062
5228
  var arrayLength = array.length;
@@ -5236,12 +5402,12 @@ function arrayToObject(values, keyFn) {
5236
5402
  * @param readKey - function to extract a key from an existing item
5237
5403
  * @param generateFn - function to create a new item for a key not found in existing items
5238
5404
  * @returns an array of items corresponding to each input key, in the same order
5239
- */ function generateIfDoesNotExist(keys, existing, readKey, generateFn) {
5405
+ */ // eslint-disable-next-line @typescript-eslint/max-params
5406
+ function generateIfDoesNotExist(keys, existing, readKey, generateFn) {
5240
5407
  var map = arrayToMap(existing, readKey);
5241
5408
  return keys.map(function(x) {
5242
5409
  var _map_get;
5243
- var value = (_map_get = map.get(x)) !== null && _map_get !== void 0 ? _map_get : generateFn(x);
5244
- return value;
5410
+ return (_map_get = map.get(x)) !== null && _map_get !== void 0 ? _map_get : generateFn(x);
5245
5411
  });
5246
5412
  }
5247
5413
 
@@ -5272,8 +5438,7 @@ function arrayToObject(values, keyFn) {
5272
5438
  return 0;
5273
5439
  } else {
5274
5440
  var random = Math.random();
5275
- var index = Math.round(random * (values.length - 1));
5276
- return index;
5441
+ return Math.round(random * (values.length - 1));
5277
5442
  }
5278
5443
  }
5279
5444
  /**
@@ -5609,6 +5774,7 @@ function caseInsensitiveString(input) {
5609
5774
 
5610
5775
  /**
5611
5776
  * Trims leading and trailing whitespace from a string.
5777
+ *
5612
5778
  * @param input The string to trim.
5613
5779
  * @returns The trimmed string.
5614
5780
  */ function stringTrimFunction(input) {
@@ -5616,6 +5782,7 @@ function caseInsensitiveString(input) {
5616
5782
  }
5617
5783
  /**
5618
5784
  * Converts a string to uppercase.
5785
+ *
5619
5786
  * @param input The string to convert.
5620
5787
  * @returns The uppercase string.
5621
5788
  */ function stringToUppercaseFunction(input) {
@@ -5623,6 +5790,7 @@ function caseInsensitiveString(input) {
5623
5790
  }
5624
5791
  /**
5625
5792
  * Converts a string to lowercase.
5793
+ *
5626
5794
  * @param input The string to convert.
5627
5795
  * @returns The lowercase string.
5628
5796
  */ function stringToLowercaseFunction(input) {
@@ -5684,9 +5852,7 @@ function caseInsensitiveString(input) {
5684
5852
  transform = stringTrimFunction;
5685
5853
  }
5686
5854
  }
5687
- if (transform == null) {
5688
- transform = MAP_IDENTITY;
5689
- }
5855
+ transform !== null && transform !== void 0 ? transform : transform = MAP_IDENTITY;
5690
5856
  return transform;
5691
5857
  }
5692
5858
  /**
@@ -5700,6 +5866,7 @@ function caseInsensitiveString(input) {
5700
5866
  }
5701
5867
  /**
5702
5868
  * Creates a function that adds a configured prefix to the input string if it does not exist on that string.
5869
+ *
5703
5870
  * @param prefix The prefix to add.
5704
5871
  * @returns A function that adds the prefix to a string.
5705
5872
  */ function addPrefixFunction(prefix) {
@@ -5709,6 +5876,7 @@ function caseInsensitiveString(input) {
5709
5876
  }
5710
5877
  /**
5711
5878
  * Adds a suffix to a string if it does not already end with that suffix.
5879
+ *
5712
5880
  * @param suffix The suffix to add.
5713
5881
  * @param input The string to modify.
5714
5882
  * @returns The modified string.
@@ -5717,6 +5885,7 @@ function caseInsensitiveString(input) {
5717
5885
  }
5718
5886
  /**
5719
5887
  * Creates a function that adds a configured suffix to the input string if it does not exist on that string.
5888
+ *
5720
5889
  * @param suffix The suffix to add.
5721
5890
  * @returns A function that adds the suffix to a string.
5722
5891
  */ function addSuffixFunction(suffix) {
@@ -5726,6 +5895,7 @@ function caseInsensitiveString(input) {
5726
5895
  }
5727
5896
  /**
5728
5897
  * Pads the start of a string to a minimum length.
5898
+ *
5729
5899
  * @param minLength The minimum length of the string.
5730
5900
  * @param padCharacter The character to use for padding.
5731
5901
  * @returns A function that pads the start of a string.
@@ -5769,6 +5939,31 @@ function caseInsensitiveString(input) {
5769
5939
  }
5770
5940
  }
5771
5941
 
5942
+ function _array_like_to_array$r(arr, len) {
5943
+ if (len == null || len > arr.length) len = arr.length;
5944
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
5945
+ return arr2;
5946
+ }
5947
+ function _array_without_holes$g(arr) {
5948
+ if (Array.isArray(arr)) return _array_like_to_array$r(arr);
5949
+ }
5950
+ function _iterable_to_array$g(iter) {
5951
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
5952
+ }
5953
+ function _non_iterable_spread$g() {
5954
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
5955
+ }
5956
+ function _to_consumable_array$g(arr) {
5957
+ return _array_without_holes$g(arr) || _iterable_to_array$g(arr) || _unsupported_iterable_to_array$r(arr) || _non_iterable_spread$g();
5958
+ }
5959
+ function _unsupported_iterable_to_array$r(o, minLen) {
5960
+ if (!o) return;
5961
+ if (typeof o === "string") return _array_like_to_array$r(o, minLen);
5962
+ var n = Object.prototype.toString.call(o).slice(8, -1);
5963
+ if (n === "Object" && o.constructor) n = o.constructor.name;
5964
+ if (n === "Map" || n === "Set") return Array.from(n);
5965
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$r(o, minLen);
5966
+ }
5772
5967
  /**
5773
5968
  * Compares two string arrays and returns whether they contain different values, ignoring case.
5774
5969
  *
@@ -5824,7 +6019,7 @@ function caseInsensitiveString(input) {
5824
6019
  * @param values - iterable of strings to deduplicate
5825
6020
  * @returns an array of unique lowercase strings
5826
6021
  */ function uniqueCaseInsensitiveStrings(values) {
5827
- return Array.from(uniqueCaseInsensitiveStringsSet(values));
6022
+ return _to_consumable_array$g(uniqueCaseInsensitiveStringsSet(values));
5828
6023
  }
5829
6024
  /**
5830
6025
  * Returns a {@link Set} of unique lowercase strings from the input, compared case-insensitively.
@@ -6028,6 +6223,7 @@ function _is_native_reflect_construct$4() {
6028
6223
  key: "target",
6029
6224
  get: /**
6030
6225
  * Gets the target object that failed the assertion.
6226
+ *
6031
6227
  * @returns The target object
6032
6228
  */ function get() {
6033
6229
  return this._target;
@@ -6037,6 +6233,7 @@ function _is_native_reflect_construct$4() {
6037
6233
  key: "propertyKey",
6038
6234
  get: /**
6039
6235
  * Gets the property key that failed the assertion.
6236
+ *
6040
6237
  * @returns The property key as a string
6041
6238
  */ function get() {
6042
6239
  return this._property;
@@ -6055,6 +6252,7 @@ function _is_native_reflect_construct$4() {
6055
6252
  {
6056
6253
  /**
6057
6254
  * Handles an assertion issue by throwing an appropriate exception.
6255
+ *
6058
6256
  * @param error - The assertion issue to handle
6059
6257
  * @throws AssertionError
6060
6258
  */ key: "handle",
@@ -6065,6 +6263,7 @@ function _is_native_reflect_construct$4() {
6065
6263
  {
6066
6264
  /**
6067
6265
  * Builds an AssertionError from an AssertionIssue.
6266
+ *
6068
6267
  * @param error - The assertion issue to build an exception from
6069
6268
  * @returns A new AssertionError instance
6070
6269
  */ key: "buildException",
@@ -6077,12 +6276,14 @@ function _is_native_reflect_construct$4() {
6077
6276
  /**
6078
6277
  * Builds an error message string from an AssertionIssue.
6079
6278
  * Uses the custom message if provided, otherwise creates a default message.
6279
+ *
6080
6280
  * @param error - The assertion issue to build a message for
6081
6281
  * @returns The error message string
6082
6282
  */ key: "buildExceptionString",
6083
6283
  value: function buildExceptionString(error) {
6284
+ var _error_options;
6084
6285
  var message;
6085
- if (error.options && error.options.message) {
6286
+ if ((_error_options = error.options) === null || _error_options === void 0 ? void 0 : _error_options.message) {
6086
6287
  message = error.options.message;
6087
6288
  } else {
6088
6289
  message = "Assertion failed for property '" + error.propertyKey + '".';
@@ -6169,7 +6370,8 @@ function _object_spread$e(target) {
6169
6370
  options = _object_spread$e({}, defaultOptions, options);
6170
6371
  return this.makeSetPropertyDescriptorInterceptor(function(param) {
6171
6372
  var target = param.target, propertyKey = param.propertyKey, setValue = param.setValue;
6172
- var map = (options === null || options === void 0 ? void 0 : options.map) || function(x) {
6373
+ var _options_map;
6374
+ var map = (_options_map = options.map) !== null && _options_map !== void 0 ? _options_map : function(x) {
6173
6375
  return x;
6174
6376
  };
6175
6377
  return function(value) {
@@ -6307,9 +6509,9 @@ function _object_spread$e(target) {
6307
6509
  break;
6308
6510
  default:
6309
6511
  filter = function filter(value, i) {
6310
- return filters.findIndex(function(filter) {
6512
+ return !filters.some(function(filter) {
6311
6513
  return !filter(value, i);
6312
- }) === -1;
6514
+ });
6313
6515
  };
6314
6516
  break;
6315
6517
  }
@@ -6323,15 +6525,15 @@ function _object_spread$e(target) {
6323
6525
  * @returns The inverted filter function, or the original if invert is false
6324
6526
  */ var invertFilter = invertBooleanReturnFunction;
6325
6527
 
6326
- function _array_like_to_array$k(arr, len) {
6528
+ function _array_like_to_array$q(arr, len) {
6327
6529
  if (len == null || len > arr.length) len = arr.length;
6328
6530
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
6329
6531
  return arr2;
6330
6532
  }
6331
- function _array_with_holes$h(arr) {
6533
+ function _array_with_holes$i(arr) {
6332
6534
  if (Array.isArray(arr)) return arr;
6333
6535
  }
6334
- function _iterable_to_array_limit$h(arr, i) {
6536
+ function _iterable_to_array_limit$i(arr, i) {
6335
6537
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
6336
6538
  if (_i == null) return;
6337
6539
  var _arr = [];
@@ -6355,29 +6557,31 @@ function _iterable_to_array_limit$h(arr, i) {
6355
6557
  }
6356
6558
  return _arr;
6357
6559
  }
6358
- function _non_iterable_rest$h() {
6560
+ function _non_iterable_rest$i() {
6359
6561
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6360
6562
  }
6361
- function _sliced_to_array$h(arr, i) {
6362
- return _array_with_holes$h(arr) || _iterable_to_array_limit$h(arr, i) || _unsupported_iterable_to_array$k(arr, i) || _non_iterable_rest$h();
6563
+ function _sliced_to_array$i(arr, i) {
6564
+ return _array_with_holes$i(arr) || _iterable_to_array_limit$i(arr, i) || _unsupported_iterable_to_array$q(arr, i) || _non_iterable_rest$i();
6363
6565
  }
6364
6566
  function _type_of$f(obj) {
6365
6567
  "@swc/helpers - typeof";
6366
6568
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
6367
6569
  }
6368
- function _unsupported_iterable_to_array$k(o, minLen) {
6570
+ function _unsupported_iterable_to_array$q(o, minLen) {
6369
6571
  if (!o) return;
6370
- if (typeof o === "string") return _array_like_to_array$k(o, minLen);
6572
+ if (typeof o === "string") return _array_like_to_array$q(o, minLen);
6371
6573
  var n = Object.prototype.toString.call(o).slice(8, -1);
6372
6574
  if (n === "Object" && o.constructor) n = o.constructor.name;
6373
6575
  if (n === "Map" || n === "Set") return Array.from(n);
6374
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$k(o, minLen);
6576
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$q(o, minLen);
6375
6577
  }
6376
6578
  /**
6377
6579
  * Iterates over filtered key/value tuples of an object and invokes a callback for each.
6378
6580
  *
6379
6581
  * @param obj - Object to iterate
6380
6582
  * @param config - Configuration with a forEach callback and optional filter
6583
+ * @param config.forEach - callback invoked for each key/value tuple that passes the filter
6584
+ * @param config.filter - optional filter controlling which key/value tuples are iterated; when omitted, all tuples are visited
6381
6585
  *
6382
6586
  * @example
6383
6587
  * ```ts
@@ -6513,43 +6717,43 @@ function _unsupported_iterable_to_array$k(o, minLen) {
6513
6717
  switch(type){
6514
6718
  case exports.KeyValueTypleValueFilter.UNDEFINED:
6515
6719
  filterFn = function filterFn(param) {
6516
- var _param = _sliced_to_array$h(param, 2), x = _param[1];
6720
+ var _param = _sliced_to_array$i(param, 2), x = _param[1];
6517
6721
  return x !== undefined;
6518
6722
  };
6519
6723
  break;
6520
6724
  case exports.KeyValueTypleValueFilter.NULL:
6521
6725
  filterFn = function filterFn(param) {
6522
- var _param = _sliced_to_array$h(param, 2), x = _param[1];
6726
+ var _param = _sliced_to_array$i(param, 2), x = _param[1];
6523
6727
  return x != null;
6524
6728
  };
6525
6729
  break;
6526
6730
  case exports.KeyValueTypleValueFilter.FALSY:
6527
6731
  filterFn = function filterFn(param) {
6528
- var _param = _sliced_to_array$h(param, 2), x = _param[1];
6732
+ var _param = _sliced_to_array$i(param, 2), x = _param[1];
6529
6733
  return Boolean(x);
6530
6734
  };
6531
6735
  break;
6532
6736
  case exports.KeyValueTypleValueFilter.EMPTY:
6533
6737
  filterFn = function filterFn(param) {
6534
- var _param = _sliced_to_array$h(param, 2), x = _param[1];
6738
+ var _param = _sliced_to_array$i(param, 2), x = _param[1];
6535
6739
  return hasValueOrNotEmpty(x);
6536
6740
  };
6537
6741
  break;
6538
6742
  case exports.KeyValueTypleValueFilter.EMPTY_STRICT:
6539
6743
  filterFn = function filterFn(param) {
6540
- var _param = _sliced_to_array$h(param, 2), x = _param[1];
6744
+ var _param = _sliced_to_array$i(param, 2), x = _param[1];
6541
6745
  return hasValueOrNotEmptyObject(x);
6542
6746
  };
6543
6747
  break;
6544
6748
  case exports.KeyValueTypleValueFilter.FALSY_AND_EMPTY:
6545
6749
  filterFn = function filterFn(param) {
6546
- var _param = _sliced_to_array$h(param, 2), x = _param[1];
6750
+ var _param = _sliced_to_array$i(param, 2), x = _param[1];
6547
6751
  return Boolean(x) && hasValueOrNotEmpty(x);
6548
6752
  };
6549
6753
  break;
6550
6754
  case exports.KeyValueTypleValueFilter.FALSY_AND_EMPTY_STRICT:
6551
6755
  filterFn = function filterFn(param) {
6552
- var _param = _sliced_to_array$h(param, 2), x = _param[1];
6756
+ var _param = _sliced_to_array$i(param, 2), x = _param[1];
6553
6757
  return Boolean(x) && hasValueOrNotEmptyObject(x);
6554
6758
  };
6555
6759
  break;
@@ -6636,12 +6840,12 @@ function cachedGetter(factory) {
6636
6840
  };
6637
6841
  }
6638
6842
 
6639
- function _array_like_to_array$j(arr, len) {
6843
+ function _array_like_to_array$p(arr, len) {
6640
6844
  if (len == null || len > arr.length) len = arr.length;
6641
6845
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
6642
6846
  return arr2;
6643
6847
  }
6644
- function _array_with_holes$g(arr) {
6848
+ function _array_with_holes$h(arr) {
6645
6849
  if (Array.isArray(arr)) return arr;
6646
6850
  }
6647
6851
  function _define_property$h(obj, key, value) {
@@ -6657,7 +6861,7 @@ function _define_property$h(obj, key, value) {
6657
6861
  }
6658
6862
  return obj;
6659
6863
  }
6660
- function _iterable_to_array_limit$g(arr, i) {
6864
+ function _iterable_to_array_limit$h(arr, i) {
6661
6865
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
6662
6866
  if (_i == null) return;
6663
6867
  var _arr = [];
@@ -6681,7 +6885,7 @@ function _iterable_to_array_limit$g(arr, i) {
6681
6885
  }
6682
6886
  return _arr;
6683
6887
  }
6684
- function _non_iterable_rest$g() {
6888
+ function _non_iterable_rest$h() {
6685
6889
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
6686
6890
  }
6687
6891
  function _object_spread$d(target) {
@@ -6699,20 +6903,20 @@ function _object_spread$d(target) {
6699
6903
  }
6700
6904
  return target;
6701
6905
  }
6702
- function _sliced_to_array$g(arr, i) {
6703
- return _array_with_holes$g(arr) || _iterable_to_array_limit$g(arr, i) || _unsupported_iterable_to_array$j(arr, i) || _non_iterable_rest$g();
6906
+ function _sliced_to_array$h(arr, i) {
6907
+ return _array_with_holes$h(arr) || _iterable_to_array_limit$h(arr, i) || _unsupported_iterable_to_array$p(arr, i) || _non_iterable_rest$h();
6704
6908
  }
6705
6909
  function _type_of$e(obj) {
6706
6910
  "@swc/helpers - typeof";
6707
6911
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
6708
6912
  }
6709
- function _unsupported_iterable_to_array$j(o, minLen) {
6913
+ function _unsupported_iterable_to_array$p(o, minLen) {
6710
6914
  if (!o) return;
6711
- if (typeof o === "string") return _array_like_to_array$j(o, minLen);
6915
+ if (typeof o === "string") return _array_like_to_array$p(o, minLen);
6712
6916
  var n = Object.prototype.toString.call(o).slice(8, -1);
6713
6917
  if (n === "Object" && o.constructor) n = o.constructor.name;
6714
6918
  if (n === "Map" || n === "Set") return Array.from(n);
6715
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$j(o, minLen);
6919
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$p(o, minLen);
6716
6920
  }
6717
6921
  // MARK: Object Merging/Overriding
6718
6922
  /**
@@ -6757,6 +6961,9 @@ function _unsupported_iterable_to_array$j(o, minLen) {
6757
6961
  * By default, `undefined` values in sources are excluded from the template.
6758
6962
  *
6759
6963
  * @param config - Configuration controlling filtering, copying, and caching behavior.
6964
+ * @param config.filter - filter applied to source object values when building the template; by default, `undefined` values are excluded
6965
+ * @param config.copy - when true, the target object is shallow-copied before applying overrides instead of being mutated in place
6966
+ * @param config.dynamic - when true, the template is recalculated on each call instead of being cached; useful when source objects may change over time
6760
6967
  * @returns A factory function that accepts source objects and returns an override function.
6761
6968
  *
6762
6969
  * @example
@@ -7002,8 +7209,9 @@ function _unsupported_iterable_to_array$j(o, minLen) {
7002
7209
  */ function findPOJOKeysFunction(filter) {
7003
7210
  var findEachMatchingKeyOnTarget = forEachKeyValueOnPOJOFunction({
7004
7211
  filter: filter,
7212
+ // eslint-disable-next-line @typescript-eslint/max-params
7005
7213
  forEach: function forEach(param, i, obj, context) {
7006
- var _param = _sliced_to_array$g(param, 1), key = _param[0];
7214
+ var _param = _sliced_to_array$h(param, 1), key = _param[0];
7007
7215
  context.keys.push(key);
7008
7216
  }
7009
7217
  });
@@ -7055,6 +7263,7 @@ function _unsupported_iterable_to_array$j(o, minLen) {
7055
7263
  var filter = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : exports.KeyValueTypleValueFilter.UNDEFINED;
7056
7264
  var countEachMatchingKeyOnTarget = forEachKeyValueOnPOJOFunction({
7057
7265
  filter: filter,
7266
+ // eslint-disable-next-line @typescript-eslint/max-params
7058
7267
  forEach: function forEach(x, i, obj, context) {
7059
7268
  context.count += 1;
7060
7269
  }
@@ -7100,6 +7309,8 @@ function _unsupported_iterable_to_array$j(o, minLen) {
7100
7309
  * By default, removes `undefined` values (`KeyValueTypleValueFilter.UNDEFINED`) and does not copy (`copy: false`).
7101
7310
  *
7102
7311
  * @param config - Configuration for filtering and copying. Defaults to `{ copy: false, filter: { valueFilter: KeyValueTypleValueFilter.UNDEFINED } }`.
7312
+ * @param config.copy - when true, returns a shallow copy with filtered keys removed instead of mutating the input; defaults to false
7313
+ * @param config.filter - the filter criteria determining which key/value pairs to remove; defaults to removing `undefined` values
7103
7314
  * @returns A reusable filter function. The returned function also accepts a `copyOverride` argument to override the copy behavior per-call.
7104
7315
  *
7105
7316
  * @example
@@ -7123,7 +7334,7 @@ function _unsupported_iterable_to_array$j(o, minLen) {
7123
7334
  var forEachFn = forEachKeyValueOnPOJOFunction({
7124
7335
  filter: filter,
7125
7336
  forEach: function forEach(param, i, object) {
7126
- var _param = _sliced_to_array$g(param, 1), key = _param[0];
7337
+ var _param = _sliced_to_array$h(param, 1), key = _param[0];
7127
7338
  delete object[key];
7128
7339
  }
7129
7340
  });
@@ -7198,8 +7409,9 @@ function _unsupported_iterable_to_array$j(o, minLen) {
7198
7409
  var copy = (_ref = (typeof input === "undefined" ? "undefined" : _type_of$e(input)) === 'object' ? input.copy : true) !== null && _ref !== void 0 ? _ref : true;
7199
7410
  var assignEachValueToTarget = forEachKeyValueOnPOJOFunction({
7200
7411
  filter: filter,
7412
+ // eslint-disable-next-line @typescript-eslint/max-params
7201
7413
  forEach: function forEach(param, i, object, target) {
7202
- var _param = _sliced_to_array$g(param, 2), key = _param[0], value = _param[1];
7414
+ var _param = _sliced_to_array$h(param, 2), key = _param[0], value = _param[1];
7203
7415
  target[key] = value;
7204
7416
  }
7205
7417
  });
@@ -7259,8 +7471,9 @@ function _unsupported_iterable_to_array$j(o, minLen) {
7259
7471
  var filter = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : exports.KeyValueTypleValueFilter.UNDEFINED;
7260
7472
  var addValuesFromObjectToContext = forEachKeyValueOnPOJOFunction({
7261
7473
  filter: filter,
7474
+ // eslint-disable-next-line @typescript-eslint/max-params
7262
7475
  forEach: function forEach(param, i, obj, context) {
7263
- var _param = _sliced_to_array$g(param, 2), value = _param[1];
7476
+ var _param = _sliced_to_array$h(param, 2), value = _param[1];
7264
7477
  context.values.push(value);
7265
7478
  }
7266
7479
  });
@@ -7297,7 +7510,7 @@ function _unsupported_iterable_to_array$j(o, minLen) {
7297
7510
  var invertFilter = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
7298
7511
  var keysSet = new Set(keysToFilter);
7299
7512
  var filterFn = invertBooleanReturnFunction(function(param) {
7300
- var _param = _sliced_to_array$g(param, 1), key = _param[0];
7513
+ var _param = _sliced_to_array$h(param, 1), key = _param[0];
7301
7514
  return keysSet.has(key);
7302
7515
  }, invertFilter);
7303
7516
  return filterTuplesOnPOJOFunction(filterFn);
@@ -7336,6 +7549,8 @@ function _unsupported_iterable_to_array$j(o, minLen) {
7336
7549
  * When no filter is provided, all key/value pairs are iterated.
7337
7550
  *
7338
7551
  * @param config - The filter and forEach callback configuration.
7552
+ * @param config.forEach - callback invoked for each key/value pair that passes the filter
7553
+ * @param config.filter - optional filter controlling which key/value pairs are iterated; when omitted, all pairs are visited
7339
7554
  * @returns A function that iterates matching key/value pairs on any input object.
7340
7555
  *
7341
7556
  * @example
@@ -7500,15 +7715,15 @@ function isInSetDecisionFunction(set, inputReadValue) {
7500
7715
  }
7501
7716
  }
7502
7717
 
7503
- function _array_like_to_array$i(arr, len) {
7718
+ function _array_like_to_array$o(arr, len) {
7504
7719
  if (len == null || len > arr.length) len = arr.length;
7505
7720
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
7506
7721
  return arr2;
7507
7722
  }
7508
- function _array_with_holes$f(arr) {
7723
+ function _array_with_holes$g(arr) {
7509
7724
  if (Array.isArray(arr)) return arr;
7510
7725
  }
7511
- function _iterable_to_array_limit$f(arr, i) {
7726
+ function _iterable_to_array_limit$g(arr, i) {
7512
7727
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
7513
7728
  if (_i == null) return;
7514
7729
  var _arr = [];
@@ -7532,23 +7747,23 @@ function _iterable_to_array_limit$f(arr, i) {
7532
7747
  }
7533
7748
  return _arr;
7534
7749
  }
7535
- function _non_iterable_rest$f() {
7750
+ function _non_iterable_rest$g() {
7536
7751
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7537
7752
  }
7538
- function _sliced_to_array$f(arr, i) {
7539
- return _array_with_holes$f(arr) || _iterable_to_array_limit$f(arr, i) || _unsupported_iterable_to_array$i(arr, i) || _non_iterable_rest$f();
7753
+ function _sliced_to_array$g(arr, i) {
7754
+ return _array_with_holes$g(arr) || _iterable_to_array_limit$g(arr, i) || _unsupported_iterable_to_array$o(arr, i) || _non_iterable_rest$g();
7540
7755
  }
7541
7756
  function _type_of$d(obj) {
7542
7757
  "@swc/helpers - typeof";
7543
7758
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
7544
7759
  }
7545
- function _unsupported_iterable_to_array$i(o, minLen) {
7760
+ function _unsupported_iterable_to_array$o(o, minLen) {
7546
7761
  if (!o) return;
7547
- if (typeof o === "string") return _array_like_to_array$i(o, minLen);
7762
+ if (typeof o === "string") return _array_like_to_array$o(o, minLen);
7548
7763
  var n = Object.prototype.toString.call(o).slice(8, -1);
7549
7764
  if (n === "Object" && o.constructor) n = o.constructor.name;
7550
7765
  if (n === "Map" || n === "Set") return Array.from(n);
7551
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$i(o, minLen);
7766
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$o(o, minLen);
7552
7767
  }
7553
7768
  var AUTH_ROLE_CLAIMS_DEFAULT_CLAIM_VALUE = 1;
7554
7769
  var AUTH_ROLE_CLAIMS_DEFAULT_EMPTY_VALUE = null;
@@ -7564,16 +7779,13 @@ var AUTH_ROLE_CLAIMS_DEFAULT_EMPTY_VALUE = null;
7564
7779
  */ function authRoleClaimsService(config) {
7565
7780
  var defaults = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
7566
7781
  var _ref, _ref1;
7567
- var defaultClaimValue = (_ref = objectHasKey(defaults, 'claimValue') ? defaults === null || defaults === void 0 ? void 0 : defaults.claimValue : AUTH_ROLE_CLAIMS_DEFAULT_CLAIM_VALUE) !== null && _ref !== void 0 ? _ref : AUTH_ROLE_CLAIMS_DEFAULT_CLAIM_VALUE;
7568
- var defaultEmptyValue = (_ref1 = objectHasKey(defaults, 'emptyValue') ? defaults === null || defaults === void 0 ? void 0 : defaults.emptyValue : AUTH_ROLE_CLAIMS_DEFAULT_EMPTY_VALUE) !== null && _ref1 !== void 0 ? _ref1 : null;
7569
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
7782
+ var defaultClaimValue = (_ref = objectHasKey(defaults, 'claimValue') ? defaults.claimValue : AUTH_ROLE_CLAIMS_DEFAULT_CLAIM_VALUE) !== null && _ref !== void 0 ? _ref : AUTH_ROLE_CLAIMS_DEFAULT_CLAIM_VALUE;
7783
+ var defaultEmptyValue = (_ref1 = objectHasKey(defaults, 'emptyValue') ? defaults.emptyValue : AUTH_ROLE_CLAIMS_DEFAULT_EMPTY_VALUE) !== null && _ref1 !== void 0 ? _ref1 : null;
7570
7784
  function isSimpleOptions(entry) {
7571
- return entry.roles != null;
7785
+ return 'roles' in entry;
7572
7786
  }
7573
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
7574
- var tuples = Object.entries(config).filter(function(param) {
7575
- var _param = _sliced_to_array$f(param, 2), entry = _param[1];
7576
- return entry != null;
7787
+ var tuples = Object.entries(config).filter(function(x) {
7788
+ return x[1] != null;
7577
7789
  }) // skip any ignored/null values
7578
7790
  .map(function(x) {
7579
7791
  var inputEntry = x[1];
@@ -7650,7 +7862,7 @@ var AUTH_ROLE_CLAIMS_DEFAULT_EMPTY_VALUE = null;
7650
7862
  var claims = {};
7651
7863
  // iterate by each claim value to build the claims.
7652
7864
  tuples.forEach(function(param) {
7653
- var _param = _sliced_to_array$f(param, 2), claimsKey = _param[0], entry = _param[1];
7865
+ var _param = _sliced_to_array$g(param, 2), claimsKey = _param[0], entry = _param[1];
7654
7866
  var _entry_encodeValueFromRoles;
7655
7867
  var claimsValue = (_entry_encodeValueFromRoles = entry.encodeValueFromRoles(roles)) !== null && _entry_encodeValueFromRoles !== void 0 ? _entry_encodeValueFromRoles : defaultEmptyValue;
7656
7868
  claims[claimsKey] = claimsValue;
@@ -7658,8 +7870,9 @@ var AUTH_ROLE_CLAIMS_DEFAULT_EMPTY_VALUE = null;
7658
7870
  return claims;
7659
7871
  };
7660
7872
  var forEachKeyValueAddToSet = forEachKeyValueOnPOJOFunction({
7873
+ // eslint-disable-next-line @typescript-eslint/max-params
7661
7874
  forEach: function forEach(param, i, claims, roles) {
7662
- var _param = _sliced_to_array$f(param, 2), claimsKey = _param[0], value = _param[1];
7875
+ var _param = _sliced_to_array$g(param, 2), claimsKey = _param[0], value = _param[1];
7663
7876
  var entry = authRoleMap.get(claimsKey);
7664
7877
  if (entry != null) {
7665
7878
  var decodedRoles = entry.decodeRolesFromValue(value);
@@ -7695,15 +7908,21 @@ var AUTH_ROLE_CLAIMS_DEFAULT_EMPTY_VALUE = null;
7695
7908
  });
7696
7909
  }
7697
7910
 
7698
- function _array_like_to_array$h(arr, len) {
7911
+ function _array_like_to_array$n(arr, len) {
7699
7912
  if (len == null || len > arr.length) len = arr.length;
7700
7913
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
7701
7914
  return arr2;
7702
7915
  }
7703
- function _array_with_holes$e(arr) {
7916
+ function _array_with_holes$f(arr) {
7704
7917
  if (Array.isArray(arr)) return arr;
7705
7918
  }
7706
- function _iterable_to_array_limit$e(arr, i) {
7919
+ function _array_without_holes$f(arr) {
7920
+ if (Array.isArray(arr)) return _array_like_to_array$n(arr);
7921
+ }
7922
+ function _iterable_to_array$f(iter) {
7923
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
7924
+ }
7925
+ function _iterable_to_array_limit$f(arr, i) {
7707
7926
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
7708
7927
  if (_i == null) return;
7709
7928
  var _arr = [];
@@ -7727,19 +7946,25 @@ function _iterable_to_array_limit$e(arr, i) {
7727
7946
  }
7728
7947
  return _arr;
7729
7948
  }
7730
- function _non_iterable_rest$e() {
7949
+ function _non_iterable_rest$f() {
7731
7950
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7732
7951
  }
7733
- function _sliced_to_array$e(arr, i) {
7734
- return _array_with_holes$e(arr) || _iterable_to_array_limit$e(arr, i) || _unsupported_iterable_to_array$h(arr, i) || _non_iterable_rest$e();
7952
+ function _non_iterable_spread$f() {
7953
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
7735
7954
  }
7736
- function _unsupported_iterable_to_array$h(o, minLen) {
7955
+ function _sliced_to_array$f(arr, i) {
7956
+ return _array_with_holes$f(arr) || _iterable_to_array_limit$f(arr, i) || _unsupported_iterable_to_array$n(arr, i) || _non_iterable_rest$f();
7957
+ }
7958
+ function _to_consumable_array$f(arr) {
7959
+ return _array_without_holes$f(arr) || _iterable_to_array$f(arr) || _unsupported_iterable_to_array$n(arr) || _non_iterable_spread$f();
7960
+ }
7961
+ function _unsupported_iterable_to_array$n(o, minLen) {
7737
7962
  if (!o) return;
7738
- if (typeof o === "string") return _array_like_to_array$h(o, minLen);
7963
+ if (typeof o === "string") return _array_like_to_array$n(o, minLen);
7739
7964
  var n = Object.prototype.toString.call(o).slice(8, -1);
7740
7965
  if (n === "Object" && o.constructor) n = o.constructor.name;
7741
7966
  if (n === "Map" || n === "Set") return Array.from(n);
7742
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$h(o, minLen);
7967
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$n(o, minLen);
7743
7968
  }
7744
7969
  /**
7745
7970
  * Finds the first and last occurrence of a single character within the input string.
@@ -7755,14 +7980,31 @@ function _unsupported_iterable_to_array$h(o, minLen) {
7755
7980
  if (find.length !== 1) {
7756
7981
  throw new Error('firstAndLastCharacterOccurrence() expects a single character as find input.');
7757
7982
  }
7758
- for(var i = 0; i < input.length; i += 1){
7759
- if (input[i] === find) {
7760
- if (first === -1) {
7761
- first = i;
7762
- } else {
7763
- last = i;
7983
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
7984
+ try {
7985
+ for(var _iterator = _to_consumable_array$f(input).entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
7986
+ var _step_value = _sliced_to_array$f(_step.value, 2), i = _step_value[0], char = _step_value[1];
7987
+ if (char === find) {
7988
+ if (first === -1) {
7989
+ first = i;
7990
+ } else {
7991
+ last = i;
7992
+ }
7993
+ occurences += 1;
7994
+ }
7995
+ }
7996
+ } catch (err) {
7997
+ _didIteratorError = true;
7998
+ _iteratorError = err;
7999
+ } finally{
8000
+ try {
8001
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
8002
+ _iterator.return();
8003
+ }
8004
+ } finally{
8005
+ if (_didIteratorError) {
8006
+ throw _iteratorError;
7764
8007
  }
7765
- occurences += 1;
7766
8008
  }
7767
8009
  }
7768
8010
  if (first !== -1 && last === -1) {
@@ -7781,7 +8023,7 @@ function _unsupported_iterable_to_array$h(o, minLen) {
7781
8023
  * @param find - substring to search for
7782
8024
  * @returns true if the substring is found within the input
7783
8025
  */ function stringContains(input, find) {
7784
- return input.indexOf(find) !== -1;
8026
+ return input.includes(find);
7785
8027
  }
7786
8028
  /**
7787
8029
  * Creates a function that replaces the last character of a string with the replacement string
@@ -7816,7 +8058,8 @@ function _unsupported_iterable_to_array$h(o, minLen) {
7816
8058
  * @param replacement - string to substitute at the index
7817
8059
  * @param decision - function that determines whether the character should be replaced
7818
8060
  * @returns the modified string, or the original if the decision is false
7819
- */ function replaceCharacterAtIndexIf(input, index, replacement, decision) {
8061
+ */ // eslint-disable-next-line @typescript-eslint/max-params
8062
+ function replaceCharacterAtIndexIf(input, index, replacement, decision) {
7820
8063
  if (decision(input[index])) {
7821
8064
  return replaceCharacterAtIndexWith(input, index, replacement);
7822
8065
  } else {
@@ -7831,7 +8074,7 @@ function _unsupported_iterable_to_array$h(o, minLen) {
7831
8074
  * @param replacement - string to substitute at the index
7832
8075
  * @returns the string with the character at the index replaced
7833
8076
  */ function replaceCharacterAtIndexWith(input, index, replacement) {
7834
- var _splitStringAtIndex = _sliced_to_array$e(splitStringAtIndex(input, index, false), 2), head = _splitStringAtIndex[0], tail = _splitStringAtIndex[1];
8077
+ var _splitStringAtIndex = _sliced_to_array$f(splitStringAtIndex(input, index, false), 2), head = _splitStringAtIndex[0], tail = _splitStringAtIndex[1];
7835
8078
  return head + replacement + tail;
7836
8079
  }
7837
8080
  /**
@@ -7870,13 +8113,40 @@ function _unsupported_iterable_to_array$h(o, minLen) {
7870
8113
  * @returns a record mapping each character to its index in the input string
7871
8114
  */ function stringCharactersToIndexRecord(chars) {
7872
8115
  var record = {};
7873
- for(var i = 0; i < chars.length; i += 1){
7874
- var char = chars[i];
7875
- record[char] = i;
8116
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
8117
+ try {
8118
+ for(var _iterator = _to_consumable_array$f(chars).entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
8119
+ var _step_value = _sliced_to_array$f(_step.value, 2), i = _step_value[0], char = _step_value[1];
8120
+ record[char] = i;
8121
+ }
8122
+ } catch (err) {
8123
+ _didIteratorError = true;
8124
+ _iteratorError = err;
8125
+ } finally{
8126
+ try {
8127
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
8128
+ _iterator.return();
8129
+ }
8130
+ } finally{
8131
+ if (_didIteratorError) {
8132
+ throw _iteratorError;
8133
+ }
8134
+ }
7876
8135
  }
7877
8136
  return record;
7878
8137
  }
7879
8138
 
8139
+ function _array_like_to_array$m(arr, len) {
8140
+ if (len == null || len > arr.length) len = arr.length;
8141
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
8142
+ return arr2;
8143
+ }
8144
+ function _array_with_holes$e(arr) {
8145
+ if (Array.isArray(arr)) return arr;
8146
+ }
8147
+ function _array_without_holes$e(arr) {
8148
+ if (Array.isArray(arr)) return _array_like_to_array$m(arr);
8149
+ }
7880
8150
  function _instanceof$3(left, right) {
7881
8151
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
7882
8152
  return !!right[Symbol.hasInstance](left);
@@ -7884,6 +8154,53 @@ function _instanceof$3(left, right) {
7884
8154
  return left instanceof right;
7885
8155
  }
7886
8156
  }
8157
+ function _iterable_to_array$e(iter) {
8158
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
8159
+ }
8160
+ function _iterable_to_array_limit$e(arr, i) {
8161
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
8162
+ if (_i == null) return;
8163
+ var _arr = [];
8164
+ var _n = true;
8165
+ var _d = false;
8166
+ var _s, _e;
8167
+ try {
8168
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
8169
+ _arr.push(_s.value);
8170
+ if (i && _arr.length === i) break;
8171
+ }
8172
+ } catch (err) {
8173
+ _d = true;
8174
+ _e = err;
8175
+ } finally{
8176
+ try {
8177
+ if (!_n && _i["return"] != null) _i["return"]();
8178
+ } finally{
8179
+ if (_d) throw _e;
8180
+ }
8181
+ }
8182
+ return _arr;
8183
+ }
8184
+ function _non_iterable_rest$e() {
8185
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
8186
+ }
8187
+ function _non_iterable_spread$e() {
8188
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
8189
+ }
8190
+ function _sliced_to_array$e(arr, i) {
8191
+ return _array_with_holes$e(arr) || _iterable_to_array_limit$e(arr, i) || _unsupported_iterable_to_array$m(arr, i) || _non_iterable_rest$e();
8192
+ }
8193
+ function _to_consumable_array$e(arr) {
8194
+ return _array_without_holes$e(arr) || _iterable_to_array$e(arr) || _unsupported_iterable_to_array$m(arr) || _non_iterable_spread$e();
8195
+ }
8196
+ function _unsupported_iterable_to_array$m(o, minLen) {
8197
+ if (!o) return;
8198
+ if (typeof o === "string") return _array_like_to_array$m(o, minLen);
8199
+ var n = Object.prototype.toString.call(o).slice(8, -1);
8200
+ if (n === "Object" && o.constructor) n = o.constructor.name;
8201
+ if (n === "Map" || n === "Set") return Array.from(n);
8202
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$m(o, minLen);
8203
+ }
7887
8204
  /**
7888
8205
  * Creates a function that replaces all occurrences of the configured target strings with a replacement value.
7889
8206
  *
@@ -7997,13 +8314,29 @@ function _instanceof$3(left, right) {
7997
8314
  return function(input, maxToReturn) {
7998
8315
  var max = maxToReturn !== null && maxToReturn !== void 0 ? maxToReturn : Number.MAX_SAFE_INTEGER;
7999
8316
  var occurrences = [];
8000
- for(var i = 0; i < input.length; i += 1){
8001
- var char = input[i];
8002
- if (characterSet.has(char)) {
8003
- occurrences.push(i);
8004
- // return if at the max number of occurences
8005
- if (occurrences.length >= max) {
8006
- break;
8317
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
8318
+ try {
8319
+ for(var _iterator = _to_consumable_array$e(input).entries()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
8320
+ var _step_value = _sliced_to_array$e(_step.value, 2), i = _step_value[0], char = _step_value[1];
8321
+ if (characterSet.has(char)) {
8322
+ occurrences.push(i);
8323
+ // return if at the max number of occurences
8324
+ if (occurrences.length >= max) {
8325
+ break;
8326
+ }
8327
+ }
8328
+ }
8329
+ } catch (err) {
8330
+ _didIteratorError = true;
8331
+ _iteratorError = err;
8332
+ } finally{
8333
+ try {
8334
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
8335
+ _iterator.return();
8336
+ }
8337
+ } finally{
8338
+ if (_didIteratorError) {
8339
+ throw _iteratorError;
8007
8340
  }
8008
8341
  }
8009
8342
  }
@@ -8196,6 +8529,7 @@ function _instanceof$3(left, right) {
8196
8529
  * Useful for providing a constant decision where a function is expected.
8197
8530
  *
8198
8531
  * @param decision - the constant boolean value to return
8532
+ * @returns a decision function that always returns the given boolean
8199
8533
  *
8200
8534
  * @example
8201
8535
  * ```ts
@@ -8229,6 +8563,7 @@ function _instanceof$3(left, right) {
8229
8563
  *
8230
8564
  * @param valueOrFunction - a boolean, decision function, or undefined
8231
8565
  * @param defaultIfUndefined - fallback boolean when the input is nullish (defaults to true)
8566
+ * @returns a {@link DecisionFunction} derived from the input
8232
8567
  *
8233
8568
  * @example
8234
8569
  * ```ts
@@ -8259,7 +8594,7 @@ function isEqualToValueDecisionFunction(equalityValue) {
8259
8594
  return equalityValueCheckFunction;
8260
8595
  }
8261
8596
 
8262
- function _array_like_to_array$g(arr, len) {
8597
+ function _array_like_to_array$l(arr, len) {
8263
8598
  if (len == null || len > arr.length) len = arr.length;
8264
8599
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
8265
8600
  return arr2;
@@ -8323,19 +8658,19 @@ function _object_spread$c(target) {
8323
8658
  return target;
8324
8659
  }
8325
8660
  function _sliced_to_array$d(arr, i) {
8326
- return _array_with_holes$d(arr) || _iterable_to_array_limit$d(arr, i) || _unsupported_iterable_to_array$g(arr, i) || _non_iterable_rest$d();
8661
+ return _array_with_holes$d(arr) || _iterable_to_array_limit$d(arr, i) || _unsupported_iterable_to_array$l(arr, i) || _non_iterable_rest$d();
8327
8662
  }
8328
8663
  function _type_of$c(obj) {
8329
8664
  "@swc/helpers - typeof";
8330
8665
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
8331
8666
  }
8332
- function _unsupported_iterable_to_array$g(o, minLen) {
8667
+ function _unsupported_iterable_to_array$l(o, minLen) {
8333
8668
  if (!o) return;
8334
- if (typeof o === "string") return _array_like_to_array$g(o, minLen);
8669
+ if (typeof o === "string") return _array_like_to_array$l(o, minLen);
8335
8670
  var n = Object.prototype.toString.call(o).slice(8, -1);
8336
8671
  if (n === "Object" && o.constructor) n = o.constructor.name;
8337
8672
  if (n === "Map" || n === "Set") return Array.from(n);
8338
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$g(o, minLen);
8673
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$l(o, minLen);
8339
8674
  }
8340
8675
  var SLASH_PATH_SEPARATOR = '/';
8341
8676
  var SLASH_PATH_FILE_TYPE_SEPARATOR = '.';
@@ -8525,7 +8860,9 @@ var ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX = /\.+/g;
8525
8860
  *
8526
8861
  * If the input is a file, the folder of the file is returned instead.
8527
8862
  *
8528
- * @param input
8863
+ * @param input - the string path to convert to a folder path
8864
+ * @param config - optional configuration controlling path type inference and invalid-path handling
8865
+ * @returns a valid slash path folder string with a trailing slash, or an empty string for relative root
8529
8866
  */ function slashPathFolder(input, config) {
8530
8867
  return slashPathFolderFactory(_object_spread$c({}, config))(input);
8531
8868
  }
@@ -8636,16 +8973,12 @@ var ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX = /\.+/g;
8636
8973
  var _ref = config !== null && config !== void 0 ? config : {}, _ref_illegalStrings = _ref.illegalStrings, illegalStrings = _ref_illegalStrings === void 0 ? DEFAULT_SLASH_PATH_ILLEGAL_CHARACTERS : _ref_illegalStrings, tmp = _ref.replaceIllegalCharacters, inputReplaceIllegalCharacters = tmp === void 0 ? true : tmp, tmp1 = _ref.replaceIllegalDots, inputReplaceIllegalDots = tmp1 === void 0 ? true : tmp1, throwError = _ref.throwError;
8637
8974
  var fns = [];
8638
8975
  var replaceIllegalCharacters = typeof inputReplaceIllegalCharacters === 'string' ? inputReplaceIllegalCharacters : DEFAULT_SLASH_PATH_ILLEGAL_CHARACTER_REPLACEMENT;
8639
- if (inputReplaceIllegalCharacters != null) {
8640
- fns.push(replaceStringsFunction({
8641
- replace: illegalStrings,
8642
- replaceWith: replaceIllegalCharacters
8643
- }));
8644
- }
8645
- if (inputReplaceIllegalDots != null) {
8646
- var replaceIllegalDotsWith = typeof inputReplaceIllegalDots === 'string' ? inputReplaceIllegalDots : replaceIllegalCharacters;
8647
- fns.push(replaceInvalidFilePathTypeSeparatorsInSlashPathFunction(replaceIllegalDotsWith));
8648
- }
8976
+ fns.push(replaceStringsFunction({
8977
+ replace: illegalStrings,
8978
+ replaceWith: replaceIllegalCharacters
8979
+ }));
8980
+ var replaceIllegalDotsWith = typeof inputReplaceIllegalDots === 'string' ? inputReplaceIllegalDots : replaceIllegalCharacters;
8981
+ fns.push(replaceInvalidFilePathTypeSeparatorsInSlashPathFunction(replaceIllegalDotsWith));
8649
8982
  if (throwError === true || !(inputReplaceIllegalCharacters || inputReplaceIllegalDots)) {
8650
8983
  fns.push(function(x) {
8651
8984
  if (!isValidSlashPath(x)) {
@@ -8805,31 +9138,27 @@ var ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX = /\.+/g;
8805
9138
  */ function expandSlashPathPathMatcherPartToDecisionFunctions(path) {
8806
9139
  var targetPathPartsInput = asArray(path);
8807
9140
  var indexMatchingDecisionFunctions = [];
8808
- targetPathPartsInput.forEach(function(part, index) {
9141
+ targetPathPartsInput.forEach(function(part, _index) {
8809
9142
  switch(typeof part === "undefined" ? "undefined" : _type_of$c(part)){
8810
9143
  case 'number':
8811
- var matchPartFunction;
8812
- switch(part){
8813
- case exports.SlashPathPathMatcherPartCode.WILDCARD:
8814
- matchPartFunction = decisionFunction(true);
8815
- break;
8816
- default:
8817
- // all other unknown numbers are treated as invalid and should never match
8818
- matchPartFunction = decisionFunction(false);
8819
- break;
9144
+ {
9145
+ // Currently only SlashPathPathMatcherPartCode.WILDCARD (0) exists; treat as wildcard
9146
+ var matchPartFunction = decisionFunction(true);
9147
+ indexMatchingDecisionFunctions.push(matchPartFunction);
9148
+ break;
8820
9149
  }
8821
- indexMatchingDecisionFunctions.push(matchPartFunction);
8822
- break;
8823
9150
  case 'string':
8824
- // break parts of the path into parts
8825
- var parts = slashPathParts(part);
8826
- parts.forEach(function(part, partIndex) {
8827
- var matchPartFunction = function matchPartFunction(inputPart) {
8828
- return inputPart === part;
8829
- };
8830
- indexMatchingDecisionFunctions.push(matchPartFunction);
8831
- });
8832
- break;
9151
+ {
9152
+ // break parts of the path into parts
9153
+ var parts = slashPathParts(part);
9154
+ parts.forEach(function(part, _partIndex) {
9155
+ var matchPartFunction = function matchPartFunction(inputPart) {
9156
+ return inputPart === part;
9157
+ };
9158
+ indexMatchingDecisionFunctions.push(matchPartFunction);
9159
+ });
9160
+ break;
9161
+ }
8833
9162
  case 'function':
8834
9163
  indexMatchingDecisionFunctions.push(part);
8835
9164
  break;
@@ -8875,7 +9204,7 @@ var ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX = /\.+/g;
8875
9204
  /**
8876
9205
  * Creates a SlashPathPathMatcher.
8877
9206
  *
8878
- * @param config The configuration for the matcher.
9207
+ * @param input - the matcher configuration, which may be a target path string, an array of path parts, or a full config object
8879
9208
  * @returns The matcher.
8880
9209
  */ function slashPathPathMatcher(input) {
8881
9210
  var _config_matchRemaining, _config_nonMatchingFillValue;
@@ -8956,7 +9285,7 @@ var ALL_SLASH_PATH_FILE_TYPE_SEPARATORS_REGEX = /\.+/g;
8956
9285
  };
8957
9286
  }
8958
9287
 
8959
- function _array_like_to_array$f(arr, len) {
9288
+ function _array_like_to_array$k(arr, len) {
8960
9289
  if (len == null || len > arr.length) len = arr.length;
8961
9290
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
8962
9291
  return arr2;
@@ -8964,10 +9293,10 @@ function _array_like_to_array$f(arr, len) {
8964
9293
  function _array_with_holes$c(arr) {
8965
9294
  if (Array.isArray(arr)) return arr;
8966
9295
  }
8967
- function _array_without_holes$6(arr) {
8968
- if (Array.isArray(arr)) return _array_like_to_array$f(arr);
9296
+ function _array_without_holes$d(arr) {
9297
+ if (Array.isArray(arr)) return _array_like_to_array$k(arr);
8969
9298
  }
8970
- function _iterable_to_array$6(iter) {
9299
+ function _iterable_to_array$d(iter) {
8971
9300
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
8972
9301
  }
8973
9302
  function _iterable_to_array_limit$c(arr, i) {
@@ -8997,22 +9326,22 @@ function _iterable_to_array_limit$c(arr, i) {
8997
9326
  function _non_iterable_rest$c() {
8998
9327
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
8999
9328
  }
9000
- function _non_iterable_spread$6() {
9329
+ function _non_iterable_spread$d() {
9001
9330
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
9002
9331
  }
9003
9332
  function _sliced_to_array$c(arr, i) {
9004
- return _array_with_holes$c(arr) || _iterable_to_array_limit$c(arr, i) || _unsupported_iterable_to_array$f(arr, i) || _non_iterable_rest$c();
9333
+ return _array_with_holes$c(arr) || _iterable_to_array_limit$c(arr, i) || _unsupported_iterable_to_array$k(arr, i) || _non_iterable_rest$c();
9005
9334
  }
9006
- function _to_consumable_array$6(arr) {
9007
- return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$f(arr) || _non_iterable_spread$6();
9335
+ function _to_consumable_array$d(arr) {
9336
+ return _array_without_holes$d(arr) || _iterable_to_array$d(arr) || _unsupported_iterable_to_array$k(arr) || _non_iterable_spread$d();
9008
9337
  }
9009
- function _unsupported_iterable_to_array$f(o, minLen) {
9338
+ function _unsupported_iterable_to_array$k(o, minLen) {
9010
9339
  if (!o) return;
9011
- if (typeof o === "string") return _array_like_to_array$f(o, minLen);
9340
+ if (typeof o === "string") return _array_like_to_array$k(o, minLen);
9012
9341
  var n = Object.prototype.toString.call(o).slice(8, -1);
9013
9342
  if (n === "Object" && o.constructor) n = o.constructor.name;
9014
9343
  if (n === "Map" || n === "Set") return Array.from(n);
9015
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$f(o, minLen);
9344
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$k(o, minLen);
9016
9345
  }
9017
9346
  /**
9018
9347
  * Returns true if the input string is a known HTTP protocol (`"http"` or `"https"`).
@@ -9043,7 +9372,7 @@ function _unsupported_iterable_to_array$f(o, minLen) {
9043
9372
  /**
9044
9373
  * This Regex is really only reliable for detecting that the TLD exists, but due to the nature of tld's
9045
9374
  * it cannot always be determined whether or not the part of the url is part of the tld or a subdomain.
9046
- */ var WEBSITE_TLD_DETECTION_REGEX = /[^\/.\s]([^.\s]+)\.([^.\s]+)$/;
9375
+ */ var WEBSITE_TLD_DETECTION_REGEX = /[^/.\s]([^.\s]+)\.([^.\s]+)$/;
9047
9376
  /**
9048
9377
  * Returns true if the input url has a website top level domain.
9049
9378
  *
@@ -9056,7 +9385,7 @@ function _unsupported_iterable_to_array$f(o, minLen) {
9056
9385
  }
9057
9386
  /**
9058
9387
  * Regex that matches a colon followed by digits, used to detect port numbers in URLs.
9059
- */ var HAS_PORT_NUMBER_REGEX = /\:(\d+)/;
9388
+ */ var HAS_PORT_NUMBER_REGEX = /:(\d+)/;
9060
9389
  /**
9061
9390
  * Returns true if the input string contains a port number (e.g., `:8080`).
9062
9391
  *
@@ -9176,7 +9505,7 @@ function _unsupported_iterable_to_array$f(o, minLen) {
9176
9505
  var baseWebUrl = removeWebProtocolPrefix(baseWebsiteUrl(basePath)); // remove prefix to prevent issues with slash paths
9177
9506
  var webUrl = mergeSlashPaths([
9178
9507
  baseWebUrl
9179
- ].concat(_to_consumable_array$6(asArray(paths))));
9508
+ ].concat(_to_consumable_array$d(asArray(paths))));
9180
9509
  return setWebProtocolPrefix(webUrl, protocol);
9181
9510
  }
9182
9511
  /**
@@ -9221,8 +9550,7 @@ function _unsupported_iterable_to_array$f(o, minLen) {
9221
9550
  } : undefined
9222
9551
  ]);
9223
9552
  return function(input) {
9224
- var path = pathTransform(websitePathFromWebsiteUrl(input));
9225
- return path;
9553
+ return pathTransform(websitePathFromWebsiteUrl(input));
9226
9554
  };
9227
9555
  }
9228
9556
  /**
@@ -9296,7 +9624,9 @@ function _unsupported_iterable_to_array$f(o, minLen) {
9296
9624
  * @param input - The domain-and-path string to split.
9297
9625
  * @returns A pair containing the domain and path.
9298
9626
  */ function websiteDomainAndPathPair(input) {
9299
- var _splitJoinRemainder = _sliced_to_array$c(splitJoinRemainder(input, '/', 2), 2), domain = _splitJoinRemainder[0], path = _splitJoinRemainder[1];
9627
+ var result = splitJoinRemainder(input, '/', 2);
9628
+ var domain = result[0];
9629
+ var path = result[1]; // may be undefined if input has no path separator
9300
9630
  return {
9301
9631
  domain: domain,
9302
9632
  path: toAbsoluteSlashPathStartType(path !== null && path !== void 0 ? path : '/')
@@ -9448,6 +9778,31 @@ function _unsupported_iterable_to_array$f(o, minLen) {
9448
9778
  return domain;
9449
9779
  }
9450
9780
 
9781
+ function _array_like_to_array$j(arr, len) {
9782
+ if (len == null || len > arr.length) len = arr.length;
9783
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
9784
+ return arr2;
9785
+ }
9786
+ function _array_without_holes$c(arr) {
9787
+ if (Array.isArray(arr)) return _array_like_to_array$j(arr);
9788
+ }
9789
+ function _iterable_to_array$c(iter) {
9790
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
9791
+ }
9792
+ function _non_iterable_spread$c() {
9793
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
9794
+ }
9795
+ function _to_consumable_array$c(arr) {
9796
+ return _array_without_holes$c(arr) || _iterable_to_array$c(arr) || _unsupported_iterable_to_array$j(arr) || _non_iterable_spread$c();
9797
+ }
9798
+ function _unsupported_iterable_to_array$j(o, minLen) {
9799
+ if (!o) return;
9800
+ if (typeof o === "string") return _array_like_to_array$j(o, minLen);
9801
+ var n = Object.prototype.toString.call(o).slice(8, -1);
9802
+ if (n === "Object" && o.constructor) n = o.constructor.name;
9803
+ if (n === "Map" || n === "Set") return Array.from(n);
9804
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$j(o, minLen);
9805
+ }
9451
9806
  /**
9452
9807
  * Converts an EmailParticipant object to a formatted string representation.
9453
9808
  * The format is: "name<email>" or "<email>" if no name is provided.
@@ -9484,19 +9839,18 @@ function _unsupported_iterable_to_array$f(o, minLen) {
9484
9839
  * @returns A combined array of EmailParticipant objects
9485
9840
  */ function coerceToEmailParticipants(param) {
9486
9841
  var _param_participants = param.participants, participants = _param_participants === void 0 ? [] : _param_participants, _param_emails = param.emails, emails = _param_emails === void 0 ? [] : _param_emails;
9487
- if (!(emails === null || emails === void 0 ? void 0 : emails.length)) {
9842
+ if (!emails.length) {
9488
9843
  return participants;
9489
9844
  } else {
9490
- var _ref;
9491
- var participantEmails = (_ref = participants === null || participants === void 0 ? void 0 : participants.map(function(x) {
9845
+ var participantEmails = participants.map(function(x) {
9492
9846
  return x.email;
9493
- })) !== null && _ref !== void 0 ? _ref : [];
9847
+ });
9494
9848
  var emailsWithoutParticipants = excludeValuesFromArray(emails, participantEmails);
9495
- return participants.concat(emailsWithoutParticipants.map(function(email) {
9849
+ return _to_consumable_array$c(participants).concat(_to_consumable_array$c(emailsWithoutParticipants.map(function(email) {
9496
9850
  return {
9497
9851
  email: email
9498
9852
  };
9499
- }));
9853
+ })));
9500
9854
  }
9501
9855
  }
9502
9856
 
@@ -9676,7 +10030,7 @@ function _is_native_reflect_construct$3() {
9676
10030
  * @param input - The value to check
9677
10031
  * @returns True if the input is a ServerError
9678
10032
  */ function isServerError(input) {
9679
- return input != null && (typeof input === "undefined" ? "undefined" : _type_of$b(input)) === 'object' && input.status != null && input.code != null;
10033
+ return input != null && (typeof input === "undefined" ? "undefined" : _type_of$b(input)) === 'object' && 'status' in input && 'code' in input;
9680
10034
  }
9681
10035
  function partialServerError(messageOrError) {
9682
10036
  var serverError;
@@ -9799,9 +10153,9 @@ function _type_of$a(obj) {
9799
10153
  function toReadableError(inputError) {
9800
10154
  var error;
9801
10155
  if (inputError) {
9802
- if (inputError.code) {
10156
+ if ('code' in inputError && inputError.code) {
9803
10157
  error = inputError;
9804
- } else if (inputError.data) {
10158
+ } else if ('data' in inputError) {
9805
10159
  error = _object_spread$a({
9806
10160
  code: DEFAULT_READABLE_ERROR_CODE
9807
10161
  }, inputError.data);
@@ -9812,9 +10166,10 @@ function toReadableError(inputError) {
9812
10166
  _error: inputError
9813
10167
  };
9814
10168
  } else {
10169
+ var _inputError_message;
9815
10170
  error = {
9816
10171
  code: DEFAULT_READABLE_ERROR_CODE,
9817
- message: inputError.message || '',
10172
+ message: (_inputError_message = inputError.message) !== null && _inputError_message !== void 0 ? _inputError_message : '',
9818
10173
  _error: inputError
9819
10174
  };
9820
10175
  }
@@ -9848,7 +10203,8 @@ function toReadableError(inputError) {
9848
10203
  * @param input - The error or string to extract a message from
9849
10204
  * @returns The error message string, or null/undefined if not available
9850
10205
  */ function messageFromError(input) {
9851
- return ((typeof input === "undefined" ? "undefined" : _type_of$a(input)) === 'object' ? input.message : input) || input;
10206
+ var _ref;
10207
+ return (_ref = (typeof input === "undefined" ? "undefined" : _type_of$a(input)) === 'object' ? input.message : input) !== null && _ref !== void 0 ? _ref : input;
9852
10208
  }
9853
10209
 
9854
10210
  /**
@@ -9865,33 +10221,33 @@ function toReadableError(inputError) {
9865
10221
  * @param buffer - Buffer-like object to check. Only requires the `lastIndexOf` method.
9866
10222
  * @returns true if both PDF markers are found in the expected positions.
9867
10223
  */ function bufferHasValidPdfMarkings(buffer) {
9868
- return buffer.lastIndexOf('%PDF-') === 0 && buffer.lastIndexOf('%%EOF') > -1;
10224
+ return buffer.lastIndexOf('%PDF-') === 0 && buffer.includes('%%EOF');
9869
10225
  }
9870
10226
 
9871
- function _array_like_to_array$e(arr, len) {
10227
+ function _array_like_to_array$i(arr, len) {
9872
10228
  if (len == null || len > arr.length) len = arr.length;
9873
10229
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
9874
10230
  return arr2;
9875
10231
  }
9876
- function _array_without_holes$5(arr) {
9877
- if (Array.isArray(arr)) return _array_like_to_array$e(arr);
10232
+ function _array_without_holes$b(arr) {
10233
+ if (Array.isArray(arr)) return _array_like_to_array$i(arr);
9878
10234
  }
9879
- function _iterable_to_array$5(iter) {
10235
+ function _iterable_to_array$b(iter) {
9880
10236
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
9881
10237
  }
9882
- function _non_iterable_spread$5() {
10238
+ function _non_iterable_spread$b() {
9883
10239
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
9884
10240
  }
9885
- function _to_consumable_array$5(arr) {
9886
- return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$e(arr) || _non_iterable_spread$5();
10241
+ function _to_consumable_array$b(arr) {
10242
+ return _array_without_holes$b(arr) || _iterable_to_array$b(arr) || _unsupported_iterable_to_array$i(arr) || _non_iterable_spread$b();
9887
10243
  }
9888
- function _unsupported_iterable_to_array$e(o, minLen) {
10244
+ function _unsupported_iterable_to_array$i(o, minLen) {
9889
10245
  if (!o) return;
9890
- if (typeof o === "string") return _array_like_to_array$e(o, minLen);
10246
+ if (typeof o === "string") return _array_like_to_array$i(o, minLen);
9891
10247
  var n = Object.prototype.toString.call(o).slice(8, -1);
9892
10248
  if (n === "Object" && o.constructor) n = o.constructor.name;
9893
10249
  if (n === "Map" || n === "Set") return Array.from(n);
9894
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$e(o, minLen);
10250
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$i(o, minLen);
9895
10251
  }
9896
10252
  /*eslint @typescript-eslint/no-explicit-any:"off"*/ // any is used with intent here. using unknown can have strange effects in usage of forwardFunction and type capture.
9897
10253
  /**
@@ -9903,14 +10259,13 @@ function _unsupported_iterable_to_array$e(o, minLen) {
9903
10259
  * @param getter - A Getter that provides the target function
9904
10260
  * @returns A forwarding function with the same signature as the target
9905
10261
  */ function forwardFunction(getter) {
9906
- var fn = function fn() {
10262
+ return function() {
9907
10263
  for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
9908
10264
  args[_key] = arguments[_key];
9909
10265
  }
9910
10266
  var forwardFn = getter();
9911
- return forwardFn.apply(void 0, _to_consumable_array$5(args));
10267
+ return forwardFn.apply(void 0, _to_consumable_array$b(args));
9912
10268
  };
9913
- return fn;
9914
10269
  }
9915
10270
  /**
9916
10271
  * Creates a factory that produces forwarding functions which use the provided function
@@ -9932,6 +10287,31 @@ function _unsupported_iterable_to_array$e(o, minLen) {
9932
10287
  * Alias of MAP_IDENTITY, so `isMapIdentityFunction()` will return true for this function.
9933
10288
  */ var passThrough = MAP_IDENTITY;
9934
10289
 
10290
+ function _array_like_to_array$h(arr, len) {
10291
+ if (len == null || len > arr.length) len = arr.length;
10292
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
10293
+ return arr2;
10294
+ }
10295
+ function _array_without_holes$a(arr) {
10296
+ if (Array.isArray(arr)) return _array_like_to_array$h(arr);
10297
+ }
10298
+ function _iterable_to_array$a(iter) {
10299
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
10300
+ }
10301
+ function _non_iterable_spread$a() {
10302
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
10303
+ }
10304
+ function _to_consumable_array$a(arr) {
10305
+ return _array_without_holes$a(arr) || _iterable_to_array$a(arr) || _unsupported_iterable_to_array$h(arr) || _non_iterable_spread$a();
10306
+ }
10307
+ function _unsupported_iterable_to_array$h(o, minLen) {
10308
+ if (!o) return;
10309
+ if (typeof o === "string") return _array_like_to_array$h(o, minLen);
10310
+ var n = Object.prototype.toString.call(o).slice(8, -1);
10311
+ if (n === "Object" && o.constructor) n = o.constructor.name;
10312
+ if (n === "Map" || n === "Set") return Array.from(n);
10313
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$h(o, minLen);
10314
+ }
9935
10315
  /**
9936
10316
  * Builds an array from the intersection of an object's keys with the provided keys.
9937
10317
  * For each matching key, the associated value (or values) are added to the result array.
@@ -9940,7 +10320,7 @@ function _unsupported_iterable_to_array$e(o, minLen) {
9940
10320
  * @param keys - The keys to intersect with the object
9941
10321
  * @returns An array of values from the matching keys
9942
10322
  */ function mapKeysIntersectionObjectToArray(object, keys) {
9943
- var keysToApply = Array.from(keys);
10323
+ var keysToApply = _to_consumable_array$a(keys);
9944
10324
  var applyArray = [];
9945
10325
  keysToApply.forEach(function(key) {
9946
10326
  var values = object[key];
@@ -10269,6 +10649,14 @@ function performTaskCountLoop(config) {
10269
10649
  });
10270
10650
  }
10271
10651
 
10652
+ function _array_like_to_array$g(arr, len) {
10653
+ if (len == null || len > arr.length) len = arr.length;
10654
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
10655
+ return arr2;
10656
+ }
10657
+ function _array_without_holes$9(arr) {
10658
+ if (Array.isArray(arr)) return _array_like_to_array$g(arr);
10659
+ }
10272
10660
  function asyncGeneratorStep$8(gen, resolve, reject, _next, _throw, key, arg) {
10273
10661
  try {
10274
10662
  var info = gen[key](arg);
@@ -10298,6 +10686,23 @@ function _async_to_generator$8(fn) {
10298
10686
  });
10299
10687
  };
10300
10688
  }
10689
+ function _iterable_to_array$9(iter) {
10690
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
10691
+ }
10692
+ function _non_iterable_spread$9() {
10693
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
10694
+ }
10695
+ function _to_consumable_array$9(arr) {
10696
+ return _array_without_holes$9(arr) || _iterable_to_array$9(arr) || _unsupported_iterable_to_array$g(arr) || _non_iterable_spread$9();
10697
+ }
10698
+ function _unsupported_iterable_to_array$g(o, minLen) {
10699
+ if (!o) return;
10700
+ if (typeof o === "string") return _array_like_to_array$g(o, minLen);
10701
+ var n = Object.prototype.toString.call(o).slice(8, -1);
10702
+ if (n === "Object" && o.constructor) n = o.constructor.name;
10703
+ if (n === "Map" || n === "Set") return Array.from(n);
10704
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$g(o, minLen);
10705
+ }
10301
10706
  function _ts_generator$8(thisArg, body) {
10302
10707
  var f, y, t, _ = {
10303
10708
  label: 0,
@@ -10452,7 +10857,7 @@ function _ts_generator$8(thisArg, body) {
10452
10857
  case 2:
10453
10858
  verifiedIds = _state.sent();
10454
10859
  // concat identifiers
10455
- ids = ids.concat(verifiedIds);
10860
+ ids = _to_consumable_array$9(ids).concat(_to_consumable_array$9(verifiedIds));
10456
10861
  return [
10457
10862
  3,
10458
10863
  1
@@ -10509,7 +10914,7 @@ function _ts_generator$8(thisArg, body) {
10509
10914
  };
10510
10915
  }
10511
10916
 
10512
- function _array_like_to_array$d(arr, len) {
10917
+ function _array_like_to_array$f(arr, len) {
10513
10918
  if (len == null || len > arr.length) len = arr.length;
10514
10919
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
10515
10920
  return arr2;
@@ -10517,6 +10922,12 @@ function _array_like_to_array$d(arr, len) {
10517
10922
  function _array_with_holes$b(arr) {
10518
10923
  if (Array.isArray(arr)) return arr;
10519
10924
  }
10925
+ function _array_without_holes$8(arr) {
10926
+ if (Array.isArray(arr)) return _array_like_to_array$f(arr);
10927
+ }
10928
+ function _iterable_to_array$8(iter) {
10929
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
10930
+ }
10520
10931
  function _iterable_to_array_limit$b(arr, i) {
10521
10932
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
10522
10933
  if (_i == null) return;
@@ -10544,16 +10955,22 @@ function _iterable_to_array_limit$b(arr, i) {
10544
10955
  function _non_iterable_rest$b() {
10545
10956
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
10546
10957
  }
10958
+ function _non_iterable_spread$8() {
10959
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
10960
+ }
10547
10961
  function _sliced_to_array$b(arr, i) {
10548
- return _array_with_holes$b(arr) || _iterable_to_array_limit$b(arr, i) || _unsupported_iterable_to_array$d(arr, i) || _non_iterable_rest$b();
10962
+ return _array_with_holes$b(arr) || _iterable_to_array_limit$b(arr, i) || _unsupported_iterable_to_array$f(arr, i) || _non_iterable_rest$b();
10549
10963
  }
10550
- function _unsupported_iterable_to_array$d(o, minLen) {
10964
+ function _to_consumable_array$8(arr) {
10965
+ return _array_without_holes$8(arr) || _iterable_to_array$8(arr) || _unsupported_iterable_to_array$f(arr) || _non_iterable_spread$8();
10966
+ }
10967
+ function _unsupported_iterable_to_array$f(o, minLen) {
10551
10968
  if (!o) return;
10552
- if (typeof o === "string") return _array_like_to_array$d(o, minLen);
10969
+ if (typeof o === "string") return _array_like_to_array$f(o, minLen);
10553
10970
  var n = Object.prototype.toString.call(o).slice(8, -1);
10554
10971
  if (n === "Object" && o.constructor) n = o.constructor.name;
10555
10972
  if (n === "Map" || n === "Set") return Array.from(n);
10556
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$d(o, minLen);
10973
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$f(o, minLen);
10557
10974
  }
10558
10975
  /**
10559
10976
  * Creates a bidirectional {@link PrimativeKeyDencoderMap} from the given values,
@@ -10590,7 +11007,10 @@ function _unsupported_iterable_to_array$d(o, minLen) {
10590
11007
  /**
10591
11008
  * Default fallback factory for {@link PrimativeKeyDencoderFunction} that always returns null,
10592
11009
  * causing an error to be thrown for unknown values.
10593
- */ var PRIMATIVE_KEY_DENCODER_VALUE = function PRIMATIVE_KEY_DENCODER_VALUE(input) {
11010
+ *
11011
+ * @param _input - the unknown value to look up (ignored; always returns null)
11012
+ * @returns always returns null to signal an unknown value
11013
+ */ var PRIMATIVE_KEY_DENCODER_VALUE = function PRIMATIVE_KEY_DENCODER_VALUE(_input) {
10594
11014
  return null;
10595
11015
  };
10596
11016
  /**
@@ -10605,10 +11025,9 @@ function _unsupported_iterable_to_array$d(o, minLen) {
10605
11025
  var map = primativeKeyDencoderMap(config.values);
10606
11026
  var fn = function fn(input) {
10607
11027
  if (Array.isArray(input)) {
10608
- var values = filterMaybeArrayValues(input.map(function(x) {
11028
+ return filterMaybeArrayValues(input.map(function(x) {
10609
11029
  return map.get(x);
10610
11030
  }));
10611
- return values;
10612
11031
  } else {
10613
11032
  var value = map.get(input);
10614
11033
  if (value == null) {
@@ -10639,7 +11058,7 @@ function _unsupported_iterable_to_array$d(o, minLen) {
10639
11058
  var dencoderMap = dencoder._map;
10640
11059
  if (splitter) {
10641
11060
  dencoderMap._tuples.forEach(function(x) {
10642
- if (x[0].toString().indexOf(splitter) !== -1) {
11061
+ if (x[0].toString().includes(splitter)) {
10643
11062
  throw new Error("primativeKeyStringDencoder() encountered a value (".concat(x[0], ") that contains the splitter (").concat(splitter, ")."));
10644
11063
  }
10645
11064
  });
@@ -10651,11 +11070,11 @@ function _unsupported_iterable_to_array$d(o, minLen) {
10651
11070
  }
10652
11071
  });
10653
11072
  }
10654
- var joiner = splitter || '';
11073
+ var joiner = splitter !== null && splitter !== void 0 ? splitter : '';
10655
11074
  var splitEncodedValues = splitter ? function(encodedValues) {
10656
11075
  return encodedValues.split(splitter);
10657
11076
  } : function(encodedValues) {
10658
- return Array.from(encodedValues);
11077
+ return _to_consumable_array$8(encodedValues);
10659
11078
  };
10660
11079
  return function(input) {
10661
11080
  if (typeof input === 'string') {
@@ -10778,6 +11197,7 @@ function _unsupported_iterable_to_array$d(o, minLen) {
10778
11197
  *
10779
11198
  * @param input - the address to format
10780
11199
  * @param addLinebreaks - whether to join parts with newlines (default `true`) or concatenate them directly
11200
+ * @returns the formatted address string, or `undefined` if no meaningful parts are present
10781
11201
  */ function unitedStatesAddressString(input) {
10782
11202
  var addLinebreaks = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
10783
11203
  var _ref = input !== null && input !== void 0 ? input : {}, name = _ref.name, phone = _ref.phone, line1 = _ref.line1, line2 = _ref.line2, zip = _ref.zip, state = _ref.state, city = _ref.city;
@@ -10811,6 +11231,7 @@ function _unsupported_iterable_to_array$d(o, minLen) {
10811
11231
  * Useful for validating an address before submission or display.
10812
11232
  *
10813
11233
  * @param input - the address to validate
11234
+ * @returns `true` if all required fields (line1, city, state, zip) are populated
10814
11235
  *
10815
11236
  * @example
10816
11237
  * ```ts
@@ -10838,6 +11259,7 @@ function _unsupported_iterable_to_array$d(o, minLen) {
10838
11259
  * Only matches uppercase codes; lowercase input returns `false`.
10839
11260
  *
10840
11261
  * @param input - the string to test
11262
+ * @returns `true` if the input matches a valid US state or territory code
10841
11263
  *
10842
11264
  * @example
10843
11265
  * ```ts
@@ -10866,6 +11288,7 @@ function _unsupported_iterable_to_array$d(o, minLen) {
10866
11288
  *
10867
11289
  * @param a - first vector
10868
11290
  * @param b - second vector
11291
+ * @returns `true` if both vectors are equal or both are nullish
10869
11292
  */ function isSameVector(a, b) {
10870
11293
  return a && b ? vectorsAreEqual(a, b) : a === b;
10871
11294
  }
@@ -10874,6 +11297,7 @@ function _unsupported_iterable_to_array$d(o, minLen) {
10874
11297
  *
10875
11298
  * @param a - first vector
10876
11299
  * @param b - second vector
11300
+ * @returns `true` if both vectors have identical `x` and `y` values
10877
11301
  */ function vectorsAreEqual(a, b) {
10878
11302
  return a.x === b.x && a.y === b.y;
10879
11303
  }
@@ -10884,6 +11308,7 @@ function _unsupported_iterable_to_array$d(o, minLen) {
10884
11308
  * If a minimum is not specified for an axis, the input value is passed through unchanged.
10885
11309
  *
10886
11310
  * @param minSize - the minimum dimensions to enforce
11311
+ * @returns a resize function that clamps each axis to the specified minimum
10887
11312
  *
10888
11313
  * @example
10889
11314
  * ```ts
@@ -10906,6 +11331,7 @@ function _unsupported_iterable_to_array$d(o, minLen) {
10906
11331
  *
10907
11332
  * @param a - first rectangle
10908
11333
  * @param b - second rectangle
11334
+ * @returns `true` if the rectangles share any interior area
10909
11335
  *
10910
11336
  * @example
10911
11337
  * ```ts
@@ -10937,6 +11363,7 @@ function _unsupported_iterable_to_array$d(o, minLen) {
10937
11363
  *
10938
11364
  * @param a - first rectangle
10939
11365
  * @param b - second rectangle
11366
+ * @returns the overlapping {@link Rectangle}, or `undefined` if the rectangles do not intersect
10940
11367
  */ function getOverlappingRectangle(a, b) {
10941
11368
  var xl = Math.max(a.bl.x, b.bl.x);
10942
11369
  var yl = Math.max(a.bl.y, b.bl.y);
@@ -10960,7 +11387,7 @@ function _unsupported_iterable_to_array$d(o, minLen) {
10960
11387
  };
10961
11388
  }
10962
11389
 
10963
- function _array_like_to_array$c(arr, len) {
11390
+ function _array_like_to_array$e(arr, len) {
10964
11391
  if (len == null || len > arr.length) len = arr.length;
10965
11392
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
10966
11393
  return arr2;
@@ -11043,19 +11470,19 @@ function _object_spread_props$4(target, source) {
11043
11470
  return target;
11044
11471
  }
11045
11472
  function _sliced_to_array$a(arr, i) {
11046
- return _array_with_holes$a(arr) || _iterable_to_array_limit$a(arr, i) || _unsupported_iterable_to_array$c(arr, i) || _non_iterable_rest$a();
11473
+ return _array_with_holes$a(arr) || _iterable_to_array_limit$a(arr, i) || _unsupported_iterable_to_array$e(arr, i) || _non_iterable_rest$a();
11047
11474
  }
11048
11475
  function _type_of$9(obj) {
11049
11476
  "@swc/helpers - typeof";
11050
11477
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
11051
11478
  }
11052
- function _unsupported_iterable_to_array$c(o, minLen) {
11479
+ function _unsupported_iterable_to_array$e(o, minLen) {
11053
11480
  if (!o) return;
11054
- if (typeof o === "string") return _array_like_to_array$c(o, minLen);
11481
+ if (typeof o === "string") return _array_like_to_array$e(o, minLen);
11055
11482
  var n = Object.prototype.toString.call(o).slice(8, -1);
11056
11483
  if (n === "Object" && o.constructor) n = o.constructor.name;
11057
11484
  if (n === "Map" || n === "Set") return Array.from(n);
11058
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$c(o, minLen);
11485
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$e(o, minLen);
11059
11486
  }
11060
11487
  /**
11061
11488
  * Minimum valid latitude value (-90 degrees).
@@ -11077,8 +11504,11 @@ function _unsupported_iterable_to_array$c(o, minLen) {
11077
11504
  */ var TOTAL_LONGITUDE_RANGE = MAX_LONGITUDE_VALUE - MIN_LONGITUDE_VALUE;
11078
11505
  /**
11079
11506
  * Type guard that checks whether the input is a {@link LatLngPoint} by testing for `lat` and `lng` properties.
11507
+ *
11508
+ * @param input - the value to test
11509
+ * @returns `true` if the input has both `lat` and `lng` properties
11080
11510
  */ function isLatLngPoint(input) {
11081
- return (typeof input === "undefined" ? "undefined" : _type_of$9(input)) === 'object' && input.lat != null && input.lng != null;
11511
+ return (typeof input === "undefined" ? "undefined" : _type_of$9(input)) === 'object' && input != null && 'lat' in input && 'lng' in input;
11082
11512
  }
11083
11513
  /**
11084
11514
  * Creates a shallow copy of the point so that mutations to the copy do not affect the original.
@@ -11550,7 +11980,7 @@ function latLngString(lat, lng) {
11550
11980
  });
11551
11981
  }
11552
11982
 
11553
- function _array_like_to_array$b(arr, len) {
11983
+ function _array_like_to_array$d(arr, len) {
11554
11984
  if (len == null || len > arr.length) len = arr.length;
11555
11985
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
11556
11986
  return arr2;
@@ -11558,10 +11988,10 @@ function _array_like_to_array$b(arr, len) {
11558
11988
  function _array_with_holes$9(arr) {
11559
11989
  if (Array.isArray(arr)) return arr;
11560
11990
  }
11561
- function _array_without_holes$4(arr) {
11562
- if (Array.isArray(arr)) return _array_like_to_array$b(arr);
11991
+ function _array_without_holes$7(arr) {
11992
+ if (Array.isArray(arr)) return _array_like_to_array$d(arr);
11563
11993
  }
11564
- function _iterable_to_array$4(iter) {
11994
+ function _iterable_to_array$7(iter) {
11565
11995
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
11566
11996
  }
11567
11997
  function _iterable_to_array_limit$9(arr, i) {
@@ -11591,31 +12021,34 @@ function _iterable_to_array_limit$9(arr, i) {
11591
12021
  function _non_iterable_rest$9() {
11592
12022
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
11593
12023
  }
11594
- function _non_iterable_spread$4() {
12024
+ function _non_iterable_spread$7() {
11595
12025
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
11596
12026
  }
11597
12027
  function _sliced_to_array$9(arr, i) {
11598
- return _array_with_holes$9(arr) || _iterable_to_array_limit$9(arr, i) || _unsupported_iterable_to_array$b(arr, i) || _non_iterable_rest$9();
12028
+ return _array_with_holes$9(arr) || _iterable_to_array_limit$9(arr, i) || _unsupported_iterable_to_array$d(arr, i) || _non_iterable_rest$9();
11599
12029
  }
11600
- function _to_consumable_array$4(arr) {
11601
- return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$b(arr) || _non_iterable_spread$4();
12030
+ function _to_consumable_array$7(arr) {
12031
+ return _array_without_holes$7(arr) || _iterable_to_array$7(arr) || _unsupported_iterable_to_array$d(arr) || _non_iterable_spread$7();
11602
12032
  }
11603
12033
  function _type_of$8(obj) {
11604
12034
  "@swc/helpers - typeof";
11605
12035
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
11606
12036
  }
11607
- function _unsupported_iterable_to_array$b(o, minLen) {
12037
+ function _unsupported_iterable_to_array$d(o, minLen) {
11608
12038
  if (!o) return;
11609
- if (typeof o === "string") return _array_like_to_array$b(o, minLen);
12039
+ if (typeof o === "string") return _array_like_to_array$d(o, minLen);
11610
12040
  var n = Object.prototype.toString.call(o).slice(8, -1);
11611
12041
  if (n === "Object" && o.constructor) n = o.constructor.name;
11612
12042
  if (n === "Map" || n === "Set") return Array.from(n);
11613
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
12043
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$d(o, minLen);
11614
12044
  }
11615
12045
  /**
11616
12046
  * Type guard that checks whether the input is a {@link LatLngBound} by testing for the presence of `sw` and `ne` properties.
12047
+ *
12048
+ * @param input - value to test
12049
+ * @returns `true` if the input has `sw` and `ne` properties, indicating a bound
11617
12050
  */ function isLatLngBound(input) {
11618
- return (typeof input === "undefined" ? "undefined" : _type_of$8(input)) === 'object' && input.sw != null && input.ne != null;
12051
+ return (typeof input === "undefined" ? "undefined" : _type_of$8(input)) === 'object' && input != null && 'sw' in input && 'ne' in input;
11619
12052
  }
11620
12053
  /**
11621
12054
  * Creates a deep copy of the bound so that mutations to the copy do not affect the original.
@@ -11839,7 +12272,7 @@ function _unsupported_iterable_to_array$b(o, minLen) {
11839
12272
  sw: latLngPoint(sw),
11840
12273
  ne: latLngPoint(ne)
11841
12274
  };
11842
- } else if (input.length === 4) {
12275
+ } else {
11843
12276
  var _Math, _Math1, _Math2, _Math3;
11844
12277
  var points = input.map(latLngPoint);
11845
12278
  var lats = points.map(function(x) {
@@ -11848,10 +12281,10 @@ function _unsupported_iterable_to_array$b(o, minLen) {
11848
12281
  var lngs = points.map(function(x) {
11849
12282
  return x.lng;
11850
12283
  });
11851
- var minLat = (_Math = Math).min.apply(_Math, _to_consumable_array$4(lats));
11852
- var maxLat = (_Math1 = Math).max.apply(_Math1, _to_consumable_array$4(lats));
11853
- var minLng = (_Math2 = Math).min.apply(_Math2, _to_consumable_array$4(lngs));
11854
- var maxLng = (_Math3 = Math).max.apply(_Math3, _to_consumable_array$4(lngs));
12284
+ var minLat = (_Math = Math).min.apply(_Math, _to_consumable_array$7(lats));
12285
+ var maxLat = (_Math1 = Math).max.apply(_Math1, _to_consumable_array$7(lats));
12286
+ var minLng = (_Math2 = Math).min.apply(_Math2, _to_consumable_array$7(lngs));
12287
+ var maxLng = (_Math3 = Math).max.apply(_Math3, _to_consumable_array$7(lngs));
11855
12288
  bound = {
11856
12289
  sw: latLngPoint([
11857
12290
  minLat,
@@ -11863,12 +12296,12 @@ function _unsupported_iterable_to_array$b(o, minLen) {
11863
12296
  ])
11864
12297
  };
11865
12298
  }
11866
- } else if (input && inputNe) {
12299
+ } else if (inputNe) {
11867
12300
  bound = {
11868
12301
  sw: input,
11869
12302
  ne: inputNe
11870
12303
  };
11871
- } else if (input.sw && input.ne) {
12304
+ } else if (isLatLngBound(input)) {
11872
12305
  bound = input;
11873
12306
  }
11874
12307
  if (!bound) {
@@ -12072,6 +12505,7 @@ function _unsupported_iterable_to_array$b(o, minLen) {
12072
12505
  * but `null === undefined` is `false`.
12073
12506
  *
12074
12507
  * @param compare - the comparator to wrap
12508
+ * @returns a new comparator that handles nullish values safely before delegating to the wrapped comparator
12075
12509
  *
12076
12510
  * @example
12077
12511
  * ```ts
@@ -12094,6 +12528,7 @@ function _unsupported_iterable_to_array$b(o, minLen) {
12094
12528
  * @param a - first value to compare
12095
12529
  * @param b - second value to compare
12096
12530
  * @param compare - the equality comparator for non-nullish values
12531
+ * @returns `true` if the values are considered equal
12097
12532
  *
12098
12533
  * @example
12099
12534
  * ```ts
@@ -12114,6 +12549,7 @@ function _unsupported_iterable_to_array$b(o, minLen) {
12114
12549
  *
12115
12550
  * @param readValues - extracts the comparable value from each item
12116
12551
  * @param equalityComparator - compares the extracted values for equality
12552
+ * @returns a function that compares two items by their extracted values
12117
12553
  */ function compareEqualityWithValueFromItemsFunction(readValues, equalityComparator) {
12118
12554
  return compareEqualityWithValueFromItemsFunctionFactory(readValues)(equalityComparator);
12119
12555
  }
@@ -12124,6 +12560,7 @@ function _unsupported_iterable_to_array$b(o, minLen) {
12124
12560
  * with varying comparison strategies.
12125
12561
  *
12126
12562
  * @param readValues - extracts the comparable value from each item
12563
+ * @returns a factory function that accepts an equality comparator and produces a comparison function
12127
12564
  *
12128
12565
  * @example
12129
12566
  * ```ts
@@ -12150,7 +12587,7 @@ function _unsupported_iterable_to_array$b(o, minLen) {
12150
12587
  return fn;
12151
12588
  }
12152
12589
 
12153
- function _array_like_to_array$a(arr, len) {
12590
+ function _array_like_to_array$c(arr, len) {
12154
12591
  if (len == null || len > arr.length) len = arr.length;
12155
12592
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
12156
12593
  return arr2;
@@ -12193,25 +12630,25 @@ function _non_iterable_rest$8() {
12193
12630
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
12194
12631
  }
12195
12632
  function _sliced_to_array$8(arr, i) {
12196
- return _array_with_holes$8(arr) || _iterable_to_array_limit$8(arr, i) || _unsupported_iterable_to_array$a(arr, i) || _non_iterable_rest$8();
12633
+ return _array_with_holes$8(arr) || _iterable_to_array_limit$8(arr, i) || _unsupported_iterable_to_array$c(arr, i) || _non_iterable_rest$8();
12197
12634
  }
12198
12635
  function _type_of$7(obj) {
12199
12636
  "@swc/helpers - typeof";
12200
12637
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
12201
12638
  }
12202
- function _unsupported_iterable_to_array$a(o, minLen) {
12639
+ function _unsupported_iterable_to_array$c(o, minLen) {
12203
12640
  if (!o) return;
12204
- if (typeof o === "string") return _array_like_to_array$a(o, minLen);
12641
+ if (typeof o === "string") return _array_like_to_array$c(o, minLen);
12205
12642
  var n = Object.prototype.toString.call(o).slice(8, -1);
12206
12643
  if (n === "Object" && o.constructor) n = o.constructor.name;
12207
12644
  if (n === "Map" || n === "Set") return Array.from(n);
12208
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
12645
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$c(o, minLen);
12209
12646
  }
12210
12647
  /**
12211
12648
  * Regular expression for validating ISO8601 date strings.
12212
12649
  *
12213
12650
  * TODO(FUTURE): Need to improve to support negative years.
12214
- */ var ISO_8601_DATE_STRING_REGEX = /(\d{4,})-(\d{2})-(\d{2})T(\d{2})\:(\d{2})\:(\d{2})(Z|[+-](\d{2})\:(\d{2}))?/;
12651
+ */ var ISO_8601_DATE_STRING_REGEX = /(\d{4,})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(Z|[+-](\d{2}):(\d{2}))?/;
12215
12652
  /**
12216
12653
  * Determines if a string is a valid ISO8601 date string.
12217
12654
  *
@@ -12332,8 +12769,7 @@ function isConsideredUtcTimezoneString(timezone) {
12332
12769
  if (year.length === 2) {
12333
12770
  year = "20".concat(year);
12334
12771
  }
12335
- var result = "".concat(year, "-").concat(month, "-").concat(day);
12336
- return result;
12772
+ return "".concat(year, "-").concat(month, "-").concat(day);
12337
12773
  }
12338
12774
  function dateFromDateOrTimeMillisecondsNumber(input) {
12339
12775
  if (input == null) {
@@ -12559,7 +12995,7 @@ var MINUTE_OF_DAY_MAXMIMUM = MINUTES_IN_DAY - 1;
12559
12995
  * @param day - Optional base date to use (defaults to the current date)
12560
12996
  * @returns A Date with the time set to the specified minute of day
12561
12997
  */ function dateFromMinuteOfDay(minuteOfDay, day) {
12562
- var date = day || new Date();
12998
+ var date = day !== null && day !== void 0 ? day : new Date();
12563
12999
  var _minutesToHoursAndMinutes = minutesToHoursAndMinutes(asMinuteOfDay(minuteOfDay)), hour = _minutesToHoursAndMinutes.hour, minute = _minutesToHoursAndMinutes.minute;
12564
13000
  date.setHours(hour, minute, 0, 0);
12565
13001
  return date;
@@ -12613,6 +13049,7 @@ var MINUTE_OF_DAY_MAXMIMUM = MINUTES_IN_DAY - 1;
12613
13049
  * every 1 hour at minute 30), which means intervals won't be exactly N minutes apart.
12614
13050
  *
12615
13051
  * @param inputMinutes - interval in minutes between executions
13052
+ * @returns a cron expression string that approximates the requested interval
12616
13053
  *
12617
13054
  * @example
12618
13055
  * ```ts
@@ -12639,6 +13076,7 @@ var MINUTE_OF_DAY_MAXMIMUM = MINUTES_IN_DAY - 1;
12639
13076
  *
12640
13077
  * @param contextValue - the reference value to compare against
12641
13078
  * @param fn - the equality comparator
13079
+ * @returns a function that checks whether a given value equals the captured reference
12642
13080
  *
12643
13081
  * @example
12644
13082
  * ```ts
@@ -12661,6 +13099,7 @@ var MINUTE_OF_DAY_MAXMIMUM = MINUTES_IN_DAY - 1;
12661
13099
  *
12662
13100
  * @param contextValue - the reference value to compare against
12663
13101
  * @param fn - the equality comparator
13102
+ * @returns a function that checks whether all input values equal the captured reference
12664
13103
  *
12665
13104
  * @example
12666
13105
  * ```ts
@@ -12692,6 +13131,7 @@ var MINUTE_OF_DAY_MAXMIMUM = MINUTES_IN_DAY - 1;
12692
13131
  *
12693
13132
  * @param values - the values to compare
12694
13133
  * @param fn - the equality comparator
13134
+ * @returns `true` if all values are equal to each other, or if fewer than two values are provided
12695
13135
  *
12696
13136
  * @example
12697
13137
  * ```ts
@@ -12717,6 +13157,7 @@ var MINUTE_OF_DAY_MAXMIMUM = MINUTES_IN_DAY - 1;
12717
13157
  * Enables fast lookup of labeled items by their value key.
12718
13158
  *
12719
13159
  * @param values - array of labeled values to index
13160
+ * @returns a Map keyed by each item's value for fast lookup
12720
13161
  *
12721
13162
  * @example
12722
13163
  * ```ts
@@ -12741,6 +13182,7 @@ var MINUTE_OF_DAY_MAXMIMUM = MINUTES_IN_DAY - 1;
12741
13182
  *
12742
13183
  * @param key - unique identifier for the modifier
12743
13184
  * @param modify - function that mutates the target value
13185
+ * @returns a new {@link Modifier} pairing the key with the modify function
12744
13186
  *
12745
13187
  * @example
12746
13188
  * ```ts
@@ -12757,8 +13199,9 @@ var MINUTE_OF_DAY_MAXMIMUM = MINUTES_IN_DAY - 1;
12757
13199
  }
12758
13200
  /**
12759
13201
  * A no-operation modifier that does nothing to the input. Useful as a default/fallback.
12760
- */ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12761
- var NOOP_MODIFIER = function NOOP_MODIFIER() {
13202
+ *
13203
+ * @returns undefined (no mutation is performed)
13204
+ */ var NOOP_MODIFIER = function NOOP_MODIFIER() {
12762
13205
  return undefined;
12763
13206
  };
12764
13207
  /**
@@ -12768,6 +13211,7 @@ var NOOP_MODIFIER = function NOOP_MODIFIER() {
12768
13211
  *
12769
13212
  * @param modifiers - modifier(s) to add
12770
13213
  * @param map - existing map to add to, or undefined to create a new one
13214
+ * @returns the modifier map with the new modifiers added
12771
13215
  *
12772
13216
  * @example
12773
13217
  * ```ts
@@ -12776,9 +13220,7 @@ var NOOP_MODIFIER = function NOOP_MODIFIER() {
12776
13220
  * map.has('double'); // true
12777
13221
  * ```
12778
13222
  */ function addModifiers(modifiers, map) {
12779
- if (!map) {
12780
- map = new Map();
12781
- }
13223
+ map !== null && map !== void 0 ? map : map = new Map();
12782
13224
  forEachWithArray(modifiers, function(modifier) {
12783
13225
  return map.set(modifier.key, modifier);
12784
13226
  });
@@ -12789,6 +13231,7 @@ var NOOP_MODIFIER = function NOOP_MODIFIER() {
12789
13231
  *
12790
13232
  * @param modifiers - modifier(s) whose keys should be removed
12791
13233
  * @param map - the map to remove from
13234
+ * @returns the modifier map with the specified modifiers removed
12792
13235
  *
12793
13236
  * @example
12794
13237
  * ```ts
@@ -12813,6 +13256,7 @@ var NOOP_MODIFIER = function NOOP_MODIFIER() {
12813
13256
  * Returns {@link NOOP_MODIFIER} if the map is nullish or empty.
12814
13257
  *
12815
13258
  * @param map - the modifier map to convert
13259
+ * @returns a single modifier function that applies all mapped modifiers, or {@link NOOP_MODIFIER} if empty
12816
13260
  *
12817
13261
  * @example
12818
13262
  * ```ts
@@ -12833,6 +13277,7 @@ var NOOP_MODIFIER = function NOOP_MODIFIER() {
12833
13277
  * Returns undefined if no map is provided, allowing callers to distinguish "no modifiers" from "empty modifiers".
12834
13278
  *
12835
13279
  * @param map - the modifier map to convert
13280
+ * @returns a composed modifier function, or `undefined` if no map is provided
12836
13281
  */ function maybeModifierMapToFunction(map) {
12837
13282
  var fn;
12838
13283
  if (map != null) {
@@ -12854,6 +13299,7 @@ var NOOP_MODIFIER = function NOOP_MODIFIER() {
12854
13299
  * Returns {@link NOOP_MODIFIER} if the array is empty or nullish.
12855
13300
  *
12856
13301
  * @param modifiers - array of modifier functions to merge
13302
+ * @returns a single modifier function that applies all provided modifiers, or {@link NOOP_MODIFIER} if empty
12857
13303
  *
12858
13304
  * @example
12859
13305
  * ```ts
@@ -12874,6 +13320,7 @@ var NOOP_MODIFIER = function NOOP_MODIFIER() {
12874
13320
  * If only one modifier is provided, returns it directly without wrapping.
12875
13321
  *
12876
13322
  * @param modifiers - array of modifier functions to merge, or undefined
13323
+ * @returns a composed modifier function, the single modifier if only one provided, or `undefined` if input is nullish
12877
13324
  */ function maybeMergeModifiers(modifiers) {
12878
13325
  var result = undefined;
12879
13326
  if (modifiers != null) {
@@ -12911,6 +13358,7 @@ var NOOP_MODIFIER = function NOOP_MODIFIER() {
12911
13358
  * Operates via simple string splitting rather than URL parsing, so it works with partial or non-standard URLs.
12912
13359
  *
12913
13360
  * @param url - the full URL string to clean
13361
+ * @returns the URL string with query parameters and hash fragments removed
12914
13362
  *
12915
13363
  * @example
12916
13364
  * ```ts
@@ -13167,17 +13615,12 @@ function _ts_generator$7(thisArg, body) {
13167
13615
  result = _state.sent();
13168
13616
  return [
13169
13617
  3,
13170
- 4
13618
+ 3
13171
13619
  ];
13172
13620
  case 2:
13173
- return [
13174
- 4,
13175
- getValueFromGetter(defaultValue)
13176
- ];
13621
+ result = getValueFromGetter(defaultValue);
13622
+ _state.label = 3;
13177
13623
  case 3:
13178
- result = _state.sent();
13179
- _state.label = 4;
13180
- case 4:
13181
13624
  return [
13182
13625
  2,
13183
13626
  result
@@ -13278,6 +13721,31 @@ function _ts_generator$7(thisArg, body) {
13278
13721
  };
13279
13722
  }
13280
13723
 
13724
+ function _array_like_to_array$b(arr, len) {
13725
+ if (len == null || len > arr.length) len = arr.length;
13726
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
13727
+ return arr2;
13728
+ }
13729
+ function _array_without_holes$6(arr) {
13730
+ if (Array.isArray(arr)) return _array_like_to_array$b(arr);
13731
+ }
13732
+ function _iterable_to_array$6(iter) {
13733
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
13734
+ }
13735
+ function _non_iterable_spread$6() {
13736
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
13737
+ }
13738
+ function _to_consumable_array$6(arr) {
13739
+ return _array_without_holes$6(arr) || _iterable_to_array$6(arr) || _unsupported_iterable_to_array$b(arr) || _non_iterable_spread$6();
13740
+ }
13741
+ function _unsupported_iterable_to_array$b(o, minLen) {
13742
+ if (!o) return;
13743
+ if (typeof o === "string") return _array_like_to_array$b(o, minLen);
13744
+ var n = Object.prototype.toString.call(o).slice(8, -1);
13745
+ if (n === "Object" && o.constructor) n = o.constructor.name;
13746
+ if (n === "Map" || n === "Set") return Array.from(n);
13747
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$b(o, minLen);
13748
+ }
13281
13749
  /**
13282
13750
  * Creates an {@link ObjectDeltaArrayCompressor} that can compress and expand arrays of objects using delta encoding.
13283
13751
  *
@@ -13289,7 +13757,7 @@ function _ts_generator$7(thisArg, body) {
13289
13757
  */ function objectDeltaArrayCompressor(config) {
13290
13758
  var _equalityChecker = config.equalityChecker;
13291
13759
  var assignKnownValuesToCopy = assignValuesToPOJOFunction({
13292
- keysFilter: Array.from(_equalityChecker._fields.keys()),
13760
+ keysFilter: _to_consumable_array$6(_equalityChecker._fields.keys()),
13293
13761
  valueFilter: exports.KeyValueTypleValueFilter.NULL
13294
13762
  });
13295
13763
  function compress(uncompressed) {
@@ -13326,7 +13794,7 @@ function _ts_generator$7(thisArg, body) {
13326
13794
  });
13327
13795
  return result;
13328
13796
  }
13329
- var allKeys = Array.from(_equalityChecker._fields.keys());
13797
+ var allKeys = _to_consumable_array$6(_equalityChecker._fields.keys());
13330
13798
  function expand(compressed) {
13331
13799
  if (compressed.length === 0) {
13332
13800
  return [];
@@ -13452,12 +13920,28 @@ function _type_of$6(obj) {
13452
13920
  if (obj != null && (typeof obj === "undefined" ? "undefined" : _type_of$6(obj)) === 'object') {
13453
13921
  var keys = Object.keys(obj);
13454
13922
  if (keys.length > 0) {
13455
- for(var i = 0; i < keys.length; i += 1){
13456
- var key = keys[i];
13457
- var value = obj[key];
13458
- var isEmpty = (typeof value === "undefined" ? "undefined" : _type_of$6(value)) === 'object' ? objectIsEmpty(value) : !hasValueOrNotEmpty(value);
13459
- if (!isEmpty) {
13460
- return false;
13923
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
13924
+ try {
13925
+ for(var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
13926
+ var key = _step.value;
13927
+ var value = obj[key];
13928
+ var isEmpty = (typeof value === "undefined" ? "undefined" : _type_of$6(value)) === 'object' ? objectIsEmpty(value) : !hasValueOrNotEmpty(value);
13929
+ if (!isEmpty) {
13930
+ return false;
13931
+ }
13932
+ }
13933
+ } catch (err) {
13934
+ _didIteratorError = true;
13935
+ _iteratorError = err;
13936
+ } finally{
13937
+ try {
13938
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
13939
+ _iterator.return();
13940
+ }
13941
+ } finally{
13942
+ if (_didIteratorError) {
13943
+ throw _iteratorError;
13944
+ }
13461
13945
  }
13462
13946
  }
13463
13947
  }
@@ -13519,8 +14003,7 @@ function dateFromDateOrTimeSecondsNumber(input) {
13519
14003
  var parsedExpiresFromDate = expiresFromDate != null ? dateFromDateOrTimeMillisecondsNumber(expiresFromDate) : null;
13520
14004
  function getNow(nowOverride) {
13521
14005
  var _ref;
13522
- var now = (_ref = nowOverride !== null && nowOverride !== void 0 ? nowOverride : inputNow) !== null && _ref !== void 0 ? _ref : new Date();
13523
- return now;
14006
+ return (_ref = nowOverride !== null && nowOverride !== void 0 ? nowOverride : inputNow) !== null && _ref !== void 0 ? _ref : new Date();
13524
14007
  }
13525
14008
  function hasExpired(nowOverride) {
13526
14009
  var defaultIfNoExpirationDate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
@@ -13635,30 +14118,30 @@ function dateFromDateOrTimeSecondsNumber(input) {
13635
14118
  return firstExpired !== -1;
13636
14119
  }
13637
14120
 
13638
- function _array_like_to_array$9(arr, len) {
14121
+ function _array_like_to_array$a(arr, len) {
13639
14122
  if (len == null || len > arr.length) len = arr.length;
13640
14123
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
13641
14124
  return arr2;
13642
14125
  }
13643
- function _array_without_holes$3(arr) {
13644
- if (Array.isArray(arr)) return _array_like_to_array$9(arr);
14126
+ function _array_without_holes$5(arr) {
14127
+ if (Array.isArray(arr)) return _array_like_to_array$a(arr);
13645
14128
  }
13646
- function _iterable_to_array$3(iter) {
14129
+ function _iterable_to_array$5(iter) {
13647
14130
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
13648
14131
  }
13649
- function _non_iterable_spread$3() {
14132
+ function _non_iterable_spread$5() {
13650
14133
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
13651
14134
  }
13652
- function _to_consumable_array$3(arr) {
13653
- return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$9(arr) || _non_iterable_spread$3();
14135
+ function _to_consumable_array$5(arr) {
14136
+ return _array_without_holes$5(arr) || _iterable_to_array$5(arr) || _unsupported_iterable_to_array$a(arr) || _non_iterable_spread$5();
13654
14137
  }
13655
- function _unsupported_iterable_to_array$9(o, minLen) {
14138
+ function _unsupported_iterable_to_array$a(o, minLen) {
13656
14139
  if (!o) return;
13657
- if (typeof o === "string") return _array_like_to_array$9(o, minLen);
14140
+ if (typeof o === "string") return _array_like_to_array$a(o, minLen);
13658
14141
  var n = Object.prototype.toString.call(o).slice(8, -1);
13659
14142
  if (n === "Object" && o.constructor) n = o.constructor.name;
13660
14143
  if (n === "Map" || n === "Set") return Array.from(n);
13661
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
14144
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$a(o, minLen);
13662
14145
  }
13663
14146
  /**
13664
14147
  * Returns the day of the week for the input date.
@@ -13784,9 +14267,9 @@ function _unsupported_iterable_to_array$9(o, minLen) {
13784
14267
  if (sundayFirst) {
13785
14268
  dayOfWeekNames = [
13786
14269
  sunday
13787
- ].concat(_to_consumable_array$3(days));
14270
+ ].concat(_to_consumable_array$5(days));
13788
14271
  } else {
13789
- dayOfWeekNames = _to_consumable_array$3(days).concat([
14272
+ dayOfWeekNames = _to_consumable_array$5(days).concat([
13790
14273
  sunday
13791
14274
  ]);
13792
14275
  }
@@ -13888,6 +14371,20 @@ function _unsupported_iterable_to_array$9(o, minLen) {
13888
14371
  return result;
13889
14372
  }
13890
14373
 
14374
+ /**
14375
+ * Converts the input number of milliseconds to whole minutes by flooring the result.
14376
+ *
14377
+ * @param milliseconds - The number of milliseconds to convert.
14378
+ * @returns The equivalent whole minutes, rounded down.
14379
+ *
14380
+ * @example
14381
+ * ```ts
14382
+ * millisecondsToMinutes(180000); // 3
14383
+ * millisecondsToMinutes(90000); // 1
14384
+ * ```
14385
+ */ function millisecondsToMinutes(milliseconds) {
14386
+ return Math.floor(milliseconds / MS_IN_MINUTE);
14387
+ }
13891
14388
  /**
13892
14389
  * Converts the input number of milliseconds to the equivalent in minutes and seconds.
13893
14390
  *
@@ -14239,6 +14736,9 @@ function waitForMs(ms, value) {
14239
14736
  * Polls at a regular interval until a condition is met or the maximum number of attempts is reached.
14240
14737
  *
14241
14738
  * @param config - Polling configuration including check function, wait interval, and max attempts.
14739
+ * @param config.check - predicate function that returns true when the polling condition has been satisfied
14740
+ * @param config.wait - milliseconds to wait between polling iterations; defaults to 250
14741
+ * @param config.timesToGiveup - maximum number of polling iterations before giving up; defaults to `Number.MAX_SAFE_INTEGER`
14242
14742
  * @returns A Promise that resolves when the check condition returns `true` or the max attempts are exhausted.
14243
14743
  */ function poll(param) {
14244
14744
  var check = param.check, _param_wait = param.wait, wait = _param_wait === void 0 ? 250 : _param_wait, _param_timesToGiveup = param.timesToGiveup, timesToGiveup = _param_timesToGiveup === void 0 ? Number.MAX_SAFE_INTEGER : _param_timesToGiveup;
@@ -14380,7 +14880,7 @@ var PROMISE_REF_NUMBER = 0;
14380
14880
  return ref;
14381
14881
  }
14382
14882
 
14383
- function _array_like_to_array$8(arr, len) {
14883
+ function _array_like_to_array$9(arr, len) {
14384
14884
  if (len == null || len > arr.length) len = arr.length;
14385
14885
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
14386
14886
  return arr2;
@@ -14388,8 +14888,8 @@ function _array_like_to_array$8(arr, len) {
14388
14888
  function _array_with_holes$7(arr) {
14389
14889
  if (Array.isArray(arr)) return arr;
14390
14890
  }
14391
- function _array_without_holes$2(arr) {
14392
- if (Array.isArray(arr)) return _array_like_to_array$8(arr);
14891
+ function _array_without_holes$4(arr) {
14892
+ if (Array.isArray(arr)) return _array_like_to_array$9(arr);
14393
14893
  }
14394
14894
  function asyncGeneratorStep$4(gen, resolve, reject, _next, _throw, key, arg) {
14395
14895
  try {
@@ -14433,7 +14933,7 @@ function _define_property$9(obj, key, value) {
14433
14933
  }
14434
14934
  return obj;
14435
14935
  }
14436
- function _iterable_to_array$2(iter) {
14936
+ function _iterable_to_array$4(iter) {
14437
14937
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
14438
14938
  }
14439
14939
  function _iterable_to_array_limit$7(arr, i) {
@@ -14463,7 +14963,7 @@ function _iterable_to_array_limit$7(arr, i) {
14463
14963
  function _non_iterable_rest$7() {
14464
14964
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
14465
14965
  }
14466
- function _non_iterable_spread$2() {
14966
+ function _non_iterable_spread$4() {
14467
14967
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
14468
14968
  }
14469
14969
  function _object_spread$5(target) {
@@ -14501,18 +15001,18 @@ function _object_spread_props$2(target, source) {
14501
15001
  return target;
14502
15002
  }
14503
15003
  function _sliced_to_array$7(arr, i) {
14504
- return _array_with_holes$7(arr) || _iterable_to_array_limit$7(arr, i) || _unsupported_iterable_to_array$8(arr, i) || _non_iterable_rest$7();
15004
+ return _array_with_holes$7(arr) || _iterable_to_array_limit$7(arr, i) || _unsupported_iterable_to_array$9(arr, i) || _non_iterable_rest$7();
14505
15005
  }
14506
- function _to_consumable_array$2(arr) {
14507
- return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$8(arr) || _non_iterable_spread$2();
15006
+ function _to_consumable_array$4(arr) {
15007
+ return _array_without_holes$4(arr) || _iterable_to_array$4(arr) || _unsupported_iterable_to_array$9(arr) || _non_iterable_spread$4();
14508
15008
  }
14509
- function _unsupported_iterable_to_array$8(o, minLen) {
15009
+ function _unsupported_iterable_to_array$9(o, minLen) {
14510
15010
  if (!o) return;
14511
- if (typeof o === "string") return _array_like_to_array$8(o, minLen);
15011
+ if (typeof o === "string") return _array_like_to_array$9(o, minLen);
14512
15012
  var n = Object.prototype.toString.call(o).slice(8, -1);
14513
15013
  if (n === "Object" && o.constructor) n = o.constructor.name;
14514
15014
  if (n === "Map" || n === "Set") return Array.from(n);
14515
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
15015
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$9(o, minLen);
14516
15016
  }
14517
15017
  function _ts_generator$4(thisArg, body) {
14518
15018
  var f, y, t, _ = {
@@ -14613,20 +15113,6 @@ function _ts_generator$4(thisArg, body) {
14613
15113
  };
14614
15114
  }
14615
15115
  }
14616
- function _ts_values(o) {
14617
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
14618
- if (m) return m.call(o);
14619
- if (o && typeof o.length === "number") return {
14620
- next: function() {
14621
- if (o && i >= o.length) o = void 0;
14622
- return {
14623
- value: o && o[i++],
14624
- done: !o
14625
- };
14626
- }
14627
- };
14628
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
14629
- }
14630
15116
  /**
14631
15117
  * Runs a single async task and returns the resulting value. Always configured to throw on failure.
14632
15118
  *
@@ -14885,7 +15371,7 @@ function _performAsyncTask(_0, _1) {
14885
15371
  2,
14886
15372
  [
14887
15373
  value
14888
- ].concat(_to_consumable_array$2(result))
15374
+ ].concat(_to_consumable_array$4(result))
14889
15375
  ];
14890
15376
  }
14891
15377
  retriesRemaining = retriesAllowed - tryNumber;
@@ -14919,7 +15405,7 @@ function _performAsyncTask(_0, _1) {
14919
15405
  config = _arguments.length > 2 && _arguments[2] !== void 0 ? _arguments[2] : {};
14920
15406
  inputThrowError = config.throwError, inputRetriesAllowed = config.retriesAllowed, _config_retryWait = config.retryWait, retryWait = _config_retryWait === void 0 ? 200 : _config_retryWait, beforeRetry = config.beforeRetry;
14921
15407
  throwError = inputThrowError !== null && inputThrowError !== void 0 ? inputThrowError : true; // throw errors by default
14922
- retriesAllowed = inputRetriesAllowed ? inputRetriesAllowed : 0;
15408
+ retriesAllowed = inputRetriesAllowed || 0;
14923
15409
  return [
14924
15410
  2,
14925
15411
  iterateTask(value, 0)
@@ -14989,10 +15475,10 @@ function _performAsyncTask(_0, _1) {
14989
15475
  * with configurable concurrency limits and non-concurrent key constraints.
14990
15476
  *
14991
15477
  * @param config - Configuration for the task factory, parallelism, and concurrency behavior.
14992
- * @returns A function that accepts a task input factory and returns a Promise resolving when all tasks complete.
15478
+ * @returns a function that accepts a task input factory and returns a Promise that resolves when all tasks complete
14993
15479
  */ function performTasksFromFactoryInParallelFunction(config) {
14994
15480
  /**
14995
- * By default returns null
15481
+ * @returns null
14996
15482
  */ var defaultNonConcurrentTaskKeyFactory = function defaultNonConcurrentTaskKeyFactory() {
14997
15483
  return null;
14998
15484
  };
@@ -15003,133 +15489,95 @@ function _performAsyncTask(_0, _1) {
15003
15489
  return new Promise(function(resolve, reject) {
15004
15490
  var requestMoreTasks = function requestMoreTasks(parallelIndex) {
15005
15491
  return _async_to_generator$4(function() {
15006
- var promiseRef, waited;
15492
+ var promiseRef;
15007
15493
  return _ts_generator$4(this, function(_state) {
15008
- switch(_state.label){
15009
- case 0:
15010
- if (!isOutOfTasks) return [
15011
- 3,
15012
- 1
15013
- ];
15014
- return [
15015
- 2
15016
- ];
15017
- case 1:
15018
- promiseRef = promiseReference();
15019
- if (!isFulfillingTask) return [
15020
- 3,
15021
- 3
15022
- ];
15494
+ if (isOutOfTasks) {
15495
+ return [
15496
+ 2
15497
+ ];
15498
+ } else {
15499
+ promiseRef = promiseReference();
15500
+ if (isFulfillingTask) {
15023
15501
  requestTasksQueue.push([
15024
15502
  parallelIndex,
15025
15503
  promiseRef
15026
15504
  ]);
15027
- return [
15028
- 4,
15029
- promiseRef.promise
15030
- ];
15031
- case 2:
15032
- waited = _state.sent();
15033
- return [
15034
- 2,
15035
- waited
15036
- ];
15037
- case 3:
15038
- fulfillRequestMoreTasks(parallelIndex, promiseRef);
15039
- _state.label = 4;
15040
- case 4:
15041
15505
  return [
15042
15506
  2,
15043
15507
  promiseRef.promise
15044
15508
  ];
15045
- case 5:
15046
- return [
15047
- 2
15048
- ];
15509
+ } else {
15510
+ void fulfillRequestMoreTasks(parallelIndex, promiseRef);
15511
+ }
15512
+ return [
15513
+ 2,
15514
+ promiseRef.promise
15515
+ ];
15049
15516
  }
15050
15517
  });
15051
15518
  })();
15052
15519
  };
15520
+ var tryAcquireTask = function tryAcquireTask(candidate) {
15521
+ var candidateIndex = candidate[2];
15522
+ if (visitedTaskIndexes.has(candidateIndex)) {
15523
+ return 'skip';
15524
+ }
15525
+ var keys = candidate[1];
15526
+ var keyOfTaskCurrentlyInUse = setContainsAnyValue(currentParellelTaskKeys, keys);
15527
+ if (keyOfTaskCurrentlyInUse) {
15528
+ keys.forEach(function(key) {
15529
+ return waitingConcurrentTasks.addTuples(key, candidate);
15530
+ });
15531
+ return 'defer';
15532
+ }
15533
+ addToSet(currentParellelTaskKeys, keys);
15534
+ return 'acquired';
15535
+ };
15053
15536
  var getNextTask = function getNextTask(parallelIndex) {
15054
15537
  return _async_to_generator$4(function() {
15055
- var _loop, nextTask, _ret;
15538
+ var nextTask, result;
15056
15539
  return _ts_generator$4(this, function(_state) {
15057
15540
  switch(_state.label){
15058
- case 0:
15059
- _loop = function() {
15060
- var nextTaskTuple, nextTaskTupleIndex, keys, keyOfTaskCurrentlyInUse;
15061
- return _ts_generator$4(this, function(_state) {
15062
- switch(_state.label){
15063
- case 0:
15064
- if (!(!isOutOfTasks && incompleteTasks.length === 0)) return [
15065
- 3,
15066
- 2
15067
- ];
15068
- return [
15069
- 4,
15070
- requestMoreTasks(parallelIndex)
15071
- ];
15072
- case 1:
15073
- nextTask = _state.sent();
15074
- _state.label = 2;
15075
- case 2:
15076
- nextTask = nextTask !== null && nextTask !== void 0 ? nextTask : incompleteTasks.pop();
15077
- if (nextTask != null) {
15078
- nextTaskTuple = nextTask;
15079
- nextTaskTupleIndex = nextTaskTuple[2];
15080
- if (visitedTaskIndexes.has(nextTaskTupleIndex)) {
15081
- // already run. Ignore.
15082
- nextTask = undefined;
15083
- } else {
15084
- keys = nextTaskTuple[1];
15085
- keyOfTaskCurrentlyInUse = setContainsAnyValue(currentParellelTaskKeys, keys);
15086
- if (keyOfTaskCurrentlyInUse) {
15087
- keys.forEach(function(key) {
15088
- return waitingConcurrentTasks.addTuples(key, nextTaskTuple);
15089
- }); // add to each key as waiting
15090
- nextTask = undefined; // clear to continue loop
15091
- } else {
15092
- addToSet(currentParellelTaskKeys, keys); // add to the current task keys, exit loop
15093
- return [
15094
- 2,
15095
- "break"
15096
- ];
15097
- }
15098
- }
15099
- } else {
15100
- return [
15101
- 2,
15102
- "break" // no tasks remaining, break.
15103
- ];
15104
- }
15105
- return [
15106
- 2
15107
- ];
15108
- }
15109
- });
15110
- };
15541
+ case 0:
15111
15542
  nextTask = undefined;
15112
15543
  _state.label = 1;
15113
15544
  case 1:
15114
15545
  if (!!nextTask) return [
15546
+ 3,
15547
+ 4
15548
+ ];
15549
+ if (!(!isOutOfTasks && incompleteTasks.length === 0)) return [
15115
15550
  3,
15116
15551
  3
15117
15552
  ];
15118
15553
  return [
15119
- 5,
15120
- _ts_values(_loop())
15554
+ 4,
15555
+ requestMoreTasks(parallelIndex)
15121
15556
  ];
15122
15557
  case 2:
15123
- _ret = _state.sent();
15124
- if (_ret === "break") return [
15125
- 3,
15126
- 3
15127
- ];
15558
+ nextTask = _state.sent();
15559
+ _state.label = 3;
15560
+ case 3:
15561
+ nextTask = nextTask !== null && nextTask !== void 0 ? nextTask : incompleteTasks.pop();
15562
+ if (nextTask == null) {
15563
+ return [
15564
+ 3,
15565
+ 4
15566
+ ];
15567
+ }
15568
+ result = tryAcquireTask(nextTask);
15569
+ if (result === 'acquired') {
15570
+ return [
15571
+ 3,
15572
+ 4
15573
+ ];
15574
+ }
15575
+ nextTask = undefined;
15128
15576
  return [
15129
15577
  3,
15130
15578
  1
15131
15579
  ];
15132
- case 3:
15580
+ case 4:
15133
15581
  if (nextTask) {
15134
15582
  // mark to prevent running again/concurrent runs
15135
15583
  visitedTaskIndexes.add(nextTask[2]);
@@ -15142,7 +15590,7 @@ function _performAsyncTask(_0, _1) {
15142
15590
  });
15143
15591
  })();
15144
15592
  };
15145
- var onTaskCompleted = function onTaskCompleted(task, parallelIndex) {
15593
+ var onTaskCompleted = function onTaskCompleted(task, _parallelIndex) {
15146
15594
  var keys = task[1];
15147
15595
  var indexesPushed = new Set();
15148
15596
  keys.forEach(function(key) {
@@ -15202,7 +15650,7 @@ function _performAsyncTask(_0, _1) {
15202
15650
  ];
15203
15651
  }).reverse(); // reverse to use push/pop
15204
15652
  baseI += newTaskEntries.length;
15205
- incompleteTasks = _to_consumable_array$2(newTaskEntries).concat(_to_consumable_array$2(incompleteTasks)); // new tasks go to the front of the stack
15653
+ incompleteTasks = _to_consumable_array$4(newTaskEntries).concat(_to_consumable_array$4(incompleteTasks)); // new tasks go to the front of the stack
15206
15654
  }
15207
15655
  _state.label = 2;
15208
15656
  case 2:
@@ -15221,10 +15669,10 @@ function _performAsyncTask(_0, _1) {
15221
15669
  _state.sent();
15222
15670
  _state.label = 4;
15223
15671
  case 4:
15224
- if (!isFulfillingTask && requestTasksQueue.length) {
15672
+ if (requestTasksQueue.length) {
15225
15673
  nextItemInQueue = requestTasksQueue.pop();
15226
15674
  if (nextItemInQueue) {
15227
- fulfillRequestMoreTasks(nextItemInQueue[0], nextItemInQueue[1]);
15675
+ void fulfillRequestMoreTasks(nextItemInQueue[0], nextItemInQueue[1]);
15228
15676
  }
15229
15677
  }
15230
15678
  return [
@@ -15263,10 +15711,10 @@ function _performAsyncTask(_0, _1) {
15263
15711
  // build/start promise
15264
15712
  promise = taskFactory(nextTask[0], currentRunIndex, nextTask[1]);
15265
15713
  currentRunIndex += 1;
15266
- promise.then(function() {
15714
+ void promise.then(function() {
15267
15715
  onTaskCompleted(nextTask);
15268
15716
  setTimeout(function() {
15269
- return dispatchNextPromise(parallelIndex);
15717
+ return void dispatchNextPromise(parallelIndex);
15270
15718
  }, waitBetweenTasks);
15271
15719
  }, function(e) {
15272
15720
  hasEncounteredFailure = true;
@@ -15290,7 +15738,7 @@ function _performAsyncTask(_0, _1) {
15290
15738
  }
15291
15739
  // run the initial promises
15292
15740
  range(0, maxPromisesToRunAtOneTime).forEach(function(parallelIndex) {
15293
- dispatchNextPromise(parallelIndex);
15741
+ void dispatchNextPromise(parallelIndex);
15294
15742
  });
15295
15743
  });
15296
15744
  };
@@ -15442,7 +15890,7 @@ function _object_spread$4(target) {
15442
15890
  var enabled = true;
15443
15891
  setConfig(initialConfig, true);
15444
15892
  function _checkRemainingReset() {
15445
- if (nextResetAt && isPast(nextResetAt)) {
15893
+ if (isPast(nextResetAt)) {
15446
15894
  reset();
15447
15895
  }
15448
15896
  }
@@ -15671,61 +16119,97 @@ function _ts_generator$3(thisArg, body) {
15671
16119
  var promiseFactories = config.promiseFactories, defaultSuccessOnMaybe = config.successOnMaybe, defaultThrowErrors = config.throwErrors;
15672
16120
  return function(input, config) {
15673
16121
  return _async_to_generator$3(function() {
15674
- var _ref, inputSuccessOnMaybe, inputThrowErrors, successOnMaybe, throwErrors, result, i, nextPromise, e;
16122
+ var _ref, inputSuccessOnMaybe, inputThrowErrors, successOnMaybe, throwErrors, result, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, factory, nextPromise, e, err;
15675
16123
  return _ts_generator$3(this, function(_state) {
15676
16124
  switch(_state.label){
15677
16125
  case 0:
15678
16126
  _ref = config !== null && config !== void 0 ? config : {}, inputSuccessOnMaybe = _ref.successOnMaybe, inputThrowErrors = _ref.throwErrors;
15679
16127
  successOnMaybe = inputSuccessOnMaybe !== null && inputSuccessOnMaybe !== void 0 ? inputSuccessOnMaybe : defaultSuccessOnMaybe;
15680
16128
  throwErrors = inputThrowErrors !== null && inputThrowErrors !== void 0 ? inputThrowErrors : defaultThrowErrors;
15681
- i = 0;
16129
+ _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
15682
16130
  _state.label = 1;
15683
16131
  case 1:
15684
- if (!(i < promiseFactories.length)) return [
15685
- 3,
15686
- 6
15687
- ];
16132
+ _state.trys.push([
16133
+ 1,
16134
+ 8,
16135
+ 9,
16136
+ 10
16137
+ ]);
16138
+ _iterator = promiseFactories[Symbol.iterator]();
15688
16139
  _state.label = 2;
15689
16140
  case 2:
16141
+ if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
16142
+ 3,
16143
+ 7
16144
+ ];
16145
+ factory = _step.value;
16146
+ _state.label = 3;
16147
+ case 3:
15690
16148
  _state.trys.push([
15691
- 2,
15692
- 4,
16149
+ 3,
16150
+ 5,
15693
16151
  ,
15694
- 5
16152
+ 6
15695
16153
  ]);
15696
- nextPromise = promiseFactories[i](input);
16154
+ nextPromise = factory(input);
15697
16155
  return [
15698
16156
  4,
15699
16157
  nextPromise
15700
16158
  ];
15701
- case 3:
16159
+ case 4:
15702
16160
  result = _state.sent();
15703
16161
  if (result != null || successOnMaybe) {
15704
16162
  return [
15705
16163
  3,
15706
- 6
16164
+ 7
15707
16165
  ]; // end loop early
15708
16166
  }
15709
16167
  return [
15710
16168
  3,
15711
- 5
16169
+ 6
15712
16170
  ];
15713
- case 4:
16171
+ case 5:
15714
16172
  e = _state.sent();
15715
16173
  if (throwErrors) {
15716
16174
  throw e; // throw the error if requested
15717
16175
  }
15718
16176
  return [
15719
16177
  3,
15720
- 5
16178
+ 6
15721
16179
  ];
15722
- case 5:
15723
- i += 1;
16180
+ case 6:
16181
+ _iteratorNormalCompletion = true;
15724
16182
  return [
15725
16183
  3,
15726
- 1
16184
+ 2
15727
16185
  ];
15728
- case 6:
16186
+ case 7:
16187
+ return [
16188
+ 3,
16189
+ 10
16190
+ ];
16191
+ case 8:
16192
+ err = _state.sent();
16193
+ _didIteratorError = true;
16194
+ _iteratorError = err;
16195
+ return [
16196
+ 3,
16197
+ 10
16198
+ ];
16199
+ case 9:
16200
+ try {
16201
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
16202
+ _iterator.return();
16203
+ }
16204
+ } finally{
16205
+ if (_didIteratorError) {
16206
+ throw _iteratorError;
16207
+ }
16208
+ }
16209
+ return [
16210
+ 7
16211
+ ];
16212
+ case 10:
15729
16213
  return [
15730
16214
  2,
15731
16215
  result
@@ -15736,7 +16220,7 @@ function _ts_generator$3(thisArg, body) {
15736
16220
  };
15737
16221
  }
15738
16222
 
15739
- function _array_like_to_array$7(arr, len) {
16223
+ function _array_like_to_array$8(arr, len) {
15740
16224
  if (len == null || len > arr.length) len = arr.length;
15741
16225
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
15742
16226
  return arr2;
@@ -15848,15 +16332,15 @@ function _object_spread_props$1(target, source) {
15848
16332
  return target;
15849
16333
  }
15850
16334
  function _sliced_to_array$6(arr, i) {
15851
- return _array_with_holes$6(arr) || _iterable_to_array_limit$6(arr, i) || _unsupported_iterable_to_array$7(arr, i) || _non_iterable_rest$6();
16335
+ return _array_with_holes$6(arr) || _iterable_to_array_limit$6(arr, i) || _unsupported_iterable_to_array$8(arr, i) || _non_iterable_rest$6();
15852
16336
  }
15853
- function _unsupported_iterable_to_array$7(o, minLen) {
16337
+ function _unsupported_iterable_to_array$8(o, minLen) {
15854
16338
  if (!o) return;
15855
- if (typeof o === "string") return _array_like_to_array$7(o, minLen);
16339
+ if (typeof o === "string") return _array_like_to_array$8(o, minLen);
15856
16340
  var n = Object.prototype.toString.call(o).slice(8, -1);
15857
16341
  if (n === "Object" && o.constructor) n = o.constructor.name;
15858
16342
  if (n === "Map" || n === "Set") return Array.from(n);
15859
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
16343
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$8(o, minLen);
15860
16344
  }
15861
16345
  function _ts_generator$2(thisArg, body) {
15862
16346
  var f, y, t, _ = {
@@ -16207,6 +16691,9 @@ function _is_native_reflect_construct$2() {
16207
16691
  case 'paused':
16208
16692
  result = null;
16209
16693
  break;
16694
+ case 'cancelled':
16695
+ result = null;
16696
+ break;
16210
16697
  }
16211
16698
  return result;
16212
16699
  };
@@ -16298,7 +16785,7 @@ function _is_native_reflect_construct$2() {
16298
16785
  * @param timer - The timer to toggle
16299
16786
  * @param toggleRun - If provided, forces the timer to run (true) or stop (false). Otherwise toggles the current state.
16300
16787
  */ function toggleTimerRunning(timer, toggleRun) {
16301
- toggleRun = toggleRun != null ? toggleRun : timer.state !== 'running';
16788
+ toggleRun = toggleRun !== null && toggleRun !== void 0 ? toggleRun : timer.state !== 'running';
16302
16789
  if (toggleRun) {
16303
16790
  timer.start();
16304
16791
  } else {
@@ -16307,6 +16794,9 @@ function _is_native_reflect_construct$2() {
16307
16794
  }
16308
16795
  /**
16309
16796
  * Returns the approximate end date of the given timer. If a timer is already complete, it returns the time for now.
16797
+ *
16798
+ * @param timer - the timer whose end date to approximate
16799
+ * @returns a Date representing the estimated end time, or null if no duration remains
16310
16800
  */ function approximateTimerEndDate(timer) {
16311
16801
  var durationRemaining = timer.durationRemaining;
16312
16802
  if (durationRemaining != null) {
@@ -16360,7 +16850,7 @@ function dateFromLogicalDate(logicalDate) {
16360
16850
  return isLogicalDateStringCode;
16361
16851
  }
16362
16852
 
16363
- function _array_like_to_array$6(arr, len) {
16853
+ function _array_like_to_array$7(arr, len) {
16364
16854
  if (len == null || len > arr.length) len = arr.length;
16365
16855
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
16366
16856
  return arr2;
@@ -16368,6 +16858,9 @@ function _array_like_to_array$6(arr, len) {
16368
16858
  function _array_with_holes$5(arr) {
16369
16859
  if (Array.isArray(arr)) return arr;
16370
16860
  }
16861
+ function _array_without_holes$3(arr) {
16862
+ if (Array.isArray(arr)) return _array_like_to_array$7(arr);
16863
+ }
16371
16864
  function _instanceof(left, right) {
16372
16865
  if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
16373
16866
  return !!right[Symbol.hasInstance](left);
@@ -16375,6 +16868,9 @@ function _instanceof(left, right) {
16375
16868
  return left instanceof right;
16376
16869
  }
16377
16870
  }
16871
+ function _iterable_to_array$3(iter) {
16872
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
16873
+ }
16378
16874
  function _iterable_to_array_limit$5(arr, i) {
16379
16875
  var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
16380
16876
  if (_i == null) return;
@@ -16402,20 +16898,26 @@ function _iterable_to_array_limit$5(arr, i) {
16402
16898
  function _non_iterable_rest$5() {
16403
16899
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
16404
16900
  }
16901
+ function _non_iterable_spread$3() {
16902
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
16903
+ }
16405
16904
  function _sliced_to_array$5(arr, i) {
16406
- return _array_with_holes$5(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$6(arr, i) || _non_iterable_rest$5();
16905
+ return _array_with_holes$5(arr) || _iterable_to_array_limit$5(arr, i) || _unsupported_iterable_to_array$7(arr, i) || _non_iterable_rest$5();
16906
+ }
16907
+ function _to_consumable_array$3(arr) {
16908
+ return _array_without_holes$3(arr) || _iterable_to_array$3(arr) || _unsupported_iterable_to_array$7(arr) || _non_iterable_spread$3();
16407
16909
  }
16408
16910
  function _type_of$3(obj) {
16409
16911
  "@swc/helpers - typeof";
16410
16912
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
16411
16913
  }
16412
- function _unsupported_iterable_to_array$6(o, minLen) {
16914
+ function _unsupported_iterable_to_array$7(o, minLen) {
16413
16915
  if (!o) return;
16414
- if (typeof o === "string") return _array_like_to_array$6(o, minLen);
16916
+ if (typeof o === "string") return _array_like_to_array$7(o, minLen);
16415
16917
  var n = Object.prototype.toString.call(o).slice(8, -1);
16416
16918
  if (n === "Object" && o.constructor) n = o.constructor.name;
16417
16919
  if (n === "Map" || n === "Set") return Array.from(n);
16418
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
16920
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$7(o, minLen);
16419
16921
  }
16420
16922
  /**
16421
16923
  * Performs a deep equality comparison between two values.
@@ -16438,76 +16940,90 @@ function _unsupported_iterable_to_array$6(o, minLen) {
16438
16940
  * @param pojoFilter - Filter function applied to each value before comparison
16439
16941
  * @returns `true` if the filtered values are deeply equal
16440
16942
  */ function areEqualPOJOValuesUsingPojoFilter(a, b, pojoFilter) {
16943
+ var result;
16441
16944
  // check self
16442
16945
  if (a === b) {
16443
- return true;
16444
- }
16445
- // run pojo filter before comparison
16446
- a = pojoFilter(a, true);
16447
- b = pojoFilter(b, true);
16448
- // check one value is nullish and other is not
16449
- if ((a == null || b == null) && (a || b)) {
16450
- return false;
16451
- }
16452
- // object check
16453
- if ((typeof a === "undefined" ? "undefined" : _type_of$3(a)) === 'object') {
16454
- // check if they are arrays
16455
- if (isIterable(a, false)) {
16456
- if (Array.isArray(a)) {
16457
- if (a.length !== b.length) {
16458
- return false;
16459
- }
16460
- var firstInequalityIndex = a.findIndex(function(aValue, i) {
16461
- var bValue = b[i];
16462
- return !areEqualPOJOValuesUsingPojoFilter(aValue, bValue, pojoFilter);
16463
- });
16464
- return firstInequalityIndex === -1;
16465
- } else if (_instanceof(a, Set)) {
16466
- return setsAreEquivalent(a, b);
16467
- } else if (_instanceof(a, Map)) {
16468
- var bMap = b;
16469
- if (a.size !== bMap.size) {
16470
- return false;
16471
- }
16472
- var firstInequalityIndex1 = Array.from(a.entries()).findIndex(function(param) {
16473
- var _param = _sliced_to_array$5(param, 2), key = _param[0], aValue = _param[1];
16474
- var bValue = bMap.get(key);
16475
- return !areEqualPOJOValuesUsingPojoFilter(aValue, bValue, pojoFilter);
16476
- });
16477
- return firstInequalityIndex1 === -1;
16478
- }
16946
+ result = true;
16947
+ } else {
16948
+ // run pojo filter before comparison
16949
+ a = pojoFilter(a, true);
16950
+ b = pojoFilter(b, true);
16951
+ // check one value is nullish and other is not
16952
+ if ((a == null || b == null) && (a || b)) {
16953
+ result = false;
16954
+ } else if ((typeof a === "undefined" ? "undefined" : _type_of$3(a)) !== 'object') {
16955
+ result = false;
16956
+ } else if (isIterable(a, false)) {
16957
+ // check if they are iterables (arrays, Sets, Maps)
16958
+ result = _compareIterables(a, b, pojoFilter);
16479
16959
  } else if ((typeof b === "undefined" ? "undefined" : _type_of$3(b)) === 'object') {
16480
- // check contructors/types
16481
- var firstType = a === null || a === void 0 ? void 0 : a.constructor.name;
16482
- var secondType = b === null || b === void 0 ? void 0 : b.constructor.name;
16483
- if (firstType !== secondType) {
16484
- return false; // false if not the same type
16485
- }
16486
- // check Date comparison
16487
- if (isDate(a)) {
16488
- return isEqualDate(a, b);
16489
- }
16490
- // check object comparison via keys
16491
- var aObject = a;
16492
- var bObject = b;
16493
- var aKeys = Object.keys(aObject);
16494
- var bKeys = Object.keys(bObject);
16495
- // compare keys
16496
- if (aKeys.length === bKeys.length) {
16497
- var firstInequalityIndex2 = aKeys.findIndex(function(key) {
16498
- var aKeyValue = aObject[key];
16499
- var bKeyValue = bObject[key];
16500
- return !areEqualPOJOValuesUsingPojoFilter(aKeyValue, bKeyValue, pojoFilter);
16501
- });
16502
- if (firstInequalityIndex2 === -1) {
16503
- return true; // is equal if no non-matching key/value pair is found
16504
- }
16505
- }
16960
+ // check plain object comparison
16961
+ result = _compareObjects(a, b, pojoFilter);
16962
+ } else {
16963
+ result = false;
16506
16964
  }
16507
16965
  }
16508
- // still not equal if down here
16966
+ return result;
16967
+ }
16968
+ function _compareIterables(a, b, pojoFilter) {
16969
+ if (Array.isArray(a)) {
16970
+ return _compareArrays(a, b, pojoFilter);
16971
+ }
16972
+ if (_instanceof(a, Set)) {
16973
+ return setsAreEquivalent(a, b);
16974
+ }
16975
+ if (_instanceof(a, Map)) {
16976
+ return _compareMaps(a, b, pojoFilter);
16977
+ }
16509
16978
  return false;
16510
16979
  }
16980
+ function _compareArrays(a, b, pojoFilter) {
16981
+ if (a.length !== b.length) {
16982
+ return false;
16983
+ }
16984
+ var firstInequalityIndex = a.findIndex(function(aValue, i) {
16985
+ var bValue = b[i];
16986
+ return !areEqualPOJOValuesUsingPojoFilter(aValue, bValue, pojoFilter);
16987
+ });
16988
+ return firstInequalityIndex === -1;
16989
+ }
16990
+ function _compareMaps(a, b, pojoFilter) {
16991
+ if (a.size !== b.size) {
16992
+ return false;
16993
+ }
16994
+ var firstInequalityIndex = _to_consumable_array$3(a.entries()).findIndex(function(param) {
16995
+ var _param = _sliced_to_array$5(param, 2), key = _param[0], aValue = _param[1];
16996
+ var bValue = b.get(key);
16997
+ return !areEqualPOJOValuesUsingPojoFilter(aValue, bValue, pojoFilter);
16998
+ });
16999
+ return firstInequalityIndex === -1;
17000
+ }
17001
+ function _compareObjects(a, b, pojoFilter) {
17002
+ // check constructors/types
17003
+ var firstType = a.constructor.name;
17004
+ var secondType = b.constructor.name;
17005
+ if (firstType !== secondType) {
17006
+ return false;
17007
+ }
17008
+ // check Date comparison
17009
+ if (isDate(a)) {
17010
+ return isEqualDate(a, b);
17011
+ }
17012
+ // check object comparison via keys
17013
+ var aObject = a;
17014
+ var bObject = b;
17015
+ var aKeys = Object.keys(aObject);
17016
+ var bKeys = Object.keys(bObject);
17017
+ if (aKeys.length !== bKeys.length) {
17018
+ return false;
17019
+ }
17020
+ var firstInequalityIndex = aKeys.findIndex(function(key) {
17021
+ var aKeyValue = aObject[key];
17022
+ var bKeyValue = bObject[key];
17023
+ return !areEqualPOJOValuesUsingPojoFilter(aKeyValue, bKeyValue, pojoFilter);
17024
+ });
17025
+ return firstInequalityIndex === -1;
17026
+ }
16511
17027
  /**
16512
17028
  * Creates an {@link ObjectFieldEqualityChecker} that compares two objects field-by-field using configured equality functions.
16513
17029
  *
@@ -16537,7 +17053,11 @@ function _unsupported_iterable_to_array$6(o, minLen) {
16537
17053
  var unequalFields = [];
16538
17054
  _fields.forEach(function(fieldConfig, fieldName) {
16539
17055
  var isEqual = fieldConfig.isEqual;
16540
- isEqual(a[fieldName], b[fieldName]) ? equalFields.push(fieldName) : unequalFields.push(fieldName);
17056
+ if (isEqual(a[fieldName], b[fieldName])) {
17057
+ equalFields.push(fieldName);
17058
+ } else {
17059
+ unequalFields.push(fieldName);
17060
+ }
16541
17061
  });
16542
17062
  return {
16543
17063
  a: a,
@@ -16591,7 +17111,7 @@ function _unsupported_iterable_to_array$6(o, minLen) {
16591
17111
  });
16592
17112
  }
16593
17113
 
16594
- function _array_like_to_array$5(arr, len) {
17114
+ function _array_like_to_array$6(arr, len) {
16595
17115
  if (len == null || len > arr.length) len = arr.length;
16596
17116
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
16597
17117
  return arr2;
@@ -16627,15 +17147,15 @@ function _non_iterable_rest$4() {
16627
17147
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
16628
17148
  }
16629
17149
  function _sliced_to_array$4(arr, i) {
16630
- return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest$4();
17150
+ return _array_with_holes$4(arr) || _iterable_to_array_limit$4(arr, i) || _unsupported_iterable_to_array$6(arr, i) || _non_iterable_rest$4();
16631
17151
  }
16632
- function _unsupported_iterable_to_array$5(o, minLen) {
17152
+ function _unsupported_iterable_to_array$6(o, minLen) {
16633
17153
  if (!o) return;
16634
- if (typeof o === "string") return _array_like_to_array$5(o, minLen);
17154
+ if (typeof o === "string") return _array_like_to_array$6(o, minLen);
16635
17155
  var n = Object.prototype.toString.call(o).slice(8, -1);
16636
17156
  if (n === "Object" && o.constructor) n = o.constructor.name;
16637
17157
  if (n === "Map" || n === "Set") return Array.from(n);
16638
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
17158
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$6(o, minLen);
16639
17159
  }
16640
17160
  /**
16641
17161
  * Converts an {@link ObjectMap} into a `Map` using `Object.entries`.
@@ -16779,6 +17299,9 @@ function _type_of$2(obj) {
16779
17299
  }
16780
17300
  /**
16781
17301
  * Returns true if the value is a plain object (not an array, Date, RegExp, null, etc.).
17302
+ *
17303
+ * @param value - the value to check
17304
+ * @returns true if the value is a plain object with an Object or null prototype
16782
17305
  */ function _isPlainObject(value) {
16783
17306
  var result = false;
16784
17307
  if (value != null && (typeof value === "undefined" ? "undefined" : _type_of$2(value)) === 'object') {
@@ -16812,7 +17335,7 @@ function _type_of$2(obj) {
16812
17335
  };
16813
17336
  }
16814
17337
 
16815
- function _array_like_to_array$4(arr, len) {
17338
+ function _array_like_to_array$5(arr, len) {
16816
17339
  if (len == null || len > arr.length) len = arr.length;
16817
17340
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
16818
17341
  return arr2;
@@ -16848,15 +17371,15 @@ function _non_iterable_rest$3() {
16848
17371
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
16849
17372
  }
16850
17373
  function _sliced_to_array$3(arr, i) {
16851
- return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$4(arr, i) || _non_iterable_rest$3();
17374
+ return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$5(arr, i) || _non_iterable_rest$3();
16852
17375
  }
16853
- function _unsupported_iterable_to_array$4(o, minLen) {
17376
+ function _unsupported_iterable_to_array$5(o, minLen) {
16854
17377
  if (!o) return;
16855
- if (typeof o === "string") return _array_like_to_array$4(o, minLen);
17378
+ if (typeof o === "string") return _array_like_to_array$5(o, minLen);
16856
17379
  var n = Object.prototype.toString.call(o).slice(8, -1);
16857
17380
  if (n === "Object" && o.constructor) n = o.constructor.name;
16858
17381
  if (n === "Map" || n === "Set") return Array.from(n);
16859
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
17382
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$5(o, minLen);
16860
17383
  }
16861
17384
  /**
16862
17385
  * Creates bidirectional map functions (`from` and `to`) from a set of {@link ModelFieldConversions}.
@@ -16958,7 +17481,7 @@ function _unsupported_iterable_to_array$4(o, minLen) {
16958
17481
  * @returns A function that maps Maybe input values to output values
16959
17482
  */ function modelFieldMapFunction(config) {
16960
17483
  var convert = config.convert;
16961
- var convertMaybe = config.convertMaybe;
17484
+ var convertMaybe = 'convertMaybe' in config ? config.convertMaybe : undefined;
16962
17485
  var defaultOutput = config.default;
16963
17486
  var defaultInput = config.defaultInput;
16964
17487
  var hasDefaultInput = defaultInput != null;
@@ -16970,7 +17493,7 @@ function _unsupported_iterable_to_array$4(o, minLen) {
16970
17493
  result = convert(input);
16971
17494
  } else {
16972
17495
  if (convertMaybe) {
16973
- result = convertMaybe(input !== null && input !== void 0 ? input : getDefaultInput());
17496
+ result = convertMaybe(input);
16974
17497
  } else if (hasDefaultInput) {
16975
17498
  result = convert(getDefaultInput());
16976
17499
  } else {
@@ -16988,8 +17511,7 @@ function _unsupported_iterable_to_array$4(o, minLen) {
16988
17511
  * @param input - Either a config ref or a pre-built conversions ref
16989
17512
  * @returns Resolved field conversions
16990
17513
  */ function toModelFieldConversions(input) {
16991
- var _input_fieldConversions;
16992
- var conversions = (_input_fieldConversions = input.fieldConversions) !== null && _input_fieldConversions !== void 0 ? _input_fieldConversions : modelFieldConversions(input.fields);
17514
+ var conversions = 'fieldConversions' in input ? input.fieldConversions : modelFieldConversions(input.fields);
16993
17515
  return conversions;
16994
17516
  }
16995
17517
  /**
@@ -17001,7 +17523,7 @@ function _unsupported_iterable_to_array$4(o, minLen) {
17001
17523
  * @returns Bidirectional model map functions
17002
17524
  */ function toModelMapFunctions(input) {
17003
17525
  var mapFunctions;
17004
- if (input.mapFunctions != null) {
17526
+ if ('mapFunctions' in input) {
17005
17527
  mapFunctions = input.mapFunctions;
17006
17528
  } else {
17007
17529
  var conversions = toModelFieldConversions(input);
@@ -17178,13 +17700,13 @@ function _object_spread$2(target) {
17178
17700
  }
17179
17701
  }
17180
17702
 
17181
- function _array_like_to_array$3(arr, len) {
17703
+ function _array_like_to_array$4(arr, len) {
17182
17704
  if (len == null || len > arr.length) len = arr.length;
17183
17705
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
17184
17706
  return arr2;
17185
17707
  }
17186
- function _array_without_holes$1(arr) {
17187
- if (Array.isArray(arr)) return _array_like_to_array$3(arr);
17708
+ function _array_without_holes$2(arr) {
17709
+ if (Array.isArray(arr)) return _array_like_to_array$4(arr);
17188
17710
  }
17189
17711
  function _class_call_check$5(instance, Constructor) {
17190
17712
  if (!(instance instanceof Constructor)) {
@@ -17204,22 +17726,22 @@ function _create_class$4(Constructor, protoProps, staticProps) {
17204
17726
  if (staticProps) _defineProperties$4(Constructor, staticProps);
17205
17727
  return Constructor;
17206
17728
  }
17207
- function _iterable_to_array$1(iter) {
17729
+ function _iterable_to_array$2(iter) {
17208
17730
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
17209
17731
  }
17210
- function _non_iterable_spread$1() {
17732
+ function _non_iterable_spread$2() {
17211
17733
  throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
17212
17734
  }
17213
- function _to_consumable_array$1(arr) {
17214
- return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$3(arr) || _non_iterable_spread$1();
17735
+ function _to_consumable_array$2(arr) {
17736
+ return _array_without_holes$2(arr) || _iterable_to_array$2(arr) || _unsupported_iterable_to_array$4(arr) || _non_iterable_spread$2();
17215
17737
  }
17216
- function _unsupported_iterable_to_array$3(o, minLen) {
17738
+ function _unsupported_iterable_to_array$4(o, minLen) {
17217
17739
  if (!o) return;
17218
- if (typeof o === "string") return _array_like_to_array$3(o, minLen);
17740
+ if (typeof o === "string") return _array_like_to_array$4(o, minLen);
17219
17741
  var n = Object.prototype.toString.call(o).slice(8, -1);
17220
17742
  if (n === "Object" && o.constructor) n = o.constructor.name;
17221
17743
  if (n === "Map" || n === "Set") return Array.from(n);
17222
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
17744
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$4(o, minLen);
17223
17745
  }
17224
17746
  /**
17225
17747
  * Type of relation change to perform on a collection of models.
@@ -17280,7 +17802,8 @@ function _unsupported_iterable_to_array$3(o, minLen) {
17280
17802
  },
17281
17803
  {
17282
17804
  key: "modifyCollection",
17283
- value: function modifyCollection(current, change, mods, config) {
17805
+ value: // eslint-disable-next-line @typescript-eslint/max-params
17806
+ function modifyCollection(current, change, mods, config) {
17284
17807
  var mask = config.mask, readKey = config.readKey;
17285
17808
  current = current !== null && current !== void 0 ? current : []; //init current if not set.
17286
17809
  if (mask) {
@@ -17299,15 +17822,23 @@ function _unsupported_iterable_to_array$3(o, minLen) {
17299
17822
  * The mask results are merged together.
17300
17823
  *
17301
17824
  * Order from the "current" is retained. Anything in currentRetain overrides modifiedResults.
17302
- */ function _mergeMaskResults(current, currentRetain, modifiedResults, readKey) {
17303
- return restoreOrderWithValues(current, _to_consumable_array$1(currentRetain).concat(_to_consumable_array$1(modifiedResults)), {
17825
+ *
17826
+ * @param current - the original array whose ordering is preserved
17827
+ * @param currentRetain - items from `current` that were excluded from modification and take precedence in the merge
17828
+ * @param modifiedResults - items that were modified or added during the relation change
17829
+ * @param readKey - function that extracts the relation key from each item for ordering
17830
+ * @returns the merged array with original ordering restored
17831
+ */ // eslint-disable-next-line @typescript-eslint/max-params
17832
+ function _mergeMaskResults(current, currentRetain, modifiedResults, readKey) {
17833
+ return restoreOrderWithValues(current, _to_consumable_array$2(currentRetain).concat(_to_consumable_array$2(modifiedResults)), {
17304
17834
  readKey: readKey
17305
17835
  });
17306
17836
  }
17307
17837
  },
17308
17838
  {
17309
17839
  key: "_modifyCollectionWithoutMask",
17310
- value: function _modifyCollectionWithoutMask(current, change, mods, config) {
17840
+ value: // eslint-disable-next-line @typescript-eslint/max-params
17841
+ function _modifyCollectionWithoutMask(current, change, mods, config) {
17311
17842
  var _config_readType;
17312
17843
  var readKey = config.readKey, merge = config.merge, shouldRemove = config.shouldRemove;
17313
17844
  var readType = (_config_readType = config.readType) !== null && _config_readType !== void 0 ? _config_readType : function() {
@@ -17398,7 +17929,14 @@ function _unsupported_iterable_to_array$3(o, minLen) {
17398
17929
  key: "_modifyCollection",
17399
17930
  value: /**
17400
17931
  * Used to modify a collection which may be multi-type. If readType is provided, the collection is handled as a multi-type map.
17401
- */ function _modifyCollection(current, mods, modifyCollection, readType) {
17932
+ *
17933
+ * @param current - the current collection of relation objects
17934
+ * @param mods - the modifications to apply to the collection
17935
+ * @param modifyCollection - function that applies modifications to a single-type subset of the collection
17936
+ * @param readType - optional function to read the type from each relation object, enabling multi-type handling
17937
+ * @returns the modified collection with all changes applied
17938
+ */ // eslint-disable-next-line @typescript-eslint/max-params
17939
+ function _modifyCollection(current, mods, modifyCollection, readType) {
17402
17940
  if (readType) {
17403
17941
  return ModelRelationUtility._modifyMultiTypeCollection(current, mods, readType, modifyCollection);
17404
17942
  } else {
@@ -17408,12 +17946,13 @@ function _unsupported_iterable_to_array$3(o, minLen) {
17408
17946
  },
17409
17947
  {
17410
17948
  key: "_modifyMultiTypeCollection",
17411
- value: function _modifyMultiTypeCollection(input, mods, readType, modifyCollection) {
17949
+ value: // eslint-disable-next-line @typescript-eslint/max-params
17950
+ function _modifyMultiTypeCollection(input, mods, readType, modifyCollection) {
17412
17951
  var inputMap = makeValuesGroupMap(input, readType);
17413
17952
  var modsMap = makeValuesGroupMap(mods, readType);
17414
- var typesModified = new Set(_to_consumable_array$1(inputMap.keys()).concat(_to_consumable_array$1(modsMap.keys())));
17953
+ var typesModified = new Set(_to_consumable_array$2(inputMap.keys()).concat(_to_consumable_array$2(modsMap.keys())));
17415
17954
  // Break the collections up into their individual types and process separately.
17416
- var modifiedSubcollections = Array.from(typesModified).map(function(type) {
17955
+ var modifiedSubcollections = _to_consumable_array$2(typesModified).map(function(type) {
17417
17956
  var _inputMap_get, _modsMap_get;
17418
17957
  var values = (_inputMap_get = inputMap.get(type)) !== null && _inputMap_get !== void 0 ? _inputMap_get : [];
17419
17958
  var _$mods = (_modsMap_get = modsMap.get(type)) !== null && _modsMap_get !== void 0 ? _modsMap_get : [];
@@ -17426,7 +17965,7 @@ function _unsupported_iterable_to_array$3(o, minLen) {
17426
17965
  });
17427
17966
  // Rejoin all changes.
17428
17967
  return modifiedSubcollections.reduce(function(x, y) {
17429
- return x.concat(y);
17968
+ return _to_consumable_array$2(x).concat(_to_consumable_array$2(y));
17430
17969
  }, []);
17431
17970
  }
17432
17971
  },
@@ -17446,11 +17985,10 @@ function _unsupported_iterable_to_array$3(o, minLen) {
17446
17985
  }
17447
17986
  });
17448
17987
  var added = ModelRelationUtility.addToCollection(current, addValues, readKey);
17449
- var results = ModelRelationUtility._updateSingleTypeCollection(added, updateValues, {
17988
+ return ModelRelationUtility._updateSingleTypeCollection(added, updateValues, {
17450
17989
  readKey: readKey,
17451
17990
  merge: merge
17452
17991
  });
17453
- return results;
17454
17992
  }
17455
17993
  },
17456
17994
  {
@@ -17482,7 +18020,7 @@ function _unsupported_iterable_to_array$3(o, minLen) {
17482
18020
  * @returns The collection with added items.
17483
18021
  */ function addToCollection(current, add, readKey) {
17484
18022
  current = current !== null && current !== void 0 ? current : [];
17485
- return (add === null || add === void 0 ? void 0 : add.length) ? ModelRelationUtility.removeDuplicates(_to_consumable_array$1(add).concat(_to_consumable_array$1(current)), readKey) : current; // Will keep any "added" before any existing ones.
18023
+ return add.length ? ModelRelationUtility.removeDuplicates(_to_consumable_array$2(add).concat(_to_consumable_array$2(current)), readKey) : current; // Will keep any "added" before any existing ones.
17486
18024
  }
17487
18025
  },
17488
18026
  {
@@ -17496,7 +18034,8 @@ function _unsupported_iterable_to_array$3(o, minLen) {
17496
18034
  * @param readKey - Function to extract the unique key from each item.
17497
18035
  * @param shouldRemove - Optional predicate that must return true for a matched item to actually be removed.
17498
18036
  * @returns The collection with matching items removed.
17499
- */ function removeFromCollection(current, remove, readKey, shouldRemove) {
18037
+ */ // eslint-disable-next-line @typescript-eslint/max-params
18038
+ function removeFromCollection(current, remove, readKey, shouldRemove) {
17500
18039
  if (current === null || current === void 0 ? void 0 : current.length) {
17501
18040
  if (shouldRemove) {
17502
18041
  var currentKeyPairs = makeKeyPairs(current, readKey);
@@ -17587,7 +18126,7 @@ function handlerFactory(readKey, options) {
17587
18126
  var bindHandle = handle.bind(bindTo);
17588
18127
  set(key, bindHandle);
17589
18128
  };
17590
- var fn = build({
18129
+ return build({
17591
18130
  base: function base(value) {
17592
18131
  var _ref;
17593
18132
  var key = readKey(value);
@@ -17609,7 +18148,6 @@ function handlerFactory(readKey, options) {
17609
18148
  x.setCatchAll = setCatchAll;
17610
18149
  }
17611
18150
  });
17612
- return fn;
17613
18151
  };
17614
18152
  }
17615
18153
  /**
@@ -17705,7 +18243,7 @@ function handlerFactory(readKey, options) {
17705
18243
  };
17706
18244
  }
17707
18245
 
17708
- function _array_like_to_array$2(arr, len) {
18246
+ function _array_like_to_array$3(arr, len) {
17709
18247
  if (len == null || len > arr.length) len = arr.length;
17710
18248
  for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
17711
18249
  return arr2;
@@ -17772,15 +18310,15 @@ function _non_iterable_rest$2() {
17772
18310
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
17773
18311
  }
17774
18312
  function _sliced_to_array$2(arr, i) {
17775
- return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
18313
+ return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$2();
17776
18314
  }
17777
- function _unsupported_iterable_to_array$2(o, minLen) {
18315
+ function _unsupported_iterable_to_array$3(o, minLen) {
17778
18316
  if (!o) return;
17779
- if (typeof o === "string") return _array_like_to_array$2(o, minLen);
18317
+ if (typeof o === "string") return _array_like_to_array$3(o, minLen);
17780
18318
  var n = Object.prototype.toString.call(o).slice(8, -1);
17781
18319
  if (n === "Object" && o.constructor) n = o.constructor.name;
17782
18320
  if (n === "Map" || n === "Set") return Array.from(n);
17783
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
18321
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
17784
18322
  }
17785
18323
  /**
17786
18324
  * TypedServiceRegistry implementation.
@@ -17998,6 +18536,8 @@ function _define_property$3(obj, key, value) {
17998
18536
  key: "length",
17999
18537
  get: /**
18000
18538
  * The number of items stored.
18539
+ *
18540
+ * @returns the current count of stored key-value pairs
18001
18541
  */ function get() {
18002
18542
  return this._length;
18003
18543
  }
@@ -18005,6 +18545,7 @@ function _define_property$3(obj, key, value) {
18005
18545
  {
18006
18546
  /**
18007
18547
  * Returns the key at the given index.
18548
+ *
18008
18549
  * @param index The index of the key to retrieve.
18009
18550
  * @returns The key string if found, otherwise null.
18010
18551
  */ key: "key",
@@ -18016,6 +18557,7 @@ function _define_property$3(obj, key, value) {
18016
18557
  {
18017
18558
  /**
18018
18559
  * Checks if a key exists in the storage.
18560
+ *
18019
18561
  * @param key The key to check.
18020
18562
  * @returns True if the key exists, false otherwise.
18021
18563
  */ key: "hasKey",
@@ -18026,6 +18568,7 @@ function _define_property$3(obj, key, value) {
18026
18568
  {
18027
18569
  /**
18028
18570
  * Retrieves an item from storage.
18571
+ *
18029
18572
  * @param key The key of the item to retrieve.
18030
18573
  * @returns The item string if found, otherwise null or undefined.
18031
18574
  */ key: "getItem",
@@ -18038,6 +18581,7 @@ function _define_property$3(obj, key, value) {
18038
18581
  /**
18039
18582
  * Sets an item in storage.
18040
18583
  * If the item is null or undefined, the key will be removed.
18584
+ *
18041
18585
  * @param key The key of the item to set.
18042
18586
  * @param item The item string to store.
18043
18587
  */ key: "setItem",
@@ -18055,6 +18599,7 @@ function _define_property$3(obj, key, value) {
18055
18599
  {
18056
18600
  /**
18057
18601
  * Removes an item from storage.
18602
+ *
18058
18603
  * @param key The key of the item to remove.
18059
18604
  */ key: "removeItem",
18060
18605
  value: function removeItem(key) {
@@ -18221,6 +18766,31 @@ function _is_native_reflect_construct() {
18221
18766
  }
18222
18767
  ();
18223
18768
 
18769
+ function _array_like_to_array$2(arr, len) {
18770
+ if (len == null || len > arr.length) len = arr.length;
18771
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
18772
+ return arr2;
18773
+ }
18774
+ function _array_without_holes$1(arr) {
18775
+ if (Array.isArray(arr)) return _array_like_to_array$2(arr);
18776
+ }
18777
+ function _iterable_to_array$1(iter) {
18778
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
18779
+ }
18780
+ function _non_iterable_spread$1() {
18781
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
18782
+ }
18783
+ function _to_consumable_array$1(arr) {
18784
+ return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$2(arr) || _non_iterable_spread$1();
18785
+ }
18786
+ function _unsupported_iterable_to_array$2(o, minLen) {
18787
+ if (!o) return;
18788
+ if (typeof o === "string") return _array_like_to_array$2(o, minLen);
18789
+ var n = Object.prototype.toString.call(o).slice(8, -1);
18790
+ if (n === "Object" && o.constructor) n = o.constructor.name;
18791
+ if (n === "Map" || n === "Set") return Array.from(n);
18792
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
18793
+ }
18224
18794
  /**
18225
18795
  * Joins together various arrays of CSS classes into a single space-separated string of unique class names.
18226
18796
  *
@@ -18230,7 +18800,7 @@ function _is_native_reflect_construct() {
18230
18800
  var result = '';
18231
18801
  if (cssClasses) {
18232
18802
  var allClasses = cssClassesSet(cssClasses);
18233
- result = joinStringsWithSpaces(Array.from(allClasses));
18803
+ result = joinStringsWithSpaces(_to_consumable_array$1(allClasses));
18234
18804
  }
18235
18805
  return result;
18236
18806
  }
@@ -18244,11 +18814,11 @@ function _is_native_reflect_construct() {
18244
18814
  var result;
18245
18815
  if (cssClasses) {
18246
18816
  var arrayOfClasses = iterableToArray(cssClasses, false);
18247
- var arrayOfAllClassValues = arrayOfClasses.map(function(x) {
18248
- return asArray(x).map(function(x) {
18817
+ var arrayOfAllClassValues = arrayOfClasses.flatMap(function(x) {
18818
+ return asArray(x).flatMap(function(x) {
18249
18819
  return x.split(' ');
18250
- }).flat();
18251
- }).flat();
18820
+ });
18821
+ });
18252
18822
  result = new Set(arrayOfAllClassValues);
18253
18823
  } else {
18254
18824
  result = new Set();
@@ -18316,14 +18886,30 @@ function _unsupported_iterable_to_array$1(o, minLen) {
18316
18886
  return inverted;
18317
18887
  }
18318
18888
 
18319
- /** MIME type for JPEG images. */ var JPEG_MIME_TYPE = 'image/jpeg';
18320
- /** MIME type for PNG images. */ var PNG_MIME_TYPE = 'image/png';
18321
- /** MIME type for WebP images. */ var WEBP_MIME_TYPE = 'image/webp';
18322
- /** MIME type for GIF images. */ var GIF_MIME_TYPE = 'image/gif';
18323
- /** MIME type for HEIF images. */ var HEIF_MIME_TYPE = 'image/heif';
18324
- /** MIME type for TIFF images. */ var TIFF_MIME_TYPE = 'image/tiff';
18325
- /** MIME type for SVG images. */ var SVG_MIME_TYPE = 'image/svg+xml';
18326
- /** MIME type for RAW images. */ var RAW_MIME_TYPE = 'image/raw';
18889
+ /**
18890
+ * MIME type for JPEG images.
18891
+ */ var JPEG_MIME_TYPE = 'image/jpeg';
18892
+ /**
18893
+ * MIME type for PNG images.
18894
+ */ var PNG_MIME_TYPE = 'image/png';
18895
+ /**
18896
+ * MIME type for WebP images.
18897
+ */ var WEBP_MIME_TYPE = 'image/webp';
18898
+ /**
18899
+ * MIME type for GIF images.
18900
+ */ var GIF_MIME_TYPE = 'image/gif';
18901
+ /**
18902
+ * MIME type for HEIF images.
18903
+ */ var HEIF_MIME_TYPE = 'image/heif';
18904
+ /**
18905
+ * MIME type for TIFF images.
18906
+ */ var TIFF_MIME_TYPE = 'image/tiff';
18907
+ /**
18908
+ * MIME type for SVG images.
18909
+ */ var SVG_MIME_TYPE = 'image/svg+xml';
18910
+ /**
18911
+ * MIME type for RAW images.
18912
+ */ var RAW_MIME_TYPE = 'image/raw';
18327
18913
  /**
18328
18914
  * Maps image file extensions to their corresponding MIME types.
18329
18915
  */ var IMAGE_FILE_EXTENSION_TO_MIME_TYPES_RECORD = {
@@ -18351,16 +18937,36 @@ function mimeTypeForImageFileExtension(extension) {
18351
18937
  */ function imageFileExtensionForMimeType(mimeType) {
18352
18938
  return mimeType ? IMAGE_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD[mimeType] : undefined;
18353
18939
  }
18354
- /** MIME type for PDF documents. */ var PDF_MIME_TYPE = 'application/pdf';
18355
- /** MIME type for DOCX (Word) documents. */ var DOCX_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
18356
- /** MIME type for XLSX (Excel) spreadsheets. */ var XLSX_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
18357
- /** MIME type for plain text files. */ var TXT_MIME_TYPE = 'text/plain';
18358
- /** MIME type for CSV files. */ var CSV_MIME_TYPE = 'text/csv';
18359
- /** MIME type for HTML files. */ var HTML_MIME_TYPE = 'text/html';
18360
- /** MIME type for XML files. */ var XML_MIME_TYPE = 'application/xml';
18361
- /** MIME type for JSON files. */ var JSON_MIME_TYPE = 'application/json';
18362
- /** MIME type for YAML files. */ var YAML_MIME_TYPE = 'application/yaml';
18363
- /** MIME type for Markdown files. */ var MARKDOWN_MIME_TYPE = 'text/markdown';
18940
+ /**
18941
+ * MIME type for PDF documents.
18942
+ */ var PDF_MIME_TYPE = 'application/pdf';
18943
+ /**
18944
+ * MIME type for DOCX (Word) documents.
18945
+ */ var DOCX_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
18946
+ /**
18947
+ * MIME type for XLSX (Excel) spreadsheets.
18948
+ */ var XLSX_MIME_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
18949
+ /**
18950
+ * MIME type for plain text files.
18951
+ */ var TXT_MIME_TYPE = 'text/plain';
18952
+ /**
18953
+ * MIME type for CSV files.
18954
+ */ var CSV_MIME_TYPE = 'text/csv';
18955
+ /**
18956
+ * MIME type for HTML files.
18957
+ */ var HTML_MIME_TYPE = 'text/html';
18958
+ /**
18959
+ * MIME type for XML files.
18960
+ */ var XML_MIME_TYPE = 'application/xml';
18961
+ /**
18962
+ * MIME type for JSON files.
18963
+ */ var JSON_MIME_TYPE = 'application/json';
18964
+ /**
18965
+ * MIME type for YAML files.
18966
+ */ var YAML_MIME_TYPE = 'application/yaml';
18967
+ /**
18968
+ * MIME type for Markdown files.
18969
+ */ var MARKDOWN_MIME_TYPE = 'text/markdown';
18364
18970
  /**
18365
18971
  * Maps document file extensions to their corresponding MIME types.
18366
18972
  */ var DOCUMENT_FILE_EXTENSION_TO_MIME_TYPES_RECORD = {
@@ -18389,7 +18995,9 @@ function mimeTypeForDocumentFileExtension(extension) {
18389
18995
  */ function documentFileExtensionForMimeType(mimeType) {
18390
18996
  return mimeType ? DOCUMENT_MIME_TYPES_TO_FILE_EXTENSIONS_RECORD[mimeType] : undefined;
18391
18997
  }
18392
- /** MIME type for ZIP archive files. */ var ZIP_FILE_MIME_TYPE = 'application/zip';
18998
+ /**
18999
+ * MIME type for ZIP archive files.
19000
+ */ var ZIP_FILE_MIME_TYPE = 'application/zip';
18393
19001
  /**
18394
19002
  * Maps application file extensions to their corresponding MIME types.
18395
19003
  */ var APPLICATION_FILE_EXTENSION_TO_MIME_TYPES_RECORD = {
@@ -18514,7 +19122,7 @@ function mimeTypeForFileExtension(extension) {
18514
19122
  var searchResult = readStrings(value);
18515
19123
  var match = false;
18516
19124
  if (Array.isArray(searchResult)) {
18517
- match = searchResult.findIndex(decision) !== -1;
19125
+ match = searchResult.some(decision);
18518
19126
  } else if (searchResult != null) {
18519
19127
  match = decision(searchResult);
18520
19128
  }
@@ -18530,7 +19138,7 @@ function mimeTypeForFileExtension(extension) {
18530
19138
  */ var caseInsensitiveFilterByIndexOfDecisionFactory = function caseInsensitiveFilterByIndexOfDecisionFactory(filterText) {
18531
19139
  var searchString = filterText.toLocaleLowerCase();
18532
19140
  return function(string) {
18533
- return string.toLocaleLowerCase().indexOf(searchString) !== -1;
19141
+ return string.toLocaleLowerCase().includes(searchString);
18534
19142
  };
18535
19143
  };
18536
19144
 
@@ -18632,11 +19240,9 @@ function _unsupported_iterable_to_array(o, minLen) {
18632
19240
  entries.forEach(function(entry) {
18633
19241
  result = factory(entry, result);
18634
19242
  });
18635
- if (!result) {
18636
- result = factory({
18637
- values: []
18638
- });
18639
- }
19243
+ result !== null && result !== void 0 ? result : result = factory({
19244
+ values: []
19245
+ });
18640
19246
  return result;
18641
19247
  }
18642
19248
  /**
@@ -18659,7 +19265,7 @@ function _unsupported_iterable_to_array(o, minLen) {
18659
19265
  var parts = value.split(separator);
18660
19266
  var currentNode = tree;
18661
19267
  parts.forEach(function(nodeValue) {
18662
- var existingChildNode = currentNode.children[nodeValue];
19268
+ var existingChildNode = currentNode.children[nodeValue]; // may be undefined for new paths
18663
19269
  var childNode = existingChildNode !== null && existingChildNode !== void 0 ? existingChildNode : {
18664
19270
  nodeValue: nodeValue,
18665
19271
  children: {}
@@ -19209,8 +19815,7 @@ function invertMaybeBoolean(x) {
19209
19815
  var chance = inputChance / 100;
19210
19816
  return function() {
19211
19817
  var roll = Math.random();
19212
- var result = roll <= chance;
19213
- return result;
19818
+ return roll <= chance;
19214
19819
  };
19215
19820
  }
19216
19821
  /**
@@ -19532,31 +20137,67 @@ function _ts_generator$1(thisArg, body) {
19532
20137
  * ```
19533
20138
  */ function iterate(values, useFn) {
19534
20139
  return _async_to_generator$1(function() {
19535
- var i;
20140
+ var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, value, err;
19536
20141
  return _ts_generator$1(this, function(_state) {
19537
20142
  switch(_state.label){
19538
20143
  case 0:
19539
- i = 0;
20144
+ _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
19540
20145
  _state.label = 1;
19541
20146
  case 1:
19542
- if (!(i < values.length)) return [
20147
+ _state.trys.push([
20148
+ 1,
20149
+ 6,
20150
+ 7,
20151
+ 8
20152
+ ]);
20153
+ _iterator = values[Symbol.iterator]();
20154
+ _state.label = 2;
20155
+ case 2:
20156
+ if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
19543
20157
  3,
19544
- 4
20158
+ 5
19545
20159
  ];
20160
+ value = _step.value;
19546
20161
  return [
19547
20162
  4,
19548
- useFn(values[i])
20163
+ useFn(value)
19549
20164
  ];
19550
- case 2:
19551
- _state.sent();
19552
- _state.label = 3;
19553
20165
  case 3:
19554
- i += 1;
20166
+ _state.sent();
20167
+ _state.label = 4;
20168
+ case 4:
20169
+ _iteratorNormalCompletion = true;
19555
20170
  return [
19556
20171
  3,
19557
- 1
20172
+ 2
19558
20173
  ];
19559
- case 4:
20174
+ case 5:
20175
+ return [
20176
+ 3,
20177
+ 8
20178
+ ];
20179
+ case 6:
20180
+ err = _state.sent();
20181
+ _didIteratorError = true;
20182
+ _iteratorError = err;
20183
+ return [
20184
+ 3,
20185
+ 8
20186
+ ];
20187
+ case 7:
20188
+ try {
20189
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
20190
+ _iterator.return();
20191
+ }
20192
+ } finally{
20193
+ if (_didIteratorError) {
20194
+ throw _iteratorError;
20195
+ }
20196
+ }
20197
+ return [
20198
+ 7
20199
+ ];
20200
+ case 8:
19560
20201
  return [
19561
20202
  2
19562
20203
  ];
@@ -19782,11 +20423,11 @@ function _ts_generator(thisArg, body) {
19782
20423
  * @throws Error if neither `use` nor `usePage` is specified in `iterFn`
19783
20424
  */ function iterateFilteredPages(inputPage, loadFn, iterFn) {
19784
20425
  return _async_to_generator(function() {
19785
- var _ref, _iterFn_usePage, currentPage, hasMore, count, useFn, page, values;
20426
+ var _iterFn_usePage, currentPage, hasMore, count, useFn, page, values;
19786
20427
  return _ts_generator(this, function(_state) {
19787
20428
  switch(_state.label){
19788
20429
  case 0:
19789
- currentPage = (_ref = inputPage === null || inputPage === void 0 ? void 0 : inputPage.page) !== null && _ref !== void 0 ? _ref : 0;
20430
+ currentPage = inputPage.page;
19790
20431
  hasMore = true;
19791
20432
  count = 0;
19792
20433
  if (!iterFn.use && !iterFn.usePage) {
@@ -19869,9 +20510,8 @@ function _ts_generator(thisArg, body) {
19869
20510
  var parentKey = parentParts.join('/');
19870
20511
  var parent = nodeMap.get(parentKey);
19871
20512
  if (parent) {
19872
- if (!parent.children) {
19873
- parent.children = [];
19874
- }
20513
+ var _parent, _children;
20514
+ (_children = (_parent = parent).children) !== null && _children !== void 0 ? _children : _parent.children = [];
19875
20515
  parent.children.push(node);
19876
20516
  node.parent = parent;
19877
20517
  } else if (includeChildrenWithMissingParentFolder) {
@@ -20638,6 +21278,7 @@ exports.mergeObjects = mergeObjects;
20638
21278
  exports.mergeObjectsFunction = mergeObjectsFunction;
20639
21279
  exports.mergeSlashPaths = mergeSlashPaths;
20640
21280
  exports.messageFromError = messageFromError;
21281
+ exports.millisecondsToMinutes = millisecondsToMinutes;
20641
21282
  exports.millisecondsToMinutesAndSeconds = millisecondsToMinutesAndSeconds;
20642
21283
  exports.mimeTypeForApplicationFileExtension = mimeTypeForApplicationFileExtension;
20643
21284
  exports.mimeTypeForDocumentFileExtension = mimeTypeForDocumentFileExtension;