immutable 4.0.0-rc.12 → 4.0.0-rc.14

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.js CHANGED
@@ -1,17 +1,32 @@
1
1
  /**
2
- * Copyright (c) 2014-present, Facebook, Inc.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
2
+ * MIT License
3
+ *
4
+ * Copyright (c) 2014-present, Lee Byron and other contributors.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
6
23
  */
7
-
8
24
  (function (global, factory) {
9
25
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
10
26
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
11
- (factory((global.Immutable = {})));
27
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Immutable = {}));
12
28
  }(this, (function (exports) { 'use strict';
13
29
 
14
- // Used for setting prototype methods that IE8 chokes on.
15
30
  var DELETE = 'delete';
16
31
 
17
32
  // Constants describing the size of trie nodes.
@@ -90,12 +105,12 @@
90
105
  return index === undefined
91
106
  ? defaultIndex
92
107
  : isNeg(index)
93
- ? size === Infinity
94
- ? size
95
- : Math.max(0, size + index) | 0
96
- : size === undefined || size === index
97
- ? index
98
- : Math.min(size, index) | 0;
108
+ ? size === Infinity
109
+ ? size
110
+ : Math.max(0, size + index) | 0
111
+ : size === undefined || size === index
112
+ ? index
113
+ : Math.min(size, index) | 0;
99
114
  }
100
115
 
101
116
  function isNeg(value) {
@@ -103,7 +118,6 @@
103
118
  return value < 0 || (value === 0 && 1 / value === -Infinity);
104
119
  }
105
120
 
106
- // Note: value is unchanged to not break immutable-devtools.
107
121
  var IS_COLLECTION_SYMBOL = '@@__IMMUTABLE_ITERABLE__@@';
108
122
 
109
123
  function isCollection(maybeCollection) {
@@ -213,10 +227,10 @@
213
227
  Iterator.VALUES = ITERATE_VALUES;
214
228
  Iterator.ENTRIES = ITERATE_ENTRIES;
215
229
 
216
- Iterator.prototype.inspect = Iterator.prototype.toSource = function() {
230
+ Iterator.prototype.inspect = Iterator.prototype.toSource = function () {
217
231
  return this.toString();
218
232
  };
219
- Iterator.prototype[ITERATOR_SYMBOL] = function() {
233
+ Iterator.prototype[ITERATOR_SYMBOL] = function () {
220
234
  return this;
221
235
  };
222
236
 
@@ -279,17 +293,17 @@
279
293
  );
280
294
  }
281
295
 
282
- var Seq = /*@__PURE__*/(function (Collection$$1) {
296
+ var Seq = /*@__PURE__*/(function (Collection) {
283
297
  function Seq(value) {
284
298
  return value === null || value === undefined
285
299
  ? emptySequence()
286
300
  : isImmutable(value)
287
- ? value.toSeq()
288
- : seqFromValue(value);
301
+ ? value.toSeq()
302
+ : seqFromValue(value);
289
303
  }
290
304
 
291
- if ( Collection$$1 ) Seq.__proto__ = Collection$$1;
292
- Seq.prototype = Object.create( Collection$$1 && Collection$$1.prototype );
305
+ if ( Collection ) Seq.__proto__ = Collection;
306
+ Seq.prototype = Object.create( Collection && Collection.prototype );
293
307
  Seq.prototype.constructor = Seq;
294
308
 
295
309
  Seq.prototype.toSeq = function toSeq () {
@@ -352,12 +366,12 @@
352
366
  return value === null || value === undefined
353
367
  ? emptySequence().toKeyedSeq()
354
368
  : isCollection(value)
355
- ? isKeyed(value)
356
- ? value.toSeq()
357
- : value.fromEntrySeq()
358
- : isRecord(value)
359
- ? value.toSeq()
360
- : keyedSeqFromValue(value);
369
+ ? isKeyed(value)
370
+ ? value.toSeq()
371
+ : value.fromEntrySeq()
372
+ : isRecord(value)
373
+ ? value.toSeq()
374
+ : keyedSeqFromValue(value);
361
375
  }
362
376
 
363
377
  if ( Seq ) KeyedSeq.__proto__ = Seq;
@@ -376,12 +390,12 @@
376
390
  return value === null || value === undefined
377
391
  ? emptySequence()
378
392
  : isCollection(value)
379
- ? isKeyed(value)
380
- ? value.entrySeq()
381
- : value.toIndexedSeq()
382
- : isRecord(value)
383
- ? value.toSeq().entrySeq()
384
- : indexedSeqFromValue(value);
393
+ ? isKeyed(value)
394
+ ? value.entrySeq()
395
+ : value.toIndexedSeq()
396
+ : isRecord(value)
397
+ ? value.toSeq().entrySeq()
398
+ : indexedSeqFromValue(value);
385
399
  }
386
400
 
387
401
  if ( Seq ) IndexedSeq.__proto__ = Seq;
@@ -405,9 +419,8 @@
405
419
 
406
420
  var SetSeq = /*@__PURE__*/(function (Seq) {
407
421
  function SetSeq(value) {
408
- return (isCollection(value) && !isAssociative(value)
409
- ? value
410
- : IndexedSeq(value)
422
+ return (
423
+ isCollection(value) && !isAssociative(value) ? value : IndexedSeq(value)
411
424
  ).toSetSeq();
412
425
  }
413
426
 
@@ -592,8 +605,8 @@
592
605
  var seq = Array.isArray(value)
593
606
  ? new ArraySeq(value)
594
607
  : hasIterator(value)
595
- ? new CollectionSeq(value)
596
- : undefined;
608
+ ? new CollectionSeq(value)
609
+ : undefined;
597
610
  if (seq) {
598
611
  return seq.fromEntrySeq();
599
612
  }
@@ -633,8 +646,8 @@
633
646
  return isArrayLike(value)
634
647
  ? new ArraySeq(value)
635
648
  : hasIterator(value)
636
- ? new CollectionSeq(value)
637
- : undefined;
649
+ ? new CollectionSeq(value)
650
+ : undefined;
638
651
  }
639
652
 
640
653
  var IS_MAP_SYMBOL = '@@__IMMUTABLE_MAP__@@';
@@ -759,41 +772,50 @@
759
772
  var defaultValueOf = Object.prototype.valueOf;
760
773
 
761
774
  function hash(o) {
762
- switch (typeof o) {
775
+ if (o == null) {
776
+ return hashNullish(o);
777
+ }
778
+
779
+ if (typeof o.hashCode === 'function') {
780
+ // Drop any high bits from accidentally long hash codes.
781
+ return smi(o.hashCode(o));
782
+ }
783
+
784
+ var v = valueOf(o);
785
+
786
+ if (v == null) {
787
+ return hashNullish(v);
788
+ }
789
+
790
+ switch (typeof v) {
763
791
  case 'boolean':
764
792
  // The hash values for built-in constants are a 1 value for each 5-byte
765
793
  // shift region expect for the first, which encodes the value. This
766
794
  // reduces the odds of a hash collision for these common values.
767
- return o ? 0x42108421 : 0x42108420;
795
+ return v ? 0x42108421 : 0x42108420;
768
796
  case 'number':
769
- return hashNumber(o);
797
+ return hashNumber(v);
770
798
  case 'string':
771
- return o.length > STRING_HASH_CACHE_MIN_STRLEN
772
- ? cachedHashString(o)
773
- : hashString(o);
799
+ return v.length > STRING_HASH_CACHE_MIN_STRLEN
800
+ ? cachedHashString(v)
801
+ : hashString(v);
774
802
  case 'object':
775
803
  case 'function':
776
- if (o === null) {
777
- return 0x42108422;
778
- }
779
- if (typeof o.hashCode === 'function') {
780
- // Drop any high bits from accidentally long hash codes.
781
- return smi(o.hashCode(o));
782
- }
783
- if (o.valueOf !== defaultValueOf && typeof o.valueOf === 'function') {
784
- o = o.valueOf(o);
785
- }
786
- return hashJSObj(o);
787
- case 'undefined':
788
- return 0x42108423;
804
+ return hashJSObj(v);
805
+ case 'symbol':
806
+ return hashSymbol(v);
789
807
  default:
790
- if (typeof o.toString === 'function') {
791
- return hashString(o.toString());
808
+ if (typeof v.toString === 'function') {
809
+ return hashString(v.toString());
792
810
  }
793
- throw new Error('Value type ' + typeof o + ' cannot be hashed.');
811
+ throw new Error('Value type ' + typeof v + ' cannot be hashed.');
794
812
  }
795
813
  }
796
814
 
815
+ function hashNullish(nullish) {
816
+ return nullish === null ? 0x42108422 : /* undefined */ 0x42108423;
817
+ }
818
+
797
819
  // Compress arbitrarily large numbers into smi hashes.
798
820
  function hashNumber(n) {
799
821
  if (n !== n || n === Infinity) {
@@ -839,6 +861,19 @@
839
861
  return smi(hashed);
840
862
  }
841
863
 
864
+ function hashSymbol(sym) {
865
+ var hashed = symbolMap[sym];
866
+ if (hashed !== undefined) {
867
+ return hashed;
868
+ }
869
+
870
+ hashed = nextHash();
871
+
872
+ symbolMap[sym] = hashed;
873
+
874
+ return hashed;
875
+ }
876
+
842
877
  function hashJSObj(obj) {
843
878
  var hashed;
844
879
  if (usingWeakMap) {
@@ -865,10 +900,7 @@
865
900
  }
866
901
  }
867
902
 
868
- hashed = ++objHashUID;
869
- if (objHashUID & 0x40000000) {
870
- objHashUID = 0;
871
- }
903
+ hashed = nextHash();
872
904
 
873
905
  if (usingWeakMap) {
874
906
  weakMap.set(obj, hashed);
@@ -889,7 +921,7 @@
889
921
  // we'll hijack one of the less-used non-enumerable properties to
890
922
  // save our hash on it. Since this is a function it will not show up in
891
923
  // `JSON.stringify` which is what we want.
892
- obj.propertyIsEnumerable = function() {
924
+ obj.propertyIsEnumerable = function () {
893
925
  return this.constructor.prototype.propertyIsEnumerable.apply(
894
926
  this,
895
927
  arguments
@@ -913,7 +945,7 @@
913
945
  var isExtensible = Object.isExtensible;
914
946
 
915
947
  // True if Object.defineProperty works as expected. IE8 fails this test.
916
- var canDefineProperty = (function() {
948
+ var canDefineProperty = (function () {
917
949
  try {
918
950
  Object.defineProperty({}, '@', {});
919
951
  return true;
@@ -935,6 +967,20 @@
935
967
  }
936
968
  }
937
969
 
970
+ function valueOf(obj) {
971
+ return obj.valueOf !== defaultValueOf && typeof obj.valueOf === 'function'
972
+ ? obj.valueOf(obj)
973
+ : obj;
974
+ }
975
+
976
+ function nextHash() {
977
+ var nextHash = ++_objHashUID;
978
+ if (_objHashUID & 0x40000000) {
979
+ _objHashUID = 0;
980
+ }
981
+ return nextHash;
982
+ }
983
+
938
984
  // If possible, use a WeakMap.
939
985
  var usingWeakMap = typeof WeakMap === 'function';
940
986
  var weakMap;
@@ -942,7 +988,9 @@
942
988
  weakMap = new WeakMap();
943
989
  }
944
990
 
945
- var objHashUID = 0;
991
+ var symbolMap = Object.create(null);
992
+
993
+ var _objHashUID = 0;
946
994
 
947
995
  var UID_HASH_KEY = '__immutablehash__';
948
996
  if (typeof Symbol === 'function') {
@@ -954,15 +1002,15 @@
954
1002
  var STRING_HASH_CACHE_SIZE = 0;
955
1003
  var stringHashCache = {};
956
1004
 
957
- var ToKeyedSequence = /*@__PURE__*/(function (KeyedSeq$$1) {
1005
+ var ToKeyedSequence = /*@__PURE__*/(function (KeyedSeq) {
958
1006
  function ToKeyedSequence(indexed, useKeys) {
959
1007
  this._iter = indexed;
960
1008
  this._useKeys = useKeys;
961
1009
  this.size = indexed.size;
962
1010
  }
963
1011
 
964
- if ( KeyedSeq$$1 ) ToKeyedSequence.__proto__ = KeyedSeq$$1;
965
- ToKeyedSequence.prototype = Object.create( KeyedSeq$$1 && KeyedSeq$$1.prototype );
1012
+ if ( KeyedSeq ) ToKeyedSequence.__proto__ = KeyedSeq;
1013
+ ToKeyedSequence.prototype = Object.create( KeyedSeq && KeyedSeq.prototype );
966
1014
  ToKeyedSequence.prototype.constructor = ToKeyedSequence;
967
1015
 
968
1016
  ToKeyedSequence.prototype.get = function get (key, notSetValue) {
@@ -978,29 +1026,29 @@
978
1026
  };
979
1027
 
980
1028
  ToKeyedSequence.prototype.reverse = function reverse () {
981
- var this$1 = this;
1029
+ var this$1$1 = this;
982
1030
 
983
1031
  var reversedSequence = reverseFactory(this, true);
984
1032
  if (!this._useKeys) {
985
- reversedSequence.valueSeq = function () { return this$1._iter.toSeq().reverse(); };
1033
+ reversedSequence.valueSeq = function () { return this$1$1._iter.toSeq().reverse(); };
986
1034
  }
987
1035
  return reversedSequence;
988
1036
  };
989
1037
 
990
1038
  ToKeyedSequence.prototype.map = function map (mapper, context) {
991
- var this$1 = this;
1039
+ var this$1$1 = this;
992
1040
 
993
1041
  var mappedSequence = mapFactory(this, mapper, context);
994
1042
  if (!this._useKeys) {
995
- mappedSequence.valueSeq = function () { return this$1._iter.toSeq().map(mapper, context); };
1043
+ mappedSequence.valueSeq = function () { return this$1$1._iter.toSeq().map(mapper, context); };
996
1044
  }
997
1045
  return mappedSequence;
998
1046
  };
999
1047
 
1000
1048
  ToKeyedSequence.prototype.__iterate = function __iterate (fn, reverse) {
1001
- var this$1 = this;
1049
+ var this$1$1 = this;
1002
1050
 
1003
- return this._iter.__iterate(function (v, k) { return fn(v, k, this$1); }, reverse);
1051
+ return this._iter.__iterate(function (v, k) { return fn(v, k, this$1$1); }, reverse);
1004
1052
  };
1005
1053
 
1006
1054
  ToKeyedSequence.prototype.__iterator = function __iterator (type, reverse) {
@@ -1011,14 +1059,14 @@
1011
1059
  }(KeyedSeq));
1012
1060
  ToKeyedSequence.prototype[IS_ORDERED_SYMBOL] = true;
1013
1061
 
1014
- var ToIndexedSequence = /*@__PURE__*/(function (IndexedSeq$$1) {
1062
+ var ToIndexedSequence = /*@__PURE__*/(function (IndexedSeq) {
1015
1063
  function ToIndexedSequence(iter) {
1016
1064
  this._iter = iter;
1017
1065
  this.size = iter.size;
1018
1066
  }
1019
1067
 
1020
- if ( IndexedSeq$$1 ) ToIndexedSequence.__proto__ = IndexedSeq$$1;
1021
- ToIndexedSequence.prototype = Object.create( IndexedSeq$$1 && IndexedSeq$$1.prototype );
1068
+ if ( IndexedSeq ) ToIndexedSequence.__proto__ = IndexedSeq;
1069
+ ToIndexedSequence.prototype = Object.create( IndexedSeq && IndexedSeq.prototype );
1022
1070
  ToIndexedSequence.prototype.constructor = ToIndexedSequence;
1023
1071
 
1024
1072
  ToIndexedSequence.prototype.includes = function includes (value) {
@@ -1026,18 +1074,18 @@
1026
1074
  };
1027
1075
 
1028
1076
  ToIndexedSequence.prototype.__iterate = function __iterate (fn, reverse) {
1029
- var this$1 = this;
1077
+ var this$1$1 = this;
1030
1078
 
1031
1079
  var i = 0;
1032
1080
  reverse && ensureSize(this);
1033
1081
  return this._iter.__iterate(
1034
- function (v) { return fn(v, reverse ? this$1.size - ++i : i++, this$1); },
1082
+ function (v) { return fn(v, reverse ? this$1$1.size - ++i : i++, this$1$1); },
1035
1083
  reverse
1036
1084
  );
1037
1085
  };
1038
1086
 
1039
1087
  ToIndexedSequence.prototype.__iterator = function __iterator (type, reverse) {
1040
- var this$1 = this;
1088
+ var this$1$1 = this;
1041
1089
 
1042
1090
  var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);
1043
1091
  var i = 0;
@@ -1048,7 +1096,7 @@
1048
1096
  ? step
1049
1097
  : iteratorValue(
1050
1098
  type,
1051
- reverse ? this$1.size - ++i : i++,
1099
+ reverse ? this$1$1.size - ++i : i++,
1052
1100
  step.value,
1053
1101
  step
1054
1102
  );
@@ -1058,14 +1106,14 @@
1058
1106
  return ToIndexedSequence;
1059
1107
  }(IndexedSeq));
1060
1108
 
1061
- var ToSetSequence = /*@__PURE__*/(function (SetSeq$$1) {
1109
+ var ToSetSequence = /*@__PURE__*/(function (SetSeq) {
1062
1110
  function ToSetSequence(iter) {
1063
1111
  this._iter = iter;
1064
1112
  this.size = iter.size;
1065
1113
  }
1066
1114
 
1067
- if ( SetSeq$$1 ) ToSetSequence.__proto__ = SetSeq$$1;
1068
- ToSetSequence.prototype = Object.create( SetSeq$$1 && SetSeq$$1.prototype );
1115
+ if ( SetSeq ) ToSetSequence.__proto__ = SetSeq;
1116
+ ToSetSequence.prototype = Object.create( SetSeq && SetSeq.prototype );
1069
1117
  ToSetSequence.prototype.constructor = ToSetSequence;
1070
1118
 
1071
1119
  ToSetSequence.prototype.has = function has (key) {
@@ -1073,9 +1121,9 @@
1073
1121
  };
1074
1122
 
1075
1123
  ToSetSequence.prototype.__iterate = function __iterate (fn, reverse) {
1076
- var this$1 = this;
1124
+ var this$1$1 = this;
1077
1125
 
1078
- return this._iter.__iterate(function (v) { return fn(v, v, this$1); }, reverse);
1126
+ return this._iter.__iterate(function (v) { return fn(v, v, this$1$1); }, reverse);
1079
1127
  };
1080
1128
 
1081
1129
  ToSetSequence.prototype.__iterator = function __iterator (type, reverse) {
@@ -1091,14 +1139,14 @@
1091
1139
  return ToSetSequence;
1092
1140
  }(SetSeq));
1093
1141
 
1094
- var FromEntriesSequence = /*@__PURE__*/(function (KeyedSeq$$1) {
1142
+ var FromEntriesSequence = /*@__PURE__*/(function (KeyedSeq) {
1095
1143
  function FromEntriesSequence(entries) {
1096
1144
  this._iter = entries;
1097
1145
  this.size = entries.size;
1098
1146
  }
1099
1147
 
1100
- if ( KeyedSeq$$1 ) FromEntriesSequence.__proto__ = KeyedSeq$$1;
1101
- FromEntriesSequence.prototype = Object.create( KeyedSeq$$1 && KeyedSeq$$1.prototype );
1148
+ if ( KeyedSeq ) FromEntriesSequence.__proto__ = KeyedSeq;
1149
+ FromEntriesSequence.prototype = Object.create( KeyedSeq && KeyedSeq.prototype );
1102
1150
  FromEntriesSequence.prototype.constructor = FromEntriesSequence;
1103
1151
 
1104
1152
  FromEntriesSequence.prototype.entrySeq = function entrySeq () {
@@ -1106,7 +1154,7 @@
1106
1154
  };
1107
1155
 
1108
1156
  FromEntriesSequence.prototype.__iterate = function __iterate (fn, reverse) {
1109
- var this$1 = this;
1157
+ var this$1$1 = this;
1110
1158
 
1111
1159
  return this._iter.__iterate(function (entry) {
1112
1160
  // Check if entry exists first so array access doesn't throw for holes
@@ -1117,7 +1165,7 @@
1117
1165
  return fn(
1118
1166
  indexedCollection ? entry.get(1) : entry[1],
1119
1167
  indexedCollection ? entry.get(0) : entry[0],
1120
- this$1
1168
+ this$1$1
1121
1169
  );
1122
1170
  }
1123
1171
  }, reverse);
@@ -1151,14 +1199,18 @@
1151
1199
  return FromEntriesSequence;
1152
1200
  }(KeyedSeq));
1153
1201
 
1154
- ToIndexedSequence.prototype.cacheResult = ToKeyedSequence.prototype.cacheResult = ToSetSequence.prototype.cacheResult = FromEntriesSequence.prototype.cacheResult = cacheResultThrough;
1202
+ ToIndexedSequence.prototype.cacheResult =
1203
+ ToKeyedSequence.prototype.cacheResult =
1204
+ ToSetSequence.prototype.cacheResult =
1205
+ FromEntriesSequence.prototype.cacheResult =
1206
+ cacheResultThrough;
1155
1207
 
1156
1208
  function flipFactory(collection) {
1157
1209
  var flipSequence = makeSequence(collection);
1158
1210
  flipSequence._iter = collection;
1159
1211
  flipSequence.size = collection.size;
1160
1212
  flipSequence.flip = function () { return collection; };
1161
- flipSequence.reverse = function() {
1213
+ flipSequence.reverse = function () {
1162
1214
  var reversedSequence = collection.reverse.apply(this); // super.reverse()
1163
1215
  reversedSequence.flip = function () { return collection.reverse(); };
1164
1216
  return reversedSequence;
@@ -1166,12 +1218,12 @@
1166
1218
  flipSequence.has = function (key) { return collection.includes(key); };
1167
1219
  flipSequence.includes = function (key) { return collection.has(key); };
1168
1220
  flipSequence.cacheResult = cacheResultThrough;
1169
- flipSequence.__iterateUncached = function(fn, reverse) {
1170
- var this$1 = this;
1221
+ flipSequence.__iterateUncached = function (fn, reverse) {
1222
+ var this$1$1 = this;
1171
1223
 
1172
- return collection.__iterate(function (v, k) { return fn(k, v, this$1) !== false; }, reverse);
1224
+ return collection.__iterate(function (v, k) { return fn(k, v, this$1$1) !== false; }, reverse);
1173
1225
  };
1174
- flipSequence.__iteratorUncached = function(type, reverse) {
1226
+ flipSequence.__iteratorUncached = function (type, reverse) {
1175
1227
  if (type === ITERATE_ENTRIES) {
1176
1228
  var iterator = collection.__iterator(type, reverse);
1177
1229
  return new Iterator(function () {
@@ -1202,15 +1254,15 @@
1202
1254
  ? notSetValue
1203
1255
  : mapper.call(context, v, key, collection);
1204
1256
  };
1205
- mappedSequence.__iterateUncached = function(fn, reverse) {
1206
- var this$1 = this;
1257
+ mappedSequence.__iterateUncached = function (fn, reverse) {
1258
+ var this$1$1 = this;
1207
1259
 
1208
1260
  return collection.__iterate(
1209
- function (v, k, c) { return fn(mapper.call(context, v, k, c), k, this$1) !== false; },
1261
+ function (v, k, c) { return fn(mapper.call(context, v, k, c), k, this$1$1) !== false; },
1210
1262
  reverse
1211
1263
  );
1212
1264
  };
1213
- mappedSequence.__iteratorUncached = function(type, reverse) {
1265
+ mappedSequence.__iteratorUncached = function (type, reverse) {
1214
1266
  var iterator = collection.__iterator(ITERATE_ENTRIES, reverse);
1215
1267
  return new Iterator(function () {
1216
1268
  var step = iterator.next();
@@ -1231,14 +1283,14 @@
1231
1283
  }
1232
1284
 
1233
1285
  function reverseFactory(collection, useKeys) {
1234
- var this$1 = this;
1286
+ var this$1$1 = this;
1235
1287
 
1236
1288
  var reversedSequence = makeSequence(collection);
1237
1289
  reversedSequence._iter = collection;
1238
1290
  reversedSequence.size = collection.size;
1239
1291
  reversedSequence.reverse = function () { return collection; };
1240
1292
  if (collection.flip) {
1241
- reversedSequence.flip = function() {
1293
+ reversedSequence.flip = function () {
1242
1294
  var flipSequence = flipFactory(collection);
1243
1295
  flipSequence.reverse = function () { return collection.flip(); };
1244
1296
  return flipSequence;
@@ -1248,13 +1300,13 @@
1248
1300
  reversedSequence.has = function (key) { return collection.has(useKeys ? key : -1 - key); };
1249
1301
  reversedSequence.includes = function (value) { return collection.includes(value); };
1250
1302
  reversedSequence.cacheResult = cacheResultThrough;
1251
- reversedSequence.__iterate = function(fn, reverse) {
1252
- var this$1 = this;
1303
+ reversedSequence.__iterate = function (fn, reverse) {
1304
+ var this$1$1 = this;
1253
1305
 
1254
1306
  var i = 0;
1255
1307
  reverse && ensureSize(collection);
1256
1308
  return collection.__iterate(
1257
- function (v, k) { return fn(v, useKeys ? k : reverse ? this$1.size - ++i : i++, this$1); },
1309
+ function (v, k) { return fn(v, useKeys ? k : reverse ? this$1$1.size - ++i : i++, this$1$1); },
1258
1310
  !reverse
1259
1311
  );
1260
1312
  };
@@ -1270,7 +1322,7 @@
1270
1322
  var entry = step.value;
1271
1323
  return iteratorValue(
1272
1324
  type,
1273
- useKeys ? entry[0] : reverse ? this$1.size - ++i : i++,
1325
+ useKeys ? entry[0] : reverse ? this$1$1.size - ++i : i++,
1274
1326
  entry[1],
1275
1327
  step
1276
1328
  );
@@ -1293,19 +1345,19 @@
1293
1345
  : notSetValue;
1294
1346
  };
1295
1347
  }
1296
- filterSequence.__iterateUncached = function(fn, reverse) {
1297
- var this$1 = this;
1348
+ filterSequence.__iterateUncached = function (fn, reverse) {
1349
+ var this$1$1 = this;
1298
1350
 
1299
1351
  var iterations = 0;
1300
1352
  collection.__iterate(function (v, k, c) {
1301
1353
  if (predicate.call(context, v, k, c)) {
1302
1354
  iterations++;
1303
- return fn(v, useKeys ? k : iterations - 1, this$1);
1355
+ return fn(v, useKeys ? k : iterations - 1, this$1$1);
1304
1356
  }
1305
1357
  }, reverse);
1306
1358
  return iterations;
1307
1359
  };
1308
- filterSequence.__iteratorUncached = function(type, reverse) {
1360
+ filterSequence.__iteratorUncached = function (type, reverse) {
1309
1361
  var iterator = collection.__iterator(ITERATE_ENTRIES, reverse);
1310
1362
  var iterations = 0;
1311
1363
  return new Iterator(function () {
@@ -1382,7 +1434,7 @@
1382
1434
  sliceSize === 0 ? sliceSize : (collection.size && sliceSize) || undefined;
1383
1435
 
1384
1436
  if (!useKeys && isSeq(collection) && sliceSize >= 0) {
1385
- sliceSeq.get = function(index, notSetValue) {
1437
+ sliceSeq.get = function (index, notSetValue) {
1386
1438
  index = wrapIndex(this, index);
1387
1439
  return index >= 0 && index < sliceSize
1388
1440
  ? collection.get(index + resolvedBegin, notSetValue)
@@ -1390,8 +1442,8 @@
1390
1442
  };
1391
1443
  }
1392
1444
 
1393
- sliceSeq.__iterateUncached = function(fn, reverse) {
1394
- var this$1 = this;
1445
+ sliceSeq.__iterateUncached = function (fn, reverse) {
1446
+ var this$1$1 = this;
1395
1447
 
1396
1448
  if (sliceSize === 0) {
1397
1449
  return 0;
@@ -1406,7 +1458,7 @@
1406
1458
  if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) {
1407
1459
  iterations++;
1408
1460
  return (
1409
- fn(v, useKeys ? k : iterations - 1, this$1) !== false &&
1461
+ fn(v, useKeys ? k : iterations - 1, this$1$1) !== false &&
1410
1462
  iterations !== sliceSize
1411
1463
  );
1412
1464
  }
@@ -1414,7 +1466,7 @@
1414
1466
  return iterations;
1415
1467
  };
1416
1468
 
1417
- sliceSeq.__iteratorUncached = function(type, reverse) {
1469
+ sliceSeq.__iteratorUncached = function (type, reverse) {
1418
1470
  if (sliceSize !== 0 && reverse) {
1419
1471
  return this.cacheResult().__iterator(type, reverse);
1420
1472
  }
@@ -1448,20 +1500,20 @@
1448
1500
 
1449
1501
  function takeWhileFactory(collection, predicate, context) {
1450
1502
  var takeSequence = makeSequence(collection);
1451
- takeSequence.__iterateUncached = function(fn, reverse) {
1452
- var this$1 = this;
1503
+ takeSequence.__iterateUncached = function (fn, reverse) {
1504
+ var this$1$1 = this;
1453
1505
 
1454
1506
  if (reverse) {
1455
1507
  return this.cacheResult().__iterate(fn, reverse);
1456
1508
  }
1457
1509
  var iterations = 0;
1458
1510
  collection.__iterate(
1459
- function (v, k, c) { return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$1); }
1511
+ function (v, k, c) { return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$1$1); }
1460
1512
  );
1461
1513
  return iterations;
1462
1514
  };
1463
- takeSequence.__iteratorUncached = function(type, reverse) {
1464
- var this$1 = this;
1515
+ takeSequence.__iteratorUncached = function (type, reverse) {
1516
+ var this$1$1 = this;
1465
1517
 
1466
1518
  if (reverse) {
1467
1519
  return this.cacheResult().__iterator(type, reverse);
@@ -1479,7 +1531,7 @@
1479
1531
  var entry = step.value;
1480
1532
  var k = entry[0];
1481
1533
  var v = entry[1];
1482
- if (!predicate.call(context, v, k, this$1)) {
1534
+ if (!predicate.call(context, v, k, this$1$1)) {
1483
1535
  iterating = false;
1484
1536
  return iteratorDone();
1485
1537
  }
@@ -1491,8 +1543,8 @@
1491
1543
 
1492
1544
  function skipWhileFactory(collection, predicate, context, useKeys) {
1493
1545
  var skipSequence = makeSequence(collection);
1494
- skipSequence.__iterateUncached = function(fn, reverse) {
1495
- var this$1 = this;
1546
+ skipSequence.__iterateUncached = function (fn, reverse) {
1547
+ var this$1$1 = this;
1496
1548
 
1497
1549
  if (reverse) {
1498
1550
  return this.cacheResult().__iterate(fn, reverse);
@@ -1502,13 +1554,13 @@
1502
1554
  collection.__iterate(function (v, k, c) {
1503
1555
  if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {
1504
1556
  iterations++;
1505
- return fn(v, useKeys ? k : iterations - 1, this$1);
1557
+ return fn(v, useKeys ? k : iterations - 1, this$1$1);
1506
1558
  }
1507
1559
  });
1508
1560
  return iterations;
1509
1561
  };
1510
- skipSequence.__iteratorUncached = function(type, reverse) {
1511
- var this$1 = this;
1562
+ skipSequence.__iteratorUncached = function (type, reverse) {
1563
+ var this$1$1 = this;
1512
1564
 
1513
1565
  if (reverse) {
1514
1566
  return this.cacheResult().__iterator(type, reverse);
@@ -1534,7 +1586,7 @@
1534
1586
  var entry = step.value;
1535
1587
  k = entry[0];
1536
1588
  v = entry[1];
1537
- skipping && (skipping = predicate.call(context, v, k, this$1));
1589
+ skipping && (skipping = predicate.call(context, v, k, this$1$1));
1538
1590
  } while (skipping);
1539
1591
  return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);
1540
1592
  });
@@ -1593,7 +1645,7 @@
1593
1645
 
1594
1646
  function flattenFactory(collection, depth, useKeys) {
1595
1647
  var flatSequence = makeSequence(collection);
1596
- flatSequence.__iterateUncached = function(fn, reverse) {
1648
+ flatSequence.__iterateUncached = function (fn, reverse) {
1597
1649
  if (reverse) {
1598
1650
  return this.cacheResult().__iterate(fn, reverse);
1599
1651
  }
@@ -1615,7 +1667,7 @@
1615
1667
  flatDeep(collection, 0);
1616
1668
  return iterations;
1617
1669
  };
1618
- flatSequence.__iteratorUncached = function(type, reverse) {
1670
+ flatSequence.__iteratorUncached = function (type, reverse) {
1619
1671
  if (reverse) {
1620
1672
  return this.cacheResult().__iterator(type, reverse);
1621
1673
  }
@@ -1657,18 +1709,18 @@
1657
1709
  function interposeFactory(collection, separator) {
1658
1710
  var interposedSequence = makeSequence(collection);
1659
1711
  interposedSequence.size = collection.size && collection.size * 2 - 1;
1660
- interposedSequence.__iterateUncached = function(fn, reverse) {
1661
- var this$1 = this;
1712
+ interposedSequence.__iterateUncached = function (fn, reverse) {
1713
+ var this$1$1 = this;
1662
1714
 
1663
1715
  var iterations = 0;
1664
1716
  collection.__iterate(
1665
- function (v) { return (!iterations || fn(separator, iterations++, this$1) !== false) &&
1666
- fn(v, iterations++, this$1) !== false; },
1717
+ function (v) { return (!iterations || fn(separator, iterations++, this$1$1) !== false) &&
1718
+ fn(v, iterations++, this$1$1) !== false; },
1667
1719
  reverse
1668
1720
  );
1669
1721
  return iterations;
1670
1722
  };
1671
- interposedSequence.__iteratorUncached = function(type, reverse) {
1723
+ interposedSequence.__iteratorUncached = function (type, reverse) {
1672
1724
  var iterator = collection.__iterator(ITERATE_VALUES, reverse);
1673
1725
  var iterations = 0;
1674
1726
  var step;
@@ -1698,20 +1750,22 @@
1698
1750
  .map(function (v, k) { return [k, v, index++, mapper ? mapper(v, k, collection) : v]; })
1699
1751
  .valueSeq()
1700
1752
  .toArray();
1701
- entries.sort(function (a, b) { return comparator(a[3], b[3]) || a[2] - b[2]; }).forEach(
1702
- isKeyedCollection
1703
- ? function (v, i) {
1704
- entries[i].length = 2;
1705
- }
1706
- : function (v, i) {
1707
- entries[i] = v[1];
1708
- }
1709
- );
1753
+ entries
1754
+ .sort(function (a, b) { return comparator(a[3], b[3]) || a[2] - b[2]; })
1755
+ .forEach(
1756
+ isKeyedCollection
1757
+ ? function (v, i) {
1758
+ entries[i].length = 2;
1759
+ }
1760
+ : function (v, i) {
1761
+ entries[i] = v[1];
1762
+ }
1763
+ );
1710
1764
  return isKeyedCollection
1711
1765
  ? KeyedSeq(entries)
1712
1766
  : isIndexed(collection)
1713
- ? IndexedSeq(entries)
1714
- : SetSeq(entries);
1767
+ ? IndexedSeq(entries)
1768
+ : SetSeq(entries);
1715
1769
  }
1716
1770
 
1717
1771
  function maxFactory(collection, comparator, mapper) {
@@ -1744,7 +1798,7 @@
1744
1798
  zipSequence.size = zipAll ? sizes.max() : sizes.min();
1745
1799
  // Note: this a generic base implementation of __iterate in terms of
1746
1800
  // __iterator which may be more generically useful in the future.
1747
- zipSequence.__iterate = function(fn, reverse) {
1801
+ zipSequence.__iterate = function (fn, reverse) {
1748
1802
  /* generic:
1749
1803
  var iterator = this.__iterator(ITERATE_ENTRIES, reverse);
1750
1804
  var step;
@@ -1768,7 +1822,7 @@
1768
1822
  }
1769
1823
  return iterations;
1770
1824
  };
1771
- zipSequence.__iteratorUncached = function(type, reverse) {
1825
+ zipSequence.__iteratorUncached = function (type, reverse) {
1772
1826
  var iterators = iters.map(
1773
1827
  function (i) { return ((i = Collection(i)), getIterator(reverse ? i.reverse() : i)); }
1774
1828
  );
@@ -1786,7 +1840,10 @@
1786
1840
  return iteratorValue(
1787
1841
  type,
1788
1842
  iterations++,
1789
- zipper.apply(null, steps.map(function (s) { return s.value; }))
1843
+ zipper.apply(
1844
+ null,
1845
+ steps.map(function (s) { return s.value; })
1846
+ )
1790
1847
  );
1791
1848
  });
1792
1849
  };
@@ -1809,8 +1866,8 @@
1809
1866
  return isKeyed(collection)
1810
1867
  ? KeyedCollection
1811
1868
  : isIndexed(collection)
1812
- ? IndexedCollection
1813
- : SetCollection;
1869
+ ? IndexedCollection
1870
+ : SetCollection;
1814
1871
  }
1815
1872
 
1816
1873
  function makeSequence(collection) {
@@ -1818,8 +1875,8 @@
1818
1875
  (isKeyed(collection)
1819
1876
  ? KeyedSeq
1820
1877
  : isIndexed(collection)
1821
- ? IndexedSeq
1822
- : SetSeq
1878
+ ? IndexedSeq
1879
+ : SetSeq
1823
1880
  ).prototype
1824
1881
  );
1825
1882
  }
@@ -1849,7 +1906,6 @@
1849
1906
  return a > b ? 1 : a < b ? -1 : 0;
1850
1907
  }
1851
1908
 
1852
- // http://jsperf.com/copy-array-inline
1853
1909
  function arrCopy(arr, offset) {
1854
1910
  offset = offset || 0;
1855
1911
  var len = Math.max(0, arr.length - offset);
@@ -1883,12 +1939,31 @@
1883
1939
  );
1884
1940
  }
1885
1941
 
1886
- function isPlainObj(value) {
1887
- return (
1888
- value &&
1889
- (typeof value.constructor !== 'function' ||
1890
- value.constructor.name === 'Object')
1891
- );
1942
+ var toString = Object.prototype.toString;
1943
+
1944
+ function isPlainObject(value) {
1945
+ // The base prototype's toString deals with Argument objects and native namespaces like Math
1946
+ if (
1947
+ !value ||
1948
+ typeof value !== 'object' ||
1949
+ toString.call(value) !== '[object Object]'
1950
+ ) {
1951
+ return false;
1952
+ }
1953
+
1954
+ var proto = Object.getPrototypeOf(value);
1955
+ if (proto === null) {
1956
+ return true;
1957
+ }
1958
+
1959
+ // Iteratively going up the prototype chain is needed for cross-realm environments (differing contexts, iframes, etc)
1960
+ var parentProto = proto;
1961
+ var nextProto = Object.getPrototypeOf(proto);
1962
+ while (nextProto !== null) {
1963
+ parentProto = nextProto;
1964
+ nextProto = Object.getPrototypeOf(parentProto);
1965
+ }
1966
+ return parentProto === proto;
1892
1967
  }
1893
1968
 
1894
1969
  /**
@@ -1898,13 +1973,10 @@
1898
1973
  function isDataStructure(value) {
1899
1974
  return (
1900
1975
  typeof value === 'object' &&
1901
- (isImmutable(value) || Array.isArray(value) || isPlainObj(value))
1976
+ (isImmutable(value) || Array.isArray(value) || isPlainObject(value))
1902
1977
  );
1903
1978
  }
1904
1979
 
1905
- /**
1906
- * Converts a value to a string, adding quotes if a string was provided.
1907
- */
1908
1980
  function quoteString(value) {
1909
1981
  try {
1910
1982
  return typeof value === 'string' ? JSON.stringify(value) : String(value);
@@ -1923,10 +1995,10 @@
1923
1995
  return isImmutable(collection)
1924
1996
  ? collection.get(key, notSetValue)
1925
1997
  : !has(collection, key)
1926
- ? notSetValue
1927
- : typeof collection.get === 'function'
1928
- ? collection.get(key)
1929
- : collection[key];
1998
+ ? notSetValue
1999
+ : typeof collection.get === 'function'
2000
+ ? collection.get(key)
2001
+ : collection[key];
1930
2002
  }
1931
2003
 
1932
2004
  function shallowCopy(from) {
@@ -1990,7 +2062,7 @@
1990
2062
  return collectionCopy;
1991
2063
  }
1992
2064
 
1993
- function updateIn(collection, keyPath, notSetValue, updater) {
2065
+ function updateIn$1(collection, keyPath, notSetValue, updater) {
1994
2066
  if (!updater) {
1995
2067
  updater = notSetValue;
1996
2068
  notSetValue = undefined;
@@ -2041,52 +2113,52 @@
2041
2113
  return nextUpdated === nextExisting
2042
2114
  ? existing
2043
2115
  : nextUpdated === NOT_SET
2044
- ? remove(existing, key)
2045
- : set(
2046
- wasNotSet ? (inImmutable ? emptyMap() : {}) : existing,
2047
- key,
2048
- nextUpdated
2049
- );
2116
+ ? remove(existing, key)
2117
+ : set(
2118
+ wasNotSet ? (inImmutable ? emptyMap() : {}) : existing,
2119
+ key,
2120
+ nextUpdated
2121
+ );
2050
2122
  }
2051
2123
 
2052
- function setIn(collection, keyPath, value) {
2053
- return updateIn(collection, keyPath, NOT_SET, function () { return value; });
2124
+ function setIn$1(collection, keyPath, value) {
2125
+ return updateIn$1(collection, keyPath, NOT_SET, function () { return value; });
2054
2126
  }
2055
2127
 
2056
- function setIn$1(keyPath, v) {
2057
- return setIn(this, keyPath, v);
2128
+ function setIn(keyPath, v) {
2129
+ return setIn$1(this, keyPath, v);
2058
2130
  }
2059
2131
 
2060
2132
  function removeIn(collection, keyPath) {
2061
- return updateIn(collection, keyPath, function () { return NOT_SET; });
2133
+ return updateIn$1(collection, keyPath, function () { return NOT_SET; });
2062
2134
  }
2063
2135
 
2064
2136
  function deleteIn(keyPath) {
2065
2137
  return removeIn(this, keyPath);
2066
2138
  }
2067
2139
 
2068
- function update(collection, key, notSetValue, updater) {
2069
- return updateIn(collection, [key], notSetValue, updater);
2140
+ function update$1(collection, key, notSetValue, updater) {
2141
+ return updateIn$1(collection, [key], notSetValue, updater);
2070
2142
  }
2071
2143
 
2072
- function update$1(key, notSetValue, updater) {
2144
+ function update(key, notSetValue, updater) {
2073
2145
  return arguments.length === 1
2074
2146
  ? key(this)
2075
- : update(this, key, notSetValue, updater);
2147
+ : update$1(this, key, notSetValue, updater);
2076
2148
  }
2077
2149
 
2078
- function updateIn$1(keyPath, notSetValue, updater) {
2079
- return updateIn(this, keyPath, notSetValue, updater);
2150
+ function updateIn(keyPath, notSetValue, updater) {
2151
+ return updateIn$1(this, keyPath, notSetValue, updater);
2080
2152
  }
2081
2153
 
2082
- function merge() {
2154
+ function merge$1() {
2083
2155
  var iters = [], len = arguments.length;
2084
2156
  while ( len-- ) iters[ len ] = arguments[ len ];
2085
2157
 
2086
2158
  return mergeIntoKeyedWith(this, iters);
2087
2159
  }
2088
2160
 
2089
- function mergeWith(merger) {
2161
+ function mergeWith$1(merger) {
2090
2162
  var iters = [], len = arguments.length - 1;
2091
2163
  while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ];
2092
2164
 
@@ -2117,11 +2189,7 @@
2117
2189
  return collection.withMutations(function (collection) {
2118
2190
  var mergeIntoCollection = merger
2119
2191
  ? function (value, key) {
2120
- update(
2121
- collection,
2122
- key,
2123
- NOT_SET,
2124
- function (oldVal) { return (oldVal === NOT_SET ? value : merger(oldVal, value, key)); }
2192
+ update$1(collection, key, NOT_SET, function (oldVal) { return oldVal === NOT_SET ? value : merger(oldVal, value, key); }
2125
2193
  );
2126
2194
  }
2127
2195
  : function (value, key) {
@@ -2133,28 +2201,28 @@
2133
2201
  });
2134
2202
  }
2135
2203
 
2136
- function merge$1(collection) {
2204
+ function merge(collection) {
2137
2205
  var sources = [], len = arguments.length - 1;
2138
2206
  while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ];
2139
2207
 
2140
2208
  return mergeWithSources(collection, sources);
2141
2209
  }
2142
2210
 
2143
- function mergeWith$1(merger, collection) {
2211
+ function mergeWith(merger, collection) {
2144
2212
  var sources = [], len = arguments.length - 2;
2145
2213
  while ( len-- > 0 ) sources[ len ] = arguments[ len + 2 ];
2146
2214
 
2147
2215
  return mergeWithSources(collection, sources, merger);
2148
2216
  }
2149
2217
 
2150
- function mergeDeep(collection) {
2218
+ function mergeDeep$1(collection) {
2151
2219
  var sources = [], len = arguments.length - 1;
2152
2220
  while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ];
2153
2221
 
2154
2222
  return mergeDeepWithSources(collection, sources);
2155
2223
  }
2156
2224
 
2157
- function mergeDeepWith(merger, collection) {
2225
+ function mergeDeepWith$1(merger, collection) {
2158
2226
  var sources = [], len = arguments.length - 2;
2159
2227
  while ( len-- > 0 ) sources[ len ] = arguments[ len + 2 ];
2160
2228
 
@@ -2175,12 +2243,12 @@
2175
2243
  return typeof merger === 'function' && collection.mergeWith
2176
2244
  ? collection.mergeWith.apply(collection, [ merger ].concat( sources ))
2177
2245
  : collection.merge
2178
- ? collection.merge.apply(collection, sources)
2179
- : collection.concat.apply(collection, sources);
2246
+ ? collection.merge.apply(collection, sources)
2247
+ : collection.concat.apply(collection, sources);
2180
2248
  }
2181
2249
  var isArray = Array.isArray(collection);
2182
2250
  var merged = collection;
2183
- var Collection$$1 = isArray ? IndexedCollection : KeyedCollection;
2251
+ var Collection = isArray ? IndexedCollection : KeyedCollection;
2184
2252
  var mergeItem = isArray
2185
2253
  ? function (value) {
2186
2254
  // Copy on write
@@ -2202,7 +2270,7 @@
2202
2270
  }
2203
2271
  };
2204
2272
  for (var i = 0; i < sources.length; i++) {
2205
- Collection$$1(sources[i]).forEach(mergeItem);
2273
+ Collection(sources[i]).forEach(mergeItem);
2206
2274
  }
2207
2275
  return merged;
2208
2276
  }
@@ -2212,20 +2280,20 @@
2212
2280
  return isDataStructure(oldValue) && isDataStructure(newValue)
2213
2281
  ? mergeWithSources(oldValue, [newValue], deepMerger)
2214
2282
  : merger
2215
- ? merger(oldValue, newValue, key)
2216
- : newValue;
2283
+ ? merger(oldValue, newValue, key)
2284
+ : newValue;
2217
2285
  }
2218
2286
  return deepMerger;
2219
2287
  }
2220
2288
 
2221
- function mergeDeep$1() {
2289
+ function mergeDeep() {
2222
2290
  var iters = [], len = arguments.length;
2223
2291
  while ( len-- ) iters[ len ] = arguments[ len ];
2224
2292
 
2225
2293
  return mergeDeepWithSources(this, iters);
2226
2294
  }
2227
2295
 
2228
- function mergeDeepWith$1(merger) {
2296
+ function mergeDeepWith(merger) {
2229
2297
  var iters = [], len = arguments.length - 1;
2230
2298
  while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ];
2231
2299
 
@@ -2236,14 +2304,14 @@
2236
2304
  var iters = [], len = arguments.length - 1;
2237
2305
  while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ];
2238
2306
 
2239
- return updateIn(this, keyPath, emptyMap(), function (m) { return mergeWithSources(m, iters); });
2307
+ return updateIn$1(this, keyPath, emptyMap(), function (m) { return mergeWithSources(m, iters); });
2240
2308
  }
2241
2309
 
2242
2310
  function mergeDeepIn(keyPath) {
2243
2311
  var iters = [], len = arguments.length - 1;
2244
2312
  while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ];
2245
2313
 
2246
- return updateIn(this, keyPath, emptyMap(), function (m) { return mergeDeepWithSources(m, iters); }
2314
+ return updateIn$1(this, keyPath, emptyMap(), function (m) { return mergeDeepWithSources(m, iters); }
2247
2315
  );
2248
2316
  }
2249
2317
 
@@ -2265,21 +2333,21 @@
2265
2333
  return this.__altered;
2266
2334
  }
2267
2335
 
2268
- var Map = /*@__PURE__*/(function (KeyedCollection$$1) {
2336
+ var Map = /*@__PURE__*/(function (KeyedCollection) {
2269
2337
  function Map(value) {
2270
2338
  return value === null || value === undefined
2271
2339
  ? emptyMap()
2272
2340
  : isMap(value) && !isOrdered(value)
2273
- ? value
2274
- : emptyMap().withMutations(function (map) {
2275
- var iter = KeyedCollection$$1(value);
2276
- assertNotInfinite(iter.size);
2277
- iter.forEach(function (v, k) { return map.set(k, v); });
2278
- });
2341
+ ? value
2342
+ : emptyMap().withMutations(function (map) {
2343
+ var iter = KeyedCollection(value);
2344
+ assertNotInfinite(iter.size);
2345
+ iter.forEach(function (v, k) { return map.set(k, v); });
2346
+ });
2279
2347
  }
2280
2348
 
2281
- if ( KeyedCollection$$1 ) Map.__proto__ = KeyedCollection$$1;
2282
- Map.prototype = Object.create( KeyedCollection$$1 && KeyedCollection$$1.prototype );
2349
+ if ( KeyedCollection ) Map.__proto__ = KeyedCollection;
2350
+ Map.prototype = Object.create( KeyedCollection && KeyedCollection.prototype );
2283
2351
  Map.prototype.constructor = Map;
2284
2352
 
2285
2353
  Map.of = function of () {
@@ -2357,9 +2425,11 @@
2357
2425
  };
2358
2426
 
2359
2427
  Map.prototype.map = function map (mapper, context) {
2428
+ var this$1$1 = this;
2429
+
2360
2430
  return this.withMutations(function (map) {
2361
2431
  map.forEach(function (value, key) {
2362
- map.set(key, mapper.call(context, value, key, map));
2432
+ map.set(key, mapper.call(context, value, key, this$1$1));
2363
2433
  });
2364
2434
  });
2365
2435
  };
@@ -2371,13 +2441,13 @@
2371
2441
  };
2372
2442
 
2373
2443
  Map.prototype.__iterate = function __iterate (fn, reverse) {
2374
- var this$1 = this;
2444
+ var this$1$1 = this;
2375
2445
 
2376
2446
  var iterations = 0;
2377
2447
  this._root &&
2378
2448
  this._root.iterate(function (entry) {
2379
2449
  iterations++;
2380
- return fn(entry[1], entry[0], this$1);
2450
+ return fn(entry[1], entry[0], this$1$1);
2381
2451
  }, reverse);
2382
2452
  return iterations;
2383
2453
  };
@@ -2406,24 +2476,24 @@
2406
2476
  MapPrototype[IS_MAP_SYMBOL] = true;
2407
2477
  MapPrototype[DELETE] = MapPrototype.remove;
2408
2478
  MapPrototype.removeAll = MapPrototype.deleteAll;
2409
- MapPrototype.setIn = setIn$1;
2479
+ MapPrototype.setIn = setIn;
2410
2480
  MapPrototype.removeIn = MapPrototype.deleteIn = deleteIn;
2411
- MapPrototype.update = update$1;
2412
- MapPrototype.updateIn = updateIn$1;
2413
- MapPrototype.merge = MapPrototype.concat = merge;
2414
- MapPrototype.mergeWith = mergeWith;
2415
- MapPrototype.mergeDeep = mergeDeep$1;
2416
- MapPrototype.mergeDeepWith = mergeDeepWith$1;
2481
+ MapPrototype.update = update;
2482
+ MapPrototype.updateIn = updateIn;
2483
+ MapPrototype.merge = MapPrototype.concat = merge$1;
2484
+ MapPrototype.mergeWith = mergeWith$1;
2485
+ MapPrototype.mergeDeep = mergeDeep;
2486
+ MapPrototype.mergeDeepWith = mergeDeepWith;
2417
2487
  MapPrototype.mergeIn = mergeIn;
2418
2488
  MapPrototype.mergeDeepIn = mergeDeepIn;
2419
2489
  MapPrototype.withMutations = withMutations;
2420
2490
  MapPrototype.wasAltered = wasAltered;
2421
2491
  MapPrototype.asImmutable = asImmutable;
2422
2492
  MapPrototype['@@transducer/init'] = MapPrototype.asMutable = asMutable;
2423
- MapPrototype['@@transducer/step'] = function(result, arr) {
2493
+ MapPrototype['@@transducer/step'] = function (result, arr) {
2424
2494
  return result.set(arr[0], arr[1]);
2425
2495
  };
2426
- MapPrototype['@@transducer/result'] = function(obj) {
2496
+ MapPrototype['@@transducer/result'] = function (obj) {
2427
2497
  return obj.asImmutable();
2428
2498
  };
2429
2499
 
@@ -2762,45 +2832,41 @@
2762
2832
 
2763
2833
  // #pragma Iterators
2764
2834
 
2765
- ArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = function(
2766
- fn,
2767
- reverse
2768
- ) {
2769
- var entries = this.entries;
2770
- for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) {
2771
- if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {
2772
- return false;
2835
+ ArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate =
2836
+ function (fn, reverse) {
2837
+ var entries = this.entries;
2838
+ for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) {
2839
+ if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {
2840
+ return false;
2841
+ }
2773
2842
  }
2774
- }
2775
- };
2843
+ };
2776
2844
 
2777
- BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = function(
2778
- fn,
2779
- reverse
2780
- ) {
2781
- var nodes = this.nodes;
2782
- for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {
2783
- var node = nodes[reverse ? maxIndex - ii : ii];
2784
- if (node && node.iterate(fn, reverse) === false) {
2785
- return false;
2845
+ BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate =
2846
+ function (fn, reverse) {
2847
+ var nodes = this.nodes;
2848
+ for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {
2849
+ var node = nodes[reverse ? maxIndex - ii : ii];
2850
+ if (node && node.iterate(fn, reverse) === false) {
2851
+ return false;
2852
+ }
2786
2853
  }
2787
- }
2788
- };
2854
+ };
2789
2855
 
2790
2856
  // eslint-disable-next-line no-unused-vars
2791
- ValueNode.prototype.iterate = function(fn, reverse) {
2857
+ ValueNode.prototype.iterate = function (fn, reverse) {
2792
2858
  return fn(this.entry);
2793
2859
  };
2794
2860
 
2795
- var MapIterator = /*@__PURE__*/(function (Iterator$$1) {
2861
+ var MapIterator = /*@__PURE__*/(function (Iterator) {
2796
2862
  function MapIterator(map, type, reverse) {
2797
2863
  this._type = type;
2798
2864
  this._reverse = reverse;
2799
2865
  this._stack = map._root && mapIteratorFrame(map._root);
2800
2866
  }
2801
2867
 
2802
- if ( Iterator$$1 ) MapIterator.__proto__ = Iterator$$1;
2803
- MapIterator.prototype = Object.create( Iterator$$1 && Iterator$$1.prototype );
2868
+ if ( Iterator ) MapIterator.__proto__ = Iterator;
2869
+ MapIterator.prototype = Object.create( Iterator && Iterator.prototype );
2804
2870
  MapIterator.prototype.constructor = MapIterator;
2805
2871
 
2806
2872
  MapIterator.prototype.next = function next () {
@@ -2855,12 +2921,12 @@
2855
2921
  };
2856
2922
  }
2857
2923
 
2858
- function makeMap(size, root, ownerID, hash$$1) {
2924
+ function makeMap(size, root, ownerID, hash) {
2859
2925
  var map = Object.create(MapPrototype);
2860
2926
  map.size = size;
2861
2927
  map._root = root;
2862
2928
  map.__ownerID = ownerID;
2863
- map.__hash = hash$$1;
2929
+ map.__hash = hash;
2864
2930
  map.__altered = false;
2865
2931
  return map;
2866
2932
  }
@@ -3057,7 +3123,7 @@
3057
3123
  return Boolean(maybeList && maybeList[IS_LIST_SYMBOL]);
3058
3124
  }
3059
3125
 
3060
- var List = /*@__PURE__*/(function (IndexedCollection$$1) {
3126
+ var List = /*@__PURE__*/(function (IndexedCollection) {
3061
3127
  function List(value) {
3062
3128
  var empty = emptyList();
3063
3129
  if (value === null || value === undefined) {
@@ -3066,7 +3132,7 @@
3066
3132
  if (isList(value)) {
3067
3133
  return value;
3068
3134
  }
3069
- var iter = IndexedCollection$$1(value);
3135
+ var iter = IndexedCollection(value);
3070
3136
  var size = iter.size;
3071
3137
  if (size === 0) {
3072
3138
  return empty;
@@ -3081,8 +3147,8 @@
3081
3147
  });
3082
3148
  }
3083
3149
 
3084
- if ( IndexedCollection$$1 ) List.__proto__ = IndexedCollection$$1;
3085
- List.prototype = Object.create( IndexedCollection$$1 && IndexedCollection$$1.prototype );
3150
+ if ( IndexedCollection ) List.__proto__ = IndexedCollection;
3151
+ List.prototype = Object.create( IndexedCollection && IndexedCollection.prototype );
3086
3152
  List.prototype.constructor = List;
3087
3153
 
3088
3154
  List.of = function of (/*...values*/) {
@@ -3115,10 +3181,10 @@
3115
3181
  return !this.has(index)
3116
3182
  ? this
3117
3183
  : index === 0
3118
- ? this.shift()
3119
- : index === this.size - 1
3120
- ? this.pop()
3121
- : this.splice(index, 1);
3184
+ ? this.shift()
3185
+ : index === this.size - 1
3186
+ ? this.pop()
3187
+ : this.splice(index, 1);
3122
3188
  };
3123
3189
 
3124
3190
  List.prototype.insert = function insert (index, value) {
@@ -3132,8 +3198,7 @@
3132
3198
  if (this.__ownerID) {
3133
3199
  this.size = this._origin = this._capacity = 0;
3134
3200
  this._level = SHIFT;
3135
- this._root = this._tail = null;
3136
- this.__hash = undefined;
3201
+ this._root = this._tail = this.__hash = undefined;
3137
3202
  this.__altered = true;
3138
3203
  return this;
3139
3204
  }
@@ -3177,7 +3242,7 @@
3177
3242
  var seqs = [];
3178
3243
  for (var i = 0; i < arguments.length; i++) {
3179
3244
  var argument = arguments$1[i];
3180
- var seq = IndexedCollection$$1(
3245
+ var seq = IndexedCollection(
3181
3246
  typeof argument !== 'string' && hasIterator(argument)
3182
3247
  ? argument
3183
3248
  : [argument]
@@ -3202,11 +3267,11 @@
3202
3267
  };
3203
3268
 
3204
3269
  List.prototype.map = function map (mapper, context) {
3205
- var this$1 = this;
3270
+ var this$1$1 = this;
3206
3271
 
3207
3272
  return this.withMutations(function (list) {
3208
- for (var i = 0; i < this$1.size; i++) {
3209
- list.set(i, mapper.call(context, list.get(i), i, list));
3273
+ for (var i = 0; i < this$1$1.size; i++) {
3274
+ list.set(i, mapper.call(context, list.get(i), i, this$1$1));
3210
3275
  }
3211
3276
  });
3212
3277
  };
@@ -3280,20 +3345,20 @@
3280
3345
  ListPrototype[IS_LIST_SYMBOL] = true;
3281
3346
  ListPrototype[DELETE] = ListPrototype.remove;
3282
3347
  ListPrototype.merge = ListPrototype.concat;
3283
- ListPrototype.setIn = setIn$1;
3348
+ ListPrototype.setIn = setIn;
3284
3349
  ListPrototype.deleteIn = ListPrototype.removeIn = deleteIn;
3285
- ListPrototype.update = update$1;
3286
- ListPrototype.updateIn = updateIn$1;
3350
+ ListPrototype.update = update;
3351
+ ListPrototype.updateIn = updateIn;
3287
3352
  ListPrototype.mergeIn = mergeIn;
3288
3353
  ListPrototype.mergeDeepIn = mergeDeepIn;
3289
3354
  ListPrototype.withMutations = withMutations;
3290
3355
  ListPrototype.wasAltered = wasAltered;
3291
3356
  ListPrototype.asImmutable = asImmutable;
3292
3357
  ListPrototype['@@transducer/init'] = ListPrototype.asMutable = asMutable;
3293
- ListPrototype['@@transducer/step'] = function(result, arr) {
3358
+ ListPrototype['@@transducer/step'] = function (result, arr) {
3294
3359
  return result.push(arr);
3295
3360
  };
3296
- ListPrototype['@@transducer/result'] = function(obj) {
3361
+ ListPrototype['@@transducer/result'] = function (obj) {
3297
3362
  return obj.asImmutable();
3298
3363
  };
3299
3364
 
@@ -3576,8 +3641,8 @@
3576
3641
  end === undefined
3577
3642
  ? oldCapacity
3578
3643
  : end < 0
3579
- ? oldCapacity + end
3580
- : oldOrigin + end;
3644
+ ? oldCapacity + end
3645
+ : oldOrigin + end;
3581
3646
  if (newOrigin === oldOrigin && newCapacity === oldCapacity) {
3582
3647
  return list;
3583
3648
  }
@@ -3625,8 +3690,8 @@
3625
3690
  newTailOffset < oldTailOffset
3626
3691
  ? listNodeFor(list, newCapacity - 1)
3627
3692
  : newTailOffset > oldTailOffset
3628
- ? new VNode([], owner)
3629
- : oldTail;
3693
+ ? new VNode([], owner)
3694
+ : oldTail;
3630
3695
 
3631
3696
  // Merge Tail into tree.
3632
3697
  if (
@@ -3709,21 +3774,21 @@
3709
3774
  return size < SIZE ? 0 : ((size - 1) >>> SHIFT) << SHIFT;
3710
3775
  }
3711
3776
 
3712
- var OrderedMap = /*@__PURE__*/(function (Map$$1) {
3777
+ var OrderedMap = /*@__PURE__*/(function (Map) {
3713
3778
  function OrderedMap(value) {
3714
3779
  return value === null || value === undefined
3715
3780
  ? emptyOrderedMap()
3716
3781
  : isOrderedMap(value)
3717
- ? value
3718
- : emptyOrderedMap().withMutations(function (map) {
3719
- var iter = KeyedCollection(value);
3720
- assertNotInfinite(iter.size);
3721
- iter.forEach(function (v, k) { return map.set(k, v); });
3722
- });
3782
+ ? value
3783
+ : emptyOrderedMap().withMutations(function (map) {
3784
+ var iter = KeyedCollection(value);
3785
+ assertNotInfinite(iter.size);
3786
+ iter.forEach(function (v, k) { return map.set(k, v); });
3787
+ });
3723
3788
  }
3724
3789
 
3725
- if ( Map$$1 ) OrderedMap.__proto__ = Map$$1;
3726
- OrderedMap.prototype = Object.create( Map$$1 && Map$$1.prototype );
3790
+ if ( Map ) OrderedMap.__proto__ = Map;
3791
+ OrderedMap.prototype = Object.create( Map && Map.prototype );
3727
3792
  OrderedMap.prototype.constructor = OrderedMap;
3728
3793
 
3729
3794
  OrderedMap.of = function of (/*...values*/) {
@@ -3751,6 +3816,7 @@
3751
3816
  this.size = 0;
3752
3817
  this._map.clear();
3753
3818
  this._list.clear();
3819
+ this.__altered = true;
3754
3820
  return this;
3755
3821
  }
3756
3822
  return emptyOrderedMap();
@@ -3764,15 +3830,11 @@
3764
3830
  return updateOrderedMap(this, k, NOT_SET);
3765
3831
  };
3766
3832
 
3767
- OrderedMap.prototype.wasAltered = function wasAltered () {
3768
- return this._map.wasAltered() || this._list.wasAltered();
3769
- };
3770
-
3771
3833
  OrderedMap.prototype.__iterate = function __iterate (fn, reverse) {
3772
- var this$1 = this;
3834
+ var this$1$1 = this;
3773
3835
 
3774
3836
  return this._list.__iterate(
3775
- function (entry) { return entry && fn(entry[1], entry[0], this$1); },
3837
+ function (entry) { return entry && fn(entry[1], entry[0], this$1$1); },
3776
3838
  reverse
3777
3839
  );
3778
3840
  };
@@ -3792,6 +3854,7 @@
3792
3854
  return emptyOrderedMap();
3793
3855
  }
3794
3856
  this.__ownerID = ownerID;
3857
+ this.__altered = false;
3795
3858
  this._map = newMap;
3796
3859
  this._list = newList;
3797
3860
  return this;
@@ -3814,6 +3877,7 @@
3814
3877
  omap._list = list;
3815
3878
  omap.__ownerID = ownerID;
3816
3879
  omap.__hash = hash;
3880
+ omap.__altered = false;
3817
3881
  return omap;
3818
3882
  }
3819
3883
 
@@ -3866,6 +3930,7 @@
3866
3930
  omap._map = newMap;
3867
3931
  omap._list = newList;
3868
3932
  omap.__hash = undefined;
3933
+ omap.__altered = true;
3869
3934
  return omap;
3870
3935
  }
3871
3936
  return makeOrderedMap(newMap, newList);
@@ -3877,17 +3942,17 @@
3877
3942
  return Boolean(maybeStack && maybeStack[IS_STACK_SYMBOL]);
3878
3943
  }
3879
3944
 
3880
- var Stack = /*@__PURE__*/(function (IndexedCollection$$1) {
3945
+ var Stack = /*@__PURE__*/(function (IndexedCollection) {
3881
3946
  function Stack(value) {
3882
3947
  return value === null || value === undefined
3883
3948
  ? emptyStack()
3884
3949
  : isStack(value)
3885
- ? value
3886
- : emptyStack().pushAll(value);
3950
+ ? value
3951
+ : emptyStack().pushAll(value);
3887
3952
  }
3888
3953
 
3889
- if ( IndexedCollection$$1 ) Stack.__proto__ = IndexedCollection$$1;
3890
- Stack.prototype = Object.create( IndexedCollection$$1 && IndexedCollection$$1.prototype );
3954
+ if ( IndexedCollection ) Stack.__proto__ = IndexedCollection;
3955
+ Stack.prototype = Object.create( IndexedCollection && IndexedCollection.prototype );
3891
3956
  Stack.prototype.constructor = Stack;
3892
3957
 
3893
3958
  Stack.of = function of (/*...values*/) {
@@ -3940,7 +4005,7 @@
3940
4005
  };
3941
4006
 
3942
4007
  Stack.prototype.pushAll = function pushAll (iter) {
3943
- iter = IndexedCollection$$1(iter);
4008
+ iter = IndexedCollection(iter);
3944
4009
  if (iter.size === 0) {
3945
4010
  return this;
3946
4011
  }
@@ -3993,7 +4058,7 @@
3993
4058
  var resolvedEnd = resolveEnd(end, this.size);
3994
4059
  if (resolvedEnd !== this.size) {
3995
4060
  // super.slice(begin, end);
3996
- return IndexedCollection$$1.prototype.slice.call(this, begin, end);
4061
+ return IndexedCollection.prototype.slice.call(this, begin, end);
3997
4062
  }
3998
4063
  var newSize = this.size - resolvedBegin;
3999
4064
  var head = this._head;
@@ -4030,11 +4095,11 @@
4030
4095
  // @pragma Iteration
4031
4096
 
4032
4097
  Stack.prototype.__iterate = function __iterate (fn, reverse) {
4033
- var this$1 = this;
4098
+ var this$1$1 = this;
4034
4099
 
4035
4100
  if (reverse) {
4036
4101
  return new ArraySeq(this.toArray()).__iterate(
4037
- function (v, k) { return fn(v, k, this$1); },
4102
+ function (v, k) { return fn(v, k, this$1$1); },
4038
4103
  reverse
4039
4104
  );
4040
4105
  }
@@ -4079,10 +4144,10 @@
4079
4144
  StackPrototype.wasAltered = wasAltered;
4080
4145
  StackPrototype.asImmutable = asImmutable;
4081
4146
  StackPrototype['@@transducer/init'] = StackPrototype.asMutable = asMutable;
4082
- StackPrototype['@@transducer/step'] = function(result, arr) {
4147
+ StackPrototype['@@transducer/step'] = function (result, arr) {
4083
4148
  return result.unshift(arr);
4084
4149
  };
4085
- StackPrototype['@@transducer/result'] = function(obj) {
4150
+ StackPrototype['@@transducer/result'] = function (obj) {
4086
4151
  return obj.asImmutable();
4087
4152
  };
4088
4153
 
@@ -4166,8 +4231,8 @@
4166
4231
  notAssociative
4167
4232
  ? !a.has(v)
4168
4233
  : flipped
4169
- ? !is(v, a.get(k, NOT_SET))
4170
- : !is(a.get(k, NOT_SET), v)
4234
+ ? !is(v, a.get(k, NOT_SET))
4235
+ : !is(a.get(k, NOT_SET), v)
4171
4236
  ) {
4172
4237
  allEqual = false;
4173
4238
  return false;
@@ -4177,9 +4242,6 @@
4177
4242
  return allEqual && a.size === bSize;
4178
4243
  }
4179
4244
 
4180
- /**
4181
- * Contributes additional methods to a constructor
4182
- */
4183
4245
  function mixin(ctor, methods) {
4184
4246
  var keyCopier = function (key) {
4185
4247
  ctor.prototype[key] = methods[key];
@@ -4214,21 +4276,21 @@
4214
4276
  return result;
4215
4277
  }
4216
4278
 
4217
- var Set = /*@__PURE__*/(function (SetCollection$$1) {
4279
+ var Set = /*@__PURE__*/(function (SetCollection) {
4218
4280
  function Set(value) {
4219
4281
  return value === null || value === undefined
4220
4282
  ? emptySet()
4221
4283
  : isSet(value) && !isOrdered(value)
4222
- ? value
4223
- : emptySet().withMutations(function (set) {
4224
- var iter = SetCollection$$1(value);
4225
- assertNotInfinite(iter.size);
4226
- iter.forEach(function (v) { return set.add(v); });
4227
- });
4284
+ ? value
4285
+ : emptySet().withMutations(function (set) {
4286
+ var iter = SetCollection(value);
4287
+ assertNotInfinite(iter.size);
4288
+ iter.forEach(function (v) { return set.add(v); });
4289
+ });
4228
4290
  }
4229
4291
 
4230
- if ( SetCollection$$1 ) Set.__proto__ = SetCollection$$1;
4231
- Set.prototype = Object.create( SetCollection$$1 && SetCollection$$1.prototype );
4292
+ if ( SetCollection ) Set.__proto__ = SetCollection;
4293
+ Set.prototype = Object.create( SetCollection && SetCollection.prototype );
4232
4294
  Set.prototype.constructor = Set;
4233
4295
 
4234
4296
  Set.of = function of (/*...values*/) {
@@ -4280,21 +4342,27 @@
4280
4342
  // @pragma Composition
4281
4343
 
4282
4344
  Set.prototype.map = function map (mapper, context) {
4283
- var this$1 = this;
4345
+ var this$1$1 = this;
4284
4346
 
4285
- var removes = [];
4286
- var adds = [];
4287
- this.forEach(function (value) {
4288
- var mapped = mapper.call(context, value, value, this$1);
4289
- if (mapped !== value) {
4290
- removes.push(value);
4291
- adds.push(mapped);
4292
- }
4293
- });
4294
- return this.withMutations(function (set) {
4295
- removes.forEach(function (value) { return set.remove(value); });
4296
- adds.forEach(function (value) { return set.add(value); });
4297
- });
4347
+ // keep track if the set is altered by the map function
4348
+ var didChanges = false;
4349
+
4350
+ var newMap = updateSet(
4351
+ this,
4352
+ this._map.mapEntries(function (ref) {
4353
+ var v = ref[1];
4354
+
4355
+ var mapped = mapper.call(context, v, v, this$1$1);
4356
+
4357
+ if (mapped !== v) {
4358
+ didChanges = true;
4359
+ }
4360
+
4361
+ return [mapped, mapped];
4362
+ }, context)
4363
+ );
4364
+
4365
+ return didChanges ? newMap : this;
4298
4366
  };
4299
4367
 
4300
4368
  Set.prototype.union = function union () {
@@ -4310,7 +4378,7 @@
4310
4378
  }
4311
4379
  return this.withMutations(function (set) {
4312
4380
  for (var ii = 0; ii < iters.length; ii++) {
4313
- SetCollection$$1(iters[ii]).forEach(function (value) { return set.add(value); });
4381
+ SetCollection(iters[ii]).forEach(function (value) { return set.add(value); });
4314
4382
  }
4315
4383
  });
4316
4384
  };
@@ -4322,7 +4390,7 @@
4322
4390
  if (iters.length === 0) {
4323
4391
  return this;
4324
4392
  }
4325
- iters = iters.map(function (iter) { return SetCollection$$1(iter); });
4393
+ iters = iters.map(function (iter) { return SetCollection(iter); });
4326
4394
  var toRemove = [];
4327
4395
  this.forEach(function (value) {
4328
4396
  if (!iters.every(function (iter) { return iter.includes(value); })) {
@@ -4343,7 +4411,7 @@
4343
4411
  if (iters.length === 0) {
4344
4412
  return this;
4345
4413
  }
4346
- iters = iters.map(function (iter) { return SetCollection$$1(iter); });
4414
+ iters = iters.map(function (iter) { return SetCollection(iter); });
4347
4415
  var toRemove = [];
4348
4416
  this.forEach(function (value) {
4349
4417
  if (iters.some(function (iter) { return iter.includes(value); })) {
@@ -4372,9 +4440,9 @@
4372
4440
  };
4373
4441
 
4374
4442
  Set.prototype.__iterate = function __iterate (fn, reverse) {
4375
- var this$1 = this;
4443
+ var this$1$1 = this;
4376
4444
 
4377
- return this._map.__iterate(function (k) { return fn(k, k, this$1); }, reverse);
4445
+ return this._map.__iterate(function (k) { return fn(k, k, this$1$1); }, reverse);
4378
4446
  };
4379
4447
 
4380
4448
  Set.prototype.__iterator = function __iterator (type, reverse) {
@@ -4409,10 +4477,10 @@
4409
4477
  SetPrototype.withMutations = withMutations;
4410
4478
  SetPrototype.asImmutable = asImmutable;
4411
4479
  SetPrototype['@@transducer/init'] = SetPrototype.asMutable = asMutable;
4412
- SetPrototype['@@transducer/step'] = function(result, arr) {
4480
+ SetPrototype['@@transducer/step'] = function (result, arr) {
4413
4481
  return result.add(arr);
4414
4482
  };
4415
- SetPrototype['@@transducer/result'] = function(obj) {
4483
+ SetPrototype['@@transducer/result'] = function (obj) {
4416
4484
  return obj.asImmutable();
4417
4485
  };
4418
4486
 
@@ -4428,8 +4496,8 @@
4428
4496
  return newMap === set._map
4429
4497
  ? set
4430
4498
  : newMap.size === 0
4431
- ? set.__empty()
4432
- : set.__make(newMap);
4499
+ ? set.__empty()
4500
+ : set.__make(newMap);
4433
4501
  }
4434
4502
 
4435
4503
  function makeSet(map, ownerID) {
@@ -4450,7 +4518,7 @@
4450
4518
  * (exclusive), by step, where start defaults to 0, step to 1, and end to
4451
4519
  * infinity. When start is equal to end, returns empty list.
4452
4520
  */
4453
- var Range = /*@__PURE__*/(function (IndexedSeq$$1) {
4521
+ var Range = /*@__PURE__*/(function (IndexedSeq) {
4454
4522
  function Range(start, end, step) {
4455
4523
  if (!(this instanceof Range)) {
4456
4524
  return new Range(start, end, step);
@@ -4476,8 +4544,8 @@
4476
4544
  }
4477
4545
  }
4478
4546
 
4479
- if ( IndexedSeq$$1 ) Range.__proto__ = IndexedSeq$$1;
4480
- Range.prototype = Object.create( IndexedSeq$$1 && IndexedSeq$$1.prototype );
4547
+ if ( IndexedSeq ) Range.__proto__ = IndexedSeq;
4548
+ Range.prototype = Object.create( IndexedSeq && IndexedSeq.prototype );
4481
4549
  Range.prototype.constructor = Range;
4482
4550
 
4483
4551
  Range.prototype.toString = function toString () {
@@ -4582,7 +4650,7 @@
4582
4650
 
4583
4651
  var EMPTY_RANGE;
4584
4652
 
4585
- function getIn(collection, searchKeyPath, notSetValue) {
4653
+ function getIn$1(collection, searchKeyPath, notSetValue) {
4586
4654
  var keyPath = coerceKeyPath(searchKeyPath);
4587
4655
  var i = 0;
4588
4656
  while (i !== keyPath.length) {
@@ -4594,16 +4662,16 @@
4594
4662
  return collection;
4595
4663
  }
4596
4664
 
4597
- function getIn$1(searchKeyPath, notSetValue) {
4598
- return getIn(this, searchKeyPath, notSetValue);
4665
+ function getIn(searchKeyPath, notSetValue) {
4666
+ return getIn$1(this, searchKeyPath, notSetValue);
4599
4667
  }
4600
4668
 
4601
- function hasIn(collection, keyPath) {
4602
- return getIn(collection, keyPath, NOT_SET) !== NOT_SET;
4669
+ function hasIn$1(collection, keyPath) {
4670
+ return getIn$1(collection, keyPath, NOT_SET) !== NOT_SET;
4603
4671
  }
4604
4672
 
4605
- function hasIn$1(searchKeyPath) {
4606
- return hasIn(this, searchKeyPath);
4673
+ function hasIn(searchKeyPath) {
4674
+ return hasIn$1(this, searchKeyPath);
4607
4675
  }
4608
4676
 
4609
4677
  function toObject() {
@@ -4681,8 +4749,8 @@
4681
4749
  return isIndexed(this)
4682
4750
  ? this.toIndexedSeq()
4683
4751
  : isKeyed(this)
4684
- ? this.toKeyedSeq()
4685
- : this.toSetSeq();
4752
+ ? this.toKeyedSeq()
4753
+ : this.toSetSeq();
4686
4754
  },
4687
4755
 
4688
4756
  toStack: function toStack() {
@@ -4708,9 +4776,7 @@
4708
4776
  return (
4709
4777
  head +
4710
4778
  ' ' +
4711
- this.toSeq()
4712
- .map(this.__toStringMapper)
4713
- .join(', ') +
4779
+ this.toSeq().map(this.__toStringMapper).join(', ') +
4714
4780
  ' ' +
4715
4781
  tail
4716
4782
  );
@@ -4851,10 +4917,7 @@
4851
4917
  // We cache as an entries array, so we can just return the cache!
4852
4918
  return new ArraySeq(collection._cache);
4853
4919
  }
4854
- var entriesSequence = collection
4855
- .toSeq()
4856
- .map(entryMapper)
4857
- .toIndexedSeq();
4920
+ var entriesSequence = collection.toSeq().map(entryMapper).toIndexedSeq();
4858
4921
  entriesSequence.fromEntrySeq = function () { return collection.toSeq(); };
4859
4922
  return entriesSequence;
4860
4923
  },
@@ -4880,9 +4943,7 @@
4880
4943
  },
4881
4944
 
4882
4945
  findLast: function findLast(predicate, context, notSetValue) {
4883
- return this.toKeyedSeq()
4884
- .reverse()
4885
- .find(predicate, context, notSetValue);
4946
+ return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);
4886
4947
  },
4887
4948
 
4888
4949
  findLastEntry: function findLastEntry(predicate, context, notSetValue) {
@@ -4892,9 +4953,7 @@
4892
4953
  },
4893
4954
 
4894
4955
  findLastKey: function findLastKey(predicate, context) {
4895
- return this.toKeyedSeq()
4896
- .reverse()
4897
- .findKey(predicate, context);
4956
+ return this.toKeyedSeq().reverse().findKey(predicate, context);
4898
4957
  },
4899
4958
 
4900
4959
  first: function first(notSetValue) {
@@ -4917,7 +4976,7 @@
4917
4976
  return this.find(function (_, key) { return is(key, searchKey); }, undefined, notSetValue);
4918
4977
  },
4919
4978
 
4920
- getIn: getIn$1,
4979
+ getIn: getIn,
4921
4980
 
4922
4981
  groupBy: function groupBy(grouper, context) {
4923
4982
  return groupByFactory(this, grouper, context);
@@ -4927,7 +4986,7 @@
4927
4986
  return this.get(searchKey, NOT_SET) !== NOT_SET;
4928
4987
  },
4929
4988
 
4930
- hasIn: hasIn$1,
4989
+ hasIn: hasIn,
4931
4990
 
4932
4991
  isSubset: function isSubset(iter) {
4933
4992
  iter = typeof iter.includes === 'function' ? iter : Collection(iter);
@@ -4944,21 +5003,15 @@
4944
5003
  },
4945
5004
 
4946
5005
  keySeq: function keySeq() {
4947
- return this.toSeq()
4948
- .map(keyMapper)
4949
- .toIndexedSeq();
5006
+ return this.toSeq().map(keyMapper).toIndexedSeq();
4950
5007
  },
4951
5008
 
4952
5009
  last: function last(notSetValue) {
4953
- return this.toSeq()
4954
- .reverse()
4955
- .first(notSetValue);
5010
+ return this.toSeq().reverse().first(notSetValue);
4956
5011
  },
4957
5012
 
4958
5013
  lastKeyOf: function lastKeyOf(searchValue) {
4959
- return this.toKeyedSeq()
4960
- .reverse()
4961
- .keyOf(searchValue);
5014
+ return this.toKeyedSeq().reverse().keyOf(searchValue);
4962
5015
  },
4963
5016
 
4964
5017
  max: function max(comparator) {
@@ -5050,7 +5103,7 @@
5050
5103
  CollectionPrototype[ITERATOR_SYMBOL] = CollectionPrototype.values;
5051
5104
  CollectionPrototype.toJSON = CollectionPrototype.toArray;
5052
5105
  CollectionPrototype.__toStringMapper = quoteString;
5053
- CollectionPrototype.inspect = CollectionPrototype.toSource = function() {
5106
+ CollectionPrototype.inspect = CollectionPrototype.toSource = function () {
5054
5107
  return this.toString();
5055
5108
  };
5056
5109
  CollectionPrototype.chain = CollectionPrototype.flatMap;
@@ -5064,25 +5117,25 @@
5064
5117
  },
5065
5118
 
5066
5119
  mapEntries: function mapEntries(mapper, context) {
5067
- var this$1 = this;
5120
+ var this$1$1 = this;
5068
5121
 
5069
5122
  var iterations = 0;
5070
5123
  return reify(
5071
5124
  this,
5072
5125
  this.toSeq()
5073
- .map(function (v, k) { return mapper.call(context, [k, v], iterations++, this$1); })
5126
+ .map(function (v, k) { return mapper.call(context, [k, v], iterations++, this$1$1); })
5074
5127
  .fromEntrySeq()
5075
5128
  );
5076
5129
  },
5077
5130
 
5078
5131
  mapKeys: function mapKeys(mapper, context) {
5079
- var this$1 = this;
5132
+ var this$1$1 = this;
5080
5133
 
5081
5134
  return reify(
5082
5135
  this,
5083
5136
  this.toSeq()
5084
5137
  .flip()
5085
- .map(function (k, v) { return mapper.call(context, k, v, this$1); })
5138
+ .map(function (k, v) { return mapper.call(context, k, v, this$1$1); })
5086
5139
  .flip()
5087
5140
  );
5088
5141
  },
@@ -5167,7 +5220,8 @@
5167
5220
  get: function get(index, notSetValue) {
5168
5221
  index = wrapIndex(this, index);
5169
5222
  return index < 0 ||
5170
- (this.size === Infinity || (this.size !== undefined && index > this.size))
5223
+ this.size === Infinity ||
5224
+ (this.size !== undefined && index > this.size)
5171
5225
  ? notSetValue
5172
5226
  : this.find(function (_, key) { return key === index; }, undefined, notSetValue);
5173
5227
  },
@@ -5280,13 +5334,13 @@
5280
5334
  }
5281
5335
 
5282
5336
  function not(predicate) {
5283
- return function() {
5337
+ return function () {
5284
5338
  return !predicate.apply(this, arguments);
5285
5339
  };
5286
5340
  }
5287
5341
 
5288
5342
  function neg(predicate) {
5289
- return function() {
5343
+ return function () {
5290
5344
  return -predicate.apply(this, arguments);
5291
5345
  };
5292
5346
  }
@@ -5316,12 +5370,12 @@
5316
5370
  h = (h + hashMerge(hash(v), hash(k))) | 0;
5317
5371
  }
5318
5372
  : ordered
5319
- ? function (v) {
5320
- h = (31 * h + hash(v)) | 0;
5321
- }
5322
- : function (v) {
5323
- h = (h + hash(v)) | 0;
5324
- }
5373
+ ? function (v) {
5374
+ h = (31 * h + hash(v)) | 0;
5375
+ }
5376
+ : function (v) {
5377
+ h = (h + hash(v)) | 0;
5378
+ }
5325
5379
  );
5326
5380
  return murmurHashOfSize(size, h);
5327
5381
  }
@@ -5341,21 +5395,21 @@
5341
5395
  return (a ^ (b + 0x9e3779b9 + (a << 6) + (a >> 2))) | 0; // int
5342
5396
  }
5343
5397
 
5344
- var OrderedSet = /*@__PURE__*/(function (Set$$1) {
5398
+ var OrderedSet = /*@__PURE__*/(function (Set) {
5345
5399
  function OrderedSet(value) {
5346
5400
  return value === null || value === undefined
5347
5401
  ? emptyOrderedSet()
5348
5402
  : isOrderedSet(value)
5349
- ? value
5350
- : emptyOrderedSet().withMutations(function (set) {
5351
- var iter = SetCollection(value);
5352
- assertNotInfinite(iter.size);
5353
- iter.forEach(function (v) { return set.add(v); });
5354
- });
5403
+ ? value
5404
+ : emptyOrderedSet().withMutations(function (set) {
5405
+ var iter = SetCollection(value);
5406
+ assertNotInfinite(iter.size);
5407
+ iter.forEach(function (v) { return set.add(v); });
5408
+ });
5355
5409
  }
5356
5410
 
5357
- if ( Set$$1 ) OrderedSet.__proto__ = Set$$1;
5358
- OrderedSet.prototype = Object.create( Set$$1 && Set$$1.prototype );
5411
+ if ( Set ) OrderedSet.__proto__ = Set;
5412
+ OrderedSet.prototype = Object.create( Set && Set.prototype );
5359
5413
  OrderedSet.prototype.constructor = OrderedSet;
5360
5414
 
5361
5415
  OrderedSet.of = function of (/*...values*/) {
@@ -5379,6 +5433,7 @@
5379
5433
  OrderedSetPrototype[IS_ORDERED_SYMBOL] = true;
5380
5434
  OrderedSetPrototype.zip = IndexedCollectionPrototype.zip;
5381
5435
  OrderedSetPrototype.zipWith = IndexedCollectionPrototype.zipWith;
5436
+ OrderedSetPrototype.zipAll = IndexedCollectionPrototype.zipAll;
5382
5437
 
5383
5438
  OrderedSetPrototype.__empty = emptyOrderedSet;
5384
5439
  OrderedSetPrototype.__make = makeOrderedSet;
@@ -5398,11 +5453,33 @@
5398
5453
  );
5399
5454
  }
5400
5455
 
5456
+ function throwOnInvalidDefaultValues(defaultValues) {
5457
+ if (isRecord(defaultValues)) {
5458
+ throw new Error(
5459
+ 'Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.'
5460
+ );
5461
+ }
5462
+
5463
+ if (isImmutable(defaultValues)) {
5464
+ throw new Error(
5465
+ 'Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.'
5466
+ );
5467
+ }
5468
+
5469
+ if (defaultValues === null || typeof defaultValues !== 'object') {
5470
+ throw new Error(
5471
+ 'Can not call `Record` with a non-object as default values. Use a plain javascript object instead.'
5472
+ );
5473
+ }
5474
+ }
5475
+
5401
5476
  var Record = function Record(defaultValues, name) {
5402
5477
  var hasInitialized;
5403
5478
 
5479
+ throwOnInvalidDefaultValues(defaultValues);
5480
+
5404
5481
  var RecordType = function Record(values) {
5405
- var this$1 = this;
5482
+ var this$1$1 = this;
5406
5483
 
5407
5484
  if (values instanceof RecordType) {
5408
5485
  return values;
@@ -5442,16 +5519,16 @@
5442
5519
  }
5443
5520
  this.__ownerID = undefined;
5444
5521
  this._values = List().withMutations(function (l) {
5445
- l.setSize(this$1._keys.length);
5522
+ l.setSize(this$1$1._keys.length);
5446
5523
  KeyedCollection(values).forEach(function (v, k) {
5447
- l.set(this$1._indices[k], v === this$1._defaultValues[k] ? undefined : v);
5524
+ l.set(this$1$1._indices[k], v === this$1$1._defaultValues[k] ? undefined : v);
5448
5525
  });
5449
5526
  });
5527
+ return this;
5450
5528
  };
5451
5529
 
5452
- var RecordTypePrototype = (RecordType.prototype = Object.create(
5453
- RecordPrototype
5454
- ));
5530
+ var RecordTypePrototype = (RecordType.prototype =
5531
+ Object.create(RecordPrototype));
5455
5532
  RecordTypePrototype.constructor = RecordType;
5456
5533
 
5457
5534
  if (name) {
@@ -5474,10 +5551,7 @@
5474
5551
 
5475
5552
  Record.prototype.equals = function equals (other) {
5476
5553
  return (
5477
- this === other ||
5478
- (other &&
5479
- this._keys === other._keys &&
5480
- recordSeq(this).equals(recordSeq(other)))
5554
+ this === other || (other && recordSeq(this).equals(recordSeq(other)))
5481
5555
  );
5482
5556
  };
5483
5557
 
@@ -5521,6 +5595,7 @@
5521
5595
 
5522
5596
  Record.prototype.clear = function clear () {
5523
5597
  var newValues = this._values.clear().setSize(this._keys.length);
5598
+
5524
5599
  return this.__ownerID ? this : makeRecord(this, newValues);
5525
5600
  };
5526
5601
 
@@ -5567,24 +5642,24 @@
5567
5642
  RecordPrototype[IS_RECORD_SYMBOL] = true;
5568
5643
  RecordPrototype[DELETE] = RecordPrototype.remove;
5569
5644
  RecordPrototype.deleteIn = RecordPrototype.removeIn = deleteIn;
5570
- RecordPrototype.getIn = getIn$1;
5645
+ RecordPrototype.getIn = getIn;
5571
5646
  RecordPrototype.hasIn = CollectionPrototype.hasIn;
5572
- RecordPrototype.merge = merge;
5573
- RecordPrototype.mergeWith = mergeWith;
5647
+ RecordPrototype.merge = merge$1;
5648
+ RecordPrototype.mergeWith = mergeWith$1;
5574
5649
  RecordPrototype.mergeIn = mergeIn;
5575
- RecordPrototype.mergeDeep = mergeDeep$1;
5576
- RecordPrototype.mergeDeepWith = mergeDeepWith$1;
5650
+ RecordPrototype.mergeDeep = mergeDeep;
5651
+ RecordPrototype.mergeDeepWith = mergeDeepWith;
5577
5652
  RecordPrototype.mergeDeepIn = mergeDeepIn;
5578
- RecordPrototype.setIn = setIn$1;
5579
- RecordPrototype.update = update$1;
5580
- RecordPrototype.updateIn = updateIn$1;
5653
+ RecordPrototype.setIn = setIn;
5654
+ RecordPrototype.update = update;
5655
+ RecordPrototype.updateIn = updateIn;
5581
5656
  RecordPrototype.withMutations = withMutations;
5582
5657
  RecordPrototype.asMutable = asMutable;
5583
5658
  RecordPrototype.asImmutable = asImmutable;
5584
5659
  RecordPrototype[ITERATOR_SYMBOL] = RecordPrototype.entries;
5585
5660
  RecordPrototype.toJSON = RecordPrototype.toObject =
5586
5661
  CollectionPrototype.toObject;
5587
- RecordPrototype.inspect = RecordPrototype.toSource = function() {
5662
+ RecordPrototype.inspect = RecordPrototype.toSource = function () {
5588
5663
  return this.toString();
5589
5664
  };
5590
5665
 
@@ -5606,10 +5681,10 @@
5606
5681
  function setProp(prototype, name) {
5607
5682
  try {
5608
5683
  Object.defineProperty(prototype, name, {
5609
- get: function() {
5684
+ get: function () {
5610
5685
  return this.get(name);
5611
5686
  },
5612
- set: function(value) {
5687
+ set: function (value) {
5613
5688
  invariant(this.__ownerID, 'Cannot set on an immutable record.');
5614
5689
  this.set(name, value);
5615
5690
  },
@@ -5623,7 +5698,7 @@
5623
5698
  * Returns a lazy Seq of `value` repeated `times` times. When `times` is
5624
5699
  * undefined, returns an infinite sequence of `value`.
5625
5700
  */
5626
- var Repeat = /*@__PURE__*/(function (IndexedSeq$$1) {
5701
+ var Repeat = /*@__PURE__*/(function (IndexedSeq) {
5627
5702
  function Repeat(value, times) {
5628
5703
  if (!(this instanceof Repeat)) {
5629
5704
  return new Repeat(value, times);
@@ -5638,8 +5713,8 @@
5638
5713
  }
5639
5714
  }
5640
5715
 
5641
- if ( IndexedSeq$$1 ) Repeat.__proto__ = IndexedSeq$$1;
5642
- Repeat.prototype = Object.create( IndexedSeq$$1 && IndexedSeq$$1.prototype );
5716
+ if ( IndexedSeq ) Repeat.__proto__ = IndexedSeq;
5717
+ Repeat.prototype = Object.create( IndexedSeq && IndexedSeq.prototype );
5643
5718
  Repeat.prototype.constructor = Repeat;
5644
5719
 
5645
5720
  Repeat.prototype.toString = function toString () {
@@ -5697,14 +5772,13 @@
5697
5772
  };
5698
5773
 
5699
5774
  Repeat.prototype.__iterator = function __iterator (type, reverse) {
5700
- var this$1 = this;
5775
+ var this$1$1 = this;
5701
5776
 
5702
5777
  var size = this.size;
5703
5778
  var i = 0;
5704
- return new Iterator(
5705
- function () { return i === size
5706
- ? iteratorDone()
5707
- : iteratorValue(type, reverse ? size - ++i : i++, this$1._value); }
5779
+ return new Iterator(function () { return i === size
5780
+ ? iteratorDone()
5781
+ : iteratorValue(type, reverse ? size - ++i : i++, this$1$1._value); }
5708
5782
  );
5709
5783
  };
5710
5784
 
@@ -5733,9 +5807,9 @@
5733
5807
  function fromJSWith(stack, converter, value, key, keyPath, parentValue) {
5734
5808
  var toSeq = Array.isArray(value)
5735
5809
  ? IndexedSeq
5736
- : isPlainObj(value)
5737
- ? KeyedSeq
5738
- : null;
5810
+ : isPlainObject(value)
5811
+ ? KeyedSeq
5812
+ : null;
5739
5813
  if (toSeq) {
5740
5814
  if (~stack.indexOf(value)) {
5741
5815
  throw new TypeError('Cannot convert circular structure to Immutable');
@@ -5760,7 +5834,7 @@
5760
5834
  return isKeyed(v) ? v.toMap() : v.toList();
5761
5835
  }
5762
5836
 
5763
- var version = "4.0.0-rc.11";
5837
+ var version = "4.0.0-rc.14";
5764
5838
 
5765
5839
  var Immutable = {
5766
5840
  version: version,
@@ -5792,6 +5866,7 @@
5792
5866
  isAssociative: isAssociative,
5793
5867
  isOrdered: isOrdered,
5794
5868
  isValueObject: isValueObject,
5869
+ isPlainObject: isPlainObject,
5795
5870
  isSeq: isSeq,
5796
5871
  isList: isList,
5797
5872
  isMap: isMap,
@@ -5802,62 +5877,71 @@
5802
5877
  isRecord: isRecord,
5803
5878
 
5804
5879
  get: get,
5805
- getIn: getIn,
5880
+ getIn: getIn$1,
5806
5881
  has: has,
5807
- hasIn: hasIn,
5808
- merge: merge$1,
5809
- mergeDeep: mergeDeep,
5810
- mergeWith: mergeWith$1,
5811
- mergeDeepWith: mergeDeepWith,
5882
+ hasIn: hasIn$1,
5883
+ merge: merge,
5884
+ mergeDeep: mergeDeep$1,
5885
+ mergeWith: mergeWith,
5886
+ mergeDeepWith: mergeDeepWith$1,
5812
5887
  remove: remove,
5813
5888
  removeIn: removeIn,
5814
5889
  set: set,
5815
- setIn: setIn,
5816
- update: update,
5817
- updateIn: updateIn,
5890
+ setIn: setIn$1,
5891
+ update: update$1,
5892
+ updateIn: updateIn$1,
5818
5893
  };
5819
5894
 
5820
5895
  // Note: Iterable is deprecated
5821
5896
  var Iterable = Collection;
5822
5897
 
5823
- exports.default = Immutable;
5824
- exports.version = version;
5825
5898
  exports.Collection = Collection;
5826
5899
  exports.Iterable = Iterable;
5827
- exports.Seq = Seq;
5900
+ exports.List = List;
5828
5901
  exports.Map = Map;
5829
5902
  exports.OrderedMap = OrderedMap;
5830
- exports.List = List;
5831
- exports.Stack = Stack;
5832
- exports.Set = Set;
5833
5903
  exports.OrderedSet = OrderedSet;
5834
- exports.Record = Record;
5835
5904
  exports.Range = Range;
5905
+ exports.Record = Record;
5836
5906
  exports.Repeat = Repeat;
5837
- exports.is = is;
5907
+ exports.Seq = Seq;
5908
+ exports.Set = Set;
5909
+ exports.Stack = Stack;
5910
+ exports.default = Immutable;
5838
5911
  exports.fromJS = fromJS;
5912
+ exports.get = get;
5913
+ exports.getIn = getIn$1;
5914
+ exports.has = has;
5915
+ exports.hasIn = hasIn$1;
5839
5916
  exports.hash = hash;
5840
- exports.isImmutable = isImmutable;
5917
+ exports.is = is;
5918
+ exports.isAssociative = isAssociative;
5841
5919
  exports.isCollection = isCollection;
5842
- exports.isKeyed = isKeyed;
5920
+ exports.isImmutable = isImmutable;
5843
5921
  exports.isIndexed = isIndexed;
5844
- exports.isAssociative = isAssociative;
5922
+ exports.isKeyed = isKeyed;
5923
+ exports.isList = isList;
5924
+ exports.isMap = isMap;
5845
5925
  exports.isOrdered = isOrdered;
5926
+ exports.isOrderedMap = isOrderedMap;
5927
+ exports.isOrderedSet = isOrderedSet;
5928
+ exports.isPlainObject = isPlainObject;
5929
+ exports.isRecord = isRecord;
5930
+ exports.isSeq = isSeq;
5931
+ exports.isSet = isSet;
5932
+ exports.isStack = isStack;
5846
5933
  exports.isValueObject = isValueObject;
5847
- exports.get = get;
5848
- exports.getIn = getIn;
5849
- exports.has = has;
5850
- exports.hasIn = hasIn;
5851
- exports.merge = merge$1;
5852
- exports.mergeDeep = mergeDeep;
5853
- exports.mergeWith = mergeWith$1;
5854
- exports.mergeDeepWith = mergeDeepWith;
5934
+ exports.merge = merge;
5935
+ exports.mergeDeep = mergeDeep$1;
5936
+ exports.mergeDeepWith = mergeDeepWith$1;
5937
+ exports.mergeWith = mergeWith;
5855
5938
  exports.remove = remove;
5856
5939
  exports.removeIn = removeIn;
5857
5940
  exports.set = set;
5858
- exports.setIn = setIn;
5859
- exports.update = update;
5860
- exports.updateIn = updateIn;
5941
+ exports.setIn = setIn$1;
5942
+ exports.update = update$1;
5943
+ exports.updateIn = updateIn$1;
5944
+ exports.version = version;
5861
5945
 
5862
5946
  Object.defineProperty(exports, '__esModule', { value: true });
5863
5947