/** * @license * MIT License * * Copyright (c) 2014-present, Lee Byron and other contributors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ var IS_INDEXED_SYMBOL="@@__IMMUTABLE_INDEXED__@@";function isIndexed(t){return Boolean(t&&t[IS_INDEXED_SYMBOL])}var IS_KEYED_SYMBOL="@@__IMMUTABLE_KEYED__@@";function isKeyed(t){return Boolean(t&&t[IS_KEYED_SYMBOL])}function isAssociative(t){return isKeyed(t)||isIndexed(t)}var IS_COLLECTION_SYMBOL="@@__IMMUTABLE_ITERABLE__@@";function isCollection(t){return Boolean(t&&t[IS_COLLECTION_SYMBOL])}var Collection=function(t){return isCollection(t)?t:Seq(t)},KeyedCollection=function(t){function e(t){return isKeyed(t)?t:KeyedSeq(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Collection),IndexedCollection=function(t){function e(t){return isIndexed(t)?t:IndexedSeq(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Collection),SetCollection=function(t){function e(t){return isCollection(t)&&!isAssociative(t)?t:SetSeq(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Collection);Collection.Keyed=KeyedCollection,Collection.Indexed=IndexedCollection,Collection.Set=SetCollection;var ITERATE_KEYS=0,ITERATE_VALUES=1,ITERATE_ENTRIES=2,REAL_ITERATOR_SYMBOL="function"==typeof Symbol&&Symbol.iterator,FAUX_ITERATOR_SYMBOL="@@iterator",ITERATOR_SYMBOL=REAL_ITERATOR_SYMBOL||FAUX_ITERATOR_SYMBOL,Iterator=function(t){this.next=t};function iteratorValue(t,e,r,n){var o=t===ITERATE_KEYS?e:t===ITERATE_VALUES?r:[e,r];return n?n.value=o:n={value:o,done:!1},n}function iteratorDone(){return{value:void 0,done:!0}}function hasIterator(t){return!!Array.isArray(t)||!!getIteratorFn(t)}function isIterator(t){return!(!t||"function"!=typeof t.next)}function getIterator(t){var e=getIteratorFn(t);return e&&e.call(t)}function getIteratorFn(t){var e=t&&(REAL_ITERATOR_SYMBOL&&t[REAL_ITERATOR_SYMBOL]||t[FAUX_ITERATOR_SYMBOL]);if("function"==typeof e)return e}function isEntriesIterable(t){var e=getIteratorFn(t);return e&&e===t.entries}function isKeysIterable(t){var e=getIteratorFn(t);return e&&e===t.keys}Iterator.prototype.toString=function(){return"[Iterator]"},Iterator.KEYS=ITERATE_KEYS,Iterator.VALUES=ITERATE_VALUES,Iterator.ENTRIES=ITERATE_ENTRIES,Iterator.prototype.inspect=Iterator.prototype.toSource=function(){return this.toString()},Iterator.prototype[ITERATOR_SYMBOL]=function(){return this};var DELETE="delete",SHIFT=5,SIZE=1<>>0;if(""+r!==e||4294967295===r)return NaN;e=r}return e<0?ensureSize(t)+e:e}function returnTrue(){return!0}function wholeSlice(t,e,r){return(0===t&&!isNeg(t)||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&e>=r)}function resolveBegin(t,e){return resolveIndex(t,e,0)}function resolveEnd(t,e){return resolveIndex(t,e,e)}function resolveIndex(t,e,r){return void 0===t?r:isNeg(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function isNeg(t){return t<0||0===t&&1/t==-1/0}var IS_RECORD_SYMBOL="@@__IMMUTABLE_RECORD__@@";function isRecord(t){return Boolean(t&&t[IS_RECORD_SYMBOL])}function isImmutable(t){return isCollection(t)||isRecord(t)}var IS_ORDERED_SYMBOL="@@__IMMUTABLE_ORDERED__@@";function isOrdered(t){return Boolean(t&&t[IS_ORDERED_SYMBOL])}var IS_SEQ_SYMBOL="@@__IMMUTABLE_SEQ__@@";function isSeq(t){return Boolean(t&&t[IS_SEQ_SYMBOL])}var hasOwnProperty=Object.prototype.hasOwnProperty;function isArrayLike(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 Seq=function(t){function e(t){return null==t?emptySequence():isImmutable(t)?t.toSeq():seqFromValue(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,o=0;o!==n;){var i=r[e?n-++o:o++];if(!1===t(i[1],i[0],this))break}return o}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var r=this._cache;if(r){var n=r.length,o=0;return new Iterator(function(){if(o===n)return iteratorDone();var i=r[e?n-++o:o++];return iteratorValue(t,i[0],i[1])})}return this.__iteratorUncached(t,e)},e}(Collection),KeyedSeq=function(t){function e(t){return null==t?emptySequence().toKeyedSeq():isCollection(t)?isKeyed(t)?t.toSeq():t.fromEntrySeq():isRecord(t)?t.toSeq():keyedSeqFromValue(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(Seq),IndexedSeq=function(t){function e(t){return null==t?emptySequence():isCollection(t)?isKeyed(t)?t.entrySeq():t.toIndexedSeq():isRecord(t)?t.toSeq().entrySeq():indexedSeqFromValue(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}(Seq),SetSeq=function(t){function e(t){return(isCollection(t)&&!isAssociative(t)?t:IndexedSeq(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}(Seq);Seq.isSeq=isSeq,Seq.Keyed=KeyedSeq,Seq.Set=SetSeq,Seq.Indexed=IndexedSeq,Seq.prototype[IS_SEQ_SYMBOL]=!0;var ArraySeq=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[wrapIndex(this,t)]:e},e.prototype.__iterate=function(t,e){for(var r=this._array,n=r.length,o=0;o!==n;){var i=e?n-++o:o++;if(!1===t(r[i],i,this))break}return o},e.prototype.__iterator=function(t,e){var r=this._array,n=r.length,o=0;return new Iterator(function(){if(o===n)return iteratorDone();var i=e?n-++o:o++;return iteratorValue(t,i,r[i])})},e}(IndexedSeq),ObjectSeq=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 hasOwnProperty.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,o=n.length,i=0;i!==o;){var a=n[e?o-++i:i++];if(!1===t(r[a],a,this))break}return i},e.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,o=n.length,i=0;return new Iterator(function(){if(i===o)return iteratorDone();var a=n[e?o-++i:i++];return iteratorValue(t,a,r[a])})},e}(KeyedSeq);ObjectSeq.prototype[IS_ORDERED_SYMBOL]=!0;var EMPTY_SEQ,CollectionSeq=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=getIterator(this._collection),n=0;if(isIterator(r))for(var o;!(o=r.next()).done&&!1!==t(o.value,n++,this););return n},e.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=getIterator(this._collection);if(!isIterator(r))return new Iterator(iteratorDone);var n=0;return new Iterator(function(){var e=r.next();return e.done?e:iteratorValue(t,n++,e.value)})},e}(IndexedSeq);function emptySequence(){return EMPTY_SEQ||(EMPTY_SEQ=new ArraySeq([]))}function keyedSeqFromValue(t){var e=maybeIndexedSeqFromValue(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new ObjectSeq(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function indexedSeqFromValue(t){var e=maybeIndexedSeqFromValue(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function seqFromValue(t){var e=maybeIndexedSeqFromValue(t);if(e)return isEntriesIterable(t)?e.fromEntrySeq():isKeysIterable(t)?e.toSetSeq():e;if("object"==typeof t)return new ObjectSeq(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}function maybeIndexedSeqFromValue(t){return isArrayLike(t)?new ArraySeq(t):hasIterator(t)?new CollectionSeq(t):void 0}function asImmutable(){return this.__ensureOwner()}function asMutable(){return this.__ownerID?this:this.__ensureOwner(new OwnerID)}var imul="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 smi(t){return t>>>1&1073741824|3221225471&t}var defaultValueOf=Object.prototype.valueOf;function hash(t){if(null==t)return hashNullish(t);if("function"==typeof t.hashCode)return smi(t.hashCode(t));var e=valueOf(t);if(null==e)return hashNullish(e);switch(typeof e){case"boolean":return e?1108378657:1108378656;case"number":return hashNumber(e);case"string":return e.length>STRING_HASH_CACHE_MIN_STRLEN?cachedHashString(e):hashString(e);case"object":case"function":return hashJSObj(e);case"symbol":return hashSymbol(e);default:if("function"==typeof e.toString)return hashString(e.toString());throw new Error("Value type "+typeof e+" cannot be hashed.")}}function hashNullish(t){return null===t?1108378658:1108378659}function hashNumber(t){if(t!=t||t===1/0)return 0;var e=0|t;for(e!==t&&(e^=4294967295*t);t>4294967295;)e^=t/=4294967295;return smi(e)}function cachedHashString(t){var e=stringHashCache[t];return void 0===e&&(e=hashString(t),STRING_HASH_CACHE_SIZE===STRING_HASH_CACHE_MAX_SIZE&&(STRING_HASH_CACHE_SIZE=0,stringHashCache={}),STRING_HASH_CACHE_SIZE++,stringHashCache[t]=e),e}function hashString(t){for(var e=0,r=0;r0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function valueOf(t){return t.valueOf!==defaultValueOf&&"function"==typeof t.valueOf?t.valueOf(t):t}function nextHash(){var t=++_objHashUID;return 1073741824&_objHashUID&&(_objHashUID=0),t}var weakMap,usingWeakMap="function"==typeof WeakMap;usingWeakMap&&(weakMap=new WeakMap);var symbolMap=Object.create(null),_objHashUID=0,UID_HASH_KEY="__immutablehash__";"function"==typeof Symbol&&(UID_HASH_KEY=Symbol(UID_HASH_KEY));var STRING_HASH_CACHE_MIN_STRLEN=16,STRING_HASH_CACHE_MAX_SIZE=255,STRING_HASH_CACHE_SIZE=0,stringHashCache={},ToKeyedSequence=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=reverseFactory(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},e.prototype.map=function(t,e){var r=this,n=mapFactory(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}(KeyedSeq);ToKeyedSequence.prototype[IS_ORDERED_SYMBOL]=!0;var ToIndexedSequence=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&&ensureSize(this),this._iter.__iterate(function(o){return t(o,e?r.size-++n:n++,r)},e)},e.prototype.__iterator=function(t,e){var r=this,n=this._iter.__iterator(ITERATE_VALUES,e),o=0;return e&&ensureSize(this),new Iterator(function(){var i=n.next();return i.done?i:iteratorValue(t,e?r.size-++o:o++,i.value,i)})},e}(IndexedSeq),ToSetSequence=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(ITERATE_VALUES,e);return new Iterator(function(){var e=r.next();return e.done?e:iteratorValue(t,e.value,e.value,e)})},e}(SetSeq),FromEntriesSequence=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){validateEntry(e);var n=isCollection(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(ITERATE_VALUES,e);return new Iterator(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n){validateEntry(n);var o=isCollection(n);return iteratorValue(t,o?n.get(0):n[0],o?n.get(1):n[1],e)}}})},e}(KeyedSeq);function flipFactory(t){var e=makeSequence(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=cacheResultThrough,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===ITERATE_ENTRIES){var n=t.__iterator(e,r);return new Iterator(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===ITERATE_VALUES?ITERATE_KEYS:ITERATE_VALUES,r)},e}function mapFactory(t,e,r){var n=makeSequence(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,o){var i=t.get(n,NOT_SET);return i===NOT_SET?o:e.call(r,i,n,t)},n.__iterateUncached=function(n,o){var i=this;return t.__iterate(function(t,o,a){return!1!==n(e.call(r,t,o,a),o,i)},o)},n.__iteratorUncached=function(n,o){var i=t.__iterator(ITERATE_ENTRIES,o);return new Iterator(function(){var o=i.next();if(o.done)return o;var a=o.value,u=a[0];return iteratorValue(n,u,e.call(r,a[1],u,t),o)})},n}function reverseFactory(t,e){var r=this,n=makeSequence(t);return n._iter=t,n.size=t.size,n.reverse=function(){return t},t.flip&&(n.flip=function(){var e=flipFactory(t);return e.reverse=function(){return t.flip()},e}),n.get=function(r,n){return t.get(e?r:-1-r,n)},n.has=function(r){return t.has(e?r:-1-r)},n.includes=function(e){return t.includes(e)},n.cacheResult=cacheResultThrough,n.__iterate=function(r,n){var o=this,i=0;return n&&ensureSize(t),t.__iterate(function(t,a){return r(t,e?a:n?o.size-++i:i++,o)},!n)},n.__iterator=function(n,o){var i=0;o&&ensureSize(t);var a=t.__iterator(ITERATE_ENTRIES,!o);return new Iterator(function(){var t=a.next();if(t.done)return t;var u=t.value;return iteratorValue(n,e?u[0]:o?r.size-++i:i++,u[1],t)})},n}function filterFactory(t,e,r,n){var o=makeSequence(t);return n&&(o.has=function(n){var o=t.get(n,NOT_SET);return o!==NOT_SET&&!!e.call(r,o,n,t)},o.get=function(n,o){var i=t.get(n,NOT_SET);return i!==NOT_SET&&e.call(r,i,n,t)?i:o}),o.__iterateUncached=function(o,i){var a=this,u=0;return t.__iterate(function(t,i,s){if(e.call(r,t,i,s))return u++,o(t,n?i:u-1,a)},i),u},o.__iteratorUncached=function(o,i){var a=t.__iterator(ITERATE_ENTRIES,i),u=0;return new Iterator(function(){for(;;){var i=a.next();if(i.done)return i;var s=i.value,c=s[0],p=s[1];if(e.call(r,p,c,t))return iteratorValue(o,n?c:u++,p,i)}})},o}function countByFactory(t,e,r){var n=Map().asMutable();return t.__iterate(function(o,i){n.update(e.call(r,o,i,t),0,function(t){return t+1})}),n.asImmutable()}function groupByFactory(t,e,r){var n=isKeyed(t),o=(isOrdered(t)?OrderedMap():Map()).asMutable();t.__iterate(function(i,a){o.update(e.call(r,i,a,t),function(t){return(t=t||[]).push(n?[a,i]:i),t})});var i=collectionClass(t);return o.map(function(e){return reify(t,i(e))}).asImmutable()}function partitionFactory(t,e,r){var n=isKeyed(t),o=[[],[]];t.__iterate(function(i,a){o[e.call(r,i,a,t)?1:0].push(n?[a,i]:i)});var i=collectionClass(t);return o.map(function(e){return reify(t,i(e))})}function sliceFactory(t,e,r,n){var o=t.size;if(wholeSlice(e,r,o))return t;if(void 0===o&&(e<0||r<0))return sliceFactory(t.toSeq().cacheResult(),e,r,n);var i,a=resolveBegin(e,o),u=resolveEnd(r,o)-a;u==u&&(i=u<0?0:u);var s=makeSequence(t);return s.size=0===i?i:t.size&&i||void 0,!n&&isSeq(t)&&i>=0&&(s.get=function(e,r){return(e=wrapIndex(this,e))>=0&&ei)return iteratorDone();var t=o.next();return n||e===ITERATE_VALUES||t.done?t:iteratorValue(e,s-1,e===ITERATE_KEYS?void 0:t.value[1],t)})},s}function takeWhileFactory(t,e,r){var n=makeSequence(t);return n.__iterateUncached=function(n,o){var i=this;if(o)return this.cacheResult().__iterate(n,o);var a=0;return t.__iterate(function(t,o,u){return e.call(r,t,o,u)&&++a&&n(t,o,i)}),a},n.__iteratorUncached=function(n,o){var i=this;if(o)return this.cacheResult().__iterator(n,o);var a=t.__iterator(ITERATE_ENTRIES,o),u=!0;return new Iterator(function(){if(!u)return iteratorDone();var t=a.next();if(t.done)return t;var o=t.value,s=o[0],c=o[1];return e.call(r,c,s,i)?n===ITERATE_ENTRIES?t:iteratorValue(n,s,c,t):(u=!1,iteratorDone())})},n}function skipWhileFactory(t,e,r,n){var o=makeSequence(t);return o.__iterateUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterate(o,i);var u=!0,s=0;return t.__iterate(function(t,i,c){if(!u||!(u=e.call(r,t,i,c)))return s++,o(t,n?i:s-1,a)}),s},o.__iteratorUncached=function(o,i){var a=this;if(i)return this.cacheResult().__iterator(o,i);var u=t.__iterator(ITERATE_ENTRIES,i),s=!0,c=0;return new Iterator(function(){var t,i,p;do{if((t=u.next()).done)return n||o===ITERATE_VALUES?t:iteratorValue(o,c++,o===ITERATE_KEYS?void 0:t.value[1],t);var h=t.value;i=h[0],p=h[1],s&&(s=e.call(r,p,i,a))}while(s);return o===ITERATE_ENTRIES?t:iteratorValue(o,i,p,t)})},o}ToIndexedSequence.prototype.cacheResult=ToKeyedSequence.prototype.cacheResult=ToSetSequence.prototype.cacheResult=FromEntriesSequence.prototype.cacheResult=cacheResultThrough;var ConcatSeq=function(t){function e(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[IS_KEYED_SYMBOL]=this._wrappedIterables[0][IS_KEYED_SYMBOL],this[IS_INDEXED_SYMBOL]=this._wrappedIterables[0][IS_INDEXED_SYMBOL],this[IS_ORDERED_SYMBOL]=this._wrappedIterables[0][IS_ORDERED_SYMBOL]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,e){if(0!==this._wrappedIterables.length){if(e)return this.cacheResult().__iterate(t,e);for(var r=0,n=isKeyed(this),o=n?ITERATE_ENTRIES:ITERATE_VALUES,i=this._wrappedIterables[r].__iterator(o,e),a=!0,u=0;a;){for(var s=i.next();s.done;){if(++r===this._wrappedIterables.length)return u;s=(i=this._wrappedIterables[r].__iterator(o,e)).next()}a=!1!==(n?t(s.value[1],s.value[0],this):t(s.value,u,this)),u++}return u}},e.prototype.__iteratorUncached=function(t,e){var r=this;if(0===this._wrappedIterables.length)return new Iterator(iteratorDone);if(e)return this.cacheResult().__iterator(t,e);var n=0,o=this._wrappedIterables[n].__iterator(t,e);return new Iterator(function(){for(var i=o.next();i.done;){if(++n===r._wrappedIterables.length)return i;i=(o=r._wrappedIterables[n].__iterator(t,e)).next()}return i})},e}(Seq);function concatFactory(t,e){var r=isKeyed(t),n=[t].concat(e).map(function(t){return isCollection(t)?r&&(t=KeyedCollection(t)):t=r?keyedSeqFromValue(t):indexedSeqFromValue(Array.isArray(t)?t:[t]),t}).filter(function(t){return 0!==t.size});if(0===n.length)return t;if(1===n.length){var o=n[0];if(o===t||r&&isKeyed(o)||isIndexed(t)&&isIndexed(o))return o}return new ConcatSeq(n)}function flattenFactory(t,e,r){var n=makeSequence(t);return n.__iterateUncached=function(o,i){if(i)return this.cacheResult().__iterate(o,i);var a=0,u=!1;return function t(s,c){s.__iterate(function(i,s){return(!e||c0}function zipWithFactory(t,e,r,n){var o=makeSequence(t),i=new ArraySeq(r).map(function(t){return t.size});return o.size=n?i.max():i.min(),o.__iterate=function(t,e){for(var r,n=this.__iterator(ITERATE_VALUES,e),o=0;!(r=n.next()).done&&!1!==t(r.value,o++,this););return o},o.__iteratorUncached=function(t,o){var i=r.map(function(t){return t=Collection(t),getIterator(o?t.reverse():t)}),a=0,u=!1;return new Iterator(function(){var r;return u||(r=i.map(function(t){return t.next()}),u=n?r.every(function(t){return t.done}):r.some(function(t){return t.done})),u?iteratorDone():iteratorValue(t,a++,e.apply(null,r.map(function(t){return t.value})))})},o}function reify(t,e){return t===e?t:isSeq(t)?e:t.constructor(e)}function validateEntry(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function collectionClass(t){return isKeyed(t)?KeyedCollection:isIndexed(t)?IndexedCollection:SetCollection}function makeSequence(t){return Object.create((isKeyed(t)?KeyedSeq:isIndexed(t)?IndexedSeq:SetSeq).prototype)}function cacheResultThrough(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Seq.prototype.cacheResult.call(this)}function defaultComparator(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:t>e?1:t0;)e[r]=arguments[r+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return mergeIntoKeyedWith(this,e,t)}function mergeIntoKeyedWith(t,e,r){for(var n=[],o=0;o0;)e[r]=arguments[r+1];return mergeWithSources(t,e)}function mergeWith(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return mergeWithSources(e,r,t)}function mergeDeep$1(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return mergeDeepWithSources(t,e)}function mergeDeepWith$1(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return mergeDeepWithSources(e,r,t)}function mergeDeepWithSources(t,e,r){return mergeWithSources(t,e,deepMergerWith(r))}function mergeWithSources(t,e,r){if(!isDataStructure(t))throw new TypeError("Cannot merge into non-data-structure value: "+t);if(isImmutable(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),o=t,i=n?IndexedCollection:KeyedCollection,a=n?function(e){o===t&&(o=shallowCopy(o)),o.push(e)}:function(e,n){var i=hasOwnProperty.call(o,n),a=i&&r?r(o[n],e,n):e;i&&a===o[n]||(o===t&&(o=shallowCopy(o)),o[n]=a)},u=0;u0;)e[r]=arguments[r+1];return mergeDeepWithSources(this,e,t)}function mergeDeepIn(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return updateIn(this,t,emptyMap(),function(t){return mergeDeepWithSources(t,e)})}function mergeIn(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return updateIn(this,t,emptyMap(),function(t){return mergeWithSources(t,e)})}function setIn$1(t,e,r){return updateIn(t,e,NOT_SET,function(){return r})}function setIn(t,e){return setIn$1(this,t,e)}function update(t,e,r){return 1===arguments.length?t(this):update$1(this,t,e,r)}function updateIn$1(t,e,r){return updateIn(this,t,e,r)}function wasAltered(){return this.__altered}function withMutations(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}var IS_MAP_SYMBOL="@@__IMMUTABLE_MAP__@@";function isMap(t){return Boolean(t&&t[IS_MAP_SYMBOL])}function invariant(t,e){if(!t)throw new Error(e)}function assertNotInfinite(t){invariant(t!==1/0,"Cannot perform this action with an infinite size.")}var Map=function(t){function e(e){return null==e?emptyMap():isMap(e)&&!isOrdered(e)?e:emptyMap().withMutations(function(r){var n=t(e);assertNotInfinite(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 updateMap(this,t,e)},e.prototype.remove=function(t){return updateMap(this,t,NOT_SET)},e.prototype.deleteAll=function(t){var e=Collection(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):emptyMap()},e.prototype.sort=function(t){return OrderedMap(sortFactory(this,t))},e.prototype.sortBy=function(t,e){return OrderedMap(sortFactory(this,e,t))},e.prototype.map=function(t,e){var r=this;return this.withMutations(function(n){n.forEach(function(o,i){n.set(i,t.call(e,o,i,r))})})},e.prototype.__iterator=function(t,e){return new MapIterator(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?makeMap(this.size,this._root,t,this.__hash):0===this.size?emptyMap():(this.__ownerID=t,this.__altered=!1,this)},e}(KeyedCollection);Map.isMap=isMap;var MapPrototype=Map.prototype;MapPrototype[IS_MAP_SYMBOL]=!0,MapPrototype[DELETE]=MapPrototype.remove,MapPrototype.removeAll=MapPrototype.deleteAll,MapPrototype.setIn=setIn,MapPrototype.removeIn=MapPrototype.deleteIn=deleteIn,MapPrototype.update=update,MapPrototype.updateIn=updateIn$1,MapPrototype.merge=MapPrototype.concat=merge$1,MapPrototype.mergeWith=mergeWith$1,MapPrototype.mergeDeep=mergeDeep,MapPrototype.mergeDeepWith=mergeDeepWith,MapPrototype.mergeIn=mergeIn,MapPrototype.mergeDeepIn=mergeDeepIn,MapPrototype.withMutations=withMutations,MapPrototype.wasAltered=wasAltered,MapPrototype.asImmutable=asImmutable,MapPrototype["@@transducer/init"]=MapPrototype.asMutable=asMutable,MapPrototype["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},MapPrototype["@@transducer/result"]=function(t){return t.asImmutable()};var ArrayMapNode=function(t,e){this.ownerID=t,this.entries=e};ArrayMapNode.prototype.get=function(t,e,r,n){for(var o=this.entries,i=0,a=o.length;i=MAX_ARRAY_MAP_SIZE)return createNodes(t,s,n,o);var f=t&&t===this.ownerID,_=f?s:arrCopy(s);return h?u?c===p-1?_.pop():_[c]=_.pop():_[c]=[n,o]:_.push([n,o]),f?(this.entries=_,this):new ArrayMapNode(t,_)}};var BitmapIndexedNode=function(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r};BitmapIndexedNode.prototype.get=function(t,e,r,n){void 0===e&&(e=hash(r));var o=1<<((0===t?e:e>>>t)&MASK),i=this.bitmap;return 0===(i&o)?n:this.nodes[popCount(i&o-1)].get(t+SHIFT,e,r,n)},BitmapIndexedNode.prototype.update=function(t,e,r,n,o,i,a){void 0===r&&(r=hash(n));var u=(0===e?r:r>>>e)&MASK,s=1<=MAX_BITMAP_INDEXED_SIZE)return expandNodes(t,f,c,u,l);if(p&&!l&&2===f.length&&isLeafNode(f[1^h]))return f[1^h];if(p&&l&&1===f.length&&isLeafNode(l))return l;var d=t&&t===this.ownerID,y=p?l?c:c^s:c|s,S=p?l?setAt(f,h,l,d):spliceOut(f,h,d):spliceIn(f,h,l,d);return d?(this.bitmap=y,this.nodes=S,this):new BitmapIndexedNode(t,y,S)};var HashArrayMapNode=function(t,e,r){this.ownerID=t,this.count=e,this.nodes=r};HashArrayMapNode.prototype.get=function(t,e,r,n){void 0===e&&(e=hash(r));var o=(0===t?e:e>>>t)&MASK,i=this.nodes[o];return i?i.get(t+SHIFT,e,r,n):n},HashArrayMapNode.prototype.update=function(t,e,r,n,o,i,a){void 0===r&&(r=hash(n));var u=(0===e?r:r>>>e)&MASK,s=o===NOT_SET,c=this.nodes,p=c[u];if(s&&!p)return this;var h=updateNode(p,t,e+SHIFT,r,n,o,i,a);if(h===p)return this;var f=this.count;if(p){if(!h&&--f>>r)&MASK,u=(0===r?n:n>>>r)&MASK,s=a===u?[mergeIntoNode(t,e,r+SHIFT,n,o)]:(i=new ValueNode(e,n,o),a>>=1)a[u]=1&r?e[i++]:void 0;return a[n]=o,new HashArrayMapNode(t,i+1,a)}function popCount(t){return t=(t=(858993459&(t-=t>>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function setAt(t,e,r,n){var o=n?t:arrCopy(t);return o[e]=r,o}function spliceIn(t,e,r,n){var o=t.length+1;if(n&&e+1===o)return t[e]=r,t;for(var i=new Array(o),a=0,u=0;u0&&o=0&&t>>e&MASK;if(n>=this.array.length)return new VNode([],t);var o,i=0===n;if(e>0){var a=this.array[n];if((o=a&&a.removeBefore(t,e-SHIFT,r))===a&&i)return this}if(i&&!o)return this;var u=editableVNode(this,t);if(!i)for(var s=0;s>>e&MASK;if(o>=this.array.length)return this;if(e>0){var i=this.array[o];if((n=i&&i.removeAfter(t,e-SHIFT,r))===i&&o===this.array.length-1)return this}var a=editableVNode(this,t);return a.array.splice(o+1),n&&(a.array[o]=n),a};var DONE={};function iterateList(t,e){var r=t._origin,n=t._capacity,o=getTailOffset(n),i=t._tail;return a(t._root,t._level,0);function a(t,u,s){return 0===u?function(t,a){var u=a===o?i&&i.array:t&&t.array,s=a>r?0:r-a,c=n-a;c>SIZE&&(c=SIZE);return function(){if(s===c)return DONE;var t=e?--c:s++;return u&&u[t]}}(t,s):function(t,o,i){var u,s=t&&t.array,c=i>r?0:r-i>>o,p=1+(n-i>>o);p>SIZE&&(p=SIZE);return function(){for(;;){if(u){var t=u();if(t!==DONE)return t;u=null}if(c===p)return DONE;var r=e?--p:c++;u=a(s&&s[r],o-SHIFT,i+(r<=t.size||e<0)return t.withMutations(function(t){e<0?setListBounds(t,e).set(0,r):setListBounds(t,0,e+1).set(e,r)});e+=t._origin;var n=t._tail,o=t._root,i=MakeRef();return e>=getTailOffset(t._capacity)?n=updateVNode(n,t.__ownerID,0,e,r,i):o=updateVNode(o,t.__ownerID,t._level,e,r,i),i.value?t.__ownerID?(t._root=o,t._tail=n,t.__hash=void 0,t.__altered=!0,t):makeList(t._origin,t._capacity,t._level,o,n):t}function updateVNode(t,e,r,n,o,i){var a,u=n>>>r&MASK,s=t&&u0){var c=t&&t.array[u],p=updateVNode(c,e,r-SHIFT,n,o,i);return p===c?t:((a=editableVNode(t,e)).array[u]=p,a)}return s&&t.array[u]===o?t:(i&&SetRef(i),a=editableVNode(t,e),void 0===o&&u===a.array.length-1?a.array.pop():a.array[u]=o,a)}function editableVNode(t,e){return e&&t&&e===t.ownerID?t:new VNode(t?t.array.slice():[],e)}function listNodeFor(t,e){if(e>=getTailOffset(t._capacity))return t._tail;if(e<1<0;)r=r.array[e>>>n&MASK],n-=SHIFT;return r}}function setListBounds(t,e,r){void 0!==e&&(e|=0),void 0!==r&&(r|=0);var n=t.__ownerID||new OwnerID,o=t._origin,i=t._capacity,a=o+e,u=void 0===r?i:r<0?i+r:o+r;if(a===o&&u===i)return t;if(a>=u)return t.clear();for(var s=t._level,c=t._root,p=0;a+p<0;)c=new VNode(c&&c.array.length?[void 0,c]:[],n),p+=1<<(s+=SHIFT);p&&(a+=p,o+=p,u+=p,i+=p);for(var h=getTailOffset(i),f=getTailOffset(u);f>=1<h?new VNode([],n):_;if(_&&f>h&&aSHIFT;y-=SHIFT){var S=h>>>y&MASK;d=d.array[S]=editableVNode(d.array[S],n)}d.array[h>>>SHIFT&MASK]=_}if(u=f)a-=f,u-=f,s=SHIFT,c=null,l=l&&l.removeBefore(n,0,a);else if(a>o||f>>s&MASK;if(v!==f>>>s&MASK)break;v&&(p+=(1<o&&(c=c.removeBefore(n,s,a-p)),c&&f>>SHIFT<=SIZE&&a.size>=2*i.size?(n=(o=a.filter(function(t,e){return void 0!==t&&u!==e})).toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=o.__ownerID=t.__ownerID)):(n=i.remove(e),o=u===a.size-1?a.pop():a.set(u,void 0))}else if(s){if(r===a.get(u)[1])return t;n=i,o=a.set(u,[e,r])}else n=i.set(e,a.size),o=a.set(a.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=o,t.__hash=void 0,t.__altered=!0,t):makeOrderedMap(n,o)}OrderedMap.isOrderedMap=isOrderedMap,OrderedMap.prototype[IS_ORDERED_SYMBOL]=!0,OrderedMap.prototype[DELETE]=OrderedMap.prototype.remove;var IS_STACK_SYMBOL="@@__IMMUTABLE_STACK__@@";function isStack(t){return Boolean(t&&t[IS_STACK_SYMBOL])}var Stack=function(t){function e(t){return null==t?emptyStack():isStack(t)?t:emptyStack().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=wrapIndex(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):makeStack(e,r)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&isStack(e))return e;assertNotInfinite(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):makeStack(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):emptyStack()},e.prototype.slice=function(e,r){if(wholeSlice(e,r,this.size))return this;var n=resolveBegin(e,this.size);if(resolveEnd(r,this.size)!==this.size)return t.prototype.slice.call(this,e,r);for(var o=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=o,this._head=i,this.__hash=void 0,this.__altered=!0,this):makeStack(o,i)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?makeStack(this.size,this._head,t,this.__hash):0===this.size?emptyStack():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var r=this;if(e)return new ArraySeq(this.toArray()).__iterate(function(e,n){return t(e,n,r)},e);for(var n=0,o=this._head;o&&!1!==t(o.value,n++,this);)o=o.next;return n},e.prototype.__iterator=function(t,e){if(e)return new ArraySeq(this.toArray()).__iterator(t,e);var r=0,n=this._head;return new Iterator(function(){if(n){var e=n.value;return n=n.next,iteratorValue(t,r++,e)}return iteratorDone()})},e}(IndexedCollection);Stack.isStack=isStack;var EMPTY_STACK,StackPrototype=Stack.prototype;function makeStack(t,e,r,n){var o=Object.create(StackPrototype);return o.size=t,o._head=e,o.__ownerID=r,o.__hash=n,o.__altered=!1,o}function emptyStack(){return EMPTY_STACK||(EMPTY_STACK=makeStack(0))}function reduce(t,e,r,n,o,i){return assertNotInfinite(t.size),t.__iterate(function(t,i,a){o?(o=!1,r=t):r=e.call(n,r,t,i,a)},i),r}function keyMapper(t,e){return e}function entryMapper(t,e){return[e,t]}function not(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return!t.apply(this,e)}}function neg(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return-t.apply(this,e)}}function defaultNegComparator(t,e){return te?-1:0}function deepEqual(t,e){if(t===e)return!0;if(!isCollection(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||isKeyed(t)!==isKeyed(e)||isIndexed(t)!==isIndexed(e)||isOrdered(t)!==isOrdered(e))return!1;if(0===t.size&&0===e.size)return!0;var r=!isAssociative(t);if(isOrdered(t)){var n=t.entries();return e.every(function(t,e){var o=n.next().value;return o&&is(o[1],t)&&(r||is(o[0],e))})&&n.next().done}var o=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{o=!0;var i=t;t=e,e=i}var a=!0,u=e.__iterate(function(e,n){if(r?!t.has(e):o?!is(e,t.get(n,NOT_SET)):!is(t.get(n,NOT_SET),e))return a=!1,!1});return a&&t.size===u}StackPrototype[IS_STACK_SYMBOL]=!0,StackPrototype.shift=StackPrototype.pop,StackPrototype.unshift=StackPrototype.push,StackPrototype.unshiftAll=StackPrototype.pushAll,StackPrototype.withMutations=withMutations,StackPrototype.wasAltered=wasAltered,StackPrototype.asImmutable=asImmutable,StackPrototype["@@transducer/init"]=StackPrototype.asMutable=asMutable,StackPrototype["@@transducer/step"]=function(t,e){return t.unshift(e)},StackPrototype["@@transducer/result"]=function(t){return t.asImmutable()};var EMPTY_RANGE,Range=function(t){function e(t,r,n){if(void 0===n&&(n=1),!(this instanceof e))return new e(t,r,n);if(invariant(0!==n,"Cannot step a Range by 0"),invariant(void 0!==t,"You must define a start value when using Range"),invariant(void 0!==r,"You must define an end value when using Range"),n=Math.abs(n),r=0&&e=0&&r>>-15,461845907),e=imul(e<<13|e>>>-13,5),e=imul((e=(e+3864292196|0)^t)^e>>>16,2246822507),e=smi((e=imul(e^e>>>13,3266489909))^e>>>16)}function hashMerge(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}function mixin(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}SetPrototype[IS_SET_SYMBOL]=!0,SetPrototype[DELETE]=SetPrototype.remove,SetPrototype.merge=SetPrototype.concat=SetPrototype.union,SetPrototype.withMutations=withMutations,SetPrototype.asImmutable=asImmutable,SetPrototype["@@transducer/init"]=SetPrototype.asMutable=asMutable,SetPrototype["@@transducer/step"]=function(t,e){return t.add(e)},SetPrototype["@@transducer/result"]=function(t){return t.asImmutable()},SetPrototype.__empty=emptySet,SetPrototype.__make=makeSet,Collection.Iterator=Iterator,mixin(Collection,{toArray:function(){assertNotInfinite(this.size);var t=new Array(this.size||0),e=isKeyed(this),r=0;return this.__iterate(function(n,o){t[r++]=e?[o,n]:n}),t},toIndexedSeq:function(){return new ToIndexedSequence(this)},toJS:function(){return toJS(this)},toKeyedSeq:function(){return new ToKeyedSequence(this,!0)},toMap:function(){return Map(this.toKeyedSeq())},toObject:toObject,toOrderedMap:function(){return OrderedMap(this.toKeyedSeq())},toOrderedSet:function(){return OrderedSet(isKeyed(this)?this.valueSeq():this)},toSet:function(){return Set(isKeyed(this)?this.valueSeq():this)},toSetSeq:function(){return new ToSetSequence(this)},toSeq:function(){return isIndexed(this)?this.toIndexedSeq():isKeyed(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Stack(isKeyed(this)?this.valueSeq():this)},toList:function(){return List(isKeyed(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 reify(this,concatFactory(this,t))},includes:function(t){return this.some(function(e){return is(e,t)})},entries:function(){return this.__iterator(ITERATE_ENTRIES)},every:function(t,e){assertNotInfinite(this.size);var r=!0;return this.__iterate(function(n,o,i){if(!t.call(e,n,o,i))return r=!1,!1}),r},filter:function(t,e){return reify(this,filterFactory(this,t,e,!0))},partition:function(t,e){return partitionFactory(this,t,e)},find:function(t,e,r){var n=this.findEntry(t,e);return n?n[1]:r},forEach:function(t,e){return assertNotInfinite(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){assertNotInfinite(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(ITERATE_KEYS)},map:function(t,e){return reify(this,mapFactory(this,t,e))},reduce:function(t,e,r){return reduce(this,t,e,r,arguments.length<2,!1)},reduceRight:function(t,e,r){return reduce(this,t,e,r,arguments.length<2,!0)},reverse:function(){return reify(this,reverseFactory(this,!0))},slice:function(t,e){return reify(this,sliceFactory(this,t,e,!0))},some:function(t,e){assertNotInfinite(this.size);var r=!1;return this.__iterate(function(n,o,i){if(t.call(e,n,o,i))return r=!0,!1}),r},sort:function(t){return reify(this,sortFactory(this,t))},values:function(){return this.__iterator(ITERATE_VALUES)},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 ensureSize(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return countByFactory(this,t,e)},equals:function(t){return deepEqual(this,t)},entrySeq:function(){var t=this;if(t._cache)return new ArraySeq(t._cache);var e=t.toSeq().map(entryMapper).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(not(t),e)},findEntry:function(t,e,r){var n=r;return this.__iterate(function(r,o,i){if(t.call(e,r,o,i))return n=[o,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(returnTrue,null,t)},flatMap:function(t,e){return reify(this,flatMapFactory(this,t,e))},flatten:function(t){return reify(this,flattenFactory(this,t,!0))},fromEntrySeq:function(){return new FromEntriesSequence(this)},get:function(t,e){return this.find(function(e,r){return is(r,t)},void 0,e)},getIn:getIn,groupBy:function(t,e){return groupByFactory(this,t,e)},has:function(t){return this.get(t,NOT_SET)!==NOT_SET},hasIn:hasIn,isSubset:function(t){return t="function"==typeof t.includes?t:Collection(t),this.every(function(e){return t.includes(e)})},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:Collection(t)).isSubset(this)},keyOf:function(t){return this.findKey(function(e){return is(e,t)})},keySeq:function(){return this.toSeq().map(keyMapper).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return maxFactory(this,t)},maxBy:function(t,e){return maxFactory(this,e,t)},min:function(t){return maxFactory(this,t?neg(t):defaultNegComparator)},minBy:function(t,e){return maxFactory(this,e?neg(e):defaultNegComparator,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 reify(this,skipWhileFactory(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(not(t),e)},sortBy:function(t,e){return reify(this,sortFactory(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 reify(this,takeWhileFactory(this,t,e))},takeUntil:function(t,e){return this.takeWhile(not(t),e)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=hashCollection(this))}});var CollectionPrototype=Collection.prototype;CollectionPrototype[IS_COLLECTION_SYMBOL]=!0,CollectionPrototype[ITERATOR_SYMBOL]=CollectionPrototype.values,CollectionPrototype.toJSON=CollectionPrototype.toArray,CollectionPrototype.__toStringMapper=quoteString,CollectionPrototype.inspect=CollectionPrototype.toSource=function(){return this.toString()},CollectionPrototype.chain=CollectionPrototype.flatMap,CollectionPrototype.contains=CollectionPrototype.includes,mixin(KeyedCollection,{flip:function(){return reify(this,flipFactory(this))},mapEntries:function(t,e){var r=this,n=0;return reify(this,this.toSeq().map(function(o,i){return t.call(e,[i,o],n++,r)}).fromEntrySeq())},mapKeys:function(t,e){var r=this;return reify(this,this.toSeq().flip().map(function(n,o){return t.call(e,n,o,r)}).flip())}});var KeyedCollectionPrototype=KeyedCollection.prototype;KeyedCollectionPrototype[IS_KEYED_SYMBOL]=!0,KeyedCollectionPrototype[ITERATOR_SYMBOL]=CollectionPrototype.entries,KeyedCollectionPrototype.toJSON=toObject,KeyedCollectionPrototype.__toStringMapper=function(t,e){return quoteString(e)+": "+quoteString(t)},mixin(IndexedCollection,{toKeyedSeq:function(){return new ToKeyedSequence(this,!1)},filter:function(t,e){return reify(this,filterFactory(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 reify(this,reverseFactory(this,!1))},slice:function(t,e){return reify(this,sliceFactory(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=resolveBegin(t,t<0?this.count():this.size);var n=this.slice(0,t);return reify(this,1===r?n:n.concat(arrCopy(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 reify(this,flattenFactory(this,t,!1))},get:function(t,e){return(t=wrapIndex(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=wrapIndex(this,t))>=0&&(void 0!==this.size?this.size===1/0||t2?[]:void 0,{"":t})}function fromJSWith(t,e,r,n,o,i){if("string"!=typeof r&&!isImmutable(r)&&(isArrayLike(r)||hasIterator(r)||isPlainObject(r))){if(~t.indexOf(r))throw new TypeError("Cannot convert circular structure to Immutable");t.push(r),o&&""!==n&&o.push(n);var a=e.call(i,n,Seq(r).map(function(n,i){return fromJSWith(t,e,n,i,o,r)}),o&&o.slice());return t.pop(),o&&o.pop(),a}return r}function defaultConverter(t,e){return isIndexed(e)?e.toList():isKeyed(e)?e.toMap():e.toSet()}var version="5.1.4",Iterable=Collection;export{Collection,Iterable,List,Map,OrderedMap,OrderedSet,PairSorting,Range,Record,Repeat,Seq,Set,Stack,fromJS,get,getIn$1 as getIn,has,hasIn$1 as hasIn,hash,is,isAssociative,isCollection,isImmutable,isIndexed,isKeyed,isList,isMap,isOrdered,isOrderedMap,isOrderedSet,isPlainObject,isRecord,isSeq,isSet,isStack,isValueObject,merge,mergeDeep$1 as mergeDeep,mergeDeepWith$1 as mergeDeepWith,mergeWith,remove,removeIn,set,setIn$1 as setIn,update$1 as update,updateIn,version};