Compare commits

..

1 Commits
4.5.0 ... 2.4.1

Author SHA1 Message Date
Benjamin Tan
e21e993729 Update v2.4.1 docs 2015-01-23 15:00:16 +08:00
174 changed files with 60966 additions and 75688 deletions

View File

@@ -1,12 +0,0 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

4
.gitattributes vendored
View File

@@ -1 +1,5 @@
* text=auto
*.html text eol=lf
*.js text eol=lf
*.md text eol=lf
*.sh text eol=lf

10
.gitignore vendored
View File

@@ -1,7 +1,11 @@
.coveralls.yml
.DS_Store
*.custom.*
*.log
*.template.*
*.map
lodash.compat.min.js
coverage
/*.min.*
modularize
node_modules
dist/*.backbone.*
dist/*.legacy.*
dist/*.mobile.*

96
.jscsrc
View File

@@ -1,96 +0,0 @@
{
"maxErrors": "2000",
"maximumLineLength": {
"value": 180,
"allExcept": ["comments", "functionSignature", "regex"]
},
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
"requireOperatorBeforeLineBreak": [
"=",
"+",
"-",
"/",
"*",
"==",
"===",
"!=",
"!==",
">",
">=",
"<",
"<="
],
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"return",
"try",
"catch"
],
"requireSpaceBeforeBinaryOperators": [
"=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=",
"&=", "|=", "^=", "+=",
"+", "-", "*", "/", "%", "<<", ">>", ">>>", "&",
"|", "^", "&&", "||", "===", "==", ">=",
"<=", "<", ">", "!=", "!=="
],
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireDotNotation": { "allExcept": ["keywords"] },
"requireEarlyReturn": true,
"requireLineFeedAtFileEnd": true,
"requireSemicolons": true,
"requireSpaceAfterBinaryOperators": true,
"requireSpacesInConditionalExpression": true,
"requireSpaceBeforeObjectValues": true,
"requireSpaceBeforeBlockStatements": true,
"requireSpacesInForStatement": true,
"validateIndentation": 2,
"validateParameterSeparator": ", ",
"validateQuoteMarks": { "mark": "'", "escape": true },
"disallowSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"disallowKeywords": ["with"],
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineBreaks": true,
"disallowNewlineBeforeBlockStatements": true,
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpacesInCallExpression": true,
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"disallowTrailingWhitespace": true,
"jsDoc": {
"checkRedundantAccess": true,
"checkTypes": true,
"requireNewlineAfterDescription": true,
"requireParamDescription": true,
"requireParamTypes": true,
"requireReturnTypes": true
}
}

View File

@@ -1,77 +1,79 @@
language: node_js
sudo: false
node_js:
- "5"
- "0.6"
- "0.8"
- "0.10"
env:
global:
- BIN="node" ISTANBUL=false OPTION=""
- SAUCE_LABS=false SAUCE_USERNAME="lodash"
- BIN="node" BUILD=false COMPAT=false MAKE=false OPTION="" SAUCE_LABS=false SAUCE_USERNAME="lodash"
- secure: "tg1JFsIFnxzLaTboFPOnm+aJCuMm5+JdhLlESlqg9x3fwro++7KCnwHKLNovhchaPe4otC43ZMB/nfWhDnDm11dKbm/V6HlTkED+dadTsaLxVDg6J+7yK41QhokBPJOxLV78iDaNaAQVYEirAgZ0yn8kFubxmNKV+bpCGQNc9yU="
matrix:
-
- BIN="phantomjs"
- ISTANBUL=true
- SAUCE_LABS=true
- BUILD="compat"
- BUILD="modern"
- BUILD="legacy"
- BUILD="mobile"
- BIN="phantomjs" BUILD="compat"
- BIN="phantomjs" BUILD="legacy"
- BIN="phantomjs" BUILD="mobile"
matrix:
include:
- node_js: "0.10"
env:
- node_js: "0.12"
env:
- node_js: "4"
env:
env: BIN="istanbul"
- node_js: "0.10"
env: BIN="narwhal" BUILD="compat"
- node_js: "0.10"
env: BIN="narwhal" BUILD="legacy"
- node_js: "0.10"
env: BIN="rhino" BUILD="compat"
- node_js: "0.10"
env: BIN="rhino" BUILD="legacy"
- node_js: "0.10"
env: BIN="rhino" BUILD="compat" OPTION="-require"
- node_js: "0.10"
env: BIN="rhino" BUILD="legacy" OPTION="-require"
- node_js: "0.10"
env: BIN="ringo" BUILD="compat"
- node_js: "0.10"
env: BIN="ringo" BUILD="legacy"
- node_js: "0.8"
env: SAUCE_LABS=true BUILD="compat"
- node_js: "0.8"
env: SAUCE_LABS=true BUILD="modern"
- node_js: "0.8"
env: SAUCE_LABS=true BUILD="legacy"
- node_js: "0.8"
env: SAUCE_LABS=true BUILD="mobile"
- node_js: "0.8"
env: SAUCE_LABS=true BUILD="underscore"
git:
depth: 10
branches:
only:
- master
notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/4aab6358b0e9aed0b628
on_success: change
on_failure: always
before_install:
- "nvm use $TRAVIS_NODE_VERSION"
- "npm set loglevel error"
- "npm set progress false"
- "npm i -g npm@\"^2.0.0\""
- |
PATTERN[0]="|\s*if\s*\(isHostObject\b[\s\S]+?\}(?=\n)|"
PATTERN[1]="|\s*if\s*\(enumerate\b[\s\S]+?\};\s*\}|"
PATTERN[2]="|\s*while\s*\([^)]+\)\s*\{\s*iteratee\(index\);\s*\}|"
PATTERN[3]="|\s*else\s*\{\s*assocSet\(data\b[\s\S]+?\}|"
PATTERN[4]="|\s*if\s*\(ctorString\b[\s\S]+?\}\s*\}|"
PATTERN[5]="|\bindex,\s*iterable\)\s*===\s*false\)[^}]+?(break;)|"
PATTERN[6]="|\s*if\s*\(!lodashFunc\)\s*\{\s*return;\s*\}|"
PATTERN[7]="|\s*define\([\s\S]+?\);|"
PATTERN[8]="|\s*root\._\s*=\s*_;|"
if [ $ISTANBUL == true ]; then
set -e
for PTRN in ${PATTERN[@]}; do
node ./test/remove.js "$PTRN" ./lodash.js
done
fi
- "git clone --depth=10 --branch=master git://github.com/lodash/lodash-cli ./node_modules/lodash-cli && mkdir $_/node_modules && cd $_ && ln -s ../../../ ./lodash && cd ../ && npm i && cd ../../"
- "node ./node_modules/lodash-cli/bin/lodash -o ./dist/lodash.js"
- "([ $BUILD == 'legacy' ] || [ $BUILD == 'mobile' ] || [ $BUILD == 'modern' ]) && MAKE=true || true"
- "([ $BUILD == 'compat' ] || [ $BUILD == 'legacy' ]) && COMPAT=true || true"
- "[ $SAUCE_LABS != false ] && npm i ecstatic@\"~0.4.0\" request@\"~2.27.0\" sauce-tunnel@\"~1.1.0\" || true"
- "[ $BIN == 'istanbul' ] && npm i -g coveralls@\"~2.5.0\" istanbul@\"~0.1.0\" || true"
- "[ $BIN == 'narwhal' ] && wget https://github.com/280north/narwhal/archive/v0.3.2.zip && sudo unzip v0.3.2 -d /opt/ && rm v0.3.2.zip || true"
- "[ $BIN == 'narwhal' ] && sudo ln -s /opt/narwhal-0.3.2/bin/narwhal /usr/local/bin/narwhal && sudo chmod +x /usr/local/bin/narwhal || true"
- "[ $BIN == 'rhino' ] && sudo mkdir /opt/rhino-1.7R5 && sudo wget -O /opt/rhino-1.7R5/js.jar https://oss.sonatype.org/content/repositories/snapshots/org/mozilla/rhino/1.7R5-SNAPSHOT/rhino-1.7R5-20120629.144839-4.jar || true"
- "[ $BIN == 'rhino' ] && echo -e '#!/bin/sh\\njava -jar /opt/rhino-1.7R5/js.jar $@' | sudo tee /usr/local/bin/rhino && sudo chmod +x /usr/local/bin/rhino || true"
- "[ $BIN == 'ringo' ] && wget http://ringojs.org/downloads/ringojs-0.9.zip && sudo unzip ringojs-0.9 -d /opt && rm ringojs-0.9.zip || true"
- "[ $BIN == 'ringo' ] && sudo ln -s /opt/ringojs-0.9/bin/ringo /usr/local/bin/ringo && sudo chmod +x /usr/local/bin/ringo || true"
- "[ $MAKE != false ] && git clone --depth=10 --branch=master git://github.com/lodash/lodash-cli.git ./node_modules/lodash-cli || true"
- "[ $MAKE != false ] && mkdir ./node_modules/lodash-cli/node_modules && cd ./node_modules/lodash-cli/node_modules/ && ln -s ../../../ ./lodash && cd ../ && npm i . && cd ../../ || true"
- "[ $MAKE != false ] && node ./node_modules/lodash-cli/bin/lodash $BUILD -o ./dist/lodash.$BUILD.js || true"
script:
- "[ $ISTANBUL == false ] || istanbul cover -x \"**/vendor/**\" --report lcovonly ./test/test.js -- ./lodash.js"
- "[ $ISTANBUL == false ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/lcov.info | coveralls) || true"
- "[ $ISTANBUL == false ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || (cat ./coverage/coverage.json | codecov) || true"
- "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || cd ./test"
- "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || $BIN $OPTION ./test.js ../lodash.js"
- "[ $SAUCE_LABS == true ] || [ $ISTANBUL == true ] || [ $TRAVIS_SECURE_ENV_VARS == false ] || $BIN $OPTION ./test.js ../dist/lodash.min.js"
- "[ $SAUCE_LABS == false ] || rm -rf ./node_modules/lodash"
- "[ $SAUCE_LABS == false ] || ($BIN ./node_modules/lodash-cli/bin/lodash modularize exports=node -o ./node_modules/lodash && node ./node_modules/lodash-cli/bin/lodash -d -o ./node_modules/lodash/index.js)"
- "[ $SAUCE_LABS == false ] || $BIN ./node_modules/lodash-cli/bin/lodash core -o ./dist/lodash.core.js"
- "[ $SAUCE_LABS == false ] || npm run build"
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash tests\" runner=\"test/index.html?build=../dist/lodash.js&noglobals=true\" tags=\"development\""
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash tests\" runner=\"test/index.html?build=../dist/lodash.min.js&noglobals=true\" tags=\"production\""
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"lodash-fp tests\" runner=\"test/fp.html?noglobals=true\" tags=\"development\""
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=../dist/lodash.js\" tags=\"development,underscore\""
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=../dist/lodash.min.js\" tags=\"production,underscore\""
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.js\" tags=\"development,backbone\""
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.min.js\" tags=\"production,backbone\""
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.core.js\" tags=\"development,backbone\""
- "[ $SAUCE_LABS == false ] || $BIN ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.core.min.js\" tags=\"production,backbone\""
- "[ $BIN == 'istanbul' ] && $BIN cover -x \"**/vendor/**\" --report lcovonly ./test/test.js -- ./dist/lodash.js && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage || true"
- "([ $SAUCE_LABS != false ] || [ $BUILD == false ]) && true || cd ./test"
- "([ $SAUCE_LABS != false ] || [ $BUILD == false ]) && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.js"
- "([ $SAUCE_LABS != false ] || [ $BUILD == false ]) && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.min.js"
- "([ $SAUCE_LABS == false ] || [ $BUILD == 'underscore' ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=lodash-$BUILD\" tags=\"$BUILD,production\""
- "([ $SAUCE_LABS == false ] || [ $COMPAT == false ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=lodash-$BUILD\" tags=\"$BUILD,production,ie-compat\" compatMode=7"
- "([ $SAUCE_LABS == false ] || [ $BUILD == 'underscore' ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=../dist/lodash.$BUILD.js\" tags=\"$BUILD,development\""
- "([ $SAUCE_LABS == false ] || [ $COMPAT == false ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=../dist/lodash.$BUILD.js\" tags=\"$BUILD,development,ie-compat\" compatMode=7"
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=lodash-$BUILD\" tags=\"$BUILD,production,backbone\""
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.$BUILD.js\" tags=\"$BUILD,development,backbone\""
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=lodash-$BUILD\" tags=\"$BUILD,production,underscore\""
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=../dist/lodash.$BUILD.js\" tags=\"$BUILD,development,underscore\""

View File

@@ -1,49 +0,0 @@
# Contributor Code of Conduct
As contributors and maintainers of this project, and in the interest of
fostering an open and welcoming community, we pledge to respect all people who
contribute through reporting issues, posting feature requests, updating
documentation, submitting pull requests or patches, and other activities.
We are committed to making participation in this project a harassment-free
experience for everyone, regardless of level of experience, gender, gender
identity and expression, sexual orientation, disability, personal appearance,
body size, race, ethnicity, age, religion, or nationality.
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic
addresses, without explicit permission
* Other unethical or unprofessional conduct
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
By adopting this Code of Conduct, project maintainers commit themselves to
fairly and consistently applying these principles to every aspect of managing
this project. Project maintainers who do not follow or enforce the Code of
Conduct may be permanently removed from the project team.
This code of conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community.
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting a project maintainer at
[coc@lodash.com](mailto:coc@lodash.com). All complaints will be reviewed and
investigated and will result in a response that is deemed necessary and
appropriate to the circumstances. Maintainers are obligated to maintain
confidentiality with regard to the reporter of an incident.
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 1.3.0, available at
[http://contributor-covenant.org/version/1/3/0/][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/3/0/

View File

@@ -1,67 +1,35 @@
# Contributing to Lodash
# Contributing to Lo-Dash
Contributions are always welcome. Before contributing please read the
[code of conduct](https://github.com/lodash/lodash/blob/master/CODE_OF_CONDUCT.md)
& [search the issue tracker](https://github.com/lodash/lodash/issues); your issue
may have already been discussed or fixed in `master`. To contribute,
[fork](https://help.github.com/articles/fork-a-repo/) Lodash, commit your changes,
& [send a pull request](https://help.github.com/articles/using-pull-requests/).
If youd like to contribute a feature or bug fix, you can [fork](https://help.github.com/articles/fork-a-repo) Lo-Dash, commit your changes, and [send a pull request](https://help.github.com/articles/using-pull-requests).
Please make sure to [search the issue tracker](https://github.com/lodash/lodash/issues) first; your issue may have already been discussed or fixed in `master`.
## Feature Requests
## Tests
Feature requests are always welcome. They should be submitted in the
[issue tracker](https://github.com/lodash/lodash/issues), with a description of
the expected behavior & use case, where theyll remain closed until sufficient
interest has been shown by the community. Before submitting a request,
please search for similar ones in the
[closed issues](https://github.com/lodash/lodash/issues?q=is%3Aissue+is%3Aclosed+label%3Aenhancement).
## Pull Requests
For additions or bug fixes you should only need to modify `lodash.js`. Include
updated unit tests in the `test` directory as part of your pull request. Dont
worry about regenerating the `dist/` or `doc/` files.
Before running the unit tests youll need to install, `npm i`,
[development dependencies](https://docs.npmjs.com/files/package.json#devdependencies).
Run unit tests from the command-line via `npm test`, or open `test/index.html` &
`test/fp.html` in a web browser. The [Backbone](http://backbonejs.org/) &
[Underscore](http://underscorejs.org/) test suites are included as well.
Include updated unit tests in the `test` directory as part of your pull request.
You can run the tests from the command line via `node test/test`, or open `test/index.html` in a web browser.
The `test/run-test.sh` script attempts to run the tests in [Rhino](https://developer.mozilla.org/en-US/docs/Rhino), [Narwhal](https://github.com/280north/narwhal), [RingoJS](http://ringojs.org/), [PhantomJS](http://phantomjs.org/), and [Node](http://nodejs.org/), before running them in your default browser.
The [Backbone](http://backbonejs.org/) and [Underscore](http://http://underscorejs.org/) test suites are included as well.
## Contributor License Agreement
Lodash is a member of the [Dojo Foundation](http://dojofoundation.org/).
As such, we request that all contributors sign the Dojo Foundation
[contributor license agreement (CLA)](http://dojofoundation.org/about/claForm).
Lo-Dash is a member of the [Dojo Foundation](http://dojofoundation.org/).
As such, we request that all contributors sign the Dojo Foundation [contributor license agreement](http://dojofoundation.org/about/claForm).
For more information about CLAs, please check out Alex Russells excellent post,
[“Why Do I Need to Sign This?”](http://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
For more information about CLAs, please check out Alex Russells excellent post, [“Why Do I Need to Sign This?”](http://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
## Coding Guidelines
In addition to the following guidelines, please follow the conventions already
established in the code.
In addition to the following guidelines, please follow the conventions already established in the code.
- **Spacing**:<br>
Use two spaces for indentation. No tabs.
- **Naming**:<br>
Keep variable & method names concise & descriptive.<br>
Variable names `index`, `collection`, & `callback` are preferable to
`i`, `arr`, & `fn`.
Keep variable and method names concise and descriptive.<br>
Variable names `index`, `collection`, and `callback` are preferable to `i`, `arr`, and `fn`.
- **Quotes**:<br>
Single-quoted strings are preferred to double-quoted strings; however,
please use a double-quoted string if the value contains a single-quote
character to avoid unnecessary escaping.
Single-quoted strings are preferred to double-quoted strings; however, please use a double-quoted string if the value contains a single-quote character to avoid unnecessary escaping.
- **Comments**:<br>
Please use single-line comments to annotate significant additions, &
[JSDoc-style](http://www.2ality.com/2011/08/jsdoc-intro.html) comments for
functions.
Guidelines are enforced using [JSCS](https://www.npmjs.com/package/jscs):
```bash
$ npm run style
```
Please use single-line comments to annotate significant additions, and [JSDoc-style](http://www.2ality.com/2011/08/jsdoc-intro.html) comments for new methods.

23
LICENSE
View File

@@ -1,23 +0,0 @@
The MIT License (MIT)
Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

22
LICENSE.txt Normal file
View File

@@ -0,0 +1,22 @@
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

191
README.md
View File

@@ -1,52 +1,163 @@
# lodash v4.5.0
The [lodash](https://lodash.com/) library exported as a [UMD](https://github.com/umdjs/umd) module.
Generated using [lodash-cli](https://www.npmjs.com/package/lodash-cli):
```bash
$ npm run build
$ lodash -o ./dist/lodash.js
$ lodash core -o ./dist/lodash.core.js
```
## Community
[![Gitter](https://badges.gitter.im/lodash/lodash.svg)](https://gitter.im/lodash/lodash)
## Documentation
* [API Documentation](https://lodash.com/docs)
* [FP Guide](https://github.com/lodash/lodash/wiki/FP-Guide)
# Lo-Dash v2.4.1
A utility library delivering consistency, [customization](http://lodash.com/custom-builds), [performance](http://lodash.com/benchmarks), & [extras](http://lodash.com/#features).
## Download
Lodash is released under the [MIT license](https://raw.githubusercontent.com/lodash/lodash/4.5.0/LICENSE) & supports [modern environments](#support).<br>
Review the [build differences](https://github.com/lodash/lodash/wiki/build-differences) & pick one thats right for you.
Check out our [wiki]([https://github.com/lodash/lodash/wiki/build-differences]) for details over the differences between builds.
* [Core build](https://raw.githubusercontent.com/lodash/lodash/4.5.0/dist/lodash.core.js) ([~4 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.5.0/dist/lodash.core.min.js))
* [Full build](https://raw.githubusercontent.com/lodash/lodash/4.5.0/dist/lodash.js) ([~21 kB gzipped](https://raw.githubusercontent.com/lodash/lodash/4.5.0/dist/lodash.min.js))
* [CDN copies](https://www.jsdelivr.com/projects/lodash)
* Modern builds perfect for newer browsers/environments:<br>
[Development](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.js) &
[Production](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.min.js)
## Why Lodash?
* Compatibility builds for older environment support too:<br>
[Development](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.compat.js) &
[Production](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.compat.min.js)
Lodash makes JavaScript easier by taking the hassle out of working with arrays,<br>
numbers, objects, strings, etc. Lodashs modular methods are great for:
* Underscore builds to use as a drop-in replacement:<br>
[Development](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.underscore.js) &
[Production](https://raw.github.com/lodash/lodash/2.4.1/dist/lodash.underscore.min.js)
* Iterating arrays, objects, & strings
* Manipulating & testing values
* Creating composite functions
CDN copies are available on [cdnjs](http://cdnjs.com/libraries/lodash.js/) & [jsDelivr](http://www.jsdelivr.com/#!lodash). For smaller file sizes, create [custom builds](http://lodash.com/custom-builds) with only the features needed.
## Module Formats
Love modules? Weve got you covered with [lodash-amd](https://npmjs.org/package/lodash-amd), [lodash-es6](https://github.com/lodash/lodash-es6), [lodash-node](https://npmjs.org/package/lodash-node), & [npm packages](https://npmjs.org/browse/keyword/lodash-modularized) per method.
Lodash is available in a [variety of builds](https://lodash.com/custom-builds) & module formats.
## Dive in
* [lodash](https://www.npmjs.com/package/lodash) & [per method packages](https://www.npmjs.com/browse/keyword/lodash-modularized)
* [lodash-amd](https://www.npmjs.com/package/lodash-amd)
* [lodash-es](https://www.npmjs.com/package/lodash-es) & [babel-plugin-lodash](https://www.npmjs.com/package/babel-plugin-lodash)
* [lodash/fp](https://github.com/lodash/lodash/tree/4.5.0-npm/fp)
Theres plenty of **[documentation](http://lodash.com/docs)**, [unit tests](http://lodash.com/tests), & [benchmarks](http://lodash.com/benchmarks).<br>
Check out <a href="http://devdocs.io/lodash/">DevDocs</a> as a fast, organized, & searchable interface for our documentation.
## Further Reading
The full changelog for this release is available on our [wiki](https://github.com/lodash/lodash/wiki/Changelog).<br>
A list of upcoming features is available on our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap).
* [Contributing](https://github.com/lodash/lodash/blob/master/CONTRIBUTING.md)
* [Release Notes](https://github.com/lodash/lodash/releases/tag/4.0.0)
* [Wiki (Changelog, Roadmap, etc.)](https://github.com/lodash/lodash/wiki)
## Features *not* in Underscore
* AMD loader support ([curl](https://github.com/cujojs/curl), [dojo](http://dojotoolkit.org/), [requirejs](http://requirejs.org/), etc.)
* [_(…)](http://lodash.com/docs#_) supports intuitive chaining
* [_.at](http://lodash.com/docs#at) for cherry-picking collection values
* [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”*](http://michaux.ca/articles/lazy-function-definition-pattern) defined methods
* [_.clone](http://lodash.com/docs#clone) supports shallow cloning of `Date` & `RegExp` objects
* [_.cloneDeep](http://lodash.com/docs#cloneDeep) for deep cloning arrays & objects
* [_.constant](http://lodash.com/docs#constant) & [_.property](http://lodash.com/docs#property) function generators for composing functions
* [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex`
* [_.create](http://lodash.com/docs#create) for easier object inheritance
* [_.createCallback](http://lodash.com/docs#createCallback) for extending callbacks in methods & mixins
* [_.curry](http://lodash.com/docs#curry) for creating [curried](http://hughfdjackson.com/javascript/2013/07/06/why-curry-helps/) functions
* [_.debounce](http://lodash.com/docs#debounce) & [_.throttle](http://lodash.com/docs#throttle) accept additional `options` for more control
* [_.findIndex](http://lodash.com/docs#findIndex) & [_.findKey](http://lodash.com/docs#findKey) for finding indexes & keys
* [_.forEach](http://lodash.com/docs#forEach) is chainable & supports exiting early
* [_.forIn](http://lodash.com/docs#forIn) for iterating own & inherited properties
* [_.forOwn](http://lodash.com/docs#forOwn) for iterating own properties
* [_.isPlainObject](http://lodash.com/docs#isPlainObject) for checking if values are created by `Object`
* [_.mapValues](http://lodash.com/docs#mapValues) for [mapping](http://lodash.com/docs#map) values to an object
* [_.memoize](http://lodash.com/docs#memoize) exposes the `cache` of memoized functions
* [_.merge](http://lodash.com/docs#merge) for a deep [_.extend](http://lodash.com/docs#extend)
* [_.noop](http://lodash.com/docs#noop) for function placeholders
* [_.now](http://lodash.com/docs#now) as a cross-browser `Date.now` alternative
* [_.parseInt](http://lodash.com/docs#parseInt) for consistent behavior
* [_.pull](http://lodash.com/docs#pull) & [_.remove](http://lodash.com/docs#remove) for mutating arrays
* [_.random](http://lodash.com/docs#random) supports returning floating-point numbers
* [_.runInContext](http://lodash.com/docs#runInContext) for easier mocking
* [_.sortBy](http://lodash.com/docs#sortBy) supports sorting by multiple properties
* [_.support](http://lodash.com/docs#support) for flagging environment features
* [_.template](http://lodash.com/docs#template) supports [*“imports”*](http://lodash.com/docs#templateSettings_imports) options & [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals)
* [_.transform](http://lodash.com/docs#transform) as a powerful alternative to [_.reduce](http://lodash.com/docs#reduce) for transforming objects
* [_.where](http://lodash.com/docs#where) supports deep object comparisons
* [_.xor](http://lodash.com/docs#xor) as a companion to [_.difference](http://lodash.com/docs#difference), [_.intersection](http://lodash.com/docs#intersection), & [_.union](http://lodash.com/docs#union)
* [_.zip](http://lodash.com/docs#zip) is capable of unzipping values
* [_.omit](http://lodash.com/docs#omit), [_.pick](http://lodash.com/docs#pick), &
[more](http://lodash.com/docs "_.assign, _.clone, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept callbacks
* [_.contains](http://lodash.com/docs#contains), [_.toArray](http://lodash.com/docs#toArray), &
[more](http://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.forEachRight, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.size, _.some, _.sortBy, _.where") accept strings
* [_.filter](http://lodash.com/docs#filter), [_.map](http://lodash.com/docs#map), &
[more](http://lodash.com/docs "_.countBy, _.every, _.find, _.findKey, _.findLast, _.findLastIndex, _.findLastKey, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* & *“_.where”* shorthands
* [_.findLast](http://lodash.com/docs#findLast), [_.findLastIndex](http://lodash.com/docs#findLastIndex), &
[more](http://lodash.com/docs "_.findLastKey, _.forEachRight, _.forInRight, _.forOwnRight, _.partialRight") right-associative methods
## Resources
* Podcasts
- [JavaScript Jabber](http://javascriptjabber.com/079-jsj-lo-dash-with-john-david-dalton/)
* Posts
- [Say “Hello” to Lo-Dash](http://kitcambridge.be/blog/say-hello-to-lo-dash/)
- [Custom builds in Lo-Dash 2.0](http://kitcambridge.be/blog/custom-builds-in-lo-dash-2-dot-0/)
* Videos
- [Introduction](https://vimeo.com/44154599)
- [Origins](https://vimeo.com/44154600)
- [Optimizations & builds](https://vimeo.com/44154601)
- [Native method use](https://vimeo.com/48576012)
- [Testing](https://vimeo.com/45865290)
- [CascadiaJS 12](http://www.youtube.com/watch?v=dpPy4f_SeEk)
A list of other community created podcasts, posts, & videos is available on our [wiki](https://github.com/lodash/lodash/wiki/Resources).
## Support
Tested in Chrome 5~31, Firefox 2~25, IE 6-11, Opera 9.25~17, Safari 3-7, Node.js 0.6.21~0.10.22, Narwhal 0.3.2, PhantomJS 1.9.2, RingoJS 0.9, & Rhino 1.7RC5.<br>
Automated browser test results [are available](https://saucelabs.com/u/lodash) as well as [Travis CI](https://travis-ci.org/) builds for [lodash](https://travis-ci.org/lodash/lodash/), [lodash-cli](https://travis-ci.org/lodash/lodash-cli/), [lodash-amd](https://travis-ci.org/lodash/lodash-amd/), [lodash-node](https://travis-ci.org/lodash/lodash-node/), & [grunt-lodash](https://travis-ci.org/lodash/grunt-lodash).
Special thanks to [Sauce Labs](https://saucelabs.com/) for providing automated browser testing.<br>
[![Sauce Labs](http://lodash.com/_img/sauce.png)](https://saucelabs.com/ "Sauce Labs: Selenium Testing & More")
## Installation & usage
In browsers:
```html
<script src="lodash.js"></script>
```
Using [`npm`](http://npmjs.org/):
```bash
npm i --save lodash
{sudo} npm i -g lodash
npm ln lodash
```
In [Node.js](http://nodejs.org/) & [Ringo](http://ringojs.org/):
```js
var _ = require('lodash');
// or as Underscore
var _ = require('lodash/dist/lodash.underscore');
```
**Notes:**
* Dont assign values to [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL
* If Lo-Dash is installed globally, run [`npm ln lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your projects root directory *before* requiring it
In [Rhino](http://www.mozilla.org/rhino/):
```js
load('lodash.js');
```
In an AMD loader:
```js
require({
'packages': [
{ 'name': 'lodash', 'location': 'path/to/lodash', 'main': 'lodash' }
]
},
['lodash'], function(_) {
console.log(_.VERSION);
});
```
## Author
| [![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter") |
|---|
| [John-David Dalton](http://allyoucanleet.com/) |
## Contributors
| [![twitter/blainebublitz](http://gravatar.com/avatar/ac1c67fd906c9fecd823ce302283b4c1?s=70)](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [![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)](https://twitter.com/mathias "Follow @mathias on Twitter") |
|---|---|---|
| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/lodash/lodash/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

23
bower.json Normal file
View File

@@ -0,0 +1,23 @@
{
"name": "lodash",
"version": "2.4.1",
"main": "dist/lodash.compat.js",
"ignore": [
".*",
"*.custom.*",
"*.template.*",
"*.map",
"*.md",
"/*.min.*",
"/lodash.js",
"index.js",
"component.json",
"package.json",
"doc",
"modularize",
"node_modules",
"perf",
"test",
"vendor"
]
}

12
component.json Normal file
View File

@@ -0,0 +1,12 @@
{
"name": "lodash",
"repo": "lodash/lodash",
"version": "2.4.1",
"description": "A utility library delivering consistency, customization, performance, & extras.",
"license": "MIT",
"keywords": ["amd", "browser", "client", "functional", "server", "util"],
"scripts": [
"index.js",
"dist/lodash.compat.js"
]
}

7157
dist/lodash.compat.js vendored Normal file

File diff suppressed because it is too large Load Diff

61
dist/lodash.compat.min.js vendored Normal file
View File

@@ -0,0 +1,61 @@
/**
* @license
* Lo-Dash 2.4.1 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
* Build: `lodash -o ./dist/lodash.compat.js`
*/
;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function t(t,e){var r=typeof e;if(t=t.l,"boolean"==r||null==e)return t[e]?0:-1;"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:b+e;return t=(t=t[r])&&t[u],"object"==r?t&&-1<n(t,e)?0:-1:t?0:-1}function e(n){var t=this.l,e=typeof n;if("boolean"==e||null==n)t[n]=true;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:b+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=true
}}function r(n){return n.charCodeAt(0)}function u(n,t){for(var e=n.m,r=t.m,u=-1,o=e.length;++u<o;){var a=e[u],i=r[u];if(a!==i){if(a>i||typeof a=="undefined")return 1;if(a<i||typeof i=="undefined")return-1}}return n.n-t.n}function o(n){var t=-1,r=n.length,u=n[0],o=n[r/2|0],a=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&a&&typeof a=="object")return false;for(u=l(),u["false"]=u["null"]=u["true"]=u.undefined=false,o=l(),o.k=n,o.l=u,o.push=e;++t<r;)o.push(n[t]);return o}function a(n){return"\\"+Y[n]
}function i(){return v.pop()||[]}function l(){return y.pop()||{k:null,l:null,m:null,"false":false,n:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,o:null}}function f(n){return typeof n.toString!="function"&&typeof(n+"")=="string"}function c(n){n.length=0,v.length<w&&v.push(n)}function p(n){var t=n.l;t&&p(t),n.k=n.l=n.m=n.object=n.number=n.string=n.o=null,y.length<w&&y.push(n)}function s(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];
return u}function g(e){function v(n){return n&&typeof n=="object"&&!qe(n)&&we.call(n,"__wrapped__")?n:new y(n)}function y(n,t){this.__chain__=!!t,this.__wrapped__=n}function w(n){function t(){if(r){var n=s(r);je.apply(n,arguments)}if(this instanceof t){var o=nt(e.prototype),n=e.apply(o,n||arguments);return xt(n)?n:o}return e.apply(u,n||arguments)}var e=n[0],r=n[2],u=n[4];return ze(t,n),t}function Y(n,t,e,r,u){if(e){var o=e(n);if(typeof o!="undefined")return o}if(!xt(n))return n;var a=he.call(n);if(!V[a]||!Le.nodeClass&&f(n))return n;
var l=Te[a];switch(a){case L:case z:return new l(+n);case W:case M:return new l(n);case J:return o=l(n.source,S.exec(n)),o.lastIndex=n.lastIndex,o}if(a=qe(n),t){var p=!r;r||(r=i()),u||(u=i());for(var g=r.length;g--;)if(r[g]==n)return u[g];o=a?l(n.length):{}}else o=a?s(n):Ye({},n);return a&&(we.call(n,"index")&&(o.index=n.index),we.call(n,"input")&&(o.input=n.input)),t?(r.push(n),u.push(o),(a?Xe:tr)(n,function(n,a){o[a]=Y(n,t,e,r,u)}),p&&(c(r),c(u)),o):o}function nt(n){return xt(n)?Se(n):{}}function tt(n,t,e){if(typeof n!="function")return Ht;
if(typeof t=="undefined"||!("prototype"in n))return n;var r=n.__bindData__;if(typeof r=="undefined"&&(Le.funcNames&&(r=!n.name),r=r||!Le.funcDecomp,!r)){var u=be.call(n);Le.funcNames||(r=!A.test(u)),r||(r=B.test(u),ze(n,r))}if(false===r||true!==r&&1&r[1])return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,o){return n.call(t,e,r,u,o)}}return Mt(n,t)}function et(n){function t(){var n=l?a:this;
if(u){var h=s(u);je.apply(h,arguments)}return(o||c)&&(h||(h=s(arguments)),o&&je.apply(h,o),c&&h.length<i)?(r|=16,et([e,p?r:-4&r,h,null,a,i])):(h||(h=arguments),f&&(e=n[g]),this instanceof t?(n=nt(e.prototype),h=e.apply(n,h),xt(h)?h:n):e.apply(n,h))}var e=n[0],r=n[1],u=n[2],o=n[3],a=n[4],i=n[5],l=1&r,f=2&r,c=4&r,p=8&r,g=e;return ze(t,n),t}function rt(e,r){var u=-1,a=ht(),i=e?e.length:0,l=i>=_&&a===n,f=[];if(l){var c=o(r);c?(a=t,r=c):l=false}for(;++u<i;)c=e[u],0>a(r,c)&&f.push(c);return l&&p(r),f}function ot(n,t,e,r){r=(r||0)-1;
for(var u=n?n.length:0,o=[];++r<u;){var a=n[r];if(a&&typeof a=="object"&&typeof a.length=="number"&&(qe(a)||dt(a))){t||(a=ot(a,t,e));var i=-1,l=a.length,f=o.length;for(o.length+=l;++i<l;)o[f++]=a[i]}else e||o.push(a)}return o}function at(n,t,e,r,u,o){if(e){var a=e(n,t);if(typeof a!="undefined")return!!a}if(n===t)return 0!==n||1/n==1/t;if(n===n&&!(n&&X[typeof n]||t&&X[typeof t]))return false;if(null==n||null==t)return n===t;var l=he.call(n),p=he.call(t);if(l==T&&(l=G),p==T&&(p=G),l!=p)return false;switch(l){case L:case z:return+n==+t;
case W:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case J:case M:return n==ie(t)}if(p=l==$,!p){var s=we.call(n,"__wrapped__"),g=we.call(t,"__wrapped__");if(s||g)return at(s?n.__wrapped__:n,g?t.__wrapped__:t,e,r,u,o);if(l!=G||!Le.nodeClass&&(f(n)||f(t)))return false;if(l=!Le.argsObject&&dt(n)?oe:n.constructor,s=!Le.argsObject&&dt(t)?oe:t.constructor,l!=s&&!(jt(l)&&l instanceof l&&jt(s)&&s instanceof s)&&"constructor"in n&&"constructor"in t)return false}for(l=!u,u||(u=i()),o||(o=i()),s=u.length;s--;)if(u[s]==n)return o[s]==t;
var h=0,a=true;if(u.push(n),o.push(t),p){if(s=n.length,h=t.length,(a=h==s)||r)for(;h--;)if(p=s,g=t[h],r)for(;p--&&!(a=at(n[p],g,e,r,u,o)););else if(!(a=at(n[h],g,e,r,u,o)))break}else nr(t,function(t,i,l){return we.call(l,i)?(h++,a=we.call(n,i)&&at(n[i],t,e,r,u,o)):void 0}),a&&!r&&nr(n,function(n,t,e){return we.call(e,t)?a=-1<--h:void 0});return u.pop(),o.pop(),l&&(c(u),c(o)),a}function it(n,t,e,r,u){(qe(t)?Dt:tr)(t,function(t,o){var a,i,l=t,f=n[o];if(t&&((i=qe(t))||er(t))){for(l=r.length;l--;)if(a=r[l]==t){f=u[l];
break}if(!a){var c;e&&(l=e(f,t),c=typeof l!="undefined")&&(f=l),c||(f=i?qe(f)?f:[]:er(f)?f:{}),r.push(t),u.push(f),c||it(f,t,e,r,u)}}else e&&(l=e(f,t),typeof l=="undefined"&&(l=t)),typeof l!="undefined"&&(f=l);n[o]=f})}function lt(n,t){return n+de(Fe()*(t-n+1))}function ft(e,r,u){var a=-1,l=ht(),f=e?e.length:0,s=[],g=!r&&f>=_&&l===n,h=u||g?i():s;for(g&&(h=o(h),l=t);++a<f;){var v=e[a],y=u?u(v,a,e):v;(r?!a||h[h.length-1]!==y:0>l(h,y))&&((u||g)&&h.push(y),s.push(v))}return g?(c(h.k),p(h)):u&&c(h),s}function ct(n){return function(t,e,r){var u={};
if(e=v.createCallback(e,r,3),qe(t)){r=-1;for(var o=t.length;++r<o;){var a=t[r];n(u,a,e(a,r,t),t)}}else Xe(t,function(t,r,o){n(u,t,e(t,r,o),o)});return u}}function pt(n,t,e,r,u,o){var a=1&t,i=4&t,l=16&t,f=32&t;if(!(2&t||jt(n)))throw new le;l&&!e.length&&(t&=-17,l=e=false),f&&!r.length&&(t&=-33,f=r=false);var c=n&&n.__bindData__;return c&&true!==c?(c=s(c),c[2]&&(c[2]=s(c[2])),c[3]&&(c[3]=s(c[3])),!a||1&c[1]||(c[4]=u),!a&&1&c[1]&&(t|=8),!i||4&c[1]||(c[5]=o),l&&je.apply(c[2]||(c[2]=[]),e),f&&Ee.apply(c[3]||(c[3]=[]),r),c[1]|=t,pt.apply(null,c)):(1==t||17===t?w:et)([n,t,e,r,u,o])
}function st(){Q.h=F,Q.b=Q.c=Q.g=Q.i="",Q.e="t",Q.j=true;for(var n,t=0;n=arguments[t];t++)for(var e in n)Q[e]=n[e];t=Q.a,Q.d=/^[^,]+/.exec(t)[0],n=ee,t="return function("+t+"){",e=Q;var r="var n,t="+e.d+",E="+e.e+";if(!t)return E;"+e.i+";";e.b?(r+="var u=t.length;n=-1;if("+e.b+"){",Le.unindexedChars&&(r+="if(s(t)){t=t.split('')}"),r+="while(++n<u){"+e.g+";}}else{"):Le.nonEnumArgs&&(r+="var u=t.length;n=-1;if(u&&p(t)){while(++n<u){n+='';"+e.g+";}}else{"),Le.enumPrototypes&&(r+="var G=typeof t=='function';"),Le.enumErrorProps&&(r+="var F=t===k||t instanceof Error;");
var u=[];if(Le.enumPrototypes&&u.push('!(G&&n=="prototype")'),Le.enumErrorProps&&u.push('!(F&&(n=="message"||n=="name"))'),e.j&&e.f)r+="var C=-1,D=B[typeof t]&&v(t),u=D?D.length:0;while(++C<u){n=D[C];",u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}";else if(r+="for(n in t){",e.j&&u.push("m.call(t, n)"),u.length&&(r+="if("+u.join("&&")+"){"),r+=e.g+";",u.length&&(r+="}"),r+="}",Le.nonEnumShadows){for(r+="if(t!==A){var i=t.constructor,r=t===(i&&i.prototype),f=t===J?I:t===k?j:L.call(t),x=y[f];",k=0;7>k;k++)r+="n='"+e.h[k]+"';if((!(r&&x[n])&&m.call(t,n))",e.j||(r+="||(!x[n]&&t[n]!==A[n])"),r+="){"+e.g+"}";
r+="}"}return(e.b||Le.nonEnumArgs)&&(r+="}"),r+=e.c+";return E",n("d,j,k,m,o,p,q,s,v,A,B,y,I,J,L",t+r+"}")(tt,q,ce,we,d,dt,qe,kt,Q.f,pe,X,$e,M,se,he)}function gt(n){return Ve[n]}function ht(){var t=(t=v.indexOf)===zt?n:t;return t}function vt(n){return typeof n=="function"&&ve.test(n)}function yt(n){var t,e;return!n||he.call(n)!=G||(t=n.constructor,jt(t)&&!(t instanceof t))||!Le.argsClass&&dt(n)||!Le.nodeClass&&f(n)?false:Le.ownLast?(nr(n,function(n,t,r){return e=we.call(r,t),false}),false!==e):(nr(n,function(n,t){e=t
}),typeof e=="undefined"||we.call(n,e))}function mt(n){return He[n]}function dt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&he.call(n)==T||false}function bt(n,t,e){var r=We(n),u=r.length;for(t=tt(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function _t(n){var t=[];return nr(n,function(n,e){jt(n)&&t.push(e)}),t.sort()}function wt(n){for(var t=-1,e=We(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function jt(n){return typeof n=="function"}function xt(n){return!(!n||!X[typeof n])
}function Ct(n){return typeof n=="number"||n&&typeof n=="object"&&he.call(n)==W||false}function kt(n){return typeof n=="string"||n&&typeof n=="object"&&he.call(n)==M||false}function Et(n){for(var t=-1,e=We(n),r=e.length,u=Zt(r);++t<r;)u[t]=n[e[t]];return u}function Ot(n,t,e){var r=-1,u=ht(),o=n?n.length:0,a=false;return e=(0>e?Be(0,o+e):e)||0,qe(n)?a=-1<u(n,t,e):typeof o=="number"?a=-1<(kt(n)?n.indexOf(t,e):u(n,t,e)):Xe(n,function(n){return++r<e?void 0:!(a=n===t)}),a}function St(n,t,e){var r=true;if(t=v.createCallback(t,e,3),qe(n)){e=-1;
for(var u=n.length;++e<u&&(r=!!t(n[e],e,n)););}else Xe(n,function(n,e,u){return r=!!t(n,e,u)});return r}function At(n,t,e){var r=[];if(t=v.createCallback(t,e,3),qe(n)){e=-1;for(var u=n.length;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}}else Xe(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function It(n,t,e){if(t=v.createCallback(t,e,3),!qe(n)){var r;return Xe(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0}),r}e=-1;for(var u=n.length;++e<u;){var o=n[e];if(t(o,e,n))return o}}function Dt(n,t,e){if(t&&typeof e=="undefined"&&qe(n)){e=-1;
for(var r=n.length;++e<r&&false!==t(n[e],e,n););}else Xe(n,t,e);return n}function Nt(n,t,e){var r=n,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:tt(t,e,3),qe(n))for(;u--&&false!==t(n[u],u,n););else{if(typeof u!="number")var o=We(n),u=o.length;else Le.unindexedChars&&kt(n)&&(r=n.split(""));Xe(n,function(n,e,a){return e=o?o[--u]:--u,t(r[e],e,a)})}return n}function Bt(n,t,e){var r=-1,u=n?n.length:0,o=Zt(typeof u=="number"?u:0);if(t=v.createCallback(t,e,3),qe(n))for(;++r<u;)o[r]=t(n[r],r,n);else Xe(n,function(n,e,u){o[++r]=t(n,e,u)
});return o}function Pt(n,t,e){var u=-1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&qe(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i>o&&(o=i)}}else t=null==t&&kt(n)?r:v.createCallback(t,e,3),Xe(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Rt(n,t,e,r){var u=3>arguments.length;if(t=v.createCallback(t,r,4),qe(n)){var o=-1,a=n.length;for(u&&(e=n[++o]);++o<a;)e=t(e,n[o],o,n)}else Xe(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)});return e}function Ft(n,t,e,r){var u=3>arguments.length;
return t=v.createCallback(t,r,4),Nt(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function Tt(n){var t=-1,e=n?n.length:0,r=Zt(typeof e=="number"?e:0);return Dt(n,function(n){var e=lt(0,++t);r[t]=r[e],r[e]=n}),r}function $t(n,t,e){var r;if(t=v.createCallback(t,e,3),qe(n)){e=-1;for(var u=n.length;++e<u&&!(r=t(n[e],e,n)););}else Xe(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function Lt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;for(t=v.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++
}else if(r=t,null==r||e)return n?n[0]:h;return s(n,0,Pe(Be(0,r),u))}function zt(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?Be(0,u+r):r||0}else if(r)return r=Kt(t,e),t[r]===e?r:-1;return n(t,e,r)}function qt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=v.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Be(0,t);return s(n,r)}function Kt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?v.createCallback(e,r,1):Ht,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;
return u}function Wt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(e=v.createCallback(e,r,3)),ft(n,t,e)}function Gt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?Pt(ar(n,"length")):0,r=Zt(0>e?0:e);++t<e;)r[t]=ar(n,t);return r}function Jt(n,t){var e=-1,r=n?n.length:0,u={};for(t||!r||qe(n[0])||(t=[]);++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function Mt(n,t){return 2<arguments.length?pt(n,17,s(arguments,2),null,t):pt(n,1,null,null,t)
}function Vt(n,t,e){var r,u,o,a,i,l,f,c=0,p=false,s=true;if(!jt(n))throw new le;if(t=Be(0,t)||0,true===e)var g=true,s=false;else xt(e)&&(g=e.leading,p="maxWait"in e&&(Be(t,e.maxWait)||0),s="trailing"in e?e.trailing:s);var v=function(){var e=t-(ir()-a);0<e?l=Ce(v,e):(u&&me(u),e=f,u=l=f=h,e&&(c=ir(),o=n.apply(i,r),l||u||(r=i=null)))},y=function(){l&&me(l),u=l=f=h,(s||p!==t)&&(c=ir(),o=n.apply(i,r),l||u||(r=i=null))};return function(){if(r=arguments,a=ir(),i=this,f=s&&(l||!g),false===p)var e=g&&!l;else{u||g||(c=a);
var h=p-(a-c),m=0>=h;m?(u&&(u=me(u)),c=a,o=n.apply(i,r)):u||(u=Ce(y,h))}return m&&l?l=me(l):l||t===p||(l=Ce(v,t)),e&&(m=true,o=n.apply(i,r)),!m||l||u||(r=i=null),o}}function Ht(n){return n}function Ut(n,t,e){var r=true,u=t&&_t(t);t&&(e||u.length)||(null==e&&(e=t),o=y,t=n,n=v,u=_t(t)),false===e?r=false:xt(e)&&"chain"in e&&(r=e.chain);var o=n,a=jt(o);Dt(u,function(e){var u=n[e]=t[e];a&&(o.prototype[e]=function(){var t=this.__chain__,e=this.__wrapped__,a=[e];if(je.apply(a,arguments),a=u.apply(n,a),r||t){if(e===a&&xt(a))return this;
a=new o(a),a.__chain__=t}return a})})}function Qt(){}function Xt(n){return function(t){return t[n]}}function Yt(){return this.__wrapped__}e=e?ut.defaults(Z.Object(),e,ut.pick(Z,R)):Z;var Zt=e.Array,ne=e.Boolean,te=e.Date,ee=e.Function,re=e.Math,ue=e.Number,oe=e.Object,ae=e.RegExp,ie=e.String,le=e.TypeError,fe=[],ce=e.Error.prototype,pe=oe.prototype,se=ie.prototype,ge=e._,he=pe.toString,ve=ae("^"+ie(he).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),ye=re.ceil,me=e.clearTimeout,de=re.floor,be=ee.prototype.toString,_e=vt(_e=oe.getPrototypeOf)&&_e,we=pe.hasOwnProperty,je=fe.push,xe=pe.propertyIsEnumerable,Ce=e.setTimeout,ke=fe.splice,Ee=fe.unshift,Oe=function(){try{var n={},t=vt(t=oe.defineProperty)&&t,e=t(n,n,n)&&t
}catch(r){}return e}(),Se=vt(Se=oe.create)&&Se,Ae=vt(Ae=Zt.isArray)&&Ae,Ie=e.isFinite,De=e.isNaN,Ne=vt(Ne=oe.keys)&&Ne,Be=re.max,Pe=re.min,Re=e.parseInt,Fe=re.random,Te={};Te[$]=Zt,Te[L]=ne,Te[z]=te,Te[K]=ee,Te[G]=oe,Te[W]=ue,Te[J]=ae,Te[M]=ie;var $e={};$e[$]=$e[z]=$e[W]={constructor:true,toLocaleString:true,toString:true,valueOf:true},$e[L]=$e[M]={constructor:true,toString:true,valueOf:true},$e[q]=$e[K]=$e[J]={constructor:true,toString:true},$e[G]={constructor:true},function(){for(var n=F.length;n--;){var t,e=F[n];
for(t in $e)we.call($e,t)&&!we.call($e[t],e)&&($e[t][e]=false)}}(),y.prototype=v.prototype;var Le=v.support={};!function(){var n=function(){this.x=1},t={0:1,length:1},r=[];n.prototype={valueOf:1,y:1};for(var u in new n)r.push(u);for(u in arguments);Le.argsClass=he.call(arguments)==T,Le.argsObject=arguments.constructor==oe&&!(arguments instanceof Zt),Le.enumErrorProps=xe.call(ce,"message")||xe.call(ce,"name"),Le.enumPrototypes=xe.call(n,"prototype"),Le.funcDecomp=!vt(e.WinRTError)&&B.test(g),Le.funcNames=typeof ee.name=="string",Le.nonEnumArgs=0!=u,Le.nonEnumShadows=!/valueOf/.test(r),Le.ownLast="x"!=r[0],Le.spliceObjects=(fe.splice.call(t,0,1),!t[0]),Le.unindexedChars="xx"!="x"[0]+oe("x")[0];
try{Le.nodeClass=!(he.call(document)==G&&!({toString:0}+""))}catch(o){Le.nodeClass=true}}(1),v.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:I,variable:"",imports:{_:v}},Se||(nt=function(){function n(){}return function(t){if(xt(t)){n.prototype=t;var r=new n;n.prototype=null}return r||e.Object()}}());var ze=Oe?function(n,t){U.value=t,Oe(n,"__bindData__",U)}:Qt;Le.argsClass||(dt=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&we.call(n,"callee")&&!xe.call(n,"callee")||false
});var qe=Ae||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&he.call(n)==$||false},Ke=st({a:"z",e:"[]",i:"if(!(B[typeof z]))return E",g:"E.push(n)"}),We=Ne?function(n){return xt(n)?Le.enumPrototypes&&typeof n=="function"||Le.nonEnumArgs&&n.length&&dt(n)?Ke(n):Ne(n):[]}:Ke,Ge={a:"g,e,K",i:"e=e&&typeof K=='undefined'?e:d(e,K,3)",b:"typeof u=='number'",v:We,g:"if(e(t[n],n,g)===false)return E"},Je={a:"z,H,l",i:"var a=arguments,b=0,c=typeof l=='number'?2:a.length;while(++b<c){t=a[b];if(t&&B[typeof t]){",v:We,g:"if(typeof E[n]=='undefined')E[n]=t[n]",c:"}}"},Me={i:"if(!B[typeof t])return E;"+Ge.i,b:false},Ve={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},He=wt(Ve),Ue=ae("("+We(He).join("|")+")","g"),Qe=ae("["+We(Ve).join("")+"]","g"),Xe=st(Ge),Ye=st(Je,{i:Je.i.replace(";",";if(c>3&&typeof a[c-2]=='function'){var e=d(a[--c-1],a[c--],2)}else if(c>2&&typeof a[c-1]=='function'){e=a[--c]}"),g:"E[n]=e?e(E[n],t[n]):t[n]"}),Ze=st(Je),nr=st(Ge,Me,{j:false}),tr=st(Ge,Me);
jt(/x/)&&(jt=function(n){return typeof n=="function"&&he.call(n)==K});var er=_e?function(n){if(!n||he.call(n)!=G||!Le.argsClass&&dt(n))return false;var t=n.valueOf,e=vt(t)&&(e=_e(t))&&_e(e);return e?n==e||_e(n)==e:yt(n)}:yt,rr=ct(function(n,t,e){we.call(n,e)?n[e]++:n[e]=1}),ur=ct(function(n,t,e){(we.call(n,e)?n[e]:n[e]=[]).push(t)}),or=ct(function(n,t,e){n[e]=t}),ar=Bt,ir=vt(ir=te.now)&&ir||function(){return(new te).getTime()},lr=8==Re(j+"08")?Re:function(n,t){return Re(kt(n)?n.replace(D,""):n,t||0)};
return v.after=function(n,t){if(!jt(t))throw new le;return function(){return 1>--n?t.apply(this,arguments):void 0}},v.assign=Ye,v.at=function(n){var t=arguments,e=-1,r=ot(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Zt(t);for(Le.unindexedChars&&kt(n)&&(n=n.split(""));++e<t;)u[e]=n[r[e]];return u},v.bind=Mt,v.bindAll=function(n){for(var t=1<arguments.length?ot(arguments,true,false,1):_t(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=pt(n[u],1,null,null,n)}return n},v.bindKey=function(n,t){return 2<arguments.length?pt(t,19,s(arguments,2),null,n):pt(t,3,null,null,n)
},v.chain=function(n){return n=new y(n),n.__chain__=true,n},v.compact=function(n){for(var t=-1,e=n?n.length:0,r=[];++t<e;){var u=n[t];u&&r.push(u)}return r},v.compose=function(){for(var n=arguments,t=n.length;t--;)if(!jt(n[t]))throw new le;return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},v.constant=function(n){return function(){return n}},v.countBy=rr,v.create=function(n,t){var e=nt(n);return t?Ye(e,t):e},v.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return tt(n,t,e);
if("object"!=r)return Xt(n);var u=We(n),o=u[0],a=n[o];return 1!=u.length||a!==a||xt(a)?function(t){for(var e=u.length,r=false;e--&&(r=at(t[u[e]],n[u[e]],null,true)););return r}:function(n){return n=n[o],a===n&&(0!==a||1/a==1/n)}},v.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,pt(n,4,null,null,null,t)},v.debounce=Vt,v.defaults=Ze,v.defer=function(n){if(!jt(n))throw new le;var t=s(arguments,1);return Ce(function(){n.apply(h,t)},1)},v.delay=function(n,t){if(!jt(n))throw new le;var e=s(arguments,2);
return Ce(function(){n.apply(h,e)},t)},v.difference=function(n){return rt(n,ot(arguments,true,true,1))},v.filter=At,v.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(n=Bt(n,e,r)),ot(n,t)},v.forEach=Dt,v.forEachRight=Nt,v.forIn=nr,v.forInRight=function(n,t,e){var r=[];nr(n,function(n,t){r.push(t,n)});var u=r.length;for(t=tt(t,e,3);u--&&false!==t(r[u--],r[u],n););return n},v.forOwn=tr,v.forOwnRight=bt,v.functions=_t,v.groupBy=ur,v.indexBy=or,v.initial=function(n,t,e){var r=0,u=n?n.length:0;
if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return s(n,0,Pe(Be(0,u-r),u))},v.intersection=function(){for(var e=[],r=-1,u=arguments.length,a=i(),l=ht(),f=l===n,s=i();++r<u;){var g=arguments[r];(qe(g)||dt(g))&&(e.push(g),a.push(f&&g.length>=_&&o(r?e[r]:s)))}var f=e[0],h=-1,v=f?f.length:0,y=[];n:for(;++h<v;){var m=a[0],g=f[h];if(0>(m?t(m,g):l(s,g))){for(r=u,(m||s).push(g);--r;)if(m=a[r],0>(m?t(m,g):l(e[r],g)))continue n;y.push(g)
}}for(;u--;)(m=a[u])&&p(m);return c(a),c(s),y},v.invert=wt,v.invoke=function(n,t){var e=s(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,a=Zt(typeof o=="number"?o:0);return Dt(n,function(n){a[++r]=(u?t:n[t]).apply(n,e)}),a},v.keys=We,v.map=Bt,v.mapValues=function(n,t,e){var r={};return t=v.createCallback(t,e,3),tr(n,function(n,e,u){r[e]=t(n,e,u)}),r},v.max=Pt,v.memoize=function(n,t){if(!jt(n))throw new le;var e=function(){var r=e.cache,u=t?t.apply(this,arguments):b+arguments[0];return we.call(r,u)?r[u]:r[u]=n.apply(this,arguments)
};return e.cache={},e},v.merge=function(n){var t=arguments,e=2;if(!xt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=tt(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=s(arguments,1,e),u=-1,o=i(),a=i();++u<e;)it(n,t[u],r,o,a);return c(o),c(a),n},v.min=function(n,t,e){var u=1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&qe(n)){e=-1;for(var a=n.length;++e<a;){var i=n[e];i<o&&(o=i)}}else t=null==t&&kt(n)?r:v.createCallback(t,e,3),Xe(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n)
});return o},v.omit=function(n,t,e){var r={};if(typeof t!="function"){var u=[];nr(n,function(n,t){u.push(t)});for(var u=rt(u,ot(arguments,true,false,1)),o=-1,a=u.length;++o<a;){var i=u[o];r[i]=n[i]}}else t=v.createCallback(t,e,3),nr(n,function(n,e,u){t(n,e,u)||(r[e]=n)});return r},v.once=function(n){var t,e;if(!jt(n))throw new le;return function(){return t?e:(t=true,e=n.apply(this,arguments),n=null,e)}},v.pairs=function(n){for(var t=-1,e=We(n),r=e.length,u=Zt(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u
},v.partial=function(n){return pt(n,16,s(arguments,1))},v.partialRight=function(n){return pt(n,32,null,s(arguments,1))},v.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=ot(arguments,true,false,1),a=xt(n)?o.length:0;++u<a;){var i=o[u];i in n&&(r[i]=n[i])}else t=v.createCallback(t,e,3),nr(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},v.pluck=ar,v.property=Xt,v.pull=function(n){for(var t=arguments,e=0,r=t.length,u=n?n.length:0;++e<r;)for(var o=-1,a=t[e];++o<u;)n[o]===a&&(ke.call(n,o--,1),u--);
return n},v.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=Be(0,ye((t-n)/(e||1)));for(var u=Zt(t);++r<t;)u[r]=n,n+=e;return u},v.reject=function(n,t,e){return t=v.createCallback(t,e,3),At(n,function(n,e,r){return!t(n,e,r)})},v.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];for(t=v.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),ke.call(n,r--,1),u--);return o},v.rest=qt,v.shuffle=Tt,v.sortBy=function(n,t,e){var r=-1,o=qe(t),a=n?n.length:0,f=Zt(typeof a=="number"?a:0);
for(o||(t=v.createCallback(t,e,3)),Dt(n,function(n,e,u){var a=f[++r]=l();o?a.m=Bt(t,function(t){return n[t]}):(a.m=i())[0]=t(n,e,u),a.n=r,a.o=n}),a=f.length,f.sort(u);a--;)n=f[a],f[a]=n.o,o||c(n.m),p(n);return f},v.tap=function(n,t){return t(n),n},v.throttle=function(n,t,e){var r=true,u=true;if(!jt(n))throw new le;return false===e?r=false:xt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),H.leading=r,H.maxWait=t,H.trailing=u,Vt(n,t,H)},v.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Zt(n);
for(t=tt(t,e,1);++r<n;)u[r]=t(r);return u},v.toArray=function(n){return n&&typeof n.length=="number"?Le.unindexedChars&&kt(n)?n.split(""):s(n):Et(n)},v.transform=function(n,t,e,r){var u=qe(n);if(null==e)if(u)e=[];else{var o=n&&n.constructor;e=nt(o&&o.prototype)}return t&&(t=v.createCallback(t,r,4),(u?Xe:tr)(n,function(n,r,u){return t(e,n,r,u)})),e},v.union=function(){return ft(ot(arguments,true,true))},v.uniq=Wt,v.values=Et,v.where=At,v.without=function(n){return rt(n,s(arguments,1))},v.wrap=function(n,t){return pt(t,16,[n])
},v.xor=function(){for(var n=-1,t=arguments.length;++n<t;){var e=arguments[n];if(qe(e)||dt(e))var r=r?ft(rt(r,e).concat(rt(e,r))):e}return r||[]},v.zip=Gt,v.zipObject=Jt,v.collect=Bt,v.drop=qt,v.each=Dt,v.eachRight=Nt,v.extend=Ye,v.methods=_t,v.object=Jt,v.select=At,v.tail=qt,v.unique=Wt,v.unzip=Gt,Ut(v),v.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=false),Y(n,t,typeof e=="function"&&tt(e,r,1))},v.cloneDeep=function(n,t,e){return Y(n,true,typeof t=="function"&&tt(t,e,1))},v.contains=Ot,v.escape=function(n){return null==n?"":ie(n).replace(Qe,gt)
},v.every=St,v.find=It,v.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=v.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},v.findKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),tr(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.findLast=function(n,t,e){var r;return t=v.createCallback(t,e,3),Nt(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0}),r},v.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=v.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;
return-1},v.findLastKey=function(n,t,e){var r;return t=v.createCallback(t,e,3),bt(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},v.has=function(n,t){return n?we.call(n,t):false},v.identity=Ht,v.indexOf=zt,v.isArguments=dt,v.isArray=qe,v.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&he.call(n)==L||false},v.isDate=function(n){return n&&typeof n=="object"&&he.call(n)==z||false},v.isElement=function(n){return n&&1===n.nodeType||false},v.isEmpty=function(n){var t=true;if(!n)return t;var e=he.call(n),r=n.length;
return e==$||e==M||(Le.argsClass?e==T:dt(n))||e==G&&typeof r=="number"&&jt(n.splice)?!r:(tr(n,function(){return t=false}),t)},v.isEqual=function(n,t,e,r){return at(n,t,typeof e=="function"&&tt(e,r,2))},v.isFinite=function(n){return Ie(n)&&!De(parseFloat(n))},v.isFunction=jt,v.isNaN=function(n){return Ct(n)&&n!=+n},v.isNull=function(n){return null===n},v.isNumber=Ct,v.isObject=xt,v.isPlainObject=er,v.isRegExp=function(n){return n&&X[typeof n]&&he.call(n)==J||false},v.isString=kt,v.isUndefined=function(n){return typeof n=="undefined"
},v.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Be(0,r+e):Pe(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},v.mixin=Ut,v.noConflict=function(){return e._=ge,this},v.noop=Qt,v.now=ir,v.parseInt=lr,v.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Fe(),Pe(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):lt(n,t)},v.reduce=Rt,v.reduceRight=Ft,v.result=function(n,t){if(n){var e=n[t];
return jt(e)?n[t]():e}},v.runInContext=g,v.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:We(n).length},v.some=$t,v.sortedIndex=Kt,v.template=function(n,t,e){var r=v.templateSettings;n=ie(n||""),e=Ze({},e,r);var u,o=Ze({},e.imports,r.imports),r=We(o),o=Et(o),i=0,l=e.interpolate||N,f="__p+='",l=ae((e.escape||N).source+"|"+l.source+"|"+(l===I?O:N).source+"|"+(e.evaluate||N).source+"|$","g");n.replace(l,function(t,e,r,o,l,c){return r||(r=o),f+=n.slice(i,c).replace(P,a),e&&(f+="'+__e("+e+")+'"),l&&(u=true,f+="';"+l+";\n__p+='"),r&&(f+="'+((__t=("+r+"))==null?'':__t)+'"),i=c+t.length,t
}),f+="';",l=e=e.variable,l||(e="obj",f="with("+e+"){"+f+"}"),f=(u?f.replace(x,""):f).replace(C,"$1").replace(E,"$1;"),f="function("+e+"){"+(l?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+f+"return __p}";try{var c=ee(r,"return "+f).apply(h,o)}catch(p){throw p.source=f,p}return t?c(t):(c.source=f,c)},v.unescape=function(n){return null==n?"":ie(n).replace(Ue,mt)},v.uniqueId=function(n){var t=++m;return ie(null==n?"":n)+t
},v.all=St,v.any=$t,v.detect=It,v.findWhere=It,v.foldl=Rt,v.foldr=Ft,v.include=Ot,v.inject=Rt,Ut(function(){var n={};return tr(v,function(t,e){v.prototype[e]||(n[e]=t)}),n}(),false),v.first=Lt,v.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=v.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:h;return s(n,Be(0,u-r))},v.sample=function(n,t,e){return n&&typeof n.length!="number"?n=Et(n):Le.unindexedChars&&kt(n)&&(n=n.split("")),null==t||e?n?n[lt(0,n.length-1)]:h:(n=Tt(n),n.length=Pe(Be(0,t),n.length),n)
},v.take=Lt,v.head=Lt,tr(v,function(n,t){var e="sample"!==t;v.prototype[t]||(v.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new y(o,u):o})}),v.VERSION="2.4.1",v.prototype.chain=function(){return this.__chain__=true,this},v.prototype.toString=function(){return ie(this.__wrapped__)},v.prototype.value=Yt,v.prototype.valueOf=Yt,Xe(["join","pop","shift"],function(n){var t=fe[n];v.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);
return n?new y(e,n):e}}),Xe(["push","reverse","sort","unshift"],function(n){var t=fe[n];v.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),Xe(["concat","slice","splice"],function(n){var t=fe[n];v.prototype[n]=function(){return new y(t.apply(this.__wrapped__,arguments),this.__chain__)}}),Le.spliceObjects||Xe(["pop","shift","splice"],function(n){var t=fe[n],e="splice"==n;v.prototype[n]=function(){var n=this.__chain__,r=this.__wrapped__,u=t.apply(r,arguments);return 0===r.length&&delete r[0],n||e?new y(u,n):u
}}),v}var h,v=[],y=[],m=0,d={},b=+new Date+"",_=75,w=40,j=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",x=/\b__p\+='';/g,C=/\b(__p\+=)''\+/g,E=/(__e\(.*?\)|\b__t\))\+'';/g,O=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,S=/\w*$/,A=/^\s*function[ \n\r\t]+\w/,I=/<%=([\s\S]+?)%>/g,D=RegExp("^["+j+"]*0+(?=.$)"),N=/($^)/,B=/\bthis\b/,P=/['\n\r\t\u2028\u2029\\]/g,R="Array Boolean Date Error Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setTimeout".split(" "),F="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),T="[object Arguments]",$="[object Array]",L="[object Boolean]",z="[object Date]",q="[object Error]",K="[object Function]",W="[object Number]",G="[object Object]",J="[object RegExp]",M="[object String]",V={};
V[K]=false,V[T]=V[$]=V[L]=V[z]=V[W]=V[G]=V[J]=V[M]=true;var H={leading:false,maxWait:0,trailing:false},U={configurable:false,enumerable:false,value:null,writable:false},Q={a:"",b:null,c:"",d:"",e:"",v:null,g:"",h:null,support:null,i:"",j:false},X={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},Z=X[typeof window]&&window||this,nt=X[typeof exports]&&exports&&!exports.nodeType&&exports,tt=X[typeof module]&&module&&!module.nodeType&&module,et=tt&&tt.exports===nt&&nt,rt=X[typeof global]&&global;
!rt||rt.global!==rt&&rt.window!==rt||(Z=rt);var ut=g();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Z._=ut, define(function(){return ut})):nt&&tt?et?(tt.exports=ut)._=ut:nt._=ut:Z._=ut}).call(this);

3824
dist/lodash.core.js vendored

File diff suppressed because it is too large Load Diff

View File

@@ -1,29 +0,0 @@
/**
* @license
* lodash 4.5.0 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
* Build: `lodash core -o ./dist/lodash.core.js`
*/
;(function(){function n(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function t(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(c===ln?i===i:r(i,c)))var c=i,f=o}return f}function r(n,t,r){var e;return r(n,function(n,r,u){return t(n,r,u)?(e=n,false):void 0}),e}function e(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function u(n,t){return O(t,function(t){return n[t]})}function o(n){return n&&n.Object===Object?n:null}function i(n){return yn[n];
}function c(n){var t=false;if(null!=n&&typeof n.toString!="function")try{t=!!(n+"")}catch(r){}return t}function f(n,t){return n=typeof n=="number"||vn.test(n)?+n:-1,n>-1&&0==n%1&&(null==t?9007199254740991:t)>n}function a(n){if(Z(n)&&!Un(n)){if(n instanceof l)return n;if(An.call(n,"__wrapped__")){var t=new l(n.__wrapped__,n.__chain__);return t.__actions__=N(n.__actions__),t}}return new l(n)}function l(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t}function p(n,t,r,e){return n===ln||H(n,En[r])&&!An.call(e,r)?t:n;
}function s(n){return Y(n)?Rn(n):{}}function h(n,t,r){if(typeof n!="function")throw new TypeError("Expected a function");return setTimeout(function(){n.apply(ln,r)},t)}function v(n,t){var r=true;return qn(n,function(n,e,u){return r=!!t(n,e,u)}),r}function y(n,t){var r=[];return qn(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function _(t,r,e,u){u||(u=[]);for(var o=-1,i=t.length;++o<i;){var c=t[o];r>0&&Z(c)&&Q(c)&&(e||Un(c)||L(c))?r>1?_(c,r-1,e,u):n(u,c):e||(u[u.length]=c)}return u}function g(n,t){return n&&zn(n,t,un);
}function b(n,t){return y(t,function(t){return W(n[t])})}function j(n,t,r,e,u){return n===t?true:null==n||null==t||!Y(n)&&!Z(t)?n!==n&&t!==t:m(n,t,j,r,e,u)}function m(n,t,r,e,u,o){var i=Un(n),f=Un(t),a="[object Array]",l="[object Array]";i||(a=Nn.call(n),"[object Arguments]"==a&&(a="[object Object]")),f||(l=Nn.call(t),"[object Arguments]"==l&&(l="[object Object]"));var p="[object Object]"==a&&!c(n),f="[object Object]"==l&&!c(t);return!(l=a==l)||i||p?2&u||(a=p&&An.call(n,"__wrapped__"),f=f&&An.call(t,"__wrapped__"),
!a&&!f)?l?(o||(o=[]),(a=J(o,function(t){return t[0]===n}))&&a[1]?a[1]==t:(o.push([n,t]),t=(i?I:q)(n,t,r,e,u,o),o.pop(),t)):false:r(a?n.value():n,f?t.value():t,e,u,o):$(n,t,a)}function d(n){var t=typeof n;return"function"==t?n:null==n?fn:("object"==t?x:A)(n)}function w(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function O(n,t){var r=-1,e=Q(n)?Array(n.length):[];return qn(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function x(n){var t=un(n);return function(r){var e=t.length;if(null==r)return!e;
for(r=Object(r);e--;){var u=t[e];if(!(u in r&&j(n[u],r[u],ln,3)))return false}return true}}function E(n,t){return n=Object(n),P(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function A(n){return function(t){return null==t?ln:t[n]}}function k(n,t,r){var e=-1,u=n.length;for(0>t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e<u;)r[e]=n[e+t];return r}function N(n){return k(n,0,n.length)}function S(n,t){var r;return qn(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function T(t,r){
return P(r,function(t,r){return r.func.apply(r.thisArg,n([t],r.args))},t)}function F(n,t,r,e){r||(r={});for(var u=-1,o=t.length;++u<o;){var i=t[u],c=e?e(r[i],n[i],i,r,n):n[i],f=r,a=f[i];(!H(a,c)||H(a,En[i])&&!An.call(f,i)||c===ln&&!(i in f))&&(f[i]=c)}return r}function R(n){return V(function(t,r){var e=-1,u=r.length,o=u>1?r[u-1]:ln,o=typeof o=="function"?(u--,o):ln;for(t=Object(t);++e<u;){var i=r[e];i&&n(t,i,e,o)}return t})}function B(n){return function(){var t=arguments,r=s(n.prototype),t=n.apply(r,t);
return Y(t)?t:r}}function D(n,t,r){function e(){for(var o=-1,i=arguments.length,c=-1,f=r.length,a=Array(f+i),l=this&&this!==On&&this instanceof e?u:n;++c<f;)a[c]=r[c];for(;i--;)a[c++]=arguments[++o];return l.apply(t,a)}if(typeof n!="function")throw new TypeError("Expected a function");var u=B(n);return e}function I(n,t,r,e,u,o){var i=-1,c=1&u,f=n.length,a=t.length;if(f!=a&&!(2&u&&a>f))return false;for(a=true;++i<f;){var l=n[i],p=t[i];if(void 0!==ln){a=false;break}if(c){if(!S(t,function(n){return l===n||r(l,n,e,u,o);
})){a=false;break}}else if(l!==p&&!r(l,p,e,u,o)){a=false;break}}return a}function $(n,t,r){switch(r){case"[object Boolean]":case"[object Date]":return+n==+t;case"[object Error]":return n.name==t.name&&n.message==t.message;case"[object Number]":return n!=+n?t!=+t:n==+t;case"[object RegExp]":case"[object String]":return n==t+""}return false}function q(n,t,r,e,u,o){var i=2&u,c=un(n),f=c.length,a=un(t).length;if(f!=a&&!i)return false;for(var l=f;l--;){var p=c[l];if(!(i?p in t:An.call(t,p)))return false}for(a=true;++l<f;){
var p=c[l],s=n[p],h=t[p];if(void 0!==ln||s!==h&&!r(s,h,e,u,o)){a=false;break}i||(i="constructor"==p)}return a&&!i&&(r=n.constructor,e=t.constructor,r!=e&&"constructor"in n&&"constructor"in t&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(a=false)),a}function z(n){var t=n?n.length:ln;if(X(t)&&(Un(n)||tn(n)||L(n))){n=String;for(var r=-1,e=Array(t);++r<t;)e[r]=n(r);t=e}else t=null;return t}function C(n){var t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||En);
}function G(n){return n?n[0]:ln}function J(n,t){return r(n,d(t),qn)}function M(n,t){return qn(n,typeof t=="function"?t:fn)}function P(n,t,r){return e(n,d(t),r,3>arguments.length,qn)}function U(n,t){var r;if(typeof t!="function")throw new TypeError("Expected a function");return n=Vn(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=ln),r}}function V(n){var t;if(typeof n!="function")throw new TypeError("Expected a function");return t=$n(t===ln?n.length-1:Vn(t),0),function(){for(var r=arguments,e=-1,u=$n(r.length-t,0),o=Array(u);++e<u;)o[e]=r[t+e];
for(u=Array(t+1),e=-1;++e<t;)u[e]=r[e];return u[t]=o,n.apply(this,u)}}function H(n,t){return n===t||n!==n&&t!==t}function K(n,t){return n>t}function L(n){return Z(n)&&Q(n)&&An.call(n,"callee")&&(!Bn.call(n,"callee")||"[object Arguments]"==Nn.call(n))}function Q(n){return null!=n&&!(typeof n=="function"&&W(n))&&X(Cn(n))}function W(n){return n=Y(n)?Nn.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function X(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function Y(n){
var t=typeof n;return!!n&&("object"==t||"function"==t)}function Z(n){return!!n&&typeof n=="object"}function nn(n){return typeof n=="number"||Z(n)&&"[object Number]"==Nn.call(n)}function tn(n){return typeof n=="string"||!Un(n)&&Z(n)&&"[object String]"==Nn.call(n)}function rn(n,t){return t>n}function en(n){return typeof n=="string"?n:null==n?"":n+""}function un(n){var t=C(n);if(!t&&!Q(n))return In(Object(n));var r,e=z(n),u=!!e,e=e||[],o=e.length;for(r in n)!An.call(n,r)||u&&("length"==r||f(r,o))||t&&"constructor"==r||e.push(r);
return e}function on(n){for(var t=-1,r=C(n),e=w(n),u=e.length,o=z(n),i=!!o,o=o||[],c=o.length;++t<u;){var a=e[t];i&&("length"==a||f(a,c))||"constructor"==a&&(r||!An.call(n,a))||o.push(a)}return o}function cn(n){return n?u(n,un(n)):[]}function fn(n){return n}function an(t,r,e){var u=un(r),o=b(r,u);null!=e||Y(r)&&(o.length||!u.length)||(e=r,r=t,t=this,o=b(r,un(r)));var i=Y(e)&&"chain"in e?e.chain:true,c=W(t);return qn(o,function(e){var u=r[e];t[e]=u,c&&(t.prototype[e]=function(){var r=this.__chain__;if(i||r){
var e=t(this.__wrapped__);return(e.__actions__=N(this.__actions__)).push({func:u,args:arguments,thisArg:t}),e.__chain__=r,e}return u.apply(t,n([this.value()],arguments))})}),t}var ln,pn=1/0,sn=/[&<>"'`]/g,hn=RegExp(sn.source),vn=/^(?:0|[1-9]\d*)$/,yn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},_n={"function":true,object:true},gn=_n[typeof exports]&&exports&&!exports.nodeType?exports:ln,bn=_n[typeof module]&&module&&!module.nodeType?module:ln,jn=bn&&bn.exports===gn?gn:ln,mn=o(_n[typeof self]&&self),dn=o(_n[typeof window]&&window),wn=o(_n[typeof this]&&this),On=o(gn&&bn&&typeof global=="object"&&global)||dn!==(wn&&wn.window)&&dn||mn||wn||Function("return this")(),xn=Array.prototype,En=Object.prototype,An=En.hasOwnProperty,kn=0,Nn=En.toString,Sn=On._,Tn=On.Reflect,Fn=Tn?Tn.f:ln,Rn=Object.create,Bn=En.propertyIsEnumerable,Dn=On.isFinite,In=Object.keys,$n=Math.max,qn=function(n,t){
return function(r,e){if(null==r)return r;if(!Q(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&false!==e(i[o],o,i););return r}}(g),zn=function(n){return function(t,r,e){var u=-1,o=Object(t);e=e(t);for(var i=e.length;i--;){var c=e[n?i:++u];if(false===r(o[c],c,o))break}return t}}();Fn&&!Bn.call({valueOf:1},"valueOf")&&(w=function(n){n=Fn(n);for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r});var Cn=A("length"),Gn=V(function(t,r){return Un(t)||(t=null==t?[]:[Object(t)]),_(r,1),
n(N(t),cn)}),Jn=V(function(n,t,r){return D(n,t,r)}),Mn=V(function(n,t){return h(n,1,t)}),Pn=V(function(n,t,r){return h(n,Hn(t)||0,r)}),Un=Array.isArray,Vn=Number,Hn=Number,Kn=R(function(n,t){F(t,un(t),n)}),Ln=R(function(n,t){F(t,on(t),n)}),Qn=R(function(n,t,r,e){F(t,on(t),n,e)}),Wn=V(function(n){return n.push(ln,p),Qn.apply(ln,n)}),Xn=V(function(n,t){return null==n?{}:E(n,_(t,1))}),Yn=d;l.prototype=s(a.prototype),l.prototype.constructor=l,a.assignIn=Ln,a.before=U,a.bind=Jn,a.chain=function(n){return n=a(n),
n.__chain__=true,n},a.compact=function(n){return y(n,Boolean)},a.concat=Gn,a.create=function(n,t){var r=s(n);return t?Kn(r,t):r},a.defaults=Wn,a.defer=Mn,a.delay=Pn,a.filter=function(n,t){return y(n,d(t))},a.flatten=function(n){return n&&n.length?_(n,1):[]},a.flattenDeep=function(n){return n&&n.length?_(n,pn):[]},a.iteratee=Yn,a.keys=un,a.map=function(n,t){return O(n,d(t))},a.matches=function(n){return x(Kn({},n))},a.mixin=an,a.negate=function(n){if(typeof n!="function")throw new TypeError("Expected a function");
return function(){return!n.apply(this,arguments)}},a.once=function(n){return U(2,n)},a.pick=Xn,a.slice=function(n,t,r){var e=n?n.length:0;return r=r===ln?e:+r,e?k(n,null==t?0:+t,r):[]},a.sortBy=function(n,t){var r=0;return t=d(t),O(O(n,function(n,e,u){return{c:n,b:r++,a:t(n,e,u)}}).sort(function(n,t){var r;n:{r=n.a;var e=t.a;if(r!==e){var u=null===r,o=r===ln,i=r===r,c=null===e,f=e===ln,a=e===e;if(r>e&&!c||!i||u&&!f&&a||o&&a){r=1;break n}if(e>r&&!u||!a||c&&!o&&i||f&&i){r=-1;break n}}r=0}return r||n.b-t.b;
}),A("c"))},a.tap=function(n,t){return t(n),n},a.thru=function(n,t){return t(n)},a.toArray=function(n){return Q(n)?n.length?N(n):[]:cn(n)},a.values=cn,a.extend=Ln,an(a,a),a.clone=function(n){return Y(n)?Un(n)?N(n):F(n,un(n)):n},a.escape=function(n){return(n=en(n))&&hn.test(n)?n.replace(sn,i):n},a.every=function(n,t,r){return t=r?ln:t,v(n,d(t))},a.find=J,a.forEach=M,a.has=function(n,t){return null!=n&&An.call(n,t)},a.head=G,a.identity=fn,a.indexOf=function(n,t,r){var e=n?n.length:0;r=typeof r=="number"?0>r?$n(e+r,0):r:0,
r=(r||0)-1;for(var u=t===t;++r<e;){var o=n[r];if(u?o===t:o!==o)return r}return-1},a.isArguments=L,a.isArray=Un,a.isBoolean=function(n){return true===n||false===n||Z(n)&&"[object Boolean]"==Nn.call(n)},a.isDate=function(n){return Z(n)&&"[object Date]"==Nn.call(n)},a.isEmpty=function(n){if(Q(n)&&(Un(n)||tn(n)||W(n.splice)||L(n)))return!n.length;for(var t in n)if(An.call(n,t))return false;return true},a.isEqual=function(n,t){return j(n,t)},a.isFinite=function(n){return typeof n=="number"&&Dn(n)},a.isFunction=W,a.isNaN=function(n){
return nn(n)&&n!=+n},a.isNull=function(n){return null===n},a.isNumber=nn,a.isObject=Y,a.isRegExp=function(n){return Y(n)&&"[object RegExp]"==Nn.call(n)},a.isString=tn,a.isUndefined=function(n){return n===ln},a.last=function(n){var t=n?n.length:0;return t?n[t-1]:ln},a.max=function(n){return n&&n.length?t(n,fn,K):ln},a.min=function(n){return n&&n.length?t(n,fn,rn):ln},a.noConflict=function(){return On._===this&&(On._=Sn),this},a.noop=function(){},a.reduce=P,a.result=function(n,t,r){return t=null==n?ln:n[t],
t===ln&&(t=r),W(t)?t.call(n):t},a.size=function(n){return null==n?0:(n=Q(n)?n:un(n),n.length)},a.some=function(n,t,r){return t=r?ln:t,S(n,d(t))},a.uniqueId=function(n){var t=++kn;return en(n)+t},a.each=M,a.first=G,an(a,function(){var n={};return g(a,function(t,r){An.call(a.prototype,r)||(n[r]=t)}),n}(),{chain:false}),a.VERSION="4.5.0",qn("pop join replace reverse split push shift sort splice unshift".split(" "),function(n){var t=(/^(?:replace|split)$/.test(n)?String.prototype:xn)[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|join|replace|shift)$/.test(n);
a.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),a.prototype.toJSON=a.prototype.valueOf=a.prototype.value=function(){return T(this.__wrapped__,this.__actions__)},(dn||mn||{})._=a,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return a}):gn&&bn?(jn&&((bn.exports=a)._=a),gn._=a):On._=a}).call(this);

604
dist/lodash.fp.js vendored
View File

@@ -1,604 +0,0 @@
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["fp"] = factory();
else
root["fp"] = factory();
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports, __webpack_require__) {
var baseConvert = __webpack_require__(1);
/**
* Converts `lodash` to an immutable auto-curried iteratee-first data-last version.
*
* @param {Function} lodash The lodash function.
* @param {Object} [options] The options object. See `baseConvert` for more details.
* @returns {Function} Returns the converted `lodash`.
*/
function browserConvert(lodash, options) {
return baseConvert(lodash, lodash, options);
}
if (typeof _ == 'function') {
_ = browserConvert(_.runInContext());
}
module.exports = browserConvert;
/***/ },
/* 1 */
/***/ function(module, exports, __webpack_require__) {
var mapping = __webpack_require__(2),
mutateMap = mapping.mutate,
placeholder = {};
/**
* The base implementation of `convert` which accepts a `util` object of methods
* required to perform conversions.
*
* @param {Object} util The util object.
* @param {string} name The name of the function to wrap.
* @param {Function} func The function to wrap.
* @param {Object} [options] The options object.
* @param {boolean} [options.cap=true] Specify capping iteratee arguments.
* @param {boolean} [options.curry=true] Specify currying.
* @param {boolean} [options.fixed=true] Specify fixed arity.
* @param {boolean} [options.immutable=true] Specify immutable operations.
* @param {boolean} [options.rearg=true] Specify rearranging arguments.
* @returns {Function|Object} Returns the converted function or object.
*/
function baseConvert(util, name, func, options) {
var setPlaceholder,
isLib = typeof name == 'function',
isObj = name === Object(name);
if (isObj) {
options = func;
func = name;
name = undefined;
}
if (func == null) {
throw new TypeError;
}
options || (options = {});
var config = {
'cap': 'cap' in options ? options.cap : true,
'curry': 'curry' in options ? options.curry : true,
'fixed': 'fixed' in options ? options.fixed : true,
'immutable': 'immutable' in options ? options.immutable : true,
'rearg': 'rearg' in options ? options.rearg : true
};
var forceRearg = ('rearg' in options) && options.rearg;
var helpers = isLib ? func : {
'ary': util.ary,
'cloneDeep': util.cloneDeep,
'curry': util.curry,
'forEach': util.forEach,
'isArray': util.isArray,
'isFunction': util.isFunction,
'iteratee': util.iteratee,
'keys': util.keys,
'rearg': util.rearg,
'spread': util.spread
};
var ary = helpers.ary,
cloneDeep = helpers.cloneDeep,
curry = helpers.curry,
each = helpers.forEach,
isArray = helpers.isArray,
isFunction = helpers.isFunction,
keys = helpers.keys,
rearg = helpers.rearg,
spread = helpers.spread;
var aryMethodKeys = keys(mapping.aryMethod);
var baseAry = function(func, n) {
return n == 2
? function(a, b) { return func(a, b); }
: function(a) { return func(a); };
};
var cloneArray = function(array) {
var length = array ? array.length : 0,
result = Array(length);
while (length--) {
result[length] = array[length];
}
return result;
};
var createCloner = function(func) {
return function(object) {
return func({}, object);
};
};
var immutWrap = function(func, cloner) {
return function() {
var length = arguments.length;
if (!length) {
return result;
}
var args = Array(length);
while (length--) {
args[length] = arguments[length];
}
var result = args[0] = cloner(args[0]);
func.apply(undefined, args);
return result;
};
};
var iterateeAry = function(func, n) {
return overArg(func, function(func) {
return typeof func == 'function'
? baseAry(func, n)
: func;
});
};
var overArg = function(func, iteratee, retArg) {
return function() {
var length = arguments.length;
if (!length) {
return func();
}
var args = Array(length);
while (length--) {
args[length] = arguments[length];
}
var index = config.rearg ? 0 : (length - 1);
args[index] = iteratee(args[index]);
return func.apply(undefined, args);
};
};
var wrappers = {
'castArray': function(castArray) {
return function() {
var value = arguments[0];
return isArray(value)
? castArray(cloneArray(value))
: castArray.apply(undefined, arguments);
};
},
'iteratee': function(iteratee) {
return function() {
var func = arguments[0],
arity = arguments[1];
if (!config.cap) {
return iteratee(func, arity);
}
arity = arity > 2 ? (arity - 2) : 1;
func = iteratee(func);
var length = func.length;
return (length && length <= arity) ? func : baseAry(func, arity);
};
},
'mixin': function(mixin) {
return function(source) {
var func = this;
if (!isFunction(func)) {
return mixin(func, Object(source));
}
var methods = [],
methodNames = [];
each(keys(source), function(key) {
var value = source[key];
if (isFunction(value)) {
methodNames.push(key);
methods.push(func.prototype[key]);
}
});
mixin(func, Object(source));
each(methodNames, function(methodName, index) {
var method = methods[index];
if (isFunction(method)) {
func.prototype[methodName] = method;
} else {
delete func.prototype[methodName];
}
});
return func;
};
},
'runInContext': function(runInContext) {
return function(context) {
return baseConvert(util, runInContext(context), options);
};
}
};
var wrap = function(name, func) {
name = mapping.aliasToReal[name] || name;
var wrapper = wrappers[name];
if (wrapper) {
return wrapper(func);
}
var wrapped = func;
if (config.immutable) {
if (mutateMap.array[name]) {
wrapped = immutWrap(func, cloneArray);
}
else if (mutateMap.object[name]) {
wrapped = immutWrap(func, createCloner(func));
}
else if (mutateMap.set[name]) {
wrapped = immutWrap(func, cloneDeep);
}
}
var result;
each(aryMethodKeys, function(aryKey) {
each(mapping.aryMethod[aryKey], function(otherName) {
if (name == otherName) {
var aryN = !isLib && mapping.iterateeAry[name],
spreadStart = mapping.methodSpread[name];
result = wrapped;
if (config.fixed) {
result = spreadStart === undefined
? ary(result, aryKey)
: spread(result, spreadStart);
}
if (config.rearg && aryKey > 1 && (forceRearg || !mapping.skipRearg[name])) {
result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[aryKey]);
}
if (config.cap && aryN) {
result = iterateeAry(result, aryN);
}
if (config.curry && aryKey > 1) {
result = curry(result, aryKey);
}
return false;
}
});
return !result;
});
result || (result = wrapped);
if (mapping.placeholder[name]) {
setPlaceholder = true;
func.placeholder = result.placeholder = placeholder;
}
return result;
};
if (!isObj) {
return wrap(name, func);
}
var _ = func;
// Iterate over methods for the current ary cap.
var pairs = [];
each(aryMethodKeys, function(aryKey) {
each(mapping.aryMethod[aryKey], function(key) {
var func = _[mapping.remap[key] || key];
if (func) {
pairs.push([key, wrap(key, func)]);
}
});
});
// Assign to `_` leaving `_.prototype` unchanged to allow chaining.
each(pairs, function(pair) {
_[pair[0]] = pair[1];
});
if (setPlaceholder) {
_.placeholder = placeholder;
}
// Wrap the lodash method and its aliases.
each(keys(_), function(key) {
each(mapping.realToAlias[key] || [], function(alias) {
_[alias] = _[key];
});
});
return _;
}
module.exports = baseConvert;
/***/ },
/* 2 */
/***/ function(module, exports) {
/** Used to map aliases to their real names. */
exports.aliasToReal = {
'__': 'placeholder',
'all': 'some',
'allPass': 'overEvery',
'apply': 'spread',
'assoc': 'set',
'assocPath': 'set',
'compose': 'flowRight',
'contains': 'includes',
'dissoc': 'unset',
'dissocPath': 'unset',
'each': 'forEach',
'eachRight': 'forEachRight',
'equals': 'isEqual',
'extend': 'assignIn',
'extendWith': 'assignInWith',
'first': 'head',
'init': 'initial',
'mapObj': 'mapValues',
'omitAll': 'omit',
'nAry': 'ary',
'path': 'get',
'pathEq': 'matchesProperty',
'pathOr': 'getOr',
'pickAll': 'pick',
'pipe': 'flow',
'prop': 'get',
'propOf': 'propertyOf',
'propOr': 'getOr',
'somePass': 'overSome',
'unapply': 'rest',
'unnest': 'flatten',
'useWith': 'overArgs',
'whereEq': 'filter',
'zipObj': 'zipObject'
};
/** Used to map ary to method names. */
exports.aryMethod = {
'1': [
'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin',
'over', 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext',
'spread', 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words'
],
'2': [
'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindKey',
'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', 'every',
'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex',
'findLastKey', 'flatMap', 'flattenDepth', 'forEach', 'forEachRight', 'forIn',
'forInRight', 'forOwn', 'forOwnRight', 'get', 'groupBy', 'gt', 'gte', 'has',
'hasIn', 'includes', 'indexOf', 'intersection', 'invertBy', 'invoke', 'invokeMap',
'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map',
'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', 'merge', 'minBy', 'omit',
'omitBy', 'orderBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt',
'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile',
'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd',
'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', 'unset',
'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep'
],
'3': [
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith',
'isMatchWith', 'mergeWith', 'pullAllBy', 'reduce', 'reduceRight', 'replace',
'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy',
'unionWith', 'xorBy', 'xorWith', 'zipWith'
],
'4': [
'fill', 'setWith'
]
};
/** Used to map ary to rearg configs. */
exports.aryRearg = {
'2': [1, 0],
'3': [2, 0, 1],
'4': [3, 2, 0, 1]
};
/** Used to map method names to their iteratee ary. */
exports.iterateeAry = {
'assignWith': 2,
'assignInWith': 2,
'cloneDeepWith': 1,
'cloneWith': 1,
'dropRightWhile': 1,
'dropWhile': 1,
'every': 1,
'filter': 1,
'find': 1,
'findIndex': 1,
'findKey': 1,
'findLast': 1,
'findLastIndex': 1,
'findLastKey': 1,
'flatMap': 1,
'forEach': 1,
'forEachRight': 1,
'forIn': 1,
'forInRight': 1,
'forOwn': 1,
'forOwnRight': 1,
'isEqualWith': 2,
'isMatchWith': 2,
'map': 1,
'mapKeys': 1,
'mapValues': 1,
'partition': 1,
'reduce': 2,
'reduceRight': 2,
'reject': 1,
'remove': 1,
'some': 1,
'takeRightWhile': 1,
'takeWhile': 1,
'times': 1,
'transform': 2
};
/** Used to map method names to rearg configs. */
exports.methodRearg = {
'assignInWith': [1, 2, 0],
'assignWith': [1, 2, 0],
'getOr': [2, 1, 0],
'isMatchWith': [2, 1, 0],
'mergeWith': [1, 2, 0],
'pullAllBy': [2, 1, 0],
'setWith': [3, 1, 2, 0],
'sortedIndexBy': [2, 1, 0],
'sortedLastIndexBy': [2, 1, 0],
'zipWith': [1, 2, 0]
};
/** Used to map method names to spread configs. */
exports.methodSpread = {
'partial': 1,
'partialRight': 1
};
/** Used to identify methods which mutate arrays or objects. */
exports.mutate = {
'array': {
'fill': true,
'pull': true,
'pullAll': true,
'pullAllBy': true,
'pullAt': true,
'remove': true,
'reverse': true
},
'object': {
'assign': true,
'assignIn': true,
'assignInWith': true,
'assignWith': true,
'defaults': true,
'defaultsDeep': true,
'merge': true,
'mergeWith': true
},
'set': {
'set': true,
'setWith': true,
'unset': true
}
};
/** Used to track methods with placeholder support */
exports.placeholder = {
'bind': true,
'bindKey': true,
'curry': true,
'curryRight': true,
'partial': true,
'partialRight': true
};
/** Used to map real names to their aliases. */
exports.realToAlias = (function() {
var hasOwnProperty = Object.prototype.hasOwnProperty,
object = exports.aliasToReal,
result = {};
for (var key in object) {
var value = object[key];
if (hasOwnProperty.call(result, value)) {
result[value].push(key);
} else {
result[value] = [key];
}
}
return result;
}());
/** Used to map method names to other names. */
exports.remap = {
'curryN': 'curry',
'curryRightN': 'curryRight',
'getOr': 'get',
'trimChars': 'trim',
'trimCharsEnd': 'trimEnd',
'trimCharsStart': 'trimStart'
};
/** Used to track methods that skip `_.rearg`. */
exports.skipRearg = {
'add': true,
'assign': true,
'assignIn': true,
'concat': true,
'difference': true,
'gt': true,
'gte': true,
'lt': true,
'lte': true,
'matchesProperty': true,
'merge': true,
'partial': true,
'partialRight': true,
'random': true,
'range': true,
'rangeRight': true,
'subtract': true,
'zip': true,
'zipObject': true
};
/***/ }
/******/ ])
});
;

13
dist/lodash.fp.min.js vendored
View File

@@ -1,13 +0,0 @@
!function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.fp=r():e.fp=r()}(this,function(){return function(e){function r(i){if(t[i])return t[i].exports;var n=t[i]={exports:{},id:i,loaded:!1};return e[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}var t={};return r.m=e,r.c=t,r.p="",r(0)}([function(e,r,t){function i(e,r){return n(e,e,r)}var n=t(1);"function"==typeof _&&(_=i(_.runInContext())),
e.exports=i},function(e,r,t){function i(e,r,t,s){var u,c="function"==typeof r,p=r===Object(r);if(p&&(s=t,t=r,r=void 0),null==t)throw new TypeError;s||(s={});var l={cap:"cap"in s?s.cap:!0,curry:"curry"in s?s.curry:!0,fixed:"fixed"in s?s.fixed:!0,immutable:"immutable"in s?s.immutable:!0,rearg:"rearg"in s?s.rearg:!0},f="rearg"in s&&s.rearg,h=c?t:{ary:e.ary,cloneDeep:e.cloneDeep,curry:e.curry,forEach:e.forEach,isArray:e.isArray,isFunction:e.isFunction,iteratee:e.iteratee,keys:e.keys,rearg:e.rearg,spread:e.spread
},d=h.ary,y=h.cloneDeep,g=h.curry,m=h.forEach,v=h.isArray,W=h.isFunction,x=h.keys,R=h.rearg,I=h.spread,O=x(n.aryMethod),b=function(e,r){return 2==r?function(r,t){return e(r,t)}:function(r){return e(r)}},A=function(e){for(var r=e?e.length:0,t=Array(r);r--;)t[r]=e[r];return t},B=function(e){return function(r){return e({},r)}},E=function(e,r){return function(){var t=arguments.length;if(!t)return n;for(var i=Array(t);t--;)i[t]=arguments[t];var n=i[0]=r(i[0]);return e.apply(void 0,i),n}},k=function(e,r){
return j(e,function(e){return"function"==typeof e?b(e,r):e})},j=function(e,r,t){return function(){var t=arguments.length;if(!t)return e();for(var i=Array(t);t--;)i[t]=arguments[t];var n=l.rearg?0:t-1;return i[n]=r(i[n]),e.apply(void 0,i)}},w={castArray:function(e){return function(){var r=arguments[0];return v(r)?e(A(r)):e.apply(void 0,arguments)}},iteratee:function(e){return function(){var r=arguments[0],t=arguments[1];if(!l.cap)return e(r,t);t=t>2?t-2:1,r=e(r);var i=r.length;return i&&t>=i?r:b(r,t);
}},mixin:function(e){return function(r){var t=this;if(!W(t))return e(t,Object(r));var i=[],n=[];return m(x(r),function(e){var a=r[e];W(a)&&(n.push(e),i.push(t.prototype[e]))}),e(t,Object(r)),m(n,function(e,r){var n=i[r];W(n)?t.prototype[e]=n:delete t.prototype[e]}),t}},runInContext:function(r){return function(t){return i(e,r(t),s)}}},q=function(e,r){e=n.aliasToReal[e]||e;var t=w[e];if(t)return t(r);var i=r;l.immutable&&(a.array[e]?i=E(r,A):a.object[e]?i=E(r,B(r)):a.set[e]&&(i=E(r,y)));var s;return m(O,function(r){
return m(n.aryMethod[r],function(t){if(e==t){var a=!c&&n.iterateeAry[e],o=n.methodSpread[e];return s=i,l.fixed&&(s=void 0===o?d(s,r):I(s,o)),l.rearg&&r>1&&(f||!n.skipRearg[e])&&(s=R(s,n.methodRearg[e]||n.aryRearg[r])),l.cap&&a&&(s=k(s,a)),l.curry&&r>1&&(s=g(s,r)),!1}}),!s}),s||(s=i),n.placeholder[e]&&(u=!0,r.placeholder=s.placeholder=o),s};if(!p)return q(r,t);var z=t,M=[];return m(O,function(e){m(n.aryMethod[e],function(e){var r=z[n.remap[e]||e];r&&M.push([e,q(e,r)])})}),m(M,function(e){z[e[0]]=e[1];
}),u&&(z.placeholder=o),m(x(z),function(e){m(n.realToAlias[e]||[],function(r){z[r]=z[e]})}),z}var n=t(2),a=n.mutate,o={};e.exports=i},function(e,r){r.aliasToReal={__:"placeholder",all:"some",allPass:"overEvery",apply:"spread",assoc:"set",assocPath:"set",compose:"flowRight",contains:"includes",dissoc:"unset",dissocPath:"unset",each:"forEach",eachRight:"forEachRight",equals:"isEqual",extend:"assignIn",extendWith:"assignInWith",first:"head",init:"initial",mapObj:"mapValues",omitAll:"omit",nAry:"ary",
path:"get",pathEq:"matchesProperty",pathOr:"getOr",pickAll:"pick",pipe:"flow",prop:"get",propOf:"propertyOf",propOr:"getOr",somePass:"overSome",unapply:"rest",unnest:"flatten",useWith:"overArgs",whereEq:"filter",zipObj:"zipObject"},r.aryMethod={1:["attempt","castArray","ceil","create","curry","curryRight","floor","fromPairs","invert","iteratee","memoize","method","methodOf","mixin","over","overEvery","overSome","rest","reverse","round","runInContext","spread","template","trim","trimEnd","trimStart","uniqueId","words"],
2:["add","after","ary","assign","assignIn","at","before","bind","bindKey","chunk","cloneDeepWith","cloneWith","concat","countBy","curryN","curryRightN","debounce","defaults","defaultsDeep","delay","difference","drop","dropRight","dropRightWhile","dropWhile","endsWith","eq","every","filter","find","find","findIndex","findKey","findLast","findLastIndex","findLastKey","flatMap","flattenDepth","forEach","forEachRight","forIn","forInRight","forOwn","forOwnRight","get","groupBy","gt","gte","has","hasIn","includes","indexOf","intersection","invertBy","invoke","invokeMap","isEqual","isMatch","join","keyBy","lastIndexOf","lt","lte","map","mapKeys","mapValues","matchesProperty","maxBy","merge","minBy","omit","omitBy","orderBy","overArgs","pad","padEnd","padStart","parseInt","partial","partialRight","partition","pick","pickBy","pull","pullAll","pullAt","random","range","rangeRight","rearg","reject","remove","repeat","result","sampleSize","some","sortBy","sortedIndex","sortedIndexOf","sortedLastIndex","sortedLastIndexOf","sortedUniqBy","split","startsWith","subtract","sumBy","take","takeRight","takeRightWhile","takeWhile","tap","throttle","thru","times","trimChars","trimCharsEnd","trimCharsStart","truncate","union","uniqBy","uniqWith","unset","unzipWith","without","wrap","xor","zip","zipObject","zipObjectDeep"],
3:["assignInWith","assignWith","clamp","differenceBy","differenceWith","getOr","inRange","intersectionBy","intersectionWith","isEqualWith","isMatchWith","mergeWith","pullAllBy","reduce","reduceRight","replace","set","slice","sortedIndexBy","sortedLastIndexBy","transform","unionBy","unionWith","xorBy","xorWith","zipWith"],4:["fill","setWith"]},r.aryRearg={2:[1,0],3:[2,0,1],4:[3,2,0,1]},r.iterateeAry={assignWith:2,assignInWith:2,cloneDeepWith:1,cloneWith:1,dropRightWhile:1,dropWhile:1,every:1,filter:1,
find:1,findIndex:1,findKey:1,findLast:1,findLastIndex:1,findLastKey:1,flatMap:1,forEach:1,forEachRight:1,forIn:1,forInRight:1,forOwn:1,forOwnRight:1,isEqualWith:2,isMatchWith:2,map:1,mapKeys:1,mapValues:1,partition:1,reduce:2,reduceRight:2,reject:1,remove:1,some:1,takeRightWhile:1,takeWhile:1,times:1,transform:2},r.methodRearg={assignInWith:[1,2,0],assignWith:[1,2,0],getOr:[2,1,0],isMatchWith:[2,1,0],mergeWith:[1,2,0],pullAllBy:[2,1,0],setWith:[3,1,2,0],sortedIndexBy:[2,1,0],sortedLastIndexBy:[2,1,0],
zipWith:[1,2,0]},r.methodSpread={partial:1,partialRight:1},r.mutate={array:{fill:!0,pull:!0,pullAll:!0,pullAllBy:!0,pullAt:!0,remove:!0,reverse:!0},object:{assign:!0,assignIn:!0,assignInWith:!0,assignWith:!0,defaults:!0,defaultsDeep:!0,merge:!0,mergeWith:!0},set:{set:!0,setWith:!0,unset:!0}},r.placeholder={bind:!0,bindKey:!0,curry:!0,curryRight:!0,partial:!0,partialRight:!0},r.realToAlias=function(){var e=Object.prototype.hasOwnProperty,t=r.aliasToReal,i={};for(var n in t){var a=t[n];e.call(i,a)?i[a].push(n):i[a]=[n];
}return i}(),r.remap={curryN:"curry",curryRightN:"curryRight",getOr:"get",trimChars:"trim",trimCharsEnd:"trimEnd",trimCharsStart:"trimStart"},r.skipRearg={add:!0,assign:!0,assignIn:!0,concat:!0,difference:!0,gt:!0,gte:!0,lt:!0,lte:!0,matchesProperty:!0,merge:!0,partial:!0,partialRight:!0,random:!0,range:!0,rangeRight:!0,subtract:!0,zip:!0,zipObject:!0}}])});

18947
dist/lodash.js vendored

File diff suppressed because it is too large Load Diff

170
dist/lodash.min.js vendored
View File

@@ -1,120 +1,56 @@
/**
* @license
* lodash 4.5.0 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
* Build: `lodash -o ./dist/lodash.js`
* Lo-Dash 2.4.1 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
* Build: `lodash modern -o ./dist/lodash.js`
*/
;(function(){function n(n,t){return n.set(t[0],t[1]),n}function t(n,t){return n.add(t),n}function r(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function e(n,t,r,e){for(var u=-1,o=n.length;++u<o;){var i=n[u];t(e,i,r(i),n)}return e}function u(n,t){for(var r=-1,e=n.length;++r<e&&false!==t(n[r],r,n););return n}function o(n,t){for(var r=-1,e=n.length;++r<e;)if(!t(n[r],r,n))return false;
return true}function i(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;){var i=n[r];t(i,r,n)&&(o[++u]=i)}return o}function f(n,t){return!!n.length&&-1<d(n,t,0)}function c(n,t,r){for(var e=-1,u=n.length;++e<u;)if(r(t,n[e]))return true;return false}function a(n,t){for(var r=-1,e=n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}function l(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function s(n,t,r,e){var u=-1,o=n.length;for(e&&o&&(r=n[++u]);++u<o;)r=t(r,n[u],u,n);return r}function h(n,t,r,e){
var u=n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function p(n,t){for(var r=-1,e=n.length;++r<e;)if(t(n[r],r,n))return true;return false}function _(n,t,r){for(var e=-1,u=n.length;++e<u;){var o=n[e],i=t(o);if(null!=i&&(f===Z?i===i:r(i,f)))var f=i,c=o}return c}function g(n,t,r,e){var u;return r(n,function(n,r,o){return t(n,r,o)?(u=e?r:n,false):void 0}),u}function v(n,t,r){for(var e=n.length,u=r?e:-1;r?u--:++u<e;)if(t(n[u],u,n))return u;return-1}function d(n,t,r){if(t!==t)return B(n,r);--r;for(var e=n.length;++r<e;)if(n[r]===t)return r;
return-1}function y(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function b(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].c;return n}function x(n,t){for(var r,e=-1,u=n.length;++e<u;){var o=t(n[e]);o!==Z&&(r=r===Z?o:r+o)}return r}function j(n,t){for(var r=-1,e=Array(n);++r<n;)e[r]=t(r);return e}function m(n,t){return a(t,function(t){return[t,n[t]]})}function w(n){return function(t){return n(t)}}function A(n,t){return a(t,function(t){return n[t]})}function O(n,t){for(var r=-1,e=n.length;++r<e&&-1<d(t,n[r],0););
return r}function k(n,t){for(var r=n.length;r--&&-1<d(t,n[r],0););return r}function E(n){return n&&n.Object===Object?n:null}function I(n,t){if(n!==t){var r=null===n,e=n===Z,u=n===n,o=null===t,i=t===Z,f=t===t;if(n>t&&!o||!u||r&&!i&&f||e&&f)return 1;if(t>n&&!r||!f||o&&!e&&u||i&&u)return-1}return 0}function S(n){return Un[n]}function R(n){return zn[n]}function W(n){return"\\"+$n[n]}function B(n,t,r){var e=n.length;for(t+=r?0:-1;r?t--:++t<e;){var u=n[t];if(u!==u)return t}return-1}function C(n){var t=false;
if(null!=n&&typeof n.toString!="function")try{t=!!(n+"")}catch(r){}return t}function U(n,t){return n=typeof n=="number"||yn.test(n)?+n:-1,n>-1&&0==n%1&&(null==t?9007199254740991:t)>n}function z(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}function M(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function L(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;)n[r]===t&&(n[r]="__lodash_placeholder__",o[++u]=r);return o}function $(n){var t=-1,r=Array(n.size);return n.forEach(function(n){
r[++t]=n}),r}function F(n){if(!n||!En.test(n))return n.length;for(var t=kn.lastIndex=0;kn.test(n);)t++;return t}function N(n){return Mn[n]}function D(E){function yn(n){if(me(n)&&!Do(n)&&!(n instanceof An)){if(n instanceof wn)return n;if(au.call(n,"__wrapped__"))return qr(n)}return new wn(n)}function mn(){}function wn(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=Z}function An(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=false,
this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Un(){}function zn(n){var t=-1,r=n?n.length:0;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Mn(n){var t=-1,r=n?n.length:0;for(this.__data__=new zn;++t<r;)this.push(n[t])}function Ln(n,t){var r=n.__data__;return Lr(t)?(r=r.__data__,"__lodash_hash_undefined__"===(typeof t=="string"?r.string:r.hash)[t]):r.has(t)}function $n(n){var t=-1,r=n?n.length:0;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1]);
}}function Dn(n,t){var r=Pn(n,t);return 0>r?false:(r==n.length-1?n.pop():Eu.call(n,r,1),true)}function Zn(n,t){var r=Pn(n,t);return 0>r?Z:n[r][1]}function Pn(n,t){for(var r=n.length;r--;)if(he(n[r][0],t))return r;return-1}function Tn(n,t,r){var e=Pn(n,t);0>e?n.push([t,r]):n[e][1]=r}function Kn(n,t,r,e){return n===Z||he(n,fu[r])&&!au.call(e,r)?t:n}function Jn(n,t,r){(r!==Z&&!he(n[t],r)||typeof t=="number"&&r===Z&&!(t in n))&&(n[t]=r)}function Yn(n,t,r){var e=n[t];(!he(e,r)||he(e,fu[t])&&!au.call(n,t)||r===Z&&!(t in n))&&(n[t]=r);
}function Hn(n,t,r,e){return Yu(n,function(n,u,o){t(e,n,r(n),o)}),e}function Qn(n,t){return n&&nr(t,Ne(t),n)}function Xn(n,t){for(var r=-1,e=null==n,u=t.length,o=Array(u);++r<u;)o[r]=e?Z:Le(n,t[r]);return o}function nt(n){return ve(n)?n:[]}function tt(n){return typeof n=="function"?n:Je}function rt(n){return Do(n)?n:Zr(n)}function et(n,t,r){return n===n&&(r!==Z&&(n=n>r?r:n),t!==Z&&(n=t>n?t:n)),n}function ut(n,t,r,e,o,i){var f;if(r&&(f=o?r(n,e,o,i):r(n)),f!==Z)return f;if(!je(n))return n;if(e=Do(n)){
if(f=Wr(n),!t)return Xt(n,f)}else{var c=Sr(n),a="[object Function]"==c||"[object GeneratorFunction]"==c;if(Zo(n))return Jt(n,t);if("[object Object]"==c||"[object Arguments]"==c||a&&!o){if(C(n))return o?n:{};if(f=Br(a?{}:n),!t)return rr(n,Qn(f,n))}else{if(!Cn[c])return o?n:{};f=Cr(n,c,t)}}return i||(i=new $n),(o=i.get(n))?o:(i.set(n,f),(e?u:pt)(n,function(e,u){Yn(f,u,ut(e,t,r,u,n,i))}),e?f:rr(n,f))}function ot(n){var t=Ne(n),r=t.length;return function(e){if(null==e)return!r;for(var u=r;u--;){var o=t[u],i=n[o],f=e[o];
if(f===Z&&!(o in Object(e))||!i(f))return false}return true}}function it(n){return je(n)?Au(n):{}}function ft(n,t,r){if(typeof n!="function")throw new ou("Expected a function");return ku(function(){n.apply(Z,r)},t)}function ct(n,t,r,e){var u=-1,o=f,i=true,l=n.length,s=[],h=t.length;if(!l)return s;r&&(t=a(t,w(r))),e?(o=c,i=false):t.length>=200&&(o=Ln,i=false,t=new Mn(t));n:for(;++u<l;){var p=n[u],_=r?r(p):p;if(i&&_===_){for(var g=h;g--;)if(t[g]===_)continue n;s.push(p)}else o(t,_,e)||s.push(p)}return s}function at(n,t){
var r=true;return Yu(n,function(n,e,u){return r=!!t(n,e,u)}),r}function lt(n,t){var r=[];return Yu(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function st(n,t,r,e){e||(e=[]);for(var u=-1,o=n.length;++u<o;){var i=n[u];t>0&&ve(i)&&(r||Do(i)||_e(i))?t>1?st(i,t-1,r,e):l(e,i):r||(e[e.length]=i)}return e}function ht(n,t){null==n||Qu(n,t,De)}function pt(n,t){return n&&Qu(n,t,Ne)}function _t(n,t){return n&&Xu(n,t,Ne)}function gt(n,t){return i(t,function(t){return ye(n[t])})}function vt(n,t){t=Mr(t,n)?[t+""]:rt(t);
for(var r=0,e=t.length;null!=n&&e>r;)n=n[t[r++]];return r&&r==e?n:Z}function dt(n,t){return au.call(n,t)||typeof n=="object"&&t in n&&null===ju(n)}function yt(n,t){return t in Object(n)}function bt(n,t,r){for(var e=r?c:f,u=n.length,o=u,i=Array(u),l=[];o--;){var s=n[o];o&&t&&(s=a(s,w(t))),i[o]=r||!t&&120>s.length?Z:new Mn(o&&s)}var s=n[0],h=-1,p=s.length,_=i[0];n:for(;++h<p;){var g=s[h],v=t?t(g):g;if(_?!Ln(_,v):!e(l,v,r)){for(o=u;--o;){var d=i[o];if(d?!Ln(d,v):!e(n[o],v,r))continue n}_&&_.push(v),
l.push(g)}}return l}function xt(n,t,r){var e={};return pt(n,function(n,u,o){t(e,r(n),u,o)}),e}function jt(n,t,e){return Mr(t,n)||(t=rt(t),n=Dr(n,t),t=Gr(t)),t=null==n?n:n[t],null==t?Z:r(t,n,e)}function mt(n,t,r,e,u){if(n===t)n=true;else if(null==n||null==t||!je(n)&&!me(t))n=n!==n&&t!==t;else n:{var o=Do(n),i=Do(t),f="[object Array]",c="[object Array]";o||(f=Sr(n),"[object Arguments]"==f?f="[object Object]":"[object Object]"!=f&&(o=Se(n))),i||(c=Sr(t),"[object Arguments]"==c?c="[object Object]":"[object Object]"!=c&&Se(t));
var a="[object Object]"==f&&!C(n),i="[object Object]"==c&&!C(t),c=f==c;if(!c||o||a){if(!(2&e)&&(f=a&&au.call(n,"__wrapped__"),i=i&&au.call(t,"__wrapped__"),f||i)){n=mt(f?n.value():n,i?t.value():t,r,e,u);break n}c?(u||(u=new $n),n=(o?mr:Ar)(n,t,mt,r,e,u)):n=false}else n=wr(n,t,f,mt,r,e)}return n}function wt(n,t,r,e){var u=r.length,o=u,i=!e;if(null==n)return!o;for(n=Object(n);u--;){var f=r[u];if(i&&f[2]?f[1]!==n[f[0]]:!(f[0]in n))return false}for(;++u<o;){var f=r[u],c=f[0],a=n[c],l=f[1];if(i&&f[2]){if(a===Z&&!(c in n))return false;
}else if(f=new $n,c=e?e(a,l,c,n,t,f):Z,c===Z?!mt(l,a,e,3,f):!c)return false}return true}function At(n){var t=typeof n;return"function"==t?n:null==n?Je:"object"==t?Do(n)?It(n[0],n[1]):Et(n):Xe(n)}function Ot(n){n=null==n?n:Object(n);var t,r=[];for(t in n)r.push(t);return r}function kt(n,t){var r=-1,e=ge(n)?Array(n.length):[];return Yu(n,function(n,u,o){e[++r]=t(n,u,o)}),e}function Et(n){var t=Er(n);if(1==t.length&&t[0][2]){var r=t[0][0],e=t[0][1];return function(n){return null==n?false:n[r]===e&&(e!==Z||r in Object(n));
}}return function(r){return r===n||wt(r,n,t)}}function It(n,t){return function(r){var e=Le(r,n);return e===Z&&e===t?Fe(r,n):mt(t,e,Z,3)}}function St(n,t,r,e,o){if(n!==t){var i=Do(t)||Se(t)?Z:De(t);u(i||t,function(u,f){if(i&&(f=u,u=t[f]),je(u)){o||(o=new $n);var c=f,a=o,l=n[c],s=t[c],h=a.get(s);if(h)Jn(n,c,h);else{var h=e?e(l,s,c+"",n,t,a):Z,p=h===Z;p&&(h=s,Do(s)||Se(s)?Do(l)?h=l:ve(l)?h=Xt(l):(p=false,h=ut(s,true)):Oe(s)||_e(s)?_e(l)?h=ze(l):!je(l)||r&&ye(l)?(p=false,h=ut(s,true)):h=l:p=false),a.set(s,h),p&&St(h,s,r,e,a),
Jn(n,c,h)}}else c=e?e(n[f],u,f+"",n,t,o):Z,c===Z&&(c=u),Jn(n,f,c)})}}function Rt(n,t,r){var e=-1,u=kr();return t=a(t.length?t:Array(1),function(n){return u(n)}),n=kt(n,function(n){return{a:a(t,function(t){return t(n)}),b:++e,c:n}}),b(n,function(n,t){var e;n:{e=-1;for(var u=n.a,o=t.a,i=u.length,f=r.length;++e<i;){var c=I(u[e],o[e]);if(c){e=f>e?c*("desc"==r[e]?-1:1):c;break n}}e=n.b-t.b}return e})}function Wt(n,t){return n=Object(n),s(t,function(t,r){return r in n&&(t[r]=n[r]),t},{})}function Bt(n,t){
var r={};return ht(n,function(n,e){t(n,e)&&(r[e]=n)}),r}function Ct(n){return function(t){return null==t?Z:t[n]}}function Ut(n){return function(t){return vt(t,n)}}function zt(n,t,r){var e=-1,u=t.length,o=n;for(r&&(o=a(n,function(n){return r(n)}));++e<u;)for(var i=0,f=t[e],f=r?r(f):f;-1<(i=d(o,f,i));)o!==n&&Eu.call(o,i,1),Eu.call(n,i,1);return n}function Mt(n,t){for(var r=n?t.length:0,e=r-1;r--;){var u=t[r];if(e==r||u!=o){var o=u;if(U(u))Eu.call(n,u,1);else if(Mr(u,n))delete n[u];else{var u=rt(u),i=Dr(n,u);
null!=i&&delete i[Gr(u)]}}}}function Lt(n,t){return n+Su(Mu()*(t-n+1))}function $t(n,t,r,e){t=Mr(t,n)?[t+""]:rt(t);for(var u=-1,o=t.length,i=o-1,f=n;null!=f&&++u<o;){var c=t[u];if(je(f)){var a=r;if(u!=i){var l=f[c],a=e?e(l,c,f):Z;a===Z&&(a=null==l?U(t[u+1])?[]:{}:l)}Yn(f,c,a)}f=f[c]}return n}function Ft(n,t,r){var e=-1,u=n.length;for(0>t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Array(u);++e<u;)r[e]=n[e+t];return r}function Nt(n,t){var r;return Yu(n,function(n,e,u){return r=t(n,e,u),
!r}),!!r}function Dt(n,t,r){var e=0,u=n?n.length:e;if(typeof t=="number"&&t===t&&2147483647>=u){for(;u>e;){var o=e+u>>>1,i=n[o];(r?t>=i:t>i)&&null!==i?e=o+1:u=o}return u}return Zt(n,t,Je,r)}function Zt(n,t,r,e){t=r(t);for(var u=0,o=n?n.length:0,i=t!==t,f=null===t,c=t===Z;o>u;){var a=Su((u+o)/2),l=r(n[a]),s=l!==Z,h=l===l;(i?h||e:f?h&&s&&(e||null!=l):c?h&&(e||s):null==l?0:e?t>=l:t>l)?u=a+1:o=a}return Uu(o,4294967294)}function qt(n,t){for(var r=0,e=n.length,u=n[0],o=t?t(u):u,i=o,f=0,c=[u];++r<e;)u=n[r],
o=t?t(u):u,he(o,i)||(i=o,c[++f]=u);return c}function Pt(n,t,r){var e=-1,u=f,o=n.length,i=true,a=[],l=a;if(r)i=false,u=c;else if(o<200)l=t?[]:a;else{if(u=t?null:to(n))return $(u);i=false,u=Ln,l=new Mn}n:for(;++e<o;){var s=n[e],h=t?t(s):s;if(i&&h===h){for(var p=l.length;p--;)if(l[p]===h)continue n;t&&l.push(h),a.push(s)}else u(l,h,r)||(l!==a&&l.push(h),a.push(s))}return a}function Tt(n,t,r,e){for(var u=n.length,o=e?u:-1;(e?o--:++o<u)&&t(n[o],o,n););return r?Ft(n,e?0:o,e?o+1:u):Ft(n,e?o+1:0,e?u:o)}function Kt(n,t){
var r=n;return r instanceof An&&(r=r.value()),s(t,function(n,t){return t.func.apply(t.thisArg,l([n],t.args))},r)}function Gt(n,t,r){for(var e=-1,u=n.length;++e<u;)var o=o?l(ct(o,n[e],t,r),ct(n[e],o,t,r)):n[e];return o&&o.length?Pt(o,t,r):[]}function Vt(n,t,r){for(var e=-1,u=n.length,o=t.length,i={};++e<u;)r(i,n[e],o>e?t[e]:Z);return i}function Jt(n,t){if(t)return n.slice();var r=new n.constructor(n.length);return n.copy(r),r}function Yt(n){var t=new n.constructor(n.byteLength);return new yu(t).set(new yu(n)),
t}function Ht(n,t,r){for(var e=r.length,u=-1,o=Cu(n.length-e,0),i=-1,f=t.length,c=Array(f+o);++i<f;)c[i]=t[i];for(;++u<e;)c[r[u]]=n[u];for(;o--;)c[i++]=n[u++];return c}function Qt(n,t,r){for(var e=-1,u=r.length,o=-1,i=Cu(n.length-u,0),f=-1,c=t.length,a=Array(i+c);++o<i;)a[o]=n[o];for(i=o;++f<c;)a[i+f]=t[f];for(;++e<u;)a[i+r[e]]=n[o++];return a}function Xt(n,t){var r=-1,e=n.length;for(t||(t=Array(e));++r<e;)t[r]=n[r];return t}function nr(n,t,r){return tr(n,t,r)}function tr(n,t,r,e){r||(r={});for(var u=-1,o=t.length;++u<o;){
var i=t[u],f=e?e(r[i],n[i],i,r,n):n[i];Yn(r,i,f)}return r}function rr(n,t){return nr(n,uo(n),t)}function er(n,t){return function(r,u){var o=Do(r)?e:Hn,i=t?t():{};return o(r,n,kr(u),i)}}function ur(n){return se(function(t,r){var e=-1,u=r.length,o=u>1?r[u-1]:Z,i=u>2?r[2]:Z,o=typeof o=="function"?(u--,o):Z;for(i&&zr(r[0],r[1],i)&&(o=3>u?Z:o,u=1),t=Object(t);++e<u;)(i=r[e])&&n(t,i,e,o);return t})}function or(n,t){return function(r,e){if(null==r)return r;if(!ge(r))return n(r,e);for(var u=r.length,o=t?u:-1,i=Object(r);(t?o--:++o<u)&&false!==e(i[o],o,i););
return r}}function ir(n){return function(t,r,e){var u=-1,o=Object(t);e=e(t);for(var i=e.length;i--;){var f=e[n?i:++u];if(false===r(o[f],f,o))break}return t}}function fr(n,t,r){function e(){return(this&&this!==Gn&&this instanceof e?o:n).apply(u?r:this,arguments)}var u=1&t,o=lr(n);return e}function cr(n){return function(t){t=Me(t);var r=En.test(t)?t.match(kn):Z,e=r?r[0]:t.charAt(0);return t=r?r.slice(1).join(""):t.slice(1),e[n]()+t}}function ar(n){return function(t){return s(Ge(Te(t)),n,"")}}function lr(n){
return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=it(n.prototype),t=n.apply(r,t);return je(t)?t:r}}function sr(n,t,e){function u(){for(var i=arguments.length,f=i,c=Array(i),a=this&&this!==Gn&&this instanceof u?o:n,l=yn.placeholder||u.placeholder;f--;)c[f]=arguments[f];
return f=3>i&&c[0]!==l&&c[i-1]!==l?[]:L(c,l),i-=f.length,e>i?br(n,t,pr,l,Z,c,f,Z,Z,e-i):r(a,this,c)}var o=lr(n);return u}function hr(n){return se(function(t){t=st(t,1);var r=t.length,e=r,u=wn.prototype.thru;for(n&&t.reverse();e--;){var o=t[e];if(typeof o!="function")throw new ou("Expected a function");if(u&&!i&&"wrapper"==Or(o))var i=new wn([],true)}for(e=i?e:r;++e<r;)var o=t[e],u=Or(o),f="wrapper"==u?ro(o):Z,i=f&&$r(f[0])&&424==f[1]&&!f[4].length&&1==f[9]?i[Or(f[0])].apply(i,f[3]):1==o.length&&$r(o)?i[u]():i.thru(o);
return function(){var n=arguments,e=n[0];if(i&&1==n.length&&Do(e)&&e.length>=200)return i.plant(e).value();for(var u=0,n=r?t[u].apply(this,n):e;++u<r;)n=t[u].call(this,n);return n}})}function pr(n,t,r,e,u,o,i,f,c,a){function l(){for(var y=arguments.length,b=y,x=Array(y);b--;)x[b]=arguments[b];if(e&&(x=Ht(x,e,u)),o&&(x=Qt(x,o,i)),_||g){var b=yn.placeholder||l.placeholder,j=L(x,b),y=y-j.length;if(a>y)return br(n,t,pr,b,r,x,j,f,c,a-y)}if(y=h?r:this,b=p?y[n]:n,f)for(var j=x.length,m=Uu(f.length,j),w=Xt(x);m--;){
var A=f[m];x[m]=U(A,j)?w[A]:Z}else v&&x.length>1&&x.reverse();return s&&x.length>c&&(x.length=c),this&&this!==Gn&&this instanceof l&&(b=d||lr(b)),b.apply(y,x)}var s=128&t,h=1&t,p=2&t,_=8&t,g=16&t,v=512&t,d=p?Z:lr(n);return l}function _r(n,t){return function(r,e){return xt(r,n,t(e))}}function gr(n){return se(function(t){return t=a(st(t,1),kr()),se(function(e){var u=this;return n(t,function(n){return r(n,u,e)})})})}function vr(n,t,r){return t=Be(t),n=F(n),t&&t>n?(t-=n,r=r===Z?" ":r+"",n=Ke(r,Iu(t/F(r))),
En.test(r)?n.match(kn).slice(0,t).join(""):n.slice(0,t)):""}function dr(n,t,e,u){function o(){for(var t=-1,c=arguments.length,a=-1,l=u.length,s=Array(l+c),h=this&&this!==Gn&&this instanceof o?f:n;++a<l;)s[a]=u[a];for(;c--;)s[a++]=arguments[++t];return r(h,i?e:this,s)}var i=1&t,f=lr(n);return o}function yr(n){return function(t,r,e){e&&typeof e!="number"&&zr(t,r,e)&&(r=e=Z),t=Ue(t),t=t===t?t:0,r===Z?(r=t,t=0):r=Ue(r)||0,e=e===Z?r>t?1:-1:Ue(e)||0;var u=-1;r=Cu(Iu((r-t)/(e||1)),0);for(var o=Array(r);r--;)o[n?r:++u]=t,
t+=e;return o}}function br(n,t,r,e,u,o,i,f,c,a){var l=8&t;f=f?Xt(f):Z;var s=l?i:Z;i=l?Z:i;var h=l?o:Z;return o=l?Z:o,t=(t|(l?32:64))&~(l?64:32),4&t||(t&=-4),t=[n,t,u,h,s,o,i,f,c,a],r=r.apply(Z,t),$r(n)&&oo(r,t),r.placeholder=e,r}function xr(n){var t=eu[n];return function(n,r){if(n=Ue(n),r=Be(r)){var e=(Me(n)+"e").split("e"),e=t(e[0]+"e"+(+e[1]+r)),e=(Me(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return t(n)}}function jr(n,t,r,e,u,o,i,f){var c=2&t;if(!c&&typeof n!="function")throw new ou("Expected a function");
var a=e?e.length:0;if(a||(t&=-97,e=u=Z),i=i===Z?i:Cu(Be(i),0),f=f===Z?f:Be(f),a-=u?u.length:0,64&t){var l=e,s=u;e=u=Z}var h=c?Z:ro(n);return o=[n,t,r,e,u,l,s,o,i,f],h&&(r=o[1],n=h[1],t=r|n,e=128==n&&8==r||128==n&&256==r&&h[8]>=o[7].length||384==n&&h[8]>=h[7].length&&8==r,131>t||e)&&(1&n&&(o[2]=h[2],t|=1&r?0:4),(r=h[3])&&(e=o[3],o[3]=e?Ht(e,r,h[4]):Xt(r),o[4]=e?L(o[3],"__lodash_placeholder__"):Xt(h[4])),(r=h[5])&&(e=o[5],o[5]=e?Qt(e,r,h[6]):Xt(r),o[6]=e?L(o[5],"__lodash_placeholder__"):Xt(h[6])),(r=h[7])&&(o[7]=Xt(r)),
128&n&&(o[8]=null==o[8]?h[8]:Uu(o[8],h[8])),null==o[9]&&(o[9]=h[9]),o[0]=h[0],o[1]=t),n=o[0],t=o[1],r=o[2],e=o[3],u=o[4],f=o[9]=null==o[9]?c?0:n.length:Cu(o[9]-a,0),!f&&24&t&&(t&=-25),(h?no:oo)(t&&1!=t?8==t||16==t?sr(n,t,f):32!=t&&33!=t||u.length?pr.apply(Z,o):dr(n,t,r,e):fr(n,t,r),o)}function mr(n,t,r,e,u,o){var i=-1,f=2&u,c=1&u,a=n.length,l=t.length;if(!(a==l||f&&l>a))return false;if(l=o.get(n))return l==t;for(l=true,o.set(n,t);++i<a;){var s=n[i],h=t[i];if(e)var _=f?e(h,s,i,t,n,o):e(s,h,i,n,t,o);if(_!==Z){
if(_)continue;l=false;break}if(c){if(!p(t,function(n){return s===n||r(s,n,e,u,o)})){l=false;break}}else if(s!==h&&!r(s,h,e,u,o)){l=false;break}}return o["delete"](n),l}function wr(n,t,r,e,u,o){switch(r){case"[object ArrayBuffer]":if(n.byteLength!=t.byteLength||!e(new yu(n),new yu(t)))break;return true;case"[object Boolean]":case"[object Date]":return+n==+t;case"[object Error]":return n.name==t.name&&n.message==t.message;case"[object Number]":return n!=+n?t!=+t:n==+t;case"[object RegExp]":case"[object String]":
return n==t+"";case"[object Map]":var i=M;case"[object Set]":return i||(i=$),(2&o||n.size==t.size)&&e(i(n),i(t),u,1|o);case"[object Symbol]":return!!du&&Gu.call(n)==Gu.call(t)}return false}function Ar(n,t,r,e,u,o){var i=2&u,f=Ne(n),c=f.length,a=Ne(t).length;if(c!=a&&!i)return false;for(var l=c;l--;){var s=f[l];if(!(i?s in t:dt(t,s)))return false}if(a=o.get(n))return a==t;a=true,o.set(n,t);for(var h=i;++l<c;){var s=f[l],p=n[s],_=t[s];if(e)var g=i?e(_,p,s,t,n,o):e(p,_,s,n,t,o);if(g===Z?p!==_&&!r(p,_,e,u,o):!g){a=false;
break}h||(h="constructor"==s)}return a&&!h&&(r=n.constructor,e=t.constructor,r!=e&&"constructor"in n&&"constructor"in t&&!(typeof r=="function"&&r instanceof r&&typeof e=="function"&&e instanceof e)&&(a=false)),o["delete"](n),a}function Or(n){for(var t=n.name+"",r=Ju[t],e=au.call(Ju,t)?r.length:0;e--;){var u=r[e],o=u.func;if(null==o||o==n)return u.name}return t}function kr(){var n=yn.iteratee||Ye,n=n===Ye?At:n;return arguments.length?n(arguments[0],arguments[1]):n}function Er(n){n=Ze(n);for(var t=n.length;t--;){
var r=n[t][1];n[t][2]=r===r&&!je(r)}return n}function Ir(n,t){var r=null==n?Z:n[t];return we(r)?r:Z}function Sr(n){return hu.call(n)}function Rr(n,t,r){if(null==n)return false;var e=r(n,t);return e||Mr(t)||(t=rt(t),n=Dr(n,t),null!=n&&(t=Gr(t),e=r(n,t))),r=n?n.length:Z,e||!!r&&xe(r)&&U(t,r)&&(Do(n)||Ee(n)||_e(n))}function Wr(n){var t=n.length,r=n.constructor(t);return t&&"string"==typeof n[0]&&au.call(n,"index")&&(r.index=n.index,r.input=n.input),r}function Br(n){return Fr(n)?{}:(n=n.constructor,it(ye(n)?n.prototype:Z));
}function Cr(r,e,u){var o=r.constructor;switch(e){case"[object ArrayBuffer]":return Yt(r);case"[object Boolean]":case"[object Date]":return new o(+r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return e=r.buffer,u=u?Yt(e):e,new r.constructor(u,r.byteOffset,r.length);case"[object Map]":return u=r.constructor,
s(M(r),n,new u);case"[object Number]":case"[object String]":return new o(r);case"[object RegExp]":return u=new r.constructor(r.source,hn.exec(r)),u.lastIndex=r.lastIndex,u;case"[object Set]":return u=r.constructor,s($(r),t,new u);case"[object Symbol]":return du?Object(Gu.call(r)):{}}}function Ur(n){var t=n?n.length:Z;return xe(t)&&(Do(n)||Ee(n)||_e(n))?j(t,String):null}function zr(n,t,r){if(!je(r))return false;var e=typeof t;return("number"==e?ge(r)&&U(t,r.length):"string"==e&&t in r)?he(r[t],n):false}function Mr(n,t){
return typeof n=="number"?true:!Do(n)&&(rn.test(n)||!tn.test(n)||null!=t&&n in Object(t))}function Lr(n){var t=typeof n;return"number"==t||"boolean"==t||"string"==t&&"__proto__"!=n||null==n}function $r(n){var t=Or(n),r=yn[t];return typeof r=="function"&&t in An.prototype?n===r?true:(t=ro(r),!!t&&n===t[0]):false}function Fr(n){var t=n&&n.constructor;return n===(typeof t=="function"&&t.prototype||fu)}function Nr(n,t,r,e,u,o){return je(n)&&je(t)&&(o.set(t,n),St(n,t,Z,Nr,o)),n}function Dr(n,t){return 1==t.length?n:Le(n,Ft(t,0,-1));
}function Zr(n){var t=[];return Me(n).replace(en,function(n,r,e,u){t.push(e?u.replace(ln,"$1"):r||n)}),t}function qr(n){if(n instanceof An)return n.clone();var t=new wn(n.__wrapped__,n.__chain__);return t.__actions__=Xt(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}function Pr(n,t,r){var e=n?n.length:0;return e?(t=r||t===Z?1:Be(t),Ft(n,0>t?0:t,e)):[]}function Tr(n,t,r){var e=n?n.length:0;return e?(t=r||t===Z?1:Be(t),t=e-t,Ft(n,0,0>t?0:t)):[]}function Kr(n){return n?n[0]:Z}function Gr(n){
var t=n?n.length:0;return t?n[t-1]:Z}function Vr(n,t){return n&&n.length&&t&&t.length?zt(n,t):n}function Jr(n){return n?Lu.call(n):n}function Yr(n){if(!n||!n.length)return[];var t=0;return n=i(n,function(n){return ve(n)?(t=Cu(n.length,t),true):void 0}),j(t,function(t){return a(n,Ct(t))})}function Hr(n,t){if(!n||!n.length)return[];var e=Yr(n);return null==t?e:a(e,function(n){return r(t,Z,n)})}function Qr(n){return n=yn(n),n.__chain__=true,n}function Xr(n,t){return t(n)}function ne(){return this}function te(n,t){
return typeof t=="function"&&Do(n)?u(n,t):Yu(n,tt(t))}function re(n,t){var r;if(typeof t=="function"&&Do(n)){for(r=n.length;r--&&false!==t(n[r],r,n););r=n}else r=Hu(n,tt(t));return r}function ee(n,t){return(Do(n)?a:kt)(n,kr(t,3))}function ue(n,t){var r=-1,e=We(n),u=e.length,o=u-1;for(t=et(Be(t),0,u);++r<t;){var u=Lt(r,o),i=e[u];e[u]=e[r],e[r]=i}return e.length=t,e}function oe(n,t,r){return t=r?Z:t,t=n&&null==t?n.length:t,jr(n,128,Z,Z,Z,Z,t)}function ie(n,t){var r;if(typeof t!="function")throw new ou("Expected a function");
return n=Be(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=Z),r}}function fe(n,t,r){return t=r?Z:t,n=jr(n,8,Z,Z,Z,Z,Z,t),n.placeholder=yn.placeholder||fe.placeholder,n}function ce(n,t,r){return t=r?Z:t,n=jr(n,16,Z,Z,Z,Z,Z,t),n.placeholder=yn.placeholder||ce.placeholder,n}function ae(n,t,r){function e(){p&&bu(p),a&&bu(a),g=0,c=a=h=p=_=Z}function u(t,r){r&&bu(r),a=p=_=Z,t&&(g=Bo(),l=n.apply(h,c),p||a||(c=h=Z))}function o(){var n=t-(Bo()-s);0>=n||n>t?u(_,a):p=ku(o,n)}function i(){u(y,p);
}function f(){if(c=arguments,s=Bo(),h=this,_=y&&(p||!v),false===d)var r=v&&!p;else{g||a||v||(g=s);var e=d-(s-g),u=(0>=e||e>d)&&(v||a);u?(a&&(a=bu(a)),g=s,l=n.apply(h,c)):a||(a=ku(i,e))}return u&&p?p=bu(p):p||t===d||(p=ku(o,t)),r&&(u=true,l=n.apply(h,c)),!u||p||a||(c=h=Z),l}var c,a,l,s,h,p,_,g=0,v=false,d=false,y=true;if(typeof n!="function")throw new ou("Expected a function");return t=Ue(t)||0,je(r)&&(v=!!r.leading,d="maxWait"in r&&Cu(Ue(r.maxWait)||0,t),y="trailing"in r?!!r.trailing:y),f.cancel=e,f.flush=function(){
return(p&&_||a&&y)&&(l=n.apply(h,c)),e(),l},f}function le(n,t){function r(){var e=arguments,u=t?t.apply(this,e):e[0],o=r.cache;return o.has(u)?o.get(u):(e=n.apply(this,e),r.cache=o.set(u,e),e)}if(typeof n!="function"||t&&typeof t!="function")throw new ou("Expected a function");return r.cache=new le.Cache,r}function se(n,t){if(typeof n!="function")throw new ou("Expected a function");return t=Cu(t===Z?n.length-1:Be(t),0),function(){for(var e=arguments,u=-1,o=Cu(e.length-t,0),i=Array(o);++u<o;)i[u]=e[t+u];
switch(t){case 0:return n.call(this,i);case 1:return n.call(this,e[0],i);case 2:return n.call(this,e[0],e[1],i)}for(o=Array(t+1),u=-1;++u<t;)o[u]=e[u];return o[t]=i,r(n,this,o)}}function he(n,t){return n===t||n!==n&&t!==t}function pe(n,t){return n>t}function _e(n){return ve(n)&&au.call(n,"callee")&&(!Ou.call(n,"callee")||"[object Arguments]"==hu.call(n))}function ge(n){return null!=n&&!(typeof n=="function"&&ye(n))&&xe(eo(n))}function ve(n){return me(n)&&ge(n)}function de(n){if(!me(n))return false;var t=n.constructor;
return"[object Error]"==hu.call(n)||typeof t=="function"&&"[object Error]"==hu.call(t.prototype)}function ye(n){return n=je(n)?hu.call(n):"","[object Function]"==n||"[object GeneratorFunction]"==n}function be(n){return typeof n=="number"&&n==Be(n)}function xe(n){return typeof n=="number"&&n>-1&&0==n%1&&9007199254740991>=n}function je(n){var t=typeof n;return!!n&&("object"==t||"function"==t)}function me(n){return!!n&&typeof n=="object"}function we(n){return null==n?false:ye(n)?_u.test(cu.call(n)):me(n)&&(C(n)?_u:vn).test(n);
}function Ae(n){return typeof n=="number"||me(n)&&"[object Number]"==hu.call(n)}function Oe(n){if(!me(n)||"[object Object]"!=hu.call(n)||C(n))return false;var t=fu;return typeof n.constructor=="function"&&(t=ju(n)),null===t?true:(n=t.constructor,typeof n=="function"&&n instanceof n&&cu.call(n)==su)}function ke(n){return je(n)&&"[object RegExp]"==hu.call(n)}function Ee(n){return typeof n=="string"||!Do(n)&&me(n)&&"[object String]"==hu.call(n)}function Ie(n){return typeof n=="symbol"||me(n)&&"[object Symbol]"==hu.call(n);
}function Se(n){return me(n)&&xe(n.length)&&!!Bn[hu.call(n)]}function Re(n,t){return t>n}function We(n){if(!n)return[];if(ge(n))return Ee(n)?n.match(kn):Xt(n);if(wu&&n[wu])return z(n[wu]());var t=Sr(n);return("[object Map]"==t?M:"[object Set]"==t?$:qe)(n)}function Be(n){if(!n)return 0===n?n:0;if(n=Ue(n),n===q||n===-q)return 1.7976931348623157e308*(0>n?-1:1);var t=n%1;return n===n?t?n-t:n:0}function Ce(n){return n?et(Be(n),0,4294967295):0}function Ue(n){if(je(n)&&(n=ye(n.valueOf)?n.valueOf():n,n=je(n)?n+"":n),
typeof n!="string")return 0===n?n:+n;n=n.replace(fn,"");var t=gn.test(n);return t||dn.test(n)?Nn(n.slice(2),t?2:8):_n.test(n)?P:+n}function ze(n){return nr(n,De(n))}function Me(n){if(typeof n=="string")return n;if(null==n)return"";if(Ie(n))return du?Vu.call(n):"";var t=n+"";return"0"==t&&1/n==-q?"-0":t}function Le(n,t,r){return n=null==n?Z:vt(n,t),n===Z?r:n}function $e(n,t){return Rr(n,t,dt)}function Fe(n,t){return Rr(n,t,yt)}function Ne(n){var t=Fr(n);if(!t&&!ge(n))return Bu(Object(n));var r,e=Ur(n),u=!!e,e=e||[],o=e.length;
for(r in n)!dt(n,r)||u&&("length"==r||U(r,o))||t&&"constructor"==r||e.push(r);return e}function De(n){for(var t=-1,r=Fr(n),e=Ot(n),u=e.length,o=Ur(n),i=!!o,o=o||[],f=o.length;++t<u;){var c=e[t];i&&("length"==c||U(c,f))||"constructor"==c&&(r||!au.call(n,c))||o.push(c)}return o}function Ze(n){return m(n,Ne(n))}function qe(n){return n?A(n,Ne(n)):[]}function Pe(n){return fi(Me(n).toLowerCase())}function Te(n){return(n=Me(n))&&n.replace(bn,S).replace(On,"")}function Ke(n,t){n=Me(n),t=Be(t);var r="";if(!n||1>t||t>9007199254740991)return r;
do t%2&&(r+=n),t=Su(t/2),n+=n;while(t);return r}function Ge(n,t,r){return n=Me(n),t=r?Z:t,t===Z&&(t=Rn.test(n)?Sn:In),n.match(t)||[]}function Ve(n){return function(){return n}}function Je(n){return n}function Ye(n){return At(typeof n=="function"?n:ut(n,true))}function He(n,t,r){var e=Ne(t),o=gt(t,e);null!=r||je(t)&&(o.length||!e.length)||(r=t,t=n,n=this,o=gt(t,Ne(t)));var i=je(r)&&"chain"in r?r.chain:true,f=ye(n);return u(o,function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;
if(i||t){var r=n(this.__wrapped__);return(r.__actions__=Xt(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,l([this.value()],arguments))})}),n}function Qe(){}function Xe(n){return Mr(n)?Ct(n):Ut(n)}function nu(n){return n&&n.length?x(n,Je):0}E=E?Vn.defaults({},E,Vn.pick(Gn,Wn)):Gn;var tu=E.Date,ru=E.Error,eu=E.Math,uu=E.RegExp,ou=E.TypeError,iu=E.Array.prototype,fu=E.Object.prototype,cu=E.Function.prototype.toString,au=fu.hasOwnProperty,lu=0,su=cu.call(Object),hu=fu.toString,pu=Gn._,_u=uu("^"+cu.call(au).replace(un,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gu=qn?E.Buffer:Z,vu=E.Reflect,du=E.Symbol,yu=E.Uint8Array,bu=E.clearTimeout,xu=vu?vu.f:Z,ju=Object.getPrototypeOf,mu=Object.getOwnPropertySymbols,wu=typeof(wu=du&&du.iterator)=="symbol"?wu:Z,Au=Object.create,Ou=fu.propertyIsEnumerable,ku=E.setTimeout,Eu=iu.splice,Iu=eu.ceil,Su=eu.floor,Ru=E.isFinite,Wu=iu.join,Bu=Object.keys,Cu=eu.max,Uu=eu.min,zu=E.parseInt,Mu=eu.random,Lu=iu.reverse,$u=Ir(E,"Map"),Fu=Ir(E,"Set"),Nu=Ir(E,"WeakMap"),Du=Ir(Object,"create"),Zu=Nu&&new Nu,qu=$u?cu.call($u):"",Pu=Fu?cu.call(Fu):"",Tu=Nu?cu.call(Nu):"",Ku=du?du.prototype:Z,Gu=du?Ku.valueOf:Z,Vu=du?Ku.toString:Z,Ju={};
yn.templateSettings={escape:Q,evaluate:X,interpolate:nn,variable:"",imports:{_:yn}};var Yu=or(pt),Hu=or(_t,true),Qu=ir(),Xu=ir(true);xu&&!Ou.call({valueOf:1},"valueOf")&&(Ot=function(n){return z(xu(n))});var no=Zu?function(n,t){return Zu.set(n,t),n}:Je,to=Fu&&2===new Fu([1,2]).size?function(n){return new Fu(n)}:Qe,ro=Zu?function(n){return Zu.get(n)}:Qe,eo=Ct("length"),uo=mu||function(){return[]};($u&&"[object Map]"!=Sr(new $u)||Fu&&"[object Set]"!=Sr(new Fu)||Nu&&"[object WeakMap]"!=Sr(new Nu))&&(Sr=function(n){
var t=hu.call(n);if(n="[object Object]"==t?n.constructor:null,n=typeof n=="function"?cu.call(n):"")switch(n){case qu:return"[object Map]";case Pu:return"[object Set]";case Tu:return"[object WeakMap]"}return t});var oo=function(){var n=0,t=0;return function(r,e){var u=Bo(),o=16-(u-t);if(t=u,o>0){if(150<=++n)return r}else n=0;return no(r,e)}}(),io=se(function(n,t){Do(n)||(n=null==n?[]:[Object(n)]),t=st(t,1);for(var r=n,e=t,u=-1,o=r.length,i=-1,f=e.length,c=Array(o+f);++u<o;)c[u]=r[u];for(;++i<f;)c[u++]=e[i];
return c}),fo=se(function(n,t){return ve(n)?ct(n,st(t,1,true)):[]}),co=se(function(n,t){var r=Gr(t);return ve(r)&&(r=Z),ve(n)?ct(n,st(t,1,true),kr(r)):[]}),ao=se(function(n,t){var r=Gr(t);return ve(r)&&(r=Z),ve(n)?ct(n,st(t,1,true),Z,r):[]}),lo=se(function(n){var t=a(n,nt);return t.length&&t[0]===n[0]?bt(t):[]}),so=se(function(n){var t=Gr(n),r=a(n,nt);return t===Gr(r)?t=Z:r.pop(),r.length&&r[0]===n[0]?bt(r,kr(t)):[]}),ho=se(function(n){var t=Gr(n),r=a(n,nt);return t===Gr(r)?t=Z:r.pop(),r.length&&r[0]===n[0]?bt(r,Z,t):[];
}),po=se(Vr),_o=se(function(n,t){t=a(st(t,1),String);var r=Xn(n,t);return Mt(n,t.sort(I)),r}),go=se(function(n){return Pt(st(n,1,true))}),vo=se(function(n){var t=Gr(n);return ve(t)&&(t=Z),Pt(st(n,1,true),kr(t))}),yo=se(function(n){var t=Gr(n);return ve(t)&&(t=Z),Pt(st(n,1,true),Z,t)}),bo=se(function(n,t){return ve(n)?ct(n,t):[]}),xo=se(function(n){return Gt(i(n,ve))}),jo=se(function(n){var t=Gr(n);return ve(t)&&(t=Z),Gt(i(n,ve),kr(t))}),mo=se(function(n){var t=Gr(n);return ve(t)&&(t=Z),Gt(i(n,ve),Z,t)}),wo=se(Yr),Ao=se(function(n){
var t=n.length,t=t>1?n[t-1]:Z,t=typeof t=="function"?(n.pop(),t):Z;return Hr(n,t)}),Oo=se(function(n){function t(t){return Xn(t,n)}n=st(n,1);var r=n.length,e=r?n[0]:0,u=this.__wrapped__;return 1>=r&&!this.__actions__.length&&u instanceof An&&U(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:Xr,args:[t],thisArg:Z}),new wn(u,this.__chain__).thru(function(n){return r&&!n.length&&n.push(Z),n})):this.thru(t)}),ko=er(function(n,t,r){au.call(n,r)?++n[r]:n[r]=1}),Eo=er(function(n,t,r){au.call(n,r)?n[r].push(t):n[r]=[t];
}),Io=se(function(n,t,e){var u=-1,o=typeof t=="function",i=Mr(t),f=ge(n)?Array(n.length):[];return Yu(n,function(n){var c=o?t:i&&null!=n?n[t]:Z;f[++u]=c?r(c,n,e):jt(n,t,e)}),f}),So=er(function(n,t,r){n[r]=t}),Ro=er(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),Wo=se(function(n,t){if(null==n)return[];var r=t.length;return r>1&&zr(n,t[0],t[1])?t=[]:r>2&&zr(t[0],t[1],t[2])&&(t.length=1),Rt(n,st(t,1),[])}),Bo=tu.now,Co=se(function(n,t,r){var e=1;if(r.length)var u=L(r,yn.placeholder||Co.placeholder),e=32|e;
return jr(n,e,t,r,u)}),Uo=se(function(n,t,r){var e=3;if(r.length)var u=L(r,yn.placeholder||Uo.placeholder),e=32|e;return jr(t,e,n,r,u)}),zo=se(function(n,t){return ft(n,1,t)}),Mo=se(function(n,t,r){return ft(n,Ue(t)||0,r)}),Lo=se(function(n,t){t=a(st(t,1),kr());var e=t.length;return se(function(u){for(var o=-1,i=Uu(u.length,e);++o<i;)u[o]=t[o].call(this,u[o]);return r(n,this,u)})}),$o=se(function(n,t){var r=L(t,yn.placeholder||$o.placeholder);return jr(n,32,Z,t,r)}),Fo=se(function(n,t){var r=L(t,yn.placeholder||Fo.placeholder);
return jr(n,64,Z,t,r)}),No=se(function(n,t){return jr(n,256,Z,Z,Z,st(t,1))}),Do=Array.isArray,Zo=gu?function(n){return n instanceof gu}:Ve(false),qo=ur(function(n,t){nr(t,Ne(t),n)}),Po=ur(function(n,t){nr(t,De(t),n)}),To=ur(function(n,t,r,e){tr(t,De(t),n,e)}),Ko=ur(function(n,t,r,e){tr(t,Ne(t),n,e)}),Go=se(function(n,t){return Xn(n,st(t,1))}),Vo=se(function(n){return n.push(Z,Kn),r(To,Z,n)}),Jo=se(function(n){return n.push(Z,Nr),r(ni,Z,n)}),Yo=_r(function(n,t,r){n[t]=r},Ve(Je)),Ho=_r(function(n,t,r){
au.call(n,t)?n[t].push(r):n[t]=[r]},kr),Qo=se(jt),Xo=ur(function(n,t,r){St(n,t,r)}),ni=ur(function(n,t,r,e){St(n,t,r,e)}),ti=se(function(n,t){return null==n?{}:(t=a(st(t,1),String),Wt(n,ct(De(n),t)))}),ri=se(function(n,t){return null==n?{}:Wt(n,st(t,1))}),ei=ar(function(n,t,r){return t=t.toLowerCase(),n+(r?Pe(t):t)}),ui=ar(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),oi=ar(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),ii=cr("toLowerCase"),fi=cr("toUpperCase"),ci=ar(function(n,t,r){
return n+(r?"_":"")+t.toLowerCase()}),ai=ar(function(n,t,r){return n+(r?" ":"")+Pe(t)}),li=ar(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),si=se(function(n,t){try{return r(n,Z,t)}catch(e){return de(e)?e:new ru(e)}}),hi=se(function(n,t){return u(st(t,1),function(t){n[t]=Co(n[t],n)}),n}),pi=hr(),_i=hr(true),gi=se(function(n,t){return function(r){return jt(r,n,t)}}),vi=se(function(n,t){return function(r){return jt(n,r,t)}}),di=gr(a),yi=gr(o),bi=gr(p),xi=yr(),ji=yr(true),mi=xr("ceil"),wi=xr("floor"),Ai=xr("round");
return yn.prototype=mn.prototype,wn.prototype=it(mn.prototype),wn.prototype.constructor=wn,An.prototype=it(mn.prototype),An.prototype.constructor=An,Un.prototype=Du?Du(null):fu,zn.prototype.clear=function(){this.__data__={hash:new Un,map:$u?new $u:[],string:new Un}},zn.prototype["delete"]=function(n){var t=this.__data__;return Lr(n)?(t=typeof n=="string"?t.string:t.hash,n=(Du?t[n]!==Z:au.call(t,n))&&delete t[n]):n=$u?t.map["delete"](n):Dn(t.map,n),n},zn.prototype.get=function(n){var t=this.__data__;
return Lr(n)?(t=typeof n=="string"?t.string:t.hash,Du?(n=t[n],n="__lodash_hash_undefined__"===n?Z:n):n=au.call(t,n)?t[n]:Z):n=$u?t.map.get(n):Zn(t.map,n),n},zn.prototype.has=function(n){var t=this.__data__;return Lr(n)?(t=typeof n=="string"?t.string:t.hash,n=Du?t[n]!==Z:au.call(t,n)):n=$u?t.map.has(n):-1<Pn(t.map,n),n},zn.prototype.set=function(n,t){var r=this.__data__;return Lr(n)?(typeof n=="string"?r.string:r.hash)[n]=Du&&t===Z?"__lodash_hash_undefined__":t:$u?r.map.set(n,t):Tn(r.map,n,t),this;
},Mn.prototype.push=function(n){var t=this.__data__;Lr(n)?(t=t.__data__,(typeof n=="string"?t.string:t.hash)[n]="__lodash_hash_undefined__"):t.set(n,"__lodash_hash_undefined__")},$n.prototype.clear=function(){this.__data__={array:[],map:null}},$n.prototype["delete"]=function(n){var t=this.__data__,r=t.array;return r?Dn(r,n):t.map["delete"](n)},$n.prototype.get=function(n){var t=this.__data__,r=t.array;return r?Zn(r,n):t.map.get(n)},$n.prototype.has=function(n){var t=this.__data__,r=t.array;return r?-1<Pn(r,n):t.map.has(n);
},$n.prototype.set=function(n,t){var r=this.__data__,e=r.array;return e&&(199>e.length?Tn(e,n,t):(r.array=null,r.map=new zn(e))),(r=r.map)&&r.set(n,t),this},le.Cache=zn,yn.after=function(n,t){if(typeof t!="function")throw new ou("Expected a function");return n=Be(n),function(){return 1>--n?t.apply(this,arguments):void 0}},yn.ary=oe,yn.assign=qo,yn.assignIn=Po,yn.assignInWith=To,yn.assignWith=Ko,yn.at=Go,yn.before=ie,yn.bind=Co,yn.bindAll=hi,yn.bindKey=Uo,yn.castArray=function(){if(!arguments.length)return[];
var n=arguments[0];return Do(n)?n:[n]},yn.chain=Qr,yn.chunk=function(n,t){t=Cu(Be(t),0);var r=n?n.length:0;if(!r||1>t)return[];for(var e=0,u=-1,o=Array(Iu(r/t));r>e;)o[++u]=Ft(n,e,e+=t);return o},yn.compact=function(n){for(var t=-1,r=n?n.length:0,e=-1,u=[];++t<r;){var o=n[t];o&&(u[++e]=o)}return u},yn.concat=io,yn.cond=function(n){var t=n?n.length:0,e=kr();return n=t?a(n,function(n){if("function"!=typeof n[1])throw new ou("Expected a function");return[e(n[0]),n[1]]}):[],se(function(e){for(var u=-1;++u<t;){
var o=n[u];if(r(o[0],this,e))return r(o[1],this,e)}})},yn.conforms=function(n){return ot(ut(n,true))},yn.constant=Ve,yn.countBy=ko,yn.create=function(n,t){var r=it(n);return t?Qn(r,t):r},yn.curry=fe,yn.curryRight=ce,yn.debounce=ae,yn.defaults=Vo,yn.defaultsDeep=Jo,yn.defer=zo,yn.delay=Mo,yn.difference=fo,yn.differenceBy=co,yn.differenceWith=ao,yn.drop=Pr,yn.dropRight=Tr,yn.dropRightWhile=function(n,t){return n&&n.length?Tt(n,kr(t,3),true,true):[]},yn.dropWhile=function(n,t){return n&&n.length?Tt(n,kr(t,3),true):[];
},yn.fill=function(n,t,r,e){var u=n?n.length:0;if(!u)return[];for(r&&typeof r!="number"&&zr(n,t,r)&&(r=0,e=u),u=n.length,r=Be(r),0>r&&(r=-r>u?0:u+r),e=e===Z||e>u?u:Be(e),0>e&&(e+=u),e=r>e?0:Ce(e);e>r;)n[r++]=t;return n},yn.filter=function(n,t){return(Do(n)?i:lt)(n,kr(t,3))},yn.flatMap=function(n,t){return st(ee(n,t),1)},yn.flatten=function(n){return n&&n.length?st(n,1):[]},yn.flattenDeep=function(n){return n&&n.length?st(n,q):[]},yn.flattenDepth=function(n,t){return n&&n.length?(t=t===Z?1:Be(t),st(n,t)):[];
},yn.flip=function(n){return jr(n,512)},yn.flow=pi,yn.flowRight=_i,yn.fromPairs=function(n){for(var t=-1,r=n?n.length:0,e={};++t<r;){var u=n[t];e[u[0]]=u[1]}return e},yn.functions=function(n){return null==n?[]:gt(n,Ne(n))},yn.functionsIn=function(n){return null==n?[]:gt(n,De(n))},yn.groupBy=Eo,yn.initial=function(n){return Tr(n,1)},yn.intersection=lo,yn.intersectionBy=so,yn.intersectionWith=ho,yn.invert=Yo,yn.invertBy=Ho,yn.invokeMap=Io,yn.iteratee=Ye,yn.keyBy=So,yn.keys=Ne,yn.keysIn=De,yn.map=ee,
yn.mapKeys=function(n,t){var r={};return t=kr(t,3),pt(n,function(n,e,u){r[t(n,e,u)]=n}),r},yn.mapValues=function(n,t){var r={};return t=kr(t,3),pt(n,function(n,e,u){r[e]=t(n,e,u)}),r},yn.matches=function(n){return Et(ut(n,true))},yn.matchesProperty=function(n,t){return It(n,ut(t,true))},yn.memoize=le,yn.merge=Xo,yn.mergeWith=ni,yn.method=gi,yn.methodOf=vi,yn.mixin=He,yn.negate=function(n){if(typeof n!="function")throw new ou("Expected a function");return function(){return!n.apply(this,arguments)}},yn.nthArg=function(n){
return n=Be(n),function(){return arguments[n]}},yn.omit=ti,yn.omitBy=function(n,t){return t=kr(t,2),Bt(n,function(n,r){return!t(n,r)})},yn.once=function(n){return ie(2,n)},yn.orderBy=function(n,t,r,e){return null==n?[]:(Do(t)||(t=null==t?[]:[t]),r=e?Z:r,Do(r)||(r=null==r?[]:[r]),Rt(n,t,r))},yn.over=di,yn.overArgs=Lo,yn.overEvery=yi,yn.overSome=bi,yn.partial=$o,yn.partialRight=Fo,yn.partition=Ro,yn.pick=ri,yn.pickBy=function(n,t){return null==n?{}:Bt(n,kr(t,2))},yn.property=Xe,yn.propertyOf=function(n){
return function(t){return null==n?Z:vt(n,t)}},yn.pull=po,yn.pullAll=Vr,yn.pullAllBy=function(n,t,r){return n&&n.length&&t&&t.length?zt(n,t,kr(r)):n},yn.pullAt=_o,yn.range=xi,yn.rangeRight=ji,yn.rearg=No,yn.reject=function(n,t){var r=Do(n)?i:lt;return t=kr(t,3),r(n,function(n,r,e){return!t(n,r,e)})},yn.remove=function(n,t){var r=[];if(!n||!n.length)return r;var e=-1,u=[],o=n.length;for(t=kr(t,3);++e<o;){var i=n[e];t(i,e,n)&&(r.push(i),u.push(e))}return Mt(n,u),r},yn.rest=se,yn.reverse=Jr,yn.sampleSize=ue,
yn.set=function(n,t,r){return null==n?n:$t(n,t,r)},yn.setWith=function(n,t,r,e){return e=typeof e=="function"?e:Z,null==n?n:$t(n,t,r,e)},yn.shuffle=function(n){return ue(n,4294967295)},yn.slice=function(n,t,r){var e=n?n.length:0;return e?(r&&typeof r!="number"&&zr(n,t,r)?(t=0,r=e):(t=null==t?0:Be(t),r=r===Z?e:Be(r)),Ft(n,t,r)):[]},yn.sortBy=Wo,yn.sortedUniq=function(n){return n&&n.length?qt(n):[]},yn.sortedUniqBy=function(n,t){return n&&n.length?qt(n,kr(t)):[]},yn.split=function(n,t,r){return Me(n).split(t,r);
},yn.spread=function(n,t){if(typeof n!="function")throw new ou("Expected a function");return t=t===Z?0:Cu(Be(t),0),se(function(e){var u=e[t];return e=e.slice(0,t),u&&l(e,u),r(n,this,e)})},yn.tail=function(n){return Pr(n,1)},yn.take=function(n,t,r){return n&&n.length?(t=r||t===Z?1:Be(t),Ft(n,0,0>t?0:t)):[]},yn.takeRight=function(n,t,r){var e=n?n.length:0;return e?(t=r||t===Z?1:Be(t),t=e-t,Ft(n,0>t?0:t,e)):[]},yn.takeRightWhile=function(n,t){return n&&n.length?Tt(n,kr(t,3),false,true):[]},yn.takeWhile=function(n,t){
return n&&n.length?Tt(n,kr(t,3)):[]},yn.tap=function(n,t){return t(n),n},yn.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new ou("Expected a function");return je(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),ae(n,t,{leading:e,maxWait:t,trailing:u})},yn.thru=Xr,yn.toArray=We,yn.toPairs=Ze,yn.toPairsIn=function(n){return m(n,De(n))},yn.toPath=function(n){return Do(n)?a(n,String):Zr(n)},yn.toPlainObject=ze,yn.transform=function(n,t,r){var e=Do(n)||Se(n);if(t=kr(t,4),
null==r)if(e||je(n)){var o=n.constructor;r=e?Do(n)?new o:[]:it(ye(o)?o.prototype:Z)}else r={};return(e?u:pt)(n,function(n,e,u){return t(r,n,e,u)}),r},yn.unary=function(n){return oe(n,1)},yn.union=go,yn.unionBy=vo,yn.unionWith=yo,yn.uniq=function(n){return n&&n.length?Pt(n):[]},yn.uniqBy=function(n,t){return n&&n.length?Pt(n,kr(t)):[]},yn.uniqWith=function(n,t){return n&&n.length?Pt(n,Z,t):[]},yn.unset=function(n,t){var r;if(null==n)r=true;else{r=n;var e=t,e=Mr(e,r)?[e+""]:rt(e);r=Dr(r,e),e=Gr(e),r=null!=r&&$e(r,e)?delete r[e]:true;
}return r},yn.unzip=Yr,yn.unzipWith=Hr,yn.values=qe,yn.valuesIn=function(n){return null==n?[]:A(n,De(n))},yn.without=bo,yn.words=Ge,yn.wrap=function(n,t){return t=null==t?Je:t,$o(t,n)},yn.xor=xo,yn.xorBy=jo,yn.xorWith=mo,yn.zip=wo,yn.zipObject=function(n,t){return Vt(n||[],t||[],Yn)},yn.zipObjectDeep=function(n,t){return Vt(n||[],t||[],$t)},yn.zipWith=Ao,yn.extend=Po,yn.extendWith=To,He(yn,yn),yn.add=function(n,t){var r;return n===Z&&t===Z?0:(n!==Z&&(r=n),t!==Z&&(r=r===Z?t:r+t),r)},yn.attempt=si,
yn.camelCase=ei,yn.capitalize=Pe,yn.ceil=mi,yn.clamp=function(n,t,r){return r===Z&&(r=t,t=Z),r!==Z&&(r=Ue(r),r=r===r?r:0),t!==Z&&(t=Ue(t),t=t===t?t:0),et(Ue(n),t,r)},yn.clone=function(n){return ut(n)},yn.cloneDeep=function(n){return ut(n,true)},yn.cloneDeepWith=function(n,t){return ut(n,true,t)},yn.cloneWith=function(n,t){return ut(n,false,t)},yn.deburr=Te,yn.endsWith=function(n,t,r){n=Me(n),t=typeof t=="string"?t:t+"";var e=n.length;return r=r===Z?e:et(Be(r),0,e),r-=t.length,r>=0&&n.indexOf(t,r)==r},yn.eq=he,
yn.escape=function(n){return(n=Me(n))&&H.test(n)?n.replace(J,R):n},yn.escapeRegExp=function(n){return(n=Me(n))&&on.test(n)?n.replace(un,"\\$&"):n},yn.every=function(n,t,r){var e=Do(n)?o:at;return r&&zr(n,t,r)&&(t=Z),e(n,kr(t,3))},yn.find=function(n,t){if(t=kr(t,3),Do(n)){var r=v(n,t);return r>-1?n[r]:Z}return g(n,t,Yu)},yn.findIndex=function(n,t){return n&&n.length?v(n,kr(t,3)):-1},yn.findKey=function(n,t){return g(n,kr(t,3),pt,true)},yn.findLast=function(n,t){if(t=kr(t,3),Do(n)){var r=v(n,t,true);return r>-1?n[r]:Z;
}return g(n,t,Hu)},yn.findLastIndex=function(n,t){return n&&n.length?v(n,kr(t,3),true):-1},yn.findLastKey=function(n,t){return g(n,kr(t,3),_t,true)},yn.floor=wi,yn.forEach=te,yn.forEachRight=re,yn.forIn=function(n,t){return null==n?n:Qu(n,tt(t),De)},yn.forInRight=function(n,t){return null==n?n:Xu(n,tt(t),De)},yn.forOwn=function(n,t){return n&&pt(n,tt(t))},yn.forOwnRight=function(n,t){return n&&_t(n,tt(t))},yn.get=Le,yn.gt=pe,yn.gte=function(n,t){return n>=t},yn.has=$e,yn.hasIn=Fe,yn.head=Kr,yn.identity=Je,
yn.includes=function(n,t,r,e){return n=ge(n)?n:qe(n),r=r&&!e?Be(r):0,e=n.length,0>r&&(r=Cu(e+r,0)),Ee(n)?e>=r&&-1<n.indexOf(t,r):!!e&&-1<d(n,t,r)},yn.indexOf=function(n,t,r){var e=n?n.length:0;return e?(r=Be(r),0>r&&(r=Cu(e+r,0)),d(n,t,r)):-1},yn.inRange=function(n,t,r){return t=Ue(t)||0,r===Z?(r=t,t=0):r=Ue(r)||0,n=Ue(n),n>=Uu(t,r)&&n<Cu(t,r)},yn.invoke=Qo,yn.isArguments=_e,yn.isArray=Do,yn.isArrayBuffer=function(n){return me(n)&&"[object ArrayBuffer]"==hu.call(n)},yn.isArrayLike=ge,yn.isArrayLikeObject=ve,
yn.isBoolean=function(n){return true===n||false===n||me(n)&&"[object Boolean]"==hu.call(n)},yn.isBuffer=Zo,yn.isDate=function(n){return me(n)&&"[object Date]"==hu.call(n)},yn.isElement=function(n){return!!n&&1===n.nodeType&&me(n)&&!Oe(n)},yn.isEmpty=function(n){if(ge(n)&&(Do(n)||Ee(n)||ye(n.splice)||_e(n)))return!n.length;for(var t in n)if(au.call(n,t))return false;return true},yn.isEqual=function(n,t){return mt(n,t)},yn.isEqualWith=function(n,t,r){var e=(r=typeof r=="function"?r:Z)?r(n,t):Z;return e===Z?mt(n,t,r):!!e;
},yn.isError=de,yn.isFinite=function(n){return typeof n=="number"&&Ru(n)},yn.isFunction=ye,yn.isInteger=be,yn.isLength=xe,yn.isMap=function(n){return me(n)&&"[object Map]"==Sr(n)},yn.isMatch=function(n,t){return n===t||wt(n,t,Er(t))},yn.isMatchWith=function(n,t,r){return r=typeof r=="function"?r:Z,wt(n,t,Er(t),r)},yn.isNaN=function(n){return Ae(n)&&n!=+n},yn.isNative=we,yn.isNil=function(n){return null==n},yn.isNull=function(n){return null===n},yn.isNumber=Ae,yn.isObject=je,yn.isObjectLike=me,yn.isPlainObject=Oe,
yn.isRegExp=ke,yn.isSafeInteger=function(n){return be(n)&&n>=-9007199254740991&&9007199254740991>=n},yn.isSet=function(n){return me(n)&&"[object Set]"==Sr(n)},yn.isString=Ee,yn.isSymbol=Ie,yn.isTypedArray=Se,yn.isUndefined=function(n){return n===Z},yn.isWeakMap=function(n){return me(n)&&"[object WeakMap]"==Sr(n)},yn.isWeakSet=function(n){return me(n)&&"[object WeakSet]"==hu.call(n)},yn.join=function(n,t){return n?Wu.call(n,t):""},yn.kebabCase=ui,yn.last=Gr,yn.lastIndexOf=function(n,t,r){var e=n?n.length:0;
if(!e)return-1;var u=e;if(r!==Z&&(u=Be(r),u=(0>u?Cu(e+u,0):Uu(u,e-1))+1),t!==t)return B(n,u,true);for(;u--;)if(n[u]===t)return u;return-1},yn.lowerCase=oi,yn.lowerFirst=ii,yn.lt=Re,yn.lte=function(n,t){return t>=n},yn.max=function(n){return n&&n.length?_(n,Je,pe):Z},yn.maxBy=function(n,t){return n&&n.length?_(n,kr(t),pe):Z},yn.mean=function(n){return nu(n)/(n?n.length:0)},yn.min=function(n){return n&&n.length?_(n,Je,Re):Z},yn.minBy=function(n,t){return n&&n.length?_(n,kr(t),Re):Z},yn.noConflict=function(){
return Gn._===this&&(Gn._=pu),this},yn.noop=Qe,yn.now=Bo,yn.pad=function(n,t,r){n=Me(n),t=Be(t);var e=F(n);return t&&t>e?(e=(t-e)/2,t=Su(e),e=Iu(e),vr("",t,r)+n+vr("",e,r)):n},yn.padEnd=function(n,t,r){return n=Me(n),n+vr(n,t,r)},yn.padStart=function(n,t,r){return n=Me(n),vr(n,t,r)+n},yn.parseInt=function(n,t,r){return r||null==t?t=0:t&&(t=+t),n=Me(n).replace(fn,""),zu(n,t||(pn.test(n)?16:10))},yn.random=function(n,t,r){if(r&&typeof r!="boolean"&&zr(n,t,r)&&(t=r=Z),r===Z&&(typeof t=="boolean"?(r=t,
t=Z):typeof n=="boolean"&&(r=n,n=Z)),n===Z&&t===Z?(n=0,t=1):(n=Ue(n)||0,t===Z?(t=n,n=0):t=Ue(t)||0),n>t){var e=n;n=t,t=e}return r||n%1||t%1?(r=Mu(),Uu(n+r*(t-n+Fn("1e-"+((r+"").length-1))),t)):Lt(n,t)},yn.reduce=function(n,t,r){var e=Do(n)?s:y,u=3>arguments.length;return e(n,kr(t,4),r,u,Yu)},yn.reduceRight=function(n,t,r){var e=Do(n)?h:y,u=3>arguments.length;return e(n,kr(t,4),r,u,Hu)},yn.repeat=Ke,yn.replace=function(){var n=arguments,t=Me(n[0]);return 3>n.length?t:t.replace(n[1],n[2])},yn.result=function(n,t,r){
if(Mr(t,n))e=null==n?Z:n[t];else{t=rt(t);var e=Le(n,t);n=Dr(n,t)}return e===Z&&(e=r),ye(e)?e.call(n):e},yn.round=Ai,yn.runInContext=D,yn.sample=function(n){n=ge(n)?n:qe(n);var t=n.length;return t>0?n[Lt(0,t-1)]:Z},yn.size=function(n){if(null==n)return 0;if(ge(n)){var t=n.length;return t&&Ee(n)?F(n):t}return Ne(n).length},yn.snakeCase=ci,yn.some=function(n,t,r){var e=Do(n)?p:Nt;return r&&zr(n,t,r)&&(t=Z),e(n,kr(t,3))},yn.sortedIndex=function(n,t){return Dt(n,t)},yn.sortedIndexBy=function(n,t,r){return Zt(n,t,kr(r));
},yn.sortedIndexOf=function(n,t){var r=n?n.length:0;if(r){var e=Dt(n,t);if(r>e&&he(n[e],t))return e}return-1},yn.sortedLastIndex=function(n,t){return Dt(n,t,true)},yn.sortedLastIndexBy=function(n,t,r){return Zt(n,t,kr(r),true)},yn.sortedLastIndexOf=function(n,t){if(n&&n.length){var r=Dt(n,t,true)-1;if(he(n[r],t))return r}return-1},yn.startCase=ai,yn.startsWith=function(n,t,r){return n=Me(n),r=et(Be(r),0,n.length),n.lastIndexOf(t,r)==r},yn.subtract=function(n,t){var r;return n===Z&&t===Z?0:(n!==Z&&(r=n),
t!==Z&&(r=r===Z?t:r-t),r)},yn.sum=nu,yn.sumBy=function(n,t){return n&&n.length?x(n,kr(t)):0},yn.template=function(n,t,r){var e=yn.templateSettings;r&&zr(n,t,r)&&(t=Z),n=Me(n),t=To({},t,e,Kn),r=To({},t.imports,e.imports,Kn);var u,o,i=Ne(r),f=A(r,i),c=0;r=t.interpolate||xn;var a="__p+='";r=uu((t.escape||xn).source+"|"+r.source+"|"+(r===nn?sn:xn).source+"|"+(t.evaluate||xn).source+"|$","g");var l="sourceURL"in t?"//# sourceURL="+t.sourceURL+"\n":"";if(n.replace(r,function(t,r,e,i,f,l){return e||(e=i),
a+=n.slice(c,l).replace(jn,W),r&&(u=true,a+="'+__e("+r+")+'"),f&&(o=true,a+="';"+f+";\n__p+='"),e&&(a+="'+((__t=("+e+"))==null?'':__t)+'"),c=l+t.length,t}),a+="';",(t=t.variable)||(a="with(obj){"+a+"}"),a=(o?a.replace(T,""):a).replace(K,"$1").replace(G,"$1;"),a="function("+(t||"obj")+"){"+(t?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+a+"return __p}",t=si(function(){return Function(i,l+"return "+a).apply(Z,f);
}),t.source=a,de(t))throw t;return t},yn.times=function(n,t){if(n=Be(n),1>n||n>9007199254740991)return[];var r=4294967295,e=Uu(n,4294967295);for(t=tt(t),n-=4294967295,e=j(e,t);++r<n;)t(r);return e},yn.toInteger=Be,yn.toLength=Ce,yn.toLower=function(n){return Me(n).toLowerCase()},yn.toNumber=Ue,yn.toSafeInteger=function(n){return et(Be(n),-9007199254740991,9007199254740991)},yn.toString=Me,yn.toUpper=function(n){return Me(n).toUpperCase()},yn.trim=function(n,t,r){return(n=Me(n))?r||t===Z?n.replace(fn,""):(t+="")?(n=n.match(kn),
t=t.match(kn),n.slice(O(n,t),k(n,t)+1).join("")):n:n},yn.trimEnd=function(n,t,r){return(n=Me(n))?r||t===Z?n.replace(an,""):(t+="")?(n=n.match(kn),n.slice(0,k(n,t.match(kn))+1).join("")):n:n},yn.trimStart=function(n,t,r){return(n=Me(n))?r||t===Z?n.replace(cn,""):(t+="")?(n=n.match(kn),n.slice(O(n,t.match(kn))).join("")):n:n},yn.truncate=function(n,t){var r=30,e="...";if(je(t))var u="separator"in t?t.separator:u,r="length"in t?Be(t.length):r,e="omission"in t?Me(t.omission):e;n=Me(n);var o=n.length;if(En.test(n))var i=n.match(kn),o=i.length;
if(r>=o)return n;if(o=r-F(e),1>o)return e;if(r=i?i.slice(0,o).join(""):n.slice(0,o),u===Z)return r+e;if(i&&(o+=r.length-o),ke(u)){if(n.slice(o).search(u)){var f=r;for(u.global||(u=uu(u.source,Me(hn.exec(u))+"g")),u.lastIndex=0;i=u.exec(f);)var c=i.index;r=r.slice(0,c===Z?o:c)}}else n.indexOf(u,o)!=o&&(u=r.lastIndexOf(u),u>-1&&(r=r.slice(0,u)));return r+e},yn.unescape=function(n){return(n=Me(n))&&Y.test(n)?n.replace(V,N):n},yn.uniqueId=function(n){var t=++lu;return Me(n)+t},yn.upperCase=li,yn.upperFirst=fi,
yn.each=te,yn.eachRight=re,yn.first=Kr,He(yn,function(){var n={};return pt(yn,function(t,r){au.call(yn.prototype,r)||(n[r]=t)}),n}(),{chain:false}),yn.VERSION="4.5.0",u("bind bindKey curry curryRight partial partialRight".split(" "),function(n){yn[n].placeholder=yn}),u(["drop","take"],function(n,t){An.prototype[n]=function(r){var e=this.__filtered__;if(e&&!t)return new An(this);r=r===Z?1:Cu(Be(r),0);var u=this.clone();return e?u.__takeCount__=Uu(r,u.__takeCount__):u.__views__.push({size:Uu(r,4294967295),
type:n+(0>u.__dir__?"Right":"")}),u},An.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),u(["filter","map","takeWhile"],function(n,t){var r=t+1,e=1==r||3==r;An.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:kr(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),u(["head","last"],function(n,t){var r="take"+(t?"Right":"");An.prototype[n]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");
An.prototype[n]=function(){return this.__filtered__?new An(this):this[r](1)}}),An.prototype.compact=function(){return this.filter(Je)},An.prototype.find=function(n){return this.filter(n).head()},An.prototype.findLast=function(n){return this.reverse().find(n)},An.prototype.invokeMap=se(function(n,t){return typeof n=="function"?new An(this):this.map(function(r){return jt(r,n,t)})}),An.prototype.reject=function(n){return n=kr(n,3),this.filter(function(t){return!n(t)})},An.prototype.slice=function(n,t){
n=Be(n);var r=this;return r.__filtered__&&(n>0||0>t)?new An(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==Z&&(t=Be(t),r=0>t?r.dropRight(-t):r.take(t-n)),r)},An.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},An.prototype.toArray=function(){return this.take(4294967295)},pt(An.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=yn[e?"take"+("last"==t?"Right":""):t],o=e||/^find/.test(t);u&&(yn.prototype[t]=function(){
function t(n){return n=u.apply(yn,l([n],f)),e&&h?n[0]:n}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof An,a=f[0],s=c||Do(i);s&&r&&typeof a=="function"&&1!=a.length&&(c=s=false);var h=this.__chain__,p=!!this.__actions__.length,a=o&&!h,c=c&&!p;return!o&&s?(i=c?i:new An(this),i=n.apply(i,f),i.__actions__.push({func:Xr,args:[t],thisArg:Z}),new wn(i,h)):a&&c?n.apply(this,f):(i=this.thru(t),a?e?i.value()[0]:i.value():i)})}),u("pop push shift sort splice unshift".split(" "),function(n){var t=iu[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);
yn.prototype[n]=function(){var n=arguments;return e&&!this.__chain__?t.apply(this.value(),n):this[r](function(r){return t.apply(r,n)})}}),pt(An.prototype,function(n,t){var r=yn[t];if(r){var e=r.name+"";(Ju[e]||(Ju[e]=[])).push({name:t,func:r})}}),Ju[pr(Z,2).name]=[{name:"wrapper",func:Z}],An.prototype.clone=function(){var n=new An(this.__wrapped__);return n.__actions__=Xt(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Xt(this.__iteratees__),n.__takeCount__=this.__takeCount__,
n.__views__=Xt(this.__views__),n},An.prototype.reverse=function(){if(this.__filtered__){var n=new An(this);n.__dir__=-1,n.__filtered__=true}else n=this.clone(),n.__dir__*=-1;return n},An.prototype.value=function(){var n,t=this.__wrapped__.value(),r=this.__dir__,e=Do(t),u=0>r,o=e?t.length:0;n=o;for(var i=this.__views__,f=0,c=-1,a=i.length;++c<a;){var l=i[c],s=l.size;switch(l.type){case"drop":f+=s;break;case"dropRight":n-=s;break;case"take":n=Uu(n,f+s);break;case"takeRight":f=Cu(f,n-s)}}if(n={start:f,
end:n},i=n.start,f=n.end,n=f-i,u=u?f:i-1,i=this.__iteratees__,f=i.length,c=0,a=Uu(n,this.__takeCount__),!e||200>o||o==n&&a==n)return Kt(t,this.__actions__);e=[];n:for(;n--&&a>c;){for(u+=r,o=-1,l=t[u];++o<f;){var h=i[o],s=h.type,h=(0,h.iteratee)(l);if(2==s)l=h;else if(!h){if(1==s)continue n;break n}}e[c++]=l}return e},yn.prototype.at=Oo,yn.prototype.chain=function(){return Qr(this)},yn.prototype.commit=function(){return new wn(this.value(),this.__chain__)},yn.prototype.flatMap=function(n){return this.map(n).flatten();
},yn.prototype.next=function(){this.__values__===Z&&(this.__values__=We(this.value()));var n=this.__index__>=this.__values__.length,t=n?Z:this.__values__[this.__index__++];return{done:n,value:t}},yn.prototype.plant=function(n){for(var t,r=this;r instanceof mn;){var e=qr(r);e.__index__=0,e.__values__=Z,t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__}return u.__wrapped__=n,t},yn.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof An?(this.__actions__.length&&(n=new An(this)),n=n.reverse(),
n.__actions__.push({func:Xr,args:[Jr],thisArg:Z}),new wn(n,this.__chain__)):this.thru(Jr)},yn.prototype.toJSON=yn.prototype.valueOf=yn.prototype.value=function(){return Kt(this.__wrapped__,this.__actions__)},wu&&(yn.prototype[wu]=ne),yn}var Z,q=1/0,P=NaN,T=/\b__p\+='';/g,K=/\b(__p\+=)''\+/g,G=/(__e\(.*?\)|\b__t\))\+'';/g,V=/&(?:amp|lt|gt|quot|#39|#96);/g,J=/[&<>"'`]/g,Y=RegExp(V.source),H=RegExp(J.source),Q=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,nn=/<%=([\s\S]+?)%>/g,tn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rn=/^\w*$/,en=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,un=/[\\^$.*+?()[\]{}|]/g,on=RegExp(un.source),fn=/^\s+|\s+$/g,cn=/^\s+/,an=/\s+$/,ln=/\\(\\)?/g,sn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,hn=/\w*$/,pn=/^0x/i,_n=/^[-+]0x[0-9a-f]+$/i,gn=/^0b[01]+$/i,vn=/^\[object .+?Constructor\]$/,dn=/^0o[0-7]+$/i,yn=/^(?:0|[1-9]\d*)$/,bn=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xn=/($^)/,jn=/['\n\r\u2028\u2029\\]/g,mn="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*",wn="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+mn,An="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]?|[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",On=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),kn=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+An+mn,"g"),En=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),In=/[a-zA-Z0-9]+/g,Sn=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\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]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\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\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\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]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\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\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2018\\u2019\\u201c\\u201d \\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\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+|[A-Z\\xc0-\\xd6\\xd8-\\xde]+|\\d+",wn].join("|"),"g"),Rn=/[a-z][A-Z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wn="Array Buffer Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Reflect RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),Bn={};
Bn["[object Float32Array]"]=Bn["[object Float64Array]"]=Bn["[object Int8Array]"]=Bn["[object Int16Array]"]=Bn["[object Int32Array]"]=Bn["[object Uint8Array]"]=Bn["[object Uint8ClampedArray]"]=Bn["[object Uint16Array]"]=Bn["[object Uint32Array]"]=true,Bn["[object Arguments]"]=Bn["[object Array]"]=Bn["[object ArrayBuffer]"]=Bn["[object Boolean]"]=Bn["[object Date]"]=Bn["[object Error]"]=Bn["[object Function]"]=Bn["[object Map]"]=Bn["[object Number]"]=Bn["[object Object]"]=Bn["[object RegExp]"]=Bn["[object Set]"]=Bn["[object String]"]=Bn["[object WeakMap]"]=false;
var Cn={};Cn["[object Arguments]"]=Cn["[object Array]"]=Cn["[object ArrayBuffer]"]=Cn["[object Boolean]"]=Cn["[object Date]"]=Cn["[object Float32Array]"]=Cn["[object Float64Array]"]=Cn["[object Int8Array]"]=Cn["[object Int16Array]"]=Cn["[object Int32Array]"]=Cn["[object Map]"]=Cn["[object Number]"]=Cn["[object Object]"]=Cn["[object RegExp]"]=Cn["[object Set]"]=Cn["[object String]"]=Cn["[object Symbol]"]=Cn["[object Uint8Array]"]=Cn["[object Uint8ClampedArray]"]=Cn["[object Uint16Array]"]=Cn["[object Uint32Array]"]=true,
Cn["[object Error]"]=Cn["[object Function]"]=Cn["[object WeakMap]"]=false;var Un={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O",
"\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},zn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},Mn={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},Ln={"function":true,object:true},$n={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"
},Fn=parseFloat,Nn=parseInt,Dn=Ln[typeof exports]&&exports&&!exports.nodeType?exports:Z,Zn=Ln[typeof module]&&module&&!module.nodeType?module:Z,qn=Zn&&Zn.exports===Dn?Dn:Z,Pn=E(Ln[typeof self]&&self),Tn=E(Ln[typeof window]&&window),Kn=E(Ln[typeof this]&&this),Gn=E(Dn&&Zn&&typeof global=="object"&&global)||Tn!==(Kn&&Kn.window)&&Tn||Pn||Kn||Function("return this")(),Vn=D();(Tn||Pn||{})._=Vn,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return Vn}):Dn&&Zn?(qn&&((Zn.exports=Vn)._=Vn),
Dn._=Vn):Gn._=Vn}).call(this);
;(function(){function n(n,t,e){e=(e||0)-1;for(var r=n?n.length:0;++e<r;)if(n[e]===t)return e;return-1}function t(t,e){var r=typeof e;if(t=t.l,"boolean"==r||null==e)return t[e]?0:-1;"number"!=r&&"string"!=r&&(r="object");var u="number"==r?e:m+e;return t=(t=t[r])&&t[u],"object"==r?t&&-1<n(t,e)?0:-1:t?0:-1}function e(n){var t=this.l,e=typeof n;if("boolean"==e||null==n)t[n]=true;else{"number"!=e&&"string"!=e&&(e="object");var r="number"==e?n:m+n,t=t[e]||(t[e]={});"object"==e?(t[r]||(t[r]=[])).push(n):t[r]=true
}}function r(n){return n.charCodeAt(0)}function u(n,t){for(var e=n.m,r=t.m,u=-1,o=e.length;++u<o;){var i=e[u],a=r[u];if(i!==a){if(i>a||typeof i=="undefined")return 1;if(i<a||typeof a=="undefined")return-1}}return n.n-t.n}function o(n){var t=-1,r=n.length,u=n[0],o=n[r/2|0],i=n[r-1];if(u&&typeof u=="object"&&o&&typeof o=="object"&&i&&typeof i=="object")return false;for(u=f(),u["false"]=u["null"]=u["true"]=u.undefined=false,o=f(),o.k=n,o.l=u,o.push=e;++t<r;)o.push(n[t]);return o}function i(n){return"\\"+U[n]
}function a(){return h.pop()||[]}function f(){return g.pop()||{k:null,l:null,m:null,"false":false,n:0,"null":false,number:null,object:null,push:null,string:null,"true":false,undefined:false,o:null}}function l(n){n.length=0,h.length<_&&h.push(n)}function c(n){var t=n.l;t&&c(t),n.k=n.l=n.m=n.object=n.number=n.string=n.o=null,g.length<_&&g.push(n)}function p(n,t,e){t||(t=0),typeof e=="undefined"&&(e=n?n.length:0);var r=-1;e=e-t||0;for(var u=Array(0>e?0:e);++r<e;)u[r]=n[t+r];return u}function s(e){function h(n,t,e){if(!n||!V[typeof n])return n;
t=t&&typeof e=="undefined"?t:tt(t,e,3);for(var r=-1,u=V[typeof n]&&Fe(n),o=u?u.length:0;++r<o&&(e=u[r],false!==t(n[e],e,n)););return n}function g(n,t,e){var r;if(!n||!V[typeof n])return n;t=t&&typeof e=="undefined"?t:tt(t,e,3);for(r in n)if(false===t(n[r],r,n))break;return n}function _(n,t,e){var r,u=n,o=u;if(!u)return o;for(var i=arguments,a=0,f=typeof e=="number"?2:i.length;++a<f;)if((u=i[a])&&V[typeof u])for(var l=-1,c=V[typeof u]&&Fe(u),p=c?c.length:0;++l<p;)r=c[l],"undefined"==typeof o[r]&&(o[r]=u[r]);
return o}function U(n,t,e){var r,u=n,o=u;if(!u)return o;var i=arguments,a=0,f=typeof e=="number"?2:i.length;if(3<f&&"function"==typeof i[f-2])var l=tt(i[--f-1],i[f--],2);else 2<f&&"function"==typeof i[f-1]&&(l=i[--f]);for(;++a<f;)if((u=i[a])&&V[typeof u])for(var c=-1,p=V[typeof u]&&Fe(u),s=p?p.length:0;++c<s;)r=p[c],o[r]=l?l(o[r],u[r]):u[r];return o}function H(n){var t,e=[];if(!n||!V[typeof n])return e;for(t in n)me.call(n,t)&&e.push(t);return e}function J(n){return n&&typeof n=="object"&&!Te(n)&&me.call(n,"__wrapped__")?n:new Q(n)
}function Q(n,t){this.__chain__=!!t,this.__wrapped__=n}function X(n){function t(){if(r){var n=p(r);be.apply(n,arguments)}if(this instanceof t){var o=nt(e.prototype),n=e.apply(o,n||arguments);return wt(n)?n:o}return e.apply(u,n||arguments)}var e=n[0],r=n[2],u=n[4];return $e(t,n),t}function Z(n,t,e,r,u){if(e){var o=e(n);if(typeof o!="undefined")return o}if(!wt(n))return n;var i=ce.call(n);if(!K[i])return n;var f=Ae[i];switch(i){case T:case F:return new f(+n);case W:case P:return new f(n);case z:return o=f(n.source,C.exec(n)),o.lastIndex=n.lastIndex,o
}if(i=Te(n),t){var c=!r;r||(r=a()),u||(u=a());for(var s=r.length;s--;)if(r[s]==n)return u[s];o=i?f(n.length):{}}else o=i?p(n):U({},n);return i&&(me.call(n,"index")&&(o.index=n.index),me.call(n,"input")&&(o.input=n.input)),t?(r.push(n),u.push(o),(i?St:h)(n,function(n,i){o[i]=Z(n,t,e,r,u)}),c&&(l(r),l(u)),o):o}function nt(n){return wt(n)?ke(n):{}}function tt(n,t,e){if(typeof n!="function")return Ut;if(typeof t=="undefined"||!("prototype"in n))return n;var r=n.__bindData__;if(typeof r=="undefined"&&(De.funcNames&&(r=!n.name),r=r||!De.funcDecomp,!r)){var u=ge.call(n);
De.funcNames||(r=!O.test(u)),r||(r=E.test(u),$e(n,r))}if(false===r||true!==r&&1&r[1])return n;switch(e){case 1:return function(e){return n.call(t,e)};case 2:return function(e,r){return n.call(t,e,r)};case 3:return function(e,r,u){return n.call(t,e,r,u)};case 4:return function(e,r,u,o){return n.call(t,e,r,u,o)}}return Mt(n,t)}function et(n){function t(){var n=f?i:this;if(u){var h=p(u);be.apply(h,arguments)}return(o||c)&&(h||(h=p(arguments)),o&&be.apply(h,o),c&&h.length<a)?(r|=16,et([e,s?r:-4&r,h,null,i,a])):(h||(h=arguments),l&&(e=n[v]),this instanceof t?(n=nt(e.prototype),h=e.apply(n,h),wt(h)?h:n):e.apply(n,h))
}var e=n[0],r=n[1],u=n[2],o=n[3],i=n[4],a=n[5],f=1&r,l=2&r,c=4&r,s=8&r,v=e;return $e(t,n),t}function rt(e,r){var u=-1,i=st(),a=e?e.length:0,f=a>=b&&i===n,l=[];if(f){var p=o(r);p?(i=t,r=p):f=false}for(;++u<a;)p=e[u],0>i(r,p)&&l.push(p);return f&&c(r),l}function ut(n,t,e,r){r=(r||0)-1;for(var u=n?n.length:0,o=[];++r<u;){var i=n[r];if(i&&typeof i=="object"&&typeof i.length=="number"&&(Te(i)||yt(i))){t||(i=ut(i,t,e));var a=-1,f=i.length,l=o.length;for(o.length+=f;++a<f;)o[l++]=i[a]}else e||o.push(i)}return o
}function ot(n,t,e,r,u,o){if(e){var i=e(n,t);if(typeof i!="undefined")return!!i}if(n===t)return 0!==n||1/n==1/t;if(n===n&&!(n&&V[typeof n]||t&&V[typeof t]))return false;if(null==n||null==t)return n===t;var f=ce.call(n),c=ce.call(t);if(f==D&&(f=q),c==D&&(c=q),f!=c)return false;switch(f){case T:case F:return+n==+t;case W:return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case z:case P:return n==oe(t)}if(c=f==$,!c){var p=me.call(n,"__wrapped__"),s=me.call(t,"__wrapped__");if(p||s)return ot(p?n.__wrapped__:n,s?t.__wrapped__:t,e,r,u,o);
if(f!=q)return false;if(f=n.constructor,p=t.constructor,f!=p&&!(dt(f)&&f instanceof f&&dt(p)&&p instanceof p)&&"constructor"in n&&"constructor"in t)return false}for(f=!u,u||(u=a()),o||(o=a()),p=u.length;p--;)if(u[p]==n)return o[p]==t;var v=0,i=true;if(u.push(n),o.push(t),c){if(p=n.length,v=t.length,(i=v==p)||r)for(;v--;)if(c=p,s=t[v],r)for(;c--&&!(i=ot(n[c],s,e,r,u,o)););else if(!(i=ot(n[v],s,e,r,u,o)))break}else g(t,function(t,a,f){return me.call(f,a)?(v++,i=me.call(n,a)&&ot(n[a],t,e,r,u,o)):void 0}),i&&!r&&g(n,function(n,t,e){return me.call(e,t)?i=-1<--v:void 0
});return u.pop(),o.pop(),f&&(l(u),l(o)),i}function it(n,t,e,r,u){(Te(t)?St:h)(t,function(t,o){var i,a,f=t,l=n[o];if(t&&((a=Te(t))||Pe(t))){for(f=r.length;f--;)if(i=r[f]==t){l=u[f];break}if(!i){var c;e&&(f=e(l,t),c=typeof f!="undefined")&&(l=f),c||(l=a?Te(l)?l:[]:Pe(l)?l:{}),r.push(t),u.push(l),c||it(l,t,e,r,u)}}else e&&(f=e(l,t),typeof f=="undefined"&&(f=t)),typeof f!="undefined"&&(l=f);n[o]=l})}function at(n,t){return n+he(Re()*(t-n+1))}function ft(e,r,u){var i=-1,f=st(),p=e?e.length:0,s=[],v=!r&&p>=b&&f===n,h=u||v?a():s;
for(v&&(h=o(h),f=t);++i<p;){var g=e[i],y=u?u(g,i,e):g;(r?!i||h[h.length-1]!==y:0>f(h,y))&&((u||v)&&h.push(y),s.push(g))}return v?(l(h.k),c(h)):u&&l(h),s}function lt(n){return function(t,e,r){var u={};e=J.createCallback(e,r,3),r=-1;var o=t?t.length:0;if(typeof o=="number")for(;++r<o;){var i=t[r];n(u,i,e(i,r,t),t)}else h(t,function(t,r,o){n(u,t,e(t,r,o),o)});return u}}function ct(n,t,e,r,u,o){var i=1&t,a=4&t,f=16&t,l=32&t;if(!(2&t||dt(n)))throw new ie;f&&!e.length&&(t&=-17,f=e=false),l&&!r.length&&(t&=-33,l=r=false);
var c=n&&n.__bindData__;return c&&true!==c?(c=p(c),c[2]&&(c[2]=p(c[2])),c[3]&&(c[3]=p(c[3])),!i||1&c[1]||(c[4]=u),!i&&1&c[1]&&(t|=8),!a||4&c[1]||(c[5]=o),f&&be.apply(c[2]||(c[2]=[]),e),l&&we.apply(c[3]||(c[3]=[]),r),c[1]|=t,ct.apply(null,c)):(1==t||17===t?X:et)([n,t,e,r,u,o])}function pt(n){return Be[n]}function st(){var t=(t=J.indexOf)===Wt?n:t;return t}function vt(n){return typeof n=="function"&&pe.test(n)}function ht(n){var t,e;return n&&ce.call(n)==q&&(t=n.constructor,!dt(t)||t instanceof t)?(g(n,function(n,t){e=t
}),typeof e=="undefined"||me.call(n,e)):false}function gt(n){return We[n]}function yt(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ce.call(n)==D||false}function mt(n,t,e){var r=Fe(n),u=r.length;for(t=tt(t,e,3);u--&&(e=r[u],false!==t(n[e],e,n)););return n}function bt(n){var t=[];return g(n,function(n,e){dt(n)&&t.push(e)}),t.sort()}function _t(n){for(var t=-1,e=Fe(n),r=e.length,u={};++t<r;){var o=e[t];u[n[o]]=o}return u}function dt(n){return typeof n=="function"}function wt(n){return!(!n||!V[typeof n])
}function jt(n){return typeof n=="number"||n&&typeof n=="object"&&ce.call(n)==W||false}function kt(n){return typeof n=="string"||n&&typeof n=="object"&&ce.call(n)==P||false}function xt(n){for(var t=-1,e=Fe(n),r=e.length,u=Xt(r);++t<r;)u[t]=n[e[t]];return u}function Ct(n,t,e){var r=-1,u=st(),o=n?n.length:0,i=false;return e=(0>e?Ie(0,o+e):e)||0,Te(n)?i=-1<u(n,t,e):typeof o=="number"?i=-1<(kt(n)?n.indexOf(t,e):u(n,t,e)):h(n,function(n){return++r<e?void 0:!(i=n===t)}),i}function Ot(n,t,e){var r=true;t=J.createCallback(t,e,3),e=-1;
var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&(r=!!t(n[e],e,n)););else h(n,function(n,e,u){return r=!!t(n,e,u)});return r}function Nt(n,t,e){var r=[];t=J.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u;){var o=n[e];t(o,e,n)&&r.push(o)}else h(n,function(n,e,u){t(n,e,u)&&r.push(n)});return r}function It(n,t,e){t=J.createCallback(t,e,3),e=-1;var r=n?n.length:0;if(typeof r!="number"){var u;return h(n,function(n,e,r){return t(n,e,r)?(u=n,false):void 0}),u}for(;++e<r;){var o=n[e];
if(t(o,e,n))return o}}function St(n,t,e){var r=-1,u=n?n.length:0;if(t=t&&typeof e=="undefined"?t:tt(t,e,3),typeof u=="number")for(;++r<u&&false!==t(n[r],r,n););else h(n,t);return n}function Et(n,t,e){var r=n?n.length:0;if(t=t&&typeof e=="undefined"?t:tt(t,e,3),typeof r=="number")for(;r--&&false!==t(n[r],r,n););else{var u=Fe(n),r=u.length;h(n,function(n,e,o){return e=u?u[--r]:--r,t(o[e],e,o)})}return n}function Rt(n,t,e){var r=-1,u=n?n.length:0;if(t=J.createCallback(t,e,3),typeof u=="number")for(var o=Xt(u);++r<u;)o[r]=t(n[r],r,n);
else o=[],h(n,function(n,e,u){o[++r]=t(n,e,u)});return o}function At(n,t,e){var u=-1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&Te(n)){e=-1;for(var i=n.length;++e<i;){var a=n[e];a>o&&(o=a)}}else t=null==t&&kt(n)?r:J.createCallback(t,e,3),St(n,function(n,e,r){e=t(n,e,r),e>u&&(u=e,o=n)});return o}function Dt(n,t,e,r){if(!n)return e;var u=3>arguments.length;t=J.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 h(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)
});return e}function $t(n,t,e,r){var u=3>arguments.length;return t=J.createCallback(t,r,4),Et(n,function(n,r,o){e=u?(u=false,n):t(e,n,r,o)}),e}function Tt(n){var t=-1,e=n?n.length:0,r=Xt(typeof e=="number"?e:0);return St(n,function(n){var e=at(0,++t);r[t]=r[e],r[e]=n}),r}function Ft(n,t,e){var r;t=J.createCallback(t,e,3),e=-1;var u=n?n.length:0;if(typeof u=="number")for(;++e<u&&!(r=t(n[e],e,n)););else h(n,function(n,e,u){return!(r=t(n,e,u))});return!!r}function Bt(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=-1;
for(t=J.createCallback(t,e,3);++o<u&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[0]:v;return p(n,0,Se(Ie(0,r),u))}function Wt(t,e,r){if(typeof r=="number"){var u=t?t.length:0;r=0>r?Ie(0,u+r):r||0}else if(r)return r=zt(t,e),t[r]===e?r:-1;return n(t,e,r)}function qt(n,t,e){if(typeof t!="number"&&null!=t){var r=0,u=-1,o=n?n.length:0;for(t=J.createCallback(t,e,3);++u<o&&t(n[u],u,n);)r++}else r=null==t||e?1:Ie(0,t);return p(n,r)}function zt(n,t,e,r){var u=0,o=n?n.length:u;for(e=e?J.createCallback(e,r,1):Ut,t=e(t);u<o;)r=u+o>>>1,e(n[r])<t?u=r+1:o=r;
return u}function Pt(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(e=J.createCallback(e,r,3)),ft(n,t,e)}function Kt(){for(var n=1<arguments.length?arguments:arguments[0],t=-1,e=n?At(Ve(n,"length")):0,r=Xt(0>e?0:e);++t<e;)r[t]=Ve(n,t);return r}function Lt(n,t){var e=-1,r=n?n.length:0,u={};for(t||!r||Te(n[0])||(t=[]);++e<r;){var o=n[e];t?u[o]=t[e]:o&&(u[o[0]]=o[1])}return u}function Mt(n,t){return 2<arguments.length?ct(n,17,p(arguments,2),null,t):ct(n,1,null,null,t)
}function Vt(n,t,e){function r(){c&&ve(c),i=c=p=v,(g||h!==t)&&(s=Ue(),a=n.apply(l,o),c||i||(o=l=null))}function u(){var e=t-(Ue()-f);0<e?c=_e(u,e):(i&&ve(i),e=p,i=c=p=v,e&&(s=Ue(),a=n.apply(l,o),c||i||(o=l=null)))}var o,i,a,f,l,c,p,s=0,h=false,g=true;if(!dt(n))throw new ie;if(t=Ie(0,t)||0,true===e)var y=true,g=false;else wt(e)&&(y=e.leading,h="maxWait"in e&&(Ie(t,e.maxWait)||0),g="trailing"in e?e.trailing:g);return function(){if(o=arguments,f=Ue(),l=this,p=g&&(c||!y),false===h)var e=y&&!c;else{i||y||(s=f);var v=h-(f-s),m=0>=v;
m?(i&&(i=ve(i)),s=f,a=n.apply(l,o)):i||(i=_e(r,v))}return m&&c?c=ve(c):c||t===h||(c=_e(u,t)),e&&(m=true,a=n.apply(l,o)),!m||c||i||(o=l=null),a}}function Ut(n){return n}function Gt(n,t,e){var r=true,u=t&&bt(t);t&&(e||u.length)||(null==e&&(e=t),o=Q,t=n,n=J,u=bt(t)),false===e?r=false:wt(e)&&"chain"in e&&(r=e.chain);var o=n,i=dt(o);St(u,function(e){var u=n[e]=t[e];i&&(o.prototype[e]=function(){var t=this.__chain__,e=this.__wrapped__,i=[e];if(be.apply(i,arguments),i=u.apply(n,i),r||t){if(e===i&&wt(i))return this;
i=new o(i),i.__chain__=t}return i})})}function Ht(){}function Jt(n){return function(t){return t[n]}}function Qt(){return this.__wrapped__}e=e?Y.defaults(G.Object(),e,Y.pick(G,A)):G;var Xt=e.Array,Yt=e.Boolean,Zt=e.Date,ne=e.Function,te=e.Math,ee=e.Number,re=e.Object,ue=e.RegExp,oe=e.String,ie=e.TypeError,ae=[],fe=re.prototype,le=e._,ce=fe.toString,pe=ue("^"+oe(ce).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),se=te.ceil,ve=e.clearTimeout,he=te.floor,ge=ne.prototype.toString,ye=vt(ye=re.getPrototypeOf)&&ye,me=fe.hasOwnProperty,be=ae.push,_e=e.setTimeout,de=ae.splice,we=ae.unshift,je=function(){try{var n={},t=vt(t=re.defineProperty)&&t,e=t(n,n,n)&&t
}catch(r){}return e}(),ke=vt(ke=re.create)&&ke,xe=vt(xe=Xt.isArray)&&xe,Ce=e.isFinite,Oe=e.isNaN,Ne=vt(Ne=re.keys)&&Ne,Ie=te.max,Se=te.min,Ee=e.parseInt,Re=te.random,Ae={};Ae[$]=Xt,Ae[T]=Yt,Ae[F]=Zt,Ae[B]=ne,Ae[q]=re,Ae[W]=ee,Ae[z]=ue,Ae[P]=oe,Q.prototype=J.prototype;var De=J.support={};De.funcDecomp=!vt(e.a)&&E.test(s),De.funcNames=typeof ne.name=="string",J.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,variable:"",imports:{_:J}},ke||(nt=function(){function n(){}return function(t){if(wt(t)){n.prototype=t;
var r=new n;n.prototype=null}return r||e.Object()}}());var $e=je?function(n,t){M.value=t,je(n,"__bindData__",M)}:Ht,Te=xe||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&ce.call(n)==$||false},Fe=Ne?function(n){return wt(n)?Ne(n):[]}:H,Be={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},We=_t(Be),qe=ue("("+Fe(We).join("|")+")","g"),ze=ue("["+Fe(Be).join("")+"]","g"),Pe=ye?function(n){if(!n||ce.call(n)!=q)return false;var t=n.valueOf,e=vt(t)&&(e=ye(t))&&ye(e);return e?n==e||ye(n)==e:ht(n)
}:ht,Ke=lt(function(n,t,e){me.call(n,e)?n[e]++:n[e]=1}),Le=lt(function(n,t,e){(me.call(n,e)?n[e]:n[e]=[]).push(t)}),Me=lt(function(n,t,e){n[e]=t}),Ve=Rt,Ue=vt(Ue=Zt.now)&&Ue||function(){return(new Zt).getTime()},Ge=8==Ee(d+"08")?Ee:function(n,t){return Ee(kt(n)?n.replace(I,""):n,t||0)};return J.after=function(n,t){if(!dt(t))throw new ie;return function(){return 1>--n?t.apply(this,arguments):void 0}},J.assign=U,J.at=function(n){for(var t=arguments,e=-1,r=ut(t,true,false,1),t=t[2]&&t[2][t[1]]===n?1:r.length,u=Xt(t);++e<t;)u[e]=n[r[e]];
return u},J.bind=Mt,J.bindAll=function(n){for(var t=1<arguments.length?ut(arguments,true,false,1):bt(n),e=-1,r=t.length;++e<r;){var u=t[e];n[u]=ct(n[u],1,null,null,n)}return n},J.bindKey=function(n,t){return 2<arguments.length?ct(t,19,p(arguments,2),null,n):ct(t,3,null,null,n)},J.chain=function(n){return n=new Q(n),n.__chain__=true,n},J.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},J.compose=function(){for(var n=arguments,t=n.length;t--;)if(!dt(n[t]))throw new ie;
return function(){for(var t=arguments,e=n.length;e--;)t=[n[e].apply(this,t)];return t[0]}},J.constant=function(n){return function(){return n}},J.countBy=Ke,J.create=function(n,t){var e=nt(n);return t?U(e,t):e},J.createCallback=function(n,t,e){var r=typeof n;if(null==n||"function"==r)return tt(n,t,e);if("object"!=r)return Jt(n);var u=Fe(n),o=u[0],i=n[o];return 1!=u.length||i!==i||wt(i)?function(t){for(var e=u.length,r=false;e--&&(r=ot(t[u[e]],n[u[e]],null,true)););return r}:function(n){return n=n[o],i===n&&(0!==i||1/i==1/n)
}},J.curry=function(n,t){return t=typeof t=="number"?t:+t||n.length,ct(n,4,null,null,null,t)},J.debounce=Vt,J.defaults=_,J.defer=function(n){if(!dt(n))throw new ie;var t=p(arguments,1);return _e(function(){n.apply(v,t)},1)},J.delay=function(n,t){if(!dt(n))throw new ie;var e=p(arguments,2);return _e(function(){n.apply(v,e)},t)},J.difference=function(n){return rt(n,ut(arguments,true,true,1))},J.filter=Nt,J.flatten=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=typeof t!="function"&&r&&r[t]===n?null:t,t=false),null!=e&&(n=Rt(n,e,r)),ut(n,t)
},J.forEach=St,J.forEachRight=Et,J.forIn=g,J.forInRight=function(n,t,e){var r=[];g(n,function(n,t){r.push(t,n)});var u=r.length;for(t=tt(t,e,3);u--&&false!==t(r[u--],r[u],n););return n},J.forOwn=h,J.forOwnRight=mt,J.functions=bt,J.groupBy=Le,J.indexBy=Me,J.initial=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=J.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else r=null==t||e?1:t||r;return p(n,0,Se(Ie(0,u-r),u))},J.intersection=function(){for(var e=[],r=-1,u=arguments.length,i=a(),f=st(),p=f===n,s=a();++r<u;){var v=arguments[r];
(Te(v)||yt(v))&&(e.push(v),i.push(p&&v.length>=b&&o(r?e[r]:s)))}var p=e[0],h=-1,g=p?p.length:0,y=[];n:for(;++h<g;){var m=i[0],v=p[h];if(0>(m?t(m,v):f(s,v))){for(r=u,(m||s).push(v);--r;)if(m=i[r],0>(m?t(m,v):f(e[r],v)))continue n;y.push(v)}}for(;u--;)(m=i[u])&&c(m);return l(i),l(s),y},J.invert=_t,J.invoke=function(n,t){var e=p(arguments,2),r=-1,u=typeof t=="function",o=n?n.length:0,i=Xt(typeof o=="number"?o:0);return St(n,function(n){i[++r]=(u?t:n[t]).apply(n,e)}),i},J.keys=Fe,J.map=Rt,J.mapValues=function(n,t,e){var r={};
return t=J.createCallback(t,e,3),h(n,function(n,e,u){r[e]=t(n,e,u)}),r},J.max=At,J.memoize=function(n,t){function e(){var r=e.cache,u=t?t.apply(this,arguments):m+arguments[0];return me.call(r,u)?r[u]:r[u]=n.apply(this,arguments)}if(!dt(n))throw new ie;return e.cache={},e},J.merge=function(n){var t=arguments,e=2;if(!wt(n))return n;if("number"!=typeof t[2]&&(e=t.length),3<e&&"function"==typeof t[e-2])var r=tt(t[--e-1],t[e--],2);else 2<e&&"function"==typeof t[e-1]&&(r=t[--e]);for(var t=p(arguments,1,e),u=-1,o=a(),i=a();++u<e;)it(n,t[u],r,o,i);
return l(o),l(i),n},J.min=function(n,t,e){var u=1/0,o=u;if(typeof t!="function"&&e&&e[t]===n&&(t=null),null==t&&Te(n)){e=-1;for(var i=n.length;++e<i;){var a=n[e];a<o&&(o=a)}}else t=null==t&&kt(n)?r:J.createCallback(t,e,3),St(n,function(n,e,r){e=t(n,e,r),e<u&&(u=e,o=n)});return o},J.omit=function(n,t,e){var r={};if(typeof t!="function"){var u=[];g(n,function(n,t){u.push(t)});for(var u=rt(u,ut(arguments,true,false,1)),o=-1,i=u.length;++o<i;){var a=u[o];r[a]=n[a]}}else t=J.createCallback(t,e,3),g(n,function(n,e,u){t(n,e,u)||(r[e]=n)
});return r},J.once=function(n){var t,e;if(!dt(n))throw new ie;return function(){return t?e:(t=true,e=n.apply(this,arguments),n=null,e)}},J.pairs=function(n){for(var t=-1,e=Fe(n),r=e.length,u=Xt(r);++t<r;){var o=e[t];u[t]=[o,n[o]]}return u},J.partial=function(n){return ct(n,16,p(arguments,1))},J.partialRight=function(n){return ct(n,32,null,p(arguments,1))},J.pick=function(n,t,e){var r={};if(typeof t!="function")for(var u=-1,o=ut(arguments,true,false,1),i=wt(n)?o.length:0;++u<i;){var a=o[u];a in n&&(r[a]=n[a])
}else t=J.createCallback(t,e,3),g(n,function(n,e,u){t(n,e,u)&&(r[e]=n)});return r},J.pluck=Ve,J.property=Jt,J.pull=function(n){for(var t=arguments,e=0,r=t.length,u=n?n.length:0;++e<r;)for(var o=-1,i=t[e];++o<u;)n[o]===i&&(de.call(n,o--,1),u--);return n},J.range=function(n,t,e){n=+n||0,e=typeof e=="number"?e:+e||1,null==t&&(t=n,n=0);var r=-1;t=Ie(0,se((t-n)/(e||1)));for(var u=Xt(t);++r<t;)u[r]=n,n+=e;return u},J.reject=function(n,t,e){return t=J.createCallback(t,e,3),Nt(n,function(n,e,r){return!t(n,e,r)
})},J.remove=function(n,t,e){var r=-1,u=n?n.length:0,o=[];for(t=J.createCallback(t,e,3);++r<u;)e=n[r],t(e,r,n)&&(o.push(e),de.call(n,r--,1),u--);return o},J.rest=qt,J.shuffle=Tt,J.sortBy=function(n,t,e){var r=-1,o=Te(t),i=n?n.length:0,p=Xt(typeof i=="number"?i:0);for(o||(t=J.createCallback(t,e,3)),St(n,function(n,e,u){var i=p[++r]=f();o?i.m=Rt(t,function(t){return n[t]}):(i.m=a())[0]=t(n,e,u),i.n=r,i.o=n}),i=p.length,p.sort(u);i--;)n=p[i],p[i]=n.o,o||l(n.m),c(n);return p},J.tap=function(n,t){return t(n),n
},J.throttle=function(n,t,e){var r=true,u=true;if(!dt(n))throw new ie;return false===e?r=false:wt(e)&&(r="leading"in e?e.leading:r,u="trailing"in e?e.trailing:u),L.leading=r,L.maxWait=t,L.trailing=u,Vt(n,t,L)},J.times=function(n,t,e){n=-1<(n=+n)?n:0;var r=-1,u=Xt(n);for(t=tt(t,e,1);++r<n;)u[r]=t(r);return u},J.toArray=function(n){return n&&typeof n.length=="number"?p(n):xt(n)},J.transform=function(n,t,e,r){var u=Te(n);if(null==e)if(u)e=[];else{var o=n&&n.constructor;e=nt(o&&o.prototype)}return t&&(t=J.createCallback(t,r,4),(u?St:h)(n,function(n,r,u){return t(e,n,r,u)
})),e},J.union=function(){return ft(ut(arguments,true,true))},J.uniq=Pt,J.values=xt,J.where=Nt,J.without=function(n){return rt(n,p(arguments,1))},J.wrap=function(n,t){return ct(t,16,[n])},J.xor=function(){for(var n=-1,t=arguments.length;++n<t;){var e=arguments[n];if(Te(e)||yt(e))var r=r?ft(rt(r,e).concat(rt(e,r))):e}return r||[]},J.zip=Kt,J.zipObject=Lt,J.collect=Rt,J.drop=qt,J.each=St,J.eachRight=Et,J.extend=U,J.methods=bt,J.object=Lt,J.select=Nt,J.tail=qt,J.unique=Pt,J.unzip=Kt,Gt(J),J.clone=function(n,t,e,r){return typeof t!="boolean"&&null!=t&&(r=e,e=t,t=false),Z(n,t,typeof e=="function"&&tt(e,r,1))
},J.cloneDeep=function(n,t,e){return Z(n,true,typeof t=="function"&&tt(t,e,1))},J.contains=Ct,J.escape=function(n){return null==n?"":oe(n).replace(ze,pt)},J.every=Ot,J.find=It,J.findIndex=function(n,t,e){var r=-1,u=n?n.length:0;for(t=J.createCallback(t,e,3);++r<u;)if(t(n[r],r,n))return r;return-1},J.findKey=function(n,t,e){var r;return t=J.createCallback(t,e,3),h(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},J.findLast=function(n,t,e){var r;return t=J.createCallback(t,e,3),Et(n,function(n,e,u){return t(n,e,u)?(r=n,false):void 0
}),r},J.findLastIndex=function(n,t,e){var r=n?n.length:0;for(t=J.createCallback(t,e,3);r--;)if(t(n[r],r,n))return r;return-1},J.findLastKey=function(n,t,e){var r;return t=J.createCallback(t,e,3),mt(n,function(n,e,u){return t(n,e,u)?(r=e,false):void 0}),r},J.has=function(n,t){return n?me.call(n,t):false},J.identity=Ut,J.indexOf=Wt,J.isArguments=yt,J.isArray=Te,J.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&ce.call(n)==T||false},J.isDate=function(n){return n&&typeof n=="object"&&ce.call(n)==F||false
},J.isElement=function(n){return n&&1===n.nodeType||false},J.isEmpty=function(n){var t=true;if(!n)return t;var e=ce.call(n),r=n.length;return e==$||e==P||e==D||e==q&&typeof r=="number"&&dt(n.splice)?!r:(h(n,function(){return t=false}),t)},J.isEqual=function(n,t,e,r){return ot(n,t,typeof e=="function"&&tt(e,r,2))},J.isFinite=function(n){return Ce(n)&&!Oe(parseFloat(n))},J.isFunction=dt,J.isNaN=function(n){return jt(n)&&n!=+n},J.isNull=function(n){return null===n},J.isNumber=jt,J.isObject=wt,J.isPlainObject=Pe,J.isRegExp=function(n){return n&&typeof n=="object"&&ce.call(n)==z||false
},J.isString=kt,J.isUndefined=function(n){return typeof n=="undefined"},J.lastIndexOf=function(n,t,e){var r=n?n.length:0;for(typeof e=="number"&&(r=(0>e?Ie(0,r+e):Se(e,r-1))+1);r--;)if(n[r]===t)return r;return-1},J.mixin=Gt,J.noConflict=function(){return e._=le,this},J.noop=Ht,J.now=Ue,J.parseInt=Ge,J.random=function(n,t,e){var r=null==n,u=null==t;return null==e&&(typeof n=="boolean"&&u?(e=n,n=1):u||typeof t!="boolean"||(e=t,u=true)),r&&u&&(t=1),n=+n||0,u?(t=n,n=0):t=+t||0,e||n%1||t%1?(e=Re(),Se(n+e*(t-n+parseFloat("1e-"+((e+"").length-1))),t)):at(n,t)
},J.reduce=Dt,J.reduceRight=$t,J.result=function(n,t){if(n){var e=n[t];return dt(e)?n[t]():e}},J.runInContext=s,J.size=function(n){var t=n?n.length:0;return typeof t=="number"?t:Fe(n).length},J.some=Ft,J.sortedIndex=zt,J.template=function(n,t,e){var r=J.templateSettings;n=oe(n||""),e=_({},e,r);var u,o=_({},e.imports,r.imports),r=Fe(o),o=xt(o),a=0,f=e.interpolate||S,l="__p+='",f=ue((e.escape||S).source+"|"+f.source+"|"+(f===N?x:S).source+"|"+(e.evaluate||S).source+"|$","g");n.replace(f,function(t,e,r,o,f,c){return r||(r=o),l+=n.slice(a,c).replace(R,i),e&&(l+="'+__e("+e+")+'"),f&&(u=true,l+="';"+f+";\n__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"),a=c+t.length,t
}),l+="';",f=e=e.variable,f||(e="obj",l="with("+e+"){"+l+"}"),l=(u?l.replace(w,""):l).replace(j,"$1").replace(k,"$1;"),l="function("+e+"){"+(f?"":e+"||("+e+"={});")+"var __t,__p='',__e=_.escape"+(u?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+l+"return __p}";try{var c=ne(r,"return "+l).apply(v,o)}catch(p){throw p.source=l,p}return t?c(t):(c.source=l,c)},J.unescape=function(n){return null==n?"":oe(n).replace(qe,gt)},J.uniqueId=function(n){var t=++y;return oe(null==n?"":n)+t
},J.all=Ot,J.any=Ft,J.detect=It,J.findWhere=It,J.foldl=Dt,J.foldr=$t,J.include=Ct,J.inject=Dt,Gt(function(){var n={};return h(J,function(t,e){J.prototype[e]||(n[e]=t)}),n}(),false),J.first=Bt,J.last=function(n,t,e){var r=0,u=n?n.length:0;if(typeof t!="number"&&null!=t){var o=u;for(t=J.createCallback(t,e,3);o--&&t(n[o],o,n);)r++}else if(r=t,null==r||e)return n?n[u-1]:v;return p(n,Ie(0,u-r))},J.sample=function(n,t,e){return n&&typeof n.length!="number"&&(n=xt(n)),null==t||e?n?n[at(0,n.length-1)]:v:(n=Tt(n),n.length=Se(Ie(0,t),n.length),n)
},J.take=Bt,J.head=Bt,h(J,function(n,t){var e="sample"!==t;J.prototype[t]||(J.prototype[t]=function(t,r){var u=this.__chain__,o=n(this.__wrapped__,t,r);return u||null!=t&&(!r||e&&typeof t=="function")?new Q(o,u):o})}),J.VERSION="2.4.1",J.prototype.chain=function(){return this.__chain__=true,this},J.prototype.toString=function(){return oe(this.__wrapped__)},J.prototype.value=Qt,J.prototype.valueOf=Qt,St(["join","pop","shift"],function(n){var t=ae[n];J.prototype[n]=function(){var n=this.__chain__,e=t.apply(this.__wrapped__,arguments);
return n?new Q(e,n):e}}),St(["push","reverse","sort","unshift"],function(n){var t=ae[n];J.prototype[n]=function(){return t.apply(this.__wrapped__,arguments),this}}),St(["concat","slice","splice"],function(n){var t=ae[n];J.prototype[n]=function(){return new Q(t.apply(this.__wrapped__,arguments),this.__chain__)}}),J}var v,h=[],g=[],y=0,m=+new Date+"",b=75,_=40,d=" \t\x0B\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",w=/\b__p\+='';/g,j=/\b(__p\+=)''\+/g,k=/(__e\(.*?\)|\b__t\))\+'';/g,x=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,C=/\w*$/,O=/^\s*function[ \n\r\t]+\w/,N=/<%=([\s\S]+?)%>/g,I=RegExp("^["+d+"]*0+(?=.$)"),S=/($^)/,E=/\bthis\b/,R=/['\n\r\t\u2028\u2029\\]/g,A="Array Boolean Date Function Math Number Object RegExp String _ attachEvent clearTimeout isFinite isNaN parseInt setTimeout".split(" "),D="[object Arguments]",$="[object Array]",T="[object Boolean]",F="[object Date]",B="[object Function]",W="[object Number]",q="[object Object]",z="[object RegExp]",P="[object String]",K={};
K[B]=false,K[D]=K[$]=K[T]=K[F]=K[W]=K[q]=K[z]=K[P]=true;var L={leading:false,maxWait:0,trailing:false},M={configurable:false,enumerable:false,value:null,writable:false},V={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},U={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},G=V[typeof window]&&window||this,H=V[typeof exports]&&exports&&!exports.nodeType&&exports,J=V[typeof module]&&module&&!module.nodeType&&module,Q=J&&J.exports===H&&H,X=V[typeof global]&&global;!X||X.global!==X&&X.window!==X||(G=X);
var Y=s();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(G._=Y, define(function(){return Y})):H&&J?Q?(J.exports=Y)._=Y:H._=Y:G._=Y}).call(this);

4979
dist/lodash.underscore.js vendored Normal file

File diff suppressed because it is too large Load Diff

39
dist/lodash.underscore.min.js vendored Normal file
View File

@@ -0,0 +1,39 @@
/**
* @license
* Lo-Dash 2.4.1 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
*/
;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++t<e;)if(n[t]===r)return t;return-1}function r(n,r){for(var t=n.m,e=r.m,u=-1,o=t.length;++u<o;){var i=t[u],f=e[u];if(i!==f){if(i>f||typeof i=="undefined")return 1;if(i<f||typeof f=="undefined")return-1}}return n.n-r.n}function t(n){return"\\"+yr[n]}function e(n,r,t){r||(r=0),typeof t=="undefined"&&(t=n?n.length:0);var e=-1;t=t-r||0;for(var u=Array(0>t?0:t);++e<t;)u[e]=n[r+e];return u}function u(n){return n instanceof u?n:new o(n)}function o(n,r){this.__chain__=!!r,this.__wrapped__=n
}function i(n){function r(){if(u){var n=e(u);Rr.apply(n,arguments)}if(this instanceof r){var i=f(t.prototype),n=t.apply(i,n||arguments);return O(n)?n:i}return t.apply(o,n||arguments)}var t=n[0],u=n[2],o=n[4];return r}function f(n){return O(n)?Br(n):{}}function a(n,r,t){if(typeof n!="function")return Y;if(typeof r=="undefined"||!("prototype"in n))return n;switch(t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)
};case 4:return function(t,e,u,o){return n.call(r,t,e,u,o)}}return L(n,r)}function l(n){function r(){var n=p?a:this;if(o){var y=e(o);Rr.apply(y,arguments)}return(i||g)&&(y||(y=e(arguments)),i&&Rr.apply(y,i),g&&y.length<c)?(u|=16,l([t,h?u:-4&u,y,null,a,c])):(y||(y=arguments),s&&(t=n[v]),this instanceof r?(n=f(t.prototype),y=t.apply(n,y),O(y)?y:n):t.apply(n,y))}var t=n[0],u=n[1],o=n[2],i=n[3],a=n[4],c=n[5],p=1&u,s=2&u,g=4&u,h=8&u,v=t;return r}function c(n,r){for(var t=-1,e=m(),u=n?n.length:0,o=[];++t<u;){var i=n[t];
0>e(r,i)&&o.push(i)}return o}function p(n,r,t,e){e=(e||0)-1;for(var u=n?n.length:0,o=[];++e<u;){var i=n[e];if(i&&typeof i=="object"&&typeof i.length=="number"&&(Cr(i)||b(i))){r||(i=p(i,r,t));var f=-1,a=i.length,l=o.length;for(o.length+=a;++f<a;)o[l++]=i[f]}else t||o.push(i)}return o}function s(n,r,t,e){if(n===r)return 0!==n||1/n==1/r;if(n===n&&!(n&&vr[typeof n]||r&&vr[typeof r]))return false;if(null==n||null==r)return n===r;var o=Er.call(n),i=Er.call(r);if(o!=i)return false;switch(o){case lr:case cr:return+n==+r;
case pr:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case gr:case hr:return n==r+""}if(i=o==ar,!i){var f=n instanceof u,a=r instanceof u;if(f||a)return s(f?n.__wrapped__:n,a?r.__wrapped__:r,t,e);if(o!=sr)return false;if(o=n.constructor,f=r.constructor,o!=f&&!(A(o)&&o instanceof o&&A(f)&&f instanceof f)&&"constructor"in n&&"constructor"in r)return false}for(t||(t=[]),e||(e=[]),o=t.length;o--;)if(t[o]==n)return e[o]==r;var l=true,c=0;if(t.push(n),e.push(r),i){if(c=r.length,l=c==n.length)for(;c--&&(l=s(n[c],r[c],t,e)););}else Kr(r,function(r,u,o){return Nr.call(o,u)?(c++,!(l=Nr.call(n,u)&&s(n[u],r,t,e))&&er):void 0
}),l&&Kr(n,function(n,r,t){return Nr.call(t,r)?!(l=-1<--c)&&er:void 0});return t.pop(),e.pop(),l}function g(n,r,t){for(var e=-1,u=m(),o=n?n.length:0,i=[],f=t?[]:i;++e<o;){var a=n[e],l=t?t(a,e,n):a;(r?!e||f[f.length-1]!==l:0>u(f,l))&&(t&&f.push(l),i.push(a))}return i}function h(n){return function(r,t,e){var u={};t=X(t,e,3),e=-1;var o=r?r.length:0;if(typeof o=="number")for(;++e<o;){var i=r[e];n(u,i,t(i,e,r),r)}else Lr(r,function(r,e,o){n(u,r,t(r,e,o),o)});return u}}function v(n,r,t,e,u,o){var f=16&r,a=32&r;
if(!(2&r||A(n)))throw new TypeError;return f&&!t.length&&(r&=-17,t=false),a&&!e.length&&(r&=-33,e=false),(1==r||17===r?i:l)([n,r,t,e,u,o])}function y(n){return Vr[n]}function m(){var r=(r=u.indexOf)===G?n:r;return r}function _(n){return typeof n=="function"&&Ar.test(n)}function d(n){return Gr[n]}function b(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Er.call(n)==fr||false}function w(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)n[u]=e[u]}return n
}function j(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)"undefined"==typeof n[u]&&(n[u]=e[u])}return n}function x(n){var r=[];return Kr(n,function(n,t){A(n)&&r.push(t)}),r.sort()}function T(n){for(var r=-1,t=Ur(n),e=t.length,u={};++r<e;){var o=t[r];u[n[o]]=o}return u}function E(n){if(!n)return true;if(Cr(n)||N(n))return!n.length;for(var r in n)if(Nr.call(n,r))return false;return true}function A(n){return typeof n=="function"}function O(n){return!(!n||!vr[typeof n])
}function S(n){return typeof n=="number"||n&&typeof n=="object"&&Er.call(n)==pr||false}function N(n){return typeof n=="string"||n&&typeof n=="object"&&Er.call(n)==hr||false}function R(n){for(var r=-1,t=Ur(n),e=t.length,u=Array(e);++r<e;)u[r]=n[t[r]];return u}function k(n,r){var t=m(),e=n?n.length:0,u=false;return e&&typeof e=="number"?u=-1<t(n,r):Lr(n,function(n){return(u=n===r)&&er}),u}function B(n,r,t){var e=true;r=X(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&(e=!!r(n[t],t,n)););else Lr(n,function(n,t,u){return!(e=!!r(n,t,u))&&er
});return e}function F(n,r,t){var e=[];r=X(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u;){var o=n[t];r(o,t,n)&&e.push(o)}else Lr(n,function(n,t,u){r(n,t,u)&&e.push(n)});return e}function q(n,r,t){r=X(r,t,3),t=-1;var e=n?n.length:0;if(typeof e!="number"){var u;return Lr(n,function(n,t,e){return r(n,t,e)?(u=n,er):void 0}),u}for(;++t<e;){var o=n[t];if(r(o,t,n))return o}}function D(n,r,t){var e=-1,u=n?n.length:0;if(r=r&&typeof t=="undefined"?r:a(r,t,3),typeof u=="number")for(;++e<u&&r(n[e],e,n)!==er;);else Lr(n,r)
}function I(n,r){var t=n?n.length:0;if(typeof t=="number")for(;t--&&false!==r(n[t],t,n););else{var e=Ur(n),t=e.length;Lr(n,function(n,u,o){return u=e?e[--t]:--t,false===r(o[u],u,o)&&er})}}function M(n,r,t){var e=-1,u=n?n.length:0;if(r=X(r,t,3),typeof u=="number")for(var o=Array(u);++e<u;)o[e]=r(n[e],e,n);else o=[],Lr(n,function(n,t,u){o[++e]=r(n,t,u)});return o}function $(n,r,t){var e=-1/0,u=e;typeof r!="function"&&t&&t[r]===n&&(r=null);var o=-1,i=n?n.length:0;if(null==r&&typeof i=="number")for(;++o<i;)t=n[o],t>u&&(u=t);
else r=X(r,t,3),D(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function W(n,r,t,e){if(!n)return t;var u=3>arguments.length;r=X(r,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(t=n[++o]);++o<i;)t=r(t,n[o],o,n);else Lr(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)});return t}function z(n,r,t,e){var u=3>arguments.length;return r=X(r,e,4),I(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)}),t}function C(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return D(n,function(n){var t;t=++r,t=0+Sr(Wr()*(t-0+1)),e[r]=e[t],e[t]=n
}),e}function P(n,r,t){var e;r=X(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&!(e=r(n[t],t,n)););else Lr(n,function(n,t,u){return(e=r(n,t,u))&&er});return!!e}function U(n,r,t){return t&&E(r)?rr:(t?q:F)(n,r)}function V(n,r,t){var u=0,o=n?n.length:0;if(typeof r!="number"&&null!=r){var i=-1;for(r=X(r,t,3);++i<o&&r(n[i],i,n);)u++}else if(u=r,null==u||t)return n?n[0]:rr;return e(n,0,$r(Mr(0,u),o))}function G(r,t,e){if(typeof e=="number"){var u=r?r.length:0;e=0>e?Mr(0,u+e):e||0}else if(e)return e=J(r,t),r[e]===t?e:-1;
return n(r,t,e)}function H(n,r,t){if(typeof r!="number"&&null!=r){var u=0,o=-1,i=n?n.length:0;for(r=X(r,t,3);++o<i&&r(n[o],o,n);)u++}else u=null==r||t?1:Mr(0,r);return e(n,u)}function J(n,r,t,e){var u=0,o=n?n.length:u;for(t=t?X(t,e,1):Y,r=t(r);u<o;)e=u+o>>>1,t(n[e])<r?u=e+1:o=e;return u}function K(n,r,t,e){return typeof r!="boolean"&&null!=r&&(e=t,t=typeof r!="function"&&e&&e[r]===n?null:r,r=false),null!=t&&(t=X(t,e,3)),g(n,r,t)}function L(n,r){return 2<arguments.length?v(n,17,e(arguments,2),null,r):v(n,1,null,null,r)
}function Q(n,r,t){var e,u,o,i,f,a,l,c=0,p=false,s=true;if(!A(n))throw new TypeError;if(r=Mr(0,r)||0,true===t)var g=true,s=false;else O(t)&&(g=t.leading,p="maxWait"in t&&(Mr(r,t.maxWait)||0),s="trailing"in t?t.trailing:s);var h=function(){var t=r-(nt()-i);0<t?a=setTimeout(h,t):(u&&clearTimeout(u),t=l,u=a=l=rr,t&&(c=nt(),o=n.apply(f,e),a||u||(e=f=null)))},v=function(){a&&clearTimeout(a),u=a=l=rr,(s||p!==r)&&(c=nt(),o=n.apply(f,e),a||u||(e=f=null))};return function(){if(e=arguments,i=nt(),f=this,l=s&&(a||!g),false===p)var t=g&&!a;
else{u||g||(c=i);var y=p-(i-c),m=0>=y;m?(u&&(u=clearTimeout(u)),c=i,o=n.apply(f,e)):u||(u=setTimeout(v,y))}return m&&a?a=clearTimeout(a):a||r===p||(a=setTimeout(h,r)),t&&(m=true,o=n.apply(f,e)),!m||a||u||(e=f=null),o}}function X(n,r,t){var e=typeof n;if(null==n||"function"==e)return a(n,r,t);if("object"!=e)return nr(n);var u=Ur(n);return function(r){for(var t=u.length,e=false;t--&&(e=r[u[t]]===n[u[t]]););return e}}function Y(n){return n}function Z(n){D(x(n),function(r){var t=u[r]=n[r];u.prototype[r]=function(){var n=[this.__wrapped__];
return Rr.apply(n,arguments),n=t.apply(u,n),this.__chain__?new o(n,true):n}})}function nr(n){return function(r){return r[n]}}var rr,tr=0,er={},ur=+new Date+"",or=/($^)/,ir=/['\n\r\t\u2028\u2029\\]/g,fr="[object Arguments]",ar="[object Array]",lr="[object Boolean]",cr="[object Date]",pr="[object Number]",sr="[object Object]",gr="[object RegExp]",hr="[object String]",vr={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},yr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},mr=vr[typeof window]&&window||this,_r=vr[typeof exports]&&exports&&!exports.nodeType&&exports,dr=vr[typeof module]&&module&&!module.nodeType&&module,br=dr&&dr.exports===_r&&_r,wr=vr[typeof global]&&global;
!wr||wr.global!==wr&&wr.window!==wr||(mr=wr);var jr=[],xr=Object.prototype,Tr=mr._,Er=xr.toString,Ar=RegExp("^"+(Er+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Or=Math.ceil,Sr=Math.floor,Nr=xr.hasOwnProperty,Rr=jr.push,kr=xr.propertyIsEnumerable,Br=_(Br=Object.create)&&Br,Fr=_(Fr=Array.isArray)&&Fr,qr=mr.isFinite,Dr=mr.isNaN,Ir=_(Ir=Object.keys)&&Ir,Mr=Math.max,$r=Math.min,Wr=Math.random;o.prototype=u.prototype;var zr={};!function(){var n={0:1,length:1};zr.spliceObjects=(jr.splice.call(n,0,1),!n[0])
}(1),u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Br||(f=function(){function n(){}return function(r){if(O(r)){n.prototype=r;var t=new n;n.prototype=null}return t||mr.Object()}}()),b(arguments)||(b=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Nr.call(n,"callee")&&!kr.call(n,"callee")||false});var Cr=Fr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Er.call(n)==ar||false},Pr=function(n){var r,t=[];
if(!n||!vr[typeof n])return t;for(r in n)Nr.call(n,r)&&t.push(r);return t},Ur=Ir?function(n){return O(n)?Ir(n):[]}:Pr,Vr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},Gr=T(Vr),Hr=RegExp("("+Ur(Gr).join("|")+")","g"),Jr=RegExp("["+Ur(Vr).join("")+"]","g"),Kr=function(n,r){var t;if(!n||!vr[typeof n])return n;for(t in n)if(r(n[t],t,n)===er)break;return n},Lr=function(n,r){var t;if(!n||!vr[typeof n])return n;for(t in n)if(Nr.call(n,t)&&r(n[t],t,n)===er)break;return n};A(/x/)&&(A=function(n){return typeof n=="function"&&"[object Function]"==Er.call(n)
});var Qr=h(function(n,r,t){Nr.call(n,t)?n[t]++:n[t]=1}),Xr=h(function(n,r,t){(Nr.call(n,t)?n[t]:n[t]=[]).push(r)}),Yr=h(function(n,r,t){n[t]=r}),Zr=M,nt=_(nt=Date.now)&&nt||function(){return(new Date).getTime()};u.after=function(n,r){if(!A(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0}},u.bind=L,u.bindAll=function(n){for(var r=1<arguments.length?p(arguments,true,false,1):x(n),t=-1,e=r.length;++t<e;){var u=r[t];n[u]=v(n[u],1,null,null,n)}return n},u.chain=function(n){return n=new o(n),n.__chain__=true,n
},u.compact=function(n){for(var r=-1,t=n?n.length:0,e=[];++r<t;){var u=n[r];u&&e.push(u)}return e},u.compose=function(){for(var n=arguments,r=n.length;r--;)if(!A(n[r]))throw new TypeError;return function(){for(var r=arguments,t=n.length;t--;)r=[n[t].apply(this,r)];return r[0]}},u.countBy=Qr,u.debounce=Q,u.defaults=j,u.defer=function(n){if(!A(n))throw new TypeError;var r=e(arguments,1);return setTimeout(function(){n.apply(rr,r)},1)},u.delay=function(n,r){if(!A(n))throw new TypeError;var t=e(arguments,2);
return setTimeout(function(){n.apply(rr,t)},r)},u.difference=function(n){return c(n,p(arguments,true,true,1))},u.filter=F,u.flatten=function(n,r){return p(n,r)},u.forEach=D,u.functions=x,u.groupBy=Xr,u.indexBy=Yr,u.initial=function(n,r,t){var u=0,o=n?n.length:0;if(typeof r!="number"&&null!=r){var i=o;for(r=X(r,t,3);i--&&r(n[i],i,n);)u++}else u=null==r||t?1:r||u;return e(n,0,$r(Mr(0,o-u),o))},u.intersection=function(){for(var n=[],r=-1,t=arguments.length;++r<t;){var e=arguments[r];(Cr(e)||b(e))&&n.push(e)
}var u=n[0],o=-1,i=m(),f=u?u.length:0,a=[];n:for(;++o<f;)if(e=u[o],0>i(a,e)){for(r=t;--r;)if(0>i(n[r],e))continue n;a.push(e)}return a},u.invert=T,u.invoke=function(n,r){var t=e(arguments,2),u=-1,o=typeof r=="function",i=n?n.length:0,f=Array(typeof i=="number"?i:0);return D(n,function(n){f[++u]=(o?r:n[r]).apply(n,t)}),f},u.keys=Ur,u.map=M,u.max=$,u.memoize=function(n,r){var t={};return function(){var e=r?r.apply(this,arguments):ur+arguments[0];return Nr.call(t,e)?t[e]:t[e]=n.apply(this,arguments)
}},u.min=function(n,r,t){var e=1/0,u=e;typeof r!="function"&&t&&t[r]===n&&(r=null);var o=-1,i=n?n.length:0;if(null==r&&typeof i=="number")for(;++o<i;)t=n[o],t<u&&(u=t);else r=X(r,t,3),D(n,function(n,t,o){t=r(n,t,o),t<e&&(e=t,u=n)});return u},u.omit=function(n){var r=[];Kr(n,function(n,t){r.push(t)});for(var r=c(r,p(arguments,true,false,1)),t=-1,e=r.length,u={};++t<e;){var o=r[t];u[o]=n[o]}return u},u.once=function(n){var r,t;if(!A(n))throw new TypeError;return function(){return r?t:(r=true,t=n.apply(this,arguments),n=null,t)
}},u.pairs=function(n){for(var r=-1,t=Ur(n),e=t.length,u=Array(e);++r<e;){var o=t[r];u[r]=[o,n[o]]}return u},u.partial=function(n){return v(n,16,e(arguments,1))},u.pick=function(n){for(var r=-1,t=p(arguments,true,false,1),e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u},u.pluck=Zr,u.range=function(n,r,t){n=+n||0,t=+t||1,null==r&&(r=n,n=0);var e=-1;r=Mr(0,Or((r-n)/t));for(var u=Array(r);++e<r;)u[e]=n,n+=t;return u},u.reject=function(n,r,t){return r=X(r,t,3),F(n,function(n,t,e){return!r(n,t,e)
})},u.rest=H,u.shuffle=C,u.sortBy=function(n,t,e){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);for(t=X(t,e,3),D(n,function(n,r,e){i[++u]={m:[t(n,r,e)],n:u,o:n}}),o=i.length,i.sort(r);o--;)i[o]=i[o].o;return i},u.tap=function(n,r){return r(n),n},u.throttle=function(n,r,t){var e=true,u=true;if(!A(n))throw new TypeError;return false===t?e=false:O(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),t={},t.leading=e,t.maxWait=r,t.trailing=u,Q(n,r,t)},u.times=function(n,r,t){n=-1<(n=+n)?n:0;
var e=-1,u=Array(n);for(r=a(r,t,1);++e<n;)u[e]=r(e);return u},u.toArray=function(n){return Cr(n)?e(n):n&&typeof n.length=="number"?M(n):R(n)},u.union=function(){return g(p(arguments,true,true))},u.uniq=K,u.values=R,u.where=U,u.without=function(n){return c(n,e(arguments,1))},u.wrap=function(n,r){return v(r,16,[n])},u.zip=function(){for(var n=-1,r=$(Zr(arguments,"length")),t=Array(0>r?0:r);++n<r;)t[n]=Zr(arguments,n);return t},u.collect=M,u.drop=H,u.each=D,u.extend=w,u.methods=x,u.object=function(n,r){var t=-1,e=n?n.length:0,u={};
for(r||!e||Cr(n[0])||(r=[]);++t<e;){var o=n[t];r?u[o]=r[t]:o&&(u[o[0]]=o[1])}return u},u.select=F,u.tail=H,u.unique=K,u.clone=function(n){return O(n)?Cr(n)?e(n):w({},n):n},u.contains=k,u.escape=function(n){return null==n?"":(n+"").replace(Jr,y)},u.every=B,u.find=q,u.has=function(n,r){return n?Nr.call(n,r):false},u.identity=Y,u.indexOf=G,u.isArguments=b,u.isArray=Cr,u.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&Er.call(n)==lr||false},u.isDate=function(n){return n&&typeof n=="object"&&Er.call(n)==cr||false
},u.isElement=function(n){return n&&1===n.nodeType||false},u.isEmpty=E,u.isEqual=function(n,r){return s(n,r)},u.isFinite=function(n){return qr(n)&&!Dr(parseFloat(n))},u.isFunction=A,u.isNaN=function(n){return S(n)&&n!=+n},u.isNull=function(n){return null===n},u.isNumber=S,u.isObject=O,u.isRegExp=function(n){return n&&vr[typeof n]&&Er.call(n)==gr||false},u.isString=N,u.isUndefined=function(n){return typeof n=="undefined"},u.lastIndexOf=function(n,r,t){var e=n?n.length:0;for(typeof t=="number"&&(e=(0>t?Mr(0,e+t):$r(t,e-1))+1);e--;)if(n[e]===r)return e;
return-1},u.mixin=Z,u.noConflict=function(){return mr._=Tr,this},u.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Sr(Wr()*(r-n+1))},u.reduce=W,u.reduceRight=z,u.result=function(n,r){if(n){var t=n[r];return A(t)?n[r]():t}},u.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:Ur(n).length},u.some=P,u.sortedIndex=J,u.template=function(n,r,e){var o=u,i=o.templateSettings;n=(n||"")+"",e=j({},e,i);var f=0,a="__p+='",i=e.variable;n.replace(RegExp((e.escape||or).source+"|"+(e.interpolate||or).source+"|"+(e.evaluate||or).source+"|$","g"),function(r,e,u,o,i){return a+=n.slice(f,i).replace(ir,t),e&&(a+="'+_.escape("+e+")+'"),o&&(a+="';"+o+";\n__p+='"),u&&(a+="'+((__t=("+u+"))==null?'':__t)+'"),f=i+r.length,r
}),a+="';",i||(i="obj",a="with("+i+"||{}){"+a+"}"),a="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}";try{var l=Function("_","return "+a)(o)}catch(c){throw c.source=a,c}return r?l(r):(l.source=a,l)},u.unescape=function(n){return null==n?"":(n+"").replace(Hr,d)},u.uniqueId=function(n){var r=++tr+"";return n?n+r:r},u.all=B,u.any=P,u.detect=q,u.findWhere=function(n,r){return U(n,r,true)},u.foldl=W,u.foldr=z,u.include=k,u.inject=W,u.first=V,u.last=function(n,r,t){var u=0,o=n?n.length:0;
if(typeof r!="number"&&null!=r){var i=o;for(r=X(r,t,3);i--&&r(n[i],i,n);)u++}else if(u=r,null==u||t)return n?n[o-1]:rr;return e(n,Mr(0,o-u))},u.sample=function(n,r,t){return n&&typeof n.length!="number"&&(n=R(n)),null==r||t?n?n[0+Sr(Wr()*(n.length-1-0+1))]:rr:(n=C(n),n.length=$r(Mr(0,r),n.length),n)},u.take=V,u.head=V,Z(u),u.VERSION="2.4.1",u.prototype.chain=function(){return this.__chain__=true,this},u.prototype.value=function(){return this.__wrapped__},D("pop push reverse shift sort splice unshift".split(" "),function(n){var r=jr[n];
u.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),zr.spliceObjects||0!==n.length||delete n[0],this}}),D(["concat","join","slice"],function(n){var r=jr[n];u.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new o(n),n.__chain__=true),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(mr._=u, define(function(){return u})):_r&&dr?br?(dr.exports=u)._=u:_r._=u:mr._=u}).call(this);

295
dist/mapping.fp.js vendored
View File

@@ -1,295 +0,0 @@
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["mapping"] = factory();
else
root["mapping"] = factory();
})(this, function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ exports: {},
/******/ id: moduleId,
/******/ loaded: false
/******/ };
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/ // Flag the module as loaded
/******/ module.loaded = true;
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/ // Load entry module and return exports
/******/ return __webpack_require__(0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ function(module, exports) {
/** Used to map aliases to their real names. */
exports.aliasToReal = {
'__': 'placeholder',
'all': 'some',
'allPass': 'overEvery',
'apply': 'spread',
'assoc': 'set',
'assocPath': 'set',
'compose': 'flowRight',
'contains': 'includes',
'dissoc': 'unset',
'dissocPath': 'unset',
'each': 'forEach',
'eachRight': 'forEachRight',
'equals': 'isEqual',
'extend': 'assignIn',
'extendWith': 'assignInWith',
'first': 'head',
'init': 'initial',
'mapObj': 'mapValues',
'omitAll': 'omit',
'nAry': 'ary',
'path': 'get',
'pathEq': 'matchesProperty',
'pathOr': 'getOr',
'pickAll': 'pick',
'pipe': 'flow',
'prop': 'get',
'propOf': 'propertyOf',
'propOr': 'getOr',
'somePass': 'overSome',
'unapply': 'rest',
'unnest': 'flatten',
'useWith': 'overArgs',
'whereEq': 'filter',
'zipObj': 'zipObject'
};
/** Used to map ary to method names. */
exports.aryMethod = {
'1': [
'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin',
'over', 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext',
'spread', 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words'
],
'2': [
'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindKey',
'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', 'every',
'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex',
'findLastKey', 'flatMap', 'flattenDepth', 'forEach', 'forEachRight', 'forIn',
'forInRight', 'forOwn', 'forOwnRight', 'get', 'groupBy', 'gt', 'gte', 'has',
'hasIn', 'includes', 'indexOf', 'intersection', 'invertBy', 'invoke', 'invokeMap',
'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map',
'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', 'merge', 'minBy', 'omit',
'omitBy', 'orderBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt',
'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile',
'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd',
'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', 'unset',
'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep'
],
'3': [
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith',
'isMatchWith', 'mergeWith', 'pullAllBy', 'reduce', 'reduceRight', 'replace',
'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy',
'unionWith', 'xorBy', 'xorWith', 'zipWith'
],
'4': [
'fill', 'setWith'
]
};
/** Used to map ary to rearg configs. */
exports.aryRearg = {
'2': [1, 0],
'3': [2, 0, 1],
'4': [3, 2, 0, 1]
};
/** Used to map method names to their iteratee ary. */
exports.iterateeAry = {
'assignWith': 2,
'assignInWith': 2,
'cloneDeepWith': 1,
'cloneWith': 1,
'dropRightWhile': 1,
'dropWhile': 1,
'every': 1,
'filter': 1,
'find': 1,
'findIndex': 1,
'findKey': 1,
'findLast': 1,
'findLastIndex': 1,
'findLastKey': 1,
'flatMap': 1,
'forEach': 1,
'forEachRight': 1,
'forIn': 1,
'forInRight': 1,
'forOwn': 1,
'forOwnRight': 1,
'isEqualWith': 2,
'isMatchWith': 2,
'map': 1,
'mapKeys': 1,
'mapValues': 1,
'partition': 1,
'reduce': 2,
'reduceRight': 2,
'reject': 1,
'remove': 1,
'some': 1,
'takeRightWhile': 1,
'takeWhile': 1,
'times': 1,
'transform': 2
};
/** Used to map method names to rearg configs. */
exports.methodRearg = {
'assignInWith': [1, 2, 0],
'assignWith': [1, 2, 0],
'getOr': [2, 1, 0],
'isMatchWith': [2, 1, 0],
'mergeWith': [1, 2, 0],
'pullAllBy': [2, 1, 0],
'setWith': [3, 1, 2, 0],
'sortedIndexBy': [2, 1, 0],
'sortedLastIndexBy': [2, 1, 0],
'zipWith': [1, 2, 0]
};
/** Used to map method names to spread configs. */
exports.methodSpread = {
'partial': 1,
'partialRight': 1
};
/** Used to identify methods which mutate arrays or objects. */
exports.mutate = {
'array': {
'fill': true,
'pull': true,
'pullAll': true,
'pullAllBy': true,
'pullAt': true,
'remove': true,
'reverse': true
},
'object': {
'assign': true,
'assignIn': true,
'assignInWith': true,
'assignWith': true,
'defaults': true,
'defaultsDeep': true,
'merge': true,
'mergeWith': true
},
'set': {
'set': true,
'setWith': true,
'unset': true
}
};
/** Used to track methods with placeholder support */
exports.placeholder = {
'bind': true,
'bindKey': true,
'curry': true,
'curryRight': true,
'partial': true,
'partialRight': true
};
/** Used to map real names to their aliases. */
exports.realToAlias = (function() {
var hasOwnProperty = Object.prototype.hasOwnProperty,
object = exports.aliasToReal,
result = {};
for (var key in object) {
var value = object[key];
if (hasOwnProperty.call(result, value)) {
result[value].push(key);
} else {
result[value] = [key];
}
}
return result;
}());
/** Used to map method names to other names. */
exports.remap = {
'curryN': 'curry',
'curryRightN': 'curryRight',
'getOr': 'get',
'trimChars': 'trim',
'trimCharsEnd': 'trimEnd',
'trimCharsStart': 'trimStart'
};
/** Used to track methods that skip `_.rearg`. */
exports.skipRearg = {
'add': true,
'assign': true,
'assignIn': true,
'concat': true,
'difference': true,
'gt': true,
'gte': true,
'lt': true,
'lte': true,
'matchesProperty': true,
'merge': true,
'partial': true,
'partialRight': true,
'random': true,
'range': true,
'rangeRight': true,
'subtract': true,
'zip': true,
'zipObject': true
};
/***/ }
/******/ ])
});
;

File diff suppressed because it is too large Load Diff

38
doc/parse.php Normal file
View File

@@ -0,0 +1,38 @@
<?php
// cleanup requested file path
$filePath = isset($_GET['f']) ? $_GET['f'] : 'lodash';
$filePath = preg_replace('#(\.*[\/])+#', '', $filePath);
$filePath .= preg_match('/\.[a-z]+$/', $filePath) ? '' : '.js';
// output filename
if (isset($_GET['o'])) {
$outputName = $_GET['o'];
} else if (isset($_SERVER['argv'][1])) {
$outputName = $_SERVER['argv'][1];
} else {
$outputName = basename($filePath);
}
/*--------------------------------------------------------------------------*/
require('../vendor/docdown/docdown.php');
// get package version
$version = json_decode(file_get_contents('../package.json'))->version;
// generate Markdown
$markdown = docdown(array(
'path' => '../' . $filePath,
'title' => '<a href="http://lodash.com/">Lo-Dash</a> <span>v' . $version . '</span>',
'toc' => 'categories',
'url' => 'https://github.com/lodash/lodash/blob/' . $version . '/lodash.js'
));
// save to a `.md` file
file_put_contents($outputName . '.md', $markdown);
// print
header('Content-Type: text/plain;charset=utf-8');
echo $markdown . PHP_EOL;
?>

View File

@@ -1,280 +0,0 @@
var mapping = require('./_mapping'),
mutateMap = mapping.mutate,
placeholder = {};
/**
* The base implementation of `convert` which accepts a `util` object of methods
* required to perform conversions.
*
* @param {Object} util The util object.
* @param {string} name The name of the function to wrap.
* @param {Function} func The function to wrap.
* @param {Object} [options] The options object.
* @param {boolean} [options.cap=true] Specify capping iteratee arguments.
* @param {boolean} [options.curry=true] Specify currying.
* @param {boolean} [options.fixed=true] Specify fixed arity.
* @param {boolean} [options.immutable=true] Specify immutable operations.
* @param {boolean} [options.rearg=true] Specify rearranging arguments.
* @returns {Function|Object} Returns the converted function or object.
*/
function baseConvert(util, name, func, options) {
var setPlaceholder,
isLib = typeof name == 'function',
isObj = name === Object(name);
if (isObj) {
options = func;
func = name;
name = undefined;
}
if (func == null) {
throw new TypeError;
}
options || (options = {});
var config = {
'cap': 'cap' in options ? options.cap : true,
'curry': 'curry' in options ? options.curry : true,
'fixed': 'fixed' in options ? options.fixed : true,
'immutable': 'immutable' in options ? options.immutable : true,
'rearg': 'rearg' in options ? options.rearg : true
};
var forceRearg = ('rearg' in options) && options.rearg;
var helpers = isLib ? func : {
'ary': util.ary,
'cloneDeep': util.cloneDeep,
'curry': util.curry,
'forEach': util.forEach,
'isArray': util.isArray,
'isFunction': util.isFunction,
'iteratee': util.iteratee,
'keys': util.keys,
'rearg': util.rearg,
'spread': util.spread
};
var ary = helpers.ary,
cloneDeep = helpers.cloneDeep,
curry = helpers.curry,
each = helpers.forEach,
isArray = helpers.isArray,
isFunction = helpers.isFunction,
keys = helpers.keys,
rearg = helpers.rearg,
spread = helpers.spread;
var aryMethodKeys = keys(mapping.aryMethod);
var baseAry = function(func, n) {
return n == 2
? function(a, b) { return func(a, b); }
: function(a) { return func(a); };
};
var cloneArray = function(array) {
var length = array ? array.length : 0,
result = Array(length);
while (length--) {
result[length] = array[length];
}
return result;
};
var createCloner = function(func) {
return function(object) {
return func({}, object);
};
};
var immutWrap = function(func, cloner) {
return function() {
var length = arguments.length;
if (!length) {
return result;
}
var args = Array(length);
while (length--) {
args[length] = arguments[length];
}
var result = args[0] = cloner(args[0]);
func.apply(undefined, args);
return result;
};
};
var iterateeAry = function(func, n) {
return overArg(func, function(func) {
return typeof func == 'function'
? baseAry(func, n)
: func;
});
};
var overArg = function(func, iteratee, retArg) {
return function() {
var length = arguments.length;
if (!length) {
return func();
}
var args = Array(length);
while (length--) {
args[length] = arguments[length];
}
var index = config.rearg ? 0 : (length - 1);
args[index] = iteratee(args[index]);
return func.apply(undefined, args);
};
};
var wrappers = {
'castArray': function(castArray) {
return function() {
var value = arguments[0];
return isArray(value)
? castArray(cloneArray(value))
: castArray.apply(undefined, arguments);
};
},
'iteratee': function(iteratee) {
return function() {
var func = arguments[0],
arity = arguments[1];
if (!config.cap) {
return iteratee(func, arity);
}
arity = arity > 2 ? (arity - 2) : 1;
func = iteratee(func);
var length = func.length;
return (length && length <= arity) ? func : baseAry(func, arity);
};
},
'mixin': function(mixin) {
return function(source) {
var func = this;
if (!isFunction(func)) {
return mixin(func, Object(source));
}
var methods = [],
methodNames = [];
each(keys(source), function(key) {
var value = source[key];
if (isFunction(value)) {
methodNames.push(key);
methods.push(func.prototype[key]);
}
});
mixin(func, Object(source));
each(methodNames, function(methodName, index) {
var method = methods[index];
if (isFunction(method)) {
func.prototype[methodName] = method;
} else {
delete func.prototype[methodName];
}
});
return func;
};
},
'runInContext': function(runInContext) {
return function(context) {
return baseConvert(util, runInContext(context), options);
};
}
};
var wrap = function(name, func) {
name = mapping.aliasToReal[name] || name;
var wrapper = wrappers[name];
if (wrapper) {
return wrapper(func);
}
var wrapped = func;
if (config.immutable) {
if (mutateMap.array[name]) {
wrapped = immutWrap(func, cloneArray);
}
else if (mutateMap.object[name]) {
wrapped = immutWrap(func, createCloner(func));
}
else if (mutateMap.set[name]) {
wrapped = immutWrap(func, cloneDeep);
}
}
var result;
each(aryMethodKeys, function(aryKey) {
each(mapping.aryMethod[aryKey], function(otherName) {
if (name == otherName) {
var aryN = !isLib && mapping.iterateeAry[name],
spreadStart = mapping.methodSpread[name];
result = wrapped;
if (config.fixed) {
result = spreadStart === undefined
? ary(result, aryKey)
: spread(result, spreadStart);
}
if (config.rearg && aryKey > 1 && (forceRearg || !mapping.skipRearg[name])) {
result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[aryKey]);
}
if (config.cap && aryN) {
result = iterateeAry(result, aryN);
}
if (config.curry && aryKey > 1) {
result = curry(result, aryKey);
}
return false;
}
});
return !result;
});
result || (result = wrapped);
if (mapping.placeholder[name]) {
setPlaceholder = true;
func.placeholder = result.placeholder = placeholder;
}
return result;
};
if (!isObj) {
return wrap(name, func);
}
var _ = func;
// Iterate over methods for the current ary cap.
var pairs = [];
each(aryMethodKeys, function(aryKey) {
each(mapping.aryMethod[aryKey], function(key) {
var func = _[mapping.remap[key] || key];
if (func) {
pairs.push([key, wrap(key, func)]);
}
});
});
// Assign to `_` leaving `_.prototype` unchanged to allow chaining.
each(pairs, function(pair) {
_[pair[0]] = pair[1];
});
if (setPlaceholder) {
_.placeholder = placeholder;
}
// Wrap the lodash method and its aliases.
each(keys(_), function(key) {
each(mapping.realToAlias[key] || [], function(alias) {
_[alias] = _[key];
});
});
return _;
}
module.exports = baseConvert;

View File

@@ -1,17 +0,0 @@
var baseConvert = require('./_baseConvert');
/**
* Converts `lodash` to an immutable auto-curried iteratee-first data-last version.
*
* @param {Function} lodash The lodash function.
* @param {Object} [options] The options object. See `baseConvert` for more details.
* @returns {Function} Returns the converted `lodash`.
*/
function browserConvert(lodash, options) {
return baseConvert(lodash, lodash, options);
}
if (typeof _ == 'function') {
_ = browserConvert(_.runInContext());
}
module.exports = browserConvert;

View File

@@ -1,233 +0,0 @@
/** Used to map aliases to their real names. */
exports.aliasToReal = {
'__': 'placeholder',
'all': 'some',
'allPass': 'overEvery',
'apply': 'spread',
'assoc': 'set',
'assocPath': 'set',
'compose': 'flowRight',
'contains': 'includes',
'dissoc': 'unset',
'dissocPath': 'unset',
'each': 'forEach',
'eachRight': 'forEachRight',
'equals': 'isEqual',
'extend': 'assignIn',
'extendWith': 'assignInWith',
'first': 'head',
'init': 'initial',
'mapObj': 'mapValues',
'omitAll': 'omit',
'nAry': 'ary',
'path': 'get',
'pathEq': 'matchesProperty',
'pathOr': 'getOr',
'pickAll': 'pick',
'pipe': 'flow',
'prop': 'get',
'propOf': 'propertyOf',
'propOr': 'getOr',
'somePass': 'overSome',
'unapply': 'rest',
'unnest': 'flatten',
'useWith': 'overArgs',
'whereEq': 'filter',
'zipObj': 'zipObject'
};
/** Used to map ary to method names. */
exports.aryMethod = {
'1': [
'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin',
'over', 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext',
'spread', 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words'
],
'2': [
'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindKey',
'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', 'every',
'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex',
'findLastKey', 'flatMap', 'flattenDepth', 'forEach', 'forEachRight', 'forIn',
'forInRight', 'forOwn', 'forOwnRight', 'get', 'groupBy', 'gt', 'gte', 'has',
'hasIn', 'includes', 'indexOf', 'intersection', 'invertBy', 'invoke', 'invokeMap',
'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map',
'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', 'merge', 'minBy', 'omit',
'omitBy', 'orderBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt',
'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile',
'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd',
'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', 'unset',
'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep'
],
'3': [
'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith',
'isMatchWith', 'mergeWith', 'pullAllBy', 'reduce', 'reduceRight', 'replace',
'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy',
'unionWith', 'xorBy', 'xorWith', 'zipWith'
],
'4': [
'fill', 'setWith'
]
};
/** Used to map ary to rearg configs. */
exports.aryRearg = {
'2': [1, 0],
'3': [2, 0, 1],
'4': [3, 2, 0, 1]
};
/** Used to map method names to their iteratee ary. */
exports.iterateeAry = {
'assignWith': 2,
'assignInWith': 2,
'cloneDeepWith': 1,
'cloneWith': 1,
'dropRightWhile': 1,
'dropWhile': 1,
'every': 1,
'filter': 1,
'find': 1,
'findIndex': 1,
'findKey': 1,
'findLast': 1,
'findLastIndex': 1,
'findLastKey': 1,
'flatMap': 1,
'forEach': 1,
'forEachRight': 1,
'forIn': 1,
'forInRight': 1,
'forOwn': 1,
'forOwnRight': 1,
'isEqualWith': 2,
'isMatchWith': 2,
'map': 1,
'mapKeys': 1,
'mapValues': 1,
'partition': 1,
'reduce': 2,
'reduceRight': 2,
'reject': 1,
'remove': 1,
'some': 1,
'takeRightWhile': 1,
'takeWhile': 1,
'times': 1,
'transform': 2
};
/** Used to map method names to rearg configs. */
exports.methodRearg = {
'assignInWith': [1, 2, 0],
'assignWith': [1, 2, 0],
'getOr': [2, 1, 0],
'isMatchWith': [2, 1, 0],
'mergeWith': [1, 2, 0],
'pullAllBy': [2, 1, 0],
'setWith': [3, 1, 2, 0],
'sortedIndexBy': [2, 1, 0],
'sortedLastIndexBy': [2, 1, 0],
'zipWith': [1, 2, 0]
};
/** Used to map method names to spread configs. */
exports.methodSpread = {
'partial': 1,
'partialRight': 1
};
/** Used to identify methods which mutate arrays or objects. */
exports.mutate = {
'array': {
'fill': true,
'pull': true,
'pullAll': true,
'pullAllBy': true,
'pullAt': true,
'remove': true,
'reverse': true
},
'object': {
'assign': true,
'assignIn': true,
'assignInWith': true,
'assignWith': true,
'defaults': true,
'defaultsDeep': true,
'merge': true,
'mergeWith': true
},
'set': {
'set': true,
'setWith': true,
'unset': true
}
};
/** Used to track methods with placeholder support */
exports.placeholder = {
'bind': true,
'bindKey': true,
'curry': true,
'curryRight': true,
'partial': true,
'partialRight': true
};
/** Used to map real names to their aliases. */
exports.realToAlias = (function() {
var hasOwnProperty = Object.prototype.hasOwnProperty,
object = exports.aliasToReal,
result = {};
for (var key in object) {
var value = object[key];
if (hasOwnProperty.call(result, value)) {
result[value].push(key);
} else {
result[value] = [key];
}
}
return result;
}());
/** Used to map method names to other names. */
exports.remap = {
'curryN': 'curry',
'curryRightN': 'curryRight',
'getOr': 'get',
'trimChars': 'trim',
'trimCharsEnd': 'trimEnd',
'trimCharsStart': 'trimStart'
};
/** Used to track methods that skip `_.rearg`. */
exports.skipRearg = {
'add': true,
'assign': true,
'assignIn': true,
'concat': true,
'difference': true,
'gt': true,
'gte': true,
'lt': true,
'lte': true,
'matchesProperty': true,
'merge': true,
'partial': true,
'partialRight': true,
'random': true,
'range': true,
'rangeRight': true,
'subtract': true,
'zip': true,
'zipObject': true
};

1
index.js Executable file
View File

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

View File

@@ -1,26 +0,0 @@
'use strict';
var _ = require('lodash'),
fs = require('fs-extra'),
uglify = require('uglify-js');
var uglifyOptions = require('./uglify.options.js');
/*----------------------------------------------------------------------------*/
function minify(inpath, outpath, callback, options) {
if (_.isFunction(outpath)) {
if (_.isObject(callback)) {
options = callback;
}
callback = outpath;
outpath = undefined;
}
if (!outpath) {
outpath = inpath.replace(/(?=\.js$)/, '.min');
}
var output = uglify.minify(inpath, _.defaults(options || {}, uglifyOptions));
fs.writeFile(outpath, output.code, 'utf-8', callback);
}
module.exports = minify;

View File

@@ -1,16 +0,0 @@
module.exports = {
'compress': {
'pure_getters': true,
'unsafe': true,
'unsafe_comps': true,
'warnings': false
},
'mangle': {
'except': ['define']
},
'output': {
'ascii_only': true,
'comments': /^!|@cc_on|@license|@preserve/i,
'max_line_len': 500
}
};

View File

@@ -1,19 +0,0 @@
'use strict';
var _ = require('lodash'),
fs = require('fs-extra'),
glob = require('glob'),
path = require('path');
/*----------------------------------------------------------------------------*/
function globTemplate(pattern) {
return _.transform(glob.sync(pattern), function(result, filePath) {
var key = path.basename(filePath, path.extname(filePath));
result[key] = _.template(fs.readFileSync(filePath, 'utf8'));
}, {});
}
module.exports = {
'globTemplate': globTemplate
};

View File

@@ -1,55 +0,0 @@
'use strict';
var _ = require('lodash'),
async = require('async'),
path = require('path'),
webpack = require('webpack');
var minify = require('../common/minify.js');
var basePath = path.join(__dirname, '..', '..'),
distPath = path.join(basePath, 'dist'),
fpPath = path.join(basePath, 'fp'),
filename = 'lodash.fp.js';
var fpConfig = {
'entry': path.join(fpPath, '_convertBrowser.js'),
'output': {
'path': distPath,
'filename': filename,
'library': 'fp',
'libraryTarget': 'umd'
},
'plugins': [
new webpack.optimize.OccurenceOrderPlugin,
new webpack.optimize.DedupePlugin
]
};
var mappingConfig = {
'entry': path.join(fpPath, '_mapping.js'),
'output': {
'path': distPath,
'filename': 'mapping.fp.js',
'library': 'mapping',
'libraryTarget': 'umd'
}
};
/*----------------------------------------------------------------------------*/
function onComplete(error) {
if (error) {
throw error;
}
}
function build() {
async.series([
_.partial(webpack, mappingConfig),
_.partial(webpack, fpConfig),
_.partial(minify, path.join(distPath, filename))
], onComplete);
}
build();

View File

@@ -1,62 +0,0 @@
'use strict';
var _ = require('lodash'),
fs = require('fs-extra'),
path = require('path'),
util = require('../common/util');
var mapping = require('../../fp/_mapping'),
templatePath = path.join(__dirname, 'template/doc'),
template = util.globTemplate(path.join(templatePath, '*.jst'));
var argNames = ['a', 'b', 'c', 'd'];
var templateData = {
'mapping': mapping,
'toArgOrder': toArgOrder,
'toFuncList': toFuncList
};
function toArgOrder(array) {
return '`(' + _.map(array, function(value) {
return argNames[value];
}).join(', ') + ')`';
}
function toFuncList(array) {
var chunks = _.chunk(array.slice().sort(), 5),
lastChunk = _.last(chunks),
last = lastChunk ? lastChunk.pop() : undefined;
chunks = _.reject(chunks, _.isEmpty);
lastChunk = _.last(chunks);
var result = '`' + _.map(chunks, function(chunk) {
return chunk.join('`, `') + '`';
}).join(',\n`');
if (last == null) {
return result;
}
if (_.size(chunks) > 1 || _.size(lastChunk) > 1) {
result += ',';
}
result += ' &';
result += _.size(lastChunk) < 5 ? ' ' : '\n';
return result + '`' + last + '`';
}
/*----------------------------------------------------------------------------*/
function onComplete(error) {
if (error) {
throw error;
}
}
function build(target) {
target = path.resolve(target);
fs.writeFile(target, template.wiki(templateData), onComplete);
}
build(_.last(process.argv));

View File

@@ -1,126 +0,0 @@
'use strict';
var _ = require('lodash'),
async = require('async'),
fs = require('fs-extra'),
glob = require('glob'),
path = require('path'),
util = require('../common/util');
var mapping = require('../../fp/_mapping'),
templatePath = path.join(__dirname, 'template/modules'),
template = util.globTemplate(path.join(templatePath, '*.jst'));
var aryMethods = _.union(
mapping.aryMethod[1],
mapping.aryMethod[2],
mapping.aryMethod[3],
mapping.aryMethod[4]
);
var categories = [
'array',
'collection',
'date',
'function',
'lang',
'math',
'number',
'object',
'seq',
'string',
'util'
];
var ignored = [
'_*.js',
'core.js',
'fp.js',
'index.js',
'lodash.js'
];
function copyFile(srcPath, destPath) {
return _.partial(fs.copy, srcPath, destPath);
}
function isAlias(funcName) {
return _.has(mapping.aliasToReal, funcName);
}
function isCategory(funcName) {
return _.includes(categories, funcName);
}
function isThru(funcName) {
return !_.includes(aryMethods, funcName);
}
function getTemplate(moduleName) {
var data = {
'name': _.result(mapping.aliasToReal, moduleName, moduleName),
'mapping': mapping
};
if (isAlias(moduleName)) {
return template.alias(data);
}
if (isCategory(moduleName)) {
return template.category(data);
}
if (isThru(moduleName)) {
return template.thru(data);
}
return template.module(data);
}
function writeFile(filePath, data) {
return _.partial(fs.writeFile, filePath, data);
}
/*----------------------------------------------------------------------------*/
function onComplete(error) {
if (error) {
throw error;
}
}
function build(target) {
target = path.resolve(target);
var fpPath = path.join(target, 'fp');
// Glob existing lodash module paths.
var modulePaths = glob.sync(path.join(target, '*.js'), {
'nodir': true,
'ignore': ignored.map(function(filename) {
return path.join(target, filename);
})
});
// Add FP alias and remapped module paths.
_.each([mapping.aliasToReal, mapping.remap], function(data) {
_.forOwn(data, function(realName, alias) {
var modulePath = path.join(target, alias + '.js');
if (!_.startsWith(alias, '_') &&
!_.includes(modulePaths, modulePath)) {
modulePaths.push(modulePath);
}
});
});
var actions = modulePaths.map(function(modulePath) {
var moduleName = path.basename(modulePath, '.js');
return writeFile(path.join(fpPath, moduleName + '.js'), getTemplate(moduleName));
});
actions.unshift(copyFile(path.join(__dirname, '../../fp'), fpPath));
actions.push(writeFile(path.join(target, 'fp.js'), template.fp()));
actions.push(writeFile(path.join(fpPath, 'convert.js'), template.convert()));
actions.push(writeFile(path.join(fpPath, '_util.js'), template._util()));
async.series(actions, onComplete);
}
build(_.last(process.argv));

View File

@@ -1,127 +0,0 @@
## lodash/fp
The `lodash/fp` module is an instance of `lodash` with its methods wrapped to
produce immutable auto-curried iteratee-first data-last methods.
## Installation
In a browser:
```html
<script src='path/to/lodash.js'></script>
<script src='path/to/lodash.fp.js'></script>
```
In Node.js:
```js
// Load the fp build.
var _ = require('lodash/fp');
// Load a method category.
var object = require('lodash/fp/object');
// Load a single method for smaller builds with browserify/rollup/webpack.
var extend = require('lodash/fp/extend');
```
## Convert
This module is used to convert Lodash methods to their `fp` counterparts.
```js
var convert = require('lodash/fp/convert');
// Convert by name.
var assign = convert('assign', require('lodash.assign'));
// Convert by object.
var fp = convert({
'assign': require('lodash.assign'),
'chunk': require('lodash.chunk')
});
// Convert by `lodash` instance.
var fp = convert(lodash.runInContext());
```
Its even customizable so you can create the `fp` function thats right for you.
```js
// Every option is `true` by default.
var filter = convert('filter', _.filter, {
// Specify capping iteratee arguments.
'cap': true,
// Specify currying.
'curry': true,
// Specify fixed arity.
'fixed': true,
// Specify immutable operations.
'immutable': true,
// Specify rearranging arguments.
'rearg': true
});
// Specify `cap` of `false` to create a function that doesnt cap iteratee arguments.
var filter = convert('filter', _.filter, { 'cap': false });
filter(function(value, index) {
return index % 2 == 0;
})(['a', 'b', 'c']);
// => ['a', 'c']
```
## Mapping
Immutable auto-curried iteratee-first data-last methods sound great, but whats
that really mean for each method? Below is a breakdown of the mapping used to
convert each method.
#### Capped Iteratee Arguments
Methods that cap iteratees to one argument:<br>
<%= toFuncList(_.keys(_.pick(mapping.iterateeAry, _.partial(_.eq, _, 1)))) %>
Methods that cap iteratees to two arguments:<br>
<%= toFuncList(_.keys(_.pick(mapping.iterateeAry, _.partial(_.eq, _, 2)))) %>
#### Fixed Arity
Methods with a fixed arity of one:<br>
<%= toFuncList(mapping.aryMethod[1]) %>
Methods with a fixed arity of two:<br>
<%= toFuncList(mapping.aryMethod[2]) %>
Methods with a fixed arity of three:<br>
<%= toFuncList(mapping.aryMethod[3]) %>
Methods with a fixed arity of four:<br>
<%= toFuncList(mapping.aryMethod[4]) %>
#### Rearranged Arguments
Methods with a fixed arity of two have an argument order of:<br>
<%= toArgOrder(mapping.aryRearg[2]) %>
Methods with a fixed arity of three have an argument order of:<br>
<%= toArgOrder(mapping.aryRearg[3]) %>
Methods with a fixed arity of four have an argument order of:<br>
<%= toArgOrder(mapping.aryRearg[4]) %>
Methods with custom argument orders:<br>
<%= _.map(mapping.methodRearg, function(orders, methodName) {
return ' * `_.' + methodName + '` has an order of ' + toArgOrder(orders);
}).join('\n') %>
Methods with unchanged argument orders:<br>
<%= toFuncList(_.keys(mapping.skipRearg)) %>
#### New Methods
Methods created to accommodate Lodashs variadic methods:<br>
<%= toFuncList(_.keys(mapping.remap)) %>
#### Aliases
There are <%= _.size(mapping.aliasToReal) %> method aliases:<br>
<%= _.map(mapping.aliasToReal, function(realName, alias) {
return ' * Added `_.' + alias + '` as an alias of `_.' + realName + '`';
}).join('\n') %>

View File

@@ -1,12 +0,0 @@
module.exports = {
'ary': require('../ary'),
'cloneDeep': require('../cloneDeep'),
'curry': require('../curry'),
'forEach': require('../_arrayEach'),
'isArray': require('../isArray'),
'isFunction': require('../isFunction'),
'iteratee': require('../iteratee'),
'keys': require('../_baseKeys'),
'rearg': require('../rearg'),
'spread': require('../spread')
};

View File

@@ -1 +0,0 @@
module.exports = require('./<%= name %>');

View File

@@ -1,2 +0,0 @@
var convert = require('./convert');
module.exports = convert(require('../<%= name %>'));

View File

@@ -1,17 +0,0 @@
var baseConvert = require('./_baseConvert'),
util = require('./_util');
/**
* Converts `func` of `name` to an immutable auto-curried iteratee-first data-last
* version. If `name` is an object its methods will be converted.
*
* @param {string} name The name of the function to wrap.
* @param {Function} [func] The function to wrap.
* @param {Object} [options] The options object. See `baseConvert` for more details.
* @returns {Function|Object} Returns the converted function or object.
*/
function convert(name, func, options) {
return baseConvert(util, name, func, options);
}
module.exports = convert;

View File

@@ -1,2 +0,0 @@
var _ = require('./lodash').runInContext();
module.exports = require('./fp/convert')(_);

View File

@@ -1,2 +0,0 @@
var convert = require('./convert');
module.exports = convert('<%= name %>', require('../<%= _.result(mapping.remap, name, name) %>'));

View File

@@ -1 +0,0 @@
module.exports = require('../<%= name %>');

View File

@@ -1,32 +0,0 @@
'use strict';
var _ = require('lodash'),
async = require('async'),
fs = require('fs-extra'),
path = require('path');
var minify = require('../common/minify.js');
var basePath = path.join(__dirname, '..', '..'),
distPath = path.join(basePath, 'dist'),
filename = 'lodash.js';
var baseLodash = path.join(basePath, filename),
distLodash = path.join(distPath, filename);
/*----------------------------------------------------------------------------*/
function onComplete(error) {
if (error) {
throw error;
}
}
function build() {
async.series([
_.partial(fs.copy, baseLodash, distLodash),
_.partial(minify, distLodash)
], onComplete);
}
build();

View File

@@ -1,55 +0,0 @@
'use strict';
var _ = require('lodash'),
docdown = require('docdown'),
fs = require('fs-extra'),
path = require('path');
var basePath = path.join(__dirname, '..', '..'),
docPath = path.join(basePath, 'doc'),
readmePath = path.join(docPath, 'README.md');
var pkg = require('../../package.json'),
version = pkg.version;
var config = {
'base': {
'entryLinks': [
'<% if (name == "templateSettings" || !/^(?:methods|properties|seq)$/i.test(category)) {' +
'print("[&#x24C3;](https://www.npmjs.com/package/lodash." + name.toLowerCase() + " \\"See the npm package\\")")' +
'} %>'
],
'path': path.join(basePath, 'lodash.js'),
'title': '<a href="https://lodash.com/">lodash</a> <span>v' + version + '</span>',
'toc': 'categories',
'url': 'https://github.com/lodash/lodash/blob/' + version + '/lodash.js'
},
'github': {
'hash': 'github'
},
'site': {
'tocLink': '#docs'
}
};
function postprocess(string) {
// Fix docdown bug by wrapping symbol property identifiers in brackets.
return string.replace(/\.(Symbol\.(?:[a-z]+[A-Z]?)+)/g, '[$1]');
}
/*----------------------------------------------------------------------------*/
function onComplete(error) {
if (error) {
throw error;
}
}
function build(type) {
var options = _.defaults({}, config.base, config[type]),
markdown = docdown(options);
fs.writeFile(readmePath, postprocess(markdown), onComplete);
}
build(_.last(process.argv));

View File

@@ -1,23 +0,0 @@
'use strict';
var _ = require('lodash'),
fs = require('fs-extra'),
path = require('path');
var basePath = path.join(__dirname, '..', '..'),
distPath = path.join(basePath, 'dist'),
corePath = path.join(distPath, 'lodash.core.js');
/*----------------------------------------------------------------------------*/
function onComplete(error) {
if (error) {
throw error;
}
}
function build(target) {
fs.copy(corePath, path.join(target, 'core.js'), onComplete);
}
build(_.last(process.argv));

19302
lodash.js

File diff suppressed because it is too large Load Diff

View File

@@ -1,51 +1,62 @@
{
"name": "lodash",
"version": "4.5.0",
"main": "lodash.js",
"private": true,
"devDependencies": {
"async": "^1.5.2",
"benchmark": "^2.1.0",
"chalk": "^1.1.1",
"codecov.io": "~0.1.6",
"coveralls": "^2.11.6",
"curl-amd": "~0.8.12",
"docdown": "~0.4.1",
"dojo": "^1.10.4",
"ecstatic": "^1.4.0",
"fs-extra": "~0.26.5",
"glob": "^7.0.0",
"istanbul": "0.4.2",
"jquery": "^2.2.0",
"jscs": "^2.10.1",
"lodash": "^3.10.1",
"platform": "^1.3.1",
"qunit-extras": "^1.4.5",
"qunitjs": "~1.21.0",
"request": "^2.69.0",
"requirejs": "^2.1.22",
"sauce-tunnel": "^2.4.0",
"uglify-js": "2.6.1",
"webpack": "^1.12.13"
"version": "2.4.1",
"description": "A utility library delivering consistency, customization, performance, & extras.",
"homepage": "http://lodash.com/",
"license": "MIT",
"main": "dist/lodash.js",
"keywords": ["amd", "browser", "client", "customize", "functional", "server", "util"],
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
"contributors": [
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
"Mathias Bynens <mathias@qiwi.be> (http://mathiasbynens.be/)"
],
"bugs": "https://github.com/lodash/lodash/issues",
"repository": { "type": "git", "url": "https://github.com/lodash/lodash.git" },
"engines": ["node", "rhino"],
"files": [
"LICENSE.txt",
"lodash.js",
"dist/lodash.js",
"dist/lodash.min.js",
"dist/lodash.compat.js",
"dist/lodash.compat.min.js",
"dist/lodash.underscore.js",
"dist/lodash.underscore.min.js"
],
"jam": {
"main": "dist/lodash.compat.js",
"include": [
"LICENSE.txt",
"dist/lodash.js",
"dist/lodash.min.js",
"dist/lodash.compat.js",
"dist/lodash.compat.min.js",
"dist/lodash.underscore.js",
"dist/lodash.underscore.min.js"
]
},
"scripts": {
"build": "npm run build:main & npm run build:fp",
"build:fp": "node lib/fp/build-dist.js",
"build:fp-modules": "node lib/fp/build-modules.js",
"build:main": "node lib/main/build-dist.js",
"build:main-modules": "node lib/main/build-modules.js",
"doc": "node lib/main/build-doc github",
"doc:fp": "node lib/fp/build-doc",
"doc:site": "node lib/main/build-doc site",
"prepublish": "npm run style",
"pretest": "npm run build",
"style": "npm run style:main & npm run style:fp & npm run style:perf & npm run style:test",
"style:fp": "jscs fp/*.js lib/**/*.js",
"style:main": "jscs lodash.js",
"style:perf": "jscs perf/*.js perf/**/*.js",
"style:test": "jscs test/*.js test/**/*.js",
"test": "npm run test:main && npm run test:fp",
"test:fp": "node test/test-fp",
"test:main": "node test/test"
"volo": {
"type": "directory",
"ignore": [
".*",
"*.custom.*",
"*.min.*",
"*.template.*",
"*.map",
"*.md",
"lodash.js",
"index.js",
"bower.json",
"component.json",
"doc",
"modularize",
"node_modules",
"perf",
"test",
"vendor"
]
}
}

View File

@@ -1,16 +1,16 @@
;(function(window) {
'use strict';
/** The base path of the lodash builds. */
/** The base path of the builds */
var basePath = '../';
/** The lodash build to load. */
/** The Lo-Dash build to load */
var build = (build = /build=([^&]+)/.exec(location.search)) && decodeURIComponent(build[1]);
/** The other library to load. */
/** The other library to load */
var other = (other = /other=([^&]+)/.exec(location.search)) && decodeURIComponent(other[1]);
/** The `ui` object. */
/** The `ui` object */
var ui = {};
/*--------------------------------------------------------------------------*/
@@ -34,7 +34,7 @@
/*--------------------------------------------------------------------------*/
// Initialize controls.
// initialize controls
addListener(window, 'load', function() {
function eventHandler(event) {
var buildIndex = buildList.selectedIndex,
@@ -58,7 +58,13 @@
span1.innerHTML =
'<label for="perf-build">Build: </label>' +
'<select id="perf-build">' +
'<option value="lodash">lodash</option>' +
'<option value="lodash-compat">Lo-Dash (compat)</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-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>';
var span2 = document.createElement('span');
@@ -68,7 +74,13 @@
'<select id="perf-other">' +
'<option value="underscore-dev">Underscore (development)</option>' +
'<option value="underscore">Underscore (production)</option>' +
'<option value="lodash">lodash</option>' +
'<option value="lodash-compat">Lo-Dash (compat)</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-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>';
var buildList = span1.lastChild,
@@ -80,8 +92,14 @@
buildList.selectedIndex = (function() {
switch (build) {
case 'lodash':
case null: return 0;
case 'lodash-compat': return 0;
case 'lodash-legacy': return 1;
case 'lodash-mobile': return 2;
case 'lodash-underscore': return 4;
case 'lodash-custom-dev': return 5;
case 'lodash-custom': return 6;
case 'lodash-modern':
case null: return 3;
}
return -1;
}());
@@ -89,7 +107,13 @@
otherList.selectedIndex = (function() {
switch (other) {
case 'underscore-dev': return 0;
case 'lodash': return 2;
case 'lodash-compat': return 2;
case 'lodash-legacy': return 3;
case 'lodash-mobile': return 4;
case 'lodash-modern': return 5;
case 'lodash-underscore': return 6;
case 'lodash-custom-dev': return 7;
case 'lodash-custom': return 8;
case 'underscore':
case null: return 1;
}
@@ -100,32 +124,49 @@
addListener(otherList, 'change', eventHandler);
});
// The lodash build file path.
// expose Lo-Dash build file path
ui.buildPath = (function() {
var result;
switch (build) {
case null: build = 'lodash';
case 'lodash': result = 'dist/lodash.min.js'; break;
case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
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 null: build = 'lodash-modern';
case 'lodash-modern': result = 'dist/lodash.min.js'; break;
default: return build;
}
return basePath + result;
}());
// The other library file path.
// expose other library file path
ui.otherPath = (function() {
var result;
switch (other) {
case 'lodash': result = 'dist/lodash.min.js'; break;
case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
case 'lodash-modern': result = 'dist/lodash.min.js'; break;
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 'underscore-dev': result = 'vendor/underscore/underscore.js'; break;
case null: other = 'underscore';
case null: other = 'underscore';
case 'underscore': result = 'vendor/underscore/underscore-min.js'; break;
default: return other;
}
return basePath + result;
}());
ui.urlParams = { 'build': build, 'other': other };
// expose `ui.urlParams` properties
ui.urlParams = {
'build': build,
'other': other
};
// expose `ui`
window.ui = ui;
}(this));

View File

@@ -1,69 +1,82 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>lodash Performance Suite</title>
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
}
#FirebugUI {
top: 2em;
}
#perf-toolbar {
background-color: #EEE;
color: #5E740B;
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
font-size: small;
padding: 0.5em 0 0.5em 2em;
overflow: hidden;
}
</style>
</head>
<body>
<div id="perf-toolbar"></div>
<script src="../lodash.js"></script>
<script src="../node_modules/platform/platform.js"></script>
<script src="../node_modules/benchmark/benchmark.js"></script>
<script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
<script src="./asset/perf-ui.js"></script>
<script>
document.write('<script src="' + ui.buildPath + '"><\/script>');
</script>
<script>
var lodash = _.noConflict();
</script>
<script>
document.write('<script src="' + ui.otherPath + '"><\/script>');
</script>
<script src="perf.js"></script>
<script>
(function() {
var measured,
perfNow,
begin = new Date;
<head>
<meta charset="utf-8">
<title>Lo-Dash Performance Suite</title>
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
}
applet {
position: absolute;
left: -9999em;
}
#FirebugUI {
top: 2em;
}
#perf-toolbar {
background-color: #EEE;
color: #5E740B;
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
font-size: small;
padding: 0.5em 0 0.5em 2em;
overflow: hidden;
}
</style>
</head>
<body>
<div id="perf-toolbar"></div>
<script src="../vendor/platform.js/platform.js"></script>
<script src="../lodash.js"></script>
<script src="../vendor/benchmark.js/benchmark.js"></script>
<script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
<script src="./asset/perf-ui.js"></script>
<script>
document.write('<script src="' + ui.buildPath + '"><\/script>');
</script>
<script>
var lodash = _.noConflict();
</script>
<script>
document.write('<script src="' + ui.otherPath + '"><\/script>');
</script>
<script src="perf.js"></script>
<script>
(function() {
var measured,
perfNow,
begin = new Date;
function init() {
var fbUI = document.getElementById('FirebugUI'),
fbDoc = fbUI && (fbDoc = fbUI.contentWindow || fbUI.contentDocument).document || fbDoc,
fbCommandLine = fbDoc && fbDoc.getElementById('fbCommandLine');
function init() {
var fbUI = document.getElementById('FirebugUI'),
fbDoc = fbUI && (fbDoc = fbUI.contentWindow || fbUI.contentDocument).document || fbDoc,
fbCommandLine = fbDoc && fbDoc.getElementById('fbCommandLine');
if (!fbCommandLine) {
return setTimeout(init, 15);
}
fbUI.style.height = (
Math.max(document.documentElement.clientHeight, document.body.clientHeight) -
document.getElementById('perf-toolbar').clientHeight
) + 'px';
if (!fbCommandLine) {
return setTimeout(init, 15);
}
fbUI.style.height = (
Math.max(document.documentElement.clientHeight, document.body.clientHeight) -
document.getElementById('perf-toolbar').clientHeight
) + 'px';
fbDoc.body.style.height = fbDoc.documentElement.style.height = '100%';
setTimeout(run, 15);
}
fbDoc.body.style.height = fbDoc.documentElement.style.height = '100%';
setTimeout(run, 15);
}
window.onload = init;
}());
</script>
</body>
// is the applet permitted?
if (!/[?&]nojava=true(?:&|$)/.test(location.search)) {
// is the applet really needed?
while (!(measured = new Date - begin)) { }
if (measured != 1 && !((perfNow = window.performance) && typeof (perfNow.now || perfNow.webkitNow) == 'function')) {
// load applet
document.write('<applet code="nano" archive="../vendor/benchmark.js/nano.jar"></applet>');
}
}
window.onload = init;
}());
</script>
</body>
</html>

File diff suppressed because it is too large Load Diff

14
perf/run-perf.sh Executable file
View File

@@ -0,0 +1,14 @@
cd "$(dirname "$0")"
echo "Running performance suite in node..."
node perf.js ../dist/lodash.js && node perf.js ../dist/lodash.min.js
for cmd in rhino "rhino -require" narwhal ringo phantomjs; do
echo ""
echo "Running performance suite in $cmd..."
$cmd perf.js ../dist/lodash.compat.js && $cmd perf.js ../dist/lodash.compat.min.js
done
echo ""
echo "Running performance suite in a browser..."
open index.html

View File

@@ -1,16 +1,16 @@
;(function(window) {
'use strict';
/** The base path of the lodash builds. */
/** The base path of the builds */
var basePath = '../';
/** The lodash build to load. */
/** The Lo-Dash build to load */
var build = (build = /build=([^&]+)/.exec(location.search)) && decodeURIComponent(build[1]);
/** The module loader to use. */
/** The module loader to use */
var loader = (loader = /loader=([^&]+)/.exec(location.search)) && decodeURIComponent(loader[1]);
/** The `ui` object. */
/** The `ui` object */
var ui = {};
/*--------------------------------------------------------------------------*/
@@ -34,7 +34,7 @@
/*--------------------------------------------------------------------------*/
// Initialize controls.
// initialize controls
addListener(window, 'load', function() {
function eventHandler(event) {
var buildIndex = buildList.selectedIndex,
@@ -55,37 +55,43 @@
function init() {
var toolbar = document.getElementById('qunit-testrunner-toolbar');
if (!toolbar) {
setTimeout(init, 15);
return;
if (toolbar) {
toolbar.appendChild(span1);
toolbar.appendChild(span2);
buildList.selectedIndex = (function() {
switch (build) {
case 'lodash-compat': return 1;
case 'lodash-modern-dev': return 2;
case 'lodash-modern': return 3;
case 'lodash-legacy': return 4;
case 'lodash-mobile': return 5;
case 'lodash-underscore': return 6;
case 'lodash-custom-dev': return 7;
case 'lodash-custom': return 8;
case 'lodash-compat-dev':
case null: return 0;
}
return -1;
}());
loaderList.selectedIndex = (function() {
switch (loader) {
case 'curl': return 1;
case 'dojo': return 2;
case 'requirejs': return 3;
case 'none':
case null: return 0;
}
return -1;
}());
addListener(buildList, 'change', eventHandler);
addListener(loaderList, 'change', eventHandler);
}
else {
setTimeout(init, 15);
}
toolbar.appendChild(span1);
toolbar.appendChild(span2);
buildList.selectedIndex = (function() {
switch (build) {
case 'lodash': return 1;
case 'lodash-core-dev': return 2;
case 'lodash-core': return 3;
case 'lodash-dev':
case null: return 0;
}
return -1;
}());
loaderList.selectedIndex = (function() {
switch (loader) {
case 'curl': return 1;
case 'dojo': return 2;
case 'requirejs': return 3;
case 'none':
case null: return 0;
}
return -1;
}());
addListener(buildList, 'change', eventHandler);
addListener(loaderList, 'change', eventHandler);
}
var span1 = document.createElement('span');
@@ -93,10 +99,15 @@
span1.innerHTML =
'<label for="qunit-build">Build: </label>' +
'<select id="qunit-build">' +
'<option value="lodash-dev">lodash (development)</option>' +
'<option value="lodash">lodash (production)</option>' +
'<option value="lodash-core-dev">lodash-core (development)</option>' +
'<option value="lodash-core">lodash-core (production)</option>' +
'<option value="lodash-compat-dev">Lo-Dash (compat development)</option>' +
'<option value="lodash-compat">Lo-Dash (compat production)</option>' +
'<option value="lodash-modern-dev">Lo-Dash (modern development)</option>' +
'<option value="lodash-modern">Lo-Dash (modern production)</option>' +
'<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
'<option value="lodash-mobile">Lo-Dash (mobile)</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>';
var span2 = document.createElement('span');
@@ -113,58 +124,51 @@
var buildList = span1.lastChild,
loaderList = span2.lastChild;
setTimeout(function() {
ui.timing.loadEventEnd = +new Date;
}, 1);
init();
});
// The lodash build file path.
// expose Lo-Dash build file path
ui.buildPath = (function() {
var result;
switch (build) {
case 'lodash': result = 'dist/lodash.min.js'; break;
case 'lodash-core-dev': result = 'dist/lodash.core.js'; break;
case 'lodash-core': result = 'dist/lodash.core.min.js'; break;
case null: build = 'lodash-dev';
case 'lodash-dev': result = 'lodash.js'; break;
case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
case 'lodash-modern-dev': result = 'dist/lodash.js'; break;
case 'lodash-modern': result = 'dist/lodash.min.js'; break;
case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
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 null: build = 'lodash-compat-dev';
case 'lodash-compat-dev': result = 'lodash.js'; break;
default: return build;
}
return basePath + result;
}());
// The module loader file path.
// expose module loader file path
ui.loaderPath = (function() {
var result;
switch (loader) {
case 'curl': result = 'node_modules/curl-amd/dist/curl-kitchen-sink/curl.js'; break;
case 'dojo': result = 'node_modules/dojo/dojo.js'; break;
case 'requirejs': result = 'node_modules/requirejs/require.js'; break;
case 'curl': result = 'vendor/curl/dist/curl-kitchen-sink/curl.js'; break;
case 'dojo': result = 'vendor/dojo/dojo.js'; break;
case 'requirejs': result = 'vendor/requirejs/require.js'; break;
case null: loader = 'none'; return '';
default: return loader;
}
return basePath + result;
}());
// Used to indicate testing a core build.
ui.isCore = /\bcore(\.min)?\.js\b/.test(ui.buildPath);
// expose `ui.urlParams` properties
ui.urlParams = {
'build': build,
'loader': loader
};
// Used to indicate testing a foreign file.
ui.isForeign = RegExp('^(\\w+:)?//').test(build);
// Used to indicate testing a modularized build.
ui.isModularize = /\b(?:amd|commonjs|es|node|npm|(index|main)\.js)\b/.test([location.pathname, location.search]);
// Used to indicate testing in Sauce Labs' automated test cloud.
ui.isSauceLabs = location.port == '9001';
// Used to indicate that lodash is in strict mode.
ui.isStrict = /\bes\b/.test([location.pathname, location.search]);
ui.urlParams = { 'build': build, 'loader': loader };
ui.timing = { 'loadEventEnd': 0 };
// used to indicate testing a modularized build
ui.isModularize = /\b(?:commonjs|(index|main)\.js|lodash-(?:amd|node)|modularize|npm)\b/.test([location.pathname, location.search, ui.buildPath]);
// expose `ui`
window.ui = ui;
}(this));

View File

@@ -1,12 +1,6 @@
self.console || (self.console = { 'log': function() {} });
addEventListener('message', function(e) {
if (e.data) {
try {
importScripts('../' + e.data);
} catch (e) {
self._ = { 'VERSION': e.message };
}
importScripts('../' + e.data);
postMessage(_.VERSION);
}
}, false);

View File

@@ -1,170 +1,76 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Backbone Test Suite</title>
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
</head>
<body>
<script>
// Avoid reporting tests to Sauce Labs when script errors occur.
if (location.port == '9001') {
window.onerror = function(message) {
if (window.QUnit) {
QUnit.config.done.length = 0;
}
global_test_results = { 'message': message };
};
}
</script>
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
<script src="../node_modules/qunit-extras/qunit-extras.js"></script>
<script src="../vendor/json-js/json2.js"></script>
<script src="../node_modules/platform/platform.js"></script>
<script src="./asset/test-ui.js"></script>
<script src="../lodash.js"></script>
<script>
QUnit.config.asyncRetries = 10;
QUnit.config.hidepassed = true;
<head>
<meta charset="utf-8">
<title>Backbone Test Suite</title>
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
<style>
body > #qunit-header {
display: none;
}
</style>
</head>
<body>
<div id="qunit"></div>
<h1 id="qunit-header"></h1>
<div id="qunit-fixture">
<div id='testElement'>
<h1>Test</h1>
</div>
</div>
<script src="../vendor/qunit/qunit/qunit.js"></script>
<script src="../vendor/qunit-extras/qunit-extras.js"></script>
<script src="../vendor/json-js/json2.js"></script>
<script src="../vendor/jquery/jquery.js"></script>
<script src="../vendor/platform.js/platform.js"></script>
<script src="./asset/test-ui.js"></script>
<script src="../lodash.js"></script>
<script>
var lodash = _.noConflict();
var mixinPrereqs = (function() {
var aliasToReal = {
'indexBy': 'keyBy',
'invoke': 'invokeMap'
};
QUnit.config.asyncRetries = 5;
QUnit.config.hidepassed = true;
var keyMap = {
'rest': 'tail'
};
// excuse tests we intentionally fail or those with problems
QUnit.config.excused = {
'Backbone.Collection': {
'set with many models does not overflow the stack': true
},
'Backbone.Router': {
'#2656 - No trailing slash on root.': true,
'#2765 - Fragment matching sans query/hash.': true
}
};
var lodash = _.noConflict();
// only excuse `Backbone.Router` tests in IE < 8
if (!(document.attachEvent && (document.documentMode || 0) < 8)) {
delete QUnit.config.excused['Backbone.Router'];
}
return function(_) {
lodash.defaultsDeep(_, { 'templateSettings': lodash.templateSettings });
lodash.mixin(_, lodash.pick(lodash, lodash.difference([
'countBy',
'debounce',
'difference',
'find',
'findIndex',
'findLastIndex',
'groupBy',
'includes',
'invert',
'invokeMap',
'keyBy',
'omit',
'partition',
'reduceRight',
'reject',
'sample',
'without'
], lodash.functions(_))));
// assign results to `global_test_results` for Sauce Labs
var global_test_results;
QUnit.done(function(results) {
global_test_results = results;
});
lodash.forOwn(keyMap, function(realName, otherName) {
_[otherName] = lodash[realName];
_.prototype[otherName] = lodash.prototype[realName];
});
lodash.forOwn(aliasToReal, function(realName, alias) {
_[alias] = _[realName];
_.prototype[alias] = _.prototype[realName];
});
};
}());
// Load prerequisite scripts.
document.write(ui.urlParams.loader == 'none'
? '<script src="' + ui.buildPath + '"><\/script>'
: '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
);
</script>
<script>
if (ui.urlParams.loader == 'none') {
mixinPrereqs(_);
document.write([
'<script src="../node_modules/jquery/dist/jquery.js"><\/script>',
'<script src="../vendor/backbone/backbone.js"><\/script>',
'<script src="../vendor/backbone/test/setup/dom-setup.js"><\/script>',
'<script src="../vendor/backbone/test/setup/environment.js"><\/script>',
'<script src="../vendor/backbone/test/noconflict.js"><\/script>',
'<script src="../vendor/backbone/test/events.js"><\/script>',
'<script src="../vendor/backbone/test/model.js"><\/script>',
'<script src="../vendor/backbone/test/collection.js"><\/script>',
'<script src="../vendor/backbone/test/router.js"><\/script>',
'<script src="../vendor/backbone/test/view.js"><\/script>',
'<script src="../vendor/backbone/test/sync.js"><\/script>'
].join('\n'));
}
</script>
<script>
(function() {
if (window.curl) {
curl.config({ 'apiName': 'require' });
}
if (!window.require) {
return;
}
var reBasename = /[\w.-]+$/,
basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
modulePath = ui.buildPath.replace(/\.js$/, ''),
locationPath = modulePath.replace(reBasename, '').replace(/^\/|\/$/g, ''),
moduleMain = modulePath.match(reBasename)[0],
uid = +new Date;
function getConfig() {
var result = {
'baseUrl': './',
'urlArgs': 't=' + uid++,
'waitSeconds': 0,
'paths': {
'backbone': '../vendor/backbone/backbone',
'jquery': '../node_modules/jquery/dist/jquery'
},
'packages': [{
'name': 'test',
'location': '../vendor/backbone/test',
'config': {
// Work around no global being exported.
'exports': 'QUnit',
'loader': 'curl/loader/legacy'
}
}]
};
if (ui.isModularize) {
result.packages.push({
'name': 'underscore',
'location': locationPath,
'main': moduleMain
});
} else {
result.paths.underscore = modulePath;
}
return result;
}
QUnit.config.autostart = false;
require(getConfig(), ['underscore'], function(lodash) {
mixinPrereqs(lodash);
require(getConfig(), ['backbone'], function() {
require(getConfig(), [
'test/setup/dom-setup',
'test/setup/environment',
'test/noconflict',
'test/events',
'test/model',
'test/collection',
'test/router',
'test/view',
'test/sync'
], function() {
QUnit.start();
});
});
});
}());
</script>
</body>
// load the build of Lo-Dash
document.write('<script src="' + ui.buildPath + '"><\/script>');
</script>
<script>
_.mixin({
'debounce': _.debounce || lodash.debounce,
'defer': _.defer || lodash.defer,
'pluck': _.pluck || lodash.pluck
});
</script>
<script src="../vendor/backbone/backbone.js"></script>
<script src="../vendor/backbone/test/environment.js"></script>
<script src="../vendor/backbone/test/noconflict.js"></script>
<script src="../vendor/backbone/test/events.js"></script>
<script src="../vendor/backbone/test/model.js"></script>
<script src="../vendor/backbone/test/collection.js"></script>
<script src="../vendor/backbone/test/router.js"></script>
<script src="../vendor/backbone/test/view.js"></script>
<script src="../vendor/backbone/test/sync.js"></script>
</body>
</html>

View File

@@ -1,41 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>lodash-fp Test Suite</title>
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
</head>
<body>
<script>
// Avoid reporting tests to Sauce Labs when script errors occur.
if (location.port == '9001') {
window.onerror = function(message) {
if (window.QUnit) {
QUnit.config.done.length = 0;
}
global_test_results = { 'message': message };
};
}
</script>
<script src="../lodash.js"></script>
<script src="../dist/lodash.fp.js"></script>
<script src="../dist/mapping.fp.js"></script>
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
<script src="../node_modules/qunit-extras/qunit-extras.js"></script>
<script src="../node_modules/platform/platform.js"></script>
<script src="./test-fp.js"></script>
<div id="qunit"></div>
<script>
// Set a more readable browser name.
window.onload = function() {
var timeoutId = setInterval(function() {
var ua = document.getElementById('qunit-userAgent');
if (ua) {
ua.innerHTML = platform;
clearInterval(timeoutId);
}
}, 16);
};
</script>
</body>
</html>

View File

@@ -1,342 +1,202 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>lodash Test Suite</title>
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
<style>
#exports, #module {
display: none;
}
</style>
</head>
<body>
<script>
// Avoid reporting tests to Sauce Labs when script errors occur.
if (location.port == '9001') {
window.onerror = function(message) {
if (window.QUnit) {
QUnit.config.done.length = 0;
}
global_test_results = { 'message': message };
};
}
</script>
<script src="../node_modules/lodash/index.js"></script>
<script>var lodashStable = _.noConflict();</script>
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
<script src="../node_modules/qunit-extras/qunit-extras.js"></script>
<script src="../node_modules/platform/platform.js"></script>
<script src="./asset/test-ui.js"></script>
<div id="qunit"></div>
<div id="exports"></div>
<div id="module"></div>
<script>
function setProperty(object, key, value) {
try {
Object.defineProperty(object, key, {
'configurable': true,
'enumerable': false,
'writable': true,
'value': value
});
} catch (e) {
object[key] = value;
}
return object;
}
<head>
<meta charset="utf-8">
<title>Lo-Dash Test Suite</title>
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
<style>
#exports {
display: none;
}
</style>
</head>
<body>
<script src="../vendor/qunit/qunit/qunit.js"></script>
<script src="../vendor/qunit-extras/qunit-extras.js"></script>
<script src="../vendor/platform.js/platform.js"></script>
<script src="./asset/test-ui.js"></script>
<div id="qunit"></div>
<div id="exports"></div>
<script>
// set bad shims
Array._isArray = Array.isArray;
Array.isArray = function() {};
function addBizarroMethods() {
var funcProto = Function.prototype,
objectProto = Object.prototype;
Date._now = Date.now;
Date.now = function() {};
var hasOwnProperty = objectProto.hasOwnProperty,
fnToString = funcProto.toString,
nativeString = fnToString.call(objectProto.toString),
noop = function() {},
propertyIsEnumerable = objectProto.propertyIsEnumerable,
reToString = /toString/g;
Function.prototype._bind = Function.prototype.bind;
Function.prototype.bind = function() { return function() {}; };
function constant(value) {
return function() {
return value;
};
}
Object._create = Object.create;
Object.create = function() {};
function createToString(funcName) {
return constant(nativeString.replace(reToString, funcName));
}
Object._defineProperty = Object.defineProperty;
Object.defineProperty = function() {};
// Allow bypassing native checks.
setProperty(funcProto, 'toString', (function() {
function wrapper() {
setProperty(funcProto, 'toString', fnToString);
var result = hasOwnProperty.call(this, 'toString') ? this.toString() : fnToString.call(this);
setProperty(funcProto, 'toString', wrapper);
return result;
}
return wrapper;
}()));
Object._getPrototypeOf = Object.getPrototypeOf;
Object.getPrototypeOf = function() {};
// Add prototype extensions.
funcProto._method = noop;
Object._keys = Object.keys;
Object.keys = function() {};
// Set bad shims.
setProperty(Object, '_create', Object.create);
setProperty(Object, 'create', (function() {
function object() {}
return function(prototype) {
if (prototype === Object(prototype)) {
object.prototype = prototype;
var result = new object;
object.prototype = undefined;
}
return result || {};
};
}()));
// load Lo-Dash and expose it to the bad shims
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
</script>
<script>
// store Lo-Dash to test for bad shim detection
var lodashBadShim = window._;
setProperty(Object, '_getOwnPropertySymbols', Object.getOwnPropertySymbols);
setProperty(Object, 'getOwnPropertySymbols', undefined);
// restore native methods
if (Array._isArray) {
Array.isArray = Array._isArray;
} else {
delete Array.isArray;
}
if (Date._now) {
Date.now = Date._now;
} else {
delete Date.now;
}
if (Function.prototype._bind) {
Function.prototype.bind = Function.prototype._bind;
} else {
delete Function.prototype.bind;
}
if (Object._create) {
Object.create = Object._create;
} else {
delete Object.create;
}
if (Object._defineProperty) {
Object.defineProperty = Object._defineProperty;
} else {
delete Object.defineProperty;
}
if (Object._getPrototypeOf) {
Object.getPrototypeOf = Object._getPrototypeOf;
} else {
delete Object.getPrototypeOf;
}
if (Object._keys) {
Object.keys = Object._keys;
} else {
delete Object.keys;
}
delete Array._isArray;
delete Date._now;
delete Function.prototype._bind;
delete Object._create;
delete Object._defineProperty;
delete Object._getPrototypeOf;
delete Object._keys;
setProperty(objectProto, '_propertyIsEnumerable', propertyIsEnumerable);
setProperty(objectProto, 'propertyIsEnumerable', function(key) {
return !(key == 'valueOf' && this && this.valueOf === 1) && _propertyIsEnumerable.call(this, key);
});
QUnit.config.hidepassed = true;
setProperty(window, '_Map', window.Map);
if (_Map) {
setProperty(window, 'Map', (function(Map) {
var count = 0;
return function() {
if (count++) {
return new Map;
}
var result = {};
setProperty(window, 'Map', Map);
return result;
};
}(_Map)));
// assign results to `global_test_results` for Sauce Labs
var global_test_results;
QUnit.done(function(results) {
global_test_results = results;
});
setProperty(Map, 'toString', createToString('Map'));
}
setProperty(window, '_Set', window.Set);
setProperty(window, 'Set', noop);
// clear existing `_` value
window._ = undefined;
setProperty(window, '_Symbol', window.Symbol);
setProperty(window, 'Symbol', undefined);
// load Lo-Dash and test scripts
document.write(ui.urlParams.loader == 'none'
? '<script src="' + ui.buildPath + '"><\/script><script src="test.js"><\/script>'
: '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
);
</script>
<script>
var lodashModule,
shimmedModule,
underscoreModule;
setProperty(window, '_WeakMap', window.WeakMap);
setProperty(window, 'WeakMap', noop);
(function() {
if (window.curl) {
curl.config({ 'apiName': 'require' });
}
if (!window.require) {
return;
}
var reBasename = /[\w.-]+$/,
basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
modulePath = ui.buildPath.replace(/\.js$/, ''),
locationPath = modulePath.replace(reBasename, ''),
moduleMain = modulePath.match(reBasename)[0];
// Fake `WinRTError`.
setProperty(window, 'WinRTError', Error);
QUnit.config.autostart = false;
// Fake free variable `global`.
setProperty(window, 'exports', window);
setProperty(window, 'global', window);
setProperty(window, 'module', {});
}
// load Lo-Dash as a module
require({
'baseUrl': './',
'urlArgs': 't=' + (+new Date),
'packages': [
{
'name': 'lodash',
'location': locationPath,
'main': moduleMain
},
{
'name': 'shimmed',
'location': './abc/../' + locationPath,
'main': moduleMain
},
{
'name': 'underscore',
'location': './xyz/../' + locationPath,
'main': moduleMain
},
{
'name': 'test',
'location': basePath + '/test',
'main': 'test',
'config': {
// work around no global being exported
'exports': 'QUnit',
'loader': 'curl/loader/legacy'
}
}
],
'shim': {
'shimmed': {
'exports': '_'
}
}
},
['lodash', 'shimmed', 'underscore'], function(lodash, shimmed, underscore) {
if (shimmed && shimmed.noConflict) {
shimmedModule = shimmed.noConflict();
shimmedModule.moduleName = 'shimmed';
}
if (underscore && underscore.noConflict) {
underscoreModule = underscore.noConflict();
underscoreModule.moduleName = 'underscore';
}
if (lodash) {
lodashModule = lodash;
lodashModule.moduleName = 'lodash';
}
if (ui.isModularize) {
window._ = lodash;
}
require(['test'], function() {
QUnit.start();
});
});
}());
function removeBizarroMethods() {
var funcProto = Function.prototype,
objectProto = Object.prototype;
setProperty(objectProto, 'propertyIsEnumerable', objectProto._propertyIsEnumerable);
if (Object._create) {
Object.create = Object._create;
} else {
delete Object.create;
}
if (Object._getOwnPropertySymbols) {
Object.getOwnPropertySymbols = Object._getOwnPropertySymbols;
} else {
delete Object.getOwnPropertySymbols;
}
if (_Map) {
Map = _Map;
} else {
setProperty(window, 'Map', undefined);
}
if (_Set) {
Set = _Set;
} else {
setProperty(window, 'Set', undefined);
}
if (_Symbol) {
Symbol = _Symbol;
}
if (_WeakMap) {
WeakMap = _WeakMap;
} else {
setProperty(window, 'WeakMap', undefined);
}
setProperty(window, '_Map', undefined);
setProperty(window, '_Set', undefined);
setProperty(window, '_Symbol', undefined);
setProperty(window, '_WeakMap', undefined);
setProperty(window, 'WinRTError', undefined);
setProperty(window, 'exports', document.getElementById('exports'));
setProperty(window, 'global', undefined);
setProperty(window, 'module', document.getElementById('module'));
delete funcProto._method;
delete Object._create;
delete Object._getOwnPropertySymbols;
delete objectProto._propertyIsEnumerable;
}
// Load lodash to expose it to the bad extensions/shims.
if (!ui.isModularize) {
addBizarroMethods();
document.write('<script src="' + ui.buildPath + '"><\/script>');
}
</script>
<script>
// Store lodash to test for bad extensions/shims.
if (!ui.isModularize) {
var lodashBizarro = window._;
window._ = undefined;
removeBizarroMethods();
}
// Load test scripts.
document.write((ui.isForeign || ui.urlParams.loader == 'none')
? '<script src="' + ui.buildPath + '"><\/script><script src="test.js"><\/script>'
: '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
);
</script>
<script>
var lodashModule,
shimmedModule,
underscoreModule;
(function() {
if (window.curl) {
curl.config({ 'apiName': 'require' });
}
if (ui.isForeign || !window.require) {
return;
}
var reBasename = /[\w.-]+$/,
basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
modulePath = ui.buildPath.replace(/\.js$/, ''),
moduleMain = modulePath.match(reBasename)[0],
locationPath = modulePath.replace(reBasename, '').replace(/^\/|\/$/g, ''),
shimmedLocationPath = './abc/../' + locationPath,
underscoreLocationPath = './xyz/../' + locationPath,
uid = +new Date;
function getConfig() {
var result = {
'baseUrl': './',
'urlArgs': 't=' + uid++,
'waitSeconds': 0,
'paths': {},
'packages': [{
'name': 'test',
'location': basePath + 'test',
'main': 'test',
'config': {
// Work around no global being exported.
'exports': 'QUnit',
'loader': 'curl/loader/legacy'
}
}],
'shim': {
'shimmed': {
'exports': '_'
}
}
};
if (ui.isModularize) {
result.packages.push({
'name': 'lodash',
'location': locationPath,
'main': moduleMain
}, {
'name': 'shimmed',
'location': shimmedLocationPath,
'main': moduleMain
}, {
'name': 'underscore',
'location': underscoreLocationPath,
'main': moduleMain
});
} else {
result.paths.lodash = modulePath;
result.paths.shimmed = shimmedLocationPath + '/' + moduleMain;
result.paths.underscore = underscoreLocationPath + '/' + moduleMain;
}
return result;
}
function loadTests() {
require(getConfig(), ['test'], function() {
QUnit.start();
});
}
function loadModulesAndTests() {
require(getConfig(), ['lodash', 'shimmed', 'underscore'], function(lodash, shimmed, underscore) {
lodashModule = lodash;
lodashModule.moduleName = 'lodash';
if (shimmed) {
shimmedModule = shimmed.result(shimmed, 'noConflict') || shimmed;
shimmedModule.moduleName = 'shimmed';
}
if (underscore) {
underscoreModule = underscore.result(underscore, 'noConflict') || underscore;
underscoreModule.moduleName = 'underscore';
}
window._ = lodash;
if (ui.isModularize) {
require(getConfig(), [
'lodash/internal/baseEach',
'lodash/internal/isIndex',
'lodash/internal/isIterateeCall'
], function(baseEach, isIndex, isIterateeCall) {
lodash._baseEach = baseEach;
lodash._isIndex = isIndex;
lodash._isIterateeCall = isIterateeCall;
loadTests();
});
} else {
loadTests();
}
});
}
QUnit.config.autostart = false;
if (window.requirejs) {
addBizarroMethods();
require(getConfig(), ['lodash'], function(lodash) {
lodashBizarro = lodash.result(lodash, 'noConflict') || lodash;
delete requirejs.s.contexts._;
removeBizarroMethods();
loadModulesAndTests();
});
} else {
loadModulesAndTests();
}
}());
// Set a more readable browser name.
window.onload = function() {
var timeoutId = setInterval(function() {
var ua = document.getElementById('qunit-userAgent');
if (ua) {
ua.innerHTML = platform;
clearInterval(timeoutId);
}
}, 16);
};
</script>
</body>
// set a more readable browser name
window.onload = function() {
var timeoutId = setInterval(function() {
var ua = document.getElementById('qunit-userAgent');
if (ua) {
ua.innerHTML = platform;
clearInterval(timeoutId);
}
}, 16);
};
</script>
</body>
</html>

View File

@@ -1,27 +0,0 @@
#!/usr/bin/env node
'use strict';
var fs = require('fs'),
path = require('path');
var args = (args = process.argv)
.slice((args[0] === process.execPath || args[0] === 'node') ? 2 : 0);
var filePath = path.resolve(args[1]),
reLine = /.*/gm,
slice = Array.prototype.slice;
var pattern = (function() {
var result = args[0],
delimiter = result.charAt(0),
lastIndex = result.lastIndexOf(delimiter);
return RegExp(result.slice(1, lastIndex), result.slice(lastIndex + 1));
}());
/*----------------------------------------------------------------------------*/
fs.writeFileSync(filePath, fs.readFileSync(filePath, 'utf8').replace(pattern, function(match) {
var snippet = slice.call(arguments, -3, -1)[0];
return match.replace(snippet, snippet.replace(reLine, ''));
}));

14
test/run-test.sh Normal file
View File

@@ -0,0 +1,14 @@
cd "$(dirname "$0")"
for cmd in rhino "rhino -require" narwhal ringo phantomjs; do
echo "Testing in $cmd..."
$cmd test.js ../dist/lodash.compat.js && $cmd test.js ../dist/lodash.compat.min.js
echo ""
done
echo "Testing in node..."
node test.js ../dist/lodash.js && node test.js ../dist/lodash.min.js
echo ""
echo "Testing in a browser..."
open index.html

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

25766
test/test.js

File diff suppressed because it is too large Load Diff

View File

@@ -1,480 +1,205 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Underscore Test Suite</title>
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
</head>
<body>
<div id="qunit"></div>
<script>
// Avoid reporting tests to Sauce Labs when script errors occur.
if (location.port == '9001') {
window.onerror = function(message) {
if (window.QUnit) {
QUnit.config.done.length = 0;
}
global_test_results = { 'message': message };
};
}
</script>
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
<script src="../node_modules/qunit-extras/qunit-extras.js"></script>
<script src="../node_modules/jquery/dist/jquery.js"></script>
<script src="../node_modules/platform/platform.js"></script>
<script src="./asset/test-ui.js"></script>
<script src="../lodash.js"></script>
<script>
QUnit.config.asyncRetries = 10;
QUnit.config.hidepassed = true;
QUnit.config.excused = {
'Arrays': {
'difference': [
'can perform an OO-style difference'
],
'drop': [
'is an alias for rest'
],
'first': [
'returns an empty array when n <= 0 (0 case)',
'returns an empty array when n <= 0 (negative case)',
'can fetch the first n elements',
'returns the whole array if n > length'
],
'findIndex': [
'called with context'
],
'findLastIndex': [
'called with context'
],
'flatten': [
'supports empty arrays',
'can flatten nested arrays',
'works on an arguments object',
'can handle very deep arrays'
],
'head': [
'is an alias for first'
],
'indexOf': [
"sorted indexOf doesn't uses binary search",
'0'
],
'initial': [
'returns all but the last n elements',
'returns an empty array when n > length',
'works on an arguments object'
],
'intersection': [
'can perform an OO-style intersection'
],
'last': [
'returns an empty array when n <= 0 (0 case)',
'returns an empty array when n <= 0 (negative case)',
'can fetch the last n elements',
'returns the whole array if n > length'
],
'lastIndexOf': [
'should treat falsey `fromIndex` values, except `0` and `NaN`, as `array.length`',
'should treat non-number `fromIndex` values as `array.length`',
'[0,-1,-1]'
],
'object': [
'an array of pairs zipped together into an object',
'an object converted to pairs and back to an object'
],
'range': [
'range with two arguments a &amp; b, b&lt;a generates an empty array'
],
'rest': [
'returns the whole array when index is 0',
'returns elements starting at the given index',
'works on an arguments object'
],
'sortedIndex': [
'2',
'3'
],
'tail': [
'is an alias for rest'
],
'take': [
'is an alias for first'
],
'uniq': [
'uses the result of `iterator` for uniqueness comparisons (unsorted case)',
'`sorted` argument defaults to false when omitted',
'when `iterator` is a string, uses that key for comparisons (unsorted case)',
'uses the result of `iterator` for uniqueness comparisons (sorted case)',
'when `iterator` is a string, uses that key for comparisons (sorted case)',
'can use falsey pluck like iterator'
],
'union': [
'can perform an OO-style union'
]
},
'Chaining': {
'pop': true,
'shift': true,
'splice': true,
'reverse/concat/unshift/pop/map': [
'can chain together array functions.'
]
},
'Collections': {
'lookupIterator with contexts': true,
'Iterating objects with sketchy length properties': true,
'Resistant to collection length and properties changing while iterating': true,
'countBy': [
'true'
],
'each': [
'context object property accessed'
],
'every': [
'Can be called with object',
'Died on test #15',
'context works'
],
'filter': [
'given context',
'[{"a":1,"b":2},{"a":1,"b":3},{"a":1,"b":4}]',
'[{"a":1,"b":2},{"a":2,"b":2}]',
'Empty object accepts all items',
'OO-filter'
],
'find': [
'{"a":1,"b":4}',
'undefined when not found',
'undefined when searching empty list',
'works on objects',
'undefined',
'called with context'
],
'findWhere': [
'checks properties given function'
],
'groupBy': [
'true'
],
'includes': [
"doesn't delegate to binary search"
],
'invoke': [
'handles null & undefined'
],
'map': [
'tripled numbers with context',
'OO-style doubled numbers'
],
'max': [
'can handle null/undefined',
'can perform a computation-based max',
'Maximum value of an empty object',
'Maximum value of an empty array',
'Maximum value of a non-numeric collection',
'Finds correct max in array starting with num and containing a NaN',
'Finds correct max in array starting with NaN',
'Respects iterator return value of -Infinity',
'String keys use property iterator',
'Iterator context',
'Lookup falsy iterator'
],
'min': [
'can handle null/undefined',
'can perform a computation-based min',
'Minimum value of an empty object',
'Minimum value of an empty array',
'Minimum value of a non-numeric collection',
'Finds correct min in array starting with NaN',
'Respects iterator return value of Infinity',
'String keys use property iterator',
'Iterator context',
'Lookup falsy iterator'
],
'partition': [
'can reference the array index',
'Died on test #8',
'partition takes a context argument',
'function(a){[code]}'
],
'pluck': [
'[1]'
],
'reduce': [
'can reduce with a context object'
],
'reject': [
'Returns empty list given empty array'
],
'sample': [
'behaves correctly on negative n',
'Died on test #3'
],
'some': [
'Can be called with object',
'Died on test #17',
'context works'
],
'where': [
'checks properties given function'
],
'Can use various collection methods on NodeLists': [
'<span id="id2"></span>',
'<span id="id1"></span>'
]
},
'Functions': {
'debounce asap': true,
'debounce asap cancel': true,
'debounce after system time is set backwards': true,
'debounce asap recursively': true,
'throttle repeatedly with results': true,
'more throttle does not trigger leading call when leading is set to false': true,
'throttle does not trigger trailing call when trailing is set to false': true,
'before': [
'stores a memo to the last value',
'provides context'
],
'bind': [
'Died on test #2'
],
'bindAll': [
'throws an error for bindAll with no functions named'
],
'memoize': [
'{"bar":"BAR","foo":"FOO"}',
'Died on test #8'
],
'partial':[
'can partially apply with placeholders',
'accepts more arguments than the number of placeholders',
'accepts fewer arguments than the number of placeholders',
'unfilled placeholders are undefined',
'keeps prototype',
'allows the placeholder to be swapped out'
]
},
'Objects': {
'#1929 Typed Array constructors are functions': true,
'allKeys': [
'is not fooled by sparse arrays; see issue #95',
'is not fooled by sparse arrays with additional properties',
'[]'
],
'defaults': [
'defaults skips nulls',
'defaults skips undefined'
],
'extend': [
'extending null results in null',
'extending undefined results in undefined'
],
'extendOwn': [
'extending non-objects results in returning the non-object value',
'extending undefined results in undefined'
],
'functions': [
'also looks up functions on the prototype'
],
'isEqual': [
'`0` is not equal to `-0`',
'Commutative equality is implemented for `0` and `-0`',
'`new Number(0)` and `-0` are not equal',
'Commutative equality is implemented for `new Number(0)` and `-0`',
'false'
],
'isFinite': [
'Numeric strings are numbers',
'Number instances can be finite'
],
'isMatch': [
'doesnt falsey match constructor on undefined/null'
],
'findKey': [
'called with context'
],
'keys': [
'is not fooled by sparse arrays; see issue #95',
'[]'
],
'mapObject': [
'keep context',
'called with context',
'mapValue identity'
],
'matcher': [
'null matches null',
'treats primitives as empty'
],
'omit': [
'can accept a predicate',
'function is given context'
],
'pick': [
'can accept a predicate and context',
'function is given context'
]
},
'Utility': {
'noConflict (node vm)': true,
'now': [
'Produces the correct time in milliseconds'
],
'times': [
'works as a wrapper'
]
}
};
<head>
<meta charset="utf-8">
<title>Underscore Test Suite</title>
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
<style>
iframe {
display: none;
}
</style>
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture">
<div id="map-test">
<div id="id1"></div>
<div id="id2"></div>
</div>
<img id="chart_image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==">
</div>
<script src="../vendor/qunit/qunit/qunit.js"></script>
<script src="../vendor/qunit-extras/qunit-extras.js"></script>
<script src="../vendor/jquery/jquery.js"></script>
<script src="../vendor/platform.js/platform.js"></script>
<script src="./asset/test-ui.js"></script>
<script>
QUnit.config.asyncRetries = 10;
QUnit.config.hidepassed = true;
var mixinPrereqs = (function() {
var aliasToReal = {
'all': 'every',
'allKeys': 'keysIn',
'any': 'some',
'collect': 'map',
'compose': 'flowRight',
'contains': 'includes',
'detect': 'find',
'extendOwn': 'assign',
'findWhere': 'find',
'foldl': 'reduce',
'foldr': 'reduceRight',
'include': 'includes',
'indexBy': 'keyBy',
'inject': 'reduce',
'invoke': 'invokeMap',
'mapObject': 'mapValues',
'matcher': 'matches',
'methods': 'functions',
'object': 'zipObject',
'pairs': 'toPairs',
'pluck': 'map',
'restParam': 'restArgs',
'select': 'filter',
'unique': 'uniq',
'where': 'filter'
};
// excuse tests we intentionally fail or those with problems
QUnit.config.excused = {
'Arrays': {
'union': [
'[null,1,2,3]'
]
},
'Chaining': {
'select/reject/sortBy': [
'Died on test #1'
],
'select/reject/sortBy in functional style': [
'Died on test #1'
],
'reverse/concat/unshift/pop/map': [
'"34, 10, 8, 6, 4, 2, 10, 10"'
]
},
'Collections': {
'reduce': [
'handles a null (without initial value) properly',
'throws an error for empty arrays with no initial value'
],
'reduceRight': [
'handles a null (without initial value) properly',
'throws an error for empty arrays with no initial value'
],
'where': [
'Only get the first object matched.'
]
},
'Functions': {
'bind': [
'can bind without specifying a context',
'Died on test #2'
],
'bindAll': [
'throws an error for bindAll with no functions named'
],
'throttle repeatedly with results': true,
'more throttle does not trigger leading call when leading is set to false': true,
'throttle does not trigger trailing call when trailing is set to false': true,
'debounce asap': true
},
'Objects': {
'isEqual': [
'Died on test #60',
'Died on test #63'
],
'keys': [
'throws an error for `null` values',
'throws an error for `undefined` values',
'throws an error for number primitives',
'throws an error for string primitives',
'throws an error for boolean primitives'
]
},
'Utility': {
'_.escape': [
'"&lt;a href=&quot;http://moe.com&quot;&gt;Curly &amp; Moe&#x27;s&lt;/a&gt;"'
],
'_.unescape': [
'"<a href=\\"http://moe.com\\">Curly & Moe&#039;s</a>"'
],
'times': [
'Died on test #1'
],
'uniqueId': [
'Died on test #1'
]
}
};
var keyMap = {
'rest': 'tail',
'restArgs': 'rest'
};
// only excuse in Sauce Labs (buggy Safari and timers)
if (location.port != '9001') {
delete QUnit.config.excused.Chaining['select/reject/sortBy'];
delete QUnit.config.excused.Chaining['select/reject/sortBy in functional style'];
delete QUnit.config.excused.Functions['throttle repeatedly with results'];
delete QUnit.config.excused.Functions['more throttle does not trigger leading call when leading is set to false'];
delete QUnit.config.excused.Functions['throttle does not trigger trailing call when trailing is set to false'];
delete QUnit.config.excused.Functions['debounce asap'];
delete QUnit.config.excused.Objects.isEqual;
delete QUnit.config.excused.Utility.times;
delete QUnit.config.excused.Utility.uniqueId;
}
// only excuse in non-Underscore builds
if (/\bunderscore\b/i.test(ui.buildPath)) {
delete QUnit.config.excused.Chaining;
delete QUnit.config.excused.Collections.where;
delete QUnit.config.excused.Utility['_.escape'];
delete QUnit.config.excused.Utility['_.unescape'];
}
var lodash = _.noConflict();
// assign results to `global_test_results` for Sauce Labs
var global_test_results;
QUnit.done(function(results) {
global_test_results = results;
});
return function(_) {
lodash.defaultsDeep(_, { 'templateSettings': lodash.templateSettings });
lodash.mixin(_, lodash.pick(lodash, lodash.difference(lodash.functions(lodash), lodash.functions(_))));
// load Lo-Dash and test scripts
document.write(ui.urlParams.loader != 'none'
? '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
: ([
'<script src="' + ui.buildPath + '"><\/script>',
'<script src="../vendor/underscore/test/collections.js"><\/script>',
'<script src="../vendor/underscore/test/arrays.js"><\/script>',
'<script src="../vendor/underscore/test/functions.js"><\/script>',
'<script src="../vendor/underscore/test/objects.js"><\/script>',
'<script src="../vendor/underscore/test/utility.js"><\/script>',
'<script src="../vendor/underscore/test/chaining.js"><\/script>'
].join('\n'))
);
</script>
<script>
(function() {
if (window.curl) {
curl.config({ 'apiName': 'require' });
}
if (!window.require) {
return;
}
var reBasename = /[\w.-]+$/,
basePath = ('//' + location.host + location.pathname).replace(/\btest\/$/, ''),
modulePath = ui.buildPath.replace(/\.js$/, ''),
locationPath = modulePath.replace(reBasename, ''),
moduleMain = modulePath.match(reBasename)[0];
lodash.forOwn(keyMap, function(realName, otherName) {
_[otherName] = lodash[realName];
_.prototype[otherName] = lodash.prototype[realName];
});
QUnit.config.autostart = false;
lodash.forOwn(aliasToReal, function(realName, alias) {
_[alias] = _[realName];
_.prototype[alias] = _.prototype[realName];
});
};
}());
// Only excuse in Sauce Labs.
if (!ui.isSauceLabs) {
delete QUnit.config.excused.Functions['throttle repeatedly with results'];
delete QUnit.config.excused.Functions['more throttle does not trigger leading call when leading is set to false'];
delete QUnit.config.excused.Functions['throttle does not trigger trailing call when trailing is set to false'];
delete QUnit.config.excused.Utility.now;
}
// Load prerequisite scripts.
document.write(ui.urlParams.loader == 'none'
? '<script src="' + ui.buildPath + '"><\/script>'
: '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
);
</script>
<script>
if (ui.urlParams.loader == 'none') {
mixinPrereqs(_);
document.write([
'<script src="../vendor/underscore/test/collections.js"><\/script>',
'<script src="../vendor/underscore/test/arrays.js"><\/script>',
'<script src="../vendor/underscore/test/functions.js"><\/script>',
'<script src="../vendor/underscore/test/objects.js"><\/script>',
'<script src="../vendor/underscore/test/cross-document.js"><\/script>',
'<script src="../vendor/underscore/test/utility.js"><\/script>',
'<script src="../vendor/underscore/test/chaining.js"><\/script>'
].join('\n'));
}
</script>
<script>
(function() {
if (window.curl) {
curl.config({ 'apiName': 'require' });
}
if (!window.require) {
return;
}
// Wrap to work around tests assuming Node `require` use.
require = (function(func) {
return function() {
return arguments[0] === '..' ? window._ : func.apply(null, arguments);
};
}(require));
var reBasename = /[\w.-]+$/,
basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
modulePath = ui.buildPath.replace(/\.js$/, ''),
locationPath = modulePath.replace(reBasename, '').replace(/^\/|\/$/g, ''),
moduleId = /\bunderscore\b/i.test(ui.buildPath) ? 'underscore' : 'lodash',
moduleMain = modulePath.match(reBasename)[0],
uid = +new Date;
function getConfig() {
var result = {
'baseUrl': './',
'urlArgs': 't=' + uid++,
'waitSeconds': 0,
'paths': {},
'packages': [{
'name': 'test',
'location': '../vendor/underscore/test',
'config': {
// Work around no global being exported.
'exports': 'QUnit',
'loader': 'curl/loader/legacy'
}
}]
};
if (ui.isModularize) {
result.packages.push({
'name': moduleId,
'location': locationPath,
'main': moduleMain
});
} else {
result.paths[moduleId] = modulePath;
}
return result;
}
QUnit.config.autostart = false;
require(getConfig(), [moduleId], function(lodash) {
mixinPrereqs(lodash);
require(getConfig(), [
'test/collections',
'test/arrays',
'test/functions',
'test/objects',
'test/cross-document',
'test/utility',
'test/chaining'
], function() {
QUnit.start();
});
});
}());
</script>
</body>
// load Lo-Dash as a module
require({
'baseUrl': './',
'urlArgs': 't=' + (+new Date),
'packages': [
{
'name': 'lodash',
'location': locationPath,
'main': moduleMain
},
{
'name': 'test',
'location': '../vendor/underscore/test',
'config': {
// work around no global being exported
'exports': 'QUnit',
'loader': 'curl/loader/legacy'
}
}
]
},
['lodash'], function(lodash) {
if (ui.isModularize) {
window._ = lodash;
}
require([
'test/collections',
'test/arrays',
'test/functions',
'test/objects',
'test/utility',
'test/chaining'
], function() {
QUnit.start();
});
});
}());
</script>
<script type="text/html" id="template">
<%
// a comment
if (data) { data += 12345; }; %>
<li><%= data %></li>
</script>
</body>
</html>

View File

@@ -1,4 +1,4 @@
Copyright (c) 2010-2016 Jeremy Ashkenas, DocumentCloud
Copyright (c) 2010-2013 Jeremy Ashkenas, DocumentCloud
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -4,17 +4,9 @@
var ajax = Backbone.ajax;
var emulateHTTP = Backbone.emulateHTTP;
var emulateJSON = Backbone.emulateJSON;
var history = window.history;
var pushState = history.pushState;
var replaceState = history.replaceState;
QUnit.config.noglobals = true;
QUnit.testStart(function() {
var env = QUnit.config.current.testEnvironment;
// We never want to actually call these during tests.
history.pushState = history.replaceState = function(){};
var env = this.config.current.testEnvironment;
// Capture ajax settings for comparison.
Backbone.ajax = function(settings) {
@@ -38,8 +30,6 @@
Backbone.ajax = ajax;
Backbone.emulateHTTP = emulateHTTP;
Backbone.emulateJSON = emulateJSON;
history.pushState = pushState;
history.replaceState = replaceState;
});
})();

View File

@@ -1,44 +1,42 @@
(function() {
QUnit.module('Backbone.Events');
module("Backbone.Events");
QUnit.test('on and trigger', function(assert) {
assert.expect(2);
var obj = {counter: 0};
_.extend(obj, Backbone.Events);
test("on and trigger", 2, function() {
var obj = { counter: 0 };
_.extend(obj,Backbone.Events);
obj.on('event', function() { obj.counter += 1; });
obj.trigger('event');
assert.equal(obj.counter, 1, 'counter should be incremented.');
equal(obj.counter,1,'counter should be incremented.');
obj.trigger('event');
obj.trigger('event');
obj.trigger('event');
obj.trigger('event');
assert.equal(obj.counter, 5, 'counter should be incremented five times.');
equal(obj.counter, 5, 'counter should be incremented five times.');
});
QUnit.test('binding and triggering multiple events', function(assert) {
assert.expect(4);
var obj = {counter: 0};
test("binding and triggering multiple events", 4, function() {
var obj = { counter: 0 };
_.extend(obj, Backbone.Events);
obj.on('a b c', function() { obj.counter += 1; });
obj.trigger('a');
assert.equal(obj.counter, 1);
equal(obj.counter, 1);
obj.trigger('a b');
assert.equal(obj.counter, 3);
equal(obj.counter, 3);
obj.trigger('c');
assert.equal(obj.counter, 4);
equal(obj.counter, 4);
obj.off('a c');
obj.trigger('a b c');
assert.equal(obj.counter, 5);
equal(obj.counter, 5);
});
QUnit.test('binding and triggering with event maps', function(assert) {
var obj = {counter: 0};
test("binding and triggering with event maps", function() {
var obj = { counter: 0 };
_.extend(obj, Backbone.Events);
var increment = function() {
@@ -52,85 +50,36 @@
}, obj);
obj.trigger('a');
assert.equal(obj.counter, 1);
equal(obj.counter, 1);
obj.trigger('a b');
assert.equal(obj.counter, 3);
equal(obj.counter, 3);
obj.trigger('c');
assert.equal(obj.counter, 4);
equal(obj.counter, 4);
obj.off({
a: increment,
c: increment
}, obj);
obj.trigger('a b c');
assert.equal(obj.counter, 5);
equal(obj.counter, 5);
});
QUnit.test('binding and triggering multiple event names with event maps', function(assert) {
var obj = {counter: 0};
_.extend(obj, Backbone.Events);
var increment = function() {
this.counter += 1;
};
obj.on({
'a b c': increment
});
obj.trigger('a');
assert.equal(obj.counter, 1);
obj.trigger('a b');
assert.equal(obj.counter, 3);
obj.trigger('c');
assert.equal(obj.counter, 4);
obj.off({
'a c': increment
});
obj.trigger('a b c');
assert.equal(obj.counter, 5);
});
QUnit.test('binding and trigger with event maps context', function(assert) {
assert.expect(2);
var obj = {counter: 0};
var context = {};
_.extend(obj, Backbone.Events);
obj.on({
a: function() {
assert.strictEqual(this, context, 'defaults `context` to `callback` param');
}
}, context).trigger('a');
obj.off().on({
a: function() {
assert.strictEqual(this, context, 'will not override explicit `context` param');
}
}, this, context).trigger('a');
});
QUnit.test('listenTo and stopListening', function(assert) {
assert.expect(1);
test("listenTo and stopListening", 1, function() {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
a.listenTo(b, 'all', function(){ assert.ok(true); });
a.listenTo(b, 'all', function(){ ok(true); });
b.trigger('anything');
a.listenTo(b, 'all', function(){ assert.ok(false); });
a.listenTo(b, 'all', function(){ ok(false); });
a.stopListening();
b.trigger('anything');
});
QUnit.test('listenTo and stopListening with event maps', function(assert) {
assert.expect(4);
test("listenTo and stopListening with event maps", 4, function() {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
var cb = function(){ assert.ok(true); };
var cb = function(){ ok(true); };
a.listenTo(b, {event: cb});
b.trigger('event');
a.listenTo(b, {event2: cb});
@@ -141,11 +90,10 @@
b.trigger('event event2');
});
QUnit.test('stopListening with omitted args', function(assert) {
assert.expect(2);
test("stopListening with omitted args", 2, function () {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
var cb = function() { assert.ok(true); };
var cb = function () { ok(true); };
a.listenTo(b, 'event', cb);
b.on('event', cb);
a.listenTo(b, 'event2', cb);
@@ -158,237 +106,123 @@
b.trigger('event2');
});
QUnit.test('listenToOnce', function(assert) {
assert.expect(2);
// Same as the previous test, but we use once rather than having to explicitly unbind
var obj = {counterA: 0, counterB: 0};
_.extend(obj, Backbone.Events);
var incrA = function(){ obj.counterA += 1; obj.trigger('event'); };
var incrB = function(){ obj.counterB += 1; };
obj.listenToOnce(obj, 'event', incrA);
obj.listenToOnce(obj, 'event', incrB);
obj.trigger('event');
assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.');
assert.equal(obj.counterB, 1, 'counterB should have only been incremented once.');
});
QUnit.test('listenToOnce and stopListening', function(assert) {
assert.expect(1);
test("listenToOnce and stopListening", 1, function() {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
a.listenToOnce(b, 'all', function() { assert.ok(true); });
a.listenToOnce(b, 'all', function() { ok(true); });
b.trigger('anything');
b.trigger('anything');
a.listenToOnce(b, 'all', function() { assert.ok(false); });
a.listenToOnce(b, 'all', function() { ok(false); });
a.stopListening();
b.trigger('anything');
});
QUnit.test('listenTo, listenToOnce and stopListening', function(assert) {
assert.expect(1);
test("listenTo, listenToOnce and stopListening", 1, function() {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
a.listenToOnce(b, 'all', function() { assert.ok(true); });
a.listenToOnce(b, 'all', function() { ok(true); });
b.trigger('anything');
b.trigger('anything');
a.listenTo(b, 'all', function() { assert.ok(false); });
a.listenTo(b, 'all', function() { ok(false); });
a.stopListening();
b.trigger('anything');
});
QUnit.test('listenTo and stopListening with event maps', function(assert) {
assert.expect(1);
test("listenTo and stopListening with event maps", 1, function() {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
a.listenTo(b, {change: function(){ assert.ok(true); }});
a.listenTo(b, {change: function(){ ok(true); }});
b.trigger('change');
a.listenTo(b, {change: function(){ assert.ok(false); }});
a.listenTo(b, {change: function(){ ok(false); }});
a.stopListening();
b.trigger('change');
});
QUnit.test('listenTo yourself', function(assert) {
assert.expect(1);
test("listenTo yourself", 1, function(){
var e = _.extend({}, Backbone.Events);
e.listenTo(e, 'foo', function(){ assert.ok(true); });
e.trigger('foo');
e.listenTo(e, "foo", function(){ ok(true); });
e.trigger("foo");
});
QUnit.test('listenTo yourself cleans yourself up with stopListening', function(assert) {
assert.expect(1);
test("listenTo yourself cleans yourself up with stopListening", 1, function(){
var e = _.extend({}, Backbone.Events);
e.listenTo(e, 'foo', function(){ assert.ok(true); });
e.trigger('foo');
e.listenTo(e, "foo", function(){ ok(true); });
e.trigger("foo");
e.stopListening();
e.trigger('foo');
e.trigger("foo");
});
QUnit.test('stopListening cleans up references', function(assert) {
assert.expect(12);
test("stopListening cleans up references", 4, function() {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
var fn = function() {};
b.on('event', fn);
a.listenTo(b, 'event', fn).stopListening();
assert.equal(_.size(a._listeningTo), 0);
assert.equal(_.size(b._events.event), 1);
assert.equal(_.size(b._listeners), 0);
a.listenTo(b, 'event', fn).stopListening(b);
assert.equal(_.size(a._listeningTo), 0);
assert.equal(_.size(b._events.event), 1);
assert.equal(_.size(b._listeners), 0);
a.listenTo(b, 'event', fn).stopListening(b, 'event');
assert.equal(_.size(a._listeningTo), 0);
assert.equal(_.size(b._events.event), 1);
assert.equal(_.size(b._listeners), 0);
a.listenTo(b, 'event', fn).stopListening(b, 'event', fn);
assert.equal(_.size(a._listeningTo), 0);
assert.equal(_.size(b._events.event), 1);
assert.equal(_.size(b._listeners), 0);
a.listenTo(b, 'all', fn).stopListening();
equal(_.size(a._listeningTo), 0);
a.listenTo(b, 'all', fn).stopListening(b);
equal(_.size(a._listeningTo), 0);
a.listenTo(b, 'all', fn).stopListening(null, 'all');
equal(_.size(a._listeningTo), 0);
a.listenTo(b, 'all', fn).stopListening(null, null, fn);
equal(_.size(a._listeningTo), 0);
});
QUnit.test('stopListening cleans up references from listenToOnce', function(assert) {
assert.expect(12);
test("listenTo and stopListening cleaning up references", 2, function() {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
var fn = function() {};
b.on('event', fn);
a.listenToOnce(b, 'event', fn).stopListening();
assert.equal(_.size(a._listeningTo), 0);
assert.equal(_.size(b._events.event), 1);
assert.equal(_.size(b._listeners), 0);
a.listenToOnce(b, 'event', fn).stopListening(b);
assert.equal(_.size(a._listeningTo), 0);
assert.equal(_.size(b._events.event), 1);
assert.equal(_.size(b._listeners), 0);
a.listenToOnce(b, 'event', fn).stopListening(b, 'event');
assert.equal(_.size(a._listeningTo), 0);
assert.equal(_.size(b._events.event), 1);
assert.equal(_.size(b._listeners), 0);
a.listenToOnce(b, 'event', fn).stopListening(b, 'event', fn);
assert.equal(_.size(a._listeningTo), 0);
assert.equal(_.size(b._events.event), 1);
assert.equal(_.size(b._listeners), 0);
});
QUnit.test('listenTo and off cleaning up references', function(assert) {
assert.expect(8);
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
var fn = function() {};
a.listenTo(b, 'event', fn);
b.off();
assert.equal(_.size(a._listeningTo), 0);
assert.equal(_.size(b._listeners), 0);
a.listenTo(b, 'event', fn);
b.off('event');
assert.equal(_.size(a._listeningTo), 0);
assert.equal(_.size(b._listeners), 0);
a.listenTo(b, 'event', fn);
b.off(null, fn);
assert.equal(_.size(a._listeningTo), 0);
assert.equal(_.size(b._listeners), 0);
a.listenTo(b, 'event', fn);
b.off(null, null, a);
assert.equal(_.size(a._listeningTo), 0);
assert.equal(_.size(b._listeners), 0);
});
QUnit.test('listenTo and stopListening cleaning up references', function(assert) {
assert.expect(2);
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
a.listenTo(b, 'all', function(){ assert.ok(true); });
a.listenTo(b, 'all', function(){ ok(true); });
b.trigger('anything');
a.listenTo(b, 'other', function(){ assert.ok(false); });
a.listenTo(b, 'other', function(){ ok(false); });
a.stopListening(b, 'other');
a.stopListening(b, 'all');
assert.equal(_.size(a._listeningTo), 0);
equal(_.keys(a._listeningTo).length, 0);
});
QUnit.test('listenToOnce without context cleans up references after the event has fired', function(assert) {
assert.expect(2);
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
a.listenToOnce(b, 'all', function(){ assert.ok(true); });
b.trigger('anything');
assert.equal(_.size(a._listeningTo), 0);
});
QUnit.test('listenToOnce with event maps cleans up references', function(assert) {
assert.expect(2);
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
a.listenToOnce(b, {
one: function() { assert.ok(true); },
two: function() { assert.ok(false); }
});
b.trigger('one');
assert.equal(_.size(a._listeningTo), 1);
});
QUnit.test('listenToOnce with event maps binds the correct `this`', function(assert) {
assert.expect(1);
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
a.listenToOnce(b, {
one: function() { assert.ok(this === a); },
two: function() { assert.ok(false); }
});
b.trigger('one');
});
QUnit.test("listenTo with empty callback doesn't throw an error", function(assert) {
assert.expect(1);
test("listenTo with empty callback doesn't throw an error", 1, function(){
var e = _.extend({}, Backbone.Events);
e.listenTo(e, 'foo', null);
e.trigger('foo');
assert.ok(true);
e.listenTo(e, "foo", null);
e.trigger("foo");
ok(true);
});
QUnit.test('trigger all for each event', function(assert) {
assert.expect(3);
var a, b, obj = {counter: 0};
test("trigger all for each event", 3, function() {
var a, b, obj = { counter: 0 };
_.extend(obj, Backbone.Events);
obj.on('all', function(event) {
obj.counter++;
if (event === 'a') a = true;
if (event === 'b') b = true;
if (event == 'a') a = true;
if (event == 'b') b = true;
})
.trigger('a b');
assert.ok(a);
assert.ok(b);
assert.equal(obj.counter, 2);
ok(a);
ok(b);
equal(obj.counter, 2);
});
QUnit.test('on, then unbind all functions', function(assert) {
assert.expect(1);
var obj = {counter: 0};
_.extend(obj, Backbone.Events);
test("on, then unbind all functions", 1, function() {
var obj = { counter: 0 };
_.extend(obj,Backbone.Events);
var callback = function() { obj.counter += 1; };
obj.on('event', callback);
obj.trigger('event');
obj.off('event');
obj.trigger('event');
assert.equal(obj.counter, 1, 'counter should have only been incremented once.');
equal(obj.counter, 1, 'counter should have only been incremented once.');
});
QUnit.test('bind two callbacks, unbind only one', function(assert) {
assert.expect(2);
var obj = {counterA: 0, counterB: 0};
_.extend(obj, Backbone.Events);
test("bind two callbacks, unbind only one", 2, function() {
var obj = { counterA: 0, counterB: 0 };
_.extend(obj,Backbone.Events);
var callback = function() { obj.counterA += 1; };
obj.on('event', callback);
obj.on('event', function() { obj.counterB += 1; });
obj.trigger('event');
obj.off('event', callback);
obj.trigger('event');
assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.');
assert.equal(obj.counterB, 2, 'counterB should have been incremented twice.');
equal(obj.counterA, 1, 'counterA should have only been incremented once.');
equal(obj.counterB, 2, 'counterB should have been incremented twice.');
});
QUnit.test('unbind a callback in the midst of it firing', function(assert) {
assert.expect(1);
test("unbind a callback in the midst of it firing", 1, function() {
var obj = {counter: 0};
_.extend(obj, Backbone.Events);
var callback = function() {
@@ -399,13 +233,12 @@
obj.trigger('event');
obj.trigger('event');
obj.trigger('event');
assert.equal(obj.counter, 1, 'the callback should have been unbound.');
equal(obj.counter, 1, 'the callback should have been unbound.');
});
QUnit.test('two binds that unbind themeselves', function(assert) {
assert.expect(2);
var obj = {counterA: 0, counterB: 0};
_.extend(obj, Backbone.Events);
test("two binds that unbind themeselves", 2, function() {
var obj = { counterA: 0, counterB: 0 };
_.extend(obj,Backbone.Events);
var incrA = function(){ obj.counterA += 1; obj.off('event', incrA); };
var incrB = function(){ obj.counterB += 1; obj.off('event', incrB); };
obj.on('event', incrA);
@@ -413,52 +246,49 @@
obj.trigger('event');
obj.trigger('event');
obj.trigger('event');
assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.');
assert.equal(obj.counterB, 1, 'counterB should have only been incremented once.');
equal(obj.counterA, 1, 'counterA should have only been incremented once.');
equal(obj.counterB, 1, 'counterB should have only been incremented once.');
});
QUnit.test('bind a callback with a supplied context', function(assert) {
assert.expect(1);
var TestClass = function() {
test("bind a callback with a supplied context", 1, function () {
var TestClass = function () {
return this;
};
TestClass.prototype.assertTrue = function() {
assert.ok(true, '`this` was bound to the callback');
TestClass.prototype.assertTrue = function () {
ok(true, '`this` was bound to the callback');
};
var obj = _.extend({}, Backbone.Events);
obj.on('event', function() { this.assertTrue(); }, new TestClass);
var obj = _.extend({},Backbone.Events);
obj.on('event', function () { this.assertTrue(); }, (new TestClass));
obj.trigger('event');
});
QUnit.test('nested trigger with unbind', function(assert) {
assert.expect(1);
var obj = {counter: 0};
test("nested trigger with unbind", 1, function () {
var obj = { counter: 0 };
_.extend(obj, Backbone.Events);
var incr1 = function(){ obj.counter += 1; obj.off('event', incr1); obj.trigger('event'); };
var incr2 = function(){ obj.counter += 1; };
obj.on('event', incr1);
obj.on('event', incr2);
obj.trigger('event');
assert.equal(obj.counter, 3, 'counter should have been incremented three times');
equal(obj.counter, 3, 'counter should have been incremented three times');
});
QUnit.test('callback list is not altered during trigger', function(assert) {
assert.expect(2);
test("callback list is not altered during trigger", 2, function () {
var counter = 0, obj = _.extend({}, Backbone.Events);
var incr = function(){ counter++; };
var incrOn = function(){ obj.on('event all', incr); };
var incrOff = function(){ obj.off('event all', incr); };
obj.on('event all', incrOn).trigger('event');
assert.equal(counter, 0, 'on does not alter callback list');
obj.off().on('event', incrOff).on('event all', incr).trigger('event');
assert.equal(counter, 2, 'off does not alter callback list');
obj.on('event', function(){ obj.on('event', incr).on('all', incr); })
.trigger('event');
equal(counter, 0, 'bind does not alter callback list');
obj.off()
.on('event', function(){ obj.off('event', incr).off('all', incr); })
.on('event', incr)
.on('all', incr)
.trigger('event');
equal(counter, 2, 'unbind does not alter callback list');
});
QUnit.test("#1282 - 'all' callback list is retrieved after each event.", function(assert) {
assert.expect(1);
test("#1282 - 'all' callback list is retrieved after each event.", 1, function() {
var counter = 0;
var obj = _.extend({}, Backbone.Events);
var incr = function(){ counter++; };
@@ -466,68 +296,61 @@
obj.on('y', incr).on('all', incr);
})
.trigger('x y');
assert.strictEqual(counter, 2);
strictEqual(counter, 2);
});
QUnit.test('if no callback is provided, `on` is a noop', function(assert) {
assert.expect(0);
test("if no callback is provided, `on` is a noop", 0, function() {
_.extend({}, Backbone.Events).on('test').trigger('test');
});
QUnit.test('if callback is truthy but not a function, `on` should throw an error just like jQuery', function(assert) {
assert.expect(1);
test("if callback is truthy but not a function, `on` should throw an error just like jQuery", 1, function() {
var view = _.extend({}, Backbone.Events).on('test', 'noop');
assert.raises(function() {
throws(function() {
view.trigger('test');
});
});
QUnit.test('remove all events for a specific context', function(assert) {
assert.expect(4);
test("remove all events for a specific context", 4, function() {
var obj = _.extend({}, Backbone.Events);
obj.on('x y all', function() { assert.ok(true); });
obj.on('x y all', function() { assert.ok(false); }, obj);
obj.on('x y all', function() { ok(true); });
obj.on('x y all', function() { ok(false); }, obj);
obj.off(null, null, obj);
obj.trigger('x y');
});
QUnit.test('remove all events for a specific callback', function(assert) {
assert.expect(4);
test("remove all events for a specific callback", 4, function() {
var obj = _.extend({}, Backbone.Events);
var success = function() { assert.ok(true); };
var fail = function() { assert.ok(false); };
var success = function() { ok(true); };
var fail = function() { ok(false); };
obj.on('x y all', success);
obj.on('x y all', fail);
obj.off(null, fail);
obj.trigger('x y');
});
QUnit.test('#1310 - off does not skip consecutive events', function(assert) {
assert.expect(0);
test("#1310 - off does not skip consecutive events", 0, function() {
var obj = _.extend({}, Backbone.Events);
obj.on('event', function() { assert.ok(false); }, obj);
obj.on('event', function() { assert.ok(false); }, obj);
obj.on('event', function() { ok(false); }, obj);
obj.on('event', function() { ok(false); }, obj);
obj.off(null, null, obj);
obj.trigger('event');
});
QUnit.test('once', function(assert) {
assert.expect(2);
test("once", 2, function() {
// Same as the previous test, but we use once rather than having to explicitly unbind
var obj = {counterA: 0, counterB: 0};
var obj = { counterA: 0, counterB: 0 };
_.extend(obj, Backbone.Events);
var incrA = function(){ obj.counterA += 1; obj.trigger('event'); };
var incrB = function(){ obj.counterB += 1; };
obj.once('event', incrA);
obj.once('event', incrB);
obj.trigger('event');
assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.');
assert.equal(obj.counterB, 1, 'counterB should have only been incremented once.');
equal(obj.counterA, 1, 'counterA should have only been incremented once.');
equal(obj.counterB, 1, 'counterB should have only been incremented once.');
});
QUnit.test('once variant one', function(assert) {
assert.expect(3);
var f = function(){ assert.ok(true); };
test("once variant one", 3, function() {
var f = function(){ ok(true); };
var a = _.extend({}, Backbone.Events).once('event', f);
var b = _.extend({}, Backbone.Events).on('event', f);
@@ -538,9 +361,8 @@
b.trigger('event');
});
QUnit.test('once variant two', function(assert) {
assert.expect(3);
var f = function(){ assert.ok(true); };
test("once variant two", 3, function() {
var f = function(){ ok(true); };
var obj = _.extend({}, Backbone.Events);
obj
@@ -550,9 +372,8 @@
.trigger('event');
});
QUnit.test('once with off', function(assert) {
assert.expect(0);
var f = function(){ assert.ok(true); };
test("once with off", 0, function() {
var f = function(){ ok(true); };
var obj = _.extend({}, Backbone.Events);
obj.once('event', f);
@@ -560,8 +381,8 @@
obj.trigger('event');
});
QUnit.test('once with event maps', function(assert) {
var obj = {counter: 0};
test("once with event maps", function() {
var obj = { counter: 0 };
_.extend(obj, Backbone.Events);
var increment = function() {
@@ -575,107 +396,82 @@
}, obj);
obj.trigger('a');
assert.equal(obj.counter, 1);
equal(obj.counter, 1);
obj.trigger('a b');
assert.equal(obj.counter, 2);
equal(obj.counter, 2);
obj.trigger('c');
assert.equal(obj.counter, 3);
equal(obj.counter, 3);
obj.trigger('a b c');
assert.equal(obj.counter, 3);
equal(obj.counter, 3);
});
QUnit.test('once with off only by context', function(assert) {
assert.expect(0);
test("once with off only by context", 0, function() {
var context = {};
var obj = _.extend({}, Backbone.Events);
obj.once('event', function(){ assert.ok(false); }, context);
obj.once('event', function(){ ok(false); }, context);
obj.off(null, null, context);
obj.trigger('event');
});
QUnit.test('Backbone object inherits Events', function(assert) {
assert.ok(Backbone.on === Backbone.Events.on);
test("Backbone object inherits Events", function() {
ok(Backbone.on === Backbone.Events.on);
});
QUnit.test('once with asynchronous events', function(assert) {
var done = assert.async();
assert.expect(1);
var func = _.debounce(function() { assert.ok(true); done(); }, 50);
asyncTest("once with asynchronous events", 1, function() {
var func = _.debounce(function() { ok(true); start(); }, 50);
var obj = _.extend({}, Backbone.Events).once('async', func);
obj.trigger('async');
obj.trigger('async');
});
QUnit.test('once with multiple events.', function(assert) {
assert.expect(2);
test("once with multiple events.", 2, function() {
var obj = _.extend({}, Backbone.Events);
obj.once('x y', function() { assert.ok(true); });
obj.once('x y', function() { ok(true); });
obj.trigger('x y');
});
QUnit.test('Off during iteration with once.', function(assert) {
assert.expect(2);
test("Off during iteration with once.", 2, function() {
var obj = _.extend({}, Backbone.Events);
var f = function(){ this.off('event', f); };
obj.on('event', f);
obj.once('event', function(){});
obj.on('event', function(){ assert.ok(true); });
obj.on('event', function(){ ok(true); });
obj.trigger('event');
obj.trigger('event');
});
QUnit.test('`once` on `all` should work as expected', function(assert) {
assert.expect(1);
test("`once` on `all` should work as expected", 1, function() {
Backbone.once('all', function() {
assert.ok(true);
ok(true);
Backbone.trigger('all');
});
Backbone.trigger('all');
});
QUnit.test('once without a callback is a noop', function(assert) {
assert.expect(0);
test("once without a callback is a noop", 0, function() {
_.extend({}, Backbone.Events).once('event').trigger('event');
});
QUnit.test('listenToOnce without a callback is a noop', function(assert) {
assert.expect(0);
var obj = _.extend({}, Backbone.Events);
obj.listenToOnce(obj, 'event').trigger('event');
});
QUnit.test('event functions are chainable', function(assert) {
test("event functions are chainable", function() {
var obj = _.extend({}, Backbone.Events);
var obj2 = _.extend({}, Backbone.Events);
var fn = function() {};
assert.equal(obj, obj.trigger('noeventssetyet'));
assert.equal(obj, obj.off('noeventssetyet'));
assert.equal(obj, obj.stopListening('noeventssetyet'));
assert.equal(obj, obj.on('a', fn));
assert.equal(obj, obj.once('c', fn));
assert.equal(obj, obj.trigger('a'));
assert.equal(obj, obj.listenTo(obj2, 'a', fn));
assert.equal(obj, obj.listenToOnce(obj2, 'b', fn));
assert.equal(obj, obj.off('a c'));
assert.equal(obj, obj.stopListening(obj2, 'a'));
assert.equal(obj, obj.stopListening());
});
QUnit.test('#3448 - listenToOnce with space-separated events', function(assert) {
assert.expect(2);
var one = _.extend({}, Backbone.Events);
var two = _.extend({}, Backbone.Events);
var count = 1;
one.listenToOnce(two, 'x y', function(n) { assert.ok(n === count++); });
two.trigger('x', 1);
two.trigger('x', 1);
two.trigger('y', 2);
two.trigger('y', 2);
equal(obj, obj.trigger('noeventssetyet'));
equal(obj, obj.off('noeventssetyet'));
equal(obj, obj.stopListening('noeventssetyet'));
equal(obj, obj.on('a', fn));
equal(obj, obj.once('c', fn));
equal(obj, obj.trigger('a'));
equal(obj, obj.listenTo(obj2, 'a', fn));
equal(obj, obj.listenToOnce(obj2, 'b', fn));
equal(obj, obj.off('a c'));
equal(obj, obj.stopListening(obj2, 'a'));
equal(obj, obj.stopListening());
});
})();

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,12 @@
(function() {
QUnit.module('Backbone.noConflict');
module("Backbone.noConflict");
QUnit.test('noConflict', function(assert) {
assert.expect(2);
test('noConflict', 2, function() {
var noconflictBackbone = Backbone.noConflict();
assert.equal(window.Backbone, undefined, 'Returned window.Backbone');
equal(window.Backbone, undefined, 'Returned window.Backbone');
window.Backbone = noconflictBackbone;
assert.equal(window.Backbone, noconflictBackbone, 'Backbone is still pointing to the original Backbone');
equal(window.Backbone, noconflictBackbone, 'Backbone is still pointing to the original Backbone');
});
})();

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +0,0 @@
$('body').append(
'<div id="qunit"></div>' +
'<div id="qunit-fixture"></div>'
);

View File

@@ -1,239 +1,210 @@
(function() {
var Library = Backbone.Collection.extend({
url: function() { return '/library'; }
url : function() { return '/library'; }
});
var library;
var attrs = {
title: 'The Tempest',
author: 'Bill Shakespeare',
length: 123
title : "The Tempest",
author : "Bill Shakespeare",
length : 123
};
QUnit.module('Backbone.sync', {
module("Backbone.sync", {
beforeEach: function(assert) {
setup : function() {
library = new Library;
library.create(attrs, {wait: false});
},
afterEach: function(assert) {
teardown: function() {
Backbone.emulateHTTP = false;
}
});
QUnit.test('read', function(assert) {
assert.expect(4);
test("read", 4, function() {
library.fetch();
assert.equal(this.ajaxSettings.url, '/library');
assert.equal(this.ajaxSettings.type, 'GET');
assert.equal(this.ajaxSettings.dataType, 'json');
assert.ok(_.isEmpty(this.ajaxSettings.data));
equal(this.ajaxSettings.url, '/library');
equal(this.ajaxSettings.type, 'GET');
equal(this.ajaxSettings.dataType, 'json');
ok(_.isEmpty(this.ajaxSettings.data));
});
QUnit.test('passing data', function(assert) {
assert.expect(3);
test("passing data", 3, function() {
library.fetch({data: {a: 'a', one: 1}});
assert.equal(this.ajaxSettings.url, '/library');
assert.equal(this.ajaxSettings.data.a, 'a');
assert.equal(this.ajaxSettings.data.one, 1);
equal(this.ajaxSettings.url, '/library');
equal(this.ajaxSettings.data.a, 'a');
equal(this.ajaxSettings.data.one, 1);
});
QUnit.test('create', function(assert) {
assert.expect(6);
assert.equal(this.ajaxSettings.url, '/library');
assert.equal(this.ajaxSettings.type, 'POST');
assert.equal(this.ajaxSettings.dataType, 'json');
test("create", 6, function() {
equal(this.ajaxSettings.url, '/library');
equal(this.ajaxSettings.type, 'POST');
equal(this.ajaxSettings.dataType, 'json');
var data = JSON.parse(this.ajaxSettings.data);
assert.equal(data.title, 'The Tempest');
assert.equal(data.author, 'Bill Shakespeare');
assert.equal(data.length, 123);
equal(data.title, 'The Tempest');
equal(data.author, 'Bill Shakespeare');
equal(data.length, 123);
});
QUnit.test('update', function(assert) {
assert.expect(7);
test("update", 7, function() {
library.first().save({id: '1-the-tempest', author: 'William Shakespeare'});
assert.equal(this.ajaxSettings.url, '/library/1-the-tempest');
assert.equal(this.ajaxSettings.type, 'PUT');
assert.equal(this.ajaxSettings.dataType, 'json');
equal(this.ajaxSettings.url, '/library/1-the-tempest');
equal(this.ajaxSettings.type, 'PUT');
equal(this.ajaxSettings.dataType, 'json');
var data = JSON.parse(this.ajaxSettings.data);
assert.equal(data.id, '1-the-tempest');
assert.equal(data.title, 'The Tempest');
assert.equal(data.author, 'William Shakespeare');
assert.equal(data.length, 123);
equal(data.id, '1-the-tempest');
equal(data.title, 'The Tempest');
equal(data.author, 'William Shakespeare');
equal(data.length, 123);
});
QUnit.test('update with emulateHTTP and emulateJSON', function(assert) {
assert.expect(7);
test("update with emulateHTTP and emulateJSON", 7, function() {
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
emulateHTTP: true,
emulateJSON: true
});
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
assert.equal(this.ajaxSettings.type, 'POST');
assert.equal(this.ajaxSettings.dataType, 'json');
assert.equal(this.ajaxSettings.data._method, 'PUT');
equal(this.ajaxSettings.url, '/library/2-the-tempest');
equal(this.ajaxSettings.type, 'POST');
equal(this.ajaxSettings.dataType, 'json');
equal(this.ajaxSettings.data._method, 'PUT');
var data = JSON.parse(this.ajaxSettings.data.model);
assert.equal(data.id, '2-the-tempest');
assert.equal(data.author, 'Tim Shakespeare');
assert.equal(data.length, 123);
equal(data.id, '2-the-tempest');
equal(data.author, 'Tim Shakespeare');
equal(data.length, 123);
});
QUnit.test('update with just emulateHTTP', function(assert) {
assert.expect(6);
test("update with just emulateHTTP", 6, function() {
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
emulateHTTP: true
});
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
assert.equal(this.ajaxSettings.type, 'POST');
assert.equal(this.ajaxSettings.contentType, 'application/json');
equal(this.ajaxSettings.url, '/library/2-the-tempest');
equal(this.ajaxSettings.type, 'POST');
equal(this.ajaxSettings.contentType, 'application/json');
var data = JSON.parse(this.ajaxSettings.data);
assert.equal(data.id, '2-the-tempest');
assert.equal(data.author, 'Tim Shakespeare');
assert.equal(data.length, 123);
equal(data.id, '2-the-tempest');
equal(data.author, 'Tim Shakespeare');
equal(data.length, 123);
});
QUnit.test('update with just emulateJSON', function(assert) {
assert.expect(6);
test("update with just emulateJSON", 6, function() {
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'}, {
emulateJSON: true
});
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
assert.equal(this.ajaxSettings.type, 'PUT');
assert.equal(this.ajaxSettings.contentType, 'application/x-www-form-urlencoded');
equal(this.ajaxSettings.url, '/library/2-the-tempest');
equal(this.ajaxSettings.type, 'PUT');
equal(this.ajaxSettings.contentType, 'application/x-www-form-urlencoded');
var data = JSON.parse(this.ajaxSettings.data.model);
assert.equal(data.id, '2-the-tempest');
assert.equal(data.author, 'Tim Shakespeare');
assert.equal(data.length, 123);
equal(data.id, '2-the-tempest');
equal(data.author, 'Tim Shakespeare');
equal(data.length, 123);
});
QUnit.test('read model', function(assert) {
assert.expect(3);
test("read model", 3, function() {
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
library.first().fetch();
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
assert.equal(this.ajaxSettings.type, 'GET');
assert.ok(_.isEmpty(this.ajaxSettings.data));
equal(this.ajaxSettings.url, '/library/2-the-tempest');
equal(this.ajaxSettings.type, 'GET');
ok(_.isEmpty(this.ajaxSettings.data));
});
QUnit.test('destroy', function(assert) {
assert.expect(3);
test("destroy", 3, function() {
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
library.first().destroy({wait: true});
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
assert.equal(this.ajaxSettings.type, 'DELETE');
assert.equal(this.ajaxSettings.data, null);
equal(this.ajaxSettings.url, '/library/2-the-tempest');
equal(this.ajaxSettings.type, 'DELETE');
equal(this.ajaxSettings.data, null);
});
QUnit.test('destroy with emulateHTTP', function(assert) {
assert.expect(3);
test("destroy with emulateHTTP", 3, function() {
library.first().save({id: '2-the-tempest', author: 'Tim Shakespeare'});
library.first().destroy({
emulateHTTP: true,
emulateJSON: true
});
assert.equal(this.ajaxSettings.url, '/library/2-the-tempest');
assert.equal(this.ajaxSettings.type, 'POST');
assert.equal(JSON.stringify(this.ajaxSettings.data), '{"_method":"DELETE"}');
equal(this.ajaxSettings.url, '/library/2-the-tempest');
equal(this.ajaxSettings.type, 'POST');
equal(JSON.stringify(this.ajaxSettings.data), '{"_method":"DELETE"}');
});
QUnit.test('urlError', function(assert) {
assert.expect(2);
test("urlError", 2, function() {
var model = new Backbone.Model();
assert.raises(function() {
raises(function() {
model.fetch();
});
model.fetch({url: '/one/two'});
assert.equal(this.ajaxSettings.url, '/one/two');
equal(this.ajaxSettings.url, '/one/two');
});
QUnit.test('#1052 - `options` is optional.', function(assert) {
assert.expect(0);
test("#1052 - `options` is optional.", 0, function() {
var model = new Backbone.Model();
model.url = '/test';
Backbone.sync('create', model);
});
QUnit.test('Backbone.ajax', function(assert) {
assert.expect(1);
test("Backbone.ajax", 1, function() {
Backbone.ajax = function(settings){
assert.strictEqual(settings.url, '/test');
strictEqual(settings.url, '/test');
};
var model = new Backbone.Model();
model.url = '/test';
Backbone.sync('create', model);
});
QUnit.test('Call provided error callback on error.', function(assert) {
assert.expect(1);
test("Call provided error callback on error.", 1, function() {
var model = new Backbone.Model;
model.url = '/test';
Backbone.sync('read', model, {
error: function() { assert.ok(true); }
error: function() { ok(true); }
});
this.ajaxSettings.error();
});
QUnit.test('Use Backbone.emulateHTTP as default.', function(assert) {
assert.expect(2);
test('Use Backbone.emulateHTTP as default.', 2, function() {
var model = new Backbone.Model;
model.url = '/test';
Backbone.emulateHTTP = true;
model.sync('create', model);
assert.strictEqual(this.ajaxSettings.emulateHTTP, true);
strictEqual(this.ajaxSettings.emulateHTTP, true);
Backbone.emulateHTTP = false;
model.sync('create', model);
assert.strictEqual(this.ajaxSettings.emulateHTTP, false);
strictEqual(this.ajaxSettings.emulateHTTP, false);
});
QUnit.test('Use Backbone.emulateJSON as default.', function(assert) {
assert.expect(2);
test('Use Backbone.emulateJSON as default.', 2, function() {
var model = new Backbone.Model;
model.url = '/test';
Backbone.emulateJSON = true;
model.sync('create', model);
assert.strictEqual(this.ajaxSettings.emulateJSON, true);
strictEqual(this.ajaxSettings.emulateJSON, true);
Backbone.emulateJSON = false;
model.sync('create', model);
assert.strictEqual(this.ajaxSettings.emulateJSON, false);
strictEqual(this.ajaxSettings.emulateJSON, false);
});
QUnit.test('#1756 - Call user provided beforeSend function.', function(assert) {
assert.expect(4);
test("#1756 - Call user provided beforeSend function.", 4, function() {
Backbone.emulateHTTP = true;
var model = new Backbone.Model;
model.url = '/test';
var xhr = {
setRequestHeader: function(header, value) {
assert.strictEqual(header, 'X-HTTP-Method-Override');
assert.strictEqual(value, 'DELETE');
strictEqual(header, 'X-HTTP-Method-Override');
strictEqual(value, 'DELETE');
}
};
model.sync('delete', model, {
beforeSend: function(_xhr) {
assert.ok(_xhr === xhr);
ok(_xhr === xhr);
return false;
}
});
assert.strictEqual(this.ajaxSettings.beforeSend(xhr), false);
});
QUnit.test('#2928 - Pass along `textStatus` and `errorThrown`.', function(assert) {
assert.expect(2);
var model = new Backbone.Model;
model.url = '/test';
model.on('error', function(m, xhr, options) {
assert.strictEqual(options.textStatus, 'textStatus');
assert.strictEqual(options.errorThrown, 'errorThrown');
});
model.fetch();
this.ajaxSettings.error({}, 'textStatus', 'errorThrown');
strictEqual(this.ajaxSettings.beforeSend(xhr), false);
});
})();

View File

@@ -2,109 +2,67 @@
var view;
QUnit.module('Backbone.View', {
beforeEach: function(assert) {
$('#qunit-fixture').append(
'<div id="testElement"><h1>Test</h1></div>'
);
module("Backbone.View", {
setup: function() {
view = new Backbone.View({
id: 'test-view',
className: 'test-view',
other: 'non-special-option'
id : 'test-view',
className : 'test-view',
other : 'non-special-option'
});
}
});
QUnit.test('constructor', function(assert) {
assert.expect(3);
assert.equal(view.el.id, 'test-view');
assert.equal(view.el.className, 'test-view');
assert.equal(view.el.other, void 0);
test("constructor", 3, function() {
equal(view.el.id, 'test-view');
equal(view.el.className, 'test-view');
equal(view.el.other, void 0);
});
QUnit.test('$', function(assert) {
assert.expect(2);
var myView = new Backbone.View;
myView.setElement('<p><a><b>test</b></a></p>');
var result = myView.$('a b');
assert.strictEqual(result[0].innerHTML, 'test');
assert.ok(result.length === +result.length);
test("jQuery", 1, function() {
var view = new Backbone.View;
view.setElement('<p><a><b>test</b></a></p>');
strictEqual(view.$('a b').html(), 'test');
});
QUnit.test('$el', function(assert) {
assert.expect(3);
var myView = new Backbone.View;
myView.setElement('<p><a><b>test</b></a></p>');
assert.strictEqual(myView.el.nodeType, 1);
assert.ok(myView.$el instanceof Backbone.$);
assert.strictEqual(myView.$el[0], myView.el);
});
QUnit.test('initialize', function(assert) {
assert.expect(1);
test("initialize", 1, function() {
var View = Backbone.View.extend({
initialize: function() {
this.one = 1;
}
});
assert.strictEqual(new View().one, 1);
strictEqual(new View().one, 1);
});
QUnit.test('render', function(assert) {
assert.expect(1);
var myView = new Backbone.View;
assert.equal(myView.render(), myView, '#render returns the view instance');
});
QUnit.test('delegateEvents', function(assert) {
assert.expect(6);
test("delegateEvents", 6, function() {
var counter1 = 0, counter2 = 0;
var myView = new Backbone.View({el: '#testElement'});
myView.increment = function(){ counter1++; };
myView.$el.on('click', function(){ counter2++; });
var view = new Backbone.View({el: '<p><a id="test"></a></p>'});
view.increment = function(){ counter1++; };
view.$el.on('click', function(){ counter2++; });
var events = {'click h1': 'increment'};
var events = {'click #test': 'increment'};
myView.delegateEvents(events);
myView.$('h1').trigger('click');
assert.equal(counter1, 1);
assert.equal(counter2, 1);
view.delegateEvents(events);
view.$('#test').trigger('click');
equal(counter1, 1);
equal(counter2, 1);
myView.$('h1').trigger('click');
assert.equal(counter1, 2);
assert.equal(counter2, 2);
view.$('#test').trigger('click');
equal(counter1, 2);
equal(counter2, 2);
myView.delegateEvents(events);
myView.$('h1').trigger('click');
assert.equal(counter1, 3);
assert.equal(counter2, 3);
view.delegateEvents(events);
view.$('#test').trigger('click');
equal(counter1, 3);
equal(counter2, 3);
});
QUnit.test('delegate', function(assert) {
assert.expect(3);
var myView = new Backbone.View({el: '#testElement'});
myView.delegate('click', 'h1', function() {
assert.ok(true);
});
myView.delegate('click', function() {
assert.ok(true);
});
myView.$('h1').trigger('click');
assert.equal(myView.delegate(), myView, '#delegate returns the view instance');
});
QUnit.test('delegateEvents allows functions for callbacks', function(assert) {
assert.expect(3);
var myView = new Backbone.View({el: '<p></p>'});
myView.counter = 0;
test("delegateEvents allows functions for callbacks", 3, function() {
var view = new Backbone.View({el: '<p></p>'});
view.counter = 0;
var events = {
click: function() {
@@ -112,148 +70,76 @@
}
};
myView.delegateEvents(events);
myView.$el.trigger('click');
assert.equal(myView.counter, 1);
view.delegateEvents(events);
view.$el.trigger('click');
equal(view.counter, 1);
myView.$el.trigger('click');
assert.equal(myView.counter, 2);
view.$el.trigger('click');
equal(view.counter, 2);
myView.delegateEvents(events);
myView.$el.trigger('click');
assert.equal(myView.counter, 3);
view.delegateEvents(events);
view.$el.trigger('click');
equal(view.counter, 3);
});
QUnit.test('delegateEvents ignore undefined methods', function(assert) {
assert.expect(0);
var myView = new Backbone.View({el: '<p></p>'});
myView.delegateEvents({'click': 'undefinedMethod'});
myView.$el.trigger('click');
test("delegateEvents ignore undefined methods", 0, function() {
var view = new Backbone.View({el: '<p></p>'});
view.delegateEvents({'click': 'undefinedMethod'});
view.$el.trigger('click');
});
QUnit.test('undelegateEvents', function(assert) {
assert.expect(7);
test("undelegateEvents", 6, function() {
var counter1 = 0, counter2 = 0;
var myView = new Backbone.View({el: '#testElement'});
myView.increment = function(){ counter1++; };
myView.$el.on('click', function(){ counter2++; });
var view = new Backbone.View({el: '<p><a id="test"></a></p>'});
view.increment = function(){ counter1++; };
view.$el.on('click', function(){ counter2++; });
var events = {'click h1': 'increment'};
var events = {'click #test': 'increment'};
myView.delegateEvents(events);
myView.$('h1').trigger('click');
assert.equal(counter1, 1);
assert.equal(counter2, 1);
view.delegateEvents(events);
view.$('#test').trigger('click');
equal(counter1, 1);
equal(counter2, 1);
myView.undelegateEvents();
myView.$('h1').trigger('click');
assert.equal(counter1, 1);
assert.equal(counter2, 2);
view.undelegateEvents();
view.$('#test').trigger('click');
equal(counter1, 1);
equal(counter2, 2);
myView.delegateEvents(events);
myView.$('h1').trigger('click');
assert.equal(counter1, 2);
assert.equal(counter2, 3);
assert.equal(myView.undelegateEvents(), myView, '#undelegateEvents returns the view instance');
view.delegateEvents(events);
view.$('#test').trigger('click');
equal(counter1, 2);
equal(counter2, 3);
});
QUnit.test('undelegate', function(assert) {
assert.expect(1);
var myView = new Backbone.View({el: '#testElement'});
myView.delegate('click', function() { assert.ok(false); });
myView.delegate('click', 'h1', function() { assert.ok(false); });
myView.undelegate('click');
myView.$('h1').trigger('click');
myView.$el.trigger('click');
assert.equal(myView.undelegate(), myView, '#undelegate returns the view instance');
});
QUnit.test('undelegate with passed handler', function(assert) {
assert.expect(1);
var myView = new Backbone.View({el: '#testElement'});
var listener = function() { assert.ok(false); };
myView.delegate('click', listener);
myView.delegate('click', function() { assert.ok(true); });
myView.undelegate('click', listener);
myView.$el.trigger('click');
});
QUnit.test('undelegate with selector', function(assert) {
assert.expect(2);
var myView = new Backbone.View({el: '#testElement'});
myView.delegate('click', function() { assert.ok(true); });
myView.delegate('click', 'h1', function() { assert.ok(false); });
myView.undelegate('click', 'h1');
myView.$('h1').trigger('click');
myView.$el.trigger('click');
});
QUnit.test('undelegate with handler and selector', function(assert) {
assert.expect(2);
var myView = new Backbone.View({el: '#testElement'});
myView.delegate('click', function() { assert.ok(true); });
var handler = function(){ assert.ok(false); };
myView.delegate('click', 'h1', handler);
myView.undelegate('click', 'h1', handler);
myView.$('h1').trigger('click');
myView.$el.trigger('click');
});
QUnit.test('tagName can be provided as a string', function(assert) {
assert.expect(1);
var View = Backbone.View.extend({
tagName: 'span'
});
assert.equal(new View().el.tagName, 'SPAN');
});
QUnit.test('tagName can be provided as a function', function(assert) {
assert.expect(1);
var View = Backbone.View.extend({
tagName: function() {
return 'p';
}
});
assert.ok(new View().$el.is('p'));
});
QUnit.test('_ensureElement with DOM node el', function(assert) {
assert.expect(1);
test("_ensureElement with DOM node el", 1, function() {
var View = Backbone.View.extend({
el: document.body
});
assert.equal(new View().el, document.body);
equal(new View().el, document.body);
});
QUnit.test('_ensureElement with string el', function(assert) {
assert.expect(3);
test("_ensureElement with string el", 3, function() {
var View = Backbone.View.extend({
el: 'body'
el: "body"
});
assert.strictEqual(new View().el, document.body);
strictEqual(new View().el, document.body);
View = Backbone.View.extend({
el: '#testElement > h1'
el: "#testElement > h1"
});
assert.strictEqual(new View().el, $('#testElement > h1').get(0));
strictEqual(new View().el, $("#testElement > h1").get(0));
View = Backbone.View.extend({
el: '#nonexistent'
el: "#nonexistent"
});
assert.ok(!new View().el);
ok(!new View().el);
});
QUnit.test('with className and id functions', function(assert) {
assert.expect(2);
test("with className and id functions", 2, function() {
var View = Backbone.View.extend({
className: function() {
return 'className';
@@ -263,54 +149,33 @@
}
});
assert.strictEqual(new View().el.className, 'className');
assert.strictEqual(new View().el.id, 'id');
strictEqual(new View().el.className, 'className');
strictEqual(new View().el.id, 'id');
});
QUnit.test('with attributes', function(assert) {
assert.expect(2);
test("with attributes", 2, function() {
var View = Backbone.View.extend({
attributes: {
'id': 'id',
id: 'id',
'class': 'class'
}
});
assert.strictEqual(new View().el.className, 'class');
assert.strictEqual(new View().el.id, 'id');
strictEqual(new View().el.className, 'class');
strictEqual(new View().el.id, 'id');
});
QUnit.test('with attributes as a function', function(assert) {
assert.expect(1);
test("with attributes as a function", 1, function() {
var View = Backbone.View.extend({
attributes: function() {
return {'class': 'dynamic'};
}
});
assert.strictEqual(new View().el.className, 'dynamic');
strictEqual(new View().el.className, 'dynamic');
});
QUnit.test('should default to className/id properties', function(assert) {
assert.expect(4);
var View = Backbone.View.extend({
className: 'backboneClass',
id: 'backboneId',
attributes: {
'class': 'attributeClass',
'id': 'attributeId'
}
});
var myView = new View;
assert.strictEqual(myView.el.className, 'backboneClass');
assert.strictEqual(myView.el.id, 'backboneId');
assert.strictEqual(myView.$el.attr('class'), 'backboneClass');
assert.strictEqual(myView.$el.attr('id'), 'backboneId');
});
QUnit.test('multiple views per element', function(assert) {
assert.expect(3);
test("multiple views per element", 3, function() {
var count = 0;
var $el = $('<p></p>');
@@ -324,167 +189,143 @@
});
var view1 = new View;
$el.trigger('click');
assert.equal(1, count);
$el.trigger("click");
equal(1, count);
var view2 = new View;
$el.trigger('click');
assert.equal(3, count);
$el.trigger("click");
equal(3, count);
view1.delegateEvents();
$el.trigger('click');
assert.equal(5, count);
$el.trigger("click");
equal(5, count);
});
QUnit.test('custom events', function(assert) {
assert.expect(2);
test("custom events, with namespaces", 2, function() {
var count = 0;
var View = Backbone.View.extend({
el: $('body'),
events: {
fake$event: function() { assert.ok(true); }
events: function() {
return {"fake$event.namespaced": "run"};
},
run: function() {
count++;
}
});
var myView = new View;
var view = new View;
$('body').trigger('fake$event').trigger('fake$event');
equal(count, 2);
$('body').off('fake$event');
$('body').unbind('.namespaced');
$('body').trigger('fake$event');
equal(count, 2);
});
QUnit.test('#1048 - setElement uses provided object.', function(assert) {
assert.expect(2);
test("#1048 - setElement uses provided object.", 2, function() {
var $el = $('body');
var myView = new Backbone.View({el: $el});
assert.ok(myView.$el === $el);
var view = new Backbone.View({el: $el});
ok(view.$el === $el);
myView.setElement($el = $($el));
assert.ok(myView.$el === $el);
view.setElement($el = $($el));
ok(view.$el === $el);
});
QUnit.test('#986 - Undelegate before changing element.', function(assert) {
assert.expect(1);
test("#986 - Undelegate before changing element.", 1, function() {
var button1 = $('<button></button>');
var button2 = $('<button></button>');
var View = Backbone.View.extend({
events: {
click: function(e) {
assert.ok(myView.el === e.target);
ok(view.el === e.target);
}
}
});
var myView = new View({el: button1});
myView.setElement(button2);
var view = new View({el: button1});
view.setElement(button2);
button1.trigger('click');
button2.trigger('click');
});
QUnit.test('#1172 - Clone attributes object', function(assert) {
assert.expect(2);
test("#1172 - Clone attributes object", 2, function() {
var View = Backbone.View.extend({
attributes: {foo: 'bar'}
});
var view1 = new View({id: 'foo'});
assert.strictEqual(view1.el.id, 'foo');
strictEqual(view1.el.id, 'foo');
var view2 = new View();
assert.ok(!view2.el.id);
ok(!view2.el.id);
});
QUnit.test('views stopListening', function(assert) {
assert.expect(0);
test("#1228 - tagName can be provided as a function", 1, function() {
var View = Backbone.View.extend({
initialize: function() {
this.listenTo(this.model, 'all x', function(){ assert.ok(false); });
this.listenTo(this.collection, 'all x', function(){ assert.ok(false); });
tagName: function() {
return 'p';
}
});
var myView = new View({
ok(new View().$el.is('p'));
});
test("views stopListening", 0, function() {
var View = Backbone.View.extend({
initialize: function() {
this.listenTo(this.model, 'all x', function(){ ok(false); }, this);
this.listenTo(this.collection, 'all x', function(){ ok(false); }, this);
}
});
var view = new View({
model: new Backbone.Model,
collection: new Backbone.Collection
});
myView.stopListening();
myView.model.trigger('x');
myView.collection.trigger('x');
view.stopListening();
view.model.trigger('x');
view.collection.trigger('x');
});
QUnit.test('Provide function for el.', function(assert) {
assert.expect(2);
test("Provide function for el.", 2, function() {
var View = Backbone.View.extend({
el: function() {
return '<p><a></a></p>';
return "<p><a></a></p>";
}
});
var myView = new View;
assert.ok(myView.$el.is('p'));
assert.ok(myView.$el.has('a'));
var view = new View;
ok(view.$el.is('p'));
ok(view.$el.has('a'));
});
QUnit.test('events passed in options', function(assert) {
assert.expect(1);
test("events passed in options", 2, function() {
var counter = 0;
var View = Backbone.View.extend({
el: '#testElement',
el: '<p><a id="test"></a></p>',
increment: function() {
counter++;
}
});
var myView = new View({
events: {
'click h1': 'increment'
}
});
var view = new View({events:{'click #test':'increment'}});
var view2 = new View({events:function(){
return {'click #test':'increment'};
}});
myView.$('h1').trigger('click').trigger('click');
assert.equal(counter, 2);
});
view.$('#test').trigger('click');
view2.$('#test').trigger('click');
equal(counter, 2);
QUnit.test('remove', function(assert) {
assert.expect(2);
var myView = new Backbone.View;
document.body.appendChild(view.el);
myView.delegate('click', function() { assert.ok(false); });
myView.listenTo(myView, 'all x', function() { assert.ok(false); });
assert.equal(myView.remove(), myView, '#remove returns the view instance');
myView.$el.trigger('click');
myView.trigger('x');
// In IE8 and below, parentNode still exists but is not document.body.
assert.notEqual(myView.el.parentNode, document.body);
});
QUnit.test('setElement', function(assert) {
assert.expect(3);
var myView = new Backbone.View({
events: {
click: function() { assert.ok(false); }
}
});
myView.events = {
click: function() { assert.ok(true); }
};
var oldEl = myView.el;
var $oldEl = myView.$el;
myView.setElement(document.createElement('div'));
$oldEl.click();
myView.$el.click();
assert.notEqual(oldEl, myView.el);
assert.notEqual($oldEl, myView.$el);
view.$('#test').trigger('click');
view2.$('#test').trigger('click');
equal(counter, 4);
});
})();

22
vendor/benchmark.js/LICENSE.txt vendored Normal file
View File

@@ -0,0 +1,22 @@
Copyright 2010-2013 Mathias Bynens <http://mathiasbynens.be/>
Based on JSLitmus.js, copyright Robert Kieffer <http://broofa.com/>
Modified by John-David Dalton <http://allyoucanleet.com/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

2864
vendor/benchmark.js/benchmark.js vendored Normal file

File diff suppressed because it is too large Load Diff

BIN
vendor/benchmark.js/nano.jar vendored Normal file

Binary file not shown.

24
vendor/curl/LICENSE.txt vendored Normal file
View File

@@ -0,0 +1,24 @@
Open Source Initiative OSI - The MIT License
http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2010-2013 Brian Cavalier and John Hann
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,48 @@
(function(){/*
MIT License (c) copyright 2010-2013 B Cavalier & J Hann MIT (c) copyright 2010-2013 B Cavalier & J Hann */
(function(f){function k(){}function g(a,e){return 0==T.call(a).indexOf("[object "+e)}function n(a){return a&&"/"==a.charAt(a.length-1)?a.substr(0,a.length-1):a}function d(a,e){var l,h,D,m;l=1;h=a;"."==h.charAt(0)&&(D=!0,h=h.replace(U,function(a,e,h,D){h&&l++;return D||""}));if(D){D=e.split("/");m=D.length-l;if(0>m)return a;D.splice(m,l);return D.concat(h||[]).join("/")}return h}function s(a){var e=a.indexOf("!");return{g:a.substr(e+1),d:0<=e&&a.substr(0,e)}}function v(){}function q(a,e){v.prototype=
a||Q;var l=new v;v.prototype=Q;for(var h in e)l[h]=e[h];return l}function y(){function a(a,e,l){h.push([a,e,l])}function e(a,e){for(var l,D=0;l=h[D++];)(l=l[a])&&l(e)}var l,h,D;l=this;h=[];D=function(l,m){a=l?function(a){a&&a(m)}:function(a,e){e&&e(m)};D=k;e(l?0:1,m);e=k;h=G};this.l=function(e,h,D){a(e,h,D);return l};this.k=function(a){l.H=a;D(!0,a)};this.e=function(a){l.Ba=a;D(!1,a)};this.F=function(a){e(2,a)}}function x(a){return a instanceof y||a instanceof u}function r(a,e,l,h){x(a)?a.l(e,l,h):
e(a)}function w(a,e,l){var h;return function(){0<=--a&&e&&(h=e.apply(G,arguments));0==a&&l&&l(h);return h}}function b(){var a,e;p="";a=[].slice.call(arguments);g(a[0],"Object")&&(e=a.shift(),e=c(e));return new u(a[0],a[1],a[2],e)}function c(a,e,l){var h;p="";if(a&&(t.V(a),E=t.b(a),"preloads"in a&&(h=new u(a.preloads,G,l,J,!0),t.n(function(){J=h})),a=a.main))return new u(a,e,l)}function u(a,e,l,h,D){var m;m=t.i(E,G,[].concat(a),D);this.then=this.l=a=function(a,e){r(m,function(e){a&&a.apply(G,e)},function(a){if(e)e(a);
else throw a;});return this};this.next=function(a,e,h){return new u(a,e,h,m)};this.config=c;(e||l)&&a(e,l);t.n(function(){r(D||J,function(){r(h,function(){t.A(m)},l)})})}function z(a){var e,l;e=a.id;e==G&&(K!==G?K={L:"Multiple anonymous defines encountered"}:(e=t.ja())||(K=a));if(e!=G){l=F[e];e in F||(l=t.o(e,E),l=t.I(l.b,e),F[e]=l);if(!x(l))throw Error("duplicate define: "+e);l.oa=!1;t.J(l,a)}}function A(){var a=t.ga(arguments);z(a)}var p,E,C,H,B=f.document,L=B&&(B.head||B.getElementsByTagName("head")[0]),
N=L&&L.getElementsByTagName("base")[0]||null,M={},I={},m={},V="addEventListener"in f?{}:{loaded:1,complete:1},Q={},T=Q.toString,G,F={},O={},J=!1,K,S=/^\/|^[^:]+:\/\//,U=/(\.)(\.?)(?:$|\/([^\.\/]+.*)?)/g,W=/\/\*[\s\S]*?\*\/|\/\/.*?[\n\r]/g,X=/require\s*\(\s*(["'])(.*?[^\\])\1\s*\)|[^\\]?(["'])/g,Y=/\s*,\s*/,R,t;t={t:function(a,e,l){var h;a=d(a,e);if("."==a.charAt(0))return a;h=s(a);a=(e=h.d)||h.g;a in l.c&&(a=l.c[a].Q||a);e&&(0>e.indexOf("/")&&!(e in l.c)&&(a=n(l.T)+"/"+e),a=a+"!"+h.g);return a},i:function(a,
e,l,h){function m(e,h){var l,c;l=t.t(e,b.id,a);if(!h)return l;c=s(l);if(!c.d)return l;l=F[c.d];c.g="normalize"in l?l.normalize(c.g,m,b.b)||"":m(c.g);return c.d+"!"+c.g}function c(e,l,d){var s;s=l&&function(a){l.apply(G,a)};if(g(e,"String")){if(s)throw Error("require(id, callback) not allowed");d=m(e,!0);e=F[d];if(!(d in F))throw Error("Module not resolved: "+d);return(d=x(e)&&e.a)||e}r(t.A(t.i(a,b.id,e,h)),s,d)}var b;b=new y;b.id=e||"";b.ka=h;b.K=l;b.b=a;b.s=c;c.toUrl=function(e){return t.o(m(e,!0),
a).url};b.t=m;return b},I:function(a,e,l){var h,m,c;h=t.i(a,e,G,l);m=h.k;c=w(1,function(a){h.w=a;try{return t.ba(h)}catch(e){h.e(e)}});h.k=function(a){r(l||J,function(){m(F[h.id]=O[h.url]=c(a))})};h.M=function(a){r(l||J,function(){h.a&&(c(a),h.F(I))})};return h},$:function(a,e,l,h){return t.i(a,l,G,h)},ia:function(a){return a.s},O:function(a){return a.a||(a.a={})},ha:function(a){var e=a.B;e||(e=a.B={id:a.id,uri:t.P(a),exports:t.O(a),config:function(){return a.b}},e.a=e.exports);return e},P:function(a){return a.url||
(a.url=t.u(a.s.toUrl(a.id),a.b))},V:function(a){var e,l,h,m,c;e="curl";l="define";h=m=f;if(a&&(c=a.overwriteApi||a.ya,e=a.apiName||a.qa||e,h=a.apiContext||a.pa||h,l=a.defineName||a.ua||l,m=a.defineContext||a.ta||m,C&&g(C,"Function")&&(f.curl=C),C=null,H&&g(H,"Function")&&(f.define=H),H=null,!c)){if(h[e]&&h[e]!=b)throw Error(e+" already exists");if(m[l]&&m[l]!=A)throw Error(l+" already exists");}h[e]=b;m[l]=A},b:function(a){function e(a,e){var l,h,b,p,f;for(f in a){b=a[f];g(b,"String")&&(b={path:a[f]});
b.name=b.name||f;p=m;h=s(n(b.name));l=h.g;if(h=h.d)p=c[h],p||(p=c[h]=q(m),p.c=q(m.c),p.f=[]),delete a[f];h=b;var k=e,r=void 0;h.path=n(h.path||h.location||"");k&&(r=h.main||"./main","."==r.charAt(0)||(r="./"+r),h.Q=d(r,h.name+"/"));h.b=h.config;h.b&&(h.b=q(m,h.b));h.W=l.split("/").length;l?(p.c[l]=h,p.f.push(l)):p.p=t.U(b.path,m)}}function l(a){var e=a.c;a.S=RegExp("^("+a.f.sort(function(a,h){return e[h].W-e[a].W}).join("|").replace(/\/|\./g,"\\$&")+")(?=\\/|$)");delete a.f}var h,m,c,b;"baseUrl"in
a&&(a.p=a.baseUrl);"main"in a&&(a.Q=a.main);"preloads"in a&&(a.za=a.preloads);"pluginPath"in a&&(a.T=a.pluginPath);if("dontAddFileExt"in a||a.j)a.j=RegExp(a.dontAddFileExt||a.j);h=E;m=q(h,a);m.c=q(h.c);c=a.plugins||{};m.plugins=q(h.plugins);m.D=q(h.D,a.D);m.C=q(h.C,a.C);m.f=[];e(a.packages,!0);e(a.paths,!1);for(b in c)a=t.t(b+"!","",m),m.plugins[a.substr(0,a.length-1)]=c[b];c=m.plugins;for(b in c)if(c[b]=q(m,c[b]),a=c[b].f)c[b].f=a.concat(m.f),l(c[b]);for(b in h.c)m.c.hasOwnProperty(b)||m.f.push(b);
l(m);return m},o:function(a,e){var m,h,b,c;m=e.c;b=S.test(a)?a:a.replace(e.S,function(a){h=m[a]||{};c=h.b;return h.path||""});return{b:c||E,url:t.U(b,e)}},U:function(a,e){var m=e.p;return m&&!S.test(a)?n(m)+"/"+a:a},u:function(a,e){return a+((e||E).j.test(a)?"":".js")},m:function(a,e,l){var h=B.createElement("script");h.onload=h.onreadystatechange=function(l){l=l||f.event;if("load"==l.type||V[h.readyState])delete m[a.id],h.onload=h.onreadystatechange=h.onerror="",e()};h.onerror=function(){l(Error("Syntax or http error: "+
a.url))};h.type=a.r||"text/javascript";h.charset="utf-8";h.async=!a.R;h.src=a.url;m[a.id]=h;L.insertBefore(h,N);return h},N:function(a){var e=[],m;("string"==typeof a?a:a.toSource?a.toSource():a.toString()).replace(W,"").replace(X,function(a,b,c,d){d?m=m==d?G:m:m||e.push(c);return""});return e},ga:function(a){var e,m,h,b,c,d;c=a.length;h=a[c-1];b=g(h,"Function")?h.length:-1;2==c?g(a[0],"Array")?m=a[0]:e=a[0]:3==c&&(e=a[0],m=a[1]);!m&&0<b&&(d=!0,m=["require","exports","module"].slice(0,b).concat(t.N(h)));
return{id:e,w:m||[],G:0<=b?h:function(){return h},v:d}},ba:function(a){var e;e=a.G.apply(a.v?a.a:G,a.w);e===G&&a.a&&(e=a.B?a.a=a.B.a:a.a);return e},J:function(a,e){a.G=e.G;a.v=e.v;a.K=e.w;t.A(a)},A:function(a){function e(a,e,m){d[e]=a;m&&s(a,e)}function m(e,h){var b,c,l,d;b=w(1,function(a){c(a);g(a,h)});c=w(1,function(a){s(a,h)});l=t.da(e,a);(d=x(l)&&l.a)&&c(d);r(l,b,a.e,a.a&&function(a){l.a&&(a==M?c(l.a):a==I&&b(l.a))})}function h(){a.k(d)}var b,c,d,p,f,s,g;d=[];c=a.K;p=c.length;0==c.length&&h();
s=w(p,e,function(){a.M&&a.M(d)});g=w(p,e,h);for(b=0;b<p;b++)f=c[b],f in R?(g(R[f](a),b,!0),a.a&&a.F(M)):f?m(f,b):g(G,b,!0);return a},ea:function(a){t.P(a);t.m(a,function(){var e=K;K=G;!1!==a.oa&&(!e||e.L?a.e(Error(e&&e.L||"define() missing or duplicated: "+a.url)):t.J(a,e))},a.e);return a},da:function(a,e){var m,h,b,c,d,p,f,g,q,k,n,u;m=e.t;h=e.ka;b=e.b||E;d=m(a);d in F?p=d:(c=s(d),g=c.g,p=c.d||g,q=t.o(p,b));if(!(d in F))if(u=t.o(g,b).b,c.d)f=p;else if(f=u.moduleLoader||u.xa||u.loader||u.wa)g=p,p=
f,q=t.o(f,b);p in F?k=F[p]:q.url in O?k=F[p]=O[q.url]:(k=t.I(u,p,h),k.url=t.u(q.url,q.b),F[p]=O[q.url]=k,t.ea(k));p==f&&(c.d&&b.plugins[c.d]&&(u=b.plugins[c.d]),n=new y,r(k,function(a){var e,b,c;c=a.dynamic;g="normalize"in a?a.normalize(g,m,k.b)||"":m(g);b=f+"!"+g;e=F[b];if(!(b in F)){e=t.$(u,b,g,h);c||(F[b]=e);var d=function(a){c||(F[b]=a);e.k(a)};d.resolve=d;d.reject=d.error=e.e;a.load(g,e.s,d,u)}n!=e&&r(e,n.k,n.e,n.F)},n.e));return n||k},ja:function(){var a;if(!g(f.opera,"Opera"))for(var e in m)if("interactive"==
m[e].readyState){a=e;break}return a},fa:function(a){var e=0,m,b;for(m=B&&(B.scripts||B.getElementsByTagName("script"));m&&(b=m[e++]);)if(a(b))return b},ca:function(){var a,e="";(a=t.fa(function(a){(a=a.getAttribute("data-curl-run"))&&(e=a);return a}))&&a.setAttribute("data-curl-run","");return e},X:function(){function a(){t.m({url:b.shift()},e,e)}function e(){p&&(b.length?(t.n(m),a()):m("run.js script did not run."))}function m(a){throw Error(a||"Primary run.js failed. Trying fallback.");}var b=p.split(Y);
b.length&&a()},n:function(a){setTimeout(a,0)}};R={require:t.ia,exports:t.O,module:t.ha};b.version="0.8.4";b.config=c;A.amd={plugins:!0,jQuery:!0,curl:"0.8.4"};E={p:"",T:"curl/plugin",j:/\?|\.js\b/,D:{},C:{},plugins:{},c:{},S:/$^/};C=f.curl;H=f.define;C&&g(C,"Object")?(f.curl=G,c(C)):t.V();(p=t.ca())&&t.n(t.X);F.curl=b;F["curl/_privileged"]={core:t,cache:F,config:function(){return E},_define:z,_curl:b,Promise:y}})(this.window||"undefined"!=typeof global&&global||this);
(function(f,k){function g(){if(!k.body)return!1;A||(A=k.createTextNode(""));try{return k.body.removeChild(k.body.appendChild(A)),A=z,!0}catch(b){return!1}}function n(){var d;d=v[k[s]]&&g();if(!x&&d){x=!0;for(clearTimeout(u);b=c.pop();)b();y&&(k[s]="complete");for(var f;f=q.shift();)f()}return d}function d(){n();x||(u=setTimeout(d,r))}var s="readyState",v={loaded:1,interactive:1,complete:1},q=[],y=k&&"string"!=typeof k[s],x=!1,r=10,w,b,c=[],u,z,A;w="addEventListener"in f?function(b,c){b.addEventListener(c,
n,!1);return function(){b.removeEventListener(c,n,!1)}}:function(b,c){b.attachEvent("on"+c,n);return function(){b.detachEvent(c,n)}};k&&!n()&&(c=[w(f,"load"),w(k,"readystatechange"),w(f,"DOMContentLoaded")],u=setTimeout(d,r));define("curl/domReady",function(){function b(c){x?c():q.push(c)}b.then=b;b.amd=!0;return b})})(this,this.document);var P;
(function(f,k){define("curl/shim/dojo18",["curl/_privileged"],function(g){function n(c){c.has||(c.has=b);c.on||(c.on=s);c.idle||(c.idle=d);c.async=!0}function d(){for(var b in q)if(q[b]instanceof y)return!1;return!0}function s(){}var v,q,y,x;v=g._curl;q=g.cache;y=g.Promise;x=g.core.i;var r,w,b;r=g.b().va||{};w=k&&k.createElement("div");b=function(b){return"function"==typeof r[b]?r[b]=r[b](f,k,w):r[b]};b.add=function(c,d,f,g){if(void 0===r[c]||g)r[c]=d;if(f)return b(c)};r["dojo-loader"]=!1;q["dojo/_base/loader"]=
0;"undefined"==typeof P&&(n(v),P=v);g.core.i=function(){var b=x.apply(this,arguments);n(b.s);return b};return!0})})("object"==typeof global?global:this.window||this.global,"object"==typeof document&&document);
(function(f,k,g){define("curl/plugin/js",["curl/_privileged"],function(f){function d(b,c,d){function s(){p||(k<new Date?d():setTimeout(s,10))}var k,p,q;k=(new Date).valueOf()+(b.na||3E5);d&&b.a&&setTimeout(s,10);q=f.core.m(b,function(){p=!0;b.a&&(b.H=g(b.a));!b.a||b.H?c(q):d()},function(b){p=!0;d(b)})}function s(b,c){d(b,function(){var d=q.shift();r=0<q.length;d&&s.apply(null,d);c.k(b.H||!0)},function(b){c.e(b)})}var v={},q=[],y=k&&!0==k.createElement("script").async,x,r,w=/\?|\.js\b/;x=f.Promise;
return{dynamic:!0,normalize:function(b,c){var d=b.indexOf("!");return 0<=d?c(b.substr(0,d))+b.substr(d):c(b)},load:function(b,c,f,g){function k(b){(f.error||function(b){throw b;})(b)}var p,n,C,H,B;p=0<b.indexOf("!order");n=b.indexOf("!exports=");C=0<n?b.substr(n+9):g.a;H="prefetch"in g?g.prefetch:!0;b=p||0<n?b.substr(0,b.indexOf("!")):b;n=(n=g.dontAddFileExt||g.j)?RegExp(n):w;B=c.toUrl(b);n.test(B)||(B=B.lastIndexOf(".")<=B.lastIndexOf("/")?B+".js":B);B in v?v[B]instanceof x?v[B].l(f,k):f(v[B]):(b=
{name:b,url:B,R:p,a:C,na:g.timeout},v[B]=c=new x,c.l(function(b){v[B]=b;f(b)},k),p&&!y&&r?(q.push([b,c]),H&&(b.r="text/cache",d(b,function(b){b&&b.parentNode.removeChild(b)},function(){}),b.r="")):(r=r||p,s(b,c)))},cramPlugin:"../cram/js"}})})(this,this.document,function(f){try{return eval(f)}catch(k){}});
define("curl/plugin/_fetchText",[],function(){var f,k;k=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];f=function(){if("undefined"!==typeof XMLHttpRequest)f=function(){return new XMLHttpRequest};else for(var g=f=function(){throw Error("getXhr(): XMLHttpRequest not available");};0<k.length&&f===g;)(function(g){try{new ActiveXObject(g),f=function(){return new ActiveXObject(g)}}catch(d){}})(k.shift());return f()};return function(g,k,d){var s=f();s.open("GET",g,!0);s.onreadystatechange=function(){4===
s.readyState&&(400>s.status?k(s.responseText):d(Error("fetchText() failed. status: "+s.statusText)))};s.send(null)}});define("curl/plugin/text",["./_fetchText"],function(f){function k(f){throw f;}return{load:function(g,n,d){f(n.toUrl(g),d,d.error||k)},cramPlugin:"../cram/text"}});
define("curl/plugin/async",function(){return{load:function(f,k,g){function n(d){"function"==typeof g.error&&g.error(d)}k([f],function(d){"function"==typeof d.l?d.l(function(f){0==arguments.length&&(f=d);g(f)},n):g(d)},g.error||function(d){throw d;})},analyze:function(f,k,g){g(f)}}});
(function(f){function k(){var b;b=p[z]("link");b.rel="stylesheet";b.type="text/css";return b}function g(b,c){b.onload=function(){I.load=I.load||!0;c()}}function n(b,c){b.onerror=function(){I.error=I.error||!0;c()}}function d(b,c,d){B.push({url:b,Y:c,aa:function(){d(Error(M))}});(b=v())&&s(b)}function s(b){var c,d;c=B.shift();d=b.styleSheet;c?(b.onload=function(){c.Y(c.ma);s(b)},b.onerror=function(){c.aa();s(b)},c.ma=d.imports[d.addImport(c.url)]):(b.onload=b.onerror=u,H.push(b))}function v(){var b;
b=H.shift();!b&&C.length<L&&(b=p.createElement("style"),C.push(b),E.appendChild(b));return b}function q(b){var c,d,f;if(!b.href||p.readyState&&"complete"!=p.readyState)return!1;c=!1;try{if(d=b.sheet)f=d.cssRules,c=null===f,!c&&f&&(d.insertRule("-curl-css-test {}",0),d.deleteRule(0),c=!0)}catch(g){c="[object Opera]"!=Object.prototype.toString.call(window.opera)&&/security|denied/i.test(g.message)}return c}function y(b,c,d){I.load||(q(b)?d(b.sheet):b.onload==u||!b.onload||A(function(){y(b,c,d)},c))}
function x(c,d,f){function k(){c.onload!=u&&c.onload&&(c.onload=c.onerror=u,b(function(){f(c.sheet)}))}g(c,k);y(c,d,k)}function r(b,c){n(b,function(){b.onload!=u&&b.onload&&(b.onload=b.onerror=u,c(Error(M)))})}function w(b,c,d,f){var g;g=k();x(g,f,c);r(g,d);g.href=b;E.appendChild(g)}function b(b){function c(){p.readyState&&"complete"!=p.readyState?A(c,10):b()}c()}function c(b){return b.lastIndexOf(".")<=b.lastIndexOf("/")?b+".css":b}function u(){}var z="createElement",A=f.setTimeout,p=f.document,
E;f=p&&p.createStyleSheet&&!(10<=p.documentMode);var C=[],H=[],B=[],L=12,N,M="HTTP or network error.",I={};p&&(E=p.head||p.getElementsByTagName("head")[0],N=f?d:w);define("curl/plugin/css",{normalize:function(b,c){var d,f;if(!b)return b;d=b.split(",");f=[];for(var g=0,k=d.length;g<k;g++)f.push(c(d[g]));return f.join(",")},load:function(b,d,f,g){function p(b){1<n.length&&q.push(b);0==--C&&f(1==n.length?b:q)}function s(b){(f.e||function(b){throw b;})(b)}var q,n,r,C,w;q=[];n=(b||"").split(",");r=g.cssWatchPeriod||
50;g=g.cssNoWait;C=n.length;for(w=0;w<n.length;w++){b=n[w];var u;b=c(d.toUrl(b));g?(u=k(),u.href=b,E.appendChild(u),p(u.sheet||u.styleSheet)):N(b,p,s,r)}},cramPlugin:"../cram/css"})})(this);
(function(f){var k=f.document,g=/^\/\//,n;k&&(n=k.head||(k.head=k.getElementsByTagName("head")[0]));define("curl/plugin/link",{load:function(d,f,v,q){d=f.toUrl(d);d=d.lastIndexOf(".")<=d.lastIndexOf("/")?d+".css":d;q=d=(q="fixSchemalessUrls"in q?q.fixSchemalessUrls:k.location.protocol)?d.replace(g,q+"//"):d;d=k.createElement("link");d.rel="stylesheet";d.type="text/css";d.href=q;n.appendChild(d);v(d.sheet||d.styleSheet)}})})(this);
define("curl/plugin/domReady",["../domReady"],function(f){return{load:function(k,g,n){f(n)}}});(function(f){define("curl/shim/_fetchText",function(){function k(d,f,g){n.Aa(d,function(d,k){d?g(d):f(k.toString())})}function g(f,g,k){var n;f=s.parse(f,!1,!0);n="";d.get(f,function(d){d.h("data",function(b){n+=b}).h("end",function(){g(n)}).h("error",k)}).h("error",k)}var n,d,s;n=f("fs");d=f("http");s=f("url");var v;v=/^https?:/;return function(d,f,n){v.test(d)?g(d,f,n):k(d,f,n)}})})(P);define.amd.Da=!0;
(function(f,k){define("curl/shim/ssjs",["curl/_privileged","./_fetchText"],function(g,n){function d(b,c,d){try{k(b.url),c()}catch(f){d(f)}}function s(b,c,d){var g;try{g=b.url.replace(/\.js$/,""),f(g),c()}catch(k){d(k)}}function v(b,c,d){var g;b=f("url").parse(b.url,!1,!0);g="";z.get(b,function(b){b.h("data",function(b){g+=b}).h("end",function(){y(g);c()}).h("error",d)}).h("error",d)}function q(b){throw Error("ssjs: unable to load module in current environment: "+b.url);}function y(b){eval(b)}function x(b){return b&&
b.replace(c,function(b,c){return c})}var r,w,b,c,u,z,A,p;if("object"!=typeof window||!window.sa&&!window.navigator){r=g.ra;w=g.b();b=/^\w+:\/\//;c=/(^\w+:)?.*$/;"undefined"==typeof XMLHttpRequest&&(r["curl/plugin/_fetchText"]=n);u=(w.q&&":"!=w.q[w.q.length-1]?w.q+":":w.q)||x(w.p)||"http:";if(k)A=p=d;else if(f){A=s;try{z=f("http"),p=v}catch(E){p=q}}else A=p=q;"object"===typeof process&&process.la&&(g.Z.n=process.la);g.Z.m=function(c,d,f){/^\/\//.test(c.url)&&(c.url=u+c.url);return b.test(c.url)?p(c,
d,f):A(c,d,f)}}})})(P,void 0);
(function(f,k,g){define("curl/loader/cjsm11",["../plugin/_fetchText","curl/_privileged"],function(f,d){function s(d,b){s="text"in d?function(b,d){b.text=d}:function(b,d){b.appendChild(k.createTextNode(d))};s(d,b)}function v(d,b,c){c=c?"/*\n////@ sourceURL="+c.replace(/\s/g,"%20")+".js\n*/":"";return"define('"+b+"',['require','exports','module'],function(require,exports,module){"+d+"\n});\n"+c+"\n"}var q,y,x,r;y=(q=k&&(k.head||k.getElementsByTagName("head")[0]))&&q.getElementsByTagName("base")[0]||null;
x=d.core.N;r=d.core.u;v.load=function(d,b,c,u){var z,A,p;z=c.error||function(b){throw b;};A=r(b.Fa(d),u);p=!1!==u.injectSourceUrl&&A;f(A,function(f){var n;n=x(f);b(n,function(){f=v(f,d,p);if(u.injectScript){var n=f,r=k.createElement("script");s(r,n);r.charset="utf-8";q.insertBefore(r,y)}else g(f);c(b(d))},z)},z)};v.cramPlugin="../cram/cjsm11";return v})})(this,this.document,function(f){eval(f)});
define("curl/plugin/locale",function(){function f(f,d){var g;if(f&&(g=f.locale,"function"==typeof g&&(g=g(f,d)),"string"==typeof g))return g;if("undefined"==typeof window)return!1;g=window.clientInformation||window.navigator;return(g&&(g.language||g.userLanguage)||"").toLowerCase()}function k(f,d){return f.replace(g,(d?"/"+d:"")+"$&")}var g;g=/(\.js)?$/;f.toModuleId=k;f.load=function(g,d,s,v){function q(){var b=Error("Unable to find correct locale for "+g);if(s.error)s.error(b);else throw b;}var y,
x;y=f(v,g);x=v.localeToModuleId||k;v=y?x(g,y):g;try{s(d(v))}catch(r){x=y?x(g,!1):g;if(x==v)return q();try{s(d(x))}catch(w){if(!0!==y)return q();d(["i18n!"+g],s,q)}}};return f});
define("curl/plugin/i18n",["./locale"],function(f){function k(f,k,d,s,v){f([k],function(f){s(f,d)},v)}return{load:function(g,n,d,s){function v(b,c){w[c]=b;q()}function q(){var f;if(++b==c.length)if(0==w.length)y(Error('No i18n bundles found: "'+g+'", locale "'+r+'"'));else{f=w[0]||{};for(z=1;z<w.length;z++){var k=w[z],n={},q=void 0;for(q in f)n[q]=f[q];if(k)for(q in k)n[q]=k[q];f=n}d(f)}}var y,x,r,w,b,c,u,z;y=d.error;g||y(Error("blank i18n bundle id."));x=s.localeToModuleId||f.Ea;r=f(s,g);c=[g];w=
[];b=0;if(r&&!1!==s.locale)for(c=c.concat(r.split("-")),u=[],z=1;z<c.length;z++)u[z-1]=c[z],s=x(g,u.join("-")),k(n,s,z,v,q);k(n,g,0,v,q)},cramPlugin:"../cram/i18n"}});
(function(f,k,g){define("curl/loader/legacy",["curl/_privileged"],function(n){var d,s,v;d=k&&!0==k.createElement("script").async;s=n.core.m;v=/\?|\.js\b/;return{load:function(k,n,x,r){function w(){E.r="";s(E,b,c)}function b(){var b;if(!(0<--C)){if(z)try{b=z.call(f,k)}catch(d){c(Error("Factory for legacy "+k+" failed: "+d.message))}else try{b=g(u)}catch(n){c(Error("Failed to find exports "+u+" for legacy "+k))}define(k,b);x(b)}}function c(b){(x.error||function(b){throw b;})(b)}var u,z,A,p,E,C;u=r.exports||
r.a;z=r.factory||r.factory;if(!u&&!z)throw Error("`exports` or `factory` required for legacy: "+k);A=[].concat(r.requires||r.Ca||[]);r=(r=r.dontAddFileExt||r.j)?RegExp(r):v;p=n.toUrl(k);r.test(p)||(p=p.lastIndexOf(".")<=p.lastIndexOf("/")?p+".js":p);E={url:p,R:!0,r:d||!A.length?"":"text/cache"};A.length?(C=2,n(A,d?b:w,c)):C=1;s(E,b,c)},cramPlugin:"../cram/legacy"}})})(this,this.document,function(f){return(0,eval)(f)});
}).call(this);

20
vendor/docdown/LICENSE.txt vendored Normal file
View File

@@ -0,0 +1,20 @@
Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

38
vendor/docdown/docdown.php vendored Normal file
View File

@@ -0,0 +1,38 @@
<?php
/*!
* Docdown v1.0.0-pre
* Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
* Available under MIT license <http://mths.be/mit>
*/
require(dirname(__FILE__) . '/src/DocDown/MarkdownGenerator.php');
/**
* Generates Markdown from JSDoc entries in a given file.
*
* @param {Array} [$options=array()] The options array.
* @returns {string} The generated Markdown.
* @example
*
* // specify a file path
* $markdown = docdown(array(
* // path to js file
* 'path' => $filepath,
* // url used to reference line numbers in code
* 'url' => 'https://github.com/username/project/blob/master/my.js'
* ));
*
* // or pass raw js
* $markdown = docdown(array(
* // raw JavaScript source
* 'source' => $rawJS,
* // documentation title
* 'title' => 'My API Documentation',
* // url used to reference line numbers in code
* 'url' => 'https://github.com/username/project/blob/master/my.js'
* ));
*/
function docdown( $options = array() ) {
$gen = new MarkdownGenerator($options);
return $gen->generate();
}
?>

226
vendor/docdown/src/DocDown/Alias.php vendored Normal file
View File

@@ -0,0 +1,226 @@
<?php
/**
* A class to represent a JSDoc entry alias.
*/
class Alias {
/**
* The alias owner.
*
* @memberOf Alias
* @type Object
*/
public $owner;
/*--------------------------------------------------------------------------*/
/**
* The Alias constructor.
*
* @constructor
* @param {string} $name The alias name.
* @param {Object} $owner The alias owner.
*/
public function __construct( $name, $owner ) {
$this->owner = $owner;
$this->_name = $name;
$this->_call = $owner->getCall();
$this->_category = $owner->getCategory();
$this->_desc = $owner->getDesc();
$this->_example = $owner->getExample();
$this->_isCtor = $owner->isCtor();
$this->_isLicense = $owner->isLicense();
$this->_isPlugin = $owner->isPlugin();
$this->_isPrivate = $owner->isPrivate();
$this->_isStatic = $owner->isStatic();
$this->_lineNumber = $owner->getLineNumber();
$this->_members = $owner->getMembers();
$this->_params = $owner->getParams();
$this->_returns = $owner->getReturns();
$this->_type = $owner->getType();
}
/*--------------------------------------------------------------------------*/
/**
* Extracts the entry's `alias` objects.
*
* @memberOf Alias
* @param {number} $index The index of the array value to return.
* @returns {Array|string} The entry's `alias` objects.
*/
public function getAliases( $index = null ) {
$result = array();
return $index !== null
? @$result[$index]
: $result;
}
/**
* Extracts the function call from the owner entry.
*
* @memberOf Alias
* @returns {string} The function call.
*/
public function getCall() {
return $this->_call;
}
/**
* Extracts the owner entry's `category` data.
*
* @memberOf Alias
* @returns {string} The owner entry's `category` data.
*/
public function getCategory() {
return $this->_category;
}
/**
* Extracts the owner entry's description.
*
* @memberOf Alias
* @returns {string} The owner entry's description.
*/
public function getDesc() {
return $this->_desc;
}
/**
* Extracts the owner entry's `example` data.
*
* @memberOf Alias
* @returns {string} The owner entry's `example` data.
*/
public function getExample() {
return $this->_example;
}
/**
* Checks if the entry is an alias.
*
* @memberOf Alias
* @returns {boolean} Returns `true`.
*/
public function isAlias() {
return true;
}
/**
* Checks if the owner entry is a constructor.
*
* @memberOf Alias
* @returns {boolean} Returns `true` if a constructor, else `false`.
*/
public function isCtor() {
return $this->_isCtor;
}
/**
* Checks if the owner entry is a license.
*
* @memberOf Alias
* @returns {boolean} Returns `true` if a license, else `false`.
*/
public function isLicense() {
return $this->_isLicense;
}
/**
* Checks if the owner entry *is* assigned to a prototype.
*
* @memberOf Alias
* @returns {boolean} Returns `true` if assigned to a prototype, else `false`.
*/
public function isPlugin() {
return $this->_isPlugin;
}
/**
* Checks if the owner entry is private.
*
* @memberOf Alias
* @returns {boolean} Returns `true` if private, else `false`.
*/
public function isPrivate() {
return $this->_isPrivate;
}
/**
* Checks if the owner entry is *not* assigned to a prototype.
*
* @memberOf Alias
* @returns {boolean} Returns `true` if not assigned to a prototype, else `false`.
*/
public function isStatic() {
return $this->_isStatic;
}
/**
* Resolves the owner entry's line number.
*
* @memberOf Alias
* @returns {number} The owner entry's line number.
*/
public function getLineNumber() {
return $this->_lineNumber;
}
/**
* Extracts the owner entry's `member` data.
*
* @memberOf Alias
* @param {number} $index The index of the array value to return.
* @returns {Array|string} The owner entry's `member` data.
*/
public function getMembers( $index = null ) {
return $index !== null
? @$this->_members[$index]
: $this->_members;
}
/**
* Extracts the owner entry's `name` data.
*
* @memberOf Alias
* @returns {string} The owner entry's `name` data.
*/
public function getName() {
return $this->_name;
}
/**
* Extracts the owner entry's `param` data.
*
* @memberOf Alias
* @param {number} $index The index of the array value to return.
* @returns {Array} The owner entry's `param` data.
*/
public function getParams( $index = null ) {
return $index !== null
? @$this->_params[$index]
: $this->_params;
}
/**
* Extracts the owner entry's `returns` data.
*
* @memberOf Alias
* @returns {string} The owner entry's `returns` data.
*/
public function getReturns() {
return $this->_returns;
}
/**
* Extracts the owner entry's `type` data.
*
* @memberOf Alias
* @returns {string} The owner entry's `type` data.
*/
public function getType() {
return $this->_type;
}
}
?>

452
vendor/docdown/src/DocDown/Entry.php vendored Normal file
View File

@@ -0,0 +1,452 @@
<?php
require(dirname(__FILE__) . "/Alias.php");
/**
* A class to simplify parsing a single JSDoc entry.
*/
class Entry {
/**
* The documentation entry.
*
* @memberOf Entry
* @type string
*/
public $entry = '';
/**
* The language highlighter used for code examples.
*
* @memberOf Entry
* @type string
*/
public $lang = '';
/**
* The source code.
*
* @memberOf Entry
* @type string
*/
public $source = '';
/*--------------------------------------------------------------------------*/
/**
* The Entry constructor.
*
* @constructor
* @param {string} $entry The documentation entry to analyse.
* @param {string} $source The source code.
* @param {string} [$lang ='js'] The language highlighter used for code examples.
*/
public function __construct( $entry, $source, $lang = 'js' ) {
$this->entry = $entry;
$this->lang = $lang;
$this->source = str_replace(PHP_EOL, "\n", $source);
}
/*--------------------------------------------------------------------------*/
/**
* Extracts the documentation entries from source code.
*
* @static
* @memberOf Entry
* @param {string} $source The source code.
* @returns {Array} The array of entries.
*/
public static function getEntries( $source ) {
preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*.+#', $source, $result);
return array_pop($result);
}
/*--------------------------------------------------------------------------*/
/**
* Checks if the entry is a function reference.
*
* @private
* @memberOf Entry
* @returns {boolean} Returns `true` if the entry is a function reference, else `false`.
*/
private function isFunction() {
if (!isset($this->_isFunction)) {
$this->_isFunction = !!(
$this->isCtor() ||
count($this->getParams()) ||
count($this->getReturns()) ||
preg_match('/\*[\t ]*@function\b/', $this->entry) ||
preg_match('#\*/\s*function #', $this->entry)
);
}
return $this->_isFunction;
}
/*--------------------------------------------------------------------------*/
/**
* Extracts the entry's `alias` objects.
*
* @memberOf Entry
* @param {number} $index The index of the array value to return.
* @returns {Array|string} The entry's `alias` objects.
*/
public function getAliases( $index = null ) {
if (!isset($this->_aliases)) {
preg_match('#\*[\t ]*@alias\s+(.+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
$result = preg_split('/,\s*/', $result);
natsort($result);
foreach ($result as $resultIndex => $value) {
$result[$resultIndex] = new Alias($value, $this);
}
}
$this->_aliases = $result;
}
return $index !== null
? @$this->_aliases[$index]
: $this->_aliases;
}
/**
* Extracts the function call from the entry.
*
* @memberOf Entry
* @returns {string} The function call.
*/
public function getCall() {
if (isset($this->_call)) {
return $this->_call;
}
preg_match('#\*/\s*(?:function ([^(]*)|(.*?)(?=[:=,]|return\b))#', $this->entry, $result);
if ($result = array_pop($result)) {
$result = array_pop(explode('var ', trim(trim(array_pop(explode('.', $result))), "'")));
}
// resolve name
// avoid $this->getName() because it calls $this->getCall()
preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $name);
if (count($name)) {
$name = trim($name[1]);
} else {
$name = $result;
}
// compile function call syntax
if ($this->isFunction()) {
// compose parts
$result = array($result);
$params = $this->getParams();
foreach ($params as $param) {
// skip params that are properties of other params (e.g. `options.leading`)
if (!preg_match('/\w+\.[\w.]+\s*=/', $param[1])) {
$result[] = $param[1];
}
}
// format
$result = $name .'('. implode(array_slice($result, 1), ', ') .')';
}
$this->_call = $result ? $result : $name;
return $this->_call;
}
/**
* Extracts the entry's `category` data.
*
* @memberOf Entry
* @returns {string} The entry's `category` data.
*/
public function getCategory() {
if (isset($this->_category)) {
return $this->_category;
}
preg_match('#\*[\t ]*@category\s+(.+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
} else {
$result = $this->getType() == 'Function' ? 'Methods' : 'Properties';
}
$this->_category = $result;
return $result;
}
/**
* Extracts the entry's description.
*
* @memberOf Entry
* @returns {string} The entry's description.
*/
public function getDesc() {
if (isset($this->_desc)) {
return $this->_desc;
}
preg_match('#/\*\*(?:\s*\*)?([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) {
$type = $this->getType();
$result = preg_replace('/:\n[\t ]*\*[\t ]*/', ":<br>\n", $result[1]);
$result = preg_replace('/(?:^|\n)[\t ]*\*\n[\t ]*\*[\t ]*/', "\n\n", $result);
$result = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result);
$result = trim($result);
$result = ($type == 'Function' ? '' : '(' . str_replace('|', ', ', trim($type, '{}')) . '): ') . $result;
}
$this->_desc = $result;
return $result;
}
/**
* Extracts the entry's `example` data.
*
* @memberOf Entry
* @returns {string} The entry's `example` data.
*/
public function getExample() {
if (isset($this->_example)) {
return $this->_example;
}
preg_match('#\*[\t ]*@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', "\n", $result[1]));
$result = '```' . $this->lang . "\n" . $result . "\n```";
}
$this->_example = $result;
return $result;
}
/**
* Checks if the entry is an alias.
*
* @memberOf Entry
* @returns {boolean} Returns `false`.
*/
public function isAlias() {
return false;
}
/**
* Checks if the entry is a constructor.
*
* @memberOf Entry
* @returns {boolean} Returns `true` if a constructor, else `false`.
*/
public function isCtor() {
if (!isset($this->_isCtor)) {
$this->_isCtor = !!preg_match('/\*[\t ]*@constructor\b/', $this->entry);
}
return $this->_isCtor;
}
/**
* Checks if the entry is a license.
*
* @memberOf Entry
* @returns {boolean} Returns `true` if a license, else `false`.
*/
public function isLicense() {
if (!isset($this->_isLicense)) {
$this->_isLicense = !!preg_match('/\*[\t ]*@license\b/', $this->entry);
}
return $this->_isLicense;
}
/**
* Checks if the entry *is* assigned to a prototype.
*
* @memberOf Entry
* @returns {boolean} Returns `true` if assigned to a prototype, else `false`.
*/
public function isPlugin() {
if (!isset($this->_isPlugin)) {
$this->_isPlugin = !$this->isCtor() && !$this->isPrivate() && !$this->isStatic();
}
return $this->_isPlugin;
}
/**
* Checks if the entry is private.
*
* @memberOf Entry
* @returns {boolean} Returns `true` if private, else `false`.
*/
public function isPrivate() {
if (!isset($this->_isPrivate)) {
$this->_isPrivate = $this->isLicense() || !!preg_match('/\*[\t ]*@private\b/', $this->entry) || !preg_match('/\*[\t ]*@[a-z]+\b/', $this->entry);
}
return $this->_isPrivate;
}
/**
* Checks if the entry is *not* assigned to a prototype.
*
* @memberOf Entry
* @returns {boolean} Returns `true` if not assigned to a prototype, else `false`.
*/
public function isStatic() {
if (isset($this->_isStatic)) {
return $this->_isStatic;
}
$public = !$this->isPrivate();
$result = $public && !!preg_match('/\*[\t ]*@static\b/', $this->entry);
// set in cases where it isn't explicitly stated
if ($public && !$result) {
if ($parent = array_pop(preg_split('/[#.]/', $this->getMembers(0)))) {
foreach (Entry::getEntries($this->source) as $entry) {
$entry = new Entry($entry, $this->source);
if ($entry->getName() == $parent) {
$result = !$entry->isCtor();
break;
}
}
} else {
$result = true;
}
}
$this->_isStatic = $result;
return $result;
}
/**
* Resolves the entry's line number.
*
* @memberOf Entry
* @returns {number} The entry's line number.
*/
public function getLineNumber() {
if (!isset($this->_lineNumber)) {
preg_match_all('/\n/', substr($this->source, 0, strrpos($this->source, $this->entry) + strlen($this->entry)), $lines);
$this->_lineNumber = count(array_pop($lines)) + 1;
}
return $this->_lineNumber;
}
/**
* Extracts the entry's `member` data.
*
* @memberOf Entry
* @param {number} $index The index of the array value to return.
* @returns {Array|string} The entry's `member` data.
*/
public function getMembers( $index = null ) {
if (!isset($this->_members)) {
preg_match('#\*[\t ]*@member(?:Of)?\s+(.+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
$result = preg_split('/,\s*/', $result);
natsort($result);
}
$this->_members = $result;
}
return $index !== null
? @$this->_members[$index]
: $this->_members;
}
/**
* Extracts the entry's `name` data.
*
* @memberOf Entry
* @returns {string} The entry's `name` data.
*/
public function getName() {
if (isset($this->_name)) {
return $this->_name;
}
preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
} else {
$result = array_shift(explode('(', $this->getCall()));
}
$this->_name = $result;
return $result;
}
/**
* Extracts the entry's `param` data.
*
* @memberOf Entry
* @param {number} $index The index of the array value to return.
* @returns {Array} The entry's `param` data.
*/
public function getParams( $index = null ) {
if (!isset($this->_params)) {
preg_match_all('#\*[\t ]*@param\s+\{\(?([^})]+)\)?\}\s+(\[.+\]|[$\w|]+(?:\[.+\])?)\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#i', $this->entry, $matchTuples);
$matchTuples = array_filter(array_slice($matchTuples, 1));
$result = array();
if (count($matchTuples)) {
foreach ($matchTuples as $tupleKey => $tuple) {
foreach ($tuple as $key => $value) {
if (!isset($result[$key])) {
$result[$key] = array();
}
$result[$key][] = $tupleKey
? trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]*/', ' ', $value))
: trim($value);
}
}
}
$this->_params = $result;
}
return $index !== null
? @$this->_params[$index]
: $this->_params;
}
/**
* Extracts the entry's `returns` data.
*
* @memberOf Entry
* @returns {string} The entry's `returns` data.
*/
public function getReturns() {
if (isset($this->_returns)) {
return $this->_returns;
}
preg_match('#\*[\t ]*@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) {
$result = array_map('trim', array_slice($result, 1));
$result[0] = str_replace('|', ', ', $result[0]);
$result[1] = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]);
}
$this->_returns = $result;
return $result;
}
/**
* Extracts the entry's `type` data.
*
* @memberOf Entry
* @returns {string} The entry's `type` data.
*/
public function getType() {
if (isset($this->_type)) {
return $this->_type;
}
preg_match('#\*[\t ]*@type\s(?:\{\(?)?([^)}\n]+)#', $this->entry, $result);
if (count($result)) {
$result = trim($result[1]);
if (preg_match('/^(?:array|function|object|regexp)$/', $result)) {
$result = ucfirst($result);
}
} else {
$result = $this->isFunction() ? 'Function' : 'unknown';
}
$this->_type = $result;
return $result;
}
}
?>

View File

@@ -0,0 +1,648 @@
<?php
require(dirname(__FILE__) . "/Entry.php");
/**
* Generates Markdown from JSDoc entries.
*/
class MarkdownGenerator {
/**
* The HTML for the close tag.
*
* @static
* @memberOf MarkdownGenerator
* @type string
*/
public $closeTag = "\n<!-- /div -->\n";
/**
* An array of JSDoc entries.
*
* @memberOf MarkdownGenerator
* @type Array
*/
public $entries = array();
/**
* The HTML for the open tag.
*
* @memberOf MarkdownGenerator
* @type string
*/
public $openTag = "\n<!-- div -->\n";
/**
* An options array used to configure the generator.
*
* @memberOf MarkdownGenerator
* @type Array
*/
public $options = array();
/**
* The file's source code.
*
* @memberOf MarkdownGenerator
* @type string
*/
public $source = '';
/**
* The array of code snippets that are tokenized by `escape`.
*
* @private
* @memberOf MarkdownGenerator
* @type Array
*/
private $snippets = array();
/*--------------------------------------------------------------------------*/
/**
* The MarkdownGenerator constructor.
*
* @constructor
* @param {string} $source The source code to parse.
* @param {Array} $options The options array.
*/
public function __construct( $source, $options = array() ) {
// juggle arguments
if (is_array($source)) {
$options = $source;
} else {
$options['source'] = $source;
}
if (isset($options['source']) && realpath($options['source'])) {
$options['path'] = $options['source'];
}
if (isset($options['path'])) {
preg_match('/(?<=\.)[a-z]+$/', $options['path'], $ext);
$options['source'] = file_get_contents($options['path']);
$ext = array_pop($ext);
if (!isset($options['lang']) && $ext) {
$options['lang'] = $ext;
}
if (!isset($options['title'])) {
$options['title'] = ucfirst(basename($options['path'])) . ' API documentation';
}
}
if (!isset($options['lang'])) {
$options['lang'] = 'js';
}
if (!isset($options['toc'])) {
$options['toc'] = 'properties';
}
$this->options = $options;
$this->source = str_replace(PHP_EOL, "\n", $options['source']);
$this->entries = Entry::getEntries($this->source);
foreach ($this->entries as $index => $value) {
$this->entries[$index] = new Entry($value, $this->source, $options['lang']);
}
}
/*--------------------------------------------------------------------------*/
/**
* Performs common string formatting operations.
*
* @private
* @static
* @memberOf MarkdownGenerator
* @param {string} $string The string to format.
* @returns {string} The formatted string.
*/
private static function format( $string ) {
$counter = 0;
// tokenize inline code snippets
preg_match_all('/`[^`]+`/', $string, $tokenized);
$tokenized = $tokenized[0];
foreach ($tokenized as $snippet) {
$string = str_replace($snippet, '__token' . ($counter++) .'__', $string);
}
// italicize parentheses
$string = preg_replace('/(^|\s)(\([^)]+\))/', '$1*$2*', $string);
// mark numbers as inline code
$string = preg_replace('/[\t ](-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string);
// detokenize inline code snippets
$counter = 0;
foreach ($tokenized as $snippet) {
$string = str_replace('__token' . ($counter++) . '__', $snippet, $string);
}
return trim($string);
}
/**
* Modify a string by replacing named tokens with matching assoc. array values.
*
* @private
* @static
* @memberOf MarkdownGenerator
* @param {string} $string The string to modify.
* @param {Array|Object} $object The template object.
* @returns {string} The modified string.
*/
private static function interpolate( $string, $object ) {
preg_match_all('/#\{([^}]+)\}/', $string, $tokens);
$tokens = array_unique(array_pop($tokens));
foreach ($tokens as $token) {
$pattern = '/#\{' . preg_replace('/([.*+?^${}()|[\]\\\])/', '\\\$1', $token) . '\}/';
$replacement = '';
if (is_object($object)) {
preg_match('/\(([^)]+?)\)$/', $token, $args);
$args = preg_split('/,\s*/', array_pop($args));
$method = 'get' . ucfirst(preg_replace('/\([^)]+?\)$/', '', $token));
if (method_exists($object, $method)) {
$replacement = (string) call_user_func_array(array($object, $method), $args);
} else if (isset($object->{$token})) {
$replacement = (string) $object->{$token};
}
} else if (isset($object[$token])) {
$replacement = (string) $object[$token];
}
$string = preg_replace($pattern, trim($replacement), $string);
}
return MarkdownGenerator::format($string);
}
/*--------------------------------------------------------------------------*/
/**
* Adds the given `$entries` to the `$result` array.
*
* @private
* @memberOf MarkdownGenerator
* @param {Array} $result The result array to modify.
* @param {Array} $entries The entries to add to the `$result`.
*/
private function addEntries( &$result, $entries ) {
foreach ($entries as $entry) {
// skip aliases
if ($entry->isAlias()) {
continue;
}
// name and description
array_push(
$result,
$this->openTag,
MarkdownGenerator::interpolate("### <a id=\"#{hash}\"></a>`#{member}#{separator}#{call}`\n<a href=\"##{hash}\">#</a> [&#x24C8;](#{href} \"View in source\") [&#x24C9;][1]\n\n#{desc}", array(
'call' => $entry->getCall(),
'desc' => $this->escape($entry->getDesc()),
'hash' => $entry->hash,
'href' => $entry->href,
'member' => $entry->member,
'separator' => $entry->separator
))
);
// @alias
if (count($aliases = $entry->getAliases())) {
array_push($result, '', '#### Aliases');
foreach ($aliases as $index => $alias) {
$aliases[$index] = MarkdownGenerator::interpolate('#{member}#{separator}#{name}', $alias);
}
$result[] = '*' . implode(', ', $aliases) . '*';
}
// @param
if (count($params = $entry->getParams())) {
array_push($result, '', '#### Arguments');
foreach ($params as $index => $param) {
$result[] = MarkdownGenerator::interpolate('#{num}. `#{name}` (#{type}): #{desc}', array(
'desc' => $this->escape($param[2]),
'name' => $param[1],
'num' => $index + 1,
'type' => $this->escape($param[0])
));
}
}
// @returns
if (count($returns = $entry->getReturns())) {
array_push(
$result, '',
'#### Returns',
MarkdownGenerator::interpolate('(#{type}): #{desc}', array(
'desc' => $this->escape($returns[1]),
'type' => $this->escape($returns[0])
))
);
}
// @example
if ($example = $entry->getExample()) {
array_push($result, '', '#### Example', $example);
}
array_push($result, "\n* * *", $this->closeTag);
}
}
/**
* Escapes special Markdown characters.
*
* @private
* @memberOf Entry
* @param {string} $string The string to escape.
* @returns {string} Returns the escaped string.
*/
private function escape( $string ) {
$string = preg_replace_callback('/`.*?\`/', array($this, 'swapSnippetsToTokens'), $string);
$string = preg_replace('/(?<!\\\)\*/', '&#42;', $string);
$string = preg_replace('/(?<!\\\)\[/', '&#91;', $string);
$string = preg_replace('/(?<!\\\)\]/', '&#93;', $string);
$string = preg_replace_callback('/@@token@@/', array($this, 'swapTokensToSnippets'), $string);
return $string;
}
/**
* Resolves the entry's hash used to navigate the documentation.
*
* @private
* @memberOf MarkdownGenerator
* @param {number|Object} $entry The entry object.
* @param {string} $member The name of the member.
* @returns {string} The url hash.
*/
private function getHash( $entry, $member = '' ) {
$entry = is_numeric($entry) ? $this->entries[$entry] : $entry;
$member = !$member ? $entry->getMembers(0) : $member;
$result = ($member ? $member . ($entry->isPlugin() ? 'prototype' : '') : '') . $entry->getCall();
$result = preg_replace('/\(\[|\[\]/', '', $result);
$result = preg_replace('/[\t =|\'"{}.()\]]/', '', $result);
$result = preg_replace('/[\[#,]+/', '-', $result);
return strtolower($result);
}
/**
* Resolves the entry's url for the specific line number.
*
* @private
* @memberOf MarkdownGenerator
* @param {number|Object} $entry The entry object.
* @returns {string} The url.
*/
private function getLineUrl( $entry ) {
$entry = is_numeric($entry) ? $this->entries($entry) : $entry;
return $this->options['url'] . '#L' . $entry->getLineNumber();
}
/**
* Extracts the character used to separate the entry's name from its member.
*
* @private
* @memberOf MarkdownGenerator
* @param {number|Object} $entry The entry object.
* @returns {string} The separator.
*/
private function getSeparator( $entry ) {
$entry = is_numeric($entry) ? $this->entries($entry) : $entry;
return $entry->isPlugin() ? '.prototype.' : '.';
}
/**
* Swaps code snippets with tokens as a `preg_replace_callback` callback
* used by `escape`.
*
* @private
* @memberOf Entry
* @param {Array} $matches The array of regexp matches.
* @returns {string} Returns the token.
*/
private function swapSnippetsToTokens( $matches ) {
$this->snippets[] = $matches[0];
return '@@token@@';
}
/**
* Swaps tokens with code snippets as a `preg_replace_callback` callback
* used by `escape`.
*
* @private
* @memberOf Entry
* @returns {string} Returns the code snippet.
*/
private function swapTokensToSnippets() {
return array_shift($this->snippets);
}
/*--------------------------------------------------------------------------*/
/**
* Generates Markdown from JSDoc entries.
*
* @memberOf MarkdownGenerator
* @returns {string} The rendered Markdown.
*/
public function generate() {
$api = array();
$byCategory = $this->options['toc'] == 'categories';
$categories = array();
$closeTag = $this->closeTag;
$compiling = false;
$openTag = $this->openTag;
$result = array('# ' . $this->options['title']);
$toc = 'toc';
// initialize $api array
foreach ($this->entries as $entry) {
// skip invalid or private entries
$name = $entry->getName();
if (!$name || $entry->isPrivate()) {
continue;
}
$members = $entry->getMembers();
$members = count($members) ? $members : array('');
foreach ($members as $member) {
// create api category arrays
if ($member && !isset($api[$member])) {
// create temporary entry to be replaced later
$api[$member] = new stdClass;
$api[$member]->static = array();
$api[$member]->plugin = array();
}
// append entry to api member
if (!$member || $entry->isCtor() || ($entry->getType() == 'Object' &&
!preg_match('/[=:]\s*(?:null|undefined)\s*[,;]?$/', $entry->entry))) {
// assign the real entry, replacing the temporary entry if it exist
$member = ($member ? $member . ($entry->isPlugin() ? '#' : '.') : '') . $name;
$entry->static = @$api[$member] ? $api[$member]->static : array();
$entry->plugin = @$api[$member] ? $api[$member]->plugin : array();
$api[$member] = $entry;
foreach ($entry->getAliases() as $alias) {
$api[$member]->static[] = $alias;
}
}
else if ($entry->isStatic()) {
$api[$member]->static[] = $entry;
foreach ($entry->getAliases() as $alias) {
$api[$member]->static[] = $alias;
}
}
else if (!$entry->isCtor()) {
$api[$member]->plugin[] = $entry;
foreach ($entry->getAliases() as $alias) {
$api[$member]->plugin[] = $alias;
}
}
}
}
// add properties to each entry
foreach ($api as $entry) {
$entry->hash = $this->getHash($entry);
$entry->href = $this->getLineUrl($entry);
$entry->separator = '';
$member = $entry->getMembers(0);
$member = ($member ? $member . $this->getSeparator($entry) : '') . $entry->getName();
$entry->member = preg_replace('/' . $entry->getName() . '$/', '', $member);
// add properties to static and plugin sub-entries
foreach (array('static', 'plugin') as $kind) {
foreach ($entry->{$kind} as $subentry) {
$subentry->hash = $this->getHash($subentry);
$subentry->href = $this->getLineUrl($subentry);
$subentry->member = $member;
$subentry->separator = $this->getSeparator($subentry);
}
}
}
/*------------------------------------------------------------------------*/
// custom sort for root level entries
// TODO: see how well it handles deeper namespace traversal
function sortCompare($a, $b) {
$score = array( 'a' => 0, 'b' => 0);
foreach (array( 'a' => $a, 'b' => $b) as $key => $value) {
// capitalized properties are last
if (preg_match('/[#.][A-Z]/', $value)) {
$score[$key] = 0;
}
// lowercase prototype properties are next to last
else if (preg_match('/#[a-z]/', $value)) {
$score[$key] = 1;
}
// lowercase static properties next to first
else if (preg_match('/\.[a-z]/', $value)) {
$score[$key] = 2;
}
// root properties are first
else if (preg_match('/^[^#.]+$/', $value)) {
$score[$key] = 3;
}
}
$score = $score['b'] - $score['a'];
return $score ? $score : strcasecmp($a, $b);
}
uksort($api, 'sortCompare');
// sort static and plugin sub-entries
foreach ($api as $entry) {
foreach (array('static', 'plugin') as $kind) {
$sortBy = array( 'a' => array(), 'b' => array(), 'c' => array() );
foreach ($entry->{$kind} as $subentry) {
$name = $subentry->getName();
// functions w/o ALL-CAPs names are last
$sortBy['a'][] = $subentry->getType() == 'Function' && !preg_match('/^[A-Z_]+$/', $name);
// ALL-CAPs properties first
$sortBy['b'][] = preg_match('/^[A-Z_]+$/', $name);
// lowercase alphanumeric sort
$sortBy['c'][] = strtolower($name);
}
array_multisort($sortBy['a'], SORT_ASC, $sortBy['b'], SORT_DESC, $sortBy['c'], SORT_ASC, $entry->{$kind});
}
}
/*------------------------------------------------------------------------*/
// add categories
foreach ($api as $entry) {
$categories[$entry->getCategory()][] = $entry;
foreach (array('static', 'plugin') as $kind) {
foreach ($entry->{$kind} as $subentry) {
$categories[$subentry->getCategory()][] = $subentry;
}
}
}
// sort categories
ksort($categories);
foreach(array('Methods', 'Properties') as $category) {
if (isset($categories[$category])) {
$entries = $categories[$category];
unset($categories[$category]);
$categories[$category] = $entries;
}
}
/*------------------------------------------------------------------------*/
// compile TOC
$result[] = $openTag;
// compile TOC by categories
if ($byCategory) {
foreach ($categories as $category => $entries) {
if ($compiling) {
$result[] = $closeTag;
} else {
$compiling = true;
}
// assign TOC hash
if (count($result) == 2) {
$toc = strtolower($category);
}
// add category
array_push(
$result,
$openTag, '## ' . (count($result) == 2 ? '<a id="' . $toc . '"></a>' : '') . '`' . $category . '`'
);
// add entries
foreach ($entries as $entry) {
if ($entry->isAlias()) {
$result[] = MarkdownGenerator::interpolate('* <a href="##{hash}" class="alias">`#{member}#{separator}#{name}` -> `#{realName}`</a>', array(
'hash' => $entry->hash,
'member' => $entry->member,
'name' => $entry->getName(),
'realName' => $entry->owner->getName(),
'separator' => $entry->separator
));
}
else {
$result[] = MarkdownGenerator::interpolate('* <a href="##{hash}">`#{member}#{separator}#{name}`</a>', $entry);
}
}
}
}
// compile TOC by namespace
else {
foreach ($api as $entry) {
if ($compiling) {
$result[] = $closeTag;
} else {
$compiling = true;
}
$member = $entry->member . $entry->getName();
// assign TOC hash
if (count($result) == 2) {
$toc = $member;
}
// add root entry
array_push(
$result,
$openTag, '## ' . (count($result) == 2 ? '<a id="' . $toc . '"></a>' : '') . '`' . $member . '`',
MarkdownGenerator::interpolate('* [`' . $member . '`](##{hash})', $entry)
);
// add static and plugin sub-entries
foreach (array('static', 'plugin') as $kind) {
if ($kind == 'plugin' && count($entry->plugin)) {
array_push(
$result,
$closeTag,
$openTag,
'## `' . $member . ($entry->isCtor() ? '.prototype`' : '`')
);
}
foreach ($entry->{$kind} as $subentry) {
$subentry->member = $member;
if ($subentry->isAlias()) {
$result[] = MarkdownGenerator::interpolate('* <a href="##{hash}" class="alias">`#{member}#{separator}#{name}` -> `#{realName}`</a>', array(
'hash' => $subentry->hash,
'member' => $subentry->member,
'name' => $subentry->getName(),
'realName' => $subentry->owner->getName(),
'separator' => $subentry->separator
));
}
else {
$result[] = MarkdownGenerator::interpolate('* <a href="##{hash}">`#{member}#{separator}#{name}`</a>', $subentry);
}
}
}
}
}
array_push($result, $closeTag, $closeTag);
/*------------------------------------------------------------------------*/
// compile content
$compiling = false;
$result[] = $openTag;
if ($byCategory) {
foreach ($categories as $category => $entries) {
if ($compiling) {
$result[] = $closeTag;
} else {
$compiling = true;
}
if ($category != 'Methods' && $category != 'Properties') {
$category = '“' . $category . '” Methods';
}
array_push($result, $openTag, '## `' . $category . '`');
$this->addEntries($result, $entries);
}
}
else {
foreach ($api as $entry) {
// skip aliases
if ($entry->isAlias()) {
continue;
}
if ($compiling) {
$result[] = $closeTag;
} else {
$compiling = true;
}
// add root entry name
$member = $entry->member . $entry->getName();
array_push($result, $openTag, '## `' . $member . '`');
foreach (array($entry, 'static', 'plugin') as $kind) {
$subentries = is_string($kind) ? $entry->{$kind} : array($kind);
// add sub-entry name
if ($kind != 'static' && $entry->getType() != 'Object' &&
count($subentries) && $subentries[0] != $kind) {
if ($kind == 'plugin') {
$result[] = $closeTag;
}
array_push(
$result,
$openTag,
'## `' . $member . ($kind == 'plugin' ? '.prototype`' : '`')
);
}
$this->addEntries($result, $subentries);
}
}
}
// close tags add TOC link reference
array_push($result, $closeTag, $closeTag, '', ' [1]: #' . $toc . ' "Jump back to the TOC."');
// cleanup whitespace
return trim(preg_replace('/[\t ]+\n/', "\n", join($result, "\n")));
}
}
?>

195
vendor/dojo/LICENSE vendored Normal file
View File

@@ -0,0 +1,195 @@
Dojo is available under *either* the terms of the modified BSD license *or* the
Academic Free License version 2.1. As a recipient of Dojo, you may choose which
license to receive this code under (except as noted in per-module LICENSE
files). Some modules may not be the copyright of the Dojo Foundation. These
modules contain explicit declarations of copyright in both the LICENSE files in
the directories in which they reside and in the code itself. No external
contributions are allowed under licenses which are fundamentally incompatible
with the AFL or BSD licenses that Dojo is distributed under.
The text of the AFL and BSD licenses is reproduced below.
-------------------------------------------------------------------------------
The "New" BSD License:
**********************
Copyright (c) 2005-2013, The Dojo Foundation
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Dojo Foundation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
The Academic Free License, v. 2.1:
**********************************
This Academic Free License (the "License") applies to any original work of
authorship (the "Original Work") whose owner (the "Licensor") has placed the
following notice immediately following the copyright notice for the Original
Work:
Licensed under the Academic Free License version 2.1
1) Grant of Copyright License. Licensor hereby grants You a world-wide,
royalty-free, non-exclusive, perpetual, sublicenseable license to do the
following:
a) to reproduce the Original Work in copies;
b) to prepare derivative works ("Derivative Works") based upon the Original
Work;
c) to distribute copies of the Original Work and Derivative Works to the
public;
d) to perform the Original Work publicly; and
e) to display the Original Work publicly.
2) Grant of Patent License. Licensor hereby grants You a world-wide,
royalty-free, non-exclusive, perpetual, sublicenseable license, under patent
claims owned or controlled by the Licensor that are embodied in the Original
Work as furnished by the Licensor, to make, use, sell and offer for sale the
Original Work and Derivative Works.
3) Grant of Source Code License. The term "Source Code" means the preferred
form of the Original Work for making modifications to it and all available
documentation describing how to modify the Original Work. Licensor hereby
agrees to provide a machine-readable copy of the Source Code of the Original
Work along with each copy of the Original Work that Licensor distributes.
Licensor reserves the right to satisfy this obligation by placing a
machine-readable copy of the Source Code in an information repository
reasonably calculated to permit inexpensive and convenient access by You for as
long as Licensor continues to distribute the Original Work, and by publishing
the address of that information repository in a notice immediately following
the copyright notice that applies to the Original Work.
4) Exclusions From License Grant. Neither the names of Licensor, nor the names
of any contributors to the Original Work, nor any of their trademarks or
service marks, may be used to endorse or promote products derived from this
Original Work without express prior written permission of the Licensor. Nothing
in this License shall be deemed to grant any rights to trademarks, copyrights,
patents, trade secrets or any other intellectual property of Licensor except as
expressly stated herein. No patent license is granted to make, use, sell or
offer to sell embodiments of any patent claims other than the licensed claims
defined in Section 2. No right is granted to the trademarks of Licensor even if
such marks are included in the Original Work. Nothing in this License shall be
interpreted to prohibit Licensor from licensing under different terms from this
License any Original Work that Licensor otherwise would have a right to
license.
5) This section intentionally omitted.
6) Attribution Rights. You must retain, in the Source Code of any Derivative
Works that You create, all copyright, patent or trademark notices from the
Source Code of the Original Work, as well as any notices of licensing and any
descriptive text identified therein as an "Attribution Notice." You must cause
the Source Code for any Derivative Works that You create to carry a prominent
Attribution Notice reasonably calculated to inform recipients that You have
modified the Original Work.
7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that
the copyright in and to the Original Work and the patent rights granted herein
by Licensor are owned by the Licensor or are sublicensed to You under the terms
of this License with the permission of the contributor(s) of those copyrights
and patent rights. Except as expressly stated in the immediately proceeding
sentence, the Original Work is provided under this License on an "AS IS" BASIS
and WITHOUT WARRANTY, either express or implied, including, without limitation,
the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU.
This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No
license to Original Work is granted hereunder except under this disclaimer.
8) Limitation of Liability. Under no circumstances and under no legal theory,
whether in tort (including negligence), contract, or otherwise, shall the
Licensor be liable to any person for any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License
or the use of the Original Work including, without limitation, damages for loss
of goodwill, work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses. This limitation of liability shall not
apply to liability for death or personal injury resulting from Licensor's
negligence to the extent applicable law prohibits such limitation. Some
jurisdictions do not allow the exclusion or limitation of incidental or
consequential damages, so this exclusion and limitation may not apply to You.
9) Acceptance and Termination. If You distribute copies of the Original Work or
a Derivative Work, You must make a reasonable effort under the circumstances to
obtain the express assent of recipients to the terms of this License. Nothing
else but this License (or another written agreement between Licensor and You)
grants You permission to create Derivative Works based upon the Original Work
or to exercise any of the rights granted in Section 1 herein, and any attempt
to do so except under the terms of this License (or another written agreement
between Licensor and You) is expressly prohibited by U.S. copyright law, the
equivalent laws of other countries, and by international treaty. Therefore, by
exercising any of the rights granted to You in Section 1 herein, You indicate
Your acceptance of this License and all of its terms and conditions.
10) Termination for Patent Action. This License shall terminate automatically
and You may no longer exercise any of the rights granted to You by this License
as of the date You commence an action, including a cross-claim or counterclaim,
against Licensor or any licensee alleging that the Original Work infringes a
patent. This termination provision shall not apply for an action alleging
patent infringement by combinations of the Original Work with other software or
hardware.
11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
License may be brought only in the courts of a jurisdiction wherein the
Licensor resides or in which Licensor conducts its primary business, and under
the laws of that jurisdiction excluding its conflict-of-law provisions. The
application of the United Nations Convention on Contracts for the International
Sale of Goods is expressly excluded. Any use of the Original Work outside the
scope of this License or after its termination shall be subject to the
requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101 et
seq., the equivalent laws of other countries, and international treaty. This
section shall survive the termination of this License.
12) Attorneys Fees. In any action to enforce the terms of this License or
seeking damages relating thereto, the prevailing party shall be entitled to
recover its costs and expenses, including, without limitation, reasonable
attorneys' fees and costs incurred in connection with such action, including
any appeal of such action. This section shall survive the termination of this
License.
13) Miscellaneous. This License represents the complete agreement concerning
the subject matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent necessary to
make it enforceable.
14) Definition of "You" in This License. "You" throughout this License, whether
in upper or lower case, means an individual or a legal entity exercising rights
under, and complying with all of the terms of, this License. For legal
entities, "You" includes any entity that controls, is controlled by, or is
under common control with you. For purposes of this definition, "control" means
(i) the power, direct or indirect, to cause the direction or management of such
entity, whether by contract or otherwise, or (ii) ownership of fifty percent
(50%) or more of the outstanding shares, or (iii) beneficial ownership of such
entity.
15) Right to Use. You may use the Original Work in all ways not otherwise
restricted or conditioned by this License or by law, and Licensor promises not
to interfere with or be responsible for such uses by You.
This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights reserved.
Permission is hereby granted to copy and distribute this license without
modification. This license may not be modified without the express written
permission of its copyright owner.

1997
vendor/dojo/dojo.js vendored Normal file

File diff suppressed because it is too large Load Diff

0
vendor/firebug-lite/license.txt vendored Normal file → Executable file
View File

0
vendor/firebug-lite/skin/xp/blank.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 43 B

After

Width:  |  Height:  |  Size: 43 B

0
vendor/firebug-lite/skin/xp/buttonBg.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 167 B

0
vendor/firebug-lite/skin/xp/buttonBgHover.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 171 B

0
vendor/firebug-lite/skin/xp/debugger.css vendored Normal file → Executable file
View File

0
vendor/firebug-lite/skin/xp/detach.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 655 B

After

Width:  |  Height:  |  Size: 655 B

0
vendor/firebug-lite/skin/xp/detachHover.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 586 B

After

Width:  |  Height:  |  Size: 586 B

0
vendor/firebug-lite/skin/xp/disable.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 340 B

After

Width:  |  Height:  |  Size: 340 B

0
vendor/firebug-lite/skin/xp/disable.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 543 B

0
vendor/firebug-lite/skin/xp/disableHover.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 344 B

0
vendor/firebug-lite/skin/xp/disableHover.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 512 B

After

Width:  |  Height:  |  Size: 512 B

0
vendor/firebug-lite/skin/xp/down.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 637 B

After

Width:  |  Height:  |  Size: 637 B

0
vendor/firebug-lite/skin/xp/downActive.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 543 B

0
vendor/firebug-lite/skin/xp/downHover.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 526 B

After

Width:  |  Height:  |  Size: 526 B

Some files were not shown because too many files have changed in this diff Show More