Comparing version 6.8.3 to 6.9.0
@@ -0,1 +1,16 @@ | ||
6.9.0 | ||
- Fix slow `R.uniq` methods - [Issue #581](https://github.com/selfrefactor/rambda/issues/581) | ||
Fixing `R.uniq` was done by improving `R.indexOf` which has performance implication to all methods importing `R.indexOf`: | ||
- R.includes | ||
- R.intersection | ||
- R.difference | ||
- R.excludes | ||
- R.symmetricDifference | ||
- R.union | ||
- R.without no longer support the following case - `without('0:1', ['0', '0:1']) // => ['0']`. Now it throws as the first argument should be a list, not a string. Ramda, on the other hand, returns an empty list. | ||
6.8.3 | ||
@@ -2,0 +17,0 @@ |
@@ -616,13 +616,31 @@ function F() { | ||
function includesArray(valueToFind, input) { | ||
function _indexOf(valueToFind, list) { | ||
if (!_isArray(list)) { | ||
throw new Error(`Cannot read property 'indexOf' of ${list}`); | ||
} | ||
const typeOfValue = type(valueToFind); | ||
if (!['Object', 'Array', 'NaN', 'RegExp'].includes(typeOfValue)) return list.indexOf(valueToFind); | ||
let index = -1; | ||
let foundIndex = -1; | ||
const { | ||
length | ||
} = list; | ||
while (++index < input.length) { | ||
if (equals(input[index], valueToFind)) { | ||
return true; | ||
while (++index < length && foundIndex === -1) { | ||
if (equals(list[index], valueToFind)) { | ||
foundIndex = index; | ||
} | ||
} | ||
return false; | ||
return foundIndex; | ||
} | ||
function indexOf(valueToFind, list) { | ||
if (arguments.length === 1) { | ||
return _list => _indexOf(valueToFind, _list); | ||
} | ||
return _indexOf(valueToFind, list); | ||
} | ||
function includes(valueToFind, input) { | ||
@@ -640,17 +658,52 @@ if (arguments.length === 1) return _input => includes(valueToFind, _input); | ||
if (!_isArray(input)) return false; | ||
return includesArray(valueToFind, input); | ||
return _indexOf(valueToFind, input) > -1; | ||
} | ||
function uniq(list) { | ||
let index = -1; | ||
const willReturn = []; | ||
class _Set { | ||
constructor() { | ||
this.set = new Set(); | ||
this.items = {}; | ||
} | ||
while (++index < list.length) { | ||
const value = list[index]; | ||
checkUniqueness(item) { | ||
const type$1 = type(item); | ||
if (!includes(value, willReturn)) { | ||
willReturn.push(value); | ||
if (['Null', 'Undefined', 'NaN'].includes(type$1)) { | ||
if (type$1 in this.items) { | ||
return false; | ||
} | ||
this.items[type$1] = true; | ||
return true; | ||
} | ||
if (!['Object', 'Array'].includes(type$1)) { | ||
const prevSize = this.set.size; | ||
this.set.add(item); | ||
return this.set.size !== prevSize; | ||
} | ||
if (!(type$1 in this.items)) { | ||
this.items[type$1] = [item]; | ||
return true; | ||
} | ||
if (_indexOf(item, this.items[type$1]) === -1) { | ||
this.items[type$1].push(item); | ||
return true; | ||
} | ||
return false; | ||
} | ||
} | ||
function uniq(list) { | ||
const set = new _Set(); | ||
const willReturn = []; | ||
list.forEach(item => { | ||
if (set.checkUniqueness(item)) { | ||
willReturn.push(item); | ||
} | ||
}); | ||
return willReturn; | ||
@@ -1200,21 +1253,2 @@ } | ||
function indexOf(valueToFind, list) { | ||
if (arguments.length === 1) { | ||
return _list => indexOf(valueToFind, _list); | ||
} | ||
let index = -1; | ||
const { | ||
length | ||
} = list; | ||
while (++index < length) { | ||
if (list[index] === valueToFind) { | ||
return index; | ||
} | ||
} | ||
return -1; | ||
} | ||
function baseSlice(array, start, end) { | ||
@@ -2137,3 +2171,3 @@ let index = -1; | ||
return reduce((prev, current) => includesArray(current, matchAgainst) ? prev : prev.concat(current), [], source); | ||
return reduce((prev, current) => _indexOf(current, matchAgainst) > -1 ? prev : prev.concat(current), [], source); | ||
} | ||
@@ -2172,2 +2206,2 @@ | ||
export { F, T, add, adjust, all, allPass, always, and, any, anyPass, append, applySpec, assoc, assocPath, both, chain, clamp, clone, complement, compose, concat, cond, converge, curry, curryN, dec, defaultTo, difference, dissoc, divide, drop, dropLast, dropLastWhile, dropRepeats, dropRepeatsWith, dropWhile, either, endsWith, eqProps, equals, evolve, evolveArray, evolveObject, filter, filterArray, filterObject, find, findIndex, findLast, findLastIndex, flatten, flip, forEach, fromPairs, groupBy, groupWith, has, hasPath, head, identical, identity, ifElse, inc, includes, includesArray, indexBy, indexOf, init, intersection, intersperse, is, isEmpty, isNil, join, keys, last, lastIndexOf, length, lens, lensIndex, lensPath, lensProp, map, mapArray, mapObjIndexed, mapObject, match, mathMod, max, maxBy, maxByFn, mean, median, merge, mergeAll, mergeDeepRight, mergeLeft, min, minBy, minByFn, modulo, move, multiply, negate, none, not, nth, objOf, of, omit, once, or, over, partial, partition, partitionArray, partitionObject, path, pathEq, pathOr, paths, pick, pickAll, pipe, pluck, prepend, product, prop, propEq, propIs, propOr, props, range, reduce, reject, repeat, replace, reverse, set, slice, sort, sortBy, split, splitAt, splitEvery, splitWhen, startsWith, subtract, sum, symmetricDifference, tail, take, takeLast, takeLastWhile, takeWhile, tap, test, times, toLower, toPairs, toString, toUpper, transpose, trim, tryCatch, type, union, uniq, uniqWith, unless, update, values, view, when, where, whereEq, without, xor, zip, zipObj, zipWith }; | ||
export { F, T, _indexOf, add, adjust, all, allPass, always, and, any, anyPass, append, applySpec, assoc, assocPath, both, chain, clamp, clone, complement, compose, concat, cond, converge, curry, curryN, dec, defaultTo, difference, dissoc, divide, drop, dropLast, dropLastWhile, dropRepeats, dropRepeatsWith, dropWhile, either, endsWith, eqProps, equals, evolve, evolveArray, evolveObject, filter, filterArray, filterObject, find, findIndex, findLast, findLastIndex, flatten, flip, forEach, fromPairs, groupBy, groupWith, has, hasPath, head, identical, identity, ifElse, inc, includes, indexBy, indexOf, init, intersection, intersperse, is, isEmpty, isNil, join, keys, last, lastIndexOf, length, lens, lensIndex, lensPath, lensProp, map, mapArray, mapObjIndexed, mapObject, match, mathMod, max, maxBy, maxByFn, mean, median, merge, mergeAll, mergeDeepRight, mergeLeft, min, minBy, minByFn, modulo, move, multiply, negate, none, not, nth, objOf, of, omit, once, or, over, partial, partition, partitionArray, partitionObject, path, pathEq, pathOr, paths, pick, pickAll, pipe, pluck, prepend, product, prop, propEq, propIs, propOr, props, range, reduce, reject, repeat, replace, reverse, set, slice, sort, sortBy, split, splitAt, splitEvery, splitWhen, startsWith, subtract, sum, symmetricDifference, tail, take, takeLast, takeLastWhile, takeWhile, tap, test, times, toLower, toPairs, toString, toUpper, transpose, trim, tryCatch, type, union, uniq, uniqWith, unless, update, values, view, when, where, whereEq, without, xor, zip, zipObj, zipWith }; |
@@ -620,13 +620,31 @@ 'use strict'; | ||
function includesArray(valueToFind, input) { | ||
function _indexOf(valueToFind, list) { | ||
if (!_isArray(list)) { | ||
throw new Error(`Cannot read property 'indexOf' of ${list}`); | ||
} | ||
const typeOfValue = type(valueToFind); | ||
if (!['Object', 'Array', 'NaN', 'RegExp'].includes(typeOfValue)) return list.indexOf(valueToFind); | ||
let index = -1; | ||
let foundIndex = -1; | ||
const { | ||
length | ||
} = list; | ||
while (++index < input.length) { | ||
if (equals(input[index], valueToFind)) { | ||
return true; | ||
while (++index < length && foundIndex === -1) { | ||
if (equals(list[index], valueToFind)) { | ||
foundIndex = index; | ||
} | ||
} | ||
return false; | ||
return foundIndex; | ||
} | ||
function indexOf(valueToFind, list) { | ||
if (arguments.length === 1) { | ||
return _list => _indexOf(valueToFind, _list); | ||
} | ||
return _indexOf(valueToFind, list); | ||
} | ||
function includes(valueToFind, input) { | ||
@@ -644,17 +662,52 @@ if (arguments.length === 1) return _input => includes(valueToFind, _input); | ||
if (!_isArray(input)) return false; | ||
return includesArray(valueToFind, input); | ||
return _indexOf(valueToFind, input) > -1; | ||
} | ||
function uniq(list) { | ||
let index = -1; | ||
const willReturn = []; | ||
class _Set { | ||
constructor() { | ||
this.set = new Set(); | ||
this.items = {}; | ||
} | ||
while (++index < list.length) { | ||
const value = list[index]; | ||
checkUniqueness(item) { | ||
const type$1 = type(item); | ||
if (!includes(value, willReturn)) { | ||
willReturn.push(value); | ||
if (['Null', 'Undefined', 'NaN'].includes(type$1)) { | ||
if (type$1 in this.items) { | ||
return false; | ||
} | ||
this.items[type$1] = true; | ||
return true; | ||
} | ||
if (!['Object', 'Array'].includes(type$1)) { | ||
const prevSize = this.set.size; | ||
this.set.add(item); | ||
return this.set.size !== prevSize; | ||
} | ||
if (!(type$1 in this.items)) { | ||
this.items[type$1] = [item]; | ||
return true; | ||
} | ||
if (_indexOf(item, this.items[type$1]) === -1) { | ||
this.items[type$1].push(item); | ||
return true; | ||
} | ||
return false; | ||
} | ||
} | ||
function uniq(list) { | ||
const set = new _Set(); | ||
const willReturn = []; | ||
list.forEach(item => { | ||
if (set.checkUniqueness(item)) { | ||
willReturn.push(item); | ||
} | ||
}); | ||
return willReturn; | ||
@@ -1204,21 +1257,2 @@ } | ||
function indexOf(valueToFind, list) { | ||
if (arguments.length === 1) { | ||
return _list => indexOf(valueToFind, _list); | ||
} | ||
let index = -1; | ||
const { | ||
length | ||
} = list; | ||
while (++index < length) { | ||
if (list[index] === valueToFind) { | ||
return index; | ||
} | ||
} | ||
return -1; | ||
} | ||
function baseSlice(array, start, end) { | ||
@@ -2141,3 +2175,3 @@ let index = -1; | ||
return reduce((prev, current) => includesArray(current, matchAgainst) ? prev : prev.concat(current), [], source); | ||
return reduce((prev, current) => _indexOf(current, matchAgainst) > -1 ? prev : prev.concat(current), [], source); | ||
} | ||
@@ -2178,2 +2212,3 @@ | ||
exports.T = T; | ||
exports._indexOf = _indexOf; | ||
exports.add = add; | ||
@@ -2241,3 +2276,2 @@ exports.adjust = adjust; | ||
exports.includes = includes; | ||
exports.includesArray = includesArray; | ||
exports.indexBy = indexBy; | ||
@@ -2244,0 +2278,0 @@ exports.indexOf = indexOf; |
@@ -1,1 +0,1 @@ | ||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((n="undefined"!=typeof globalThis?globalThis:n||self).R={})}(this,function(n){"use strict";function l(n){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function e(n,r,t){return r in n?Object.defineProperty(n,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[r]=t,n}function i(n,r){return function(n){if(Array.isArray(n))return n}(n)||function(n,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(n)))return;var t=[],e=!0,u=!1,i=void 0;try{for(var o,f=n[Symbol.iterator]();!(e=(o=f.next()).done)&&(t.push(o.value),!r||t.length!==r);e=!0);}catch(n){u=!0,i=n}finally{try{e||null==f.return||f.return()}finally{if(u)throw i}}return t}(n,r)||t(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(n){return function(n){if(Array.isArray(n))return u(n)}(n)||function(n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(n))return Array.from(n)}(n)||t(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(n,r){if(n){if("string"==typeof n)return u(n,r);var t=Object.prototype.toString.call(n).slice(8,-1);return"Map"===(t="Object"===t&&n.constructor?n.constructor.name:t)||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?u(n,r):void 0}}function u(n,r){for(var t=0,e=Array(r=null==r||r>n.length?n.length:r);t<r;t++)e[t]=n[t];return e}function o(u){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];return function(){for(var n,r=arguments.length,t=Array(r),e=0;e<r;e++)t[e]=arguments[e];return(n=[].concat(h(i),t)).length<u.length?o(u,n):u.apply(void 0,h(n))}}var r=o(function(n,r,t){var e=n<0?t.length+n:n;return t.length<=n||e<0||((t=t.slice())[e]=r(t[e])),t});function f(n){return function(){return n}}function c(r,n){if(1===arguments.length)return function(n){return c(r,n)};for(var t=0;t<n.length;){if(r(n[t],t))return!0;t++}return!1}var s=Array.isArray;function p(){for(var n=[],r=0,t=arguments.length;r<t&&void 0!==arguments[r];)n[r]=arguments[r],r++;return n}var a=o(function(n,r,t){return Object.assign({},t,e({},n,r))});function g(n){return n<<0===n}var v=Number.isInteger||g;var y=o(function n(r,t,e){var u="string"==typeof r?r.split(".").map(function(n){return g(+(""+n))?+(""+n):n}):r;if(0===u.length)return t;r=u[0];if(1<u.length&&(i="object"===l(e)&&null!==e&&e.hasOwnProperty(r)?e[r]:g(u[1])?[]:{},t=n(Array.prototype.slice.call(u,1),t,i)),g(r)&&s(e)){var i=e.slice();return i[r]=t,i}return a(r,t,e)});var d=o(function(n,r,t){if(r<n)throw Error("min must not be greater than max in clamp(min, max, value)");return t<n||r<t?r<t?r:t<n?n:void 0:t});function m(r,n){return 1===arguments.length?function(n){return m(r,n)}:"string"==typeof r?"".concat(r).concat(n):[].concat(h(r),h(n))}function b(n,l){switch(n){case 0:return function(){return l.apply(this,arguments)};case 1:return function(n){return l.apply(this,arguments)};case 2:return function(n,r){return l.apply(this,arguments)};case 3:return function(n,r,t){return l.apply(this,arguments)};case 4:return function(n,r,t,e){return l.apply(this,arguments)};case 5:return function(n,r,t,e,u){return l.apply(this,arguments)};case 6:return function(n,r,t,e,u,i){return l.apply(this,arguments)};case 7:return function(n,r,t,e,u,i,o){return l.apply(this,arguments)};case 8:return function(n,r,t,e,u,i,o,f){return l.apply(this,arguments)};case 9:return function(n,r,t,e,u,i,o,f,c){return l.apply(this,arguments)};default:return function(n,r,t,e,u,i,o,f,c,a){return l.apply(this,arguments)}}}function w(r,n){if(1===arguments.length)return function(n){return w(r,n)};if(10<r)throw Error("First argument to _arity must be a non-negative integer no greater than ten");return b(r,function i(o,f,c){return function(){for(var n=0,r=0,t=f.length,e=arguments.length,u=Array(t+e);n<t;)u[n]=f[n],n++;for(;r<e;)u[t+r]=arguments[r],r++;return u.length<o?b(o-u.length,i(o,u,c)):c.apply(this,u)}}(r,[],n))}var j=Object.keys;function O(n,r){for(var t=2<arguments.length&&void 0!==arguments[2]&&arguments[2],e=0,u=Array(r.length);e<r.length;)u[e]=t?n(r[e],e):n(r[e]),e++;return u}function E(n,r){for(var t=0,e=j(r),u=e.length,i={};t<u;){var o=e[t];i[o]=n(r[o],o,r),t++}return i}var A=E;function N(r,n){return 1===arguments.length?function(n){return N(r,n)}:void 0===n?[]:(s(n)?O:E)(r,n)}function x(r,n){return 1===arguments.length?function(n){return x(r,n)}:r<n?n:r}var S=o(function(n,r,t){if(!s(t))throw new TypeError("reduce: list must be array or iterable");for(var e=0,u=t.length;e<u;)r=n(r,t[e],e,t),e++;return r});function T(r,n){return 1===arguments.length?function(n){return T(r,n)}:null==(t=n)||!0===Number.isNaN(t)?r:n;var t}function P(n){var r=l(n);if(null===n)return"Null";if(void 0===n)return"Undefined";if("boolean"===r)return"Boolean";if("number"===r)return Number.isNaN(n)?"NaN":"Number";if("string"===r)return"String";if(s(n))return"Array";if("symbol"===r)return"Symbol";if(n instanceof RegExp)return"RegExp";var t=n&&n.toString?""+n:"";return["true","false"].includes(t)?"Boolean":Number.isNaN(+(""+t))?t.startsWith("async")?"Async":"[object Promise]"===t?"Promise":"function"===r?"Function":n instanceof String?"String":"Object":"Number"}function k(n){var r=""+n.__proto__;return["Error","TypeError"].includes(r)?[r,n.message]:[]}function W(n){return n.toDateString?[!0,n.getTime()]:[!1]}function F(n){return n.constructor!==RegExp?[!1]:[!0,""+n]}function I(t,e){if(1===arguments.length)return function(n){return I(t,n)};var n=P(t);if(n!==P(e))return!1;if("Function"===n)return void 0!==t.name&&t.name===e.name;if(["NaN","Undefined","Null"].includes(n))return!0;if("Number"===n)return Object.is(-0,t)===Object.is(-0,e)&&""+t==""+e;if(["String","Boolean"].includes(n))return""+t==""+e;if("Array"===n){var r=Array.from(t),u=Array.from(e);if(""+r!=""+u)return!1;var i=!0;return r.forEach(function(n,r){i&&(n===u[r]||I(n,u[r])||(i=!1))}),i}var o=F(t),r=F(e);if(o[0])return!!r[0]&&o[1]===r[1];if(r[0])return!1;o=W(t),r=W(e);if(o[0])return!!r[0]&&o[1]===r[1];if(r[0])return!1;o=k(t),r=k(e);if(o[0])return!!r[0]&&(o[0]===r[0]&&o[1]===r[1]);if("Object"!==n)return!1;n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;var f=!0;return n.forEach(function(n){var r;f&&((r=t[n])===(n=e[n])||I(r,n)||(f=!1))}),f}function R(n,r){for(var t=-1;++t<r.length;)if(I(r[t],n))return!0;return!1}function q(r,n){if(1===arguments.length)return function(n){return q(r,n)};if("string"==typeof n)return n.includes(r);if(!n)throw new TypeError("Cannot read property 'indexOf' of ".concat(n));return!!s(n)&&R(r,n)}function B(n){for(var r=-1,t=[];++r<n.length;){var e=n[r];q(e,t)||t.push(e)}return t}function L(r,n){return 1===arguments.length?function(n){return L(r,n)}:n.slice(0<r?r:0)}var C=o(function(n,r,t){if(!r||!t)throw Error("wrong object inputs are passed to R.eqProps");return I(r[n],t[n])});function _(t,n){return O(function(n,r){return"Function"===P(t[r])?t[r](n):n},n,!0)}function M(e,n){return E(function(n,r){if("Object"!==P(n))return"Function"===P(e[r])?e[r](n):n;var t=P(e[r]);return"Function"===t?e[r](n):"Object"===t?U(e[r],n):n},n)}function U(r,n){if(1===arguments.length)return function(n){return U(r,n)};var t=P(r),e=P(n);if(e!==t)throw Error("iterableType !== rulesType");if(!["Object","Array"].includes(t))throw Error("'iterable' and 'rules' are from wrong type ".concat(t));return("Object"===e?M:_)(r,n)}function D(n,r){var t,e={};for(t in r)n(r[t],t,r)&&(e[t]=r[t]);return e}function z(n,r){for(var t=2<arguments.length&&void 0!==arguments[2]&&arguments[2],e=0,u=r.length,i=[];e<u;)(t?n(r[e],e):n(r[e]))&&i.push(r[e]),e++;return i}function J(r,n){return 1===arguments.length?function(n){return J(r,n)}:n?(s(n)?z:D)(r,n):[]}function $(r,n){if(1===arguments.length)return function(n){return $(r,n)};if(null!=n){for(var t=n,e=0,u="string"==typeof r?r.split("."):r;e<u.length;){if(null==t)return;if(null===t[u[e]])return;t=t[u[e]],e++}return t}}var G=Object.is||function(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r};var H=o(function(n,r,t){return function(){return(!0===("boolean"==typeof n?n:n.apply(void 0,arguments))?r:t).apply(void 0,arguments)}});function K(n,r,t){var e=-1,u=n.length;(t=u<t?u:t)<0&&(t+=u),u=t<r?0:t-r>>>0,r>>>=0;for(var i=Array(u);++e<u;)i[e]=n[e+r];return i}function Q(r,n){return 1===arguments.length?function(n){return Q(r,n)}:null!=n&&n.constructor===r||n instanceof r}function V(t,e){return function(n){return function(r){return n(t(r)).map(function(n){return e(n,r)})}}}function X(r,n){if(1===arguments.length)return function(n){return X(r,n)};var t=r<0?n.length+r:r;return"[object String]"===Object.prototype.toString.call(n)?n[0|t]:n[t]}var Y=o(function(n,r,t){return t.slice().fill(r,n,n+1)});function Z(r,n){return 1===arguments.length?function(n){return Z(r,n)}:n?n[r]:void 0}function nn(n,r,t){return n(t)>n(r)?t:r}var rn=o(nn);function tn(n){return n.reduce(function(n,r){return n+r},0)}function en(n){return tn(n)/n.length}function un(r,n){return 1===arguments.length?function(n){return un(r,n)}:Object.assign({},r||{},n||{})}function on(n,r,t){return n(t)<n(r)?t:r}var fn=o(on);var cn=o(function(n,r,t){if(n<0||r<0)throw Error("Rambda.move does not support negative indexes");if(t.length-1<n||t.length-1<r)return t;var e=t.slice();return e[n]=t[r],e[r]=t[n],e});function an(r,n){return 1===arguments.length?function(n){return an(r,n)}:r*n}function ln(n,r){var t;return function(){return n&&(t=n.apply(r||this,arguments),n=null),t}}function hn(r){return{x:r,map:function(n){return hn(n(r))}}}var sn=o(function(n,r,t){return n(function(n){return hn(r(n))})(t).x});function pn(e){for(var n=arguments.length,u=Array(1<n?n-1:0),r=1;r<n;r++)u[r-1]=arguments[r];var i=e.length;return function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];return u.length+r.length<i?pn.apply(void 0,[e].concat([].concat(u,r))):e.apply(void 0,u.concat(r))}}function gn(t,n){var e={},u={};return Object.entries(n).forEach(function(n){var r=i(n,2),n=r[0],r=r[1];t(r,n)?e[n]=r:u[n]=r}),[e,u]}function vn(n,r){for(var t=2<arguments.length&&void 0!==arguments[2]&&arguments[2],e=[],u=[],i=-1;i++<r.length-1;)((t?n(r[i],i):n(r[i]))?e:u).push(r[i]);return[e,u]}var yn=o(function(n,r,t){return I($(n,t),r)});var dn=o(function(n,r,t){return T(n,$(r,t))});var mn=S(an,1);var bn=o(function(n,r,t){return!!t&&t[n]===r});var wn=o(function(n,r,t){return Q(n,t[r])});var jn=o(function(n,r,t){return t?T(n,t[r]):n});function On(r,n){if(1===arguments.length)return function(n){return On(r,n)};if(Number.isNaN(+(""+r))||Number.isNaN(+(""+n)))throw new TypeError("Both arguments to range must be numbers");if(n<r)return[];for(var t=n-r,e=Array(t),u=0;u<t;u++)e[u]=r+u;return e}var En=o(function(n,r,t){return t.replace(n,r)});var An=o(function(n,r,t){return sn(n,f(r),t)});var Nn=o(function(n,r,t){return t.slice(n,r)});function xn(r,n){return 1===arguments.length?function(n){return xn(r,n)}:r<0?n.slice():"string"==typeof n?n.slice(0,r):K(n,0,r)}function Sn(n){return["Async","Function"].includes(P(n))}var Tn=function r(t){return{x:t,map:function(n){return r(t)}}};var Pn=o(function(n,r,t){return n(t)?r(t):t});var kn=o(function(t,n,e){return xn((e.length<n.length?e:n).length,n).map(function(n,r){return t(n,e[r])})});n.F=function(){return!1},n.T=function(){return!0},n.add=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:+(""+t)+ +(""+n)},n.adjust=r,n.all=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=0;e<n.length;e++)if(!t(n[e]))return!1;return!0},n.allPass=function(t){return function(n){for(var r=0;r<t.length;){if(!t[r](n))return!1;r++}return!0}},n.always=f,n.and=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t&&n},n.any=c,n.anyPass=function(t){return function(n){for(var r=0;r<t.length;){if(t[r](n))return!0;r++}return!1}},n.append=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if("string"==typeof n)return n.split("").concat(t);n=n.slice();return n.push(t),n},n.applySpec=function(n){var r=function n(r,t){var e,u=1<arguments.length&&void 0!==t?t:0;for(e in r)0!=r.hasOwnProperty(e)&&"constructor"!==e&&("object"===l(r[e])&&(u=Math.max(u,n(r[e]))),"function"==typeof r[e]&&(u=Math.max(u,r[e].length)));return u}(n);if(0===r)return function(){return{}};for(var t=arguments.length,e=Array(1<t?t-1:0),u=1;u<t;u++)e[u-1]=arguments[u];return function u(i,o,f){var n=o-f.length;if(1==n)return function(n){return u(i,o,p.apply(void 0,h(f).concat([n])))};if(2==n)return function(n,r){return u(i,o,p.apply(void 0,h(f).concat([n,r])))};if(3==n)return function(n,r,t){return u(i,o,p.apply(void 0,h(f).concat([n,r,t])))};if(4==n)return function(n,r,t,e){return u(i,o,p.apply(void 0,h(f).concat([n,r,t,e])))};if(4<n)return function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];return u(i,o,p.apply(void 0,h(f).concat(r)))};if(s(i)){for(var r=[],t=0,e=i.length;t<e;t++)"object"!==l(i[t])&&!s(i[t])||(r[t]=u(i[t],o,f)),"function"==typeof i[t]&&(r[t]=i[t].apply(i,h(f)));return r}var c,a={};for(c in i)0!=i.hasOwnProperty(c)&&"constructor"!==c&&("object"!==l(i[c])?"function"==typeof i[c]&&(a[c]=i[c].apply(i,h(f))):a[c]=u(i[c],o,f));return a}(n,r,e)},n.assoc=a,n.assocPath=y,n.both=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:function(){return t.apply(void 0,arguments)&&n.apply(void 0,arguments)}},n.chain=function r(t,n){var e;return 1===arguments.length?function(n){return r(t,n)}:(e=[]).concat.apply(e,h(n.map(t)))},n.clamp=d,n.clone=function n(r){var t,e=s(r)?Array(r.length):{};if(r&&r.getTime)return new Date(r.getTime());for(t in r){var u=r[t];e[t]="object"===l(u)&&null!==u?u.getTime?new Date(u.getTime()):n(u):u}return e},n.complement=function(n){return function(){return!n.apply(void 0,arguments)}},n.compose=function(){for(var n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];if(0===t.length)throw Error("compose requires at least one argument");return function(){var n=t.slice();if(0<n.length){for(var r=n.pop().apply(void 0,arguments);0<n.length;)r=n.pop()(r);return r}}},n.concat=m,n.cond=function(n){return function(t){var e,u=!1;return n.forEach(function(n){var r=i(n,2),n=r[1];!u&&(0,r[0])(t)&&(u=!0,e=n(t))}),e}},n.converge=function r(e,n){return 1===arguments.length?function(n){return r(e,n)}:w(S(function(n,r){return x(n,r.length)},0,n),function(){var r=arguments,t=this;return e.apply(this,N(function(n){return n.apply(t,r)},n))})},n.curry=o,n.curryN=w,n.dec=function(n){return n-1},n.defaultTo=T,n.difference=function r(t,e){return 1===arguments.length?function(n){return r(t,n)}:B(t).filter(function(n){return!q(n,e)})},n.dissoc=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(null==n)return{};var e,u={};for(e in n)u[e]=n[e];return delete u[t],u},n.divide=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t/n},n.drop=L,n.dropLast=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:0<t?n.slice(0,-t):n.slice()},n.dropLastWhile=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(0===n.length)return n;var e=s(n);if("function"!=typeof t)throw Error("'predicate' is from wrong type ".concat(l(t)));if(!e&&"string"!=typeof n)throw Error("'iterable' is from wrong type ".concat(l(n)));for(var u=!1,i=[],o=n.length;0<o;)o--,u||!1!==t(n[o])?u&&i.push(n[o]):(u=!0,i.push(n[o]));return e?i.reverse():i.reverse().join("")},n.dropRepeats=function(n){if(!s(n))throw Error("".concat(n," is not a list"));var t=[];return n.reduce(function(n,r){return I(n,r)||t.push(r),r},void 0),t},n.dropRepeatsWith=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(!s(n))throw Error("".concat(n," is not a list"));var e=[];return n.reduce(function(n,r){return void 0!==n&&t(n,r)||e.push(r),r},void 0),e},n.dropWhile=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};var e=s(n);if(!e&&"string"!=typeof n)throw Error("`iterable` is neither list nor a string");for(var u=!1,i=[],o=-1;o++<n.length-1;)u?i.push(n[o]):t(n[o])||(u=u||!0,i.push(n[o]));return e?i:i.join("")},n.either=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:function(){return!(!t.apply(void 0,arguments)&&!n.apply(void 0,arguments))}},n.endsWith=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.endsWith(t)},n.eqProps=C,n.equals=I,n.evolve=U,n.evolveArray=_,n.evolveObject=M,n.filter=J,n.filterArray=z,n.filterObject=D,n.find=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=0,u=n.length;e<u;){var i=n[e];if(t(i))return i;e++}},n.findIndex=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=n.length,u=-1;++u<e;)if(t(n[u]))return u;return-1},n.findLast=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=n.length;0<=--e;)if(t(n[e]))return n[e]},n.findLastIndex=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=n.length;0<=--e;)if(t(n[e]))return e;return-1},n.flatten=function n(r,t){for(var e=void 0===t?[]:t,u=0;u<r.length;u++)s(r[u])?n(r[u],e):e.push(r[u]);return e},n.flip=function(n){return e=n,function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];if(1===r.length)return function(n){return e(n,r[0])};if(2===r.length)return e(r[1],r[0]);if(3===r.length)return e(r[1],r[0],r[2]);if(4===r.length)return e(r[1],r[0],r[2],r[3]);throw Error("R.flip doesn't work with arity > 4")};var e},n.forEach=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(void 0!==n){if(s(n))for(var e=0,u=n.length;e<u;)t(n[e]),e++;else for(var i=0,o=j(n),f=o.length;i<f;){var c=o[i];t(n[c],c,n),i++}return n}},n.fromPairs=function(n){var r={};return n.forEach(function(n){n=i(n,2);return r[n[0]]=n[1]}),r},n.groupBy=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e={},u=0;u<n.length;u++){var i=n[u],o=t(i);e[o]||(e[o]=[]),e[o].push(i)}return e},n.groupWith=function(i,o){if(!s(o))throw new TypeError("list.reduce is not a function");var n=o.slice();if(1===o.length)return[n];var f=[],c=[];return n.reduce(function(n,r,t){if(0===t)return r;var e=i(n,r),u=0===c.length,t=t===o.length-1;return e?(u&&c.push(n),c.push(r),t&&f.push(c)):u?(f.push([n]),t&&f.push([r])):(f.push(c),t&&f.push([r]),c=[]),r},void 0),f},n.has=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:!!n&&n.hasOwnProperty(t)},n.hasPath=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:void 0!==$(t,n)},n.head=function(n){return"string"==typeof n?n[0]||"":n[0]},n.identical=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:G(t,n)},n.identity=function(n){return n},n.ifElse=H,n.inc=function(n){return n+1},n.includes=q,n.includesArray=R,n.indexBy=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if("string"==typeof t)return function(n,r){for(var t={},e=0;e<r.length;e++){var u=r[e];t[$(n,u)]=u}return t}(t,n);for(var e={},u=0;u<n.length;u++){var i=n[u];e[t(i)]=i}return e},n.indexOf=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=-1,u=n.length;++e<u;)if(n[e]===t)return e;return-1},n.init=function(n){return"string"==typeof n?n.slice(0,-1):n.length?K(n,0,-1):[]},n.intersection=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:J(function(n){return q(n,t)},n)},n.intersperse=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=-1,u=n.length,i=[];++e<u;)e===u-1?i.push(n[e]):i.push(n[e],t);return i},n.is=Q,n.isEmpty=function(n){var r=P(n);return!["Undefined","NaN","Number","Null"].includes(r)&&(!n||("Object"===r?0===Object.keys(n).length:"Array"===r&&0===n.length))},n.isNil=function(n){return null==n},n.join=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.join(t)},n.keys=function(n){return Object.keys(n)},n.last=function(n){return"string"==typeof n?n[n.length-1]||"":n[n.length-1]},n.lastIndexOf=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=n.length;0<--e;)if(I(n[e],t))return e;return-1},n.length=function(n){return!n&&""!==n||void 0===n.length?NaN:n.length},n.lens=V,n.lensIndex=function(n){return V(X(n),Y(n))},n.lensPath=function(n){return V($(n),y(n))},n.lensProp=function(n){return V(Z(n),a(n))},n.map=N,n.mapArray=O,n.mapObjIndexed=A,n.mapObject=E,n.match=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};n=n.match(t);return null===n?[]:n},n.mathMod=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:v(t)&&v(n)&&1<=n?(t%n+n)%n:NaN},n.max=x,n.maxBy=rn,n.maxByFn=nn,n.mean=en,n.median=function(n){if(0===(t=n.length))return NaN;var r=2-t%2,t=(t-r)/2;return en(Array.prototype.slice.call(n,0).sort(function(n,r){return n===r?0:n<r?-1:1}).slice(t,t+r))},n.merge=un,n.mergeAll=function(n){var r={};return N(function(n){r=un(r,n)},n),r},n.mergeDeepRight=function r(t,e){if(1===arguments.length)return function(n){return r(t,n)};var u=JSON.parse(JSON.stringify(t));return Object.keys(e).forEach(function(n){"Object"===P(e[n])&&"Object"===P(t[n])?u[n]=r(t[n],e[n]):u[n]=e[n]}),u},n.mergeLeft=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:un(n,t)},n.min=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n<t?n:t},n.minBy=fn,n.minByFn=on,n.modulo=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t%n},n.move=cn,n.multiply=an,n.negate=function(n){return-n},n.none=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=0;e<n.length;e++)if(!t(n[e]))return!0;return!1},n.not=function(n){return!n},n.nth=X,n.objOf=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:e({},t,n)},n.of=function(n){return[n]},n.omit=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(null!=n){var e,u="string"==typeof t?t.split(","):t,i={};for(e in n)u.includes(e)||(i[e]=n[e]);return i}},n.once=function(n,r){return 1!==arguments.length?ln(n,r):o(ln(n,r))},n.or=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t||n},n.over=sn,n.partial=pn,n.partition=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:(s(n)?vn:gn)(t,n)},n.partitionArray=vn,n.partitionObject=gn,n.path=$,n.pathEq=yn,n.pathOr=dn,n.paths=function r(t,e){return 1===arguments.length?function(n){return r(t,n)}:t.map(function(n){return $(n,e)})},n.pick=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(null!=n){for(var e="string"==typeof t?t.split(","):t,u={},i=0;i<e.length;)e[i]in n&&(u[e[i]]=n[e[i]]),i++;return u}},n.pickAll=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(null!=n){for(var e="string"==typeof t?t.split(","):t,u={},i=0;i<e.length;)e[i]in n?u[e[i]]=n[e[i]]:u[e[i]]=void 0,i++;return u}},n.pipe=function(){for(var n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];if(0===t.length)throw Error("pipe requires at least one argument");return function(){var n=t.slice();if(0<n.length){for(var r=n.shift().apply(void 0,arguments);0<n.length;)r=n.shift()(r);return r}}},n.pluck=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};var e=[];return N(function(n){void 0!==n[t]&&e.push(n[t])},n),e},n.prepend=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:[t].concat("string"==typeof n?n.split(""):n)},n.product=mn,n.prop=Z,n.propEq=bn,n.propIs=wn,n.propOr=jn,n.props=function r(t,e){if(1===arguments.length)return function(n){return r(t,n)};if(!s(t))throw Error("propsToPick is not a list");return O(function(n){return e[n]},t)},n.range=On,n.reduce=S,n.reject=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:J(function(n){return!t(n)},n)},n.repeat=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:Array(n).fill(t)},n.replace=En,n.reverse=function(n){return"string"==typeof n?n.split("").reverse().join(""):n.slice().reverse()},n.set=An,n.slice=Nn,n.sort=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.slice().sort(t)},n.sortBy=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.slice().sort(function(n,r){return n=t(n),r=t(r),n===r?0:n<r?-1:1})},n.split=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.split(t)},n.splitAt=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(!n)throw new TypeError("Cannot read property 'slice' of ".concat(n));if(!s(n)&&"string"!=typeof n)return[[],[]];var e,u,i=(u=n.length+t<0?0:n.length+t,u=(e=(i=t)<0)&&"Function"===P(u)?u():u,i=e||"Function"!==P(i)?i:i(),e?u:i);return[xn(i,n),L(i,n)]},n.splitEvery=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(t<1)throw Error("First argument to splitEvery must be a positive integer");for(var e=[],u=0;u<n.length;)e.push(n.slice(u,u+=t));return e},n.splitWhen=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(!n)throw new TypeError("Cannot read property 'length' of ".concat(n));for(var e=[],u=[],i=!1,o=-1;o++<n.length-1;)i?u.push(n[o]):t(n[o])?(u.push(n[o]),i=!0):e.push(n[o]);return[e,u]},n.startsWith=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.startsWith(t)},n.subtract=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t-n},n.sum=tn,n.symmetricDifference=function r(t,e){return 1===arguments.length?function(n){return r(t,n)}:m(J(function(n){return!q(n,e)},t),J(function(n){return!q(n,t)},e))},n.tail=function(n){return L(1,n)},n.take=xn,n.takeLast=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};var e=n.length;if(t<0)return n.slice();var u=e<t?e:t;return"string"==typeof n?n.slice(e-u):K(n,u=e-u,e)},n.takeLastWhile=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(0===n.length)return n;for(var e=!1,u=[],i=n.length;!e||0===i;)!1===t(n[--i])?e=!0:e||u.push(n[i]);return s(n)?u.reverse():u.reverse().join("")},n.takeWhile=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};var e=s(n);if(!e&&"string"!=typeof n)throw Error("`iterable` is neither list nor a string");for(var u=!0,i=[],o=-1;o++<n.length-1;)t(n[o])?u&&i.push(n[o]):u=u&&!1;return e?i:i.join("")},n.tap=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:(t(n),n)},n.test=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if("string"==typeof t)throw new TypeError('‘test’ requires a value of type RegExp as its first argument; received "'.concat(t,'"'));return-1!=n.search(t)},n.times=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(!Number.isInteger(n)||n<0)throw new RangeError("n must be an integer");return N(t,On(0,n))},n.toLower=function(n){return n.toLowerCase()},n.toPairs=function(n){return Object.entries(n)},n.toString=function(n){return""+n},n.toUpper=function(n){return n.toUpperCase()},n.transpose=function(n){return n.reduce(function(t,n){return n.forEach(function(n,r){return s(t[r])?t[r].push(n):t.push([n])}),t},[])},n.trim=function(n){return n.trim()},n.tryCatch=function(e,u){if(!Sn(e))throw Error("R.tryCatch | fn '".concat(e,"'"));var i=Sn(u);return function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];try{return e.apply(void 0,r)}catch(n){return i?u.apply(void 0,[n].concat(r)):u}}},n.type=P,n.union=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};var e=t.slice();return n.forEach(function(n){q(n,t)||e.push(n)}),e},n.uniq=B,n.uniqWith=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=-1,u=[];++e<n.length;)!function(){var r=n[e];c(function(n){return t(r,n)},u)||u.push(r)}();return u},n.unless=function r(t,e){return 1===arguments.length?function(n){return r(t,n)}:function(n){return t(n)?n:e(n)}},n.update=Y,n.values=function(n){return"Object"!==P(n)?[]:Object.values(n)},n.view=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t(Tn)(n).x},n.when=Pn,n.where=function r(t,n){if(void 0===n)return function(n){return r(t,n)};var e,u=!0;for(e in t){var i=t[e](n[e]);u&&!1===i&&(u=!1)}return u},n.whereEq=function r(t,e){if(1===arguments.length)return function(n){return r(t,n)};var n=J(function(n,r){return I(n,e[r])},t);return Object.keys(n).length===Object.keys(t).length},n.without=function r(t,n){return void 0===n?function(n){return r(t,n)}:S(function(n,r){return R(r,t)?n:n.concat(r)},[],n)},n.xor=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:!!t&&!n||!!n&&!t},n.zip=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=[],u=Math.min(t.length,n.length),i=0;i<u;i++)e[i]=[t[i],n[i]];return e},n.zipObj=function r(t,e){return 1===arguments.length?function(n){return r(t,n)}:xn(e.length,t).reduce(function(n,r,t){return n[r]=e[t],n},{})},n.zipWith=kn,Object.defineProperty(n,"__esModule",{value:!0})}); | ||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((n="undefined"!=typeof globalThis?globalThis:n||self).R={})}(this,function(n){"use strict";function l(n){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function u(n,r){for(var t=0;t<r.length;t++){var e=r[t];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(n,e.key,e)}}function e(n,r,t){return r in n?Object.defineProperty(n,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[r]=t,n}function i(n,r){return function(n){if(Array.isArray(n))return n}(n)||function(n,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(n)))return;var t=[],e=!0,u=!1,i=void 0;try{for(var o,f=n[Symbol.iterator]();!(e=(o=f.next()).done)&&(t.push(o.value),!r||t.length!==r);e=!0);}catch(n){u=!0,i=n}finally{try{e||null==f.return||f.return()}finally{if(u)throw i}}return t}(n,r)||t(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(n){return function(n){if(Array.isArray(n))return o(n)}(n)||function(n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(n))return Array.from(n)}(n)||t(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(n,r){if(n){if("string"==typeof n)return o(n,r);var t=Object.prototype.toString.call(n).slice(8,-1);return"Map"===(t="Object"===t&&n.constructor?n.constructor.name:t)||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?o(n,r):void 0}}function o(n,r){for(var t=0,e=Array(r=null==r||r>n.length?n.length:r);t<r;t++)e[t]=n[t];return e}function f(u){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];return function(){for(var n,r=arguments.length,t=Array(r),e=0;e<r;e++)t[e]=arguments[e];return(n=[].concat(s(i),t)).length<u.length?f(u,n):u.apply(void 0,s(n))}}var r=f(function(n,r,t){var e=n<0?t.length+n:n;return t.length<=n||e<0||((t=t.slice())[e]=r(t[e])),t});function c(n){return function(){return n}}function a(r,n){if(1===arguments.length)return function(n){return a(r,n)};for(var t=0;t<n.length;){if(r(n[t],t))return!0;t++}return!1}var h=Array.isArray;function p(){for(var n=[],r=0,t=arguments.length;r<t&&void 0!==arguments[r];)n[r]=arguments[r],r++;return n}var g=f(function(n,r,t){return Object.assign({},t,e({},n,r))});function v(n){return n<<0===n}var y=Number.isInteger||v;var d=f(function n(r,t,e){var u="string"==typeof r?r.split(".").map(function(n){return v(+(""+n))?+(""+n):n}):r;if(0===u.length)return t;r=u[0];if(1<u.length&&(i="object"===l(e)&&null!==e&&e.hasOwnProperty(r)?e[r]:v(u[1])?[]:{},t=n(Array.prototype.slice.call(u,1),t,i)),v(r)&&h(e)){var i=e.slice();return i[r]=t,i}return g(r,t,e)});var m=f(function(n,r,t){if(r<n)throw Error("min must not be greater than max in clamp(min, max, value)");return t<n||r<t?r<t?r:t<n?n:void 0:t});function b(r,n){return 1===arguments.length?function(n){return b(r,n)}:"string"==typeof r?"".concat(r).concat(n):[].concat(s(r),s(n))}function w(n,l){switch(n){case 0:return function(){return l.apply(this,arguments)};case 1:return function(n){return l.apply(this,arguments)};case 2:return function(n,r){return l.apply(this,arguments)};case 3:return function(n,r,t){return l.apply(this,arguments)};case 4:return function(n,r,t,e){return l.apply(this,arguments)};case 5:return function(n,r,t,e,u){return l.apply(this,arguments)};case 6:return function(n,r,t,e,u,i){return l.apply(this,arguments)};case 7:return function(n,r,t,e,u,i,o){return l.apply(this,arguments)};case 8:return function(n,r,t,e,u,i,o,f){return l.apply(this,arguments)};case 9:return function(n,r,t,e,u,i,o,f,c){return l.apply(this,arguments)};default:return function(n,r,t,e,u,i,o,f,c,a){return l.apply(this,arguments)}}}function j(r,n){if(1===arguments.length)return function(n){return j(r,n)};if(10<r)throw Error("First argument to _arity must be a non-negative integer no greater than ten");return w(r,function i(o,f,c){return function(){for(var n=0,r=0,t=f.length,e=arguments.length,u=Array(t+e);n<t;)u[n]=f[n],n++;for(;r<e;)u[t+r]=arguments[r],r++;return u.length<o?w(o-u.length,i(o,u,c)):c.apply(this,u)}}(r,[],n))}var O=Object.keys;function E(n,r){for(var t=2<arguments.length&&void 0!==arguments[2]&&arguments[2],e=0,u=Array(r.length);e<r.length;)u[e]=t?n(r[e],e):n(r[e]),e++;return u}function A(n,r){for(var t=0,e=O(r),u=e.length,i={};t<u;){var o=e[t];i[o]=n(r[o],o,r),t++}return i}var N=A;function x(r,n){return 1===arguments.length?function(n){return x(r,n)}:void 0===n?[]:(h(n)?E:A)(r,n)}function S(r,n){return 1===arguments.length?function(n){return S(r,n)}:r<n?n:r}var T=f(function(n,r,t){if(!h(t))throw new TypeError("reduce: list must be array or iterable");for(var e=0,u=t.length;e<u;)r=n(r,t[e],e,t),e++;return r});function k(r,n){return 1===arguments.length?function(n){return k(r,n)}:null==(t=n)||!0===Number.isNaN(t)?r:n;var t}function P(n){var r=l(n);if(null===n)return"Null";if(void 0===n)return"Undefined";if("boolean"===r)return"Boolean";if("number"===r)return Number.isNaN(n)?"NaN":"Number";if("string"===r)return"String";if(h(n))return"Array";if("symbol"===r)return"Symbol";if(n instanceof RegExp)return"RegExp";var t=n&&n.toString?""+n:"";return["true","false"].includes(t)?"Boolean":Number.isNaN(+(""+t))?t.startsWith("async")?"Async":"[object Promise]"===t?"Promise":"function"===r?"Function":n instanceof String?"String":"Object":"Number"}function R(n){var r=""+n.__proto__;return["Error","TypeError"].includes(r)?[r,n.message]:[]}function W(n){return n.toDateString?[!0,n.getTime()]:[!1]}function q(n){return n.constructor!==RegExp?[!1]:[!0,""+n]}function F(t,e){if(1===arguments.length)return function(n){return F(t,n)};var n=P(t);if(n!==P(e))return!1;if("Function"===n)return void 0!==t.name&&t.name===e.name;if(["NaN","Undefined","Null"].includes(n))return!0;if("Number"===n)return Object.is(-0,t)===Object.is(-0,e)&&""+t==""+e;if(["String","Boolean"].includes(n))return""+t==""+e;if("Array"===n){var r=Array.from(t),u=Array.from(e);if(""+r!=""+u)return!1;var i=!0;return r.forEach(function(n,r){i&&(n===u[r]||F(n,u[r])||(i=!1))}),i}var o=q(t),r=q(e);if(o[0])return!!r[0]&&o[1]===r[1];if(r[0])return!1;o=W(t),r=W(e);if(o[0])return!!r[0]&&o[1]===r[1];if(r[0])return!1;o=R(t),r=R(e);if(o[0])return!!r[0]&&(o[0]===r[0]&&o[1]===r[1]);if("Object"!==n)return!1;n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;var f=!0;return n.forEach(function(n){var r;f&&((r=t[n])===(n=e[n])||F(r,n)||(f=!1))}),f}function I(n,r){if(!h(r))throw Error("Cannot read property 'indexOf' of ".concat(r));var t=P(n);if(!["Object","Array","NaN","RegExp"].includes(t))return r.indexOf(n);for(var e=-1,u=-1,i=r.length;++e<i&&-1===u;)F(r[e],n)&&(u=e);return u}function B(r,n){if(1===arguments.length)return function(n){return B(r,n)};if("string"==typeof n)return n.includes(r);if(!n)throw new TypeError("Cannot read property 'indexOf' of ".concat(n));return!!h(n)&&-1<I(r,n)}var C=function(){function r(){!function(n){if(!(n instanceof r))throw new TypeError("Cannot call a class as a function")}(this),this.set=new Set,this.items={}}var n,t,e;return n=r,(t=[{key:"checkUniqueness",value:function(n){var r=P(n);if(["Null","Undefined","NaN"].includes(r))return!(r in this.items)&&(this.items[r]=!0);if(["Object","Array"].includes(r))return r in this.items?-1===I(n,this.items[r])&&(this.items[r].push(n),!0):(this.items[r]=[n],!0);r=this.set.size;return this.set.add(n),this.set.size!==r}}])&&u(n.prototype,t),e&&u(n,e),r}();function L(n){var r=new C,t=[];return n.forEach(function(n){r.checkUniqueness(n)&&t.push(n)}),t}function U(r,n){return 1===arguments.length?function(n){return U(r,n)}:n.slice(0<r?r:0)}var _=f(function(n,r,t){if(!r||!t)throw Error("wrong object inputs are passed to R.eqProps");return F(r[n],t[n])});function M(t,n){return E(function(n,r){return"Function"===P(t[r])?t[r](n):n},n,!0)}function z(e,n){return A(function(n,r){if("Object"!==P(n))return"Function"===P(e[r])?e[r](n):n;var t=P(e[r]);return"Function"===t?e[r](n):"Object"===t?D(e[r],n):n},n)}function D(r,n){if(1===arguments.length)return function(n){return D(r,n)};var t=P(r),e=P(n);if(e!==t)throw Error("iterableType !== rulesType");if(!["Object","Array"].includes(t))throw Error("'iterable' and 'rules' are from wrong type ".concat(t));return("Object"===e?z:M)(r,n)}function J(n,r){var t,e={};for(t in r)n(r[t],t,r)&&(e[t]=r[t]);return e}function $(n,r){for(var t=2<arguments.length&&void 0!==arguments[2]&&arguments[2],e=0,u=r.length,i=[];e<u;)(t?n(r[e],e):n(r[e]))&&i.push(r[e]),e++;return i}function G(r,n){return 1===arguments.length?function(n){return G(r,n)}:n?(h(n)?$:J)(r,n):[]}function H(r,n){if(1===arguments.length)return function(n){return H(r,n)};if(null!=n){for(var t=n,e=0,u="string"==typeof r?r.split("."):r;e<u.length;){if(null==t)return;if(null===t[u[e]])return;t=t[u[e]],e++}return t}}var K=Object.is||function(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r};var Q=f(function(n,r,t){return function(){return(!0===("boolean"==typeof n?n:n.apply(void 0,arguments))?r:t).apply(void 0,arguments)}});function V(n,r,t){var e=-1,u=n.length;(t=u<t?u:t)<0&&(t+=u),u=t<r?0:t-r>>>0,r>>>=0;for(var i=Array(u);++e<u;)i[e]=n[e+r];return i}function X(r,n){return 1===arguments.length?function(n){return X(r,n)}:null!=n&&n.constructor===r||n instanceof r}function Y(t,e){return function(n){return function(r){return n(t(r)).map(function(n){return e(n,r)})}}}function Z(r,n){if(1===arguments.length)return function(n){return Z(r,n)};var t=r<0?n.length+r:r;return"[object String]"===Object.prototype.toString.call(n)?n[0|t]:n[t]}var nn=f(function(n,r,t){return t.slice().fill(r,n,n+1)});function rn(r,n){return 1===arguments.length?function(n){return rn(r,n)}:n?n[r]:void 0}function tn(n,r,t){return n(t)>n(r)?t:r}var en=f(tn);function un(n){return n.reduce(function(n,r){return n+r},0)}function on(n){return un(n)/n.length}function fn(r,n){return 1===arguments.length?function(n){return fn(r,n)}:Object.assign({},r||{},n||{})}function cn(n,r,t){return n(t)<n(r)?t:r}var an=f(cn);var ln=f(function(n,r,t){if(n<0||r<0)throw Error("Rambda.move does not support negative indexes");if(t.length-1<n||t.length-1<r)return t;var e=t.slice();return e[n]=t[r],e[r]=t[n],e});function sn(r,n){return 1===arguments.length?function(n){return sn(r,n)}:r*n}function hn(n,r){var t;return function(){return n&&(t=n.apply(r||this,arguments),n=null),t}}function pn(r){return{x:r,map:function(n){return pn(n(r))}}}var gn=f(function(n,r,t){return n(function(n){return pn(r(n))})(t).x});function vn(e){for(var n=arguments.length,u=Array(1<n?n-1:0),r=1;r<n;r++)u[r-1]=arguments[r];var i=e.length;return function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];return u.length+r.length<i?vn.apply(void 0,[e].concat([].concat(u,r))):e.apply(void 0,u.concat(r))}}function yn(t,n){var e={},u={};return Object.entries(n).forEach(function(n){var r=i(n,2),n=r[0],r=r[1];t(r,n)?e[n]=r:u[n]=r}),[e,u]}function dn(n,r){for(var t=2<arguments.length&&void 0!==arguments[2]&&arguments[2],e=[],u=[],i=-1;i++<r.length-1;)((t?n(r[i],i):n(r[i]))?e:u).push(r[i]);return[e,u]}var mn=f(function(n,r,t){return F(H(n,t),r)});var bn=f(function(n,r,t){return k(n,H(r,t))});var wn=T(sn,1);var jn=f(function(n,r,t){return!!t&&t[n]===r});var On=f(function(n,r,t){return X(n,t[r])});var En=f(function(n,r,t){return t?k(n,t[r]):n});function An(r,n){if(1===arguments.length)return function(n){return An(r,n)};if(Number.isNaN(+(""+r))||Number.isNaN(+(""+n)))throw new TypeError("Both arguments to range must be numbers");if(n<r)return[];for(var t=n-r,e=Array(t),u=0;u<t;u++)e[u]=r+u;return e}var Nn=f(function(n,r,t){return t.replace(n,r)});var xn=f(function(n,r,t){return gn(n,c(r),t)});var Sn=f(function(n,r,t){return t.slice(n,r)});function Tn(r,n){return 1===arguments.length?function(n){return Tn(r,n)}:r<0?n.slice():"string"==typeof n?n.slice(0,r):V(n,0,r)}function kn(n){return["Async","Function"].includes(P(n))}var Pn=function r(t){return{x:t,map:function(n){return r(t)}}};var Rn=f(function(n,r,t){return n(t)?r(t):t});var Wn=f(function(t,n,e){return Tn((e.length<n.length?e:n).length,n).map(function(n,r){return t(n,e[r])})});n.F=function(){return!1},n.T=function(){return!0},n._indexOf=I,n.add=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:+(""+t)+ +(""+n)},n.adjust=r,n.all=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=0;e<n.length;e++)if(!t(n[e]))return!1;return!0},n.allPass=function(t){return function(n){for(var r=0;r<t.length;){if(!t[r](n))return!1;r++}return!0}},n.always=c,n.and=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t&&n},n.any=a,n.anyPass=function(t){return function(n){for(var r=0;r<t.length;){if(t[r](n))return!0;r++}return!1}},n.append=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if("string"==typeof n)return n.split("").concat(t);n=n.slice();return n.push(t),n},n.applySpec=function(n){var r=function n(r,t){var e,u=1<arguments.length&&void 0!==t?t:0;for(e in r)0!=r.hasOwnProperty(e)&&"constructor"!==e&&("object"===l(r[e])&&(u=Math.max(u,n(r[e]))),"function"==typeof r[e]&&(u=Math.max(u,r[e].length)));return u}(n);if(0===r)return function(){return{}};for(var t=arguments.length,e=Array(1<t?t-1:0),u=1;u<t;u++)e[u-1]=arguments[u];return function u(i,o,f){var n=o-f.length;if(1==n)return function(n){return u(i,o,p.apply(void 0,s(f).concat([n])))};if(2==n)return function(n,r){return u(i,o,p.apply(void 0,s(f).concat([n,r])))};if(3==n)return function(n,r,t){return u(i,o,p.apply(void 0,s(f).concat([n,r,t])))};if(4==n)return function(n,r,t,e){return u(i,o,p.apply(void 0,s(f).concat([n,r,t,e])))};if(4<n)return function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];return u(i,o,p.apply(void 0,s(f).concat(r)))};if(h(i)){for(var r=[],t=0,e=i.length;t<e;t++)"object"!==l(i[t])&&!h(i[t])||(r[t]=u(i[t],o,f)),"function"==typeof i[t]&&(r[t]=i[t].apply(i,s(f)));return r}var c,a={};for(c in i)0!=i.hasOwnProperty(c)&&"constructor"!==c&&("object"!==l(i[c])?"function"==typeof i[c]&&(a[c]=i[c].apply(i,s(f))):a[c]=u(i[c],o,f));return a}(n,r,e)},n.assoc=g,n.assocPath=d,n.both=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:function(){return t.apply(void 0,arguments)&&n.apply(void 0,arguments)}},n.chain=function r(t,n){var e;return 1===arguments.length?function(n){return r(t,n)}:(e=[]).concat.apply(e,s(n.map(t)))},n.clamp=m,n.clone=function n(r){var t,e=h(r)?Array(r.length):{};if(r&&r.getTime)return new Date(r.getTime());for(t in r){var u=r[t];e[t]="object"===l(u)&&null!==u?u.getTime?new Date(u.getTime()):n(u):u}return e},n.complement=function(n){return function(){return!n.apply(void 0,arguments)}},n.compose=function(){for(var n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];if(0===t.length)throw Error("compose requires at least one argument");return function(){var n=t.slice();if(0<n.length){for(var r=n.pop().apply(void 0,arguments);0<n.length;)r=n.pop()(r);return r}}},n.concat=b,n.cond=function(n){return function(t){var e,u=!1;return n.forEach(function(n){var r=i(n,2),n=r[1];!u&&(0,r[0])(t)&&(u=!0,e=n(t))}),e}},n.converge=function r(e,n){return 1===arguments.length?function(n){return r(e,n)}:j(T(function(n,r){return S(n,r.length)},0,n),function(){var r=arguments,t=this;return e.apply(this,x(function(n){return n.apply(t,r)},n))})},n.curry=f,n.curryN=j,n.dec=function(n){return n-1},n.defaultTo=k,n.difference=function r(t,e){return 1===arguments.length?function(n){return r(t,n)}:L(t).filter(function(n){return!B(n,e)})},n.dissoc=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(null==n)return{};var e,u={};for(e in n)u[e]=n[e];return delete u[t],u},n.divide=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t/n},n.drop=U,n.dropLast=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:0<t?n.slice(0,-t):n.slice()},n.dropLastWhile=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(0===n.length)return n;var e=h(n);if("function"!=typeof t)throw Error("'predicate' is from wrong type ".concat(l(t)));if(!e&&"string"!=typeof n)throw Error("'iterable' is from wrong type ".concat(l(n)));for(var u=!1,i=[],o=n.length;0<o;)o--,u||!1!==t(n[o])?u&&i.push(n[o]):(u=!0,i.push(n[o]));return e?i.reverse():i.reverse().join("")},n.dropRepeats=function(n){if(!h(n))throw Error("".concat(n," is not a list"));var t=[];return n.reduce(function(n,r){return F(n,r)||t.push(r),r},void 0),t},n.dropRepeatsWith=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(!h(n))throw Error("".concat(n," is not a list"));var e=[];return n.reduce(function(n,r){return void 0!==n&&t(n,r)||e.push(r),r},void 0),e},n.dropWhile=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};var e=h(n);if(!e&&"string"!=typeof n)throw Error("`iterable` is neither list nor a string");for(var u=!1,i=[],o=-1;o++<n.length-1;)u?i.push(n[o]):t(n[o])||(u=u||!0,i.push(n[o]));return e?i:i.join("")},n.either=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:function(){return!(!t.apply(void 0,arguments)&&!n.apply(void 0,arguments))}},n.endsWith=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.endsWith(t)},n.eqProps=_,n.equals=F,n.evolve=D,n.evolveArray=M,n.evolveObject=z,n.filter=G,n.filterArray=$,n.filterObject=J,n.find=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=0,u=n.length;e<u;){var i=n[e];if(t(i))return i;e++}},n.findIndex=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=n.length,u=-1;++u<e;)if(t(n[u]))return u;return-1},n.findLast=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=n.length;0<=--e;)if(t(n[e]))return n[e]},n.findLastIndex=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=n.length;0<=--e;)if(t(n[e]))return e;return-1},n.flatten=function n(r,t){for(var e=void 0===t?[]:t,u=0;u<r.length;u++)h(r[u])?n(r[u],e):e.push(r[u]);return e},n.flip=function(n){return e=n,function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];if(1===r.length)return function(n){return e(n,r[0])};if(2===r.length)return e(r[1],r[0]);if(3===r.length)return e(r[1],r[0],r[2]);if(4===r.length)return e(r[1],r[0],r[2],r[3]);throw Error("R.flip doesn't work with arity > 4")};var e},n.forEach=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(void 0!==n){if(h(n))for(var e=0,u=n.length;e<u;)t(n[e]),e++;else for(var i=0,o=O(n),f=o.length;i<f;){var c=o[i];t(n[c],c,n),i++}return n}},n.fromPairs=function(n){var r={};return n.forEach(function(n){n=i(n,2);return r[n[0]]=n[1]}),r},n.groupBy=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e={},u=0;u<n.length;u++){var i=n[u],o=t(i);e[o]||(e[o]=[]),e[o].push(i)}return e},n.groupWith=function(i,o){if(!h(o))throw new TypeError("list.reduce is not a function");var n=o.slice();if(1===o.length)return[n];var f=[],c=[];return n.reduce(function(n,r,t){if(0===t)return r;var e=i(n,r),u=0===c.length,t=t===o.length-1;return e?(u&&c.push(n),c.push(r),t&&f.push(c)):u?(f.push([n]),t&&f.push([r])):(f.push(c),t&&f.push([r]),c=[]),r},void 0),f},n.has=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:!!n&&n.hasOwnProperty(t)},n.hasPath=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:void 0!==H(t,n)},n.head=function(n){return"string"==typeof n?n[0]||"":n[0]},n.identical=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:K(t,n)},n.identity=function(n){return n},n.ifElse=Q,n.inc=function(n){return n+1},n.includes=B,n.indexBy=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if("string"==typeof t)return function(n,r){for(var t={},e=0;e<r.length;e++){var u=r[e];t[H(n,u)]=u}return t}(t,n);for(var e={},u=0;u<n.length;u++){var i=n[u];e[t(i)]=i}return e},n.indexOf=function(r,n){return 1===arguments.length?function(n){return I(r,n)}:I(r,n)},n.init=function(n){return"string"==typeof n?n.slice(0,-1):n.length?V(n,0,-1):[]},n.intersection=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:G(function(n){return B(n,t)},n)},n.intersperse=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=-1,u=n.length,i=[];++e<u;)e===u-1?i.push(n[e]):i.push(n[e],t);return i},n.is=X,n.isEmpty=function(n){var r=P(n);return!["Undefined","NaN","Number","Null"].includes(r)&&(!n||("Object"===r?0===Object.keys(n).length:"Array"===r&&0===n.length))},n.isNil=function(n){return null==n},n.join=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.join(t)},n.keys=function(n){return Object.keys(n)},n.last=function(n){return"string"==typeof n?n[n.length-1]||"":n[n.length-1]},n.lastIndexOf=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=n.length;0<--e;)if(F(n[e],t))return e;return-1},n.length=function(n){return!n&&""!==n||void 0===n.length?NaN:n.length},n.lens=Y,n.lensIndex=function(n){return Y(Z(n),nn(n))},n.lensPath=function(n){return Y(H(n),d(n))},n.lensProp=function(n){return Y(rn(n),g(n))},n.map=x,n.mapArray=E,n.mapObjIndexed=N,n.mapObject=A,n.match=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};n=n.match(t);return null===n?[]:n},n.mathMod=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:y(t)&&y(n)&&1<=n?(t%n+n)%n:NaN},n.max=S,n.maxBy=en,n.maxByFn=tn,n.mean=on,n.median=function(n){if(0===(t=n.length))return NaN;var r=2-t%2,t=(t-r)/2;return on(Array.prototype.slice.call(n,0).sort(function(n,r){return n===r?0:n<r?-1:1}).slice(t,t+r))},n.merge=fn,n.mergeAll=function(n){var r={};return x(function(n){r=fn(r,n)},n),r},n.mergeDeepRight=function r(t,e){if(1===arguments.length)return function(n){return r(t,n)};var u=JSON.parse(JSON.stringify(t));return Object.keys(e).forEach(function(n){"Object"===P(e[n])&&"Object"===P(t[n])?u[n]=r(t[n],e[n]):u[n]=e[n]}),u},n.mergeLeft=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:fn(n,t)},n.min=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n<t?n:t},n.minBy=an,n.minByFn=cn,n.modulo=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t%n},n.move=ln,n.multiply=sn,n.negate=function(n){return-n},n.none=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=0;e<n.length;e++)if(!t(n[e]))return!0;return!1},n.not=function(n){return!n},n.nth=Z,n.objOf=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:e({},t,n)},n.of=function(n){return[n]},n.omit=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(null!=n){var e,u="string"==typeof t?t.split(","):t,i={};for(e in n)u.includes(e)||(i[e]=n[e]);return i}},n.once=function(n,r){return 1!==arguments.length?hn(n,r):f(hn(n,r))},n.or=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t||n},n.over=gn,n.partial=vn,n.partition=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:(h(n)?dn:yn)(t,n)},n.partitionArray=dn,n.partitionObject=yn,n.path=H,n.pathEq=mn,n.pathOr=bn,n.paths=function r(t,e){return 1===arguments.length?function(n){return r(t,n)}:t.map(function(n){return H(n,e)})},n.pick=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(null!=n){for(var e="string"==typeof t?t.split(","):t,u={},i=0;i<e.length;)e[i]in n&&(u[e[i]]=n[e[i]]),i++;return u}},n.pickAll=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(null!=n){for(var e="string"==typeof t?t.split(","):t,u={},i=0;i<e.length;)e[i]in n?u[e[i]]=n[e[i]]:u[e[i]]=void 0,i++;return u}},n.pipe=function(){for(var n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];if(0===t.length)throw Error("pipe requires at least one argument");return function(){var n=t.slice();if(0<n.length){for(var r=n.shift().apply(void 0,arguments);0<n.length;)r=n.shift()(r);return r}}},n.pluck=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};var e=[];return x(function(n){void 0!==n[t]&&e.push(n[t])},n),e},n.prepend=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:[t].concat("string"==typeof n?n.split(""):n)},n.product=wn,n.prop=rn,n.propEq=jn,n.propIs=On,n.propOr=En,n.props=function r(t,e){if(1===arguments.length)return function(n){return r(t,n)};if(!h(t))throw Error("propsToPick is not a list");return E(function(n){return e[n]},t)},n.range=An,n.reduce=T,n.reject=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:G(function(n){return!t(n)},n)},n.repeat=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:Array(n).fill(t)},n.replace=Nn,n.reverse=function(n){return"string"==typeof n?n.split("").reverse().join(""):n.slice().reverse()},n.set=xn,n.slice=Sn,n.sort=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.slice().sort(t)},n.sortBy=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.slice().sort(function(n,r){return n=t(n),r=t(r),n===r?0:n<r?-1:1})},n.split=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.split(t)},n.splitAt=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(!n)throw new TypeError("Cannot read property 'slice' of ".concat(n));if(!h(n)&&"string"!=typeof n)return[[],[]];var e,u,i=(u=n.length+t<0?0:n.length+t,u=(e=(i=t)<0)&&"Function"===P(u)?u():u,i=e||"Function"!==P(i)?i:i(),e?u:i);return[Tn(i,n),U(i,n)]},n.splitEvery=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(t<1)throw Error("First argument to splitEvery must be a positive integer");for(var e=[],u=0;u<n.length;)e.push(n.slice(u,u+=t));return e},n.splitWhen=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(!n)throw new TypeError("Cannot read property 'length' of ".concat(n));for(var e=[],u=[],i=!1,o=-1;o++<n.length-1;)i?u.push(n[o]):t(n[o])?(u.push(n[o]),i=!0):e.push(n[o]);return[e,u]},n.startsWith=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.startsWith(t)},n.subtract=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t-n},n.sum=un,n.symmetricDifference=function r(t,e){return 1===arguments.length?function(n){return r(t,n)}:b(G(function(n){return!B(n,e)},t),G(function(n){return!B(n,t)},e))},n.tail=function(n){return U(1,n)},n.take=Tn,n.takeLast=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};var e=n.length;if(t<0)return n.slice();var u=e<t?e:t;return"string"==typeof n?n.slice(e-u):V(n,u=e-u,e)},n.takeLastWhile=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(0===n.length)return n;for(var e=!1,u=[],i=n.length;!e||0===i;)!1===t(n[--i])?e=!0:e||u.push(n[i]);return h(n)?u.reverse():u.reverse().join("")},n.takeWhile=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};var e=h(n);if(!e&&"string"!=typeof n)throw Error("`iterable` is neither list nor a string");for(var u=!0,i=[],o=-1;o++<n.length-1;)t(n[o])?u&&i.push(n[o]):u=u&&!1;return e?i:i.join("")},n.tap=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:(t(n),n)},n.test=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if("string"==typeof t)throw new TypeError('‘test’ requires a value of type RegExp as its first argument; received "'.concat(t,'"'));return-1!=n.search(t)},n.times=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(!Number.isInteger(n)||n<0)throw new RangeError("n must be an integer");return x(t,An(0,n))},n.toLower=function(n){return n.toLowerCase()},n.toPairs=function(n){return Object.entries(n)},n.toString=function(n){return""+n},n.toUpper=function(n){return n.toUpperCase()},n.transpose=function(n){return n.reduce(function(t,n){return n.forEach(function(n,r){return h(t[r])?t[r].push(n):t.push([n])}),t},[])},n.trim=function(n){return n.trim()},n.tryCatch=function(e,u){if(!kn(e))throw Error("R.tryCatch | fn '".concat(e,"'"));var i=kn(u);return function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];try{return e.apply(void 0,r)}catch(n){return i?u.apply(void 0,[n].concat(r)):u}}},n.type=P,n.union=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};var e=t.slice();return n.forEach(function(n){B(n,t)||e.push(n)}),e},n.uniq=L,n.uniqWith=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=-1,u=[];++e<n.length;)!function(){var r=n[e];a(function(n){return t(r,n)},u)||u.push(r)}();return u},n.unless=function r(t,e){return 1===arguments.length?function(n){return r(t,n)}:function(n){return t(n)?n:e(n)}},n.update=nn,n.values=function(n){return"Object"!==P(n)?[]:Object.values(n)},n.view=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t(Pn)(n).x},n.when=Rn,n.where=function r(t,n){if(void 0===n)return function(n){return r(t,n)};var e,u=!0;for(e in t){var i=t[e](n[e]);u&&!1===i&&(u=!1)}return u},n.whereEq=function r(t,e){if(1===arguments.length)return function(n){return r(t,n)};var n=G(function(n,r){return F(n,e[r])},t);return Object.keys(n).length===Object.keys(t).length},n.without=function r(t,n){return void 0===n?function(n){return r(t,n)}:T(function(n,r){return-1<I(r,t)?n:n.concat(r)},[],n)},n.xor=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:!!t&&!n||!!n&&!t},n.zip=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=[],u=Math.min(t.length,n.length),i=0;i<u;i++)e[i]=[t[i],n[i]];return e},n.zipObj=function r(t,e){return 1===arguments.length?function(n){return r(t,n)}:Tn(e.length,t).reduce(function(n,r,t){return n[r]=e[t],n},{})},n.zipWith=Wn,Object.defineProperty(n,"__esModule",{value:!0})}); |
@@ -1424,4 +1424,2 @@ export type RambdaTypes = "Object" | "Number" | "Boolean" | "String" | "Null" | "Array" | "RegExp" | "NaN" | "Function" | "Undefined" | "Async" | "Promise" | "Symbol"; | ||
* It returns `true` if all each property in `conditions` returns `true` when applied to corresponding property in `input` object. | ||
* | ||
* `R.equals` is used to determine equality. | ||
*/ | ||
@@ -1428,0 +1426,0 @@ export function where<T, U>(conditions: T, input: U): boolean; |
{ | ||
"name": "rambda", | ||
"version": "6.8.3", | ||
"version": "6.9.0", | ||
"scripts": { | ||
"populatedocs": "cd ../rambda-scripts && yarn populate:docs", | ||
"populatedocs:x": "cd ../rambda-scripts && yarn populate:docs:rambdax", | ||
"populatereadme": "cd ../rambda-scripts && yarn populate:readme", | ||
"populatereadme:x": "cd ../rambda-scripts && yarn populate:readme:rambdax", | ||
"out": "yarn populatedocs && yarn populatereadme && yarn immutable && yarn build", | ||
"x": "cd ../rambda-scripts&&yarn populate:docs:rambdax&&cd ../rambda-scripts&&yarn populate:readme:rambdax", | ||
"x": "yarn populatedocs:x && yarn populatereadme:x && yarn immutable:x", | ||
"github": "cd ../rambda-scripts&&yarn github", | ||
"immutable": "cd ../rambda-scripts&&yarn immutable", | ||
"immutable": "cd ../rambda-scripts&&yarn immutable:rambda", | ||
"immutable:x": "cd ../rambda-scripts&&yarn immutable:rambdax", | ||
"usedby": "cd ../rambda-scripts&&yarn usedby", | ||
@@ -21,4 +24,6 @@ "lint": "cd ../rambda-scripts&&yarn lint", | ||
"cover": "yarn typings&&yarn cover:spec", | ||
"benchmark": "cd ../rambda-scripts&&yarn benchmarks", | ||
"benchmarkx": "cd ../rambda-scripts&&yarn benchmarksx", | ||
"benchmark": "yarn populatedocs && yarn populatereadme && yarn build:main && yarn benchmark:method", | ||
"benchmark:all": "yarn populatedocs && yarn populatereadme && yarn build:main && cd ../rambda-scripts&&yarn benchmark:all", | ||
"benchmark:method": "cd ../rambda-scripts && METHOD=uniqWith yarn benchmark", | ||
"benchmarkx": "cd ../rambda-scripts&&yarn benchmarkx", | ||
"typings": "dtslint --localTs ./node_modules/typescript/lib --expectOnly ./source", | ||
@@ -71,2 +76,3 @@ "fix": "mkdir $HOME/.dts/perf -p" | ||
"src", | ||
"README.md", | ||
"CHANGELOG.md", | ||
@@ -95,6 +101,3 @@ "index.d.ts", | ||
], | ||
"bugs": { | ||
"url": "https://github.com/selfrefactor/rambda/issues" | ||
}, | ||
"homepage": "https://github.com/selfrefactor/rambda#readme" | ||
} |
import { _isArray } from './_internals/_isArray' | ||
import { equals } from './equals' | ||
import { _indexOf } from './indexOf' | ||
export function includesArray(valueToFind, input){ | ||
let index = -1 | ||
while (++index < input.length){ | ||
if (equals(input[ index ], valueToFind)){ | ||
return true | ||
} | ||
} | ||
return false | ||
} | ||
export function includes(valueToFind, input){ | ||
@@ -26,3 +14,3 @@ if (arguments.length === 1) return _input => includes(valueToFind, _input) | ||
return includesArray(valueToFind, input) | ||
return _indexOf(valueToFind, input) > -1 | ||
} |
@@ -1,16 +0,31 @@ | ||
export function indexOf(valueToFind, list){ | ||
if (arguments.length === 1){ | ||
return _list => indexOf(valueToFind, _list) | ||
import { equals } from './equals' | ||
import { type } from './type' | ||
import { _isArray } from './_internals/_isArray' | ||
export function _indexOf(valueToFind, list) { | ||
if (!_isArray(list)){ | ||
throw new Error(`Cannot read property 'indexOf' of ${list}`) | ||
} | ||
const typeOfValue = type(valueToFind) | ||
if (!['Object', 'Array', 'NaN', 'RegExp'].includes(typeOfValue)) return list.indexOf(valueToFind) | ||
let index = -1 | ||
let foundIndex = -1 | ||
const { length } = list | ||
while (++index < length){ | ||
if (list[ index ] === valueToFind){ | ||
return index | ||
while (++index < length && foundIndex === -1){ | ||
if (equals(list[index], valueToFind)){ | ||
foundIndex = index | ||
} | ||
} | ||
return -1 | ||
return foundIndex | ||
} | ||
export function indexOf(valueToFind, list){ | ||
if (arguments.length === 1){ | ||
return _list => _indexOf(valueToFind, _list) | ||
} | ||
return _indexOf(valueToFind, list) | ||
} |
@@ -1,16 +0,13 @@ | ||
import { includes } from './includes' | ||
import { _Set } from './_internals/set' | ||
export function uniq(list){ | ||
let index = -1 | ||
export function uniq(list) { | ||
const set = new _Set() | ||
const willReturn = [] | ||
while (++index < list.length){ | ||
const value = list[ index ] | ||
if (!includes(value, willReturn)){ | ||
willReturn.push(value) | ||
list.forEach(item => { | ||
if (set.checkUniqueness(item)) { | ||
willReturn.push(item) | ||
} | ||
} | ||
}) | ||
return willReturn | ||
} |
@@ -1,6 +0,6 @@ | ||
import { includesArray } from './includes' | ||
import { reduce } from './reduce' | ||
import {reduce} from './reduce' | ||
import {_indexOf} from './indexOf' | ||
export function without(matchAgainst, source){ | ||
if (source === undefined){ | ||
export function without(matchAgainst, source) { | ||
if (source === undefined) { | ||
return _source => without(matchAgainst, _source) | ||
@@ -11,3 +11,3 @@ } | ||
(prev, current) => | ||
includesArray(current, matchAgainst) ? prev : prev.concat(current), | ||
_indexOf(current, matchAgainst) > -1 ? prev : prev.concat(current), | ||
[], | ||
@@ -14,0 +14,0 @@ source |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
793831
192
10249
1
19430