diff --git a/.gitignore b/.gitignore
index 01de01e..2e6d5b8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,3 @@
-bower_components
node_modules
!.gitkeep
*.log
-public
diff --git a/bower_components/accessibility-developer-tools/.bower.json b/bower_components/accessibility-developer-tools/.bower.json
new file mode 100644
index 0000000..9b7493c
--- /dev/null
+++ b/bower_components/accessibility-developer-tools/.bower.json
@@ -0,0 +1,40 @@
+{
+ "name": "accessibility-developer-tools",
+ "version": "2.12.0",
+ "homepage": "https://github.com/GoogleChrome/accessibility-developer-tools",
+ "authors": [
+ "Google"
+ ],
+ "description": "This is a library of accessibility-related testing and utility code.",
+ "main": "dist/js/axs_testing.js",
+ "moduleType": [
+ "amd",
+ "globals"
+ ],
+ "keywords": [
+ "accessibility",
+ "testing",
+ "WCAG",
+ "module"
+ ],
+ "license": "Apache-2.0",
+ "ignore": [
+ "**/.*",
+ "lib",
+ "scripts",
+ "src",
+ "test",
+ "tools",
+ "Gruntfile.js",
+ "package.json"
+ ],
+ "_release": "2.12.0",
+ "_resolution": {
+ "type": "version",
+ "tag": "v2.12.0",
+ "commit": "3616c094e090174f70b53ca4cea25529522abffb"
+ },
+ "_source": "https://github.com/GoogleChrome/accessibility-developer-tools.git",
+ "_target": "^2.10.0",
+ "_originalSource": "accessibility-developer-tools"
+}
\ No newline at end of file
diff --git a/bower_components/accessibility-developer-tools/Changelog.md b/bower_components/accessibility-developer-tools/Changelog.md
new file mode 100644
index 0000000..e587f7e
--- /dev/null
+++ b/bower_components/accessibility-developer-tools/Changelog.md
@@ -0,0 +1,154 @@
+## 2.11.0 - 2016-09-14
+
+### Enhancements
+
+* Performance enhancements (#263)
+
+## 2.10.1-rc.0 - 2016-01-13
+
+### Bug fixes:
+
+* Escape special characters to be used in a query selector string (PR #267)
+* Fix exception thrown by RoleTooltipRequiresDescribedBy.js (#269)
+
+## 2.10.0 - 2015-11-13
+
+## 2.10.0-rc.1 - 2015-10-19
+
+### Bug fixes:
+
+* `linkWithUnclearPurpose` should only look at links, not `` without `href`. (#245)
+
+## 2.10.0-rc.0 - 2015-10-09
+
+### New rules
+* A tabpanel should be related to a tab via aria-controls or aria-labelledby (`src/audits/UncontrolledTabpanel.js`)
+* A data table must identify row and column headers (`src/audits/TableHasAppropriateHeaders.js`)
+* A tooltip element should have an aria-describedby referring to it (`src/audits/RoleTooltipRequiresDescribedBy.js`).
+
+### Enhancements
+
+* Pull DOM-related functionality out into `DOMUtils.js`
+
+### Bug fixes:
+
+* Fix `findTextAlternatives` not always correctly ignoring hidden elements (#217).
+* `findTextAlternatives` now honors `alt` attribute of input type image
+* Revert #150 which was causing the extension not to work.
+* AX_HTML_02 (duplicate IDs) now only audits elements that are referenced by an IDREF (#141);
+* Fix #171 by being smarter about finding the composed parent node.
+* Tweak in canScrollTo to handle the (common) case where the container is `document.body` (#243).
+
+## 2.9.0 - 2015-09-04
+
+## 2.9.0-rc.0 - 2015-08-21
+
+### New rules
+
+* A label element may not have labelable descendants other than its labeled control (`src/audits/MultipleLabelableElementsPerLabel.js`)
+
+### Enhancements
+
+* Implement support for specifying audit configuration options through an object when initializing audits (#165).
+* Implement support for AMD loaders.
+
+### Bug fixes:
+
+* Fix `badAriaAttributeValue` not correctly handling decimal values (#182).
+* Work around null pointer exception caused by closure compiler issue (#183).
+* Add a special case to handle color `"transparent"` to fix (#180).
+* Fix `matchSelector` not working properly in browser environments without vendor prefixes (#189).
+* Fix false positives on elements with no role for Unsupported ARIA Attribute rule (#178 and #199).
+* Fix ARIA `tablist` and ARIA `tab` scope (#204)
+* Fix link with clear purpose with text alternative (#156);
+* Handle edge cases in number parser, e.g. "+1", ".1", "01"
+* HTML button containing img with alt attribute now passes controlsWithoutLabel (#202)
+* Disabled elements should be ignored by low contrast audit (#205)
+* Fix input of type "text" did not find correct implied role (#225)
+* Hidden links are no longer relevant for meaningful link text rule.
+
+## 2.8.0 - 2015-07-24
+
+## 2.8.0-rc.0 - 2015-07-10
+
+### Enhancements:
+* Pull color code into separate file.
+* Improve color suggestion algorithm.
+* Descend into iframes when collecting matching elements.
+
+## 2.7.1 - 2015-06-30
+
+## 2.7.1-rc.1 - 2015-06-23
+
+### Bug fixes:
+
+* Check for null `textAlternatives` in `FocusableElementNotVisibleAndNotAriaHidden`'s `relevantElementMatcher` method.
+
+## 2.7.1-rc.0 - 2015-06-15
+
+### Enhancements:
+* Rework findTextAlternatives not to return non-exposed text alternatives.
+* Add Bower config (#157)
+
+### Bug fixes:
+* Check for any text alternatives when assessing unlabeled images (#154).
+
+## 2.7.0 - 2015-05-15
+
+### New rules
+* This element does not support ARIA roles, states and properties (`src/audits/AriaOnReservedElement.js`)
+* aria-owns should not be used if ownership is implicit in the DOM (`src/audits/AriaOwnsDescendant.js`)
+* Elements with ARIA roles must be in the correct scope (`src/audits/AriaRoleNotScoped.js`)
+* An element's ID must be unique in the DOM (`src/audits/DuplicateId.js`)
+* The web page should have the content's human language indicated in the markup (`src/audits/HumanLangMissing.js`)
+* An element's ID must not be present in more that one aria-owns attribute at any time (`src/audits/MultipleAriaOwners.js`)
+* ARIA attributes which refer to other elements by ID should refer to elements which exist in the DOM (`src/audits/NonExistentAriaRelatedElement.js` - previously `src/audits/NonExistentAriaLabeledBy.js`)
+* Elements with ARIA roles must ensure required owned elements are present (`src/audits/RequiredOwnedAriaRoleMissing.js`)
+* Avoid positive integer values for tabIndex (`src/audits/TabIndexGreaterThanZero.js`)
+* This element has an unsupported ARIA attribute (`src/audits/UnsupportedAriaAttribute.js`)
+
+### Enhancements:
+* Add configurable blacklist phrases and stop words to LinkWithUnclearPurpose (#99)
+* Detect and warn if we reuse the same code for more than one rule. (#133)
+* Force focus before testing visibility on focusable elements. (#65)
+* Use getDistributedNodes to get nodes distributed into shadowRoots (#128)
+* Add section to Audit Rules page for HumanLangMissing and link to it from rule (#119)
+* Reference "applied role" in axs.utils.getRoles enhancement (#130)
+* Add warning that AX_FOCUS_02 is not available from axs.Audit.run() (#85)
+
+### Bug fixes:
+* Incorrect use of nth-of-type against className in utils.getQuerySelectorText (#87)
+* AX_TEXT_01 Accessibility Audit test should probably ignore role=presentation elements (#97)
+* Fix path to audit rules in phantomjs runner (#108)
+* Label audit should fail if form fields lack a label, even with placeholder text (#81)
+* False positives for controls without labels with role=presentation (#23)
+* Fix "valid" flag on return value of axs.utils.getRoles (#131)
+
+Note: this version number is somewhat arbitrary - just bringing it vaguely in line with [the extension](https://github.com/GoogleChrome/accessibility-developer-tools-extension) since that's where the library originated - but will use semver for version bumps going forward from here.
+
+## 0.0.5 - 2014-02-04
+
+### Enhancements:
+* overlapping elements detection code made more sophisticated
+* axs.properties.getFocusProperties() returns more information about visibility
+* new axs.properties.hasDirectTextDescendant() method with more sophisticated detection of text content
+
+### Bug fixes:
+* FocusableElementNotVisibleAndNotAriaHidden audit passes on elements which are brought onscreen on focus
+* UnfocusableElementsWithOnclick checks for element.disabled
+* Fix infinite loop when getting descendant text content of a label containing an input
+* Detect elements which are out of scroll area of any parent element, not just the document scroll area
+* findTextAlternatives doesn't throw TypeError if used on a HTMLSelectElement
+
+## 0.0.4 - 2013-10-03
+
+### Enhancements:
+
+* axs.AuditRule.run() has a new signature: it now takes an options object. Please see method documentation for details.
+* Audit Rule severity can be overridden (per Audit Rule) in AuditConfig.
+
+### Bug fixes:
+
+* axs.utils.isLowContrast() now rounds to the nearest 0.1 before checking (so `#777` is now a passing value)
+* MainRoleOnInappropriateElement was always failing due to accessible name calculation taking the main role into account and not descending into content (now just gets descendant content directly)
+* UnfocusableElementsWithOnClick had a dangling if-statement causing very noisy false positives
diff --git a/bower_components/accessibility-developer-tools/LICENSE b/bower_components/accessibility-developer-tools/LICENSE
new file mode 100644
index 0000000..d645695
--- /dev/null
+++ b/bower_components/accessibility-developer-tools/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the 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.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/bower_components/accessibility-developer-tools/README.md b/bower_components/accessibility-developer-tools/README.md
new file mode 100644
index 0000000..3bc1a10
--- /dev/null
+++ b/bower_components/accessibility-developer-tools/README.md
@@ -0,0 +1,222 @@
+[![Build Status](https://travis-ci.org/GoogleChrome/accessibility-developer-tools.svg?branch=master)](https://travis-ci.org/GoogleChrome/accessibility-developer-tools)
+[![npm version](https://img.shields.io/npm/v/accessibility-developer-tools.svg)](https://www.npmjs.com/package/accessibility-developer-tools)
+[![npm downloads](https://img.shields.io/npm/dm/accessibility-developer-tools.svg)](https://www.npmjs.com/package/accessibility-developer-tools)
+
+# Accessibility Developer Tools
+
+This is a library of accessibility-related testing and utility code.
+
+Its main component is the accessibility audit: a collection of audit rules checking for common accessibility problems, and an API for running these rules in an HTML page.
+
+There is also a collection of accessibility-related utility code, including but not limited to:
+* contrast ratio calculation and color suggestions
+* retrieving and validating ARIA attributes and states
+* accessible name calculation using the algorithm at [http://www.w3.org/TR/wai-aria/roles#textalternativecomputation](http://www.w3.org/TR/wai-aria/roles#textalternativecomputation)
+
+# Getting the code
+
+To include just the javascript rules, require the following file:
+
+ https://raw.github.com/GoogleChrome/accessibility-developer-tools/stable/dist/js/axs_testing.js
+
+ `git 1.6.5` or later:
+
+ % git clone --recursive https://github.com/GoogleChrome/accessibility-developer-tools.git
+
+ Before `git 1.6.5`:
+
+ % git clone https://github.com/GoogleChrome/accessibility-developer-tools.git
+ % cd accessibility-developer-tools
+ % git submodule init; git submodule update
+
+# Building
+
+You will need `node` and `grunt-cli` to build.
+
+1. (Once only) Install [Node.js](http://nodejs.org/) and `npm` - useful instructions here: [https://gist.github.com/isaacs/579814](https://gist.github.com/isaacs/579814)
+
+ Make sure you have Node.js v 0.8 or higher.
+
+2. (Once only) Use `npm` to install `grunt-cli`
+
+ % npm install -g grunt-cli # May need to be run as root
+
+3. (Every time you make a fresh checkout) Install dependencies (including `grunt`) for this project (run from project root)
+
+ % npm install
+
+4. (Rebuild if you make changes) Build using `grunt` (run from project root)
+
+ % grunt
+
+
+## Troubleshooting
+
+This project uses [Closure Compiler](https://github.com/google/closure-compiler) to build our releases. You may need to install a recent version of [JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html) in order for builds to successfully complete.
+
+# Using the Audit API
+
+## Including the library
+
+The simplest option is to include the generated `axs_testing.js` library on your page. After you build, you will have two versions of `axs_testings.js`:
+* Distribution Build: project-root/dist/js/axs_testing.js
+* Local Build (use if you make changes): project-root/tmp/build/axs_testing.js
+
+Work is underway to include the library in WebDriver and other automated testing frameworks.
+
+## The `axs.Audit.run()` method
+
+Once you have included `axs_testing.js`, you can call `axs.Audit.run()`. This returns an object in the following form:
+
+ {
+ /** @type {axs.constants.AuditResult} */
+ result, // one of PASS, FAIL or NA
+
+ /** @type {Array.} */
+ elements, // The elements which the rule fails on, if result == axs.constants.AuditResult.FAIL
+
+ /** @type {axs.AuditRule} */
+ rule // The rule which this result is for.
+ }
+
+### Command Line Runner
+
+The Accessibility Developer Tools project includes a command line runner for the audit. To use the runner, [install phantomjs](http://phantomjs.org/download.html) then run the following command from the project root directory.
+
+ $ phantomjs tools/runner/audit.js
+
+The runner will load the specified file or URL in a headless browser, inject axs_testing.js, run the audit and output the report text.
+
+### Run audit from Selenium WebDriver (Scala):
+ val driver = org.openqa.selenium.firefox.FirefoxDriver //use driver of your choice
+ val jse = driver.asInstanceOf[JavascriptExecutor]
+ jse.executeScript(scala.io.Source.fromURL("https://raw.githubusercontent.com/GoogleChrome/" +
+ "accessibility-developer-tools/stable/dist/js/axs_testing.js").mkString)
+ val report = jse.executeScript("var results = axs.Audit.run();return axs.Audit.createReport(results);")
+ println(report)
+
+### Run audit from Selenium WebDriver (Scala)(with caching):
+ val cache = collection.mutable.Map[String, String]()
+ val driver = org.openqa.selenium.firefox.FirefoxDriver //use driver of your choice
+ val jse = driver.asInstanceOf[JavascriptExecutor]
+ def getUrlSource(arg: String): String = cache get arg match {
+ case Some(result) => result
+ case None =>
+ val result: String = scala.io.Source.fromURL(arg).mkString
+ cache(arg) = result
+ result
+ }
+ jse.executeScript(getUrlSource("https://raw.githubusercontent.com/GoogleChrome/" +
+ "accessibility-developer-tools/stable/dist/js/axs_testing.js"))
+ val report = js.executeScript("var results = axs.Audit.run();return axs.Audit.createReport(results);")
+ println(report)
+
+If println() outputs nothing, check if you need to set DesiredCapabilities for your WebDriver (such as loggingPrefs):
+https://code.google.com/p/selenium/wiki/DesiredCapabilities
+
+## Using the results
+
+### Interpreting the result
+
+The result may be one of three constants:
+* `axs.constants.AuditResult.PASS` - This implies that there were elements on the page that may potentially have failed this audit rule, but they passed. Congratulations!
+* `axs.constants.AuditResult.NA` - This implies that there were no elements on the page that may potentially have failed this audit rule. For example, an audit rule that checks video elements for subtitles would return this result if there were no video elements on the page.
+* `axs.constants.AuditResult.FAIL` - This implies that there were elements on the page that did not pass this audit rule. This is the only result you will probably be interested in.
+
+### Creating a useful error message
+
+The static, global `axs.Audit.createReport(results, opt_url)` may be used to create an error message using the return value of axs.Audit.run(). This will look like the following:
+
+ *** Begin accessibility audit results ***
+ An accessibility audit found 4 errors and 4 warnings on this page.
+ For more information, please see https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules
+
+ Error: badAriaAttributeValue (AX_ARIA_04) failed on the following elements (1 - 3 of 3):
+ DIV:nth-of-type(3) > INPUT
+ DIV:nth-of-type(5) > INPUT
+ #aria-invalid
+
+ Error: badAriaRole (AX_ARIA_01) failed on the following element:
+ DIV:nth-of-type(11) > SPAN
+
+ Error: controlsWithoutLabel (AX_TEXT_01) failed on the following elements (1 - 3 of 3):
+ DIV > INPUT
+ DIV:nth-of-type(12) > DIV:nth-of-type(3) > INPUT
+ LABEL > INPUT
+
+ Error: requiredAriaAttributeMissing (AX_ARIA_03) failed on the following element:
+ DIV:nth-of-type(13) > DIV:nth-of-type(11) > DIV
+
+ Warning: focusableElementNotVisibleAndNotAriaHidden (AX_FOCUS_01) failed on the following element:
+ #notariahidden
+
+ Warning: imagesWithoutAltText (AX_TEXT_02) failed on the following elements (1 - 2 of 2):
+ #deceptive-img
+ DIV:nth-of-type(13) > IMG
+
+ Warning: lowContrastElements (AX_COLOR_01) failed on the following elements (1 - 2 of 2):
+ DIV:nth-of-type(13) > DIV
+ DIV:nth-of-type(13) > DIV:nth-of-type(3)
+
+ Warning: nonExistentAriaLabelledbyElement (AX_ARIA_02) failed on the following elements (1 - 2 of 2):
+ DIV:nth-of-type(3) > INPUT
+ DIV:nth-of-type(5) > INPUT
+ *** End accessibility audit results ***
+
+Each rule will have at most five elements listed as failures, in the form of a unique query selector for each element.
+
+### Configuring the Audit
+
+If you wish to fine-tune the audit, you can create an `axs.AuditConfiguration` object, with the following options:
+
+#### Ignore parts of the page for a particular audit rule
+
+For example, say you have a separate high-contrast version of your page, and there is a CSS rule which causes certain elements (with class `pretty`) on the page to be low-contrast for stylistic reasons. Running the audit unmodified produces results something like
+
+ Warning: lowContrastElements (AX_COLOR_01) failed on the following elements (1 - 5 of 15):
+ ...
+
+You can modify the audit to ignore the elements which are known and intended to have low contrast like this:
+
+ var configuration = new axs.AuditConfiguration();
+ configuration.ignoreSelectors('lowContrastElements', '.pretty');
+ axs.Audit.run(configuration);
+
+The `AuditConfiguration.ignoreSelectors()` method takes a rule name, which you can find in the audit report, and a query selector string representing the parts of the page to be ignored for that audit rule. Multiple calls to `ignoreSelectors()` can be made for each audit rule, if multiple selectors need to be ignored.
+
+#### Restrict the scope of the entire audit to a subsection of the page
+
+You may have a part of the page which varies while other parts of the page stay constant, like a content area vs. a toolbar. In this case, running the audit on the entire page may give you spurious results in the part of the page which doesn't vary, which may drown out regressions in the main part of the page.
+
+You can set a `scope` on the `AuditConfiguration` object like this:
+
+ var configuration = new axs.AuditConfiguration();
+ configuration.scope = document.querySelector('main'); // or however you wish to choose your scope element
+ axs.Audit.run(configuration);
+
+You may also specify a configuration payload while instantiating the `axs.AuditConfiguration`,
+which allows you to provide multiple configuration options at once.
+
+ var configuration = new axs.AuditConfiguration({
+ auditRulesToRun: ['badAriaRole'],
+ scope: document.querySelector('main'),
+ maxResults: 5
+ });
+
+ axs.Audit.run(configuration);
+
+## License
+
+Copyright 2013 Google Inc. All Rights Reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/bower_components/accessibility-developer-tools/bower.json b/bower_components/accessibility-developer-tools/bower.json
new file mode 100644
index 0000000..ab38602
--- /dev/null
+++ b/bower_components/accessibility-developer-tools/bower.json
@@ -0,0 +1,31 @@
+{
+ "name": "accessibility-developer-tools",
+ "version": "2.11.0",
+ "homepage": "https://github.com/GoogleChrome/accessibility-developer-tools",
+ "authors": [
+ "Google"
+ ],
+ "description": "This is a library of accessibility-related testing and utility code.",
+ "main": "dist/js/axs_testing.js",
+ "moduleType": [
+ "amd",
+ "globals"
+ ],
+ "keywords": [
+ "accessibility",
+ "testing",
+ "WCAG",
+ "module"
+ ],
+ "license": "Apache-2.0",
+ "ignore": [
+ "**/.*",
+ "lib",
+ "scripts",
+ "src",
+ "test",
+ "tools",
+ "Gruntfile.js",
+ "package.json"
+ ]
+}
diff --git a/bower_components/accessibility-developer-tools/dist/js/axs_testing.js b/bower_components/accessibility-developer-tools/dist/js/axs_testing.js
new file mode 100644
index 0000000..1f83c95
--- /dev/null
+++ b/bower_components/accessibility-developer-tools/dist/js/axs_testing.js
@@ -0,0 +1,2402 @@
+/*
+ * Copyright 2017 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Generated from http://github.com/GoogleChrome/accessibility-developer-tools/tree/9acd1c6e3e72a39a0ec14506d68203a4e8cfafb4
+ *
+ * See project README for build steps.
+ */
+
+// AUTO-GENERATED CONTENT BELOW: DO NOT EDIT! See above for details.
+
+var fn = (function() {
+ var COMPILED = !0, goog = goog || {};
+goog.global = this;
+goog.isDef = function(a) {
+ return void 0 !== a;
+};
+goog.exportPath_ = function(a, b, c) {
+ a = a.split(".");
+ c = c || goog.global;
+ a[0] in c || !c.execScript || c.execScript("var " + a[0]);
+ for (var d;a.length && (d = a.shift());) {
+ !a.length && goog.isDef(b) ? c[d] = b : c = c[d] ? c[d] : c[d] = {};
+ }
+};
+goog.define = function(a, b) {
+ var c = b;
+ COMPILED || (goog.global.CLOSURE_UNCOMPILED_DEFINES && Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_UNCOMPILED_DEFINES, a) ? c = goog.global.CLOSURE_UNCOMPILED_DEFINES[a] : goog.global.CLOSURE_DEFINES && Object.prototype.hasOwnProperty.call(goog.global.CLOSURE_DEFINES, a) && (c = goog.global.CLOSURE_DEFINES[a]));
+ goog.exportPath_(a, c);
+};
+goog.DEBUG = !0;
+goog.LOCALE = "en";
+goog.TRUSTED_SITE = !0;
+goog.STRICT_MODE_COMPATIBLE = !1;
+goog.DISALLOW_TEST_ONLY_CODE = COMPILED && !goog.DEBUG;
+goog.ENABLE_CHROME_APP_SAFE_SCRIPT_LOADING = !1;
+goog.provide = function(a) {
+ if (goog.isInModuleLoader_()) {
+ throw Error("goog.provide can not be used within a goog.module.");
+ }
+ if (!COMPILED && goog.isProvided_(a)) {
+ throw Error('Namespace "' + a + '" already declared.');
+ }
+ goog.constructNamespace_(a);
+};
+goog.constructNamespace_ = function(a, b) {
+ if (!COMPILED) {
+ delete goog.implicitNamespaces_[a];
+ for (var c = a;(c = c.substring(0, c.lastIndexOf("."))) && !goog.getObjectByName(c);) {
+ goog.implicitNamespaces_[c] = !0;
+ }
+ }
+ goog.exportPath_(a, b);
+};
+goog.VALID_MODULE_RE_ = /^[a-zA-Z_$][a-zA-Z0-9._$]*$/;
+goog.module = function(a) {
+ if (!goog.isString(a) || !a || -1 == a.search(goog.VALID_MODULE_RE_)) {
+ throw Error("Invalid module identifier");
+ }
+ if (!goog.isInModuleLoader_()) {
+ throw Error("Module " + a + " has been loaded incorrectly. Note, modules cannot be loaded as normal scripts. They require some kind of pre-processing step. You're likely trying to load a module via a script tag or as a part of a concatenated bundle without rewriting the module. For more info see: https://github.com/google/closure-library/wiki/goog.module:-an-ES6-module-like-alternative-to-goog.provide.");
+ }
+ if (goog.moduleLoaderState_.moduleName) {
+ throw Error("goog.module may only be called once per module.");
+ }
+ goog.moduleLoaderState_.moduleName = a;
+ if (!COMPILED) {
+ if (goog.isProvided_(a)) {
+ throw Error('Namespace "' + a + '" already declared.');
+ }
+ delete goog.implicitNamespaces_[a];
+ }
+};
+goog.module.get = function(a) {
+ return goog.module.getInternal_(a);
+};
+goog.module.getInternal_ = function(a) {
+ if (!COMPILED) {
+ if (a in goog.loadedModules_) {
+ return goog.loadedModules_[a];
+ }
+ if (!goog.implicitNamespaces_[a]) {
+ return a = goog.getObjectByName(a), null != a ? a : null;
+ }
+ }
+ return null;
+};
+goog.moduleLoaderState_ = null;
+goog.isInModuleLoader_ = function() {
+ return null != goog.moduleLoaderState_;
+};
+goog.module.declareLegacyNamespace = function() {
+ if (!COMPILED && !goog.isInModuleLoader_()) {
+ throw Error("goog.module.declareLegacyNamespace must be called from within a goog.module");
+ }
+ if (!COMPILED && !goog.moduleLoaderState_.moduleName) {
+ throw Error("goog.module must be called prior to goog.module.declareLegacyNamespace.");
+ }
+ goog.moduleLoaderState_.declareLegacyNamespace = !0;
+};
+goog.setTestOnly = function(a) {
+ if (goog.DISALLOW_TEST_ONLY_CODE) {
+ throw a = a || "", Error("Importing test-only code into non-debug environment" + (a ? ": " + a : "."));
+ }
+};
+goog.forwardDeclare = function(a) {
+};
+COMPILED || (goog.isProvided_ = function(a) {
+ return a in goog.loadedModules_ || !goog.implicitNamespaces_[a] && goog.isDefAndNotNull(goog.getObjectByName(a));
+}, goog.implicitNamespaces_ = {"goog.module":!0});
+goog.getObjectByName = function(a, b) {
+ for (var c = a.split("."), d = b || goog.global, e;e = c.shift();) {
+ if (goog.isDefAndNotNull(d[e])) {
+ d = d[e];
+ } else {
+ return null;
+ }
+ }
+ return d;
+};
+goog.globalize = function(a, b) {
+ var c = b || goog.global, d;
+ for (d in a) {
+ c[d] = a[d];
+ }
+};
+goog.addDependency = function(a, b, c, d) {
+ if (goog.DEPENDENCIES_ENABLED) {
+ var e;
+ a = a.replace(/\\/g, "/");
+ var f = goog.dependencies_;
+ d && "boolean" !== typeof d || (d = d ? {module:"goog"} : {});
+ for (var g = 0;e = b[g];g++) {
+ f.nameToPath[e] = a, f.loadFlags[a] = d;
+ }
+ for (d = 0;b = c[d];d++) {
+ a in f.requires || (f.requires[a] = {}), f.requires[a][b] = !0;
+ }
+ }
+};
+goog.ENABLE_DEBUG_LOADER = !0;
+goog.logToConsole_ = function(a) {
+ goog.global.console && goog.global.console.error(a);
+};
+goog.require = function(a) {
+ if (!COMPILED) {
+ goog.ENABLE_DEBUG_LOADER && goog.IS_OLD_IE_ && goog.maybeProcessDeferredDep_(a);
+ if (goog.isProvided_(a)) {
+ if (goog.isInModuleLoader_()) {
+ return goog.module.getInternal_(a);
+ }
+ } else {
+ if (goog.ENABLE_DEBUG_LOADER) {
+ var b = goog.getPathFromDeps_(a);
+ if (b) {
+ goog.writeScripts_(b);
+ } else {
+ throw a = "goog.require could not find: " + a, goog.logToConsole_(a), Error(a);
+ }
+ }
+ }
+ return null;
+ }
+};
+goog.basePath = "";
+goog.nullFunction = function() {
+};
+goog.abstractMethod = function() {
+ throw Error("unimplemented abstract method");
+};
+goog.addSingletonGetter = function(a) {
+ a.getInstance = function() {
+ if (a.instance_) {
+ return a.instance_;
+ }
+ goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = a);
+ return a.instance_ = new a;
+ };
+};
+goog.instantiatedSingletons_ = [];
+goog.LOAD_MODULE_USING_EVAL = !0;
+goog.SEAL_MODULE_EXPORTS = goog.DEBUG;
+goog.loadedModules_ = {};
+goog.DEPENDENCIES_ENABLED = !COMPILED && goog.ENABLE_DEBUG_LOADER;
+goog.TRANSPILE = "detect";
+goog.TRANSPILER = "transpile.js";
+goog.DEPENDENCIES_ENABLED && (goog.dependencies_ = {loadFlags:{}, nameToPath:{}, requires:{}, visited:{}, written:{}, deferred:{}}, goog.inHtmlDocument_ = function() {
+ var a = goog.global.document;
+ return null != a && "write" in a;
+}, goog.findBasePath_ = function() {
+ if (goog.isDef(goog.global.CLOSURE_BASE_PATH)) {
+ goog.basePath = goog.global.CLOSURE_BASE_PATH;
+ } else {
+ if (goog.inHtmlDocument_()) {
+ for (var a = goog.global.document.getElementsByTagName("SCRIPT"), b = a.length - 1;0 <= b;--b) {
+ var c = a[b].src, d = c.lastIndexOf("?"), d = -1 == d ? c.length : d;
+ if ("base.js" == c.substr(d - 7, 7)) {
+ goog.basePath = c.substr(0, d - 7);
+ break;
+ }
+ }
+ }
+ }
+}, goog.importScript_ = function(a, b) {
+ (goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_)(a, b) && (goog.dependencies_.written[a] = !0);
+}, goog.IS_OLD_IE_ = !(goog.global.atob || !goog.global.document || !goog.global.document.all), goog.importProcessedScript_ = function(a, b, c) {
+ goog.importScript_("", 'goog.retrieveAndExec_("' + a + '", ' + b + ", " + c + ");");
+}, goog.queuedModules_ = [], goog.wrapModule_ = function(a, b) {
+ return goog.LOAD_MODULE_USING_EVAL && goog.isDef(goog.global.JSON) ? "goog.loadModule(" + goog.global.JSON.stringify(b + "\n//# sourceURL=" + a + "\n") + ");" : 'goog.loadModule(function(exports) {"use strict";' + b + "\n;return exports});\n//# sourceURL=" + a + "\n";
+}, goog.loadQueuedModules_ = function() {
+ var a = goog.queuedModules_.length;
+ if (0 < a) {
+ var b = goog.queuedModules_;
+ goog.queuedModules_ = [];
+ for (var c = 0;c < a;c++) {
+ goog.maybeProcessDeferredPath_(b[c]);
+ }
+ }
+}, goog.maybeProcessDeferredDep_ = function(a) {
+ goog.isDeferredModule_(a) && goog.allDepsAreAvailable_(a) && (a = goog.getPathFromDeps_(a), goog.maybeProcessDeferredPath_(goog.basePath + a));
+}, goog.isDeferredModule_ = function(a) {
+ var b = (a = goog.getPathFromDeps_(a)) && goog.dependencies_.loadFlags[a] || {}, c = b.lang || "es3";
+ return a && ("goog" == b.module || goog.needsTranspile_(c)) ? goog.basePath + a in goog.dependencies_.deferred : !1;
+}, goog.allDepsAreAvailable_ = function(a) {
+ if ((a = goog.getPathFromDeps_(a)) && a in goog.dependencies_.requires) {
+ for (var b in goog.dependencies_.requires[a]) {
+ if (!goog.isProvided_(b) && !goog.isDeferredModule_(b)) {
+ return !1;
+ }
+ }
+ }
+ return !0;
+}, goog.maybeProcessDeferredPath_ = function(a) {
+ if (a in goog.dependencies_.deferred) {
+ var b = goog.dependencies_.deferred[a];
+ delete goog.dependencies_.deferred[a];
+ goog.globalEval(b);
+ }
+}, goog.loadModuleFromUrl = function(a) {
+ goog.retrieveAndExec_(a, !0, !1);
+}, goog.writeScriptSrcNode_ = function(a) {
+ goog.global.document.write('
+
+```
+
+## Documentation
+
+Some functions are also available in the following forms:
+* `Series` - the same as `` but runs only a single async operation at a time
+* `Limit` - the same as `` but runs a maximum of `limit` async operations at a time
+
+### Collections
+
+* [`each`](#each), `eachSeries`, `eachLimit`
+* [`forEachOf`](#forEachOf), `forEachOfSeries`, `forEachOfLimit`
+* [`map`](#map), `mapSeries`, `mapLimit`
+* [`filter`](#filter), `filterSeries`, `filterLimit`
+* [`reject`](#reject), `rejectSeries`, `rejectLimit`
+* [`reduce`](#reduce), [`reduceRight`](#reduceRight)
+* [`detect`](#detect), `detectSeries`, `detectLimit`
+* [`sortBy`](#sortBy)
+* [`some`](#some), `someLimit`
+* [`every`](#every), `everyLimit`
+* [`concat`](#concat), `concatSeries`
+
+### Control Flow
+
+* [`series`](#seriestasks-callback)
+* [`parallel`](#parallel), `parallelLimit`
+* [`whilst`](#whilst), [`doWhilst`](#doWhilst)
+* [`until`](#until), [`doUntil`](#doUntil)
+* [`during`](#during), [`doDuring`](#doDuring)
+* [`forever`](#forever)
+* [`waterfall`](#waterfall)
+* [`compose`](#compose)
+* [`seq`](#seq)
+* [`applyEach`](#applyEach), `applyEachSeries`
+* [`queue`](#queue), [`priorityQueue`](#priorityQueue)
+* [`cargo`](#cargo)
+* [`auto`](#auto)
+* [`retry`](#retry)
+* [`iterator`](#iterator)
+* [`times`](#times), `timesSeries`, `timesLimit`
+
+### Utils
+
+* [`apply`](#apply)
+* [`nextTick`](#nextTick)
+* [`memoize`](#memoize)
+* [`unmemoize`](#unmemoize)
+* [`ensureAsync`](#ensureAsync)
+* [`constant`](#constant)
+* [`asyncify`](#asyncify)
+* [`wrapSync`](#wrapSync)
+* [`log`](#log)
+* [`dir`](#dir)
+* [`noConflict`](#noConflict)
+
+## Collections
+
+
+
+### each(arr, iterator, [callback])
+
+Applies the function `iterator` to each item in `arr`, in parallel.
+The `iterator` is called with an item from the list, and a callback for when it
+has finished. If the `iterator` passes an error to its `callback`, the main
+`callback` (for the `each` function) is immediately called with the error.
+
+Note, that since this function applies `iterator` to each item in parallel,
+there is no guarantee that the iterator functions will complete in order.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err)` which must be called once it has
+ completed. If no error has occurred, the `callback` should be run without
+ arguments or with an explicit `null` argument. The array index is not passed
+ to the iterator. If you need the index, use [`forEachOf`](#forEachOf).
+* `callback(err)` - *Optional* A callback which is called when all `iterator` functions
+ have finished, or an error occurs.
+
+__Examples__
+
+
+```js
+// assuming openFiles is an array of file names and saveFile is a function
+// to save the modified contents of that file:
+
+async.each(openFiles, saveFile, function(err){
+ // if any of the saves produced an error, err would equal that error
+});
+```
+
+```js
+// assuming openFiles is an array of file names
+
+async.each(openFiles, function(file, callback) {
+
+ // Perform operation on file here.
+ console.log('Processing file ' + file);
+
+ if( file.length > 32 ) {
+ console.log('This file name is too long');
+ callback('File name too long');
+ } else {
+ // Do work to process file here
+ console.log('File processed');
+ callback();
+ }
+}, function(err){
+ // if any of the file processing produced an error, err would equal that error
+ if( err ) {
+ // One of the iterations produced an error.
+ // All processing will now stop.
+ console.log('A file failed to process');
+ } else {
+ console.log('All files have been processed successfully');
+ }
+});
+```
+
+__Related__
+
+* eachSeries(arr, iterator, [callback])
+* eachLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+
+
+
+### forEachOf(obj, iterator, [callback])
+
+Like `each`, except that it iterates over objects, and passes the key as the second argument to the iterator.
+
+__Arguments__
+
+* `obj` - An object or array to iterate over.
+* `iterator(item, key, callback)` - A function to apply to each item in `obj`.
+The `key` is the item's key, or index in the case of an array. The iterator is
+passed a `callback(err)` which must be called once it has completed. If no
+error has occurred, the callback should be run without arguments or with an
+explicit `null` argument.
+* `callback(err)` - *Optional* A callback which is called when all `iterator` functions have finished, or an error occurs.
+
+__Example__
+
+```js
+var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
+var configs = {};
+
+async.forEachOf(obj, function (value, key, callback) {
+ fs.readFile(__dirname + value, "utf8", function (err, data) {
+ if (err) return callback(err);
+ try {
+ configs[key] = JSON.parse(data);
+ } catch (e) {
+ return callback(e);
+ }
+ callback();
+ })
+}, function (err) {
+ if (err) console.error(err.message);
+ // configs is now a map of JSON data
+ doSomethingWith(configs);
+})
+```
+
+__Related__
+
+* forEachOfSeries(obj, iterator, [callback])
+* forEachOfLimit(obj, limit, iterator, [callback])
+
+---------------------------------------
+
+
+### map(arr, iterator, [callback])
+
+Produces a new array of values by mapping each value in `arr` through
+the `iterator` function. The `iterator` is called with an item from `arr` and a
+callback for when it has finished processing. Each of these callback takes 2 arguments:
+an `error`, and the transformed item from `arr`. If `iterator` passes an error to its
+callback, the main `callback` (for the `map` function) is immediately called with the error.
+
+Note, that since this function applies the `iterator` to each item in parallel,
+there is no guarantee that the `iterator` functions will complete in order.
+However, the results array will be in the same order as the original `arr`.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err, transformed)` which must be called once
+ it has completed with an error (which can be `null`) and a transformed item.
+* `callback(err, results)` - *Optional* A callback which is called when all `iterator`
+ functions have finished, or an error occurs. Results is an array of the
+ transformed items from the `arr`.
+
+__Example__
+
+```js
+async.map(['file1','file2','file3'], fs.stat, function(err, results){
+ // results is now an array of stats for each file
+});
+```
+
+__Related__
+* mapSeries(arr, iterator, [callback])
+* mapLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+
+
+### filter(arr, iterator, [callback])
+
+__Alias:__ `select`
+
+Returns a new array of all the values in `arr` which pass an async truth test.
+_The callback for each `iterator` call only accepts a single argument of `true` or
+`false`; it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like `fs.exists`. This operation is
+performed in parallel, but the results array will be in the same order as the
+original.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in `arr`.
+ The `iterator` is passed a `callback(truthValue)`, which must be called with a
+ boolean argument once it has completed.
+* `callback(results)` - *Optional* A callback which is called after all the `iterator`
+ functions have finished.
+
+__Example__
+
+```js
+async.filter(['file1','file2','file3'], fs.exists, function(results){
+ // results now equals an array of the existing files
+});
+```
+
+__Related__
+
+* filterSeries(arr, iterator, [callback])
+* filterLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+
+### reject(arr, iterator, [callback])
+
+The opposite of [`filter`](#filter). Removes values that pass an `async` truth test.
+
+__Related__
+
+* rejectSeries(arr, iterator, [callback])
+* rejectLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+
+### reduce(arr, memo, iterator, [callback])
+
+__Aliases:__ `inject`, `foldl`
+
+Reduces `arr` into a single value using an async `iterator` to return
+each successive step. `memo` is the initial state of the reduction.
+This function only operates in series.
+
+For performance reasons, it may make sense to split a call to this function into
+a parallel map, and then use the normal `Array.prototype.reduce` on the results.
+This function is for situations where each step in the reduction needs to be async;
+if you can get the data before reducing it, then it's probably a good idea to do so.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `memo` - The initial state of the reduction.
+* `iterator(memo, item, callback)` - A function applied to each item in the
+ array to produce the next step in the reduction. The `iterator` is passed a
+ `callback(err, reduction)` which accepts an optional error as its first
+ argument, and the state of the reduction as the second. If an error is
+ passed to the callback, the reduction is stopped and the main `callback` is
+ immediately called with the error.
+* `callback(err, result)` - *Optional* A callback which is called after all the `iterator`
+ functions have finished. Result is the reduced value.
+
+__Example__
+
+```js
+async.reduce([1,2,3], 0, function(memo, item, callback){
+ // pointless async:
+ process.nextTick(function(){
+ callback(null, memo + item)
+ });
+}, function(err, result){
+ // result is now equal to the last value of memo, which is 6
+});
+```
+
+---------------------------------------
+
+
+### reduceRight(arr, memo, iterator, [callback])
+
+__Alias:__ `foldr`
+
+Same as [`reduce`](#reduce), only operates on `arr` in reverse order.
+
+
+---------------------------------------
+
+
+### detect(arr, iterator, [callback])
+
+Returns the first value in `arr` that passes an async truth test. The
+`iterator` is applied in parallel, meaning the first iterator to return `true` will
+fire the detect `callback` with that result. That means the result might not be
+the first item in the original `arr` (in terms of order) that passes the test.
+
+If order within the original `arr` is important, then look at [`detectSeries`](#detectSeries).
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in `arr`.
+ The iterator is passed a `callback(truthValue)` which must be called with a
+ boolean argument once it has completed. **Note: this callback does not take an error as its first argument.**
+* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
+ `true`, or after all the `iterator` functions have finished. Result will be
+ the first item in the array that passes the truth test (iterator) or the
+ value `undefined` if none passed. **Note: this callback does not take an error as its first argument.**
+
+__Example__
+
+```js
+async.detect(['file1','file2','file3'], fs.exists, function(result){
+ // result now equals the first file in the list that exists
+});
+```
+
+__Related__
+
+* detectSeries(arr, iterator, [callback])
+* detectLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+
+### sortBy(arr, iterator, [callback])
+
+Sorts a list by the results of running each `arr` value through an async `iterator`.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err, sortValue)` which must be called once it
+ has completed with an error (which can be `null`) and a value to use as the sort
+ criteria.
+* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`
+ functions have finished, or an error occurs. Results is the items from
+ the original `arr` sorted by the values returned by the `iterator` calls.
+
+__Example__
+
+```js
+async.sortBy(['file1','file2','file3'], function(file, callback){
+ fs.stat(file, function(err, stats){
+ callback(err, stats.mtime);
+ });
+}, function(err, results){
+ // results is now the original array of files sorted by
+ // modified date
+});
+```
+
+__Sort Order__
+
+By modifying the callback parameter the sorting order can be influenced:
+
+```js
+//ascending order
+async.sortBy([1,9,3,5], function(x, callback){
+ callback(null, x);
+}, function(err,result){
+ //result callback
+} );
+
+//descending order
+async.sortBy([1,9,3,5], function(x, callback){
+ callback(null, x*-1); //<- x*-1 instead of x, turns the order around
+}, function(err,result){
+ //result callback
+} );
+```
+
+---------------------------------------
+
+
+### some(arr, iterator, [callback])
+
+__Alias:__ `any`
+
+Returns `true` if at least one element in the `arr` satisfies an async test.
+_The callback for each iterator call only accepts a single argument of `true` or
+`false`; it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like `fs.exists`. Once any iterator
+call returns `true`, the main `callback` is immediately called.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in the array
+ in parallel. The iterator is passed a `callback(truthValue)`` which must be
+ called with a boolean argument once it has completed.
+* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
+ `true`, or after all the iterator functions have finished. Result will be
+ either `true` or `false` depending on the values of the async tests.
+
+ **Note: the callbacks do not take an error as their first argument.**
+__Example__
+
+```js
+async.some(['file1','file2','file3'], fs.exists, function(result){
+ // if result is true then at least one of the files exists
+});
+```
+
+__Related__
+
+* someLimit(arr, limit, iterator, callback)
+
+---------------------------------------
+
+
+### every(arr, iterator, [callback])
+
+__Alias:__ `all`
+
+Returns `true` if every element in `arr` satisfies an async test.
+_The callback for each `iterator` call only accepts a single argument of `true` or
+`false`; it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like `fs.exists`.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in the array
+ in parallel. The iterator is passed a `callback(truthValue)` which must be
+ called with a boolean argument once it has completed.
+* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
+ `false`, or after all the iterator functions have finished. Result will be
+ either `true` or `false` depending on the values of the async tests.
+
+ **Note: the callbacks do not take an error as their first argument.**
+
+__Example__
+
+```js
+async.every(['file1','file2','file3'], fs.exists, function(result){
+ // if result is true then every file exists
+});
+```
+
+__Related__
+
+* everyLimit(arr, limit, iterator, callback)
+
+---------------------------------------
+
+
+### concat(arr, iterator, [callback])
+
+Applies `iterator` to each item in `arr`, concatenating the results. Returns the
+concatenated list. The `iterator`s are called in parallel, and the results are
+concatenated as they return. There is no guarantee that the results array will
+be returned in the original order of `arr` passed to the `iterator` function.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err, results)` which must be called once it
+ has completed with an error (which can be `null`) and an array of results.
+* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`
+ functions have finished, or an error occurs. Results is an array containing
+ the concatenated results of the `iterator` function.
+
+__Example__
+
+```js
+async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){
+ // files is now a list of filenames that exist in the 3 directories
+});
+```
+
+__Related__
+
+* concatSeries(arr, iterator, [callback])
+
+
+## Control Flow
+
+
+### series(tasks, [callback])
+
+Run the functions in the `tasks` array in series, each one running once the previous
+function has completed. If any functions in the series pass an error to its
+callback, no more functions are run, and `callback` is immediately called with the value of the error.
+Otherwise, `callback` receives an array of results when `tasks` have completed.
+
+It is also possible to use an object instead of an array. Each property will be
+run as a function, and the results will be passed to the final `callback` as an object
+instead of an array. This can be a more readable way of handling results from
+[`series`](#series).
+
+**Note** that while many implementations preserve the order of object properties, the
+[ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)
+explicitly states that
+
+> The mechanics and order of enumerating the properties is not specified.
+
+So if you rely on the order in which your series of functions are executed, and want
+this to work on all platforms, consider using an array.
+
+__Arguments__
+
+* `tasks` - An array or object containing functions to run, each function is passed
+ a `callback(err, result)` it must call on completion with an error `err` (which can
+ be `null`) and an optional `result` value.
+* `callback(err, results)` - An optional callback to run once all the functions
+ have completed. This function gets a results array (or object) containing all
+ the result arguments passed to the `task` callbacks.
+
+__Example__
+
+```js
+async.series([
+ function(callback){
+ // do some stuff ...
+ callback(null, 'one');
+ },
+ function(callback){
+ // do some more stuff ...
+ callback(null, 'two');
+ }
+],
+// optional callback
+function(err, results){
+ // results is now equal to ['one', 'two']
+});
+
+
+// an example using an object instead of an array
+async.series({
+ one: function(callback){
+ setTimeout(function(){
+ callback(null, 1);
+ }, 200);
+ },
+ two: function(callback){
+ setTimeout(function(){
+ callback(null, 2);
+ }, 100);
+ }
+},
+function(err, results) {
+ // results is now equal to: {one: 1, two: 2}
+});
+```
+
+---------------------------------------
+
+
+### parallel(tasks, [callback])
+
+Run the `tasks` array of functions in parallel, without waiting until the previous
+function has completed. If any of the functions pass an error to its
+callback, the main `callback` is immediately called with the value of the error.
+Once the `tasks` have completed, the results are passed to the final `callback` as an
+array.
+
+**Note:** `parallel` is about kicking-off I/O tasks in parallel, not about parallel execution of code. If your tasks do not use any timers or perform any I/O, they will actually be executed in series. Any synchronous setup sections for each task will happen one after the other. JavaScript remains single-threaded.
+
+It is also possible to use an object instead of an array. Each property will be
+run as a function and the results will be passed to the final `callback` as an object
+instead of an array. This can be a more readable way of handling results from
+[`parallel`](#parallel).
+
+
+__Arguments__
+
+* `tasks` - An array or object containing functions to run. Each function is passed
+ a `callback(err, result)` which it must call on completion with an error `err`
+ (which can be `null`) and an optional `result` value.
+* `callback(err, results)` - An optional callback to run once all the functions
+ have completed successfully. This function gets a results array (or object) containing all
+ the result arguments passed to the task callbacks.
+
+__Example__
+
+```js
+async.parallel([
+ function(callback){
+ setTimeout(function(){
+ callback(null, 'one');
+ }, 200);
+ },
+ function(callback){
+ setTimeout(function(){
+ callback(null, 'two');
+ }, 100);
+ }
+],
+// optional callback
+function(err, results){
+ // the results array will equal ['one','two'] even though
+ // the second function had a shorter timeout.
+});
+
+
+// an example using an object instead of an array
+async.parallel({
+ one: function(callback){
+ setTimeout(function(){
+ callback(null, 1);
+ }, 200);
+ },
+ two: function(callback){
+ setTimeout(function(){
+ callback(null, 2);
+ }, 100);
+ }
+},
+function(err, results) {
+ // results is now equals to: {one: 1, two: 2}
+});
+```
+
+__Related__
+
+* parallelLimit(tasks, limit, [callback])
+
+---------------------------------------
+
+
+### whilst(test, fn, callback)
+
+Repeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped,
+or an error occurs.
+
+__Arguments__
+
+* `test()` - synchronous truth test to perform before each execution of `fn`.
+* `fn(callback)` - A function which is called each time `test` passes. The function is
+ passed a `callback(err)`, which must be called once it has completed with an
+ optional `err` argument.
+* `callback(err, [results])` - A callback which is called after the test
+ function has failed and repeated execution of `fn` has stopped. `callback`
+ will be passed an error and any arguments passed to the final `fn`'s callback.
+
+__Example__
+
+```js
+var count = 0;
+
+async.whilst(
+ function () { return count < 5; },
+ function (callback) {
+ count++;
+ setTimeout(function () {
+ callback(null, count);
+ }, 1000);
+ },
+ function (err, n) {
+ // 5 seconds have passed, n = 5
+ }
+);
+```
+
+---------------------------------------
+
+
+### doWhilst(fn, test, callback)
+
+The post-check version of [`whilst`](#whilst). To reflect the difference in
+the order of operations, the arguments `test` and `fn` are switched.
+
+`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
+
+---------------------------------------
+
+
+### until(test, fn, callback)
+
+Repeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped,
+or an error occurs. `callback` will be passed an error and any arguments passed
+to the final `fn`'s callback.
+
+The inverse of [`whilst`](#whilst).
+
+---------------------------------------
+
+
+### doUntil(fn, test, callback)
+
+Like [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`.
+
+---------------------------------------
+
+
+### during(test, fn, callback)
+
+Like [`whilst`](#whilst), except the `test` is an asynchronous function that is passed a callback in the form of `function (err, truth)`. If error is passed to `test` or `fn`, the main callback is immediately called with the value of the error.
+
+__Example__
+
+```js
+var count = 0;
+
+async.during(
+ function (callback) {
+ return callback(null, count < 5);
+ },
+ function (callback) {
+ count++;
+ setTimeout(callback, 1000);
+ },
+ function (err) {
+ // 5 seconds have passed
+ }
+);
+```
+
+---------------------------------------
+
+
+### doDuring(fn, test, callback)
+
+The post-check version of [`during`](#during). To reflect the difference in
+the order of operations, the arguments `test` and `fn` are switched.
+
+Also a version of [`doWhilst`](#doWhilst) with asynchronous `test` function.
+
+---------------------------------------
+
+
+### forever(fn, [errback])
+
+Calls the asynchronous function `fn` with a callback parameter that allows it to
+call itself again, in series, indefinitely.
+
+If an error is passed to the callback then `errback` is called with the
+error, and execution stops, otherwise it will never be called.
+
+```js
+async.forever(
+ function(next) {
+ // next is suitable for passing to things that need a callback(err [, whatever]);
+ // it will result in this function being called again.
+ },
+ function(err) {
+ // if next is called with a value in its first parameter, it will appear
+ // in here as 'err', and execution will stop.
+ }
+);
+```
+
+---------------------------------------
+
+
+### waterfall(tasks, [callback])
+
+Runs the `tasks` array of functions in series, each passing their results to the next in
+the array. However, if any of the `tasks` pass an error to their own callback, the
+next function is not executed, and the main `callback` is immediately called with
+the error.
+
+__Arguments__
+
+* `tasks` - An array of functions to run, each function is passed a
+ `callback(err, result1, result2, ...)` it must call on completion. The first
+ argument is an error (which can be `null`) and any further arguments will be
+ passed as arguments in order to the next task.
+* `callback(err, [results])` - An optional callback to run once all the functions
+ have completed. This will be passed the results of the last task's callback.
+
+
+
+__Example__
+
+```js
+async.waterfall([
+ function(callback) {
+ callback(null, 'one', 'two');
+ },
+ function(arg1, arg2, callback) {
+ // arg1 now equals 'one' and arg2 now equals 'two'
+ callback(null, 'three');
+ },
+ function(arg1, callback) {
+ // arg1 now equals 'three'
+ callback(null, 'done');
+ }
+], function (err, result) {
+ // result now equals 'done'
+});
+```
+Or, with named functions:
+
+```js
+async.waterfall([
+ myFirstFunction,
+ mySecondFunction,
+ myLastFunction,
+], function (err, result) {
+ // result now equals 'done'
+});
+function myFirstFunction(callback) {
+ callback(null, 'one', 'two');
+}
+function mySecondFunction(arg1, arg2, callback) {
+ // arg1 now equals 'one' and arg2 now equals 'two'
+ callback(null, 'three');
+}
+function myLastFunction(arg1, callback) {
+ // arg1 now equals 'three'
+ callback(null, 'done');
+}
+```
+
+Or, if you need to pass any argument to the first function:
+
+```js
+async.waterfall([
+ async.apply(myFirstFunction, 'zero'),
+ mySecondFunction,
+ myLastFunction,
+], function (err, result) {
+ // result now equals 'done'
+});
+function myFirstFunction(arg1, callback) {
+ // arg1 now equals 'zero'
+ callback(null, 'one', 'two');
+}
+function mySecondFunction(arg1, arg2, callback) {
+ // arg1 now equals 'one' and arg2 now equals 'two'
+ callback(null, 'three');
+}
+function myLastFunction(arg1, callback) {
+ // arg1 now equals 'three'
+ callback(null, 'done');
+}
+```
+
+---------------------------------------
+
+### compose(fn1, fn2...)
+
+Creates a function which is a composition of the passed asynchronous
+functions. Each function consumes the return value of the function that
+follows. Composing functions `f()`, `g()`, and `h()` would produce the result of
+`f(g(h()))`, only this version uses callbacks to obtain the return values.
+
+Each function is executed with the `this` binding of the composed function.
+
+__Arguments__
+
+* `functions...` - the asynchronous functions to compose
+
+
+__Example__
+
+```js
+function add1(n, callback) {
+ setTimeout(function () {
+ callback(null, n + 1);
+ }, 10);
+}
+
+function mul3(n, callback) {
+ setTimeout(function () {
+ callback(null, n * 3);
+ }, 10);
+}
+
+var add1mul3 = async.compose(mul3, add1);
+
+add1mul3(4, function (err, result) {
+ // result now equals 15
+});
+```
+
+---------------------------------------
+
+### seq(fn1, fn2...)
+
+Version of the compose function that is more natural to read.
+Each function consumes the return value of the previous function.
+It is the equivalent of [`compose`](#compose) with the arguments reversed.
+
+Each function is executed with the `this` binding of the composed function.
+
+__Arguments__
+
+* `functions...` - the asynchronous functions to compose
+
+
+__Example__
+
+```js
+// Requires lodash (or underscore), express3 and dresende's orm2.
+// Part of an app, that fetches cats of the logged user.
+// This example uses `seq` function to avoid overnesting and error
+// handling clutter.
+app.get('/cats', function(request, response) {
+ var User = request.models.User;
+ async.seq(
+ _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))
+ function(user, fn) {
+ user.getCats(fn); // 'getCats' has signature (callback(err, data))
+ }
+ )(req.session.user_id, function (err, cats) {
+ if (err) {
+ console.error(err);
+ response.json({ status: 'error', message: err.message });
+ } else {
+ response.json({ status: 'ok', message: 'Cats found', data: cats });
+ }
+ });
+});
+```
+
+---------------------------------------
+
+### applyEach(fns, args..., callback)
+
+Applies the provided arguments to each function in the array, calling
+`callback` after all functions have completed. If you only provide the first
+argument, then it will return a function which lets you pass in the
+arguments as if it were a single function call.
+
+__Arguments__
+
+* `fns` - the asynchronous functions to all call with the same arguments
+* `args...` - any number of separate arguments to pass to the function
+* `callback` - the final argument should be the callback, called when all
+ functions have completed processing
+
+
+__Example__
+
+```js
+async.applyEach([enableSearch, updateSchema], 'bucket', callback);
+
+// partial application example:
+async.each(
+ buckets,
+ async.applyEach([enableSearch, updateSchema]),
+ callback
+);
+```
+
+__Related__
+
+* applyEachSeries(tasks, args..., [callback])
+
+---------------------------------------
+
+
+### queue(worker, [concurrency])
+
+Creates a `queue` object with the specified `concurrency`. Tasks added to the
+`queue` are processed in parallel (up to the `concurrency` limit). If all
+`worker`s are in progress, the task is queued until one becomes available.
+Once a `worker` completes a `task`, that `task`'s callback is called.
+
+__Arguments__
+
+* `worker(task, callback)` - An asynchronous function for processing a queued
+ task, which must call its `callback(err)` argument when finished, with an
+ optional `error` as an argument. If you want to handle errors from an individual task, pass a callback to `q.push()`.
+* `concurrency` - An `integer` for determining how many `worker` functions should be
+ run in parallel. If omitted, the concurrency defaults to `1`. If the concurrency is `0`, an error is thrown.
+
+__Queue objects__
+
+The `queue` object returned by this function has the following properties and
+methods:
+
+* `length()` - a function returning the number of items waiting to be processed.
+* `started` - a function returning whether or not any items have been pushed and processed by the queue
+* `running()` - a function returning the number of items currently being processed.
+* `workersList()` - a function returning the array of items currently being processed.
+* `idle()` - a function returning false if there are items waiting or being processed, or true if not.
+* `concurrency` - an integer for determining how many `worker` functions should be
+ run in parallel. This property can be changed after a `queue` is created to
+ alter the concurrency on-the-fly.
+* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once
+ the `worker` has finished processing the task. Instead of a single task, a `tasks` array
+ can be submitted. The respective callback is used for every task in the list.
+* `unshift(task, [callback])` - add a new task to the front of the `queue`.
+* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit,
+ and further tasks will be queued.
+* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`.
+* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`.
+* `paused` - a boolean for determining whether the queue is in a paused state
+* `pause()` - a function that pauses the processing of tasks until `resume()` is called.
+* `resume()` - a function that resumes the processing of queued tasks when the queue is paused.
+* `kill()` - a function that removes the `drain` callback and empties remaining tasks from the queue forcing it to go idle.
+
+__Example__
+
+```js
+// create a queue object with concurrency 2
+
+var q = async.queue(function (task, callback) {
+ console.log('hello ' + task.name);
+ callback();
+}, 2);
+
+
+// assign a callback
+q.drain = function() {
+ console.log('all items have been processed');
+}
+
+// add some items to the queue
+
+q.push({name: 'foo'}, function (err) {
+ console.log('finished processing foo');
+});
+q.push({name: 'bar'}, function (err) {
+ console.log('finished processing bar');
+});
+
+// add some items to the queue (batch-wise)
+
+q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {
+ console.log('finished processing item');
+});
+
+// add some items to the front of the queue
+
+q.unshift({name: 'bar'}, function (err) {
+ console.log('finished processing bar');
+});
+```
+
+
+---------------------------------------
+
+
+### priorityQueue(worker, concurrency)
+
+The same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects:
+
+* `push(task, priority, [callback])` - `priority` should be a number. If an array of
+ `tasks` is given, all tasks will be assigned the same priority.
+* The `unshift` method was removed.
+
+---------------------------------------
+
+
+### cargo(worker, [payload])
+
+Creates a `cargo` object with the specified payload. Tasks added to the
+cargo will be processed altogether (up to the `payload` limit). If the
+`worker` is in progress, the task is queued until it becomes available. Once
+the `worker` has completed some tasks, each callback of those tasks is called.
+Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) for how `cargo` and `queue` work.
+
+While [queue](#queue) passes only one task to one of a group of workers
+at a time, cargo passes an array of tasks to a single worker, repeating
+when the worker is finished.
+
+__Arguments__
+
+* `worker(tasks, callback)` - An asynchronous function for processing an array of
+ queued tasks, which must call its `callback(err)` argument when finished, with
+ an optional `err` argument.
+* `payload` - An optional `integer` for determining how many tasks should be
+ processed per round; if omitted, the default is unlimited.
+
+__Cargo objects__
+
+The `cargo` object returned by this function has the following properties and
+methods:
+
+* `length()` - A function returning the number of items waiting to be processed.
+* `payload` - An `integer` for determining how many tasks should be
+ process per round. This property can be changed after a `cargo` is created to
+ alter the payload on-the-fly.
+* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called
+ once the `worker` has finished processing the task. Instead of a single task, an array of `tasks`
+ can be submitted. The respective callback is used for every task in the list.
+* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued.
+* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`.
+* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`.
+* `idle()`, `pause()`, `resume()`, `kill()` - cargo inherits all of the same methods and event calbacks as [`queue`](#queue)
+
+__Example__
+
+```js
+// create a cargo object with payload 2
+
+var cargo = async.cargo(function (tasks, callback) {
+ for(var i=0; i
+### auto(tasks, [concurrency], [callback])
+
+Determines the best order for running the functions in `tasks`, based on their requirements. Each function can optionally depend on other functions being completed first, and each function is run as soon as its requirements are satisfied.
+
+If any of the functions pass an error to their callback, the `auto` sequence will stop. Further tasks will not execute (so any other functions depending on it will not run), and the main `callback` is immediately called with the error. Functions also receive an object containing the results of functions which have completed so far.
+
+Note, all functions are called with a `results` object as a second argument,
+so it is unsafe to pass functions in the `tasks` object which cannot handle the
+extra argument.
+
+For example, this snippet of code:
+
+```js
+async.auto({
+ readData: async.apply(fs.readFile, 'data.txt', 'utf-8')
+}, callback);
+```
+
+will have the effect of calling `readFile` with the results object as the last
+argument, which will fail:
+
+```js
+fs.readFile('data.txt', 'utf-8', cb, {});
+```
+
+Instead, wrap the call to `readFile` in a function which does not forward the
+`results` object:
+
+```js
+async.auto({
+ readData: function(cb, results){
+ fs.readFile('data.txt', 'utf-8', cb);
+ }
+}, callback);
+```
+
+__Arguments__
+
+* `tasks` - An object. Each of its properties is either a function or an array of
+ requirements, with the function itself the last item in the array. The object's key
+ of a property serves as the name of the task defined by that property,
+ i.e. can be used when specifying requirements for other tasks.
+ The function receives two arguments: (1) a `callback(err, result)` which must be
+ called when finished, passing an `error` (which can be `null`) and the result of
+ the function's execution, and (2) a `results` object, containing the results of
+ the previously executed functions.
+* `concurrency` - An optional `integer` for determining the maximum number of tasks that can be run in parallel. By default, as many as possible.
+* `callback(err, results)` - An optional callback which is called when all the
+ tasks have been completed. It receives the `err` argument if any `tasks`
+ pass an error to their callback. Results are always returned; however, if
+ an error occurs, no further `tasks` will be performed, and the results
+ object will only contain partial results.
+
+
+__Example__
+
+```js
+async.auto({
+ get_data: function(callback){
+ console.log('in get_data');
+ // async code to get some data
+ callback(null, 'data', 'converted to array');
+ },
+ make_folder: function(callback){
+ console.log('in make_folder');
+ // async code to create a directory to store a file in
+ // this is run at the same time as getting the data
+ callback(null, 'folder');
+ },
+ write_file: ['get_data', 'make_folder', function(callback, results){
+ console.log('in write_file', JSON.stringify(results));
+ // once there is some data and the directory exists,
+ // write the data to a file in the directory
+ callback(null, 'filename');
+ }],
+ email_link: ['write_file', function(callback, results){
+ console.log('in email_link', JSON.stringify(results));
+ // once the file is written let's email a link to it...
+ // results.write_file contains the filename returned by write_file.
+ callback(null, {'file':results.write_file, 'email':'user@example.com'});
+ }]
+}, function(err, results) {
+ console.log('err = ', err);
+ console.log('results = ', results);
+});
+```
+
+This is a fairly trivial example, but to do this using the basic parallel and
+series functions would look like this:
+
+```js
+async.parallel([
+ function(callback){
+ console.log('in get_data');
+ // async code to get some data
+ callback(null, 'data', 'converted to array');
+ },
+ function(callback){
+ console.log('in make_folder');
+ // async code to create a directory to store a file in
+ // this is run at the same time as getting the data
+ callback(null, 'folder');
+ }
+],
+function(err, results){
+ async.series([
+ function(callback){
+ console.log('in write_file', JSON.stringify(results));
+ // once there is some data and the directory exists,
+ // write the data to a file in the directory
+ results.push('filename');
+ callback(null);
+ },
+ function(callback){
+ console.log('in email_link', JSON.stringify(results));
+ // once the file is written let's email a link to it...
+ callback(null, {'file':results.pop(), 'email':'user@example.com'});
+ }
+ ]);
+});
+```
+
+For a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding
+new tasks much easier (and the code more readable).
+
+
+---------------------------------------
+
+
+### retry([opts = {times: 5, interval: 0}| 5], task, [callback])
+
+Attempts to get a successful response from `task` no more than `times` times before
+returning an error. If the task is successful, the `callback` will be passed the result
+of the successful task. If all attempts fail, the callback will be passed the error and
+result (if any) of the final attempt.
+
+__Arguments__
+
+* `opts` - Can be either an object with `times` and `interval` or a number.
+ * `times` - The number of attempts to make before giving up. The default is `5`.
+ * `interval` - The time to wait between retries, in milliseconds. The default is `0`.
+ * If `opts` is a number, the number specifies the number of times to retry, with the default interval of `0`.
+* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)`
+ which must be called when finished, passing `err` (which can be `null`) and the `result` of
+ the function's execution, and (2) a `results` object, containing the results of
+ the previously executed functions (if nested inside another control flow).
+* `callback(err, results)` - An optional callback which is called when the
+ task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`.
+
+The [`retry`](#retry) function can be used as a stand-alone control flow by passing a callback, as shown below:
+
+```js
+// try calling apiMethod 3 times
+async.retry(3, apiMethod, function(err, result) {
+ // do something with the result
+});
+```
+
+```js
+// try calling apiMethod 3 times, waiting 200 ms between each retry
+async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {
+ // do something with the result
+});
+```
+
+```js
+// try calling apiMethod the default 5 times no delay between each retry
+async.retry(apiMethod, function(err, result) {
+ // do something with the result
+});
+```
+
+It can also be embedded within other control flow functions to retry individual methods
+that are not as reliable, like this:
+
+```js
+async.auto({
+ users: api.getUsers.bind(api),
+ payments: async.retry(3, api.getPayments.bind(api))
+}, function(err, results) {
+ // do something with the results
+});
+```
+
+
+---------------------------------------
+
+
+### iterator(tasks)
+
+Creates an iterator function which calls the next function in the `tasks` array,
+returning a continuation to call the next one after that. It's also possible to
+“peek” at the next iterator with `iterator.next()`.
+
+This function is used internally by the `async` module, but can be useful when
+you want to manually control the flow of functions in series.
+
+__Arguments__
+
+* `tasks` - An array of functions to run.
+
+__Example__
+
+```js
+var iterator = async.iterator([
+ function(){ sys.p('one'); },
+ function(){ sys.p('two'); },
+ function(){ sys.p('three'); }
+]);
+
+node> var iterator2 = iterator();
+'one'
+node> var iterator3 = iterator2();
+'two'
+node> iterator3();
+'three'
+node> var nextfn = iterator2.next();
+node> nextfn();
+'three'
+```
+
+---------------------------------------
+
+
+### apply(function, arguments..)
+
+Creates a continuation function with some arguments already applied.
+
+Useful as a shorthand when combined with other control flow functions. Any arguments
+passed to the returned function are added to the arguments originally passed
+to apply.
+
+__Arguments__
+
+* `function` - The function you want to eventually apply all arguments to.
+* `arguments...` - Any number of arguments to automatically apply when the
+ continuation is called.
+
+__Example__
+
+```js
+// using apply
+
+async.parallel([
+ async.apply(fs.writeFile, 'testfile1', 'test1'),
+ async.apply(fs.writeFile, 'testfile2', 'test2'),
+]);
+
+
+// the same process without using apply
+
+async.parallel([
+ function(callback){
+ fs.writeFile('testfile1', 'test1', callback);
+ },
+ function(callback){
+ fs.writeFile('testfile2', 'test2', callback);
+ }
+]);
+```
+
+It's possible to pass any number of additional arguments when calling the
+continuation:
+
+```js
+node> var fn = async.apply(sys.puts, 'one');
+node> fn('two', 'three');
+one
+two
+three
+```
+
+---------------------------------------
+
+
+### nextTick(callback), setImmediate(callback)
+
+Calls `callback` on a later loop around the event loop. In Node.js this just
+calls `process.nextTick`; in the browser it falls back to `setImmediate(callback)`
+if available, otherwise `setTimeout(callback, 0)`, which means other higher priority
+events may precede the execution of `callback`.
+
+This is used internally for browser-compatibility purposes.
+
+__Arguments__
+
+* `callback` - The function to call on a later loop around the event loop.
+
+__Example__
+
+```js
+var call_order = [];
+async.nextTick(function(){
+ call_order.push('two');
+ // call_order now equals ['one','two']
+});
+call_order.push('one')
+```
+
+
+### times(n, iterator, [callback])
+
+Calls the `iterator` function `n` times, and accumulates results in the same manner
+you would use with [`map`](#map).
+
+__Arguments__
+
+* `n` - The number of times to run the function.
+* `iterator` - The function to call `n` times.
+* `callback` - see [`map`](#map)
+
+__Example__
+
+```js
+// Pretend this is some complicated async factory
+var createUser = function(id, callback) {
+ callback(null, {
+ id: 'user' + id
+ })
+}
+// generate 5 users
+async.times(5, function(n, next){
+ createUser(n, function(err, user) {
+ next(err, user)
+ })
+}, function(err, users) {
+ // we should now have 5 users
+});
+```
+
+__Related__
+
+* timesSeries(n, iterator, [callback])
+* timesLimit(n, limit, iterator, [callback])
+
+
+## Utils
+
+
+### memoize(fn, [hasher])
+
+Caches the results of an `async` function. When creating a hash to store function
+results against, the callback is omitted from the hash and an optional hash
+function can be used.
+
+If no hash function is specified, the first argument is used as a hash key, which may work reasonably if it is a string or a data type that converts to a distinct string. Note that objects and arrays will not behave reasonably. Neither will cases where the other arguments are significant. In such cases, specify your own hash function.
+
+The cache of results is exposed as the `memo` property of the function returned
+by `memoize`.
+
+__Arguments__
+
+* `fn` - The function to proxy and cache results from.
+* `hasher` - An optional function for generating a custom hash for storing
+ results. It has all the arguments applied to it apart from the callback, and
+ must be synchronous.
+
+__Example__
+
+```js
+var slow_fn = function (name, callback) {
+ // do something
+ callback(null, result);
+};
+var fn = async.memoize(slow_fn);
+
+// fn can now be used as if it were slow_fn
+fn('some name', function () {
+ // callback
+});
+```
+
+
+### unmemoize(fn)
+
+Undoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized
+form. Handy for testing.
+
+__Arguments__
+
+* `fn` - the memoized function
+
+---------------------------------------
+
+
+### ensureAsync(fn)
+
+Wrap an async function and ensure it calls its callback on a later tick of the event loop. If the function already calls its callback on a next tick, no extra deferral is added. This is useful for preventing stack overflows (`RangeError: Maximum call stack size exceeded`) and generally keeping [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) contained.
+
+__Arguments__
+
+* `fn` - an async function, one that expects a node-style callback as its last argument
+
+Returns a wrapped function with the exact same call signature as the function passed in.
+
+__Example__
+
+```js
+function sometimesAsync(arg, callback) {
+ if (cache[arg]) {
+ return callback(null, cache[arg]); // this would be synchronous!!
+ } else {
+ doSomeIO(arg, callback); // this IO would be asynchronous
+ }
+}
+
+// this has a risk of stack overflows if many results are cached in a row
+async.mapSeries(args, sometimesAsync, done);
+
+// this will defer sometimesAsync's callback if necessary,
+// preventing stack overflows
+async.mapSeries(args, async.ensureAsync(sometimesAsync), done);
+
+```
+
+---------------------------------------
+
+
+### constant(values...)
+
+Returns a function that when called, calls-back with the values provided. Useful as the first function in a `waterfall`, or for plugging values in to `auto`.
+
+__Example__
+
+```js
+async.waterfall([
+ async.constant(42),
+ function (value, next) {
+ // value === 42
+ },
+ //...
+], callback);
+
+async.waterfall([
+ async.constant(filename, "utf8"),
+ fs.readFile,
+ function (fileData, next) {
+ //...
+ }
+ //...
+], callback);
+
+async.auto({
+ hostname: async.constant("https://server.net/"),
+ port: findFreePort,
+ launchServer: ["hostname", "port", function (cb, options) {
+ startServer(options, cb);
+ }],
+ //...
+}, callback);
+
+```
+
+---------------------------------------
+
+
+
+### asyncify(func)
+
+__Alias:__ `wrapSync`
+
+Take a sync function and make it async, passing its return value to a callback. This is useful for plugging sync functions into a waterfall, series, or other async functions. Any arguments passed to the generated function will be passed to the wrapped function (except for the final callback argument). Errors thrown will be passed to the callback.
+
+__Example__
+
+```js
+async.waterfall([
+ async.apply(fs.readFile, filename, "utf8"),
+ async.asyncify(JSON.parse),
+ function (data, next) {
+ // data is the result of parsing the text.
+ // If there was a parsing error, it would have been caught.
+ }
+], callback)
+```
+
+If the function passed to `asyncify` returns a Promise, that promises's resolved/rejected state will be used to call the callback, rather than simply the synchronous return value. Example:
+
+```js
+async.waterfall([
+ async.apply(fs.readFile, filename, "utf8"),
+ async.asyncify(function (contents) {
+ return db.model.create(contents);
+ }),
+ function (model, next) {
+ // `model` is the instantiated model object.
+ // If there was an error, this function would be skipped.
+ }
+], callback)
+```
+
+This also means you can asyncify ES2016 `async` functions.
+
+```js
+var q = async.queue(async.asyncify(async function (file) {
+ var intermediateStep = await processFile(file);
+ return await somePromise(intermediateStep)
+}));
+
+q.push(files);
+```
+
+---------------------------------------
+
+
+### log(function, arguments)
+
+Logs the result of an `async` function to the `console`. Only works in Node.js or
+in browsers that support `console.log` and `console.error` (such as FF and Chrome).
+If multiple arguments are returned from the async function, `console.log` is
+called on each argument in order.
+
+__Arguments__
+
+* `function` - The function you want to eventually apply all arguments to.
+* `arguments...` - Any number of arguments to apply to the function.
+
+__Example__
+
+```js
+var hello = function(name, callback){
+ setTimeout(function(){
+ callback(null, 'hello ' + name);
+ }, 1000);
+};
+```
+```js
+node> async.log(hello, 'world');
+'hello world'
+```
+
+---------------------------------------
+
+
+### dir(function, arguments)
+
+Logs the result of an `async` function to the `console` using `console.dir` to
+display the properties of the resulting object. Only works in Node.js or
+in browsers that support `console.dir` and `console.error` (such as FF and Chrome).
+If multiple arguments are returned from the async function, `console.dir` is
+called on each argument in order.
+
+__Arguments__
+
+* `function` - The function you want to eventually apply all arguments to.
+* `arguments...` - Any number of arguments to apply to the function.
+
+__Example__
+
+```js
+var hello = function(name, callback){
+ setTimeout(function(){
+ callback(null, {hello: name});
+ }, 1000);
+};
+```
+```js
+node> async.dir(hello, 'world');
+{hello: 'world'}
+```
+
+---------------------------------------
+
+
+### noConflict()
+
+Changes the value of `async` back to its original value, returning a reference to the
+`async` object.
diff --git a/bower_components/async/bower.json b/bower_components/async/bower.json
new file mode 100644
index 0000000..0ce24ba
--- /dev/null
+++ b/bower_components/async/bower.json
@@ -0,0 +1,57 @@
+{
+ "name": "async",
+ "description": "Higher-order functions and common patterns for asynchronous code",
+ "main": "lib/async.js",
+ "keywords": [
+ "async",
+ "callback",
+ "utility",
+ "module"
+ ],
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/caolan/async.git"
+ },
+ "devDependencies": {
+ "benchmark": "bestiejs/benchmark.js",
+ "bluebird": "^2.9.32",
+ "chai": "^3.1.0",
+ "coveralls": "^2.11.2",
+ "es6-promise": "^2.3.0",
+ "jscs": "^1.13.1",
+ "jshint": "~2.8.0",
+ "karma": "^0.13.2",
+ "karma-browserify": "^4.2.1",
+ "karma-firefox-launcher": "^0.1.6",
+ "karma-mocha": "^0.2.0",
+ "karma-mocha-reporter": "^1.0.2",
+ "lodash": "^3.9.0",
+ "mkdirp": "~0.5.1",
+ "mocha": "^2.2.5",
+ "native-promise-only": "^0.8.0-a",
+ "nodeunit": ">0.0.0",
+ "nyc": "^2.1.0",
+ "rsvp": "^3.0.18",
+ "semver": "^4.3.6",
+ "uglify-js": "~2.4.0",
+ "xyz": "^0.5.0",
+ "yargs": "~3.9.1"
+ },
+ "moduleType": [
+ "amd",
+ "globals",
+ "node"
+ ],
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "test",
+ "tests"
+ ],
+ "authors": [
+ "Caolan McMahon"
+ ],
+ "version": "1.5.2"
+}
diff --git a/bower_components/async/component.json b/bower_components/async/component.json
new file mode 100644
index 0000000..103558d
--- /dev/null
+++ b/bower_components/async/component.json
@@ -0,0 +1,17 @@
+{
+ "name": "async",
+ "description": "Higher-order functions and common patterns for asynchronous code",
+ "version": "1.5.2",
+ "keywords": [
+ "async",
+ "callback",
+ "utility",
+ "module"
+ ],
+ "license": "MIT",
+ "main": "lib/async.js",
+ "repository": "caolan/async",
+ "scripts": [
+ "lib/async.js"
+ ]
+}
diff --git a/bower_components/async/deps/nodeunit.css b/bower_components/async/deps/nodeunit.css
new file mode 100644
index 0000000..274434a
--- /dev/null
+++ b/bower_components/async/deps/nodeunit.css
@@ -0,0 +1,70 @@
+/*!
+ * Styles taken from qunit.css
+ */
+
+h1#nodeunit-header, h1.nodeunit-header {
+ padding: 15px;
+ font-size: large;
+ background-color: #06b;
+ color: white;
+ font-family: 'trebuchet ms', verdana, arial;
+ margin: 0;
+}
+
+h1#nodeunit-header a {
+ color: white;
+}
+
+h2#nodeunit-banner {
+ height: 2em;
+ border-bottom: 1px solid white;
+ background-color: #eee;
+ margin: 0;
+ font-family: 'trebuchet ms', verdana, arial;
+}
+h2#nodeunit-banner.pass {
+ background-color: green;
+}
+h2#nodeunit-banner.fail {
+ background-color: red;
+}
+
+h2#nodeunit-userAgent, h2.nodeunit-userAgent {
+ padding: 10px;
+ background-color: #eee;
+ color: black;
+ margin: 0;
+ font-size: small;
+ font-weight: normal;
+ font-family: 'trebuchet ms', verdana, arial;
+ font-size: 10pt;
+}
+
+div#nodeunit-testrunner-toolbar {
+ background: #eee;
+ border-top: 1px solid black;
+ padding: 10px;
+ font-family: 'trebuchet ms', verdana, arial;
+ margin: 0;
+ font-size: 10pt;
+}
+
+ol#nodeunit-tests {
+ font-family: 'trebuchet ms', verdana, arial;
+ font-size: 10pt;
+}
+ol#nodeunit-tests li strong {
+ cursor:pointer;
+}
+ol#nodeunit-tests .pass {
+ color: green;
+}
+ol#nodeunit-tests .fail {
+ color: red;
+}
+
+p#nodeunit-testresult {
+ margin-left: 1em;
+ font-size: 10pt;
+ font-family: 'trebuchet ms', verdana, arial;
+}
diff --git a/bower_components/async/deps/nodeunit.js b/bower_components/async/deps/nodeunit.js
new file mode 100644
index 0000000..6251ba1
--- /dev/null
+++ b/bower_components/async/deps/nodeunit.js
@@ -0,0 +1,2117 @@
+/*!
+ * Nodeunit
+ * https://github.com/caolan/nodeunit
+ * Copyright (c) 2010 Caolan McMahon
+ * MIT Licensed
+ *
+ * json2.js
+ * http://www.JSON.org/json2.js
+ * Public Domain.
+ * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+ */
+nodeunit = (function(){
+/*
+ http://www.JSON.org/json2.js
+ 2010-11-17
+
+ Public Domain.
+
+ NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
+
+ See http://www.JSON.org/js.html
+
+
+ This code should be minified before deployment.
+ See http://javascript.crockford.com/jsmin.html
+
+ USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
+ NOT CONTROL.
+
+
+ This file creates a global JSON object containing two methods: stringify
+ and parse.
+
+ JSON.stringify(value, replacer, space)
+ value any JavaScript value, usually an object or array.
+
+ replacer an optional parameter that determines how object
+ values are stringified for objects. It can be a
+ function or an array of strings.
+
+ space an optional parameter that specifies the indentation
+ of nested structures. If it is omitted, the text will
+ be packed without extra whitespace. If it is a number,
+ it will specify the number of spaces to indent at each
+ level. If it is a string (such as '\t' or ' '),
+ it contains the characters used to indent at each level.
+
+ This method produces a JSON text from a JavaScript value.
+
+ When an object value is found, if the object contains a toJSON
+ method, its toJSON method will be called and the result will be
+ stringified. A toJSON method does not serialize: it returns the
+ value represented by the name/value pair that should be serialized,
+ or undefined if nothing should be serialized. The toJSON method
+ will be passed the key associated with the value, and this will be
+ bound to the value
+
+ For example, this would serialize Dates as ISO strings.
+
+ Date.prototype.toJSON = function (key) {
+ function f(n) {
+ // Format integers to have at least two digits.
+ return n < 10 ? '0' + n : n;
+ }
+
+ return this.getUTCFullYear() + '-' +
+ f(this.getUTCMonth() + 1) + '-' +
+ f(this.getUTCDate()) + 'T' +
+ f(this.getUTCHours()) + ':' +
+ f(this.getUTCMinutes()) + ':' +
+ f(this.getUTCSeconds()) + 'Z';
+ };
+
+ You can provide an optional replacer method. It will be passed the
+ key and value of each member, with this bound to the containing
+ object. The value that is returned from your method will be
+ serialized. If your method returns undefined, then the member will
+ be excluded from the serialization.
+
+ If the replacer parameter is an array of strings, then it will be
+ used to select the members to be serialized. It filters the results
+ such that only members with keys listed in the replacer array are
+ stringified.
+
+ Values that do not have JSON representations, such as undefined or
+ functions, will not be serialized. Such values in objects will be
+ dropped; in arrays they will be replaced with null. You can use
+ a replacer function to replace those with JSON values.
+ JSON.stringify(undefined) returns undefined.
+
+ The optional space parameter produces a stringification of the
+ value that is filled with line breaks and indentation to make it
+ easier to read.
+
+ If the space parameter is a non-empty string, then that string will
+ be used for indentation. If the space parameter is a number, then
+ the indentation will be that many spaces.
+
+ Example:
+
+ text = JSON.stringify(['e', {pluribus: 'unum'}]);
+ // text is '["e",{"pluribus":"unum"}]'
+
+
+ text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t');
+ // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
+
+ text = JSON.stringify([new Date()], function (key, value) {
+ return this[key] instanceof Date ?
+ 'Date(' + this[key] + ')' : value;
+ });
+ // text is '["Date(---current time---)"]'
+
+
+ JSON.parse(text, reviver)
+ This method parses a JSON text to produce an object or array.
+ It can throw a SyntaxError exception.
+
+ The optional reviver parameter is a function that can filter and
+ transform the results. It receives each of the keys and values,
+ and its return value is used instead of the original value.
+ If it returns what it received, then the structure is not modified.
+ If it returns undefined then the member is deleted.
+
+ Example:
+
+ // Parse the text. Values that look like ISO date strings will
+ // be converted to Date objects.
+
+ myData = JSON.parse(text, function (key, value) {
+ var a;
+ if (typeof value === 'string') {
+ a =
+/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
+ if (a) {
+ return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],
+ +a[5], +a[6]));
+ }
+ }
+ return value;
+ });
+
+ myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) {
+ var d;
+ if (typeof value === 'string' &&
+ value.slice(0, 5) === 'Date(' &&
+ value.slice(-1) === ')') {
+ d = new Date(value.slice(5, -1));
+ if (d) {
+ return d;
+ }
+ }
+ return value;
+ });
+
+
+ This is a reference implementation. You are free to copy, modify, or
+ redistribute.
+*/
+
+/*jslint evil: true, strict: false, regexp: false */
+
+/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply,
+ call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
+ getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
+ lastIndex, length, parse, prototype, push, replace, slice, stringify,
+ test, toJSON, toString, valueOf
+*/
+
+
+// Create a JSON object only if one does not already exist. We create the
+// methods in a closure to avoid creating global variables.
+
+var JSON = {};
+
+(function () {
+ "use strict";
+
+ function f(n) {
+ // Format integers to have at least two digits.
+ return n < 10 ? '0' + n : n;
+ }
+
+ if (typeof Date.prototype.toJSON !== 'function') {
+
+ Date.prototype.toJSON = function (key) {
+
+ return isFinite(this.valueOf()) ?
+ this.getUTCFullYear() + '-' +
+ f(this.getUTCMonth() + 1) + '-' +
+ f(this.getUTCDate()) + 'T' +
+ f(this.getUTCHours()) + ':' +
+ f(this.getUTCMinutes()) + ':' +
+ f(this.getUTCSeconds()) + 'Z' : null;
+ };
+
+ String.prototype.toJSON =
+ Number.prototype.toJSON =
+ Boolean.prototype.toJSON = function (key) {
+ return this.valueOf();
+ };
+ }
+
+ var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
+ gap,
+ indent,
+ meta = { // table of character substitutions
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '"' : '\\"',
+ '\\': '\\\\'
+ },
+ rep;
+
+
+ function quote(string) {
+
+// If the string contains no control characters, no quote characters, and no
+// backslash characters, then we can safely slap some quotes around it.
+// Otherwise we must also replace the offending characters with safe escape
+// sequences.
+
+ escapable.lastIndex = 0;
+ return escapable.test(string) ?
+ '"' + string.replace(escapable, function (a) {
+ var c = meta[a];
+ return typeof c === 'string' ? c :
+ '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ }) + '"' :
+ '"' + string + '"';
+ }
+
+
+ function str(key, holder) {
+
+// Produce a string from holder[key].
+
+ var i, // The loop counter.
+ k, // The member key.
+ v, // The member value.
+ length,
+ mind = gap,
+ partial,
+ value = holder[key];
+
+// If the value has a toJSON method, call it to obtain a replacement value.
+
+ if (value && typeof value === 'object' &&
+ typeof value.toJSON === 'function') {
+ value = value.toJSON(key);
+ }
+
+// If we were called with a replacer function, then call the replacer to
+// obtain a replacement value.
+
+ if (typeof rep === 'function') {
+ value = rep.call(holder, key, value);
+ }
+
+// What happens next depends on the value's type.
+
+ switch (typeof value) {
+ case 'string':
+ return quote(value);
+
+ case 'number':
+
+// JSON numbers must be finite. Encode non-finite numbers as null.
+
+ return isFinite(value) ? String(value) : 'null';
+
+ case 'boolean':
+ case 'null':
+
+// If the value is a boolean or null, convert it to a string. Note:
+// typeof null does not produce 'null'. The case is included here in
+// the remote chance that this gets fixed someday.
+
+ return String(value);
+
+// If the type is 'object', we might be dealing with an object or an array or
+// null.
+
+ case 'object':
+
+// Due to a specification blunder in ECMAScript, typeof null is 'object',
+// so watch out for that case.
+
+ if (!value) {
+ return 'null';
+ }
+
+// Make an array to hold the partial results of stringifying this object value.
+
+ gap += indent;
+ partial = [];
+
+// Is the value an array?
+
+ if (Object.prototype.toString.apply(value) === '[object Array]') {
+
+// The value is an array. Stringify every element. Use null as a placeholder
+// for non-JSON values.
+
+ length = value.length;
+ for (i = 0; i < length; i += 1) {
+ partial[i] = str(i, value) || 'null';
+ }
+
+// Join all of the elements together, separated with commas, and wrap them in
+// brackets.
+
+ v = partial.length === 0 ? '[]' :
+ gap ? '[\n' + gap +
+ partial.join(',\n' + gap) + '\n' +
+ mind + ']' :
+ '[' + partial.join(',') + ']';
+ gap = mind;
+ return v;
+ }
+
+// If the replacer is an array, use it to select the members to be stringified.
+
+ if (rep && typeof rep === 'object') {
+ length = rep.length;
+ for (i = 0; i < length; i += 1) {
+ k = rep[i];
+ if (typeof k === 'string') {
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ } else {
+
+// Otherwise, iterate through all of the keys in the object.
+
+ for (k in value) {
+ if (Object.hasOwnProperty.call(value, k)) {
+ v = str(k, value);
+ if (v) {
+ partial.push(quote(k) + (gap ? ': ' : ':') + v);
+ }
+ }
+ }
+ }
+
+// Join all of the member texts together, separated with commas,
+// and wrap them in braces.
+
+ v = partial.length === 0 ? '{}' :
+ gap ? '{\n' + gap + partial.join(',\n' + gap) + '\n' +
+ mind + '}' : '{' + partial.join(',') + '}';
+ gap = mind;
+ return v;
+ }
+ }
+
+// If the JSON object does not yet have a stringify method, give it one.
+
+ if (typeof JSON.stringify !== 'function') {
+ JSON.stringify = function (value, replacer, space) {
+
+// The stringify method takes a value and an optional replacer, and an optional
+// space parameter, and returns a JSON text. The replacer can be a function
+// that can replace values, or an array of strings that will select the keys.
+// A default replacer method can be provided. Use of the space parameter can
+// produce text that is more easily readable.
+
+ var i;
+ gap = '';
+ indent = '';
+
+// If the space parameter is a number, make an indent string containing that
+// many spaces.
+
+ if (typeof space === 'number') {
+ for (i = 0; i < space; i += 1) {
+ indent += ' ';
+ }
+
+// If the space parameter is a string, it will be used as the indent string.
+
+ } else if (typeof space === 'string') {
+ indent = space;
+ }
+
+// If there is a replacer, it must be a function or an array.
+// Otherwise, throw an error.
+
+ rep = replacer;
+ if (replacer && typeof replacer !== 'function' &&
+ (typeof replacer !== 'object' ||
+ typeof replacer.length !== 'number')) {
+ throw new Error('JSON.stringify');
+ }
+
+// Make a fake root object containing our value under the key of ''.
+// Return the result of stringifying the value.
+
+ return str('', {'': value});
+ };
+ }
+
+
+// If the JSON object does not yet have a parse method, give it one.
+
+ if (typeof JSON.parse !== 'function') {
+ JSON.parse = function (text, reviver) {
+
+// The parse method takes a text and an optional reviver function, and returns
+// a JavaScript value if the text is a valid JSON text.
+
+ var j;
+
+ function walk(holder, key) {
+
+// The walk method is used to recursively walk the resulting structure so
+// that modifications can be made.
+
+ var k, v, value = holder[key];
+ if (value && typeof value === 'object') {
+ for (k in value) {
+ if (Object.hasOwnProperty.call(value, k)) {
+ v = walk(value, k);
+ if (v !== undefined) {
+ value[k] = v;
+ } else {
+ delete value[k];
+ }
+ }
+ }
+ }
+ return reviver.call(holder, key, value);
+ }
+
+
+// Parsing happens in four stages. In the first stage, we replace certain
+// Unicode characters with escape sequences. JavaScript handles many characters
+// incorrectly, either silently deleting them, or treating them as line endings.
+
+ text = String(text);
+ cx.lastIndex = 0;
+ if (cx.test(text)) {
+ text = text.replace(cx, function (a) {
+ return '\\u' +
+ ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ });
+ }
+
+// In the second stage, we run the text against regular expressions that look
+// for non-JSON patterns. We are especially concerned with '()' and 'new'
+// because they can cause invocation, and '=' because it can cause mutation.
+// But just to be safe, we want to reject all unexpected forms.
+
+// We split the second stage into 4 regexp operations in order to work around
+// crippling inefficiencies in IE's and Safari's regexp engines. First we
+// replace the JSON backslash pairs with '@' (a non-JSON character). Second, we
+// replace all simple value tokens with ']' characters. Third, we delete all
+// open brackets that follow a colon or comma or that begin the text. Finally,
+// we look to see that the remaining characters are only whitespace or ']' or
+// ',' or ':' or '{' or '}'. If that is so, then the text is safe for eval.
+
+ if (/^[\],:{}\s]*$/
+.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
+.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
+.replace(/(?:^|:|,)(?:\s*\[)+/g, ''))) {
+
+// In the third stage we use the eval function to compile the text into a
+// JavaScript structure. The '{' operator is subject to a syntactic ambiguity
+// in JavaScript: it can begin a block or an object literal. We wrap the text
+// in parens to eliminate the ambiguity.
+
+ j = eval('(' + text + ')');
+
+// In the optional fourth stage, we recursively walk the new structure, passing
+// each name/value pair to a reviver function for possible transformation.
+
+ return typeof reviver === 'function' ?
+ walk({'': j}, '') : j;
+ }
+
+// If the text is not JSON parseable, then a SyntaxError is thrown.
+
+ throw new SyntaxError('JSON.parse');
+ };
+ }
+}());
+var assert = this.assert = {};
+var types = {};
+var core = {};
+var nodeunit = {};
+var reporter = {};
+/*global setTimeout: false, console: false */
+(function () {
+
+ var async = {};
+
+ // global on the server, window in the browser
+ var root = this,
+ previous_async = root.async;
+
+ if (typeof module !== 'undefined' && module.exports) {
+ module.exports = async;
+ }
+ else {
+ root.async = async;
+ }
+
+ async.noConflict = function () {
+ root.async = previous_async;
+ return async;
+ };
+
+ //// cross-browser compatiblity functions ////
+
+ var _forEach = function (arr, iterator) {
+ if (arr.forEach) {
+ return arr.forEach(iterator);
+ }
+ for (var i = 0; i < arr.length; i += 1) {
+ iterator(arr[i], i, arr);
+ }
+ };
+
+ var _map = function (arr, iterator) {
+ if (arr.map) {
+ return arr.map(iterator);
+ }
+ var results = [];
+ _forEach(arr, function (x, i, a) {
+ results.push(iterator(x, i, a));
+ });
+ return results;
+ };
+
+ var _reduce = function (arr, iterator, memo) {
+ if (arr.reduce) {
+ return arr.reduce(iterator, memo);
+ }
+ _forEach(arr, function (x, i, a) {
+ memo = iterator(memo, x, i, a);
+ });
+ return memo;
+ };
+
+ var _keys = function (obj) {
+ if (Object.keys) {
+ return Object.keys(obj);
+ }
+ var keys = [];
+ for (var k in obj) {
+ if (obj.hasOwnProperty(k)) {
+ keys.push(k);
+ }
+ }
+ return keys;
+ };
+
+ var _indexOf = function (arr, item) {
+ if (arr.indexOf) {
+ return arr.indexOf(item);
+ }
+ for (var i = 0; i < arr.length; i += 1) {
+ if (arr[i] === item) {
+ return i;
+ }
+ }
+ return -1;
+ };
+
+ //// exported async module functions ////
+
+ //// nextTick implementation with browser-compatible fallback ////
+ if (typeof setImmediate === 'function') {
+ async.nextTick = function (fn) {
+ setImmediate(fn);
+ };
+ }
+ else if (typeof process !== 'undefined' && process.nextTick) {
+ async.nextTick = process.nextTick;
+ }
+ else {
+ async.nextTick = function (fn) {
+ setTimeout(fn, 0);
+ };
+ }
+
+ async.forEach = function (arr, iterator, callback) {
+ if (!arr.length) {
+ return callback();
+ }
+ var completed = 0;
+ _forEach(arr, function (x) {
+ iterator(x, function (err) {
+ if (err) {
+ callback(err);
+ callback = function () {};
+ }
+ else {
+ completed += 1;
+ if (completed === arr.length) {
+ callback();
+ }
+ }
+ });
+ });
+ };
+
+ async.forEachSeries = function (arr, iterator, callback) {
+ if (!arr.length) {
+ return callback();
+ }
+ var completed = 0;
+ var iterate = function () {
+ iterator(arr[completed], function (err) {
+ if (err) {
+ callback(err);
+ callback = function () {};
+ }
+ else {
+ completed += 1;
+ if (completed === arr.length) {
+ callback();
+ }
+ else {
+ iterate();
+ }
+ }
+ });
+ };
+ iterate();
+ };
+
+
+ var doParallel = function (fn) {
+ return function () {
+ var args = Array.prototype.slice.call(arguments);
+ return fn.apply(null, [async.forEach].concat(args));
+ };
+ };
+ var doSeries = function (fn) {
+ return function () {
+ var args = Array.prototype.slice.call(arguments);
+ return fn.apply(null, [async.forEachSeries].concat(args));
+ };
+ };
+
+
+ var _asyncMap = function (eachfn, arr, iterator, callback) {
+ var results = [];
+ arr = _map(arr, function (x, i) {
+ return {index: i, value: x};
+ });
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (err, v) {
+ results[x.index] = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ };
+ async.map = doParallel(_asyncMap);
+ async.mapSeries = doSeries(_asyncMap);
+
+
+ // reduce only has a series version, as doing reduce in parallel won't
+ // work in many situations.
+ async.reduce = function (arr, memo, iterator, callback) {
+ async.forEachSeries(arr, function (x, callback) {
+ iterator(memo, x, function (err, v) {
+ memo = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, memo);
+ });
+ };
+ // inject alias
+ async.inject = async.reduce;
+ // foldl alias
+ async.foldl = async.reduce;
+
+ async.reduceRight = function (arr, memo, iterator, callback) {
+ var reversed = _map(arr, function (x) {
+ return x;
+ }).reverse();
+ async.reduce(reversed, memo, iterator, callback);
+ };
+ // foldr alias
+ async.foldr = async.reduceRight;
+
+ var _filter = function (eachfn, arr, iterator, callback) {
+ var results = [];
+ arr = _map(arr, function (x, i) {
+ return {index: i, value: x};
+ });
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (v) {
+ if (v) {
+ results.push(x);
+ }
+ callback();
+ });
+ }, function (err) {
+ callback(_map(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ };
+ async.filter = doParallel(_filter);
+ async.filterSeries = doSeries(_filter);
+ // select alias
+ async.select = async.filter;
+ async.selectSeries = async.filterSeries;
+
+ var _reject = function (eachfn, arr, iterator, callback) {
+ var results = [];
+ arr = _map(arr, function (x, i) {
+ return {index: i, value: x};
+ });
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (v) {
+ if (!v) {
+ results.push(x);
+ }
+ callback();
+ });
+ }, function (err) {
+ callback(_map(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ };
+ async.reject = doParallel(_reject);
+ async.rejectSeries = doSeries(_reject);
+
+ var _detect = function (eachfn, arr, iterator, main_callback) {
+ eachfn(arr, function (x, callback) {
+ iterator(x, function (result) {
+ if (result) {
+ main_callback(x);
+ }
+ else {
+ callback();
+ }
+ });
+ }, function (err) {
+ main_callback();
+ });
+ };
+ async.detect = doParallel(_detect);
+ async.detectSeries = doSeries(_detect);
+
+ async.some = function (arr, iterator, main_callback) {
+ async.forEach(arr, function (x, callback) {
+ iterator(x, function (v) {
+ if (v) {
+ main_callback(true);
+ main_callback = function () {};
+ }
+ callback();
+ });
+ }, function (err) {
+ main_callback(false);
+ });
+ };
+ // any alias
+ async.any = async.some;
+
+ async.every = function (arr, iterator, main_callback) {
+ async.forEach(arr, function (x, callback) {
+ iterator(x, function (v) {
+ if (!v) {
+ main_callback(false);
+ main_callback = function () {};
+ }
+ callback();
+ });
+ }, function (err) {
+ main_callback(true);
+ });
+ };
+ // all alias
+ async.all = async.every;
+
+ async.sortBy = function (arr, iterator, callback) {
+ async.map(arr, function (x, callback) {
+ iterator(x, function (err, criteria) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ callback(null, {value: x, criteria: criteria});
+ }
+ });
+ }, function (err, results) {
+ if (err) {
+ return callback(err);
+ }
+ else {
+ var fn = function (left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ };
+ callback(null, _map(results.sort(fn), function (x) {
+ return x.value;
+ }));
+ }
+ });
+ };
+
+ async.auto = function (tasks, callback) {
+ callback = callback || function () {};
+ var keys = _keys(tasks);
+ if (!keys.length) {
+ return callback(null);
+ }
+
+ var completed = [];
+
+ var listeners = [];
+ var addListener = function (fn) {
+ listeners.unshift(fn);
+ };
+ var removeListener = function (fn) {
+ for (var i = 0; i < listeners.length; i += 1) {
+ if (listeners[i] === fn) {
+ listeners.splice(i, 1);
+ return;
+ }
+ }
+ };
+ var taskComplete = function () {
+ _forEach(listeners, function (fn) {
+ fn();
+ });
+ };
+
+ addListener(function () {
+ if (completed.length === keys.length) {
+ callback(null);
+ }
+ });
+
+ _forEach(keys, function (k) {
+ var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k];
+ var taskCallback = function (err) {
+ if (err) {
+ callback(err);
+ // stop subsequent errors hitting callback multiple times
+ callback = function () {};
+ }
+ else {
+ completed.push(k);
+ taskComplete();
+ }
+ };
+ var requires = task.slice(0, Math.abs(task.length - 1)) || [];
+ var ready = function () {
+ return _reduce(requires, function (a, x) {
+ return (a && _indexOf(completed, x) !== -1);
+ }, true);
+ };
+ if (ready()) {
+ task[task.length - 1](taskCallback);
+ }
+ else {
+ var listener = function () {
+ if (ready()) {
+ removeListener(listener);
+ task[task.length - 1](taskCallback);
+ }
+ };
+ addListener(listener);
+ }
+ });
+ };
+
+ async.waterfall = function (tasks, callback) {
+ if (!tasks.length) {
+ return callback();
+ }
+ callback = callback || function () {};
+ var wrapIterator = function (iterator) {
+ return function (err) {
+ if (err) {
+ callback(err);
+ callback = function () {};
+ }
+ else {
+ var args = Array.prototype.slice.call(arguments, 1);
+ var next = iterator.next();
+ if (next) {
+ args.push(wrapIterator(next));
+ }
+ else {
+ args.push(callback);
+ }
+ async.nextTick(function () {
+ iterator.apply(null, args);
+ });
+ }
+ };
+ };
+ wrapIterator(async.iterator(tasks))();
+ };
+
+ async.parallel = function (tasks, callback) {
+ callback = callback || function () {};
+ if (tasks.constructor === Array) {
+ async.map(tasks, function (fn, callback) {
+ if (fn) {
+ fn(function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ callback.call(null, err, args || null);
+ });
+ }
+ }, callback);
+ }
+ else {
+ var results = {};
+ async.forEach(_keys(tasks), function (k, callback) {
+ tasks[k](function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ results[k] = args;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+ };
+
+ async.series = function (tasks, callback) {
+ callback = callback || function () {};
+ if (tasks.constructor === Array) {
+ async.mapSeries(tasks, function (fn, callback) {
+ if (fn) {
+ fn(function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ callback.call(null, err, args || null);
+ });
+ }
+ }, callback);
+ }
+ else {
+ var results = {};
+ async.forEachSeries(_keys(tasks), function (k, callback) {
+ tasks[k](function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ results[k] = args;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+ };
+
+ async.iterator = function (tasks) {
+ var makeCallback = function (index) {
+ var fn = function () {
+ if (tasks.length) {
+ tasks[index].apply(null, arguments);
+ }
+ return fn.next();
+ };
+ fn.next = function () {
+ return (index < tasks.length - 1) ? makeCallback(index + 1): null;
+ };
+ return fn;
+ };
+ return makeCallback(0);
+ };
+
+ async.apply = function (fn) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ return function () {
+ return fn.apply(
+ null, args.concat(Array.prototype.slice.call(arguments))
+ );
+ };
+ };
+
+ var _concat = function (eachfn, arr, fn, callback) {
+ var r = [];
+ eachfn(arr, function (x, cb) {
+ fn(x, function (err, y) {
+ r = r.concat(y || []);
+ cb(err);
+ });
+ }, function (err) {
+ callback(err, r);
+ });
+ };
+ async.concat = doParallel(_concat);
+ async.concatSeries = doSeries(_concat);
+
+ async.whilst = function (test, iterator, callback) {
+ if (test()) {
+ iterator(function (err) {
+ if (err) {
+ return callback(err);
+ }
+ async.whilst(test, iterator, callback);
+ });
+ }
+ else {
+ callback();
+ }
+ };
+
+ async.until = function (test, iterator, callback) {
+ if (!test()) {
+ iterator(function (err) {
+ if (err) {
+ return callback(err);
+ }
+ async.until(test, iterator, callback);
+ });
+ }
+ else {
+ callback();
+ }
+ };
+
+ async.queue = function (worker, concurrency) {
+ var workers = 0;
+ var tasks = [];
+ var q = {
+ concurrency: concurrency,
+ push: function (data, callback) {
+ tasks.push({data: data, callback: callback});
+ async.nextTick(q.process);
+ },
+ process: function () {
+ if (workers < q.concurrency && tasks.length) {
+ var task = tasks.splice(0, 1)[0];
+ workers += 1;
+ worker(task.data, function () {
+ workers -= 1;
+ if (task.callback) {
+ task.callback.apply(task, arguments);
+ }
+ q.process();
+ });
+ }
+ },
+ length: function () {
+ return tasks.length;
+ }
+ };
+ return q;
+ };
+
+ var _console_fn = function (name) {
+ return function (fn) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ fn.apply(null, args.concat([function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (typeof console !== 'undefined') {
+ if (err) {
+ if (console.error) {
+ console.error(err);
+ }
+ }
+ else if (console[name]) {
+ _forEach(args, function (x) {
+ console[name](x);
+ });
+ }
+ }
+ }]));
+ };
+ };
+ async.log = _console_fn('log');
+ async.dir = _console_fn('dir');
+ /*async.info = _console_fn('info');
+ async.warn = _console_fn('warn');
+ async.error = _console_fn('error');*/
+
+ async.memoize = function (fn, hasher) {
+ var memo = {};
+ hasher = hasher || function (x) {
+ return x;
+ };
+ return function () {
+ var args = Array.prototype.slice.call(arguments);
+ var callback = args.pop();
+ var key = hasher.apply(null, args);
+ if (key in memo) {
+ callback.apply(null, memo[key]);
+ }
+ else {
+ fn.apply(null, args.concat([function () {
+ memo[key] = arguments;
+ callback.apply(null, arguments);
+ }]));
+ }
+ };
+ };
+
+}());
+(function(exports){
+/**
+ * This file is based on the node.js assert module, but with some small
+ * changes for browser-compatibility
+ * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS!
+ */
+
+
+/**
+ * Added for browser compatibility
+ */
+
+var _keys = function(obj){
+ if(Object.keys) return Object.keys(obj);
+ if (typeof obj != 'object' && typeof obj != 'function') {
+ throw new TypeError('-');
+ }
+ var keys = [];
+ for(var k in obj){
+ if(obj.hasOwnProperty(k)) keys.push(k);
+ }
+ return keys;
+};
+
+
+
+// http://wiki.commonjs.org/wiki/Unit_Testing/1.0
+//
+// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
+//
+// Originally from narwhal.js (http://narwhaljs.org)
+// Copyright (c) 2009 Thomas Robinson <280north.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 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.
+
+
+var pSlice = Array.prototype.slice;
+
+// 1. The assert module provides functions that throw
+// AssertionError's when particular conditions are not met. The
+// assert module must conform to the following interface.
+
+var assert = exports;
+
+// 2. The AssertionError is defined in assert.
+// new assert.AssertionError({message: message, actual: actual, expected: expected})
+
+assert.AssertionError = function AssertionError (options) {
+ this.name = "AssertionError";
+ this.message = options.message;
+ this.actual = options.actual;
+ this.expected = options.expected;
+ this.operator = options.operator;
+ var stackStartFunction = options.stackStartFunction || fail;
+
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, stackStartFunction);
+ }
+};
+// code from util.inherits in node
+assert.AssertionError.super_ = Error;
+
+
+// EDITED FOR BROWSER COMPATIBILITY: replaced Object.create call
+// TODO: test what effect this may have
+var ctor = function () { this.constructor = assert.AssertionError; };
+ctor.prototype = Error.prototype;
+assert.AssertionError.prototype = new ctor();
+
+
+assert.AssertionError.prototype.toString = function() {
+ if (this.message) {
+ return [this.name+":", this.message].join(' ');
+ } else {
+ return [ this.name+":"
+ , typeof this.expected !== 'undefined' ? JSON.stringify(this.expected) : 'undefined'
+ , this.operator
+ , typeof this.actual !== 'undefined' ? JSON.stringify(this.actual) : 'undefined'
+ ].join(" ");
+ }
+};
+
+// assert.AssertionError instanceof Error
+
+assert.AssertionError.__proto__ = Error.prototype;
+
+// At present only the three keys mentioned above are used and
+// understood by the spec. Implementations or sub modules can pass
+// other keys to the AssertionError's constructor - they will be
+// ignored.
+
+// 3. All of the following functions must throw an AssertionError
+// when a corresponding condition is not met, with a message that
+// may be undefined if not provided. All assertion methods provide
+// both the actual and expected values to the assertion error for
+// display purposes.
+
+function fail(actual, expected, message, operator, stackStartFunction) {
+ throw new assert.AssertionError({
+ message: message,
+ actual: actual,
+ expected: expected,
+ operator: operator,
+ stackStartFunction: stackStartFunction
+ });
+}
+
+// EXTENSION! allows for well behaved errors defined elsewhere.
+assert.fail = fail;
+
+// 4. Pure assertion tests whether a value is truthy, as determined
+// by !!guard.
+// assert.ok(guard, message_opt);
+// This statement is equivalent to assert.equal(true, guard,
+// message_opt);. To test strictly for the value true, use
+// assert.strictEqual(true, guard, message_opt);.
+
+assert.ok = function ok(value, message) {
+ if (!!!value) fail(value, true, message, "==", assert.ok);
+};
+
+// 5. The equality assertion tests shallow, coercive equality with
+// ==.
+// assert.equal(actual, expected, message_opt);
+
+assert.equal = function equal(actual, expected, message) {
+ if (actual != expected) fail(actual, expected, message, "==", assert.equal);
+};
+
+// 6. The non-equality assertion tests for whether two objects are not equal
+// with != assert.notEqual(actual, expected, message_opt);
+
+assert.notEqual = function notEqual(actual, expected, message) {
+ if (actual == expected) {
+ fail(actual, expected, message, "!=", assert.notEqual);
+ }
+};
+
+// 7. The equivalence assertion tests a deep equality relation.
+// assert.deepEqual(actual, expected, message_opt);
+
+assert.deepEqual = function deepEqual(actual, expected, message) {
+ if (!_deepEqual(actual, expected)) {
+ fail(actual, expected, message, "deepEqual", assert.deepEqual);
+ }
+};
+
+var Buffer = null;
+if (typeof require !== 'undefined' && typeof process !== 'undefined') {
+ try {
+ Buffer = require('buffer').Buffer;
+ }
+ catch (e) {
+ // May be a CommonJS environment other than Node.js
+ Buffer = null;
+ }
+}
+
+function _deepEqual(actual, expected) {
+ // 7.1. All identical values are equivalent, as determined by ===.
+ if (actual === expected) {
+ return true;
+ // 7.2. If the expected value is a Date object, the actual value is
+ // equivalent if it is also a Date object that refers to the same time.
+ } else if (actual instanceof Date && expected instanceof Date) {
+ return actual.getTime() === expected.getTime();
+
+ // 7.2.1 If the expcted value is a RegExp object, the actual value is
+ // equivalent if it is also a RegExp object that refers to the same source and options
+ } else if (actual instanceof RegExp && expected instanceof RegExp) {
+ return actual.source === expected.source &&
+ actual.global === expected.global &&
+ actual.ignoreCase === expected.ignoreCase &&
+ actual.multiline === expected.multiline;
+
+ } else if (Buffer && actual instanceof Buffer && expected instanceof Buffer) {
+ return (function() {
+ var i, len;
+
+ for (i = 0, len = expected.length; i < len; i++) {
+ if (actual[i] !== expected[i]) {
+ return false;
+ }
+ }
+ return actual.length === expected.length;
+ })();
+ // 7.3. Other pairs that do not both pass typeof value == "object",
+ // equivalence is determined by ==.
+ } else if (typeof actual != 'object' && typeof expected != 'object') {
+ return actual == expected;
+
+ // 7.4. For all other Object pairs, including Array objects, equivalence is
+ // determined by having the same number of owned properties (as verified
+ // with Object.prototype.hasOwnProperty.call), the same set of keys
+ // (although not necessarily the same order), equivalent values for every
+ // corresponding key, and an identical "prototype" property. Note: this
+ // accounts for both named and indexed properties on Arrays.
+ } else {
+ return objEquiv(actual, expected);
+ }
+}
+
+function isUndefinedOrNull (value) {
+ return value === null || value === undefined;
+}
+
+function isArguments (object) {
+ return Object.prototype.toString.call(object) == '[object Arguments]';
+}
+
+function objEquiv (a, b) {
+ if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
+ return false;
+ // an identical "prototype" property.
+ if (a.prototype !== b.prototype) return false;
+ //~~~I've managed to break Object.keys through screwy arguments passing.
+ // Converting to array solves the problem.
+ if (isArguments(a)) {
+ if (!isArguments(b)) {
+ return false;
+ }
+ a = pSlice.call(a);
+ b = pSlice.call(b);
+ return _deepEqual(a, b);
+ }
+ try{
+ var ka = _keys(a),
+ kb = _keys(b),
+ key, i;
+ } catch (e) {//happens when one is a string literal and the other isn't
+ return false;
+ }
+ // having the same number of owned properties (keys incorporates hasOwnProperty)
+ if (ka.length != kb.length)
+ return false;
+ //the same set of keys (although not necessarily the same order),
+ ka.sort();
+ kb.sort();
+ //~~~cheap key test
+ for (i = ka.length - 1; i >= 0; i--) {
+ if (ka[i] != kb[i])
+ return false;
+ }
+ //equivalent values for every corresponding key, and
+ //~~~possibly expensive deep test
+ for (i = ka.length - 1; i >= 0; i--) {
+ key = ka[i];
+ if (!_deepEqual(a[key], b[key] ))
+ return false;
+ }
+ return true;
+}
+
+// 8. The non-equivalence assertion tests for any deep inequality.
+// assert.notDeepEqual(actual, expected, message_opt);
+
+assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
+ if (_deepEqual(actual, expected)) {
+ fail(actual, expected, message, "notDeepEqual", assert.notDeepEqual);
+ }
+};
+
+// 9. The strict equality assertion tests strict equality, as determined by ===.
+// assert.strictEqual(actual, expected, message_opt);
+
+assert.strictEqual = function strictEqual(actual, expected, message) {
+ if (actual !== expected) {
+ fail(actual, expected, message, "===", assert.strictEqual);
+ }
+};
+
+// 10. The strict non-equality assertion tests for strict inequality, as determined by !==.
+// assert.notStrictEqual(actual, expected, message_opt);
+
+assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
+ if (actual === expected) {
+ fail(actual, expected, message, "!==", assert.notStrictEqual);
+ }
+};
+
+function expectedException(actual, expected) {
+ if (!actual || !expected) {
+ return false;
+ }
+
+ if (expected instanceof RegExp) {
+ return expected.test(actual.message || actual);
+ } else if (actual instanceof expected) {
+ return true;
+ } else if (expected.call({}, actual) === true) {
+ return true;
+ }
+
+ return false;
+}
+
+function _throws(shouldThrow, block, expected, message) {
+ var actual;
+
+ if (typeof expected === 'string') {
+ message = expected;
+ expected = null;
+ }
+
+ try {
+ block();
+ } catch (e) {
+ actual = e;
+ }
+
+ message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
+ (message ? ' ' + message : '.');
+
+ if (shouldThrow && !actual) {
+ fail('Missing expected exception' + message);
+ }
+
+ if (!shouldThrow && expectedException(actual, expected)) {
+ fail('Got unwanted exception' + message);
+ }
+
+ if ((shouldThrow && actual && expected &&
+ !expectedException(actual, expected)) || (!shouldThrow && actual)) {
+ throw actual;
+ }
+}
+
+// 11. Expected to throw an error:
+// assert.throws(block, Error_opt, message_opt);
+
+assert.throws = function(block, /*optional*/error, /*optional*/message) {
+ _throws.apply(this, [true].concat(pSlice.call(arguments)));
+};
+
+// EXTENSION! This is annoying to write outside this module.
+assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
+ _throws.apply(this, [false].concat(pSlice.call(arguments)));
+};
+
+assert.ifError = function (err) { if (err) {throw err;}};
+})(assert);
+(function(exports){
+/*!
+ * Nodeunit
+ * Copyright (c) 2010 Caolan McMahon
+ * MIT Licensed
+ *
+ * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS!
+ * Only code on that line will be removed, it's mostly to avoid requiring code
+ * that is node specific
+ */
+
+/**
+ * Module dependencies
+ */
+
+
+
+/**
+ * Creates assertion objects representing the result of an assert call.
+ * Accepts an object or AssertionError as its argument.
+ *
+ * @param {object} obj
+ * @api public
+ */
+
+exports.assertion = function (obj) {
+ return {
+ method: obj.method || '',
+ message: obj.message || (obj.error && obj.error.message) || '',
+ error: obj.error,
+ passed: function () {
+ return !this.error;
+ },
+ failed: function () {
+ return Boolean(this.error);
+ }
+ };
+};
+
+/**
+ * Creates an assertion list object representing a group of assertions.
+ * Accepts an array of assertion objects.
+ *
+ * @param {Array} arr
+ * @param {Number} duration
+ * @api public
+ */
+
+exports.assertionList = function (arr, duration) {
+ var that = arr || [];
+ that.failures = function () {
+ var failures = 0;
+ for (var i = 0; i < this.length; i += 1) {
+ if (this[i].failed()) {
+ failures += 1;
+ }
+ }
+ return failures;
+ };
+ that.passes = function () {
+ return that.length - that.failures();
+ };
+ that.duration = duration || 0;
+ return that;
+};
+
+/**
+ * Create a wrapper function for assert module methods. Executes a callback
+ * after it's complete with an assertion object representing the result.
+ *
+ * @param {Function} callback
+ * @api private
+ */
+
+var assertWrapper = function (callback) {
+ return function (new_method, assert_method, arity) {
+ return function () {
+ var message = arguments[arity - 1];
+ var a = exports.assertion({method: new_method, message: message});
+ try {
+ assert[assert_method].apply(null, arguments);
+ }
+ catch (e) {
+ a.error = e;
+ }
+ callback(a);
+ };
+ };
+};
+
+/**
+ * Creates the 'test' object that gets passed to every test function.
+ * Accepts the name of the test function as its first argument, followed by
+ * the start time in ms, the options object and a callback function.
+ *
+ * @param {String} name
+ * @param {Number} start
+ * @param {Object} options
+ * @param {Function} callback
+ * @api public
+ */
+
+exports.test = function (name, start, options, callback) {
+ var expecting;
+ var a_list = [];
+
+ var wrapAssert = assertWrapper(function (a) {
+ a_list.push(a);
+ if (options.log) {
+ async.nextTick(function () {
+ options.log(a);
+ });
+ }
+ });
+
+ var test = {
+ done: function (err) {
+ if (expecting !== undefined && expecting !== a_list.length) {
+ var e = new Error(
+ 'Expected ' + expecting + ' assertions, ' +
+ a_list.length + ' ran'
+ );
+ var a1 = exports.assertion({method: 'expect', error: e});
+ a_list.push(a1);
+ if (options.log) {
+ async.nextTick(function () {
+ options.log(a1);
+ });
+ }
+ }
+ if (err) {
+ var a2 = exports.assertion({error: err});
+ a_list.push(a2);
+ if (options.log) {
+ async.nextTick(function () {
+ options.log(a2);
+ });
+ }
+ }
+ var end = new Date().getTime();
+ async.nextTick(function () {
+ var assertion_list = exports.assertionList(a_list, end - start);
+ options.testDone(name, assertion_list);
+ callback(null, a_list);
+ });
+ },
+ ok: wrapAssert('ok', 'ok', 2),
+ same: wrapAssert('same', 'deepEqual', 3),
+ equals: wrapAssert('equals', 'equal', 3),
+ expect: function (num) {
+ expecting = num;
+ },
+ _assertion_list: a_list
+ };
+ // add all functions from the assert module
+ for (var k in assert) {
+ if (assert.hasOwnProperty(k)) {
+ test[k] = wrapAssert(k, k, assert[k].length);
+ }
+ }
+ return test;
+};
+
+/**
+ * Ensures an options object has all callbacks, adding empty callback functions
+ * if any are missing.
+ *
+ * @param {Object} opt
+ * @return {Object}
+ * @api public
+ */
+
+exports.options = function (opt) {
+ var optionalCallback = function (name) {
+ opt[name] = opt[name] || function () {};
+ };
+
+ optionalCallback('moduleStart');
+ optionalCallback('moduleDone');
+ optionalCallback('testStart');
+ optionalCallback('testReady');
+ optionalCallback('testDone');
+ //optionalCallback('log');
+
+ // 'done' callback is not optional.
+
+ return opt;
+};
+})(types);
+(function(exports){
+/*!
+ * Nodeunit
+ * Copyright (c) 2010 Caolan McMahon
+ * MIT Licensed
+ *
+ * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS!
+ * Only code on that line will be removed, it's mostly to avoid requiring code
+ * that is node specific
+ */
+
+/**
+ * Module dependencies
+ */
+
+
+
+/**
+ * Added for browser compatibility
+ */
+
+var _keys = function (obj) {
+ if (Object.keys) {
+ return Object.keys(obj);
+ }
+ var keys = [];
+ for (var k in obj) {
+ if (obj.hasOwnProperty(k)) {
+ keys.push(k);
+ }
+ }
+ return keys;
+};
+
+
+var _copy = function (obj) {
+ var nobj = {};
+ var keys = _keys(obj);
+ for (var i = 0; i < keys.length; i += 1) {
+ nobj[keys[i]] = obj[keys[i]];
+ }
+ return nobj;
+};
+
+
+/**
+ * Runs a test function (fn) from a loaded module. After the test function
+ * calls test.done(), the callback is executed with an assertionList as its
+ * second argument.
+ *
+ * @param {String} name
+ * @param {Function} fn
+ * @param {Object} opt
+ * @param {Function} callback
+ * @api public
+ */
+
+exports.runTest = function (name, fn, opt, callback) {
+ var options = types.options(opt);
+
+ options.testStart(name);
+ var start = new Date().getTime();
+ var test = types.test(name, start, options, callback);
+
+ options.testReady(test);
+ try {
+ fn(test);
+ }
+ catch (e) {
+ test.done(e);
+ }
+};
+
+/**
+ * Takes an object containing test functions or other test suites as properties
+ * and runs each in series. After all tests have completed, the callback is
+ * called with a list of all assertions as the second argument.
+ *
+ * If a name is passed to this function it is prepended to all test and suite
+ * names that run within it.
+ *
+ * @param {String} name
+ * @param {Object} suite
+ * @param {Object} opt
+ * @param {Function} callback
+ * @api public
+ */
+
+exports.runSuite = function (name, suite, opt, callback) {
+ suite = wrapGroup(suite);
+ var keys = _keys(suite);
+
+ async.concatSeries(keys, function (k, cb) {
+ var prop = suite[k], _name;
+
+ _name = name ? [].concat(name, k) : [k];
+ _name.toString = function () {
+ // fallback for old one
+ return this.join(' - ');
+ };
+
+ if (typeof prop === 'function') {
+ var in_name = false,
+ in_specific_test = (_name.toString() === opt.testFullSpec) ? true : false;
+ for (var i = 0; i < _name.length; i += 1) {
+ if (_name[i] === opt.testspec) {
+ in_name = true;
+ }
+ }
+
+ if ((!opt.testFullSpec || in_specific_test) && (!opt.testspec || in_name)) {
+ if (opt.moduleStart) {
+ opt.moduleStart();
+ }
+ exports.runTest(_name, suite[k], opt, cb);
+ }
+ else {
+ return cb();
+ }
+ }
+ else {
+ exports.runSuite(_name, suite[k], opt, cb);
+ }
+ }, callback);
+};
+
+/**
+ * Run each exported test function or test suite from a loaded module.
+ *
+ * @param {String} name
+ * @param {Object} mod
+ * @param {Object} opt
+ * @param {Function} callback
+ * @api public
+ */
+
+exports.runModule = function (name, mod, opt, callback) {
+ var options = _copy(types.options(opt));
+
+ var _run = false;
+ var _moduleStart = options.moduleStart;
+
+ mod = wrapGroup(mod);
+
+ function run_once() {
+ if (!_run) {
+ _run = true;
+ _moduleStart(name);
+ }
+ }
+ options.moduleStart = run_once;
+
+ var start = new Date().getTime();
+
+ exports.runSuite(null, mod, options, function (err, a_list) {
+ var end = new Date().getTime();
+ var assertion_list = types.assertionList(a_list, end - start);
+ options.moduleDone(name, assertion_list);
+ if (nodeunit.complete) {
+ nodeunit.complete(name, assertion_list);
+ }
+ callback(null, a_list);
+ });
+};
+
+/**
+ * Treats an object literal as a list of modules keyed by name. Runs each
+ * module and finished with calling 'done'. You can think of this as a browser
+ * safe alternative to runFiles in the nodeunit module.
+ *
+ * @param {Object} modules
+ * @param {Object} opt
+ * @api public
+ */
+
+// TODO: add proper unit tests for this function
+exports.runModules = function (modules, opt) {
+ var all_assertions = [];
+ var options = types.options(opt);
+ var start = new Date().getTime();
+
+ async.concatSeries(_keys(modules), function (k, cb) {
+ exports.runModule(k, modules[k], options, cb);
+ },
+ function (err, all_assertions) {
+ var end = new Date().getTime();
+ options.done(types.assertionList(all_assertions, end - start));
+ });
+};
+
+
+/**
+ * Wraps a test function with setUp and tearDown functions.
+ * Used by testCase.
+ *
+ * @param {Function} setUp
+ * @param {Function} tearDown
+ * @param {Function} fn
+ * @api private
+ */
+
+var wrapTest = function (setUp, tearDown, fn) {
+ return function (test) {
+ var context = {};
+ if (tearDown) {
+ var done = test.done;
+ test.done = function (err) {
+ try {
+ tearDown.call(context, function (err2) {
+ if (err && err2) {
+ test._assertion_list.push(
+ types.assertion({error: err})
+ );
+ return done(err2);
+ }
+ done(err || err2);
+ });
+ }
+ catch (e) {
+ done(e);
+ }
+ };
+ }
+ if (setUp) {
+ setUp.call(context, function (err) {
+ if (err) {
+ return test.done(err);
+ }
+ fn.call(context, test);
+ });
+ }
+ else {
+ fn.call(context, test);
+ }
+ };
+};
+
+
+/**
+ * Returns a serial callback from two functions.
+ *
+ * @param {Function} funcFirst
+ * @param {Function} funcSecond
+ * @api private
+ */
+
+var getSerialCallback = function (fns) {
+ if (!fns.length) {
+ return null;
+ }
+ return function (callback) {
+ var that = this;
+ var bound_fns = [];
+ for (var i = 0, len = fns.length; i < len; i++) {
+ (function (j) {
+ bound_fns.push(function () {
+ return fns[j].apply(that, arguments);
+ });
+ })(i);
+ }
+ return async.series(bound_fns, callback);
+ };
+};
+
+
+/**
+ * Wraps a group of tests with setUp and tearDown functions.
+ * Used by testCase.
+ *
+ * @param {Object} group
+ * @param {Array} setUps - parent setUp functions
+ * @param {Array} tearDowns - parent tearDown functions
+ * @api private
+ */
+
+var wrapGroup = function (group, setUps, tearDowns) {
+ var tests = {};
+
+ var setUps = setUps ? setUps.slice(): [];
+ var tearDowns = tearDowns ? tearDowns.slice(): [];
+
+ if (group.setUp) {
+ setUps.push(group.setUp);
+ delete group.setUp;
+ }
+ if (group.tearDown) {
+ tearDowns.unshift(group.tearDown);
+ delete group.tearDown;
+ }
+
+ var keys = _keys(group);
+
+ for (var i = 0; i < keys.length; i += 1) {
+ var k = keys[i];
+ if (typeof group[k] === 'function') {
+ tests[k] = wrapTest(
+ getSerialCallback(setUps),
+ getSerialCallback(tearDowns),
+ group[k]
+ );
+ }
+ else if (typeof group[k] === 'object') {
+ tests[k] = wrapGroup(group[k], setUps, tearDowns);
+ }
+ }
+ return tests;
+};
+
+
+/**
+ * Backwards compatibility for test suites using old testCase API
+ */
+
+exports.testCase = function (suite) {
+ return suite;
+};
+})(core);
+(function(exports){
+/*!
+ * Nodeunit
+ * Copyright (c) 2010 Caolan McMahon
+ * MIT Licensed
+ *
+ * THIS FILE SHOULD BE BROWSER-COMPATIBLE JS!
+ * Only code on that line will be removed, its mostly to avoid requiring code
+ * that is node specific
+ */
+
+
+/**
+ * NOTE: this test runner is not listed in index.js because it cannot be
+ * used with the command-line tool, only inside the browser.
+ */
+
+
+/**
+ * Reporter info string
+ */
+
+exports.info = "Browser-based test reporter";
+
+
+/**
+ * Run all tests within each module, reporting the results
+ *
+ * @param {Array} files
+ * @api public
+ */
+
+exports.run = function (modules, options, callback) {
+ var start = new Date().getTime(), div;
+ options = options || {};
+ div = options.div || document.body;
+
+ function setText(el, txt) {
+ if ('innerText' in el) {
+ el.innerText = txt;
+ }
+ else if ('textContent' in el){
+ el.textContent = txt;
+ }
+ }
+
+ function getOrCreate(tag, id) {
+ var el = document.getElementById(id);
+ if (!el) {
+ el = document.createElement(tag);
+ el.id = id;
+ div.appendChild(el);
+ }
+ return el;
+ };
+
+ var header = getOrCreate('h1', 'nodeunit-header');
+ var banner = getOrCreate('h2', 'nodeunit-banner');
+ var userAgent = getOrCreate('h2', 'nodeunit-userAgent');
+ var tests = getOrCreate('ol', 'nodeunit-tests');
+ var result = getOrCreate('p', 'nodeunit-testresult');
+
+ setText(userAgent, navigator.userAgent);
+
+ nodeunit.runModules(modules, {
+ moduleStart: function (name) {
+ /*var mheading = document.createElement('h2');
+ mheading.innerText = name;
+ results.appendChild(mheading);
+ module = document.createElement('ol');
+ results.appendChild(module);*/
+ },
+ testDone: function (name, assertions) {
+ var test = document.createElement('li');
+ var strong = document.createElement('strong');
+ strong.innerHTML = name + ' (' +
+ '' + assertions.failures() + ', ' +
+ '' + assertions.passes() + ', ' +
+ assertions.length +
+ ')';
+ test.className = assertions.failures() ? 'fail': 'pass';
+ test.appendChild(strong);
+
+ var aList = document.createElement('ol');
+ aList.style.display = 'none';
+ test.onclick = function () {
+ var d = aList.style.display;
+ aList.style.display = (d == 'none') ? 'block': 'none';
+ };
+ for (var i=0; i' + (a.error.stack || a.error) + '';
+ li.className = 'fail';
+ }
+ else {
+ li.innerHTML = a.message || a.method || 'no message';
+ li.className = 'pass';
+ }
+ aList.appendChild(li);
+ }
+ test.appendChild(aList);
+ tests.appendChild(test);
+ },
+ done: function (assertions) {
+ var end = new Date().getTime();
+ var duration = end - start;
+
+ var failures = assertions.failures();
+ banner.className = failures ? 'fail': 'pass';
+
+ result.innerHTML = 'Tests completed in ' + duration +
+ ' milliseconds. ' +
+ assertions.passes() + ' assertions of ' +
+ '' + assertions.length + ' passed, ' +
+ assertions.failures() + ' failed.';
+
+ if (callback) callback(assertions.failures() ? new Error('We have got test failures.') : undefined);
+ }
+ });
+};
+})(reporter);
+nodeunit = core;
+nodeunit.assert = assert;
+nodeunit.reporter = reporter;
+nodeunit.run = reporter.run;
+return nodeunit; })();
diff --git a/bower_components/async/dist/async.js b/bower_components/async/dist/async.js
new file mode 100644
index 0000000..31e7620
--- /dev/null
+++ b/bower_components/async/dist/async.js
@@ -0,0 +1,1265 @@
+/*!
+ * async
+ * https://github.com/caolan/async
+ *
+ * Copyright 2010-2014 Caolan McMahon
+ * Released under the MIT license
+ */
+(function () {
+
+ var async = {};
+ function noop() {}
+ function identity(v) {
+ return v;
+ }
+ function toBool(v) {
+ return !!v;
+ }
+ function notId(v) {
+ return !v;
+ }
+
+ // global on the server, window in the browser
+ var previous_async;
+
+ // Establish the root object, `window` (`self`) in the browser, `global`
+ // on the server, or `this` in some virtual machines. We use `self`
+ // instead of `window` for `WebWorker` support.
+ var root = typeof self === 'object' && self.self === self && self ||
+ typeof global === 'object' && global.global === global && global ||
+ this;
+
+ if (root != null) {
+ previous_async = root.async;
+ }
+
+ async.noConflict = function () {
+ root.async = previous_async;
+ return async;
+ };
+
+ function only_once(fn) {
+ return function() {
+ if (fn === null) throw new Error("Callback was already called.");
+ fn.apply(this, arguments);
+ fn = null;
+ };
+ }
+
+ function _once(fn) {
+ return function() {
+ if (fn === null) return;
+ fn.apply(this, arguments);
+ fn = null;
+ };
+ }
+
+ //// cross-browser compatiblity functions ////
+
+ var _toString = Object.prototype.toString;
+
+ var _isArray = Array.isArray || function (obj) {
+ return _toString.call(obj) === '[object Array]';
+ };
+
+ // Ported from underscore.js isObject
+ var _isObject = function(obj) {
+ var type = typeof obj;
+ return type === 'function' || type === 'object' && !!obj;
+ };
+
+ function _isArrayLike(arr) {
+ return _isArray(arr) || (
+ // has a positive integer length property
+ typeof arr.length === "number" &&
+ arr.length >= 0 &&
+ arr.length % 1 === 0
+ );
+ }
+
+ function _arrayEach(arr, iterator) {
+ var index = -1,
+ length = arr.length;
+
+ while (++index < length) {
+ iterator(arr[index], index, arr);
+ }
+ }
+
+ function _map(arr, iterator) {
+ var index = -1,
+ length = arr.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iterator(arr[index], index, arr);
+ }
+ return result;
+ }
+
+ function _range(count) {
+ return _map(Array(count), function (v, i) { return i; });
+ }
+
+ function _reduce(arr, iterator, memo) {
+ _arrayEach(arr, function (x, i, a) {
+ memo = iterator(memo, x, i, a);
+ });
+ return memo;
+ }
+
+ function _forEachOf(object, iterator) {
+ _arrayEach(_keys(object), function (key) {
+ iterator(object[key], key);
+ });
+ }
+
+ function _indexOf(arr, item) {
+ for (var i = 0; i < arr.length; i++) {
+ if (arr[i] === item) return i;
+ }
+ return -1;
+ }
+
+ var _keys = Object.keys || function (obj) {
+ var keys = [];
+ for (var k in obj) {
+ if (obj.hasOwnProperty(k)) {
+ keys.push(k);
+ }
+ }
+ return keys;
+ };
+
+ function _keyIterator(coll) {
+ var i = -1;
+ var len;
+ var keys;
+ if (_isArrayLike(coll)) {
+ len = coll.length;
+ return function next() {
+ i++;
+ return i < len ? i : null;
+ };
+ } else {
+ keys = _keys(coll);
+ len = keys.length;
+ return function next() {
+ i++;
+ return i < len ? keys[i] : null;
+ };
+ }
+ }
+
+ // Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html)
+ // This accumulates the arguments passed into an array, after a given index.
+ // From underscore.js (https://github.com/jashkenas/underscore/pull/2140).
+ function _restParam(func, startIndex) {
+ startIndex = startIndex == null ? func.length - 1 : +startIndex;
+ return function() {
+ var length = Math.max(arguments.length - startIndex, 0);
+ var rest = Array(length);
+ for (var index = 0; index < length; index++) {
+ rest[index] = arguments[index + startIndex];
+ }
+ switch (startIndex) {
+ case 0: return func.call(this, rest);
+ case 1: return func.call(this, arguments[0], rest);
+ }
+ // Currently unused but handle cases outside of the switch statement:
+ // var args = Array(startIndex + 1);
+ // for (index = 0; index < startIndex; index++) {
+ // args[index] = arguments[index];
+ // }
+ // args[startIndex] = rest;
+ // return func.apply(this, args);
+ };
+ }
+
+ function _withoutIndex(iterator) {
+ return function (value, index, callback) {
+ return iterator(value, callback);
+ };
+ }
+
+ //// exported async module functions ////
+
+ //// nextTick implementation with browser-compatible fallback ////
+
+ // capture the global reference to guard against fakeTimer mocks
+ var _setImmediate = typeof setImmediate === 'function' && setImmediate;
+
+ var _delay = _setImmediate ? function(fn) {
+ // not a direct alias for IE10 compatibility
+ _setImmediate(fn);
+ } : function(fn) {
+ setTimeout(fn, 0);
+ };
+
+ if (typeof process === 'object' && typeof process.nextTick === 'function') {
+ async.nextTick = process.nextTick;
+ } else {
+ async.nextTick = _delay;
+ }
+ async.setImmediate = _setImmediate ? _delay : async.nextTick;
+
+
+ async.forEach =
+ async.each = function (arr, iterator, callback) {
+ return async.eachOf(arr, _withoutIndex(iterator), callback);
+ };
+
+ async.forEachSeries =
+ async.eachSeries = function (arr, iterator, callback) {
+ return async.eachOfSeries(arr, _withoutIndex(iterator), callback);
+ };
+
+
+ async.forEachLimit =
+ async.eachLimit = function (arr, limit, iterator, callback) {
+ return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback);
+ };
+
+ async.forEachOf =
+ async.eachOf = function (object, iterator, callback) {
+ callback = _once(callback || noop);
+ object = object || [];
+
+ var iter = _keyIterator(object);
+ var key, completed = 0;
+
+ while ((key = iter()) != null) {
+ completed += 1;
+ iterator(object[key], key, only_once(done));
+ }
+
+ if (completed === 0) callback(null);
+
+ function done(err) {
+ completed--;
+ if (err) {
+ callback(err);
+ }
+ // Check key is null in case iterator isn't exhausted
+ // and done resolved synchronously.
+ else if (key === null && completed <= 0) {
+ callback(null);
+ }
+ }
+ };
+
+ async.forEachOfSeries =
+ async.eachOfSeries = function (obj, iterator, callback) {
+ callback = _once(callback || noop);
+ obj = obj || [];
+ var nextKey = _keyIterator(obj);
+ var key = nextKey();
+ function iterate() {
+ var sync = true;
+ if (key === null) {
+ return callback(null);
+ }
+ iterator(obj[key], key, only_once(function (err) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ key = nextKey();
+ if (key === null) {
+ return callback(null);
+ } else {
+ if (sync) {
+ async.setImmediate(iterate);
+ } else {
+ iterate();
+ }
+ }
+ }
+ }));
+ sync = false;
+ }
+ iterate();
+ };
+
+
+
+ async.forEachOfLimit =
+ async.eachOfLimit = function (obj, limit, iterator, callback) {
+ _eachOfLimit(limit)(obj, iterator, callback);
+ };
+
+ function _eachOfLimit(limit) {
+
+ return function (obj, iterator, callback) {
+ callback = _once(callback || noop);
+ obj = obj || [];
+ var nextKey = _keyIterator(obj);
+ if (limit <= 0) {
+ return callback(null);
+ }
+ var done = false;
+ var running = 0;
+ var errored = false;
+
+ (function replenish () {
+ if (done && running <= 0) {
+ return callback(null);
+ }
+
+ while (running < limit && !errored) {
+ var key = nextKey();
+ if (key === null) {
+ done = true;
+ if (running <= 0) {
+ callback(null);
+ }
+ return;
+ }
+ running += 1;
+ iterator(obj[key], key, only_once(function (err) {
+ running -= 1;
+ if (err) {
+ callback(err);
+ errored = true;
+ }
+ else {
+ replenish();
+ }
+ }));
+ }
+ })();
+ };
+ }
+
+
+ function doParallel(fn) {
+ return function (obj, iterator, callback) {
+ return fn(async.eachOf, obj, iterator, callback);
+ };
+ }
+ function doParallelLimit(fn) {
+ return function (obj, limit, iterator, callback) {
+ return fn(_eachOfLimit(limit), obj, iterator, callback);
+ };
+ }
+ function doSeries(fn) {
+ return function (obj, iterator, callback) {
+ return fn(async.eachOfSeries, obj, iterator, callback);
+ };
+ }
+
+ function _asyncMap(eachfn, arr, iterator, callback) {
+ callback = _once(callback || noop);
+ arr = arr || [];
+ var results = _isArrayLike(arr) ? [] : {};
+ eachfn(arr, function (value, index, callback) {
+ iterator(value, function (err, v) {
+ results[index] = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+
+ async.map = doParallel(_asyncMap);
+ async.mapSeries = doSeries(_asyncMap);
+ async.mapLimit = doParallelLimit(_asyncMap);
+
+ // reduce only has a series version, as doing reduce in parallel won't
+ // work in many situations.
+ async.inject =
+ async.foldl =
+ async.reduce = function (arr, memo, iterator, callback) {
+ async.eachOfSeries(arr, function (x, i, callback) {
+ iterator(memo, x, function (err, v) {
+ memo = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, memo);
+ });
+ };
+
+ async.foldr =
+ async.reduceRight = function (arr, memo, iterator, callback) {
+ var reversed = _map(arr, identity).reverse();
+ async.reduce(reversed, memo, iterator, callback);
+ };
+
+ async.transform = function (arr, memo, iterator, callback) {
+ if (arguments.length === 3) {
+ callback = iterator;
+ iterator = memo;
+ memo = _isArray(arr) ? [] : {};
+ }
+
+ async.eachOf(arr, function(v, k, cb) {
+ iterator(memo, v, k, cb);
+ }, function(err) {
+ callback(err, memo);
+ });
+ };
+
+ function _filter(eachfn, arr, iterator, callback) {
+ var results = [];
+ eachfn(arr, function (x, index, callback) {
+ iterator(x, function (v) {
+ if (v) {
+ results.push({index: index, value: x});
+ }
+ callback();
+ });
+ }, function () {
+ callback(_map(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ }
+
+ async.select =
+ async.filter = doParallel(_filter);
+
+ async.selectLimit =
+ async.filterLimit = doParallelLimit(_filter);
+
+ async.selectSeries =
+ async.filterSeries = doSeries(_filter);
+
+ function _reject(eachfn, arr, iterator, callback) {
+ _filter(eachfn, arr, function(value, cb) {
+ iterator(value, function(v) {
+ cb(!v);
+ });
+ }, callback);
+ }
+ async.reject = doParallel(_reject);
+ async.rejectLimit = doParallelLimit(_reject);
+ async.rejectSeries = doSeries(_reject);
+
+ function _createTester(eachfn, check, getResult) {
+ return function(arr, limit, iterator, cb) {
+ function done() {
+ if (cb) cb(getResult(false, void 0));
+ }
+ function iteratee(x, _, callback) {
+ if (!cb) return callback();
+ iterator(x, function (v) {
+ if (cb && check(v)) {
+ cb(getResult(true, x));
+ cb = iterator = false;
+ }
+ callback();
+ });
+ }
+ if (arguments.length > 3) {
+ eachfn(arr, limit, iteratee, done);
+ } else {
+ cb = iterator;
+ iterator = limit;
+ eachfn(arr, iteratee, done);
+ }
+ };
+ }
+
+ async.any =
+ async.some = _createTester(async.eachOf, toBool, identity);
+
+ async.someLimit = _createTester(async.eachOfLimit, toBool, identity);
+
+ async.all =
+ async.every = _createTester(async.eachOf, notId, notId);
+
+ async.everyLimit = _createTester(async.eachOfLimit, notId, notId);
+
+ function _findGetResult(v, x) {
+ return x;
+ }
+ async.detect = _createTester(async.eachOf, identity, _findGetResult);
+ async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult);
+ async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult);
+
+ async.sortBy = function (arr, iterator, callback) {
+ async.map(arr, function (x, callback) {
+ iterator(x, function (err, criteria) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ callback(null, {value: x, criteria: criteria});
+ }
+ });
+ }, function (err, results) {
+ if (err) {
+ return callback(err);
+ }
+ else {
+ callback(null, _map(results.sort(comparator), function (x) {
+ return x.value;
+ }));
+ }
+
+ });
+
+ function comparator(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }
+ };
+
+ async.auto = function (tasks, concurrency, callback) {
+ if (typeof arguments[1] === 'function') {
+ // concurrency is optional, shift the args.
+ callback = concurrency;
+ concurrency = null;
+ }
+ callback = _once(callback || noop);
+ var keys = _keys(tasks);
+ var remainingTasks = keys.length;
+ if (!remainingTasks) {
+ return callback(null);
+ }
+ if (!concurrency) {
+ concurrency = remainingTasks;
+ }
+
+ var results = {};
+ var runningTasks = 0;
+
+ var hasError = false;
+
+ var listeners = [];
+ function addListener(fn) {
+ listeners.unshift(fn);
+ }
+ function removeListener(fn) {
+ var idx = _indexOf(listeners, fn);
+ if (idx >= 0) listeners.splice(idx, 1);
+ }
+ function taskComplete() {
+ remainingTasks--;
+ _arrayEach(listeners.slice(0), function (fn) {
+ fn();
+ });
+ }
+
+ addListener(function () {
+ if (!remainingTasks) {
+ callback(null, results);
+ }
+ });
+
+ _arrayEach(keys, function (k) {
+ if (hasError) return;
+ var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
+ var taskCallback = _restParam(function(err, args) {
+ runningTasks--;
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ if (err) {
+ var safeResults = {};
+ _forEachOf(results, function(val, rkey) {
+ safeResults[rkey] = val;
+ });
+ safeResults[k] = args;
+ hasError = true;
+
+ callback(err, safeResults);
+ }
+ else {
+ results[k] = args;
+ async.setImmediate(taskComplete);
+ }
+ });
+ var requires = task.slice(0, task.length - 1);
+ // prevent dead-locks
+ var len = requires.length;
+ var dep;
+ while (len--) {
+ if (!(dep = tasks[requires[len]])) {
+ throw new Error('Has nonexistent dependency in ' + requires.join(', '));
+ }
+ if (_isArray(dep) && _indexOf(dep, k) >= 0) {
+ throw new Error('Has cyclic dependencies');
+ }
+ }
+ function ready() {
+ return runningTasks < concurrency && _reduce(requires, function (a, x) {
+ return (a && results.hasOwnProperty(x));
+ }, true) && !results.hasOwnProperty(k);
+ }
+ if (ready()) {
+ runningTasks++;
+ task[task.length - 1](taskCallback, results);
+ }
+ else {
+ addListener(listener);
+ }
+ function listener() {
+ if (ready()) {
+ runningTasks++;
+ removeListener(listener);
+ task[task.length - 1](taskCallback, results);
+ }
+ }
+ });
+ };
+
+
+
+ async.retry = function(times, task, callback) {
+ var DEFAULT_TIMES = 5;
+ var DEFAULT_INTERVAL = 0;
+
+ var attempts = [];
+
+ var opts = {
+ times: DEFAULT_TIMES,
+ interval: DEFAULT_INTERVAL
+ };
+
+ function parseTimes(acc, t){
+ if(typeof t === 'number'){
+ acc.times = parseInt(t, 10) || DEFAULT_TIMES;
+ } else if(typeof t === 'object'){
+ acc.times = parseInt(t.times, 10) || DEFAULT_TIMES;
+ acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL;
+ } else {
+ throw new Error('Unsupported argument type for \'times\': ' + typeof t);
+ }
+ }
+
+ var length = arguments.length;
+ if (length < 1 || length > 3) {
+ throw new Error('Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)');
+ } else if (length <= 2 && typeof times === 'function') {
+ callback = task;
+ task = times;
+ }
+ if (typeof times !== 'function') {
+ parseTimes(opts, times);
+ }
+ opts.callback = callback;
+ opts.task = task;
+
+ function wrappedTask(wrappedCallback, wrappedResults) {
+ function retryAttempt(task, finalAttempt) {
+ return function(seriesCallback) {
+ task(function(err, result){
+ seriesCallback(!err || finalAttempt, {err: err, result: result});
+ }, wrappedResults);
+ };
+ }
+
+ function retryInterval(interval){
+ return function(seriesCallback){
+ setTimeout(function(){
+ seriesCallback(null);
+ }, interval);
+ };
+ }
+
+ while (opts.times) {
+
+ var finalAttempt = !(opts.times-=1);
+ attempts.push(retryAttempt(opts.task, finalAttempt));
+ if(!finalAttempt && opts.interval > 0){
+ attempts.push(retryInterval(opts.interval));
+ }
+ }
+
+ async.series(attempts, function(done, data){
+ data = data[data.length - 1];
+ (wrappedCallback || opts.callback)(data.err, data.result);
+ });
+ }
+
+ // If a callback is passed, run this as a controll flow
+ return opts.callback ? wrappedTask() : wrappedTask;
+ };
+
+ async.waterfall = function (tasks, callback) {
+ callback = _once(callback || noop);
+ if (!_isArray(tasks)) {
+ var err = new Error('First argument to waterfall must be an array of functions');
+ return callback(err);
+ }
+ if (!tasks.length) {
+ return callback();
+ }
+ function wrapIterator(iterator) {
+ return _restParam(function (err, args) {
+ if (err) {
+ callback.apply(null, [err].concat(args));
+ }
+ else {
+ var next = iterator.next();
+ if (next) {
+ args.push(wrapIterator(next));
+ }
+ else {
+ args.push(callback);
+ }
+ ensureAsync(iterator).apply(null, args);
+ }
+ });
+ }
+ wrapIterator(async.iterator(tasks))();
+ };
+
+ function _parallel(eachfn, tasks, callback) {
+ callback = callback || noop;
+ var results = _isArrayLike(tasks) ? [] : {};
+
+ eachfn(tasks, function (task, key, callback) {
+ task(_restParam(function (err, args) {
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ results[key] = args;
+ callback(err);
+ }));
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+
+ async.parallel = function (tasks, callback) {
+ _parallel(async.eachOf, tasks, callback);
+ };
+
+ async.parallelLimit = function(tasks, limit, callback) {
+ _parallel(_eachOfLimit(limit), tasks, callback);
+ };
+
+ async.series = function(tasks, callback) {
+ _parallel(async.eachOfSeries, tasks, callback);
+ };
+
+ async.iterator = function (tasks) {
+ function makeCallback(index) {
+ function fn() {
+ if (tasks.length) {
+ tasks[index].apply(null, arguments);
+ }
+ return fn.next();
+ }
+ fn.next = function () {
+ return (index < tasks.length - 1) ? makeCallback(index + 1): null;
+ };
+ return fn;
+ }
+ return makeCallback(0);
+ };
+
+ async.apply = _restParam(function (fn, args) {
+ return _restParam(function (callArgs) {
+ return fn.apply(
+ null, args.concat(callArgs)
+ );
+ });
+ });
+
+ function _concat(eachfn, arr, fn, callback) {
+ var result = [];
+ eachfn(arr, function (x, index, cb) {
+ fn(x, function (err, y) {
+ result = result.concat(y || []);
+ cb(err);
+ });
+ }, function (err) {
+ callback(err, result);
+ });
+ }
+ async.concat = doParallel(_concat);
+ async.concatSeries = doSeries(_concat);
+
+ async.whilst = function (test, iterator, callback) {
+ callback = callback || noop;
+ if (test()) {
+ var next = _restParam(function(err, args) {
+ if (err) {
+ callback(err);
+ } else if (test.apply(this, args)) {
+ iterator(next);
+ } else {
+ callback.apply(null, [null].concat(args));
+ }
+ });
+ iterator(next);
+ } else {
+ callback(null);
+ }
+ };
+
+ async.doWhilst = function (iterator, test, callback) {
+ var calls = 0;
+ return async.whilst(function() {
+ return ++calls <= 1 || test.apply(this, arguments);
+ }, iterator, callback);
+ };
+
+ async.until = function (test, iterator, callback) {
+ return async.whilst(function() {
+ return !test.apply(this, arguments);
+ }, iterator, callback);
+ };
+
+ async.doUntil = function (iterator, test, callback) {
+ return async.doWhilst(iterator, function() {
+ return !test.apply(this, arguments);
+ }, callback);
+ };
+
+ async.during = function (test, iterator, callback) {
+ callback = callback || noop;
+
+ var next = _restParam(function(err, args) {
+ if (err) {
+ callback(err);
+ } else {
+ args.push(check);
+ test.apply(this, args);
+ }
+ });
+
+ var check = function(err, truth) {
+ if (err) {
+ callback(err);
+ } else if (truth) {
+ iterator(next);
+ } else {
+ callback(null);
+ }
+ };
+
+ test(check);
+ };
+
+ async.doDuring = function (iterator, test, callback) {
+ var calls = 0;
+ async.during(function(next) {
+ if (calls++ < 1) {
+ next(null, true);
+ } else {
+ test.apply(this, arguments);
+ }
+ }, iterator, callback);
+ };
+
+ function _queue(worker, concurrency, payload) {
+ if (concurrency == null) {
+ concurrency = 1;
+ }
+ else if(concurrency === 0) {
+ throw new Error('Concurrency must not be zero');
+ }
+ function _insert(q, data, pos, callback) {
+ if (callback != null && typeof callback !== "function") {
+ throw new Error("task callback must be a function");
+ }
+ q.started = true;
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length === 0 && q.idle()) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ q.drain();
+ });
+ }
+ _arrayEach(data, function(task) {
+ var item = {
+ data: task,
+ callback: callback || noop
+ };
+
+ if (pos) {
+ q.tasks.unshift(item);
+ } else {
+ q.tasks.push(item);
+ }
+
+ if (q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ });
+ async.setImmediate(q.process);
+ }
+ function _next(q, tasks) {
+ return function(){
+ workers -= 1;
+
+ var removed = false;
+ var args = arguments;
+ _arrayEach(tasks, function (task) {
+ _arrayEach(workersList, function (worker, index) {
+ if (worker === task && !removed) {
+ workersList.splice(index, 1);
+ removed = true;
+ }
+ });
+
+ task.callback.apply(task, args);
+ });
+ if (q.tasks.length + workers === 0) {
+ q.drain();
+ }
+ q.process();
+ };
+ }
+
+ var workers = 0;
+ var workersList = [];
+ var q = {
+ tasks: [],
+ concurrency: concurrency,
+ payload: payload,
+ saturated: noop,
+ empty: noop,
+ drain: noop,
+ started: false,
+ paused: false,
+ push: function (data, callback) {
+ _insert(q, data, false, callback);
+ },
+ kill: function () {
+ q.drain = noop;
+ q.tasks = [];
+ },
+ unshift: function (data, callback) {
+ _insert(q, data, true, callback);
+ },
+ process: function () {
+ while(!q.paused && workers < q.concurrency && q.tasks.length){
+
+ var tasks = q.payload ?
+ q.tasks.splice(0, q.payload) :
+ q.tasks.splice(0, q.tasks.length);
+
+ var data = _map(tasks, function (task) {
+ return task.data;
+ });
+
+ if (q.tasks.length === 0) {
+ q.empty();
+ }
+ workers += 1;
+ workersList.push(tasks[0]);
+ var cb = only_once(_next(q, tasks));
+ worker(data, cb);
+ }
+ },
+ length: function () {
+ return q.tasks.length;
+ },
+ running: function () {
+ return workers;
+ },
+ workersList: function () {
+ return workersList;
+ },
+ idle: function() {
+ return q.tasks.length + workers === 0;
+ },
+ pause: function () {
+ q.paused = true;
+ },
+ resume: function () {
+ if (q.paused === false) { return; }
+ q.paused = false;
+ var resumeCount = Math.min(q.concurrency, q.tasks.length);
+ // Need to call q.process once per concurrent
+ // worker to preserve full concurrency after pause
+ for (var w = 1; w <= resumeCount; w++) {
+ async.setImmediate(q.process);
+ }
+ }
+ };
+ return q;
+ }
+
+ async.queue = function (worker, concurrency) {
+ var q = _queue(function (items, cb) {
+ worker(items[0], cb);
+ }, concurrency, 1);
+
+ return q;
+ };
+
+ async.priorityQueue = function (worker, concurrency) {
+
+ function _compareTasks(a, b){
+ return a.priority - b.priority;
+ }
+
+ function _binarySearch(sequence, item, compare) {
+ var beg = -1,
+ end = sequence.length - 1;
+ while (beg < end) {
+ var mid = beg + ((end - beg + 1) >>> 1);
+ if (compare(item, sequence[mid]) >= 0) {
+ beg = mid;
+ } else {
+ end = mid - 1;
+ }
+ }
+ return beg;
+ }
+
+ function _insert(q, data, priority, callback) {
+ if (callback != null && typeof callback !== "function") {
+ throw new Error("task callback must be a function");
+ }
+ q.started = true;
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length === 0) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ q.drain();
+ });
+ }
+ _arrayEach(data, function(task) {
+ var item = {
+ data: task,
+ priority: priority,
+ callback: typeof callback === 'function' ? callback : noop
+ };
+
+ q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);
+
+ if (q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ async.setImmediate(q.process);
+ });
+ }
+
+ // Start with a normal queue
+ var q = async.queue(worker, concurrency);
+
+ // Override push to accept second parameter representing priority
+ q.push = function (data, priority, callback) {
+ _insert(q, data, priority, callback);
+ };
+
+ // Remove unshift function
+ delete q.unshift;
+
+ return q;
+ };
+
+ async.cargo = function (worker, payload) {
+ return _queue(worker, 1, payload);
+ };
+
+ function _console_fn(name) {
+ return _restParam(function (fn, args) {
+ fn.apply(null, args.concat([_restParam(function (err, args) {
+ if (typeof console === 'object') {
+ if (err) {
+ if (console.error) {
+ console.error(err);
+ }
+ }
+ else if (console[name]) {
+ _arrayEach(args, function (x) {
+ console[name](x);
+ });
+ }
+ }
+ })]));
+ });
+ }
+ async.log = _console_fn('log');
+ async.dir = _console_fn('dir');
+ /*async.info = _console_fn('info');
+ async.warn = _console_fn('warn');
+ async.error = _console_fn('error');*/
+
+ async.memoize = function (fn, hasher) {
+ var memo = {};
+ var queues = {};
+ var has = Object.prototype.hasOwnProperty;
+ hasher = hasher || identity;
+ var memoized = _restParam(function memoized(args) {
+ var callback = args.pop();
+ var key = hasher.apply(null, args);
+ if (has.call(memo, key)) {
+ async.setImmediate(function () {
+ callback.apply(null, memo[key]);
+ });
+ }
+ else if (has.call(queues, key)) {
+ queues[key].push(callback);
+ }
+ else {
+ queues[key] = [callback];
+ fn.apply(null, args.concat([_restParam(function (args) {
+ memo[key] = args;
+ var q = queues[key];
+ delete queues[key];
+ for (var i = 0, l = q.length; i < l; i++) {
+ q[i].apply(null, args);
+ }
+ })]));
+ }
+ });
+ memoized.memo = memo;
+ memoized.unmemoized = fn;
+ return memoized;
+ };
+
+ async.unmemoize = function (fn) {
+ return function () {
+ return (fn.unmemoized || fn).apply(null, arguments);
+ };
+ };
+
+ function _times(mapper) {
+ return function (count, iterator, callback) {
+ mapper(_range(count), iterator, callback);
+ };
+ }
+
+ async.times = _times(async.map);
+ async.timesSeries = _times(async.mapSeries);
+ async.timesLimit = function (count, limit, iterator, callback) {
+ return async.mapLimit(_range(count), limit, iterator, callback);
+ };
+
+ async.seq = function (/* functions... */) {
+ var fns = arguments;
+ return _restParam(function (args) {
+ var that = this;
+
+ var callback = args[args.length - 1];
+ if (typeof callback == 'function') {
+ args.pop();
+ } else {
+ callback = noop;
+ }
+
+ async.reduce(fns, args, function (newargs, fn, cb) {
+ fn.apply(that, newargs.concat([_restParam(function (err, nextargs) {
+ cb(err, nextargs);
+ })]));
+ },
+ function (err, results) {
+ callback.apply(that, [err].concat(results));
+ });
+ });
+ };
+
+ async.compose = function (/* functions... */) {
+ return async.seq.apply(null, Array.prototype.reverse.call(arguments));
+ };
+
+
+ function _applyEach(eachfn) {
+ return _restParam(function(fns, args) {
+ var go = _restParam(function(args) {
+ var that = this;
+ var callback = args.pop();
+ return eachfn(fns, function (fn, _, cb) {
+ fn.apply(that, args.concat([cb]));
+ },
+ callback);
+ });
+ if (args.length) {
+ return go.apply(this, args);
+ }
+ else {
+ return go;
+ }
+ });
+ }
+
+ async.applyEach = _applyEach(async.eachOf);
+ async.applyEachSeries = _applyEach(async.eachOfSeries);
+
+
+ async.forever = function (fn, callback) {
+ var done = only_once(callback || noop);
+ var task = ensureAsync(fn);
+ function next(err) {
+ if (err) {
+ return done(err);
+ }
+ task(next);
+ }
+ next();
+ };
+
+ function ensureAsync(fn) {
+ return _restParam(function (args) {
+ var callback = args.pop();
+ args.push(function () {
+ var innerArgs = arguments;
+ if (sync) {
+ async.setImmediate(function () {
+ callback.apply(null, innerArgs);
+ });
+ } else {
+ callback.apply(null, innerArgs);
+ }
+ });
+ var sync = true;
+ fn.apply(this, args);
+ sync = false;
+ });
+ }
+
+ async.ensureAsync = ensureAsync;
+
+ async.constant = _restParam(function(values) {
+ var args = [null].concat(values);
+ return function (callback) {
+ return callback.apply(this, args);
+ };
+ });
+
+ async.wrapSync =
+ async.asyncify = function asyncify(func) {
+ return _restParam(function (args) {
+ var callback = args.pop();
+ var result;
+ try {
+ result = func.apply(this, args);
+ } catch (e) {
+ return callback(e);
+ }
+ // if result is Promise object
+ if (_isObject(result) && typeof result.then === "function") {
+ result.then(function(value) {
+ callback(null, value);
+ })["catch"](function(err) {
+ callback(err.message ? err : new Error(err));
+ });
+ } else {
+ callback(null, result);
+ }
+ });
+ };
+
+ // Node.js
+ if (typeof module === 'object' && module.exports) {
+ module.exports = async;
+ }
+ // AMD / RequireJS
+ else if (typeof define === 'function' && define.amd) {
+ define([], function () {
+ return async;
+ });
+ }
+ // included directly via
+
+
diff --git a/bower_components/iron-demo-helpers/demo/index.html b/bower_components/iron-demo-helpers/demo/index.html
new file mode 100644
index 0000000..0908bec
--- /dev/null
+++ b/bower_components/iron-demo-helpers/demo/index.html
@@ -0,0 +1,70 @@
+
+
+
+
+ demo-snippet demo
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bower_components/iron-flex-layout/.bower.json b/bower_components/iron-flex-layout/.bower.json
new file mode 100644
index 0000000..2dfad57
--- /dev/null
+++ b/bower_components/iron-flex-layout/.bower.json
@@ -0,0 +1,64 @@
+{
+ "name": "iron-flex-layout",
+ "version": "2.0.0",
+ "description": "Provide flexbox-based layouts",
+ "keywords": [
+ "web-components",
+ "polymer",
+ "layout"
+ ],
+ "main": "iron-flex-layout.html",
+ "private": true,
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-flex-layout.git"
+ },
+ "dependencies": {
+ "polymer": "Polymer/polymer#1.9 - 2"
+ },
+ "devDependencies": {
+ "test-fixture": "PolymerElements/test-fixture#^3.0.0-rc.1",
+ "web-component-tester": "^6.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0",
+ "iron-component-page": "PolymerElements/iron-component-page#1 - 2",
+ "iron-demo-helpers": "PolymerElements/iron-demo-helpers#1 - 2"
+ },
+ "ignore": [],
+ "variants": {
+ "1.x": {
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.9"
+ },
+ "devDependencies": {
+ "test-fixture": "PolymerElements/test-fixture#^1.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "web-component-tester": "Polymer/web-component-tester#^4.0.0",
+ "iron-component-page": "PolymerElements/iron-component-page#^1.0.0",
+ "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0"
+ },
+ "resolutions": {
+ "webcomponentsjs": "^0.7"
+ }
+ }
+ },
+ "pages": {
+ "Flexbox layout guide": "GUIDE.md"
+ },
+ "resolutions": {
+ "webcomponentsjs": "^1.0.0"
+ },
+ "homepage": "https://github.com/polymerelements/iron-flex-layout",
+ "_release": "2.0.0",
+ "_resolution": {
+ "type": "version",
+ "tag": "v2.0.0",
+ "commit": "985972fddaae4969f885d8f4451f72d735093946"
+ },
+ "_source": "https://github.com/polymerelements/iron-flex-layout.git",
+ "_target": "1 - 2",
+ "_originalSource": "polymerelements/iron-flex-layout"
+}
\ No newline at end of file
diff --git a/bower_components/iron-flex-layout/.github/ISSUE_TEMPLATE.md b/bower_components/iron-flex-layout/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 0000000..b79eca4
--- /dev/null
+++ b/bower_components/iron-flex-layout/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,33 @@
+
+### Description
+
+
+### Expected outcome
+
+
+
+### Actual outcome
+
+
+
+### Live Demo
+
+
+### Steps to reproduce
+
+
+
+### Browsers Affected
+
+- [ ] Chrome
+- [ ] Firefox
+- [ ] Safari 9
+- [ ] Safari 8
+- [ ] Safari 7
+- [ ] Edge
+- [ ] IE 11
+- [ ] IE 10
diff --git a/bower_components/iron-flex-layout/.gitignore b/bower_components/iron-flex-layout/.gitignore
new file mode 100644
index 0000000..2be39e4
--- /dev/null
+++ b/bower_components/iron-flex-layout/.gitignore
@@ -0,0 +1,2 @@
+bower_components*
+bower-*.json
diff --git a/bower_components/iron-flex-layout/.travis.yml b/bower_components/iron-flex-layout/.travis.yml
new file mode 100644
index 0000000..25cc503
--- /dev/null
+++ b/bower_components/iron-flex-layout/.travis.yml
@@ -0,0 +1,26 @@
+language: node_js
+sudo: required
+before_script:
+ - npm install -g polymer-cli
+ - polymer install --variants
+env:
+ global:
+ - secure: >-
+ idlCNYtNQ7rLGCSl2NuZ++XZEwofpojkakXhL8m34pCX1ZwhGRprHsvNE7h7tz8SIV+mUjuUT8DaM7rlgZ+bLyw/Hq7G15DdmU5puUsCVibFFBBEhh82lxkdK/Rlfo+ytt0MFsbTJljEoqTSbnL0fSeC0cN/7wf6yEQs/+mTR0I=
+ - secure: >-
+ i/rAHa9rxszmbE+RbQ2b7ln6OYzrcoUssdPk36lNeJk/B1HjBS9cfg1PMwSAw+t6yvAN3I0fbOOl4dlGB1K5T4kAtmcAcC3fbptJL08IvK9K15pz/rMEzIBWLXj9oVJliwBZR2GFH+5zv6aFdEwQxh1leBnHQwmKgl24QX8XGO4=
+node_js: stable
+addons:
+ firefox: latest
+ apt:
+ sources:
+ - google-chrome
+ packages:
+ - google-chrome-stable
+ sauce_connect: true
+script:
+ - xvfb-run polymer test
+ - >-
+ if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then polymer test -s 'default';
+ fi
+dist: trusty
diff --git a/bower_components/iron-flex-layout/CONTRIBUTING.md b/bower_components/iron-flex-layout/CONTRIBUTING.md
new file mode 100644
index 0000000..093090d
--- /dev/null
+++ b/bower_components/iron-flex-layout/CONTRIBUTING.md
@@ -0,0 +1,77 @@
+
+
+# Polymer Elements
+## Guide for Contributors
+
+Polymer Elements are built in the open, and the Polymer authors eagerly encourage any and all forms of community contribution. When contributing, please follow these guidelines:
+
+### Filing Issues
+
+**If you are filing an issue to request a feature**, please provide a clear description of the feature. It can be helpful to describe answers to the following questions:
+
+ 1. **Who will use the feature?** _“As someone filling out a form…”_
+ 2. **When will they use the feature?** _“When I enter an invalid value…”_
+ 3. **What is the user’s goal?** _“I want to be visually notified that the value needs to be corrected…”_
+
+**If you are filing an issue to report a bug**, please provide:
+
+ 1. **A clear description of the bug and related expectations.** Consider using the following example template for reporting a bug:
+
+ ```markdown
+ The `paper-foo` element causes the page to turn pink when clicked.
+
+ ## Expected outcome
+
+ The page stays the same color.
+
+ ## Actual outcome
+
+ The page turns pink.
+
+ ## Steps to reproduce
+
+ 1. Put a `paper-foo` element in the page.
+ 2. Open the page in a web browser.
+ 3. Click the `paper-foo` element.
+ ```
+
+ 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [https://jsbin.com/cagaye/edit?html,output](https://jsbin.com/cagaye/edit?html,output).
+
+ 3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers.
+
+### Submitting Pull Requests
+
+**Before creating a pull request**, please ensure that an issue exists for the corresponding change in the pull request that you intend to make. **If an issue does not exist, please create one per the guidelines above**. The goal is to discuss the design and necessity of the proposed change with Polymer authors and community before diving into a pull request.
+
+When submitting pull requests, please provide:
+
+ 1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues in the pull request description using the following syntax:
+
+ ```markdown
+ (For a single issue)
+ Fixes #20
+
+ (For multiple issues)
+ Fixes #32, fixes #40
+ ```
+
+ 2. **A succinct description of the design** used to fix any related issues. For example:
+
+ ```markdown
+ This fixes #20 by removing styles that leaked which would cause the page to turn pink whenever `paper-foo` is clicked.
+ ```
+
+ 3. **At least one test for each bug fixed or feature added** as part of the pull request. Pull requests that fix bugs or add features without accompanying tests will not be considered.
+
+If a proposed change contains multiple commits, please [squash commits](https://www.google.com/url?q=http://blog.steveklabnik.com/posts/2012-11-08-how-to-squash-commits-in-a-github-pull-request) to as few as is necessary to succinctly express the change. A Polymer author can help you squash commits, so don’t be afraid to ask us if you need help with that!
diff --git a/bower_components/iron-flex-layout/GUIDE.md b/bower_components/iron-flex-layout/GUIDE.md
new file mode 100644
index 0000000..e230ce0
--- /dev/null
+++ b/bower_components/iron-flex-layout/GUIDE.md
@@ -0,0 +1,1265 @@
+## Overview
+
+The `iron-flex-layout` component provides simple ways to use [CSS flexible box layout](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes), also known as _flexbox_. This component provides two different ways to use flexbox:
+
+* Layout classes. The layout class stylesheet provides a simple set of class-based flexbox rules. Layout classes
+ let you specify layout properties directly in markup.
+
+* Custom CSS mixins. The mixin stylesheet includes custom CSS mixins that can be applied
+ inside a CSS rule using the `@apply` function.
+
+Using the classes or CSS mixins is largely a matter of preference. The following sections discuss
+how to use the each of the stylesheets.
+
+> Note: Before using either of these stylesheets, it's helpful to be familiar with the basics
+of flexbox layout. Chris Coyier's [A Complete Guide to Flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/) is a
+good primer.
+
+### Using layout classes
+
+To use layout classes import the `iron-flex-layout-classes` file. You
+must do this in any element that uses any of the `iron-flex-layout` styles.
+```html
+
+```
+
+Then include the module(s) that you need:
+```html
+
+
+
+
+
+
+
+
One
+
Two
+
Three
+
+
+
+```
+**Example: using classes in a Polymer element**
+```html
+
+
+ ...
+
+
+
+
+
+
+
+
+
One
+
Two
+
Three
+
+
+
+
+
+
+```
+
+It's important to note that unlike the previous layout class stylesheets
+(found in `/classes/iron-flex-layout.html`), the new version does not use the `/deep/`
+combinator: it does not work across local DOM boundaries,
+and the modules must be imported into each scope where they're used.
+
+### Using layout mixins
+
+Custom mixins can be applied inside a Polymer
+custom element's stylesheet, **or** inside a `custom-style` stylesheet to apply styles to the
+main document. (They cannot be applied in the main document without a `custom-style` stylesheet.)
+
+**Example: using mixins in the main document**
+```html
+
+
+ ...
+
+
+
+ ...
+
+
+
+
+
+
+
+
+
One
+
Two
+
Three
+
+
+
+```
+**Example: using mixins in a Polymer element**
+```html
+
+
+ ...
+
+
+
+
+
+
+
+
+
One
+
Two
+
Three
+
+
+
+
+
+
+```
+
+In general the mixins require a little more code to use, but they can be preferable if you
+don't want to use the classes, or if you want to switch layouts based on a media query.
+
+Custom CSS properties and mixins are features provided by the Polymer library.
+See [Cross-scope styling](https://www.polymer-project.org/1.0/docs/devguide/styling.html#xscope-styling)
+in the Polymer developer guide.
+
+## Horizontal and vertical layout
+
+Create a flex container that lays out its children vertically or horizontally.
+
+Class | Mixin | Result
+:-|:-|:-
+layout horizontal| --layout-horizontal | Horizontal layout container.
+layout vertical | --layout-vertical | Vertical layout container.
+
+The classes listed here are included in the `iron-flex` module of the `iron-flex-layout-classes` file.
+
+**Example: classes**
+```html
+
+
One
+
Two
+
Three
+
+```
+
+**Example: mixins**
+
+```html
+
+
+
+
One
+
Two
+
Three
+
+```
+
+### Flexible children
+
+Children of a flex container can use flex to control their own sizing.
+
+Class | Mixin | Result
+:-|:-|:-
+flex| --layout-flex | Expand the child to fill available space in the main axis.
+flex-ratio| --layout-flex-ratio | Assign a flex ratio of 1 to 12.
+flex-none| --layout-flex-none | Don't flex the child.
+flex-auto| --layout-flex-auto | Sets flex `flex-basis` to `auto` and `flex-grow` and `flex-shrink` to 1.
+
+The classes listed here are included in the `iron-flex` module of the `iron-flex-layout-classes` file.
+
+**Example: classes**
+```html
+
+
Alpha
+
Beta (flex)
+
Gamma
+
+```
+
+**Example: mixins**
+
+```html
+
+
+
+
Alpha
+
Beta (flex)
+
Gamma
+
+```
+
+#### Flexible children in vertical layouts
+
+The same rules can be used for children in vertical layouts.
+
+**Example: classes**
+```html
+
+
Alpha
+
Beta (flex)
+
Gamma
+
+```
+
+**Example: mixins**
+
+```html
+
+
+
+
One
+
Two
+
Three
+
+```
+
+> **Note**: for vertical layouts, the container needs to have a height for the
+children to flex correctly.
+
+#### Flex ratios
+
+Children elements can be told to take up more space by including a "flex ratio"
+from 1 to 12. This is equivalent to specifying the CSS `flex-grow` property.
+
+For example, the following examples make "Gamma" 2x larger than "Beta" and "Alpha" 3x larger, use
+`flex-2` and `flex-3`, respectively.
+
+The classes listed here are included in the `iron-flex-factors` module of the `iron-flex-layout-classes` file.
+
+**Example: classes**
+```html
+
+
Alpha
+
Beta
+
Gamma
+
+```
+
+**Example: mixins**
+
+```html
+
+
+
+
One
+
Two
+
Three
+
+```
+
+### Cross-axis alignment
+
+By default, children stretch to fit the cross-axis (e.g. _vertical_ stretching in a _horizontal_ layout).
+
+
+```html
+
+
Stretch Fill
+
+```
+
+Center _across_ the main axis (e.g. _vertical_ centering elements in a _horizontal_ layout)
+by adding the `center` class or applying the `--layout-center` mixin.
+
+**Example: classes, cross-axis center**
+
+```html
+
+```
+
+You can also position at the top/bottom (or left/right in `vertical` layouts) using the `start` or `end`
+classes, or by applying the `--layout-start` or `--layout-end` mixins.
+
+
+**Example: classes, cross-axis start**
+
+```html
+
+```
+
+### Justification
+
+Justifying aligns contents along the **main axis**. Justify the layout
+by specifying one of the following.
+
+
+Class | Mixin | Result
+:-|:-|:-
+`start-justified`| --layout-start-justified | Aligns contents at the start of the main axis.
+`center-justified` | --layout-center-justified | Centers contents along the main axis.
+`end-justified` | --layout-end-justified | Aligns contents to the end of the main axis.
+`justified` | --layout-justified | Aligns contents with equal spaces between children.
+`around-justified` | --layout-around-justified | Aligns contents with equal spaces arround children.
+
+The classes listed here are included in the `iron-flex-alignment` module of the `iron-flex-layout-classes` file.
+
+**Example: classes, start justified**
+
+```html
+
+```
+
+**Example: classes, end justified**
+
+```html
+
+
end-justified
+
+```
+
+**Example: mixins, equal space between elements**
+
+```html
+
+
+
+
justified
+
justified
+
justified
+
+```
+
+**Example: classes, equal space around each element**
+
+```html
+
+
around-justified
+
around-justified
+
+```
+
+## Self alignment
+
+Alignment can also be set per-child (instead of using the layout container's rules).
+
+Class | Mixin | Result
+:-|:-|:-
+`self-start`| --layout-self-start | Aligns the child at the start of the cross-axis.
+`self-center` | --layout-self-center | Centers the child along the cross-axis.
+`self-end` | --layout-self-end | Aligns the child at the end of the cross-axis.
+`self-stretch` | --layout-self-stretch | Stretches the child to fit the cross-axis.
+
+**Example: classes**
+
+```html
+
+
Alpha
+
Beta
+
Gamma
+
Delta
+
+```
+
+**Example: mixins**
+
+```html
+
+
+
Alpha
+
Beta
+
Gamma
+
Delta
+
+```
+
+> Note: The flex class
+(and --layout-flex mixin) shown in these examples is
+added for the demo and not required for self-alignment.
+
+
+## Wrapping
+
+Wrapped layouts can be enabled with the `wrap` class or `--layout-wrap` mixin.
+
+**Example: classes**
+
+```html
+
+
Alpha
+
Beta
+
Gamma
+
Delta
+
+```
+
+## Reversed layouts
+
+Layout direction can be mirrored using the following rules:
+
+Class | Mixin | Result
+:-|:-|:-
+layout horizontal-reverse| --layout-horizontal-reverse | Horizontal layout with children laid out in reverse order (last-to-first).
+layout vertical-reverse | --layout-vertical-reverse | Vertical layout with children laid out in reverse order.
+layout wrap-reverse | --layout-wrap-reverse | Wrap layout with wrapped rows placed in the reverse order (for example, in a vertical layout, the second row is placed above the first row, instead of below).
+
+The classes listed here are included in the `iron-flex-reverse` module of the `iron-flex-layout-classes` file.
+
+**Example: mixins**
+
+```html
+
+
+
+
Alpha
+
Beta
+
Gamma
+
Delta
+
+```
+
+## Full bleed <body>
+
+It's common to want the entire `` to fit to the viewport. By themselves, Polymer's layout features on
+`` don't achieve the result. You can make `` take up the entire viewport by adding the `fullbleed` class:
+
+```html
+
+
Fitting a fullbleed body.
+
+```
+
+This removes its margins and maximizes its height to the viewport. There is no equivalent mixin, but the same result can
+be achieved in CSS very simply:
+```css
+body {
+ margin: 0;
+ height: 100vh;
+}
+```
+
+This class is included in the `iron-positioning` module of the `iron-flex-layout-classes` file.
+
+Note that the `fullbleed` class **only works on the `` tag.** This is the only rule in the
+stylesheet that is scoped to a particular tag.
+
+
+## General purpose rules
+
+Polymer also includes other general purpose rules for basic positioning:
+
+Class | Mixin | Result
+:-|:-|:-
+`block`| `--layout-block` | Assigns `display: block`
+`invisible` | `--layout-invisible` | Assigns `visibility: hidden`
+`relative` | `--layout-relative` | Assigns `position: relative`
+`fit` | `--layout-fit` | Sets `position: absolute` and sets `top:0;right:0;bottom:0;left:0;` (aka "trbl fitting").
+
+The classes listed here are included in the `iron-positioning` module of the `iron-flex-layout-classes` file.
+
+> Note:When using `fit` layout, the element must have an ancestor with fixed size and `position: relative` layout
+to fit inside of.
+
+
+**Example: classes**
+
+```html
+
Before [A Span] After
+
Before [A Block Span] After
+
Before invisible span Not displayed After invisible span
+
+
Fit
+
+```
diff --git a/bower_components/iron-flex-layout/README.md b/bower_components/iron-flex-layout/README.md
new file mode 100644
index 0000000..ca54ed3
--- /dev/null
+++ b/bower_components/iron-flex-layout/README.md
@@ -0,0 +1,61 @@
+[![Build status](https://travis-ci.org/PolymerElements/iron-flex-layout.svg?branch=master)](https://travis-ci.org/PolymerElements/iron-flex-layout)
+[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://beta.webcomponents.org/element/PolymerElements/iron-flex-layout)
+
+## <iron-flex-layout>
+
+The `` component provides simple ways to use
+[CSS flexible box layout](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes),
+also known as flexbox. This component provides two different ways to use flexbox:
+
+1. [Layout classes](https://github.com/PolymerElements/iron-flex-layout/tree/master/iron-flex-layout-classes.html).
+The layout class stylesheet provides a simple set of class-based flexbox rules, that
+let you specify layout properties directly in markup. You must include this file
+in every element that needs to use them.
+
+Sample use:
+
+
+```html
+
+
+
+
+
+
diff --git a/bower_components/iron-location/.bower.json b/bower_components/iron-location/.bower.json
new file mode 100644
index 0000000..5e9e454
--- /dev/null
+++ b/bower_components/iron-location/.bower.json
@@ -0,0 +1,71 @@
+{
+ "name": "iron-location",
+ "version": "2.0.2",
+ "description": "Bidirectional data binding into the page's URL.",
+ "private": true,
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "routing"
+ ],
+ "main": [
+ "iron-location.html",
+ "iron-query-params.html"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-location.git"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/iron-location",
+ "ignore": [],
+ "dependencies": {
+ "polymer": "Polymer/polymer#1.9 - 2"
+ },
+ "devDependencies": {
+ "iron-flex-layout": "PolymerElements/iron-flex-layout#1 - 2",
+ "iron-demo-helpers": "PolymerElements/iron-demo-helpers#1 - 2",
+ "iron-component-page": "PolymerElements/iron-component-page#1 - 2",
+ "promise-polyfill": "polymerlabs/promise-polyfill#1 - 2",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^3.0.0-rc.1",
+ "web-component-tester": "^6.0.0"
+ },
+ "variants": {
+ "1.x": {
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.9"
+ },
+ "devDependencies": {
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
+ "paper-input": "polymerelements/paper-input#^1.0.0",
+ "paper-slider": "polymerelements/paper-slider#^1.0.0",
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "promise-polyfill": "polymerlabs/promise-polyfill#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "^4.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.2.3"
+ },
+ "resolutions": {
+ "webcomponentsjs": "^0.7"
+ }
+ }
+ },
+ "resolutions": {
+ "webcomponentsjs": "^1.0.0"
+ },
+ "_release": "2.0.2",
+ "_resolution": {
+ "type": "version",
+ "tag": "v2.0.2",
+ "commit": "10493907e6ba30b2bd9d21c0f91209d08416b4e8"
+ },
+ "_source": "https://github.com/PolymerElements/iron-location.git",
+ "_target": "1 - 2",
+ "_originalSource": "PolymerElements/iron-location"
+}
\ No newline at end of file
diff --git a/bower_components/iron-location/.github/ISSUE_TEMPLATE.md b/bower_components/iron-location/.github/ISSUE_TEMPLATE.md
new file mode 100644
index 0000000..e3b4e28
--- /dev/null
+++ b/bower_components/iron-location/.github/ISSUE_TEMPLATE.md
@@ -0,0 +1,33 @@
+
+### Description
+
+
+### Expected outcome
+
+
+
+### Actual outcome
+
+
+
+### Live Demo
+
+
+### Steps to reproduce
+
+
+
+### Browsers Affected
+
+- [ ] Chrome
+- [ ] Firefox
+- [ ] Safari 9
+- [ ] Safari 8
+- [ ] Safari 7
+- [ ] Edge
+- [ ] IE 11
+- [ ] IE 10
diff --git a/bower_components/iron-location/.gitignore b/bower_components/iron-location/.gitignore
new file mode 100644
index 0000000..1b3dfde
--- /dev/null
+++ b/bower_components/iron-location/.gitignore
@@ -0,0 +1,2 @@
+bower_components*
+bower-*.json
\ No newline at end of file
diff --git a/bower_components/iron-location/.travis.yml b/bower_components/iron-location/.travis.yml
new file mode 100644
index 0000000..882c845
--- /dev/null
+++ b/bower_components/iron-location/.travis.yml
@@ -0,0 +1,26 @@
+language: node_js
+sudo: required
+node_js: stable
+addons:
+ firefox: latest
+ apt:
+ sources:
+ - google-chrome
+ packages:
+ - google-chrome-stable
+ sauce_connect: true
+before_script:
+ - npm install -g polymer-cli
+ - polymer install --variants
+script:
+ - xvfb-run polymer test
+ - >-
+ if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then polymer test -s 'default';
+ fi
+env:
+ global:
+ - secure: >-
+ LSHof0ip5tJswHk4wAIXXsf8Z0WL44Y1pB1XmqFtIsjQLl+2K5bdhRq6Hd6RUZYcpTL29cMStCLQJEG1hxnMks37omHuVFWRtk0NaYlGnJY4i/m/ukUBmM7Yr7LROWRnBgU75PVUvc4YMbCjvlQ9KKjdgBbQBFH2KjhKr9GUN+ihB1yaKRMADvFtC6JWisG4RPv1pRxF6UgvGkOsaCdVb9H9AbKA0psAI1cpg8IMGgUBslbwhYw+viMEQdZ5lW++T3Tb9cwzCVaTqBgvkQCXW4I6T4En9yvUWbV0Ry8uChchvs6BJfwpgN/nksYnLCbCLmN+Rw5eU0+XyWZDLiki/HpsNQblqVEW7vHo1hmtpK24GUv2g8kuE1OjjW7K/l+Q20D8FJFIcPdFjmZ/XgLWxdtXbgNC8n4Z1XBEqKuV1BJ29ojvZk5a5/gFBf9PWdMNTVwSepk7+LoEVQW17vzSHT/HDF7WYEs14uZ0x9I0AV2+339RG7iCcVFMZKYgIif0DmZVysnm0Z9j+wRRk227JpiF9MHeVkFUaXl3+3XIQMz04t+H1wOXiDRlJLJG9IUrzFs+KYuCA+OxNc0XrxjA6Zkl75AQAjAY5vMEWYD+N2OGjkfwD7dB4JtltmZ4llMhEZUt/RPLeZJvL4Sus8hfA6SNG9/tdVgef0mQ91acxZg=
+ - secure: >-
+ h0j4eT4lJqbDkEVz4OjkPuAHxxT0Cy7bWbT71oDllhDAvl9zXxIn5BHSnCaUfO0xUhXVpwNuVmDzOE6yQETJ3MamoqL2Hrbg0VCr4hux9/2ipa4tlCTjQ2Y/YaIoID7CpCchdoOQAjrxeg0ZhpMnwxV18NHTqlxNrsdoSDDSmCdffWQwgjVI07O4h1ISIWx6oY0i1Z+9nJI001iZIw5vGopK8zACa5hfSu9my8Nog5gYOBOEoYmT8lNBaKkNuZacGAkHmXPmeeWiflM49sRO5MfyCgVvNtn6yohXs5D1QD2KUZs4mTzVBebT3vPuV7I9NFd+ZY9GT9YeH9BLuxKpYhGlnjL2HhGAvGjIcKX8315EOCpVvgwX3VE1f9PJe3K9q6LP/sFUqf8cUrbj9FhiAVp79IPJkvLUc+1hUG3iQ8X83mjQxcrCt6I50BINOLgjsfzCmnvv12g3FuRry2EBRxEultvPLRCNc2bJCPqol6kiWzs8ySOPXCYOcXqW5/6Z4DYLMTYevapkJZhErcTBuIH7rXEX4tGsdBjtGjTepcW7k2dsCElrul79czZA3AwdLEK/fuygxXR8eMCeS8Tdh4+Ba4M9TfXtAjjnR30NayTOCwyWW9IvTJeWeXKd6SilJcGVO7r546ayGWJ2G+Fltyi7RGixMplRMm8y6YfeM9k=
+dist: trusty
diff --git a/bower_components/iron-location/CONTRIBUTING.md b/bower_components/iron-location/CONTRIBUTING.md
new file mode 100644
index 0000000..cfda1a5
--- /dev/null
+++ b/bower_components/iron-location/CONTRIBUTING.md
@@ -0,0 +1,77 @@
+
+
+# Polymer Elements
+## Guide for Contributors
+
+Polymer Elements are built in the open, and the Polymer authors eagerly encourage any and all forms of community contribution. When contributing, please follow these guidelines:
+
+### Filing Issues
+
+**If you are filing an issue to request a feature**, please provide a clear description of the feature. It can be helpful to describe answers to the following questions:
+
+ 1. **Who will use the feature?** _“As someone filling out a form…”_
+ 2. **When will they use the feature?** _“When I enter an invalid value…”_
+ 3. **What is the user’s goal?** _“I want to be visually notified that the value needs to be corrected…”_
+
+**If you are filing an issue to report a bug**, please provide:
+
+ 1. **A clear description of the bug and related expectations.** Consider using the following example template for reporting a bug:
+
+ ```markdown
+ The `paper-foo` element causes the page to turn pink when clicked.
+
+ ## Expected outcome
+
+ The page stays the same color.
+
+ ## Actual outcome
+
+ The page turns pink.
+
+ ## Steps to reproduce
+
+ 1. Put a `paper-foo` element in the page.
+ 2. Open the page in a web browser.
+ 3. Click the `paper-foo` element.
+ ```
+
+ 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [https://jsbin.com/lebawa/edit?html,output](https://jsbin.com/lebawa/edit?html,output).
+
+ 3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers.
+
+### Submitting Pull Requests
+
+**Before creating a pull request**, please ensure that an issue exists for the corresponding change in the pull request that you intend to make. **If an issue does not exist, please create one per the guidelines above**. The goal is to discuss the design and necessity of the proposed change with Polymer authors and community before diving into a pull request.
+
+When submitting pull requests, please provide:
+
+ 1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues in the pull request description using the following syntax:
+
+ ```markdown
+ (For a single issue)
+ Fixes #20
+
+ (For multiple issues)
+ Fixes #32, fixes #40
+ ```
+
+ 2. **A succinct description of the design** used to fix any related issues. For example:
+
+ ```markdown
+ This fixes #20 by removing styles that leaked which would cause the page to turn pink whenever `paper-foo` is clicked.
+ ```
+
+ 3. **At least one test for each bug fixed or feature added** as part of the pull request. Pull requests that fix bugs or add features without accompanying tests will not be considered.
+
+If a proposed change contains multiple commits, please [squash commits](https://www.google.com/url?q=http://blog.steveklabnik.com/posts/2012-11-08-how-to-squash-commits-in-a-github-pull-request) to as few as is necessary to succinctly express the change. A Polymer author can help you squash commits, so don’t be afraid to ask us if you need help with that!
diff --git a/bower_components/iron-location/README.md b/bower_components/iron-location/README.md
new file mode 100644
index 0000000..a28a757
--- /dev/null
+++ b/bower_components/iron-location/README.md
@@ -0,0 +1,60 @@
+
+
+
+[![Build status](https://travis-ci.org/PolymerElements/iron-location.svg?branch=master)](https://travis-ci.org/PolymerElements/iron-location)
+
+_[Demo and API docs](https://elements.polymer-project.org/elements/iron-location)_
+
+## Changes in 2.0
+* URL Polyfill no longer a dependency. Small workaround implemented.
+
+## <iron-location>
+
+The `iron-location` element manages binding to and from the current URL.
+
+iron-location is the first, and lowest level element in the Polymer team's
+routing system. This is a beta release of iron-location as we continue work
+on higher level elements, and as such iron-location may undergo breaking
+changes.
+
+#### Properties
+
+When the URL is: `/search?query=583#details` iron-location's properties will be:
+
+* path: `'/search'`
+* query: `'query=583'`
+* hash: `'details'`
+
+These bindings are bidirectional. Modifying them will in turn modify the URL.
+
+iron-location is only active while it is attached to the document.
+
+#### Links
+
+While iron-location is active in the document it will intercept clicks on links
+within your site, updating the URL pushing the updated URL out through the
+databinding system. iron-location only intercepts clicks with the intent to
+open in the same window, so middle mouse clicks and ctrl/cmd clicks work fine.
+
+You can customize this behavior with the `urlSpaceRegex`.
+
+#### Dwell Time
+
+iron-location protects against accidental history spamming by only adding
+entries to the user's history if the URL stays unchanged for `dwellTime`
+milliseconds.
+
+
+
+
diff --git a/bower_components/iron-location/bower.json b/bower_components/iron-location/bower.json
new file mode 100644
index 0000000..de50bed
--- /dev/null
+++ b/bower_components/iron-location/bower.json
@@ -0,0 +1,62 @@
+{
+ "name": "iron-location",
+ "version": "2.0.2",
+ "description": "Bidirectional data binding into the page's URL.",
+ "private": true,
+ "authors": [
+ "The Polymer Authors"
+ ],
+ "keywords": [
+ "web-components",
+ "polymer",
+ "routing"
+ ],
+ "main": [
+ "iron-location.html",
+ "iron-query-params.html"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/PolymerElements/iron-location.git"
+ },
+ "license": "http://polymer.github.io/LICENSE.txt",
+ "homepage": "https://github.com/PolymerElements/iron-location",
+ "ignore": [],
+ "dependencies": {
+ "polymer": "Polymer/polymer#1.9 - 2"
+ },
+ "devDependencies": {
+ "iron-flex-layout": "PolymerElements/iron-flex-layout#1 - 2",
+ "iron-demo-helpers": "PolymerElements/iron-demo-helpers#1 - 2",
+ "iron-component-page": "PolymerElements/iron-component-page#1 - 2",
+ "promise-polyfill": "polymerlabs/promise-polyfill#1 - 2",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^1.0.0",
+ "test-fixture": "PolymerElements/test-fixture#^3.0.0-rc.1",
+ "web-component-tester": "^6.0.0"
+ },
+ "variants": {
+ "1.x": {
+ "dependencies": {
+ "polymer": "Polymer/polymer#^1.9"
+ },
+ "devDependencies": {
+ "iron-component-page": "polymerelements/iron-component-page#^1.0.0",
+ "iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
+ "paper-input": "polymerelements/paper-input#^1.0.0",
+ "paper-slider": "polymerelements/paper-slider#^1.0.0",
+ "paper-styles": "polymerelements/paper-styles#^1.0.0",
+ "promise-polyfill": "polymerlabs/promise-polyfill#^1.0.0",
+ "test-fixture": "polymerelements/test-fixture#^1.0.0",
+ "web-component-tester": "^4.0.0",
+ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
+ "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.2.3"
+ },
+ "resolutions": {
+ "webcomponentsjs": "^0.7"
+ }
+ }
+ },
+ "resolutions": {
+ "webcomponentsjs": "^1.0.0"
+ }
+}
diff --git a/bower_components/iron-location/demo/index.html b/bower_components/iron-location/demo/index.html
new file mode 100644
index 0000000..ea1b2ed
--- /dev/null
+++ b/bower_components/iron-location/demo/index.html
@@ -0,0 +1,132 @@
+
+
+
+
+
+ iron-location
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
URL
+
+
+
+
+
+
Dwell Time
+
+ iron-location won't add extraneous entries to the browser's history
+ when changes come in quick succession.
+
+
+ A new history entry will only be added if iron-location stays in
+ the same state longer than dwellTime.
+
+
+
+
diff --git a/bower_components/marked-element/hero.svg b/bower_components/marked-element/hero.svg
new file mode 100755
index 0000000..879a19c
--- /dev/null
+++ b/bower_components/marked-element/hero.svg
@@ -0,0 +1,27 @@
+
+
+
+
diff --git a/bower_components/marked-element/index.html b/bower_components/marked-element/index.html
new file mode 100644
index 0000000..487bb5c
--- /dev/null
+++ b/bower_components/marked-element/index.html
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bower_components/marked-element/marked-element.html b/bower_components/marked-element/marked-element.html
new file mode 100644
index 0000000..b9564b7
--- /dev/null
+++ b/bower_components/marked-element/marked-element.html
@@ -0,0 +1,385 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bower_components/marked-element/marked-import.html b/bower_components/marked-element/marked-import.html
new file mode 100644
index 0000000..31b1666
--- /dev/null
+++ b/bower_components/marked-element/marked-import.html
@@ -0,0 +1,10 @@
+
+
diff --git a/bower_components/marked-element/test/index.html b/bower_components/marked-element/test/index.html
new file mode 100644
index 0000000..7f15992
--- /dev/null
+++ b/bower_components/marked-element/test/index.html
@@ -0,0 +1,24 @@
+
+
+
+ Tests
+
+
+
+
+
+
+
diff --git a/bower_components/marked-element/test/marked-element.html b/bower_components/marked-element/test/marked-element.html
new file mode 100644
index 0000000..dcbd2c4
--- /dev/null
+++ b/bower_components/marked-element/test/marked-element.html
@@ -0,0 +1,616 @@
+
+
+
+
+
+ marked-element basic tests
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/bower_components/marked-element/test/remoteSanitization.md b/bower_components/marked-element/test/remoteSanitization.md
new file mode 100644
index 0000000..281c686
--- /dev/null
+++ b/bower_components/marked-element/test/remoteSanitization.md
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/bower_components/marked-element/test/test.md b/bower_components/marked-element/test/test.md
new file mode 100644
index 0000000..66517b1
--- /dev/null
+++ b/bower_components/marked-element/test/test.md
@@ -0,0 +1,3 @@
+# Test
+
+[Link](http://url.com/)
diff --git a/bower_components/marked-element/test/test1.md b/bower_components/marked-element/test/test1.md
new file mode 100644
index 0000000..a5b2345
--- /dev/null
+++ b/bower_components/marked-element/test/test1.md
@@ -0,0 +1,3 @@
+# Test Another
+
+[Link](http://url.com/)
diff --git a/bower_components/marked-element/test/test2.md b/bower_components/marked-element/test/test2.md
new file mode 100644
index 0000000..f7b1c22
--- /dev/null
+++ b/bower_components/marked-element/test/test2.md
@@ -0,0 +1 @@
+# Test 2
diff --git a/bower_components/marked/.bower.json b/bower_components/marked/.bower.json
new file mode 100644
index 0000000..cfe9724
--- /dev/null
+++ b/bower_components/marked/.bower.json
@@ -0,0 +1,33 @@
+{
+ "name": "marked",
+ "version": "0.3.6",
+ "homepage": "https://github.com/chjj/marked",
+ "authors": [
+ "Christopher Jeffrey "
+ ],
+ "description": "A markdown parser built for speed",
+ "keywords": [
+ "markdown",
+ "markup",
+ "html"
+ ],
+ "main": "lib/marked.js",
+ "license": "MIT",
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "app/bower_components",
+ "test",
+ "tests"
+ ],
+ "_release": "0.3.6",
+ "_resolution": {
+ "type": "version",
+ "tag": "v0.3.6",
+ "commit": "eddec20467c2d10c7769061ee9074e268500966f"
+ },
+ "_source": "https://github.com/chjj/marked.git",
+ "_target": "~0.3.6",
+ "_originalSource": "marked"
+}
\ No newline at end of file
diff --git a/bower_components/marked/Gulpfile.js b/bower_components/marked/Gulpfile.js
new file mode 100644
index 0000000..cebc16a
--- /dev/null
+++ b/bower_components/marked/Gulpfile.js
@@ -0,0 +1,22 @@
+var gulp = require('gulp');
+var uglify = require('gulp-uglify');
+var concat = require('gulp-concat');
+
+var preserveFirstComment = function() {
+ var set = false;
+
+ return function() {
+ if (set) return false;
+ set = true;
+ return true;
+ };
+};
+
+gulp.task('uglify', function() {
+ gulp.src('lib/marked.js')
+ .pipe(uglify({preserveComments: preserveFirstComment()}))
+ .pipe(concat('marked.min.js'))
+ .pipe(gulp.dest('.'));
+});
+
+gulp.task('default', ['uglify']);
diff --git a/bower_components/marked/LICENSE b/bower_components/marked/LICENSE
new file mode 100644
index 0000000..a7b812e
--- /dev/null
+++ b/bower_components/marked/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/)
+
+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.
diff --git a/bower_components/marked/Makefile b/bower_components/marked/Makefile
new file mode 100644
index 0000000..d9349f0
--- /dev/null
+++ b/bower_components/marked/Makefile
@@ -0,0 +1,12 @@
+all:
+ @cp lib/marked.js marked.js
+ @uglifyjs --comments '/\*[^\0]+?Copyright[^\0]+?\*/' -o marked.min.js lib/marked.js
+
+clean:
+ @rm marked.js
+ @rm marked.min.js
+
+bench:
+ @node test --bench
+
+.PHONY: clean all
diff --git a/bower_components/marked/README.md b/bower_components/marked/README.md
new file mode 100644
index 0000000..efa71aa
--- /dev/null
+++ b/bower_components/marked/README.md
@@ -0,0 +1,406 @@
+# marked
+
+> A full-featured markdown parser and compiler, written in JavaScript. Built
+> for speed.
+
+[![NPM version](https://badge.fury.io/js/marked.png)][badge]
+
+## Install
+
+``` bash
+npm install marked --save
+```
+
+## Usage
+
+Minimal usage:
+
+```js
+var marked = require('marked');
+console.log(marked('I am using __markdown__.'));
+// Outputs:
I am using markdown.
+```
+
+Example setting options with default values:
+
+```js
+var marked = require('marked');
+marked.setOptions({
+ renderer: new marked.Renderer(),
+ gfm: true,
+ tables: true,
+ breaks: false,
+ pedantic: false,
+ sanitize: true,
+ smartLists: true,
+ smartypants: false
+});
+
+console.log(marked('I am using __markdown__.'));
+```
+
+### Browser
+
+```html
+
+
+
+
+ Marked in the browser
+
+
+
+
+
+
+
+```
+
+## marked(markdownString [,options] [,callback])
+
+### markdownString
+
+Type: `string`
+
+String of markdown source to be compiled.
+
+### options
+
+Type: `object`
+
+Hash of options. Can also be set using the `marked.setOptions` method as seen
+above.
+
+### callback
+
+Type: `function`
+
+Function called when the `markdownString` has been fully parsed when using
+async highlighting. If the `options` argument is omitted, this can be used as
+the second argument.
+
+## Options
+
+### highlight
+
+Type: `function`
+
+A function to highlight code blocks. The first example below uses async highlighting with
+[node-pygmentize-bundled][pygmentize], and the second is a synchronous example using
+[highlight.js][highlight]:
+
+```js
+var marked = require('marked');
+
+var markdownString = '```js\n console.log("hello"); \n```';
+
+// Async highlighting with pygmentize-bundled
+marked.setOptions({
+ highlight: function (code, lang, callback) {
+ require('pygmentize-bundled')({ lang: lang, format: 'html' }, code, function (err, result) {
+ callback(err, result.toString());
+ });
+ }
+});
+
+// Using async version of marked
+marked(markdownString, function (err, content) {
+ if (err) throw err;
+ console.log(content);
+});
+
+// Synchronous highlighting with highlight.js
+marked.setOptions({
+ highlight: function (code) {
+ return require('highlight.js').highlightAuto(code).value;
+ }
+});
+
+console.log(marked(markdownString));
+```
+
+#### highlight arguments
+
+`code`
+
+Type: `string`
+
+The section of code to pass to the highlighter.
+
+`lang`
+
+Type: `string`
+
+The programming language specified in the code block.
+
+`callback`
+
+Type: `function`
+
+The callback function to call when using an async highlighter.
+
+### renderer
+
+Type: `object`
+Default: `new Renderer()`
+
+An object containing functions to render tokens to HTML.
+
+#### Overriding renderer methods
+
+The renderer option allows you to render tokens in a custom manner. Here is an
+example of overriding the default heading token rendering by adding an embedded anchor tag like on GitHub:
+
+```javascript
+var marked = require('marked');
+var renderer = new marked.Renderer();
+
+renderer.heading = function (text, level) {
+ var escapedText = text.toLowerCase().replace(/[^\w]+/g, '-');
+
+ return '' +
+ text + '';
+},
+
+console.log(marked('# heading+', { renderer: renderer }));
+```
+This code will output the following HTML:
+```html
+
+```
+
+#### Block level renderer methods
+
+- code(*string* code, *string* language)
+- blockquote(*string* quote)
+- html(*string* html)
+- heading(*string* text, *number* level)
+- hr()
+- list(*string* body, *boolean* ordered)
+- listitem(*string* text)
+- paragraph(*string* text)
+- table(*string* header, *string* body)
+- tablerow(*string* content)
+- tablecell(*string* content, *object* flags)
+
+`flags` has the following properties:
+
+```js
+{
+ header: true || false,
+ align: 'center' || 'left' || 'right'
+}
+```
+
+#### Inline level renderer methods
+
+- strong(*string* text)
+- em(*string* text)
+- codespan(*string* code)
+- br()
+- del(*string* text)
+- link(*string* href, *string* title, *string* text)
+- image(*string* href, *string* title, *string* text)
+
+### gfm
+
+Type: `boolean`
+Default: `true`
+
+Enable [GitHub flavored markdown][gfm].
+
+### tables
+
+Type: `boolean`
+Default: `true`
+
+Enable GFM [tables][tables].
+This option requires the `gfm` option to be true.
+
+### breaks
+
+Type: `boolean`
+Default: `false`
+
+Enable GFM [line breaks][breaks].
+This option requires the `gfm` option to be true.
+
+### pedantic
+
+Type: `boolean`
+Default: `false`
+
+Conform to obscure parts of `markdown.pl` as much as possible. Don't fix any of
+the original markdown bugs or poor behavior.
+
+### sanitize
+
+Type: `boolean`
+Default: `false`
+
+Sanitize the output. Ignore any HTML that has been input.
+
+### smartLists
+
+Type: `boolean`
+Default: `true`
+
+Use smarter list behavior than the original markdown. May eventually be
+default with the old behavior moved into `pedantic`.
+
+### smartypants
+
+Type: `boolean`
+Default: `false`
+
+Use "smart" typograhic punctuation for things like quotes and dashes.
+
+## Access to lexer and parser
+
+You also have direct access to the lexer and parser if you so desire.
+
+``` js
+var tokens = marked.lexer(text, options);
+console.log(marked.parser(tokens));
+```
+
+``` js
+var lexer = new marked.Lexer(options);
+var tokens = lexer.lex(text);
+console.log(tokens);
+console.log(lexer.rules);
+```
+
+## CLI
+
+``` bash
+$ marked -o hello.html
+hello world
+^D
+$ cat hello.html
+
hello world
+```
+
+## Philosophy behind marked
+
+The point of marked was to create a markdown compiler where it was possible to
+frequently parse huge chunks of markdown without having to worry about
+caching the compiled output somehow...or blocking for an unnecesarily long time.
+
+marked is very concise and still implements all markdown features. It is also
+now fully compatible with the client-side.
+
+marked more or less passes the official markdown test suite in its
+entirety. This is important because a surprising number of markdown compilers
+cannot pass more than a few tests. It was very difficult to get marked as
+compliant as it is. It could have cut corners in several areas for the sake
+of performance, but did not in order to be exactly what you expect in terms
+of a markdown rendering. In fact, this is why marked could be considered at a
+disadvantage in the benchmarks above.
+
+Along with implementing every markdown feature, marked also implements [GFM
+features][gfmf].
+
+## Benchmarks
+
+node v0.8.x
+
+``` bash
+$ node test --bench
+marked completed in 3411ms.
+marked (gfm) completed in 3727ms.
+marked (pedantic) completed in 3201ms.
+robotskirt completed in 808ms.
+showdown (reuse converter) completed in 11954ms.
+showdown (new converter) completed in 17774ms.
+markdown-js completed in 17191ms.
+```
+
+__Marked is now faster than Discount, which is written in C.__
+
+For those feeling skeptical: These benchmarks run the entire markdown test suite 1000 times. The test suite tests every feature. It doesn't cater to specific aspects.
+
+### Pro level
+
+You also have direct access to the lexer and parser if you so desire.
+
+``` js
+var tokens = marked.lexer(text, options);
+console.log(marked.parser(tokens));
+```
+
+``` js
+var lexer = new marked.Lexer(options);
+var tokens = lexer.lex(text);
+console.log(tokens);
+console.log(lexer.rules);
+```
+
+``` bash
+$ node
+> require('marked').lexer('> i am using marked.')
+[ { type: 'blockquote_start' },
+ { type: 'paragraph',
+ text: 'i am using marked.' },
+ { type: 'blockquote_end' },
+ links: {} ]
+```
+
+## Running Tests & Contributing
+
+If you want to submit a pull request, make sure your changes pass the test
+suite. If you're adding a new feature, be sure to add your own test.
+
+The marked test suite is set up slightly strangely: `test/new` is for all tests
+that are not part of the original markdown.pl test suite (this is where your
+test should go if you make one). `test/original` is only for the original
+markdown.pl tests. `test/tests` houses both types of tests after they have been
+combined and moved/generated by running `node test --fix` or `marked --test
+--fix`.
+
+In other words, if you have a test to add, add it to `test/new/` and then
+regenerate the tests with `node test --fix`. Commit the result. If your test
+uses a certain feature, for example, maybe it assumes GFM is *not* enabled, you
+can add `.nogfm` to the filename. So, `my-test.text` becomes
+`my-test.nogfm.text`. You can do this with any marked option. Say you want
+line breaks and smartypants enabled, your filename should be:
+`my-test.breaks.smartypants.text`.
+
+To run the tests:
+
+``` bash
+cd marked/
+node test
+```
+
+### Contribution and License Agreement
+
+If you contribute code to this project, you are implicitly allowing your code
+to be distributed under the MIT license. You are also implicitly verifying that
+all code is your original work. ``
+
+## License
+
+Copyright (c) 2011-2014, Christopher Jeffrey. (MIT License)
+
+See LICENSE for more info.
+
+[gfm]: https://help.github.com/articles/github-flavored-markdown
+[gfmf]: http://github.github.com/github-flavored-markdown/
+[pygmentize]: https://github.com/rvagg/node-pygmentize-bundled
+[highlight]: https://github.com/isagalaev/highlight.js
+[badge]: http://badge.fury.io/js/marked
+[tables]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#wiki-tables
+[breaks]: https://help.github.com/articles/github-flavored-markdown#newlines
diff --git a/bower_components/marked/bin/marked b/bower_components/marked/bin/marked
new file mode 100755
index 0000000..64254fc
--- /dev/null
+++ b/bower_components/marked/bin/marked
@@ -0,0 +1,187 @@
+#!/usr/bin/env node
+
+/**
+ * Marked CLI
+ * Copyright (c) 2011-2013, Christopher Jeffrey (MIT License)
+ */
+
+var fs = require('fs')
+ , util = require('util')
+ , marked = require('../');
+
+/**
+ * Man Page
+ */
+
+function help() {
+ var spawn = require('child_process').spawn;
+
+ var options = {
+ cwd: process.cwd(),
+ env: process.env,
+ setsid: false,
+ customFds: [0, 1, 2]
+ };
+
+ spawn('man',
+ [__dirname + '/../man/marked.1'],
+ options);
+}
+
+/**
+ * Main
+ */
+
+function main(argv, callback) {
+ var files = []
+ , options = {}
+ , input
+ , output
+ , arg
+ , tokens
+ , opt;
+
+ function getarg() {
+ var arg = argv.shift();
+
+ if (arg.indexOf('--') === 0) {
+ // e.g. --opt
+ arg = arg.split('=');
+ if (arg.length > 1) {
+ // e.g. --opt=val
+ argv.unshift(arg.slice(1).join('='));
+ }
+ arg = arg[0];
+ } else if (arg[0] === '-') {
+ if (arg.length > 2) {
+ // e.g. -abc
+ argv = arg.substring(1).split('').map(function(ch) {
+ return '-' + ch;
+ }).concat(argv);
+ arg = argv.shift();
+ } else {
+ // e.g. -a
+ }
+ } else {
+ // e.g. foo
+ }
+
+ return arg;
+ }
+
+ while (argv.length) {
+ arg = getarg();
+ switch (arg) {
+ case '--test':
+ return require('../test').main(process.argv.slice());
+ case '-o':
+ case '--output':
+ output = argv.shift();
+ break;
+ case '-i':
+ case '--input':
+ input = argv.shift();
+ break;
+ case '-t':
+ case '--tokens':
+ tokens = true;
+ break;
+ case '-h':
+ case '--help':
+ return help();
+ default:
+ if (arg.indexOf('--') === 0) {
+ opt = camelize(arg.replace(/^--(no-)?/, ''));
+ if (!marked.defaults.hasOwnProperty(opt)) {
+ continue;
+ }
+ if (arg.indexOf('--no-') === 0) {
+ options[opt] = typeof marked.defaults[opt] !== 'boolean'
+ ? null
+ : false;
+ } else {
+ options[opt] = typeof marked.defaults[opt] !== 'boolean'
+ ? argv.shift()
+ : true;
+ }
+ } else {
+ files.push(arg);
+ }
+ break;
+ }
+ }
+
+ function getData(callback) {
+ if (!input) {
+ if (files.length <= 2) {
+ return getStdin(callback);
+ }
+ input = files.pop();
+ }
+ return fs.readFile(input, 'utf8', callback);
+ }
+
+ return getData(function(err, data) {
+ if (err) return callback(err);
+
+ data = tokens
+ ? JSON.stringify(marked.lexer(data, options), null, 2)
+ : marked(data, options);
+
+ if (!output) {
+ process.stdout.write(data + '\n');
+ return callback();
+ }
+
+ return fs.writeFile(output, data, callback);
+ });
+}
+
+/**
+ * Helpers
+ */
+
+function getStdin(callback) {
+ var stdin = process.stdin
+ , buff = '';
+
+ stdin.setEncoding('utf8');
+
+ stdin.on('data', function(data) {
+ buff += data;
+ });
+
+ stdin.on('error', function(err) {
+ return callback(err);
+ });
+
+ stdin.on('end', function() {
+ return callback(null, buff);
+ });
+
+ try {
+ stdin.resume();
+ } catch (e) {
+ callback(e);
+ }
+}
+
+function camelize(text) {
+ return text.replace(/(\w)-(\w)/g, function(_, a, b) {
+ return a + b.toUpperCase();
+ });
+}
+
+/**
+ * Expose / Entry Point
+ */
+
+if (!module.parent) {
+ process.title = 'marked';
+ main(process.argv.slice(), function(err, code) {
+ if (err) throw err;
+ return process.exit(code || 0);
+ });
+} else {
+ module.exports = main;
+}
diff --git a/bower_components/marked/bower.json b/bower_components/marked/bower.json
new file mode 100644
index 0000000..a2a8187
--- /dev/null
+++ b/bower_components/marked/bower.json
@@ -0,0 +1,24 @@
+{
+ "name": "marked",
+ "version": "0.3.4",
+ "homepage": "https://github.com/chjj/marked",
+ "authors": [
+ "Christopher Jeffrey "
+ ],
+ "description": "A markdown parser built for speed",
+ "keywords": [
+ "markdown",
+ "markup",
+ "html"
+ ],
+ "main": "lib/marked.js",
+ "license": "MIT",
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "app/bower_components",
+ "test",
+ "tests"
+ ]
+}
diff --git a/bower_components/marked/component.json b/bower_components/marked/component.json
new file mode 100644
index 0000000..1d67287
--- /dev/null
+++ b/bower_components/marked/component.json
@@ -0,0 +1,10 @@
+{
+ "name": "marked",
+ "version": "0.3.4",
+ "repo": "chjj/marked",
+ "description": "A markdown parser built for speed",
+ "keywords": ["markdown", "markup", "html"],
+ "scripts": ["lib/marked.js"],
+ "main": "lib/marked.js",
+ "license": "MIT"
+}
diff --git a/bower_components/marked/doc/broken.md b/bower_components/marked/doc/broken.md
new file mode 100644
index 0000000..7bfa49e
--- /dev/null
+++ b/bower_components/marked/doc/broken.md
@@ -0,0 +1,426 @@
+# Markdown is broken
+
+I have a lot of scraps of markdown engine oddities that I've collected over the
+years. What you see below is slightly messy, but it's what I've managed to
+cobble together to illustrate the differences between markdown engines, and
+why, if there ever is a markdown specification, it has to be absolutely
+thorough. There are a lot more of these little differences I have documented
+elsewhere. I know I will find them lingering on my disk one day, but until
+then, I'll continue to add whatever strange nonsensical things I find.
+
+Some of these examples may only mention a particular engine compared to marked.
+However, the examples with markdown.pl could easily be swapped out for
+discount, upskirt, or markdown.js, and you would very easily see even more
+inconsistencies.
+
+A lot of this was written when I was very unsatisfied with the inconsistencies
+between markdown engines. Please excuse the frustration noticeable in my
+writing.
+
+## Examples of markdown's "stupid" list parsing
+
+```
+$ markdown.pl
+
+ * item1
+
+ * item2
+
+ text
+^D
+
+```
+
+Again, which looks correct to you?
+
+- - -
+
+EXAMPLE:
+
+```
+$ markdown.pl
+* hello
+ * world
+ * hi
+ code
+^D
+
+
hello
+
+
world
+
hi
+ code
+
+
+```
+
+The code isn't a code block even though it's after the bullet margin. I know,
+lets give it two more spaces, effectively making it 8 spaces past the bullet.
+
+```
+$ markdown.pl
+* hello
+ * world
+ * hi
+ code
+^D
+
+
hello
+
+
world
+
hi
+ code
+
+
+```
+
+And, it's still not a code block. Did you also notice that the 3rd item isn't
+even its own list? Markdown screws that up too because of its indentation
+unaware parsing.
+
+- - -
+
+Let's look at some more examples of markdown's list parsing:
+
+```
+$ markdown.pl
+
+ * item1
+
+ * item2
+
+ text
+^D
+