immutable 5.1.6 → 5.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/immutable.d.ts +2 -0
- package/dist/immutable.es.js +166 -19
- package/dist/immutable.js +166 -19
- package/dist/immutable.min.js +1 -1
- package/package.json +1 -1
package/dist/immutable.d.ts
CHANGED
|
@@ -4219,6 +4219,7 @@ declare namespace Immutable {
|
|
|
4219
4219
|
*
|
|
4220
4220
|
* @see `Array#reduce`.
|
|
4221
4221
|
*/
|
|
4222
|
+
reduce(reducer: (reduction: V, value: V, key: K, iter: this) => V): V;
|
|
4222
4223
|
reduce<R>(
|
|
4223
4224
|
reducer: (reduction: R, value: V, key: K, iter: this) => R,
|
|
4224
4225
|
initialReduction: R,
|
|
@@ -4234,6 +4235,7 @@ declare namespace Immutable {
|
|
|
4234
4235
|
* Note: Similar to this.reverse().reduce(), and provided for parity
|
|
4235
4236
|
* with `Array#reduceRight`.
|
|
4236
4237
|
*/
|
|
4238
|
+
reduceRight(reducer: (reduction: V, value: V, key: K, iter: this) => V): V;
|
|
4237
4239
|
reduceRight<R>(
|
|
4238
4240
|
reducer: (reduction: R, value: V, key: K, iter: this) => R,
|
|
4239
4241
|
initialReduction: R,
|
package/dist/immutable.es.js
CHANGED
|
@@ -856,6 +856,26 @@ function hashString(string) {
|
|
|
856
856
|
}
|
|
857
857
|
return smi(hashed);
|
|
858
858
|
}
|
|
859
|
+
// Per-process seed for the secondary collision hash. Never exposed nor
|
|
860
|
+
// serialized, so the public `hash()` stays deterministic. An odd base in
|
|
861
|
+
// [3, 2^20) keeps `base * h` exact as a double (no `Math.imul`).
|
|
862
|
+
var COLLISION_HASH_BASE = ((Math.random() * 0x100000) | 1) % 0x100000 || 0x9e37;
|
|
863
|
+
// Secondary hash to index entries within a `HashCollisionNode`, where every key
|
|
864
|
+
// shares the same primary `hash()`. Using a different, seeded base scatters
|
|
865
|
+
// crafted collision families (e.g. "Aa"/"BB", which only collide under base 31)
|
|
866
|
+
// that an attacker cannot precompute without the seed. It only narrows
|
|
867
|
+
// candidates — `is()` still decides equality — so non-string keys can safely
|
|
868
|
+
// fall back to the (here constant) primary hash and a linear scan.
|
|
869
|
+
function hashCollisionKey(key) {
|
|
870
|
+
if (typeof key !== 'string') {
|
|
871
|
+
return hash(key);
|
|
872
|
+
}
|
|
873
|
+
var hashed = 0;
|
|
874
|
+
for (var ii = 0; ii < key.length; ii++) {
|
|
875
|
+
hashed = (COLLISION_HASH_BASE * hashed + key.charCodeAt(ii)) | 0;
|
|
876
|
+
}
|
|
877
|
+
return hashed;
|
|
878
|
+
}
|
|
859
879
|
function hashSymbol(sym) {
|
|
860
880
|
var hashed = symbolMap[sym];
|
|
861
881
|
if (hashed !== undefined) {
|
|
@@ -2788,20 +2808,79 @@ HashArrayMapNode.prototype.update = function update (ownerID, shift, keyHash, ke
|
|
|
2788
2808
|
return new HashArrayMapNode(ownerID, newCount, newNodes);
|
|
2789
2809
|
};
|
|
2790
2810
|
|
|
2811
|
+
/**
|
|
2812
|
+
* Trie leaf gathering entries whose keys all share the same 32-bit `hash()`.
|
|
2813
|
+
* The trie routes by hash, so colliding keys cannot be separated and land here
|
|
2814
|
+
* in a flat `entries` array, disambiguated by `is()`.
|
|
2815
|
+
*
|
|
2816
|
+
* To guard against hash-flooding DoS (CWE-407), large buckets build a secondary
|
|
2817
|
+
* index keyed by a per-process seeded hash (`hashCollisionKey`). `is()` still
|
|
2818
|
+
* decides equality, so the index can only ever narrow candidates, never lose a key.
|
|
2819
|
+
*/
|
|
2791
2820
|
var HashCollisionNode = function HashCollisionNode(ownerID, keyHash, entries) {
|
|
2792
2821
|
this.ownerID = ownerID;
|
|
2793
2822
|
this.keyHash = keyHash;
|
|
2794
2823
|
this.entries = entries;
|
|
2824
|
+
// Lazy `{ [secondaryHash]: number[] }`, built only past
|
|
2825
|
+
// MIN_HASH_COLLISION_INDEX_SIZE so small buckets keep their linear path.
|
|
2826
|
+
this._index = undefined;
|
|
2795
2827
|
};
|
|
2796
2828
|
|
|
2797
|
-
|
|
2829
|
+
// Returns the position of `key` in `this.entries`, or -1. Uses the secondary
|
|
2830
|
+
// index when present; builds it only when `buildIndex` is true (reads and
|
|
2831
|
+
// transient inserts, where the node is reused so the O(n) build amortizes).
|
|
2832
|
+
// Persistent inserts already pay an O(n) copy, so a throwaway index is skipped.
|
|
2833
|
+
HashCollisionNode.prototype._positionOf = function _positionOf (key, buildIndex) {
|
|
2834
|
+
var entries = this.entries;
|
|
2835
|
+
var index = this._index;
|
|
2836
|
+
if (
|
|
2837
|
+
index === undefined &&
|
|
2838
|
+
buildIndex &&
|
|
2839
|
+
entries.length >= MIN_HASH_COLLISION_INDEX_SIZE
|
|
2840
|
+
) {
|
|
2841
|
+
index = this._buildIndex();
|
|
2842
|
+
}
|
|
2843
|
+
if (index !== undefined) {
|
|
2844
|
+
var positions = index[hashCollisionKey(key)];
|
|
2845
|
+
if (positions !== undefined) {
|
|
2846
|
+
for (var jj = 0; jj < positions.length; jj++) {
|
|
2847
|
+
var ii = positions[jj];
|
|
2848
|
+
if (is(key, entries[ii][0])) {
|
|
2849
|
+
return ii;
|
|
2850
|
+
}
|
|
2851
|
+
}
|
|
2852
|
+
}
|
|
2853
|
+
return -1;
|
|
2854
|
+
}
|
|
2855
|
+
for (var ii$1 = 0, len = entries.length; ii$1 < len; ii$1++) {
|
|
2856
|
+
if (is(key, entries[ii$1][0])) {
|
|
2857
|
+
return ii$1;
|
|
2858
|
+
}
|
|
2859
|
+
}
|
|
2860
|
+
return -1;
|
|
2861
|
+
};
|
|
2862
|
+
|
|
2863
|
+
// Builds and memoizes the secondary index. A plain object, not `Map` — which
|
|
2864
|
+
// in this module resolves to the *Immutable* Map, not the native one.
|
|
2865
|
+
HashCollisionNode.prototype._buildIndex = function _buildIndex () {
|
|
2866
|
+
var index = Object.create(null);
|
|
2798
2867
|
var entries = this.entries;
|
|
2799
2868
|
for (var ii = 0, len = entries.length; ii < len; ii++) {
|
|
2800
|
-
|
|
2801
|
-
|
|
2869
|
+
var secondaryHash = hashCollisionKey(entries[ii][0]);
|
|
2870
|
+
var positions = index[secondaryHash];
|
|
2871
|
+
if (positions !== undefined) {
|
|
2872
|
+
positions.push(ii);
|
|
2873
|
+
} else {
|
|
2874
|
+
index[secondaryHash] = [ii];
|
|
2802
2875
|
}
|
|
2803
2876
|
}
|
|
2804
|
-
|
|
2877
|
+
this._index = index;
|
|
2878
|
+
return index;
|
|
2879
|
+
};
|
|
2880
|
+
|
|
2881
|
+
HashCollisionNode.prototype.get = function get (shift, keyHash, key, notSetValue) {
|
|
2882
|
+
var idx = this._positionOf(key, true);
|
|
2883
|
+
return idx === -1 ? notSetValue : this.entries[idx][1];
|
|
2805
2884
|
};
|
|
2806
2885
|
|
|
2807
2886
|
HashCollisionNode.prototype.update = function update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
|
|
@@ -2821,14 +2900,11 @@ HashCollisionNode.prototype.update = function update (ownerID, shift, keyHash, k
|
|
|
2821
2900
|
}
|
|
2822
2901
|
|
|
2823
2902
|
var entries = this.entries;
|
|
2824
|
-
var idx = 0;
|
|
2825
2903
|
var len = entries.length;
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
}
|
|
2831
|
-
var exists = idx < len;
|
|
2904
|
+
var isEditable = ownerID && ownerID === this.ownerID;
|
|
2905
|
+
var foundIdx = this._positionOf(key, isEditable);
|
|
2906
|
+
var idx = foundIdx === -1 ? len : foundIdx;
|
|
2907
|
+
var exists = foundIdx !== -1;
|
|
2832
2908
|
|
|
2833
2909
|
if (exists ? entries[idx][1] === value : removed) {
|
|
2834
2910
|
return this;
|
|
@@ -2842,7 +2918,6 @@ HashCollisionNode.prototype.update = function update (ownerID, shift, keyHash, k
|
|
|
2842
2918
|
return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]);
|
|
2843
2919
|
}
|
|
2844
2920
|
|
|
2845
|
-
var isEditable = ownerID && ownerID === this.ownerID;
|
|
2846
2921
|
var newEntries = isEditable ? entries : arrCopy(entries);
|
|
2847
2922
|
|
|
2848
2923
|
if (exists) {
|
|
@@ -2851,11 +2926,27 @@ HashCollisionNode.prototype.update = function update (ownerID, shift, keyHash, k
|
|
|
2851
2926
|
idx === len - 1
|
|
2852
2927
|
? newEntries.pop()
|
|
2853
2928
|
: (newEntries[idx] = newEntries.pop());
|
|
2929
|
+
// The swap-pop reshuffles positions; drop the stale index (rebuilt lazily).
|
|
2930
|
+
if (isEditable) {
|
|
2931
|
+
this._index = undefined;
|
|
2932
|
+
}
|
|
2854
2933
|
} else {
|
|
2934
|
+
// Same key, same position: the index stays valid.
|
|
2855
2935
|
newEntries[idx] = [key, value];
|
|
2856
2936
|
}
|
|
2857
2937
|
} else {
|
|
2858
2938
|
newEntries.push([key, value]);
|
|
2939
|
+
// Keep the index in sync on the transient insert path. Persistent inserts
|
|
2940
|
+
// return a fresh node below whose index rebuilds lazily, so skip them.
|
|
2941
|
+
if (isEditable && this._index !== undefined) {
|
|
2942
|
+
var secondaryHash = hashCollisionKey(key);
|
|
2943
|
+
var positions = this._index[secondaryHash];
|
|
2944
|
+
if (positions !== undefined) {
|
|
2945
|
+
positions.push(len);
|
|
2946
|
+
} else {
|
|
2947
|
+
this._index[secondaryHash] = [len];
|
|
2948
|
+
}
|
|
2949
|
+
}
|
|
2859
2950
|
}
|
|
2860
2951
|
|
|
2861
2952
|
if (isEditable) {
|
|
@@ -3189,6 +3280,12 @@ var MAX_ARRAY_MAP_SIZE = SIZE / 4;
|
|
|
3189
3280
|
var MAX_BITMAP_INDEXED_SIZE = SIZE / 2;
|
|
3190
3281
|
var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;
|
|
3191
3282
|
|
|
3283
|
+
// Above this many colliding entries, a `HashCollisionNode` builds a seeded
|
|
3284
|
+
// secondary index instead of scanning linearly. Kept small so the rare,
|
|
3285
|
+
// naturally-occurring collision buckets stay overhead-free, while adversarial
|
|
3286
|
+
// hash-flooding (thousands of keys sharing one hash) degrades gracefully.
|
|
3287
|
+
var MIN_HASH_COLLISION_INDEX_SIZE = 16;
|
|
3288
|
+
|
|
3192
3289
|
function coerceKeyPath(keyPath) {
|
|
3193
3290
|
if (isArrayLike(keyPath) && typeof keyPath !== 'string') {
|
|
3194
3291
|
return keyPath;
|
|
@@ -3888,7 +3985,39 @@ function listNodeFor(list, rawIndex) {
|
|
|
3888
3985
|
}
|
|
3889
3986
|
}
|
|
3890
3987
|
|
|
3988
|
+
/**
|
|
3989
|
+
* Validates requested bounds before int32 coercion in setListBounds().
|
|
3990
|
+
* Throws when origin/capacity would exceed the trie's safe range.
|
|
3991
|
+
*/
|
|
3992
|
+
function validateListBoundsRequest(list, begin, end) {
|
|
3993
|
+
var requestedOrigin = list._origin + (begin === undefined ? 0 : begin);
|
|
3994
|
+
var requestedCapacity =
|
|
3995
|
+
end === undefined
|
|
3996
|
+
? list._capacity
|
|
3997
|
+
: end < 0
|
|
3998
|
+
? list._capacity + end
|
|
3999
|
+
: list._origin + end;
|
|
4000
|
+
|
|
4001
|
+
// Keep origin/capacity within the trie's safe signed 32-bit range.
|
|
4002
|
+
if (
|
|
4003
|
+
(Number.isFinite(requestedCapacity) && requestedCapacity > MAX_LIST_SIZE) ||
|
|
4004
|
+
(Number.isFinite(requestedOrigin) && requestedOrigin < -MAX_LIST_SIZE) ||
|
|
4005
|
+
(Number.isFinite(requestedCapacity) &&
|
|
4006
|
+
Number.isFinite(requestedOrigin) &&
|
|
4007
|
+
requestedCapacity - requestedOrigin > MAX_LIST_SIZE)
|
|
4008
|
+
) {
|
|
4009
|
+
throw new RangeError(
|
|
4010
|
+
'Invalid List size: a List cannot hold more than ' +
|
|
4011
|
+
MAX_LIST_SIZE +
|
|
4012
|
+
' (2 ** 30) values.'
|
|
4013
|
+
);
|
|
4014
|
+
}
|
|
4015
|
+
}
|
|
4016
|
+
|
|
3891
4017
|
function setListBounds(list, begin, end) {
|
|
4018
|
+
// Validate full-precision bounds before int32 coercion.
|
|
4019
|
+
validateListBoundsRequest(list, begin, end);
|
|
4020
|
+
|
|
3892
4021
|
// Sanitize begin & end using this shorthand for ToInt32(argument)
|
|
3893
4022
|
// http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
|
|
3894
4023
|
if (begin !== undefined) {
|
|
@@ -3927,7 +4056,8 @@ function setListBounds(list, begin, end) {
|
|
|
3927
4056
|
owner
|
|
3928
4057
|
);
|
|
3929
4058
|
newLevel += SHIFT;
|
|
3930
|
-
|
|
4059
|
+
// Shift origin into non-negative space as trie height grows.
|
|
4060
|
+
offsetShift += levelCapacity(newLevel);
|
|
3931
4061
|
}
|
|
3932
4062
|
if (offsetShift) {
|
|
3933
4063
|
newOrigin += offsetShift;
|
|
@@ -3940,7 +4070,7 @@ function setListBounds(list, begin, end) {
|
|
|
3940
4070
|
var newTailOffset = getTailOffset(newCapacity);
|
|
3941
4071
|
|
|
3942
4072
|
// New size might need creating a higher root.
|
|
3943
|
-
while (newTailOffset >=
|
|
4073
|
+
while (newTailOffset >= levelCapacity(newLevel + SHIFT)) {
|
|
3944
4074
|
newRoot = new VNode(
|
|
3945
4075
|
newRoot && newRoot.array.length ? [newRoot] : [],
|
|
3946
4076
|
owner
|
|
@@ -4038,6 +4168,19 @@ function getTailOffset(size) {
|
|
|
4038
4168
|
return size < SIZE ? 0 : ((size - 1) >>> SHIFT) << SHIFT;
|
|
4039
4169
|
}
|
|
4040
4170
|
|
|
4171
|
+
// The largest number of values a List can hold. Above this the 32-bit trie math
|
|
4172
|
+
// in setListBounds() stays in the safe signed 32-bit range.
|
|
4173
|
+
var MAX_LIST_SIZE = Math.pow( 2, 30 ); // 1073741824
|
|
4174
|
+
|
|
4175
|
+
/**
|
|
4176
|
+
* Computes 2 ** exp for the trie level-raising loops in setListBounds().
|
|
4177
|
+
* Use the cheap bitwise operator shift whenever possible, otherwise fall back to exponentiation.
|
|
4178
|
+
* This is necessary because bitwise operators in JavaScript only work on 32-bit signed integers, so for exp >= 31, we need to use exponentiation to avoid overflow.
|
|
4179
|
+
*/
|
|
4180
|
+
function levelCapacity(exp) {
|
|
4181
|
+
return exp < 31 ? 1 << exp : Math.pow( 2, exp );
|
|
4182
|
+
}
|
|
4183
|
+
|
|
4041
4184
|
/**
|
|
4042
4185
|
* True if `maybeOrderedMap` is an OrderedMap.
|
|
4043
4186
|
*/
|
|
@@ -4453,6 +4596,9 @@ function reduce(collection, reducer, reduction, context, useFirst, reverse) {
|
|
|
4453
4596
|
reduction = v;
|
|
4454
4597
|
}
|
|
4455
4598
|
else {
|
|
4599
|
+
// `reduction` has already been seeded here (either with the provided
|
|
4600
|
+
// initial value or with the first iterated value), so it is never the
|
|
4601
|
+
// `undefined` placeholder — only a `V` or a `R`.
|
|
4456
4602
|
reduction = reducer.call(context, reduction, v, k, c);
|
|
4457
4603
|
}
|
|
4458
4604
|
}, reverse);
|
|
@@ -5637,11 +5783,12 @@ mixin(IndexedCollection, {
|
|
|
5637
5783
|
|
|
5638
5784
|
has: function has(index) {
|
|
5639
5785
|
index = wrapIndex(this, index);
|
|
5786
|
+
|
|
5640
5787
|
return (
|
|
5641
5788
|
index >= 0 &&
|
|
5642
5789
|
(this.size !== undefined
|
|
5643
5790
|
? this.size === Infinity || index < this.size
|
|
5644
|
-
: this.
|
|
5791
|
+
: this.find(function (_, key) { return key === index; }, undefined, NOT_SET) !== NOT_SET)
|
|
5645
5792
|
);
|
|
5646
5793
|
},
|
|
5647
5794
|
|
|
@@ -6102,15 +6249,15 @@ var Repeat = /*@__PURE__*/(function (IndexedSeq) {
|
|
|
6102
6249
|
};
|
|
6103
6250
|
|
|
6104
6251
|
Repeat.prototype.indexOf = function indexOf (searchValue) {
|
|
6105
|
-
if (is(this._value, searchValue)) {
|
|
6252
|
+
if (this.size !== 0 && is(this._value, searchValue)) {
|
|
6106
6253
|
return 0;
|
|
6107
6254
|
}
|
|
6108
6255
|
return -1;
|
|
6109
6256
|
};
|
|
6110
6257
|
|
|
6111
6258
|
Repeat.prototype.lastIndexOf = function lastIndexOf (searchValue) {
|
|
6112
|
-
if (is(this._value, searchValue)) {
|
|
6113
|
-
return this.size;
|
|
6259
|
+
if (this.size !== 0 && is(this._value, searchValue)) {
|
|
6260
|
+
return this.size - 1;
|
|
6114
6261
|
}
|
|
6115
6262
|
return -1;
|
|
6116
6263
|
};
|
|
@@ -6191,7 +6338,7 @@ function defaultConverter(k, v) {
|
|
|
6191
6338
|
return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet();
|
|
6192
6339
|
}
|
|
6193
6340
|
|
|
6194
|
-
var version = "5.1.
|
|
6341
|
+
var version = "5.1.8";
|
|
6195
6342
|
|
|
6196
6343
|
/* eslint-disable import/order */
|
|
6197
6344
|
|
package/dist/immutable.js
CHANGED
|
@@ -862,6 +862,26 @@
|
|
|
862
862
|
}
|
|
863
863
|
return smi(hashed);
|
|
864
864
|
}
|
|
865
|
+
// Per-process seed for the secondary collision hash. Never exposed nor
|
|
866
|
+
// serialized, so the public `hash()` stays deterministic. An odd base in
|
|
867
|
+
// [3, 2^20) keeps `base * h` exact as a double (no `Math.imul`).
|
|
868
|
+
var COLLISION_HASH_BASE = ((Math.random() * 0x100000) | 1) % 0x100000 || 0x9e37;
|
|
869
|
+
// Secondary hash to index entries within a `HashCollisionNode`, where every key
|
|
870
|
+
// shares the same primary `hash()`. Using a different, seeded base scatters
|
|
871
|
+
// crafted collision families (e.g. "Aa"/"BB", which only collide under base 31)
|
|
872
|
+
// that an attacker cannot precompute without the seed. It only narrows
|
|
873
|
+
// candidates — `is()` still decides equality — so non-string keys can safely
|
|
874
|
+
// fall back to the (here constant) primary hash and a linear scan.
|
|
875
|
+
function hashCollisionKey(key) {
|
|
876
|
+
if (typeof key !== 'string') {
|
|
877
|
+
return hash(key);
|
|
878
|
+
}
|
|
879
|
+
var hashed = 0;
|
|
880
|
+
for (var ii = 0; ii < key.length; ii++) {
|
|
881
|
+
hashed = (COLLISION_HASH_BASE * hashed + key.charCodeAt(ii)) | 0;
|
|
882
|
+
}
|
|
883
|
+
return hashed;
|
|
884
|
+
}
|
|
865
885
|
function hashSymbol(sym) {
|
|
866
886
|
var hashed = symbolMap[sym];
|
|
867
887
|
if (hashed !== undefined) {
|
|
@@ -2794,20 +2814,79 @@
|
|
|
2794
2814
|
return new HashArrayMapNode(ownerID, newCount, newNodes);
|
|
2795
2815
|
};
|
|
2796
2816
|
|
|
2817
|
+
/**
|
|
2818
|
+
* Trie leaf gathering entries whose keys all share the same 32-bit `hash()`.
|
|
2819
|
+
* The trie routes by hash, so colliding keys cannot be separated and land here
|
|
2820
|
+
* in a flat `entries` array, disambiguated by `is()`.
|
|
2821
|
+
*
|
|
2822
|
+
* To guard against hash-flooding DoS (CWE-407), large buckets build a secondary
|
|
2823
|
+
* index keyed by a per-process seeded hash (`hashCollisionKey`). `is()` still
|
|
2824
|
+
* decides equality, so the index can only ever narrow candidates, never lose a key.
|
|
2825
|
+
*/
|
|
2797
2826
|
var HashCollisionNode = function HashCollisionNode(ownerID, keyHash, entries) {
|
|
2798
2827
|
this.ownerID = ownerID;
|
|
2799
2828
|
this.keyHash = keyHash;
|
|
2800
2829
|
this.entries = entries;
|
|
2830
|
+
// Lazy `{ [secondaryHash]: number[] }`, built only past
|
|
2831
|
+
// MIN_HASH_COLLISION_INDEX_SIZE so small buckets keep their linear path.
|
|
2832
|
+
this._index = undefined;
|
|
2801
2833
|
};
|
|
2802
2834
|
|
|
2803
|
-
|
|
2835
|
+
// Returns the position of `key` in `this.entries`, or -1. Uses the secondary
|
|
2836
|
+
// index when present; builds it only when `buildIndex` is true (reads and
|
|
2837
|
+
// transient inserts, where the node is reused so the O(n) build amortizes).
|
|
2838
|
+
// Persistent inserts already pay an O(n) copy, so a throwaway index is skipped.
|
|
2839
|
+
HashCollisionNode.prototype._positionOf = function _positionOf (key, buildIndex) {
|
|
2840
|
+
var entries = this.entries;
|
|
2841
|
+
var index = this._index;
|
|
2842
|
+
if (
|
|
2843
|
+
index === undefined &&
|
|
2844
|
+
buildIndex &&
|
|
2845
|
+
entries.length >= MIN_HASH_COLLISION_INDEX_SIZE
|
|
2846
|
+
) {
|
|
2847
|
+
index = this._buildIndex();
|
|
2848
|
+
}
|
|
2849
|
+
if (index !== undefined) {
|
|
2850
|
+
var positions = index[hashCollisionKey(key)];
|
|
2851
|
+
if (positions !== undefined) {
|
|
2852
|
+
for (var jj = 0; jj < positions.length; jj++) {
|
|
2853
|
+
var ii = positions[jj];
|
|
2854
|
+
if (is(key, entries[ii][0])) {
|
|
2855
|
+
return ii;
|
|
2856
|
+
}
|
|
2857
|
+
}
|
|
2858
|
+
}
|
|
2859
|
+
return -1;
|
|
2860
|
+
}
|
|
2861
|
+
for (var ii$1 = 0, len = entries.length; ii$1 < len; ii$1++) {
|
|
2862
|
+
if (is(key, entries[ii$1][0])) {
|
|
2863
|
+
return ii$1;
|
|
2864
|
+
}
|
|
2865
|
+
}
|
|
2866
|
+
return -1;
|
|
2867
|
+
};
|
|
2868
|
+
|
|
2869
|
+
// Builds and memoizes the secondary index. A plain object, not `Map` — which
|
|
2870
|
+
// in this module resolves to the *Immutable* Map, not the native one.
|
|
2871
|
+
HashCollisionNode.prototype._buildIndex = function _buildIndex () {
|
|
2872
|
+
var index = Object.create(null);
|
|
2804
2873
|
var entries = this.entries;
|
|
2805
2874
|
for (var ii = 0, len = entries.length; ii < len; ii++) {
|
|
2806
|
-
|
|
2807
|
-
|
|
2875
|
+
var secondaryHash = hashCollisionKey(entries[ii][0]);
|
|
2876
|
+
var positions = index[secondaryHash];
|
|
2877
|
+
if (positions !== undefined) {
|
|
2878
|
+
positions.push(ii);
|
|
2879
|
+
} else {
|
|
2880
|
+
index[secondaryHash] = [ii];
|
|
2808
2881
|
}
|
|
2809
2882
|
}
|
|
2810
|
-
|
|
2883
|
+
this._index = index;
|
|
2884
|
+
return index;
|
|
2885
|
+
};
|
|
2886
|
+
|
|
2887
|
+
HashCollisionNode.prototype.get = function get (shift, keyHash, key, notSetValue) {
|
|
2888
|
+
var idx = this._positionOf(key, true);
|
|
2889
|
+
return idx === -1 ? notSetValue : this.entries[idx][1];
|
|
2811
2890
|
};
|
|
2812
2891
|
|
|
2813
2892
|
HashCollisionNode.prototype.update = function update (ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {
|
|
@@ -2827,14 +2906,11 @@
|
|
|
2827
2906
|
}
|
|
2828
2907
|
|
|
2829
2908
|
var entries = this.entries;
|
|
2830
|
-
var idx = 0;
|
|
2831
2909
|
var len = entries.length;
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
}
|
|
2837
|
-
var exists = idx < len;
|
|
2910
|
+
var isEditable = ownerID && ownerID === this.ownerID;
|
|
2911
|
+
var foundIdx = this._positionOf(key, isEditable);
|
|
2912
|
+
var idx = foundIdx === -1 ? len : foundIdx;
|
|
2913
|
+
var exists = foundIdx !== -1;
|
|
2838
2914
|
|
|
2839
2915
|
if (exists ? entries[idx][1] === value : removed) {
|
|
2840
2916
|
return this;
|
|
@@ -2848,7 +2924,6 @@
|
|
|
2848
2924
|
return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]);
|
|
2849
2925
|
}
|
|
2850
2926
|
|
|
2851
|
-
var isEditable = ownerID && ownerID === this.ownerID;
|
|
2852
2927
|
var newEntries = isEditable ? entries : arrCopy(entries);
|
|
2853
2928
|
|
|
2854
2929
|
if (exists) {
|
|
@@ -2857,11 +2932,27 @@
|
|
|
2857
2932
|
idx === len - 1
|
|
2858
2933
|
? newEntries.pop()
|
|
2859
2934
|
: (newEntries[idx] = newEntries.pop());
|
|
2935
|
+
// The swap-pop reshuffles positions; drop the stale index (rebuilt lazily).
|
|
2936
|
+
if (isEditable) {
|
|
2937
|
+
this._index = undefined;
|
|
2938
|
+
}
|
|
2860
2939
|
} else {
|
|
2940
|
+
// Same key, same position: the index stays valid.
|
|
2861
2941
|
newEntries[idx] = [key, value];
|
|
2862
2942
|
}
|
|
2863
2943
|
} else {
|
|
2864
2944
|
newEntries.push([key, value]);
|
|
2945
|
+
// Keep the index in sync on the transient insert path. Persistent inserts
|
|
2946
|
+
// return a fresh node below whose index rebuilds lazily, so skip them.
|
|
2947
|
+
if (isEditable && this._index !== undefined) {
|
|
2948
|
+
var secondaryHash = hashCollisionKey(key);
|
|
2949
|
+
var positions = this._index[secondaryHash];
|
|
2950
|
+
if (positions !== undefined) {
|
|
2951
|
+
positions.push(len);
|
|
2952
|
+
} else {
|
|
2953
|
+
this._index[secondaryHash] = [len];
|
|
2954
|
+
}
|
|
2955
|
+
}
|
|
2865
2956
|
}
|
|
2866
2957
|
|
|
2867
2958
|
if (isEditable) {
|
|
@@ -3195,6 +3286,12 @@
|
|
|
3195
3286
|
var MAX_BITMAP_INDEXED_SIZE = SIZE / 2;
|
|
3196
3287
|
var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;
|
|
3197
3288
|
|
|
3289
|
+
// Above this many colliding entries, a `HashCollisionNode` builds a seeded
|
|
3290
|
+
// secondary index instead of scanning linearly. Kept small so the rare,
|
|
3291
|
+
// naturally-occurring collision buckets stay overhead-free, while adversarial
|
|
3292
|
+
// hash-flooding (thousands of keys sharing one hash) degrades gracefully.
|
|
3293
|
+
var MIN_HASH_COLLISION_INDEX_SIZE = 16;
|
|
3294
|
+
|
|
3198
3295
|
function coerceKeyPath(keyPath) {
|
|
3199
3296
|
if (isArrayLike(keyPath) && typeof keyPath !== 'string') {
|
|
3200
3297
|
return keyPath;
|
|
@@ -3894,7 +3991,39 @@
|
|
|
3894
3991
|
}
|
|
3895
3992
|
}
|
|
3896
3993
|
|
|
3994
|
+
/**
|
|
3995
|
+
* Validates requested bounds before int32 coercion in setListBounds().
|
|
3996
|
+
* Throws when origin/capacity would exceed the trie's safe range.
|
|
3997
|
+
*/
|
|
3998
|
+
function validateListBoundsRequest(list, begin, end) {
|
|
3999
|
+
var requestedOrigin = list._origin + (begin === undefined ? 0 : begin);
|
|
4000
|
+
var requestedCapacity =
|
|
4001
|
+
end === undefined
|
|
4002
|
+
? list._capacity
|
|
4003
|
+
: end < 0
|
|
4004
|
+
? list._capacity + end
|
|
4005
|
+
: list._origin + end;
|
|
4006
|
+
|
|
4007
|
+
// Keep origin/capacity within the trie's safe signed 32-bit range.
|
|
4008
|
+
if (
|
|
4009
|
+
(Number.isFinite(requestedCapacity) && requestedCapacity > MAX_LIST_SIZE) ||
|
|
4010
|
+
(Number.isFinite(requestedOrigin) && requestedOrigin < -MAX_LIST_SIZE) ||
|
|
4011
|
+
(Number.isFinite(requestedCapacity) &&
|
|
4012
|
+
Number.isFinite(requestedOrigin) &&
|
|
4013
|
+
requestedCapacity - requestedOrigin > MAX_LIST_SIZE)
|
|
4014
|
+
) {
|
|
4015
|
+
throw new RangeError(
|
|
4016
|
+
'Invalid List size: a List cannot hold more than ' +
|
|
4017
|
+
MAX_LIST_SIZE +
|
|
4018
|
+
' (2 ** 30) values.'
|
|
4019
|
+
);
|
|
4020
|
+
}
|
|
4021
|
+
}
|
|
4022
|
+
|
|
3897
4023
|
function setListBounds(list, begin, end) {
|
|
4024
|
+
// Validate full-precision bounds before int32 coercion.
|
|
4025
|
+
validateListBoundsRequest(list, begin, end);
|
|
4026
|
+
|
|
3898
4027
|
// Sanitize begin & end using this shorthand for ToInt32(argument)
|
|
3899
4028
|
// http://www.ecma-international.org/ecma-262/6.0/#sec-toint32
|
|
3900
4029
|
if (begin !== undefined) {
|
|
@@ -3933,7 +4062,8 @@
|
|
|
3933
4062
|
owner
|
|
3934
4063
|
);
|
|
3935
4064
|
newLevel += SHIFT;
|
|
3936
|
-
|
|
4065
|
+
// Shift origin into non-negative space as trie height grows.
|
|
4066
|
+
offsetShift += levelCapacity(newLevel);
|
|
3937
4067
|
}
|
|
3938
4068
|
if (offsetShift) {
|
|
3939
4069
|
newOrigin += offsetShift;
|
|
@@ -3946,7 +4076,7 @@
|
|
|
3946
4076
|
var newTailOffset = getTailOffset(newCapacity);
|
|
3947
4077
|
|
|
3948
4078
|
// New size might need creating a higher root.
|
|
3949
|
-
while (newTailOffset >=
|
|
4079
|
+
while (newTailOffset >= levelCapacity(newLevel + SHIFT)) {
|
|
3950
4080
|
newRoot = new VNode(
|
|
3951
4081
|
newRoot && newRoot.array.length ? [newRoot] : [],
|
|
3952
4082
|
owner
|
|
@@ -4044,6 +4174,19 @@
|
|
|
4044
4174
|
return size < SIZE ? 0 : ((size - 1) >>> SHIFT) << SHIFT;
|
|
4045
4175
|
}
|
|
4046
4176
|
|
|
4177
|
+
// The largest number of values a List can hold. Above this the 32-bit trie math
|
|
4178
|
+
// in setListBounds() stays in the safe signed 32-bit range.
|
|
4179
|
+
var MAX_LIST_SIZE = Math.pow( 2, 30 ); // 1073741824
|
|
4180
|
+
|
|
4181
|
+
/**
|
|
4182
|
+
* Computes 2 ** exp for the trie level-raising loops in setListBounds().
|
|
4183
|
+
* Use the cheap bitwise operator shift whenever possible, otherwise fall back to exponentiation.
|
|
4184
|
+
* This is necessary because bitwise operators in JavaScript only work on 32-bit signed integers, so for exp >= 31, we need to use exponentiation to avoid overflow.
|
|
4185
|
+
*/
|
|
4186
|
+
function levelCapacity(exp) {
|
|
4187
|
+
return exp < 31 ? 1 << exp : Math.pow( 2, exp );
|
|
4188
|
+
}
|
|
4189
|
+
|
|
4047
4190
|
/**
|
|
4048
4191
|
* True if `maybeOrderedMap` is an OrderedMap.
|
|
4049
4192
|
*/
|
|
@@ -4459,6 +4602,9 @@
|
|
|
4459
4602
|
reduction = v;
|
|
4460
4603
|
}
|
|
4461
4604
|
else {
|
|
4605
|
+
// `reduction` has already been seeded here (either with the provided
|
|
4606
|
+
// initial value or with the first iterated value), so it is never the
|
|
4607
|
+
// `undefined` placeholder — only a `V` or a `R`.
|
|
4462
4608
|
reduction = reducer.call(context, reduction, v, k, c);
|
|
4463
4609
|
}
|
|
4464
4610
|
}, reverse);
|
|
@@ -5643,11 +5789,12 @@
|
|
|
5643
5789
|
|
|
5644
5790
|
has: function has(index) {
|
|
5645
5791
|
index = wrapIndex(this, index);
|
|
5792
|
+
|
|
5646
5793
|
return (
|
|
5647
5794
|
index >= 0 &&
|
|
5648
5795
|
(this.size !== undefined
|
|
5649
5796
|
? this.size === Infinity || index < this.size
|
|
5650
|
-
: this.
|
|
5797
|
+
: this.find(function (_, key) { return key === index; }, undefined, NOT_SET) !== NOT_SET)
|
|
5651
5798
|
);
|
|
5652
5799
|
},
|
|
5653
5800
|
|
|
@@ -6108,15 +6255,15 @@
|
|
|
6108
6255
|
};
|
|
6109
6256
|
|
|
6110
6257
|
Repeat.prototype.indexOf = function indexOf (searchValue) {
|
|
6111
|
-
if (is(this._value, searchValue)) {
|
|
6258
|
+
if (this.size !== 0 && is(this._value, searchValue)) {
|
|
6112
6259
|
return 0;
|
|
6113
6260
|
}
|
|
6114
6261
|
return -1;
|
|
6115
6262
|
};
|
|
6116
6263
|
|
|
6117
6264
|
Repeat.prototype.lastIndexOf = function lastIndexOf (searchValue) {
|
|
6118
|
-
if (is(this._value, searchValue)) {
|
|
6119
|
-
return this.size;
|
|
6265
|
+
if (this.size !== 0 && is(this._value, searchValue)) {
|
|
6266
|
+
return this.size - 1;
|
|
6120
6267
|
}
|
|
6121
6268
|
return -1;
|
|
6122
6269
|
};
|
|
@@ -6197,7 +6344,7 @@
|
|
|
6197
6344
|
return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet();
|
|
6198
6345
|
}
|
|
6199
6346
|
|
|
6200
|
-
var version = "5.1.
|
|
6347
|
+
var version = "5.1.8";
|
|
6201
6348
|
|
|
6202
6349
|
/* eslint-disable import/order */
|
|
6203
6350
|
|
package/dist/immutable.min.js
CHANGED
|
@@ -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="@@__IMMUTABLE_INDEXED__@@";function r(t){return Boolean(t&&t[e])}var n="@@__IMMUTABLE_KEYED__@@";function i(t){return Boolean(t&&t[n])}function o(t){return i(t)||r(t)}var u="@@__IMMUTABLE_ITERABLE__@@";function s(t){return Boolean(t&&t[u])}var a=function(t){return s(t)?t:X(t)},c=function(t){function e(t){return i(t)?t:F(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(a),f=function(t){function e(t){return r(t)?t:G(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(a),h=function(t){function e(t){return s(t)&&!o(t)?t:Z(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(a);a.Keyed=c,a.Indexed=f,a.Set=h;var p=0,_=1,l=2,v="function"==typeof Symbol&&Symbol.iterator,y="@@iterator",d=v||y,g=function(t){this.next=t};function w(t,e,r,n){var i=t===p?e:t===_?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function m(){return{value:void 0,done:!0}}function b(t){return!!Array.isArray(t)||!!I(t)}function z(t){return!(!t||"function"!=typeof t.next)}function S(t){var e=I(t);return e&&e.call(t)}function I(t){var e=t&&(v&&t[v]||t[y]);if("function"==typeof e)return e}g.prototype.toString=function(){return"[Iterator]"},g.KEYS=p,g.VALUES=_,g.ENTRIES=l,g.prototype.inspect=g.prototype.toSource=function(){return this.toString()},g.prototype[d]=function(){return this};var O="delete",E=5,j=1<<E,q=j-1,M={};function D(t){t&&(t.value=!0)}function x(){}function A(t){return void 0===t.size&&(t.size=t.__iterate(R)),t.size}function k(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 R(){return!0}function U(t,e,r){return(0===t&&!L(t)||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&e>=r)}function T(t,e){return K(t,e,0)}function B(t,e){return K(t,e,e)}function K(t,e,r){return void 0===t?r:L(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function L(t){return t<0||0===t&&1/t==-1/0}var C="@@__IMMUTABLE_RECORD__@@";function P(t){return Boolean(t&&t[C])}function W(t){return s(t)||P(t)}var N="@@__IMMUTABLE_ORDERED__@@";function H(t){return Boolean(t&&t[N])}var J="@@__IMMUTABLE_SEQ__@@";function V(t){return Boolean(t&&t[J])}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():W(t)?t.toSeq():function(t){var e=ut(t);if(e)return(n=I(r=t))&&n===r.entries?e.fromEntrySeq():function(t){var e=I(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 g((function(){if(i===n)return{value:void 0,done:!0};var o=r[e?n-++i:i++];return w(t,o[0],o[1])}))}return this.__iteratorUncached(t,e)},e}(a),F=function(t){function e(t){return null==t?nt().toKeyedSeq():s(t)?i(t)?t.toSeq():t.fromEntrySeq():P(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():s(t)?i(t)?t.entrySeq():t.toIndexedSeq():P(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(s(t)&&!o(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=V,X.Keyed=F,X.Set=Z,X.Indexed=G,X.prototype[J]=!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[k(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 g((function(){if(i===n)return{value:void 0,done:!0};var o=e?n-++i:i++;return w(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 g((function(){if(o===i)return{value:void 0,done:!0};var u=n[e?i-++o:o++];return w(t,u,r[u])}))},e}(F);tt.prototype[N]=!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=S(this._collection),n=0;if(z(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=S(this._collection);if(!z(r))return new g(m);var n=0;return new g((function(){var e=r.next();return e.done?e:w(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):b(t)?new rt(t):void 0}function st(){return this.__ensureOwner()}function at(){return this.__ownerID?this:this.__ensureOwner(new x)}var ct="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 ft(t){return t>>>1&1073741824|3221225471&t}var ht=Object.prototype.valueOf;function pt(t){if(null==t)return _t(t);if("function"==typeof t.hashCode)return ft(t.hashCode(t));var e,r=(e=t).valueOf!==ht&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return _t(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 ft(e)}(r);case"string":return r.length>St?function(t){var e=Et[t];void 0===e&&(e=lt(t),Ot===It&&(Ot=0,Et={}),Ot++,Et[t]=e);return e}(r):lt(r);case"object":case"function":return function(t){var e;if(wt&&void 0!==(e=gt.get(t)))return e;if(e=t[zt],void 0!==e)return e;if(!yt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[zt]))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=dt(),wt)gt.set(t,e);else{if(void 0!==vt&&!1===vt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(yt)Object.defineProperty(t,zt,{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[zt]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[zt]=e}}return e}(r);case"symbol":return function(t){var e=mt[t];if(void 0!==e)return e;return e=dt(),mt[t]=e,e}(r);default:if("function"==typeof r.toString)return lt(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function _t(t){return null===t?1108378658:1108378659}function lt(t){for(var e=0,r=0;r<t.length;r++)e=31*e+t.charCodeAt(r)|0;return ft(e)}var vt=Object.isExtensible,yt=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}();function dt(){var t=++bt;return 1073741824&bt&&(bt=0),t}var gt,wt="function"==typeof WeakMap;wt&&(gt=new WeakMap);var mt=Object.create(null),bt=0,zt="__immutablehash__";"function"==typeof Symbol&&(zt=Symbol(zt));var St=16,It=255,Ot=0,Et={},jt=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=kt(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},e.prototype.map=function(t,e){var r=this,n=At(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);jt.prototype[N]=!0;var qt=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(_,e),i=0;return e&&A(this),new g((function(){var o=n.next();return o.done?o:w(t,e?r.size-++i:i++,o.value,o)}))},e}(G),Mt=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(_,e);return new g((function(){var e=r.next();return e.done?e:w(t,e.value,e.value,e)}))},e}(Z),Dt=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){Ht(e);var n=s(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(_,e);return new g((function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n){Ht(n);var i=s(n);return w(t,i?n.get(0):n[0],i?n.get(1):n[1],e)}}}))},e}(F);function xt(t){var e=Vt(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=Yt,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===l){var n=t.__iterator(e,r);return new g((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===_?p:_,r)},e}function At(t,e,r){var n=Vt(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var o=t.get(n,M);return o===M?i:e.call(r,o,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(l,i);return new g((function(){var i=o.next();if(i.done)return i;var u=i.value,s=u[0];return w(n,s,e.call(r,u[1],s,t),i)}))},n}function kt(t,e){var r=Vt(t);return r._iter=t,r.size=t.size,r.reverse=function(){return t},t.flip&&(r.flip=function(){var e=xt(t);return e.reverse=function(){return t.flip()},e}),r.get=function(r,n){return t.get(e?r:-1-r,n)},r.has=function(r){return t.has(e?r:-1-r)},r.includes=function(e){return t.includes(e)},r.cacheResult=Yt,r.__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)},r.__iterator=function(n,i){var o=0;i&&A(t);var u=t.__iterator(l,!i);return new g((function(){var t=u.next();if(t.done)return t;var s=t.value;return w(n,e?s[0]:i?r.size-++o:o++,s[1],t)}))},r}function Rt(t,e,r,n){var i=Vt(t);return n&&(i.has=function(n){var i=t.get(n,M);return i!==M&&!!e.call(r,i,n,t)},i.get=function(n,i){var o=t.get(n,M);return o!==M&&e.call(r,o,n,t)?o: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(l,o),s=0;return new g((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 w(i,n?c:s++,f,o)}}))},i}function Ut(t,e,r,n){var i=t.size;if(U(e,r,i))return t;if(void 0===i&&(e<0||r<0))return Ut(t.toSeq().cacheResult(),e,r,n);var o,u=T(e,i),s=B(r,i)-u;s==s&&(o=s<0?0:s);var a=Vt(t);return a.size=0===o?o:t.size&&o||void 0,!n&&V(t)&&o>=0&&(a.get=function(e,r){return(e=k(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 g(m);var i=t.__iterator(e,r),s=0,a=0;return new g((function(){for(;s++<u;)i.next();if(++a>o)return{value:void 0,done:!0};var t=i.next();return n||e===_||t.done?t:w(e,a-1,e===p?void 0:t.value[1],t)}))},a}function Tt(t,e,r,n){var i=Vt(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(l,o),a=!0,c=0;return new g((function(){var t,o,f;do{if((t=s.next()).done)return n||i===_?t:w(i,c++,i===p?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===l?t:w(i,o,f,t)}))},i}qt.prototype.cacheResult=jt.prototype.cacheResult=Mt.prototype.cacheResult=Dt.prototype.cacheResult=Yt;var Bt=function(t){function r(t){this._wrappedIterables=t.flatMap((function(t){return t._wrappedIterables?t._wrappedIterables:[t]})),this.size=this._wrappedIterables.reduce((function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}}),0),this[n]=this._wrappedIterables[0][n],this[e]=this._wrappedIterables[0][e],this[N]=this._wrappedIterables[0][N]}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.__iterateUncached=function(t,e){if(0!==this._wrappedIterables.length){if(e)return this.cacheResult().__iterate(t,e);for(var r=0,n=i(this),o=n?l:_,u=this._wrappedIterables[r].__iterator(o,e),s=!0,a=0;s;){for(var c=u.next();c.done;){if(++r===this._wrappedIterables.length)return a;c=(u=this._wrappedIterables[r].__iterator(o,e)).next()}s=!1!==(n?t(c.value[1],c.value[0],this):t(c.value,a,this)),a++}return a}},r.prototype.__iteratorUncached=function(t,e){var r=this;if(0===this._wrappedIterables.length)return new g(m);if(e)return this.cacheResult().__iterator(t,e);var n=0,i=this._wrappedIterables[n].__iterator(t,e);return new g((function(){for(var o=i.next();o.done;){if(++n===r._wrappedIterables.length)return o;o=(i=r._wrappedIterables[n].__iterator(t,e)).next()}return o}))},r}(X);function Kt(t,e,r){var n=Vt(t);return n.__iterateUncached=function(i,o){if(o)return this.cacheResult().__iterate(i,o);var u=0,a=!1;return function t(c,f){c.__iterate((function(o,c){return(!e||f<e)&&s(o)?t(o,f+1):(u++,!1===i(o,r?c:u-1,n)&&(a=!0)),!a}),o)}(t,0),u},n.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var o=t.__iterator(n,i),u=[],a=0;return new g((function(){for(;o;){var t=o.next();if(!1===t.done){var c=t.value;if(n===l&&(c=c[1]),e&&!(u.length<e)||!s(c))return r?t:w(n,a++,c,t);u.push(o),o=c.__iterator(n,i)}else o=u.pop()}return{value:void 0,done:!0}}))},n}function Lt(t,e,n){e||(e=Qt);var o=i(t),u=0,s=t.toSeq().map((function(e,r){return[r,e,u++,n?n(e,r,t):e]})).valueSeq().toArray();return s.sort((function(t,r){return e(t[3],r[3])||t[2]-r[2]})).forEach(o?function(t,e){s[e].length=2}:function(t,e){s[e]=t[1]}),o?F(s):r(t)?G(s):Z(s)}function Ct(t,e,r){if(e||(e=Qt),r){var n=t.toSeq().map((function(e,n){return[e,r(e,n,t)]})).reduce((function(t,r){return Pt(e,t[1],r[1])?r:t}));return n&&n[0]}return t.reduce((function(t,r){return Pt(e,t,r)?r:t}))}function Pt(t,e,r){var n=t(r,e);return 0===n&&r!==e&&(null==r||r!=r)||n>0}function Wt(t,e,r,n){var i=Vt(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(_,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=a(t),S(i?t.reverse():t)})),u=0,s=!1;return new g((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}:w(t,u++,e.apply(null,r.map((function(t){return t.value}))))}))},i}function Nt(t,e){return t===e?t:V(t)?e:t.constructor(e)}function Ht(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Jt(t){return i(t)?c:r(t)?f:h}function Vt(t){return Object.create((i(t)?F:r(t)?G:Z).prototype)}function Yt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):X.prototype.cacheResult.call(this)}function Qt(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 Xt(t){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function Ft(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!!(Xt(t)&&Xt(e)&&t.equals(e))}function Gt(t,e,r,n){return Ge(t,[e],r,n)}function Zt(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return te(this,t)}function $t(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 te(this,e,t)}function te(t,e,r){for(var n=[],i=0;i<e.length;i++){var o=c(e[i]);0!==o.size&&n.push(o)}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){Gt(t,n,M,(function(t){return t===M?e:r(t,e,n)}))}:function(e,r){t.set(r,e)},i=0;i<n.length;i++)n[i].forEach(e)})):P(t)?t:t.constructor(n[0])}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&&(W(t)||Array.isArray(t)||re(t))}function ie(t){return"string"==typeof t&&("__proto__"===t||"constructor"===t)}function oe(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 ue(t){if(Array.isArray(t))return oe(t);var e={};for(var r in t)ie(r)||Y.call(t,r)&&(e[r]=t[r]);return e}function se(t,e,n){return ae(t,e,function(t){function e(n,o,u){return ne(n)&&ne(o)&&(s=o,a=X(n),c=X(s),r(a)===r(c)&&i(a)===i(c))?ae(n,[o],e):t?t(n,o,u):o;var s,a,c}return e}(n))}function ae(t,e,r){if(!ne(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(W(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?f:c,u=n?function(e){i===t&&(i=ue(i)),i.push(e)}:function(e,n){if(!ie(n)){var o=Y.call(i,n),u=o&&r?r(i[n],e,n):e;o&&u===i[n]||(i===t&&(i=ue(i)),i[n]=u)}},s=0;s<e.length;s++)o(e[s]).forEach(u);return i}function ce(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return se(this,t)}function fe(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return se(this,e,t)}function he(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return Ge(this,t,Ue(),(function(t){return se(t,e)}))}function pe(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return Ge(this,t,Ue(),(function(t){return ae(t,e)}))}function _e(t,e,r){return Ge(t,e,M,(function(){return r}))}function le(t,e){return _e(this,t,e)}function ve(t,e,r){return 1===arguments.length?t(this):Gt(this,t,e,r)}function ye(t,e,r){return Ge(this,t,e,r)}function de(){return this.__altered}function ge(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}var we="@@__IMMUTABLE_MAP__@@";function me(t){return Boolean(t&&t[we])}function be(t,e){if(!t)throw new Error(e)}function ze(t){be(t!==1/0,"Cannot perform this action with an infinite size.")}var Se=function(t){function e(e){return null==e?Ue():me(e)&&!H(e)?e:Ue().withMutations((function(r){var n=t(e);ze(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 Te(this,t,e)},e.prototype.remove=function(t){return Te(this,t,M)},e.prototype.deleteAll=function(t){var e=a(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):Ue()},e.prototype.sort=function(t){return dr(Lt(this,t))},e.prototype.sortBy=function(t,e){return dr(Lt(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 xe(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?Re(this.size,this._root,t,this.__hash):0===this.size?Ue():(this.__ownerID=t,this.__altered=!1,this)},e}(c);Se.isMap=me;var Ie=Se.prototype;Ie[we]=!0,Ie[O]=Ie.remove,Ie.removeAll=Ie.deleteAll,Ie.setIn=le,Ie.removeIn=Ie.deleteIn=tr,Ie.update=ve,Ie.updateIn=ye,Ie.merge=Ie.concat=Zt,Ie.mergeWith=$t,Ie.mergeDeep=ce,Ie.mergeDeepWith=fe,Ie.mergeIn=pe,Ie.mergeDeepIn=he,Ie.withMutations=ge,Ie.wasAltered=de,Ie.asImmutable=st,Ie["@@transducer/init"]=Ie.asMutable=at,Ie["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Ie["@@transducer/result"]=function(t){return t.asImmutable()};var Oe=function(t,e){this.ownerID=t,this.entries=e};Oe.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(Ft(r,i[o][0]))return i[o][1];return n},Oe.prototype.update=function(t,e,r,n,i,o,u){for(var s=i===M,a=this.entries,c=0,f=a.length;c<f&&!Ft(n,a[c][0]);c++);var h=c<f;if(h?a[c][1]===i:s)return this;if(D(u),(s||!h)&&D(o),!s||1!==a.length){if(!h&&!s&&a.length>=We)return function(t,e,r,n){t||(t=new x);for(var i=new Me(t,pt(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,a,n,i);var p=t&&t===this.ownerID,_=p?a:oe(a);return h?s?c===f-1?_.pop():_[c]=_.pop():_[c]=[n,i]:_.push([n,i]),p?(this.entries=_,this):new Oe(t,_)}};var Ee=function(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r};Ee.prototype.get=function(t,e,r,n){void 0===e&&(e=pt(r));var i=1<<((0===t?e:e>>>t)&q),o=this.bitmap;return 0==(o&i)?n:this.nodes[Ce(o&i-1)].get(t+E,e,r,n)},Ee.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=pt(n));var s=(0===e?r:r>>>e)&q,a=1<<s,c=this.bitmap,f=0!=(c&a);if(!f&&i===M)return this;var h=Ce(c&a-1),p=this.nodes,_=f?p[h]:void 0,l=Be(_,t,e+E,r,n,i,o,u);if(l===_)return this;if(!f&&l&&p.length>=Ne)return function(t,e,r,n,i){for(var o=0,u=new Array(j),s=0;0!==r;s++,r>>>=1)u[s]=1&r?e[o++]:void 0;return u[n]=i,new je(t,o+1,u)}(t,p,c,s,l);if(f&&!l&&2===p.length&&Ke(p[1^h]))return p[1^h];if(f&&l&&1===p.length&&Ke(l))return l;var v=t&&t===this.ownerID,y=f?l?c:c^a:c|a,d=f?l?Pe(p,h,l,v):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}(p,h,v):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}(p,h,l,v);return v?(this.bitmap=y,this.nodes=d,this):new Ee(t,y,d)};var je=function(t,e,r){this.ownerID=t,this.count=e,this.nodes=r};je.prototype.get=function(t,e,r,n){void 0===e&&(e=pt(r));var i=(0===t?e:e>>>t)&q,o=this.nodes[i];return o?o.get(t+E,e,r,n):n},je.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=pt(n));var s=(0===e?r:r>>>e)&q,a=i===M,c=this.nodes,f=c[s];if(a&&!f)return this;var h=Be(f,t,e+E,r,n,i,o,u);if(h===f)return this;var p=this.count;if(f){if(!h&&--p<He)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 Ee(t,i,u)}(t,c,p,s)}else p++;var _=t&&t===this.ownerID,l=Pe(c,s,h,_);return _?(this.count=p,this.nodes=l,this):new je(t,p,l)};var qe=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r};qe.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(Ft(r,i[o][0]))return i[o][1];return n},qe.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=pt(n));var s=i===M;if(r!==this.keyHash)return s?this:(D(u),D(o),Le(this,t,e,r,[n,i]));for(var a=this.entries,c=0,f=a.length;c<f&&!Ft(n,a[c][0]);c++);var h=c<f;if(h?a[c][1]===i:s)return this;if(D(u),(s||!h)&&D(o),s&&2===f)return new Me(t,this.keyHash,a[1^c]);var p=t&&t===this.ownerID,_=p?a:oe(a);return h?s?c===f-1?_.pop():_[c]=_.pop():_[c]=[n,i]:_.push([n,i]),p?(this.entries=_,this):new qe(t,this.keyHash,_)};var Me=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r};Me.prototype.get=function(t,e,r,n){return Ft(r,this.entry[0])?this.entry[1]:n},Me.prototype.update=function(t,e,r,n,i,o,u){var s=i===M,a=Ft(n,this.entry[0]);return(a?i===this.entry[1]:s)?this:(D(u),s?void D(o):a?t&&t===this.ownerID?(this.entry[1]=i,this):new Me(t,this.keyHash,[n,i]):(D(o),Le(this,t,e,pt(n),[n,i])))},Oe.prototype.iterate=qe.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},Ee.prototype.iterate=je.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}},Me.prototype.iterate=function(t,e){return t(this.entry)};var De,xe=function(t){function e(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&ke(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 Ae(t,r.entry)}else if(r.entries){if(n<=(i=r.entries.length-1))return Ae(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 Ae(t,o.entry);e=this._stack=ke(o,e)}continue}e=this._stack=this._stack.__prev}return{value:void 0,done:!0}},e}(g);function Ae(t,e){return w(t,e[0],e[1])}function ke(t,e){return{node:t,index:0,__prev:e}}function Re(t,e,r,n){var i=Object.create(Ie);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Ue(){return De||(De=Re(0))}function Te(t,e,r){var n,i;if(t._root){var o={value:!1},u={value:!1};if(n=Be(t._root,t.__ownerID,0,void 0,e,r,o,u),!u.value)return t;i=t.size+(o.value?r===M?-1:1:0)}else{if(r===M)return t;i=1,n=new Oe(t.__ownerID,[[e,r]])}return t.__ownerID?(t.size=i,t._root=n,t.__hash=void 0,t.__altered=!0,t):n?Re(i,n):Ue()}function Be(t,e,r,n,i,o,u,s){return t?t.update(e,r,n,i,o,u,s):o===M?t:(D(s),D(u),new Me(e,n,[i,o]))}function Ke(t){return t.constructor===Me||t.constructor===qe}function Le(t,e,r,n,i){if(t.keyHash===n)return new qe(e,n,[t.entry,i]);var o,u=(0===r?t.keyHash:t.keyHash>>>r)&q,s=(0===r?n:n>>>r)&q,a=u===s?[Le(t,e,r+E,n,i)]:(o=new Me(e,n,i),u<s?[t,o]:[o,t]);return new Ee(e,1<<u|1<<s,a)}function Ce(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function Pe(t,e,r,n){var i=n?t:oe(t);return i[e]=r,i}var We=j/4,Ne=j/2,He=j/4;function Je(t){if(Q(t)&&"string"!=typeof t)return t;if(H(t))return t.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+t)}function Ve(t){try{return"string"==typeof t?JSON.stringify(t):String(t)}catch(e){return JSON.stringify(t)}}function Ye(t,e){return W(t)?t.has(e):ne(t)&&Y.call(t,e)}function Qe(t,e,r){return W(t)?t.get(e,r):Ye(t,e)?"function"==typeof t.get?t.get(e):t[e]:r}function Xe(t,e){if(!ne(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(W(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=ue(t);return Array.isArray(r)?r.splice(e,1):delete r[e],r}function Fe(t,e,r){if(ie(e))return t;if(!ne(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(W(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=ue(t);return n[e]=r,n}function Ge(t,e,r,n){n||(n=r,r=void 0);var i=Ze(W(t),t,Je(e),0,r,n);return i===M?r:i}function Ze(t,e,r,n,i,o){var u=e===M;if(n===r.length){var s=u?i:e,a=o(s);return a===s?e:a}if(!u&&!ne(e))throw new TypeError("Cannot update within non-data-structure value in path ["+Array.from(r).slice(0,n).map(Ve)+"]: "+e);var c=r[n],f=u?M:Qe(e,c,M),h=Ze(f===M?t:W(f),f,r,n+1,i,o);return h===f?e:h===M?Xe(e,c):Fe(u?t?Ue():{}:e,c,h)}function $e(t,e){return Ge(t,e,(function(){return M}))}function tr(t){return $e(this,t)}var er="@@__IMMUTABLE_LIST__@@";function rr(t){return Boolean(t&&t[er])}var nr=function(t){function e(e){var r=cr();if(null==e)return r;if(rr(e))return e;var n=t(e),i=n.size;return 0===i?r:(ze(i),i>0&&i<j?ar(0,i,E,null,new or(n.toArray())):r.withMutations((function(t){t.setSize(i),n.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=k(this,t))>=0&&t<this.size){var r=pr(this,t+=this._origin);return r&&r.array[t&q]}return e},e.prototype.set=function(t,e){return function(t,e,r){if(e=k(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=E,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.shuffle=function(t){return void 0===t&&(t=Math.random),this.withMutations((function(e){for(var r,n,i=e.size;i;)r=Math.floor(t()*i--),n=e.get(r),e.set(r,e.get(i)),e.set(i,n)}))},e.prototype.concat=function(){for(var e=arguments,r=[],n=0;n<arguments.length;n++){var i=e[n],o=t("string"!=typeof i&&b(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 U(t,e,r)?this:_r(this,T(t,r),B(e,r))},e.prototype.__iterator=function(t,e){var r=e?this.size:0,n=sr(this,e);return new g((function(){var i=n();return i===ur?{value:void 0,done:!0}:w(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}(f);nr.isList=rr;var ir=nr.prototype;ir[er]=!0,ir[O]=ir.remove,ir.merge=ir.concat,ir.setIn=le,ir.deleteIn=ir.removeIn=tr,ir.update=ve,ir.updateIn=ye,ir.mergeIn=pe,ir.mergeDeepIn=he,ir.withMutations=ge,ir.wasAltered=de,ir.asImmutable=st,ir["@@transducer/init"]=ir.asMutable=at,ir["@@transducer/step"]=function(t,e){return t.push(e)},ir["@@transducer/result"]=function(t){return t.asImmutable()};var or=function(t,e){this.array=t,this.ownerID=e};or.prototype.removeBefore=function(t,e,r){if(0==(r&(1<<e+E)-1)||0===this.array.length)return this;var n=r>>>e&q;if(n>=this.array.length)return new or([],t);var i,o=0===n;if(e>0){var u=this.array[n];if((i=u&&u.removeBefore(t,e-E,r))===u&&o)return this}if(o&&!i)return this;var s=hr(this,t);if(!o)for(var a=0;a<n;a++)s.array[a]=void 0;return i&&(s.array[n]=i),s},or.prototype.removeAfter=function(t,e,r){if(r===(e?1<<e+E:j)||0===this.array.length)return this;var n,i=r-1>>>e&q;if(i>=this.array.length)return this;if(e>0){var o=this.array[i];if((n=o&&o.removeAfter(t,e-E,r))===o&&i===this.array.length-1)return this}var u=hr(this,t);return u.array.splice(i+1),n&&(u.array[i]=n),u};var ur={};function sr(t,e){var r=t._origin,n=t._capacity,i=lr(n),o=t._tail;return u(t._root,t._level,0);function u(t,s,a){return 0===s?function(t,u){var s=u===i?o&&o.array:t&&t.array,a=u>r?0:r-u,c=n-u;c>j&&(c=j);return function(){if(a===c)return ur;var t=e?--c:a++;return s&&s[t]}}(t,a):function(t,i,o){var s,a=t&&t.array,c=o>r?0:r-o>>i,f=1+(n-o>>i);f>j&&(f=j);return function(){for(;;){if(s){var t=s();if(t!==ur)return t;s=null}if(c===f)return ur;var r=e?--f:c++;s=u(a&&a[r],i-E,o+(r<<i))}}}(t,s,a)}}function ar(t,e,r,n,i,o,u){var s=Object.create(ir);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 ar(0,0,E)}function fr(t,e,r,n,i,o){var u,s=n>>>r&q,a=t&&s<t.array.length;if(!a&&void 0===i)return t;if(r>0){var c=t&&t.array[s],f=fr(c,e,r-E,n,i,o);return f===c?t:((u=hr(t,e)).array[s]=f,u)}return a&&t.array[s]===i?t:(o&&D(o),u=hr(t,e),void 0===i&&s===u.array.length-1?u.array.pop():u.array[s]=i,u)}function hr(t,e){return e&&t&&e===t.ownerID?t:new or(t?t.array.slice():[],e)}function pr(t,e){if(e>=lr(t._capacity))return t._tail;if(e<1<<t._level+E){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&q],n-=E;return r}}function _r(t,e,r){void 0!==e&&(e|=0),void 0!==r&&(r|=0);var n=t.__ownerID||new x,i=t._origin,o=t._capacity,u=i+e,s=void 0===r?o:r<0?o+r:i+r;if(u===i&&s===o)return t;if(u>=s)return t.clear();for(var a=t._level,c=t._root,f=0;u+f<0;)c=new or(c&&c.array.length?[void 0,c]:[],n),f+=1<<(a+=E);f&&(u+=f,i+=f,s+=f,o+=f);for(var h=lr(o),p=lr(s);p>=1<<a+E;)c=new or(c&&c.array.length?[c]:[],n),a+=E;var _=t._tail,l=p<h?pr(t,s-1):p>h?new or([],n):_;if(_&&p>h&&u<o&&_.array.length){for(var v=c=hr(c,n),y=a;y>E;y-=E){var d=h>>>y&q;v=v.array[d]=hr(v.array[d],n)}v.array[h>>>E&q]=_}if(s<o&&(l=l&&l.removeAfter(n,0,s)),u>=p)u-=p,s-=p,a=E,c=null,l=l&&l.removeBefore(n,0,u);else if(u>i||p<h){for(f=0;c;){var g=u>>>a&q;if(g!==p>>>a&q)break;g&&(f+=(1<<a)*g),a-=E,c=c.array[g]}c&&u>i&&(c=c.removeBefore(n,a,u-f)),c&&p<h&&(c=c.removeAfter(n,a,p-f)),f&&(u-=f,s-=f)}return t.__ownerID?(t.size=s-u,t._origin=u,t._capacity=s,t._level=a,t._root=c,t._tail=l,t.__hash=void 0,t.__altered=!0,t):ar(u,s,a,c,l)}function lr(t){return t<j?0:t-1>>>E<<E}function vr(t){return me(t)&&H(t)}var yr,dr=function(t){function e(t){return null==t?wr():vr(t)?t:wr().withMutations((function(e){var r=c(t);ze(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):wr()},e.prototype.set=function(t,e){return mr(this,t,e)},e.prototype.remove=function(t){return mr(this,t,M)},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?gr(e,r,t,this.__hash):0===this.size?wr():(this.__ownerID=t,this.__altered=!1,this._map=e,this._list=r,this)},e}(Se);function gr(t,e,r,n){var i=Object.create(dr.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 wr(){return yr||(yr=gr(Ue(),cr()))}function mr(t,e,r){var n,i,o=t._map,u=t._list,s=o.get(e),a=void 0!==s;if(r===M){if(!a)return t;u.size>=j&&u.size>=2*o.size?(n=(i=u.filter((function(t,e){return void 0!==t&&s!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(r===u.get(s)[1])return t;n=o,i=u.set(s,[e,r])}else n=o.set(e,u.size),i=u.set(u.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t.__altered=!0,t):gr(n,i)}dr.isOrderedMap=vr,dr.prototype[N]=!0,dr.prototype[O]=dr.prototype.remove;var br="@@__IMMUTABLE_STACK__@@";function zr(t){return Boolean(t&&t[br])}var Sr=function(t){function e(t){return null==t?jr():zr(t)?t:jr().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=k(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):Er(e,r)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&zr(e))return e;ze(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):Er(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):jr()},e.prototype.slice=function(e,r){if(U(e,r,this.size))return this;var n=T(e,this.size);if(B(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):Er(i,o)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Er(this.size,this._head,t,this.__hash):0===this.size?jr():(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 g((function(){if(n){var e=n.value;return n=n.next,w(t,r++,e)}return{value:void 0,done:!0}}))},e}(f);Sr.isStack=zr;var Ir,Or=Sr.prototype;function Er(t,e,r,n){var i=Object.create(Or);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function jr(){return Ir||(Ir=Er(0))}function qr(t,e,r,n,i,o){return ze(t.size),t.__iterate((function(t,o,u){i?(i=!1,r=t):r=e.call(n,r,t,o,u)}),o),r}function Mr(t,e){return e}function Dr(t,e){return[e,t]}function xr(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return!t.apply(this,e)}}function Ar(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return-t.apply(this,e)}}function kr(t,e){return t<e?1:t>e?-1:0}function Rr(t,e){if(t===e)return!0;if(!s(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||i(t)!==i(e)||r(t)!==r(e)||H(t)!==H(e))return!1;if(0===t.size&&0===e.size)return!0;var n=!o(t);if(H(t)){var u=t.entries();return e.every((function(t,e){var r=u.next().value;return r&&Ft(r[1],t)&&(n||Ft(r[0],e))}))&&u.next().done}var a=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{a=!0;var c=t;t=e,e=c}var f=!0,h=e.__iterate((function(e,r){if(n?!t.has(e):a?!Ft(e,t.get(r,M)):!Ft(t.get(r,M),e))return f=!1,!1}));return f&&t.size===h}Or[br]=!0,Or.shift=Or.pop,Or.unshift=Or.push,Or.unshiftAll=Or.pushAll,Or.withMutations=ge,Or.wasAltered=de,Or.asImmutable=st,Or["@@transducer/init"]=Or.asMutable=at,Or["@@transducer/step"]=function(t,e){return t.unshift(e)},Or["@@transducer/result"]=function(t){return t.asImmutable()};var Ur,Tr=function(t){function e(t,r,n){if(void 0===n&&(n=1),!(this instanceof e))return new e(t,r,n);if(be(0!==n,"Cannot step a Range by 0"),be(void 0!==t,"You must define a start value when using Range"),be(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(Ur)return Ur;Ur=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+k(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 U(t,r,this.size)?this:(t=T(t,this.size),(r=B(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 g((function(){if(o===r)return{value:void 0,done:!0};var u=i;return i+=e?-n:n,w(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:Rr(this,t)},e}(G),Br="@@__IMMUTABLE_SET__@@";function Kr(t){return Boolean(t&&t[Br])}var Lr=function(t){function e(e){return null==e?Hr():Kr(e)&&!H(e)?e:Hr().withMutations((function(r){var n=t(e);ze(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(c(t).keySeq())},e.intersect=function(t){return(t=a(t).toArray()).length?Pr.intersect.apply(e(t.pop()),t):Hr()},e.union=function(t){return(t=a(t).toArray()).length?Pr.union.apply(e(t.pop()),t):Hr()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Wr(this,this._map.set(t,t))},e.prototype.remove=function(t){return Wr(this,this._map.remove(t))},e.prototype.clear=function(){return Wr(this,this._map.clear())},e.prototype.map=function(t,e){var r=this,n=!1,i=Wr(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 un(Lt(this,t))},e.prototype.sortBy=function(t,e){return un(Lt(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}(h);Lr.isSet=Kr;var Cr,Pr=Lr.prototype;function Wr(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 Nr(t,e){var r=Object.create(Pr);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Hr(){return Cr||(Cr=Nr(Ue()))}function Jr(t,e,r){for(var n=Je(e),i=0;i!==n.length;)if((t=Qe(t,n[i++],M))===M)return r;return t}function Vr(t,e){return Jr(this,t,e)}function Yr(t,e){return Jr(t,e,M)!==M}function Qr(){ze(this.size);var t={};return this.__iterate((function(e,r){ie(r)||(t[r]=e)})),t}function Xr(t){if(!t||"object"!=typeof t)return t;if(!s(t)){if(!ne(t))return t;t=X(t)}if(i(t)){var e={};return t.__iterate((function(t,r){ie(r)||(e[r]=Xr(t))})),e}var r=[];return t.__iterate((function(t){r.push(Xr(t))})),r}function Fr(t){if(t.size===1/0)return 0;var e=H(t),r=i(t),n=e?1:0;return t.__iterate(r?e?function(t,e){n=31*n+Gr(pt(t),pt(e))|0}:function(t,e){n=n+Gr(pt(t),pt(e))|0}:e?function(t){n=31*n+pt(t)|0}:function(t){n=n+pt(t)|0}),function(t,e){return e=ct(e,3432918353),e=ct(e<<15|e>>>-15,461845907),e=ct(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=ct(e^e>>>16,2246822507),e=ct(e^e>>>13,3266489909),e=ft(e^e>>>16),e}(t.size,n)}function Gr(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}function Zr(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}Pr[Br]=!0,Pr[O]=Pr.remove,Pr.merge=Pr.concat=Pr.union,Pr.withMutations=ge,Pr.asImmutable=st,Pr["@@transducer/init"]=Pr.asMutable=at,Pr["@@transducer/step"]=function(t,e){return t.add(e)},Pr["@@transducer/result"]=function(t){return t.asImmutable()},Pr.__empty=Hr,Pr.__make=Nr,a.Iterator=g,Zr(a,{toArray:function(){ze(this.size);var t=new Array(this.size||0),e=i(this),r=0;return this.__iterate((function(n,i){t[r++]=e?[i,n]:n})),t},toIndexedSeq:function(){return new qt(this)},toJS:function(){return Xr(this)},toKeyedSeq:function(){return new jt(this,!0)},toMap:function(){return Se(this.toKeyedSeq())},toObject:Qr,toOrderedMap:function(){return dr(this.toKeyedSeq())},toOrderedSet:function(){return un(i(this)?this.valueSeq():this)},toSet:function(){return Lr(i(this)?this.valueSeq():this)},toSetSeq:function(){return new Mt(this)},toSeq:function(){return r(this)?this.toIndexedSeq():i(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Sr(i(this)?this.valueSeq():this)},toList:function(){return nr(i(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 Nt(this,function(t,e){var n=i(t),o=[t].concat(e).map((function(t){return s(t)?n&&(t=c(t)):t=n?it(t):ot(Array.isArray(t)?t:[t]),t})).filter((function(t){return 0!==t.size}));if(0===o.length)return t;if(1===o.length){var u=o[0];if(u===t||n&&i(u)||r(t)&&r(u))return u}return new Bt(o)}(this,t))},includes:function(t){return this.some((function(e){return Ft(e,t)}))},entries:function(){return this.__iterator(l)},every:function(t,e){ze(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 Nt(this,Rt(this,t,e,!0))},partition:function(t,e){return function(t,e,r){var n=i(t),o=[[],[]];t.__iterate((function(i,u){o[e.call(r,i,u,t)?1:0].push(n?[u,i]:i)}));var u=Jt(t);return o.map((function(e){return Nt(t,u(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 ze(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){ze(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(p)},map:function(t,e){return Nt(this,At(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 Nt(this,kt(this,!0))},slice:function(t,e){return Nt(this,Ut(this,t,e,!0))},some:function(t,e){ze(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 Nt(this,Lt(this,t))},values:function(){return this.__iterator(_)},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=Se().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 Rr(this,t)},entrySeq:function(){var t=this;if(t._cache)return new $(t._cache);var e=t.toSeq().map(Dr).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(xr(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(R,null,t)},flatMap:function(t,e){return Nt(this,function(t,e,r){var n=Jt(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 Nt(this,Kt(this,t,!0))},fromEntrySeq:function(){return new Dt(this)},get:function(t,e){return this.find((function(e,r){return Ft(r,t)}),void 0,e)},getIn:Vr,groupBy:function(t,e){return function(t,e,r){var n=i(t),o=(H(t)?dr():Se()).asMutable();t.__iterate((function(i,u){o.update(e.call(r,i,u,t),(function(t){return(t=t||[]).push(n?[u,i]:i),t}))}));var u=Jt(t);return o.map((function(e){return Nt(t,u(e))})).asImmutable()}(this,t,e)},has:function(t){return this.get(t,M)!==M},hasIn:function(t){return Yr(this,t)},isSubset:function(t){return t="function"==typeof t.includes?t:a(t),this.every((function(e){return t.includes(e)}))},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:a(t)).isSubset(this)},keyOf:function(t){return this.findKey((function(e){return Ft(e,t)}))},keySeq:function(){return this.toSeq().map(Mr).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Ct(this,t)},maxBy:function(t,e){return Ct(this,e,t)},min:function(t){return Ct(this,t?Ar(t):kr)},minBy:function(t,e){return Ct(this,e?Ar(e):kr,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 Nt(this,Tt(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(xr(t),e)},sortBy:function(t,e){return Nt(this,Lt(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 Nt(this,function(t,e,r){var n=Vt(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(l,i),s=!0;return new g((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===l?t:w(n,a,c,t):(s=!1,{value:void 0,done:!0})}))},n}(this,t,e))},takeUntil:function(t,e){return this.takeWhile(xr(t),e)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=Fr(this))}});var $r=a.prototype;$r[u]=!0,$r[d]=$r.values,$r.toJSON=$r.toArray,$r.__toStringMapper=Ve,$r.inspect=$r.toSource=function(){return this.toString()},$r.chain=$r.flatMap,$r.contains=$r.includes,Zr(c,{flip:function(){return Nt(this,xt(this))},mapEntries:function(t,e){var r=this,n=0;return Nt(this,this.toSeq().map((function(i,o){return t.call(e,[o,i],n++,r)})).fromEntrySeq())},mapKeys:function(t,e){var r=this;return Nt(this,this.toSeq().flip().map((function(n,i){return t.call(e,n,i,r)})).flip())}});var tn=c.prototype;tn[n]=!0,tn[d]=$r.entries,tn.toJSON=Qr,tn.__toStringMapper=function(t,e){return Ve(e)+": "+Ve(t)},Zr(f,{toKeyedSeq:function(){return new jt(this,!1)},filter:function(t,e){return Nt(this,Rt(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 Nt(this,kt(this,!1))},slice:function(t,e){return Nt(this,Ut(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=T(t,t<0?this.count():this.size);var n=this.slice(0,t);return Nt(this,1===r?n:n.concat(oe(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 Nt(this,Kt(this,t,!1))},get:function(t,e){return(t=k(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=k(this,t))>=0&&(void 0!==this.size?this.size===1/0||t<this.size:-1!==this.indexOf(t))},interpose:function(t){return Nt(this,function(t,e){var r=Vt(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(_,n),u=0;return new g((function(){return(!i||u%2)&&(i=o.next()).done?i:u%2?w(r,u++,e):w(r,u++,i.value,i)}))},r}(this,t))},interleave:function(){var t=[this].concat(oe(arguments)),e=Wt(this.toSeq(),G.of,t),r=e.flatten(!0);return e.size&&(r.size=e.size*t.length),Nt(this,r)},keySeq:function(){return Tr(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,e){return Nt(this,Tt(this,t,e,!1))},zip:function(){return Nt(this,Wt(this,nn,[this].concat(oe(arguments))))},zipAll:function(){return Nt(this,Wt(this,nn,[this].concat(oe(arguments)),!0))},zipWith:function(t){var e=oe(arguments);return e[0]=this,Nt(this,Wt(this,t,e))}});var en=f.prototype;en[e]=!0,en[N]=!0,Zr(h,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});var rn=h.prototype;function nn(){return oe(arguments)}function on(t){return Kr(t)&&H(t)}rn.has=$r.includes,rn.contains=rn.includes,rn.keys=rn.values,Zr(F,tn),Zr(G,en),Zr(Z,rn);var un=function(t){function e(t){return null==t?fn():on(t)?t:fn().withMutations((function(e){var r=h(t);ze(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(c(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Lr);un.isOrderedSet=on;var sn,an=un.prototype;function cn(t,e){var r=Object.create(an);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function fn(){return sn||(sn=cn(wr()))}an[N]=!0,an.zip=en.zip,an.zipWith=en.zipWith,an.zipAll=en.zipAll,an.__empty=fn,an.__make=cn;var hn=function(t,e){var r;!function(t){if(P(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(W(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 f=0;f<s.length;f++){var h=s[f];a[h]=f,i[h]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+ln(this)+' with property "'+h+'" since that property name is part of the Record API.'):yn(i,h)}}return this.__ownerID=void 0,this._values=nr().withMutations((function(t){t.setSize(u._keys.length),c(o).forEach((function(e,r){t.set(u._indices[r],e===u._defaultValues[r]?void 0:e)}))})),this},i=n.prototype=Object.create(pn);return i.constructor=n,e&&(n.displayName=e),n};hn.prototype.toString=function(){for(var t,e=ln(this)+" { ",r=this._keys,n=0,i=r.length;n!==i;n++)e+=(n?", ":"")+(t=r[n])+": "+Ve(this.get(t));return e+" }"},hn.prototype.equals=function(t){return this===t||P(t)&&vn(this).equals(vn(t))},hn.prototype.hashCode=function(){return vn(this).hashCode()},hn.prototype.has=function(t){return this._indices.hasOwnProperty(t)},hn.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},hn.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 _n(this,r)}return this},hn.prototype.remove=function(t){return this.set(t)},hn.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:_n(this,t)},hn.prototype.wasAltered=function(){return this._values.wasAltered()},hn.prototype.toSeq=function(){return vn(this)},hn.prototype.toJS=function(){return Xr(this)},hn.prototype.entries=function(){return this.__iterator(l)},hn.prototype.__iterator=function(t,e){return vn(this).__iterator(t,e)},hn.prototype.__iterate=function(t,e){return vn(this).__iterate(t,e)},hn.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._values.__ensureOwner(t);return t?_n(this,e,t):(this.__ownerID=t,this._values=e,this)},hn.isRecord=P,hn.getDescriptiveName=ln;var pn=hn.prototype;function _n(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._values=e,n.__ownerID=r,n}function ln(t){return t.constructor.displayName||t.constructor.name||"Record"}function vn(t){return it(t._keys.map((function(e){return[e,t.get(e)]})))}function yn(t,e){try{Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){be(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}catch(t){}}pn[C]=!0,pn[O]=pn.remove,pn.deleteIn=pn.removeIn=tr,pn.getIn=Vr,pn.hasIn=$r.hasIn,pn.merge=Zt,pn.mergeWith=$t,pn.mergeIn=pe,pn.mergeDeep=ce,pn.mergeDeepWith=fe,pn.mergeDeepIn=he,pn.setIn=le,pn.update=ve,pn.updateIn=ye,pn.withMutations=ge,pn.asMutable=at,pn.asImmutable=st,pn[d]=pn.entries,pn.toJSON=pn.toObject=$r.toObject,pn.inspect=pn.toSource=function(){return this.toString()};var dn,gn=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(dn)return dn;dn=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 Ft(this._value,t)},e.prototype.slice=function(t,r){var n=this.size;return U(t,r,n)?this:new e(this._value,B(r,n)-T(t,n))},e.prototype.reverse=function(){return this},e.prototype.indexOf=function(t){return Ft(this._value,t)?0:-1},e.prototype.lastIndexOf=function(t){return Ft(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 g((function(){return i===n?{value:void 0,done:!0}:w(t,e?n-++i:i++,r._value)}))},e.prototype.equals=function(t){return t instanceof e?Ft(this._value,t._value):Rr(this,t)},e}(G);function wn(t,e,r,n,i,o){if("string"!=typeof r&&!W(r)&&(Q(r)||b(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 wn(t,e,n,o,i,r)})),i&&i.slice());return t.pop(),i&&i.pop(),u}return r}function mn(t,e){return r(e)?e.toList():i(e)?e.toMap():e.toSet()}var bn=a;t.Collection=a,t.Iterable=bn,t.List=nr,t.Map=Se,t.OrderedMap=dr,t.OrderedSet=un,t.PairSorting={LeftThenRight:-1,RightThenLeft:1},t.Range=Tr,t.Record=hn,t.Repeat=gn,t.Seq=X,t.Set=Lr,t.Stack=Sr,t.fromJS=function(t,e){return wn([],e||mn,t,"",e&&e.length>2?[]:void 0,{"":t})},t.get=Qe,t.getIn=Jr,t.has=Ye,t.hasIn=Yr,t.hash=pt,t.is=Ft,t.isAssociative=o,t.isCollection=s,t.isImmutable=W,t.isIndexed=r,t.isKeyed=i,t.isList=rr,t.isMap=me,t.isOrdered=H,t.isOrderedMap=vr,t.isOrderedSet=on,t.isPlainObject=re,t.isRecord=P,t.isSeq=V,t.isSet=Kr,t.isStack=zr,t.isValueObject=Xt,t.merge=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return ae(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 ae(e,r,t)},t.remove=Xe,t.removeIn=$e,t.set=Fe,t.setIn=_e,t.update=Gt,t.updateIn=Ge,t.version="5.1.6"}));
|
|
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="@@__IMMUTABLE_INDEXED__@@";function r(t){return Boolean(t&&t[e])}var n="@@__IMMUTABLE_KEYED__@@";function i(t){return Boolean(t&&t[n])}function o(t){return i(t)||r(t)}var u="@@__IMMUTABLE_ITERABLE__@@";function s(t){return Boolean(t&&t[u])}var a=function(t){return s(t)?t:Q(t)},c=function(t){function e(t){return i(t)?t:X(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(a),f=function(t){function e(t){return r(t)?t:G(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(a),h=function(t){function e(t){return s(t)&&!o(t)?t:Z(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(a);a.Keyed=c,a.Indexed=f,a.Set=h;var p=0,_=1,l=2,v="function"==typeof Symbol&&Symbol.iterator,y="@@iterator",d=v||y,g=function(t){this.next=t};function w(t,e,r,n){var i=t===p?e:t===_?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function m(){return{value:void 0,done:!0}}function b(t){return!!Array.isArray(t)||!!I(t)}function z(t){return!(!t||"function"!=typeof t.next)}function S(t){var e=I(t);return e&&e.call(t)}function I(t){var e=t&&(v&&t[v]||t[y]);if("function"==typeof e)return e}g.prototype.toString=function(){return"[Iterator]"},g.KEYS=p,g.VALUES=_,g.ENTRIES=l,g.prototype.inspect=g.prototype.toSource=function(){return this.toString()},g.prototype[d]=function(){return this};var O="delete",E=5,j=1<<E,M=j-1,q={};function x(t){t&&(t.value=!0)}function D(){}function A(t){return void 0===t.size&&(t.size=t.__iterate(R)),t.size}function k(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 R(){return!0}function U(t,e,r){return(0===t&&!L(t)||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&e>=r)}function T(t,e){return K(t,e,0)}function B(t,e){return K(t,e,e)}function K(t,e,r){return void 0===t?r:L(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function L(t){return t<0||0===t&&1/t==-1/0}var C="@@__IMMUTABLE_RECORD__@@";function N(t){return Boolean(t&&t[C])}function P(t){return s(t)||N(t)}var W="@@__IMMUTABLE_ORDERED__@@";function H(t){return Boolean(t&&t[W])}var J="@@__IMMUTABLE_SEQ__@@";function V(t){return Boolean(t&&t[J])}var F=Object.prototype.hasOwnProperty;function Y(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 Q=function(t){function e(t){return null==t?nt():P(t)?t.toSeq():function(t){var e=ut(t);if(e)return(n=I(r=t))&&n===r.entries?e.fromEntrySeq():function(t){var e=I(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 g((function(){if(i===n)return{value:void 0,done:!0};var o=r[e?n-++i:i++];return w(t,o[0],o[1])}))}return this.__iteratorUncached(t,e)},e}(a),X=function(t){function e(t){return null==t?nt().toKeyedSeq():s(t)?i(t)?t.toSeq():t.fromEntrySeq():N(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}(Q),G=function(t){function e(t){return null==t?nt():s(t)?i(t)?t.entrySeq():t.toIndexedSeq():N(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}(Q),Z=function(t){function e(t){return(s(t)&&!o(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}(Q);Q.isSeq=V,Q.Keyed=X,Q.Set=Z,Q.Indexed=G,Q.prototype[J]=!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[k(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 g((function(){if(i===n)return{value:void 0,done:!0};var o=e?n-++i:i++;return w(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 F.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 g((function(){if(o===i)return{value:void 0,done:!0};var u=n[e?i-++o:o++];return w(t,u,r[u])}))},e}(X);tt.prototype[W]=!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=S(this._collection),n=0;if(z(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=S(this._collection);if(!z(r))return new g(m);var n=0;return new g((function(){var e=r.next();return e.done?e:w(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 Y(t)?new $(t):b(t)?new rt(t):void 0}function st(){return this.__ensureOwner()}function at(){return this.__ownerID?this:this.__ensureOwner(new D)}var ct="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 ft(t){return t>>>1&1073741824|3221225471&t}var ht=Object.prototype.valueOf;function pt(t){if(null==t)return _t(t);if("function"==typeof t.hashCode)return ft(t.hashCode(t));var e,r=(e=t).valueOf!==ht&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return _t(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 ft(e)}(r);case"string":return r.length>Ot?function(t){var e=Mt[t];void 0===e&&(e=lt(t),jt===Et&&(jt=0,Mt={}),jt++,Mt[t]=e);return e}(r):lt(r);case"object":case"function":return function(t){var e;if(bt&&void 0!==(e=mt.get(t)))return e;if(e=t[It],void 0!==e)return e;if(!gt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[It]))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=wt(),bt)mt.set(t,e);else{if(void 0!==dt&&!1===dt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(gt)Object.defineProperty(t,It,{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[It]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[It]=e}}return e}(r);case"symbol":return function(t){var e=zt[t];if(void 0!==e)return e;return e=wt(),zt[t]=e,e}(r);default:if("function"==typeof r.toString)return lt(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function _t(t){return null===t?1108378658:1108378659}function lt(t){for(var e=0,r=0;r<t.length;r++)e=31*e+t.charCodeAt(r)|0;return ft(e)}var vt=(1048576*Math.random()|1)%1048576||40503;function yt(t){if("string"!=typeof t)return pt(t);for(var e=0,r=0;r<t.length;r++)e=vt*e+t.charCodeAt(r)|0;return e}var dt=Object.isExtensible,gt=function(){try{return Object.defineProperty({},"@",{}),!0}catch(t){return!1}}();function wt(){var t=++St;return 1073741824&St&&(St=0),t}var mt,bt="function"==typeof WeakMap;bt&&(mt=new WeakMap);var zt=Object.create(null),St=0,It="__immutablehash__";"function"==typeof Symbol&&(It=Symbol(It));var Ot=16,Et=255,jt=0,Mt={},qt=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=Ut(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},e.prototype.map=function(t,e){var r=this,n=Rt(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}(X);qt.prototype[W]=!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(_,e),i=0;return e&&A(this),new g((function(){var o=n.next();return o.done?o:w(t,e?r.size-++i:i++,o.value,o)}))},e}(G),Dt=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(_,e);return new g((function(){var e=r.next();return e.done?e:w(t,e.value,e.value,e)}))},e}(Z),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.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=s(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(_,e);return new g((function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n){Vt(n);var i=s(n);return w(t,i?n.get(0):n[0],i?n.get(1):n[1],e)}}}))},e}(X);function kt(t){var e=Yt(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=Qt,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===l){var n=t.__iterator(e,r);return new g((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===_?p:_,r)},e}function Rt(t,e,r){var n=Yt(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var o=t.get(n,q);return o===q?i:e.call(r,o,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(l,i);return new g((function(){var i=o.next();if(i.done)return i;var u=i.value,s=u[0];return w(n,s,e.call(r,u[1],s,t),i)}))},n}function Ut(t,e){var r=Yt(t);return r._iter=t,r.size=t.size,r.reverse=function(){return t},t.flip&&(r.flip=function(){var e=kt(t);return e.reverse=function(){return t.flip()},e}),r.get=function(r,n){return t.get(e?r:-1-r,n)},r.has=function(r){return t.has(e?r:-1-r)},r.includes=function(e){return t.includes(e)},r.cacheResult=Qt,r.__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)},r.__iterator=function(n,i){var o=0;i&&A(t);var u=t.__iterator(l,!i);return new g((function(){var t=u.next();if(t.done)return t;var s=t.value;return w(n,e?s[0]:i?r.size-++o:o++,s[1],t)}))},r}function Tt(t,e,r,n){var i=Yt(t);return n&&(i.has=function(n){var i=t.get(n,q);return i!==q&&!!e.call(r,i,n,t)},i.get=function(n,i){var o=t.get(n,q);return o!==q&&e.call(r,o,n,t)?o: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(l,o),s=0;return new g((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 w(i,n?c:s++,f,o)}}))},i}function Bt(t,e,r,n){var i=t.size;if(U(e,r,i))return t;if(void 0===i&&(e<0||r<0))return Bt(t.toSeq().cacheResult(),e,r,n);var o,u=T(e,i),s=B(r,i)-u;s==s&&(o=s<0?0:s);var a=Yt(t);return a.size=0===o?o:t.size&&o||void 0,!n&&V(t)&&o>=0&&(a.get=function(e,r){return(e=k(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 g(m);var i=t.__iterator(e,r),s=0,a=0;return new g((function(){for(;s++<u;)i.next();if(++a>o)return{value:void 0,done:!0};var t=i.next();return n||e===_||t.done?t:w(e,a-1,e===p?void 0:t.value[1],t)}))},a}function Kt(t,e,r,n){var i=Yt(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(l,o),a=!0,c=0;return new g((function(){var t,o,f;do{if((t=s.next()).done)return n||i===_?t:w(i,c++,i===p?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===l?t:w(i,o,f,t)}))},i}xt.prototype.cacheResult=qt.prototype.cacheResult=Dt.prototype.cacheResult=At.prototype.cacheResult=Qt;var Lt=function(t){function r(t){this._wrappedIterables=t.flatMap((function(t){return t._wrappedIterables?t._wrappedIterables:[t]})),this.size=this._wrappedIterables.reduce((function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}}),0),this[n]=this._wrappedIterables[0][n],this[e]=this._wrappedIterables[0][e],this[W]=this._wrappedIterables[0][W]}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.__iterateUncached=function(t,e){if(0!==this._wrappedIterables.length){if(e)return this.cacheResult().__iterate(t,e);for(var r=0,n=i(this),o=n?l:_,u=this._wrappedIterables[r].__iterator(o,e),s=!0,a=0;s;){for(var c=u.next();c.done;){if(++r===this._wrappedIterables.length)return a;c=(u=this._wrappedIterables[r].__iterator(o,e)).next()}s=!1!==(n?t(c.value[1],c.value[0],this):t(c.value,a,this)),a++}return a}},r.prototype.__iteratorUncached=function(t,e){var r=this;if(0===this._wrappedIterables.length)return new g(m);if(e)return this.cacheResult().__iterator(t,e);var n=0,i=this._wrappedIterables[n].__iterator(t,e);return new g((function(){for(var o=i.next();o.done;){if(++n===r._wrappedIterables.length)return o;o=(i=r._wrappedIterables[n].__iterator(t,e)).next()}return o}))},r}(Q);function Ct(t,e,r){var n=Yt(t);return n.__iterateUncached=function(i,o){if(o)return this.cacheResult().__iterate(i,o);var u=0,a=!1;return function t(c,f){c.__iterate((function(o,c){return(!e||f<e)&&s(o)?t(o,f+1):(u++,!1===i(o,r?c:u-1,n)&&(a=!0)),!a}),o)}(t,0),u},n.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var o=t.__iterator(n,i),u=[],a=0;return new g((function(){for(;o;){var t=o.next();if(!1===t.done){var c=t.value;if(n===l&&(c=c[1]),e&&!(u.length<e)||!s(c))return r?t:w(n,a++,c,t);u.push(o),o=c.__iterator(n,i)}else o=u.pop()}return{value:void 0,done:!0}}))},n}function Nt(t,e,n){e||(e=Xt);var o=i(t),u=0,s=t.toSeq().map((function(e,r){return[r,e,u++,n?n(e,r,t):e]})).valueSeq().toArray();return s.sort((function(t,r){return e(t[3],r[3])||t[2]-r[2]})).forEach(o?function(t,e){s[e].length=2}:function(t,e){s[e]=t[1]}),o?X(s):r(t)?G(s):Z(s)}function Pt(t,e,r){if(e||(e=Xt),r){var n=t.toSeq().map((function(e,n){return[e,r(e,n,t)]})).reduce((function(t,r){return Wt(e,t[1],r[1])?r:t}));return n&&n[0]}return t.reduce((function(t,r){return Wt(e,t,r)?r:t}))}function Wt(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=Yt(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(_,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=a(t),S(i?t.reverse():t)})),u=0,s=!1;return new g((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}:w(t,u++,e.apply(null,r.map((function(t){return t.value}))))}))},i}function Jt(t,e){return t===e?t:V(t)?e:t.constructor(e)}function Vt(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Ft(t){return i(t)?c:r(t)?f:h}function Yt(t){return Object.create((i(t)?X:r(t)?G:Z).prototype)}function Qt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Q.prototype.cacheResult.call(this)}function Xt(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){return Boolean(t&&"function"==typeof t.equals&&"function"==typeof t.hashCode)}function Zt(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!!(Gt(t)&&Gt(e)&&t.equals(e))}function $t(t,e,r,n){return tr(t,[e],r,n)}function te(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return re(this,t)}function ee(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 re(this,e,t)}function re(t,e,r){for(var n=[],i=0;i<e.length;i++){var o=c(e[i]);0!==o.size&&n.push(o)}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){$t(t,n,q,(function(t){return t===q?e:r(t,e,n)}))}:function(e,r){t.set(r,e)},i=0;i<n.length;i++)n[i].forEach(e)})):N(t)?t:t.constructor(n[0])}var ne=Object.prototype.toString;function ie(t){if(!t||"object"!=typeof t||"[object Object]"!==ne.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 oe(t){return"object"==typeof t&&(P(t)||Array.isArray(t)||ie(t))}function ue(t){return"string"==typeof t&&("__proto__"===t||"constructor"===t)}function se(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 ae(t){if(Array.isArray(t))return se(t);var e={};for(var r in t)ue(r)||F.call(t,r)&&(e[r]=t[r]);return e}function ce(t,e,n){return fe(t,e,function(t){function e(n,o,u){return oe(n)&&oe(o)&&(s=o,a=Q(n),c=Q(s),r(a)===r(c)&&i(a)===i(c))?fe(n,[o],e):t?t(n,o,u):o;var s,a,c}return e}(n))}function fe(t,e,r){if(!oe(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(P(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?f:c,u=n?function(e){i===t&&(i=ae(i)),i.push(e)}:function(e,n){if(!ue(n)){var o=F.call(i,n),u=o&&r?r(i[n],e,n):e;o&&u===i[n]||(i===t&&(i=ae(i)),i[n]=u)}},s=0;s<e.length;s++)o(e[s]).forEach(u);return i}function he(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return ce(this,t)}function pe(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return ce(this,e,t)}function _e(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return tr(this,t,Be(),(function(t){return ce(t,e)}))}function le(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return tr(this,t,Be(),(function(t){return fe(t,e)}))}function ve(t,e,r){return tr(t,e,q,(function(){return r}))}function ye(t,e){return ve(this,t,e)}function de(t,e,r){return 1===arguments.length?t(this):$t(this,t,e,r)}function ge(t,e,r){return tr(this,t,e,r)}function we(){return this.__altered}function me(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}var be="@@__IMMUTABLE_MAP__@@";function ze(t){return Boolean(t&&t[be])}function Se(t,e){if(!t)throw new Error(e)}function Ie(t){Se(t!==1/0,"Cannot perform this action with an infinite size.")}var Oe=function(t){function e(e){return null==e?Be():ze(e)&&!H(e)?e:Be().withMutations((function(r){var n=t(e);Ie(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 Ke(this,t,e)},e.prototype.remove=function(t){return Ke(this,t,q)},e.prototype.deleteAll=function(t){var e=a(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):Be()},e.prototype.sort=function(t){return zr(Nt(this,t))},e.prototype.sortBy=function(t,e){return zr(Nt(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 ke(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?Te(this.size,this._root,t,this.__hash):0===this.size?Be():(this.__ownerID=t,this.__altered=!1,this)},e}(c);Oe.isMap=ze;var Ee=Oe.prototype;Ee[be]=!0,Ee[O]=Ee.remove,Ee.removeAll=Ee.deleteAll,Ee.setIn=ye,Ee.removeIn=Ee.deleteIn=nr,Ee.update=de,Ee.updateIn=ge,Ee.merge=Ee.concat=te,Ee.mergeWith=ee,Ee.mergeDeep=he,Ee.mergeDeepWith=pe,Ee.mergeIn=le,Ee.mergeDeepIn=_e,Ee.withMutations=me,Ee.wasAltered=we,Ee.asImmutable=st,Ee["@@transducer/init"]=Ee.asMutable=at,Ee["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Ee["@@transducer/result"]=function(t){return t.asImmutable()};var je=function(t,e){this.ownerID=t,this.entries=e};je.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;o<u;o++)if(Zt(r,i[o][0]))return i[o][1];return n},je.prototype.update=function(t,e,r,n,i,o,u){for(var s=i===q,a=this.entries,c=0,f=a.length;c<f&&!Zt(n,a[c][0]);c++);var h=c<f;if(h?a[c][1]===i:s)return this;if(x(u),(s||!h)&&x(o),!s||1!==a.length){if(!h&&!s&&a.length>=He)return function(t,e,r,n){t||(t=new D);for(var i=new De(t,pt(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,a,n,i);var p=t&&t===this.ownerID,_=p?a:se(a);return h?s?c===f-1?_.pop():_[c]=_.pop():_[c]=[n,i]:_.push([n,i]),p?(this.entries=_,this):new je(t,_)}};var Me=function(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r};Me.prototype.get=function(t,e,r,n){void 0===e&&(e=pt(r));var i=1<<((0===t?e:e>>>t)&M),o=this.bitmap;return 0==(o&i)?n:this.nodes[Pe(o&i-1)].get(t+E,e,r,n)},Me.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=pt(n));var s=(0===e?r:r>>>e)&M,a=1<<s,c=this.bitmap,f=0!=(c&a);if(!f&&i===q)return this;var h=Pe(c&a-1),p=this.nodes,_=f?p[h]:void 0,l=Le(_,t,e+E,r,n,i,o,u);if(l===_)return this;if(!f&&l&&p.length>=Je)return function(t,e,r,n,i){for(var o=0,u=new Array(j),s=0;0!==r;s++,r>>>=1)u[s]=1&r?e[o++]:void 0;return u[n]=i,new qe(t,o+1,u)}(t,p,c,s,l);if(f&&!l&&2===p.length&&Ce(p[1^h]))return p[1^h];if(f&&l&&1===p.length&&Ce(l))return l;var v=t&&t===this.ownerID,y=f?l?c:c^a:c|a,d=f?l?We(p,h,l,v):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}(p,h,v):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}(p,h,l,v);return v?(this.bitmap=y,this.nodes=d,this):new Me(t,y,d)};var qe=function(t,e,r){this.ownerID=t,this.count=e,this.nodes=r};qe.prototype.get=function(t,e,r,n){void 0===e&&(e=pt(r));var i=(0===t?e:e>>>t)&M,o=this.nodes[i];return o?o.get(t+E,e,r,n):n},qe.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=pt(n));var s=(0===e?r:r>>>e)&M,a=i===q,c=this.nodes,f=c[s];if(a&&!f)return this;var h=Le(f,t,e+E,r,n,i,o,u);if(h===f)return this;var p=this.count;if(f){if(!h&&--p<Ve)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 Me(t,i,u)}(t,c,p,s)}else p++;var _=t&&t===this.ownerID,l=We(c,s,h,_);return _?(this.count=p,this.nodes=l,this):new qe(t,p,l)};var xe=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r,this._index=void 0};xe.prototype._positionOf=function(t,e){var r=this.entries,n=this._index;if(void 0===n&&e&&r.length>=Fe&&(n=this._buildIndex()),void 0!==n){var i=n[yt(t)];if(void 0!==i)for(var o=0;o<i.length;o++){var u=i[o];if(Zt(t,r[u][0]))return u}return-1}for(var s=0,a=r.length;s<a;s++)if(Zt(t,r[s][0]))return s;return-1},xe.prototype._buildIndex=function(){for(var t=Object.create(null),e=this.entries,r=0,n=e.length;r<n;r++){var i=yt(e[r][0]),o=t[i];void 0!==o?o.push(r):t[i]=[r]}return this._index=t,t},xe.prototype.get=function(t,e,r,n){var i=this._positionOf(r,!0);return-1===i?n:this.entries[i][1]},xe.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=pt(n));var s=i===q;if(r!==this.keyHash)return s?this:(x(u),x(o),Ne(this,t,e,r,[n,i]));var a=this.entries,c=a.length,f=t&&t===this.ownerID,h=this._positionOf(n,f),p=-1===h?c:h,_=-1!==h;if(_?a[p][1]===i:s)return this;if(x(u),(s||!_)&&x(o),s&&2===c)return new De(t,this.keyHash,a[1^p]);var l=f?a:se(a);if(_)s?(p===c-1?l.pop():l[p]=l.pop(),f&&(this._index=void 0)):l[p]=[n,i];else if(l.push([n,i]),f&&void 0!==this._index){var v=yt(n),y=this._index[v];void 0!==y?y.push(c):this._index[v]=[c]}return f?(this.entries=l,this):new xe(t,this.keyHash,l)};var De=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r};De.prototype.get=function(t,e,r,n){return Zt(r,this.entry[0])?this.entry[1]:n},De.prototype.update=function(t,e,r,n,i,o,u){var s=i===q,a=Zt(n,this.entry[0]);return(a?i===this.entry[1]:s)?this:(x(u),s?void x(o):a?t&&t===this.ownerID?(this.entry[1]=i,this):new De(t,this.keyHash,[n,i]):(x(o),Ne(this,t,e,pt(n),[n,i])))},je.prototype.iterate=xe.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},Me.prototype.iterate=qe.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}},De.prototype.iterate=function(t,e){return t(this.entry)};var Ae,ke=function(t){function e(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&Ue(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 Re(t,r.entry)}else if(r.entries){if(n<=(i=r.entries.length-1))return Re(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 Re(t,o.entry);e=this._stack=Ue(o,e)}continue}e=this._stack=this._stack.__prev}return{value:void 0,done:!0}},e}(g);function Re(t,e){return w(t,e[0],e[1])}function Ue(t,e){return{node:t,index:0,__prev:e}}function Te(t,e,r,n){var i=Object.create(Ee);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Be(){return Ae||(Ae=Te(0))}function Ke(t,e,r){var n,i;if(t._root){var o={value:!1},u={value:!1};if(n=Le(t._root,t.__ownerID,0,void 0,e,r,o,u),!u.value)return t;i=t.size+(o.value?r===q?-1:1:0)}else{if(r===q)return t;i=1,n=new je(t.__ownerID,[[e,r]])}return t.__ownerID?(t.size=i,t._root=n,t.__hash=void 0,t.__altered=!0,t):n?Te(i,n):Be()}function Le(t,e,r,n,i,o,u,s){return t?t.update(e,r,n,i,o,u,s):o===q?t:(x(s),x(u),new De(e,n,[i,o]))}function Ce(t){return t.constructor===De||t.constructor===xe}function Ne(t,e,r,n,i){if(t.keyHash===n)return new xe(e,n,[t.entry,i]);var o,u=(0===r?t.keyHash:t.keyHash>>>r)&M,s=(0===r?n:n>>>r)&M,a=u===s?[Ne(t,e,r+E,n,i)]:(o=new De(e,n,i),u<s?[t,o]:[o,t]);return new Me(e,1<<u|1<<s,a)}function Pe(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function We(t,e,r,n){var i=n?t:se(t);return i[e]=r,i}var He=j/4,Je=j/2,Ve=j/4,Fe=16;function Ye(t){if(Y(t)&&"string"!=typeof t)return t;if(H(t))return t.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+t)}function Qe(t){try{return"string"==typeof t?JSON.stringify(t):String(t)}catch(e){return JSON.stringify(t)}}function Xe(t,e){return P(t)?t.has(e):oe(t)&&F.call(t,e)}function Ge(t,e,r){return P(t)?t.get(e,r):Xe(t,e)?"function"==typeof t.get?t.get(e):t[e]:r}function Ze(t,e){if(!oe(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(P(t)){if(!t.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+t);return t.remove(e)}if(!F.call(t,e))return t;var r=ae(t);return Array.isArray(r)?r.splice(e,1):delete r[e],r}function $e(t,e,r){if(ue(e))return t;if(!oe(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(P(t)){if(!t.set)throw new TypeError("Cannot update immutable value without .set() method: "+t);return t.set(e,r)}if(F.call(t,e)&&r===t[e])return t;var n=ae(t);return n[e]=r,n}function tr(t,e,r,n){n||(n=r,r=void 0);var i=er(P(t),t,Ye(e),0,r,n);return i===q?r:i}function er(t,e,r,n,i,o){var u=e===q;if(n===r.length){var s=u?i:e,a=o(s);return a===s?e:a}if(!u&&!oe(e))throw new TypeError("Cannot update within non-data-structure value in path ["+Array.from(r).slice(0,n).map(Qe)+"]: "+e);var c=r[n],f=u?q:Ge(e,c,q),h=er(f===q?t:P(f),f,r,n+1,i,o);return h===f?e:h===q?Ze(e,c):$e(u?t?Be():{}:e,c,h)}function rr(t,e){return tr(t,e,(function(){return q}))}function nr(t){return rr(this,t)}var ir="@@__IMMUTABLE_LIST__@@";function or(t){return Boolean(t&&t[ir])}var ur=function(t){function e(e){var r=pr();if(null==e)return r;if(or(e))return e;var n=t(e),i=n.size;return 0===i?r:(Ie(i),i>0&&i<j?hr(0,i,E,null,new ar(n.toArray())):r.withMutations((function(t){t.setSize(i),n.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=k(this,t))>=0&&t<this.size){var r=vr(this,t+=this._origin);return r&&r.array[t&M]}return e},e.prototype.set=function(t,e){return function(t,e,r){if(e=k(t,e),e!=e)return t;if(e>=t.size||e<0)return t.withMutations((function(t){e<0?yr(t,e).set(0,r):yr(t,0,e+1).set(e,r)}));e+=t._origin;var n=t._tail,i=t._root,o={value:!1};e>=dr(t._capacity)?n=_r(n,t.__ownerID,0,e,r,o):i=_r(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 hr(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=E,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):pr()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(r){yr(r,0,e+t.length);for(var n=0;n<t.length;n++)r.set(e+n,t[n])}))},e.prototype.pop=function(){return yr(this,0,-1)},e.prototype.unshift=function(){var t=arguments;return this.withMutations((function(e){yr(e,-t.length);for(var r=0;r<t.length;r++)e.set(r,t[r])}))},e.prototype.shift=function(){return yr(this,1)},e.prototype.shuffle=function(t){return void 0===t&&(t=Math.random),this.withMutations((function(e){for(var r,n,i=e.size;i;)r=Math.floor(t()*i--),n=e.get(r),e.set(r,e.get(i)),e.set(i,n)}))},e.prototype.concat=function(){for(var e=arguments,r=[],n=0;n<arguments.length;n++){var i=e[n],o=t("string"!=typeof i&&b(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 yr(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 U(t,e,r)?this:yr(this,T(t,r),B(e,r))},e.prototype.__iterator=function(t,e){var r=e?this.size:0,n=fr(this,e);return new g((function(){var i=n();return i===cr?{value:void 0,done:!0}:w(t,e?--r:r++,i)}))},e.prototype.__iterate=function(t,e){for(var r,n=e?this.size:0,i=fr(this,e);(r=i())!==cr&&!1!==t(r,e?--n:n++,this););return n},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?hr(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):0===this.size?pr():(this.__ownerID=t,this.__altered=!1,this)},e}(f);ur.isList=or;var sr=ur.prototype;sr[ir]=!0,sr[O]=sr.remove,sr.merge=sr.concat,sr.setIn=ye,sr.deleteIn=sr.removeIn=nr,sr.update=de,sr.updateIn=ge,sr.mergeIn=le,sr.mergeDeepIn=_e,sr.withMutations=me,sr.wasAltered=we,sr.asImmutable=st,sr["@@transducer/init"]=sr.asMutable=at,sr["@@transducer/step"]=function(t,e){return t.push(e)},sr["@@transducer/result"]=function(t){return t.asImmutable()};var ar=function(t,e){this.array=t,this.ownerID=e};ar.prototype.removeBefore=function(t,e,r){if(0==(r&(1<<e+E)-1)||0===this.array.length)return this;var n=r>>>e&M;if(n>=this.array.length)return new ar([],t);var i,o=0===n;if(e>0){var u=this.array[n];if((i=u&&u.removeBefore(t,e-E,r))===u&&o)return this}if(o&&!i)return this;var s=lr(this,t);if(!o)for(var a=0;a<n;a++)s.array[a]=void 0;return i&&(s.array[n]=i),s},ar.prototype.removeAfter=function(t,e,r){if(r===(e?1<<e+E:j)||0===this.array.length)return this;var n,i=r-1>>>e&M;if(i>=this.array.length)return this;if(e>0){var o=this.array[i];if((n=o&&o.removeAfter(t,e-E,r))===o&&i===this.array.length-1)return this}var u=lr(this,t);return u.array.splice(i+1),n&&(u.array[i]=n),u};var cr={};function fr(t,e){var r=t._origin,n=t._capacity,i=dr(n),o=t._tail;return u(t._root,t._level,0);function u(t,s,a){return 0===s?function(t,u){var s=u===i?o&&o.array:t&&t.array,a=u>r?0:r-u,c=n-u;c>j&&(c=j);return function(){if(a===c)return cr;var t=e?--c:a++;return s&&s[t]}}(t,a):function(t,i,o){var s,a=t&&t.array,c=o>r?0:r-o>>i,f=1+(n-o>>i);f>j&&(f=j);return function(){for(;;){if(s){var t=s();if(t!==cr)return t;s=null}if(c===f)return cr;var r=e?--f:c++;s=u(a&&a[r],i-E,o+(r<<i))}}}(t,s,a)}}function hr(t,e,r,n,i,o,u){var s=Object.create(sr);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 pr(){return hr(0,0,E)}function _r(t,e,r,n,i,o){var u,s=n>>>r&M,a=t&&s<t.array.length;if(!a&&void 0===i)return t;if(r>0){var c=t&&t.array[s],f=_r(c,e,r-E,n,i,o);return f===c?t:((u=lr(t,e)).array[s]=f,u)}return a&&t.array[s]===i?t:(o&&x(o),u=lr(t,e),void 0===i&&s===u.array.length-1?u.array.pop():u.array[s]=i,u)}function lr(t,e){return e&&t&&e===t.ownerID?t:new ar(t?t.array.slice():[],e)}function vr(t,e){if(e>=dr(t._capacity))return t._tail;if(e<1<<t._level+E){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&M],n-=E;return r}}function yr(t,e,r){!function(t,e,r){var n=t._origin+(void 0===e?0:e),i=void 0===r?t._capacity:r<0?t._capacity+r:t._origin+r;if(Number.isFinite(i)&&i>gr||Number.isFinite(n)&&n<-gr||Number.isFinite(i)&&Number.isFinite(n)&&i-n>gr)throw new RangeError("Invalid List size: a List cannot hold more than "+gr+" (2 ** 30) values.")}(t,e,r),void 0!==e&&(e|=0),void 0!==r&&(r|=0);var n=t.__ownerID||new D,i=t._origin,o=t._capacity,u=i+e,s=void 0===r?o:r<0?o+r:i+r;if(u===i&&s===o)return t;if(u>=s)return t.clear();for(var a=t._level,c=t._root,f=0;u+f<0;)c=new ar(c&&c.array.length?[void 0,c]:[],n),f+=wr(a+=E);f&&(u+=f,i+=f,s+=f,o+=f);for(var h=dr(o),p=dr(s);p>=wr(a+E);)c=new ar(c&&c.array.length?[c]:[],n),a+=E;var _=t._tail,l=p<h?vr(t,s-1):p>h?new ar([],n):_;if(_&&p>h&&u<o&&_.array.length){for(var v=c=lr(c,n),y=a;y>E;y-=E){var d=h>>>y&M;v=v.array[d]=lr(v.array[d],n)}v.array[h>>>E&M]=_}if(s<o&&(l=l&&l.removeAfter(n,0,s)),u>=p)u-=p,s-=p,a=E,c=null,l=l&&l.removeBefore(n,0,u);else if(u>i||p<h){for(f=0;c;){var g=u>>>a&M;if(g!==p>>>a&M)break;g&&(f+=(1<<a)*g),a-=E,c=c.array[g]}c&&u>i&&(c=c.removeBefore(n,a,u-f)),c&&p<h&&(c=c.removeAfter(n,a,p-f)),f&&(u-=f,s-=f)}return t.__ownerID?(t.size=s-u,t._origin=u,t._capacity=s,t._level=a,t._root=c,t._tail=l,t.__hash=void 0,t.__altered=!0,t):hr(u,s,a,c,l)}function dr(t){return t<j?0:t-1>>>E<<E}var gr=Math.pow(2,30);function wr(t){return t<31?1<<t:Math.pow(2,t)}function mr(t){return ze(t)&&H(t)}var br,zr=function(t){function e(t){return null==t?Ir():mr(t)?t:Ir().withMutations((function(e){var r=c(t);Ie(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):Ir()},e.prototype.set=function(t,e){return Or(this,t,e)},e.prototype.remove=function(t){return Or(this,t,q)},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?Sr(e,r,t,this.__hash):0===this.size?Ir():(this.__ownerID=t,this.__altered=!1,this._map=e,this._list=r,this)},e}(Oe);function Sr(t,e,r,n){var i=Object.create(zr.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 Ir(){return br||(br=Sr(Be(),pr()))}function Or(t,e,r){var n,i,o=t._map,u=t._list,s=o.get(e),a=void 0!==s;if(r===q){if(!a)return t;u.size>=j&&u.size>=2*o.size?(n=(i=u.filter((function(t,e){return void 0!==t&&s!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(r===u.get(s)[1])return t;n=o,i=u.set(s,[e,r])}else n=o.set(e,u.size),i=u.set(u.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t.__altered=!0,t):Sr(n,i)}zr.isOrderedMap=mr,zr.prototype[W]=!0,zr.prototype[O]=zr.prototype.remove;var Er="@@__IMMUTABLE_STACK__@@";function jr(t){return Boolean(t&&t[Er])}var Mr=function(t){function e(t){return null==t?Ar():jr(t)?t:Ar().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=k(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):Dr(e,r)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&jr(e))return e;Ie(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):Dr(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):Ar()},e.prototype.slice=function(e,r){if(U(e,r,this.size))return this;var n=T(e,this.size);if(B(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):Dr(i,o)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Dr(this.size,this._head,t,this.__hash):0===this.size?Ar():(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 g((function(){if(n){var e=n.value;return n=n.next,w(t,r++,e)}return{value:void 0,done:!0}}))},e}(f);Mr.isStack=jr;var qr,xr=Mr.prototype;function Dr(t,e,r,n){var i=Object.create(xr);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Ar(){return qr||(qr=Dr(0))}function kr(t,e,r,n,i,o){return Ie(t.size),t.__iterate((function(t,o,u){i?(i=!1,r=t):r=e.call(n,r,t,o,u)}),o),r}function Rr(t,e){return e}function Ur(t,e){return[e,t]}function Tr(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return!t.apply(this,e)}}function Br(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return-t.apply(this,e)}}function Kr(t,e){return t<e?1:t>e?-1:0}function Lr(t,e){if(t===e)return!0;if(!s(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||i(t)!==i(e)||r(t)!==r(e)||H(t)!==H(e))return!1;if(0===t.size&&0===e.size)return!0;var n=!o(t);if(H(t)){var u=t.entries();return e.every((function(t,e){var r=u.next().value;return r&&Zt(r[1],t)&&(n||Zt(r[0],e))}))&&u.next().done}var a=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{a=!0;var c=t;t=e,e=c}var f=!0,h=e.__iterate((function(e,r){if(n?!t.has(e):a?!Zt(e,t.get(r,q)):!Zt(t.get(r,q),e))return f=!1,!1}));return f&&t.size===h}xr[Er]=!0,xr.shift=xr.pop,xr.unshift=xr.push,xr.unshiftAll=xr.pushAll,xr.withMutations=me,xr.wasAltered=we,xr.asImmutable=st,xr["@@transducer/init"]=xr.asMutable=at,xr["@@transducer/step"]=function(t,e){return t.unshift(e)},xr["@@transducer/result"]=function(t){return t.asImmutable()};var Cr,Nr=function(t){function e(t,r,n){if(void 0===n&&(n=1),!(this instanceof e))return new e(t,r,n);if(Se(0!==n,"Cannot step a Range by 0"),Se(void 0!==t,"You must define a start value when using Range"),Se(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(Cr)return Cr;Cr=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+k(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 U(t,r,this.size)?this:(t=T(t,this.size),(r=B(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 g((function(){if(o===r)return{value:void 0,done:!0};var u=i;return i+=e?-n:n,w(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:Lr(this,t)},e}(G),Pr="@@__IMMUTABLE_SET__@@";function Wr(t){return Boolean(t&&t[Pr])}var Hr=function(t){function e(e){return null==e?Qr():Wr(e)&&!H(e)?e:Qr().withMutations((function(r){var n=t(e);Ie(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(c(t).keySeq())},e.intersect=function(t){return(t=a(t).toArray()).length?Vr.intersect.apply(e(t.pop()),t):Qr()},e.union=function(t){return(t=a(t).toArray()).length?Vr.union.apply(e(t.pop()),t):Qr()},e.prototype.toString=function(){return this.__toString("Set {","}")},e.prototype.has=function(t){return this._map.has(t)},e.prototype.add=function(t){return Fr(this,this._map.set(t,t))},e.prototype.remove=function(t){return Fr(this,this._map.remove(t))},e.prototype.clear=function(){return Fr(this,this._map.clear())},e.prototype.map=function(t,e){var r=this,n=!1,i=Fr(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 hn(Nt(this,t))},e.prototype.sortBy=function(t,e){return hn(Nt(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}(h);Hr.isSet=Wr;var Jr,Vr=Hr.prototype;function Fr(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 Yr(t,e){var r=Object.create(Vr);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function Qr(){return Jr||(Jr=Yr(Be()))}function Xr(t,e,r){for(var n=Ye(e),i=0;i!==n.length;)if((t=Ge(t,n[i++],q))===q)return r;return t}function Gr(t,e){return Xr(this,t,e)}function Zr(t,e){return Xr(t,e,q)!==q}function $r(){Ie(this.size);var t={};return this.__iterate((function(e,r){ue(r)||(t[r]=e)})),t}function tn(t){if(!t||"object"!=typeof t)return t;if(!s(t)){if(!oe(t))return t;t=Q(t)}if(i(t)){var e={};return t.__iterate((function(t,r){ue(r)||(e[r]=tn(t))})),e}var r=[];return t.__iterate((function(t){r.push(tn(t))})),r}function en(t){if(t.size===1/0)return 0;var e=H(t),r=i(t),n=e?1:0;return t.__iterate(r?e?function(t,e){n=31*n+rn(pt(t),pt(e))|0}:function(t,e){n=n+rn(pt(t),pt(e))|0}:e?function(t){n=31*n+pt(t)|0}:function(t){n=n+pt(t)|0}),function(t,e){return e=ct(e,3432918353),e=ct(e<<15|e>>>-15,461845907),e=ct(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=ct(e^e>>>16,2246822507),e=ct(e^e>>>13,3266489909),e=ft(e^e>>>16),e}(t.size,n)}function rn(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}function nn(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}Vr[Pr]=!0,Vr[O]=Vr.remove,Vr.merge=Vr.concat=Vr.union,Vr.withMutations=me,Vr.asImmutable=st,Vr["@@transducer/init"]=Vr.asMutable=at,Vr["@@transducer/step"]=function(t,e){return t.add(e)},Vr["@@transducer/result"]=function(t){return t.asImmutable()},Vr.__empty=Qr,Vr.__make=Yr,a.Iterator=g,nn(a,{toArray:function(){Ie(this.size);var t=new Array(this.size||0),e=i(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 tn(this)},toKeyedSeq:function(){return new qt(this,!0)},toMap:function(){return Oe(this.toKeyedSeq())},toObject:$r,toOrderedMap:function(){return zr(this.toKeyedSeq())},toOrderedSet:function(){return hn(i(this)?this.valueSeq():this)},toSet:function(){return Hr(i(this)?this.valueSeq():this)},toSetSeq:function(){return new Dt(this)},toSeq:function(){return r(this)?this.toIndexedSeq():i(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Mr(i(this)?this.valueSeq():this)},toList:function(){return ur(i(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 n=i(t),o=[t].concat(e).map((function(t){return s(t)?n&&(t=c(t)):t=n?it(t):ot(Array.isArray(t)?t:[t]),t})).filter((function(t){return 0!==t.size}));if(0===o.length)return t;if(1===o.length){var u=o[0];if(u===t||n&&i(u)||r(t)&&r(u))return u}return new Lt(o)}(this,t))},includes:function(t){return this.some((function(e){return Zt(e,t)}))},entries:function(){return this.__iterator(l)},every:function(t,e){Ie(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,Tt(this,t,e,!0))},partition:function(t,e){return function(t,e,r){var n=i(t),o=[[],[]];t.__iterate((function(i,u){o[e.call(r,i,u,t)?1:0].push(n?[u,i]:i)}));var u=Ft(t);return o.map((function(e){return Jt(t,u(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 Ie(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){Ie(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(p)},map:function(t,e){return Jt(this,Rt(this,t,e))},reduce:function(t,e,r){return kr(this,t,e,r,arguments.length<2,!1)},reduceRight:function(t,e,r){return kr(this,t,e,r,arguments.length<2,!0)},reverse:function(){return Jt(this,Ut(this,!0))},slice:function(t,e){return Jt(this,Bt(this,t,e,!0))},some:function(t,e){Ie(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,Nt(this,t))},values:function(){return this.__iterator(_)},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=Oe().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 Lr(this,t)},entrySeq:function(){var t=this;if(t._cache)return new $(t._cache);var e=t.toSeq().map(Ur).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(Tr(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(R,null,t)},flatMap:function(t,e){return Jt(this,function(t,e,r){var n=Ft(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 At(this)},get:function(t,e){return this.find((function(e,r){return Zt(r,t)}),void 0,e)},getIn:Gr,groupBy:function(t,e){return function(t,e,r){var n=i(t),o=(H(t)?zr():Oe()).asMutable();t.__iterate((function(i,u){o.update(e.call(r,i,u,t),(function(t){return(t=t||[]).push(n?[u,i]:i),t}))}));var u=Ft(t);return o.map((function(e){return Jt(t,u(e))})).asImmutable()}(this,t,e)},has:function(t){return this.get(t,q)!==q},hasIn:function(t){return Zr(this,t)},isSubset:function(t){return t="function"==typeof t.includes?t:a(t),this.every((function(e){return t.includes(e)}))},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:a(t)).isSubset(this)},keyOf:function(t){return this.findKey((function(e){return Zt(e,t)}))},keySeq:function(){return this.toSeq().map(Rr).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Pt(this,t)},maxBy:function(t,e){return Pt(this,e,t)},min:function(t){return Pt(this,t?Br(t):Kr)},minBy:function(t,e){return Pt(this,e?Br(e):Kr,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,Kt(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(Tr(t),e)},sortBy:function(t,e){return Jt(this,Nt(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=Yt(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(l,i),s=!0;return new g((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===l?t:w(n,a,c,t):(s=!1,{value:void 0,done:!0})}))},n}(this,t,e))},takeUntil:function(t,e){return this.takeWhile(Tr(t),e)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=en(this))}});var on=a.prototype;on[u]=!0,on[d]=on.values,on.toJSON=on.toArray,on.__toStringMapper=Qe,on.inspect=on.toSource=function(){return this.toString()},on.chain=on.flatMap,on.contains=on.includes,nn(c,{flip:function(){return Jt(this,kt(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 un=c.prototype;un[n]=!0,un[d]=on.entries,un.toJSON=$r,un.__toStringMapper=function(t,e){return Qe(e)+": "+Qe(t)},nn(f,{toKeyedSeq:function(){return new qt(this,!1)},filter:function(t,e){return Jt(this,Tt(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,Ut(this,!1))},slice:function(t,e){return Jt(this,Bt(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=T(t,t<0?this.count():this.size);var n=this.slice(0,t);return Jt(this,1===r?n:n.concat(se(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=k(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=k(this,t))>=0&&(void 0!==this.size?this.size===1/0||t<this.size:this.find((function(e,r){return r===t}),void 0,q)!==q)},interpose:function(t){return Jt(this,function(t,e){var r=Yt(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(_,n),u=0;return new g((function(){return(!i||u%2)&&(i=o.next()).done?i:u%2?w(r,u++,e):w(r,u++,i.value,i)}))},r}(this,t))},interleave:function(){var t=[this].concat(se(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 Nr(0,this.size)},last:function(t){return this.get(-1,t)},skipWhile:function(t,e){return Jt(this,Kt(this,t,e,!1))},zip:function(){return Jt(this,Ht(this,cn,[this].concat(se(arguments))))},zipAll:function(){return Jt(this,Ht(this,cn,[this].concat(se(arguments)),!0))},zipWith:function(t){var e=se(arguments);return e[0]=this,Jt(this,Ht(this,t,e))}});var sn=f.prototype;sn[e]=!0,sn[W]=!0,nn(h,{get:function(t,e){return this.has(t)?t:e},includes:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}});var an=h.prototype;function cn(){return se(arguments)}function fn(t){return Wr(t)&&H(t)}an.has=on.includes,an.contains=an.includes,an.keys=an.values,nn(X,un),nn(G,sn),nn(Z,an);var hn=function(t){function e(t){return null==t?vn():fn(t)?t:vn().withMutations((function(e){var r=h(t);Ie(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(c(t).keySeq())},e.prototype.toString=function(){return this.__toString("OrderedSet {","}")},e}(Hr);hn.isOrderedSet=fn;var pn,_n=hn.prototype;function ln(t,e){var r=Object.create(_n);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function vn(){return pn||(pn=ln(Ir()))}_n[W]=!0,_n.zip=sn.zip,_n.zipWith=sn.zipWith,_n.zipAll=sn.zipAll,_n.__empty=vn,_n.__make=ln;var yn=function(t,e){var r;!function(t){if(N(t))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(P(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 f=0;f<s.length;f++){var h=s[f];a[h]=f,i[h]?"object"==typeof console&&console.warn&&console.warn("Cannot define "+wn(this)+' with property "'+h+'" since that property name is part of the Record API.'):bn(i,h)}}return this.__ownerID=void 0,this._values=ur().withMutations((function(t){t.setSize(u._keys.length),c(o).forEach((function(e,r){t.set(u._indices[r],e===u._defaultValues[r]?void 0:e)}))})),this},i=n.prototype=Object.create(dn);return i.constructor=n,e&&(n.displayName=e),n};yn.prototype.toString=function(){for(var t,e=wn(this)+" { ",r=this._keys,n=0,i=r.length;n!==i;n++)e+=(n?", ":"")+(t=r[n])+": "+Qe(this.get(t));return e+" }"},yn.prototype.equals=function(t){return this===t||N(t)&&mn(this).equals(mn(t))},yn.prototype.hashCode=function(){return mn(this).hashCode()},yn.prototype.has=function(t){return this._indices.hasOwnProperty(t)},yn.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},yn.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 gn(this,r)}return this},yn.prototype.remove=function(t){return this.set(t)},yn.prototype.clear=function(){var t=this._values.clear().setSize(this._keys.length);return this.__ownerID?this:gn(this,t)},yn.prototype.wasAltered=function(){return this._values.wasAltered()},yn.prototype.toSeq=function(){return mn(this)},yn.prototype.toJS=function(){return tn(this)},yn.prototype.entries=function(){return this.__iterator(l)},yn.prototype.__iterator=function(t,e){return mn(this).__iterator(t,e)},yn.prototype.__iterate=function(t,e){return mn(this).__iterate(t,e)},yn.prototype.__ensureOwner=function(t){if(t===this.__ownerID)return this;var e=this._values.__ensureOwner(t);return t?gn(this,e,t):(this.__ownerID=t,this._values=e,this)},yn.isRecord=N,yn.getDescriptiveName=wn;var dn=yn.prototype;function gn(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._values=e,n.__ownerID=r,n}function wn(t){return t.constructor.displayName||t.constructor.name||"Record"}function mn(t){return it(t._keys.map((function(e){return[e,t.get(e)]})))}function bn(t,e){try{Object.defineProperty(t,e,{get:function(){return this.get(e)},set:function(t){Se(this.__ownerID,"Cannot set on an immutable record."),this.set(e,t)}})}catch(t){}}dn[C]=!0,dn[O]=dn.remove,dn.deleteIn=dn.removeIn=nr,dn.getIn=Gr,dn.hasIn=on.hasIn,dn.merge=te,dn.mergeWith=ee,dn.mergeIn=le,dn.mergeDeep=he,dn.mergeDeepWith=pe,dn.mergeDeepIn=_e,dn.setIn=ye,dn.update=de,dn.updateIn=ge,dn.withMutations=me,dn.asMutable=at,dn.asImmutable=st,dn[d]=dn.entries,dn.toJSON=dn.toObject=on.toObject,dn.inspect=dn.toSource=function(){return this.toString()};var zn,Sn=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(zn)return zn;zn=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 Zt(this._value,t)},e.prototype.slice=function(t,r){var n=this.size;return U(t,r,n)?this:new e(this._value,B(r,n)-T(t,n))},e.prototype.reverse=function(){return this},e.prototype.indexOf=function(t){return 0!==this.size&&Zt(this._value,t)?0:-1},e.prototype.lastIndexOf=function(t){return 0!==this.size&&Zt(this._value,t)?this.size-1:-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 g((function(){return i===n?{value:void 0,done:!0}:w(t,e?n-++i:i++,r._value)}))},e.prototype.equals=function(t){return t instanceof e?Zt(this._value,t._value):Lr(this,t)},e}(G);function In(t,e,r,n,i,o){if("string"!=typeof r&&!P(r)&&(Y(r)||b(r)||ie(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,Q(r).map((function(n,o){return In(t,e,n,o,i,r)})),i&&i.slice());return t.pop(),i&&i.pop(),u}return r}function On(t,e){return r(e)?e.toList():i(e)?e.toMap():e.toSet()}var En=a;t.Collection=a,t.Iterable=En,t.List=ur,t.Map=Oe,t.OrderedMap=zr,t.OrderedSet=hn,t.PairSorting={LeftThenRight:-1,RightThenLeft:1},t.Range=Nr,t.Record=yn,t.Repeat=Sn,t.Seq=Q,t.Set=Hr,t.Stack=Mr,t.fromJS=function(t,e){return In([],e||On,t,"",e&&e.length>2?[]:void 0,{"":t})},t.get=Ge,t.getIn=Xr,t.has=Xe,t.hasIn=Zr,t.hash=pt,t.is=Zt,t.isAssociative=o,t.isCollection=s,t.isImmutable=P,t.isIndexed=r,t.isKeyed=i,t.isList=or,t.isMap=ze,t.isOrdered=H,t.isOrderedMap=mr,t.isOrderedSet=fn,t.isPlainObject=ie,t.isRecord=N,t.isSeq=V,t.isSet=Wr,t.isStack=jr,t.isValueObject=Gt,t.merge=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return fe(t,e)},t.mergeDeep=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return ce(t,e)},t.mergeDeepWith=function(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return ce(e,r,t)},t.mergeWith=function(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return fe(e,r,t)},t.remove=Ze,t.removeIn=rr,t.set=$e,t.setIn=ve,t.update=$t,t.updateIn=tr,t.version="5.1.8"}));
|