mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
Compare commits
58 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3680925e81 | ||
|
|
647f0dd34b | ||
|
|
a691a519e8 | ||
|
|
86075973b5 | ||
|
|
97ea15300c | ||
|
|
a150a8fd52 | ||
|
|
ad4e20da52 | ||
|
|
e43ab1e46f | ||
|
|
e32e280cf1 | ||
|
|
c1a07e0943 | ||
|
|
93fe641dbf | ||
|
|
d8194c0886 | ||
|
|
75ce4766d3 | ||
|
|
7eff3bf854 | ||
|
|
af143ae7dc | ||
|
|
a0e9140dde | ||
|
|
33e5d46c87 | ||
|
|
f74b206864 | ||
|
|
f334ebe577 | ||
|
|
9c39394d7f | ||
|
|
8ea0e6977a | ||
|
|
bf006473c0 | ||
|
|
568af27be4 | ||
|
|
bd55f86203 | ||
|
|
d95e577639 | ||
|
|
a904e54122 | ||
|
|
2a97655a8d | ||
|
|
d878718510 | ||
|
|
416227a2a2 | ||
|
|
7d1baa8798 | ||
|
|
fe2ee64ec9 | ||
|
|
96819628d6 | ||
|
|
1b30d7909c | ||
|
|
baf253d44e | ||
|
|
b7a4d50007 | ||
|
|
625b4befb5 | ||
|
|
30678f51bd | ||
|
|
7a4103dd48 | ||
|
|
bca3ff2eac | ||
|
|
28e2934a89 | ||
|
|
0563af682d | ||
|
|
5ccd63250b | ||
|
|
f262a0745d | ||
|
|
c42b63b008 | ||
|
|
e7ffb80877 | ||
|
|
919166212f | ||
|
|
deb124f645 | ||
|
|
86b1ff5125 | ||
|
|
2c8c96149f | ||
|
|
82e4cc9951 | ||
|
|
04df06404f | ||
|
|
f6fcf5fce4 | ||
|
|
ac5e92c879 | ||
|
|
37ccc80ba4 | ||
|
|
8153f97899 | ||
|
|
8dedc6d3dc | ||
|
|
807d75e13a | ||
|
|
feac1786e1 |
1
.coveralls.yml
Normal file
1
.coveralls.yml
Normal file
@@ -0,0 +1 @@
|
||||
repo_token: zGjBVmujNT7iaxo98dhB7EGcjLaMWxIkX
|
||||
24
.travis.yml
24
.travis.yml
@@ -6,8 +6,8 @@ node_js:
|
||||
env:
|
||||
global:
|
||||
- BIN="node" BUILD=false COMPAT=false MAKE=false OPTION="" SAUCE_LABS=false
|
||||
- SAUCE_USERNAME="jdalton"
|
||||
- secure: "woILQltl1pI3DgadZ5NrcqntdPvnRmQBwIVNZL91Ht5d9snIhgyAixI6xNAS8F8BzD9RzqzVPHay5sHfn+GhNaojcaiHs1nXAbdyclevMyfP+3MQ1HGfMSU0bv1GdT35LJ+C0u4Y3SuuZSbBlNEeLXRPMngPZahf4xL8RsZz/is="
|
||||
- SAUCE_USERNAME="lodash"
|
||||
- secure: "aFxaPI4NvlZHgXvfmNtUlYCIeiVpC4QzkdevGHc2FK27BJLnNTKNno9sBhaygURbQ83bYzfQ+fe8SMIzE7aLramAGILrT4DiWqfO+ihuB3EK1cahCbB6OionbIUI27Xzy+YukO+5lQmMP/dpVlwhIfR3qxmN4m7wXI+ExEemjZg="
|
||||
matrix:
|
||||
- BUILD="compat"
|
||||
- BUILD="modern"
|
||||
@@ -55,7 +55,7 @@ before_install:
|
||||
- "([ $BUILD == 'legacy' ] || [ $BUILD == 'mobile' ] || [ $BUILD == 'modern' ]) && MAKE=true || true"
|
||||
- "([ $BUILD == 'compat' ] || [ $BUILD == 'legacy' ]) && COMPAT=true || true"
|
||||
- "[ $SAUCE_LABS != false ] && npm i ecstatic@\"~0.4.0\" request@\"~2.27.0\" sauce-tunnel@\"~1.1.0\" || true"
|
||||
- "[ $BIN == 'istanbul' ] && npm i -g istanbul@\"~0.1.0\" || true"
|
||||
- "[ $BIN == 'istanbul' ] && npm i -g coveralls@\"~2.3.0\" istanbul@\"~0.1.0\" || true"
|
||||
- "[ $BIN == 'narwhal' ] && wget https://github.com/280north/narwhal/archive/v0.3.2.zip && sudo unzip v0.3.2 -d /opt/ && rm v0.3.2.zip || true"
|
||||
- "[ $BIN == 'narwhal' ] && sudo ln -s /opt/narwhal-0.3.2/bin/narwhal /usr/local/bin/narwhal && sudo chmod +x /usr/local/bin/narwhal || true"
|
||||
- "[ $BIN == 'rhino' ] && sudo mkdir /opt/rhino-1.7R5 && sudo wget -O /opt/rhino-1.7R5/js.jar https://oss.sonatype.org/content/repositories/snapshots/org/mozilla/rhino/1.7R5-SNAPSHOT/rhino-1.7R5-20120629.144839-4.jar || true"
|
||||
@@ -66,15 +66,15 @@ before_install:
|
||||
- "[ $MAKE != false ] && mkdir ./node_modules/lodash-cli/node_modules && cd ./node_modules/lodash-cli/node_modules/ && ln -s ../../../ ./lodash && cd ../ && npm i . && cd ../../ || true"
|
||||
- "[ $MAKE != false ] && node ./node_modules/lodash-cli/bin/lodash $BUILD -o ./dist/lodash.$BUILD.js || true"
|
||||
script:
|
||||
- "[ $BIN == 'istanbul' ] && $BIN cover ./test/test.js || true"
|
||||
- "[ $BIN == 'istanbul' ] && $BIN cover -x \"**/vendor/**\" --report lcovonly ./test/test.js -- ./dist/lodash.js && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage || true"
|
||||
- "([ $SAUCE_LABS != false ] || [ $BUILD == false ]) && true || cd ./test"
|
||||
- "([ $SAUCE_LABS != false ] || [ $BUILD == false ]) && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.js"
|
||||
- "([ $SAUCE_LABS != false ] || [ $BUILD == false ]) && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.min.js"
|
||||
- "([ $SAUCE_LABS == false ] || [ $BUILD == 'underscore' ]) && true || node ./test/saucelabs.js \"test/index.html?build=lodash-$BUILD\""
|
||||
- "([ $SAUCE_LABS == false ] || [ $BUILD == 'underscore' ]) && true || node ./test/saucelabs.js \"test/index.html?build=../dist/lodash.$BUILD.js\""
|
||||
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js \"test/backbone.html?build=lodash-$BUILD\""
|
||||
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js \"test/backbone.html?build=../dist/lodash.$BUILD.js\""
|
||||
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js \"test/underscore.html?build=lodash-$BUILD\""
|
||||
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js \"test/underscore.html?build=../dist/lodash.$BUILD.js\""
|
||||
- "([ $SAUCE_LABS == false ] || [ $COMPAT == false ]) && true || node ./test/saucelabs.js \"test/index.html?build=lodash-$BUILD&compat=7\""
|
||||
- "([ $SAUCE_LABS == false ] || [ $COMPAT == false ]) && true || node ./test/saucelabs.js \"test/index.html?build=../dist/lodash.$BUILD.js&compat=7\""
|
||||
- "([ $SAUCE_LABS == false ] || [ $BUILD == 'underscore' ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=lodash-$BUILD\" tags=\"$BUILD,production\""
|
||||
- "([ $SAUCE_LABS == false ] || [ $COMPAT == false ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=lodash-$BUILD\" tags=\"$BUILD,production,ie-compat\" compatMode=7"
|
||||
- "([ $SAUCE_LABS == false ] || [ $BUILD == 'underscore' ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=../dist/lodash.$BUILD.js\" tags=\"$BUILD,development\""
|
||||
- "([ $SAUCE_LABS == false ] || [ $COMPAT == false ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=../dist/lodash.$BUILD.js\" tags=\"$BUILD,development,ie-compat\" compatMode=7"
|
||||
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=lodash-$BUILD\" tags=\"$BUILD,production,backbone\""
|
||||
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.$BUILD.js\" tags=\"$BUILD,development,backbone\""
|
||||
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=lodash-$BUILD\" tags=\"$BUILD,production,underscore\""
|
||||
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=../dist/lodash.$BUILD.js\" tags=\"$BUILD,development,underscore\""
|
||||
|
||||
27
README.md
27
README.md
@@ -1,4 +1,4 @@
|
||||
# Lo-Dash v2.3.0
|
||||
# Lo-Dash v2.4.0
|
||||
A utility library delivering consistency, [customization](http://lodash.com/custom-builds), [performance](http://lodash.com/benchmarks), & [extras](http://lodash.com/#features).
|
||||
|
||||
## Download
|
||||
@@ -6,16 +6,16 @@ A utility library delivering consistency, [customization](http://lodash.com/cust
|
||||
Check out our [wiki]([https://github.com/lodash/lodash/wiki/build-differences]) for details over the differences between builds.
|
||||
|
||||
* Modern builds perfect for newer browsers/environments:<br>
|
||||
[Development](https://raw.github.com/lodash/lodash/2.3.0/dist/lodash.js) &
|
||||
[Production](https://raw.github.com/lodash/lodash/2.3.0/dist/lodash.min.js)
|
||||
[Development](https://raw.github.com/lodash/lodash/2.4.0/dist/lodash.js) &
|
||||
[Production](https://raw.github.com/lodash/lodash/2.4.0/dist/lodash.min.js)
|
||||
|
||||
* Compatibility builds for older environment support too:<br>
|
||||
[Development](https://raw.github.com/lodash/lodash/2.3.0/dist/lodash.compat.js) &
|
||||
[Production](https://raw.github.com/lodash/lodash/2.3.0/dist/lodash.compat.min.js)
|
||||
[Development](https://raw.github.com/lodash/lodash/2.4.0/dist/lodash.compat.js) &
|
||||
[Production](https://raw.github.com/lodash/lodash/2.4.0/dist/lodash.compat.min.js)
|
||||
|
||||
* Underscore builds to use as a drop-in replacement:<br>
|
||||
[Development](https://raw.github.com/lodash/lodash/2.3.0/dist/lodash.underscore.js) &
|
||||
[Production](https://raw.github.com/lodash/lodash/2.3.0/dist/lodash.underscore.min.js)
|
||||
[Development](https://raw.github.com/lodash/lodash/2.4.0/dist/lodash.underscore.js) &
|
||||
[Production](https://raw.github.com/lodash/lodash/2.4.0/dist/lodash.underscore.min.js)
|
||||
|
||||
CDN copies are available on [cdnjs](http://cdnjs.com/libraries/lodash.js/) & [jsDelivr](http://www.jsdelivr.com/#!lodash). For smaller file sizes, create [custom builds](http://lodash.com/custom-builds) with only the features needed.
|
||||
|
||||
@@ -38,6 +38,7 @@ A list of upcoming features is available on our [roadmap](https://github.com/lod
|
||||
* [_.clone](http://lodash.com/docs#clone) supports shallow cloning of `Date` & `RegExp` objects
|
||||
* [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays & objects
|
||||
* [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex`
|
||||
* [_.constant](http://lodash.com/docs#constant) and [_.property](http://lodash.com/docs#property) function generators for composing functions
|
||||
* [_.create](http://lodash.com/docs#create) for easier object inheritance
|
||||
* [_.createCallback](http://lodash.com/docs#createCallback) for extending callbacks in methods & mixins
|
||||
* [_.curry](http://lodash.com/docs#curry) for creating [curried](http://hughfdjackson.com/javascript/2013/07/06/why-curry-helps/) functions
|
||||
@@ -47,18 +48,21 @@ A list of upcoming features is available on our [roadmap](https://github.com/lod
|
||||
* [_.forIn](http://lodash.com/docs#forIn) for iterating own & inherited properties
|
||||
* [_.forOwn](http://lodash.com/docs#forOwn) for iterating own properties
|
||||
* [_.isPlainObject](http://lodash.com/docs#isPlainObject) for checking if values are created by `Object`
|
||||
* [_.mapValues](http://lodash.com/docs#mapValues) for [mapping](http://lodash.com/docs#map) values to an object
|
||||
* [_.memoize](http://lodash.com/docs#memoize) exposes the `cache` of memoized functions
|
||||
* [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend)
|
||||
* [_.noop](http://lodash.com/docs#noop) for function placeholders
|
||||
* [_.now](http://lodash.com/docs#now) as a cross-browser `Date.now` alternative
|
||||
* [_.parseInt](http://lodash.com/docs#parseInt) for consistent behavior
|
||||
* [_.partialRight](http://lodash.com/docs#partialRight) for [partial application](http://lodash.com/docs#partial) from the right
|
||||
* [_.pull](http://lodash.com/docs#pull) & [_.remove](http://lodash.com/docs#remove) for mutating arrays
|
||||
* [_.random](http://lodash.com/docs#random) supports returning floating-point numbers
|
||||
* [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking
|
||||
* [_.sortBy](http://lodash.com/docs#sortBy) supports sorting by multiple properties
|
||||
* [_.support](http://lodash.com/docs#support) for flagging environment features
|
||||
* [_.template](http://lodash.com/docs#template) supports [*“imports”*](http://lodash.com/docs#templateSettings_imports) options & [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6)
|
||||
* [_.template](http://lodash.com/docs#template) supports [*“imports”*](http://lodash.com/docs#templateSettings_imports) options & [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals)
|
||||
* [_.transform](http://lodash.com/docs#transform) as a powerful alternative to [_.reduce](http://lodash.com/docs#reduce) for transforming objects
|
||||
* [_.where](http://lodash.com/docs#where) supports deep object comparisons
|
||||
* [_.xor](http://lodash.com/docs#xor) as a companion to [_.difference](http://lodash.com/docs#difference), [_.intersection](http://lodash.com/docs#intersection), & [_.union](http://lodash.com/docs#union)
|
||||
* [_.zip](http://lodash.com/docs#zip) is capable of unzipping values
|
||||
* [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick), &
|
||||
[more](http://lodash.com/docs "_.assign, _.clone, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept callbacks
|
||||
@@ -67,7 +71,7 @@ A list of upcoming features is available on our [roadmap](https://github.com/lod
|
||||
* [_.filter](http://lodash.com/docs#filter), [_.map](http://lodash.com/docs#map), &
|
||||
[more](http://lodash.com/docs "_.countBy, _.every, _.find, _.findKey, _.findLast, _.findLastIndex, _.findLastKey, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* & *“_.where”* shorthands
|
||||
* [_.findLast](http://lodash.com/docs#findLast), [_.findLastIndex](http://lodash.com/docs#findLastIndex), &
|
||||
[more](http://lodash.com/docs "_.findLastKey, _.forEachRight, _.forInRight, _.forOwnRight") right-associative methods
|
||||
[more](http://lodash.com/docs "_.findLastKey, _.forEachRight, _.forInRight, _.forOwnRight, _.partialRight") right-associative methods
|
||||
|
||||
## Resources
|
||||
|
||||
@@ -90,7 +94,8 @@ A list of upcoming features is available on our [roadmap](https://github.com/lod
|
||||
|
||||
## Support
|
||||
|
||||
Tested in Chrome 5~30, Firefox 2~25, IE 6-11, Opera 9.25~17, Safari 3-7, Node.js 0.6.8-0.10.21, Narwhal 0.3.2, PhantomJS 1.9.2, RingoJS 0.9, & Rhino 1.7RC5.
|
||||
Tested in Chrome 5~31, Firefox 2~25, IE 6-11, Opera 9.25~17, Safari 3-7, Node.js 0.6.21~0.10.22, Narwhal 0.3.2, PhantomJS 1.9.2, RingoJS 0.9, & Rhino 1.7RC5.<br>
|
||||
Automated browser test results [are available](https://saucelabs.com/u/lodash) as well as [Travis CI](https://travis-ci.org/) builds for [lodash](https://travis-ci.org/lodash/lodash/), [lodash-cli](https://travis-ci.org/lodash/lodash-cli/), [lodash-amd](https://travis-ci.org/lodash/lodash-amd/), [lodash-node](https://travis-ci.org/lodash/lodash-node/), & [grunt-lodash](https://travis-ci.org/lodash/grunt-lodash).
|
||||
|
||||
Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing.<br>
|
||||
[](https://saucelabs.com/ "Sauce Labs: Selenium Testing & More")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"version": "2.3.0",
|
||||
"version": "2.4.0",
|
||||
"main": "dist/lodash.compat.js",
|
||||
"ignore": [
|
||||
".*",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"repo": "lodash/lodash",
|
||||
"version": "2.3.0",
|
||||
"version": "2.4.0",
|
||||
"description": "A utility library delivering consistency, customization, performance, & extras.",
|
||||
"license": "MIT",
|
||||
"keywords": ["amd", "browser", "client", "functional", "server", "util"],
|
||||
|
||||
560
dist/lodash.compat.js
vendored
560
dist/lodash.compat.js
vendored
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
||||
* Lo-Dash 2.4.0 (Custom Build) <http://lodash.com/>
|
||||
* Build: `lodash -o ./dist/lodash.compat.js`
|
||||
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
||||
@@ -50,7 +50,7 @@
|
||||
|
||||
/**
|
||||
* Used to match ES6 template delimiters
|
||||
* http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6
|
||||
* http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals
|
||||
*/
|
||||
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
var contextProps = [
|
||||
'Array', 'Boolean', 'Date', 'Error', 'Function', 'Math', 'Number', 'Object',
|
||||
'RegExp', 'String', '_', 'attachEvent', 'clearTimeout', 'isFinite', 'isNaN',
|
||||
'parseInt', 'setImmediate', 'setTimeout'
|
||||
'parseInt', 'setTimeout'
|
||||
];
|
||||
|
||||
/** Used to fix the JScript [[DontEnum]] bug */
|
||||
@@ -281,22 +281,29 @@
|
||||
*/
|
||||
function compareAscending(a, b) {
|
||||
var ac = a.criteria,
|
||||
bc = b.criteria;
|
||||
bc = b.criteria,
|
||||
index = -1,
|
||||
length = ac.length;
|
||||
|
||||
// ensure a stable sort in V8 and other engines
|
||||
// http://code.google.com/p/v8/issues/detail?id=90
|
||||
if (ac !== bc) {
|
||||
if (ac > bc || typeof ac == 'undefined') {
|
||||
return 1;
|
||||
}
|
||||
if (ac < bc || typeof bc == 'undefined') {
|
||||
return -1;
|
||||
while (++index < length) {
|
||||
var value = ac[index],
|
||||
other = bc[index];
|
||||
|
||||
if (value !== other) {
|
||||
if (value > other || typeof value == 'undefined') {
|
||||
return 1;
|
||||
}
|
||||
if (value < other || typeof other == 'undefined') {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
// The JS engine embedded in Adobe applications like InDesign has a buggy
|
||||
// `Array#sort` implementation that causes it, under certain circumstances,
|
||||
// to return the same value for `a` and `b`.
|
||||
// See https://github.com/jashkenas/underscore/pull/1247
|
||||
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
|
||||
// that causes it, under certain circumstances, to return the same value for
|
||||
// `a` and `b`. See https://github.com/jashkenas/underscore/pull/1247
|
||||
//
|
||||
// This also ensures a stable sort in V8 and other engines.
|
||||
// See http://code.google.com/p/v8/issues/detail?id=90
|
||||
return a.index - b.index;
|
||||
}
|
||||
|
||||
@@ -513,16 +520,11 @@
|
||||
fnToString = Function.prototype.toString,
|
||||
getPrototypeOf = reNative.test(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf,
|
||||
hasOwnProperty = objectProto.hasOwnProperty,
|
||||
now = reNative.test(now = Date.now) && now || function() { return +new Date; },
|
||||
push = arrayRef.push,
|
||||
propertyIsEnumerable = objectProto.propertyIsEnumerable,
|
||||
setTimeout = context.setTimeout,
|
||||
splice = arrayRef.splice;
|
||||
|
||||
/** Used to detect `setImmediate` in Node.js */
|
||||
var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
|
||||
!reNative.test(setImmediate) && setImmediate;
|
||||
|
||||
/** Used to set meta data on functions */
|
||||
var defineProperty = (function() {
|
||||
// IE 8 only accepts DOM elements
|
||||
@@ -2477,22 +2479,22 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the specified object `property` exists and is a direct property,
|
||||
* Checks if the specified property name exists as a direct property of `object`,
|
||||
* instead of an inherited property.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {Object} object The object to check.
|
||||
* @param {string} property The property to check for.
|
||||
* @param {Object} object The object to inspect.
|
||||
* @param {string} key The name of the property to check.
|
||||
* @returns {boolean} Returns `true` if key is a direct property, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b');
|
||||
* // => true
|
||||
*/
|
||||
function has(object, property) {
|
||||
return object ? hasOwnProperty.call(object, property) : false;
|
||||
function has(object, key) {
|
||||
return object ? hasOwnProperty.call(object, key) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2505,7 +2507,7 @@
|
||||
* @returns {Object} Returns the created inverted object.
|
||||
* @example
|
||||
*
|
||||
* _.invert({ 'first': 'fred', 'second': 'barney' });
|
||||
* _.invert({ 'first': 'fred', 'second': 'barney' });
|
||||
* // => { 'fred': 'first', 'barney': 'second' }
|
||||
*/
|
||||
function invert(object) {
|
||||
@@ -2897,6 +2899,52 @@
|
||||
return typeof value == 'undefined';
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an object with the same keys as `object` and values generated by
|
||||
* running each own enumerable property of `object` through the callback.
|
||||
* The callback is bound to `thisArg` and invoked with three arguments;
|
||||
* (value, key, object).
|
||||
*
|
||||
* If a property name is provided for `callback` the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is provided for `callback` the created "_.where" style callback
|
||||
* will return `true` for elements that have the properties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns a new object with values of the results of each `callback` execution.
|
||||
* @example
|
||||
*
|
||||
* _.mapValues({ 'a': 1, 'b': 2, 'c': 3} , function(num) { return num * 3; });
|
||||
* // => { 'a': 3, 'b': 6, 'c': 9 }
|
||||
*
|
||||
* var characters = {
|
||||
* 'fred': { 'name': 'fred', 'age': 40 },
|
||||
* 'pebbles': { 'name': 'pebbles', 'age': 1 }
|
||||
* };
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.mapValues(characters, 'age');
|
||||
* // => { 'fred': 40, 'pebbles': 1 }
|
||||
*/
|
||||
function mapValues(object, callback, thisArg) {
|
||||
var result = {};
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
|
||||
forOwn(object, function(value, key, object) {
|
||||
result[key] = callback(value, key, object);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively merges own enumerable properties of the source object(s), that
|
||||
* don't resolve to `undefined` into the destination object. Subsequent sources
|
||||
@@ -2955,7 +3003,6 @@
|
||||
if (!isObject(object)) {
|
||||
return object;
|
||||
}
|
||||
|
||||
// allows working with `_.reduce` and `_.reduceRight` without using
|
||||
// their `index` and `collection` arguments
|
||||
if (typeof args[2] != 'number') {
|
||||
@@ -3112,11 +3159,11 @@
|
||||
|
||||
/**
|
||||
* An alternative to `_.reduce` this method transforms `object` to a new
|
||||
* `accumulator` object which is the result of running each of its elements
|
||||
* through a callback, with each callback execution potentially mutating
|
||||
* the `accumulator` object. The callback is bound to `thisArg` and invoked
|
||||
* with four arguments; (accumulator, value, key, object). Callbacks may exit
|
||||
* iteration early by explicitly returning `false`.
|
||||
* `accumulator` object which is the result of running each of its own
|
||||
* enumerable properties through a callback, with each callback execution
|
||||
* potentially mutating the `accumulator` object. The callback is bound to
|
||||
* `thisArg` and invoked with four arguments; (accumulator, value, key, object).
|
||||
* Callbacks may exit iteration early by explicitly returning `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -3955,7 +4002,7 @@
|
||||
* @type Function
|
||||
* @category Collections
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {string} property The property to pluck.
|
||||
* @param {string} property The name of the property to pluck.
|
||||
* @returns {Array} Returns a new array of property values.
|
||||
* @example
|
||||
*
|
||||
@@ -4176,7 +4223,7 @@
|
||||
* // => 3
|
||||
*
|
||||
* _.size('pebbles');
|
||||
* // => 5
|
||||
* // => 7
|
||||
*/
|
||||
function size(collection) {
|
||||
var length = collection ? collection.length : 0;
|
||||
@@ -4256,6 +4303,9 @@
|
||||
* If a property name is provided for `callback` the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an array of property names is provided for `callback` the collection
|
||||
* will be sorted by each property value.
|
||||
*
|
||||
* If an object is provided for `callback` the created "_.where" style callback
|
||||
* will return `true` for elements that have the properties of the given object,
|
||||
* else `false`.
|
||||
@@ -4264,7 +4314,7 @@
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* @param {Array|Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
@@ -4277,19 +4327,37 @@
|
||||
* _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math);
|
||||
* // => [3, 1, 2]
|
||||
*
|
||||
* var characters = [
|
||||
* { 'name': 'barney', 'age': 36 },
|
||||
* { 'name': 'fred', 'age': 40 },
|
||||
* { 'name': 'barney', 'age': 26 },
|
||||
* { 'name': 'fred', 'age': 30 }
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.sortBy(['banana', 'strawberry', 'apple'], 'length');
|
||||
* // => ['apple', 'banana', 'strawberry']
|
||||
* _.map(_.sortBy(characters, 'age'), _.values);
|
||||
* // => [['barney', 26], ['fred', 30], ['barney', 36], ['fred', 40]]
|
||||
*
|
||||
* // sorting by multiple properties
|
||||
* _.map(_.sortBy(characters, ['name', 'age']), _.values);
|
||||
* // = > [['barney', 26], ['barney', 36], ['fred', 30], ['fred', 40]]
|
||||
*/
|
||||
function sortBy(collection, callback, thisArg) {
|
||||
var index = -1,
|
||||
isArr = isArray(callback),
|
||||
length = collection ? collection.length : 0,
|
||||
result = Array(typeof length == 'number' ? length : 0);
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
if (!isArr) {
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
}
|
||||
forEach(collection, function(value, key, collection) {
|
||||
var object = result[++index] = getObject();
|
||||
object.criteria = callback(value, key, collection);
|
||||
if (isArr) {
|
||||
object.criteria = map(callback, function(key) { return value[key]; });
|
||||
} else {
|
||||
(object.criteria = getArray())[0] = callback(value, key, collection);
|
||||
}
|
||||
object.index = index;
|
||||
object.value = value;
|
||||
});
|
||||
@@ -4299,6 +4367,9 @@
|
||||
while (length--) {
|
||||
var object = result[length];
|
||||
result[length] = object.value;
|
||||
if (!isArr) {
|
||||
releaseArray(object.criteria);
|
||||
}
|
||||
releaseObject(object);
|
||||
}
|
||||
return result;
|
||||
@@ -4336,7 +4407,7 @@
|
||||
* @type Function
|
||||
* @category Collections
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Object} properties The object of property values to filter by.
|
||||
* @param {Object} props The object of property values to filter by.
|
||||
* @returns {Array} Returns a new array of elements that have the given properties.
|
||||
* @example
|
||||
*
|
||||
@@ -4741,29 +4812,34 @@
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {...Array} [array] The arrays to inspect.
|
||||
* @returns {Array} Returns an array of composite values.
|
||||
* @returns {Array} Returns an array of shared values.
|
||||
* @example
|
||||
*
|
||||
* _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
||||
* _.intersection([1, 2, 3], [5, 2, 1, 4], [2, 1]);
|
||||
* // => [1, 2]
|
||||
*/
|
||||
function intersection(array) {
|
||||
var args = arguments,
|
||||
argsLength = args.length,
|
||||
function intersection() {
|
||||
var args = [],
|
||||
argsIndex = -1,
|
||||
argsLength = arguments.length,
|
||||
caches = getArray(),
|
||||
index = -1,
|
||||
indexOf = getIndexOf(),
|
||||
length = array ? array.length : 0,
|
||||
result = [],
|
||||
trustIndexOf = indexOf === baseIndexOf,
|
||||
seen = getArray();
|
||||
|
||||
while (++argsIndex < argsLength) {
|
||||
var value = args[argsIndex];
|
||||
caches[argsIndex] = indexOf === baseIndexOf &&
|
||||
(value ? value.length : 0) >= largeArraySize &&
|
||||
createCache(argsIndex ? args[argsIndex] : seen);
|
||||
var value = arguments[argsIndex];
|
||||
if (isArray(value) || isArguments(value)) {
|
||||
args.push(value);
|
||||
caches.push(trustIndexOf && value.length >= largeArraySize &&
|
||||
createCache(argsIndex ? args[argsIndex] : seen));
|
||||
}
|
||||
}
|
||||
var array = args[0],
|
||||
index = -1,
|
||||
length = array ? array.length : 0,
|
||||
result = [];
|
||||
|
||||
outer:
|
||||
while (++index < length) {
|
||||
var cache = caches[0];
|
||||
@@ -5180,13 +5256,13 @@
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {...Array} [array] The arrays to inspect.
|
||||
* @returns {Array} Returns an array of composite values.
|
||||
* @returns {Array} Returns an array of combined values.
|
||||
* @example
|
||||
*
|
||||
* _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
||||
* // => [1, 2, 3, 101, 10]
|
||||
* _.union([1, 2, 3], [5, 2, 1, 4], [2, 1]);
|
||||
* // => [1, 2, 3, 5, 4]
|
||||
*/
|
||||
function union(array) {
|
||||
function union() {
|
||||
return baseUniq(baseFlatten(arguments, true, true));
|
||||
}
|
||||
|
||||
@@ -5266,6 +5342,38 @@
|
||||
return baseDifference(array, slice(arguments, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array that is the smymetric difference of the provided arrays.
|
||||
* See http://en.wikipedia.org/wiki/Symmetric_difference.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {...Array} [array] The arrays to inspect.
|
||||
* @returns {Array} Returns an array of values.
|
||||
* @example
|
||||
*
|
||||
* _.xor([1, 2, 3], [5, 2, 1, 4]);
|
||||
* // => [3, 5, 4]
|
||||
*
|
||||
* _.xor([1, 2, 5], [2, 3, 5], [3, 4, 5]);
|
||||
* // => [1, 4, 5]
|
||||
*/
|
||||
function xor() {
|
||||
var index = -1,
|
||||
length = arguments.length;
|
||||
|
||||
while (++index < length) {
|
||||
var array = arguments[index];
|
||||
if (isArray(array) || isArguments(array)) {
|
||||
var result = result
|
||||
? baseUniq(baseDifference(result, array).concat(baseDifference(array, result)))
|
||||
: array;
|
||||
}
|
||||
}
|
||||
return result || [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array of grouped elements, the first of which contains the first
|
||||
* elements of the given arrays, the second of which contains the second
|
||||
@@ -5317,6 +5425,9 @@
|
||||
length = keys ? keys.length : 0,
|
||||
result = {};
|
||||
|
||||
if (!values && length && !isArray(keys[0])) {
|
||||
values = [];
|
||||
}
|
||||
while (++index < length) {
|
||||
var key = keys[index];
|
||||
if (values) {
|
||||
@@ -5409,8 +5520,8 @@
|
||||
* @example
|
||||
*
|
||||
* var view = {
|
||||
* 'label': 'docs',
|
||||
* 'onClick': function() { console.log('clicked ' + this.label); }
|
||||
* 'label': 'docs',
|
||||
* 'onClick': function() { console.log('clicked ' + this.label); }
|
||||
* };
|
||||
*
|
||||
* _.bindAll(view);
|
||||
@@ -5519,74 +5630,6 @@
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces a callback bound to an optional `thisArg`. If `func` is a property
|
||||
* name the created callback will return the property value for a given element.
|
||||
* If `func` is an object the created callback will return `true` for elements
|
||||
* that contain the equivalent object properties, otherwise it will return `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Functions
|
||||
* @param {*} [func=identity] The value to convert to a callback.
|
||||
* @param {*} [thisArg] The `this` binding of the created callback.
|
||||
* @param {number} [argCount] The number of arguments the callback accepts.
|
||||
* @returns {Function} Returns a callback function.
|
||||
* @example
|
||||
*
|
||||
* var characters = [
|
||||
* { 'name': 'barney', 'age': 36 },
|
||||
* { 'name': 'fred', 'age': 40 }
|
||||
* ];
|
||||
*
|
||||
* // wrap to create custom callback shorthands
|
||||
* _.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) {
|
||||
* var match = /^(.+?)__([gl]t)(.+)$/.exec(callback);
|
||||
* return !match ? func(callback, thisArg) : function(object) {
|
||||
* return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3];
|
||||
* };
|
||||
* });
|
||||
*
|
||||
* _.filter(characters, 'age__gt38');
|
||||
* // => [{ 'name': 'fred', 'age': 40 }]
|
||||
*/
|
||||
function createCallback(func, thisArg, argCount) {
|
||||
var type = typeof func;
|
||||
if (func == null || type == 'function') {
|
||||
return baseCreateCallback(func, thisArg, argCount);
|
||||
}
|
||||
// handle "_.pluck" style callback shorthands
|
||||
if (type != 'object') {
|
||||
return function(object) {
|
||||
return object[func];
|
||||
};
|
||||
}
|
||||
var props = keys(func),
|
||||
key = props[0],
|
||||
a = func[key];
|
||||
|
||||
// handle "_.where" style callback shorthands
|
||||
if (props.length == 1 && a === a && !isObject(a)) {
|
||||
// fast path the common case of providing an object with a single
|
||||
// property containing a primitive value
|
||||
return function(object) {
|
||||
var b = object[key];
|
||||
return a === b && (a !== 0 || (1 / a == 1 / b));
|
||||
};
|
||||
}
|
||||
return function(object) {
|
||||
var length = props.length,
|
||||
result = false;
|
||||
|
||||
while (length--) {
|
||||
if (!(result = baseIsEqual(object[props[length]], func[props[length]], null, true))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function which accepts one or more arguments of `func` that when
|
||||
* invoked either executes `func` returning its result, if all `func` arguments
|
||||
@@ -5772,8 +5815,8 @@
|
||||
* @returns {number} Returns the timer id.
|
||||
* @example
|
||||
*
|
||||
* _.defer(function() { console.log('deferred'); });
|
||||
* // returns from the function before 'deferred' is logged
|
||||
* _.defer(function(text) { console.log(text); }, 'deferred');
|
||||
* // logs 'deferred' after one or more milliseconds
|
||||
*/
|
||||
function defer(func) {
|
||||
if (!isFunction(func)) {
|
||||
@@ -5782,15 +5825,6 @@
|
||||
var args = slice(arguments, 1);
|
||||
return setTimeout(function() { func.apply(undefined, args); }, 1);
|
||||
}
|
||||
// use `setImmediate` if available in Node.js
|
||||
if (setImmediate) {
|
||||
defer = function(func) {
|
||||
if (!isFunction(func)) {
|
||||
throw new TypeError;
|
||||
}
|
||||
return setImmediate.apply(context, arguments);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes the `func` function after `wait` milliseconds. Additional arguments
|
||||
@@ -5805,9 +5839,8 @@
|
||||
* @returns {number} Returns the timer id.
|
||||
* @example
|
||||
*
|
||||
* var log = _.bind(console.log, console);
|
||||
* _.delay(log, 1000, 'logged later');
|
||||
* // => 'logged later' (Appears after one second.)
|
||||
* _.delay(function(text) { console.log(text); }, 1000, 'later');
|
||||
* // => logs 'later' after one second
|
||||
*/
|
||||
function delay(func, wait) {
|
||||
if (!isFunction(func)) {
|
||||
@@ -6038,6 +6071,93 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a function that returns `value`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {*} value The value to return from the new function.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* var object = { 'name': 'fred' };
|
||||
* var getter = _.constant(object);
|
||||
* getter() === object;
|
||||
* // => true
|
||||
*/
|
||||
function constant(value) {
|
||||
return function() {
|
||||
return value;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces a callback bound to an optional `thisArg`. If `func` is a property
|
||||
* name the created callback will return the property value for a given element.
|
||||
* If `func` is an object the created callback will return `true` for elements
|
||||
* that contain the equivalent object properties, otherwise it will return `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {*} [func=identity] The value to convert to a callback.
|
||||
* @param {*} [thisArg] The `this` binding of the created callback.
|
||||
* @param {number} [argCount] The number of arguments the callback accepts.
|
||||
* @returns {Function} Returns a callback function.
|
||||
* @example
|
||||
*
|
||||
* var characters = [
|
||||
* { 'name': 'barney', 'age': 36 },
|
||||
* { 'name': 'fred', 'age': 40 }
|
||||
* ];
|
||||
*
|
||||
* // wrap to create custom callback shorthands
|
||||
* _.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) {
|
||||
* var match = /^(.+?)__([gl]t)(.+)$/.exec(callback);
|
||||
* return !match ? func(callback, thisArg) : function(object) {
|
||||
* return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3];
|
||||
* };
|
||||
* });
|
||||
*
|
||||
* _.filter(characters, 'age__gt38');
|
||||
* // => [{ 'name': 'fred', 'age': 40 }]
|
||||
*/
|
||||
function createCallback(func, thisArg, argCount) {
|
||||
var type = typeof func;
|
||||
if (func == null || type == 'function') {
|
||||
return baseCreateCallback(func, thisArg, argCount);
|
||||
}
|
||||
// handle "_.pluck" style callback shorthands
|
||||
if (type != 'object') {
|
||||
return property(func);
|
||||
}
|
||||
var props = keys(func),
|
||||
key = props[0],
|
||||
a = func[key];
|
||||
|
||||
// handle "_.where" style callback shorthands
|
||||
if (props.length == 1 && a === a && !isObject(a)) {
|
||||
// fast path the common case of providing an object with a single
|
||||
// property containing a primitive value
|
||||
return function(object) {
|
||||
var b = object[key];
|
||||
return a === b && (a !== 0 || (1 / a == 1 / b));
|
||||
};
|
||||
}
|
||||
return function(object) {
|
||||
var length = props.length,
|
||||
result = false;
|
||||
|
||||
while (length--) {
|
||||
if (!(result = baseIsEqual(object[props[length]], func[props[length]], null, true))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their
|
||||
* corresponding HTML entities.
|
||||
@@ -6075,51 +6195,71 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds function properties of a source object to the `lodash` function and
|
||||
* chainable wrapper.
|
||||
* Adds function properties of a source object to the destination object.
|
||||
* If `object` is a function methods will be added to its prototype as well.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {Object} object The object of function properties to add to `lodash`.
|
||||
* @param {Object} object The object of function properties to add to `lodash`.
|
||||
* @param {Function|Object} [object=lodash] object The destination object.
|
||||
* @param {Object} source The object of functions to add.
|
||||
* @param {Object} [options] The options object.
|
||||
* @param {boolean} [options.chain=true] Specify whether the functions added are chainable.
|
||||
* @example
|
||||
*
|
||||
* _.mixin({
|
||||
* 'capitalize': function(string) {
|
||||
* return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
|
||||
* }
|
||||
* });
|
||||
* function capitalize(string) {
|
||||
* return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
|
||||
* }
|
||||
*
|
||||
* _.mixin({ 'capitalize': capitalize });
|
||||
* _.capitalize('fred');
|
||||
* // => 'Fred'
|
||||
*
|
||||
* _('fred').capitalize().value();
|
||||
* // => 'Fred'
|
||||
*
|
||||
* _.mixin({ 'capitalize': capitalize }, { 'chain': false });
|
||||
* _('fred').capitalize();
|
||||
* // => 'Fred'
|
||||
*/
|
||||
function mixin(object, source) {
|
||||
var ctor = object,
|
||||
isFunc = !source || isFunction(ctor);
|
||||
function mixin(object, source, options) {
|
||||
var chain = true,
|
||||
methodNames = source && functions(source);
|
||||
|
||||
if (!source) {
|
||||
if (!source || (!options && !methodNames.length)) {
|
||||
if (options == null) {
|
||||
options = source;
|
||||
}
|
||||
ctor = lodashWrapper;
|
||||
source = object;
|
||||
object = lodash;
|
||||
methodNames = functions(source);
|
||||
}
|
||||
forEach(functions(source), function(methodName) {
|
||||
if (options === false) {
|
||||
chain = false;
|
||||
} else if (isObject(options) && 'chain' in options) {
|
||||
chain = options.chain;
|
||||
}
|
||||
var ctor = object,
|
||||
isFunc = isFunction(ctor);
|
||||
|
||||
forEach(methodNames, function(methodName) {
|
||||
var func = object[methodName] = source[methodName];
|
||||
if (isFunc) {
|
||||
ctor.prototype[methodName] = function() {
|
||||
var value = this.__wrapped__,
|
||||
var chainAll = this.__chain__,
|
||||
value = this.__wrapped__,
|
||||
args = [value];
|
||||
|
||||
push.apply(args, arguments);
|
||||
var result = func.apply(object, args);
|
||||
if (value && typeof value == 'object' && value === result) {
|
||||
return this;
|
||||
if (chain || chainAll) {
|
||||
if (value === result && isObject(result)) {
|
||||
return this;
|
||||
}
|
||||
result = new ctor(result);
|
||||
result.__chain__ = chainAll;
|
||||
}
|
||||
result = new ctor(result);
|
||||
result.__chain__ = this.__chain__;
|
||||
return result;
|
||||
};
|
||||
}
|
||||
@@ -6159,6 +6299,23 @@
|
||||
// no operation performed
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the number of milliseconds that have elapsed since the Unix epoch
|
||||
* (1 January 1970 00:00:00 UTC).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @example
|
||||
*
|
||||
* var stamp = _.now();
|
||||
* _.defer(function() { console.log(_.now() - stamp); });
|
||||
* // => logs the number of milliseconds it took for the deferred function to be called
|
||||
*/
|
||||
var now = reNative.test(now = Date.now) && now || function() {
|
||||
return new Date().getTime();
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts the given value into an integer of the specified radix.
|
||||
* If `radix` is `undefined` or `0` a `radix` of `10` is used unless the
|
||||
@@ -6183,6 +6340,36 @@
|
||||
return nativeParseInt(isString(value) ? value.replace(reLeadingSpacesAndZeros, '') : value, radix || 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a "_.pluck" style function, which returns the `key` value of a
|
||||
* given object.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {string} key The name of the property to retrieve.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* var characters = [
|
||||
* { 'name': 'fred', 'age': 40 },
|
||||
* { 'name': 'barney', 'age': 36 }
|
||||
* ];
|
||||
*
|
||||
* var getName = _.property('name');
|
||||
*
|
||||
* _.map(characters, getName);
|
||||
* // => ['barney', 'fred']
|
||||
*
|
||||
* _.sortBy(characters, getName);
|
||||
* // => [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }]
|
||||
*/
|
||||
function property(key) {
|
||||
return function(object) {
|
||||
return object[key];
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces a random number between `min` and `max` (inclusive). If only one
|
||||
* argument is provided a number between `0` and the given number will be
|
||||
@@ -6242,7 +6429,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the value of `property` on `object`. If `property` is a function
|
||||
* Resolves the value of property `key` on `object`. If `key` is a function
|
||||
* it will be invoked with the `this` binding of `object` and its result returned,
|
||||
* else the property value is returned. If `object` is falsey then `undefined`
|
||||
* is returned.
|
||||
@@ -6251,7 +6438,7 @@
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {Object} object The object to inspect.
|
||||
* @param {string} property The property to get the value of.
|
||||
* @param {string} key The name of the property to resolve.
|
||||
* @returns {*} Returns the resolved value.
|
||||
* @example
|
||||
*
|
||||
@@ -6268,10 +6455,10 @@
|
||||
* _.result(object, 'stuff');
|
||||
* // => 'nonsense'
|
||||
*/
|
||||
function result(object, property) {
|
||||
function result(object, key) {
|
||||
if (object) {
|
||||
var value = object[property];
|
||||
return isFunction(value) ? object[property]() : value;
|
||||
var value = object[key];
|
||||
return isFunction(value) ? object[key]() : value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6335,8 +6522,8 @@
|
||||
* // => 'hello mustache!'
|
||||
*
|
||||
* // using the `imports` option to import jQuery
|
||||
* var list = '<% $.each(people, function(name) { %><li><%- name %></li><% }); %>';
|
||||
* _.template(list, { 'people': ['fred', 'barney'] }, { 'imports': { '$': jQuery } });
|
||||
* var list = '<% jq.each(people, function(name) { %><li><%- name %></li><% }); %>';
|
||||
* _.template(list, { 'people': ['fred', 'barney'] }, { 'imports': { 'jq': jQuery } });
|
||||
* // => '<li>fred</li><li>barney</li>'
|
||||
*
|
||||
* // using the `sourceURL` option to specify a custom sourceURL for the template
|
||||
@@ -6615,7 +6802,7 @@
|
||||
* _(characters).chain()
|
||||
* .first()
|
||||
* .pick('age')
|
||||
* .value()
|
||||
* .value();
|
||||
* // => { 'age': 36 }
|
||||
*/
|
||||
function wrapperChain() {
|
||||
@@ -6668,6 +6855,7 @@
|
||||
lodash.chain = chain;
|
||||
lodash.compact = compact;
|
||||
lodash.compose = compose;
|
||||
lodash.constant = constant;
|
||||
lodash.countBy = countBy;
|
||||
lodash.create = create;
|
||||
lodash.createCallback = createCallback;
|
||||
@@ -6694,6 +6882,7 @@
|
||||
lodash.invoke = invoke;
|
||||
lodash.keys = keys;
|
||||
lodash.map = map;
|
||||
lodash.mapValues = mapValues;
|
||||
lodash.max = max;
|
||||
lodash.memoize = memoize;
|
||||
lodash.merge = merge;
|
||||
@@ -6705,6 +6894,7 @@
|
||||
lodash.partialRight = partialRight;
|
||||
lodash.pick = pick;
|
||||
lodash.pluck = pluck;
|
||||
lodash.property = property;
|
||||
lodash.pull = pull;
|
||||
lodash.range = range;
|
||||
lodash.reject = reject;
|
||||
@@ -6723,6 +6913,7 @@
|
||||
lodash.where = where;
|
||||
lodash.without = without;
|
||||
lodash.wrap = wrap;
|
||||
lodash.xor = xor;
|
||||
lodash.zip = zip;
|
||||
lodash.zipObject = zipObject;
|
||||
|
||||
@@ -6780,6 +6971,7 @@
|
||||
lodash.mixin = mixin;
|
||||
lodash.noConflict = noConflict;
|
||||
lodash.noop = noop;
|
||||
lodash.now = now;
|
||||
lodash.parseInt = parseInt;
|
||||
lodash.random = random;
|
||||
lodash.reduce = reduce;
|
||||
@@ -6803,20 +6995,15 @@
|
||||
lodash.include = contains;
|
||||
lodash.inject = reduce;
|
||||
|
||||
forOwn(lodash, function(func, methodName) {
|
||||
if (!lodash.prototype[methodName]) {
|
||||
lodash.prototype[methodName] = function() {
|
||||
var args = [this.__wrapped__],
|
||||
chainAll = this.__chain__;
|
||||
|
||||
push.apply(args, arguments);
|
||||
var result = func.apply(lodash, args);
|
||||
return chainAll
|
||||
? new lodashWrapper(result, chainAll)
|
||||
: result;
|
||||
};
|
||||
}
|
||||
});
|
||||
mixin(function() {
|
||||
var source = {}
|
||||
forOwn(lodash, function(func, methodName) {
|
||||
if (!lodash.prototype[methodName]) {
|
||||
source[methodName] = func;
|
||||
}
|
||||
});
|
||||
return source;
|
||||
}(), false);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
@@ -6852,7 +7039,7 @@
|
||||
* @memberOf _
|
||||
* @type string
|
||||
*/
|
||||
lodash.VERSION = '2.3.0';
|
||||
lodash.VERSION = '2.4.0';
|
||||
|
||||
// add "Chaining" functions to the wrapper
|
||||
lodash.prototype.chain = wrapperChain;
|
||||
@@ -6873,7 +7060,7 @@
|
||||
};
|
||||
});
|
||||
|
||||
// add `Array` functions that return the wrapped value
|
||||
// add `Array` functions that return the existing wrapped value
|
||||
baseEach(['push', 'reverse', 'sort', 'unshift'], function(methodName) {
|
||||
var func = arrayRef[methodName];
|
||||
lodash.prototype[methodName] = function() {
|
||||
@@ -6923,9 +7110,8 @@
|
||||
// some AMD build optimizers like r.js check for condition patterns like the following:
|
||||
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
|
||||
// Expose Lo-Dash to the global object even when an AMD loader is present in
|
||||
// case Lo-Dash was injected by a third-party script and not intended to be
|
||||
// loaded as a module. The global assignment can be reverted in the Lo-Dash
|
||||
// module by its `noConflict()` method.
|
||||
// case Lo-Dash is loaded with a RequireJS shim config.
|
||||
// See http://requirejs.org/docs/api.html#config-shim
|
||||
root._ = _;
|
||||
|
||||
// define as an anonymous module so, through path mapping, it can be
|
||||
|
||||
106
dist/lodash.compat.min.js
vendored
106
dist/lodash.compat.min.js
vendored
@@ -1,58 +1,60 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 2.3.0 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
|
||||
* Lo-Dash 2.4.0 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
|
||||
* Build: `lodash -o ./dist/lodash.compat.js`
|
||||
*/
|
||||
;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function t(t,e){var r=typeof e;if(t=t.l,"boolean"==r||null==e)return t[e]?0:-1;"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:b+e;return t=(t=t[r])&&t[u],"object"==r?t&&-1<n(t,e)?0:-1:t?0:-1}function e(n){var t=this.l,e=typeof n;if("boolean"==e||null==n)t[n]=true;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:b+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=true
|
||||
}}function r(n){return n.charCodeAt(0)}function u(n,t){var e=n.m,r=t.m;if(e!==r){if(e>r||typeof e=="undefined")return 1;if(e<r||typeof r=="undefined")return-1}return n.n-t.n}function o(n){var t=-1,r=n.length,u=n[0],o=n[r/2|0],a=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&a&&typeof a=="object")return false;for(u=l(),u["false"]=u["null"]=u["true"]=u.undefined=false,o=l(),o.k=n,o.l=u,o.push=e;++t<r;)o.push(n[t]);return o}function a(n){return"\\"+Y[n]}function i(){return v.pop()||[]}function l(){return y.pop()||{k:null,l:null,m:null,"false":false,n:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,o:null}
|
||||
}function f(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function c(n){n.length=0,v.length<w&&v.push(n)}function p(n){var t=n.l;t&&p(t),n.k=n.l=n.m=n.object=n.number=n.string=n.o=null,y.length<w&&y.push(n)}function s(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function g(e){function v(n){return n&&typeof n=="object"&&!We(n)&&je.call(n,"__wrapped__")?n:new y(n)}function y(n,t){this.__chain__=!!t,this.__wrapped__=n
|
||||
}function w(n){function t(){if(r){var n=r.slice();Ce.apply(n,arguments)}if(this instanceof t){var o=nt(e.prototype),n=e.apply(o,n||arguments);return Ct(n)?n:o}return e.apply(u,n||arguments)}var e=n[0],r=n[2],u=n[4];return Ke(t,n),t}function Y(n,t,e,r,u){if(e){var o=e(n);if(typeof o!="undefined")return o}if(!Ct(n))return n;var a=ve.call(n);if(!H[a]||!qe.nodeClass&&f(n))return n;var l=Te[a];switch(a){case T:case z:return new l(+n);case W:case M:return new l(n);case J:return o=l(n.source,S.exec(n)),o.lastIndex=n.lastIndex,o
|
||||
}if(a=We(n),t){var p=!r;r||(r=i()),u||(u=i());for(var g=r.length;g--;)if(r[g]==n)return u[g];o=a?l(n.length):{}}else o=a?s(n):nr({},n);return a&&(je.call(n,"index")&&(o.index=n.index),je.call(n,"input")&&(o.input=n.input)),t?(r.push(n),u.push(o),(a?Ze:rr)(n,function(n,a){o[a]=Y(n,t,e,r,u)}),p&&(c(r),c(u)),o):o}function nt(n){return Ct(n)?Ae(n):{}}function tt(n,t,e){if(typeof n!="function")return Qt;if(typeof t=="undefined"||!("prototype"in n))return n;var r=n.__bindData__;if(typeof r=="undefined"&&(qe.funcNames&&(r=!n.name),r=r||!qe.funcDecomp,!r)){var u=_e.call(n);
|
||||
qe.funcNames||(r=!I.test(u)),r||(r=B.test(u),Ke(n,r))}if(false===r||true!==r&&1&r[1])return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,o){return n.call(t,e,r,u,o)}}return Ht(n,t)}function ot(n){function t(){var n=l?a:this;if(u){var h=u.slice();Ce.apply(h,arguments)}return(o||c)&&(h||(h=s(arguments)),o&&Ce.apply(h,o),c&&h.length<i)?(r|=16,ot([e,p?r:-4&r,h,null,a,i])):(h||(h=arguments),f&&(e=n[g]),this instanceof t?(n=nt(e.prototype),h=e.apply(n,h),Ct(h)?h:n):e.apply(n,h))
|
||||
}var e=n[0],r=n[1],u=n[2],o=n[3],a=n[4],i=n[5],l=1&r,f=2&r,c=4&r,p=8&r,g=e;return Ke(t,n),t}function at(e,r){var u=-1,a=yt(),i=e?e.length:0,l=i>=_&&a===n,f=[];if(l){var c=o(r);c?(a=t,r=c):l=false}for(;++u<i;)c=e[u],0>a(r,c)&&f.push(c);return l&&p(r),f}function it(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r<u;){var a=n[r];if(a&&typeof a=="object"&&typeof a.length=="number"&&(We(a)||bt(a))){t||(a=it(a,t,e));var i=-1,l=a.length,f=o.length;for(o.length+=l;++i<l;)o[f++]=a[i]}else e||o.push(a)}return o
|
||||
}function lt(n,t,e,r,u,o){if(e){var a=e(n,t);if(typeof a!="undefined")return!!a}if(n===t)return 0!==n||1/n==1/t;if(n===n&&!(n&&X[typeof n]||t&&X[typeof t]))return false;if(null==n||null==t)return n===t;var l=ve.call(n),p=ve.call(t);if(l==$&&(l=G),p==$&&(p=G),l!=p)return false;switch(l){case T:case z:return+n==+t;case W:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case J:case M:return n==le(t)}if(p=l==L,!p){var s=je.call(n,"__wrapped__"),g=je.call(t,"__wrapped__");if(s||g)return lt(s?n.__wrapped__:n,g?t.__wrapped__:t,e,r,u,o);
|
||||
if(l!=G||!qe.nodeClass&&(f(n)||f(t)))return false;if(l=!qe.argsObject&&bt(n)?ae:n.constructor,s=!qe.argsObject&&bt(t)?ae:t.constructor,l!=s&&!(xt(l)&&l instanceof l&&xt(s)&&s instanceof s)&&"constructor"in n&&"constructor"in t)return false}for(s=!u,u||(u=i()),o||(o=i()),l=u.length;l--;)if(u[l]==n)return o[l]==t;var h=0,a=true;if(u.push(n),o.push(t),p){if(l=n.length,h=t.length,a=h==n.length,!a&&!r)return a;for(;h--;)if(p=l,s=t[h],r)for(;p--&&!(a=lt(n[p],s,e,r,u,o)););else if(!(a=lt(n[h],s,e,r,u,o)))break;return a
|
||||
}return er(t,function(t,i,l){return je.call(l,i)?(h++,a=je.call(n,i)&<(n[i],t,e,r,u,o)):void 0}),a&&!r&&er(n,function(n,t,e){return je.call(e,t)?a=-1<--h:void 0}),s&&(c(u),c(o)),a}function ft(n,t,e,r,u){(We(t)?Nt:rr)(t,function(t,o){var a,i,l=t,f=n[o];if(t&&((i=We(t))||ur(t))){for(l=r.length;l--;)if(a=r[l]==t){f=u[l];break}if(!a){var c;e&&(l=e(f,t),c=typeof l!="undefined")&&(f=l),c||(f=i?We(f)?f:[]:ur(f)?f:{}),r.push(t),u.push(f),c||ft(f,t,e,r,u)}}else e&&(l=e(f,t),typeof l=="undefined"&&(l=t)),typeof l!="undefined"&&(f=l);
|
||||
n[o]=f})}function ct(n,t){return n+be(Le()*(t-n+1))}function pt(e,r,u){var a=-1,l=yt(),f=e?e.length:0,s=[],g=!r&&f>=_&&l===n,h=u||g?i():s;if(g){var v=o(h);v?(l=t,h=v):(g=false,h=u?h:(c(h),s))}for(;++a<f;){var v=e[a],y=u?u(v,a,e):v;(r?!a||h[h.length-1]!==y:0>l(h,y))&&((u||g)&&h.push(y),s.push(v))}return g?(c(h.k),p(h)):u&&c(h),s}function st(n){return function(t,e,r){var u={};if(e=v.createCallback(e,r,3),We(t)){r=-1;for(var o=t.length;++r<o;){var a=t[r];n(u,a,e(a,r,t),t)}}else Ze(t,function(t,r,o){n(u,t,e(t,r,o),o)
|
||||
});return u}}function gt(n,t,e,r,u,o){var a=1&t,i=4&t,l=16&t,f=32&t;if(!(2&t||xt(n)))throw new fe;l&&!e.length&&(t&=-17,l=e=false),f&&!r.length&&(t&=-33,f=r=false);var c=n&&n.__bindData__;return c&&true!==c?(c=c.slice(),!a||1&c[1]||(c[4]=u),!a&&1&c[1]&&(t|=8),!i||4&c[1]||(c[5]=o),l&&Ce.apply(c[2]||(c[2]=[]),e),f&&Ce.apply(c[3]||(c[3]=[]),r),c[1]|=t,gt.apply(null,c)):(1==t||17===t?w:ot)([n,t,e,r,u,o])}function ht(){Q.h=F,Q.b=Q.c=Q.g=Q.i="",Q.e="t",Q.j=true;for(var n,t=0;n=arguments[t];t++)for(var e in n)Q[e]=n[e];
|
||||
t=Q.a,Q.d=/^[^,]+/.exec(t)[0],n=re,t="return function("+t+"){",e=Q;var r="var n,t="+e.d+",E="+e.e+";if(!t)return E;"+e.i+";";e.b?(r+="var u=t.length;n=-1;if("+e.b+"){",qe.unindexedChars&&(r+="if(s(t)){t=t.split('')}"),r+="while(++n<u){"+e.g+";}}else{"):qe.nonEnumArgs&&(r+="var u=t.length;n=-1;if(u&&p(t)){while(++n<u){n+='';"+e.g+";}}else{"),qe.enumPrototypes&&(r+="var G=typeof t=='function';"),qe.enumErrorProps&&(r+="var F=t===k||t instanceof Error;");var u=[];if(qe.enumPrototypes&&u.push('!(G&&n=="prototype")'),qe.enumErrorProps&&u.push('!(F&&(n=="message"||n=="name"))'),e.j&&e.f)r+="var C=-1,D=B[typeof t]&&v(t),u=D?D.length:0;while(++C<u){n=D[C];",u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}";
|
||||
else if(r+="for(n in t){",e.j&&u.push("m.call(t, n)"),u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}",qe.nonEnumShadows){for(r+="if(t!==A){var i=t.constructor,r=t===(i&&i.prototype),f=t===J?I:t===k?j:L.call(t),x=y[f];",k=0;7>k;k++)r+="n='"+e.h[k]+"';if((!(r&&x[n])&&m.call(t,n))",e.j||(r+="||(!x[n]&&t[n]!==A[n])"),r+="){"+e.g+"}";r+="}"}return(e.b||qe.nonEnumArgs)&&(r+="}"),r+=e.c+";return E",n("d,j,k,m,o,p,q,s,v,A,B,y,I,J,L",t+r+"}")(tt,q,pe,je,d,bt,We,Et,Q.f,se,X,ze,M,ge,ve)
|
||||
}function vt(n){return Ve[n]}function yt(){var t=(t=v.indexOf)===qt?n:t;return t}function mt(n){var t,e;return!n||ve.call(n)!=G||(t=n.constructor,xt(t)&&!(t instanceof t))||!qe.argsClass&&bt(n)||!qe.nodeClass&&f(n)?false:qe.ownLast?(er(n,function(n,t,r){return e=je.call(r,t),false}),false!==e):(er(n,function(n,t){e=t}),typeof e=="undefined"||je.call(n,e))}function dt(n){return Qe[n]}function bt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ve.call(n)==$||false}function _t(n,t,e){var r=Je(n),u=r.length;
|
||||
for(t=tt(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function wt(n){var t=[];return er(n,function(n,e){xt(n)&&t.push(e)}),t.sort()}function jt(n){for(var t=-1,e=Je(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function xt(n){return typeof n=="function"}function Ct(n){return!(!n||!X[typeof n])}function kt(n){return typeof n=="number"||n&&typeof n=="object"&&ve.call(n)==W||false}function Et(n){return typeof n=="string"||n&&typeof n=="object"&&ve.call(n)==M||false}function Ot(n){for(var t=-1,e=Je(n),r=e.length,u=ne(r);++t<r;)u[t]=n[e[t]];
|
||||
return u}function St(n,t,e){var r=-1,u=yt(),o=n?n.length:0,a=false;return e=(0>e?Re(0,o+e):e)||0,We(n)?a=-1<u(n,t,e):typeof o=="number"?a=-1<(Et(n)?n.indexOf(t,e):u(n,t,e)):Ze(n,function(n){return++r<e?void 0:!(a=n===t)}),a}function It(n,t,e){var r=true;if(t=v.createCallback(t,e,3),We(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else Ze(n,function(n,e,u){return r=!!t(n,e,u)});return r}function At(n,t,e){var r=[];if(t=v.createCallback(t,e,3),We(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];
|
||||
t(o,e,n)&&r.push(o)}}else Ze(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function Dt(n,t,e){if(t=v.createCallback(t,e,3),!We(n)){var r;return Ze(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e];if(t(o,e,n))return o}}function Nt(n,t,e){if(t&&typeof e=="undefined"&&We(n)){e=-1;for(var r=n.length;++e<r&&false!==t(n[e],e,n););}else Ze(n,t,e);return n}function Bt(n,t,e){var r=n,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:tt(t,e,3),We(n))for(;u--&&false!==t(n[u],u,n););else{if(typeof u!="number")var o=Je(n),u=o.length;
|
||||
else qe.unindexedChars&&Et(n)&&(r=n.split(""));Ze(n,function(n,e,a){return e=o?o[--u]:--u,t(r[e],e,a)})}return n}function Pt(n,t,e){var r=-1,u=n?n.length:0,o=ne(typeof u=="number"?u:0);if(t=v.createCallback(t,e,3),We(n))for(;++r<u;)o[r]=t(n[r],r,n);else Ze(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function Rt(n,t,e){var u=-1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&We(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i>o&&(o=i)}}else t=null==t&&Et(n)?r:v.createCallback(t,e,3),Ze(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)
|
||||
});return o}function Ft(n,t,e,r){var u=3>arguments.length;if(t=v.createCallback(t,r,4),We(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++o<a;)e=t(e,n[o],o,n)}else Ze(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)});return e}function $t(n,t,e,r){var u=3>arguments.length;return t=v.createCallback(t,r,4),Bt(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function Lt(n){var t=-1,e=n?n.length:0,r=ne(typeof e=="number"?e:0);return Nt(n,function(n){var e=ct(0,++t);r[t]=r[e],r[e]=n}),r}function Tt(n,t,e){var r;if(t=v.createCallback(t,e,3),We(n)){e=-1;
|
||||
for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else Ze(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function zt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=v.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[0]:h;return s(n,0,Fe(Re(0,r),u))}function qt(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?Re(0,u+r):r||0}else if(r)return r=Wt(t,e),t[r]===e?r:-1;return n(t,e,r)}function Kt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;
|
||||
for(t=v.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Re(0,t);return s(n,r)}function Wt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?v.createCallback(e,r,1):Qt,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function Gt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(e=v.createCallback(e,r,3)),pt(n,t,e)}function Jt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?Rt(lr(n,"length")):0,r=ne(0>e?0:e);++t<e;)r[t]=lr(n,t);
|
||||
return r}function Mt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function Ht(n,t){return 2<arguments.length?gt(n,17,s(arguments,2),null,t):gt(n,1,null,null,t)}function Ut(n,t,e){var r,u,o,a,i,l,f,c=0,p=false,s=true;if(!xt(n))throw new fe;if(t=Re(0,t)||0,true===e)var g=true,s=false;else Ct(e)&&(g=e.leading,p="maxWait"in e&&(Re(t,e.maxWait)||0),s="trailing"in e?e.trailing:s);var v=function(){var e=t-(xe()-a);0<e?l=Ee(v,e):(u&&de(u),e=f,u=l=f=h,e&&(c=xe(),o=n.apply(i,r),l||u||(r=i=null)))
|
||||
},y=function(){l&&de(l),u=l=f=h,(s||p!==t)&&(c=xe(),o=n.apply(i,r),l||u||(r=i=null))};return function(){if(r=arguments,a=xe(),i=this,f=s&&(l||!g),false===p)var e=g&&!l;else{u||g||(c=a);var h=p-(a-c),m=0>=h;m?(u&&(u=de(u)),c=a,o=n.apply(i,r)):u||(u=Ee(y,h))}return m&&l?l=de(l):l||t===p||(l=Ee(v,t)),e&&(m=true,o=n.apply(i,r)),!m||l||u||(r=i=null),o}}function Vt(n){if(!xt(n))throw new fe;var t=s(arguments,1);return Ee(function(){n.apply(h,t)},1)}function Qt(n){return n}function Xt(n,t){var e=n,r=!t||xt(e);
|
||||
t||(e=y,t=n,n=v),Nt(wt(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return Ce.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:(r=new e(r),r.__chain__=this.__chain__,r)})})}function Yt(){}function Zt(){return this.__wrapped__}e=e?ut.defaults(Z.Object(),e,ut.pick(Z,R)):Z;var ne=e.Array,te=e.Boolean,ee=e.Date,re=e.Function,ue=e.Math,oe=e.Number,ae=e.Object,ie=e.RegExp,le=e.String,fe=e.TypeError,ce=[],pe=e.Error.prototype,se=ae.prototype,ge=le.prototype,he=e._,ve=se.toString,ye=ie("^"+le(ve).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),me=ue.ceil,de=e.clearTimeout,be=ue.floor,_e=re.prototype.toString,we=ye.test(we=ae.getPrototypeOf)&&we,je=se.hasOwnProperty,xe=ye.test(xe=ee.now)&&xe||function(){return+new ee
|
||||
},Ce=ce.push,ke=se.propertyIsEnumerable,Ee=e.setTimeout,Oe=ce.splice,Se=typeof(Se=rt&&et&&rt.setImmediate)=="function"&&!ye.test(Se)&&Se,Ie=function(){try{var n={},t=ye.test(t=ae.defineProperty)&&t,e=t(n,n,n)&&t}catch(r){}return e}(),Ae=ye.test(Ae=ae.create)&&Ae,De=ye.test(De=ne.isArray)&&De,Ne=e.isFinite,Be=e.isNaN,Pe=ye.test(Pe=ae.keys)&&Pe,Re=ue.max,Fe=ue.min,$e=e.parseInt,Le=ue.random,Te={};Te[L]=ne,Te[T]=te,Te[z]=ee,Te[K]=re,Te[G]=ae,Te[W]=oe,Te[J]=ie,Te[M]=le;var ze={};ze[L]=ze[z]=ze[W]={constructor:true,toLocaleString:true,toString:true,valueOf:true},ze[T]=ze[M]={constructor:true,toString:true,valueOf:true},ze[q]=ze[K]=ze[J]={constructor:true,toString:true},ze[G]={constructor:true},function(){for(var n=F.length;n--;){var t,e=F[n];
|
||||
for(t in ze)je.call(ze,t)&&!je.call(ze[t],e)&&(ze[t][e]=false)}}(),y.prototype=v.prototype;var qe=v.support={};!function(){var n=function(){this.x=1},t={0:1,length:1},r=[];n.prototype={valueOf:1,y:1};for(var u in new n)r.push(u);for(u in arguments);qe.argsClass=ve.call(arguments)==$,qe.argsObject=arguments.constructor==ae&&!(arguments instanceof ne),qe.enumErrorProps=ke.call(pe,"message")||ke.call(pe,"name"),qe.enumPrototypes=ke.call(n,"prototype"),qe.funcDecomp=!ye.test(e.WinRTError)&&B.test(g),qe.funcNames=typeof re.name=="string",qe.nonEnumArgs=0!=u,qe.nonEnumShadows=!/valueOf/.test(r),qe.ownLast="x"!=r[0],qe.spliceObjects=(ce.splice.call(t,0,1),!t[0]),qe.unindexedChars="xx"!="x"[0]+ae("x")[0];
|
||||
try{qe.nodeClass=!(ve.call(document)==G&&!({toString:0}+""))}catch(o){qe.nodeClass=true}}(1),v.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:A,variable:"",imports:{_:v}},Ae||(nt=function(){function n(){}return function(t){if(Ct(t)){n.prototype=t;var r=new n;n.prototype=null}return r||e.Object()}}());var Ke=Ie?function(n,t){V.value=t,Ie(n,"__bindData__",V)}:Yt;qe.argsClass||(bt=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&je.call(n,"callee")&&!ke.call(n,"callee")||false
|
||||
});var We=De||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ve.call(n)==L||false},Ge=ht({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),Je=Pe?function(n){return Ct(n)?qe.enumPrototypes&&typeof n=="function"||qe.nonEnumArgs&&n.length&&bt(n)?Ge(n):Pe(n):[]}:Ge,Me={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:Je,g:"if(e(t[n],n,g)===false)return E"},He={a:"z,H,l",i:"var a=arguments,b=0,c=typeof l=='number'?2:a.length;while(++b<c){t=a[b];if(t&&B[typeof t]){",v:Je,g:"if(typeof E[n]=='undefined')E[n]=t[n]",c:"}}"},Ue={i:"if(!B[typeof t])return E;"+Me.i,b:false},Ve={"&":"&","<":"<",">":">",'"':""","'":"'"},Qe=jt(Ve),Xe=ie("("+Je(Qe).join("|")+")","g"),Ye=ie("["+Je(Ve).join("")+"]","g"),Ze=ht(Me),nr=ht(He,{i:He.i.replace(";",";if(c>3&&typeof a[c-2]=='function'){var e=d(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){e=a[--c]}"),g:"E[n]=e?e(E[n],t[n]):t[n]"}),tr=ht(He),er=ht(Me,Ue,{j:false}),rr=ht(Me,Ue);
|
||||
xt(/x/)&&(xt=function(n){return typeof n=="function"&&ve.call(n)==K});var ur=we?function(n){if(!n||ve.call(n)!=G||!qe.argsClass&&bt(n))return false;var t=n.valueOf,e=typeof t=="function"&&(e=we(t))&&we(e);return e?n==e||we(n)==e:mt(n)}:mt,or=st(function(n,t,e){je.call(n,e)?n[e]++:n[e]=1}),ar=st(function(n,t,e){(je.call(n,e)?n[e]:n[e]=[]).push(t)}),ir=st(function(n,t,e){n[e]=t}),lr=Pt;Se&&(Vt=function(n){if(!xt(n))throw new fe;return Se.apply(e,arguments)});var fr=8==$e(j+"08")?$e:function(n,t){return $e(Et(n)?n.replace(D,""):n,t||0)
|
||||
};return v.after=function(n,t){if(!xt(t))throw new fe;return function(){return 1>--n?t.apply(this,arguments):void 0}},v.assign=nr,v.at=function(n){var t=arguments,e=-1,r=it(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=ne(t);for(qe.unindexedChars&&Et(n)&&(n=n.split(""));++e<t;)u[e]=n[r[e]];return u},v.bind=Ht,v.bindAll=function(n){for(var t=1<arguments.length?it(arguments,true,false,1):wt(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=gt(n[u],1,null,null,n)}return n},v.bindKey=function(n,t){return 2<arguments.length?gt(t,19,s(arguments,2),null,n):gt(t,3,null,null,n)
|
||||
},v.chain=function(n){return n=new y(n),n.__chain__=true,n},v.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},v.compose=function(){for(var n=arguments,t=n.length;t--;)if(!xt(n[t]))throw new fe;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},v.countBy=or,v.create=function(n,t){var e=nt(n);return t?nr(e,t):e},v.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return tt(n,t,e);if("object"!=r)return function(t){return t[n]
|
||||
};var u=Je(n),o=u[0],a=n[o];return 1!=u.length||a!==a||Ct(a)?function(t){for(var e=u.length,r=false;e--&&(r=lt(t[u[e]],n[u[e]],null,true)););return r}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},v.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,gt(n,4,null,null,null,t)},v.debounce=Ut,v.defaults=tr,v.defer=Vt,v.delay=function(n,t){if(!xt(n))throw new fe;var e=s(arguments,2);return Ee(function(){n.apply(h,e)},t)},v.difference=function(n){return at(n,it(arguments,true,true,1))},v.filter=At,v.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(n=Pt(n,e,r)),it(n,t)
|
||||
},v.forEach=Nt,v.forEachRight=Bt,v.forIn=er,v.forInRight=function(n,t,e){var r=[];er(n,function(n,t){r.push(t,n)});var u=r.length;for(t=tt(t,e,3);u--&&false!==t(r[u--],r[u],n););return n},v.forOwn=rr,v.forOwnRight=_t,v.functions=wt,v.groupBy=ar,v.indexBy=ir,v.initial=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return s(n,0,Fe(Re(0,u-r),u))},v.intersection=function(e){for(var r=arguments,u=r.length,a=-1,l=i(),f=-1,s=yt(),g=e?e.length:0,h=[],v=i();++a<u;){var y=r[a];
|
||||
l[a]=s===n&&(y?y.length:0)>=_&&o(a?r[a]:v)}n:for(;++f<g;){var m=l[0],y=e[f];if(0>(m?t(m,y):s(v,y))){for(a=u,(m||v).push(y);--a;)if(m=l[a],0>(m?t(m,y):s(r[a],y)))continue n;h.push(y)}}for(;u--;)(m=l[u])&&p(m);return c(l),c(v),h},v.invert=jt,v.invoke=function(n,t){var e=s(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=ne(typeof o=="number"?o:0);return Nt(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},v.keys=Je,v.map=Pt,v.max=Rt,v.memoize=function(n,t){if(!xt(n))throw new fe;var e=function(){var r=e.cache,u=t?t.apply(this,arguments):b+arguments[0];
|
||||
return je.call(r,u)?r[u]:r[u]=n.apply(this,arguments)};return e.cache={},e},v.merge=function(n){var t=arguments,e=2;if(!Ct(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=tt(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=s(arguments,1,e),u=-1,o=i(),a=i();++u<e;)ft(n,t[u],r,o,a);return c(o),c(a),n},v.min=function(n,t,e){var u=1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&We(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];
|
||||
i<o&&(o=i)}}else t=null==t&&Et(n)?r:v.createCallback(t,e,3),Ze(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n)});return o},v.omit=function(n,t,e){var r={};if(typeof t!="function"){var u=[];er(n,function(n,t){u.push(t)});for(var u=at(u,it(arguments,true,false,1)),o=-1,a=u.length;++o<a;){var i=u[o];r[i]=n[i]}}else t=v.createCallback(t,e,3),er(n,function(n,e,u){t(n,e,u)||(r[e]=n)});return r},v.once=function(n){var t,e;if(!xt(n))throw new fe;return function(){return t?e:(t=true,e=n.apply(this,arguments),n=null,e)
|
||||
}},v.pairs=function(n){for(var t=-1,e=Je(n),r=e.length,u=ne(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u},v.partial=function(n){return gt(n,16,s(arguments,1))},v.partialRight=function(n){return gt(n,32,null,s(arguments,1))},v.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=it(arguments,true,false,1),a=Ct(n)?o.length:0;++u<a;){var i=o[u];i in n&&(r[i]=n[i])}else t=v.createCallback(t,e,3),er(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},v.pluck=lr,v.pull=function(n){for(var t=arguments,e=0,r=t.length,u=n?n.length:0;++e<r;)for(var o=-1,a=t[e];++o<u;)n[o]===a&&(Oe.call(n,o--,1),u--);
|
||||
return n},v.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=Re(0,me((t-n)/(e||1)));for(var u=ne(t);++r<t;)u[r]=n,n+=e;return u},v.reject=function(n,t,e){return t=v.createCallback(t,e,3),At(n,function(n,e,r){return!t(n,e,r)})},v.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];for(t=v.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),Oe.call(n,r--,1),u--);return o},v.rest=Kt,v.shuffle=Lt,v.sortBy=function(n,t,e){var r=-1,o=n?n.length:0,a=ne(typeof o=="number"?o:0);
|
||||
for(t=v.createCallback(t,e,3),Nt(n,function(n,e,u){var o=a[++r]=l();o.m=t(n,e,u),o.n=r,o.o=n}),o=a.length,a.sort(u);o--;)n=a[o],a[o]=n.o,p(n);return a},v.tap=function(n,t){return t(n),n},v.throttle=function(n,t,e){var r=true,u=true;if(!xt(n))throw new fe;return false===e?r=false:Ct(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),U.leading=r,U.maxWait=t,U.trailing=u,Ut(n,t,U)},v.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=ne(n);for(t=tt(t,e,1);++r<n;)u[r]=t(r);return u},v.toArray=function(n){return n&&typeof n.length=="number"?qe.unindexedChars&&Et(n)?n.split(""):s(n):Ot(n)
|
||||
},v.transform=function(n,t,e,r){var u=We(n);if(null==e)if(u)e=[];else{var o=n&&n.constructor;e=nt(o&&o.prototype)}return t&&(t=v.createCallback(t,r,4),(u?Ze:rr)(n,function(n,r,u){return t(e,n,r,u)})),e},v.union=function(){return pt(it(arguments,true,true))},v.uniq=Gt,v.values=Ot,v.where=At,v.without=function(n){return at(n,s(arguments,1))},v.wrap=function(n,t){return gt(t,16,[n])},v.zip=Jt,v.zipObject=Mt,v.collect=Pt,v.drop=Kt,v.each=Nt,v.eachRight=Bt,v.extend=nr,v.methods=wt,v.object=Mt,v.select=At,v.tail=Kt,v.unique=Gt,v.unzip=Jt,Xt(v),v.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=false),Y(n,t,typeof e=="function"&&tt(e,r,1))
|
||||
},v.cloneDeep=function(n,t,e){return Y(n,true,typeof t=="function"&&tt(t,e,1))},v.contains=St,v.escape=function(n){return null==n?"":le(n).replace(Ye,vt)},v.every=It,v.find=Dt,v.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=v.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},v.findKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),rr(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.findLast=function(n,t,e){var r;return t=v.createCallback(t,e,3),Bt(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0
|
||||
}),r},v.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=v.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},v.findLastKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),_t(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.has=function(n,t){return n?je.call(n,t):false},v.identity=Qt,v.indexOf=qt,v.isArguments=bt,v.isArray=We,v.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&ve.call(n)==T||false},v.isDate=function(n){return n&&typeof n=="object"&&ve.call(n)==z||false
|
||||
},v.isElement=function(n){return n&&1===n.nodeType||false},v.isEmpty=function(n){var t=true;if(!n)return t;var e=ve.call(n),r=n.length;return e==L||e==M||(qe.argsClass?e==$:bt(n))||e==G&&typeof r=="number"&&xt(n.splice)?!r:(rr(n,function(){return t=false}),t)},v.isEqual=function(n,t,e,r){return lt(n,t,typeof e=="function"&&tt(e,r,2))},v.isFinite=function(n){return Ne(n)&&!Be(parseFloat(n))},v.isFunction=xt,v.isNaN=function(n){return kt(n)&&n!=+n},v.isNull=function(n){return null===n},v.isNumber=kt,v.isObject=Ct,v.isPlainObject=ur,v.isRegExp=function(n){return n&&X[typeof n]&&ve.call(n)==J||false
|
||||
},v.isString=Et,v.isUndefined=function(n){return typeof n=="undefined"},v.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Re(0,r+e):Fe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},v.mixin=Xt,v.noConflict=function(){return e._=he,this},v.noop=Yt,v.parseInt=fr,v.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Le(),Fe(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):ct(n,t)
|
||||
},v.reduce=Ft,v.reduceRight=$t,v.result=function(n,t){if(n){var e=n[t];return xt(e)?n[t]():e}},v.runInContext=g,v.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Je(n).length},v.some=Tt,v.sortedIndex=Wt,v.template=function(n,t,e){var r=v.templateSettings;n=le(n||""),e=tr({},e,r);var u,o=tr({},e.imports,r.imports),r=Je(o),o=Ot(o),i=0,l=e.interpolate||N,f="__p+='",l=ie((e.escape||N).source+"|"+l.source+"|"+(l===A?O:N).source+"|"+(e.evaluate||N).source+"|$","g");n.replace(l,function(t,e,r,o,l,c){return r||(r=o),f+=n.slice(i,c).replace(P,a),e&&(f+="'+__e("+e+")+'"),l&&(u=true,f+="';"+l+";\n__p+='"),r&&(f+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t
|
||||
}),f+="';",l=e=e.variable,l||(e="obj",f="with("+e+"){"+f+"}"),f=(u?f.replace(x,""):f).replace(C,"$1").replace(E,"$1;"),f="function("+e+"){"+(l?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=re(r,"return "+f).apply(h,o)}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},v.unescape=function(n){return null==n?"":le(n).replace(Xe,dt)},v.uniqueId=function(n){var t=++m;return le(null==n?"":n)+t
|
||||
},v.all=It,v.any=Tt,v.detect=Dt,v.findWhere=Dt,v.foldl=Ft,v.foldr=$t,v.include=St,v.inject=Ft,rr(v,function(n,t){v.prototype[t]||(v.prototype[t]=function(){var t=[this.__wrapped__],e=this.__chain__;return Ce.apply(t,arguments),t=n.apply(v,t),e?new y(t,e):t})}),v.first=zt,v.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:h;return s(n,Re(0,u-r))},v.sample=function(n,t,e){return n&&typeof n.length!="number"?n=Ot(n):qe.unindexedChars&&Et(n)&&(n=n.split("")),null==t||e?n?n[ct(0,n.length-1)]:h:(n=Lt(n),n.length=Fe(Re(0,t),n.length),n)
|
||||
},v.take=zt,v.head=zt,rr(v,function(n,t){var e="sample"!==t;v.prototype[t]||(v.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new y(o,u):o})}),v.VERSION="2.3.0",v.prototype.chain=function(){return this.__chain__=true,this},v.prototype.toString=function(){return le(this.__wrapped__)},v.prototype.value=Zt,v.prototype.valueOf=Zt,Ze(["join","pop","shift"],function(n){var t=ce[n];v.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);
|
||||
return n?new y(e,n):e}}),Ze(["push","reverse","sort","unshift"],function(n){var t=ce[n];v.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Ze(["concat","slice","splice"],function(n){var t=ce[n];v.prototype[n]=function(){return new y(t.apply(this.__wrapped__,arguments),this.__chain__)}}),qe.spliceObjects||Ze(["pop","shift","splice"],function(n){var t=ce[n],e="splice"==n;v.prototype[n]=function(){var n=this.__chain__,r=this.__wrapped__,u=t.apply(r,arguments);return 0===r.length&&delete r[0],n||e?new y(u,n):u
|
||||
}}),v}var h,v=[],y=[],m=0,d={},b=+new Date+"",_=75,w=40,j=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",x=/\b__p\+='';/g,C=/\b(__p\+=)''\+/g,E=/(__e\(.*?\)|\b__t\))\+'';/g,O=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,S=/\w*$/,I=/^\s*function[ \n\r\t]+\w/,A=/<%=([\s\S]+?)%>/g,D=RegExp("^["+j+"]*0+(?=.$)"),N=/($^)/,B=/\bthis\b/,P=/['\n\r\t\u2028\u2029\\]/g,R="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),F="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),$="[object Arguments]",L="[object Array]",T="[object Boolean]",z="[object Date]",q="[object Error]",K="[object Function]",W="[object Number]",G="[object Object]",J="[object RegExp]",M="[object String]",H={};
|
||||
H[K]=false,H[$]=H[L]=H[T]=H[z]=H[W]=H[G]=H[J]=H[M]=true;var U={leading:false,maxWait:0,trailing:false},V={configurable:false,enumerable:false,value:null,writable:false},Q={a:"",b:null,c:"",d:"",e:"",v:null,g:"",h:null,support:null,i:"",j:false},X={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Z=X[typeof window]&&window||this,nt=X[typeof exports]&&exports&&!exports.nodeType&&exports,tt=X[typeof module]&&module&&!module.nodeType&&module,et=tt&&tt.exports===nt&&nt,rt=X[typeof global]&&global;
|
||||
}}function r(n){return n.charCodeAt(0)}function u(n,t){for(var e=n.m,r=t.m,u=-1,o=e.length;++u<o;){var a=e[u],i=r[u];if(a!==i){if(a>i||typeof a=="undefined")return 1;if(a<i||typeof i=="undefined")return-1}}return n.n-t.n}function o(n){var t=-1,r=n.length,u=n[0],o=n[r/2|0],a=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&a&&typeof a=="object")return false;for(u=l(),u["false"]=u["null"]=u["true"]=u.undefined=false,o=l(),o.k=n,o.l=u,o.push=e;++t<r;)o.push(n[t]);return o}function a(n){return"\\"+Y[n]
|
||||
}function i(){return v.pop()||[]}function l(){return y.pop()||{k:null,l:null,m:null,"false":false,n:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,o:null}}function f(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function c(n){n.length=0,v.length<w&&v.push(n)}function p(n){var t=n.l;t&&p(t),n.k=n.l=n.m=n.object=n.number=n.string=n.o=null,y.length<w&&y.push(n)}function s(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];
|
||||
return u}function g(e){function v(n){return n&&typeof n=="object"&&!Le(n)&&_e.call(n,"__wrapped__")?n:new y(n)}function y(n,t){this.__chain__=!!t,this.__wrapped__=n}function w(n){function t(){if(r){var n=r.slice();we.apply(n,arguments)}if(this instanceof t){var o=nt(e.prototype),n=e.apply(o,n||arguments);return jt(n)?n:o}return e.apply(u,n||arguments)}var e=n[0],r=n[2],u=n[4];return $e(t,n),t}function Y(n,t,e,r,u){if(e){var o=e(n);if(typeof o!="undefined")return o}if(!jt(n))return n;var a=ge.call(n);
|
||||
if(!V[a]||!Te.nodeClass&&f(n))return n;var l=Re[a];switch(a){case L:case z:return new l(+n);case W:case M:return new l(n);case J:return o=l(n.source,S.exec(n)),o.lastIndex=n.lastIndex,o}if(a=Le(n),t){var p=!r;r||(r=i()),u||(u=i());for(var g=r.length;g--;)if(r[g]==n)return u[g];o=a?l(n.length):{}}else o=a?s(n):Qe({},n);return a&&(_e.call(n,"index")&&(o.index=n.index),_e.call(n,"input")&&(o.input=n.input)),t?(r.push(n),u.push(o),(a?Ue:Ze)(n,function(n,a){o[a]=Y(n,t,e,r,u)}),p&&(c(r),c(u)),o):o}function nt(n){return jt(n)?Ee(n):{}
|
||||
}function tt(n,t,e){if(typeof n!="function")return Vt;if(typeof t=="undefined"||!("prototype"in n))return n;var r=n.__bindData__;if(typeof r=="undefined"&&(Te.funcNames&&(r=!n.name),r=r||!Te.funcDecomp,!r)){var u=de.call(n);Te.funcNames||(r=!A.test(u)),r||(r=B.test(u),$e(n,r))}if(false===r||true!==r&&1&r[1])return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,o){return n.call(t,e,r,u,o)
|
||||
}}return Jt(n,t)}function et(n){function t(){var n=l?a:this;if(u){var h=u.slice();we.apply(h,arguments)}return(o||c)&&(h||(h=s(arguments)),o&&we.apply(h,o),c&&h.length<i)?(r|=16,et([e,p?r:-4&r,h,null,a,i])):(h||(h=arguments),f&&(e=n[g]),this instanceof t?(n=nt(e.prototype),h=e.apply(n,h),jt(h)?h:n):e.apply(n,h))}var e=n[0],r=n[1],u=n[2],o=n[3],a=n[4],i=n[5],l=1&r,f=2&r,c=4&r,p=8&r,g=e;return $e(t,n),t}function rt(e,r){var u=-1,a=ht(),i=e?e.length:0,l=i>=_&&a===n,f=[];if(l){var c=o(r);c?(a=t,r=c):l=false
|
||||
}for(;++u<i;)c=e[u],0>a(r,c)&&f.push(c);return l&&p(r),f}function ot(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r<u;){var a=n[r];if(a&&typeof a=="object"&&typeof a.length=="number"&&(Le(a)||mt(a))){t||(a=ot(a,t,e));var i=-1,l=a.length,f=o.length;for(o.length+=l;++i<l;)o[f++]=a[i]}else e||o.push(a)}return o}function at(n,t,e,r,u,o){if(e){var a=e(n,t);if(typeof a!="undefined")return!!a}if(n===t)return 0!==n||1/n==1/t;if(n===n&&!(n&&X[typeof n]||t&&X[typeof t]))return false;if(null==n||null==t)return n===t;
|
||||
var l=ge.call(n),p=ge.call(t);if(l==T&&(l=G),p==T&&(p=G),l!=p)return false;switch(l){case L:case z:return+n==+t;case W:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case J:case M:return n==ae(t)}if(p=l==$,!p){var s=_e.call(n,"__wrapped__"),g=_e.call(t,"__wrapped__");if(s||g)return at(s?n.__wrapped__:n,g?t.__wrapped__:t,e,r,u,o);if(l!=G||!Te.nodeClass&&(f(n)||f(t)))return false;if(l=!Te.argsObject&&mt(n)?ue:n.constructor,s=!Te.argsObject&&mt(t)?ue:t.constructor,l!=s&&!(wt(l)&&l instanceof l&&wt(s)&&s instanceof s)&&"constructor"in n&&"constructor"in t)return false
|
||||
}for(s=!u,u||(u=i()),o||(o=i()),l=u.length;l--;)if(u[l]==n)return o[l]==t;var h=0,a=true;if(u.push(n),o.push(t),p){if(l=n.length,h=t.length,a=h==n.length,!a&&!r)return a;for(;h--;)if(p=l,s=t[h],r)for(;p--&&!(a=at(n[p],s,e,r,u,o)););else if(!(a=at(n[h],s,e,r,u,o)))break;return a}return Ye(t,function(t,i,l){return _e.call(l,i)?(h++,a=_e.call(n,i)&&at(n[i],t,e,r,u,o)):void 0}),a&&!r&&Ye(n,function(n,t,e){return _e.call(e,t)?a=-1<--h:void 0}),s&&(c(u),c(o)),a}function it(n,t,e,r,u){(Le(t)?It:Ze)(t,function(t,o){var a,i,l=t,f=n[o];
|
||||
if(t&&((i=Le(t))||nr(t))){for(l=r.length;l--;)if(a=r[l]==t){f=u[l];break}if(!a){var c;e&&(l=e(f,t),c=typeof l!="undefined")&&(f=l),c||(f=i?Le(f)?f:[]:nr(f)?f:{}),r.push(t),u.push(f),c||it(f,t,e,r,u)}}else e&&(l=e(f,t),typeof l=="undefined"&&(l=t)),typeof l!="undefined"&&(f=l);n[o]=f})}function lt(n,t){return n+me(Pe()*(t-n+1))}function ft(e,r,u){var a=-1,l=ht(),f=e?e.length:0,s=[],g=!r&&f>=_&&l===n,h=u||g?i():s;if(g){var v=o(h);v?(l=t,h=v):(g=false,h=u?h:(c(h),s))}for(;++a<f;){var v=e[a],y=u?u(v,a,e):v;
|
||||
(r?!a||h[h.length-1]!==y:0>l(h,y))&&((u||g)&&h.push(y),s.push(v))}return g?(c(h.k),p(h)):u&&c(h),s}function ct(n){return function(t,e,r){var u={};if(e=v.createCallback(e,r,3),Le(t)){r=-1;for(var o=t.length;++r<o;){var a=t[r];n(u,a,e(a,r,t),t)}}else Ue(t,function(t,r,o){n(u,t,e(t,r,o),o)});return u}}function pt(n,t,e,r,u,o){var a=1&t,i=4&t,l=16&t,f=32&t;if(!(2&t||wt(n)))throw new ie;l&&!e.length&&(t&=-17,l=e=false),f&&!r.length&&(t&=-33,f=r=false);var c=n&&n.__bindData__;return c&&true!==c?(c=c.slice(),!a||1&c[1]||(c[4]=u),!a&&1&c[1]&&(t|=8),!i||4&c[1]||(c[5]=o),l&&we.apply(c[2]||(c[2]=[]),e),f&&we.apply(c[3]||(c[3]=[]),r),c[1]|=t,pt.apply(null,c)):(1==t||17===t?w:et)([n,t,e,r,u,o])
|
||||
}function st(){Q.h=F,Q.b=Q.c=Q.g=Q.i="",Q.e="t",Q.j=true;for(var n,t=0;n=arguments[t];t++)for(var e in n)Q[e]=n[e];t=Q.a,Q.d=/^[^,]+/.exec(t)[0],n=te,t="return function("+t+"){",e=Q;var r="var n,t="+e.d+",E="+e.e+";if(!t)return E;"+e.i+";";e.b?(r+="var u=t.length;n=-1;if("+e.b+"){",Te.unindexedChars&&(r+="if(s(t)){t=t.split('')}"),r+="while(++n<u){"+e.g+";}}else{"):Te.nonEnumArgs&&(r+="var u=t.length;n=-1;if(u&&p(t)){while(++n<u){n+='';"+e.g+";}}else{"),Te.enumPrototypes&&(r+="var G=typeof t=='function';"),Te.enumErrorProps&&(r+="var F=t===k||t instanceof Error;");
|
||||
var u=[];if(Te.enumPrototypes&&u.push('!(G&&n=="prototype")'),Te.enumErrorProps&&u.push('!(F&&(n=="message"||n=="name"))'),e.j&&e.f)r+="var C=-1,D=B[typeof t]&&v(t),u=D?D.length:0;while(++C<u){n=D[C];",u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}";else if(r+="for(n in t){",e.j&&u.push("m.call(t, n)"),u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}",Te.nonEnumShadows){for(r+="if(t!==A){var i=t.constructor,r=t===(i&&i.prototype),f=t===J?I:t===k?j:L.call(t),x=y[f];",k=0;7>k;k++)r+="n='"+e.h[k]+"';if((!(r&&x[n])&&m.call(t,n))",e.j||(r+="||(!x[n]&&t[n]!==A[n])"),r+="){"+e.g+"}";
|
||||
r+="}"}return(e.b||Te.nonEnumArgs)&&(r+="}"),r+=e.c+";return E",n("d,j,k,m,o,p,q,s,v,A,B,y,I,J,L",t+r+"}")(tt,q,fe,_e,d,mt,Le,Ct,Q.f,ce,X,Fe,M,pe,ge)}function gt(n){return Je[n]}function ht(){var t=(t=v.indexOf)===Lt?n:t;return t}function vt(n){var t,e;return!n||ge.call(n)!=G||(t=n.constructor,wt(t)&&!(t instanceof t))||!Te.argsClass&&mt(n)||!Te.nodeClass&&f(n)?false:Te.ownLast?(Ye(n,function(n,t,r){return e=_e.call(r,t),false}),false!==e):(Ye(n,function(n,t){e=t}),typeof e=="undefined"||_e.call(n,e))}function yt(n){return Me[n]
|
||||
}function mt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ge.call(n)==T||false}function dt(n,t,e){var r=qe(n),u=r.length;for(t=tt(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function bt(n){var t=[];return Ye(n,function(n,e){wt(n)&&t.push(e)}),t.sort()}function _t(n){for(var t=-1,e=qe(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function wt(n){return typeof n=="function"}function jt(n){return!(!n||!X[typeof n])}function xt(n){return typeof n=="number"||n&&typeof n=="object"&&ge.call(n)==W||false
|
||||
}function Ct(n){return typeof n=="string"||n&&typeof n=="object"&&ge.call(n)==M||false}function kt(n){for(var t=-1,e=qe(n),r=e.length,u=Yt(r);++t<r;)u[t]=n[e[t]];return u}function Et(n,t,e){var r=-1,u=ht(),o=n?n.length:0,a=false;return e=(0>e?De(0,o+e):e)||0,Le(n)?a=-1<u(n,t,e):typeof o=="number"?a=-1<(Ct(n)?n.indexOf(t,e):u(n,t,e)):Ue(n,function(n){return++r<e?void 0:!(a=n===t)}),a}function Ot(n,t,e){var r=true;if(t=v.createCallback(t,e,3),Le(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else Ue(n,function(n,e,u){return r=!!t(n,e,u)
|
||||
});return r}function St(n,t,e){var r=[];if(t=v.createCallback(t,e,3),Le(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}}else Ue(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function At(n,t,e){if(t=v.createCallback(t,e,3),!Le(n)){var r;return Ue(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e];if(t(o,e,n))return o}}function It(n,t,e){if(t&&typeof e=="undefined"&&Le(n)){e=-1;for(var r=n.length;++e<r&&false!==t(n[e],e,n););}else Ue(n,t,e);
|
||||
return n}function Dt(n,t,e){var r=n,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:tt(t,e,3),Le(n))for(;u--&&false!==t(n[u],u,n););else{if(typeof u!="number")var o=qe(n),u=o.length;else Te.unindexedChars&&Ct(n)&&(r=n.split(""));Ue(n,function(n,e,a){return e=o?o[--u]:--u,t(r[e],e,a)})}return n}function Nt(n,t,e){var r=-1,u=n?n.length:0,o=Yt(typeof u=="number"?u:0);if(t=v.createCallback(t,e,3),Le(n))for(;++r<u;)o[r]=t(n[r],r,n);else Ue(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function Bt(n,t,e){var u=-1/0,o=u;
|
||||
if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&Le(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i>o&&(o=i)}}else t=null==t&&Ct(n)?r:v.createCallback(t,e,3),Ue(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Pt(n,t,e,r){var u=3>arguments.length;if(t=v.createCallback(t,r,4),Le(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++o<a;)e=t(e,n[o],o,n)}else Ue(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)});return e}function Rt(n,t,e,r){var u=3>arguments.length;return t=v.createCallback(t,r,4),Dt(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)
|
||||
}),e}function Ft(n){var t=-1,e=n?n.length:0,r=Yt(typeof e=="number"?e:0);return It(n,function(n){var e=lt(0,++t);r[t]=r[e],r[e]=n}),r}function Tt(n,t,e){var r;if(t=v.createCallback(t,e,3),Le(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else Ue(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function $t(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=v.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[0]:h;return s(n,0,Ne(De(0,r),u))
|
||||
}function Lt(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?De(0,u+r):r||0}else if(r)return r=qt(t,e),t[r]===e?r:-1;return n(t,e,r)}function zt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=v.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:De(0,t);return s(n,r)}function qt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?v.createCallback(e,r,1):Vt,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function Kt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(e=v.createCallback(e,r,3)),ft(n,t,e)
|
||||
}function Wt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?Bt(ur(n,"length")):0,r=Yt(0>e?0:e);++t<e;)r[t]=ur(n,t);return r}function Gt(n,t){var e=-1,r=n?n.length:0,u={};for(t||!r||Le(n[0])||(t=[]);++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function Jt(n,t){return 2<arguments.length?pt(n,17,s(arguments,2),null,t):pt(n,1,null,null,t)}function Mt(n,t,e){var r,u,o,a,i,l,f,c=0,p=false,s=true;if(!wt(n))throw new ie;if(t=De(0,t)||0,true===e)var g=true,s=false;else jt(e)&&(g=e.leading,p="maxWait"in e&&(De(t,e.maxWait)||0),s="trailing"in e?e.trailing:s);
|
||||
var v=function(){var e=t-(or()-a);0<e?l=xe(v,e):(u&&ye(u),e=f,u=l=f=h,e&&(c=or(),o=n.apply(i,r),l||u||(r=i=null)))},y=function(){l&&ye(l),u=l=f=h,(s||p!==t)&&(c=or(),o=n.apply(i,r),l||u||(r=i=null))};return function(){if(r=arguments,a=or(),i=this,f=s&&(l||!g),false===p)var e=g&&!l;else{u||g||(c=a);var h=p-(a-c),m=0>=h;m?(u&&(u=ye(u)),c=a,o=n.apply(i,r)):u||(u=xe(y,h))}return m&&l?l=ye(l):l||t===p||(l=xe(v,t)),e&&(m=true,o=n.apply(i,r)),!m||l||u||(r=i=null),o}}function Vt(n){return n}function Ht(n,t,e){var r=true,u=t&&bt(t);
|
||||
t&&(e||u.length)||(null==e&&(e=t),o=y,t=n,n=v,u=bt(t)),false===e?r=false:jt(e)&&"chain"in e&&(r=e.chain);var o=n,a=wt(o);It(u,function(e){var u=n[e]=t[e];a&&(o.prototype[e]=function(){var t=this.__chain__,e=this.__wrapped__,a=[e];if(we.apply(a,arguments),a=u.apply(n,a),r||t){if(e===a&&jt(a))return this;a=new o(a),a.__chain__=t}return a})})}function Ut(){}function Qt(n){return function(t){return t[n]}}function Xt(){return this.__wrapped__}e=e?ut.defaults(Z.Object(),e,ut.pick(Z,R)):Z;var Yt=e.Array,Zt=e.Boolean,ne=e.Date,te=e.Function,ee=e.Math,re=e.Number,ue=e.Object,oe=e.RegExp,ae=e.String,ie=e.TypeError,le=[],fe=e.Error.prototype,ce=ue.prototype,pe=ae.prototype,se=e._,ge=ce.toString,he=oe("^"+ae(ge).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),ve=ee.ceil,ye=e.clearTimeout,me=ee.floor,de=te.prototype.toString,be=he.test(be=ue.getPrototypeOf)&&be,_e=ce.hasOwnProperty,we=le.push,je=ce.propertyIsEnumerable,xe=e.setTimeout,Ce=le.splice,ke=function(){try{var n={},t=he.test(t=ue.defineProperty)&&t,e=t(n,n,n)&&t
|
||||
}catch(r){}return e}(),Ee=he.test(Ee=ue.create)&&Ee,Oe=he.test(Oe=Yt.isArray)&&Oe,Se=e.isFinite,Ae=e.isNaN,Ie=he.test(Ie=ue.keys)&&Ie,De=ee.max,Ne=ee.min,Be=e.parseInt,Pe=ee.random,Re={};Re[$]=Yt,Re[L]=Zt,Re[z]=ne,Re[K]=te,Re[G]=ue,Re[W]=re,Re[J]=oe,Re[M]=ae;var Fe={};Fe[$]=Fe[z]=Fe[W]={constructor:true,toLocaleString:true,toString:true,valueOf:true},Fe[L]=Fe[M]={constructor:true,toString:true,valueOf:true},Fe[q]=Fe[K]=Fe[J]={constructor:true,toString:true},Fe[G]={constructor:true},function(){for(var n=F.length;n--;){var t,e=F[n];
|
||||
for(t in Fe)_e.call(Fe,t)&&!_e.call(Fe[t],e)&&(Fe[t][e]=false)}}(),y.prototype=v.prototype;var Te=v.support={};!function(){var n=function(){this.x=1},t={0:1,length:1},r=[];n.prototype={valueOf:1,y:1};for(var u in new n)r.push(u);for(u in arguments);Te.argsClass=ge.call(arguments)==T,Te.argsObject=arguments.constructor==ue&&!(arguments instanceof Yt),Te.enumErrorProps=je.call(fe,"message")||je.call(fe,"name"),Te.enumPrototypes=je.call(n,"prototype"),Te.funcDecomp=!he.test(e.WinRTError)&&B.test(g),Te.funcNames=typeof te.name=="string",Te.nonEnumArgs=0!=u,Te.nonEnumShadows=!/valueOf/.test(r),Te.ownLast="x"!=r[0],Te.spliceObjects=(le.splice.call(t,0,1),!t[0]),Te.unindexedChars="xx"!="x"[0]+ue("x")[0];
|
||||
try{Te.nodeClass=!(ge.call(document)==G&&!({toString:0}+""))}catch(o){Te.nodeClass=true}}(1),v.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:I,variable:"",imports:{_:v}},Ee||(nt=function(){function n(){}return function(t){if(jt(t)){n.prototype=t;var r=new n;n.prototype=null}return r||e.Object()}}());var $e=ke?function(n,t){U.value=t,ke(n,"__bindData__",U)}:Ut;Te.argsClass||(mt=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&_e.call(n,"callee")&&!je.call(n,"callee")||false
|
||||
});var Le=Oe||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ge.call(n)==$||false},ze=st({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),qe=Ie?function(n){return jt(n)?Te.enumPrototypes&&typeof n=="function"||Te.nonEnumArgs&&n.length&&mt(n)?ze(n):Ie(n):[]}:ze,Ke={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:qe,g:"if(e(t[n],n,g)===false)return E"},We={a:"z,H,l",i:"var a=arguments,b=0,c=typeof l=='number'?2:a.length;while(++b<c){t=a[b];if(t&&B[typeof t]){",v:qe,g:"if(typeof E[n]=='undefined')E[n]=t[n]",c:"}}"},Ge={i:"if(!B[typeof t])return E;"+Ke.i,b:false},Je={"&":"&","<":"<",">":">",'"':""","'":"'"},Me=_t(Je),Ve=oe("("+qe(Me).join("|")+")","g"),He=oe("["+qe(Je).join("")+"]","g"),Ue=st(Ke),Qe=st(We,{i:We.i.replace(";",";if(c>3&&typeof a[c-2]=='function'){var e=d(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){e=a[--c]}"),g:"E[n]=e?e(E[n],t[n]):t[n]"}),Xe=st(We),Ye=st(Ke,Ge,{j:false}),Ze=st(Ke,Ge);
|
||||
wt(/x/)&&(wt=function(n){return typeof n=="function"&&ge.call(n)==K});var nr=be?function(n){if(!n||ge.call(n)!=G||!Te.argsClass&&mt(n))return false;var t=n.valueOf,e=typeof t=="function"&&(e=be(t))&&be(e);return e?n==e||be(n)==e:vt(n)}:vt,tr=ct(function(n,t,e){_e.call(n,e)?n[e]++:n[e]=1}),er=ct(function(n,t,e){(_e.call(n,e)?n[e]:n[e]=[]).push(t)}),rr=ct(function(n,t,e){n[e]=t}),ur=Nt,or=he.test(or=ne.now)&&or||function(){return(new ne).getTime()},ar=8==Be(j+"08")?Be:function(n,t){return Be(Ct(n)?n.replace(D,""):n,t||0)
|
||||
};return v.after=function(n,t){if(!wt(t))throw new ie;return function(){return 1>--n?t.apply(this,arguments):void 0}},v.assign=Qe,v.at=function(n){var t=arguments,e=-1,r=ot(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Yt(t);for(Te.unindexedChars&&Ct(n)&&(n=n.split(""));++e<t;)u[e]=n[r[e]];return u},v.bind=Jt,v.bindAll=function(n){for(var t=1<arguments.length?ot(arguments,true,false,1):bt(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=pt(n[u],1,null,null,n)}return n},v.bindKey=function(n,t){return 2<arguments.length?pt(t,19,s(arguments,2),null,n):pt(t,3,null,null,n)
|
||||
},v.chain=function(n){return n=new y(n),n.__chain__=true,n},v.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},v.compose=function(){for(var n=arguments,t=n.length;t--;)if(!wt(n[t]))throw new ie;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},v.constant=function(n){return function(){return n}},v.countBy=tr,v.create=function(n,t){var e=nt(n);return t?Qe(e,t):e},v.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return tt(n,t,e);
|
||||
if("object"!=r)return Qt(n);var u=qe(n),o=u[0],a=n[o];return 1!=u.length||a!==a||jt(a)?function(t){for(var e=u.length,r=false;e--&&(r=at(t[u[e]],n[u[e]],null,true)););return r}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},v.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,pt(n,4,null,null,null,t)},v.debounce=Mt,v.defaults=Xe,v.defer=function(n){if(!wt(n))throw new ie;var t=s(arguments,1);return xe(function(){n.apply(h,t)},1)},v.delay=function(n,t){if(!wt(n))throw new ie;var e=s(arguments,2);
|
||||
return xe(function(){n.apply(h,e)},t)},v.difference=function(n){return rt(n,ot(arguments,true,true,1))},v.filter=St,v.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(n=Nt(n,e,r)),ot(n,t)},v.forEach=It,v.forEachRight=Dt,v.forIn=Ye,v.forInRight=function(n,t,e){var r=[];Ye(n,function(n,t){r.push(t,n)});var u=r.length;for(t=tt(t,e,3);u--&&false!==t(r[u--],r[u],n););return n},v.forOwn=Ze,v.forOwnRight=dt,v.functions=bt,v.groupBy=er,v.indexBy=rr,v.initial=function(n,t,e){var r=0,u=n?n.length:0;
|
||||
if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return s(n,0,Ne(De(0,u-r),u))},v.intersection=function(){for(var e=[],r=-1,u=arguments.length,a=i(),l=ht(),f=l===n,s=i();++r<u;){var g=arguments[r];(Le(g)||mt(g))&&(e.push(g),a.push(f&&g.length>=_&&o(r?e[r]:s)))}var f=e[0],h=-1,v=f?f.length:0,y=[];n:for(;++h<v;){var m=a[0],g=f[h];if(0>(m?t(m,g):l(s,g))){for(r=u,(m||s).push(g);--r;)if(m=a[r],0>(m?t(m,g):l(e[r],g)))continue n;y.push(g)
|
||||
}}for(;u--;)(m=a[u])&&p(m);return c(a),c(s),y},v.invert=_t,v.invoke=function(n,t){var e=s(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=Yt(typeof o=="number"?o:0);return It(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},v.keys=qe,v.map=Nt,v.mapValues=function(n,t,e){var r={};return t=v.createCallback(t,e,3),Ze(n,function(n,e,u){r[e]=t(n,e,u)}),r},v.max=Bt,v.memoize=function(n,t){if(!wt(n))throw new ie;var e=function(){var r=e.cache,u=t?t.apply(this,arguments):b+arguments[0];return _e.call(r,u)?r[u]:r[u]=n.apply(this,arguments)
|
||||
};return e.cache={},e},v.merge=function(n){var t=arguments,e=2;if(!jt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=tt(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=s(arguments,1,e),u=-1,o=i(),a=i();++u<e;)it(n,t[u],r,o,a);return c(o),c(a),n},v.min=function(n,t,e){var u=1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&Le(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i<o&&(o=i)}}else t=null==t&&Ct(n)?r:v.createCallback(t,e,3),Ue(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n)
|
||||
});return o},v.omit=function(n,t,e){var r={};if(typeof t!="function"){var u=[];Ye(n,function(n,t){u.push(t)});for(var u=rt(u,ot(arguments,true,false,1)),o=-1,a=u.length;++o<a;){var i=u[o];r[i]=n[i]}}else t=v.createCallback(t,e,3),Ye(n,function(n,e,u){t(n,e,u)||(r[e]=n)});return r},v.once=function(n){var t,e;if(!wt(n))throw new ie;return function(){return t?e:(t=true,e=n.apply(this,arguments),n=null,e)}},v.pairs=function(n){for(var t=-1,e=qe(n),r=e.length,u=Yt(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u
|
||||
},v.partial=function(n){return pt(n,16,s(arguments,1))},v.partialRight=function(n){return pt(n,32,null,s(arguments,1))},v.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=ot(arguments,true,false,1),a=jt(n)?o.length:0;++u<a;){var i=o[u];i in n&&(r[i]=n[i])}else t=v.createCallback(t,e,3),Ye(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},v.pluck=ur,v.property=Qt,v.pull=function(n){for(var t=arguments,e=0,r=t.length,u=n?n.length:0;++e<r;)for(var o=-1,a=t[e];++o<u;)n[o]===a&&(Ce.call(n,o--,1),u--);
|
||||
return n},v.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=De(0,ve((t-n)/(e||1)));for(var u=Yt(t);++r<t;)u[r]=n,n+=e;return u},v.reject=function(n,t,e){return t=v.createCallback(t,e,3),St(n,function(n,e,r){return!t(n,e,r)})},v.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];for(t=v.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),Ce.call(n,r--,1),u--);return o},v.rest=zt,v.shuffle=Ft,v.sortBy=function(n,t,e){var r=-1,o=Le(t),a=n?n.length:0,f=Yt(typeof a=="number"?a:0);
|
||||
for(o||(t=v.createCallback(t,e,3)),It(n,function(n,e,u){var a=f[++r]=l();o?a.m=Nt(t,function(t){return n[t]}):(a.m=i())[0]=t(n,e,u),a.n=r,a.o=n}),a=f.length,f.sort(u);a--;)n=f[a],f[a]=n.o,o||c(n.m),p(n);return f},v.tap=function(n,t){return t(n),n},v.throttle=function(n,t,e){var r=true,u=true;if(!wt(n))throw new ie;return false===e?r=false:jt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),H.leading=r,H.maxWait=t,H.trailing=u,Mt(n,t,H)},v.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Yt(n);
|
||||
for(t=tt(t,e,1);++r<n;)u[r]=t(r);return u},v.toArray=function(n){return n&&typeof n.length=="number"?Te.unindexedChars&&Ct(n)?n.split(""):s(n):kt(n)},v.transform=function(n,t,e,r){var u=Le(n);if(null==e)if(u)e=[];else{var o=n&&n.constructor;e=nt(o&&o.prototype)}return t&&(t=v.createCallback(t,r,4),(u?Ue:Ze)(n,function(n,r,u){return t(e,n,r,u)})),e},v.union=function(){return ft(ot(arguments,true,true))},v.uniq=Kt,v.values=kt,v.where=St,v.without=function(n){return rt(n,s(arguments,1))},v.wrap=function(n,t){return pt(t,16,[n])
|
||||
},v.xor=function(){for(var n=-1,t=arguments.length;++n<t;){var e=arguments[n];if(Le(e)||mt(e))var r=r?ft(rt(r,e).concat(rt(e,r))):e}return r||[]},v.zip=Wt,v.zipObject=Gt,v.collect=Nt,v.drop=zt,v.each=It,v.eachRight=Dt,v.extend=Qe,v.methods=bt,v.object=Gt,v.select=St,v.tail=zt,v.unique=Kt,v.unzip=Wt,Ht(v),v.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=false),Y(n,t,typeof e=="function"&&tt(e,r,1))},v.cloneDeep=function(n,t,e){return Y(n,true,typeof t=="function"&&tt(t,e,1))},v.contains=Et,v.escape=function(n){return null==n?"":ae(n).replace(He,gt)
|
||||
},v.every=Ot,v.find=At,v.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=v.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},v.findKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),Ze(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.findLast=function(n,t,e){var r;return t=v.createCallback(t,e,3),Dt(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0}),r},v.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=v.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;
|
||||
return-1},v.findLastKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),dt(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.has=function(n,t){return n?_e.call(n,t):false},v.identity=Vt,v.indexOf=Lt,v.isArguments=mt,v.isArray=Le,v.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&ge.call(n)==L||false},v.isDate=function(n){return n&&typeof n=="object"&&ge.call(n)==z||false},v.isElement=function(n){return n&&1===n.nodeType||false},v.isEmpty=function(n){var t=true;if(!n)return t;var e=ge.call(n),r=n.length;
|
||||
return e==$||e==M||(Te.argsClass?e==T:mt(n))||e==G&&typeof r=="number"&&wt(n.splice)?!r:(Ze(n,function(){return t=false}),t)},v.isEqual=function(n,t,e,r){return at(n,t,typeof e=="function"&&tt(e,r,2))},v.isFinite=function(n){return Se(n)&&!Ae(parseFloat(n))},v.isFunction=wt,v.isNaN=function(n){return xt(n)&&n!=+n},v.isNull=function(n){return null===n},v.isNumber=xt,v.isObject=jt,v.isPlainObject=nr,v.isRegExp=function(n){return n&&X[typeof n]&&ge.call(n)==J||false},v.isString=Ct,v.isUndefined=function(n){return typeof n=="undefined"
|
||||
},v.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?De(0,r+e):Ne(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},v.mixin=Ht,v.noConflict=function(){return e._=se,this},v.noop=Ut,v.now=or,v.parseInt=ar,v.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Pe(),Ne(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):lt(n,t)},v.reduce=Pt,v.reduceRight=Rt,v.result=function(n,t){if(n){var e=n[t];
|
||||
return wt(e)?n[t]():e}},v.runInContext=g,v.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:qe(n).length},v.some=Tt,v.sortedIndex=qt,v.template=function(n,t,e){var r=v.templateSettings;n=ae(n||""),e=Xe({},e,r);var u,o=Xe({},e.imports,r.imports),r=qe(o),o=kt(o),i=0,l=e.interpolate||N,f="__p+='",l=oe((e.escape||N).source+"|"+l.source+"|"+(l===I?O:N).source+"|"+(e.evaluate||N).source+"|$","g");n.replace(l,function(t,e,r,o,l,c){return r||(r=o),f+=n.slice(i,c).replace(P,a),e&&(f+="'+__e("+e+")+'"),l&&(u=true,f+="';"+l+";\n__p+='"),r&&(f+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t
|
||||
}),f+="';",l=e=e.variable,l||(e="obj",f="with("+e+"){"+f+"}"),f=(u?f.replace(x,""):f).replace(C,"$1").replace(E,"$1;"),f="function("+e+"){"+(l?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=te(r,"return "+f).apply(h,o)}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},v.unescape=function(n){return null==n?"":ae(n).replace(Ve,yt)},v.uniqueId=function(n){var t=++m;return ae(null==n?"":n)+t
|
||||
},v.all=Ot,v.any=Tt,v.detect=At,v.findWhere=At,v.foldl=Pt,v.foldr=Rt,v.include=Et,v.inject=Pt,Ht(function(){var n={};return Ze(v,function(t,e){v.prototype[e]||(n[e]=t)}),n}(),false),v.first=$t,v.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:h;return s(n,De(0,u-r))},v.sample=function(n,t,e){return n&&typeof n.length!="number"?n=kt(n):Te.unindexedChars&&Ct(n)&&(n=n.split("")),null==t||e?n?n[lt(0,n.length-1)]:h:(n=Ft(n),n.length=Ne(De(0,t),n.length),n)
|
||||
},v.take=$t,v.head=$t,Ze(v,function(n,t){var e="sample"!==t;v.prototype[t]||(v.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new y(o,u):o})}),v.VERSION="2.4.0",v.prototype.chain=function(){return this.__chain__=true,this},v.prototype.toString=function(){return ae(this.__wrapped__)},v.prototype.value=Xt,v.prototype.valueOf=Xt,Ue(["join","pop","shift"],function(n){var t=le[n];v.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);
|
||||
return n?new y(e,n):e}}),Ue(["push","reverse","sort","unshift"],function(n){var t=le[n];v.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Ue(["concat","slice","splice"],function(n){var t=le[n];v.prototype[n]=function(){return new y(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Te.spliceObjects||Ue(["pop","shift","splice"],function(n){var t=le[n],e="splice"==n;v.prototype[n]=function(){var n=this.__chain__,r=this.__wrapped__,u=t.apply(r,arguments);return 0===r.length&&delete r[0],n||e?new y(u,n):u
|
||||
}}),v}var h,v=[],y=[],m=0,d={},b=+new Date+"",_=75,w=40,j=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",x=/\b__p\+='';/g,C=/\b(__p\+=)''\+/g,E=/(__e\(.*?\)|\b__t\))\+'';/g,O=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,S=/\w*$/,A=/^\s*function[ \n\r\t]+\w/,I=/<%=([\s\S]+?)%>/g,D=RegExp("^["+j+"]*0+(?=.$)"),N=/($^)/,B=/\bthis\b/,P=/['\n\r\t\u2028\u2029\\]/g,R="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setTimeout".split(" "),F="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),T="[object Arguments]",$="[object Array]",L="[object Boolean]",z="[object Date]",q="[object Error]",K="[object Function]",W="[object Number]",G="[object Object]",J="[object RegExp]",M="[object String]",V={};
|
||||
V[K]=false,V[T]=V[$]=V[L]=V[z]=V[W]=V[G]=V[J]=V[M]=true;var H={leading:false,maxWait:0,trailing:false},U={configurable:false,enumerable:false,value:null,writable:false},Q={a:"",b:null,c:"",d:"",e:"",v:null,g:"",h:null,support:null,i:"",j:false},X={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Z=X[typeof window]&&window||this,nt=X[typeof exports]&&exports&&!exports.nodeType&&exports,tt=X[typeof module]&&module&&!module.nodeType&&module,et=tt&&tt.exports===nt&&nt,rt=X[typeof global]&&global;
|
||||
!rt||rt.global!==rt&&rt.window!==rt||(Z=rt);var ut=g();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Z._=ut, define(function(){return ut})):nt&&tt?et?(tt.exports=ut)._=ut:nt._=ut:Z._=ut}).call(this);
|
||||
573
dist/lodash.js
vendored
573
dist/lodash.js
vendored
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
||||
* Lo-Dash 2.4.0 (Custom Build) <http://lodash.com/>
|
||||
* Build: `lodash modern -o ./dist/lodash.js`
|
||||
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
/**
|
||||
* Used to match ES6 template delimiters
|
||||
* http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6
|
||||
* http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals
|
||||
*/
|
||||
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
var contextProps = [
|
||||
'Array', 'Boolean', 'Date', 'Function', 'Math', 'Number', 'Object',
|
||||
'RegExp', 'String', '_', 'attachEvent', 'clearTimeout', 'isFinite', 'isNaN',
|
||||
'parseInt', 'setImmediate', 'setTimeout'
|
||||
'parseInt', 'setTimeout'
|
||||
];
|
||||
|
||||
/** Used to make template sourceURLs easier to identify */
|
||||
@@ -256,22 +256,29 @@
|
||||
*/
|
||||
function compareAscending(a, b) {
|
||||
var ac = a.criteria,
|
||||
bc = b.criteria;
|
||||
bc = b.criteria,
|
||||
index = -1,
|
||||
length = ac.length;
|
||||
|
||||
// ensure a stable sort in V8 and other engines
|
||||
// http://code.google.com/p/v8/issues/detail?id=90
|
||||
if (ac !== bc) {
|
||||
if (ac > bc || typeof ac == 'undefined') {
|
||||
return 1;
|
||||
}
|
||||
if (ac < bc || typeof bc == 'undefined') {
|
||||
return -1;
|
||||
while (++index < length) {
|
||||
var value = ac[index],
|
||||
other = bc[index];
|
||||
|
||||
if (value !== other) {
|
||||
if (value > other || typeof value == 'undefined') {
|
||||
return 1;
|
||||
}
|
||||
if (value < other || typeof other == 'undefined') {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
// The JS engine embedded in Adobe applications like InDesign has a buggy
|
||||
// `Array#sort` implementation that causes it, under certain circumstances,
|
||||
// to return the same value for `a` and `b`.
|
||||
// See https://github.com/jashkenas/underscore/pull/1247
|
||||
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
|
||||
// that causes it, under certain circumstances, to return the same value for
|
||||
// `a` and `b`. See https://github.com/jashkenas/underscore/pull/1247
|
||||
//
|
||||
// This also ensures a stable sort in V8 and other engines.
|
||||
// See http://code.google.com/p/v8/issues/detail?id=90
|
||||
return a.index - b.index;
|
||||
}
|
||||
|
||||
@@ -472,15 +479,10 @@
|
||||
fnToString = Function.prototype.toString,
|
||||
getPrototypeOf = reNative.test(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf,
|
||||
hasOwnProperty = objectProto.hasOwnProperty,
|
||||
now = reNative.test(now = Date.now) && now || function() { return +new Date; },
|
||||
push = arrayRef.push,
|
||||
setTimeout = context.setTimeout,
|
||||
splice = arrayRef.splice;
|
||||
|
||||
/** Used to detect `setImmediate` in Node.js */
|
||||
var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
|
||||
!reNative.test(setImmediate) && setImmediate;
|
||||
|
||||
/** Used to set meta data on functions */
|
||||
var defineProperty = (function() {
|
||||
// IE 8 only accepts DOM elements
|
||||
@@ -2144,22 +2146,22 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the specified object `property` exists and is a direct property,
|
||||
* Checks if the specified property name exists as a direct property of `object`,
|
||||
* instead of an inherited property.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {Object} object The object to check.
|
||||
* @param {string} property The property to check for.
|
||||
* @param {Object} object The object to inspect.
|
||||
* @param {string} key The name of the property to check.
|
||||
* @returns {boolean} Returns `true` if key is a direct property, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b');
|
||||
* // => true
|
||||
*/
|
||||
function has(object, property) {
|
||||
return object ? hasOwnProperty.call(object, property) : false;
|
||||
function has(object, key) {
|
||||
return object ? hasOwnProperty.call(object, key) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2172,7 +2174,7 @@
|
||||
* @returns {Object} Returns the created inverted object.
|
||||
* @example
|
||||
*
|
||||
* _.invert({ 'first': 'fred', 'second': 'barney' });
|
||||
* _.invert({ 'first': 'fred', 'second': 'barney' });
|
||||
* // => { 'fred': 'first', 'barney': 'second' }
|
||||
*/
|
||||
function invert(object) {
|
||||
@@ -2557,6 +2559,52 @@
|
||||
return typeof value == 'undefined';
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an object with the same keys as `object` and values generated by
|
||||
* running each own enumerable property of `object` through the callback.
|
||||
* The callback is bound to `thisArg` and invoked with three arguments;
|
||||
* (value, key, object).
|
||||
*
|
||||
* If a property name is provided for `callback` the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is provided for `callback` the created "_.where" style callback
|
||||
* will return `true` for elements that have the properties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns a new object with values of the results of each `callback` execution.
|
||||
* @example
|
||||
*
|
||||
* _.mapValues({ 'a': 1, 'b': 2, 'c': 3} , function(num) { return num * 3; });
|
||||
* // => { 'a': 3, 'b': 6, 'c': 9 }
|
||||
*
|
||||
* var characters = {
|
||||
* 'fred': { 'name': 'fred', 'age': 40 },
|
||||
* 'pebbles': { 'name': 'pebbles', 'age': 1 }
|
||||
* };
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.mapValues(characters, 'age');
|
||||
* // => { 'fred': 40, 'pebbles': 1 }
|
||||
*/
|
||||
function mapValues(object, callback, thisArg) {
|
||||
var result = {};
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
|
||||
forOwn(object, function(value, key, object) {
|
||||
result[key] = callback(value, key, object);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively merges own enumerable properties of the source object(s), that
|
||||
* don't resolve to `undefined` into the destination object. Subsequent sources
|
||||
@@ -2615,7 +2663,6 @@
|
||||
if (!isObject(object)) {
|
||||
return object;
|
||||
}
|
||||
|
||||
// allows working with `_.reduce` and `_.reduceRight` without using
|
||||
// their `index` and `collection` arguments
|
||||
if (typeof args[2] != 'number') {
|
||||
@@ -2772,11 +2819,11 @@
|
||||
|
||||
/**
|
||||
* An alternative to `_.reduce` this method transforms `object` to a new
|
||||
* `accumulator` object which is the result of running each of its elements
|
||||
* through a callback, with each callback execution potentially mutating
|
||||
* the `accumulator` object. The callback is bound to `thisArg` and invoked
|
||||
* with four arguments; (accumulator, value, key, object). Callbacks may exit
|
||||
* iteration early by explicitly returning `false`.
|
||||
* `accumulator` object which is the result of running each of its own
|
||||
* enumerable properties through a callback, with each callback execution
|
||||
* potentially mutating the `accumulator` object. The callback is bound to
|
||||
* `thisArg` and invoked with four arguments; (accumulator, value, key, object).
|
||||
* Callbacks may exit iteration early by explicitly returning `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -3608,7 +3655,7 @@
|
||||
* @type Function
|
||||
* @category Collections
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {string} property The property to pluck.
|
||||
* @param {string} property The name of the property to pluck.
|
||||
* @returns {Array} Returns a new array of property values.
|
||||
* @example
|
||||
*
|
||||
@@ -3620,18 +3667,7 @@
|
||||
* _.pluck(characters, 'name');
|
||||
* // => ['barney', 'fred']
|
||||
*/
|
||||
function pluck(collection, property) {
|
||||
var index = -1,
|
||||
length = collection ? collection.length : 0;
|
||||
|
||||
if (typeof length == 'number') {
|
||||
var result = Array(length);
|
||||
while (++index < length) {
|
||||
result[index] = collection[index][property];
|
||||
}
|
||||
}
|
||||
return result || map(collection, property);
|
||||
}
|
||||
var pluck = map;
|
||||
|
||||
/**
|
||||
* Reduces a collection to a value which is the accumulated result of running
|
||||
@@ -3839,7 +3875,7 @@
|
||||
* // => 3
|
||||
*
|
||||
* _.size('pebbles');
|
||||
* // => 5
|
||||
* // => 7
|
||||
*/
|
||||
function size(collection) {
|
||||
var length = collection ? collection.length : 0;
|
||||
@@ -3919,6 +3955,9 @@
|
||||
* If a property name is provided for `callback` the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an array of property names is provided for `callback` the collection
|
||||
* will be sorted by each property value.
|
||||
*
|
||||
* If an object is provided for `callback` the created "_.where" style callback
|
||||
* will return `true` for elements that have the properties of the given object,
|
||||
* else `false`.
|
||||
@@ -3927,7 +3966,7 @@
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* @param {Array|Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
@@ -3940,19 +3979,37 @@
|
||||
* _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math);
|
||||
* // => [3, 1, 2]
|
||||
*
|
||||
* var characters = [
|
||||
* { 'name': 'barney', 'age': 36 },
|
||||
* { 'name': 'fred', 'age': 40 },
|
||||
* { 'name': 'barney', 'age': 26 },
|
||||
* { 'name': 'fred', 'age': 30 }
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.sortBy(['banana', 'strawberry', 'apple'], 'length');
|
||||
* // => ['apple', 'banana', 'strawberry']
|
||||
* _.map(_.sortBy(characters, 'age'), _.values);
|
||||
* // => [['barney', 26], ['fred', 30], ['barney', 36], ['fred', 40]]
|
||||
*
|
||||
* // sorting by multiple properties
|
||||
* _.map(_.sortBy(characters, ['name', 'age']), _.values);
|
||||
* // = > [['barney', 26], ['barney', 36], ['fred', 30], ['fred', 40]]
|
||||
*/
|
||||
function sortBy(collection, callback, thisArg) {
|
||||
var index = -1,
|
||||
isArr = isArray(callback),
|
||||
length = collection ? collection.length : 0,
|
||||
result = Array(typeof length == 'number' ? length : 0);
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
if (!isArr) {
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
}
|
||||
forEach(collection, function(value, key, collection) {
|
||||
var object = result[++index] = getObject();
|
||||
object.criteria = callback(value, key, collection);
|
||||
if (isArr) {
|
||||
object.criteria = map(callback, function(key) { return value[key]; });
|
||||
} else {
|
||||
(object.criteria = getArray())[0] = callback(value, key, collection);
|
||||
}
|
||||
object.index = index;
|
||||
object.value = value;
|
||||
});
|
||||
@@ -3962,6 +4019,9 @@
|
||||
while (length--) {
|
||||
var object = result[length];
|
||||
result[length] = object.value;
|
||||
if (!isArr) {
|
||||
releaseArray(object.criteria);
|
||||
}
|
||||
releaseObject(object);
|
||||
}
|
||||
return result;
|
||||
@@ -3997,7 +4057,7 @@
|
||||
* @type Function
|
||||
* @category Collections
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Object} properties The object of property values to filter by.
|
||||
* @param {Object} props The object of property values to filter by.
|
||||
* @returns {Array} Returns a new array of elements that have the given properties.
|
||||
* @example
|
||||
*
|
||||
@@ -4402,29 +4462,34 @@
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {...Array} [array] The arrays to inspect.
|
||||
* @returns {Array} Returns an array of composite values.
|
||||
* @returns {Array} Returns an array of shared values.
|
||||
* @example
|
||||
*
|
||||
* _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
||||
* _.intersection([1, 2, 3], [5, 2, 1, 4], [2, 1]);
|
||||
* // => [1, 2]
|
||||
*/
|
||||
function intersection(array) {
|
||||
var args = arguments,
|
||||
argsLength = args.length,
|
||||
function intersection() {
|
||||
var args = [],
|
||||
argsIndex = -1,
|
||||
argsLength = arguments.length,
|
||||
caches = getArray(),
|
||||
index = -1,
|
||||
indexOf = getIndexOf(),
|
||||
length = array ? array.length : 0,
|
||||
result = [],
|
||||
trustIndexOf = indexOf === baseIndexOf,
|
||||
seen = getArray();
|
||||
|
||||
while (++argsIndex < argsLength) {
|
||||
var value = args[argsIndex];
|
||||
caches[argsIndex] = indexOf === baseIndexOf &&
|
||||
(value ? value.length : 0) >= largeArraySize &&
|
||||
createCache(argsIndex ? args[argsIndex] : seen);
|
||||
var value = arguments[argsIndex];
|
||||
if (isArray(value) || isArguments(value)) {
|
||||
args.push(value);
|
||||
caches.push(trustIndexOf && value.length >= largeArraySize &&
|
||||
createCache(argsIndex ? args[argsIndex] : seen));
|
||||
}
|
||||
}
|
||||
var array = args[0],
|
||||
index = -1,
|
||||
length = array ? array.length : 0,
|
||||
result = [];
|
||||
|
||||
outer:
|
||||
while (++index < length) {
|
||||
var cache = caches[0];
|
||||
@@ -4841,13 +4906,13 @@
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {...Array} [array] The arrays to inspect.
|
||||
* @returns {Array} Returns an array of composite values.
|
||||
* @returns {Array} Returns an array of combined values.
|
||||
* @example
|
||||
*
|
||||
* _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
||||
* // => [1, 2, 3, 101, 10]
|
||||
* _.union([1, 2, 3], [5, 2, 1, 4], [2, 1]);
|
||||
* // => [1, 2, 3, 5, 4]
|
||||
*/
|
||||
function union(array) {
|
||||
function union() {
|
||||
return baseUniq(baseFlatten(arguments, true, true));
|
||||
}
|
||||
|
||||
@@ -4927,6 +4992,38 @@
|
||||
return baseDifference(array, slice(arguments, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array that is the smymetric difference of the provided arrays.
|
||||
* See http://en.wikipedia.org/wiki/Symmetric_difference.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {...Array} [array] The arrays to inspect.
|
||||
* @returns {Array} Returns an array of values.
|
||||
* @example
|
||||
*
|
||||
* _.xor([1, 2, 3], [5, 2, 1, 4]);
|
||||
* // => [3, 5, 4]
|
||||
*
|
||||
* _.xor([1, 2, 5], [2, 3, 5], [3, 4, 5]);
|
||||
* // => [1, 4, 5]
|
||||
*/
|
||||
function xor() {
|
||||
var index = -1,
|
||||
length = arguments.length;
|
||||
|
||||
while (++index < length) {
|
||||
var array = arguments[index];
|
||||
if (isArray(array) || isArguments(array)) {
|
||||
var result = result
|
||||
? baseUniq(baseDifference(result, array).concat(baseDifference(array, result)))
|
||||
: array;
|
||||
}
|
||||
}
|
||||
return result || [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array of grouped elements, the first of which contains the first
|
||||
* elements of the given arrays, the second of which contains the second
|
||||
@@ -4978,6 +5075,9 @@
|
||||
length = keys ? keys.length : 0,
|
||||
result = {};
|
||||
|
||||
if (!values && length && !isArray(keys[0])) {
|
||||
values = [];
|
||||
}
|
||||
while (++index < length) {
|
||||
var key = keys[index];
|
||||
if (values) {
|
||||
@@ -5070,8 +5170,8 @@
|
||||
* @example
|
||||
*
|
||||
* var view = {
|
||||
* 'label': 'docs',
|
||||
* 'onClick': function() { console.log('clicked ' + this.label); }
|
||||
* 'label': 'docs',
|
||||
* 'onClick': function() { console.log('clicked ' + this.label); }
|
||||
* };
|
||||
*
|
||||
* _.bindAll(view);
|
||||
@@ -5180,74 +5280,6 @@
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces a callback bound to an optional `thisArg`. If `func` is a property
|
||||
* name the created callback will return the property value for a given element.
|
||||
* If `func` is an object the created callback will return `true` for elements
|
||||
* that contain the equivalent object properties, otherwise it will return `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Functions
|
||||
* @param {*} [func=identity] The value to convert to a callback.
|
||||
* @param {*} [thisArg] The `this` binding of the created callback.
|
||||
* @param {number} [argCount] The number of arguments the callback accepts.
|
||||
* @returns {Function} Returns a callback function.
|
||||
* @example
|
||||
*
|
||||
* var characters = [
|
||||
* { 'name': 'barney', 'age': 36 },
|
||||
* { 'name': 'fred', 'age': 40 }
|
||||
* ];
|
||||
*
|
||||
* // wrap to create custom callback shorthands
|
||||
* _.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) {
|
||||
* var match = /^(.+?)__([gl]t)(.+)$/.exec(callback);
|
||||
* return !match ? func(callback, thisArg) : function(object) {
|
||||
* return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3];
|
||||
* };
|
||||
* });
|
||||
*
|
||||
* _.filter(characters, 'age__gt38');
|
||||
* // => [{ 'name': 'fred', 'age': 40 }]
|
||||
*/
|
||||
function createCallback(func, thisArg, argCount) {
|
||||
var type = typeof func;
|
||||
if (func == null || type == 'function') {
|
||||
return baseCreateCallback(func, thisArg, argCount);
|
||||
}
|
||||
// handle "_.pluck" style callback shorthands
|
||||
if (type != 'object') {
|
||||
return function(object) {
|
||||
return object[func];
|
||||
};
|
||||
}
|
||||
var props = keys(func),
|
||||
key = props[0],
|
||||
a = func[key];
|
||||
|
||||
// handle "_.where" style callback shorthands
|
||||
if (props.length == 1 && a === a && !isObject(a)) {
|
||||
// fast path the common case of providing an object with a single
|
||||
// property containing a primitive value
|
||||
return function(object) {
|
||||
var b = object[key];
|
||||
return a === b && (a !== 0 || (1 / a == 1 / b));
|
||||
};
|
||||
}
|
||||
return function(object) {
|
||||
var length = props.length,
|
||||
result = false;
|
||||
|
||||
while (length--) {
|
||||
if (!(result = baseIsEqual(object[props[length]], func[props[length]], null, true))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function which accepts one or more arguments of `func` that when
|
||||
* invoked either executes `func` returning its result, if all `func` arguments
|
||||
@@ -5433,8 +5465,8 @@
|
||||
* @returns {number} Returns the timer id.
|
||||
* @example
|
||||
*
|
||||
* _.defer(function() { console.log('deferred'); });
|
||||
* // returns from the function before 'deferred' is logged
|
||||
* _.defer(function(text) { console.log(text); }, 'deferred');
|
||||
* // logs 'deferred' after one or more milliseconds
|
||||
*/
|
||||
function defer(func) {
|
||||
if (!isFunction(func)) {
|
||||
@@ -5443,15 +5475,6 @@
|
||||
var args = slice(arguments, 1);
|
||||
return setTimeout(function() { func.apply(undefined, args); }, 1);
|
||||
}
|
||||
// use `setImmediate` if available in Node.js
|
||||
if (setImmediate) {
|
||||
defer = function(func) {
|
||||
if (!isFunction(func)) {
|
||||
throw new TypeError;
|
||||
}
|
||||
return setImmediate.apply(context, arguments);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes the `func` function after `wait` milliseconds. Additional arguments
|
||||
@@ -5466,9 +5489,8 @@
|
||||
* @returns {number} Returns the timer id.
|
||||
* @example
|
||||
*
|
||||
* var log = _.bind(console.log, console);
|
||||
* _.delay(log, 1000, 'logged later');
|
||||
* // => 'logged later' (Appears after one second.)
|
||||
* _.delay(function(text) { console.log(text); }, 1000, 'later');
|
||||
* // => logs 'later' after one second
|
||||
*/
|
||||
function delay(func, wait) {
|
||||
if (!isFunction(func)) {
|
||||
@@ -5699,6 +5721,93 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a function that returns `value`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {*} value The value to return from the new function.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* var object = { 'name': 'fred' };
|
||||
* var getter = _.constant(object);
|
||||
* getter() === object;
|
||||
* // => true
|
||||
*/
|
||||
function constant(value) {
|
||||
return function() {
|
||||
return value;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces a callback bound to an optional `thisArg`. If `func` is a property
|
||||
* name the created callback will return the property value for a given element.
|
||||
* If `func` is an object the created callback will return `true` for elements
|
||||
* that contain the equivalent object properties, otherwise it will return `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {*} [func=identity] The value to convert to a callback.
|
||||
* @param {*} [thisArg] The `this` binding of the created callback.
|
||||
* @param {number} [argCount] The number of arguments the callback accepts.
|
||||
* @returns {Function} Returns a callback function.
|
||||
* @example
|
||||
*
|
||||
* var characters = [
|
||||
* { 'name': 'barney', 'age': 36 },
|
||||
* { 'name': 'fred', 'age': 40 }
|
||||
* ];
|
||||
*
|
||||
* // wrap to create custom callback shorthands
|
||||
* _.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) {
|
||||
* var match = /^(.+?)__([gl]t)(.+)$/.exec(callback);
|
||||
* return !match ? func(callback, thisArg) : function(object) {
|
||||
* return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3];
|
||||
* };
|
||||
* });
|
||||
*
|
||||
* _.filter(characters, 'age__gt38');
|
||||
* // => [{ 'name': 'fred', 'age': 40 }]
|
||||
*/
|
||||
function createCallback(func, thisArg, argCount) {
|
||||
var type = typeof func;
|
||||
if (func == null || type == 'function') {
|
||||
return baseCreateCallback(func, thisArg, argCount);
|
||||
}
|
||||
// handle "_.pluck" style callback shorthands
|
||||
if (type != 'object') {
|
||||
return property(func);
|
||||
}
|
||||
var props = keys(func),
|
||||
key = props[0],
|
||||
a = func[key];
|
||||
|
||||
// handle "_.where" style callback shorthands
|
||||
if (props.length == 1 && a === a && !isObject(a)) {
|
||||
// fast path the common case of providing an object with a single
|
||||
// property containing a primitive value
|
||||
return function(object) {
|
||||
var b = object[key];
|
||||
return a === b && (a !== 0 || (1 / a == 1 / b));
|
||||
};
|
||||
}
|
||||
return function(object) {
|
||||
var length = props.length,
|
||||
result = false;
|
||||
|
||||
while (length--) {
|
||||
if (!(result = baseIsEqual(object[props[length]], func[props[length]], null, true))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their
|
||||
* corresponding HTML entities.
|
||||
@@ -5736,51 +5845,71 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds function properties of a source object to the `lodash` function and
|
||||
* chainable wrapper.
|
||||
* Adds function properties of a source object to the destination object.
|
||||
* If `object` is a function methods will be added to its prototype as well.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {Object} object The object of function properties to add to `lodash`.
|
||||
* @param {Object} object The object of function properties to add to `lodash`.
|
||||
* @param {Function|Object} [object=lodash] object The destination object.
|
||||
* @param {Object} source The object of functions to add.
|
||||
* @param {Object} [options] The options object.
|
||||
* @param {boolean} [options.chain=true] Specify whether the functions added are chainable.
|
||||
* @example
|
||||
*
|
||||
* _.mixin({
|
||||
* 'capitalize': function(string) {
|
||||
* return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
|
||||
* }
|
||||
* });
|
||||
* function capitalize(string) {
|
||||
* return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
|
||||
* }
|
||||
*
|
||||
* _.mixin({ 'capitalize': capitalize });
|
||||
* _.capitalize('fred');
|
||||
* // => 'Fred'
|
||||
*
|
||||
* _('fred').capitalize().value();
|
||||
* // => 'Fred'
|
||||
*
|
||||
* _.mixin({ 'capitalize': capitalize }, { 'chain': false });
|
||||
* _('fred').capitalize();
|
||||
* // => 'Fred'
|
||||
*/
|
||||
function mixin(object, source) {
|
||||
var ctor = object,
|
||||
isFunc = !source || isFunction(ctor);
|
||||
function mixin(object, source, options) {
|
||||
var chain = true,
|
||||
methodNames = source && functions(source);
|
||||
|
||||
if (!source) {
|
||||
if (!source || (!options && !methodNames.length)) {
|
||||
if (options == null) {
|
||||
options = source;
|
||||
}
|
||||
ctor = lodashWrapper;
|
||||
source = object;
|
||||
object = lodash;
|
||||
methodNames = functions(source);
|
||||
}
|
||||
forEach(functions(source), function(methodName) {
|
||||
if (options === false) {
|
||||
chain = false;
|
||||
} else if (isObject(options) && 'chain' in options) {
|
||||
chain = options.chain;
|
||||
}
|
||||
var ctor = object,
|
||||
isFunc = isFunction(ctor);
|
||||
|
||||
forEach(methodNames, function(methodName) {
|
||||
var func = object[methodName] = source[methodName];
|
||||
if (isFunc) {
|
||||
ctor.prototype[methodName] = function() {
|
||||
var value = this.__wrapped__,
|
||||
var chainAll = this.__chain__,
|
||||
value = this.__wrapped__,
|
||||
args = [value];
|
||||
|
||||
push.apply(args, arguments);
|
||||
var result = func.apply(object, args);
|
||||
if (value && typeof value == 'object' && value === result) {
|
||||
return this;
|
||||
if (chain || chainAll) {
|
||||
if (value === result && isObject(result)) {
|
||||
return this;
|
||||
}
|
||||
result = new ctor(result);
|
||||
result.__chain__ = chainAll;
|
||||
}
|
||||
result = new ctor(result);
|
||||
result.__chain__ = this.__chain__;
|
||||
return result;
|
||||
};
|
||||
}
|
||||
@@ -5820,6 +5949,23 @@
|
||||
// no operation performed
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the number of milliseconds that have elapsed since the Unix epoch
|
||||
* (1 January 1970 00:00:00 UTC).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @example
|
||||
*
|
||||
* var stamp = _.now();
|
||||
* _.defer(function() { console.log(_.now() - stamp); });
|
||||
* // => logs the number of milliseconds it took for the deferred function to be called
|
||||
*/
|
||||
var now = reNative.test(now = Date.now) && now || function() {
|
||||
return new Date().getTime();
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts the given value into an integer of the specified radix.
|
||||
* If `radix` is `undefined` or `0` a `radix` of `10` is used unless the
|
||||
@@ -5844,6 +5990,36 @@
|
||||
return nativeParseInt(isString(value) ? value.replace(reLeadingSpacesAndZeros, '') : value, radix || 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a "_.pluck" style function, which returns the `key` value of a
|
||||
* given object.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {string} key The name of the property to retrieve.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* var characters = [
|
||||
* { 'name': 'fred', 'age': 40 },
|
||||
* { 'name': 'barney', 'age': 36 }
|
||||
* ];
|
||||
*
|
||||
* var getName = _.property('name');
|
||||
*
|
||||
* _.map(characters, getName);
|
||||
* // => ['barney', 'fred']
|
||||
*
|
||||
* _.sortBy(characters, getName);
|
||||
* // => [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }]
|
||||
*/
|
||||
function property(key) {
|
||||
return function(object) {
|
||||
return object[key];
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces a random number between `min` and `max` (inclusive). If only one
|
||||
* argument is provided a number between `0` and the given number will be
|
||||
@@ -5903,7 +6079,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the value of `property` on `object`. If `property` is a function
|
||||
* Resolves the value of property `key` on `object`. If `key` is a function
|
||||
* it will be invoked with the `this` binding of `object` and its result returned,
|
||||
* else the property value is returned. If `object` is falsey then `undefined`
|
||||
* is returned.
|
||||
@@ -5912,7 +6088,7 @@
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {Object} object The object to inspect.
|
||||
* @param {string} property The property to get the value of.
|
||||
* @param {string} key The name of the property to resolve.
|
||||
* @returns {*} Returns the resolved value.
|
||||
* @example
|
||||
*
|
||||
@@ -5929,10 +6105,10 @@
|
||||
* _.result(object, 'stuff');
|
||||
* // => 'nonsense'
|
||||
*/
|
||||
function result(object, property) {
|
||||
function result(object, key) {
|
||||
if (object) {
|
||||
var value = object[property];
|
||||
return isFunction(value) ? object[property]() : value;
|
||||
var value = object[key];
|
||||
return isFunction(value) ? object[key]() : value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5996,8 +6172,8 @@
|
||||
* // => 'hello mustache!'
|
||||
*
|
||||
* // using the `imports` option to import jQuery
|
||||
* var list = '<% $.each(people, function(name) { %><li><%- name %></li><% }); %>';
|
||||
* _.template(list, { 'people': ['fred', 'barney'] }, { 'imports': { '$': jQuery } });
|
||||
* var list = '<% jq.each(people, function(name) { %><li><%- name %></li><% }); %>';
|
||||
* _.template(list, { 'people': ['fred', 'barney'] }, { 'imports': { 'jq': jQuery } });
|
||||
* // => '<li>fred</li><li>barney</li>'
|
||||
*
|
||||
* // using the `sourceURL` option to specify a custom sourceURL for the template
|
||||
@@ -6276,7 +6452,7 @@
|
||||
* _(characters).chain()
|
||||
* .first()
|
||||
* .pick('age')
|
||||
* .value()
|
||||
* .value();
|
||||
* // => { 'age': 36 }
|
||||
*/
|
||||
function wrapperChain() {
|
||||
@@ -6329,6 +6505,7 @@
|
||||
lodash.chain = chain;
|
||||
lodash.compact = compact;
|
||||
lodash.compose = compose;
|
||||
lodash.constant = constant;
|
||||
lodash.countBy = countBy;
|
||||
lodash.create = create;
|
||||
lodash.createCallback = createCallback;
|
||||
@@ -6355,6 +6532,7 @@
|
||||
lodash.invoke = invoke;
|
||||
lodash.keys = keys;
|
||||
lodash.map = map;
|
||||
lodash.mapValues = mapValues;
|
||||
lodash.max = max;
|
||||
lodash.memoize = memoize;
|
||||
lodash.merge = merge;
|
||||
@@ -6366,6 +6544,7 @@
|
||||
lodash.partialRight = partialRight;
|
||||
lodash.pick = pick;
|
||||
lodash.pluck = pluck;
|
||||
lodash.property = property;
|
||||
lodash.pull = pull;
|
||||
lodash.range = range;
|
||||
lodash.reject = reject;
|
||||
@@ -6384,6 +6563,7 @@
|
||||
lodash.where = where;
|
||||
lodash.without = without;
|
||||
lodash.wrap = wrap;
|
||||
lodash.xor = xor;
|
||||
lodash.zip = zip;
|
||||
lodash.zipObject = zipObject;
|
||||
|
||||
@@ -6441,6 +6621,7 @@
|
||||
lodash.mixin = mixin;
|
||||
lodash.noConflict = noConflict;
|
||||
lodash.noop = noop;
|
||||
lodash.now = now;
|
||||
lodash.parseInt = parseInt;
|
||||
lodash.random = random;
|
||||
lodash.reduce = reduce;
|
||||
@@ -6464,20 +6645,15 @@
|
||||
lodash.include = contains;
|
||||
lodash.inject = reduce;
|
||||
|
||||
forOwn(lodash, function(func, methodName) {
|
||||
if (!lodash.prototype[methodName]) {
|
||||
lodash.prototype[methodName] = function() {
|
||||
var args = [this.__wrapped__],
|
||||
chainAll = this.__chain__;
|
||||
|
||||
push.apply(args, arguments);
|
||||
var result = func.apply(lodash, args);
|
||||
return chainAll
|
||||
? new lodashWrapper(result, chainAll)
|
||||
: result;
|
||||
};
|
||||
}
|
||||
});
|
||||
mixin(function() {
|
||||
var source = {}
|
||||
forOwn(lodash, function(func, methodName) {
|
||||
if (!lodash.prototype[methodName]) {
|
||||
source[methodName] = func;
|
||||
}
|
||||
});
|
||||
return source;
|
||||
}(), false);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
@@ -6513,7 +6689,7 @@
|
||||
* @memberOf _
|
||||
* @type string
|
||||
*/
|
||||
lodash.VERSION = '2.3.0';
|
||||
lodash.VERSION = '2.4.0';
|
||||
|
||||
// add "Chaining" functions to the wrapper
|
||||
lodash.prototype.chain = wrapperChain;
|
||||
@@ -6534,7 +6710,7 @@
|
||||
};
|
||||
});
|
||||
|
||||
// add `Array` functions that return the wrapped value
|
||||
// add `Array` functions that return the existing wrapped value
|
||||
forEach(['push', 'reverse', 'sort', 'unshift'], function(methodName) {
|
||||
var func = arrayRef[methodName];
|
||||
lodash.prototype[methodName] = function() {
|
||||
@@ -6562,9 +6738,8 @@
|
||||
// some AMD build optimizers like r.js check for condition patterns like the following:
|
||||
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
|
||||
// Expose Lo-Dash to the global object even when an AMD loader is present in
|
||||
// case Lo-Dash was injected by a third-party script and not intended to be
|
||||
// loaded as a module. The global assignment can be reverted in the Lo-Dash
|
||||
// module by its `noConflict()` method.
|
||||
// case Lo-Dash is loaded with a RequireJS shim config.
|
||||
// See http://requirejs.org/docs/api.html#config-shim
|
||||
root._ = _;
|
||||
|
||||
// define as an anonymous module so, through path mapping, it can be
|
||||
|
||||
98
dist/lodash.min.js
vendored
98
dist/lodash.min.js
vendored
@@ -1,55 +1,55 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 2.3.0 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
|
||||
* Lo-Dash 2.4.0 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
|
||||
* Build: `lodash modern -o ./dist/lodash.js`
|
||||
*/
|
||||
;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function t(t,e){var r=typeof e;if(t=t.l,"boolean"==r||null==e)return t[e]?0:-1;"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:m+e;return t=(t=t[r])&&t[u],"object"==r?t&&-1<n(t,e)?0:-1:t?0:-1}function e(n){var t=this.l,e=typeof n;if("boolean"==e||null==n)t[n]=true;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:m+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=true
|
||||
}}function r(n){return n.charCodeAt(0)}function u(n,t){var e=n.m,r=t.m;if(e!==r){if(e>r||typeof e=="undefined")return 1;if(e<r||typeof r=="undefined")return-1}return n.n-t.n}function o(n){var t=-1,r=n.length,u=n[0],o=n[r/2|0],i=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&i&&typeof i=="object")return false;for(u=f(),u["false"]=u["null"]=u["true"]=u.undefined=false,o=f(),o.k=n,o.l=u,o.push=e;++t<r;)o.push(n[t]);return o}function i(n){return"\\"+V[n]}function a(){return h.pop()||[]}function f(){return g.pop()||{k:null,l:null,m:null,"false":false,n:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,o:null}
|
||||
}function l(n){n.length=0,h.length<b&&h.push(n)}function c(n){var t=n.l;t&&c(t),n.k=n.l=n.m=n.object=n.number=n.string=n.o=null,g.length<b&&g.push(n)}function p(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function s(e){function h(n){if(!n||ve.call(n)!=q)return false;var t=n.valueOf,e=typeof t=="function"&&(e=be(t))&&be(e);return e?n==e||be(n)==e:yt(n)}function g(n,t,e){if(!n||!U[typeof n])return n;t=t&&typeof e=="undefined"?t:ut(t,e,3);
|
||||
for(var r=-1,u=U[typeof n]&&ze(n),o=u?u.length:0;++r<o&&(e=u[r],false!==t(n[e],e,n)););return n}function b(n,t,e){var r;if(!n||!U[typeof n])return n;t=t&&typeof e=="undefined"?t:ut(t,e,3);for(r in n)if(false===t(n[r],r,n))break;return n}function V(n,t,e){var r,u=n,o=u;if(!u)return o;for(var i=arguments,a=0,f=typeof e=="number"?2:i.length;++a<f;)if((u=i[a])&&U[typeof u])for(var l=-1,c=U[typeof u]&&ze(u),p=c?c.length:0;++l<p;)r=c[l],"undefined"==typeof o[r]&&(o[r]=u[r]);return o}function H(n,t,e){var r,u=n,o=u;
|
||||
if(!u)return o;var i=arguments,a=0,f=typeof e=="number"?2:i.length;if(3<f&&"function"==typeof i[f-2])var l=ut(i[--f-1],i[f--],2);else 2<f&&"function"==typeof i[f-1]&&(l=i[--f]);for(;++a<f;)if((u=i[a])&&U[typeof u])for(var c=-1,p=U[typeof u]&&ze(u),s=p?p.length:0;++c<s;)r=p[c],o[r]=l?l(o[r],u[r]):u[r];return o}function J(n){var t,e=[];if(!n||!U[typeof n])return e;for(t in n)de.call(n,t)&&e.push(t);return e}function Z(n){return n&&typeof n=="object"&&!qe(n)&&de.call(n,"__wrapped__")?n:new nt(n)}function nt(n,t){this.__chain__=!!t,this.__wrapped__=n
|
||||
}function tt(n){function t(){if(r){var n=r.slice();je.apply(n,arguments)}if(this instanceof t){var o=rt(e.prototype),n=e.apply(o,n||arguments);return kt(n)?n:o}return e.apply(u,n||arguments)}var e=n[0],r=n[2],u=n[4];return We(t,n),t}function et(n,t,e,r,u){if(e){var o=e(n);if(typeof o!="undefined")return o}if(!kt(n))return n;var i=ve.call(n);if(!K[i])return n;var f=Te[i];switch(i){case F:case T:return new f(+n);case W:case P:return new f(n);case z:return o=f(n.source,C.exec(n)),o.lastIndex=n.lastIndex,o
|
||||
}if(i=qe(n),t){var c=!r;r||(r=a()),u||(u=a());for(var s=r.length;s--;)if(r[s]==n)return u[s];o=i?f(n.length):{}}else o=i?p(n):H({},n);return i&&(de.call(n,"index")&&(o.index=n.index),de.call(n,"input")&&(o.input=n.input)),t?(r.push(n),u.push(o),(i?Rt:g)(n,function(n,i){o[i]=et(n,t,e,r,u)}),c&&(l(r),l(u)),o):o}function rt(n){return kt(n)?Ie(n):{}}function ut(n,t,e){if(typeof n!="function")return Qt;if(typeof t=="undefined"||!("prototype"in n))return n;var r=n.__bindData__;if(typeof r=="undefined"&&(Be.funcNames&&(r=!n.name),r=r||!Be.funcDecomp,!r)){var u=_e.call(n);
|
||||
Be.funcNames||(r=!O.test(u)),r||(r=E.test(u),We(n,r))}if(false===r||true!==r&&1&r[1])return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,o){return n.call(t,e,r,u,o)}}return Gt(n,t)}function ot(n){function t(){var n=f?i:this;if(u){var h=u.slice();je.apply(h,arguments)}return(o||c)&&(h||(h=p(arguments)),o&&je.apply(h,o),c&&h.length<a)?(r|=16,ot([e,s?r:-4&r,h,null,i,a])):(h||(h=arguments),l&&(e=n[v]),this instanceof t?(n=rt(e.prototype),h=e.apply(n,h),kt(h)?h:n):e.apply(n,h))
|
||||
}var e=n[0],r=n[1],u=n[2],o=n[3],i=n[4],a=n[5],f=1&r,l=2&r,c=4&r,s=8&r,v=e;return We(t,n),t}function it(e,r){var u=-1,i=gt(),a=e?e.length:0,f=a>=_&&i===n,l=[];if(f){var p=o(r);p?(i=t,r=p):f=false}for(;++u<a;)p=e[u],0>i(r,p)&&l.push(p);return f&&c(r),l}function at(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r<u;){var i=n[r];if(i&&typeof i=="object"&&typeof i.length=="number"&&(qe(i)||_t(i))){t||(i=at(i,t,e));var a=-1,f=i.length,l=o.length;for(o.length+=f;++a<f;)o[l++]=i[a]}else e||o.push(i)}return o
|
||||
}function ft(n,t,e,r,u,o){if(e){var i=e(n,t);if(typeof i!="undefined")return!!i}if(n===t)return 0!==n||1/n==1/t;if(n===n&&!(n&&U[typeof n]||t&&U[typeof t]))return false;if(null==n||null==t)return n===t;var f=ve.call(n),c=ve.call(t);if(f==D&&(f=q),c==D&&(c=q),f!=c)return false;switch(f){case F:case T:return+n==+t;case W:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case z:case P:return n==fe(t)}if(c=f==$,!c){var p=de.call(n,"__wrapped__"),s=de.call(t,"__wrapped__");if(p||s)return ft(p?n.__wrapped__:n,s?t.__wrapped__:t,e,r,u,o);
|
||||
if(f!=q)return false;if(f=n.constructor,p=t.constructor,f!=p&&!(jt(f)&&f instanceof f&&jt(p)&&p instanceof p)&&"constructor"in n&&"constructor"in t)return false}for(p=!u,u||(u=a()),o||(o=a()),f=u.length;f--;)if(u[f]==n)return o[f]==t;var v=0,i=true;if(u.push(n),o.push(t),c){if(f=n.length,v=t.length,i=v==n.length,!i&&!r)return i;for(;v--;)if(c=f,p=t[v],r)for(;c--&&!(i=ft(n[c],p,e,r,u,o)););else if(!(i=ft(n[v],p,e,r,u,o)))break;return i}return b(t,function(t,a,f){return de.call(f,a)?(v++,i=de.call(n,a)&&ft(n[a],t,e,r,u,o)):void 0
|
||||
}),i&&!r&&b(n,function(n,t,e){return de.call(e,t)?i=-1<--v:void 0}),p&&(l(u),l(o)),i}function lt(n,t,e,r,u){(qe(t)?Rt:g)(t,function(t,o){var i,a,f=t,l=n[o];if(t&&((a=qe(t))||h(t))){for(f=r.length;f--;)if(i=r[f]==t){l=u[f];break}if(!i){var c;e&&(f=e(l,t),c=typeof f!="undefined")&&(l=f),c||(l=a?qe(l)?l:[]:h(l)?l:{}),r.push(t),u.push(l),c||lt(l,t,e,r,u)}}else e&&(f=e(l,t),typeof f=="undefined"&&(f=t)),typeof f!="undefined"&&(l=f);n[o]=l})}function ct(n,t){return n+me(Fe()*(t-n+1))}function pt(e,r,u){var i=-1,f=gt(),p=e?e.length:0,s=[],v=!r&&p>=_&&f===n,h=u||v?a():s;
|
||||
if(v){var g=o(h);g?(f=t,h=g):(v=false,h=u?h:(l(h),s))}for(;++i<p;){var g=e[i],y=u?u(g,i,e):g;(r?!i||h[h.length-1]!==y:0>f(h,y))&&((u||v)&&h.push(y),s.push(g))}return v?(l(h.k),c(h)):u&&l(h),s}function st(n){return function(t,e,r){var u={};e=Z.createCallback(e,r,3),r=-1;var o=t?t.length:0;if(typeof o=="number")for(;++r<o;){var i=t[r];n(u,i,e(i,r,t),t)}else g(t,function(t,r,o){n(u,t,e(t,r,o),o)});return u}}function vt(n,t,e,r,u,o){var i=1&t,a=4&t,f=16&t,l=32&t;if(!(2&t||jt(n)))throw new le;f&&!e.length&&(t&=-17,f=e=false),l&&!r.length&&(t&=-33,l=r=false);
|
||||
var c=n&&n.__bindData__;return c&&true!==c?(c=c.slice(),!i||1&c[1]||(c[4]=u),!i&&1&c[1]&&(t|=8),!a||4&c[1]||(c[5]=o),f&&je.apply(c[2]||(c[2]=[]),e),l&&je.apply(c[3]||(c[3]=[]),r),c[1]|=t,vt.apply(null,c)):(1==t||17===t?tt:ot)([n,t,e,r,u,o])}function ht(n){return Pe[n]}function gt(){var t=(t=Z.indexOf)===Pt?n:t;return t}function yt(n){var t,e;return n&&ve.call(n)==q&&(t=n.constructor,!jt(t)||t instanceof t)?(b(n,function(n,t){e=t}),typeof e=="undefined"||de.call(n,e)):false}function mt(n){return Ke[n]}function _t(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ve.call(n)==D||false
|
||||
}function bt(n,t,e){var r=ze(n),u=r.length;for(t=ut(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function dt(n){var t=[];return b(n,function(n,e){jt(n)&&t.push(e)}),t.sort()}function wt(n){for(var t=-1,e=ze(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function jt(n){return typeof n=="function"}function kt(n){return!(!n||!U[typeof n])}function xt(n){return typeof n=="number"||n&&typeof n=="object"&&ve.call(n)==W||false}function Ct(n){return typeof n=="string"||n&&typeof n=="object"&&ve.call(n)==P||false
|
||||
}function Ot(n){for(var t=-1,e=ze(n),r=e.length,u=ne(r);++t<r;)u[t]=n[e[t]];return u}function It(n,t,e){var r=-1,u=gt(),o=n?n.length:0,i=false;return e=(0>e?Ae(0,o+e):e)||0,qe(n)?i=-1<u(n,t,e):typeof o=="number"?i=-1<(Ct(n)?n.indexOf(t,e):u(n,t,e)):g(n,function(n){return++r<e?void 0:!(i=n===t)}),i}function Nt(n,t,e){var r=true;t=Z.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&(r=!!t(n[e],e,n)););else g(n,function(n,e,u){return r=!!t(n,e,u)});return r}function St(n,t,e){var r=[];
|
||||
t=Z.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}else g(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function Et(n,t,e){t=Z.createCallback(t,e,3),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return g(n,function(n,e,r){return t(n,e,r)?(u=n,false):void 0}),u}for(;++e<r;){var o=n[e];if(t(o,e,n))return o}}function Rt(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:ut(t,e,3),typeof u=="number")for(;++r<u&&false!==t(n[r],r,n););else g(n,t);
|
||||
return n}function At(n,t,e){var r=n?n.length:0;if(t=t&&typeof e=="undefined"?t:ut(t,e,3),typeof r=="number")for(;r--&&false!==t(n[r],r,n););else{var u=ze(n),r=u.length;g(n,function(n,e,o){return e=u?u[--r]:--r,t(o[e],e,o)})}return n}function Dt(n,t,e){var r=-1,u=n?n.length:0;if(t=Z.createCallback(t,e,3),typeof u=="number")for(var o=ne(u);++r<u;)o[r]=t(n[r],r,n);else o=[],g(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function $t(n,t,e){var u=-1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&qe(n)){e=-1;
|
||||
for(var i=n.length;++e<i;){var a=n[e];a>o&&(o=a)}}else t=null==t&&Ct(n)?r:Z.createCallback(t,e,3),Rt(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Ft(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=ne(r);++e<r;)u[e]=n[e][t];return u||Dt(n,t)}function Tt(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=Z.createCallback(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n);else g(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)});return e
|
||||
}function Bt(n,t,e,r){var u=3>arguments.length;return t=Z.createCallback(t,r,4),At(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function Wt(n){var t=-1,e=n?n.length:0,r=ne(typeof e=="number"?e:0);return Rt(n,function(n){var e=ct(0,++t);r[t]=r[e],r[e]=n}),r}function qt(n,t,e){var r;t=Z.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else g(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function zt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;
|
||||
for(t=Z.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[0]:v;return p(n,0,De(Ae(0,r),u))}function Pt(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?Ae(0,u+r):r||0}else if(r)return r=Lt(t,e),t[r]===e?r:-1;return n(t,e,r)}function Kt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=Z.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Ae(0,t);return p(n,r)}function Lt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?Z.createCallback(e,r,1):Qt,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;
|
||||
return u}function Mt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(e=Z.createCallback(e,r,3)),pt(n,t,e)}function Ut(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?$t(Ft(n,"length")):0,r=ne(0>e?0:e);++t<e;)r[t]=Ft(n,t);return r}function Vt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function Gt(n,t){return 2<arguments.length?vt(n,17,p(arguments,2),null,t):vt(n,1,null,null,t)
|
||||
}function Ht(n,t,e){function r(){c&&ye(c),i=c=p=v,(g||h!==t)&&(s=we(),a=n.apply(l,o),c||i||(o=l=null))}function u(){var e=t-(we()-f);0<e?c=ke(u,e):(i&&ye(i),e=p,i=c=p=v,e&&(s=we(),a=n.apply(l,o),c||i||(o=l=null)))}var o,i,a,f,l,c,p,s=0,h=false,g=true;if(!jt(n))throw new le;if(t=Ae(0,t)||0,true===e)var y=true,g=false;else kt(e)&&(y=e.leading,h="maxWait"in e&&(Ae(t,e.maxWait)||0),g="trailing"in e?e.trailing:g);return function(){if(o=arguments,f=we(),l=this,p=g&&(c||!y),false===h)var e=y&&!c;else{i||y||(s=f);var v=h-(f-s),m=0>=v;
|
||||
m?(i&&(i=ye(i)),s=f,a=n.apply(l,o)):i||(i=ke(r,v))}return m&&c?c=ye(c):c||t===h||(c=ke(u,t)),e&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a}}function Jt(n){if(!jt(n))throw new le;var t=p(arguments,1);return ke(function(){n.apply(v,t)},1)}function Qt(n){return n}function Xt(n,t){var e=n,r=!t||jt(e);t||(e=nt,t=n,n=Z),Rt(dt(t),function(u){var o=n[u]=t[u];r&&(e.prototype[u]=function(){var t=this.__wrapped__,r=[t];return je.apply(r,arguments),r=o.apply(n,r),t&&typeof t=="object"&&t===r?this:(r=new e(r),r.__chain__=this.__chain__,r)
|
||||
})})}function Yt(){}function Zt(){return this.__wrapped__}e=e?Y.defaults(G.Object(),e,Y.pick(G,A)):G;var ne=e.Array,te=e.Boolean,ee=e.Date,re=e.Function,ue=e.Math,oe=e.Number,ie=e.Object,ae=e.RegExp,fe=e.String,le=e.TypeError,ce=[],pe=ie.prototype,se=e._,ve=pe.toString,he=ae("^"+fe(ve).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),ge=ue.ceil,ye=e.clearTimeout,me=ue.floor,_e=re.prototype.toString,be=he.test(be=ie.getPrototypeOf)&&be,de=pe.hasOwnProperty,we=he.test(we=ee.now)&&we||function(){return+new ee
|
||||
},je=ce.push,ke=e.setTimeout,xe=ce.splice,Ce=typeof(Ce=X&&Q&&X.setImmediate)=="function"&&!he.test(Ce)&&Ce,Oe=function(){try{var n={},t=he.test(t=ie.defineProperty)&&t,e=t(n,n,n)&&t}catch(r){}return e}(),Ie=he.test(Ie=ie.create)&&Ie,Ne=he.test(Ne=ne.isArray)&&Ne,Se=e.isFinite,Ee=e.isNaN,Re=he.test(Re=ie.keys)&&Re,Ae=ue.max,De=ue.min,$e=e.parseInt,Fe=ue.random,Te={};Te[$]=ne,Te[F]=te,Te[T]=ee,Te[B]=re,Te[q]=ie,Te[W]=oe,Te[z]=ae,Te[P]=fe,nt.prototype=Z.prototype;var Be=Z.support={};Be.funcDecomp=!he.test(e.a)&&E.test(s),Be.funcNames=typeof re.name=="string",Z.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:I,variable:"",imports:{_:Z}},Ie||(rt=function(){function n(){}return function(t){if(kt(t)){n.prototype=t;
|
||||
var r=new n;n.prototype=null}return r||e.Object()}}());var We=Oe?function(n,t){M.value=t,Oe(n,"__bindData__",M)}:Yt,qe=Ne||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ve.call(n)==$||false},ze=Re?function(n){return kt(n)?Re(n):[]}:J,Pe={"&":"&","<":"<",">":">",'"':""","'":"'"},Ke=wt(Pe),Le=ae("("+ze(Ke).join("|")+")","g"),Me=ae("["+ze(Pe).join("")+"]","g"),Ue=st(function(n,t,e){de.call(n,e)?n[e]++:n[e]=1}),Ve=st(function(n,t,e){(de.call(n,e)?n[e]:n[e]=[]).push(t)
|
||||
}),Ge=st(function(n,t,e){n[e]=t});Ce&&(Jt=function(n){if(!jt(n))throw new le;return Ce.apply(e,arguments)});var He=8==$e(d+"08")?$e:function(n,t){return $e(Ct(n)?n.replace(N,""):n,t||0)};return Z.after=function(n,t){if(!jt(t))throw new le;return function(){return 1>--n?t.apply(this,arguments):void 0}},Z.assign=H,Z.at=function(n){for(var t=arguments,e=-1,r=at(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=ne(t);++e<t;)u[e]=n[r[e]];return u},Z.bind=Gt,Z.bindAll=function(n){for(var t=1<arguments.length?at(arguments,true,false,1):dt(n),e=-1,r=t.length;++e<r;){var u=t[e];
|
||||
n[u]=vt(n[u],1,null,null,n)}return n},Z.bindKey=function(n,t){return 2<arguments.length?vt(t,19,p(arguments,2),null,n):vt(t,3,null,null,n)},Z.chain=function(n){return n=new nt(n),n.__chain__=true,n},Z.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},Z.compose=function(){for(var n=arguments,t=n.length;t--;)if(!jt(n[t]))throw new le;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},Z.countBy=Ue,Z.create=function(n,t){var e=rt(n);
|
||||
return t?H(e,t):e},Z.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return ut(n,t,e);if("object"!=r)return function(t){return t[n]};var u=ze(n),o=u[0],i=n[o];return 1!=u.length||i!==i||kt(i)?function(t){for(var e=u.length,r=false;e--&&(r=ft(t[u[e]],n[u[e]],null,true)););return r}:function(n){return n=n[o],i===n&&(0!==i||1/i==1/n)}},Z.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,vt(n,4,null,null,null,t)},Z.debounce=Ht,Z.defaults=V,Z.defer=Jt,Z.delay=function(n,t){if(!jt(n))throw new le;
|
||||
var e=p(arguments,2);return ke(function(){n.apply(v,e)},t)},Z.difference=function(n){return it(n,at(arguments,true,true,1))},Z.filter=St,Z.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(n=Dt(n,e,r)),at(n,t)},Z.forEach=Rt,Z.forEachRight=At,Z.forIn=b,Z.forInRight=function(n,t,e){var r=[];b(n,function(n,t){r.push(t,n)});var u=r.length;for(t=ut(t,e,3);u--&&false!==t(r[u--],r[u],n););return n},Z.forOwn=g,Z.forOwnRight=bt,Z.functions=dt,Z.groupBy=Ve,Z.indexBy=Ge,Z.initial=function(n,t,e){var r=0,u=n?n.length:0;
|
||||
if(typeof t!="number"&&null!=t){var o=u;for(t=Z.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return p(n,0,De(Ae(0,u-r),u))},Z.intersection=function(e){for(var r=arguments,u=r.length,i=-1,f=a(),p=-1,s=gt(),v=e?e.length:0,h=[],g=a();++i<u;){var y=r[i];f[i]=s===n&&(y?y.length:0)>=_&&o(i?r[i]:g)}n:for(;++p<v;){var m=f[0],y=e[p];if(0>(m?t(m,y):s(g,y))){for(i=u,(m||g).push(y);--i;)if(m=f[i],0>(m?t(m,y):s(r[i],y)))continue n;h.push(y)}}for(;u--;)(m=f[u])&&c(m);return l(f),l(g),h},Z.invert=wt,Z.invoke=function(n,t){var e=p(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,i=ne(typeof o=="number"?o:0);
|
||||
return Rt(n,function(n){i[++r]=(u?t:n[t]).apply(n,e)}),i},Z.keys=ze,Z.map=Dt,Z.max=$t,Z.memoize=function(n,t){function e(){var r=e.cache,u=t?t.apply(this,arguments):m+arguments[0];return de.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!jt(n))throw new le;return e.cache={},e},Z.merge=function(n){var t=arguments,e=2;if(!kt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=ut(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=p(arguments,1,e),u=-1,o=a(),i=a();++u<e;)lt(n,t[u],r,o,i);
|
||||
return l(o),l(i),n},Z.min=function(n,t,e){var u=1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&qe(n)){e=-1;for(var i=n.length;++e<i;){var a=n[e];a<o&&(o=a)}}else t=null==t&&Ct(n)?r:Z.createCallback(t,e,3),Rt(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n)});return o},Z.omit=function(n,t,e){var r={};if(typeof t!="function"){var u=[];b(n,function(n,t){u.push(t)});for(var u=it(u,at(arguments,true,false,1)),o=-1,i=u.length;++o<i;){var a=u[o];r[a]=n[a]}}else t=Z.createCallback(t,e,3),b(n,function(n,e,u){t(n,e,u)||(r[e]=n)
|
||||
});return r},Z.once=function(n){var t,e;if(!jt(n))throw new le;return function(){return t?e:(t=true,e=n.apply(this,arguments),n=null,e)}},Z.pairs=function(n){for(var t=-1,e=ze(n),r=e.length,u=ne(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u},Z.partial=function(n){return vt(n,16,p(arguments,1))},Z.partialRight=function(n){return vt(n,32,null,p(arguments,1))},Z.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=at(arguments,true,false,1),i=kt(n)?o.length:0;++u<i;){var a=o[u];a in n&&(r[a]=n[a])
|
||||
}else t=Z.createCallback(t,e,3),b(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},Z.pluck=Ft,Z.pull=function(n){for(var t=arguments,e=0,r=t.length,u=n?n.length:0;++e<r;)for(var o=-1,i=t[e];++o<u;)n[o]===i&&(xe.call(n,o--,1),u--);return n},Z.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=Ae(0,ge((t-n)/(e||1)));for(var u=ne(t);++r<t;)u[r]=n,n+=e;return u},Z.reject=function(n,t,e){return t=Z.createCallback(t,e,3),St(n,function(n,e,r){return!t(n,e,r)})},Z.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];
|
||||
for(t=Z.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),xe.call(n,r--,1),u--);return o},Z.rest=Kt,Z.shuffle=Wt,Z.sortBy=function(n,t,e){var r=-1,o=n?n.length:0,i=ne(typeof o=="number"?o:0);for(t=Z.createCallback(t,e,3),Rt(n,function(n,e,u){var o=i[++r]=f();o.m=t(n,e,u),o.n=r,o.o=n}),o=i.length,i.sort(u);o--;)n=i[o],i[o]=n.o,c(n);return i},Z.tap=function(n,t){return t(n),n},Z.throttle=function(n,t,e){var r=true,u=true;if(!jt(n))throw new le;return false===e?r=false:kt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),L.leading=r,L.maxWait=t,L.trailing=u,Ht(n,t,L)
|
||||
},Z.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=ne(n);for(t=ut(t,e,1);++r<n;)u[r]=t(r);return u},Z.toArray=function(n){return n&&typeof n.length=="number"?p(n):Ot(n)},Z.transform=function(n,t,e,r){var u=qe(n);if(null==e)if(u)e=[];else{var o=n&&n.constructor;e=rt(o&&o.prototype)}return t&&(t=Z.createCallback(t,r,4),(u?Rt:g)(n,function(n,r,u){return t(e,n,r,u)})),e},Z.union=function(){return pt(at(arguments,true,true))},Z.uniq=Mt,Z.values=Ot,Z.where=St,Z.without=function(n){return it(n,p(arguments,1))
|
||||
},Z.wrap=function(n,t){return vt(t,16,[n])},Z.zip=Ut,Z.zipObject=Vt,Z.collect=Dt,Z.drop=Kt,Z.each=Rt,Z.eachRight=At,Z.extend=H,Z.methods=dt,Z.object=Vt,Z.select=St,Z.tail=Kt,Z.unique=Mt,Z.unzip=Ut,Xt(Z),Z.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=false),et(n,t,typeof e=="function"&&ut(e,r,1))},Z.cloneDeep=function(n,t,e){return et(n,true,typeof t=="function"&&ut(t,e,1))},Z.contains=It,Z.escape=function(n){return null==n?"":fe(n).replace(Me,ht)},Z.every=Nt,Z.find=Et,Z.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;
|
||||
for(t=Z.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},Z.findKey=function(n,t,e){var r;return t=Z.createCallback(t,e,3),g(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},Z.findLast=function(n,t,e){var r;return t=Z.createCallback(t,e,3),At(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0}),r},Z.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=Z.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},Z.findLastKey=function(n,t,e){var r;return t=Z.createCallback(t,e,3),bt(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0
|
||||
}),r},Z.has=function(n,t){return n?de.call(n,t):false},Z.identity=Qt,Z.indexOf=Pt,Z.isArguments=_t,Z.isArray=qe,Z.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&ve.call(n)==F||false},Z.isDate=function(n){return n&&typeof n=="object"&&ve.call(n)==T||false},Z.isElement=function(n){return n&&1===n.nodeType||false},Z.isEmpty=function(n){var t=true;if(!n)return t;var e=ve.call(n),r=n.length;return e==$||e==P||e==D||e==q&&typeof r=="number"&&jt(n.splice)?!r:(g(n,function(){return t=false}),t)},Z.isEqual=function(n,t,e,r){return ft(n,t,typeof e=="function"&&ut(e,r,2))
|
||||
},Z.isFinite=function(n){return Se(n)&&!Ee(parseFloat(n))},Z.isFunction=jt,Z.isNaN=function(n){return xt(n)&&n!=+n},Z.isNull=function(n){return null===n},Z.isNumber=xt,Z.isObject=kt,Z.isPlainObject=h,Z.isRegExp=function(n){return n&&typeof n=="object"&&ve.call(n)==z||false},Z.isString=Ct,Z.isUndefined=function(n){return typeof n=="undefined"},Z.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Ae(0,r+e):De(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},Z.mixin=Xt,Z.noConflict=function(){return e._=se,this
|
||||
},Z.noop=Yt,Z.parseInt=He,Z.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Fe(),De(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):ct(n,t)},Z.reduce=Tt,Z.reduceRight=Bt,Z.result=function(n,t){if(n){var e=n[t];return jt(e)?n[t]():e}},Z.runInContext=s,Z.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:ze(n).length},Z.some=qt,Z.sortedIndex=Lt,Z.template=function(n,t,e){var r=Z.templateSettings;
|
||||
n=fe(n||""),e=V({},e,r);var u,o=V({},e.imports,r.imports),r=ze(o),o=Ot(o),a=0,f=e.interpolate||S,l="__p+='",f=ae((e.escape||S).source+"|"+f.source+"|"+(f===I?x:S).source+"|"+(e.evaluate||S).source+"|$","g");n.replace(f,function(t,e,r,o,f,c){return r||(r=o),l+=n.slice(a,c).replace(R,i),e&&(l+="'+__e("+e+")+'"),f&&(u=true,l+="';"+f+";\n__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),a=c+t.length,t}),l+="';",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(w,""):l).replace(j,"$1").replace(k,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";
|
||||
try{var c=re(r,"return "+l).apply(v,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},Z.unescape=function(n){return null==n?"":fe(n).replace(Le,mt)},Z.uniqueId=function(n){var t=++y;return fe(null==n?"":n)+t},Z.all=Nt,Z.any=qt,Z.detect=Et,Z.findWhere=Et,Z.foldl=Tt,Z.foldr=Bt,Z.include=It,Z.inject=Tt,g(Z,function(n,t){Z.prototype[t]||(Z.prototype[t]=function(){var t=[this.__wrapped__],e=this.__chain__;return je.apply(t,arguments),t=n.apply(Z,t),e?new nt(t,e):t})}),Z.first=zt,Z.last=function(n,t,e){var r=0,u=n?n.length:0;
|
||||
if(typeof t!="number"&&null!=t){var o=u;for(t=Z.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:v;return p(n,Ae(0,u-r))},Z.sample=function(n,t,e){return n&&typeof n.length!="number"&&(n=Ot(n)),null==t||e?n?n[ct(0,n.length-1)]:v:(n=Wt(n),n.length=De(Ae(0,t),n.length),n)},Z.take=zt,Z.head=zt,g(Z,function(n,t){var e="sample"!==t;Z.prototype[t]||(Z.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new nt(o,u):o
|
||||
})}),Z.VERSION="2.3.0",Z.prototype.chain=function(){return this.__chain__=true,this},Z.prototype.toString=function(){return fe(this.__wrapped__)},Z.prototype.value=Zt,Z.prototype.valueOf=Zt,Rt(["join","pop","shift"],function(n){var t=ce[n];Z.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);return n?new nt(e,n):e}}),Rt(["push","reverse","sort","unshift"],function(n){var t=ce[n];Z.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Rt(["concat","slice","splice"],function(n){var t=ce[n];
|
||||
Z.prototype[n]=function(){return new nt(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Z}var v,h=[],g=[],y=0,m=+new Date+"",_=75,b=40,d=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",w=/\b__p\+='';/g,j=/\b(__p\+=)''\+/g,k=/(__e\(.*?\)|\b__t\))\+'';/g,x=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,C=/\w*$/,O=/^\s*function[ \n\r\t]+\w/,I=/<%=([\s\S]+?)%>/g,N=RegExp("^["+d+"]*0+(?=.$)"),S=/($^)/,E=/\bthis\b/,R=/['\n\r\t\u2028\u2029\\]/g,A="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),D="[object Arguments]",$="[object Array]",F="[object Boolean]",T="[object Date]",B="[object Function]",W="[object Number]",q="[object Object]",z="[object RegExp]",P="[object String]",K={};
|
||||
K[B]=false,K[D]=K[$]=K[F]=K[T]=K[W]=K[q]=K[z]=K[P]=true;var L={leading:false,maxWait:0,trailing:false},M={configurable:false,enumerable:false,value:null,writable:false},U={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},V={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},G=U[typeof window]&&window||this,H=U[typeof exports]&&exports&&!exports.nodeType&&exports,J=U[typeof module]&&module&&!module.nodeType&&module,Q=J&&J.exports===H&&H,X=U[typeof global]&&global;!X||X.global!==X&&X.window!==X||(G=X);
|
||||
}}function r(n){return n.charCodeAt(0)}function u(n,t){for(var e=n.m,r=t.m,u=-1,o=e.length;++u<o;){var i=e[u],a=r[u];if(i!==a){if(i>a||typeof i=="undefined")return 1;if(i<a||typeof a=="undefined")return-1}}return n.n-t.n}function o(n){var t=-1,r=n.length,u=n[0],o=n[r/2|0],i=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&i&&typeof i=="object")return false;for(u=f(),u["false"]=u["null"]=u["true"]=u.undefined=false,o=f(),o.k=n,o.l=u,o.push=e;++t<r;)o.push(n[t]);return o}function i(n){return"\\"+U[n]
|
||||
}function a(){return h.pop()||[]}function f(){return g.pop()||{k:null,l:null,m:null,"false":false,n:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,o:null}}function l(n){n.length=0,h.length<_&&h.push(n)}function c(n){var t=n.l;t&&c(t),n.k=n.l=n.m=n.object=n.number=n.string=n.o=null,g.length<_&&g.push(n)}function p(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function s(e){function h(n){if(!n||ce.call(n)!=q)return false;
|
||||
var t=n.valueOf,e=typeof t=="function"&&(e=ye(t))&&ye(e);return e?n==e||ye(n)==e:ht(n)}function g(n,t,e){if(!n||!V[typeof n])return n;t=t&&typeof e=="undefined"?t:et(t,e,3);for(var r=-1,u=V[typeof n]&&Te(n),o=u?u.length:0;++r<o&&(e=u[r],false!==t(n[e],e,n)););return n}function _(n,t,e){var r;if(!n||!V[typeof n])return n;t=t&&typeof e=="undefined"?t:et(t,e,3);for(r in n)if(false===t(n[r],r,n))break;return n}function U(n,t,e){var r,u=n,o=u;if(!u)return o;for(var i=arguments,a=0,f=typeof e=="number"?2:i.length;++a<f;)if((u=i[a])&&V[typeof u])for(var l=-1,c=V[typeof u]&&Te(u),p=c?c.length:0;++l<p;)r=c[l],"undefined"==typeof o[r]&&(o[r]=u[r]);
|
||||
return o}function H(n,t,e){var r,u=n,o=u;if(!u)return o;var i=arguments,a=0,f=typeof e=="number"?2:i.length;if(3<f&&"function"==typeof i[f-2])var l=et(i[--f-1],i[f--],2);else 2<f&&"function"==typeof i[f-1]&&(l=i[--f]);for(;++a<f;)if((u=i[a])&&V[typeof u])for(var c=-1,p=V[typeof u]&&Te(u),s=p?p.length:0;++c<s;)r=p[c],o[r]=l?l(o[r],u[r]):u[r];return o}function J(n){var t,e=[];if(!n||!V[typeof n])return e;for(t in n)me.call(n,t)&&e.push(t);return e}function Q(n){return n&&typeof n=="object"&&!$e(n)&&me.call(n,"__wrapped__")?n:new X(n)
|
||||
}function X(n,t){this.__chain__=!!t,this.__wrapped__=n}function Z(n){function t(){if(r){var n=r.slice();be.apply(n,arguments)}if(this instanceof t){var o=tt(e.prototype),n=e.apply(o,n||arguments);return wt(n)?n:o}return e.apply(u,n||arguments)}var e=n[0],r=n[2],u=n[4];return De(t,n),t}function nt(n,t,e,r,u){if(e){var o=e(n);if(typeof o!="undefined")return o}if(!wt(n))return n;var i=ce.call(n);if(!K[i])return n;var f=Re[i];switch(i){case T:case F:return new f(+n);case W:case P:return new f(n);case z:return o=f(n.source,C.exec(n)),o.lastIndex=n.lastIndex,o
|
||||
}if(i=$e(n),t){var c=!r;r||(r=a()),u||(u=a());for(var s=r.length;s--;)if(r[s]==n)return u[s];o=i?f(n.length):{}}else o=i?p(n):H({},n);return i&&(me.call(n,"index")&&(o.index=n.index),me.call(n,"input")&&(o.input=n.input)),t?(r.push(n),u.push(o),(i?St:g)(n,function(n,i){o[i]=nt(n,t,e,r,u)}),c&&(l(r),l(u)),o):o}function tt(n){return wt(n)?je(n):{}}function et(n,t,e){if(typeof n!="function")return Ut;if(typeof t=="undefined"||!("prototype"in n))return n;var r=n.__bindData__;if(typeof r=="undefined"&&(Ae.funcNames&&(r=!n.name),r=r||!Ae.funcDecomp,!r)){var u=ge.call(n);
|
||||
Ae.funcNames||(r=!O.test(u)),r||(r=E.test(u),De(n,r))}if(false===r||true!==r&&1&r[1])return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,o){return n.call(t,e,r,u,o)}}return Mt(n,t)}function rt(n){function t(){var n=f?i:this;if(u){var h=u.slice();be.apply(h,arguments)}return(o||c)&&(h||(h=p(arguments)),o&&be.apply(h,o),c&&h.length<a)?(r|=16,rt([e,s?r:-4&r,h,null,i,a])):(h||(h=arguments),l&&(e=n[v]),this instanceof t?(n=tt(e.prototype),h=e.apply(n,h),wt(h)?h:n):e.apply(n,h))
|
||||
}var e=n[0],r=n[1],u=n[2],o=n[3],i=n[4],a=n[5],f=1&r,l=2&r,c=4&r,s=8&r,v=e;return De(t,n),t}function ut(e,r){var u=-1,i=vt(),a=e?e.length:0,f=a>=b&&i===n,l=[];if(f){var p=o(r);p?(i=t,r=p):f=false}for(;++u<a;)p=e[u],0>i(r,p)&&l.push(p);return f&&c(r),l}function ot(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r<u;){var i=n[r];if(i&&typeof i=="object"&&typeof i.length=="number"&&($e(i)||yt(i))){t||(i=ot(i,t,e));var a=-1,f=i.length,l=o.length;for(o.length+=f;++a<f;)o[l++]=i[a]}else e||o.push(i)}return o
|
||||
}function it(n,t,e,r,u,o){if(e){var i=e(n,t);if(typeof i!="undefined")return!!i}if(n===t)return 0!==n||1/n==1/t;if(n===n&&!(n&&V[typeof n]||t&&V[typeof t]))return false;if(null==n||null==t)return n===t;var f=ce.call(n),c=ce.call(t);if(f==D&&(f=q),c==D&&(c=q),f!=c)return false;switch(f){case T:case F:return+n==+t;case W:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case z:case P:return n==oe(t)}if(c=f==$,!c){var p=me.call(n,"__wrapped__"),s=me.call(t,"__wrapped__");if(p||s)return it(p?n.__wrapped__:n,s?t.__wrapped__:t,e,r,u,o);
|
||||
if(f!=q)return false;if(f=n.constructor,p=t.constructor,f!=p&&!(dt(f)&&f instanceof f&&dt(p)&&p instanceof p)&&"constructor"in n&&"constructor"in t)return false}for(p=!u,u||(u=a()),o||(o=a()),f=u.length;f--;)if(u[f]==n)return o[f]==t;var v=0,i=true;if(u.push(n),o.push(t),c){if(f=n.length,v=t.length,i=v==n.length,!i&&!r)return i;for(;v--;)if(c=f,p=t[v],r)for(;c--&&!(i=it(n[c],p,e,r,u,o)););else if(!(i=it(n[v],p,e,r,u,o)))break;return i}return _(t,function(t,a,f){return me.call(f,a)?(v++,i=me.call(n,a)&&it(n[a],t,e,r,u,o)):void 0
|
||||
}),i&&!r&&_(n,function(n,t,e){return me.call(e,t)?i=-1<--v:void 0}),p&&(l(u),l(o)),i}function at(n,t,e,r,u){($e(t)?St:g)(t,function(t,o){var i,a,f=t,l=n[o];if(t&&((a=$e(t))||h(t))){for(f=r.length;f--;)if(i=r[f]==t){l=u[f];break}if(!i){var c;e&&(f=e(l,t),c=typeof f!="undefined")&&(l=f),c||(l=a?$e(l)?l:[]:h(l)?l:{}),r.push(t),u.push(l),c||at(l,t,e,r,u)}}else e&&(f=e(l,t),typeof f=="undefined"&&(f=t)),typeof f!="undefined"&&(l=f);n[o]=l})}function ft(n,t){return n+he(Ee()*(t-n+1))}function lt(e,r,u){var i=-1,f=vt(),p=e?e.length:0,s=[],v=!r&&p>=b&&f===n,h=u||v?a():s;
|
||||
if(v){var g=o(h);g?(f=t,h=g):(v=false,h=u?h:(l(h),s))}for(;++i<p;){var g=e[i],y=u?u(g,i,e):g;(r?!i||h[h.length-1]!==y:0>f(h,y))&&((u||v)&&h.push(y),s.push(g))}return v?(l(h.k),c(h)):u&&l(h),s}function ct(n){return function(t,e,r){var u={};e=Q.createCallback(e,r,3),r=-1;var o=t?t.length:0;if(typeof o=="number")for(;++r<o;){var i=t[r];n(u,i,e(i,r,t),t)}else g(t,function(t,r,o){n(u,t,e(t,r,o),o)});return u}}function pt(n,t,e,r,u,o){var i=1&t,a=4&t,f=16&t,l=32&t;if(!(2&t||dt(n)))throw new ie;f&&!e.length&&(t&=-17,f=e=false),l&&!r.length&&(t&=-33,l=r=false);
|
||||
var c=n&&n.__bindData__;return c&&true!==c?(c=c.slice(),!i||1&c[1]||(c[4]=u),!i&&1&c[1]&&(t|=8),!a||4&c[1]||(c[5]=o),f&&be.apply(c[2]||(c[2]=[]),e),l&&be.apply(c[3]||(c[3]=[]),r),c[1]|=t,pt.apply(null,c)):(1==t||17===t?Z:rt)([n,t,e,r,u,o])}function st(n){return Fe[n]}function vt(){var t=(t=Q.indexOf)===Wt?n:t;return t}function ht(n){var t,e;return n&&ce.call(n)==q&&(t=n.constructor,!dt(t)||t instanceof t)?(_(n,function(n,t){e=t}),typeof e=="undefined"||me.call(n,e)):false}function gt(n){return Be[n]}function yt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ce.call(n)==D||false
|
||||
}function mt(n,t,e){var r=Te(n),u=r.length;for(t=et(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function bt(n){var t=[];return _(n,function(n,e){dt(n)&&t.push(e)}),t.sort()}function _t(n){for(var t=-1,e=Te(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function dt(n){return typeof n=="function"}function wt(n){return!(!n||!V[typeof n])}function jt(n){return typeof n=="number"||n&&typeof n=="object"&&ce.call(n)==W||false}function kt(n){return typeof n=="string"||n&&typeof n=="object"&&ce.call(n)==P||false
|
||||
}function xt(n){for(var t=-1,e=Te(n),r=e.length,u=Xt(r);++t<r;)u[t]=n[e[t]];return u}function Ct(n,t,e){var r=-1,u=vt(),o=n?n.length:0,i=false;return e=(0>e?Ne(0,o+e):e)||0,$e(n)?i=-1<u(n,t,e):typeof o=="number"?i=-1<(kt(n)?n.indexOf(t,e):u(n,t,e)):g(n,function(n){return++r<e?void 0:!(i=n===t)}),i}function Ot(n,t,e){var r=true;t=Q.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&(r=!!t(n[e],e,n)););else g(n,function(n,e,u){return r=!!t(n,e,u)});return r}function Nt(n,t,e){var r=[];
|
||||
t=Q.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}else g(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function It(n,t,e){t=Q.createCallback(t,e,3),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return g(n,function(n,e,r){return t(n,e,r)?(u=n,false):void 0}),u}for(;++e<r;){var o=n[e];if(t(o,e,n))return o}}function St(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:et(t,e,3),typeof u=="number")for(;++r<u&&false!==t(n[r],r,n););else g(n,t);
|
||||
return n}function Et(n,t,e){var r=n?n.length:0;if(t=t&&typeof e=="undefined"?t:et(t,e,3),typeof r=="number")for(;r--&&false!==t(n[r],r,n););else{var u=Te(n),r=u.length;g(n,function(n,e,o){return e=u?u[--r]:--r,t(o[e],e,o)})}return n}function Rt(n,t,e){var r=-1,u=n?n.length:0;if(t=Q.createCallback(t,e,3),typeof u=="number")for(var o=Xt(u);++r<u;)o[r]=t(n[r],r,n);else o=[],g(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function At(n,t,e){var u=-1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&$e(n)){e=-1;
|
||||
for(var i=n.length;++e<i;){var a=n[e];a>o&&(o=a)}}else t=null==t&&kt(n)?r:Q.createCallback(t,e,3),St(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Dt(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=Q.createCallback(t,r,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n);else g(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)});return e}function $t(n,t,e,r){var u=3>arguments.length;return t=Q.createCallback(t,r,4),Et(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)
|
||||
}),e}function Tt(n){var t=-1,e=n?n.length:0,r=Xt(typeof e=="number"?e:0);return St(n,function(n){var e=ft(0,++t);r[t]=r[e],r[e]=n}),r}function Ft(n,t,e){var r;t=Q.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else g(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function Bt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=Q.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[0]:v;return p(n,0,Ie(Ne(0,r),u))
|
||||
}function Wt(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?Ne(0,u+r):r||0}else if(r)return r=zt(t,e),t[r]===e?r:-1;return n(t,e,r)}function qt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=Q.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Ne(0,t);return p(n,r)}function zt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?Q.createCallback(e,r,1):Ut,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function Pt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(e=Q.createCallback(e,r,3)),lt(n,t,e)
|
||||
}function Kt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?At(Le(n,"length")):0,r=Xt(0>e?0:e);++t<e;)r[t]=Le(n,t);return r}function Lt(n,t){var e=-1,r=n?n.length:0,u={};for(t||!r||$e(n[0])||(t=[]);++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function Mt(n,t){return 2<arguments.length?pt(n,17,p(arguments,2),null,t):pt(n,1,null,null,t)}function Vt(n,t,e){function r(){c&&ve(c),i=c=p=v,(g||h!==t)&&(s=Me(),a=n.apply(l,o),c||i||(o=l=null))}function u(){var e=t-(Me()-f);0<e?c=_e(u,e):(i&&ve(i),e=p,i=c=p=v,e&&(s=Me(),a=n.apply(l,o),c||i||(o=l=null)))
|
||||
}var o,i,a,f,l,c,p,s=0,h=false,g=true;if(!dt(n))throw new ie;if(t=Ne(0,t)||0,true===e)var y=true,g=false;else wt(e)&&(y=e.leading,h="maxWait"in e&&(Ne(t,e.maxWait)||0),g="trailing"in e?e.trailing:g);return function(){if(o=arguments,f=Me(),l=this,p=g&&(c||!y),false===h)var e=y&&!c;else{i||y||(s=f);var v=h-(f-s),m=0>=v;m?(i&&(i=ve(i)),s=f,a=n.apply(l,o)):i||(i=_e(r,v))}return m&&c?c=ve(c):c||t===h||(c=_e(u,t)),e&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a}}function Ut(n){return n}function Gt(n,t,e){var r=true,u=t&&bt(t);
|
||||
t&&(e||u.length)||(null==e&&(e=t),o=X,t=n,n=Q,u=bt(t)),false===e?r=false:wt(e)&&"chain"in e&&(r=e.chain);var o=n,i=dt(o);St(u,function(e){var u=n[e]=t[e];i&&(o.prototype[e]=function(){var t=this.__chain__,e=this.__wrapped__,i=[e];if(be.apply(i,arguments),i=u.apply(n,i),r||t){if(e===i&&wt(i))return this;i=new o(i),i.__chain__=t}return i})})}function Ht(){}function Jt(n){return function(t){return t[n]}}function Qt(){return this.__wrapped__}e=e?Y.defaults(G.Object(),e,Y.pick(G,A)):G;var Xt=e.Array,Yt=e.Boolean,Zt=e.Date,ne=e.Function,te=e.Math,ee=e.Number,re=e.Object,ue=e.RegExp,oe=e.String,ie=e.TypeError,ae=[],fe=re.prototype,le=e._,ce=fe.toString,pe=ue("^"+oe(ce).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),se=te.ceil,ve=e.clearTimeout,he=te.floor,ge=ne.prototype.toString,ye=pe.test(ye=re.getPrototypeOf)&&ye,me=fe.hasOwnProperty,be=ae.push,_e=e.setTimeout,de=ae.splice,we=function(){try{var n={},t=pe.test(t=re.defineProperty)&&t,e=t(n,n,n)&&t
|
||||
}catch(r){}return e}(),je=pe.test(je=re.create)&&je,ke=pe.test(ke=Xt.isArray)&&ke,xe=e.isFinite,Ce=e.isNaN,Oe=pe.test(Oe=re.keys)&&Oe,Ne=te.max,Ie=te.min,Se=e.parseInt,Ee=te.random,Re={};Re[$]=Xt,Re[T]=Yt,Re[F]=Zt,Re[B]=ne,Re[q]=re,Re[W]=ee,Re[z]=ue,Re[P]=oe,X.prototype=Q.prototype;var Ae=Q.support={};Ae.funcDecomp=!pe.test(e.a)&&E.test(s),Ae.funcNames=typeof ne.name=="string",Q.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:Q}},je||(tt=function(){function n(){}return function(t){if(wt(t)){n.prototype=t;
|
||||
var r=new n;n.prototype=null}return r||e.Object()}}());var De=we?function(n,t){M.value=t,we(n,"__bindData__",M)}:Ht,$e=ke||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ce.call(n)==$||false},Te=Oe?function(n){return wt(n)?Oe(n):[]}:J,Fe={"&":"&","<":"<",">":">",'"':""","'":"'"},Be=_t(Fe),We=ue("("+Te(Be).join("|")+")","g"),qe=ue("["+Te(Fe).join("")+"]","g"),ze=ct(function(n,t,e){me.call(n,e)?n[e]++:n[e]=1}),Pe=ct(function(n,t,e){(me.call(n,e)?n[e]:n[e]=[]).push(t)
|
||||
}),Ke=ct(function(n,t,e){n[e]=t}),Le=Rt,Me=pe.test(Me=Zt.now)&&Me||function(){return(new Zt).getTime()},Ve=8==Se(d+"08")?Se:function(n,t){return Se(kt(n)?n.replace(I,""):n,t||0)};return Q.after=function(n,t){if(!dt(t))throw new ie;return function(){return 1>--n?t.apply(this,arguments):void 0}},Q.assign=H,Q.at=function(n){for(var t=arguments,e=-1,r=ot(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Xt(t);++e<t;)u[e]=n[r[e]];return u},Q.bind=Mt,Q.bindAll=function(n){for(var t=1<arguments.length?ot(arguments,true,false,1):bt(n),e=-1,r=t.length;++e<r;){var u=t[e];
|
||||
n[u]=pt(n[u],1,null,null,n)}return n},Q.bindKey=function(n,t){return 2<arguments.length?pt(t,19,p(arguments,2),null,n):pt(t,3,null,null,n)},Q.chain=function(n){return n=new X(n),n.__chain__=true,n},Q.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},Q.compose=function(){for(var n=arguments,t=n.length;t--;)if(!dt(n[t]))throw new ie;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},Q.constant=function(n){return function(){return n
|
||||
}},Q.countBy=ze,Q.create=function(n,t){var e=tt(n);return t?H(e,t):e},Q.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return et(n,t,e);if("object"!=r)return Jt(n);var u=Te(n),o=u[0],i=n[o];return 1!=u.length||i!==i||wt(i)?function(t){for(var e=u.length,r=false;e--&&(r=it(t[u[e]],n[u[e]],null,true)););return r}:function(n){return n=n[o],i===n&&(0!==i||1/i==1/n)}},Q.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,pt(n,4,null,null,null,t)},Q.debounce=Vt,Q.defaults=U,Q.defer=function(n){if(!dt(n))throw new ie;
|
||||
var t=p(arguments,1);return _e(function(){n.apply(v,t)},1)},Q.delay=function(n,t){if(!dt(n))throw new ie;var e=p(arguments,2);return _e(function(){n.apply(v,e)},t)},Q.difference=function(n){return ut(n,ot(arguments,true,true,1))},Q.filter=Nt,Q.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(n=Rt(n,e,r)),ot(n,t)},Q.forEach=St,Q.forEachRight=Et,Q.forIn=_,Q.forInRight=function(n,t,e){var r=[];_(n,function(n,t){r.push(t,n)});var u=r.length;
|
||||
for(t=et(t,e,3);u--&&false!==t(r[u--],r[u],n););return n},Q.forOwn=g,Q.forOwnRight=mt,Q.functions=bt,Q.groupBy=Pe,Q.indexBy=Ke,Q.initial=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=Q.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return p(n,0,Ie(Ne(0,u-r),u))},Q.intersection=function(){for(var e=[],r=-1,u=arguments.length,i=a(),f=vt(),p=f===n,s=a();++r<u;){var v=arguments[r];($e(v)||yt(v))&&(e.push(v),i.push(p&&v.length>=b&&o(r?e[r]:s)))
|
||||
}var p=e[0],h=-1,g=p?p.length:0,y=[];n:for(;++h<g;){var m=i[0],v=p[h];if(0>(m?t(m,v):f(s,v))){for(r=u,(m||s).push(v);--r;)if(m=i[r],0>(m?t(m,v):f(e[r],v)))continue n;y.push(v)}}for(;u--;)(m=i[u])&&c(m);return l(i),l(s),y},Q.invert=_t,Q.invoke=function(n,t){var e=p(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,i=Xt(typeof o=="number"?o:0);return St(n,function(n){i[++r]=(u?t:n[t]).apply(n,e)}),i},Q.keys=Te,Q.map=Rt,Q.mapValues=function(n,t,e){var r={};return t=Q.createCallback(t,e,3),g(n,function(n,e,u){r[e]=t(n,e,u)
|
||||
}),r},Q.max=At,Q.memoize=function(n,t){function e(){var r=e.cache,u=t?t.apply(this,arguments):m+arguments[0];return me.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!dt(n))throw new ie;return e.cache={},e},Q.merge=function(n){var t=arguments,e=2;if(!wt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=et(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=p(arguments,1,e),u=-1,o=a(),i=a();++u<e;)at(n,t[u],r,o,i);return l(o),l(i),n},Q.min=function(n,t,e){var u=1/0,o=u;
|
||||
if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&$e(n)){e=-1;for(var i=n.length;++e<i;){var a=n[e];a<o&&(o=a)}}else t=null==t&&kt(n)?r:Q.createCallback(t,e,3),St(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n)});return o},Q.omit=function(n,t,e){var r={};if(typeof t!="function"){var u=[];_(n,function(n,t){u.push(t)});for(var u=ut(u,ot(arguments,true,false,1)),o=-1,i=u.length;++o<i;){var a=u[o];r[a]=n[a]}}else t=Q.createCallback(t,e,3),_(n,function(n,e,u){t(n,e,u)||(r[e]=n)});return r},Q.once=function(n){var t,e;
|
||||
if(!dt(n))throw new ie;return function(){return t?e:(t=true,e=n.apply(this,arguments),n=null,e)}},Q.pairs=function(n){for(var t=-1,e=Te(n),r=e.length,u=Xt(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u},Q.partial=function(n){return pt(n,16,p(arguments,1))},Q.partialRight=function(n){return pt(n,32,null,p(arguments,1))},Q.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=ot(arguments,true,false,1),i=wt(n)?o.length:0;++u<i;){var a=o[u];a in n&&(r[a]=n[a])}else t=Q.createCallback(t,e,3),_(n,function(n,e,u){t(n,e,u)&&(r[e]=n)
|
||||
});return r},Q.pluck=Le,Q.property=Jt,Q.pull=function(n){for(var t=arguments,e=0,r=t.length,u=n?n.length:0;++e<r;)for(var o=-1,i=t[e];++o<u;)n[o]===i&&(de.call(n,o--,1),u--);return n},Q.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=Ne(0,se((t-n)/(e||1)));for(var u=Xt(t);++r<t;)u[r]=n,n+=e;return u},Q.reject=function(n,t,e){return t=Q.createCallback(t,e,3),Nt(n,function(n,e,r){return!t(n,e,r)})},Q.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];for(t=Q.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),de.call(n,r--,1),u--);
|
||||
return o},Q.rest=qt,Q.shuffle=Tt,Q.sortBy=function(n,t,e){var r=-1,o=$e(t),i=n?n.length:0,p=Xt(typeof i=="number"?i:0);for(o||(t=Q.createCallback(t,e,3)),St(n,function(n,e,u){var i=p[++r]=f();o?i.m=Rt(t,function(t){return n[t]}):(i.m=a())[0]=t(n,e,u),i.n=r,i.o=n}),i=p.length,p.sort(u);i--;)n=p[i],p[i]=n.o,o||l(n.m),c(n);return p},Q.tap=function(n,t){return t(n),n},Q.throttle=function(n,t,e){var r=true,u=true;if(!dt(n))throw new ie;return false===e?r=false:wt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),L.leading=r,L.maxWait=t,L.trailing=u,Vt(n,t,L)
|
||||
},Q.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Xt(n);for(t=et(t,e,1);++r<n;)u[r]=t(r);return u},Q.toArray=function(n){return n&&typeof n.length=="number"?p(n):xt(n)},Q.transform=function(n,t,e,r){var u=$e(n);if(null==e)if(u)e=[];else{var o=n&&n.constructor;e=tt(o&&o.prototype)}return t&&(t=Q.createCallback(t,r,4),(u?St:g)(n,function(n,r,u){return t(e,n,r,u)})),e},Q.union=function(){return lt(ot(arguments,true,true))},Q.uniq=Pt,Q.values=xt,Q.where=Nt,Q.without=function(n){return ut(n,p(arguments,1))
|
||||
},Q.wrap=function(n,t){return pt(t,16,[n])},Q.xor=function(){for(var n=-1,t=arguments.length;++n<t;){var e=arguments[n];if($e(e)||yt(e))var r=r?lt(ut(r,e).concat(ut(e,r))):e}return r||[]},Q.zip=Kt,Q.zipObject=Lt,Q.collect=Rt,Q.drop=qt,Q.each=St,Q.eachRight=Et,Q.extend=H,Q.methods=bt,Q.object=Lt,Q.select=Nt,Q.tail=qt,Q.unique=Pt,Q.unzip=Kt,Gt(Q),Q.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=false),nt(n,t,typeof e=="function"&&et(e,r,1))},Q.cloneDeep=function(n,t,e){return nt(n,true,typeof t=="function"&&et(t,e,1))
|
||||
},Q.contains=Ct,Q.escape=function(n){return null==n?"":oe(n).replace(qe,st)},Q.every=Ot,Q.find=It,Q.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=Q.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},Q.findKey=function(n,t,e){var r;return t=Q.createCallback(t,e,3),g(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},Q.findLast=function(n,t,e){var r;return t=Q.createCallback(t,e,3),Et(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0}),r},Q.findLastIndex=function(n,t,e){var r=n?n.length:0;
|
||||
for(t=Q.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},Q.findLastKey=function(n,t,e){var r;return t=Q.createCallback(t,e,3),mt(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},Q.has=function(n,t){return n?me.call(n,t):false},Q.identity=Ut,Q.indexOf=Wt,Q.isArguments=yt,Q.isArray=$e,Q.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&ce.call(n)==T||false},Q.isDate=function(n){return n&&typeof n=="object"&&ce.call(n)==F||false},Q.isElement=function(n){return n&&1===n.nodeType||false
|
||||
},Q.isEmpty=function(n){var t=true;if(!n)return t;var e=ce.call(n),r=n.length;return e==$||e==P||e==D||e==q&&typeof r=="number"&&dt(n.splice)?!r:(g(n,function(){return t=false}),t)},Q.isEqual=function(n,t,e,r){return it(n,t,typeof e=="function"&&et(e,r,2))},Q.isFinite=function(n){return xe(n)&&!Ce(parseFloat(n))},Q.isFunction=dt,Q.isNaN=function(n){return jt(n)&&n!=+n},Q.isNull=function(n){return null===n},Q.isNumber=jt,Q.isObject=wt,Q.isPlainObject=h,Q.isRegExp=function(n){return n&&typeof n=="object"&&ce.call(n)==z||false
|
||||
},Q.isString=kt,Q.isUndefined=function(n){return typeof n=="undefined"},Q.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Ne(0,r+e):Ie(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},Q.mixin=Gt,Q.noConflict=function(){return e._=le,this},Q.noop=Ht,Q.now=Me,Q.parseInt=Ve,Q.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Ee(),Ie(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):ft(n,t)
|
||||
},Q.reduce=Dt,Q.reduceRight=$t,Q.result=function(n,t){if(n){var e=n[t];return dt(e)?n[t]():e}},Q.runInContext=s,Q.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Te(n).length},Q.some=Ft,Q.sortedIndex=zt,Q.template=function(n,t,e){var r=Q.templateSettings;n=oe(n||""),e=U({},e,r);var u,o=U({},e.imports,r.imports),r=Te(o),o=xt(o),a=0,f=e.interpolate||S,l="__p+='",f=ue((e.escape||S).source+"|"+f.source+"|"+(f===N?x:S).source+"|"+(e.evaluate||S).source+"|$","g");n.replace(f,function(t,e,r,o,f,c){return r||(r=o),l+=n.slice(a,c).replace(R,i),e&&(l+="'+__e("+e+")+'"),f&&(u=true,l+="';"+f+";\n__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),a=c+t.length,t
|
||||
}),l+="';",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(w,""):l).replace(j,"$1").replace(k,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=ne(r,"return "+l).apply(v,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},Q.unescape=function(n){return null==n?"":oe(n).replace(We,gt)},Q.uniqueId=function(n){var t=++y;return oe(null==n?"":n)+t
|
||||
},Q.all=Ot,Q.any=Ft,Q.detect=It,Q.findWhere=It,Q.foldl=Dt,Q.foldr=$t,Q.include=Ct,Q.inject=Dt,Gt(function(){var n={};return g(Q,function(t,e){Q.prototype[e]||(n[e]=t)}),n}(),false),Q.first=Bt,Q.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=Q.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:v;return p(n,Ne(0,u-r))},Q.sample=function(n,t,e){return n&&typeof n.length!="number"&&(n=xt(n)),null==t||e?n?n[ft(0,n.length-1)]:v:(n=Tt(n),n.length=Ie(Ne(0,t),n.length),n)
|
||||
},Q.take=Bt,Q.head=Bt,g(Q,function(n,t){var e="sample"!==t;Q.prototype[t]||(Q.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new X(o,u):o})}),Q.VERSION="2.4.0",Q.prototype.chain=function(){return this.__chain__=true,this},Q.prototype.toString=function(){return oe(this.__wrapped__)},Q.prototype.value=Qt,Q.prototype.valueOf=Qt,St(["join","pop","shift"],function(n){var t=ae[n];Q.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);
|
||||
return n?new X(e,n):e}}),St(["push","reverse","sort","unshift"],function(n){var t=ae[n];Q.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),St(["concat","slice","splice"],function(n){var t=ae[n];Q.prototype[n]=function(){return new X(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Q}var v,h=[],g=[],y=0,m=+new Date+"",b=75,_=40,d=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",w=/\b__p\+='';/g,j=/\b(__p\+=)''\+/g,k=/(__e\(.*?\)|\b__t\))\+'';/g,x=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,C=/\w*$/,O=/^\s*function[ \n\r\t]+\w/,N=/<%=([\s\S]+?)%>/g,I=RegExp("^["+d+"]*0+(?=.$)"),S=/($^)/,E=/\bthis\b/,R=/['\n\r\t\u2028\u2029\\]/g,A="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setTimeout".split(" "),D="[object Arguments]",$="[object Array]",T="[object Boolean]",F="[object Date]",B="[object Function]",W="[object Number]",q="[object Object]",z="[object RegExp]",P="[object String]",K={};
|
||||
K[B]=false,K[D]=K[$]=K[T]=K[F]=K[W]=K[q]=K[z]=K[P]=true;var L={leading:false,maxWait:0,trailing:false},M={configurable:false,enumerable:false,value:null,writable:false},V={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},U={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},G=V[typeof window]&&window||this,H=V[typeof exports]&&exports&&!exports.nodeType&&exports,J=V[typeof module]&&module&&!module.nodeType&&module,Q=J&&J.exports===H&&H,X=V[typeof global]&&global;!X||X.global!==X&&X.window!==X||(G=X);
|
||||
var Y=s();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(G._=Y, define(function(){return Y})):H&&J?Q?(J.exports=Y)._=Y:H._=Y:G._=Y}).call(this);
|
||||
337
dist/lodash.underscore.js
vendored
337
dist/lodash.underscore.js
vendored
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
||||
* Lo-Dash 2.4.0 (Custom Build) <http://lodash.com/>
|
||||
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
|
||||
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
||||
@@ -115,22 +115,29 @@
|
||||
*/
|
||||
function compareAscending(a, b) {
|
||||
var ac = a.criteria,
|
||||
bc = b.criteria;
|
||||
bc = b.criteria,
|
||||
index = -1,
|
||||
length = ac.length;
|
||||
|
||||
// ensure a stable sort in V8 and other engines
|
||||
// http://code.google.com/p/v8/issues/detail?id=90
|
||||
if (ac !== bc) {
|
||||
if (ac > bc || typeof ac == 'undefined') {
|
||||
return 1;
|
||||
}
|
||||
if (ac < bc || typeof bc == 'undefined') {
|
||||
return -1;
|
||||
while (++index < length) {
|
||||
var value = ac[index],
|
||||
other = bc[index];
|
||||
|
||||
if (value !== other) {
|
||||
if (value > other || typeof value == 'undefined') {
|
||||
return 1;
|
||||
}
|
||||
if (value < other || typeof other == 'undefined') {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
// The JS engine embedded in Adobe applications like InDesign has a buggy
|
||||
// `Array#sort` implementation that causes it, under certain circumstances,
|
||||
// to return the same value for `a` and `b`.
|
||||
// See https://github.com/jashkenas/underscore/pull/1247
|
||||
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
|
||||
// that causes it, under certain circumstances, to return the same value for
|
||||
// `a` and `b`. See https://github.com/jashkenas/underscore/pull/1247
|
||||
//
|
||||
// This also ensures a stable sort in V8 and other engines.
|
||||
// See http://code.google.com/p/v8/issues/detail?id=90
|
||||
return a.index - b.index;
|
||||
}
|
||||
|
||||
@@ -204,7 +211,6 @@
|
||||
var ceil = Math.ceil,
|
||||
floor = Math.floor,
|
||||
hasOwnProperty = objectProto.hasOwnProperty,
|
||||
now = reNative.test(now = Date.now) && now || function() { return +new Date; },
|
||||
push = arrayRef.push,
|
||||
propertyIsEnumerable = objectProto.propertyIsEnumerable;
|
||||
|
||||
@@ -1209,22 +1215,22 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the specified object `property` exists and is a direct property,
|
||||
* Checks if the specified property name exists as a direct property of `object`,
|
||||
* instead of an inherited property.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {Object} object The object to check.
|
||||
* @param {string} property The property to check for.
|
||||
* @param {Object} object The object to inspect.
|
||||
* @param {string} key The name of the property to check.
|
||||
* @returns {boolean} Returns `true` if key is a direct property, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b');
|
||||
* // => true
|
||||
*/
|
||||
function has(object, property) {
|
||||
return object ? hasOwnProperty.call(object, property) : false;
|
||||
function has(object, key) {
|
||||
return object ? hasOwnProperty.call(object, key) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1237,7 +1243,7 @@
|
||||
* @returns {Object} Returns the created inverted object.
|
||||
* @example
|
||||
*
|
||||
* _.invert({ 'first': 'fred', 'second': 'barney' });
|
||||
* _.invert({ 'first': 'fred', 'second': 'barney' });
|
||||
* // => { 'fred': 'first', 'barney': 'second' }
|
||||
*/
|
||||
function invert(object) {
|
||||
@@ -2435,7 +2441,7 @@
|
||||
* @type Function
|
||||
* @category Collections
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {string} property The property to pluck.
|
||||
* @param {string} property The name of the property to pluck.
|
||||
* @returns {Array} Returns a new array of property values.
|
||||
* @example
|
||||
*
|
||||
@@ -2447,18 +2453,7 @@
|
||||
* _.pluck(characters, 'name');
|
||||
* // => ['barney', 'fred']
|
||||
*/
|
||||
function pluck(collection, property) {
|
||||
var index = -1,
|
||||
length = collection ? collection.length : 0;
|
||||
|
||||
if (typeof length == 'number') {
|
||||
var result = Array(length);
|
||||
while (++index < length) {
|
||||
result[index] = collection[index][property];
|
||||
}
|
||||
}
|
||||
return result || map(collection, property);
|
||||
}
|
||||
var pluck = map;
|
||||
|
||||
/**
|
||||
* Reduces a collection to a value which is the accumulated result of running
|
||||
@@ -2666,7 +2661,7 @@
|
||||
* // => 3
|
||||
*
|
||||
* _.size('pebbles');
|
||||
* // => 5
|
||||
* // => 7
|
||||
*/
|
||||
function size(collection) {
|
||||
var length = collection ? collection.length : 0;
|
||||
@@ -2746,6 +2741,9 @@
|
||||
* If a property name is provided for `callback` the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an array of property names is provided for `callback` the collection
|
||||
* will be sorted by each property value.
|
||||
*
|
||||
* If an object is provided for `callback` the created "_.where" style callback
|
||||
* will return `true` for elements that have the properties of the given object,
|
||||
* else `false`.
|
||||
@@ -2754,7 +2752,7 @@
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* @param {Array|Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
@@ -2767,9 +2765,20 @@
|
||||
* _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math);
|
||||
* // => [3, 1, 2]
|
||||
*
|
||||
* var characters = [
|
||||
* { 'name': 'barney', 'age': 36 },
|
||||
* { 'name': 'fred', 'age': 40 },
|
||||
* { 'name': 'barney', 'age': 26 },
|
||||
* { 'name': 'fred', 'age': 30 }
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.sortBy(['banana', 'strawberry', 'apple'], 'length');
|
||||
* // => ['apple', 'banana', 'strawberry']
|
||||
* _.map(_.sortBy(characters, 'age'), _.values);
|
||||
* // => [['barney', 26], ['fred', 30], ['barney', 36], ['fred', 40]]
|
||||
*
|
||||
* // sorting by multiple properties
|
||||
* _.map(_.sortBy(characters, ['name', 'age']), _.values);
|
||||
* // = > [['barney', 26], ['barney', 36], ['fred', 30], ['fred', 40]]
|
||||
*/
|
||||
function sortBy(collection, callback, thisArg) {
|
||||
var index = -1,
|
||||
@@ -2779,7 +2788,7 @@
|
||||
callback = createCallback(callback, thisArg, 3);
|
||||
forEach(collection, function(value, key, collection) {
|
||||
result[++index] = {
|
||||
'criteria': callback(value, key, collection),
|
||||
'criteria': [callback(value, key, collection)],
|
||||
'index': index,
|
||||
'value': value
|
||||
};
|
||||
@@ -2826,7 +2835,7 @@
|
||||
* @type Function
|
||||
* @category Collections
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Object} properties The object of property values to filter by.
|
||||
* @param {Object} props The object of property values to filter by.
|
||||
* @returns {Array} Returns a new array of elements that have the given properties.
|
||||
* @example
|
||||
*
|
||||
@@ -3120,15 +3129,24 @@
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {...Array} [array] The arrays to inspect.
|
||||
* @returns {Array} Returns an array of composite values.
|
||||
* @returns {Array} Returns an array of shared values.
|
||||
* @example
|
||||
*
|
||||
* _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
||||
* _.intersection([1, 2, 3], [5, 2, 1, 4], [2, 1]);
|
||||
* // => [1, 2]
|
||||
*/
|
||||
function intersection(array) {
|
||||
var args = arguments,
|
||||
argsLength = args.length,
|
||||
function intersection() {
|
||||
var args = [],
|
||||
argsIndex = -1,
|
||||
argsLength = arguments.length;
|
||||
|
||||
while (++argsIndex < argsLength) {
|
||||
var value = arguments[argsIndex];
|
||||
if (isArray(value) || isArguments(value)) {
|
||||
args.push(value);
|
||||
}
|
||||
}
|
||||
var array = args[0],
|
||||
index = -1,
|
||||
indexOf = getIndexOf(),
|
||||
length = array ? array.length : 0,
|
||||
@@ -3136,7 +3154,7 @@
|
||||
|
||||
outer:
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
value = array[index];
|
||||
if (indexOf(result, value) < 0) {
|
||||
var argsIndex = argsLength;
|
||||
while (--argsIndex) {
|
||||
@@ -3453,13 +3471,13 @@
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {...Array} [array] The arrays to inspect.
|
||||
* @returns {Array} Returns an array of composite values.
|
||||
* @returns {Array} Returns an array of combined values.
|
||||
* @example
|
||||
*
|
||||
* _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
||||
* // => [1, 2, 3, 101, 10]
|
||||
* _.union([1, 2, 3], [5, 2, 1, 4], [2, 1]);
|
||||
* // => [1, 2, 3, 5, 4]
|
||||
*/
|
||||
function union(array) {
|
||||
function union() {
|
||||
return baseUniq(baseFlatten(arguments, true, true));
|
||||
}
|
||||
|
||||
@@ -3589,6 +3607,9 @@
|
||||
length = keys ? keys.length : 0,
|
||||
result = {};
|
||||
|
||||
if (!values && length && !isArray(keys[0])) {
|
||||
values = [];
|
||||
}
|
||||
while (++index < length) {
|
||||
var key = keys[index];
|
||||
if (values) {
|
||||
@@ -3681,8 +3702,8 @@
|
||||
* @example
|
||||
*
|
||||
* var view = {
|
||||
* 'label': 'docs',
|
||||
* 'onClick': function() { console.log('clicked ' + this.label); }
|
||||
* 'label': 'docs',
|
||||
* 'onClick': function() { console.log('clicked ' + this.label); }
|
||||
* };
|
||||
*
|
||||
* _.bindAll(view);
|
||||
@@ -3751,62 +3772,6 @@
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces a callback bound to an optional `thisArg`. If `func` is a property
|
||||
* name the created callback will return the property value for a given element.
|
||||
* If `func` is an object the created callback will return `true` for elements
|
||||
* that contain the equivalent object properties, otherwise it will return `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Functions
|
||||
* @param {*} [func=identity] The value to convert to a callback.
|
||||
* @param {*} [thisArg] The `this` binding of the created callback.
|
||||
* @param {number} [argCount] The number of arguments the callback accepts.
|
||||
* @returns {Function} Returns a callback function.
|
||||
* @example
|
||||
*
|
||||
* var characters = [
|
||||
* { 'name': 'barney', 'age': 36 },
|
||||
* { 'name': 'fred', 'age': 40 }
|
||||
* ];
|
||||
*
|
||||
* // wrap to create custom callback shorthands
|
||||
* _.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) {
|
||||
* var match = /^(.+?)__([gl]t)(.+)$/.exec(callback);
|
||||
* return !match ? func(callback, thisArg) : function(object) {
|
||||
* return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3];
|
||||
* };
|
||||
* });
|
||||
*
|
||||
* _.filter(characters, 'age__gt38');
|
||||
* // => [{ 'name': 'fred', 'age': 40 }]
|
||||
*/
|
||||
function createCallback(func, thisArg, argCount) {
|
||||
var type = typeof func;
|
||||
if (func == null || type == 'function') {
|
||||
return baseCreateCallback(func, thisArg, argCount);
|
||||
}
|
||||
// handle "_.pluck" style callback shorthands
|
||||
if (type != 'object') {
|
||||
return function(object) {
|
||||
return object[func];
|
||||
};
|
||||
}
|
||||
var props = keys(func);
|
||||
return function(object) {
|
||||
var length = props.length,
|
||||
result = false;
|
||||
|
||||
while (length--) {
|
||||
if (!(result = object[props[length]] === func[props[length]])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that will delay the execution of `func` until after
|
||||
* `wait` milliseconds have elapsed since the last time it was invoked.
|
||||
@@ -3959,8 +3924,8 @@
|
||||
* @returns {number} Returns the timer id.
|
||||
* @example
|
||||
*
|
||||
* _.defer(function() { console.log('deferred'); });
|
||||
* // returns from the function before 'deferred' is logged
|
||||
* _.defer(function(text) { console.log(text); }, 'deferred');
|
||||
* // logs 'deferred' after one or more milliseconds
|
||||
*/
|
||||
function defer(func) {
|
||||
if (!isFunction(func)) {
|
||||
@@ -3983,9 +3948,8 @@
|
||||
* @returns {number} Returns the timer id.
|
||||
* @example
|
||||
*
|
||||
* var log = _.bind(console.log, console);
|
||||
* _.delay(log, 1000, 'logged later');
|
||||
* // => 'logged later' (Appears after one second.)
|
||||
* _.delay(function(text) { console.log(text); }, 1000, 'later');
|
||||
* // => logs 'later' after one second
|
||||
*/
|
||||
function delay(func, wait) {
|
||||
if (!isFunction(func)) {
|
||||
@@ -4180,6 +4144,60 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Produces a callback bound to an optional `thisArg`. If `func` is a property
|
||||
* name the created callback will return the property value for a given element.
|
||||
* If `func` is an object the created callback will return `true` for elements
|
||||
* that contain the equivalent object properties, otherwise it will return `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {*} [func=identity] The value to convert to a callback.
|
||||
* @param {*} [thisArg] The `this` binding of the created callback.
|
||||
* @param {number} [argCount] The number of arguments the callback accepts.
|
||||
* @returns {Function} Returns a callback function.
|
||||
* @example
|
||||
*
|
||||
* var characters = [
|
||||
* { 'name': 'barney', 'age': 36 },
|
||||
* { 'name': 'fred', 'age': 40 }
|
||||
* ];
|
||||
*
|
||||
* // wrap to create custom callback shorthands
|
||||
* _.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) {
|
||||
* var match = /^(.+?)__([gl]t)(.+)$/.exec(callback);
|
||||
* return !match ? func(callback, thisArg) : function(object) {
|
||||
* return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3];
|
||||
* };
|
||||
* });
|
||||
*
|
||||
* _.filter(characters, 'age__gt38');
|
||||
* // => [{ 'name': 'fred', 'age': 40 }]
|
||||
*/
|
||||
function createCallback(func, thisArg, argCount) {
|
||||
var type = typeof func;
|
||||
if (func == null || type == 'function') {
|
||||
return baseCreateCallback(func, thisArg, argCount);
|
||||
}
|
||||
// handle "_.pluck" style callback shorthands
|
||||
if (type != 'object') {
|
||||
return property(func);
|
||||
}
|
||||
var props = keys(func);
|
||||
return function(object) {
|
||||
var length = props.length,
|
||||
result = false;
|
||||
|
||||
while (length--) {
|
||||
if (!(result = object[props[length]] === func[props[length]])) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their
|
||||
* corresponding HTML entities.
|
||||
@@ -4217,25 +4235,30 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds function properties of a source object to the `lodash` function and
|
||||
* chainable wrapper.
|
||||
* Adds function properties of a source object to the destination object.
|
||||
* If `object` is a function methods will be added to its prototype as well.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {Object} object The object of function properties to add to `lodash`.
|
||||
* @param {Object} object The object of function properties to add to `lodash`.
|
||||
* @param {Function|Object} [object=lodash] object The destination object.
|
||||
* @param {Object} source The object of functions to add.
|
||||
* @param {Object} [options] The options object.
|
||||
* @param {boolean} [options.chain=true] Specify whether the functions added are chainable.
|
||||
* @example
|
||||
*
|
||||
* _.mixin({
|
||||
* 'capitalize': function(string) {
|
||||
* return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
|
||||
* }
|
||||
* });
|
||||
* function capitalize(string) {
|
||||
* return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
|
||||
* }
|
||||
*
|
||||
* _.mixin({ 'capitalize': capitalize });
|
||||
* _.capitalize('fred');
|
||||
* // => 'Fred'
|
||||
*
|
||||
* _('fred').capitalize().value();
|
||||
* // => 'Fred'
|
||||
*
|
||||
* _.mixin({ 'capitalize': capitalize }, { 'chain': false });
|
||||
* _('fred').capitalize();
|
||||
* // => 'Fred'
|
||||
*/
|
||||
@@ -4288,6 +4311,53 @@
|
||||
// no operation performed
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the number of milliseconds that have elapsed since the Unix epoch
|
||||
* (1 January 1970 00:00:00 UTC).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @example
|
||||
*
|
||||
* var stamp = _.now();
|
||||
* _.defer(function() { console.log(_.now() - stamp); });
|
||||
* // => logs the number of milliseconds it took for the deferred function to be called
|
||||
*/
|
||||
var now = reNative.test(now = Date.now) && now || function() {
|
||||
return new Date().getTime();
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a "_.pluck" style function, which returns the `key` value of a
|
||||
* given object.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {string} key The name of the property to retrieve.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* var characters = [
|
||||
* { 'name': 'fred', 'age': 40 },
|
||||
* { 'name': 'barney', 'age': 36 }
|
||||
* ];
|
||||
*
|
||||
* var getName = _.property('name');
|
||||
*
|
||||
* _.map(characters, getName);
|
||||
* // => ['barney', 'fred']
|
||||
*
|
||||
* _.sortBy(characters, getName);
|
||||
* // => [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }]
|
||||
*/
|
||||
function property(key) {
|
||||
return function(object) {
|
||||
return object[key];
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces a random number between `min` and `max` (inclusive). If only one
|
||||
* argument is provided a number between `0` and the given number will be
|
||||
@@ -4330,7 +4400,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the value of `property` on `object`. If `property` is a function
|
||||
* Resolves the value of property `key` on `object`. If `key` is a function
|
||||
* it will be invoked with the `this` binding of `object` and its result returned,
|
||||
* else the property value is returned. If `object` is falsey then `undefined`
|
||||
* is returned.
|
||||
@@ -4339,7 +4409,7 @@
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {Object} object The object to inspect.
|
||||
* @param {string} property The property to get the value of.
|
||||
* @param {string} key The name of the property to resolve.
|
||||
* @returns {*} Returns the resolved value.
|
||||
* @example
|
||||
*
|
||||
@@ -4356,10 +4426,10 @@
|
||||
* _.result(object, 'stuff');
|
||||
* // => 'nonsense'
|
||||
*/
|
||||
function result(object, property) {
|
||||
function result(object, key) {
|
||||
if (object) {
|
||||
var value = object[property];
|
||||
return isFunction(value) ? object[property]() : value;
|
||||
var value = object[key];
|
||||
return isFunction(value) ? object[key]() : value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4423,8 +4493,8 @@
|
||||
* // => 'hello mustache!'
|
||||
*
|
||||
* // using the `imports` option to import jQuery
|
||||
* var list = '<% $.each(people, function(name) { %><li><%- name %></li><% }); %>';
|
||||
* _.template(list, { 'people': ['fred', 'barney'] }, { 'imports': { '$': jQuery } });
|
||||
* var list = '<% jq.each(people, function(name) { %><li><%- name %></li><% }); %>';
|
||||
* _.template(list, { 'people': ['fred', 'barney'] }, { 'imports': { 'jq': jQuery } });
|
||||
* // => '<li>fred</li><li>barney</li>'
|
||||
*
|
||||
* // using the `sourceURL` option to specify a custom sourceURL for the template
|
||||
@@ -4659,7 +4729,7 @@
|
||||
* _(characters).chain()
|
||||
* .first()
|
||||
* .pick('age')
|
||||
* .value()
|
||||
* .value();
|
||||
* // => { 'age': 36 }
|
||||
*/
|
||||
function wrapperChain() {
|
||||
@@ -4822,7 +4892,7 @@
|
||||
* @memberOf _
|
||||
* @type string
|
||||
*/
|
||||
lodash.VERSION = '2.3.0';
|
||||
lodash.VERSION = '2.4.0';
|
||||
|
||||
// add "Chaining" functions to the wrapper
|
||||
lodash.prototype.chain = wrapperChain;
|
||||
@@ -4864,9 +4934,8 @@
|
||||
// some AMD build optimizers like r.js check for condition patterns like the following:
|
||||
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
|
||||
// Expose Lo-Dash to the global object even when an AMD loader is present in
|
||||
// case Lo-Dash was injected by a third-party script and not intended to be
|
||||
// loaded as a module. The global assignment can be reverted in the Lo-Dash
|
||||
// module by its `noConflict()` method.
|
||||
// case Lo-Dash is loaded with a RequireJS shim config.
|
||||
// See http://requirejs.org/docs/api.html#config-shim
|
||||
root._ = lodash;
|
||||
|
||||
// define as an anonymous module so, through path mapping, it can be
|
||||
|
||||
68
dist/lodash.underscore.min.js
vendored
68
dist/lodash.underscore.min.js
vendored
@@ -1,39 +1,39 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 2.3.0 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
|
||||
* Lo-Dash 2.4.0 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
|
||||
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
|
||||
*/
|
||||
;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++t<e;)if(n[t]===r)return t;return-1}function r(n,r){var t=n.m,e=r.m;if(t!==e){if(t>e||typeof t=="undefined")return 1;if(t<e||typeof e=="undefined")return-1}return n.n-r.n}function t(n){return"\\"+vr[n]}function e(n,r,t){r||(r=0),typeof t=="undefined"&&(t=n?n.length:0);var e=-1;t=t-r||0;for(var u=Array(0>t?0:t);++e<t;)u[e]=n[r+e];return u}function u(n){return n instanceof u?n:new o(n)}function o(n,r){this.__chain__=!!r,this.__wrapped__=n
|
||||
}function i(n){function r(){if(e){var n=e.slice();Rr.apply(n,arguments)}if(this instanceof r){var o=f(t.prototype),n=t.apply(o,n||arguments);return T(n)?n:o}return t.apply(u,n||arguments)}var t=n[0],e=n[2],u=n[4];return r}function f(n){return T(n)?Br(n):{}}function a(n,r,t){if(typeof n!="function")return Y;if(typeof r=="undefined"||!("prototype"in n))return n;switch(t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)
|
||||
};case 4:return function(t,e,u,o){return n.call(r,t,e,u,o)}}return L(n,r)}function l(n){function r(){var n=p?a:this;if(o){var y=o.slice();Rr.apply(y,arguments)}return(i||g)&&(y||(y=e(arguments)),i&&Rr.apply(y,i),g&&y.length<c)?(u|=16,l([t,h?u:-4&u,y,null,a,c])):(y||(y=arguments),s&&(t=n[v]),this instanceof r?(n=f(t.prototype),y=t.apply(n,y),T(y)?y:n):t.apply(n,y))}var t=n[0],u=n[1],o=n[2],i=n[3],a=n[4],c=n[5],p=1&u,s=2&u,g=4&u,h=8&u,v=t;return r}function c(n,r){for(var t=-1,e=m(),u=n?n.length:0,o=[];++t<u;){var i=n[t];
|
||||
0>e(r,i)&&o.push(i)}return o}function p(n,r,t,e){e=(e||0)-1;for(var u=n?n.length:0,o=[];++e<u;){var i=n[e];if(i&&typeof i=="object"&&typeof i.length=="number"&&(Cr(i)||d(i))){r||(i=p(i,r,t));var f=-1,a=i.length,l=o.length;for(o.length+=a;++f<a;)o[l++]=i[f]}else t||o.push(i)}return o}function s(n,r,t,e){if(n===r)return 0!==n||1/n==1/r;if(n===n&&!(n&&hr[typeof n]||r&&hr[typeof r]))return false;if(null==n||null==r)return n===r;var o=Ar.call(n),i=Ar.call(r);if(o!=i)return false;switch(o){case ar:case lr:return+n==+r;
|
||||
;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++t<e;)if(n[t]===r)return t;return-1}function r(n,r){for(var t=n.m,e=r.m,u=-1,o=t.length;++u<o;){var i=t[u],f=e[u];if(i!==f){if(i>f||typeof i=="undefined")return 1;if(i<f||typeof f=="undefined")return-1}}return n.n-r.n}function t(n){return"\\"+vr[n]}function e(n,r,t){r||(r=0),typeof t=="undefined"&&(t=n?n.length:0);var e=-1;t=t-r||0;for(var u=Array(0>t?0:t);++e<t;)u[e]=n[r+e];return u}function u(n){return n instanceof u?n:new o(n)}function o(n,r){this.__chain__=!!r,this.__wrapped__=n
|
||||
}function i(n){function r(){if(e){var n=e.slice();Nr.apply(n,arguments)}if(this instanceof r){var o=f(t.prototype),n=t.apply(o,n||arguments);return A(n)?n:o}return t.apply(u,n||arguments)}var t=n[0],e=n[2],u=n[4];return r}function f(n){return A(n)?kr(n):{}}function a(n,r,t){if(typeof n!="function")return X;if(typeof r=="undefined"||!("prototype"in n))return n;switch(t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)
|
||||
};case 4:return function(t,e,u,o){return n.call(r,t,e,u,o)}}return K(n,r)}function l(n){function r(){var n=p?a:this;if(o){var y=o.slice();Nr.apply(y,arguments)}return(i||g)&&(y||(y=e(arguments)),i&&Nr.apply(y,i),g&&y.length<c)?(u|=16,l([t,h?u:-4&u,y,null,a,c])):(y||(y=arguments),s&&(t=n[v]),this instanceof r?(n=f(t.prototype),y=t.apply(n,y),A(y)?y:n):t.apply(n,y))}var t=n[0],u=n[1],o=n[2],i=n[3],a=n[4],c=n[5],p=1&u,s=2&u,g=4&u,h=8&u,v=t;return r}function c(n,r){for(var t=-1,e=m(),u=n?n.length:0,o=[];++t<u;){var i=n[t];
|
||||
0>e(r,i)&&o.push(i)}return o}function p(n,r,t,e){e=(e||0)-1;for(var u=n?n.length:0,o=[];++e<u;){var i=n[e];if(i&&typeof i=="object"&&typeof i.length=="number"&&(zr(i)||d(i))){r||(i=p(i,r,t));var f=-1,a=i.length,l=o.length;for(o.length+=a;++f<a;)o[l++]=i[f]}else t||o.push(i)}return o}function s(n,r,t,e){if(n===r)return 0!==n||1/n==1/r;if(n===n&&!(n&&hr[typeof n]||r&&hr[typeof r]))return false;if(null==n||null==r)return n===r;var o=Tr.call(n),i=Tr.call(r);if(o!=i)return false;switch(o){case ar:case lr:return+n==+r;
|
||||
case cr:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case sr:case gr:return n==r+""}if(i=o==fr,!i){var f=n instanceof u,a=r instanceof u;if(f||a)return s(f?n.__wrapped__:n,a?r.__wrapped__:r,t,e);if(o!=pr)return false;if(o=n.constructor,f=r.constructor,o!=f&&!(E(o)&&o instanceof o&&E(f)&&f instanceof f)&&"constructor"in n&&"constructor"in r)return false}for(t||(t=[]),e||(e=[]),o=t.length;o--;)if(t[o]==n)return e[o]==r;var l=true,c=0;if(t.push(n),e.push(r),i){if(c=r.length,l=c==n.length)for(;c--&&(l=s(n[c],r[c],t,e)););return l
|
||||
}return Kr(r,function(r,u,o){return Sr.call(o,u)?(c++,!(l=Sr.call(n,u)&&s(n[u],r,t,e))&&tr):void 0}),l&&Kr(n,function(n,r,t){return Sr.call(t,r)?!(l=-1<--c)&&tr:void 0}),l}function g(n,r,t){for(var e=-1,u=m(),o=n?n.length:0,i=[],f=t?[]:i;++e<o;){var a=n[e],l=t?t(a,e,n):a;(r?!e||f[f.length-1]!==l:0>u(f,l))&&(t&&f.push(l),i.push(a))}return i}function h(n){return function(r,t,e){var u={};t=Q(t,e,3),e=-1;var o=r?r.length:0;if(typeof o=="number")for(;++e<o;){var i=r[e];n(u,i,t(i,e,r),r)}else Lr(r,function(r,e,o){n(u,r,t(r,e,o),o)
|
||||
});return u}}function v(n,r,t,e,u,o){var f=16&r,a=32&r;if(!(2&r||E(n)))throw new TypeError;return f&&!t.length&&(r&=-17,t=false),a&&!e.length&&(r&=-33,e=false),(1==r||17===r?i:l)([n,r,t,e,u,o])}function y(n){return Vr[n]}function m(){var r=(r=u.indexOf)===G?n:r;return r}function _(n){return Gr[n]}function d(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Ar.call(n)==ir||false}function b(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)n[u]=e[u]}return n
|
||||
}function w(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)"undefined"==typeof n[u]&&(n[u]=e[u])}return n}function j(n){var r=[];return Kr(n,function(n,t){E(n)&&r.push(t)}),r.sort()}function x(n){for(var r=-1,t=Ur(n),e=t.length,u={};++r<e;){var o=t[r];u[n[o]]=o}return u}function A(n){if(!n)return true;if(Cr(n)||S(n))return!n.length;for(var r in n)if(Sr.call(n,r))return false;return true}function E(n){return typeof n=="function"}function T(n){return!(!n||!hr[typeof n])
|
||||
}function O(n){return typeof n=="number"||n&&typeof n=="object"&&Ar.call(n)==cr||false}function S(n){return typeof n=="string"||n&&typeof n=="object"&&Ar.call(n)==gr||false}function N(n){for(var r=-1,t=Ur(n),e=t.length,u=Array(e);++r<e;)u[r]=n[t[r]];return u}function R(n,r){var t=m(),e=n?n.length:0,u=false;return e&&typeof e=="number"?u=-1<t(n,r):Lr(n,function(n){return(u=n===r)&&tr}),u}function k(n,r,t){var e=true;r=Q(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&(e=!!r(n[t],t,n)););else Lr(n,function(n,t,u){return!(e=!!r(n,t,u))&&tr
|
||||
});return e}function B(n,r,t){var e=[];r=Q(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u;){var o=n[t];r(o,t,n)&&e.push(o)}else Lr(n,function(n,t,u){r(n,t,u)&&e.push(n)});return e}function F(n,r,t){r=Q(r,t,3),t=-1;var e=n?n.length:0;if(typeof e!="number"){var u;return Lr(n,function(n,t,e){return r(n,t,e)?(u=n,tr):void 0}),u}for(;++t<e;){var o=n[t];if(r(o,t,n))return o}}function q(n,r,t){var e=-1,u=n?n.length:0;if(r=r&&typeof t=="undefined"?r:a(r,t,3),typeof u=="number")for(;++e<u&&r(n[e],e,n)!==tr;);else Lr(n,r)
|
||||
}function D(n,r){var t=n?n.length:0;if(typeof t=="number")for(;t--&&false!==r(n[t],t,n););else{var e=Ur(n),t=e.length;Lr(n,function(n,u,o){return u=e?e[--t]:--t,false===r(o[u],u,o)&&tr})}}function I(n,r,t){var e=-1,u=n?n.length:0;if(r=Q(r,t,3),typeof u=="number")for(var o=Array(u);++e<u;)o[e]=r(n[e],e,n);else o=[],Lr(n,function(n,t,u){o[++e]=r(n,t,u)});return o}function M(n,r,t){var e=-1/0,u=e;typeof r!="function"&&t&&t[r]===n&&(r=null);var o=-1,i=n?n.length:0;if(null==r&&typeof i=="number")for(;++o<i;)t=n[o],t>u&&(u=t);
|
||||
else r=Q(r,t,3),q(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function $(n,r){var t=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Array(e);++t<e;)u[t]=n[t][r];return u||I(n,r)}function W(n,r,t,e){if(!n)return t;var u=3>arguments.length;r=Q(r,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(t=n[++o]);++o<i;)t=r(t,n[o],o,n);else Lr(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)});return t}function z(n,r,t,e){var u=3>arguments.length;return r=Q(r,e,4),D(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)
|
||||
}),t}function C(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return q(n,function(n){var t;t=++r,t=0+Or(Wr()*(t-0+1)),e[r]=e[t],e[t]=n}),e}function P(n,r,t){var e;r=Q(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&!(e=r(n[t],t,n)););else Lr(n,function(n,t,u){return(e=r(n,t,u))&&tr});return!!e}function U(n,r,t){return t&&A(r)?nr:(t?F:B)(n,r)}function V(n,r,t){var u=0,o=n?n.length:0;if(typeof r!="number"&&null!=r){var i=-1;for(r=Q(r,t,3);++i<o&&r(n[i],i,n);)u++}else if(u=r,null==u||t)return n?n[0]:nr;
|
||||
return e(n,0,$r(Mr(0,u),o))}function G(r,t,e){if(typeof e=="number"){var u=r?r.length:0;e=0>e?Mr(0,u+e):e||0}else if(e)return e=J(r,t),r[e]===t?e:-1;return n(r,t,e)}function H(n,r,t){if(typeof r!="number"&&null!=r){var u=0,o=-1,i=n?n.length:0;for(r=Q(r,t,3);++o<i&&r(n[o],o,n);)u++}else u=null==r||t?1:Mr(0,r);return e(n,u)}function J(n,r,t,e){var u=0,o=n?n.length:u;for(t=t?Q(t,e,1):Y,r=t(r);u<o;)e=u+o>>>1,t(n[e])<r?u=e+1:o=e;return u}function K(n,r,t,e){return typeof r!="boolean"&&null!=r&&(e=t,t=typeof r!="function"&&e&&e[r]===n?null:r,r=false),null!=t&&(t=Q(t,e,3)),g(n,r,t)
|
||||
}function L(n,r){return 2<arguments.length?v(n,17,e(arguments,2),null,r):v(n,1,null,null,r)}function Q(n,r,t){var e=typeof n;if(null==n||"function"==e)return a(n,r,t);if("object"!=e)return function(r){return r[n]};var u=Ur(n);return function(r){for(var t=u.length,e=false;t--&&(e=r[u[t]]===n[u[t]]););return e}}function X(n,r,t){var e,u,o,i,f,a,l,c=0,p=false,s=true;if(!E(n))throw new TypeError;if(r=Mr(0,r)||0,true===t)var g=true,s=false;else T(t)&&(g=t.leading,p="maxWait"in t&&(Mr(r,t.maxWait)||0),s="trailing"in t?t.trailing:s);
|
||||
var h=function(){var t=r-(Nr()-i);0<t?a=setTimeout(h,t):(u&&clearTimeout(u),t=l,u=a=l=nr,t&&(c=Nr(),o=n.apply(f,e),a||u||(e=f=null)))},v=function(){a&&clearTimeout(a),u=a=l=nr,(s||p!==r)&&(c=Nr(),o=n.apply(f,e),a||u||(e=f=null))};return function(){if(e=arguments,i=Nr(),f=this,l=s&&(a||!g),false===p)var t=g&&!a;else{u||g||(c=i);var y=p-(i-c),m=0>=y;m?(u&&(u=clearTimeout(u)),c=i,o=n.apply(f,e)):u||(u=setTimeout(v,y))}return m&&a?a=clearTimeout(a):a||r===p||(a=setTimeout(h,r)),t&&(m=true,o=n.apply(f,e)),!m||a||u||(e=f=null),o
|
||||
}}function Y(n){return n}function Z(n){q(j(n),function(r){var t=u[r]=n[r];u.prototype[r]=function(){var n=[this.__wrapped__];return Rr.apply(n,arguments),n=t.apply(u,n),this.__chain__?new o(n,true):n}})}var nr,rr=0,tr={},er=+new Date+"",ur=/($^)/,or=/['\n\r\t\u2028\u2029\\]/g,ir="[object Arguments]",fr="[object Array]",ar="[object Boolean]",lr="[object Date]",cr="[object Number]",pr="[object Object]",sr="[object RegExp]",gr="[object String]",hr={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},vr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},yr=hr[typeof window]&&window||this,mr=hr[typeof exports]&&exports&&!exports.nodeType&&exports,_r=hr[typeof module]&&module&&!module.nodeType&&module,dr=_r&&_r.exports===mr&&mr,br=hr[typeof global]&&global;
|
||||
!br||br.global!==br&&br.window!==br||(yr=br);var wr=[],jr=Object.prototype,xr=yr._,Ar=jr.toString,Er=RegExp("^"+(Ar+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Tr=Math.ceil,Or=Math.floor,Sr=jr.hasOwnProperty,Nr=Er.test(Nr=Date.now)&&Nr||function(){return+new Date},Rr=wr.push,kr=jr.propertyIsEnumerable,Br=Er.test(Br=Object.create)&&Br,Fr=Er.test(Fr=Array.isArray)&&Fr,qr=yr.isFinite,Dr=yr.isNaN,Ir=Er.test(Ir=Object.keys)&&Ir,Mr=Math.max,$r=Math.min,Wr=Math.random;
|
||||
o.prototype=u.prototype;var zr={};!function(){var n={0:1,length:1};zr.spliceObjects=(wr.splice.call(n,0,1),!n[0])}(1),u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Br||(f=function(){function n(){}return function(r){if(T(r)){n.prototype=r;var t=new n;n.prototype=null}return t||yr.Object()}}()),d(arguments)||(d=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Sr.call(n,"callee")&&!kr.call(n,"callee")||false});var Cr=Fr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Ar.call(n)==fr||false
|
||||
},Pr=function(n){var r,t=[];if(!n||!hr[typeof n])return t;for(r in n)Sr.call(n,r)&&t.push(r);return t},Ur=Ir?function(n){return T(n)?Ir(n):[]}:Pr,Vr={"&":"&","<":"<",">":">",'"':""","'":"'"},Gr=x(Vr),Hr=RegExp("("+Ur(Gr).join("|")+")","g"),Jr=RegExp("["+Ur(Vr).join("")+"]","g"),Kr=function(n,r){var t;if(!n||!hr[typeof n])return n;for(t in n)if(r(n[t],t,n)===tr)break;return n},Lr=function(n,r){var t;if(!n||!hr[typeof n])return n;for(t in n)if(Sr.call(n,t)&&r(n[t],t,n)===tr)break;
|
||||
return n};E(/x/)&&(E=function(n){return typeof n=="function"&&"[object Function]"==Ar.call(n)});var Qr=h(function(n,r,t){Sr.call(n,t)?n[t]++:n[t]=1}),Xr=h(function(n,r,t){(Sr.call(n,t)?n[t]:n[t]=[]).push(r)}),Yr=h(function(n,r,t){n[t]=r});u.after=function(n,r){if(!E(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0}},u.bind=L,u.bindAll=function(n){for(var r=1<arguments.length?p(arguments,true,false,1):j(n),t=-1,e=r.length;++t<e;){var u=r[t];n[u]=v(n[u],1,null,null,n)}return n
|
||||
},u.chain=function(n){return n=new o(n),n.__chain__=true,n},u.compact=function(n){for(var r=-1,t=n?n.length:0,e=[];++r<t;){var u=n[r];u&&e.push(u)}return e},u.compose=function(){for(var n=arguments,r=n.length;r--;)if(!E(n[r]))throw new TypeError;return function(){for(var r=arguments,t=n.length;t--;)r=[n[t].apply(this,r)];return r[0]}},u.countBy=Qr,u.debounce=X,u.defaults=w,u.defer=function(n){if(!E(n))throw new TypeError;var r=e(arguments,1);return setTimeout(function(){n.apply(nr,r)},1)},u.delay=function(n,r){if(!E(n))throw new TypeError;
|
||||
var t=e(arguments,2);return setTimeout(function(){n.apply(nr,t)},r)},u.difference=function(n){return c(n,p(arguments,true,true,1))},u.filter=B,u.flatten=function(n,r){return p(n,r)},u.forEach=q,u.functions=j,u.groupBy=Xr,u.indexBy=Yr,u.initial=function(n,r,t){var u=0,o=n?n.length:0;if(typeof r!="number"&&null!=r){var i=o;for(r=Q(r,t,3);i--&&r(n[i],i,n);)u++}else u=null==r||t?1:r||u;return e(n,0,$r(Mr(0,o-u),o))},u.intersection=function(n){var r=arguments,t=r.length,e=-1,u=m(),o=n?n.length:0,i=[];n:for(;++e<o;){var f=n[e];
|
||||
if(0>u(i,f)){for(var a=t;--a;)if(0>u(r[a],f))continue n;i.push(f)}}return i},u.invert=x,u.invoke=function(n,r){var t=e(arguments,2),u=-1,o=typeof r=="function",i=n?n.length:0,f=Array(typeof i=="number"?i:0);return q(n,function(n){f[++u]=(o?r:n[r]).apply(n,t)}),f},u.keys=Ur,u.map=I,u.max=M,u.memoize=function(n,r){var t={};return function(){var e=r?r.apply(this,arguments):er+arguments[0];return Sr.call(t,e)?t[e]:t[e]=n.apply(this,arguments)}},u.min=function(n,r,t){var e=1/0,u=e;typeof r!="function"&&t&&t[r]===n&&(r=null);
|
||||
var o=-1,i=n?n.length:0;if(null==r&&typeof i=="number")for(;++o<i;)t=n[o],t<u&&(u=t);else r=Q(r,t,3),q(n,function(n,t,o){t=r(n,t,o),t<e&&(e=t,u=n)});return u},u.omit=function(n){var r=[];Kr(n,function(n,t){r.push(t)});for(var r=c(r,p(arguments,true,false,1)),t=-1,e=r.length,u={};++t<e;){var o=r[t];u[o]=n[o]}return u},u.once=function(n){var r,t;if(!E(n))throw new TypeError;return function(){return r?t:(r=true,t=n.apply(this,arguments),n=null,t)}},u.pairs=function(n){for(var r=-1,t=Ur(n),e=t.length,u=Array(e);++r<e;){var o=t[r];
|
||||
u[r]=[o,n[o]]}return u},u.partial=function(n){return v(n,16,e(arguments,1))},u.pick=function(n){for(var r=-1,t=p(arguments,true,false,1),e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u},u.pluck=$,u.range=function(n,r,t){n=+n||0,t=+t||1,null==r&&(r=n,n=0);var e=-1;r=Mr(0,Tr((r-n)/t));for(var u=Array(r);++e<r;)u[e]=n,n+=t;return u},u.reject=function(n,r,t){return r=Q(r,t,3),B(n,function(n,t,e){return!r(n,t,e)})},u.rest=H,u.shuffle=C,u.sortBy=function(n,t,e){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);
|
||||
for(t=Q(t,e,3),q(n,function(n,r,e){i[++u]={m:t(n,r,e),n:u,o:n}}),o=i.length,i.sort(r);o--;)i[o]=i[o].o;return i},u.tap=function(n,r){return r(n),n},u.throttle=function(n,r,t){var e=true,u=true;if(!E(n))throw new TypeError;return false===t?e=false:T(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),t={},t.leading=e,t.maxWait=r,t.trailing=u,X(n,r,t)},u.times=function(n,r,t){n=-1<(n=+n)?n:0;var e=-1,u=Array(n);for(r=a(r,t,1);++e<n;)u[e]=r(e);return u},u.toArray=function(n){return Cr(n)?e(n):n&&typeof n.length=="number"?I(n):N(n)
|
||||
},u.union=function(){return g(p(arguments,true,true))},u.uniq=K,u.values=N,u.where=U,u.without=function(n){return c(n,e(arguments,1))},u.wrap=function(n,r){return v(r,16,[n])},u.zip=function(){for(var n=-1,r=M($(arguments,"length")),t=Array(0>r?0:r);++n<r;)t[n]=$(arguments,n);return t},u.collect=I,u.drop=H,u.each=q,u.extend=b,u.methods=j,u.object=function(n,r){for(var t=-1,e=n?n.length:0,u={};++t<e;){var o=n[t];r?u[o]=r[t]:o&&(u[o[0]]=o[1])}return u},u.select=B,u.tail=H,u.unique=K,u.clone=function(n){return T(n)?Cr(n)?e(n):b({},n):n
|
||||
},u.contains=R,u.escape=function(n){return null==n?"":(n+"").replace(Jr,y)},u.every=k,u.find=F,u.has=function(n,r){return n?Sr.call(n,r):false},u.identity=Y,u.indexOf=G,u.isArguments=d,u.isArray=Cr,u.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&Ar.call(n)==ar||false},u.isDate=function(n){return n&&typeof n=="object"&&Ar.call(n)==lr||false},u.isElement=function(n){return n&&1===n.nodeType||false},u.isEmpty=A,u.isEqual=function(n,r){return s(n,r)},u.isFinite=function(n){return qr(n)&&!Dr(parseFloat(n))
|
||||
},u.isFunction=E,u.isNaN=function(n){return O(n)&&n!=+n},u.isNull=function(n){return null===n},u.isNumber=O,u.isObject=T,u.isRegExp=function(n){return n&&hr[typeof n]&&Ar.call(n)==sr||false},u.isString=S,u.isUndefined=function(n){return typeof n=="undefined"},u.lastIndexOf=function(n,r,t){var e=n?n.length:0;for(typeof t=="number"&&(e=(0>t?Mr(0,e+t):$r(t,e-1))+1);e--;)if(n[e]===r)return e;return-1},u.mixin=Z,u.noConflict=function(){return yr._=xr,this},u.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Or(Wr()*(r-n+1))
|
||||
},u.reduce=W,u.reduceRight=z,u.result=function(n,r){if(n){var t=n[r];return E(t)?n[r]():t}},u.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:Ur(n).length},u.some=P,u.sortedIndex=J,u.template=function(n,r,e){var o=u,i=o.templateSettings;n=(n||"")+"",e=w({},e,i);var f=0,a="__p+='",i=e.variable;n.replace(RegExp((e.escape||ur).source+"|"+(e.interpolate||ur).source+"|"+(e.evaluate||ur).source+"|$","g"),function(r,e,u,o,i){return a+=n.slice(f,i).replace(or,t),e&&(a+="'+_.escape("+e+")+'"),o&&(a+="';"+o+";\n__p+='"),u&&(a+="'+((__t=("+u+"))==null?'':__t)+'"),f=i+r.length,r
|
||||
}),a+="';",i||(i="obj",a="with("+i+"||{}){"+a+"}"),a="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}";try{var l=Function("_","return "+a)(o)}catch(c){throw c.source=a,c}return r?l(r):(l.source=a,l)},u.unescape=function(n){return null==n?"":(n+"").replace(Hr,_)},u.uniqueId=function(n){var r=++rr+"";return n?n+r:r},u.all=k,u.any=P,u.detect=F,u.findWhere=function(n,r){return U(n,r,true)},u.foldl=W,u.foldr=z,u.include=R,u.inject=W,u.first=V,u.last=function(n,r,t){var u=0,o=n?n.length:0;
|
||||
if(typeof r!="number"&&null!=r){var i=o;for(r=Q(r,t,3);i--&&r(n[i],i,n);)u++}else if(u=r,null==u||t)return n?n[o-1]:nr;return e(n,Mr(0,o-u))},u.sample=function(n,r,t){return n&&typeof n.length!="number"&&(n=N(n)),null==r||t?n?n[0+Or(Wr()*(n.length-1-0+1))]:nr:(n=C(n),n.length=$r(Mr(0,r),n.length),n)},u.take=V,u.head=V,Z(u),u.VERSION="2.3.0",u.prototype.chain=function(){return this.__chain__=true,this},u.prototype.value=function(){return this.__wrapped__},q("pop push reverse shift sort splice unshift".split(" "),function(n){var r=wr[n];
|
||||
u.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),zr.spliceObjects||0!==n.length||delete n[0],this}}),q(["concat","join","slice"],function(n){var r=wr[n];u.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new o(n),n.__chain__=true),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(yr._=u, define(function(){return u})):mr&&_r?dr?(_r.exports=u)._=u:mr._=u:yr._=u}).call(this);
|
||||
}return Jr(r,function(r,u,o){return Sr.call(o,u)?(c++,!(l=Sr.call(n,u)&&s(n[u],r,t,e))&&tr):void 0}),l&&Jr(n,function(n,r,t){return Sr.call(t,r)?!(l=-1<--c)&&tr:void 0}),l}function g(n,r,t){for(var e=-1,u=m(),o=n?n.length:0,i=[],f=t?[]:i;++e<o;){var a=n[e],l=t?t(a,e,n):a;(r?!e||f[f.length-1]!==l:0>u(f,l))&&(t&&f.push(l),i.push(a))}return i}function h(n){return function(r,t,e){var u={};t=Q(t,e,3),e=-1;var o=r?r.length:0;if(typeof o=="number")for(;++e<o;){var i=r[e];n(u,i,t(i,e,r),r)}else Kr(r,function(r,e,o){n(u,r,t(r,e,o),o)
|
||||
});return u}}function v(n,r,t,e,u,o){var f=16&r,a=32&r;if(!(2&r||E(n)))throw new TypeError;return f&&!t.length&&(r&=-17,t=false),a&&!e.length&&(r&=-33,e=false),(1==r||17===r?i:l)([n,r,t,e,u,o])}function y(n){return Ur[n]}function m(){var r=(r=u.indexOf)===V?n:r;return r}function _(n){return Vr[n]}function d(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Tr.call(n)==ir||false}function b(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)n[u]=e[u]}return n
|
||||
}function w(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)"undefined"==typeof n[u]&&(n[u]=e[u])}return n}function j(n){var r=[];return Jr(n,function(n,t){E(n)&&r.push(t)}),r.sort()}function x(n){for(var r=-1,t=Pr(n),e=t.length,u={};++r<e;){var o=t[r];u[n[o]]=o}return u}function T(n){if(!n)return true;if(zr(n)||S(n))return!n.length;for(var r in n)if(Sr.call(n,r))return false;return true}function E(n){return typeof n=="function"}function A(n){return!(!n||!hr[typeof n])
|
||||
}function O(n){return typeof n=="number"||n&&typeof n=="object"&&Tr.call(n)==cr||false}function S(n){return typeof n=="string"||n&&typeof n=="object"&&Tr.call(n)==gr||false}function N(n){for(var r=-1,t=Pr(n),e=t.length,u=Array(e);++r<e;)u[r]=n[t[r]];return u}function R(n,r){var t=m(),e=n?n.length:0,u=false;return e&&typeof e=="number"?u=-1<t(n,r):Kr(n,function(n){return(u=n===r)&&tr}),u}function k(n,r,t){var e=true;r=Q(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&(e=!!r(n[t],t,n)););else Kr(n,function(n,t,u){return!(e=!!r(n,t,u))&&tr
|
||||
});return e}function B(n,r,t){var e=[];r=Q(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u;){var o=n[t];r(o,t,n)&&e.push(o)}else Kr(n,function(n,t,u){r(n,t,u)&&e.push(n)});return e}function F(n,r,t){r=Q(r,t,3),t=-1;var e=n?n.length:0;if(typeof e!="number"){var u;return Kr(n,function(n,t,e){return r(n,t,e)?(u=n,tr):void 0}),u}for(;++t<e;){var o=n[t];if(r(o,t,n))return o}}function q(n,r,t){var e=-1,u=n?n.length:0;if(r=r&&typeof t=="undefined"?r:a(r,t,3),typeof u=="number")for(;++e<u&&r(n[e],e,n)!==tr;);else Kr(n,r)
|
||||
}function D(n,r){var t=n?n.length:0;if(typeof t=="number")for(;t--&&false!==r(n[t],t,n););else{var e=Pr(n),t=e.length;Kr(n,function(n,u,o){return u=e?e[--t]:--t,false===r(o[u],u,o)&&tr})}}function I(n,r,t){var e=-1,u=n?n.length:0;if(r=Q(r,t,3),typeof u=="number")for(var o=Array(u);++e<u;)o[e]=r(n[e],e,n);else o=[],Kr(n,function(n,t,u){o[++e]=r(n,t,u)});return o}function M(n,r,t){var e=-1/0,u=e;typeof r!="function"&&t&&t[r]===n&&(r=null);var o=-1,i=n?n.length:0;if(null==r&&typeof i=="number")for(;++o<i;)t=n[o],t>u&&(u=t);
|
||||
else r=Q(r,t,3),q(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function $(n,r,t,e){if(!n)return t;var u=3>arguments.length;r=Q(r,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(t=n[++o]);++o<i;)t=r(t,n[o],o,n);else Kr(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)});return t}function W(n,r,t,e){var u=3>arguments.length;return r=Q(r,e,4),D(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)}),t}function z(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return q(n,function(n){var t;t=++r,t=0+Or($r()*(t-0+1)),e[r]=e[t],e[t]=n
|
||||
}),e}function C(n,r,t){var e;r=Q(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&!(e=r(n[t],t,n)););else Kr(n,function(n,t,u){return(e=r(n,t,u))&&tr});return!!e}function P(n,r,t){return t&&T(r)?nr:(t?F:B)(n,r)}function U(n,r,t){var u=0,o=n?n.length:0;if(typeof r!="number"&&null!=r){var i=-1;for(r=Q(r,t,3);++i<o&&r(n[i],i,n);)u++}else if(u=r,null==u||t)return n?n[0]:nr;return e(n,0,Mr(Ir(0,u),o))}function V(r,t,e){if(typeof e=="number"){var u=r?r.length:0;e=0>e?Ir(0,u+e):e||0}else if(e)return e=H(r,t),r[e]===t?e:-1;
|
||||
return n(r,t,e)}function G(n,r,t){if(typeof r!="number"&&null!=r){var u=0,o=-1,i=n?n.length:0;for(r=Q(r,t,3);++o<i&&r(n[o],o,n);)u++}else u=null==r||t?1:Ir(0,r);return e(n,u)}function H(n,r,t,e){var u=0,o=n?n.length:u;for(t=t?Q(t,e,1):X,r=t(r);u<o;)e=u+o>>>1,t(n[e])<r?u=e+1:o=e;return u}function J(n,r,t,e){return typeof r!="boolean"&&null!=r&&(e=t,t=typeof r!="function"&&e&&e[r]===n?null:r,r=false),null!=t&&(t=Q(t,e,3)),g(n,r,t)}function K(n,r){return 2<arguments.length?v(n,17,e(arguments,2),null,r):v(n,1,null,null,r)
|
||||
}function L(n,r,t){var e,u,o,i,f,a,l,c=0,p=false,s=true;if(!E(n))throw new TypeError;if(r=Ir(0,r)||0,true===t)var g=true,s=false;else A(t)&&(g=t.leading,p="maxWait"in t&&(Ir(r,t.maxWait)||0),s="trailing"in t?t.trailing:s);var h=function(){var t=r-(Zr()-i);0<t?a=setTimeout(h,t):(u&&clearTimeout(u),t=l,u=a=l=nr,t&&(c=Zr(),o=n.apply(f,e),a||u||(e=f=null)))},v=function(){a&&clearTimeout(a),u=a=l=nr,(s||p!==r)&&(c=Zr(),o=n.apply(f,e),a||u||(e=f=null))};return function(){if(e=arguments,i=Zr(),f=this,l=s&&(a||!g),false===p)var t=g&&!a;
|
||||
else{u||g||(c=i);var y=p-(i-c),m=0>=y;m?(u&&(u=clearTimeout(u)),c=i,o=n.apply(f,e)):u||(u=setTimeout(v,y))}return m&&a?a=clearTimeout(a):a||r===p||(a=setTimeout(h,r)),t&&(m=true,o=n.apply(f,e)),!m||a||u||(e=f=null),o}}function Q(n,r,t){var e=typeof n;if(null==n||"function"==e)return a(n,r,t);if("object"!=e)return Z(n);var u=Pr(n);return function(r){for(var t=u.length,e=false;t--&&(e=r[u[t]]===n[u[t]]););return e}}function X(n){return n}function Y(n){q(j(n),function(r){var t=u[r]=n[r];u.prototype[r]=function(){var n=[this.__wrapped__];
|
||||
return Nr.apply(n,arguments),n=t.apply(u,n),this.__chain__?new o(n,true):n}})}function Z(n){return function(r){return r[n]}}var nr,rr=0,tr={},er=+new Date+"",ur=/($^)/,or=/['\n\r\t\u2028\u2029\\]/g,ir="[object Arguments]",fr="[object Array]",ar="[object Boolean]",lr="[object Date]",cr="[object Number]",pr="[object Object]",sr="[object RegExp]",gr="[object String]",hr={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},vr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},yr=hr[typeof window]&&window||this,mr=hr[typeof exports]&&exports&&!exports.nodeType&&exports,_r=hr[typeof module]&&module&&!module.nodeType&&module,dr=_r&&_r.exports===mr&&mr,br=hr[typeof global]&&global;
|
||||
!br||br.global!==br&&br.window!==br||(yr=br);var wr=[],jr=Object.prototype,xr=yr._,Tr=jr.toString,Er=RegExp("^"+(Tr+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Ar=Math.ceil,Or=Math.floor,Sr=jr.hasOwnProperty,Nr=wr.push,Rr=jr.propertyIsEnumerable,kr=Er.test(kr=Object.create)&&kr,Br=Er.test(Br=Array.isArray)&&Br,Fr=yr.isFinite,qr=yr.isNaN,Dr=Er.test(Dr=Object.keys)&&Dr,Ir=Math.max,Mr=Math.min,$r=Math.random;o.prototype=u.prototype;var Wr={};!function(){var n={0:1,length:1};
|
||||
Wr.spliceObjects=(wr.splice.call(n,0,1),!n[0])}(1),u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},kr||(f=function(){function n(){}return function(r){if(A(r)){n.prototype=r;var t=new n;n.prototype=null}return t||yr.Object()}}()),d(arguments)||(d=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Sr.call(n,"callee")&&!Rr.call(n,"callee")||false});var zr=Br||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Tr.call(n)==fr||false
|
||||
},Cr=function(n){var r,t=[];if(!n||!hr[typeof n])return t;for(r in n)Sr.call(n,r)&&t.push(r);return t},Pr=Dr?function(n){return A(n)?Dr(n):[]}:Cr,Ur={"&":"&","<":"<",">":">",'"':""","'":"'"},Vr=x(Ur),Gr=RegExp("("+Pr(Vr).join("|")+")","g"),Hr=RegExp("["+Pr(Ur).join("")+"]","g"),Jr=function(n,r){var t;if(!n||!hr[typeof n])return n;for(t in n)if(r(n[t],t,n)===tr)break;return n},Kr=function(n,r){var t;if(!n||!hr[typeof n])return n;for(t in n)if(Sr.call(n,t)&&r(n[t],t,n)===tr)break;
|
||||
return n};E(/x/)&&(E=function(n){return typeof n=="function"&&"[object Function]"==Tr.call(n)});var Lr=h(function(n,r,t){Sr.call(n,t)?n[t]++:n[t]=1}),Qr=h(function(n,r,t){(Sr.call(n,t)?n[t]:n[t]=[]).push(r)}),Xr=h(function(n,r,t){n[t]=r}),Yr=I,Zr=Er.test(Zr=Date.now)&&Zr||function(){return(new Date).getTime()};u.after=function(n,r){if(!E(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0}},u.bind=K,u.bindAll=function(n){for(var r=1<arguments.length?p(arguments,true,false,1):j(n),t=-1,e=r.length;++t<e;){var u=r[t];
|
||||
n[u]=v(n[u],1,null,null,n)}return n},u.chain=function(n){return n=new o(n),n.__chain__=true,n},u.compact=function(n){for(var r=-1,t=n?n.length:0,e=[];++r<t;){var u=n[r];u&&e.push(u)}return e},u.compose=function(){for(var n=arguments,r=n.length;r--;)if(!E(n[r]))throw new TypeError;return function(){for(var r=arguments,t=n.length;t--;)r=[n[t].apply(this,r)];return r[0]}},u.countBy=Lr,u.debounce=L,u.defaults=w,u.defer=function(n){if(!E(n))throw new TypeError;var r=e(arguments,1);return setTimeout(function(){n.apply(nr,r)
|
||||
},1)},u.delay=function(n,r){if(!E(n))throw new TypeError;var t=e(arguments,2);return setTimeout(function(){n.apply(nr,t)},r)},u.difference=function(n){return c(n,p(arguments,true,true,1))},u.filter=B,u.flatten=function(n,r){return p(n,r)},u.forEach=q,u.functions=j,u.groupBy=Qr,u.indexBy=Xr,u.initial=function(n,r,t){var u=0,o=n?n.length:0;if(typeof r!="number"&&null!=r){var i=o;for(r=Q(r,t,3);i--&&r(n[i],i,n);)u++}else u=null==r||t?1:r||u;return e(n,0,Mr(Ir(0,o-u),o))},u.intersection=function(){for(var n=[],r=-1,t=arguments.length;++r<t;){var e=arguments[r];
|
||||
(zr(e)||d(e))&&n.push(e)}var u=n[0],o=-1,i=m(),f=u?u.length:0,a=[];n:for(;++o<f;)if(e=u[o],0>i(a,e)){for(r=t;--r;)if(0>i(n[r],e))continue n;a.push(e)}return a},u.invert=x,u.invoke=function(n,r){var t=e(arguments,2),u=-1,o=typeof r=="function",i=n?n.length:0,f=Array(typeof i=="number"?i:0);return q(n,function(n){f[++u]=(o?r:n[r]).apply(n,t)}),f},u.keys=Pr,u.map=I,u.max=M,u.memoize=function(n,r){var t={};return function(){var e=r?r.apply(this,arguments):er+arguments[0];return Sr.call(t,e)?t[e]:t[e]=n.apply(this,arguments)
|
||||
}},u.min=function(n,r,t){var e=1/0,u=e;typeof r!="function"&&t&&t[r]===n&&(r=null);var o=-1,i=n?n.length:0;if(null==r&&typeof i=="number")for(;++o<i;)t=n[o],t<u&&(u=t);else r=Q(r,t,3),q(n,function(n,t,o){t=r(n,t,o),t<e&&(e=t,u=n)});return u},u.omit=function(n){var r=[];Jr(n,function(n,t){r.push(t)});for(var r=c(r,p(arguments,true,false,1)),t=-1,e=r.length,u={};++t<e;){var o=r[t];u[o]=n[o]}return u},u.once=function(n){var r,t;if(!E(n))throw new TypeError;return function(){return r?t:(r=true,t=n.apply(this,arguments),n=null,t)
|
||||
}},u.pairs=function(n){for(var r=-1,t=Pr(n),e=t.length,u=Array(e);++r<e;){var o=t[r];u[r]=[o,n[o]]}return u},u.partial=function(n){return v(n,16,e(arguments,1))},u.pick=function(n){for(var r=-1,t=p(arguments,true,false,1),e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u},u.pluck=Yr,u.range=function(n,r,t){n=+n||0,t=+t||1,null==r&&(r=n,n=0);var e=-1;r=Ir(0,Ar((r-n)/t));for(var u=Array(r);++e<r;)u[e]=n,n+=t;return u},u.reject=function(n,r,t){return r=Q(r,t,3),B(n,function(n,t,e){return!r(n,t,e)
|
||||
})},u.rest=G,u.shuffle=z,u.sortBy=function(n,t,e){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);for(t=Q(t,e,3),q(n,function(n,r,e){i[++u]={m:[t(n,r,e)],n:u,o:n}}),o=i.length,i.sort(r);o--;)i[o]=i[o].o;return i},u.tap=function(n,r){return r(n),n},u.throttle=function(n,r,t){var e=true,u=true;if(!E(n))throw new TypeError;return false===t?e=false:A(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),t={},t.leading=e,t.maxWait=r,t.trailing=u,L(n,r,t)},u.times=function(n,r,t){n=-1<(n=+n)?n:0;
|
||||
var e=-1,u=Array(n);for(r=a(r,t,1);++e<n;)u[e]=r(e);return u},u.toArray=function(n){return zr(n)?e(n):n&&typeof n.length=="number"?I(n):N(n)},u.union=function(){return g(p(arguments,true,true))},u.uniq=J,u.values=N,u.where=P,u.without=function(n){return c(n,e(arguments,1))},u.wrap=function(n,r){return v(r,16,[n])},u.zip=function(){for(var n=-1,r=M(Yr(arguments,"length")),t=Array(0>r?0:r);++n<r;)t[n]=Yr(arguments,n);return t},u.collect=I,u.drop=G,u.each=q,u.extend=b,u.methods=j,u.object=function(n,r){var t=-1,e=n?n.length:0,u={};
|
||||
for(r||!e||zr(n[0])||(r=[]);++t<e;){var o=n[t];r?u[o]=r[t]:o&&(u[o[0]]=o[1])}return u},u.select=B,u.tail=G,u.unique=J,u.clone=function(n){return A(n)?zr(n)?e(n):b({},n):n},u.contains=R,u.escape=function(n){return null==n?"":(n+"").replace(Hr,y)},u.every=k,u.find=F,u.has=function(n,r){return n?Sr.call(n,r):false},u.identity=X,u.indexOf=V,u.isArguments=d,u.isArray=zr,u.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&Tr.call(n)==ar||false},u.isDate=function(n){return n&&typeof n=="object"&&Tr.call(n)==lr||false
|
||||
},u.isElement=function(n){return n&&1===n.nodeType||false},u.isEmpty=T,u.isEqual=function(n,r){return s(n,r)},u.isFinite=function(n){return Fr(n)&&!qr(parseFloat(n))},u.isFunction=E,u.isNaN=function(n){return O(n)&&n!=+n},u.isNull=function(n){return null===n},u.isNumber=O,u.isObject=A,u.isRegExp=function(n){return n&&hr[typeof n]&&Tr.call(n)==sr||false},u.isString=S,u.isUndefined=function(n){return typeof n=="undefined"},u.lastIndexOf=function(n,r,t){var e=n?n.length:0;for(typeof t=="number"&&(e=(0>t?Ir(0,e+t):Mr(t,e-1))+1);e--;)if(n[e]===r)return e;
|
||||
return-1},u.mixin=Y,u.noConflict=function(){return yr._=xr,this},u.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Or($r()*(r-n+1))},u.reduce=$,u.reduceRight=W,u.result=function(n,r){if(n){var t=n[r];return E(t)?n[r]():t}},u.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:Pr(n).length},u.some=C,u.sortedIndex=H,u.template=function(n,r,e){var o=u,i=o.templateSettings;n=(n||"")+"",e=w({},e,i);var f=0,a="__p+='",i=e.variable;n.replace(RegExp((e.escape||ur).source+"|"+(e.interpolate||ur).source+"|"+(e.evaluate||ur).source+"|$","g"),function(r,e,u,o,i){return a+=n.slice(f,i).replace(or,t),e&&(a+="'+_.escape("+e+")+'"),o&&(a+="';"+o+";\n__p+='"),u&&(a+="'+((__t=("+u+"))==null?'':__t)+'"),f=i+r.length,r
|
||||
}),a+="';",i||(i="obj",a="with("+i+"||{}){"+a+"}"),a="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}";try{var l=Function("_","return "+a)(o)}catch(c){throw c.source=a,c}return r?l(r):(l.source=a,l)},u.unescape=function(n){return null==n?"":(n+"").replace(Gr,_)},u.uniqueId=function(n){var r=++rr+"";return n?n+r:r},u.all=k,u.any=C,u.detect=F,u.findWhere=function(n,r){return P(n,r,true)},u.foldl=$,u.foldr=W,u.include=R,u.inject=$,u.first=U,u.last=function(n,r,t){var u=0,o=n?n.length:0;
|
||||
if(typeof r!="number"&&null!=r){var i=o;for(r=Q(r,t,3);i--&&r(n[i],i,n);)u++}else if(u=r,null==u||t)return n?n[o-1]:nr;return e(n,Ir(0,o-u))},u.sample=function(n,r,t){return n&&typeof n.length!="number"&&(n=N(n)),null==r||t?n?n[0+Or($r()*(n.length-1-0+1))]:nr:(n=z(n),n.length=Mr(Ir(0,r),n.length),n)},u.take=U,u.head=U,Y(u),u.VERSION="2.4.0",u.prototype.chain=function(){return this.__chain__=true,this},u.prototype.value=function(){return this.__wrapped__},q("pop push reverse shift sort splice unshift".split(" "),function(n){var r=wr[n];
|
||||
u.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),Wr.spliceObjects||0!==n.length||delete n[0],this}}),q(["concat","join","slice"],function(n){var r=wr[n];u.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new o(n),n.__chain__=true),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(yr._=u, define(function(){return u})):mr&&_r?dr?(_r.exports=u)._=u:mr._=u:yr._=u}).call(this);
|
||||
941
doc/README.md
941
doc/README.md
File diff suppressed because it is too large
Load Diff
560
lodash.js
560
lodash.js
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* @license
|
||||
* Lo-Dash 2.3.0 <http://lodash.com/>
|
||||
* Lo-Dash 2.4.0 <http://lodash.com/>
|
||||
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
||||
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
/**
|
||||
* Used to match ES6 template delimiters
|
||||
* http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6
|
||||
* http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals
|
||||
*/
|
||||
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
var contextProps = [
|
||||
'Array', 'Boolean', 'Date', 'Error', 'Function', 'Math', 'Number', 'Object',
|
||||
'RegExp', 'String', '_', 'attachEvent', 'clearTimeout', 'isFinite', 'isNaN',
|
||||
'parseInt', 'setImmediate', 'setTimeout'
|
||||
'parseInt', 'setTimeout'
|
||||
];
|
||||
|
||||
/** Used to fix the JScript [[DontEnum]] bug */
|
||||
@@ -280,22 +280,29 @@
|
||||
*/
|
||||
function compareAscending(a, b) {
|
||||
var ac = a.criteria,
|
||||
bc = b.criteria;
|
||||
bc = b.criteria,
|
||||
index = -1,
|
||||
length = ac.length;
|
||||
|
||||
// ensure a stable sort in V8 and other engines
|
||||
// http://code.google.com/p/v8/issues/detail?id=90
|
||||
if (ac !== bc) {
|
||||
if (ac > bc || typeof ac == 'undefined') {
|
||||
return 1;
|
||||
}
|
||||
if (ac < bc || typeof bc == 'undefined') {
|
||||
return -1;
|
||||
while (++index < length) {
|
||||
var value = ac[index],
|
||||
other = bc[index];
|
||||
|
||||
if (value !== other) {
|
||||
if (value > other || typeof value == 'undefined') {
|
||||
return 1;
|
||||
}
|
||||
if (value < other || typeof other == 'undefined') {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
// The JS engine embedded in Adobe applications like InDesign has a buggy
|
||||
// `Array#sort` implementation that causes it, under certain circumstances,
|
||||
// to return the same value for `a` and `b`.
|
||||
// See https://github.com/jashkenas/underscore/pull/1247
|
||||
// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
|
||||
// that causes it, under certain circumstances, to return the same value for
|
||||
// `a` and `b`. See https://github.com/jashkenas/underscore/pull/1247
|
||||
//
|
||||
// This also ensures a stable sort in V8 and other engines.
|
||||
// See http://code.google.com/p/v8/issues/detail?id=90
|
||||
return a.index - b.index;
|
||||
}
|
||||
|
||||
@@ -512,17 +519,12 @@
|
||||
fnToString = Function.prototype.toString,
|
||||
getPrototypeOf = reNative.test(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf,
|
||||
hasOwnProperty = objectProto.hasOwnProperty,
|
||||
now = reNative.test(now = Date.now) && now || function() { return +new Date; },
|
||||
push = arrayRef.push,
|
||||
propertyIsEnumerable = objectProto.propertyIsEnumerable,
|
||||
setTimeout = context.setTimeout,
|
||||
splice = arrayRef.splice,
|
||||
unshift = arrayRef.unshift;
|
||||
|
||||
/** Used to detect `setImmediate` in Node.js */
|
||||
var setImmediate = typeof (setImmediate = freeGlobal && moduleExports && freeGlobal.setImmediate) == 'function' &&
|
||||
!reNative.test(setImmediate) && setImmediate;
|
||||
|
||||
/** Used to set meta data on functions */
|
||||
var defineProperty = (function() {
|
||||
// IE 8 only accepts DOM elements
|
||||
@@ -2495,22 +2497,22 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the specified object `property` exists and is a direct property,
|
||||
* Checks if the specified property name exists as a direct property of `object`,
|
||||
* instead of an inherited property.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {Object} object The object to check.
|
||||
* @param {string} property The property to check for.
|
||||
* @param {Object} object The object to inspect.
|
||||
* @param {string} key The name of the property to check.
|
||||
* @returns {boolean} Returns `true` if key is a direct property, else `false`.
|
||||
* @example
|
||||
*
|
||||
* _.has({ 'a': 1, 'b': 2, 'c': 3 }, 'b');
|
||||
* // => true
|
||||
*/
|
||||
function has(object, property) {
|
||||
return object ? hasOwnProperty.call(object, property) : false;
|
||||
function has(object, key) {
|
||||
return object ? hasOwnProperty.call(object, key) : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2523,7 +2525,7 @@
|
||||
* @returns {Object} Returns the created inverted object.
|
||||
* @example
|
||||
*
|
||||
* _.invert({ 'first': 'fred', 'second': 'barney' });
|
||||
* _.invert({ 'first': 'fred', 'second': 'barney' });
|
||||
* // => { 'fred': 'first', 'barney': 'second' }
|
||||
*/
|
||||
function invert(object) {
|
||||
@@ -2915,6 +2917,52 @@
|
||||
return typeof value == 'undefined';
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an object with the same keys as `object` and values generated by
|
||||
* running each own enumerable property of `object` through the callback.
|
||||
* The callback is bound to `thisArg` and invoked with three arguments;
|
||||
* (value, key, object).
|
||||
*
|
||||
* If a property name is provided for `callback` the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an object is provided for `callback` the created "_.where" style callback
|
||||
* will return `true` for elements that have the properties of the given object,
|
||||
* else `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Objects
|
||||
* @param {Object} object The object to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
* @returns {Array} Returns a new object with values of the results of each `callback` execution.
|
||||
* @example
|
||||
*
|
||||
* _.mapValues({ 'a': 1, 'b': 2, 'c': 3} , function(num) { return num * 3; });
|
||||
* // => { 'a': 3, 'b': 6, 'c': 9 }
|
||||
*
|
||||
* var characters = {
|
||||
* 'fred': { 'name': 'fred', 'age': 40 },
|
||||
* 'pebbles': { 'name': 'pebbles', 'age': 1 }
|
||||
* };
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.mapValues(characters, 'age');
|
||||
* // => { 'fred': 40, 'pebbles': 1 }
|
||||
*/
|
||||
function mapValues(object, callback, thisArg) {
|
||||
var result = {};
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
|
||||
forOwn(object, function(value, key, object) {
|
||||
result[key] = callback(value, key, object);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively merges own enumerable properties of the source object(s), that
|
||||
* don't resolve to `undefined` into the destination object. Subsequent sources
|
||||
@@ -2973,7 +3021,6 @@
|
||||
if (!isObject(object)) {
|
||||
return object;
|
||||
}
|
||||
|
||||
// allows working with `_.reduce` and `_.reduceRight` without using
|
||||
// their `index` and `collection` arguments
|
||||
if (typeof args[2] != 'number') {
|
||||
@@ -3130,11 +3177,11 @@
|
||||
|
||||
/**
|
||||
* An alternative to `_.reduce` this method transforms `object` to a new
|
||||
* `accumulator` object which is the result of running each of its elements
|
||||
* through a callback, with each callback execution potentially mutating
|
||||
* the `accumulator` object. The callback is bound to `thisArg` and invoked
|
||||
* with four arguments; (accumulator, value, key, object). Callbacks may exit
|
||||
* iteration early by explicitly returning `false`.
|
||||
* `accumulator` object which is the result of running each of its own
|
||||
* enumerable properties through a callback, with each callback execution
|
||||
* potentially mutating the `accumulator` object. The callback is bound to
|
||||
* `thisArg` and invoked with four arguments; (accumulator, value, key, object).
|
||||
* Callbacks may exit iteration early by explicitly returning `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
@@ -3973,7 +4020,7 @@
|
||||
* @type Function
|
||||
* @category Collections
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {string} property The property to pluck.
|
||||
* @param {string} property The name of the property to pluck.
|
||||
* @returns {Array} Returns a new array of property values.
|
||||
* @example
|
||||
*
|
||||
@@ -4194,7 +4241,7 @@
|
||||
* // => 3
|
||||
*
|
||||
* _.size('pebbles');
|
||||
* // => 5
|
||||
* // => 7
|
||||
*/
|
||||
function size(collection) {
|
||||
var length = collection ? collection.length : 0;
|
||||
@@ -4274,6 +4321,9 @@
|
||||
* If a property name is provided for `callback` the created "_.pluck" style
|
||||
* callback will return the property value of the given element.
|
||||
*
|
||||
* If an array of property names is provided for `callback` the collection
|
||||
* will be sorted by each property value.
|
||||
*
|
||||
* If an object is provided for `callback` the created "_.where" style callback
|
||||
* will return `true` for elements that have the properties of the given object,
|
||||
* else `false`.
|
||||
@@ -4282,7 +4332,7 @@
|
||||
* @memberOf _
|
||||
* @category Collections
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Function|Object|string} [callback=identity] The function called
|
||||
* @param {Array|Function|Object|string} [callback=identity] The function called
|
||||
* per iteration. If a property name or object is provided it will be used
|
||||
* to create a "_.pluck" or "_.where" style callback, respectively.
|
||||
* @param {*} [thisArg] The `this` binding of `callback`.
|
||||
@@ -4295,19 +4345,37 @@
|
||||
* _.sortBy([1, 2, 3], function(num) { return this.sin(num); }, Math);
|
||||
* // => [3, 1, 2]
|
||||
*
|
||||
* var characters = [
|
||||
* { 'name': 'barney', 'age': 36 },
|
||||
* { 'name': 'fred', 'age': 40 },
|
||||
* { 'name': 'barney', 'age': 26 },
|
||||
* { 'name': 'fred', 'age': 30 }
|
||||
* ];
|
||||
*
|
||||
* // using "_.pluck" callback shorthand
|
||||
* _.sortBy(['banana', 'strawberry', 'apple'], 'length');
|
||||
* // => ['apple', 'banana', 'strawberry']
|
||||
* _.map(_.sortBy(characters, 'age'), _.values);
|
||||
* // => [['barney', 26], ['fred', 30], ['barney', 36], ['fred', 40]]
|
||||
*
|
||||
* // sorting by multiple properties
|
||||
* _.map(_.sortBy(characters, ['name', 'age']), _.values);
|
||||
* // = > [['barney', 26], ['barney', 36], ['fred', 30], ['fred', 40]]
|
||||
*/
|
||||
function sortBy(collection, callback, thisArg) {
|
||||
var index = -1,
|
||||
isArr = isArray(callback),
|
||||
length = collection ? collection.length : 0,
|
||||
result = Array(typeof length == 'number' ? length : 0);
|
||||
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
if (!isArr) {
|
||||
callback = lodash.createCallback(callback, thisArg, 3);
|
||||
}
|
||||
forEach(collection, function(value, key, collection) {
|
||||
var object = result[++index] = getObject();
|
||||
object.criteria = callback(value, key, collection);
|
||||
if (isArr) {
|
||||
object.criteria = map(callback, function(key) { return value[key]; });
|
||||
} else {
|
||||
(object.criteria = getArray())[0] = callback(value, key, collection);
|
||||
}
|
||||
object.index = index;
|
||||
object.value = value;
|
||||
});
|
||||
@@ -4317,6 +4385,9 @@
|
||||
while (length--) {
|
||||
var object = result[length];
|
||||
result[length] = object.value;
|
||||
if (!isArr) {
|
||||
releaseArray(object.criteria);
|
||||
}
|
||||
releaseObject(object);
|
||||
}
|
||||
return result;
|
||||
@@ -4354,7 +4425,7 @@
|
||||
* @type Function
|
||||
* @category Collections
|
||||
* @param {Array|Object|string} collection The collection to iterate over.
|
||||
* @param {Object} properties The object of property values to filter by.
|
||||
* @param {Object} props The object of property values to filter by.
|
||||
* @returns {Array} Returns a new array of elements that have the given properties.
|
||||
* @example
|
||||
*
|
||||
@@ -4759,29 +4830,34 @@
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {...Array} [array] The arrays to inspect.
|
||||
* @returns {Array} Returns an array of composite values.
|
||||
* @returns {Array} Returns an array of shared values.
|
||||
* @example
|
||||
*
|
||||
* _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
||||
* _.intersection([1, 2, 3], [5, 2, 1, 4], [2, 1]);
|
||||
* // => [1, 2]
|
||||
*/
|
||||
function intersection(array) {
|
||||
var args = arguments,
|
||||
argsLength = args.length,
|
||||
function intersection() {
|
||||
var args = [],
|
||||
argsIndex = -1,
|
||||
argsLength = arguments.length,
|
||||
caches = getArray(),
|
||||
index = -1,
|
||||
indexOf = getIndexOf(),
|
||||
length = array ? array.length : 0,
|
||||
result = [],
|
||||
trustIndexOf = indexOf === baseIndexOf,
|
||||
seen = getArray();
|
||||
|
||||
while (++argsIndex < argsLength) {
|
||||
var value = args[argsIndex];
|
||||
caches[argsIndex] = indexOf === baseIndexOf &&
|
||||
(value ? value.length : 0) >= largeArraySize &&
|
||||
createCache(argsIndex ? args[argsIndex] : seen);
|
||||
var value = arguments[argsIndex];
|
||||
if (isArray(value) || isArguments(value)) {
|
||||
args.push(value);
|
||||
caches.push(trustIndexOf && value.length >= largeArraySize &&
|
||||
createCache(argsIndex ? args[argsIndex] : seen));
|
||||
}
|
||||
}
|
||||
var array = args[0],
|
||||
index = -1,
|
||||
length = array ? array.length : 0,
|
||||
result = [];
|
||||
|
||||
outer:
|
||||
while (++index < length) {
|
||||
var cache = caches[0];
|
||||
@@ -5198,13 +5274,13 @@
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {...Array} [array] The arrays to inspect.
|
||||
* @returns {Array} Returns an array of composite values.
|
||||
* @returns {Array} Returns an array of combined values.
|
||||
* @example
|
||||
*
|
||||
* _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
|
||||
* // => [1, 2, 3, 101, 10]
|
||||
* _.union([1, 2, 3], [5, 2, 1, 4], [2, 1]);
|
||||
* // => [1, 2, 3, 5, 4]
|
||||
*/
|
||||
function union(array) {
|
||||
function union() {
|
||||
return baseUniq(baseFlatten(arguments, true, true));
|
||||
}
|
||||
|
||||
@@ -5284,6 +5360,38 @@
|
||||
return baseDifference(array, slice(arguments, 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array that is the smymetric difference of the provided arrays.
|
||||
* See http://en.wikipedia.org/wiki/Symmetric_difference.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Arrays
|
||||
* @param {...Array} [array] The arrays to inspect.
|
||||
* @returns {Array} Returns an array of values.
|
||||
* @example
|
||||
*
|
||||
* _.xor([1, 2, 3], [5, 2, 1, 4]);
|
||||
* // => [3, 5, 4]
|
||||
*
|
||||
* _.xor([1, 2, 5], [2, 3, 5], [3, 4, 5]);
|
||||
* // => [1, 4, 5]
|
||||
*/
|
||||
function xor() {
|
||||
var index = -1,
|
||||
length = arguments.length;
|
||||
|
||||
while (++index < length) {
|
||||
var array = arguments[index];
|
||||
if (isArray(array) || isArguments(array)) {
|
||||
var result = result
|
||||
? baseUniq(baseDifference(result, array).concat(baseDifference(array, result)))
|
||||
: array;
|
||||
}
|
||||
}
|
||||
return result || [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array of grouped elements, the first of which contains the first
|
||||
* elements of the given arrays, the second of which contains the second
|
||||
@@ -5335,6 +5443,9 @@
|
||||
length = keys ? keys.length : 0,
|
||||
result = {};
|
||||
|
||||
if (!values && length && !isArray(keys[0])) {
|
||||
values = [];
|
||||
}
|
||||
while (++index < length) {
|
||||
var key = keys[index];
|
||||
if (values) {
|
||||
@@ -5427,8 +5538,8 @@
|
||||
* @example
|
||||
*
|
||||
* var view = {
|
||||
* 'label': 'docs',
|
||||
* 'onClick': function() { console.log('clicked ' + this.label); }
|
||||
* 'label': 'docs',
|
||||
* 'onClick': function() { console.log('clicked ' + this.label); }
|
||||
* };
|
||||
*
|
||||
* _.bindAll(view);
|
||||
@@ -5537,74 +5648,6 @@
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces a callback bound to an optional `thisArg`. If `func` is a property
|
||||
* name the created callback will return the property value for a given element.
|
||||
* If `func` is an object the created callback will return `true` for elements
|
||||
* that contain the equivalent object properties, otherwise it will return `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Functions
|
||||
* @param {*} [func=identity] The value to convert to a callback.
|
||||
* @param {*} [thisArg] The `this` binding of the created callback.
|
||||
* @param {number} [argCount] The number of arguments the callback accepts.
|
||||
* @returns {Function} Returns a callback function.
|
||||
* @example
|
||||
*
|
||||
* var characters = [
|
||||
* { 'name': 'barney', 'age': 36 },
|
||||
* { 'name': 'fred', 'age': 40 }
|
||||
* ];
|
||||
*
|
||||
* // wrap to create custom callback shorthands
|
||||
* _.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) {
|
||||
* var match = /^(.+?)__([gl]t)(.+)$/.exec(callback);
|
||||
* return !match ? func(callback, thisArg) : function(object) {
|
||||
* return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3];
|
||||
* };
|
||||
* });
|
||||
*
|
||||
* _.filter(characters, 'age__gt38');
|
||||
* // => [{ 'name': 'fred', 'age': 40 }]
|
||||
*/
|
||||
function createCallback(func, thisArg, argCount) {
|
||||
var type = typeof func;
|
||||
if (func == null || type == 'function') {
|
||||
return baseCreateCallback(func, thisArg, argCount);
|
||||
}
|
||||
// handle "_.pluck" style callback shorthands
|
||||
if (type != 'object') {
|
||||
return function(object) {
|
||||
return object[func];
|
||||
};
|
||||
}
|
||||
var props = keys(func),
|
||||
key = props[0],
|
||||
a = func[key];
|
||||
|
||||
// handle "_.where" style callback shorthands
|
||||
if (props.length == 1 && a === a && !isObject(a)) {
|
||||
// fast path the common case of providing an object with a single
|
||||
// property containing a primitive value
|
||||
return function(object) {
|
||||
var b = object[key];
|
||||
return a === b && (a !== 0 || (1 / a == 1 / b));
|
||||
};
|
||||
}
|
||||
return function(object) {
|
||||
var length = props.length,
|
||||
result = false;
|
||||
|
||||
while (length--) {
|
||||
if (!(result = baseIsEqual(object[props[length]], func[props[length]], null, true))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function which accepts one or more arguments of `func` that when
|
||||
* invoked either executes `func` returning its result, if all `func` arguments
|
||||
@@ -5790,8 +5833,8 @@
|
||||
* @returns {number} Returns the timer id.
|
||||
* @example
|
||||
*
|
||||
* _.defer(function() { console.log('deferred'); });
|
||||
* // returns from the function before 'deferred' is logged
|
||||
* _.defer(function(text) { console.log(text); }, 'deferred');
|
||||
* // logs 'deferred' after one or more milliseconds
|
||||
*/
|
||||
function defer(func) {
|
||||
if (!isFunction(func)) {
|
||||
@@ -5800,15 +5843,6 @@
|
||||
var args = slice(arguments, 1);
|
||||
return setTimeout(function() { func.apply(undefined, args); }, 1);
|
||||
}
|
||||
// use `setImmediate` if available in Node.js
|
||||
if (setImmediate) {
|
||||
defer = function(func) {
|
||||
if (!isFunction(func)) {
|
||||
throw new TypeError;
|
||||
}
|
||||
return setImmediate.apply(context, arguments);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes the `func` function after `wait` milliseconds. Additional arguments
|
||||
@@ -5823,9 +5857,8 @@
|
||||
* @returns {number} Returns the timer id.
|
||||
* @example
|
||||
*
|
||||
* var log = _.bind(console.log, console);
|
||||
* _.delay(log, 1000, 'logged later');
|
||||
* // => 'logged later' (Appears after one second.)
|
||||
* _.delay(function(text) { console.log(text); }, 1000, 'later');
|
||||
* // => logs 'later' after one second
|
||||
*/
|
||||
function delay(func, wait) {
|
||||
if (!isFunction(func)) {
|
||||
@@ -6056,6 +6089,93 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a function that returns `value`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {*} value The value to return from the new function.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* var object = { 'name': 'fred' };
|
||||
* var getter = _.constant(object);
|
||||
* getter() === object;
|
||||
* // => true
|
||||
*/
|
||||
function constant(value) {
|
||||
return function() {
|
||||
return value;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces a callback bound to an optional `thisArg`. If `func` is a property
|
||||
* name the created callback will return the property value for a given element.
|
||||
* If `func` is an object the created callback will return `true` for elements
|
||||
* that contain the equivalent object properties, otherwise it will return `false`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {*} [func=identity] The value to convert to a callback.
|
||||
* @param {*} [thisArg] The `this` binding of the created callback.
|
||||
* @param {number} [argCount] The number of arguments the callback accepts.
|
||||
* @returns {Function} Returns a callback function.
|
||||
* @example
|
||||
*
|
||||
* var characters = [
|
||||
* { 'name': 'barney', 'age': 36 },
|
||||
* { 'name': 'fred', 'age': 40 }
|
||||
* ];
|
||||
*
|
||||
* // wrap to create custom callback shorthands
|
||||
* _.createCallback = _.wrap(_.createCallback, function(func, callback, thisArg) {
|
||||
* var match = /^(.+?)__([gl]t)(.+)$/.exec(callback);
|
||||
* return !match ? func(callback, thisArg) : function(object) {
|
||||
* return match[2] == 'gt' ? object[match[1]] > match[3] : object[match[1]] < match[3];
|
||||
* };
|
||||
* });
|
||||
*
|
||||
* _.filter(characters, 'age__gt38');
|
||||
* // => [{ 'name': 'fred', 'age': 40 }]
|
||||
*/
|
||||
function createCallback(func, thisArg, argCount) {
|
||||
var type = typeof func;
|
||||
if (func == null || type == 'function') {
|
||||
return baseCreateCallback(func, thisArg, argCount);
|
||||
}
|
||||
// handle "_.pluck" style callback shorthands
|
||||
if (type != 'object') {
|
||||
return property(func);
|
||||
}
|
||||
var props = keys(func),
|
||||
key = props[0],
|
||||
a = func[key];
|
||||
|
||||
// handle "_.where" style callback shorthands
|
||||
if (props.length == 1 && a === a && !isObject(a)) {
|
||||
// fast path the common case of providing an object with a single
|
||||
// property containing a primitive value
|
||||
return function(object) {
|
||||
var b = object[key];
|
||||
return a === b && (a !== 0 || (1 / a == 1 / b));
|
||||
};
|
||||
}
|
||||
return function(object) {
|
||||
var length = props.length,
|
||||
result = false;
|
||||
|
||||
while (length--) {
|
||||
if (!(result = baseIsEqual(object[props[length]], func[props[length]], null, true))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the characters `&`, `<`, `>`, `"`, and `'` in `string` to their
|
||||
* corresponding HTML entities.
|
||||
@@ -6093,51 +6213,71 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds function properties of a source object to the `lodash` function and
|
||||
* chainable wrapper.
|
||||
* Adds function properties of a source object to the destination object.
|
||||
* If `object` is a function methods will be added to its prototype as well.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {Object} object The object of function properties to add to `lodash`.
|
||||
* @param {Object} object The object of function properties to add to `lodash`.
|
||||
* @param {Function|Object} [object=lodash] object The destination object.
|
||||
* @param {Object} source The object of functions to add.
|
||||
* @param {Object} [options] The options object.
|
||||
* @param {boolean} [options.chain=true] Specify whether the functions added are chainable.
|
||||
* @example
|
||||
*
|
||||
* _.mixin({
|
||||
* 'capitalize': function(string) {
|
||||
* return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
|
||||
* }
|
||||
* });
|
||||
* function capitalize(string) {
|
||||
* return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();
|
||||
* }
|
||||
*
|
||||
* _.mixin({ 'capitalize': capitalize });
|
||||
* _.capitalize('fred');
|
||||
* // => 'Fred'
|
||||
*
|
||||
* _('fred').capitalize().value();
|
||||
* // => 'Fred'
|
||||
*
|
||||
* _.mixin({ 'capitalize': capitalize }, { 'chain': false });
|
||||
* _('fred').capitalize();
|
||||
* // => 'Fred'
|
||||
*/
|
||||
function mixin(object, source) {
|
||||
var ctor = object,
|
||||
isFunc = !source || isFunction(ctor);
|
||||
function mixin(object, source, options) {
|
||||
var chain = true,
|
||||
methodNames = source && functions(source);
|
||||
|
||||
if (!source) {
|
||||
if (!source || (!options && !methodNames.length)) {
|
||||
if (options == null) {
|
||||
options = source;
|
||||
}
|
||||
ctor = lodashWrapper;
|
||||
source = object;
|
||||
object = lodash;
|
||||
methodNames = functions(source);
|
||||
}
|
||||
forEach(functions(source), function(methodName) {
|
||||
if (options === false) {
|
||||
chain = false;
|
||||
} else if (isObject(options) && 'chain' in options) {
|
||||
chain = options.chain;
|
||||
}
|
||||
var ctor = object,
|
||||
isFunc = isFunction(ctor);
|
||||
|
||||
forEach(methodNames, function(methodName) {
|
||||
var func = object[methodName] = source[methodName];
|
||||
if (isFunc) {
|
||||
ctor.prototype[methodName] = function() {
|
||||
var value = this.__wrapped__,
|
||||
var chainAll = this.__chain__,
|
||||
value = this.__wrapped__,
|
||||
args = [value];
|
||||
|
||||
push.apply(args, arguments);
|
||||
var result = func.apply(object, args);
|
||||
if (value && typeof value == 'object' && value === result) {
|
||||
return this;
|
||||
if (chain || chainAll) {
|
||||
if (value === result && isObject(result)) {
|
||||
return this;
|
||||
}
|
||||
result = new ctor(result);
|
||||
result.__chain__ = chainAll;
|
||||
}
|
||||
result = new ctor(result);
|
||||
result.__chain__ = this.__chain__;
|
||||
return result;
|
||||
};
|
||||
}
|
||||
@@ -6177,6 +6317,23 @@
|
||||
// no operation performed
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the number of milliseconds that have elapsed since the Unix epoch
|
||||
* (1 January 1970 00:00:00 UTC).
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @example
|
||||
*
|
||||
* var stamp = _.now();
|
||||
* _.defer(function() { console.log(_.now() - stamp); });
|
||||
* // => logs the number of milliseconds it took for the deferred function to be called
|
||||
*/
|
||||
var now = reNative.test(now = Date.now) && now || function() {
|
||||
return new Date().getTime();
|
||||
};
|
||||
|
||||
/**
|
||||
* Converts the given value into an integer of the specified radix.
|
||||
* If `radix` is `undefined` or `0` a `radix` of `10` is used unless the
|
||||
@@ -6201,6 +6358,36 @@
|
||||
return nativeParseInt(isString(value) ? value.replace(reLeadingSpacesAndZeros, '') : value, radix || 0);
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a "_.pluck" style function, which returns the `key` value of a
|
||||
* given object.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {string} key The name of the property to retrieve.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* var characters = [
|
||||
* { 'name': 'fred', 'age': 40 },
|
||||
* { 'name': 'barney', 'age': 36 }
|
||||
* ];
|
||||
*
|
||||
* var getName = _.property('name');
|
||||
*
|
||||
* _.map(characters, getName);
|
||||
* // => ['barney', 'fred']
|
||||
*
|
||||
* _.sortBy(characters, getName);
|
||||
* // => [{ 'name': 'barney', 'age': 36 }, { 'name': 'fred', 'age': 40 }]
|
||||
*/
|
||||
function property(key) {
|
||||
return function(object) {
|
||||
return object[key];
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Produces a random number between `min` and `max` (inclusive). If only one
|
||||
* argument is provided a number between `0` and the given number will be
|
||||
@@ -6260,7 +6447,7 @@
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the value of `property` on `object`. If `property` is a function
|
||||
* Resolves the value of property `key` on `object`. If `key` is a function
|
||||
* it will be invoked with the `this` binding of `object` and its result returned,
|
||||
* else the property value is returned. If `object` is falsey then `undefined`
|
||||
* is returned.
|
||||
@@ -6269,7 +6456,7 @@
|
||||
* @memberOf _
|
||||
* @category Utilities
|
||||
* @param {Object} object The object to inspect.
|
||||
* @param {string} property The property to get the value of.
|
||||
* @param {string} key The name of the property to resolve.
|
||||
* @returns {*} Returns the resolved value.
|
||||
* @example
|
||||
*
|
||||
@@ -6286,10 +6473,10 @@
|
||||
* _.result(object, 'stuff');
|
||||
* // => 'nonsense'
|
||||
*/
|
||||
function result(object, property) {
|
||||
function result(object, key) {
|
||||
if (object) {
|
||||
var value = object[property];
|
||||
return isFunction(value) ? object[property]() : value;
|
||||
var value = object[key];
|
||||
return isFunction(value) ? object[key]() : value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6353,8 +6540,8 @@
|
||||
* // => 'hello mustache!'
|
||||
*
|
||||
* // using the `imports` option to import jQuery
|
||||
* var list = '<% $.each(people, function(name) { %><li><%- name %></li><% }); %>';
|
||||
* _.template(list, { 'people': ['fred', 'barney'] }, { 'imports': { '$': jQuery } });
|
||||
* var list = '<% jq.each(people, function(name) { %><li><%- name %></li><% }); %>';
|
||||
* _.template(list, { 'people': ['fred', 'barney'] }, { 'imports': { 'jq': jQuery } });
|
||||
* // => '<li>fred</li><li>barney</li>'
|
||||
*
|
||||
* // using the `sourceURL` option to specify a custom sourceURL for the template
|
||||
@@ -6633,7 +6820,7 @@
|
||||
* _(characters).chain()
|
||||
* .first()
|
||||
* .pick('age')
|
||||
* .value()
|
||||
* .value();
|
||||
* // => { 'age': 36 }
|
||||
*/
|
||||
function wrapperChain() {
|
||||
@@ -6686,6 +6873,7 @@
|
||||
lodash.chain = chain;
|
||||
lodash.compact = compact;
|
||||
lodash.compose = compose;
|
||||
lodash.constant = constant;
|
||||
lodash.countBy = countBy;
|
||||
lodash.create = create;
|
||||
lodash.createCallback = createCallback;
|
||||
@@ -6712,6 +6900,7 @@
|
||||
lodash.invoke = invoke;
|
||||
lodash.keys = keys;
|
||||
lodash.map = map;
|
||||
lodash.mapValues = mapValues;
|
||||
lodash.max = max;
|
||||
lodash.memoize = memoize;
|
||||
lodash.merge = merge;
|
||||
@@ -6723,6 +6912,7 @@
|
||||
lodash.partialRight = partialRight;
|
||||
lodash.pick = pick;
|
||||
lodash.pluck = pluck;
|
||||
lodash.property = property;
|
||||
lodash.pull = pull;
|
||||
lodash.range = range;
|
||||
lodash.reject = reject;
|
||||
@@ -6741,6 +6931,7 @@
|
||||
lodash.where = where;
|
||||
lodash.without = without;
|
||||
lodash.wrap = wrap;
|
||||
lodash.xor = xor;
|
||||
lodash.zip = zip;
|
||||
lodash.zipObject = zipObject;
|
||||
|
||||
@@ -6798,6 +6989,7 @@
|
||||
lodash.mixin = mixin;
|
||||
lodash.noConflict = noConflict;
|
||||
lodash.noop = noop;
|
||||
lodash.now = now;
|
||||
lodash.parseInt = parseInt;
|
||||
lodash.random = random;
|
||||
lodash.reduce = reduce;
|
||||
@@ -6821,20 +7013,15 @@
|
||||
lodash.include = contains;
|
||||
lodash.inject = reduce;
|
||||
|
||||
forOwn(lodash, function(func, methodName) {
|
||||
if (!lodash.prototype[methodName]) {
|
||||
lodash.prototype[methodName] = function() {
|
||||
var args = [this.__wrapped__],
|
||||
chainAll = this.__chain__;
|
||||
|
||||
push.apply(args, arguments);
|
||||
var result = func.apply(lodash, args);
|
||||
return chainAll
|
||||
? new lodashWrapper(result, chainAll)
|
||||
: result;
|
||||
};
|
||||
}
|
||||
});
|
||||
mixin(function() {
|
||||
var source = {}
|
||||
forOwn(lodash, function(func, methodName) {
|
||||
if (!lodash.prototype[methodName]) {
|
||||
source[methodName] = func;
|
||||
}
|
||||
});
|
||||
return source;
|
||||
}(), false);
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
@@ -6870,7 +7057,7 @@
|
||||
* @memberOf _
|
||||
* @type string
|
||||
*/
|
||||
lodash.VERSION = '2.3.0';
|
||||
lodash.VERSION = '2.4.0';
|
||||
|
||||
// add "Chaining" functions to the wrapper
|
||||
lodash.prototype.chain = wrapperChain;
|
||||
@@ -6891,7 +7078,7 @@
|
||||
};
|
||||
});
|
||||
|
||||
// add `Array` functions that return the wrapped value
|
||||
// add `Array` functions that return the existing wrapped value
|
||||
baseEach(['push', 'reverse', 'sort', 'unshift'], function(methodName) {
|
||||
var func = arrayRef[methodName];
|
||||
lodash.prototype[methodName] = function() {
|
||||
@@ -6946,9 +7133,8 @@
|
||||
// some AMD build optimizers like r.js check for condition patterns like the following:
|
||||
if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
|
||||
// Expose Lo-Dash to the global object even when an AMD loader is present in
|
||||
// case Lo-Dash was injected by a third-party script and not intended to be
|
||||
// loaded as a module. The global assignment can be reverted in the Lo-Dash
|
||||
// module by its `noConflict()` method.
|
||||
// case Lo-Dash is loaded with a RequireJS shim config.
|
||||
// See http://requirejs.org/docs/api.html#config-shim
|
||||
root._ = _;
|
||||
|
||||
// define as an anonymous module so, through path mapping, it can be
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lodash",
|
||||
"version": "2.3.0",
|
||||
"version": "2.4.0",
|
||||
"description": "A utility library delivering consistency, customization, performance, & extras.",
|
||||
"homepage": "http://lodash.com/",
|
||||
"license": "MIT",
|
||||
|
||||
198
test/asset/qunit-extras.js
Normal file
198
test/asset/qunit-extras.js
Normal file
@@ -0,0 +1,198 @@
|
||||
;(function(root, undefined) {
|
||||
'use strict';
|
||||
|
||||
/** Native method shortcut */
|
||||
var unshift = Array.prototype.unshift;
|
||||
|
||||
/** Used to match HTML entities */
|
||||
var reEscapedHtml = /(&|<|>|"|')/g;
|
||||
|
||||
/** Used to match parts of the assert message */
|
||||
var reDied = /^Died on test #\d+/,
|
||||
reExpected = /Expected: *<\/th><td><pre>([\s\S]*?)<\/pre>/,
|
||||
reMessage = /^<span class='test-message'>([\s\S]*?)<\/span>/;
|
||||
|
||||
/** Used to convert HTML entities to characters */
|
||||
var htmlUnescapes = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
''': "'"
|
||||
};
|
||||
|
||||
/** Detect free variable `exports` */
|
||||
var freeExports = typeof exports == 'object' && exports;
|
||||
|
||||
/** Detect free variable `global`, from Node.js or Browserified code, and use it as `root` */
|
||||
var freeGlobal = typeof global == 'object' && global;
|
||||
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
|
||||
root = freeGlobal;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Checks if a given value is present in an array using strict equality
|
||||
* for comparisons, i.e. `===`.
|
||||
*
|
||||
* @oruvate
|
||||
* @param {Array} array The array to iterate over.
|
||||
* @param {*} target The value to check for.
|
||||
* @returns {boolean} Returns `true` if the `target` element is found, else `false`.
|
||||
*/
|
||||
function contains(array, value) {
|
||||
var index = -1,
|
||||
length = array ? array.length : 0;
|
||||
|
||||
while (++index < length) {
|
||||
if (array[index] === value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the value of `property` on `object`. If `object` is falsey then
|
||||
* `undefined` is returned.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to inspect.
|
||||
* @param {string} property The property to get the value of.
|
||||
* @returns {*} Returns the resolved value.
|
||||
*/
|
||||
function result(object, property) {
|
||||
return object ? object[property] : undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the HTML entities `&`, `<`, `>`, `"`, and `'`
|
||||
* in `string` to their corresponding characters.
|
||||
*
|
||||
* @private
|
||||
* @param {string} string The string to unescape.
|
||||
* @returns {string} Returns the unescaped string.
|
||||
*/
|
||||
function unescape(string) {
|
||||
return string == null ? '' : String(string).replace(reEscapedHtml, unescapeHtmlChar);
|
||||
}
|
||||
|
||||
/**
|
||||
* Used by `unescape` to convert HTML entities to characters.
|
||||
*
|
||||
* @private
|
||||
* @param {string} match The matched character to unescape.
|
||||
* @returns {string} Returns the unescaped character.
|
||||
*/
|
||||
function unescapeHtmlChar(match) {
|
||||
return htmlUnescapes[match];
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Installs the QUnit additions on the given `context` object.
|
||||
*
|
||||
* @memberOf exports
|
||||
* @param {Object} context The context object.
|
||||
*/
|
||||
function runInContext(context) {
|
||||
// exit early if no `context` is provided or if `QUnit` does not exist
|
||||
if (!context || !context.QUnit) {
|
||||
return;
|
||||
}
|
||||
|
||||
/** Shorten `context.QUnit.QUnit` to `context.QUnit` */
|
||||
var QUnit = context.QUnit = context.QUnit.QUnit || context.QUnit;
|
||||
|
||||
/** The number of retries async tests have to succeed */
|
||||
QUnit.config.asyncRetries = 0;
|
||||
|
||||
/** An object of excused tests and assertions */
|
||||
QUnit.config.excused = {};
|
||||
|
||||
/**
|
||||
* A callback triggered at the start of every test.
|
||||
*
|
||||
* @memberOf QUnit
|
||||
* @param {Object} details An object with `module` and `name` properties.
|
||||
*/
|
||||
QUnit.testStart(function(details) {
|
||||
var excused = QUnit.config.excused || {},
|
||||
excusedTests = excused[details.module],
|
||||
excusedAsserts = excusedTests && excusedTests[details.name];
|
||||
|
||||
var test = QUnit.config.current,
|
||||
finish = test.finish;
|
||||
|
||||
// allow async tests to retry
|
||||
if (test.async && !test.retries) {
|
||||
test.retries = 0;
|
||||
test.finish = function() {
|
||||
var asserts = this.assertions,
|
||||
index = -1,
|
||||
length = asserts.length,
|
||||
queue = QUnit.config.queue;
|
||||
|
||||
while (++index < length) {
|
||||
var assert = asserts[index];
|
||||
if (!assert.result && this.retries < QUnit.config.asyncRetries) {
|
||||
this.retries++;
|
||||
asserts.length = 0;
|
||||
|
||||
var oldLength = queue.length;
|
||||
this.queue();
|
||||
unshift.apply(queue, queue.splice(oldLength, queue.length - oldLength));
|
||||
return;
|
||||
}
|
||||
}
|
||||
finish.call(this);
|
||||
};
|
||||
}
|
||||
// nothing to excuse
|
||||
if (!excusedAsserts) {
|
||||
return;
|
||||
}
|
||||
// excuse the entire test
|
||||
if (excusedAsserts === true) {
|
||||
test.async = false;
|
||||
test.callback = function() {};
|
||||
test.expected = 0;
|
||||
return;
|
||||
}
|
||||
// excuse specific assertions
|
||||
test.finish = function() {
|
||||
var asserts = this.assertions,
|
||||
index = -1,
|
||||
length = asserts.length;
|
||||
|
||||
while (++index < length) {
|
||||
var assert = asserts[index],
|
||||
message = unescape(result(reMessage.exec(assert.message), 1)),
|
||||
died = result(reDied.exec(message), 0),
|
||||
expected = unescape(result(reExpected.exec(assert.message), 1));
|
||||
|
||||
if ((message && contains(excusedAsserts, message)) ||
|
||||
(died && contains(excusedAsserts, died)) ||
|
||||
(expected && (
|
||||
contains(excusedAsserts, expected) ||
|
||||
contains(excusedAsserts, expected.replace(/\s+/g, ''))
|
||||
))) {
|
||||
assert.result = true;
|
||||
}
|
||||
}
|
||||
finish.call(this);
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// expose QUnit extras
|
||||
if (freeExports && !freeExports.nodeType) {
|
||||
freeExports.runInContext = runInContext;
|
||||
} else {
|
||||
runInContext(root);
|
||||
}
|
||||
}(this));
|
||||
@@ -22,76 +22,38 @@
|
||||
<script src="../vendor/jquery/jquery.js"></script>
|
||||
<script src="../vendor/platform.js/platform.js"></script>
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
<script src="./asset/qunit-extras.js"></script>
|
||||
<script src="./asset/test-ui.js"></script>
|
||||
<script src="../lodash.js"></script>
|
||||
<script>
|
||||
var lodash = _.noConflict();
|
||||
|
||||
QUnit.config.asyncRetries = 5;
|
||||
QUnit.config.hidepassed = true;
|
||||
|
||||
// excuse tests we intentionally fail or those with problems
|
||||
QUnit.config.excused = {
|
||||
'Backbone.Collection': {
|
||||
'set with many models does not overflow the stack': true
|
||||
},
|
||||
'Backbone.Router': {
|
||||
'#2656 - No trailing slash on root.': true,
|
||||
'#2765 - Fragment matching sans query/hash.': true
|
||||
}
|
||||
};
|
||||
|
||||
// only excuse `Backbone.Router` tests in IE < 8
|
||||
if (!(document.attachEvent && (document.documentMode || 0) < 8)) {
|
||||
delete QUnit.config.excused['Backbone.Router'];
|
||||
}
|
||||
|
||||
// assign results to `global_test_results` for Sauce Labs
|
||||
var global_test_results;
|
||||
QUnit.done(function(results) {
|
||||
global_test_results = results;
|
||||
});
|
||||
|
||||
// skip tests we intentionally fail or those with problems
|
||||
(function() {
|
||||
var skipped = {
|
||||
'Backbone.Collection': {
|
||||
'set with many models does not overflow the stack': true
|
||||
},
|
||||
'Backbone.Router': {
|
||||
'#2656 - No trailing slash on root.': true,
|
||||
'#2765 - Fragment matching sans query/hash.': true
|
||||
}
|
||||
};
|
||||
|
||||
// only skip `Backbone.Router` tests in IE < 8
|
||||
if (!(document.attachEvent && (document.documentMode || 0) < 8)) {
|
||||
delete skipped['Backbone.Router'];
|
||||
}
|
||||
|
||||
QUnit.testStart(function(details) {
|
||||
var test = QUnit.config.current,
|
||||
finish = test.finish,
|
||||
skippedTests = skipped[details.module],
|
||||
skippedAsserts = skippedTests && skippedTests[details.name];
|
||||
|
||||
if (!skippedAsserts) {
|
||||
return;
|
||||
}
|
||||
if (skippedAsserts === true) {
|
||||
test.async = false;
|
||||
test.callback = function() {};
|
||||
test.expected = 0;
|
||||
return;
|
||||
}
|
||||
test.finish = function() {
|
||||
var index = -1,
|
||||
asserts = this.assertions,
|
||||
length = asserts.length;
|
||||
|
||||
while (++index < length) {
|
||||
var assert = asserts[index],
|
||||
message = _.unescape(_.result(/^<span class='test-message'>([\s\S]*?)<\/span>/.exec(assert.message), 1)),
|
||||
died = _.result(/^Died on test #\d+/.exec(message), 0),
|
||||
expected = _.unescape(_.result(/Expected: *<\/th><td><pre>([\s\S]*?)<\/pre>/.exec(assert.message), 1));
|
||||
|
||||
if ((message && _.contains(skippedAsserts, message)) ||
|
||||
(died && _.contains(skippedAsserts, died)) ||
|
||||
(expected && (_.contains(skippedAsserts, expected) ||
|
||||
_.contains(skippedAsserts, expected.replace(/\s+/g, '')))
|
||||
)) {
|
||||
assert.result = true;
|
||||
}
|
||||
}
|
||||
finish.call(this);
|
||||
};
|
||||
});
|
||||
}());
|
||||
|
||||
// load Lo-Dash again to overwrite the existing `_` value
|
||||
// load the build of Lo-Dash
|
||||
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
||||
</script>
|
||||
<script>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<body>
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
<script src="../vendor/platform.js/platform.js"></script>
|
||||
<script src="./asset/qunit-extras.js"></script>
|
||||
<script src="./asset/test-ui.js"></script>
|
||||
<div id="qunit"></div>
|
||||
<div id="exports"></div>
|
||||
@@ -80,12 +81,12 @@
|
||||
global_test_results = results;
|
||||
});
|
||||
|
||||
// load Lo-Dash again to overwrite the existing `_` value
|
||||
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
|
||||
// clear existing `_` value
|
||||
window._ = undefined;
|
||||
|
||||
// load test.js if not using require.js
|
||||
// load Lo-Dash and test scripts
|
||||
document.write(ui.urlParams.loader == 'none'
|
||||
? '<script src="test.js"><\/script>'
|
||||
? '<script src="' + ui.buildPath + '"><\/script><script src="test.js"><\/script>'
|
||||
: '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
|
||||
);
|
||||
</script>
|
||||
@@ -155,8 +156,8 @@
|
||||
underscoreModule = underscore.noConflict();
|
||||
underscoreModule.moduleName = 'underscore';
|
||||
}
|
||||
if (lodash && lodash.noConflict) {
|
||||
lodashModule = lodash.noConflict();
|
||||
if (lodash) {
|
||||
lodashModule = lodash;
|
||||
lodashModule.moduleName = 'lodash';
|
||||
}
|
||||
if (ui.isModularize) {
|
||||
|
||||
@@ -1,48 +1,75 @@
|
||||
;(function() {
|
||||
'use strict';
|
||||
|
||||
var ecstatic = require('ecstatic'),
|
||||
http = require('http'),
|
||||
path = require('path'),
|
||||
request = require('request'),
|
||||
SauceTunnel = require('sauce-tunnel'),
|
||||
url = require('url');
|
||||
/** Environment shortcut */
|
||||
var env = process.env;
|
||||
|
||||
var attempts = -1,
|
||||
prevLine = '';
|
||||
|
||||
var port = 8081,
|
||||
username = process.env.SAUCE_USERNAME,
|
||||
accessKey = process.env.SAUCE_ACCESS_KEY,
|
||||
tunnelId = 'lodash_' + process.env.TRAVIS_JOB_NUMBER;
|
||||
|
||||
if (isFinite(process.env.TRAVIS_PULL_REQUEST)) {
|
||||
if (isFinite(env.TRAVIS_PULL_REQUEST)) {
|
||||
console.error('Testing skipped for pull requests');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
var runnerPathname = (function() {
|
||||
var args = process.argv;
|
||||
return args.length > 2
|
||||
? '/' + args[args.length - 1].replace(/^\W+/, '')
|
||||
: '/test/index.html';
|
||||
}());
|
||||
/** Load Node.js modules */
|
||||
var http = require('http'),
|
||||
path = require('path'),
|
||||
url = require('url');
|
||||
|
||||
var runnerQuery = url.parse(runnerPathname, true).query,
|
||||
isBackbone = /\bbackbone\b/i.test(runnerPathname),
|
||||
isMobile = /\bmobile\b/i.test(runnerQuery.build),
|
||||
isModern = /\bmodern\b/i.test(runnerQuery.build);
|
||||
/** Load other modules */
|
||||
var _ = require('../lodash.js'),
|
||||
ecstatic = require('ecstatic'),
|
||||
request = require('request'),
|
||||
SauceTunnel = require('sauce-tunnel');
|
||||
|
||||
/** Used by `logInline` to clear previously logged messages */
|
||||
var prevLine = '';
|
||||
|
||||
/** Used to display the wait throbber */
|
||||
var throbberId,
|
||||
throbberDelay = 500,
|
||||
waitCount = -1;
|
||||
|
||||
/** Used as request `auth` and `options` values */
|
||||
var accessKey = env.SAUCE_ACCESS_KEY,
|
||||
build = env.TRAVIS_COMMIT.slice(0, 10),
|
||||
port = 9001,
|
||||
tunnelId = 'lodash_' + env.TRAVIS_JOB_NUMBER,
|
||||
username = env.SAUCE_USERNAME;
|
||||
|
||||
var compatMode = process.argv.reduce(function(result, value) {
|
||||
return optionToValue('compatMode', value) || result;
|
||||
}, null);
|
||||
|
||||
var runner = process.argv.reduce(function(result, value) {
|
||||
value = optionToValue('runner', value);
|
||||
return value == null
|
||||
? result
|
||||
: '/' + value.replace(/^\W+/, '');
|
||||
}, '/test/index.html');
|
||||
|
||||
var sessionName = process.argv.reduce(function(result, value) {
|
||||
return optionToValue('name', value) || result;
|
||||
}, 'lodash tests');
|
||||
|
||||
var tags = process.argv.reduce(function(result, value) {
|
||||
value = optionToArray('tags', value);
|
||||
return value.length
|
||||
? _.union(result, value)
|
||||
: result;
|
||||
}, []);
|
||||
|
||||
/** List of platforms to load the runner on */
|
||||
var platforms = [
|
||||
['Windows 7', 'chrome', ''],
|
||||
['Windows 7', 'firefox', '25'],
|
||||
['Windows 7', 'firefox', '20'],
|
||||
['Windows 7', 'firefox', '10'],
|
||||
['Windows 7', 'firefox', '6'],
|
||||
['Windows 7', 'firefox', '4'],
|
||||
['Windows 7', 'firefox', '3'],
|
||||
['WIN8.1', 'internet explorer', '11'],
|
||||
['Windows 7', 'internet explorer', '10'],
|
||||
['Windows 8.1', 'chrome', '31'],
|
||||
['Windows 8.1', 'chrome', '28'],
|
||||
['Windows 8.1', 'chrome', '26'],
|
||||
['OS X 10.6', 'firefox', '25'],
|
||||
['OS X 10.6', 'firefox', '20'],
|
||||
['OS X 10.6', 'firefox', '10'],
|
||||
['OS X 10.6', 'firefox', '6'],
|
||||
['OS X 10.6', 'firefox', '4'],
|
||||
['Windows 7', 'firefox', '3.6'],
|
||||
['Windows 8.1', 'internet explorer', '11'],
|
||||
['Windows 8', 'internet explorer', '10'],
|
||||
['Windows 7', 'internet explorer', '9'],
|
||||
['Windows 7', 'internet explorer', '8'],
|
||||
['Windows XP', 'internet explorer', '7'],
|
||||
@@ -50,14 +77,21 @@
|
||||
//['Windows 7', 'opera', '12'],
|
||||
//['Windows 7', 'opera', '11'],
|
||||
['OS X 10.8', 'safari', '6'],
|
||||
['Windows 7', 'safari', '5']
|
||||
['Windows 7', 'safari', '5'],
|
||||
['Windows XP', 'safari', '4']
|
||||
];
|
||||
|
||||
/** Used to tailor the `platforms` array */
|
||||
var runnerQuery = url.parse(runner, true).query,
|
||||
isBackbone = /\bbackbone\b/i.test(runner),
|
||||
isMobile = /\bmobile\b/i.test(runnerQuery.build),
|
||||
isModern = /\bmodern\b/i.test(runnerQuery.build);
|
||||
|
||||
// platforms to test IE compat mode
|
||||
if (runnerQuery.compat) {
|
||||
if (compatMode) {
|
||||
platforms = [
|
||||
['WIN8.1', 'internet explorer', '11'],
|
||||
['Windows 7', 'internet explorer', '10'],
|
||||
['Windows 8.1', 'internet explorer', '11'],
|
||||
['Windows 8', 'internet explorer', '10'],
|
||||
['Windows 7', 'internet explorer', '9'],
|
||||
['Windows 7', 'internet explorer', '8']
|
||||
];
|
||||
@@ -85,45 +119,20 @@
|
||||
case 'firefox': return version >= 10;
|
||||
case 'internet explorer': return version >= 9;
|
||||
case 'opera': return version >= 12;
|
||||
case 'safari': return version >= (isMobile ? 5 : 6);
|
||||
case 'safari': return version >= (isMobile ? 3 : 6);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
// create a web server for the local dir
|
||||
var mount = ecstatic({
|
||||
'root': process.cwd(),
|
||||
'cache': false
|
||||
});
|
||||
|
||||
http.createServer(function(req, res) {
|
||||
var compat = url.parse(req.url, true).query.compat;
|
||||
if (compat) {
|
||||
// see http://msdn.microsoft.com/en-us/library/ff955275(v=vs.85).aspx
|
||||
res.setHeader('X-UA-Compatible', 'IE=' + compat);
|
||||
}
|
||||
mount(req, res);
|
||||
}).listen(port);
|
||||
|
||||
// set up Sauce Connect so we can use this server from Sauce Labs
|
||||
var tunnelTimeout = 10000,
|
||||
tunnel = new SauceTunnel(username, accessKey, tunnelId, true, tunnelTimeout);
|
||||
|
||||
console.log('Opening Sauce Connect tunnel...');
|
||||
|
||||
tunnel.start(function(success) {
|
||||
if (success) {
|
||||
console.log('Sauce Connect tunnel opened');
|
||||
runTests();
|
||||
} else {
|
||||
console.error('Failed to open Sauce Connect tunnel');
|
||||
process.exit(2);
|
||||
}
|
||||
});
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Writes an inline message to standard output.
|
||||
*
|
||||
* @private
|
||||
* @param {string} text The text to log.
|
||||
*/
|
||||
function logInline(text) {
|
||||
var blankLine = repeat(' ', prevLine.length);
|
||||
if (text.length > 40) {
|
||||
@@ -133,67 +142,63 @@
|
||||
process.stdout.write(text + blankLine.slice(text.length) + '\r');
|
||||
}
|
||||
|
||||
function repeat(text, times) {
|
||||
return Array(times + 1).join(text);
|
||||
/**
|
||||
* Writes the wait throbber to standard output.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function logThrobber() {
|
||||
logInline('Please wait' + repeat('.', (++waitCount % 3) + 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a comma separated option value into an array.
|
||||
*
|
||||
* @private
|
||||
* @param {string} name The name of the option to inspect.
|
||||
* @param {string} string The options string.
|
||||
* @returns {Array} Returns the new converted array.
|
||||
*/
|
||||
function optionToArray(name, string) {
|
||||
return _.compact(_.isArray(string)
|
||||
? string
|
||||
: _.invoke((optionToValue(name, string) || '').split(/, */), 'trim')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts the option value from an option string.
|
||||
*
|
||||
* @private
|
||||
* @param {string} name The name of the option to inspect.
|
||||
* @param {string} string The options string.
|
||||
* @returns {string|undefined} Returns the option value, else `undefined`.
|
||||
*/
|
||||
function optionToValue(name, string) {
|
||||
var result = (result = string.match(RegExp('^' + name + '=([\\s\\S]+)$'))) && result[1].trim();
|
||||
return result || undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string with `text` repeated `n` number of times.
|
||||
*
|
||||
* @private
|
||||
* @param {string} text The text to repeat.
|
||||
* @param {number} n The number of times to repeat `text`.
|
||||
* @returns {string} The created string.
|
||||
*/
|
||||
function repeat(text, n) {
|
||||
return Array(n + 1).join(text);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
function runTests() {
|
||||
var testDefinition = {
|
||||
'framework': 'qunit',
|
||||
'platforms': platforms,
|
||||
'tunnel': 'tunnel-identifier:' + tunnelId,
|
||||
'url': 'http://localhost:' + port + runnerPathname
|
||||
};
|
||||
|
||||
console.log('Starting saucelabs tests: ' + JSON.stringify(testDefinition));
|
||||
|
||||
request.post('https://saucelabs.com/rest/v1/' + username + '/js-tests', {
|
||||
'auth': { 'user': username, 'pass': accessKey },
|
||||
'json': testDefinition
|
||||
}, function(error, response, body) {
|
||||
var statusCode = response && response.statusCode;
|
||||
if (statusCode == 200) {
|
||||
waitForTestCompletion(body);
|
||||
} else {
|
||||
console.error('Failed to submit test to Sauce Labs; status: ' + statusCode + ', body:\n' + JSON.stringify(body));
|
||||
if (error) {
|
||||
console.error(error);
|
||||
}
|
||||
process.exit(3);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function waitForTestCompletion(testIdentifier) {
|
||||
request.post('https://saucelabs.com/rest/v1/' + username + '/js-tests/status', {
|
||||
'auth': { 'user': username, 'pass': accessKey },
|
||||
'json': testIdentifier
|
||||
}, function(error, response, body) {
|
||||
var statusCode = response && response.statusCode;
|
||||
if (statusCode == 200) {
|
||||
if (body.completed) {
|
||||
logInline('');
|
||||
handleTestResults(body['js tests']);
|
||||
}
|
||||
else {
|
||||
logInline('Please wait' + repeat('.', (++attempts % 3) + 1));
|
||||
setTimeout(function() {
|
||||
waitForTestCompletion(testIdentifier);
|
||||
}, 5000);
|
||||
}
|
||||
} else {
|
||||
logInline('');
|
||||
console.error('Failed to check test status on Sauce Labs; status: ' + statusCode + ', body:\n' + JSON.stringify(body));
|
||||
if (error) {
|
||||
console.error(error);
|
||||
}
|
||||
process.exit(4);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the result object of the test session.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} results The result object to process.
|
||||
*/
|
||||
function handleTestResults(results) {
|
||||
var failingTests = results.filter(function(test) {
|
||||
var result = test.result;
|
||||
@@ -223,10 +228,122 @@
|
||||
});
|
||||
}
|
||||
|
||||
clearInterval(throbberId);
|
||||
console.log('Shutting down Sauce Connect tunnel...');
|
||||
|
||||
tunnel.stop(function() {
|
||||
process.exit(failingTests.length ? 1 : 0);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a request for Sauce Labs to start the test session.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function runTests() {
|
||||
var options = {
|
||||
'build': build,
|
||||
'framework': 'qunit',
|
||||
'name': sessionName,
|
||||
'public': 'public',
|
||||
'platforms': platforms,
|
||||
'record-screenshots': false,
|
||||
'tags': tags,
|
||||
'tunnel': 'tunnel-identifier:' + tunnelId,
|
||||
'url': 'http://localhost:' + port + runner,
|
||||
'video-upload-on-pass': false
|
||||
};
|
||||
|
||||
console.log('Starting saucelabs tests: ' + JSON.stringify(options));
|
||||
|
||||
request.post('https://saucelabs.com/rest/v1/' + username + '/js-tests', {
|
||||
'auth': { 'user': username, 'pass': accessKey },
|
||||
'json': options
|
||||
}, function(error, response, body) {
|
||||
var statusCode = response && response.statusCode;
|
||||
if (statusCode == 200) {
|
||||
waitForTestCompletion(body);
|
||||
} else {
|
||||
console.error('Failed to submit test to Sauce Labs; status: ' + statusCode + ', body:\n' + JSON.stringify(body));
|
||||
if (error) {
|
||||
console.error(error);
|
||||
}
|
||||
process.exit(3);
|
||||
}
|
||||
});
|
||||
|
||||
// initialize the wait throbber
|
||||
if (!throbberId) {
|
||||
throbberId = setInterval(logThrobber, throbberDelay);
|
||||
logThrobber();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the status of the test session. If the session has completed it
|
||||
* passes the result object to `handleTestResults`, else it checks the status
|
||||
* again in five seconds.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} testIdentifier The object used to identify the session.
|
||||
*/
|
||||
function waitForTestCompletion(testIdentifier) {
|
||||
request.post('https://saucelabs.com/rest/v1/' + username + '/js-tests/status', {
|
||||
'auth': { 'user': username, 'pass': accessKey },
|
||||
'json': testIdentifier
|
||||
}, function(error, response, body) {
|
||||
var statusCode = response && response.statusCode;
|
||||
if (statusCode == 200) {
|
||||
if (body.completed) {
|
||||
logInline('');
|
||||
handleTestResults(body['js tests']);
|
||||
}
|
||||
else {
|
||||
setTimeout(function() {
|
||||
waitForTestCompletion(testIdentifier);
|
||||
}, 5000);
|
||||
}
|
||||
} else {
|
||||
logInline('');
|
||||
console.error('Failed to check test status on Sauce Labs; status: ' + statusCode + ', body:\n' + JSON.stringify(body));
|
||||
if (error) {
|
||||
console.error(error);
|
||||
}
|
||||
process.exit(4);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// create a web server for the local dir
|
||||
var mount = ecstatic({
|
||||
'cache': false,
|
||||
'root': process.cwd()
|
||||
});
|
||||
|
||||
http.createServer(function(req, res) {
|
||||
// see http://msdn.microsoft.com/en-us/library/ff955275(v=vs.85).aspx
|
||||
if (compatMode && path.extname(url.parse(req.url).pathname) == '.html') {
|
||||
res.setHeader('X-UA-Compatible', 'IE=' + compatMode);
|
||||
}
|
||||
mount(req, res);
|
||||
}).listen(port);
|
||||
|
||||
// set up Sauce Connect so we can use this server from Sauce Labs
|
||||
var tunnelTimeout = 10000,
|
||||
tunnel = new SauceTunnel(username, accessKey, tunnelId, true, tunnelTimeout);
|
||||
|
||||
console.log('Opening Sauce Connect tunnel...');
|
||||
|
||||
tunnel.start(function(success) {
|
||||
if (success) {
|
||||
console.log('Sauce Connect tunnel opened');
|
||||
runTests();
|
||||
} else {
|
||||
console.error('Failed to open Sauce Connect tunnel');
|
||||
process.exit(2);
|
||||
}
|
||||
});
|
||||
}());
|
||||
|
||||
646
test/test.js
646
test/test.js
File diff suppressed because it is too large
Load Diff
@@ -22,157 +22,108 @@
|
||||
<script src="../vendor/qunit/qunit/qunit.js"></script>
|
||||
<script src="../vendor/jquery/jquery.js"></script>
|
||||
<script src="../vendor/platform.js/platform.js"></script>
|
||||
<script src="./asset/qunit-extras.js"></script>
|
||||
<script src="./asset/test-ui.js"></script>
|
||||
<script>
|
||||
QUnit.config.asyncRetries = 10;
|
||||
QUnit.config.hidepassed = true;
|
||||
|
||||
// excuse tests we intentionally fail or those with problems
|
||||
QUnit.config.excused = {
|
||||
'Arrays': {
|
||||
'union': [
|
||||
'[null,1,2,3]'
|
||||
]
|
||||
},
|
||||
'Chaining': {
|
||||
'select/reject/sortBy': [
|
||||
'Died on test #1'
|
||||
],
|
||||
'select/reject/sortBy in functional style': [
|
||||
'Died on test #1'
|
||||
],
|
||||
'reverse/concat/unshift/pop/map': [
|
||||
'"34, 10, 8, 6, 4, 2, 10, 10"'
|
||||
]
|
||||
},
|
||||
'Collections': {
|
||||
'reduce': [
|
||||
'handles a null (without initial value) properly',
|
||||
'throws an error for empty arrays with no initial value'
|
||||
],
|
||||
'reduceRight': [
|
||||
'handles a null (without initial value) properly',
|
||||
'throws an error for empty arrays with no initial value'
|
||||
],
|
||||
'where': [
|
||||
'Only get the first object matched.'
|
||||
]
|
||||
},
|
||||
'Functions': {
|
||||
'bind': [
|
||||
'can bind without specifying a context',
|
||||
'Died on test #2'
|
||||
],
|
||||
'bindAll': [
|
||||
'throws an error for bindAll with no functions named'
|
||||
]
|
||||
},
|
||||
'Objects': {
|
||||
'isEqual': [
|
||||
'Died on test #60',
|
||||
'Died on test #63'
|
||||
],
|
||||
'keys': [
|
||||
'throws an error for `null` values',
|
||||
'throws an error for `undefined` values',
|
||||
'throws an error for number primitives',
|
||||
'throws an error for string primitives',
|
||||
'throws an error for boolean primitives'
|
||||
]
|
||||
},
|
||||
'Utility': {
|
||||
'_.escape': [
|
||||
'"<a href="http://moe.com">Curly & Moe's</a>"'
|
||||
],
|
||||
'_.unescape': [
|
||||
'"<a href=\\"http://moe.com\\">Curly & Moe's</a>"'
|
||||
],
|
||||
'times': [
|
||||
'Died on test #1'
|
||||
],
|
||||
'uniqueId': [
|
||||
'Died on test #1'
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
// only excuse in Sauce Labs (buggy Safari)
|
||||
if (location.port != '9001') {
|
||||
delete QUnit.config.excused.Chaining['select/reject/sortBy'];
|
||||
delete QUnit.config.excused.Chaining['select/reject/sortBy in functional style'];
|
||||
delete QUnit.config.excused.Objects.isEqual;
|
||||
delete QUnit.config.excused.Utility.times;
|
||||
delete QUnit.config.excused.Utility.uniqueId;
|
||||
}
|
||||
// only excuse in non-Underscore builds
|
||||
if (/\bunderscore\b/i.test(ui.buildPath)) {
|
||||
delete QUnit.config.excused.Chaining;
|
||||
delete QUnit.config.excused.Collections.where;
|
||||
delete QUnit.config.excused.Utility['_.escape'];
|
||||
delete QUnit.config.excused.Utility['_.unescape'];
|
||||
}
|
||||
|
||||
// assign results to `global_test_results` for Sauce Labs
|
||||
var global_test_results;
|
||||
QUnit.done(function(results) {
|
||||
global_test_results = results;
|
||||
});
|
||||
|
||||
// skip tests we intentionally fail or those with problems
|
||||
(function() {
|
||||
var skipped = {
|
||||
'Arrays': {
|
||||
'union': [
|
||||
'[null,1,2,3]'
|
||||
]
|
||||
},
|
||||
'Chaining': {
|
||||
'reverse/concat/unshift/pop/map': [
|
||||
'"34, 10, 8, 6, 4, 2, 10, 10"'
|
||||
]
|
||||
},
|
||||
'Collections': {
|
||||
'reduce': [
|
||||
'handles a null (without initial value) properly',
|
||||
'throws an error for empty arrays with no initial value'
|
||||
],
|
||||
'reduceRight': [
|
||||
'handles a null (without initial value) properly',
|
||||
'throws an error for empty arrays with no initial value'
|
||||
],
|
||||
'where': [
|
||||
'Only get the first object matched.'
|
||||
]
|
||||
},
|
||||
'Functions': {
|
||||
'bind': [
|
||||
'can bind without specifying a context',
|
||||
'Died on test #2'
|
||||
],
|
||||
'bindAll': [
|
||||
'throws an error for bindAll with no functions named'
|
||||
],
|
||||
'throttle': true,
|
||||
'throttle arguments': true,
|
||||
'throttle once': true,
|
||||
'throttle twice': true,
|
||||
'more throttling': true,
|
||||
'throttle repeatedly with results': true,
|
||||
'throttle triggers trailing call when invoked repeatedly': true,
|
||||
'throttle does not trigger leading call when leading is set to false': true,
|
||||
'more throttle does not trigger leading call when leading is set to false': true,
|
||||
'throttle does not trigger trailing call when trailing is set to false': true,
|
||||
'debounce': true,
|
||||
'debounce asap': true,
|
||||
'debounce asap recursively': true
|
||||
},
|
||||
'Objects': {
|
||||
'isEqual': [
|
||||
'Died on test #78'
|
||||
],
|
||||
'keys': [
|
||||
'throws an error for `null` values',
|
||||
'throws an error for `undefined` values',
|
||||
'throws an error for number primitives',
|
||||
'throws an error for string primitives',
|
||||
'throws an error for boolean primitives'
|
||||
]
|
||||
},
|
||||
'Utility': {
|
||||
'_.escape': [
|
||||
'"<a href="http://moe.com">Curly & Moe's</a>"'
|
||||
],
|
||||
'_.unescape': [
|
||||
'"<a href=\\"http://moe.com\\">Curly & Moe's</a>"'
|
||||
],
|
||||
'times': [
|
||||
'Died on test #1'
|
||||
],
|
||||
'uniqueId': [
|
||||
'Died on test #1'
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
// only skip in non-Underscore builds
|
||||
if (/\bunderscore\b/i.test(ui.buildPath)) {
|
||||
delete skipped.Chaining;
|
||||
delete skipped.Collections.where;
|
||||
delete skipped.Utility['_.escape'];
|
||||
delete skipped.Utility['_.unescape'];
|
||||
}
|
||||
// only skip in Sauce Labs
|
||||
if (location.port != '8081') {
|
||||
for (var key in skipped.Functions) {
|
||||
if (/\b(debounce|throttl)/.test(key)) {
|
||||
delete skipped.Functions[key];
|
||||
}
|
||||
}
|
||||
delete skipped.Objects.isEqual;
|
||||
delete skipped.Utility.times;
|
||||
delete skipped.Utility.uniqueId;
|
||||
}
|
||||
|
||||
QUnit.testStart(function(details) {
|
||||
var test = QUnit.config.current,
|
||||
finish = test.finish,
|
||||
skippedTests = skipped[details.module],
|
||||
skippedAsserts = skippedTests && skippedTests[details.name];
|
||||
|
||||
if (!skippedAsserts) {
|
||||
return;
|
||||
}
|
||||
if (skippedAsserts === true) {
|
||||
test.async = false;
|
||||
test.callback = function() {};
|
||||
test.expected = 0;
|
||||
return;
|
||||
}
|
||||
test.finish = function() {
|
||||
var index = -1,
|
||||
asserts = this.assertions,
|
||||
length = asserts.length;
|
||||
|
||||
while (++index < length) {
|
||||
var assert = asserts[index],
|
||||
message = _.unescape(_.result(/^<span class='test-message'>([\s\S]*?)<\/span>/.exec(assert.message), 1)),
|
||||
died = _.result(/^Died on test #\d+/.exec(message), 0),
|
||||
expected = _.unescape(_.result(/Expected: *<\/th><td><pre>([\s\S]*?)<\/pre>/.exec(assert.message), 1));
|
||||
|
||||
if ((message && _.contains(skippedAsserts, message)) ||
|
||||
(died && _.contains(skippedAsserts, died)) ||
|
||||
(expected && (_.contains(skippedAsserts, expected) ||
|
||||
_.contains(skippedAsserts, expected.replace(/\s+/g, '')))
|
||||
)) {
|
||||
assert.result = true;
|
||||
}
|
||||
}
|
||||
finish.call(this);
|
||||
};
|
||||
});
|
||||
}());
|
||||
|
||||
// load Lo-Dash again to overwrite the existing `_` value
|
||||
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
|
||||
|
||||
// load test.js if not using require.js
|
||||
// load Lo-Dash and test scripts
|
||||
document.write(ui.urlParams.loader != 'none'
|
||||
? '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
|
||||
: ([
|
||||
'<script src="' + ui.buildPath + '"><\/script>',
|
||||
'<script src="../vendor/underscore/test/collections.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/arrays.js"><\/script>',
|
||||
'<script src="../vendor/underscore/test/functions.js"><\/script>',
|
||||
|
||||
5
vendor/benchmark.js/benchmark.js
vendored
5
vendor/benchmark.js/benchmark.js
vendored
@@ -1471,6 +1471,11 @@
|
||||
destination = data.destination,
|
||||
currValue = destination[key];
|
||||
|
||||
// skip pseudo private properties like `_timerId` which could be a
|
||||
// Java object in environments like RingoJS
|
||||
if (key.charAt(0) == '_') {
|
||||
return;
|
||||
}
|
||||
if (value && typeof value == 'object') {
|
||||
if (_.isArray(value)) {
|
||||
// check if an array value has changed to a non-array value
|
||||
|
||||
3
vendor/docdown/src/DocDown/Entry.php
vendored
3
vendor/docdown/src/DocDown/Entry.php
vendored
@@ -77,7 +77,8 @@ class Entry {
|
||||
$this->isCtor() ||
|
||||
count($this->getParams()) ||
|
||||
count($this->getReturns()) ||
|
||||
preg_match('/\*[\t ]*@function\b/', $this->entry)
|
||||
preg_match('/\*[\t ]*@function\b/', $this->entry) ||
|
||||
preg_match('#\*/\s*function #', $this->entry)
|
||||
);
|
||||
}
|
||||
return $this->_isFunction;
|
||||
|
||||
94
vendor/docdown/src/DocDown/MarkdownGenerator.php
vendored
94
vendor/docdown/src/DocDown/MarkdownGenerator.php
vendored
@@ -27,7 +27,6 @@ class MarkdownGenerator {
|
||||
/**
|
||||
* The HTML for the open tag.
|
||||
*
|
||||
* @static
|
||||
* @memberOf MarkdownGenerator
|
||||
* @type string
|
||||
*/
|
||||
@@ -49,6 +48,15 @@ class MarkdownGenerator {
|
||||
*/
|
||||
public $source = '';
|
||||
|
||||
/**
|
||||
* The array of code snippets that are tokenized by `escape`.
|
||||
*
|
||||
* @private
|
||||
* @memberOf MarkdownGenerator
|
||||
* @type Array
|
||||
*/
|
||||
private $snippets = array();
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
@@ -132,21 +140,6 @@ class MarkdownGenerator {
|
||||
return trim($string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes special Markdown characters.
|
||||
*
|
||||
* @private
|
||||
* @memberOf Entry
|
||||
* @param {string} $string The string to escape.
|
||||
* @returns {string} Returns the escaped string.
|
||||
*/
|
||||
private function escape( $string ) {
|
||||
$string = preg_replace('/(?<!\\\)\*/', '*', $string);
|
||||
$string = preg_replace('/(?<!\\\)\[/', '[', $string);
|
||||
$string = preg_replace('/(?<!\\\)\]/', ']', $string);
|
||||
return $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify a string by replacing named tokens with matching assoc. array values.
|
||||
*
|
||||
@@ -252,6 +245,23 @@ class MarkdownGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes special Markdown characters.
|
||||
*
|
||||
* @private
|
||||
* @memberOf Entry
|
||||
* @param {string} $string The string to escape.
|
||||
* @returns {string} Returns the escaped string.
|
||||
*/
|
||||
private function escape( $string ) {
|
||||
$string = preg_replace_callback('/`.*?\`/', array($this, 'swapSnippetsToTokens'), $string);
|
||||
$string = preg_replace('/(?<!\\\)\*/', '*', $string);
|
||||
$string = preg_replace('/(?<!\\\)\[/', '[', $string);
|
||||
$string = preg_replace('/(?<!\\\)\]/', ']', $string);
|
||||
$string = preg_replace_callback('/@@token@@/', array($this, 'swapTokensToSnippets'), $string);
|
||||
return $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the entry's hash used to navigate the documentation.
|
||||
*
|
||||
@@ -298,6 +308,32 @@ class MarkdownGenerator {
|
||||
return $entry->isPlugin() ? '.prototype.' : '.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps code snippets with tokens as a `preg_replace_callback` callback
|
||||
* used by `escape`.
|
||||
*
|
||||
* @private
|
||||
* @memberOf Entry
|
||||
* @param {Array} $matches The array of regexp matches.
|
||||
* @returns {string} Returns the token.
|
||||
*/
|
||||
private function swapSnippetsToTokens( $matches ) {
|
||||
$this->snippets[] = $matches[0];
|
||||
return '@@token@@';
|
||||
}
|
||||
|
||||
/**
|
||||
* Swaps tokens with code snippets as a `preg_replace_callback` callback
|
||||
* used by `escape`.
|
||||
*
|
||||
* @private
|
||||
* @memberOf Entry
|
||||
* @returns {string} Returns the code snippet.
|
||||
*/
|
||||
private function swapTokensToSnippets() {
|
||||
return array_shift($this->snippets);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
@@ -480,7 +516,18 @@ class MarkdownGenerator {
|
||||
);
|
||||
// add entries
|
||||
foreach ($entries as $entry) {
|
||||
$result[] = MarkdownGenerator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $entry);
|
||||
if ($entry->isAlias()) {
|
||||
$result[] = MarkdownGenerator::interpolate('* <a href="##{hash}" class="alias">`#{member}#{separator}#{name}` -> `#{realName}`</a>', array(
|
||||
'hash' => $entry->hash,
|
||||
'member' => $entry->member,
|
||||
'name' => $entry->getName(),
|
||||
'realName' => $entry->owner->getName(),
|
||||
'separator' => $entry->separator
|
||||
));
|
||||
}
|
||||
else {
|
||||
$result[] = MarkdownGenerator::interpolate('* <a href="##{hash}">`#{member}#{separator}#{name}`</a>', $entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -517,7 +564,18 @@ class MarkdownGenerator {
|
||||
}
|
||||
foreach ($entry->{$kind} as $subentry) {
|
||||
$subentry->member = $member;
|
||||
$result[] = MarkdownGenerator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $subentry);
|
||||
if ($subentry->isAlias()) {
|
||||
$result[] = MarkdownGenerator::interpolate('* <a href="##{hash}" class="alias">`#{member}#{separator}#{name}` -> `#{realName}`</a>', array(
|
||||
'hash' => $subentry->hash,
|
||||
'member' => $subentry->member,
|
||||
'name' => $subentry->getName(),
|
||||
'realName' => $subentry->owner->getName(),
|
||||
'separator' => $subentry->separator
|
||||
));
|
||||
}
|
||||
else {
|
||||
$result[] = MarkdownGenerator::interpolate('* <a href="##{hash}">`#{member}#{separator}#{name}`</a>', $subentry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
74
vendor/qunit-clib/qunit-clib.js
vendored
74
vendor/qunit-clib/qunit-clib.js
vendored
@@ -30,6 +30,29 @@
|
||||
return;
|
||||
}
|
||||
|
||||
/** Used to report the test module for failing tests */
|
||||
var moduleName,
|
||||
modulePrinted;
|
||||
|
||||
/** Used to display the wait throbber */
|
||||
var throbberId,
|
||||
throbberDelay = 500,
|
||||
waitCount = -1;
|
||||
|
||||
/** Add `console.log()` support for Narwhal, Rhino, and RingoJS */
|
||||
var console = context.console || (context.console = { 'log': context.print });
|
||||
|
||||
/** Used as a horizontal rule in console output */
|
||||
var hr = '----------------------------------------';
|
||||
|
||||
/** Used by `logInline` to clear previously logged messages */
|
||||
var prevLine = '';
|
||||
|
||||
/** Shorten `context.QUnit.QUnit` to `context.QUnit` */
|
||||
var QUnit = context.QUnit = context.QUnit.QUnit || context.QUnit;
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Schedules timer-based callbacks.
|
||||
*
|
||||
@@ -108,24 +131,8 @@
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
/** Used to report the test module for failing tests */
|
||||
var moduleName,
|
||||
modulePrinted;
|
||||
|
||||
/** Add `console.log()` support for Narwhal, Rhino, and RingoJS */
|
||||
var console = context.console || (context.console = { 'log': context.print });
|
||||
|
||||
/** Used as a horizontal rule in console output */
|
||||
var hr = '----------------------------------------';
|
||||
|
||||
/** Used by `logInline` to clear previously logged messages */
|
||||
var prevLine = '';
|
||||
|
||||
/** Shorten `context.QUnit.QUnit` to `context.QUnit` */
|
||||
var QUnit = context.QUnit = context.QUnit.QUnit || context.QUnit;
|
||||
|
||||
/**
|
||||
* Logs an inline message to standard output.
|
||||
* Writes an inline message to standard output.
|
||||
*
|
||||
* @private
|
||||
* @param {string} text The text to log.
|
||||
@@ -142,7 +149,7 @@
|
||||
process.exit();
|
||||
});
|
||||
return function(text) {
|
||||
var blankLine = Array(prevLine.length + 1).join(' ');
|
||||
var blankLine = repeat(' ', prevLine.length);
|
||||
if (text.length > hr.length) {
|
||||
text = text.slice(0, hr.length - 3) + '...';
|
||||
}
|
||||
@@ -151,6 +158,29 @@
|
||||
}
|
||||
}());
|
||||
|
||||
/**
|
||||
* Writes the wait throbber to standard output.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
function logThrobber() {
|
||||
logInline('Please wait' + repeat('.', (++waitCount % 3) + 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a string with `text` repeated `n` number of times.
|
||||
*
|
||||
* @private
|
||||
* @param {string} text The text to repeat.
|
||||
* @param {number} n The number of times to repeat `text`.
|
||||
* @returns {string} The created string.
|
||||
*/
|
||||
function repeat(text, n) {
|
||||
return Array(n + 1).join(text);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* A logging callback triggered when all testing is completed.
|
||||
*
|
||||
@@ -224,11 +254,17 @@
|
||||
* @param {Object} details An object with property `name`.
|
||||
*/
|
||||
QUnit.moduleStart(function(details) {
|
||||
// reset the `modulePrinted` flag
|
||||
var newModuleName = details.name;
|
||||
if (moduleName != newModuleName) {
|
||||
moduleName = newModuleName;
|
||||
modulePrinted = false;
|
||||
}
|
||||
// initialize the wait throbber
|
||||
if (!throbberId) {
|
||||
throbberId = context.setInterval(logThrobber, throbberDelay);
|
||||
logThrobber();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -275,8 +311,6 @@
|
||||
assertions.forEach(function(value) {
|
||||
console.log(' ' + value);
|
||||
});
|
||||
} else {
|
||||
logInline('Testing ' + moduleName + '...');
|
||||
}
|
||||
assertions.length = 0;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user