mirror of
https://github.com/wahyd4/cdnjs.git
synced 2026-08-09 04:46:00 +10:00
add immutable v3.1.0
This commit is contained in:
File diff suppressed because it is too large
Load Diff
+34
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Copyright (c) 2014, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
function t(){function t(t,e,r,n){var i;if(n){var u=n.prototype;i=pr.create(u)}else i=t.prototype;return pr.keys(e).forEach(function(t){i[t]=e[t]}),pr.keys(r).forEach(function(e){t[e]=r[e]}),i.constructor=t,t.prototype=i,t}function e(t,e,r,n){return pr.getPrototypeOf(e)[r].apply(t,n)}function r(t,r,n){e(t,r,"constructor",n)}function n(t,e){return t===e?0!==t||0!==e||1/t===1/e:t!==t?e!==e:t&&"function"==typeof t.equals?t.equals(e):!1}function i(t,e){if(!t)throw Error(e)}function u(t){return t.value=!1,t}function s(t){t&&(t.value=!0)}function o(){}function a(t,e){e=e||0;for(var r=Math.max(0,t.length-e),n=Array(r),i=0;r>i;i++)n[i]=t[i+e];return n}function h(t){i(1/0!==t,"Cannot perform this action with an infinite size.")}function c(t){return void 0===t.size&&(t.size=t.__iterate(_)),t.size}function f(t,e){return e>=0?+e:c(t)+ +e}function _(){return!0}function l(t,e,r){return(0===t||void 0!==r&&-r>=t)&&(void 0===e||void 0!==r&&e>=r)}function v(t,e){return d(t,e,0)}function p(t,e){return d(t,e,e)}function d(t,e,r){return void 0===t?r:0>t?Math.max(0,e+t):void 0===e?t:Math.min(e,t)}function y(t){if(!t)return 0;if(t===!0)return 1;var e=typeof t;if("number"===e){if((0|t)===t)return t&Mr;t=""+t,e="string"}return"string"===e?t.length>Er?g(t):m(t):t.hashCode?y("function"==typeof t.hashCode?t.hashCode():t.hashCode):w(t)}function g(t){var e=Ar[t];return void 0===e&&(e=m(t),Or===Dr&&(Or=0,Ar={}),Or++,Ar[t]=e),e}function m(t){for(var e=0,r=0;t.length>r;r++)e=31*e+t.charCodeAt(r)&Mr;return e}function w(t){var e=qr&&qr.get(t);if(e)return e;if(e=t[kr])return e;if(!br){if(e=t.propertyIsEnumerable&&t.propertyIsEnumerable[kr])return e;if(e=S(t))return e}if(Object.isExtensible&&!Object.isExtensible(t))throw Error("Non-extensible objects are not allowed as keys.");if(e=++xr&Mr,qr)qr.set(t,e);else if(br)Object.defineProperty(t,kr,{enumerable:!1,configurable:!1,writable:!1,value:e});else if(t.propertyIsEnumerable&&t.propertyIsEnumerable===t.constructor.prototype.propertyIsEnumerable)t.propertyIsEnumerable=function(){return this.constructor.prototype.propertyIsEnumerable.apply(this,arguments)
|
||||
},t.propertyIsEnumerable[kr]=e;else{if(!t.nodeType)throw Error("Unable to set a non-enumerable property on object.");t[kr]=e}return e}function S(t){if(t&&t.nodeType>0)switch(t.nodeType){case 1:return t.uniqueID;case 9:return t.documentElement&&t.documentElement.uniqueID}}function z(t,e,r,n){var i=0===t?e:1===t?r:[e,r];return n?n.value=i:n={value:i,done:!1},n}function I(){return{value:void 0,done:!0}}function b(t){return!!x(t)}function q(t){return t&&"function"==typeof t.next}function M(t){var e=x(t);return e&&e.call(t)}function x(t){var e=t&&(Ur&&t[Ur]||t[Kr]);return"function"==typeof e?e:void 0}function k(t){return!(!t||!t[Jr])}function E(t){return!(!t||!t[Hr])}function D(t){return!(!t||!t[Vr])}function O(t){return E(t)||D(t)}function A(t,e){return e}function C(t,e){return[e,t]}function j(t){return function(){return!t.apply(this,arguments)}}function R(t){return function(){return-t.apply(this,arguments)}}function K(t){return"string"==typeof t?JSON.stringify(t):t}function U(t,e){return t>e?-1:e>t?1:0}function L(t,e){var r=t.prototype,n=function(t){r[t]=e[t]};return Object.keys(e).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(e).forEach(n),t}function T(t){return!(!t||!t[sn])}function B(){return fn||(fn=new on([]))}function W(t){var e=Array.isArray(t)?new on(t).fromEntrySeq():q(t)?new cn(t).fromEntrySeq():b(t)?new hn(t).fromEntrySeq():"object"==typeof t?new an(t):void 0;if(!e)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+t);return e}function P(t){var e=H(t);if(!e)throw new TypeError("Expected Array or iterable object of values: "+t);return e}function J(t){var e=H(t)||"object"==typeof t&&new an(t);if(!e)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+t);return e}function H(t){return V(t)?new on(t):q(t)?new cn(t):b(t)?new hn(t):void 0}function V(t){return t&&"number"==typeof t.length}function N(t,e,r,n){h(t.size);var i=t._cache;if(i){for(var u=i.length-1,s=0;u>=s;s++){var o=i[r?u-s:s];if(e(o[1],n?o[0]:s,t)===!1)return s+1
|
||||
}return s}return t.__iterateUncached(e,r)}function Y(t,e,r,n){var i=t._cache;if(i){var u=i.length-1,s=0;return new Tr(function(){var t=i[r?u-s:s];return s++>u?I():z(e,n?t[0]:s-1,t[1])})}return t.__iteratorUncached(e,r)}function Q(t,e){return e?X(e,t,"",{"":t}):F(t)}function X(t,e,r,n){return Array.isArray(e)?t.call(n,r,en(e).map(function(r,n){return X(t,r,n,e)})):G(e)?t.call(n,r,$r(e).map(function(r,n){return X(t,r,n,e)})):e}function F(t){return Array.isArray(t)?en(t).map(F).toList():G(t)?$r(t).map(F).toMap():t}function G(t){return t&&t.constructor===Object}function Z(t){return!(!t||!t[wn])}function $(t,e){return z(t,e[0],e[1])}function te(t,e){return{node:t,index:0,__prev:e}}function ee(t,e,r,n){var i=Object.create(Sn);return i.size=t,i._root=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function re(){return Cn||(Cn=ee(0))}function ne(t,e,r){var n,i;if(t._root){var s=u(zr),o=u(Ir);if(n=ie(t._root,t.__ownerID,0,void 0,e,r,s,o),!o.value)return t;i=t.size+(s.value?r===Sr?-1:1:0)}else{if(r===Sr)return t;i=1,n=new zn(t.__ownerID,[[e,r]])}return t.__ownerID?(t.size=i,t._root=n,t.__hash=void 0,t.__altered=!0,t):n?ee(i,n):re()}function ie(t,e,r,n,i,u,o,a){return t?t.update(e,r,n,i,u,o,a):u===Sr?t:(s(a),s(o),new Dn(e,n,[i,u]))}function ue(t){return t.constructor===Dn||t.constructor===kn}function se(t,e,r,n,i){if(t.keyHash===n)return new kn(e,n,[t.entry,i]);var u,s=(0===r?t.keyHash:t.keyHash>>>r)&wr,o=(0===r?n:n>>>r)&wr,a=s===o?[se(t,e,r+gr,n,i)]:(u=new Dn(e,n,i),o>s?[t,u]:[u,t]);return new bn(e,1<<s|1<<o,a)}function oe(t,e,r,n){t||(t=new o);for(var i=new Dn(t,y(r),[r,n]),u=0;e.length>u;u++){var s=e[u];i=i.update(t,0,void 0,s[0],s[1])}return i}function ae(t,e,r,n){for(var i=0,u=0,s=Array(r),o=0,a=1,h=e.length;h>o;o++,a<<=1){var c=e[o];void 0!==c&&o!==n&&(i|=a,s[u++]=c)}return new bn(t,i,s)}function he(t,e,r,n,i){for(var u=0,s=Array(mr),o=0;0!==r;o++,r>>>=1)s[o]=1&r?e[u++]:void 0;return s[n]=i,new Mn(t,u+1,s)}function ce(t,e,r){for(var n=[],i=0;r.length>i;i++){var u=r[i],s=Yr(u);k(u)||(s=s.map(function(t){return Q(t)})),n.push(s)
|
||||
}return _e(t,e,n)}function fe(t){return function(e,r){return e&&e.mergeDeepWith&&k(r)?e.mergeDeepWith(t,r):t?t(e,r):r}}function _e(t,e,r){return 0===r.length?t:t.withMutations(function(t){for(var n=e?function(r,n){t.update(n,Sr,function(t){return t===Sr?r:e(t,r)})}:function(e,r){t.set(r,e)},i=0;r.length>i;i++)r[i].forEach(n)})}function le(t,e,r,n,u){i(!t||t.set,"updateIn with invalid keyPath");var s=e[u],o=t?t.get(s,Sr):Sr,a=o===Sr?void 0:o,h=u===e.length-1?n(o===Sr?r:o):le(a,e,r,n,u+1);return h===a?t:h===Sr?t&&t.remove(s):(t||re()).set(s,h)}function ve(t){return t-=t>>1&1431655765,t=(858993459&t)+(t>>2&858993459),t=t+(t>>4)&252645135,t+=t>>8,t+=t>>16,127&t}function pe(t,e,r,n){var i=n?t:a(t);return i[e]=r,i}function de(t,e,r,n){var i=t.length+1;if(n&&e+1===i)return t[e]=r,t;for(var u=Array(i),s=0,o=0;i>o;o++)o===e?(u[o]=r,s=-1):u[o]=t[o+s];return u}function ye(t,e,r){var n=t.length-1;if(r&&e===n)return t.pop(),t;for(var i=Array(n),u=0,s=0;n>s;s++)s===e&&(u=1),i[s]=t[s+u];return i}function ge(t){var e=Le(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.contains(e)},e.contains=function(e){return t.has(e)},e.cacheResult=Te,e.__iterateUncached=function(e,r){var n=this;return t.__iterate(function(t,r){return e(r,t,n)!==!1},r)},e.__iteratorUncached=function(e,r){if(e===Rr){var n=t.__iterator(e,r);return new Tr(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===jr?Cr:jr,r)},e}function me(t,e,r){var n=Le(t);return n.size=t.size,n.has=function(e){return t.has(e)},n.get=function(n,i){var u=t.get(n,Sr);return u===Sr?i:e.call(r,u,n,t)},n.__iterateUncached=function(n,i){var u=this;return t.__iterate(function(t,i,s){return n(e.call(r,t,i,s),i,u)!==!1},i)},n.__iteratorUncached=function(n,i){var u=t.__iterator(Rr,i);return new Tr(function(){var i=u.next();if(i.done)return i;var s=i.value,o=s[0];return z(n,o,e.call(r,s[1],o,t),i)
|
||||
})},n}function we(t,e){var r=Le(t);return r._iter=t,r.size=t.size,r.reverse=function(){return t},t.flip&&(r.flip=function(){var e=ge(t);return e.reverse=function(){return t.flip()},e}),r.get=function(r,n){return t.get(e?r:-1-r,n)},r.has=function(r){return t.has(e?r:-1-r)},r.contains=function(e){return t.contains(e)},r.cacheResult=Te,r.__iterate=function(e,r){var n=this;return t.__iterate(function(t,r){return e(t,r,n)},!r)},r.__iterator=function(e,r){return t.__iterator(e,!r)},r}function Se(t,e,r,n){var i=Le(t);return n&&(i.has=function(n){var i=t.get(n,Sr);return i!==Sr&&!!e.call(r,i,n,t)},i.get=function(n,i){var u=t.get(n,Sr);return u!==Sr&&e.call(r,u,n,t)?u:i}),i.__iterateUncached=function(i,u){var s=this,o=0;return t.__iterate(function(t,u,a){return e.call(r,t,u,a)?(o++,i(t,n?u:o-1,s)):void 0},u),o},i.__iteratorUncached=function(i,u){var s=t.__iterator(Rr,u),o=0;return new Tr(function(){for(;;){var u=s.next();if(u.done)return u;var a=u.value,h=a[0],c=a[1];if(e.call(r,c,h,t))return z(i,n?h:o++,c,u)}})},i}function ze(t,e,r){var n=mn().asMutable();return t.__iterate(function(i,u){n.update(e.call(r,i,u,t),0,function(t){return t+1})}),n.asImmutable()}function Ie(t,e,r){var n=E(t),i=mn().asMutable();t.__iterate(function(u,s){i.update(e.call(r,u,s,t),[],function(t){return t.push(n?[s,u]:u),t})});var u=Ue(t);return i.map(function(e){return je(t,u(e))})}function be(t,e){if(e>t.size)return t;0>e&&(e=0);var r=Le(t);return r.size=t.size&&Math.min(t.size,e),r.__iterateUncached=function(r,n){var i=this;if(0===e)return 0;if(n)return this.cacheResult().__iterate(r,n);var u=0;return t.__iterate(function(t,n){return++u&&r(t,n,i)!==!1&&e>u}),u},r.__iteratorUncached=function(r,n){if(n)return this.cacheResult().__iterator(r,n);var i=e&&t.__iterator(r,n),u=0;return new Tr(function(){return u++>e?I():i.next()})},r}function qe(t,e,r){var n=Le(t);return n.__iterateUncached=function(n,i){var u=this;if(i)return this.cacheResult().__iterate(n,i);var s=0;return t.__iterate(function(t,i,o){return e.call(r,t,i,o)&&++s&&n(t,i,u)}),s},n.__iteratorUncached=function(n,i){var u=this;
|
||||
if(i)return this.cacheResult().__iterator(n,i);var s=t.__iterator(Rr,i),o=!0;return new Tr(function(){if(!o)return I();var t=s.next();if(t.done)return t;var i=t.value,a=i[0],h=i[1];return e.call(r,h,a,u)?n===Rr?t:z(n,a,h,t):(o=!1,I())})},n}function Me(t,e,r){if(0>=e)return t;var n=Le(t);return n.size=t.size&&Math.max(0,t.size-e),n.__iterateUncached=function(n,i){var u=this;if(i)return this.cacheResult().__iterate(n,i);var s=0,o=!0,a=0;return t.__iterate(function(t,i){return o&&(o=s++<e)?void 0:(a++,n(t,r?i:a-1,u))}),a},n.__iteratorUncached=function(n,i){if(i)return this.cacheResult().__iterator(n,i);var u=e&&t.__iterator(n,i),s=0,o=0;return new Tr(function(){for(;e>s;)s++,u.next();var t=u.next();return r||n===jr?t:n===Cr?z(n,o++,void 0,t):z(n,o++,t.value[1],t)})},n}function xe(t,e,r,n){var i=Le(t);return i.__iterateUncached=function(i,u){var s=this;if(u)return this.cacheResult().__iterate(i,u);var o=!0,a=0;return t.__iterate(function(t,u,h){return o&&(o=e.call(r,t,u,h))?void 0:(a++,i(t,n?u:a-1,s))}),a},i.__iteratorUncached=function(i,u){var s=this;if(u)return this.cacheResult().__iterator(i,u);var o=t.__iterator(Rr,u),a=!0,h=0;return new Tr(function(){var t,u,c;do{if(t=o.next(),t.done)return n||i===jr?t:i===Cr?z(i,h++,void 0,t):z(i,h++,t.value[1],t);var f=t.value;u=f[0],c=f[1],a&&(a=e.call(r,c,u,s))}while(a);return i===Rr?t:z(i,u,c,t)})},i}function ke(t,e){var r=E(t),n=new on([t].concat(e)).map(function(t){return k(t)?r&&(t=Yr(t)):t=r?W(t):P(Array.isArray(t)?t:[t]),t});r?n=n.toKeyedSeq():D(t)||(n=n.toSetSeq());var i=n.flatten(!0);return i.size=n.reduce(function(t,e){if(void 0!==t){var r=e.size;if(void 0!==r)return t+r}},0),i}function Ee(t,e,r){var n=Le(t);return n.__iterateUncached=function(n,i){function u(t,a){var h=this;t.__iterate(function(t,i){return(!e||e>a)&&k(t)?u(t,a+1):n(t,r?i:s++,h)===!1&&(o=!0),!o},i)}var s=0,o=!1;return u(t,0),s},n.__iteratorUncached=function(n,i){var u=t.__iterator(n,i),s=[],o=0;return new Tr(function(){for(;u;){var t=u.next();if(t.done===!1){var a=t.value;if(n===Rr&&(a=a[1]),e&&!(e>s.length)||!k(a))return r?t:z(n,o++,a,t);
|
||||
s.push(u),u=a.__iterator(n,i)}else u=s.pop()}return I()})},n}function De(t,e,r){var n=Ue(t);return t.toSeq().map(function(i,u){return n(e.call(r,i,u,t))}).flatten(!0)}function Oe(t,e){var r=Le(t);return r.size=t.size&&2*t.size-1,r.__iterateUncached=function(r,n){var i=this,u=0;return t.__iterate(function(t){return(!u||r(e,u++,i)!==!1)&&r(t,u++,i)!==!1},n),u},r.__iteratorUncached=function(r,n){var i,u=t.__iterator(jr,n),s=0;return new Tr(function(){return(!i||s%2)&&(i=u.next(),i.done)?i:s%2?z(r,s++,e):z(r,s++,i.value,i)})},r}function Ae(t,e,r){e||(e=Be);var n=E(t),i=0,u=t.toSeq().map(function(e,n){return[n,e,i++,r?r(e,n,t):e]}).toArray();return u.sort(function(t,r){return e(t[3],r[3])||t[2]-r[2]}).forEach(n?function(t,e){u[e].length=2}:function(t,e){u[e]=t[1]}),n?$r(u):D(t)?en(u):nn(u)}function Ce(t,e,r){if(e||(e=Be),r){var n=t.toSeq().map(function(e,n){return[e,r(e,n,t)]}).reduce(function(t,r){return e(r[1],t[1])>0?r:t});return n&&n[0]}return t.reduce(function(t,r){return e(r,t)>0?r:t})}function je(t,e){return T(t)?e:t.constructor(e)}function Re(t){if(t!==Object(t))throw new TypeError("Expected [K, V] tuple: "+t)}function Ke(t){return h(t.size),c(t)}function Ue(t){return E(t)?Yr:D(t)?Xr:Fr}function Le(t){return Object.create((E(t)?$r:D(t)?en:nn).prototype)}function Te(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):Gr.prototype.cacheResult.call(this)}function Be(t,e){return t>e?1:e>t?-1:0}function We(t){return!(!t||!t[Pn])}function Pe(t,e,r,n,i,u){var s,o=t&&t.array;if(0===e){var a=0>r?-r:0,h=n-r;for(h>mr&&(h=mr),s=a;h>s;s++)if(i(o&&o[u?a+h-1-s:s])===!1)return!1}else{var c=1<<e,f=e-gr;for(s=0;wr>=s;s++){var _=u?wr-s:s,l=r+(_<<e);if(n>l&&l+c>0){var v=o&&o[_];if(!Pe(v,f,l,n,i,u))return!1}}}return!0}function Je(t,e,r,n,i){return{array:t,level:e,offset:r,max:n,rawMax:n-r>>e,index:0,__prev:i}}function He(t,e,r,n,i,u,s){var o=Object.create(Jn);return o.size=e-t,o._origin=t,o._capacity=e,o._level=r,o._root=n,o._tail=i,o.__ownerID=u,o.__hash=s,o.__altered=!1,o}function Ve(){return Yn||(Yn=He(0,0,gr))
|
||||
}function Ne(t,e,r){if(e=f(t,e),e>=t.size||0>e)return t.withMutations(function(t){0>e?Fe(t,e).set(0,r):Fe(t,0,e+1).set(e,r)});e+=t._origin;var n=t._tail,i=t._root,s=u(Ir);return e>=Ze(t._capacity)?n=Ye(n,t.__ownerID,0,e,r,s):i=Ye(i,t.__ownerID,t._level,e,r,s),s.value?t.__ownerID?(t._root=i,t._tail=n,t.__hash=void 0,t.__altered=!0,t):He(t._origin,t._capacity,t._level,i,n):t}function Ye(t,e,r,n,i,u){var o=n>>>r&wr,a=t&&t.array.length>o;if(!a&&void 0===i)return t;var h;if(r>0){var c=t&&t.array[o],f=Ye(c,e,r-gr,n,i,u);return f===c?t:(h=Qe(t,e),h.array[o]=f,h)}return a&&t.array[o]===i?t:(s(u),h=Qe(t,e),void 0===i&&o===h.array.length-1?h.array.pop():h.array[o]=i,h)}function Qe(t,e){return e&&t&&e===t.ownerID?t:new Hn(t?t.array.slice():[],e)}function Xe(t,e){if(e>=Ze(t._capacity))return t._tail;if(1<<t._level+gr>e){for(var r=t._root,n=t._level;r&&n>0;)r=r.array[e>>>n&wr],n-=gr;return r}}function Fe(t,e,r){var n=t.__ownerID||new o,i=t._origin,u=t._capacity,s=i+e,a=void 0===r?u:0>r?u+r:i+r;if(s===i&&a===u)return t;if(s>=a)return t.clear();for(var h=t._level,c=t._root,f=0;0>s+f;)c=new Hn(c&&c.array.length?[void 0,c]:[],n),h+=gr,f+=1<<h;f&&(s+=f,i+=f,a+=f,u+=f);for(var _=Ze(u),l=Ze(a);l>=1<<h+gr;)c=new Hn(c&&c.array.length?[c]:[],n),h+=gr;var v=t._tail,p=_>l?Xe(t,a-1):l>_?new Hn([],n):v;if(v&&l>_&&u>s&&v.array.length){c=Qe(c,n);for(var d=c,y=h;y>gr;y-=gr){var g=_>>>y≀d=d.array[g]=Qe(d.array[g],n)}d.array[_>>>gr&wr]=v}if(u>a&&(p=p&&p.removeAfter(n,0,a)),s>=l)s-=l,a-=l,h=gr,c=null,p=p&&p.removeBefore(n,0,s);else if(s>i||_>l){for(f=0;c;){var m=s>>>h≀if(m!==l>>>h&wr)break;m&&(f+=(1<<h)*m),h-=gr,c=c.array[m]}c&&s>i&&(c=c.removeBefore(n,h,s-f)),c&&_>l&&(c=c.removeAfter(n,h,l-f)),f&&(s-=f,a-=f)}return t.__ownerID?(t.size=a-s,t._origin=s,t._capacity=a,t._level=h,t._root=c,t._tail=p,t.__hash=void 0,t.__altered=!0,t):He(s,a,h,c,p)}function Ge(t,e,r){for(var n=[],i=0,u=0;r.length>u;u++){var s=r[u],o=Xr(s);o.size>i&&(i=o.size),k(s)||(o=o.map(function(t){return Q(t)})),n.push(o)}return i>t.size&&(t=t.setSize(i)),_e(t,e,n)}function Ze(t){return mr>t?0:t-1>>>gr<<gr
|
||||
}function $e(t){return!(!t||!t[Xn])}function tr(t,e,r,n){var i=Object.create(Qn.prototype);return i.size=t?t.size:0,i._map=t,i._list=e,i.__ownerID=r,i.__hash=n,i}function er(){return Fn||(Fn=tr(re(),Ve()))}function rr(t,e,r){var n,i,u=t._map,s=t._list,o=u.get(e),a=void 0!==o;if(r===Sr){if(!a)return t;s.size>=mr&&s.size>=2*u.size?(i=s.filter(function(t,e){return void 0!==t&&o!==e}),n=i.toKeyedSeq().map(function(t){return t[0]}).flip().toMap(),t.__ownerID&&(n.__ownerID=i.__ownerID=t.__ownerID)):(n=u.remove(e),i=o===s.size-1?s.pop():s.set(o,void 0))}else if(a){if(r===s.get(o)[1])return t;n=u,i=s.set(o,[e,r])}else n=u.set(e,s.size),i=s.set(s.size,[e,r]);return t.__ownerID?(t.size=n.size,t._map=n,t._list=i,t.__hash=void 0,t):tr(n,i)}function nr(t){return!(!t||!t[$n])}function ir(t,e,r,n){var i=Object.create(ti);return i.size=t,i._head=e,i.__ownerID=r,i.__hash=n,i.__altered=!1,i}function ur(){return ei||(ei=ir(0))}function sr(t){return!(!t||!t[ni])}function or(t,e){return t.__ownerID?(t.size=e.size,t._map=e,t):e===t._map?t:0===e.size?t.__empty():t.__make(e)}function ar(t,e){var r=Object.create(ii);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function hr(){return ui||(ui=ar(re()))}function cr(t){return!(!t||!t[oi])}function fr(t,e){var r=Object.create(ai);return r.size=t?t.size:0,r._map=t,r.__ownerID=e,r}function _r(){return hi||(hi=fr(er()))}function lr(t,e,r){var n=Object.create(Object.getPrototypeOf(t));return n._map=e,n.__ownerID=r,n}function vr(t){return t._name||t.constructor.name}var pr=Object,dr={};dr.createClass=t,dr.superCall=e,dr.defaultSuperCall=r;var yr="delete",gr=5,mr=1<<gr,wr=mr-1,Sr={},zr={value:!1},Ir={value:!1},br=function(){try{return Object.defineProperty({},"x",{}),!0}catch(t){return!1}}(),qr="function"==typeof WeakMap&&new WeakMap,Mr=2147483647,xr=0,kr="__immutablehash__";"function"==typeof Symbol&&(kr=Symbol(kr));var Er=16,Dr=255,Or=0,Ar={},Cr=0,jr=1,Rr=2,Kr="@@iterator",Ur="function"==typeof Symbol&&Symbol.iterator,Lr=Ur||Kr,Tr=function(t){this.next=t};dr.createClass(Tr,{toString:function(){return"[Iterator]"
|
||||
}},{}),Tr.KEYS=Cr,Tr.VALUES=jr,Tr.ENTRIES=Rr;var Br=Tr.prototype;Br.inspect=Br.toSource=function(){return""+this},Br[Lr]=function(){return this};var Wr=function(t){return k(t)?t:Gr(t)},Pr=Wr;dr.createClass(Wr,{toArray:function(){h(this.size);var t=Array(this.size||0);return this.valueSeq().__iterate(function(e,r){t[r]=e}),t},toIndexedSeq:function(){return new Ln(this)},toJS:function(){return this.toSeq().map(function(t){return t&&"function"==typeof t.toJS?t.toJS():t}).__toJS()},toKeyedSeq:function(){return new Un(this,!0)},toMap:function(){return h(this.size),mn(this.toKeyedSeq())},toObject:function(){h(this.size);var t={};return this.__iterate(function(e,r){t[r]=e}),t},toOrderedMap:function(){return h(this.size),Qn(this.toKeyedSeq())},toOrderedSet:function(){return h(this.size),si(E(this)?this.valueSeq():this)},toSet:function(){return h(this.size),ri(E(this)?this.valueSeq():this)},toSetSeq:function(){return new Tn(this)},toSeq:function(){return D(this)?this.toIndexedSeq():E(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return h(this.size),Gn(E(this)?this.valueSeq():this)},toList:function(){return h(this.size),Wn(E(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(t,e){return 0===this.size?t+e:t+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+e},concat:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];return je(this,ke(this,t))},contains:function(t){return this.some(function(e){return n(e,t)})},entries:function(){return this.__iterator(Rr)},every:function(t,e){var r=!0;return this.__iterate(function(n,i,u){return t.call(e,n,i,u)?void 0:(r=!1,!1)}),r},filter:function(t,e){return je(this,Se(this,t,e,!0))},find:function(t,e,r){var n=r;return this.__iterate(function(r,i,u){return t.call(e,r,i,u)?(n=r,!1):void 0}),n},forEach:function(t,e){return this.__iterate(e?t.bind(e):t)},join:function(t){t=void 0!==t?""+t:",";var e="",r=!0;return this.__iterate(function(n){r?r=!1:e+=t,e+=null!==n&&void 0!==n?n:""}),e},keys:function(){return this.__iterator(Cr)
|
||||
},map:function(t,e){return je(this,me(this,t,e))},reduce:function(t,e,r){var n,i;return 2>arguments.length?i=!0:n=e,this.__iterate(function(e,u,s){i?(i=!1,n=e):n=t.call(r,n,e,u,s)}),n},reduceRight:function(){var t=this.toKeyedSeq().reverse();return t.reduce.apply(t,arguments)},reverse:function(){return je(this,we(this,!0))},slice:function(t,e){if(l(t,e,this.size))return this;var r=v(t,this.size),n=p(e,this.size);if(r!==r||n!==n)return this.toSeq().cacheResult().slice(t,e);var i=0===r?this:this.skip(r);return je(this,void 0===n||n===this.size?i:i.take(n-r))},some:function(t,e){return!this.every(j(t),e)},sort:function(t){return je(this,Ae(this,t))},values:function(){return this.__iterator(jr)},butLast:function(){return this.slice(0,-1)},count:function(t,e){return c(t?this.toSeq().filter(t,e):this)},countBy:function(t,e){return ze(this,t,e)},equals:function(t){if(this===t)return!0;if(!t||"function"!=typeof t.equals)return!1;if(void 0!==this.size&&void 0!==t.size){if(this.size!==t.size)return!1;if(0===this.size&&0===t.size)return!0}return void 0!==this.__hash&&void 0!==t.__hash&&this.__hash!==t.__hash?!1:this.__deepEquals(t)},__deepEquals:function(t){var e=this.entries();return"function"==typeof t.every&&t.every(function(t,r){var i=e.next().value;return i&&n(i[0],r)&&n(i[1],t)})&&e.next().done},entrySeq:function(){var t=this;if(t._cache)return new on(t._cache);var e=t.toSeq().map(C).toIndexedSeq();return e.fromEntrySeq=function(){return t.toSeq()},e},filterNot:function(t,e){return this.filter(j(t),e)},findLast:function(t,e,r){return this.toKeyedSeq().reverse().find(t,e,r)},first:function(){return this.find(_)},flatMap:function(t,e){return je(this,De(this,t,e))},flatten:function(t){return je(this,Ee(this,t,!0))},fromEntrySeq:function(){return new Bn(this)},get:function(t,e){return this.find(function(e,r){return n(r,t)},void 0,e)},getIn:function(t,e){var r=this;if(t)for(var n=0;t.length>n;n++)if(r=r&&r.get?r.get(t[n],Sr):Sr,r===Sr)return e;return r},groupBy:function(t,e){return Ie(this,t,e)},has:function(t){return this.get(t,Sr)!==Sr
|
||||
},isSubset:function(t){return t="function"==typeof t.contains?t:Pr(t),this.every(function(e){return t.contains(e)})},isSuperset:function(t){return t.isSubset(this)},keySeq:function(){return this.toSeq().map(A).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},max:function(t){return Ce(this,t)},maxBy:function(t,e){return Ce(this,e,t)},min:function(t){return Ce(this,t?R(t):U)},minBy:function(t,e){return Ce(this,e?R(e):U,t)},rest:function(){return this.slice(1)},skip:function(t){return je(this,Me(this,t,!0))},skipLast:function(t){return je(this,this.toSeq().reverse().skip(t).reverse())},skipWhile:function(t,e){return je(this,xe(this,t,e,!0))},skipUntil:function(t,e){return this.skipWhile(j(t),e)},sortBy:function(t,e){return je(this,Ae(this,e,t))},take:function(t){return je(this,be(this,t))},takeLast:function(t){return je(this,this.toSeq().reverse().take(t).reverse())},takeWhile:function(t,e){return je(this,qe(this,t,e))},takeUntil:function(t,e){return this.takeWhile(j(t),e)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=1/0===this.size?0:this.reduce(function(t,e,r){return t+(y(e)^(e===r?0:y(r)))&Mr},0))}},{});var Jr="@@__IMMUTABLE_ITERABLE__@@",Hr="@@__IMMUTABLE_KEYED__@@",Vr="@@__IMMUTABLE_INDEXED__@@",Nr=Wr.prototype;Nr[Jr]=!0,Nr[Lr]=Nr.values,Nr.toJSON=Nr.toJS,Nr.__toJS=Nr.toArray,Nr.__toStringMapper=K,Nr.inspect=Nr.toSource=function(){return""+this},Nr.chain=Nr.flatMap,function(){try{Object.defineProperty(Nr,"length",{get:function(){if(!Wr.noLengthWarning){var t;try{throw Error()}catch(e){t=e.stack}if(-1===t.indexOf("_wrapObject"))return console&&console.warn&&console.warn("iterable.length has been deprecated, use iterable.size or iterable.count(). This warning will become a silent error in a future version. "+t),this.size}}})}catch(t){}}();var Yr=function(t){return E(t)?t:$r(t)};dr.createClass(Yr,{flip:function(){return je(this,ge(this))},findKey:function(t,e){var r;return this.__iterate(function(n,i,u){return t.call(e,n,i,u)?(r=i,!1):void 0
|
||||
}),r},findLastKey:function(t,e){return this.toSeq().reverse().findKey(t,e)},keyOf:function(t){return this.findKey(function(e){return n(e,t)})},lastKeyOf:function(t){return this.toSeq().reverse().keyOf(t)},mapEntries:function(t,e){var r=this,n=0;return je(this,this.toSeq().map(function(i,u){return t.call(e,[u,i],n++,r)}).fromEntrySeq())},mapKeys:function(t,e){var r=this;return je(this,this.toSeq().flip().map(function(n,i){return t.call(e,n,i,r)}).flip())}},{},Wr);var Qr=Yr.prototype;Qr[Hr]=!0,Qr[Lr]=Nr.entries,Qr.__toJS=Nr.toObject,Qr.__toStringMapper=function(t,e){return e+": "+K(t)};var Xr=function(t){return D(t)?t:en(t)};dr.createClass(Xr,{toKeyedSeq:function(){return new Un(this,!1)},filter:function(t,e){return je(this,Se(this,t,e,!1))},findIndex:function(t,e){var r=this.toKeyedSeq().findKey(t,e);return void 0===r?-1:r},indexOf:function(t){var e=this.toKeyedSeq().keyOf(t);return void 0===e?-1:e},lastIndexOf:function(t){var e=this.toKeyedSeq().lastKeyOf(t);return void 0===e?-1:e},reverse:function(){return je(this,we(this,!1))},splice:function(t,e){var r=arguments.length;if(e=Math.max(0|e,0),0===r||2===r&&!e)return this;t=v(t,this.size);var n=this.slice(0,t);return je(this,1===r?n:n.concat(a(arguments,2),this.slice(t+e)))},findLastIndex:function(t,e){var r=this.toKeyedSeq().findLastKey(t,e);return void 0===r?-1:r},first:function(){return this.get(0)},flatten:function(t){return je(this,Ee(this,t,!1))},get:function(t,e){return t=f(this,t),0>t||1/0===this.size||void 0!==this.size&&t>this.size?e:this.find(function(e,r){return r===t},void 0,e)},has:function(t){return t=f(this,t),t>=0&&(void 0!==this.size?1/0===this.size||this.size>t:-1!==this.indexOf(t))},interpose:function(t){return je(this,Oe(this,t))},last:function(){return this.get(-1)},skip:function(t){var e=this,r=Me(e,t,!1);return T(e)&&r!==e&&(r.get=function(r,n){return r=f(this,r),r>=0?e.get(r+t,n):n}),je(this,r)},skipWhile:function(t,e){return je(this,xe(this,t,e,!1))},take:function(t){var e=this,r=be(e,t);return T(e)&&r!==e&&(r.get=function(r,n){return r=f(this,r),r>=0&&t>r?e.get(r,n):n
|
||||
}),je(this,r)}},{},Wr),Xr.prototype[Vr]=!0;var Fr=function(t){return k(t)&&!O(t)?t:nn(t)};dr.createClass(Fr,{get:function(t,e){return this.has(t)?t:e},contains:function(t){return this.has(t)},keySeq:function(){return this.valueSeq()}},{},Wr),Fr.prototype.has=Nr.contains,Wr.isIterable=k,Wr.isKeyed=E,Wr.isIndexed=D,Wr.isAssociative=O,Wr.Keyed=Yr,Wr.Indexed=Xr,Wr.Set=Fr,Wr.Iterator=Tr;var Gr=function(t){return null===t||void 0===t?B():k(t)?t.toSeq():J(t)},Zr=Gr;dr.createClass(Gr,{toSeq:function(){return this},toString:function(){return this.__toString("Seq {","}")},cacheResult:function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},__iterate:function(t,e){return N(this,t,e,!0)},__iterator:function(t,e){return Y(this,t,e,!0)}},{of:function(){return Zr(arguments)}},Wr);var $r=function(t){return null===t||void 0===t?B().toKeyedSeq():k(t)?E(t)?t.toSeq():t.fromEntrySeq():W(t)},tn=$r;dr.createClass($r,{toKeyedSeq:function(){return this},toSeq:function(){return this}},{of:function(){return tn(arguments)}},Gr),L($r,Yr.prototype);var en=function(t){return null===t||void 0===t?B():k(t)?E(t)?t.entrySeq():t.toIndexedSeq():P(t)},rn=en;dr.createClass(en,{toIndexedSeq:function(){return this},toString:function(){return this.__toString("Seq [","]")},__iterate:function(t,e){return N(this,t,e,!1)},__iterator:function(t,e){return Y(this,t,e,!1)}},{of:function(){return rn(arguments)}},Gr),L(en,Xr.prototype);var nn=function(t){return(null===t||void 0===t?B():k(t)?E(t)?t.entrySeq():t:P(t)).toSetSeq()},un=nn;dr.createClass(nn,{toSetSeq:function(){return this}},{of:function(){return un(arguments)}},Gr),L(nn,Fr.prototype),Gr.isSeq=T,Gr.Keyed=$r,Gr.Set=nn,Gr.Indexed=en;var sn="@@__IMMUTABLE_SEQ__@@";Gr.prototype[sn]=!0;var on=function(t){this._array=t,this.size=t.length};dr.createClass(on,{get:function(t,e){return this.has(t)?this._array[f(this,t)]:e},__iterate:function(t,e){for(var r=this._array,n=r.length-1,i=0;n>=i;i++)if(t(r[e?n-i:i],i,this)===!1)return i+1;return i},__iterator:function(t,e){var r=this._array,n=r.length-1,i=0;
|
||||
return new Tr(function(){return i>n?I():z(t,i,r[e?n-i++:i++])})}},{},en);var an=function(t){var e=Object.keys(t);this._object=t,this._keys=e,this.size=e.length};dr.createClass(an,{get:function(t,e){return void 0===e||this.has(t)?this._object[t]:e},has:function(t){return this._object.hasOwnProperty(t)},__iterate:function(t,e){for(var r=this._object,n=this._keys,i=n.length-1,u=0;i>=u;u++){var s=n[e?i-u:u];if(t(r[s],s,this)===!1)return u+1}return u},__iterator:function(t,e){var r=this._object,n=this._keys,i=n.length-1,u=0;return new Tr(function(){var s=n[e?i-u:u];return u++>i?I():z(t,s,r[s])})}},{},$r);var hn=function(t){this._iterable=t,this.size=t.length||t.size};dr.createClass(hn,{__iterateUncached:function(t,e){if(e)return this.cacheResult().__iterate(t,e);var r=this._iterable,n=M(r),i=0;if(q(n))for(var u;!(u=n.next()).done&&t(u.value,i++,this)!==!1;);return i},__iteratorUncached:function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterable,n=M(r);if(!q(n))return new Tr(I);var i=0;return new Tr(function(){var e=n.next();return e.done?e:z(t,i++,e.value)})}},{},en);var cn=function(t){this._iterator=t,this._iteratorCache=[]};dr.createClass(cn,{__iterateUncached:function(t,e){if(e)return this.cacheResult().__iterate(t,e);for(var r=this._iterator,n=this._iteratorCache,i=0;n.length>i;)if(t(n[i],i++,this)===!1)return i;for(var u;!(u=r.next()).done;){var s=u.value;if(n[i]=s,t(s,i++,this)===!1)break}return i},__iteratorUncached:function(t,e){if(e)return this.cacheResult().__iterator(t,e);var r=this._iterator,n=this._iteratorCache,i=0;return new Tr(function(){if(i>=n.length){var e=r.next();if(e.done)return e;n[i]=e.value}return z(t,i,n[i++])})}},{},en);var fn,_n=function(){throw TypeError("Abstract")};dr.createClass(_n,{},{},Wr);var ln=function(){dr.defaultSuperCall(this,vn.prototype,arguments)},vn=ln;dr.createClass(ln,{},{},_n),L(ln,Yr.prototype);var pn=function(){dr.defaultSuperCall(this,dn.prototype,arguments)},dn=pn;dr.createClass(pn,{},{},_n),L(pn,Xr.prototype);var yn=function(){dr.defaultSuperCall(this,gn.prototype,arguments)
|
||||
},gn=yn;dr.createClass(yn,{},{},_n),L(yn,Fr.prototype),_n.Keyed=ln,_n.Indexed=pn,_n.Set=yn;var mn=function(t){return null===t||void 0===t?re():Z(t)?t:re().merge(Yr(t))};dr.createClass(mn,{toString:function(){return this.__toString("Map {","}")},get:function(t,e){return this._root?this._root.get(0,void 0,t,e):e},set:function(t,e){return ne(this,t,e)},setIn:function(t,e){return i(t.length>0,"Requires non-empty key path."),this.updateIn(t,function(){return e})},remove:function(t){return ne(this,t,Sr)},removeIn:function(t){return i(t.length>0,"Requires non-empty key path."),this.updateIn(t,function(){return Sr})},update:function(t,e,r){return 1===arguments.length?t(this):this.updateIn([t],e,r)},updateIn:function(t,e,r){return r||(r=e,e=void 0),0===t.length?r(this):le(this,t,e,r,0)},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):re()},merge:function(){return ce(this,void 0,arguments)},mergeWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return ce(this,t,e)},mergeDeep:function(){return ce(this,fe(void 0),arguments)},mergeDeepWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return ce(this,fe(t),e)},sort:function(t){return Qn(Ae(this,t))},sortBy:function(t,e){return Qn(Ae(this,e,t))},withMutations:function(t){var e=this.asMutable();return t(e),e.wasAltered()?e.__ensureOwner(this.__ownerID):this},asMutable:function(){return this.__ownerID?this:this.__ensureOwner(new o)},asImmutable:function(){return this.__ensureOwner()},wasAltered:function(){return this.__altered},__iterator:function(t,e){return new An(this,t,e)},__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},__ensureOwner:function(t){return t===this.__ownerID?this:t?ee(this.size,this._root,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)}},{},ln),mn.isMap=Z;var wn="@@__IMMUTABLE_MAP__@@",Sn=mn.prototype;Sn[wn]=!0,Sn[yr]=Sn.remove;var zn=function(t,e){this.ownerID=t,this.entries=e
|
||||
},In=zn;dr.createClass(zn,{get:function(t,e,r,i){for(var u=this.entries,s=0,o=u.length;o>s;s++)if(n(r,u[s][0]))return u[s][1];return i},update:function(t,e,r,i,u,o,h){for(var c=u===Sr,f=this.entries,_=0,l=f.length;l>_&&!n(i,f[_][0]);_++);var v=l>_;if(v?f[_][1]===u:c)return this;if(s(h),(c||!v)&&s(o),!c||1!==f.length){if(!v&&!c&&f.length>=jn)return oe(t,f,i,u);var p=t&&t===this.ownerID,d=p?f:a(f);return v?c?_===l-1?d.pop():d[_]=d.pop():d[_]=[i,u]:d.push([i,u]),p?(this.entries=d,this):new In(t,d)}}},{});var bn=function(t,e,r){this.ownerID=t,this.bitmap=e,this.nodes=r},qn=bn;dr.createClass(bn,{get:function(t,e,r,n){void 0===e&&(e=y(r));var i=1<<((0===t?e:e>>>t)&wr),u=this.bitmap;return 0===(u&i)?n:this.nodes[ve(u&i-1)].get(t+gr,e,r,n)},update:function(t,e,r,n,i,u,s){void 0===r&&(r=y(n));var o=(0===e?r:r>>>e)&wr,a=1<<o,h=this.bitmap,c=0!==(h&a);if(!c&&i===Sr)return this;var f=ve(h&a-1),_=this.nodes,l=c?_[f]:void 0,v=ie(l,t,e+gr,r,n,i,u,s);if(v===l)return this;if(!c&&v&&_.length>=Rn)return he(t,_,h,o,v);if(c&&!v&&2===_.length&&ue(_[1^f]))return _[1^f];if(c&&v&&1===_.length&&ue(v))return v;var p=t&&t===this.ownerID,d=c?v?h:h^a:h|a,g=c?v?pe(_,f,v,p):ye(_,f,p):de(_,f,v,p);return p?(this.bitmap=d,this.nodes=g,this):new qn(t,d,g)}},{});var Mn=function(t,e,r){this.ownerID=t,this.count=e,this.nodes=r},xn=Mn;dr.createClass(Mn,{get:function(t,e,r,n){void 0===e&&(e=y(r));var i=(0===t?e:e>>>t)&wr,u=this.nodes[i];return u?u.get(t+gr,e,r,n):n},update:function(t,e,r,n,i,u,s){void 0===r&&(r=y(n));var o=(0===e?r:r>>>e)&wr,a=i===Sr,h=this.nodes,c=h[o];if(a&&!c)return this;var f=ie(c,t,e+gr,r,n,i,u,s);if(f===c)return this;var _=this.count;if(c){if(!f&&(_--,Kn>_))return ae(t,h,_,o)}else _++;var l=t&&t===this.ownerID,v=pe(h,o,f,l);return l?(this.count=_,this.nodes=v,this):new xn(t,_,v)}},{});var kn=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entries=r},En=kn;dr.createClass(kn,{get:function(t,e,r,i){for(var u=this.entries,s=0,o=u.length;o>s;s++)if(n(r,u[s][0]))return u[s][1];return i},update:function(t,e,r,i,u,o,h){void 0===r&&(r=y(i));
|
||||
var c=u===Sr;if(r!==this.keyHash)return c?this:(s(h),s(o),se(this,t,e,r,[i,u]));for(var f=this.entries,_=0,l=f.length;l>_&&!n(i,f[_][0]);_++);var v=l>_;if(v?f[_][1]===u:c)return this;if(s(h),(c||!v)&&s(o),c&&2===l)return new Dn(t,this.keyHash,f[1^_]);var p=t&&t===this.ownerID,d=p?f:a(f);return v?c?_===l-1?d.pop():d[_]=d.pop():d[_]=[i,u]:d.push([i,u]),p?(this.entries=d,this):new En(t,this.keyHash,d)}},{});var Dn=function(t,e,r){this.ownerID=t,this.keyHash=e,this.entry=r},On=Dn;dr.createClass(Dn,{get:function(t,e,r,i){return n(r,this.entry[0])?this.entry[1]:i},update:function(t,e,r,i,u,o,a){var h=u===Sr,c=n(i,this.entry[0]);return(c?u===this.entry[1]:h)?this:(s(a),h?void s(o):c?t&&t===this.ownerID?(this.entry[1]=u,this):new On(t,this.keyHash,[i,u]):(s(o),se(this,t,e,y(i),[i,u])))}},{}),zn.prototype.iterate=kn.prototype.iterate=function(t,e){for(var r=this.entries,n=0,i=r.length-1;i>=n;n++)if(t(r[e?i-n:n])===!1)return!1},bn.prototype.iterate=Mn.prototype.iterate=function(t,e){for(var r=this.nodes,n=0,i=r.length-1;i>=n;n++){var u=r[e?i-n:n];if(u&&u.iterate(t,e)===!1)return!1}},Dn.prototype.iterate=function(t){return t(this.entry)};var An=function(t,e,r){this._type=e,this._reverse=r,this._stack=t._root&&te(t._root)};dr.createClass(An,{next:function(){for(var t=this._type,e=this._stack;e;){var r,n=e.node,i=e.index++;if(n.entry){if(0===i)return $(t,n.entry)}else if(n.entries){if(r=n.entries.length-1,r>=i)return $(t,n.entries[this._reverse?r-i:i])}else if(r=n.nodes.length-1,r>=i){var u=n.nodes[this._reverse?r-i:i];if(u){if(u.entry)return $(t,u.entry);e=this._stack=te(u,e)}continue}e=this._stack=this._stack.__prev}return I()}},{},Tr);var Cn,jn=mr/4,Rn=mr/2,Kn=mr/4,Un=function(t,e){this._iter=t,this._useKeys=e,this.size=t.size};dr.createClass(Un,{get:function(t,e){return this._iter.get(t,e)},has:function(t){return this._iter.has(t)},valueSeq:function(){return this._iter.valueSeq()},reverse:function(){var t=this,e=we(this,!0);return this._useKeys||(e.valueSeq=function(){return t._iter.toSeq().reverse()}),e},map:function(t,e){var r=this,n=me(this,t,e);
|
||||
return this._useKeys||(n.valueSeq=function(){return r._iter.toSeq().map(t,e)}),n},__iterate:function(t,e){var r,n=this;return this._iter.__iterate(this._useKeys?function(e,r){return t(e,r,n)}:(r=e?Ke(this):0,function(i){return t(i,e?--r:r++,n)}),e)},__iterator:function(t,e){if(this._useKeys)return this._iter.__iterator(t,e);var r=this._iter.__iterator(jr,e),n=e?Ke(this):0;return new Tr(function(){var i=r.next();return i.done?i:z(t,e?--n:n++,i.value,i)})}},{},$r);var Ln=function(t){this._iter=t,this.size=t.size};dr.createClass(Ln,{contains:function(t){return this._iter.contains(t)},__iterate:function(t,e){var r=this,n=0;return this._iter.__iterate(function(e){return t(e,n++,r)},e)},__iterator:function(t,e){var r=this._iter.__iterator(jr,e),n=0;return new Tr(function(){var e=r.next();return e.done?e:z(t,n++,e.value,e)})}},{},en);var Tn=function(t){this._iter=t,this.size=t.size};dr.createClass(Tn,{has:function(t){return this._iter.contains(t)},__iterate:function(t,e){var r=this;return this._iter.__iterate(function(e){return t(e,e,r)},e)},__iterator:function(t,e){var r=this._iter.__iterator(jr,e);return new Tr(function(){var e=r.next();return e.done?e:z(t,e.value,e.value,e)})}},{},nn);var Bn=function(t){this._iter=t,this.size=t.size};dr.createClass(Bn,{entrySeq:function(){return this._iter.toSeq()},__iterate:function(t,e){var r=this;return this._iter.__iterate(function(e){return e?(Re(e),t(e[1],e[0],r)):void 0},e)},__iterator:function(t,e){var r=this._iter.__iterator(jr,e);return new Tr(function(){for(;;){var e=r.next();if(e.done)return e;var n=e.value;if(n)return Re(n),t===Rr?e:z(t,n[0],n[1],e)}})}},{},$r),Ln.prototype.cacheResult=Un.prototype.cacheResult=Tn.prototype.cacheResult=Bn.prototype.cacheResult=Te;var Wn=function(t){var e=Ve();if(null===t||void 0===t)return e;if(We(t))return t;t=Xr(t);var r=t.size;return 0===r?e:r>0&&mr>r?He(0,r,gr,null,new Hn(t.toArray())):e.merge(t)};dr.createClass(Wn,{toString:function(){return this.__toString("List [","]")},get:function(t,e){if(t=f(this,t),0>t||t>=this.size)return e;t+=this._origin;
|
||||
var r=Xe(this,t);return r&&r.array[t&wr]},set:function(t,e){return Ne(this,t,e)},remove:function(t){return this.has(t)?0===t?this.shift():t===this.size-1?this.pop():this.splice(t,1):this},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=this._origin=this._capacity=0,this._level=gr,this._root=this._tail=null,this.__hash=void 0,this.__altered=!0,this):Ve()},push:function(){var t=arguments,e=this.size;return this.withMutations(function(r){Fe(r,0,e+t.length);for(var n=0;t.length>n;n++)r.set(e+n,t[n])})},pop:function(){return Fe(this,0,-1)},unshift:function(){var t=arguments;return this.withMutations(function(e){Fe(e,-t.length);for(var r=0;t.length>r;r++)e.set(r,t[r])})},shift:function(){return Fe(this,1)},merge:function(){return Ge(this,void 0,arguments)},mergeWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return Ge(this,t,e)},mergeDeep:function(){return Ge(this,fe(void 0),arguments)},mergeDeepWith:function(t){for(var e=[],r=1;arguments.length>r;r++)e[r-1]=arguments[r];return Ge(this,fe(t),e)},setSize:function(t){return Fe(this,0,t)},slice:function(t,e){var r=this.size;return l(t,e,r)?this:Fe(this,v(t,r),p(e,r))},__iterator:function(t,e){return new Nn(this,t,e)},__iterate:function(t,e){var r=this,n=0,i=function(e){return t(e,n++,r)},u=Ze(this._capacity);return e?Pe(this._tail,0,u-this._origin,this._capacity-this._origin,i,e)&&Pe(this._root,this._level,-this._origin,u-this._origin,i,e):Pe(this._root,this._level,-this._origin,u-this._origin,i,e)&&Pe(this._tail,0,u-this._origin,this._capacity-this._origin,i,e),n},__ensureOwner:function(t){return t===this.__ownerID?this:t?He(this._origin,this._capacity,this._level,this._root,this._tail,t,this.__hash):(this.__ownerID=t,this)}},{of:function(){return this(arguments)}},pn),Wn.isList=We;var Pn="@@__IMMUTABLE_LIST__@@",Jn=Wn.prototype;Jn[Pn]=!0,Jn[yr]=Jn.remove,Jn.setIn=Sn.setIn,Jn.removeIn=Sn.removeIn,Jn.update=Sn.update,Jn.updateIn=Sn.updateIn,Jn.withMutations=Sn.withMutations,Jn.asMutable=Sn.asMutable,Jn.asImmutable=Sn.asImmutable,Jn.wasAltered=Sn.wasAltered;
|
||||
var Hn=function(t,e){this.array=t,this.ownerID=e},Vn=Hn;dr.createClass(Hn,{removeBefore:function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;var n=r>>>e≀if(n>=this.array.length)return new Vn([],t);var i,u=0===n;if(e>0){var s=this.array[n];if(i=s&&s.removeBefore(t,e-gr,r),i===s&&u)return this}if(u&&!i)return this;var o=Qe(this,t);if(!u)for(var a=0;n>a;a++)o.array[a]=void 0;return i&&(o.array[n]=i),o},removeAfter:function(t,e,r){if(r===e?1<<e:0||0===this.array.length)return this;var n=r-1>>>e≀if(n>=this.array.length)return this;var i,u=n===this.array.length-1;if(e>0){var s=this.array[n];if(i=s&&s.removeAfter(t,e-gr,r),i===s&&u)return this}if(u&&!i)return this;var o=Qe(this,t);return u||o.array.pop(),i&&(o.array[n]=i),o}},{});var Nn=function(t,e,r){this._type=e,this._reverse=!!r,this._maxIndex=t.size-1;var n=Ze(t._capacity),i=Je(t._root&&t._root.array,t._level,-t._origin,n-t._origin-1),u=Je(t._tail&&t._tail.array,0,n-t._origin,t._capacity-t._origin-1);this._stack=r?u:i,this._stack.__prev=r?i:u};dr.createClass(Nn,{next:function(){for(var t=this._stack;t;){var e=t.array,r=t.index++;if(this._reverse&&(r=wr-r,r>t.rawMax&&(r=t.rawMax,t.index=mr-r)),r>=0&&mr>r&&t.rawMax>=r){var n=e&&e[r];if(0===t.level){var i,u=this._type;return 1!==u&&(i=t.offset+(r<<t.level),this._reverse&&(i=this._maxIndex-i)),z(u,i,n)}this._stack=t=Je(n&&n.array,t.level-gr,t.offset+(r<<t.level),t.max,t)}else t=this._stack=this._stack.__prev}return I()}},{},Tr);var Yn,Qn=function(t){return null===t||void 0===t?er():$e(t)?t:er().merge(Yr(t))};dr.createClass(Qn,{toString:function(){return this.__toString("OrderedMap {","}")},get:function(t,e){var r=this._map.get(t);return void 0!==r?this._list.get(r)[1]:e},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):er()},set:function(t,e){return rr(this,t,e)},remove:function(t){return rr(this,t,Sr)},wasAltered:function(){return this._map.wasAltered()||this._list.wasAltered()},__iterate:function(t,e){var r=this;return this._list.__iterate(function(e){return e&&t(e[1],e[0],r)
|
||||
},e)},__iterator:function(t,e){return this._list.fromEntrySeq().__iterator(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t),r=this._list.__ensureOwner(t);return t?tr(e,r,t,this.__hash):(this.__ownerID=t,this._map=e,this._list=r,this)}},{of:function(){return this(arguments)}},mn),Qn.isOrderedMap=$e;var Xn="@@__IMMUTABLE_ORDERED_MAP__@@";Qn.prototype[Xn]=!0,Qn.prototype[yr]=Qn.prototype.remove;var Fn,Gn=function(t){return null===t||void 0===t?ur():nr(t)?t:ur().unshiftAll(t)},Zn=Gn;dr.createClass(Gn,{toString:function(){return this.__toString("Stack [","]")},get:function(t,e){for(var r=this._head;r&&t--;)r=r.next;return r?r.value:e},peek:function(){return this._head&&this._head.value},push:function(){if(0===arguments.length)return this;for(var t=this.size+arguments.length,e=this._head,r=arguments.length-1;r>=0;r--)e={value:arguments[r],next:e};return this.__ownerID?(this.size=t,this._head=e,this.__hash=void 0,this.__altered=!0,this):ir(t,e)},pushAll:function(t){if(t=Xr(t),0===t.size)return this;var e=this.size,r=this._head;return t.reverse().forEach(function(t){e++,r={value:t,next:r}}),this.__ownerID?(this.size=e,this._head=r,this.__hash=void 0,this.__altered=!0,this):ir(e,r)},pop:function(){return this.slice(1)},unshift:function(){return this.push.apply(this,arguments)},unshiftAll:function(t){return this.pushAll(t)},shift:function(){return this.pop.apply(this,arguments)},clear:function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):ur()},slice:function(t,e){if(l(t,e,this.size))return this;var r=v(t,this.size),n=p(e,this.size);if(n!==this.size)return dr.superCall(this,Zn.prototype,"slice",[t,e]);for(var i=this.size-r,u=this._head;r--;)u=u.next;return this.__ownerID?(this.size=i,this._head=u,this.__hash=void 0,this.__altered=!0,this):ir(i,u)},__ensureOwner:function(t){return t===this.__ownerID?this:t?ir(this.size,this._head,t,this.__hash):(this.__ownerID=t,this.__altered=!1,this)},__iterate:function(t,e){if(e)return this.toSeq().cacheResult.__iterate(t,e);
|
||||
for(var r=0,n=this._head;n&&t(n.value,r++,this)!==!1;)n=n.next;return r},__iterator:function(t,e){if(e)return this.toSeq().cacheResult().__iterator(t,e);var r=0,n=this._head;return new Tr(function(){if(n){var e=n.value;return n=n.next,z(t,r++,e)}return I()})}},{of:function(){return this(arguments)}},pn),Gn.isStack=nr;var $n="@@__IMMUTABLE_STACK__@@",ti=Gn.prototype;ti[$n]=!0,ti.withMutations=Sn.withMutations,ti.asMutable=Sn.asMutable,ti.asImmutable=Sn.asImmutable,ti.wasAltered=Sn.wasAltered;var ei,ri=function(t){return null===t||void 0===t?hr():sr(t)?t:hr().union(Fr(t))};dr.createClass(ri,{toString:function(){return this.__toString("Set {","}")},has:function(t){return this._map.has(t)},add:function(t){return or(this,this._map.set(t,!0))},remove:function(t){return or(this,this._map.remove(t))},clear:function(){return or(this,this._map.clear())},union:function(){var t=arguments;return 0===t.length?this:this.withMutations(function(e){for(var r=0;t.length>r;r++)Fr(t[r]).forEach(function(t){return e.add(t)})})},intersect:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return Fr(t)});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.every(function(t){return t.contains(r)})||e.remove(r)})})},subtract:function(){for(var t=[],e=0;arguments.length>e;e++)t[e]=arguments[e];if(0===t.length)return this;t=t.map(function(t){return Fr(t)});var r=this;return this.withMutations(function(e){r.forEach(function(r){t.some(function(t){return t.contains(r)})&&e.remove(r)})})},merge:function(){return this.union.apply(this,arguments)},mergeWith:function(){for(var t=[],e=1;arguments.length>e;e++)t[e-1]=arguments[e];return this.union.apply(this,t)},sort:function(t){return si(Ae(this,t))},sortBy:function(t,e){return si(Ae(this,e,t))},wasAltered:function(){return this._map.wasAltered()},__iterate:function(t,e){var r=this;return this._map.__iterate(function(e,n){return t(n,n,r)},e)},__iterator:function(t,e){return this._map.map(function(t,e){return e}).__iterator(t,e)
|
||||
},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map.__ensureOwner(t);return t?this.__make(e,t):(this.__ownerID=t,this._map=e,this)}},{of:function(){return this(arguments)},fromKeys:function(t){return this(Yr(t).keySeq())}},yn),ri.isSet=sr;var ni="@@__IMMUTABLE_SET__@@",ii=ri.prototype;ii[ni]=!0,ii[yr]=ii.remove,ii.mergeDeep=ii.merge,ii.mergeDeepWith=ii.mergeWith,ii.withMutations=Sn.withMutations,ii.asMutable=Sn.asMutable,ii.asImmutable=Sn.asImmutable,ii.__empty=hr,ii.__make=ar;var ui,si=function(t){return null===t||void 0===t?_r():cr(t)?t:_r().union(Fr(t))};dr.createClass(si,{toString:function(){return this.__toString("OrderedSet {","}")}},{of:function(){return this(arguments)},fromKeys:function(t){return this(Yr(t).keySeq())}},ri),si.isOrderedSet=cr;var oi="@@__IMMUTABLE_ORDERED_SET__@@",ai=si.prototype;ai[oi]=!0,ai.__empty=_r,ai.__make=fr;var hi,ci=function(t,e){var r=function(t){return this instanceof r?void(this._map=mn(t)):new r(t)},n=Object.keys(t),u=r.prototype=Object.create(fi);u.constructor=r,e&&(u._name=e),u._defaultValues=t,u._keys=n,u.size=n.length;try{n.forEach(function(t){Object.defineProperty(r.prototype,t,{get:function(){return this.get(t)},set:function(e){i(this.__ownerID,"Cannot set on an immutable record."),this.set(t,e)}})})}catch(s){}return r};dr.createClass(ci,{toString:function(){return this.__toString(vr(this)+" {","}")},has:function(t){return this._defaultValues.hasOwnProperty(t)},get:function(t,e){if(!this.has(t))return e;var r=this._defaultValues[t];return this._map?this._map.get(t,r):r},clear:function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var t=Object.getPrototypeOf(this).constructor;return t._empty||(t._empty=lr(this,re()))},set:function(t,e){if(!this.has(t))throw Error('Cannot set unknown key "'+t+'" on '+vr(this));var r=this._map&&this._map.set(t,e);return this.__ownerID||r===this._map?this:lr(this,r)},remove:function(t){if(!this.has(t))return this;var e=this._map&&this._map.remove(t);return this.__ownerID||e===this._map?this:lr(this,e)
|
||||
},wasAltered:function(){return this._map.wasAltered()},__iterator:function(t,e){var r=this;return Yr(this._defaultValues).map(function(t,e){return r.get(e)}).__iterator(t,e)},__iterate:function(t,e){var r=this;return Yr(this._defaultValues).map(function(t,e){return r.get(e)}).__iterate(t,e)},__ensureOwner:function(t){if(t===this.__ownerID)return this;var e=this._map&&this._map.__ensureOwner(t);return t?lr(this,e,t):(this.__ownerID=t,this._map=e,this)}},{},ln);var fi=ci.prototype;fi[yr]=fi.remove,fi.merge=Sn.merge,fi.mergeWith=Sn.mergeWith,fi.mergeDeep=Sn.mergeDeep,fi.mergeDeepWith=Sn.mergeDeepWith,fi.update=Sn.update,fi.updateIn=Sn.updateIn,fi.withMutations=Sn.withMutations,fi.asMutable=Sn.asMutable,fi.asImmutable=Sn.asImmutable;var _i=function(t,e,r){return this instanceof li?(i(0!==r,"Cannot step a Range by 0"),t=t||0,void 0===e&&(e=1/0),t===e&&pi?pi:(r=void 0===r?1:Math.abs(r),t>e&&(r=-r),this._start=t,this._end=e,this._step=r,void(this.size=Math.max(0,Math.ceil((e-t)/r-1)+1)))):new li(t,e,r)},li=_i;dr.createClass(_i,{toString:function(){return 0===this.size?"Range []":"Range [ "+this._start+"..."+this._end+(this._step>1?" by "+this._step:"")+" ]"},get:function(t,e){return this.has(t)?this._start+f(this,t)*this._step:e},contains:function(t){var e=(t-this._start)/this._step;return e>=0&&this.size>e&&e===Math.floor(e)},slice:function(t,e){return l(t,e,this.size)?this:(t=v(t,this.size),e=p(e,this.size),t>=e?pi:new li(this.get(t,this._end),this.get(e,this._end),this._step))},indexOf:function(t){var e=t-this._start;if(e%this._step===0){var r=e/this._step;if(r>=0&&this.size>r)return r}return-1},lastIndexOf:function(t){return this.indexOf(t)},take:function(t){return this.slice(0,Math.max(0,t))},skip:function(t){return this.slice(Math.max(0,t))},__iterate:function(t,e){for(var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,u=0;r>=u;u++){if(t(i,u,this)===!1)return u+1;i+=e?-n:n}return u},__iterator:function(t,e){var r=this.size-1,n=this._step,i=e?this._start+r*n:this._start,u=0;return new Tr(function(){var s=i;
|
||||
return i+=e?-n:n,u>r?I():z(t,u++,s)})},__deepEquals:function(t){return t instanceof li?this._start===t._start&&this._end===t._end&&this._step===t._step:dr.superCall(this,li.prototype,"__deepEquals",[t])}},{},en);var vi=_i.prototype;vi.__toJS=vi.toArray,vi.first=Jn.first,vi.last=Jn.last;var pi=_i(0,0),di=function(t,e){return 0>=e&&mi?mi:this instanceof yi?(this._value=t,this.size=void 0===e?1/0:Math.max(0,e),void(0===this.size&&(mi=this))):new yi(t,e)},yi=di;dr.createClass(di,{toString:function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},get:function(t,e){return this.has(t)?this._value:e},contains:function(t){return n(this._value,t)},slice:function(t,e){var r=this.size;return l(t,e,r)?this:new yi(this._value,p(e,r)-v(t,r))},reverse:function(){return this},indexOf:function(t){return n(this._value,t)?0:-1},lastIndexOf:function(t){return n(this._value,t)?this.size:-1},__iterate:function(t){for(var e=0;this.size>e;e++)if(t(this._value,e,this)===!1)return e+1;return e},__iterator:function(t){var e=this,r=0;return new Tr(function(){return e.size>r?z(t,r++,e._value):I()})},__deepEquals:function(t){return t instanceof yi?n(this._value,t._value):dr.superCall(this,yi.prototype,"__deepEquals",[t])}},{},en);var gi=di.prototype;gi.last=gi.first,gi.has=vi.has,gi.take=vi.take,gi.skip=vi.skip,gi.__toJS=vi.__toJS;var mi,wi={Iterable:Wr,Seq:Gr,Collection:_n,Map:mn,OrderedMap:Qn,List:Wn,Stack:Gn,Set:ri,OrderedSet:si,Record:ci,Range:_i,Repeat:di,is:n,fromJS:Q};return wi}"object"==typeof exports?module.exports=t():"function"==typeof define&&define.amd?define(t):Immutable=t();
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "immutable",
|
||||
"filename": "immutable.min.js",
|
||||
"version": "3.0.3",
|
||||
"version": "3.1.0",
|
||||
"description": "Immutable Data Collections",
|
||||
"keywords": [
|
||||
"immutable",
|
||||
|
||||
Reference in New Issue
Block a user