immutable 5.0.0-beta.5 → 5.0.0-rc.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.
package/README.md CHANGED
@@ -86,7 +86,7 @@ map1.get('b') + ' vs. ' + map2.get('b'); // 2 vs. 50
86
86
 
87
87
  Immutable.js has no dependencies, which makes it predictable to include in a Browser.
88
88
 
89
- It's highly recommended to use a module bundler like [webpack](https://webpack.github.io/),
89
+ It's highly recommended to use a module bundler like [webpack](https://webpack.js.org/),
90
90
  [rollup](https://rollupjs.org/), or
91
91
  [browserify](https://browserify.org/). The `immutable` npm module works
92
92
  without any additional consideration. All examples throughout the documentation
@@ -29,11 +29,13 @@ import { isIndexed } from './predicates/isIndexed.js';
29
29
  import { isAssociative } from './predicates/isAssociative.js';
30
30
 
31
31
  var Collection = function Collection(value) {
32
+ // eslint-disable-next-line no-constructor-return
32
33
  return isCollection(value) ? value : Seq(value);
33
34
  };
34
35
 
35
36
  var KeyedCollection = /*@__PURE__*/(function (Collection) {
36
37
  function KeyedCollection(value) {
38
+ // eslint-disable-next-line no-constructor-return
37
39
  return isKeyed(value) ? value : KeyedSeq(value);
38
40
  }
39
41
 
@@ -46,6 +48,7 @@ var KeyedCollection = /*@__PURE__*/(function (Collection) {
46
48
 
47
49
  var IndexedCollection = /*@__PURE__*/(function (Collection) {
48
50
  function IndexedCollection(value) {
51
+ // eslint-disable-next-line no-constructor-return
49
52
  return isIndexed(value) ? value : IndexedSeq(value);
50
53
  }
51
54
 
@@ -58,6 +61,7 @@ var IndexedCollection = /*@__PURE__*/(function (Collection) {
58
61
 
59
62
  var SetCollection = /*@__PURE__*/(function (Collection) {
60
63
  function SetCollection(value) {
64
+ // eslint-disable-next-line no-constructor-return
61
65
  return isCollection(value) && !isAssociative(value) ? value : SetSeq(value);
62
66
  }
63
67
 
@@ -23,8 +23,7 @@
23
23
  * SOFTWARE.
24
24
  */
25
25
  import { Collection, KeyedCollection, IndexedCollection, SetCollection } from './Collection.js';
26
- import { IS_COLLECTION_SYMBOL, isCollection } from './predicates/isCollection.js';
27
- import { isAssociative } from './predicates/isAssociative.js';
26
+ import { IS_COLLECTION_SYMBOL } from './predicates/isCollection.js';
28
27
  import { isKeyed, IS_KEYED_SYMBOL } from './predicates/isKeyed.js';
29
28
  import { isIndexed, IS_INDEXED_SYMBOL } from './predicates/isIndexed.js';
30
29
  import { IS_ORDERED_SYMBOL, isOrdered } from './predicates/isOrdered.js';
@@ -52,13 +51,6 @@ import { getIn } from './methods/getIn.js';
52
51
  import { hasIn } from './methods/hasIn.js';
53
52
  import { toObject } from './methods/toObject.js';
54
53
 
55
- // Note: all of these methods are deprecated.
56
- Collection.isIterable = isCollection;
57
- Collection.isKeyed = isKeyed;
58
- Collection.isIndexed = isIndexed;
59
- Collection.isAssociative = isAssociative;
60
- Collection.isOrdered = isOrdered;
61
-
62
54
  Collection.Iterator = Iterator;
63
55
 
64
56
  mixin(Collection, {
@@ -293,6 +285,7 @@ mixin(Collection, {
293
285
  },
294
286
 
295
287
  entrySeq: function entrySeq() {
288
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
296
289
  var collection = this;
297
290
  if (collection._cache) {
298
291
  // We cache as an entries array, so we can just return the cache!
@@ -743,7 +736,8 @@ function hashCollection(collection) {
743
736
  var ordered = isOrdered(collection);
744
737
  var keyed = isKeyed(collection);
745
738
  var h = ordered ? 1 : 0;
746
- var size = collection.__iterate(
739
+
740
+ collection.__iterate(
747
741
  keyed
748
742
  ? ordered
749
743
  ? function (v, k) {
@@ -760,7 +754,8 @@ function hashCollection(collection) {
760
754
  h = (h + hash(v)) | 0;
761
755
  }
762
756
  );
763
- return murmurHashOfSize(size, h);
757
+
758
+ return murmurHashOfSize(collection.size, h);
764
759
  }
765
760
 
766
761
  function murmurHashOfSize(size, h) {
package/dist/es/List.js CHANGED
@@ -42,20 +42,25 @@ var List = /*@__PURE__*/(function (IndexedCollection) {
42
42
  function List(value) {
43
43
  var empty = emptyList();
44
44
  if (value === undefined || value === null) {
45
+ // eslint-disable-next-line no-constructor-return
45
46
  return empty;
46
47
  }
47
48
  if (isList(value)) {
49
+ // eslint-disable-next-line no-constructor-return
48
50
  return value;
49
51
  }
50
52
  var iter = IndexedCollection(value);
51
53
  var size = iter.size;
52
54
  if (size === 0) {
55
+ // eslint-disable-next-line no-constructor-return
53
56
  return empty;
54
57
  }
55
58
  assertNotInfinite(size);
56
59
  if (size > 0 && size < SIZE) {
60
+ // eslint-disable-next-line no-constructor-return
57
61
  return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));
58
62
  }
63
+ // eslint-disable-next-line no-constructor-return
59
64
  return empty.withMutations(function (list) {
60
65
  list.setSize(size);
61
66
  iter.forEach(function (v, i) { return list.set(i, v); });
@@ -421,9 +426,8 @@ function makeList(origin, capacity, level, root, tail, ownerID, hash) {
421
426
  return list;
422
427
  }
423
428
 
424
- var EMPTY_LIST;
425
429
  function emptyList() {
426
- return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));
430
+ return makeList(0, 0, SHIFT);
427
431
  }
428
432
 
429
433
  function updateList(list, index, value) {
package/dist/es/Map.js CHANGED
@@ -48,6 +48,7 @@ import { OrderedMap } from './OrderedMap.js';
48
48
 
49
49
  var Map = /*@__PURE__*/(function (KeyedCollection) {
50
50
  function Map(value) {
51
+ // eslint-disable-next-line no-constructor-return
51
52
  return value === undefined || value === null
52
53
  ? emptyMap()
53
54
  : isMap(value) && !isOrdered(value)
@@ -63,20 +64,6 @@ var Map = /*@__PURE__*/(function (KeyedCollection) {
63
64
  Map.prototype = Object.create( KeyedCollection && KeyedCollection.prototype );
64
65
  Map.prototype.constructor = Map;
65
66
 
66
- Map.of = function of () {
67
- var keyValues = [], len = arguments.length;
68
- while ( len-- ) keyValues[ len ] = arguments[ len ];
69
-
70
- return emptyMap().withMutations(function (map) {
71
- for (var i = 0; i < keyValues.length; i += 2) {
72
- if (i + 1 >= keyValues.length) {
73
- throw new Error('Missing value for key: ' + keyValues[i]);
74
- }
75
- map.set(keyValues[i], keyValues[i + 1]);
76
- }
77
- });
78
- };
79
-
80
67
  Map.prototype.toString = function toString () {
81
68
  return this.__toString('Map {', '}');
82
69
  };
@@ -566,7 +553,7 @@ BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate =
566
553
  }
567
554
  };
568
555
 
569
- // eslint-disable-next-line no-unused-vars
556
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
570
557
  ValueNode.prototype.iterate = function (fn, reverse) {
571
558
  return fn(this.entry);
572
559
  };
@@ -450,16 +450,16 @@ function sliceFactory(collection, begin, end, useKeys) {
450
450
  return collection;
451
451
  }
452
452
 
453
- var resolvedBegin = resolveBegin(begin, originalSize);
454
- var resolvedEnd = resolveEnd(end, originalSize);
455
-
456
- // begin or end will be NaN if they were provided as negative numbers and
453
+ // begin or end can not be resolved if they were provided as negative numbers and
457
454
  // this collection's size is unknown. In that case, cache first so there is
458
455
  // a known size and these do not resolve to NaN.
459
- if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {
456
+ if (typeof originalSize === 'undefined' && (begin < 0 || end < 0)) {
460
457
  return sliceFactory(collection.toSeq().cacheResult(), begin, end, useKeys);
461
458
  }
462
459
 
460
+ var resolvedBegin = resolveBegin(begin, originalSize);
461
+ var resolvedEnd = resolveEnd(end, originalSize);
462
+
463
463
  // Note: resolvedEnd is undefined when the original sequence's length is
464
464
  // unknown and this slice did not supply an end and should contain all
465
465
  // elements after resolvedBegin.
@@ -32,6 +32,7 @@ import assertNotInfinite from './utils/assertNotInfinite.js';
32
32
 
33
33
  var OrderedMap = /*@__PURE__*/(function (Map) {
34
34
  function OrderedMap(value) {
35
+ // eslint-disable-next-line no-constructor-return
35
36
  return value === undefined || value === null
36
37
  ? emptyOrderedMap()
37
38
  : isOrderedMap(value)
@@ -32,6 +32,7 @@ import assertNotInfinite from './utils/assertNotInfinite.js';
32
32
 
33
33
  var OrderedSet = /*@__PURE__*/(function (Set) {
34
34
  function OrderedSet(value) {
35
+ // eslint-disable-next-line no-constructor-return
35
36
  return value === undefined || value === null
36
37
  ? emptyOrderedSet()
37
38
  : isOrderedSet(value)
package/dist/es/Range.js CHANGED
@@ -38,6 +38,7 @@ var Range = /*@__PURE__*/(function (IndexedSeq) {
38
38
  if ( step === void 0 ) step = 1;
39
39
 
40
40
  if (!(this instanceof Range)) {
41
+ // eslint-disable-next-line no-constructor-return
41
42
  return new Range(start, end, step);
42
43
  }
43
44
  invariant(step !== 0, 'Cannot step a Range by 0');
@@ -60,8 +61,10 @@ var Range = /*@__PURE__*/(function (IndexedSeq) {
60
61
  this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);
61
62
  if (this.size === 0) {
62
63
  if (EMPTY_RANGE) {
64
+ // eslint-disable-next-line no-constructor-return
63
65
  return EMPTY_RANGE;
64
66
  }
67
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
65
68
  EMPTY_RANGE = this;
66
69
  }
67
70
  }
package/dist/es/Record.js CHANGED
@@ -128,6 +128,7 @@ var Record = function Record(defaultValues, name) {
128
128
  RecordType.displayName = name;
129
129
  }
130
130
 
131
+ // eslint-disable-next-line no-constructor-return
131
132
  return RecordType;
132
133
  };
133
134
 
package/dist/es/Repeat.js CHANGED
@@ -35,14 +35,17 @@ import deepEqual from './utils/deepEqual.js';
35
35
  var Repeat = /*@__PURE__*/(function (IndexedSeq) {
36
36
  function Repeat(value, times) {
37
37
  if (!(this instanceof Repeat)) {
38
+ // eslint-disable-next-line no-constructor-return
38
39
  return new Repeat(value, times);
39
40
  }
40
41
  this._value = value;
41
42
  this.size = times === undefined ? Infinity : Math.max(0, times);
42
43
  if (this.size === 0) {
43
44
  if (EMPTY_REPEAT) {
45
+ // eslint-disable-next-line no-constructor-return
44
46
  return EMPTY_REPEAT;
45
47
  }
48
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
46
49
  EMPTY_REPEAT = this;
47
50
  }
48
51
  }
@@ -119,7 +122,7 @@ var Repeat = /*@__PURE__*/(function (IndexedSeq) {
119
122
  Repeat.prototype.equals = function equals (other) {
120
123
  return other instanceof Repeat
121
124
  ? is(this._value, other._value)
122
- : deepEqual(other);
125
+ : deepEqual(this, other);
123
126
  };
124
127
 
125
128
  return Repeat;
package/dist/es/Seq.js CHANGED
@@ -37,6 +37,7 @@ import isArrayLike from './utils/isArrayLike.js';
37
37
 
38
38
  var Seq = /*@__PURE__*/(function (Collection) {
39
39
  function Seq(value) {
40
+ // eslint-disable-next-line no-constructor-return
40
41
  return value === undefined || value === null
41
42
  ? emptySequence()
42
43
  : isImmutable(value)
@@ -105,6 +106,7 @@ var Seq = /*@__PURE__*/(function (Collection) {
105
106
 
106
107
  var KeyedSeq = /*@__PURE__*/(function (Seq) {
107
108
  function KeyedSeq(value) {
109
+ // eslint-disable-next-line no-constructor-return
108
110
  return value === undefined || value === null
109
111
  ? emptySequence().toKeyedSeq()
110
112
  : isCollection(value)
@@ -129,6 +131,7 @@ var KeyedSeq = /*@__PURE__*/(function (Seq) {
129
131
 
130
132
  var IndexedSeq = /*@__PURE__*/(function (Seq) {
131
133
  function IndexedSeq(value) {
134
+ // eslint-disable-next-line no-constructor-return
132
135
  return value === undefined || value === null
133
136
  ? emptySequence()
134
137
  : isCollection(value)
@@ -161,6 +164,7 @@ var IndexedSeq = /*@__PURE__*/(function (Seq) {
161
164
 
162
165
  var SetSeq = /*@__PURE__*/(function (Seq) {
163
166
  function SetSeq(value) {
167
+ // eslint-disable-next-line no-constructor-return
164
168
  return (
165
169
  isCollection(value) && !isAssociative(value) ? value : IndexedSeq(value)
166
170
  ).toSetSeq();
package/dist/es/Set.js CHANGED
@@ -36,6 +36,7 @@ import { OrderedSet } from './OrderedSet.js';
36
36
 
37
37
  var Set = /*@__PURE__*/(function (SetCollection) {
38
38
  function Set(value) {
39
+ // eslint-disable-next-line no-constructor-return
39
40
  return value === undefined || value === null
40
41
  ? emptySet()
41
42
  : isSet(value) && !isOrdered(value)
package/dist/es/Stack.js CHANGED
@@ -35,6 +35,7 @@ import { withMutations } from './methods/withMutations.js';
35
35
 
36
36
  var Stack = /*@__PURE__*/(function (IndexedCollection) {
37
37
  function Stack(value) {
38
+ // eslint-disable-next-line no-constructor-return
38
39
  return value === undefined || value === null
39
40
  ? emptyStack()
40
41
  : isStack(value)
@@ -22,6 +22,6 @@
22
22
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
23
  * SOFTWARE.
24
24
  */
25
- var version = "5.0.0-beta.5";
25
+ var version = "5.0.0-rc.2";
26
26
 
27
27
  export { version };
@@ -1,3 +1,5 @@
1
+ /** @ignore we should disable this rules, but let's activate it to enable eslint first */
2
+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types */
1
3
  /**
2
4
  * Immutable data encourages pure functions (data-in, data-out) and lends itself
3
5
  * to much simpler application development and enabling techniques from
@@ -125,6 +127,7 @@ declare namespace Immutable {
125
127
  : string]: V extends object ? unknown : V;
126
128
  }
127
129
  : // convert IndexedCollection or Immutable.Set to DeepCopy plain JS array
130
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
128
131
  T extends Collection<infer _, infer V>
129
132
  ? Array<DeepCopy<V>>
130
133
  : T extends string | number // Iterable scalar types : should be kept as is
@@ -789,24 +792,6 @@ declare namespace Immutable {
789
792
  * ```
790
793
  */
791
794
  function isMap(maybeMap: unknown): maybeMap is Map<unknown, unknown>;
792
-
793
- /**
794
- * Creates a new Map from alternating keys and values
795
- *
796
- * <!-- runkit:activate -->
797
- * ```js
798
- * const { Map } = require('immutable')
799
- * Map.of(
800
- * 'key', 'value',
801
- * 'numerical value', 3,
802
- * 0, 'numerical key'
803
- * )
804
- * // Map { 0: "numerical key", "key": "value", "numerical value": 3 }
805
- * ```
806
- *
807
- * @deprecated Use Map([ [ 'k', 'v' ] ]) or Map({ k: 'v' })
808
- */
809
- function of(...keyValues: Array<unknown>): Map<unknown, unknown>;
810
795
  }
811
796
 
812
797
  /**
@@ -870,7 +855,9 @@ declare namespace Immutable {
870
855
  get<K extends keyof R>(key: K, notSetValue?: unknown): R[K];
871
856
  get<NSV>(key: any, notSetValue: NSV): NSV;
872
857
 
873
- // https://github.com/microsoft/TypeScript/pull/39094
858
+ // TODO `<const P extends ...>` can be used after dropping support for TypeScript 4.x
859
+ // reference: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#const-type-parameters
860
+ // after this change, `as const` assertions can be remove from the type tests
874
861
  getIn<P extends ReadonlyArray<string | number | symbol>>(
875
862
  searchKeyPath: [...P],
876
863
  notSetValue?: unknown
@@ -1604,6 +1591,65 @@ declare namespace Immutable {
1604
1591
  * @see Collection.Keyed.flip
1605
1592
  */
1606
1593
  flip(): Map<V, K>;
1594
+
1595
+ /**
1596
+ * Returns an OrderedMap of the same type which includes the same entries,
1597
+ * stably sorted by using a `comparator`.
1598
+ *
1599
+ * If a `comparator` is not provided, a default comparator uses `<` and `>`.
1600
+ *
1601
+ * `comparator(valueA, valueB)`:
1602
+ *
1603
+ * * Returns `0` if the elements should not be swapped.
1604
+ * * Returns `-1` (or any negative number) if `valueA` comes before `valueB`
1605
+ * * Returns `1` (or any positive number) if `valueA` comes after `valueB`
1606
+ * * Alternatively, can return a value of the `PairSorting` enum type
1607
+ * * Is pure, i.e. it must always return the same value for the same pair
1608
+ * of values.
1609
+ *
1610
+ * <!-- runkit:activate -->
1611
+ * ```js
1612
+ * const { Map } = require('immutable')
1613
+ * Map({ "c": 3, "a": 1, "b": 2 }).sort((a, b) => {
1614
+ * if (a < b) { return -1; }
1615
+ * if (a > b) { return 1; }
1616
+ * if (a === b) { return 0; }
1617
+ * });
1618
+ * // OrderedMap { "a": 1, "b": 2, "c": 3 }
1619
+ * ```
1620
+ *
1621
+ * Note: `sort()` Always returns a new instance, even if the original was
1622
+ * already sorted.
1623
+ *
1624
+ * Note: This is always an eager operation.
1625
+ */
1626
+ sort(comparator?: Comparator<V>): this & OrderedMap<K, V>;
1627
+
1628
+ /**
1629
+ * Like `sort`, but also accepts a `comparatorValueMapper` which allows for
1630
+ * sorting by more sophisticated means:
1631
+ *
1632
+ * <!-- runkit:activate -->
1633
+ * ```js
1634
+ * const { Map } = require('immutable')
1635
+ * const beattles = Map({
1636
+ * John: { name: "Lennon" },
1637
+ * Paul: { name: "McCartney" },
1638
+ * George: { name: "Harrison" },
1639
+ * Ringo: { name: "Starr" },
1640
+ * });
1641
+ * beattles.sortBy(member => member.name);
1642
+ * ```
1643
+ *
1644
+ * Note: `sortBy()` Always returns a new instance, even if the original was
1645
+ * already sorted.
1646
+ *
1647
+ * Note: This is always an eager operation.
1648
+ */
1649
+ sortBy<C>(
1650
+ comparatorValueMapper: (value: V, key: K, iter: this) => C,
1651
+ comparator?: (valueA: C, valueB: C) => number
1652
+ ): this & OrderedMap<K, V>;
1607
1653
  }
1608
1654
 
1609
1655
  /**
@@ -1831,7 +1877,6 @@ declare namespace Immutable {
1831
1877
  * this Collection or JavaScript Object.
1832
1878
  */
1833
1879
  function fromKeys<T>(iter: Collection.Keyed<T, unknown>): Set<T>;
1834
- // tslint:disable-next-line unified-signatures
1835
1880
  function fromKeys<T>(iter: Collection<T, unknown>): Set<T>;
1836
1881
  function fromKeys(obj: { [key: string]: unknown }): Set<string>;
1837
1882
 
@@ -2026,6 +2071,65 @@ declare namespace Immutable {
2026
2071
  predicate: (this: C, value: T, key: T, iter: this) => unknown,
2027
2072
  context?: C
2028
2073
  ): [this, this];
2074
+
2075
+ /**
2076
+ * Returns an OrderedSet of the same type which includes the same entries,
2077
+ * stably sorted by using a `comparator`.
2078
+ *
2079
+ * If a `comparator` is not provided, a default comparator uses `<` and `>`.
2080
+ *
2081
+ * `comparator(valueA, valueB)`:
2082
+ *
2083
+ * * Returns `0` if the elements should not be swapped.
2084
+ * * Returns `-1` (or any negative number) if `valueA` comes before `valueB`
2085
+ * * Returns `1` (or any positive number) if `valueA` comes after `valueB`
2086
+ * * Alternatively, can return a value of the `PairSorting` enum type
2087
+ * * Is pure, i.e. it must always return the same value for the same pair
2088
+ * of values.
2089
+ *
2090
+ * <!-- runkit:activate -->
2091
+ * ```js
2092
+ * const { Set } = require('immutable')
2093
+ * Set(['b', 'a', 'c']).sort((a, b) => {
2094
+ * if (a < b) { return -1; }
2095
+ * if (a > b) { return 1; }
2096
+ * if (a === b) { return 0; }
2097
+ * });
2098
+ * // OrderedSet { "a":, "b", "c" }
2099
+ * ```
2100
+ *
2101
+ * Note: `sort()` Always returns a new instance, even if the original was
2102
+ * already sorted.
2103
+ *
2104
+ * Note: This is always an eager operation.
2105
+ */
2106
+ sort(comparator?: Comparator<T>): this & OrderedSet<T>;
2107
+
2108
+ /**
2109
+ * Like `sort`, but also accepts a `comparatorValueMapper` which allows for
2110
+ * sorting by more sophisticated means:
2111
+ *
2112
+ * <!-- runkit:activate -->
2113
+ * ```js
2114
+ * const { Set } = require('immutable')
2115
+ * const beattles = Set([
2116
+ * { name: "Lennon" },
2117
+ * { name: "McCartney" },
2118
+ * { name: "Harrison" },
2119
+ * { name: "Starr" },
2120
+ * ]);
2121
+ * beattles.sortBy(member => member.name);
2122
+ * ```
2123
+ *
2124
+ * Note: `sortBy()` Always returns a new instance, even if the original was
2125
+ * already sorted.
2126
+ *
2127
+ * Note: This is always an eager operation.
2128
+ */
2129
+ sortBy<C>(
2130
+ comparatorValueMapper: (value: T, key: T, iter: this) => C,
2131
+ comparator?: (valueA: C, valueB: C) => number
2132
+ ): this & OrderedSet<T>;
2029
2133
  }
2030
2134
 
2031
2135
  /**
@@ -2056,7 +2160,6 @@ declare namespace Immutable {
2056
2160
  * the keys from this Collection or JavaScript Object.
2057
2161
  */
2058
2162
  function fromKeys<T>(iter: Collection.Keyed<T, unknown>): OrderedSet<T>;
2059
- // tslint:disable-next-line unified-signatures
2060
2163
  function fromKeys<T>(iter: Collection<T, unknown>): OrderedSet<T>;
2061
2164
  function fromKeys(obj: { [key: string]: unknown }): OrderedSet<string>;
2062
2165
  }
@@ -3589,34 +3692,6 @@ declare namespace Immutable {
3589
3692
  * `Collection.Indexed`, or `Collection.Set`.
3590
3693
  */
3591
3694
  namespace Collection {
3592
- /**
3593
- * @deprecated use `const { isKeyed } = require('immutable')`
3594
- */
3595
- function isKeyed(
3596
- maybeKeyed: unknown
3597
- ): maybeKeyed is Collection.Keyed<unknown, unknown>;
3598
-
3599
- /**
3600
- * @deprecated use `const { isIndexed } = require('immutable')`
3601
- */
3602
- function isIndexed(
3603
- maybeIndexed: unknown
3604
- ): maybeIndexed is Collection.Indexed<unknown>;
3605
-
3606
- /**
3607
- * @deprecated use `const { isAssociative } = require('immutable')`
3608
- */
3609
- function isAssociative(
3610
- maybeAssociative: unknown
3611
- ): maybeAssociative is
3612
- | Collection.Keyed<unknown, unknown>
3613
- | Collection.Indexed<unknown>;
3614
-
3615
- /**
3616
- * @deprecated use `const { isOrdered } = require('immutable')`
3617
- */
3618
- function isOrdered(maybeOrdered: unknown): boolean;
3619
-
3620
3695
  /**
3621
3696
  * Keyed Collections have discrete keys tied to each value.
3622
3697
  *
@@ -4325,7 +4400,8 @@ declare namespace Immutable {
4325
4400
  * In case the `Collection` is empty returns the optional default
4326
4401
  * value if provided, if no default value is provided returns undefined.
4327
4402
  */
4328
- first<NSV = undefined>(notSetValue?: NSV): V | NSV;
4403
+ first<NSV>(notSetValue: NSV): V | NSV;
4404
+ first(): V | undefined;
4329
4405
 
4330
4406
  /**
4331
4407
  * In case the `Collection` is not empty returns the last element of the
@@ -4333,7 +4409,8 @@ declare namespace Immutable {
4333
4409
  * In case the `Collection` is empty returns the optional default
4334
4410
  * value if provided, if no default value is provided returns undefined.
4335
4411
  */
4336
- last<NSV = undefined>(notSetValue?: NSV): V | NSV;
4412
+ last<NSV>(notSetValue: NSV): V | NSV;
4413
+ last(): V | undefined;
4337
4414
 
4338
4415
  // Reading deep values
4339
4416
 
@@ -4925,7 +5002,6 @@ declare namespace Immutable {
4925
5002
  * returns Collection<K, V>
4926
5003
  */
4927
5004
  flatten(depth?: number): Collection<unknown, unknown>;
4928
- // tslint:disable-next-line unified-signatures
4929
5005
  flatten(shallow?: boolean): Collection<unknown, unknown>;
4930
5006
 
4931
5007
  /**
package/dist/immutable.js CHANGED
@@ -144,11 +144,13 @@
144
144
  }
145
145
 
146
146
  var Collection = function Collection(value) {
147
+ // eslint-disable-next-line no-constructor-return
147
148
  return isCollection(value) ? value : Seq(value);
148
149
  };
149
150
 
150
151
  var KeyedCollection = /*@__PURE__*/(function (Collection) {
151
152
  function KeyedCollection(value) {
153
+ // eslint-disable-next-line no-constructor-return
152
154
  return isKeyed(value) ? value : KeyedSeq(value);
153
155
  }
154
156
 
@@ -161,6 +163,7 @@
161
163
 
162
164
  var IndexedCollection = /*@__PURE__*/(function (Collection) {
163
165
  function IndexedCollection(value) {
166
+ // eslint-disable-next-line no-constructor-return
164
167
  return isIndexed(value) ? value : IndexedSeq(value);
165
168
  }
166
169
 
@@ -173,6 +176,7 @@
173
176
 
174
177
  var SetCollection = /*@__PURE__*/(function (Collection) {
175
178
  function SetCollection(value) {
179
+ // eslint-disable-next-line no-constructor-return
176
180
  return isCollection(value) && !isAssociative(value) ? value : SetSeq(value);
177
181
  }
178
182
 
@@ -313,6 +317,7 @@
313
317
 
314
318
  var Seq = /*@__PURE__*/(function (Collection) {
315
319
  function Seq(value) {
320
+ // eslint-disable-next-line no-constructor-return
316
321
  return value === undefined || value === null
317
322
  ? emptySequence()
318
323
  : isImmutable(value)
@@ -381,6 +386,7 @@
381
386
 
382
387
  var KeyedSeq = /*@__PURE__*/(function (Seq) {
383
388
  function KeyedSeq(value) {
389
+ // eslint-disable-next-line no-constructor-return
384
390
  return value === undefined || value === null
385
391
  ? emptySequence().toKeyedSeq()
386
392
  : isCollection(value)
@@ -405,6 +411,7 @@
405
411
 
406
412
  var IndexedSeq = /*@__PURE__*/(function (Seq) {
407
413
  function IndexedSeq(value) {
414
+ // eslint-disable-next-line no-constructor-return
408
415
  return value === undefined || value === null
409
416
  ? emptySequence()
410
417
  : isCollection(value)
@@ -437,6 +444,7 @@
437
444
 
438
445
  var SetSeq = /*@__PURE__*/(function (Seq) {
439
446
  function SetSeq(value) {
447
+ // eslint-disable-next-line no-constructor-return
440
448
  return (
441
449
  isCollection(value) && !isAssociative(value) ? value : IndexedSeq(value)
442
450
  ).toSetSeq();
@@ -1438,16 +1446,16 @@
1438
1446
  return collection;
1439
1447
  }
1440
1448
 
1441
- var resolvedBegin = resolveBegin(begin, originalSize);
1442
- var resolvedEnd = resolveEnd(end, originalSize);
1443
-
1444
- // begin or end will be NaN if they were provided as negative numbers and
1449
+ // begin or end can not be resolved if they were provided as negative numbers and
1445
1450
  // this collection's size is unknown. In that case, cache first so there is
1446
1451
  // a known size and these do not resolve to NaN.
1447
- if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {
1452
+ if (typeof originalSize === 'undefined' && (begin < 0 || end < 0)) {
1448
1453
  return sliceFactory(collection.toSeq().cacheResult(), begin, end, useKeys);
1449
1454
  }
1450
1455
 
1456
+ var resolvedBegin = resolveBegin(begin, originalSize);
1457
+ var resolvedEnd = resolveEnd(end, originalSize);
1458
+
1451
1459
  // Note: resolvedEnd is undefined when the original sequence's length is
1452
1460
  // unknown and this slice did not supply an end and should contain all
1453
1461
  // elements after resolvedBegin.
@@ -2389,6 +2397,7 @@
2389
2397
 
2390
2398
  var Map = /*@__PURE__*/(function (KeyedCollection) {
2391
2399
  function Map(value) {
2400
+ // eslint-disable-next-line no-constructor-return
2392
2401
  return value === undefined || value === null
2393
2402
  ? emptyMap()
2394
2403
  : isMap(value) && !isOrdered(value)
@@ -2404,20 +2413,6 @@
2404
2413
  Map.prototype = Object.create( KeyedCollection && KeyedCollection.prototype );
2405
2414
  Map.prototype.constructor = Map;
2406
2415
 
2407
- Map.of = function of () {
2408
- var keyValues = [], len = arguments.length;
2409
- while ( len-- ) keyValues[ len ] = arguments[ len ];
2410
-
2411
- return emptyMap().withMutations(function (map) {
2412
- for (var i = 0; i < keyValues.length; i += 2) {
2413
- if (i + 1 >= keyValues.length) {
2414
- throw new Error('Missing value for key: ' + keyValues[i]);
2415
- }
2416
- map.set(keyValues[i], keyValues[i + 1]);
2417
- }
2418
- });
2419
- };
2420
-
2421
2416
  Map.prototype.toString = function toString () {
2422
2417
  return this.__toString('Map {', '}');
2423
2418
  };
@@ -2907,7 +2902,7 @@
2907
2902
  }
2908
2903
  };
2909
2904
 
2910
- // eslint-disable-next-line no-unused-vars
2905
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2911
2906
  ValueNode.prototype.iterate = function (fn, reverse) {
2912
2907
  return fn(this.entry);
2913
2908
  };
@@ -3181,20 +3176,25 @@
3181
3176
  function List(value) {
3182
3177
  var empty = emptyList();
3183
3178
  if (value === undefined || value === null) {
3179
+ // eslint-disable-next-line no-constructor-return
3184
3180
  return empty;
3185
3181
  }
3186
3182
  if (isList(value)) {
3183
+ // eslint-disable-next-line no-constructor-return
3187
3184
  return value;
3188
3185
  }
3189
3186
  var iter = IndexedCollection(value);
3190
3187
  var size = iter.size;
3191
3188
  if (size === 0) {
3189
+ // eslint-disable-next-line no-constructor-return
3192
3190
  return empty;
3193
3191
  }
3194
3192
  assertNotInfinite(size);
3195
3193
  if (size > 0 && size < SIZE) {
3194
+ // eslint-disable-next-line no-constructor-return
3196
3195
  return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));
3197
3196
  }
3197
+ // eslint-disable-next-line no-constructor-return
3198
3198
  return empty.withMutations(function (list) {
3199
3199
  list.setSize(size);
3200
3200
  iter.forEach(function (v, i) { return list.set(i, v); });
@@ -3560,9 +3560,8 @@
3560
3560
  return list;
3561
3561
  }
3562
3562
 
3563
- var EMPTY_LIST;
3564
3563
  function emptyList() {
3565
- return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));
3564
+ return makeList(0, 0, SHIFT);
3566
3565
  }
3567
3566
 
3568
3567
  function updateList(list, index, value) {
@@ -3830,6 +3829,7 @@
3830
3829
 
3831
3830
  var OrderedMap = /*@__PURE__*/(function (Map) {
3832
3831
  function OrderedMap(value) {
3832
+ // eslint-disable-next-line no-constructor-return
3833
3833
  return value === undefined || value === null
3834
3834
  ? emptyOrderedMap()
3835
3835
  : isOrderedMap(value)
@@ -3998,6 +3998,7 @@
3998
3998
 
3999
3999
  var Stack = /*@__PURE__*/(function (IndexedCollection) {
4000
4000
  function Stack(value) {
4001
+ // eslint-disable-next-line no-constructor-return
4001
4002
  return value === undefined || value === null
4002
4003
  ? emptyStack()
4003
4004
  : isStack(value)
@@ -4335,6 +4336,7 @@
4335
4336
 
4336
4337
  var Set = /*@__PURE__*/(function (SetCollection) {
4337
4338
  function Set(value) {
4339
+ // eslint-disable-next-line no-constructor-return
4338
4340
  return value === undefined || value === null
4339
4341
  ? emptySet()
4340
4342
  : isSet(value) && !isOrdered(value)
@@ -4584,6 +4586,7 @@
4584
4586
  if ( step === void 0 ) step = 1;
4585
4587
 
4586
4588
  if (!(this instanceof Range)) {
4589
+ // eslint-disable-next-line no-constructor-return
4587
4590
  return new Range(start, end, step);
4588
4591
  }
4589
4592
  invariant(step !== 0, 'Cannot step a Range by 0');
@@ -4606,8 +4609,10 @@
4606
4609
  this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);
4607
4610
  if (this.size === 0) {
4608
4611
  if (EMPTY_RANGE) {
4612
+ // eslint-disable-next-line no-constructor-return
4609
4613
  return EMPTY_RANGE;
4610
4614
  }
4615
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
4611
4616
  EMPTY_RANGE = this;
4612
4617
  }
4613
4618
  }
@@ -4751,13 +4756,6 @@
4751
4756
  return object;
4752
4757
  }
4753
4758
 
4754
- // Note: all of these methods are deprecated.
4755
- Collection.isIterable = isCollection;
4756
- Collection.isKeyed = isKeyed;
4757
- Collection.isIndexed = isIndexed;
4758
- Collection.isAssociative = isAssociative;
4759
- Collection.isOrdered = isOrdered;
4760
-
4761
4759
  Collection.Iterator = Iterator;
4762
4760
 
4763
4761
  mixin(Collection, {
@@ -4992,6 +4990,7 @@
4992
4990
  },
4993
4991
 
4994
4992
  entrySeq: function entrySeq() {
4993
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
4995
4994
  var collection = this;
4996
4995
  if (collection._cache) {
4997
4996
  // We cache as an entries array, so we can just return the cache!
@@ -5442,7 +5441,8 @@
5442
5441
  var ordered = isOrdered(collection);
5443
5442
  var keyed = isKeyed(collection);
5444
5443
  var h = ordered ? 1 : 0;
5445
- var size = collection.__iterate(
5444
+
5445
+ collection.__iterate(
5446
5446
  keyed
5447
5447
  ? ordered
5448
5448
  ? function (v, k) {
@@ -5459,7 +5459,8 @@
5459
5459
  h = (h + hash(v)) | 0;
5460
5460
  }
5461
5461
  );
5462
- return murmurHashOfSize(size, h);
5462
+
5463
+ return murmurHashOfSize(collection.size, h);
5463
5464
  }
5464
5465
 
5465
5466
  function murmurHashOfSize(size, h) {
@@ -5479,6 +5480,7 @@
5479
5480
 
5480
5481
  var OrderedSet = /*@__PURE__*/(function (Set) {
5481
5482
  function OrderedSet(value) {
5483
+ // eslint-disable-next-line no-constructor-return
5482
5484
  return value === undefined || value === null
5483
5485
  ? emptyOrderedSet()
5484
5486
  : isOrderedSet(value)
@@ -5622,6 +5624,7 @@
5622
5624
  RecordType.displayName = name;
5623
5625
  }
5624
5626
 
5627
+ // eslint-disable-next-line no-constructor-return
5625
5628
  return RecordType;
5626
5629
  };
5627
5630
 
@@ -5789,14 +5792,17 @@
5789
5792
  var Repeat = /*@__PURE__*/(function (IndexedSeq) {
5790
5793
  function Repeat(value, times) {
5791
5794
  if (!(this instanceof Repeat)) {
5795
+ // eslint-disable-next-line no-constructor-return
5792
5796
  return new Repeat(value, times);
5793
5797
  }
5794
5798
  this._value = value;
5795
5799
  this.size = times === undefined ? Infinity : Math.max(0, times);
5796
5800
  if (this.size === 0) {
5797
5801
  if (EMPTY_REPEAT) {
5802
+ // eslint-disable-next-line no-constructor-return
5798
5803
  return EMPTY_REPEAT;
5799
5804
  }
5805
+ // eslint-disable-next-line @typescript-eslint/no-this-alias
5800
5806
  EMPTY_REPEAT = this;
5801
5807
  }
5802
5808
  }
@@ -5873,7 +5879,7 @@
5873
5879
  Repeat.prototype.equals = function equals (other) {
5874
5880
  return other instanceof Repeat
5875
5881
  ? is(this._value, other._value)
5876
- : deepEqual(other);
5882
+ : deepEqual(this, other);
5877
5883
  };
5878
5884
 
5879
5885
  return Repeat;
@@ -5922,7 +5928,7 @@
5922
5928
  return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet();
5923
5929
  }
5924
5930
 
5925
- var version = "5.0.0-beta.5";
5931
+ var version = "5.0.0-rc.2";
5926
5932
 
5927
5933
  // Note: Iterable is deprecated
5928
5934
  var Iterable = Collection;
@@ -76,8 +76,10 @@ declare class _Collection<K, +V> implements ValueObject {
76
76
  has(key: K): boolean;
77
77
  includes(value: V): boolean;
78
78
  contains(value: V): boolean;
79
- first<NSV>(notSetValue?: NSV): V | NSV;
80
- last<NSV>(notSetValue?: NSV): V | NSV;
79
+ first(): V | void;
80
+ first<NSV>(notSetValue: NSV): V | NSV;
81
+ last(): V | void;
82
+ last<NSV>(notSetValue: NSV): V | NSV;
81
83
 
82
84
  hasIn(keyPath: Iterable<mixed>): boolean;
83
85
 
@@ -218,16 +220,16 @@ declare class _Collection<K, +V> implements ValueObject {
218
220
  context?: mixed
219
221
  ): Map<G, number>;
220
222
 
221
- find<NSV>(
223
+ find(
222
224
  predicate: (value: V, key: K, iter: this) => mixed,
223
225
  context?: mixed,
224
- notSetValue?: NSV
225
- ): V | NSV;
226
- findLast<NSV>(
226
+ notSetValue?: V
227
+ ): V | void;
228
+ findLast(
227
229
  predicate: (value: V, key: K, iter: this) => mixed,
228
230
  context?: mixed,
229
- notSetValue?: NSV
230
- ): V | NSV;
231
+ notSetValue?: V
232
+ ): V | void;
231
233
 
232
234
  findEntry(predicate: (value: V, key: K, iter: this) => mixed): [K, V] | void;
233
235
  findLastEntry(
@@ -22,4 +22,4 @@
22
22
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
23
  * SOFTWARE.
24
24
  */
25
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Immutable={})}(this,(function(t){"use strict";var e="delete",r=5,n=1<<r,i=n-1,o={};function u(t){t&&(t.value=!0)}function s(){}function a(t){return void 0===t.size&&(t.size=t.__iterate(f)),t.size}function c(t,e){if("number"!=typeof e){var r=e>>>0;if(""+r!==e||4294967295===r)return NaN;e=r}return e<0?a(t)+e:e}function f(){return!0}function h(t,e,r){return(0===t&&!v(t)||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&e>=r)}function p(t,e){return l(t,e,0)}function _(t,e){return l(t,e,e)}function l(t,e,r){return void 0===t?r:v(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function v(t){return t<0||0===t&&1/t==-1/0}var y="@@__IMMUTABLE_ITERABLE__@@";function d(t){return Boolean(t&&t[y])}var g="@@__IMMUTABLE_KEYED__@@";function w(t){return Boolean(t&&t[g])}var m="@@__IMMUTABLE_INDEXED__@@";function S(t){return Boolean(t&&t[m])}function z(t){return w(t)||S(t)}var b=function(t){return d(t)?t:X(t)},I=function(t){function e(t){return w(t)?t:F(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(b),O=function(t){function e(t){return S(t)?t:G(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(b),E=function(t){function e(t){return d(t)&&!z(t)?t:Z(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(b);b.Keyed=I,b.Indexed=O,b.Set=E;var q="@@__IMMUTABLE_SEQ__@@";function j(t){return Boolean(t&&t[q])}var M="@@__IMMUTABLE_RECORD__@@";function D(t){return Boolean(t&&t[M])}function x(t){return d(t)||D(t)}var A="@@__IMMUTABLE_ORDERED__@@";function k(t){return Boolean(t&&t[A])}var R=0,U=1,T=2,B="function"==typeof Symbol&&Symbol.iterator,K="@@iterator",L=B||K,C=function(t){this.next=t};function P(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function W(){return{value:void 0,done:!0}}function N(t){return!!Array.isArray(t)||!!V(t)}function H(t){return t&&"function"==typeof t.next}function J(t){var e=V(t);return e&&e.call(t)}function V(t){var e=t&&(B&&t[B]||t[K]);if("function"==typeof e)return e}C.prototype.toString=function(){return"[Iterator]"},C.KEYS=R,C.VALUES=U,C.ENTRIES=T,C.prototype.inspect=C.prototype.toSource=function(){return this.toString()},C.prototype[L]=function(){return this};var Y=Object.prototype.hasOwnProperty;function Q(t){return!(!Array.isArray(t)&&"string"!=typeof t)||t&&"object"==typeof t&&Number.isInteger(t.length)&&t.length>=0&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var X=function(t){function e(t){return null==t?nt():x(t)?t.toSeq():function(t){var e=ut(t);if(e)return(n=V(r=t))&&n===r.entries?e.fromEntrySeq():function(t){var e=V(t);return e&&e===t.keys}(t)?e.toSetSeq():e;var r,n;if("object"==typeof t)return new tt(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var r=this._cache;if(r){for(var n=r.length,i=0;i!==n;){var o=r[e?n-++i:i++];if(!1===t(o[1],o[0],this))break}return i}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var r=this._cache;if(r){var n=r.length,i=0;return new C((function(){if(i===n)return{value:void 0,done:!0};var o=r[e?n-++i:i++];return P(t,o[0],o[1])}))}return this.__iteratorUncached(t,e)},e}(b),F=function(t){function e(t){return null==t?nt().toKeyedSeq():d(t)?w(t)?t.toSeq():t.fromEntrySeq():D(t)?t.toSeq():it(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(X),G=function(t){function e(t){return null==t?nt():d(t)?w(t)?t.entrySeq():t.toIndexedSeq():D(t)?t.toSeq().entrySeq():ot(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(X),Z=function(t){function e(t){return(d(t)&&!z(t)?t:G(t)).toSetSeq()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(X);X.isSeq=j,X.Keyed=F,X.Set=Z,X.Indexed=G,X.prototype[q]=!0;var $=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this.has(t)?this._array[c(this,t)]:e},e.prototype.__iterate=function(t,e){for(var r=this._array,n=r.length,i=0;i!==n;){var o=e?n-++i:i++;if(!1===t(r[o],o,this))break}return i},e.prototype.__iterator=function(t,e){var r=this._array,n=r.length,i=0;return new C((function(){if(i===n)return{value:void 0,done:!0};var o=e?n-++i:i++;return P(t,o,r[o])}))},e}(G),tt=function(t){function e(t){var e=Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]);this._object=t,this._keys=e,this.size=e.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},e.prototype.has=function(t){return Y.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length,o=0;o!==i;){var u=n[e?i-++o:o++];if(!1===t(r[u],u,this))break}return o},e.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,i=n.length,o=0;return new C((function(){if(o===i)return{value:void 0,done:!0};var u=n[e?i-++o:o++];return P(t,u,r[u])}))},e}(F);tt.prototype[A]=!0;var et,rt=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=J(this._collection),n=0;if(H(r))for(var i;!(i=r.next()).done&&!1!==t(i.value,n++,this););return n},e.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=J(this._collection);if(!H(r))return new C(W);var n=0;return new C((function(){var e=r.next();return e.done?e:P(t,n++,e.value)}))},e}(G);function nt(){return et||(et=new $([]))}function it(t){var e=ut(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new tt(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function ot(t){var e=ut(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function ut(t){return Q(t)?new $(t):N(t)?new rt(t):void 0}var st="@@__IMMUTABLE_MAP__@@";function at(t){return Boolean(t&&t[st])}function ct(t){return at(t)&&k(t)}function ft(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function ht(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!!(ft(t)&&ft(e)&&t.equals(e))}var pt="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var r=65535&(t|=0),n=65535&(e|=0);return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0};function _t(t){return t>>>1&1073741824|3221225471&t}var lt=Object.prototype.valueOf;function vt(t){if(null==t)return yt(t);if("function"==typeof t.hashCode)return _t(t.hashCode(t));var e,r=(e=t).valueOf!==lt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return yt(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;e!==t&&(e^=4294967295*t);for(;t>4294967295;)e^=t/=4294967295;return _t(e)}(r);case"string":return r.length>Et?function(t){var e=Mt[t];void 0===e&&(e=dt(t),jt===qt&&(jt=0,Mt={}),jt++,Mt[t]=e);return e}(r):dt(r);case"object":case"function":return function(t){var e;if(zt&&void 0!==(e=St.get(t)))return e;if(e=t[Ot],void 0!==e)return e;if(!wt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Ot]))return e;if(void 0!==(e=function(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return e}if(e=mt(),zt)St.set(t,e);else{if(void 0!==gt&&!1===gt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(wt)Object.defineProperty(t,Ot,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[Ot]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Ot]=e}}return e}(r);case"symbol":return function(t){var e=bt[t];if(void 0!==e)return e;return e=mt(),bt[t]=e,e}(r);default:if("function"==typeof r.toString)return dt(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function yt(t){return null===t?1108378658:1108378659}function dt(t){for(var e=0,r=0;r<t.length;r++)e=31*e+t.charCodeAt(r)|0;return _t(e)}var gt=Object.isExtensible,wt=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}();function mt(){var t=++It;return 1073741824&It&&(It=0),t}var St,zt="function"==typeof WeakMap;zt&&(St=new WeakMap);var bt=Object.create(null),It=0,Ot="__immutablehash__";"function"==typeof Symbol&&(Ot=Symbol(Ot));var Et=16,qt=255,jt=0,Mt={},Dt=function(t){function e(t,e){this._iter=t,this._useKeys=e,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this._iter.get(t,e)},e.prototype.has=function(t){return this._iter.has(t)},e.prototype.valueSeq=function(){return this._iter.valueSeq()},e.prototype.reverse=function(){var t=this,e=Tt(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},e.prototype.map=function(t,e){var r=this,n=Ut(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate((function(e,n){return t(e,n,r)}),e)},e.prototype.__iterator=function(t,e){return this._iter.__iterator(t,e)},e}(F);Dt.prototype[A]=!0;var xt=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.includes=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(t,e){var r=this,n=0;return e&&a(this),this._iter.__iterate((function(i){return t(i,e?r.size-++n:n++,r)}),e)},e.prototype.__iterator=function(t,e){var r=this,n=this._iter.__iterator(U,e),i=0;return e&&a(this),new C((function(){var o=n.next();return o.done?o:P(t,e?r.size-++i:i++,o.value,o)}))},e}(G),At=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.has=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate((function(e){return t(e,e,r)}),e)},e.prototype.__iterator=function(t,e){var r=this._iter.__iterator(U,e);return new C((function(){var e=r.next();return e.done?e:P(t,e.value,e.value,e)}))},e}(Z),kt=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.entrySeq=function(){return this._iter.toSeq()},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate((function(e){if(e){Vt(e);var n=d(e);return t(n?e.get(1):e[1],n?e.get(0):e[0],r)}}),e)},e.prototype.__iterator=function(t,e){var r=this._iter.__iterator(U,e);return new C((function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n){Vt(n);var i=d(n);return P(t,i?n.get(0):n[0],i?n.get(1):n[1],e)}}}))},e}(F);function Rt(t){var e=Qt(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=Xt,e.__iterateUncached=function(e,r){var n=this;return t.__iterate((function(t,r){return!1!==e(r,t,n)}),r)},e.__iteratorUncached=function(e,r){if(e===T){var n=t.__iterator(e,r);return new C((function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t}))}return t.__iterator(e===U?R:U,r)},e}function Ut(t,e,r){var n=Qt(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var u=t.get(n,o);return u===o?i:e.call(r,u,n,t)},n.__iterateUncached=function(n,i){var o=this;return t.__iterate((function(t,i,u){return!1!==n(e.call(r,t,i,u),i,o)}),i)},n.__iteratorUncached=function(n,i){var o=t.__iterator(T,i);return new C((function(){var i=o.next();if(i.done)return i;var u=i.value,s=u[0];return P(n,s,e.call(r,u[1],s,t),i)}))},n}function Tt(t,e){var r=this,n=Qt(t);return n._iter=t,n.size=t.size,n.reverse=function(){return t},t.flip&&(n.flip=function(){var e=Rt(t);return e.reverse=function(){return t.flip()},e}),n.get=function(r,n){return t.get(e?r:-1-r,n)},n.has=function(r){return t.has(e?r:-1-r)},n.includes=function(e){return t.includes(e)},n.cacheResult=Xt,n.__iterate=function(r,n){var i=this,o=0;return n&&a(t),t.__iterate((function(t,u){return r(t,e?u:n?i.size-++o:o++,i)}),!n)},n.__iterator=function(n,i){var o=0;i&&a(t);var u=t.__iterator(T,!i);return new C((function(){var t=u.next();if(t.done)return t;var s=t.value;return P(n,e?s[0]:i?r.size-++o:o++,s[1],t)}))},n}function Bt(t,e,r,n){var i=Qt(t);return n&&(i.has=function(n){var i=t.get(n,o);return i!==o&&!!e.call(r,i,n,t)},i.get=function(n,i){var u=t.get(n,o);return u!==o&&e.call(r,u,n,t)?u:i}),i.__iterateUncached=function(i,o){var u=this,s=0;return t.__iterate((function(t,o,a){if(e.call(r,t,o,a))return s++,i(t,n?o:s-1,u)}),o),s},i.__iteratorUncached=function(i,o){var u=t.__iterator(T,o),s=0;return new C((function(){for(;;){var o=u.next();if(o.done)return o;var a=o.value,c=a[0],f=a[1];if(e.call(r,f,c,t))return P(i,n?c:s++,f,o)}}))},i}function Kt(t,e,r,n){var i=t.size;if(h(e,r,i))return t;var o=p(e,i),u=_(r,i);if(o!=o||u!=u)return Kt(t.toSeq().cacheResult(),e,r,n);var s,a=u-o;a==a&&(s=a<0?0:a);var f=Qt(t);return f.size=0===s?s:t.size&&s||void 0,!n&&j(t)&&s>=0&&(f.get=function(e,r){return(e=c(this,e))>=0&&e<s?t.get(e+o,r):r}),f.__iterateUncached=function(e,r){var i=this;if(0===s)return 0;if(r)return this.cacheResult().__iterate(e,r);var u=0,a=!0,c=0;return t.__iterate((function(t,r){if(!a||!(a=u++<o))return c++,!1!==e(t,n?r:c-1,i)&&c!==s})),c},f.__iteratorUncached=function(e,r){if(0!==s&&r)return this.cacheResult().__iterator(e,r);if(0===s)return new C(W);var i=t.__iterator(e,r),u=0,a=0;return new C((function(){for(;u++<o;)i.next();if(++a>s)return{value:void 0,done:!0};var t=i.next();return n||e===U||t.done?t:P(e,a-1,e===R?void 0:t.value[1],t)}))},f}function Lt(t,e,r,n){var i=Qt(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,a=0;return t.__iterate((function(t,o,c){if(!s||!(s=e.call(r,t,o,c)))return a++,i(t,n?o:a-1,u)})),a},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var s=t.__iterator(T,o),a=!0,c=0;return new C((function(){var t,o,f;do{if((t=s.next()).done)return n||i===U?t:P(i,c++,i===R?void 0:t.value[1],t);var h=t.value;o=h[0],f=h[1],a&&(a=e.call(r,f,o,u))}while(a);return i===T?t:P(i,o,f,t)}))},i}function Ct(t,e,r){var n=Qt(t);return n.__iterateUncached=function(i,o){if(o)return this.cacheResult().__iterate(i,o);var u=0,s=!1;return function t(a,c){a.__iterate((function(o,a){return(!e||c<e)&&d(o)?t(o,c+1):(u++,!1===i(o,r?a:u-1,n)&&(s=!0)),!s}),o)}(t,0),u},n.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var o=t.__iterator(n,i),u=[],s=0;return new C((function(){for(;o;){var t=o.next();if(!1===t.done){var a=t.value;if(n===T&&(a=a[1]),e&&!(u.length<e)||!d(a))return r?t:P(n,s++,a,t);u.push(o),o=a.__iterator(n,i)}else o=u.pop()}return{value:void 0,done:!0}}))},n}function Pt(t,e,r){e||(e=Ft);var n=w(t),i=0,o=t.toSeq().map((function(e,n){return[n,e,i++,r?r(e,n,t):e]})).valueSeq().toArray();return o.sort((function(t,r){return e(t[3],r[3])||t[2]-r[2]})).forEach(n?function(t,e){o[e].length=2}:function(t,e){o[e]=t[1]}),n?F(o):S(t)?G(o):Z(o)}function Wt(t,e,r){if(e||(e=Ft),r){var n=t.toSeq().map((function(e,n){return[e,r(e,n,t)]})).reduce((function(t,r){return Nt(e,t[1],r[1])?r:t}));return n&&n[0]}return t.reduce((function(t,r){return Nt(e,t,r)?r:t}))}function Nt(t,e,r){var n=t(r,e);return 0===n&&r!==e&&(null==r||r!=r)||n>0}function Ht(t,e,r,n){var i=Qt(t),o=new $(r).map((function(t){return t.size}));return i.size=n?o.max():o.min(),i.__iterate=function(t,e){for(var r,n=this.__iterator(U,e),i=0;!(r=n.next()).done&&!1!==t(r.value,i++,this););return i},i.__iteratorUncached=function(t,i){var o=r.map((function(t){return t=b(t),J(i?t.reverse():t)})),u=0,s=!1;return new C((function(){var r;return s||(r=o.map((function(t){return t.next()})),s=n?r.every((function(t){return t.done})):r.some((function(t){return t.done}))),s?{value:void 0,done:!0}:P(t,u++,e.apply(null,r.map((function(t){return t.value}))))}))},i}function Jt(t,e){return t===e?t:j(t)?e:t.constructor(e)}function Vt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Yt(t){return w(t)?I:S(t)?O:E}function Qt(t){return Object.create((w(t)?F:S(t)?G:Z).prototype)}function Xt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):X.prototype.cacheResult.call(this)}function Ft(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:t>e?1:t<e?-1:0}function Gt(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=new Array(r),i=0;i<r;i++)n[i]=t[i+e];return n}function Zt(t,e){if(!t)throw new Error(e)}function $t(t){Zt(t!==1/0,"Cannot perform this action with an infinite size.")}function te(t){if(Q(t)&&"string"!=typeof t)return t;if(k(t))return t.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+t)}xt.prototype.cacheResult=Dt.prototype.cacheResult=At.prototype.cacheResult=kt.prototype.cacheResult=Xt;var ee=Object.prototype.toString;function re(t){if(!t||"object"!=typeof t||"[object Object]"!==ee.call(t))return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var r=e,n=Object.getPrototypeOf(e);null!==n;)r=n,n=Object.getPrototypeOf(r);return r===e}function ne(t){return"object"==typeof t&&(x(t)||Array.isArray(t)||re(t))}function ie(t){try{return"string"==typeof t?JSON.stringify(t):String(t)}catch(e){return JSON.stringify(t)}}function oe(t,e){return x(t)?t.has(e):ne(t)&&Y.call(t,e)}function ue(t,e,r){return x(t)?t.get(e,r):oe(t,e)?"function"==typeof t.get?t.get(e):t[e]:r}function se(t){if(Array.isArray(t))return Gt(t);var e={};for(var r in t)Y.call(t,r)&&(e[r]=t[r]);return e}function ae(t,e){if(!ne(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(x(t)){if(!t.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+t);return t.remove(e)}if(!Y.call(t,e))return t;var r=se(t);return Array.isArray(r)?r.splice(e,1):delete r[e],r}function ce(t,e,r){if(!ne(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(x(t)){if(!t.set)throw new TypeError("Cannot update immutable value without .set() method: "+t);return t.set(e,r)}if(Y.call(t,e)&&r===t[e])return t;var n=se(t);return n[e]=r,n}function fe(t,e,r,n){n||(n=r,r=void 0);var i=he(x(t),t,te(e),0,r,n);return i===o?r:i}function he(t,e,r,n,i,u){var s=e===o;if(n===r.length){var a=s?i:e,c=u(a);return c===a?e:c}if(!s&&!ne(e))throw new TypeError("Cannot update within non-data-structure value in path ["+r.slice(0,n).map(ie)+"]: "+e);var f=r[n],h=s?o:ue(e,f,o),p=he(h===o?t:x(h),h,r,n+1,i,u);return p===h?e:p===o?ae(e,f):ce(s?t?He():{}:e,f,p)}function pe(t,e,r){return fe(t,e,o,(function(){return r}))}function _e(t,e){return pe(this,t,e)}function le(t,e){return fe(t,e,(function(){return o}))}function ve(t){return le(this,t)}function ye(t,e,r,n){return fe(t,[e],r,n)}function de(t,e,r){return 1===arguments.length?t(this):ye(this,t,e,r)}function ge(t,e,r){return fe(this,t,e,r)}function we(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Se(this,t)}function me(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return Se(this,e,t)}function Se(t,e,r){for(var n=[],i=0;i<e.length;i++){var u=I(e[i]);0!==u.size&&n.push(u)}return 0===n.length?t:0!==t.toSeq().size||t.__ownerID||1!==n.length?t.withMutations((function(t){for(var e=r?function(e,n){ye(t,n,o,(function(t){return t===o?e:r(t,e,n)}))}:function(e,r){t.set(r,e)},i=0;i<n.length;i++)n[i].forEach(e)})):t.constructor(n[0])}function ze(t,e,r){return be(t,e,function(t){function e(r,n,i){return ne(r)&&ne(n)&&(o=n,u=X(r),s=X(o),S(u)===S(s)&&w(u)===w(s))?be(r,[n],e):t?t(r,n,i):n;var o,u,s}return e}(r))}function be(t,e,r){if(!ne(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(x(t))return"function"==typeof r&&t.mergeWith?t.mergeWith.apply(t,[r].concat(e)):t.merge?t.merge.apply(t,e):t.concat.apply(t,e);for(var n=Array.isArray(t),i=t,o=n?O:I,u=n?function(e){i===t&&(i=se(i)),i.push(e)}:function(e,n){var o=Y.call(i,n),u=o&&r?r(i[n],e,n):e;o&&u===i[n]||(i===t&&(i=se(i)),i[n]=u)},s=0;s<e.length;s++)o(e[s]).forEach(u);return i}function Ie(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return ze(this,t)}function Oe(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return ze(this,e,t)}function Ee(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return fe(this,t,He(),(function(t){return be(t,e)}))}function qe(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return fe(this,t,He(),(function(t){return ze(t,e)}))}function je(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function Me(){return this.__ownerID?this:this.__ensureOwner(new s)}function De(){return this.__ensureOwner()}function xe(){return this.__altered}var Ae=function(t){function e(e){return null==e?He():at(e)&&!k(e)?e:He().withMutations((function(r){var n=t(e);$t(n.size),n.forEach((function(t,e){return r.set(e,t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return He().withMutations((function(e){for(var r=0;r<t.length;r+=2){if(r+1>=t.length)throw new Error("Missing value for key: "+t[r]);e.set(t[r],t[r+1])}}))},e.prototype.toString=function(){return this.__toString("Map {","}")},e.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},e.prototype.set=function(t,e){return Je(this,t,e)},e.prototype.remove=function(t){return Je(this,t,o)},e.prototype.deleteAll=function(t){var e=b(t);return 0===e.size?this:this.withMutations((function(t){e.forEach((function(e){return t.remove(e)}))}))},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):He()},e.prototype.sort=function(t){return yr(Pt(this,t))},e.prototype.sortBy=function(t,e){return yr(Pt(this,e,t))},e.prototype.map=function(t,e){var r=this;return this.withMutations((function(n){n.forEach((function(i,o){n.set(o,t.call(e,i,o,r))}))}))},e.prototype.__iterator=function(t,e){return new Ce(this,t,e)},e.prototype.__iterate=function(t,e){var r=this,n=0;return this._root&&this._root.iterate((function(e){return n++,t(e[1],e[0],r)}),e),n},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ne(this.size,this._root,t,this.__hash):0===this.size?He():(this.__ownerID=t,this.__altered=!1,this)},e}(I);Ae.isMap=at;var ke=Ae.prototype;ke[st]=!0,ke[e]=ke.remove,ke.removeAll=ke.deleteAll,ke.setIn=_e,ke.removeIn=ke.deleteIn=ve,ke.update=de,ke.updateIn=ge,ke.merge=ke.concat=we,ke.mergeWith=me,ke.mergeDeep=Ie,ke.mergeDeepWith=Oe,ke.mergeIn=Ee,ke.mergeDeepIn=qe,ke.withMutations=je,ke.wasAltered=xe,ke.asImmutable=De,ke["@@transducer/init"]=ke.asMutable=Me,ke["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},ke["@@transducer/result"]=function(t){return t.asImmutable()};var Re=function(t,e){this.ownerID=t,this.entries=e};Re.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(ht(r,i[o][0]))return i[o][1];return n},Re.prototype.update=function(t,e,r,n,i,a,c){for(var f=i===o,h=this.entries,p=0,_=h.length;p<_&&!ht(n,h[p][0]);p++);var l=p<_;if(l?h[p][1]===i:f)return this;if(u(c),(f||!l)&&u(a),!f||1!==h.length){if(!l&&!f&&h.length>=Ge)return function(t,e,r,n){t||(t=new s);for(var i=new Ke(t,vt(r),[r,n]),o=0;o<e.length;o++){var u=e[o];i=i.update(t,0,void 0,u[0],u[1])}return i}(t,h,n,i);var v=t&&t===this.ownerID,y=v?h:Gt(h);return l?f?p===_-1?y.pop():y[p]=y.pop():y[p]=[n,i]:y.push([n,i]),v?(this.entries=y,this):new Re(t,y)}};var Ue=function(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r};Ue.prototype.get=function(t,e,n,o){void 0===e&&(e=vt(n));var u=1<<((0===t?e:e>>>t)&i),s=this.bitmap;return 0==(s&u)?o:this.nodes[Xe(s&u-1)].get(t+r,e,n,o)},Ue.prototype.update=function(t,e,u,s,a,c,f){void 0===u&&(u=vt(s));var h=(0===e?u:u>>>e)&i,p=1<<h,_=this.bitmap,l=0!=(_&p);if(!l&&a===o)return this;var v=Xe(_&p-1),y=this.nodes,d=l?y[v]:void 0,g=Ve(d,t,e+r,u,s,a,c,f);if(g===d)return this;if(!l&&g&&y.length>=Ze)return function(t,e,r,i,o){for(var u=0,s=new Array(n),a=0;0!==r;a++,r>>>=1)s[a]=1&r?e[u++]:void 0;return s[i]=o,new Te(t,u+1,s)}(t,y,_,h,g);if(l&&!g&&2===y.length&&Ye(y[1^v]))return y[1^v];if(l&&g&&1===y.length&&Ye(g))return g;var w=t&&t===this.ownerID,m=l?g?_:_^p:_|p,S=l?g?Fe(y,v,g,w):function(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=new Array(n),o=0,u=0;u<n;u++)u===e&&(o=1),i[u]=t[u+o];return i}(y,v,w):function(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var o=new Array(i),u=0,s=0;s<i;s++)s===e?(o[s]=r,u=-1):o[s]=t[s+u];return o}(y,v,g,w);return w?(this.bitmap=m,this.nodes=S,this):new Ue(t,m,S)};var Te=function(t,e,r){this.ownerID=t,this.count=e,this.nodes=r};Te.prototype.get=function(t,e,n,o){void 0===e&&(e=vt(n));var u=(0===t?e:e>>>t)&i,s=this.nodes[u];return s?s.get(t+r,e,n,o):o},Te.prototype.update=function(t,e,n,u,s,a,c){void 0===n&&(n=vt(u));var f=(0===e?n:n>>>e)&i,h=s===o,p=this.nodes,_=p[f];if(h&&!_)return this;var l=Ve(_,t,e+r,n,u,s,a,c);if(l===_)return this;var v=this.count;if(_){if(!l&&--v<$e)return function(t,e,r,n){for(var i=0,o=0,u=new Array(r),s=0,a=1,c=e.length;s<c;s++,a<<=1){var f=e[s];void 0!==f&&s!==n&&(i|=a,u[o++]=f)}return new Ue(t,i,u)}(t,p,v,f)}else v++;var y=t&&t===this.ownerID,d=Fe(p,f,l,y);return y?(this.count=v,this.nodes=d,this):new Te(t,v,d)};var Be=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r};Be.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(ht(r,i[o][0]))return i[o][1];return n},Be.prototype.update=function(t,e,r,n,i,s,a){void 0===r&&(r=vt(n));var c=i===o;if(r!==this.keyHash)return c?this:(u(a),u(s),Qe(this,t,e,r,[n,i]));for(var f=this.entries,h=0,p=f.length;h<p&&!ht(n,f[h][0]);h++);var _=h<p;if(_?f[h][1]===i:c)return this;if(u(a),(c||!_)&&u(s),c&&2===p)return new Ke(t,this.keyHash,f[1^h]);var l=t&&t===this.ownerID,v=l?f:Gt(f);return _?c?h===p-1?v.pop():v[h]=v.pop():v[h]=[n,i]:v.push([n,i]),l?(this.entries=v,this):new Be(t,this.keyHash,v)};var Ke=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r};Ke.prototype.get=function(t,e,r,n){return ht(r,this.entry[0])?this.entry[1]:n},Ke.prototype.update=function(t,e,r,n,i,s,a){var c=i===o,f=ht(n,this.entry[0]);return(f?i===this.entry[1]:c)?this:(u(a),c?void u(s):f?t&&t===this.ownerID?(this.entry[1]=i,this):new Ke(t,this.keyHash,[n,i]):(u(s),Qe(this,t,e,vt(n),[n,i])))},Re.prototype.iterate=Be.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;n<=i;n++)if(!1===t(r[e?i-n:n]))return!1},Ue.prototype.iterate=Te.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;n<=i;n++){var o=r[e?i-n:n];if(o&&!1===o.iterate(t,e))return!1}},Ke.prototype.iterate=function(t,e){return t(this.entry)};var Le,Ce=function(t){function e(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&We(t._root)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var r=e.node,n=e.index++,i=void 0;if(r.entry){if(0===n)return Pe(t,r.entry)}else if(r.entries){if(n<=(i=r.entries.length-1))return Pe(t,r.entries[this._reverse?i-n:n])}else if(n<=(i=r.nodes.length-1)){var o=r.nodes[this._reverse?i-n:n];if(o){if(o.entry)return Pe(t,o.entry);e=this._stack=We(o,e)}continue}e=this._stack=this._stack.__prev}return{value:void 0,done:!0}},e}(C);function Pe(t,e){return P(t,e[0],e[1])}function We(t,e){return{node:t,index:0,__prev:e}}function Ne(t,e,r,n){var i=Object.create(ke);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function He(){return Le||(Le=Ne(0))}function Je(t,e,r){var n,i;if(t._root){var u={value:!1},s={value:!1};if(n=Ve(t._root,t.__ownerID,0,void 0,e,r,u,s),!s.value)return t;i=t.size+(u.value?r===o?-1:1:0)}else{if(r===o)return t;i=1,n=new Re(t.__ownerID,[[e,r]])}return t.__ownerID?(t.size=i,t._root=n,t.__hash=void 0,t.__altered=!0,t):n?Ne(i,n):He()}function Ve(t,e,r,n,i,s,a,c){return t?t.update(e,r,n,i,s,a,c):s===o?t:(u(c),u(a),new Ke(e,n,[i,s]))}function Ye(t){return t.constructor===Ke||t.constructor===Be}function Qe(t,e,n,o,u){if(t.keyHash===o)return new Be(e,o,[t.entry,u]);var s,a=(0===n?t.keyHash:t.keyHash>>>n)&i,c=(0===n?o:o>>>n)&i,f=a===c?[Qe(t,e,n+r,o,u)]:(s=new Ke(e,o,u),a<c?[t,s]:[s,t]);return new Ue(e,1<<a|1<<c,f)}function Xe(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function Fe(t,e,r,n){var i=n?t:Gt(t);return i[e]=r,i}var Ge=n/4,Ze=n/2,$e=n/4,tr="@@__IMMUTABLE_LIST__@@";function er(t){return Boolean(t&&t[tr])}var rr=function(t){function e(e){var i=cr();if(null==e)return i;if(er(e))return e;var o=t(e),u=o.size;return 0===u?i:($t(u),u>0&&u<n?ar(0,u,r,null,new ir(o.toArray())):i.withMutations((function(t){t.setSize(u),o.forEach((function(e,r){return t.set(r,e)}))})))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("List [","]")},e.prototype.get=function(t,e){if((t=c(this,t))>=0&&t<this.size){var r=pr(this,t+=this._origin);return r&&r.array[t&i]}return e},e.prototype.set=function(t,e){return function(t,e,r){if(e=c(t,e),e!=e)return t;if(e>=t.size||e<0)return t.withMutations((function(t){e<0?_r(t,e).set(0,r):_r(t,0,e+1).set(e,r)}));e+=t._origin;var n=t._tail,i=t._root,o={value:!1};e>=lr(t._capacity)?n=fr(n,t.__ownerID,0,e,r,o):i=fr(i,t.__ownerID,t._level,e,r,o);if(!o.value)return t;if(t.__ownerID)return t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t;return ar(t._origin,t._capacity,t._level,i,n)}(this,t,e)},e.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,e){return this.splice(t,0,e)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=r,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):cr()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(r){_r(r,0,e+t.length);for(var n=0;n<t.length;n++)r.set(e+n,t[n])}))},e.prototype.pop=function(){return _r(this,0,-1)},e.prototype.unshift=function(){var t=arguments;return this.withMutations((function(e){_r(e,-t.length);for(var r=0;r<t.length;r++)e.set(r,t[r])}))},e.prototype.shift=function(){return _r(this,1)},e.prototype.concat=function(){for(var e=arguments,r=[],n=0;n<arguments.length;n++){var i=e[n],o=t("string"!=typeof i&&N(i)?i:[i]);0!==o.size&&r.push(o)}return 0===r.length?this:0!==this.size||this.__ownerID||1!==r.length?this.withMutations((function(t){r.forEach((function(e){return e.forEach((function(e){return t.push(e)}))}))})):this.constructor(r[0])},e.prototype.setSize=function(t){return _r(this,0,t)},e.prototype.map=function(t,e){var r=this;return this.withMutations((function(n){for(var i=0;i<r.size;i++)n.set(i,t.call(e,n.get(i),i,r))}))},e.prototype.slice=function(t,e){var r=this.size;return h(t,e,r)?this:_r(this,p(t,r),_(e,r))},e.prototype.__iterator=function(t,e){var r=e?this.size:0,n=sr(this,e);return new C((function(){var i=n();return i===ur?{value:void 0,done:!0}:P(t,e?--r:r++,i)}))},e.prototype.__iterate=function(t,e){for(var r,n=e?this.size:0,i=sr(this,e);(r=i())!==ur&&!1!==t(r,e?--n:n++,this););return n},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?ar(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):0===this.size?cr():(this.__ownerID=t,this.__altered=!1,this)},e}(O);rr.isList=er;var nr=rr.prototype;nr[tr]=!0,nr[e]=nr.remove,nr.merge=nr.concat,nr.setIn=_e,nr.deleteIn=nr.removeIn=ve,nr.update=de,nr.updateIn=ge,nr.mergeIn=Ee,nr.mergeDeepIn=qe,nr.withMutations=je,nr.wasAltered=xe,nr.asImmutable=De,nr["@@transducer/init"]=nr.asMutable=Me,nr["@@transducer/step"]=function(t,e){return t.push(e)},nr["@@transducer/result"]=function(t){return t.asImmutable()};var ir=function(t,e){this.array=t,this.ownerID=e};ir.prototype.removeBefore=function(t,e,n){if(n===e?1<<e:0===this.array.length)return this;var o=n>>>e&i;if(o>=this.array.length)return new ir([],t);var u,s=0===o;if(e>0){var a=this.array[o];if((u=a&&a.removeBefore(t,e-r,n))===a&&s)return this}if(s&&!u)return this;var c=hr(this,t);if(!s)for(var f=0;f<o;f++)c.array[f]=void 0;return u&&(c.array[o]=u),c},ir.prototype.removeAfter=function(t,e,n){if(n===(e?1<<e:0)||0===this.array.length)return this;var o,u=n-1>>>e&i;if(u>=this.array.length)return this;if(e>0){var s=this.array[u];if((o=s&&s.removeAfter(t,e-r,n))===s&&u===this.array.length-1)return this}var a=hr(this,t);return a.array.splice(u+1),o&&(a.array[u]=o),a};var or,ur={};function sr(t,e){var i=t._origin,o=t._capacity,u=lr(o),s=t._tail;return a(t._root,t._level,0);function a(t,c,f){return 0===c?function(t,r){var a=r===u?s&&s.array:t&&t.array,c=r>i?0:i-r,f=o-r;f>n&&(f=n);return function(){if(c===f)return ur;var t=e?--f:c++;return a&&a[t]}}(t,f):function(t,u,s){var c,f=t&&t.array,h=s>i?0:i-s>>u,p=1+(o-s>>u);p>n&&(p=n);return function(){for(;;){if(c){var t=c();if(t!==ur)return t;c=null}if(h===p)return ur;var n=e?--p:h++;c=a(f&&f[n],u-r,s+(n<<u))}}}(t,c,f)}}function ar(t,e,r,n,i,o,u){var s=Object.create(nr);return s.size=e-t,s._origin=t,s._capacity=e,s._level=r,s._root=n,s._tail=i,s.__ownerID=o,s.__hash=u,s.__altered=!1,s}function cr(){return or||(or=ar(0,0,r))}function fr(t,e,n,o,s,a){var c,f=o>>>n&i,h=t&&f<t.array.length;if(!h&&void 0===s)return t;if(n>0){var p=t&&t.array[f],_=fr(p,e,n-r,o,s,a);return _===p?t:((c=hr(t,e)).array[f]=_,c)}return h&&t.array[f]===s?t:(a&&u(a),c=hr(t,e),void 0===s&&f===c.array.length-1?c.array.pop():c.array[f]=s,c)}function hr(t,e){return e&&t&&e===t.ownerID?t:new ir(t?t.array.slice():[],e)}function pr(t,e){if(e>=lr(t._capacity))return t._tail;if(e<1<<t._level+r){for(var n=t._root,o=t._level;n&&o>0;)n=n.array[e>>>o&i],o-=r;return n}}function _r(t,e,n){void 0!==e&&(e|=0),void 0!==n&&(n|=0);var o=t.__ownerID||new s,u=t._origin,a=t._capacity,c=u+e,f=void 0===n?a:n<0?a+n:u+n;if(c===u&&f===a)return t;if(c>=f)return t.clear();for(var h=t._level,p=t._root,_=0;c+_<0;)p=new ir(p&&p.array.length?[void 0,p]:[],o),_+=1<<(h+=r);_&&(c+=_,u+=_,f+=_,a+=_);for(var l=lr(a),v=lr(f);v>=1<<h+r;)p=new ir(p&&p.array.length?[p]:[],o),h+=r;var y=t._tail,d=v<l?pr(t,f-1):v>l?new ir([],o):y;if(y&&v>l&&c<a&&y.array.length){for(var g=p=hr(p,o),w=h;w>r;w-=r){var m=l>>>w&i;g=g.array[m]=hr(g.array[m],o)}g.array[l>>>r&i]=y}if(f<a&&(d=d&&d.removeAfter(o,0,f)),c>=v)c-=v,f-=v,h=r,p=null,d=d&&d.removeBefore(o,0,c);else if(c>u||v<l){for(_=0;p;){var S=c>>>h&i;if(S!==v>>>h&i)break;S&&(_+=(1<<h)*S),h-=r,p=p.array[S]}p&&c>u&&(p=p.removeBefore(o,h,c-_)),p&&v<l&&(p=p.removeAfter(o,h,v-_)),_&&(c-=_,f-=_)}return t.__ownerID?(t.size=f-c,t._origin=c,t._capacity=f,t._level=h,t._root=p,t._tail=d,t.__hash=void 0,t.__altered=!0,t):ar(c,f,h,p,d)}function lr(t){return t<n?0:t-1>>>r<<r}var vr,yr=function(t){function e(t){return null==t?gr():ct(t)?t:gr().withMutations((function(e){var r=I(t);$t(r.size),r.forEach((function(t,r){return e.set(r,t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("OrderedMap {","}")},e.prototype.get=function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):gr()},e.prototype.set=function(t,e){return wr(this,t,e)},e.prototype.remove=function(t){return wr(this,t,o)},e.prototype.__iterate=function(t,e){var r=this;return this._list.__iterate((function(e){return e&&t(e[1],e[0],r)}),e)},e.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?dr(e,r,t,this.__hash):0===this.size?gr():(this.__ownerID=t,this.__altered=!1,this._map=e,this._list=r,this)},e}(Ae);function dr(t,e,r,n){var i=Object.create(yr.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function gr(){return vr||(vr=dr(He(),cr()))}function wr(t,e,r){var i,u,s=t._map,a=t._list,c=s.get(e),f=void 0!==c;if(r===o){if(!f)return t;a.size>=n&&a.size>=2*s.size?(i=(u=a.filter((function(t,e){return void 0!==t&&c!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(i.__ownerID=u.__ownerID=t.__ownerID)):(i=s.remove(e),u=c===a.size-1?a.pop():a.set(c,void 0))}else if(f){if(r===a.get(c)[1])return t;i=s,u=a.set(c,[e,r])}else i=s.set(e,a.size),u=a.set(a.size,[e,r]);return t.__ownerID?(t.size=i.size,t._map=i,t._list=u,t.__hash=void 0,t.__altered=!0,t):dr(i,u)}yr.isOrderedMap=ct,yr.prototype[A]=!0,yr.prototype[e]=yr.prototype.remove;var mr="@@__IMMUTABLE_STACK__@@";function Sr(t){return Boolean(t&&t[mr])}var zr=function(t){function e(t){return null==t?Er():Sr(t)?t:Er().pushAll(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(t,e){var r=this._head;for(t=c(this,t);r&&t--;)r=r.next;return r?r.value:e},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,r=this._head,n=arguments.length-1;n>=0;n--)r={value:t[n],next:r};return this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):Or(e,r)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&Sr(e))return e;$t(e.size);var r=this.size,n=this._head;return e.__iterate((function(t){r++,n={value:t,next:n}}),!0),this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):Or(r,n)},e.prototype.pop=function(){return this.slice(1)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Er()},e.prototype.slice=function(e,r){if(h(e,r,this.size))return this;var n=p(e,this.size);if(_(r,this.size)!==this.size)return t.prototype.slice.call(this,e,r);for(var i=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):Or(i,o)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Or(this.size,this._head,t,this.__hash):0===this.size?Er():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var r=this;if(e)return new $(this.toArray()).__iterate((function(e,n){return t(e,n,r)}),e);for(var n=0,i=this._head;i&&!1!==t(i.value,n++,this);)i=i.next;return n},e.prototype.__iterator=function(t,e){if(e)return new $(this.toArray()).__iterator(t,e);var r=0,n=this._head;return new C((function(){if(n){var e=n.value;return n=n.next,P(t,r++,e)}return{value:void 0,done:!0}}))},e}(O);zr.isStack=Sr;var br,Ir=zr.prototype;function Or(t,e,r,n){var i=Object.create(Ir);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Er(){return br||(br=Or(0))}Ir[mr]=!0,Ir.shift=Ir.pop,Ir.unshift=Ir.push,Ir.unshiftAll=Ir.pushAll,Ir.withMutations=je,Ir.wasAltered=xe,Ir.asImmutable=De,Ir["@@transducer/init"]=Ir.asMutable=Me,Ir["@@transducer/step"]=function(t,e){return t.unshift(e)},Ir["@@transducer/result"]=function(t){return t.asImmutable()};var qr="@@__IMMUTABLE_SET__@@";function jr(t){return Boolean(t&&t[qr])}function Mr(t){return jr(t)&&k(t)}function Dr(t,e){if(t===e)return!0;if(!d(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||w(t)!==w(e)||S(t)!==S(e)||k(t)!==k(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!z(t);if(k(t)){var n=t.entries();return e.every((function(t,e){var i=n.next().value;return i&&ht(i[1],t)&&(r||ht(i[0],e))}))&&n.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var u=t;t=e,e=u}var s=!0,a=e.__iterate((function(e,n){if(r?!t.has(e):i?!ht(e,t.get(n,o)):!ht(t.get(n,o),e))return s=!1,!1}));return s&&t.size===a}function xr(t,e){var r=function(r){t.prototype[r]=e[r]};return Object.keys(e).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r),t}function Ar(t){if(!t||"object"!=typeof t)return t;if(!d(t)){if(!ne(t))return t;t=X(t)}if(w(t)){var e={};return t.__iterate((function(t,r){e[r]=Ar(t)})),e}var r=[];return t.__iterate((function(t){r.push(Ar(t))})),r}var kr=function(t){function e(e){return null==e?Kr():jr(e)&&!k(e)?e:Kr().withMutations((function(r){var n=t(e);$t(n.size),n.forEach((function(t){return r.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(I(t).keySeq())},e.intersect=function(t){return(t=b(t).toArray()).length?Ur.intersect.apply(e(t.pop()),t):Kr()},e.union=function(t){return(t=b(t).toArray()).length?Ur.union.apply(e(t.pop()),t):Kr()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Tr(this,this._map.set(t,t))},e.prototype.remove=function(t){return Tr(this,this._map.remove(t))},e.prototype.clear=function(){return Tr(this,this._map.clear())},e.prototype.map=function(t,e){var r=this,n=!1,i=Tr(this,this._map.mapEntries((function(i){var o=i[1],u=t.call(e,o,o,r);return u!==o&&(n=!0),[u,u]}),e));return n?i:this},e.prototype.union=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return 0===(e=e.filter((function(t){return 0!==t.size}))).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations((function(r){for(var n=0;n<e.length;n++)"string"==typeof e[n]?r.add(e[n]):t(e[n]).forEach((function(t){return r.add(t)}))})):this.constructor(e[0])},e.prototype.intersect=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(0===e.length)return this;e=e.map((function(e){return t(e)}));var n=[];return this.forEach((function(t){e.every((function(e){return e.includes(t)}))||n.push(t)})),this.withMutations((function(t){n.forEach((function(e){t.remove(e)}))}))},e.prototype.subtract=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(0===e.length)return this;e=e.map((function(e){return t(e)}));var n=[];return this.forEach((function(t){e.some((function(e){return e.includes(t)}))&&n.push(t)})),this.withMutations((function(t){n.forEach((function(e){t.remove(e)}))}))},e.prototype.sort=function(t){return nn(Pt(this,t))},e.prototype.sortBy=function(t,e){return nn(Pt(this,e,t))},e.prototype.wasAltered=function(){return this._map.wasAltered()},e.prototype.__iterate=function(t,e){var r=this;return this._map.__iterate((function(e){return t(e,e,r)}),e)},e.prototype.__iterator=function(t,e){return this._map.__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):0===this.size?this.__empty():(this.__ownerID=t,this._map=e,this)},e}(E);kr.isSet=jr;var Rr,Ur=kr.prototype;function Tr(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Br(t,e){var r=Object.create(Ur);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Kr(){return Rr||(Rr=Br(He()))}Ur[qr]=!0,Ur[e]=Ur.remove,Ur.merge=Ur.concat=Ur.union,Ur.withMutations=je,Ur.asImmutable=De,Ur["@@transducer/init"]=Ur.asMutable=Me,Ur["@@transducer/step"]=function(t,e){return t.add(e)},Ur["@@transducer/result"]=function(t){return t.asImmutable()},Ur.__empty=Kr,Ur.__make=Br;var Lr,Cr=function(t){function e(t,r,n){if(void 0===n&&(n=1),!(this instanceof e))return new e(t,r,n);if(Zt(0!==n,"Cannot step a Range by 0"),Zt(void 0!==t,"You must define a start value when using Range"),Zt(void 0!==r,"You must define an end value when using Range"),n=Math.abs(n),r<t&&(n=-n),this._start=t,this._end=r,this._step=n,this.size=Math.max(0,Math.ceil((r-t)/n-1)+1),0===this.size){if(Lr)return Lr;Lr=this}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},e.prototype.get=function(t,e){return this.has(t)?this._start+c(this,t)*this._step:e},e.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e<this.size&&e===Math.floor(e)},e.prototype.slice=function(t,r){return h(t,r,this.size)?this:(t=p(t,this.size),(r=_(r,this.size))<=t?new e(0,0):new e(this.get(t,this._end),this.get(r,this._end),this._step))},e.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step==0){var r=e/this._step;if(r>=0&&r<this.size)return r}return-1},e.prototype.lastIndexOf=function(t){return this.indexOf(t)},e.prototype.__iterate=function(t,e){for(var r=this.size,n=this._step,i=e?this._start+(r-1)*n:this._start,o=0;o!==r&&!1!==t(i,e?r-++o:o++,this);)i+=e?-n:n;return o},e.prototype.__iterator=function(t,e){var r=this.size,n=this._step,i=e?this._start+(r-1)*n:this._start,o=0;return new C((function(){if(o===r)return{value:void 0,done:!0};var u=i;return i+=e?-n:n,P(t,e?r-++o:o++,u)}))},e.prototype.equals=function(t){return t instanceof e?this._start===t._start&&this._end===t._end&&this._step===t._step:Dr(this,t)},e}(G);function Pr(t,e,r){for(var n=te(e),i=0;i!==n.length;)if((t=ue(t,n[i++],o))===o)return r;return t}function Wr(t,e){return Pr(this,t,e)}function Nr(t,e){return Pr(t,e,o)!==o}function Hr(){$t(this.size);var t={};return this.__iterate((function(e,r){t[r]=e})),t}b.isIterable=d,b.isKeyed=w,b.isIndexed=S,b.isAssociative=z,b.isOrdered=k,b.Iterator=C,xr(b,{toArray:function(){$t(this.size);var t=new Array(this.size||0),e=w(this),r=0;return this.__iterate((function(n,i){t[r++]=e?[i,n]:n})),t},toIndexedSeq:function(){return new xt(this)},toJS:function(){return Ar(this)},toKeyedSeq:function(){return new Dt(this,!0)},toMap:function(){return Ae(this.toKeyedSeq())},toObject:Hr,toOrderedMap:function(){return yr(this.toKeyedSeq())},toOrderedSet:function(){return nn(w(this)?this.valueSeq():this)},toSet:function(){return kr(w(this)?this.valueSeq():this)},toSetSeq:function(){return new At(this)},toSeq:function(){return S(this)?this.toIndexedSeq():w(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return zr(w(this)?this.valueSeq():this)},toList:function(){return rr(w(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Jt(this,function(t,e){var r=w(t),n=[t].concat(e).map((function(t){return d(t)?r&&(t=I(t)):t=r?it(t):ot(Array.isArray(t)?t:[t]),t})).filter((function(t){return 0!==t.size}));if(0===n.length)return t;if(1===n.length){var i=n[0];if(i===t||r&&w(i)||S(t)&&S(i))return i}var o=new $(n);return r?o=o.toKeyedSeq():S(t)||(o=o.toSetSeq()),(o=o.flatten(!0)).size=n.reduce((function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}}),0),o}(this,t))},includes:function(t){return this.some((function(e){return ht(e,t)}))},entries:function(){return this.__iterator(T)},every:function(t,e){$t(this.size);var r=!0;return this.__iterate((function(n,i,o){if(!t.call(e,n,i,o))return r=!1,!1})),r},filter:function(t,e){return Jt(this,Bt(this,t,e,!0))},partition:function(t,e){return function(t,e,r){var n=w(t),i=[[],[]];t.__iterate((function(o,u){i[e.call(r,o,u,t)?1:0].push(n?[u,o]:o)}));var o=Yt(t);return i.map((function(e){return Jt(t,o(e))}))}(this,t,e)},find:function(t,e,r){var n=this.findEntry(t,e);return n?n[1]:r},forEach:function(t,e){return $t(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){$t(this.size),t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate((function(n){r?r=!1:e+=t,e+=null!=n?n.toString():""})),e},keys:function(){return this.__iterator(R)},map:function(t,e){return Jt(this,Ut(this,t,e))},reduce:function(t,e,r){return Xr(this,t,e,r,arguments.length<2,!1)},reduceRight:function(t,e,r){return Xr(this,t,e,r,arguments.length<2,!0)},reverse:function(){return Jt(this,Tt(this,!0))},slice:function(t,e){return Jt(this,Kt(this,t,e,!0))},some:function(t,e){$t(this.size);var r=!1;return this.__iterate((function(n,i,o){if(t.call(e,n,i,o))return r=!0,!1})),r},sort:function(t){return Jt(this,Pt(this,t))},values:function(){return this.__iterator(U)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(t,e){return a(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return function(t,e,r){var n=Ae().asMutable();return t.__iterate((function(i,o){n.update(e.call(r,i,o,t),0,(function(t){return t+1}))})),n.asImmutable()}(this,t,e)},equals:function(t){return Dr(this,t)},entrySeq:function(){var t=this;if(t._cache)return new $(t._cache);var e=t.toSeq().map(Gr).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(Zr(t),e)},findEntry:function(t,e,r){var n=r;return this.__iterate((function(r,i,o){if(t.call(e,r,i,o))return n=[i,r],!1})),n},findKey:function(t,e){var r=this.findEntry(t,e);return r&&r[0]},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},findLastEntry:function(t,e,r){return this.toKeyedSeq().reverse().findEntry(t,e,r)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(t){return this.find(f,null,t)},flatMap:function(t,e){return Jt(this,function(t,e,r){var n=Yt(t);return t.toSeq().map((function(i,o){return n(e.call(r,i,o,t))})).flatten(!0)}(this,t,e))},flatten:function(t){return Jt(this,Ct(this,t,!0))},fromEntrySeq:function(){return new kt(this)},get:function(t,e){return this.find((function(e,r){return ht(r,t)}),void 0,e)},getIn:Wr,groupBy:function(t,e){return function(t,e,r){var n=w(t),i=(k(t)?yr():Ae()).asMutable();t.__iterate((function(o,u){i.update(e.call(r,o,u,t),(function(t){return(t=t||[]).push(n?[u,o]:o),t}))}));var o=Yt(t);return i.map((function(e){return Jt(t,o(e))})).asImmutable()}(this,t,e)},has:function(t){return this.get(t,o)!==o},hasIn:function(t){return Nr(this,t)},isSubset:function(t){return t="function"==typeof t.includes?t:b(t),this.every((function(e){return t.includes(e)}))},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:b(t)).isSubset(this)},keyOf:function(t){return this.findKey((function(e){return ht(e,t)}))},keySeq:function(){return this.toSeq().map(Fr).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Wt(this,t)},maxBy:function(t,e){return Wt(this,e,t)},min:function(t){return Wt(this,t?$r(t):en)},minBy:function(t,e){return Wt(this,e?$r(e):en,t)},rest:function(){return this.slice(1)},skip:function(t){return 0===t?this:this.slice(Math.max(0,t))},skipLast:function(t){return 0===t?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,e){return Jt(this,Lt(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(Zr(t),e)},sortBy:function(t,e){return Jt(this,Pt(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,e){return Jt(this,function(t,e,r){var n=Qt(t);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var u=0;return t.__iterate((function(t,i,s){return e.call(r,t,i,s)&&++u&&n(t,i,o)})),u},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var u=t.__iterator(T,i),s=!0;return new C((function(){if(!s)return{value:void 0,done:!0};var t=u.next();if(t.done)return t;var i=t.value,a=i[0],c=i[1];return e.call(r,c,a,o)?n===T?t:P(n,a,c,t):(s=!1,{value:void 0,done:!0})}))},n}(this,t,e))},takeUntil:function(t,e){return this.takeWhile(Zr(t),e)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(t){if(t.size===1/0)return 0;var e=k(t),r=w(t),n=e?1:0;return function(t,e){return e=pt(e,3432918353),e=pt(e<<15|e>>>-15,461845907),e=pt(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=pt(e^e>>>16,2246822507),e=pt(e^e>>>13,3266489909),e=_t(e^e>>>16),e}(t.__iterate(r?e?function(t,e){n=31*n+rn(vt(t),vt(e))|0}:function(t,e){n=n+rn(vt(t),vt(e))|0}:e?function(t){n=31*n+vt(t)|0}:function(t){n=n+vt(t)|0}),n)}(this))}});var Jr=b.prototype;Jr[y]=!0,Jr[L]=Jr.values,Jr.toJSON=Jr.toArray,Jr.__toStringMapper=ie,Jr.inspect=Jr.toSource=function(){return this.toString()},Jr.chain=Jr.flatMap,Jr.contains=Jr.includes,xr(I,{flip:function(){return Jt(this,Rt(this))},mapEntries:function(t,e){var r=this,n=0;return Jt(this,this.toSeq().map((function(i,o){return t.call(e,[o,i],n++,r)})).fromEntrySeq())},mapKeys:function(t,e){var r=this;return Jt(this,this.toSeq().flip().map((function(n,i){return t.call(e,n,i,r)})).flip())}});var Vr=I.prototype;Vr[g]=!0,Vr[L]=Jr.entries,Vr.toJSON=Hr,Vr.__toStringMapper=function(t,e){return ie(e)+": "+ie(t)},xr(O,{toKeyedSeq:function(){return new Dt(this,!1)},filter:function(t,e){return Jt(this,Bt(this,t,e,!1))},findIndex:function(t,e){var r=this.findEntry(t,e);return r?r[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return Jt(this,Tt(this,!1))},slice:function(t,e){return Jt(this,Kt(this,t,e,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(e||0,0),0===r||2===r&&!e)return this;t=p(t,t<0?this.count():this.size);var n=this.slice(0,t);return Jt(this,1===r?n:n.concat(Gt(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.findLastEntry(t,e);return r?r[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Jt(this,Ct(this,t,!1))},get:function(t,e){return(t=c(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find((function(e,r){return r===t}),void 0,e)},has:function(t){return(t=c(this,t))>=0&&(void 0!==this.size?this.size===1/0||t<this.size:-1!==this.indexOf(t))},interpose:function(t){return Jt(this,function(t,e){var r=Qt(t);return r.size=t.size&&2*t.size-1,r.__iterateUncached=function(r,n){var i=this,o=0;return t.__iterate((function(t){return(!o||!1!==r(e,o++,i))&&!1!==r(t,o++,i)}),n),o},r.__iteratorUncached=function(r,n){var i,o=t.__iterator(U,n),u=0;return new C((function(){return(!i||u%2)&&(i=o.next()).done?i:u%2?P(r,u++,e):P(r,u++,i.value,i)}))},r}(this,t))},interleave:function(){var t=[this].concat(Gt(arguments)),e=Ht(this.toSeq(),G.of,t),r=e.flatten(!0);return e.size&&(r.size=e.size*t.length),Jt(this,r)},keySeq:function(){return Cr(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,e){return Jt(this,Lt(this,t,e,!1))},zip:function(){return Jt(this,Ht(this,tn,[this].concat(Gt(arguments))))},zipAll:function(){return Jt(this,Ht(this,tn,[this].concat(Gt(arguments)),!0))},zipWith:function(t){var e=Gt(arguments);return e[0]=this,Jt(this,Ht(this,t,e))}});var Yr=O.prototype;Yr[m]=!0,Yr[A]=!0,xr(E,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});var Qr=E.prototype;function Xr(t,e,r,n,i,o){return $t(t.size),t.__iterate((function(t,o,u){i?(i=!1,r=t):r=e.call(n,r,t,o,u)}),o),r}function Fr(t,e){return e}function Gr(t,e){return[e,t]}function Zr(t){return function(){return!t.apply(this,arguments)}}function $r(t){return function(){return-t.apply(this,arguments)}}function tn(){return Gt(arguments)}function en(t,e){return t<e?1:t>e?-1:0}function rn(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}Qr.has=Jr.includes,Qr.contains=Qr.includes,Qr.keys=Qr.values,xr(F,Vr),xr(G,Yr),xr(Z,Qr);var nn=function(t){function e(t){return null==t?an():Mr(t)?t:an().withMutations((function(e){var r=E(t);$t(r.size),r.forEach((function(t){return e.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(I(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(kr);nn.isOrderedSet=Mr;var on,un=nn.prototype;function sn(t,e){var r=Object.create(un);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function an(){return on||(on=sn(gr()))}un[A]=!0,un.zip=Yr.zip,un.zipWith=Yr.zipWith,un.zipAll=Yr.zipAll,un.__empty=an,un.__make=sn;var cn=function(t,e){var r;!function(t){if(D(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(x(t))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(t);var n=function(o){var u=this;if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!r){r=!0;var s=Object.keys(t),a=i._indices={};i._name=e,i._keys=s,i._defaultValues=t;for(var c=0;c<s.length;c++){var f=s[c];a[f]=c,i[f]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+pn(this)+' with property "'+f+'" since that property name is part of the Record API.'):ln(i,f)}}return this.__ownerID=void 0,this._values=rr().withMutations((function(t){t.setSize(u._keys.length),I(o).forEach((function(e,r){t.set(u._indices[r],e===u._defaultValues[r]?void 0:e)}))})),this},i=n.prototype=Object.create(fn);return i.constructor=n,e&&(n.displayName=e),n};cn.prototype.toString=function(){for(var t,e=pn(this)+" { ",r=this._keys,n=0,i=r.length;n!==i;n++)e+=(n?", ":"")+(t=r[n])+": "+ie(this.get(t));return e+" }"},cn.prototype.equals=function(t){return this===t||D(t)&&_n(this).equals(_n(t))},cn.prototype.hashCode=function(){return _n(this).hashCode()},cn.prototype.has=function(t){return this._indices.hasOwnProperty(t)},cn.prototype.get=function(t,e){if(!this.has(t))return e;var r=this._indices[t],n=this._values.get(r);return void 0===n?this._defaultValues[t]:n},cn.prototype.set=function(t,e){if(this.has(t)){var r=this._values.set(this._indices[t],e===this._defaultValues[t]?void 0:e);if(r!==this._values&&!this.__ownerID)return hn(this,r)}return this},cn.prototype.remove=function(t){return this.set(t)},cn.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:hn(this,t)},cn.prototype.wasAltered=function(){return this._values.wasAltered()},cn.prototype.toSeq=function(){return _n(this)},cn.prototype.toJS=function(){return Ar(this)},cn.prototype.entries=function(){return this.__iterator(T)},cn.prototype.__iterator=function(t,e){return _n(this).__iterator(t,e)},cn.prototype.__iterate=function(t,e){return _n(this).__iterate(t,e)},cn.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._values.__ensureOwner(t);return t?hn(this,e,t):(this.__ownerID=t,this._values=e,this)},cn.isRecord=D,cn.getDescriptiveName=pn;var fn=cn.prototype;function hn(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._values=e,n.__ownerID=r,n}function pn(t){return t.constructor.displayName||t.constructor.name||"Record"}function _n(t){return it(t._keys.map((function(e){return[e,t.get(e)]})))}function ln(t,e){try{Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){Zt(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}catch(t){}}fn[M]=!0,fn[e]=fn.remove,fn.deleteIn=fn.removeIn=ve,fn.getIn=Wr,fn.hasIn=Jr.hasIn,fn.merge=we,fn.mergeWith=me,fn.mergeIn=Ee,fn.mergeDeep=Ie,fn.mergeDeepWith=Oe,fn.mergeDeepIn=qe,fn.setIn=_e,fn.update=de,fn.updateIn=ge,fn.withMutations=je,fn.asMutable=Me,fn.asImmutable=De,fn[L]=fn.entries,fn.toJSON=fn.toObject=Jr.toObject,fn.inspect=fn.toSource=function(){return this.toString()};var vn,yn=function(t){function e(t,r){if(!(this instanceof e))return new e(t,r);if(this._value=t,this.size=void 0===r?1/0:Math.max(0,r),0===this.size){if(vn)return vn;vn=this}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},e.prototype.get=function(t,e){return this.has(t)?this._value:e},e.prototype.includes=function(t){return ht(this._value,t)},e.prototype.slice=function(t,r){var n=this.size;return h(t,r,n)?this:new e(this._value,_(r,n)-p(t,n))},e.prototype.reverse=function(){return this},e.prototype.indexOf=function(t){return ht(this._value,t)?0:-1},e.prototype.lastIndexOf=function(t){return ht(this._value,t)?this.size:-1},e.prototype.__iterate=function(t,e){for(var r=this.size,n=0;n!==r&&!1!==t(this._value,e?r-++n:n++,this););return n},e.prototype.__iterator=function(t,e){var r=this,n=this.size,i=0;return new C((function(){return i===n?{value:void 0,done:!0}:P(t,e?n-++i:i++,r._value)}))},e.prototype.equals=function(t){return t instanceof e?ht(this._value,t._value):Dr(t)},e}(G);function dn(t,e,r,n,i,o){if("string"!=typeof r&&!x(r)&&(Q(r)||N(r)||re(r))){if(~t.indexOf(r))throw new TypeError("Cannot convert circular structure to Immutable");t.push(r),i&&""!==n&&i.push(n);var u=e.call(o,n,X(r).map((function(n,o){return dn(t,e,n,o,i,r)})),i&&i.slice());return t.pop(),i&&i.pop(),u}return r}function gn(t,e){return S(e)?e.toList():w(e)?e.toMap():e.toSet()}var wn=b;t.Collection=b,t.Iterable=wn,t.List=rr,t.Map=Ae,t.OrderedMap=yr,t.OrderedSet=nn,t.PairSorting={LeftThenRight:-1,RightThenLeft:1},t.Range=Cr,t.Record=cn,t.Repeat=yn,t.Seq=X,t.Set=kr,t.Stack=zr,t.fromJS=function(t,e){return dn([],e||gn,t,"",e&&e.length>2?[]:void 0,{"":t})},t.get=ue,t.getIn=Pr,t.has=oe,t.hasIn=Nr,t.hash=vt,t.is=ht,t.isAssociative=z,t.isCollection=d,t.isImmutable=x,t.isIndexed=S,t.isKeyed=w,t.isList=er,t.isMap=at,t.isOrdered=k,t.isOrderedMap=ct,t.isOrderedSet=Mr,t.isPlainObject=re,t.isRecord=D,t.isSeq=j,t.isSet=jr,t.isStack=Sr,t.isValueObject=ft,t.merge=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return be(t,e)},t.mergeDeep=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return ze(t,e)},t.mergeDeepWith=function(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return ze(e,r,t)},t.mergeWith=function(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return be(e,r,t)},t.remove=ae,t.removeIn=le,t.set=ce,t.setIn=pe,t.update=ye,t.updateIn=fe,t.version="5.0.0-beta.5"}));
25
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Immutable={})}(this,(function(t){"use strict";var e="delete",r=5,n=1<<r,i=n-1,o={};function u(t){t&&(t.value=!0)}function s(){}function a(t){return void 0===t.size&&(t.size=t.__iterate(f)),t.size}function c(t,e){if("number"!=typeof e){var r=e>>>0;if(""+r!==e||4294967295===r)return NaN;e=r}return e<0?a(t)+e:e}function f(){return!0}function h(t,e,r){return(0===t&&!v(t)||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&e>=r)}function p(t,e){return l(t,e,0)}function _(t,e){return l(t,e,e)}function l(t,e,r){return void 0===t?r:v(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function v(t){return t<0||0===t&&1/t==-1/0}var y="@@__IMMUTABLE_ITERABLE__@@";function d(t){return Boolean(t&&t[y])}var g="@@__IMMUTABLE_KEYED__@@";function w(t){return Boolean(t&&t[g])}var m="@@__IMMUTABLE_INDEXED__@@";function z(t){return Boolean(t&&t[m])}function S(t){return w(t)||z(t)}var b=function(t){return d(t)?t:X(t)},I=function(t){function e(t){return w(t)?t:F(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(b),O=function(t){function e(t){return z(t)?t:G(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(b),E=function(t){function e(t){return d(t)&&!S(t)?t:Z(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(b);b.Keyed=I,b.Indexed=O,b.Set=E;var q="@@__IMMUTABLE_SEQ__@@";function j(t){return Boolean(t&&t[q])}var M="@@__IMMUTABLE_RECORD__@@";function D(t){return Boolean(t&&t[M])}function x(t){return d(t)||D(t)}var A="@@__IMMUTABLE_ORDERED__@@";function k(t){return Boolean(t&&t[A])}var R=0,U=1,T=2,B="function"==typeof Symbol&&Symbol.iterator,K="@@iterator",L=B||K,C=function(t){this.next=t};function P(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function W(){return{value:void 0,done:!0}}function N(t){return!!Array.isArray(t)||!!V(t)}function H(t){return t&&"function"==typeof t.next}function J(t){var e=V(t);return e&&e.call(t)}function V(t){var e=t&&(B&&t[B]||t[K]);if("function"==typeof e)return e}C.prototype.toString=function(){return"[Iterator]"},C.KEYS=R,C.VALUES=U,C.ENTRIES=T,C.prototype.inspect=C.prototype.toSource=function(){return this.toString()},C.prototype[L]=function(){return this};var Y=Object.prototype.hasOwnProperty;function Q(t){return!(!Array.isArray(t)&&"string"!=typeof t)||t&&"object"==typeof t&&Number.isInteger(t.length)&&t.length>=0&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var X=function(t){function e(t){return null==t?nt():x(t)?t.toSeq():function(t){var e=ut(t);if(e)return(n=V(r=t))&&n===r.entries?e.fromEntrySeq():function(t){var e=V(t);return e&&e===t.keys}(t)?e.toSetSeq():e;var r,n;if("object"==typeof t)return new tt(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var r=this._cache;if(r){for(var n=r.length,i=0;i!==n;){var o=r[e?n-++i:i++];if(!1===t(o[1],o[0],this))break}return i}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var r=this._cache;if(r){var n=r.length,i=0;return new C((function(){if(i===n)return{value:void 0,done:!0};var o=r[e?n-++i:i++];return P(t,o[0],o[1])}))}return this.__iteratorUncached(t,e)},e}(b),F=function(t){function e(t){return null==t?nt().toKeyedSeq():d(t)?w(t)?t.toSeq():t.fromEntrySeq():D(t)?t.toSeq():it(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(X),G=function(t){function e(t){return null==t?nt():d(t)?w(t)?t.entrySeq():t.toIndexedSeq():D(t)?t.toSeq().entrySeq():ot(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(X),Z=function(t){function e(t){return(d(t)&&!S(t)?t:G(t)).toSetSeq()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(X);X.isSeq=j,X.Keyed=F,X.Set=Z,X.Indexed=G,X.prototype[q]=!0;var $=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this.has(t)?this._array[c(this,t)]:e},e.prototype.__iterate=function(t,e){for(var r=this._array,n=r.length,i=0;i!==n;){var o=e?n-++i:i++;if(!1===t(r[o],o,this))break}return i},e.prototype.__iterator=function(t,e){var r=this._array,n=r.length,i=0;return new C((function(){if(i===n)return{value:void 0,done:!0};var o=e?n-++i:i++;return P(t,o,r[o])}))},e}(G),tt=function(t){function e(t){var e=Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]);this._object=t,this._keys=e,this.size=e.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},e.prototype.has=function(t){return Y.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length,o=0;o!==i;){var u=n[e?i-++o:o++];if(!1===t(r[u],u,this))break}return o},e.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,i=n.length,o=0;return new C((function(){if(o===i)return{value:void 0,done:!0};var u=n[e?i-++o:o++];return P(t,u,r[u])}))},e}(F);tt.prototype[A]=!0;var et,rt=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=J(this._collection),n=0;if(H(r))for(var i;!(i=r.next()).done&&!1!==t(i.value,n++,this););return n},e.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=J(this._collection);if(!H(r))return new C(W);var n=0;return new C((function(){var e=r.next();return e.done?e:P(t,n++,e.value)}))},e}(G);function nt(){return et||(et=new $([]))}function it(t){var e=ut(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new tt(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function ot(t){var e=ut(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function ut(t){return Q(t)?new $(t):N(t)?new rt(t):void 0}var st="@@__IMMUTABLE_MAP__@@";function at(t){return Boolean(t&&t[st])}function ct(t){return at(t)&&k(t)}function ft(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function ht(t,e){if(t===e||t!=t&&e!=e)return!0;if(!t||!e)return!1;if("function"==typeof t.valueOf&&"function"==typeof e.valueOf){if((t=t.valueOf())===(e=e.valueOf())||t!=t&&e!=e)return!0;if(!t||!e)return!1}return!!(ft(t)&&ft(e)&&t.equals(e))}var pt="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var r=65535&(t|=0),n=65535&(e|=0);return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0};function _t(t){return t>>>1&1073741824|3221225471&t}var lt=Object.prototype.valueOf;function vt(t){if(null==t)return yt(t);if("function"==typeof t.hashCode)return _t(t.hashCode(t));var e,r=(e=t).valueOf!==lt&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return yt(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;e!==t&&(e^=4294967295*t);for(;t>4294967295;)e^=t/=4294967295;return _t(e)}(r);case"string":return r.length>Et?function(t){var e=Mt[t];void 0===e&&(e=dt(t),jt===qt&&(jt=0,Mt={}),jt++,Mt[t]=e);return e}(r):dt(r);case"object":case"function":return function(t){var e;if(St&&void 0!==(e=zt.get(t)))return e;if(e=t[Ot],void 0!==e)return e;if(!wt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[Ot]))return e;if(void 0!==(e=function(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return e}if(e=mt(),St)zt.set(t,e);else{if(void 0!==gt&&!1===gt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(wt)Object.defineProperty(t,Ot,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[Ot]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[Ot]=e}}return e}(r);case"symbol":return function(t){var e=bt[t];if(void 0!==e)return e;return e=mt(),bt[t]=e,e}(r);default:if("function"==typeof r.toString)return dt(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function yt(t){return null===t?1108378658:1108378659}function dt(t){for(var e=0,r=0;r<t.length;r++)e=31*e+t.charCodeAt(r)|0;return _t(e)}var gt=Object.isExtensible,wt=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}();function mt(){var t=++It;return 1073741824&It&&(It=0),t}var zt,St="function"==typeof WeakMap;St&&(zt=new WeakMap);var bt=Object.create(null),It=0,Ot="__immutablehash__";"function"==typeof Symbol&&(Ot=Symbol(Ot));var Et=16,qt=255,jt=0,Mt={},Dt=function(t){function e(t,e){this._iter=t,this._useKeys=e,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this._iter.get(t,e)},e.prototype.has=function(t){return this._iter.has(t)},e.prototype.valueSeq=function(){return this._iter.valueSeq()},e.prototype.reverse=function(){var t=this,e=Tt(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},e.prototype.map=function(t,e){var r=this,n=Ut(this,t,e);return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate((function(e,n){return t(e,n,r)}),e)},e.prototype.__iterator=function(t,e){return this._iter.__iterator(t,e)},e}(F);Dt.prototype[A]=!0;var xt=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.includes=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(t,e){var r=this,n=0;return e&&a(this),this._iter.__iterate((function(i){return t(i,e?r.size-++n:n++,r)}),e)},e.prototype.__iterator=function(t,e){var r=this,n=this._iter.__iterator(U,e),i=0;return e&&a(this),new C((function(){var o=n.next();return o.done?o:P(t,e?r.size-++i:i++,o.value,o)}))},e}(G),At=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.has=function(t){return this._iter.includes(t)},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate((function(e){return t(e,e,r)}),e)},e.prototype.__iterator=function(t,e){var r=this._iter.__iterator(U,e);return new C((function(){var e=r.next();return e.done?e:P(t,e.value,e.value,e)}))},e}(Z),kt=function(t){function e(t){this._iter=t,this.size=t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.entrySeq=function(){return this._iter.toSeq()},e.prototype.__iterate=function(t,e){var r=this;return this._iter.__iterate((function(e){if(e){Vt(e);var n=d(e);return t(n?e.get(1):e[1],n?e.get(0):e[0],r)}}),e)},e.prototype.__iterator=function(t,e){var r=this._iter.__iterator(U,e);return new C((function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n){Vt(n);var i=d(n);return P(t,i?n.get(0):n[0],i?n.get(1):n[1],e)}}}))},e}(F);function Rt(t){var e=Qt(t);return e._iter=t,e.size=t.size,e.flip=function(){return t},e.reverse=function(){var e=t.reverse.apply(this);return e.flip=function(){return t.reverse()},e},e.has=function(e){return t.includes(e)},e.includes=function(e){return t.has(e)},e.cacheResult=Xt,e.__iterateUncached=function(e,r){var n=this;return t.__iterate((function(t,r){return!1!==e(r,t,n)}),r)},e.__iteratorUncached=function(e,r){if(e===T){var n=t.__iterator(e,r);return new C((function(){var t=n.next();if(!t.done){var e=t.value[0];t.value[0]=t.value[1],t.value[1]=e}return t}))}return t.__iterator(e===U?R:U,r)},e}function Ut(t,e,r){var n=Qt(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var u=t.get(n,o);return u===o?i:e.call(r,u,n,t)},n.__iterateUncached=function(n,i){var o=this;return t.__iterate((function(t,i,u){return!1!==n(e.call(r,t,i,u),i,o)}),i)},n.__iteratorUncached=function(n,i){var o=t.__iterator(T,i);return new C((function(){var i=o.next();if(i.done)return i;var u=i.value,s=u[0];return P(n,s,e.call(r,u[1],s,t),i)}))},n}function Tt(t,e){var r=this,n=Qt(t);return n._iter=t,n.size=t.size,n.reverse=function(){return t},t.flip&&(n.flip=function(){var e=Rt(t);return e.reverse=function(){return t.flip()},e}),n.get=function(r,n){return t.get(e?r:-1-r,n)},n.has=function(r){return t.has(e?r:-1-r)},n.includes=function(e){return t.includes(e)},n.cacheResult=Xt,n.__iterate=function(r,n){var i=this,o=0;return n&&a(t),t.__iterate((function(t,u){return r(t,e?u:n?i.size-++o:o++,i)}),!n)},n.__iterator=function(n,i){var o=0;i&&a(t);var u=t.__iterator(T,!i);return new C((function(){var t=u.next();if(t.done)return t;var s=t.value;return P(n,e?s[0]:i?r.size-++o:o++,s[1],t)}))},n}function Bt(t,e,r,n){var i=Qt(t);return n&&(i.has=function(n){var i=t.get(n,o);return i!==o&&!!e.call(r,i,n,t)},i.get=function(n,i){var u=t.get(n,o);return u!==o&&e.call(r,u,n,t)?u:i}),i.__iterateUncached=function(i,o){var u=this,s=0;return t.__iterate((function(t,o,a){if(e.call(r,t,o,a))return s++,i(t,n?o:s-1,u)}),o),s},i.__iteratorUncached=function(i,o){var u=t.__iterator(T,o),s=0;return new C((function(){for(;;){var o=u.next();if(o.done)return o;var a=o.value,c=a[0],f=a[1];if(e.call(r,f,c,t))return P(i,n?c:s++,f,o)}}))},i}function Kt(t,e,r,n){var i=t.size;if(h(e,r,i))return t;if(void 0===i&&(e<0||r<0))return Kt(t.toSeq().cacheResult(),e,r,n);var o,u=p(e,i),s=_(r,i)-u;s==s&&(o=s<0?0:s);var a=Qt(t);return a.size=0===o?o:t.size&&o||void 0,!n&&j(t)&&o>=0&&(a.get=function(e,r){return(e=c(this,e))>=0&&e<o?t.get(e+u,r):r}),a.__iterateUncached=function(e,r){var i=this;if(0===o)return 0;if(r)return this.cacheResult().__iterate(e,r);var s=0,a=!0,c=0;return t.__iterate((function(t,r){if(!a||!(a=s++<u))return c++,!1!==e(t,n?r:c-1,i)&&c!==o})),c},a.__iteratorUncached=function(e,r){if(0!==o&&r)return this.cacheResult().__iterator(e,r);if(0===o)return new C(W);var i=t.__iterator(e,r),s=0,a=0;return new C((function(){for(;s++<u;)i.next();if(++a>o)return{value:void 0,done:!0};var t=i.next();return n||e===U||t.done?t:P(e,a-1,e===R?void 0:t.value[1],t)}))},a}function Lt(t,e,r,n){var i=Qt(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,a=0;return t.__iterate((function(t,o,c){if(!s||!(s=e.call(r,t,o,c)))return a++,i(t,n?o:a-1,u)})),a},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var s=t.__iterator(T,o),a=!0,c=0;return new C((function(){var t,o,f;do{if((t=s.next()).done)return n||i===U?t:P(i,c++,i===R?void 0:t.value[1],t);var h=t.value;o=h[0],f=h[1],a&&(a=e.call(r,f,o,u))}while(a);return i===T?t:P(i,o,f,t)}))},i}function Ct(t,e,r){var n=Qt(t);return n.__iterateUncached=function(i,o){if(o)return this.cacheResult().__iterate(i,o);var u=0,s=!1;return function t(a,c){a.__iterate((function(o,a){return(!e||c<e)&&d(o)?t(o,c+1):(u++,!1===i(o,r?a:u-1,n)&&(s=!0)),!s}),o)}(t,0),u},n.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var o=t.__iterator(n,i),u=[],s=0;return new C((function(){for(;o;){var t=o.next();if(!1===t.done){var a=t.value;if(n===T&&(a=a[1]),e&&!(u.length<e)||!d(a))return r?t:P(n,s++,a,t);u.push(o),o=a.__iterator(n,i)}else o=u.pop()}return{value:void 0,done:!0}}))},n}function Pt(t,e,r){e||(e=Ft);var n=w(t),i=0,o=t.toSeq().map((function(e,n){return[n,e,i++,r?r(e,n,t):e]})).valueSeq().toArray();return o.sort((function(t,r){return e(t[3],r[3])||t[2]-r[2]})).forEach(n?function(t,e){o[e].length=2}:function(t,e){o[e]=t[1]}),n?F(o):z(t)?G(o):Z(o)}function Wt(t,e,r){if(e||(e=Ft),r){var n=t.toSeq().map((function(e,n){return[e,r(e,n,t)]})).reduce((function(t,r){return Nt(e,t[1],r[1])?r:t}));return n&&n[0]}return t.reduce((function(t,r){return Nt(e,t,r)?r:t}))}function Nt(t,e,r){var n=t(r,e);return 0===n&&r!==e&&(null==r||r!=r)||n>0}function Ht(t,e,r,n){var i=Qt(t),o=new $(r).map((function(t){return t.size}));return i.size=n?o.max():o.min(),i.__iterate=function(t,e){for(var r,n=this.__iterator(U,e),i=0;!(r=n.next()).done&&!1!==t(r.value,i++,this););return i},i.__iteratorUncached=function(t,i){var o=r.map((function(t){return t=b(t),J(i?t.reverse():t)})),u=0,s=!1;return new C((function(){var r;return s||(r=o.map((function(t){return t.next()})),s=n?r.every((function(t){return t.done})):r.some((function(t){return t.done}))),s?{value:void 0,done:!0}:P(t,u++,e.apply(null,r.map((function(t){return t.value}))))}))},i}function Jt(t,e){return t===e?t:j(t)?e:t.constructor(e)}function Vt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Yt(t){return w(t)?I:z(t)?O:E}function Qt(t){return Object.create((w(t)?F:z(t)?G:Z).prototype)}function Xt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):X.prototype.cacheResult.call(this)}function Ft(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:t>e?1:t<e?-1:0}function Gt(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=new Array(r),i=0;i<r;i++)n[i]=t[i+e];return n}function Zt(t,e){if(!t)throw new Error(e)}function $t(t){Zt(t!==1/0,"Cannot perform this action with an infinite size.")}function te(t){if(Q(t)&&"string"!=typeof t)return t;if(k(t))return t.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+t)}xt.prototype.cacheResult=Dt.prototype.cacheResult=At.prototype.cacheResult=kt.prototype.cacheResult=Xt;var ee=Object.prototype.toString;function re(t){if(!t||"object"!=typeof t||"[object Object]"!==ee.call(t))return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var r=e,n=Object.getPrototypeOf(e);null!==n;)r=n,n=Object.getPrototypeOf(r);return r===e}function ne(t){return"object"==typeof t&&(x(t)||Array.isArray(t)||re(t))}function ie(t){try{return"string"==typeof t?JSON.stringify(t):String(t)}catch(e){return JSON.stringify(t)}}function oe(t,e){return x(t)?t.has(e):ne(t)&&Y.call(t,e)}function ue(t,e,r){return x(t)?t.get(e,r):oe(t,e)?"function"==typeof t.get?t.get(e):t[e]:r}function se(t){if(Array.isArray(t))return Gt(t);var e={};for(var r in t)Y.call(t,r)&&(e[r]=t[r]);return e}function ae(t,e){if(!ne(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(x(t)){if(!t.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+t);return t.remove(e)}if(!Y.call(t,e))return t;var r=se(t);return Array.isArray(r)?r.splice(e,1):delete r[e],r}function ce(t,e,r){if(!ne(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(x(t)){if(!t.set)throw new TypeError("Cannot update immutable value without .set() method: "+t);return t.set(e,r)}if(Y.call(t,e)&&r===t[e])return t;var n=se(t);return n[e]=r,n}function fe(t,e,r,n){n||(n=r,r=void 0);var i=he(x(t),t,te(e),0,r,n);return i===o?r:i}function he(t,e,r,n,i,u){var s=e===o;if(n===r.length){var a=s?i:e,c=u(a);return c===a?e:c}if(!s&&!ne(e))throw new TypeError("Cannot update within non-data-structure value in path ["+r.slice(0,n).map(ie)+"]: "+e);var f=r[n],h=s?o:ue(e,f,o),p=he(h===o?t:x(h),h,r,n+1,i,u);return p===h?e:p===o?ae(e,f):ce(s?t?He():{}:e,f,p)}function pe(t,e,r){return fe(t,e,o,(function(){return r}))}function _e(t,e){return pe(this,t,e)}function le(t,e){return fe(t,e,(function(){return o}))}function ve(t){return le(this,t)}function ye(t,e,r,n){return fe(t,[e],r,n)}function de(t,e,r){return 1===arguments.length?t(this):ye(this,t,e,r)}function ge(t,e,r){return fe(this,t,e,r)}function we(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return ze(this,t)}function me(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return ze(this,e,t)}function ze(t,e,r){for(var n=[],i=0;i<e.length;i++){var u=I(e[i]);0!==u.size&&n.push(u)}return 0===n.length?t:0!==t.toSeq().size||t.__ownerID||1!==n.length?t.withMutations((function(t){for(var e=r?function(e,n){ye(t,n,o,(function(t){return t===o?e:r(t,e,n)}))}:function(e,r){t.set(r,e)},i=0;i<n.length;i++)n[i].forEach(e)})):t.constructor(n[0])}function Se(t,e,r){return be(t,e,function(t){function e(r,n,i){return ne(r)&&ne(n)&&(o=n,u=X(r),s=X(o),z(u)===z(s)&&w(u)===w(s))?be(r,[n],e):t?t(r,n,i):n;var o,u,s}return e}(r))}function be(t,e,r){if(!ne(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(x(t))return"function"==typeof r&&t.mergeWith?t.mergeWith.apply(t,[r].concat(e)):t.merge?t.merge.apply(t,e):t.concat.apply(t,e);for(var n=Array.isArray(t),i=t,o=n?O:I,u=n?function(e){i===t&&(i=se(i)),i.push(e)}:function(e,n){var o=Y.call(i,n),u=o&&r?r(i[n],e,n):e;o&&u===i[n]||(i===t&&(i=se(i)),i[n]=u)},s=0;s<e.length;s++)o(e[s]).forEach(u);return i}function Ie(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Se(this,t)}function Oe(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return Se(this,e,t)}function Ee(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return fe(this,t,He(),(function(t){return be(t,e)}))}function qe(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return fe(this,t,He(),(function(t){return Se(t,e)}))}function je(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}function Me(){return this.__ownerID?this:this.__ensureOwner(new s)}function De(){return this.__ensureOwner()}function xe(){return this.__altered}var Ae=function(t){function e(e){return null==e?He():at(e)&&!k(e)?e:He().withMutations((function(r){var n=t(e);$t(n.size),n.forEach((function(t,e){return r.set(e,t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return this.__toString("Map {","}")},e.prototype.get=function(t,e){return this._root?this._root.get(0,void 0,t,e):e},e.prototype.set=function(t,e){return Je(this,t,e)},e.prototype.remove=function(t){return Je(this,t,o)},e.prototype.deleteAll=function(t){var e=b(t);return 0===e.size?this:this.withMutations((function(t){e.forEach((function(e){return t.remove(e)}))}))},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):He()},e.prototype.sort=function(t){return vr(Pt(this,t))},e.prototype.sortBy=function(t,e){return vr(Pt(this,e,t))},e.prototype.map=function(t,e){var r=this;return this.withMutations((function(n){n.forEach((function(i,o){n.set(o,t.call(e,i,o,r))}))}))},e.prototype.__iterator=function(t,e){return new Ce(this,t,e)},e.prototype.__iterate=function(t,e){var r=this,n=0;return this._root&&this._root.iterate((function(e){return n++,t(e[1],e[0],r)}),e),n},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ne(this.size,this._root,t,this.__hash):0===this.size?He():(this.__ownerID=t,this.__altered=!1,this)},e}(I);Ae.isMap=at;var ke=Ae.prototype;ke[st]=!0,ke[e]=ke.remove,ke.removeAll=ke.deleteAll,ke.setIn=_e,ke.removeIn=ke.deleteIn=ve,ke.update=de,ke.updateIn=ge,ke.merge=ke.concat=we,ke.mergeWith=me,ke.mergeDeep=Ie,ke.mergeDeepWith=Oe,ke.mergeIn=Ee,ke.mergeDeepIn=qe,ke.withMutations=je,ke.wasAltered=xe,ke.asImmutable=De,ke["@@transducer/init"]=ke.asMutable=Me,ke["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},ke["@@transducer/result"]=function(t){return t.asImmutable()};var Re=function(t,e){this.ownerID=t,this.entries=e};Re.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(ht(r,i[o][0]))return i[o][1];return n},Re.prototype.update=function(t,e,r,n,i,a,c){for(var f=i===o,h=this.entries,p=0,_=h.length;p<_&&!ht(n,h[p][0]);p++);var l=p<_;if(l?h[p][1]===i:f)return this;if(u(c),(f||!l)&&u(a),!f||1!==h.length){if(!l&&!f&&h.length>=Ge)return function(t,e,r,n){t||(t=new s);for(var i=new Ke(t,vt(r),[r,n]),o=0;o<e.length;o++){var u=e[o];i=i.update(t,0,void 0,u[0],u[1])}return i}(t,h,n,i);var v=t&&t===this.ownerID,y=v?h:Gt(h);return l?f?p===_-1?y.pop():y[p]=y.pop():y[p]=[n,i]:y.push([n,i]),v?(this.entries=y,this):new Re(t,y)}};var Ue=function(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r};Ue.prototype.get=function(t,e,n,o){void 0===e&&(e=vt(n));var u=1<<((0===t?e:e>>>t)&i),s=this.bitmap;return 0==(s&u)?o:this.nodes[Xe(s&u-1)].get(t+r,e,n,o)},Ue.prototype.update=function(t,e,u,s,a,c,f){void 0===u&&(u=vt(s));var h=(0===e?u:u>>>e)&i,p=1<<h,_=this.bitmap,l=0!=(_&p);if(!l&&a===o)return this;var v=Xe(_&p-1),y=this.nodes,d=l?y[v]:void 0,g=Ve(d,t,e+r,u,s,a,c,f);if(g===d)return this;if(!l&&g&&y.length>=Ze)return function(t,e,r,i,o){for(var u=0,s=new Array(n),a=0;0!==r;a++,r>>>=1)s[a]=1&r?e[u++]:void 0;return s[i]=o,new Te(t,u+1,s)}(t,y,_,h,g);if(l&&!g&&2===y.length&&Ye(y[1^v]))return y[1^v];if(l&&g&&1===y.length&&Ye(g))return g;var w=t&&t===this.ownerID,m=l?g?_:_^p:_|p,z=l?g?Fe(y,v,g,w):function(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=new Array(n),o=0,u=0;u<n;u++)u===e&&(o=1),i[u]=t[u+o];return i}(y,v,w):function(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var o=new Array(i),u=0,s=0;s<i;s++)s===e?(o[s]=r,u=-1):o[s]=t[s+u];return o}(y,v,g,w);return w?(this.bitmap=m,this.nodes=z,this):new Ue(t,m,z)};var Te=function(t,e,r){this.ownerID=t,this.count=e,this.nodes=r};Te.prototype.get=function(t,e,n,o){void 0===e&&(e=vt(n));var u=(0===t?e:e>>>t)&i,s=this.nodes[u];return s?s.get(t+r,e,n,o):o},Te.prototype.update=function(t,e,n,u,s,a,c){void 0===n&&(n=vt(u));var f=(0===e?n:n>>>e)&i,h=s===o,p=this.nodes,_=p[f];if(h&&!_)return this;var l=Ve(_,t,e+r,n,u,s,a,c);if(l===_)return this;var v=this.count;if(_){if(!l&&--v<$e)return function(t,e,r,n){for(var i=0,o=0,u=new Array(r),s=0,a=1,c=e.length;s<c;s++,a<<=1){var f=e[s];void 0!==f&&s!==n&&(i|=a,u[o++]=f)}return new Ue(t,i,u)}(t,p,v,f)}else v++;var y=t&&t===this.ownerID,d=Fe(p,f,l,y);return y?(this.count=v,this.nodes=d,this):new Te(t,v,d)};var Be=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r};Be.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(ht(r,i[o][0]))return i[o][1];return n},Be.prototype.update=function(t,e,r,n,i,s,a){void 0===r&&(r=vt(n));var c=i===o;if(r!==this.keyHash)return c?this:(u(a),u(s),Qe(this,t,e,r,[n,i]));for(var f=this.entries,h=0,p=f.length;h<p&&!ht(n,f[h][0]);h++);var _=h<p;if(_?f[h][1]===i:c)return this;if(u(a),(c||!_)&&u(s),c&&2===p)return new Ke(t,this.keyHash,f[1^h]);var l=t&&t===this.ownerID,v=l?f:Gt(f);return _?c?h===p-1?v.pop():v[h]=v.pop():v[h]=[n,i]:v.push([n,i]),l?(this.entries=v,this):new Be(t,this.keyHash,v)};var Ke=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r};Ke.prototype.get=function(t,e,r,n){return ht(r,this.entry[0])?this.entry[1]:n},Ke.prototype.update=function(t,e,r,n,i,s,a){var c=i===o,f=ht(n,this.entry[0]);return(f?i===this.entry[1]:c)?this:(u(a),c?void u(s):f?t&&t===this.ownerID?(this.entry[1]=i,this):new Ke(t,this.keyHash,[n,i]):(u(s),Qe(this,t,e,vt(n),[n,i])))},Re.prototype.iterate=Be.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;n<=i;n++)if(!1===t(r[e?i-n:n]))return!1},Ue.prototype.iterate=Te.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;n<=i;n++){var o=r[e?i-n:n];if(o&&!1===o.iterate(t,e))return!1}},Ke.prototype.iterate=function(t,e){return t(this.entry)};var Le,Ce=function(t){function e(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&We(t._root)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.next=function(){for(var t=this._type,e=this._stack;e;){var r=e.node,n=e.index++,i=void 0;if(r.entry){if(0===n)return Pe(t,r.entry)}else if(r.entries){if(n<=(i=r.entries.length-1))return Pe(t,r.entries[this._reverse?i-n:n])}else if(n<=(i=r.nodes.length-1)){var o=r.nodes[this._reverse?i-n:n];if(o){if(o.entry)return Pe(t,o.entry);e=this._stack=We(o,e)}continue}e=this._stack=this._stack.__prev}return{value:void 0,done:!0}},e}(C);function Pe(t,e){return P(t,e[0],e[1])}function We(t,e){return{node:t,index:0,__prev:e}}function Ne(t,e,r,n){var i=Object.create(ke);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function He(){return Le||(Le=Ne(0))}function Je(t,e,r){var n,i;if(t._root){var u={value:!1},s={value:!1};if(n=Ve(t._root,t.__ownerID,0,void 0,e,r,u,s),!s.value)return t;i=t.size+(u.value?r===o?-1:1:0)}else{if(r===o)return t;i=1,n=new Re(t.__ownerID,[[e,r]])}return t.__ownerID?(t.size=i,t._root=n,t.__hash=void 0,t.__altered=!0,t):n?Ne(i,n):He()}function Ve(t,e,r,n,i,s,a,c){return t?t.update(e,r,n,i,s,a,c):s===o?t:(u(c),u(a),new Ke(e,n,[i,s]))}function Ye(t){return t.constructor===Ke||t.constructor===Be}function Qe(t,e,n,o,u){if(t.keyHash===o)return new Be(e,o,[t.entry,u]);var s,a=(0===n?t.keyHash:t.keyHash>>>n)&i,c=(0===n?o:o>>>n)&i,f=a===c?[Qe(t,e,n+r,o,u)]:(s=new Ke(e,o,u),a<c?[t,s]:[s,t]);return new Ue(e,1<<a|1<<c,f)}function Xe(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function Fe(t,e,r,n){var i=n?t:Gt(t);return i[e]=r,i}var Ge=n/4,Ze=n/2,$e=n/4,tr="@@__IMMUTABLE_LIST__@@";function er(t){return Boolean(t&&t[tr])}var rr=function(t){function e(e){var i=ar();if(null==e)return i;if(er(e))return e;var o=t(e),u=o.size;return 0===u?i:($t(u),u>0&&u<n?sr(0,u,r,null,new ir(o.toArray())):i.withMutations((function(t){t.setSize(u),o.forEach((function(e,r){return t.set(r,e)}))})))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("List [","]")},e.prototype.get=function(t,e){if((t=c(this,t))>=0&&t<this.size){var r=hr(this,t+=this._origin);return r&&r.array[t&i]}return e},e.prototype.set=function(t,e){return function(t,e,r){if(e=c(t,e),e!=e)return t;if(e>=t.size||e<0)return t.withMutations((function(t){e<0?pr(t,e).set(0,r):pr(t,0,e+1).set(e,r)}));e+=t._origin;var n=t._tail,i=t._root,o={value:!1};e>=_r(t._capacity)?n=cr(n,t.__ownerID,0,e,r,o):i=cr(i,t.__ownerID,t._level,e,r,o);if(!o.value)return t;if(t.__ownerID)return t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t;return sr(t._origin,t._capacity,t._level,i,n)}(this,t,e)},e.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,e){return this.splice(t,0,e)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=r,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):ar()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(r){pr(r,0,e+t.length);for(var n=0;n<t.length;n++)r.set(e+n,t[n])}))},e.prototype.pop=function(){return pr(this,0,-1)},e.prototype.unshift=function(){var t=arguments;return this.withMutations((function(e){pr(e,-t.length);for(var r=0;r<t.length;r++)e.set(r,t[r])}))},e.prototype.shift=function(){return pr(this,1)},e.prototype.concat=function(){for(var e=arguments,r=[],n=0;n<arguments.length;n++){var i=e[n],o=t("string"!=typeof i&&N(i)?i:[i]);0!==o.size&&r.push(o)}return 0===r.length?this:0!==this.size||this.__ownerID||1!==r.length?this.withMutations((function(t){r.forEach((function(e){return e.forEach((function(e){return t.push(e)}))}))})):this.constructor(r[0])},e.prototype.setSize=function(t){return pr(this,0,t)},e.prototype.map=function(t,e){var r=this;return this.withMutations((function(n){for(var i=0;i<r.size;i++)n.set(i,t.call(e,n.get(i),i,r))}))},e.prototype.slice=function(t,e){var r=this.size;return h(t,e,r)?this:pr(this,p(t,r),_(e,r))},e.prototype.__iterator=function(t,e){var r=e?this.size:0,n=ur(this,e);return new C((function(){var i=n();return i===or?{value:void 0,done:!0}:P(t,e?--r:r++,i)}))},e.prototype.__iterate=function(t,e){for(var r,n=e?this.size:0,i=ur(this,e);(r=i())!==or&&!1!==t(r,e?--n:n++,this););return n},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?sr(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):0===this.size?ar():(this.__ownerID=t,this.__altered=!1,this)},e}(O);rr.isList=er;var nr=rr.prototype;nr[tr]=!0,nr[e]=nr.remove,nr.merge=nr.concat,nr.setIn=_e,nr.deleteIn=nr.removeIn=ve,nr.update=de,nr.updateIn=ge,nr.mergeIn=Ee,nr.mergeDeepIn=qe,nr.withMutations=je,nr.wasAltered=xe,nr.asImmutable=De,nr["@@transducer/init"]=nr.asMutable=Me,nr["@@transducer/step"]=function(t,e){return t.push(e)},nr["@@transducer/result"]=function(t){return t.asImmutable()};var ir=function(t,e){this.array=t,this.ownerID=e};ir.prototype.removeBefore=function(t,e,n){if(n===e?1<<e:0===this.array.length)return this;var o=n>>>e&i;if(o>=this.array.length)return new ir([],t);var u,s=0===o;if(e>0){var a=this.array[o];if((u=a&&a.removeBefore(t,e-r,n))===a&&s)return this}if(s&&!u)return this;var c=fr(this,t);if(!s)for(var f=0;f<o;f++)c.array[f]=void 0;return u&&(c.array[o]=u),c},ir.prototype.removeAfter=function(t,e,n){if(n===(e?1<<e:0)||0===this.array.length)return this;var o,u=n-1>>>e&i;if(u>=this.array.length)return this;if(e>0){var s=this.array[u];if((o=s&&s.removeAfter(t,e-r,n))===s&&u===this.array.length-1)return this}var a=fr(this,t);return a.array.splice(u+1),o&&(a.array[u]=o),a};var or={};function ur(t,e){var i=t._origin,o=t._capacity,u=_r(o),s=t._tail;return a(t._root,t._level,0);function a(t,c,f){return 0===c?function(t,r){var a=r===u?s&&s.array:t&&t.array,c=r>i?0:i-r,f=o-r;f>n&&(f=n);return function(){if(c===f)return or;var t=e?--f:c++;return a&&a[t]}}(t,f):function(t,u,s){var c,f=t&&t.array,h=s>i?0:i-s>>u,p=1+(o-s>>u);p>n&&(p=n);return function(){for(;;){if(c){var t=c();if(t!==or)return t;c=null}if(h===p)return or;var n=e?--p:h++;c=a(f&&f[n],u-r,s+(n<<u))}}}(t,c,f)}}function sr(t,e,r,n,i,o,u){var s=Object.create(nr);return s.size=e-t,s._origin=t,s._capacity=e,s._level=r,s._root=n,s._tail=i,s.__ownerID=o,s.__hash=u,s.__altered=!1,s}function ar(){return sr(0,0,r)}function cr(t,e,n,o,s,a){var c,f=o>>>n&i,h=t&&f<t.array.length;if(!h&&void 0===s)return t;if(n>0){var p=t&&t.array[f],_=cr(p,e,n-r,o,s,a);return _===p?t:((c=fr(t,e)).array[f]=_,c)}return h&&t.array[f]===s?t:(a&&u(a),c=fr(t,e),void 0===s&&f===c.array.length-1?c.array.pop():c.array[f]=s,c)}function fr(t,e){return e&&t&&e===t.ownerID?t:new ir(t?t.array.slice():[],e)}function hr(t,e){if(e>=_r(t._capacity))return t._tail;if(e<1<<t._level+r){for(var n=t._root,o=t._level;n&&o>0;)n=n.array[e>>>o&i],o-=r;return n}}function pr(t,e,n){void 0!==e&&(e|=0),void 0!==n&&(n|=0);var o=t.__ownerID||new s,u=t._origin,a=t._capacity,c=u+e,f=void 0===n?a:n<0?a+n:u+n;if(c===u&&f===a)return t;if(c>=f)return t.clear();for(var h=t._level,p=t._root,_=0;c+_<0;)p=new ir(p&&p.array.length?[void 0,p]:[],o),_+=1<<(h+=r);_&&(c+=_,u+=_,f+=_,a+=_);for(var l=_r(a),v=_r(f);v>=1<<h+r;)p=new ir(p&&p.array.length?[p]:[],o),h+=r;var y=t._tail,d=v<l?hr(t,f-1):v>l?new ir([],o):y;if(y&&v>l&&c<a&&y.array.length){for(var g=p=fr(p,o),w=h;w>r;w-=r){var m=l>>>w&i;g=g.array[m]=fr(g.array[m],o)}g.array[l>>>r&i]=y}if(f<a&&(d=d&&d.removeAfter(o,0,f)),c>=v)c-=v,f-=v,h=r,p=null,d=d&&d.removeBefore(o,0,c);else if(c>u||v<l){for(_=0;p;){var z=c>>>h&i;if(z!==v>>>h&i)break;z&&(_+=(1<<h)*z),h-=r,p=p.array[z]}p&&c>u&&(p=p.removeBefore(o,h,c-_)),p&&v<l&&(p=p.removeAfter(o,h,v-_)),_&&(c-=_,f-=_)}return t.__ownerID?(t.size=f-c,t._origin=c,t._capacity=f,t._level=h,t._root=p,t._tail=d,t.__hash=void 0,t.__altered=!0,t):sr(c,f,h,p,d)}function _r(t){return t<n?0:t-1>>>r<<r}var lr,vr=function(t){function e(t){return null==t?dr():ct(t)?t:dr().withMutations((function(e){var r=I(t);$t(r.size),r.forEach((function(t,r){return e.set(r,t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("OrderedMap {","}")},e.prototype.get=function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this.__altered=!0,this):dr()},e.prototype.set=function(t,e){return gr(this,t,e)},e.prototype.remove=function(t){return gr(this,t,o)},e.prototype.__iterate=function(t,e){var r=this;return this._list.__iterate((function(e){return e&&t(e[1],e[0],r)}),e)},e.prototype.__iterator=function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?yr(e,r,t,this.__hash):0===this.size?dr():(this.__ownerID=t,this.__altered=!1,this._map=e,this._list=r,this)},e}(Ae);function yr(t,e,r,n){var i=Object.create(vr.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function dr(){return lr||(lr=yr(He(),ar()))}function gr(t,e,r){var i,u,s=t._map,a=t._list,c=s.get(e),f=void 0!==c;if(r===o){if(!f)return t;a.size>=n&&a.size>=2*s.size?(i=(u=a.filter((function(t,e){return void 0!==t&&c!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(i.__ownerID=u.__ownerID=t.__ownerID)):(i=s.remove(e),u=c===a.size-1?a.pop():a.set(c,void 0))}else if(f){if(r===a.get(c)[1])return t;i=s,u=a.set(c,[e,r])}else i=s.set(e,a.size),u=a.set(a.size,[e,r]);return t.__ownerID?(t.size=i.size,t._map=i,t._list=u,t.__hash=void 0,t.__altered=!0,t):yr(i,u)}vr.isOrderedMap=ct,vr.prototype[A]=!0,vr.prototype[e]=vr.prototype.remove;var wr="@@__IMMUTABLE_STACK__@@";function mr(t){return Boolean(t&&t[wr])}var zr=function(t){function e(t){return null==t?Or():mr(t)?t:Or().pushAll(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(t,e){var r=this._head;for(t=c(this,t);r&&t--;)r=r.next;return r?r.value:e},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,r=this._head,n=arguments.length-1;n>=0;n--)r={value:t[n],next:r};return this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):Ir(e,r)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&mr(e))return e;$t(e.size);var r=this.size,n=this._head;return e.__iterate((function(t){r++,n={value:t,next:n}}),!0),this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):Ir(r,n)},e.prototype.pop=function(){return this.slice(1)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Or()},e.prototype.slice=function(e,r){if(h(e,r,this.size))return this;var n=p(e,this.size);if(_(r,this.size)!==this.size)return t.prototype.slice.call(this,e,r);for(var i=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):Ir(i,o)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Ir(this.size,this._head,t,this.__hash):0===this.size?Or():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var r=this;if(e)return new $(this.toArray()).__iterate((function(e,n){return t(e,n,r)}),e);for(var n=0,i=this._head;i&&!1!==t(i.value,n++,this);)i=i.next;return n},e.prototype.__iterator=function(t,e){if(e)return new $(this.toArray()).__iterator(t,e);var r=0,n=this._head;return new C((function(){if(n){var e=n.value;return n=n.next,P(t,r++,e)}return{value:void 0,done:!0}}))},e}(O);zr.isStack=mr;var Sr,br=zr.prototype;function Ir(t,e,r,n){var i=Object.create(br);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Or(){return Sr||(Sr=Ir(0))}br[wr]=!0,br.shift=br.pop,br.unshift=br.push,br.unshiftAll=br.pushAll,br.withMutations=je,br.wasAltered=xe,br.asImmutable=De,br["@@transducer/init"]=br.asMutable=Me,br["@@transducer/step"]=function(t,e){return t.unshift(e)},br["@@transducer/result"]=function(t){return t.asImmutable()};var Er="@@__IMMUTABLE_SET__@@";function qr(t){return Boolean(t&&t[Er])}function jr(t){return qr(t)&&k(t)}function Mr(t,e){if(t===e)return!0;if(!d(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||w(t)!==w(e)||z(t)!==z(e)||k(t)!==k(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!S(t);if(k(t)){var n=t.entries();return e.every((function(t,e){var i=n.next().value;return i&&ht(i[1],t)&&(r||ht(i[0],e))}))&&n.next().done}var i=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{i=!0;var u=t;t=e,e=u}var s=!0,a=e.__iterate((function(e,n){if(r?!t.has(e):i?!ht(e,t.get(n,o)):!ht(t.get(n,o),e))return s=!1,!1}));return s&&t.size===a}function Dr(t,e){var r=function(r){t.prototype[r]=e[r]};return Object.keys(e).forEach(r),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(r),t}function xr(t){if(!t||"object"!=typeof t)return t;if(!d(t)){if(!ne(t))return t;t=X(t)}if(w(t)){var e={};return t.__iterate((function(t,r){e[r]=xr(t)})),e}var r=[];return t.__iterate((function(t){r.push(xr(t))})),r}var Ar=function(t){function e(e){return null==e?Br():qr(e)&&!k(e)?e:Br().withMutations((function(r){var n=t(e);$t(n.size),n.forEach((function(t){return r.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(I(t).keySeq())},e.intersect=function(t){return(t=b(t).toArray()).length?Rr.intersect.apply(e(t.pop()),t):Br()},e.union=function(t){return(t=b(t).toArray()).length?Rr.union.apply(e(t.pop()),t):Br()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Ur(this,this._map.set(t,t))},e.prototype.remove=function(t){return Ur(this,this._map.remove(t))},e.prototype.clear=function(){return Ur(this,this._map.clear())},e.prototype.map=function(t,e){var r=this,n=!1,i=Ur(this,this._map.mapEntries((function(i){var o=i[1],u=t.call(e,o,o,r);return u!==o&&(n=!0),[u,u]}),e));return n?i:this},e.prototype.union=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return 0===(e=e.filter((function(t){return 0!==t.size}))).length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations((function(r){for(var n=0;n<e.length;n++)"string"==typeof e[n]?r.add(e[n]):t(e[n]).forEach((function(t){return r.add(t)}))})):this.constructor(e[0])},e.prototype.intersect=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(0===e.length)return this;e=e.map((function(e){return t(e)}));var n=[];return this.forEach((function(t){e.every((function(e){return e.includes(t)}))||n.push(t)})),this.withMutations((function(t){n.forEach((function(e){t.remove(e)}))}))},e.prototype.subtract=function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];if(0===e.length)return this;e=e.map((function(e){return t(e)}));var n=[];return this.forEach((function(t){e.some((function(e){return e.includes(t)}))&&n.push(t)})),this.withMutations((function(t){n.forEach((function(e){t.remove(e)}))}))},e.prototype.sort=function(t){return rn(Pt(this,t))},e.prototype.sortBy=function(t,e){return rn(Pt(this,e,t))},e.prototype.wasAltered=function(){return this._map.wasAltered()},e.prototype.__iterate=function(t,e){var r=this;return this._map.__iterate((function(e){return t(e,e,r)}),e)},e.prototype.__iterator=function(t,e){return this._map.__iterator(t,e)},e.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):0===this.size?this.__empty():(this.__ownerID=t,this._map=e,this)},e}(E);Ar.isSet=qr;var kr,Rr=Ar.prototype;function Ur(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function Tr(t,e){var r=Object.create(Rr);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Br(){return kr||(kr=Tr(He()))}Rr[Er]=!0,Rr[e]=Rr.remove,Rr.merge=Rr.concat=Rr.union,Rr.withMutations=je,Rr.asImmutable=De,Rr["@@transducer/init"]=Rr.asMutable=Me,Rr["@@transducer/step"]=function(t,e){return t.add(e)},Rr["@@transducer/result"]=function(t){return t.asImmutable()},Rr.__empty=Br,Rr.__make=Tr;var Kr,Lr=function(t){function e(t,r,n){if(void 0===n&&(n=1),!(this instanceof e))return new e(t,r,n);if(Zt(0!==n,"Cannot step a Range by 0"),Zt(void 0!==t,"You must define a start value when using Range"),Zt(void 0!==r,"You must define an end value when using Range"),n=Math.abs(n),r<t&&(n=-n),this._start=t,this._end=r,this._step=n,this.size=Math.max(0,Math.ceil((r-t)/n-1)+1),0===this.size){if(Kr)return Kr;Kr=this}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(1!==this._step?" by "+this._step:"")+" ]"},e.prototype.get=function(t,e){return this.has(t)?this._start+c(this,t)*this._step:e},e.prototype.includes=function(t){var e=(t-this._start)/this._step;return e>=0&&e<this.size&&e===Math.floor(e)},e.prototype.slice=function(t,r){return h(t,r,this.size)?this:(t=p(t,this.size),(r=_(r,this.size))<=t?new e(0,0):new e(this.get(t,this._end),this.get(r,this._end),this._step))},e.prototype.indexOf=function(t){var e=t-this._start;if(e%this._step==0){var r=e/this._step;if(r>=0&&r<this.size)return r}return-1},e.prototype.lastIndexOf=function(t){return this.indexOf(t)},e.prototype.__iterate=function(t,e){for(var r=this.size,n=this._step,i=e?this._start+(r-1)*n:this._start,o=0;o!==r&&!1!==t(i,e?r-++o:o++,this);)i+=e?-n:n;return o},e.prototype.__iterator=function(t,e){var r=this.size,n=this._step,i=e?this._start+(r-1)*n:this._start,o=0;return new C((function(){if(o===r)return{value:void 0,done:!0};var u=i;return i+=e?-n:n,P(t,e?r-++o:o++,u)}))},e.prototype.equals=function(t){return t instanceof e?this._start===t._start&&this._end===t._end&&this._step===t._step:Mr(this,t)},e}(G);function Cr(t,e,r){for(var n=te(e),i=0;i!==n.length;)if((t=ue(t,n[i++],o))===o)return r;return t}function Pr(t,e){return Cr(this,t,e)}function Wr(t,e){return Cr(t,e,o)!==o}function Nr(){$t(this.size);var t={};return this.__iterate((function(e,r){t[r]=e})),t}b.Iterator=C,Dr(b,{toArray:function(){$t(this.size);var t=new Array(this.size||0),e=w(this),r=0;return this.__iterate((function(n,i){t[r++]=e?[i,n]:n})),t},toIndexedSeq:function(){return new xt(this)},toJS:function(){return xr(this)},toKeyedSeq:function(){return new Dt(this,!0)},toMap:function(){return Ae(this.toKeyedSeq())},toObject:Nr,toOrderedMap:function(){return vr(this.toKeyedSeq())},toOrderedSet:function(){return rn(w(this)?this.valueSeq():this)},toSet:function(){return Ar(w(this)?this.valueSeq():this)},toSetSeq:function(){return new At(this)},toSeq:function(){return z(this)?this.toIndexedSeq():w(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return zr(w(this)?this.valueSeq():this)},toList:function(){return rr(w(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Jt(this,function(t,e){var r=w(t),n=[t].concat(e).map((function(t){return d(t)?r&&(t=I(t)):t=r?it(t):ot(Array.isArray(t)?t:[t]),t})).filter((function(t){return 0!==t.size}));if(0===n.length)return t;if(1===n.length){var i=n[0];if(i===t||r&&w(i)||z(t)&&z(i))return i}var o=new $(n);return r?o=o.toKeyedSeq():z(t)||(o=o.toSetSeq()),(o=o.flatten(!0)).size=n.reduce((function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}}),0),o}(this,t))},includes:function(t){return this.some((function(e){return ht(e,t)}))},entries:function(){return this.__iterator(T)},every:function(t,e){$t(this.size);var r=!0;return this.__iterate((function(n,i,o){if(!t.call(e,n,i,o))return r=!1,!1})),r},filter:function(t,e){return Jt(this,Bt(this,t,e,!0))},partition:function(t,e){return function(t,e,r){var n=w(t),i=[[],[]];t.__iterate((function(o,u){i[e.call(r,o,u,t)?1:0].push(n?[u,o]:o)}));var o=Yt(t);return i.map((function(e){return Jt(t,o(e))}))}(this,t,e)},find:function(t,e,r){var n=this.findEntry(t,e);return n?n[1]:r},forEach:function(t,e){return $t(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){$t(this.size),t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate((function(n){r?r=!1:e+=t,e+=null!=n?n.toString():""})),e},keys:function(){return this.__iterator(R)},map:function(t,e){return Jt(this,Ut(this,t,e))},reduce:function(t,e,r){return Qr(this,t,e,r,arguments.length<2,!1)},reduceRight:function(t,e,r){return Qr(this,t,e,r,arguments.length<2,!0)},reverse:function(){return Jt(this,Tt(this,!0))},slice:function(t,e){return Jt(this,Kt(this,t,e,!0))},some:function(t,e){$t(this.size);var r=!1;return this.__iterate((function(n,i,o){if(t.call(e,n,i,o))return r=!0,!1})),r},sort:function(t){return Jt(this,Pt(this,t))},values:function(){return this.__iterator(U)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(t,e){return a(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return function(t,e,r){var n=Ae().asMutable();return t.__iterate((function(i,o){n.update(e.call(r,i,o,t),0,(function(t){return t+1}))})),n.asImmutable()}(this,t,e)},equals:function(t){return Mr(this,t)},entrySeq:function(){var t=this;if(t._cache)return new $(t._cache);var e=t.toSeq().map(Fr).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(Gr(t),e)},findEntry:function(t,e,r){var n=r;return this.__iterate((function(r,i,o){if(t.call(e,r,i,o))return n=[i,r],!1})),n},findKey:function(t,e){var r=this.findEntry(t,e);return r&&r[0]},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},findLastEntry:function(t,e,r){return this.toKeyedSeq().reverse().findEntry(t,e,r)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(t){return this.find(f,null,t)},flatMap:function(t,e){return Jt(this,function(t,e,r){var n=Yt(t);return t.toSeq().map((function(i,o){return n(e.call(r,i,o,t))})).flatten(!0)}(this,t,e))},flatten:function(t){return Jt(this,Ct(this,t,!0))},fromEntrySeq:function(){return new kt(this)},get:function(t,e){return this.find((function(e,r){return ht(r,t)}),void 0,e)},getIn:Pr,groupBy:function(t,e){return function(t,e,r){var n=w(t),i=(k(t)?vr():Ae()).asMutable();t.__iterate((function(o,u){i.update(e.call(r,o,u,t),(function(t){return(t=t||[]).push(n?[u,o]:o),t}))}));var o=Yt(t);return i.map((function(e){return Jt(t,o(e))})).asImmutable()}(this,t,e)},has:function(t){return this.get(t,o)!==o},hasIn:function(t){return Wr(this,t)},isSubset:function(t){return t="function"==typeof t.includes?t:b(t),this.every((function(e){return t.includes(e)}))},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:b(t)).isSubset(this)},keyOf:function(t){return this.findKey((function(e){return ht(e,t)}))},keySeq:function(){return this.toSeq().map(Xr).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Wt(this,t)},maxBy:function(t,e){return Wt(this,e,t)},min:function(t){return Wt(this,t?Zr(t):tn)},minBy:function(t,e){return Wt(this,e?Zr(e):tn,t)},rest:function(){return this.slice(1)},skip:function(t){return 0===t?this:this.slice(Math.max(0,t))},skipLast:function(t){return 0===t?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,e){return Jt(this,Lt(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(Gr(t),e)},sortBy:function(t,e){return Jt(this,Pt(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,e){return Jt(this,function(t,e,r){var n=Qt(t);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var u=0;return t.__iterate((function(t,i,s){return e.call(r,t,i,s)&&++u&&n(t,i,o)})),u},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var u=t.__iterator(T,i),s=!0;return new C((function(){if(!s)return{value:void 0,done:!0};var t=u.next();if(t.done)return t;var i=t.value,a=i[0],c=i[1];return e.call(r,c,a,o)?n===T?t:P(n,a,c,t):(s=!1,{value:void 0,done:!0})}))},n}(this,t,e))},takeUntil:function(t,e){return this.takeWhile(Gr(t),e)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=function(t){if(t.size===1/0)return 0;var e=k(t),r=w(t),n=e?1:0;return t.__iterate(r?e?function(t,e){n=31*n+en(vt(t),vt(e))|0}:function(t,e){n=n+en(vt(t),vt(e))|0}:e?function(t){n=31*n+vt(t)|0}:function(t){n=n+vt(t)|0}),function(t,e){return e=pt(e,3432918353),e=pt(e<<15|e>>>-15,461845907),e=pt(e<<13|e>>>-13,5),e=pt((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=_t((e=pt(e^e>>>13,3266489909))^e>>>16)}(t.size,n)}(this))}});var Hr=b.prototype;Hr[y]=!0,Hr[L]=Hr.values,Hr.toJSON=Hr.toArray,Hr.__toStringMapper=ie,Hr.inspect=Hr.toSource=function(){return this.toString()},Hr.chain=Hr.flatMap,Hr.contains=Hr.includes,Dr(I,{flip:function(){return Jt(this,Rt(this))},mapEntries:function(t,e){var r=this,n=0;return Jt(this,this.toSeq().map((function(i,o){return t.call(e,[o,i],n++,r)})).fromEntrySeq())},mapKeys:function(t,e){var r=this;return Jt(this,this.toSeq().flip().map((function(n,i){return t.call(e,n,i,r)})).flip())}});var Jr=I.prototype;Jr[g]=!0,Jr[L]=Hr.entries,Jr.toJSON=Nr,Jr.__toStringMapper=function(t,e){return ie(e)+": "+ie(t)},Dr(O,{toKeyedSeq:function(){return new Dt(this,!1)},filter:function(t,e){return Jt(this,Bt(this,t,e,!1))},findIndex:function(t,e){var r=this.findEntry(t,e);return r?r[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return Jt(this,Tt(this,!1))},slice:function(t,e){return Jt(this,Kt(this,t,e,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(e||0,0),0===r||2===r&&!e)return this;t=p(t,t<0?this.count():this.size);var n=this.slice(0,t);return Jt(this,1===r?n:n.concat(Gt(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.findLastEntry(t,e);return r?r[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Jt(this,Ct(this,t,!1))},get:function(t,e){return(t=c(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find((function(e,r){return r===t}),void 0,e)},has:function(t){return(t=c(this,t))>=0&&(void 0!==this.size?this.size===1/0||t<this.size:-1!==this.indexOf(t))},interpose:function(t){return Jt(this,function(t,e){var r=Qt(t);return r.size=t.size&&2*t.size-1,r.__iterateUncached=function(r,n){var i=this,o=0;return t.__iterate((function(t){return(!o||!1!==r(e,o++,i))&&!1!==r(t,o++,i)}),n),o},r.__iteratorUncached=function(r,n){var i,o=t.__iterator(U,n),u=0;return new C((function(){return(!i||u%2)&&(i=o.next()).done?i:u%2?P(r,u++,e):P(r,u++,i.value,i)}))},r}(this,t))},interleave:function(){var t=[this].concat(Gt(arguments)),e=Ht(this.toSeq(),G.of,t),r=e.flatten(!0);return e.size&&(r.size=e.size*t.length),Jt(this,r)},keySeq:function(){return Lr(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,e){return Jt(this,Lt(this,t,e,!1))},zip:function(){return Jt(this,Ht(this,$r,[this].concat(Gt(arguments))))},zipAll:function(){return Jt(this,Ht(this,$r,[this].concat(Gt(arguments)),!0))},zipWith:function(t){var e=Gt(arguments);return e[0]=this,Jt(this,Ht(this,t,e))}});var Vr=O.prototype;Vr[m]=!0,Vr[A]=!0,Dr(E,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});var Yr=E.prototype;function Qr(t,e,r,n,i,o){return $t(t.size),t.__iterate((function(t,o,u){i?(i=!1,r=t):r=e.call(n,r,t,o,u)}),o),r}function Xr(t,e){return e}function Fr(t,e){return[e,t]}function Gr(t){return function(){return!t.apply(this,arguments)}}function Zr(t){return function(){return-t.apply(this,arguments)}}function $r(){return Gt(arguments)}function tn(t,e){return t<e?1:t>e?-1:0}function en(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}Yr.has=Hr.includes,Yr.contains=Yr.includes,Yr.keys=Yr.values,Dr(F,Jr),Dr(G,Vr),Dr(Z,Yr);var rn=function(t){function e(t){return null==t?sn():jr(t)?t:sn().withMutations((function(e){var r=E(t);$t(r.size),r.forEach((function(t){return e.add(t)}))}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.fromKeys=function(t){return this(I(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Ar);rn.isOrderedSet=jr;var nn,on=rn.prototype;function un(t,e){var r=Object.create(on);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function sn(){return nn||(nn=un(dr()))}on[A]=!0,on.zip=Vr.zip,on.zipWith=Vr.zipWith,on.zipAll=Vr.zipAll,on.__empty=sn,on.__make=un;var an=function(t,e){var r;!function(t){if(D(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(x(t))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(null===t||"object"!=typeof t)throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}(t);var n=function(o){var u=this;if(o instanceof n)return o;if(!(this instanceof n))return new n(o);if(!r){r=!0;var s=Object.keys(t),a=i._indices={};i._name=e,i._keys=s,i._defaultValues=t;for(var c=0;c<s.length;c++){var f=s[c];a[f]=c,i[f]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+hn(this)+' with property "'+f+'" since that property name is part of the Record API.'):_n(i,f)}}return this.__ownerID=void 0,this._values=rr().withMutations((function(t){t.setSize(u._keys.length),I(o).forEach((function(e,r){t.set(u._indices[r],e===u._defaultValues[r]?void 0:e)}))})),this},i=n.prototype=Object.create(cn);return i.constructor=n,e&&(n.displayName=e),n};an.prototype.toString=function(){for(var t,e=hn(this)+" { ",r=this._keys,n=0,i=r.length;n!==i;n++)e+=(n?", ":"")+(t=r[n])+": "+ie(this.get(t));return e+" }"},an.prototype.equals=function(t){return this===t||D(t)&&pn(this).equals(pn(t))},an.prototype.hashCode=function(){return pn(this).hashCode()},an.prototype.has=function(t){return this._indices.hasOwnProperty(t)},an.prototype.get=function(t,e){if(!this.has(t))return e;var r=this._indices[t],n=this._values.get(r);return void 0===n?this._defaultValues[t]:n},an.prototype.set=function(t,e){if(this.has(t)){var r=this._values.set(this._indices[t],e===this._defaultValues[t]?void 0:e);if(r!==this._values&&!this.__ownerID)return fn(this,r)}return this},an.prototype.remove=function(t){return this.set(t)},an.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:fn(this,t)},an.prototype.wasAltered=function(){return this._values.wasAltered()},an.prototype.toSeq=function(){return pn(this)},an.prototype.toJS=function(){return xr(this)},an.prototype.entries=function(){return this.__iterator(T)},an.prototype.__iterator=function(t,e){return pn(this).__iterator(t,e)},an.prototype.__iterate=function(t,e){return pn(this).__iterate(t,e)},an.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._values.__ensureOwner(t);return t?fn(this,e,t):(this.__ownerID=t,this._values=e,this)},an.isRecord=D,an.getDescriptiveName=hn;var cn=an.prototype;function fn(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._values=e,n.__ownerID=r,n}function hn(t){return t.constructor.displayName||t.constructor.name||"Record"}function pn(t){return it(t._keys.map((function(e){return[e,t.get(e)]})))}function _n(t,e){try{Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){Zt(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}catch(t){}}cn[M]=!0,cn[e]=cn.remove,cn.deleteIn=cn.removeIn=ve,cn.getIn=Pr,cn.hasIn=Hr.hasIn,cn.merge=we,cn.mergeWith=me,cn.mergeIn=Ee,cn.mergeDeep=Ie,cn.mergeDeepWith=Oe,cn.mergeDeepIn=qe,cn.setIn=_e,cn.update=de,cn.updateIn=ge,cn.withMutations=je,cn.asMutable=Me,cn.asImmutable=De,cn[L]=cn.entries,cn.toJSON=cn.toObject=Hr.toObject,cn.inspect=cn.toSource=function(){return this.toString()};var ln,vn=function(t){function e(t,r){if(!(this instanceof e))return new e(t,r);if(this._value=t,this.size=void 0===r?1/0:Math.max(0,r),0===this.size){if(ln)return ln;ln=this}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},e.prototype.get=function(t,e){return this.has(t)?this._value:e},e.prototype.includes=function(t){return ht(this._value,t)},e.prototype.slice=function(t,r){var n=this.size;return h(t,r,n)?this:new e(this._value,_(r,n)-p(t,n))},e.prototype.reverse=function(){return this},e.prototype.indexOf=function(t){return ht(this._value,t)?0:-1},e.prototype.lastIndexOf=function(t){return ht(this._value,t)?this.size:-1},e.prototype.__iterate=function(t,e){for(var r=this.size,n=0;n!==r&&!1!==t(this._value,e?r-++n:n++,this););return n},e.prototype.__iterator=function(t,e){var r=this,n=this.size,i=0;return new C((function(){return i===n?{value:void 0,done:!0}:P(t,e?n-++i:i++,r._value)}))},e.prototype.equals=function(t){return t instanceof e?ht(this._value,t._value):Mr(this,t)},e}(G);function yn(t,e,r,n,i,o){if("string"!=typeof r&&!x(r)&&(Q(r)||N(r)||re(r))){if(~t.indexOf(r))throw new TypeError("Cannot convert circular structure to Immutable");t.push(r),i&&""!==n&&i.push(n);var u=e.call(o,n,X(r).map((function(n,o){return yn(t,e,n,o,i,r)})),i&&i.slice());return t.pop(),i&&i.pop(),u}return r}function dn(t,e){return z(e)?e.toList():w(e)?e.toMap():e.toSet()}var gn=b;t.Collection=b,t.Iterable=gn,t.List=rr,t.Map=Ae,t.OrderedMap=vr,t.OrderedSet=rn,t.PairSorting={LeftThenRight:-1,RightThenLeft:1},t.Range=Lr,t.Record=an,t.Repeat=vn,t.Seq=X,t.Set=Ar,t.Stack=zr,t.fromJS=function(t,e){return yn([],e||dn,t,"",e&&e.length>2?[]:void 0,{"":t})},t.get=ue,t.getIn=Cr,t.has=oe,t.hasIn=Wr,t.hash=vt,t.is=ht,t.isAssociative=S,t.isCollection=d,t.isImmutable=x,t.isIndexed=z,t.isKeyed=w,t.isList=er,t.isMap=at,t.isOrdered=k,t.isOrderedMap=ct,t.isOrderedSet=jr,t.isPlainObject=re,t.isRecord=D,t.isSeq=j,t.isSet=qr,t.isStack=mr,t.isValueObject=ft,t.merge=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return be(t,e)},t.mergeDeep=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return Se(t,e)},t.mergeDeepWith=function(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return Se(e,r,t)},t.mergeWith=function(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return be(e,r,t)},t.remove=ae,t.removeIn=le,t.set=ce,t.setIn=pe,t.update=ye,t.updateIn=fe,t.version="5.0.0-rc.2"}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "immutable",
3
- "version": "5.0.0-beta.5",
3
+ "version": "5.0.0-rc.2",
4
4
  "description": "Immutable Data Collections",
5
5
  "license": "MIT",
6
6
  "homepage": "https://immutable-js.com",