: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
var args = Array(length);
for (var i = 0; i < length; i++) {
args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
while (position < arguments.length) args.push(arguments[position++]);
return executeBound(func, bound, this, this, args);
partial.placeholder = _$1;
// Create a function bound to a given object (assigning `this`, and arguments,
var bind = restArguments(function(func, context, args) {
if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function');
var bound = restArguments(function(callArgs) {
return executeBound(func, bound, context, this, args.concat(callArgs));
// Internal helper for collection methods to determine whether a collection
// should be iterated as an array or as an object.
// Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
// Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
var isArrayLike = createSizePropertyCheck(getLength);
// Internal implementation of a recursive `flatten` function.
function flatten$1(input, depth, strict, output) {
if (!depth && depth !== 0) {
return output.concat(input);
for (var i = 0, length = getLength(input); i < length; i++) {
if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) {
// Flatten current level of array or arguments object.
flatten$1(value, depth - 1, strict, output);
var j = 0, len = value.length;
while (j < len) output[idx++] = value[j++];
// Bind a number of an object's methods to that object. Remaining arguments
// are the method names to be bound. Useful for ensuring that all callbacks
// defined on an object belong to it.
var bindAll = restArguments(function(obj, keys) {
keys = flatten$1(keys, false, false);
if (index < 1) throw new Error('bindAll must be passed function names');
obj[key] = bind(obj[key], obj);
// Memoize an expensive function by storing its results.
function memoize(func, hasher) {
var memoize = function(key) {
var cache = memoize.cache;
var address = '' + (hasher ? hasher.apply(this, arguments) : key);
if (!has$1(cache, address)) cache[address] = func.apply(this, arguments);
// Delays a function for the given number of milliseconds, and then calls
// it with the arguments supplied.
var delay = restArguments(function(func, wait, args) {
return setTimeout(function() {
return func.apply(null, args);
// Defers a function, scheduling it to run after the current call stack has
var defer = partial(delay, _$1, 1);
// Returns a function, that, when invoked, will only be triggered at most once
// during a given window of time. Normally, the throttled function will run
// as much as it can, without ever going more than once per `wait` duration;
// but if you'd like to disable the execution on the leading edge, pass
// `{leading: false}`. To disable execution on the trailing edge, ditto.
function throttle(func, wait, options) {
var timeout, context, args, result;
if (!options) options = {};
previous = options.leading === false ? 0 : now();
result = func.apply(context, args);
if (!timeout) context = args = null;
var throttled = function() {
if (!previous && options.leading === false) previous = _now;
var remaining = wait - (_now - previous);
if (remaining <= 0 || remaining > wait) {
result = func.apply(context, args);
if (!timeout) context = args = null;
} else if (!timeout && options.trailing !== false) {
timeout = setTimeout(later, remaining);
throttled.cancel = function() {
timeout = context = args = null;
// When a sequence of calls of the returned function ends, the argument
// function is triggered. The end of a sequence is defined by the `wait`
// parameter. If `immediate` is passed, the argument function will be
// triggered at the beginning of the sequence instead of at the end.
function debounce(func, wait, immediate) {
var timeout, previous, args, result, context;
var passed = now() - previous;
timeout = setTimeout(later, wait - passed);
if (!immediate) result = func.apply(context, args);
// This check is needed because `func` can recursively invoke `debounced`.
if (!timeout) args = context = null;
var debounced = restArguments(function(_args) {
timeout = setTimeout(later, wait);
if (immediate) result = func.apply(context, args);
debounced.cancel = function() {
timeout = args = context = null;
// Returns the first function passed as an argument to the second,
// allowing you to adjust arguments, run code before and after, and
// conditionally execute the original function.
function wrap(func, wrapper) {
return partial(wrapper, func);
// Returns a negated version of the passed-in predicate.
function negate(predicate) {
return !predicate.apply(this, arguments);
// Returns a function that is the composition of a list of functions, each
// consuming the return value of the function that follows.
var start = args.length - 1;
var result = args[start].apply(this, arguments);
while (i--) result = args[i].call(this, result);
// Returns a function that will only be executed on and after the Nth call.
function after(times, func) {
return func.apply(this, arguments);
// Returns a function that will only be executed up to (but not including) the
function before(times, func) {
memo = func.apply(this, arguments);
if (times <= 1) func = null;
// Returns a function that will be executed at most one time, no matter how
// often you call it. Useful for lazy initialization.
var once = partial(before, 2);
// Returns the first key on an object that passes a truth test.
function findKey(obj, predicate, context) {
predicate = cb(predicate, context);
var _keys = keys(obj), key;
for (var i = 0, length = _keys.length; i < length; i++) {
if (predicate(obj[key], key, obj)) return key;
// Internal function to generate `_.findIndex` and `_.findLastIndex`.
function createPredicateIndexFinder(dir) {
return function(array, predicate, context) {
predicate = cb(predicate, context);
var length = getLength(array);
var index = dir > 0 ? 0 : length - 1;
for (; index >= 0 && index < length; index += dir) {
if (predicate(array[index], index, array)) return index;
// Returns the first index on an array-like that passes a truth test.
var findIndex = createPredicateIndexFinder(1);
// Returns the last index on an array-like that passes a truth test.
var findLastIndex = createPredicateIndexFinder(-1);
// Use a comparator function to figure out the smallest index at which
// an object should be inserted so as to maintain order. Uses binary search.
function sortedIndex(array, obj, iteratee, context) {
iteratee = cb(iteratee, context, 1);
var value = iteratee(obj);
var low = 0, high = getLength(array);
var mid = Math.floor((low + high) / 2);
if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
// Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.
function createIndexFinder(dir, predicateFind, sortedIndex) {
return function(array, item, idx) {
var i = 0, length = getLength(array);
if (typeof idx == 'number') {
i = idx >= 0 ? idx : Math.max(idx + length, i);
length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
} else if (sortedIndex && idx && length) {
idx = sortedIndex(array, item);
return array[idx] === item ? idx : -1;
idx = predicateFind(slice.call(array, i, length), isNaN$1);
return idx >= 0 ? idx + i : -1;
for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
if (array[idx] === item) return idx;
// Return the position of the first occurrence of an item in an array,
// or -1 if the item is not included in the array.
// If the array is large and already in sort order, pass `true`
// for **isSorted** to use binary search.
var indexOf = createIndexFinder(1, findIndex, sortedIndex);
// Return the position of the last occurrence of an item in an array,
// or -1 if the item is not included in the array.
var lastIndexOf = createIndexFinder(-1, findLastIndex);
// Return the first value which passes a truth test.
function find(obj, predicate, context) {
var keyFinder = isArrayLike(obj) ? findIndex : findKey;
var key = keyFinder(obj, predicate, context);
if (key !== void 0 && key !== -1) return obj[key];
// Convenience version of a common use case of `_.find`: getting the first
// object containing specific `key:value` pairs.
function findWhere(obj, attrs) {
return find(obj, matcher(attrs));
// The cornerstone for collection functions, an `each`
// implementation, aka `forEach`.
// Handles raw objects in addition to array-likes. Treats all
// sparse array-likes as if they were dense.
function each(obj, iteratee, context) {
iteratee = optimizeCb(iteratee, context);
for (i = 0, length = obj.length; i < length; i++) {
iteratee(obj[i], i, obj);
for (i = 0, length = _keys.length; i < length; i++) {
iteratee(obj[_keys[i]], _keys[i], obj);
// Return the results of applying the iteratee to each element.
function map(obj, iteratee, context) {
iteratee = cb(iteratee, context);
var _keys = !isArrayLike(obj) && keys(obj),
length = (_keys || obj).length,
for (var index = 0; index < length; index++) {
var currentKey = _keys ? _keys[index] : index;
results[index] = iteratee(obj[currentKey], currentKey, obj);
// Internal helper to create a reducing function, iterating left or right.
function createReduce(dir) {
// Wrap code that reassigns argument variables in a separate function than
// the one that accesses `arguments.length` to avoid a perf hit. (#1991)
var reducer = function(obj, iteratee, memo, initial) {
var _keys = !isArrayLike(obj) && keys(obj),
length = (_keys || obj).length,
index = dir > 0 ? 0 : length - 1;
memo = obj[_keys ? _keys[index] : index];
for (; index >= 0 && index < length; index += dir) {
var currentKey = _keys ? _keys[index] : index;
memo = iteratee(memo, obj[currentKey], currentKey, obj);
return function(obj, iteratee, memo, context) {
var initial = arguments.length >= 3;
return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);
// **Reduce** builds up a single result from a list of values, aka `inject`,
var reduce = createReduce(1);
// The right-associative version of reduce, also known as `foldr`.
var reduceRight = createReduce(-1);
// Return all the elements that pass a truth test.
function filter(obj, predicate, context) {
predicate = cb(predicate, context);
each(obj, function(value, index, list) {
if (predicate(value, index, list)) results.push(value);
// Return all the elements for which a truth test fails.
function reject(obj, predicate, context) {
return filter(obj, negate(cb(predicate)), context);
// Determine whether all of the elements pass a truth test.
function every(obj, predicate, context) {
predicate = cb(predicate, context);
var _keys = !isArrayLike(obj) && keys(obj),
length = (_keys || obj).length;
for (var index = 0; index < length; index++) {
var currentKey = _keys ? _keys[index] : index;
if (!predicate(obj[currentKey], currentKey, obj)) return false;
// Determine if at least one element in the object passes a truth test.
function some(obj, predicate, context) {
predicate = cb(predicate, context);
var _keys = !isArrayLike(obj) && keys(obj),
length = (_keys || obj).length;
for (var index = 0; index < length; index++) {
var currentKey = _keys ? _keys[index] : index;
if (predicate(obj[currentKey], currentKey, obj)) return true;
// Determine if the array or object contains a given item (using `===`).
function contains(obj, item, fromIndex, guard) {
if (!isArrayLike(obj)) obj = values(obj);
if (typeof fromIndex != 'number' || guard) fromIndex = 0;
return indexOf(obj, item, fromIndex) >= 0;
// Invoke a method (with arguments) on every item in a collection.
var invoke = restArguments(function(obj, path, args) {
if (isFunction$1(path)) {
contextPath = path.slice(0, -1);
path = path[path.length - 1];
return map(obj, function(context) {
if (contextPath && contextPath.length) {
context = deepGet(context, contextPath);
if (context == null) return void 0;
return method == null ? method : method.apply(context, args);
// Convenience version of a common use case of `_.map`: fetching a property.
function pluck(obj, key) {
return map(obj, property(key));
// Convenience version of a common use case of `_.filter`: selecting only
// objects containing specific `key:value` pairs.
function where(obj, attrs) {
return filter(obj, matcher(attrs));
// Return the maximum element (or element-based computation).
function max(obj, iteratee, context) {
var result = -Infinity, lastComputed = -Infinity,
if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) {
obj = isArrayLike(obj) ? obj : values(obj);
for (var i = 0, length = obj.length; i < length; i++) {
if (value != null && value > result) {
iteratee = cb(iteratee, context);
each(obj, function(v, index, list) {
computed = iteratee(v, index, list);
if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) {
// Return the minimum element (or element-based computation).
function min(obj, iteratee, context) {
var result = Infinity, lastComputed = Infinity,
if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) {
obj = isArrayLike(obj) ? obj : values(obj);
for (var i = 0, length = obj.length; i < length; i++) {
if (value != null && value < result) {