diff --git a/dist/lodash.compat.js b/dist/lodash.compat.js index 21fb3feb8..d8b92be3f 100644 --- a/dist/lodash.compat.js +++ b/dist/lodash.compat.js @@ -33,9 +33,9 @@ HOT_SPAN = 16; /** Used to indicate the type of lazy iteratees */ - var LAZY_FILTER_FLAG = 1, - LAZY_MAP_FLAG = 2, - LAZY_WHILE_FLAG = 3; + var LAZY_FILTER_FLAG = 0, + LAZY_MAP_FLAG = 1, + LAZY_WHILE_FLAG = 2; /** Used as the `TypeError` message for "Functions" methods */ var FUNC_ERROR_TEXT = 'Expected a function'; @@ -254,13 +254,6 @@ '`': '`' }; - /** Used to map iteratee types to lazy methods */ - var lazyIterateeTypes = { - 'filter': LAZY_FILTER_FLAG, - 'map': LAZY_MAP_FLAG, - 'takeWhile': LAZY_WHILE_FLAG - }; - /** Used to determine if values are of the language type `Object` */ var objectTypes = { 'function': true, @@ -277,8 +270,13 @@ '\u2029': 'u2029' }; - /** Used as a reference to the global object */ - var root = (objectTypes[typeof window] && window) || this; + /** + * Used as a reference to the global object. + * + * The `this` value is used if it is the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ + var root = (objectTypes[typeof window] && window !== (this && this.window)) ? window : this; /** Detect free variable `exports` */ var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; @@ -577,8 +575,7 @@ } /** - * Used by `_.max` and `_.min` as the default callback when a given collection - * is a string value. + * Used by `_.max` and `_.min` as the default callback for string values. * * @private * @param {string} string The string to inspect. @@ -1015,31 +1012,30 @@ /*------------------------------------------------------------------------*/ /** - * Creates a `lodash` object which wraps the given value to enable intuitive - * method chaining. + * Creates a `lodash` object which wraps `value` to enable intuitive chaining. + * Explicit chaining may be enabled by using `_.chain`. Chaining is supported + * in custom builds as long as the `_#value` method is implicitly or explicitly + * included in the build. * * In addition to Lo-Dash methods, wrappers also have the following `Array` methods: * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, * and `unshift` * - * Chaining is supported in custom builds as long as the `value` method is - * implicitly or explicitly included in the build. - * * The chainable wrapper functions are: * `after`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`, `callback`, * `chain`, `chunk`, `compact`, `concat`, `constant`, `countBy`, `create`, * `curry`, `debounce`, `defaults`, `defer`, `delay`, `difference`, `drop`, - * `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `flatten`, `flattenDeep`, - * `flow`, `flowRight`, `forEach`, `forEachRight`, `forIn`, `forInRight`, - * `forOwn`, `forOwnRight`, `functions`, `groupBy`, `indexBy`, `initial`, - * `intersection`, `invert`, `invoke`, `keys`, `keysIn`, `map`, `mapValues`, - * `matches`, `memoize`, `merge`, `mixin`, `negate`, `noop`, `omit`, `once`, - * `pairs`, `partial`, `partialRight`, `partition`, `pick`, `pluck`, `property`, - * `pull`, `pullAt`, `push`, `range`, `reject`, `remove`, `rest`, `reverse`, - * `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `take`, `takeRight`, - * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `times`, - * `toArray`, `transform`, `union`, `uniq`, `unshift`, `unzip`, `values`, - * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, and `zipObject` + * `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `flatten`, + * `flattenDeep`, `flow`, `flowRight`, `forEach`, `forEachRight`, `forIn`, + * `forInRight`, `forOwn`, `forOwnRight`, `functions`, `groupBy`, `indexBy`, + * `initial`, `intersection`, `invert`, `invoke`, `keys`, `keysIn`, `map`, + * `mapValues`, `matches`, `memoize`, `merge`, `mixin`, `negate`, `noop`, + * `omit`, `once`, `pairs`, `partial`, `partialRight`, `partition`, `pick`, + * `pluck`, `property`, `pull`, `pullAt`, `push`, `range`, `reject`, `remove`, + * `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `take`, + * `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, + * `times`, `toArray`, `transform`, `union`, `uniq`, `unshift`, `unzip`, + * `values`, `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, and `zipObject` * * The non-chainable wrapper functions are: * `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `contains`, @@ -1048,17 +1044,15 @@ * `has`, `identity`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, isDate`, * `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`, `isFunction`, * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`, - * `isRegExp`, `isString`, `isUndefined`, `join`, `kebabCase`, `last`, - * `lastIndexOf`, `max`, `min`, `noConflict`, `now`, `pad`, `padLeft`, - * `padRight`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, - * `result`, `runInContext`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, - * `sortedLastIndex`, `startsWith`, `template`, `trim`, `trimLeft`, `trimRight`, - * `trunc`, `unescape`, `uniqueId`, `value`, and `words` + * `isRegExp`, `isString`, `isUndefined`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `max`, `min`, `noConflict`, `now`, `pad`, `padLeft`, `padRight`, `parseInt`, + * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `runInContext`, + * `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, + * `startsWith`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, `unescape`, + * `uniqueId`, `value`, and `words` * - * The wrapper function `sample` will return a wrapped value when `n` is - * provided, otherwise it will return an unwrapped value. - * - * Explicit chaining can be enabled by using the `_.chain` method. + * The wrapper function `sample` will return a wrapped value when `n` is provided, + * otherwise it will return an unwrapped value. * * @name _ * @constructor @@ -2966,6 +2960,34 @@ return collection ? result(collection, target, fromIndex) : result; } + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} [transforms] The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms ? transforms.length : 0; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } + /** * Initializes an array clone. * @@ -3508,12 +3530,11 @@ * // => ['barney', 'fred'] */ function dropRightWhile(array, predicate, thisArg) { - var length = array ? array.length : 0, - index = length; + var length = array ? array.length : 0; predicate = getCallback(predicate, thisArg, 3); - while (index-- && predicate(array[index], index, array)) {} - return slice(array, 0, index + 1); + while (length-- && predicate(array[length], length, array)) {} + return slice(array, 0, length + 1); } /** @@ -4073,17 +4094,17 @@ } /** - * Slices `array` from the `start` index up to, but not including, the `end` index. + * Creates a slice of `array` from `start` up to, but not including, `end`. * - * **Note:** This function is used instead of `Array#slice` to support node lists - * in IE < 9 and to ensure dense arrays are returned. + * **Note:** This function is used instead of `Array#slice` to support node + * lists in IE < 9 and to ensure dense arrays are returned. * * @static * @memberOf _ * @category Array * @param {Array} array The array to slice. - * @param {number} [start=0] The start index. - * @param {number} [end=array.length] The end index. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function slice(array, start, end) { @@ -4294,12 +4315,11 @@ * // => ['pebbles'] */ function takeRightWhile(array, predicate, thisArg) { - var length = array ? array.length : 0, - index = length; + var length = array ? array.length : 0; predicate = getCallback(predicate, thisArg, 3); - while (index-- && predicate(array[index], index, array)) {} - return slice(array, index + 1); + while (length-- && predicate(array[length], length, array)) {} + return slice(array, length + 1); } /** @@ -4802,9 +4822,9 @@ this.dir = 1; this.dropCount = 0; this.filtered = false; - this.iteratees = []; + this.iteratees = null; this.takeCount = POSITIVE_INFINITY; - this.views = []; + this.views = null; this.wrapped = value; } @@ -4817,13 +4837,16 @@ * @returns {Object} Returns the cloned `LazyWrapper` object. */ function lazyClone() { - var result = new LazyWrapper(this.wrapped); + var iteratees = this.iteratees, + views = this.views, + result = new LazyWrapper(this.wrapped); + result.dir = this.dir; result.dropCount = this.dropCount; result.filtered = this.filtered; + result.iteratees = iteratees ? baseSlice(iteratees) : null; result.takeCount = this.takeCount; - push.apply(result.iteratees, this.iteratees); - push.apply(result.views, this.views); + result.views = views ? baseSlice(views) : null; return result; } @@ -4854,43 +4877,29 @@ */ function lazyValue() { var array = this.wrapped.value(), - length = array.length, - start = 0, - end = length, - views = this.views, - viewIndex = -1, - viewsLength = views.length; - - while (++viewIndex < viewsLength) { - var view = views[viewIndex], - size = view.size; - - switch (view.type) { - case 'drop': start += size; break; - case 'dropRight': end -= size; break; - case 'take': end = nativeMin(end, start + size); break; - case 'takeRight': start = nativeMax(start, end - size); break; - } - } - var dir = this.dir, - dropCount = this.dropCount, - droppedCount = 0, - doneDropping = !dropCount, - takeCount = nativeMin(end - start, this.takeCount - dropCount), + dir = this.dir, isRight = dir < 0, + length = array.length, + view = getView(0, length, this.views), + start = view.start, + end = view.end, + dropCount = this.dropCount, + takeCount = nativeMin(end - start, this.takeCount - dropCount), index = isRight ? end : start - 1, iteratees = this.iteratees, - iterateesLength = iteratees.length, + iterLength = iteratees ? iteratees.length : 0, resIndex = 0, result = []; outer: while (length-- && resIndex < takeCount) { - var iterateesIndex = -1, - value = array[index += dir]; + index += dir; - while (++iterateesIndex < iterateesLength) { - var data = iteratees[iterateesIndex], + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], iteratee = data.iteratee, computed = iteratee(value, index, array), type = data.type; @@ -4905,10 +4914,10 @@ } } } - if (doneDropping) { - result[resIndex++] = value; + if (dropCount) { + dropCount--; } else { - doneDropping = ++droppedCount >= dropCount; + result[resIndex++] = value; } } return isRight ? result.reverse() : result; @@ -7907,10 +7916,9 @@ } /** - * Creates an object composed of the inverted keys and values of the given - * object. If the given object contains duplicate values, subsequent values - * overwrite property assignments of previous values unless `multiValue` - * is `true`. + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite property + * assignments of previous values unless `multiValue` is `true`. * * @static * @memberOf _ @@ -8028,7 +8036,8 @@ var keyIndex, Ctor = object.constructor, index = -1, - isProto = typeof Ctor == 'function' && Ctor.prototype === object, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto, + isProto = proto === object, result = Array(length), skipIndexes = length > 0, skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error), @@ -8042,24 +8051,26 @@ // attribute of an existing property and the `constructor` property of a // prototype defaults to non-enumerable. for (var key in object) { - if (!(isProto && key == 'constructor') && - !(skipProto && key == 'prototype') && + if (!(skipProto && key == 'prototype') && !(skipErrorProps && (key == 'message' || key == 'name')) && - !(skipIndexes && (keyIndex = +key, keyIndex > -1 && keyIndex < length && keyIndex % 1 == 0))) { + !(skipIndexes && (keyIndex = +key, keyIndex > -1 && keyIndex < length && keyIndex % 1 == 0)) && + !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } if (support.nonEnumShadows && object !== objectProto) { - index = -1; - length = shadowedProps.length; + var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object), + nonEnums = nonEnumProps[className] || nonEnumProps[objectClass]; - if (isProto) { - var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object), - nonEnum = nonEnumProps[className]; + if (className == objectClass) { + proto = objectProto; } - while (++index < length) { - key = shadowedProps[index]; - if (!(nonEnum && nonEnum[key]) && hasOwnProperty.call(object, key)) { + length = shadowedProps.length; + while (length--) { + key = shadowedProps[length]; + var nonEnum = nonEnums[key]; + if (!(isProto && nonEnum) && + (nonEnum ? hasOwnProperty.call(object, key) : object[key] !== proto[key])) { result.push(key); } } @@ -8202,7 +8213,7 @@ } /** - * Creates a two dimensional array of a given object's key-value pairs, + * Creates a two dimensional array of the key-value pairs for `object`, * e.g. `[[key1, value1], [key2, value2]]`. * * @static @@ -8432,7 +8443,7 @@ } /** - * Checks if `string` ends with a given target string. + * Checks if `string` ends with the given target string. * * @static * @memberOf _ @@ -8440,8 +8451,7 @@ * @param {string} [string=''] The string to search. * @param {string} [target] The string to search for. * @param {number} [position=string.length] The position to search from. - * @returns {boolean} Returns `true` if the given string ends with the - * target string, else `false`. + * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`. * @example * * _.endsWith('abc', 'c'); @@ -8699,7 +8709,7 @@ }); /** - * Checks if `string` starts with a given target string. + * Checks if `string` starts with the given target string. * * @static * @memberOf _ @@ -8707,8 +8717,7 @@ * @param {string} [string=''] The string to search. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search from. - * @returns {boolean} Returns `true` if the given string starts with the - * target string, else `false`. + * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`. * @example * * _.startsWith('abc', 'a'); @@ -9592,7 +9601,7 @@ /** * Creates an array of numbers (positive and/or negative) progressing from - * `start` up to but not including `end`. If `start` is less than `end` a + * `start` up to, but not including, `end`. If `start` is less than `end` a * zero-length range is created unless a negative `step` is specified. * * @static @@ -10008,15 +10017,18 @@ LazyWrapper.prototype[methodName] = function(iteratee, thisArg) { iteratee = getCallback(iteratee, thisArg, 3); - var result = this.clone(); - result.filtered = isFilter || result.filtered; - result.iteratees.push({ 'iteratee': iteratee, 'type': lazyIterateeTypes[methodName] }); + var result = this.clone(), + filtered = result.filtered, + iteratees = result.iteratees || (result.iteratees = []); + + result.filtered = filtered || index == LAZY_FILTER_FLAG || (index == LAZY_WHILE_FLAG && result.dir < 0); + iteratees.push({ 'iteratee': iteratee, 'type': index }); return result; }; }); // add `LazyWrapper` methods for `_.drop` and `_.take` variants - arrayEach(['drop', 'take'], function(methodName) { + arrayEach(['drop', 'take'], function(methodName, index) { var countName = methodName + 'Count', whileName = methodName + 'While'; @@ -10024,14 +10036,13 @@ n = n == null ? 1 : nativeMax(+n || 0, 0); var result = this.clone(); - if (this.filtered) { - result[countName] = n; - return result; + if (result.filtered) { + var value = result[countName]; + result[countName] = index ? nativeMin(value, n) : (value + n); + } else { + var views = result.views || (result.views = []); + views.push({ 'size': n, 'type': methodName + (result.dir < 0 ? 'Right' : '') }); } - result.views.push({ - 'size': n, - 'type': methodName + (result.dir < 0 ? 'Right' : '') - }); return result; }; @@ -10040,9 +10051,7 @@ }; LazyWrapper.prototype[methodName + 'RightWhile'] = function(predicate, thisArg) { - var result = this.reverse()[whileName](predicate, thisArg); - result.filtered = true; - return result.reverse(); + return this.reverse()[whileName](predicate, thisArg).reverse(); }; }); diff --git a/dist/lodash.compat.min.js b/dist/lodash.compat.min.js index da6cf9826..fe03e4116 100644 --- a/dist/lodash.compat.min.js +++ b/dist/lodash.compat.min.js @@ -5,78 +5,78 @@ */ ;(function(){function n(n,t){for(var r=-1,e=n.length;++rt||!r||typeof n=="undefined"&&e)return 1;if(n=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n)}function x(n,t){for(var r=-1,e=n.length,u=-1,o=[];++re&&(e=u)}return e}function Lt(n){for(var t=-1,r=n.length,e=Gu;++t=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n)}function x(n,t){for(var r=-1,e=n.length,u=-1,o=[];++re&&(e=u)}return e}function $t(n){for(var t=-1,r=n.length,e=Gu;++tu(t,i)&&a.push(i);return a}function Ht(n,t){var r=n?n.length:0;if(!qr(r))return ar(n,t);for(var e=-1,u=Yr(n);++ec))return false}else{var g=p&&bu.call(n,"__wrapped__"),h=h&&bu.call(t,"__wrapped__");if(g||h)return cr(g?n.value():n,h?t.value():t,r,e,u,o);if(!s)return false;if(!a&&!p){switch(l){case vt:case yt:return+n==+t;case _t:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t; -case wt:case xt:return n==pu(t)}return false}if(Nt.support.argsClass||(c=De(n),i=De(t)),g=c?cu:n.constructor,l=i?cu:t.constructor,a){if(g.prototype.name!=l.prototype.name)return false}else if(p=!c&&bu.call(n,"constructor"),h=!i&&bu.call(t,"constructor"),p!=h||!p&&g!=l&&"constructor"in n&&"constructor"in t&&!(typeof g=="function"&&g instanceof g&&typeof l=="function"&&l instanceof l))return false;if(g=a?["message","name"]:mo(n),l=a?g:mo(t),c&&g.push("length"),i&&l.push("length"),c=g.length,p=l.length,c!=p&&!e)return false +r=r(n);for(var o=r.length;++ec))return false}else{var g=p&&bu.call(n,"__wrapped__"),h=h&&bu.call(t,"__wrapped__");if(g||h)return cr(g?n.value():n,h?t.value():t,r,e,u,o);if(!s)return false;if(!a&&!p){switch(l){case yt:case dt:return+n==+t;case bt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t; +case xt:case jt:return n==pu(t)}return false}if(Wt.support.argsClass||(c=De(n),i=De(t)),g=c?cu:n.constructor,l=i?cu:t.constructor,a){if(g.prototype.name!=l.prototype.name)return false}else if(p=!c&&bu.call(n,"constructor"),h=!i&&bu.call(t,"constructor"),p!=h||!p&&g!=l&&"constructor"in n&&"constructor"in t&&!(typeof g=="function"&&g instanceof g&&typeof l=="function"&&l instanceof l))return false;if(g=a?["message","name"]:mo(n),l=a?g:mo(t),c&&g.push("length"),i&&l.push("length"),c=g.length,p=l.length,c!=p&&!e)return false }for(u||(u=[]),o||(o=[]),l=u.length;l--;)if(u[l]==n)return o[l]==t;if(u.push(n),o.push(t),i=true,f)for(;i&&++le(f,p)&&((t||i)&&f.push(p),a.push(c))}return a}function br(n,t){for(var r=-1,e=t(n),u=e.length,o=uu(u);++rt||null==r)return r;if(3t?0:t)}function Gr(n,t,r){var e=n?n.length:0;return t=e-((r||null==t?1:t)||0),ne(n,0,0>t?0:t)}function Jr(n,t,r){var e=-1,u=n?n.length:0;for(t=Dr(t,r,3);++er?zu(e+r,0):r||0;else if(r)return r=te(n,t),n=n[r],(t===t?t===n:n!==n)?r:-1;return l(n,t,r)}function Qr(n){return Zr(n,1) +for(var u=0;++ut?0:t)}function Gr(n,t,r){var e=n?n.length:0;return t=e-((r||null==t?1:t)||0),ne(n,0,0>t?0:t)}function Jr(n,t,r){var e=-1,u=n?n.length:0;for(t=Dr(t,r,3);++er?zu(e+r,0):r||0;else if(r)return r=te(n,t),n=n[r],(t===t?t===n:n!==n)?r:-1;return l(n,t,r)}function Qr(n){return Zr(n,1) }function ne(n,t,r){var e=-1,u=n?n.length:0,o=typeof r;if(r&&"number"!=o&&$r(n,t,r)&&(t=0,r=u),t=null==t?0:+t||0,0>t&&(t=-t>u?0:u+t),r="undefined"==o||r>u?u:+r||0,0>r&&(r+=u),r&&r==u&&!t)return c(n);for(u=t>r?0:r-t,r=uu(u);++er?zu(e+r,0):r||0:0,typeof n=="string"||!ho(n)&&Pe(n)?ri||r===Zu&&r===a)&&(i=r,a=n)}),a}function de(n,t){return ve(n,eu(t))}function me(n,t,r,e){return(ho(n)?u:yr)(n,Dr(t,e,4),r,3>arguments.length,Ht) -}function _e(n,t,r,e){return(ho(n)?o:yr)(n,Dr(t,e,4),r,3>arguments.length,Qt)}function be(n){n=Vr(n);for(var t=-1,r=n.length,e=uu(r);++targuments.length)return Sr(n,k,null,t); +}function ge(n,t,r){if(typeof t=="function"&&typeof r=="undefined"&&ho(n))for(r=n.length;r--&&false!==t(n[r],r,n););else n=Qt(n,Kt(t,r,3));return n}function ve(n,t,r){return t=Dr(t,r,3),(ho(n)?e:pr)(n,t)}function ye(n,t,r){r&&$r(n,t,r)&&(t=null);var e=null==t,u=e&&ho(n),o=!u&&Pe(n);if(e&&!o)return Lt(u?n:Vr(n));var i=Zu,a=i;return t=e&&o?p:Dr(t,r,3),Ht(n,function(n,r,e){r=t(n,r,e),(r>i||r===Zu&&r===a)&&(i=r,a=n)}),a}function de(n,t){return ve(n,eu(t))}function me(n,t,r,e){return(ho(n)?u:yr)(n,Dr(t,e,4),r,3>arguments.length,Ht) +}function _e(n,t,r,e){return(ho(n)?o:yr)(n,Dr(t,e,4),r,3>arguments.length,Qt)}function be(n){n=Vr(n);for(var t=-1,r=n.length,e=uu(r);++targuments.length)return Sr(n,k,null,t); var r=ne(arguments,2),e=x(r,je.placeholder);return gr(n,k|T,r,e,t)}function Ae(n,t){var r=k|F;if(2=r||r>t?(a&&Iu(a),r=p,a=s=p=I,r&&(h=jo(),f=n.apply(c,i),s||a||(i=c=null))):s=Du(e,r)}function u(){s&&Iu(s),a=s=p=I,(v||g!==t)&&(h=jo(),f=n.apply(c,i),s||a||(i=c=null)) -}function o(){if(i=arguments,l=jo(),c=this,p=v&&(s||!y),false===g)var r=y&&!s;else{a||y||(h=l);var o=g-(l-h),d=0>=o||o>g;d?(a&&(a=Iu(a)),h=l,f=n.apply(c,i)):a||(a=Du(u,o))}return d&&s?s=Iu(s):s||t===g||(s=Du(e,t)),r&&(d=true,f=n.apply(c,i)),!d||s||a||(i=c=null),f}var i,a,f,l,c,s,p,h=0,g=false,v=true;if(!Ne(n))throw new hu(z);if(t=0>t?0:t,true===r)var y=true,v=false;else Ue(r)&&(y=r.leading,g="maxWait"in r&&zu(+r.maxWait||0,t),v="trailing"in r?r.trailing:v);return o.cancel=function(){s&&Iu(s),a&&Iu(a),a=s=p=I},o}function Oe(){var n=arguments,r=n.length-1; -if(0>r)return function(){};if(!t(n,Ne))throw new hu(z);return function(){for(var t=r,e=n[t].apply(this,arguments);t--;)e=n[t].call(this,e);return e}}function ke(n,t){function r(){var e=r.cache,u=t?t.apply(this,arguments):arguments[0];if(e.has(u))return e.get(u);var o=n.apply(this,arguments);return e.set(u,o),o}if(!Ne(n)||t&&!Ne(t))throw new hu(z);return r.cache=new ke.Cache,r}function Fe(n){var t=ne(arguments,1),r=x(t,Fe.placeholder);return gr(n,T,t,r)}function Re(n){var t=ne(arguments,1),r=x(t,Re.placeholder); -return gr(n,W,t,r)}function Se(){this.__wrapped__={}}function De(n){return qr(n&&typeof n=="object"?n.length:I)&&xu.call(n)==ht||false}function Te(n){return n&&typeof n=="object"&&1===n.nodeType&&(Nt.support.nodeClass?-1t||null==n||!qu(t))return r; -n=pu(n);do t%2&&(r+=n),t=Ou(t/2),n+=n;while(t);return r}function Ze(n,t,r){return(n=null==n?"":pu(n))?r||null==t?n.slice(j(n),A(n)+1):(t=pu(t),n.slice(h(n,t),g(n,t)+1)):n}function Ge(n,t,r){return(n=null!=n&&pu(n))&&n.match((r?null:t)||lt)||[]}function Je(n){try{return n()}catch(t){return We(t)?t:iu(t)}}function Xe(n,t,r){return Kt(n,r?I:t)}function He(n){return n}function Qe(n){var t=mo(n),r=t.length;if(1==r){var e=t[0],u=n[e];if(Pr(u))return function(n){return null!=n&&u===n[e]&&bu.call(n,e)}}for(var o=r,i=uu(r),a=uu(r);o--;){var u=n[t[o]],f=Pr(u); -i[o]=f?u:Vt(u,true,Bt),a[o]=f}return function(n){if(o=r,null==n)return!o;for(;o--;)if(a[o]?i[o]!==n[t[o]]:!bu.call(n,t[o]))return false;for(o=r;o--;)if(a[o]?!bu.call(n,t[o]):!cr(i[o],n[t[o]],null,true))return false;return true}}function nu(n,t,r){var e=true,u=Ue(t),o=null==r,i=o&&u&&mo(t),a=i&&lr(t,i);(i&&i.length&&!a.length||o&&!u)&&(o&&(r=t),a=false,t=n,n=this),a||(a=lr(t,mo(t))),false===r?e=false:Ue(r)&&"chain"in r&&(e=r.chain),r=-1,u=Ne(n);for(o=a.length;++r=L)return r}else n=0;return uo(r,e)}}(),fo=Ar(function(n,t,r){bu.call(n,r)?++n[r]:n[r]=1}),lo=Ar(function(n,t,r){bu.call(n,r)?n[r].push(t):n[r]=[t]}),co=Ar(function(n,t,r){n[r]=t}),so=Ar(function(n,t,r){n[r?0:1].push(t) -},function(){return[[],[]]}),po=gr(xe,T,[2],[]);eo.argsClass||(De=function(n){return qr(n&&typeof n=="object"?n.length:I)&&bu.call(n,"callee")&&!Ru.call(n,"callee")||false});var ho=$u||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&xu.call(n)==gt||false};eo.dom||(Te=function(n){return n&&typeof n=="object"&&1===n.nodeType&&!vo(n)||false});var go=Ku||function(n){return typeof n=="number"&&qu(n)};Ne(/x/)&&(Ne=function(n){return typeof n=="function"&&xu.call(n)==mt});var vo=ku?function(n){if(!n||xu.call(n)!=bt||!Nt.support.argsClass&&De(n))return false; -var t=n.valueOf,r=Le(t)&&(r=ku(t))&&ku(r);return r?n==r||ku(n)==r:Mr(n)}:Mr,yo=Er(Mt),mo=Pu?function(n){if(n)var t=n.constructor,r=n.length;return typeof t=="function"&&t.prototype===n||typeof r=="number"&&0--n?t.apply(this,arguments):void 0 -}},Nt.assign=yo,Nt.at=function(n){return(!n||qr(n.length))&&(n=Vr(n)),a(n,er(arguments,false,false,1))},Nt.before=xe,Nt.bind=je,Nt.bindAll=function(n){for(var t=n,r=1(p?s(p,i):u(c,i))){for(t=r;--t;){var h=e[t];if(0>(h?s(h,i):u(n[t],i)))continue n}p&&p.push(i),c.push(i) -}return c},Nt.invert=function(n,t,r){t=r?null:t,r=-1;for(var e=mo(n),u=e.length,o={};++rt?0:t)},Nt.takeRight=function(n,t,r){var e=n?n.length:0;return t=e-((r||null==t?1:t)||0),ne(n,0>t?0:t)},Nt.takeRightWhile=function(n,t,r){var e=n?n.length:0;for(t=Dr(t,r,3);e--&&t(n[e],e,n););return ne(n,e+1)},Nt.takeWhile=function(n,t,r){var e=-1,u=n?n.length:0;for(t=Dr(t,r,3);++er?0:+r||0,e))-t.length,0<=r&&n.indexOf(t,r)==r},Nt.escape=function(n){return(n=null==n?"":pu(n))&&(G.lastIndex=0,G.test(n))?n.replace(G,m):n},Nt.escapeRegExp=Ve,Nt.every=ce,Nt.find=pe,Nt.findIndex=Jr,Nt.findKey=function(n,t,r){return t=Dr(t,r,3),rr(n,t,ar,true) -},Nt.findLast=function(n,t,r){return t=Dr(t,r,3),rr(n,t,Qt)},Nt.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=Dr(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},Nt.findLastKey=function(n,t,r){return t=Dr(t,r,3),rr(n,t,fr,true)},Nt.findWhere=function(n,t){return pe(n,Qe(t))},Nt.first=Xr,Nt.has=function(n,t){return n?bu.call(n,t):false},Nt.identity=He,Nt.indexOf=Hr,Nt.isArguments=De,Nt.isArray=ho,Nt.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&xu.call(n)==vt||false},Nt.isDate=function(n){return n&&typeof n=="object"&&xu.call(n)==yt||false -},Nt.isElement=Te,Nt.isEmpty=function(n){if(null==n)return true;var t=n.length;return qr(t)&&(ho(n)||Pe(n)||De(n)||typeof n=="object"&&Ne(n.splice))?!t:!mo(n).length},Nt.isEqual=function(n,t,r,e){return r=typeof r=="function"&&Kt(r,e,3),!r&&Pr(n)&&Pr(t)?n===t:cr(n,t,r)},Nt.isError=We,Nt.isFinite=go,Nt.isFunction=Ne,Nt.isNaN=function(n){return $e(n)&&n!=+n},Nt.isNative=Le,Nt.isNull=function(n){return null===n},Nt.isNumber=$e,Nt.isObject=Ue,Nt.isPlainObject=vo,Nt.isRegExp=qe,Nt.isString=Pe,Nt.isUndefined=function(n){return typeof n=="undefined" -},Nt.kebabCase=wo,Nt.last=function(n){var t=n?n.length:0;return t?n[t-1]:I},Nt.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(typeof r=="number")u=(0>r?zu(e+r,0):Bu(r||0,e-1))+1;else if(r)return u=re(n,t)-1,n=n[u],(t===t?t===n:n!==n)?u:-1;if(t!==t)return b(n,u,true);for(;u--;)if(n[u]===t)return u;return-1},Nt.max=ye,Nt.min=function(n,t,r){r&&$r(n,t,r)&&(t=null);var e=null==t,u=e&&ho(n),o=!u&&Pe(n);if(e&&!o)return Lt(u?n:Vr(n));var i=Gu,a=i;return t=e&&o?p:Dr(t,r,3),Ht(n,function(n,r,e){r=t(n,r,e),(rr?0:+r||0,n.length),n.lastIndexOf(t,r)==r},Nt.template=function(n,t,r){var e=Nt.templateSettings;r&&$r(n,t,r)&&(t=r=null),n=pu(null==n?"":n),t=yo({},r||t,e,Pt),r=yo({},t.imports,e.imports,Pt); -var u,o,i=mo(r),a=Me(r),f=0;r=t.interpolate||ot;var l="__p+='";if(r=su((t.escape||ot).source+"|"+r.source+"|"+(r===H?Q:ot).source+"|"+(t.evaluate||ot).source+"|$","g"),n.replace(r,function(t,r,e,i,a,c){return e||(e=i),l+=n.slice(f,c).replace(ft,_),r&&(u=true,l+="'+__e("+r+")+'"),a&&(o=true,l+="';"+a+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),f=c+t.length,t}),l+="';",(t=t.variable)||(l="with(obj){"+l+"}"),l=(o?l.replace(K,""):l).replace(V,"$1").replace(Y,"$1;"),l="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",t=Je(function(){return au(i,"return "+l).apply(I,a) -}),t.source=l,We(t))throw t;return t},Nt.trim=Ze,Nt.trimLeft=function(n,t,r){return(n=null==n?"":pu(n))?r||null==t?n.slice(j(n)):(t=pu(t),n.slice(h(n,t))):n},Nt.trimRight=function(n,t,r){return(n=null==n?"":pu(n))?r||null==t?n.slice(0,A(n)+1):(t=pu(t),n.slice(0,g(n,t)+1)):n},Nt.trunc=function(n,t,r){t=r?null:t;var e=N;if(r=U,Ue(t)){var u="separator"in t?t.separator:u,e="length"in t?+t.length||0:e;r="omission"in t?pu(t.omission):r}else null!=t&&(e=+t||0);if(n=null==n?"":pu(n),e>=n.length)return n; -if(e-=r.length,1>e)return r;if(t=n.slice(0,e),null==u)return t+r;if(qe(u)){if(n.slice(e).search(u)){var o,i=n.slice(0,e);for(u.global||(u=su(u.source,(nt.exec(u)||"")+"g")),u.lastIndex=0;n=u.exec(i);)o=n.index;t=t.slice(0,null==o?e:o)}}else n.indexOf(u,e)!=e&&(u=t.lastIndexOf(u),-1t?0:+t||0,n.length),n)},Nt.prototype.sample=function(n,t){return n=t?null:n,this.__chain__||null!=n?this.thru(function(t){return Nt.sample(t,n)}):Nt.sample(this.value())},Nt.VERSION=O,n("bind bindKey curry curryRight partial partialRight".split(" "),function(n){Nt[n].placeholder=Nt}),n(["filter","map","takeWhile"],function(n,t){var r=!t; -fe.prototype[n]=function(t,e){t=Dr(t,e,3);var u=this.clone();return u.filtered=r||u.filtered,u.iteratees.push({iteratee:t,type:$t[n]}),u}}),n(["drop","take"],function(n){var t=n+"Count",r=n+"While";fe.prototype[n]=function(r){r=null==r?1:zu(+r||0,0);var e=this.clone();return this.filtered?(e[t]=r,e):(e.views.push({size:r,type:n+(0>e.dir?"Right":"")}),e)},fe.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()},fe.prototype[n+"RightWhile"]=function(n,t){var e=this.reverse()[r](n,t); -return e.filtered=true,e.reverse()}}),n(["first","last"],function(n,t){var r="take"+(t?"Right":"");fe.prototype[n]=function(){return this[r](1).value()[0]}}),n(["initial","rest"],function(n,t){var r="drop"+(t?"":"Right");fe.prototype[n]=function(){return this[r](1)}}),fe.prototype.dropWhile=function(n,t){n=Dr(n,t,3);var r,e,u=0>this.dir;return this.filter(function(t,o,i){return r=r&&(u?oe),e=o,r||(r=!n(t,o,i))})},fe.prototype.reject=function(n,t){return n=Dr(n,t,3),this.filter(function(t,r,e){return!n(t,r,e) -})},fe.prototype.slice=function(n,t){n=null==n?0:+n||0;var r=0>n?this.takeRight(-n):this.drop(n);return typeof t!="undefined"&&(t=+t||0,r=0>t?r.dropRight(-t):r.take(t-n)),r},ar(fe.prototype,function(n,t){var r=/^(?:first|last)$/.test(t);Nt.prototype[t]=function(){var e=arguments,u=this.__chain__,o=this.__wrapped__,i=o instanceof fe;return r&&!u?i?n.call(o):Nt[t](this.value()):i||ho(o)?(o=n.apply(i?o:new fe(this),e),new ae(o,u)):this.thru(function(n){return n=[n],Fu.apply(n,e),Nt[t].apply(Nt,n)})}}),n("concat join pop push shift sort splice unshift".split(" "),function(n){var t=gu[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:join|pop|shift)$/.test(n),u=eo.spliceObjects||!/^(?:pop|shift|splice)$/.test(n)?t:function(){var n=t.apply(this,arguments); -return 0===this.length&&delete this[0],n};Nt.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?u.apply(this.value(),n):this[r](function(t){return u.apply(t,n)})}}),fe.prototype.clone=function(){var n=new fe(this.wrapped);return n.dir=this.dir,n.dropCount=this.dropCount,n.filtered=this.filtered,n.takeCount=this.takeCount,Fu.apply(n.iteratees,this.iteratees),Fu.apply(n.views,this.views),n},fe.prototype.reverse=function(){var n=this.filtered,t=n?new fe(this):this.clone();return t.dir=-1*this.dir,t.filtered=n,t -},fe.prototype.value=function(){for(var n=this.wrapped.value(),t=n.length,r=0,e=t,u=this.views,o=-1,i=u.length;++ou,r=l?e:r-1,e=this.iteratees,c=e.length,s=0,p=[];n:for(;t--&&s=o}return l?p.reverse():p},Nt.prototype.chain=function(){return ie(this)},Nt.prototype.reverse=function(){return this.thru(function(n){return n.reverse()})},Nt.prototype.toString=function(){return pu(this.value())},Nt.prototype.toJSON=Nt.prototype.value=Nt.prototype.valueOf=function(){var n=this.__wrapped__;n instanceof fe&&(n=n.value());for(var t=-1,r=this.__queue__,e=r.length;++t"'`]/g,J=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,Q=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,nt=/\w*$/,tt=/^\s*function[ \n\r\t]+\w/,rt=/^0[xX]/,et=/^\[object .+?Constructor\]$/,ut=/[\xC0-\xD6\xD8-\xDE\xDF-\xF6\xF8-\xFF]/g,ot=/($^)/,it=/[.*+?^${}()|[\]\/\\]/g,at=/\bthis\b/,ft=/['\n\r\u2028\u2029\\]/g,lt=RegExp("[A-Z\\xC0-\\xD6\\xD8-\\xDE]{2,}(?=[A-Z\\xC0-\\xD6\\xD8-\\xDE][a-z\\xDF-\\xF6\\xF8-\\xFF]+)|[A-Z\\xC0-\\xD6\\xD8-\\xDE]?[a-z\\xDF-\\xF6\\xF8-\\xFF]+|[A-Z\\xC0-\\xD6\\xD8-\\xDE]+|[0-9]+","g"),ct=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",st="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout document isFinite parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap window WinRTError".split(" "),pt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),ht="[object Arguments]",gt="[object Array]",vt="[object Boolean]",yt="[object Date]",dt="[object Error]",mt="[object Function]",_t="[object Number]",bt="[object Object]",wt="[object RegExp]",xt="[object String]",jt="[object ArrayBuffer]",At="[object Float32Array]",Et="[object Float64Array]",Ct="[object Int8Array]",It="[object Int16Array]",Ot="[object Int32Array]",kt="[object Uint8Array]",Ft="[object Uint8ClampedArray]",Rt="[object Uint16Array]",St="[object Uint32Array]",Dt={}; -Dt[ht]=Dt[gt]=Dt[At]=Dt[Et]=Dt[Ct]=Dt[It]=Dt[Ot]=Dt[kt]=Dt[Ft]=Dt[Rt]=Dt[St]=true,Dt[jt]=Dt[vt]=Dt[yt]=Dt[dt]=Dt[mt]=Dt["[object Map]"]=Dt[_t]=Dt[bt]=Dt[wt]=Dt["[object Set]"]=Dt[xt]=Dt["[object WeakMap]"]=false;var Tt={};Tt[ht]=Tt[gt]=Tt[jt]=Tt[vt]=Tt[yt]=Tt[At]=Tt[Et]=Tt[Ct]=Tt[It]=Tt[Ot]=Tt[_t]=Tt[bt]=Tt[wt]=Tt[xt]=Tt[kt]=Tt[Ft]=Tt[Rt]=Tt[St]=true,Tt[dt]=Tt[mt]=Tt["[object Map]"]=Tt["[object Set]"]=Tt["[object WeakMap]"]=false;var Wt={leading:false,maxWait:0,trailing:false},Nt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Ut={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Lt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},$t={filter:q,map:P,takeWhile:3},qt={"function":true,object:true},Pt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zt=qt[typeof window]&&window||this,Bt=qt[typeof exports]&&exports&&!exports.nodeType&&exports,Mt=qt[typeof module]&&module&&!module.nodeType&&module,Kt=Bt&&Mt&&typeof global=="object"&&global; +}function o(){if(i=arguments,l=jo(),c=this,p=v&&(s||!y),false===g)var r=y&&!s;else{a||y||(h=l);var o=g-(l-h),d=0>=o||o>g;d?(a&&(a=Iu(a)),h=l,f=n.apply(c,i)):a||(a=Du(u,o))}return d&&s?s=Iu(s):s||t===g||(s=Du(e,t)),r&&(d=true,f=n.apply(c,i)),!d||s||a||(i=c=null),f}var i,a,f,l,c,s,p,h=0,g=false,v=true;if(!Ue(n))throw new hu(B);if(t=0>t?0:t,true===r)var y=true,v=false;else We(r)&&(y=r.leading,g="maxWait"in r&&zu(+r.maxWait||0,t),v="trailing"in r?r.trailing:v);return o.cancel=function(){s&&Iu(s),a&&Iu(a),a=s=p=I},o}function Oe(){var n=arguments,r=n.length-1; +if(0>r)return function(){};if(!t(n,Ue))throw new hu(B);return function(){for(var t=r,e=n[t].apply(this,arguments);t--;)e=n[t].call(this,e);return e}}function ke(n,t){function r(){var e=r.cache,u=t?t.apply(this,arguments):arguments[0];if(e.has(u))return e.get(u);var o=n.apply(this,arguments);return e.set(u,o),o}if(!Ue(n)||t&&!Ue(t))throw new hu(B);return r.cache=new ke.Cache,r}function Fe(n){var t=ne(arguments,1),r=x(t,Fe.placeholder);return gr(n,T,t,r)}function Re(n){var t=ne(arguments,1),r=x(t,Re.placeholder); +return gr(n,N,t,r)}function Se(){this.__wrapped__={}}function De(n){return qr(n&&typeof n=="object"?n.length:I)&&xu.call(n)==gt||false}function Te(n){return n&&typeof n=="object"&&1===n.nodeType&&(Wt.support.nodeClass?-1t||null==n||!qu(t))return r;n=pu(n);do t%2&&(r+=n),t=Ou(t/2),n+=n;while(t);return r}function Ze(n,t,r){return(n=null==n?"":pu(n))?r||null==t?n.slice(j(n),A(n)+1):(t=pu(t),n.slice(h(n,t),g(n,t)+1)):n}function Ge(n,t,r){return(n=null!=n&&pu(n))&&n.match((r?null:t)||ct)||[]}function Je(n){try{return n()}catch(t){return Ne(t)?t:iu(t)}}function Xe(n,t,r){return Kt(n,r?I:t)}function He(n){return n}function Qe(n){var t=mo(n),r=t.length;if(1==r){var e=t[0],u=n[e];if(Pr(u))return function(n){return null!=n&&u===n[e]&&bu.call(n,e) +}}for(var o=r,i=uu(r),a=uu(r);o--;){var u=n[t[o]],f=Pr(u);i[o]=f?u:Vt(u,true,Bt),a[o]=f}return function(n){if(o=r,null==n)return!o;for(;o--;)if(a[o]?i[o]!==n[t[o]]:!bu.call(n,t[o]))return false;for(o=r;o--;)if(a[o]?!bu.call(n,t[o]):!cr(i[o],n[t[o]],null,true))return false;return true}}function nu(n,t,r){var e=true,u=We(t),o=null==r,i=o&&u&&mo(t),a=i&&lr(t,i);(i&&i.length&&!a.length||o&&!u)&&(o&&(r=t),a=false,t=n,n=this),a||(a=lr(t,mo(t))),false===r?e=false:We(r)&&"chain"in r&&(e=r.chain),r=-1,u=Ue(n);for(o=a.length;++r=L)return r}else n=0;return uo(r,e)}}(),fo=Ar(function(n,t,r){bu.call(n,r)?++n[r]:n[r]=1}),lo=Ar(function(n,t,r){bu.call(n,r)?n[r].push(t):n[r]=[t]}),co=Ar(function(n,t,r){n[r]=t}),so=Ar(function(n,t,r){n[r?0:1].push(t) +},function(){return[[],[]]}),po=gr(xe,T,[2],[]);eo.argsClass||(De=function(n){return qr(n&&typeof n=="object"?n.length:I)&&bu.call(n,"callee")&&!Ru.call(n,"callee")||false});var ho=$u||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&xu.call(n)==vt||false};eo.dom||(Te=function(n){return n&&typeof n=="object"&&1===n.nodeType&&!vo(n)||false});var go=Ku||function(n){return typeof n=="number"&&qu(n)};Ue(/x/)&&(Ue=function(n){return typeof n=="function"&&xu.call(n)==_t});var vo=ku?function(n){if(!n||xu.call(n)!=wt||!Wt.support.argsClass&&De(n))return false; +var t=n.valueOf,r=Le(t)&&(r=ku(t))&&ku(r);return r?n==r||ku(n)==r:Mr(n)}:Mr,yo=Er(Mt),mo=Pu?function(n){if(n)var t=n.constructor,r=n.length;return typeof t=="function"&&t.prototype===n||typeof r=="number"&&0--n?t.apply(this,arguments):void 0 +}},Wt.assign=yo,Wt.at=function(n){return(!n||qr(n.length))&&(n=Vr(n)),a(n,er(arguments,false,false,1))},Wt.before=xe,Wt.bind=je,Wt.bindAll=function(n){for(var t=n,r=1(p?s(p,i):u(c,i))){for(t=r;--t;){var h=e[t];if(0>(h?s(h,i):u(n[t],i)))continue n}p&&p.push(i),c.push(i) +}return c},Wt.invert=function(n,t,r){t=r?null:t,r=-1;for(var e=mo(n),u=e.length,o={};++rt?0:t)},Wt.takeRight=function(n,t,r){var e=n?n.length:0;return t=e-((r||null==t?1:t)||0),ne(n,0>t?0:t)},Wt.takeRightWhile=function(n,t,r){var e=n?n.length:0;for(t=Dr(t,r,3);e--&&t(n[e],e,n););return ne(n,e+1)},Wt.takeWhile=function(n,t,r){var e=-1,u=n?n.length:0;for(t=Dr(t,r,3);++er?0:+r||0,e))-t.length,0<=r&&n.indexOf(t,r)==r},Wt.escape=function(n){return(n=null==n?"":pu(n))&&(J.lastIndex=0,J.test(n))?n.replace(J,m):n},Wt.escapeRegExp=Ve,Wt.every=ce,Wt.find=pe,Wt.findIndex=Jr,Wt.findKey=function(n,t,r){return t=Dr(t,r,3),rr(n,t,ar,true) +},Wt.findLast=function(n,t,r){return t=Dr(t,r,3),rr(n,t,Qt)},Wt.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=Dr(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},Wt.findLastKey=function(n,t,r){return t=Dr(t,r,3),rr(n,t,fr,true)},Wt.findWhere=function(n,t){return pe(n,Qe(t))},Wt.first=Xr,Wt.has=function(n,t){return n?bu.call(n,t):false},Wt.identity=He,Wt.indexOf=Hr,Wt.isArguments=De,Wt.isArray=ho,Wt.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&xu.call(n)==yt||false},Wt.isDate=function(n){return n&&typeof n=="object"&&xu.call(n)==dt||false +},Wt.isElement=Te,Wt.isEmpty=function(n){if(null==n)return true;var t=n.length;return qr(t)&&(ho(n)||Pe(n)||De(n)||typeof n=="object"&&Ue(n.splice))?!t:!mo(n).length},Wt.isEqual=function(n,t,r,e){return r=typeof r=="function"&&Kt(r,e,3),!r&&Pr(n)&&Pr(t)?n===t:cr(n,t,r)},Wt.isError=Ne,Wt.isFinite=go,Wt.isFunction=Ue,Wt.isNaN=function(n){return $e(n)&&n!=+n},Wt.isNative=Le,Wt.isNull=function(n){return null===n},Wt.isNumber=$e,Wt.isObject=We,Wt.isPlainObject=vo,Wt.isRegExp=qe,Wt.isString=Pe,Wt.isUndefined=function(n){return typeof n=="undefined" +},Wt.kebabCase=wo,Wt.last=function(n){var t=n?n.length:0;return t?n[t-1]:I},Wt.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(typeof r=="number")u=(0>r?zu(e+r,0):Bu(r||0,e-1))+1;else if(r)return u=re(n,t)-1,n=n[u],(t===t?t===n:n!==n)?u:-1;if(t!==t)return b(n,u,true);for(;u--;)if(n[u]===t)return u;return-1},Wt.max=ye,Wt.min=function(n,t,r){r&&$r(n,t,r)&&(t=null);var e=null==t,u=e&&ho(n),o=!u&&Pe(n);if(e&&!o)return $t(u?n:Vr(n));var i=Gu,a=i;return t=e&&o?p:Dr(t,r,3),Ht(n,function(n,r,e){r=t(n,r,e),(rr?0:+r||0,n.length),n.lastIndexOf(t,r)==r},Wt.template=function(n,t,r){var e=Wt.templateSettings;r&&$r(n,t,r)&&(t=r=null),n=pu(null==n?"":n),t=yo({},r||t,e,Pt),r=yo({},t.imports,e.imports,Pt); +var u,o,i=mo(r),a=Me(r),f=0;r=t.interpolate||it;var l="__p+='";if(r=su((t.escape||it).source+"|"+r.source+"|"+(r===Q?nt:it).source+"|"+(t.evaluate||it).source+"|$","g"),n.replace(r,function(t,r,e,i,a,c){return e||(e=i),l+=n.slice(f,c).replace(lt,_),r&&(u=true,l+="'+__e("+r+")+'"),a&&(o=true,l+="';"+a+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),f=c+t.length,t}),l+="';",(t=t.variable)||(l="with(obj){"+l+"}"),l=(o?l.replace(V,""):l).replace(Y,"$1").replace(Z,"$1;"),l="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",t=Je(function(){return au(i,"return "+l).apply(I,a) +}),t.source=l,Ne(t))throw t;return t},Wt.trim=Ze,Wt.trimLeft=function(n,t,r){return(n=null==n?"":pu(n))?r||null==t?n.slice(j(n)):(t=pu(t),n.slice(h(n,t))):n},Wt.trimRight=function(n,t,r){return(n=null==n?"":pu(n))?r||null==t?n.slice(0,A(n)+1):(t=pu(t),n.slice(0,g(n,t)+1)):n},Wt.trunc=function(n,t,r){t=r?null:t;var e=U;if(r=W,We(t)){var u="separator"in t?t.separator:u,e="length"in t?+t.length||0:e;r="omission"in t?pu(t.omission):r}else null!=t&&(e=+t||0);if(n=null==n?"":pu(n),e>=n.length)return n; +if(e-=r.length,1>e)return r;if(t=n.slice(0,e),null==u)return t+r;if(qe(u)){if(n.slice(e).search(u)){var o,i=n.slice(0,e);for(u.global||(u=su(u.source,(tt.exec(u)||"")+"g")),u.lastIndex=0;n=u.exec(i);)o=n.index;t=t.slice(0,null==o?e:o)}}else n.indexOf(u,e)!=e&&(u=t.lastIndexOf(u),-1t?0:+t||0,n.length),n)},Wt.prototype.sample=function(n,t){return n=t?null:n,this.__chain__||null!=n?this.thru(function(t){return Wt.sample(t,n)}):Wt.sample(this.value())},Wt.VERSION=O,n("bind bindKey curry curryRight partial partialRight".split(" "),function(n){Wt[n].placeholder=Wt}),n(["filter","map","takeWhile"],function(n,t){fe.prototype[n]=function(n,r){n=Dr(n,r,3); +var e=this.clone(),u=e.filtered,o=e.iteratees||(e.iteratees=[]);return e.filtered=u||t==q||t==z&&0>e.dir,o.push({iteratee:n,type:t}),e}}),n(["drop","take"],function(n,t){var r=n+"Count",e=n+"While";fe.prototype[n]=function(e){e=null==e?1:zu(+e||0,0);var u=this.clone();if(u.filtered){var o=u[r];u[r]=t?Bu(o,e):o+e}else(u.views||(u.views=[])).push({size:e,type:n+(0>u.dir?"Right":"")});return u},fe.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()},fe.prototype[n+"RightWhile"]=function(n,t){return this.reverse()[e](n,t).reverse() +}}),n(["first","last"],function(n,t){var r="take"+(t?"Right":"");fe.prototype[n]=function(){return this[r](1).value()[0]}}),n(["initial","rest"],function(n,t){var r="drop"+(t?"":"Right");fe.prototype[n]=function(){return this[r](1)}}),fe.prototype.dropWhile=function(n,t){n=Dr(n,t,3);var r,e,u=0>this.dir;return this.filter(function(t,o,i){return r=r&&(u?oe),e=o,r||(r=!n(t,o,i))})},fe.prototype.reject=function(n,t){return n=Dr(n,t,3),this.filter(function(t,r,e){return!n(t,r,e)})},fe.prototype.slice=function(n,t){n=null==n?0:+n||0; +var r=0>n?this.takeRight(-n):this.drop(n);return typeof t!="undefined"&&(t=+t||0,r=0>t?r.dropRight(-t):r.take(t-n)),r},ar(fe.prototype,function(n,t){var r=/^(?:first|last)$/.test(t);Wt.prototype[t]=function(){var e=arguments,u=this.__chain__,o=this.__wrapped__,i=o instanceof fe;return r&&!u?i?n.call(o):Wt[t](this.value()):i||ho(o)?(o=n.apply(i?o:new fe(this),e),new ae(o,u)):this.thru(function(n){return n=[n],Fu.apply(n,e),Wt[t].apply(Wt,n)})}}),n("concat join pop push shift sort splice unshift".split(" "),function(n){var t=gu[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:join|pop|shift)$/.test(n),u=eo.spliceObjects||!/^(?:pop|shift|splice)$/.test(n)?t:function(){var n=t.apply(this,arguments); +return 0===this.length&&delete this[0],n};Wt.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?u.apply(this.value(),n):this[r](function(t){return u.apply(t,n)})}}),fe.prototype.clone=function(){var n=this.iteratees,t=this.views,r=new fe(this.wrapped);return r.dir=this.dir,r.dropCount=this.dropCount,r.filtered=this.filtered,r.iteratees=n?c(n):null,r.takeCount=this.takeCount,r.views=t?c(t):null,r},fe.prototype.reverse=function(){var n=this.filtered,t=n?new fe(this):this.clone();return t.dir=-1*this.dir,t.filtered=n,t +},fe.prototype.value=function(){var n,t=this.wrapped.value(),r=this.dir,e=0>r,u=t.length;n=u;for(var o=this.views,i=0,a=-1,f=o?o.length:0;++a"'`]/g,X=/<%-([\s\S]+?)%>/g,H=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,tt=/\w*$/,rt=/^\s*function[ \n\r\t]+\w/,et=/^0[xX]/,ut=/^\[object .+?Constructor\]$/,ot=/[\xC0-\xD6\xD8-\xDE\xDF-\xF6\xF8-\xFF]/g,it=/($^)/,at=/[.*+?^${}()|[\]\/\\]/g,ft=/\bthis\b/,lt=/['\n\r\u2028\u2029\\]/g,ct=RegExp("[A-Z\\xC0-\\xD6\\xD8-\\xDE]{2,}(?=[A-Z\\xC0-\\xD6\\xD8-\\xDE][a-z\\xDF-\\xF6\\xF8-\\xFF]+)|[A-Z\\xC0-\\xD6\\xD8-\\xDE]?[a-z\\xDF-\\xF6\\xF8-\\xFF]+|[A-Z\\xC0-\\xD6\\xD8-\\xDE]+|[0-9]+","g"),st=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",pt="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout document isFinite parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap window WinRTError".split(" "),ht="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),gt="[object Arguments]",vt="[object Array]",yt="[object Boolean]",dt="[object Date]",mt="[object Error]",_t="[object Function]",bt="[object Number]",wt="[object Object]",xt="[object RegExp]",jt="[object String]",At="[object ArrayBuffer]",Et="[object Float32Array]",Ct="[object Float64Array]",It="[object Int8Array]",Ot="[object Int16Array]",kt="[object Int32Array]",Ft="[object Uint8Array]",Rt="[object Uint8ClampedArray]",St="[object Uint16Array]",Dt="[object Uint32Array]",Tt={}; +Tt[gt]=Tt[vt]=Tt[Et]=Tt[Ct]=Tt[It]=Tt[Ot]=Tt[kt]=Tt[Ft]=Tt[Rt]=Tt[St]=Tt[Dt]=true,Tt[At]=Tt[yt]=Tt[dt]=Tt[mt]=Tt[_t]=Tt["[object Map]"]=Tt[bt]=Tt[wt]=Tt[xt]=Tt["[object Set]"]=Tt[jt]=Tt["[object WeakMap]"]=false;var Nt={};Nt[gt]=Nt[vt]=Nt[At]=Nt[yt]=Nt[dt]=Nt[Et]=Nt[Ct]=Nt[It]=Nt[Ot]=Nt[kt]=Nt[bt]=Nt[wt]=Nt[xt]=Nt[jt]=Nt[Ft]=Nt[Rt]=Nt[St]=Nt[Dt]=true,Nt[mt]=Nt[_t]=Nt["[object Map]"]=Nt["[object Set]"]=Nt["[object WeakMap]"]=false;var Ut={leading:false,maxWait:0,trailing:false},Wt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Lt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},$t={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},qt={"function":true,object:true},Pt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zt=qt[typeof window]&&window!==(this&&this.window)?window:this,Bt=qt[typeof exports]&&exports&&!exports.nodeType&&exports,Mt=qt[typeof module]&&module&&!module.nodeType&&module,Kt=Bt&&Mt&&typeof global=="object"&&global; !Kt||Kt.global!==Kt&&Kt.window!==Kt&&Kt.self!==Kt||(zt=Kt);var Vt=Mt&&Mt.exports===Bt&&Bt,Yt=function(){try{String({toString:0}+"")}catch(n){return function(){return false}}return function(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}}(),Zt=C();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(zt._=Zt, define(function(){return Zt})):Bt&&Mt?Vt?(Mt.exports=Zt)._=Zt:Bt._=Zt:zt._=Zt}).call(this); \ No newline at end of file diff --git a/dist/lodash.js b/dist/lodash.js index f45f98b26..5897975ba 100644 --- a/dist/lodash.js +++ b/dist/lodash.js @@ -33,9 +33,9 @@ HOT_SPAN = 16; /** Used to indicate the type of lazy iteratees */ - var LAZY_FILTER_FLAG = 1, - LAZY_MAP_FLAG = 2, - LAZY_WHILE_FLAG = 3; + var LAZY_FILTER_FLAG = 0, + LAZY_MAP_FLAG = 1, + LAZY_WHILE_FLAG = 2; /** Used as the `TypeError` message for "Functions" methods */ var FUNC_ERROR_TEXT = 'Expected a function'; @@ -248,13 +248,6 @@ '`': '`' }; - /** Used to map iteratee types to lazy methods */ - var lazyIterateeTypes = { - 'filter': LAZY_FILTER_FLAG, - 'map': LAZY_MAP_FLAG, - 'takeWhile': LAZY_WHILE_FLAG - }; - /** Used to determine if values are of the language type `Object` */ var objectTypes = { 'function': true, @@ -271,8 +264,13 @@ '\u2029': 'u2029' }; - /** Used as a reference to the global object */ - var root = (objectTypes[typeof window] && window) || this; + /** + * Used as a reference to the global object. + * + * The `this` value is used if it is the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ + var root = (objectTypes[typeof window] && window !== (this && this.window)) ? window : this; /** Detect free variable `exports` */ var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports; @@ -571,8 +569,7 @@ } /** - * Used by `_.max` and `_.min` as the default callback when a given collection - * is a string value. + * Used by `_.max` and `_.min` as the default callback for string values. * * @private * @param {string} string The string to inspect. @@ -959,31 +956,30 @@ /*------------------------------------------------------------------------*/ /** - * Creates a `lodash` object which wraps the given value to enable intuitive - * method chaining. + * Creates a `lodash` object which wraps `value` to enable intuitive chaining. + * Explicit chaining may be enabled by using `_.chain`. Chaining is supported + * in custom builds as long as the `_#value` method is implicitly or explicitly + * included in the build. * * In addition to Lo-Dash methods, wrappers also have the following `Array` methods: * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`, `splice`, * and `unshift` * - * Chaining is supported in custom builds as long as the `value` method is - * implicitly or explicitly included in the build. - * * The chainable wrapper functions are: * `after`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`, `callback`, * `chain`, `chunk`, `compact`, `concat`, `constant`, `countBy`, `create`, * `curry`, `debounce`, `defaults`, `defer`, `delay`, `difference`, `drop`, - * `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `flatten`, `flattenDeep`, - * `flow`, `flowRight`, `forEach`, `forEachRight`, `forIn`, `forInRight`, - * `forOwn`, `forOwnRight`, `functions`, `groupBy`, `indexBy`, `initial`, - * `intersection`, `invert`, `invoke`, `keys`, `keysIn`, `map`, `mapValues`, - * `matches`, `memoize`, `merge`, `mixin`, `negate`, `noop`, `omit`, `once`, - * `pairs`, `partial`, `partialRight`, `partition`, `pick`, `pluck`, `property`, - * `pull`, `pullAt`, `push`, `range`, `reject`, `remove`, `rest`, `reverse`, - * `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `take`, `takeRight`, - * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `times`, - * `toArray`, `transform`, `union`, `uniq`, `unshift`, `unzip`, `values`, - * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, and `zipObject` + * `dropRight`, `dropRightWhile`, `dropWhile`, `filter`, `flatten`, + * `flattenDeep`, `flow`, `flowRight`, `forEach`, `forEachRight`, `forIn`, + * `forInRight`, `forOwn`, `forOwnRight`, `functions`, `groupBy`, `indexBy`, + * `initial`, `intersection`, `invert`, `invoke`, `keys`, `keysIn`, `map`, + * `mapValues`, `matches`, `memoize`, `merge`, `mixin`, `negate`, `noop`, + * `omit`, `once`, `pairs`, `partial`, `partialRight`, `partition`, `pick`, + * `pluck`, `property`, `pull`, `pullAt`, `push`, `range`, `reject`, `remove`, + * `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, `take`, + * `takeRight`, `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, + * `times`, `toArray`, `transform`, `union`, `uniq`, `unshift`, `unzip`, + * `values`, `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, and `zipObject` * * The non-chainable wrapper functions are: * `attempt`, `camelCase`, `capitalize`, `clone`, `cloneDeep`, `contains`, @@ -992,17 +988,15 @@ * `has`, `identity`, `indexOf`, `isArguments`, `isArray`, `isBoolean`, isDate`, * `isElement`, `isEmpty`, `isEqual`, `isError`, `isFinite`, `isFunction`, * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`, - * `isRegExp`, `isString`, `isUndefined`, `join`, `kebabCase`, `last`, - * `lastIndexOf`, `max`, `min`, `noConflict`, `now`, `pad`, `padLeft`, - * `padRight`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, `repeat`, - * `result`, `runInContext`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, - * `sortedLastIndex`, `startsWith`, `template`, `trim`, `trimLeft`, `trimRight`, - * `trunc`, `unescape`, `uniqueId`, `value`, and `words` + * `isRegExp`, `isString`, `isUndefined`, `join`, `kebabCase`, `last`, `lastIndexOf`, + * `max`, `min`, `noConflict`, `now`, `pad`, `padLeft`, `padRight`, `parseInt`, + * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `runInContext`, + * `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, + * `startsWith`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`, `unescape`, + * `uniqueId`, `value`, and `words` * - * The wrapper function `sample` will return a wrapped value when `n` is - * provided, otherwise it will return an unwrapped value. - * - * Explicit chaining can be enabled by using the `_.chain` method. + * The wrapper function `sample` will return a wrapped value when `n` is provided, + * otherwise it will return an unwrapped value. * * @name _ * @constructor @@ -2804,6 +2798,34 @@ return collection ? result(collection, target, fromIndex) : result; } + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} [transforms] The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms ? transforms.length : 0; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } + /** * Initializes an array clone. * @@ -3320,12 +3342,11 @@ * // => ['barney', 'fred'] */ function dropRightWhile(array, predicate, thisArg) { - var length = array ? array.length : 0, - index = length; + var length = array ? array.length : 0; predicate = getCallback(predicate, thisArg, 3); - while (index-- && predicate(array[index], index, array)) {} - return slice(array, 0, index + 1); + while (length-- && predicate(array[length], length, array)) {} + return slice(array, 0, length + 1); } /** @@ -3885,17 +3906,17 @@ } /** - * Slices `array` from the `start` index up to, but not including, the `end` index. + * Creates a slice of `array` from `start` up to, but not including, `end`. * - * **Note:** This function is used instead of `Array#slice` to support node lists - * in IE < 9 and to ensure dense arrays are returned. + * **Note:** This function is used instead of `Array#slice` to support node + * lists in IE < 9 and to ensure dense arrays are returned. * * @static * @memberOf _ * @category Array * @param {Array} array The array to slice. - * @param {number} [start=0] The start index. - * @param {number} [end=array.length] The end index. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. */ function slice(array, start, end) { @@ -4106,12 +4127,11 @@ * // => ['pebbles'] */ function takeRightWhile(array, predicate, thisArg) { - var length = array ? array.length : 0, - index = length; + var length = array ? array.length : 0; predicate = getCallback(predicate, thisArg, 3); - while (index-- && predicate(array[index], index, array)) {} - return slice(array, index + 1); + while (length-- && predicate(array[length], length, array)) {} + return slice(array, length + 1); } /** @@ -4614,9 +4634,9 @@ this.dir = 1; this.dropCount = 0; this.filtered = false; - this.iteratees = []; + this.iteratees = null; this.takeCount = POSITIVE_INFINITY; - this.views = []; + this.views = null; this.wrapped = value; } @@ -4629,13 +4649,16 @@ * @returns {Object} Returns the cloned `LazyWrapper` object. */ function lazyClone() { - var result = new LazyWrapper(this.wrapped); + var iteratees = this.iteratees, + views = this.views, + result = new LazyWrapper(this.wrapped); + result.dir = this.dir; result.dropCount = this.dropCount; result.filtered = this.filtered; + result.iteratees = iteratees ? baseSlice(iteratees) : null; result.takeCount = this.takeCount; - push.apply(result.iteratees, this.iteratees); - push.apply(result.views, this.views); + result.views = views ? baseSlice(views) : null; return result; } @@ -4666,43 +4689,29 @@ */ function lazyValue() { var array = this.wrapped.value(), - length = array.length, - start = 0, - end = length, - views = this.views, - viewIndex = -1, - viewsLength = views.length; - - while (++viewIndex < viewsLength) { - var view = views[viewIndex], - size = view.size; - - switch (view.type) { - case 'drop': start += size; break; - case 'dropRight': end -= size; break; - case 'take': end = nativeMin(end, start + size); break; - case 'takeRight': start = nativeMax(start, end - size); break; - } - } - var dir = this.dir, - dropCount = this.dropCount, - droppedCount = 0, - doneDropping = !dropCount, - takeCount = nativeMin(end - start, this.takeCount - dropCount), + dir = this.dir, isRight = dir < 0, + length = array.length, + view = getView(0, length, this.views), + start = view.start, + end = view.end, + dropCount = this.dropCount, + takeCount = nativeMin(end - start, this.takeCount - dropCount), index = isRight ? end : start - 1, iteratees = this.iteratees, - iterateesLength = iteratees.length, + iterLength = iteratees ? iteratees.length : 0, resIndex = 0, result = []; outer: while (length-- && resIndex < takeCount) { - var iterateesIndex = -1, - value = array[index += dir]; + index += dir; - while (++iterateesIndex < iterateesLength) { - var data = iteratees[iterateesIndex], + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], iteratee = data.iteratee, computed = iteratee(value, index, array), type = data.type; @@ -4717,10 +4726,10 @@ } } } - if (doneDropping) { - result[resIndex++] = value; + if (dropCount) { + dropCount--; } else { - doneDropping = ++droppedCount >= dropCount; + result[resIndex++] = value; } } return isRight ? result.reverse() : result; @@ -7702,10 +7711,9 @@ } /** - * Creates an object composed of the inverted keys and values of the given - * object. If the given object contains duplicate values, subsequent values - * overwrite property assignments of previous values unless `multiValue` - * is `true`. + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite property + * assignments of previous values unless `multiValue` is `true`. * * @static * @memberOf _ @@ -7828,8 +7836,8 @@ result[index] = String(index); } for (var key in object) { - if (!(isProto && key == 'constructor') && - !(skipIndexes && (keyIndex = +key, keyIndex > -1 && keyIndex <= maxIndex && keyIndex % 1 == 0))) { + if (!(skipIndexes && (keyIndex = +key, keyIndex > -1 && keyIndex <= maxIndex && keyIndex % 1 == 0)) && + !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { result.push(key); } } @@ -7971,7 +7979,7 @@ } /** - * Creates a two dimensional array of a given object's key-value pairs, + * Creates a two dimensional array of the key-value pairs for `object`, * e.g. `[[key1, value1], [key2, value2]]`. * * @static @@ -8201,7 +8209,7 @@ } /** - * Checks if `string` ends with a given target string. + * Checks if `string` ends with the given target string. * * @static * @memberOf _ @@ -8209,8 +8217,7 @@ * @param {string} [string=''] The string to search. * @param {string} [target] The string to search for. * @param {number} [position=string.length] The position to search from. - * @returns {boolean} Returns `true` if the given string ends with the - * target string, else `false`. + * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`. * @example * * _.endsWith('abc', 'c'); @@ -8468,7 +8475,7 @@ }); /** - * Checks if `string` starts with a given target string. + * Checks if `string` starts with the given target string. * * @static * @memberOf _ @@ -8476,8 +8483,7 @@ * @param {string} [string=''] The string to search. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search from. - * @returns {boolean} Returns `true` if the given string starts with the - * target string, else `false`. + * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`. * @example * * _.startsWith('abc', 'a'); @@ -9361,7 +9367,7 @@ /** * Creates an array of numbers (positive and/or negative) progressing from - * `start` up to but not including `end`. If `start` is less than `end` a + * `start` up to, but not including, `end`. If `start` is less than `end` a * zero-length range is created unless a negative `step` is specified. * * @static @@ -9777,15 +9783,18 @@ LazyWrapper.prototype[methodName] = function(iteratee, thisArg) { iteratee = getCallback(iteratee, thisArg, 3); - var result = this.clone(); - result.filtered = isFilter || result.filtered; - result.iteratees.push({ 'iteratee': iteratee, 'type': lazyIterateeTypes[methodName] }); + var result = this.clone(), + filtered = result.filtered, + iteratees = result.iteratees || (result.iteratees = []); + + result.filtered = filtered || index == LAZY_FILTER_FLAG || (index == LAZY_WHILE_FLAG && result.dir < 0); + iteratees.push({ 'iteratee': iteratee, 'type': index }); return result; }; }); // add `LazyWrapper` methods for `_.drop` and `_.take` variants - arrayEach(['drop', 'take'], function(methodName) { + arrayEach(['drop', 'take'], function(methodName, index) { var countName = methodName + 'Count', whileName = methodName + 'While'; @@ -9793,14 +9802,13 @@ n = n == null ? 1 : nativeMax(+n || 0, 0); var result = this.clone(); - if (this.filtered) { - result[countName] = n; - return result; + if (result.filtered) { + var value = result[countName]; + result[countName] = index ? nativeMin(value, n) : (value + n); + } else { + var views = result.views || (result.views = []); + views.push({ 'size': n, 'type': methodName + (result.dir < 0 ? 'Right' : '') }); } - result.views.push({ - 'size': n, - 'type': methodName + (result.dir < 0 ? 'Right' : '') - }); return result; }; @@ -9809,9 +9817,7 @@ }; LazyWrapper.prototype[methodName + 'RightWhile'] = function(predicate, thisArg) { - var result = this.reverse()[whileName](predicate, thisArg); - result.filtered = true; - return result.reverse(); + return this.reverse()[whileName](predicate, thisArg).reverse(); }; }); diff --git a/dist/lodash.min.js b/dist/lodash.min.js index 6c37154ae..cdbd45e3a 100644 --- a/dist/lodash.min.js +++ b/dist/lodash.min.js @@ -5,75 +5,76 @@ */ ;(function(){function n(n,t){for(var r=-1,e=n.length;++rt||!r||typeof n=="undefined"&&e)return 1;if(n=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n)}function x(n,t){for(var r=-1,e=n.length,u=-1,o=[];++re&&(e=u)}return e}function Nt(n){for(var t=-1,r=n.length,e=Mu;++tu(t,i)&&f.push(i);return f}function Gt(n,t){var r=n?n.length:0;if(!Nr(r))return ur(n,t);for(var e=-1,u=Mr(n);++e=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n)}function x(n,t){for(var r=-1,e=n.length,u=-1,o=[];++re&&(e=u)}return e}function Ut(n){for(var t=-1,r=n.length,e=Mu;++tu(t,i)&&f.push(i);return f}function Gt(n,t){var r=n?n.length:0;if(!Wr(r))return ur(n,t);for(var e=-1,u=Mr(n);++ec))return false}else{var g=p&&gu.call(n,"__wrapped__"),h=h&&gu.call(t,"__wrapped__");if(g||h)return fr(g?n.value():n,h?t.value():t,r,e,u,o);if(!s)return false; -if(!f&&!p){switch(l){case gt:case vt:return+n==+t;case dt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case _t:case bt:return n==au(t)}return false}if(g=c?iu:n.constructor,l=i?iu:t.constructor,f){if(g.prototype.name!=l.prototype.name)return false}else if(p=!c&&gu.call(n,"constructor"),h=!i&&gu.call(t,"constructor"),p!=h||!p&&g!=l&&"constructor"in n&&"constructor"in t&&!(typeof g=="function"&&g instanceof g&&typeof l=="function"&&l instanceof l))return false;if(g=f?["message","name"]:lo(n),l=f?g:lo(t),c&&g.push("length"),i&&l.push("length"),c=g.length,p=l.length,c!=p&&!e)return false -}for(u||(u=[]),o||(o=[]),l=u.length;l--;)if(u[l]==n)return o[l]==t;if(u.push(n),o.push(t),i=true,a)for(;i&&++lc))return false}else{var g=p&&gu.call(n,"__wrapped__"),h=h&&gu.call(t,"__wrapped__");if(g||h)return fr(g?n.value():n,h?t.value():t,r,e,u,o);if(!s)return false; +if(!f&&!p){switch(l){case vt:case yt:return+n==+t;case mt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case bt:case wt:return n==au(t)}return false}if(g=c?iu:n.constructor,l=i?iu:t.constructor,f){if(g.prototype.name!=l.prototype.name)return false}else if(p=!c&&gu.call(n,"constructor"),h=!i&&gu.call(t,"constructor"),p!=h||!p&&g!=l&&"constructor"in n&&"constructor"in t&&!(typeof g=="function"&&g instanceof g&&typeof l=="function"&&l instanceof l))return false;if(g=f?["message","name"]:lo(n),l=f?g:lo(t),c&&g.push("length"),i&&l.push("length"),c=g.length,p=l.length,c!=p&&!e)return false +}for(u||(u=[]),o||(o=[]),l=u.length;l--;)if(u[l]==n)return o[l]==t;if(u.push(n),o.push(t),i=true,a)for(;i&&++le(a,p)&&((t||i)&&a.push(p),f.push(c))}return f}function dr(n,t){for(var r=-1,e=t(n),u=e.length,o=nu(u);++rt||null==r)return r;if(3e(a,p)&&((t||i)&&a.push(p),f.push(c))}return f}function dr(n,t){for(var r=-1,e=t(n),u=e.length,o=nu(u);++rt||null==r)return r;if(3t?0:t)}function Kr(n,t,r){var e=n?n.length:0;return t=e-((r||null==t?1:t)||0),Jr(n,0,0>t?0:t)}function Vr(n,t,r){var e=-1,u=n?n.length:0; -for(t=Fr(t,r,3);++er?Nu(e+r,0):r||0;else if(r)return r=Xr(n,t),n=n[r],(t===t?t===n:n!==n)?r:-1;return l(n,t,r)}function Gr(n){return Pr(n,1)}function Jr(n,t,r){var e=-1,u=n?n.length:0,o=typeof r;if(r&&"number"!=o&&Wr(n,t,r)&&(t=0,r=u),t=null==t?0:+t||0,0>t&&(t=-t>u?0:u+t),r="undefined"==o||r>u?u:+r||0,0>r&&(r+=u),r&&r==u&&!t)return c(n);for(u=t>r?0:r-t,r=nu(u);++er?Nu(e+r,0):r||0:0,typeof n=="string"||!oo(n)&&Ue(n)?rt?0:t)}function Kr(n,t,r){var e=n?n.length:0;return t=e-((r||null==t?1:t)||0),Jr(n,0,0>t?0:t)}function Vr(n,t,r){var e=-1,u=n?n.length:0; +for(t=Fr(t,r,3);++er?Wu(e+r,0):r||0;else if(r)return r=Xr(n,t),n=n[r],(t===t?t===n:n!==n)?r:-1;return l(n,t,r)}function Gr(n){return Pr(n,1)}function Jr(n,t,r){var e=-1,u=n?n.length:0,o=typeof r;if(r&&"number"!=o&&Nr(n,t,r)&&(t=0,r=u),t=null==t?0:+t||0,0>t&&(t=-t>u?0:u+t),r="undefined"==o||r>u?u:+r||0,0>r&&(r+=u),r&&r==u&&!t)return c(n);for(u=t>r?0:r-t,r=nu(u);++er?Wu(e+r,0):r||0:0,typeof n=="string"||!oo(n)&&Ue(n)?ri||r===Bu&&r===f)&&(i=r,f=n)}),f}function he(n,t){return se(n,Qe(t))}function ge(n,t,r,e){return(oo(n)?u:hr)(n,Fr(t,e,4),r,3>arguments.length,Gt)}function ve(n,t,r,e){return(oo(n)?o:hr)(n,Fr(t,e,4),r,3>arguments.length,Jt)}function ye(n){n=Br(n);for(var t=-1,r=n.length,e=nu(r);++targuments.length)return Rr(n,R,null,t);var r=Jr(arguments,2),e=x(r,_e.placeholder);return sr(n,R|T,r,e,t)}function be(n,t){var r=R|F;if(2i||r===Bu&&r===f)&&(i=r,f=n)}),f}function he(n,t){return se(n,Qe(t))}function ge(n,t,r,e){return(oo(n)?u:hr)(n,Fr(t,e,4),r,3>arguments.length,Gt)}function ve(n,t,r,e){return(oo(n)?o:hr)(n,Fr(t,e,4),r,3>arguments.length,Jt)}function ye(n){n=Br(n);for(var t=-1,r=n.length,e=nu(r);++targuments.length)return Rr(n,R,null,t);var r=Jr(arguments,2),e=x(r,_e.placeholder);return sr(n,R|T,r,e,t)}function be(n,t){var r=R|F;if(2=r||r>t?(f&&wu(f),r=p,f=s=p=k,r&&(h=go(),a=n.apply(c,i),s||f||(i=c=null))):s=ku(e,r)}function u(){s&&wu(s),f=s=p=k,(v||g!==t)&&(h=go(),a=n.apply(c,i),s||f||(i=c=null))}function o(){if(i=arguments,l=go(),c=this,p=v&&(s||!y),false===g)var r=y&&!s;else{f||y||(h=l);var o=g-(l-h),d=0>=o||o>g;d?(f&&(f=wu(f)),h=l,a=n.apply(c,i)):f||(f=ku(u,o)) -}return d&&s?s=wu(s):s||t===g||(s=ku(e,t)),r&&(d=true,a=n.apply(c,i)),!d||s||f||(i=c=null),a}var i,f,a,l,c,s,p,h=0,g=false,v=true;if(!De(n))throw new lu(B);if(t=0>t?0:t,true===r)var y=true,v=false;else Se(r)&&(y=r.leading,g="maxWait"in r&&Nu(+r.maxWait||0,t),v="trailing"in r?r.trailing:v);return o.cancel=function(){s&&wu(s),f&&wu(f),f=s=p=k},o}function Ae(){var n=arguments,r=n.length-1;if(0>r)return function(){};if(!t(n,De))throw new lu(B);return function(){for(var t=r,e=n[t].apply(this,arguments);t--;)e=n[t].call(this,e); -return e}}function Ee(n,t){function r(){var e=r.cache,u=t?t.apply(this,arguments):arguments[0];if(e.has(u))return e.get(u);var o=n.apply(this,arguments);return e.set(u,o),o}if(!De(n)||t&&!De(t))throw new lu(B);return r.cache=new Ee.Cache,r}function Ie(n){var t=Jr(arguments,1),r=x(t,Ie.placeholder);return sr(n,T,t,r)}function ke(n){var t=Jr(arguments,1),r=x(t,ke.placeholder);return sr(n,W,t,r)}function Oe(){this.__wrapped__={}}function Re(n){return Nr(n&&typeof n=="object"?n.length:k)&&yu.call(n)==pt||false -}function Fe(n){return n&&typeof n=="object"&&1===n.nodeType&&-1t||null==n||!Tu(t))return r;n=au(n);do t%2&&(r+=n),t=xu(t/2),n+=n;while(t);return r}function Pe(n,t,r){return(n=null==n?"":au(n))?r||null==t?n.slice(j(n),A(n)+1):(t=au(t),n.slice(h(n,t),g(n,t)+1)):n}function Ke(n,t,r){return(n=null!=n&&au(n))&&n.match((r?null:t)||lt)||[]}function Ve(n){try{return n()}catch(t){return Ce(t)?t:ru(t)}}function Ye(n,t,r){return Pt(n,r?k:t) +}return d&&s?s=wu(s):s||t===g||(s=ku(e,t)),r&&(d=true,a=n.apply(c,i)),!d||s||f||(i=c=null),a}var i,f,a,l,c,s,p,h=0,g=false,v=true;if(!De(n))throw new lu(M);if(t=0>t?0:t,true===r)var y=true,v=false;else Se(r)&&(y=r.leading,g="maxWait"in r&&Wu(+r.maxWait||0,t),v="trailing"in r?r.trailing:v);return o.cancel=function(){s&&wu(s),f&&wu(f),f=s=p=k},o}function Ae(){var n=arguments,r=n.length-1;if(0>r)return function(){};if(!t(n,De))throw new lu(M);return function(){for(var t=r,e=n[t].apply(this,arguments);t--;)e=n[t].call(this,e); +return e}}function Ee(n,t){function r(){var e=r.cache,u=t?t.apply(this,arguments):arguments[0];if(e.has(u))return e.get(u);var o=n.apply(this,arguments);return e.set(u,o),o}if(!De(n)||t&&!De(t))throw new lu(M);return r.cache=new Ee.Cache,r}function Ie(n){var t=Jr(arguments,1),r=x(t,Ie.placeholder);return sr(n,T,t,r)}function ke(n){var t=Jr(arguments,1),r=x(t,ke.placeholder);return sr(n,N,t,r)}function Oe(){this.__wrapped__={}}function Re(n){return Wr(n&&typeof n=="object"?n.length:k)&&yu.call(n)==ht||false +}function Fe(n){return n&&typeof n=="object"&&1===n.nodeType&&-1t||null==n||!Tu(t))return r;n=au(n);do t%2&&(r+=n),t=xu(t/2),n+=n;while(t);return r}function Pe(n,t,r){return(n=null==n?"":au(n))?r||null==t?n.slice(j(n),A(n)+1):(t=au(t),n.slice(h(n,t),g(n,t)+1)):n}function Ke(n,t,r){return(n=null!=n&&au(n))&&n.match((r?null:t)||ct)||[]}function Ve(n){try{return n()}catch(t){return Ce(t)?t:ru(t)}}function Ye(n,t,r){return Pt(n,r?k:t) }function Ze(n){return n}function Ge(n){var t=lo(n),r=t.length;if(1==r){var e=t[0],u=n[e];if(Ur(u))return function(n){return null!=n&&u===n[e]&&gu.call(n,e)}}for(var o=r,i=nu(r),f=nu(r);o--;){var u=n[t[o]],a=Ur(u);i[o]=a?u:Kt(u,true,zt),f[o]=a}return function(n){if(o=r,null==n)return!o;for(;o--;)if(f[o]?i[o]!==n[t[o]]:!gu.call(n,t[o]))return false;for(o=r;o--;)if(f[o]?!gu.call(n,t[o]):!fr(i[o],n[t[o]],null,true))return false;return true}}function Je(n,t,r){var e=true,u=Se(t),o=null==r,i=o&&u&&lo(t),f=i&&ir(t,i);(i&&i.length&&!f.length||o&&!u)&&(o&&(r=t),f=false,t=n,n=this),f||(f=ir(t,lo(t))),false===r?e=false:Se(r)&&"chain"in r&&(e=r.chain),r=-1,u=De(n); -for(o=f.length;++r=$)return r}else n=0;return Ju(r,e)}}(),no=wr(function(n,t,r){gu.call(n,r)?++n[r]:n[r]=1}),to=wr(function(n,t,r){gu.call(n,r)?n[r].push(t):n[r]=[t]}),ro=wr(function(n,t,r){n[r]=t}),eo=wr(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),uo=sr(me,T,[2],[]),oo=Su||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&yu.call(n)==ht||false -};Gu.dom||(Fe=function(n){return n&&typeof n=="object"&&1===n.nodeType&&!fo(n)||false});var io=qu||function(n){return typeof n=="number"&&Tu(n)},fo=ju?function(n){if(!n||yu.call(n)!=mt)return false;var t=n.valueOf,r=Te(t)&&(r=ju(t))&&ju(r);return r?n==r||ju(n)==r:Lr(n)}:Lr,ao=xr(Bt),lo=Wu?function(n){if(n)var t=n.constructor,r=n.length;return typeof t=="function"&&t.prototype===n||typeof r=="number"&&0--n?t.apply(this,arguments):void 0}},Tt.assign=ao,Tt.at=function(n){return(!n||Nr(n.length))&&(n=Br(n)),f(n,nr(arguments,false,false,1))},Tt.before=me,Tt.bind=_e,Tt.bindAll=function(n){for(var t=n,r=1(p?s(p,i):u(c,i))){for(t=r;--t;){var h=e[t]; -if(0>(h?s(h,i):u(n[t],i)))continue n}p&&p.push(i),c.push(i)}return c},Tt.invert=function(n,t,r){t=r?null:t,r=-1;for(var e=lo(n),u=e.length,o={};++rt?0:t)},Tt.takeRight=function(n,t,r){var e=n?n.length:0;return t=e-((r||null==t?1:t)||0),Jr(n,0>t?0:t)},Tt.takeRightWhile=function(n,t,r){var e=n?n.length:0;for(t=Fr(t,r,3);e--&&t(n[e],e,n););return Jr(n,e+1)},Tt.takeWhile=function(n,t,r){var e=-1,u=n?n.length:0;for(t=Fr(t,r,3);++er?0:+r||0,e))-t.length,0<=r&&n.indexOf(t,r)==r},Tt.escape=function(n){return(n=null==n?"":au(n))&&(G.lastIndex=0,G.test(n))?n.replace(G,m):n},Tt.escapeRegExp=Be,Tt.every=ie,Tt.find=ae,Tt.findIndex=Vr,Tt.findKey=function(n,t,r){return t=Fr(t,r,3),Qt(n,t,ur,true)},Tt.findLast=function(n,t,r){return t=Fr(t,r,3),Qt(n,t,Jt) -},Tt.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=Fr(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},Tt.findLastKey=function(n,t,r){return t=Fr(t,r,3),Qt(n,t,or,true)},Tt.findWhere=function(n,t){return ae(n,Ge(t))},Tt.first=Yr,Tt.has=function(n,t){return n?gu.call(n,t):false},Tt.identity=Ze,Tt.indexOf=Zr,Tt.isArguments=Re,Tt.isArray=oo,Tt.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&yu.call(n)==gt||false},Tt.isDate=function(n){return n&&typeof n=="object"&&yu.call(n)==vt||false -},Tt.isElement=Fe,Tt.isEmpty=function(n){if(null==n)return true;var t=n.length;return Nr(t)&&(oo(n)||Ue(n)||Re(n)||typeof n=="object"&&De(n.splice))?!t:!lo(n).length},Tt.isEqual=function(n,t,r,e){return r=typeof r=="function"&&Pt(r,e,3),!r&&Ur(n)&&Ur(t)?n===t:fr(n,t,r)},Tt.isError=Ce,Tt.isFinite=io,Tt.isFunction=De,Tt.isNaN=function(n){return We(n)&&n!=+n},Tt.isNative=Te,Tt.isNull=function(n){return null===n},Tt.isNumber=We,Tt.isObject=Se,Tt.isPlainObject=fo,Tt.isRegExp=Ne,Tt.isString=Ue,Tt.isUndefined=function(n){return typeof n=="undefined" -},Tt.kebabCase=po,Tt.last=function(n){var t=n?n.length:0;return t?n[t-1]:k},Tt.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(typeof r=="number")u=(0>r?Nu(e+r,0):Uu(r||0,e-1))+1;else if(r)return u=Hr(n,t)-1,n=n[u],(t===t?t===n:n!==n)?u:-1;if(t!==t)return b(n,u,true);for(;u--;)if(n[u]===t)return u;return-1},Tt.max=pe,Tt.min=function(n,t,r){r&&Wr(n,t,r)&&(t=null);var e=null==t,u=e&&oo(n),o=!u&&Ue(n);if(e&&!o)return Nt(u?n:Br(n));var i=Mu,f=i;return t=e&&o?p:Fr(t,r,3),Gt(n,function(n,r,e){r=t(n,r,e),(rr?0:+r||0,n.length),n.lastIndexOf(t,r)==r},Tt.template=function(n,t,r){var e=Tt.templateSettings;r&&Wr(n,t,r)&&(t=r=null),n=au(null==n?"":n),t=ao({},r||t,e,qt),r=ao({},t.imports,e.imports,qt); -var u,o,i=lo(r),f=Le(r),a=0;r=t.interpolate||ot;var l="__p+='";if(r=fu((t.escape||ot).source+"|"+r.source+"|"+(r===H?Q:ot).source+"|"+(t.evaluate||ot).source+"|$","g"),n.replace(r,function(t,r,e,i,f,c){return e||(e=i),l+=n.slice(a,c).replace(at,_),r&&(u=true,l+="'+__e("+r+")+'"),f&&(o=true,l+="';"+f+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),a=c+t.length,t}),l+="';",(t=t.variable)||(l="with(obj){"+l+"}"),l=(o?l.replace(K,""):l).replace(V,"$1").replace(Y,"$1;"),l="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",t=Ve(function(){return eu(i,"return "+l).apply(k,f) -}),t.source=l,Ce(t))throw t;return t},Tt.trim=Pe,Tt.trimLeft=function(n,t,r){return(n=null==n?"":au(n))?r||null==t?n.slice(j(n)):(t=au(t),n.slice(h(n,t))):n},Tt.trimRight=function(n,t,r){return(n=null==n?"":au(n))?r||null==t?n.slice(0,A(n)+1):(t=au(t),n.slice(0,g(n,t)+1)):n},Tt.trunc=function(n,t,r){t=r?null:t;var e=N;if(r=U,Se(t)){var u="separator"in t?t.separator:u,e="length"in t?+t.length||0:e;r="omission"in t?au(t.omission):r}else null!=t&&(e=+t||0);if(n=null==n?"":au(n),e>=n.length)return n; -if(e-=r.length,1>e)return r;if(t=n.slice(0,e),null==u)return t+r;if(Ne(u)){if(n.slice(e).search(u)){var o,i=n.slice(0,e);for(u.global||(u=fu(u.source,(nt.exec(u)||"")+"g")),u.lastIndex=0;n=u.exec(i);)o=n.index;t=t.slice(0,null==o?e:o)}}else n.indexOf(u,e)!=e&&(u=t.lastIndexOf(u),-1t?0:+t||0,n.length),n)},Tt.prototype.sample=function(n,t){return n=t?null:n,this.__chain__||null!=n?this.thru(function(t){return Tt.sample(t,n)}):Tt.sample(this.value())},Tt.VERSION=O,n("bind bindKey curry curryRight partial partialRight".split(" "),function(n){Tt[n].placeholder=Tt}),n(["filter","map","takeWhile"],function(n,t){var r=!t; -ue.prototype[n]=function(t,e){t=Fr(t,e,3);var u=this.clone();return u.filtered=r||u.filtered,u.iteratees.push({iteratee:t,type:Ut[n]}),u}}),n(["drop","take"],function(n){var t=n+"Count",r=n+"While";ue.prototype[n]=function(r){r=null==r?1:Nu(+r||0,0);var e=this.clone();return this.filtered?(e[t]=r,e):(e.views.push({size:r,type:n+(0>e.dir?"Right":"")}),e)},ue.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()},ue.prototype[n+"RightWhile"]=function(n,t){var e=this.reverse()[r](n,t); -return e.filtered=true,e.reverse()}}),n(["first","last"],function(n,t){var r="take"+(t?"Right":"");ue.prototype[n]=function(){return this[r](1).value()[0]}}),n(["initial","rest"],function(n,t){var r="drop"+(t?"":"Right");ue.prototype[n]=function(){return this[r](1)}}),ue.prototype.dropWhile=function(n,t){n=Fr(n,t,3);var r,e,u=0>this.dir;return this.filter(function(t,o,i){return r=r&&(u?oe),e=o,r||(r=!n(t,o,i))})},ue.prototype.reject=function(n,t){return n=Fr(n,t,3),this.filter(function(t,r,e){return!n(t,r,e) -})},ue.prototype.slice=function(n,t){n=null==n?0:+n||0;var r=0>n?this.takeRight(-n):this.drop(n);return typeof t!="undefined"&&(t=+t||0,r=0>t?r.dropRight(-t):r.take(t-n)),r},ur(ue.prototype,function(n,t){var r=/^(?:first|last)$/.test(t);Tt.prototype[t]=function(){var e=arguments,u=this.__chain__,o=this.__wrapped__,i=o instanceof ue;return r&&!u?i?n.call(o):Tt[t](this.value()):i||oo(o)?(o=n.apply(i?o:new ue(this),e),new ee(o,u)):this.thru(function(n){return n=[n],Au.apply(n,e),Tt[t].apply(Tt,n)})}}),n("concat join pop push shift sort splice unshift".split(" "),function(n){var t=cu[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:join|pop|shift)$/.test(n); -Tt.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),ue.prototype.clone=function(){var n=new ue(this.wrapped);return n.dir=this.dir,n.dropCount=this.dropCount,n.filtered=this.filtered,n.takeCount=this.takeCount,Au.apply(n.iteratees,this.iteratees),Au.apply(n.views,this.views),n},ue.prototype.reverse=function(){var n=this.filtered,t=n?new ue(this):this.clone();return t.dir=-1*this.dir,t.filtered=n,t},ue.prototype.value=function(){for(var n=this.wrapped.value(),t=n.length,r=0,e=t,u=this.views,o=-1,i=u.length;++ou,r=l?e:r-1,e=this.iteratees,c=e.length,s=0,p=[];n:for(;t--&&s=o}return l?p.reverse():p},Tt.prototype.chain=function(){return re(this)},Tt.prototype.reverse=function(){return this.thru(function(n){return n.reverse() -})},Tt.prototype.toString=function(){return au(this.value())},Tt.prototype.toJSON=Tt.prototype.value=Tt.prototype.valueOf=function(){var n=this.__wrapped__;n instanceof ue&&(n=n.value());for(var t=-1,r=this.__queue__,e=r.length;++t"'`]/g,J=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,Q=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,nt=/\w*$/,tt=/^\s*function[ \n\r\t]+\w/,rt=/^0[xX]/,et=/^\[object .+?Constructor\]$/,ut=/[\xC0-\xD6\xD8-\xDE\xDF-\xF6\xF8-\xFF]/g,ot=/($^)/,it=/[.*+?^${}()|[\]\/\\]/g,ft=/\bthis\b/,at=/['\n\r\u2028\u2029\\]/g,lt=RegExp("[A-Z\\xC0-\\xD6\\xD8-\\xDE]{2,}(?=[A-Z\\xC0-\\xD6\\xD8-\\xDE][a-z\\xDF-\\xF6\\xF8-\\xFF]+)|[A-Z\\xC0-\\xD6\\xD8-\\xDE]?[a-z\\xDF-\\xF6\\xF8-\\xFF]+|[A-Z\\xC0-\\xD6\\xD8-\\xDE]+|[0-9]+","g"),ct=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",st="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout document isFinite parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap window WinRTError".split(" "),pt="[object Arguments]",ht="[object Array]",gt="[object Boolean]",vt="[object Date]",yt="[object Error]",dt="[object Number]",mt="[object Object]",_t="[object RegExp]",bt="[object String]",wt="[object ArrayBuffer]",xt="[object Float32Array]",jt="[object Float64Array]",At="[object Int8Array]",Et="[object Int16Array]",It="[object Int32Array]",kt="[object Uint8Array]",Ot="[object Uint8ClampedArray]",Rt="[object Uint16Array]",Ft="[object Uint32Array]",Ct={}; -Ct[pt]=Ct[ht]=Ct[xt]=Ct[jt]=Ct[At]=Ct[Et]=Ct[It]=Ct[kt]=Ct[Ot]=Ct[Rt]=Ct[Ft]=true,Ct[wt]=Ct[gt]=Ct[vt]=Ct[yt]=Ct["[object Function]"]=Ct["[object Map]"]=Ct[dt]=Ct[mt]=Ct[_t]=Ct["[object Set]"]=Ct[bt]=Ct["[object WeakMap]"]=false;var Dt={};Dt[pt]=Dt[ht]=Dt[wt]=Dt[gt]=Dt[vt]=Dt[xt]=Dt[jt]=Dt[At]=Dt[Et]=Dt[It]=Dt[dt]=Dt[mt]=Dt[_t]=Dt[bt]=Dt[kt]=Dt[Ot]=Dt[Rt]=Dt[Ft]=true,Dt[yt]=Dt["[object Function]"]=Dt["[object Map]"]=Dt["[object Set]"]=Dt["[object WeakMap]"]=false;var St={leading:false,maxWait:0,trailing:false},Tt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Wt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Nt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ut={filter:L,map:z,takeWhile:3},$t={"function":true,object:true},qt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Lt=$t[typeof window]&&window||this,zt=$t[typeof exports]&&exports&&!exports.nodeType&&exports,$t=$t[typeof module]&&module&&!module.nodeType&&module,Bt=zt&&$t&&typeof global=="object"&&global; +for(o=f.length;++r=$)return r}else n=0;return Ju(r,e)}}(),no=wr(function(n,t,r){gu.call(n,r)?++n[r]:n[r]=1}),to=wr(function(n,t,r){gu.call(n,r)?n[r].push(t):n[r]=[t]}),ro=wr(function(n,t,r){n[r]=t}),eo=wr(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),uo=sr(me,T,[2],[]),oo=Su||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&yu.call(n)==gt||false +};Gu.dom||(Fe=function(n){return n&&typeof n=="object"&&1===n.nodeType&&!fo(n)||false});var io=qu||function(n){return typeof n=="number"&&Tu(n)},fo=ju?function(n){if(!n||yu.call(n)!=_t)return false;var t=n.valueOf,r=Te(t)&&(r=ju(t))&&ju(r);return r?n==r||ju(n)==r:Lr(n)}:Lr,ao=xr(Bt),lo=Nu?function(n){if(n)var t=n.constructor,r=n.length;return typeof t=="function"&&t.prototype===n||typeof r=="number"&&0--n?t.apply(this,arguments):void 0}},Nt.assign=ao,Nt.at=function(n){return(!n||Wr(n.length))&&(n=Br(n)),f(n,nr(arguments,false,false,1))},Nt.before=me,Nt.bind=_e,Nt.bindAll=function(n){for(var t=n,r=1(p?s(p,i):u(c,i))){for(t=r;--t;){var h=e[t]; +if(0>(h?s(h,i):u(n[t],i)))continue n}p&&p.push(i),c.push(i)}return c},Nt.invert=function(n,t,r){t=r?null:t,r=-1;for(var e=lo(n),u=e.length,o={};++rt?0:t)},Nt.takeRight=function(n,t,r){var e=n?n.length:0;return t=e-((r||null==t?1:t)||0),Jr(n,0>t?0:t)},Nt.takeRightWhile=function(n,t,r){var e=n?n.length:0;for(t=Fr(t,r,3);e--&&t(n[e],e,n););return Jr(n,e+1)},Nt.takeWhile=function(n,t,r){var e=-1,u=n?n.length:0;for(t=Fr(t,r,3);++er?0:+r||0,e))-t.length,0<=r&&n.indexOf(t,r)==r},Nt.escape=function(n){return(n=null==n?"":au(n))&&(J.lastIndex=0,J.test(n))?n.replace(J,m):n},Nt.escapeRegExp=Be,Nt.every=ie,Nt.find=ae,Nt.findIndex=Vr,Nt.findKey=function(n,t,r){return t=Fr(t,r,3),Qt(n,t,ur,true)},Nt.findLast=function(n,t,r){return t=Fr(t,r,3),Qt(n,t,Jt) +},Nt.findLastIndex=function(n,t,r){var e=n?n.length:0;for(t=Fr(t,r,3);e--;)if(t(n[e],e,n))return e;return-1},Nt.findLastKey=function(n,t,r){return t=Fr(t,r,3),Qt(n,t,or,true)},Nt.findWhere=function(n,t){return ae(n,Ge(t))},Nt.first=Yr,Nt.has=function(n,t){return n?gu.call(n,t):false},Nt.identity=Ze,Nt.indexOf=Zr,Nt.isArguments=Re,Nt.isArray=oo,Nt.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&yu.call(n)==vt||false},Nt.isDate=function(n){return n&&typeof n=="object"&&yu.call(n)==yt||false +},Nt.isElement=Fe,Nt.isEmpty=function(n){if(null==n)return true;var t=n.length;return Wr(t)&&(oo(n)||Ue(n)||Re(n)||typeof n=="object"&&De(n.splice))?!t:!lo(n).length},Nt.isEqual=function(n,t,r,e){return r=typeof r=="function"&&Pt(r,e,3),!r&&Ur(n)&&Ur(t)?n===t:fr(n,t,r)},Nt.isError=Ce,Nt.isFinite=io,Nt.isFunction=De,Nt.isNaN=function(n){return Ne(n)&&n!=+n},Nt.isNative=Te,Nt.isNull=function(n){return null===n},Nt.isNumber=Ne,Nt.isObject=Se,Nt.isPlainObject=fo,Nt.isRegExp=We,Nt.isString=Ue,Nt.isUndefined=function(n){return typeof n=="undefined" +},Nt.kebabCase=po,Nt.last=function(n){var t=n?n.length:0;return t?n[t-1]:k},Nt.lastIndexOf=function(n,t,r){var e=n?n.length:0;if(!e)return-1;var u=e;if(typeof r=="number")u=(0>r?Wu(e+r,0):Uu(r||0,e-1))+1;else if(r)return u=Hr(n,t)-1,n=n[u],(t===t?t===n:n!==n)?u:-1;if(t!==t)return b(n,u,true);for(;u--;)if(n[u]===t)return u;return-1},Nt.max=pe,Nt.min=function(n,t,r){r&&Nr(n,t,r)&&(t=null);var e=null==t,u=e&&oo(n),o=!u&&Ue(n);if(e&&!o)return Ut(u?n:Br(n));var i=Mu,f=i;return t=e&&o?p:Fr(t,r,3),Gt(n,function(n,r,e){r=t(n,r,e),(rr?0:+r||0,n.length),n.lastIndexOf(t,r)==r},Nt.template=function(n,t,r){var e=Nt.templateSettings;r&&Nr(n,t,r)&&(t=r=null),n=au(null==n?"":n),t=ao({},r||t,e,qt),r=ao({},t.imports,e.imports,qt); +var u,o,i=lo(r),f=Le(r),a=0;r=t.interpolate||it;var l="__p+='";if(r=fu((t.escape||it).source+"|"+r.source+"|"+(r===Q?nt:it).source+"|"+(t.evaluate||it).source+"|$","g"),n.replace(r,function(t,r,e,i,f,c){return e||(e=i),l+=n.slice(a,c).replace(lt,_),r&&(u=true,l+="'+__e("+r+")+'"),f&&(o=true,l+="';"+f+";\n__p+='"),e&&(l+="'+((__t=("+e+"))==null?'':__t)+'"),a=c+t.length,t}),l+="';",(t=t.variable)||(l="with(obj){"+l+"}"),l=(o?l.replace(V,""):l).replace(Y,"$1").replace(Z,"$1;"),l="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}",t=Ve(function(){return eu(i,"return "+l).apply(k,f) +}),t.source=l,Ce(t))throw t;return t},Nt.trim=Pe,Nt.trimLeft=function(n,t,r){return(n=null==n?"":au(n))?r||null==t?n.slice(j(n)):(t=au(t),n.slice(h(n,t))):n},Nt.trimRight=function(n,t,r){return(n=null==n?"":au(n))?r||null==t?n.slice(0,A(n)+1):(t=au(t),n.slice(0,g(n,t)+1)):n},Nt.trunc=function(n,t,r){t=r?null:t;var e=W;if(r=U,Se(t)){var u="separator"in t?t.separator:u,e="length"in t?+t.length||0:e;r="omission"in t?au(t.omission):r}else null!=t&&(e=+t||0);if(n=null==n?"":au(n),e>=n.length)return n; +if(e-=r.length,1>e)return r;if(t=n.slice(0,e),null==u)return t+r;if(We(u)){if(n.slice(e).search(u)){var o,i=n.slice(0,e);for(u.global||(u=fu(u.source,(tt.exec(u)||"")+"g")),u.lastIndex=0;n=u.exec(i);)o=n.index;t=t.slice(0,null==o?e:o)}}else n.indexOf(u,e)!=e&&(u=t.lastIndexOf(u),-1t?0:+t||0,n.length),n)},Nt.prototype.sample=function(n,t){return n=t?null:n,this.__chain__||null!=n?this.thru(function(t){return Nt.sample(t,n)}):Nt.sample(this.value())},Nt.VERSION=O,n("bind bindKey curry curryRight partial partialRight".split(" "),function(n){Nt[n].placeholder=Nt}),n(["filter","map","takeWhile"],function(n,t){ue.prototype[n]=function(n,r){n=Fr(n,r,3); +var e=this.clone(),u=e.filtered,o=e.iteratees||(e.iteratees=[]);return e.filtered=u||t==L||t==B&&0>e.dir,o.push({iteratee:n,type:t}),e}}),n(["drop","take"],function(n,t){var r=n+"Count",e=n+"While";ue.prototype[n]=function(e){e=null==e?1:Wu(+e||0,0);var u=this.clone();if(u.filtered){var o=u[r];u[r]=t?Uu(o,e):o+e}else(u.views||(u.views=[])).push({size:e,type:n+(0>u.dir?"Right":"")});return u},ue.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()},ue.prototype[n+"RightWhile"]=function(n,t){return this.reverse()[e](n,t).reverse() +}}),n(["first","last"],function(n,t){var r="take"+(t?"Right":"");ue.prototype[n]=function(){return this[r](1).value()[0]}}),n(["initial","rest"],function(n,t){var r="drop"+(t?"":"Right");ue.prototype[n]=function(){return this[r](1)}}),ue.prototype.dropWhile=function(n,t){n=Fr(n,t,3);var r,e,u=0>this.dir;return this.filter(function(t,o,i){return r=r&&(u?oe),e=o,r||(r=!n(t,o,i))})},ue.prototype.reject=function(n,t){return n=Fr(n,t,3),this.filter(function(t,r,e){return!n(t,r,e)})},ue.prototype.slice=function(n,t){n=null==n?0:+n||0; +var r=0>n?this.takeRight(-n):this.drop(n);return typeof t!="undefined"&&(t=+t||0,r=0>t?r.dropRight(-t):r.take(t-n)),r},ur(ue.prototype,function(n,t){var r=/^(?:first|last)$/.test(t);Nt.prototype[t]=function(){var e=arguments,u=this.__chain__,o=this.__wrapped__,i=o instanceof ue;return r&&!u?i?n.call(o):Nt[t](this.value()):i||oo(o)?(o=n.apply(i?o:new ue(this),e),new ee(o,u)):this.thru(function(n){return n=[n],Au.apply(n,e),Nt[t].apply(Nt,n)})}}),n("concat join pop push shift sort splice unshift".split(" "),function(n){var t=cu[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:join|pop|shift)$/.test(n); +Nt.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),ue.prototype.clone=function(){var n=this.iteratees,t=this.views,r=new ue(this.wrapped);return r.dir=this.dir,r.dropCount=this.dropCount,r.filtered=this.filtered,r.iteratees=n?c(n):null,r.takeCount=this.takeCount,r.views=t?c(t):null,r},ue.prototype.reverse=function(){var n=this.filtered,t=n?new ue(this):this.clone();return t.dir=-1*this.dir,t.filtered=n,t},ue.prototype.value=function(){var n,t=this.wrapped.value(),r=this.dir,e=0>r,u=t.length; +n=u;for(var o=this.views,i=0,f=-1,a=o?o.length:0;++f"'`]/g,X=/<%-([\s\S]+?)%>/g,H=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,tt=/\w*$/,rt=/^\s*function[ \n\r\t]+\w/,et=/^0[xX]/,ut=/^\[object .+?Constructor\]$/,ot=/[\xC0-\xD6\xD8-\xDE\xDF-\xF6\xF8-\xFF]/g,it=/($^)/,ft=/[.*+?^${}()|[\]\/\\]/g,at=/\bthis\b/,lt=/['\n\r\u2028\u2029\\]/g,ct=RegExp("[A-Z\\xC0-\\xD6\\xD8-\\xDE]{2,}(?=[A-Z\\xC0-\\xD6\\xD8-\\xDE][a-z\\xDF-\\xF6\\xF8-\\xFF]+)|[A-Z\\xC0-\\xD6\\xD8-\\xDE]?[a-z\\xDF-\\xF6\\xF8-\\xFF]+|[A-Z\\xC0-\\xD6\\xD8-\\xDE]+|[0-9]+","g"),st=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",pt="Array ArrayBuffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Math Number Object RegExp Set String _ clearTimeout document isFinite parseInt setTimeout TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap window WinRTError".split(" "),ht="[object Arguments]",gt="[object Array]",vt="[object Boolean]",yt="[object Date]",dt="[object Error]",mt="[object Number]",_t="[object Object]",bt="[object RegExp]",wt="[object String]",xt="[object ArrayBuffer]",jt="[object Float32Array]",At="[object Float64Array]",Et="[object Int8Array]",It="[object Int16Array]",kt="[object Int32Array]",Ot="[object Uint8Array]",Rt="[object Uint8ClampedArray]",Ft="[object Uint16Array]",Ct="[object Uint32Array]",Dt={}; +Dt[ht]=Dt[gt]=Dt[jt]=Dt[At]=Dt[Et]=Dt[It]=Dt[kt]=Dt[Ot]=Dt[Rt]=Dt[Ft]=Dt[Ct]=true,Dt[xt]=Dt[vt]=Dt[yt]=Dt[dt]=Dt["[object Function]"]=Dt["[object Map]"]=Dt[mt]=Dt[_t]=Dt[bt]=Dt["[object Set]"]=Dt[wt]=Dt["[object WeakMap]"]=false;var St={};St[ht]=St[gt]=St[xt]=St[vt]=St[yt]=St[jt]=St[At]=St[Et]=St[It]=St[kt]=St[mt]=St[_t]=St[bt]=St[wt]=St[Ot]=St[Rt]=St[Ft]=St[Ct]=true,St[dt]=St["[object Function]"]=St["[object Map]"]=St["[object Set]"]=St["[object WeakMap]"]=false;var Tt={leading:false,maxWait:0,trailing:false},Nt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Wt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Ut={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},$t={"function":true,object:true},qt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Lt=$t[typeof window]&&window!==(this&&this.window)?window:this,zt=$t[typeof exports]&&exports&&!exports.nodeType&&exports,$t=$t[typeof module]&&module&&!module.nodeType&&module,Bt=zt&&$t&&typeof global=="object"&&global; !Bt||Bt.global!==Bt&&Bt.window!==Bt&&Bt.self!==Bt||(Lt=Bt);var Bt=$t&&$t.exports===zt&&zt,Mt=I();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Lt._=Mt, define(function(){return Mt})):zt&&$t?Bt?($t.exports=Mt)._=Mt:zt._=Mt:Lt._=Mt}).call(this); \ No newline at end of file