/** * @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. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Immutable={})}(this,(function(t){"use strict";var e="@@__IMMUTABLE_INDEXED__@@";function r(t){return Boolean(t&&t[e])}var n="@@__IMMUTABLE_KEYED__@@";function i(t){return Boolean(t&&t[n])}function o(t){return i(t)||r(t)}var u="@@__IMMUTABLE_ITERABLE__@@";function s(t){return Boolean(t&&t[u])}var a=function(t){return s(t)?t:X(t)},c=function(t){function e(t){return i(t)?t:F(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(a),f=function(t){function e(t){return r(t)?t:G(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(a),h=function(t){function e(t){return s(t)&&!o(t)?t:Z(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(a);a.Keyed=c,a.Indexed=f,a.Set=h;var p=0,_=1,l=2,v="function"==typeof Symbol&&Symbol.iterator,y="@@iterator",d=v||y,g=function(t){this.next=t};function w(t,e,r,n){var i=t===p?e:t===_?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function m(){return{value:void 0,done:!0}}function b(t){return!!Array.isArray(t)||!!I(t)}function z(t){return!(!t||"function"!=typeof t.next)}function S(t){var e=I(t);return e&&e.call(t)}function I(t){var e=t&&(v&&t[v]||t[y]);if("function"==typeof e)return e}g.prototype.toString=function(){return"[Iterator]"},g.KEYS=p,g.VALUES=_,g.ENTRIES=l,g.prototype.inspect=g.prototype.toSource=function(){return this.toString()},g.prototype[d]=function(){return this};var O="delete",E=5,j=1<>>0;if(""+r!==e||4294967295===r)return NaN;e=r}return e<0?A(t)+e:e}function R(){return!0}function U(t,e,r){return(0===t&&!L(t)||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&e>=r)}function T(t,e){return K(t,e,0)}function B(t,e){return K(t,e,e)}function K(t,e,r){return void 0===t?r:L(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function L(t){return t<0||0===t&&1/t==-1/0}var C="@@__IMMUTABLE_RECORD__@@";function P(t){return Boolean(t&&t[C])}function W(t){return s(t)||P(t)}var N="@@__IMMUTABLE_ORDERED__@@";function H(t){return Boolean(t&&t[N])}var J="@@__IMMUTABLE_SEQ__@@";function V(t){return Boolean(t&&t[J])}var Y=Object.prototype.hasOwnProperty;function Q(t){return!(!Array.isArray(t)&&"string"!=typeof t)||t&&"object"==typeof t&&Number.isInteger(t.length)&&t.length>=0&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var X=function(t){function e(t){return null==t?nt():W(t)?t.toSeq():function(t){var e=ut(t);if(e)return(n=I(r=t))&&n===r.entries?e.fromEntrySeq():function(t){var e=I(t);return e&&e===t.keys}(t)?e.toSetSeq():e;var r,n;if("object"==typeof t)return new tt(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var r=this._cache;if(r){for(var n=r.length,i=0;i!==n;){var o=r[e?n-++i:i++];if(!1===t(o[1],o[0],this))break}return i}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var r=this._cache;if(r){var n=r.length,i=0;return new g((function(){if(i===n)return{value:void 0,done:!0};var o=r[e?n-++i:i++];return w(t,o[0],o[1])}))}return this.__iteratorUncached(t,e)},e}(a),F=function(t){function e(t){return null==t?nt().toKeyedSeq():s(t)?i(t)?t.toSeq():t.fromEntrySeq():P(t)?t.toSeq():it(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=function(){return this},e}(X),G=function(t){function e(t){return null==t?nt():s(t)?i(t)?t.entrySeq():t.toIndexedSeq():P(t)?t.toSeq().entrySeq():ot(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toIndexedSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq [","]")},e}(X),Z=function(t){function e(t){return(s(t)&&!o(t)?t:G(t)).toSetSeq()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return e(arguments)},e.prototype.toSetSeq=function(){return this},e}(X);X.isSeq=V,X.Keyed=F,X.Set=Z,X.Indexed=G,X.prototype[J]=!0;var $=function(t){function e(t){this._array=t,this.size=t.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return this.has(t)?this._array[k(this,t)]:e},e.prototype.__iterate=function(t,e){for(var r=this._array,n=r.length,i=0;i!==n;){var o=e?n-++i:i++;if(!1===t(r[o],o,this))break}return i},e.prototype.__iterator=function(t,e){var r=this._array,n=r.length,i=0;return new g((function(){if(i===n)return{value:void 0,done:!0};var o=e?n-++i:i++;return w(t,o,r[o])}))},e}(G),tt=function(t){function e(t){var e=Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t):[]);this._object=t,this._keys=e,this.size=e.length}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t,e){return void 0===e||this.has(t)?this._object[t]:e},e.prototype.has=function(t){return Y.call(this._object,t)},e.prototype.__iterate=function(t,e){for(var r=this._object,n=this._keys,i=n.length,o=0;o!==i;){var u=n[e?i-++o:o++];if(!1===t(r[u],u,this))break}return o},e.prototype.__iterator=function(t,e){var r=this._object,n=this._keys,i=n.length,o=0;return new g((function(){if(o===i)return{value:void 0,done:!0};var u=n[e?i-++o:o++];return w(t,u,r[u])}))},e}(F);tt.prototype[N]=!0;var et,rt=function(t){function e(t){this._collection=t,this.size=t.length||t.size}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.__iterateUncached=function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=S(this._collection),n=0;if(z(r))for(var i;!(i=r.next()).done&&!1!==t(i.value,n++,this););return n},e.prototype.__iteratorUncached=function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=S(this._collection);if(!z(r))return new g(m);var n=0;return new g((function(){var e=r.next();return e.done?e:w(t,n++,e.value)}))},e}(G);function nt(){return et||(et=new $([]))}function it(t){var e=ut(t);if(e)return e.fromEntrySeq();if("object"==typeof t)return new tt(t);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+t)}function ot(t){var e=ut(t);if(e)return e;throw new TypeError("Expected Array or collection object of values: "+t)}function ut(t){return Q(t)?new $(t):b(t)?new rt(t):void 0}function st(){return this.__ensureOwner()}function at(){return this.__ownerID?this:this.__ensureOwner(new x)}var ct="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(t,e){var r=65535&(t|=0),n=65535&(e|=0);return r*n+((t>>>16)*n+r*(e>>>16)<<16>>>0)|0};function ft(t){return t>>>1&1073741824|3221225471&t}var ht=Object.prototype.valueOf;function pt(t){if(null==t)return _t(t);if("function"==typeof t.hashCode)return ft(t.hashCode(t));var e,r=(e=t).valueOf!==ht&&"function"==typeof e.valueOf?e.valueOf(e):e;if(null==r)return _t(r);switch(typeof r){case"boolean":return r?1108378657:1108378656;case"number":return function(t){if(t!=t||t===1/0)return 0;var e=0|t;e!==t&&(e^=4294967295*t);for(;t>4294967295;)e^=t/=4294967295;return ft(e)}(r);case"string":return r.length>St?function(t){var e=Et[t];void 0===e&&(e=lt(t),Ot===It&&(Ot=0,Et={}),Ot++,Et[t]=e);return e}(r):lt(r);case"object":case"function":return function(t){var e;if(wt&&void 0!==(e=gt.get(t)))return e;if(e=t[zt],void 0!==e)return e;if(!yt){if(void 0!==(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[zt]))return e;if(void 0!==(e=function(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}(t)))return e}if(e=dt(),wt)gt.set(t,e);else{if(void 0!==vt&&!1===vt(t))throw new Error("Non-extensible objects are not allowed as keys.");if(yt)Object.defineProperty(t,zt,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(void 0!==t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)},t.propertyIsEnumerable[zt]=e;else{if(void 0===t.nodeType)throw new Error("Unable to set a non-enumerable property on object.");t[zt]=e}}return e}(r);case"symbol":return function(t){var e=mt[t];if(void 0!==e)return e;return e=dt(),mt[t]=e,e}(r);default:if("function"==typeof r.toString)return lt(r.toString());throw new Error("Value type "+typeof r+" cannot be hashed.")}}function _t(t){return null===t?1108378658:1108378659}function lt(t){for(var e=0,r=0;r=0&&(a.get=function(e,r){return(e=k(this,e))>=0&&eo)return{value:void 0,done:!0};var t=i.next();return n||e===_||t.done?t:w(e,a-1,e===p?void 0:t.value[1],t)}))},a}function Tt(t,e,r,n){var i=Vt(t);return i.__iterateUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,a=0;return t.__iterate((function(t,o,c){if(!s||!(s=e.call(r,t,o,c)))return a++,i(t,n?o:a-1,u)})),a},i.__iteratorUncached=function(i,o){var u=this;if(o)return this.cacheResult().__iterator(i,o);var s=t.__iterator(l,o),a=!0,c=0;return new g((function(){var t,o,f;do{if((t=s.next()).done)return n||i===_?t:w(i,c++,i===p?void 0:t.value[1],t);var h=t.value;o=h[0],f=h[1],a&&(a=e.call(r,f,o,u))}while(a);return i===l?t:w(i,o,f,t)}))},i}qt.prototype.cacheResult=jt.prototype.cacheResult=Mt.prototype.cacheResult=Dt.prototype.cacheResult=Yt;var Bt=function(t){function r(t){this._wrappedIterables=t.flatMap((function(t){return t._wrappedIterables?t._wrappedIterables:[t]})),this.size=this._wrappedIterables.reduce((function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}}),0),this[n]=this._wrappedIterables[0][n],this[e]=this._wrappedIterables[0][e],this[N]=this._wrappedIterables[0][N]}return t&&(r.__proto__=t),r.prototype=Object.create(t&&t.prototype),r.prototype.constructor=r,r.prototype.__iterateUncached=function(t,e){if(0!==this._wrappedIterables.length){if(e)return this.cacheResult().__iterate(t,e);for(var r=0,n=i(this),o=n?l:_,u=this._wrappedIterables[r].__iterator(o,e),s=!0,a=0;s;){for(var c=u.next();c.done;){if(++r===this._wrappedIterables.length)return a;c=(u=this._wrappedIterables[r].__iterator(o,e)).next()}s=!1!==(n?t(c.value[1],c.value[0],this):t(c.value,a,this)),a++}return a}},r.prototype.__iteratorUncached=function(t,e){var r=this;if(0===this._wrappedIterables.length)return new g(m);if(e)return this.cacheResult().__iterator(t,e);var n=0,i=this._wrappedIterables[n].__iterator(t,e);return new g((function(){for(var o=i.next();o.done;){if(++n===r._wrappedIterables.length)return o;o=(i=r._wrappedIterables[n].__iterator(t,e)).next()}return o}))},r}(X);function Kt(t,e,r){var n=Vt(t);return n.__iterateUncached=function(i,o){if(o)return this.cacheResult().__iterate(i,o);var u=0,a=!1;return function t(c,f){c.__iterate((function(o,c){return(!e||f0}function Wt(t,e,r,n){var i=Vt(t),o=new $(r).map((function(t){return t.size}));return i.size=n?o.max():o.min(),i.__iterate=function(t,e){for(var r,n=this.__iterator(_,e),i=0;!(r=n.next()).done&&!1!==t(r.value,i++,this););return i},i.__iteratorUncached=function(t,i){var o=r.map((function(t){return t=a(t),S(i?t.reverse():t)})),u=0,s=!1;return new g((function(){var r;return s||(r=o.map((function(t){return t.next()})),s=n?r.every((function(t){return t.done})):r.some((function(t){return t.done}))),s?{value:void 0,done:!0}:w(t,u++,e.apply(null,r.map((function(t){return t.value}))))}))},i}function Nt(t,e){return t===e?t:V(t)?e:t.constructor(e)}function Ht(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Jt(t){return i(t)?c:r(t)?f:h}function Vt(t){return Object.create((i(t)?F:r(t)?G:Z).prototype)}function Yt(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):X.prototype.cacheResult.call(this)}function Qt(t,e){return void 0===t&&void 0===e?0:void 0===t?1:void 0===e?-1:t>e?1:t0;)e[r]=arguments[r+1];if("function"!=typeof t)throw new TypeError("Invalid merger function: "+t);return te(this,e,t)}function te(t,e,r){for(var n=[],i=0;i0;)e[r]=arguments[r+1];return ue(this,e,t)}function fe(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return Fe(this,t,Re(),(function(t){return ue(t,e)}))}function he(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return Fe(this,t,Re(),(function(t){return se(t,e)}))}function pe(t,e,r){return Fe(t,e,M,(function(){return r}))}function _e(t,e){return pe(this,t,e)}function le(t,e,r){return 1===arguments.length?t(this):Gt(this,t,e,r)}function ve(t,e,r){return Fe(this,t,e,r)}function ye(){return this.__altered}function de(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this}var ge="@@__IMMUTABLE_MAP__@@";function we(t){return Boolean(t&&t[ge])}function me(t,e){if(!t)throw new Error(e)}function be(t){me(t!==1/0,"Cannot perform this action with an infinite size.")}var ze=function(t){function e(e){return null==e?Re():we(e)&&!H(e)?e:Re().withMutations((function(r){var n=t(e);be(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 Ue(this,t,e)},e.prototype.remove=function(t){return Ue(this,t,M)},e.prototype.deleteAll=function(t){var e=a(t);return 0===e.size?this:this.withMutations((function(t){e.forEach((function(e){return t.remove(e)}))}))},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):Re()},e.prototype.sort=function(t){return yr(Lt(this,t))},e.prototype.sortBy=function(t,e){return yr(Lt(this,e,t))},e.prototype.map=function(t,e){var r=this;return this.withMutations((function(n){n.forEach((function(i,o){n.set(o,t.call(e,i,o,r))}))}))},e.prototype.__iterator=function(t,e){return new De(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?ke(this.size,this._root,t,this.__hash):0===this.size?Re():(this.__ownerID=t,this.__altered=!1,this)},e}(c);ze.isMap=we;var Se=ze.prototype;Se[ge]=!0,Se[O]=Se.remove,Se.removeAll=Se.deleteAll,Se.setIn=_e,Se.removeIn=Se.deleteIn=$e,Se.update=le,Se.updateIn=ve,Se.merge=Se.concat=Zt,Se.mergeWith=$t,Se.mergeDeep=ae,Se.mergeDeepWith=ce,Se.mergeIn=he,Se.mergeDeepIn=fe,Se.withMutations=de,Se.wasAltered=ye,Se.asImmutable=st,Se["@@transducer/init"]=Se.asMutable=at,Se["@@transducer/step"]=function(t,e){return t.set(e[0],e[1])},Se["@@transducer/result"]=function(t){return t.asImmutable()};var Ie=function(t,e){this.ownerID=t,this.entries=e};Ie.prototype.get=function(t,e,r,n){for(var i=this.entries,o=0,u=i.length;o=Pe)return function(t,e,r,n){t||(t=new x);for(var i=new qe(t,pt(r),[r,n]),o=0;o>>t)&q),o=this.bitmap;return 0==(o&i)?n:this.nodes[Le(o&i-1)].get(t+E,e,r,n)},Oe.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=pt(n));var s=(0===e?r:r>>>e)&q,a=1<=We)return function(t,e,r,n,i){for(var o=0,u=new Array(j),s=0;0!==r;s++,r>>>=1)u[s]=1&r?e[o++]:void 0;return u[n]=i,new Ee(t,o+1,u)}(t,p,c,s,l);if(f&&!l&&2===p.length&&Be(p[1^h]))return p[1^h];if(f&&l&&1===p.length&&Be(l))return l;var v=t&&t===this.ownerID,y=f?l?c:c^a:c|a,d=f?l?Ce(p,h,l,v):function(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=new Array(n),o=0,u=0;u>>t)&q,o=this.nodes[i];return o?o.get(t+E,e,r,n):n},Ee.prototype.update=function(t,e,r,n,i,o,u){void 0===r&&(r=pt(n));var s=(0===e?r:r>>>e)&q,a=i===M,c=this.nodes,f=c[s];if(a&&!f)return this;var h=Te(f,t,e+E,r,n,i,o,u);if(h===f)return this;var p=this.count;if(f){if(!h&&--p>>r)&q,s=(0===r?n:n>>>r)&q,a=u===s?[Ke(t,e,r+E,n,i)]:(o=new qe(e,n,i),u>1&1431655765))+(t>>2&858993459))+(t>>4)&252645135,t+=t>>8,127&(t+=t>>16)}function Ce(t,e,r,n){var i=n?t:ie(t);return i[e]=r,i}var Pe=j/4,We=j/2,Ne=j/4;function He(t){if(Q(t)&&"string"!=typeof t)return t;if(H(t))return t.toArray();throw new TypeError("Invalid keyPath: expected Ordered Collection or Array: "+t)}function Je(t){try{return"string"==typeof t?JSON.stringify(t):String(t)}catch(e){return JSON.stringify(t)}}function Ve(t,e){return W(t)?t.has(e):ne(t)&&Y.call(t,e)}function Ye(t,e,r){return W(t)?t.get(e,r):Ve(t,e)?"function"==typeof t.get?t.get(e):t[e]:r}function Qe(t,e){if(!ne(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(W(t)){if(!t.remove)throw new TypeError("Cannot update immutable value without .remove() method: "+t);return t.remove(e)}if(!Y.call(t,e))return t;var r=oe(t);return Array.isArray(r)?r.splice(e,1):delete r[e],r}function Xe(t,e,r){if(!ne(t))throw new TypeError("Cannot update non-data-structure value: "+t);if(W(t)){if(!t.set)throw new TypeError("Cannot update immutable value without .set() method: "+t);return t.set(e,r)}if(Y.call(t,e)&&r===t[e])return t;var n=oe(t);return n[e]=r,n}function Fe(t,e,r,n){n||(n=r,r=void 0);var i=Ge(W(t),t,He(e),0,r,n);return i===M?r:i}function Ge(t,e,r,n,i,o){var u=e===M;if(n===r.length){var s=u?i:e,a=o(s);return a===s?e:a}if(!u&&!ne(e))throw new TypeError("Cannot update within non-data-structure value in path ["+Array.from(r).slice(0,n).map(Je)+"]: "+e);var c=r[n],f=u?M:Ye(e,c,M),h=Ge(f===M?t:W(f),f,r,n+1,i,o);return h===f?e:h===M?Qe(e,c):Xe(u?t?Re():{}:e,c,h)}function Ze(t,e){return Fe(t,e,(function(){return M}))}function $e(t){return Ze(this,t)}var tr="@@__IMMUTABLE_LIST__@@";function er(t){return Boolean(t&&t[tr])}var rr=function(t){function e(e){var r=ar();if(null==e)return r;if(er(e))return e;var n=t(e),i=n.size;return 0===i?r:(be(i),i>0&&i=0&&t=t.size||e<0)return t.withMutations((function(t){e<0?pr(t,e).set(0,r):pr(t,0,e+1).set(e,r)}));e+=t._origin;var n=t._tail,i=t._root,o={value:!1};e>=_r(t._capacity)?n=cr(n,t.__ownerID,0,e,r,o):i=cr(i,t.__ownerID,t._level,e,r,o);if(!o.value)return t;if(t.__ownerID)return t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t;return sr(t._origin,t._capacity,t._level,i,n)}(this,t,e)},e.prototype.remove=function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},e.prototype.insert=function(t,e){return this.splice(t,0,e)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=E,this._root=this._tail=this.__hash=void 0,this.__altered=!0,this):ar()},e.prototype.push=function(){var t=arguments,e=this.size;return this.withMutations((function(r){pr(r,0,e+t.length);for(var n=0;n>>e&q;if(n>=this.array.length)return new ir([],t);var i,o=0===n;if(e>0){var u=this.array[n];if((i=u&&u.removeBefore(t,e-E,r))===u&&o)return this}if(o&&!i)return this;var s=fr(this,t);if(!o)for(var a=0;a>>e&q;if(i>=this.array.length)return this;if(e>0){var o=this.array[i];if((n=o&&o.removeAfter(t,e-E,r))===o&&i===this.array.length-1)return this}var u=fr(this,t);return u.array.splice(i+1),n&&(u.array[i]=n),u};var or={};function ur(t,e){var r=t._origin,n=t._capacity,i=_r(n),o=t._tail;return u(t._root,t._level,0);function u(t,s,a){return 0===s?function(t,u){var s=u===i?o&&o.array:t&&t.array,a=u>r?0:r-u,c=n-u;c>j&&(c=j);return function(){if(a===c)return or;var t=e?--c:a++;return s&&s[t]}}(t,a):function(t,i,o){var s,a=t&&t.array,c=o>r?0:r-o>>i,f=1+(n-o>>i);f>j&&(f=j);return function(){for(;;){if(s){var t=s();if(t!==or)return t;s=null}if(c===f)return or;var r=e?--f:c++;s=u(a&&a[r],i-E,o+(r<>>r&q,a=t&&s0){var c=t&&t.array[s],f=cr(c,e,r-E,n,i,o);return f===c?t:((u=fr(t,e)).array[s]=f,u)}return a&&t.array[s]===i?t:(o&&D(o),u=fr(t,e),void 0===i&&s===u.array.length-1?u.array.pop():u.array[s]=i,u)}function fr(t,e){return e&&t&&e===t.ownerID?t:new ir(t?t.array.slice():[],e)}function hr(t,e){if(e>=_r(t._capacity))return t._tail;if(e<1<0;)r=r.array[e>>>n&q],n-=E;return r}}function pr(t,e,r){void 0!==e&&(e|=0),void 0!==r&&(r|=0);var n=t.__ownerID||new x,i=t._origin,o=t._capacity,u=i+e,s=void 0===r?o:r<0?o+r:i+r;if(u===i&&s===o)return t;if(u>=s)return t.clear();for(var a=t._level,c=t._root,f=0;u+f<0;)c=new ir(c&&c.array.length?[void 0,c]:[],n),f+=1<<(a+=E);f&&(u+=f,i+=f,s+=f,o+=f);for(var h=_r(o),p=_r(s);p>=1<h?new ir([],n):_;if(_&&p>h&&uE;y-=E){var d=h>>>y&q;v=v.array[d]=fr(v.array[d],n)}v.array[h>>>E&q]=_}if(s=p)u-=p,s-=p,a=E,c=null,l=l&&l.removeBefore(n,0,u);else if(u>i||p>>a&q;if(g!==p>>>a&q)break;g&&(f+=(1<i&&(c=c.removeBefore(n,a,u-f)),c&&p>>E<=j&&u.size>=2*o.size?(n=(i=u.filter((function(t,e){return void 0!==t&&s!==e}))).toKeyedSeq().map((function(t){return t[0]})).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=o.remove(e),i=s===u.size-1?u.pop():u.set(s,void 0))}else if(a){if(r===u.get(s)[1])return t;n=o,i=u.set(s,[e,r])}else n=o.set(e,u.size),i=u.set(u.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t.__altered=!0,t):dr(n,i)}yr.isOrderedMap=lr,yr.prototype[N]=!0,yr.prototype[O]=yr.prototype.remove;var mr="@@__IMMUTABLE_STACK__@@";function br(t){return Boolean(t&&t[mr])}var zr=function(t){function e(t){return null==t?Er():br(t)?t:Er().pushAll(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.of=function(){return this(arguments)},e.prototype.toString=function(){return this.__toString("Stack [","]")},e.prototype.get=function(t,e){var r=this._head;for(t=k(this,t);r&&t--;)r=r.next;return r?r.value:e},e.prototype.peek=function(){return this._head&&this._head.value},e.prototype.push=function(){var t=arguments;if(0===arguments.length)return this;for(var e=this.size+arguments.length,r=this._head,n=arguments.length-1;n>=0;n--)r={value:t[n],next:r};return this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):Or(e,r)},e.prototype.pushAll=function(e){if(0===(e=t(e)).size)return this;if(0===this.size&&br(e))return e;be(e.size);var r=this.size,n=this._head;return e.__iterate((function(t){r++,n={value:t,next:n}}),!0),this.__ownerID?(this.size=r,this._head=n,this.__hash=void 0,this.__altered=!0,this):Or(r,n)},e.prototype.pop=function(){return this.slice(1)},e.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Er()},e.prototype.slice=function(e,r){if(U(e,r,this.size))return this;var n=T(e,this.size);if(B(r,this.size)!==this.size)return t.prototype.slice.call(this,e,r);for(var i=this.size-n,o=this._head;n--;)o=o.next;return this.__ownerID?(this.size=i,this._head=o,this.__hash=void 0,this.__altered=!0,this):Or(i,o)},e.prototype.__ensureOwner=function(t){return t===this.__ownerID?this:t?Or(this.size,this._head,t,this.__hash):0===this.size?Er():(this.__ownerID=t,this.__altered=!1,this)},e.prototype.__iterate=function(t,e){var r=this;if(e)return new $(this.toArray()).__iterate((function(e,n){return t(e,n,r)}),e);for(var n=0,i=this._head;i&&!1!==t(i.value,n++,this);)i=i.next;return n},e.prototype.__iterator=function(t,e){if(e)return new $(this.toArray()).__iterator(t,e);var r=0,n=this._head;return new g((function(){if(n){var e=n.value;return n=n.next,w(t,r++,e)}return{value:void 0,done:!0}}))},e}(f);zr.isStack=br;var Sr,Ir=zr.prototype;function Or(t,e,r,n){var i=Object.create(Ir);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function Er(){return Sr||(Sr=Or(0))}function jr(t,e,r,n,i,o){return be(t.size),t.__iterate((function(t,o,u){i?(i=!1,r=t):r=e.call(n,r,t,o,u)}),o),r}function qr(t,e){return e}function Mr(t,e){return[e,t]}function Dr(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return!t.apply(this,e)}}function xr(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return-t.apply(this,e)}}function Ar(t,e){return te?-1:0}function kr(t,e){if(t===e)return!0;if(!s(e)||void 0!==t.size&&void 0!==e.size&&t.size!==e.size||void 0!==t.__hash&&void 0!==e.__hash&&t.__hash!==e.__hash||i(t)!==i(e)||r(t)!==r(e)||H(t)!==H(e))return!1;if(0===t.size&&0===e.size)return!0;var n=!o(t);if(H(t)){var u=t.entries();return e.every((function(t,e){var r=u.next().value;return r&&Ft(r[1],t)&&(n||Ft(r[0],e))}))&&u.next().done}var a=!1;if(void 0===t.size)if(void 0===e.size)"function"==typeof t.cacheResult&&t.cacheResult();else{a=!0;var c=t;t=e,e=c}var f=!0,h=e.__iterate((function(e,r){if(n?!t.has(e):a?!Ft(e,t.get(r,M)):!Ft(t.get(r,M),e))return f=!1,!1}));return f&&t.size===h}Ir[mr]=!0,Ir.shift=Ir.pop,Ir.unshift=Ir.push,Ir.unshiftAll=Ir.pushAll,Ir.withMutations=de,Ir.wasAltered=ye,Ir.asImmutable=st,Ir["@@transducer/init"]=Ir.asMutable=at,Ir["@@transducer/step"]=function(t,e){return t.unshift(e)},Ir["@@transducer/result"]=function(t){return t.asImmutable()};var Rr,Ur=function(t){function e(t,r,n){if(void 0===n&&(n=1),!(this instanceof e))return new e(t,r,n);if(me(0!==n,"Cannot step a Range by 0"),me(void 0!==t,"You must define a start value when using Range"),me(void 0!==r,"You must define an end value when using Range"),n=Math.abs(n),r=0&&e=0&&r>>-15,461845907),e=ct(e<<13|e>>>-13,5),e=(e+3864292196|0)^t,e=ct(e^e>>>16,2246822507),e=ct(e^e>>>13,3266489909),e=ft(e^e>>>16),e}(t.size,n)}function Fr(t,e){return t^e+2654435769+(t<<6)+(t>>2)|0}function Gr(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}Cr[Tr]=!0,Cr[O]=Cr.remove,Cr.merge=Cr.concat=Cr.union,Cr.withMutations=de,Cr.asImmutable=st,Cr["@@transducer/init"]=Cr.asMutable=at,Cr["@@transducer/step"]=function(t,e){return t.add(e)},Cr["@@transducer/result"]=function(t){return t.asImmutable()},Cr.__empty=Nr,Cr.__make=Wr,a.Iterator=g,Gr(a,{toArray:function(){be(this.size);var t=new Array(this.size||0),e=i(this),r=0;return this.__iterate((function(n,i){t[r++]=e?[i,n]:n})),t},toIndexedSeq:function(){return new qt(this)},toJS:function(){return Qr(this)},toKeyedSeq:function(){return new jt(this,!0)},toMap:function(){return ze(this.toKeyedSeq())},toObject:Yr,toOrderedMap:function(){return yr(this.toKeyedSeq())},toOrderedSet:function(){return on(i(this)?this.valueSeq():this)},toSet:function(){return Kr(i(this)?this.valueSeq():this)},toSetSeq:function(){return new Mt(this)},toSeq:function(){return r(this)?this.toIndexedSeq():i(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return zr(i(this)?this.valueSeq():this)},toList:function(){return rr(i(this)?this.valueSeq():this)},toString:function(){return"[Collection]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];return Nt(this,function(t,e){var n=i(t),o=[t].concat(e).map((function(t){return s(t)?n&&(t=c(t)):t=n?it(t):ot(Array.isArray(t)?t:[t]),t})).filter((function(t){return 0!==t.size}));if(0===o.length)return t;if(1===o.length){var u=o[0];if(u===t||n&&i(u)||r(t)&&r(u))return u}return new Bt(o)}(this,t))},includes:function(t){return this.some((function(e){return Ft(e,t)}))},entries:function(){return this.__iterator(l)},every:function(t,e){be(this.size);var r=!0;return this.__iterate((function(n,i,o){if(!t.call(e,n,i,o))return r=!1,!1})),r},filter:function(t,e){return Nt(this,Rt(this,t,e,!0))},partition:function(t,e){return function(t,e,r){var n=i(t),o=[[],[]];t.__iterate((function(i,u){o[e.call(r,i,u,t)?1:0].push(n?[u,i]:i)}));var u=Jt(t);return o.map((function(e){return Nt(t,u(e))}))}(this,t,e)},find:function(t,e,r){var n=this.findEntry(t,e);return n?n[1]:r},forEach:function(t,e){return be(this.size),this.__iterate(e?t.bind(e):t)},join:function(t){be(this.size),t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate((function(n){r?r=!1:e+=t,e+=null!=n?n.toString():""})),e},keys:function(){return this.__iterator(p)},map:function(t,e){return Nt(this,At(this,t,e))},reduce:function(t,e,r){return jr(this,t,e,r,arguments.length<2,!1)},reduceRight:function(t,e,r){return jr(this,t,e,r,arguments.length<2,!0)},reverse:function(){return Nt(this,kt(this,!0))},slice:function(t,e){return Nt(this,Ut(this,t,e,!0))},some:function(t,e){be(this.size);var r=!1;return this.__iterate((function(n,i,o){if(t.call(e,n,i,o))return r=!0,!1})),r},sort:function(t){return Nt(this,Lt(this,t))},values:function(){return this.__iterator(_)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some((function(){return!0}))},count:function(t,e){return A(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return function(t,e,r){var n=ze().asMutable();return t.__iterate((function(i,o){n.update(e.call(r,i,o,t),0,(function(t){return t+1}))})),n.asImmutable()}(this,t,e)},equals:function(t){return kr(this,t)},entrySeq:function(){var t=this;if(t._cache)return new $(t._cache);var e=t.toSeq().map(Mr).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(Dr(t),e)},findEntry:function(t,e,r){var n=r;return this.__iterate((function(r,i,o){if(t.call(e,r,i,o))return n=[i,r],!1})),n},findKey:function(t,e){var r=this.findEntry(t,e);return r&&r[0]},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},findLastEntry:function(t,e,r){return this.toKeyedSeq().reverse().findEntry(t,e,r)},findLastKey:function(t,e){return this.toKeyedSeq().reverse().findKey(t,e)},first:function(t){return this.find(R,null,t)},flatMap:function(t,e){return Nt(this,function(t,e,r){var n=Jt(t);return t.toSeq().map((function(i,o){return n(e.call(r,i,o,t))})).flatten(!0)}(this,t,e))},flatten:function(t){return Nt(this,Kt(this,t,!0))},fromEntrySeq:function(){return new Dt(this)},get:function(t,e){return this.find((function(e,r){return Ft(r,t)}),void 0,e)},getIn:Jr,groupBy:function(t,e){return function(t,e,r){var n=i(t),o=(H(t)?yr():ze()).asMutable();t.__iterate((function(i,u){o.update(e.call(r,i,u,t),(function(t){return(t=t||[]).push(n?[u,i]:i),t}))}));var u=Jt(t);return o.map((function(e){return Nt(t,u(e))})).asImmutable()}(this,t,e)},has:function(t){return this.get(t,M)!==M},hasIn:function(t){return Vr(this,t)},isSubset:function(t){return t="function"==typeof t.includes?t:a(t),this.every((function(e){return t.includes(e)}))},isSuperset:function(t){return(t="function"==typeof t.isSubset?t:a(t)).isSubset(this)},keyOf:function(t){return this.findKey((function(e){return Ft(e,t)}))},keySeq:function(){return this.toSeq().map(qr).toIndexedSeq()},last:function(t){return this.toSeq().reverse().first(t)},lastKeyOf:function(t){return this.toKeyedSeq().reverse().keyOf(t)},max:function(t){return Ct(this,t)},maxBy:function(t,e){return Ct(this,e,t)},min:function(t){return Ct(this,t?xr(t):Ar)},minBy:function(t,e){return Ct(this,e?xr(e):Ar,t)},rest:function(){return this.slice(1)},skip:function(t){return 0===t?this:this.slice(Math.max(0,t))},skipLast:function(t){return 0===t?this:this.slice(0,-Math.max(0,t))},skipWhile:function(t,e){return Nt(this,Tt(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(Dr(t),e)},sortBy:function(t,e){return Nt(this,Lt(this,e,t))},take:function(t){return this.slice(0,Math.max(0,t))},takeLast:function(t){return this.slice(-Math.max(0,t))},takeWhile:function(t,e){return Nt(this,function(t,e,r){var n=Vt(t);return n.__iterateUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterate(n,i);var u=0;return t.__iterate((function(t,i,s){return e.call(r,t,i,s)&&++u&&n(t,i,o)})),u},n.__iteratorUncached=function(n,i){var o=this;if(i)return this.cacheResult().__iterator(n,i);var u=t.__iterator(l,i),s=!0;return new g((function(){if(!s)return{value:void 0,done:!0};var t=u.next();if(t.done)return t;var i=t.value,a=i[0],c=i[1];return e.call(r,c,a,o)?n===l?t:w(n,a,c,t):(s=!1,{value:void 0,done:!0})}))},n}(this,t,e))},takeUntil:function(t,e){return this.takeWhile(Dr(t),e)},update:function(t){return t(this)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=Xr(this))}});var Zr=a.prototype;Zr[u]=!0,Zr[d]=Zr.values,Zr.toJSON=Zr.toArray,Zr.__toStringMapper=Je,Zr.inspect=Zr.toSource=function(){return this.toString()},Zr.chain=Zr.flatMap,Zr.contains=Zr.includes,Gr(c,{flip:function(){return Nt(this,xt(this))},mapEntries:function(t,e){var r=this,n=0;return Nt(this,this.toSeq().map((function(i,o){return t.call(e,[o,i],n++,r)})).fromEntrySeq())},mapKeys:function(t,e){var r=this;return Nt(this,this.toSeq().flip().map((function(n,i){return t.call(e,n,i,r)})).flip())}});var $r=c.prototype;$r[n]=!0,$r[d]=Zr.entries,$r.toJSON=Yr,$r.__toStringMapper=function(t,e){return Je(e)+": "+Je(t)},Gr(f,{toKeyedSeq:function(){return new jt(this,!1)},filter:function(t,e){return Nt(this,Rt(this,t,e,!1))},findIndex:function(t,e){var r=this.findEntry(t,e);return r?r[0]:-1},indexOf:function(t){var e=this.keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return Nt(this,kt(this,!1))},slice:function(t,e){return Nt(this,Ut(this,t,e,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(e||0,0),0===r||2===r&&!e)return this;t=T(t,t<0?this.count():this.size);var n=this.slice(0,t);return Nt(this,1===r?n:n.concat(ie(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.findLastEntry(t,e);return r?r[0]:-1},first:function(t){return this.get(0,t)},flatten:function(t){return Nt(this,Kt(this,t,!1))},get:function(t,e){return(t=k(this,t))<0||this.size===1/0||void 0!==this.size&&t>this.size?e:this.find((function(e,r){return r===t}),void 0,e)},has:function(t){return(t=k(this,t))>=0&&(void 0!==this.size?this.size===1/0||t2?[]:void 0,{"":t})},t.get=Ye,t.getIn=Hr,t.has=Ve,t.hasIn=Vr,t.hash=pt,t.is=Ft,t.isAssociative=o,t.isCollection=s,t.isImmutable=W,t.isIndexed=r,t.isKeyed=i,t.isList=er,t.isMap=we,t.isOrdered=H,t.isOrderedMap=lr,t.isOrderedSet=nn,t.isPlainObject=re,t.isRecord=P,t.isSeq=V,t.isSet=Br,t.isStack=br,t.isValueObject=Xt,t.merge=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return se(t,e)},t.mergeDeep=function(t){for(var e=[],r=arguments.length-1;r-- >0;)e[r]=arguments[r+1];return ue(t,e)},t.mergeDeepWith=function(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return ue(e,r,t)},t.mergeWith=function(t,e){for(var r=[],n=arguments.length-2;n-- >0;)r[n]=arguments[n+2];return se(e,r,t)},t.remove=Qe,t.removeIn=Ze,t.set=Xe,t.setIn=pe,t.update=Gt,t.updateIn=Fe,t.version="5.1.4"}));