Compare commits

...

161 Commits
1.2.0 ... 1.3.1

Author SHA1 Message Date
Benjamin Tan
18a41de47a Update v1.3.1 docs 2015-01-23 15:35:45 +08:00
John-David Dalton
9bd12eb782 Bump to v1.3.1.
Former-commit-id: 2d7b1adacb8d2dd6fbee4b9b623b73aa8582e487
2013-06-12 07:54:39 -07:00
John-David Dalton
ef66650997 Ensure maxWait tests pass in Ringo.
Former-commit-id: 57f4142caab308b2df0c0403cfac15cd240c0538
2013-06-12 07:47:53 -07:00
John-David Dalton
fcffcdde1b Increase maxPoolSize limit, add missing cache property to the object returned by getObject, and optimize releaseArray and releaseObject.
Former-commit-id: 41c356fb0d03339bc450de8d69f8002aa4613628
2013-06-12 07:20:58 -07:00
John-David Dalton
7de892ccac Correct typo in _.indexOf perf test.
Former-commit-id: 96d717dbf50ea5b9c8098ec39f2572cccb72ab18
2013-06-12 00:15:14 -07:00
John-David Dalton
f90f2e051a Bump to v1.3.0.
Former-commit-id: 4b8a4e90b97d2960445073cd4288af19dadc9266
2013-06-11 08:33:35 -07:00
John-David Dalton
24f49c8d83 Ensure _.throttle passes underscore unit tests in all environments.
Former-commit-id: 5867875313995ed02a94cd879d537c295b8a5c5f
2013-06-11 08:19:54 -07:00
John-David Dalton
a4ebaf15ab Remove lodash.js from .npmignore.
Former-commit-id: 437fe2fa2e19d4de8f83e2f760cf9da854ded128
2013-06-10 23:55:13 -07:00
John-David Dalton
54a46dccc3 Correct _.throttle method dependencies.
Former-commit-id: 2118e1789803a042675fcc8acb19f1904a102578
2013-06-10 12:37:24 -07:00
John-David Dalton
9747d5057d Update builds and docs.
Former-commit-id: 413e8a906dee3407baf848c4607d9887f57fac85
2013-06-10 11:55:51 -07:00
John-David Dalton
7f5c97d0be Avoid Array.prototype issues in Narwhal.
Former-commit-id: 47627a187d59fb83f4a5b84b03158432d5216395
2013-06-10 11:54:09 -07:00
John-David Dalton
1933a76631 Add maxWait option to _.debounce and implement _.throttle by way of _.debounce. [closes #285]
Former-commit-id: 63b41aac298e5fa89f7922e84b2ed0d5c6545bd3
2013-06-10 11:16:14 -07:00
John-David Dalton
c20d7f9754 Tweak free variable module detection so it will work with Component's polyfill. [closes #296]
Former-commit-id: bda6c962dc5e8299689e4c5cf003f6a6c9a4369d
2013-06-10 09:32:33 -07:00
John-David Dalton
6b46dc7e89 Ensure more private properties are minified correctly.
Former-commit-id: dbebbb088768f04a8252029ad709bad9f01c88bb
2013-06-09 17:21:50 -07:00
John-David Dalton
0c1a26170c Remove build source ./lodash.js from components.
Former-commit-id: 4d7f56385b288b396182020aed07eec285c37815
2013-06-08 09:23:20 -07:00
John-David Dalton
244ee08d7d Remove ./ path prefix to avoid issues with Component's build. [closes #294]
Former-commit-id: 93ba9214538b0f30fde75bff96b75c83f3b96f1f
2013-06-07 18:44:15 -07:00
John-David Dalton
a3acbca24b Rename typod test/run-test.sh.
Former-commit-id: bb982a51c5ceb123e83d98c3201e969607f990b8
2013-06-07 13:33:12 -07:00
John-David Dalton
d77e4ed581 Rebuild files and docs.
Former-commit-id: 1e3b1e236e15e4248247a4b20288ab2e153ce753
2013-06-07 08:39:08 -07:00
John-David Dalton
b928abb956 Tweak _.intersection to still hit fast paths in engines.
Former-commit-id: e8cb944bd6223bb30d58da343c4b5a3f296a4956
2013-06-07 08:24:30 -07:00
John-David Dalton
a46ef8d1a6 When chaining, _.max and _.min should resolve the correct value when passed an array containing only one value. [closes #292]
Former-commit-id: 79c71c1851a73c23919a28aadd56490ded91166c
2013-06-06 09:07:14 -07:00
John-David Dalton
a5d459749f Update dependency maps and remove properties in pre-compile.js that no longer exist.
Former-commit-id: d24f0ac4575ab1c2d12f3e8b4bc5f089424407ca
2013-06-06 08:44:20 -07:00
John-David Dalton
7dfa383968 Move some functions out of runInContext and cleanup _.intersection.
Former-commit-id: dfefa6e202b3cd5a7925ddef6ac73dcab5bef8d1
2013-06-06 08:43:24 -07:00
John-David Dalton
036483d195 Simplify the object pool and large array cache.
Former-commit-id: d15df51efe575cd6fa773622f135ccfb6f675545
2013-06-05 08:06:05 -07:00
John-David Dalton
2c950f74bc Remove props related to _.sortBy if the method isn't included in a given build.
Former-commit-id: b3da4dab8257b9001b7458263a28bf22b0a2c831
2013-06-04 09:12:11 -07:00
John-David Dalton
2c59dcd929 Rebuild docs and files.
Former-commit-id: 94d3e29ccf0ba47599a9d662e5d4068713009c9b
2013-06-04 08:37:12 -07:00
John-David Dalton
658d14f31d Cleanup var names and properties.
Former-commit-id: a3455f40184b61a7abe3f5749ea1c0a141c0e574
2013-06-04 08:36:45 -07:00
John-David Dalton
819f4d2151 Add maxPoolSize to limit array and object pools.
Former-commit-id: 677cdb053c7ef60274d71d9ecf4d6f866ef6a8eb
2013-06-03 08:43:04 -07:00
John-David Dalton
9b214d75df Update DocDown.
Former-commit-id: ecb4c7428007bfb6b721000c81254a03c826b1ff
2013-06-03 08:00:46 -07:00
John-David Dalton
e0891a2d71 Clarify lodash underscore test name in test-build.js.
Former-commit-id: 4723604102d38ea252f867aeab16ce167b1d1a49
2013-06-03 08:00:29 -07:00
John-David Dalton
34a4876761 Cleanup .travis and .ignore files.
Former-commit-id: 268e1eb34f30581ed1a36236970673f389f94bb3
2013-06-03 07:59:44 -07:00
John-David Dalton
13ead0085d Add array and object pools to lodash.
Former-commit-id: f038284d6a544e146dc271ed0fbea0d7401593d4
2013-06-03 07:09:04 -07:00
John-David Dalton
9e63270fc5 Add Volo ignore entry to package.json.
Former-commit-id: 9fe60cf0dcfeb4f688f53ffb1995a619d420d586
2013-06-02 17:29:57 -07:00
John-David Dalton
eccab3cd57 Fix build test for older Node versions w/o setImmediate.
Former-commit-id: 9f21f174626cd86eefd0a26cf0b36a60858ba501
2013-05-30 09:37:09 -04:00
John-David Dalton
6446daf1a6 Remove Instanbul note from README and devDependency from package.json.
Former-commit-id: 891c387534df492f9e4d836daac7adc930205fb3
2013-05-30 08:23:08 -04:00
Mathias Bynens
821602ef1c package.json: Remove Grunt devDependencies
Follow-up commit to dc3512de9f [formerly 6d38406eafbfc880c0b5aabf853c987c65f03482].


Former-commit-id: f8c310cad3fe165b6005312bad74a9abc5148a47
2013-05-30 10:44:08 +02:00
John-David Dalton
dc3512de9f Move istanbul to travis.yml.
Former-commit-id: 6d38406eafbfc880c0b5aabf853c987c65f03482
2013-05-30 03:38:55 -04:00
John-David Dalton
36e9cb7108 Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: 629fdb25b4727f8dbf870457196af9a4c43b562d
2013-05-29 17:25:09 -04:00
John-David Dalton
42f4531720 Remove unneeded method from the backbone build and fix build tests.
Former-commit-id: ee463a4af4d458a556f5be666b71b464bae32e6b
2013-05-29 17:06:01 -04:00
Mathias Bynens
d1fb379a40 Enable code coverage
Former-commit-id: 9b52247b6e880f15895842e4ff34c15fc99fd1eb
2013-05-29 17:51:57 +02:00
John-David Dalton
e27bdb965c Add a note about the exposed cache to _.memoize docs.
Former-commit-id: 75939e3ed38fe8447c2f9e45b965a837901bcc4c
2013-05-29 10:30:58 -05:00
John-David Dalton
54fc6df3da Update _.transform docs.
Former-commit-id: ff26ef26e906410787a8819b9c653f20bbdeff38
2013-05-29 09:21:45 -05:00
John-David Dalton
9dd8f62c8a Make Error.prototype unit tests pass in Firefox.
Former-commit-id: 1ff097e7947ba206bc58fe0c319bf36bb64b5387
2013-05-29 09:05:21 -05:00
John-David Dalton
1db19148e7 Update vendors.
Former-commit-id: 6be90c53f9b69d500485492ea2a0ebd288b92abe
2013-05-29 08:56:53 -05:00
John-David Dalton
93a01506e4 Add/fix build tests for mixed method builds.
Former-commit-id: 2b97810ca6960670ea646c6eda962bd4585fda04
2013-05-29 08:30:13 -05:00
John-David Dalton
4767ed790c Add _.findWhere alias.
Former-commit-id: 2c70e59b71c22d902e499747444a196a85691554
2013-05-28 16:08:24 -05:00
John-David Dalton
e39211347c Fix build.
Former-commit-id: f8c32906f46a747b1d610c1c9ca8a8ee3b095d90
2013-05-27 23:54:16 -07:00
John-David Dalton
a8cdbb65fe Move code block to a more related part of build.js.
Former-commit-id: c138608bdff2937c51127e129955143ad7a3caec
2013-05-27 23:21:18 -07:00
John-David Dalton
ff74ff4149 Tweak _.transform docs.
Former-commit-id: dc7100411a403be4cce6b3784e1dd81cc9423b76
2013-05-27 22:31:41 -07:00
John-David Dalton
96e47f3d27 Avoid incorrectly converting local variables to boolean values.
Former-commit-id: 322f6dec4c669bdc1ef534f7786cf12aee580e53
2013-05-27 15:38:11 -07:00
John-David Dalton
be52c181ea Ensure converted !0 and !1 have leading whitespace if needed.
Former-commit-id: 930001f35111d47a51c011c47d6c2608b0bb7e2d
2013-05-27 13:47:01 -07:00
John-David Dalton
507f2ec544 Avoid minifier tricks for boolean literals in expressions.
Former-commit-id: a02445f97a81c330018247140784818be830595f
2013-05-27 13:04:26 -07:00
John-David Dalton
fe00c628f4 Fix build.
Former-commit-id: 8dfb12b5883e59111857360ee5392c62e5e9146f
2013-05-26 23:19:10 -07:00
John-David Dalton
e9387d322c Disable use of basicIndexOf optimization if _.indexOf is customized.
Former-commit-id: 5b2273b36934581e34c6f6042de95bf556c61ca2
2013-05-26 22:46:52 -07:00
John-David Dalton
2e3b135fe9 Rebuild docs and files.
Former-commit-id: 3f0dd7d8a07e2a3694619ce7277573ffb6f88ef6
2013-05-25 01:08:38 -07:00
John-David Dalton
d28cc15be2 Ensure _.isPlainObject returns true for empty objects in older browsers. [closes #283]
Former-commit-id: d01d32b1cbd87d08bc8014d07eaa1842e3118a40
2013-05-25 01:08:08 -07:00
John-David Dalton
d15bd23800 Add *.template.* to .ignore files.
Former-commit-id: d4c34dccb521890de2ced7482628f4796b55dcc1
2013-05-24 09:11:34 -07:00
John-David Dalton
90fe45c52d Tweak regexp in build/post-compile.js used to repair whitespace detection.
Former-commit-id: 7bfe6a6bc0b5e2258c56588d8aacad1e5176d8ba
2013-05-24 09:10:45 -07:00
John-David Dalton
8f7be71905 Avoid escaping existing non-ascii characters in templates. [closes #278]
Former-commit-id: a56581f3e323c0c47e4f26ef8dce13e90fb6c15c
2013-05-24 08:42:11 -07:00
John-David Dalton
5d583637c4 Clarify _.uniq doc example and rebuild files. [closes #282]
Former-commit-id: b3ab9ae81af219dfb75b3f4339555530a6301f6e
2013-05-24 07:53:03 -07:00
John-David Dalton
0efb4285c1 Make capitalize in test/test-build.js consistent with other areas.
Former-commit-id: 2a4b6a2f394e474af2c3ca9376ec0ac2580e9bb9
2013-05-23 20:23:48 -07:00
John-David Dalton
6dc543ca18 Rename internal each to basicEach and add internal overloadWrapper function.
Former-commit-id: b12ea9977ab7b6da877aca5925a9fc59019bec93
2013-05-23 20:23:10 -07:00
John-David Dalton
e93e1ddeb9 Add private function dependencies to help reduce dead code in non-minified builds and allow turning them into modules as part of the modularize build option.
Former-commit-id: e9118c47ae2b66e86332a02b4279999b99b8c429
2013-05-23 20:22:12 -07:00
John-David Dalton
d5459f5996 Reduce test/test-build.js travis-ci time limit.
Former-commit-id: c71f8dec6e7cbd81d8693bd52f1f2d0ef78149a7
2013-05-21 10:46:07 -07:00
John-David Dalton
c6420a910d Cleanup getJavaOptions in build/minify.js.
Former-commit-id: 74a6ddf40eadcfd66c0da243d2496b45bc89d8a1
2013-05-21 09:14:37 -07:00
John-David Dalton
f8e67b8e68 Remove the binding optimization from all but the modern build.
Former-commit-id: 1023ccc976e180425dabaa1b61e873e542aa3c2a
2013-05-21 08:42:13 -07:00
John-David Dalton
9ffcd382b4 Have build.js remove createCache if it's not called in the source.
Former-commit-id: 399d1e19b96b2084cc8cd459d297129db1bda071
2013-05-21 00:30:49 -07:00
John-David Dalton
725746badf Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: f3bd8611110e0656b448fd5e7bd6fb88dc7a7213
2013-05-20 22:58:22 -07:00
John-David Dalton
9d5290de91 Rebuild docs and files.
Former-commit-id: 00c9d39304630bf650d7f1c80496c383cdac0ba7
2013-05-20 22:58:08 -07:00
John-David Dalton
1bb0b58cce Rename cachedContains reference in build.js to createCache.
Former-commit-id: 3b8cee53f3b7cadc5350c4261794cec72e704427
2013-05-20 22:57:31 -07:00
John-David Dalton
32f0ebbe61 Avoid issues with Titanium, clearTimeout, and an undefined timer id.
Former-commit-id: 18813fcebbab5185164c236a647b0b6436d495ff
2013-05-20 22:53:27 -07:00
John-David Dalton
25a1d74627 Update test/underscore.html and test/backbone.html to account for chain existing in Lo-Dash.
Former-commit-id: f815e7a3ac6e9cc6c048eab82acc32e462dbb021
2013-05-20 22:52:34 -07:00
John-David Dalton
355b2f09bf Make getDependants work with an array of method names.
Former-commit-id: 55f3721735d93e95da10bb3367f8478d861e683c
2013-05-20 22:10:11 -07:00
John-David Dalton
01621f75b6 Avoid binding functions in _.createCallback if they don't reference this.
Former-commit-id: d491414e7e1536d3241a607ba07120f629ff2410
2013-05-20 09:20:51 -07:00
John-David Dalton
242e8a3bd6 Fix typo left out of the "legacy include=defer" patch.
Former-commit-id: cf8f3e072534a925bdf6a0ebdee65d1280f7d29e
2013-05-20 08:44:12 -07:00
John-David Dalton
010c26e716 Replace cachedContains with createCache and further optimize linear array searches.
Former-commit-id: bfe905985c9125cbadfcf111ffd97b6f8ecdd58d
2013-05-19 19:21:11 -07:00
John-David Dalton
e7bad10663 Ensure mobile builds pass unit tests.
Former-commit-id: 31b4eb76c90f375069ef4a73aa7e3fdbcbda069d
2013-05-19 14:28:23 -07:00
John-David Dalton
16242f98ce Ensure each is converted to forEach when used in a ternary operation.
Former-commit-id: ff42e367f9987726fd561037337081c63c7a5100
2013-05-19 14:23:35 -07:00
Kit Cambridge
14a447b3d8 Ensure that the javaOptions are set correctly, as exec is asynchronous.
Previously, the `java` command would execute on the next tick and update the
`javaOptions` array, which could occur prior to the invocation of the Closure
Compiler on the current tick. This has now been refactored into a separate
`getJavaOptions` function, which passes the `javaOptions` array to a callback.

`getJavaOptions` is defined lazily; after the first invocation, the options
are cached and passed to all subsequent callbacks. The callbacks are invoked
on the next tick for compatibility with `exec`.


Former-commit-id: 89ca63c9edb3df3d4fcbbaa64e06075495febfd0
2013-05-19 14:16:35 -07:00
John-David Dalton
a2088fa500 Rebuild docs, files, and update minifiers.
Former-commit-id: 65b04c3efc7677c8ec5cc7ce6e5840fed23b3716
2013-05-19 13:11:57 -07:00
John-David Dalton
87af68c092 Add Java options for faster Closure Compiler minification to minify.js.
Former-commit-id: b493d461e78d0df80c80805a570220fdff93d487
2013-05-19 11:45:24 -07:00
John-David Dalton
06daad87ca Remove unnecessary semicolons from compiled strings.
Former-commit-id: d4f31dafd3335878469babc5daac45957c6d4e80
2013-05-19 11:36:04 -07:00
John-David Dalton
0b4b86f6c9 Remove ctorByClass from the minified vars list in pre-compile.js.
Former-commit-id: 5f5fe90d6a1a9726a07ee7b4c2c9b9b23b6700d3
2013-05-19 10:58:36 -07:00
John-David Dalton
10626904af Add _.transform unit tests.
Former-commit-id: 34e844950f5c003eeeaf2daea7a5ef6247fbfdab
2013-05-19 10:57:50 -07:00
John-David Dalton
90cca8a3eb Remove Error enum fixes/code from builds that don't need them.
Former-commit-id: db060ff3571ef656709447970b62f4af753ea0cb
2013-05-19 10:52:56 -07:00
John-David Dalton
8da0141cac Fix legacy include=defer build test.
Former-commit-id: 49d0598ad3a979796cd07b6819c0aa08642c93a1
2013-05-19 00:37:40 -07:00
John-David Dalton
39e123aaf4 Rebuild files.
Former-commit-id: ab61934d0b097036dc4cab968d92bfd1450fe8c7
2013-05-18 19:33:17 -07:00
John-David Dalton
24fd17f072 Replace _.isPlainObject with shimIsPlainObject.
Former-commit-id: c1c273a352387e25ae5a6a22dfda8871beac8400
2013-05-18 19:32:16 -07:00
John-David Dalton
9270cc47b5 Add _.transform.
Former-commit-id: 6c040fedd130e8436ff99b1d70892ac8cebbb996
2013-05-18 19:12:22 -07:00
John-David Dalton
3721db34ab Avoid writing a minified file when --stdout is used. [closes #273]
Former-commit-id: 75068b4a92f3a98d4c47ad049e88ef764154bcc1
2013-05-18 09:21:23 -07:00
John-David Dalton
e85ae351c7 Ensure --output paths containing build commands are processed w/o problems.
Former-commit-id: 4790e4e2ea2eba6af8c93e3576858d1f6ff45e70
2013-05-17 08:41:55 -07:00
John-David Dalton
a56ba245ea Fix _.support.enumErrorProps docs.
Former-commit-id: f7aa45537b1e4d173f966a78f89b183c444faaeb
2013-05-16 09:12:56 -07:00
John-David Dalton
d162eed4c7 Rebuild files.
Former-commit-id: dd3db7be0213bfada5ab7d8593e233a9af4a9dd0
2013-05-16 08:48:28 -07:00
John-David Dalton
43fea34f61 Ensure _.chain works as expected.
Former-commit-id: ed176702dc08deeb35d94bb7b40623ab06142848
2013-05-16 08:47:52 -07:00
John-David Dalton
f7c960fc0d Ensure Error is escaped for advanced Closure Compiler minification.
Former-commit-id: 7a9cfbe464afa9e52ec3ed23692965d07db51d32
2013-05-14 22:49:15 -07:00
John-David Dalton
ee1933389a Add _.chain tests and ensure they pass.
Former-commit-id: e365b65da8a740383c975c7b904ad2156d1cc8ab
2013-05-14 22:48:34 -07:00
John-David Dalton
fdc9d5f1fd Rebuild docs and files.
Former-commit-id: 59596707224acabb767b87078d69363c293eec2d
2013-05-14 09:15:48 -07:00
John-David Dalton
bad40b6125 Ensure snippet in iteratorTemplate is minifiable and remove unneeded references from iteratorTemplate.
Former-commit-id: f8c96f63f1a50644c0d2074e5419e68d1a247d46
2013-05-14 09:15:26 -07:00
John-David Dalton
d76ce85327 Add better _.forIn support for legacy browsers.
Former-commit-id: a03ce4662021d6ac8ca12c4885a9c4718c227a30
2013-05-14 09:04:15 -07:00
John-David Dalton
d3df072a22 Make build.js remove extraneous semicolons from inlined methods.
Former-commit-id: 061ed370a4c95a64669335c6b2a5da7ebc1015fd
2013-05-14 08:11:56 -07:00
John-David Dalton
4b3009a195 Ensure _.clone, _.flatten, and _.uniq can be used as a callback for methods like _.map. [closes #270]
Former-commit-id: fb62b5bbdad844cb04c3259c323e27fb81932809
2013-05-14 00:50:57 -07:00
John-David Dalton
b72b0d60cb Add support for floating point numbers to _.random. [closes #263]
Former-commit-id: ef356bb180b163fc936ef69ac2ef33186983eaa7
2013-05-12 15:48:01 -07:00
John-David Dalton
5841e62c66 Add _.chain alias of _. [closes #267]
Former-commit-id: 580e4346444096c7fa77cfc5cf2c68b6cf891fcf
2013-05-11 00:59:48 -07:00
John-David Dalton
9bd0c01702 Expose memoized function's cache. [closes #265]
Former-commit-id: fc44676386854ec9d5fd7a4fac8583508d63949f
2013-05-10 23:22:04 -07:00
John-David Dalton
6d86b3a950 Add _.has unit test.
Former-commit-id: 3334651f8d29e6aa006184846b128acd006157ef
2013-05-10 22:57:08 -07:00
John-David Dalton
5ff9b02c89 Rebuild files and docs.
Former-commit-id: 697fc5842bb6099f48e3731940c9e329452850d2
2013-05-08 01:05:03 -07:00
John-David Dalton
80934ea232 Fix build.
Former-commit-id: 114ddcfec3e9bd4bccf481e8ec943ffdead2bb24
2013-05-08 00:59:37 -07:00
John-David Dalton
5acfa2bf3a Remove _.unzip from the underscore build.
Former-commit-id: 6d0accb64f39b08b72e3165c49a8c844a7a99cd3
2013-05-07 23:49:30 -07:00
John-David Dalton
4fada52e04 Remove nonEnumProps from the modernish builds.
Former-commit-id: 38592e1ee24524b223b801ede8033d7b4ccb8a36
2013-05-07 23:34:17 -07:00
John-David Dalton
e1c8e95e11 Tweak whitespace in iteratorTemplate.
Former-commit-id: 2f9fdbd72d316a1668d34fa95a3f1ecb325d625b
2013-05-07 23:33:04 -07:00
John-David Dalton
1dfebad790 Add a space before define in the minified files so Dojo builder will detect it properly.
Former-commit-id: 3c656ba3b2dd4771eab97c259840c2f426e2454c
2013-05-07 22:14:47 -07:00
John-David Dalton
37ffe63d13 Rename arrayRef to arrayProto in build.js.
Former-commit-id: fec054f96a4972173cb638ee77a7a0d1813c9ad4
2013-05-07 09:24:12 -07:00
John-David Dalton
cc14c34dc2 Allow the underscore build to opt-in to more lodash build methods.
Former-commit-id: 3f685fe1ced25ba37ea9d09e2ed8fa59acb5b8b7
2013-05-07 09:22:31 -07:00
John-David Dalton
e0cf4e644b Add more _.forIn iteration tests and prep support for Error object iteration.
Former-commit-id: 3676681717d0648c9f96570a4952f7c35e6a9bec
2013-05-07 01:38:13 -07:00
John-David Dalton
aad55fc3db Fix trailing parenthesis typo.
Former-commit-id: a9b4fe7408aa9faa7079656c3cb31a4c655544e6
2013-05-06 07:02:53 -07:00
John-David Dalton
ba2b459220 Tweak wiki wording in README.md.
Former-commit-id: 86b1377b1e0eb09bf9e50ac66b988548b022cf96
2013-05-05 23:59:13 -07:00
John-David Dalton
086669fbe0 Ensure _.forIn works over objects with longer inheritance chains in IE < 9.
Former-commit-id: 226223454e71dd8cb6c38a543f1accd915eef3cb
2013-05-05 23:58:33 -07:00
John-David Dalton
4cc3fcb6e8 Ensure unknown objectTypes return false.
Former-commit-id: a60236ecd8908a91c0268d71d5710665986f1ceb
2013-05-05 23:49:37 -07:00
John-David Dalton
8781053dbe Simplify arrays iterator options.
Former-commit-id: 7ea81c03f791615bcfec24d8574162c190d49c7d
2013-05-03 08:51:10 -07:00
John-David Dalton
bdac8974d8 Realign _.assign and _.defaults with ES6 Object.assign. [closes #259]
Former-commit-id: e8c89e4a130ed286ce07e1a2e848f50b182effae
2013-05-03 08:33:51 -07:00
John-David Dalton
9ae24141a3 Cleanup _.debounce.
Former-commit-id: 0212c6b31222a8e215d6f60e906fbad074f424a9
2013-05-02 00:06:55 -07:00
John-David Dalton
e773efdc59 Ensure _.debounce with leading and trailing will call the func on the leading edge after a trailing call is performed. [closes #257]
Former-commit-id: 97afe842b2b4c3eb20c9557298e01ec268386ea2
2013-05-01 09:03:52 -07:00
John-David Dalton
8f94bd1fbd Reduce _.unzip and _.zip.
Former-commit-id: f388c50817910eee510f33b22fd4904fd648a6f0
2013-04-30 09:18:26 -07:00
John-David Dalton
d24d83d52a Ensure remove of the "exit early" feature is handled properly when mixing lodash methods into the underscore build.
Former-commit-id: 973c3e188076ca4403f59684b82bee3049370d5a
2013-04-30 09:12:57 -07:00
John-David Dalton
c938017baa Bump to v1.2.1.
Former-commit-id: ddffb32b2aa61001e81fccfa59b9e9bb38bf7883
2013-04-29 09:10:51 -07:00
John-David Dalton
728eea3ae1 Use zopfli to compress minifiers.
Former-commit-id: 0c68644b7602caf00b02a4977951508aceeb4156
2013-04-29 08:55:07 -07:00
John-David Dalton
88f9c1e539 Add modern build test.
Former-commit-id: 5f1addf774bd9d128095d477c227c4d8420ead5d
2013-04-29 08:54:46 -07:00
John-David Dalton
76540c20f3 Add .map to the ignore files. [ci skip]
Former-commit-id: 129c53ab38b4fbb178b4a832a7abdbf8b055d615
2013-04-29 08:54:15 -07:00
John-David Dalton
70761cf1d9 Avoid false test fails in isType unit tests.
Former-commit-id: b7311a8c3844000efab5d56d3632b99f0bf16ce8
2013-04-28 19:28:40 -07:00
John-David Dalton
ace913a97d Update avatars in READMEs. [ci skip]
Former-commit-id: a4ca090094770481959cd4d4e68ec49696c12f9d
2013-04-28 16:51:53 -07:00
John-David Dalton
d6e269c7f6 Avoid special characters in the whitespace unit test.
Former-commit-id: 5344bbdb0cd96a3a7d275facc7160c1afa1e971e
2013-04-28 16:48:54 -07:00
John-David Dalton
ec10550b3a Ensure the _.isRegExp is correct for various builds.
Former-commit-id: 38cf57053b89b1011bbfbd0b6a9cd31e91589c31
2013-04-28 16:48:13 -07:00
John-David Dalton
86e2374b48 Ensure _.isArray assignment is handled correctly for builds.
Former-commit-id: a844909ada5fbb394cbb91d06e6c76ccc6c40ff7
2013-04-28 15:53:36 -07:00
John-David Dalton
d156dacbb9 Add more .json files to the various ignore files. [ci skip]
Former-commit-id: ff1bce7c404799856f838aab301e60b654309c96
2013-04-28 15:23:53 -07:00
John-David Dalton
1af5517da0 Add component.json. [closes #58]
Former-commit-id: a7edbb3ee80687f3c74fdb2ae37cad553e009766
2013-04-28 00:18:37 -07:00
John-David Dalton
e5d34890a9 Cleanup whitespace characters in strings and fix a whitespace bug in Closure Compiler.
Former-commit-id: d1ab43648f3084b7bcfbd471728b71cea48aa9be
2013-04-27 02:24:25 -07:00
John-David Dalton
183b2548cf Document the radix argument of _.parseInt and ensure it ignores leading whitespace. [closes #254]
Former-commit-id: b1d0f7688402b3f41cfb030c63dcd097ba3f4e68
2013-04-26 22:48:14 -07:00
John-David Dalton
d2de489e3a Update vendors.
Former-commit-id: a36c775be95f95737129965826c2ffcab3fde4f3
2013-04-26 10:44:59 -07:00
Kit Cambridge
90f8dbd86e minify: Send a User-Agent header to avoid 403 responses from GitHub. [ci skip] [closes #255]
Former-commit-id: 1879b790b4ace543430edba6ae62d33c963f0344
2013-04-26 09:38:04 -07:00
John-David Dalton
3508ce19f3 Remove support.argsObject from the underscore build.
Former-commit-id: 4b25a64d662bde78ab6956109b072ed0a4755e53
2013-04-25 09:15:12 -07:00
John-David Dalton
00188c9818 Use -1 as the selectedIndex of the drop down lists when a custom url is used in the perf suite. [ci skip]
Former-commit-id: a3946b9a1d1e129b202606172803daf93afb1fbe
2013-04-24 23:40:41 -07:00
John-David Dalton
499232f0e6 Use lodash.reduce in getGeometricMean of perf.js. [ci skip]
Former-commit-id: 7c5af9afcd56958e03f96d3f13f396894cf95f4b
2013-04-24 21:48:04 -07:00
John-David Dalton
17471a12d2 Add legacy build to the perf suite and ensure belt is assigned the correct value.
Former-commit-id: 568bbd8157155d76d406ae0e33fe71418f4632f4
2013-04-24 12:53:18 -07:00
John-David Dalton
de4b5eeda7 Allow external scripts to be specified and run in the perf suite.
Former-commit-id: 474f0a24d54c800830e2bcec98f6536a17a12bfb
2013-04-24 09:08:46 -07:00
John-David Dalton
d0a0193707 Add missing backticks in the docs. [ci skip]
Former-commit-id: 77e7f0275b820e02d52dea90181fc48ae0f650fe
2013-04-23 20:28:52 -07:00
John-David Dalton
5269a26b69 Merge pull request #253 from ajoslin/master
Fix missing backtick in uniq docs

Former-commit-id: 37b7007e2f2bc8e30f09fb04dc1a2a69c84795e2
2013-04-23 20:14:24 -07:00
Andy Joslin
8dc6ad587f Fix missing backtick in uniq docs
Former-commit-id: f43321cad9391c1b6167cf1ba7a7814e5128948c
2013-04-23 23:07:55 -04:00
John-David Dalton
757339c52d Add more builds to the drop down lists of the perf and test suite.
Former-commit-id: ab565c850a553e70137b064383813812eee4acce
2013-04-23 00:05:37 -07:00
John-David Dalton
6e289339d7 Ensure _.isArray fallback returns a boolean value.
Former-commit-id: c96fb8e95c40d546099796f8337db6d4d3d33aea
2013-04-22 23:56:36 -07:00
John-David Dalton
3ff0a44a1c Tweak perf suite to use geometric mean and remove tests with high variability.
Former-commit-id: ce4ff88ee6be007b761bcf991c59f30f28880973
2013-04-22 08:33:01 -07:00
John-David Dalton
0562228e9a Ensure the modern build version of _.isPlainObject doesn't error when passed an object created via Object.create. [closes #248]
Former-commit-id: d24641ed2562925fbbd2b64653e8e93ab1aa02bc
2013-04-20 19:40:48 -07:00
John-David Dalton
0b6993bb7c Fix _.debounce doc typo.
Former-commit-id: e2659ca38818d15a4080aa8dd605fed99a9eaa43
2013-04-19 09:07:55 -07:00
John-David Dalton
4a19d90d48 Add _.isObject to the isType benchmark.
Former-commit-id: 4e2a61fab31b506bac1d5ce7ad47f7bb2d9e11b6
2013-04-19 01:03:09 -07:00
John-David Dalton
038b1bcf7b Update _.debounce and _.throttle doc examples and rebuild.
Former-commit-id: fc094e857aeae0ab9581ad56dca894cc96bc7b2e
2013-04-19 01:02:36 -07:00
John-David Dalton
a707c2fe8e Ensure isType methods return false for subclassed values.
Former-commit-id: e300d12eb506c6ae4949bd37cf8eb33c3a4be2e1
2013-04-19 00:12:22 -07:00
John-David Dalton
3bb119f578 Update _.debounce and _.throttled docs. [ci skip]
Former-commit-id: 5a94c9d35069952c72303541409b88656deaa6a7
2013-04-17 22:40:49 -07:00
John-David Dalton
2a92600fa7 Add _.throttle unit test to test lastCalled.
Former-commit-id: 528ebd3514aacafcde55fad989f955f1fe403811
2013-04-17 21:36:37 -07:00
John-David Dalton
e80e1dab4d Add lodash underscore build tests for isType methods.
Former-commit-id: 80898964d46abebb3acf1e5e3586f4df700cd85b
2013-04-17 19:53:14 -07:00
John-David Dalton
45d59d75ba Remove stray fs.writeFileSync in build.js.
Former-commit-id: ba94c84ac7e3d2fe9be8e578035132c86cd59790
2013-04-17 19:52:49 -07:00
John-David Dalton
28cd4c3ee9 Update docs & builds.
Former-commit-id: 84fbc06fe506451e70fb76cef16cbc072468df99
2013-04-17 09:04:07 -07:00
John-David Dalton
e7c44274b0 Ensure _.debounce performs a trailing call, when both leading and trailing are true, only after the throttled function is called more than once. [closes #243]
Former-commit-id: 59ac6bc4ece373623f2bd753b662b8cc974cabc8
2013-04-17 08:43:18 -07:00
John-David Dalton
3b2e0e34ef Tweak release notes in README.md. [ci skip]
Former-commit-id: 316e7610ad00ca0b9d6a80ec44d38e1e739dcfd8
2013-04-17 08:07:28 -07:00
42 changed files with 5804 additions and 3191 deletions

3
.gitignore vendored
View File

@@ -1,5 +1,8 @@
.DS_Store .DS_Store
*.custom.* *.custom.*
*.template.*
*.d.ts
*.map
node_modules node_modules
vendor/closure-compiler vendor/closure-compiler
vendor/uglifyjs vendor/uglifyjs

View File

@@ -1,11 +1,15 @@
.* .*
*.custom.* *.custom.*
*.template.*
*.d.ts *.d.ts
*.map
*.md *.md
*.txt *.txt
build.js build.js
lodash.js
index.js index.js
bower.json bower.json
component.json
build build
doc doc
node_modules node_modules

View File

@@ -1,10 +1,12 @@
.* .*
*.custom.* *.custom.*
*.template.*
*.d.ts *.d.ts
*.map
*.md *.md
bower.json bower.json
component.json
doc doc
node_modules
perf perf
test test
vendor/*.gz vendor/*.gz

View File

@@ -2,12 +2,14 @@ language: node_js
node_js: node_js:
- 0.6 - 0.6
- 0.9 - 0.9
- 0.10
env: env:
- TEST_COMMAND="istanbul cover ./test/test.js"
- TEST_COMMAND="phantomjs ./test/test.js ../dist/lodash.compat.js" - TEST_COMMAND="phantomjs ./test/test.js ../dist/lodash.compat.js"
- TEST_COMMAND="phantomjs ./test/test.js ../dist/lodash.compat.min.js" - TEST_COMMAND="phantomjs ./test/test.js ../dist/lodash.compat.min.js"
- TEST_COMMAND="node ./test/test.js ../dist/lodash.js" - TEST_COMMAND="node ./test/test.js ../dist/lodash.js"
- TEST_COMMAND="node ./test/test.js ../dist/lodash.min.js" - TEST_COMMAND="node ./test/test.js ../dist/lodash.min.js"
- TEST_COMMAND="node ./test/test-build.js --time-limit 49m30s" - TEST_COMMAND="node ./test/test-build.js --time-limit 48m"
git: git:
depth: 1 depth: 1
branches: branches:
@@ -16,5 +18,6 @@ branches:
before_script: before_script:
- "tar -xzvf vendor/closure-compiler.tar.gz -C vendor" - "tar -xzvf vendor/closure-compiler.tar.gz -C vendor"
- "tar -xzvf vendor/uglifyjs.tar.gz -C vendor" - "tar -xzvf vendor/uglifyjs.tar.gz -C vendor"
- "npm install -g istanbul"
script: script:
$TEST_COMMAND $TEST_COMMAND

View File

@@ -1,28 +1,28 @@
# Lo-Dash <sup>v1.2.0</sup> # Lo-Dash <sup>v1.3.1</sup>
A low-level utility library delivering consistency, [customization](https://github.com/bestiejs/lodash#custom-builds), [performance](http://lodash.com/benchmarks), and [extra features](https://github.com/bestiejs/lodash#features). A low-level utility library delivering consistency, [customization](https://github.com/bestiejs/lodash#custom-builds), [performance](http://lodash.com/benchmarks), and [extra features](https://github.com/bestiejs/lodash#features).
## Download ## Download
* Lo-Dash builds (for modern environments):<br> * Lo-Dash builds (for modern environments):<br>
[Development](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.js) and [Development](https://raw.github.com/bestiejs/lodash/v1.3.1/dist/lodash.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.min.js) [Production](https://raw.github.com/bestiejs/lodash/v1.3.1/dist/lodash.min.js)
* Lo-Dash compatibility builds (for legacy and modern environments):<br> * Lo-Dash compatibility builds (for legacy and modern environments):<br>
[Development](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.compat.js) and [Development](https://raw.github.com/bestiejs/lodash/v1.3.1/dist/lodash.compat.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.compat.min.js) [Production](https://raw.github.com/bestiejs/lodash/v1.3.1/dist/lodash.compat.min.js)
* Underscore compatibility builds:<br> * Underscore compatibility builds:<br>
[Development](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.underscore.js) and [Development](https://raw.github.com/bestiejs/lodash/v1.3.1/dist/lodash.underscore.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.2.0/dist/lodash.underscore.min.js) [Production](https://raw.github.com/bestiejs/lodash/v1.3.1/dist/lodash.underscore.min.js)
* CDN copies of ≤ v1.2.0s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):<br> * CDN copies of ≤ v1.3.1s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):<br>
[Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.0/lodash.js), [Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.js),
[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.0/lodash.min.js),<br> [Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.min.js),<br>
[Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.0/lodash.compat.js), [Lo-Dash compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.compat.js),
[Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.0/lodash.compat.min.js),<br> [Lo-Dash compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.compat.min.js),<br>
[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.0/lodash.underscore.js), and [Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.underscore.js), and
[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.2.0/lodash.underscore.min.js) [Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.3.1/lodash.underscore.min.js)
* For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need * For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need
@@ -68,6 +68,7 @@ For more information check out these articles, screencasts, and other videos ove
* [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking and extended environment support * [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking and extended environment support
* [_.support](http://lodash.com/docs#support) to flag environment features * [_.support](http://lodash.com/docs#support) to flag environment features
* [_.template](http://lodash.com/docs#template) supports [*“imports”* options](http://lodash.com/docs#templateSettings_imports), [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6), and [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) * [_.template](http://lodash.com/docs#template) supports [*“imports”* options](http://lodash.com/docs#templateSettings_imports), [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6), and [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
* [_.transform](http://lodash.com/docs#transform) as a powerful alternative to [_.reduce](http://lodash.com/docs#reduce) for transforming objects
* [_.unzip](http://lodash.com/docs#unzip) as the inverse of [_.zip](http://lodash.com/docs#zip) * [_.unzip](http://lodash.com/docs#unzip) as the inverse of [_.zip](http://lodash.com/docs#zip)
* [_.where](http://lodash.com/docs#where) supports deep object comparisons * [_.where](http://lodash.com/docs#where) supports deep object comparisons
* [_.clone](http://lodash.com/docs#clone), [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick), * [_.clone](http://lodash.com/docs#clone), [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick),
@@ -79,12 +80,13 @@ For more information check out these articles, screencasts, and other videos ove
## Support ## Support
Lo-Dash has been tested in at least Chrome 5~26, Firefox 2~19, IE 6-10, Opera 9.25~12, Safari 3-6, Node.js 0.4.8-0.10.4, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5. Lo-Dash has been tested in at least Chrome 5~27, Firefox 2~21, IE 6-10, Opera 9.25~12, Safari 3-6, Node.js 0.4.8-0.10.7 (Node bug [#5622](https://github.com/joyent/node/issues/5622) prevents 0.10.8-0.10.10 from working), Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
## Custom builds ## Custom builds
Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need. Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need.
To top it off, we handle all method dependency and alias mapping for you. To top it off, we handle all method dependency and alias mapping for you.
For a more detailed summary over the differences between various builds, check out the [wiki page](https://github.com/bestiejs/lodash/wiki/build-differences).
* Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument. * Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument.
```bash ```bash
@@ -247,20 +249,46 @@ require({
## Release Notes ## Release Notes
### <sup>v1.2.0</sup> ### <sup>v1.3.1</sup>
* Added Bower package support * Added missing `cache` property to the objects returned by `getObject`
* Added `_.unzip` * Ensured `maxWait` unit tests pass in Ringo
* Added an `options` argument to `_.debounce` and `_.throttle` * Increased the `maxPoolSize` value
* Allowed non-`underscore` builds to include `_.findWhere` and `_.chain` * Optimized `releaseArray` and `releaseObject`
* Ensured *“Arrays”* and *“Objects”* category methods work with `arguments` objects and arrays respectively
* Ensured build utility runs on Windows ### <sup>v1.3.0</sup>
* Ensured `underscore` build versions of *“isType”* methods align with Underscore
* Ensured methods avoid issues with the `__proto__` property * Added `_.transform` method
* Ensured `_.merge` applies a `callback` to nested properties * Added `_.chain` and `_.findWhere` aliases
* Ensured `_.merge` passes the correct `callback` arguments when comparing objects * Added internal array and object pooling
* Made Lo-Dash work with Browserify * Added Istanbul test coverage reports to Travis CI
* Removed method compilation from the `modern` * Added `maxWait` option to `_.debounce`
* Added support for floating point numbers to `_.random`
* Added Volo configuration to package.json
* Adjusted UMD for `component build`
* Allowed more stable mixing of `lodash` and `underscore` build methods
* Ensured debounced function with, `leading` and `trailing` options, works as expected
* Ensured minified builds work with the Dojo builder
* Ensured minification avoids deoptimizing expressions containing boolean values
* Ensured unknown types return `false` in `_.isObject` and `_.isRegExp`
* Ensured `_.clone`, `_.flatten`, and `_.uniq` can be used as a `callback` for methods like `_.map`
* Ensured `_.forIn` works on objects with longer inheritance chains in IE < 9
* Ensured `_.isPlainObject` returns `true` for empty objects in IE < 9
* Ensured `_.max` and `_.min` chain correctly
* Ensured `clearTimeout` use doesnt cause errors in Titanium
* Ensured that the `--stdout` build option doesn't write to a file
* Exposed memoized functions `cache`
* Fixed `Error.prototype` iteration bugs
* Fixed "scripts" paths in component.json
* Made methods support customizing `_.indexOf`
* Made the build track dependencies of private functions
* Made the `template` pre-compiler build option avoid escaping non-ascii characters
* Made `_.createCallback` avoid binding functions if they dont reference `this`
* Optimized the Closure Compiler minification process
* Optimized the large array cache for `_.difference`, `_.intersection`, and `_.uniq`
* Optimized internal `_.flatten` and `_.indexOf` use
* Reduced `_.unzip` and `_.zip`
* Removed special handling of arrays in `_.assign` and `_.defaults`
The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog). The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).
@@ -270,12 +298,12 @@ Lo-Dash is part of the BestieJS *“Best in Class”* module collection. This me
## Author ## Author
* [John-David Dalton](http://allyoucanleet.com/) | [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton "Follow @jdalton on Twitter") |
[![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") |---|
| [John-David Dalton](http://allyoucanleet.com/) |
## Contributors ## Contributors
* [Kit Cambridge](http://kitcambridge.github.com/) | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias "Follow @mathias on Twitter") |
[![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") |---|---|
* [Mathias Bynens](http://mathiasbynens.be/) | [Kit Cambridge](http://kitcambridge.github.io/) | [Mathias Bynens](http://mathiasbynens.be/) |
[![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter")

View File

@@ -1,15 +1,19 @@
{ {
"name": "lodash", "name": "lodash",
"version": "1.2.0", "version": "1.3.1",
"main": "./lodash.js", "main": "./dist/lodash.compat.js",
"ignore": [ "ignore": [
".*", ".*",
"*.custom.*", "*.custom.*",
"*.template.*",
"*.d.ts", "*.d.ts",
"*.map",
"*.md", "*.md",
"*.txt", "*.txt",
"build.js", "build.js",
"index.js", "index.js",
"component.json",
"package.json",
"build", "build",
"doc", "doc",
"node_modules", "node_modules",

2157
build.js

File diff suppressed because it is too large Load Diff

View File

@@ -3,8 +3,8 @@
'use strict'; 'use strict';
/** Load Node.js modules */ /** Load Node.js modules */
var https = require('https'), var cp = require('child_process'),
spawn = require('child_process').spawn, https = require('https'),
zlib = require('zlib'); zlib = require('zlib');
/** Load other modules */ /** Load other modules */
@@ -19,10 +19,10 @@
path = util.path; path = util.path;
/** The Git object ID of `closure-compiler.tar.gz` */ /** The Git object ID of `closure-compiler.tar.gz` */
var closureId = 'fe7665b9fb2378ffaf9e3985268e20e5c72e35fd'; var closureId = '9fd5d61c1b706e7505aeb5187941c2c5497e5fd8';
/** The Git object ID of `uglifyjs.tar.gz` */ /** The Git object ID of `uglifyjs.tar.gz` */
var uglifyId = '3658629b8c7ae2e686f69eadd788ed792a23f4c6'; var uglifyId = '7de2795a3af58d1b293e3b0e83cdbc994f4941dc';
/** The path of the directory that is the base of the repository */ /** The path of the directory that is the base of the repository */
var basePath = fs.realpathSync(path.join(__dirname, '..')); var basePath = fs.realpathSync(path.join(__dirname, '..'));
@@ -310,7 +310,10 @@
// containing Base64-encoded blob data. Overriding the `Accept` header // containing Base64-encoded blob data. Overriding the `Accept` header
// with the GitHub raw media type returns the blob data directly. // with the GitHub raw media type returns the blob data directly.
// See http://developer.github.com/v3/media/. // See http://developer.github.com/v3/media/.
'Accept': mediaType 'Accept': mediaType,
// As of 2013-04-24, the GitHub API mandates the `User-Agent` header
// for all requests.
'User-Agent': 'Lo-Dash/' + _.VERSION
} }
}, function(response) { }, function(response) {
var decompressor = zlib.createUnzip(), var decompressor = zlib.createUnzip(),
@@ -321,6 +324,30 @@
}); });
} }
/**
* Retrieves the Java command-line options used for faster minification by
* the Closure Compiler, invoking the `callback` when finished. Subsequent
* calls will lazily return the previously retrieved options. The `callback`
* is invoked with one argument; (options).
*
* See https://code.google.com/p/closure-compiler/wiki/FAQ#What_are_the_recommended_Java_VM_command-line_options?.
*
* @private
* @param {Function} callback The function called once the options have been retrieved.
*/
function getJavaOptions(callback) {
var result = [];
cp.exec('java -version -client -d32', function(error) {
if (!error && process.platform != 'win32') {
result.push('-client', '-d32');
}
getJavaOptions = function(callback) {
_.defer(callback, result);
};
callback(result);
});
}
/** /**
* Resolves the source map path from the given output path. * Resolves the source map path from the given output path.
* *
@@ -347,6 +374,8 @@
var filePath = this.filePath, var filePath = this.filePath,
isAdvanced = mode == 'advanced', isAdvanced = mode == 'advanced',
isMapped = this.isMapped, isMapped = this.isMapped,
isSilent = this.isSilent,
isTemplate = this.isTemplate,
options = closureOptions.slice(), options = closureOptions.slice(),
outputPath = this.outputPath, outputPath = this.outputPath,
mapPath = getMapPath(outputPath), mapPath = getMapPath(outputPath),
@@ -372,58 +401,63 @@
if (isMapped) { if (isMapped) {
options.push('--create_source_map=' + mapPath, '--source_map_format=V3'); options.push('--create_source_map=' + mapPath, '--source_map_format=V3');
} }
if (isTemplate) {
var compiler = spawn('java', ['-jar', closurePath].concat(options)); options.push('--charset=UTF-8');
if (!this.isSilent) {
console.log('Compressing ' + path.basename(outputPath, '.js') + ' using the Closure Compiler (' + mode + ')...');
} }
var error = ''; getJavaOptions(function(javaOptions) {
compiler.stderr.on('data', function(data) { var compiler = cp.spawn('java', javaOptions.concat('-jar', closurePath, options));
error += data; if (!isSilent) {
console.log('Compressing ' + path.basename(outputPath, '.js') + ' using the Closure Compiler (' + mode + ')...');
}
var error = '';
compiler.stderr.on('data', function(data) {
error += data;
});
var output = '';
compiler.stdout.on('data', function(data) {
output += data;
});
compiler.on('exit', function(status) {
// `status` contains the process exit code
if (status) {
var exception = new Error(error);
exception.status = status;
}
// restore IIFE and move exposed vars inside the IIFE
if (hasIIFE && isAdvanced) {
output = output
.replace(/__iife__\(/, '(')
.replace(/,\s*this\)([\s;]*(\n\/\/.+)?)$/, '(this))$1')
.replace(/^((?:var (?:\w+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^{]+{)/, '$2$1');
}
// inject "use strict" directive
if (isStrict) {
output = output.replace(/^[\s\S]*?function[^{]+{/, '$&"use strict";');
}
// restore copyright header
if (license) {
output = license + output;
}
if (isMapped) {
var mapOutput = fs.readFileSync(mapPath, 'utf8');
fs.unlinkSync(mapPath);
output = output.replace(/[\s;]*$/, '\n/*\n//@ sourceMappingURL=' + sourceMapURL) + '\n*/';
mapOutput = JSON.parse(mapOutput);
mapOutput.file = path.basename(outputPath);
mapOutput.sources = [path.basename(filePath)];
mapOutput = JSON.stringify(mapOutput, null, 2);
}
callback(exception, output, mapOutput);
});
// proxy the standard input to the Closure Compiler
compiler.stdin.end(source);
}); });
var output = '';
compiler.stdout.on('data', function(data) {
output += data;
});
compiler.on('exit', function(status) {
// `status` contains the process exit code
if (status) {
var exception = new Error(error);
exception.status = status;
}
// restore IIFE and move exposed vars inside the IIFE
if (hasIIFE && isAdvanced) {
output = output
.replace(/__iife__\(/, '(')
.replace(/,\s*this\)([\s;]*(\n\/\/.+)?)$/, '(this))$1')
.replace(/^((?:var (?:\w+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^{]+{)/, '$2$1');
}
// inject "use strict" directive
if (isStrict) {
output = output.replace(/^[\s\S]*?function[^{]+{/, '$&"use strict";');
}
// restore copyright header
if (license) {
output = license + output;
}
if (isMapped) {
var mapOutput = fs.readFileSync(mapPath, 'utf8');
fs.unlinkSync(mapPath);
output = output.replace(/[\s;]*$/, '\n/*\n//@ sourceMappingURL=' + sourceMapURL) + '\n*/';
mapOutput = JSON.parse(mapOutput);
mapOutput.file = path.basename(outputPath);
mapOutput.sources = [path.basename(filePath)];
mapOutput = JSON.stringify(mapOutput, null, 2);
}
callback(exception, output, mapOutput);
});
// proxy the standard input to the Closure Compiler
compiler.stdin.end(source);
} }
/** /**
@@ -467,7 +501,7 @@
// 4. output // 4. output
// restrict lines to 500 characters for consistency with the Closure Compiler // restrict lines to 500 characters for consistency with the Closure Compiler
var stream = uglifyJS.OutputStream({ var stream = uglifyJS.OutputStream({
'ascii_only': true, 'ascii_only': !this.isTemplate,
'comments': /@cc_on|@license|@preserve/i, 'comments': /@cc_on|@license|@preserve/i,
'max_line_len': 500, 'max_line_len': 500,
}); });

View File

@@ -2,8 +2,9 @@
;(function() { ;(function() {
'use strict'; 'use strict';
/** The Node.js filesystem module */ /** Load Node.js modules */
var fs = require('fs'); var fs = require('fs'),
vm = require('vm');
/** The minimal license/copyright template */ /** The minimal license/copyright template */
var licenseTemplate = [ var licenseTemplate = [
@@ -24,11 +25,43 @@
* @returns {String} Returns the processed source. * @returns {String} Returns the processed source.
*/ */
function postprocess(source) { function postprocess(source) {
// remove copyright header
source = source.replace(/^\/\**[\s\S]+?\*\/\n/, '');
// correct overly aggressive Closure Compiler advanced optimization // correct overly aggressive Closure Compiler advanced optimization
source = source.replace(/(document[^&]+&&)\s*(?:\w+|!\d)/, '$1!({toString:0}+"")'); source = source
.replace(/(document[^&]+&&)\s*(?:\w+|!\d)/, '$1!({toString:0}+"")')
.replace(/"\t"/g, '"\\t"')
.replace(/"[^"]*?\\f[^"]*?"/g,
'" \\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"'
);
try {
var context = vm.createContext({});
vm.runInContext(source, context);
} catch(e) { }
['forEach', 'forIn', 'forOwn'].forEach(function(methodName) {
var pairs = /[!=]==\s*([a-zA-Z]+)(?!\()|([a-zA-Z]+)\s*[!=]==/.exec((context._ || {})[methodName]),
varName = pairs && (pairs[1] || pairs[2]),
value = (value = varName && RegExp('\\b' + varName + '\\s*=\\s*!([01])\\b').exec(source)) && !+value[1];
if (typeof value == 'boolean') {
// replace vars for `false` and `true` with boolean literals
source = source.replace(RegExp('([!=]==\\s*)' + varName + '\\b(?!\\()|\\b' + varName + '(\\s*[!=]==)', 'g'), function(match, prelude, postlude, at) {
// avoid replacing local variables with the same name
return RegExp('\\b' + varName + '\\s*(?:,|=[^=])').test(source.slice(at - 10, at))
? match
: (prelude || '') + value + (postlude || '');
});
}
});
// replace `!1` and `!0` in expressions with `false` and `true` values
[/([!=]==)\s*!1\b|(.)!1\s*([!=]==)/g, /([!=]==)\s*!0\b|(.)!0\s*([!=]==)/g].forEach(function(regexp, index) {
source = source.replace(regexp, function(match, prelude, chr, postlude) {
return (prelude || chr + (/\w/.test(chr) ? ' ' : '')) + !!index + (postlude || '');
});
});
// flip `typeof` expressions to help optimize Safari and // flip `typeof` expressions to help optimize Safari and
// correct the AMD module definition for AMD build optimizers // correct the AMD module definition for AMD build optimizers
@@ -37,6 +70,11 @@
return (other ? other + ' ' : '') + expression + equality + type; return (other ? other + ' ' : '') + expression + equality + type;
}); });
// add a space so `define` is detected by the Dojo builder
source = source.replace(/(.)(define\()/, function(match, prelude, define) {
return prelude + (/^\S/.test(prelude) ? ' ' : '') + define;
});
// add trailing semicolon // add trailing semicolon
if (source) { if (source) {
source = source.replace(/[\s;]*?(\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)*$/, ';$1'); source = source.replace(/[\s;]*?(\s*\/\/.*\s*|\s*\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/\s*)*$/, ';$1');
@@ -46,6 +84,9 @@
if (!snippet) { if (!snippet) {
return source; return source;
} }
// remove copyright header
source = source.replace(/^\/\**[\s\S]+?\*\/\n/, '');
// add new copyright header // add new copyright header
var version = snippet[2]; var version = snippet[2];
source = licenseTemplate.replace('<%= VERSION %>', version) + '\n;' + source; source = licenseTemplate.replace('<%= VERSION %>', version) + '\n;' + source;

View File

@@ -11,32 +11,44 @@
'argsIndex', 'argsIndex',
'argsLength', 'argsLength',
'callback', 'callback',
'className',
'collection', 'collection',
'conditions',
'ctor', 'ctor',
'errorClass',
'errorProto',
'guard', 'guard',
'hasOwnProperty', 'hasOwnProperty',
'index', 'index',
'isArguments', 'isArguments',
'isArray', 'isArray',
'isProto',
'isString', 'isString',
'iterable', 'iterable',
'length', 'length',
'keys', 'keys',
'lodash', 'lodash',
'nonEnum',
'nonEnumProps',
'object', 'object',
'objectProto',
'objectTypes', 'objectTypes',
'ownIndex', 'ownIndex',
'ownProps', 'ownProps',
'result', 'result',
'skipErrorProps',
'skipProto', 'skipProto',
'source', 'source',
'thisArg' 'stringClass',
'stringProto',
'thisArg',
'toString'
]; ];
/** Used to minify `iteratorTemplate` data properties */ /** Used to minify `iteratorTemplate` data properties */
var iteratorOptions = [ var iteratorOptions = [
'args', 'args',
'arrays', 'array',
'bottom', 'bottom',
'firstArg', 'firstArg',
'init', 'init',
@@ -58,6 +70,7 @@
'Array', 'Array',
'Boolean', 'Boolean',
'Date', 'Date',
'Error',
'Function', 'Function',
'Math', 'Math',
'Number', 'Number',
@@ -74,12 +87,14 @@
'any', 'any',
'argsClass', 'argsClass',
'argsObject', 'argsObject',
'array',
'assign', 'assign',
'at', 'at',
'attachEvent', 'attachEvent',
'bind', 'bind',
'bindAll', 'bindAll',
'bindKey', 'bindKey',
'cache',
'clearTimeout', 'clearTimeout',
'clone', 'clone',
'cloneDeep', 'cloneDeep',
@@ -98,6 +113,7 @@
'difference', 'difference',
'drop', 'drop',
'each', 'each',
'enumErrorProps',
'enumPrototypes', 'enumPrototypes',
'environment', 'environment',
'escape', 'escape',
@@ -118,6 +134,7 @@
'forEach', 'forEach',
'forIn', 'forIn',
'forOwn', 'forOwn',
'function',
'functions', 'functions',
'global', 'global',
'groupBy', 'groupBy',
@@ -159,6 +176,7 @@
'leading', 'leading',
'map', 'map',
'max', 'max',
'maxWait',
'memoize', 'memoize',
'merge', 'merge',
'methods', 'methods',
@@ -168,6 +186,8 @@
'nodeClass', 'nodeClass',
'nonEnumArgs', 'nonEnumArgs',
'nonEnumShadows', 'nonEnumShadows',
'null',
'number',
'object', 'object',
'omit', 'omit',
'once', 'once',
@@ -196,6 +216,7 @@
'sortedIndex', 'sortedIndex',
'source', 'source',
'spliceObjects', 'spliceObjects',
'string',
'support', 'support',
'tail', 'tail',
'take', 'take',
@@ -206,6 +227,8 @@
'times', 'times',
'toArray', 'toArray',
'trailing', 'trailing',
'transform',
'undefined',
'unescape', 'unescape',
'unindexedChars', 'unindexedChars',
'union', 'union',
@@ -276,7 +299,7 @@
string = string.slice(left.length); string = string.slice(left.length);
} }
// avoids removing the '\n' of the `stringEscapes` object // avoids removing the '\n' of the `stringEscapes` object
string = string.replace(/\[object |delete |else (?!{)|function | in |return\s+[\w"']|throw |typeof |use strict|var |@ |(["'])\\n\1|\\\\n|\\n|\s+/g, function(match) { string = string.replace(/\[object |delete |else (?!{)|function | in | instanceof |return\s+[\w"']|throw |typeof |use strict|var |@ |(["'])\\n\1|\\\\n|\\n|\s+/g, function(match) {
return match == false || match == '\\n' ? '' : match; return match == false || match == '\\n' ? '' : match;
}); });
// unclip // unclip
@@ -296,11 +319,27 @@
// remove debug sourceURL use in `_.template` // remove debug sourceURL use in `_.template`
source = source.replace(/(?:\s*\/\/.*\n)* *var sourceURL[^;]+;|\+ *sourceURL/g, ''); source = source.replace(/(?:\s*\/\/.*\n)* *var sourceURL[^;]+;|\+ *sourceURL/g, '');
// minify internal properties used by 'compareAscending' and `_.sortBy` // minify internal properties
(function() { (function() {
var properties = ['criteria', 'index', 'value'], var methods = [
snippets = source.match(/( +)function (?:compareAscending|sortBy)\b[\s\S]+?\n\1}/g); 'cacheIndexOf',
'cachePush',
'compareAscending',
'createCache',
'getObject',
'releaseObject',
'sortBy',
'uniq'
];
var props = [
'cache',
'criteria',
'index',
'value'
];
var snippets = source.match(RegExp('^( *)(?:var|function) +(?:' + methods.join('|') + ')\\b[\\s\\S]+?\\n\\1}', 'gm'));
if (!snippets) { if (!snippets) {
return; return;
} }
@@ -308,11 +347,12 @@
var modified = snippet; var modified = snippet;
// minify properties // minify properties
properties.forEach(function(property, index) { props.forEach(function(prop, index) {
var minName = minNames[index], // use minified names different than those chosen for `iteratorOptions`
reBracketProp = RegExp("\\['(" + property + ")'\\]", 'g'), var minName = minNames[iteratorOptions.length + index],
reDotProp = RegExp('\\.' + property + '\\b', 'g'), reBracketProp = RegExp("\\['(" + prop + ")'\\]", 'g'),
rePropColon = RegExp("([^?\\s])\\s*([\"'])?\\b" + property + "\\2 *:", 'g'); reDotProp = RegExp('\\.' + prop + '\\b', 'g'),
rePropColon = RegExp("([^?\\s])\\s*([\"'])?\\b" + prop + "\\2 *:", 'g');
modified = modified modified = modified
.replace(reBracketProp, "['" + minName + "']") .replace(reBracketProp, "['" + minName + "']")
@@ -331,14 +371,14 @@
var snippets = source.match( var snippets = source.match(
RegExp([ RegExp([
// match the `iteratorTemplate` // match the `iteratorTemplate`
'( +)var iteratorTemplate\\b[\\s\\S]+?\\n\\1}', '^( *)var iteratorTemplate\\b[\\s\\S]+?\\n\\1}',
// match methods created by `createIterator` calls // match methods created by `createIterator` calls
'createIterator\\((?:{|[a-zA-Z]+)[\\s\\S]*?\\);\\n', 'createIterator\\((?:{|[a-zA-Z]+)[\\s\\S]*?\\);\\n',
// match variables storing `createIterator` options // match variables storing `createIterator` options
'( +)var [a-zA-Z]+IteratorOptions\\b[\\s\\S]+?\\n\\2}', '^( *)var [a-zA-Z]+IteratorOptions\\b[\\s\\S]+?\\n\\2}',
// match the the `createIterator` function // match `cachePush`, `createCache`, `createIterator`, `getObject`, `releaseObject`, and `uniq` functions
'( +)function createIterator\\b[\\s\\S]+?\\n\\3}' '^( *)(?:var|function) +(?:cachePush|createCache|createIterator|getObject|releaseObject|uniq)\\b[\\s\\S]+?\\n\\3}'
].join('|'), 'g') ].join('|'), 'gm')
); );
// exit early if no compilable snippets // exit early if no compilable snippets
@@ -347,7 +387,7 @@
} }
snippets.forEach(function(snippet, index) { snippets.forEach(function(snippet, index) {
var isCreateIterator = /function createIterator\b/.test(snippet), var isFunc = /\bfunction *[ \w]*\(/.test(snippet),
isIteratorTemplate = /var iteratorTemplate\b/.test(snippet), isIteratorTemplate = /var iteratorTemplate\b/.test(snippet),
modified = snippet; modified = snippet;
@@ -356,6 +396,11 @@
return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']"; return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']";
}); });
// remove unnecessary semicolons in strings
modified = modified.replace(/;(?:}["']|(?:\\n|\s)*["']\s*\+\s*["'](?:\\n|\s)*})/g, function(match) {
return match.slice(1);
});
// minify `createIterator` option property names // minify `createIterator` option property names
iteratorOptions.forEach(function(property, index) { iteratorOptions.forEach(function(property, index) {
var minName = minNames[index]; var minName = minNames[index];
@@ -371,16 +416,24 @@
var minName = minNames[index]; var minName = minNames[index];
// minify variable names present in strings // minify variable names present in strings
if (isCreateIterator) { if (isFunc && !isIteratorTemplate) {
modified = modified.replace(RegExp('(([\'"])[^\\n\\2]*?)\\b' + varName + '\\b(?=[^\\n\\2]*\\2[ ,+]+$)', 'gm'), '$1' + minName); modified = modified.replace(RegExp('((["\'])[^\\n\\2]*?)\\b' + varName + '\\b(?=[^\\n\\2]*\\2[ ,+;]+$)', 'gm'), function(match, prelude) {
return prelude + minName;
});
} }
// ensure properties in compiled strings aren't minified // ensure properties in compiled strings aren't minified
else { else {
modified = modified.replace(RegExp('([^.])\\b' + varName + '\\b(?!\' *[\\]:])', 'g'), '$1' + minName); modified = modified.replace(RegExp('([^.])\\b' + varName + '\\b(?!\' *[\\]:])', 'g'), function(match, prelude) {
return prelude + minName;
});
} }
// correct `typeof` values // correct `typeof` string values
if (/^(?:boolean|function|object|number|string|undefined)$/.test(varName)) { if (/^(?:boolean|function|object|number|string|undefined)$/.test(varName)) {
modified = modified.replace(RegExp("(typeof [^']+')" + minName + "'", 'g'), '$1' + varName + "'"); modified = modified.replace(RegExp('(= *)(["\'])' + minName + '\\2|(["\'])' + minName + '\\3( *=)', 'g'), function(match, prelude, preQuote, postQuote, postlude) {
return prelude
? prelude + preQuote + varName + preQuote
: postQuote + varName + postQuote + postlude;
});
} }
}); });

20
component.json Normal file
View File

@@ -0,0 +1,20 @@
{
"name": "lodash",
"repo": "bestiejs/lodash",
"version": "1.3.1",
"description": "A low-level utility library delivering consistency, customization, performance, and extra features.",
"license": "MIT",
"scripts": [
"index.js",
"dist/lodash.compat.js"
],
"keywords": [
"browser",
"client",
"functional",
"performance",
"server",
"speed",
"util"
]
}

1341
dist/lodash.compat.js vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,46 +1,51 @@
/** /**
* @license * @license
* Lo-Dash 1.2.0 (Custom Build) lodash.com/license * Lo-Dash 1.3.1 (Custom Build) lodash.com/license
* Build: `lodash -o ./dist/lodash.compat.js` * Build: `lodash -o ./dist/lodash.compat.js`
* Underscore.js 1.4.4 underscorejs.org/LICENSE * Underscore.js 1.4.4 underscorejs.org/LICENSE
*/ */
;(function(n){function t(r){function a(n){return n&&typeof n=="object"&&!Z(n)&&Qt.call(n,"__wrapped__")?n:new U(n)}function F(n){var t=n.length,e=t>=l;if(e)for(var r={},u=-1;++u<t;){var a=f+n[u];(r[a]||(r[a]=[])).push(n[u])}return function(t){if(e){var u=f+t;return r[u]&&-1<_t(r[u],t)}return-1<_t(n,t)}}function R(n){return n.charCodeAt(0)}function T(n,t){var e=n.b,r=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return e<r?-1:1}function D(n,t,e,r){function u(){var r=arguments,l=o?this:t; ;!function(n){function t(n,t,r){r=(r||0)-1;for(var e=n.length;++r<e;)if(n[r]===t)return r;return-1}function r(n,r){var e=typeof r;if(n=n.k,"boolean"==e||r==d)return n[r];"number"!=e&&"string"!=e&&(e="object");var u="number"==e?r:x+r;return n=n[e]||(n[e]={}),"object"==e?n[u]&&-1<t(n[u],r)?0:-1:n[u]?0:-1}function e(n){var t=this.k,r=typeof n;if("boolean"==r||n==d)t[n]=y;else{"number"!=r&&"string"!=r&&(r="object");var e="number"==r?n:x+n,u=t[r]||(t[r]={});"object"==r?(u[e]||(u[e]=[])).push(n)==this.b.length&&(t[r]=b):u[e]=y
return a||(n=t[i]),e.length&&(r=r.length?(r=le.call(r),f?r.concat(e):e.concat(r)):e),this instanceof u?(V.prototype=n.prototype,l=new V,V.prototype=null,r=n.apply(l,r),et(r)?r:l):n.apply(l,r)}var a=tt(n),o=!e,i=t;if(o){var f=r;e=t}else if(!a){if(!r)throw new Dt;t=n}return u}function z(){for(var n,t={g:C,b:"k(m)",c:"",e:"m",f:"",h:"",i:!0,j:!!de},e=0;n=arguments[e];e++)for(var r in n)t[r]=n[r];if(n=t.a,t.d=/^[^,]+/.exec(n)[0],e=$t,r="var i,m="+t.d+",u="+t.e+";if(!m)return u;"+t.h+";",t.b?(r+="var n=m.length;i=-1;if("+t.b+"){",ve.unindexedChars&&(r+="if(l(m)){m=m.split('')}"),r+="while(++i<n){"+t.f+"}}else{"):ve.nonEnumArgs&&(r+="var n=m.length;i=-1;if(n&&j(m)){while(++i<n){i+='';"+t.f+"}}else{"),ve.enumPrototypes&&(r+="var v=typeof m=='function';"),t.i&&t.j)r+="var s=-1,t=r[typeof m]?o(m):[],n=t.length;while(++s<n){i=t[s];",ve.enumPrototypes&&(r+="if(!(v&&i=='prototype')){"),r+=t.f,ve.enumPrototypes&&(r+="}"),r+="}"; }}function u(n){return n.charCodeAt(0)}function a(n,t){var r=n.m,e=t.m;if(n=n.l,t=t.l,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return r<e?-1:1}function o(n){var t=-1,r=n.length,u=c();u["false"]=u["null"]=u["true"]=u.undefined=b;var a=c();for(a.b=n,a.k=u,a.push=e;++t<r;)a.push(n[t]);return u.object===false?(g(a),d):a}function i(n){return"\\"+tt[n]}function l(){return _.pop()||[]}function c(){return C.pop()||{a:"",b:d,c:"",k:d,l:d,"false":b,d:"",m:0,e:"",leading:b,f:"",maxWait:0,"null":b,number:d,object:d,push:d,g:d,string:d,h:"",trailing:b,"true":b,undefined:b,i:b,j:b,n:d}
else if(r+="for(i in m){",(ve.enumPrototypes||t.i)&&(r+="if(",ve.enumPrototypes&&(r+="!(v&&i=='prototype')"),ve.enumPrototypes&&t.i&&(r+="&&"),t.i&&(r+="h.call(m,i)"),r+="){"),r+=t.f+";",(ve.enumPrototypes||t.i)&&(r+="}"),r+="}",ve.nonEnumShadows){r+="var f=m.constructor;";for(var u=0;7>u;u++)r+="i='"+t.g[u]+"';if(","constructor"==t.g[u]&&(r+="!(f&&f.prototype===m)&&"),r+="h.call(m,i)){"+t.f+"}"}return(t.b||ve.nonEnumArgs)&&(r+="}"),r+=t.c+";return u",e("h,j,k,l,o,p,r","return function("+n+"){"+r+"}")(Qt,Q,Z,ut,de,a,$) }function f(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function p(){}function s(n){n.length=0,_.length<E&&_.push(n)}function g(n){var t=n.k;t&&g(t),n.b=n.k=n.l=n.object=n.number=n.string=n.n=d,C.length<E&&C.push(n)}function v(n,t,r){t||(t=0),typeof r=="undefined"&&(r=n?n.length:0);var e=-1;r=r-t||0;for(var u=Array(0>r?0:r);++e<r;)u[e]=n[t+e];return u}function h(e){function _(n){return n&&typeof n=="object"&&!qr(n)&&sr.call(n,"__wrapped__")?n:new C(n)}function C(n){this.__wrapped__=n
}function L(n){return"\\"+q[n]}function K(n){return _e[n]}function M(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function U(n){this.__wrapped__=n}function V(){}function G(n){var t=!1;if(!n||Zt.call(n)!=A||!ve.argsClass&&Q(n))return t;var e=n.constructor;return(tt(e)?e instanceof e:ve.nodeClass||!M(n))?ve.ownLast?(ke(n,function(n,e,r){return t=Qt.call(r,e),!1}),!0===t):(ke(n,function(n,e){t=e}),!1===t||Qt.call(n,t)):t}function H(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0); }function E(n,t,r,e){function u(){var e=arguments,c=o?this:t;return a||(n=t[i]),r.length&&(e=e.length?(e=Sr.call(e),l?e.concat(r):r.concat(e)):r),this instanceof u?(c=rt(n.prototype),e=n.apply(c,e),mt(e)?e:c):n.apply(c,e)}var a=ht(n),o=!r,i=t;if(o){var l=e;r=t}else if(!a){if(!e)throw new Zt;t=n}return u}function tt(){var n=c();n.g=L,n.b=n.c=n.f=n.h="",n.e="r",n.i=y,n.j=!!Rr;for(var t,r=0;t=arguments[r];r++)for(var e in t)n[e]=t[e];r=n.a,n.d=/^[^,]+/.exec(r)[0],t=Mt,r="return function("+r+"){",e="var m,r="+n.d+",C="+n.e+";if(!r)return C;"+n.h+";",n.b?(e+="var s=r.length;m=-1;if("+n.b+"){",Pr.unindexedChars&&(e+="if(q(r)){r=r.split('')}"),e+="while(++m<s){"+n.f+";}}else{"):Pr.nonEnumArgs&&(e+="var s=r.length;m=-1;if(s&&n(r)){while(++m<s){m+='';"+n.f+";}}else{"),Pr.enumPrototypes&&(e+="var E=typeof r=='function';"),Pr.enumErrorProps&&(e+="var D=r===j||r instanceof Error;");
var r=-1;e=e-t||0;for(var u=It(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function J(n){return we[n]}function Q(n){return Zt.call(n)==j}function W(n,t,r,u,o,i){var f=n;if(typeof t=="function"&&(u=r,r=t,t=!1),typeof r=="function"){if(r=typeof u=="undefined"?r:a.createCallback(r,u,1),f=r(f),typeof f!="undefined")return f;f=n}if(u=et(f)){var l=Zt.call(f);if(!N[l]||!ve.nodeClass&&M(f))return f;var c=Z(f)}if(!u||!t)return u?c?H(f):Ce({},f):f;switch(u=se[l],l){case x:case O:return new u(+f);case S:case P:return new u(f); var u=[];if(Pr.enumPrototypes&&u.push('!(E&&m=="prototype")'),Pr.enumErrorProps&&u.push('!(D&&(m=="message"||m=="name"))'),n.i&&n.j)e+="var A=-1,B=z[typeof r]&&t(r),s=B?B.length:0;while(++A<s){m=B[A];",u.length&&(e+="if("+u.join("&&")+"){"),e+=n.f+";",u.length&&(e+="}"),e+="}";else if(e+="for(m in r){",n.i&&u.push("l.call(r, m)"),u.length&&(e+="if("+u.join("&&")+"){"),e+=n.f+";",u.length&&(e+="}"),e+="}",Pr.nonEnumShadows){for(e+="if(r!==y){var h=r.constructor,p=r===(h&&h.prototype),e=r===H?G:r===j?i:J.call(r),v=w[e];",k=0;7>k;k++)e+="m='"+n.g[k]+"';if((!(p&&v[m])&&l.call(r,m))",n.i||(e+="||(!v[m]&&r[m]!==y[m])"),e+="){"+n.f+"}";
case I:return u(f.source,h.exec(f))}for(o||(o=[]),i||(i=[]),l=o.length;l--;)if(o[l]==n)return i[l];return f=c?u(f.length):{},c&&(Qt.call(n,"index")&&(f.index=n.index),Qt.call(n,"input")&&(f.input=n.input)),o.push(n),i.push(f),(c?pt:xe)(n,function(n,u){f[u]=W(n,t,r,e,o,i)}),f}function X(n){var t=[];return ke(n,function(n,e){tt(n)&&t.push(e)}),t.sort()}function Y(n){for(var t=-1,e=de(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function Z(n){return ve.argsObject&&n instanceof It||(te?te(n):Zt.call(n)==k) e+="}"}return(n.b||Pr.nonEnumArgs)&&(e+="}"),e+=n.c+";return C",t=t("i,j,l,n,o,q,t,u,y,z,w,G,H,J",r+e+"}"),g(n),t(M,tr,sr,ft,qr,dt,Rr,_,rr,nt,Nr,Y,er,yr)}function rt(n){return mt(n)?br(n):{}}function ut(n){return Wr[n]}function ot(){var n=(n=_.indexOf)===Pt?t:n;return n}function it(n){return function(t,r,e,u){return typeof r!="boolean"&&r!=d&&(u=e,e=u&&u[r]===t?m:r,r=b),e!=d&&(e=_.createCallback(e,u)),n(t,r,e,u)}}function lt(n){var t,r;return!n||yr.call(n)!=Q||(t=n.constructor,ht(t)&&!(t instanceof t))||!Pr.argsClass&&ft(n)||!Pr.nodeClass&&f(n)?b:Pr.ownLast?(Jr(n,function(n,t,e){return r=sr.call(e,t),b
}function nt(n,t,e,r,u,o){var f=e===i;if(typeof e=="function"&&!f){e=a.createCallback(e,r,2);var l=e(n,t);if(typeof l!="undefined")return!!l}if(n===t)return 0!==n||1/n==1/t;var c=typeof n,p=typeof t;if(n===n&&(!n||"function"!=c&&"object"!=c)&&(!t||"function"!=p&&"object"!=p))return!1;if(null==n||null==t)return n===t;if(p=Zt.call(n),c=Zt.call(t),p==j&&(p=A),c==j&&(c=A),p!=c)return!1;switch(p){case x:case O:return+n==+t;case S:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case I:case P:return n==Tt(t)}if(c=p==k,!c){if(Qt.call(n,"__wrapped__")||Qt.call(t,"__wrapped__"))return nt(n.__wrapped__||n,t.__wrapped__||t,e,r,u,o); }),r!==false):(Jr(n,function(n,t){r=t}),r===m||sr.call(n,r))}function ct(n){return Lr[n]}function ft(n){return yr.call(n)==G}function pt(n,t,r,e,u,a){var o=n;if(typeof t!="boolean"&&t!=d&&(e=r,r=t,t=b),typeof r=="function"){if(r=typeof e=="undefined"?r:_.createCallback(r,e,1),o=r(o),typeof o!="undefined")return o;o=n}if(e=mt(o)){var i=yr.call(o);if(!Z[i]||!Pr.nodeClass&&f(o))return o;var c=qr(o)}if(!e||!t)return e?c?v(o):Gr({},o):o;switch(e=Br[i],i){case J:case K:return new e(+o);case V:case Y:return new e(o);
if(p!=A||!ve.nodeClass&&(M(n)||M(t)))return!1;var p=!ve.argsObject&&Q(n)?Ft:n.constructor,s=!ve.argsObject&&Q(t)?Ft:t.constructor;if(p!=s&&(!tt(p)||!(p instanceof p&&tt(s)&&s instanceof s)))return!1}for(u||(u=[]),o||(o=[]),p=u.length;p--;)if(u[p]==n)return o[p]==t;var v=0,l=!0;if(u.push(n),o.push(t),c){if(p=n.length,v=t.length,l=v==n.length,!l&&!f)return l;for(;v--;)if(c=p,s=t[v],f)for(;c--&&!(l=nt(n[c],s,e,r,u,o)););else if(!(l=nt(n[v],s,e,r,u,o)))break;return l}return ke(t,function(t,a,i){return Qt.call(i,a)?(v++,l=Qt.call(n,a)&&nt(n[a],t,e,r,u,o)):void 0 case X:return e(o.source,P.exec(o))}i=!u,u||(u=l()),a||(a=l());for(var p=u.length;p--;)if(u[p]==n)return a[p];return o=c?e(o.length):{},c&&(sr.call(n,"index")&&(o.index=n.index),sr.call(n,"input")&&(o.input=n.input)),u.push(n),a.push(o),(c?Tr:Kr)(n,function(n,e){o[e]=pt(n,t,r,m,u,a)}),i&&(s(u),s(a)),o}function st(n){var t=[];return Jr(n,function(n,r){ht(n)&&t.push(r)}),t.sort()}function gt(n){for(var t=-1,r=Rr(n),e=r.length,u={};++t<e;){var a=r[t];u[n[a]]=a}return u}function vt(n,t,r,e,u,a){var o=r===w;
}),l&&!f&&ke(n,function(n,t,e){return Qt.call(e,t)?l=-1<--v:void 0}),l}function tt(n){return typeof n=="function"}function et(n){return n?$[typeof n]:!1}function rt(n){return typeof n=="number"||Zt.call(n)==S}function ut(n){return typeof n=="string"||Zt.call(n)==P}function at(n,t,e){var r=arguments,u=0,o=2;if(!et(n))return n;if(e===i)var f=r[3],l=r[4],c=r[5];else l=[],c=[],typeof e!="number"&&(o=r.length),3<o&&"function"==typeof r[o-2]?f=a.createCallback(r[--o-1],r[o--],2):2<o&&"function"==typeof r[o-1]&&(f=r[--o]); if(typeof r=="function"&&!o){r=_.createCallback(r,e,2);var i=r(n,t);if(typeof i!="undefined")return!!i}if(n===t)return 0!==n||1/n==1/t;var c=typeof n,p=typeof t;if(n===n&&(!n||"function"!=c&&"object"!=c)&&(!t||"function"!=p&&"object"!=p))return b;if(n==d||t==d)return n===t;if(p=yr.call(n),c=yr.call(t),p==G&&(p=Q),c==G&&(c=Q),p!=c)return b;switch(p){case J:case K:return+n==+t;case V:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case X:case Y:return n==Yt(t)}if(c=p==H,!c){if(sr.call(n,"__wrapped__")||sr.call(t,"__wrapped__"))return vt(n.__wrapped__||n,t.__wrapped__||t,r,e,u,a);
for(;++u<o;)(Z(r[u])?pt:xe)(r[u],function(t,e){var r,u,a=t,o=n[e];if(t&&((u=Z(t))||Oe(t))){for(a=l.length;a--;)if(r=l[a]==t){o=c[a];break}if(!r){var p;f&&(a=f(o,t),p=typeof a!="undefined")&&(o=a),p||(o=u?Z(o)?o:[]:Oe(o)?o:{}),l.push(t),c.push(o),p||(o=at(o,t,i,f,l,c))}}else f&&(a=f(o,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(o=a);n[e]=o});return n}function ot(n){for(var t=-1,e=de(n),r=e.length,u=It(r);++t<r;)u[t]=n[e[t]];return u}function it(n,t,e){var r=-1,u=n?n.length:0,a=!1;return e=(0>e?ae(0,u+e):e)||0,typeof u=="number"?a=-1<(ut(n)?n.indexOf(t,e):_t(n,t,e)):be(n,function(n){return++r<e?void 0:!(a=n===t) if(p!=Q||!Pr.nodeClass&&(f(n)||f(t)))return b;var p=!Pr.argsObject&&ft(n)?Qt:n.constructor,g=!Pr.argsObject&&ft(t)?Qt:t.constructor;if(p!=g&&(!ht(p)||!(p instanceof p&&ht(g)&&g instanceof g)))return b}for(g=!u,u||(u=l()),a||(a=l()),p=u.length;p--;)if(u[p]==n)return a[p]==t;var v=0,i=y;if(u.push(n),a.push(t),c){if(p=n.length,v=t.length,i=v==n.length,!i&&!o)return i;for(;v--;)if(c=p,g=t[v],o)for(;c--&&!(i=vt(n[c],g,r,e,u,a)););else if(!(i=vt(n[v],g,r,e,u,a)))break;return i}return Jr(t,function(t,o,l){return sr.call(l,o)?(v++,i=sr.call(n,o)&&vt(n[o],t,r,e,u,a)):void 0
}),a}function ft(n,t,e){var r=!0;if(t=a.createCallback(t,e),Z(n)){e=-1;for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else be(n,function(n,e,u){return r=!!t(n,e,u)});return r}function lt(n,t,e){var r=[];if(t=a.createCallback(t,e),Z(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}}else be(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function ct(n,t,e){if(t=a.createCallback(t,e),!Z(n)){var r;return be(n,function(n,e,u){return t(n,e,u)?(r=n,!1):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e]; }),i&&!o&&Jr(n,function(n,t,r){return sr.call(r,t)?i=-1<--v:void 0}),g&&(s(u),s(a)),i}function ht(n){return typeof n=="function"}function mt(n){return!(!n||!nt[typeof n])}function yt(n){return typeof n=="number"||yr.call(n)==V}function dt(n){return typeof n=="string"||yr.call(n)==Y}function bt(n,t,r){var e=arguments,u=0,a=2;if(!mt(n))return n;if(r===w)var o=e[3],i=e[4],c=e[5];else{var f=y,i=l(),c=l();typeof r!="number"&&(a=e.length),3<a&&"function"==typeof e[a-2]?o=_.createCallback(e[--a-1],e[a--],2):2<a&&"function"==typeof e[a-1]&&(o=e[--a])
if(t(o,e,n))return o}}function pt(n,t,e){if(t&&typeof e=="undefined"&&Z(n)){e=-1;for(var r=n.length;++e<r&&!1!==t(n[e],e,n););}else be(n,t,e);return n}function st(n,t,e){var r=-1,u=n?n.length:0,o=It(typeof u=="number"?u:0);if(t=a.createCallback(t,e),Z(n))for(;++r<u;)o[r]=t(n[r],r,n);else be(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function vt(n,t,e){var r=-1/0,u=r;if(!t&&Z(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>u&&(u=i)}}else t=!t&&ut(n)?R:a.createCallback(t,e),be(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n) }for(;++u<a;)(qr(e[u])?xt:Kr)(e[u],function(t,r){var e,u,a=t,l=n[r];if(t&&((u=qr(t))||Mr(t))){for(a=i.length;a--;)if(e=i[a]==t){l=c[a];break}if(!e){var f;o&&(a=o(l,t),f=typeof a!="undefined")&&(l=a),f||(l=u?qr(l)?l:[]:Mr(l)?l:{}),i.push(t),c.push(l),f||(l=bt(l,t,w,o,i,c))}}else o&&(a=o(l,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(l=a);n[r]=l});return f&&(s(i),s(c)),n}function _t(n){for(var t=-1,r=Rr(n),e=r.length,u=Ht(e);++t<e;)u[t]=n[r[t]];return u}function Ct(n,t,r){var e=-1,u=ot(),a=n?n.length:0,o=b;
});return u}function gt(n,t,e,r){var u=3>arguments.length;if(t=a.createCallback(t,r,4),Z(n)){var o=-1,i=n.length;for(u&&(e=n[++o]);++o<i;)e=t(e,n[o],o,n)}else be(n,function(n,r,a){e=u?(u=!1,n):t(e,n,r,a)});return e}function ht(n,t,e,r){var u=n,o=n?n.length:0,i=3>arguments.length;if(typeof o!="number")var f=de(n),o=f.length;else ve.unindexedChars&&ut(n)&&(u=n.split(""));return t=a.createCallback(t,r,4),pt(n,function(n,r,a){r=f?f[--o]:--o,e=i?(i=!1,u[r]):t(e,u[r],r,a)}),e}function yt(n,t,e){var r;if(t=a.createCallback(t,e),Z(n)){e=-1; return r=(0>r?kr(0,a+r):r)||0,a&&typeof a=="number"?o=-1<(dt(n)?n.indexOf(t,r):u(n,t,r)):Tr(n,function(n){return++e<r?void 0:!(o=n===t)}),o}function jt(n,t,r){var e=y;if(t=_.createCallback(t,r),qr(n)){r=-1;for(var u=n.length;++r<u&&(e=!!t(n[r],r,n)););}else Tr(n,function(n,r,u){return e=!!t(n,r,u)});return e}function wt(n,t,r){var e=[];if(t=_.createCallback(t,r),qr(n)){r=-1;for(var u=n.length;++r<u;){var a=n[r];t(a,r,n)&&e.push(a)}}else Tr(n,function(n,r,u){t(n,r,u)&&e.push(n)});return e}function kt(n,t,r){if(t=_.createCallback(t,r),!qr(n)){var e;
for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else be(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function mt(n){for(var t=-1,e=n?n.length:0,r=Gt.apply(zt,le.call(arguments,1)),r=F(r),u=[];++t<e;){var a=n[t];r(a)||u.push(a)}return u}function dt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=-1;for(t=a.createCallback(t,e);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[0];return H(n,0,oe(ae(0,r),u))}}function bt(n,t,e,r){var u=-1,o=n?n.length:0,i=[];for(typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1),null!=e&&(e=a.createCallback(e,r));++u<o;)r=n[u],e&&(r=e(r,u,n)),Z(r)?Wt.apply(i,t?r:bt(r)):i.push(r); return Tr(n,function(n,r,u){return t(n,r,u)?(e=n,b):void 0}),e}r=-1;for(var u=n.length;++r<u;){var a=n[r];if(t(a,r,n))return a}}function xt(n,t,r){if(t&&typeof r=="undefined"&&qr(n)){r=-1;for(var e=n.length;++r<e&&t(n[r],r,n)!==false;);}else Tr(n,t,r);return n}function Ot(n,t,r){var e=-1,u=n?n.length:0,a=Ht(typeof u=="number"?u:0);if(t=_.createCallback(t,r),qr(n))for(;++e<u;)a[e]=t(n[e],e,n);else Tr(n,function(n,r,u){a[++e]=t(n,r,u)});return a}function Et(n,t,r){var e=-1/0,a=e;if(!t&&qr(n)){r=-1;for(var o=n.length;++r<o;){var i=n[r];
return i}function _t(n,t,e){var r=-1,u=n?n.length:0;if(typeof e=="number")r=(0>e?ae(0,u+e):e||0)-1;else if(e)return r=Ct(n,t),n[r]===t?r:-1;for(;++r<u;)if(n[r]===t)return r;return-1}function wt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=a.createCallback(t,e);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:ae(0,t);return H(n,r)}function Ct(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?a.createCallback(e,r,1):Et,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;return u}function jt(n,t,e,r){var u=-1,o=n?n.length:0,i=[],c=i; i>a&&(a=i)}}else t=!t&&dt(n)?u:_.createCallback(t,r),Tr(n,function(n,r,u){r=t(n,r,u),r>e&&(e=r,a=n)});return a}function St(n,t,r,e){var u=3>arguments.length;if(t=_.createCallback(t,e,4),qr(n)){var a=-1,o=n.length;for(u&&(r=n[++a]);++a<o;)r=t(r,n[a],a,n)}else Tr(n,function(n,e,a){r=u?(u=b,n):t(r,n,e,a)});return r}function At(n,t,r,e){var u=n,a=n?n.length:0,o=3>arguments.length;if(typeof a!="number")var i=Rr(n),a=i.length;else Pr.unindexedChars&&dt(n)&&(u=n.split(""));return t=_.createCallback(t,e,4),xt(n,function(n,e,l){e=i?i[--a]:--a,r=o?(o=b,u[e]):t(r,u[e],e,l)
typeof t!="boolean"&&null!=t&&(r=e,e=t,t=!1);var p=!t&&o>=l;if(p)var s={};for(null!=e&&(c=[],e=a.createCallback(e,r));++u<o;){r=n[u];var v=e?e(r,u,n):r;if(p)var g=f+v,g=s[g]?!(c=s[g]):c=s[g]=[];(t?!u||c[c.length-1]!==v:g||0>_t(c,v))&&((e||p)&&c.push(v),i.push(r))}return i}function kt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:u[a[0]]=a[1]}return u}function xt(n,t){return ve.fastBind||ne&&2<arguments.length?ne.call.apply(ne,arguments):D(n,t,le.call(arguments,2))}function Ot(n){var t=le.call(arguments,1); }),r}function It(n,t,r){var e;if(t=_.createCallback(t,r),qr(n)){r=-1;for(var u=n.length;++r<u&&!(e=t(n[r],r,n)););}else Tr(n,function(n,r,u){return!(e=t(n,r,u))});return!!e}function Bt(n){var e=-1,u=ot(),a=n?n.length:0,i=lr.apply(nr,Sr.call(arguments,1)),l=[],c=a>=O&&u===t;if(c){var f=o(i);f?(u=r,i=f):c=b}for(;++e<a;)f=n[e],0>u(i,f)&&l.push(f);return c&&g(i),l}function Nt(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=d){var a=-1;for(t=_.createCallback(t,r);++a<u&&t(n[a],a,n);)e++}else if(e=t,e==d||r)return n[0];
return Yt(function(){n.apply(e,t)},1)}function Et(n){return n}function St(n){pt(X(n),function(t){var e=a[t]=n[t];a.prototype[t]=function(){var n=this.__wrapped__,t=[n];return Wt.apply(t,arguments),t=e.apply(a,t),n&&typeof n=="object"&&n==t?this:new U(t)}})}function At(){return this.__wrapped__}r=r?B.defaults(n.Object(),r,B.pick(n,w)):n;var It=r.Array,Pt=r.Boolean,Nt=r.Date,$t=r.Function,qt=r.Math,Bt=r.Number,Ft=r.Object,Rt=r.RegExp,Tt=r.String,Dt=r.TypeError,zt=It(),Lt=Ft(),Kt=r._,Mt=Rt("^"+Tt(Lt.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Ut=qt.ceil,Vt=r.clearTimeout,Gt=zt.concat,Ht=qt.floor,Jt=Mt.test(Jt=Ft.getPrototypeOf)&&Jt,Qt=Lt.hasOwnProperty,Wt=zt.push,Xt=r.setImmediate,Yt=r.setTimeout,Zt=Lt.toString,ne=Mt.test(ne=Zt.bind)&&ne,te=Mt.test(te=It.isArray)&&te,ee=r.isFinite,re=r.isNaN,ue=Mt.test(ue=Ft.keys)&&ue,ae=qt.max,oe=qt.min,ie=r.parseInt,fe=qt.random,le=zt.slice,ce=Mt.test(r.attachEvent),pe=ne&&!/\n|true/.test(ne+ce),se={}; return v(n,0,xr(kr(0,e),u))}}function Pt(n,r,e){if(typeof e=="number"){var u=n?n.length:0;e=0>e?kr(0,u+e):e||0}else if(e)return e=Ft(n,r),n[e]===r?e:-1;return n?t(n,r,e):-1}function zt(n,t,r){if(typeof t!="number"&&t!=d){var e=0,u=-1,a=n?n.length:0;for(t=_.createCallback(t,r);++u<a&&t(n[u],u,n);)e++}else e=t==d||r?1:kr(0,t);return v(n,e)}function Ft(n,t,r,e){var u=0,a=n?n.length:u;for(r=r?_.createCallback(r,e,1):Wt,t=r(t);u<a;)e=u+a>>>1,r(n[e])<t?u=e+1:a=e;return u}function $t(n){for(var t=-1,r=n?Et(Ur(n,"length")):0,e=Ht(0>r?0:r);++t<r;)e[t]=Ur(n,t);
se[k]=It,se[x]=Pt,se[O]=Nt,se[A]=Ft,se[S]=Bt,se[I]=Rt,se[P]=Tt;var ve=a.support={};(function(){var n=function(){this.x=1},t={0:1,length:1},e=[];n.prototype={valueOf:1,y:1};for(var r in new n)e.push(r);for(r in arguments);ve.argsObject=arguments.constructor==Ft&&!(arguments instanceof It),ve.argsClass=Q(arguments),ve.enumPrototypes=n.propertyIsEnumerable("prototype"),ve.fastBind=ne&&!pe,ve.ownLast="x"!=e[0],ve.nonEnumArgs=0!=r,ve.nonEnumShadows=!/valueOf/.test(e),ve.spliceObjects=(zt.splice.call(t,0,1),!t[0]),ve.unindexedChars="xx"!="x"[0]+Ft("x")[0]; return e}function qt(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var a=n[r];t?u[a]=t[r]:u[a[0]]=a[1]}return u}function Dt(n,t){return Pr.fastBind||dr&&2<arguments.length?dr.call.apply(dr,arguments):E(n,t,Sr.call(arguments,2))}function Rt(n,t,r){function e(){ir(s),ir(g),c=0,s=g=d}function u(){var t=v&&(!h||1<c);e(),t&&(p!==false&&(f=new Kt),i=n.apply(l,o))}function a(){e(),(v||p!==t)&&(f=new Kt,i=n.apply(l,o))}var o,i,l,c=0,f=0,p=b,s=d,g=d,v=y;if(t=kr(0,t||0),r===y)var h=y,v=b;else mt(r)&&(h=r.leading,p="maxWait"in r&&kr(t,r.maxWait||0),v="trailing"in r?r.trailing:v);
try{ve.nodeClass=!(Zt.call(document)==A&&!({toString:0}+""))}catch(u){ve.nodeClass=!0}})(1),a.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:y,variable:"",imports:{_:a}};var ge={a:"q,w,g",h:"var a=arguments,b=0,c=typeof g=='number'?2:a.length;while(++b<c){m=a[b];if(m&&r[typeof m]){",f:"if(typeof u[i]=='undefined')u[i]=m[i]",c:"}}"},he={a:"e,d,x",h:"d=d&&typeof x=='undefined'?d:p.createCallback(d,x)",b:"typeof n=='number'",f:"if(d(m[i],i,e)===false)return u"},ye={h:"if(!r[typeof m])return u;"+he.h,b:!1}; return function(){if(o=arguments,l=this,c++,ir(g),p===false)h&&2>c&&(i=n.apply(l,o));else{var r=new Kt;!s&&!h&&(f=r);var e=p-(r-f);0<e?s||(s=mr(a,e)):(ir(s),s=d,f=r,i=n.apply(l,o))}return t!==p&&(g=mr(u,t)),i}}function Tt(n){var t=Sr.call(arguments,1);return mr(function(){n.apply(m,t)},1)}function Wt(n){return n}function Lt(n){xt(st(n),function(t){var r=_[t]=n[t];_.prototype[t]=function(){var n=this.__wrapped__,t=[n];return gr.apply(t,arguments),t=r.apply(_,t),n&&typeof n=="object"&&n===t?this:new C(t)
U.prototype=a.prototype,ve.argsClass||(Q=function(n){return n?Qt.call(n,"callee"):!1});var me=z({a:"q",e:"[]",h:"if(!(r[typeof q]))return u",f:"u.push(i)",b:!1}),de=ue?function(n){return et(n)?ve.enumPrototypes&&typeof n=="function"||ve.nonEnumArgs&&n.length&&Q(n)?me(n):ue(n):[]}:me,be=z(he),_e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},we=Y(_e),Ce=z(ge,{h:ge.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=p.createCallback(a[--c-1],a[c--],2);}else if(c>2&&typeof a[c-1]=='function'){d=a[--c];}"),f:"u[i]=d?d(u[i],m[i]):m[i]"}),je=z(ge),ke=z(he,ye,{i:!1}),xe=z(he,ye); }})}function Gt(){return this.__wrapped__}e=e?at.defaults(n.Object(),e,at.pick(n,W)):n;var Ht=e.Array,Jt=e.Boolean,Kt=e.Date,Mt=e.Function,Ut=e.Math,Vt=e.Number,Qt=e.Object,Xt=e.RegExp,Yt=e.String,Zt=e.TypeError,nr=[],tr=e.Error.prototype,rr=Qt.prototype,er=Yt.prototype,ur=e._,ar=Xt("^"+Yt(rr.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),or=Ut.ceil,ir=e.clearTimeout,lr=nr.concat,cr=Ut.floor,fr=Mt.prototype.toString,pr=ar.test(pr=Qt.getPrototypeOf)&&pr,sr=rr.hasOwnProperty,gr=nr.push,vr=rr.propertyIsEnumerable,hr=e.setImmediate,mr=e.setTimeout,yr=rr.toString,dr=ar.test(dr=yr.bind)&&dr,br=ar.test(br=Qt.create)&&br,_r=ar.test(_r=Ht.isArray)&&_r,Cr=e.isFinite,jr=e.isNaN,wr=ar.test(wr=Qt.keys)&&wr,kr=Ut.max,xr=Ut.min,Or=e.parseInt,Er=Ut.random,Sr=nr.slice,Ar=ar.test(e.attachEvent),Ir=dr&&!/\n|true/.test(dr+Ar),Br={};
tt(/x/)&&(tt=function(n){return n instanceof $t||Zt.call(n)==E});var Oe=Jt?function(n){if(!n||Zt.call(n)!=A||!ve.argsClass&&Q(n))return!1;var t=n.valueOf,e=typeof t=="function"&&(e=Jt(t))&&Jt(e);return e?n==e||Jt(n)==e:G(n)}:G;pe&&u&&typeof Xt=="function"&&(Ot=xt(Xt,r));var Ee=8==ie("08")?ie:function(n,t){return ie(ut(n)?n.replace(m,""):n,t||0)};return a.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},a.assign=Ce,a.at=function(n){var t=-1,e=Gt.apply(zt,le.call(arguments,1)),r=e.length,u=It(r); Br[H]=Ht,Br[J]=Jt,Br[K]=Kt,Br[U]=Mt,Br[Q]=Qt,Br[V]=Vt,Br[X]=Xt,Br[Y]=Yt;var Nr={};Nr[H]=Nr[K]=Nr[V]={constructor:y,toLocaleString:y,toString:y,valueOf:y},Nr[J]=Nr[Y]={constructor:y,toString:y,valueOf:y},Nr[M]=Nr[U]=Nr[X]={constructor:y,toString:y},Nr[Q]={constructor:y},function(){for(var n=L.length;n--;){var t,r=L[n];for(t in Nr)sr.call(Nr,t)&&!sr.call(Nr[t],r)&&(Nr[t][r]=b)}}(),C.prototype=_.prototype;var Pr=_.support={};!function(){function n(){this.x=1}var t={0:1,length:1},r=[];n.prototype={valueOf:1};
for(ve.unindexedChars&&ut(n)&&(n=n.split(""));++t<r;)u[t]=n[e[t]];return u},a.bind=xt,a.bindAll=function(n){for(var t=1<arguments.length?Gt.apply(zt,le.call(arguments,1)):X(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=xt(n[u],n)}return n},a.bindKey=function(n,t){return D(n,t,le.call(arguments,2),i)},a.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},a.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)]; for(var e in new n)r.push(e);for(e in arguments);Pr.argsObject=arguments.constructor==Qt&&!(arguments instanceof Ht),Pr.argsClass=ft(arguments),Pr.enumErrorProps=vr.call(tr,"message")||vr.call(tr,"name"),Pr.enumPrototypes=vr.call(n,"prototype"),Pr.fastBind=dr&&!Ir,Pr.ownLast="x"!=r[0],Pr.nonEnumArgs=0!=e,Pr.nonEnumShadows=!/valueOf/.test(r),Pr.spliceObjects=(nr.splice.call(t,0,1),!t[0]),Pr.unindexedChars="xx"!="x"[0]+Qt("x")[0];try{Pr.nodeClass=!(yr.call(document)==Q&&!({toString:0}+""))}catch(u){Pr.nodeClass=y
return t[0]}},a.countBy=function(n,t,e){var r={};return t=a.createCallback(t,e),pt(n,function(n,e,u){e=Tt(t(n,e,u)),Qt.call(r,e)?r[e]++:r[e]=1}),r},a.createCallback=function(n,t,e){if(null==n)return Et;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=de(n);return function(t){for(var e=u.length,r=!1;e--&&(r=nt(t[u[e]],n[u[e]],i)););return r}}return typeof t!="undefined"?1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)}:4===e?function(e,r,u,a){return n.call(t,e,r,u,a) }}(1),_.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:z,variable:"",imports:{_:_}};var zr={a:"x,F,k",h:"var a=arguments,b=0,c=typeof k=='number'?2:a.length;while(++b<c){r=a[b];if(r&&z[typeof r]){",f:"if(typeof C[m]=='undefined')C[m]=r[m]",c:"}}"},Fr={a:"f,d,I",h:"d=d&&typeof I=='undefined'?d:u.createCallback(d,I)",b:"typeof s=='number'",f:"if(d(r[m],m,f)===false)return C"},$r={h:"if(!z[typeof r])return C;"+Fr.h,b:b};br||(rt=function(n){if(mt(n)){p.prototype=n;
}:function(e,r,u){return n.call(t,e,r,u)}:n},a.debounce=function(n,t,e){function r(){i=null,f&&(a=n.apply(o,u))}var u,a,o,i,f=!0;if(!0===e)var l=!0,f=!1;else e&&$[typeof e]&&(l=e.leading,f="trailing"in e?e.trailing:f);return function(){var e=l&&!i;return u=arguments,o=this,Vt(i),i=Yt(r,t),e&&(a=n.apply(o,u)),a}},a.defaults=je,a.defer=Ot,a.delay=function(n,t){var r=le.call(arguments,2);return Yt(function(){n.apply(e,r)},t)},a.difference=mt,a.filter=lt,a.flatten=bt,a.forEach=pt,a.forIn=ke,a.forOwn=xe,a.functions=X,a.groupBy=function(n,t,e){var r={}; var t=new p;p.prototype=d}return t||{}}),Pr.argsClass||(ft=function(n){return n?sr.call(n,"callee"):b});var qr=_r||function(n){return n?typeof n=="object"&&yr.call(n)==H:b},Dr=tt({a:"x",e:"[]",h:"if(!(z[typeof x]))return C",f:"C.push(m)"}),Rr=wr?function(n){return mt(n)?Pr.enumPrototypes&&typeof n=="function"||Pr.nonEnumArgs&&n.length&&ft(n)?Dr(n):wr(n):[]}:Dr,Tr=tt(Fr),Wr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Lr=gt(Wr),Gr=tt(zr,{h:zr.h.replace(";",";if(c>3&&typeof a[c-2]=='function'){var d=u.createCallback(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){d=a[--c]}"),f:"C[m]=d?d(C[m],r[m]):r[m]"}),Hr=tt(zr),Jr=tt(Fr,$r,{i:b}),Kr=tt(Fr,$r);
return t=a.createCallback(t,e),pt(n,function(n,e,u){e=Tt(t(n,e,u)),(Qt.call(r,e)?r[e]:r[e]=[]).push(n)}),r},a.initial=function(n,t,e){if(!n)return[];var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return H(n,0,oe(ae(0,u-r),u))},a.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,a=n?n.length:0,o=a>=l,i=[],c=i;n:for(;++u<a;){var p=n[u];if(o)var s=f+p,s=r[0][s]?!(c=r[0][s]):c=r[0][s]=[];if(s||0>_t(c,p)){o&&c.push(p); ht(/x/)&&(ht=function(n){return typeof n=="function"&&yr.call(n)==U});var Mr=pr?function(n){if(!n||yr.call(n)!=Q||!Pr.argsClass&&ft(n))return b;var t=n.valueOf,r=typeof t=="function"&&(r=pr(t))&&pr(r);return r?n==r||pr(n)==r:lt(n)}:lt,Ur=Ot,Vr=it(function Yr(n,t,r){for(var e=-1,u=n?n.length:0,a=[];++e<u;){var o=n[e];r&&(o=r(o,e,n)),qr(o)?gr.apply(a,t?o:Yr(o)):a.push(o)}return a}),Qr=it(function(n,e,u){var a=-1,i=ot(),c=n?n.length:0,f=[],p=!e&&c>=O&&i===t,v=u||p?l():f;if(p){var h=o(v);h?(i=r,v=h):(p=b,v=u?v:(s(v),f))
for(var v=e;--v;)if(!(r[v]||(r[v]=F(t[v])))(p))continue n;i.push(p)}}return i},a.invert=Y,a.invoke=function(n,t){var e=le.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=It(typeof a=="number"?a:0);return pt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},a.keys=de,a.map=st,a.max=vt,a.memoize=function(n,t){var e={};return function(){var r=f+(t?t.apply(this,arguments):arguments[0]);return Qt.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},a.merge=at,a.min=function(n,t,e){var r=1/0,u=r; }for(;++a<c;){var h=n[a],m=u?u(h,a,n):h;(e?!a||v[v.length-1]!==m:0>i(v,m))&&((u||p)&&v.push(m),f.push(h))}return p?(s(v.b),g(v)):u&&s(v),f});Ir&&et&&typeof hr=="function"&&(Tt=Dt(hr,e));var Xr=8==Or($+"08")?Or:function(n,t){return Or(dt(n)?n.replace(q,""):n,t||0)};return _.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},_.assign=Gr,_.at=function(n){var t=-1,r=lr.apply(nr,Sr.call(arguments,1)),e=r.length,u=Ht(e);for(Pr.unindexedChars&&dt(n)&&(n=n.split(""));++t<e;)u[t]=n[r[t]];
if(!t&&Z(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i<u&&(u=i)}}else t=!t&&ut(n)?R:a.createCallback(t,e),be(n,function(n,e,a){e=t(n,e,a),e<r&&(r=e,u=n)});return u},a.omit=function(n,t,e){var r=typeof t=="function",u={};if(r)t=a.createCallback(t,e);else var o=Gt.apply(zt,le.call(arguments,1));return ke(n,function(n,e,a){(r?!t(n,e,a):0>_t(o,e))&&(u[e]=n)}),u},a.once=function(n){var t,e;return function(){return t?e:(t=!0,e=n.apply(this,arguments),n=null,e)}},a.pairs=function(n){for(var t=-1,e=de(n),r=e.length,u=It(r);++t<r;){var a=e[t]; return u},_.bind=Dt,_.bindAll=function(n){for(var t=1<arguments.length?lr.apply(nr,Sr.call(arguments,1)):st(n),r=-1,e=t.length;++r<e;){var u=t[r];n[u]=Dt(n[u],n)}return n},_.bindKey=function(n,t){return E(n,t,Sr.call(arguments,2),w)},_.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)}return e},_.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},_.countBy=function(n,t,r){var e={};return t=_.createCallback(t,r),xt(n,function(n,r,u){r=Yt(t(n,r,u)),sr.call(e,r)?e[r]++:e[r]=1
u[t]=[a,n[a]]}return u},a.partial=function(n){return D(n,le.call(arguments,1))},a.partialRight=function(n){return D(n,le.call(arguments,1),null,i)},a.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=Gt.apply(zt,le.call(arguments,1)),i=et(n)?o.length:0;++u<i;){var f=o[u];f in n&&(r[f]=n[f])}else t=a.createCallback(t,e),ke(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},a.pluck=st,a.range=function(n,t,e){n=+n||0,e=+e||1,null==t&&(t=n,n=0);var r=-1;t=ae(0,Ut((t-n)/e));for(var u=It(t);++r<t;)u[r]=n,n+=e; }),e},_.createCallback=function(n,t,r){if(n==d)return Wt;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Rr(n);return function(t){for(var r=u.length,e=b;r--&&(e=vt(t[u[r]],n[u[r]],w)););return e}}return typeof t=="undefined"||F&&!F.test(fr.call(n))?n:1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)}:4===r?function(r,e,u,a){return n.call(t,r,e,u,a)}:function(r,e,u){return n.call(t,r,e,u)}},_.debounce=Rt,_.defaults=Hr,_.defer=Tt,_.delay=function(n,t){var r=Sr.call(arguments,2);
return u},a.reject=function(n,t,e){return t=a.createCallback(t,e),lt(n,function(n,e,r){return!t(n,e,r)})},a.rest=wt,a.shuffle=function(n){var t=-1,e=n?n.length:0,r=It(typeof e=="number"?e:0);return pt(n,function(n){var e=Ht(fe()*(++t+1));r[t]=r[e],r[e]=n}),r},a.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,o=It(typeof u=="number"?u:0);for(t=a.createCallback(t,e),pt(n,function(n,e,u){o[++r]={a:t(n,e,u),b:r,c:n}}),u=o.length,o.sort(T);u--;)o[u]=o[u].c;return o},a.tap=function(n,t){return t(n),n},a.throttle=function(n,t,e){function r(){f=new Nt,i=null,c&&(a=n.apply(o,u)) return mr(function(){n.apply(m,r)},t)},_.difference=Bt,_.filter=wt,_.flatten=Vr,_.forEach=xt,_.forIn=Jr,_.forOwn=Kr,_.functions=st,_.groupBy=function(n,t,r){var e={};return t=_.createCallback(t,r),xt(n,function(n,r,u){r=Yt(t(n,r,u)),(sr.call(e,r)?e[r]:e[r]=[]).push(n)}),e},_.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=d){var a=u;for(t=_.createCallback(t,r);a--&&t(n[a],a,n);)e++}else e=t==d||r?1:t||e;return v(n,0,xr(kr(0,u-e),u))},_.intersection=function(n){for(var e=arguments,u=e.length,a=-1,i=l(),c=-1,f=ot(),p=n?n.length:0,v=[],h=l();++a<u;){var m=e[a];
}var u,a,o,i,f=0,l=!0,c=!0;return!1===e?l=!1:e&&$[typeof e]&&(l="leading"in e?e.leading:l,c="trailing"in e?e.trailing:c),function(){var e=new Nt;!i&&!l&&(f=e);var c=t-(e-f);return u=arguments,o=this,0<c?i||(i=Yt(r,c)):(Vt(i),i=null,f=e,a=n.apply(o,u)),a}},a.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=It(n);for(t=a.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},a.toArray=function(n){return n&&typeof n.length=="number"?ve.unindexedChars&&ut(n)?n.split(""):H(n):ot(n)},a.union=function(n){return Z(n)||(arguments[0]=n?le.call(n):zt),jt(Gt.apply(zt,arguments)) i[a]=f===t&&(m?m.length:0)>=O&&o(a?e[a]:h)}n:for(;++c<p;){var y=i[0],m=n[c];if(0>(y?r(y,m):f(h,m))){for(a=u,(y||h).push(m);--a;)if(y=i[a],0>(y?r(y,m):f(e[a],m)))continue n;v.push(m)}}for(;u--;)(y=i[u])&&g(y);return s(i),s(h),v},_.invert=gt,_.invoke=function(n,t){var r=Sr.call(arguments,2),e=-1,u=typeof t=="function",a=n?n.length:0,o=Ht(typeof a=="number"?a:0);return xt(n,function(n){o[++e]=(u?t:n[t]).apply(n,r)}),o},_.keys=Rr,_.map=Ot,_.max=Et,_.memoize=function(n,t){function r(){var e=r.cache,u=x+(t?t.apply(this,arguments):arguments[0]);
},a.uniq=jt,a.unzip=function(n){for(var t=-1,e=n?n.length:0,r=e?vt(st(n,"length")):0,u=It(r);++t<e;)for(var a=-1,o=n[t];++a<r;)(u[a]||(u[a]=It(e)))[t]=o[a];return u},a.values=ot,a.where=lt,a.without=function(n){return mt(n,le.call(arguments,1))},a.wrap=function(n,t){return function(){var e=[n];return Wt.apply(e,arguments),t.apply(this,e)}},a.zip=function(n){for(var t=-1,e=n?vt(st(arguments,"length")):0,r=It(e);++t<e;)r[t]=st(arguments,t);return r},a.zipObject=kt,a.collect=st,a.drop=wt,a.each=pt,a.extend=Ce,a.methods=X,a.object=kt,a.select=lt,a.tail=wt,a.unique=jt,St(a),a.clone=W,a.cloneDeep=function(n,t,e){return W(n,!0,t,e) return sr.call(e,u)?e[u]:e[u]=n.apply(this,arguments)}return r.cache={},r},_.merge=bt,_.min=function(n,t,r){var e=1/0,a=e;if(!t&&qr(n)){r=-1;for(var o=n.length;++r<o;){var i=n[r];i<a&&(a=i)}}else t=!t&&dt(n)?u:_.createCallback(t,r),Tr(n,function(n,r,u){r=t(n,r,u),r<e&&(e=r,a=n)});return a},_.omit=function(n,t,r){var e=ot(),u=typeof t=="function",a={};if(u)t=_.createCallback(t,r);else var o=lr.apply(nr,Sr.call(arguments,1));return Jr(n,function(n,r,i){(u?!t(n,r,i):0>e(o,r))&&(a[r]=n)}),a},_.once=function(n){var t,r;
},a.contains=it,a.escape=function(n){return null==n?"":Tt(n).replace(b,K)},a.every=ft,a.find=ct,a.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=a.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},a.findKey=function(n,t,e){var r;return t=a.createCallback(t,e),xe(n,function(n,e,u){return t(n,e,u)?(r=e,!1):void 0}),r},a.has=function(n,t){return n?Qt.call(n,t):!1},a.identity=Et,a.indexOf=_t,a.isArguments=Q,a.isArray=Z,a.isBoolean=function(n){return!0===n||!1===n||Zt.call(n)==x},a.isDate=function(n){return n instanceof Nt||Zt.call(n)==O return function(){return t?r:(t=y,r=n.apply(this,arguments),n=d,r)}},_.pairs=function(n){for(var t=-1,r=Rr(n),e=r.length,u=Ht(e);++t<e;){var a=r[t];u[t]=[a,n[a]]}return u},_.partial=function(n){return E(n,Sr.call(arguments,1))},_.partialRight=function(n){return E(n,Sr.call(arguments,1),d,w)},_.pick=function(n,t,r){var e={};if(typeof t!="function")for(var u=-1,a=lr.apply(nr,Sr.call(arguments,1)),o=mt(n)?a.length:0;++u<o;){var i=a[u];i in n&&(e[i]=n[i])}else t=_.createCallback(t,r),Jr(n,function(n,r,u){t(n,r,u)&&(e[r]=n)
},a.isElement=function(n){return n?1===n.nodeType:!1},a.isEmpty=function(n){var t=!0;if(!n)return t;var e=Zt.call(n),r=n.length;return e==k||e==P||(ve.argsClass?e==j:Q(n))||e==A&&typeof r=="number"&&tt(n.splice)?!r:(xe(n,function(){return t=!1}),t)},a.isEqual=nt,a.isFinite=function(n){return ee(n)&&!re(parseFloat(n))},a.isFunction=tt,a.isNaN=function(n){return rt(n)&&n!=+n},a.isNull=function(n){return null===n},a.isNumber=rt,a.isObject=et,a.isPlainObject=Oe,a.isRegExp=function(n){return n instanceof Rt||Zt.call(n)==I });return e},_.pluck=Ur,_.range=function(n,t,r){n=+n||0,r=+r||1,t==d&&(t=n,n=0);var e=-1;t=kr(0,or((t-n)/r));for(var u=Ht(t);++e<t;)u[e]=n,n+=r;return u},_.reject=function(n,t,r){return t=_.createCallback(t,r),wt(n,function(n,r,e){return!t(n,r,e)})},_.rest=zt,_.shuffle=function(n){var t=-1,r=n?n.length:0,e=Ht(typeof r=="number"?r:0);return xt(n,function(n){var r=cr(Er()*(++t+1));e[t]=e[r],e[r]=n}),e},_.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,o=Ht(typeof u=="number"?u:0);for(t=_.createCallback(t,r),xt(n,function(n,r,u){var a=o[++e]=c();
},a.isString=ut,a.isUndefined=function(n){return typeof n=="undefined"},a.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?ae(0,r+e):oe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},a.mixin=St,a.noConflict=function(){return r._=Kt,this},a.parseInt=Ee,a.random=function(n,t){return null==n&&null==t&&(t=1),n=+n||0,null==t&&(t=n,n=0),n+Ht(fe()*((+t||0)-n+1))},a.reduce=gt,a.reduceRight=ht,a.result=function(n,t){var r=n?n[t]:e;return tt(r)?n[t]():r},a.runInContext=t,a.size=function(n){var t=n?n.length:0; a.l=t(n,r,u),a.m=e,a.n=n}),u=o.length,o.sort(a);u--;)n=o[u],o[u]=n.n,g(n);return o},_.tap=function(n,t){return t(n),n},_.throttle=function(n,t,r){var e=y,u=y;return r===false?e=b:mt(r)&&(e="leading"in r?r.leading:e,u="trailing"in r?r.trailing:u),r=c(),r.leading=e,r.maxWait=t,r.trailing=u,n=Rt(n,t,r),g(r),n},_.times=function(n,t,r){n=-1<(n=+n)?n:0;var e=-1,u=Ht(n);for(t=_.createCallback(t,r,1);++e<n;)u[e]=t(e);return u},_.toArray=function(n){return n&&typeof n.length=="number"?Pr.unindexedChars&&dt(n)?n.split(""):v(n):_t(n)
return typeof t=="number"?t:de(n).length},a.some=yt,a.sortedIndex=Ct,a.template=function(n,t,r){var u=a.templateSettings;n||(n=""),r=je({},r,u);var o,i=je({},r.imports,u.imports),u=de(i),i=ot(i),f=0,l=r.interpolate||d,v="__p+='",l=Rt((r.escape||d).source+"|"+l.source+"|"+(l===y?g:d).source+"|"+(r.evaluate||d).source+"|$","g");n.replace(l,function(t,e,r,u,a,i){return r||(r=u),v+=n.slice(f,i).replace(_,L),e&&(v+="'+__e("+e+")+'"),a&&(o=!0,v+="';"+a+";__p+='"),r&&(v+="'+((__t=("+r+"))==null?'':__t)+'"),f=i+t.length,t },_.transform=function(n,t,r,e){var u=qr(n);return t=_.createCallback(t,e,4),r==d&&(u?r=[]:(e=n&&n.constructor,r=rt(e&&e.prototype))),(u?Tr:Kr)(n,function(n,e,u){return t(r,n,e,u)}),r},_.union=function(n){return qr(n)||(arguments[0]=n?Sr.call(n):nr),Qr(lr.apply(nr,arguments))},_.uniq=Qr,_.unzip=$t,_.values=_t,_.where=wt,_.without=function(n){return Bt(n,Sr.call(arguments,1))},_.wrap=function(n,t){return function(){var r=[n];return gr.apply(r,arguments),t.apply(this,r)}},_.zip=function(n){return n?$t(arguments):[]
}),v+="';\n",l=r=r.variable,l||(r="obj",v="with("+r+"){"+v+"}"),v=(o?v.replace(c,""):v).replace(p,"$1").replace(s,"$1;"),v="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+v+"return __p}";try{var h=$t(u,"return "+v).apply(e,i)}catch(m){throw m.source=v,m}return t?h(t):(h.source=v,h)},a.unescape=function(n){return null==n?"":Tt(n).replace(v,J)},a.uniqueId=function(n){var t=++o;return Tt(null==n?"":n)+t },_.zipObject=qt,_.collect=Ot,_.drop=zt,_.each=xt,_.extend=Gr,_.methods=st,_.object=qt,_.select=wt,_.tail=zt,_.unique=Qr,Lt(_),_.chain=_,_.prototype.chain=function(){return this},_.clone=pt,_.cloneDeep=function(n,t,r){return pt(n,y,t,r)},_.contains=Ct,_.escape=function(n){return n==d?"":Yt(n).replace(R,ut)},_.every=jt,_.find=kt,_.findIndex=function(n,t,r){var e=-1,u=n?n.length:0;for(t=_.createCallback(t,r);++e<u;)if(t(n[e],e,n))return e;return-1},_.findKey=function(n,t,r){var e;return t=_.createCallback(t,r),Kr(n,function(n,r,u){return t(n,r,u)?(e=r,b):void 0
},a.all=ft,a.any=yt,a.detect=ct,a.foldl=gt,a.foldr=ht,a.include=it,a.inject=gt,xe(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(){var t=[this.__wrapped__];return Wt.apply(t,arguments),n.apply(a,t)})}),a.first=dt,a.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&null!=t){var o=u;for(t=a.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n[u-1];return H(n,ae(0,u-r))}},a.take=dt,a.head=dt,xe(a,function(n,t){a.prototype[t]||(a.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e); }),e},_.has=function(n,t){return n?sr.call(n,t):b},_.identity=Wt,_.indexOf=Pt,_.isArguments=ft,_.isArray=qr,_.isBoolean=function(n){return n===y||n===false||yr.call(n)==J},_.isDate=function(n){return n?typeof n=="object"&&yr.call(n)==K:b},_.isElement=function(n){return n?1===n.nodeType:b},_.isEmpty=function(n){var t=y;if(!n)return t;var r=yr.call(n),e=n.length;return r==H||r==Y||(Pr.argsClass?r==G:ft(n))||r==Q&&typeof e=="number"&&ht(n.splice)?!e:(Kr(n,function(){return t=b}),t)},_.isEqual=vt,_.isFinite=function(n){return Cr(n)&&!jr(parseFloat(n))
return null==t||e&&typeof t!="function"?r:new U(r)})}),a.VERSION="1.2.0",a.prototype.toString=function(){return Tt(this.__wrapped__)},a.prototype.value=At,a.prototype.valueOf=At,be(["join","pop","shift"],function(n){var t=zt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),be(["push","reverse","sort","unshift"],function(n){var t=zt[n];a.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),be(["concat","slice","splice"],function(n){var t=zt[n];a.prototype[n]=function(){return new U(t.apply(this.__wrapped__,arguments)) },_.isFunction=ht,_.isNaN=function(n){return yt(n)&&n!=+n},_.isNull=function(n){return n===d},_.isNumber=yt,_.isObject=mt,_.isPlainObject=Mr,_.isRegExp=function(n){return!(!n||!nt[typeof n])&&yr.call(n)==X},_.isString=dt,_.isUndefined=function(n){return typeof n=="undefined"},_.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?kr(0,e+r):xr(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},_.mixin=Lt,_.noConflict=function(){return e._=ur,this},_.parseInt=Xr,_.random=function(n,t){n==d&&t==d&&(t=1),n=+n||0,t==d?(t=n,n=0):t=+t||0;
}}),ve.spliceObjects||be(["pop","shift","splice"],function(n){var t=zt[n],e="splice"==n;a.prototype[n]=function(){var n=this.__wrapped__,r=t.apply(n,arguments);return 0===n.length&&delete n[0],e?new U(r):r}}),a}var e,r=typeof exports=="object"&&exports,u=typeof module=="object"&&module&&module.exports==r&&module,a=typeof global=="object"&&global;(a.global===a||a.window===a)&&(n=a);var o=0,i={},f=+new Date+"",l=200,c=/\b__p\+='';/g,p=/\b(__p\+=)''\+/g,s=/(__e\(.*?\)|\b__t\))\+'';/g,v=/&(?:amp|lt|gt|quot|#39);/g,g=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,h=/\w*$/,y=/<%=([\s\S]+?)%>/g,m=/^0+(?=.$)/,d=/($^)/,b=/[&<>"']/g,_=/['\n\r\t\u2028\u2029\\]/g,w="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),C="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),j="[object Arguments]",k="[object Array]",x="[object Boolean]",O="[object Date]",E="[object Function]",S="[object Number]",A="[object Object]",I="[object RegExp]",P="[object String]",N={}; var r=Er();return n%1||t%1?n+xr(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+cr(r*(t-n+1))},_.reduce=St,_.reduceRight=At,_.result=function(n,t){var r=n?n[t]:m;return ht(r)?n[t]():r},_.runInContext=h,_.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Rr(n).length},_.some=It,_.sortedIndex=Ft,_.template=function(n,t,r){var e=_.templateSettings;n||(n=""),r=Hr({},r,e);var u,a=Hr({},r.imports,e.imports),e=Rr(a),a=_t(a),o=0,l=r.interpolate||D,c="__p+='",l=Xt((r.escape||D).source+"|"+l.source+"|"+(l===z?N:D).source+"|"+(r.evaluate||D).source+"|$","g");
N[E]=!1,N[j]=N[k]=N[x]=N[O]=N[S]=N[A]=N[I]=N[P]=!0;var $={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},q={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},B=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=B,define(function(){return B})):r&&!r.nodeType?u?(u.exports=B)._=B:r._=B:n._=B})(this); n.replace(l,function(t,r,e,a,l,f){return e||(e=a),c+=n.slice(o,f).replace(T,i),r&&(c+="'+__e("+r+")+'"),l&&(u=y,c+="';"+l+";__p+='"),e&&(c+="'+((__t=("+e+"))==null?'':__t)+'"),o=f+t.length,t}),c+="';\n",l=r=r.variable,l||(r="obj",c="with("+r+"){"+c+"}"),c=(u?c.replace(S,""):c).replace(A,"$1").replace(I,"$1;"),c="function("+r+"){"+(l?"":r+"||("+r+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+c+"return __p}";try{var f=Mt(e,"return "+c).apply(m,a)
}catch(p){throw p.source=c,p}return t?f(t):(f.source=c,f)},_.unescape=function(n){return n==d?"":Yt(n).replace(B,ct)},_.uniqueId=function(n){var t=++j;return Yt(n==d?"":n)+t},_.all=jt,_.any=It,_.detect=kt,_.findWhere=kt,_.foldl=St,_.foldr=At,_.include=Ct,_.inject=St,Kr(_,function(n,t){_.prototype[t]||(_.prototype[t]=function(){var t=[this.__wrapped__];return gr.apply(t,arguments),n.apply(_,t)})}),_.first=Nt,_.last=function(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=d){var a=u;for(t=_.createCallback(t,r);a--&&t(n[a],a,n);)e++
}else if(e=t,e==d||r)return n[u-1];return v(n,kr(0,u-e))}},_.take=Nt,_.head=Nt,Kr(_,function(n,t){_.prototype[t]||(_.prototype[t]=function(t,r){var e=n(this.__wrapped__,t,r);return t==d||r&&typeof t!="function"?e:new C(e)})}),_.VERSION="1.3.1",_.prototype.toString=function(){return Yt(this.__wrapped__)},_.prototype.value=Gt,_.prototype.valueOf=Gt,Tr(["join","pop","shift"],function(n){var t=nr[n];_.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),Tr(["push","reverse","sort","unshift"],function(n){var t=nr[n];
_.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Tr(["concat","slice","splice"],function(n){var t=nr[n];_.prototype[n]=function(){return new C(t.apply(this.__wrapped__,arguments))}}),Pr.spliceObjects||Tr(["pop","shift","splice"],function(n){var t=nr[n],r="splice"==n;_.prototype[n]=function(){var n=this.__wrapped__,e=t.apply(n,arguments);return 0===n.length&&delete n[0],r?new C(e):e}}),_}var m,y=!0,d=null,b=!1,_=[],C=[],j=0,w={},x=+new Date+"",O=75,E=40,S=/\b__p\+='';/g,A=/\b(__p\+=)''\+/g,I=/(__e\(.*?\)|\b__t\))\+'';/g,B=/&(?:amp|lt|gt|quot|#39);/g,N=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,P=/\w*$/,z=/<%=([\s\S]+?)%>/g,F=(F=/\bthis\b/)&&F.test(h)&&F,$=" \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",q=RegExp("^["+$+"]*0+(?=.$)"),D=/($^)/,R=/[&<>"']/g,T=/['\n\r\t\u2028\u2029\\]/g,W="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),L="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),G="[object Arguments]",H="[object Array]",J="[object Boolean]",K="[object Date]",M="[object Error]",U="[object Function]",V="[object Number]",Q="[object Object]",X="[object RegExp]",Y="[object String]",Z={};
Z[U]=b,Z[G]=Z[H]=Z[J]=Z[K]=Z[V]=Z[Q]=Z[X]=Z[Y]=y;var nt={"boolean":b,"function":y,object:y,number:b,string:b,undefined:b},tt={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},rt=nt[typeof exports]&&exports,et=nt[typeof module]&&module&&module.exports==rt&&module,ut=nt[typeof global]&&global;!ut||ut.global!==ut&&ut.window!==ut||(n=ut);var at=h();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=at, define(function(){return at})):rt&&!rt.nodeType?et?(et.exports=at)._=at:rt._=at:n._=at
}(this);

1131
dist/lodash.js vendored

File diff suppressed because it is too large Load Diff

82
dist/lodash.min.js vendored
View File

@@ -1,44 +1,48 @@
/** /**
* @license * @license
* Lo-Dash 1.2.0 (Custom Build) lodash.com/license * Lo-Dash 1.3.1 (Custom Build) lodash.com/license
* Build: `lodash modern -o ./dist/lodash.js` * Build: `lodash modern -o ./dist/lodash.js`
* Underscore.js 1.4.4 underscorejs.org/LICENSE * Underscore.js 1.4.4 underscorejs.org/LICENSE
*/ */
;(function(n){function t(o){function f(n){if(!n||ue.call(n)!=S)return a;var t=n.valueOf,e=typeof t=="function"&&(e=Zt(t))&&Zt(e);return e?n==e||Zt(n)==e:X(n)}function q(n,t,e){if(!n||!F[typeof n])return n;t=t&&typeof e=="undefined"?t:M.createCallback(t,e);for(var r=-1,u=F[typeof n]?me(n):[],o=u.length;++r<o&&(e=u[r],!(t(n[e],e,n)===a)););return n}function D(n,t,e){var r;if(!n||!F[typeof n])return n;t=t&&typeof e=="undefined"?t:M.createCallback(t,e);for(r in n)if(t(n[r],r,n)===a)break;return n}function z(n,t,e){var r,u=n,a=u; ;!function(n){function t(n,t,e){e=(e||0)-1;for(var r=n.length;++e<r;)if(n[e]===t)return e;return-1}function e(n,e){var r=typeof e;if(n=n.k,"boolean"==r||e==h)return n[e];"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:j+e;return n=n[r]||(n[r]={}),"object"==r?n[u]&&-1<t(n[u],e)?0:-1:n[u]?0:-1}function r(n){var t=this.k,e=typeof n;if("boolean"==e||n==h)t[n]=y;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:j+n,u=t[e]||(t[e]={});"object"==e?(u[r]||(u[r]=[])).push(n)==this.b.length&&(t[e]=b):u[r]=y
if(!u)return a;for(var o=arguments,i=0,f=typeof e=="number"?2:o.length;++i<f;)if((u=o[i])&&F[typeof u]){var c=u.length;if(r=-1,rt(u))for(;++r<c;)"undefined"==typeof a[r]&&(a[r]=u[r]);else for(var l=-1,p=F[typeof u]?me(u):[],c=p.length;++l<c;)r=p[l],"undefined"==typeof a[r]&&(a[r]=u[r])}return a}function P(n,t,e){var r,u=n,a=u;if(!u)return a;var o=arguments,i=0,f=typeof e=="number"?2:o.length;if(3<f&&"function"==typeof o[f-2])var c=M.createCallback(o[--f-1],o[f--],2);else 2<f&&"function"==typeof o[f-1]&&(c=o[--f]); }}function u(n){return n.charCodeAt(0)}function a(n,t){var e=n.m,r=t.m;if(n=n.l,t=t.l,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return e<r?-1:1}function o(n){var t=-1,e=n.length,u=l();u["false"]=u["null"]=u["true"]=u.undefined=b;var a=l();for(a.b=n,a.k=u,a.push=r;++t<e;)a.push(n[t]);return u.object===false?(p(a),h):a}function i(n){return"\\"+Q[n]}function f(){return m.pop()||[]}function l(){return d.pop()||{b:h,k:h,l:h,"false":b,m:0,leading:b,maxWait:0,"null":b,number:h,object:h,push:h,string:h,trailing:b,"true":b,undefined:b,n:h}
for(;++i<f;)if((u=o[i])&&F[typeof u]){var l=u.length;if(r=-1,rt(u))for(;++r<l;)a[r]=c?c(a[r],u[r]):u[r];else for(var p=-1,s=F[typeof u]?me(u):[],l=s.length;++p<l;)r=s[p],a[r]=c?c(a[r],u[r]):u[r]}return a}function K(n){var t,e=[];if(!n||!F[typeof n])return e;for(t in n)ne.call(n,t)&&e.push(t);return e}function M(n){return n&&typeof n=="object"&&!rt(n)&&ne.call(n,"__wrapped__")?n:new Q(n)}function U(n){var t=n.length,e=t>=s;if(e)for(var r={},u=-1;++u<t;){var a=p+n[u];(r[a]||(r[a]=[])).push(n[u])}return function(t){if(e){var u=p+t; }function c(n){n.length=0,m.length<C&&m.push(n)}function p(n){var t=n.k;t&&p(t),n.b=n.k=n.l=n.object=n.number=n.string=n.n=h,d.length<C&&d.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 v(r){function m(n){if(!n||ve.call(n)!=V)return b;var t=n.valueOf,e=typeof t=="function"&&(e=fe(t))&&fe(e);return e?n==e||fe(n)==e:it(n)}function d(n,t,e){if(!n||!L[typeof n])return n;t=t&&typeof e=="undefined"?t:tt.createCallback(t,e);
return r[u]&&-1<xt(r[u],t)}return-1<xt(n,t)}}function V(n){return n.charCodeAt(0)}function G(n,t){var e=n.b,r=t.b;if(n=n.a,t=t.a,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return e<r?-1:1}function H(n,t,e,r){function a(){var r=arguments,l=i?this:t;return o||(n=t[f]),e.length&&(r=r.length?(r=ge.call(r),c?r.concat(e):e.concat(r)):e),this instanceof a?(W.prototype=n.prototype,l=new W,W.prototype=u,r=n.apply(l,r),ot(r)?r:l):n.apply(l,r)}var o=at(n),i=!e,f=t;if(i){var c=r; for(var r=-1,u=L[typeof n]&&Se(n),a=u?u.length:0;++r<a&&(e=u[r],!(t(n[e],e,n)===false)););return n}function C(n,t,e){var r;if(!n||!L[typeof n])return n;t=t&&typeof e=="undefined"?t:tt.createCallback(t,e);for(r in n)if(t(n[r],r,n)===false)break;return n}function Q(n,t,e){var r,u=n,a=u;if(!u)return a;for(var o=arguments,i=0,f=typeof e=="number"?2:o.length;++i<f;)if((u=o[i])&&L[typeof u])for(var l=-1,c=L[typeof u]&&Se(u),p=c?c.length:0;++l<p;)r=c[l],"undefined"==typeof a[r]&&(a[r]=u[r]);return a}function X(n,t,e){var r,u=n,a=u;
e=t}else if(!o){if(!r)throw new Vt;t=n}return a}function J(n){return"\\"+R[n]}function L(n){return be[n]}function Q(n){this.__wrapped__=n}function W(){}function X(n){var t=a;if(!n||ue.call(n)!=S)return t;var e=n.constructor;return(at(e)?e instanceof e:he.nodeClass||!isNode(n))?(D(n,function(n,e){t=e}),t===a||ne.call(n,t)):t}function Y(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Rt(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function Z(n){return de[n]}function nt(n,t,r,u,o,i){var f=n; if(!u)return a;var o=arguments,i=0,f=typeof e=="number"?2:o.length;if(3<f&&"function"==typeof o[f-2])var l=tt.createCallback(o[--f-1],o[f--],2);else 2<f&&"function"==typeof o[f-1]&&(l=o[--f]);for(;++i<f;)if((u=o[i])&&L[typeof u])for(var c=-1,p=L[typeof u]&&Se(u),s=p?p.length:0;++c<s;)r=p[c],a[r]=l?l(a[r],u[r]):u[r];return a}function Z(n){var t,e=[];if(!n||!L[typeof n])return e;for(t in n)le.call(n,t)&&e.push(t);return e}function tt(n){return n&&typeof n=="object"&&!Ee(n)&&le.call(n,"__wrapped__")?n:new et(n)
if(typeof t=="function"&&(u=r,r=t,t=a),typeof r=="function"){if(r=typeof u=="undefined"?r:M.createCallback(r,u,1),f=r(f),typeof f!="undefined")return f;f=n}if(u=ot(f)){var c=ue.call(f);if(!B[c])return f;var l=rt(f)}if(!u||!t)return u?l?Y(f):P({},f):f;switch(u=ye[c],c){case N:case E:return new u(+f);case I:case $:return new u(f);case A:return u(f.source,b.exec(f))}for(o||(o=[]),i||(i=[]),c=o.length;c--;)if(o[c]==n)return i[c];return f=l?u(f.length):{},l&&(ne.call(n,"index")&&(f.index=n.index),ne.call(n,"input")&&(f.input=n.input)),o.push(n),i.push(f),(l?yt:q)(n,function(n,u){f[u]=nt(n,t,r,e,o,i) }function et(n){this.__wrapped__=n}function rt(n,t,e,r){function u(){var r=arguments,l=o?this:t;return a||(n=t[i]),e.length&&(r=r.length?(r=Ce.call(r),f?r.concat(e):e.concat(r)):e),this instanceof u?(l=gt(n.prototype)?ye(n.prototype):{},r=n.apply(l,r),gt(r)?r:l):n.apply(l,r)}var a=vt(n),o=!e,i=t;if(o){var f=r;e=t}else if(!a){if(!r)throw new Yt;t=n}return u}function ut(n){return Ie[n]}function at(){var n=(n=tt.indexOf)===$t?t:n;return n}function ot(n){return function(t,e,r,u){return typeof e!="boolean"&&e!=h&&(u=r,r=u&&u[e]===t?g:e,e=b),r!=h&&(r=tt.createCallback(r,u)),n(t,e,r,u)
}),f}function tt(n){var t=[];return D(n,function(n,e){at(n)&&t.push(e)}),t.sort()}function et(n){for(var t=-1,e=me(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function rt(n){return n instanceof Rt||oe(n)}function ut(n,t,e,o,i,f){var c=e===l;if(typeof e=="function"&&!c){e=M.createCallback(e,o,2);var p=e(n,t);if(typeof p!="undefined")return!!p}if(n===t)return 0!==n||1/n==1/t;var s=typeof n,v=typeof t;if(n===n&&(!n||"function"!=s&&"object"!=s)&&(!t||"function"!=v&&"object"!=v))return a; }}function it(n){var t,e;return n&&ve.call(n)==V&&(t=n.constructor,!vt(t)||t instanceof t)?(C(n,function(n,t){e=t}),e===g||le.call(n,e)):b}function ft(n){return Ae[n]}function lt(n,t,e,r,u,a){var o=n;if(typeof t!="boolean"&&t!=h&&(r=e,e=t,t=b),typeof e=="function"){if(e=typeof r=="undefined"?e:tt.createCallback(e,r,1),o=e(o),typeof o!="undefined")return o;o=n}if(r=gt(o)){var i=ve.call(o);if(!J[i])return o;var l=Ee(o)}if(!r||!t)return r?l?s(o):X({},o):o;switch(r=xe[i],i){case P:case K:return new r(+o);
if(n==u||t==u)return n===t;if(v=ue.call(n),s=ue.call(t),v==x&&(v=S),s==x&&(s=S),v!=s)return a;switch(v){case N:case E:return+n==+t;case I:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case A:case $:return n==Ut(t)}if(s=v==O,!s){if(ne.call(n,"__wrapped__")||ne.call(t,"__wrapped__"))return ut(n.__wrapped__||n,t.__wrapped__||t,e,o,i,f);if(v!=S)return a;var v=n.constructor,g=t.constructor;if(v!=g&&(!at(v)||!(v instanceof v&&at(g)&&g instanceof g)))return a}for(i||(i=[]),f||(f=[]),v=i.length;v--;)if(i[v]==n)return f[v]==t; case U:case H:return new r(o);case G:return r(o.source,A.exec(o))}i=!u,u||(u=f()),a||(a=f());for(var p=u.length;p--;)if(u[p]==n)return a[p];return o=l?r(o.length):{},l&&(le.call(n,"index")&&(o.index=n.index),le.call(n,"input")&&(o.input=n.input)),u.push(n),a.push(o),(l?wt:d)(n,function(n,r){o[r]=lt(n,t,e,g,u,a)}),i&&(c(u),c(a)),o}function ct(n){var t=[];return C(n,function(n,e){vt(n)&&t.push(e)}),t.sort()}function pt(n){for(var t=-1,e=Se(n),r=e.length,u={};++t<r;){var a=e[t];u[n[a]]=a}return u}function st(n,t,e,r,u,a){var o=e===k;
var y=0,p=r;if(i.push(n),f.push(t),s){if(v=n.length,y=t.length,p=y==n.length,!p&&!c)return p;for(;y--;)if(s=v,g=t[y],c)for(;s--&&!(p=ut(n[s],g,e,o,i,f)););else if(!(p=ut(n[y],g,e,o,i,f)))break;return p}return D(t,function(t,r,u){return ne.call(u,r)?(y++,p=ne.call(n,r)&&ut(n[r],t,e,o,i,f)):void 0}),p&&!c&&D(n,function(n,t,e){return ne.call(e,t)?p=-1<--y:void 0}),p}function at(n){return typeof n=="function"}function ot(n){return n?F[typeof n]:a}function it(n){return typeof n=="number"||ue.call(n)==I}function ft(n){return typeof n=="string"||ue.call(n)==$ if(typeof e=="function"&&!o){e=tt.createCallback(e,r,2);var i=e(n,t);if(typeof i!="undefined")return!!i}if(n===t)return 0!==n||1/n==1/t;var l=typeof n,p=typeof t;if(n===n&&(!n||"function"!=l&&"object"!=l)&&(!t||"function"!=p&&"object"!=p))return b;if(n==h||t==h)return n===t;if(p=ve.call(n),l=ve.call(t),p==z&&(p=V),l==z&&(l=V),p!=l)return b;switch(p){case P:case K:return+n==+t;case U:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case G:case H:return n==Xt(t)}if(l=p==W,!l){if(le.call(n,"__wrapped__")||le.call(t,"__wrapped__"))return st(n.__wrapped__||n,t.__wrapped__||t,e,r,u,a);
}function ct(n,t,e){var r=arguments,u=0,a=2;if(!ot(n))return n;if(e===l)var o=r[3],i=r[4],c=r[5];else i=[],c=[],typeof e!="number"&&(a=r.length),3<a&&"function"==typeof r[a-2]?o=M.createCallback(r[--a-1],r[a--],2):2<a&&"function"==typeof r[a-1]&&(o=r[--a]);for(;++u<a;)(rt(r[u])?yt:q)(r[u],function(t,e){var r,u,a=t,p=n[e];if(t&&((u=rt(t))||f(t))){for(a=i.length;a--;)if(r=i[a]==t){p=c[a];break}if(!r){var s;o&&(a=o(p,t),s=typeof a!="undefined")&&(p=a),s||(p=u?rt(p)?p:[]:f(p)?p:{}),i.push(t),c.push(p),s||(p=ct(p,t,l,o,i,c)) if(p!=V)return b;var p=n.constructor,s=t.constructor;if(p!=s&&(!vt(p)||!(p instanceof p&&vt(s)&&s instanceof s)))return b}for(s=!u,u||(u=f()),a||(a=f()),p=u.length;p--;)if(u[p]==n)return a[p]==t;var v=0,i=y;if(u.push(n),a.push(t),l){if(p=n.length,v=t.length,i=v==n.length,!i&&!o)return i;for(;v--;)if(l=p,s=t[v],o)for(;l--&&!(i=st(n[l],s,e,r,u,a)););else if(!(i=st(n[v],s,e,r,u,a)))break;return i}return C(t,function(t,o,f){return le.call(f,o)?(v++,i=le.call(n,o)&&st(n[o],t,e,r,u,a)):void 0}),i&&!o&&C(n,function(n,t,e){return le.call(e,t)?i=-1<--v:void 0
}}else o&&(a=o(p,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(p=a);n[e]=p});return n}function lt(n){for(var t=-1,e=me(n),r=e.length,u=Rt(r);++t<r;)u[t]=n[e[t]];return u}function pt(n,t,e){var r=-1,u=n?n.length:0,o=a;return e=(0>e?le(0,u+e):e)||0,typeof u=="number"?o=-1<(ft(n)?n.indexOf(t,e):xt(n,t,e)):q(n,function(n){return++r<e?void 0:!(o=n===t)}),o}function st(n,t,e){var u=r;t=M.createCallback(t,e),e=-1;var a=n?n.length:0;if(typeof a=="number")for(;++e<a&&(u=!!t(n[e],e,n)););else q(n,function(n,e,r){return u=!!t(n,e,r) }),s&&(c(u),c(a)),i}function vt(n){return typeof n=="function"}function gt(n){return!(!n||!L[typeof n])}function yt(n){return typeof n=="number"||ve.call(n)==U}function ht(n){return typeof n=="string"||ve.call(n)==H}function bt(n,t,e){var r=arguments,u=0,a=2;if(!gt(n))return n;if(e===k)var o=r[3],i=r[4],l=r[5];else{var p=y,i=f(),l=f();typeof e!="number"&&(a=r.length),3<a&&"function"==typeof r[a-2]?o=tt.createCallback(r[--a-1],r[a--],2):2<a&&"function"==typeof r[a-1]&&(o=r[--a])}for(;++u<a;)(Ee(r[u])?wt:d)(r[u],function(t,e){var r,u,a=t,f=n[e];
});return u}function vt(n,t,e){var r=[];t=M.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u;){var a=n[e];t(a,e,n)&&r.push(a)}else q(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function gt(n,t,e){t=M.createCallback(t,e),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return q(n,function(n,e,r){return t(n,e,r)?(u=n,a):void 0}),u}for(;++e<r;){var o=n[e];if(t(o,e,n))return o}}function yt(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:M.createCallback(t,e),typeof u=="number")for(;++r<u&&t(n[r],r,n)!==a;);else q(n,t); if(t&&((u=Ee(t))||m(t))){for(a=i.length;a--;)if(r=i[a]==t){f=l[a];break}if(!r){var c;o&&(a=o(f,t),c=typeof a!="undefined")&&(f=a),c||(f=u?Ee(f)?f:[]:m(f)?f:{}),i.push(t),l.push(f),c||(f=bt(f,t,k,o,i,l))}}else o&&(a=o(f,t),typeof a=="undefined"&&(a=t)),typeof a!="undefined"&&(f=a);n[e]=f});return p&&(c(i),c(l)),n}function mt(n){for(var t=-1,e=Se(n),r=e.length,u=Mt(r);++t<r;)u[t]=n[e[t]];return u}function dt(n,t,e){var r=-1,u=at(),a=n?n.length:0,o=b;return e=(0>e?_e(0,a+e):e)||0,a&&typeof a=="number"?o=-1<(ht(n)?n.indexOf(t,e):u(n,t,e)):d(n,function(n){return++r<e?void 0:!(o=n===t)
return n}function ht(n,t,e){var r=-1,u=n?n.length:0;if(t=M.createCallback(t,e),typeof u=="number")for(var a=Rt(u);++r<u;)a[r]=t(n[r],r,n);else a=[],q(n,function(n,e,u){a[++r]=t(n,e,u)});return a}function mt(n,t,e){var r=-1/0,u=r;if(!t&&rt(n)){e=-1;for(var a=n.length;++e<a;){var o=n[e];o>u&&(u=o)}}else t=!t&&ft(n)?V:M.createCallback(t,e),yt(n,function(n,e,a){e=t(n,e,a),e>r&&(r=e,u=n)});return u}function bt(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Rt(r);++e<r;)u[e]=n[e][t];return u||ht(n,t) }),o}function _t(n,t,e){var r=y;t=tt.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&(r=!!t(n[e],e,n)););else d(n,function(n,e,u){return r=!!t(n,e,u)});return r}function kt(n,t,e){var r=[];t=tt.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u;){var a=n[e];t(a,e,n)&&r.push(a)}else d(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function jt(n,t,e){t=tt.createCallback(t,e),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return d(n,function(n,e,r){return t(n,e,r)?(u=n,b):void 0
}function dt(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=M.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 q(n,function(n,r,o){e=u?(u=a,n):t(e,n,r,o)});return e}function _t(n,t,e,r){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=me(n),u=i.length;return t=M.createCallback(t,r,4),yt(n,function(r,f,c){f=i?i[--u]:--u,e=o?(o=a,n[f]):t(e,n[f],f,c)}),e}function kt(n,t,e){var r;t=M.createCallback(t,e),e=-1;var u=n?n.length:0; }),u}for(;++e<r;){var a=n[e];if(t(a,e,n))return a}}function wt(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:tt.createCallback(t,e),typeof u=="number")for(;++r<u&&t(n[r],r,n)!==false;);else d(n,t);return n}function Ct(n,t,e){var r=-1,u=n?n.length:0;if(t=tt.createCallback(t,e),typeof u=="number")for(var a=Mt(u);++r<u;)a[r]=t(n[r],r,n);else a=[],d(n,function(n,e,u){a[++r]=t(n,e,u)});return a}function xt(n,t,e){var r=-1/0,a=r;if(!t&&Ee(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];i>a&&(a=i)
if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else q(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function wt(n){for(var t=-1,e=n?n.length:0,r=Xt.apply(Gt,ge.call(arguments,1)),r=U(r),u=[];++t<e;){var a=n[t];r(a)||u.push(a)}return u}function Ct(n,t,e){if(n){var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=-1;for(t=M.createCallback(t,e);++o<a&&t(n[o],o,n);)r++}else if(r=t,r==u||e)return n[0];return Y(n,0,pe(le(0,r),a))}}function jt(n,t,e,r){var o=-1,i=n?n.length:0,f=[];for(typeof t!="boolean"&&t!=u&&(r=e,e=t,t=a),e!=u&&(e=M.createCallback(e,r));++o<i;)r=n[o],e&&(r=e(r,o,n)),rt(r)?te.apply(f,t?r:jt(r)):f.push(r); }}else t=!t&&ht(n)?u:tt.createCallback(t,e),wt(n,function(n,e,u){e=t(n,e,u),e>r&&(r=e,a=n)});return a}function Ot(n,t){var e=-1,r=n?n.length:0;if(typeof r=="number")for(var u=Mt(r);++e<r;)u[e]=n[e][t];return u||Ct(n,t)}function Et(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=tt.createCallback(t,r,4);var a=-1,o=n.length;if(typeof o=="number")for(u&&(e=n[++a]);++a<o;)e=t(e,n[a],a,n);else d(n,function(n,r,a){e=u?(u=b,n):t(e,n,r,a)});return e}function St(n,t,e,r){var u=n?n.length:0,a=3>arguments.length;
return f}function xt(n,t,e){var r=-1,u=n?n.length:0;if(typeof e=="number")r=(0>e?le(0,u+e):e||0)-1;else if(e)return r=Nt(n,t),n[r]===t?r:-1;for(;++r<u;)if(n[r]===t)return r;return-1}function Ot(n,t,e){if(typeof t!="number"&&t!=u){var r=0,a=-1,o=n?n.length:0;for(t=M.createCallback(t,e);++a<o&&t(n[a],a,n);)r++}else r=t==u||e?1:le(0,t);return Y(n,r)}function Nt(n,t,e,r){var u=0,a=n?n.length:u;for(e=e?M.createCallback(e,r,1):$t,t=e(t);u<a;)r=u+a>>>1,e(n[r])<t?u=r+1:a=r;return u}function Et(n,t,e,r){var o=-1,i=n?n.length:0,f=[],c=f; if(typeof u!="number")var o=Se(n),u=o.length;return t=tt.createCallback(t,r,4),wt(n,function(r,i,f){i=o?o[--u]:--u,e=a?(a=b,n[i]):t(e,n[i],i,f)}),e}function It(n,t,e){var r;t=tt.createCallback(t,e),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else d(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function At(n){var r=-1,u=at(),a=n?n.length:0,i=ae.apply(Zt,Ce.call(arguments,1)),f=[],l=a>=w&&u===t;if(l){var c=o(i);c?(u=e,i=c):l=b}for(;++r<a;)c=n[r],0>u(i,c)&&f.push(c);
typeof t!="boolean"&&t!=u&&(r=e,e=t,t=a);var l=!t&&i>=s;if(l)var v={};for(e!=u&&(c=[],e=M.createCallback(e,r));++o<i;){r=n[o];var g=e?e(r,o,n):r;if(l)var y=p+g,y=v[y]?!(c=v[y]):c=v[y]=[];(t?!o||c[c.length-1]!==g:y||0>xt(c,g))&&((e||l)&&c.push(g),f.push(r))}return f}function It(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:u[a[0]]=a[1]}return u}function St(n,t){return he.fastBind||ae&&2<arguments.length?ae.call.apply(ae,arguments):H(n,t,ge.call(arguments,2))}function At(n){var t=ge.call(arguments,1); return l&&p(i),f}function Nt(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=h){var a=-1;for(t=tt.createCallback(t,e);++a<u&&t(n[a],a,n);)r++}else if(r=t,r==h||e)return n[0];return s(n,0,ke(_e(0,r),u))}}function $t(n,e,r){if(typeof r=="number"){var u=n?n.length:0;r=0>r?_e(0,u+r):r||0}else if(r)return r=Ft(n,e),n[r]===e?r:-1;return n?t(n,e,r):-1}function Bt(n,t,e){if(typeof t!="number"&&t!=h){var r=0,u=-1,a=n?n.length:0;for(t=tt.createCallback(t,e);++u<a&&t(n[u],u,n);)r++}else r=t==h||e?1:_e(0,t);
return re(function(){n.apply(e,t)},1)}function $t(n){return n}function Bt(n){yt(tt(n),function(t){var e=M[t]=n[t];M.prototype[t]=function(){var n=this.__wrapped__,t=[n];return te.apply(t,arguments),t=e.apply(M,t),n&&typeof n=="object"&&n==t?this:new Q(t)}})}function Ft(){return this.__wrapped__}o=o?T.defaults(n.Object(),o,T.pick(n,j)):n;var Rt=o.Array,Tt=o.Boolean,qt=o.Date,Dt=o.Function,zt=o.Math,Pt=o.Number,Kt=o.Object,Mt=o.RegExp,Ut=o.String,Vt=o.TypeError,Gt=Rt(),Ht=Kt(),Jt=o._,Lt=Mt("^"+Ut(Ht.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Qt=zt.ceil,Wt=o.clearTimeout,Xt=Gt.concat,Yt=zt.floor,Zt=Lt.test(Zt=Kt.getPrototypeOf)&&Zt,ne=Ht.hasOwnProperty,te=Gt.push,ee=o.setImmediate,re=o.setTimeout,ue=Ht.toString,ae=Lt.test(ae=ue.bind)&&ae,oe=Lt.test(oe=Rt.isArray)&&oe,ie=o.isFinite,fe=o.isNaN,ce=Lt.test(ce=Kt.keys)&&ce,le=zt.max,pe=zt.min,se=o.parseInt,ve=zt.random,ge=Gt.slice,zt=Lt.test(o.attachEvent),zt=ae&&!/\n|true/.test(ae+zt),ye={}; return s(n,r)}function Ft(n,t,e,r){var u=0,a=n?n.length:u;for(e=e?tt.createCallback(e,r,1):Wt,t=e(t);u<a;)r=u+a>>>1,e(n[r])<t?u=r+1:a=r;return u}function Rt(n){for(var t=-1,e=n?xt(Ot(n,"length")):0,r=Mt(0>e?0:e);++t<e;)r[t]=Ot(n,t);return r}function Tt(n,t){for(var e=-1,r=n?n.length:0,u={};++e<r;){var a=n[e];t?u[a]=t[e]:u[a[0]]=a[1]}return u}function qt(n,t){return Oe.fastBind||ge&&2<arguments.length?ge.call.apply(ge,arguments):rt(n,t,Ce.call(arguments,2))}function Dt(n,t,e){function r(){ue(s),ue(v),l=0,s=v=h
ye[O]=Rt,ye[N]=Tt,ye[E]=qt,ye[S]=Kt,ye[I]=Pt,ye[A]=Mt,ye[$]=Ut;var he=M.support={};he.fastBind=ae&&!zt,M.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:d,variable:"",imports:{_:M}},Q.prototype=M.prototype;var me=ce?function(n){return ot(n)?ce(n):[]}:K,be={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},de=et(be);return zt&&i&&typeof ee=="function"&&(At=St(ee,o)),Tt=8==se("08")?se:function(n,t){return se(ft(n)?n.replace(_,""):n,t||0)},M.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0 }function u(){var t=g&&(!m||1<l);r(),t&&(p!==false&&(c=new Vt),i=n.apply(f,o))}function a(){r(),(g||p!==t)&&(c=new Vt,i=n.apply(f,o))}var o,i,f,l=0,c=0,p=b,s=h,v=h,g=y;if(t=_e(0,t||0),e===y)var m=y,g=b;else gt(e)&&(m=e.leading,p="maxWait"in e&&_e(t,e.maxWait||0),g="trailing"in e?e.trailing:g);return function(){if(o=arguments,f=this,l++,ue(v),p===false)m&&2>l&&(i=n.apply(f,o));else{var e=new Vt;!s&&!m&&(c=e);var r=p-(e-c);0<r?s||(s=se(a,r)):(ue(s),s=h,c=e,i=n.apply(f,o))}return t!==p&&(v=se(u,t)),i}}function zt(n){var t=Ce.call(arguments,1);
}},M.assign=P,M.at=function(n){for(var t=-1,e=Xt.apply(Gt,ge.call(arguments,1)),r=e.length,u=Rt(r);++t<r;)u[t]=n[e[t]];return u},M.bind=St,M.bindAll=function(n){for(var t=1<arguments.length?Xt.apply(Gt,ge.call(arguments,1)):tt(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=St(n[u],n)}return n},M.bindKey=function(n,t){return H(n,t,ge.call(arguments,2),l)},M.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},M.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)]; return se(function(){n.apply(g,t)},1)}function Wt(n){return n}function Pt(n){wt(ct(n),function(t){var e=tt[t]=n[t];tt.prototype[t]=function(){var n=this.__wrapped__,t=[n];return ce.apply(t,arguments),t=e.apply(tt,t),n&&typeof n=="object"&&n===t?this:new et(t)}})}function Kt(){return this.__wrapped__}r=r?nt.defaults(n.Object(),r,nt.pick(n,D)):n;var Mt=r.Array,Ut=r.Boolean,Vt=r.Date,Gt=r.Function,Ht=r.Math,Jt=r.Number,Lt=r.Object,Qt=r.RegExp,Xt=r.String,Yt=r.TypeError,Zt=[],ne=Lt.prototype,te=r._,ee=Qt("^"+Xt(ne.valueOf).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),re=Ht.ceil,ue=r.clearTimeout,ae=Zt.concat,oe=Ht.floor,ie=Gt.prototype.toString,fe=ee.test(fe=Lt.getPrototypeOf)&&fe,le=ne.hasOwnProperty,ce=Zt.push,pe=r.setImmediate,se=r.setTimeout,ve=ne.toString,ge=ee.test(ge=ve.bind)&&ge,ye=ee.test(ye=Lt.create)&&ye,he=ee.test(he=Mt.isArray)&&he,be=r.isFinite,me=r.isNaN,de=ee.test(de=Lt.keys)&&de,_e=Ht.max,ke=Ht.min,je=r.parseInt,we=Ht.random,Ce=Zt.slice,Ht=ee.test(r.attachEvent),Ht=ge&&!/\n|true/.test(ge+Ht),xe={};
return t[0]}},M.countBy=function(n,t,e){var r={};return t=M.createCallback(t,e),yt(n,function(n,e,u){e=Ut(t(n,e,u)),ne.call(r,e)?r[e]++:r[e]=1}),r},M.createCallback=function(n,t,e){if(n==u)return $t;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var o=me(n);return function(t){for(var e=o.length,r=a;e--&&(r=ut(t[o[e]],n[o[e]],l)););return r}}return typeof t!="undefined"?1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)}:4===e?function(e,r,u,a){return n.call(t,e,r,u,a) xe[W]=Mt,xe[P]=Ut,xe[K]=Vt,xe[M]=Gt,xe[V]=Lt,xe[U]=Jt,xe[G]=Qt,xe[H]=Xt,et.prototype=tt.prototype;var Oe=tt.support={};Oe.fastBind=ge&&!Ht,tt.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:tt}};var Ee=he,Se=de?function(n){return gt(n)?de(n):[]}:Z,Ie={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ae=pt(Ie),Ut=ot(function $e(n,t,e){for(var r=-1,u=n?n.length:0,a=[];++r<u;){var o=n[r];e&&(o=e(o,r,n)),Ee(o)?ce.apply(a,t?o:$e(o)):a.push(o)
}:function(e,r,u){return n.call(t,e,r,u)}:n},M.debounce=function(n,t,e){function o(){l=u,p&&(f=n.apply(c,i))}var i,f,c,l,p=r;if(e===r)var s=r,p=a;else e&&F[typeof e]&&(s=e.leading,p="trailing"in e?e.trailing:p);return function(){var e=s&&!l;return i=arguments,c=this,Wt(l),l=re(o,t),e&&(f=n.apply(c,i)),f}},M.defaults=z,M.defer=At,M.delay=function(n,t){var r=ge.call(arguments,2);return re(function(){n.apply(e,r)},t)},M.difference=wt,M.filter=vt,M.flatten=jt,M.forEach=yt,M.forIn=D,M.forOwn=q,M.functions=tt,M.groupBy=function(n,t,e){var r={}; }return a}),Ne=ot(function(n,r,u){var a=-1,i=at(),l=n?n.length:0,s=[],v=!r&&l>=w&&i===t,g=u||v?f():s;if(v){var y=o(g);y?(i=e,g=y):(v=b,g=u?g:(c(g),s))}for(;++a<l;){var y=n[a],h=u?u(y,a,n):y;(r?!a||g[g.length-1]!==h:0>i(g,h))&&((u||v)&&g.push(h),s.push(y))}return v?(c(g.b),p(g)):u&&c(g),s});return Ht&&Y&&typeof pe=="function"&&(zt=qt(pe,r)),pe=8==je(B+"08")?je:function(n,t){return je(ht(n)?n.replace(F,""):n,t||0)},tt.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0
return t=M.createCallback(t,e),yt(n,function(n,e,u){e=Ut(t(n,e,u)),(ne.call(r,e)?r[e]:r[e]=[]).push(n)}),r},M.initial=function(n,t,e){if(!n)return[];var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=a;for(t=M.createCallback(t,e);o--&&t(n[o],o,n);)r++}else r=t==u||e?1:t||r;return Y(n,0,pe(le(0,a-r),a))},M.intersection=function(n){var t=arguments,e=t.length,r={0:{}},u=-1,a=n?n.length:0,o=a>=s,i=[],f=i;n:for(;++u<a;){var c=n[u];if(o)var l=p+c,l=r[0][l]?!(f=r[0][l]):f=r[0][l]=[];if(l||0>xt(f,c)){o&&f.push(c); }},tt.assign=X,tt.at=function(n){for(var t=-1,e=ae.apply(Zt,Ce.call(arguments,1)),r=e.length,u=Mt(r);++t<r;)u[t]=n[e[t]];return u},tt.bind=qt,tt.bindAll=function(n){for(var t=1<arguments.length?ae.apply(Zt,Ce.call(arguments,1)):ct(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=qt(n[u],n)}return n},tt.bindKey=function(n,t){return rt(n,t,Ce.call(arguments,2),k)},tt.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},tt.compose=function(){var n=arguments;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];
for(var v=e;--v;)if(!(r[v]||(r[v]=U(t[v])))(c))continue n;i.push(c)}}return i},M.invert=et,M.invoke=function(n,t){var e=ge.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Rt(typeof a=="number"?a:0);return yt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},M.keys=me,M.map=ht,M.max=mt,M.memoize=function(n,t){var e={};return function(){var r=p+(t?t.apply(this,arguments):arguments[0]);return ne.call(e,r)?e[r]:e[r]=n.apply(this,arguments)}},M.merge=ct,M.min=function(n,t,e){var r=1/0,u=r; return t[0]}},tt.countBy=function(n,t,e){var r={};return t=tt.createCallback(t,e),wt(n,function(n,e,u){e=Xt(t(n,e,u)),le.call(r,e)?r[e]++:r[e]=1}),r},tt.createCallback=function(n,t,e){if(n==h)return Wt;var r=typeof n;if("function"!=r){if("object"!=r)return function(t){return t[n]};var u=Se(n);return function(t){for(var e=u.length,r=b;e--&&(r=st(t[u[e]],n[u[e]],k)););return r}}return typeof t=="undefined"||$&&!$.test(ie.call(n))?n:1===e?function(e){return n.call(t,e)}:2===e?function(e,r){return n.call(t,e,r)
if(!t&&rt(n)){e=-1;for(var a=n.length;++e<a;){var o=n[e];o<u&&(u=o)}}else t=!t&&ft(n)?V:M.createCallback(t,e),yt(n,function(n,e,a){e=t(n,e,a),e<r&&(r=e,u=n)});return u},M.omit=function(n,t,e){var r=typeof t=="function",u={};if(r)t=M.createCallback(t,e);else var a=Xt.apply(Gt,ge.call(arguments,1));return D(n,function(n,e,o){(r?!t(n,e,o):0>xt(a,e))&&(u[e]=n)}),u},M.once=function(n){var t,e;return function(){return t?e:(t=r,e=n.apply(this,arguments),n=u,e)}},M.pairs=function(n){for(var t=-1,e=me(n),r=e.length,u=Rt(r);++t<r;){var a=e[t]; }:4===e?function(e,r,u,a){return n.call(t,e,r,u,a)}:function(e,r,u){return n.call(t,e,r,u)}},tt.debounce=Dt,tt.defaults=Q,tt.defer=zt,tt.delay=function(n,t){var e=Ce.call(arguments,2);return se(function(){n.apply(g,e)},t)},tt.difference=At,tt.filter=kt,tt.flatten=Ut,tt.forEach=wt,tt.forIn=C,tt.forOwn=d,tt.functions=ct,tt.groupBy=function(n,t,e){var r={};return t=tt.createCallback(t,e),wt(n,function(n,e,u){e=Xt(t(n,e,u)),(le.call(r,e)?r[e]:r[e]=[]).push(n)}),r},tt.initial=function(n,t,e){if(!n)return[];
u[t]=[a,n[a]]}return u},M.partial=function(n){return H(n,ge.call(arguments,1))},M.partialRight=function(n){return H(n,ge.call(arguments,1),u,l)},M.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,a=Xt.apply(Gt,ge.call(arguments,1)),o=ot(n)?a.length:0;++u<o;){var i=a[u];i in n&&(r[i]=n[i])}else t=M.createCallback(t,e),D(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},M.pluck=bt,M.range=function(n,t,e){n=+n||0,e=+e||1,t==u&&(t=n,n=0);var r=-1;t=le(0,Qt((t-n)/e));for(var a=Rt(t);++r<t;)a[r]=n,n+=e; var r=0,u=n.length;if(typeof t!="number"&&t!=h){var a=u;for(t=tt.createCallback(t,e);a--&&t(n[a],a,n);)r++}else r=t==h||e?1:t||r;return s(n,0,ke(_e(0,u-r),u))},tt.intersection=function(n){for(var r=arguments,u=r.length,a=-1,i=f(),l=-1,s=at(),v=n?n.length:0,g=[],y=f();++a<u;){var h=r[a];i[a]=s===t&&(h?h.length:0)>=w&&o(a?r[a]:y)}n:for(;++l<v;){var b=i[0],h=n[l];if(0>(b?e(b,h):s(y,h))){for(a=u,(b||y).push(h);--a;)if(b=i[a],0>(b?e(b,h):s(r[a],h)))continue n;g.push(h)}}for(;u--;)(b=i[u])&&p(b);return c(i),c(y),g
return a},M.reject=function(n,t,e){return t=M.createCallback(t,e),vt(n,function(n,e,r){return!t(n,e,r)})},M.rest=Ot,M.shuffle=function(n){var t=-1,e=n?n.length:0,r=Rt(typeof e=="number"?e:0);return yt(n,function(n){var e=Yt(ve()*(++t+1));r[t]=r[e],r[e]=n}),r},M.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,a=Rt(typeof u=="number"?u:0);for(t=M.createCallback(t,e),yt(n,function(n,e,u){a[++r]={a:t(n,e,u),b:r,c:n}}),u=a.length,a.sort(G);u--;)a[u]=a[u].c;return a},M.tap=function(n,t){return t(n),n},M.throttle=function(n,t,e){function o(){p=new qt,l=u,v&&(f=n.apply(c,i)) },tt.invert=pt,tt.invoke=function(n,t){var e=Ce.call(arguments,2),r=-1,u=typeof t=="function",a=n?n.length:0,o=Mt(typeof a=="number"?a:0);return wt(n,function(n){o[++r]=(u?t:n[t]).apply(n,e)}),o},tt.keys=Se,tt.map=Ct,tt.max=xt,tt.memoize=function(n,t){function e(){var r=e.cache,u=j+(t?t.apply(this,arguments):arguments[0]);return le.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}return e.cache={},e},tt.merge=bt,tt.min=function(n,t,e){var r=1/0,a=r;if(!t&&Ee(n)){e=-1;for(var o=n.length;++e<o;){var i=n[e];
}var i,f,c,l,p=0,s=r,v=r;return e===a?s=a:e&&F[typeof e]&&(s="leading"in e?e.leading:s,v="trailing"in e?e.trailing:v),function(){var e=new qt;!l&&!s&&(p=e);var r=t-(e-p);return i=arguments,c=this,0<r?l||(l=re(o,r)):(Wt(l),l=u,p=e,f=n.apply(c,i)),f}},M.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Rt(n);for(t=M.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},M.toArray=function(n){return n&&typeof n.length=="number"?Y(n):lt(n)},M.union=function(n){return rt(n)||(arguments[0]=n?ge.call(n):Gt),Et(Xt.apply(Gt,arguments)) i<a&&(a=i)}}else t=!t&&ht(n)?u:tt.createCallback(t,e),wt(n,function(n,e,u){e=t(n,e,u),e<r&&(r=e,a=n)});return a},tt.omit=function(n,t,e){var r=at(),u=typeof t=="function",a={};if(u)t=tt.createCallback(t,e);else var o=ae.apply(Zt,Ce.call(arguments,1));return C(n,function(n,e,i){(u?!t(n,e,i):0>r(o,e))&&(a[e]=n)}),a},tt.once=function(n){var t,e;return function(){return t?e:(t=y,e=n.apply(this,arguments),n=h,e)}},tt.pairs=function(n){for(var t=-1,e=Se(n),r=e.length,u=Mt(r);++t<r;){var a=e[t];u[t]=[a,n[a]]
},M.uniq=Et,M.unzip=function(n){for(var t=-1,e=n?n.length:0,r=e?mt(bt(n,"length")):0,u=Rt(r);++t<e;)for(var a=-1,o=n[t];++a<r;)(u[a]||(u[a]=Rt(e)))[t]=o[a];return u},M.values=lt,M.where=vt,M.without=function(n){return wt(n,ge.call(arguments,1))},M.wrap=function(n,t){return function(){var e=[n];return te.apply(e,arguments),t.apply(this,e)}},M.zip=function(n){for(var t=-1,e=n?mt(bt(arguments,"length")):0,r=Rt(e);++t<e;)r[t]=bt(arguments,t);return r},M.zipObject=It,M.collect=ht,M.drop=Ot,M.each=yt,M.extend=P,M.methods=tt,M.object=It,M.select=vt,M.tail=Ot,M.unique=Et,Bt(M),M.clone=nt,M.cloneDeep=function(n,t,e){return nt(n,r,t,e) }return u},tt.partial=function(n){return rt(n,Ce.call(arguments,1))},tt.partialRight=function(n){return rt(n,Ce.call(arguments,1),h,k)},tt.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,a=ae.apply(Zt,Ce.call(arguments,1)),o=gt(n)?a.length:0;++u<o;){var i=a[u];i in n&&(r[i]=n[i])}else t=tt.createCallback(t,e),C(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},tt.pluck=Ot,tt.range=function(n,t,e){n=+n||0,e=+e||1,t==h&&(t=n,n=0);var r=-1;t=_e(0,re((t-n)/e));for(var u=Mt(t);++r<t;)u[r]=n,n+=e;
},M.contains=pt,M.escape=function(n){return n==u?"":Ut(n).replace(w,L)},M.every=st,M.find=gt,M.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=M.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},M.findKey=function(n,t,e){var r;return t=M.createCallback(t,e),q(n,function(n,e,u){return t(n,e,u)?(r=e,a):void 0}),r},M.has=function(n,t){return n?ne.call(n,t):a},M.identity=$t,M.indexOf=xt,M.isArguments=function(n){return ue.call(n)==x},M.isArray=rt,M.isBoolean=function(n){return n===r||n===a||ue.call(n)==N return u},tt.reject=function(n,t,e){return t=tt.createCallback(t,e),kt(n,function(n,e,r){return!t(n,e,r)})},tt.rest=Bt,tt.shuffle=function(n){var t=-1,e=n?n.length:0,r=Mt(typeof e=="number"?e:0);return wt(n,function(n){var e=oe(we()*(++t+1));r[t]=r[e],r[e]=n}),r},tt.sortBy=function(n,t,e){var r=-1,u=n?n.length:0,o=Mt(typeof u=="number"?u:0);for(t=tt.createCallback(t,e),wt(n,function(n,e,u){var a=o[++r]=l();a.l=t(n,e,u),a.m=r,a.n=n}),u=o.length,o.sort(a);u--;)n=o[u],o[u]=n.n,p(n);return o},tt.tap=function(n,t){return t(n),n
},M.isDate=function(n){return n instanceof qt||ue.call(n)==E},M.isElement=function(n){return n?1===n.nodeType:a},M.isEmpty=function(n){var t=r;if(!n)return t;var e=ue.call(n),u=n.length;return e==O||e==$||e==x||e==S&&typeof u=="number"&&at(n.splice)?!u:(q(n,function(){return t=a}),t)},M.isEqual=ut,M.isFinite=function(n){return ie(n)&&!fe(parseFloat(n))},M.isFunction=at,M.isNaN=function(n){return it(n)&&n!=+n},M.isNull=function(n){return n===u},M.isNumber=it,M.isObject=ot,M.isPlainObject=f,M.isRegExp=function(n){return n instanceof Mt||ue.call(n)==A },tt.throttle=function(n,t,e){var r=y,u=y;return e===false?r=b:gt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),e=l(),e.leading=r,e.maxWait=t,e.trailing=u,n=Dt(n,t,e),p(e),n},tt.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Mt(n);for(t=tt.createCallback(t,e,1);++r<n;)u[r]=t(r);return u},tt.toArray=function(n){return n&&typeof n.length=="number"?s(n):mt(n)},tt.transform=function(n,t,e,r){var u=Ee(n);return t=tt.createCallback(t,r,4),e==h&&(u?e=[]:(r=n&&n.constructor,e=gt(r&&r.prototype)?ye(r&&r.prototype):{})),(u?wt:d)(n,function(n,r,u){return t(e,n,r,u)
},M.isString=ft,M.isUndefined=function(n){return typeof n=="undefined"},M.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?le(0,r+e):pe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},M.mixin=Bt,M.noConflict=function(){return o._=Jt,this},M.parseInt=Tt,M.random=function(n,t){return n==u&&t==u&&(t=1),n=+n||0,t==u&&(t=n,n=0),n+Yt(ve()*((+t||0)-n+1))},M.reduce=dt,M.reduceRight=_t,M.result=function(n,t){var r=n?n[t]:e;return at(r)?n[t]():r},M.runInContext=t,M.size=function(n){var t=n?n.length:0; }),e},tt.union=function(n){return Ee(n)||(arguments[0]=n?Ce.call(n):Zt),Ne(ae.apply(Zt,arguments))},tt.uniq=Ne,tt.unzip=Rt,tt.values=mt,tt.where=kt,tt.without=function(n){return At(n,Ce.call(arguments,1))},tt.wrap=function(n,t){return function(){var e=[n];return ce.apply(e,arguments),t.apply(this,e)}},tt.zip=function(n){return n?Rt(arguments):[]},tt.zipObject=Tt,tt.collect=Ct,tt.drop=Bt,tt.each=wt,tt.extend=X,tt.methods=ct,tt.object=Tt,tt.select=kt,tt.tail=Bt,tt.unique=Ne,Pt(tt),tt.chain=tt,tt.prototype.chain=function(){return this
return typeof t=="number"?t:me(n).length},M.some=kt,M.sortedIndex=Nt,M.template=function(n,t,u){var a=M.templateSettings;n||(n=""),u=z({},u,a);var o,i=z({},u.imports,a.imports),a=me(i),i=lt(i),f=0,c=u.interpolate||k,l="__p+='",c=Mt((u.escape||k).source+"|"+c.source+"|"+(c===d?m:k).source+"|"+(u.evaluate||k).source+"|$","g");n.replace(c,function(t,e,u,a,i,c){return u||(u=a),l+=n.slice(f,c).replace(C,J),e&&(l+="'+__e("+e+")+'"),i&&(o=r,l+="';"+i+";__p+='"),u&&(l+="'+((__t=("+u+"))==null?'':__t)+'"),f=c+t.length,t },tt.clone=lt,tt.cloneDeep=function(n,t,e){return lt(n,y,t,e)},tt.contains=dt,tt.escape=function(n){return n==h?"":Xt(n).replace(T,ut)},tt.every=_t,tt.find=jt,tt.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=tt.createCallback(t,e);++r<u;)if(t(n[r],r,n))return r;return-1},tt.findKey=function(n,t,e){var r;return t=tt.createCallback(t,e),d(n,function(n,e,u){return t(n,e,u)?(r=e,b):void 0}),r},tt.has=function(n,t){return n?le.call(n,t):b},tt.identity=Wt,tt.indexOf=$t,tt.isArguments=function(n){return ve.call(n)==z
}),l+="';\n",c=u=u.variable,c||(u="obj",l="with("+u+"){"+l+"}"),l=(o?l.replace(v,""):l).replace(g,"$1").replace(y,"$1;"),l="function("+u+"){"+(c?"":u+"||("+u+"={});")+"var __t,__p='',__e=_.escape"+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var p=Dt(a,"return "+l).apply(e,i)}catch(s){throw s.source=l,s}return t?p(t):(p.source=l,p)},M.unescape=function(n){return n==u?"":Ut(n).replace(h,Z)},M.uniqueId=function(n){var t=++c;return Ut(n==u?"":n)+t },tt.isArray=Ee,tt.isBoolean=function(n){return n===y||n===false||ve.call(n)==P},tt.isDate=function(n){return n?typeof n=="object"&&ve.call(n)==K:b},tt.isElement=function(n){return n?1===n.nodeType:b},tt.isEmpty=function(n){var t=y;if(!n)return t;var e=ve.call(n),r=n.length;return e==W||e==H||e==z||e==V&&typeof r=="number"&&vt(n.splice)?!r:(d(n,function(){return t=b}),t)},tt.isEqual=st,tt.isFinite=function(n){return be(n)&&!me(parseFloat(n))},tt.isFunction=vt,tt.isNaN=function(n){return yt(n)&&n!=+n
},M.all=st,M.any=kt,M.detect=gt,M.foldl=dt,M.foldr=_t,M.include=pt,M.inject=dt,q(M,function(n,t){M.prototype[t]||(M.prototype[t]=function(){var t=[this.__wrapped__];return te.apply(t,arguments),n.apply(M,t)})}),M.first=Ct,M.last=function(n,t,e){if(n){var r=0,a=n.length;if(typeof t!="number"&&t!=u){var o=a;for(t=M.createCallback(t,e);o--&&t(n[o],o,n);)r++}else if(r=t,r==u||e)return n[a-1];return Y(n,le(0,a-r))}},M.take=Ct,M.head=Ct,q(M,function(n,t){M.prototype[t]||(M.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e); },tt.isNull=function(n){return n===h},tt.isNumber=yt,tt.isObject=gt,tt.isPlainObject=m,tt.isRegExp=function(n){return n?typeof n=="object"&&ve.call(n)==G:b},tt.isString=ht,tt.isUndefined=function(n){return typeof n=="undefined"},tt.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?_e(0,r+e):ke(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},tt.mixin=Pt,tt.noConflict=function(){return r._=te,this},tt.parseInt=pe,tt.random=function(n,t){n==h&&t==h&&(t=1),n=+n||0,t==h?(t=n,n=0):t=+t||0;
return t==u||e&&typeof t!="function"?r:new Q(r)})}),M.VERSION="1.2.0",M.prototype.toString=function(){return Ut(this.__wrapped__)},M.prototype.value=Ft,M.prototype.valueOf=Ft,yt(["join","pop","shift"],function(n){var t=Gt[n];M.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)}}),yt(["push","reverse","sort","unshift"],function(n){var t=Gt[n];M.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),yt(["concat","slice","splice"],function(n){var t=Gt[n];M.prototype[n]=function(){return new Q(t.apply(this.__wrapped__,arguments)) var e=we();return n%1||t%1?n+ke(e*(t-n+parseFloat("1e-"+((e+"").length-1))),t):n+oe(e*(t-n+1))},tt.reduce=Et,tt.reduceRight=St,tt.result=function(n,t){var e=n?n[t]:g;return vt(e)?n[t]():e},tt.runInContext=v,tt.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Se(n).length},tt.some=It,tt.sortedIndex=Ft,tt.template=function(n,t,e){var r=tt.templateSettings;n||(n=""),e=Q({},e,r);var u,a=Q({},e.imports,r.imports),r=Se(a),a=mt(a),o=0,f=e.interpolate||R,l="__p+='",f=Qt((e.escape||R).source+"|"+f.source+"|"+(f===N?I:R).source+"|"+(e.evaluate||R).source+"|$","g");
}}),M}var e,r=!0,u=null,a=!1,o=typeof exports=="object"&&exports,i=typeof module=="object"&&module&&module.exports==o&&module,f=typeof global=="object"&&global;(f.global===f||f.window===f)&&(n=f);var c=0,l={},p=+new Date+"",s=200,v=/\b__p\+='';/g,g=/\b(__p\+=)''\+/g,y=/(__e\(.*?\)|\b__t\))\+'';/g,h=/&(?:amp|lt|gt|quot|#39);/g,m=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,b=/\w*$/,d=/<%=([\s\S]+?)%>/g,_=/^0+(?=.$)/,k=/($^)/,w=/[&<>"']/g,C=/['\n\r\t\u2028\u2029\\]/g,j="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),x="[object Arguments]",O="[object Array]",N="[object Boolean]",E="[object Date]",I="[object Number]",S="[object Object]",A="[object RegExp]",$="[object String]",B={"[object Function]":a}; n.replace(f,function(t,e,r,a,f,c){return r||(r=a),l+=n.slice(o,c).replace(q,i),e&&(l+="'+__e("+e+")+'"),f&&(u=y,l+="';"+f+";__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),o=c+t.length,t}),l+="';\n",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(x,""):l).replace(O,"$1").replace(E,"$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=Gt(r,"return "+l).apply(g,a)
B[x]=B[O]=B[N]=B[E]=B[I]=B[S]=B[A]=B[$]=r;var F={"boolean":a,"function":r,object:r,number:a,string:a,undefined:a},R={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},T=t();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=T,define(function(){return T})):o&&!o.nodeType?i?(i.exports=T)._=T:o._=T:n._=T})(this); }catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},tt.unescape=function(n){return n==h?"":Xt(n).replace(S,ft)},tt.uniqueId=function(n){var t=++_;return Xt(n==h?"":n)+t},tt.all=_t,tt.any=It,tt.detect=jt,tt.findWhere=jt,tt.foldl=Et,tt.foldr=St,tt.include=dt,tt.inject=Et,d(tt,function(n,t){tt.prototype[t]||(tt.prototype[t]=function(){var t=[this.__wrapped__];return ce.apply(t,arguments),n.apply(tt,t)})}),tt.first=Nt,tt.last=function(n,t,e){if(n){var r=0,u=n.length;if(typeof t!="number"&&t!=h){var a=u;
for(t=tt.createCallback(t,e);a--&&t(n[a],a,n);)r++}else if(r=t,r==h||e)return n[u-1];return s(n,_e(0,u-r))}},tt.take=Nt,tt.head=Nt,d(tt,function(n,t){tt.prototype[t]||(tt.prototype[t]=function(t,e){var r=n(this.__wrapped__,t,e);return t==h||e&&typeof t!="function"?r:new et(r)})}),tt.VERSION="1.3.1",tt.prototype.toString=function(){return Xt(this.__wrapped__)},tt.prototype.value=Kt,tt.prototype.valueOf=Kt,wt(["join","pop","shift"],function(n){var t=Zt[n];tt.prototype[n]=function(){return t.apply(this.__wrapped__,arguments)
}}),wt(["push","reverse","sort","unshift"],function(n){var t=Zt[n];tt.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),wt(["concat","slice","splice"],function(n){var t=Zt[n];tt.prototype[n]=function(){return new et(t.apply(this.__wrapped__,arguments))}}),tt}var g,y=!0,h=null,b=!1,m=[],d=[],_=0,k={},j=+new Date+"",w=75,C=40,x=/\b__p\+='';/g,O=/\b(__p\+=)''\+/g,E=/(__e\(.*?\)|\b__t\))\+'';/g,S=/&(?:amp|lt|gt|quot|#39);/g,I=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,A=/\w*$/,N=/<%=([\s\S]+?)%>/g,$=($=/\bthis\b/)&&$.test(v)&&$,B=" \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",F=RegExp("^["+B+"]*0+(?=.$)"),R=/($^)/,T=/[&<>"']/g,q=/['\n\r\t\u2028\u2029\\]/g,D="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setImmediate setTimeout".split(" "),z="[object Arguments]",W="[object Array]",P="[object Boolean]",K="[object Date]",M="[object Function]",U="[object Number]",V="[object Object]",G="[object RegExp]",H="[object String]",J={};
J[M]=b,J[z]=J[W]=J[P]=J[K]=J[U]=J[V]=J[G]=J[H]=y;var L={"boolean":b,"function":y,object:y,number:b,string:b,undefined:b},Q={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},X=L[typeof exports]&&exports,Y=L[typeof module]&&module&&module.exports==X&&module,Z=L[typeof global]&&global;!Z||Z.global!==Z&&Z.window!==Z||(n=Z);var nt=v();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=nt, define(function(){return nt})):X&&!X.nodeType?Y?(Y.exports=nt)._=nt:X._=nt:n._=nt
}(this);

View File

@@ -1,6 +1,6 @@
/** /**
* @license * @license
* Lo-Dash 1.2.0 (Custom Build) <http://lodash.com/> * Lo-Dash 1.3.1 (Custom Build) <http://lodash.com/>
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js` * Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/> * Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
* Based on Underscore.js 1.4.4 <http://underscorejs.org/> * Based on Underscore.js 1.4.4 <http://underscorejs.org/>
@@ -12,18 +12,6 @@
/** Used as a safe reference for `undefined` in pre ES5 environments */ /** Used as a safe reference for `undefined` in pre ES5 environments */
var undefined; var undefined;
/** Detect free variable `exports` */
var freeExports = typeof exports == 'object' && exports;
/** Detect free variable `module` */
var freeModule = typeof module == 'object' && module && module.exports == freeExports && module;
/** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
var freeGlobal = typeof global == 'object' && global;
if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
window = freeGlobal;
}
/** Used to generate unique IDs */ /** Used to generate unique IDs */
var idCounter = 0; var idCounter = 0;
@@ -34,7 +22,7 @@
var keyPrefix = +new Date + ''; var keyPrefix = +new Date + '';
/** Used as the size when optimizations are enabled for large arrays */ /** Used as the size when optimizations are enabled for large arrays */
var largeArraySize = 200; var largeArraySize = 75;
/** Used to match empty string literals in compiled template source */ /** Used to match empty string literals in compiled template source */
var reEmptyStringLeading = /\b__p \+= '';/g, var reEmptyStringLeading = /\b__p \+= '';/g,
@@ -73,6 +61,7 @@
arrayClass = '[object Array]', arrayClass = '[object Array]',
boolClass = '[object Boolean]', boolClass = '[object Boolean]',
dateClass = '[object Date]', dateClass = '[object Date]',
errorClass = '[object Error]',
funcClass = '[object Function]', funcClass = '[object Function]',
numberClass = '[object Number]', numberClass = '[object Number]',
objectClass = '[object Object]', objectClass = '[object Object]',
@@ -100,18 +89,112 @@
'\u2029': 'u2029' '\u2029': 'u2029'
}; };
/** Detect free variable `exports` */
var freeExports = objectTypes[typeof exports] && exports;
/** Detect free variable `module` */
var freeModule = objectTypes[typeof module] && module && module.exports == freeExports && module;
/** Detect free variable `global`, from Node.js or Browserified code, and use it as `window` */
var freeGlobal = objectTypes[typeof global] && global;
if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
window = freeGlobal;
}
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/** Used for `Array` and `Object` method references */ /**
var arrayRef = Array(), * A basic implementation of `_.indexOf` without support for binary searches
objectRef = Object(); * or `fromIndex` constraints.
*
* @private
* @param {Array} array The array to search.
* @param {Mixed} value The value to search for.
* @param {Number} [fromIndex=0] The index to search from.
* @returns {Number} Returns the index of the matched value or `-1`.
*/
function basicIndexOf(array, value, fromIndex) {
var index = (fromIndex || 0) - 1,
length = array.length;
while (++index < length) {
if (array[index] === value) {
return index;
}
}
return -1;
}
/**
* Used by `sortBy` to compare transformed `collection` values, stable sorting
* them in ascending order.
*
* @private
* @param {Object} a The object to compare to `b`.
* @param {Object} b The object to compare to `a`.
* @returns {Number} Returns the sort order indicator of `1` or `-1`.
*/
function compareAscending(a, b) {
var ai = a.index,
bi = b.index;
a = a.criteria;
b = b.criteria;
// ensure a stable sort in V8 and other engines
// http://code.google.com/p/v8/issues/detail?id=90
if (a !== b) {
if (a > b || typeof a == 'undefined') {
return 1;
}
if (a < b || typeof b == 'undefined') {
return -1;
}
}
return ai < bi ? -1 : 1;
}
/**
* Used by `template` to escape characters for inclusion in compiled
* string literals.
*
* @private
* @param {String} match The matched character to escape.
* @returns {String} Returns the escaped character.
*/
function escapeStringChar(match) {
return '\\' + stringEscapes[match];
}
/**
* A no-operation function.
*
* @private
*/
function noop() {
// no operation performed
}
/*--------------------------------------------------------------------------*/
/**
* Used for `Array` method references.
*
* Normally `Array.prototype` would suffice, however, using an array literal
* avoids issues in Narwhal.
*/
var arrayRef = [];
/** Used for native method references */
var objectProto = Object.prototype,
stringProto = String.prototype;
/** Used to restore the original `_` reference in `noConflict` */ /** Used to restore the original `_` reference in `noConflict` */
var oldDash = window._; var oldDash = window._;
/** Used to detect if a method is native */ /** Used to detect if a method is native */
var reNative = RegExp('^' + var reNative = RegExp('^' +
String(objectRef.valueOf) String(objectProto.valueOf)
.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') .replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
.replace(/valueOf|for [^\]]+/g, '.+?') + '$' .replace(/valueOf|for [^\]]+/g, '.+?') + '$'
); );
@@ -121,13 +204,15 @@
clearTimeout = window.clearTimeout, clearTimeout = window.clearTimeout,
concat = arrayRef.concat, concat = arrayRef.concat,
floor = Math.floor, floor = Math.floor,
hasOwnProperty = objectRef.hasOwnProperty, hasOwnProperty = objectProto.hasOwnProperty,
push = arrayRef.push, push = arrayRef.push,
propertyIsEnumerable = objectProto.propertyIsEnumerable,
setTimeout = window.setTimeout, setTimeout = window.setTimeout,
toString = objectRef.toString; toString = objectProto.toString;
/* Native method shortcuts for methods with the same name as other `lodash` methods */ /* Native method shortcuts for methods with the same name as other `lodash` methods */
var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind, var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind,
nativeCreate = reNative.test(nativeCreate = Object.create) && nativeCreate,
nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray, nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
nativeIsFinite = window.isFinite, nativeIsFinite = window.isFinite,
nativeIsNaN = window.isNaN, nativeIsNaN = window.isNaN,
@@ -162,8 +247,8 @@
* `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`, * `invoke`, `keys`, `map`, `max`, `memoize`, `merge`, `min`, `object`, `omit`,
* `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`, * `once`, `pairs`, `partial`, `partialRight`, `pick`, `pluck`, `push`, `range`,
* `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`, * `reject`, `rest`, `reverse`, `shuffle`, `slice`, `sort`, `sortBy`, `splice`,
* `tap`, `throttle`, `times`, `toArray`, `union`, `uniq`, `unshift`, `unzip`, * `tap`, `throttle`, `times`, `toArray`, `transform`, `union`, `uniq`, `unshift`,
* `values`, `where`, `without`, `wrap`, and `zip` * `unzip`, `values`, `where`, `without`, `wrap`, and `zip`
* *
* The non-chainable wrapper functions are: * The non-chainable wrapper functions are:
* `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`, * `clone`, `cloneDeep`, `contains`, `escape`, `every`, `find`, `has`,
@@ -179,6 +264,7 @@
* *
* @name _ * @name _
* @constructor * @constructor
* @alias chain
* @category Chaining * @category Chaining
* @param {Mixed} value The value to wrap in a `lodash` instance. * @param {Mixed} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns a `lodash` instance. * @returns {Object} Returns a `lodash` instance.
@@ -209,6 +295,19 @@
: new lodashWrapper(value); : new lodashWrapper(value);
} }
/**
* A fast path for creating `lodash` wrapper objects.
*
* @private
* @param {Mixed} value The value to wrap in a `lodash` instance.
* @returns {Object} Returns a `lodash` instance.
*/
function lodashWrapper(value) {
this.__wrapped__ = value;
}
// ensure `new lodashWrapper` is an instance of `lodash`
lodashWrapper.prototype = lodash.prototype;
/** /**
* An object used to flag environments features. * An object used to flag environments features.
* *
@@ -221,14 +320,6 @@
(function() { (function() {
var object = { '0': 1, 'length': 1 }; var object = { '0': 1, 'length': 1 };
/**
* Detect if `arguments` objects are `Object` objects (all but Narwhal and Opera < 10.5).
*
* @memberOf _.support
* @type Boolean
*/
support.argsObject = arguments.constructor == Object && !(arguments instanceof Array);
/** /**
* Detect if `Function#bind` exists and is inferred to be fast (all but V8). * Detect if `Function#bind` exists and is inferred to be fast (all but V8).
* *
@@ -298,47 +389,6 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/**
* Used by `_.max` and `_.min` as the default `callback` when a given
* `collection` is a string value.
*
* @private
* @param {String} value The character to inspect.
* @returns {Number} Returns the code unit of given character.
*/
function charAtCallback(value) {
return value.charCodeAt(0);
}
/**
* Used by `sortBy` to compare transformed `collection` values, stable sorting
* them in ascending order.
*
* @private
* @param {Object} a The object to compare to `b`.
* @param {Object} b The object to compare to `a`.
* @returns {Number} Returns the sort order indicator of `1` or `-1`.
*/
function compareAscending(a, b) {
var ai = a.index,
bi = b.index;
a = a.criteria;
b = b.criteria;
// ensure a stable sort in V8 and other engines
// http://code.google.com/p/v8/issues/detail?id=90
if (a !== b) {
if (a > b || typeof a == 'undefined') {
return 1;
}
if (a < b || typeof b == 'undefined') {
return -1;
}
}
return ai < bi ? -1 : 1;
}
/** /**
* Creates a function that, when called, invokes `func` with the `this` binding * Creates a function that, when called, invokes `func` with the `this` binding
* of `thisArg` and prepends any `partialArgs` to the arguments passed to the * of `thisArg` and prepends any `partialArgs` to the arguments passed to the
@@ -385,9 +435,7 @@
} }
if (this instanceof bound) { if (this instanceof bound) {
// ensure `new bound` is an instance of `func` // ensure `new bound` is an instance of `func`
noop.prototype = func.prototype; thisBinding = createObject(func.prototype);
thisBinding = new noop;
noop.prototype = null;
// mimic the constructor's `return` behavior // mimic the constructor's `return` behavior
// http://es5.github.com/#x13.2.2 // http://es5.github.com/#x13.2.2
@@ -400,15 +448,25 @@
} }
/** /**
* Used by `template` to escape characters for inclusion in compiled * Creates a new object with the specified `prototype`.
* string literals.
* *
* @private * @private
* @param {String} match The matched character to escape. * @param {Object} prototype The prototype object.
* @returns {String} Returns the escaped character. * @returns {Object} Returns the new object.
*/ */
function escapeStringChar(match) { function createObject(prototype) {
return '\\' + stringEscapes[match]; return isObject(prototype) ? nativeCreate(prototype) : {};
}
// fallback for browsers without `Object.create`
if (!nativeCreate) {
var createObject = function(prototype) {
if (isObject(prototype)) {
noop.prototype = prototype;
var result = new noop;
noop.prototype = null;
}
return result || {};
};
} }
/** /**
@@ -423,25 +481,16 @@
} }
/** /**
* A fast path for creating `lodash` wrapper objects. * Gets the appropriate "indexOf" function. If the `_.indexOf` method is
* customized, this method returns the custom method, otherwise it returns
* the `basicIndexOf` function.
* *
* @private * @private
* @param {Mixed} value The value to wrap in a `lodash` instance. * @returns {Function} Returns the "indexOf" function.
* @returns {Object} Returns a `lodash` instance.
*/ */
function lodashWrapper(value) { function getIndexOf(array, value, fromIndex) {
this.__wrapped__ = value; var result = (result = lodash.indexOf) === indexOf ? basicIndexOf : result;
} return result;
// ensure `new lodashWrapper` is an instance of `lodash`
lodashWrapper.prototype = lodash.prototype;
/**
* A no-operation function.
*
* @private
*/
function noop() {
// no operation performed
} }
/** /**
@@ -483,6 +532,26 @@
}; };
} }
/**
* Checks if `value` is an array.
*
* @static
* @memberOf _
* @category Objects
* @param {Mixed} value The value to check.
* @returns {Boolean} Returns `true`, if the `value` is an array, else `false`.
* @example
*
* (function() { return _.isArray(arguments); })();
* // => false
*
* _.isArray([1, 2, 3]);
* // => true
*/
var isArray = nativeIsArray || function(value) {
return value ? (typeof value == 'object' && toString.call(value) == arrayClass) : false;
};
/** /**
* A fallback implementation of `Object.keys` which produces an array of the * A fallback implementation of `Object.keys` which produces an array of the
* given object's own enumerable property names. * given object's own enumerable property names.
@@ -495,11 +564,10 @@
var shimKeys = function (object) { var shimKeys = function (object) {
var index, iterable = object, result = []; var index, iterable = object, result = [];
if (!iterable) return result; if (!iterable) return result;
if (!(objectTypes[typeof object])) return result; if (!(objectTypes[typeof object])) return result;
for (index in iterable) { for (index in iterable) {
if (hasOwnProperty.call(iterable, index)) { if (hasOwnProperty.call(iterable, index)) {
result.push(index); result.push(index);
} }
} }
return result return result
@@ -709,7 +777,6 @@
var index, iterable = collection, result = iterable; var index, iterable = collection, result = iterable;
if (!iterable) return result; if (!iterable) return result;
if (!objectTypes[typeof iterable]) return result; if (!objectTypes[typeof iterable]) return result;
for (index in iterable) { for (index in iterable) {
if (callback(iterable[index], index, collection) === indicatorObject) return result; if (callback(iterable[index], index, collection) === indicatorObject) return result;
} }
@@ -741,10 +808,9 @@
var index, iterable = collection, result = iterable; var index, iterable = collection, result = iterable;
if (!iterable) return result; if (!iterable) return result;
if (!objectTypes[typeof iterable]) return result; if (!objectTypes[typeof iterable]) return result;
for (index in iterable) { for (index in iterable) {
if (hasOwnProperty.call(iterable, index)) { if (hasOwnProperty.call(iterable, index)) {
if (callback(iterable[index], index, collection) === indicatorObject) return result; if (callback(iterable[index], index, collection) === indicatorObject) return result;
} }
} }
return result return result
@@ -820,26 +886,6 @@
return result; return result;
} }
/**
* Checks if `value` is an array.
*
* @static
* @memberOf _
* @category Objects
* @param {Mixed} value The value to check.
* @returns {Boolean} Returns `true`, if the `value` is an array, else `false`.
* @example
*
* (function() { return _.isArray(arguments); })();
* // => false
*
* _.isArray([1, 2, 3]);
* // => true
*/
var isArray = nativeIsArray || function(value) {
return toString.call(value) == arrayClass;
};
/** /**
* Checks if `value` is a boolean value. * Checks if `value` is a boolean value.
* *
@@ -871,7 +917,7 @@
* // => true * // => true
*/ */
function isDate(value) { function isDate(value) {
return toString.call(value) == dateClass; return value ? (typeof value == 'object' && toString.call(value) == dateClass) : false;
} }
/** /**
@@ -1116,7 +1162,7 @@
// fallback for older versions of Chrome and Safari // fallback for older versions of Chrome and Safari
if (isFunction(/x/)) { if (isFunction(/x/)) {
isFunction = function(value) { isFunction = function(value) {
return toString.call(value) == funcClass; return typeof value == 'function' && toString.call(value) == funcClass;
}; };
} }
@@ -1145,7 +1191,7 @@
// http://es5.github.com/#x8 // http://es5.github.com/#x8
// and avoid a V8 bug // and avoid a V8 bug
// http://code.google.com/p/v8/issues/detail?id=2291 // http://code.google.com/p/v8/issues/detail?id=2291
return value ? objectTypes[typeof value] : false; return !!(value && objectTypes[typeof value]);
} }
/** /**
@@ -1230,7 +1276,7 @@
* // => true * // => true
*/ */
function isRegExp(value) { function isRegExp(value) {
return toString.call(value) == regexpClass; return !!(value && objectTypes[typeof value]) && toString.call(value) == regexpClass;
} }
/** /**
@@ -1294,7 +1340,8 @@
* // => { 'name': 'moe' } * // => { 'name': 'moe' }
*/ */
function omit(object) { function omit(object) {
var props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)), var indexOf = getIndexOf(),
props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
result = {}; result = {};
forIn(object, function(value, key) { forIn(object, function(value, key) {
@@ -1427,9 +1474,10 @@
* // => true * // => true
*/ */
function contains(collection, target) { function contains(collection, target) {
var length = collection ? collection.length : 0, var indexOf = getIndexOf(),
length = collection ? collection.length : 0,
result = false; result = false;
if (typeof length == 'number') { if (length && typeof length == 'number') {
result = indexOf(collection, target) > -1; result = indexOf(collection, target) > -1;
} else { } else {
forOwn(collection, function(value) { forOwn(collection, function(value) {
@@ -1623,7 +1671,7 @@
* *
* @static * @static
* @memberOf _ * @memberOf _
* @alias detect * @alias detect, findWhere
* @category Collections * @category Collections
* @param {Array|Object|String} collection The collection to iterate over. * @param {Array|Object|String} collection The collection to iterate over.
* @param {Function|Object|String} [callback=identity] The function called per * @param {Function|Object|String} [callback=identity] The function called per
@@ -2458,6 +2506,7 @@
*/ */
function difference(array) { function difference(array) {
var index = -1, var index = -1,
indexOf = getIndexOf(),
length = array.length, length = array.length,
flattened = concat.apply(arrayRef, nativeSlice.call(arguments, 1)), flattened = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
result = []; result = [];
@@ -2552,7 +2601,7 @@
/** /**
* Flattens a nested array (the nesting can be to any depth). If `isShallow` * Flattens a nested array (the nesting can be to any depth). If `isShallow`
* is truthy, `array` will only be flattened a single level. If `callback` * is truthy, `array` will only be flattened a single level. If `callback`
* is passed, each element of `array` is passed through a callback` before * is passed, each element of `array` is passed through a `callback` before
* flattening. The `callback` is bound to `thisArg` and invoked with three * flattening. The `callback` is bound to `thisArg` and invoked with three
* arguments; (value, index, array). * arguments; (value, index, array).
* *
@@ -2631,21 +2680,14 @@
* // => 2 * // => 2
*/ */
function indexOf(array, value, fromIndex) { function indexOf(array, value, fromIndex) {
var index = -1,
length = array ? array.length : 0;
if (typeof fromIndex == 'number') { if (typeof fromIndex == 'number') {
index = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0) - 1; var length = array ? array.length : 0;
fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0);
} else if (fromIndex) { } else if (fromIndex) {
index = sortedIndex(array, value); var index = sortedIndex(array, value);
return array[index] === value ? index : -1; return array[index] === value ? index : -1;
} }
while (++index < length) { return array ? basicIndexOf(array, value, fromIndex) : -1;
if (array[index] === value) {
return index;
}
}
return -1;
} }
/** /**
@@ -2742,6 +2784,7 @@
var args = arguments, var args = arguments,
argsLength = args.length, argsLength = args.length,
index = -1, index = -1,
indexOf = getIndexOf(),
length = array ? array.length : 0, length = array ? array.length : 0,
result = []; result = [];
@@ -3086,7 +3129,7 @@
* Creates a duplicate-value-free version of the `array` using strict equality * Creates a duplicate-value-free version of the `array` using strict equality
* for comparisons, i.e. `===`. If the `array` is already sorted, passing `true` * for comparisons, i.e. `===`. If the `array` is already sorted, passing `true`
* for `isSorted` will run a faster algorithm. If `callback` is passed, each * for `isSorted` will run a faster algorithm. If `callback` is passed, each
* element of `array` is passed through a callback` before uniqueness is computed. * element of `array` is passed through the `callback` before uniqueness is computed.
* The `callback` is bound to `thisArg` and invoked with three arguments; (value, index, array). * The `callback` is bound to `thisArg` and invoked with three arguments; (value, index, array).
* *
* If a property name is passed for `callback`, the created "_.pluck" style * If a property name is passed for `callback`, the created "_.pluck" style
@@ -3115,11 +3158,11 @@
* _.uniq([1, 1, 2, 2, 3], true); * _.uniq([1, 1, 2, 2, 3], true);
* // => [1, 2, 3] * // => [1, 2, 3]
* *
* _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return Math.floor(num); }); * _.uniq(['A', 'b', 'C', 'a', 'B', 'c'], function(letter) { return letter.toLowerCase(); });
* // => [1, 2, 3] * // => ['A', 'b', 'C']
* *
* _.uniq([1, 2, 1.5, 3, 2.5], function(num) { return this.floor(num); }, Math); * _.uniq([1, 2.5, 3, 1.5, 2, 3.5], function(num) { return this.floor(num); }, Math);
* // => [1, 2, 3] * // => [1, 2.5, 3]
* *
* // using "_.pluck" callback shorthand * // using "_.pluck" callback shorthand
* _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
@@ -3127,6 +3170,7 @@
*/ */
function uniq(array, isSorted, callback, thisArg) { function uniq(array, isSorted, callback, thisArg) {
var index = -1, var index = -1,
indexOf = getIndexOf(),
length = array ? array.length : 0, length = array ? array.length : 0,
result = [], result = [],
seen = result; seen = result;
@@ -3157,6 +3201,31 @@
return result; return result;
} }
/**
* The inverse of `_.zip`, this method splits groups of elements into arrays
* composed of elements from each group at their corresponding indexes.
*
* @static
* @memberOf _
* @category Arrays
* @param {Array} array The array to process.
* @returns {Array} Returns a new array of the composed arrays.
* @example
*
* _.unzip([['moe', 30, true], ['larry', 40, false]]);
* // => [['moe', 'larry'], [30, 40], [true, false]];
*/
function unzip(array) {
var index = -1,
length = array ? max(pluck(array, 'length')) : 0,
result = Array(length < 0 ? 0 : length);
while (++index < length) {
result[index] = pluck(array, index);
}
return result;
}
/** /**
* Creates an array with all occurrences of the passed values removed using * Creates an array with all occurrences of the passed values removed using
* strict equality for comparisons, i.e. `===`. * strict equality for comparisons, i.e. `===`.
@@ -3195,7 +3264,7 @@
function zip(array) { function zip(array) {
var index = -1, var index = -1,
length = array ? max(pluck(arguments, 'length')) : 0, length = array ? max(pluck(arguments, 'length')) : 0,
result = Array(length); result = Array(length < 0 ? 0 : length);
while (++index < length) { while (++index < length) {
result[index] = pluck(arguments, index); result[index] = pluck(arguments, index);
@@ -3438,27 +3507,27 @@
return result; return result;
}; };
} }
if (typeof thisArg != 'undefined') { if (typeof thisArg == 'undefined') {
if (argCount === 1) { return func;
return function(value) { }
return func.call(thisArg, value); if (argCount === 1) {
}; return function(value) {
} return func.call(thisArg, value);
if (argCount === 2) {
return function(a, b) {
return func.call(thisArg, a, b);
};
}
if (argCount === 4) {
return function(accumulator, value, index, collection) {
return func.call(thisArg, accumulator, value, index, collection);
};
}
return function(value, index, collection) {
return func.call(thisArg, value, index, collection);
}; };
} }
return func; if (argCount === 2) {
return function(a, b) {
return func.call(thisArg, a, b);
};
}
if (argCount === 4) {
return function(accumulator, value, index, collection) {
return func.call(thisArg, accumulator, value, index, collection);
};
}
return function(value, index, collection) {
return func.call(thisArg, value, index, collection);
};
} }
/** /**
@@ -3468,6 +3537,10 @@
* and/or trailing edge of the `wait` timeout. Subsequent calls to the debounced * and/or trailing edge of the `wait` timeout. Subsequent calls to the debounced
* function will return the result of the last `func` call. * function will return the result of the last `func` call.
* *
* Note: If `leading` and `trailing` options are `true`, `func` will be called
* on the trailing edge of the timeout only if the the debounced function is
* invoked more than once during the `wait` timeout.
*
* @static * @static
* @memberOf _ * @memberOf _
* @category Functions * @category Functions
@@ -3475,18 +3548,24 @@
* @param {Number} wait The number of milliseconds to delay. * @param {Number} wait The number of milliseconds to delay.
* @param {Object} options The options object. * @param {Object} options The options object.
* [leading=false] A boolean to specify execution on the leading edge of the timeout. * [leading=false] A boolean to specify execution on the leading edge of the timeout.
* [maxWait] The maximum time `func` is allowed to be delayed before it's called.
* [trailing=true] A boolean to specify execution on the trailing edge of the timeout. * [trailing=true] A boolean to specify execution on the trailing edge of the timeout.
* @returns {Function} Returns the new debounced function. * @returns {Function} Returns the new debounced function.
* @example * @example
* *
* var lazyLayout = _.debounce(calculateLayout, 300); * var lazyLayout = _.debounce(calculateLayout, 300);
* jQuery(window).on('resize', lazyLayout); * jQuery(window).on('resize', lazyLayout);
*
* jQuery('#postbox').on('click', _.debounce(sendMail, 200, {
* 'leading': true,
* 'trailing': false
* });
*/ */
function debounce(func, wait, immediate) { function debounce(func, wait, immediate) {
var args, var args,
result, result,
thisArg, thisArg,
timeoutId; timeoutId = null;
function delayed() { function delayed() {
timeoutId = null; timeoutId = null;
@@ -3556,7 +3635,8 @@
* passed, it will be used to determine the cache key for storing the result * passed, it will be used to determine the cache key for storing the result
* based on the arguments passed to the memoized function. By default, the first * based on the arguments passed to the memoized function. By default, the first
* argument passed to the memoized function is used as the cache key. The `func` * argument passed to the memoized function is used as the cache key. The `func`
* is executed with the `this` binding of the memoized function. * is executed with the `this` binding of the memoized function. The result
* cache is exposed as the `cache` property on the memoized function.
* *
* @static * @static
* @memberOf _ * @memberOf _
@@ -3638,12 +3718,14 @@
/** /**
* Creates a function that, when executed, will only call the `func` function * Creates a function that, when executed, will only call the `func` function
* at most once per every `wait` milliseconds. If the throttled function is * at most once per every `wait` milliseconds. Pass an `options` object to
* invoked more than once during the `wait` timeout, `func` will also be called * indicate that `func` should be invoked on the leading and/or trailing edge
* on the trailing edge of the timeout. Pass an `options` object to indicate * of the `wait` timeout. Subsequent calls to the throttled function will
* that `func` should be invoked on the leading and/or trailing edge of the * return the result of the last `func` call.
* `wait` timeout. Subsequent calls to the throttled function will return *
* the result of the last `func` call. * Note: If `leading` and `trailing` options are `true`, `func` will be called
* on the trailing edge of the timeout only if the the throttled function is
* invoked more than once during the `wait` timeout.
* *
* @static * @static
* @memberOf _ * @memberOf _
@@ -3658,13 +3740,17 @@
* *
* var throttled = _.throttle(updatePosition, 100); * var throttled = _.throttle(updatePosition, 100);
* jQuery(window).on('scroll', throttled); * jQuery(window).on('scroll', throttled);
*
* jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {
* 'trailing': false
* }));
*/ */
function throttle(func, wait) { function throttle(func, wait) {
var args, var args,
result, result,
thisArg, thisArg,
timeoutId, lastCalled = 0,
lastCalled = 0; timeoutId = null;
function trailingCall() { function trailingCall() {
lastCalled = new Date; lastCalled = new Date;
@@ -3741,7 +3827,7 @@
} }
/** /**
* This function returns the first argument passed to it. * This method returns the first argument passed to it.
* *
* @static * @static
* @memberOf _ * @memberOf _
@@ -3841,8 +3927,13 @@
if (max == null) { if (max == null) {
max = min; max = min;
min = 0; min = 0;
} else {
max = +max || 0;
} }
return min + floor(nativeRandom() * ((+max || 0) - min + 1)); var rand = nativeRandom();
return (min % 1 || max % 1)
? min + nativeMin(rand * (max - min + parseFloat('1e-' + ((rand +'').length - 1))), max)
: min + floor(rand * (max - min + 1));
} }
/** /**
@@ -3957,8 +4048,9 @@
* '); * ');
*/ */
function template(text, data, options) { function template(text, data, options) {
var settings = lodash.templateSettings;
text || (text = ''); text || (text = '');
options = defaults({}, options, lodash.templateSettings); options = defaults({}, options, settings);
var index = 0, var index = 0,
source = "__p += '", source = "__p += '",
@@ -4253,6 +4345,9 @@
lodash.tail = rest; lodash.tail = rest;
lodash.unique = uniq; lodash.unique = uniq;
// add Underscore compat
lodash.chain = chain;
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
// add functions that return unwrapped values when chaining // add functions that return unwrapped values when chaining
@@ -4261,7 +4356,6 @@
lodash.escape = escape; lodash.escape = escape;
lodash.every = every; lodash.every = every;
lodash.find = find; lodash.find = find;
lodash.findWhere = findWhere;
lodash.has = has; lodash.has = has;
lodash.identity = identity; lodash.identity = identity;
lodash.indexOf = indexOf; lodash.indexOf = indexOf;
@@ -4299,6 +4393,7 @@
lodash.all = every; lodash.all = every;
lodash.any = some; lodash.any = some;
lodash.detect = find; lodash.detect = find;
lodash.findWhere = findWhere;
lodash.foldl = reduce; lodash.foldl = reduce;
lodash.foldr = reduceRight; lodash.foldr = reduceRight;
lodash.include = contains; lodash.include = contains;
@@ -4316,8 +4411,6 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
lodash.chain = chain;
/** /**
* The semantic version number. * The semantic version number.
* *
@@ -4325,7 +4418,7 @@
* @memberOf _ * @memberOf _
* @type String * @type String
*/ */
lodash.VERSION = '1.2.0'; lodash.VERSION = '1.3.1';
// add functions to `lodash.prototype` // add functions to `lodash.prototype`
mixin(lodash); mixin(lodash);

View File

@@ -1,34 +1,35 @@
/** /**
* @license * @license
* Lo-Dash 1.2.0 (Custom Build) lodash.com/license * Lo-Dash 1.3.1 (Custom Build) lodash.com/license
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js` * Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
* Underscore.js 1.4.4 underscorejs.org/LICENSE * Underscore.js 1.4.4 underscorejs.org/LICENSE
*/ */
;(function(n){function r(n){return n instanceof r?n:new i(n)}function t(n,r){var t=n.b,e=r.b;if(n=n.a,r=r.a,n!==r){if(n>r||typeof n=="undefined")return 1;if(n<r||typeof r=="undefined")return-1}return t<e?-1:1}function e(n,r,t,e){function u(){var e=arguments,c=i?this:r;return o||(n=r[f]),t.length&&(e=e.length?(e=Br.call(e),l?e.concat(t):t.concat(e)):t),this instanceof u?(a.prototype=n.prototype,c=new a,a.prototype=null,e=n.apply(c,e),m(e)?e:c):n.apply(c,e)}var o=y(n),i=!t,f=r;if(i){var l=e;t=r}else if(!o){if(!e)throw new TypeError; ;!function(n){function t(n,t){var r;if(n&&gt[typeof n])for(r in n)if(Et.call(n,r)&&t(n[r],r,n)===nt)break}function r(n,t){var r;if(n&&gt[typeof n])for(r in n)if(t(n[r],r,n)===nt)break}function e(n){var t,r=[];if(!n||!gt[typeof n])return r;for(t in n)Et.call(n,t)&&r.push(t);return r}function u(n,t,r){r=(r||0)-1;for(var e=n.length;++r<e;)if(n[r]===t)return r;return-1}function o(n,t){var r=n.m,e=t.m;if(n=n.l,t=t.l,n!==t){if(n>t||typeof n=="undefined")return 1;if(n<t||typeof t=="undefined")return-1}return r<e?-1:1
r=n}return u}function u(n){return"\\"+lr[n]}function o(n){return Rr[n]}function i(n){this.__wrapped__=n}function a(){}function f(n){return Dr[n]}function l(n){return dr.call(n)==nr}function c(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 p(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)null==n[u]&&(n[u]=e[u])}return n}function s(n){var r=[];return Mr(n,function(n,t){y(n)&&r.push(t) }function i(n){return"\\"+ht[n]}function a(){}function f(n){return n instanceof f?n:new c(n)}function c(n){this.__wrapped__=n}function l(n,t,r){function e(){var f=arguments,c=o?this:t;return u||(n=t[i]),r.length&&(f=f.length?(f=zt.call(f),a?f.concat(r):r.concat(f)):r),this instanceof e?(c=p(n.prototype),f=n.apply(c,f),A(f)?f:c):n.apply(c,f)}var u=w(n),o=!r,i=t;if(o){var a=void 0;r=t}else if(!u)throw new TypeError;return e}function p(n){return A(n)?Ft(n):{}}function s(n){return Wt[n]}function v(){var n=(n=f.indexOf)===U?u:n;
}),r.sort()}function v(n){for(var r=-1,t=Fr(n),e=t.length,u={};++r<e;){var o=t[r];u[n[o]]=o}return u}function g(n){if(!n)return!0;if($r(n)||b(n))return!n.length;for(var r in n)if(mr.call(n,r))return!1;return!0}function h(n,t,e,u){if(n===t)return 0!==n||1/n==1/t;var o=typeof n,i=typeof t;if(n===n&&(!n||"function"!=o&&"object"!=o)&&(!t||"function"!=i&&"object"!=i))return!1;if(null==n||null==t)return n===t;if(i=dr.call(n),o=dr.call(t),i!=o)return!1;switch(i){case tr:case er:return+n==+t;case ur:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t; return n}function g(n){return Gt[n]}function h(n){return kt.call(n)==it}function y(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]=e[u]}return n}function m(n){if(!n)return n;for(var t=1,r=arguments.length;t<r;t++){var e=arguments[t];if(e)for(var u in e)n[u]==X&&(n[u]=e[u])}return n}function _(n){var t=[];return r(n,function(n,r){w(n)&&t.push(r)}),t.sort()}function d(n){for(var t=-1,r=Vt(n),e=r.length,u={};++t<e;){var o=r[t];u[n[o]]=o}return u}function b(n){if(!n)return Q;
case ir:case ar:return n==t+""}if(o=i==rr,!o){if(n instanceof r||t instanceof r)return h(n.__wrapped__||n,t.__wrapped__||t,e,u);if(i!=or)return!1;var i=n.constructor,a=t.constructor;if(i!=a&&(!y(i)||!(i instanceof i&&y(a)&&a instanceof a)))return!1}for(e||(e=[]),u||(u=[]),i=e.length;i--;)if(e[i]==n)return u[i]==t;var f=!0,l=0;if(e.push(n),u.push(t),o){if(l=t.length,f=l==n.length)for(;l--&&(f=h(n[l],t[l],e,u)););return f}return Mr(t,function(r,t,o){return mr.call(o,t)?(l++,!(f=mr.call(n,t)&&h(n[t],r,e,u))&&K):void 0 if(Ut(n)||O(n))return!n.length;for(var t in n)if(Et.call(n,t))return Y;return Q}function j(n,t,e,u){if(n===t)return 0!==n||1/n==1/t;var o=typeof n,i=typeof t;if(n===n&&(!n||"function"!=o&&"object"!=o)&&(!t||"function"!=i&&"object"!=i))return Y;if(n==X||t==X)return n===t;if(i=kt.call(n),o=kt.call(t),i!=o)return Y;switch(i){case ft:case ct:return+n==+t;case lt:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case st:case vt:return n==t+""}if(o=i==at,!o){if(n instanceof f||t instanceof f)return j(n.__wrapped__||n,t.__wrapped__||t,e,u);
}),f&&Mr(n,function(n,r,t){return mr.call(t,r)?!(f=-1<--l)&&K:void 0}),f}function y(n){return typeof n=="function"}function m(n){return n?fr[typeof n]:!1}function _(n){return typeof n=="number"||dr.call(n)==ur}function b(n){return typeof n=="string"||dr.call(n)==ar}function d(n){for(var r=-1,t=Fr(n),e=t.length,u=Array(e);++r<e;)u[r]=n[t[r]];return u}function j(n,r){var t=!1;return typeof(n?n.length:0)=="number"?t=-1<T(n,r):Tr(n,function(n){return(t=n===r)&&K}),t}function w(n,r,t){var e=!0;r=P(r,t),t=-1; if(i!=pt)return Y;var i=n.constructor,a=t.constructor;if(i!=a&&(!w(i)||!(i instanceof i&&w(a)&&a instanceof a)))return Y}for(e||(e=[]),u||(u=[]),i=e.length;i--;)if(e[i]==n)return u[i]==t;var c=Q,l=0;if(e.push(n),u.push(t),o){if(l=t.length,c=l==n.length)for(;l--&&(c=j(n[l],t[l],e,u)););return c}return r(t,function(t,r,o){return Et.call(o,r)?(l++,!(c=Et.call(n,r)&&j(n[r],t,e,u))&&nt):void 0}),c&&r(n,function(n,t,r){return Et.call(r,t)?!(c=-1<--l)&&nt:void 0}),c}function w(n){return typeof n=="function"
var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&(e=!!r(n[t],t,n)););else Tr(n,function(n,t,u){return!(e=!!r(n,t,u))&&K});return e}function A(n,r,t){var e=[];r=P(r,t),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 Tr(n,function(n,t,u){r(n,t,u)&&e.push(n)});return e}function x(n,r,t){r=P(r,t),t=-1;var e=n?n.length:0;if(typeof e!="number"){var u;return Tr(n,function(n,t,e){return r(n,t,e)?(u=n,K):void 0}),u}for(;++t<e;){var o=n[t];if(r(o,t,n))return o }function A(n){return!(!n||!gt[typeof n])}function x(n){return typeof n=="number"||kt.call(n)==lt}function O(n){return typeof n=="string"||kt.call(n)==vt}function E(n){for(var t=-1,r=Vt(n),e=r.length,u=Array(e);++t<e;)u[t]=n[r[t]];return u}function S(n,r){var e=v(),u=n?n.length:0,o=Y;return u&&typeof u=="number"?o=-1<e(n,r):t(n,function(n){return(o=n===r)&&nt}),o}function N(n,r,e){var u=Q;r=J(r,e),e=-1;var o=n?n.length:0;if(typeof o=="number")for(;++e<o&&(u=!!r(n[e],e,n)););else t(n,function(n,t,e){return!(u=!!r(n,t,e))&&nt
}}function O(n,r,t){var e=-1,u=n?n.length:0;if(r=r&&typeof t=="undefined"?r:P(r,t),typeof u=="number")for(;++e<u&&r(n[e],e,n)!==K;);else Tr(n,r)}function E(n,r,t){var e=-1,u=n?n.length:0;if(r=P(r,t),typeof u=="number")for(var o=Array(u);++e<u;)o[e]=r(n[e],e,n);else o=[],Tr(n,function(n,t,u){o[++e]=r(n,t,u)});return o}function S(n,r,t){var e=-1/0,u=e,o=-1,i=n?n.length:0;if(r||typeof i!="number")r=P(r,t),O(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});else for(;++o<i;)t=n[o],t>u&&(u=t);return u}function N(n,r){var t=-1,e=n?n.length:0; });return u}function k(n,r,e){var u=[];r=J(r,e),e=-1;var o=n?n.length:0;if(typeof o=="number")for(;++e<o;){var i=n[e];r(i,e,n)&&u.push(i)}else t(n,function(n,t,e){r(n,t,e)&&u.push(n)});return u}function B(n,r,e){r=J(r,e),e=-1;var u=n?n.length:0;if(typeof u!="number"){var o;return t(n,function(n,t,e){return r(n,t,e)?(o=n,nt):void 0}),o}for(;++e<u;){var i=n[e];if(r(i,e,n))return i}}function F(n,r,e){var u=-1,o=n?n.length:0;if(r=r&&typeof e=="undefined"?r:J(r,e),typeof o=="number")for(;++u<o&&r(n[u],u,n)!==nt;);else t(n,r)
if(typeof e=="number")for(var u=Array(e);++t<e;)u[t]=n[t][r];return u||E(n,r)}function B(n,r,t,e){if(!n)return t;var u=3>arguments.length;r=P(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 Tr(n,function(n,e,o){t=u?(u=!1,n):r(t,n,e,o)});return t}function k(n,r,t,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Fr(n),u=i.length;return r=P(r,e,4),O(n,function(e,a,f){a=i?i[--u]:--u,t=o?(o=!1,n[a]):r(t,n[a],a,f)}),t}function q(n,r,t){var e; }function q(n,r,e){var u=-1,o=n?n.length:0;if(r=J(r,e),typeof o=="number")for(var i=Array(o);++u<o;)i[u]=r(n[u],u,n);else i=[],t(n,function(n,t,e){i[++u]=r(n,t,e)});return i}function R(n,t,r){var e=-1/0,u=e,o=-1,i=n?n.length:0;if(t||typeof i!="number")t=J(t,r),F(n,function(n,r,o){r=t(n,r,o),r>e&&(e=r,u=n)});else for(;++o<i;)r=n[o],r>u&&(u=r);return u}function D(n,t){var r=-1,e=n?n.length:0;if(typeof e=="number")for(var u=Array(e);++r<e;)u[r]=n[r][t];return u||q(n,t)}function M(n,r,e,u){if(!n)return e;
r=P(r,t),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&!(e=r(n[t],t,n)););else Tr(n,function(n,t,u){return(e=r(n,t,u))&&K});return!!e}function F(n,r,t){return t&&g(r)?null:(t?x:A)(n,r)}function R(n){for(var r=-1,t=n.length,e=hr.apply(cr,Br.call(arguments,1)),u=[];++r<t;){var o=n[r];0>T(e,o)&&u.push(o)}return u}function D(n,r,t){if(n){var e=0,u=n.length;if(typeof r!="number"&&null!=r){var o=-1;for(r=P(r,t);++o<u&&r(n[o],o,n);)e++}else if(e=r,null==e||t)return n[0];return Br.call(n,0,Sr(Er(0,e),u)) var o=3>arguments.length;r=J(r,u,4);var i=-1,a=n.length;if(typeof a=="number")for(o&&(e=n[++i]);++i<a;)e=r(e,n[i],i,n);else t(n,function(n,t,u){e=o?(o=Y,n):r(e,n,t,u)});return e}function T(n,t,r,e){var u=n?n.length:0,o=3>arguments.length;if(typeof u!="number")var i=Vt(n),u=i.length;return t=J(t,e,4),F(n,function(e,a,f){a=i?i[--u]:--u,r=o?(o=Y,n[a]):t(r,n[a],a,f)}),r}function $(n,r,e){var u;r=J(r,e),e=-1;var o=n?n.length:0;if(typeof o=="number")for(;++e<o&&!(u=r(n[e],e,n)););else t(n,function(n,t,e){return(u=r(n,t,e))&&nt
}}function M(n,r){for(var t=-1,e=n?n.length:0,u=[];++t<e;){var o=n[t];$r(o)?_r.apply(u,r?o:M(o)):u.push(o)}return u}function T(n,r,t){var e=-1,u=n?n.length:0;if(typeof t=="number")e=(0>t?Er(0,u+t):t||0)-1;else if(t)return e=I(n,r),n[e]===r?e:-1;for(;++e<u;)if(n[e]===r)return e;return-1}function $(n,r,t){if(typeof r!="number"&&null!=r){var e=0,u=-1,o=n?n.length:0;for(r=P(r,t);++u<o&&r(n[u],u,n);)e++}else e=null==r||t?1:Er(0,r);return Br.call(n,e)}function I(n,r,t,e){var u=0,o=n?n.length:u;for(t=t?P(t,e,1):U,r=t(r);u<o;)e=u+o>>>1,t(n[e])<r?u=e+1:o=e; });return!!u}function I(n,t,r){return r&&b(t)?X:(r?B:k)(n,t)}function z(n){for(var t=-1,r=v(),e=n.length,u=xt.apply(dt,zt.call(arguments,1)),o=[];++t<e;){var i=n[t];0>r(u,i)&&o.push(i)}return o}function C(n,t,r){if(n){var e=0,u=n.length;if(typeof t!="number"&&t!=X){var o=-1;for(t=J(t,r);++o<u&&t(n[o],o,n);)e++}else if(e=t,e==X||r)return n[0];return zt.call(n,0,$t(Tt(0,e),u))}}function P(n,t){for(var r=-1,e=n?n.length:0,u=[];++r<e;){var o=n[r];Ut(o)?St.apply(u,t?o:P(o)):u.push(o)}return u}function U(n,t,r){if(typeof r=="number"){var e=n?n.length:0;
return u}function z(n,r,t,e){var u=-1,o=n?n.length:0,i=[],a=i;for(typeof r!="boolean"&&null!=r&&(e=t,t=r,r=!1),null!=t&&(a=[],t=P(t,e));++u<o;){e=n[u];var f=t?t(e,u,n):e;(r?!u||a[a.length-1]!==f:0>T(a,f))&&(t&&a.push(f),i.push(e))}return i}function C(n,r){return qr.fastBind||jr&&2<arguments.length?jr.call.apply(jr,arguments):e(n,r,Br.call(arguments,2))}function P(n,r,t){if(null==n)return U;var e=typeof n;if("function"!=e){if("object"!=e)return function(r){return r[n]};var u=Fr(n);return function(r){for(var t=u.length,e=!1;t--&&(e=r[u[t]]===n[u[t]]););return e r=0>r?Tt(0,e+r):r||0}else if(r)return r=W(n,t),n[r]===t?r:-1;return n?u(n,t,r):-1}function V(n,t,r){if(typeof t!="number"&&t!=X){var e=0,u=-1,o=n?n.length:0;for(t=J(t,r);++u<o&&t(n[u],u,n);)e++}else e=t==X||r?1:Tt(0,t);return zt.call(n,e)}function W(n,t,r,e){var u=0,o=n?n.length:u;for(r=r?J(r,e,1):K,t=r(t);u<o;)e=u+o>>>1,r(n[e])<t?u=e+1:o=e;return u}function G(n,t,r,e){var u=-1,o=v(),i=n?n.length:0,a=[],f=a;for(typeof t!="boolean"&&t!=X&&(e=r,r=t,t=Y),r!=X&&(f=[],r=J(r,e));++u<i;){e=n[u];var c=r?r(e,u,n):e;
}}return typeof r!="undefined"?1===t?function(t){return n.call(r,t)}:2===t?function(t,e){return n.call(r,t,e)}:4===t?function(t,e,u,o){return n.call(r,t,e,u,o)}:function(t,e,u){return n.call(r,t,e,u)}:n}function U(n){return n}function V(n){O(s(n),function(t){var e=r[t]=n[t];r.prototype[t]=function(){var n=[this.__wrapped__];return _r.apply(n,arguments),n=e.apply(r,n),this.__chain__&&(n=new i(n),n.__chain__=!0),n}})}var W=typeof exports=="object"&&exports,G=typeof module=="object"&&module&&module.exports==W&&module,H=typeof global=="object"&&global; (t?!u||f[f.length-1]!==c:0>o(f,c))&&(r&&f.push(c),a.push(e))}return a}function H(n,t){return Pt.fastBind||Bt&&2<arguments.length?Bt.call.apply(Bt,arguments):l(n,t,zt.call(arguments,2))}function J(n,t,r){if(n==X)return K;var e=typeof n;if("function"!=e){if("object"!=e)return function(t){return t[n]};var u=Vt(n);return function(t){for(var r=u.length,e=Y;r--&&(e=t[u[r]]===n[u[r]]););return e}}return typeof t=="undefined"?n:1===r?function(r){return n.call(t,r)}:2===r?function(r,e){return n.call(t,r,e)
(H.global===H||H.window===H)&&(n=H);var J=0,K={},L=+new Date+"",Q=/&(?:amp|lt|gt|quot|#39);/g,X=/($^)/,Y=/[&<>"']/g,Z=/['\n\r\t\u2028\u2029\\]/g,nr="[object Arguments]",rr="[object Array]",tr="[object Boolean]",er="[object Date]",ur="[object Number]",or="[object Object]",ir="[object RegExp]",ar="[object String]",fr={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},lr={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},cr=[],H={},pr=n._,sr=RegExp("^"+(H.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),vr=Math.ceil,gr=n.clearTimeout,hr=cr.concat,yr=Math.floor,mr=H.hasOwnProperty,_r=cr.push,br=n.setTimeout,dr=H.toString,jr=sr.test(jr=dr.bind)&&jr,wr=sr.test(wr=Array.isArray)&&wr,Ar=n.isFinite,xr=n.isNaN,Or=sr.test(Or=Object.keys)&&Or,Er=Math.max,Sr=Math.min,Nr=Math.random,Br=cr.slice,H=sr.test(n.attachEvent),kr=jr&&!/\n|true/.test(jr+H),qr={}; }:4===r?function(r,e,u,o){return n.call(t,r,e,u,o)}:function(r,e,u){return n.call(t,r,e,u)}}function K(n){return n}function L(n){F(_(n),function(t){var r=f[t]=n[t];f.prototype[t]=function(){var n=[this.__wrapped__];return St.apply(n,arguments),n=r.apply(f,n),this.__chain__&&(n=new c(n),n.__chain__=Q),n}})}var Q=!0,X=null,Y=!1,Z=0,nt={},tt=+new Date+"",rt=/&(?:amp|lt|gt|quot|#39);/g,et=/($^)/,ut=/[&<>"']/g,ot=/['\n\r\t\u2028\u2029\\]/g,it="[object Arguments]",at="[object Array]",ft="[object Boolean]",ct="[object Date]",lt="[object Number]",pt="[object Object]",st="[object RegExp]",vt="[object String]",gt={"boolean":Y,"function":Q,object:Q,number:Y,string:Y,undefined:Y},ht={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},yt=gt[typeof exports]&&exports,mt=gt[typeof module]&&module&&module.exports==yt&&module,_t=gt[typeof global]&&global;
(function(){var n={0:1,length:1};qr.argsObject=arguments.constructor==Object&&!(arguments instanceof Array),qr.fastBind=jr&&!kr,qr.spliceObjects=(cr.splice.call(n,0,1),!n[0])})(1),r.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},i.prototype=r.prototype,l(arguments)||(l=function(n){return n?mr.call(n,"callee"):!1});var H=function(n){var r,t=[];if(!n||!fr[typeof n])return t;for(r in n)mr.call(n,r)&&t.push(r);return t},Fr=Or?function(n){return m(n)?Or(n):[] !_t||_t.global!==_t&&_t.window!==_t||(n=_t);var dt=[],_t=Object.prototype,bt=n._,jt=RegExp("^"+(_t.valueOf+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),wt=Math.ceil,At=n.clearTimeout,xt=dt.concat,Ot=Math.floor,Et=_t.hasOwnProperty,St=dt.push,Nt=n.setTimeout,kt=_t.toString,Bt=jt.test(Bt=kt.bind)&&Bt,Ft=jt.test(Ft=Object.create)&&Ft,qt=jt.test(qt=Array.isArray)&&qt,Rt=n.isFinite,Dt=n.isNaN,Mt=jt.test(Mt=Object.keys)&&Mt,Tt=Math.max,$t=Math.min,It=Math.random,zt=dt.slice,_t=jt.test(n.attachEvent),Ct=Bt&&!/\n|true/.test(Bt+_t);
}:H,Rr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Dr=v(Rr),Mr=function(n,r){var t;if(!n||!fr[typeof n])return n;for(t in n)if(r(n[t],t,n)===K)break;return n},Tr=function(n,r){var t;if(!n||!fr[typeof n])return n;for(t in n)if(mr.call(n,t)&&r(n[t],t,n)===K)break;return n},$r=wr||function(n){return dr.call(n)==rr};y(/x/)&&(y=function(n){return"[object Function]"==dr.call(n)}),r.after=function(n,r){return 1>n?r():function(){return 1>--n?r.apply(this,arguments):void 0}},r.bind=C,r.bindAll=function(n){for(var r=1<arguments.length?hr.apply(cr,Br.call(arguments,1)):s(n),t=-1,e=r.length;++t<e;){var u=r[t]; c.prototype=f.prototype;var Pt={};!function(){var n={0:1,length:1};Pt.fastBind=Bt&&!Ct,Pt.spliceObjects=(dt.splice.call(n,0,1),!n[0])}(1),f.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Ft||(p=function(n){if(A(n)){a.prototype=n;var t=new a;a.prototype=X}return t||{}}),h(arguments)||(h=function(n){return n?Et.call(n,"callee"):Y});var Ut=qt||function(n){return n?typeof n=="object"&&kt.call(n)==at:Y},Vt=Mt?function(n){return A(n)?Mt(n):[]
n[u]=C(n[u],n)}return n},r.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},r.compose=function(){var n=arguments;return function(){for(var r=arguments,t=n.length;t--;)r=[n[t].apply(this,r)];return r[0]}},r.countBy=function(n,r,t){var e={};return r=P(r,t),O(n,function(n,t,u){t=r(n,t,u)+"",mr.call(e,t)?e[t]++:e[t]=1}),e},r.debounce=function(n,r,t){function e(){a=null,t||(o=n.apply(i,u))}var u,o,i,a;return function(){var f=t&&!a;return u=arguments,i=this,gr(a),a=br(e,r),f&&(o=n.apply(i,u)),o }:e,Wt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Gt=d(Wt);w(/x/)&&(w=function(n){return typeof n=="function"&&"[object Function]"==kt.call(n)}),f.after=function(n,t){return 1>n?t():function(){return 1>--n?t.apply(this,arguments):void 0}},f.bind=H,f.bindAll=function(n){for(var t=1<arguments.length?xt.apply(dt,zt.call(arguments,1)):_(n),r=-1,e=t.length;++r<e;){var u=t[r];n[u]=H(n[u],n)}return n},f.compact=function(n){for(var t=-1,r=n?n.length:0,e=[];++t<r;){var u=n[t];u&&e.push(u)
}},r.defaults=p,r.defer=function(n){var r=Br.call(arguments,1);return br(function(){n.apply(void 0,r)},1)},r.delay=function(n,r){var t=Br.call(arguments,2);return br(function(){n.apply(void 0,t)},r)},r.difference=R,r.filter=A,r.flatten=M,r.forEach=O,r.functions=s,r.groupBy=function(n,r,t){var e={};return r=P(r,t),O(n,function(n,t,u){t=r(n,t,u)+"",(mr.call(e,t)?e[t]:e[t]=[]).push(n)}),e},r.initial=function(n,r,t){if(!n)return[];var e=0,u=n.length;if(typeof r!="number"&&null!=r){var o=u;for(r=P(r,t);o--&&r(n[o],o,n);)e++ }return e},f.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length;r--;)t=[n[r].apply(this,t)];return t[0]}},f.countBy=function(n,t,r){var e={};return t=J(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",Et.call(e,r)?e[r]++:e[r]=1}),e},f.debounce=function(n,t,r){function e(){a=X,r||(o=n.apply(i,u))}var u,o,i,a=X;return function(){var f=r&&!a;return u=arguments,i=this,At(a),a=Nt(e,t),f&&(o=n.apply(i,u)),o}},f.defaults=m,f.defer=function(n){var t=zt.call(arguments,1);return Nt(function(){n.apply(void 0,t)
}else e=null==r||t?1:r||e;return Br.call(n,0,Sr(Er(0,u-e),u))},r.intersection=function(n){var r=arguments,t=r.length,e=-1,u=n?n.length:0,o=[];n:for(;++e<u;){var i=n[e];if(0>T(o,i)){for(var a=t;--a;)if(0>T(r[a],i))continue n;o.push(i)}}return o},r.invert=v,r.invoke=function(n,r){var t=Br.call(arguments,2),e=-1,u=typeof r=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return O(n,function(n){i[++e]=(u?r:n[r]).apply(n,t)}),i},r.keys=Fr,r.map=E,r.max=S,r.memoize=function(n,r){var t={};return function(){var e=L+(r?r.apply(this,arguments):arguments[0]); },1)},f.delay=function(n,t){var r=zt.call(arguments,2);return Nt(function(){n.apply(void 0,r)},t)},f.difference=z,f.filter=k,f.flatten=P,f.forEach=F,f.functions=_,f.groupBy=function(n,t,r){var e={};return t=J(t,r),F(n,function(n,r,u){r=t(n,r,u)+"",(Et.call(e,r)?e[r]:e[r]=[]).push(n)}),e},f.initial=function(n,t,r){if(!n)return[];var e=0,u=n.length;if(typeof t!="number"&&t!=X){var o=u;for(t=J(t,r);o--&&t(n[o],o,n);)e++}else e=t==X||r?1:t||e;return zt.call(n,0,$t(Tt(0,u-e),u))},f.intersection=function(n){var t=arguments,r=t.length,e=-1,u=v(),o=n?n.length:0,i=[];
return mr.call(t,e)?t[e]:t[e]=n.apply(this,arguments)}},r.min=function(n,r,t){var e=1/0,u=e,o=-1,i=n?n.length:0;if(r||typeof i!="number")r=P(r,t),O(n,function(n,t,o){t=r(n,t,o),t<e&&(e=t,u=n)});else for(;++o<i;)t=n[o],t<u&&(u=t);return u},r.omit=function(n){var r=hr.apply(cr,Br.call(arguments,1)),t={};return Mr(n,function(n,e){0>T(r,e)&&(t[e]=n)}),t},r.once=function(n){var r,t;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},r.pairs=function(n){for(var r=-1,t=Fr(n),e=t.length,u=Array(e);++r<e;){var o=t[r]; n:for(;++e<o;){var a=n[e];if(0>u(i,a)){for(var f=r;--f;)if(0>u(t[f],a))continue n;i.push(a)}}return i},f.invert=d,f.invoke=function(n,t){var r=zt.call(arguments,2),e=-1,u=typeof t=="function",o=n?n.length:0,i=Array(typeof o=="number"?o:0);return F(n,function(n){i[++e]=(u?t:n[t]).apply(n,r)}),i},f.keys=Vt,f.map=q,f.max=R,f.memoize=function(n,t){var r={};return function(){var e=tt+(t?t.apply(this,arguments):arguments[0]);return Et.call(r,e)?r[e]:r[e]=n.apply(this,arguments)}},f.min=function(n,t,r){var e=1/0,u=e,o=-1,i=n?n.length:0;
u[r]=[o,n[o]]}return u},r.partial=function(n){return e(n,Br.call(arguments,1))},r.pick=function(n){for(var r=-1,t=hr.apply(cr,Br.call(arguments,1)),e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u},r.pluck=N,r.range=function(n,r,t){n=+n||0,t=+t||1,null==r&&(r=n,n=0);var e=-1;r=Er(0,vr((r-n)/t));for(var u=Array(r);++e<r;)u[e]=n,n+=t;return u},r.reject=function(n,r,t){return r=P(r,t),A(n,function(n,t,e){return!r(n,t,e)})},r.rest=$,r.shuffle=function(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0); if(t||typeof i!="number")t=J(t,r),F(n,function(n,r,o){r=t(n,r,o),r<e&&(e=r,u=n)});else for(;++o<i;)r=n[o],r<u&&(u=r);return u},f.omit=function(n){var t=v(),e=xt.apply(dt,zt.call(arguments,1)),u={};return r(n,function(n,r){0>t(e,r)&&(u[r]=n)}),u},f.once=function(n){var t,r;return function(){return t?r:(t=Q,r=n.apply(this,arguments),n=X,r)}},f.pairs=function(n){for(var t=-1,r=Vt(n),e=r.length,u=Array(e);++t<e;){var o=r[t];u[t]=[o,n[o]]}return u},f.partial=function(n){return l(n,zt.call(arguments,1))
return O(n,function(n){var t=yr(Nr()*(++r+1));e[r]=e[t],e[t]=n}),e},r.sortBy=function(n,r,e){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);for(r=P(r,e),O(n,function(n,t,e){i[++u]={a:r(n,t,e),b:u,c:n}}),o=i.length,i.sort(t);o--;)i[o]=i[o].c;return i},r.tap=function(n,r){return r(n),n},r.throttle=function(n,r){function t(){a=new Date,i=null,u=n.apply(o,e)}var e,u,o,i,a=0;return function(){var f=new Date,l=r-(f-a);return e=arguments,o=this,0<l?i||(i=br(t,l)):(gr(i),i=null,a=f,u=n.apply(o,e)),u },f.pick=function(n){for(var t=-1,r=xt.apply(dt,zt.call(arguments,1)),e=r.length,u={};++t<e;){var o=r[t];o in n&&(u[o]=n[o])}return u},f.pluck=D,f.range=function(n,t,r){n=+n||0,r=+r||1,t==X&&(t=n,n=0);var e=-1;t=Tt(0,wt((t-n)/r));for(var u=Array(t);++e<t;)u[e]=n,n+=r;return u},f.reject=function(n,t,r){return t=J(t,r),k(n,function(n,r,e){return!t(n,r,e)})},f.rest=V,f.shuffle=function(n){var t=-1,r=n?n.length:0,e=Array(typeof r=="number"?r:0);return F(n,function(n){var r=Ot(It()*(++t+1));e[t]=e[r],e[r]=n
}},r.times=function(n,r,t){for(var e=-1,u=Array(-1<n?n:0);++e<n;)u[e]=r.call(t,e);return u},r.toArray=function(n){return $r(n)?Br.call(n):n&&typeof n.length=="number"?E(n):d(n)},r.union=function(n){return $r(n)||(arguments[0]=n?Br.call(n):cr),z(hr.apply(cr,arguments))},r.uniq=z,r.values=d,r.where=F,r.without=function(n){return R(n,Br.call(arguments,1))},r.wrap=function(n,r){return function(){var t=[n];return _r.apply(t,arguments),r.apply(this,t)}},r.zip=function(n){for(var r=-1,t=n?S(N(arguments,"length")):0,e=Array(t);++r<t;)e[r]=N(arguments,r); }),e},f.sortBy=function(n,t,r){var e=-1,u=n?n.length:0,i=Array(typeof u=="number"?u:0);for(t=J(t,r),F(n,function(n,r,u){i[++e]={l:t(n,r,u),m:e,n:n}}),u=i.length,i.sort(o);u--;)i[u]=i[u].n;return i},f.tap=function(n,t){return t(n),n},f.throttle=function(n,t){function r(){i=new Date,a=X,u=n.apply(o,e)}var e,u,o,i=0,a=X;return function(){var f=new Date,c=t-(f-i);return e=arguments,o=this,0<c?a||(a=Nt(r,c)):(At(a),a=X,i=f,u=n.apply(o,e)),u}},f.times=function(n,t,r){for(var e=-1,u=Array(-1<n?n:0);++e<n;)u[e]=t.call(r,e);
return e},r.collect=E,r.drop=$,r.each=O,r.extend=c,r.methods=s,r.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]:u[o[0]]=o[1]}return u},r.select=A,r.tail=$,r.unique=z,r.clone=function(n){return m(n)?$r(n)?Br.call(n):c({},n):n},r.contains=j,r.escape=function(n){return null==n?"":(n+"").replace(Y,o)},r.every=w,r.find=x,r.findWhere=function(n,r){return F(n,r,!0)},r.has=function(n,r){return n?mr.call(n,r):!1},r.identity=U,r.indexOf=T,r.isArguments=l,r.isArray=$r,r.isBoolean=function(n){return!0===n||!1===n||dr.call(n)==tr return u},f.toArray=function(n){return Ut(n)?zt.call(n):n&&typeof n.length=="number"?q(n):E(n)},f.union=function(n){return Ut(n)||(arguments[0]=n?zt.call(n):dt),G(xt.apply(dt,arguments))},f.uniq=G,f.values=E,f.where=I,f.without=function(n){return z(n,zt.call(arguments,1))},f.wrap=function(n,t){return function(){var r=[n];return St.apply(r,arguments),t.apply(this,r)}},f.zip=function(n){for(var t=-1,r=n?R(D(arguments,"length")):0,e=Array(0>r?0:r);++t<r;)e[t]=D(arguments,t);return e},f.collect=q,f.drop=V,f.each=F,f.extend=y,f.methods=_,f.object=function(n,t){for(var r=-1,e=n?n.length:0,u={};++r<e;){var o=n[r];
},r.isDate=function(n){return dr.call(n)==er},r.isElement=function(n){return n?1===n.nodeType:!1},r.isEmpty=g,r.isEqual=h,r.isFinite=function(n){return Ar(n)&&!xr(parseFloat(n))},r.isFunction=y,r.isNaN=function(n){return _(n)&&n!=+n},r.isNull=function(n){return null===n},r.isNumber=_,r.isObject=m,r.isRegExp=function(n){return dr.call(n)==ir},r.isString=b,r.isUndefined=function(n){return typeof n=="undefined"},r.lastIndexOf=function(n,r,t){var e=n?n.length:0;for(typeof t=="number"&&(e=(0>t?Er(0,e+t):Sr(t,e-1))+1);e--;)if(n[e]===r)return e; t?u[o]=t[r]:u[o[0]]=o[1]}return u},f.select=k,f.tail=V,f.unique=G,f.chain=function(n){return n=new c(n),n.__chain__=Q,n},f.clone=function(n){return A(n)?Ut(n)?zt.call(n):y({},n):n},f.contains=S,f.escape=function(n){return n==X?"":(n+"").replace(ut,s)},f.every=N,f.find=B,f.has=function(n,t){return n?Et.call(n,t):Y},f.identity=K,f.indexOf=U,f.isArguments=h,f.isArray=Ut,f.isBoolean=function(n){return n===Q||n===Y||kt.call(n)==ft},f.isDate=function(n){return n?typeof n=="object"&&kt.call(n)==ct:Y},f.isElement=function(n){return n?1===n.nodeType:Y
return-1},r.mixin=V,r.noConflict=function(){return n._=pr,this},r.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r&&(r=n,n=0),n+yr(Nr()*((+r||0)-n+1))},r.reduce=B,r.reduceRight=k,r.result=function(n,r){var t=n?n[r]:null;return y(t)?n[r]():t},r.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:Fr(n).length},r.some=q,r.sortedIndex=I,r.template=function(n,t,e){n||(n=""),e=p({},e,r.templateSettings);var o=0,i="__p+='",a=e.variable;n.replace(RegExp((e.escape||X).source+"|"+(e.interpolate||X).source+"|"+(e.evaluate||X).source+"|$","g"),function(r,t,e,a,f){return i+=n.slice(o,f).replace(Z,u),t&&(i+="'+_['escape']("+t+")+'"),a&&(i+="';"+a+";__p+='"),e&&(i+="'+((__t=("+e+"))==null?'':__t)+'"),o=f+r.length,r },f.isEmpty=b,f.isEqual=j,f.isFinite=function(n){return Rt(n)&&!Dt(parseFloat(n))},f.isFunction=w,f.isNaN=function(n){return x(n)&&n!=+n},f.isNull=function(n){return n===X},f.isNumber=x,f.isObject=A,f.isRegExp=function(n){return!(!n||!gt[typeof n])&&kt.call(n)==st},f.isString=O,f.isUndefined=function(n){return typeof n=="undefined"},f.lastIndexOf=function(n,t,r){var e=n?n.length:0;for(typeof r=="number"&&(e=(0>r?Tt(0,e+r):$t(r,e-1))+1);e--;)if(n[e]===t)return e;return-1},f.mixin=L,f.noConflict=function(){return n._=bt,this
}),i+="';\n",a||(a="obj",i="with("+a+"||{}){"+i+"}"),i="function("+a+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+i+"return __p}";try{var f=Function("_","return "+i)(r)}catch(l){throw l.source=i,l}return t?f(t):(f.source=i,f)},r.unescape=function(n){return null==n?"":(n+"").replace(Q,f)},r.uniqueId=function(n){var r=++J+"";return n?n+r:r},r.all=w,r.any=q,r.detect=x,r.foldl=B,r.foldr=k,r.include=j,r.inject=B,r.first=D,r.last=function(n,r,t){if(n){var e=0,u=n.length; },f.random=function(n,t){n==X&&t==X&&(t=1),n=+n||0,t==X?(t=n,n=0):t=+t||0;var r=It();return n%1||t%1?n+$t(r*(t-n+parseFloat("1e-"+((r+"").length-1))),t):n+Ot(r*(t-n+1))},f.reduce=M,f.reduceRight=T,f.result=function(n,t){var r=n?n[t]:X;return w(r)?n[t]():r},f.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Vt(n).length},f.some=$,f.sortedIndex=W,f.template=function(n,t,r){var e=f.templateSettings;n||(n=""),r=m({},r,e);var u=0,o="__p+='",e=r.variable;n.replace(RegExp((r.escape||et).source+"|"+(r.interpolate||et).source+"|"+(r.evaluate||et).source+"|$","g"),function(t,r,e,a,f){return o+=n.slice(u,f).replace(ot,i),r&&(o+="'+_['escape']("+r+")+'"),a&&(o+="';"+a+";__p+='"),e&&(o+="'+((__t=("+e+"))==null?'':__t)+'"),u=f+t.length,t
if(typeof r!="number"&&null!=r){var o=u;for(r=P(r,t);o--&&r(n[o],o,n);)e++}else if(e=r,null==e||t)return n[u-1];return Br.call(n,Er(0,u-e))}},r.take=D,r.head=D,r.chain=function(n){return n=new i(n),n.__chain__=!0,n},r.VERSION="1.2.0",V(r),r.prototype.chain=function(){return this.__chain__=!0,this},r.prototype.value=function(){return this.__wrapped__},O("pop push reverse shift sort splice unshift".split(" "),function(n){var t=cr[n];r.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),!qr.spliceObjects&&0===n.length&&delete n[0],this }),o+="';\n",e||(e="obj",o="with("+e+"||{}){"+o+"}"),o="function("+e+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+o+"return __p}";try{var a=Function("_","return "+o)(f)}catch(c){throw c.source=o,c}return t?a(t):(a.source=o,a)},f.unescape=function(n){return n==X?"":(n+"").replace(rt,g)},f.uniqueId=function(n){var t=++Z+"";return n?n+t:t},f.all=N,f.any=$,f.detect=B,f.findWhere=function(n,t){return I(n,t,Q)},f.foldl=M,f.foldr=T,f.include=S,f.inject=M,f.first=C,f.last=function(n,t,r){if(n){var e=0,u=n.length;
}}),O(["concat","join","slice"],function(n){var t=cr[n];r.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new i(n),n.__chain__=!0),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=r,define(function(){return r})):W&&!W.nodeType?G?(G.exports=r)._=r:W._=r:n._=r})(this); if(typeof t!="number"&&t!=X){var o=u;for(t=J(t,r);o--&&t(n[o],o,n);)e++}else if(e=t,e==X||r)return n[u-1];return zt.call(n,Tt(0,u-e))}},f.take=C,f.head=C,f.VERSION="1.3.1",L(f),f.prototype.chain=function(){return this.__chain__=Q,this},f.prototype.value=function(){return this.__wrapped__},F("pop push reverse shift sort splice unshift".split(" "),function(n){var t=dt[n];f.prototype[n]=function(){var n=this.__wrapped__;return t.apply(n,arguments),!Pt.spliceObjects&&0===n.length&&delete n[0],this}}),F(["concat","join","slice"],function(n){var t=dt[n];
f.prototype[n]=function(){var n=t.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new c(n),n.__chain__=Q),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(n._=f, define(function(){return f})):yt&&!yt.nodeType?mt?(mt.exports=f)._=f:yt._=f:n._=f}(this);

File diff suppressed because it is too large Load Diff

View File

@@ -21,9 +21,9 @@
// generate Markdown // generate Markdown
$markdown = docdown(array( $markdown = docdown(array(
'path' => '../' . $file, 'path' => '../' . $file,
'title' => 'Lo-Dash <sup>v1.2.0</sup>', 'title' => 'Lo-Dash <sup>v1.3.1</sup>',
'toc' => 'categories', 'toc' => 'categories',
'url' => 'https://github.com/bestiejs/lodash/blob/master/lodash.js' 'url' => 'https://github.com/lodash/lodash/blob/1.3.1/lodash.js'
)); ));
// save to a .md file // save to a .md file
@@ -33,4 +33,4 @@
header('Content-Type: text/plain;charset=utf-8'); header('Content-Type: text/plain;charset=utf-8');
echo $markdown . PHP_EOL; echo $markdown . PHP_EOL;
?> ?>

View File

@@ -1 +1 @@
module.exports = require('./lodash'); module.exports = require('./dist/lodash.compat.js');

1334
lodash.js

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
{ {
"name": "lodash", "name": "lodash",
"version": "1.2.0", "version": "1.3.1",
"description": "A low-level utility library delivering consistency, customization, performance, and extra features.", "description": "A low-level utility library delivering consistency, customization, performance, and extra features.",
"homepage": "http://lodash.com", "homepage": "http://lodash.com/",
"license": "MIT", "license": "MIT",
"main": "./dist/lodash.js", "main": "./dist/lodash.js",
"keywords": [ "keywords": [
@@ -34,6 +34,29 @@
"rhino" "rhino"
], ],
"jam": { "jam": {
"main": "./lodash.js" "main": "./dist/lodash.compat.js"
},
"volo": {
"type": "directory",
"ignore": [
".*",
"*.custom.*",
"*.template.*",
"*.d.ts",
"*.map",
"*.md",
"*.txt",
"build.js",
"lodash.js",
"index.js",
"bower.json",
"component.json",
"build",
"doc",
"node_modules",
"perf",
"test",
"vendor"
]
} }
} }

View File

@@ -34,13 +34,13 @@
<script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script> <script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
<script src="perf-ui.js"></script> <script src="perf-ui.js"></script>
<script> <script>
document.write('<script src="../' + ui.buildPath + '"><\/script>'); document.write('<script src="' + ui.buildPath + '"><\/script>');
</script> </script>
<script> <script>
var lodash = _.noConflict(); var lodash = _.noConflict();
</script> </script>
<script> <script>
document.write('<script src="../' + ui.otherPath + '"><\/script>'); document.write('<script src="' + ui.otherPath + '"><\/script>');
</script> </script>
<script src="perf.js"></script> <script src="perf.js"></script>
<script> <script>

View File

@@ -1,6 +1,9 @@
;(function(window) { ;(function(window) {
'use strict'; 'use strict';
/** The base path of the builds */
var basePath = '../';
/** The Lo-Dash build to load */ /** The Lo-Dash build to load */
var build = (/build=([^&]+)/.exec(location.search) || [])[1]; var build = (/build=([^&]+)/.exec(location.search) || [])[1];
@@ -33,26 +36,38 @@
// expose Lo-Dash build file path // expose Lo-Dash build file path
ui.buildPath = (function() { ui.buildPath = (function() {
var result;
switch (build) { switch (build) {
case 'lodash-dev': return 'dist/lodash.compat.js'; case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
case 'lodash-modern': return 'dist/lodash.min.js'; case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
case 'lodash-underscore': return 'dist/lodash.underscore.min.js'; case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
case 'lodash-custom': return 'lodash.custom.min.js'; case 'lodash-underscore': result = 'dist/lodash.underscore.min.js'; break;
case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
case 'lodash-custom': result = 'lodash.custom.min.js'; break;
case 'lodash-modern':
case undefined: result = 'dist/lodash.min.js'; break;
default: result = build;
} }
return 'dist/lodash.compat.min.js'; return result == build ? result : (basePath + result);
}()); }());
// expose other library file path // expose other library file path
ui.otherPath = (function() { ui.otherPath = (function() {
var result;
switch (other) { switch (other) {
case 'lodash-dev': return 'dist/lodash.compat.js'; case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
case 'lodash-prod': return 'dist/lodash.compat.min.js'; case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
case 'lodash-modern': return 'dist/lodash.min.js'; case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
case 'lodash-underscore': return 'dist/lodash.underscore.min.js'; case 'lodash-modern': result = 'dist/lodash.min.js'; break;
case 'lodash-custom': return 'lodash.custom.min.js'; case 'lodash-underscore': result = 'dist/lodash.underscore.min.js'; break;
case 'underscore-dev': return 'vendor/underscore/underscore.js'; case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
case 'lodash-custom': result = 'lodash.custom.min.js'; break;
case 'underscore-dev': result = 'vendor/underscore/underscore.js'; break;
case 'underscore':
case undefined: result = 'vendor/underscore/underscore-min.js'; break;
default: result = other;
} }
return 'vendor/underscore/underscore-min.js'; return result == other ? result : (basePath + result);
}()); }());
// initialize controls // initialize controls
@@ -76,11 +91,13 @@
span1.innerHTML = span1.innerHTML =
'<label for="perf-build">Build: </label>' + '<label for="perf-build">Build: </label>' +
'<select id="perf-build">' + '<select id="perf-build">' +
'<option value="lodash-dev">Lo-Dash</option>' + '<option value="lodash-compat">Lo-Dash (compat)</option>' +
'<option value="lodash-prod">Lo-Dash (minified)</option>' + '<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
'<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
'<option value="lodash-modern">Lo-Dash (modern)</option>' + '<option value="lodash-modern">Lo-Dash (modern)</option>' +
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' + '<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
'<option value="lodash-custom">Lo-Dash (custom)</option>' + '<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
'</select>'; '</select>';
var span2 = document.createElement('span'); var span2 = document.createElement('span');
@@ -88,13 +105,15 @@
span2.innerHTML = span2.innerHTML =
'<label for="perf-other">Other Library: </label>' + '<label for="perf-other">Other Library: </label>' +
'<select id="perf-other">' + '<select id="perf-other">' +
'<option value="underscore-dev">Underscore</option>' + '<option value="underscore-dev">Underscore (development)</option>' +
'<option value="underscore-prod">Underscore (minified)</option>' + '<option value="underscore">Underscore (production)</option>' +
'<option value="lodash-dev">Lo-Dash</option>' + '<option value="lodash-compat">Lo-Dash (compat)</option>' +
'<option value="lodash-prod">Lo-Dash (minified)</option>' + '<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
'<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
'<option value="lodash-modern">Lo-Dash (modern)</option>' + '<option value="lodash-modern">Lo-Dash (modern)</option>' +
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' + '<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
'<option value="lodash-custom">Lo-Dash (custom)</option>' + '<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
'</select>'; '</select>';
var buildList = span1.lastChild, var buildList = span1.lastChild,
@@ -106,24 +125,32 @@
buildList.selectedIndex = (function() { buildList.selectedIndex = (function() {
switch (build) { switch (build) {
case 'lodash-dev': return 0; case 'lodash-compat': return 0;
case 'lodash-modern': return 2; case 'lodash-legacy': return 1;
case 'lodash-underscore': return 3; case 'lodash-mobile': return 2;
case 'lodash-custom': return 4; case 'lodash-underscore': return 4;
case 'lodash-custom-dev': return 5;
case 'lodash-custom': return 6;
case 'lodash-modern':
case undefined: return 3;
} }
return 1; return -1;
}()); }());
otherList.selectedIndex = (function() { otherList.selectedIndex = (function() {
switch (other) { switch (other) {
case 'underscore-dev': return 0; case 'underscore-dev': return 0;
case 'lodash-dev': return 2; case 'lodash-compat': return 2;
case 'lodash-prod': return 3; case 'lodash-legacy': return 3;
case 'lodash-modern': return 4; case 'lodash-mobile': return 4;
case 'lodash-underscore': return 5; case 'lodash-modern': return 5;
case 'lodash-custom': return 6; case 'lodash-underscore': return 6;
case 'lodash-custom-dev': return 7;
case 'lodash-custom': return 8;
case 'underscore':
case undefined: return 1;
} }
return 1; return -1;
}()); }());
addListener(buildList, 'change', eventHandler); addListener(buildList, 'change', eventHandler);

View File

@@ -58,7 +58,7 @@
var reSpecialChars = /[.*+?^=!:${}()|[\]\/\\]/g; var reSpecialChars = /[.*+?^=!:${}()|[\]\/\\]/g;
/** Used to score performance */ /** Used to score performance */
var score = { 'a': 0, 'b': 0 }; var score = { 'a': [], 'b': [] };
/** Used to queue benchmark suites */ /** Used to queue benchmark suites */
var suites = []; var suites = [];
@@ -67,16 +67,16 @@
var toString = Object.prototype.toString; var toString = Object.prototype.toString;
/** The `ui` object */ /** The `ui` object */
var ui = window.ui || ({ var ui = window.ui || (window.ui = {
'buildPath': basename(filePath, '.js'), 'buildPath': basename(filePath, '.js'),
'otherPath': 'underscore' 'otherPath': 'underscore'
}); });
/** The Lo-Dash build basename */ /** The Lo-Dash build basename */
var buildName = basename(ui.buildPath, '.js'); var buildName = window.buildName = basename(ui.buildPath, '.js');
/** The other library basename */ /** The other library basename */
var otherName = basename(ui.otherPath, '.js'); var otherName = window.otherName = basename(ui.otherPath, '.js');
/** Detect if in a browser environment */ /** Detect if in a browser environment */
var isBrowser = isHostType(window, 'document') && isHostType(window, 'navigator'); var isBrowser = isHostType(window, 'document') && isHostType(window, 'navigator');
@@ -105,6 +105,20 @@
: result.replace(RegExp(extension.replace(reSpecialChars, '\\$&') + '$'), ''); : result.replace(RegExp(extension.replace(reSpecialChars, '\\$&') + '$'), '');
} }
/**
* Computes the geometric mean (log-average) of an array of values.
* See http://en.wikipedia.org/wiki/Geometric_mean#Relationship_with_arithmetic_mean_of_logarithms.
*
* @private
* @param {Array} array The array of values.
* @returns {Number} The geometric mean.
*/
function getGeometricMean(array) {
return Math.pow(Math.E, lodash.reduce(array, function(sum, x) {
return sum + Math.log(x);
}, 0) / array.length) || 0;
}
/** /**
* Gets the Hz, i.e. operations per second, of `bench` adjusted for the * Gets the Hz, i.e. operations per second, of `bench` adjusted for the
* margin of error. * margin of error.
@@ -174,22 +188,24 @@
log(event.target); log(event.target);
}, },
'onComplete': function() { 'onComplete': function() {
var formatNumber = Benchmark.formatNumber,
fastest = this.filter('fastest'),
fastestHz = getHz(fastest[0]),
slowest = this.filter('slowest'),
slowestHz = getHz(slowest[0]),
aHz = getHz(this[0]),
bHz = getHz(this[1]);
for (var index = 0, length = this.length; index < length; index++) { for (var index = 0, length = this.length; index < length; index++) {
var bench = this[index]; var bench = this[index];
if (bench.error) { if (bench.error) {
var errored = true; var errored = true;
log(bench.error);
} }
} }
if (!errored) { if (errored) {
log('There was a problem, skipping...');
}
else {
var formatNumber = Benchmark.formatNumber,
fastest = this.filter('fastest'),
fastestHz = getHz(fastest[0]),
slowest = this.filter('slowest'),
slowestHz = getHz(slowest[0]),
aHz = getHz(this[0]),
bHz = getHz(this[1]);
if (fastest.length > 1) { if (fastest.length > 1) {
log('It\'s too close to call.'); log('It\'s too close to call.');
aHz = bHz = slowestHz; aHz = bHz = slowestHz;
@@ -204,8 +220,8 @@
); );
} }
// add score adjusted for margin of error // add score adjusted for margin of error
score.a += aHz; score.a.push(aHz);
score.b += bHz; score.b.push(bHz);
} }
// remove current suite from queue // remove current suite from queue
suites.shift(); suites.shift();
@@ -215,14 +231,16 @@
suites[0].run({ 'async': !isJava }); suites[0].run({ 'async': !isJava });
} }
else { else {
var fastestTotalHz = Math.max(score.a, score.b), var aMeanHz = getGeometricMean(score.a),
slowestTotalHz = Math.min(score.a, score.b), bMeanHz = getGeometricMean(score.b),
totalPercent = formatNumber(Math.round(((fastestTotalHz / slowestTotalHz) - 1) * 100)), fastestMeanHz = Math.max(aMeanHz, bMeanHz),
totalX = fastestTotalHz / slowestTotalHz, slowestMeanHz = Math.min(aMeanHz, bMeanHz),
message = 'is ' + totalPercent + '% ' + (totalX == 1 ? '' : '(' + formatNumber(totalX.toFixed(2)) + 'x) ') + 'faster than'; xFaster = fastestMeanHz / slowestMeanHz,
percentFaster = formatNumber(Math.round((xFaster - 1) * 100)),
message = 'is ' + percentFaster + '% ' + (xFaster == 1 ? '' : '(' + formatNumber(xFaster.toFixed(2)) + 'x) ') + 'faster than';
// report results // report results
if (score.a >= score.b) { if (aMeanHz >= bMeanHz) {
log('\n' + buildName + ' ' + message + ' ' + otherName + '.'); log('\n' + buildName + ' ' + message + ' ' + otherName + '.');
} else { } else {
log('\n' + otherName + ' ' + message + ' ' + buildName + '.'); log('\n' + otherName + ' ' + message + ' ' + buildName + '.');
@@ -238,7 +256,7 @@
'setup': '\ 'setup': '\
var _ = window._,\ var _ = window._,\
lodash = window.lodash,\ lodash = window.lodash,\
belt = this.name == "Lo-Dash" ? lodash : _;\ belt = this.name == buildName ? lodash : _;\
\ \
var index,\ var index,\
date = new Date,\ date = new Date,\
@@ -273,13 +291,17 @@
}\ }\
\ \
if (typeof bindAll != "undefined") {\ if (typeof bindAll != "undefined") {\
var bindAllObjects = Array(this.count),\ var bindAllCount = -1,\
funcNames = belt.functions(lodash);\ bindAllObjects = Array(this.count);\
\
var funcNames = belt.reject(belt.functions(belt).slice(0, 40), function(funcName) {\
return /^_/.test(funcName);\
});\
\ \
// potentially expensive\n\ // potentially expensive\n\
for (index = 0; index < this.count; index++) {\ for (index = 0; index < this.count; index++) {\
bindAllObjects[index] = belt.reduce(funcNames, function(object, funcName) {\ bindAllObjects[index] = belt.reduce(funcNames, function(object, funcName) {\
object[funcName] = lodash[funcName];\ object[funcName] = belt[funcName];\
return object;\ return object;\
}, {});\ }, {});\
}\ }\
@@ -624,11 +646,11 @@
suites.push( suites.push(
Benchmark.Suite('`_.bindAll` iterating arguments') Benchmark.Suite('`_.bindAll` iterating arguments')
.add(buildName, { .add(buildName, {
'fn': 'lodash.bindAll.apply(lodash, [bindAllObjects.pop()].concat(funcNames))', 'fn': 'lodash.bindAll.apply(lodash, [bindAllObjects[++bindAllCount]].concat(funcNames))',
'teardown': 'function bindAll(){}' 'teardown': 'function bindAll(){}'
}) })
.add(otherName, { .add(otherName, {
'fn': '_.bindAll.apply(_, [bindAllObjects.pop()].concat(funcNames))', 'fn': '_.bindAll.apply(_, [bindAllObjects[++bindAllCount]].concat(funcNames))',
'teardown': 'function bindAll(){}' 'teardown': 'function bindAll(){}'
}) })
); );
@@ -636,11 +658,11 @@
suites.push( suites.push(
Benchmark.Suite('`_.bindAll` iterating the `object`') Benchmark.Suite('`_.bindAll` iterating the `object`')
.add(buildName, { .add(buildName, {
'fn': 'lodash.bindAll(bindAllObjects.pop())', 'fn': 'lodash.bindAll(bindAllObjects[++bindAllCount])',
'teardown': 'function bindAll(){}' 'teardown': 'function bindAll(){}'
}) })
.add(otherName, { .add(otherName, {
'fn': '_.bindAll(bindAllObjects.pop())', 'fn': '_.bindAll(bindAllObjects[++bindAllCount])',
'teardown': 'function bindAll(){}' 'teardown': 'function bindAll(){}'
}) })
); );
@@ -753,6 +775,18 @@
) )
); );
suites.push(
Benchmark.Suite('`_.difference` iterating 75 elements')
.add(buildName, {
'fn': 'lodash.difference(seventyFiveValues, seventyFiveValues2)',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.difference(seventyFiveValues, seventyFiveValues2)',
'teardown': 'function multiArrays(){}'
})
);
suites.push( suites.push(
Benchmark.Suite('`_.difference` iterating 200 elements') Benchmark.Suite('`_.difference` iterating 200 elements')
.add(buildName, { .add(buildName, {
@@ -1032,22 +1066,14 @@
suites.push( suites.push(
Benchmark.Suite('`_.indexOf`') Benchmark.Suite('`_.indexOf`')
.add(buildName, '\ .add(buildName, {
lodash.indexOf(numbers, 9)' 'fn': 'lodash.indexOf(twoHundredValues, 199)',
) 'teardown': 'function multiArrays(){}'
.add(otherName, '\ })
_.indexOf(numbers, 9)' .add(otherName, {
) 'fn': '_.indexOf(twoHundredValues, 199)',
); 'teardown': 'function multiArrays(){}'
})
suites.push(
Benchmark.Suite('`_.indexOf` with `isSorted`')
.add(buildName, '\
lodash.indexOf(numbers, 19, true)'
)
.add(otherName, '\
_.indexOf(numbers, 19, true)'
)
); );
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
@@ -1062,6 +1088,18 @@
) )
); );
suites.push(
Benchmark.Suite('`_.intersection` iterating 75 elements')
.add(buildName, {
'fn': 'lodash.intersection(seventyFiveValues, seventyFiveValues2)',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.intersection(seventyFiveValues, seventyFiveValues2)',
'teardown': 'function multiArrays(){}'
})
);
suites.push( suites.push(
Benchmark.Suite('`_.intersection` iterating 200 elements') Benchmark.Suite('`_.intersection` iterating 200 elements')
.add(buildName, { .add(buildName, {
@@ -1137,13 +1175,13 @@
.add(buildName, { .add(buildName, {
'fn': '\ 'fn': '\
lodash.isEqual(numbers, numbers2);\ lodash.isEqual(numbers, numbers2);\
lodash.isEqual(twoNumbers, twoNumbers2);', lodash.isEqual(twoNumbers, twoNumbers2)',
'teardown': 'function isEqual(){}' 'teardown': 'function isEqual(){}'
}) })
.add(otherName, { .add(otherName, {
'fn': '\ 'fn': '\
_.isEqual(numbers, numbers2);\ _.isEqual(numbers, numbers2);\
_.isEqual(twoNumbers, twoNumbers2);', _.isEqual(twoNumbers, twoNumbers2)',
'teardown': 'function isEqual(){}' 'teardown': 'function isEqual(){}'
}) })
); );
@@ -1153,13 +1191,13 @@
.add(buildName, { .add(buildName, {
'fn': '\ 'fn': '\
lodash.isEqual(nestedNumbers, nestedNumbers2);\ lodash.isEqual(nestedNumbers, nestedNumbers2);\
lodash.isEqual(nestedNumbers2, nestedNumbers3);', lodash.isEqual(nestedNumbers2, nestedNumbers3)',
'teardown': 'function isEqual(){}' 'teardown': 'function isEqual(){}'
}) })
.add(otherName, { .add(otherName, {
'fn': '\ 'fn': '\
_.isEqual(nestedNumbers, nestedNumbers2);\ _.isEqual(nestedNumbers, nestedNumbers2);\
_.isEqual(nestedNumbers2, nestedNumbers3);', _.isEqual(nestedNumbers2, nestedNumbers3)',
'teardown': 'function isEqual(){}' 'teardown': 'function isEqual(){}'
}) })
); );
@@ -1169,13 +1207,13 @@
.add(buildName, { .add(buildName, {
'fn': '\ 'fn': '\
lodash.isEqual(objects, objects2);\ lodash.isEqual(objects, objects2);\
lodash.isEqual(simpleObjects, simpleObjects2);', lodash.isEqual(simpleObjects, simpleObjects2)',
'teardown': 'function isEqual(){}' 'teardown': 'function isEqual(){}'
}) })
.add(otherName, { .add(otherName, {
'fn': '\ 'fn': '\
_.isEqual(objects, objects2);\ _.isEqual(objects, objects2);\
_.isEqual(simpleObjects, simpleObjects2);', _.isEqual(simpleObjects, simpleObjects2)',
'teardown': 'function isEqual(){}' 'teardown': 'function isEqual(){}'
}) })
); );
@@ -1185,13 +1223,13 @@
.add(buildName, { .add(buildName, {
'fn': '\ 'fn': '\
lodash.isEqual(object, object2);\ lodash.isEqual(object, object2);\
lodash.isEqual(simpleObject, simpleObject2);', lodash.isEqual(simpleObject, simpleObject2)',
'teardown': 'function isEqual(){}' 'teardown': 'function isEqual(){}'
}) })
.add(otherName, { .add(otherName, {
'fn': '\ 'fn': '\
_.isEqual(object, object2);\ _.isEqual(object, object2);\
_.isEqual(simpleObject, simpleObject2);', _.isEqual(simpleObject, simpleObject2)',
'teardown': 'function isEqual(){}' 'teardown': 'function isEqual(){}'
}) })
); );
@@ -1199,7 +1237,7 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
suites.push( suites.push(
Benchmark.Suite('`_.isArguments`, `_.isDate`, `_.isFunction`, `_.isNumber`, `_.isRegExp`') Benchmark.Suite('`_.isArguments`, `_.isDate`, `_.isFunction`, `_.isNumber`, `_.isObject`, `_.isRegExp`')
.add(buildName, '\ .add(buildName, '\
lodash.isArguments(arguments);\ lodash.isArguments(arguments);\
lodash.isArguments(object);\ lodash.isArguments(object);\
@@ -1209,8 +1247,10 @@
lodash.isFunction(object);\ lodash.isFunction(object);\
lodash.isNumber(1);\ lodash.isNumber(1);\
lodash.isNumber(object);\ lodash.isNumber(object);\
lodash.isObject(object);\
lodash.isObject(1);\
lodash.isRegExp(regexp);\ lodash.isRegExp(regexp);\
lodash.isRegExp(object);' lodash.isRegExp(object)'
) )
.add(otherName, '\ .add(otherName, '\
_.isArguments(arguments);\ _.isArguments(arguments);\
@@ -1221,8 +1261,10 @@
_.isFunction(object);\ _.isFunction(object);\
_.isNumber(1);\ _.isNumber(1);\
_.isNumber(object);\ _.isNumber(object);\
_.isObject(object);\
_.isObject(1);\
_.isRegExp(regexp);\ _.isRegExp(regexp);\
_.isRegExp(object);' _.isRegExp(object)'
) )
); );
@@ -1386,13 +1428,13 @@
lodash.reduce(numbers, function(result, value, index) {\ lodash.reduce(numbers, function(result, value, index) {\
result[index] = value;\ result[index] = value;\
return result;\ return result;\
}, {});' }, {})'
) )
.add(otherName, '\ .add(otherName, '\
_.reduce(numbers, function(result, value, index) {\ _.reduce(numbers, function(result, value, index) {\
result[index] = value;\ result[index] = value;\
return result;\ return result;\
}, {});' }, {})'
) )
); );
@@ -1402,13 +1444,13 @@
lodash.reduce(object, function(result, value, key) {\ lodash.reduce(object, function(result, value, key) {\
result.push(key, value);\ result.push(key, value);\
return result;\ return result;\
}, []);' }, [])'
) )
.add(otherName, '\ .add(otherName, '\
_.reduce(object, function(result, value, key) {\ _.reduce(object, function(result, value, key) {\
result.push(key, value);\ result.push(key, value);\
return result;\ return result;\
}, []);' }, [])'
) )
); );
@@ -1420,13 +1462,13 @@
lodash.reduceRight(numbers, function(result, value, index) {\ lodash.reduceRight(numbers, function(result, value, index) {\
result[index] = value;\ result[index] = value;\
return result;\ return result;\
}, {});' }, {})'
) )
.add(otherName, '\ .add(otherName, '\
_.reduceRight(numbers, function(result, value, index) {\ _.reduceRight(numbers, function(result, value, index) {\
result[index] = value;\ result[index] = value;\
return result;\ return result;\
}, {});' }, {})'
) )
); );
@@ -1436,13 +1478,13 @@
lodash.reduceRight(object, function(result, value, key) {\ lodash.reduceRight(object, function(result, value, key) {\
result.push(key, value);\ result.push(key, value);\
return result;\ return result;\
}, []);' }, [])'
) )
.add(otherName, '\ .add(otherName, '\
_.reduceRight(object, function(result, value, key) {\ _.reduceRight(object, function(result, value, key) {\
result.push(key, value);\ result.push(key, value);\
return result;\ return result;\
}, []);' }, [])'
) )
); );
@@ -1594,16 +1636,6 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
suites.push(
Benchmark.Suite('`_.sortedIndex`')
.add(buildName, '\
lodash.sortedIndex(numbers, 25)'
)
.add(otherName, '\
_.sortedIndex(numbers, 25)'
)
);
suites.push( suites.push(
Benchmark.Suite('`_.sortedIndex` with `callback`') Benchmark.Suite('`_.sortedIndex` with `callback`')
.add(buildName, { .add(buildName, {
@@ -1723,11 +1755,23 @@
suites.push( suites.push(
Benchmark.Suite('`_.union` iterating an array of 75 elements') Benchmark.Suite('`_.union` iterating an array of 75 elements')
.add(buildName, { .add(buildName, {
'fn': 'lodash.union(fiftyValues, twentyFiveValues2);', 'fn': 'lodash.union(twentyFiveValues, fiftyValues2)',
'teardown': 'function multiArrays(){}' 'teardown': 'function multiArrays(){}'
}) })
.add(otherName, { .add(otherName, {
'fn': '_.union(fiftyValues, twentyFiveValues2);', 'fn': '_.union(twentyFiveValues, fiftyValues2)',
'teardown': 'function multiArrays(){}'
})
);
suites.push(
Benchmark.Suite('`_.union` iterating an array of 200 elements')
.add(buildName, {
'fn': 'lodash.union(oneHundredValues, oneHundredValues2)',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.union(oneHundredValues, oneHundredValues2)',
'teardown': 'function multiArrays(){}' 'teardown': 'function multiArrays(){}'
}) })
); );
@@ -1749,7 +1793,7 @@
.add(buildName, '\ .add(buildName, '\
lodash.uniq(numbers.concat(twoNumbers, fourNumbers), function(num) {\ lodash.uniq(numbers.concat(twoNumbers, fourNumbers), function(num) {\
return num % 2;\ return num % 2;\
});' })'
) )
.add(otherName, '\ .add(otherName, '\
_.uniq(numbers.concat(twoNumbers, fourNumbers), function(num) {\ _.uniq(numbers.concat(twoNumbers, fourNumbers), function(num) {\
@@ -1759,13 +1803,25 @@
); );
suites.push( suites.push(
Benchmark.Suite('`_.uniq` iterating an array of 200 elements') Benchmark.Suite('`_.uniq` iterating an array of 75 elements')
.add(buildName, { .add(buildName, {
'fn': 'lodash.uniq(oneHundredValues.concat(oneHundredValues2));', 'fn': 'lodash.uniq(twentyFiveValues.concat(fiftyValues2))',
'teardown': 'function multiArrays(){}' 'teardown': 'function multiArrays(){}'
}) })
.add(otherName, { .add(otherName, {
'fn': '_.uniq(oneHundredValues.concat(oneHundredValues2));', 'fn': '_.uniq(twentyFiveValues.concat(fiftyValues2))',
'teardown': 'function multiArrays(){}'
})
);
suites.push(
Benchmark.Suite('`_.uniq` iterating an array of 200 elements')
.add(buildName, {
'fn': 'lodash.uniq(oneHundredValues.concat(oneHundredValues2))',
'teardown': 'function multiArrays(){}'
})
.add(otherName, {
'fn': '_.uniq(oneHundredValues.concat(oneHundredValues2))',
'teardown': 'function multiArrays(){}' 'teardown': 'function multiArrays(){}'
}) })
); );
@@ -1775,11 +1831,11 @@
suites.push( suites.push(
Benchmark.Suite('`_.unzip`') Benchmark.Suite('`_.unzip`')
.add(buildName, { .add(buildName, {
'fn': 'lodash.unzip(zipped);', 'fn': 'lodash.unzip(zipped)',
'teardown': 'function zip(){}' 'teardown': 'function zip(){}'
}) })
.add(otherName, { .add(otherName, {
'fn': '_.unzip(zipped);', 'fn': '_.unzip(zipped)',
'teardown': 'function zip(){}' 'teardown': 'function zip(){}'
}) })
); );
@@ -1801,11 +1857,11 @@
suites.push( suites.push(
Benchmark.Suite('`_.where`') Benchmark.Suite('`_.where`')
.add(buildName, { .add(buildName, {
'fn': 'lodash.where(objects, whereObject);', 'fn': 'lodash.where(objects, whereObject)',
'teardown': 'function where(){}' 'teardown': 'function where(){}'
}) })
.add(otherName, { .add(otherName, {
'fn': '_.where(objects, whereObject);', 'fn': '_.where(objects, whereObject)',
'teardown': 'function where(){}' 'teardown': 'function where(){}'
}) })
); );
@@ -1827,11 +1883,11 @@
suites.push( suites.push(
Benchmark.Suite('`_.zip`') Benchmark.Suite('`_.zip`')
.add(buildName, { .add(buildName, {
'fn': 'lodash.zip.apply(lodash, unzipped);', 'fn': 'lodash.zip.apply(lodash, unzipped)',
'teardown': 'function zip(){}' 'teardown': 'function zip(){}'
}) })
.add(otherName, { .add(otherName, {
'fn': '_.zip.apply(_, unzipped);', 'fn': '_.zip.apply(_, unzipped)',
'teardown': 'function zip(){}' 'teardown': 'function zip(){}'
}) })
); );

View File

@@ -33,13 +33,6 @@
'debounce': lodash.debounce, 'debounce': lodash.debounce,
'defer': lodash.defer 'defer': lodash.defer
}); });
if (!_.chain) {
_.mixin({
'chain': function(value) {
return new _(value);
}
});
}
</script> </script>
<script src="../vendor/backbone/backbone.js"></script> <script src="../vendor/backbone/backbone.js"></script>
<script src="../vendor/backbone/test/environment.js"></script> <script src="../vendor/backbone/test/environment.js"></script>

0
test/run-test.sh Executable file → Normal file
View File

View File

@@ -1 +1 @@
Hello {{ name }}! Hallå {{ name }}!

View File

@@ -6,7 +6,7 @@
var vm = require('vm'); var vm = require('vm');
/** Load other modules */ /** Load other modules */
var _ = require('../lodash.js'), var _ = require('../dist/lodash.js'),
build = require('../build.js'), build = require('../build.js'),
minify = require('../build/minify.js'), minify = require('../build/minify.js'),
util = require('../build/util.js'); util = require('../build/util.js');
@@ -89,13 +89,13 @@
'zipObject': ['object'] 'zipObject': ['object']
}; };
/** List of all Lo-Dash methods */ /** List of all methods */
var lodashMethods = _.functions(_).filter(function(methodName) { var allMethods = _.functions(_).filter(function(methodName) {
return !/^_/.test(methodName); return !/^_/.test(methodName);
}); });
/** List of all methods */ /** List of all Lo-Dash methods */
var allMethods = lodashMethods.concat('chain', 'findWhere'); var lodashMethods = _.without(allMethods, 'findWhere');
/** List of "Arrays" category methods */ /** List of "Arrays" category methods */
var arraysMethods = [ var arraysMethods = [
@@ -225,6 +225,7 @@
'omit', 'omit',
'pairs', 'pairs',
'pick', 'pick',
'transform',
'values' 'values'
]; ];
@@ -316,6 +317,7 @@
'parseInt', 'parseInt',
'partialRight', 'partialRight',
'runInContext', 'runInContext',
'transform',
'unzip' 'unzip'
]; ];
@@ -332,7 +334,7 @@
* @returns {String} Returns the capitalized string. * @returns {String} Returns the capitalized string.
*/ */
function capitalize(string) { function capitalize(string) {
return string[0].toUpperCase() + string.toLowerCase().slice(1); return string[0].toUpperCase() + string.slice(1);
} }
/** /**
@@ -461,7 +463,7 @@
func(array, 'slice'); func(array, 'slice');
func(object, 'toFixed'); func(object, 'toFixed');
} }
else if (methodName == 'where') { else if (methodName == 'findWhere' || methodName == 'where') {
func(array, object); func(array, object);
func(object, object); func(object, object);
} }
@@ -650,7 +652,7 @@
vm.runInContext(data.source, context); vm.runInContext(data.source, context);
equal(moduleId, expectedId, basename); equal(moduleId, expectedId, basename);
equal(_.templates.d(object.d), 'Hello Mustache!', basename); equal(_.templates.d(object.d), 'Hallå Mustache!', basename);
delete _.templates; delete _.templates;
start(); start();
}); });
@@ -771,6 +773,27 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('modern modifier');
(function() {
asyncTest('`lodash modern`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', 'modern'], function(data) {
var basename = path.basename(data.outputPath, '.js'),
context = createContext();
vm.runInContext(data.source, context);
var lodash = context._;
strictEqual(lodash.isPlainObject(Object.create(null)), true, basename);
start();
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('source-map modifier'); QUnit.module('source-map modifier');
(function() { (function() {
@@ -1033,7 +1056,7 @@
]; ];
commands.forEach(function(command, index) { commands.forEach(function(command, index) {
asyncTest('`lodash ' + command +'`', function() { asyncTest('`lodash underscore ' + command +'`', function() {
var start = _.after(2, _.once(QUnit.start)); var start = _.after(2, _.once(QUnit.start));
build(['-s', 'underscore', command], function(data) { build(['-s', 'underscore', command], function(data) {
@@ -1106,6 +1129,80 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('exclude command');
(function() {
var commands = [
'exclude',
'minus'
];
commands.forEach(function(command) {
asyncTest('`lodash ' + command + '=runInContext`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', command + '=runInContext'], function(data) {
var basename = path.basename(data.outputPath, '.js'),
context = createContext(),
source = data.source;
vm.runInContext(data.source, context);
var lodash = context._,
array = [0];
var actual = lodash.map(array, function() {
return String(this[0]);
}, array);
deepEqual(actual, ['0'], basename);
equal('runInContext' in lodash, false, basename);
start();
});
});
asyncTest('`lodash ' + command + '=mixin`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', command + '=mixin'], function(data) {
var basename = path.basename(data.outputPath, '.js'),
context = createContext(),
source = data.source;
vm.runInContext(data.source, context);
var lodash = context._;
var actual = lodash([1, 2, 3])
.map(function(num) { return num * num; })
.value();
deepEqual(actual, [1, 4, 9], basename);
equal('mixin' in lodash, false, basename);
start();
});
});
asyncTest('`lodash ' + command + '=value`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', command + '=value'], function(data) {
var basename = path.basename(data.outputPath, '.js'),
context = createContext(),
source = data.source;
vm.runInContext(data.source, context);
var lodash = context._;
strictEqual(lodash([1]), undefined, basename);
deepEqual(_.keys(lodash.prototype), [], basename);
start();
});
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('exports command'); QUnit.module('exports command');
(function() { (function() {
@@ -1244,37 +1341,6 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('commands with findWhere');
(function() {
var commands = [
'underscore include=findWhere',
'modern include=findWhere',
'plus=findWhere'
];
commands.forEach(function(command) {
asyncTest('`lodash ' + command + '`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s'].concat(command.split(' ')), function(data) {
var basename = path.basename(data.outputPath, '.js'),
context = createContext();
vm.runInContext(data.source, context);
var lodash = context._;
var collection = [{ 'a': 1 }, { 'a': 1 }];
deepEqual(lodash.findWhere(collection, { 'a': 1 }), collection[0], '_.findWhere: ' + basename);
start();
});
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('no-dep option'); QUnit.module('no-dep option');
(function() { (function() {
@@ -1313,7 +1379,8 @@
'--output b.js', '--output b.js',
'-o ' + path.join('a', 'b', 'c.js'), '-o ' + path.join('a', 'b', 'c.js'),
'-o ' + relativePrefix + path.join('a', 'b', 'c.js'), '-o ' + relativePrefix + path.join('a', 'b', 'c.js'),
'-o ' + path.join(nestedPath, 'c.js') '-o ' + path.join(nestedPath, 'c.js'),
'-o name_with_keywords_like_category_include_exclude_plus_minus.js'
]; ];
commands.forEach(function(command) { commands.forEach(function(command) {
@@ -1365,6 +1432,8 @@
build(['exports=', 'include='].concat(command.split(' ')), function(data) { build(['exports=', 'include='].concat(command.split(' ')), function(data) {
process.stdout.write = write; process.stdout.write = write;
strictEqual('outputPath' in data, false);
equal(written, data.source); equal(written, data.source);
equal(arguments.length, 1); equal(arguments.length, 1);
start(); start();
@@ -1375,6 +1444,111 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('underscore builds with lodash methods');
(function() {
var methodNames = [
'assign',
'bindKey',
'clone',
'contains',
'debouce',
'defaults',
'defer',
'difference',
'every',
'filter',
'find',
'findWhere',
'first',
'flatten',
'forEach',
'forOwn',
'intersection',
'initial',
'isEmpty',
'isEqual',
'isPlainObject',
'isRegExp',
'last',
'map',
'max',
'memoize',
'min',
'omit',
'partial',
'partialRight',
'pick',
'pluck',
'reduce',
'reduceRight',
'result',
'rest',
'some',
'tap',
'template',
'throttle',
'times',
'toArray',
'transform',
'uniq',
'uniqueId',
'value',
'where',
'zip'
];
function strip(value) {
return String(value)
.replace(/^ *\/\/.*/gm, '')
.replace(/\b(?:basicEach|context|forEach|forOwn|window)\b/g, '')
.replace(/\blodash\.(createCallback\()\b/g, '$1')
.replace(/[\s;]/g, '');
}
methodNames.forEach(function(methodName) {
var command = 'underscore plus=' + methodName;
if (methodName == 'createCallback') {
command += ',where';
}
if (methodName == 'zip') {
command += ',unzip';
}
if (methodName != 'chain' && _.contains(chainingMethods.concat('mixin'), methodName)) {
command += ',chain';
}
if (_.contains(['isEqual', 'isPlainObject'], methodName)) {
command += ',forIn';
}
if (_.contains(['contains', 'every', 'find', 'some', 'transform'], methodName)) {
command += ',forOwn';
}
asyncTest('`lodash ' + command +'`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s'].concat(command.split(' ')), function(data) {
var array = [{ 'value': 1 }],
basename = path.basename(data.outputPath, '.js'),
context = createContext();
vm.runInContext(data.source, context, true);
var lodash = context._;
if (methodName == 'chain' || methodName == 'findWhere' || (methodName == 'defer' && global.setImmediate)) {
notEqual(strip(lodash[methodName]), strip(_[methodName]), basename);
} else if (!/\.min$/.test(basename)) {
equal(strip(lodash[methodName]), strip(_[methodName]), basename);
}
testMethod(lodash, methodName, basename);
start();
});
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash build'); QUnit.module('lodash build');
(function() { (function() {
@@ -1414,19 +1588,19 @@
var command = origCommand; var command = origCommand;
if (index == 1) { if (index == 1) {
if (/legacy|mobile/.test(command)) { if (/\b(?:legacy|mobile)\b/.test(command)) {
return; return;
} }
command = 'mobile ' + command; command = 'mobile ' + command;
} }
else if (index == 2) { else if (index == 2) {
if (/legacy|modern/.test(command)) { if (/\b(?:legacy|modern)\b/.test(command)) {
return; return;
} }
command = 'modern ' + command; command = 'modern ' + command;
} }
else if (index == 3) { else if (index == 3) {
if (/category|legacy|underscore/.test(command)) { if (/\b(?:category|legacy|underscore)\b/.test(command)) {
return; return;
} }
command = 'underscore ' + command; command = 'underscore ' + command;
@@ -1438,8 +1612,8 @@
var methodNames, var methodNames,
basename = path.basename(data.outputPath, '.js'), basename = path.basename(data.outputPath, '.js'),
context = createContext(), context = createContext(),
isBackbone = /backbone/.test(command), isBackbone = /\bbackbone\b/.test(command),
isUnderscore = isBackbone || /underscore/.test(command), isUnderscore = isBackbone || /\bunderscore\b/.test(command),
exposeAssign = !isUnderscore, exposeAssign = !isUnderscore,
exposeZipObject = !isUnderscore; exposeZipObject = !isUnderscore;
@@ -1449,11 +1623,11 @@
console.log(e); console.log(e);
} }
// add method names explicitly // add method names explicitly
if (/include/.test(command)) { if (/\binclude=/.test(command)) {
methodNames = command.match(/include=(\S*)/)[1].split(/, */); methodNames = command.match(/\binclude=(\S*)/)[1].split(/, */);
} }
// add method names required by Backbone and Underscore builds // add method names required by Backbone and Underscore builds
if (/backbone/.test(command) && !methodNames) { if (/\bbackbone\b/.test(command) && !methodNames) {
methodNames = backboneDependencies.slice(); methodNames = backboneDependencies.slice();
} }
if (isUnderscore) { if (isUnderscore) {
@@ -1464,20 +1638,22 @@
methodNames = underscoreMethods.slice(); methodNames = underscoreMethods.slice();
} }
} }
if (/category/.test(command)) { if (/\bcategory=/.test(command)) {
methodNames = (methodNames || []).concat(command.match(/category=(\S*)/)[1].split(/, */).map(capitalize)); methodNames = (methodNames || []).concat(command.match(/\bcategory=(\S*)/)[1].split(/, */).map(function(category) {
return capitalize(category.toLowerCase());
}));
} }
if (!methodNames) { if (!methodNames) {
methodNames = lodashMethods.slice(); methodNames = lodashMethods.slice();
} }
if (/plus/.test(command)) { if (/\bplus=/.test(command)) {
methodNames = methodNames.concat(command.match(/plus=(\S*)/)[1].split(/, */)); methodNames = methodNames.concat(command.match(/\bplus=(\S*)/)[1].split(/, */));
} }
if (/minus/.test(command)) { if (/\bminus=/.test(command)) {
methodNames = _.without.apply(_, [methodNames].concat(expandMethodNames(command.match(/minus=(\S*)/)[1].split(/, */)))); methodNames = _.without.apply(_, [methodNames].concat(expandMethodNames(command.match(/\bminus=(\S*)/)[1].split(/, */))));
} }
if (/exclude/.test(command)) { if (/\bexclude=/.test(command)) {
methodNames = _.without.apply(_, [methodNames].concat(expandMethodNames(command.match(/exclude=(\S*)/)[1].split(/, */)))); methodNames = _.without.apply(_, [methodNames].concat(expandMethodNames(command.match(/\bexclude=(\S*)/)[1].split(/, */))));
} }
// expand categories to real method names // expand categories to real method names

View File

@@ -18,12 +18,14 @@
// expose Lo-Dash build file path // expose Lo-Dash build file path
ui.buildPath = (function() { ui.buildPath = (function() {
switch (build) { switch (build) {
case 'lodash-prod': return 'dist/lodash.compat.min.js'; case 'lodash-compat': return 'dist/lodash.compat.min.js';
case 'lodash-underscore': return 'dist/lodash.underscore.min.js'; case 'lodash-modern-dev': return 'dist/lodash.js';
case 'lodash-modern': return 'dist/lodash.min.js'; case 'lodash-modern': return 'dist/lodash.min.js';
case 'lodash-modern-debug': return 'dist/lodash.js'; case 'lodash-legacy': return 'dist/lodash.legacy.min.js';
case 'lodash-custom': return 'lodash.custom.min.js'; case 'lodash-mobile': return 'dist/lodash.mobile.min.js';
case 'lodash-custom-debug': return 'lodash.custom.js'; case 'lodash-underscore': return 'dist/lodash.underscore.min.js';
case 'lodash-custom-dev': return 'lodash.custom.js';
case 'lodash-custom': return 'lodash.custom.min.js';
} }
return 'lodash.js'; return 'lodash.js';
}()); }());
@@ -58,12 +60,14 @@
buildList.selectedIndex = (function() { buildList.selectedIndex = (function() {
switch (build) { switch (build) {
case 'lodash-prod': return 1; case 'lodash-compat': return 1;
case 'lodash-underscore': return 2; case 'lodash-modern-dev': return 2;
case 'lodash-modern': return 3; case 'lodash-modern': return 3;
case 'lodash-modern-debug': return 4; case 'lodash-legacy': return 4;
case 'lodash-custom': return 5; case 'lodash-mobile': return 5;
case 'lodash-custom-debug': return 6; case 'lodash-underscore': return 6;
case 'lodash-custom-dev': return 7;
case 'lodash-custom': return 8;
} }
return 0; return 0;
}()); }());
@@ -87,13 +91,15 @@
span2.innerHTML = span2.innerHTML =
'<label for="qunit-build">Build: </label>' + '<label for="qunit-build">Build: </label>' +
'<select id="qunit-build">' + '<select id="qunit-build">' +
'<option value="lodash-dev">Developement</option>' + '<option value="lodash-compat-dev">Lo-Dash (compat development)</option>' +
'<option value="lodash-prod">Production</option>' + '<option value="lodash-compat">Lo-Dash (compat production)</option>' +
'<option value="lodash-underscore">Underscore</option>' + '<option value="lodash-modern-dev">Lo-Dash (modern development)</option>' +
'<option value="lodash-modern">Modern</option>' + '<option value="lodash-modern">Lo-Dash (modern production)</option>' +
'<option value="lodash-modern-debug">Modern (debug)</option>' + '<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
'<option value="lodash-custom">Custom</option>' + '<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
'<option value="lodash-custom-debug">Custom (debug)</option>' + '<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
'<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
'</select>'; '</select>';
var checkbox = span1.firstChild, var checkbox = span1.firstChild,

View File

@@ -1,17 +1,29 @@
;(function(window, undefined) { ;(function(window, undefined) {
'use strict'; 'use strict';
/** Method and object shortcuts */
var document = window.document,
amd = window.define && define.amd,
body = document && document.body,
create = Object.create,
freeze = Object.freeze,
phantom = window.phantom,
process = window.process,
slice = Array.prototype.slice,
system = window.system,
toString = Object.prototype.toString;
/** Use a single "load" function */ /** Use a single "load" function */
var load = typeof require == 'function' ? require : window.load; var load = typeof require == 'function' ? require : window.load;
/** The file path of the Lo-Dash file to test */ /** The file path of the Lo-Dash file to test */
var filePath = (function() { var filePath = (function() {
var min = 0; var min = 0;
var result = window.phantom var result = phantom
? phantom.args ? phantom.args
: (window.system : (system
? (min = 1, system.args) ? (min = 1, system.args)
: (window.process ? (min = 2, process.argv) : (window.arguments || [])) : (process ? (min = 2, process.argv) : (window.arguments || []))
); );
var last = result[result.length - 1]; var last = result[result.length - 1];
@@ -60,8 +72,8 @@
undefined undefined
]; ];
/** Shortcut used to make object properties immutable */ /** Used as the size when optimizations are enabled for large arrays */
var freeze = Object.freeze; var largeArraySize = 75;
/** Used to set property descriptors */ /** Used to set property descriptors */
var setDescriptor = (function() { var setDescriptor = (function() {
@@ -73,9 +85,6 @@
return result; return result;
}()); }());
/** Shortcut used to convert array-like objects to arrays */
var slice = Array.prototype.slice;
/** Used to check problem JScript properties (a.k.a. the [[DontEnum]] bug) */ /** Used to check problem JScript properties (a.k.a. the [[DontEnum]] bug) */
var shadowedProps = [ var shadowedProps = [
'constructor', 'constructor',
@@ -109,14 +118,13 @@
// add object from iframe // add object from iframe
(function() { (function() {
if (!window.document || window.phantom) { if (!document || phantom) {
return; return;
} }
var body = document.body, var iframe = document.createElement('iframe');
iframe = document.createElement('iframe');
iframe.frameBorder = iframe.height = iframe.width = 0; iframe.frameBorder = iframe.height = iframe.width = 0;
body.appendChild(iframe); body.appendChild(iframe);
var idoc = (idoc = iframe.contentDocument || iframe.contentWindow).document || idoc; var idoc = (idoc = iframe.contentDocument || iframe.contentWindow).document || idoc;
idoc.write("<script>parent._._object = { 'a': 1, 'b': 2, 'c': 3 };<\/script>"); idoc.write("<script>parent._._object = { 'a': 1, 'b': 2, 'c': 3 };<\/script>");
idoc.close(); idoc.close();
@@ -130,7 +138,7 @@
(function() { (function() {
test('supports loading ' + basename + ' as the "lodash" module', function() { test('supports loading ' + basename + ' as the "lodash" module', function() {
if (window.define && define.amd) { if (amd) {
equal((lodashModule || {}).moduleName, 'lodash'); equal((lodashModule || {}).moduleName, 'lodash');
} else { } else {
skipTest(); skipTest();
@@ -138,7 +146,7 @@
}); });
test('supports loading ' + basename + ' with the Require.js "shim" configuration option', function() { test('supports loading ' + basename + ' with the Require.js "shim" configuration option', function() {
if (window.define && define.amd) { if (amd) {
equal((shimmedModule || {}).moduleName, 'shimmed'); equal((shimmedModule || {}).moduleName, 'shimmed');
} else { } else {
skipTest(); skipTest();
@@ -146,7 +154,7 @@
}); });
test('supports loading ' + basename + ' as the "underscore" module', function() { test('supports loading ' + basename + ' as the "underscore" module', function() {
if (window.define && define.amd) { if (amd) {
equal((underscoreModule || {}).moduleName, 'underscore'); equal((underscoreModule || {}).moduleName, 'underscore');
} else { } else {
skipTest(); skipTest();
@@ -154,7 +162,7 @@
}); });
test('avoids overwritten native methods', function() { test('avoids overwritten native methods', function() {
if (window.document && !window.phantom) { if (document && !phantom) {
notDeepEqual(lodashBadShim.keys({ 'a': 1 }), []); notDeepEqual(lodashBadShim.keys({ 'a': 1 }), []);
} else { } else {
skipTest(); skipTest();
@@ -333,6 +341,23 @@
}); });
}()); }());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.chain');
(function() {
test('should return a wrapped value', function() {
var actual = _.chain({ 'a': 0 });
ok(actual instanceof _);
});
test('should return the existing wrapper when chaining', function() {
var wrapper = _({ 'a': 0 });
equal(wrapper.chain(), wrapper);
});
}());
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('cloning'); QUnit.module('cloning');
@@ -342,7 +367,7 @@
Klass.prototype = { 'b': 1 }; Klass.prototype = { 'b': 1 };
var nonCloneable = { var nonCloneable = {
'an element': window.document && document.body, 'an element': body,
'a function': Klass 'a function': Klass
}; };
@@ -387,11 +412,11 @@
}); });
}); });
test('should shallow clone when used as `callback` for `_.map`', function() { test('should perform a shallow clone when used as `callback` for `_.map`', function() {
var expected = [{ 'a': [0] }, { 'b': [1] }], var expected = [{ 'a': [0] }, { 'b': [1] }],
actual = _.map(expected, _.clone); actual = _.map(expected, _.clone);
ok(actual != expected && actual.a == expected.a && actual.b == expected.b); ok(actual[0] != expected[0] && actual[0].a === expected[0].a && actual[1].b === expected[1].b);
}); });
test('should deep clone `index` and `input` array properties', function() { test('should deep clone `index` and `input` array properties', function() {
@@ -552,16 +577,38 @@
}, 64); }, 64);
}); });
test('should work with `leading` option', function() { asyncTest('should work with `leading` option', function() {
_.each([true, { 'leading': true }], function(options) { var withLeadingAndTrailing,
var withLeading = _.debounce(_.identity, 32, options); counts = [0, 0, 0];
equal(withLeading('x'), 'x');
_.each([true, { 'leading': true }], function(options, index) {
var debounced = _.debounce(function(value) {
counts[index]++;
return value;
}, 32, options);
if (index == 1) {
withLeadingAndTrailing = debounced;
}
equal(debounced('x'), 'x');
}); });
_.times(2, _.debounce(function() { counts[2]++; }, 32, { 'leading': true }));
strictEqual(counts[2], 1);
_.each([false, { 'leading': false }], function(options) { _.each([false, { 'leading': false }], function(options) {
var withoutLeading = _.debounce(_.identity, 32, options); var withoutLeading = _.debounce(_.identity, 32, options);
strictEqual(withoutLeading('x'), undefined); strictEqual(withoutLeading('x'), undefined);
}); });
setTimeout(function() {
deepEqual(counts, [1, 1, 2]);
withLeadingAndTrailing('x');
equal(counts[1], 2);
QUnit.start();
}, 64);
}); });
asyncTest('should work with `trailing` option', function() { asyncTest('should work with `trailing` option', function() {
@@ -587,6 +634,37 @@
QUnit.start(); QUnit.start();
}, 64); }, 64);
}); });
asyncTest('should work with `maxWait` option', function() {
var limit = 96,
withCount = 0,
withoutCount = 0;
var withMaxWait = _.debounce(function() {
withCount++;
}, 32, { 'maxWait': 64 });
var withoutMaxWait = _.debounce(function() {
withoutCount++;
}, 32);
var start = new Date;
while ((new Date - start) < limit) {
withMaxWait();
withoutMaxWait();
}
strictEqual(withCount, 1);
strictEqual(withoutCount, 0);
var lastWithCount = withCount,
lastWithoutCount = withoutCount;
setTimeout(function() {
ok(withCount > lastWithCount);
ok(withoutCount > lastWithoutCount && withoutCount < withCount);
QUnit.start();
}, 64);
});
}()); }());
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
@@ -679,19 +757,21 @@
deepEqual(func({}, new Foo), {}); deepEqual(func({}, new Foo), {});
}); });
test('lodash.' + methodName + ' should treat sparse arrays as dense', function() { if (methodName == 'merge') {
var array = Array(3); test('lodash.' + methodName + ' should treat sparse arrays as dense', function() {
array[0] = 1; var array = Array(3);
array[2] = 3; array[0] = 1;
array[2] = 3;
var actual = func([], array), var actual = func([], array),
expected = array.slice(); expected = array.slice();
expected[1] = undefined; expected[1] = undefined;
ok(1 in actual); ok(1 in actual);
deepEqual(actual, expected); deepEqual(actual, expected);
}); });
}
}); });
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
@@ -814,7 +894,7 @@
deepEqual(args, [1, 0, array]); deepEqual(args, [1, 0, array]);
}); });
test('supports the `thisArg` argument', function() { test('should support the `thisArg` argument', function() {
var actual = _.first(array, function(value, index) { var actual = _.first(array, function(value, index) {
return this[index] < 3; return this[index] < 3;
}, array); }, array);
@@ -887,7 +967,7 @@
deepEqual(args, [{ 'a': [1, [2]] }, 0, array]); deepEqual(args, [{ 'a': [1, [2]] }, 0, array]);
}); });
test('supports the `thisArg` argument', function() { test('should support the `thisArg` argument', function() {
var actual = _.flatten(array, function(value, index) { var actual = _.flatten(array, function(value, index) {
return this[index].a; return this[index].a;
}, array); }, array);
@@ -899,6 +979,13 @@
deepEqual(_.flatten(array, 'a'), [1, 2, 3]); deepEqual(_.flatten(array, 'a'), [1, 2, 3]);
}); });
test('should perform a deep flatten when used as `callback` for `_.map`', function() {
var array = [[[['a']]], [[['b']]]],
actual = _.map(array, _.flatten);
deepEqual(actual, [['a'], ['b']]);
});
test('should treat sparse arrays as dense', function() { test('should treat sparse arrays as dense', function() {
var array = [[1, 2, 3], Array(3)], var array = [[1, 2, 3], Array(3)],
expected = [1, 2, 3], expected = [1, 2, 3],
@@ -930,7 +1017,7 @@
equal(wrapper.forEach(Boolean), wrapper); equal(wrapper.forEach(Boolean), wrapper);
}); });
test('supports the `thisArg` argument', function() { test('should support the `thisArg` argument', function() {
var actual; var actual;
function callback(value, index) { function callback(value, index) {
@@ -970,12 +1057,25 @@
(function() { (function() {
test('iterates over inherited properties', function() { test('iterates over inherited properties', function() {
function Dog(name) { this.name = name; } function Foo() { this.a = 1; }
Dog.prototype.bark = function() { /* Woof, woof! */ }; Foo.prototype.b = 2;
var keys = []; var keys = [];
_.forIn(new Dog('Dagny'), function(value, key) { keys.push(key); }); _.forIn(new Foo, function(value, key) { keys.push(key); });
deepEqual(keys.sort(), ['bark', 'name']); deepEqual(keys.sort(), ['a', 'b']);
});
test('fixes the JScript [[DontEnum]] bug with inherited properties (test in IE < 9)', function() {
function Foo() {}
Foo.prototype = shadowedObject;
function Bar() {}
Bar.prototype = new Foo;
Bar.prototype.constructor = Bar;
var keys = [];
_.forIn(shadowedObject, function(value, key) { keys.push(key); });
deepEqual(keys.sort(), shadowedProps);
}); });
}()); }());
@@ -1006,6 +1106,37 @@
deepEqual(keys.sort(), shadowedProps); deepEqual(keys.sort(), shadowedProps);
}); });
test('lodash.' + methodName + ' does not iterate over non-enumerable properties (test in IE < 9)', function() {
_.forOwn({
'Array': Array.prototype,
'Boolean': Boolean.prototype,
'Date': Date.prototype,
'Error': Error.prototype,
'Function': Function.prototype,
'Object': Object.prototype,
'Number': Number.prototype,
'TypeError': TypeError.prototype,
'RegExp': RegExp.prototype,
'String': String.prototype
},
function(object, builtin) {
var message = 'non-enumerable properties on ' + builtin + '.prototype',
props = [];
func(object, function(value, prop) {
props.push(prop);
});
if (/Error/.test(builtin)) {
ok(_.every(['constructor', 'toString'], function(prop) {
return !_.contains(props, prop);
}), message);
} else {
deepEqual(props, [], message);
}
});
});
test('lodash.' + methodName + ' skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', function() { test('lodash.' + methodName + ' skips the prototype property of functions (test in Firefox < 3.6, Opera > 9.50 - Opera < 11.60, and Safari < 5.1)', function() {
function Foo() {} function Foo() {}
Foo.prototype.a = 1; Foo.prototype.a = 1;
@@ -1155,7 +1286,7 @@
stringObject = Object(stringLiteral), stringObject = Object(stringLiteral),
expected = [stringLiteral, stringObject]; expected = [stringLiteral, stringObject];
var array = _.times(100, function(count) { var array = _.times(largeArraySize, function(count) {
return count % 2 ? stringObject : stringLiteral; return count % 2 ? stringObject : stringLiteral;
}); });
@@ -1181,7 +1312,7 @@
QUnit.module('lodash.groupBy'); QUnit.module('lodash.groupBy');
(function() { (function() {
test('supports the `thisArg` argument', function() { test('should support the `thisArg` argument', function() {
var actual = _.groupBy([4.2, 6.1, 6.4], function(num) { var actual = _.groupBy([4.2, 6.1, 6.4], function(num) {
return this.floor(num); return this.floor(num);
}, Math); }, Math);
@@ -1220,6 +1351,18 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('lodash.has');
(function() {
test('should return `false` for primitives', function() {
_.each(falsey.concat(1, 'a'), function(value) {
strictEqual(_.has(value, 'valueOf'), false);
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.indexOf'); QUnit.module('lodash.indexOf');
(function() { (function() {
@@ -1256,6 +1399,68 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('custom `_.indexOf` methods');
(function() {
function custom(array, value, fromIndex) {
var index = (fromIndex || 0) - 1,
length = array.length;
while (++index < length) {
var other = array[index];
if (other === value ||
(_.isObject(value) && other instanceof Foo) ||
(other === 'x' && /[13]/.test(value))) {
return index;
}
}
return -1;
}
function Foo() {}
var array = [1, new Foo, 3, new Foo],
indexOf = _.indexOf;
test('_.contains should work with a custom `_.indexOf` method', function() {
_.indexOf = custom;
ok(_.contains(array, new Foo));
_.indexOf = indexOf;
});
test('_.difference should work with a custom `_.indexOf` method', function() {
_.indexOf = custom;
deepEqual(_.difference(array, [new Foo]), [1, 3]);
_.indexOf = indexOf;
});
test('_.intersection should work with a custom `_.indexOf` method', function() {
_.indexOf = custom;
deepEqual(_.intersection(array, [new Foo]), [array[1]]);
_.indexOf = indexOf;
});
test('_.omit should work with a custom `_.indexOf` method', function() {
_.indexOf = custom;
deepEqual(_.omit(array, ['x']), { '0': 1, '2': 3 });
_.indexOf = indexOf;
});
test('_.uniq should work with a custom `_.indexOf` method', function() {
_.indexOf = custom;
deepEqual(_.uniq(array), array.slice(0, 3));
var largeArray = _.times(largeArraySize, function() {
return new Foo;
});
deepEqual(_.uniq(largeArray), [largeArray[0]]);
_.indexOf = indexOf;
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.initial'); QUnit.module('lodash.initial');
(function() { (function() {
@@ -1306,7 +1511,7 @@
deepEqual(args, [3, 2, array]); deepEqual(args, [3, 2, array]);
}); });
test('supports the `thisArg` argument', function() { test('should support the `thisArg` argument', function() {
var actual = _.initial(array, function(value, index) { var actual = _.initial(array, function(value, index) {
return this[index] > 1; return this[index] > 1;
}, array); }, array);
@@ -1340,7 +1545,7 @@
(function() { (function() {
test('should use strict equality in its duck type check', function() { test('should use strict equality in its duck type check', function() {
var element = window.document ? document.body : { 'nodeType': 1 }; var element = body || { 'nodeType': 1 };
strictEqual(_.isElement(element), true); strictEqual(_.isElement(element), true);
strictEqual(_.isElement({ 'nodeType': new Number(1) }), false); strictEqual(_.isElement({ 'nodeType': new Number(1) }), false);
@@ -1544,14 +1749,29 @@
strictEqual(_.isPlainObject(new Foo(1)), false); strictEqual(_.isPlainObject(new Foo(1)), false);
strictEqual(_.isPlainObject([1, 2, 3]), false); strictEqual(_.isPlainObject([1, 2, 3]), false);
strictEqual(_.isPlainObject({ 'a': 1 }), true); strictEqual(_.isPlainObject({ 'a': 1 }), true);
if (create) {
strictEqual(_.isPlainObject(create(null)), true);
} else {
skipTest();
}
if (document) {
strictEqual(_.isPlainObject(body), false);
} else {
skipTest();
}
}); });
test('should return `false` for objects without a [[Class]] of "Object"', function() { test('should return `true` for empty objects', function() {
strictEqual(_.isPlainObject({}), true);
});
test('should return `false` for Object objects without a [[Class]] of "Object"', function() {
strictEqual(_.isPlainObject(arguments), false); strictEqual(_.isPlainObject(arguments), false);
strictEqual(_.isPlainObject(Error), false); strictEqual(_.isPlainObject(Error), false);
strictEqual(_.isPlainObject(Math), false); strictEqual(_.isPlainObject(Math), false);
strictEqual(_.isPlainObject(window), false); strictEqual(_.isPlainObject(window), false);
}) });
}()); }());
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
@@ -1587,7 +1807,7 @@
equal(typeof func(true), expected); equal(typeof func(true), expected);
equal(typeof func(false), expected); equal(typeof func(false), expected);
equal(typeof func(new Date), expected); equal(typeof func(new Date), expected);
equal(typeof func(window.document && document.body), expected); equal(typeof func(body), expected);
equal(typeof func({}), expected); equal(typeof func({}), expected);
equal(typeof func(undefined), expected); equal(typeof func(undefined), expected);
equal(typeof func(Infinity), expected); equal(typeof func(Infinity), expected);
@@ -1600,6 +1820,22 @@
}); });
}); });
(function() {
test('should return `false` for subclassed values', function() {
_.each(['isArray', 'isBoolean', 'isDate', 'isFunction', 'isNumber', 'isRegExp', 'isString'], function(methodName) {
function Foo() {}
Foo.prototype = window[methodName.slice(2)].prototype;
var object = new Foo;
if (toString.call(object) == '[object Object]') {
strictEqual(_[methodName](object), false, '_.' + methodName + ' returns `false`');
} else {
skipTest();
}
});
});
}());
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('lodash.keys'); QUnit.module('lodash.keys');
@@ -1673,7 +1909,7 @@
deepEqual(args, [3, 2, array]); deepEqual(args, [3, 2, array]);
}); });
test('supports the `thisArg` argument', function() { test('should support the `thisArg` argument', function() {
var actual = _.last(array, function(value, index) { var actual = _.last(array, function(value, index) {
return this[index] > 1; return this[index] > 1;
}, array); }, array);
@@ -1799,6 +2035,33 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('lodash.max and lodash.min chaining');
_.each(['max', 'min'], function(methodName) {
test('lodash.' + methodName + ' should resolve the correct value when passed an array containing only one value', function() {
var actual = _([40])[methodName]().value();
strictEqual(actual, 40);
});
});
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.memoize');
(function() {
test('should expose a `cache` object on the `memoized` function', function() {
var memoized = _.memoize(_.identity);
memoized('x');
var cache = memoized.cache,
key = _.keys(cache)[0];
equal(cache[key], 'x');
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.merge'); QUnit.module('lodash.merge');
(function() { (function() {
@@ -2010,15 +2273,23 @@
QUnit.module('lodash.parseInt'); QUnit.module('lodash.parseInt');
(function() { (function() {
test('should parse strings with leading zeros with a `radix` of 10 by default (test in Firefox and Opera)', function() { test('should parse strings with leading whitespace and zeros with a `radix` of 10 by default (test in Chrome, Firefox, and Opera)', function() {
var whitespace = ' \x09\x0B\x0C\xA0\ufeff\x0A\x0D\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000';
equal(_.parseInt('08'), 8); equal(_.parseInt('08'), 8);
equal(_.parseInt(whitespace + '08'), 8);
}); });
test('should internally use a radix of 10 if `radix` is `undefined` or `0`', function() { test('should use a radix of `10`, for non-hexadecimals, if `radix` is `undefined` or `0`', function() {
equal(_.parseInt('10', 0), 10); equal(_.parseInt('10', 0), 10);
equal(_.parseInt('10'), 10); equal(_.parseInt('10'), 10);
equal(_.parseInt('10', undefined), 10); equal(_.parseInt('10', undefined), 10);
}); });
test('should use a radix of `16`, for hexadecimals, if `radix` is `undefined` or `0`', function() {
equal(_.parseInt('0x20', 0), 32);
equal(_.parseInt('0x20'), 32);
equal(_.parseInt('0x20', undefined), 32);
});
}()); }());
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
@@ -2181,6 +2452,15 @@
test('should coerce arguments to numbers', function() { test('should coerce arguments to numbers', function() {
strictEqual(_.random('1', '1'), 1); strictEqual(_.random('1', '1'), 1);
}); });
test('should support floats', function() {
var min = 1.5,
max = 1.6,
actual = _.random(min, max);
ok(actual % 1);
ok(actual >= min && actual <= max);
});
}()); }());
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
@@ -2484,7 +2764,7 @@
deepEqual(actual, collection); deepEqual(actual, collection);
}); });
test('supports the `thisArg` argument', function() { test('should support the `thisArg` argument', function() {
var actual = _.sortBy([1, 2, 3], function(num) { var actual = _.sortBy([1, 2, 3], function(num) {
return this.sin(num); return this.sin(num);
}, Math); }, Math);
@@ -2506,7 +2786,7 @@
QUnit.module('lodash.sortedIndex'); QUnit.module('lodash.sortedIndex');
(function() { (function() {
test('supports the `thisArg` argument', function() { test('should support the `thisArg` argument', function() {
var actual = _.sortedIndex([1, 2, 3], 4, function(num) { var actual = _.sortedIndex([1, 2, 3], 4, function(num) {
return this.sin(num); return this.sin(num);
}, Math); }, Math);
@@ -2830,11 +3110,27 @@
}); });
setTimeout(function() { setTimeout(function() {
strictEqual(withCount, 2); equal(withCount, 2);
strictEqual(withoutCount, 1); strictEqual(withoutCount, 1);
QUnit.start(); QUnit.start();
}, 64); }, 64);
}); });
asyncTest('should not update `lastCalled`, at the end of the timeout, when `trailing` is `false`', function() {
var count = 0;
var throttled = _.throttle(function() {
count++;
}, 64, { 'trailing': false });
_.times(2, throttled);
setTimeout(function() { _.times(2, throttled); }, 100);
setTimeout(function() {
equal(count, 2);
QUnit.start();
}, 128);
});
}()); }());
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
@@ -2867,10 +3163,9 @@
}); });
test('should work with a node list for `collection` (test in IE < 9)', function() { test('should work with a node list for `collection` (test in IE < 9)', function() {
if (window.document) { if (document) {
try { try {
var nodeList = document.getElementsByTagName('body'), var nodeList = document.getElementsByTagName('body'),
body = nodeList[0],
actual = _.toArray(nodeList); actual = _.toArray(nodeList);
} catch(e) { } } catch(e) { }
deepEqual(actual, [body]); deepEqual(actual, [body]);
@@ -2906,6 +3201,67 @@
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
QUnit.module('lodash.transform');
(function() {
test('should produce an that is an instance of the given object\'s constructor', function() {
function Foo() {
this.a = 1;
this.b = 2;
this.c = 3;
}
var actual = _.transform(new Foo, function(result, value, key) {
result[key] = value * value;
});
ok(actual instanceof Foo);
deepEqual(_.clone(actual), { 'a': 1, 'b': 4, 'c': 9 });
});
test('should treat sparse arrays as dense', function() {
var actual = _.transform(Array(1), function(result, value, index) {
result[index] = String(value);
});
deepEqual(actual, ['undefined']);
});
_.each({
'array': [1, 2, 3],
'object': { 'a': 1, 'b': 2, 'c': 3 }
},
function(object, key) {
test('should pass the correct `callback` arguments when transforming an ' + key, function() {
var args;
_.transform(object, function() {
args || (args = slice.call(arguments));
});
var first = args[0];
if (key == 'array') {
ok(first != object && _.isArray(first));
deepEqual(args, [first, 1, 0, object]);
} else {
ok(first != object && _.isPlainObject(first));
deepEqual(args, [first, 1, 'a', object]);
}
});
test('should support the `thisArg` argument when transforming an ' + key, function() {
var actual = _.transform(object, function(result, value, key) {
result[key] = this[key];
}, null, object);
notEqual(actual, object);
deepEqual(actual, object);
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.unescape'); QUnit.module('lodash.unescape');
(function() { (function() {
@@ -2948,7 +3304,7 @@
QUnit.module('lodash.uniq'); QUnit.module('lodash.uniq');
(function() { (function() {
test('supports the `thisArg` argument', function() { test('should support the `thisArg` argument', function() {
var actual = _.uniq([1, 2, 1.5, 3, 2.5], function(num) { var actual = _.uniq([1, 2, 1.5, 3, 2.5], function(num) {
return this.floor(num); return this.floor(num);
}, Math); }, Math);
@@ -2956,15 +3312,23 @@
deepEqual(actual, [1, 2, 3]); deepEqual(actual, [1, 2, 3]);
}); });
test('should perform an unsorted uniq operation when used as `callback` for `_.map`', function() {
var array = [[2, 1, 2], [1, 2, 1]],
actual = _.map(array, _.uniq);
deepEqual(actual, [[2, 1], [1, 2]]);
});
test('should distinguish between numbers and numeric strings', function() { test('should distinguish between numbers and numeric strings', function() {
var array = [], var array = [],
expected = ['2', 2, Object('2'), Object(2)]; expected = ['2', 2, Object('2'), Object(2)],
count = Math.ceil(largeArraySize / expected.length);
_.times(50, function() { _.times(count, function() {
array.push.apply(array, expected); array.push.apply(array, expected);
}); });
deepEqual(_.uniq(expected), expected); deepEqual(_.uniq(array), expected);
}); });
_.each({ _.each({
@@ -3437,7 +3801,7 @@
// configure QUnit and call `QUnit.start()` for // configure QUnit and call `QUnit.start()` for
// Narwhal, Node.js, PhantomJS, Rhino, and RingoJS // Narwhal, Node.js, PhantomJS, Rhino, and RingoJS
if (!window.document || window.phantom) { if (!document || phantom) {
QUnit.config.noglobals = true; QUnit.config.noglobals = true;
QUnit.start(); QUnit.start();
} }

View File

@@ -34,7 +34,7 @@
push = arrayProto.push, push = arrayProto.push,
slice = arrayProto.slice; slice = arrayProto.slice;
if (_.chain) { if (_.chain().__chain__) {
return; return;
} }
_.mixin = function(object) { _.mixin = function(object) {

View File

@@ -15,7 +15,7 @@ For a list of upcoming features, check out our [roadmap](https://github.com/best
## Support ## Support
Benchmark.js has been tested in at least Chrome 5~26, Firefox 1~19, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.4, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5. Benchmark.js has been tested in at least Chrome 5~27, Firefox 2~21, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.7, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
## Installation and usage ## Installation and usage
@@ -100,7 +100,7 @@ suite.add('RegExp#test', function() {
console.log(String(event.target)); console.log(String(event.target));
}) })
.on('complete', function() { .on('complete', function() {
console.log('Fastest is ' + _.pluck(this.filter('fastest'), 'name')); console.log('Fastest is ' + this.filter('fastest').pluck('name'));
}) })
// run async // run async
.run({ 'async': true }); .run({ 'async': true });
@@ -117,12 +117,12 @@ Benchmark.js is part of the BestieJS *"Best in Class"* module collection. This m
## Authors ## Authors
* [Mathias Bynens](http://mathiasbynens.be/) | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias "Follow @mathias on Twitter") | [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton "Follow @jdalton on Twitter") |
[![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |---|---|
* [John-David Dalton](http://allyoucanleet.com/) | [Mathias Bynens](http://mathiasbynens.be/) | [John-David Dalton](http://allyoucanleet.com/) |
[![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter")
## Contributors ## Contributors
* [Kit Cambridge](http://kitcambridge.github.com/) | [![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") |
[![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") |---|
| [Kit Cambridge](http://kitcambridge.github.io/) |

View File

@@ -30,6 +30,9 @@
/** Used to assign each benchmark an incrimented id */ /** Used to assign each benchmark an incrimented id */
var counter = 0; var counter = 0;
/** Used to make every compiled test unique */
var uidCounter = 0;
/** Used to detect primitive types */ /** Used to detect primitive types */
var rePrimitive = /^(?:boolean|number|string|undefined)$/; var rePrimitive = /^(?:boolean|number|string|undefined)$/;
@@ -139,6 +142,7 @@
max = Math.max, max = Math.max,
min = Math.min, min = Math.min,
pow = Math.pow, pow = Math.pow,
push = arrayRef.push,
setTimeout = context.setTimeout, setTimeout = context.setTimeout,
shift = arrayRef.shift, shift = arrayRef.shift,
slice = arrayRef.slice, slice = arrayRef.slice,
@@ -1444,10 +1448,9 @@
// ...the z-stat is greater than 1.96 or less than -1.96 // ...the z-stat is greater than 1.96 or less than -1.96
// http://www.statisticslectures.com/topics/mannwhitneyu/ // http://www.statisticslectures.com/topics/mannwhitneyu/
zStat = getZ(u); zStat = getZ(u);
return abs(zStat) > 1.96 ? (zStat > 0 ? -1 : 1) : 0; return abs(zStat) > 1.96 ? (u == u1 ? 1 : -1) : 0;
} }
// ...the U value is less than or equal the critical U value // ...the U value is less than or equal the critical U value
// http://www.geoib.com/mann-whitney-u-test.html
critical = maxSize < 5 || minSize < 3 ? 0 : uTable[maxSize][minSize - 3]; critical = maxSize < 5 || minSize < 3 ? 0 : uTable[maxSize][minSize - 3];
return u <= critical ? (u == u1 ? 1 : -1) : 0; return u <= critical ? (u == u1 ? 1 : -1) : 0;
} }
@@ -1560,22 +1563,18 @@
function clock() { function clock() {
var applet, var applet,
options = Benchmark.options, options = Benchmark.options,
templateData = {},
timers = [{ 'ns': timer.ns, 'res': max(0.0015, getRes('ms')), 'unit': 'ms' }]; timers = [{ 'ns': timer.ns, 'res': max(0.0015, getRes('ms')), 'unit': 'ms' }];
var templateData = {
'begin': interpolate('s#=new n#'),
'end': interpolate('r#=(new n#-s#)/1e3'),
'uid': uid
};
// lazy define for hi-res timers // lazy define for hi-res timers
clock = function(clone) { clock = function(clone) {
var deferred; var deferred;
templateData.uid = uid + uidCounter++;
if (clone instanceof Deferred) { if (clone instanceof Deferred) {
deferred = clone; deferred = clone;
clone = deferred.benchmark; clone = deferred.benchmark;
} }
var bench = clone._original, var bench = clone._original,
fn = bench.fn, fn = bench.fn,
fnArg = deferred ? getFirstArgument(fn) || 'deferred' : '', fnArg = deferred ? getFirstArgument(fn) || 'deferred' : '',
@@ -1588,6 +1587,45 @@
'teardown': getSource(bench.teardown, interpolate('m#.teardown()')) 'teardown': getSource(bench.teardown, interpolate('m#.teardown()'))
}); });
// use API of chosen timer
if (timer.unit == 'ns') {
if (timer.ns.nanoTime) {
_.extend(templateData, {
'begin': interpolate('s#=n#.nanoTime()'),
'end': interpolate('r#=(n#.nanoTime()-s#)/1e9')
});
} else {
_.extend(templateData, {
'begin': interpolate('s#=n#()'),
'end': interpolate('r#=n#(s#);r#=r#[0]+(r#[1]/1e9)')
});
}
}
else if (timer.unit == 'us') {
if (timer.ns.stop) {
_.extend(templateData, {
'begin': interpolate('s#=n#.start()'),
'end': interpolate('r#=n#.microseconds()/1e6')
});
} else if (perfName) {
_.extend(templateData, {
'begin': interpolate('s#=n#.' + perfName + '()'),
'end': interpolate('r#=(n#.' + perfName + '()-s#)/1e3')
});
} else {
_.extend(templateData, {
'begin': interpolate('s#=n#()'),
'end': interpolate('r#=(n#()-s#)/1e6')
});
}
}
else {
_.extend(templateData, {
'begin': interpolate('s#=new n#'),
'end': interpolate('r#=(new n#-s#)/1e3')
});
}
var count = bench.count = clone.count, var count = bench.count = clone.count,
decompilable = support.decompilation || stringable, decompilable = support.decompilation || stringable,
id = bench.id, id = bench.id,
@@ -1609,6 +1647,16 @@
ns = timer.ns = new applet.Packages.nano; ns = timer.ns = new applet.Packages.nano;
} }
} }
// define `timer` methods
timer.start = createFunction(
interpolate('o#'),
interpolate('var n#=this.ns,${begin};o#.elapsed=0;o#.timeStamp=s#')
);
timer.stop = createFunction(
interpolate('o#'),
interpolate('var n#=this.ns,s#=o#.timeStamp,${end};o#.elapsed=r#')
);
// Compile in setup/teardown functions and the test loop. // Compile in setup/teardown functions and the test loop.
// Create a new compiled test, instead of using the cached `bench.compiled`, // Create a new compiled test, instead of using the cached `bench.compiled`,
@@ -1627,7 +1675,7 @@
// start timer // start timer
't#.start(d#);' + 't#.start(d#);' +
// execute `deferred.fn` and return a dummy object // execute `deferred.fn` and return a dummy object
'}d#.fn();return{}' '}d#.fn();return{uid:"${uid}"}'
: 'var r#,s#,m#=this,f#=m#.fn,i#=m#.count,n#=t#.ns;${setup}\n${begin};' + : 'var r#,s#,m#=this,f#=m#.fn,i#=m#.count,n#=t#.ns;${setup}\n${begin};' +
'while(i#--){${fn}\n}${end};${teardown}\nreturn{elapsed:r#,uid:"${uid}"}' 'while(i#--){${fn}\n}${end};${teardown}\nreturn{elapsed:r#,uid:"${uid}"}'
@@ -1643,7 +1691,7 @@
// pretest to determine if compiled code is exits early, usually by a // pretest to determine if compiled code is exits early, usually by a
// rogue `return` statement, by checking for a return object with the uid // rogue `return` statement, by checking for a return object with the uid
bench.count = 1; bench.count = 1;
compiled = (compiled.call(bench, context, timer) || {}).uid == uid && compiled; compiled = (compiled.call(bench, context, timer) || {}).uid == templateData.uid && compiled;
bench.count = count; bench.count = count;
} }
} catch(e) { } catch(e) {
@@ -1762,7 +1810,7 @@
*/ */
function interpolate(string) { function interpolate(string) {
// replaces all occurrences of `#` with a unique number and template tokens with content // replaces all occurrences of `#` with a unique number and template tokens with content
return _.template(string.replace(/\#/g, /\d+/.exec(uid)), templateData || {}); return _.template(string.replace(/\#/g, /\d+/.exec(templateData.uid)), templateData);
} }
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
@@ -1816,50 +1864,6 @@
if (timer.res == Infinity) { if (timer.res == Infinity) {
throw new Error('Benchmark.js was unable to find a working timer.'); throw new Error('Benchmark.js was unable to find a working timer.');
} }
// use API of chosen timer
if (timer.unit == 'ns') {
if (timer.ns.nanoTime) {
_.extend(templateData, {
'begin': interpolate('s#=n#.nanoTime()'),
'end': interpolate('r#=(n#.nanoTime()-s#)/1e9')
});
} else {
_.extend(templateData, {
'begin': interpolate('s#=n#()'),
'end': interpolate('r#=n#(s#);r#=r#[0]+(r#[1]/1e9)')
});
}
}
else if (timer.unit == 'us') {
if (timer.ns.stop) {
_.extend(templateData, {
'begin': interpolate('s#=n#.start()'),
'end': interpolate('r#=n#.microseconds()/1e6')
});
} else if (perfName) {
_.extend(templateData, {
'begin': interpolate('s#=n#.' + perfName + '()'),
'end': interpolate('r#=(n#.' + perfName + '()-s#)/1e3')
});
} else {
_.extend(templateData, {
'begin': interpolate('s#=n#()'),
'end': interpolate('r#=(n#()-s#)/1e6')
});
}
}
// define `timer` methods
timer.start = createFunction(
interpolate('o#'),
interpolate('var n#=this.ns,${begin};o#.elapsed=0;o#.timeStamp=s#')
);
timer.stop = createFunction(
interpolate('o#'),
interpolate('var n#=this.ns,s#=o#.timeStamp,${end};o#.elapsed=r#')
);
// resolve time span required to achieve a percent uncertainty of at most 1% // resolve time span required to achieve a percent uncertainty of at most 1%
// http://spiff.rit.edu/classes/phys273/uncert/uncert.html // http://spiff.rit.edu/classes/phys273/uncert/uncert.html
options.minTime || (options.minTime = max(timer.res / 2 / 0.01, 0.05)); options.minTime || (options.minTime = max(timer.res / 2 / 0.01, 0.05));
@@ -2356,6 +2360,11 @@
'support': support 'support': support
}); });
// Add Lo-Dash methods to Benchmark
_.each(['each', 'forEach', 'forOwn', 'has', 'indexOf', 'map', 'pluck', 'reduce'], function(methodName) {
Benchmark[methodName] = _[methodName];
});
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
_.extend(Benchmark.prototype, { _.extend(Benchmark.prototype, {
@@ -2777,11 +2786,12 @@
'off': off, 'off': off,
'on': on, 'on': on,
'pop': arrayRef.pop, 'pop': arrayRef.pop,
'push': arrayRef.push, 'push': push,
'reset': resetSuite, 'reset': resetSuite,
'run': runSuite, 'run': runSuite,
'reverse': arrayRef.reverse, 'reverse': arrayRef.reverse,
'shift': shift, 'shift': shift,
'slice': arrayRef.slice,
'sort': arrayRef.sort, 'sort': arrayRef.sort,
'splice': arrayRef.splice, 'splice': arrayRef.splice,
'unshift': arrayRef.unshift 'unshift': arrayRef.unshift
@@ -2798,6 +2808,16 @@
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
// add Lo-Dash methods as Suite methods
_.each(['each', 'forEach', 'indexOf', 'map', 'pluck', 'reduce'], function(methodName) {
var func = _[methodName];
Suite.prototype[methodName] = function() {
var args = [this];
push.apply(args, arguments);
return func.apply(_, args);
};
});
// avoid array-like object bugs with `Array#shift` and `Array#splice` // avoid array-like object bugs with `Array#shift` and `Array#splice`
// in Firefox < 10 and IE < 9 // in Firefox < 10 and IE < 9
if (!_.support.spliceObjects) { if (!_.support.spliceObjects) {

View File

@@ -24,10 +24,12 @@ $markdown = docdown(array(
## Author ## Author
* [John-David Dalton](http://allyoucanleet.com/) | [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton "Follow @jdalton on Twitter") |
[![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") |---|
| [John-David Dalton](http://allyoucanleet.com/) |
## Contributors ## Contributors
* [Mathias Bynens](http://mathiasbynens.be/) | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias "Follow @mathias on Twitter") |
[![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |---|
| [Mathias Bynens](http://mathiasbynens.be/) |

View File

@@ -58,7 +58,7 @@ class Entry {
* @returns {Array} The array of entries. * @returns {Array} The array of entries.
*/ */
public static function getEntries( $source ) { public static function getEntries( $source ) {
preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*[^\n]+#', $source, $result); preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*.+#', $source, $result);
return array_pop($result); return array_pop($result);
} }
@@ -77,7 +77,7 @@ class Entry {
$this->isCtor() || $this->isCtor() ||
count($this->getParams()) || count($this->getParams()) ||
count($this->getReturns()) || count($this->getReturns()) ||
preg_match('/\* *@function\b/', $this->entry) preg_match('/\*[\t ]*@function\b/', $this->entry)
); );
} }
return $this->_isFunction; return $this->_isFunction;
@@ -94,10 +94,10 @@ class Entry {
*/ */
public function getAliases( $index = null ) { public function getAliases( $index = null ) {
if (!isset($this->_aliases)) { if (!isset($this->_aliases)) {
preg_match('#\* *@alias\s+([^\n]+)#', $this->entry, $result); preg_match('#\*[\t ]*@alias\s+(.+)#', $this->entry, $result);
if (count($result)) { if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1])); $result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
$result = preg_split('/,\s*/', $result); $result = preg_split('/,\s*/', $result);
natsort($result); natsort($result);
@@ -129,7 +129,7 @@ class Entry {
} }
// resolve name // resolve name
// avoid $this->getName() because it calls $this->getCall() // avoid $this->getName() because it calls $this->getCall()
preg_match('#\* *@name\s+([^\n]+)#', $this->entry, $name); preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $name);
if (count($name)) { if (count($name)) {
$name = trim($name[1]); $name = trim($name[1]);
} else { } else {
@@ -163,9 +163,9 @@ class Entry {
return $this->_category; return $this->_category;
} }
preg_match('#\* *@category\s+([^\n]+)#', $this->entry, $result); preg_match('#\*[\t ]*@category\s+(.+)#', $this->entry, $result);
if (count($result)) { if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1])); $result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
} else { } else {
$result = $this->getType() == 'Function' ? 'Methods' : 'Properties'; $result = $this->getType() == 'Function' ? 'Methods' : 'Properties';
} }
@@ -187,9 +187,9 @@ class Entry {
preg_match('#/\*\*(?:\s*\*)?([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result); preg_match('#/\*\*(?:\s*\*)?([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) { if (count($result)) {
$type = $this->getType(); $type = $this->getType();
$result = preg_replace('/:\n *\* */', ":<br>\n", $result[1]); $result = preg_replace('/:\n[\t ]*\*[\t ]*/', ":<br>\n", $result[1]);
$result = preg_replace('/(?:^|\n) *\*\n *\* */', "\n\n", $result); $result = preg_replace('/(?:^|\n)[\t ]*\*\n[\t ]*\*[\t ]*/', "\n\n", $result);
$result = preg_replace('/(?:^|\n) *\* ?/', ' ', $result); $result = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result);
$result = trim($result); $result = trim($result);
$result = ($type == 'Function' ? '' : '(' . str_replace('|', ', ', trim($type, '{}')) . '): ') . $result; $result = ($type == 'Function' ? '' : '(' . str_replace('|', ', ', trim($type, '{}')) . '): ') . $result;
} }
@@ -208,9 +208,9 @@ class Entry {
return $this->_example; return $this->_example;
} }
preg_match('#\* *@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result); preg_match('#\*[\t ]*@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) { if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', "\n", $result[1])); $result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', "\n", $result[1]));
$result = '```' . $this->lang . "\n" . $result . "\n```"; $result = '```' . $this->lang . "\n" . $result . "\n```";
} }
$this->_example = $result; $this->_example = $result;
@@ -235,7 +235,7 @@ class Entry {
*/ */
public function isCtor() { public function isCtor() {
if (!isset($this->_isCtor)) { if (!isset($this->_isCtor)) {
$this->_isCtor = !!preg_match('/\* *@constructor\b/', $this->entry); $this->_isCtor = !!preg_match('/\*[\t ]*@constructor\b/', $this->entry);
} }
return $this->_isCtor; return $this->_isCtor;
} }
@@ -248,7 +248,7 @@ class Entry {
*/ */
public function isLicense() { public function isLicense() {
if (!isset($this->_isLicense)) { if (!isset($this->_isLicense)) {
$this->_isLicense = !!preg_match('/\* *@license\b/', $this->entry); $this->_isLicense = !!preg_match('/\*[\t ]*@license\b/', $this->entry);
} }
return $this->_isLicense; return $this->_isLicense;
} }
@@ -274,7 +274,7 @@ class Entry {
*/ */
public function isPrivate() { public function isPrivate() {
if (!isset($this->_isPrivate)) { if (!isset($this->_isPrivate)) {
$this->_isPrivate = $this->isLicense() || !!preg_match('/\* *@private\b/', $this->entry) || !preg_match('/\* *@[a-z]+\b/', $this->entry); $this->_isPrivate = $this->isLicense() || !!preg_match('/\*[\t ]*@private\b/', $this->entry) || !preg_match('/\*[\t ]*@[a-z]+\b/', $this->entry);
} }
return $this->_isPrivate; return $this->_isPrivate;
} }
@@ -291,7 +291,7 @@ class Entry {
} }
$public = !$this->isPrivate(); $public = !$this->isPrivate();
$result = $public && !!preg_match('/\* *@static\b/', $this->entry); $result = $public && !!preg_match('/\*[\t ]*@static\b/', $this->entry);
// set in cases where it isn't explicitly stated // set in cases where it isn't explicitly stated
if ($public && !$result) { if ($public && !$result) {
@@ -334,9 +334,9 @@ class Entry {
*/ */
public function getMembers( $index = null ) { public function getMembers( $index = null ) {
if (!isset($this->_members)) { if (!isset($this->_members)) {
preg_match('#\* *@member(?:Of)?\s+([^\n]+)#', $this->entry, $result); preg_match('#\*[\t ]*@member(?:Of)?\s+(.+)#', $this->entry, $result);
if (count($result)) { if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1])); $result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
$result = preg_split('/,\s*/', $result); $result = preg_split('/,\s*/', $result);
natsort($result); natsort($result);
} }
@@ -358,9 +358,9 @@ class Entry {
return $this->_name; return $this->_name;
} }
preg_match('#\* *@name\s+([^\n]+)#', $this->entry, $result); preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $result);
if (count($result)) { if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1])); $result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
} else { } else {
$result = array_shift(explode('(', $this->getCall())); $result = array_shift(explode('(', $this->getCall()));
} }
@@ -377,7 +377,7 @@ class Entry {
*/ */
public function getParams( $index = null ) { public function getParams( $index = null ) {
if (!isset($this->_params)) { if (!isset($this->_params)) {
preg_match_all('#\* *@param\s+\{([^}]+)\}\s+(\[.+\]|[$\w|]+(?:\[.+\])?)\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#i', $this->entry, $result); preg_match_all('#\*[\t ]*@param\s+\{([^}]+)\}\s+(\[.+\]|[$\w|]+(?:\[.+\])?)\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#i', $this->entry, $result);
if (count($result = array_filter(array_slice($result, 1)))) { if (count($result = array_filter(array_slice($result, 1)))) {
// repurpose array // repurpose array
foreach ($result as $param) { foreach ($result as $param) {
@@ -385,7 +385,7 @@ class Entry {
if (!is_array($result[0][$key])) { if (!is_array($result[0][$key])) {
$result[0][$key] = array(); $result[0][$key] = array();
} }
$result[0][$key][] = trim(preg_replace('/(?:^|\n)\s*\* */', ' ', $value)); $result[0][$key][] = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]*/', ' ', $value));
} }
} }
$result = $result[0]; $result = $result[0];
@@ -408,11 +408,11 @@ class Entry {
return $this->_returns; return $this->_returns;
} }
preg_match('#\* *@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result); preg_match('#\*[\t ]*@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) { if (count($result)) {
$result = array_map('trim', array_slice($result, 1)); $result = array_map('trim', array_slice($result, 1));
$result[0] = str_replace('|', ', ', $result[0]); $result[0] = str_replace('|', ', ', $result[0]);
$result[1] = preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]); $result[1] = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]);
} }
$this->_returns = $result; $this->_returns = $result;
return $result; return $result;
@@ -429,9 +429,9 @@ class Entry {
return $this->_type; return $this->_type;
} }
preg_match('#\* *@type\s+([^\n]+)#', $this->entry, $result); preg_match('#\*[\t ]*@type\s+(.+)#', $this->entry, $result);
if (count($result)) { if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1])); $result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
} else { } else {
$result = $this->isFunction() ? 'Function' : 'Unknown'; $result = $this->isFunction() ? 'Function' : 'Unknown';
} }

View File

@@ -121,7 +121,7 @@ class Generator {
$string = preg_replace('/(^|\s)(\([^)]+\))/', '$1*$2*', $string); $string = preg_replace('/(^|\s)(\([^)]+\))/', '$1*$2*', $string);
// mark numbers as inline code // mark numbers as inline code
$string = preg_replace('/ (-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string); $string = preg_replace('/[\t ](-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string);
// detokenize inline code snippets // detokenize inline code snippets
$counter = 0; $counter = 0;
@@ -321,9 +321,7 @@ class Generator {
$api[$member] = $entry; $api[$member] = $entry;
foreach ($entry->getAliases() as $alias) { foreach ($entry->getAliases() as $alias) {
$api[$member] = $alias; $api[$member]->static[] = $alias;
$alias->static = array();
$alias->plugin = array();
} }
} }
else if ($entry->isStatic()) { else if ($entry->isStatic()) {
@@ -559,7 +557,7 @@ class Generator {
array_push($result, $closeTag, $closeTag, '', ' [1]: #' . $toc . ' "Jump back to the TOC."'); array_push($result, $closeTag, $closeTag, '', ' [1]: #' . $toc . ' "Jump back to the TOC."');
// cleanup whitespace // cleanup whitespace
return trim(preg_replace('/ +\n/', "\n", join($result, "\n"))); return trim(preg_replace('/[\t ]+\n/', "\n", join($result, "\n")));
} }
} }
?> ?>

View File

@@ -18,7 +18,7 @@ For a list of upcoming features, check out our [roadmap](https://github.com/best
## Support ## Support
Platform.js has been tested in at least Chrome 5~26, Firefox 1~19, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.4, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5. Platform.js has been tested in at least Chrome 5~27, Firefox 2~21, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.10.7, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
## Installation and usage ## Installation and usage
@@ -89,10 +89,12 @@ info.description; // 'Opera 11.52 (identifying as Firefox 4.0) on Mac OS X 10.7.
## Author ## Author
* [John-David Dalton](http://allyoucanleet.com/) | [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton "Follow @jdalton on Twitter") |
[![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") |---|
| [John-David Dalton](http://allyoucanleet.com/) |
## Contributors ## Contributors
* [Mathias Bynens](http://mathiasbynens.be/) | [![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](http://twitter.com/mathias "Follow @mathias on Twitter") |
[![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |---|
| [Mathias Bynens](http://mathiasbynens.be/) |

View File

@@ -9,7 +9,7 @@ QUnit CLIB helps extend QUnits CLI support to many common CLI environments.
## Support ## Support
QUnit CLIB has been tested in at least Node.js 0.4.8-0.10.4, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5. QUnit CLIB has been tested in at least Node.js 0.4.8-0.10.7, Narwhal 0.3.2, PhantomJS 1.9.0, RingoJS 0.9, and Rhino 1.7RC5.
## Usage ## Usage
@@ -55,5 +55,6 @@ QUnit CLIB has been tested in at least Node.js 0.4.8-0.10.4, Narwhal 0.3.2, Phan
## Author ## Author
* [John-David Dalton](http://allyoucanleet.com/) | [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](http://twitter.com/jdalton "Follow @jdalton on Twitter") |
[![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") |---|
| [John-David Dalton](http://allyoucanleet.com/) |

View File

@@ -1,5 +1,5 @@
/** vim: et:ts=4:sw=4:sts=4 /** vim: et:ts=4:sw=4:sts=4
* @license RequireJS 2.1.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. * @license RequireJS 2.1.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license. * Available via the MIT or new BSD license.
* see: http://github.com/jrburke/requirejs for details * see: http://github.com/jrburke/requirejs for details
*/ */
@@ -12,7 +12,7 @@ var requirejs, require, define;
(function (global) { (function (global) {
var req, s, head, baseElement, dataMain, src, var req, s, head, baseElement, dataMain, src,
interactiveScript, currentlyAddingScript, mainScript, subPath, interactiveScript, currentlyAddingScript, mainScript, subPath,
version = '2.1.5', version = '2.1.6',
commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g, cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
jsSuffixRegExp = /\.js$/, jsSuffixRegExp = /\.js$/,
@@ -22,7 +22,7 @@ var requirejs, require, define;
hasOwn = op.hasOwnProperty, hasOwn = op.hasOwnProperty,
ap = Array.prototype, ap = Array.prototype,
apsp = ap.splice, apsp = ap.splice,
isBrowser = !!(typeof window !== 'undefined' && navigator && document), isBrowser = !!(typeof window !== 'undefined' && navigator && window.document),
isWebWorker = !isBrowser && typeof importScripts !== 'undefined', isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
//PS3 indicates loaded and complete, but need to wait for complete //PS3 indicates loaded and complete, but need to wait for complete
//specifically. Sequence is 'loading', 'loaded', execution, //specifically. Sequence is 'loading', 'loaded', execution,
@@ -134,6 +134,10 @@ var requirejs, require, define;
return document.getElementsByTagName('script'); return document.getElementsByTagName('script');
} }
function defaultOnError(err) {
throw err;
}
//Allow getting a global that expressed in //Allow getting a global that expressed in
//dot notation, like 'a.b.c'. //dot notation, like 'a.b.c'.
function getGlobal(value) { function getGlobal(value) {
@@ -500,7 +504,12 @@ var requirejs, require, define;
fn(defined[id]); fn(defined[id]);
} }
} else { } else {
getModule(depMap).on(name, fn); mod = getModule(depMap);
if (mod.error && name === 'error') {
fn(mod.error);
} else {
mod.on(name, fn);
}
} }
} }
@@ -571,7 +580,13 @@ var requirejs, require, define;
id: mod.map.id, id: mod.map.id,
uri: mod.map.url, uri: mod.map.url,
config: function () { config: function () {
return (config.config && getOwn(config.config, mod.map.id)) || {}; var c,
pkg = getOwn(config.pkgs, mod.map.id);
// For packages, only support config targeted
// at the main module.
c = pkg ? getOwn(config.config, mod.map.id + '/' + pkg.main) :
getOwn(config.config, mod.map.id);
return c || {};
}, },
exports: defined[mod.map.id] exports: defined[mod.map.id]
}); });
@@ -840,8 +855,13 @@ var requirejs, require, define;
if (this.depCount < 1 && !this.defined) { if (this.depCount < 1 && !this.defined) {
if (isFunction(factory)) { if (isFunction(factory)) {
//If there is an error listener, favor passing //If there is an error listener, favor passing
//to that instead of throwing an error. //to that instead of throwing an error. However,
if (this.events.error) { //only do it for define()'d modules. require
//errbacks should not be called for failures in
//their callbacks (#699). However if a global
//onError is set, use that.
if ((this.events.error && this.map.isDefine) ||
req.onError !== defaultOnError) {
try { try {
exports = context.execCb(id, factory, depExports, exports); exports = context.execCb(id, factory, depExports, exports);
} catch (e) { } catch (e) {
@@ -869,8 +889,8 @@ var requirejs, require, define;
if (err) { if (err) {
err.requireMap = this.map; err.requireMap = this.map;
err.requireModules = [this.map.id]; err.requireModules = this.map.isDefine ? [this.map.id] : null;
err.requireType = 'define'; err.requireType = this.map.isDefine ? 'define' : 'require';
return onError((this.error = err)); return onError((this.error = err));
} }
@@ -1093,7 +1113,7 @@ var requirejs, require, define;
})); }));
if (this.errback) { if (this.errback) {
on(depMap, 'error', this.errback); on(depMap, 'error', bind(this, this.errback));
} }
} }
@@ -1605,7 +1625,7 @@ var requirejs, require, define;
}, },
/** /**
* Executes a module callack function. Broken out as a separate function * Executes a module callback function. Broken out as a separate function
* solely to allow the build system to sequence the files in the built * solely to allow the build system to sequence the files in the built
* layer in the right sequence. * layer in the right sequence.
* *
@@ -1643,7 +1663,7 @@ var requirejs, require, define;
onScriptError: function (evt) { onScriptError: function (evt) {
var data = getScriptData(evt); var data = getScriptData(evt);
if (!hasPathFallback(data.id)) { if (!hasPathFallback(data.id)) {
return onError(makeError('scripterror', 'Script error', evt, [data.id])); return onError(makeError('scripterror', 'Script error for: ' + data.id, evt, [data.id]));
} }
} }
}; };
@@ -1772,9 +1792,7 @@ var requirejs, require, define;
* function. Intercept/override it if you want custom error handling. * function. Intercept/override it if you want custom error handling.
* @param {Error} err the error object. * @param {Error} err the error object.
*/ */
req.onError = function (err) { req.onError = defaultOnError;
throw err;
};
/** /**
* Does the request to load a module for the browser case. * Does the request to load a module for the browser case.
@@ -1906,24 +1924,31 @@ var requirejs, require, define;
//baseUrl, if it is not already set. //baseUrl, if it is not already set.
dataMain = script.getAttribute('data-main'); dataMain = script.getAttribute('data-main');
if (dataMain) { if (dataMain) {
//Preserve dataMain in case it is a path (i.e. contains '?')
mainScript = dataMain;
//Set final baseUrl if there is not already an explicit one. //Set final baseUrl if there is not already an explicit one.
if (!cfg.baseUrl) { if (!cfg.baseUrl) {
//Pull off the directory of data-main for use as the //Pull off the directory of data-main for use as the
//baseUrl. //baseUrl.
src = dataMain.split('/'); src = mainScript.split('/');
mainScript = src.pop(); mainScript = src.pop();
subPath = src.length ? src.join('/') + '/' : './'; subPath = src.length ? src.join('/') + '/' : './';
cfg.baseUrl = subPath; cfg.baseUrl = subPath;
dataMain = mainScript;
} }
//Strip off any trailing .js since dataMain is now //Strip off any trailing .js since mainScript is now
//like a module name. //like a module name.
dataMain = dataMain.replace(jsSuffixRegExp, ''); mainScript = mainScript.replace(jsSuffixRegExp, '');
//If mainScript is still a path, fall back to dataMain
if (req.jsExtRegExp.test(mainScript)) {
mainScript = dataMain;
}
//Put the data-main script in the files to load. //Put the data-main script in the files to load.
cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain]; cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript];
return true; return true;
} }
@@ -1951,12 +1976,13 @@ var requirejs, require, define;
//This module may not have dependencies //This module may not have dependencies
if (!isArray(deps)) { if (!isArray(deps)) {
callback = deps; callback = deps;
deps = []; deps = null;
} }
//If no name, and callback is a function, then figure out if it a //If no name, and callback is a function, then figure out if it a
//CommonJS thing with dependencies. //CommonJS thing with dependencies.
if (!deps.length && isFunction(callback)) { if (!deps && isFunction(callback)) {
deps = [];
//Remove comments from the callback string, //Remove comments from the callback string,
//look for require calls, and pull them into the dependencies, //look for require calls, and pull them into the dependencies,
//but only if there are function args. //but only if there are function args.

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,7 @@
// Underscore.js 1.4.4 // Underscore.js 1.4.4
// http://underscorejs.org // http://underscorejs.org
// (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. // (c) 2009-2011 Jeremy Ashkenas, DocumentCloud Inc.
// (c) 2011-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
// Underscore may be freely distributed under the MIT license. // Underscore may be freely distributed under the MIT license.
(function() { (function() {
@@ -21,11 +22,12 @@
var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
// Create quick reference variables for speed access to core prototypes. // Create quick reference variables for speed access to core prototypes.
var push = ArrayProto.push, var
slice = ArrayProto.slice, push = ArrayProto.push,
concat = ArrayProto.concat, slice = ArrayProto.slice,
toString = ObjProto.toString, concat = ArrayProto.concat,
hasOwnProperty = ObjProto.hasOwnProperty; toString = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty;
// All **ECMAScript 5** native function implementations that we hope to use // All **ECMAScript 5** native function implementations that we hope to use
// are declared here. // are declared here.
@@ -264,7 +266,7 @@
var result = {computed : -Infinity, value: -Infinity}; var result = {computed : -Infinity, value: -Infinity};
each(obj, function(value, index, list) { each(obj, function(value, index, list) {
var computed = iterator ? iterator.call(context, value, index, list) : value; var computed = iterator ? iterator.call(context, value, index, list) : value;
computed >= result.computed && (result = {value : value, computed : computed}); computed > result.computed && (result = {value : value, computed : computed});
}); });
return result.value; return result.value;
}; };
@@ -363,7 +365,7 @@
return low; return low;
}; };
// Safely convert anything iterable into a real, live array. // Safely create a real, live array from anything iterable.
_.toArray = function(obj) { _.toArray = function(obj) {
if (!obj) return []; if (!obj) return [];
if (_.isArray(obj)) return slice.call(obj); if (_.isArray(obj)) return slice.call(obj);
@@ -423,7 +425,7 @@
// Internal implementation of a recursive `flatten` function. // Internal implementation of a recursive `flatten` function.
var flatten = function(input, shallow, output) { var flatten = function(input, shallow, output) {
each(input, function(value) { each(input, function(value) {
if (_.isArray(value)) { if (_.isArray(value) || _.isArguments(value)) {
shallow ? push.apply(output, value) : flatten(value, shallow, output); shallow ? push.apply(output, value) : flatten(value, shallow, output);
} else { } else {
output.push(value); output.push(value);
@@ -466,7 +468,7 @@
// Produce an array that contains the union: each distinct element from all of // Produce an array that contains the union: each distinct element from all of
// the passed-in arrays. // the passed-in arrays.
_.union = function() { _.union = function() {
return _.uniq(concat.apply(ArrayProto, arguments)); return _.uniq(_.flatten(arguments, true));
}; };
// Produce an array that contains every item shared between all the // Produce an array that contains every item shared between all the
@@ -490,13 +492,7 @@
// Zip together multiple lists into a single array -- elements that share // Zip together multiple lists into a single array -- elements that share
// an index go together. // an index go together.
_.zip = function() { _.zip = function() {
var args = slice.call(arguments); return _.unzip(slice.call(arguments));
var length = _.max(_.pluck(args, 'length'));
var results = new Array(length);
for (var i = 0; i < length; i++) {
results[i] = _.pluck(args, "" + i);
}
return results;
}; };
// The inverse operation to `_.zip`. If given an array of pairs it // The inverse operation to `_.zip`. If given an array of pairs it
@@ -505,9 +501,13 @@
// three element array and so on. For example, `_.unzip` given // three element array and so on. For example, `_.unzip` given
// `[['a',1],['b',2],['c',3]]` returns the array // `[['a',1],['b',2],['c',3]]` returns the array
// [['a','b','c'],[1,2,3]]. // [['a','b','c'],[1,2,3]].
_.unzip = function(tuples) { _.unzip = function(list) {
var maxLen = _.max(_.pluck(tuples, "length")) var length = _.max(_.pluck(list, "length").concat(0));
return _.times(maxLen, _.partial(_.pluck, tuples)); var results = new Array(length);
for (var i = 0; i < length; i++) {
results[i] = _.pluck(list, '' + i);
}
return results;
}; };
// Converts lists into objects. Pass either a single array of `[key, value]` // Converts lists into objects. Pass either a single array of `[key, value]`
@@ -593,7 +593,7 @@
// available. // available.
_.bind = function(func, context) { _.bind = function(func, context) {
var args, bound; var args, bound;
if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
if (!_.isFunction(func)) throw new TypeError; if (!_.isFunction(func)) throw new TypeError;
args = slice.call(arguments, 2); args = slice.call(arguments, 2);
return bound = function() { return bound = function() {
@@ -651,7 +651,8 @@
// Returns a function, that, when invoked, will only be triggered at most once // Returns a function, that, when invoked, will only be triggered at most once
// during a given window of time. // during a given window of time.
_.throttle = function(func, wait, immediate) { _.throttle = function(func, wait, immediate) {
var context, args, timeout, result; var context, args, result;
var timeout = null;
var previous = 0; var previous = 0;
var later = function() { var later = function() {
previous = new Date; previous = new Date;
@@ -681,7 +682,8 @@
// N milliseconds. If `immediate` is passed, trigger the function on the // N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing. // leading edge, instead of the trailing.
_.debounce = function(func, wait, immediate) { _.debounce = function(func, wait, immediate) {
var timeout, result; var result;
var timeout = null;
return function() { return function() {
var context = this, args = arguments; var context = this, args = arguments;
var later = function() { var later = function() {