26 lines
66 KiB
JavaScript
26 lines
66 KiB
JavaScript
|
|
/**
|
||
|
|
* @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<<E,q=j-1,M={};function D(t){t&&(t.value=!0)}function x(){}function A(t){return void 0===t.size&&(t.size=t.__iterate(R)),t.size}function k(t,e){if("number"!=typeof e){var r=e>>>0;if(""+r!==e||4294967295===r)return NaN;e=r}return e<0?A(t)+e:e}function R(){return!0}function U(t,e,r){return(0===t&&!L(t)||void 0!==r&&t<=-r)&&(void 0===e||void 0!==r&&e>=r)}function T(t,e){return K(t,e,0)}function B(t,e){return K(t,e,e)}function K(t,e,r){return void 0===t?r:L(t)?e===1/0?e:0|Math.max(0,e+t):void 0===e||e===t?t:0|Math.min(e,t)}function L(t){return t<0||0===t&&1/t==-1/0}var C="@@__IMMUTABLE_RECORD__@@";function P(t){return Boolean(t&&t[C])}function W(t){return s(t)||P(t)}var N="@@__IMMUTABLE_ORDERED__@@";function H(t){return Boolean(t&&t[N])}var J="@@__IMMUTABLE_SEQ__@@";function V(t){return Boolean(t&&t[J])}var Y=Object.prototype.hasOwnProperty;function Q(t){return!(!Array.isArray(t)&&"string"!=typeof t)||t&&"object"==typeof t&&Number.isInteger(t.length)&&t.length>=0&&(0===t.length?1===Object.keys(t).length:t.hasOwnProperty(t.length-1))}var X=function(t){function e(t){return null==t?nt():W(t)?t.toSeq():function(t){var e=ut(t);if(e)return(n=I(r=t))&&n===r.entries?e.fromEntrySeq():function(t){var e=I(t);return e&&e===t.keys}(t)?e.toSetSeq():e;var r,n;if("object"==typeof t)return new tt(t);throw new TypeError("Expected Array or collection object of values, or keyed object: "+t)}(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toSeq=function(){return this},e.prototype.toString=function(){return this.__toString("Seq {","}")},e.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},e.prototype.__iterate=function(t,e){var r=this._cache;if(r){for(var n=r.length,i=0;i!==n;){var o=r[e?n-++i:i++];if(!1===t(o[1],o[0],this))break}return i}return this.__iterateUncached(t,e)},e.prototype.__iterator=function(t,e){var r=this._cache;if(r){var n=r.length,i=0;return new g((function(){if(i===n)return{value:void 0,done:!0};var o=r[e?n-++i:i++];return w(t,o[0],o[1])}))}return this.__iteratorUncached(t,e)},e}(a),F=function(t){function e(t){return null==t?nt().toKeyedSeq():s(t)?i(t)?t.toSeq():t.fromEntrySeq():P(t)?t.toSeq():it(t)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.toKeyedSeq=fu
|