Browse files

Ensure `_.keys` use in `createIterator` is consistent per build.

  • Loading branch information...
1 parent aa6c47c commit c456dc0d80248af8b95881b1406bb576508dd5f6 @jdalton jdalton committed Mar 19, 2013
Showing with 1,212 additions and 1,212 deletions.
  1. +24 −17 build.js
  2. +4 −2 build/pre-compile.js
  3. +155 −159 dist/lodash.compat.js
  4. +40 −40 dist/lodash.compat.min.js
  5. +145 −149 dist/lodash.js
  6. +143 −139 dist/lodash.legacy.js
  7. +39 −39 dist/lodash.legacy.min.js
  8. +36 −36 dist/lodash.min.js
  9. +158 −152 dist/lodash.mobile.js
  10. +36 −36 dist/lodash.mobile.min.js
  11. +128 −122 dist/lodash.underscore.js
  12. +28 −28 dist/lodash.underscore.min.js
  13. +121 −134 doc/README.md
  14. +155 −159 lodash.js
View
41 build.js
@@ -98,8 +98,8 @@
'every': ['createCallback', 'isArray'],
'filter': ['createCallback', 'isArray'],
'find': ['createCallback', 'forEach', 'isArray'],
- 'findIndex': [],
- 'findKey': [],
+ 'findIndex': ['createCallback'],
+ 'findKey': ['createCallback'],
'first': [],
'flatten': ['createCallback', 'isArray'],
'forEach': ['createCallback', 'isArguments', 'isArray', 'isString'],
@@ -190,10 +190,12 @@
'arrays',
'bottom',
'firstArg',
+ 'init',
'loop',
'shadowedProps',
'top',
- 'useHas'
+ 'useHas',
+ 'useKeys'
];
/** List of all Lo-Dash methods */
@@ -923,16 +925,19 @@
*
* @private
* @param {String} source The source to process.
- * @param {String} varName The name of the variable to remove.
+ * @param {String} identifier The name of the variable or property to remove.
* @returns {String} Returns the modified source.
*/
- function removeFromCreateIterator(source, varName) {
- var snippet = matchFunction(source, 'createIterator');
+ function removeFromCreateIterator(source, identifier) {
+ var snippet = matchFunction(source, 'createIterator');
if (!snippet) {
return source;
}
// remove data object property assignment
- var modified = snippet.replace(RegExp("^(?: *\\/\\/.*\\n)* *'" + varName + "': *" + varName + '.+\\n+', 'm'), '');
+ var modified = snippet
+ .replace(RegExp("^(?: *\\/\\/.*\\n)* *'" + identifier + "':.+\\n+", 'm'), '')
+ .replace(/,(?=\s*})/, '');
+
source = source.replace(snippet, function() {
return modified;
});
@@ -941,7 +946,7 @@
snippet = modified.match(/Function\([\s\S]+$/)[0];
modified = snippet
- .replace(RegExp('\\b' + varName + '\\b,? *', 'g'), '')
+ .replace(RegExp('\\b' + identifier + '\\b,? *', 'g'), '')
.replace(/, *',/, "',")
.replace(/,\s*\)/, ')')
@@ -1019,12 +1024,11 @@
* @returns {String} Returns the modified source.
*/
function removeKeysOptimization(source) {
- source = removeVar(source, 'isJSC');
- source = removeSupportProp(source, 'fastKeys');
+ source = removeFromCreateIterator(source, 'useKeys');
// remove optimized branch in `iteratorTemplate`
source = source.replace(getIteratorTemplate(source), function(match) {
- return match.replace(/^(?: *\/\/.*\n)* *["']( *)<% *if *\(support\.fastKeys[\s\S]+?["']\1<% *} *else *{ *%>.+\n([\s\S]+?) *["']\1<% *} *%>.+/m, "'\\n' +\n$2");
+ return match.replace(/^(?: *\/\/.*\n)* *["']( *)<% *if *\(useHas *&& *useKeys[\s\S]+?["']\1<% *} *else *{ *%>.+\n([\s\S]+?) *["']\1<% *} *%>.+/m, "'\\n' +\n$2");
});
return source;
@@ -1826,7 +1830,7 @@
source = replaceVar(source, varName, 'false');
});
- _.each(['argsClass', 'fastBind', 'fastKeys'], function(propName) {
+ _.each(['argsClass', 'fastBind'], function(propName) {
source = replaceSupportProp(source, propName, 'false');
});
@@ -2484,17 +2488,20 @@
if (!isRemoved(source, 'keys')) {
source = source.replace(
matchFunction(source, 'keys').replace(/[\s\S]+?var keys *= */, ''),
- matchFunction(source, 'shimKeys').replace(/[\s\S]+?function shimKeys/, 'function').replace(/}\n$/, '};\n')
+ matchFunction(source, 'shimKeys').replace(/[\s\S]+?var shimKeys *= */, '')
);
source = removeFunction(source, 'shimKeys');
}
// replace `_.isArguments` with fallback
if (!isRemoved(source, 'isArguments')) {
- source = source.replace(
- matchFunction(source, 'isArguments').replace(/[\s\S]+?function isArguments/, ''),
- getIsArgumentsFallback(source).match(/isArguments *= *function([\s\S]+?) *};/)[1] + ' }\n'
- );
+ source = source.replace(matchFunction(source, 'isArguments').replace(/[\s\S]+?function isArguments/, ''), function() {
+ var fallback = getIsArgumentsFallback(source),
+ body = fallback.match(/isArguments *= *function([\s\S]+? *});/)[1],
+ indent = getIndent(fallback);
+
+ return body.replace(RegExp('^' + indent, 'gm'), indent.slice(0, -2)) + '\n';
+ });
source = removeIsArgumentsFallback(source);
}
View
6 build/pre-compile.js
@@ -21,8 +21,8 @@
'isString',
'iterable',
'length',
+ 'keys',
'lodash',
- 'nativeKeys',
'object',
'objectTypes',
'ownIndex',
@@ -39,10 +39,12 @@
'arrays',
'bottom',
'firstArg',
+ 'init',
'loop',
'shadowedProps',
'top',
- 'useHas'
+ 'useHas',
+ 'useKeys'
];
/** Used to minify variables and string values to a single character */
View
314 dist/lodash.compat.js
@@ -186,7 +186,6 @@
/** Detect various environments */
var isIeOpera = reNative.test(context.attachEvent),
- isJSC = !/\n{2,}/.test(Function()),
isV8 = nativeBind && !/\n|true/.test(nativeBind + isIeOpera);
/** Used to lookup a built-in constructor by [[Class]] */
@@ -304,14 +303,6 @@
support.fastBind = nativeBind && !isV8;
/**
- * Detect if `Object.keys` exists and is inferred to be fast (Firefox, IE, Opera, V8).
- *
- * @memberOf _.support
- * @type Boolean
- */
- support.fastKeys = nativeKeys && (isIeOpera || isV8 || !isJSC);
-
- /**
* Detect if own properties are iterated after inherited properties (all but IE < 9).
*
* @memberOf _.support
@@ -453,7 +444,9 @@
var __p = 'var index, iterable = ' +
(obj.firstArg) +
- ', result = iterable;\nif (!iterable) return result;\n' +
+ ', result = ' +
+ (obj.init) +
+ ';\nif (!iterable) return result;\n' +
(obj.top) +
';\n';
if (obj.arrays) {
@@ -476,8 +469,8 @@
__p += '\n var skipProto = typeof iterable == \'function\';\n ';
}
- if (support.fastKeys && obj.useHas) {
- __p += '\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] ? nativeKeys(iterable) : [],\n length = ownProps.length;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n ';
+ if (obj.useHas && obj.useKeys) {
+ __p += '\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] ? keys(iterable) : [],\n length = ownProps.length;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n ';
if (support.enumPrototypes) {
__p += 'if (!(skipProto && index == \'prototype\')) {\n ';
}
@@ -716,9 +709,11 @@
// iterator options
'arrays': 'isArray(iterable)',
'bottom': '',
+ 'init': 'iterable',
'loop': '',
'top': '',
- 'useHas': true
+ 'useHas': true,
+ 'useKeys': !!keys
};
// merge options into a template data object
@@ -732,14 +727,14 @@
// create the function factory
var factory = Function(
- 'hasOwnProperty, isArguments, isArray, isString, lodash, ' +
- 'objectTypes, nativeKeys',
+ 'hasOwnProperty, isArguments, isArray, isString, keys, ' +
+ 'lodash, objectTypes',
'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}'
);
// return the compiled function
return factory(
- hasOwnProperty, isArguments, isArray, isString, lodash,
- objectTypes, nativeKeys
+ hasOwnProperty, isArguments, isArray, isString, keys,
+ lodash, objectTypes
);
}
@@ -818,6 +813,63 @@
}
/**
+ * A fallback implementation of `isPlainObject` that checks if a given `value`
+ * is an object created by the `Object` constructor, assuming objects created
+ * by the `Object` constructor have no inherited enumerable properties and that
+ * there are no `Object.prototype` extensions.
+ *
+ * @private
+ * @param {Mixed} value The value to check.
+ * @returns {Boolean} Returns `true`, if `value` is a plain object, else `false`.
+ */
+ function shimIsPlainObject(value) {
+ // avoid non-objects and false positives for `arguments` objects
+ var result = false;
+ if (!(value && toString.call(value) == objectClass) || (!support.argsClass && isArguments(value))) {
+ return result;
+ }
+ // check that the constructor is `Object` (i.e. `Object instanceof Object`)
+ var ctor = value.constructor;
+ if ((!isFunction(ctor) && (support.nodeClass || !isNode(value))) || ctor instanceof ctor) {
+ // IE < 9 iterates inherited properties before own properties. If the first
+ // iterated property is an object's own property then there are no inherited
+ // enumerable properties.
+ if (support.ownLast) {
+ forIn(value, function(value, key, object) {
+ result = hasOwnProperty.call(object, key);
+ return false;
+ });
+ return result === true;
+ }
+ // In most environments an object's own properties are iterated before
+ // its inherited properties. If the last iterated property is an object's
+ // own property then there are no inherited enumerable properties.
+ forIn(value, function(value, key) {
+ result = key;
+ });
+ return result === false || hasOwnProperty.call(value, result);
+ }
+ return result;
+ }
+
+ /**
+ * A fallback implementation of `Object.keys` that produces an array of the
+ * given object's own enumerable property names.
+ *
+ * @private
+ * @type Function
+ * @param {Object} object The object to inspect.
+ * @returns {Array} Returns a new array of property names.
+ */
+ var shimKeys = createIterator({
+ 'args': 'object',
+ 'init': '[]',
+ 'top': 'if (!(objectTypes[typeof object])) return result',
+ 'loop': 'result.push(index)',
+ 'arrays': false
+ });
+
+ /**
* Slices the `collection` from the `start` index up to, but not including,
* the `end` index.
*
@@ -885,92 +937,6 @@
}
/**
- * This method is similar to `_.find`, except that it returns the key of the
- * element that passes the callback check, instead of the element itself.
- *
- * @static
- * @memberOf _
- * @category Objects
- * @param {Array|Object|String} collection The collection to iterate over.
- * @param {Function|Object|String} [callback=identity] The function called per
- * iteration. If a property name or object is passed, it will be used to create
- * a "_.pluck" or "_.where" style callback, respectively.
- * @param {Mixed} [thisArg] The `this` binding of `callback`.
- * @returns {Mixed} Returns the key of the found element, else `undefined`.
- * @example
- *
- * _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { return num % 2 == 0; });
- * // => 'b'
- */
- function findKey(collection, callback, thisArg) {
- var result;
- callback = lodash.createCallback(callback, thisArg);
- forOwn(collection, function(value, key, collection) {
- if (callback(value, key, collection)) {
- result = key;
- return false;
- }
- });
- return result;
- }
-
- /**
- * Iterates over `object`'s own and inherited enumerable properties, executing
- * the `callback` for each property. The `callback` is bound to `thisArg` and
- * invoked with three arguments; (value, key, object). Callbacks may exit iteration
- * early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @type Function
- * @category Objects
- * @param {Object} object The object to iterate over.
- * @param {Function} [callback=identity] The function called per iteration.
- * @param {Mixed} [thisArg] The `this` binding of `callback`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * function Dog(name) {
- * this.name = name;
- * }
- *
- * Dog.prototype.bark = function() {
- * alert('Woof, woof!');
- * };
- *
- * _.forIn(new Dog('Dagny'), function(value, key) {
- * alert(key);
- * });
- * // => alerts 'name' and 'bark' (order is not guaranteed)
- */
- var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, {
- 'useHas': false
- });
-
- /**
- * Iterates over an object's own enumerable properties, executing the `callback`
- * for each property. The `callback` is bound to `thisArg` and invoked with three
- * arguments; (value, key, object). Callbacks may exit iteration early by explicitly
- * returning `false`.
- *
- * @static
- * @memberOf _
- * @type Function
- * @category Objects
- * @param {Object} object The object to iterate over.
- * @param {Function} [callback=identity] The function called per iteration.
- * @param {Mixed} [thisArg] The `this` binding of `callback`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
- * alert(key);
- * });
- * // => alerts '0', '1', and 'length' (order is not guaranteed)
- */
- var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions);
-
- /**
* Checks if `value` is an array.
*
* @static
@@ -1017,62 +983,6 @@
};
/**
- * A fallback implementation of `isPlainObject` that checks if a given `value`
- * is an object created by the `Object` constructor, assuming objects created
- * by the `Object` constructor have no inherited enumerable properties and that
- * there are no `Object.prototype` extensions.
- *
- * @private
- * @param {Mixed} value The value to check.
- * @returns {Boolean} Returns `true`, if `value` is a plain object, else `false`.
- */
- function shimIsPlainObject(value) {
- // avoid non-objects and false positives for `arguments` objects
- var result = false;
- if (!(value && toString.call(value) == objectClass) || (!support.argsClass && isArguments(value))) {
- return result;
- }
- // check that the constructor is `Object` (i.e. `Object instanceof Object`)
- var ctor = value.constructor;
- if ((!isFunction(ctor) && (support.nodeClass || !isNode(value))) || ctor instanceof ctor) {
- // IE < 9 iterates inherited properties before own properties. If the first
- // iterated property is an object's own property then there are no inherited
- // enumerable properties.
- if (support.ownLast) {
- forIn(value, function(value, key, object) {
- result = hasOwnProperty.call(object, key);
- return false;
- });
- return result === true;
- }
- // In most environments an object's own properties are iterated before
- // its inherited properties. If the last iterated property is an object's
- // own property then there are no inherited enumerable properties.
- forIn(value, function(value, key) {
- result = key;
- });
- return result === false || hasOwnProperty.call(value, result);
- }
- return result;
- }
-
- /**
- * A fallback implementation of `Object.keys` that produces an array of the
- * given object's own enumerable property names.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @returns {Array} Returns a new array of property names.
- */
- function shimKeys(object) {
- var result = [];
- forOwn(object, function(value, key) {
- result.push(key);
- });
- return result;
- }
-
- /**
* Used to convert characters to HTML entities:
*
* Though the `>` character is escaped for symmetry, characters like `>` and `/`
@@ -1330,6 +1240,92 @@
var defaults = createIterator(defaultsIteratorOptions);
/**
+ * This method is similar to `_.find`, except that it returns the key of the
+ * element that passes the callback check, instead of the element itself.
+ *
+ * @static
+ * @memberOf _
+ * @category Objects
+ * @param {Array|Object|String} collection The collection to iterate over.
+ * @param {Function|Object|String} [callback=identity] The function called per
+ * iteration. If a property name or object is passed, it will be used to create
+ * a "_.pluck" or "_.where" style callback, respectively.
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
+ * @returns {Mixed} Returns the key of the found element, else `undefined`.
+ * @example
+ *
+ * _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { return num % 2 == 0; });
+ * // => 'b'
+ */
+ function findKey(collection, callback, thisArg) {
+ var result;
+ callback = lodash.createCallback(callback, thisArg);
+ forOwn(collection, function(value, key, collection) {
+ if (callback(value, key, collection)) {
+ result = key;
+ return false;
+ }
+ });
+ return result;
+ }
+
+ /**
+ * Iterates over `object`'s own and inherited enumerable properties, executing
+ * the `callback` for each property. The `callback` is bound to `thisArg` and
+ * invoked with three arguments; (value, key, object). Callbacks may exit iteration
+ * early by explicitly returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @type Function
+ * @category Objects
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [callback=identity] The function called per iteration.
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function Dog(name) {
+ * this.name = name;
+ * }
+ *
+ * Dog.prototype.bark = function() {
+ * alert('Woof, woof!');
+ * };
+ *
+ * _.forIn(new Dog('Dagny'), function(value, key) {
+ * alert(key);
+ * });
+ * // => alerts 'name' and 'bark' (order is not guaranteed)
+ */
+ var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, {
+ 'useHas': false
+ });
+
+ /**
+ * Iterates over an object's own enumerable properties, executing the `callback`
+ * for each property. The `callback` is bound to `thisArg` and invoked with three
+ * arguments; (value, key, object). Callbacks may exit iteration early by explicitly
+ * returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @type Function
+ * @category Objects
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [callback=identity] The function called per iteration.
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
+ * alert(key);
+ * });
+ * // => alerts '0', '1', and 'length' (order is not guaranteed)
+ */
+ var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions);
+
+ /**
* Creates a sorted array of all enumerable properties, own and inherited,
* of `object` that have function values.
*
View
80 dist/lodash.compat.min.js
@@ -4,43 +4,43 @@
* Build: `lodash -o ./dist/lodash.compat.js`
* Underscore.js 1.4.4 underscorejs.org/LICENSE
*/
-;(function(n){function t(r){function a(n){return n&&typeof n=="object"&&!ve(n)&&Vt.call(n,"__wrapped__")?n:new L(n)}function B(n,t,e){var r=n.length,u=r-t>=e;if(u){var a={};for(e=t-1;++e<r;){var o=Ft(n[e]);(Vt.call(a,o)?a[o]:a[o]=[]).push(n[e])}}return function(e){if(u){var r=Ft(e);return Vt.call(a,r)&&-1<mt(a[r],e)}return-1<mt(n,e,t)}}function F(n){return n.charCodeAt(0)}function q(n,t){var e=n.b,r=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1
-}return e<r?-1:1}function R(n,t,e,r){function u(){var f=arguments,c=o?this:t;return a||(n=t[i]),e.length&&(f=f.length?(f=U(f),r?f.concat(e):e.concat(f)):e),this instanceof u?(M.prototype=n.prototype,c=new M,M.prototype=null,f=n.apply(c,f),nt(f)?f:c):n.apply(c,f)}var a=Z(n),o=!e,i=t;return o&&(e=t),a||(t=n),u}function T(){for(var n,t={f:_,b:"k(m)",c:"",e:"",g:"",h:!0},e=0;n=arguments[e];e++)for(var r in n)t[r]=n[r];if(n=t.a,t.d=/^[^,]+/.exec(n)[0],e=It,r="var i,m="+t.d+",u=m;if(!m)return u;"+t.g+";",t.b?(r+="var n=m.length;i=-1;if("+t.b+"){",ce.unindexedChars&&(r+="if(l(m)){m=m.split('')}"),r+="while(++i<n){"+t.e+"}}else{"):ce.nonEnumArgs&&(r+="var n=m.length;i=-1;if(n&&j(m)){while(++i<n){i+='';"+t.e+"}}else{"),ce.enumPrototypes&&(r+="var v=typeof m=='function';"),ce.fastKeys&&t.h?(r+="var s=-1,t=r[typeof m]?p(m):[],n=t.length;while(++s<n){i=t[s];",ce.enumPrototypes&&(r+="if(!(v&&i=='prototype')){"),r+=t.e,ce.enumPrototypes&&(r+="}")):(r+="for(i in m){",(ce.enumPrototypes||t.h)&&(r+="if(",ce.enumPrototypes&&(r+="!(v&&i=='prototype')"),ce.enumPrototypes&&t.h&&(r+="&&"),t.h&&(r+="h.call(m,i)"),r+="){"),r+=t.e+";",(ce.enumPrototypes||t.h)&&(r+="}")),r+="}",ce.nonEnumShadows){r+="var f=m.constructor;";
-for(var u=0;7>u;u++)r+="i='"+t.f[u]+"';if(","constructor"==t.f[u]&&(r+="!(f&&f.prototype===m)&&"),r+="h.call(m,i)){"+t.e+"}"}return(t.b||ce.nonEnumArgs)&&(r+="}"),r+=t.c+";return u",e("h,j,k,l,o,r,p","return function("+n+"){"+r+"}")(Vt,G,ve,et,a,P,ne)}function D(n){return"\\"+N[n]}function z(n){return he[n]}function K(n){return typeof n.toString!="function"&&typeof Ft=="string"(n)}function L(n){this.__wrapped__=n}function M(){}function U(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;
-e=e-t||0;for(var u=Et(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function V(n){return ye[n]}function G(n){return Qt.call(n)==C}function H(n){var t=!1;if(!n||Qt.call(n)!=E||!ce.argsClass&&G(n))return t;var e=n.constructor;return!Z(e)&&(ce.nodeClass||!K(n))||e instanceof e?ce.ownLast?(pe(n,function(n,e,r){return t=Vt.call(r,e),!1}),!0===t):(pe(n,function(n,e){t=e}),!1===t||Vt.call(n,t)):t}function J(n){var t=[];return se(n,function(n,e){t.push(e)}),t}function Q(n,t,r,u,o,i){var f=n;if(typeof t=="function"&&(u=r,r=t,t=!1),typeof r=="function"){if(r=typeof u=="undefined"?r:a.createCallback(r,u,1),f=r(f),typeof f!="undefined")return f;
-f=n}if(u=nt(f)){var c=Qt.call(f);if(!I[c]||!ce.nodeClass&&K(f))return f;var l=ve(f)}if(!u||!t)return u?l?U(f):me({},f):f;switch(u=fe[c],c){case j:case k:return new u(+f);case O:case A:return new u(f);case S:return u(f.source,v.exec(f))}for(o||(o=[]),i||(i=[]),c=o.length;c--;)if(o[c]==n)return i[c];return f=l?u(f.length):{},l&&(Vt.call(n,"index")&&(f.index=n.index),Vt.call(n,"input")&&(f.input=n.input)),o.push(n),i.push(f),(l?ct:se)(n,function(n,u){f[u]=Q(n,t,r,e,o,i)}),f}function W(n){var t=[];return pe(n,function(n,e){Z(n)&&t.push(e)
-}),t.sort()}function X(n){for(var t=-1,e=ge(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function Y(n,t,e,r,u,o){var f=e===i;if(e&&!f){e=typeof r=="undefined"?e:a.createCallback(e,r,2);var c=e(n,t);if(typeof c!="undefined")return!!c}if(n===t)return 0!==n||1/n==1/t;var l=typeof n,p=typeof t;if(n===n&&(!n||"function"!=l&&"object"!=l)&&(!t||"function"!=p&&"object"!=p))return!1;if(null==n||null==t)return n===t;if(p=Qt.call(n),l=Qt.call(t),p==C&&(p=E),l==C&&(l=E),p!=l)return!1;switch(p){case j:case k:return+n==+t;
-case O:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case S:case A:return n==Ft(t)}if(l=p==w,!l){if(Vt.call(n,"__wrapped__")||Vt.call(t,"__wrapped__"))return Y(n.__wrapped__||n,t.__wrapped__||t,e,r,u,o);if(p!=E||!ce.nodeClass&&(K(n)||K(t)))return!1;var p=!ce.argsObject&&G(n)?$t:n.constructor,s=!ce.argsObject&&G(t)?$t:t.constructor;if(p!=s&&(!Z(p)||!(p instanceof p&&Z(s)&&s instanceof s)))return!1}for(u||(u=[]),o||(o=[]),p=u.length;p--;)if(u[p]==n)return o[p]==t;var v=0,c=!0;if(u.push(n),o.push(t),l){if(p=n.length,v=t.length,c=v==n.length,!c&&!f)return c;
-for(;v--;)if(l=p,s=t[v],f)for(;l--&&!(c=Y(n[l],s,e,r,u,o)););else if(!(c=Y(n[v],s,e,r,u,o)))break;return c}return pe(t,function(t,a,i){return Vt.call(i,a)?(v++,c=Vt.call(n,a)&&Y(n[a],t,e,r,u,o)):void 0}),c&&!f&&pe(n,function(n,t,e){return Vt.call(e,t)?c=-1<--v:void 0}),c}function Z(n){return typeof n=="function"}function nt(n){return n?P[typeof n]:!1}function tt(n){return typeof n=="number"||Qt.call(n)==O}function et(n){return typeof n=="string"||Qt.call(n)==A}function rt(n,t,e){var r=arguments,u=0,o=2;
-if(!nt(n))return n;if(e===i)var f=r[3],c=r[4],l=r[5];else c=[],l=[],typeof e!="number"&&(o=r.length),3<o&&"function"==typeof r[o-2]?f=a.createCallback(r[--o-1],r[o--],2):2<o&&"function"==typeof r[o-1]&&(f=r[--o]);for(;++u<o;)(ve(r[u])?ct:se)(r[u],function(t,e){var r,u,a=t,o=n[e];if(t&&((u=ve(t))||be(t))){for(a=c.length;a--;)if(r=c[a]==t){o=l[a];break}r||(o=u?ve(o)?o:[]:be(o)?o:{},f&&(a=f(o,t),typeof a!="undefined"&&(o=a)),c.push(t),l.push(o),f||(o=rt(o,t,i,f,c,l)))}else f&&(a=f(o,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(o=a);
-n[e]=o});return n}function ut(n){for(var t=-1,e=ge(n),r=e.length,u=Et(r);++t<r;)u[t]=n[e[t]];return u}function at(n,t,e){var r=-1,u=n?n.length:0,a=!1;return e=(0>e?te(0,u+e):e)||0,typeof u=="number"?a=-1<(et(n)?n.indexOf(t,e):mt(n,t,e)):le(n,function(n){return++r<e?void 0:!(a=n===t)}),a}function ot(n,t,e){var r=!0;if(t=a.createCallback(t,e),ve(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else le(n,function(n,e,u){return r=!!t(n,e,u)});return r}function it(n,t,e){var r=[];if(t=a.createCallback(t,e),ve(n)){e=-1;
-for(var u=n.length;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}}else le(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function ft(n,t,e){if(t=a.createCallback(t,e),!ve(n)){var r;return le(n,function(n,e,u){return t(n,e,u)?(r=n,!1):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e];if(t(o,e,n))return o}}function ct(n,t,e){if(t&&typeof e=="undefined"&&ve(n)){e=-1;for(var r=n.length;++e<r&&!1!==t(n[e],e,n););}else le(n,t,e);return n}function lt(n,t,e){var r=-1,u=n?n.length:0,o=Et(typeof u=="number"?u:0);
-if(t=a.createCallback(t,e),ve(n))for(;++r<u;)o[r]=t(n[r],r,n);else le(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function pt(n,t,e){var r=-1/0,u=r;if(!t&&ve(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>u&&(u=i)}}else t=!t&&et(n)?F:a.createCallback(t,e),le(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)});return u}function st(n,t,e,r){var u=3>arguments.length;if(t=a.createCallback(t,r,4),ve(n)){var o=-1,i=n.length;for(u&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n)}else le(n,function(n,r,a){e=u?(u=!1,n):t(e,n,r,a)
-});return e}function vt(n,t,e,r){var u=n,o=n?n.length:0,i=3>arguments.length;if(typeof o!="number")var f=ge(n),o=f.length;else ce.unindexedChars&&et(n)&&(u=n.split(""));return t=a.createCallback(t,r,4),ct(n,function(n,r,a){r=f?f[--o]:--o,e=i?(i=!1,u[r]):t(e,u[r],r,a)}),e}function gt(n,t,e){var r;if(t=a.createCallback(t,e),ve(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else le(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function ht(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=-1;
-for(t=a.createCallback(t,e);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[0];return U(n,0,ee(te(0,r),u))}}function yt(n,t,e,r){var u=-1,o=n?n.length:0,i=[];for(typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1),null!=e&&(e=a.createCallback(e,r));++u<o;)r=n[u],e&&(r=e(r,u,n)),ve(r)?Gt.apply(i,t?r:yt(r)):i.push(r);return i}function mt(n,t,e){var r=-1,u=n?n.length:0;if(typeof e=="number")r=(0>e?te(0,u+e):e||0)-1;else if(e)return r=bt(n,t),n[r]===t?r:-1;for(;++r<u;)if(n[r]===t)return r;return-1}function dt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;
-for(t=a.createCallback(t,e);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:te(0,t);return U(n,r)}function bt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?a.createCallback(e,r,1):kt,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function _t(n,t,e,r){var u=-1,o=n?n.length:0,i=[],f=i;typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1);var c=!t&&75<=o;if(c)var l={};for(null!=e&&(f=[],e=a.createCallback(e,r));++u<o;){r=n[u];var p=e?e(r,u,n):r;if(c)var s=Ft(p),s=Vt.call(l,s)?!(f=l[s]):f=l[s]=[];(t?!u||f[f.length-1]!==p:s||0>mt(f,p))&&((e||c)&&f.push(p),i.push(r))
-}return i}function Ct(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:u[a[0]]=a[1]}return u}function wt(n,t){return ce.fastBind||Wt&&2<arguments.length?Wt.call.apply(Wt,arguments):R(n,t,U(arguments,2))}function jt(n){var t=U(arguments,1);return Jt(function(){n.apply(e,t)},1)}function kt(n){return n}function xt(n){ct(W(n),function(t){var e=a[t]=n[t];a.prototype[t]=function(){var n=this.__wrapped__,t=[n];return Gt.apply(t,arguments),t=e.apply(a,t),n&&typeof n=="object"&&n==t?this:new L(t)
-}})}function Ot(){return this.__wrapped__}r=r?$.defaults(n.Object(),r,$.pick(n,b)):n;var Et=r.Array,St=r.Boolean,At=r.Date,It=r.Function,Pt=r.Math,Nt=r.Number,$t=r.Object,Bt=r.RegExp,Ft=r.String,qt=Et(),Rt=$t(),Tt=r._,Dt=Bt("^"+Ft(Rt.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),zt=Pt.ceil,Kt=r.clearTimeout,Lt=qt.concat,Mt=Pt.floor,Ut=Dt.test(Ut=$t.getPrototypeOf)&&Ut,Vt=Rt.hasOwnProperty,Gt=qt.push,Ht=r.setImmediate,Jt=r.setTimeout,Qt=Rt.toString,Wt=Dt.test(Wt=U.bind)&&Wt,Xt=Dt.test(Xt=Et.isArray)&&Xt,Yt=r.isFinite,Zt=r.isNaN,ne=Dt.test(ne=$t.keys)&&ne,te=Pt.max,ee=Pt.min,re=r.parseInt,ue=Pt.random,ae=Dt.test(r.attachEvent),oe=!/\n{2,}/.test(It()),ie=Wt&&!/\n|true/.test(Wt+ae),fe={};
-fe[w]=Et,fe[j]=St,fe[k]=At,fe[E]=$t,fe[O]=Nt,fe[S]=Bt,fe[A]=Ft;var ce=a.support={};(function(){var n=function(){this.x=1},t={0:1,length:1},e=[];n.prototype={valueOf:1,y:1};for(var r in new n)e.push(r);for(r in arguments);ce.argsObject=arguments.constructor==$t,ce.argsClass=G(arguments),ce.enumPrototypes=n.propertyIsEnumerable("prototype"),ce.fastBind=Wt&&!ie,ce.fastKeys=ne&&(ae||ie||!oe),ce.ownLast="x"!=e[0],ce.nonEnumArgs=0!=r,ce.nonEnumShadows=!/valueOf/.test(e),ce.spliceObjects=(qt.splice.call(t,0,1),!t[0]),ce.unindexedChars="xx"!="x"[0]+$t("x")[0];
-try{ce.nodeClass=!(Qt.call(document)==E&&!Ft({toString:0}))}catch(u){ce.nodeClass=!0}})(1),a.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:g,variable:"",imports:{_:a}};var St={a:"q,w,g",g:"var a=arguments,b=0,c=typeof g=='number'?2:a.length;while(++b<c){m=a[b];if(m&&r[typeof m]){",e:"if(typeof u[i]=='undefined')u[i]=m[i]",c:"}}"},Pt={a:"e,d,x",g:"d=d&&typeof x=='undefined'?d:o.createCallback(d,x)",b:"typeof n=='number'",e:"if(d(m[i],i,e)===false)return u"},Nt={g:"if(!r[typeof m])return u;"+Pt.g,b:!1},le=T(Pt);
-L.prototype=a.prototype,ce.argsClass||(G=function(n){return n?Vt.call(n,"callee"):!1});var pe=T(Pt,Nt,{h:!1}),se=T(Pt,Nt),ve=Xt||function(n){return ce.argsObject&&n instanceof Et||Qt.call(n)==w},ge=ne?function(n){return nt(n)?ce.enumPrototypes&&typeof n=="function"||ce.nonEnumArgs&&n.length&&G(n)?J(n):ne(n):[]}:J,he={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ye=X(he),me=T(St,{g:St.g.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=o.createCallback(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),e:"u[i]=d?d(u[i],m[i]):m[i]"}),de=T(St);
-Z(/x/)&&(Z=function(n){return n instanceof It||Qt.call(n)==x});var be=Ut?function(n){if(!n||Qt.call(n)!=E||!ce.argsClass&&G(n))return!1;var t=n.valueOf,e=typeof t=="function"&&(e=Ut(t))&&Ut(e);return e?n==e||Ut(n)==e:H(n)}:H;return ie&&u&&typeof Ht=="function"&&(jt=wt(Ht,r)),Ht=8==re("08")?re:function(n,t){return re(et(n)?n.replace(h,""):n,t||0)},a.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},a.assign=me,a.at=function(n){var t=-1,e=Lt.apply(qt,U(arguments,1)),r=e.length,u=Et(r);
-for(ce.unindexedChars&&et(n)&&(n=n.split(""));++t<r;)u[t]=n[e[t]];return u},a.bind=wt,a.bindAll=function(n){for(var t=Lt.apply(qt,arguments),e=1<t.length?0:(t=W(n),-1),r=t.length;++e<r;){var u=t[e];n[u]=wt(n[u],n)}return n},a.bindKey=function(n,t){return R(n,t,U(arguments,2))},a.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},a.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}
-},a.countBy=function(n,t,e){var r={};return t=a.createCallback(t,e),ct(n,function(n,e,u){e=Ft(t(n,e,u)),Vt.call(r,e)?r[e]++:r[e]=1}),r},a.createCallback=function(n,t,e){if(null==n)return kt;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=ge(n);return function(t){for(var e=u.length,r=!1;e--&&(r=Y(t[u[e]],n[u[e]],i)););return r}}return typeof t!="undefined"?1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)}:4===e?function(e,r,u,a){return n.call(t,e,r,u,a)
-}:function(e,r,u){return n.call(t,e,r,u)}:n},a.debounce=function(n,t,e){function r(){i=null,e||(a=n.apply(o,u))}var u,a,o,i;return function(){var f=e&&!i;return u=arguments,o=this,Kt(i),i=Jt(r,t),f&&(a=n.apply(o,u)),a}},a.defaults=de,a.defer=jt,a.delay=function(n,t){var r=U(arguments,2);return Jt(function(){n.apply(e,r)},t)},a.difference=function(n){for(var t=-1,e=n?n.length:0,r=Lt.apply(qt,arguments),r=B(r,e,100),u=[];++t<e;){var a=n[t];r(a)||u.push(a)}return u},a.filter=it,a.flatten=yt,a.forEach=ct,a.forIn=pe,a.forOwn=se,a.functions=W,a.groupBy=function(n,t,e){var r={};
-return t=a.createCallback(t,e),ct(n,function(n,e,u){e=Ft(t(n,e,u)),(Vt.call(r,e)?r[e]:r[e]=[]).push(n)}),r},a.initial=function(n,t,e){if(!n)return[];var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return U(n,0,ee(te(0,u-r),u))},a.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,a=n?n.length:0,o=100<=a,i=[],f=i;n:for(;++u<a;){var c=n[u];if(o)var l=Ft(c),l=Vt.call(r[0],l)?!(f=r[0][l]):f=r[0][l]=[];
-if(l||0>mt(f,c)){o&&f.push(c);for(var p=e;--p;)if(!(r[p]||(r[p]=B(t[p],0,100)))(c))continue n;i.push(c)}}return i},a.invert=X,a.invoke=function(n,t){var e=U(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Et(typeof a=="number"?a:0);return ct(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},a.keys=ge,a.map=lt,a.max=pt,a.memoize=function(n,t){var e={};return function(){var r=Ft(t?t.apply(this,arguments):arguments[0]);return Vt.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},a.merge=rt,a.min=function(n,t,e){var r=1/0,u=r;
-if(!t&&ve(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i<u&&(u=i)}}else t=!t&&et(n)?F:a.createCallback(t,e),le(n,function(n,e,a){e=t(n,e,a),e<r&&(r=e,u=n)});return u},a.omit=function(n,t,e){var r=typeof t=="function",u={};if(r)t=a.createCallback(t,e);else var o=Lt.apply(qt,arguments);return pe(n,function(n,e,a){(r?!t(n,e,a):0>mt(o,e,1))&&(u[e]=n)}),u},a.once=function(n){var t,e;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},a.pairs=function(n){for(var t=-1,e=ge(n),r=e.length,u=Et(r);++t<r;){var a=e[t];
-u[t]=[a,n[a]]}return u},a.partial=function(n){return R(n,U(arguments,1))},a.partialRight=function(n){return R(n,U(arguments,1),null,i)},a.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=0,o=Lt.apply(qt,arguments),i=nt(n)?o.length:0;++u<i;){var f=o[u];f in n&&(r[f]=n[f])}else t=a.createCallback(t,e),pe(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},a.pluck=lt,a.range=function(n,t,e){n=+n||0,e=+e||1,null==t&&(t=n,n=0);var r=-1;t=te(0,zt((t-n)/e));for(var u=Et(t);++r<t;)u[r]=n,n+=e;
-return u},a.reject=function(n,t,e){return t=a.createCallback(t,e),it(n,function(n,e,r){return!t(n,e,r)})},a.rest=dt,a.shuffle=function(n){var t=-1,e=n?n.length:0,r=Et(typeof e=="number"?e:0);return ct(n,function(n){var e=Mt(ue()*(++t+1));r[t]=r[e],r[e]=n}),r},a.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,o=Et(typeof u=="number"?u:0);for(t=a.createCallback(t,e),ct(n,function(n,e,u){o[++r]={a:t(n,e,u),b:r,c:n}}),u=o.length,o.sort(q);u--;)o[u]=o[u].c;return o},a.tap=function(n,t){return t(n),n},a.throttle=function(n,t){function e(){i=new At,o=null,u=n.apply(a,r)
-}var r,u,a,o,i=0;return function(){var f=new At,c=t-(f-i);return r=arguments,a=this,0<c?o||(o=Jt(e,c)):(Kt(o),o=null,i=f,u=n.apply(a,r)),u}},a.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Et(n);for(t=a.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},a.toArray=function(n){return n&&typeof n.length=="number"?ce.unindexedChars&&et(n)?n.split(""):U(n):ut(n)},a.union=function(){return _t(Lt.apply(qt,arguments))},a.uniq=_t,a.values=ut,a.where=it,a.without=function(n){for(var t=-1,e=n?n.length:0,r=B(arguments,1,30),u=[];++t<e;){var a=n[t];
-r(a)||u.push(a)}return u},a.wrap=function(n,t){return function(){var e=[n];return Gt.apply(e,arguments),t.apply(this,e)}},a.zip=function(n){for(var t=-1,e=n?pt(lt(arguments,"length")):0,r=Et(e);++t<e;)r[t]=lt(arguments,t);return r},a.zipObject=Ct,a.collect=lt,a.drop=dt,a.each=ct,a.extend=me,a.methods=W,a.object=Ct,a.select=it,a.tail=dt,a.unique=_t,xt(a),a.clone=Q,a.cloneDeep=function(n,t,e){return Q(n,!0,t,e)},a.contains=at,a.escape=function(n){return null==n?"":Ft(n).replace(m,z)},a.every=ot,a.find=ft,a.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;
-for(t=a.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},a.findKey=function(n,t,e){var r;return t=a.createCallback(t,e),se(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},a.has=function(n,t){return n?Vt.call(n,t):!1},a.identity=kt,a.indexOf=mt,a.isArguments=G,a.isArray=ve,a.isBoolean=function(n){return!0===n||!1===n||Qt.call(n)==j},a.isDate=function(n){return n instanceof At||Qt.call(n)==k},a.isElement=function(n){return n?1===n.nodeType:!1},a.isEmpty=function(n){var t=!0;if(!n)return t;
-var e=Qt.call(n),r=n.length;return e==w||e==A||(ce.argsClass?e==C:G(n))||e==E&&typeof r=="number"&&Z(n.splice)?!r:(se(n,function(){return t=!1}),t)},a.isEqual=Y,a.isFinite=function(n){return Yt(n)&&!Zt(parseFloat(n))},a.isFunction=Z,a.isNaN=function(n){return tt(n)&&n!=+n},a.isNull=function(n){return null===n},a.isNumber=tt,a.isObject=nt,a.isPlainObject=be,a.isRegExp=function(n){return n instanceof Bt||Qt.call(n)==S},a.isString=et,a.isUndefined=function(n){return typeof n=="undefined"},a.lastIndexOf=function(n,t,e){var r=n?n.length:0;
-for(typeof e=="number"&&(r=(0>e?te(0,r+e):ee(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},a.mixin=xt,a.noConflict=function(){return r._=Tt,this},a.parseInt=Ht,a.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+Mt(ue()*((+t||0)-n+1))},a.reduce=st,a.reduceRight=vt,a.result=function(n,t){var r=n?n[t]:e;return Z(r)?n[t]():r},a.runInContext=t,a.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:ge(n).length},a.some=gt,a.sortedIndex=bt,a.template=function(n,t,r){var u=a.templateSettings;
-n||(n=""),r=de({},r,u);var o,i=de({},r.imports,u.imports),u=ge(i),i=ut(i),p=0,v=r.interpolate||y,h="__p+='",v=Bt((r.escape||y).source+"|"+v.source+"|"+(v===g?s:y).source+"|"+(r.evaluate||y).source+"|$","g");n.replace(v,function(t,e,r,u,a,i){return r||(r=u),h+=n.slice(p,i).replace(d,D),e&&(h+="'+__e("+e+")+'"),a&&(o=!0,h+="';"+a+";__p+='"),r&&(h+="'+((__t=("+r+"))==null?'':__t)+'"),p=i+t.length,t}),h+="';\n",v=r=r.variable,v||(r="obj",h="with("+r+"){"+h+"}"),h=(o?h.replace(f,""):h).replace(c,"$1").replace(l,"$1;"),h="function("+r+"){"+(v?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+h+"return __p}";
-try{var m=It(u,"return "+h).apply(e,i)}catch(b){throw b.source=h,b}return t?m(t):(m.source=h,m)},a.unescape=function(n){return null==n?"":Ft(n).replace(p,V)},a.uniqueId=function(n){var t=++o;return Ft(null==n?"":n)+t},a.all=ot,a.any=gt,a.detect=ft,a.foldl=st,a.foldr=vt,a.include=at,a.inject=st,se(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(){var t=[this.__wrapped__];return Gt.apply(t,arguments),n.apply(a,t)})}),a.first=ht,a.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;
-for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[u-1];return U(n,te(0,u-r))}},a.take=ht,a.head=ht,se(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return null==t||e&&typeof t!="function"?r:new L(r)})}),a.VERSION="1.0.1",a.prototype.toString=function(){return Ft(this.__wrapped__)},a.prototype.value=Ot,a.prototype.valueOf=Ot,le(["join","pop","shift"],function(n){var t=qt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)
-}}),le(["push","reverse","sort","unshift"],function(n){var t=qt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),le(["concat","slice","splice"],function(n){var t=qt[n];a.prototype[n]=function(){return new L(t.apply(this.__wrapped__,arguments))}}),ce.spliceObjects||le(["pop","shift","splice"],function(n){var t=qt[n],e="splice"==n;a.prototype[n]=function(){var n=this.__wrapped__,r=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new L(r):r}}),a}var e,r=typeof exports=="object"&&exports,u=typeof module=="object"&&module&&module.exports==r&&module,a=typeof global=="object"&&global;
-a.global===a&&(n=a);var o=0,i={},f=/\b__p\+='';/g,c=/\b(__p\+=)''\+/g,l=/(__e\(.*?\)|\b__t\))\+'';/g,p=/&(?:amp|lt|gt|quot|#39);/g,s=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,v=/\w*$/,g=/<%=([\s\S]+?)%>/g,h=/^0+(?=.$)/,y=/($^)/,m=/[&<>"']/g,d=/['\n\r\t\u2028\u2029\\]/g,b="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),C="[object Arguments]",w="[object Array]",j="[object Boolean]",k="[object Date]",x="[object Function]",O="[object Number]",E="[object Object]",S="[object RegExp]",A="[object String]",I={};
-I[x]=!1,I[C]=I[w]=I[j]=I[k]=I[O]=I[E]=I[S]=I[A]=!0;var P={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},N={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},$=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=$,define(function(){return $})):r&&!r.nodeType?u?(u.exports=$)._=$:r._=$:n._=$})(this);
+;(function(n){function t(r){function a(n){return n&&typeof n=="object"&&!ve(n)&&Jt.call(n,"__wrapped__")?n:new V(n)}function R(n,t,e){var r=n.length,u=r-t>=e;if(u){var a={};for(e=t-1;++e<r;){var o=Tt(n[e]);(Jt.call(a,o)?a[o]:a[o]=[]).push(n[e])}}return function(e){if(u){var r=Tt(e);return Jt.call(a,r)&&-1<bt(a[r],e)}return-1<bt(n,e,t)}}function T(n){return n.charCodeAt(0)}function D(n,t){var e=n.b,r=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1
+}return e<r?-1:1}function z(n,t,e,r){function u(){var f=arguments,c=o?this:t;return a||(n=t[i]),e.length&&(f=f.length?(f=J(f),r?f.concat(e):e.concat(f)):e),this instanceof u?(G.prototype=n.prototype,c=new G,G.prototype=null,f=n.apply(c,f),et(f)?f:c):n.apply(c,f)}var a=tt(n),o=!e,i=t;return o&&(e=t),a||(t=n),u}function L(){for(var n,t={g:w,b:"k(m)",c:"",e:"m",f:"",h:"",i:!0,j:!!o},e=0;n=arguments[e];e++)for(var r in n)t[r]=n[r];if(n=t.a,t.d=/^[^,]+/.exec(n)[0],e=$t,r="var i,m="+t.d+",u="+t.e+";if(!m)return u;"+t.h+";",t.b?(r+="var n=m.length;i=-1;if("+t.b+"){",le.unindexedChars&&(r+="if(l(m)){m=m.split('')}"),r+="while(++i<n){"+t.f+"}}else{"):le.nonEnumArgs&&(r+="var n=m.length;i=-1;if(n&&j(m)){while(++i<n){i+='';"+t.f+"}}else{"),le.enumPrototypes&&(r+="var v=typeof m=='function';"),t.i&&t.j?(r+="var s=-1,t=r[typeof m]?o(m):[],n=t.length;while(++s<n){i=t[s];",le.enumPrototypes&&(r+="if(!(v&&i=='prototype')){"),r+=t.f,le.enumPrototypes&&(r+="}")):(r+="for(i in m){",(le.enumPrototypes||t.i)&&(r+="if(",le.enumPrototypes&&(r+="!(v&&i=='prototype')"),le.enumPrototypes&&t.i&&(r+="&&"),t.i&&(r+="h.call(m,i)"),r+="){"),r+=t.f+";",(le.enumPrototypes||t.i)&&(r+="}")),r+="}",le.nonEnumShadows){r+="var f=m.constructor;";
+for(var u=0;7>u;u++)r+="i='"+t.g[u]+"';if(","constructor"==t.g[u]&&(r+="!(f&&f.prototype===m)&&"),r+="h.call(m,i)){"+t.f+"}"}return(t.b||le.nonEnumArgs)&&(r+="}"),r+=t.c+";return u",e("h,j,k,l,o,p,r","return function("+n+"){"+r+"}")(Jt,W,ve,ut,ge,a,q)}function K(n){return"\\"+B[n]}function M(n){return he[n]}function U(n){return typeof n.toString!="function"&&typeof Tt=="string"(n)}function V(n){this.__wrapped__=n}function G(){}function H(n){var t=!1;if(!n||Yt.call(n)!=I||!le.argsClass&&j(n))return t;
+var e=n.constructor;return!tt(e)&&(le.nodeClass||!U(n))||e instanceof e?le.ownLast?(be(n,function(n,e,r){return t=h.call(r,e),!1}),!0===St):(be(n,function(n,t){St=t}),!1===St||Jt.call(n,St)):St}function J(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=It(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function Q(n){return ye[n]}function W(n){return Yt.call(n)==k}function X(n,t,r,u,o,i){var f=n;if(typeof t=="function"&&(u=r,r=t,t=!1),typeof r=="function"){if(r=typeof u=="undefined"?r:a.createCallback(r,u,1),f=r(f),typeof f!="undefined")return f;
+f=n}if(u=et(f)){var c=Yt.call(f);if(!$[c]||!le.nodeClass&&U(f))return f;var l=ve(f)}if(!u||!t)return u?l?J(f):me({},f):f;switch(u=ce[c],c){case O:case E:return new u(+f);case A:case N:return new u(f);case P:return u(f.source,g.exec(f))}for(o||(o=[]),i||(i=[]),c=o.length;c--;)if(o[c]==n)return i[c];return f=l?u(f.length):{},l&&(Jt.call(n,"index")&&(f.index=n.index),Jt.call(n,"input")&&(f.input=n.input)),o.push(n),i.push(f),(l?pt:_e)(n,function(n,u){f[u]=X(n,t,r,e,o,i)}),f}function Y(n){var t=[];return be(n,function(n,e){tt(n)&&t.push(e)
+}),t.sort()}function Z(n){for(var t=-1,e=ge(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function nt(n,t,e,r,u,o){var i=e===f;if(e&&!i){e=typeof r=="undefined"?e:a.createCallback(e,r,2);var c=e(n,t);if(typeof c!="undefined")return!!c}if(n===t)return 0!==n||1/n==1/t;var l=typeof n,p=typeof t;if(n===n&&(!n||"function"!=l&&"object"!=l)&&(!t||"function"!=p&&"object"!=p))return!1;if(null==n||null==t)return n===t;if(p=Yt.call(n),l=Yt.call(t),p==k&&(p=I),l==k&&(l=I),p!=l)return!1;switch(p){case O:case E:return+n==+t;
+case A:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case P:case N:return n==Tt(t)}if(l=p==x,!l){if(Jt.call(n,"__wrapped__")||Jt.call(t,"__wrapped__"))return nt(n.__wrapped__||n,t.__wrapped__||t,e,r,u,o);if(p!=I||!le.nodeClass&&(U(n)||U(t)))return!1;var p=!le.argsObject&&W(n)?Ft:n.constructor,s=!le.argsObject&&W(t)?Ft:t.constructor;if(p!=s&&(!tt(p)||!(p instanceof p&&tt(s)&&s instanceof s)))return!1}for(u||(u=[]),o||(o=[]),p=u.length;p--;)if(u[p]==n)return o[p]==t;var v=0,c=!0;if(u.push(n),o.push(t),l){if(p=n.length,v=t.length,c=v==n.length,!c&&!i)return c;
+for(;v--;)if(l=p,s=t[v],i)for(;l--&&!(c=nt(n[l],s,e,r,u,o)););else if(!(c=nt(n[v],s,e,r,u,o)))break;return c}return be(t,function(t,a,i){return Jt.call(i,a)?(v++,c=Jt.call(n,a)&&nt(n[a],t,e,r,u,o)):void 0}),c&&!i&&be(n,function(n,t,e){return Jt.call(e,t)?c=-1<--v:void 0}),c}function tt(n){return typeof n=="function"}function et(n){return n?q[typeof n]:!1}function rt(n){return typeof n=="number"||Yt.call(n)==A}function ut(n){return typeof n=="string"||Yt.call(n)==N}function at(n,t,e){var r=arguments,u=0,o=2;
+if(!et(n))return n;if(e===f)var i=r[3],c=r[4],l=r[5];else c=[],l=[],typeof e!="number"&&(o=r.length),3<o&&"function"==typeof r[o-2]?i=a.createCallback(r[--o-1],r[o--],2):2<o&&"function"==typeof r[o-1]&&(i=r[--o]);for(;++u<o;)(ve(r[u])?pt:_e)(r[u],function(t,e){var r,u,a=t,o=n[e];if(t&&((u=ve(t))||Ce(t))){for(a=c.length;a--;)if(r=c[a]==t){o=l[a];break}r||(o=u?ve(o)?o:[]:Ce(o)?o:{},i&&(a=i(o,t),typeof a!="undefined"&&(o=a)),c.push(t),l.push(o),i||(o=at(o,t,f,i,c,l)))}else i&&(a=i(o,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(o=a);
+n[e]=o});return n}function ot(n){for(var t=-1,e=ge(n),r=e.length,u=It(r);++t<r;)u[t]=n[e[t]];return u}function it(n,t,e){var r=-1,u=n?n.length:0,a=!1;return e=(0>e?ue(0,u+e):e)||0,typeof u=="number"?a=-1<(ut(n)?n.indexOf(t,e):bt(n,t,e)):pe(n,function(n){return++r<e?void 0:!(a=n===t)}),a}function ft(n,t,e){var r=!0;if(t=a.createCallback(t,e),ve(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else pe(n,function(n,e,u){return r=!!t(n,e,u)});return r}function ct(n,t,e){var r=[];if(t=a.createCallback(t,e),ve(n)){e=-1;
+for(var u=n.length;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}}else pe(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function lt(n,t,e){if(t=a.createCallback(t,e),!ve(n)){var r;return pe(n,function(n,e,u){return t(n,e,u)?(r=n,!1):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e];if(t(o,e,n))return o}}function pt(n,t,e){if(t&&typeof e=="undefined"&&ve(n)){e=-1;for(var r=n.length;++e<r&&!1!==t(n[e],e,n););}else pe(n,t,e);return n}function st(n,t,e){var r=-1,u=n?n.length:0,o=It(typeof u=="number"?u:0);
+if(t=a.createCallback(t,e),ve(n))for(;++r<u;)o[r]=t(n[r],r,n);else pe(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function vt(n,t,e){var r=-1/0,u=r;if(!t&&ve(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>u&&(u=i)}}else t=!t&&ut(n)?T:a.createCallback(t,e),pe(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)});return u}function gt(n,t,e,r){var u=3>arguments.length;if(t=a.createCallback(t,r,4),ve(n)){var o=-1,i=n.length;for(u&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n)}else pe(n,function(n,r,a){e=u?(u=!1,n):t(e,n,r,a)
+});return e}function ht(n,t,e,r){var u=n,o=n?n.length:0,i=3>arguments.length;if(typeof o!="number")var f=ge(n),o=f.length;else le.unindexedChars&&ut(n)&&(u=n.split(""));return t=a.createCallback(t,r,4),pt(n,function(n,r,a){r=f?f[--o]:--o,e=i?(i=!1,u[r]):t(e,u[r],r,a)}),e}function yt(n,t,e){var r;if(t=a.createCallback(t,e),ve(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else pe(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function mt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=-1;
+for(t=a.createCallback(t,e);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[0];return J(n,0,ae(ue(0,r),u))}}function dt(n,t,e,r){var u=-1,o=n?n.length:0,i=[];for(typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1),null!=e&&(e=a.createCallback(e,r));++u<o;)r=n[u],e&&(r=e(r,u,n)),ve(r)?Qt.apply(i,t?r:dt(r)):i.push(r);return i}function bt(n,t,e){var r=-1,u=n?n.length:0;if(typeof e=="number")r=(0>e?ue(0,u+e):e||0)-1;else if(e)return r=Ct(n,t),n[r]===t?r:-1;for(;++r<u;)if(n[r]===t)return r;return-1}function _t(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;
+for(t=a.createCallback(t,e);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:ue(0,t);return J(n,r)}function Ct(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?a.createCallback(e,r,1):Ot,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function wt(n,t,e,r){var u=-1,o=n?n.length:0,i=[],f=i;typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1);var c=!t&&75<=o;if(c)var l={};for(null!=e&&(f=[],e=a.createCallback(e,r));++u<o;){r=n[u];var p=e?e(r,u,n):r;if(c)var s=Tt(p),s=Jt.call(l,s)?!(f=l[s]):f=l[s]=[];(t?!u||f[f.length-1]!==p:s||0>bt(f,p))&&((e||c)&&f.push(p),i.push(r))
+}return i}function jt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:u[a[0]]=a[1]}return u}function kt(n,t){return le.fastBind||Zt&&2<arguments.length?Zt.call.apply(Zt,arguments):z(n,t,J(arguments,2))}function xt(n){var t=J(arguments,1);return Xt(function(){n.apply(e,t)},1)}function Ot(n){return n}function Et(n){pt(Y(n),function(t){var e=a[t]=n[t];a.prototype[t]=function(){var n=this.__wrapped__,t=[n];return Qt.apply(t,arguments),t=e.apply(a,t),n&&typeof n=="object"&&n==t?this:new V(t)
+}})}function St(n,t){var r=n?n[t]:e;return tt(r)?n[t]():r}function At(){return this.__wrapped__}r=r?F.defaults(n.Object(),r,F.pick(n,C)):n;var It=r.Array,Pt=r.Boolean,Nt=r.Date,$t=r.Function,qt=r.Math,Bt=r.Number,Ft=r.Object,Rt=r.RegExp,Tt=r.String,Dt=It(),zt=Ft(),Lt=r._,Kt=Rt("^"+Tt(zt.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Mt=qt.ceil,Ut=r.clearTimeout,Vt=Dt.concat,Gt=qt.floor,Ht=Kt.test(Ht=Ft.getPrototypeOf)&&Ht,Jt=zt.hasOwnProperty,Qt=Dt.push,Wt=r.setImmediate,Xt=r.setTimeout,Yt=zt.toString,Zt=Kt.test(Zt=J.bind)&&Zt,ne=Kt.test(ne=It.isArray)&&ne,te=r.isFinite,ee=r.isNaN,re=Kt.test(re=Ft.keys)&&re,ue=qt.max,ae=qt.min,oe=r.parseInt,ie=qt.random,qt=Kt.test(r.attachEvent),fe=Zt&&!/\n|true/.test(Zt+qt),ce={};
+ce[x]=It,ce[O]=Pt,ce[E]=Nt,ce[I]=Ft,ce[A]=Bt,ce[P]=Rt,ce[N]=Tt;var le=a.support={};(function(){var n=function(){this.x=1},t={0:1,length:1},e=[];n.prototype={valueOf:1,y:1};for(var r in new n)e.push(r);for(r in arguments);le.argsObject=arguments.constructor==Ft,le.argsClass=W(arguments),le.enumPrototypes=n.propertyIsEnumerable("prototype"),le.fastBind=Zt&&!fe,le.ownLast="x"!=e[0],le.nonEnumArgs=0!=r,le.nonEnumShadows=!/valueOf/.test(e),le.spliceObjects=(Dt.splice.call(t,0,1),!t[0]),le.unindexedChars="xx"!="x"[0]+Ft("x")[0];
+try{le.nodeClass=!(Yt.call(document)==I&&!Tt({toString:0}))}catch(u){le.nodeClass=!0}})(1),a.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:y,variable:"",imports:{_:a}};var Pt={a:"q,w,g",h:"var a=arguments,b=0,c=typeof g=='number'?2:a.length;while(++b<c){m=a[b];if(m&&r[typeof m]){",f:"if(typeof u[i]=='undefined')u[i]=m[i]",c:"}}"},Bt={a:"e,d,x",h:"d=d&&typeof x=='undefined'?d:p.createCallback(d,x)",b:"typeof n=='number'",f:"if(d(m[i],i,e)===false)return u"},qt={h:"if(!r[typeof m])return u;"+Bt.h,b:!1},pe=L(Bt);
+V.prototype=a.prototype;var se=L({a:"q",e:"[]",h:"if(!(r[typeof q]))return u",f:"u.push(i)",b:!1});le.argsClass||(W=function(n){return n?Jt.call(n,"callee"):!1});var ve=ne||function(n){return le.argsObject&&n instanceof It||Yt.call(n)==x},ge=re?function(n){return et(n)?le.enumPrototypes&&typeof n=="function"||le.nonEnumArgs&&n.length&&W(n)?se(n):re(n):[]}:se,he={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ye=Z(he),me=L(Pt,{h:Pt.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=p.createCallback(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),f:"u[i]=d?d(u[i],m[i]):m[i]"}),de=L(Pt),be=L(Bt,qt,{i:!1}),_e=L(Bt,qt);
+tt(/x/)&&(tt=function(n){return n instanceof $t||Yt.call(n)==S});var Ce=Ht?function(n){if(!n||Yt.call(n)!=I||!le.argsClass&&W(n))return!1;var t=n.valueOf,e=typeof t=="function"&&(e=Ht(t))&&Ht(e);return e?n==e||Ht(n)==e:H(n)}:H;return fe&&u&&typeof Wt=="function"&&(xt=kt(Wt,r)),Wt=8==oe("08")?oe:function(n,t){return oe(ut(n)?n.replace(m,""):n,t||0)},a.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},a.assign=me,a.at=function(n){var t=-1,e=Vt.apply(Dt,J(arguments,1)),r=e.length,u=It(r);
+for(le.unindexedChars&&ut(n)&&(n=n.split(""));++t<r;)u[t]=n[e[t]];return u},a.bind=kt,a.bindAll=function(n){for(var t=Vt.apply(Dt,arguments),e=1<t.length?0:(t=Y(n),-1),r=t.length;++e<r;){var u=t[e];n[u]=kt(n[u],n)}return n},a.bindKey=function(n,t){return z(n,t,J(arguments,2))},a.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},a.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}
+},a.countBy=function(n,t,e){var r={};return t=a.createCallback(t,e),pt(n,function(n,e,u){e=Tt(t(n,e,u)),Jt.call(r,e)?r[e]++:r[e]=1}),r},a.createCallback=function(n,t,e){if(null==n)return Ot;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=ge(n);return function(t){for(var e=u.length,r=!1;e--&&(r=nt(t[u[e]],n[u[e]],f)););return r}}return typeof t!="undefined"?1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)}:4===e?function(e,r,u,a){return n.call(t,e,r,u,a)
+}:function(e,r,u){return n.call(t,e,r,u)}:n},a.debounce=function(n,t,e){function r(){i=null,e||(a=n.apply(o,u))}var u,a,o,i;return function(){var f=e&&!i;return u=arguments,o=this,Ut(i),i=Xt(r,t),f&&(a=n.apply(o,u)),a}},a.defaults=de,a.defer=xt,a.delay=function(n,t){var r=J(arguments,2);return Xt(function(){n.apply(e,r)},t)},a.difference=function(n){for(var t=-1,e=n?n.length:0,r=Vt.apply(Dt,arguments),r=R(r,e,100),u=[];++t<e;){var a=n[t];r(a)||u.push(a)}return u},a.filter=ct,a.flatten=dt,a.forEach=pt,a.forIn=be,a.forOwn=_e,a.functions=Y,a.groupBy=function(n,t,e){var r={};
+return t=a.createCallback(t,e),pt(n,function(n,e,u){e=Tt(t(n,e,u)),(Jt.call(r,e)?r[e]:r[e]=[]).push(n)}),r},a.initial=function(n,t,e){if(!n)return[];var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return J(n,0,ae(ue(0,u-r),u))},a.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,a=n?n.length:0,o=100<=a,i=[],f=i;n:for(;++u<a;){var c=n[u];if(o)var l=Tt(c),l=Jt.call(r[0],l)?!(f=r[0][l]):f=r[0][l]=[];
+if(l||0>bt(f,c)){o&&f.push(c);for(var p=e;--p;)if(!(r[p]||(r[p]=R(t[p],0,100)))(c))continue n;i.push(c)}}return i},a.invert=Z,a.invoke=function(n,t){var e=J(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=It(typeof a=="number"?a:0);return pt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},a.keys=ge,a.map=st,a.max=vt,a.memoize=function(n,t){var e={};return function(){var r=Tt(t?t.apply(this,arguments):arguments[0]);return Jt.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},a.merge=at,a.min=function(n,t,e){var r=1/0,u=r;
+if(!t&&ve(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i<u&&(u=i)}}else t=!t&&ut(n)?T:a.createCallback(t,e),pe(n,function(n,e,a){e=t(n,e,a),e<r&&(r=e,u=n)});return u},a.omit=function(n,t,e){var r=typeof t=="function",u={};if(r)t=a.createCallback(t,e);else var o=Vt.apply(Dt,arguments);return be(n,function(n,e,a){(r?!t(n,e,a):0>bt(o,e,1))&&(u[e]=n)}),u},a.once=function(n){var t,e;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},a.pairs=function(n){for(var t=-1,e=ge(n),r=e.length,u=It(r);++t<r;){var a=e[t];
+u[t]=[a,n[a]]}return u},a.partial=function(n){return z(n,J(arguments,1))},a.partialRight=function(n){return z(n,J(arguments,1),null,f)},a.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=0,o=Vt.apply(Dt,arguments),i=et(n)?o.length:0;++u<i;){var f=o[u];f in n&&(r[f]=n[f])}else t=a.createCallback(t,e),be(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},a.pluck=st,a.range=function(n,t,e){n=+n||0,e=+e||1,null==t&&(t=n,n=0);var r=-1;t=ue(0,Mt((t-n)/e));for(var u=It(t);++r<t;)u[r]=n,n+=e;
+return u},a.reject=function(n,t,e){return t=a.createCallback(t,e),ct(n,function(n,e,r){return!t(n,e,r)})},a.rest=_t,a.shuffle=function(n){var t=-1,e=n?n.length:0,r=It(typeof e=="number"?e:0);return pt(n,function(n){var e=Gt(ie()*(++t+1));r[t]=r[e],r[e]=n}),r},a.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,o=It(typeof u=="number"?u:0);for(t=a.createCallback(t,e),pt(n,function(n,e,u){o[++r]={a:t(n,e,u),b:r,c:n}}),u=o.length,o.sort(D);u--;)o[u]=o[u].c;return o},a.tap=function(n,t){return t(n),n},a.throttle=function(n,t){function e(){i=new Nt,o=null,u=n.apply(a,r)
+}var r,u,a,o,i=0;return function(){var f=new Nt,c=t-(f-i);return r=arguments,a=this,0<c?o||(o=Xt(e,c)):(Ut(o),o=null,i=f,u=n.apply(a,r)),u}},a.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=It(n);for(t=a.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},a.toArray=function(n){return n&&typeof n.length=="number"?le.unindexedChars&&ut(n)?n.split(""):J(n):ot(n)},a.union=function(){return wt(Vt.apply(Dt,arguments))},a.uniq=wt,a.values=ot,a.where=ct,a.without=function(n){for(var t=-1,e=n?n.length:0,r=R(arguments,1,30),u=[];++t<e;){var a=n[t];
+r(a)||u.push(a)}return u},a.wrap=function(n,t){return function(){var e=[n];return Qt.apply(e,arguments),t.apply(this,e)}},a.zip=function(n){for(var t=-1,e=n?vt(st(arguments,"length")):0,r=It(e);++t<e;)r[t]=st(arguments,t);return r},a.zipObject=jt,a.collect=st,a.drop=_t,a.each=pt,a.extend=me,a.methods=Y,a.object=jt,a.select=ct,a.tail=_t,a.unique=wt,Et(a),a.clone=X,a.cloneDeep=function(n,t,e){return X(n,!0,t,e)},a.contains=it,a.escape=function(n){return null==n?"":Tt(n).replace(b,M)},a.every=ft,a.find=lt,a.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;
+for(t=a.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},a.findKey=function(n,t,e){var r;return t=a.createCallback(t,e),_e(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},a.has=function(n,t){return n?Jt.call(n,t):!1},a.identity=Ot,a.indexOf=bt,a.isArguments=W,a.isArray=ve,a.isBoolean=function(n){return!0===n||!1===n||Yt.call(n)==O},a.isDate=function(n){return n instanceof Nt||Yt.call(n)==E},a.isElement=function(n){return n?1===n.nodeType:!1},a.isEmpty=function(n){var t=!0;if(!n)return t;
+var e=Yt.call(n),r=n.length;return e==x||e==N||(le.argsClass?e==k:W(n))||e==I&&typeof r=="number"&&tt(n.splice)?!r:(_e(n,function(){return t=!1}),t)},a.isEqual=nt,a.isFinite=function(n){return te(n)&&!ee(parseFloat(n))},a.isFunction=tt,a.isNaN=function(n){return rt(n)&&n!=+n},a.isNull=function(n){return null===n},a.isNumber=rt,a.isObject=et,a.isPlainObject=Ce,a.isRegExp=function(n){return n instanceof Rt||Yt.call(n)==P},a.isString=ut,a.isUndefined=function(n){return typeof n=="undefined"},a.lastIndexOf=function(n,t,e){var r=n?n.length:0;
+for(typeof e=="number"&&(r=(0>e?ue(0,r+e):ae(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},a.mixin=Et,a.noConflict=function(){return r._=Lt,this},a.parseInt=Wt,a.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+Gt(ie()*((+t||0)-n+1))},a.reduce=gt,a.reduceRight=ht,a.result=St,a.runInContext=t,a.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:ge(n).length},a.some=yt,a.sortedIndex=Ct,a.template=function(n,t,r){var u=a.templateSettings;n||(n=""),r=de({},r,u);
+var o,i=de({},r.imports,u.imports),u=ge(i),i=ot(i),f=0,s=r.interpolate||d,g="__p+='",s=Rt((r.escape||d).source+"|"+s.source+"|"+(s===y?v:d).source+"|"+(r.evaluate||d).source+"|$","g");n.replace(s,function(t,e,r,u,a,i){return r||(r=u),g+=n.slice(f,i).replace(_,K),e&&(g+="'+__e("+e+")+'"),a&&(o=!0,g+="';"+a+";__p+='"),r&&(g+="'+((__t=("+r+"))==null?'':__t)+'"),f=i+t.length,t}),g+="';\n",s=r=r.variable,s||(r="obj",g="with("+r+"){"+g+"}"),g=(o?g.replace(c,""):g).replace(l,"$1").replace(p,"$1;"),g="function("+r+"){"+(s?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+g+"return __p}";
+try{var h=$t(u,"return "+g).apply(e,i)}catch(m){throw m.source=g,m}return t?h(t):(h.source=g,h)},a.unescape=function(n){return null==n?"":Tt(n).replace(s,Q)},a.uniqueId=function(n){var t=++i;return Tt(null==n?"":n)+t},a.all=ft,a.any=yt,a.detect=lt,a.foldl=gt,a.foldr=ht,a.include=it,a.inject=gt,_e(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(){var t=[this.__wrapped__];return Qt.apply(t,arguments),n.apply(a,t)})}),a.first=mt,a.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;
+for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[u-1];return J(n,ue(0,u-r))}},a.take=mt,a.head=mt,_e(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return null==t||e&&typeof t!="function"?r:new V(r)})}),a.VERSION="1.0.1",a.prototype.toString=function(){return Tt(this.__wrapped__)},a.prototype.value=At,a.prototype.valueOf=At,pe(["join","pop","shift"],function(n){var t=Dt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)
+}}),pe(["push","reverse","sort","unshift"],function(n){var t=Dt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),pe(["concat","slice","splice"],function(n){var t=Dt[n];a.prototype[n]=function(){return new V(t.apply(this.__wrapped__,arguments))}}),le.spliceObjects||pe(["pop","shift","splice"],function(n){var t=Dt[n],e="splice"==n;a.prototype[n]=function(){var n=this.__wrapped__,r=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new V(r):r}}),a}var e,r=typeof exports=="object"&&exports,u=typeof module=="object"&&module&&module.exports==r&&module,a=typeof global=="object"&&global;
+a.global===a&&(n=a);var i=0,f={},c=/\b__p\+='';/g,l=/\b(__p\+=)''\+/g,p=/(__e\(.*?\)|\b__t\))\+'';/g,s=/&(?:amp|lt|gt|quot|#39);/g,v=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,g=/\w*$/,y=/<%=([\s\S]+?)%>/g,m=/^0+(?=.$)/,d=/($^)/,b=/[&<>"']/g,_=/['\n\r\t\u2028\u2029\\]/g,C="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),w="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),k="[object Arguments]",x="[object Array]",O="[object Boolean]",E="[object Date]",S="[object Function]",A="[object Number]",I="[object Object]",P="[object RegExp]",N="[object String]",$={};
+$[S]=!1,$[k]=$[x]=$[O]=$[E]=$[A]=$[I]=$[P]=$[N]=!0;var q={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},B={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},F=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=F,define(function(){return F})):r&&!r.nodeType?u?(u.exports=F)._=F:r._=F:n._=F})(this);
View
294 dist/lodash.js
@@ -180,7 +180,6 @@
/** Detect various environments */
var isIeOpera = reNative.test(context.attachEvent),
- isJSC = !/\n{2,}/.test(Function()),
isV8 = nativeBind && !/\n|true/.test(nativeBind + isIeOpera);
/** Used to lookup a built-in constructor by [[Class]] */
@@ -260,14 +259,6 @@
support.fastBind = nativeBind && !isV8;
/**
- * Detect if `Object.keys` exists and is inferred to be fast (Firefox, IE, Opera, V8).
- *
- * @memberOf _.support
- * @type Boolean
- */
- support.fastKeys = nativeKeys && (isIeOpera || isV8 || !isJSC);
-
- /**
* By default, the template delimiters used by Lo-Dash are similar to those in
* embedded Ruby (ERB). Change the following template settings to use alternative
* delimiters.
@@ -341,7 +332,9 @@
var __p = 'var index, iterable = ' +
(obj.firstArg) +
- ', result = iterable;\nif (!iterable) return result;\n' +
+ ', result = ' +
+ (obj.init) +
+ ';\nif (!iterable) return result;\n' +
(obj.top) +
';\n';
if (obj.arrays) {
@@ -352,8 +345,8 @@
'\n }\n}\nelse { ';
}
- if (support.fastKeys && obj.useHas) {
- __p += '\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] ? nativeKeys(iterable) : [],\n length = ownProps.length;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n ' +
+ if (obj.useHas && obj.useKeys) {
+ __p += '\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] ? keys(iterable) : [],\n length = ownProps.length;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n ' +
(obj.loop) +
'\n } ';
} else {
@@ -563,9 +556,11 @@
// iterator options
'arrays': 'isArray(iterable)',
'bottom': '',
+ 'init': 'iterable',
'loop': '',
'top': '',
- 'useHas': true
+ 'useHas': true,
+ 'useKeys': !!keys
};
// merge options into a template data object
@@ -579,14 +574,14 @@
// create the function factory
var factory = Function(
- 'hasOwnProperty, isArguments, isArray, isString, lodash, ' +
- 'objectTypes, nativeKeys',
+ 'hasOwnProperty, isArguments, isArray, isString, keys, ' +
+ 'lodash, objectTypes',
'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}'
);
// return the compiled function
return factory(
- hasOwnProperty, isArguments, isArray, isString, lodash,
- objectTypes, nativeKeys
+ hasOwnProperty, isArguments, isArray, isString, keys,
+ lodash, objectTypes
);
}
@@ -649,6 +644,53 @@
}
/**
+ * A fallback implementation of `isPlainObject` that checks if a given `value`
+ * is an object created by the `Object` constructor, assuming objects created
+ * by the `Object` constructor have no inherited enumerable properties and that
+ * there are no `Object.prototype` extensions.
+ *
+ * @private
+ * @param {Mixed} value The value to check.
+ * @returns {Boolean} Returns `true`, if `value` is a plain object, else `false`.
+ */
+ function shimIsPlainObject(value) {
+ // avoid non-objects and false positives for `arguments` objects
+ var result = false;
+ if (!(value && toString.call(value) == objectClass)) {
+ return result;
+ }
+ // check that the constructor is `Object` (i.e. `Object instanceof Object`)
+ var ctor = value.constructor;
+ if ((!isFunction(ctor)) || ctor instanceof ctor) {
+ // In most environments an object's own properties are iterated before
+ // its inherited properties. If the last iterated property is an object's
+ // own property then there are no inherited enumerable properties.
+ forIn(value, function(value, key) {
+ result = key;
+ });
+ return result === false || hasOwnProperty.call(value, result);
+ }
+ return result;
+ }
+
+ /**
+ * A fallback implementation of `Object.keys` that produces an array of the
+ * given object's own enumerable property names.
+ *
+ * @private
+ * @type Function
+ * @param {Object} object The object to inspect.
+ * @returns {Array} Returns a new array of property names.
+ */
+ var shimKeys = createIterator({
+ 'args': 'object',
+ 'init': '[]',
+ 'top': 'if (!(objectTypes[typeof object])) return result',
+ 'loop': 'result.push(index)',
+ 'arrays': false
+ });
+
+ /**
* Slices the `collection` from the `start` index up to, but not including,
* the `end` index.
*
@@ -710,92 +752,6 @@
}
/**
- * This method is similar to `_.find`, except that it returns the key of the
- * element that passes the callback check, instead of the element itself.
- *
- * @static
- * @memberOf _
- * @category Objects
- * @param {Array|Object|String} collection The collection to iterate over.
- * @param {Function|Object|String} [callback=identity] The function called per
- * iteration. If a property name or object is passed, it will be used to create
- * a "_.pluck" or "_.where" style callback, respectively.
- * @param {Mixed} [thisArg] The `this` binding of `callback`.
- * @returns {Mixed} Returns the key of the found element, else `undefined`.
- * @example
- *
- * _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { return num % 2 == 0; });
- * // => 'b'
- */
- function findKey(collection, callback, thisArg) {
- var result;
- callback = lodash.createCallback(callback, thisArg);
- forOwn(collection, function(value, key, collection) {
- if (callback(value, key, collection)) {
- result = key;
- return false;
- }
- });
- return result;
- }
-
- /**
- * Iterates over `object`'s own and inherited enumerable properties, executing
- * the `callback` for each property. The `callback` is bound to `thisArg` and
- * invoked with three arguments; (value, key, object). Callbacks may exit iteration
- * early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @type Function
- * @category Objects
- * @param {Object} object The object to iterate over.
- * @param {Function} [callback=identity] The function called per iteration.
- * @param {Mixed} [thisArg] The `this` binding of `callback`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * function Dog(name) {
- * this.name = name;
- * }
- *
- * Dog.prototype.bark = function() {
- * alert('Woof, woof!');
- * };
- *
- * _.forIn(new Dog('Dagny'), function(value, key) {
- * alert(key);
- * });
- * // => alerts 'name' and 'bark' (order is not guaranteed)
- */
- var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, {
- 'useHas': false
- });
-
- /**
- * Iterates over an object's own enumerable properties, executing the `callback`
- * for each property. The `callback` is bound to `thisArg` and invoked with three
- * arguments; (value, key, object). Callbacks may exit iteration early by explicitly
- * returning `false`.
- *
- * @static
- * @memberOf _
- * @type Function
- * @category Objects
- * @param {Object} object The object to iterate over.
- * @param {Function} [callback=identity] The function called per iteration.
- * @param {Mixed} [thisArg] The `this` binding of `callback`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
- * alert(key);
- * });
- * // => alerts '0', '1', and 'length' (order is not guaranteed)
- */
- var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions);
-
- /**
* Checks if `value` is an array.
*
* @static
@@ -838,52 +794,6 @@
};
/**
- * A fallback implementation of `isPlainObject` that checks if a given `value`
- * is an object created by the `Object` constructor, assuming objects created
- * by the `Object` constructor have no inherited enumerable properties and that
- * there are no `Object.prototype` extensions.
- *
- * @private
- * @param {Mixed} value The value to check.
- * @returns {Boolean} Returns `true`, if `value` is a plain object, else `false`.
- */
- function shimIsPlainObject(value) {
- // avoid non-objects and false positives for `arguments` objects
- var result = false;
- if (!(value && toString.call(value) == objectClass)) {
- return result;
- }
- // check that the constructor is `Object` (i.e. `Object instanceof Object`)
- var ctor = value.constructor;
- if ((!isFunction(ctor)) || ctor instanceof ctor) {
- // In most environments an object's own properties are iterated before
- // its inherited properties. If the last iterated property is an object's
- // own property then there are no inherited enumerable properties.
- forIn(value, function(value, key) {
- result = key;
- });
- return result === false || hasOwnProperty.call(value, result);
- }
- return result;
- }
-
- /**
- * A fallback implementation of `Object.keys` that produces an array of the
- * given object's own enumerable property names.
- *
- * @private
- * @param {Object} object The object to inspect.
- * @returns {Array} Returns a new array of property names.
- */
- function shimKeys(object) {
- var result = [];
- forOwn(object, function(value, key) {
- result.push(key);
- });
- return result;
- }
-
- /**
* Used to convert characters to HTML entities:
*
* Though the `>` character is escaped for symmetry, characters like `>` and `/`
@@ -1141,6 +1051,92 @@
var defaults = createIterator(defaultsIteratorOptions);
/**
+ * This method is similar to `_.find`, except that it returns the key of the
+ * element that passes the callback check, instead of the element itself.
+ *
+ * @static
+ * @memberOf _
+ * @category Objects
+ * @param {Array|Object|String} collection The collection to iterate over.
+ * @param {Function|Object|String} [callback=identity] The function called per
+ * iteration. If a property name or object is passed, it will be used to create
+ * a "_.pluck" or "_.where" style callback, respectively.
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
+ * @returns {Mixed} Returns the key of the found element, else `undefined`.
+ * @example
+ *
+ * _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { return num % 2 == 0; });
+ * // => 'b'
+ */
+ function findKey(collection, callback, thisArg) {
+ var result;
+ callback = lodash.createCallback(callback, thisArg);
+ forOwn(collection, function(value, key, collection) {
+ if (callback(value, key, collection)) {
+ result = key;
+ return false;
+ }
+ });
+ return result;
+ }
+
+ /**
+ * Iterates over `object`'s own and inherited enumerable properties, executing
+ * the `callback` for each property. The `callback` is bound to `thisArg` and
+ * invoked with three arguments; (value, key, object). Callbacks may exit iteration
+ * early by explicitly returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @type Function
+ * @category Objects
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [callback=identity] The function called per iteration.
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function Dog(name) {
+ * this.name = name;
+ * }
+ *
+ * Dog.prototype.bark = function() {
+ * alert('Woof, woof!');
+ * };
+ *
+ * _.forIn(new Dog('Dagny'), function(value, key) {
+ * alert(key);
+ * });
+ * // => alerts 'name' and 'bark' (order is not guaranteed)
+ */
+ var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, {
+ 'useHas': false
+ });
+
+ /**
+ * Iterates over an object's own enumerable properties, executing the `callback`
+ * for each property. The `callback` is bound to `thisArg` and invoked with three
+ * arguments; (value, key, object). Callbacks may exit iteration early by explicitly
+ * returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @type Function
+ * @category Objects
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [callback=identity] The function called per iteration.
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
+ * alert(key);
+ * });
+ * // => alerts '0', '1', and 'length' (order is not guaranteed)
+ */
+ var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions);
+
+ /**
* Creates a sorted array of all enumerable properties, own and inherited,
* of `object` that have function values.
*
View
282 dist/lodash.legacy.js
@@ -421,7 +421,9 @@
var __p = 'var index, iterable = ' +
(obj.firstArg) +
- ', result = iterable;\nif (!iterable) return result;\n' +
+ ', result = ' +
+ (obj.init) +
+ ';\nif (!iterable) return result;\n' +
(obj.top) +
';\n';
if (obj.arrays) {
@@ -669,6 +671,7 @@
// iterator options
'arrays': 'isArray(iterable)',
'bottom': '',
+ 'init': 'iterable',
'loop': '',
'top': '',
'useHas': true
@@ -685,14 +688,15 @@
// create the function factory
var factory = Function(
- 'hasOwnProperty, isArguments, isArray, isString, lodash, ' +
- 'objectTypes',
+ 'hasOwnProperty, isArguments, isArray, isString, keys, ' +
+ 'lodash, objectTypes',
'return function(' + args + ') {\n' + iteratorTemplate(data) + '\n}'
);
// return the compiled function
return factory(
- hasOwnProperty, isArguments, isArray, isString, lodash,
- objectTypes);
+ hasOwnProperty, isArguments, isArray, isString, keys,
+ lodash, objectTypes
+ );
}
/**
@@ -770,6 +774,46 @@
}
/**
+ * A fallback implementation of `isPlainObject` that checks if a given `value`
+ * is an object created by the `Object` constructor, assuming objects created
+ * by the `Object` constructor have no inherited enumerable properties and that
+ * there are no `Object.prototype` extensions.
+ *
+ * @private
+ * @param {Mixed} value The value to check.
+ * @returns {Boolean} Returns `true`, if `value` is a plain object, else `false`.
+ */
+ function shimIsPlainObject(value) {
+ // avoid non-objects and false positives for `arguments` objects
+ var result = false;
+ if (!(value && toString.call(value) == objectClass) || (!support.argsClass && isArguments(value))) {
+ return result;
+ }
+ // check that the constructor is `Object` (i.e. `Object instanceof Object`)
+ var ctor = value.constructor;
+ if ((!isFunction(ctor) && (support.nodeClass || !isNode(value))) || ctor instanceof ctor) {
+ // IE < 9 iterates inherited properties before own properties. If the first
+ // iterated property is an object's own property then there are no inherited
+ // enumerable properties.
+ if (support.ownLast) {
+ forIn(value, function(value, key, object) {
+ result = hasOwnProperty.call(object, key);
+ return false;
+ });
+ return result === true;
+ }
+ // In most environments an object's own properties are iterated before
+ // its inherited properties. If the last iterated property is an object's
+ // own property then there are no inherited enumerable properties.
+ forIn(value, function(value, key) {
+ result = key;
+ });
+ return result === false || hasOwnProperty.call(value, result);
+ }
+ return result;
+ }
+
+ /**
* Slices the `collection` from the `start` index up to, but not including,
* the `end` index.
*
@@ -827,96 +871,10 @@
* // => false
*/
function isArguments(value) {
- return value ? hasOwnProperty.call(value, 'callee') : false;
- }
-
- /**
- * This method is similar to `_.find`, except that it returns the key of the
- * element that passes the callback check, instead of the element itself.
- *
- * @static
- * @memberOf _
- * @category Objects
- * @param {Array|Object|String} collection The collection to iterate over.
- * @param {Function|Object|String} [callback=identity] The function called per
- * iteration. If a property name or object is passed, it will be used to create
- * a "_.pluck" or "_.where" style callback, respectively.
- * @param {Mixed} [thisArg] The `this` binding of `callback`.
- * @returns {Mixed} Returns the key of the found element, else `undefined`.
- * @example
- *
- * _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { return num % 2 == 0; });
- * // => 'b'
- */
- function findKey(collection, callback, thisArg) {
- var result;
- callback = lodash.createCallback(callback, thisArg);
- forOwn(collection, function(value, key, collection) {
- if (callback(value, key, collection)) {
- result = key;
- return false;
- }
- });
- return result;
+ return value ? hasOwnProperty.call(value, 'callee') : false;
}
/**
- * Iterates over `object`'s own and inherited enumerable properties, executing
- * the `callback` for each property. The `callback` is bound to `thisArg` and
- * invoked with three arguments; (value, key, object). Callbacks may exit iteration
- * early by explicitly returning `false`.
- *
- * @static
- * @memberOf _
- * @type Function
- * @category Objects
- * @param {Object} object The object to iterate over.
- * @param {Function} [callback=identity] The function called per iteration.
- * @param {Mixed} [thisArg] The `this` binding of `callback`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * function Dog(name) {
- * this.name = name;
- * }
- *
- * Dog.prototype.bark = function() {
- * alert('Woof, woof!');
- * };
- *
- * _.forIn(new Dog('Dagny'), function(value, key) {
- * alert(key);
- * });
- * // => alerts 'name' and 'bark' (order is not guaranteed)
- */
- var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, {
- 'useHas': false
- });
-
- /**
- * Iterates over an object's own enumerable properties, executing the `callback`
- * for each property. The `callback` is bound to `thisArg` and invoked with three
- * arguments; (value, key, object). Callbacks may exit iteration early by explicitly
- * returning `false`.
- *
- * @static
- * @memberOf _
- * @type Function
- * @category Objects
- * @param {Object} object The object to iterate over.
- * @param {Function} [callback=identity] The function called per iteration.
- * @param {Mixed} [thisArg] The `this` binding of `callback`.
- * @returns {Object} Returns `object`.
- * @example
- *
- * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
- * alert(key);
- * });
- * // => alerts '0', '1', and 'length' (order is not guaranteed)
- */
- var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions);
-
- /**
* Checks if `value` is an array.
*
* @static
@@ -951,53 +909,13 @@
* _.keys({ 'one': 1, 'two': 2, 'three': 3 });
* // => ['one', 'two', 'three'] (order is not guaranteed)
*/
- var keys = function(object) {
- var result = [];
- forOwn(object, function(value, key) {
- result.push(key);
- });
- return result;
- };
-
- /**
- * A fallback implementation of `isPlainObject` that checks if a given `value`
- * is an object created by the `Object` constructor, assuming objects created
- * by the `Object` constructor have no inherited enumerable properties and that
- * there are no `Object.prototype` extensions.
- *
- * @private
- * @param {Mixed} value The value to check.
- * @returns {Boolean} Returns `true`, if `value` is a plain object, else `false`.
- */
- function shimIsPlainObject(value) {
- // avoid non-objects and false positives for `arguments` objects
- var result = false;
- if (!(value && toString.call(value) == objectClass) || (!support.argsClass && isArguments(value))) {
- return result;
- }
- // check that the constructor is `Object` (i.e. `Object instanceof Object`)
- var ctor = value.constructor;
- if ((!isFunction(ctor) && (support.nodeClass || !isNode(value))) || ctor instanceof ctor) {
- // IE < 9 iterates inherited properties before own properties. If the first
- // iterated property is an object's own property then there are no inherited
- // enumerable properties.
- if (support.ownLast) {
- forIn(value, function(value, key, object) {
- result = hasOwnProperty.call(object, key);
- return false;
- });
- return result === true;
- }
- // In most environments an object's own properties are iterated before
- // its inherited properties. If the last iterated property is an object's
- // own property then there are no inherited enumerable properties.
- forIn(value, function(value, key) {
- result = key;
- });
- return result === false || hasOwnProperty.call(value, result);
- }
- return result;
- }
+ var keys = createIterator({
+ 'args': 'object',
+ 'init': '[]',
+ 'top': 'if (!(objectTypes[typeof object])) return result',
+ 'loop': 'result.push(index)',
+ 'arrays': false
+ });
/**
* Used to convert characters to HTML entities:
@@ -1257,6 +1175,92 @@
var defaults = createIterator(defaultsIteratorOptions);
/**
+ * This method is similar to `_.find`, except that it returns the key of the
+ * element that passes the callback check, instead of the element itself.
+ *
+ * @static
+ * @memberOf _
+ * @category Objects
+ * @param {Array|Object|String} collection The collection to iterate over.
+ * @param {Function|Object|String} [callback=identity] The function called per
+ * iteration. If a property name or object is passed, it will be used to create
+ * a "_.pluck" or "_.where" style callback, respectively.
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
+ * @returns {Mixed} Returns the key of the found element, else `undefined`.
+ * @example
+ *
+ * _.findKey({ 'a': 1, 'b': 2, 'c': 3, 'd': 4 }, function(num) { return num % 2 == 0; });
+ * // => 'b'
+ */
+ function findKey(collection, callback, thisArg) {
+ var result;
+ callback = lodash.createCallback(callback, thisArg);
+ forOwn(collection, function(value, key, collection) {
+ if (callback(value, key, collection)) {
+ result = key;
+ return false;
+ }
+ });
+ return result;
+ }
+
+ /**
+ * Iterates over `object`'s own and inherited enumerable properties, executing
+ * the `callback` for each property. The `callback` is bound to `thisArg` and
+ * invoked with three arguments; (value, key, object). Callbacks may exit iteration
+ * early by explicitly returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @type Function
+ * @category Objects
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [callback=identity] The function called per iteration.
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * function Dog(name) {
+ * this.name = name;
+ * }
+ *
+ * Dog.prototype.bark = function() {
+ * alert('Woof, woof!');
+ * };
+ *
+ * _.forIn(new Dog('Dagny'), function(value, key) {
+ * alert(key);
+ * });
+ * // => alerts 'name' and 'bark' (order is not guaranteed)
+ */
+ var forIn = createIterator(eachIteratorOptions, forOwnIteratorOptions, {
+ 'useHas': false
+ });
+
+ /**
+ * Iterates over an object's own enumerable properties, executing the `callback`
+ * for each property. The `callback` is bound to `thisArg` and invoked with three
+ * arguments; (value, key, object). Callbacks may exit iteration early by explicitly
+ * returning `false`.
+ *
+ * @static
+ * @memberOf _
+ * @type Function
+ * @category Objects
+ * @param {Object} object The object to iterate over.
+ * @param {Function} [callback=identity] The function called per iteration.
+ * @param {Mixed} [thisArg] The `this` binding of `callback`.
+ * @returns {Object} Returns `object`.
+ * @example
+ *
+ * _.forOwn({ '0': 'zero', '1': 'one', 'length': 2 }, function(num, key) {
+ * alert(key);
+ * });
+ * // => alerts '0', '1', and 'length' (order is not guaranteed)
+ */
+ var forOwn = createIterator(eachIteratorOptions, forOwnIteratorOptions);
+
+ /**
* Creates a sorted array of all enumerable properties, own and inherited,
* of `object` that have function values.
*
View
78 dist/lodash.legacy.min.js
@@ -4,42 +4,42 @@
* Build: `lodash legacy -o ./dist/lodash.legacy.js`
* Underscore.js 1.4.4 underscorejs.org/LICENSE
*/
-;(function(n){function t(r){function u(n){return n&&typeof n=="object"&&!ne(n)&&Dt.call(n,"__wrapped__")?n:new L(n)}function a(n,t,e){var r=n.length,u=r-t>=e;if(u){var a={};for(e=t-1;++e<r;){var o=Nt(n[e]);(Dt.call(a,o)?a[o]:a[o]=[]).push(n[e])}}return function(e){if(u){var r=Nt(e);return Dt.call(a,r)&&-1<gt(a[r],e)}return-1<gt(n,e,t)}}function q(n){return n.charCodeAt(0)}function B(n,t){var e=n.b,r=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1
-}return e<r?-1:1}function R(n,t,e,r){function u(){var c=arguments,f=o?this:t;return a||(n=t[i]),e.length&&(c=c.length?(c=M(c),r?c.concat(e):e.concat(c)):e),this instanceof u?(K.prototype=n.prototype,f=new K,K.prototype=null,c=n.apply(f,c),X(c)?c:f):n.apply(f,c)}var a=W(n),o=!e,i=t;return o&&(e=t),a||(t=n),u}function $(){for(var n,t={f:_,b:"k(m)",c:"",e:"",g:"",h:!0},e=0;n=arguments[e];e++)for(var r in n)t[r]=n[r];if(n=t.a,t.d=/^[^,]+/.exec(n)[0],e=Ot,r="var i,m="+t.d+",u=m;if(!m)return u;"+t.g+";",t.b?(r+="var n=m.length;i=-1;if("+t.b+"){",Wt.unindexedChars&&(r+="if(l(m)){m=m.split('')}"),r+="while(++i<n){"+t.e+"}}else{"):Wt.nonEnumArgs&&(r+="var n=m.length;i=-1;if(n&&j(m)){while(++i<n){i+='';"+t.e+"}}else{"),Wt.enumPrototypes&&(r+="var v=typeof m=='function';"),r+="for(i in m){",(Wt.enumPrototypes||t.h)&&(r+="if(",Wt.enumPrototypes&&(r+="!(v&&i=='prototype')"),Wt.enumPrototypes&&t.h&&(r+="&&"),t.h&&(r+="h.call(m,i)"),r+="){"),r+=t.e+";",(Wt.enumPrototypes||t.h)&&(r+="}"),r+="}",Wt.nonEnumShadows){r+="var f=m.constructor;";
-for(var a=0;7>a;a++)r+="i='"+t.f[a]+"';if(","constructor"==t.f[a]&&(r+="!(f&&f.prototype===m)&&"),r+="h.call(m,i)){"+t.e+"}"}return(t.b||Wt.nonEnumArgs)&&(r+="}"),r+=t.c+";return u",e("h,j,k,l,o,r","return function("+n+"){"+r+"}")(Dt,V,ne,Z,u,N)}function T(n){return"\\"+P[n]}function D(n){return ee[n]}function z(n){return typeof n.toString!="function"&&typeof Nt=="string"(n)}function L(n){this.__wrapped__=n}function K(){}function M(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;
-e=e-t||0;for(var u=jt(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function U(n){return re[n]}function V(n){return n?Dt.call(n,"callee"):!1}function G(n,t,r,a,o,i){var c=n;if(typeof t=="function"&&(a=r,r=t,t=!1),typeof r=="function"){if(r=typeof a=="undefined"?r:u.createCallback(r,a,1),c=r(c),typeof c!="undefined")return c;c=n}if(a=X(c)){var f=Kt.call(c);if(!I[f]||!Wt.nodeClass&&z(c))return c;var l=ne(c)}if(!a||!t)return a?l?M(c):ue({},c):c;switch(a=Qt[f],f){case j:case k:return new a(+c);case O:case A:return new a(c);
-case E:return a(c.source,v.exec(c))}for(o||(o=[]),i||(i=[]),f=o.length;f--;)if(o[f]==n)return i[f];return c=l?a(c.length):{},l&&(Dt.call(n,"index")&&(c.index=n.index),Dt.call(n,"input")&&(c.input=n.input)),o.push(n),i.push(c),(l?ot:Zt)(n,function(n,u){c[u]=G(n,t,r,e,o,i)}),c}function H(n){var t=[];return Yt(n,function(n,e){W(n)&&t.push(e)}),t.sort()}function J(n){for(var t=-1,e=te(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function Q(n,t,e,r,a,o){var c=e===i;if(e&&!c){e=typeof r=="undefined"?e:u.createCallback(e,r,2);
-var f=e(n,t);if(typeof f!="undefined")return!!f}if(n===t)return 0!==n||1/n==1/t;var l=typeof n,p=typeof t;if(n===n&&(!n||"function"!=l&&"object"!=l)&&(!t||"function"!=p&&"object"!=p))return!1;if(null==n||null==t)return n===t;if(p=Kt.call(n),l=Kt.call(t),p==C&&(p=S),l==C&&(l=S),p!=l)return!1;switch(p){case j:case k:return+n==+t;case O:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case E:case A:return n==Nt(t)}if(l=p==w,!l){if(Dt.call(n,"__wrapped__")||Dt.call(t,"__wrapped__"))return Q(n.__wrapped__||n,t.__wrapped__||t,e,r,a,o);
-if(p!=S||!Wt.nodeClass&&(z(n)||z(t)))return!1;var p=!Wt.argsObject&&V(n)?At:n.constructor,s=!Wt.argsObject&&V(t)?At:t.constructor;if(p!=s&&(!W(p)||!(p instanceof p&&W(s)&&s instanceof s)))return!1}for(a||(a=[]),o||(o=[]),p=a.length;p--;)if(a[p]==n)return o[p]==t;var v=0,f=!0;if(a.push(n),o.push(t),l){if(p=n.length,v=t.length,f=v==n.length,!f&&!c)return f;for(;v--;)if(l=p,s=t[v],c)for(;l--&&!(f=Q(n[l],s,e,r,a,o)););else if(!(f=Q(n[v],s,e,r,a,o)))break;return f}return Yt(t,function(t,u,i){return Dt.call(i,u)?(v++,f=Dt.call(n,u)&&Q(n[u],t,e,r,a,o)):void 0
-}),f&&!c&&Yt(n,function(n,t,e){return Dt.call(e,t)?f=-1<--v:void 0}),f}function W(n){return typeof n=="function"}function X(n){return n?N[typeof n]:!1}function Y(n){return typeof n=="number"||Kt.call(n)==O}function Z(n){return typeof n=="string"||Kt.call(n)==A}function nt(n,t,e){var r=arguments,a=0,o=2;if(!X(n))return n;if(e===i)var c=r[3],f=r[4],l=r[5];else f=[],l=[],typeof e!="number"&&(o=r.length),3<o&&"function"==typeof r[o-2]?c=u.createCallback(r[--o-1],r[o--],2):2<o&&"function"==typeof r[o-1]&&(c=r[--o]);
-for(;++a<o;)(ne(r[a])?ot:Zt)(r[a],function(t,e){var r,u,a=t,o=n[e];if(t&&((u=ne(t))||oe(t))){for(a=f.length;a--;)if(r=f[a]==t){o=l[a];break}r||(o=u?ne(o)?o:[]:oe(o)?o:{},c&&(a=c(o,t),typeof a!="undefined"&&(o=a)),f.push(t),l.push(o),c||(o=nt(o,t,i,c,f,l)))}else c&&(a=c(o,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(o=a);n[e]=o});return n}function tt(n){for(var t=-1,e=te(n),r=e.length,u=jt(r);++t<r;)u[t]=n[e[t]];return u}function et(n,t,e){var r=-1,u=n?n.length:0,a=!1;return e=(0>e?Vt(0,u+e):e)||0,typeof u=="number"?a=-1<(Z(n)?n.indexOf(t,e):gt(n,t,e)):Xt(n,function(n){return++r<e?void 0:!(a=n===t)
-}),a}function rt(n,t,e){var r=!0;if(t=u.createCallback(t,e),ne(n)){e=-1;for(var a=n.length;++e<a&&(r=!!t(n[e],e,n)););}else Xt(n,function(n,e,u){return r=!!t(n,e,u)});return r}function ut(n,t,e){var r=[];if(t=u.createCallback(t,e),ne(n)){e=-1;for(var a=n.length;++e<a;){var o=n[e];t(o,e,n)&&r.push(o)}}else Xt(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function at(n,t,e){if(t=u.createCallback(t,e),!ne(n)){var r;return Xt(n,function(n,e,u){return t(n,e,u)?(r=n,!1):void 0}),r}e=-1;for(var a=n.length;++e<a;){var o=n[e];
-if(t(o,e,n))return o}}function ot(n,t,e){if(t&&typeof e=="undefined"&&ne(n)){e=-1;for(var r=n.length;++e<r&&!1!==t(n[e],e,n););}else Xt(n,t,e);return n}function it(n,t,e){var r=-1,a=n?n.length:0,o=jt(typeof a=="number"?a:0);if(t=u.createCallback(t,e),ne(n))for(;++r<a;)o[r]=t(n[r],r,n);else Xt(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function ct(n,t,e){var r=-1/0,a=r;if(!t&&ne(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>a&&(a=i)}}else t=!t&&Z(n)?q:u.createCallback(t,e),Xt(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,a=n)
-});return a}function ft(n,t,e,r){var a=3>arguments.length;if(t=u.createCallback(t,r,4),ne(n)){var o=-1,i=n.length;for(a&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n)}else Xt(n,function(n,r,u){e=a?(a=!1,n):t(e,n,r,u)});return e}function lt(n,t,e,r){var a=n,o=n?n.length:0,i=3>arguments.length;if(typeof o!="number")var c=te(n),o=c.length;else Wt.unindexedChars&&Z(n)&&(a=n.split(""));return t=u.createCallback(t,r,4),ot(n,function(n,r,u){r=c?c[--o]:--o,e=i?(i=!1,a[r]):t(e,a[r],r,u)}),e}function pt(n,t,e){var r;if(t=u.createCallback(t,e),ne(n)){e=-1;
-for(var a=n.length;++e<a&&!(r=t(n[e],e,n)););}else Xt(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function st(n,t,e){if(n){var r=0,a=n.length;if(typeof t!="number"&&null!=t){var o=-1;for(t=u.createCallback(t,e);++o<a&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[0];return M(n,0,Gt(Vt(0,r),a))}}function vt(n,t,e,r){var a=-1,o=n?n.length:0,i=[];for(typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1),null!=e&&(e=u.createCallback(e,r));++a<o;)r=n[a],e&&(r=e(r,a,n)),ne(r)?zt.apply(i,t?r:vt(r)):i.push(r);
-return i}function gt(n,t,e){var r=-1,u=n?n.length:0;if(typeof e=="number")r=(0>e?Vt(0,u+e):e||0)-1;else if(e)return r=yt(n,t),n[r]===t?r:-1;for(;++r<u;)if(n[r]===t)return r;return-1}function ht(n,t,e){if(typeof t!="number"&&null!=t){var r=0,a=-1,o=n?n.length:0;for(t=u.createCallback(t,e);++a<o&&t(n[a],a,n);)r++}else r=null==t||e?1:Vt(0,t);return M(n,r)}function yt(n,t,e,r){var a=0,o=n?n.length:a;for(e=e?u.createCallback(e,r,1):_t,t=e(t);a<o;)r=a+o>>>1,e(n[r])<t?a=r+1:o=r;return a}function mt(n,t,e,r){var a=-1,o=n?n.length:0,i=[],c=i;
-typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1);var f=!t&&75<=o;if(f)var l={};for(null!=e&&(c=[],e=u.createCallback(e,r));++a<o;){r=n[a];var p=e?e(r,a,n):r;if(f)var s=Nt(p),s=Dt.call(l,s)?!(c=l[s]):c=l[s]=[];(t?!a||c[c.length-1]!==p:s||0>gt(c,p))&&((e||f)&&c.push(p),i.push(r))}return i}function dt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:u[a[0]]=a[1]}return u}function bt(n,t){return R(n,t,M(arguments,2))}function _t(n){return n}function Ct(n){ot(H(n),function(t){var e=u[t]=n[t];
-u.prototype[t]=function(){var n=this.__wrapped__,t=[n];return zt.apply(t,arguments),t=e.apply(u,t),n&&typeof n=="object"&&n==t?this:new L(t)}})}function wt(){return this.__wrapped__}r=r?F.defaults(n.Object(),r,F.pick(n,b)):n;var jt=r.Array,kt=r.Boolean,xt=r.Date,Ot=r.Function,St=r.Math,Et=r.Number,At=r.Object,It=r.RegExp,Nt=r.String,Pt=jt(),Ft=At(),qt=r._,Bt=St.ceil,Rt=r.clearTimeout,$t=Pt.concat,Tt=St.floor,Dt=Ft.hasOwnProperty,zt=Pt.push,Lt=r.setTimeout,Kt=Ft.toString,Mt=r.isFinite,Ut=r.isNaN,Vt=St.max,Gt=St.min,Ht=r.parseInt,Jt=St.random,Qt={};
-Qt[w]=jt,Qt[j]=kt,Qt[k]=xt,Qt[S]=At,Qt[O]=Et,Qt[E]=It,Qt[A]=Nt;var Wt=u.support={};(function(){var n=function(){this.x=1},t={0:1,length:1},e=[];n.prototype={valueOf:1,y:1};for(var r in new n)e.push(r);for(r in arguments);Wt.argsObject=arguments.constructor==At,Wt.argsClass=!1,Wt.enumPrototypes=n.propertyIsEnumerable("prototype"),Wt.ownLast="x"!=e[0],Wt.nonEnumArgs=0!=r,Wt.nonEnumShadows=!/valueOf/.test(e),Wt.spliceObjects=(Pt.splice.call(t,0,1),!t[0]),Wt.unindexedChars="xx"!="x"[0]+At("x")[0];try{Wt.nodeClass=!(Kt.call(document)==S&&!Nt({toString:0}))
-}catch(u){Wt.nodeClass=!0}})(1),u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:g,variable:"",imports:{_:u}};var kt={a:"q,w,g",g:"var a=arguments,b=0,c=typeof g=='number'?2:a.length;while(++b<c){m=a[b];if(m&&r[typeof m]){",e:"if(typeof u[i]=='undefined')u[i]=m[i]",c:"}}"},St={a:"e,d,x",g:"d=d&&typeof x=='undefined'?d:o.createCallback(d,x)",b:"typeof n=='number'",e:"if(d(m[i],i,e)===false)return u"},Et={g:"if(!r[typeof m])return u;"+St.g,b:!1},Xt=$(St);L.prototype=u.prototype;
-var Yt=$(St,Et,{h:!1}),Zt=$(St,Et),ne=function(n){return Wt.argsObject&&n instanceof jt||Kt.call(n)==w},te=function(n){var t=[];return Zt(n,function(n,e){t.push(e)}),t},ee={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},re=J(ee),ue=$(kt,{g:kt.g.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=o.createCallback(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),e:"u[i]=d?d(u[i],m[i]):m[i]"}),ae=$(kt);W(/x/)&&(W=function(n){return n instanceof Ot||Kt.call(n)==x
-});var oe=function(n){var t=!1;if(!n||Kt.call(n)!=S||!Wt.argsClass&&V(n))return t;var e=n.constructor;return!W(e)&&(Wt.nodeClass||!z(n))||e instanceof e?Wt.ownLast?(Yt(n,function(n,e,r){return t=Dt.call(r,e),!1}),!0===t):(Yt(n,function(n,e){t=e}),!1===t||Dt.call(n,t)):t},kt=8==Ht("08")?Ht:function(n,t){return Ht(Z(n)?n.replace(h,""):n,t||0)};return u.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},u.assign=ue,u.at=function(n){var t=-1,e=$t.apply(Pt,M(arguments,1)),r=e.length,u=jt(r);
-for(Wt.unindexedChars&&Z(n)&&(n=n.split(""));++t<r;)u[t]=n[e[t]];return u},u.bind=bt,u.bindAll=function(n){for(var t=$t.apply(Pt,arguments),e=1<t.length?0:(t=H(n),-1),r=t.length;++e<r;){var u=t[e];n[u]=bt(n[u],n)}return n},u.bindKey=function(n,t){return R(n,t,M(arguments,2))},u.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},u.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},u.countBy=function(n,t,e){var r={};
-return t=u.createCallback(t,e),ot(n,function(n,e,u){e=Nt(t(n,e,u)),Dt.call(r,e)?r[e]++:r[e]=1}),r},u.createCallback=function(n,t,e){if(null==n)return _t;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=te(n);return function(t){for(var e=u.length,r=!1;e--&&(r=Q(t[u[e]],n[u[e]],i)););return r}}return typeof t!="undefined"?1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)}:4===e?function(e,r,u,a){return n.call(t,e,r,u,a)}:function(e,r,u){return n.call(t,e,r,u)
-}:n},u.debounce=function(n,t,e){function r(){i=null,e||(a=n.apply(o,u))}var u,a,o,i;return function(){var c=e&&!i;return u=arguments,o=this,Rt(i),i=Lt(r,t),c&&(a=n.apply(o,u)),a}},u.defaults=ae,u.defer=function(n){var t=M(arguments,1);return Lt(function(){n.apply(e,t)},1)},u.delay=function(n,t){var r=M(arguments,2);return Lt(function(){n.apply(e,r)},t)},u.difference=function(n){for(var t=-1,e=n?n.length:0,r=$t.apply(Pt,arguments),r=a(r,e,100),u=[];++t<e;){var o=n[t];r(o)||u.push(o)}return u},u.filter=ut,u.flatten=vt,u.forEach=ot,u.forIn=Yt,u.forOwn=Zt,u.functions=H,u.groupBy=function(n,t,e){var r={};
-return t=u.createCallback(t,e),ot(n,function(n,e,u){e=Nt(t(n,e,u)),(Dt.call(r,e)?r[e]:r[e]=[]).push(n)}),r},u.initial=function(n,t,e){if(!n)return[];var r=0,a=n.length;if(typeof t!="number"&&null!=t){var o=a;for(t=u.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return M(n,0,Gt(Vt(0,a-r),a))},u.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,o=n?n.length:0,i=100<=o,c=[],f=c;n:for(;++u<o;){var l=n[u];if(i)var p=Nt(l),p=Dt.call(r[0],p)?!(f=r[0][p]):f=r[0][p]=[];
-if(p||0>gt(f,l)){i&&f.push(l);for(var s=e;--s;)if(!(r[s]||(r[s]=a(t[s],0,100)))(l))continue n;c.push(l)}}return c},u.invert=J,u.invoke=function(n,t){var e=M(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=jt(typeof a=="number"?a:0);return ot(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},u.keys=te,u.map=it,u.max=ct,u.memoize=function(n,t){var e={};return function(){var r=Nt(t?t.apply(this,arguments):arguments[0]);return Dt.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},u.merge=nt,u.min=function(n,t,e){var r=1/0,a=r;
-if(!t&&ne(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i<a&&(a=i)}}else t=!t&&Z(n)?q:u.createCallback(t,e),Xt(n,function(n,e,u){e=t(n,e,u),e<r&&(r=e,a=n)});return a},u.omit=function(n,t,e){var r=typeof t=="function",a={};if(r)t=u.createCallback(t,e);else var o=$t.apply(Pt,arguments);return Yt(n,function(n,e,u){(r?!t(n,e,u):0>gt(o,e,1))&&(a[e]=n)}),a},u.once=function(n){var t,e;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},u.pairs=function(n){for(var t=-1,e=te(n),r=e.length,u=jt(r);++t<r;){var a=e[t];
-u[t]=[a,n[a]]}return u},u.partial=function(n){return R(n,M(arguments,1))},u.partialRight=function(n){return R(n,M(arguments,1),null,i)},u.pick=function(n,t,e){var r={};if(typeof t!="function")for(var a=0,o=$t.apply(Pt,arguments),i=X(n)?o.length:0;++a<i;){var c=o[a];c in n&&(r[c]=n[c])}else t=u.createCallback(t,e),Yt(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},u.pluck=it,u.range=function(n,t,e){n=+n||0,e=+e||1,null==t&&(t=n,n=0);var r=-1;t=Vt(0,Bt((t-n)/e));for(var u=jt(t);++r<t;)u[r]=n,n+=e;
-return u},u.reject=function(n,t,e){return t=u.createCallback(t,e),ut(n,function(n,e,r){return!t(n,e,r)})},u.rest=ht,u.shuffle=function(n){var t=-1,e=n?n.length:0,r=jt(typeof e=="number"?e:0);return ot(n,function(n){var e=Tt(Jt()*(++t+1));r[t]=r[e],r[e]=n}),r},u.sortBy=function(n,t,e){var r=-1,a=n?n.length:0,o=jt(typeof a=="number"?a:0);for(t=u.createCallback(t,e),ot(n,function(n,e,u){o[++r]={a:t(n,e,u),b:r,c:n}}),a=o.length,o.sort(B);a--;)o[a]=o[a].c;return o},u.tap=function(n,t){return t(n),n},u.throttle=function(n,t){function e(){i=new xt,o=null,u=n.apply(a,r)
-}var r,u,a,o,i=0;return function(){var c=new xt,f=t-(c-i);return r=arguments,a=this,0<f?o||(o=Lt(e,f)):(Rt(o),o=null,i=c,u=n.apply(a,r)),u}},u.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,a=jt(n);for(t=u.createCallback(t,e,1);++r<n;)a[r]=t(r);return a},u.toArray=function(n){return n&&typeof n.length=="number"?Wt.unindexedChars&&Z(n)?n.split(""):M(n):tt(n)},u.union=function(){return mt($t.apply(Pt,arguments))},u.uniq=mt,u.values=tt,u.where=ut,u.without=function(n){for(var t=-1,e=n?n.length:0,r=a(arguments,1,30),u=[];++t<e;){var o=n[t];
-r(o)||u.push(o)}return u},u.wrap=function(n,t){return function(){var e=[n];return zt.apply(e,arguments),t.apply(this,e)}},u.zip=function(n){for(var t=-1,e=n?ct(it(arguments,"length")):0,r=jt(e);++t<e;)r[t]=it(arguments,t);return r},u.zipObject=dt,u.collect=it,u.drop=ht,u.each=ot,u.extend=ue,u.methods=H,u.object=dt,u.select=ut,u.tail=ht,u.unique=mt,Ct(u),u.clone=G,u.cloneDeep=function(n,t,e){return G(n,!0,t,e)},u.contains=et,u.escape=function(n){return null==n?"":Nt(n).replace(m,D)},u.every=rt,u.find=at,u.findIndex=function(n,t,e){var r=-1,a=n?n.length:0;
-for(t=u.createCallback(t,e);++r<a;)if(t(n[r],r,n))return r;return-1},u.findKey=function(n,t,e){var r;return t=u.createCallback(t,e),Zt(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},u.has=function(n,t){return n?Dt.call(n,t):!1},u.identity=_t,u.indexOf=gt,u.isArguments=V,u.isArray=ne,u.isBoolean=function(n){return!0===n||!1===n||Kt.call(n)==j},u.isDate=function(n){return n instanceof xt||Kt.call(n)==k},u.isElement=function(n){return n?1===n.nodeType:!1},u.isEmpty=function(n){var t=!0;if(!n)return t;
-var e=Kt.call(n),r=n.length;return e==w||e==A||(Wt.argsClass?e==C:V(n))||e==S&&typeof r=="number"&&W(n.splice)?!r:(Zt(n,function(){return t=!1}),t)},u.isEqual=Q,u.isFinite=function(n){return Mt(n)&&!Ut(parseFloat(n))},u.isFunction=W,u.isNaN=function(n){return Y(n)&&n!=+n},u.isNull=function(n){return null===n},u.isNumber=Y,u.isObject=X,u.isPlainObject=oe,u.isRegExp=function(n){return n instanceof It||Kt.call(n)==E},u.isString=Z,u.isUndefined=function(n){return typeof n=="undefined"},u.lastIndexOf=function(n,t,e){var r=n?n.length:0;
-for(typeof e=="number"&&(r=(0>e?Vt(0,r+e):Gt(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},u.mixin=Ct,u.noConflict=function(){return r._=qt,this},u.parseInt=kt,u.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+Tt(Jt()*((+t||0)-n+1))},u.reduce=ft,u.reduceRight=lt,u.result=function(n,t){var r=n?n[t]:e;return W(r)?n[t]():r},u.runInContext=t,u.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:te(n).length},u.some=pt,u.sortedIndex=yt,u.template=function(n,t,r){var a=u.templateSettings;
-n||(n=""),r=ae({},r,a);var o,i=ae({},r.imports,a.imports),a=te(i),i=tt(i),p=0,v=r.interpolate||y,h="__p+='",v=It((r.escape||y).source+"|"+v.source+"|"+(v===g?s:y).source+"|"+(r.evaluate||y).source+"|$","g");n.replace(v,function(t,e,r,u,a,i){return r||(r=u),h+=n.slice(p,i).replace(d,T),e&&(h+="'+__e("+e+")+'"),a&&(o=!0,h+="';"+a+";__p+='"),r&&(h+="'+((__t=("+r+"))==null?'':__t)+'"),p=i+t.length,t}),h+="';\n",v=r=r.variable,v||(r="obj",h="with("+r+"){"+h+"}"),h=(o?h.replace(c,""):h).replace(f,"$1").replace(l,"$1;"),h="function("+r+"){"+(v?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+h+"return __p}";
-try{var m=Ot(a,"return "+h).apply(e,i)}catch(b){throw b.source=h,b}return t?m(t):(m.source=h,m)},u.unescape=function(n){return null==n?"":Nt(n).replace(p,U)},u.uniqueId=function(n){var t=++o;return Nt(null==n?"":n)+t},u.all=rt,u.any=pt,u.detect=at,u.foldl=ft,u.foldr=lt,u.include=et,u.inject=ft,Zt(u,function(n,t){u.prototype[t]||(u.prototype[t]=function(){var t=[this.__wrapped__];return zt.apply(t,arguments),n.apply(u,t)})}),u.first=st,u.last=function(n,t,e){if(n){var r=0,a=n.length;if(typeof t!="number"&&null!=t){var o=a;
-for(t=u.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[a-1];return M(n,Vt(0,a-r))}},u.take=st,u.head=st,Zt(u,function(n,t){u.prototype[t]||(u.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return null==t||e&&typeof t!="function"?r:new L(r)})}),u.VERSION="1.0.1",u.prototype.toString=function(){return Nt(this.__wrapped__)},u.prototype.value=wt,u.prototype.valueOf=wt,Xt(["join","pop","shift"],function(n){var t=Pt[n];u.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)
-}}),Xt(["push","reverse","sort","unshift"],function(n){var t=Pt[n];u.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Xt(["concat","slice","splice"],function(n){var t=Pt[n];u.prototype[n]=function(){return new L(t.apply(this.__wrapped__,arguments))}}),Wt.spliceObjects||Xt(["pop","shift","splice"],function(n){var t=Pt[n],e="splice"==n;u.prototype[n]=function(){var n=this.__wrapped__,r=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new L(r):r}}),u}var e,r=typeof exports=="object"&&exports,u=typeof module=="object"&&module&&module.exports==r&&module,a=typeof global=="object"&&global;
-a.global===a&&(n=a);var o=0,i={},c=/\b__p\+='';/g,f=/\b(__p\+=)''\+/g,l=/(__e\(.*?\)|\b__t\))\+'';/g,p=/&(?:amp|lt|gt|quot|#39);/g,s=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,v=/\w*$/,g=/<%=([\s\S]+?)%>/g,h=/^0+(?=.$)/,y=/($^)/,m=/[&<>"']/g,d=/['\n\r\t\u2028\u2029\\]/g,b="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),_="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),C="[object Arguments]",w="[object Array]",j="[object Boolean]",k="[object Date]",x="[object Function]",O="[object Number]",S="[object Object]",E="[object RegExp]",A="[object String]",I={};
-I[x]=!1,I[C]=I[w]=I[j]=I[k]=I[O]=I[S]=I[E]=I[A]=!0;var N={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},P={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},F=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=F,define(function(){return F})):r&&!r.nodeType?u?(u.exports=F)._=F:r._=F:n._=F})(this);
+;(function(n){function t(r){function u(n){return n&&typeof