diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..1bda236 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,9 @@ +### Fixes #XXXX +## Changes proposed in the pull request + * +## Impact +## Other information + +Check if you have done the following before creating the PR +- [ ] console logs have been deleted +- [ ] No commented code (If commented the reasons are given) diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100644 index 0000000..123bd43 --- /dev/null +++ b/.github/issue_template.md @@ -0,0 +1,10 @@ +## Before you describe your issue, idea or feature, please consider using this issue template. + +## Type of issue: +- [ ] Bug / Error +- [ ] Idea / Feature +- [ ] Improvement detail + +## Short description on the issue + +## Possible fix diff --git a/.gitignore b/.gitignore index e9ea3aa..846dac0 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,154 @@ -stackle_app/package-lock.json +# Created by https://www.gitignore.io/api/java,node,linux,windows,angular + +### Angular ### +## Angular ## +# compiled output +/dist +/tmp +/app/**/*.js +/app/**/*.js.map + +# dependencies +/node_modules +/bower_components + +# IDEs and editors +/.idea + +# misc +/.sass-cache +/connect.lock +/coverage/* +/libpeerconnection.log +npm-debug.log +testem.log +/typings + +# e2e +/e2e/*.js +/e2e/*.map + +#System Files +.DS_Store + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### Node ### +# Logs +logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Typescript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.gitignore.io/api/java,node,linux,windows,angular diff --git a/.travis.yml b/.travis.yml index 3bad9c7..b7fabeb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,2 +1,8 @@ language: node_js -script : stackle_api/server.js \ No newline at end of file + +node_js: + - "node" +install: + - cd stackle_api + - npm install +script : node server.js & diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..e1aeac3 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at info@scorelab.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md new file mode 100644 index 0000000..b1be8c1 --- /dev/null +++ b/CONTRIBUTORS.md @@ -0,0 +1,8 @@ +# Contributors +============== + +Stackle is still new and it's a result of following people who contributed to it in many ways from concept to coding +* Charitha Madusanka [charithccmc](https://github.com/charithccmc) +* Tharindu Ranathunga [tharindupr](https://github.com/tharindupr) +* Milindu Sanoj Kumarage [agentMilindu](https://github.com/agentmilindu) +* Pasan Missaka [psnmissaka](https://github.com/psnmissaka) diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..fe0cfc1 --- /dev/null +++ b/ISSUE_TEMPLATE.md @@ -0,0 +1,41 @@ +# Prerequisites + +Please answer the following questions for yourself before submitting an issue. **YOU MAY DELETE THE PREREQUISITES SECTION.** + +- [ ] I am running the latest version +- [ ] I checked the documentation and found no answer +- [ ] I checked to make sure that this issue has not already been filed +- [ ] I'm reporting the issue to the correct repository (for multi-repository projects) + +# Expected Behavior + +Please describe the behavior you are expecting + +# Current Behavior + +What is the current behavior? + +# Failure Information (for bugs) + +Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template. + +## Steps to Reproduce + +Please provide detailed steps for reproducing the issue. + +1. step 1 +2. step 2 +3. you get it... + +## Context + +Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions. + +* Firmware Version: +* Operating System: +* SDK version: +* Toolchain version: + +## Failure Logs + +Please include any relevant log snippets or files here. diff --git a/LICENSE b/LICENSE index 6ceb7f7..5229534 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {2017} {Sustainable Computing Research Lab} + Copyright {2018} {Sustainable Computing Research Lab} Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index abe5efd..e648630 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,21 @@ +![Stackle](https://gdurl.com/66Sl) + +[![Join the chat at https://gitter.im/scorelab/scorelab](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/scorelab/scorelab?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![GitHub license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://raw.githubusercontent.com/scorelab/stackle/master/LICENSE) [![Travis Build](https://api.travis-ci.org/scorelab/Stackle.svg?branch=master)](https://travis-ci.org/scorelab/Stackle) + + # Introduction -Stackle is an web communication portal aimed at providing Open Source organizations a platform to have discussions on their GitHub projects and their issues. It provides GitHub integration which allows administrator of an organization to create a forum thread for the particular organization. Users signing in is able to view forums of the organizations they contribute to and engage in the forum discussions. +Stackle is a web communication portal aimed at providing Open Source organizations a platform to have discussions on their GitHub projects and their issues. It provides GitHub integration which allows the administrator of an organization to create a forum thread for the particular organization. Users signing in are able to view forums of the organizations they contribute to and engage in the forum discussions. # Implementation Details MEAN stack is used for developing Stackle. - - Front-End is developed using AngularJS + - Front-End is developed using Angular - Back-end is handled by NodeJS using Express - MongoDB is used as the databases for storing data related to stackle # Architecture -Users interact with the application through the AngularJS front-end which communicates with Node-API to get and post data to the MongoDB server. The front-end also communicates with GitHub API to get data related to Users, repositories and organizations. Users can login to the application through auth0 login integrated to Stackle. +Users interact with the application through the Angular front-end which communicates with Node-API to get and post data to the MongoDB server. The front-end also communicates with GitHub API to get data related to Users, repositories and organizations. Users can login to the application through auth0 login integrated to Stackle. +![Architecture](./stackle_app/app/images/architecture.jpg) *** # Setting Up the Project @@ -29,20 +35,64 @@ These are the instructions on how to setup the project locally. For more information refer the [MongoDB manual](https://docs.mongodb.com/manual/administration/install-community/) on installing MongoDB Community edtion. +### On Mac + +1. Download the binary files for the desired release of MongoDB. +Download the binaries from the [MongoDB Download Center](www.mongodb.com/download-center). +2. Extract the files from the downloaded archive. +For example, from a system shell, you can extract through the tar command: +```tar -zxvf mongodb-osx-ssl-x86_64-3.6.3.tgz``` +3. Copy the extracted archive to the target directory. +Copy the extracted folder to the location from which MongoDB will run. +```mkdir -p mongodb``` +```cp -R -n mongodb-osx-ssl-x86_64-3.6.3/ mongodb``` +4. Ensure the location of the binaries is in the PATH variable. +The MongoDB binaries are in the bin/ directory of the archive. To ensure that the binaries are in your PATH, you can modify your PATH. +For example, you can add the following line to your shell’s rc file (e.g. ~/.bashrc): +```export PATH=/bin:$PATH``` +Replace with the path to the extracted MongoDB archive. + +## On Linux +For Ubuntu,SUSE, and Debian systems, you can install mongoDB Community Edition using .deb packages. The process varies from distro to distro, so I suggest you visit the link below, select your distribution. + +Ubuntu terminal command: +`sudo apt-get update +sudo apt-get install -y mongodb-org` +Debian terminal command: +`sudo apt-get update +sudo apt-get install -y mongodb-org` +SUSE terminal command: +`sudo zypper -n install mongodb-org` + +https://docs.mongodb.com/manual/administration/install-on-linux/ ## Stackle API 1. `cd` in to the **stackle_api** directory. 2. Run `npm install` to install the packages required. -3. once all the packages are installed run `npm start` +3. Once all the packages are installed run `npm start` ## Stackle App -1. `cd`in to the **stackle_app** directory -2. run `npm install` to install the packages required. -3. Once all the packages are installed, run `gulp serve` +Make sure you have the [angular-cli](https://cli.angular.io/) installed. +1. `cd` in to the **stackle-app** directory +2. Run `npm install` to install the packages required. +3. Once all the packages are installed, run `npm start` or `ng serve -o` + +## Running Tests (Protractor) +1. Run `npm install -g protractor` to install protractor globally. +2. To get started with a Selenium Server, run + ``` + webdriver-manager update + webdriver-manager start + ``` +3. `cd` in to **root** directory and run `./ui-tests.sh` +4. To add more tests, edit **stackle_tests.js** located in **stackle_app** # Running with Docker 1. Change the url in the database config file in stackle_api/config/database.js as `url : 'mongodb://mongo:27017/stackle'` 2. In the root of the Stackle directory, run `docker-compose build` + - If you are on Linux machine, execute the following steps to install compose. + ``` + sudo curl -L https://github.com/docker/compose/releases/download/1.17.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose + sudo chmod +x /usr/local/bin/docker-compose + ``` 3. Once build completes, run `docker-compose up` - - diff --git a/docker-compose.yaml b/docker-compose.yaml index d9ed26b..410315a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -4,11 +4,13 @@ services: build: './stackle_api' ports: - "8080:8080" - links : + links: - mongo mongo: - image : mongo + image: mongo + restart: unless-stopped + angular: - build : './stackle_app' - ports : - - "9000:9000" \ No newline at end of file + build: './stackle_app' + ports: + - "9000:9000" diff --git a/eslintrc.json b/eslintrc.json new file mode 100644 index 0000000..f6b371a --- /dev/null +++ b/eslintrc.json @@ -0,0 +1,13 @@ +{ + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module", + "ecmaFeatures": {} + }, + "rules": { + "complexity": "off: + }, + "env": { + "node": true + } +} diff --git a/npm-debug.log b/npm-debug.log deleted file mode 100644 index b00d56e..0000000 --- a/npm-debug.log +++ /dev/null @@ -1,22 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', -1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', -1 verbose cli 'start' ] -2 info using npm@3.10.10 -3 info using node@v6.9.5 -4 verbose stack Error: ENOENT: no such file or directory, open 'D:\Projects\Stackle\package.json' -4 verbose stack at Error (native) -5 verbose cwd D:\Projects\Stackle -6 error Windows_NT 10.0.14393 -7 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start" -8 error node v6.9.5 -9 error npm v3.10.10 -10 error path D:\Projects\Stackle\package.json -11 error code ENOENT -12 error errno -4058 -13 error syscall open -14 error enoent ENOENT: no such file or directory, open 'D:\Projects\Stackle\package.json' -15 error enoent ENOENT: no such file or directory, open 'D:\Projects\Stackle\package.json' -15 error enoent This is most likely not a problem with npm itself -15 error enoent and is related to npm not being able to find a file. -16 verbose exit [ -4058, true ] diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..a3e19ef --- /dev/null +++ b/package-lock.json @@ -0,0 +1,27 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@angular/cdk": { + "version": "2.0.0-beta.12", + "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-2.0.0-beta.12.tgz", + "integrity": "sha1-OiQ8tiuT9OA5EgunD5ANyeI1Yi4=", + "requires": { + "tslib": "1.8.0" + } + }, + "@angular/material": { + "version": "2.0.0-beta.12", + "resolved": "https://registry.npmjs.org/@angular/material/-/material-2.0.0-beta.12.tgz", + "integrity": "sha1-cbbQt7AhiR5dDjaIwdS9eMdFf1g=", + "requires": { + "tslib": "1.8.0" + } + }, + "tslib": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.8.0.tgz", + "integrity": "sha512-ymKWWZJST0/CkgduC2qkzjMOWr4bouhuURNXCn/inEX0L57BnRG6FhX76o7FOnsjHazCjfU2LKeSrlS2sIKQJg==" + } + } +} diff --git a/run-ui-tests.sh b/run-ui-tests.sh new file mode 100644 index 0000000..09fa5d4 --- /dev/null +++ b/run-ui-tests.sh @@ -0,0 +1,6 @@ +#!/bin/bash +cd stackle_app; +sudo npm i -D cypress --unsafe-perm; +sudo $(npm bin)/cypress open; +sudo cp Stackle_test.js cypress/integration; + diff --git a/stackle-app/.angular-cli.json b/stackle-app/.angular-cli.json new file mode 100644 index 0000000..e2a30ff --- /dev/null +++ b/stackle-app/.angular-cli.json @@ -0,0 +1,60 @@ +{ + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", + "project": { + "name": "stackle-app" + }, + "apps": [ + { + "root": "src", + "outDir": "dist", + "assets": [ + "assets", + "favicon.ico" + ], + "index": "index.html", + "main": "main.ts", + "polyfills": "polyfills.ts", + "test": "test.ts", + "tsconfig": "tsconfig.app.json", + "testTsconfig": "tsconfig.spec.json", + "prefix": "app", + "styles": [ + "styles.css" + ], + "scripts": [], + "environmentSource": "environments/environment.ts", + "environments": { + "dev": "environments/environment.ts", + "prod": "environments/environment.prod.ts" + } + } + ], + "e2e": { + "protractor": { + "config": "./protractor.conf.js" + } + }, + "lint": [ + { + "project": "src/tsconfig.app.json", + "exclude": "**/node_modules/**" + }, + { + "project": "src/tsconfig.spec.json", + "exclude": "**/node_modules/**" + }, + { + "project": "e2e/tsconfig.e2e.json", + "exclude": "**/node_modules/**" + } + ], + "test": { + "karma": { + "config": "./karma.conf.js" + } + }, + "defaults": { + "styleExt": "css", + "component": {} + } +} diff --git a/stackle-app/.editorconfig b/stackle-app/.editorconfig new file mode 100644 index 0000000..6e87a00 --- /dev/null +++ b/stackle-app/.editorconfig @@ -0,0 +1,13 @@ +# Editor configuration, see http://editorconfig.org +root = true + +[*] +charset = utf-8 +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +max_line_length = off +trim_trailing_whitespace = false diff --git a/stackle-app/.gitignore b/stackle-app/.gitignore new file mode 100644 index 0000000..227915b --- /dev/null +++ b/stackle-app/.gitignore @@ -0,0 +1,43 @@ +# See http://help.github.com/ignore-files/ for more about ignoring files. + +# compiled output +/dist +/tmp +/out-tsc + +# dependencies +/node_modules + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# misc +/.sass-cache +/connect.lock +/coverage +/libpeerconnection.log +npm-debug.log +testem.log +/typings +/src/environments/environment.ts + +# e2e +/e2e/*.js +/e2e/*.map + +# System Files +.DS_Store +Thumbs.db diff --git a/stackle-app/.travis.yml b/stackle-app/.travis.yml new file mode 100644 index 0000000..474cd2c --- /dev/null +++ b/stackle-app/.travis.yml @@ -0,0 +1,11 @@ +#.travis.yml + +language: node_js +node_js: + - "6.9" + +before_script: + - npm install -g @angular/cli + +script: + - ng build --prod \ No newline at end of file diff --git a/stackle-app/README.md b/stackle-app/README.md new file mode 100644 index 0000000..796d800 --- /dev/null +++ b/stackle-app/README.md @@ -0,0 +1,27 @@ +# StackleApp + +This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.5.0. + +## Development server + +Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files. + +## Code scaffolding + +Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`. + +## Build + +Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build. + +## Running unit tests + +Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io). + +## Running end-to-end tests + +Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/). + +## Further help + +To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md). diff --git a/stackle-app/e2e/app.e2e-spec.ts b/stackle-app/e2e/app.e2e-spec.ts new file mode 100644 index 0000000..34b3f4b --- /dev/null +++ b/stackle-app/e2e/app.e2e-spec.ts @@ -0,0 +1,14 @@ +import { AppPage } from './app.po'; + +describe('stackle-app App', () => { + let page: AppPage; + + beforeEach(() => { + page = new AppPage(); + }); + + it('should display welcome message', () => { + page.navigateTo(); + expect(page.getParagraphText()).toEqual('Welcome to app!'); + }); +}); diff --git a/stackle-app/e2e/app.po.ts b/stackle-app/e2e/app.po.ts new file mode 100644 index 0000000..82ea75b --- /dev/null +++ b/stackle-app/e2e/app.po.ts @@ -0,0 +1,11 @@ +import { browser, by, element } from 'protractor'; + +export class AppPage { + navigateTo() { + return browser.get('/'); + } + + getParagraphText() { + return element(by.css('app-root h1')).getText(); + } +} diff --git a/stackle-app/e2e/tsconfig.e2e.json b/stackle-app/e2e/tsconfig.e2e.json new file mode 100644 index 0000000..1d9e5ed --- /dev/null +++ b/stackle-app/e2e/tsconfig.e2e.json @@ -0,0 +1,14 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/e2e", + "baseUrl": "./", + "module": "commonjs", + "target": "es5", + "types": [ + "jasmine", + "jasminewd2", + "node" + ] + } +} diff --git a/stackle-app/karma.conf.js b/stackle-app/karma.conf.js new file mode 100644 index 0000000..af139fa --- /dev/null +++ b/stackle-app/karma.conf.js @@ -0,0 +1,33 @@ +// Karma configuration file, see link for more information +// https://karma-runner.github.io/1.0/config/configuration-file.html + +module.exports = function (config) { + config.set({ + basePath: '', + frameworks: ['jasmine', '@angular/cli'], + plugins: [ + require('karma-jasmine'), + require('karma-chrome-launcher'), + require('karma-jasmine-html-reporter'), + require('karma-coverage-istanbul-reporter'), + require('@angular/cli/plugins/karma') + ], + client:{ + clearContext: false // leave Jasmine Spec Runner output visible in browser + }, + coverageIstanbulReporter: { + reports: [ 'html', 'lcovonly' ], + fixWebpackSourcePaths: true + }, + angularCli: { + environment: 'dev' + }, + reporters: ['progress', 'kjhtml'], + port: 9876, + colors: true, + logLevel: config.LOG_INFO, + autoWatch: true, + browsers: ['Chrome'], + singleRun: false + }); +}; diff --git a/stackle-app/package-lock.json b/stackle-app/package-lock.json new file mode 100644 index 0000000..2f95989 --- /dev/null +++ b/stackle-app/package-lock.json @@ -0,0 +1,9677 @@ +{ + "name": "stackle-app", + "version": "0.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@angular-devkit/build-optimizer": { + "version": "0.0.32", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-optimizer/-/build-optimizer-0.0.32.tgz", + "integrity": "sha512-j09JdaFoRukEllfmH+TUJpe2ujUzTSj/szqYGHWVBilajwnNQh7f0A9v1R27mX+2di4x8tXuvaBgwvdEZBv32w==", + "dev": true, + "requires": { + "loader-utils": "1.1.0", + "source-map": "0.5.7", + "typescript": "2.4.2", + "webpack-sources": "1.0.2" + } + }, + "@angular-devkit/core": { + "version": "0.0.20", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-0.0.20.tgz", + "integrity": "sha512-lg5BvMxOfbVD//SOQvpq6TPIKTXYNMj0I9N/kfXbXkUGgiBGFLyFMf2fc+qNvDoa7lulKMPT8OJWS1YlGt93eg==", + "dev": true, + "requires": { + "source-map": "0.5.7" + } + }, + "@angular-devkit/schematics": { + "version": "0.0.35", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-0.0.35.tgz", + "integrity": "sha512-+qGUWhmMpHqHkYKMk1yKQDjXb/vqXGkzbMiRs/u5rSnlrH+/TzkCO0UsM7/p9WPcModuDxkf5FItpw/AgdcPeQ==", + "dev": true, + "requires": { + "@angular-devkit/core": "0.0.20", + "@ngtools/json-schema": "1.1.0", + "minimist": "1.2.0", + "rxjs": "5.5.2" + } + }, + "@angular/animations": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-5.0.0.tgz", + "integrity": "sha1-ta0ZnGf5P3WVREd+/+ZnnhVJkfs=", + "requires": { + "tslib": "1.8.0" + } + }, + "@angular/cdk": { + "version": "5.0.0-rc0", + "resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-5.0.0-rc0.tgz", + "integrity": "sha512-wZg/mzHisiTieVt7Q/YNPB+r07PHvjoAT3+0mwyIP7wuC00W8BJLPhTZd/tIM5q7Nd69kuA1HSx1qLkcmlCZkw==", + "requires": { + "tslib": "1.8.0" + } + }, + "@angular/cli": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-1.5.0.tgz", + "integrity": "sha512-nCXvqNCdi+8aOU2v6EABZsMg5bB7iM+wfaoWKnu9M5fOW2Rm+7/3Y1gDQKyFkgXCzXdy3J/xpfmwT0gjmjlvIA==", + "dev": true, + "requires": { + "@angular-devkit/build-optimizer": "0.0.32", + "@angular-devkit/schematics": "0.0.35", + "@ngtools/json-schema": "1.1.0", + "@ngtools/webpack": "1.8.0", + "@schematics/angular": "0.1.1", + "autoprefixer": "6.7.7", + "chalk": "2.2.2", + "circular-dependency-plugin": "3.0.0", + "common-tags": "1.4.0", + "copy-webpack-plugin": "4.2.0", + "core-object": "3.1.5", + "css-loader": "0.28.7", + "cssnano": "3.10.0", + "denodeify": "1.2.1", + "ember-cli-string-utils": "1.1.0", + "exports-loader": "0.6.4", + "extract-text-webpack-plugin": "3.0.0", + "file-loader": "1.1.5", + "fs-extra": "4.0.2", + "glob": "7.1.2", + "html-webpack-plugin": "2.30.1", + "istanbul-instrumenter-loader": "2.0.0", + "karma-source-map-support": "1.2.0", + "less": "2.7.3", + "less-loader": "4.0.5", + "license-webpack-plugin": "1.1.1", + "lodash": "4.17.4", + "memory-fs": "0.4.1", + "node-modules-path": "1.0.1", + "node-sass": "4.6.0", + "nopt": "4.0.1", + "opn": "5.1.0", + "portfinder": "1.0.13", + "postcss-custom-properties": "6.2.0", + "postcss-loader": "1.3.3", + "postcss-url": "5.1.2", + "raw-loader": "0.5.1", + "resolve": "1.5.0", + "rxjs": "5.5.2", + "sass-loader": "6.0.6", + "semver": "5.4.1", + "silent-error": "1.1.0", + "source-map-loader": "0.2.3", + "source-map-support": "0.4.18", + "style-loader": "0.13.2", + "stylus": "0.54.5", + "stylus-loader": "3.0.1", + "uglifyjs-webpack-plugin": "1.0.0", + "url-loader": "0.6.2", + "webpack": "3.8.1", + "webpack-concat-plugin": "1.4.0", + "webpack-dev-middleware": "1.12.0", + "webpack-dev-server": "2.9.4", + "webpack-merge": "4.1.1", + "webpack-sources": "1.0.2", + "webpack-subresource-integrity": "1.0.1", + "zone.js": "0.8.18" + } + }, + "@angular/common": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@angular/common/-/common-5.0.0.tgz", + "integrity": "sha1-+W1mpRe5ldG6mygwnxXC41lnWCU=", + "requires": { + "tslib": "1.8.0" + } + }, + "@angular/compiler": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-5.0.0.tgz", + "integrity": "sha1-uf+/GMijnYt9rOxHMZOpDiTMK8k=", + "requires": { + "tslib": "1.8.0" + } + }, + "@angular/compiler-cli": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-5.0.0.tgz", + "integrity": "sha1-Dsu5N9hKT43ZTwwqR7B9LkaUyFM=", + "dev": true, + "requires": { + "chokidar": "1.7.0", + "minimist": "1.2.0", + "reflect-metadata": "0.1.10", + "tsickle": "0.24.1" + } + }, + "@angular/core": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@angular/core/-/core-5.0.0.tgz", + "integrity": "sha1-T5dqIl993fNJkvLK2CTJVDpG9Mg=", + "requires": { + "tslib": "1.8.0" + } + }, + "@angular/forms": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-5.0.0.tgz", + "integrity": "sha1-x/3fo1OWdZrphSkgowzdqMQe0d4=", + "requires": { + "tslib": "1.8.0" + } + }, + "@angular/http": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@angular/http/-/http-5.0.0.tgz", + "integrity": "sha1-Byiivgz7sHhyfF64fUyF1T/smlE=", + "requires": { + "tslib": "1.8.0" + } + }, + "@angular/language-service": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@angular/language-service/-/language-service-5.0.0.tgz", + "integrity": "sha1-bMu2n0dXJw3QTsWFfTdjSy8CxAw=", + "dev": true + }, + "@angular/material": { + "version": "5.0.0-rc0", + "resolved": "https://registry.npmjs.org/@angular/material/-/material-5.0.0-rc0.tgz", + "integrity": "sha512-ZW9gy3c8l2NbFfX9DRYSW+i67pPoL9DZoMCb16STQlhdDfwwAWNpjGF0etXkXw30hDnRCMGVVJVU+45cNXJspA==", + "requires": { + "tslib": "1.8.0" + } + }, + "@angular/platform-browser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-5.0.0.tgz", + "integrity": "sha1-xwOPfN6AcFtiAUiXIx4YLuyXb+0=", + "requires": { + "tslib": "1.8.0" + } + }, + "@angular/platform-browser-dynamic": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-5.0.0.tgz", + "integrity": "sha1-iH4QbIsQOwQVz2FWpCXabYP0yJ0=", + "requires": { + "tslib": "1.8.0" + } + }, + "@angular/router": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@angular/router/-/router-5.0.0.tgz", + "integrity": "sha1-/ktSGmc4QIvOMPk6U0mRQMk6T3Y=", + "requires": { + "tslib": "1.8.0" + } + }, + "@ngtools/json-schema": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@ngtools/json-schema/-/json-schema-1.1.0.tgz", + "integrity": "sha1-w6DFRNYjkqzCgTpCyKDcb1j4aSI=", + "dev": true + }, + "@ngtools/webpack": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-1.8.0.tgz", + "integrity": "sha512-QefALj8VUakHMI/Z/7RjyQR4UpAAfCXeoHqqD9+7Td3CZkuryyGQILqOSAg3d+cP+64iCwIb2jSKC+YAIy722Q==", + "dev": true, + "requires": { + "chalk": "2.2.2", + "enhanced-resolve": "3.4.1", + "loader-utils": "1.1.0", + "magic-string": "0.22.4", + "semver": "5.4.1", + "source-map": "0.5.7", + "tree-kill": "1.2.0" + } + }, + "@schematics/angular": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-0.1.1.tgz", + "integrity": "sha512-Rk3OmVEJ3N1oBxNswfbamuADnwa//UHPTSdqlDMzN5DQwr2ruqvkJxldgDL7N1Dr6o2xq3QCVHhiV0VdT6JIsA==", + "dev": true, + "requires": { + "@angular-devkit/core": "0.0.20" + } + }, + "@types/jasmine": { + "version": "2.5.54", + "resolved": "https://registry.npmjs.org/@types/jasmine/-/jasmine-2.5.54.tgz", + "integrity": "sha512-B9YofFbUljs19g5gBKUYeLIulsh31U5AK70F41BImQRHEZQGm4GcN922UvnYwkduMqbC/NH+9fruWa/zrqvHIg==", + "dev": true + }, + "@types/jasminewd2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/jasminewd2/-/jasminewd2-2.0.3.tgz", + "integrity": "sha512-hYDVmQZT5VA2kigd4H4bv7vl/OhlympwREUemqBdOqtrYTo5Ytm12a5W5/nGgGYdanGVxj0x/VhZ7J3hOg/YKg==", + "dev": true, + "requires": { + "@types/jasmine": "2.5.54" + } + }, + "@types/node": { + "version": "6.0.90", + "resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.90.tgz", + "integrity": "sha512-tXoGRVdi7wZX7P1VWoV9Wfk0uYDOAHdEYXAttuWgSrN76Q32wQlSrMX0Rgyv3RTEaQY2ZLQrzYHVM2e8rfo8sA==", + "dev": true + }, + "@types/q": { + "version": "0.0.32", + "resolved": "https://registry.npmjs.org/@types/q/-/q-0.0.32.tgz", + "integrity": "sha1-vShOV8hPEyXacCur/IKlMoGQwMU=", + "dev": true + }, + "@types/selenium-webdriver": { + "version": "2.53.43", + "resolved": "https://registry.npmjs.org/@types/selenium-webdriver/-/selenium-webdriver-2.53.43.tgz", + "integrity": "sha512-UBYHWph6P3tutkbXpW6XYg9ZPbTKjw/YC2hGG1/GEvWwTbvezBUv3h+mmUFw79T3RFPnmedpiXdOBbXX+4l0jg==", + "dev": true + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "accepts": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", + "integrity": "sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=", + "dev": true, + "requires": { + "mime-types": "2.1.17", + "negotiator": "0.6.1" + } + }, + "acorn": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.2.1.tgz", + "integrity": "sha512-jG0u7c4Ly+3QkkW18V+NRDN+4bWHdln30NL1ZL2AvFZZmQe/BfopYCtghCKKVBUSetZ4QKcyA0pY6/4Gw8Pv8w==", + "dev": true + }, + "acorn-dynamic-import": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-2.0.2.tgz", + "integrity": "sha1-x1K9IQvvZ5UBtsbLf8hPj0cVjMQ=", + "dev": true, + "requires": { + "acorn": "4.0.13" + }, + "dependencies": { + "acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", + "dev": true + } + } + }, + "adm-zip": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.7.tgz", + "integrity": "sha1-hgbCy/HEJs6MjsABdER/1Jtur8E=", + "dev": true + }, + "after": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", + "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=", + "dev": true + }, + "agent-base": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-2.1.1.tgz", + "integrity": "sha1-1t4Q1a9hMtW9aSQn1G/FOFOQlMc=", + "dev": true, + "requires": { + "extend": "3.0.1", + "semver": "5.0.3" + }, + "dependencies": { + "semver": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz", + "integrity": "sha1-d0Zt5YnNXTyV8TiqeLxWmjy10no=", + "dev": true + } + } + }, + "ajv": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.3.0.tgz", + "integrity": "sha1-RBT/dKUIecII7l/cgm4ywwNUnto=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } + }, + "alphanum-sort": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz", + "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", + "dev": true + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true + }, + "ansi-html": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz", + "integrity": "sha1-gTWEAhliqenm/QOflA0S9WynhZ4=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.0" + } + }, + "anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "requires": { + "micromatch": "2.3.11", + "normalize-path": "2.1.1" + } + }, + "app-root-path": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-2.0.1.tgz", + "integrity": "sha1-zWLc+OT9WkF+/GZNLlsQZTxlG0Y=", + "dev": true + }, + "append-transform": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-0.4.0.tgz", + "integrity": "sha1-126/jKlNJ24keja61EpLdKthGZE=", + "dev": true, + "requires": { + "default-require-extensions": "1.0.0" + } + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", + "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", + "dev": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.3.3" + } + }, + "argparse": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "1.1.0" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-flatten": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-2.1.1.tgz", + "integrity": "sha1-Qmu52oQJDBg42BLIFQryCoMx4pY=", + "dev": true + }, + "array-includes": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", + "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "es-abstract": "1.9.0" + } + }, + "array-slice": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-0.2.3.tgz", + "integrity": "sha1-3Tz7gO15c6dRF82sabC5nshhhvU=", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "arraybuffer.slice": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz", + "integrity": "sha1-8zshWfBTKj8xB6JywMz70a0peco=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=" + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", + "dev": true + }, + "asn1.js": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.2.tgz", + "integrity": "sha512-b/OsSjvWEo8Pi8H0zsDd2P6Uqo2TK2pH8gNLSJtNLM2Db0v2QaAZ0pBQJXVjAn4gBuugeVDr7s63ZogpUIwWDg==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" + } + }, + "assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "dev": true, + "requires": { + "util": "0.10.3" + } + }, + "assert-plus": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", + "dev": true + }, + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "dev": true, + "requires": { + "lodash": "4.17.4" + } + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "dev": true + }, + "async-foreach": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", + "integrity": "sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI=", + "dev": true, + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "auth0-js": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/auth0-js/-/auth0-js-8.11.3.tgz", + "integrity": "sha1-lzhaF8iq0c1hK/gv3tMopDlu698=", + "requires": { + "base64-js": "1.2.1", + "idtoken-verifier": "1.1.0", + "qs": "6.4.0", + "superagent": "3.8.1", + "url-join": "1.1.0", + "winchan": "0.2.0" + } + }, + "auth0-lock": { + "version": "10.24.1", + "resolved": "https://registry.npmjs.org/auth0-lock/-/auth0-lock-10.24.1.tgz", + "integrity": "sha1-+FqHw6kwm5p6ffNpBA/GY73m7Jw=", + "requires": { + "auth0-js": "8.11.3", + "blueimp-md5": "2.3.1", + "fbjs": "0.3.2", + "idtoken-verifier": "1.1.0", + "immutable": "3.8.2", + "jsonp": "0.2.1", + "password-sheriff": "1.1.0", + "prop-types": "15.6.0", + "react": "15.6.2", + "react-dom": "15.6.2", + "react-transition-group": "2.2.1", + "superagent": "3.8.1", + "trim": "0.0.1", + "url-join": "1.1.0" + } + }, + "autoprefixer": { + "version": "6.7.7", + "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-6.7.7.tgz", + "integrity": "sha1-Hb0cg1ZY41zj+ZhAmdsAWFx4IBQ=", + "dev": true, + "requires": { + "browserslist": "1.7.7", + "caniuse-db": "1.0.30000760", + "normalize-range": "0.1.2", + "num2fraction": "1.2.2", + "postcss": "5.2.18", + "postcss-value-parser": "3.3.0" + } + }, + "aws-sign2": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", + "dev": true + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "babel-generator": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.0.tgz", + "integrity": "sha1-rBriAHC3n248odMmlhMFN3TyDcU=", + "dev": true, + "requires": { + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "detect-indent": "4.0.0", + "jsesc": "1.3.0", + "lodash": "4.17.4", + "source-map": "0.5.7", + "trim-right": "1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", + "dev": true + } + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "2.5.1", + "regenerator-runtime": "0.11.0" + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "lodash": "4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "babel-messages": "6.23.0", + "babel-runtime": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "debug": "2.6.9", + "globals": "9.18.0", + "invariant": "2.2.2", + "lodash": "4.17.4" + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "esutils": "2.0.2", + "lodash": "4.17.4", + "to-fast-properties": "1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true + }, + "backo2": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", + "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base64-arraybuffer": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", + "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=", + "dev": true + }, + "base64-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", + "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==" + }, + "base64id": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz", + "integrity": "sha1-R2iMuZu2gE8OBtPnY7HDLlfY5rY=", + "dev": true + }, + "batch": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.6.1.tgz", + "integrity": "sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "better-assert": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", + "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", + "dev": true, + "requires": { + "callsite": "1.0.0" + } + }, + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==", + "dev": true + }, + "binary-extensions": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.10.0.tgz", + "integrity": "sha1-muuabF6IY4qtFx4Wf1kAq+JINdA=", + "dev": true + }, + "blob": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", + "integrity": "sha1-vPEwUspURj8w+fx+lbmkdjCpSSE=", + "dev": true + }, + "block-stream": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", + "dev": true, + "optional": true, + "requires": { + "inherits": "2.0.3" + } + }, + "blocking-proxy": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/blocking-proxy/-/blocking-proxy-0.0.5.tgz", + "integrity": "sha1-RikF4Nz76pcPQao3Ij3anAexkSs=", + "dev": true, + "requires": { + "minimist": "1.2.0" + } + }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", + "dev": true + }, + "blueimp-md5": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.3.1.tgz", + "integrity": "sha1-mSpnN3M7naHt1kFVDcOsqy6c/Fo=" + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "body-parser": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", + "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", + "dev": true, + "requires": { + "bytes": "3.0.0", + "content-type": "1.0.4", + "debug": "2.6.9", + "depd": "1.1.1", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "on-finished": "2.3.0", + "qs": "6.5.1", + "raw-body": "2.3.2", + "type-is": "1.6.15" + }, + "dependencies": { + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", + "dev": true + } + } + }, + "bonjour": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/bonjour/-/bonjour-3.5.0.tgz", + "integrity": "sha1-jokKGD2O6aI5OzhExpGkK897yfU=", + "dev": true, + "requires": { + "array-flatten": "2.1.1", + "deep-equal": "1.0.1", + "dns-equal": "1.0.0", + "dns-txt": "2.0.2", + "multicast-dns": "6.1.1", + "multicast-dns-service-types": "1.1.0" + } + }, + "boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha1-aN/1++YMUes3cl6p4+0xDcwed24=", + "dev": true + }, + "boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "bootstrap": { + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-3.3.7.tgz", + "integrity": "sha1-WjiTlFSfIzMIdaOxUGVldPip63E=" + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browserify-aes": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.1.1.tgz", + "integrity": "sha512-UGnTYAnB2a3YuYKIRy1/4FB2HdM866E0qC46JXvVTYKlBlZlnvfpSfY6OKfXZAkv70eJ2a1SqzpAo5CRhZGDFg==", + "dev": true, + "requires": { + "buffer-xor": "1.0.3", + "cipher-base": "1.0.4", + "create-hash": "1.1.3", + "evp_bytestokey": "1.0.3", + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + }, + "browserify-cipher": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", + "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=", + "dev": true, + "requires": { + "browserify-aes": "1.1.1", + "browserify-des": "1.0.0", + "evp_bytestokey": "1.0.3" + } + }, + "browserify-des": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", + "integrity": "sha1-2qJ3cXRwki7S/hhZQRihdUOXId0=", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "des.js": "1.0.0", + "inherits": "2.0.3" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "randombytes": "2.0.5" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "elliptic": "6.4.0", + "inherits": "2.0.3", + "parse-asn1": "5.1.0" + } + }, + "browserify-zlib": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "dev": true, + "requires": { + "pako": "0.2.9" + } + }, + "browserslist": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", + "integrity": "sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk=", + "dev": true, + "requires": { + "caniuse-db": "1.0.30000760", + "electron-to-chromium": "1.3.27" + } + }, + "buffer": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", + "dev": true, + "requires": { + "base64-js": "1.2.1", + "ieee754": "1.1.8", + "isarray": "1.0.0" + } + }, + "buffer-indexof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-indexof/-/buffer-indexof-1.1.1.tgz", + "integrity": "sha512-4/rOEg86jivtPTeOUUT61jJO1Ya1TrR/OkqCSZDyq84WJh3LuuiphBYJN+fm5xufIk4XAFcEwte/8WzC8If/1g==", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "bytes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=", + "dev": true + }, + "cacache": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.0.tgz", + "integrity": "sha512-s9h6I9NY3KcBjfuS28K6XNmrv/HNFSzlpVD6eYMXugZg3Y8jjI1lUzTeUMa0oKByCDtHfsIy5Ec7KgWRnC5gtg==", + "dev": true, + "requires": { + "bluebird": "3.5.1", + "chownr": "1.0.1", + "glob": "7.1.2", + "graceful-fs": "4.1.11", + "lru-cache": "4.1.1", + "mississippi": "1.3.0", + "mkdirp": "0.5.1", + "move-concurrently": "1.0.1", + "promise-inflight": "1.0.1", + "rimraf": "2.6.2", + "ssri": "5.0.0", + "unique-filename": "1.1.0", + "y18n": "3.2.1" + } + }, + "callsite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", + "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=", + "dev": true + }, + "camel-case": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", + "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=", + "dev": true, + "requires": { + "no-case": "2.3.2", + "upper-case": "1.1.3" + } + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "2.1.1", + "map-obj": "1.0.1" + } + }, + "caniuse-api": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/caniuse-api/-/caniuse-api-1.6.1.tgz", + "integrity": "sha1-tTTnxzTE+B7F++isoq0kNUuWLGw=", + "dev": true, + "requires": { + "browserslist": "1.7.7", + "caniuse-db": "1.0.30000760", + "lodash.memoize": "4.1.2", + "lodash.uniq": "4.5.0" + } + }, + "caniuse-db": { + "version": "1.0.30000760", + "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000760.tgz", + "integrity": "sha1-PqKUc+t4psywny63Osnh3r/sUo0=", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + }, + "dependencies": { + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true + } + } + }, + "chain-function": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/chain-function/-/chain-function-1.0.0.tgz", + "integrity": "sha1-DUqzfn4Y6tC9xHuSB2QRjOWHM9w=" + }, + "chalk": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.2.2.tgz", + "integrity": "sha512-LvixLAQ4MYhbf7hgL4o5PeK32gJKvVzDRiSNIApDofQvyhl8adgG2lJVXn4+ekQoK7HL9RF8lqxwerpe0x2pCw==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=", + "dev": true + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "requires": { + "anymatch": "1.3.2", + "async-each": "1.0.1", + "glob-parent": "2.0.0", + "inherits": "2.0.3", + "is-binary-path": "1.0.1", + "is-glob": "2.0.1", + "path-is-absolute": "1.0.1", + "readdirp": "2.1.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + } + } + }, + "chownr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", + "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", + "dev": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + }, + "circular-dependency-plugin": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/circular-dependency-plugin/-/circular-dependency-plugin-3.0.0.tgz", + "integrity": "sha1-m2hpLjWw41EJmNAWS2rlARvqV2A=", + "dev": true + }, + "clap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/clap/-/clap-1.2.3.tgz", + "integrity": "sha512-4CoL/A3hf90V3VIEjeuhSvlGFEHKzOz+Wfc2IVZc+FaUgU0ZQafJTP49fvnULipOPcAfqhyI2duwQyns6xqjYA==", + "dev": true, + "requires": { + "chalk": "1.1.3" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "classnames": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.5.tgz", + "integrity": "sha1-+zgB1FNGdknvNgPH1hoCvRKb3m0=" + }, + "clean-css": { + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.1.9.tgz", + "integrity": "sha1-Nc7ornaHpJuYA09w3gDE7dOCYwE=", + "dev": true, + "requires": { + "source-map": "0.5.7" + } + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" + } + }, + "clone": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", + "integrity": "sha1-Jgt6meux7f4kdTgXX3gyQ8sZ0Uk=", + "dev": true + }, + "clone-deep": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-0.3.0.tgz", + "integrity": "sha1-NIxhrpzb4O3+BT2R/0zFIdeQ7eg=", + "dev": true, + "requires": { + "for-own": "1.0.0", + "is-plain-object": "2.0.4", + "kind-of": "3.2.2", + "shallow-clone": "0.1.2" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "coa": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/coa/-/coa-1.0.4.tgz", + "integrity": "sha1-qe8VNmDWqGqL3sAomlxoTSF0Mv0=", + "dev": true, + "requires": { + "q": "1.5.1" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "codelyzer": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/codelyzer/-/codelyzer-3.2.2.tgz", + "integrity": "sha512-VNvW9gRThsqRarEnLioiILd0Pdk0yCq/7cVgYvqHpC+3CHqfnrJfmXjoana7vzWfSis+9pODXofjCWX+nlU9Gw==", + "dev": true, + "requires": { + "app-root-path": "2.0.1", + "css-selector-tokenizer": "0.7.0", + "cssauron": "1.4.0", + "semver-dsl": "1.0.1", + "source-map": "0.5.7", + "sprintf-js": "1.0.3" + } + }, + "color": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/color/-/color-0.11.4.tgz", + "integrity": "sha1-bXtcdPtl6EHNSHkq0e1eB7kE12Q=", + "dev": true, + "requires": { + "clone": "1.0.2", + "color-convert": "1.9.0", + "color-string": "0.3.0" + } + }, + "color-convert": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz", + "integrity": "sha1-Gsz5fdc5uYO/mU1W/sj5WFNkG3o=", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "color-string": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-0.3.0.tgz", + "integrity": "sha1-J9RvtnAlxcL6JZk7+/V55HhBuZE=", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "colormin": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/colormin/-/colormin-1.1.2.tgz", + "integrity": "sha1-6i90IKcrlogaOKrlnsEkpvcpgTM=", + "dev": true, + "requires": { + "color": "0.11.4", + "css-color-names": "0.0.4", + "has": "1.0.1" + } + }, + "colors": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", + "dev": true + }, + "combine-lists": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/combine-lists/-/combine-lists-1.0.1.tgz", + "integrity": "sha1-RYwH4J4NkA/Ci3Cj/sLazR0st/Y=", + "dev": true, + "requires": { + "lodash": "4.17.4" + } + }, + "combined-stream": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "requires": { + "delayed-stream": "1.0.0" + } + }, + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "dev": true + }, + "common-tags": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.4.0.tgz", + "integrity": "sha1-EYe+Tz1M8MBCfUP3Tu8fc1AWFMA=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0" + } + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "component-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", + "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=", + "dev": true + }, + "component-emitter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz", + "integrity": "sha1-KWWU8nU9qmOZbSrwjRWpURbJrsM=", + "dev": true + }, + "component-inherit": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", + "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=", + "dev": true + }, + "compressible": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.12.tgz", + "integrity": "sha1-xZpcmdt2dn6YdlAOJx72OzSTvWY=", + "dev": true, + "requires": { + "mime-db": "1.30.0" + } + }, + "compression": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.1.tgz", + "integrity": "sha1-7/JgPvwuIs+G810uuTWJ+YdTc9s=", + "dev": true, + "requires": { + "accepts": "1.3.4", + "bytes": "3.0.0", + "compressible": "2.0.12", + "debug": "2.6.9", + "on-headers": "1.0.1", + "safe-buffer": "5.1.1", + "vary": "1.1.2" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.3", + "typedarray": "0.0.6" + } + }, + "connect": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.6.5.tgz", + "integrity": "sha1-+43ee6B2OHfQ7J352sC0tA5yx9o=", + "dev": true, + "requires": { + "debug": "2.6.9", + "finalhandler": "1.0.6", + "parseurl": "1.3.2", + "utils-merge": "1.0.1" + }, + "dependencies": { + "finalhandler": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.6.tgz", + "integrity": "sha1-AHrqM9Gk0+QgF/YkhIrVjSEvgU8=", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "statuses": "1.3.1", + "unpipe": "1.0.0" + } + } + } + }, + "connect-history-api-fallback": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.4.0.tgz", + "integrity": "sha1-PbJPlz9LkjsOgvYZzg3wJBHKYj0=", + "dev": true + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "0.1.4" + } + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "content-disposition": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=", + "dev": true + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "dev": true + }, + "convert-source-map": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz", + "integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=", + "dev": true + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", + "dev": true + }, + "cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=", + "dev": true + }, + "cookiejar": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.1.tgz", + "integrity": "sha1-Qa1XsbVVlR7BcUEqgZQrHoIA00o=" + }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "dev": true, + "requires": { + "aproba": "1.2.0", + "fs-write-stream-atomic": "1.0.10", + "iferr": "0.1.5", + "mkdirp": "0.5.1", + "rimraf": "2.6.2", + "run-queue": "1.0.3" + } + }, + "copy-webpack-plugin": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-4.2.0.tgz", + "integrity": "sha512-eZERim02YjJcepLjrToQMapOoRLfiXewJi9zJON6xXNNJSUhkGzL1L/yFjOufS0KxsnWUzc2szg9t8ZaZKJXAg==", + "dev": true, + "requires": { + "bluebird": "3.5.1", + "fs-extra": "4.0.2", + "glob": "7.1.2", + "is-glob": "4.0.0", + "loader-utils": "0.2.17", + "lodash": "4.17.4", + "minimatch": "3.0.4", + "node-dir": "0.1.17" + }, + "dependencies": { + "loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "dev": true, + "requires": { + "big.js": "3.2.0", + "emojis-list": "2.1.0", + "json5": "0.5.1", + "object-assign": "4.1.1" + } + } + } + }, + "core-js": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.1.tgz", + "integrity": "sha1-rmh03GaTd4m4B1T/VCjfZoGcpQs=" + }, + "core-object": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/core-object/-/core-object-3.1.5.tgz", + "integrity": "sha512-sA2/4+/PZ/KV6CKgjrVrrUVBKCkdDO02CUlQ0YKTQoYUwPYNOtOAcWlbYhd5v/1JqYaA6oZ4sDlOU4ppVw6Wbg==", + "dev": true, + "requires": { + "chalk": "2.2.2" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "cosmiconfig": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-2.2.2.tgz", + "integrity": "sha512-GiNXLwAFPYHy25XmTPpafYvn3CLAkJ8FLsscq78MQd1Kh0OU6Yzhn4eV2MVF4G9WEQZoWEGltatdR+ntGPMl5A==", + "dev": true, + "requires": { + "is-directory": "0.3.1", + "js-yaml": "3.7.0", + "minimist": "1.2.0", + "object-assign": "4.1.1", + "os-homedir": "1.0.2", + "parse-json": "2.2.0", + "require-from-string": "1.2.1" + } + }, + "create-ecdh": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", + "integrity": "sha1-iIxyNZbN92EvZJgjPuvXo1MBc30=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.4.0" + } + }, + "create-hash": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", + "integrity": "sha1-YGBCrIuSYnUPSDyt2rD1gZFy2P0=", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "inherits": "2.0.3", + "ripemd160": "2.0.1", + "sha.js": "2.4.9" + } + }, + "create-hmac": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.6.tgz", + "integrity": "sha1-rLniIaThe9sHbpBlfEK5PjcmzwY=", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "create-hash": "1.1.3", + "inherits": "2.0.3", + "ripemd160": "2.0.1", + "safe-buffer": "5.1.1", + "sha.js": "2.4.9" + } + }, + "create-react-class": { + "version": "15.6.2", + "resolved": "https://registry.npmjs.org/create-react-class/-/create-react-class-15.6.2.tgz", + "integrity": "sha1-zx7RXxKq1/FO9fLf4F5sQvke8Co=", + "requires": { + "fbjs": "0.8.16", + "loose-envify": "1.3.1", + "object-assign": "4.1.1" + }, + "dependencies": { + "core-js": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=" + }, + "fbjs": { + "version": "0.8.16", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.16.tgz", + "integrity": "sha1-XmdDL1UNxBtXK/VYR7ispk5TN9s=", + "requires": { + "core-js": "1.2.7", + "isomorphic-fetch": "2.2.1", + "loose-envify": "1.3.1", + "object-assign": "4.1.1", + "promise": "7.3.1", + "setimmediate": "1.0.5", + "ua-parser-js": "0.7.17" + } + } + } + }, + "cross-spawn": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-3.0.1.tgz", + "integrity": "sha1-ElYDfsufDF9549bvE14wdwGEuYI=", + "dev": true, + "optional": true, + "requires": { + "lru-cache": "4.1.1", + "which": "1.3.0" + } + }, + "crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=", + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "dev": true, + "requires": { + "boom": "2.10.1" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "1.0.0", + "browserify-sign": "4.0.4", + "create-ecdh": "4.0.0", + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "diffie-hellman": "5.0.2", + "inherits": "2.0.3", + "pbkdf2": "3.0.14", + "public-encrypt": "4.0.0", + "randombytes": "2.0.5", + "randomfill": "1.0.3" + } + }, + "crypto-js": { + "version": "3.1.9-1", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.1.9-1.tgz", + "integrity": "sha1-/aGedh/Ad+Af+/3G6f38WeiAbNg=" + }, + "css-color-names": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/css-color-names/-/css-color-names-0.0.4.tgz", + "integrity": "sha1-gIrcLnnPhHOAabZGyyDsJ762KeA=", + "dev": true + }, + "css-loader": { + "version": "0.28.7", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-0.28.7.tgz", + "integrity": "sha512-GxMpax8a/VgcfRrVy0gXD6yLd5ePYbXX/5zGgTVYp4wXtJklS8Z2VaUArJgc//f6/Dzil7BaJObdSv8eKKCPgg==", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "css-selector-tokenizer": "0.7.0", + "cssnano": "3.10.0", + "icss-utils": "2.1.0", + "loader-utils": "1.1.0", + "lodash.camelcase": "4.3.0", + "object-assign": "4.1.1", + "postcss": "5.2.18", + "postcss-modules-extract-imports": "1.1.0", + "postcss-modules-local-by-default": "1.2.0", + "postcss-modules-scope": "1.1.0", + "postcss-modules-values": "1.3.0", + "postcss-value-parser": "3.3.0", + "source-list-map": "2.0.0" + } + }, + "css-parse": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/css-parse/-/css-parse-1.7.0.tgz", + "integrity": "sha1-Mh9s9zeCpv91ERE5D8BeLGV9jJs=", + "dev": true + }, + "css-select": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-1.2.0.tgz", + "integrity": "sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg=", + "dev": true, + "requires": { + "boolbase": "1.0.0", + "css-what": "2.1.0", + "domutils": "1.5.1", + "nth-check": "1.0.1" + } + }, + "css-selector-tokenizer": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.0.tgz", + "integrity": "sha1-5piEdK6MlTR3v15+/s/OzNnPTIY=", + "dev": true, + "requires": { + "cssesc": "0.1.0", + "fastparse": "1.1.1", + "regexpu-core": "1.0.0" + } + }, + "css-what": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-2.1.0.tgz", + "integrity": "sha1-lGfQMsOM+u+58teVASUwYvh/ob0=", + "dev": true + }, + "cssauron": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/cssauron/-/cssauron-1.4.0.tgz", + "integrity": "sha1-pmAt/34EqDBtwNuaVR6S6LVmKtg=", + "dev": true, + "requires": { + "through": "2.3.8" + } + }, + "cssesc": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-0.1.0.tgz", + "integrity": "sha1-yBSQPkViM3GgR3tAEJqq++6t27Q=", + "dev": true + }, + "cssnano": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/cssnano/-/cssnano-3.10.0.tgz", + "integrity": "sha1-Tzj2zqK5sX+gFJDyPx3GjqZcHDg=", + "dev": true, + "requires": { + "autoprefixer": "6.7.7", + "decamelize": "1.2.0", + "defined": "1.0.0", + "has": "1.0.1", + "object-assign": "4.1.1", + "postcss": "5.2.18", + "postcss-calc": "5.3.1", + "postcss-colormin": "2.2.2", + "postcss-convert-values": "2.6.1", + "postcss-discard-comments": "2.0.4", + "postcss-discard-duplicates": "2.1.0", + "postcss-discard-empty": "2.1.0", + "postcss-discard-overridden": "0.1.1", + "postcss-discard-unused": "2.2.3", + "postcss-filter-plugins": "2.0.2", + "postcss-merge-idents": "2.1.7", + "postcss-merge-longhand": "2.0.2", + "postcss-merge-rules": "2.1.2", + "postcss-minify-font-values": "1.0.5", + "postcss-minify-gradients": "1.0.5", + "postcss-minify-params": "1.2.2", + "postcss-minify-selectors": "2.1.1", + "postcss-normalize-charset": "1.1.1", + "postcss-normalize-url": "3.0.8", + "postcss-ordered-values": "2.2.3", + "postcss-reduce-idents": "2.4.0", + "postcss-reduce-initial": "1.0.1", + "postcss-reduce-transforms": "1.0.4", + "postcss-svgo": "2.1.6", + "postcss-unique-selectors": "2.0.2", + "postcss-value-parser": "3.3.0", + "postcss-zindex": "2.2.0" + } + }, + "csso": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/csso/-/csso-2.3.2.tgz", + "integrity": "sha1-3dUsWHAz9J6Utx/FVWnyUuj/X4U=", + "dev": true, + "requires": { + "clap": "1.2.3", + "source-map": "0.5.7" + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "1.0.2" + } + }, + "custom-event": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", + "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=", + "dev": true + }, + "cyclist": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", + "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=", + "dev": true + }, + "d": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true, + "requires": { + "es5-ext": "0.10.35" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "deep-equal": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", + "dev": true + }, + "default-require-extensions": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz", + "integrity": "sha1-836hXT4T/9m0N9M+GnW1+5eHTLg=", + "dev": true, + "requires": { + "strip-bom": "2.0.0" + } + }, + "define-properties": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "dev": true, + "requires": { + "foreach": "2.0.5", + "object-keys": "1.0.11" + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "del": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/del/-/del-3.0.0.tgz", + "integrity": "sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU=", + "dev": true, + "requires": { + "globby": "6.1.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.0", + "p-map": "1.2.0", + "pify": "3.0.0", + "rimraf": "2.6.2" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true + }, + "denodeify": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/denodeify/-/denodeify-1.2.1.tgz", + "integrity": "sha1-OjYof1A05pnnV3kBBSwubJQlFjE=", + "dev": true + }, + "depd": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=", + "dev": true + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" + } + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "dev": true, + "requires": { + "repeating": "2.0.1" + } + }, + "detect-node": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.3.tgz", + "integrity": "sha1-ogM8CcyOFY03dI+951B4Mr1s4Sc=", + "dev": true + }, + "di": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", + "integrity": "sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw=", + "dev": true + }, + "diff": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.4.0.tgz", + "integrity": "sha512-QpVuMTEoJMF7cKzi6bvWhRulU1fZqZnvyVQgNhPaxxuTYwyjn/j1v9falseQ/uXWwPnO56RBfwtg4h/EQXmucA==", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", + "integrity": "sha1-tYNXOScM/ias9jIJn97SoH8gnl4=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "miller-rabin": "4.0.1", + "randombytes": "2.0.5" + } + }, + "directory-encoder": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/directory-encoder/-/directory-encoder-0.7.2.tgz", + "integrity": "sha1-WbTiqk8lQi9sY7UntGL14tDdLFg=", + "dev": true, + "requires": { + "fs-extra": "0.23.1", + "handlebars": "1.3.0", + "img-stats": "0.5.2" + }, + "dependencies": { + "fs-extra": { + "version": "0.23.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.23.1.tgz", + "integrity": "sha1-ZhHbpq3yq43Jxp+rN83fiBgVfj0=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "2.4.0", + "path-is-absolute": "1.0.1", + "rimraf": "2.6.2" + } + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11" + } + } + } + }, + "dns-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/dns-equal/-/dns-equal-1.0.0.tgz", + "integrity": "sha1-s55/HabrCnW6nBcySzR1PEfgZU0=", + "dev": true + }, + "dns-packet": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/dns-packet/-/dns-packet-1.2.2.tgz", + "integrity": "sha512-kN+DjfGF7dJGUL7nWRktL9Z18t1rWP3aQlyZdY8XlpvU3Nc6GeFTQApftcjtWKxAZfiggZSGrCEoszNgvnpwDg==", + "dev": true, + "requires": { + "ip": "1.1.5", + "safe-buffer": "5.1.1" + } + }, + "dns-txt": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/dns-txt/-/dns-txt-2.0.2.tgz", + "integrity": "sha1-uR2Ab10nGI5Ks+fRB9iBocxGQrY=", + "dev": true, + "requires": { + "buffer-indexof": "1.1.1" + } + }, + "dom-converter": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.1.4.tgz", + "integrity": "sha1-pF71cnuJDJv/5tfIduexnLDhfzs=", + "dev": true, + "requires": { + "utila": "0.3.3" + }, + "dependencies": { + "utila": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/utila/-/utila-0.3.3.tgz", + "integrity": "sha1-1+jn1+MJEHCSsF+NloiCTWM6QiY=", + "dev": true + } + } + }, + "dom-helpers": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-3.2.1.tgz", + "integrity": "sha1-MgPgf+0he9H0JLAZc1WC/Deyglo=" + }, + "dom-serialize": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", + "integrity": "sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs=", + "dev": true, + "requires": { + "custom-event": "1.0.1", + "ent": "2.2.0", + "extend": "3.0.1", + "void-elements": "2.0.1" + } + }, + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "dev": true, + "requires": { + "domelementtype": "1.1.3", + "entities": "1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "dev": true + } + } + }, + "domain-browser": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", + "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", + "dev": true + }, + "domelementtype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "dev": true + }, + "domhandler": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.1.0.tgz", + "integrity": "sha1-0mRvXlf2w7qxHPbLBdPArPdBJZQ=", + "dev": true, + "requires": { + "domelementtype": "1.3.0" + } + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "requires": { + "dom-serializer": "0.1.0", + "domelementtype": "1.3.0" + } + }, + "duplexify": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.1.tgz", + "integrity": "sha512-j5goxHTwVED1Fpe5hh3q9R93Kip0Bg2KVAt4f8CEYM3UEwYcPSvWbXaUQOzdX/HtiNomipv+gU7ASQPDbV7pGQ==", + "dev": true, + "requires": { + "end-of-stream": "1.4.0", + "inherits": "2.0.3", + "readable-stream": "2.3.3", + "stream-shift": "1.0.0" + } + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, + "ejs": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-2.5.7.tgz", + "integrity": "sha1-zIcsFoiArjxxiXYv1f/ACJbJUYo=", + "dev": true + }, + "electron-to-chromium": { + "version": "1.3.27", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.27.tgz", + "integrity": "sha1-eOy4o5kGYYe7N07t412ccFZagD0=", + "dev": true + }, + "elliptic": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", + "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.3", + "hmac-drbg": "1.0.1", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0", + "minimalistic-crypto-utils": "1.0.1" + } + }, + "ember-cli-string-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ember-cli-string-utils/-/ember-cli-string-utils-1.1.0.tgz", + "integrity": "sha1-ObZ3/CgF9VFzc1N2/O8njqpEUqE=", + "dev": true + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "dev": true + }, + "encodeurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", + "integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=", + "dev": true + }, + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "requires": { + "iconv-lite": "0.4.19" + } + }, + "end-of-stream": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.0.tgz", + "integrity": "sha1-epDYM+/abPpurA9JSduw+tOmMgY=", + "dev": true, + "requires": { + "once": "1.4.0" + } + }, + "engine.io": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-1.8.3.tgz", + "integrity": "sha1-jef5eJXSDTm4X4ju7nd7K9QrE9Q=", + "dev": true, + "requires": { + "accepts": "1.3.3", + "base64id": "1.0.0", + "cookie": "0.3.1", + "debug": "2.3.3", + "engine.io-parser": "1.3.2", + "ws": "1.1.2" + }, + "dependencies": { + "accepts": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", + "integrity": "sha1-w8p0NJOGSMPg2cHjKN1otiLChMo=", + "dev": true, + "requires": { + "mime-types": "2.1.17", + "negotiator": "0.6.1" + } + }, + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "dev": true, + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + } + } + }, + "engine.io-client": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-1.8.3.tgz", + "integrity": "sha1-F5jtk0USRkU9TG9jXXogH+lA1as=", + "dev": true, + "requires": { + "component-emitter": "1.2.1", + "component-inherit": "0.0.3", + "debug": "2.3.3", + "engine.io-parser": "1.3.2", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "parsejson": "0.0.3", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "ws": "1.1.2", + "xmlhttprequest-ssl": "1.5.3", + "yeast": "0.1.2" + }, + "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "dev": true, + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + } + } + }, + "engine.io-parser": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-1.3.2.tgz", + "integrity": "sha1-k3sHnwAH0Ik+xW1GyyILjLQ1Igo=", + "dev": true, + "requires": { + "after": "0.8.2", + "arraybuffer.slice": "0.0.6", + "base64-arraybuffer": "0.1.5", + "blob": "0.0.4", + "has-binary": "0.1.7", + "wtf-8": "1.0.0" + } + }, + "enhanced-resolve": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz", + "integrity": "sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "memory-fs": "0.4.1", + "object-assign": "4.1.1", + "tapable": "0.2.8" + } + }, + "ent": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", + "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", + "dev": true + }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "dev": true + }, + "errno": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.4.tgz", + "integrity": "sha1-uJbiOp5ei6M4cfyZar02NfyaHH0=", + "dev": true, + "requires": { + "prr": "0.0.0" + } + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "es-abstract": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.9.0.tgz", + "integrity": "sha512-kk3IJoKo7A3pWJc0OV8yZ/VEX2oSUytfekrJiqoxBlKJMFAJVJVpGdHClCCTdv+Fn2zHfpDHHIelMFhZVfef3Q==", + "dev": true, + "requires": { + "es-to-primitive": "1.1.1", + "function-bind": "1.1.1", + "has": "1.0.1", + "is-callable": "1.1.3", + "is-regex": "1.0.4" + } + }, + "es-to-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", + "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "dev": true, + "requires": { + "is-callable": "1.1.3", + "is-date-object": "1.0.1", + "is-symbol": "1.0.1" + } + }, + "es5-ext": { + "version": "0.10.35", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.35.tgz", + "integrity": "sha1-GO6FjOajxFx9eekcFfzKnsVoSU8=", + "dev": true, + "requires": { + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1" + } + }, + "es6-iterator": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", + "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.35", + "es6-symbol": "3.1.1" + } + }, + "es6-map": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", + "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.35", + "es6-iterator": "2.0.3", + "es6-set": "0.1.5", + "es6-symbol": "3.1.1", + "event-emitter": "0.3.5" + } + }, + "es6-set": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", + "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.35", + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1", + "event-emitter": "0.3.5" + } + }, + "es6-symbol": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.35" + } + }, + "es6-weak-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", + "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.35", + "es6-iterator": "2.0.3", + "es6-symbol": "3.1.1" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escope": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", + "integrity": "sha1-4Bl16BJ4GhY6ba392AOY3GTIicM=", + "dev": true, + "requires": { + "es6-map": "0.1.5", + "es6-weak-map": "2.0.2", + "esrecurse": "4.2.0", + "estraverse": "4.2.0" + } + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "esrecurse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", + "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", + "dev": true, + "requires": { + "estraverse": "4.2.0", + "object-assign": "4.1.1" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.35" + } + }, + "eventemitter3": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz", + "integrity": "sha1-HIaZHYFq0eUEdQ5zh0Ik7PO+xQg=", + "dev": true + }, + "events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "dev": true + }, + "eventsource": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-0.1.6.tgz", + "integrity": "sha1-Cs7ehJ7X3RzMMsgRuxG5RNTykjI=", + "dev": true, + "requires": { + "original": "1.0.0" + } + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "1.3.4", + "safe-buffer": "5.1.1" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "5.1.0", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "4.1.1", + "shebang-command": "1.2.0", + "which": "1.3.0" + } + } + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "expand-braces": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/expand-braces/-/expand-braces-0.1.2.tgz", + "integrity": "sha1-SIsdHSRRyz06axks/AMPRMWFX+o=", + "dev": true, + "requires": { + "array-slice": "0.2.3", + "array-unique": "0.2.1", + "braces": "0.1.5" + }, + "dependencies": { + "braces": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-0.1.5.tgz", + "integrity": "sha1-wIVxEIUpHYt1/ddOqw+FlygHEeY=", + "dev": true, + "requires": { + "expand-range": "0.1.1" + } + }, + "expand-range": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-0.1.1.tgz", + "integrity": "sha1-TLjtoJk8pW+k9B/ELzy7TMrf8EQ=", + "dev": true, + "requires": { + "is-number": "0.1.1", + "repeat-string": "0.2.2" + } + }, + "is-number": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-0.1.1.tgz", + "integrity": "sha1-aaevEWlj1HIG7JvZtIoUIW8eOAY=", + "dev": true + }, + "repeat-string": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-0.2.2.tgz", + "integrity": "sha1-x6jTI2BoNiBZp+RlH8aITosftK4=", + "dev": true + } + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "2.2.3" + } + }, + "exports-loader": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/exports-loader/-/exports-loader-0.6.4.tgz", + "integrity": "sha1-1w/GEhl1s1/BKDDPUnVL4nQPyIY=", + "dev": true, + "requires": { + "loader-utils": "1.1.0", + "source-map": "0.5.7" + } + }, + "express": { + "version": "4.16.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.16.2.tgz", + "integrity": "sha1-41xt/i1kt9ygpc1PIXgb4ymeB2w=", + "dev": true, + "requires": { + "accepts": "1.3.4", + "array-flatten": "1.1.1", + "body-parser": "1.18.2", + "content-disposition": "0.5.2", + "content-type": "1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "1.1.1", + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "etag": "1.8.1", + "finalhandler": "1.1.0", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "1.1.2", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "2.0.2", + "qs": "6.5.1", + "range-parser": "1.2.0", + "safe-buffer": "5.1.1", + "send": "0.16.1", + "serve-static": "1.13.1", + "setprototypeof": "1.1.0", + "statuses": "1.3.1", + "type-is": "1.6.15", + "utils-merge": "1.0.1", + "vary": "1.1.2" + }, + "dependencies": { + "array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", + "dev": true + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==", + "dev": true + } + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + } + } + }, + "extract-text-webpack-plugin": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/extract-text-webpack-plugin/-/extract-text-webpack-plugin-3.0.0.tgz", + "integrity": "sha1-kMqnkHvESfM1AF46x1MrQbAN5hI=", + "dev": true, + "requires": { + "async": "2.6.0", + "loader-utils": "1.1.0", + "schema-utils": "0.3.0", + "webpack-sources": "1.0.2" + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", + "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fastparse": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.1.tgz", + "integrity": "sha1-0eJkOzipTXWDtHkGDmxK/8lAcfg=", + "dev": true + }, + "faye-websocket": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.10.0.tgz", + "integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ=", + "dev": true, + "requires": { + "websocket-driver": "0.7.0" + } + }, + "fbjs": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.3.2.tgz", + "integrity": "sha1-AzpUBZUIS13jUJpAXQbxoqjlufs=", + "requires": { + "core-js": "1.2.7", + "loose-envify": "1.3.1", + "promise": "7.3.1", + "ua-parser-js": "0.7.17", + "whatwg-fetch": "0.9.0" + }, + "dependencies": { + "core-js": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=" + } + } + }, + "file-loader": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/file-loader/-/file-loader-1.1.5.tgz", + "integrity": "sha512-RzGHDatcVNpGISTvCpfUfOGpYuSR7HSsSg87ki+wF6rw1Hm0RALPTiAdsxAq1UwLf0RRhbe22/eHK6nhXspiOQ==", + "dev": true, + "requires": { + "loader-utils": "1.1.0", + "schema-utils": "0.3.0" + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fileset": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz", + "integrity": "sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA=", + "dev": true, + "requires": { + "glob": "7.1.2", + "minimatch": "3.0.4" + } + }, + "fill-range": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", + "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "dev": true, + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "1.1.7", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "finalhandler": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.0.tgz", + "integrity": "sha1-zgtoVbRYU+eRsvzGgARtiCU91/U=", + "dev": true, + "requires": { + "debug": "2.6.9", + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "statuses": "1.3.1", + "unpipe": "1.0.0" + } + }, + "find-cache-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", + "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", + "dev": true, + "requires": { + "commondir": "1.0.1", + "make-dir": "1.1.0", + "pkg-dir": "2.0.0" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "flatten": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.2.tgz", + "integrity": "sha1-2uRqnXj74lKSJYzB54CkHZXAN4I=", + "dev": true + }, + "flush-write-stream": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.2.tgz", + "integrity": "sha1-yBuQ2HRnZvGmCaRoCZRsRd2K5Bc=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.3" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "requires": { + "for-in": "1.0.2" + } + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", + "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "dev": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.17" + } + }, + "formidable": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.1.1.tgz", + "integrity": "sha1-lriIb3w8NQi5Mta9cMTTqI818ak=" + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=", + "dev": true + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", + "dev": true + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.3" + } + }, + "fs-access": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", + "integrity": "sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o=", + "dev": true, + "requires": { + "null-check": "1.0.0" + } + }, + "fs-extra": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.2.tgz", + "integrity": "sha1-+RcExT0bRh+JNFKwwwfZmXZHq2s=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "4.0.0", + "universalify": "0.1.1" + } + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "iferr": "0.1.5", + "imurmurhash": "0.1.4", + "readable-stream": "2.3.3" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fstream": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", + "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.2" + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "requires": { + "aproba": "1.2.0", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "gaze": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.2.tgz", + "integrity": "sha1-hHIkZ3rbiHDWeSV+0ziP22HkAQU=", + "dev": true, + "optional": true, + "requires": { + "globule": "1.2.0" + } + }, + "get-caller-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + } + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "2.0.1" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + } + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", + "dev": true + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "globule": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.0.tgz", + "integrity": "sha1-HcScaCLdnoovoAuiopUAboZkvQk=", + "dev": true, + "optional": true, + "requires": { + "glob": "7.1.2", + "lodash": "4.17.4", + "minimatch": "3.0.4" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "handle-thing": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-1.2.5.tgz", + "integrity": "sha1-/Xqtcmvxpf0W38KbL3pmAdJxOcQ=", + "dev": true + }, + "handlebars": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-1.3.0.tgz", + "integrity": "sha1-npsTCpPjiUkTItl1zz7BgYw3zjQ=", + "dev": true, + "requires": { + "optimist": "0.3.7", + "uglify-js": "2.3.6" + }, + "dependencies": { + "async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=", + "dev": true, + "optional": true + }, + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "dev": true, + "optional": true, + "requires": { + "amdefine": "1.0.1" + } + }, + "uglify-js": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.3.6.tgz", + "integrity": "sha1-+gmEdwtCi3qbKoBY9GNV0U/vIRo=", + "dev": true, + "optional": true, + "requires": { + "async": "0.2.10", + "optimist": "0.3.7", + "source-map": "0.1.43" + } + } + } + }, + "har-schema": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", + "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=", + "dev": true + }, + "har-validator": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", + "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", + "dev": true, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + }, + "dependencies": { + "ajv": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "dev": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + } + } + }, + "has": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "dev": true, + "requires": { + "function-bind": "1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-binary": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/has-binary/-/has-binary-0.1.7.tgz", + "integrity": "sha1-aOYesWIQyVRaClzOBqhzkS/h5ow=", + "dev": true, + "requires": { + "isarray": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, + "has-cors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", + "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=", + "dev": true + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true + }, + "hash-base": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", + "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=", + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" + } + }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "dev": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "1.1.3", + "minimalistic-assert": "1.0.0", + "minimalistic-crypto-utils": "1.0.1" + } + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "dev": true + }, + "homedir-polyfill": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", + "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", + "dev": true, + "requires": { + "parse-passwd": "1.0.0" + } + }, + "hosted-git-info": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", + "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", + "dev": true + }, + "hpack.js": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", + "integrity": "sha1-h3dMCUnlE/QuhFdbPEVoH63ioLI=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "obuf": "1.1.1", + "readable-stream": "2.3.3", + "wbuf": "1.7.2" + } + }, + "html-comment-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.1.tgz", + "integrity": "sha1-ZouTd26q5V696POtRkswekljYl4=", + "dev": true + }, + "html-entities": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.2.1.tgz", + "integrity": "sha1-DfKTUfByEWNRXfueVUPl9u7VFi8=", + "dev": true + }, + "html-minifier": { + "version": "3.5.6", + "resolved": "https://registry.npmjs.org/html-minifier/-/html-minifier-3.5.6.tgz", + "integrity": "sha512-88FjtKrlak2XjczhxrBomgzV4jmGzM3UnHRBScRkJcmcRum0kb+IwhVAETJ8AVp7j0p3xugjSaw9L+RmI5/QOA==", + "dev": true, + "requires": { + "camel-case": "3.0.0", + "clean-css": "4.1.9", + "commander": "2.11.0", + "he": "1.1.1", + "ncname": "1.0.0", + "param-case": "2.1.1", + "relateurl": "0.2.7", + "uglify-js": "3.1.8" + } + }, + "html-webpack-plugin": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-2.30.1.tgz", + "integrity": "sha1-f5xCG36pHsRg9WUn1430hO51N9U=", + "dev": true, + "requires": { + "bluebird": "3.5.1", + "html-minifier": "3.5.6", + "loader-utils": "0.2.17", + "lodash": "4.17.4", + "pretty-error": "2.1.1", + "toposort": "1.0.6" + }, + "dependencies": { + "loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "dev": true, + "requires": { + "big.js": "3.2.0", + "emojis-list": "2.1.0", + "json5": "0.5.1", + "object-assign": "4.1.1" + } + } + } + }, + "htmlparser2": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.3.0.tgz", + "integrity": "sha1-zHDQWln2VC5D8OaFyYLhTJJKnv4=", + "dev": true, + "requires": { + "domelementtype": "1.3.0", + "domhandler": "2.1.0", + "domutils": "1.1.6", + "readable-stream": "1.0.34" + }, + "dependencies": { + "domutils": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.1.6.tgz", + "integrity": "sha1-vdw94Jm5ou+sxRxiPyj0FuzFdIU=", + "dev": true, + "requires": { + "domelementtype": "1.3.0" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "http-deceiver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", + "integrity": "sha1-+nFolEq5pRnTN8sL7HKE3D5yPYc=", + "dev": true + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "dev": true, + "requires": { + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": "1.3.1" + }, + "dependencies": { + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=", + "dev": true + } + } + }, + "http-parser-js": { + "version": "0.4.9", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.9.tgz", + "integrity": "sha1-6hoE+2St/wJC6ZdPKX3Uw8rSceE=", + "dev": true + }, + "http-proxy": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.16.2.tgz", + "integrity": "sha1-Bt/ykpUr9k2+hHH6nfcwZtTzd0I=", + "dev": true, + "requires": { + "eventemitter3": "1.2.0", + "requires-port": "1.0.0" + } + }, + "http-proxy-middleware": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.17.4.tgz", + "integrity": "sha1-ZC6ISIUdZvCdTxJJEoRtuutBuDM=", + "dev": true, + "requires": { + "http-proxy": "1.16.2", + "is-glob": "3.1.0", + "lodash": "4.17.4", + "micromatch": "2.3.11" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "2.1.1" + } + } + } + }, + "http-signature": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "dev": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.1", + "sshpk": "1.13.1" + } + }, + "https-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-0.0.1.tgz", + "integrity": "sha1-P5E2XKvmC3ftDruiS0VOPgnZWoI=", + "dev": true + }, + "https-proxy-agent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-1.0.0.tgz", + "integrity": "sha1-NffabEjOTdv6JkiRrFk+5f+GceY=", + "dev": true, + "requires": { + "agent-base": "2.1.1", + "debug": "2.6.9", + "extend": "3.0.1" + } + }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" + }, + "icss-replace-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz", + "integrity": "sha1-Bupvg2ead0njhs/h/oEq5dsiPe0=", + "dev": true + }, + "icss-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-2.1.0.tgz", + "integrity": "sha1-g/Cg7DeL8yRheLbCrZE28TWxyWI=", + "dev": true, + "requires": { + "postcss": "6.0.14" + }, + "dependencies": { + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "postcss": { + "version": "6.0.14", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", + "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "dev": true, + "requires": { + "chalk": "2.3.0", + "source-map": "0.6.1", + "supports-color": "4.5.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "idtoken-verifier": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/idtoken-verifier/-/idtoken-verifier-1.1.0.tgz", + "integrity": "sha1-Gt0wElqj5eWFnRUrNWqQio4utaA=", + "requires": { + "base64-js": "1.2.1", + "crypto-js": "3.1.9-1", + "jsbn": "0.1.1", + "superagent": "3.8.1", + "url-join": "1.1.0" + } + }, + "ieee754": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", + "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=", + "dev": true + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", + "dev": true + }, + "image-size": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz", + "integrity": "sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=", + "dev": true, + "optional": true + }, + "img-stats": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/img-stats/-/img-stats-0.5.2.tgz", + "integrity": "sha1-wgNJbELy2esuWrgjL6dWurMsnis=", + "dev": true, + "requires": { + "xmldom": "0.1.27" + } + }, + "immutable": { + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-3.8.2.tgz", + "integrity": "sha1-wkOZUUVbs5kT2vKBN28VMOEErfM=" + }, + "import-local": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-0.1.1.tgz", + "integrity": "sha1-sReVcqrNwRxqkQCftDDbyrX2aKg=", + "dev": true, + "requires": { + "pkg-dir": "2.0.0", + "resolve-cwd": "2.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "in-publish": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz", + "integrity": "sha1-4g/146KvwmkDILbcVSaCqcf631E=", + "dev": true, + "optional": true + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "2.0.1" + } + }, + "indexes-of": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", + "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=", + "dev": true + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ini": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", + "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", + "dev": true + }, + "internal-ip": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/internal-ip/-/internal-ip-1.2.0.tgz", + "integrity": "sha1-rp+/k7mEh4eF1QqN4bNWlWBYz1w=", + "dev": true, + "requires": { + "meow": "3.7.0" + } + }, + "interpret": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.4.tgz", + "integrity": "sha1-ggzdWIuGj/sZGoCVBtbJyPISsbA=", + "dev": true + }, + "invariant": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", + "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=", + "dev": true, + "requires": { + "loose-envify": "1.3.1" + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "ip": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/ip/-/ip-1.1.5.tgz", + "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=", + "dev": true + }, + "ipaddr.js": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.5.2.tgz", + "integrity": "sha1-1LUFvemUaYfM8PxY2QEP+WB+P6A=", + "dev": true + }, + "is-absolute-url": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz", + "integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "1.10.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-callable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", + "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", + "dev": true + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "dev": true + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-glob": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "dev": true, + "requires": { + "is-extglob": "2.1.1" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", + "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "dev": true, + "requires": { + "is-path-inside": "1.0.0" + } + }, + "is-path-inside": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", + "integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838=", + "dev": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "3.0.1" + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "1.0.1" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-svg": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-svg/-/is-svg-2.1.0.tgz", + "integrity": "sha1-z2EJDaDZ77yrhyLeum8DIgjbsOk=", + "dev": true, + "requires": { + "html-comment-regex": "1.1.1" + } + }, + "is-symbol": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", + "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isbinaryfile": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-3.0.2.tgz", + "integrity": "sha1-Sj6XTsDLqQBNP8bN5yCeppNopiE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "isomorphic-fetch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", + "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", + "requires": { + "node-fetch": "1.7.3", + "whatwg-fetch": "2.0.3" + }, + "dependencies": { + "whatwg-fetch": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz", + "integrity": "sha1-nITsLc9oGH/wC8ZOEnS0QhduHIQ=" + } + } + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istanbul-api": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-1.2.1.tgz", + "integrity": "sha512-oFCwXvd65amgaPCzqrR+a2XjanS1MvpXN6l/MlMUTv6uiA1NOgGX+I0uyq8Lg3GDxsxPsaP1049krz3hIJ5+KA==", + "dev": true, + "requires": { + "async": "2.6.0", + "fileset": "2.0.3", + "istanbul-lib-coverage": "1.1.1", + "istanbul-lib-hook": "1.1.0", + "istanbul-lib-instrument": "1.9.1", + "istanbul-lib-report": "1.1.2", + "istanbul-lib-source-maps": "1.2.2", + "istanbul-reports": "1.1.3", + "js-yaml": "3.7.0", + "mkdirp": "0.5.1", + "once": "1.4.0" + } + }, + "istanbul-instrumenter-loader": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/istanbul-instrumenter-loader/-/istanbul-instrumenter-loader-2.0.0.tgz", + "integrity": "sha1-5UkpAKsLuoNe+oAkywC+mz7qJwA=", + "dev": true, + "requires": { + "convert-source-map": "1.5.0", + "istanbul-lib-instrument": "1.9.1", + "loader-utils": "0.2.17", + "object-assign": "4.1.1" + }, + "dependencies": { + "loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "dev": true, + "requires": { + "big.js": "3.2.0", + "emojis-list": "2.1.0", + "json5": "0.5.1", + "object-assign": "4.1.1" + } + } + } + }, + "istanbul-lib-coverage": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz", + "integrity": "sha512-0+1vDkmzxqJIn5rcoEqapSB4DmPxE31EtI2dF2aCkV5esN9EWHxZ0dwgDClivMXJqE7zaYQxq30hj5L0nlTN5Q==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-1.1.0.tgz", + "integrity": "sha512-U3qEgwVDUerZ0bt8cfl3dSP3S6opBoOtk3ROO5f2EfBr/SRiD9FQqzwaZBqFORu8W7O0EXpai+k7kxHK13beRg==", + "dev": true, + "requires": { + "append-transform": "0.4.0" + } + }, + "istanbul-lib-instrument": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-1.9.1.tgz", + "integrity": "sha512-RQmXeQ7sphar7k7O1wTNzVczF9igKpaeGQAG9qR2L+BS4DCJNTI9nytRmIVYevwO0bbq+2CXvJmYDuz0gMrywA==", + "dev": true, + "requires": { + "babel-generator": "6.26.0", + "babel-template": "6.26.0", + "babel-traverse": "6.26.0", + "babel-types": "6.26.0", + "babylon": "6.18.0", + "istanbul-lib-coverage": "1.1.1", + "semver": "5.4.1" + } + }, + "istanbul-lib-report": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-1.1.2.tgz", + "integrity": "sha512-UTv4VGx+HZivJQwAo1wnRwe1KTvFpfi/NYwN7DcsrdzMXwpRT/Yb6r4SBPoHWj4VuQPakR32g4PUUeyKkdDkBA==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "1.1.1", + "mkdirp": "0.5.1", + "path-parse": "1.0.5", + "supports-color": "3.2.3" + }, + "dependencies": { + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "1.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.2.tgz", + "integrity": "sha512-8BfdqSfEdtip7/wo1RnrvLpHVEd8zMZEDmOFEnpC6dg0vXflHt9nvoAyQUzig2uMSXfF2OBEYBV3CVjIL9JvaQ==", + "dev": true, + "requires": { + "debug": "3.1.0", + "istanbul-lib-coverage": "1.1.1", + "mkdirp": "0.5.1", + "rimraf": "2.6.2", + "source-map": "0.5.7" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "istanbul-reports": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-1.1.3.tgz", + "integrity": "sha512-ZEelkHh8hrZNI5xDaKwPMFwDsUf5wIEI2bXAFGp1e6deR2mnEKBPhLJEgr4ZBt8Gi6Mj38E/C8kcy9XLggVO2Q==", + "dev": true, + "requires": { + "handlebars": "4.0.11" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "optional": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "optional": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, + "optional": true + } + } + }, + "handlebars": { + "version": "4.0.11", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", + "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "dev": true, + "requires": { + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" + } + }, + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "0.0.10", + "wordwrap": "0.0.3" + } + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "optional": true, + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "optional": true + } + } + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } + } + }, + "jasmine": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-2.8.0.tgz", + "integrity": "sha1-awicChFXax8W3xG4AUbZHU6Lij4=", + "dev": true, + "requires": { + "exit": "0.1.2", + "glob": "7.1.2", + "jasmine-core": "2.8.0" + }, + "dependencies": { + "jasmine-core": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.8.0.tgz", + "integrity": "sha1-vMl5rh+f0FcB5F5S5l06XWPxok4=", + "dev": true + } + } + }, + "jasmine-core": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/jasmine-core/-/jasmine-core-2.6.4.tgz", + "integrity": "sha1-3skmzQqfoof7bbXHVfpIfnTOysU=", + "dev": true + }, + "jasmine-spec-reporter": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/jasmine-spec-reporter/-/jasmine-spec-reporter-4.1.1.tgz", + "integrity": "sha1-Wm1Yq11hvqcwn7wnkjlRF1axtYg=", + "dev": true, + "requires": { + "colors": "1.1.2" + } + }, + "jasminewd2": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/jasminewd2/-/jasminewd2-2.2.0.tgz", + "integrity": "sha1-43zwsX8ZnM4jvqcbIDk5Uka07E4=", + "dev": true + }, + "js-base64": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.3.2.tgz", + "integrity": "sha512-Y2/+DnfJJXT1/FCwUebUhLWb3QihxiSC42+ctHLGogmW2jPY6LCapMdFZXRvVP2z6qyKW7s6qncE/9gSqZiArw==", + "dev": true + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" + }, + "js-yaml": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.7.0.tgz", + "integrity": "sha1-XJZ93YN6m/3KXy3oQlOr6KHAO4A=", + "dev": true, + "requires": { + "argparse": "1.0.9", + "esprima": "2.7.3" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" + }, + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + }, + "json-loader": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/json-loader/-/json-loader-0.5.7.tgz", + "integrity": "sha512-QLPs8Dj7lnf3e3QYS1zkCo+4ZwqOiF9d/nZnYozTISxXWCfNs9yuky5rJw4/W34s7POaNlbZmQGaB5NiXCbP4w==", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "json3": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", + "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", + "dev": true + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11" + } + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsonp": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/jsonp/-/jsonp-0.2.1.tgz", + "integrity": "sha1-pltPoPEL2nGaBUQep7lMVfPhW64=", + "requires": { + "debug": "2.6.9" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "karma": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/karma/-/karma-1.7.1.tgz", + "integrity": "sha512-k5pBjHDhmkdaUccnC7gE3mBzZjcxyxYsYVaqiL2G5AqlfLyBO5nw2VdNK+O16cveEPd/gIOWULH7gkiYYwVNHg==", + "dev": true, + "requires": { + "bluebird": "3.5.1", + "body-parser": "1.18.2", + "chokidar": "1.7.0", + "colors": "1.1.2", + "combine-lists": "1.0.1", + "connect": "3.6.5", + "core-js": "2.5.1", + "di": "0.0.1", + "dom-serialize": "2.2.1", + "expand-braces": "0.1.2", + "glob": "7.1.2", + "graceful-fs": "4.1.11", + "http-proxy": "1.16.2", + "isbinaryfile": "3.0.2", + "lodash": "3.10.1", + "log4js": "0.6.38", + "mime": "1.4.1", + "minimatch": "3.0.4", + "optimist": "0.6.1", + "qjobs": "1.1.5", + "range-parser": "1.2.0", + "rimraf": "2.6.2", + "safe-buffer": "5.1.1", + "socket.io": "1.7.3", + "source-map": "0.5.7", + "tmp": "0.0.31", + "useragent": "2.2.1" + }, + "dependencies": { + "lodash": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", + "dev": true + }, + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "0.0.10", + "wordwrap": "0.0.3" + } + } + } + }, + "karma-chrome-launcher": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-2.1.1.tgz", + "integrity": "sha1-IWh5xorATY1RQOmWGboEtZr9Rs8=", + "dev": true, + "requires": { + "fs-access": "1.0.1", + "which": "1.3.0" + } + }, + "karma-cli": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/karma-cli/-/karma-cli-1.0.1.tgz", + "integrity": "sha1-rmw8WKMTodALRRZMRVubhs4X+WA=", + "dev": true, + "requires": { + "resolve": "1.5.0" + } + }, + "karma-coverage-istanbul-reporter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/karma-coverage-istanbul-reporter/-/karma-coverage-istanbul-reporter-1.3.0.tgz", + "integrity": "sha1-0ULNnFVzHJ42Pvc3To7xoxvr+ts=", + "dev": true, + "requires": { + "istanbul-api": "1.2.1", + "minimatch": "3.0.4" + } + }, + "karma-jasmine": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/karma-jasmine/-/karma-jasmine-1.1.0.tgz", + "integrity": "sha1-IuTAa/mhguUpTR9wXjczgRuBCs8=", + "dev": true + }, + "karma-jasmine-html-reporter": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/karma-jasmine-html-reporter/-/karma-jasmine-html-reporter-0.2.2.tgz", + "integrity": "sha1-SKjl7xiAdhfuK14zwRlMNbQ5Ukw=", + "dev": true, + "requires": { + "karma-jasmine": "1.1.0" + } + }, + "karma-source-map-support": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/karma-source-map-support/-/karma-source-map-support-1.2.0.tgz", + "integrity": "sha1-G/gee7SwiWJ6s1LsQXnhF8QGpUA=", + "dev": true, + "requires": { + "source-map-support": "0.4.18" + } + }, + "killable": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.0.tgz", + "integrity": "sha1-2ouEvUfeU5WHj5XWTQLyRJ/gXms=", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + }, + "lazy-cache": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-0.2.7.tgz", + "integrity": "sha1-f+3fLctu23fRHvHRF6tf/fCrG2U=", + "dev": true + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "1.0.0" + } + }, + "less": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/less/-/less-2.7.3.tgz", + "integrity": "sha512-KPdIJKWcEAb02TuJtaLrhue0krtRLoRoo7x6BNJIBelO00t/CCdJQUnHW5V34OnHMWzIktSalJxRO+FvytQlCQ==", + "dev": true, + "requires": { + "errno": "0.1.4", + "graceful-fs": "4.1.11", + "image-size": "0.5.5", + "mime": "1.4.1", + "mkdirp": "0.5.1", + "promise": "7.3.1", + "request": "2.81.0", + "source-map": "0.5.7" + } + }, + "less-loader": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/less-loader/-/less-loader-4.0.5.tgz", + "integrity": "sha1-rhVadAbKxqzSk9eFWH/P8PR4xN0=", + "dev": true, + "requires": { + "clone": "2.1.1", + "loader-utils": "1.1.0", + "pify": "2.3.0" + }, + "dependencies": { + "clone": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz", + "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=", + "dev": true + } + } + }, + "license-webpack-plugin": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/license-webpack-plugin/-/license-webpack-plugin-1.1.1.tgz", + "integrity": "sha512-TjKOyiC0exqd4Idy/4M8/DETR22dXBZks387DuS5LbslxHiMRXGx/Q2F/j9IUtvEoH5uFvt72vRgk/G6f8j3Dg==", + "dev": true, + "requires": { + "ejs": "2.5.7" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" + } + }, + "loader-runner": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.0.tgz", + "integrity": "sha1-9IKuqC1UPgeSFwDVpG7yb9rGuKI=", + "dev": true + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "dev": true, + "requires": { + "big.js": "3.2.0", + "emojis-list": "2.1.0", + "json5": "0.5.1" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "lodash": { + "version": "4.17.4", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", + "dev": true + }, + "lodash.assign": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", + "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", + "dev": true, + "optional": true + }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", + "dev": true + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", + "dev": true + }, + "lodash.mergewith": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.0.tgz", + "integrity": "sha1-FQzwoWeR9ZA7iJHqsVRgknS96lU=", + "dev": true, + "optional": true + }, + "lodash.tail": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.tail/-/lodash.tail-4.1.1.tgz", + "integrity": "sha1-0jM6NtnncXyK0vfKyv7HwytERmQ=", + "dev": true + }, + "lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", + "dev": true + }, + "log4js": { + "version": "0.6.38", + "resolved": "https://registry.npmjs.org/log4js/-/log4js-0.6.38.tgz", + "integrity": "sha1-LElBFmldb7JUgJQ9P8hy5mKlIv0=", + "dev": true, + "requires": { + "readable-stream": "1.0.34", + "semver": "4.3.6" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "semver": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", + "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=", + "dev": true + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "loglevel": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.5.1.tgz", + "integrity": "sha1-GJB4yUq5BT7iFaCs2/JCROoPZQI=", + "dev": true + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "loose-envify": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", + "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", + "requires": { + "js-tokens": "3.0.2" + } + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "0.4.1", + "signal-exit": "3.0.2" + } + }, + "lower-case": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", + "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=", + "dev": true + }, + "lru-cache": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.1.tgz", + "integrity": "sha512-q4spe4KTfsAS1SUHLO0wz8Qiyf1+vMIAgpRYioFYDMNqKfHQbg+AVDH3i4fvpl71/P1L0dBl+fQi+P37UYf0ew==", + "dev": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "macaddress": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/macaddress/-/macaddress-0.2.8.tgz", + "integrity": "sha1-WQTcU3w57G2+/q6QIycTX6hRHxI=", + "dev": true + }, + "magic-string": { + "version": "0.22.4", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.4.tgz", + "integrity": "sha512-kxBL06p6iO2qPBHsqGK2b3cRwiRGpnmSuVWNhwHcMX7qJOUr1HvricYP1LZOCdkQBUp0jiWg2d6WJwR3vYgByw==", + "dev": true, + "requires": { + "vlq": "0.2.3" + } + }, + "make-dir": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.1.0.tgz", + "integrity": "sha512-0Pkui4wLJ7rxvmfUvs87skoEaxmu0hCUApF8nonzpl7q//FWp9zu8W61Scz4sd/kUiqDxvUhtoam2efDyiBzcA==", + "dev": true, + "requires": { + "pify": "3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "make-error": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.0.tgz", + "integrity": "sha1-Uq06M5zPEM5itAQLcI/nByRLi5Y=", + "dev": true + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "math-expression-evaluator": { + "version": "1.2.17", + "resolved": "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz", + "integrity": "sha1-3oGf282E3M2PrlnGrreWFbnSZqw=", + "dev": true + }, + "md5": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz", + "integrity": "sha1-U6s41f48iJG6RlMp6iP6wFQBJvk=", + "dev": true, + "requires": { + "charenc": "0.0.2", + "crypt": "0.0.2", + "is-buffer": "1.1.6" + } + }, + "md5.js": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", + "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", + "dev": true, + "requires": { + "hash-base": "3.0.4", + "inherits": "2.0.3" + }, + "dependencies": { + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + } + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "dev": true + }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "dev": true, + "requires": { + "mimic-fn": "1.1.0" + } + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "requires": { + "errno": "0.1.4", + "readable-stream": "2.3.3" + } + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "2.1.0", + "decamelize": "1.2.0", + "loud-rejection": "1.6.0", + "map-obj": "1.0.1", + "minimist": "1.2.0", + "normalize-package-data": "2.4.0", + "object-assign": "4.1.1", + "read-pkg-up": "1.0.1", + "redent": "1.0.0", + "trim-newlines": "1.0.0" + } + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=", + "dev": true + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.4" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + } + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0" + } + }, + "mime": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" + }, + "mime-db": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", + "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=" + }, + "mime-types": { + "version": "2.1.17", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", + "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", + "requires": { + "mime-db": "1.30.0" + } + }, + "mimic-fn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.1.0.tgz", + "integrity": "sha1-5md4PZLonb00KBi1IwudYqZyrRg=", + "dev": true + }, + "minimalistic-assert": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", + "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mississippi": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-1.3.0.tgz", + "integrity": "sha1-0gFYPrEjJ+PFwWQqQEqcrPlONPU=", + "dev": true, + "requires": { + "concat-stream": "1.6.0", + "duplexify": "3.5.1", + "end-of-stream": "1.4.0", + "flush-write-stream": "1.0.2", + "from2": "2.3.0", + "parallel-transform": "1.1.0", + "pump": "1.0.2", + "pumpify": "1.3.5", + "stream-each": "1.2.2", + "through2": "2.0.3" + } + }, + "mixin-object": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mixin-object/-/mixin-object-2.0.1.tgz", + "integrity": "sha1-T7lJRB2rGCVA8f4DW6YOGUel5X4=", + "dev": true, + "requires": { + "for-in": "0.1.8", + "is-extendable": "0.1.1" + }, + "dependencies": { + "for-in": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.8.tgz", + "integrity": "sha1-2Hc5COMSVhCZUrH9ubP6hn0ndeE=", + "dev": true + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "dev": true, + "requires": { + "aproba": "1.2.0", + "copy-concurrently": "1.0.5", + "fs-write-stream-atomic": "1.0.10", + "mkdirp": "0.5.1", + "rimraf": "2.6.2", + "run-queue": "1.0.3" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "multicast-dns": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/multicast-dns/-/multicast-dns-6.1.1.tgz", + "integrity": "sha1-bn3oalcIcqsXBYrepxYLvsqBTd4=", + "dev": true, + "requires": { + "dns-packet": "1.2.2", + "thunky": "0.1.0" + } + }, + "multicast-dns-service-types": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz", + "integrity": "sha1-iZ8R2WhuXgXLkbNdXw5jt3PPyQE=", + "dev": true + }, + "nan": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.7.0.tgz", + "integrity": "sha1-2Vv3IeyHfgjbJ27T/G63j5CDrUY=", + "dev": true, + "optional": true + }, + "ncname": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ncname/-/ncname-1.0.0.tgz", + "integrity": "sha1-W1etGLHKCShk72Kwse2BlPODtxw=", + "dev": true, + "requires": { + "xml-char-classes": "1.0.0" + } + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", + "dev": true + }, + "no-case": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", + "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", + "dev": true, + "requires": { + "lower-case": "1.1.4" + } + }, + "node-dir": { + "version": "0.1.17", + "resolved": "https://registry.npmjs.org/node-dir/-/node-dir-0.1.17.tgz", + "integrity": "sha1-X1Zl2TNRM1yqvvjxxVRRbPXx5OU=", + "dev": true, + "requires": { + "minimatch": "3.0.4" + } + }, + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "requires": { + "encoding": "0.1.12", + "is-stream": "1.1.0" + } + }, + "node-forge": { + "version": "0.6.33", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.6.33.tgz", + "integrity": "sha1-RjgRh59XPUUVWtap9D3ClujoXrw=", + "dev": true + }, + "node-gyp": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.6.2.tgz", + "integrity": "sha1-m/vlRWIoYoSDjnUOrAUpWFP6HGA=", + "dev": true, + "optional": true, + "requires": { + "fstream": "1.0.11", + "glob": "7.1.2", + "graceful-fs": "4.1.11", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "nopt": "3.0.6", + "npmlog": "4.1.2", + "osenv": "0.1.4", + "request": "2.81.0", + "rimraf": "2.6.2", + "semver": "5.3.0", + "tar": "2.2.1", + "which": "1.3.0" + }, + "dependencies": { + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "optional": true, + "requires": { + "abbrev": "1.1.1" + } + }, + "semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "dev": true, + "optional": true + } + } + }, + "node-libs-browser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.0.0.tgz", + "integrity": "sha1-o6WeyXAkmFtG6Vg3lkb5bEthZkY=", + "dev": true, + "requires": { + "assert": "1.4.1", + "browserify-zlib": "0.1.4", + "buffer": "4.9.1", + "console-browserify": "1.1.0", + "constants-browserify": "1.0.0", + "crypto-browserify": "3.12.0", + "domain-browser": "1.1.7", + "events": "1.1.1", + "https-browserify": "0.0.1", + "os-browserify": "0.2.1", + "path-browserify": "0.0.0", + "process": "0.11.10", + "punycode": "1.4.1", + "querystring-es3": "0.2.1", + "readable-stream": "2.3.3", + "stream-browserify": "2.0.1", + "stream-http": "2.7.2", + "string_decoder": "0.10.31", + "timers-browserify": "2.0.4", + "tty-browserify": "0.0.0", + "url": "0.11.0", + "util": "0.10.3", + "vm-browserify": "0.0.4" + }, + "dependencies": { + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "node-modules-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/node-modules-path/-/node-modules-path-1.0.1.tgz", + "integrity": "sha1-QAlrCM560OoUaAhjr0ScfHWl0cg=", + "dev": true + }, + "node-sass": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.6.0.tgz", + "integrity": "sha512-rh0CvkxpYdQdbWx4EQfunmG0+99BVyVwQHlFE+yUzc6lteF5K3WUcJ0bdmv9E9CqQA1RfuMyvmpDP99cmBObow==", + "dev": true, + "optional": true, + "requires": { + "async-foreach": "0.1.3", + "chalk": "1.1.3", + "cross-spawn": "3.0.1", + "gaze": "1.1.2", + "get-stdin": "4.0.1", + "glob": "7.1.2", + "in-publish": "2.0.0", + "lodash.assign": "4.2.0", + "lodash.clonedeep": "4.5.0", + "lodash.mergewith": "4.6.0", + "meow": "3.7.0", + "mkdirp": "0.5.1", + "nan": "2.7.0", + "node-gyp": "3.6.2", + "npmlog": "4.1.2", + "request": "2.81.0", + "sass-graph": "2.2.4", + "stdout-stream": "1.4.0" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true, + "optional": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "optional": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true, + "optional": true + } + } + }, + "nopt": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "dev": true, + "requires": { + "abbrev": "1.1.1", + "osenv": "0.1.4" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "2.5.0", + "is-builtin-module": "1.0.0", + "semver": "5.4.1", + "validate-npm-package-license": "3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "1.1.0" + } + }, + "normalize-range": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", + "integrity": "sha1-LRDAa9/TEuqXd2laTShDlFa3WUI=", + "dev": true + }, + "normalize-url": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-1.9.1.tgz", + "integrity": "sha1-LMDWazHqIwNkWENuNiDYWVTGbDw=", + "dev": true, + "requires": { + "object-assign": "4.1.1", + "prepend-http": "1.0.4", + "query-string": "4.3.4", + "sort-keys": "1.1.2" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "2.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "nth-check": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-1.0.1.tgz", + "integrity": "sha1-mSms32KPwsQQmN6rgqxYDPFJquQ=", + "dev": true, + "requires": { + "boolbase": "1.0.0" + } + }, + "null-check": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/null-check/-/null-check-1.0.0.tgz", + "integrity": "sha1-l33/1xdgErnsMNKjnbXPcqBDnt0=", + "dev": true + }, + "num2fraction": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", + "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=", + "dev": true + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "object-component": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", + "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=", + "dev": true + }, + "object-keys": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", + "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", + "dev": true + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "0.1.5", + "is-extendable": "0.1.1" + }, + "dependencies": { + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "1.0.2" + } + } + } + }, + "obuf": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.1.tgz", + "integrity": "sha1-EEEktsYCxnlogaBCVB0220OlJk4=", + "dev": true + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "on-headers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", + "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "opn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/opn/-/opn-5.1.0.tgz", + "integrity": "sha512-iPNl7SyM8L30Rm1sjGdLLheyHVw5YXVfi3SKWJzBI7efxRwHojfRFjwE/OLM6qp9xJYMgab8WicTU1cPoY+Hpg==", + "dev": true, + "requires": { + "is-wsl": "1.1.0" + } + }, + "optimist": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz", + "integrity": "sha1-yQlBrVnkJzMokjB00s8ufLxuwNk=", + "dev": true, + "requires": { + "wordwrap": "0.0.3" + } + }, + "options": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", + "integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=", + "dev": true + }, + "original": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/original/-/original-1.0.0.tgz", + "integrity": "sha1-kUf5P6FpbQS+YeAb1QuurKZWvTs=", + "dev": true, + "requires": { + "url-parse": "1.0.5" + }, + "dependencies": { + "url-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.0.5.tgz", + "integrity": "sha1-CFSGBCKv3P7+tsllxmLUgAFpkns=", + "dev": true, + "requires": { + "querystringify": "0.0.4", + "requires-port": "1.0.0" + } + } + } + }, + "os-browserify": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.2.1.tgz", + "integrity": "sha1-Y/xMzuXS13Y9Jrv4YBB45sLgBE8=", + "dev": true + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "osenv": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", + "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=", + "dev": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-limit": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.1.0.tgz", + "integrity": "sha1-sH/y2aXYi+yAYDWJWiurZqJ5iLw=", + "dev": true + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "1.1.0" + } + }, + "p-map": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-1.2.0.tgz", + "integrity": "sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==", + "dev": true + }, + "pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "dev": true + }, + "parallel-transform": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", + "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", + "dev": true, + "requires": { + "cyclist": "0.2.2", + "inherits": "2.0.3", + "readable-stream": "2.3.3" + } + }, + "param-case": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", + "integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=", + "dev": true, + "requires": { + "no-case": "2.3.2" + } + }, + "parse-asn1": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz", + "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=", + "dev": true, + "requires": { + "asn1.js": "4.9.2", + "browserify-aes": "1.1.1", + "create-hash": "1.1.3", + "evp_bytestokey": "1.0.3", + "pbkdf2": "3.0.14" + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "0.3.0", + "is-dotfile": "1.0.3", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" + }, + "dependencies": { + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + } + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "1.3.1" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, + "parsejson": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz", + "integrity": "sha1-q343WfIJ7OmUN5c/fQ8fZK4OZKs=", + "dev": true, + "requires": { + "better-assert": "1.0.2" + } + }, + "parseqs": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", + "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", + "dev": true, + "requires": { + "better-assert": "1.0.2" + } + }, + "parseuri": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", + "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", + "dev": true, + "requires": { + "better-assert": "1.0.2" + } + }, + "parseurl": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", + "dev": true + }, + "password-sheriff": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/password-sheriff/-/password-sheriff-1.1.0.tgz", + "integrity": "sha1-/bPD2EWgo8kt5CKyrZNGzginFBM=" + }, + "path-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", + "dev": true + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "2.0.1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "pbkdf2": { + "version": "3.0.14", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.14.tgz", + "integrity": "sha512-gjsZW9O34fm0R7PaLHRJmLLVfSoesxztjPjE9o6R+qtVJij90ltg1joIovN9GKrRW3t1PzhDDG3UMEMFfZ+1wA==", + "dev": true, + "requires": { + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "ripemd160": "2.0.1", + "safe-buffer": "5.1.1", + "sha.js": "2.4.9" + } + }, + "performance-now": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", + "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "2.1.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + } + } + }, + "portfinder": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.13.tgz", + "integrity": "sha1-uzLs2HwnEErm7kS1o8y/Drsa7ek=", + "dev": true, + "requires": { + "async": "1.5.2", + "debug": "2.6.9", + "mkdirp": "0.5.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + } + } + }, + "postcss": { + "version": "5.2.18", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-5.2.18.tgz", + "integrity": "sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==", + "dev": true, + "requires": { + "chalk": "1.1.3", + "js-base64": "2.3.2", + "source-map": "0.5.7", + "supports-color": "3.2.3" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + }, + "dependencies": { + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + } + } + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "1.0.0" + } + } + } + }, + "postcss-calc": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-5.3.1.tgz", + "integrity": "sha1-d7rnypKK2FcW4v2kLyYb98HWW14=", + "dev": true, + "requires": { + "postcss": "5.2.18", + "postcss-message-helpers": "2.0.0", + "reduce-css-calc": "1.3.0" + } + }, + "postcss-colormin": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/postcss-colormin/-/postcss-colormin-2.2.2.tgz", + "integrity": "sha1-ZjFBfV8OkJo9fsJrJMio0eT5bks=", + "dev": true, + "requires": { + "colormin": "1.1.2", + "postcss": "5.2.18", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-convert-values": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/postcss-convert-values/-/postcss-convert-values-2.6.1.tgz", + "integrity": "sha1-u9hZPFwf0uPRwyK7kl3K6Nrk1i0=", + "dev": true, + "requires": { + "postcss": "5.2.18", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-custom-properties": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/postcss-custom-properties/-/postcss-custom-properties-6.2.0.tgz", + "integrity": "sha512-eNR2h9T9ciKMoQEORrPjH33XeN/nuvVuxArOKmHtsFbGbNss631tgTrKou3/pmjAZbA4QQkhLIkPQkIk3WW+8w==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "postcss": "6.0.14" + }, + "dependencies": { + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "postcss": { + "version": "6.0.14", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", + "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "dev": true, + "requires": { + "chalk": "2.3.0", + "source-map": "0.6.1", + "supports-color": "4.5.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-discard-comments": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/postcss-discard-comments/-/postcss-discard-comments-2.0.4.tgz", + "integrity": "sha1-vv6J+v1bPazlzM5Rt2uBUUvgDj0=", + "dev": true, + "requires": { + "postcss": "5.2.18" + } + }, + "postcss-discard-duplicates": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/postcss-discard-duplicates/-/postcss-discard-duplicates-2.1.0.tgz", + "integrity": "sha1-uavye4isGIFYpesSq8riAmO5GTI=", + "dev": true, + "requires": { + "postcss": "5.2.18" + } + }, + "postcss-discard-empty": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/postcss-discard-empty/-/postcss-discard-empty-2.1.0.tgz", + "integrity": "sha1-0rS9nVztXr2Nyt52QMfXzX9PkrU=", + "dev": true, + "requires": { + "postcss": "5.2.18" + } + }, + "postcss-discard-overridden": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/postcss-discard-overridden/-/postcss-discard-overridden-0.1.1.tgz", + "integrity": "sha1-ix6vVU9ob7KIzYdMVWZ7CqNmjVg=", + "dev": true, + "requires": { + "postcss": "5.2.18" + } + }, + "postcss-discard-unused": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/postcss-discard-unused/-/postcss-discard-unused-2.2.3.tgz", + "integrity": "sha1-vOMLLMWR/8Y0Mitfs0ZLbZNPRDM=", + "dev": true, + "requires": { + "postcss": "5.2.18", + "uniqs": "2.0.0" + } + }, + "postcss-filter-plugins": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/postcss-filter-plugins/-/postcss-filter-plugins-2.0.2.tgz", + "integrity": "sha1-bYWGJTTXNaxCDkqFgG4fXUKG2Ew=", + "dev": true, + "requires": { + "postcss": "5.2.18", + "uniqid": "4.1.1" + } + }, + "postcss-load-config": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-1.2.0.tgz", + "integrity": "sha1-U56a/J3chiASHr+djDZz4M5Q0oo=", + "dev": true, + "requires": { + "cosmiconfig": "2.2.2", + "object-assign": "4.1.1", + "postcss-load-options": "1.2.0", + "postcss-load-plugins": "2.3.0" + } + }, + "postcss-load-options": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postcss-load-options/-/postcss-load-options-1.2.0.tgz", + "integrity": "sha1-sJixVZ3awt8EvAuzdfmaXP4rbYw=", + "dev": true, + "requires": { + "cosmiconfig": "2.2.2", + "object-assign": "4.1.1" + } + }, + "postcss-load-plugins": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/postcss-load-plugins/-/postcss-load-plugins-2.3.0.tgz", + "integrity": "sha1-dFdoEWWZrKLwCfrUJrABdQSdjZI=", + "dev": true, + "requires": { + "cosmiconfig": "2.2.2", + "object-assign": "4.1.1" + } + }, + "postcss-loader": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/postcss-loader/-/postcss-loader-1.3.3.tgz", + "integrity": "sha1-piHqH6KQYqg5cqRvVEhncTAZFus=", + "dev": true, + "requires": { + "loader-utils": "1.1.0", + "object-assign": "4.1.1", + "postcss": "5.2.18", + "postcss-load-config": "1.2.0" + } + }, + "postcss-merge-idents": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/postcss-merge-idents/-/postcss-merge-idents-2.1.7.tgz", + "integrity": "sha1-TFUwMTwI4dWzu/PSu8dH4njuonA=", + "dev": true, + "requires": { + "has": "1.0.1", + "postcss": "5.2.18", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-merge-longhand": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/postcss-merge-longhand/-/postcss-merge-longhand-2.0.2.tgz", + "integrity": "sha1-I9kM0Sewp3mUkVMyc5A0oaTz1lg=", + "dev": true, + "requires": { + "postcss": "5.2.18" + } + }, + "postcss-merge-rules": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/postcss-merge-rules/-/postcss-merge-rules-2.1.2.tgz", + "integrity": "sha1-0d9d+qexrMO+VT8OnhDofGG19yE=", + "dev": true, + "requires": { + "browserslist": "1.7.7", + "caniuse-api": "1.6.1", + "postcss": "5.2.18", + "postcss-selector-parser": "2.2.3", + "vendors": "1.0.1" + } + }, + "postcss-message-helpers": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/postcss-message-helpers/-/postcss-message-helpers-2.0.0.tgz", + "integrity": "sha1-pPL0+rbk/gAvCu0ABHjN9S+bpg4=", + "dev": true + }, + "postcss-minify-font-values": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/postcss-minify-font-values/-/postcss-minify-font-values-1.0.5.tgz", + "integrity": "sha1-S1jttWZB66fIR0qzUmyv17vey2k=", + "dev": true, + "requires": { + "object-assign": "4.1.1", + "postcss": "5.2.18", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-minify-gradients": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/postcss-minify-gradients/-/postcss-minify-gradients-1.0.5.tgz", + "integrity": "sha1-Xb2hE3NwP4PPtKPqOIHY11/15uE=", + "dev": true, + "requires": { + "postcss": "5.2.18", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-minify-params": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-1.2.2.tgz", + "integrity": "sha1-rSzgcTc7lDs9kwo/pZo1jCjW8fM=", + "dev": true, + "requires": { + "alphanum-sort": "1.0.2", + "postcss": "5.2.18", + "postcss-value-parser": "3.3.0", + "uniqs": "2.0.0" + } + }, + "postcss-minify-selectors": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/postcss-minify-selectors/-/postcss-minify-selectors-2.1.1.tgz", + "integrity": "sha1-ssapjAByz5G5MtGkllCBFDEXNb8=", + "dev": true, + "requires": { + "alphanum-sort": "1.0.2", + "has": "1.0.1", + "postcss": "5.2.18", + "postcss-selector-parser": "2.2.3" + } + }, + "postcss-modules-extract-imports": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.1.0.tgz", + "integrity": "sha1-thTJcgvmgW6u41+zpfqh26agXds=", + "dev": true, + "requires": { + "postcss": "6.0.14" + }, + "dependencies": { + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "postcss": { + "version": "6.0.14", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", + "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "dev": true, + "requires": { + "chalk": "2.3.0", + "source-map": "0.6.1", + "supports-color": "4.5.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-modules-local-by-default": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-1.2.0.tgz", + "integrity": "sha1-99gMOYxaOT+nlkRmvRlQCn1hwGk=", + "dev": true, + "requires": { + "css-selector-tokenizer": "0.7.0", + "postcss": "6.0.14" + }, + "dependencies": { + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "postcss": { + "version": "6.0.14", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", + "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "dev": true, + "requires": { + "chalk": "2.3.0", + "source-map": "0.6.1", + "supports-color": "4.5.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-modules-scope": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-1.1.0.tgz", + "integrity": "sha1-1upkmUx5+XtipytCb75gVqGUu5A=", + "dev": true, + "requires": { + "css-selector-tokenizer": "0.7.0", + "postcss": "6.0.14" + }, + "dependencies": { + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "postcss": { + "version": "6.0.14", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", + "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "dev": true, + "requires": { + "chalk": "2.3.0", + "source-map": "0.6.1", + "supports-color": "4.5.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-modules-values": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-1.3.0.tgz", + "integrity": "sha1-7P+p1+GSUYOJ9CrQ6D9yrsRW6iA=", + "dev": true, + "requires": { + "icss-replace-symbols": "1.1.0", + "postcss": "6.0.14" + }, + "dependencies": { + "chalk": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", + "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.5.0" + } + }, + "postcss": { + "version": "6.0.14", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.14.tgz", + "integrity": "sha512-NJ1z0f+1offCgadPhz+DvGm5Mkci+mmV5BqD13S992o0Xk9eElxUfPPF+t2ksH5R/17gz4xVK8KWocUQ5o3Rog==", + "dev": true, + "requires": { + "chalk": "2.3.0", + "source-map": "0.6.1", + "supports-color": "4.5.0" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "postcss-normalize-charset": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/postcss-normalize-charset/-/postcss-normalize-charset-1.1.1.tgz", + "integrity": "sha1-757nEhLX/nWceO0WL2HtYrXLk/E=", + "dev": true, + "requires": { + "postcss": "5.2.18" + } + }, + "postcss-normalize-url": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/postcss-normalize-url/-/postcss-normalize-url-3.0.8.tgz", + "integrity": "sha1-EI90s/L82viRov+j6kWSJ5/HgiI=", + "dev": true, + "requires": { + "is-absolute-url": "2.1.0", + "normalize-url": "1.9.1", + "postcss": "5.2.18", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-ordered-values": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-2.2.3.tgz", + "integrity": "sha1-7sbCpntsQSqNsgQud/6NpD+VwR0=", + "dev": true, + "requires": { + "postcss": "5.2.18", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-reduce-idents": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/postcss-reduce-idents/-/postcss-reduce-idents-2.4.0.tgz", + "integrity": "sha1-wsbSDMlYKE9qv75j92Cb9AkFmtM=", + "dev": true, + "requires": { + "postcss": "5.2.18", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-reduce-initial": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-1.0.1.tgz", + "integrity": "sha1-aPgGlfBF0IJjqHmtJA343WT2ROo=", + "dev": true, + "requires": { + "postcss": "5.2.18" + } + }, + "postcss-reduce-transforms": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-1.0.4.tgz", + "integrity": "sha1-/3b02CEkN7McKYpC0uFEQCV3GuE=", + "dev": true, + "requires": { + "has": "1.0.1", + "postcss": "5.2.18", + "postcss-value-parser": "3.3.0" + } + }, + "postcss-selector-parser": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-2.2.3.tgz", + "integrity": "sha1-+UN3iGBsPJrO4W/+jYsWKX8nu5A=", + "dev": true, + "requires": { + "flatten": "1.0.2", + "indexes-of": "1.0.1", + "uniq": "1.0.1" + } + }, + "postcss-svgo": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/postcss-svgo/-/postcss-svgo-2.1.6.tgz", + "integrity": "sha1-tt8YqmE7Zm4TPwittSGcJoSsEI0=", + "dev": true, + "requires": { + "is-svg": "2.1.0", + "postcss": "5.2.18", + "postcss-value-parser": "3.3.0", + "svgo": "0.7.2" + } + }, + "postcss-unique-selectors": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-2.0.2.tgz", + "integrity": "sha1-mB1X0p3csz57Hf4f1DuGSfkzyh0=", + "dev": true, + "requires": { + "alphanum-sort": "1.0.2", + "postcss": "5.2.18", + "uniqs": "2.0.0" + } + }, + "postcss-url": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/postcss-url/-/postcss-url-5.1.2.tgz", + "integrity": "sha1-mLMWW+jVkkccsMqt3iwNH4MvEz4=", + "dev": true, + "requires": { + "directory-encoder": "0.7.2", + "js-base64": "2.3.2", + "mime": "1.4.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "path-is-absolute": "1.0.1", + "postcss": "5.2.18" + } + }, + "postcss-value-parser": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz", + "integrity": "sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU=", + "dev": true + }, + "postcss-zindex": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/postcss-zindex/-/postcss-zindex-2.2.0.tgz", + "integrity": "sha1-0hCd3AVbka9n/EyzsCWUZjnSryI=", + "dev": true, + "requires": { + "has": "1.0.1", + "postcss": "5.2.18", + "uniqs": "2.0.0" + } + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "pretty-error": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-2.1.1.tgz", + "integrity": "sha1-X0+HyPkeWuPzuoerTPXgOxoX8aM=", + "dev": true, + "requires": { + "renderkid": "2.0.1", + "utila": "0.4.0" + } + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" + }, + "promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "requires": { + "asap": "2.0.6" + } + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "prop-types": { + "version": "15.6.0", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.0.tgz", + "integrity": "sha1-zq8IMCL8RrSjX2nhPvda7Q1jmFY=", + "requires": { + "fbjs": "0.8.16", + "loose-envify": "1.3.1", + "object-assign": "4.1.1" + }, + "dependencies": { + "core-js": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=" + }, + "fbjs": { + "version": "0.8.16", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.16.tgz", + "integrity": "sha1-XmdDL1UNxBtXK/VYR7ispk5TN9s=", + "requires": { + "core-js": "1.2.7", + "isomorphic-fetch": "2.2.1", + "loose-envify": "1.3.1", + "object-assign": "4.1.1", + "promise": "7.3.1", + "setimmediate": "1.0.5", + "ua-parser-js": "0.7.17" + } + } + } + }, + "protractor": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/protractor/-/protractor-5.1.2.tgz", + "integrity": "sha1-myIXQXCaTGLVzVPGqt1UpxE36V8=", + "dev": true, + "requires": { + "@types/node": "6.0.90", + "@types/q": "0.0.32", + "@types/selenium-webdriver": "2.53.43", + "blocking-proxy": "0.0.5", + "chalk": "1.1.3", + "glob": "7.1.2", + "jasmine": "2.8.0", + "jasminewd2": "2.2.0", + "optimist": "0.6.1", + "q": "1.4.1", + "saucelabs": "1.3.0", + "selenium-webdriver": "3.0.1", + "source-map-support": "0.4.18", + "webdriver-js-extender": "1.0.0", + "webdriver-manager": "12.0.6" + }, + "dependencies": { + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.0", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.2" + } + }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "0.0.10", + "wordwrap": "0.0.3" + } + }, + "q": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.4.1.tgz", + "integrity": "sha1-VXBbzZPF82c1MMLCy8DCs63cKG4=", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "webdriver-manager": { + "version": "12.0.6", + "resolved": "https://registry.npmjs.org/webdriver-manager/-/webdriver-manager-12.0.6.tgz", + "integrity": "sha1-PfGkgZdwELTL+MnYXHpXeCjA5ws=", + "dev": true, + "requires": { + "adm-zip": "0.4.7", + "chalk": "1.1.3", + "del": "2.2.2", + "glob": "7.1.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "q": "1.4.1", + "request": "2.81.0", + "rimraf": "2.6.2", + "semver": "5.4.1", + "xml2js": "0.4.19" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + } + } + }, + "proxy-addr": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.2.tgz", + "integrity": "sha1-ZXFQT0e7mI7IGAJT+F3X4UlSvew=", + "dev": true, + "requires": { + "forwarded": "0.1.2", + "ipaddr.js": "1.5.2" + } + }, + "prr": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/prr/-/prr-0.0.0.tgz", + "integrity": "sha1-GoS4WQgyVQFBGFPQCB7j+obikmo=", + "dev": true + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "public-encrypt": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", + "integrity": "sha1-OfaZ86RlYN1eusvKaTyvfGXBjMY=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.1.3", + "parse-asn1": "5.1.0", + "randombytes": "2.0.5" + } + }, + "pump": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.2.tgz", + "integrity": "sha1-Oz7mUS+U8OV1U4wXmV+fFpkKXVE=", + "dev": true, + "requires": { + "end-of-stream": "1.4.0", + "once": "1.4.0" + } + }, + "pumpify": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.3.5.tgz", + "integrity": "sha1-G2ccYZlAq8rqwK0OOjwWS+dgmTs=", + "dev": true, + "requires": { + "duplexify": "3.5.1", + "inherits": "2.0.3", + "pump": "1.0.2" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true + }, + "qjobs": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.1.5.tgz", + "integrity": "sha1-ZZ3p8s+NzCehSBJ28gU3cnI4LnM=", + "dev": true + }, + "qs": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", + "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=" + }, + "query-string": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/query-string/-/query-string-4.3.4.tgz", + "integrity": "sha1-u7aTucqRXCMlFbIosaArYJBD2+s=", + "dev": true, + "requires": { + "object-assign": "4.1.1", + "strict-uri-encode": "1.1.0" + } + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "querystringify": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-0.0.4.tgz", + "integrity": "sha1-DPf4T5Rj/wrlHExLFC2VvjdyTZw=", + "dev": true + }, + "randomatic": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", + "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "dev": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "randombytes": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.5.tgz", + "integrity": "sha512-8T7Zn1AhMsQ/HI1SjcCfT/t4ii3eAqco3yOcSzS4mozsOz69lHLsoMXmF9nZgnFanYscnSlUSgs8uZyKzpE6kg==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "randomfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.3.tgz", + "integrity": "sha512-YL6GrhrWoic0Eq8rXVbMptH7dAxCs0J+mh5Y0euNekPPYaxEmdVGim6GdoxoRzKW2yJoU8tueifS7mYxvcFDEQ==", + "dev": true, + "requires": { + "randombytes": "2.0.5", + "safe-buffer": "5.1.1" + } + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", + "dev": true + }, + "raw-body": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", + "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", + "dev": true, + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "unpipe": "1.0.0" + } + }, + "raw-loader": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-0.5.1.tgz", + "integrity": "sha1-DD0L6u2KAclm2Xh793goElKpeao=", + "dev": true + }, + "react": { + "version": "15.6.2", + "resolved": "https://registry.npmjs.org/react/-/react-15.6.2.tgz", + "integrity": "sha1-26BDSrQ5z+gvEI8PURZjkIF5qnI=", + "requires": { + "create-react-class": "15.6.2", + "fbjs": "0.8.16", + "loose-envify": "1.3.1", + "object-assign": "4.1.1", + "prop-types": "15.6.0" + }, + "dependencies": { + "core-js": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=" + }, + "fbjs": { + "version": "0.8.16", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.16.tgz", + "integrity": "sha1-XmdDL1UNxBtXK/VYR7ispk5TN9s=", + "requires": { + "core-js": "1.2.7", + "isomorphic-fetch": "2.2.1", + "loose-envify": "1.3.1", + "object-assign": "4.1.1", + "promise": "7.3.1", + "setimmediate": "1.0.5", + "ua-parser-js": "0.7.17" + } + } + } + }, + "react-dom": { + "version": "15.6.2", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-15.6.2.tgz", + "integrity": "sha1-Qc+t9pO3V/rycIRDodH9WgK+9zA=", + "requires": { + "fbjs": "0.8.16", + "loose-envify": "1.3.1", + "object-assign": "4.1.1", + "prop-types": "15.6.0" + }, + "dependencies": { + "core-js": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=" + }, + "fbjs": { + "version": "0.8.16", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.16.tgz", + "integrity": "sha1-XmdDL1UNxBtXK/VYR7ispk5TN9s=", + "requires": { + "core-js": "1.2.7", + "isomorphic-fetch": "2.2.1", + "loose-envify": "1.3.1", + "object-assign": "4.1.1", + "promise": "7.3.1", + "setimmediate": "1.0.5", + "ua-parser-js": "0.7.17" + } + } + } + }, + "react-transition-group": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-2.2.1.tgz", + "integrity": "sha512-q54UBM22bs/CekG8r3+vi9TugSqh0t7qcEVycaRc9M0p0aCEu+h6rp/RFiW7fHfgd1IKpd9oILFTl5QK+FpiPA==", + "requires": { + "chain-function": "1.0.0", + "classnames": "2.2.5", + "dom-helpers": "3.2.1", + "loose-envify": "1.3.1", + "prop-types": "15.6.0", + "warning": "3.0.0" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "1.1.0", + "normalize-package-data": "2.4.0", + "path-type": "1.1.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "1.1.2", + "read-pkg": "1.1.0" + } + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "readdirp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "minimatch": "3.0.4", + "readable-stream": "2.3.3", + "set-immediate-shim": "1.0.1" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "2.1.0", + "strip-indent": "1.0.1" + } + }, + "reduce-css-calc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/reduce-css-calc/-/reduce-css-calc-1.3.0.tgz", + "integrity": "sha1-dHyRTgSWFKTJz7umKYca0dKSdxY=", + "dev": true, + "requires": { + "balanced-match": "0.4.2", + "math-expression-evaluator": "1.2.17", + "reduce-function-call": "1.0.2" + }, + "dependencies": { + "balanced-match": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "dev": true + } + } + }, + "reduce-function-call": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/reduce-function-call/-/reduce-function-call-1.0.2.tgz", + "integrity": "sha1-WiAL+S4ON3UXUv5FsKszD9S2vpk=", + "dev": true, + "requires": { + "balanced-match": "0.4.2" + }, + "dependencies": { + "balanced-match": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", + "dev": true + } + } + }, + "reflect-metadata": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.10.tgz", + "integrity": "sha1-tPg3BEFqytiZiMmxVjXUfgO5NEo=", + "dev": true + }, + "regenerate": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.3.3.tgz", + "integrity": "sha512-jVpo1GadrDAK59t/0jRx5VxYWQEDkkEKi6+HjE3joFVLfDOh9Xrdh0dF1eSq+BI/SwvTQ44gSscJ8N5zYL61sg==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz", + "integrity": "sha512-/aA0kLeRb5N9K0d4fw7ooEbI+xDe+DKD499EQqygGqeS8N3xto15p09uY2xj7ixP81sNPXvRLnAQIqdVStgb1A==", + "dev": true + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "0.1.3" + } + }, + "regexpu-core": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-1.0.0.tgz", + "integrity": "sha1-hqdj9Y7k18L2sQLkdkBQ3n7ZDGs=", + "dev": true, + "requires": { + "regenerate": "1.3.3", + "regjsgen": "0.2.0", + "regjsparser": "0.1.5" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "requires": { + "jsesc": "0.5.0" + } + }, + "relateurl": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", + "integrity": "sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=", + "dev": true + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "renderkid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/renderkid/-/renderkid-2.0.1.tgz", + "integrity": "sha1-iYyr/Ivt5Le5ETWj/9Mj5YwNsxk=", + "dev": true, + "requires": { + "css-select": "1.2.0", + "dom-converter": "0.1.4", + "htmlparser2": "3.3.0", + "strip-ansi": "3.0.1", + "utila": "0.3.3" + }, + "dependencies": { + "utila": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/utila/-/utila-0.3.3.tgz", + "integrity": "sha1-1+jn1+MJEHCSsF+NloiCTWM6QiY=", + "dev": true + } + } + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "1.0.2" + } + }, + "request": { + "version": "2.81.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", + "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", + "dev": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.17", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.1.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.3", + "tunnel-agent": "0.6.0", + "uuid": "3.1.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-from-string": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-1.2.1.tgz", + "integrity": "sha1-UpyczvJzgK3+yaL5ZbZJu+5jZBg=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true + }, + "resolve": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz", + "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==", + "dev": true, + "requires": { + "path-parse": "1.0.5" + } + }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "dev": true, + "requires": { + "resolve-from": "3.0.0" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "requires": { + "align-text": "0.1.4" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "ripemd160": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz", + "integrity": "sha1-D0WEKVxTo2KK9+bXmsohzlfRxuc=", + "dev": true, + "requires": { + "hash-base": "2.0.2", + "inherits": "2.0.3" + } + }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "dev": true, + "requires": { + "aproba": "1.2.0" + } + }, + "rxjs": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.2.tgz", + "integrity": "sha512-oRYoIKWBU3Ic37fLA5VJu31VqQO4bWubRntcHSJ+cwaDQBwdnZ9x4zmhJfm/nFQ2E82/I4loSioHnACamrKGgA==", + "requires": { + "symbol-observable": "1.0.4" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "sass-graph": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz", + "integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=", + "dev": true, + "optional": true, + "requires": { + "glob": "7.1.2", + "lodash": "4.17.4", + "scss-tokenizer": "0.2.3", + "yargs": "7.1.0" + } + }, + "sass-loader": { + "version": "6.0.6", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-6.0.6.tgz", + "integrity": "sha512-c3/Zc+iW+qqDip6kXPYLEgsAu2lf4xz0EZDplB7EmSUMda12U1sGJPetH55B/j9eu0bTtKzKlNPWWyYC7wFNyQ==", + "dev": true, + "requires": { + "async": "2.6.0", + "clone-deep": "0.3.0", + "loader-utils": "1.1.0", + "lodash.tail": "4.1.1", + "pify": "3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "saucelabs": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/saucelabs/-/saucelabs-1.3.0.tgz", + "integrity": "sha1-0kDoAJ33+ocwbsRXimm6O1xCT+4=", + "dev": true, + "requires": { + "https-proxy-agent": "1.0.0" + } + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "schema-utils": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.3.0.tgz", + "integrity": "sha1-9YdyIs4+kx7a4DnxfrNxbnE3+M8=", + "dev": true, + "requires": { + "ajv": "5.3.0" + } + }, + "scss-tokenizer": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/scss-tokenizer/-/scss-tokenizer-0.2.3.tgz", + "integrity": "sha1-jrBtualyMzOCTT9VMGQRSYR85dE=", + "dev": true, + "optional": true, + "requires": { + "js-base64": "2.3.2", + "source-map": "0.4.4" + }, + "dependencies": { + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "optional": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "select-hose": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz", + "integrity": "sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo=", + "dev": true + }, + "selenium-webdriver": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-3.0.1.tgz", + "integrity": "sha1-ot6l2kqX9mcuiefKcnbO+jZRR6c=", + "dev": true, + "requires": { + "adm-zip": "0.4.7", + "rimraf": "2.6.2", + "tmp": "0.0.30", + "xml2js": "0.4.19" + }, + "dependencies": { + "tmp": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.30.tgz", + "integrity": "sha1-ckGdSovn1s51FI/YsyTlk6cRwu0=", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2" + } + } + } + }, + "selfsigned": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.1.tgz", + "integrity": "sha1-v4y3uDJWxFUeMTR8YxF3jbme7FI=", + "dev": true, + "requires": { + "node-forge": "0.6.33" + } + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + }, + "semver-dsl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/semver-dsl/-/semver-dsl-1.0.1.tgz", + "integrity": "sha1-02eN5VVeimH2Ke7QJTZq5fJzQKA=", + "dev": true, + "requires": { + "semver": "5.4.1" + } + }, + "send": { + "version": "0.16.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.1.tgz", + "integrity": "sha512-ElCLJdJIKPk6ux/Hocwhk7NFHpI3pVm/IZOYWqUmoxcgeyM+MpxHHKhb8QmlJDX1pU6WrgaHBkVNm73Sv7uc2A==", + "dev": true, + "requires": { + "debug": "2.6.9", + "depd": "1.1.1", + "destroy": "1.0.4", + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "etag": "1.8.1", + "fresh": "0.5.2", + "http-errors": "1.6.2", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "2.3.0", + "range-parser": "1.2.0", + "statuses": "1.3.1" + } + }, + "serve-index": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", + "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", + "dev": true, + "requires": { + "accepts": "1.3.4", + "batch": "0.6.1", + "debug": "2.6.9", + "escape-html": "1.0.3", + "http-errors": "1.6.2", + "mime-types": "2.1.17", + "parseurl": "1.3.2" + } + }, + "serve-static": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.1.tgz", + "integrity": "sha512-hSMUZrsPa/I09VYFJwa627JJkNs0NrfL1Uzuup+GqHfToR2KcsXFymXSV90hoyw3M+msjFuQly+YzIH/q0MGlQ==", + "dev": true, + "requires": { + "encodeurl": "1.0.1", + "escape-html": "1.0.3", + "parseurl": "1.3.2", + "send": "0.16.1" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==", + "dev": true + }, + "sha.js": { + "version": "2.4.9", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.9.tgz", + "integrity": "sha512-G8zektVqbiPHrylgew9Zg1VRB1L/DtXNUVAM6q4QLy8NE3qtHlFXTf8VLL4k1Yl6c7NMjtZUTdXV+X44nFaT6A==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + }, + "shallow-clone": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-0.1.2.tgz", + "integrity": "sha1-WQnodLp3EG1zrEFM/sH/yofZcGA=", + "dev": true, + "requires": { + "is-extendable": "0.1.1", + "kind-of": "2.0.1", + "lazy-cache": "0.2.7", + "mixin-object": "2.0.1" + }, + "dependencies": { + "kind-of": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-2.0.1.tgz", + "integrity": "sha1-AY7HpM5+OobLkUG+UZ0kyPqpgbU=", + "dev": true, + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "silent-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/silent-error/-/silent-error-1.1.0.tgz", + "integrity": "sha1-IglwbxyFCp8dENDYQJGLRvJuG8k=", + "dev": true, + "requires": { + "debug": "2.6.9" + } + }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "socket.io": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-1.7.3.tgz", + "integrity": "sha1-uK+cq6AJSeVo42nxMn6pvp6iRhs=", + "dev": true, + "requires": { + "debug": "2.3.3", + "engine.io": "1.8.3", + "has-binary": "0.1.7", + "object-assign": "4.1.0", + "socket.io-adapter": "0.5.0", + "socket.io-client": "1.7.3", + "socket.io-parser": "2.3.1" + }, + "dependencies": { + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "dev": true, + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + }, + "object-assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz", + "integrity": "sha1-ejs9DpgGPUP0wD8uiubNUahog6A=", + "dev": true + } + } + }, + "socket.io-adapter": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-0.5.0.tgz", + "integrity": "sha1-y21LuL7IHhB4uZZ3+c7QBGBmu4s=", + "dev": true, + "requires": { + "debug": "2.3.3", + "socket.io-parser": "2.3.1" + }, + "dependencies": { + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "dev": true, + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + } + } + }, + "socket.io-client": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-1.7.3.tgz", + "integrity": "sha1-sw6GqhDV7zVGYBwJzeR2Xjgdo3c=", + "dev": true, + "requires": { + "backo2": "1.0.2", + "component-bind": "1.0.0", + "component-emitter": "1.2.1", + "debug": "2.3.3", + "engine.io-client": "1.8.3", + "has-binary": "0.1.7", + "indexof": "0.0.1", + "object-component": "0.0.3", + "parseuri": "0.0.5", + "socket.io-parser": "2.3.1", + "to-array": "0.1.4" + }, + "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "dev": true, + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + } + } + }, + "socket.io-parser": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-2.3.1.tgz", + "integrity": "sha1-3VMgJRA85Clpcya+/WQAX8/ltKA=", + "dev": true, + "requires": { + "component-emitter": "1.1.2", + "debug": "2.2.0", + "isarray": "0.0.1", + "json3": "3.3.2" + }, + "dependencies": { + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + } + } + }, + "sockjs": { + "version": "0.3.18", + "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.18.tgz", + "integrity": "sha1-2bKJMWyn33dZXvKZ4HXw+TfrQgc=", + "dev": true, + "requires": { + "faye-websocket": "0.10.0", + "uuid": "2.0.3" + }, + "dependencies": { + "uuid": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", + "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=", + "dev": true + } + } + }, + "sockjs-client": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/sockjs-client/-/sockjs-client-1.1.4.tgz", + "integrity": "sha1-W6vjhrd15M8U51IJEUUmVAFsixI=", + "dev": true, + "requires": { + "debug": "2.6.9", + "eventsource": "0.1.6", + "faye-websocket": "0.11.1", + "inherits": "2.0.3", + "json3": "3.3.2", + "url-parse": "1.2.0" + }, + "dependencies": { + "faye-websocket": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/faye-websocket/-/faye-websocket-0.11.1.tgz", + "integrity": "sha1-8O/hjE9W5PQK/H4Gxxn9XuYYjzg=", + "dev": true, + "requires": { + "websocket-driver": "0.7.0" + } + } + } + }, + "sort-keys": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-1.1.2.tgz", + "integrity": "sha1-RBttTTRnmPG05J6JIK37oOVD+a0=", + "dev": true, + "requires": { + "is-plain-obj": "1.1.0" + } + }, + "source-list-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.0.tgz", + "integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-loader": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/source-map-loader/-/source-map-loader-0.2.3.tgz", + "integrity": "sha512-MYbFX9DYxmTQFfy2v8FC1XZwpwHKYxg3SK8Wb7VPBKuhDjz8gi9re2819MsG4p49HDyiOSUKlmZ+nQBArW5CGw==", + "dev": true, + "requires": { + "async": "2.6.0", + "loader-utils": "0.2.17", + "source-map": "0.6.1" + }, + "dependencies": { + "loader-utils": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-0.2.17.tgz", + "integrity": "sha1-+G5jdNQyBabmxg6RlvF8Apm/s0g=", + "dev": true, + "requires": { + "big.js": "3.2.0", + "emojis-list": "2.1.0", + "json5": "0.5.1", + "object-assign": "4.1.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "0.5.7" + } + }, + "spdx-correct": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "dev": true, + "requires": { + "spdx-license-ids": "1.2.2" + } + }, + "spdx-expression-parse": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", + "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", + "dev": true + }, + "spdx-license-ids": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", + "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", + "dev": true + }, + "spdy": { + "version": "3.4.7", + "resolved": "https://registry.npmjs.org/spdy/-/spdy-3.4.7.tgz", + "integrity": "sha1-Qv9B7OXMD5mjpsKKq7c/XDsDrLw=", + "dev": true, + "requires": { + "debug": "2.6.9", + "handle-thing": "1.2.5", + "http-deceiver": "1.2.7", + "safe-buffer": "5.1.1", + "select-hose": "2.0.0", + "spdy-transport": "2.0.20" + } + }, + "spdy-transport": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/spdy-transport/-/spdy-transport-2.0.20.tgz", + "integrity": "sha1-c15yBUxIayNU/onnAiVgBKOazk0=", + "dev": true, + "requires": { + "debug": "2.6.9", + "detect-node": "2.0.3", + "hpack.js": "2.1.6", + "obuf": "1.1.1", + "readable-stream": "2.3.3", + "safe-buffer": "5.1.1", + "wbuf": "1.7.2" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", + "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "dev": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "ssri": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.0.0.tgz", + "integrity": "sha512-728D4yoQcQm1ooZvSbywLkV1RjfITZXh0oWrhM/lnsx3nAHx7LsRGJWB/YyvoceAYRq98xqbstiN4JBv1/wNHg==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", + "dev": true + }, + "stdout-stream": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.0.tgz", + "integrity": "sha1-osfIWH5U2UJ+qe2zrD8s1SLfN4s=", + "dev": true, + "optional": true, + "requires": { + "readable-stream": "2.3.3" + } + }, + "stream-browserify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.3" + } + }, + "stream-each": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.2.tgz", + "integrity": "sha512-mc1dbFhGBxvTM3bIWmAAINbqiuAk9TATcfIQC8P+/+HJefgaiTlMn2dHvkX8qlI12KeYKSQ1Ua9RrIqrn1VPoA==", + "dev": true, + "requires": { + "end-of-stream": "1.4.0", + "stream-shift": "1.0.0" + } + }, + "stream-http": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.7.2.tgz", + "integrity": "sha512-c0yTD2rbQzXtSsFSVhtpvY/vS6u066PcXOX9kBB3mSO76RiUQzL340uJkGBWnlBg4/HZzqiUXtaVA7wcRcJgEw==", + "dev": true, + "requires": { + "builtin-status-codes": "3.0.0", + "inherits": "2.0.3", + "readable-stream": "2.3.3", + "to-arraybuffer": "1.0.1", + "xtend": "4.0.1" + } + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "dev": true + }, + "strict-uri-encode": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz", + "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", + "dev": true + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "requires": { + "safe-buffer": "5.1.1" + } + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "4.0.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "style-loader": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-0.13.2.tgz", + "integrity": "sha1-dFMzhM9pjHEEx5URULSXF63C87s=", + "dev": true, + "requires": { + "loader-utils": "1.1.0" + } + }, + "stylus": { + "version": "0.54.5", + "resolved": "https://registry.npmjs.org/stylus/-/stylus-0.54.5.tgz", + "integrity": "sha1-QrlWCTHKcJDOhRWnmLqeaqPW3Hk=", + "dev": true, + "requires": { + "css-parse": "1.7.0", + "debug": "2.6.9", + "glob": "7.0.6", + "mkdirp": "0.5.1", + "sax": "0.5.8", + "source-map": "0.1.43" + }, + "dependencies": { + "glob": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", + "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "sax": { + "version": "0.5.8", + "resolved": "https://registry.npmjs.org/sax/-/sax-0.5.8.tgz", + "integrity": "sha1-1HLbIo6zMcJQaw6MFVJK25OdEsE=", + "dev": true + }, + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "stylus-loader": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/stylus-loader/-/stylus-loader-3.0.1.tgz", + "integrity": "sha1-d/SzT9Aw0lsmF7z1UT21sHMMQIk=", + "dev": true, + "requires": { + "loader-utils": "1.1.0", + "lodash.clonedeep": "4.5.0", + "when": "3.6.4" + } + }, + "superagent": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.1.tgz", + "integrity": "sha512-VMBFLYgFuRdfeNQSMLbxGSLfmXL/xc+OO+BZp41Za/NRDBet/BNbkRJrYzCUu0u4GU0i/ml2dtT8b9qgkw9z6Q==", + "requires": { + "component-emitter": "1.2.1", + "cookiejar": "2.1.1", + "debug": "3.1.0", + "extend": "3.0.1", + "form-data": "2.3.1", + "formidable": "1.1.1", + "methods": "1.1.2", + "mime": "1.4.1", + "qs": "6.5.1", + "readable-stream": "2.3.3" + }, + "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "form-data": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.1.tgz", + "integrity": "sha1-b7lPvXGIUwbXPRXMSX/kzE7NRL8=", + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.17" + } + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + } + } + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + }, + "svgo": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-0.7.2.tgz", + "integrity": "sha1-n1dyQTlSE1xv779Ar+ak+qiLS7U=", + "dev": true, + "requires": { + "coa": "1.0.4", + "colors": "1.1.2", + "csso": "2.3.2", + "js-yaml": "3.7.0", + "mkdirp": "0.5.1", + "sax": "1.2.4", + "whet.extend": "0.9.9" + } + }, + "symbol-observable": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.4.tgz", + "integrity": "sha1-Kb9hXUqnEhvdiYsi1LP5vE4qoD0=" + }, + "tapable": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.8.tgz", + "integrity": "sha1-mTcqXJmb8t8WCvwNdL7U9HlIzSI=", + "dev": true + }, + "tar": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "dev": true, + "optional": true, + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "2.3.3", + "xtend": "4.0.1" + } + }, + "thunky": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/thunky/-/thunky-0.1.0.tgz", + "integrity": "sha1-vzAUaCTituZ7Dy16Ssi+smkIaE4=", + "dev": true + }, + "time-stamp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-2.0.0.tgz", + "integrity": "sha1-lcakRTDhW6jW9KPsuMOj+sRto1c=", + "dev": true + }, + "timers-browserify": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.4.tgz", + "integrity": "sha512-uZYhyU3EX8O7HQP+J9fTVYwsq90Vr68xPEFo7yrVImIxYvHgukBEgOB/SgGoorWVTzGM/3Z+wUNnboA4M8jWrg==", + "dev": true, + "requires": { + "setimmediate": "1.0.5" + } + }, + "tmp": { + "version": "0.0.31", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.31.tgz", + "integrity": "sha1-jzirlDjhcxXl29izZX6L+yd65Kc=", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2" + } + }, + "to-array": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", + "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=", + "dev": true + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", + "dev": true + }, + "toposort": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/toposort/-/toposort-1.0.6.tgz", + "integrity": "sha1-wxdI5V0hDv/AD9zcfW5o19e7nOw=", + "dev": true + }, + "tough-cookie": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", + "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", + "dev": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tree-kill": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.0.tgz", + "integrity": "sha512-DlX6dR0lOIRDFxI0mjL9IYg6OTncLm/Zt+JiBhE5OlFcAR8yc9S7FFXU9so0oda47frdM/JFsk7UjNt9vscKcg==", + "dev": true + }, + "trim": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz", + "integrity": "sha1-WFhUf2spB1fulczMZm+1AITEYN0=" + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "ts-node": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-3.2.2.tgz", + "integrity": "sha1-u9KOOK9Kqj6WB2xGbhsiAZfBo84=", + "dev": true, + "requires": { + "arrify": "1.0.1", + "chalk": "2.2.2", + "diff": "3.4.0", + "make-error": "1.3.0", + "minimist": "1.2.0", + "mkdirp": "0.5.1", + "source-map-support": "0.4.18", + "tsconfig": "6.0.0", + "v8flags": "3.0.1", + "yn": "2.0.0" + } + }, + "tsconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-6.0.0.tgz", + "integrity": "sha1-aw6DdgA9evGGT434+J3QBZ/80DI=", + "dev": true, + "requires": { + "strip-bom": "3.0.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "tsickle": { + "version": "0.24.1", + "resolved": "https://registry.npmjs.org/tsickle/-/tsickle-0.24.1.tgz", + "integrity": "sha512-XloFQZhVhgjpQsi3u2ORNRJvuID5sflOg6HfP093IqAbhE1+fIUXznULpdDwHgG4p+v8w78KdHruQtkWUKx5AQ==", + "dev": true, + "requires": { + "minimist": "1.2.0", + "mkdirp": "0.5.1", + "source-map": "0.5.7", + "source-map-support": "0.4.18" + } + }, + "tslib": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.8.0.tgz", + "integrity": "sha512-ymKWWZJST0/CkgduC2qkzjMOWr4bouhuURNXCn/inEX0L57BnRG6FhX76o7FOnsjHazCjfU2LKeSrlS2sIKQJg==" + }, + "tslint": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.7.0.tgz", + "integrity": "sha1-wl4NDJL6EgHCvDDoROCOaCtPNVI=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "colors": "1.1.2", + "commander": "2.11.0", + "diff": "3.4.0", + "glob": "7.1.2", + "minimatch": "3.0.4", + "resolve": "1.5.0", + "semver": "5.4.1", + "tslib": "1.8.0", + "tsutils": "2.12.2" + } + }, + "tsutils": { + "version": "2.12.2", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.12.2.tgz", + "integrity": "sha1-rVikhl0X7D3bZjG2ylO+FKVlb/M=", + "dev": true, + "requires": { + "tslib": "1.8.0" + } + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true, + "optional": true + }, + "type-is": { + "version": "1.6.15", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz", + "integrity": "sha1-yrEPtJCeRByChC6v4a1kbIGARBA=", + "dev": true, + "requires": { + "media-typer": "0.3.0", + "mime-types": "2.1.17" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typescript": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.4.2.tgz", + "integrity": "sha1-+DlfhdRZJ2BnyYiqQYN6j4KHCEQ=", + "dev": true + }, + "ua-parser-js": { + "version": "0.7.17", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.17.tgz", + "integrity": "sha512-uRdSdu1oA1rncCQL7sCj8vSyZkgtL7faaw9Tc9rZ3mGgraQ7+Pdx7w5mnOSF3gw9ZNG6oc+KXfkon3bKuROm0g==" + }, + "uglify-js": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.1.8.tgz", + "integrity": "sha512-1lnTkrJWw6LJ7n43ZyYVXx0eN2PQh0c3Inb0nY/vj5fNfwykXQFif2kvNgm/Bf0ClLA8R6SKaMHFzo9io4Q+vg==", + "dev": true, + "requires": { + "commander": "2.11.0", + "source-map": "0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "uglifyjs-webpack-plugin": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.0.0.tgz", + "integrity": "sha512-23qmtiLm1X7O0XVSZ54W7XGHykPss+2lo3RYC9zSzK3DDT5W27woZpDFDKguDCnG1RIX8cDnmy5j+dtXxJCA/Q==", + "dev": true, + "requires": { + "cacache": "10.0.0", + "find-cache-dir": "1.0.0", + "schema-utils": "0.3.0", + "source-map": "0.5.7", + "uglify-es": "3.1.8", + "webpack-sources": "1.0.2", + "worker-farm": "1.5.1" + }, + "dependencies": { + "uglify-es": { + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.1.8.tgz", + "integrity": "sha512-z+rniTaxBFZngGxc93XAFwExhkWBtT2JlBVQDJ25D8pQD2Dlqf5sJg8ZhXMzK5xyu+hbUhuw52nUZD3+qqRmkQ==", + "dev": true, + "requires": { + "commander": "2.11.0", + "source-map": "0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + } + } + }, + "ultron": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", + "integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po=", + "dev": true + }, + "uniq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", + "dev": true + }, + "uniqid": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/uniqid/-/uniqid-4.1.1.tgz", + "integrity": "sha1-iSIN32t1GuUrX3JISGNShZa7hME=", + "dev": true, + "requires": { + "macaddress": "0.2.8" + } + }, + "uniqs": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/uniqs/-/uniqs-2.0.0.tgz", + "integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI=", + "dev": true + }, + "unique-filename": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.0.tgz", + "integrity": "sha1-0F8v5AMlYIcfMOk8vnNe6iAVFPM=", + "dev": true, + "requires": { + "unique-slug": "2.0.0" + } + }, + "unique-slug": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.0.tgz", + "integrity": "sha1-22Z258fMBimHj/GWCXx4hVrp9Ks=", + "dev": true, + "requires": { + "imurmurhash": "0.1.4" + } + }, + "universalify": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz", + "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=", + "dev": true + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, + "upper-case": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", + "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=", + "dev": true + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "url-join": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-1.1.0.tgz", + "integrity": "sha1-dBxsL0WWxIMNZxhGCSDQySIC3Hg=" + }, + "url-loader": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/url-loader/-/url-loader-0.6.2.tgz", + "integrity": "sha512-h3qf9TNn53BpuXTTcpC+UehiRrl0Cv45Yr/xWayApjw6G8Bg2dGke7rIwDQ39piciWCWrC+WiqLjOh3SUp9n0Q==", + "dev": true, + "requires": { + "loader-utils": "1.1.0", + "mime": "1.4.1", + "schema-utils": "0.3.0" + } + }, + "url-parse": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.2.0.tgz", + "integrity": "sha512-DT1XbYAfmQP65M/mE6OALxmXzZ/z1+e5zk2TcSKe/KiYbNGZxgtttzC0mR/sjopbpOXcbniq7eIKmocJnUWlEw==", + "dev": true, + "requires": { + "querystringify": "1.0.0", + "requires-port": "1.0.0" + }, + "dependencies": { + "querystringify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-1.0.0.tgz", + "integrity": "sha1-YoYkIRLFtxL6ZU5SZlK/ahP/Bcs=", + "dev": true + } + } + }, + "useragent": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/useragent/-/useragent-2.2.1.tgz", + "integrity": "sha1-z1k+9PLRdYdei7ZY6pLhik/QbY4=", + "dev": true, + "requires": { + "lru-cache": "2.2.4", + "tmp": "0.0.31" + }, + "dependencies": { + "lru-cache": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.2.4.tgz", + "integrity": "sha1-bGWGGb7PFAMdDQtZSxYELOTcBj0=", + "dev": true + } + } + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "utila": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/utila/-/utila-0.4.0.tgz", + "integrity": "sha1-ihagXURWV6Oupe7MWxKk+lN5dyw=", + "dev": true + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "dev": true + }, + "uuid": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", + "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", + "dev": true + }, + "v8flags": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.0.1.tgz", + "integrity": "sha1-3Oj8N5wX2fLJ6e142JzgAFKxt2s=", + "dev": true, + "requires": { + "homedir-polyfill": "1.0.1" + } + }, + "validate-npm-package-license": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", + "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "dev": true, + "requires": { + "spdx-correct": "1.0.2", + "spdx-expression-parse": "1.0.4" + } + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "dev": true + }, + "vendors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.1.tgz", + "integrity": "sha1-N61zyO5Bf7PVgOeFMSMH0nSEfyI=", + "dev": true + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "vlq": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", + "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", + "dev": true + }, + "vm-browserify": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", + "dev": true, + "requires": { + "indexof": "0.0.1" + } + }, + "void-elements": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", + "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=", + "dev": true + }, + "warning": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/warning/-/warning-3.0.0.tgz", + "integrity": "sha1-MuU3fLVy3kqwR1O9+IIcAe1gW3w=", + "requires": { + "loose-envify": "1.3.1" + } + }, + "watchpack": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.4.0.tgz", + "integrity": "sha1-ShRyvLuVK9Cpu0A2gB+VTfs5+qw=", + "dev": true, + "requires": { + "async": "2.6.0", + "chokidar": "1.7.0", + "graceful-fs": "4.1.11" + } + }, + "wbuf": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/wbuf/-/wbuf-1.7.2.tgz", + "integrity": "sha1-1pe5nx9ZUS3ydRvkJ2nBWAtYAf4=", + "dev": true, + "requires": { + "minimalistic-assert": "1.0.0" + } + }, + "webdriver-js-extender": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/webdriver-js-extender/-/webdriver-js-extender-1.0.0.tgz", + "integrity": "sha1-gcUzqeM9W/tZe05j4s2yW1R3dRU=", + "dev": true, + "requires": { + "@types/selenium-webdriver": "2.53.43", + "selenium-webdriver": "2.53.3" + }, + "dependencies": { + "adm-zip": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.4.tgz", + "integrity": "sha1-ph7VrmkFw66lizplfSUDMJEFJzY=", + "dev": true + }, + "sax": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-0.6.1.tgz", + "integrity": "sha1-VjsZx8HeiS4Jv8Ty/DDjwn8JUrk=", + "dev": true + }, + "selenium-webdriver": { + "version": "2.53.3", + "resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-2.53.3.tgz", + "integrity": "sha1-0p/1qVff8aG0ncRXdW5OS/vc4IU=", + "dev": true, + "requires": { + "adm-zip": "0.4.4", + "rimraf": "2.6.2", + "tmp": "0.0.24", + "ws": "1.1.2", + "xml2js": "0.4.4" + } + }, + "tmp": { + "version": "0.0.24", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.24.tgz", + "integrity": "sha1-1qXhmNFKmDXMby18PZ4wJCjIzxI=", + "dev": true + }, + "xml2js": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.4.tgz", + "integrity": "sha1-MREBAAMAiuGSQOuhdJe1fHKcVV0=", + "dev": true, + "requires": { + "sax": "0.6.1", + "xmlbuilder": "9.0.4" + } + } + } + }, + "webpack": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-3.8.1.tgz", + "integrity": "sha512-5ZXLWWsMqHKFr5y0N3Eo5IIisxeEeRAajNq4mELb/WELOR7srdbQk2N5XiyNy2A/AgvlR3AmeBCZJW8lHrolbw==", + "dev": true, + "requires": { + "acorn": "5.2.1", + "acorn-dynamic-import": "2.0.2", + "ajv": "5.3.0", + "ajv-keywords": "2.1.1", + "async": "2.6.0", + "enhanced-resolve": "3.4.1", + "escope": "3.6.0", + "interpret": "1.0.4", + "json-loader": "0.5.7", + "json5": "0.5.1", + "loader-runner": "2.3.0", + "loader-utils": "1.1.0", + "memory-fs": "0.4.1", + "mkdirp": "0.5.1", + "node-libs-browser": "2.0.0", + "source-map": "0.5.7", + "supports-color": "4.5.0", + "tapable": "0.2.8", + "uglifyjs-webpack-plugin": "0.4.6", + "watchpack": "1.4.0", + "webpack-sources": "1.0.2", + "yargs": "8.0.2" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "strip-bom": "3.0.0" + } + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "dev": true, + "requires": { + "execa": "0.7.0", + "lcid": "1.0.0", + "mem": "1.1.0" + } + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "2.3.0" + } + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "2.0.0", + "normalize-package-data": "2.4.0", + "path-type": "2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "read-pkg": "2.0.0" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + }, + "dependencies": { + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } + } + }, + "uglifyjs-webpack-plugin": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-0.4.6.tgz", + "integrity": "sha1-uVH0q7a9YX5m9j64kUmOORdj4wk=", + "dev": true, + "requires": { + "source-map": "0.5.7", + "uglify-js": "2.8.29", + "webpack-sources": "1.0.2" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true + }, + "yargs": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz", + "integrity": "sha1-YpmpBVsc78lp/355wdkY3Osiw2A=", + "dev": true, + "requires": { + "camelcase": "4.1.0", + "cliui": "3.2.0", + "decamelize": "1.2.0", + "get-caller-file": "1.0.2", + "os-locale": "2.1.0", + "read-pkg-up": "2.0.0", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "2.1.1", + "which-module": "2.0.0", + "y18n": "3.2.1", + "yargs-parser": "7.0.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wrap-ansi": "2.1.0" + }, + "dependencies": { + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + } + } + } + } + }, + "yargs-parser": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-7.0.0.tgz", + "integrity": "sha1-jQrELxbqVd69MyyvTEA4s+P139k=", + "dev": true, + "requires": { + "camelcase": "4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + } + } + } + } + }, + "webpack-concat-plugin": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/webpack-concat-plugin/-/webpack-concat-plugin-1.4.0.tgz", + "integrity": "sha512-Ym9Qm5Sw9oXJYChNJk09I/yaXDaV3UDxsa07wcCvILzIeSJTnSUZjhS4y2YkULzgE8VHOv9X04KtlJPZGwXqMg==", + "dev": true, + "requires": { + "md5": "2.2.1", + "uglify-js": "2.8.29" + }, + "dependencies": { + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + } + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + } + }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + } + } + } + }, + "webpack-core": { + "version": "0.6.9", + "resolved": "https://registry.npmjs.org/webpack-core/-/webpack-core-0.6.9.tgz", + "integrity": "sha1-/FcViMhVjad76e+23r3Fo7FyvcI=", + "dev": true, + "requires": { + "source-list-map": "0.1.8", + "source-map": "0.4.4" + }, + "dependencies": { + "source-list-map": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-0.1.8.tgz", + "integrity": "sha1-xVCyq1Qn9rPyH1r+rYjE9Vh7IQY=", + "dev": true + }, + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "webpack-dev-middleware": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/webpack-dev-middleware/-/webpack-dev-middleware-1.12.0.tgz", + "integrity": "sha1-007++y7dp+HTtdvgcolRMhllFwk=", + "dev": true, + "requires": { + "memory-fs": "0.4.1", + "mime": "1.4.1", + "path-is-absolute": "1.0.1", + "range-parser": "1.2.0", + "time-stamp": "2.0.0" + } + }, + "webpack-dev-server": { + "version": "2.9.4", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-2.9.4.tgz", + "integrity": "sha512-thrqC0EQEoSjXeYgP6pUXcUCZ+LNrKsDPn+mItLnn5VyyNZOJKd06hUP5vqkYwL8nWWXsii0loSF9NHNccT6ow==", + "dev": true, + "requires": { + "ansi-html": "0.0.7", + "array-includes": "3.0.3", + "bonjour": "3.5.0", + "chokidar": "1.7.0", + "compression": "1.7.1", + "connect-history-api-fallback": "1.4.0", + "debug": "3.1.0", + "del": "3.0.0", + "express": "4.16.2", + "html-entities": "1.2.1", + "http-proxy-middleware": "0.17.4", + "import-local": "0.1.1", + "internal-ip": "1.2.0", + "ip": "1.1.5", + "killable": "1.0.0", + "loglevel": "1.5.1", + "opn": "5.1.0", + "portfinder": "1.0.13", + "selfsigned": "1.10.1", + "serve-index": "1.9.1", + "sockjs": "0.3.18", + "sockjs-client": "1.1.4", + "spdy": "3.4.7", + "strip-ansi": "3.0.1", + "supports-color": "4.5.0", + "webpack-dev-middleware": "1.12.0", + "yargs": "6.6.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "yargs": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-6.6.0.tgz", + "integrity": "sha1-eC7CHvQDNF+DCoCMo9UTr1YGUgg=", + "dev": true, + "requires": { + "camelcase": "3.0.0", + "cliui": "3.2.0", + "decamelize": "1.2.0", + "get-caller-file": "1.0.2", + "os-locale": "1.4.0", + "read-pkg-up": "1.0.1", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "1.0.2", + "which-module": "1.0.0", + "y18n": "3.2.1", + "yargs-parser": "4.2.1" + } + }, + "yargs-parser": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-4.2.1.tgz", + "integrity": "sha1-KczqwNxPA8bIe0qfIX3RjJ90hxw=", + "dev": true, + "requires": { + "camelcase": "3.0.0" + } + } + } + }, + "webpack-merge": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-4.1.1.tgz", + "integrity": "sha512-geQsZ86YkXOVOjvPC5yv3JSNnL6/X3Kzh935AQ/gJNEYXEfJDQFu/sdFuktS9OW2JcH/SJec8TGfRdrpHshH7A==", + "dev": true, + "requires": { + "lodash": "4.17.4" + } + }, + "webpack-sources": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.0.2.tgz", + "integrity": "sha512-Y7UddMCv6dGjy81nBv6nuQeFFIt5aalHm7uyDsAsW86nZwfOVPGRr3XMjEQLaT+WKo8rlzhC9qtbJvYKLtAwaw==", + "dev": true, + "requires": { + "source-list-map": "2.0.0", + "source-map": "0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "webpack-subresource-integrity": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/webpack-subresource-integrity/-/webpack-subresource-integrity-1.0.1.tgz", + "integrity": "sha1-H8CdRkl9pm5GdDoqUdLMOFucsO0=", + "dev": true, + "requires": { + "webpack-core": "0.6.9" + } + }, + "websocket-driver": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/websocket-driver/-/websocket-driver-0.7.0.tgz", + "integrity": "sha1-DK+dLXVdk67gSdS90NP+LMoqJOs=", + "dev": true, + "requires": { + "http-parser-js": "0.4.9", + "websocket-extensions": "0.1.2" + } + }, + "websocket-extensions": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/websocket-extensions/-/websocket-extensions-0.1.2.tgz", + "integrity": "sha1-Dhh4HeYpoYMIzhSBZQ9n/6JpOl0=", + "dev": true + }, + "whatwg-fetch": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-0.9.0.tgz", + "integrity": "sha1-DjaExsuZlbQ+/J3wPkw2XZX9nMA=" + }, + "when": { + "version": "3.6.4", + "resolved": "https://registry.npmjs.org/when/-/when-3.6.4.tgz", + "integrity": "sha1-RztRfsFZ4rhQBUl6E5g/CVQS404=", + "dev": true + }, + "whet.extend": { + "version": "0.9.9", + "resolved": "https://registry.npmjs.org/whet.extend/-/whet.extend-0.9.9.tgz", + "integrity": "sha1-+HfVv2SMl+WqVC+twW1qJZucEaE=", + "dev": true + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true + }, + "wide-align": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", + "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", + "dev": true, + "requires": { + "string-width": "1.0.2" + } + }, + "winchan": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/winchan/-/winchan-0.2.0.tgz", + "integrity": "sha1-OGMCjn+XSw2hQS8oQXukJJcqvZQ=" + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + }, + "worker-farm": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.5.1.tgz", + "integrity": "sha512-T5NH6Wqsd8MwGD4AK8BBllUy6LmHaqjEOyo/YIUEegZui6/v5Bqde//3jwyE3PGiGYMmWi06exFBi5LNhhPFNw==", + "dev": true, + "requires": { + "errno": "0.1.4", + "xtend": "4.0.1" + } + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "ws": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.2.tgz", + "integrity": "sha1-iiRPoFJAHgjJiGz0SoUYnh/UBn8=", + "dev": true, + "requires": { + "options": "0.0.6", + "ultron": "1.0.2" + } + }, + "wtf-8": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wtf-8/-/wtf-8-1.0.0.tgz", + "integrity": "sha1-OS2LotDxw00e4tYw8V0O+2jhBIo=", + "dev": true + }, + "xml-char-classes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/xml-char-classes/-/xml-char-classes-1.0.0.tgz", + "integrity": "sha1-ZGV4SKIP/F31g6Qq2KJ3tFErvE0=", + "dev": true + }, + "xml2js": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", + "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", + "dev": true, + "requires": { + "sax": "1.2.4", + "xmlbuilder": "9.0.4" + } + }, + "xmlbuilder": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.4.tgz", + "integrity": "sha1-UZy0ymhtAFqEINNJbz8MruzKWA8=", + "dev": true + }, + "xmldom": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", + "integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=", + "dev": true + }, + "xmlhttprequest-ssl": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.3.tgz", + "integrity": "sha1-GFqIjATspGw+QHDZn3tJ3jUomS0=", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", + "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "3.0.0", + "cliui": "3.2.0", + "decamelize": "1.2.0", + "get-caller-file": "1.0.2", + "os-locale": "1.4.0", + "read-pkg-up": "1.0.1", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "1.0.2", + "which-module": "1.0.0", + "y18n": "3.2.1", + "yargs-parser": "5.0.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true, + "optional": true + } + } + }, + "yargs-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", + "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "3.0.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true, + "optional": true + } + } + }, + "yeast": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", + "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=", + "dev": true + }, + "yn": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", + "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", + "dev": true + }, + "zone.js": { + "version": "0.8.18", + "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.8.18.tgz", + "integrity": "sha512-knKOBQM0oea3/x9pdyDuDi7RhxDlJhOIkeixXSiTKWLgs4LpK37iBc+1HaHwzlciHUKT172CymJFKo8Xgh+44Q==" + } + } +} diff --git a/stackle-app/package.json b/stackle-app/package.json new file mode 100644 index 0000000..1d17137 --- /dev/null +++ b/stackle-app/package.json @@ -0,0 +1,54 @@ +{ + "name": "stackle-app", + "version": "0.0.0", + "license": "MIT", + "scripts": { + "ng": "ng", + "start": "ng serve", + "build": "ng build", + "test": "ng test", + "lint": "ng lint", + "e2e": "ng e2e" + }, + "private": true, + "dependencies": { + "@angular/animations": "^5.0.0", + "@angular/cdk": "^5.0.0-rc0", + "@angular/common": "^5.0.0", + "@angular/compiler": "^5.0.0", + "@angular/core": "^5.0.0", + "@angular/forms": "^5.0.0", + "@angular/http": "^5.0.0", + "@angular/material": "^5.0.0-rc0", + "@angular/platform-browser": "^5.0.0", + "@angular/platform-browser-dynamic": "^5.0.0", + "@angular/router": "^5.0.0", + "auth0-js": "^8.11.3", + "auth0-lock": "^10.24.1", + "bootstrap": "^3.3.7", + "core-js": "^2.4.1", + "rxjs": "^5.5.2", + "zone.js": "^0.8.14" + }, + "devDependencies": { + "@angular/cli": "1.5.0", + "@angular/compiler-cli": "^5.0.0", + "@angular/language-service": "^5.0.0", + "@types/jasmine": "~2.5.53", + "@types/jasminewd2": "~2.0.2", + "@types/node": "~6.0.60", + "codelyzer": "~3.2.0", + "jasmine-core": "~2.6.2", + "jasmine-spec-reporter": "~4.1.0", + "karma": "~1.7.0", + "karma-chrome-launcher": "~2.1.1", + "karma-cli": "~1.0.1", + "karma-coverage-istanbul-reporter": "^1.2.1", + "karma-jasmine": "~1.1.0", + "karma-jasmine-html-reporter": "^0.2.2", + "protractor": "~5.1.2", + "ts-node": "~3.2.0", + "tslint": "~5.7.0", + "typescript": "~2.4.2" + } +} diff --git a/stackle-app/protractor.conf.js b/stackle-app/protractor.conf.js new file mode 100644 index 0000000..7ee3b5e --- /dev/null +++ b/stackle-app/protractor.conf.js @@ -0,0 +1,28 @@ +// Protractor configuration file, see link for more information +// https://github.com/angular/protractor/blob/master/lib/config.ts + +const { SpecReporter } = require('jasmine-spec-reporter'); + +exports.config = { + allScriptsTimeout: 11000, + specs: [ + './e2e/**/*.e2e-spec.ts' + ], + capabilities: { + 'browserName': 'chrome' + }, + directConnect: true, + baseUrl: 'http://localhost:4200/', + framework: 'jasmine', + jasmineNodeOpts: { + showColors: true, + defaultTimeoutInterval: 30000, + print: function() {} + }, + onPrepare() { + require('ts-node').register({ + project: 'e2e/tsconfig.e2e.json' + }); + jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); + } +}; diff --git a/stackle-app/src/app/app-routing.module.ts b/stackle-app/src/app/app-routing.module.ts new file mode 100644 index 0000000..14507ae --- /dev/null +++ b/stackle-app/src/app/app-routing.module.ts @@ -0,0 +1,12 @@ +import { NgModule } from '@angular/core'; +import { RouterModule } from '@angular/router'; + +@NgModule({ + imports: [ + RouterModule.forRoot([ + { path: '', redirectTo: '/login', pathMatch: 'full' } + ]) + ], + exports: [RouterModule] +}) +export class AppRoutingModule { } diff --git a/stackle_app/npm-debug.log.1601028086 b/stackle-app/src/app/app.component.css similarity index 100% rename from stackle_app/npm-debug.log.1601028086 rename to stackle-app/src/app/app.component.css diff --git a/stackle-app/src/app/app.component.html b/stackle-app/src/app/app.component.html new file mode 100644 index 0000000..a5ad64d --- /dev/null +++ b/stackle-app/src/app/app.component.html @@ -0,0 +1,2 @@ + + diff --git a/stackle-app/src/app/app.component.spec.ts b/stackle-app/src/app/app.component.spec.ts new file mode 100644 index 0000000..9510495 --- /dev/null +++ b/stackle-app/src/app/app.component.spec.ts @@ -0,0 +1,32 @@ +import { TestBed, async } from '@angular/core/testing'; + +import { AppComponent } from './app.component'; + +describe('AppComponent', () => { + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ + AppComponent + ], + }).compileComponents(); + })); + + it('should create the app', async(() => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app).toBeTruthy(); + })); + + it(`should have as title 'app'`, async(() => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app.title).toEqual('app'); + })); + + it('should render title in a h1 tag', async(() => { + const fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); + const compiled = fixture.debugElement.nativeElement; + expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); + })); +}); diff --git a/stackle-app/src/app/app.component.ts b/stackle-app/src/app/app.component.ts new file mode 100644 index 0000000..5cfd683 --- /dev/null +++ b/stackle-app/src/app/app.component.ts @@ -0,0 +1,12 @@ +import { Component } from '@angular/core'; +import { AuthService } from './services/auth.service'; + +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.css'] +}) + +export class AppComponent { + constructor() { } +} diff --git a/stackle-app/src/app/app.module.ts b/stackle-app/src/app/app.module.ts new file mode 100644 index 0000000..9b7d72f --- /dev/null +++ b/stackle-app/src/app/app.module.ts @@ -0,0 +1,63 @@ +import { BrowserModule } from '@angular/platform-browser'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { NgModule } from '@angular/core'; +import { HttpModule } from '@angular/http'; +import { FormsModule } from '@angular/forms' + +// material module +import { MaterialModule } from './material/material.module'; +import { PublicModule } from './public/public.module'; +import { SecureModule } from './secure/secure.module'; + +// services +import { AuthService } from './services/auth.service'; +import { PostService } from './services/post.service'; +import { StackService } from './services/stack.service'; +import { ProfileService } from './services/profile.service'; +import { UserService } from './services/user.service'; + +import { AppComponent } from './app.component'; + +import { AppRoutingModule } from './app-routing.module'; +import { PublicComponent } from './public/public.component'; +import { SecureComponent } from './secure/secure.component'; +import { CommonFeedComponent } from './secure/common-feed/common-feed.component'; +import { ProfileComponent } from './secure/profile/profile.component'; +import { LoginComponent } from './public/login/login.component'; +import {PostComponent} from './secure/shared/post/post.component'; +import { SearchPipe } from './pipes/search.pipe'; + +import { TokenInterceptor } from './token.interceptor'; + + +@NgModule({ + declarations: [ + AppComponent, + PublicComponent, + SecureComponent, + CommonFeedComponent, + ProfileComponent, + LoginComponent, + SearchPipe + ], + imports: [ + BrowserModule, + BrowserAnimationsModule, + HttpModule, + AppRoutingModule, + FormsModule, + MaterialModule, + PublicModule, + SecureModule + ], + providers: [ + AuthService, + PostService, + StackService, + ProfileService, + UserService, + TokenInterceptor + ], + bootstrap: [AppComponent] +}) +export class AppModule { } diff --git a/stackle-app/src/app/material/material.module.ts b/stackle-app/src/app/material/material.module.ts new file mode 100644 index 0000000..e9548d1 --- /dev/null +++ b/stackle-app/src/app/material/material.module.ts @@ -0,0 +1,59 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +// material imports +import { + MatButtonModule, + MatMenuModule, + MatToolbarModule, + MatIconModule, + MatCardModule, + MatGridListModule, + MatSidenavModule, + MatFormFieldModule, + MatInputModule, + MatListModule, + MatProgressBarModule, + MatChipsModule, + MatSnackBarModule, + MatSelectModule +} from '@angular/material'; + +@NgModule({ + imports: [ + CommonModule, + MatButtonModule, + MatMenuModule, + MatToolbarModule, + MatIconModule, + MatCardModule, + MatGridListModule, + MatSidenavModule, + MatFormFieldModule, + MatInputModule, + MatListModule, + MatProgressBarModule, + MatChipsModule, + MatSnackBarModule, + MatSelectModule + ], + declarations: [], + exports: [ + CommonModule, + MatButtonModule, + MatMenuModule, + MatToolbarModule, + MatIconModule, + MatCardModule, + MatGridListModule, + MatSidenavModule, + MatFormFieldModule, + MatInputModule, + MatListModule, + MatProgressBarModule, + MatChipsModule, + MatSnackBarModule, + MatSelectModule + ] +}) +export class MaterialModule { } diff --git a/stackle-app/src/app/pipes/search.pipe.spec.ts b/stackle-app/src/app/pipes/search.pipe.spec.ts new file mode 100644 index 0000000..3ed1852 --- /dev/null +++ b/stackle-app/src/app/pipes/search.pipe.spec.ts @@ -0,0 +1,8 @@ +import { SearchPipe } from './search.pipe'; + +describe('SearchPipe', () => { + it('create an instance', () => { + const pipe = new SearchPipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/stackle-app/src/app/pipes/search.pipe.ts b/stackle-app/src/app/pipes/search.pipe.ts new file mode 100644 index 0000000..e47e96b --- /dev/null +++ b/stackle-app/src/app/pipes/search.pipe.ts @@ -0,0 +1,19 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'search' +}) +export class SearchPipe implements PipeTransform { + + transform(items: any[], searchKey: string): any { + if(!items) return[]; + if(!searchKey) return items; + + searchKey = searchKey.toLowerCase(); + + return items.filter(item => { + return item.toLowerCase().includes(searchKey); + }); + } + +} diff --git a/stackle-app/src/app/public/callback/callback.component.css b/stackle-app/src/app/public/callback/callback.component.css new file mode 100644 index 0000000..e69de29 diff --git a/stackle-app/src/app/public/callback/callback.component.html b/stackle-app/src/app/public/callback/callback.component.html new file mode 100644 index 0000000..fba9bc5 --- /dev/null +++ b/stackle-app/src/app/public/callback/callback.component.html @@ -0,0 +1,3 @@ +

+ callback works! +

diff --git a/stackle-app/src/app/public/callback/callback.component.spec.ts b/stackle-app/src/app/public/callback/callback.component.spec.ts new file mode 100644 index 0000000..848b5e3 --- /dev/null +++ b/stackle-app/src/app/public/callback/callback.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CallbackComponent } from './callback.component'; + +describe('CallbackComponent', () => { + let component: CallbackComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CallbackComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CallbackComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/stackle-app/src/app/public/callback/callback.component.ts b/stackle-app/src/app/public/callback/callback.component.ts new file mode 100644 index 0000000..071c3a8 --- /dev/null +++ b/stackle-app/src/app/public/callback/callback.component.ts @@ -0,0 +1,36 @@ +import { Component, OnInit } from '@angular/core'; +import {Router, ActivatedRoute, Params} from '@angular/router'; + + +@Component({ + selector: 'app-callback', + templateUrl: './callback.component.html', + styleUrls: ['./callback.component.css'], +}) +export class CallbackComponent implements OnInit { + + constructor( + private activatedRoute: ActivatedRoute, + private router: Router + ) { } + + ngOnInit() { + + this.activatedRoute.queryParams.subscribe((params: Params) => { + let userId = params['userId']; + let token = params['token']; + + if(userId === "" || userId === undefined || token === "" || token === undefined){ + this.router.navigate(['login']); + return; + } + + localStorage.setItem('username', userId); + localStorage.setItem('token', token); + + this.router.navigate(['app/commonFeed']) + + }) + } + +} diff --git a/stackle-app/src/app/public/login/login.component.css b/stackle-app/src/app/public/login/login.component.css new file mode 100644 index 0000000..7b05773 --- /dev/null +++ b/stackle-app/src/app/public/login/login.component.css @@ -0,0 +1,28 @@ +.header { + margin : 2%; +} + +.login-btn { + font-family: Roboto; + position: fixed; + top: 2%; + right: 2%; + background-color:#5b5e71c9; + background-repeat:no-repeat; + border: none; + cursor:pointer; + overflow: hidden; + outline:none; + color: white; +} +#toolbar { + background-color: rgb(85, 70, 181); +} + +#landing-banner { + color: white; + background-image: url('../../../assets/images/Stackle-landing.jpg'); + position: absolute; + width: 100%; + height: 100%; +} \ No newline at end of file diff --git a/stackle-app/src/app/public/login/login.component.html b/stackle-app/src/app/public/login/login.component.html new file mode 100644 index 0000000..9d5cefe --- /dev/null +++ b/stackle-app/src/app/public/login/login.component.html @@ -0,0 +1,13 @@ + diff --git a/stackle-app/src/app/public/login/login.component.spec.ts b/stackle-app/src/app/public/login/login.component.spec.ts new file mode 100644 index 0000000..b9b2bc1 --- /dev/null +++ b/stackle-app/src/app/public/login/login.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { LoginComponent } from './login.component'; + +describe('LoginComponent', () => { + let component: LoginComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ LoginComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(LoginComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should be created', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/stackle-app/src/app/public/login/login.component.ts b/stackle-app/src/app/public/login/login.component.ts new file mode 100644 index 0000000..5390759 --- /dev/null +++ b/stackle-app/src/app/public/login/login.component.ts @@ -0,0 +1,31 @@ +import { Component, OnInit } from '@angular/core'; +import * as Auth0Lock from 'auth0-lock'; +import { environment } from '../../../environments/environment'; +import { AuthService } from '../../services/auth.service'; + +@Component({ + selector: 'app-login', + templateUrl: './login.component.html', + styleUrls: ['./login.component.css'] +}) +export class LoginComponent implements OnInit { + + constructor(private auth: AuthService) { + // Comment out this method call if using + // hash-based routing + auth.handleAuthentication(); + + // Uncomment this method call if using + // hash-based routing + // auth.handleAuthenticationWithHash(); + } + + ngOnInit() { + } + + + login() { + window.location.replace('http://localhost:8080/login'); + } + +} diff --git a/stackle-app/src/app/public/public-routing.module.ts b/stackle-app/src/app/public/public-routing.module.ts new file mode 100644 index 0000000..adb97a2 --- /dev/null +++ b/stackle-app/src/app/public/public-routing.module.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { LoginComponent} from './login/login.component'; +import { CallbackComponent} from './callback/callback.component'; + +const routes: Routes = [ + { path: 'login', component: LoginComponent}, + { path: 'callback', component: CallbackComponent } +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class PublicRoutingModule { } diff --git a/stackle-app/src/app/public/public.component.css b/stackle-app/src/app/public/public.component.css new file mode 100644 index 0000000..e69de29 diff --git a/stackle-app/src/app/public/public.component.html b/stackle-app/src/app/public/public.component.html new file mode 100644 index 0000000..e15ae95 --- /dev/null +++ b/stackle-app/src/app/public/public.component.html @@ -0,0 +1,3 @@ +

+ public works! +

diff --git a/stackle-app/src/app/public/public.component.spec.ts b/stackle-app/src/app/public/public.component.spec.ts new file mode 100644 index 0000000..ba263bb --- /dev/null +++ b/stackle-app/src/app/public/public.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PublicComponent } from './public.component'; + +describe('PublicComponent', () => { + let component: PublicComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PublicComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PublicComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should be created', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/stackle-app/src/app/public/public.component.ts b/stackle-app/src/app/public/public.component.ts new file mode 100644 index 0000000..5f232b0 --- /dev/null +++ b/stackle-app/src/app/public/public.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-public', + templateUrl: './public.component.html', + styleUrls: ['./public.component.css'] +}) +export class PublicComponent implements OnInit { + + constructor() { } + + ngOnInit() { + } + +} diff --git a/stackle-app/src/app/public/public.module.ts b/stackle-app/src/app/public/public.module.ts new file mode 100644 index 0000000..6aaf825 --- /dev/null +++ b/stackle-app/src/app/public/public.module.ts @@ -0,0 +1,16 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { MaterialModule } from '../material/material.module'; + +import { PublicRoutingModule } from './public-routing.module'; +import { CallbackComponent } from './callback/callback.component'; + +@NgModule({ + imports: [ + CommonModule, + PublicRoutingModule, + MaterialModule + ], + declarations: [CallbackComponent] +}) +export class PublicModule { } diff --git a/stackle-app/src/app/secure/common-feed/common-feed.component.css b/stackle-app/src/app/secure/common-feed/common-feed.component.css new file mode 100644 index 0000000..a26ae8a --- /dev/null +++ b/stackle-app/src/app/secure/common-feed/common-feed.component.css @@ -0,0 +1,36 @@ +.post-container { + margin-top: 5vh; +} + +.post{ + margin-bottom: 15px; +} + +.example-header-image img{ + width: 30px; +} + +.mat-chip { + font-size: 10px; + height: auto; + padding: 4px 10px !important; +} + +mat-card-subtitle p { + margin: 0; + font-size: 12px; + font-weight: 500; +} + +.post-description { + white-space: pre-wrap; + margin-bottom: 20px; +} + +.feed-container { + margin-top: 10vh; +} + +#ol { + margin-left: 70px; +} diff --git a/stackle-app/src/app/secure/common-feed/common-feed.component.html b/stackle-app/src/app/secure/common-feed/common-feed.component.html new file mode 100644 index 0000000..ddf34ff --- /dev/null +++ b/stackle-app/src/app/secure/common-feed/common-feed.component.html @@ -0,0 +1,63 @@ +
+ +
+ +
+ +
+ + + +
+
+
+ +
+
+ + + +
+ +
+ {{post.title}} + +

Repository: {{post.repository}}

+

{{post.org_name}}

+
+
+
+

{{post.description}}

+ + {{tag.name}} + +
+ + +
{{post.votes}} Votes + {{post.comments.length}} Comments +
+ + + + +
+
+
+ +
+
+ No posts available +
+
+
+
+
diff --git a/stackle-app/src/app/secure/common-feed/common-feed.component.spec.ts b/stackle-app/src/app/secure/common-feed/common-feed.component.spec.ts new file mode 100644 index 0000000..ed15920 --- /dev/null +++ b/stackle-app/src/app/secure/common-feed/common-feed.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CommonFeedComponent } from './common-feed.component'; + +describe('CommonFeedComponent', () => { + let component: CommonFeedComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CommonFeedComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CommonFeedComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should be created', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/stackle-app/src/app/secure/common-feed/common-feed.component.ts b/stackle-app/src/app/secure/common-feed/common-feed.component.ts new file mode 100644 index 0000000..a9d8fa0 --- /dev/null +++ b/stackle-app/src/app/secure/common-feed/common-feed.component.ts @@ -0,0 +1,46 @@ +import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; + +import { PostService } from '../../services/post.service'; + +@Component({ + selector: 'app-common-feed', + templateUrl: './common-feed.component.html', + styleUrls: ['./common-feed.component.css'] +}) + +export class CommonFeedComponent implements OnInit { + private loading = false; + private posts; + + constructor( + private router: Router, + private postService: PostService + ) { } + + ngOnInit() { + this.loading = true; + this.getAllPosts(); + } + + private navigateToPost(post_id) { + this.router.navigate(['app/post/'+post_id]); + } + + getAllPosts() { + this.postService.getAllPosts().subscribe(response => { + // this.loading = true; + this.posts = response.json().result; + this.loading = false; + }, error => { + this.loading = false; + }); + } + + voteUp(id) { + this.postService.voteUp(id).subscribe( response => { + this.getAllPosts(); + }) + } + +} diff --git a/stackle-app/src/app/secure/create-post/category/category.component.css b/stackle-app/src/app/secure/create-post/category/category.component.css new file mode 100644 index 0000000..ab35bad --- /dev/null +++ b/stackle-app/src/app/secure/create-post/category/category.component.css @@ -0,0 +1,4 @@ +.box{ + display: flex; +} + diff --git a/stackle-app/src/app/secure/create-post/category/category.component.html b/stackle-app/src/app/secure/create-post/category/category.component.html new file mode 100644 index 0000000..607b970 --- /dev/null +++ b/stackle-app/src/app/secure/create-post/category/category.component.html @@ -0,0 +1,8 @@ +
+
+

{{category.category}}

+
    +
  • {{type.name}} Cost: {{type.price}}
  • +
+
+
\ No newline at end of file diff --git a/stackle-app/src/app/secure/create-post/category/category.component.spec.ts b/stackle-app/src/app/secure/create-post/category/category.component.spec.ts new file mode 100644 index 0000000..d19649a --- /dev/null +++ b/stackle-app/src/app/secure/create-post/category/category.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CategoryComponent } from './category.component'; + +describe('CategoryComponent', () => { + let component: CategoryComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CategoryComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CategoryComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/stackle-app/src/app/secure/create-post/category/category.component.ts b/stackle-app/src/app/secure/create-post/category/category.component.ts new file mode 100644 index 0000000..7b497e0 --- /dev/null +++ b/stackle-app/src/app/secure/create-post/category/category.component.ts @@ -0,0 +1,14 @@ +import { Component, OnInit, Input } from '@angular/core'; + +@Component({ + selector: 'app-category', + templateUrl: './category.component.html', + styleUrls: ['./category.component.css'] +}) +export class CategoryComponent implements OnInit { + + constructor() { } + + ngOnInit() { } + +} diff --git a/stackle-app/src/app/secure/create-post/create-post.component.css b/stackle-app/src/app/secure/create-post/create-post.component.css new file mode 100644 index 0000000..a724b7e --- /dev/null +++ b/stackle-app/src/app/secure/create-post/create-post.component.css @@ -0,0 +1,19 @@ +.create-post-container { + margin-top: 10vh; +} + +.form-container { + display: flex; + flex-direction: column; +} +.form-container > * { + width: 100%; +} + +.createPostForm{ + background-color: #0034e0; +} + +.box{ + display: flex; +} diff --git a/stackle-app/src/app/secure/create-post/create-post.component.html b/stackle-app/src/app/secure/create-post/create-post.component.html new file mode 100644 index 0000000..13cd4cb --- /dev/null +++ b/stackle-app/src/app/secure/create-post/create-post.component.html @@ -0,0 +1,58 @@ +
+
+
+
+ + Create Post + + Create a discussion about your issue
+ * required fields +
+ +
+ + + + + + + {{stack.name}} + + + + + + + + + + + + + {{tag.name}} + cancel + + + + + + + +
+
+ + + + + + +
+
+
+
+
diff --git a/stackle-app/src/app/secure/create-post/create-post.component.spec.ts b/stackle-app/src/app/secure/create-post/create-post.component.spec.ts new file mode 100644 index 0000000..34c7223 --- /dev/null +++ b/stackle-app/src/app/secure/create-post/create-post.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CreatePostComponent } from './create-post.component'; + +describe('CreatePostComponent', () => { + let component: CreatePostComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CreatePostComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CreatePostComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/stackle-app/src/app/secure/create-post/create-post.component.ts b/stackle-app/src/app/secure/create-post/create-post.component.ts new file mode 100644 index 0000000..40d2d79 --- /dev/null +++ b/stackle-app/src/app/secure/create-post/create-post.component.ts @@ -0,0 +1,110 @@ +import { Component, OnInit } from '@angular/core'; +import { PostService } from '../../services/post.service'; +import {MatChipInputEvent} from '@angular/material'; +import { MatSnackBar } from '@angular/material' +import {ENTER, COMMA} from '@angular/cdk/keycodes'; +import { Router } from '@angular/router'; +import { UserService } from "../../services/user.service"; + +@Component({ + selector: 'app-create-post', + templateUrl: './create-post.component.html', + styleUrls: ['./create-post.component.css'] +}) +export class CreatePostComponent implements OnInit { + + private username ; + private postObject; + private separatorKeyCodes; + private loading = false; + private subscribedStacks; + + selectable: boolean = true; + removable: boolean = true; + addOnBlur: boolean = true; + + constructor( + private postService: PostService, + private userService: UserService, + private snackBar: MatSnackBar, + private router: Router + ) {} + + ngOnInit() { + this.postObject = {}; + this.postObject.tags = []; + this.postObject.votes = 0; + this.separatorKeyCodes = [ENTER, COMMA]; + this.subscribedStacks = []; + this.getSubscribedStacks(); + } + + + createPost = () => { + if(this.postObject.title == "" || this.postObject.title == undefined){ + this.showSnackBar('Please enter a title!'); + }else if(this.postObject.org_name == "" || this.postObject.org_name == undefined){ + this.showSnackBar('Please enter an organization name!'); + }else if(this.postObject.repository == "" || this.postObject.repository == undefined){ + this.showSnackBar('Please enter a repository!'); + }else if(this.postObject.description == "" || this.postObject.description == undefined){ + this.showSnackBar('Please enter a description!'); + } + + else { + this.postObject.date = new Date(); + this.postObject.user = localStorage.getItem('username'); + this.loading = true; + this.postService.createPost(this.postObject).subscribe( response => { + if(response.status == 200){ + this.showSnackBar('Post created!'); + this.router.navigate(['app/commonFeed']); + }else{ + this.showSnackBar('Could not create post!'); + } + }) + } + }; + + clear = () => { + this.postObject.title = ""; + this.postObject.org_name = ""; + this.postObject.repository = ""; + this.postObject.linkIssue = ""; + this.postObject.description = ""; + }; + + addTag(event: MatChipInputEvent): void { + let input = event.input; + let value = event.value; + + if((value || '').trim()){ + this.postObject.tags.push({name: value.trim()}); + } + + if(input){ + input.value = ''; + } + } + + removeTag(tag: any): void { + let index = this.postObject.tags.indexOf(tag); + + if(index >= 0){ + this.postObject.tags.splice(index,1); + } + } + + showSnackBar(message:string) { + this.snackBar.open(message, null, { + duration: 2000 + }) + } + + getSubscribedStacks(){ + this.userService.getUser(localStorage.getItem('username')).subscribe(response => { + this.subscribedStacks = response.result.subscribedStacks; + }) + } + +} diff --git a/stackle-app/src/app/secure/create-stack/create-stack.component.css b/stackle-app/src/app/secure/create-stack/create-stack.component.css new file mode 100644 index 0000000..a724b7e --- /dev/null +++ b/stackle-app/src/app/secure/create-stack/create-stack.component.css @@ -0,0 +1,19 @@ +.create-post-container { + margin-top: 10vh; +} + +.form-container { + display: flex; + flex-direction: column; +} +.form-container > * { + width: 100%; +} + +.createPostForm{ + background-color: #0034e0; +} + +.box{ + display: flex; +} diff --git a/stackle-app/src/app/secure/create-stack/create-stack.component.html b/stackle-app/src/app/secure/create-stack/create-stack.component.html new file mode 100644 index 0000000..6cc359b --- /dev/null +++ b/stackle-app/src/app/secure/create-stack/create-stack.component.html @@ -0,0 +1,37 @@ +
+
+
+
+ + Create Stack + + Create a stack for your organization
+ * required fields +
+ +
+ + + + + + + + + + + + +
+
+ + + + + + +
+
+
+
+
diff --git a/stackle-app/src/app/secure/create-stack/create-stack.component.spec.ts b/stackle-app/src/app/secure/create-stack/create-stack.component.spec.ts new file mode 100644 index 0000000..bdbbd98 --- /dev/null +++ b/stackle-app/src/app/secure/create-stack/create-stack.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CreateStackComponent } from './create-stack.component'; + +describe('CreateStackComponent', () => { + let component: CreateStackComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ CreateStackComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(CreateStackComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/stackle-app/src/app/secure/create-stack/create-stack.component.ts b/stackle-app/src/app/secure/create-stack/create-stack.component.ts new file mode 100644 index 0000000..5d6c3aa --- /dev/null +++ b/stackle-app/src/app/secure/create-stack/create-stack.component.ts @@ -0,0 +1,60 @@ +import { Component, OnInit } from '@angular/core'; +import { StackService } from '../../services/stack.service'; +import { MatSnackBar } from '@angular/material' +import { Router } from '@angular/router'; + +@Component({ + selector: 'app-create-stack', + templateUrl: './create-stack.component.html', + styleUrls: ['./create-stack.component.css'], +}) +export class CreateStackComponent implements OnInit { + + private stackObject; + + constructor( + private stackService: StackService, + private snackBar: MatSnackBar, + private router: Router + ) { } + + ngOnInit() { + this.stackObject = {}; + } + + createStack() { + this.stackObject.createdUser = localStorage.getItem('username'); + + // validate user inputs + if(this.stackObject.name == undefined || this.stackObject.name == ""){ + this.showSnackBar('Please enter a name!'); + }else if(this.stackObject.description == undefined || this.stackObject.description == ""){ + this.showSnackBar('Please enter a description!'); + }else if(this.stackObject.stackleUrl == undefined || this.stackObject.stackleUrl == ""){ + this.showSnackBar('Please enter the Stackle URL!'); + }else { + + this.stackService.createNewStack(this.stackObject).subscribe( response => { + if(response.status == 200){ + this.showSnackBar('Stack created!'); + this.router.navigate(['app/stacks']); + }else { + this.showSnackBar('Could not create stack!'); + } + }) + + } + + } + + clear() { + this.stackObject = {}; + } + + showSnackBar(message:string) { + this.snackBar.open(message, null, { + duration: 2000 + }) + } + +} diff --git a/stackle-app/src/app/secure/profile/profile.component.css b/stackle-app/src/app/secure/profile/profile.component.css new file mode 100644 index 0000000..c434c70 --- /dev/null +++ b/stackle-app/src/app/secure/profile/profile.component.css @@ -0,0 +1,30 @@ +.profile-container { + margin-top: 10vh; +} + +.profile-container mat-card { + padding: 60px 20px 40px 20px !important; +} + +.profile-container img { + border: 3px solid #021a40; + border-radius: 50%; +} + +.profile-container mat-card-title{ + margin: 30px 0 0 0; + font-size: 30px; +} + +.stat-table { + padding-top: 20px; + border-top: 1px solid #d0d0d0; +} +.stat-table td{ + border: none !important; +} + +.stat-table .stat-title { + font-weight: 500; + padding-left: 20px; +} diff --git a/stackle-app/src/app/secure/profile/profile.component.html b/stackle-app/src/app/secure/profile/profile.component.html new file mode 100644 index 0000000..8b59e16 --- /dev/null +++ b/stackle-app/src/app/secure/profile/profile.component.html @@ -0,0 +1,69 @@ +
+ + +
+ +
+ +
+ + + + + +
+
+ +
+
+ +
+
+

{{profileObject.name}}

+

{{profileObject.login}}

+

{{profileObject.bio}}

+
+
+ + + + +
+
+

{{profileObject.public_repos}}

+

Public Repositories

+
+
+

{{profileObject.public_gists}}

+

Public Gists

+
+
+ +
+
+ + + + + + + + + + + + + +
Posts15
Comments02
Likes45
+
+
+
+ +
+ + +
diff --git a/stackle-app/src/app/secure/profile/profile.component.spec.ts b/stackle-app/src/app/secure/profile/profile.component.spec.ts new file mode 100644 index 0000000..c409004 --- /dev/null +++ b/stackle-app/src/app/secure/profile/profile.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ProfileComponent } from './profile.component'; + +describe('ProfileComponent', () => { + let component: ProfileComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ProfileComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ProfileComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should be created', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/stackle-app/src/app/secure/profile/profile.component.ts b/stackle-app/src/app/secure/profile/profile.component.ts new file mode 100644 index 0000000..69e1c5a --- /dev/null +++ b/stackle-app/src/app/secure/profile/profile.component.ts @@ -0,0 +1,34 @@ +import { Component, OnInit } from '@angular/core'; +import { ProfileService } from '../../services/profile.service'; + +@Component({ + selector: 'app-profile', + templateUrl: './profile.component.html', + styleUrls: ['./profile.component.css'] +}) +export class ProfileComponent implements OnInit { + + private profileObject; + private loading = false; + + constructor( + private profileService: ProfileService + ) { } + + ngOnInit() { + this.profileObject = {}; + this.getProfileObject(); + this.loading = true; + } + + getProfileObject(){ + this.profileService.getCurrentUser().subscribe(response => { + this.profileObject = JSON.parse(response['_body']); + this.loading = false; + }, error => { + console.error(error); + this.loading = false; + }) + } + +} diff --git a/stackle-app/src/app/secure/secure-routing.module.ts b/stackle-app/src/app/secure/secure-routing.module.ts new file mode 100644 index 0000000..a7b0306 --- /dev/null +++ b/stackle-app/src/app/secure/secure-routing.module.ts @@ -0,0 +1,49 @@ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { SecureComponent } from './secure.component'; +import { ProfileComponent } from './profile/profile.component'; +import { CommonFeedComponent } from './common-feed/common-feed.component'; +import { PostComponent } from './shared/post/post.component'; +import { CreatePostComponent} from './create-post/create-post.component'; +import { CreateStackComponent } from './create-stack/create-stack.component'; +import { StacksComponent } from './stacks/stacks.component'; +import { StackComponent } from './shared/stack/stack.component'; + +const routes: Routes = [ + { + path: 'app', + component: SecureComponent, + children: [ + { + path: 'profile', component: ProfileComponent + }, + { + path: 'commonFeed', component: CommonFeedComponent + }, + { + path: 'post/:id', component: PostComponent + }, + { + path: 'createPost', component: CreatePostComponent + }, + { + path: 'createStack', component: CreateStackComponent + }, + { + path: 'stacks', component: StacksComponent + }, + { + path: 'stack', component: StackComponent + } + ] + } + +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) + +export class SecureRoutingModule { } diff --git a/stackle-app/src/app/secure/secure.component.css b/stackle-app/src/app/secure/secure.component.css new file mode 100644 index 0000000..83f79f0 --- /dev/null +++ b/stackle-app/src/app/secure/secure.component.css @@ -0,0 +1,98 @@ +.example-container { + display: flex; + flex-direction: column; + } + + .example-container > * { + width: 100%; + } + + #home-body{ + height: 90vh; + } + + #home-nav{ + display: list-item; + vertical-align: middle; + background-color: #212121; + color: white; + position: fixed; + top: 0; + width: 100%; + z-index: 10; + } + + #home-nav img { + width: 20px; + margin-right: 10px; + } + + .nav-items { + float: right; + } + + #home-nav .col-md-2 { + padding: 0; + } + #home-nav h3 { + padding: 10px 20px 10px 20px; + margin-bottom: 0; + text-align: center; + display: inline-block; + } + + #home-nav h3:hover { + background-color: #414f57; + color: #ffffff; + } + + #home-nav a { + text-decoration: none; + color: #ececec; + } + + #sidebar{ + background-color: #ECEFF1; + height: 100vh; + position: fixed; + left: 0; + padding: 20px 0; + text-align: center; + z-index: 20; + width: 15%; + } + + #sidebar h2 { + margin-bottom: 0; + text-transform: uppercase; + font-weight: 600; + letter-spacing: 3px; + } + + #sidebar mat-form-field { + width: 80%; + } + + #sidebar button { + /* width: 80%; */ + } + + #sidebar hr { + color: #d0d0d0; + border: 0.5px solid; + } + + #sidebar mat-list-item img { + width: 20px; + margin-right: 10px; + margin-bottom: 50px; + } + + #foot-note { + margin-top: 140px; + margin-right: 80px; + } + +.view-container { + /*float: right;*/ +} diff --git a/stackle-app/src/app/secure/secure.component.html b/stackle-app/src/app/secure/secure.component.html new file mode 100644 index 0000000..10953f5 --- /dev/null +++ b/stackle-app/src/app/secure/secure.component.html @@ -0,0 +1,74 @@ +
+
+ +
+
+ +
+ +
+
+
diff --git a/stackle-app/src/app/secure/secure.component.spec.ts b/stackle-app/src/app/secure/secure.component.spec.ts new file mode 100644 index 0000000..0c84b47 --- /dev/null +++ b/stackle-app/src/app/secure/secure.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SecureComponent } from './secure.component'; + +describe('SecureComponent', () => { + let component: SecureComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SecureComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SecureComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should be created', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/stackle-app/src/app/secure/secure.component.ts b/stackle-app/src/app/secure/secure.component.ts new file mode 100644 index 0000000..edf2a22 --- /dev/null +++ b/stackle-app/src/app/secure/secure.component.ts @@ -0,0 +1,62 @@ +import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; + +import { AuthService } from '../services/auth.service'; +import { StackService } from '../services/stack.service'; +import { ProfileService } from '../services/profile.service'; + +@Component({ + selector: 'app-secure', + templateUrl: './secure.component.html', + styleUrls: ['./secure.component.css'] +}) +export class SecureComponent implements OnInit { + + private subscribedStacks = []; + private userAvatarUrl; + + constructor( + private auth: AuthService, + private stackService: StackService, + private router: Router, + private profileService: ProfileService + ) { + auth.handleAuthentication(); + } + + ngOnInit() { + + this.stackService.getAllOrgsByUser().subscribe( response => { + this.subscribedStacks = response.result; + }); + + this.getUserProfileAvatar(); + } + + public navigateToCreatePost() { + this.router.navigate(['app/createPost']); + } + + public navigateToCommonFeed() { + this.router.navigate(['app/commonFeed']); + } + + public navigateToCreateStack() { + this.router.navigate(['app/createStack']); + } + + public navigateToStacks() { + this.router.navigate(['app/stacks']); + } + + public getUserProfileAvatar() { + this.profileService.getCurrentUserFromDB().subscribe( response => { + this.userAvatarUrl = response.json().result.picUrl; + }) + } + + public goToStack(stackName) { + this.router.navigate(['app/stack'], { queryParams: { name: stackName }}); + } + +} diff --git a/stackle-app/src/app/secure/secure.module.ts b/stackle-app/src/app/secure/secure.module.ts new file mode 100644 index 0000000..dc0ca0c --- /dev/null +++ b/stackle-app/src/app/secure/secure.module.ts @@ -0,0 +1,34 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; +import { MaterialModule} from '../material/material.module'; +import { FormsModule } from '@angular/forms'; + +import { SecureRoutingModule } from './secure-routing.module'; +import { SecureComponent } from './secure.component'; +import { PostComponent } from './shared/post/post.component'; +import { CreatePostComponent } from './create-post/create-post.component'; +import { CategoryComponent } from './create-post/category/category.component'; +import { CreateStackComponent } from './create-stack/create-stack.component'; +import { StackComponent } from './shared/stack/stack.component'; +import { StacksComponent } from './stacks/stacks.component'; + + +@NgModule({ + imports: [ + SecureRoutingModule, + MaterialModule, + FormsModule + ], + declarations: [ + PostComponent, + CreatePostComponent, + CategoryComponent, + CreateStackComponent, + StackComponent, + StacksComponent + ], + exports: [ + MaterialModule + ] +}) +export class SecureModule { } diff --git a/stackle-app/src/app/secure/shared/post/post.component.css b/stackle-app/src/app/secure/shared/post/post.component.css new file mode 100644 index 0000000..764676b --- /dev/null +++ b/stackle-app/src/app/secure/shared/post/post.component.css @@ -0,0 +1,63 @@ +.post-container { + margin-top: 10vh; +} + +.description{ + padding : 3px; + white-space: pre-wrap; +} + +.mat-chip { + font-size: 10px; + height: auto; + padding: 4px 10px !important; +} + + +.comment-section{ + /* background-color: #F5F5F5; */ +} + +.comment{ + padding : 3px; +} + +.comment-user{ + color: #0D47A1 +} + +.comment-date{ + color : #78909C; +} + +.comment-textarea { + width: 100%; +} + +.comment-votes { + background-color: #efefef; + border-radius: 20px; + padding: 2px 5px; + margin-left: 10px; +} + +.form-container { + display: flex; + flex-direction: column; +} +.form-container > * { + width: 100%; +} + +.example-header-image img{ + width: 30px; +} + +.comment mat-icon { + font-size: 14px; +} + + +.comment-content { + padding: 3px; +} diff --git a/stackle-app/src/app/secure/shared/post/post.component.html b/stackle-app/src/app/secure/shared/post/post.component.html new file mode 100644 index 0000000..1eaa818 --- /dev/null +++ b/stackle-app/src/app/secure/shared/post/post.component.html @@ -0,0 +1,104 @@ + +
+ + + + + +
+
+ +
+
+ + {{post.title}} + + {{post.org_name}} Repository: {{post.repository}} +
+ + +

+ {{post.description}} +

+ + {{tag.name}} + +
+
{{post.votes}} Votes + {{post.comments.length}} Comments +
+ + + + + + + + +
+
+ + + +
+ + + +
+
+ +
+ +
+
+ +
+
+ + {{comment.description}}
+ + {{comment.date | date}} {{comment.date | date:'shortTime'}} + {{comment.votes}} + +
+
+
+ + +
+
+ +
+
+ + {{reply.description}}
+ + {{reply.date | date}} {{reply.date | date:'shortTime'}} +
+
+ +
+ + + + + +
+
+
+
+
+
+
+ +
+
diff --git a/stackle-app/src/app/secure/shared/post/post.component.spec.ts b/stackle-app/src/app/secure/shared/post/post.component.spec.ts new file mode 100644 index 0000000..b8b6de8 --- /dev/null +++ b/stackle-app/src/app/secure/shared/post/post.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PostComponent } from './post.component'; + +describe('PostComponent', () => { + let component: PostComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PostComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PostComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/stackle-app/src/app/secure/shared/post/post.component.ts b/stackle-app/src/app/secure/shared/post/post.component.ts new file mode 100644 index 0000000..cf63f82 --- /dev/null +++ b/stackle-app/src/app/secure/shared/post/post.component.ts @@ -0,0 +1,103 @@ +import { Component, OnInit } from '@angular/core'; +import { Router, ActivatedRoute, Params } from '@angular/router'; +import { PostService } from '../../../services/post.service'; +import { MatSnackBar } from '@angular/material'; +import {ProfileService} from "../../../services/profile.service"; + +@Component({ + selector: 'app-post', + templateUrl: './post.component.html', + styleUrls: ['./post.component.css'] +}) +export class PostComponent implements OnInit { + private postId; + private post; + private loading = false; + private commentObject; + private replyObject; + + constructor( + private postService: PostService, + private profileService: ProfileService, + private router: Router, + private activatedRoute: ActivatedRoute, + private snackBar: MatSnackBar + ) { } + + ngOnInit() { + this.post = {}; + this.post.comments = []; + this.loading = true; + this.commentObject = {}; + this.replyObject = {}; + this.commentObject.votes = 0; + //Set User + this.commentObject.user = localStorage.getItem('username'); + this.replyObject.user = localStorage.getItem('username'); + this.activatedRoute.params.subscribe(params => { + this.postId = params['id']; + this.getPostData(); + }); + } + + getPostData() { + this.postService.getPost(this.postId).subscribe(post => { + this.post = null; + this.post = post.json().result; + this.loading = false; + }); + } + + postComment(){ + // validate post content + if(this.commentObject.description === undefined || this.commentObject.description === ""){ + this.showSnackBar("Please enter comment text"); + }else { + + this.commentObject.date = new Date(); + this.postService.postComment(this.postId, this.commentObject).subscribe( response => { + this.commentObject.description = ""; + this.getPostData(); + }) + + } + + } + + voteOnPost(){ + this.postService.voteUp(this.postId).subscribe( response => { + this.getPostData(); + }); + } + + voteUpOnComment(id){ + this.postService.voteUpOnComment(id).subscribe( response => { + this.getPostData(); + }) + } + + voteDownOnComment(id){ + this.postService.voteDownOnComment(id).subscribe( response => { + this.getPostData(); + }) + } + + replyOnComment(id){ + if(this.replyObject.description === undefined || this.replyObject.description === ""){ + this.showSnackBar("Please enter reply text"); + }else{ + this.replyObject.date = new Date(); + this.postService.replyOnComment(id, this.replyObject).subscribe(response => { + this.replyObject.description = ""; + this.getPostData(); + }) + } + } + + showSnackBar(message:string) { + this.snackBar.open(message, null, { + duration: 2000 + }) + } + +} diff --git a/stackle-app/src/app/secure/shared/stack/stack.component.css b/stackle-app/src/app/secure/shared/stack/stack.component.css new file mode 100644 index 0000000..65980c5 --- /dev/null +++ b/stackle-app/src/app/secure/shared/stack/stack.component.css @@ -0,0 +1,32 @@ +.post-container { + margin-top: 5vh; +} + +.post{ + margin-bottom: 15px; +} + +.example-header-image img{ + width: 30px; +} + +.mat-chip { + font-size: 10px; + height: auto; + padding: 4px 10px !important; +} + +mat-card-subtitle p { + margin: 0; + font-size: 12px; + font-weight: 500; +} + +.post-description { + white-space: pre-wrap; + margin-bottom: 20px; +} + +.feed-container { + margin-top: 10vh; +} diff --git a/stackle-app/src/app/secure/shared/stack/stack.component.html b/stackle-app/src/app/secure/shared/stack/stack.component.html new file mode 100644 index 0000000..eaf9ec2 --- /dev/null +++ b/stackle-app/src/app/secure/shared/stack/stack.component.html @@ -0,0 +1,64 @@ +
+ +
+ +
+ +
+ + + +
+
+
+ +
+
+ + + +
+ +
+ {{post.title}} + +

Repository: {{post.repository}}

+

{{post.org_name}}

+
+
+
+

{{post.description}}

+ + {{tag.name}} + +
+ + +
{{post.votes}} Votes + {{post.comments.length}} Comments +
+ + + + +
+
+
+ +
+
+ No posts available +
+
+
+
+
diff --git a/stackle-app/src/app/secure/shared/stack/stack.component.spec.ts b/stackle-app/src/app/secure/shared/stack/stack.component.spec.ts new file mode 100644 index 0000000..ac616a8 --- /dev/null +++ b/stackle-app/src/app/secure/shared/stack/stack.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { StackComponent } from './stack.component'; + +describe('StackComponent', () => { + let component: StackComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ StackComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(StackComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/stackle-app/src/app/secure/shared/stack/stack.component.ts b/stackle-app/src/app/secure/shared/stack/stack.component.ts new file mode 100644 index 0000000..8735b69 --- /dev/null +++ b/stackle-app/src/app/secure/shared/stack/stack.component.ts @@ -0,0 +1,54 @@ +import { Component, OnInit } from '@angular/core'; +import { Router, ActivatedRoute, Params } from "@angular/router"; +import {PostService} from "../../../services/post.service"; + +@Component({ + selector: 'app-stack', + templateUrl: './stack.component.html', + styleUrls: ['./stack.component.css'] +}) +export class StackComponent implements OnInit { + + private loading = false; + private posts; + private orgName; + + constructor( + private activatedRoute: ActivatedRoute, + private router: Router, + private postService: PostService + ) { } + + ngOnInit() { + + this.loading = true; + + this.activatedRoute.queryParams.subscribe((params: Params) => { + this.orgName = params['name']; + + + if(this.orgName === "" || this.orgName === undefined){ + this.router.navigate(['app/commonFeed']); + return; + } + + this.getPosts(this.orgName); + + }) + + } + + getPosts(orgName) { + this.postService.getAllPostsByOrg(orgName).subscribe(response => { + this.posts = response.json().result; + this.loading = false; + }, error => { + this.posts = []; + }) + } + + private navigateToPost(post_id) { + this.router.navigate(['app/post/'+post_id]); + } + +} diff --git a/stackle-app/src/app/secure/stacks/stacks.component.css b/stackle-app/src/app/secure/stacks/stacks.component.css new file mode 100644 index 0000000..ad4605f --- /dev/null +++ b/stackle-app/src/app/secure/stacks/stacks.component.css @@ -0,0 +1,15 @@ +.example-header-image img{ + width: 30px; +} + +.example-card { + margin-bottom: 15px; +} + +.post-container { + margin-top: 5vh; +} + +.stacks-container { + margin-top: 10vh; +} diff --git a/stackle-app/src/app/secure/stacks/stacks.component.html b/stackle-app/src/app/secure/stacks/stacks.component.html new file mode 100644 index 0000000..acf882d --- /dev/null +++ b/stackle-app/src/app/secure/stacks/stacks.component.html @@ -0,0 +1,59 @@ +
+ +
+ +
+ +
+ + + +
+ +
+ +
+ +
+
+ + +
+ +
+ +
+ {{stack.name}} + +

Organization: {{stack.githubUrl}}

+
+
+
+

{{stack.description}}

+
+
+
+ + + + + + + +
+
+
+
+ +
+
+ No Stacks available +
+
+
+
+
diff --git a/stackle-app/src/app/secure/stacks/stacks.component.spec.ts b/stackle-app/src/app/secure/stacks/stacks.component.spec.ts new file mode 100644 index 0000000..0ef31d9 --- /dev/null +++ b/stackle-app/src/app/secure/stacks/stacks.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { StacksComponent } from './stacks.component'; + +describe('StacksComponent', () => { + let component: StacksComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ StacksComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(StacksComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/stackle-app/src/app/secure/stacks/stacks.component.ts b/stackle-app/src/app/secure/stacks/stacks.component.ts new file mode 100644 index 0000000..ad46fe3 --- /dev/null +++ b/stackle-app/src/app/secure/stacks/stacks.component.ts @@ -0,0 +1,57 @@ +import { Component, OnInit } from '@angular/core'; +import { StackService } from '../../services/stack.service'; +import { UserService } from '../../services/user.service'; +import {stripSummaryForJitNameSuffix} from "@angular/compiler/src/aot/util"; + +@Component({ + selector: 'app-stacks', + templateUrl: './stacks.component.html', + styleUrls: ['./stacks.component.css'] +}) +export class StacksComponent implements OnInit { + + private stacks; + private user; + + constructor( + private stackService: StackService, + private userService: UserService + ) { } + + ngOnInit() { + this.getCurrentUser(); + } + + getAllOrgs(){ + this.stackService.getAllOrgs().subscribe( response => { + this.stacks = []; + this.stacks = response.result; + }) + } + + getCurrentUser(){ + const user = localStorage.getItem('username'); + this.userService.getUser(user).subscribe( response => { + this.user = response.result; + this.getAllOrgs(); + }) + } + + subscribeToStack(stack){ + + if(!this.checkSubscription(stack)){ + this.stackService.subscribeToStack(stack._id).subscribe( response => { + this.getCurrentUser(); + }) + }else{ + this.stackService.unsubscribeFromStack(stack._id).subscribe( response => { + this.getCurrentUser(); + }) + } + } + + checkSubscription(stack){ + return !!this.user.subscribedStacks.find(item => item._id === stack._id); + } + +} diff --git a/stackle-app/src/app/services/auth.service.spec.ts b/stackle-app/src/app/services/auth.service.spec.ts new file mode 100644 index 0000000..bd98634 --- /dev/null +++ b/stackle-app/src/app/services/auth.service.spec.ts @@ -0,0 +1,15 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { AuthService } from './auth.service'; + +describe('AuthService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [AuthService] + }); + }); + + it('should be created', inject([AuthService], (service: AuthService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/stackle-app/src/app/services/auth.service.ts b/stackle-app/src/app/services/auth.service.ts new file mode 100644 index 0000000..928a129 --- /dev/null +++ b/stackle-app/src/app/services/auth.service.ts @@ -0,0 +1,92 @@ +import { Injectable } from '@angular/core'; +import { Router, NavigationStart } from '@angular/router'; + +import 'rxjs/add/operator/filter'; + +import Auth0Lock from 'auth0-lock'; +import { environment } from '../../environments/environment'; + +@Injectable() +export class AuthService { + + private lock = new Auth0Lock(environment.AUTH0_CLIENTID, environment.AUTH0_DOMAIN, { + oidcConformant: true, + autoclose: true, + auth: { + redirectUrl: environment.AUTH0_REDIRECTURI, + responseType: 'token id_token', + audience: `https://${environment.AUTH0_DOMAIN}/userinfo`, + params: { + scope: 'openid profile' + } + } + }); + + constructor(public router: Router) { } + + public login(): void { + this.lock.show(); + } + + // Call this method in app.component.ts + // if using path-based routing + public handleAuthentication(): void { + this.lock.on('authenticated', (authResult) => { + if (authResult && authResult.accessToken && authResult.idToken) { + this.setSession(authResult); + this.router.navigate(['/app/commonFeed']); + } + }); + this.lock.on('authorization_error', (err) => { + this.router.navigate(['/']); + alert(`Error: ${err.error}. Check the console for further details.`); + }); + } + + // Call this method in app.component.ts + // if using hash-based routing + public handleAuthenticationWithHash(): void { + this + .router + .events + .filter(event => event instanceof NavigationStart) + .filter((event: NavigationStart) => (/access_token|id_token|error/).test(event.url)) + .subscribe(() => { + this.lock.resumeAuth(window.location.hash, (err, authResult) => { + if (err) { + this.router.navigate(['/']); + alert(`Error: ${err.error}. Check the console for further details.`); + return; + } + this.setSession(authResult); + this.router.navigate(['/']); + }); + }); + } + + private setSession(authResult): void { + // Set the time that the access token will expire at + const expiresAt = JSON.stringify((authResult.expiresIn * 1000) + new Date().getTime()); + localStorage.setItem('access_token', authResult.accessToken); + localStorage.setItem('id_token', authResult.idToken); + localStorage.setItem('expires_at', expiresAt); + localStorage.setItem('username', authResult.idTokenPayload.nickname); + } + + public logout(): void { + // Remove tokens and expiry time from localStorage + localStorage.removeItem('access_token'); + localStorage.removeItem('id_token'); + localStorage.removeItem('expires_at'); + localStorage.removeItem('username'); + // Go back to the home route + this.router.navigate(['/login']); + } + + public isAuthenticated(): boolean { + // Check whether the current time is past the + // access token's expiry time + const expiresAt = JSON.parse(localStorage.getItem('expires_at')); + return new Date().getTime() < expiresAt; + } +} diff --git a/stackle-app/src/app/services/post.service.spec.ts b/stackle-app/src/app/services/post.service.spec.ts new file mode 100644 index 0000000..b19a88e --- /dev/null +++ b/stackle-app/src/app/services/post.service.spec.ts @@ -0,0 +1,15 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { PostService } from './post.service'; + +describe('PostService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [PostService] + }); + }); + + it('should be created', inject([PostService], (service: PostService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/stackle-app/src/app/services/post.service.ts b/stackle-app/src/app/services/post.service.ts new file mode 100644 index 0000000..c3c8ff4 --- /dev/null +++ b/stackle-app/src/app/services/post.service.ts @@ -0,0 +1,58 @@ +import { Injectable } from '@angular/core'; +import { Http, Response, Headers, RequestOptions } from '@angular/http'; +import { environment} from '../../environments/environment'; +import { Observable } from "../../../node_modules/rxjs"; + +@Injectable() +export class PostService { + + private apiUrl = `${environment.API_URL}`; + private headers = new Headers({ 'Content-Type': 'application/json' }); + private options; + + constructor( + private http: Http + ) { } + + getAllPosts(params?){ + return this.http.get(`${this.apiUrl}/api/post/all`, this.options); + } + + getAllPostsByOrg(orgName){ + return this.http.get(`${this.apiUrl}/api/post/all/org/${orgName}`, this.options) + .catch((error: any)=> Observable.throw(error.json().error || 'Server error')); + } + + getPost(id){ + return this.http.get(`${this.apiUrl}/api/post/${id}`, this.options); + } + + createPost(postObject){ + return this.http.post(`${this.apiUrl}/api/post/create`, postObject); + } + + voteUp(id) { + return this.http.post(`${this.apiUrl}/api/post/likes/up/${id}`, {userId:localStorage.getItem('username')}); + } + + voteDown(id) { + return this.http.post(`${this.apiUrl}/api/post/likes/down/${id}`, {userId:localStorage.getItem('username')}); + } + + //comments + postComment(postId, commentObject) { + return this.http.post(`${this.apiUrl}/api/comment/${postId}`, commentObject); + } + + voteUpOnComment(commentId) { + return this.http.post(`${this.apiUrl}/api/comment/likes/up/${commentId}`, {userId:localStorage.getItem('username')}); + } + + voteDownOnComment(commentId) { + return this.http.post(`${this.apiUrl}/api/comment/likes/down/${commentId}`, {userId:localStorage.getItem('username')}); + } + + replyOnComment(commentId, replyObject) { + return this.http.post(`${this.apiUrl}/api/reply/${commentId}`, replyObject); + } +} diff --git a/stackle-app/src/app/services/profile.service.spec.ts b/stackle-app/src/app/services/profile.service.spec.ts new file mode 100644 index 0000000..0f3b5f5 --- /dev/null +++ b/stackle-app/src/app/services/profile.service.spec.ts @@ -0,0 +1,15 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { ProfileService } from './profile.service'; + +describe('ProfileService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [ProfileService] + }); + }); + + it('should be created', inject([GithubService], (service: ProfileService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/stackle-app/src/app/services/profile.service.ts b/stackle-app/src/app/services/profile.service.ts new file mode 100644 index 0000000..80b0532 --- /dev/null +++ b/stackle-app/src/app/services/profile.service.ts @@ -0,0 +1,33 @@ +import { Injectable } from '@angular/core'; +import { Http, Response, Headers, RequestOptions } from '@angular/http'; + + +@Injectable() +export class ProfileService { + + private gitHubApiUrl = 'https://api.github.com'; + private apiUrl = 'http://localhost:8080'; + + constructor( + private http: Http + ) { } + + public getCurrentUser(){ + var username = localStorage.getItem('username'); + return this.http.get(`${this.gitHubApiUrl}/users/${username}`); + } + + public getCurrentUserFromDB() { + var username = localStorage.getItem('username'); + return this.http.get(`${this.apiUrl}/api/user/${username}`); + } + + public getProfileByUserName(username) { + return this.http.get(`${this.gitHubApiUrl}/users/${username}`); + } + + public getProfileByUserNameFromDB(username){ + return this.http.get(`${this.apiUrl}/api/user/${username}`); + } + +} diff --git a/stackle-app/src/app/services/stack.service.spec.ts b/stackle-app/src/app/services/stack.service.spec.ts new file mode 100644 index 0000000..91544e0 --- /dev/null +++ b/stackle-app/src/app/services/stack.service.spec.ts @@ -0,0 +1,15 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { StackService } from './stack.service'; + +describe('StackService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [StackService] + }); + }); + + it('should be created', inject([StackService], (service: StackService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/stackle-app/src/app/services/stack.service.ts b/stackle-app/src/app/services/stack.service.ts new file mode 100644 index 0000000..575a364 --- /dev/null +++ b/stackle-app/src/app/services/stack.service.ts @@ -0,0 +1,70 @@ +import { Injectable } from '@angular/core'; +import { Http, Response, Headers, RequestOptions } from '@angular/http'; +import { environment } from '../../environments/environment'; +import { Observable } from 'rxjs/Rx'; + +// Import RxJs required methods +import 'rxjs/add/operator/map'; +import 'rxjs/add/operator/catch'; + +@Injectable() +export class StackService { + + private apiUrl = `${environment.API_URL}`; + private headers = new Headers({ 'Content-Type': 'application/json' }); + private options; + + constructor(private http: Http) { } + + public getAllOrgs() { + return this.http.get(`${this.apiUrl}/api/org/all`, this.options) + .map((res: Response) => res.json()) + .catch((error: any) => Observable.throw(error.json().error || 'Server error')); + } + + //get all organizations subscribed by the user + public getAllOrgsByUser() { + + var userId = localStorage.getItem('username'); + + return this.http.get(`${this.apiUrl}/api/user/stacks/${userId}`, this.options) + .map((res: Response) => res.json()) + .catch((error: any)=> Observable.throw(error.json().error || 'Server error')); + } + + public createNewStack(stackObject) { + return this.http.post(`${this.apiUrl}/api/org/create`, stackObject) + .map((res: Response) => res.json()) + .catch((error: any) => Observable.throw(error.json().error || 'Server error')); + } + + public subscribeToStack(stackId) { + + var userId = localStorage.getItem('username'); + let requestBody = { + stackId: stackId, + userId: userId + }; + + return this.http.post(`${this.apiUrl}/api/user/subscribe`, requestBody) + .map((res: Response) => res.json()) + .catch((error: any) => Observable.throw(error.json().error) || 'Server error'); + + } + + public unsubscribeFromStack(stackId) { + + var userId = localStorage.getItem('username'); + + let requestBody = { + stackId: stackId, + userId: userId + }; + + return this.http.post(`${this.apiUrl}/api/user/unsubscribe`, requestBody) + .map((res: Response) => res.json()) + .catch((error:any) => Observable.throw(error.json().error) || 'Server error'); + + } + +} diff --git a/stackle-app/src/app/services/user.service.spec.ts b/stackle-app/src/app/services/user.service.spec.ts new file mode 100644 index 0000000..b26195c --- /dev/null +++ b/stackle-app/src/app/services/user.service.spec.ts @@ -0,0 +1,15 @@ +import { TestBed, inject } from '@angular/core/testing'; + +import { UserService } from './user.service'; + +describe('UserService', () => { + beforeEach(() => { + TestBed.configureTestingModule({ + providers: [UserService] + }); + }); + + it('should be created', inject([UserService], (service: UserService) => { + expect(service).toBeTruthy(); + })); +}); diff --git a/stackle-app/src/app/services/user.service.ts b/stackle-app/src/app/services/user.service.ts new file mode 100644 index 0000000..8175722 --- /dev/null +++ b/stackle-app/src/app/services/user.service.ts @@ -0,0 +1,20 @@ +import { Injectable } from '@angular/core'; +import {environment} from "../../environments/environment"; +import { Http, Response, Headers, RequestOptions } from '@angular/http'; +import { Observable } from 'rxjs/Rx'; +@Injectable() +export class UserService { + + private apiUrl = `${environment.API_URL}`; + private headers = new Headers({ 'Content-Type': 'application/json' }); + private options; + + constructor(private http: Http) { } + + public getUser(id){ + return this.http.get(`${this.apiUrl}/api/user/${id}`, this.options) + .map((res: Response) => res.json()) + .catch((error: any) => Observable.throw(error.json().error) || 'Server error'); + } + +} diff --git a/stackle-app/src/app/token.interceptor.ts b/stackle-app/src/app/token.interceptor.ts new file mode 100644 index 0000000..ccbb090 --- /dev/null +++ b/stackle-app/src/app/token.interceptor.ts @@ -0,0 +1,20 @@ +import { Injectable} from "@angular/core"; +import { + HttpRequest, + HttpHandler, + HttpEvent, + HttpInterceptor +} from '@angular/common/http'; +import { Observable } from 'rxjs/Observable'; + +@Injectable() +export class TokenInterceptor implements HttpInterceptor{ + intercept(req: HttpRequest, next: HttpHandler): Observable> { + req = req.clone({ + setHeaders: { + Authorization: `Bearer ${localStorage.getItem('access_token')}` + } + }); + return next.handle(req); + } +} diff --git a/stackle-app/src/assets/.gitkeep b/stackle-app/src/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/stackle-app/src/assets/images/Stackle-landing.jpg b/stackle-app/src/assets/images/Stackle-landing.jpg new file mode 100644 index 0000000..78dfa96 Binary files /dev/null and b/stackle-app/src/assets/images/Stackle-landing.jpg differ diff --git a/stackle-app/src/assets/images/user_avatar.png b/stackle-app/src/assets/images/user_avatar.png new file mode 100644 index 0000000..7bdd0e0 Binary files /dev/null and b/stackle-app/src/assets/images/user_avatar.png differ diff --git a/stackle-app/src/environments/environment.prod.ts b/stackle-app/src/environments/environment.prod.ts new file mode 100644 index 0000000..3612073 --- /dev/null +++ b/stackle-app/src/environments/environment.prod.ts @@ -0,0 +1,3 @@ +export const environment = { + production: true +}; diff --git a/stackle-app/src/environments/environment.ts b/stackle-app/src/environments/environment.ts new file mode 100644 index 0000000..2d41f38 --- /dev/null +++ b/stackle-app/src/environments/environment.ts @@ -0,0 +1,13 @@ +// The file contents for the current environment will overwrite these during build. +// The build system defaults to the dev environment which uses `environment.ts`, but if you do +// `ng build --env=prod` then `environment.prod.ts` will be used instead. +// The list of which env maps to which file can be found in `.angular-cli.json`. + +export const environment = { + production: false, + API_URL: 'http://localhost:8080', + AUTH0_CLIENTID: 'f6ewsNvcnhe8ODntv_FAD_lW_YPvxN5X', + AUTH0_DOMAIN: 'psnmissaka.au.auth0.com', + AUTH0_AUDIENCE: 'https://psnmissaka.au.auth0.com/userinfo', + AUTH0_REDIRECTURI: 'http://localhost:4200/app/commonFeed' +}; diff --git a/stackle-app/src/favicon.ico b/stackle-app/src/favicon.ico new file mode 100644 index 0000000..5d5c323 Binary files /dev/null and b/stackle-app/src/favicon.ico differ diff --git a/stackle-app/src/index.html b/stackle-app/src/index.html new file mode 100644 index 0000000..1470e74 --- /dev/null +++ b/stackle-app/src/index.html @@ -0,0 +1,20 @@ + + + + + + StackleApp + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stackle-app/src/main.ts b/stackle-app/src/main.ts new file mode 100644 index 0000000..a9ca1ca --- /dev/null +++ b/stackle-app/src/main.ts @@ -0,0 +1,11 @@ +import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { AppModule } from './app/app.module'; +import { environment } from './environments/environment'; + +if (environment.production) { + enableProdMode(); +} + +platformBrowserDynamic().bootstrapModule(AppModule); diff --git a/stackle-app/src/polyfills.ts b/stackle-app/src/polyfills.ts new file mode 100644 index 0000000..7831e97 --- /dev/null +++ b/stackle-app/src/polyfills.ts @@ -0,0 +1,72 @@ +/** + * This file includes polyfills needed by Angular and is loaded before the app. + * You can add your own extra polyfills to this file. + * + * This file is divided into 2 sections: + * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. + * 2. Application imports. Files imported after ZoneJS that should be loaded before your main + * file. + * + * The current setup is for so-called "evergreen" browsers; the last versions of browsers that + * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), + * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. + * + * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html + */ + +/*************************************************************************************************** + * BROWSER POLYFILLS + */ + +/** IE9, IE10 and IE11 requires all of the following polyfills. **/ +// import 'core-js/es6/symbol'; +// import 'core-js/es6/object'; +// import 'core-js/es6/function'; +// import 'core-js/es6/parse-int'; +// import 'core-js/es6/parse-float'; +// import 'core-js/es6/number'; +// import 'core-js/es6/math'; +// import 'core-js/es6/string'; +// import 'core-js/es6/date'; +// import 'core-js/es6/array'; +// import 'core-js/es6/regexp'; +// import 'core-js/es6/map'; +// import 'core-js/es6/weak-map'; +// import 'core-js/es6/set'; + +/** IE10 and IE11 requires the following for NgClass support on SVG elements */ +// import 'classlist.js'; // Run `npm install --save classlist.js`. + +/** Evergreen browsers require these. **/ +import 'core-js/es6/reflect'; +import 'core-js/es7/reflect'; + + +/** + * Required to support Web Animations `@angular/animation`. + * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation + **/ +// import 'web-animations-js'; // Run `npm install --save web-animations-js`. + + + +/*************************************************************************************************** + * Zone JS is required by Angular itself. + */ +import 'zone.js/dist/zone'; // Included with Angular CLI. + + + +/*************************************************************************************************** + * APPLICATION IMPORTS + */ + +/** + * Date, currency, decimal and percent pipes. + * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 + */ +// import 'intl'; // Run `npm install --save intl`. +/** + * Need to import at least one locale-data with intl. + */ +// import 'intl/locale-data/jsonp/en'; diff --git a/stackle-app/src/styles.css b/stackle-app/src/styles.css new file mode 100644 index 0000000..b8a5bb1 --- /dev/null +++ b/stackle-app/src/styles.css @@ -0,0 +1,3 @@ +/* You can add global styles to this file, and also import other style files */ +@import "~@angular/material/prebuilt-themes/indigo-pink.css"; +@import "../node_modules/bootstrap/dist/css/bootstrap.min.css"; \ No newline at end of file diff --git a/stackle-app/src/test.ts b/stackle-app/src/test.ts new file mode 100644 index 0000000..cd612ee --- /dev/null +++ b/stackle-app/src/test.ts @@ -0,0 +1,32 @@ +// This file is required by karma.conf.js and loads recursively all the .spec and framework files + +import 'zone.js/dist/long-stack-trace-zone'; +import 'zone.js/dist/proxy.js'; +import 'zone.js/dist/sync-test'; +import 'zone.js/dist/jasmine-patch'; +import 'zone.js/dist/async-test'; +import 'zone.js/dist/fake-async-test'; +import { getTestBed } from '@angular/core/testing'; +import { + BrowserDynamicTestingModule, + platformBrowserDynamicTesting +} from '@angular/platform-browser-dynamic/testing'; + +// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. +declare const __karma__: any; +declare const require: any; + +// Prevent Karma from running prematurely. +__karma__.loaded = function () {}; + +// First, initialize the Angular testing environment. +getTestBed().initTestEnvironment( + BrowserDynamicTestingModule, + platformBrowserDynamicTesting() +); +// Then we find all the tests. +const context = require.context('./', true, /\.spec\.ts$/); +// And load the modules. +context.keys().map(context); +// Finally, start Karma to run the tests. +__karma__.start(); diff --git a/stackle-app/src/tsconfig.app.json b/stackle-app/src/tsconfig.app.json new file mode 100644 index 0000000..39ba8db --- /dev/null +++ b/stackle-app/src/tsconfig.app.json @@ -0,0 +1,13 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/app", + "baseUrl": "./", + "module": "es2015", + "types": [] + }, + "exclude": [ + "test.ts", + "**/*.spec.ts" + ] +} diff --git a/stackle-app/src/tsconfig.spec.json b/stackle-app/src/tsconfig.spec.json new file mode 100644 index 0000000..63d89ff --- /dev/null +++ b/stackle-app/src/tsconfig.spec.json @@ -0,0 +1,20 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "outDir": "../out-tsc/spec", + "baseUrl": "./", + "module": "commonjs", + "target": "es5", + "types": [ + "jasmine", + "node" + ] + }, + "files": [ + "test.ts" + ], + "include": [ + "**/*.spec.ts", + "**/*.d.ts" + ] +} diff --git a/stackle-app/src/typings.d.ts b/stackle-app/src/typings.d.ts new file mode 100644 index 0000000..ef5c7bd --- /dev/null +++ b/stackle-app/src/typings.d.ts @@ -0,0 +1,5 @@ +/* SystemJS module definition */ +declare var module: NodeModule; +interface NodeModule { + id: string; +} diff --git a/stackle-app/tsconfig.json b/stackle-app/tsconfig.json new file mode 100644 index 0000000..a6c016b --- /dev/null +++ b/stackle-app/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "target": "es5", + "typeRoots": [ + "node_modules/@types" + ], + "lib": [ + "es2017", + "dom" + ] + } +} diff --git a/stackle-app/tslint.json b/stackle-app/tslint.json new file mode 100644 index 0000000..c24dc29 --- /dev/null +++ b/stackle-app/tslint.json @@ -0,0 +1,141 @@ +{ + "rulesDirectory": [ + "node_modules/codelyzer" + ], + "rules": { + "arrow-return-shorthand": true, + "callable-types": true, + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "curly": true, + "eofline": true, + "forin": true, + "import-blacklist": [ + true, + "rxjs", + "rxjs/Rx" + ], + "import-spacing": true, + "indent": [ + true, + "spaces" + ], + "interface-over-type-literal": true, + "label-position": true, + "max-line-length": [ + true, + 140 + ], + "member-access": false, + "member-ordering": [ + true, + { + "order": [ + "static-field", + "instance-field", + "static-method", + "instance-method" + ] + } + ], + "no-arg": true, + "no-bitwise": true, + "no-console": [ + true, + "debug", + "info", + "time", + "timeEnd", + "trace" + ], + "no-construct": true, + "no-debugger": true, + "no-duplicate-super": true, + "no-empty": false, + "no-empty-interface": true, + "no-eval": true, + "no-inferrable-types": [ + true, + "ignore-params" + ], + "no-misused-new": true, + "no-non-null-assertion": true, + "no-shadowed-variable": true, + "no-string-literal": false, + "no-string-throw": true, + "no-switch-case-fall-through": true, + "no-trailing-whitespace": true, + "no-unnecessary-initializer": true, + "no-unused-expression": true, + "no-use-before-declare": true, + "no-var-keyword": true, + "object-literal-sort-keys": false, + "one-line": [ + true, + "check-open-brace", + "check-catch", + "check-else", + "check-whitespace" + ], + "prefer-const": true, + "quotemark": [ + true, + "single" + ], + "radix": true, + "semicolon": [ + true, + "always" + ], + "triple-equals": [ + true, + "allow-null-check" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + } + ], + "typeof-compare": true, + "unified-signatures": true, + "variable-name": false, + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type" + ], + "directive-selector": [ + true, + "attribute", + "app", + "camelCase" + ], + "component-selector": [ + true, + "element", + "app", + "kebab-case" + ], + "use-input-property-decorator": true, + "use-output-property-decorator": true, + "use-host-property-decorator": true, + "no-input-rename": true, + "no-output-rename": true, + "use-life-cycle-interface": true, + "use-pipe-transform-interface": true, + "component-class-suffix": true, + "directive-class-suffix": true, + "invoke-injectable": true + } +} diff --git a/stackle_api/.eslintrc.json b/stackle_api/.eslintrc.json new file mode 100644 index 0000000..23b8d3f --- /dev/null +++ b/stackle_api/.eslintrc.json @@ -0,0 +1,3 @@ +"parserOptions": { + "ecmaVersion": 6 + } diff --git a/stackle_api/.gitignore b/stackle_api/.gitignore index 362c7cc..75fe862 100644 --- a/stackle_api/.gitignore +++ b/stackle_api/.gitignore @@ -1,12 +1,19 @@ + +# Created by https://www.gitignore.io/api/node + +### Node ### # Logs logs *.log npm-debug.log* +yarn-debug.log* +yarn-error.log* # Runtime data pids *.pid *.seed +*.pid.lock # Directory for instrumented libs generated by jscoverage/JSCover lib-cov @@ -20,6 +27,9 @@ coverage # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt +# Bower dependency directory (https://bower.io/) +bower_components + # node-waf configuration .lock-wscript @@ -27,12 +37,29 @@ coverage build/Release # Dependency directories -node_modules -jspm_packages -bower_components +node_modules/ +jspm_packages/ + +# Typescript v1 declaration files +typings/ # Optional npm cache directory .npm +# Optional eslint cache +.eslintcache + # Optional REPL history .node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + + +# End of https://www.gitignore.io/api/node \ No newline at end of file diff --git a/stackle_api/Dockerfile b/stackle_api/Dockerfile index 3af48c7..604dfda 100644 --- a/stackle_api/Dockerfile +++ b/stackle_api/Dockerfile @@ -8,4 +8,12 @@ COPY . . RUN npm install EXPOSE 8080 -CMD [ "npm", "start"] \ No newline at end of file +CMD [ "npm", "start"] + +LABEL org.label-schema.name = "Stackle" \ + org.label-schema.description = "Stackle is an web communication portal aimed at providing Open Source organizations a platform to have discussions on their GitHub projects and their issues." \ + org.label-schema.url = "https://github.com/scorelab/Stackle/blob/master/README.md" \ + org.label-schema.vendor = "Sustainable Computing and Research Group" \ + org.label-schema.vcs-ref = "279FA63"\ + org.label-schema.vcs-url = "https://github.com/scorelab/Stackle" \ + org.label-schema.schema-version = "1.0" diff --git a/stackle_api/Stackle_API_Endpoints.json b/stackle_api/Stackle_API_Endpoints.json new file mode 100644 index 0000000..a7a855b --- /dev/null +++ b/stackle_api/Stackle_API_Endpoints.json @@ -0,0 +1,356 @@ +{ + "variables": [], + "info": { + "name": "Stackle", + "_postman_id": "150c721e-a0fc-6c19-9136-9b3dc11f4c43", + "description": "Stackle API end points", + "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" + }, + "item": [ + { + "name": "Getting all the posts", + "request": { + "url": "http://localhost:8080/api/posts", + "method": "GET", + "header": [], + "body": {}, + "description": "" + }, + "response": [] + }, + { + "name": "Submitting a post", + "request": { + "url": "http://localhost:8080/api/user/post", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n\ttitle : \"This is the title\",\r\n\tdescription : \"Description about the post\",\r\n\torg_name : \"Orgname\",\r\n\ttags : [],\r\n\trepository : \"URL to the repository\",\r\n\tlinkIssue : \"URL to the Issue\",\r\n\tuser : \"UserId\",\r\n\tdate : \"2017-11-28\",\r\n\tvotes : 0,\r\n\tcomments : []\r\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "Getting a particular post by postId", + "request": { + "url": { + "raw": "http://localhost:8080/api/post/:postid", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "api", + "post", + ":postid" + ], + "query": [], + "variable": [ + { + "key": "postid", + "value": "" + } + ] + }, + "method": "GET", + "header": [], + "body": {}, + "description": "" + }, + "response": [] + }, + { + "name": "Deleting a post by postId", + "request": { + "url": { + "raw": "http://localhost:8080/api/post/:postid", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "api", + "post", + ":postid" + ], + "query": [], + "variable": [ + { + "key": "postid", + "value": "" + } + ] + }, + "method": "DELETE", + "header": [], + "body": {}, + "description": "" + }, + "response": [] + }, + { + "name": "Getting posts by a particular user", + "request": { + "url": { + "raw": "http://localhost:8080/api/posts/:userId", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "api", + "posts", + ":userId" + ], + "query": [], + "variable": [ + { + "key": "userId", + "value": "" + } + ] + }, + "method": "GET", + "header": [], + "body": {}, + "description": "" + }, + "response": [] + }, + { + "name": "Getting posts related to specific organization by org name", + "request": { + "url": { + "raw": "http://localhost:8080/api/posts/org/:orgname", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "api", + "posts", + "org", + ":orgname" + ], + "query": [], + "variable": [ + { + "key": "orgname", + "value": "" + } + ] + }, + "method": "GET", + "header": [], + "body": {}, + "description": "" + }, + "response": [] + }, + { + "name": "Getting details of a specific org", + "request": { + "url": { + "raw": "http://localhost:8080/api/org/:orgname", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "api", + "org", + ":orgname" + ], + "query": [], + "variable": [ + { + "key": "orgname", + "value": "" + } + ] + }, + "method": "GET", + "header": [], + "body": {}, + "description": "" + }, + "response": [] + }, + { + "name": "Post a comment on a post ", + "request": { + "url": { + "raw": "http://localhost:8080/api/comment/:postId", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "api", + "comment", + ":postId" + ], + "query": [], + "variable": [ + { + "key": "postId", + "value": "" + } + ] + }, + "method": "POST", + "header": [], + "body": {}, + "description": "" + }, + "response": [] + }, + { + "name": "Getting all the stacks in Stackle", + "request": { + "url": "http://localhost:8080/api/orgs", + "method": "GET", + "header": [], + "body": {}, + "description": "returns all the organizations registred in Stackle" + }, + "response": [] + }, + { + "name": "Create a Stack", + "request": { + "url": "http://localhost:8080/api/stack/create", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n\t\"name\" : \"Org_name\",\r\n\t\"description\" : \"Small description about the organization\",\r\n\t\"stackleUrl\" : \"Stackle URL\", //this will be generated by the app\r\n\t\"githubUrl\" : \"Github URL\",\r\n\t\"createdUser\" : \"userId\"\r\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "Deleting a Stack", + "request": { + "url": { + "raw": "http://localhost:8080/api/delete/stack/:stackid", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "api", + "delete", + "stack", + ":stackid" + ], + "query": [], + "variable": [ + { + "key": "stackid", + "value": "" + } + ] + }, + "method": "DELETE", + "header": [], + "body": {}, + "description": "" + }, + "response": [] + }, + { + "name": "Subscribing to a Stack", + "request": { + "url": "http://localhost:8080/api/subscribe", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"uid\" : \"userId\",\n\t\"stack_name\" : \"Stack name\"\n}" + }, + "description": "" + }, + "response": [] + }, + { + "name": "Getting the subscribed stack of a user", + "request": { + "url": { + "raw": "http://localhost:8080/api/stack/subscribed/:userid", + "protocol": "http", + "host": [ + "localhost" + ], + "port": "8080", + "path": [ + "api", + "stack", + "subscribed", + ":userid" + ], + "query": [], + "variable": [ + { + "key": "userid", + "value": "" + } + ] + }, + "method": "GET", + "header": [], + "body": {}, + "description": "" + }, + "response": [] + }, + { + "name": "Creating a new user", + "request": { + "url": "http://localhost:8080/api/newuser", + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "description": "" + } + ], + "body": { + "mode": "raw", + "raw": "{\r\n\t\"userId\" : String, //userId must be generated by the app\r\n\t\"github\" : {\r\n\t\t\"id\" : String, // github id\r\n\t\t\"token\" : String, // github tokenid\r\n\t\t\"email\" : String, // primary email for Github\r\n\t\t\"name\" : String // name as in Github\r\n\t},\r\n\t\"gitlab\" : {\r\n\t\t\"id\" : String, // gitlab id\r\n\t\t\"token\" : String, // gitlab tokenid\r\n\t\t\"email\" : String, // primary email for Gitlab\r\n\t\t\"name\" : String // name as in Gitlab\r\n\t},\r\n\tsubscribedStacks : []\r\n}" + }, + "description": "" + }, + "response": [] + } + ] +} \ No newline at end of file diff --git a/stackle_api/app/lib/auth.js b/stackle_api/app/lib/auth.js new file mode 100644 index 0000000..bafa6a5 --- /dev/null +++ b/stackle_api/app/lib/auth.js @@ -0,0 +1,15 @@ +const returnWithResponse = require('./returnWithResponse'); + +//check authorization to protected resource +const auth = function(request, response, next) { + if (request.isAuthenticated()) + return next(); + else + returnWithResponse.configureReturnData({ + status: 401, + success: false, + result: 'Access-Denied ! You are not authorized to access this URL.' + }, response); +} + +module.exports = auth; \ No newline at end of file diff --git a/stackle_api/app/lib/passport.js b/stackle_api/app/lib/passport.js new file mode 100644 index 0000000..1ef79f4 --- /dev/null +++ b/stackle_api/app/lib/passport.js @@ -0,0 +1,89 @@ +const passport = require('passport'); +const GithubStratergy = require('passport-github').Strategy; +const BearerStratergy = require('passport-http-bearer').Strategy; +const authConfig = require('../../config/auth'); +const UserModel = require('../models/user'); + +//used by passport engine for serializing user +passport.serializeUser(function(user, done) { + done(null, user); +}); + +//used by passport engine for de-serializing user +passport.deserializeUser(function(user, done) { + done(null, user); +}); + + +//Oauth strategy used by passportJS +//TODO - change authConfig in production env +var strategy = new GithubStratergy({ + clientID: authConfig.clientId, + clientSecret: authConfig.secret, + callbackURL: authConfig.callback + }, + function(token, refreshToken, profile, cb) { + + var user = profile; + var data = user._json; + var currentUser = {}; + + currentUser.userId = user.username; + currentUser.picUrl = data.avatar_url; + currentUser.profileUrl = user.profileUrl; + currentUser.token = token; + + if (data.email == null || !data.email) + currentUser.email = 'N/A'; + else + currentUser.email = data.email; + + if (user.displayName == null || !user.displayName || user.displayName === undefined) + currentUser.name = currentUser.userId; + else + currentUser.name = user.displayName; + + // UserModel.findOrCreateUser(currentUser, cb); + + UserModel.findOne({ + userId: currentUser.userId + }).exec(function(err, data) { + + if (err) { + cb(err, false); + } else if (!data) { + var temp = new UserModel(currentUser); + temp.save(); + cb(null, temp); + } else { + data.token = token; + data.save(); + cb(null, data); + } + + }); + }); + +//Validating Token +var strategyToken = new BearerStratergy( + function(token, done) { + UserModel.findOne({ + token: token + }, + function(err, user) { + if (err || !user) { + done(err, false); + } else { + done(null, user); + } + + } + ); + } +); + +passport.use(strategy); +passport.use(strategyToken); + + +module.exports = passport; \ No newline at end of file diff --git a/stackle_api/app/lib/returnWithResponse.js b/stackle_api/app/lib/returnWithResponse.js new file mode 100644 index 0000000..c2fa037 --- /dev/null +++ b/stackle_api/app/lib/returnWithResponse.js @@ -0,0 +1,38 @@ +'use strict'; + +/** + * Pass the response object and data you want to throw. + * For an example + * { + * status: 200 - required + * success: true - required + * result: any - required + * } + * @param { Object } data status + * @param { Object } response response + */ +function configureReturnData(data, response) { + if (!!!~Object.keys(data).indexOf('status')) { + throw new Error('Attribute status is missing'); + } + + if (!!!~Object.keys(data).indexOf('success')) { + throw new Error('Attribute success is missing'); + } + + if (!!!~Object.keys(data).indexOf('result')) { + throw new Error('Attribute result is missing'); + } + + //response.header("Access-Control-Allow-Origin", "*"); + // response.header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE, OPTIONS'); + //response.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); + response.status(data.status); + response.json({ + status: data.status, + success: data.success, + result: data.result, + }); +} + +module.exports.configureReturnData = configureReturnData; \ No newline at end of file diff --git a/stackle_api/app/lib/validator.js b/stackle_api/app/lib/validator.js new file mode 100644 index 0000000..d815cac --- /dev/null +++ b/stackle_api/app/lib/validator.js @@ -0,0 +1,453 @@ +/** + * pass the input from app + * @param { Object } input + */ +function Validator(input) { + this.input = input; + this.inputObjKeys = Object.keys(input) +}; + + +Validator.prototype.validateAddingPost = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.title) { + throw new Error('Attribute title is missing'); + } + + if (!this.input.description) { + throw new Error('Attribute description is missing'); + } + + if (!this.input.repository) { + throw new Error('Attribute repository is missing'); + } + + if (!this.input.org_name) { + throw new Error('Attribute org_name is missing'); + } + + if (!this.input.tags) { + throw new Error('Attribute tags is missing'); + } + + if (!this.input.linkIssue) { + throw new Error('Attribute link_issue is missing'); + } + + if (!this.input.user) { + throw new Error('Attribute user is missing'); + } + + if (!this.input.date) { + throw new Error('Attribute date is missing'); + } + + return this.input; +}; + + +Validator.prototype.validateGetPost = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.postId) { + throw new Error('Attribute postId is missing'); + } + + return this.input; +}; + + +Validator.prototype.validateUserId = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.userId) { + throw new Error('Attribute userId is missing'); + } + + return this.input; +}; + + +Validator.prototype.validateDeletePost = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.postId) { + throw new Error('Attribute postId is missing'); + } + + return this.input; +}; + +Validator.prototype.validatePostsByUser = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.user) { + throw new Error('Attribute user is missing'); + } + + return this.input; +}; + +Validator.prototype.validatePostToOrganisation = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.organisationName) { + throw new Error('Attribute organisationName is missing'); + } + + return this.input; +}; + +Validator.prototype.validateGetOrganisationDetails = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.organisationName) { + throw new Error('Attribute organisationName is missing'); + } + + return this.input; +}; + + +Validator.prototype.validateStackId = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.stackId) { + throw new Error('Attribute stackId is missing'); + } + + return this.input; +}; + +// To validate user while getting comments by user +Validator.prototype.validateCommentsByUser = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.user) { + throw new Error('Attribute user is missing'); + } + + return this.input; +} + +//Validating PostId +Validator.prototype.validateCommentOnPost = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.postId) { + throw new Error('Attribute postId is missing'); + } + + return this.input; +}; + +//Validating Comment Body +Validator.prototype.validateCommentBody = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.description) { + throw new Error('Attribute description is missing'); + } + + if (!this.input.user) { + throw new Error('Attribute user is missing'); + } + + if (!this.input.date) { + throw new Error('Attribute date is missing'); + } + + return this.input; +} + +//Validating commentId +Validator.prototype.validateCommentId = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.commentId) { + throw new Error('Attribute commentId is missing'); + } + + return this.input; +} + +//to Validate the Post Id while hitting endpoints of the APIs +Validator.prototype.validatePostId = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.postId) { + throw new Error('Attribute postId is missing'); + } + + return this.input; +} + +Validator.prototype.validateAddTag = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.tag) { + throw new Error('Attribute tag is missing'); + } + + return this.input; +} + +Validator.prototype.validateCreateStack = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.name) { + throw new Error('Attribute name is missing'); + } + + if (!this.input.description) { + throw new Error('Attribute description is missing'); + } + + if (!this.input.stackleUrl) { + throw new Error('Attribute stackleUrl is missing'); + } + + // if (!!!~this.inputObjKeys.indexOf('githubUrl')) { throw new Error('Attribute githubUrl is missing'); } + + if (!this.input.createdUser) { + throw new Error('Attribute createdUser is missing'); + } + + return this.input; +}; + +Validator.prototype.validateDeleteStack = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.stackId) { + throw new Error('Attribute stackId is missing'); + } + + return this.input; +}; + +Validator.prototype.validateUserSubscribeStack = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!!!~this.inputObjKeys.indexOf('stackId')) { + throw new Error('Attribute stackId is missing'); + } + + if (!this.input.userId) { + throw new Error('Attribute userId is missing'); + } + + return this.input; +}; + + +Validator.prototype.validateGetUserSubscribeStack = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.userId) { + throw new Error('Attribute userId is missing'); + } + + return this.input; +}; + +Validator.prototype.validateCreateNewUser = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.token) { + throw new Error('Attribute token is missing'); + } + + if (!this.input.userId) { + throw new Error('Attribute userId is missing'); + } + + if (!this.input.email) { + throw new Error('Attribute email is missing'); + } + + if (!this.input.name) { + throw new Error('Attribute name is missing'); + } + + return this.input; +}; + + +//Validating Reply Body +Validator.prototype.validateReplyBody = function() { + + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.description) { + throw new Error('Attribute description is missing'); + } + + if (!this.input.user) { + throw new Error('Attribute user is missing'); + } + + if (!this.input.date) { + throw new Error('Attribute date is missing'); + } + + return this.input; + +} + +// To validate user while getting replies by user +Validator.prototype.validateRepliesByUser = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.user) { + throw new Error('Attribute user is missing'); + } + + return this.input; +} + +//Validating reply ID +Validator.prototype.validateReplyId = function() { + if (!this.input) { + throw new Error('Input is undefined'); + } + + if (!this.inputObjKeys.length) { + throw new Error('Empty Object has been passed'); + } + + if (!this.input.replyId) { + throw new Error('Attribute replyId is missing'); + } + + return this.input; +} + +module.exports.Validator = Validator; \ No newline at end of file diff --git a/stackle_api/app/models/post.js b/stackle_api/app/models/post.js index 5a0189f..700a07f 100644 --- a/stackle_api/app/models/post.js +++ b/stackle_api/app/models/post.js @@ -1,38 +1,1297 @@ -var mongoose = require('mongoose'); +const mongoose = require('mongoose'); +const Validator = require('../lib/validator').Validator; +const returnWithResponse = require('../lib/returnWithResponse'); +const User = require('./user'); -var replySchema = mongoose.Schema({ - description : String, - user : String, - date : String + +const replySchema = mongoose.Schema({ + description: { + type: String, + required: true + }, + user: { + type: String, + required: true + }, + date: { + type: String, + required: true + } }); -var commentSchema = mongoose.Schema({ - description : String, - user : String, - votes : Number, - date : String, - replies : [replySchema] +const commentSchema = mongoose.Schema({ + description: { + type: String, + required: true + }, + user: { + type: String, + required: true + }, + date: { + type: String, + required: true + }, + replies: [{ + type: mongoose.Schema.Types.ObjectId, + ref: 'Reply' + }], + likes: [{ + type: mongoose.Schema.Types.ObjectId, + ref: 'User3' + }], }); -var postSchema = mongoose.Schema({ - title : String, - description : String, - org_name : String, - tags : [], - repository : String, - link_issue : String, - user : String, - date : String, - votes : Number, - comments : [commentSchema] +const postSchema = mongoose.Schema({ + title: { + type: String, + required: true + }, + description: { + type: String, + required: true + }, + org_name: { + type: String, + required: true + }, + tags: [], + repository: String, + linkIssue: String, + user: { + type: String, + required: true + }, + date: { + type: String, + required: true + }, + likes: [{ + type: mongoose.Schema.Types.ObjectId, + ref: 'User3' + }], + comments: [{ + type: mongoose.Schema.Types.ObjectId, + ref: 'Comment' + }] }); -var Post = mongoose.model('Post', postSchema); -var Comment = mongoose.model('Comment', commentSchema); -var Reply = mongoose.model('Reply', replySchema); +//CRUD operations for POST schema + +//CREATE - save a post +postSchema.statics.setPost = function(request, response) { + try { + const validator = new Validator(request.body); + const input = validator.validateAddingPost(); + const post = new Post(input); + post.save((error, insertedPost) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: insertedPost._id + }, response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//READ - get all posts +postSchema.statics.getAll = function(request, response) { + + this.find({}).populate({ + path: 'comments', + model: 'Comment', + populate: { + path: 'replies', + model: 'Reply' + } + }).populate({ + path: 'comments', + model: 'Comment', + populate: { + path: 'likes', + model: 'User3' + } + }).populate('likes').exec((error, postsDetails) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: postsDetails + }, response); + }); +} + +//READ - get post by id +postSchema.statics.getById = function(request, response) { + try { + const validator = new Validator(request.params); + const input = validator.validateGetPost(); + + this.findOne({ + _id: input.postId + }).populate({ + path: 'comments', + model: 'Comment', + populate: { + path: 'replies', + model: 'Reply' + } + }).populate({ + path: 'comments', + model: 'Comment', + populate: { + path: 'likes', + model: 'User3' + } + }).populate('likes').exec((error, postDetails) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!postDetails) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Post: ${input.postId} not found` + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: postDetails + }, response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//READ - get all posts by user +postSchema.statics.getAllByUser = function(request, response) { + try { + const validator = new Validator(request.params); + const input = validator.validatePostsByUser(); + this.find({ + user: input.user + }).populate({ + path: 'comments', + model: 'Comment', + populate: { + path: 'replies', + model: 'Reply' + } + }).populate({ + path: 'comments', + model: 'Comment', + populate: { + path: 'likes', + model: 'User3' + } + }).populate('likes').exec((error, userPosts) => { + + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!userPosts || userPosts.length === 0) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Posts by ${input.user} user not found` + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: userPosts + }, response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//READ - get all posts by organisationName +postSchema.statics.getAllByOrg = function(request, response) { + try { + const validator = new Validator(request.params); + const input = validator.validatePostToOrganisation(); + this.find({ + org_name: input.organisationName + }).populate({ + path: 'comments', + model: 'Comment', + populate: { + path: 'replies', + model: 'Reply' + } + }).populate('likes').populate({ + path: 'comments', + model: 'Comment', + populate: { + path: 'likes', + model: 'User3' + } + }).exec((error, organisationPosts) => { + + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!organisationPosts || organisationPosts.length === 0) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Posts by ${input.organisationName} organisation not found` + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: organisationPosts + }, response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//Comment on a post +postSchema.statics.commentById = function(request, response) { + try { + const validator = new Validator(request.params); + const bodyValidator = new Validator(request.body); + const input = validator.validateCommentOnPost(); + const inputComment = bodyValidator.validateCommentBody(); + var comment = new Comment(inputComment); + comment.save(function(err, data) { + if (err) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + }); + + Post.findOneAndUpdate({ + _id: input.postId + }, { + $push: { + comments: comment._id + } + }, (error, result) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!result) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Post-${input.postId} not found` + }, response); + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: comment + }, + response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//get All comments for a single post +postSchema.statics.getAllComments = function(request, response) { + try { + const validator = new Validator(request.params); + const input = validator.validateCommentOnPost(); + + Post.findOne({ + _id: input.postId + }).populate({ + path: 'comments', + model: 'Comment', + populate: { + path: 'replies', + model: 'Reply' + } + }).populate({ + path: 'comments', + model: 'Comment', + populate: { + path: 'likes', + model: 'User3' + } + }).exec((error, result) => { + + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!result) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Post-${input.postId} not found` + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: result.comments + }, + response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//to increment vote up on Post +postSchema.statics.getLikes = function(request, response) { + try { + const validator = new Validator(request.params); + const input = validator.validatePostId(); + + Post.findOne({ + _id: input.postId + }).populate('likes').exec((err, result) => { + if (err) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: err + }, response); + } + + if (!result) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Post-${input.postId} not found` + }, response); + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: result.likes + }, response); + }); + + + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//ADD tag to post +postSchema.statics.addTag = function(request, response) { + try { + const validatorPostId = new Validator(request.params); + const input = validatorPostId.validatePostId(); + var currentId = input.postId; + + const validatorTag = new Validator(request.body); + const input2 = validatorTag.validateAddTag(); + var currentTag = input2.tag; + + Post.findOne({ + _id: currentId + }, (error, result) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!result) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Post-${input.postId} not found` + }, response); + + + var tagData = result.tags; + var check = tagData.indexOf(currentTag); + if (check === -1) { + result.tags.push(currentTag); + result.save(); + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: `${currentTag} added to post ${currentId}` + }, response); + } else { + return returnWithResponse.configureReturnData({ + status: 200, + success: false, + result: `Post: ${currentId} is already tagged with ${currentTag}` + }, response); + } + + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//to remove tag from post +postSchema.statics.removeTag = function(request, response) { + try { + const validatorPostId = new Validator(request.params); + const input = validatorPostId.validatePostId(); + var currentId = input.postId; + + const validatorTag = new Validator(request.body); + const input2 = validatorTag.validateAddTag(); + var currentTag = input2.tag; + + Post.findOne({ + _id: currentId + }, (error, result) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!result) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Post: ${currentId} not found` + }, response); + + var tagData = result.tags; + var check = tagData.indexOf(currentTag); + if (check === -1) { + return returnWithResponse.configureReturnData({ + status: 200, + success: false, + result: `${currentTag} is not found in post: ${currentId}` + }, response); + } else { + tagData.splice(check, 1); + result.save(); + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: `${currentTag} tag is removed from the post : ${currentId}` + }, response); + } + + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//POST- like the post +postSchema.statics.setLikeUp = function(request, response) { + + try { + //Valdiating postId in req.params + const validatorPostId = new Validator(request.params); + const input1 = validatorPostId.validatePostId(); + const currentPostId = input1.postId; + + //Valdiating userId in req.body + const validatorUserId = new Validator(request.body); + const input2 = validatorUserId.validateUserId(); + const currentUserId = input2.userId; + + this.findOne({ + _id: currentPostId + }, (error, result) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!result) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Post-${currentPostId} not found` + }, response); + + var likeArray = result.likes; + var check = likeArray.indexOf(currentUserId); + + if (check === -1) { + result.likes.push(currentUserId); + result.save(function(err) { + if (err) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: 'Internal Database error' + }, response); + + else { + User.findOne({ + _id: currentUserId + }).exec(function(err, data) { + if (err || !data) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: 'Invalid User Id' + }, response); + + data.postLikes.push(currentPostId); + data.save(); + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: `${currentUserId}: user liked the post-${currentPostId}` + }, response); + }); + } + + }); + } else { + return returnWithResponse.configureReturnData({ + status: 200, + success: false, + result: `User already liked the post - ${currentPostId}` + }, response); + } + }); + + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } + +} + + +//POST- Dislike the post +postSchema.statics.setLikeDown = function(request, response) { + try { + //Valdiating postId in req.params + const validatorPostId = new Validator(request.params); + const input1 = validatorPostId.validatePostId(); + const currentPostId = input1.postId; + + //Valdiating userId in req.body + const validatorUserId = new Validator(request.body); + const input2 = validatorUserId.validateUserId(); + const currentUserId = input2.userId; + + this.findOne({ + _id: currentPostId + }, (error, result) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!result) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Post-${currentPostId} not found` + }, response); + + var likeArray = result.likes; + var check = likeArray.indexOf(currentUserId); + + if (check === -1) { + return returnWithResponse.configureReturnData({ + status: 200, + success: false, + result: `${currentUserId}-user not found in the likes of the post-${currentPostId}` + }, response); + } else { + + result.likes.splice(check, 1); + result.save(function(err) { + if (err) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: 'Internal Database error' + }, response); + + else { + + User.findOne({ + _id: currentUserId + }).exec(function(err, data) { + if (err || !data) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: 'Invalid User Id' + }, response); + + var postIndex = data.postLikes.indexOf(currentPostId); + data.postLikes.splice(postIndex, 1); + data.save(); + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: `User Disliked the post - ${currentPostId}` + }, response); + }); + + } + + }); + } + + }); + + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//DELETE - delete post by id +postSchema.statics.deleteById = function(request, response) { + try { + const validator = new Validator(request.params); + const input = validator.validateDeletePost(); + var currentId = input.postId; + + this.deleteOne({ + _id: currentId + }, (error, result) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!result) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Post-${input.postId} not found` + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: `${currentId} was sucessfully deleted` + }, response); + }); + + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//to delete all post +postSchema.statics.deleteAll = function(request, response) { + this.remove({}, function(err) { + if (err) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: err + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: `All data removed.` + }, response); + + }); +} + +//get comment by id +commentSchema.statics.getCommentById = function(request, response) { + try { + const validator = new Validator(request.params); + const input = validator.validateCommentId(); + this.findOne({ + _id: input.commentId + }).populate('likes').exec((error, commentData) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!commentData) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Comment: ${input.commentId} not found` + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: commentData + }, response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//to add user to like in comment + +commentSchema.statics.setLikeUpComment = function(request, response) { + + try { + //Valdiating commentId in req.params + const validatorCommentId = new Validator(request.params); + const input1 = validatorCommentId.validateCommentId(); + const currentCommentId = input1.commentId; + + //Valdiating userId in req.body + const validatorUserId = new Validator(request.body); + const input2 = validatorUserId.validateUserId(); + const currentUserId = input2.userId; + + this.findOne({ + _id: currentCommentId + }, (error, result) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!result) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Comment-${currentCommentId} not found` + }, response); + + var likeArray = result.likes; + var check = likeArray.indexOf(currentUserId); + + if (check === -1) { + result.likes.push(currentUserId); + result.save(); + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: `${currentUserId}: user liked the comment-${currentCommentId}` + }, response); + } else { + return returnWithResponse.configureReturnData({ + status: 200, + success: false, + result: `User already liked the comment - ${currentCommentId}` + }, response); + } + }); + + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } + +} + + +//to remove user from like in comment + +commentSchema.statics.setLikeDownComment = function(request, response) { + + try { + //Valdiating commentId in req.params + const validatorCommentId = new Validator(request.params); + const input1 = validatorCommentId.validateCommentId(); + const currentCommentId = input1.commentId; + + //Valdiating userId in req.body + const validatorUserId = new Validator(request.body); + const input2 = validatorUserId.validateUserId(); + const currentUserId = input2.userId; + + this.findOne({ + _id: currentCommentId + }, (error, result) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!result) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Comment-${currentCommentId} not found` + }, response); + + var likeArray = result.likes; + var check = likeArray.indexOf(currentUserId); + + if (check === -1) { + return returnWithResponse.configureReturnData({ + status: 200, + success: false, + result: `${currentUserId}-user not found in the likes of the Comment-${currentCommentId}` + }, response); + } else { + + result.likes.splice(check, 1); + result.save(); + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: `User Disliked the Comment - ${currentCommentId}` + }, response); + } + + }); + + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +commentSchema.statics.getLikes = function(request, response) { + + try { + //Valdiating commentId in req.params + const validatorCommentId = new Validator(request.params); + const input1 = validatorCommentId.validateCommentId(); + const currentCommentId = input1.commentId; + + this.findOne({ + _id: currentCommentId + }).populate('likes').exec((error, result) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!result) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Comment-${currentCommentId} not found` + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: result.likes + }, response); + + }); + + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + + +//to delete all comments +commentSchema.statics.deleteAll = function(request, response) { + this.remove({}, function(err) { + if (err) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: err + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: `All Comment data removed.` + }, response); + + }); +} + +// to get All the comments for a specific user +commentSchema.statics.getAllCommentsByUser = function(request, response) { + try { + const validator = new Validator(request.params); + const input = validator.validateCommentsByUser(); + this.find({ + user: input.user + }).populate('likes').populate('replies').exec((error, data) => { + + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!data || data.length === 0) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Comments by ${input.user} user not found` + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: data + }, response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + + + +// Reply create + +replySchema.statics.replyById = function(request, response) { + try { + const validator = new Validator(request.params); + const bodyValidator = new Validator(request.body); + + const input = validator.validateCommentId(); + const inputComment = bodyValidator.validateReplyBody(); + + var reply = new Reply(inputComment); + reply.save(function(err, data) { + if (err) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + }); + + Comment.findOneAndUpdate({ + _id: input.commentId + }, { + $push: { + replies: reply._id + } + }, (error, result) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!result) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Comment-${input.commentId} not found` + }, response); + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: reply + }, + response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +// to get all replies for a single comment + +replySchema.statics.getAll = function(request, response) { + + try { + const validator = new Validator(request.params); + const input = validator.validateCommentId(); + + Comment.findOne({ + _id: input.commentId + }).populate('replies').exec((error, result) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!result) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Comment-${input.postId} not found` + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: result.replies + }, + response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + + +//get reply by id +replySchema.statics.getReplyById = function(request, response) { + try { + const validator = new Validator(request.params); + const input = validator.validateReplyId(); + this.findOne({ + _id: input.replyId + }, (error, data) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!data) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Reply: ${input.replyId} not found` + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: data + }, response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + + +// to get All the replies for a specific user +replySchema.statics.getAllRepliesByUser = function(request, response) { + try { + const validator = new Validator(request.params); + const input = validator.validateRepliesByUser(); + + this.find({ + user: input.user + }).exec((error, data) => { + + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!data || data.length === 0) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `Replies by ${input.user} user not found` + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: data + }, response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + + +//to clear all - only for developer use +replySchema.statics.deleteAll = function(request, response) { + this.remove({}, function(err) { + if (err) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: err + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: `All replies data removed.` + }, response); + + }); +} + +const Post = mongoose.model('Post', postSchema); +const Comment = mongoose.model('Comment', commentSchema); +const Reply = mongoose.model('Reply', replySchema); module.exports = { - Post : Post, - Comment : Comment, - Reply : Reply + Post, + Comment, + Reply } \ No newline at end of file diff --git a/stackle_api/app/models/stack.js b/stackle_api/app/models/stack.js index 84cbb06..f930d74 100644 --- a/stackle_api/app/models/stack.js +++ b/stackle_api/app/models/stack.js @@ -1,11 +1,196 @@ -var mongoose = require('mongoose'); - -var stackSchema = mongoose.Schema({ - name : String, - description : String, - stackleUrl : String, - githubUrl : String, - created_user : String +const mongoose = require('mongoose'); +const Validator = require('../lib/validator').Validator; +const returnWithResponse = require('../lib/returnWithResponse'); + + +const stackSchema = mongoose.Schema({ + name: { + type: String, + required: true, + unique: true + }, + description: { + type: String, + required: true + }, + stackleUrl: { + type: String, + required: true, + unique: true + }, + githubUrl: String, + createdUser: { + type: String, + required: true, + unique: false + } }); -module.exports = mongoose.model('Stack', stackSchema); \ No newline at end of file + +//create a stack +stackSchema.statics.createStack = function(request, response) { + try { + const validator = new Validator(request.body); + const input = validator.validateCreateStack(); + const stack = new Stack(input); + stack.save((error, insertedStack) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: insertedStack._id + }, response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//to get All stacks +stackSchema.statics.getAll = function(request, response) { + this.find({}, (error, stacksDetails) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: stacksDetails + }, response); + }); +} + +//to get stack by Name +stackSchema.statics.getByName = function(request, response) { + try { + const validator = new Validator(request.params); + const input = validator.validateGetOrganisationDetails(); + Stack.findOne({ + name: input.organisationName + }, (error, organisationDetails) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: organisationDetails + }, response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//to get Stack by Id +stackSchema.statics.getById = function(request, response) { + try { + const validator = new Validator(request.params); + const input = validator.validateStackId(); + Stack.findOne({ + _id: input.stackId + }, (error, organisationDetails) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: organisationDetails + }, response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//Only For Developer Mode. + +//Delete Stack by ID +stackSchema.statics.deleteById = function(request, response) { + try { + const validator = new Validator(request.params); + const input = validator.validateStackId(); + + this.remove({ + _id: input.stackId + }, function(err) { + if (err) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: err + }, response); + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: `Stack data removed with id : ${input.stackId}` + }, response); + + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//to delete all post +stackSchema.statics.clearAll = function(request, response) { + this.remove({}, function(err) { + if (err) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: err + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: `All Stack data removed.` + }, response); + + }); +} + +const Stack = mongoose.model('Stack', stackSchema); +module.exports = Stack; \ No newline at end of file diff --git a/stackle_api/app/models/user.js b/stackle_api/app/models/user.js index cef504b..36b5304 100644 --- a/stackle_api/app/models/user.js +++ b/stackle_api/app/models/user.js @@ -1,20 +1,427 @@ -var mongoose = require('mongoose'); - -var userSchema = mongoose.Schema({ - userId : String, - github : { - id : String, - token : String, - email : String, - name : String - }, - gitlab : { - id : String, - token : String, - email : String, - name : String - }, - subscribed_stacks : [] +const mongoose = require('mongoose'); +const Validator = require('../lib/validator').Validator; +const returnWithResponse = require('../lib/returnWithResponse'); + + +const userSchema = mongoose.Schema({ + userId: { + type: String, + required: true, + unique: true + }, + token: { + type: String, + unique: false + }, + email: { + type: String, + required: true + }, + name: { + type: String, + required: true + }, + picUrl: { + type: String, + required: false + }, + profileUrl: { + type: String, + required: false + }, + postLikes: [{ + type: mongoose.Schema.Types.ObjectId, + ref: 'Post' + }], + subscribedStacks: [{ + type: mongoose.Schema.Types.ObjectId, + ref: 'Stack' + }] }); -module.exports = mongoose.model('User', userSchema); \ No newline at end of file +// create a user +userSchema.statics.createUser = function(request, response) { + try { + const validator = new Validator(request.body); + const input = validator.validateCreateNewUser(); + const user = new User(input); + user.save(function(error, insertedUser) { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: `${insertedUser.userId} user created` + }, response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//get All user +userSchema.statics.getAll = function(request, response) { + this.find({}).populate('subscribedStacks').exec((error, data) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: data + }, response); + }); +} + +//get User by username +userSchema.statics.getById = function(request, response) { + try { + const validator = new Validator(request.params); + const input = validator.validateUserId(); + this.findOne({ + userId: input.userId + }).populate('subscribedStacks').exec((error, data) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!data) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `User: ${input.userId} not found` + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: data + }, response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//get user by db id +userSchema.statics.getByDBId = function(request, response) { + try { + const validator = new Validator(request.params); + const input = validator.validateUserId(); + + this.findOne({ + _id: input.userId + }).populate('subscribedStacks').exec((error, data) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!data) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `User: ${input.userId} not found` + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: data + }, response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + + + + +userSchema.statics.getStacks = function(request, response) { + try { + const validator = new Validator(request.params); + const input = validator.validateUserId(); + this.findOne({ + userId: input.userId + }).populate('subscribedStacks').exec((error, data) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!data) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `User: ${input.userId} not found` + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: data.subscribedStacks + }, response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//subscribe stack +userSchema.statics.subscribe = function(request, response) { + try { + const validator = new Validator(request.body); + const input = validator.validateUserSubscribeStack(); + + + this.findOne({ + userId: input.userId + }, (error, result) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!result) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `User: ${input.userId} not found` + }, response); + + var stacks = result.subscribedStacks; + var check = stacks.indexOf(input.stackId); + if (check === -1) { + result.subscribedStacks.push(input.stackId); + result.save(); + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: `user ${input.userId} subscribed to stack : ${input.stackId} ` + }, response); + } else { + return returnWithResponse.configureReturnData({ + status: 200, + success: false, + result: `user ${input.userId} Already subscribed to stack : ${input.stackId} ` + }, response); + } + + }); + + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//unsubscribe the user from stack +userSchema.statics.unsubscribe = function(request, response) { + try { + const validator = new Validator(request.body); + //validating userId and stackId in body + const input = validator.validateUserSubscribeStack(); + + this.findOne({ + userId: input.userId + }, (error, result) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!result) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `User: ${input.userId} not found` + }, response); + + var stacks = result.subscribedStacks; + var check = stacks.indexOf(input.stackId); + if (check === -1) { + return returnWithResponse.configureReturnData({ + status: 200, + success: false, + result: `user ${input.userId} is not subscribed to stack : ${input.stackId} ` + }, response); + } else { + + stacks.splice(check, 1); + result.save(); + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: `user ${input.userId} Unsubscribed to stack : ${input.stackId} ` + }, response); + } + + }); + + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +//delete all user +userSchema.statics.clearAll = function(request, response) { + this.remove({}, function(err) { + if (err) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: err + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: `All User data removed.` + }, response); + + }); +} + +//find or create user +userSchema.statics.findOrCreateUser = function(user, cb) { + this.findOne({ + userId: currentUser.userId + }).exec(function(err, data) { + + if (err) { + cb(err, false); + } else if (!data) { + var temp = new UserModel(currentUser); + temp.save(); + cb(null, temp); + } else { + data.token = token; + data.save(); + cb(null, data); + } + + }); +} + + +//LogoutHelper function +userSchema.statics.logout = function(request, response) { + this.findOne({ + token: request.query.access_token + }).exec(function(err, data) { + if (err || !data) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: 'Logout Failed! Access Denied.' + }, response); + } else { + data.token = ' '; + data.save(); + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: 'User SuccessFully Logout' + }, response); + } + + }); +} + + +//to get post likes for a user +userSchema.statics.getpostLikes = function(request, response) { + try { + const validator = new Validator(request.params); + const input = validator.validateUserId(); + + this.findOne({ + _id: input.userId + }).exec((error, data) => { + if (error) { + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: error + }, response); + } + + if (!data) + return returnWithResponse.configureReturnData({ + status: 400, + success: false, + result: `User: ${input.userId} not found` + }, response); + + + return returnWithResponse.configureReturnData({ + status: 200, + success: true, + result: data.postLikes + }, response); + }); + } catch (validationError) { + return returnWithResponse.configureReturnData({ + status: 502, + success: false, + result: validationError.toString() + }, response); + } +} + +const User = mongoose.model('User3', userSchema); +module.exports = User; \ No newline at end of file diff --git a/stackle_api/app/routes.js b/stackle_api/app/routes.js index 721dfff..3b9964a 100644 --- a/stackle_api/app/routes.js +++ b/stackle_api/app/routes.js @@ -1,209 +1,38 @@ -// application ------------------------------------------------------------- -var mongoose = require('mongoose'); - -var User = require('./models/user'); -var Stack = require('./models/stack'); - -var postModels = require('./models/post') - -var Post = postModels.Post; -var Comment = postModels.Comment; -var Reply = postModels.Reply; - -module.exports = function (app, db) { - - //api - app.get('/api/login/', function (req, res) { - }) - - app.get('/home', function (req, res) { - //needs to intergrate with github for implementation - res.end(); - }) - - //get all posts - app.get('/api/posts', function (req, res) { - res.header("Access-Control-Allow-Origin", "*"); - res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); - Post.find({}, function (err, posts) { - if (err) - console.log("Cant get all posts!") - res.send(posts); - }) - }) - - //save a post - app.post('/api/user/post', function (req, res) { - var post = new Post(req.body); - post.save(function (err, post) { - if (err) { - console.log("error saving the post"); - res.send("error!") - } else { - res.send("Sucessfully saved the post!"); - } - }); - }) - - //get a post by id - app.get('/api/post/:postid', function (req, res) { - res.header("Access-Control-Allow-Origin", "*"); - res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); - var objectid = req.params.postid; - Post.findOne({ _id: objectid }, function (err, post) { - if (err) { - res.send(err) - } else { - res.send(post); - } - }) - }) - - //delete a post by ID - app.delete('/api/post/:postid', function (req, res) { - var postid = req.params.postid; - Post.remove({ _id: postid }, function (err, success) { - if (err) { - console.log(err); - res.send("Error deleting the document"); - } else if (success) { - res.send("Sucessfully Deleted"); - } else { - console.log("Null pointer"); - } - }) - }) - - //returns posts by a specific user - app.get('/api/posts/:user', function (req, res) { - var id = req.params.user; - Post.find({ user: id }, function (err, posts) { - if (err) - console.log("Erorr getting posts"); - res.send(posts); - }) - }) - - //returns posts relating to specific org - app.get('/api/posts/org/:org_name', function (req, res) { - res.header("Access-Control-Allow-Origin", "*"); - res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); - var orgname = req.params.org_name; - Post.find({ org_name: orgname }, function (err, posts) { - if (err) - console.log(`Error getting posts from $orgname`); - else - res.send(posts); - }) - }) - - //get a specific org - app.get('/api/org/:orgname', function (req, res) { - res.header("Access-Control-Allow-Origin", "*"); - res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); - var orgname = req.params.orgname; - Stack.find({ name: orgname }, function (err, org) { - if (err) { - console.log('Error'); - } else { - res.send(org); - } - }) - }) - - //comment on a post - app.post('/api/comment/:postid', function (req, res) { - var postid = req.params.postid; - var query = { _id: postid }; - var comment = new Comment(req.body); - Post.update(query, { comments: [] }); - }) - - //get all stacks (orgs) - app.get('/api/orgs', function (req, res) { - Stack.find({}, function (err, stacks) { - if (err) - console.log("Errors retrieving stacks!"); - else - res.send(stacks); - }) - }) - - //create stack - app.post('/api/stack/create', function (req, res) { - var stack = new Stack(req.body); - stack.save(function (err, stack) { - if (err) { - console.log("Error saving the stack to database"); - res.send("Error saving stack!"); - } else if (stack) { - res.send("Sucessfully created the stack"); - } else { - res.send("Null"); - } - }) - }) - - //delete stack - app.delete('api/delete/stack/:stackid', function (req, res) { - var stack_id = req.params.stackid; - Stack.remove({ _id: stack_id }, function (err, success) { - if (err) { - res.send("Couldn't delete Stack"); - } else { - res.send("") - } - }) - }) - - //user subscribing to an stack - app.post('/api/subscribe', function (req, res) { - var userid = req.body.uid; - var stackname = req.body.stack_name; - var query = { userId : userid }; - User.findOneAndUpdate(query, {$push: {subscribed_stacks : stackname}}, function(err, noaffected){ - if(err){ - res.send("Error Updating"); - }else{ - res.send("Success!!"); - } - }); - }) - - //getting subscribed stacks for a user - app.get('/api/stack/subscribed/:userid', function(req ,res){ - res.header("Access-Control-Allow-Origin", "*"); - res.header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE, OPTIONS'); - res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); - User.findOne({userId : req.params.userid}, function(err, result){ - if(err){ - res.send(err); - }else if(result){ - var sub_stack = result.subscribed_stacks; - res.send(sub_stack); - }else{ - res.send("Can't get!"); - } - }) - }) - - //create user - app.post('/api/newuser', function (req, res) { - var user = new User(req.body); - user.save(function (err, user) { - if (err) { - console.log("Error saving the stack to database"); - res.send("Error saving user!"); - } else { - res.send("Sucessfully created the user"); - } - }) - }) - - app.get('/api/notifications', function (req, res) { }); - - app.get('/*', function (req, res) { - res.sendfile('./public/404.html'); - }); - -} +/** ------------------------- application -------------------------------- */ +'use strict'; +const mongoose = require('mongoose'); + +const User = require('./models/user'); +const Stack = require('./models/stack'); +const postModels = require('./models/post'); +const Validator = require('./lib/validator').Validator; +const returnWithResponse = require('./lib/returnWithResponse'); + +const Post = postModels.Post; +const Comment = postModels.Comment; +const Reply = postModels.Reply; + +module.exports = function(app, db) { + + // Login + app.get('/login', function(request, response) { + response.redirect('/auth/github'); + }); + + //needs to intergrate with github for implementation + app.get('/home', function(request, response) { + return returnWithResponse.configureReturnData({ + status: 501, + success: false, + result: 'Not Implemented' + }, response); + }); + + + // app.get('/api/notifications', function (request, response) { + // }); + + app.get('/*', function(request, response) { + response.sendFile('./public/404.html'); + }); +} \ No newline at end of file diff --git a/stackle_api/app/routes/comment.js b/stackle_api/app/routes/comment.js new file mode 100644 index 0000000..ddba39a --- /dev/null +++ b/stackle_api/app/routes/comment.js @@ -0,0 +1,48 @@ +const express = require('express'); +const router = express.Router(); +const postModels = require('../models/post'); + +const Model = postModels.Post; +const Comment = postModels.Comment; + +//to comment on a post +router.post('/:postId', function(request, response) { + Model.commentById(request, response); +}); + +//to get all comment for a single post +router.get('/all/:postId', function(request, response) { + Model.getAllComments(request, response); +}); + +//to clear all comment - (only for developer mode) +router.delete('/all', function(request, response) { + Comment.deleteAll(request, response); +}); + +//to get Comment by Id +router.get('/:commentId', function(request, response) { + Comment.getCommentById(request, response); +}); + +//to get like array of users +router.get('/likes/:commentId', function(request, response) { + Comment.getLikes(request, response); +}); + +//to like a comment +router.post('/likes/up/:commentId', function(request, response) { + Comment.setLikeUpComment(request, response); +}); + +//to dislike the liked comment +router.post('/likes/down/:commentId', function(request, response) { + Comment.setLikeDownComment(request, response); +}); + +//to get comment by user +router.get('/all/user/:user', function(request, response) { + Comment.getAllCommentsByUser(request, response); +}); + +module.exports = router; \ No newline at end of file diff --git a/stackle_api/app/routes/post.js b/stackle_api/app/routes/post.js new file mode 100644 index 0000000..d4e526d --- /dev/null +++ b/stackle_api/app/routes/post.js @@ -0,0 +1,67 @@ +const express = require('express'); +const router = express.Router(); +const postModels = require('../models/post'); +const Post = postModels.Post; +// const auth = require('../lib/auth'); + +//to get all posts +router.get('/all', function(request, response) { + Post.getAll(request, response); +}); + +//to get a single post by id +router.get('/:postId', function(request, response) { + Post.getById(request, response); +}); + +//to create a post +router.post('/create', function(request, response) { + Post.setPost(request, response); +}); + +//to get all posts by a specific user +router.get('/all/user/:user', function(request, response) { + Post.getAllByUser(request, response); +}); + +//to get all posts relating to specific organisation +router.get('/all/org/:organisationName', function(request, response) { + Post.getAllByOrg(request, response); +}); + +//to clear model - (only for developer mode) +router.delete('/all', function(request, response) { + Post.deleteAll(request, response); +}); + +//to delete a post by ID - (only for developer mode) +router.delete('/:postId', function(request, response) { + Post.deleteById(request, response); +}); + +//to get Likes on post +router.get('/likes/:postId', function(request, response) { + Post.getLikes(request, response); +}); + +//to like a post +router.post('/likes/up/:postId', function(request, response) { + Post.setLikeUp(request, response); +}); + +//to dislike the liked post +router.post('/likes/down/:postId', function(request, response) { + Post.setLikeDown(request, response); +}); + +//to add tag to post +router.post('/tag/add/:postId', function(request, response) { + Post.addTag(request, response); +}); + +//to remove tag from post +router.post('/tag/remove/:postId', function(request, response) { + Post.removeTag(request, response); +}); + +module.exports = router; \ No newline at end of file diff --git a/stackle_api/app/routes/reply.js b/stackle_api/app/routes/reply.js new file mode 100644 index 0000000..7fa6659 --- /dev/null +++ b/stackle_api/app/routes/reply.js @@ -0,0 +1,32 @@ +const express = require('express'); +const router = express.Router(); +const models = require('../models/post'); +const Reply = models.Reply; + +//to reply on a comment +router.post('/:commentId', function(request, response) { + Reply.replyById(request, response); +}); + +//to get all replies for a single comment +router.get('/all/:commentId', function(request, response) { + Reply.getAll(request, response); +}); + +//to clear all replies - (only for developer mode) +router.delete('/all', function(request, response) { + Reply.deleteAll(request, response); +}); + +//to get reply by Id +router.get('/:replyId', function(request, response) { + Reply.getReplyById(request, response); +}); + +//to get replies by user +router.get('/all/user/:user', function(request, response) { + Reply.getAllRepliesByUser(request, response); +}); + + +module.exports = router; \ No newline at end of file diff --git a/stackle_api/app/routes/stack.js b/stackle_api/app/routes/stack.js new file mode 100644 index 0000000..a37c451 --- /dev/null +++ b/stackle_api/app/routes/stack.js @@ -0,0 +1,43 @@ +const express = require('express'); +const router = express.Router(); + +const Model = require('../models/stack'); + +//create a Stack +router.post('/create', function(request, response) { + Model.createStack(request, response); +}); + +//get All stacks +router.get('/all', function(request, response) { + Model.getAll(request, response); +}); + +//get stack by name +router.get('/name/:organisationName', function(request, response) { + Model.getByName(request, response); +}); + + +// Get stack by id +router.get('/id/:stackId', function(request, response) { + Model.getById(request, response); +}); + + +//Only for developer Mode. Never consume below two APIs + +//clear all data +router.delete('/all', function(request, response) { + Model.clearAll(request, response); +}); + +// Delete stack by id +router.delete('/:stackId', function(request, response) { + Model.deleteById(request, response); +}); + + + + +module.exports = router; \ No newline at end of file diff --git a/stackle_api/app/routes/user.js b/stackle_api/app/routes/user.js new file mode 100644 index 0000000..5e8b6f1 --- /dev/null +++ b/stackle_api/app/routes/user.js @@ -0,0 +1,53 @@ +const express = require('express'); +const router = express.Router(); +const userModel = require('../models/user'); + +//create a user +router.post('/create', function(request, response) { + userModel.createUser(request, response); +}); + +//get All users +router.get('/all', function(request, response) { + userModel.getAll(request, response); +}); + +//get current user +router.get('/:userId', function(request, response) { + userModel.getById(request, response); +}); + +//get current user by DB ID +router.get('/id/:userId', function(request, response) { + userModel.getByDBId(request, response); +}); + + +//get list of subscribed stacks +router.get('/stacks/:userId', function(request, response) { + userModel.getStacks(request, response); +}); + +//subscribe a stack +router.post('/subscribe', function(request, response) { + userModel.subscribe(request, response); +}); + +//unsubscribe a stack +router.post('/unsubscribe', function(request, response) { + userModel.unsubscribe(request, response); +}); + +// get likes post by user +router.get('/likes/post/:userId', function(request, response) { + userModel.getpostLikes(request, response); +}); + +// only for developer mode dont consume below APIs + +//clear all data +router.delete('/all', function(request, response) { + userModel.clearAll(request, response); +}); + +module.exports = router; \ No newline at end of file diff --git a/stackle_api/bin/www.js b/stackle_api/bin/www.js new file mode 100644 index 0000000..7a087cb --- /dev/null +++ b/stackle_api/bin/www.js @@ -0,0 +1,75 @@ +#!/usr/bin/env node + +/** + * Module dependencies. + */ + +const app = require("../server"); +const http = require("http"); + +/** + * Normalize a port into a number, string, or false. + */ + +function normalizePort(val) { + const port = parseInt(val, 10); + + if (isNaN(port)) { + // named pipe + return val; + } + + if (port >= 0) { + // port number + return port; + } + + return false; +} + +/** + * Get port from environment and store in Express. + */ + +const port = normalizePort(process.env.PORT || "8080"); +app.set("port", port); + +/** + * Event listener for HTTP server "error" event. + */ + +function onError(error) { + if (error.syscall !== "listen") { + throw error; + } + + // handle specific listen errors with friendly messages + switch (error.code) { + case "EACCES": + console.error(port + " requires elevated privileges"); + process.exit(1); + break; + case "EADDRINUSE": + console.error(port + " is already in use"); + process.exit(1); + break; + default: + `` + throw error; + } +} + +/** + * Create HTTP server. + */ + +const server = http.createServer(app); + +/** + * Listen on provided port, on all network interfaces. + */ + +server.listen(port, () => { + console.log("Server listening at localhost:" + port); +}); +server.on("error", onError); \ No newline at end of file diff --git a/stackle_api/config/auth.js b/stackle_api/config/auth.js new file mode 100644 index 0000000..03e2f3c --- /dev/null +++ b/stackle_api/config/auth.js @@ -0,0 +1,10 @@ +authConfig = { + + //TODO change client ID and secret key and callback url in production Environment + clientId: 'c23afb23347c52f6c3e5', + secret: '6bee728b708beebdf52a1894242efaaf1873315c', + callback: 'http://localhost:8080/auth/github/callback', + sessionSecret: 'This is a demo secret key used by session. Change it during production.' +}; + +module.exports = authConfig; \ No newline at end of file diff --git a/stackle_api/config/database.js b/stackle_api/config/database.js index 73ea9d0..aec56f0 100644 --- a/stackle_api/config/database.js +++ b/stackle_api/config/database.js @@ -1,5 +1,21 @@ module.exports = { - url : 'mongodb://localhost:27017/stackle', - alturl : 'mongodb://ordinary:H3ll0w0rld@ds149201.mlab.com:49201/stackle', + url: process.env.LOCAL_DB || "mongodb://localhost/main", + testurl: "mongodb://localhost/node-test", + alturl: "mongodb://ordinary:H3ll0w0rld@ds149201.mlab.com:49201/stackle", + option: function(version) { + var opt; + if (version < '5') { + opt = { + useMongoClient: true + }; + } + return opt; + } +}; -}; \ No newline at end of file +/* +To start local mongodb server use following command: +LINUX: sudo service mongod start +WINDOWS: mongod +For More: https://github.com/scorelab/Stackle#installing-mongodb +*/ \ No newline at end of file diff --git a/stackle_api/index.html b/stackle_api/index.html index 5e4e421..54b628d 100644 --- a/stackle_api/index.html +++ b/stackle_api/index.html @@ -6,6 +6,6 @@

Stackle API


-2017 SCoRELab +2018 SCoRELab - \ No newline at end of file + diff --git a/stackle_api/package-lock.json b/stackle_api/package-lock.json index a9720f6..29df59f 100644 --- a/stackle_api/package-lock.json +++ b/stackle_api/package-lock.json @@ -4,161 +4,468 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@uirouter/core": { - "version": "https://registry.npmjs.org/@uirouter/core/-/core-5.0.3.tgz", - "integrity": "sha1-4rWx5FGQ4gxnuk4VwBPeXU4MyrM=" + "@types/body-parser": { + "version": "1.16.7", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.16.7.tgz", + "integrity": "sha512-Obn1/GG0sYsnlAlhhSR1hvYRGBpQT+fzSi2IlGN8emCE4iu6f6xIjaq499B1sa7N9iBLzxyOUBo5bzgJd16BvA==", + "requires": { + "@types/express": "4.0.39", + "@types/node": "8.0.47" + } }, - "abbrev": { - "version": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", - "integrity": "sha1-0FVMIlZjbi9W58LlrRg/hZQo2B8=" + "@types/express": { + "version": "4.0.39", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.0.39.tgz", + "integrity": "sha512-dBUam7jEjyuEofigUXCtublUHknRZvcRgITlGsTbFgPvnTwtQUt2NgLakbsf+PsGo/Nupqr3IXCYsOpBpofyrA==", + "requires": { + "@types/body-parser": "1.16.7", + "@types/express-serve-static-core": "4.0.55", + "@types/serve-static": "1.13.0" + } + }, + "@types/express-jwt": { + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/@types/express-jwt/-/express-jwt-0.0.34.tgz", + "integrity": "sha1-/b7kxq9cCiRu8qkz9VGZc8dxfwI=", + "requires": { + "@types/express": "4.0.39", + "@types/express-unless": "0.0.32" + } }, - "accepts": { - "version": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", - "integrity": "sha1-w8p0NJOGSMPg2cHjKN1otiLChMo=", + "@types/express-serve-static-core": { + "version": "4.0.55", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.0.55.tgz", + "integrity": "sha512-sDFubLXpgiluVW+2txOp877cQp7FyWYB9eMJTm3oAsX4HlGqIKiPcNpJq5XDKCTOMuVbnNMALYmayaj9KlRntg==", "requires": { - "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.16.tgz", - "negotiator": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz" + "@types/node": "8.0.47" } }, - "angular": { - "version": "https://registry.npmjs.org/angular/-/angular-1.6.5.tgz", - "integrity": "sha1-N/eI7r7Fzi4/oCsXu8sqIxV2oNY=" + "@types/express-unless": { + "version": "0.0.32", + "resolved": "https://registry.npmjs.org/@types/express-unless/-/express-unless-0.0.32.tgz", + "integrity": "sha512-6YpJyFNlDDnPnRjMOvJCoDYlSDDmG/OEEUsPk7yhNkL4G9hUYtgab6vi1CcWsGSSSM0CsvNlWTG+ywAGnvF03g==", + "requires": { + "@types/express": "4.0.39" + } + }, + "@types/mime": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.0.tgz", + "integrity": "sha512-A2TAGbTFdBw9azHbpVd+/FkdW2T6msN1uct1O9bH3vTerEHKZhTXJUQXy+hNq1B0RagfU8U+KBdqiZpxjhOUQA==" + }, + "@types/node": { + "version": "8.0.47", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.47.tgz", + "integrity": "sha512-kOwL746WVvt/9Phf6/JgX/bsGQvbrK5iUgzyfwZNcKVFcjAUVSpF9HxevLTld2SG9aywYHOILj38arDdY1r/iQ==" }, - "angular-jwt": { - "version": "https://registry.npmjs.org/angular-jwt/-/angular-jwt-0.1.9.tgz", - "integrity": "sha1-24vPGPBapXMgrC/aFh1+liLAmcM=" + "@types/serve-static": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.0.tgz", + "integrity": "sha512-wvQkePwCDZoyQPGb64DTl2TEeLw54CQFXjY+tznxYYxNcBb4LG40ezoVbMDa0epwE4yogB0f42jCaH0356x5Mg==", + "requires": { + "@types/express-serve-static-core": "4.0.55", + "@types/mime": "2.0.0" + } }, - "angular-storage": { - "version": "https://registry.npmjs.org/angular-storage/-/angular-storage-0.0.15.tgz", - "integrity": "sha1-AF1kgImChI2UlyXisr+Qod0nr8E=" + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + }, + "ajv": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.3.0.tgz", + "integrity": "sha1-RBT/dKUIecII7l/cgm4ywwNUnto=", + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } }, - "angular-ui-router": { - "version": "https://registry.npmjs.org/angular-ui-router/-/angular-ui-router-1.0.3.tgz", - "integrity": "sha1-vySUyq6Vw3zwGvN2HYl0fP7S20U=", + "ansi-align": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", + "integrity": "sha1-w2rsy6VjuJzrVW82kPCx2eNUf38=", "requires": { - "@uirouter/core": "https://registry.npmjs.org/@uirouter/core/-/core-5.0.3.tgz" + "string-width": "2.1.1" } }, "ansi-regex": { - "version": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" }, "ansi-styles": { - "version": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "1.9.2" + } }, "anymatch": { - "version": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha1-VT3Lj5HjyImEXf26NMd3IbkLnXo=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", "requires": { - "micromatch": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "normalize-path": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz" + "micromatch": "3.1.10", + "normalize-path": "2.1.1" } }, "arr-diff": { - "version": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", - "requires": { - "arr-flatten": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" }, "arr-flatten": { - "version": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" }, "array-flatten": { - "version": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" }, "array-unique": { - "version": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=" + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" }, + "assertion-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.2.tgz", - "integrity": "sha1-E8pRXYYgbaC6xm6DTdOX2HWBCUw=", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, + + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" + }, "async": { - "version": "https://registry.npmjs.org/async/-/async-2.1.4.tgz", - "integrity": "sha1-LSFgx3iAMuTdbL4lAvH5osj2zeQ=", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", "requires": { - "lodash": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz" + "lodash": "4.17.10" } }, "async-each": { - "version": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=" }, - "auth0-angular": { - "version": "https://registry.npmjs.org/auth0-angular/-/auth0-angular-4.2.7.tgz", - "integrity": "sha1-Y9n/uAlhfRBRGlD0JwMAuAp/ptk=" + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "atob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", + "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" }, "balanced-match": { - "version": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "requires": { + "cache-base": "1.0.1", + "class-utils": "0.3.6", + "component-emitter": "1.2.1", + "define-property": "1.0.0", + "isobject": "3.0.1", + "mixin-deep": "1.3.1", + "pascalcase": "0.1.1" + }, + "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + }, + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "1.0.2" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, + "base64url": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64url/-/base64url-2.0.0.tgz", + "integrity": "sha1-6sFuA+oUOO/5Qj1puqNiYu0fcLs=" + }, "basic-auth": { - "version": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.1.0.tgz", - "integrity": "sha1-RSIe5Cn37h5QNb4/UVM/HN/SmIQ=" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.0.tgz", + "integrity": "sha1-AV2z81PgLlY3d1X5YnQuiYHnu7o=", + "requires": { + "safe-buffer": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz" + } + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } }, "binary-extensions": { - "version": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.9.0.tgz", - "integrity": "sha1-ZlBsFs5vTWkopbPNajPKQelB43s=" + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=" }, "bluebird": { - "version": "https://registry.npmjs.org/bluebird/-/bluebird-2.10.2.tgz", - "integrity": "sha1-AkpVFylTCIV/FPkfEQb8O1VfRGs=" + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.0.tgz", + "integrity": "sha1-eRQg1/VR7qKJdFOop3ZT+WYG1nw=" }, "body-parser": { - "version": "https://registry.npmjs.org/body-parser/-/body-parser-1.17.2.tgz", - "integrity": "sha1-+IkqvI+eYn1Crtr7yma/WrmRBO4=", + "version": "1.18.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz", + "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=", + "requires": { + "bytes": "3.0.0", + "content-type": "1.0.4", + "debug": "2.6.9", + "depd": "1.1.2", + "http-errors": "1.6.3", + "iconv-lite": "0.4.23", + "on-finished": "2.3.0", + "qs": "6.5.2", + "raw-body": "2.3.3", + "type-is": "1.6.16" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", + "requires": { + "depd": "1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": "1.4.0" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + } + } + }, + "boom": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", + "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", "requires": { - "bytes": "https://registry.npmjs.org/bytes/-/bytes-2.4.0.tgz", - "content-type": "https://registry.npmjs.org/content-type/-/content-type-1.0.2.tgz", - "debug": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz", - "depd": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", - "http-errors": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.1.tgz", - "iconv-lite": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.15.tgz", - "on-finished": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "qs": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", - "raw-body": "https://registry.npmjs.org/raw-body/-/raw-body-2.2.0.tgz", - "type-is": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz" + "hoek": "4.2.0" + }, + "dependencies": { + "hoek": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz", + "integrity": "sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ==" + } } }, - "bower": { - "version": "https://registry.npmjs.org/bower/-/bower-1.8.0.tgz", - "integrity": "sha1-Vdvr7wrZFVOC2enT5JfBNyNFtEo=" + "boxen": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-1.3.0.tgz", + "integrity": "sha512-TNPjfTr432qx7yOjQyaXm3dSR0MH9vXp7eT1BFSl/C51g+EFnOR9hTg1IreahGBmDNCehscshe45f+C1TBZbLw==", + "requires": { + "ansi-align": "2.0.0", + "camelcase": "4.1.0", + "chalk": "2.4.1", + "cli-boxes": "1.0.0", + "string-width": "2.1.1", + "term-size": "1.2.0", + "widest-line": "2.0.0" + } }, "brace-expansion": { - "version": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", - "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { - "balanced-match": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "concat-map": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + "balanced-match": "1.0.0", + "concat-map": "0.0.1" } }, "braces": { - "version": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "requires": { - "expand-range": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "preserve": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "repeat-element": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz" + "arr-flatten": "1.1.0", + "array-unique": "0.3.2", + "extend-shallow": "2.0.1", + "fill-range": "4.0.0", + "isobject": "3.0.1", + "repeat-element": "1.1.2", + "snapdragon": "0.8.2", + "snapdragon-node": "2.1.1", + "split-string": "3.1.0", + "to-regex": "3.0.2" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + } } }, "bson": { - "version": "https://registry.npmjs.org/bson/-/bson-1.0.4.tgz", - "integrity": "sha1-k8ENOeqltYQVy8QFLz5T5WKwtyw=" + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/bson/-/bson-1.0.9.tgz", + "integrity": "sha512-IQX9/h7WdMBIW/q/++tGd+emQr0XMdeZ6icnT/74Xk9fnabWn+gZgpE+9V+gujL3hhJOoNrnDVY7tWdzc7NUTg==" }, - "buffer-shims": { - "version": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", - "integrity": "sha1-mXjOMXOIxkmth5MCjDR37wRKi1E=" + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" }, "bytes": { - "version": "https://registry.npmjs.org/bytes/-/bytes-2.4.0.tgz", - "integrity": "sha1-fZcZb51br39pNeJZhVSe3SpsIzk=" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "requires": { + "collection-visit": "1.0.0", + "component-emitter": "1.2.1", + "get-value": "2.0.6", + "has-value": "1.0.0", + "isobject": "3.0.1", + "set-value": "2.0.0", + "to-object-path": "0.3.0", + "union-value": "1.0.0", + "unset-value": "1.0.0" + }, + "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + } + } + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" + }, + "capture-stack-trace": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz", + "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0=" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, "chai": { "version": "3.5.0", @@ -166,9 +473,40 @@ "integrity": "sha1-TQJjewZ/6Vi9v906QOxW/vc3Mkc=", "dev": true, "requires": { - "assertion-error": "1.0.2", + "assertion-error": "1.1.0", "deep-eql": "0.1.3", "type-detect": "1.0.0" + }, + "dependencies": { + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "deep-eql": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", + "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", + "dev": true, + "requires": { + "type-detect": "0.1.1" + }, + "dependencies": { + "type-detect": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", + "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=", + "dev": true + } + } + }, + "type-detect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-1.0.0.tgz", + "integrity": "sha1-diIXzAbbJY7EiQihKY6LlRIejqI=", + "dev": true + } } }, "chai-http": { @@ -184,378 +522,2429 @@ "superagent": "1.2.0" }, "dependencies": { + "async": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", + "dev": true + }, + "combined-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", + "integrity": "sha1-ATfmV7qlp1QcV6w3rF/AfXO03B8=", + "dev": true, + "requires": { + "delayed-stream": "0.0.5" + } + }, + "component-emitter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz", + "integrity": "sha1-KWWU8nU9qmOZbSrwjRWpURbJrsM=", + "dev": true + }, + "cookiejar": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.0.6.tgz", + "integrity": "sha1-Cr81atANHFohnYjURRgEbdAmrP4=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "delayed-stream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz", + "integrity": "sha1-1LH0OpPoKW3+AmlPRoC8N6MTxz8=", + "dev": true + }, + "extend": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-1.2.1.tgz", + "integrity": "sha1-oPX9bPyDpf5J72mNYOyKYk3UV2w=", + "dev": true + }, + "form-data": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz", + "integrity": "sha1-Jvi8JtpkQOKZy9z7aQNcT3em5GY=", + "dev": true, + "requires": { + "async": "0.9.2", + "combined-stream": "0.0.7", + "mime-types": "2.0.14" + } + }, + "formidable": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.0.14.tgz", + "integrity": "sha1-Kz9MQRy7X91pXESEPiojUUpDIxo=", + "dev": true + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "ip-regex": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-1.0.3.tgz", + "integrity": "sha1-3FiQdvZZ9BnCIgOaMzFvHHOH7/0=", + "dev": true + }, + "is-ip": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-1.0.0.tgz", + "integrity": "sha1-K7aVn3l8zW+f3IEnWLy8h8TFkHQ=", + "dev": true, + "requires": { + "ip-regex": "1.0.3" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, "methods": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/methods/-/methods-0.0.1.tgz", "integrity": "sha1-J3yQ+L7zlwlkWoNxxRw7bGSOBow=", "dev": true }, + "mime-db": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.12.0.tgz", + "integrity": "sha1-PQxjGA9FjrENMlqqN9fFiuMS6dc=", + "dev": true + }, + "mime-types": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz", + "integrity": "sha1-MQ4VnbI+B3+Lsit0jav6SVcUCqY=", + "dev": true, + "requires": { + "mime-db": "1.12.0" + } + }, "qs": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/qs/-/qs-2.0.0.tgz", "integrity": "sha1-QjNE0qEySo63IeJ1hteVGP8Hh88=", "dev": true + }, + "readable-stream": { + "version": "1.0.27-1", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.27-1.tgz", + "integrity": "sha1-a2eYPCA1fO/QfwFlABoW1xDZEHg=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "reduce-component": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/reduce-component/-/reduce-component-1.0.1.tgz", + "integrity": "sha1-4Mk1QsV0UhvqE98PlIjtgqt3xdo=", + "dev": true + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "superagent": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-1.2.0.tgz", + "integrity": "sha1-qsJiUzwexVOBRKETcc028kSldP0=", + "dev": true, + "requires": { + "component-emitter": "1.1.2", + "cookiejar": "2.0.1", + "debug": "2.6.9", + "extend": "1.2.1", + "form-data": "0.2.0", + "formidable": "1.0.14", + "methods": "1.0.1", + "mime": "1.3.4", + "qs": "2.3.3", + "readable-stream": "1.0.27-1", + "reduce-component": "1.0.1" + }, + "dependencies": { + "cookiejar": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.0.1.tgz", + "integrity": "sha1-PRJ1L2rfaKiS8zJDNJK9WBK7Zo8=", + "dev": true + }, + "methods": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.0.1.tgz", + "integrity": "sha1-dbyRlD3/19oDfPPusO1zoAN80Us=", + "dev": true + }, + "qs": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz", + "integrity": "sha1-6eha2+ddoLvkyOBHaghikPhjtAQ=", + "dev": true + } + } } } }, "chalk": { - "version": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "requires": { - "ansi-styles": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "escape-string-regexp": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "has-ansi": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "supports-color": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" } }, "chokidar": { - "version": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", - "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.4.tgz", + "integrity": "sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ==", "requires": { - "anymatch": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "async-each": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "glob-parent": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "is-binary-path": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "path-is-absolute": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "readdirp": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz" + "anymatch": "2.0.0", + "async-each": "1.0.1", + "braces": "2.3.2", + "fsevents": "1.2.4", + "glob-parent": "3.1.0", + "inherits": "2.0.3", + "is-binary-path": "1.0.1", + "is-glob": "4.0.0", + "lodash.debounce": "4.0.8", + "normalize-path": "2.1.1", + "path-is-absolute": "1.0.1", + "readdirp": "2.1.0", + "upath": "1.1.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + } } }, - "combined-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-0.0.7.tgz", - "integrity": "sha1-ATfmV7qlp1QcV6w3rF/AfXO03B8=", - "dev": true, + "ci-info": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.1.3.tgz", + "integrity": "sha512-SK/846h/Rcy8q9Z9CAwGBLfCJ6EkjJWdpelWDufQpqVDYq2Wnnv8zlSO6AMQap02jvhVruKKpEtQOufo3pFhLg==" + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "requires": { + "arr-union": "3.1.0", + "define-property": "0.2.5", + "isobject": "3.0.1", + "static-extend": "0.1.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.6" + } + } + } + }, + "cli-boxes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-1.0.0.tgz", + "integrity": "sha1-T6kXw+WclKAEzWH47lCdplFocUM=" + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "requires": { + "map-visit": "1.0.0", + "object-visit": "1.0.1" + } + }, + "color-convert": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.2.tgz", + "integrity": "sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg==", "requires": { - "delayed-stream": "0.0.5" + "color-name": "1.1.1" } }, + "color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=" + }, + "commander": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.3.0.tgz", "integrity": "sha1-/UMOiJgy7DU7ms0d4hfBHLPu+HM=", "dev": true }, - "component-emitter": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz", - "integrity": "sha1-KWWU8nU9qmOZbSrwjRWpURbJrsM=", - "dev": true - }, + "concat-map": { - "version": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, "configstore": { - "version": "https://registry.npmjs.org/configstore/-/configstore-1.4.0.tgz", - "integrity": "sha1-w1eB0FAdJowlxUuLF/YkDopPsCE=", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz", + "integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==", "requires": { - "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "os-tmpdir": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "osenv": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", - "uuid": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", - "write-file-atomic": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", - "xdg-basedir": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-2.0.0.tgz" + "dot-prop": "4.2.0", + "graceful-fs": "4.1.11", + "make-dir": "1.3.0", + "unique-string": "1.0.0", + "write-file-atomic": "2.3.0", + "xdg-basedir": "3.0.0" } }, "content-disposition": { - "version": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=" }, "content-type": { - "version": "https://registry.npmjs.org/content-type/-/content-type-1.0.2.tgz", - "integrity": "sha1-t9ETrueo3Se9IRM8TcJSnfFyHu0=" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" }, "cookie": { - "version": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" }, "cookie-signature": { - "version": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, - "cookiejar": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.0.6.tgz", - "integrity": "sha1-Cr81atANHFohnYjURRgEbdAmrP4=", - "dev": true + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" }, "core-util-is": { "version": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, - "debug": { - "version": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz", - "integrity": "sha1-krrR9tBbu2u6Isyoi80OyJTChh4=", + "cors": { + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.4.tgz", + "integrity": "sha1-K9OB8usgECAQXNUOpZ2mMJBpRoY=", "requires": { - "ms": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" + "object-assign": "4.1.1", + "vary": "1.1.2" } }, - "deep-eql": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", - "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", - "dev": true, + "crc": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/crc/-/crc-3.4.4.tgz", + "integrity": "sha1-naHpgOO9RPxck79as9ozeNheRms=" + }, + "create-error-class": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/create-error-class/-/create-error-class-3.0.2.tgz", + "integrity": "sha1-Br56vvlHo/FKMP1hBnHUAbyot7Y=", "requires": { - "type-detect": "0.1.1" + "capture-stack-trace": "1.0.0" + } + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "requires": { + "lru-cache": "4.1.3", + "shebang-command": "1.2.0", + "which": "1.3.1" }, "dependencies": { - "type-detect": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", - "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=", - "dev": true + "lru-cache": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } } } }, - "deep-extend": { - "version": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", - "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=" - }, - "delayed-stream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz", - "integrity": "sha1-1LH0OpPoKW3+AmlPRoC8N6MTxz8=", - "dev": true - }, - "depd": { - "version": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", + "cryptiles": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", + "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", + "requires": { + "boom": "5.2.0" + }, + "dependencies": { + "boom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", + "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", + "requires": { + "hoek": "4.2.0" + } + }, + "hoek": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz", + "integrity": "sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ==" + } + } + }, + "crypto-random-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", + "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=" + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "1.0.0" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + }, + + "deep-eql": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", + "integrity": "sha1-71WKyrjeJSBs1xOQbXTlaTDrafI=", + "dev": true, + "requires": { + "type-detect": "0.1.1" + }, + "dependencies": { + "type-detect": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-0.1.1.tgz", + "integrity": "sha1-C6XsKohWQORw6k6FBZcZANrFiCI=", + "dev": true + } + } + }, + + "deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "requires": { + "is-descriptor": "1.0.2", + "isobject": "3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } + } + }, + "depd": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=" }, "destroy": { - "version": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" }, + "diff": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/diff/-/diff-1.4.0.tgz", "integrity": "sha1-fyjS657nsVqX79ic5j3P2qPMur8=", "dev": true }, + + "dot-prop": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", + "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "requires": { + "is-obj": "1.0.1" + } + }, + "dotenv": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-5.0.1.tgz", + "integrity": "sha512-4As8uPrjfwb7VXC+WnLCbXK7y+Ueb2B3zgNCePYfhxS1PYeaO1YTeplffTEcbfLhvFNGLAz90VvJs9yomG7bow==" + }, "duplexer": { - "version": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=" }, - "duplexify": { - "version": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.0.tgz", - "integrity": "sha1-GqdzAC4VeEV+nZ1KULDMquvL1gQ=", + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "optional": true, "requires": { - "end-of-stream": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.0.0.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.7.tgz", - "stream-shift": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz" + "jsbn": "0.1.1" } }, - "ee-first": { - "version": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" - }, - "encodeurl": { - "version": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", - "integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=" - }, - "end-of-stream": { - "version": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.0.0.tgz", - "integrity": "sha1-1FlucCc0qT5A6a+GQxnqvZn/Lw4=", + "ecdsa-sig-formatter": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.9.tgz", + "integrity": "sha1-S8kmJ07Dtau1AW5+HWCSGsJisqE=", "requires": { - "once": "https://registry.npmjs.org/once/-/once-1.3.3.tgz" + "base64url": "2.0.0", + "safe-buffer": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz" } }, - "es6-promise": { - "version": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.2.1.tgz", - "integrity": "sha1-7FYjOGgDKQkgcXDDlEjiREndH8Q=" + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "escape-html": { - "version": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" }, "escape-string-regexp": { - "version": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "etag": { - "version": "https://registry.npmjs.org/etag/-/etag-1.8.0.tgz", - "integrity": "sha1-b2Ma7zNtbEY2K1F2QETOIWvjwFE=" + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" }, "event-stream": { - "version": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", + "version": "3.3.4", + "resolved": "http://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", "requires": { - "duplexer": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "from": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "map-stream": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "pause-stream": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "split": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "stream-combiner": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + "duplexer": "0.1.1", + "from": "0.1.7", + "map-stream": "0.1.0", + "pause-stream": "0.0.11", + "split": "0.3.3", + "stream-combiner": "0.0.4", + "through": "2.3.8" } }, - "expand-brackets": { - "version": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", "requires": { - "is-posix-bracket": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz" + "cross-spawn": "5.1.0", + "get-stream": "3.0.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" } }, - "expand-range": { - "version": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "requires": { - "fill-range": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz" + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "posix-character-classes": "0.1.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } } }, "express": { - "version": "https://registry.npmjs.org/express/-/express-4.15.3.tgz", - "integrity": "sha1-urZdDwOqgMNYQIly/HAPkWlEtmI=", - "requires": { - "accepts": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", - "array-flatten": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "content-disposition": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", - "content-type": "https://registry.npmjs.org/content-type/-/content-type-1.0.2.tgz", - "cookie": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", - "cookie-signature": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "debug": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz", - "depd": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", - "encodeurl": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", - "escape-html": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "etag": "https://registry.npmjs.org/etag/-/etag-1.8.0.tgz", - "finalhandler": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.3.tgz", - "fresh": "https://registry.npmjs.org/fresh/-/fresh-0.5.0.tgz", - "merge-descriptors": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "methods": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "on-finished": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "parseurl": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz", - "path-to-regexp": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "proxy-addr": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.1.5.tgz", - "qs": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", - "range-parser": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "send": "https://registry.npmjs.org/send/-/send-0.15.3.tgz", - "serve-static": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.3.tgz", - "setprototypeof": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", - "statuses": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", - "type-is": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz", - "utils-merge": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", - "vary": "https://registry.npmjs.org/vary/-/vary-1.1.1.tgz" - } - }, - "extend": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-1.2.1.tgz", - "integrity": "sha1-oPX9bPyDpf5J72mNYOyKYk3UV2w=", - "dev": true + "version": "4.16.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz", + "integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", + "requires": { + "accepts": "1.3.5", + "array-flatten": "1.1.1", + "body-parser": "1.18.2", + "content-disposition": "0.5.2", + "content-type": "1.0.4", + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "1.1.2", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "finalhandler": "1.1.1", + "fresh": "0.5.2", + "merge-descriptors": "1.0.1", + "methods": "1.1.2", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "path-to-regexp": "0.1.7", + "proxy-addr": "2.0.3", + "qs": "6.5.1", + "range-parser": "1.2.0", + "safe-buffer": "5.1.1", + "send": "0.16.2", + "serve-static": "1.13.2", + "setprototypeof": "1.1.0", + "statuses": "1.4.0", + "type-is": "1.6.16", + "utils-merge": "1.0.1", + "vary": "1.1.2" + }, + "dependencies": { + "accepts": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", + "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", + "requires": { + "mime-types": "2.1.18", + "negotiator": "0.6.1" + } + }, + "body-parser": { + "version": "1.18.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz", + "integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=", + "requires": { + "bytes": "3.0.0", + "content-type": "1.0.4", + "debug": "2.6.9", + "depd": "1.1.2", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "on-finished": "2.3.0", + "qs": "6.5.1", + "raw-body": "2.3.2", + "type-is": "1.6.16" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "finalhandler": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", + "requires": { + "debug": "2.6.9", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "on-finished": "2.3.0", + "parseurl": "1.3.2", + "statuses": "1.4.0", + "unpipe": "1.0.0" + } + }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" + }, + "ipaddr.js": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.6.0.tgz", + "integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs=" + }, + "mime": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz", + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" + }, + "mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "requires": { + "mime-db": "1.33.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "proxy-addr": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz", + "integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==", + "requires": { + "forwarded": "0.1.2", + "ipaddr.js": "1.6.0" + } + }, + "raw-body": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz", + "integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=", + "requires": { + "bytes": "3.0.0", + "http-errors": "1.6.2", + "iconv-lite": "0.4.19", + "unpipe": "1.0.0" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "send": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz", + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==", + "requires": { + "debug": "2.6.9", + "depd": "1.1.2", + "destroy": "1.0.4", + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "etag": "1.8.1", + "fresh": "0.5.2", + "http-errors": "1.6.2", + "mime": "1.4.1", + "ms": "2.0.0", + "on-finished": "2.3.0", + "range-parser": "1.2.0", + "statuses": "1.4.0" + } + }, + "serve-static": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz", + "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", + "requires": { + "encodeurl": "1.0.2", + "escape-html": "1.0.3", + "parseurl": "1.3.2", + "send": "0.16.2" + } + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" + }, + "type-is": { + "version": "1.6.16", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", + "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "2.1.18" + } + } + } + }, + "express-jwt": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/express-jwt/-/express-jwt-5.3.1.tgz", + "integrity": "sha512-1C9RNq0wMp/JvsH/qZMlg3SIPvKu14YkZ4YYv7gJQ1Vq+Dv8LH9tLKenS5vMNth45gTlEUGx+ycp9IHIlaHP/g==", + "requires": { + "async": "1.5.2", + "express-unless": "0.3.1", + "jsonwebtoken": "8.2.1", + "lodash.set": "4.3.2" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "jsonwebtoken": { + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.2.1.tgz", + "integrity": "sha512-l8rUBr0fqYYwPc8/ZGrue7GiW7vWdZtZqelxo4Sd5lMvuEeCK8/wS54sEo6tJhdZ6hqfutsj6COgC0d1XdbHGw==", + "requires": { + "jws": "3.1.4", + "lodash.includes": "4.3.0", + "lodash.isboolean": "3.0.3", + "lodash.isinteger": "4.0.4", + "lodash.isnumber": "3.0.3", + "lodash.isplainobject": "4.0.6", + "lodash.isstring": "4.0.1", + "lodash.once": "4.1.1", + "ms": "2.1.1", + "xtend": "4.0.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + } + } + }, + "express-session": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.15.6.tgz", + "integrity": "sha512-r0nrHTCYtAMrFwZ0kBzZEXa1vtPVrw0dKvGSrKP4dahwBQ1BJpF2/y1Pp4sCD/0kvxV4zZeclyvfmw0B4RMJQA==", + "requires": { + "cookie": "0.3.1", + "cookie-signature": "1.0.6", + "crc": "3.4.4", + "debug": "2.6.9", + "depd": "1.1.1", + "on-headers": "1.0.1", + "parseurl": "1.3.2", + "uid-safe": "2.1.5", + "utils-merge": "1.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } + }, + "express-unless": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/express-unless/-/express-unless-0.3.1.tgz", + "integrity": "sha1-JVfBRudb65A+LSR/m1ugFFJpbiA=" + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "requires": { + "assign-symbols": "1.0.0", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "2.0.4" + } + } + } }, "extglob": { - "version": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "requires": { - "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" + "array-unique": "0.3.2", + "define-property": "1.0.0", + "expand-brackets": "2.1.4", + "extend-shallow": "2.0.1", + "fragment-cache": "0.2.1", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "1.0.2" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } } }, - "filename-regex": { - "version": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=" + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz", + "integrity": "sha1-liVqO8l1WV6zbYLpkp0GDYk0Of8=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" }, "fill-range": { - "version": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "requires": { + "extend-shallow": "2.0.1", + "is-number": "3.0.0", + "repeat-string": "1.6.1", + "to-regex-range": "2.1.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + } + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "forwarded": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=" + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "requires": { - "is-number": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "isobject": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "randomatic": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "repeat-element": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "repeat-string": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" + "map-cache": "0.2.2" } }, - "finalhandler": { - "version": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.0.3.tgz", - "integrity": "sha1-70fneVDpmXgOhgIqVg4yF+DQzIk=", + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "from": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", + "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=" + }, + "fsevents": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", + "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "optional": true, "requires": { - "debug": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz", - "encodeurl": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", - "escape-html": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "on-finished": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "parseurl": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz", - "statuses": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", - "unpipe": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz" + "nan": "2.10.0", + "node-pre-gyp": "0.10.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.3.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.0.1", + "bundled": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.5.1", + "bundled": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "optional": true, + "requires": { + "minipass": "2.2.4" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "optional": true, + "requires": { + "aproba": "1.2.0", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "optional": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.21", + "bundled": true, + "optional": true, + "requires": { + "safer-buffer": "2.1.2" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "optional": true, + "requires": { + "minimatch": "3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "optional": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true + }, + "minipass": { + "version": "2.2.4", + "bundled": true, + "requires": { + "safe-buffer": "5.1.1", + "yallist": "3.0.2" + } + }, + "minizlib": { + "version": "1.1.0", + "bundled": true, + "optional": true, + "requires": { + "minipass": "2.2.4" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "needle": { + "version": "2.2.0", + "bundled": true, + "optional": true, + "requires": { + "debug": "2.6.9", + "iconv-lite": "0.4.21", + "sax": "1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.0", + "bundled": true, + "optional": true, + "requires": { + "detect-libc": "1.0.3", + "mkdirp": "0.5.1", + "needle": "2.2.0", + "nopt": "4.0.1", + "npm-packlist": "1.1.10", + "npmlog": "4.1.2", + "rc": "1.2.7", + "rimraf": "2.6.2", + "semver": "5.5.0", + "tar": "4.4.1" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "optional": true, + "requires": { + "abbrev": "1.1.1", + "osenv": "0.1.5" + } + }, + "npm-bundled": { + "version": "1.0.3", + "bundled": true, + "optional": true + }, + "npm-packlist": { + "version": "1.1.10", + "bundled": true, + "optional": true, + "requires": { + "ignore-walk": "3.0.1", + "npm-bundled": "1.0.3" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "optional": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "optional": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "rc": { + "version": "1.2.7", + "bundled": true, + "optional": true, + "requires": { + "deep-extend": "0.5.1", + "ini": "1.3.5", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "optional": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "optional": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.1.1", + "bundled": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "optional": true + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "optional": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "tar": { + "version": "4.4.1", + "bundled": true, + "optional": true, + "requires": { + "chownr": "1.0.1", + "fs-minipass": "1.2.5", + "minipass": "2.2.4", + "minizlib": "1.1.0", + "mkdirp": "0.5.1", + "safe-buffer": "5.1.1", + "yallist": "3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true + } + } + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "1.0.0" + } + }, + + "glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", + "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "minimatch": "0.3.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "minimatch": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", + "integrity": "sha1-J12O2qxPG7MyZHIInnlJyDlGmd0=", + "dev": true, + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + } + } + }, + + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "requires": { + "is-glob": "3.1.0", + "path-dirname": "1.0.2" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "requires": { + "is-extglob": "2.1.1" + } + } + } + }, + "global-dirs": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", + "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", + "requires": { + "ini": "1.3.5" + } + }, + "got": { + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", + "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", + "requires": { + "create-error-class": "3.0.2", + "duplexer3": "0.1.4", + "get-stream": "3.0.0", + "is-redirect": "1.0.0", + "is-retry-allowed": "1.1.0", + "is-stream": "1.1.0", + "lowercase-keys": "1.0.1", + "safe-buffer": "5.1.2", + "timed-out": "4.0.1", + "unzip-response": "2.0.1", + "url-parse-lax": "1.0.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + }, + + "growl": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", + "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", + "dev": true + }, + + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "requires": { + "ajv": "5.3.0", + "har-schema": "2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "requires": { + "get-value": "2.0.6", + "has-values": "1.0.0", + "isobject": "3.0.1" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "hawk": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", + "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", + "requires": { + "boom": "4.3.1", + "cryptiles": "3.1.2", + "hoek": "4.2.0", + "sntp": "2.1.0" + }, + "dependencies": { + "hoek": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz", + "integrity": "sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ==" + } + } + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "requires": { + "depd": "1.1.1", + "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "setprototypeof": "1.0.3", + "statuses": "1.4.0" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "1.0.0", + "jsprim": "1.4.1", + "sshpk": "1.13.1" + } + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "requires": { + "safer-buffer": "2.1.2" + } + }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=" + }, + "import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=" + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + }, + "inherits": { + "version": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "requires": { + "binary-extensions": "1.11.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-ci": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.1.0.tgz", + "integrity": "sha512-c7TnwxLePuqIlxHgr7xtxzycJPegNHFuIrBkwbf8hc58//+Op1CqFkyS+xnIMkwn9UsJIwc174BIjkyBmSpjKg==", + "requires": { + "ci-info": "1.1.3" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "requires": { + "is-accessor-descriptor": "0.1.6", + "is-data-descriptor": "0.1.4", + "kind-of": "5.1.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "is-glob": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "requires": { + "is-extglob": "2.1.1" + } + }, + "is-installed-globally": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", + "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", + "requires": { + "global-dirs": "0.1.1", + "is-path-inside": "1.0.1" + } + }, + "is-npm": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", + "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=" + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } + } + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=" + }, + "is-odd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", + "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", + "requires": { + "is-number": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" + } + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "requires": { + "isobject": "3.0.1" + } + }, + "is-redirect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", + "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=" + }, + "is-retry-allowed": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", + "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=" + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + + "jade": { + "version": "0.26.3", + "resolved": "https://registry.npmjs.org/jade/-/jade-0.26.3.tgz", + "integrity": "sha1-jxDXl32NefL2/4YqgbBRPMslaGw=", + "dev": true, + "requires": { + "commander": "0.6.1", + "mkdirp": "0.3.0" + }, + "dependencies": { + "commander": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz", + "integrity": "sha1-+mihT2qUXVTbvlDYzbMyDp47GgY=", + "dev": true + }, + "mkdirp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz", + "integrity": "sha1-G79asbqCevI1dRQ0kEJkVfSB/h4=", + "dev": true + } + } + }, + + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "jwa": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.5.tgz", + "integrity": "sha1-oFUs4CIHQs1S4VN3SjKQXDDnVuU=", + "requires": { + "base64url": "2.0.0", + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.9", + "safe-buffer": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz" + } + }, + "jwks-rsa": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/jwks-rsa/-/jwks-rsa-1.2.1.tgz", + "integrity": "sha512-xg+fw7FOV4eGdDIEMqQJvPLmFv85h4uN+j/GKwJZAxlCrDQpM8ov1F709xKGEp/dG3l4TUxoSOeN6YK7+KpinQ==", + "requires": { + "@types/express-jwt": "0.0.34", + "debug": "2.6.9", + "limiter": "1.1.2", + "lru-memoizer": "1.11.1", + "ms": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "request": "2.83.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" + } + } + } + }, + "jws": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.4.tgz", + "integrity": "sha1-+ei5M46KhHJ31kRLFGT2GIDgUKI=", + "requires": { + "base64url": "2.0.0", + "jwa": "1.1.5", + "safe-buffer": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz" + } + }, + "kareem": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.2.1.tgz", + "integrity": "sha512-xpDFy8OxkFM+vK6pXy6JmH92ibeEFUuDWzas5M9L7MzVmHW3jzwAHxodCPV/BYkf4A31bVDLyonrMfp9RXb/oA==" + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + }, + "latest-version": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-3.1.0.tgz", + "integrity": "sha1-ogU4P+oyKzO1rjsYq+4NwvNW7hU=", + "requires": { + "package-json": "4.0.1" + } + }, + "limiter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.2.tgz", + "integrity": "sha512-JIKZ0xb6fZZYa3deZ0BgXCgX6HgV8Nx3mFGeFHmFWW8Fb2c08e0CyE+G3nalpD0xGvGssjGb1UdFr+PprxZEbw==" + }, + "lock": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/lock/-/lock-0.1.4.tgz", + "integrity": "sha1-/sfervF+fDoKVeHaBCgD4l2RdF0=" + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" + }, + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" + }, + "lodash.includes": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + "integrity": "sha1-YLuYqHy5I8aMoeUTJUgzFISfVT8=" + }, + "lodash.isboolean": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + "integrity": "sha1-bC4XHbKiV82WgC/UOwGyDV9YcPY=" + }, + "lodash.isinteger": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + "integrity": "sha1-YZwK89A/iwTDH1iChAt3sRzWg0M=" + }, + "lodash.isnumber": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + "integrity": "sha1-POdoEMWSjQM1IwGsKHMX8RwLH/w=" + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=" + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=" + }, + "lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha1-DdOXEhPHxW34gJd9UEyI+0cal6w=" + }, + "lodash.set": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", + "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=" + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" + }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", + "dev": true + }, + "lru-memoizer": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/lru-memoizer/-/lru-memoizer-1.11.1.tgz", + "integrity": "sha1-BpP2EAWTkUwC4ZK/m42TiEy/UNM=", + "requires": { + "lock": "0.1.4", + "lodash": "4.5.1", + "lru-cache": "4.0.2", + "very-fast-args": "1.1.0" + }, + "dependencies": { + "lodash": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.5.1.tgz", + "integrity": "sha1-gOigdMpfOJOmscELKmNkktcQwxY=" + }, + "lru-cache": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.2.tgz", + "integrity": "sha1-HRdnnAac2l0ECZGgnbwsDbN35V4=", + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + } + } + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "requires": { + "pify": "3.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" + }, + "map-stream": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", + "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=" + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "requires": { + "object-visit": "1.0.1" + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + }, + "method-override": { + "version": "2.3.10", + "resolved": "https://registry.npmjs.org/method-override/-/method-override-2.3.10.tgz", + "integrity": "sha1-49r41d7hDdLc59SuiNYrvud0drQ=", + "requires": { + "debug": "2.6.9", + "methods": "1.1.2", + "parseurl": "1.3.2", + "vary": "1.1.2" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" + } + } + } + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "braces": "2.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "extglob": "2.0.4", + "fragment-cache": "0.2.1", + "kind-of": "6.0.2", + "nanomatch": "1.2.9", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } + }, + "mime": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", + "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=", + "dev": true + }, + "mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "requires": { + "mime-db": "1.33.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "requires": { + "for-in": "1.0.2", + "is-extendable": "1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "2.0.4" + } + } } }, - "for-in": { - "version": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" - }, - "for-own": { - "version": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, "requires": { - "for-in": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz" + "minimist": "0.0.8" } }, - "form-data": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-0.2.0.tgz", - "integrity": "sha1-Jvi8JtpkQOKZy9z7aQNcT3em5GY=", + + "mocha": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-2.5.3.tgz", + "integrity": "sha1-FhvlvetJZ3HrmzV0UFC2IrWu/Fg=", "dev": true, "requires": { - "async": "0.9.2", - "combined-stream": "0.0.7", - "mime-types": "2.0.14" + "commander": "2.3.0", + "debug": "2.2.0", + "diff": "1.4.0", + "escape-string-regexp": "1.0.2", + "glob": "3.2.11", + "growl": "1.9.2", + "jade": "0.26.3", + "mkdirp": "0.5.1", + "supports-color": "1.2.0", + "to-iso-string": "0.0.2" }, "dependencies": { - "async": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", - "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", + "commander": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.3.0.tgz", + "integrity": "sha1-/UMOiJgy7DU7ms0d4hfBHLPu+HM=", "dev": true }, - "mime-db": { - "version": "1.12.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.12.0.tgz", - "integrity": "sha1-PQxjGA9FjrENMlqqN9fFiuMS6dc=", + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "diff": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-1.4.0.tgz", + "integrity": "sha1-fyjS657nsVqX79ic5j3P2qPMur8=", "dev": true }, - "mime-types": { - "version": "2.0.14", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.0.14.tgz", - "integrity": "sha1-MQ4VnbI+B3+Lsit0jav6SVcUCqY=", + "escape-string-regexp": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz", + "integrity": "sha1-Tbwv5nTnGUnK8/smlc5/LcHZqNE=", + "dev": true + }, + "glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", + "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", "dev": true, "requires": { - "mime-db": "1.12.0" + "inherits": "2.0.3", + "minimatch": "0.3.0" } - } - } - }, - "formidable": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.0.14.tgz", - "integrity": "sha1-Kz9MQRy7X91pXESEPiojUUpDIxo=", - "dev": true - }, - "forwarded": { - "version": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.0.tgz", - "integrity": "sha1-Ge+YdMSuHCl7zweP3mOgm2aoQ2M=" - }, - "fresh": { - "version": "https://registry.npmjs.org/fresh/-/fresh-0.5.0.tgz", - "integrity": "sha1-9HTKXmqSRtb9jglTz6m5yAWvp44=" - }, - "from": { - "version": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=" - }, - "glob": { - "version": "3.2.11", - "resolved": "https://registry.npmjs.org/glob/-/glob-3.2.11.tgz", - "integrity": "sha1-Spc/Y1uRkPcV0QmH1cAP0oFevj0=", - "dev": true, - "requires": { - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "minimatch": "0.3.0" - }, - "dependencies": { + }, + "growl": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", + "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", + "dev": true + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "jade": { + "version": "0.26.3", + "resolved": "https://registry.npmjs.org/jade/-/jade-0.26.3.tgz", + "integrity": "sha1-jxDXl32NefL2/4YqgbBRPMslaGw=", + "dev": true, + "requires": { + "commander": "0.6.1", + "mkdirp": "0.3.0" + }, + "dependencies": { + "commander": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz", + "integrity": "sha1-+mihT2qUXVTbvlDYzbMyDp47GgY=", + "dev": true + }, + "mkdirp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz", + "integrity": "sha1-G79asbqCevI1dRQ0kEJkVfSB/h4=", + "dev": true + } + } + }, "minimatch": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz", @@ -565,1153 +2954,1441 @@ "lru-cache": "2.7.3", "sigmund": "1.0.1" } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", + "dev": true + }, + "supports-color": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.2.0.tgz", + "integrity": "sha1-/x7R5hFp0Gs88tWI4YixjYhH4X4=", + "dev": true + }, + "to-iso-string": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/to-iso-string/-/to-iso-string-0.0.2.tgz", + "integrity": "sha1-TcGeZk38y+Jb2NtQiwDG2hWCVdE=", + "dev": true } } }, - "glob-base": { - "version": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "mongodb": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.0.10.tgz", + "integrity": "sha512-jy9s4FgcM4rl8sHNETYHGeWcuRh9AlwQCUuMiTj041t/HD02HwyFgmm2VZdd9/mA9YNHaUJLqj0tzBx2QFivtg==", "requires": { - "glob-parent": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + "mongodb-core": "3.0.9" } }, - "glob-parent": { - "version": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", - "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "mongodb-core": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-3.0.9.tgz", + "integrity": "sha512-buOWjdLLBlEqjHDeHYSXqXx173wHMVp7bafhdHxSjxWdB9V6Ri4myTqxjYZwL/eGFZxvd8oRQSuhwuIDbaaB+g==", "requires": { - "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + "bson": "1.0.9", + "require_optional": "1.0.1" } }, - "got": { - "version": "https://registry.npmjs.org/got/-/got-3.3.1.tgz", - "integrity": "sha1-5dDtSvVfw+701WAHdp2YGSvLLso=", - "requires": { - "duplexify": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.0.tgz", - "infinity-agent": "https://registry.npmjs.org/infinity-agent/-/infinity-agent-2.0.3.tgz", - "is-redirect": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", - "is-stream": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "lowercase-keys": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", - "nested-error-stacks": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-1.0.2.tgz", - "object-assign": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", - "prepend-http": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "read-all-stream": "https://registry.npmjs.org/read-all-stream/-/read-all-stream-3.1.0.tgz", - "timed-out": "https://registry.npmjs.org/timed-out/-/timed-out-2.0.0.tgz" + "mongoose": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.1.6.tgz", + "integrity": "sha512-p8p/3Z2kfXViqawN1TV+cZ8XbHz6SsllkytKTog+CDWfCNObyGraHQlUuRv/9aYPNKiZfq6WWITgLpJLZW/o/A==", + "requires": { + "async": "2.6.1", + "bson": "1.0.9", + "kareem": "2.2.1", + "lodash.get": "4.4.2", + "mongodb": "3.0.10", + "mongoose-legacy-pluralize": "1.0.2", + "mpath": "0.4.1", + "mquery": "3.0.0", + "ms": "2.0.0", + "regexp-clone": "0.0.1", + "sliced": "1.0.1" }, "dependencies": { - "object-assign": { - "version": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", - "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=" + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" } } }, - "graceful-fs": { - "version": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" - }, - "growl": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", - "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", - "dev": true + "mongoose-legacy-pluralize": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz", + "integrity": "sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ==" }, - "has-ansi": { - "version": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "morgan": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.0.tgz", + "integrity": "sha1-0B+mxlhZt2/PMbPLU6OCGjEdgFE=", "requires": { - "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" + "basic-auth": "2.0.0", + "debug": "2.6.9", + "depd": "1.1.1", + "on-finished": "2.3.0", + "on-headers": "1.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" + } + } } }, - "hooks-fixed": { - "version": "https://registry.npmjs.org/hooks-fixed/-/hooks-fixed-2.0.0.tgz", - "integrity": "sha1-oB2JTVKsf2WZu7H2PfycQR33DLo=" + "mpath": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.4.1.tgz", + "integrity": "sha512-NNY/MpBkALb9jJmjpBlIi6GRoLveLUM0pJzgbp9vY9F7IQEb/HREC/nxrixechcQwd1NevOhJnWWV8QQQRE+OA==" }, - "http-errors": { - "version": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.1.tgz", - "integrity": "sha1-X4uO2YrKVFZWv1cplzh/kEpyIlc=", + "mquery": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-3.0.0.tgz", + "integrity": "sha512-WL1Lk8v4l8VFSSwN3yCzY9TXw+fKVYKn6f+w86TRzOLSE8k1yTgGaLBPUByJQi8VcLbOdnUneFV/y3Kv874pnQ==", "requires": { - "depd": "https://registry.npmjs.org/depd/-/depd-1.1.0.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "setprototypeof": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", - "statuses": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz" + "bluebird": "3.5.0", + "debug": "2.6.9", + "regexp-clone": "0.0.1", + "sliced": "0.0.5" }, "dependencies": { - "depd": { - "version": "https://registry.npmjs.org/depd/-/depd-1.1.0.tgz", - "integrity": "sha1-4b2Cxqq2ztlluXuIsX7T5SjKGMM=" + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "sliced": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-0.0.5.tgz", + "integrity": "sha1-XtwETKTrb3gW1Qui/GPiXY/kcH8=" } } }, - "iconv-lite": { - "version": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.15.tgz", - "integrity": "sha1-/iZaIYrGpXz+hUkn6dBMGYJe3es=" - }, - "ignore-by-default": { - "version": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=" - }, - "imurmurhash": { - "version": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" - }, - "infinity-agent": { - "version": "https://registry.npmjs.org/infinity-agent/-/infinity-agent-2.0.3.tgz", - "integrity": "sha1-ReDi/3qesDCyfWK3SzdEt6esQhY=" - }, - "inherits": { - "version": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "ms": { + "version": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, - "ini": { - "version": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=" + "nan": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", + "optional": true }, - "ip-regex": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-1.0.3.tgz", - "integrity": "sha1-3FiQdvZZ9BnCIgOaMzFvHHOH7/0=", - "dev": true + "nanomatch": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", + "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", + "requires": { + "arr-diff": "4.0.0", + "array-unique": "0.3.2", + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "fragment-cache": "0.2.1", + "is-odd": "2.0.0", + "is-windows": "1.0.2", + "kind-of": "6.0.2", + "object.pick": "1.3.0", + "regex-not": "1.0.2", + "snapdragon": "0.8.2", + "to-regex": "3.0.2" + } }, - "ipaddr.js": { - "version": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.4.0.tgz", - "integrity": "sha1-KWrKh4qCGBbluF0KKFqZvP9FgvA=" + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" }, - "is-binary-path": { - "version": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "nodemon": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-1.17.5.tgz", + "integrity": "sha512-FG2mWJU1Y58a9ktgMJ/RZpsiPz3b7ge77t/okZHEa4NbrlXGKZ8s1A6Q+C7+JPXohAfcPALRwvxcAn8S874pmw==", "requires": { - "binary-extensions": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.9.0.tgz" + "chokidar": "2.0.4", + "debug": "3.1.0", + "ignore-by-default": "1.0.1", + "minimatch": "3.0.4", + "pstree.remy": "1.1.0", + "semver": "5.5.0", + "supports-color": "5.4.0", + "touch": "3.1.0", + "undefsafe": "2.0.2", + "update-notifier": "2.5.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } } }, - "is-buffer": { - "version": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", - "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=" + "nopt": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", + "requires": { + "abbrev": "1.1.1" + } }, - "is-dotfile": { - "version": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=" + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "requires": { + "remove-trailing-separator": "1.1.0" + } }, - "is-equal-shallow": { - "version": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "requires": { - "is-primitive": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" + "path-key": "2.0.1" } }, - "is-extendable": { - "version": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + "oauth": { + "version": "0.9.15", + "resolved": "https://registry.npmjs.org/oauth/-/oauth-0.9.15.tgz", + "integrity": "sha1-vR/vr2hslrdUda7VGWQS/2DPucE=" }, - "is-extglob": { - "version": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" }, - "is-finite": { - "version": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", "requires": { - "number-is-nan": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz" + "copy-descriptor": "0.1.1", + "define-property": "0.2.5", + "kind-of": "3.2.2" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.6" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } } }, - "is-glob": { - "version": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "requires": { - "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz" + "isobject": "3.0.1" } }, - "is-ip": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-ip/-/is-ip-1.0.0.tgz", - "integrity": "sha1-K7aVn3l8zW+f3IEnWLy8h8TFkHQ=", - "dev": true, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "requires": { - "ip-regex": "1.0.3" + "isobject": "3.0.1" } }, - "is-npm": { - "version": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", - "integrity": "sha1-8vtjpl5JBbQGyGBydloaTceTufQ=" - }, - "is-number": { - "version": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", - "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", "requires": { - "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz" + "ee-first": "1.1.1" } }, - "is-posix-bracket": { - "version": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", - "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=" - }, - "is-primitive": { - "version": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", - "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=" - }, - "is-redirect": { - "version": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", - "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=" - }, - "is-stream": { - "version": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + "on-headers": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", + "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=" }, - "isarray": { - "version": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" }, - "isobject": { - "version": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "package-json": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-4.0.1.tgz", + "integrity": "sha1-iGmgQBJTZhxMTKPabCEh7VVfXu0=", "requires": { - "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + "got": "6.7.1", + "registry-auth-token": "3.3.2", + "registry-url": "3.1.0", + "semver": "5.5.0" } }, - "jade": { - "version": "0.26.3", - "resolved": "https://registry.npmjs.org/jade/-/jade-0.26.3.tgz", - "integrity": "sha1-jxDXl32NefL2/4YqgbBRPMslaGw=", - "dev": true, + "parseurl": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" + }, + "passport": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/passport/-/passport-0.4.0.tgz", + "integrity": "sha1-xQlWkTR71a07XhgCOMORTRbwWBE=", "requires": { - "commander": "0.6.1", - "mkdirp": "0.3.0" - }, - "dependencies": { - "commander": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz", - "integrity": "sha1-+mihT2qUXVTbvlDYzbMyDp47GgY=", - "dev": true - }, - "mkdirp": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz", - "integrity": "sha1-G79asbqCevI1dRQ0kEJkVfSB/h4=", - "dev": true - } + "passport-strategy": "1.0.0", + "pause": "0.0.1" } }, - "kareem": { - "version": "https://registry.npmjs.org/kareem/-/kareem-1.5.0.tgz", - "integrity": "sha1-4+QQHZ3P3imXadr0tNtk2JXRdEg=" + "passport-github": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/passport-github/-/passport-github-1.1.0.tgz", + "integrity": "sha1-jOHj/NYa11eOsd9ZWDnkrqEjVdQ=", + "requires": { + "passport-oauth2": "1.4.0" + } }, - "kind-of": { - "version": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "passport-http-bearer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/passport-http-bearer/-/passport-http-bearer-1.0.1.tgz", + "integrity": "sha1-FHRp6jZp4qhMYWfvmdu3fh8AmKg=", "requires": { - "is-buffer": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz" + "passport-strategy": "1.0.0" } }, - "latest-version": { - "version": "https://registry.npmjs.org/latest-version/-/latest-version-1.0.1.tgz", - "integrity": "sha1-cs/Ebj6NG+ZR4eu1Tqn26pbzdLs=", + "passport-oauth2": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/passport-oauth2/-/passport-oauth2-1.4.0.tgz", + "integrity": "sha1-9i+BWDy+EmCb585vFguTlaJ7hq0=", "requires": { - "package-json": "https://registry.npmjs.org/package-json/-/package-json-1.2.0.tgz" + "oauth": "0.9.15", + "passport-strategy": "1.0.0", + "uid2": "0.0.3", + "utils-merge": "1.0.1" } }, - "lodash": { - "version": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" + "passport-strategy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz", + "integrity": "sha1-tVOaqPwiWj0a0XlHbd8ja0QPUuQ=" }, - "lodash._baseassign": { - "version": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", - "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", - "requires": { - "lodash._basecopy": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "lodash.keys": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz" - } + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=" }, - "lodash._basecopy": { - "version": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=" + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, - "lodash._bindcallback": { - "version": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", - "integrity": "sha1-5THCdkTPi1epnhftlbNcdIeJOS4=" + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=" }, - "lodash._createassigner": { - "version": "https://registry.npmjs.org/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz", - "integrity": "sha1-g4pbri/aymOsIt7o4Z+k5taXCxE=", - "requires": { - "lodash._bindcallback": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", - "lodash._isiterateecall": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "lodash.restparam": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz" - } + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" }, - "lodash._getnative": { - "version": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=" + "path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" }, - "lodash._isiterateecall": { - "version": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=" + "pause": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz", + "integrity": "sha1-HUCLP9t2kjuVQ9lvtMnf1TXZy10=" }, - "lodash.assign": { - "version": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-3.2.0.tgz", - "integrity": "sha1-POnwI0tLIiPilrj6CsH+6OvKZPo=", + "pause-stream": { + "version": "0.0.11", + "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", + "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", "requires": { - "lodash._baseassign": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", - "lodash._createassigner": "https://registry.npmjs.org/lodash._createassigner/-/lodash._createassigner-3.1.1.tgz", - "lodash.keys": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz" + "through": "2.3.8" } }, - "lodash.defaults": { - "version": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-3.1.2.tgz", - "integrity": "sha1-xzCLGNv4vJNy1wGnNJPGEZK9Liw=", - "requires": { - "lodash.assign": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-3.2.0.tgz", - "lodash.restparam": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz" - } + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" }, - "lodash.isarguments": { - "version": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=" + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" }, - "lodash.isarray": { - "version": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", - "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=" + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, - "lodash.keys": { - "version": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", - "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "ps-tree": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz", + "integrity": "sha1-tCGyQUDWID8e08dplrRCewjowBQ=", "requires": { - "lodash._getnative": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", - "lodash.isarguments": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", - "lodash.isarray": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz" + "event-stream": "3.3.4" } }, - "lodash.restparam": { - "version": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", - "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=" + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" }, - "lowercase-keys": { - "version": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.0.tgz", - "integrity": "sha1-TjNms55/VFfjXxMkvfb4jQv8cwY=" + "pstree.remy": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pstree.remy/-/pstree.remy-1.1.0.tgz", + "integrity": "sha512-q5I5vLRMVtdWa8n/3UEzZX7Lfghzrg9eG2IKk2ENLSofKRCXVqMvMUHxCKgXNaqH/8ebhBxrqftHWnyTFweJ5Q==", + "requires": { + "ps-tree": "1.1.0" + } }, - "lru-cache": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", - "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", - "dev": true + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" }, - "map-stream": { - "version": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=" + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" }, - "media-typer": { - "version": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + "random-bytes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", + "integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs=" }, - "merge-descriptors": { - "version": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" }, - "method-override": { - "version": "https://registry.npmjs.org/method-override/-/method-override-2.3.9.tgz", - "integrity": "sha1-vRUfLONM8Bp2ykAKuVwBKxAtj3E=", + "raw-body": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz", + "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==", "requires": { - "debug": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "methods": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "parseurl": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz", - "vary": "https://registry.npmjs.org/vary/-/vary-1.1.1.tgz" + "bytes": "3.0.0", + "http-errors": "1.6.3", + "iconv-lite": "0.4.23", + "unpipe": "1.0.0" }, "dependencies": { - "debug": { - "version": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "http-errors": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "requires": { - "ms": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" + "depd": "1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.0", + "statuses": "1.4.0" } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "setprototypeof": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" } } }, - "methods": { - "version": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" - }, - "micromatch": { - "version": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", - "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", - "requires": { - "arr-diff": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", - "array-unique": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", - "braces": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", - "expand-brackets": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "extglob": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "filename-regex": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", - "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", - "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "normalize-path": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "object.omit": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "parse-glob": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "regex-cache": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz" - } - }, - "mime": { - "version": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", - "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=" - }, - "mime-db": { - "version": "https://registry.npmjs.org/mime-db/-/mime-db-1.29.0.tgz", - "integrity": "sha1-SNJtI1WJZRcErFkWygYAGRQmaHg=" - }, - "mime-types": { - "version": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.16.tgz", - "integrity": "sha1-K4WKUuXs1RbbiXrCvodIeDBpjiM=", - "requires": { - "mime-db": "https://registry.npmjs.org/mime-db/-/mime-db-1.29.0.tgz" - } - }, - "minimatch": { - "version": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", - "requires": { - "brace-expansion": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz" - } - }, - "minimist": { - "version": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" - }, - "mkdirp": { - "version": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "requires": { - "minimist": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + "deep-extend": "0.6.0", + "ini": "1.3.5", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + } } }, - "mocha": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-2.5.3.tgz", - "integrity": "sha1-FhvlvetJZ3HrmzV0UFC2IrWu/Fg=", - "dev": true, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { - "commander": "2.3.0", - "debug": "2.2.0", - "diff": "1.4.0", - "escape-string-regexp": "1.0.2", - "glob": "3.2.11", - "growl": "1.9.2", - "jade": "0.26.3", - "mkdirp": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "supports-color": "1.2.0", - "to-iso-string": "0.0.2" + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.2", + "string_decoder": "1.1.1", + "util-deprecate": "1.0.2" }, "dependencies": { - "debug": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", - "dev": true, - "requires": { - "ms": "0.7.1" - } - }, - "escape-string-regexp": { + "core-util-is": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz", - "integrity": "sha1-Tbwv5nTnGUnK8/smlc5/LcHZqNE=", - "dev": true + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, - "ms": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", - "dev": true + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" }, - "supports-color": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.2.0.tgz", - "integrity": "sha1-/x7R5hFp0Gs88tWI4YixjYhH4X4=", - "dev": true + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" } } }, - "mongodb": { - "version": "https://registry.npmjs.org/mongodb/-/mongodb-2.2.27.tgz", - "integrity": "sha1-NBIgNNtm2YO89qta2yaiSnD+9uY=", + "readdirp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", "requires": { - "es6-promise": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.2.1.tgz", - "mongodb-core": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-2.1.11.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.7.tgz" + "graceful-fs": "4.1.11", + "minimatch": "3.0.4", + "readable-stream": "2.3.6", + "set-immediate-shim": "1.0.1" } }, - "mongodb-core": { - "version": "https://registry.npmjs.org/mongodb-core/-/mongodb-core-2.1.11.tgz", - "integrity": "sha1-HDh3bOsXSZepnCiGDu2QKNqbPho=", + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "requires": { - "bson": "https://registry.npmjs.org/bson/-/bson-1.0.4.tgz", - "require_optional": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz" + "extend-shallow": "3.0.2", + "safe-regex": "1.1.0" } }, - "mongoose": { - "version": "https://registry.npmjs.org/mongoose/-/mongoose-4.11.5.tgz", - "integrity": "sha1-WeSh2E3NNsxR8+Y5t3HLg1n1Oao=", - "requires": { - "async": "https://registry.npmjs.org/async/-/async-2.1.4.tgz", - "bson": "https://registry.npmjs.org/bson/-/bson-1.0.4.tgz", - "hooks-fixed": "https://registry.npmjs.org/hooks-fixed/-/hooks-fixed-2.0.0.tgz", - "kareem": "https://registry.npmjs.org/kareem/-/kareem-1.5.0.tgz", - "mongodb": "https://registry.npmjs.org/mongodb/-/mongodb-2.2.27.tgz", - "mpath": "https://registry.npmjs.org/mpath/-/mpath-0.3.0.tgz", - "mpromise": "https://registry.npmjs.org/mpromise/-/mpromise-0.5.5.tgz", - "mquery": "https://registry.npmjs.org/mquery/-/mquery-2.3.1.tgz", - "ms": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "muri": "https://registry.npmjs.org/muri/-/muri-1.2.2.tgz", - "regexp-clone": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz", - "sliced": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz" - } + "regexp-clone": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz", + "integrity": "sha1-p8LgmJH9vzj7sQ03b7cwA+aKxYk=" }, - "morgan": { - "version": "https://registry.npmjs.org/morgan/-/morgan-1.8.2.tgz", - "integrity": "sha1-eErHc05KRTqcbm6GgKkyknXItoc=", - "requires": { - "basic-auth": "https://registry.npmjs.org/basic-auth/-/basic-auth-1.1.0.tgz", - "debug": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "depd": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", - "on-finished": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "on-headers": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz" + "registry-auth-token": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", + "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", + "requires": { + "rc": "1.2.8", + "safe-buffer": "5.1.2" }, "dependencies": { - "debug": { - "version": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", - "requires": { - "ms": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" - } + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" } } }, - "mpath": { - "version": "https://registry.npmjs.org/mpath/-/mpath-0.3.0.tgz", - "integrity": "sha1-elj3iem1/TyUUgY0FXlg8mvV70Q=" + "registry-url": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", + "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", + "requires": { + "rc": "1.2.8" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=" }, - "mpromise": { - "version": "https://registry.npmjs.org/mpromise/-/mpromise-0.5.5.tgz", - "integrity": "sha1-9bJCWddjrMIlewoMjG2Gb9UXMuY=" + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" }, - "mquery": { - "version": "https://registry.npmjs.org/mquery/-/mquery-2.3.1.tgz", - "integrity": "sha1-mrNnSXFIAP8LtTpoHOS8TV8HyHs=", + "request": { + "version": "2.83.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", + "integrity": "sha512-lR3gD69osqm6EYLk9wB/G1W/laGWjzH90t1vEa2xuxHD5KUrSzp9pUSfTm+YC5Nxt2T8nMPEvKlhbQayU7bgFw==", "requires": { - "bluebird": "https://registry.npmjs.org/bluebird/-/bluebird-2.10.2.tgz", - "debug": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "regexp-clone": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz", - "sliced": "https://registry.npmjs.org/sliced/-/sliced-0.0.5.tgz" + "aws-sign2": "0.7.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.3.1", + "har-validator": "5.0.3", + "hawk": "6.0.2", + "http-signature": "1.2.0", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.17", + "oauth-sign": "0.8.2", + "performance-now": "2.1.0", + "qs": "6.5.1", + "safe-buffer": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "stringstream": "0.0.5", + "tough-cookie": "2.3.3", + "tunnel-agent": "0.6.0", + "uuid": "3.1.0" }, "dependencies": { - "debug": { - "version": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "combined-stream": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", "requires": { - "ms": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" + "delayed-stream": "1.0.0" } }, - "sliced": { - "version": "https://registry.npmjs.org/sliced/-/sliced-0.0.5.tgz", - "integrity": "sha1-XtwETKTrb3gW1Qui/GPiXY/kcH8=" + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + }, + "form-data": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.1.tgz", + "integrity": "sha1-b7lPvXGIUwbXPRXMSX/kzE7NRL8=", + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.17" + } + }, + "mime-db": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", + "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=" + }, + "mime-types": { + "version": "2.1.17", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", + "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", + "requires": { + "mime-db": "1.30.0" + } + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + }, + "uuid": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", + "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==" } } }, - "ms": { - "version": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "muri": { - "version": "https://registry.npmjs.org/muri/-/muri-1.2.2.tgz", - "integrity": "sha1-YxmBMmUNsIoEzHnM0A3Tia/SYxw=" - }, - "negotiator": { - "version": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", - "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=" - }, - "nested-error-stacks": { - "version": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-1.0.2.tgz", - "integrity": "sha1-GfYZWRUZ8JZ2mlupqG5u7sgjw88=", + "require_optional": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", + "integrity": "sha512-qhM/y57enGWHAe3v/NcwML6a3/vfESLe/sGM2dII+gEO0BpKRUkWZow/tyloNqJyN6kXSl3RyyM8Ll5D/sJP8g==", "requires": { - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + "resolve-from": "2.0.0", + "semver": "5.5.0" } }, - "nodemon": { - "version": "https://registry.npmjs.org/nodemon/-/nodemon-1.11.0.tgz", - "integrity": "sha1-ImxWK9KnsT09dRi0mtSCijYj0Gw=", - "requires": { - "chokidar": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", - "debug": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz", - "es6-promise": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.2.1.tgz", - "ignore-by-default": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", - "lodash.defaults": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-3.1.2.tgz", - "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "ps-tree": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz", - "touch": "https://registry.npmjs.org/touch/-/touch-1.0.0.tgz", - "undefsafe": "https://registry.npmjs.org/undefsafe/-/undefsafe-0.0.3.tgz", - "update-notifier": "https://registry.npmjs.org/update-notifier/-/update-notifier-0.5.0.tgz" - } + "resolve-from": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", + "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" }, - "nopt": { - "version": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", - "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", - "requires": { - "abbrev": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz" - } + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" }, - "normalize-path": { - "version": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" + }, + "safe-buffer": { + "version": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=" + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "requires": { - "remove-trailing-separator": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz" + "ret": "0.1.15" } }, - "number-is-nan": { - "version": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, - "object-assign": { - "version": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" }, - "object.omit": { - "version": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", - "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "semver-diff": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", + "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", "requires": { - "for-own": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", - "is-extendable": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz" + "semver": "5.5.0" } }, - "on-finished": { - "version": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", "requires": { - "ee-first": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz" + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "split-string": "3.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + } } }, - "on-headers": { - "version": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.1.tgz", - "integrity": "sha1-ko9dD0cNSTQmUepnlLCFfBAGk/c=" + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" }, - "once": { - "version": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "requires": { - "wrappy": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" + "shebang-regex": "1.0.0" } }, - "os-homedir": { - "version": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + }, + + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", + "dev": true + }, + + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, + "sliced": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", + "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" }, - "os-tmpdir": { - "version": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "requires": { + "base": "0.11.2", + "debug": "2.6.9", + "define-property": "0.2.5", + "extend-shallow": "2.0.1", + "map-cache": "0.2.2", + "source-map": "0.5.7", + "source-map-resolve": "0.5.2", + "use": "3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "0.1.6" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } + } }, - "osenv": { - "version": "https://registry.npmjs.org/osenv/-/osenv-0.1.4.tgz", - "integrity": "sha1-Qv5tWVPfBsgGS+bxdsPQWqqjRkQ=", + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "requires": { - "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "os-tmpdir": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" + "define-property": "1.0.0", + "isobject": "3.0.1", + "snapdragon-util": "3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "1.0.2" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "6.0.2" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "1.0.0", + "is-data-descriptor": "1.0.0", + "kind-of": "6.0.2" + } + } } }, - "package-json": { - "version": "https://registry.npmjs.org/package-json/-/package-json-1.2.0.tgz", - "integrity": "sha1-yOysCUInzfdqMWh07QXifMk5oOA=", + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "requires": { - "got": "https://registry.npmjs.org/got/-/got-3.3.1.tgz", - "registry-url": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz" + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } } }, - "parse-glob": { - "version": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", - "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "sntp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", + "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", "requires": { - "glob-base": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", - "is-dotfile": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", - "is-extglob": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", - "is-glob": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz" + "hoek": "4.2.0" + }, + "dependencies": { + "hoek": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.0.tgz", + "integrity": "sha512-v0XCLxICi9nPfYrS9RL8HbYnXi9obYAeLbSP00BmnZwCK9+Ih9WOjoZ8YoHCoav2csqn4FOz4Orldsy2dmDwmQ==" + } } }, - "parseurl": { - "version": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz", - "integrity": "sha1-yKuMkiO6NIiKpkopeyiFO+wY2lY=" - }, - "path-is-absolute": { - "version": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "path-to-regexp": { - "version": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" }, - "pause-stream": { - "version": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", "requires": { - "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + "atob": "2.1.1", + "decode-uri-component": "0.2.0", + "resolve-url": "0.2.1", + "source-map-url": "0.4.0", + "urix": "0.1.0" } }, - "pinkie": { - "version": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", - "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=" + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" }, - "pinkie-promise": { - "version": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "split": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", + "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", "requires": { - "pinkie": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" + "through": "2.3.8" } }, - "prepend-http": { - "version": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", - "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" - }, - "preserve": { - "version": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", - "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=" - }, - "process-nextick-args": { - "version": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" - }, - "proxy-addr": { - "version": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-1.1.5.tgz", - "integrity": "sha1-ccDuOxAt4/IC87ZPYI0XP8uhqRg=", + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "requires": { - "forwarded": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.0.tgz", - "ipaddr.js": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.4.0.tgz" + "extend-shallow": "3.0.2" } }, - "ps-tree": { - "version": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz", - "integrity": "sha1-tCGyQUDWID8e08dplrRCewjowBQ=", + "sshpk": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", + "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", "requires": { - "event-stream": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz" + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" } }, - "qs": { - "version": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", - "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=" - }, - "randomatic": { - "version": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha1-x6vpzIuHwLqodrGf3oP9RkeX44w=", + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", "requires": { - "is-number": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz" + "define-property": "0.2.5", + "object-copy": "0.1.0" }, "dependencies": { - "is-number": { - "version": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "requires": { - "kind-of": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz" - }, - "dependencies": { - "kind-of": { - "version": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz" - } - } - } - }, - "kind-of": { - "version": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "requires": { - "is-buffer": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz" + "is-descriptor": "0.1.6" } } } }, - "range-parser": { - "version": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=" + "statuses": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz", + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew==" }, - "raw-body": { - "version": "https://registry.npmjs.org/raw-body/-/raw-body-2.2.0.tgz", - "integrity": "sha1-mUl2z2pQlqQRYoQEkvC9xdbn+5Y=", + "stream-combiner": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", + "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", "requires": { - "bytes": "https://registry.npmjs.org/bytes/-/bytes-2.4.0.tgz", - "iconv-lite": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.15.tgz", - "unpipe": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz" + "duplexer": "0.1.1" } }, - "rc": { - "version": "https://registry.npmjs.org/rc/-/rc-1.2.1.tgz", - "integrity": "sha1-LgPo5C7kULjLPc5lvhv4l04d/ZU=", + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { - "deep-extend": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", - "ini": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "minimist": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "strip-json-comments": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz" + "safe-buffer": "5.1.2" }, "dependencies": { - "minimist": { - "version": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" } } }, - "read-all-stream": { - "version": "https://registry.npmjs.org/read-all-stream/-/read-all-stream-3.1.0.tgz", - "integrity": "sha1-NcPhd/IHjveJ7kv6+kNzB06u9Po=", - "requires": { - "pinkie-promise": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.7.tgz" - } + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" }, - "readable-stream": { - "version": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.7.tgz", - "integrity": "sha1-BwV6y+JGeyIELTb5jFrVBwVOlbE=", + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "requires": { - "buffer-shims": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz", - "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "process-nextick-args": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "string_decoder": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "util-deprecate": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + "ansi-regex": "3.0.0" } }, - "readdirp": { - "version": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", - "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", - "requires": { - "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "minimatch": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "readable-stream": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.2.7.tgz", - "set-immediate-shim": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz" - } + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" }, - "reduce-component": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/reduce-component/-/reduce-component-1.0.1.tgz", - "integrity": "sha1-4Mk1QsV0UhvqE98PlIjtgqt3xdo=", - "dev": true + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, - "regex-cache": { - "version": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.3.tgz", - "integrity": "sha1-mxpsNdTQ3871cRrmUejp09cRQUU=", + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "requires": { - "is-equal-shallow": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", - "is-primitive": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz" + "has-flag": "3.0.0" } }, - "regexp-clone": { - "version": "https://registry.npmjs.org/regexp-clone/-/regexp-clone-0.0.1.tgz", - "integrity": "sha1-p8LgmJH9vzj7sQ03b7cwA+aKxYk=" - }, - "registry-url": { - "version": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", - "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", + "term-size": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", + "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", "requires": { - "rc": "https://registry.npmjs.org/rc/-/rc-1.2.1.tgz" + "execa": "0.7.0" } }, - "remove-trailing-separator": { - "version": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz", - "integrity": "sha1-abBi2XhyetFNxrVrpKt3L9jXBRE=" + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" }, - "repeat-element": { - "version": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=" + "timed-out": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", + "integrity": "sha1-8y6srFoXW+ol1/q1Zas+2HQe9W8=" }, - "repeat-string": { - "version": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + + "to-iso-string": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/to-iso-string/-/to-iso-string-0.0.2.tgz", + "integrity": "sha1-TcGeZk38y+Jb2NtQiwDG2hWCVdE=", + "dev": true }, - "repeating": { - "version": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", - "integrity": "sha1-PUEUIYh3U3SU+X93+Xhfq4EPpKw=", + + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "requires": { - "is-finite": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz" + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "1.1.6" + } + } } }, - "require_optional": { - "version": "https://registry.npmjs.org/require_optional/-/require_optional-1.0.1.tgz", - "integrity": "sha1-TPNaQkf2TKPfjC7yCMxJSxyo/C4=", + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", "requires": { - "resolve-from": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", - "semver": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz" + "define-property": "2.0.2", + "extend-shallow": "3.0.2", + "regex-not": "1.0.2", + "safe-regex": "1.1.0" } }, - "resolve-from": { - "version": "https://registry.npmjs.org/resolve-from/-/resolve-from-2.0.0.tgz", - "integrity": "sha1-lICrIOlP+h2egKgEx+oUdhGWa1c=" - }, - "safe-buffer": { - "version": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=" - }, - "semver": { - "version": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", - "integrity": "sha1-4FnAnYVx8FQII3M0M1BdOi8AsY4=" - }, - "semver-diff": { - "version": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", - "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "requires": { - "semver": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz" + "is-number": "3.0.0", + "repeat-string": "1.6.1" } }, - "send": { - "version": "https://registry.npmjs.org/send/-/send-0.15.3.tgz", - "integrity": "sha1-UBP5+ZAj31DRvZiSwZ4979HVMwk=", + "touch": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/touch/-/touch-3.1.0.tgz", + "integrity": "sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==", "requires": { - "debug": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz", - "depd": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", - "destroy": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "encodeurl": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", - "escape-html": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "etag": "https://registry.npmjs.org/etag/-/etag-1.8.0.tgz", - "fresh": "https://registry.npmjs.org/fresh/-/fresh-0.5.0.tgz", - "http-errors": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.1.tgz", - "mime": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", - "ms": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "on-finished": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "range-parser": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", - "statuses": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz" + "nopt": "1.0.10" } }, - "serve-static": { - "version": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.3.tgz", - "integrity": "sha1-n0uhni8wMMVH+K+ZEHg47DjVseI=", + "tough-cookie": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", + "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", "requires": { - "encodeurl": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", - "escape-html": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "parseurl": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.1.tgz", - "send": "https://registry.npmjs.org/send/-/send-0.15.3.tgz" + "punycode": "1.4.1" } }, - "set-immediate-shim": { - "version": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz" + } }, - "setprototypeof": { - "version": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", - "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=" + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true }, - "sigmund": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", + + "type-detect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-1.0.0.tgz", + "integrity": "sha1-diIXzAbbJY7EiQihKY6LlRIejqI=", "dev": true }, - "sliced": { - "version": "https://registry.npmjs.org/sliced/-/sliced-1.0.1.tgz", - "integrity": "sha1-CzpmK10Ewxd7GSa+qCsD+Dei70E=" - }, - "slide": { - "version": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=" - }, - "split": { - "version": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", + + "type-is": { + "version": "1.6.16", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz", + "integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==", "requires": { - "through": "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + "media-typer": "0.3.0", + "mime-types": "2.1.18" } }, - "statuses": { - "version": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", - "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" - }, - "stream-combiner": { - "version": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", + "uid-safe": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", + "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", "requires": { - "duplexer": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz" + "random-bytes": "1.0.0" } }, - "stream-shift": { - "version": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" + "uid2": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz", + "integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=" }, - "string_decoder": { - "version": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", - "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", + "undefsafe": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/undefsafe/-/undefsafe-2.0.2.tgz", + "integrity": "sha1-Il9rngM3Zj4Njnz9aG/Cg2zKznY=", "requires": { - "safe-buffer": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz" + "debug": "2.6.9" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + } } }, - "string-length": { - "version": "https://registry.npmjs.org/string-length/-/string-length-1.0.1.tgz", - "integrity": "sha1-VpcPscOFWOnnC3KL894mmsRa36w=", + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", "requires": { - "strip-ansi": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz" + "arr-union": "3.1.0", + "get-value": "2.0.6", + "is-extendable": "0.1.1", + "set-value": "0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "0.1.1" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "requires": { + "extend-shallow": "2.0.1", + "is-extendable": "0.1.1", + "is-plain-object": "2.0.4", + "to-object-path": "0.3.0" + } + } } }, - "strip-ansi": { - "version": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "unique-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", + "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", "requires": { - "ansi-regex": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz" + "crypto-random-string": "1.0.0" } }, - "strip-json-comments": { - "version": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" }, - "superagent": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-1.2.0.tgz", - "integrity": "sha1-qsJiUzwexVOBRKETcc028kSldP0=", - "dev": true, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", "requires": { - "component-emitter": "1.1.2", - "cookiejar": "2.0.1", - "debug": "https://registry.npmjs.org/debug/-/debug-2.6.7.tgz", - "extend": "1.2.1", - "form-data": "0.2.0", - "formidable": "1.0.14", - "methods": "1.0.1", - "mime": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", - "qs": "2.3.3", - "readable-stream": "1.0.27-1", - "reduce-component": "1.0.1" + "has-value": "0.3.1", + "isobject": "3.0.1" }, "dependencies": { - "cookiejar": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.0.1.tgz", - "integrity": "sha1-PRJ1L2rfaKiS8zJDNJK9WBK7Zo8=", - "dev": true - }, - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "methods": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.0.1.tgz", - "integrity": "sha1-dbyRlD3/19oDfPPusO1zoAN80Us=", - "dev": true - }, - "qs": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz", - "integrity": "sha1-6eha2+ddoLvkyOBHaghikPhjtAQ=", - "dev": true - }, - "readable-stream": { - "version": "1.0.27-1", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.27-1.tgz", - "integrity": "sha1-a2eYPCA1fO/QfwFlABoW1xDZEHg=", - "dev": true, + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", "requires": { - "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "inherits": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "isarray": "0.0.1", - "string_decoder": "0.10.31" + "get-value": "2.0.6", + "has-values": "0.1.4", + "isobject": "2.1.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } + } } }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" } } }, - "supports-color": { - "version": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" - }, - "through": { - "version": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" - }, - "timed-out": { - "version": "https://registry.npmjs.org/timed-out/-/timed-out-2.0.0.tgz", - "integrity": "sha1-84sK6B03R9YoAB9B2vxlKs5nHAo=" + "unzip-response": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unzip-response/-/unzip-response-2.0.1.tgz", + "integrity": "sha1-0vD3N9FrBhXnKmk17QQhRXLVb5c=" }, - "to-iso-string": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/to-iso-string/-/to-iso-string-0.0.2.tgz", - "integrity": "sha1-TcGeZk38y+Jb2NtQiwDG2hWCVdE=", - "dev": true + "upath": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz", + "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==" }, - "touch": { - "version": "https://registry.npmjs.org/touch/-/touch-1.0.0.tgz", - "integrity": "sha1-RJy+LbrlqMgDjjDXH6D/RklHxN4=", + "update-notifier": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-2.5.0.tgz", + "integrity": "sha512-gwMdhgJHGuj/+wHJJs9e6PcCszpxR1b236igrOkUofGhqJuG+amlIKwApH1IW1WWl7ovZxsX49lMBWLxSdm5Dw==", "requires": { - "nopt": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz" + "boxen": "1.3.0", + "chalk": "2.4.1", + "configstore": "3.1.2", + "import-lazy": "2.1.0", + "is-ci": "1.1.0", + "is-installed-globally": "0.1.0", + "is-npm": "1.0.0", + "latest-version": "3.1.0", + "semver-diff": "2.1.0", + "xdg-basedir": "3.0.0" } }, - "type-detect": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-1.0.0.tgz", - "integrity": "sha1-diIXzAbbJY7EiQihKY6LlRIejqI=", - "dev": true + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" }, - "type-is": { - "version": "https://registry.npmjs.org/type-is/-/type-is-1.6.15.tgz", - "integrity": "sha1-yrEPtJCeRByChC6v4a1kbIGARBA=", + "url-parse-lax": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", + "integrity": "sha1-evjzA2Rem9eaJy56FKxovAYJ2nM=", "requires": { - "media-typer": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "mime-types": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.16.tgz" + "prepend-http": "1.0.4" } }, - "undefsafe": { - "version": "https://registry.npmjs.org/undefsafe/-/undefsafe-0.0.3.tgz", - "integrity": "sha1-7Mo6A+VrmvFzhbqsgSrIO5lKli8=" - }, - "unpipe": { - "version": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" - }, - "update-notifier": { - "version": "https://registry.npmjs.org/update-notifier/-/update-notifier-0.5.0.tgz", - "integrity": "sha1-B7XcIGazYnqztPUwEw9+3doHpMw=", + "use": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", + "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", "requires": { - "chalk": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "configstore": "https://registry.npmjs.org/configstore/-/configstore-1.4.0.tgz", - "is-npm": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", - "latest-version": "https://registry.npmjs.org/latest-version/-/latest-version-1.0.1.tgz", - "repeating": "https://registry.npmjs.org/repeating/-/repeating-1.1.3.tgz", - "semver-diff": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", - "string-length": "https://registry.npmjs.org/string-length/-/string-length-1.0.1.tgz" + "kind-of": "6.0.2" } }, "util-deprecate": { - "version": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" }, "utils-merge": { - "version": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", - "integrity": "sha1-ApT7kiu5N1FTVBxPcJYjHyh8ivg=" - }, - "uuid": { - "version": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", - "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=" + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" }, "vary": { - "version": "https://registry.npmjs.org/vary/-/vary-1.1.1.tgz", - "integrity": "sha1-Z1Neu2lMHVIldFeYRmUyP1h+jTc=" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "extsprintf": "1.3.0" + } }, - "wrappy": { - "version": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "very-fast-args": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/very-fast-args/-/very-fast-args-1.1.0.tgz", + "integrity": "sha1-4W0dH6+KbllqJGQh/ZCneWPQs5Y=" }, - "write-file-atomic": { - "version": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", - "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "requires": { - "graceful-fs": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "imurmurhash": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "slide": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz" + "isexe": "2.0.0" } }, - "xdg-basedir": { - "version": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-2.0.0.tgz", - "integrity": "sha1-7byQPMOF/ARSPZZqM1UEtVBNG9I=", + "widest-line": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.0.tgz", + "integrity": "sha1-AUKk6KJD+IgsAjOqDgKBqnYVInM=", + "requires": { + "string-width": "2.1.1" + } + }, + "write-file-atomic": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", + "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", "requires": { - "os-homedir": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz" + "graceful-fs": "4.1.11", + "imurmurhash": "0.1.4", + "signal-exit": "3.0.2" } + }, + "xdg-basedir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", + "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=" + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" } } } diff --git a/stackle_api/package.json b/stackle_api/package.json index ac2adee..9d71c70 100644 --- a/stackle_api/package.json +++ b/stackle_api/package.json @@ -4,8 +4,9 @@ "description": "Web Communication portal for OpenSource organizations to discuss project ideas and issues ", "main": "server.js", "scripts": { - "test": "mocha --timeout 10000", - "start": "nodemon server.js" + "test": "mocha --timeout 20000", + "start": "nodemon bin/www", + "serve": "node bin/www" }, "repository": { "type": "git", @@ -15,30 +16,37 @@ "stackle", "SCORE" ], + "contributors": [ + "Pasan Missaka Gamaetige", + "Tharindu Prabhath Ranathunga", + "Milindu Sanoj Kumarage" + ], "author": "SCoRe Lab", - "license": "ISC", + "license": "Apache Version 2", "bugs": { "url": "https://github.com/psnmissaka/Stackle/issues" }, "homepage": "https://github.com/psnmissaka/Stackle#readme", "dependencies": { - "angular": "^1.6.3", - "angular-jwt": "^0.1.9", - "angular-storage": "0.0.15", - "angular-ui-router": "^1.0.3", - "auth0-angular": "^4.2.7", - "body-parser": "^1.17.1", - "bower": "^1.8.0", - "express": "^4.15.2", - "method-override": "^2.3.8", - "mongoose": "^4.9.6", - "morgan": "^1.8.1", - "nodemon": "^1.11.0" + "body-parser": "^1.18.3", + "cors": "^2.8.4", + "dotenv": "^5.0.1", + "express": "^4.16.3", + "express-jwt": "^5.3.1", + "express-session": "^1.15.6", + "jwks-rsa": "^1.2.1", + "method-override": "^2.3.10", + "mongoose": "^5.1.6", + "morgan": "^1.9.0", + "nodemon": "^1.17.5", + "passport": "^0.4.0", + "passport-github": "^1.1.0", + "passport-http-bearer": "^1.0.1" }, "devDependencies": { "chai": "^3.5.0", "chai-http": "^2.0.1", - "mocha": "^2.4.5" + "mocha": "^2.5.3" }, "engines": { "node": "6.9.5" diff --git a/stackle_api/public/core.js b/stackle_api/public/core.js index 5c71059..46183c2 100644 --- a/stackle_api/public/core.js +++ b/stackle_api/public/core.js @@ -12,6 +12,6 @@ stackleApp.controller('mainController', function($scope,$http){ console.log(data); }) .error(function(data){ - console.log('error'_data); + console.log('error',_data); }) }); \ No newline at end of file diff --git a/stackle_api/server.js b/stackle_api/server.js index a1d463b..fcb8524 100644 --- a/stackle_api/server.js +++ b/stackle_api/server.js @@ -1,52 +1,118 @@ +require('dotenv').config(); const express = require('express'); const app = express(); const path = require('path'); -var port = process.env.PORT || 8080; -var mongoose = require('mongoose'); -var database = require('./config/database'); // load the database config -var morgan = require('morgan'); // log requests to the console (express4) -var bodyParser = require('body-parser'); // pull information from HTML POST (express4) -var methodOverride = require('method-override'); // simulate DELETE and PUT (express4) -var db = mongoose.connection; +var port = process.env.PORT || 3000; app.use('/', express.static(__dirname + '/')); +const mongoose = require('mongoose'); +const database = require('./config/database'); // load the database config +const morgan = require('morgan'); // log requests to the console (express4) +const bodyParser = require('body-parser'); // pull information from HTML POST (express4) +const methodOverride = require('method-override'); // simulate DELETE and PUT (express4) +const db = mongoose.connection; +const cors = require("cors"); +const postRouter = require('./app/routes/post'); +const commentRouter = require('./app/routes/comment'); +const userRouter = require('./app/routes/user'); +const stackRouter = require('./app/routes/stack'); +const replyRouter = require('./app/routes/reply'); +const passport = require('./app/lib/passport'); +const authConfig = require('./config/auth'); +const returnWithResponse = require('./app/lib/returnWithResponse'); +const UserModel = require('./app/models/user'); + +let dbURL = database.url; + app.use(morgan('dev')); // log every request to the console -app.use(bodyParser.urlencoded({'extended':'true'})); // parse application/x-www-form-urlencoded +app.use(bodyParser.urlencoded({ 'extended': 'true' })); // parse application/x-www-form-urlencoded app.use(bodyParser.json()); // parse application/json app.use(bodyParser.json({ type: 'application/vnd.api+json' })); // parse application/vnd.api+json as json app.use(methodOverride()); +app.use(cors()); +//Initalizing passport engine +app.use(passport.initialize()); -var routes = require('./app/routes')(app,db); +//Basic Routes +//serving static index.html file using middleware +app.use('/', express.static(__dirname + '/')); +app.use('/api/post', postRouter); +app.use('/api/comment', commentRouter); +app.use('/api/user', userRouter); +app.use('/api/org', stackRouter); +app.use('/api/reply', replyRouter); +//Auth and its callback +app.get('/auth/github', passport.authenticate('github', {session: false})); +app.get('/auth/github/callback', passport.authenticate('github', {failureRedirect : '/', failWithError: true, session: false}), function(request,response){ + response.redirect('http://localhost:4200/callback?userId='.concat(request.user.userId)+"&token=".concat(request.user.token)); +}, function(err, request , response){ + returnWithResponse.configureReturnData({status: 400, success: false, result: 'Authentication Failed'}, response); +}); -app.use(function (err, req, res, next) { - res.header("Access-Control-Allow-Origin", "http://localhost:8082"); - res.header('Access-Control-Allow-Methods', 'GET, PUT, POST, DELETE, OPTIONS'); - res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); - console.error(err.stack); - res.status(500).send('Something broke!') +//logout +app.get('/logout' , function(request, response){ + UserModel.logout(request, response); }); -const hostname = 'localhost'; +app.get('/api/profile',passport.authenticate('bearer', { session: false, failWithError: true }), function(req, res, next){ + returnWithResponse.configureReturnData({status: 200 , success: true, result: req.user} ,res); +}, function(err, req ,res, next){ + returnWithResponse.configureReturnData({status: 400 , success: false, result: 'Access-Denied!'} ,res); +}); + +var routes = require("./app/routes"); +routes(app, db); + +// Commenting our code for custom middleware +/* app.use(function (err, req, res, next) { + res.header("Access-Control-Allow-Origin", "http://localhost:8082"); + res.header('Access-Control-Allow-Methods', 'GET, PUT, POST, DELETE, OPTIONS'); + res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); + console.error(err.stack); + res.status(500).send('Something broke!') +});*/ -mongoose.connect(database.url,function(err){ - console.log("Connecting to the database.."); - if(err){ - mongoose.connect(database.alturl,function(err){ - return console.log(err); +// Add option { useMongoClient: true } if mongoose version < 5 +var option = database.option(mongoose.version); + +if(app.get('env') === 'test'){ + dbURL = database.testurl; + console.log('Testing ... \n'); +} + +mongoose.connect(database.url, option, function (err) { + console.log("Connecting to the database..."); + if (err) { + console.log("\nCouldn't connect to local database. Please make sure your local mongodb server is running. \nFind more: https://github.com/scorelab/Stackle#installing-mongodb\n\nConnecting to alternative remote (mongolab) database ..."); + mongoose.connect(database.alturl, options, function (err) { + if (err) { + return console.log("\nCouldn't connect to remote (mongolab) database."); + } + return console.log("\nSuccessfully connected to remote (mongolab) database!"); }) - return console.log("Couldnt connect to db url 1. connecting to alternate"); - }else{ - console.log("Mongo connect sucess!"); + } else { + console.log("\nSuccessfully connected to local database!"); } - - app.listen(port, function(){ - console.log("App listening on port " + port); - }); - }); // connect to mongoDB database on modulus.io - - +// catch 404 and forward to error handler +app.use(function (req, res, next) { + var err = new Error("Not Found"); + err.status = 404; + next(err); +}); + +// error handler +app.use(function (err, req, res, next) { + // render the error page + res.status(err.status || 500); + if (process.env.NODE_ENV !== "DEVELOPMENT") { + res.send(`

Error Code: ${err.status || 500}

`); + } else { + res.send(`

Error Code: ${err.status || 500}


${err.stack}

`); + } +}); +module.exports = app; diff --git a/stackle_api/test/comment.js b/stackle_api/test/comment.js new file mode 100644 index 0000000..a37392f --- /dev/null +++ b/stackle_api/test/comment.js @@ -0,0 +1,182 @@ +process.env.NODE_ENV = 'test'; + +const chai = require('chai'); +const chaiHttp = require('chai-http'); +const should = chai.should(); +const server = require('../server'); +const models = require('../app/models/post'); +const postModel = models['Post']; +const commentModel = models['Comment']; +const userModel = require('../app/models/user'); +const demoUserToken = "THisIsADemoToken"; +const username = 'DEMO'; + +chai.use(chaiHttp); + +// testing GET all comments for a single post +function testGetAllCommentsForAPost(done, post) { + chai.request(server) + .get('/api/comment/all/' + post._id) + .end(function(err, res) { + + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('status'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.status.should.equal(200); + res.body.result.should.be.a('array'); + done(); + }); + +} + +// testing GET single comment +function testGetSingleComment(done, comment) { + chai.request(server) + .get('/api/comment/' + comment._id) + .end(function(err, res) { + + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('status'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.status.should.equal(200); + res.body.result.should.be.a('object'); + done(); + }); +} + +//testing POST creating a comment +function testCommentCreate(done, post) { + + let newUser = new userModel({ + userId: 'demoUserId', + token: demoUserToken, + email: 'email', + name: username, + }); + + newUser.save(function(err) { + chai.request(server) + .post('/api/comment/' + post._id + '?access_token=' + demoUserToken) + .send({ + description: 'Comment description', + user: 'username', + date: '19/07/2018' + }) + .end(function(err, res) { + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.should.have.property('status'); + res.body.result.should.be.a('object'); + res.body.status.should.equal(200); + done(); + + //removing user after completing testing + userModel.remove({}); + + }); + }); +} + +// testing GET single comment +function testGetLikesUser(done, comment) { + chai.request(server) + .get('/api/comment/likes/' + comment._id) + .end(function(err, res) { + + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('status'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.status.should.equal(200); + res.body.result.should.be.a('array'); + done(); + }); +} + + +describe('Comments:- \n', function() { + + //before each testCase is run + beforeEach(function(done) { + + let newComment = new commentModel({ + description: 'Comment description', + user: username, + date: '25/10/2018' + }); + newComment.save(function(err) { + + let newPost = new postModel({ + title: 'Post_title', + description: 'post_description', + org_name: 'org_name', + repository: 'repository', + linkIssue: 'link', + user: username, + tags: [], + date: '19/07/2018' + }); + + newPost.comments.push(newComment._id); + newPost.save(function(err) { + done(); + }); + + }); + + }); + + //Droping Collection after every testCase + afterEach(function(done) { + postModel.remove({}, function(err) { + commentModel.remove({}, function(err) { + done(); + }); + }); + }); + + // Testing GET all comments for a post + it('Testing /api/comment/all/:postId', function(done) { + postModel.findOne({ + user: username + }).exec(function(err, data) { + testGetAllCommentsForAPost(done, data); + }); + }); + + // Testing GET a single comment by id + it('Testing /api/comment/:commentId', function(done) { + commentModel.findOne({ + user: username + }).exec(function(err, data) { + testGetSingleComment(done, data); + }); + }); + + // Testing GET likes array of users + it('Testing /api/comment/likes/:commentid', function(done) { + commentModel.findOne({ + user: username + }).exec(function(err, data) { + testGetLikesUser(done, data); + }); + }); + + // Testing POST creating comment + it('Testing /api/comment/:postId', function(done) { + postModel.findOne({ + user: username + }).exec(function(err, data) { + testCommentCreate(done, data); + }); + }); + + +}); \ No newline at end of file diff --git a/stackle_api/test/post.js b/stackle_api/test/post.js new file mode 100644 index 0000000..06bb712 --- /dev/null +++ b/stackle_api/test/post.js @@ -0,0 +1,214 @@ +process.env.NODE_ENV = 'test'; + +const chai = require('chai'); +const chaiHttp = require('chai-http'); +const should = chai.should(); +const server = require('../server'); +const models = require('../app/models/post'); +const postModel = models['Post']; +const userModel = require('../app/models/user'); +const demoUserToken = "THisIsADemoToken"; +const username = 'DEMO'; + +chai.use(chaiHttp); + + +//GET testing all post +function testGetAll(done) { + chai.request(server) + .get('/api/post/all') + .end(function(err, res) { + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('status'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.status.should.equal(200); + res.body.result.should.be.a('array'); + done(); + }); +} + +//GET testing a single post by postId +function testGetSingleById(done, data) { + chai.request(server) + .get('/api/post/' + data._id) + .end(function(err, res) { + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('status'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.status.should.equal(200); + res.body.result.should.be.a('object'); + done(); + }); +} + +//GET testing a single post by user +function testGetSingleByUser(done, username) { + + chai.request(server) + .get('/api/post/all/user/' + username) + .end(function(err, res) { + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('status'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.status.should.equal(200); + res.body.result.should.be.a('array'); + done(); + }); +} + +//GET testing all post +function testGetAllByOrg(done, data) { + + chai.request(server) + .get('/api/post/all/org/' + data.org_name) + .end(function(err, res) { + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('status'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.status.should.equal(200); + res.body.result.should.be.a('array'); + done(); + }); +} + +//GET testing get likes +function testGetLikes(done, data) { + + chai.request(server) + .get('/api/post/likes/' + data._id) + .end(function(err, res) { + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('status'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.status.should.equal(200); + res.body.result.should.be.a('array'); + done(); + }); +} + +//POST testing post creation +function testPostCreate(done) { + + let newUser = new userModel({ + userId: 'demoUserId', + token: demoUserToken, + email: 'email', + name: username, + }); + + newUser.save(function(err) { + + chai.request(server) + .post('/api/post/create?access_token=' + demoUserToken) + .send({ + title: 'title', + description: 'description', + org_name: 'org_name', + repository: 'repository', + linkIssue: 'link', + user: 'username', + date: '19/07/2018', + tags: [], + }) + .end(function(err, res) { + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.should.have.property('status'); + res.body.result.should.be.a('string'); + res.body.status.should.equal(200); + done(); + + //removing user after completing testing + userModel.remove({}); + }); + }); +} + +describe('POSTS:- \n', function() { + + //before each testCase is run + beforeEach(function(done) { + let newPost = new postModel({ + title: 'Post_title', + description: 'post_description', + org_name: 'org_name', + repository: 'repository', + linkIssue: 'link', + user: username, + tags: [], + date: '19/07/2018' + }); + + newPost.save(function(err) { + done(); + }); + }); + + //Droping Collection after every testCase + afterEach(function(done) { + postModel.remove({}, function(err) { + done(); + }); + }); + + + //Testing post creation + it('Testing /api/post/create', function(done) { + testPostCreate(done); + }); + + // Testing all posts + it('Testing /api/post/all', function(done) { + testGetAll(done); + }); + + //Testing a single post by id + it('Testing /api/post/:postId', function(done) { + postModel.findOne({ + user: username + }).exec(function(err, data) { + testGetSingleById(done, data); + }); + }); + + // Testing a all post by a single user + it('Testing /api/post/all/user/:user', function(done, newPost) { + postModel.findOne({ + user: username + }).exec(function(err, data) { + testGetSingleByUser(done, username); + }); + }); + + //Testing all posts by org + it('Testing /api/post/all/org/:organisationName', function(done, newPost) { + postModel.findOne({ + user: username + }).exec(function(err, data) { + testGetAllByOrg(done, data); + }); + }); + + //Testing get likes for a post + it('Testing /api/post/likes/:postId', function(done, newPost) { + postModel.findOne({ + user: username + }).exec(function(err, data) { + testGetLikes(done, data); + }); + }); + + +}); \ No newline at end of file diff --git a/stackle_api/test/reply.js b/stackle_api/test/reply.js new file mode 100644 index 0000000..9ea523b --- /dev/null +++ b/stackle_api/test/reply.js @@ -0,0 +1,149 @@ +process.env.NODE_ENV = 'test'; + +const chai = require('chai'); +const chaiHttp = require('chai-http'); +const should = chai.should(); +const server = require('../server'); +const models = require('../app/models/post'); +const replyModel = models['Reply']; +const commentModel = models['Comment']; +const userModel = require('../app/models/user'); +const demoUserToken = "THisIsADemoToken"; +const username = 'DEMO'; + +chai.use(chaiHttp); + +// testing GET all replies for a single comment +function testGetAllRepliesForAComment(done, comment) { + chai.request(server) + .get('/api/reply/all/' + comment._id) + .end(function(err, res) { + + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('status'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.status.should.equal(200); + res.body.result.should.be.a('array'); + done(); + }); + +} + +// testing GET single reply by id +function testGetReplyById(done, reply) { + chai.request(server) + .get('/api/reply/' + reply._id) + .end(function(err, res) { + + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('status'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.status.should.equal(200); + res.body.result.should.be.a('object'); + done(); + }); +} + +//testing POST creating a reply +function testReplyCreate(done, comment) { + + let newUser = new userModel({ + userId: 'demoUserId', + token: demoUserToken, + email: 'email', + name: username, + }); + + newUser.save(function(err) { + chai.request(server) + .post('/api/reply/' + comment._id + '?access_token=' + demoUserToken) + .send({ + description: 'reply Demo description', + user: 'demousername1', + date: '19/07/2018' + }) + .end(function(err, res) { + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.should.have.property('status'); + res.body.result.should.be.a('object'); + res.body.status.should.equal(200); + done(); + + //removing user after completing testing + userModel.remove({}); + + }); + }); +} + +//Grouping of testCases +describe('Reply:- \n', function() { + + //before each testCase is run + beforeEach(function(done) { + + let newReply = new replyModel({ + description: 'Reply description', + user: username, + date: '25/10/2018' + }); + newReply.save(function(err) { + + let newComment = new commentModel({ + description: 'Comment description', + user: username, + date: '19/10/2018' + }); + + newComment.replies.push(newReply._id); + newComment.save(function(err) { + done(); + }); + + }); + + }); + + //Droping Collection after every testCase + afterEach(function(done) { + commentModel.remove({}, function(err) { + replyModel.remove({}, function(err) { + done(); + }); + }); + }); + + // Testing GET all replies for a comment + it('Testing /api/reply/all/:commentId', function(done) { + commentModel.findOne({ + user: username + }).exec(function(err, data) { + testGetAllRepliesForAComment(done, data); + }); + }); + + // Testing GET a reply by ID + it('Testing /api/reply/:replyId', function(done) { + replyModel.findOne({ + user: username + }, function(err, data) { + testGetReplyById(done, data); + }); + }); + + // Testing POST creating reply + it('Testing /api/reply/:commentId', function(done) { + commentModel.findOne({ + user: username + }).exec(function(err, data) { + testReplyCreate(done, data); + }); + }); +}); \ No newline at end of file diff --git a/stackle_api/test/stack.js b/stackle_api/test/stack.js new file mode 100644 index 0000000..ec0c8da --- /dev/null +++ b/stackle_api/test/stack.js @@ -0,0 +1,149 @@ +process.env.NODE_ENV = 'test'; + +const chai = require('chai'); +const chaiHttp = require('chai-http'); +const should = chai.should(); +const server = require('../server'); +const stackModel = require('../app/models/stack'); +const stackName = 'testStack'; +const BASEURL = '/api/org/'; +const userModel = require('../app/models/user'); +const demoUserToken = "THisIsADemoToken"; +const username = 'DEMO'; + +chai.use(chaiHttp); + +//GET testing all stack +function testGetAllStack(done) { + chai.request(server) + .get(BASEURL + 'all') + .end(function(err, res) { + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('status'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.status.should.equal(200); + res.body.result.should.be.a('array'); + done(); + }); +} + +//GET testing a single stack by user +function testGetStackByName(done, stackName) { + chai.request(server) + .get(BASEURL + 'name/' + stackName) + .end(function(err, res) { + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('status'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.status.should.equal(200); + res.body.result.should.be.a('object'); + done(); + }); +} + +//POST testing stack creation +function testStackCreate(done) { + + let newUser = new userModel({ + userId: 'demoUserId', + token: demoUserToken, + email: 'email', + name: username, + }); + + newUser.save(function(err) { + chai.request(server) + .post(BASEURL + 'create?access_token=' + demoUserToken) + .send({ + name: 'name', + description: 'description', + stackleUrl: 'url_link', + linkIssue: 'link_Issue', + createdUser: 'demo', + }) + .end(function(err, res) { + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.should.have.property('status'); + res.body.result.should.be.a('string'); + res.body.status.should.equal(200); + done(); + + //removing user after testing + newUser.remove({}); + }); + }); + + +} + +//GET testing a single stack by ID +function testGetStackById(done, stack) { + chai.request(server) + .get(BASEURL + 'id/' + stack._id) + .end(function(err, res) { + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('status'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.status.should.equal(200); + res.body.result.should.be.a('object'); + done(); + }); +} + +//Grouping stack related testcases +describe('STACK:- \n', function() { + + //before each testCase is run + beforeEach(function(done) { + let newStack = new stackModel({ + name: stackName, + description: 'This is a testing stack', + stackleUrl: 'demoUrl', + createdUser: 'demoUser', + }); + + newStack.save(function(err) { + done(); + }); + }); + + //Droping Collection after every testCase + afterEach(function(done) { + stackModel.remove({}, function(err) { + done(); + }); + }); + + //Testing stack creation + it('Testing /api/org/create', function(done) { + testStackCreate(done); + }); + + // Testing all stacks + it('Testing /api/org/all', function(done) { + testGetAllStack(done); + }); + + //Testing GET stack by name + it('Testing /api/org/name/:organisationName', function(done) { + testGetStackByName(done, stackName); + }); + + //Testing GET stack by ID + it('Testing /api/org/id/:stackId', function(done) { + stackModel.findOne({ + name: stackName + }, function(err, stack) { + testGetStackById(done, stack); + }); + }); +}); \ No newline at end of file diff --git a/stackle_api/test/user.js b/stackle_api/test/user.js new file mode 100644 index 0000000..89a5611 --- /dev/null +++ b/stackle_api/test/user.js @@ -0,0 +1,166 @@ +process.env.NODE_ENV = 'test'; + +const chai = require('chai'); +const chaiHttp = require('chai-http'); +const should = chai.should(); +const server = require('../server'); +const models = require('../app/models/post'); +const postModel = models['Post']; +const userModel = require('../app/models/user'); + +const demoUserToken = "THis_Is_A_Demo_Token"; +const demoUserName = 'DEMO_User_ID_NAME'; + +chai.use(chaiHttp); + + +//GET testing all Uers +function testGetAll(done) { + chai.request(server) + .get('/api/user/all') + .end(function(err, res) { + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('status'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.status.should.equal(200); + res.body.result.should.be.a('array'); + done(); + }); +} + +//GET testing a single user by userId +function testGetSingleByUserId(done) { + chai.request(server) + .get('/api/user/' + demoUserName) + .end(function(err, res) { + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('status'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.status.should.equal(200); + res.body.result.should.be.a('object'); + done(); + }); +} + + +//GET testing a single user by DB_id +function testGetSingleByDBId(done, user) { + chai.request(server) + .get('/api/user/id/' + user._id) + .end(function(err, res) { + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('status'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.status.should.equal(200); + res.body.result.should.be.a('object'); + done(); + }); +} + + + +//GET testing a single user by DB_id +function testGetStacksList(done) { + chai.request(server) + .get('/api/user/stacks/' + demoUserName) + .end(function(err, res) { + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('status'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.status.should.equal(200); + res.body.result.should.be.a('array'); + done(); + }); +} + + +//POST testing user creation +function testUserCreate(done) { + chai.request(server) + .post('/api/user/create?access_token=' + demoUserToken) + .send({ + userId: 'userid', + token: 'token', + email: 'userEmail', + name: 'name', + picUrl: 'linkPic', + profileUrl: 'linkProfile', + }) + .end(function(err, res) { + res.should.be.json; + res.body.should.be.a('object'); + res.body.should.have.property('success'); + res.body.should.have.property('result'); + res.body.should.have.property('status'); + res.body.result.should.be.a('string'); + res.body.status.should.equal(200); + done(); + }); +} + + +//Grouping user testCases +describe('User:- \n', function() { + + //before each testCase is run + beforeEach(function(done) { + let newUser = new userModel({ + userId: demoUserName, + token: demoUserToken, + email: 'email', + name: demoUserName, + picUrl: 'piclink', + profileUrl: 'profileLink', + }); + + newUser.save(function(err) { + done(); + }); + }); + + //Droping Collection after every testCase + afterEach(function(done) { + userModel.remove({}, function(err) { + done(); + }); + }); + + // Testing GET User all + it('Testing /api/user/all', function(done) { + testGetAll(done); + }); + + // Testing GET User by userID + it('Testing /api/user/:userId', function(done) { + testGetSingleByUserId(done); + }); + + // Testing GET User by DB ID + it('Testing /api/user/id/:id', function(done) { + userModel.findOne({ + userId: demoUserName + }, function(err, user) { + testGetSingleByDBId(done, user); + }); + + }); + + // Testing GET subscribe stacks by userId + it('Testing /api/user/stacks/:userId', function(done) { + testGetStacksList(done); + }); + + //Testing POST: creating a USER + it('Testing /api/user/create', function(done) { + testUserCreate(done); + }); + +}); \ No newline at end of file diff --git a/stackle_app/.bowerrc b/stackle_app/.bowerrc deleted file mode 100644 index 69fad35..0000000 --- a/stackle_app/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "bower_components" -} diff --git a/stackle_app/.dockerignore b/stackle_app/.dockerignore deleted file mode 100644 index 03615bc..0000000 --- a/stackle_app/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -npm-debug.log -bower_components \ No newline at end of file diff --git a/stackle_app/.editorconfig b/stackle_app/.editorconfig deleted file mode 100644 index c2cdfb8..0000000 --- a/stackle_app/.editorconfig +++ /dev/null @@ -1,21 +0,0 @@ -# EditorConfig helps developers define and maintain consistent -# coding styles between different editors and IDEs -# editorconfig.org - -root = true - - -[*] - -# Change these settings to your own preference -indent_style = space -indent_size = 2 - -# We recommend you to keep these unchanged -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/stackle_app/.gitattributes b/stackle_app/.gitattributes deleted file mode 100644 index 2125666..0000000 --- a/stackle_app/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text=auto \ No newline at end of file diff --git a/stackle_app/.gitignore b/stackle_app/.gitignore deleted file mode 100644 index dc5576c..0000000 --- a/stackle_app/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -/node_modules -/dist -/.tmp -/.sass-cache -/bower_components diff --git a/stackle_app/.jscsrc b/stackle_app/.jscsrc deleted file mode 100644 index f8bf9ba..0000000 --- a/stackle_app/.jscsrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "requireCamelCaseOrUpperCaseIdentifiers": true, - "requireCapitalizedConstructors": true, - "requireParenthesesAroundIIFE": true, - "validateQuoteMarks": "'" -} diff --git a/stackle_app/.jshintrc b/stackle_app/.jshintrc deleted file mode 100644 index 4572e5d..0000000 --- a/stackle_app/.jshintrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "bitwise": true, - "browser": true, - "curly": true, - "eqeqeq": true, - "esnext": true, - "latedef": true, - "noarg": true, - "node": true, - "strict": true, - "undef": true, - "unused": true, - "globals": { - "angular": false - } -} diff --git a/stackle_app/.yo-rc.json b/stackle_app/.yo-rc.json deleted file mode 100644 index 0967ef4..0000000 --- a/stackle_app/.yo-rc.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/stackle_app/Dockerfile b/stackle_app/Dockerfile deleted file mode 100644 index b486673..0000000 --- a/stackle_app/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM node:boron - -WORKDIR /usr/src/app - -COPY . . - -RUN npm install - -EXPOSE 9000 -CMD [ "npm", "start"] \ No newline at end of file diff --git a/stackle_app/README.md b/stackle_app/README.md deleted file mode 100644 index b01e37e..0000000 --- a/stackle_app/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# stackle-app - -This project is generated with [yo angular generator](https://github.com/yeoman/generator-angular) -version 0.16.0. - -## Build & development - -Run `grunt` for building and `grunt serve` for preview. - -## Testing - -Running `grunt test` will run the unit tests with karma. diff --git a/stackle_app/app/404.html b/stackle_app/app/404.html deleted file mode 100644 index 899828a..0000000 --- a/stackle_app/app/404.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - Page Not Found :( - - - -
-

Not found :(

-

Sorry, but the page you were trying to view does not exist.

-

It looks like this was the result of either:

-
    -
  • a mistyped address
  • -
  • an out-of-date link
  • -
- - -
- - diff --git a/stackle_app/app/favicon.ico b/stackle_app/app/favicon.ico deleted file mode 100644 index 6527905..0000000 Binary files a/stackle_app/app/favicon.ico and /dev/null differ diff --git a/stackle_app/app/images/yeoman.png b/stackle_app/app/images/yeoman.png deleted file mode 100644 index 92497ad..0000000 Binary files a/stackle_app/app/images/yeoman.png and /dev/null differ diff --git a/stackle_app/app/index.html b/stackle_app/app/index.html deleted file mode 100644 index 86f4d57..0000000 --- a/stackle_app/app/index.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/stackle_app/app/robots.txt b/stackle_app/app/robots.txt deleted file mode 100644 index 4d521f9..0000000 --- a/stackle_app/app/robots.txt +++ /dev/null @@ -1,4 +0,0 @@ -# robotstxt.org - -User-agent: * -Disallow: diff --git a/stackle_app/app/scripts/app.js b/stackle_app/app/scripts/app.js deleted file mode 100644 index 066a22f..0000000 --- a/stackle_app/app/scripts/app.js +++ /dev/null @@ -1,77 +0,0 @@ -'use strict'; - -/** - * @ngdoc overview - * @name stackleAppApp - * @description - * # stackleAppApp - * - * Main module of the application. - */ -angular - .module('stackleAppApp', [ - 'ngAnimate', - 'ngCookies', - 'ngResource', - 'ngRoute', - 'ngSanitize', - 'ngTouch', - 'ngMaterial', - 'auth0', - 'angular-storage', - 'angular-jwt', - 'ui.router' - ]) - .config(function ($routeProvider, - $provide, - authProvider, - $urlRouterProvider, - $stateProvider, - $httpProvider, - jwtInterceptorProvider, - $mdIconProvider) { - - authProvider.init({ - domain : 'psnmissaka.au.auth0.com', - clientID : 'f6ewsNvcnhe8ODntv_FAD_lW_YPvxN5X' - }); - - $mdIconProvider - .iconSet('social', 'img/icons/sets/social-icons.svg', 24) - .defaultIconSet('img/icons/sets/core-icons.svg', 24); - - $stateProvider - .state('home',{ - url : '/home', - templateUrl : 'views/home.html' - }) - .state('profile',{ - url :'/profile', - templateUrl : 'views/profile.html', - controller : 'profileController as user' - }) - .state('landing',{ - url : '/landing', - templateUrl : 'views/landing.html', - controller : 'landingController' - }) - .state('main',{ - url : '', - templateUrl : 'views/main.html', - controller : 'MainCtrl' - }) - .state('createPost', { - url : '/post/createPost', - templateUrl : 'views/posts/create-post.html', - controller : 'createPostController' - }) - .state('viewPost', { - url : '/post/viewPost', - templateUrl : 'views/posts/view-post.html', - controller : 'viewPostController' - }) - .state('otherwise',{ - url : '/#!/*path', - templateUrl : '404.html' - }) - }); diff --git a/stackle_app/app/scripts/controllers/landing.js b/stackle_app/app/scripts/controllers/landing.js deleted file mode 100644 index 68db022..0000000 --- a/stackle_app/app/scripts/controllers/landing.js +++ /dev/null @@ -1,65 +0,0 @@ -(function () { - 'use strict'; - angular - .module('stackleAppApp') - .controller('landingController', ['$scope', 'userService', 'stackService', 'postService', landingController]); - - function landingController($scope, userService, stackService ,postService) { - $scope.user_id = JSON.parse(localStorage.getItem("profile")).identities[0].user_id; - $scope.orgs = userService.getOrgs(); - $scope.org_post = false; - - postService.getAllPosts(function(data){ - if(data.length!=0){ - $scope.posts = data; - }else{ - $scope.postError = true; - } - }) - - $scope.searched = false; - - $scope.searchOrg = function (name) { - - stackService.searchStack(name, function(res) { - $scope.searched = false; - $scope.org_name = res.data.name; - $scope.description = res.data.description; - $scope.num_repos = res.data.public_repos; - $scope.repo_url = res.data.repos_url; - $scope.logo_url = res.data.avatar_url; - - $scope.ifEx = stackService.stackExist($scope.org_name); - $scope.searched = true; - }) - } - $scope.orgname = ''; - - $scope.subscribe = function(user_id, org_name){ - stackService.subscribeStack(user_id, org_name, function(data){ - $scope.submessage = data; - console.log($scope.submessage); - }) - }; - - - userService.getSubscribedStacks($scope.user_id, function(data){ - if(data.length != 0){ - $scope.sub_stacks = data; - }else{ - $scope.subscribed = false; - } - }); - - $scope.getOrgPosts = function(org_name){ - postService.getOrgPosts(org_name , function(res){ - console.log(res); - $scope.org_post = false; - $scope.org_posts = res; - $scope.org_post = true; - }) - }; - - } - -})(); diff --git a/stackle_app/app/scripts/controllers/main.js b/stackle_app/app/scripts/controllers/main.js deleted file mode 100644 index 88ac235..0000000 --- a/stackle_app/app/scripts/controllers/main.js +++ /dev/null @@ -1,18 +0,0 @@ -'use strict'; - -/** - * @ngdoc function - * @name stackleAppApp.controller:MainCtrl - * @description - * # MainCtrl - * Controller of the stackleAppApp - */ -angular.module('stackleAppApp') - .controller('MainCtrl', function () { - this.awesomeThings = [ - 'HTML5 Boilerplate', - 'AngularJS', - 'Karma' - ]; - - }); diff --git a/stackle_app/app/scripts/controllers/posts/create-post.js b/stackle_app/app/scripts/controllers/posts/create-post.js deleted file mode 100644 index a1554f3..0000000 --- a/stackle_app/app/scripts/controllers/posts/create-post.js +++ /dev/null @@ -1,20 +0,0 @@ -(function () { - 'use strict'; - angular - .module('stackleAppApp') - .controller('createPostController', CreatePostController); - - function CreatePostController ($mdConstant, $scope) { - // Use common key codes found in $mdConstant.KEY_CODE... - this.keys = [$mdConstant.KEY_CODE.ENTER, $mdConstant.KEY_CODE.COMMA]; - this.tags = []; - - $scope.post = { - title : '', - description : '', - repository : '', - tags : [] - }; - - } -})(); \ No newline at end of file diff --git a/stackle_app/app/scripts/controllers/posts/view-post.js b/stackle_app/app/scripts/controllers/posts/view-post.js deleted file mode 100644 index 502c1ca..0000000 --- a/stackle_app/app/scripts/controllers/posts/view-post.js +++ /dev/null @@ -1,21 +0,0 @@ -(function () { - 'use strict'; - angular - .module('stackleAppApp') - .controller('viewPostController', ['$scope', 'postService', ViewPostController]); - - function ViewPostController ($scope, postService) { - // $scope.title = "This works!"; - postService.getPost('594e14fdb95cd72f0034ebc5', function (data){ - if(data._id){ - $scope.post = data; - }else{ - $scope.error = true; - } - }) - - $scope.comment = ''; - - - } -})(); \ No newline at end of file diff --git a/stackle_app/app/scripts/controllers/profile.js b/stackle_app/app/scripts/controllers/profile.js deleted file mode 100644 index 084389a..0000000 --- a/stackle_app/app/scripts/controllers/profile.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -angular.module('stackleAppApp') - .controller('profileController', function ($http, $scope) { - this.awesomeThings = [ - 'HTML5 Boilerplate', - 'AngularJS', - 'Karma' - ]; - - $scope.profile = JSON.parse(localStorage.getItem("profile")); - - }); diff --git a/stackle_app/app/scripts/controllers/stackfeed.js b/stackle_app/app/scripts/controllers/stackfeed.js deleted file mode 100644 index ea6c936..0000000 --- a/stackle_app/app/scripts/controllers/stackfeed.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -angular.module('stackleAppApp') - .controller('stackFeedController', function ($http) { - this.awesomeThings = [ - 'HTML5 Boilerplate', - 'AngularJS', - 'Karma' - ]; - }); diff --git a/stackle_app/app/scripts/directives/toolbar.directive.js b/stackle_app/app/scripts/directives/toolbar.directive.js deleted file mode 100644 index 6defe22..0000000 --- a/stackle_app/app/scripts/directives/toolbar.directive.js +++ /dev/null @@ -1,39 +0,0 @@ -(function(){ - 'use strict'; - - angular - .module('stackleAppApp') - .directive('toolbar',toolbar); - - function toolbar(){ - return { - templateUrl: 'views/toolbar.html', - controller : toolbarController, - controllerAs: 'toolbar' - } - } - - function toolbarController(auth, store, $location){ - var vm = this; - vm.login = login; - vm.logout = logout; - vm.auth = auth; - - function login(){ - auth.signin({},function(profile, token){ - store.set('profile', profile); - store.set('id_token', token); - $location.path('/landing'); - }, function(err){ - console.log(err); - }); - } - - function logout(){ - store.remove('profile'); - store.remove('id_token'); - auth.signout(); - $location.path('/home'); - } - } -})(); diff --git a/stackle_app/app/scripts/services/post.service.js b/stackle_app/app/scripts/services/post.service.js deleted file mode 100644 index 9aafe2f..0000000 --- a/stackle_app/app/scripts/services/post.service.js +++ /dev/null @@ -1,43 +0,0 @@ -(function () { - 'use strict'; - - angular.module('stackleAppApp') - .service('postService', ['$http', postService]); - - function postService($http) { - var server = 'http://localhost:8080/'; - - var getAllPosts = function (callback) { - var apiurl = server + 'api/posts'; - - $http.get(apiurl).then(function (response) { - callback(response.data); - }) - } - - var getPost = function (postid, callback) { - var apiUrl = server + 'api/post/' + postid; - - $http.get(apiUrl).then(function (response) { - callback(response.data); - }); - } - - var getOrgPosts = function (orgname, callback) { - var apiUrl = server + 'api/posts/org/'+ orgname; - - $http.get(apiUrl).then(function(response){ - callback(response.data); - }, function(error){ - callback(error); - }) - }; - - return { - getAllPosts: getAllPosts, - getPost: getPost, - getOrgPosts : getOrgPosts - } - } - -})(); \ No newline at end of file diff --git a/stackle_app/app/scripts/services/stack.service.js b/stackle_app/app/scripts/services/stack.service.js deleted file mode 100644 index 9ffb78f..0000000 --- a/stackle_app/app/scripts/services/stack.service.js +++ /dev/null @@ -1,76 +0,0 @@ -(function () { - 'use strict'; - - angular.module('stackleAppApp') - .service('stackService', ['$http', stackService]); - - function stackService($http) { - - var searchStack = function (name, cb) { - if (name) { - var url = "https://api.github.com/orgs/" + name; - $http.get(url).then(function (result) { - return cb(result); - }, function (error) { - return cb(error); - }); - } else { - return "Can't get!"; - } - - } - - var stackExist = function (name, cb) { - if (name) { - var url = 'http://localhost:8080/api/org/' + name; - $http.get(url).then(function (result) { - // console.log(result.data); - if (result.data = '[]') { - return cb(false); - } - return cb(true); - }, function (error) { - return cb(error); - }) - } - } - - var createStack = function (name, username) { - var url = "https://api.github.com/orgs/{{name}}/members"; - - $http.get(url).then(function (response) { - var members = JSON.parse(response.data); - for (var member in members) { - if (member.login == name) { - return "you are a member"; - } else { - return "you are not a member"; - } - } - }, function error(response) { - return "error occured!" - }) - } - - var subscribeStack = function (userid, stackname, callback) { - var apiUrl = 'http://localhost:8080/api/subscribe'; - var data = { - uid: userid, - stack_name: stackname - }; - $http.post(apiUrl, data).then(function (response) { - callback(response); - }, function (error) { - callback(error); - }) - }; - - return { - searchStack: searchStack, - createStack: createStack, - stackExist: stackExist, - subscribeStack: subscribeStack - } - - } -})(); diff --git a/stackle_app/app/scripts/services/user.service.js b/stackle_app/app/scripts/services/user.service.js deleted file mode 100644 index 4b9a92c..0000000 --- a/stackle_app/app/scripts/services/user.service.js +++ /dev/null @@ -1,30 +0,0 @@ -(function () { - 'use strict'; - - angular.module('stackleAppApp') - .service('userService', ['$http', userService]); - - function userService($http) { - var server = 'http://localhost:8080/'; - var getOrgs = function () { - var url = JSON.parse(localStorage.getItem("profile")).organizations_url; - $http.get(url).then(function (response) { - return response; - }, function error(response) { - return "error_occured"; - }) - } - - var getSubscribedStacks = function(userid, callback){ - var apiUrl = server + 'api/stack/subscribed/'+ userid; - $http.get(apiUrl).then(function(response){ - return callback(response.data); - }) - }; - - return { - getOrgs: getOrgs, - getSubscribedStacks : getSubscribedStacks - } - } -})(); diff --git a/stackle_app/app/styles/landing.css b/stackle_app/app/styles/landing.css deleted file mode 100644 index f8bfd1f..0000000 --- a/stackle_app/app/styles/landing.css +++ /dev/null @@ -1,17 +0,0 @@ -#orghd{ - font-weight: bold; - text-align: center; -} - -#orgmenu{ - background-color: white; - height: 100%; - width: 25%; - text-align: center; - -} - -#org_logo{ - height: 56px; - width : 56px; -} diff --git a/stackle_app/app/styles/main.css b/stackle_app/app/styles/main.css deleted file mode 100644 index 1c0b3bc..0000000 --- a/stackle_app/app/styles/main.css +++ /dev/null @@ -1,127 +0,0 @@ -.browsehappy { - margin: 0.2em 0; - background: #ccc; - color: #000; - padding: 0.2em 0; -} - -body { - padding: 0; - background-color: #ECEFF1; -} - -/* Everything but the jumbotron gets side spacing for mobile first views */ -.header, -.marketing, -.footer { - padding-left: 15px; - padding-right: 15px; -} - -/* Custom page header */ -.header { - border-bottom: 1px solid #e5e5e5; - margin-bottom: 10px; -} -/* Make the masthead heading the same height as the navigation */ -.header h3 { - margin-top: 0; - margin-bottom: 0; - line-height: 40px; - padding-bottom: 19px; -} - -/* Custom page footer */ -.footer { - padding-top: 19px; - color: #777; - border-top: 1px solid #e5e5e5; -} - -.container-narrow > hr { - margin: 30px 0; -} - -/* Main marketing message and sign up button */ -.jumbotron { - text-align: center; - border-bottom: 1px solid #e5e5e5; -} -.jumbotron .btn { - font-size: 21px; - padding: 14px 24px; -} - -/* Supporting marketing content */ -.marketing { - margin: 40px 0; -} -.marketing p + h4 { - margin-top: 28px; -} - -#newsfeed{ - background-color: white; - height: 100%; - width: 50%; - -} - -#notification{ - background-color: white; - height: 100%; - width: 25%; -} - -/* Responsive: Portrait tablets and up */ -@media screen and (min-width: 768px) { - .container { - max-width: 730px; - } - - /* Remove the padding we set earlier */ - .header, - .marketing, - .footer { - padding-left: 0; - padding-right: 0; - } - /* Space out the masthead */ - .header { - margin-bottom: 30px; - } - /* Remove the bottom border on the jumbotron for visual effect */ - .jumbotron { - border-bottom: 0; - } -} - -.stacklePost{ - background-color: white; -} - -.comments{ - margin-left : 5px; - font-size: 14px; -} - -.poster{ - font-size : 12px; - color: #777; -} - -.tag_chips{ - font-size: 12px; -} - -.postvote{ - text-align: center; -} - -.tagslike{ - margin-right: 5px; - margin-left : 5px; - padding: 5px; - font-size: 14px; - background-color: greenyellow; -} \ No newline at end of file diff --git a/stackle_app/app/styles/profile.css b/stackle_app/app/styles/profile.css deleted file mode 100644 index e8205e3..0000000 --- a/stackle_app/app/styles/profile.css +++ /dev/null @@ -1,10 +0,0 @@ -#profile_pic{ - margin: 5px; - height: 96px; - width: 96px; -} - -#profile_card{ - /*background-color: #BDBDBD;*/ - text-align : center; -} diff --git a/stackle_app/app/vendor/angular-cookies.js b/stackle_app/app/vendor/angular-cookies.js deleted file mode 100644 index a290ec0..0000000 --- a/stackle_app/app/vendor/angular-cookies.js +++ /dev/null @@ -1,331 +0,0 @@ -/** - * @license AngularJS v1.6.4 - * (c) 2010-2017 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window, angular) {'use strict'; - -/** - * @ngdoc module - * @name ngCookies - * @description - * - * # ngCookies - * - * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies. - * - * - *
- * - * See {@link ngCookies.$cookies `$cookies`} for usage. - */ - - -angular.module('ngCookies', ['ng']). - info({ angularVersion: '1.6.4' }). - /** - * @ngdoc provider - * @name $cookiesProvider - * @description - * Use `$cookiesProvider` to change the default behavior of the {@link ngCookies.$cookies $cookies} service. - * */ - provider('$cookies', [/** @this */function $CookiesProvider() { - /** - * @ngdoc property - * @name $cookiesProvider#defaults - * @description - * - * Object containing default options to pass when setting cookies. - * - * The object may have following properties: - * - * - **path** - `{string}` - The cookie will be available only for this path and its - * sub-paths. By default, this is the URL that appears in your `` tag. - * - **domain** - `{string}` - The cookie will be available only for this domain and - * its sub-domains. For security reasons the user agent will not accept the cookie - * if the current domain is not a sub-domain of this domain or equal to it. - * - **expires** - `{string|Date}` - String of the form "Wdy, DD Mon YYYY HH:MM:SS GMT" - * or a Date object indicating the exact date/time this cookie will expire. - * - **secure** - `{boolean}` - If `true`, then the cookie will only be available through a - * secured connection. - * - * Note: By default, the address that appears in your `` tag will be used as the path. - * This is important so that cookies will be visible for all routes when html5mode is enabled. - * - * @example - * - * ```js - * angular.module('cookiesProviderExample', ['ngCookies']) - * .config(['$cookiesProvider', function($cookiesProvider) { - * // Setting default options - * $cookiesProvider.defaults.domain = 'foo.com'; - * $cookiesProvider.defaults.secure = true; - * }]); - * ``` - **/ - var defaults = this.defaults = {}; - - function calcOptions(options) { - return options ? angular.extend({}, defaults, options) : defaults; - } - - /** - * @ngdoc service - * @name $cookies - * - * @description - * Provides read/write access to browser's cookies. - * - *
- * Up until Angular 1.3, `$cookies` exposed properties that represented the - * current browser cookie values. In version 1.4, this behavior has changed, and - * `$cookies` now provides a standard api of getters, setters etc. - *
- * - * Requires the {@link ngCookies `ngCookies`} module to be installed. - * - * @example - * - * ```js - * angular.module('cookiesExample', ['ngCookies']) - * .controller('ExampleController', ['$cookies', function($cookies) { - * // Retrieving a cookie - * var favoriteCookie = $cookies.get('myFavorite'); - * // Setting a cookie - * $cookies.put('myFavorite', 'oatmeal'); - * }]); - * ``` - */ - this.$get = ['$$cookieReader', '$$cookieWriter', function($$cookieReader, $$cookieWriter) { - return { - /** - * @ngdoc method - * @name $cookies#get - * - * @description - * Returns the value of given cookie key - * - * @param {string} key Id to use for lookup. - * @returns {string} Raw cookie value. - */ - get: function(key) { - return $$cookieReader()[key]; - }, - - /** - * @ngdoc method - * @name $cookies#getObject - * - * @description - * Returns the deserialized value of given cookie key - * - * @param {string} key Id to use for lookup. - * @returns {Object} Deserialized cookie value. - */ - getObject: function(key) { - var value = this.get(key); - return value ? angular.fromJson(value) : value; - }, - - /** - * @ngdoc method - * @name $cookies#getAll - * - * @description - * Returns a key value object with all the cookies - * - * @returns {Object} All cookies - */ - getAll: function() { - return $$cookieReader(); - }, - - /** - * @ngdoc method - * @name $cookies#put - * - * @description - * Sets a value for given cookie key - * - * @param {string} key Id for the `value`. - * @param {string} value Raw value to be stored. - * @param {Object=} options Options object. - * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults} - */ - put: function(key, value, options) { - $$cookieWriter(key, value, calcOptions(options)); - }, - - /** - * @ngdoc method - * @name $cookies#putObject - * - * @description - * Serializes and sets a value for given cookie key - * - * @param {string} key Id for the `value`. - * @param {Object} value Value to be stored. - * @param {Object=} options Options object. - * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults} - */ - putObject: function(key, value, options) { - this.put(key, angular.toJson(value), options); - }, - - /** - * @ngdoc method - * @name $cookies#remove - * - * @description - * Remove given cookie - * - * @param {string} key Id of the key-value pair to delete. - * @param {Object=} options Options object. - * See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults} - */ - remove: function(key, options) { - $$cookieWriter(key, undefined, calcOptions(options)); - } - }; - }]; - }]); - -angular.module('ngCookies'). -/** - * @ngdoc service - * @name $cookieStore - * @deprecated - * sinceVersion="v1.4.0" - * Please use the {@link ngCookies.$cookies `$cookies`} service instead. - * - * @requires $cookies - * - * @description - * Provides a key-value (string-object) storage, that is backed by session cookies. - * Objects put or retrieved from this storage are automatically serialized or - * deserialized by angular's toJson/fromJson. - * - * Requires the {@link ngCookies `ngCookies`} module to be installed. - * - * @example - * - * ```js - * angular.module('cookieStoreExample', ['ngCookies']) - * .controller('ExampleController', ['$cookieStore', function($cookieStore) { - * // Put cookie - * $cookieStore.put('myFavorite','oatmeal'); - * // Get cookie - * var favoriteCookie = $cookieStore.get('myFavorite'); - * // Removing a cookie - * $cookieStore.remove('myFavorite'); - * }]); - * ``` - */ - factory('$cookieStore', ['$cookies', function($cookies) { - - return { - /** - * @ngdoc method - * @name $cookieStore#get - * - * @description - * Returns the value of given cookie key - * - * @param {string} key Id to use for lookup. - * @returns {Object} Deserialized cookie value, undefined if the cookie does not exist. - */ - get: function(key) { - return $cookies.getObject(key); - }, - - /** - * @ngdoc method - * @name $cookieStore#put - * - * @description - * Sets a value for given cookie key - * - * @param {string} key Id for the `value`. - * @param {Object} value Value to be stored. - */ - put: function(key, value) { - $cookies.putObject(key, value); - }, - - /** - * @ngdoc method - * @name $cookieStore#remove - * - * @description - * Remove given cookie - * - * @param {string} key Id of the key-value pair to delete. - */ - remove: function(key) { - $cookies.remove(key); - } - }; - - }]); - -/** - * @name $$cookieWriter - * @requires $document - * - * @description - * This is a private service for writing cookies - * - * @param {string} name Cookie name - * @param {string=} value Cookie value (if undefined, cookie will be deleted) - * @param {Object=} options Object with options that need to be stored for the cookie. - */ -function $$CookieWriter($document, $log, $browser) { - var cookiePath = $browser.baseHref(); - var rawDocument = $document[0]; - - function buildCookieString(name, value, options) { - var path, expires; - options = options || {}; - expires = options.expires; - path = angular.isDefined(options.path) ? options.path : cookiePath; - if (angular.isUndefined(value)) { - expires = 'Thu, 01 Jan 1970 00:00:00 GMT'; - value = ''; - } - if (angular.isString(expires)) { - expires = new Date(expires); - } - - var str = encodeURIComponent(name) + '=' + encodeURIComponent(value); - str += path ? ';path=' + path : ''; - str += options.domain ? ';domain=' + options.domain : ''; - str += expires ? ';expires=' + expires.toUTCString() : ''; - str += options.secure ? ';secure' : ''; - - // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum: - // - 300 cookies - // - 20 cookies per unique domain - // - 4096 bytes per cookie - var cookieLength = str.length + 1; - if (cookieLength > 4096) { - $log.warn('Cookie \'' + name + - '\' possibly not set or overflowed because it was too large (' + - cookieLength + ' > 4096 bytes)!'); - } - - return str; - } - - return function(name, value, options) { - rawDocument.cookie = buildCookieString(name, value, options); - }; -} - -$$CookieWriter.$inject = ['$document', '$log', '$browser']; - -angular.module('ngCookies').provider('$$cookieWriter', /** @this */ function $$CookieWriterProvider() { - this.$get = $$CookieWriter; -}); - - -})(window, window.angular); diff --git a/stackle_app/app/vendor/angular-jwt.js b/stackle_app/app/vendor/angular-jwt.js deleted file mode 100644 index 5bf8ef1..0000000 --- a/stackle_app/app/vendor/angular-jwt.js +++ /dev/null @@ -1,394 +0,0 @@ -(function() { - - -// Create all modules and define dependencies to make sure they exist -// and are loaded in the correct order to satisfy dependency injection -// before all nested files are concatenated by Grunt - -// Modules -angular.module('angular-jwt', - [ - 'angular-jwt.options', - 'angular-jwt.interceptor', - 'angular-jwt.jwt', - 'angular-jwt.authManager' - ]); - -angular.module('angular-jwt.authManager', []) - .provider('authManager', function () { - - this.$get = ["$rootScope", "$injector", "$location", "jwtHelper", "jwtInterceptor", "jwtOptions", function ($rootScope, $injector, $location, jwtHelper, jwtInterceptor, jwtOptions) { - - var config = jwtOptions.getConfig(); - - function invokeToken(tokenGetter) { - var token = null; - if (Array.isArray(tokenGetter)) { - token = $injector.invoke(tokenGetter, this, {options: null}); - } else { - token = tokenGetter(); - } - return token; - } - - function invokeRedirector(redirector) { - if (Array.isArray(redirector) || angular.isFunction(redirector)) { - return $injector.invoke(redirector, config, {}); - } else { - throw new Error('unauthenticatedRedirector must be a function'); - } - } - - function isAuthenticated() { - var token = invokeToken(config.tokenGetter); - if (token) { - return !jwtHelper.isTokenExpired(token); - } - } - - $rootScope.isAuthenticated = false; - - function authenticate() { - $rootScope.isAuthenticated = true; - } - - function unauthenticate() { - $rootScope.isAuthenticated = false; - } - - function checkAuthOnRefresh() { - $rootScope.$on('$locationChangeStart', function () { - var token = invokeToken(config.tokenGetter); - if (token) { - if (!jwtHelper.isTokenExpired(token)) { - authenticate(); - } else { - $rootScope.$broadcast('tokenHasExpired', token); - } - } - }); - } - - function redirectWhenUnauthenticated() { - $rootScope.$on('unauthenticated', function () { - invokeRedirector(config.unauthenticatedRedirector); - unauthenticate(); - }); - } - - function verifyRoute(event, next) { - if (!next) { - return false; - } - - var routeData = (next.$$route) ? next.$$route : next.data; - - if (routeData && routeData.requiresLogin === true) { - var token = invokeToken(config.tokenGetter); - if (!token || jwtHelper.isTokenExpired(token)) { - event.preventDefault(); - invokeRedirector(config.unauthenticatedRedirector); - } - } - } - - var eventName = ($injector.has('$state')) ? '$stateChangeStart' : '$routeChangeStart'; - $rootScope.$on(eventName, verifyRoute); - - return { - authenticate: authenticate, - unauthenticate: unauthenticate, - getToken: function(){ return invokeToken(config.tokenGetter); }, - redirect: function() { return invokeRedirector(config.unauthenticatedRedirector); }, - checkAuthOnRefresh: checkAuthOnRefresh, - redirectWhenUnauthenticated: redirectWhenUnauthenticated, - isAuthenticated: isAuthenticated - } - }] - }); - -angular.module('angular-jwt.interceptor', []) - .provider('jwtInterceptor', function() { - - this.urlParam; - this.authHeader; - this.authPrefix; - this.whiteListedDomains; - this.tokenGetter; - - var config = this; - - this.$get = ["$q", "$injector", "$rootScope", "urlUtils", "jwtOptions", function($q, $injector, $rootScope, urlUtils, jwtOptions) { - - var options = angular.extend({}, jwtOptions.getConfig(), config); - - function isSafe (url) { - if (!urlUtils.isSameOrigin(url) && !options.whiteListedDomains.length) { - throw new Error('As of v0.1.0, requests to domains other than the application\'s origin must be white listed. Use jwtOptionsProvider.config({ whiteListedDomains: [] }); to whitelist.') - } - var hostname = urlUtils.urlResolve(url).hostname.toLowerCase(); - for (var i = 0; i < options.whiteListedDomains.length; i++) { - var domain = options.whiteListedDomains[i]; - var regexp = domain instanceof RegExp ? domain : new RegExp(domain, 'i'); - if (hostname.match(regexp)) { - return true; - } - } - - if (urlUtils.isSameOrigin(url)) { - return true; - } - - return false; - } - - return { - request: function (request) { - if (request.skipAuthorization || !isSafe(request.url)) { - return request; - } - - if (options.urlParam) { - request.params = request.params || {}; - // Already has the token in the url itself - if (request.params[options.urlParam]) { - return request; - } - } else { - request.headers = request.headers || {}; - // Already has an Authorization header - if (request.headers[options.authHeader]) { - return request; - } - } - - var tokenPromise = $q.when($injector.invoke(options.tokenGetter, this, { - options: request - })); - - return tokenPromise.then(function(token) { - if (token) { - if (options.urlParam) { - request.params[options.urlParam] = token; - } else { - request.headers[options.authHeader] = options.authPrefix + token; - } - } - return request; - }); - }, - responseError: function (response) { - // handle the case where the user is not authenticated - if (response.status === 401) { - $rootScope.$broadcast('unauthenticated', response); - } - return $q.reject(response); - } - }; - }] - }); - - angular.module('angular-jwt.jwt', []) - .service('jwtHelper', ["$window", function($window) { - - this.urlBase64Decode = function(str) { - var output = str.replace(/-/g, '+').replace(/_/g, '/'); - switch (output.length % 4) { - case 0: { break; } - case 2: { output += '=='; break; } - case 3: { output += '='; break; } - default: { - throw 'Illegal base64url string!'; - } - } - return $window.decodeURIComponent(escape($window.atob(output))); //polyfill https://github.com/davidchambers/Base64.js - }; - - - this.decodeToken = function(token) { - var parts = token.split('.'); - - if (parts.length !== 3) { - throw new Error('JWT must have 3 parts'); - } - - var decoded = this.urlBase64Decode(parts[1]); - if (!decoded) { - throw new Error('Cannot decode the token'); - } - - return angular.fromJson(decoded); - }; - - this.getTokenExpirationDate = function(token) { - var decoded = this.decodeToken(token); - - if(typeof decoded.exp === "undefined") { - return null; - } - - var d = new Date(0); // The 0 here is the key, which sets the date to the epoch - d.setUTCSeconds(decoded.exp); - - return d; - }; - - this.isTokenExpired = function(token, offsetSeconds) { - var d = this.getTokenExpirationDate(token); - offsetSeconds = offsetSeconds || 0; - if (d === null) { - return false; - } - - // Token expired? - return !(d.valueOf() > (new Date().valueOf() + (offsetSeconds * 1000))); - }; - }]); - -angular.module('angular-jwt.options', []) - .provider('jwtOptions', function() { - var globalConfig = {}; - this.config = function(value) { - globalConfig = value; - }; - this.$get = function() { - - var options = { - urlParam: null, - authHeader: 'Authorization', - authPrefix: 'Bearer ', - whiteListedDomains: [], - tokenGetter: function() { - return null; - }, - loginPath: '/', - unauthenticatedRedirectPath: '/', - unauthenticatedRedirector: ['$location', function($location) { - $location.path(this.unauthenticatedRedirectPath); - }] - }; - - function JwtOptions() { - var config = this.config = angular.extend({}, options, globalConfig); - } - - JwtOptions.prototype.getConfig = function() { - return this.config; - }; - - return new JwtOptions(); - } - }); - - /** - * The content from this file was directly lifted from Angular. It is - * unfortunately not a public API, so the best we can do is copy it. - * - * Angular References: - * https://github.com/angular/angular.js/issues/3299 - * https://github.com/angular/angular.js/blob/d077966ff1ac18262f4615ff1a533db24d4432a7/src/ng/urlUtils.js - */ - - angular.module('angular-jwt.interceptor') - .service('urlUtils', function () { - - // NOTE: The usage of window and document instead of $window and $document here is - // deliberate. This service depends on the specific behavior of anchor nodes created by the - // browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and - // cause us to break tests. In addition, when the browser resolves a URL for XHR, it - // doesn't know about mocked locations and resolves URLs to the real document - which is - // exactly the behavior needed here. There is little value is mocking these out for this - // service. - var urlParsingNode = document.createElement("a"); - var originUrl = urlResolve(window.location.href); - - /** - * - * Implementation Notes for non-IE browsers - * ---------------------------------------- - * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM, - * results both in the normalizing and parsing of the URL. Normalizing means that a relative - * URL will be resolved into an absolute URL in the context of the application document. - * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related - * properties are all populated to reflect the normalized URL. This approach has wide - * compatibility - Safari 1+, Mozilla 1+, Opera 7+,e etc. See - * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html - * - * Implementation Notes for IE - * --------------------------- - * IE <= 10 normalizes the URL when assigned to the anchor node similar to the other - * browsers. However, the parsed components will not be set if the URL assigned did not specify - * them. (e.g. if you assign a.href = "foo", then a.protocol, a.host, etc. will be empty.) We - * work around that by performing the parsing in a 2nd step by taking a previously normalized - * URL (e.g. by assigning to a.href) and assigning it a.href again. This correctly populates the - * properties such as protocol, hostname, port, etc. - * - * References: - * http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement - * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html - * http://url.spec.whatwg.org/#urlutils - * https://github.com/angular/angular.js/pull/2902 - * http://james.padolsey.com/javascript/parsing-urls-with-the-dom/ - * - * @kind function - * @param {string} url The URL to be parsed. - * @description Normalizes and parses a URL. - * @returns {object} Returns the normalized URL as a dictionary. - * - * | member name | Description | - * |---------------|----------------| - * | href | A normalized version of the provided URL if it was not an absolute URL | - * | protocol | The protocol including the trailing colon | - * | host | The host and port (if the port is non-default) of the normalizedUrl | - * | search | The search params, minus the question mark | - * | hash | The hash string, minus the hash symbol - * | hostname | The hostname - * | port | The port, without ":" - * | pathname | The pathname, beginning with "/" - * - */ - function urlResolve(url) { - var href = url; - - // Normalize before parse. Refer Implementation Notes on why this is - // done in two steps on IE. - urlParsingNode.setAttribute("href", href); - href = urlParsingNode.href; - urlParsingNode.setAttribute('href', href); - - // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils - return { - href: urlParsingNode.href, - protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', - host: urlParsingNode.host, - search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', - hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', - hostname: urlParsingNode.hostname, - port: urlParsingNode.port, - pathname: (urlParsingNode.pathname.charAt(0) === '/') - ? urlParsingNode.pathname - : '/' + urlParsingNode.pathname - }; - } - - /** - * Parse a request URL and determine whether this is a same-origin request as the application document. - * - * @param {string|object} requestUrl The url of the request as a string that will be resolved - * or a parsed URL object. - * @returns {boolean} Whether the request is for the same origin as the application document. - */ - function urlIsSameOrigin(requestUrl) { - var parsed = (angular.isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl; - return (parsed.protocol === originUrl.protocol && - parsed.host === originUrl.host); - } - - return { - urlResolve: urlResolve, - isSameOrigin: urlIsSameOrigin - }; - - }); - -}()); \ No newline at end of file diff --git a/stackle_app/app/vendor/angular-resource.js b/stackle_app/app/vendor/angular-resource.js deleted file mode 100644 index 41a6697..0000000 --- a/stackle_app/app/vendor/angular-resource.js +++ /dev/null @@ -1,858 +0,0 @@ -/** - * @license AngularJS v1.6.4 - * (c) 2010-2017 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window, angular) {'use strict'; - -var $resourceMinErr = angular.$$minErr('$resource'); - -// Helper functions and regex to lookup a dotted path on an object -// stopping at undefined/null. The path must be composed of ASCII -// identifiers (just like $parse) -var MEMBER_NAME_REGEX = /^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/; - -function isValidDottedPath(path) { - return (path != null && path !== '' && path !== 'hasOwnProperty' && - MEMBER_NAME_REGEX.test('.' + path)); -} - -function lookupDottedPath(obj, path) { - if (!isValidDottedPath(path)) { - throw $resourceMinErr('badmember', 'Dotted member path "@{0}" is invalid.', path); - } - var keys = path.split('.'); - for (var i = 0, ii = keys.length; i < ii && angular.isDefined(obj); i++) { - var key = keys[i]; - obj = (obj !== null) ? obj[key] : undefined; - } - return obj; -} - -/** - * Create a shallow copy of an object and clear other fields from the destination - */ -function shallowClearAndCopy(src, dst) { - dst = dst || {}; - - angular.forEach(dst, function(value, key) { - delete dst[key]; - }); - - for (var key in src) { - if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) { - dst[key] = src[key]; - } - } - - return dst; -} - -/** - * @ngdoc module - * @name ngResource - * @description - * - * # ngResource - * - * The `ngResource` module provides interaction support with RESTful services - * via the $resource service. - * - * - *
- * - * See {@link ngResource.$resourceProvider} and {@link ngResource.$resource} for usage. - */ - -/** - * @ngdoc provider - * @name $resourceProvider - * - * @description - * - * Use `$resourceProvider` to change the default behavior of the {@link ngResource.$resource} - * service. - * - * ## Dependencies - * Requires the {@link ngResource } module to be installed. - * - */ - -/** - * @ngdoc service - * @name $resource - * @requires $http - * @requires ng.$log - * @requires $q - * @requires ng.$timeout - * - * @description - * A factory which creates a resource object that lets you interact with - * [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources. - * - * The returned resource object has action methods which provide high-level behaviors without - * the need to interact with the low level {@link ng.$http $http} service. - * - * Requires the {@link ngResource `ngResource`} module to be installed. - * - * By default, trailing slashes will be stripped from the calculated URLs, - * which can pose problems with server backends that do not expect that - * behavior. This can be disabled by configuring the `$resourceProvider` like - * this: - * - * ```js - app.config(['$resourceProvider', function($resourceProvider) { - // Don't strip trailing slashes from calculated URLs - $resourceProvider.defaults.stripTrailingSlashes = false; - }]); - * ``` - * - * @param {string} url A parameterized URL template with parameters prefixed by `:` as in - * `/user/:username`. If you are using a URL with a port number (e.g. - * `http://example.com:8080/api`), it will be respected. - * - * If you are using a url with a suffix, just add the suffix, like this: - * `$resource('http://example.com/resource.json')` or `$resource('http://example.com/:id.json')` - * or even `$resource('http://example.com/resource/:resource_id.:format')` - * If the parameter before the suffix is empty, :resource_id in this case, then the `/.` will be - * collapsed down to a single `.`. If you need this sequence to appear and not collapse then you - * can escape it with `/\.`. - * - * @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in - * `actions` methods. If a parameter value is a function, it will be called every time - * a param value needs to be obtained for a request (unless the param was overridden). The function - * will be passed the current data value as an argument. - * - * Each key value in the parameter object is first bound to url template if present and then any - * excess keys are appended to the url search query after the `?`. - * - * Given a template `/path/:verb` and parameter `{verb:'greet', salutation:'Hello'}` results in - * URL `/path/greet?salutation=Hello`. - * - * If the parameter value is prefixed with `@`, then the value for that parameter will be - * extracted from the corresponding property on the `data` object (provided when calling actions - * with a request body). - * For example, if the `defaultParam` object is `{someParam: '@someProp'}` then the value of - * `someParam` will be `data.someProp`. - * Note that the parameter will be ignored, when calling a "GET" action method (i.e. an action - * method that does not accept a request body) - * - * @param {Object.=} actions Hash with declaration of custom actions that will be available - * in addition to the default set of resource actions (see below). If a custom action has the same - * key as a default action (e.g. `save`), then the default action will be *overwritten*, and not - * extended. - * - * The declaration should be created in the format of {@link ng.$http#usage $http.config}: - * - * {action1: {method:?, params:?, isArray:?, headers:?, ...}, - * action2: {method:?, params:?, isArray:?, headers:?, ...}, - * ...} - * - * Where: - * - * - **`action`** – {string} – The name of action. This name becomes the name of the method on - * your resource object. - * - **`method`** – {string} – Case insensitive HTTP method (e.g. `GET`, `POST`, `PUT`, - * `DELETE`, `JSONP`, etc). - * - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of - * the parameter value is a function, it will be called every time when a param value needs to - * be obtained for a request (unless the param was overridden). The function will be passed the - * current data value as an argument. - * - **`url`** – {string} – action specific `url` override. The url templating is supported just - * like for the resource-level urls. - * - **`isArray`** – {boolean=} – If true then the returned object for this action is an array, - * see `returns` section. - * - **`transformRequest`** – - * `{function(data, headersGetter)|Array.}` – - * transform function or an array of such functions. The transform function takes the http - * request body and headers and returns its transformed (typically serialized) version. - * By default, transformRequest will contain one function that checks if the request data is - * an object and serializes it using `angular.toJson`. To prevent this behavior, set - * `transformRequest` to an empty array: `transformRequest: []` - * - **`transformResponse`** – - * `{function(data, headersGetter, status)|Array.}` – - * transform function or an array of such functions. The transform function takes the http - * response body, headers and status and returns its transformed (typically deserialized) - * version. - * By default, transformResponse will contain one function that checks if the response looks - * like a JSON string and deserializes it using `angular.fromJson`. To prevent this behavior, - * set `transformResponse` to an empty array: `transformResponse: []` - * - **`cache`** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the - * GET request, otherwise if a cache instance built with - * {@link ng.$cacheFactory $cacheFactory} is supplied, this cache will be used for - * caching. - * - **`timeout`** – `{number}` – timeout in milliseconds.
- * **Note:** In contrast to {@link ng.$http#usage $http.config}, {@link ng.$q promises} are - * **not** supported in $resource, because the same value would be used for multiple requests. - * If you are looking for a way to cancel requests, you should use the `cancellable` option. - * - **`cancellable`** – `{boolean}` – if set to true, the request made by a "non-instance" call - * will be cancelled (if not already completed) by calling `$cancelRequest()` on the call's - * return value. Calling `$cancelRequest()` for a non-cancellable or an already - * completed/cancelled request will have no effect.
- * - **`withCredentials`** - `{boolean}` - whether to set the `withCredentials` flag on the - * XHR object. See - * [requests with credentials](https://developer.mozilla.org/en/http_access_control#section_5) - * for more information. - * - **`responseType`** - `{string}` - see - * [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType). - * - **`interceptor`** - `{Object=}` - The interceptor object has two optional methods - - * `response` and `responseError`. Both `response` and `responseError` interceptors get called - * with `http response` object. See {@link ng.$http $http interceptors}. - * - **`hasBody`** - `{boolean}` - allows to specify if a request body should be included or not. - * If not specified only POST, PUT and PATCH requests will have a body. - * - * @param {Object} options Hash with custom settings that should extend the - * default `$resourceProvider` behavior. The supported options are: - * - * - **`stripTrailingSlashes`** – {boolean} – If true then the trailing - * slashes from any calculated URL will be stripped. (Defaults to true.) - * - **`cancellable`** – {boolean} – If true, the request made by a "non-instance" call will be - * cancelled (if not already completed) by calling `$cancelRequest()` on the call's return value. - * This can be overwritten per action. (Defaults to false.) - * - * @returns {Object} A resource "class" object with methods for the default set of resource actions - * optionally extended with custom `actions`. The default set contains these actions: - * ```js - * { 'get': {method:'GET'}, - * 'save': {method:'POST'}, - * 'query': {method:'GET', isArray:true}, - * 'remove': {method:'DELETE'}, - * 'delete': {method:'DELETE'} }; - * ``` - * - * Calling these methods invoke an {@link ng.$http} with the specified http method, - * destination and parameters. When the data is returned from the server then the object is an - * instance of the resource class. The actions `save`, `remove` and `delete` are available on it - * as methods with the `$` prefix. This allows you to easily perform CRUD operations (create, - * read, update, delete) on server-side data like this: - * ```js - * var User = $resource('/user/:userId', {userId:'@id'}); - * var user = User.get({userId:123}, function() { - * user.abc = true; - * user.$save(); - * }); - * ``` - * - * It is important to realize that invoking a $resource object method immediately returns an - * empty reference (object or array depending on `isArray`). Once the data is returned from the - * server the existing reference is populated with the actual data. This is a useful trick since - * usually the resource is assigned to a model which is then rendered by the view. Having an empty - * object results in no rendering, once the data arrives from the server then the object is - * populated with the data and the view automatically re-renders itself showing the new data. This - * means that in most cases one never has to write a callback function for the action methods. - * - * The action methods on the class object or instance object can be invoked with the following - * parameters: - * - * - "class" actions without a body: `Resource.action([parameters], [success], [error])` - * - "class" actions with a body: `Resource.action([parameters], postData, [success], [error])` - * - instance actions: `instance.$action([parameters], [success], [error])` - * - * - * When calling instance methods, the instance itself is used as the request body (if the action - * should have a body). By default, only actions using `POST`, `PUT` or `PATCH` have request - * bodies, but you can use the `hasBody` configuration option to specify whether an action - * should have a body or not (regardless of its HTTP method). - * - * - * Success callback is called with (value (Object|Array), responseHeaders (Function), - * status (number), statusText (string)) arguments, where the value is the populated resource - * instance or collection object. The error callback is called with (httpResponse) argument. - * - * Class actions return empty instance (with additional properties below). - * Instance actions return promise of the action. - * - * The Resource instances and collections have these additional properties: - * - * - `$promise`: the {@link ng.$q promise} of the original server interaction that created this - * instance or collection. - * - * On success, the promise is resolved with the same resource instance or collection object, - * updated with data from server. This makes it easy to use in - * {@link ngRoute.$routeProvider resolve section of $routeProvider.when()} to defer view - * rendering until the resource(s) are loaded. - * - * On failure, the promise is rejected with the {@link ng.$http http response} object, without - * the `resource` property. - * - * If an interceptor object was provided, the promise will instead be resolved with the value - * returned by the interceptor. - * - * - `$resolved`: `true` after first server interaction is completed (either with success or - * rejection), `false` before that. Knowing if the Resource has been resolved is useful in - * data-binding. - * - * The Resource instances and collections have these additional methods: - * - * - `$cancelRequest`: If there is a cancellable, pending request related to the instance or - * collection, calling this method will abort the request. - * - * The Resource instances have these additional methods: - * - * - `toJSON`: It returns a simple object without any of the extra properties added as part of - * the Resource API. This object can be serialized through {@link angular.toJson} safely - * without attaching Angular-specific fields. Notice that `JSON.stringify` (and - * `angular.toJson`) automatically use this method when serializing a Resource instance - * (see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#toJSON%28%29_behavior)). - * - * @example - * - * # Credit card resource - * - * ```js - // Define CreditCard class - var CreditCard = $resource('/user/:userId/card/:cardId', - {userId:123, cardId:'@id'}, { - charge: {method:'POST', params:{charge:true}} - }); - - // We can retrieve a collection from the server - var cards = CreditCard.query(function() { - // GET: /user/123/card - // server returns: [ {id:456, number:'1234', name:'Smith'} ]; - - var card = cards[0]; - // each item is an instance of CreditCard - expect(card instanceof CreditCard).toEqual(true); - card.name = "J. Smith"; - // non GET methods are mapped onto the instances - card.$save(); - // POST: /user/123/card/456 {id:456, number:'1234', name:'J. Smith'} - // server returns: {id:456, number:'1234', name: 'J. Smith'}; - - // our custom method is mapped as well. - card.$charge({amount:9.99}); - // POST: /user/123/card/456?amount=9.99&charge=true {id:456, number:'1234', name:'J. Smith'} - }); - - // we can create an instance as well - var newCard = new CreditCard({number:'0123'}); - newCard.name = "Mike Smith"; - newCard.$save(); - // POST: /user/123/card {number:'0123', name:'Mike Smith'} - // server returns: {id:789, number:'0123', name: 'Mike Smith'}; - expect(newCard.id).toEqual(789); - * ``` - * - * The object returned from this function execution is a resource "class" which has "static" method - * for each action in the definition. - * - * Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and - * `headers`. - * - * @example - * - * # User resource - * - * When the data is returned from the server then the object is an instance of the resource type and - * all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD - * operations (create, read, update, delete) on server-side data. - - ```js - var User = $resource('/user/:userId', {userId:'@id'}); - User.get({userId:123}, function(user) { - user.abc = true; - user.$save(); - }); - ``` - * - * It's worth noting that the success callback for `get`, `query` and other methods gets passed - * in the response that came from the server as well as $http header getter function, so one - * could rewrite the above example and get access to http headers as: - * - ```js - var User = $resource('/user/:userId', {userId:'@id'}); - User.get({userId:123}, function(user, getResponseHeaders){ - user.abc = true; - user.$save(function(user, putResponseHeaders) { - //user => saved user object - //putResponseHeaders => $http header getter - }); - }); - ``` - * - * You can also access the raw `$http` promise via the `$promise` property on the object returned - * - ``` - var User = $resource('/user/:userId', {userId:'@id'}); - User.get({userId:123}) - .$promise.then(function(user) { - $scope.user = user; - }); - ``` - * - * @example - * - * # Creating a custom 'PUT' request - * - * In this example we create a custom method on our resource to make a PUT request - * ```js - * var app = angular.module('app', ['ngResource', 'ngRoute']); - * - * // Some APIs expect a PUT request in the format URL/object/ID - * // Here we are creating an 'update' method - * app.factory('Notes', ['$resource', function($resource) { - * return $resource('/notes/:id', null, - * { - * 'update': { method:'PUT' } - * }); - * }]); - * - * // In our controller we get the ID from the URL using ngRoute and $routeParams - * // We pass in $routeParams and our Notes factory along with $scope - * app.controller('NotesCtrl', ['$scope', '$routeParams', 'Notes', - function($scope, $routeParams, Notes) { - * // First get a note object from the factory - * var note = Notes.get({ id:$routeParams.id }); - * $id = note.id; - * - * // Now call update passing in the ID first then the object you are updating - * Notes.update({ id:$id }, note); - * - * // This will PUT /notes/ID with the note object in the request payload - * }]); - * ``` - * - * @example - * - * # Cancelling requests - * - * If an action's configuration specifies that it is cancellable, you can cancel the request related - * to an instance or collection (as long as it is a result of a "non-instance" call): - * - ```js - // ...defining the `Hotel` resource... - var Hotel = $resource('/api/hotel/:id', {id: '@id'}, { - // Let's make the `query()` method cancellable - query: {method: 'get', isArray: true, cancellable: true} - }); - - // ...somewhere in the PlanVacationController... - ... - this.onDestinationChanged = function onDestinationChanged(destination) { - // We don't care about any pending request for hotels - // in a different destination any more - this.availableHotels.$cancelRequest(); - - // Let's query for hotels in '' - // (calls: /api/hotel?location=) - this.availableHotels = Hotel.query({location: destination}); - }; - ``` - * - */ -angular.module('ngResource', ['ng']). - info({ angularVersion: '1.6.4' }). - provider('$resource', function ResourceProvider() { - var PROTOCOL_AND_IPV6_REGEX = /^https?:\/\/\[[^\]]*][^/]*/; - - var provider = this; - - /** - * @ngdoc property - * @name $resourceProvider#defaults - * @description - * Object containing default options used when creating `$resource` instances. - * - * The default values satisfy a wide range of usecases, but you may choose to overwrite any of - * them to further customize your instances. The available properties are: - * - * - **stripTrailingSlashes** – `{boolean}` – If true, then the trailing slashes from any - * calculated URL will be stripped.
- * (Defaults to true.) - * - **cancellable** – `{boolean}` – If true, the request made by a "non-instance" call will be - * cancelled (if not already completed) by calling `$cancelRequest()` on the call's return - * value. For more details, see {@link ngResource.$resource}. This can be overwritten per - * resource class or action.
- * (Defaults to false.) - * - **actions** - `{Object.}` - A hash with default actions declarations. Actions are - * high-level methods corresponding to RESTful actions/methods on resources. An action may - * specify what HTTP method to use, what URL to hit, if the return value will be a single - * object or a collection (array) of objects etc. For more details, see - * {@link ngResource.$resource}. The actions can also be enhanced or overwritten per resource - * class.
- * The default actions are: - * ```js - * { - * get: {method: 'GET'}, - * save: {method: 'POST'}, - * query: {method: 'GET', isArray: true}, - * remove: {method: 'DELETE'}, - * delete: {method: 'DELETE'} - * } - * ``` - * - * #### Example - * - * For example, you can specify a new `update` action that uses the `PUT` HTTP verb: - * - * ```js - * angular. - * module('myApp'). - * config(['$resourceProvider', function ($resourceProvider) { - * $resourceProvider.defaults.actions.update = { - * method: 'PUT' - * }; - * }); - * ``` - * - * Or you can even overwrite the whole `actions` list and specify your own: - * - * ```js - * angular. - * module('myApp'). - * config(['$resourceProvider', function ($resourceProvider) { - * $resourceProvider.defaults.actions = { - * create: {method: 'POST'}, - * get: {method: 'GET'}, - * getAll: {method: 'GET', isArray:true}, - * update: {method: 'PUT'}, - * delete: {method: 'DELETE'} - * }; - * }); - * ``` - * - */ - this.defaults = { - // Strip slashes by default - stripTrailingSlashes: true, - - // Make non-instance requests cancellable (via `$cancelRequest()`) - cancellable: false, - - // Default actions configuration - actions: { - 'get': {method: 'GET'}, - 'save': {method: 'POST'}, - 'query': {method: 'GET', isArray: true}, - 'remove': {method: 'DELETE'}, - 'delete': {method: 'DELETE'} - } - }; - - this.$get = ['$http', '$log', '$q', '$timeout', function($http, $log, $q, $timeout) { - - var noop = angular.noop, - forEach = angular.forEach, - extend = angular.extend, - copy = angular.copy, - isArray = angular.isArray, - isDefined = angular.isDefined, - isFunction = angular.isFunction, - isNumber = angular.isNumber, - encodeUriQuery = angular.$$encodeUriQuery, - encodeUriSegment = angular.$$encodeUriSegment; - - function Route(template, defaults) { - this.template = template; - this.defaults = extend({}, provider.defaults, defaults); - this.urlParams = {}; - } - - Route.prototype = { - setUrlParams: function(config, params, actionUrl) { - var self = this, - url = actionUrl || self.template, - val, - encodedVal, - protocolAndIpv6 = ''; - - var urlParams = self.urlParams = Object.create(null); - forEach(url.split(/\W/), function(param) { - if (param === 'hasOwnProperty') { - throw $resourceMinErr('badname', 'hasOwnProperty is not a valid parameter name.'); - } - if (!(new RegExp('^\\d+$').test(param)) && param && - (new RegExp('(^|[^\\\\]):' + param + '(\\W|$)').test(url))) { - urlParams[param] = { - isQueryParamValue: (new RegExp('\\?.*=:' + param + '(?:\\W|$)')).test(url) - }; - } - }); - url = url.replace(/\\:/g, ':'); - url = url.replace(PROTOCOL_AND_IPV6_REGEX, function(match) { - protocolAndIpv6 = match; - return ''; - }); - - params = params || {}; - forEach(self.urlParams, function(paramInfo, urlParam) { - val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam]; - if (isDefined(val) && val !== null) { - if (paramInfo.isQueryParamValue) { - encodedVal = encodeUriQuery(val, true); - } else { - encodedVal = encodeUriSegment(val); - } - url = url.replace(new RegExp(':' + urlParam + '(\\W|$)', 'g'), function(match, p1) { - return encodedVal + p1; - }); - } else { - url = url.replace(new RegExp('(/?):' + urlParam + '(\\W|$)', 'g'), function(match, - leadingSlashes, tail) { - if (tail.charAt(0) === '/') { - return tail; - } else { - return leadingSlashes + tail; - } - }); - } - }); - - // strip trailing slashes and set the url (unless this behavior is specifically disabled) - if (self.defaults.stripTrailingSlashes) { - url = url.replace(/\/+$/, '') || '/'; - } - - // Collapse `/.` if found in the last URL path segment before the query. - // E.g. `http://url.com/id/.format?q=x` becomes `http://url.com/id.format?q=x`. - url = url.replace(/\/\.(?=\w+($|\?))/, '.'); - // Replace escaped `/\.` with `/.`. - // (If `\.` comes from a param value, it will be encoded as `%5C.`.) - config.url = protocolAndIpv6 + url.replace(/\/(\\|%5C)\./, '/.'); - - - // set params - delegate param encoding to $http - forEach(params, function(value, key) { - if (!self.urlParams[key]) { - config.params = config.params || {}; - config.params[key] = value; - } - }); - } - }; - - - function resourceFactory(url, paramDefaults, actions, options) { - var route = new Route(url, options); - - actions = extend({}, provider.defaults.actions, actions); - - function extractParams(data, actionParams) { - var ids = {}; - actionParams = extend({}, paramDefaults, actionParams); - forEach(actionParams, function(value, key) { - if (isFunction(value)) { value = value(data); } - ids[key] = value && value.charAt && value.charAt(0) === '@' ? - lookupDottedPath(data, value.substr(1)) : value; - }); - return ids; - } - - function defaultResponseInterceptor(response) { - return response.resource; - } - - function Resource(value) { - shallowClearAndCopy(value || {}, this); - } - - Resource.prototype.toJSON = function() { - var data = extend({}, this); - delete data.$promise; - delete data.$resolved; - delete data.$cancelRequest; - return data; - }; - - forEach(actions, function(action, name) { - var hasBody = action.hasBody === true || (action.hasBody !== false && /^(POST|PUT|PATCH)$/i.test(action.method)); - var numericTimeout = action.timeout; - var cancellable = isDefined(action.cancellable) ? - action.cancellable : route.defaults.cancellable; - - if (numericTimeout && !isNumber(numericTimeout)) { - $log.debug('ngResource:\n' + - ' Only numeric values are allowed as `timeout`.\n' + - ' Promises are not supported in $resource, because the same value would ' + - 'be used for multiple requests. If you are looking for a way to cancel ' + - 'requests, you should use the `cancellable` option.'); - delete action.timeout; - numericTimeout = null; - } - - Resource[name] = function(a1, a2, a3, a4) { - var params = {}, data, success, error; - - switch (arguments.length) { - case 4: - error = a4; - success = a3; - // falls through - case 3: - case 2: - if (isFunction(a2)) { - if (isFunction(a1)) { - success = a1; - error = a2; - break; - } - - success = a2; - error = a3; - // falls through - } else { - params = a1; - data = a2; - success = a3; - break; - } - // falls through - case 1: - if (isFunction(a1)) success = a1; - else if (hasBody) data = a1; - else params = a1; - break; - case 0: break; - default: - throw $resourceMinErr('badargs', - 'Expected up to 4 arguments [params, data, success, error], got {0} arguments', - arguments.length); - } - - var isInstanceCall = this instanceof Resource; - var value = isInstanceCall ? data : (action.isArray ? [] : new Resource(data)); - var httpConfig = {}; - var responseInterceptor = action.interceptor && action.interceptor.response || - defaultResponseInterceptor; - var responseErrorInterceptor = action.interceptor && action.interceptor.responseError || - undefined; - var hasError = !!error; - var hasResponseErrorInterceptor = !!responseErrorInterceptor; - var timeoutDeferred; - var numericTimeoutPromise; - - forEach(action, function(value, key) { - switch (key) { - default: - httpConfig[key] = copy(value); - break; - case 'params': - case 'isArray': - case 'interceptor': - case 'cancellable': - break; - } - }); - - if (!isInstanceCall && cancellable) { - timeoutDeferred = $q.defer(); - httpConfig.timeout = timeoutDeferred.promise; - - if (numericTimeout) { - numericTimeoutPromise = $timeout(timeoutDeferred.resolve, numericTimeout); - } - } - - if (hasBody) httpConfig.data = data; - route.setUrlParams(httpConfig, - extend({}, extractParams(data, action.params || {}), params), - action.url); - - var promise = $http(httpConfig).then(function(response) { - var data = response.data; - - if (data) { - // Need to convert action.isArray to boolean in case it is undefined - if (isArray(data) !== (!!action.isArray)) { - throw $resourceMinErr('badcfg', - 'Error in resource configuration for action `{0}`. Expected response to ' + - 'contain an {1} but got an {2} (Request: {3} {4})', name, action.isArray ? 'array' : 'object', - isArray(data) ? 'array' : 'object', httpConfig.method, httpConfig.url); - } - if (action.isArray) { - value.length = 0; - forEach(data, function(item) { - if (typeof item === 'object') { - value.push(new Resource(item)); - } else { - // Valid JSON values may be string literals, and these should not be converted - // into objects. These items will not have access to the Resource prototype - // methods, but unfortunately there - value.push(item); - } - }); - } else { - var promise = value.$promise; // Save the promise - shallowClearAndCopy(data, value); - value.$promise = promise; // Restore the promise - } - } - response.resource = value; - - return response; - }); - - promise = promise['finally'](function() { - value.$resolved = true; - if (!isInstanceCall && cancellable) { - value.$cancelRequest = noop; - $timeout.cancel(numericTimeoutPromise); - timeoutDeferred = numericTimeoutPromise = httpConfig.timeout = null; - } - }); - - promise = promise.then( - function(response) { - var value = responseInterceptor(response); - (success || noop)(value, response.headers, response.status, response.statusText); - return value; - }, - (hasError || hasResponseErrorInterceptor) ? - function(response) { - if (hasError && !hasResponseErrorInterceptor) { - // Avoid `Possibly Unhandled Rejection` error, - // but still fulfill the returned promise with a rejection - promise.catch(noop); - } - if (hasError) error(response); - return hasResponseErrorInterceptor ? - responseErrorInterceptor(response) : - $q.reject(response); - } : - undefined); - - if (!isInstanceCall) { - // we are creating instance / collection - // - set the initial promise - // - return the instance / collection - value.$promise = promise; - value.$resolved = false; - if (cancellable) value.$cancelRequest = cancelRequest; - - return value; - } - - // instance call - return promise; - - function cancelRequest(value) { - promise.catch(noop); - timeoutDeferred.resolve(value); - } - }; - - - Resource.prototype['$' + name] = function(params, success, error) { - if (isFunction(params)) { - error = success; success = params; params = {}; - } - var result = Resource[name].call(this, params, this, success, error); - return result.$promise || result; - }; - }); - - Resource.bind = function(additionalParamDefaults) { - var extendedParamDefaults = extend({}, paramDefaults, additionalParamDefaults); - return resourceFactory(url, extendedParamDefaults, actions, options); - }; - - return Resource; - } - - return resourceFactory; - }]; - }); - - -})(window, window.angular); diff --git a/stackle_app/app/vendor/angular-route.js b/stackle_app/app/vendor/angular-route.js deleted file mode 100644 index 0fc3404..0000000 --- a/stackle_app/app/vendor/angular-route.js +++ /dev/null @@ -1,1229 +0,0 @@ -/** - * @license AngularJS v1.6.4 - * (c) 2010-2017 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window, angular) {'use strict'; - -/* global shallowCopy: true */ - -/** - * Creates a shallow copy of an object, an array or a primitive. - * - * Assumes that there are no proto properties for objects. - */ -function shallowCopy(src, dst) { - if (isArray(src)) { - dst = dst || []; - - for (var i = 0, ii = src.length; i < ii; i++) { - dst[i] = src[i]; - } - } else if (isObject(src)) { - dst = dst || {}; - - for (var key in src) { - if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) { - dst[key] = src[key]; - } - } - } - - return dst || src; -} - -/* global shallowCopy: false */ - -// `isArray` and `isObject` are necessary for `shallowCopy()` (included via `src/shallowCopy.js`). -// They are initialized inside the `$RouteProvider`, to ensure `window.angular` is available. -var isArray; -var isObject; -var isDefined; -var noop; - -/** - * @ngdoc module - * @name ngRoute - * @description - * - * # ngRoute - * - * The `ngRoute` module provides routing and deeplinking services and directives for angular apps. - * - * ## Example - * See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`. - * - * - *
- */ -/* global -ngRouteModule */ -var ngRouteModule = angular. - module('ngRoute', []). - info({ angularVersion: '1.6.4' }). - provider('$route', $RouteProvider). - // Ensure `$route` will be instantiated in time to capture the initial `$locationChangeSuccess` - // event (unless explicitly disabled). This is necessary in case `ngView` is included in an - // asynchronously loaded template. - run(instantiateRoute); -var $routeMinErr = angular.$$minErr('ngRoute'); -var isEagerInstantiationEnabled; - - -/** - * @ngdoc provider - * @name $routeProvider - * @this - * - * @description - * - * Used for configuring routes. - * - * ## Example - * See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`. - * - * ## Dependencies - * Requires the {@link ngRoute `ngRoute`} module to be installed. - */ -function $RouteProvider() { - isArray = angular.isArray; - isObject = angular.isObject; - isDefined = angular.isDefined; - noop = angular.noop; - - function inherit(parent, extra) { - return angular.extend(Object.create(parent), extra); - } - - var routes = {}; - - /** - * @ngdoc method - * @name $routeProvider#when - * - * @param {string} path Route path (matched against `$location.path`). If `$location.path` - * contains redundant trailing slash or is missing one, the route will still match and the - * `$location.path` will be updated to add or drop the trailing slash to exactly match the - * route definition. - * - * * `path` can contain named groups starting with a colon: e.g. `:name`. All characters up - * to the next slash are matched and stored in `$routeParams` under the given `name` - * when the route matches. - * * `path` can contain named groups starting with a colon and ending with a star: - * e.g.`:name*`. All characters are eagerly stored in `$routeParams` under the given `name` - * when the route matches. - * * `path` can contain optional named groups with a question mark: e.g.`:name?`. - * - * For example, routes like `/color/:color/largecode/:largecode*\/edit` will match - * `/color/brown/largecode/code/with/slashes/edit` and extract: - * - * * `color: brown` - * * `largecode: code/with/slashes`. - * - * - * @param {Object} route Mapping information to be assigned to `$route.current` on route - * match. - * - * Object properties: - * - * - `controller` – `{(string|Function)=}` – Controller fn that should be associated with - * newly created scope or the name of a {@link angular.Module#controller registered - * controller} if passed as a string. - * - `controllerAs` – `{string=}` – An identifier name for a reference to the controller. - * If present, the controller will be published to scope under the `controllerAs` name. - * - `template` – `{(string|Function)=}` – html template as a string or a function that - * returns an html template as a string which should be used by {@link - * ngRoute.directive:ngView ngView} or {@link ng.directive:ngInclude ngInclude} directives. - * This property takes precedence over `templateUrl`. - * - * If `template` is a function, it will be called with the following parameters: - * - * - `{Array.}` - route parameters extracted from the current - * `$location.path()` by applying the current route - * - * One of `template` or `templateUrl` is required. - * - * - `templateUrl` – `{(string|Function)=}` – path or function that returns a path to an html - * template that should be used by {@link ngRoute.directive:ngView ngView}. - * - * If `templateUrl` is a function, it will be called with the following parameters: - * - * - `{Array.}` - route parameters extracted from the current - * `$location.path()` by applying the current route - * - * One of `templateUrl` or `template` is required. - * - * - `resolve` - `{Object.=}` - An optional map of dependencies which should - * be injected into the controller. If any of these dependencies are promises, the router - * will wait for them all to be resolved or one to be rejected before the controller is - * instantiated. - * If all the promises are resolved successfully, the values of the resolved promises are - * injected and {@link ngRoute.$route#$routeChangeSuccess $routeChangeSuccess} event is - * fired. If any of the promises are rejected the - * {@link ngRoute.$route#$routeChangeError $routeChangeError} event is fired. - * For easier access to the resolved dependencies from the template, the `resolve` map will - * be available on the scope of the route, under `$resolve` (by default) or a custom name - * specified by the `resolveAs` property (see below). This can be particularly useful, when - * working with {@link angular.Module#component components} as route templates.
- *
- * **Note:** If your scope already contains a property with this name, it will be hidden - * or overwritten. Make sure, you specify an appropriate name for this property, that - * does not collide with other properties on the scope. - *
- * The map object is: - * - * - `key` – `{string}`: a name of a dependency to be injected into the controller. - * - `factory` - `{string|Function}`: If `string` then it is an alias for a service. - * Otherwise if function, then it is {@link auto.$injector#invoke injected} - * and the return value is treated as the dependency. If the result is a promise, it is - * resolved before its value is injected into the controller. Be aware that - * `ngRoute.$routeParams` will still refer to the previous route within these resolve - * functions. Use `$route.current.params` to access the new route parameters, instead. - * - * - `resolveAs` - `{string=}` - The name under which the `resolve` map will be available on - * the scope of the route. If omitted, defaults to `$resolve`. - * - * - `redirectTo` – `{(string|Function)=}` – value to update - * {@link ng.$location $location} path with and trigger route redirection. - * - * If `redirectTo` is a function, it will be called with the following parameters: - * - * - `{Object.}` - route parameters extracted from the current - * `$location.path()` by applying the current route templateUrl. - * - `{string}` - current `$location.path()` - * - `{Object}` - current `$location.search()` - * - * The custom `redirectTo` function is expected to return a string which will be used - * to update `$location.url()`. If the function throws an error, no further processing will - * take place and the {@link ngRoute.$route#$routeChangeError $routeChangeError} event will - * be fired. - * - * Routes that specify `redirectTo` will not have their controllers, template functions - * or resolves called, the `$location` will be changed to the redirect url and route - * processing will stop. The exception to this is if the `redirectTo` is a function that - * returns `undefined`. In this case the route transition occurs as though there was no - * redirection. - * - * - `resolveRedirectTo` – `{Function=}` – a function that will (eventually) return the value - * to update {@link ng.$location $location} URL with and trigger route redirection. In - * contrast to `redirectTo`, dependencies can be injected into `resolveRedirectTo` and the - * return value can be either a string or a promise that will be resolved to a string. - * - * Similar to `redirectTo`, if the return value is `undefined` (or a promise that gets - * resolved to `undefined`), no redirection takes place and the route transition occurs as - * though there was no redirection. - * - * If the function throws an error or the returned promise gets rejected, no further - * processing will take place and the - * {@link ngRoute.$route#$routeChangeError $routeChangeError} event will be fired. - * - * `redirectTo` takes precedence over `resolveRedirectTo`, so specifying both on the same - * route definition, will cause the latter to be ignored. - * - * - `[reloadOnSearch=true]` - `{boolean=}` - reload route when only `$location.search()` - * or `$location.hash()` changes. - * - * If the option is set to `false` and url in the browser changes, then - * `$routeUpdate` event is broadcasted on the root scope. - * - * - `[caseInsensitiveMatch=false]` - `{boolean=}` - match routes without being case sensitive - * - * If the option is set to `true`, then the particular route can be matched without being - * case sensitive - * - * @returns {Object} self - * - * @description - * Adds a new route definition to the `$route` service. - */ - this.when = function(path, route) { - //copy original route object to preserve params inherited from proto chain - var routeCopy = shallowCopy(route); - if (angular.isUndefined(routeCopy.reloadOnSearch)) { - routeCopy.reloadOnSearch = true; - } - if (angular.isUndefined(routeCopy.caseInsensitiveMatch)) { - routeCopy.caseInsensitiveMatch = this.caseInsensitiveMatch; - } - routes[path] = angular.extend( - routeCopy, - path && pathRegExp(path, routeCopy) - ); - - // create redirection for trailing slashes - if (path) { - var redirectPath = (path[path.length - 1] === '/') - ? path.substr(0, path.length - 1) - : path + '/'; - - routes[redirectPath] = angular.extend( - {redirectTo: path}, - pathRegExp(redirectPath, routeCopy) - ); - } - - return this; - }; - - /** - * @ngdoc property - * @name $routeProvider#caseInsensitiveMatch - * @description - * - * A boolean property indicating if routes defined - * using this provider should be matched using a case insensitive - * algorithm. Defaults to `false`. - */ - this.caseInsensitiveMatch = false; - - /** - * @param path {string} path - * @param opts {Object} options - * @return {?Object} - * - * @description - * Normalizes the given path, returning a regular expression - * and the original path. - * - * Inspired by pathRexp in visionmedia/express/lib/utils.js. - */ - function pathRegExp(path, opts) { - var insensitive = opts.caseInsensitiveMatch, - ret = { - originalPath: path, - regexp: path - }, - keys = ret.keys = []; - - path = path - .replace(/([().])/g, '\\$1') - .replace(/(\/)?:(\w+)(\*\?|[?*])?/g, function(_, slash, key, option) { - var optional = (option === '?' || option === '*?') ? '?' : null; - var star = (option === '*' || option === '*?') ? '*' : null; - keys.push({ name: key, optional: !!optional }); - slash = slash || ''; - return '' - + (optional ? '' : slash) - + '(?:' - + (optional ? slash : '') - + (star && '(.+?)' || '([^/]+)') - + (optional || '') - + ')' - + (optional || ''); - }) - .replace(/([/$*])/g, '\\$1'); - - ret.regexp = new RegExp('^' + path + '$', insensitive ? 'i' : ''); - return ret; - } - - /** - * @ngdoc method - * @name $routeProvider#otherwise - * - * @description - * Sets route definition that will be used on route change when no other route definition - * is matched. - * - * @param {Object|string} params Mapping information to be assigned to `$route.current`. - * If called with a string, the value maps to `redirectTo`. - * @returns {Object} self - */ - this.otherwise = function(params) { - if (typeof params === 'string') { - params = {redirectTo: params}; - } - this.when(null, params); - return this; - }; - - /** - * @ngdoc method - * @name $routeProvider#eagerInstantiationEnabled - * @kind function - * - * @description - * Call this method as a setter to enable/disable eager instantiation of the - * {@link ngRoute.$route $route} service upon application bootstrap. You can also call it as a - * getter (i.e. without any arguments) to get the current value of the - * `eagerInstantiationEnabled` flag. - * - * Instantiating `$route` early is necessary for capturing the initial - * {@link ng.$location#$locationChangeStart $locationChangeStart} event and navigating to the - * appropriate route. Usually, `$route` is instantiated in time by the - * {@link ngRoute.ngView ngView} directive. Yet, in cases where `ngView` is included in an - * asynchronously loaded template (e.g. in another directive's template), the directive factory - * might not be called soon enough for `$route` to be instantiated _before_ the initial - * `$locationChangeSuccess` event is fired. Eager instantiation ensures that `$route` is always - * instantiated in time, regardless of when `ngView` will be loaded. - * - * The default value is true. - * - * **Note**:
- * You may want to disable the default behavior when unit-testing modules that depend on - * `ngRoute`, in order to avoid an unexpected request for the default route's template. - * - * @param {boolean=} enabled - If provided, update the internal `eagerInstantiationEnabled` flag. - * - * @returns {*} The current value of the `eagerInstantiationEnabled` flag if used as a getter or - * itself (for chaining) if used as a setter. - */ - isEagerInstantiationEnabled = true; - this.eagerInstantiationEnabled = function eagerInstantiationEnabled(enabled) { - if (isDefined(enabled)) { - isEagerInstantiationEnabled = enabled; - return this; - } - - return isEagerInstantiationEnabled; - }; - - - this.$get = ['$rootScope', - '$location', - '$routeParams', - '$q', - '$injector', - '$templateRequest', - '$sce', - '$browser', - function($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce, $browser) { - - /** - * @ngdoc service - * @name $route - * @requires $location - * @requires $routeParams - * - * @property {Object} current Reference to the current route definition. - * The route definition contains: - * - * - `controller`: The controller constructor as defined in the route definition. - * - `locals`: A map of locals which is used by {@link ng.$controller $controller} service for - * controller instantiation. The `locals` contain - * the resolved values of the `resolve` map. Additionally the `locals` also contain: - * - * - `$scope` - The current route scope. - * - `$template` - The current route template HTML. - * - * The `locals` will be assigned to the route scope's `$resolve` property. You can override - * the property name, using `resolveAs` in the route definition. See - * {@link ngRoute.$routeProvider $routeProvider} for more info. - * - * @property {Object} routes Object with all route configuration Objects as its properties. - * - * @description - * `$route` is used for deep-linking URLs to controllers and views (HTML partials). - * It watches `$location.url()` and tries to map the path to an existing route definition. - * - * Requires the {@link ngRoute `ngRoute`} module to be installed. - * - * You can define routes through {@link ngRoute.$routeProvider $routeProvider}'s API. - * - * The `$route` service is typically used in conjunction with the - * {@link ngRoute.directive:ngView `ngView`} directive and the - * {@link ngRoute.$routeParams `$routeParams`} service. - * - * @example - * This example shows how changing the URL hash causes the `$route` to match a route against the - * URL, and the `ngView` pulls in the partial. - * - * - * - *
- * Choose: - * Moby | - * Moby: Ch1 | - * Gatsby | - * Gatsby: Ch4 | - * Scarlet Letter
- * - *
- * - *
- * - *
$location.path() = {{$location.path()}}
- *
$route.current.templateUrl = {{$route.current.templateUrl}}
- *
$route.current.params = {{$route.current.params}}
- *
$route.current.scope.name = {{$route.current.scope.name}}
- *
$routeParams = {{$routeParams}}
- *
- *
- * - * - * controller: {{name}}
- * Book Id: {{params.bookId}}
- *
- * - * - * controller: {{name}}
- * Book Id: {{params.bookId}}
- * Chapter Id: {{params.chapterId}} - *
- * - * - * angular.module('ngRouteExample', ['ngRoute']) - * - * .controller('MainController', function($scope, $route, $routeParams, $location) { - * $scope.$route = $route; - * $scope.$location = $location; - * $scope.$routeParams = $routeParams; - * }) - * - * .controller('BookController', function($scope, $routeParams) { - * $scope.name = 'BookController'; - * $scope.params = $routeParams; - * }) - * - * .controller('ChapterController', function($scope, $routeParams) { - * $scope.name = 'ChapterController'; - * $scope.params = $routeParams; - * }) - * - * .config(function($routeProvider, $locationProvider) { - * $routeProvider - * .when('/Book/:bookId', { - * templateUrl: 'book.html', - * controller: 'BookController', - * resolve: { - * // I will cause a 1 second delay - * delay: function($q, $timeout) { - * var delay = $q.defer(); - * $timeout(delay.resolve, 1000); - * return delay.promise; - * } - * } - * }) - * .when('/Book/:bookId/ch/:chapterId', { - * templateUrl: 'chapter.html', - * controller: 'ChapterController' - * }); - * - * // configure html5 to get links working on jsfiddle - * $locationProvider.html5Mode(true); - * }); - * - * - * - * - * it('should load and compile correct template', function() { - * element(by.linkText('Moby: Ch1')).click(); - * var content = element(by.css('[ng-view]')).getText(); - * expect(content).toMatch(/controller: ChapterController/); - * expect(content).toMatch(/Book Id: Moby/); - * expect(content).toMatch(/Chapter Id: 1/); - * - * element(by.partialLinkText('Scarlet')).click(); - * - * content = element(by.css('[ng-view]')).getText(); - * expect(content).toMatch(/controller: BookController/); - * expect(content).toMatch(/Book Id: Scarlet/); - * }); - * - *
- */ - - /** - * @ngdoc event - * @name $route#$routeChangeStart - * @eventType broadcast on root scope - * @description - * Broadcasted before a route change. At this point the route services starts - * resolving all of the dependencies needed for the route change to occur. - * Typically this involves fetching the view template as well as any dependencies - * defined in `resolve` route property. Once all of the dependencies are resolved - * `$routeChangeSuccess` is fired. - * - * The route change (and the `$location` change that triggered it) can be prevented - * by calling `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} - * for more details about event object. - * - * @param {Object} angularEvent Synthetic event object. - * @param {Route} next Future route information. - * @param {Route} current Current route information. - */ - - /** - * @ngdoc event - * @name $route#$routeChangeSuccess - * @eventType broadcast on root scope - * @description - * Broadcasted after a route change has happened successfully. - * The `resolve` dependencies are now available in the `current.locals` property. - * - * {@link ngRoute.directive:ngView ngView} listens for the directive - * to instantiate the controller and render the view. - * - * @param {Object} angularEvent Synthetic event object. - * @param {Route} current Current route information. - * @param {Route|Undefined} previous Previous route information, or undefined if current is - * first route entered. - */ - - /** - * @ngdoc event - * @name $route#$routeChangeError - * @eventType broadcast on root scope - * @description - * Broadcasted if a redirection function fails or any redirection or resolve promises are - * rejected. - * - * @param {Object} angularEvent Synthetic event object - * @param {Route} current Current route information. - * @param {Route} previous Previous route information. - * @param {Route} rejection The thrown error or the rejection reason of the promise. Usually - * the rejection reason is the error that caused the promise to get rejected. - */ - - /** - * @ngdoc event - * @name $route#$routeUpdate - * @eventType broadcast on root scope - * @description - * The `reloadOnSearch` property has been set to false, and we are reusing the same - * instance of the Controller. - * - * @param {Object} angularEvent Synthetic event object - * @param {Route} current Current/previous route information. - */ - - var forceReload = false, - preparedRoute, - preparedRouteIsUpdateOnly, - $route = { - routes: routes, - - /** - * @ngdoc method - * @name $route#reload - * - * @description - * Causes `$route` service to reload the current route even if - * {@link ng.$location $location} hasn't changed. - * - * As a result of that, {@link ngRoute.directive:ngView ngView} - * creates new scope and reinstantiates the controller. - */ - reload: function() { - forceReload = true; - - var fakeLocationEvent = { - defaultPrevented: false, - preventDefault: function fakePreventDefault() { - this.defaultPrevented = true; - forceReload = false; - } - }; - - $rootScope.$evalAsync(function() { - prepareRoute(fakeLocationEvent); - if (!fakeLocationEvent.defaultPrevented) commitRoute(); - }); - }, - - /** - * @ngdoc method - * @name $route#updateParams - * - * @description - * Causes `$route` service to update the current URL, replacing - * current route parameters with those specified in `newParams`. - * Provided property names that match the route's path segment - * definitions will be interpolated into the location's path, while - * remaining properties will be treated as query params. - * - * @param {!Object} newParams mapping of URL parameter names to values - */ - updateParams: function(newParams) { - if (this.current && this.current.$$route) { - newParams = angular.extend({}, this.current.params, newParams); - $location.path(interpolate(this.current.$$route.originalPath, newParams)); - // interpolate modifies newParams, only query params are left - $location.search(newParams); - } else { - throw $routeMinErr('norout', 'Tried updating route when with no current route'); - } - } - }; - - $rootScope.$on('$locationChangeStart', prepareRoute); - $rootScope.$on('$locationChangeSuccess', commitRoute); - - return $route; - - ///////////////////////////////////////////////////// - - /** - * @param on {string} current url - * @param route {Object} route regexp to match the url against - * @return {?Object} - * - * @description - * Check if the route matches the current url. - * - * Inspired by match in - * visionmedia/express/lib/router/router.js. - */ - function switchRouteMatcher(on, route) { - var keys = route.keys, - params = {}; - - if (!route.regexp) return null; - - var m = route.regexp.exec(on); - if (!m) return null; - - for (var i = 1, len = m.length; i < len; ++i) { - var key = keys[i - 1]; - - var val = m[i]; - - if (key && val) { - params[key.name] = val; - } - } - return params; - } - - function prepareRoute($locationEvent) { - var lastRoute = $route.current; - - preparedRoute = parseRoute(); - preparedRouteIsUpdateOnly = preparedRoute && lastRoute && preparedRoute.$$route === lastRoute.$$route - && angular.equals(preparedRoute.pathParams, lastRoute.pathParams) - && !preparedRoute.reloadOnSearch && !forceReload; - - if (!preparedRouteIsUpdateOnly && (lastRoute || preparedRoute)) { - if ($rootScope.$broadcast('$routeChangeStart', preparedRoute, lastRoute).defaultPrevented) { - if ($locationEvent) { - $locationEvent.preventDefault(); - } - } - } - } - - function commitRoute() { - var lastRoute = $route.current; - var nextRoute = preparedRoute; - - if (preparedRouteIsUpdateOnly) { - lastRoute.params = nextRoute.params; - angular.copy(lastRoute.params, $routeParams); - $rootScope.$broadcast('$routeUpdate', lastRoute); - } else if (nextRoute || lastRoute) { - forceReload = false; - $route.current = nextRoute; - - var nextRoutePromise = $q.resolve(nextRoute); - - $browser.$$incOutstandingRequestCount(); - - nextRoutePromise. - then(getRedirectionData). - then(handlePossibleRedirection). - then(function(keepProcessingRoute) { - return keepProcessingRoute && nextRoutePromise. - then(resolveLocals). - then(function(locals) { - // after route change - if (nextRoute === $route.current) { - if (nextRoute) { - nextRoute.locals = locals; - angular.copy(nextRoute.params, $routeParams); - } - $rootScope.$broadcast('$routeChangeSuccess', nextRoute, lastRoute); - } - }); - }).catch(function(error) { - if (nextRoute === $route.current) { - $rootScope.$broadcast('$routeChangeError', nextRoute, lastRoute, error); - } - }).finally(function() { - // Because `commitRoute()` is called from a `$rootScope.$evalAsync` block (see - // `$locationWatch`), this `$$completeOutstandingRequest()` call will not cause - // `outstandingRequestCount` to hit zero. This is important in case we are redirecting - // to a new route which also requires some asynchronous work. - - $browser.$$completeOutstandingRequest(noop); - }); - } - } - - function getRedirectionData(route) { - var data = { - route: route, - hasRedirection: false - }; - - if (route) { - if (route.redirectTo) { - if (angular.isString(route.redirectTo)) { - data.path = interpolate(route.redirectTo, route.params); - data.search = route.params; - data.hasRedirection = true; - } else { - var oldPath = $location.path(); - var oldSearch = $location.search(); - var newUrl = route.redirectTo(route.pathParams, oldPath, oldSearch); - - if (angular.isDefined(newUrl)) { - data.url = newUrl; - data.hasRedirection = true; - } - } - } else if (route.resolveRedirectTo) { - return $q. - resolve($injector.invoke(route.resolveRedirectTo)). - then(function(newUrl) { - if (angular.isDefined(newUrl)) { - data.url = newUrl; - data.hasRedirection = true; - } - - return data; - }); - } - } - - return data; - } - - function handlePossibleRedirection(data) { - var keepProcessingRoute = true; - - if (data.route !== $route.current) { - keepProcessingRoute = false; - } else if (data.hasRedirection) { - var oldUrl = $location.url(); - var newUrl = data.url; - - if (newUrl) { - $location. - url(newUrl). - replace(); - } else { - newUrl = $location. - path(data.path). - search(data.search). - replace(). - url(); - } - - if (newUrl !== oldUrl) { - // Exit out and don't process current next value, - // wait for next location change from redirect - keepProcessingRoute = false; - } - } - - return keepProcessingRoute; - } - - function resolveLocals(route) { - if (route) { - var locals = angular.extend({}, route.resolve); - angular.forEach(locals, function(value, key) { - locals[key] = angular.isString(value) ? - $injector.get(value) : - $injector.invoke(value, null, null, key); - }); - var template = getTemplateFor(route); - if (angular.isDefined(template)) { - locals['$template'] = template; - } - return $q.all(locals); - } - } - - function getTemplateFor(route) { - var template, templateUrl; - if (angular.isDefined(template = route.template)) { - if (angular.isFunction(template)) { - template = template(route.params); - } - } else if (angular.isDefined(templateUrl = route.templateUrl)) { - if (angular.isFunction(templateUrl)) { - templateUrl = templateUrl(route.params); - } - if (angular.isDefined(templateUrl)) { - route.loadedTemplateUrl = $sce.valueOf(templateUrl); - template = $templateRequest(templateUrl); - } - } - return template; - } - - /** - * @returns {Object} the current active route, by matching it against the URL - */ - function parseRoute() { - // Match a route - var params, match; - angular.forEach(routes, function(route, path) { - if (!match && (params = switchRouteMatcher($location.path(), route))) { - match = inherit(route, { - params: angular.extend({}, $location.search(), params), - pathParams: params}); - match.$$route = route; - } - }); - // No route matched; fallback to "otherwise" route - return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}}); - } - - /** - * @returns {string} interpolation of the redirect path with the parameters - */ - function interpolate(string, params) { - var result = []; - angular.forEach((string || '').split(':'), function(segment, i) { - if (i === 0) { - result.push(segment); - } else { - var segmentMatch = segment.match(/(\w+)(?:[?*])?(.*)/); - var key = segmentMatch[1]; - result.push(params[key]); - result.push(segmentMatch[2] || ''); - delete params[key]; - } - }); - return result.join(''); - } - }]; -} - -instantiateRoute.$inject = ['$injector']; -function instantiateRoute($injector) { - if (isEagerInstantiationEnabled) { - // Instantiate `$route` - $injector.get('$route'); - } -} - -ngRouteModule.provider('$routeParams', $RouteParamsProvider); - - -/** - * @ngdoc service - * @name $routeParams - * @requires $route - * @this - * - * @description - * The `$routeParams` service allows you to retrieve the current set of route parameters. - * - * Requires the {@link ngRoute `ngRoute`} module to be installed. - * - * The route parameters are a combination of {@link ng.$location `$location`}'s - * {@link ng.$location#search `search()`} and {@link ng.$location#path `path()`}. - * The `path` parameters are extracted when the {@link ngRoute.$route `$route`} path is matched. - * - * In case of parameter name collision, `path` params take precedence over `search` params. - * - * The service guarantees that the identity of the `$routeParams` object will remain unchanged - * (but its properties will likely change) even when a route change occurs. - * - * Note that the `$routeParams` are only updated *after* a route change completes successfully. - * This means that you cannot rely on `$routeParams` being correct in route resolve functions. - * Instead you can use `$route.current.params` to access the new route's parameters. - * - * @example - * ```js - * // Given: - * // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby - * // Route: /Chapter/:chapterId/Section/:sectionId - * // - * // Then - * $routeParams ==> {chapterId:'1', sectionId:'2', search:'moby'} - * ``` - */ -function $RouteParamsProvider() { - this.$get = function() { return {}; }; -} - -ngRouteModule.directive('ngView', ngViewFactory); -ngRouteModule.directive('ngView', ngViewFillContentFactory); - - -/** - * @ngdoc directive - * @name ngView - * @restrict ECA - * - * @description - * # Overview - * `ngView` is a directive that complements the {@link ngRoute.$route $route} service by - * including the rendered template of the current route into the main layout (`index.html`) file. - * Every time the current route changes, the included view changes with it according to the - * configuration of the `$route` service. - * - * Requires the {@link ngRoute `ngRoute`} module to be installed. - * - * @animations - * | Animation | Occurs | - * |----------------------------------|-------------------------------------| - * | {@link ng.$animate#enter enter} | when the new element is inserted to the DOM | - * | {@link ng.$animate#leave leave} | when the old element is removed from to the DOM | - * - * The enter and leave animation occur concurrently. - * - * @scope - * @priority 400 - * @param {string=} onload Expression to evaluate whenever the view updates. - * - * @param {string=} autoscroll Whether `ngView` should call {@link ng.$anchorScroll - * $anchorScroll} to scroll the viewport after the view is updated. - * - * - If the attribute is not set, disable scrolling. - * - If the attribute is set without value, enable scrolling. - * - Otherwise enable scrolling only if the `autoscroll` attribute value evaluated - * as an expression yields a truthy value. - * @example - - -
- Choose: - Moby | - Moby: Ch1 | - Gatsby | - Gatsby: Ch4 | - Scarlet Letter
- -
-
-
-
- -
$location.path() = {{main.$location.path()}}
-
$route.current.templateUrl = {{main.$route.current.templateUrl}}
-
$route.current.params = {{main.$route.current.params}}
-
$routeParams = {{main.$routeParams}}
-
-
- - -
- controller: {{book.name}}
- Book Id: {{book.params.bookId}}
-
-
- - -
- controller: {{chapter.name}}
- Book Id: {{chapter.params.bookId}}
- Chapter Id: {{chapter.params.chapterId}} -
-
- - - .view-animate-container { - position:relative; - height:100px!important; - background:white; - border:1px solid black; - height:40px; - overflow:hidden; - } - - .view-animate { - padding:10px; - } - - .view-animate.ng-enter, .view-animate.ng-leave { - transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s; - - display:block; - width:100%; - border-left:1px solid black; - - position:absolute; - top:0; - left:0; - right:0; - bottom:0; - padding:10px; - } - - .view-animate.ng-enter { - left:100%; - } - .view-animate.ng-enter.ng-enter-active { - left:0; - } - .view-animate.ng-leave.ng-leave-active { - left:-100%; - } - - - - angular.module('ngViewExample', ['ngRoute', 'ngAnimate']) - .config(['$routeProvider', '$locationProvider', - function($routeProvider, $locationProvider) { - $routeProvider - .when('/Book/:bookId', { - templateUrl: 'book.html', - controller: 'BookCtrl', - controllerAs: 'book' - }) - .when('/Book/:bookId/ch/:chapterId', { - templateUrl: 'chapter.html', - controller: 'ChapterCtrl', - controllerAs: 'chapter' - }); - - $locationProvider.html5Mode(true); - }]) - .controller('MainCtrl', ['$route', '$routeParams', '$location', - function MainCtrl($route, $routeParams, $location) { - this.$route = $route; - this.$location = $location; - this.$routeParams = $routeParams; - }]) - .controller('BookCtrl', ['$routeParams', function BookCtrl($routeParams) { - this.name = 'BookCtrl'; - this.params = $routeParams; - }]) - .controller('ChapterCtrl', ['$routeParams', function ChapterCtrl($routeParams) { - this.name = 'ChapterCtrl'; - this.params = $routeParams; - }]); - - - - - it('should load and compile correct template', function() { - element(by.linkText('Moby: Ch1')).click(); - var content = element(by.css('[ng-view]')).getText(); - expect(content).toMatch(/controller: ChapterCtrl/); - expect(content).toMatch(/Book Id: Moby/); - expect(content).toMatch(/Chapter Id: 1/); - - element(by.partialLinkText('Scarlet')).click(); - - content = element(by.css('[ng-view]')).getText(); - expect(content).toMatch(/controller: BookCtrl/); - expect(content).toMatch(/Book Id: Scarlet/); - }); - -
- */ - - -/** - * @ngdoc event - * @name ngView#$viewContentLoaded - * @eventType emit on the current ngView scope - * @description - * Emitted every time the ngView content is reloaded. - */ -ngViewFactory.$inject = ['$route', '$anchorScroll', '$animate']; -function ngViewFactory($route, $anchorScroll, $animate) { - return { - restrict: 'ECA', - terminal: true, - priority: 400, - transclude: 'element', - link: function(scope, $element, attr, ctrl, $transclude) { - var currentScope, - currentElement, - previousLeaveAnimation, - autoScrollExp = attr.autoscroll, - onloadExp = attr.onload || ''; - - scope.$on('$routeChangeSuccess', update); - update(); - - function cleanupLastView() { - if (previousLeaveAnimation) { - $animate.cancel(previousLeaveAnimation); - previousLeaveAnimation = null; - } - - if (currentScope) { - currentScope.$destroy(); - currentScope = null; - } - if (currentElement) { - previousLeaveAnimation = $animate.leave(currentElement); - previousLeaveAnimation.done(function(response) { - if (response !== false) previousLeaveAnimation = null; - }); - currentElement = null; - } - } - - function update() { - var locals = $route.current && $route.current.locals, - template = locals && locals.$template; - - if (angular.isDefined(template)) { - var newScope = scope.$new(); - var current = $route.current; - - // Note: This will also link all children of ng-view that were contained in the original - // html. If that content contains controllers, ... they could pollute/change the scope. - // However, using ng-view on an element with additional content does not make sense... - // Note: We can't remove them in the cloneAttchFn of $transclude as that - // function is called before linking the content, which would apply child - // directives to non existing elements. - var clone = $transclude(newScope, function(clone) { - $animate.enter(clone, null, currentElement || $element).done(function onNgViewEnter(response) { - if (response !== false && angular.isDefined(autoScrollExp) - && (!autoScrollExp || scope.$eval(autoScrollExp))) { - $anchorScroll(); - } - }); - cleanupLastView(); - }); - - currentElement = clone; - currentScope = current.scope = newScope; - currentScope.$emit('$viewContentLoaded'); - currentScope.$eval(onloadExp); - } else { - cleanupLastView(); - } - } - } - }; -} - -// This directive is called during the $transclude call of the first `ngView` directive. -// It will replace and compile the content of the element with the loaded template. -// We need this directive so that the element content is already filled when -// the link function of another directive on the same element as ngView -// is called. -ngViewFillContentFactory.$inject = ['$compile', '$controller', '$route']; -function ngViewFillContentFactory($compile, $controller, $route) { - return { - restrict: 'ECA', - priority: -400, - link: function(scope, $element) { - var current = $route.current, - locals = current.locals; - - $element.html(locals.$template); - - var link = $compile($element.contents()); - - if (current.controller) { - locals.$scope = scope; - var controller = $controller(current.controller, locals); - if (current.controllerAs) { - scope[current.controllerAs] = controller; - } - $element.data('$ngControllerController', controller); - $element.children().data('$ngControllerController', controller); - } - scope[current.resolveAs || '$resolve'] = locals; - - link(scope); - } - }; -} - - -})(window, window.angular); diff --git a/stackle_app/app/vendor/angular-sanitize.js b/stackle_app/app/vendor/angular-sanitize.js deleted file mode 100644 index 1d60fdb..0000000 --- a/stackle_app/app/vendor/angular-sanitize.js +++ /dev/null @@ -1,756 +0,0 @@ -/** - * @license AngularJS v1.6.4 - * (c) 2010-2017 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window, angular) {'use strict'; - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Any commits to this file should be reviewed with security in mind. * - * Changes to this file can potentially create security vulnerabilities. * - * An approval from 2 Core members with history of modifying * - * this file is required. * - * * - * Does the change somehow allow for arbitrary javascript to be executed? * - * Or allows for someone to change the prototype of built-in objects? * - * Or gives undesired access to variables likes document or window? * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -var $sanitizeMinErr = angular.$$minErr('$sanitize'); -var bind; -var extend; -var forEach; -var isDefined; -var lowercase; -var noop; -var nodeContains; -var htmlParser; -var htmlSanitizeWriter; - -/** - * @ngdoc module - * @name ngSanitize - * @description - * - * # ngSanitize - * - * The `ngSanitize` module provides functionality to sanitize HTML. - * - * - *
- * - * See {@link ngSanitize.$sanitize `$sanitize`} for usage. - */ - -/** - * @ngdoc service - * @name $sanitize - * @kind function - * - * @description - * Sanitizes an html string by stripping all potentially dangerous tokens. - * - * The input is sanitized by parsing the HTML into tokens. All safe tokens (from a whitelist) are - * then serialized back to properly escaped html string. This means that no unsafe input can make - * it into the returned string. - * - * The whitelist for URL sanitization of attribute values is configured using the functions - * `aHrefSanitizationWhitelist` and `imgSrcSanitizationWhitelist` of {@link ng.$compileProvider - * `$compileProvider`}. - * - * The input may also contain SVG markup if this is enabled via {@link $sanitizeProvider}. - * - * @param {string} html HTML input. - * @returns {string} Sanitized HTML. - * - * @example - - - -
- Snippet: - - - - - - - - - - - - - - - - - - - - - - - - - -
DirectiveHowSourceRendered
ng-bind-htmlAutomatically uses $sanitize
<div ng-bind-html="snippet">
</div>
ng-bind-htmlBypass $sanitize by explicitly trusting the dangerous value -
<div ng-bind-html="deliberatelyTrustDangerousSnippet()">
-</div>
-
ng-bindAutomatically escapes
<div ng-bind="snippet">
</div>
-
-
- - it('should sanitize the html snippet by default', function() { - expect(element(by.css('#bind-html-with-sanitize div')).getAttribute('innerHTML')). - toBe('

an html\nclick here\nsnippet

'); - }); - - it('should inline raw snippet if bound to a trusted value', function() { - expect(element(by.css('#bind-html-with-trust div')).getAttribute('innerHTML')). - toBe("

an html\n" + - "click here\n" + - "snippet

"); - }); - - it('should escape snippet without any filter', function() { - expect(element(by.css('#bind-default div')).getAttribute('innerHTML')). - toBe("<p style=\"color:blue\">an html\n" + - "<em onmouseover=\"this.textContent='PWN3D!'\">click here</em>\n" + - "snippet</p>"); - }); - - it('should update', function() { - element(by.model('snippet')).clear(); - element(by.model('snippet')).sendKeys('new text'); - expect(element(by.css('#bind-html-with-sanitize div')).getAttribute('innerHTML')). - toBe('new text'); - expect(element(by.css('#bind-html-with-trust div')).getAttribute('innerHTML')).toBe( - 'new text'); - expect(element(by.css('#bind-default div')).getAttribute('innerHTML')).toBe( - "new <b onclick=\"alert(1)\">text</b>"); - }); -
-
- */ - - -/** - * @ngdoc provider - * @name $sanitizeProvider - * @this - * - * @description - * Creates and configures {@link $sanitize} instance. - */ -function $SanitizeProvider() { - var svgEnabled = false; - - this.$get = ['$$sanitizeUri', function($$sanitizeUri) { - if (svgEnabled) { - extend(validElements, svgElements); - } - return function(html) { - var buf = []; - htmlParser(html, htmlSanitizeWriter(buf, function(uri, isImage) { - return !/^unsafe:/.test($$sanitizeUri(uri, isImage)); - })); - return buf.join(''); - }; - }]; - - - /** - * @ngdoc method - * @name $sanitizeProvider#enableSvg - * @kind function - * - * @description - * Enables a subset of svg to be supported by the sanitizer. - * - *
- *

By enabling this setting without taking other precautions, you might expose your - * application to click-hijacking attacks. In these attacks, sanitized svg elements could be positioned - * outside of the containing element and be rendered over other elements on the page (e.g. a login - * link). Such behavior can then result in phishing incidents.

- * - *

To protect against these, explicitly setup `overflow: hidden` css rule for all potential svg - * tags within the sanitized content:

- * - *
- * - *

-   *   .rootOfTheIncludedContent svg {
-   *     overflow: hidden !important;
-   *   }
-   *   
- *
- * - * @param {boolean=} flag Enable or disable SVG support in the sanitizer. - * @returns {boolean|ng.$sanitizeProvider} Returns the currently configured value if called - * without an argument or self for chaining otherwise. - */ - this.enableSvg = function(enableSvg) { - if (isDefined(enableSvg)) { - svgEnabled = enableSvg; - return this; - } else { - return svgEnabled; - } - }; - - ////////////////////////////////////////////////////////////////////////////////////////////////// - // Private stuff - ////////////////////////////////////////////////////////////////////////////////////////////////// - - bind = angular.bind; - extend = angular.extend; - forEach = angular.forEach; - isDefined = angular.isDefined; - lowercase = angular.lowercase; - noop = angular.noop; - - htmlParser = htmlParserImpl; - htmlSanitizeWriter = htmlSanitizeWriterImpl; - - nodeContains = window.Node.prototype.contains || /** @this */ function(arg) { - // eslint-disable-next-line no-bitwise - return !!(this.compareDocumentPosition(arg) & 16); - }; - - // Regular Expressions for parsing tags and attributes - var SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, - // Match everything outside of normal chars and " (quote character) - NON_ALPHANUMERIC_REGEXP = /([^#-~ |!])/g; - - - // Good source of info about elements and attributes - // http://dev.w3.org/html5/spec/Overview.html#semantics - // http://simon.html5.org/html-elements - - // Safe Void Elements - HTML5 - // http://dev.w3.org/html5/spec/Overview.html#void-elements - var voidElements = toMap('area,br,col,hr,img,wbr'); - - // Elements that you can, intentionally, leave open (and which close themselves) - // http://dev.w3.org/html5/spec/Overview.html#optional-tags - var optionalEndTagBlockElements = toMap('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr'), - optionalEndTagInlineElements = toMap('rp,rt'), - optionalEndTagElements = extend({}, - optionalEndTagInlineElements, - optionalEndTagBlockElements); - - // Safe Block Elements - HTML5 - var blockElements = extend({}, optionalEndTagBlockElements, toMap('address,article,' + - 'aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' + - 'h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,section,table,ul')); - - // Inline Elements - HTML5 - var inlineElements = extend({}, optionalEndTagInlineElements, toMap('a,abbr,acronym,b,' + - 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,' + - 'samp,small,span,strike,strong,sub,sup,time,tt,u,var')); - - // SVG Elements - // https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Elements - // Note: the elements animate,animateColor,animateMotion,animateTransform,set are intentionally omitted. - // They can potentially allow for arbitrary javascript to be executed. See #11290 - var svgElements = toMap('circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,' + - 'hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,' + - 'radialGradient,rect,stop,svg,switch,text,title,tspan'); - - // Blocked Elements (will be stripped) - var blockedElements = toMap('script,style'); - - var validElements = extend({}, - voidElements, - blockElements, - inlineElements, - optionalEndTagElements); - - //Attributes that have href and hence need to be sanitized - var uriAttrs = toMap('background,cite,href,longdesc,src,xlink:href'); - - var htmlAttrs = toMap('abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,' + - 'color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,' + - 'ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,' + - 'scope,scrolling,shape,size,span,start,summary,tabindex,target,title,type,' + - 'valign,value,vspace,width'); - - // SVG attributes (without "id" and "name" attributes) - // https://wiki.whatwg.org/wiki/Sanitization_rules#svg_Attributes - var svgAttrs = toMap('accent-height,accumulate,additive,alphabetic,arabic-form,ascent,' + - 'baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,' + - 'cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,' + - 'font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,' + - 'height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,' + - 'marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,' + - 'max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,' + - 'path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,' + - 'requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,' + - 'stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,' + - 'stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,' + - 'stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,' + - 'underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,' + - 'width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,' + - 'xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan', true); - - var validAttrs = extend({}, - uriAttrs, - svgAttrs, - htmlAttrs); - - function toMap(str, lowercaseKeys) { - var obj = {}, items = str.split(','), i; - for (i = 0; i < items.length; i++) { - obj[lowercaseKeys ? lowercase(items[i]) : items[i]] = true; - } - return obj; - } - - var inertBodyElement; - (function(window) { - var doc; - if (window.document && window.document.implementation) { - doc = window.document.implementation.createHTMLDocument('inert'); - } else { - throw $sanitizeMinErr('noinert', 'Can\'t create an inert html document'); - } - var docElement = doc.documentElement || doc.getDocumentElement(); - var bodyElements = docElement.getElementsByTagName('body'); - - // usually there should be only one body element in the document, but IE doesn't have any, so we need to create one - if (bodyElements.length === 1) { - inertBodyElement = bodyElements[0]; - } else { - var html = doc.createElement('html'); - inertBodyElement = doc.createElement('body'); - html.appendChild(inertBodyElement); - doc.appendChild(html); - } - })(window); - - /** - * @example - * htmlParser(htmlString, { - * start: function(tag, attrs) {}, - * end: function(tag) {}, - * chars: function(text) {}, - * comment: function(text) {} - * }); - * - * @param {string} html string - * @param {object} handler - */ - function htmlParserImpl(html, handler) { - if (html === null || html === undefined) { - html = ''; - } else if (typeof html !== 'string') { - html = '' + html; - } - inertBodyElement.innerHTML = html; - - //mXSS protection - var mXSSAttempts = 5; - do { - if (mXSSAttempts === 0) { - throw $sanitizeMinErr('uinput', 'Failed to sanitize html because the input is unstable'); - } - mXSSAttempts--; - - // strip custom-namespaced attributes on IE<=11 - if (window.document.documentMode) { - stripCustomNsAttrs(inertBodyElement); - } - html = inertBodyElement.innerHTML; //trigger mXSS - inertBodyElement.innerHTML = html; - } while (html !== inertBodyElement.innerHTML); - - var node = inertBodyElement.firstChild; - while (node) { - switch (node.nodeType) { - case 1: // ELEMENT_NODE - handler.start(node.nodeName.toLowerCase(), attrToMap(node.attributes)); - break; - case 3: // TEXT NODE - handler.chars(node.textContent); - break; - } - - var nextNode; - if (!(nextNode = node.firstChild)) { - if (node.nodeType === 1) { - handler.end(node.nodeName.toLowerCase()); - } - nextNode = getNonDescendant('nextSibling', node); - if (!nextNode) { - while (nextNode == null) { - node = getNonDescendant('parentNode', node); - if (node === inertBodyElement) break; - nextNode = getNonDescendant('nextSibling', node); - if (node.nodeType === 1) { - handler.end(node.nodeName.toLowerCase()); - } - } - } - } - node = nextNode; - } - - while ((node = inertBodyElement.firstChild)) { - inertBodyElement.removeChild(node); - } - } - - function attrToMap(attrs) { - var map = {}; - for (var i = 0, ii = attrs.length; i < ii; i++) { - var attr = attrs[i]; - map[attr.name] = attr.value; - } - return map; - } - - - /** - * Escapes all potentially dangerous characters, so that the - * resulting string can be safely inserted into attribute or - * element text. - * @param value - * @returns {string} escaped text - */ - function encodeEntities(value) { - return value. - replace(/&/g, '&'). - replace(SURROGATE_PAIR_REGEXP, function(value) { - var hi = value.charCodeAt(0); - var low = value.charCodeAt(1); - return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';'; - }). - replace(NON_ALPHANUMERIC_REGEXP, function(value) { - return '&#' + value.charCodeAt(0) + ';'; - }). - replace(//g, '>'); - } - - /** - * create an HTML/XML writer which writes to buffer - * @param {Array} buf use buf.join('') to get out sanitized html string - * @returns {object} in the form of { - * start: function(tag, attrs) {}, - * end: function(tag) {}, - * chars: function(text) {}, - * comment: function(text) {} - * } - */ - function htmlSanitizeWriterImpl(buf, uriValidator) { - var ignoreCurrentElement = false; - var out = bind(buf, buf.push); - return { - start: function(tag, attrs) { - tag = lowercase(tag); - if (!ignoreCurrentElement && blockedElements[tag]) { - ignoreCurrentElement = tag; - } - if (!ignoreCurrentElement && validElements[tag] === true) { - out('<'); - out(tag); - forEach(attrs, function(value, key) { - var lkey = lowercase(key); - var isImage = (tag === 'img' && lkey === 'src') || (lkey === 'background'); - if (validAttrs[lkey] === true && - (uriAttrs[lkey] !== true || uriValidator(value, isImage))) { - out(' '); - out(key); - out('="'); - out(encodeEntities(value)); - out('"'); - } - }); - out('>'); - } - }, - end: function(tag) { - tag = lowercase(tag); - if (!ignoreCurrentElement && validElements[tag] === true && voidElements[tag] !== true) { - out(''); - } - // eslint-disable-next-line eqeqeq - if (tag == ignoreCurrentElement) { - ignoreCurrentElement = false; - } - }, - chars: function(chars) { - if (!ignoreCurrentElement) { - out(encodeEntities(chars)); - } - } - }; - } - - - /** - * When IE9-11 comes across an unknown namespaced attribute e.g. 'xlink:foo' it adds 'xmlns:ns1' attribute to declare - * ns1 namespace and prefixes the attribute with 'ns1' (e.g. 'ns1:xlink:foo'). This is undesirable since we don't want - * to allow any of these custom attributes. This method strips them all. - * - * @param node Root element to process - */ - function stripCustomNsAttrs(node) { - while (node) { - if (node.nodeType === window.Node.ELEMENT_NODE) { - var attrs = node.attributes; - for (var i = 0, l = attrs.length; i < l; i++) { - var attrNode = attrs[i]; - var attrName = attrNode.name.toLowerCase(); - if (attrName === 'xmlns:ns1' || attrName.lastIndexOf('ns1:', 0) === 0) { - node.removeAttributeNode(attrNode); - i--; - l--; - } - } - } - - var nextNode = node.firstChild; - if (nextNode) { - stripCustomNsAttrs(nextNode); - } - - node = getNonDescendant('nextSibling', node); - } - } - - function getNonDescendant(propName, node) { - // An element is clobbered if its `propName` property points to one of its descendants - var nextNode = node[propName]; - if (nextNode && nodeContains.call(node, nextNode)) { - throw $sanitizeMinErr('elclob', 'Failed to sanitize html because the element is clobbered: {0}', node.outerHTML || node.outerText); - } - return nextNode; - } -} - -function sanitizeText(chars) { - var buf = []; - var writer = htmlSanitizeWriter(buf, noop); - writer.chars(chars); - return buf.join(''); -} - - -// define ngSanitize module and register $sanitize service -angular.module('ngSanitize', []) - .provider('$sanitize', $SanitizeProvider) - .info({ angularVersion: '1.6.4' }); - -/** - * @ngdoc filter - * @name linky - * @kind function - * - * @description - * Finds links in text input and turns them into html links. Supports `http/https/ftp/mailto` and - * plain email address links. - * - * Requires the {@link ngSanitize `ngSanitize`} module to be installed. - * - * @param {string} text Input text. - * @param {string} target Window (`_blank|_self|_parent|_top`) or named frame to open links in. - * @param {object|function(url)} [attributes] Add custom attributes to the link element. - * - * Can be one of: - * - * - `object`: A map of attributes - * - `function`: Takes the url as a parameter and returns a map of attributes - * - * If the map of attributes contains a value for `target`, it overrides the value of - * the target parameter. - * - * - * @returns {string} Html-linkified and {@link $sanitize sanitized} text. - * - * @usage - - * - * @example - - -
- Snippet: - - - - - - - - - - - - - - - - - - - - - - - - - - -
FilterSourceRendered
linky filter -
<div ng-bind-html="snippet | linky">
</div>
-
-
-
linky target -
<div ng-bind-html="snippetWithSingleURL | linky:'_blank'">
</div>
-
-
-
linky custom attributes -
<div ng-bind-html="snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}">
</div>
-
-
-
no filter
<div ng-bind="snippet">
</div>
- - - angular.module('linkyExample', ['ngSanitize']) - .controller('ExampleController', ['$scope', function($scope) { - $scope.snippet = - 'Pretty text with some links:\n' + - 'http://angularjs.org/,\n' + - 'mailto:us@somewhere.org,\n' + - 'another@somewhere.org,\n' + - 'and one more: ftp://127.0.0.1/.'; - $scope.snippetWithSingleURL = 'http://angularjs.org/'; - }]); - - - it('should linkify the snippet with urls', function() { - expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()). - toBe('Pretty text with some links: http://angularjs.org/, us@somewhere.org, ' + - 'another@somewhere.org, and one more: ftp://127.0.0.1/.'); - expect(element.all(by.css('#linky-filter a')).count()).toEqual(4); - }); - - it('should not linkify snippet without the linky filter', function() { - expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()). - toBe('Pretty text with some links: http://angularjs.org/, mailto:us@somewhere.org, ' + - 'another@somewhere.org, and one more: ftp://127.0.0.1/.'); - expect(element.all(by.css('#escaped-html a')).count()).toEqual(0); - }); - - it('should update', function() { - element(by.model('snippet')).clear(); - element(by.model('snippet')).sendKeys('new http://link.'); - expect(element(by.id('linky-filter')).element(by.binding('snippet | linky')).getText()). - toBe('new http://link.'); - expect(element.all(by.css('#linky-filter a')).count()).toEqual(1); - expect(element(by.id('escaped-html')).element(by.binding('snippet')).getText()) - .toBe('new http://link.'); - }); - - it('should work with the target property', function() { - expect(element(by.id('linky-target')). - element(by.binding("snippetWithSingleURL | linky:'_blank'")).getText()). - toBe('http://angularjs.org/'); - expect(element(by.css('#linky-target a')).getAttribute('target')).toEqual('_blank'); - }); - - it('should optionally add custom attributes', function() { - expect(element(by.id('linky-custom-attributes')). - element(by.binding("snippetWithSingleURL | linky:'_self':{rel: 'nofollow'}")).getText()). - toBe('http://angularjs.org/'); - expect(element(by.css('#linky-custom-attributes a')).getAttribute('rel')).toEqual('nofollow'); - }); - - - */ -angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) { - var LINKY_URL_REGEXP = - /((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/i, - MAILTO_REGEXP = /^mailto:/i; - - var linkyMinErr = angular.$$minErr('linky'); - var isDefined = angular.isDefined; - var isFunction = angular.isFunction; - var isObject = angular.isObject; - var isString = angular.isString; - - return function(text, target, attributes) { - if (text == null || text === '') return text; - if (!isString(text)) throw linkyMinErr('notstring', 'Expected string but received: {0}', text); - - var attributesFn = - isFunction(attributes) ? attributes : - isObject(attributes) ? function getAttributesObject() {return attributes;} : - function getEmptyAttributesObject() {return {};}; - - var match; - var raw = text; - var html = []; - var url; - var i; - while ((match = raw.match(LINKY_URL_REGEXP))) { - // We can not end in these as they are sometimes found at the end of the sentence - url = match[0]; - // if we did not match ftp/http/www/mailto then assume mailto - if (!match[2] && !match[4]) { - url = (match[3] ? 'http://' : 'mailto:') + url; - } - i = match.index; - addText(raw.substr(0, i)); - addLink(url, match[0].replace(MAILTO_REGEXP, '')); - raw = raw.substring(i + match[0].length); - } - addText(raw); - return $sanitize(html.join('')); - - function addText(text) { - if (!text) { - return; - } - html.push(sanitizeText(text)); - } - - function addLink(url, text) { - var key, linkAttributes = attributesFn(url); - html.push(''); - addText(text); - html.push(''); - } - }; -}]); - - -})(window, window.angular); diff --git a/stackle_app/app/vendor/angular-storage.js b/stackle_app/app/vendor/angular-storage.js deleted file mode 100644 index 8c72066..0000000 --- a/stackle_app/app/vendor/angular-storage.js +++ /dev/null @@ -1,213 +0,0 @@ -(function() { - - -// Create all modules and define dependencies to make sure they exist -// and are loaded in the correct order to satisfy dependency injection -// before all nested files are concatenated by Grunt - -angular.module('angular-storage', - [ - 'angular-storage.store' - ]); - -angular.module('angular-storage.cookieStorage', []) - .service('cookieStorage', ["$cookies", function ($cookies) { - - this.set = function (what, value) { - return $cookies.put(what, value); - }; - - this.get = function (what) { - return $cookies.get(what); - }; - - this.remove = function (what) { - return $cookies.remove(what); - }; - }]); - -angular.module('angular-storage.internalStore', ['angular-storage.localStorage', 'angular-storage.sessionStorage']) - .factory('InternalStore', ["$log", "$injector", function($log, $injector) { - - function InternalStore(namespace, storage, delimiter, useCache) { - this.namespace = namespace || null; - if (angular.isUndefined(useCache) || useCache == null) { - useCache = true; - } - this.useCache = useCache; - this.delimiter = delimiter || '.'; - this.inMemoryCache = {}; - this.storage = $injector.get(storage || 'localStorage'); - } - - InternalStore.prototype.getNamespacedKey = function(key) { - if (!this.namespace) { - return key; - } else { - return [this.namespace, key].join(this.delimiter); - } - }; - - InternalStore.prototype.set = function(name, elem) { - if (this.useCache) { - this.inMemoryCache[name] = elem; - } - this.storage.set(this.getNamespacedKey(name), JSON.stringify(elem)); - }; - - InternalStore.prototype.get = function(name) { - var obj = null; - if (this.useCache && name in this.inMemoryCache) { - return this.inMemoryCache[name]; - } - var saved = this.storage.get(this.getNamespacedKey(name)); - try { - - if (typeof saved === 'undefined' || saved === 'undefined') { - obj = undefined; - } else { - obj = JSON.parse(saved); - } - - if (this.useCache) { - this.inMemoryCache[name] = obj; - } - } catch(e) { - $log.error('Error parsing saved value', e); - this.remove(name); - } - return obj; - }; - - InternalStore.prototype.remove = function(name) { - if (this.useCache) { - this.inMemoryCache[name] = null; - } - this.storage.remove(this.getNamespacedKey(name)); - }; - - return InternalStore; - }]); - - -angular.module('angular-storage.localStorage', ['angular-storage.cookieStorage']) - .service('localStorage', ["$window", "$injector", function ($window, $injector) { - var localStorageAvailable; - - try { - $window.localStorage.setItem('testKey', 'test'); - $window.localStorage.removeItem('testKey'); - localStorageAvailable = true; - } catch(e) { - localStorageAvailable = false; - } - - if (localStorageAvailable) { - this.set = function (what, value) { - return $window.localStorage.setItem(what, value); - }; - - this.get = function (what) { - return $window.localStorage.getItem(what); - }; - - this.remove = function (what) { - return $window.localStorage.removeItem(what); - }; - - this.clear = function () { - $window.localStorage.clear(); - }; - } else { - var cookieStorage = $injector.get('cookieStorage'); - - this.set = cookieStorage.set; - this.get = cookieStorage.get; - this.remove = cookieStorage.remove; - } - }]); - -angular.module('angular-storage.sessionStorage', ['angular-storage.cookieStorage']) - .service('sessionStorage', ["$window", "$injector", function ($window, $injector) { - var sessionStorageAvailable; - - try { - $window.sessionStorage.setItem('testKey', 'test'); - $window.sessionStorage.removeItem('testKey'); - sessionStorageAvailable = true; - } catch(e) { - sessionStorageAvailable = false; - } - - if (sessionStorageAvailable) { - this.set = function (what, value) { - return $window.sessionStorage.setItem(what, value); - }; - - this.get = function (what) { - return $window.sessionStorage.getItem(what); - }; - - this.remove = function (what) { - return $window.sessionStorage.removeItem(what); - }; - } else { - var cookieStorage = $injector.get('cookieStorage'); - - this.set = cookieStorage.set; - this.get = cookieStorage.get; - this.remove = cookieStorage.remove; - } - }]); - -angular.module('angular-storage.store', ['angular-storage.internalStore']) - .provider('store', function() { - - // the default storage - var _storage = 'localStorage'; - - //caching is on by default - var _caching = true; - - /** - * Sets the storage. - * - * @param {String} storage The storage name - */ - this.setStore = function(storage) { - if (storage && angular.isString(storage)) { - _storage = storage; - } - }; - - /** - * Sets the internal cache usage - * - * @param {boolean} useCache Whether to use internal cache - */ - this.setCaching = function(useCache) { - _caching = !!useCache; - }; - - this.$get = ["InternalStore", function(InternalStore) { - var store = new InternalStore(null, _storage, null, _caching); - - /** - * Returns a namespaced store - * - * @param {String} namespace The namespace - * @param {String} storage The name of the storage service - * @param {String} delimiter The key delimiter - * @param {boolean} useCache whether to use the internal caching - * @returns {InternalStore} - */ - store.getNamespacedStore = function(namespace, storage, delimiter, useCache) { - return new InternalStore(namespace, storage, delimiter, useCache); - }; - - return store; - }]; - }); - - -}()); \ No newline at end of file diff --git a/stackle_app/app/vendor/angular-touch.js b/stackle_app/app/vendor/angular-touch.js deleted file mode 100644 index f046875..0000000 --- a/stackle_app/app/vendor/angular-touch.js +++ /dev/null @@ -1,749 +0,0 @@ -/** - * @license AngularJS v1.6.4 - * (c) 2010-2017 Google, Inc. http://angularjs.org - * License: MIT - */ -(function(window, angular) {'use strict'; - -/* global ngTouchClickDirectiveFactory: false */ - -/** - * @ngdoc module - * @name ngTouch - * @description - * - * # ngTouch - * - * The `ngTouch` module provides touch events and other helpers for touch-enabled devices. - * The implementation is based on jQuery Mobile touch event handling - * ([jquerymobile.com](http://jquerymobile.com/)). - * - * - * See {@link ngTouch.$swipe `$swipe`} for usage. - * - *
- * - */ - -// define ngTouch module -/* global -ngTouch */ -var ngTouch = angular.module('ngTouch', []); - -ngTouch.info({ angularVersion: '1.6.4' }); - -ngTouch.provider('$touch', $TouchProvider); - -function nodeName_(element) { - return angular.lowercase(element.nodeName || (element[0] && element[0].nodeName)); -} - -/** - * @ngdoc provider - * @name $touchProvider - * - * @description - * The `$touchProvider` allows enabling / disabling {@link ngTouch.ngClick ngTouch's ngClick directive}. - */ -$TouchProvider.$inject = ['$provide', '$compileProvider']; -function $TouchProvider($provide, $compileProvider) { - - /** - * @ngdoc method - * @name $touchProvider#ngClickOverrideEnabled - * - * @param {boolean=} enabled update the ngClickOverrideEnabled state if provided, otherwise just return the - * current ngClickOverrideEnabled state - * @returns {*} current value if used as getter or itself (chaining) if used as setter - * - * @kind function - * - * @description - * Call this method to enable/disable {@link ngTouch.ngClick ngTouch's ngClick directive}. If enabled, - * the default ngClick directive will be replaced by a version that eliminates the 300ms delay for - * click events on browser for touch-devices. - * - * The default is `false`. - * - */ - var ngClickOverrideEnabled = false; - var ngClickDirectiveAdded = false; - // eslint-disable-next-line no-invalid-this - this.ngClickOverrideEnabled = function(enabled) { - if (angular.isDefined(enabled)) { - - if (enabled && !ngClickDirectiveAdded) { - ngClickDirectiveAdded = true; - - // Use this to identify the correct directive in the delegate - ngTouchClickDirectiveFactory.$$moduleName = 'ngTouch'; - $compileProvider.directive('ngClick', ngTouchClickDirectiveFactory); - - $provide.decorator('ngClickDirective', ['$delegate', function($delegate) { - if (ngClickOverrideEnabled) { - // drop the default ngClick directive - $delegate.shift(); - } else { - // drop the ngTouch ngClick directive if the override has been re-disabled (because - // we cannot de-register added directives) - var i = $delegate.length - 1; - while (i >= 0) { - if ($delegate[i].$$moduleName === 'ngTouch') { - $delegate.splice(i, 1); - break; - } - i--; - } - } - - return $delegate; - }]); - } - - ngClickOverrideEnabled = enabled; - return this; - } - - return ngClickOverrideEnabled; - }; - - /** - * @ngdoc service - * @name $touch - * @kind object - * - * @description - * Provides the {@link ngTouch.$touch#ngClickOverrideEnabled `ngClickOverrideEnabled`} method. - * - */ - // eslint-disable-next-line no-invalid-this - this.$get = function() { - return { - /** - * @ngdoc method - * @name $touch#ngClickOverrideEnabled - * - * @returns {*} current value of `ngClickOverrideEnabled` set in the {@link ngTouch.$touchProvider $touchProvider}, - * i.e. if {@link ngTouch.ngClick ngTouch's ngClick} directive is enabled. - * - * @kind function - */ - ngClickOverrideEnabled: function() { - return ngClickOverrideEnabled; - } - }; - }; - -} - -/* global ngTouch: false */ - - /** - * @ngdoc service - * @name $swipe - * - * @description - * The `$swipe` service is a service that abstracts the messier details of hold-and-drag swipe - * behavior, to make implementing swipe-related directives more convenient. - * - * Requires the {@link ngTouch `ngTouch`} module to be installed. - * - * `$swipe` is used by the `ngSwipeLeft` and `ngSwipeRight` directives in `ngTouch`. - * - * # Usage - * The `$swipe` service is an object with a single method: `bind`. `bind` takes an element - * which is to be watched for swipes, and an object with four handler functions. See the - * documentation for `bind` below. - */ - -ngTouch.factory('$swipe', [function() { - // The total distance in any direction before we make the call on swipe vs. scroll. - var MOVE_BUFFER_RADIUS = 10; - - var POINTER_EVENTS = { - 'mouse': { - start: 'mousedown', - move: 'mousemove', - end: 'mouseup' - }, - 'touch': { - start: 'touchstart', - move: 'touchmove', - end: 'touchend', - cancel: 'touchcancel' - }, - 'pointer': { - start: 'pointerdown', - move: 'pointermove', - end: 'pointerup', - cancel: 'pointercancel' - } - }; - - function getCoordinates(event) { - var originalEvent = event.originalEvent || event; - var touches = originalEvent.touches && originalEvent.touches.length ? originalEvent.touches : [originalEvent]; - var e = (originalEvent.changedTouches && originalEvent.changedTouches[0]) || touches[0]; - - return { - x: e.clientX, - y: e.clientY - }; - } - - function getEvents(pointerTypes, eventType) { - var res = []; - angular.forEach(pointerTypes, function(pointerType) { - var eventName = POINTER_EVENTS[pointerType][eventType]; - if (eventName) { - res.push(eventName); - } - }); - return res.join(' '); - } - - return { - /** - * @ngdoc method - * @name $swipe#bind - * - * @description - * The main method of `$swipe`. It takes an element to be watched for swipe motions, and an - * object containing event handlers. - * The pointer types that should be used can be specified via the optional - * third argument, which is an array of strings `'mouse'`, `'touch'` and `'pointer'`. By default, - * `$swipe` will listen for `mouse`, `touch` and `pointer` events. - * - * The four events are `start`, `move`, `end`, and `cancel`. `start`, `move`, and `end` - * receive as a parameter a coordinates object of the form `{ x: 150, y: 310 }` and the raw - * `event`. `cancel` receives the raw `event` as its single parameter. - * - * `start` is called on either `mousedown`, `touchstart` or `pointerdown`. After this event, `$swipe` is - * watching for `touchmove`, `mousemove` or `pointermove` events. These events are ignored until the total - * distance moved in either dimension exceeds a small threshold. - * - * Once this threshold is exceeded, either the horizontal or vertical delta is greater. - * - If the horizontal distance is greater, this is a swipe and `move` and `end` events follow. - * - If the vertical distance is greater, this is a scroll, and we let the browser take over. - * A `cancel` event is sent. - * - * `move` is called on `mousemove`, `touchmove` and `pointermove` after the above logic has determined that - * a swipe is in progress. - * - * `end` is called when a swipe is successfully completed with a `touchend`, `mouseup` or `pointerup`. - * - * `cancel` is called either on a `touchcancel` or `pointercancel` from the browser, or when we begin scrolling - * as described above. - * - */ - bind: function(element, eventHandlers, pointerTypes) { - // Absolute total movement, used to control swipe vs. scroll. - var totalX, totalY; - // Coordinates of the start position. - var startCoords; - // Last event's position. - var lastPos; - // Whether a swipe is active. - var active = false; - - pointerTypes = pointerTypes || ['mouse', 'touch', 'pointer']; - element.on(getEvents(pointerTypes, 'start'), function(event) { - startCoords = getCoordinates(event); - active = true; - totalX = 0; - totalY = 0; - lastPos = startCoords; - if (eventHandlers['start']) { - eventHandlers['start'](startCoords, event); - } - }); - var events = getEvents(pointerTypes, 'cancel'); - if (events) { - element.on(events, function(event) { - active = false; - if (eventHandlers['cancel']) { - eventHandlers['cancel'](event); - } - }); - } - - element.on(getEvents(pointerTypes, 'move'), function(event) { - if (!active) return; - - // Android will send a touchcancel if it thinks we're starting to scroll. - // So when the total distance (+ or - or both) exceeds 10px in either direction, - // we either: - // - On totalX > totalY, we send preventDefault() and treat this as a swipe. - // - On totalY > totalX, we let the browser handle it as a scroll. - - if (!startCoords) return; - var coords = getCoordinates(event); - - totalX += Math.abs(coords.x - lastPos.x); - totalY += Math.abs(coords.y - lastPos.y); - - lastPos = coords; - - if (totalX < MOVE_BUFFER_RADIUS && totalY < MOVE_BUFFER_RADIUS) { - return; - } - - // One of totalX or totalY has exceeded the buffer, so decide on swipe vs. scroll. - if (totalY > totalX) { - // Allow native scrolling to take over. - active = false; - if (eventHandlers['cancel']) { - eventHandlers['cancel'](event); - } - return; - } else { - // Prevent the browser from scrolling. - event.preventDefault(); - if (eventHandlers['move']) { - eventHandlers['move'](coords, event); - } - } - }); - - element.on(getEvents(pointerTypes, 'end'), function(event) { - if (!active) return; - active = false; - if (eventHandlers['end']) { - eventHandlers['end'](getCoordinates(event), event); - } - }); - } - }; -}]); - -/* global ngTouch: false, - nodeName_: false -*/ - -/** - * @ngdoc directive - * @name ngClick - * @deprecated - * sinceVersion="v1.5.0" - * This directive is deprecated and **disabled** by default. - * The directive will receive no further support and might be removed from future releases. - * If you need the directive, you can enable it with the {@link ngTouch.$touchProvider $touchProvider#ngClickOverrideEnabled} - * function. We also recommend that you migrate to [FastClick](https://github.com/ftlabs/fastclick). - * To learn more about the 300ms delay, this [Telerik article](http://developer.telerik.com/featured/300-ms-click-delay-ios-8/) - * gives a good overview. - * - * @description - * A more powerful replacement for the default ngClick designed to be used on touchscreen - * devices. Most mobile browsers wait about 300ms after a tap-and-release before sending - * the click event. This version handles them immediately, and then prevents the - * following click event from propagating. - * - * Requires the {@link ngTouch `ngTouch`} module to be installed. - * - * This directive can fall back to using an ordinary click event, and so works on desktop - * browsers as well as mobile. - * - * This directive also sets the CSS class `ng-click-active` while the element is being held - * down (by a mouse click or touch) so you can restyle the depressed element if you wish. - * - * @element ANY - * @param {expression} ngClick {@link guide/expression Expression} to evaluate - * upon tap. (Event object is available as `$event`) - * - * @example - - - - count: {{ count }} - - - angular.module('ngClickExample', ['ngTouch']); - - - */ - -var ngTouchClickDirectiveFactory = ['$parse', '$timeout', '$rootElement', - function($parse, $timeout, $rootElement) { - var TAP_DURATION = 750; // Shorter than 750ms is a tap, longer is a taphold or drag. - var MOVE_TOLERANCE = 12; // 12px seems to work in most mobile browsers. - var PREVENT_DURATION = 2500; // 2.5 seconds maximum from preventGhostClick call to click - var CLICKBUSTER_THRESHOLD = 25; // 25 pixels in any dimension is the limit for busting clicks. - - var ACTIVE_CLASS_NAME = 'ng-click-active'; - var lastPreventedTime; - var touchCoordinates; - var lastLabelClickCoordinates; - - - // TAP EVENTS AND GHOST CLICKS - // - // Why tap events? - // Mobile browsers detect a tap, then wait a moment (usually ~300ms) to see if you're - // double-tapping, and then fire a click event. - // - // This delay sucks and makes mobile apps feel unresponsive. - // So we detect touchstart, touchcancel and touchend ourselves and determine when - // the user has tapped on something. - // - // What happens when the browser then generates a click event? - // The browser, of course, also detects the tap and fires a click after a delay. This results in - // tapping/clicking twice. We do "clickbusting" to prevent it. - // - // How does it work? - // We attach global touchstart and click handlers, that run during the capture (early) phase. - // So the sequence for a tap is: - // - global touchstart: Sets an "allowable region" at the point touched. - // - element's touchstart: Starts a touch - // (- touchcancel ends the touch, no click follows) - // - element's touchend: Determines if the tap is valid (didn't move too far away, didn't hold - // too long) and fires the user's tap handler. The touchend also calls preventGhostClick(). - // - preventGhostClick() removes the allowable region the global touchstart created. - // - The browser generates a click event. - // - The global click handler catches the click, and checks whether it was in an allowable region. - // - If preventGhostClick was called, the region will have been removed, the click is busted. - // - If the region is still there, the click proceeds normally. Therefore clicks on links and - // other elements without ngTap on them work normally. - // - // This is an ugly, terrible hack! - // Yeah, tell me about it. The alternatives are using the slow click events, or making our users - // deal with the ghost clicks, so I consider this the least of evils. Fortunately Angular - // encapsulates this ugly logic away from the user. - // - // Why not just put click handlers on the element? - // We do that too, just to be sure. If the tap event caused the DOM to change, - // it is possible another element is now in that position. To take account for these possibly - // distinct elements, the handlers are global and care only about coordinates. - - // Checks if the coordinates are close enough to be within the region. - function hit(x1, y1, x2, y2) { - return Math.abs(x1 - x2) < CLICKBUSTER_THRESHOLD && Math.abs(y1 - y2) < CLICKBUSTER_THRESHOLD; - } - - // Checks a list of allowable regions against a click location. - // Returns true if the click should be allowed. - // Splices out the allowable region from the list after it has been used. - function checkAllowableRegions(touchCoordinates, x, y) { - for (var i = 0; i < touchCoordinates.length; i += 2) { - if (hit(touchCoordinates[i], touchCoordinates[i + 1], x, y)) { - touchCoordinates.splice(i, i + 2); - return true; // allowable region - } - } - return false; // No allowable region; bust it. - } - - // Global click handler that prevents the click if it's in a bustable zone and preventGhostClick - // was called recently. - function onClick(event) { - if (Date.now() - lastPreventedTime > PREVENT_DURATION) { - return; // Too old. - } - - var touches = event.touches && event.touches.length ? event.touches : [event]; - var x = touches[0].clientX; - var y = touches[0].clientY; - // Work around desktop Webkit quirk where clicking a label will fire two clicks (on the label - // and on the input element). Depending on the exact browser, this second click we don't want - // to bust has either (0,0), negative coordinates, or coordinates equal to triggering label - // click event - if (x < 1 && y < 1) { - return; // offscreen - } - if (lastLabelClickCoordinates && - lastLabelClickCoordinates[0] === x && lastLabelClickCoordinates[1] === y) { - return; // input click triggered by label click - } - // reset label click coordinates on first subsequent click - if (lastLabelClickCoordinates) { - lastLabelClickCoordinates = null; - } - // remember label click coordinates to prevent click busting of trigger click event on input - if (nodeName_(event.target) === 'label') { - lastLabelClickCoordinates = [x, y]; - } - - // Look for an allowable region containing this click. - // If we find one, that means it was created by touchstart and not removed by - // preventGhostClick, so we don't bust it. - if (checkAllowableRegions(touchCoordinates, x, y)) { - return; - } - - // If we didn't find an allowable region, bust the click. - event.stopPropagation(); - event.preventDefault(); - - // Blur focused form elements - if (event.target && event.target.blur) { - event.target.blur(); - } - } - - - // Global touchstart handler that creates an allowable region for a click event. - // This allowable region can be removed by preventGhostClick if we want to bust it. - function onTouchStart(event) { - var touches = event.touches && event.touches.length ? event.touches : [event]; - var x = touches[0].clientX; - var y = touches[0].clientY; - touchCoordinates.push(x, y); - - $timeout(function() { - // Remove the allowable region. - for (var i = 0; i < touchCoordinates.length; i += 2) { - if (touchCoordinates[i] === x && touchCoordinates[i + 1] === y) { - touchCoordinates.splice(i, i + 2); - return; - } - } - }, PREVENT_DURATION, false); - } - - // On the first call, attaches some event handlers. Then whenever it gets called, it creates a - // zone around the touchstart where clicks will get busted. - function preventGhostClick(x, y) { - if (!touchCoordinates) { - $rootElement[0].addEventListener('click', onClick, true); - $rootElement[0].addEventListener('touchstart', onTouchStart, true); - touchCoordinates = []; - } - - lastPreventedTime = Date.now(); - - checkAllowableRegions(touchCoordinates, x, y); - } - - // Actual linking function. - return function(scope, element, attr) { - var clickHandler = $parse(attr.ngClick), - tapping = false, - tapElement, // Used to blur the element after a tap. - startTime, // Used to check if the tap was held too long. - touchStartX, - touchStartY; - - function resetState() { - tapping = false; - element.removeClass(ACTIVE_CLASS_NAME); - } - - element.on('touchstart', function(event) { - tapping = true; - tapElement = event.target ? event.target : event.srcElement; // IE uses srcElement. - // Hack for Safari, which can target text nodes instead of containers. - if (tapElement.nodeType === 3) { - tapElement = tapElement.parentNode; - } - - element.addClass(ACTIVE_CLASS_NAME); - - startTime = Date.now(); - - // Use jQuery originalEvent - var originalEvent = event.originalEvent || event; - var touches = originalEvent.touches && originalEvent.touches.length ? originalEvent.touches : [originalEvent]; - var e = touches[0]; - touchStartX = e.clientX; - touchStartY = e.clientY; - }); - - element.on('touchcancel', function(event) { - resetState(); - }); - - element.on('touchend', function(event) { - var diff = Date.now() - startTime; - - // Use jQuery originalEvent - var originalEvent = event.originalEvent || event; - var touches = (originalEvent.changedTouches && originalEvent.changedTouches.length) ? - originalEvent.changedTouches : - ((originalEvent.touches && originalEvent.touches.length) ? originalEvent.touches : [originalEvent]); - var e = touches[0]; - var x = e.clientX; - var y = e.clientY; - var dist = Math.sqrt(Math.pow(x - touchStartX, 2) + Math.pow(y - touchStartY, 2)); - - if (tapping && diff < TAP_DURATION && dist < MOVE_TOLERANCE) { - // Call preventGhostClick so the clickbuster will catch the corresponding click. - preventGhostClick(x, y); - - // Blur the focused element (the button, probably) before firing the callback. - // This doesn't work perfectly on Android Chrome, but seems to work elsewhere. - // I couldn't get anything to work reliably on Android Chrome. - if (tapElement) { - tapElement.blur(); - } - - if (!angular.isDefined(attr.disabled) || attr.disabled === false) { - element.triggerHandler('click', [event]); - } - } - - resetState(); - }); - - // Hack for iOS Safari's benefit. It goes searching for onclick handlers and is liable to click - // something else nearby. - element.onclick = function(event) { }; - - // Actual click handler. - // There are three different kinds of clicks, only two of which reach this point. - // - On desktop browsers without touch events, their clicks will always come here. - // - On mobile browsers, the simulated "fast" click will call this. - // - But the browser's follow-up slow click will be "busted" before it reaches this handler. - // Therefore it's safe to use this directive on both mobile and desktop. - element.on('click', function(event, touchend) { - scope.$apply(function() { - clickHandler(scope, {$event: (touchend || event)}); - }); - }); - - element.on('mousedown', function(event) { - element.addClass(ACTIVE_CLASS_NAME); - }); - - element.on('mousemove mouseup', function(event) { - element.removeClass(ACTIVE_CLASS_NAME); - }); - - }; -}]; - -/* global ngTouch: false */ - -/** - * @ngdoc directive - * @name ngSwipeLeft - * - * @description - * Specify custom behavior when an element is swiped to the left on a touchscreen device. - * A leftward swipe is a quick, right-to-left slide of the finger. - * Though ngSwipeLeft is designed for touch-based devices, it will work with a mouse click and drag - * too. - * - * To disable the mouse click and drag functionality, add `ng-swipe-disable-mouse` to - * the `ng-swipe-left` or `ng-swipe-right` DOM Element. - * - * Requires the {@link ngTouch `ngTouch`} module to be installed. - * - * @element ANY - * @param {expression} ngSwipeLeft {@link guide/expression Expression} to evaluate - * upon left swipe. (Event object is available as `$event`) - * - * @example - - -
- Some list content, like an email in the inbox -
-
- - -
-
- - angular.module('ngSwipeLeftExample', ['ngTouch']); - -
- */ - -/** - * @ngdoc directive - * @name ngSwipeRight - * - * @description - * Specify custom behavior when an element is swiped to the right on a touchscreen device. - * A rightward swipe is a quick, left-to-right slide of the finger. - * Though ngSwipeRight is designed for touch-based devices, it will work with a mouse click and drag - * too. - * - * Requires the {@link ngTouch `ngTouch`} module to be installed. - * - * @element ANY - * @param {expression} ngSwipeRight {@link guide/expression Expression} to evaluate - * upon right swipe. (Event object is available as `$event`) - * - * @example - - -
- Some list content, like an email in the inbox -
-
- - -
-
- - angular.module('ngSwipeRightExample', ['ngTouch']); - -
- */ - -function makeSwipeDirective(directiveName, direction, eventName) { - ngTouch.directive(directiveName, ['$parse', '$swipe', function($parse, $swipe) { - // The maximum vertical delta for a swipe should be less than 75px. - var MAX_VERTICAL_DISTANCE = 75; - // Vertical distance should not be more than a fraction of the horizontal distance. - var MAX_VERTICAL_RATIO = 0.3; - // At least a 30px lateral motion is necessary for a swipe. - var MIN_HORIZONTAL_DISTANCE = 30; - - return function(scope, element, attr) { - var swipeHandler = $parse(attr[directiveName]); - - var startCoords, valid; - - function validSwipe(coords) { - // Check that it's within the coordinates. - // Absolute vertical distance must be within tolerances. - // Horizontal distance, we take the current X - the starting X. - // This is negative for leftward swipes and positive for rightward swipes. - // After multiplying by the direction (-1 for left, +1 for right), legal swipes - // (ie. same direction as the directive wants) will have a positive delta and - // illegal ones a negative delta. - // Therefore this delta must be positive, and larger than the minimum. - if (!startCoords) return false; - var deltaY = Math.abs(coords.y - startCoords.y); - var deltaX = (coords.x - startCoords.x) * direction; - return valid && // Short circuit for already-invalidated swipes. - deltaY < MAX_VERTICAL_DISTANCE && - deltaX > 0 && - deltaX > MIN_HORIZONTAL_DISTANCE && - deltaY / deltaX < MAX_VERTICAL_RATIO; - } - - var pointerTypes = ['touch']; - if (!angular.isDefined(attr['ngSwipeDisableMouse'])) { - pointerTypes.push('mouse'); - } - $swipe.bind(element, { - 'start': function(coords, event) { - startCoords = coords; - valid = true; - }, - 'cancel': function(event) { - valid = false; - }, - 'end': function(coords, event) { - if (validSwipe(coords)) { - scope.$apply(function() { - element.triggerHandler(eventName); - swipeHandler(scope, {$event: event}); - }); - } - } - }, pointerTypes); - }; - }]); -} - -// Left is negative X-coordinate, right is positive. -makeSwipeDirective('ngSwipeLeft', -1, 'swipeleft'); -makeSwipeDirective('ngSwipeRight', 1, 'swiperight'); - - - -})(window, window.angular); diff --git a/stackle_app/app/vendor/angular-ui-router.js b/stackle_app/app/vendor/angular-ui-router.js deleted file mode 100644 index c66a6d9..0000000 --- a/stackle_app/app/vendor/angular-ui-router.js +++ /dev/null @@ -1,10020 +0,0 @@ -/** - * State-based routing for AngularJS 1.x - * NOTICE: This monolithic bundle also bundles the @uirouter/core code. - * This causes it to be incompatible with plugins that depend on @uirouter/core. - * We recommend switching to the ui-router-core.js and ui-router-angularjs.js bundles instead. - * For more information, see http://ui-router.github.io/blog/angular-ui-router-umd-bundles - * @version v1.0.3 - * @link https://ui-router.github.io - * @license MIT License, http://www.opensource.org/licenses/MIT - */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('angular')) : - typeof define === 'function' && define.amd ? define(['exports', 'angular'], factory) : - (factory((global['@uirouter/angularjs'] = global['@uirouter/angularjs'] || {}),global.angular)); -}(this, (function (exports,ng_from_import) { 'use strict'; - -/** - * Higher order functions - * - * These utility functions are exported, but are subject to change without notice. - * - * @module common_hof - */ /** */ -/** - * Returns a new function for [Partial Application](https://en.wikipedia.org/wiki/Partial_application) of the original function. - * - * Given a function with N parameters, returns a new function that supports partial application. - * The new function accepts anywhere from 1 to N parameters. When that function is called with M parameters, - * where M is less than N, it returns a new function that accepts the remaining parameters. It continues to - * accept more parameters until all N parameters have been supplied. - * - * - * This contrived example uses a partially applied function as an predicate, which returns true - * if an object is found in both arrays. - * @example - * ``` - * // returns true if an object is in both of the two arrays - * function inBoth(array1, array2, object) { - * return array1.indexOf(object) !== -1 && - * array2.indexOf(object) !== 1; - * } - * let obj1, obj2, obj3, obj4, obj5, obj6, obj7 - * let foos = [obj1, obj3] - * let bars = [obj3, obj4, obj5] - * - * // A curried "copy" of inBoth - * let curriedInBoth = curry(inBoth); - * // Partially apply both the array1 and array2 - * let inFoosAndBars = curriedInBoth(foos, bars); - * - * // Supply the final argument; since all arguments are - * // supplied, the original inBoth function is then called. - * let obj1InBoth = inFoosAndBars(obj1); // false - * - * // Use the inFoosAndBars as a predicate. - * // Filter, on each iteration, supplies the final argument - * let allObjs = [ obj1, obj2, obj3, obj4, obj5, obj6, obj7 ]; - * let foundInBoth = allObjs.filter(inFoosAndBars); // [ obj3 ] - * - * ``` - * - * Stolen from: http://stackoverflow.com/questions/4394747/javascript-curry-function - * - * @param fn - * @returns {*|function(): (*|any)} - */ -function curry(fn) { - var initial_args = [].slice.apply(arguments, [1]); - var func_args_length = fn.length; - function curried(args) { - if (args.length >= func_args_length) - return fn.apply(null, args); - return function () { - return curried(args.concat([].slice.apply(arguments))); - }; - } - return curried(initial_args); -} -/** - * Given a varargs list of functions, returns a function that composes the argument functions, right-to-left - * given: f(x), g(x), h(x) - * let composed = compose(f,g,h) - * then, composed is: f(g(h(x))) - */ -function compose() { - var args = arguments; - var start = args.length - 1; - return function () { - var i = start, result = args[start].apply(this, arguments); - while (i--) - result = args[i].call(this, result); - return result; - }; -} -/** - * Given a varargs list of functions, returns a function that is composes the argument functions, left-to-right - * given: f(x), g(x), h(x) - * let piped = pipe(f,g,h); - * then, piped is: h(g(f(x))) - */ -function pipe() { - var funcs = []; - for (var _i = 0; _i < arguments.length; _i++) { - funcs[_i] = arguments[_i]; - } - return compose.apply(null, [].slice.call(arguments).reverse()); -} -/** - * Given a property name, returns a function that returns that property from an object - * let obj = { foo: 1, name: "blarg" }; - * let getName = prop("name"); - * getName(obj) === "blarg" - */ -var prop = function (name) { - return function (obj) { return obj && obj[name]; }; -}; -/** - * Given a property name and a value, returns a function that returns a boolean based on whether - * the passed object has a property that matches the value - * let obj = { foo: 1, name: "blarg" }; - * let getName = propEq("name", "blarg"); - * getName(obj) === true - */ -var propEq = curry(function (name, val, obj) { return obj && obj[name] === val; }); -/** - * Given a dotted property name, returns a function that returns a nested property from an object, or undefined - * let obj = { id: 1, nestedObj: { foo: 1, name: "blarg" }, }; - * let getName = prop("nestedObj.name"); - * getName(obj) === "blarg" - * let propNotFound = prop("this.property.doesnt.exist"); - * propNotFound(obj) === undefined - */ -var parse = function (name) { - return pipe.apply(null, name.split(".").map(prop)); -}; -/** - * Given a function that returns a truthy or falsey value, returns a - * function that returns the opposite (falsey or truthy) value given the same inputs - */ -var not = function (fn) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return !fn.apply(null, args); - }; -}; -/** - * Given two functions that return truthy or falsey values, returns a function that returns truthy - * if both functions return truthy for the given arguments - */ -function and(fn1, fn2) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return fn1.apply(null, args) && fn2.apply(null, args); - }; -} -/** - * Given two functions that return truthy or falsey values, returns a function that returns truthy - * if at least one of the functions returns truthy for the given arguments - */ -function or(fn1, fn2) { - return function () { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - return fn1.apply(null, args) || fn2.apply(null, args); - }; -} -/** - * Check if all the elements of an array match a predicate function - * - * @param fn1 a predicate function `fn1` - * @returns a function which takes an array and returns true if `fn1` is true for all elements of the array - */ -var all = function (fn1) { - return function (arr) { return arr.reduce(function (b, x) { return b && !!fn1(x); }, true); }; -}; -var any = function (fn1) { - return function (arr) { return arr.reduce(function (b, x) { return b || !!fn1(x); }, false); }; -}; -/** Given a class, returns a Predicate function that returns true if the object is of that class */ -var is = function (ctor) { - return function (obj) { - return (obj != null && obj.constructor === ctor || obj instanceof ctor); - }; -}; -/** Given a value, returns a Predicate function that returns true if another value is === equal to the original value */ -var eq = function (val) { return function (other) { - return val === other; -}; }; -/** Given a value, returns a function which returns the value */ -var val = function (v) { return function () { return v; }; }; -function invoke(fnName, args) { - return function (obj) { - return obj[fnName].apply(obj, args); - }; -} -/** - * Sorta like Pattern Matching (a functional programming conditional construct) - * - * See http://c2.com/cgi/wiki?PatternMatching - * - * This is a conditional construct which allows a series of predicates and output functions - * to be checked and then applied. Each predicate receives the input. If the predicate - * returns truthy, then its matching output function (mapping function) is provided with - * the input and, then the result is returned. - * - * Each combination (2-tuple) of predicate + output function should be placed in an array - * of size 2: [ predicate, mapFn ] - * - * These 2-tuples should be put in an outer array. - * - * @example - * ``` - * - * // Here's a 2-tuple where the first element is the isString predicate - * // and the second element is a function that returns a description of the input - * let firstTuple = [ angular.isString, (input) => `Heres your string ${input}` ]; - * - * // Second tuple: predicate "isNumber", mapfn returns a description - * let secondTuple = [ angular.isNumber, (input) => `(${input}) That's a number!` ]; - * - * let third = [ (input) => input === null, (input) => `Oh, null...` ]; - * - * let fourth = [ (input) => input === undefined, (input) => `notdefined` ]; - * - * let descriptionOf = pattern([ firstTuple, secondTuple, third, fourth ]); - * - * console.log(descriptionOf(undefined)); // 'notdefined' - * console.log(descriptionOf(55)); // '(55) That's a number!' - * console.log(descriptionOf("foo")); // 'Here's your string foo' - * ``` - * - * @param struct A 2D array. Each element of the array should be an array, a 2-tuple, - * with a Predicate and a mapping/output function - * @returns {function(any): *} - */ -function pattern(struct) { - return function (x) { - for (var i = 0; i < struct.length; i++) { - if (struct[i][0](x)) - return struct[i][1](x); - } - }; -} - -/** - * @coreapi - * @module core - */ -/** - * Matches state names using glob-like pattern strings. - * - * Globs can be used in specific APIs including: - * - * - [[StateService.is]] - * - [[StateService.includes]] - * - The first argument to Hook Registration functions like [[TransitionService.onStart]] - * - [[HookMatchCriteria]] and [[HookMatchCriterion]] - * - * A `Glob` string is a pattern which matches state names. - * Nested state names are split into segments (separated by a dot) when processing. - * The state named `foo.bar.baz` is split into three segments ['foo', 'bar', 'baz'] - * - * Globs work according to the following rules: - * - * ### Exact match: - * - * The glob `'A.B'` matches the state named exactly `'A.B'`. - * - * | Glob |Matches states named|Does not match state named| - * |:------------|:--------------------|:---------------------| - * | `'A'` | `'A'` | `'B'` , `'A.C'` | - * | `'A.B'` | `'A.B'` | `'A'` , `'A.B.C'` | - * | `'foo'` | `'foo'` | `'FOO'` , `'foo.bar'`| - * - * ### Single star (`*`) - * - * A single star (`*`) is a wildcard that matches exactly one segment. - * - * | Glob |Matches states named |Does not match state named | - * |:------------|:---------------------|:--------------------------| - * | `'*'` | `'A'` , `'Z'` | `'A.B'` , `'Z.Y.X'` | - * | `'A.*'` | `'A.B'` , `'A.C'` | `'A'` , `'A.B.C'` | - * | `'A.*.*'` | `'A.B.C'` , `'A.X.Y'`| `'A'`, `'A.B'` , `'Z.Y.X'`| - * - * ### Double star (`**`) - * - * A double star (`'**'`) is a wildcard that matches *zero or more segments* - * - * | Glob |Matches states named |Does not match state named | - * |:------------|:----------------------------------------------|:----------------------------------| - * | `'**'` | `'A'` , `'A.B'`, `'Z.Y.X'` | (matches all states) | - * | `'A.**'` | `'A'` , `'A.B'` , `'A.C.X'` | `'Z.Y.X'` | - * | `'**.X'` | `'X'` , `'A.X'` , `'Z.Y.X'` | `'A'` , `'A.login.Z'` | - * | `'A.**.X'` | `'A.X'` , `'A.B.X'` , `'A.B.C.X'` | `'A'` , `'A.B.C'` | - * - */ -var Glob = (function () { - function Glob(text) { - this.text = text; - this.glob = text.split('.'); - var regexpString = this.text.split('.') - .map(function (seg) { - if (seg === '**') - return '(?:|(?:\\.[^.]*)*)'; - if (seg === '*') - return '\\.[^.]*'; - return '\\.' + seg; - }).join(''); - this.regexp = new RegExp("^" + regexpString + "$"); - } - Glob.prototype.matches = function (name) { - return this.regexp.test('.' + name); - }; - /** Returns true if the string has glob-like characters in it */ - Glob.is = function (text) { - return !!/[!,*]+/.exec(text); - }; - /** Returns a glob from the string, or null if the string isn't Glob-like */ - Glob.fromString = function (text) { - return Glob.is(text) ? new Glob(text) : null; - }; - return Glob; -}()); - -/** - * Internal representation of a UI-Router state. - * - * Instances of this class are created when a [[StateDeclaration]] is registered with the [[StateRegistry]]. - * - * A registered [[StateDeclaration]] is augmented with a getter ([[StateDeclaration.$$state]]) which returns the corresponding [[StateObject]] object. - * - * This class prototypally inherits from the corresponding [[StateDeclaration]]. - * Each of its own properties (i.e., `hasOwnProperty`) are built using builders from the [[StateBuilder]]. - */ -var StateObject = (function () { - /** @deprecated use State.create() */ - function StateObject(config) { - return StateObject.create(config || {}); - } - /** - * Create a state object to put the private/internal implementation details onto. - * The object's prototype chain looks like: - * (Internal State Object) -> (Copy of State.prototype) -> (State Declaration object) -> (State Declaration's prototype...) - * - * @param stateDecl the user-supplied State Declaration - * @returns {StateObject} an internal State object - */ - StateObject.create = function (stateDecl) { - stateDecl = StateObject.isStateClass(stateDecl) ? new stateDecl() : stateDecl; - var state = inherit(inherit(stateDecl, StateObject.prototype)); - stateDecl.$$state = function () { return state; }; - state.self = stateDecl; - state.__stateObjectCache = { - nameGlob: Glob.fromString(state.name) // might return null - }; - return state; - }; - /** - * Returns true if the provided parameter is the same state. - * - * Compares the identity of the state against the passed value, which is either an object - * reference to the actual `State` instance, the original definition object passed to - * `$stateProvider.state()`, or the fully-qualified name. - * - * @param ref Can be one of (a) a `State` instance, (b) an object that was passed - * into `$stateProvider.state()`, (c) the fully-qualified name of a state as a string. - * @returns Returns `true` if `ref` matches the current `State` instance. - */ - StateObject.prototype.is = function (ref) { - return this === ref || this.self === ref || this.fqn() === ref; - }; - /** - * @deprecated this does not properly handle dot notation - * @returns Returns a dot-separated name of the state. - */ - StateObject.prototype.fqn = function () { - if (!this.parent || !(this.parent instanceof this.constructor)) - return this.name; - var name = this.parent.fqn(); - return name ? name + "." + this.name : this.name; - }; - /** - * Returns the root node of this state's tree. - * - * @returns The root of this state's tree. - */ - StateObject.prototype.root = function () { - return this.parent && this.parent.root() || this; - }; - /** - * Gets the state's `Param` objects - * - * Gets the list of [[Param]] objects owned by the state. - * If `opts.inherit` is true, it also includes the ancestor states' [[Param]] objects. - * If `opts.matchingKeys` exists, returns only `Param`s whose `id` is a key on the `matchingKeys` object - * - * @param opts options - */ - StateObject.prototype.parameters = function (opts) { - opts = defaults(opts, { inherit: true, matchingKeys: null }); - var inherited = opts.inherit && this.parent && this.parent.parameters() || []; - return inherited.concat(values(this.params)) - .filter(function (param) { return !opts.matchingKeys || opts.matchingKeys.hasOwnProperty(param.id); }); - }; - /** - * Returns a single [[Param]] that is owned by the state - * - * If `opts.inherit` is true, it also searches the ancestor states` [[Param]]s. - * @param id the name of the [[Param]] to return - * @param opts options - */ - StateObject.prototype.parameter = function (id, opts) { - if (opts === void 0) { opts = {}; } - return (this.url && this.url.parameter(id, opts) || - find(values(this.params), propEq('id', id)) || - opts.inherit && this.parent && this.parent.parameter(id)); - }; - StateObject.prototype.toString = function () { - return this.fqn(); - }; - return StateObject; -}()); -/** Predicate which returns true if the object is an class with @State() decorator */ -StateObject.isStateClass = function (stateDecl) { - return isFunction(stateDecl) && stateDecl['__uiRouterState'] === true; -}; -/** Predicate which returns true if the object is an internal [[StateObject]] object */ -StateObject.isState = function (obj) { - return isObject(obj['__stateObjectCache']); -}; - -/** Predicates - * - * These predicates return true/false based on the input. - * Although these functions are exported, they are subject to change without notice. - * - * @module common_predicates - */ -/** */ -var toStr = Object.prototype.toString; -var tis = function (t) { return function (x) { return typeof (x) === t; }; }; -var isUndefined = tis('undefined'); -var isDefined = not(isUndefined); -var isNull = function (o) { return o === null; }; -var isNullOrUndefined = or(isNull, isUndefined); -var isFunction = tis('function'); -var isNumber = tis('number'); -var isString = tis('string'); -var isObject = function (x) { return x !== null && typeof x === 'object'; }; -var isArray = Array.isArray; -var isDate = (function (x) { return toStr.call(x) === '[object Date]'; }); -var isRegExp = (function (x) { return toStr.call(x) === '[object RegExp]'; }); -var isState = StateObject.isState; -/** - * Predicate which checks if a value is injectable - * - * A value is "injectable" if it is a function, or if it is an ng1 array-notation-style array - * where all the elements in the array are Strings, except the last one, which is a Function - */ -function isInjectable(val$$1) { - if (isArray(val$$1) && val$$1.length) { - var head = val$$1.slice(0, -1), tail = val$$1.slice(-1); - return !(head.filter(not(isString)).length || tail.filter(not(isFunction)).length); - } - return isFunction(val$$1); -} -/** - * Predicate which checks if a value looks like a Promise - * - * It is probably a Promise if it's an object, and it has a `then` property which is a Function - */ -var isPromise = and(isObject, pipe(prop('then'), isFunction)); - -var notImplemented = function (fnname) { return function () { - throw new Error(fnname + "(): No coreservices implementation for UI-Router is loaded."); -}; }; -var services = { - $q: undefined, - $injector: undefined, -}; - -/** - * Random utility functions used in the UI-Router code - * - * These functions are exported, but are subject to change without notice. - * - * @preferred - * @module common - */ -/** for typedoc */ -var w = typeof window === 'undefined' ? {} : window; -var angular$1 = w.angular || {}; -var fromJson = angular$1.fromJson || JSON.parse.bind(JSON); -var toJson = angular$1.toJson || JSON.stringify.bind(JSON); -var copy = angular$1.copy || _copy; -var forEach = angular$1.forEach || _forEach; -var extend = Object.assign || _extend; -var equals = angular$1.equals || _equals; -function identity(x) { return x; } -function noop$1() { } -/** - * Builds proxy functions on the `to` object which pass through to the `from` object. - * - * For each key in `fnNames`, creates a proxy function on the `to` object. - * The proxy function calls the real function on the `from` object. - * - * - * #### Example: - * This example creates an new class instance whose functions are prebound to the new'd object. - * ```js - * class Foo { - * constructor(data) { - * // Binds all functions from Foo.prototype to 'this', - * // then copies them to 'this' - * bindFunctions(Foo.prototype, this, this); - * this.data = data; - * } - * - * log() { - * console.log(this.data); - * } - * } - * - * let myFoo = new Foo([1,2,3]); - * var logit = myFoo.log; - * logit(); // logs [1, 2, 3] from the myFoo 'this' instance - * ``` - * - * #### Example: - * This example creates a bound version of a service function, and copies it to another object - * ``` - * - * var SomeService = { - * this.data = [3, 4, 5]; - * this.log = function() { - * console.log(this.data); - * } - * } - * - * // Constructor fn - * function OtherThing() { - * // Binds all functions from SomeService to SomeService, - * // then copies them to 'this' - * bindFunctions(SomeService, this, SomeService); - * } - * - * let myOtherThing = new OtherThing(); - * myOtherThing.log(); // logs [3, 4, 5] from SomeService's 'this' - * ``` - * - * @param source A function that returns the source object which contains the original functions to be bound - * @param target A function that returns the target object which will receive the bound functions - * @param bind A function that returns the object which the functions will be bound to - * @param fnNames The function names which will be bound (Defaults to all the functions found on the 'from' object) - * @param latebind If true, the binding of the function is delayed until the first time it's invoked - */ -function createProxyFunctions(source, target, bind, fnNames, latebind) { - if (latebind === void 0) { latebind = false; } - var bindFunction = function (fnName) { - return source()[fnName].bind(bind()); - }; - var makeLateRebindFn = function (fnName) { return function lateRebindFunction() { - target[fnName] = bindFunction(fnName); - return target[fnName].apply(null, arguments); - }; }; - fnNames = fnNames || Object.keys(source()); - return fnNames.reduce(function (acc, name) { - acc[name] = latebind ? makeLateRebindFn(name) : bindFunction(name); - return acc; - }, target); -} -/** - * prototypal inheritance helper. - * Creates a new object which has `parent` object as its prototype, and then copies the properties from `extra` onto it - */ -var inherit = function (parent, extra) { - return extend(Object.create(parent), extra); -}; -/** Given an array, returns true if the object is found in the array, (using indexOf) */ -var inArray = curry(_inArray); -function _inArray(array, obj) { - return array.indexOf(obj) !== -1; -} -/** - * Given an array, and an item, if the item is found in the array, it removes it (in-place). - * The same array is returned - */ -var removeFrom = curry(_removeFrom); -function _removeFrom(array, obj) { - var idx = array.indexOf(obj); - if (idx >= 0) - array.splice(idx, 1); - return array; -} -/** pushes a values to an array and returns the value */ -var pushTo = curry(_pushTo); -function _pushTo(arr, val$$1) { - return (arr.push(val$$1), val$$1); -} -/** Given an array of (deregistration) functions, calls all functions and removes each one from the source array */ -var deregAll = function (functions) { - return functions.slice().forEach(function (fn) { - typeof fn === 'function' && fn(); - removeFrom(functions, fn); - }); -}; -/** - * Applies a set of defaults to an options object. The options object is filtered - * to only those properties of the objects in the defaultsList. - * Earlier objects in the defaultsList take precedence when applying defaults. - */ -function defaults(opts) { - var defaultsList = []; - for (var _i = 1; _i < arguments.length; _i++) { - defaultsList[_i - 1] = arguments[_i]; - } - var _defaultsList = defaultsList.concat({}).reverse(); - var defaultVals = extend.apply(null, _defaultsList); - return extend({}, defaultVals, pick(opts || {}, Object.keys(defaultVals))); -} -/** Reduce function that merges each element of the list into a single object, using extend */ -var mergeR = function (memo, item) { return extend(memo, item); }; -/** - * Finds the common ancestor path between two states. - * - * @param {Object} first The first state. - * @param {Object} second The second state. - * @return {Array} Returns an array of state names in descending order, not including the root. - */ -function ancestors(first, second) { - var path = []; - for (var n in first.path) { - if (first.path[n] !== second.path[n]) - break; - path.push(first.path[n]); - } - return path; -} -/** - * Return a copy of the object only containing the whitelisted properties. - * - * #### Example: - * ``` - * var foo = { a: 1, b: 2, c: 3 }; - * var ab = pick(foo, ['a', 'b']); // { a: 1, b: 2 } - * ``` - * @param obj the source object - * @param propNames an Array of strings, which are the whitelisted property names - */ -function pick(obj, propNames) { - var objCopy = {}; - for (var prop_1 in obj) { - if (propNames.indexOf(prop_1) !== -1) { - objCopy[prop_1] = obj[prop_1]; - } - } - return objCopy; -} -/** - * Return a copy of the object omitting the blacklisted properties. - * - * @example - * ``` - * - * var foo = { a: 1, b: 2, c: 3 }; - * var ab = omit(foo, ['a', 'b']); // { c: 3 } - * ``` - * @param obj the source object - * @param propNames an Array of strings, which are the blacklisted property names - */ -function omit(obj, propNames) { - return Object.keys(obj) - .filter(not(inArray(propNames))) - .reduce(function (acc, key) { return (acc[key] = obj[key], acc); }, {}); -} -/** - * Maps an array, or object to a property (by name) - */ -function pluck(collection, propName) { - return map(collection, prop(propName)); -} -/** Filters an Array or an Object's properties based on a predicate */ -function filter(collection, callback) { - var arr = isArray(collection), result = arr ? [] : {}; - var accept = arr ? function (x) { return result.push(x); } : function (x, key) { return result[key] = x; }; - forEach(collection, function (item, i) { - if (callback(item, i)) - accept(item, i); - }); - return result; -} -/** Finds an object from an array, or a property of an object, that matches a predicate */ -function find(collection, callback) { - var result; - forEach(collection, function (item, i) { - if (result) - return; - if (callback(item, i)) - result = item; - }); - return result; -} -/** Given an object, returns a new object, where each property is transformed by the callback function */ -var mapObj = map; -/** Maps an array or object properties using a callback function */ -function map(collection, callback) { - var result = isArray(collection) ? [] : {}; - forEach(collection, function (item, i) { return result[i] = callback(item, i); }); - return result; -} -/** - * Given an object, return its enumerable property values - * - * @example - * ``` - * - * let foo = { a: 1, b: 2, c: 3 } - * let vals = values(foo); // [ 1, 2, 3 ] - * ``` - */ -var values = function (obj) { - return Object.keys(obj).map(function (key) { return obj[key]; }); -}; -/** - * Reduce function that returns true if all of the values are truthy. - * - * @example - * ``` - * - * let vals = [ 1, true, {}, "hello world"]; - * vals.reduce(allTrueR, true); // true - * - * vals.push(0); - * vals.reduce(allTrueR, true); // false - * ``` - */ -var allTrueR = function (memo, elem) { return memo && elem; }; -/** - * Reduce function that returns true if any of the values are truthy. - * - * * @example - * ``` - * - * let vals = [ 0, null, undefined ]; - * vals.reduce(anyTrueR, true); // false - * - * vals.push("hello world"); - * vals.reduce(anyTrueR, true); // true - * ``` - */ -var anyTrueR = function (memo, elem) { return memo || elem; }; -/** - * Reduce function which un-nests a single level of arrays - * @example - * ``` - * - * let input = [ [ "a", "b" ], [ "c", "d" ], [ [ "double", "nested" ] ] ]; - * input.reduce(unnestR, []) // [ "a", "b", "c", "d", [ "double, "nested" ] ] - * ``` - */ -var unnestR = function (memo, elem) { return memo.concat(elem); }; -/** - * Reduce function which recursively un-nests all arrays - * - * @example - * ``` - * - * let input = [ [ "a", "b" ], [ "c", "d" ], [ [ "double", "nested" ] ] ]; - * input.reduce(unnestR, []) // [ "a", "b", "c", "d", "double, "nested" ] - * ``` - */ -var flattenR = function (memo, elem) { - return isArray(elem) ? memo.concat(elem.reduce(flattenR, [])) : pushR(memo, elem); -}; -/** - * Reduce function that pushes an object to an array, then returns the array. - * Mostly just for [[flattenR]] and [[uniqR]] - */ -function pushR(arr, obj) { - arr.push(obj); - return arr; -} -/** Reduce function that filters out duplicates */ -var uniqR = function (acc, token) { - return inArray(acc, token) ? acc : pushR(acc, token); -}; -/** - * Return a new array with a single level of arrays unnested. - * - * @example - * ``` - * - * let input = [ [ "a", "b" ], [ "c", "d" ], [ [ "double", "nested" ] ] ]; - * unnest(input) // [ "a", "b", "c", "d", [ "double, "nested" ] ] - * ``` - */ -var unnest = function (arr) { return arr.reduce(unnestR, []); }; -/** - * Return a completely flattened version of an array. - * - * @example - * ``` - * - * let input = [ [ "a", "b" ], [ "c", "d" ], [ [ "double", "nested" ] ] ]; - * flatten(input) // [ "a", "b", "c", "d", "double, "nested" ] - * ``` - */ -var flatten = function (arr) { return arr.reduce(flattenR, []); }; -/** - * Given a .filter Predicate, builds a .filter Predicate which throws an error if any elements do not pass. - * @example - * ``` - * - * let isNumber = (obj) => typeof(obj) === 'number'; - * let allNumbers = [ 1, 2, 3, 4, 5 ]; - * allNumbers.filter(assertPredicate(isNumber)); //OK - * - * let oneString = [ 1, 2, 3, 4, "5" ]; - * oneString.filter(assertPredicate(isNumber, "Not all numbers")); // throws Error(""Not all numbers""); - * ``` - */ -var assertPredicate = assertFn; -/** - * Given a .map function, builds a .map function which throws an error if any mapped elements do not pass a truthyness test. - * @example - * ``` - * - * var data = { foo: 1, bar: 2 }; - * - * let keys = [ 'foo', 'bar' ] - * let values = keys.map(assertMap(key => data[key], "Key not found")); - * // values is [1, 2] - * - * let keys = [ 'foo', 'bar', 'baz' ] - * let values = keys.map(assertMap(key => data[key], "Key not found")); - * // throws Error("Key not found") - * ``` - */ -var assertMap = assertFn; -function assertFn(predicateOrMap, errMsg) { - if (errMsg === void 0) { errMsg = "assert failure"; } - return function (obj) { - var result = predicateOrMap(obj); - if (!result) { - throw new Error(isFunction(errMsg) ? errMsg(obj) : errMsg); - } - return result; - }; -} -/** - * Like _.pairs: Given an object, returns an array of key/value pairs - * - * @example - * ``` - * - * pairs({ foo: "FOO", bar: "BAR }) // [ [ "foo", "FOO" ], [ "bar": "BAR" ] ] - * ``` - */ -var pairs = function (obj) { - return Object.keys(obj).map(function (key) { return [key, obj[key]]; }); -}; -/** - * Given two or more parallel arrays, returns an array of tuples where - * each tuple is composed of [ a[i], b[i], ... z[i] ] - * - * @example - * ``` - * - * let foo = [ 0, 2, 4, 6 ]; - * let bar = [ 1, 3, 5, 7 ]; - * let baz = [ 10, 30, 50, 70 ]; - * arrayTuples(foo, bar); // [ [0, 1], [2, 3], [4, 5], [6, 7] ] - * arrayTuples(foo, bar, baz); // [ [0, 1, 10], [2, 3, 30], [4, 5, 50], [6, 7, 70] ] - * ``` - */ -function arrayTuples() { - var args = []; - for (var _i = 0; _i < arguments.length; _i++) { - args[_i] = arguments[_i]; - } - if (args.length === 0) - return []; - var maxArrayLen = args.reduce(function (min, arr) { return Math.min(arr.length, min); }, 9007199254740991); // aka 2^53 − 1 aka Number.MAX_SAFE_INTEGER - var i, result = []; - for (i = 0; i < maxArrayLen; i++) { - // This is a hot function - // Unroll when there are 1-4 arguments - switch (args.length) { - case 1: - result.push([args[0][i]]); - break; - case 2: - result.push([args[0][i], args[1][i]]); - break; - case 3: - result.push([args[0][i], args[1][i], args[2][i]]); - break; - case 4: - result.push([args[0][i], args[1][i], args[2][i], args[3][i]]); - break; - default: - result.push(args.map(function (array) { return array[i]; })); - break; - } - } - return result; -} -/** - * Reduce function which builds an object from an array of [key, value] pairs. - * - * Each iteration sets the key/val pair on the memo object, then returns the memo for the next iteration. - * - * Each keyValueTuple should be an array with values [ key: string, value: any ] - * - * @example - * ``` - * - * var pairs = [ ["fookey", "fooval"], ["barkey", "barval"] ] - * - * var pairsToObj = pairs.reduce((memo, pair) => applyPairs(memo, pair), {}) - * // pairsToObj == { fookey: "fooval", barkey: "barval" } - * - * // Or, more simply: - * var pairsToObj = pairs.reduce(applyPairs, {}) - * // pairsToObj == { fookey: "fooval", barkey: "barval" } - * ``` - */ -function applyPairs(memo, keyValTuple) { - var key, value; - if (isArray(keyValTuple)) - key = keyValTuple[0], value = keyValTuple[1]; - if (!isString(key)) - throw new Error("invalid parameters to applyPairs"); - memo[key] = value; - return memo; -} -/** Get the last element of an array */ -function tail(arr) { - return arr.length && arr[arr.length - 1] || undefined; -} -/** - * shallow copy from src to dest - * - * note: This is a shallow copy, while angular.copy is a deep copy. - * ui-router uses `copy` only to make copies of state parameters. - */ -function _copy(src, dest) { - if (dest) - Object.keys(dest).forEach(function (key) { return delete dest[key]; }); - if (!dest) - dest = {}; - return extend(dest, src); -} -/** Naive forEach implementation works with Objects or Arrays */ -function _forEach(obj, cb, _this) { - if (isArray(obj)) - return obj.forEach(cb, _this); - Object.keys(obj).forEach(function (key) { return cb(obj[key], key); }); -} -function _extend(toObj) { - for (var i = 1; i < arguments.length; i++) { - var obj = arguments[i]; - if (!obj) - continue; - var keys = Object.keys(obj); - for (var j = 0; j < keys.length; j++) { - toObj[keys[j]] = obj[keys[j]]; - } - } - return toObj; -} -function _equals(o1, o2) { - if (o1 === o2) - return true; - if (o1 === null || o2 === null) - return false; - if (o1 !== o1 && o2 !== o2) - return true; // NaN === NaN - var t1 = typeof o1, t2 = typeof o2; - if (t1 !== t2 || t1 !== 'object') - return false; - var tup = [o1, o2]; - if (all(isArray)(tup)) - return _arraysEq(o1, o2); - if (all(isDate)(tup)) - return o1.getTime() === o2.getTime(); - if (all(isRegExp)(tup)) - return o1.toString() === o2.toString(); - if (all(isFunction)(tup)) - return true; // meh - var predicates = [isFunction, isArray, isDate, isRegExp]; - if (predicates.map(any).reduce(function (b, fn) { return b || !!fn(tup); }, false)) - return false; - var key, keys = {}; - for (key in o1) { - if (!_equals(o1[key], o2[key])) - return false; - keys[key] = true; - } - for (key in o2) { - if (!keys[key]) - return false; - } - return true; -} -function _arraysEq(a1, a2) { - if (a1.length !== a2.length) - return false; - return arrayTuples(a1, a2).reduce(function (b, t) { return b && _equals(t[0], t[1]); }, true); -} -/** - * Create a sort function - * - * Creates a sort function which sorts by a numeric property. - * - * The `propFn` should return the property as a number which can be sorted. - * - * #### Example: - * This example returns the `priority` prop. - * ```js - * var sortfn = sortBy(obj => obj.priority) - * // equivalent to: - * var longhandSortFn = (a, b) => a.priority - b.priority; - * ``` - * - * #### Example: - * This example uses [[prop]] - * ```js - * var sortfn = sortBy(prop('priority')) - * ``` - * - * The `checkFn` can be used to exclude objects from sorting. - * - * #### Example: - * This example only sorts objects with type === 'FOO' - * ```js - * var sortfn = sortBy(prop('priority'), propEq('type', 'FOO')) - * ``` - * - * @param propFn a function that returns the property (as a number) - * @param checkFn a predicate - * - * @return a sort function like: `(a, b) => (checkFn(a) && checkFn(b)) ? propFn(a) - propFn(b) : 0` - */ -var sortBy = function (propFn, checkFn) { - if (checkFn === void 0) { checkFn = val(true); } - return function (a, b) { - return (checkFn(a) && checkFn(b)) ? propFn(a) - propFn(b) : 0; - }; -}; -/** - * Composes a list of sort functions - * - * Creates a sort function composed of multiple sort functions. - * Each sort function is invoked in series. - * The first sort function to return non-zero "wins". - * - * @param sortFns list of sort functions - */ -var composeSort = function () { - var sortFns = []; - for (var _i = 0; _i < arguments.length; _i++) { - sortFns[_i] = arguments[_i]; - } - return function composedSort(a, b) { - return sortFns.reduce(function (prev, fn) { return prev || fn(a, b); }, 0); - }; -}; -// issue #2676 -var silenceUncaughtInPromise = function (promise) { - return promise.catch(function (e) { return 0; }) && promise; -}; -var silentRejection = function (error) { - return silenceUncaughtInPromise(services.$q.reject(error)); -}; - -/** - * @module common - */ /** for typedoc */ -var Queue = (function () { - function Queue(_items, _limit) { - if (_items === void 0) { _items = []; } - if (_limit === void 0) { _limit = null; } - this._items = _items; - this._limit = _limit; - } - Queue.prototype.enqueue = function (item) { - var items = this._items; - items.push(item); - if (this._limit && items.length > this._limit) - items.shift(); - return item; - }; - Queue.prototype.dequeue = function () { - if (this.size()) - return this._items.splice(0, 1)[0]; - }; - Queue.prototype.clear = function () { - var current = this._items; - this._items = []; - return current; - }; - Queue.prototype.size = function () { - return this._items.length; - }; - Queue.prototype.remove = function (item) { - var idx = this._items.indexOf(item); - return idx > -1 && this._items.splice(idx, 1)[0]; - }; - Queue.prototype.peekTail = function () { - return this._items[this._items.length - 1]; - }; - Queue.prototype.peekHead = function () { - if (this.size()) - return this._items[0]; - }; - return Queue; -}()); - -/** - * @coreapi - * @module transition - */ /** for typedoc */ - -(function (RejectType) { - RejectType[RejectType["SUPERSEDED"] = 2] = "SUPERSEDED"; - RejectType[RejectType["ABORTED"] = 3] = "ABORTED"; - RejectType[RejectType["INVALID"] = 4] = "INVALID"; - RejectType[RejectType["IGNORED"] = 5] = "IGNORED"; - RejectType[RejectType["ERROR"] = 6] = "ERROR"; -})(exports.RejectType || (exports.RejectType = {})); -/** @hidden */ var id = 0; -var Rejection = (function () { - function Rejection(type, message, detail) { - this.$id = id++; - this.type = type; - this.message = message; - this.detail = detail; - } - Rejection.prototype.toString = function () { - var detailString = function (d) { - return d && d.toString !== Object.prototype.toString ? d.toString() : stringify(d); - }; - var detail = detailString(this.detail); - var _a = this, $id = _a.$id, type = _a.type, message = _a.message; - return "Transition Rejection($id: " + $id + " type: " + type + ", message: " + message + ", detail: " + detail + ")"; - }; - Rejection.prototype.toPromise = function () { - return extend(silentRejection(this), { _transitionRejection: this }); - }; - /** Returns true if the obj is a rejected promise created from the `asPromise` factory */ - Rejection.isRejectionPromise = function (obj) { - return obj && (typeof obj.then === 'function') && is(Rejection)(obj._transitionRejection); - }; - /** Returns a Rejection due to transition superseded */ - Rejection.superseded = function (detail, options) { - var message = "The transition has been superseded by a different transition"; - var rejection = new Rejection(exports.RejectType.SUPERSEDED, message, detail); - if (options && options.redirected) { - rejection.redirected = true; - } - return rejection; - }; - /** Returns a Rejection due to redirected transition */ - Rejection.redirected = function (detail) { - return Rejection.superseded(detail, { redirected: true }); - }; - /** Returns a Rejection due to invalid transition */ - Rejection.invalid = function (detail) { - var message = "This transition is invalid"; - return new Rejection(exports.RejectType.INVALID, message, detail); - }; - /** Returns a Rejection due to ignored transition */ - Rejection.ignored = function (detail) { - var message = "The transition was ignored"; - return new Rejection(exports.RejectType.IGNORED, message, detail); - }; - /** Returns a Rejection due to aborted transition */ - Rejection.aborted = function (detail) { - var message = "The transition has been aborted"; - return new Rejection(exports.RejectType.ABORTED, message, detail); - }; - /** Returns a Rejection due to aborted transition */ - Rejection.errored = function (detail) { - var message = "The transition errored"; - return new Rejection(exports.RejectType.ERROR, message, detail); - }; - /** - * Returns a Rejection - * - * Normalizes a value as a Rejection. - * If the value is already a Rejection, returns it. - * Otherwise, wraps and returns the value as a Rejection (Rejection type: ERROR). - * - * @returns `detail` if it is already a `Rejection`, else returns an ERROR Rejection. - */ - Rejection.normalize = function (detail) { - return is(Rejection)(detail) ? detail : Rejection.errored(detail); - }; - return Rejection; -}()); - -/** - * # Transition tracing (debug) - * - * Enable transition tracing to print transition information to the console, - * in order to help debug your application. - * Tracing logs detailed information about each Transition to your console. - * - * To enable tracing, import the [[Trace]] singleton and enable one or more categories. - * - * ### ES6 - * ```js - * import {trace} from "ui-router-ng2"; // or "angular-ui-router" - * trace.enable(1, 5); // TRANSITION and VIEWCONFIG - * ``` - * - * ### CJS - * ```js - * let trace = require("angular-ui-router").trace; // or "ui-router-ng2" - * trace.enable("TRANSITION", "VIEWCONFIG"); - * ``` - * - * ### Globals - * ```js - * let trace = window["angular-ui-router"].trace; // or "ui-router-ng2" - * trace.enable(); // Trace everything (very verbose) - * ``` - * - * ### Angular 1: - * ```js - * app.run($trace => $trace.enable()); - * ``` - * - * @coreapi - * @module trace - */ /** for typedoc */ -/** @hidden */ -function uiViewString(viewData) { - if (!viewData) - return 'ui-view (defunct)'; - return "[ui-view#" + viewData.id + " tag " + - ("in template from '" + (viewData.creationContext && viewData.creationContext.name || '(root)') + "' state]: ") + - ("fqn: '" + viewData.fqn + "', ") + - ("name: '" + viewData.name + "@" + viewData.creationContext + "')"); -} -/** @hidden */ -var viewConfigString = function (viewConfig) { - return "[ViewConfig#" + viewConfig.$id + " from '" + (viewConfig.viewDecl.$context.name || '(root)') + "' state]: target ui-view: '" + viewConfig.viewDecl.$uiViewName + "@" + viewConfig.viewDecl.$uiViewContextAnchor + "'"; -}; -/** @hidden */ -function normalizedCat(input) { - return isNumber(input) ? exports.Category[input] : exports.Category[exports.Category[input]]; -} -/** - * Trace categories Enum - * - * Enable or disable a category using [[Trace.enable]] or [[Trace.disable]] - * - * `trace.enable(Category.TRANSITION)` - * - * These can also be provided using a matching string, or position ordinal - * - * `trace.enable("TRANSITION")` - * - * `trace.enable(1)` - */ - -(function (Category) { - Category[Category["RESOLVE"] = 0] = "RESOLVE"; - Category[Category["TRANSITION"] = 1] = "TRANSITION"; - Category[Category["HOOK"] = 2] = "HOOK"; - Category[Category["UIVIEW"] = 3] = "UIVIEW"; - Category[Category["VIEWCONFIG"] = 4] = "VIEWCONFIG"; -})(exports.Category || (exports.Category = {})); -/** @hidden */ var _tid = parse("$id"); -/** @hidden */ var _rid = parse("router.$id"); -/** @hidden */ var transLbl = function (trans) { return "Transition #" + _tid(trans) + "-" + _rid(trans); }; -/** - * Prints UI-Router Transition trace information to the console. - */ -var Trace = (function () { - /** @hidden */ - function Trace() { - /** @hidden */ - this._enabled = {}; - this.approximateDigests = 0; - } - /** @hidden */ - Trace.prototype._set = function (enabled, categories) { - var _this = this; - if (!categories.length) { - categories = Object.keys(exports.Category) - .map(function (k) { return parseInt(k, 10); }) - .filter(function (k) { return !isNaN(k); }) - .map(function (key) { return exports.Category[key]; }); - } - categories.map(normalizedCat).forEach(function (category) { return _this._enabled[category] = enabled; }); - }; - /** - * Enables a trace [[Category]] - * - * ```js - * trace.enable("TRANSITION"); - * ``` - * - * @param categories categories to enable. If `categories` is omitted, all categories are enabled. - * Also takes strings (category name) or ordinal (category position) - */ - Trace.prototype.enable = function () { - var categories = []; - for (var _i = 0; _i < arguments.length; _i++) { - categories[_i] = arguments[_i]; - } - this._set(true, categories); - }; - /** - * Disables a trace [[Category]] - * - * ```js - * trace.disable("VIEWCONFIG"); - * ``` - * - * @param categories categories to disable. If `categories` is omitted, all categories are disabled. - * Also takes strings (category name) or ordinal (category position) - */ - Trace.prototype.disable = function () { - var categories = []; - for (var _i = 0; _i < arguments.length; _i++) { - categories[_i] = arguments[_i]; - } - this._set(false, categories); - }; - /** - * Retrieves the enabled stateus of a [[Category]] - * - * ```js - * trace.enabled("VIEWCONFIG"); // true or false - * ``` - * - * @returns boolean true if the category is enabled - */ - Trace.prototype.enabled = function (category) { - return !!this._enabled[normalizedCat(category)]; - }; - /** @internalapi called by ui-router code */ - Trace.prototype.traceTransitionStart = function (trans) { - if (!this.enabled(exports.Category.TRANSITION)) - return; - console.log(transLbl(trans) + ": Started -> " + stringify(trans)); - }; - /** @internalapi called by ui-router code */ - Trace.prototype.traceTransitionIgnored = function (trans) { - if (!this.enabled(exports.Category.TRANSITION)) - return; - console.log(transLbl(trans) + ": Ignored <> " + stringify(trans)); - }; - /** @internalapi called by ui-router code */ - Trace.prototype.traceHookInvocation = function (step, trans, options) { - if (!this.enabled(exports.Category.HOOK)) - return; - var event = parse("traceData.hookType")(options) || "internal", context = parse("traceData.context.state.name")(options) || parse("traceData.context")(options) || "unknown", name = functionToString(step.registeredHook.callback); - console.log(transLbl(trans) + ": Hook -> " + event + " context: " + context + ", " + maxLength(200, name)); - }; - /** @internalapi called by ui-router code */ - Trace.prototype.traceHookResult = function (hookResult, trans, transitionOptions) { - if (!this.enabled(exports.Category.HOOK)) - return; - console.log(transLbl(trans) + ": <- Hook returned: " + maxLength(200, stringify(hookResult))); - }; - /** @internalapi called by ui-router code */ - Trace.prototype.traceResolvePath = function (path, when, trans) { - if (!this.enabled(exports.Category.RESOLVE)) - return; - console.log(transLbl(trans) + ": Resolving " + path + " (" + when + ")"); - }; - /** @internalapi called by ui-router code */ - Trace.prototype.traceResolvableResolved = function (resolvable, trans) { - if (!this.enabled(exports.Category.RESOLVE)) - return; - console.log(transLbl(trans) + ": <- Resolved " + resolvable + " to: " + maxLength(200, stringify(resolvable.data))); - }; - /** @internalapi called by ui-router code */ - Trace.prototype.traceError = function (reason, trans) { - if (!this.enabled(exports.Category.TRANSITION)) - return; - console.log(transLbl(trans) + ": <- Rejected " + stringify(trans) + ", reason: " + reason); - }; - /** @internalapi called by ui-router code */ - Trace.prototype.traceSuccess = function (finalState, trans) { - if (!this.enabled(exports.Category.TRANSITION)) - return; - console.log(transLbl(trans) + ": <- Success " + stringify(trans) + ", final state: " + finalState.name); - }; - /** @internalapi called by ui-router code */ - Trace.prototype.traceUIViewEvent = function (event, viewData, extra) { - if (extra === void 0) { extra = ""; } - if (!this.enabled(exports.Category.UIVIEW)) - return; - console.log("ui-view: " + padString(30, event) + " " + uiViewString(viewData) + extra); - }; - /** @internalapi called by ui-router code */ - Trace.prototype.traceUIViewConfigUpdated = function (viewData, context) { - if (!this.enabled(exports.Category.UIVIEW)) - return; - this.traceUIViewEvent("Updating", viewData, " with ViewConfig from context='" + context + "'"); - }; - /** @internalapi called by ui-router code */ - Trace.prototype.traceUIViewFill = function (viewData, html) { - if (!this.enabled(exports.Category.UIVIEW)) - return; - this.traceUIViewEvent("Fill", viewData, " with: " + maxLength(200, html)); - }; - /** @internalapi called by ui-router code */ - Trace.prototype.traceViewServiceEvent = function (event, viewConfig) { - if (!this.enabled(exports.Category.VIEWCONFIG)) - return; - console.log("VIEWCONFIG: " + event + " " + viewConfigString(viewConfig)); - }; - /** @internalapi called by ui-router code */ - Trace.prototype.traceViewServiceUIViewEvent = function (event, viewData) { - if (!this.enabled(exports.Category.VIEWCONFIG)) - return; - console.log("VIEWCONFIG: " + event + " " + uiViewString(viewData)); - }; - return Trace; -}()); -/** - * The [[Trace]] singleton - * - * #### Example: - * ```js - * import {trace} from "angular-ui-router"; - * trace.enable(1, 5); - * ``` - */ -var trace = new Trace(); - -(function (TransitionHookPhase) { - TransitionHookPhase[TransitionHookPhase["CREATE"] = 0] = "CREATE"; - TransitionHookPhase[TransitionHookPhase["BEFORE"] = 1] = "BEFORE"; - TransitionHookPhase[TransitionHookPhase["RUN"] = 2] = "RUN"; - TransitionHookPhase[TransitionHookPhase["SUCCESS"] = 3] = "SUCCESS"; - TransitionHookPhase[TransitionHookPhase["ERROR"] = 4] = "ERROR"; -})(exports.TransitionHookPhase || (exports.TransitionHookPhase = {})); - -(function (TransitionHookScope) { - TransitionHookScope[TransitionHookScope["TRANSITION"] = 0] = "TRANSITION"; - TransitionHookScope[TransitionHookScope["STATE"] = 1] = "STATE"; -})(exports.TransitionHookScope || (exports.TransitionHookScope = {})); - -/** - * @coreapi - * @module state - */ /** for typedoc */ -/** - * Encapsulate the target (destination) state/params/options of a [[Transition]]. - * - * This class is frequently used to redirect a transition to a new destination. - * - * See: - * - * - [[HookResult]] - * - [[TransitionHookFn]] - * - [[TransitionService.onStart]] - * - * To create a `TargetState`, use [[StateService.target]]. - * - * --- - * - * This class wraps: - * - * 1) an identifier for a state - * 2) a set of parameters - * 3) and transition options - * 4) the registered state object (the [[StateDeclaration]]) - * - * Many UI-Router APIs such as [[StateService.go]] take a [[StateOrName]] argument which can - * either be a *state object* (a [[StateDeclaration]] or [[StateObject]]) or a *state name* (a string). - * The `TargetState` class normalizes those options. - * - * A `TargetState` may be valid (the state being targeted exists in the registry) - * or invalid (the state being targeted is not registered). - */ -var TargetState = (function () { - /** - * The TargetState constructor - * - * Note: Do not construct a `TargetState` manually. - * To create a `TargetState`, use the [[StateService.target]] factory method. - * - * @param _identifier An identifier for a state. - * Either a fully-qualified state name, or the object used to define the state. - * @param _definition The internal state representation, if exists. - * @param _params Parameters for the target state - * @param _options Transition options. - * - * @internalapi - */ - function TargetState(_identifier, _definition, _params, _options) { - if (_options === void 0) { _options = {}; } - this._identifier = _identifier; - this._definition = _definition; - this._options = _options; - this._params = _params || {}; - } - /** The name of the state this object targets */ - TargetState.prototype.name = function () { - return this._definition && this._definition.name || this._identifier; - }; - /** The identifier used when creating this TargetState */ - TargetState.prototype.identifier = function () { - return this._identifier; - }; - /** The target parameter values */ - TargetState.prototype.params = function () { - return this._params; - }; - /** The internal state object (if it was found) */ - TargetState.prototype.$state = function () { - return this._definition; - }; - /** The internal state declaration (if it was found) */ - TargetState.prototype.state = function () { - return this._definition && this._definition.self; - }; - /** The target options */ - TargetState.prototype.options = function () { - return this._options; - }; - /** True if the target state was found */ - TargetState.prototype.exists = function () { - return !!(this._definition && this._definition.self); - }; - /** True if the object is valid */ - TargetState.prototype.valid = function () { - return !this.error(); - }; - /** If the object is invalid, returns the reason why */ - TargetState.prototype.error = function () { - var base = this.options().relative; - if (!this._definition && !!base) { - var stateName = base.name ? base.name : base; - return "Could not resolve '" + this.name() + "' from state '" + stateName + "'"; - } - if (!this._definition) - return "No such state '" + this.name() + "'"; - if (!this._definition.self) - return "State '" + this.name() + "' has an invalid definition"; - }; - TargetState.prototype.toString = function () { - return "'" + this.name() + "'" + toJson(this.params()); - }; - return TargetState; -}()); -/** Returns true if the object has a state property that might be a state or state name */ -TargetState.isDef = function (obj) { - return obj && obj.state && (isString(obj.state) || isString(obj.state.name)); -}; - -/** - * @coreapi - * @module transition - */ -/** for typedoc */ -var defaultOptions = { - current: noop$1, - transition: null, - traceData: {}, - bind: null, -}; -/** @hidden */ -var TransitionHook = (function () { - function TransitionHook(transition, stateContext, registeredHook, options) { - var _this = this; - this.transition = transition; - this.stateContext = stateContext; - this.registeredHook = registeredHook; - this.options = options; - this.isSuperseded = function () { - return _this.type.hookPhase === exports.TransitionHookPhase.RUN && !_this.options.transition.isActive(); - }; - this.options = defaults(options, defaultOptions); - this.type = registeredHook.eventType; - } - TransitionHook.prototype.logError = function (err) { - this.transition.router.stateService.defaultErrorHandler()(err); - }; - TransitionHook.prototype.invokeHook = function () { - var _this = this; - var hook = this.registeredHook; - if (hook._deregistered) - return; - var notCurrent = this.getNotCurrentRejection(); - if (notCurrent) - return notCurrent; - var options = this.options; - trace.traceHookInvocation(this, this.transition, options); - var invokeCallback = function () { - return hook.callback.call(options.bind, _this.transition, _this.stateContext); - }; - var normalizeErr = function (err) { - return Rejection.normalize(err).toPromise(); - }; - var handleError = function (err) { - return hook.eventType.getErrorHandler(_this)(err); - }; - var handleResult = function (result) { - return hook.eventType.getResultHandler(_this)(result); - }; - try { - var result = invokeCallback(); - if (!this.type.synchronous && isPromise(result)) { - return result.catch(normalizeErr) - .then(handleResult, handleError); - } - else { - return handleResult(result); - } - } - catch (err) { - // If callback throws (synchronously) - return handleError(Rejection.normalize(err)); - } - }; - /** - * This method handles the return value of a Transition Hook. - * - * A hook can return false (cancel), a TargetState (redirect), - * or a promise (which may later resolve to false or a redirect) - * - * This also handles "transition superseded" -- when a new transition - * was started while the hook was still running - */ - TransitionHook.prototype.handleHookResult = function (result) { - var _this = this; - var notCurrent = this.getNotCurrentRejection(); - if (notCurrent) - return notCurrent; - // Hook returned a promise - if (isPromise(result)) { - // Wait for the promise, then reprocess with the resulting value - return result.then(function (val$$1) { return _this.handleHookResult(val$$1); }); - } - trace.traceHookResult(result, this.transition, this.options); - // Hook returned false - if (result === false) { - // Abort this Transition - return Rejection.aborted("Hook aborted transition").toPromise(); - } - var isTargetState = is(TargetState); - // hook returned a TargetState - if (isTargetState(result)) { - // Halt the current Transition and redirect (a new Transition) to the TargetState. - return Rejection.redirected(result).toPromise(); - } - }; - /** - * Return a Rejection promise if the transition is no longer current due - * to a stopped router (disposed), or a new transition has started and superseded this one. - */ - TransitionHook.prototype.getNotCurrentRejection = function () { - var router = this.transition.router; - // The router is stopped - if (router._disposed) { - return Rejection.aborted("UIRouter instance #" + router.$id + " has been stopped (disposed)").toPromise(); - } - if (this.transition._aborted) { - return Rejection.aborted().toPromise(); - } - // This transition is no longer current. - // Another transition started while this hook was still running. - if (this.isSuperseded()) { - // Abort this transition - return Rejection.superseded(this.options.current()).toPromise(); - } - }; - TransitionHook.prototype.toString = function () { - var _a = this, options = _a.options, registeredHook = _a.registeredHook; - var event = parse("traceData.hookType")(options) || "internal", context = parse("traceData.context.state.name")(options) || parse("traceData.context")(options) || "unknown", name = fnToString(registeredHook.callback); - return event + " context: " + context + ", " + maxLength(200, name); - }; - /** - * Chains together an array of TransitionHooks. - * - * Given a list of [[TransitionHook]] objects, chains them together. - * Each hook is invoked after the previous one completes. - * - * #### Example: - * ```js - * var hooks: TransitionHook[] = getHooks(); - * let promise: Promise = TransitionHook.chain(hooks); - * - * promise.then(handleSuccess, handleError); - * ``` - * - * @param hooks the list of hooks to chain together - * @param waitFor if provided, the chain is `.then()`'ed off this promise - * @returns a `Promise` for sequentially invoking the hooks (in order) - */ - TransitionHook.chain = function (hooks, waitFor) { - // Chain the next hook off the previous - var createHookChainR = function (prev, nextHook) { - return prev.then(function () { return nextHook.invokeHook(); }); - }; - return hooks.reduce(createHookChainR, waitFor || services.$q.when()); - }; - /** - * Invokes all the provided TransitionHooks, in order. - * Each hook's return value is checked. - * If any hook returns a promise, then the rest of the hooks are chained off that promise, and the promise is returned. - * If no hook returns a promise, then all hooks are processed synchronously. - * - * @param hooks the list of TransitionHooks to invoke - * @param doneCallback a callback that is invoked after all the hooks have successfully completed - * - * @returns a promise for the async result, or the result of the callback - */ - TransitionHook.invokeHooks = function (hooks, doneCallback) { - for (var idx = 0; idx < hooks.length; idx++) { - var hookResult = hooks[idx].invokeHook(); - if (isPromise(hookResult)) { - var remainingHooks = hooks.slice(idx + 1); - return TransitionHook.chain(remainingHooks, hookResult) - .then(doneCallback); - } - } - return doneCallback(); - }; - /** - * Run all TransitionHooks, ignoring their return value. - */ - TransitionHook.runAllHooks = function (hooks) { - hooks.forEach(function (hook) { return hook.invokeHook(); }); - }; - return TransitionHook; -}()); -/** - * These GetResultHandler(s) are used by [[invokeHook]] below - * Each HookType chooses a GetResultHandler (See: [[TransitionService._defineCoreEvents]]) - */ -TransitionHook.HANDLE_RESULT = function (hook) { return function (result) { - return hook.handleHookResult(result); -}; }; -/** - * If the result is a promise rejection, log it. - * Otherwise, ignore the result. - */ -TransitionHook.LOG_REJECTED_RESULT = function (hook) { return function (result) { - isPromise(result) && result.catch(function (err) { - return hook.logError(Rejection.normalize(err)); - }); - return undefined; -}; }; -/** - * These GetErrorHandler(s) are used by [[invokeHook]] below - * Each HookType chooses a GetErrorHandler (See: [[TransitionService._defineCoreEvents]]) - */ -TransitionHook.LOG_ERROR = function (hook) { return function (error) { - return hook.logError(error); -}; }; -TransitionHook.REJECT_ERROR = function (hook) { return function (error) { - return silentRejection(error); -}; }; -TransitionHook.THROW_ERROR = function (hook) { return function (error) { - throw error; -}; }; - -/** - * @coreapi - * @module transition - */ /** for typedoc */ -/** - * Determines if the given state matches the matchCriteria - * - * @hidden - * - * @param state a State Object to test against - * @param criterion - * - If a string, matchState uses the string as a glob-matcher against the state name - * - If an array (of strings), matchState uses each string in the array as a glob-matchers against the state name - * and returns a positive match if any of the globs match. - * - If a function, matchState calls the function with the state and returns true if the function's result is truthy. - * @returns {boolean} - */ -function matchState(state, criterion) { - var toMatch = isString(criterion) ? [criterion] : criterion; - function matchGlobs(_state) { - var globStrings = toMatch; - for (var i = 0; i < globStrings.length; i++) { - var glob = new Glob(globStrings[i]); - if ((glob && glob.matches(_state.name)) || (!glob && globStrings[i] === _state.name)) { - return true; - } - } - return false; - } - var matchFn = (isFunction(toMatch) ? toMatch : matchGlobs); - return !!matchFn(state); -} -/** - * @internalapi - * The registration data for a registered transition hook - */ -var RegisteredHook = (function () { - function RegisteredHook(tranSvc, eventType, callback, matchCriteria, options) { - if (options === void 0) { options = {}; } - this.tranSvc = tranSvc; - this.eventType = eventType; - this.callback = callback; - this.matchCriteria = matchCriteria; - this.priority = options.priority || 0; - this.bind = options.bind || null; - this._deregistered = false; - } - /** - * Gets the matching [[PathNode]]s - * - * Given an array of [[PathNode]]s, and a [[HookMatchCriterion]], returns an array containing - * the [[PathNode]]s that the criteria matches, or `null` if there were no matching nodes. - * - * Returning `null` is significant to distinguish between the default - * "match-all criterion value" of `true` compared to a `() => true` function, - * when the nodes is an empty array. - * - * This is useful to allow a transition match criteria of `entering: true` - * to still match a transition, even when `entering === []`. Contrast that - * with `entering: (state) => true` which only matches when a state is actually - * being entered. - */ - RegisteredHook.prototype._matchingNodes = function (nodes, criterion) { - if (criterion === true) - return nodes; - var matching = nodes.filter(function (node) { return matchState(node.state, criterion); }); - return matching.length ? matching : null; - }; - /** - * Gets the default match criteria (all `true`) - * - * Returns an object which has all the criteria match paths as keys and `true` as values, i.e.: - * - * ```js - * { - * to: true, - * from: true, - * entering: true, - * exiting: true, - * retained: true, - * } - */ - RegisteredHook.prototype._getDefaultMatchCriteria = function () { - return map(this.tranSvc._pluginapi._getPathTypes(), function () { return true; }); - }; - /** - * Gets matching nodes as [[IMatchingNodes]] - * - * Create a IMatchingNodes object from the TransitionHookTypes that is roughly equivalent to: - * - * ```js - * let matches: IMatchingNodes = { - * to: _matchingNodes([tail(treeChanges.to)], mc.to), - * from: _matchingNodes([tail(treeChanges.from)], mc.from), - * exiting: _matchingNodes(treeChanges.exiting, mc.exiting), - * retained: _matchingNodes(treeChanges.retained, mc.retained), - * entering: _matchingNodes(treeChanges.entering, mc.entering), - * }; - * ``` - */ - RegisteredHook.prototype._getMatchingNodes = function (treeChanges) { - var _this = this; - var criteria = extend(this._getDefaultMatchCriteria(), this.matchCriteria); - var paths = values(this.tranSvc._pluginapi._getPathTypes()); - return paths.reduce(function (mn, pathtype) { - // STATE scope criteria matches against every node in the path. - // TRANSITION scope criteria matches against only the last node in the path - var isStateHook = pathtype.scope === exports.TransitionHookScope.STATE; - var path = treeChanges[pathtype.name] || []; - var nodes = isStateHook ? path : [tail(path)]; - mn[pathtype.name] = _this._matchingNodes(nodes, criteria[pathtype.name]); - return mn; - }, {}); - }; - /** - * Determines if this hook's [[matchCriteria]] match the given [[TreeChanges]] - * - * @returns an IMatchingNodes object, or null. If an IMatchingNodes object is returned, its values - * are the matching [[PathNode]]s for each [[HookMatchCriterion]] (to, from, exiting, retained, entering) - */ - RegisteredHook.prototype.matches = function (treeChanges) { - var matches = this._getMatchingNodes(treeChanges); - // Check if all the criteria matched the TreeChanges object - var allMatched = values(matches).every(identity); - return allMatched ? matches : null; - }; - return RegisteredHook; -}()); -/** @hidden Return a registration function of the requested type. */ -function makeEvent(registry, transitionService, eventType) { - // Create the object which holds the registered transition hooks. - var _registeredHooks = registry._registeredHooks = (registry._registeredHooks || {}); - var hooks = _registeredHooks[eventType.name] = []; - // Create hook registration function on the IHookRegistry for the event - registry[eventType.name] = hookRegistrationFn; - function hookRegistrationFn(matchObject, callback, options) { - if (options === void 0) { options = {}; } - var registeredHook = new RegisteredHook(transitionService, eventType, callback, matchObject, options); - hooks.push(registeredHook); - return function deregisterEventHook() { - registeredHook._deregistered = true; - removeFrom(hooks)(registeredHook); - }; - } - return hookRegistrationFn; -} - -/** - * @coreapi - * @module transition - */ /** for typedoc */ -/** - * This class returns applicable TransitionHooks for a specific Transition instance. - * - * Hooks ([[RegisteredHook]]) may be registered globally, e.g., $transitions.onEnter(...), or locally, e.g. - * myTransition.onEnter(...). The HookBuilder finds matching RegisteredHooks (where the match criteria is - * determined by the type of hook) - * - * The HookBuilder also converts RegisteredHooks objects to TransitionHook objects, which are used to run a Transition. - * - * The HookBuilder constructor is given the $transitions service and a Transition instance. Thus, a HookBuilder - * instance may only be used for one specific Transition object. (side note: the _treeChanges accessor is private - * in the Transition class, so we must also provide the Transition's _treeChanges) - * - */ -var HookBuilder = (function () { - function HookBuilder(transition) { - this.transition = transition; - } - HookBuilder.prototype.buildHooksForPhase = function (phase) { - var _this = this; - var $transitions = this.transition.router.transitionService; - return $transitions._pluginapi._getEvents(phase) - .map(function (type) { return _this.buildHooks(type); }) - .reduce(unnestR, []) - .filter(identity); - }; - /** - * Returns an array of newly built TransitionHook objects. - * - * - Finds all RegisteredHooks registered for the given `hookType` which matched the transition's [[TreeChanges]]. - * - Finds [[PathNode]] (or `PathNode[]`) to use as the TransitionHook context(s) - * - For each of the [[PathNode]]s, creates a TransitionHook - * - * @param hookType the type of the hook registration function, e.g., 'onEnter', 'onFinish'. - */ - HookBuilder.prototype.buildHooks = function (hookType) { - var transition = this.transition; - var treeChanges = transition.treeChanges(); - // Find all the matching registered hooks for a given hook type - var matchingHooks = this.getMatchingHooks(hookType, treeChanges); - if (!matchingHooks) - return []; - var baseHookOptions = { - transition: transition, - current: transition.options().current - }; - var makeTransitionHooks = function (hook) { - // Fetch the Nodes that caused this hook to match. - var matches = hook.matches(treeChanges); - // Select the PathNode[] that will be used as TransitionHook context objects - var matchingNodes = matches[hookType.criteriaMatchPath.name]; - // Return an array of HookTuples - return matchingNodes.map(function (node) { - var _options = extend({ - bind: hook.bind, - traceData: { hookType: hookType.name, context: node } - }, baseHookOptions); - var state = hookType.criteriaMatchPath.scope === exports.TransitionHookScope.STATE ? node.state.self : null; - var transitionHook = new TransitionHook(transition, state, hook, _options); - return { hook: hook, node: node, transitionHook: transitionHook }; - }); - }; - return matchingHooks.map(makeTransitionHooks) - .reduce(unnestR, []) - .sort(tupleSort(hookType.reverseSort)) - .map(function (tuple) { return tuple.transitionHook; }); - }; - /** - * Finds all RegisteredHooks from: - * - The Transition object instance hook registry - * - The TransitionService ($transitions) global hook registry - * - * which matched: - * - the eventType - * - the matchCriteria (to, from, exiting, retained, entering) - * - * @returns an array of matched [[RegisteredHook]]s - */ - HookBuilder.prototype.getMatchingHooks = function (hookType, treeChanges) { - var isCreate = hookType.hookPhase === exports.TransitionHookPhase.CREATE; - // Instance and Global hook registries - var $transitions = this.transition.router.transitionService; - var registries = isCreate ? [$transitions] : [this.transition, $transitions]; - return registries.map(function (reg) { return reg.getHooks(hookType.name); }) // Get named hooks from registries - .filter(assertPredicate(isArray, "broken event named: " + hookType.name)) // Sanity check - .reduce(unnestR, []) // Un-nest RegisteredHook[][] to RegisteredHook[] array - .filter(function (hook) { return hook.matches(treeChanges); }); // Only those satisfying matchCriteria - }; - return HookBuilder; -}()); -/** - * A factory for a sort function for HookTuples. - * - * The sort function first compares the PathNode depth (how deep in the state tree a node is), then compares - * the EventHook priority. - * - * @param reverseDepthSort a boolean, when true, reverses the sort order for the node depth - * @returns a tuple sort function - */ -function tupleSort(reverseDepthSort) { - if (reverseDepthSort === void 0) { reverseDepthSort = false; } - return function nodeDepthThenPriority(l, r) { - var factor = reverseDepthSort ? -1 : 1; - var depthDelta = (l.node.state.path.length - r.node.state.path.length) * factor; - return depthDelta !== 0 ? depthDelta : r.hook.priority - l.hook.priority; - }; -} - -/** - * @coreapi - * @module params - */ -/** */ -/** - * An internal class which implements [[ParamTypeDefinition]]. - * - * A [[ParamTypeDefinition]] is a plain javascript object used to register custom parameter types. - * When a param type definition is registered, an instance of this class is created internally. - * - * This class has naive implementations for all the [[ParamTypeDefinition]] methods. - * - * Used by [[UrlMatcher]] when matching or formatting URLs, or comparing and validating parameter values. - * - * #### Example: - * ```js - * var paramTypeDef = { - * decode: function(val) { return parseInt(val, 10); }, - * encode: function(val) { return val && val.toString(); }, - * equals: function(a, b) { return this.is(a) && a === b; }, - * is: function(val) { return angular.isNumber(val) && isFinite(val) && val % 1 === 0; }, - * pattern: /\d+/ - * } - * - * var paramType = new ParamType(paramTypeDef); - * ``` - * @internalapi - */ -var ParamType = (function () { - /** - * @param def A configuration object which contains the custom type definition. The object's - * properties will override the default methods and/or pattern in `ParamType`'s public interface. - * @returns a new ParamType object - */ - function ParamType(def) { - /** @inheritdoc */ - this.pattern = /.*/; - /** @inheritdoc */ - this.inherit = true; - extend(this, def); - } - // consider these four methods to be "abstract methods" that should be overridden - /** @inheritdoc */ - ParamType.prototype.is = function (val, key) { return true; }; - /** @inheritdoc */ - ParamType.prototype.encode = function (val, key) { return val; }; - /** @inheritdoc */ - ParamType.prototype.decode = function (val, key) { return val; }; - /** @inheritdoc */ - ParamType.prototype.equals = function (a, b) { return a == b; }; - ParamType.prototype.$subPattern = function () { - var sub = this.pattern.toString(); - return sub.substr(1, sub.length - 2); - }; - ParamType.prototype.toString = function () { - return "{ParamType:" + this.name + "}"; - }; - /** Given an encoded string, or a decoded object, returns a decoded object */ - ParamType.prototype.$normalize = function (val) { - return this.is(val) ? val : this.decode(val); - }; - /** - * Wraps an existing custom ParamType as an array of ParamType, depending on 'mode'. - * e.g.: - * - urlmatcher pattern "/path?{queryParam[]:int}" - * - url: "/path?queryParam=1&queryParam=2 - * - $stateParams.queryParam will be [1, 2] - * if `mode` is "auto", then - * - url: "/path?queryParam=1 will create $stateParams.queryParam: 1 - * - url: "/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2] - */ - ParamType.prototype.$asArray = function (mode, isSearch) { - if (!mode) - return this; - if (mode === "auto" && !isSearch) - throw new Error("'auto' array mode is for query parameters only"); - return new ArrayType(this, mode); - }; - return ParamType; -}()); -/** - * Wraps up a `ParamType` object to handle array values. - * @internalapi - */ -function ArrayType(type, mode) { - var _this = this; - // Wrap non-array value as array - function arrayWrap(val) { - return isArray(val) ? val : (isDefined(val) ? [val] : []); - } - // Unwrap array value for "auto" mode. Return undefined for empty array. - function arrayUnwrap(val) { - switch (val.length) { - case 0: return undefined; - case 1: return mode === "auto" ? val[0] : val; - default: return val; - } - } - // Wraps type (.is/.encode/.decode) functions to operate on each value of an array - function arrayHandler(callback, allTruthyMode) { - return function handleArray(val) { - if (isArray(val) && val.length === 0) - return val; - var arr = arrayWrap(val); - var result = map(arr, callback); - return (allTruthyMode === true) ? filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result); - }; - } - // Wraps type (.equals) functions to operate on each value of an array - function arrayEqualsHandler(callback) { - return function handleArray(val1, val2) { - var left = arrayWrap(val1), right = arrayWrap(val2); - if (left.length !== right.length) - return false; - for (var i = 0; i < left.length; i++) { - if (!callback(left[i], right[i])) - return false; - } - return true; - }; - } - ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) { - var paramTypeFn = type[name].bind(type); - var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler; - _this[name] = wrapperFn(paramTypeFn); - }); - extend(this, { - dynamic: type.dynamic, - name: type.name, - pattern: type.pattern, - inherit: type.inherit, - is: arrayHandler(type.is.bind(type), true), - $arrayMode: mode - }); -} - -/** - * @coreapi - * @module params - */ /** for typedoc */ -/** @hidden */ var hasOwn = Object.prototype.hasOwnProperty; -/** @hidden */ var isShorthand = function (cfg) { - return ["value", "type", "squash", "array", "dynamic"].filter(hasOwn.bind(cfg || {})).length === 0; -}; -/** @internalapi */ - -(function (DefType) { - DefType[DefType["PATH"] = 0] = "PATH"; - DefType[DefType["SEARCH"] = 1] = "SEARCH"; - DefType[DefType["CONFIG"] = 2] = "CONFIG"; -})(exports.DefType || (exports.DefType = {})); -/** @hidden */ -function unwrapShorthand(cfg) { - cfg = isShorthand(cfg) && { value: cfg } || cfg; - getStaticDefaultValue['__cacheable'] = true; - function getStaticDefaultValue() { - return cfg.value; - } - return extend(cfg, { - $$fn: isInjectable(cfg.value) ? cfg.value : getStaticDefaultValue, - }); -} -/** @hidden */ -function getType(cfg, urlType, location, id, paramTypes) { - if (cfg.type && urlType && urlType.name !== 'string') - throw new Error("Param '" + id + "' has two type configurations."); - if (cfg.type && urlType && urlType.name === 'string' && paramTypes.type(cfg.type)) - return paramTypes.type(cfg.type); - if (urlType) - return urlType; - if (!cfg.type) { - var type = location === exports.DefType.CONFIG ? "any" : - location === exports.DefType.PATH ? "path" : - location === exports.DefType.SEARCH ? "query" : "string"; - return paramTypes.type(type); - } - return cfg.type instanceof ParamType ? cfg.type : paramTypes.type(cfg.type); -} -/** - * @internalapi - * returns false, true, or the squash value to indicate the "default parameter url squash policy". - */ -function getSquashPolicy(config, isOptional, defaultPolicy) { - var squash = config.squash; - if (!isOptional || squash === false) - return false; - if (!isDefined(squash) || squash == null) - return defaultPolicy; - if (squash === true || isString(squash)) - return squash; - throw new Error("Invalid squash policy: '" + squash + "'. Valid policies: false, true, or arbitrary string"); -} -/** @internalapi */ -function getReplace(config, arrayMode, isOptional, squash) { - var replace, configuredKeys, defaultPolicy = [ - { from: "", to: (isOptional || arrayMode ? undefined : "") }, - { from: null, to: (isOptional || arrayMode ? undefined : "") }, - ]; - replace = isArray(config.replace) ? config.replace : []; - if (isString(squash)) - replace.push({ from: squash, to: undefined }); - configuredKeys = map(replace, prop("from")); - return filter(defaultPolicy, function (item) { return configuredKeys.indexOf(item.from) === -1; }).concat(replace); -} -/** @internalapi */ -var Param = (function () { - function Param(id, type, config, location, urlMatcherFactory) { - config = unwrapShorthand(config); - type = getType(config, type, location, id, urlMatcherFactory.paramTypes); - var arrayMode = getArrayMode(); - type = arrayMode ? type.$asArray(arrayMode, location === exports.DefType.SEARCH) : type; - var isOptional = config.value !== undefined || location === exports.DefType.SEARCH; - var dynamic = isDefined(config.dynamic) ? !!config.dynamic : !!type.dynamic; - var raw = isDefined(config.raw) ? !!config.raw : !!type.raw; - var squash = getSquashPolicy(config, isOptional, urlMatcherFactory.defaultSquashPolicy()); - var replace = getReplace(config, arrayMode, isOptional, squash); - var inherit$$1 = isDefined(config.inherit) ? !!config.inherit : !!type.inherit; - // array config: param name (param[]) overrides default settings. explicit config overrides param name. - function getArrayMode() { - var arrayDefaults = { array: (location === exports.DefType.SEARCH ? "auto" : false) }; - var arrayParamNomenclature = id.match(/\[\]$/) ? { array: true } : {}; - return extend(arrayDefaults, arrayParamNomenclature, config).array; - } - extend(this, { id: id, type: type, location: location, isOptional: isOptional, dynamic: dynamic, raw: raw, squash: squash, replace: replace, inherit: inherit$$1, array: arrayMode, config: config }); - } - Param.prototype.isDefaultValue = function (value) { - return this.isOptional && this.type.equals(this.value(), value); - }; - /** - * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the - * default value, which may be the result of an injectable function. - */ - Param.prototype.value = function (value) { - var _this = this; - /** - * [Internal] Get the default value of a parameter, which may be an injectable function. - */ - var getDefaultValue = function () { - if (_this._defaultValueCache) - return _this._defaultValueCache.defaultValue; - if (!services.$injector) - throw new Error("Injectable functions cannot be called at configuration time"); - var defaultValue = services.$injector.invoke(_this.config.$$fn); - if (defaultValue !== null && defaultValue !== undefined && !_this.type.is(defaultValue)) - throw new Error("Default value (" + defaultValue + ") for parameter '" + _this.id + "' is not an instance of ParamType (" + _this.type.name + ")"); - if (_this.config.$$fn['__cacheable']) { - _this._defaultValueCache = { defaultValue: defaultValue }; - } - return defaultValue; - }; - var replaceSpecialValues = function (val$$1) { - for (var _i = 0, _a = _this.replace; _i < _a.length; _i++) { - var tuple = _a[_i]; - if (tuple.from === val$$1) - return tuple.to; - } - return val$$1; - }; - value = replaceSpecialValues(value); - return isUndefined(value) ? getDefaultValue() : this.type.$normalize(value); - }; - Param.prototype.isSearch = function () { - return this.location === exports.DefType.SEARCH; - }; - Param.prototype.validates = function (value) { - // There was no parameter value, but the param is optional - if ((isUndefined(value) || value === null) && this.isOptional) - return true; - // The value was not of the correct ParamType, and could not be decoded to the correct ParamType - var normalized = this.type.$normalize(value); - if (!this.type.is(normalized)) - return false; - // The value was of the correct type, but when encoded, did not match the ParamType's regexp - var encoded = this.type.encode(normalized); - return !(isString(encoded) && !this.type.pattern.exec(encoded)); - }; - Param.prototype.toString = function () { - return "{Param:" + this.id + " " + this.type + " squash: '" + this.squash + "' optional: " + this.isOptional + "}"; - }; - Param.values = function (params, values$$1) { - if (values$$1 === void 0) { values$$1 = {}; } - var paramValues = {}; - for (var _i = 0, params_1 = params; _i < params_1.length; _i++) { - var param = params_1[_i]; - paramValues[param.id] = param.value(values$$1[param.id]); - } - return paramValues; - }; - /** - * Finds [[Param]] objects which have different param values - * - * Filters a list of [[Param]] objects to only those whose parameter values differ in two param value objects - * - * @param params: The list of Param objects to filter - * @param values1: The first set of parameter values - * @param values2: the second set of parameter values - * - * @returns any Param objects whose values were different between values1 and values2 - */ - Param.changed = function (params, values1, values2) { - if (values1 === void 0) { values1 = {}; } - if (values2 === void 0) { values2 = {}; } - return params.filter(function (param) { return !param.type.equals(values1[param.id], values2[param.id]); }); - }; - /** - * Checks if two param value objects are equal (for a set of [[Param]] objects) - * - * @param params The list of [[Param]] objects to check - * @param values1 The first set of param values - * @param values2 The second set of param values - * - * @returns true if the param values in values1 and values2 are equal - */ - Param.equals = function (params, values1, values2) { - if (values1 === void 0) { values1 = {}; } - if (values2 === void 0) { values2 = {}; } - return Param.changed(params, values1, values2).length === 0; - }; - /** Returns true if a the parameter values are valid, according to the Param definitions */ - Param.validates = function (params, values$$1) { - if (values$$1 === void 0) { values$$1 = {}; } - return params.map(function (param) { return param.validates(values$$1[param.id]); }).reduce(allTrueR, true); - }; - return Param; -}()); - -/** @module path */ /** for typedoc */ -/** - * @internalapi - * - * A node in a [[TreeChanges]] path - * - * For a [[TreeChanges]] path, this class holds the stateful information for a single node in the path. - * Each PathNode corresponds to a state being entered, exited, or retained. - * The stateful information includes parameter values and resolve data. - */ -var PathNode = (function () { - function PathNode(stateOrNode) { - if (stateOrNode instanceof PathNode) { - var node = stateOrNode; - this.state = node.state; - this.paramSchema = node.paramSchema.slice(); - this.paramValues = extend({}, node.paramValues); - this.resolvables = node.resolvables.slice(); - this.views = node.views && node.views.slice(); - } - else { - var state = stateOrNode; - this.state = state; - this.paramSchema = state.parameters({ inherit: false }); - this.paramValues = {}; - this.resolvables = state.resolvables.map(function (res) { return res.clone(); }); - } - } - /** Sets [[paramValues]] for the node, from the values of an object hash */ - PathNode.prototype.applyRawParams = function (params) { - var getParamVal = function (paramDef) { return [paramDef.id, paramDef.value(params[paramDef.id])]; }; - this.paramValues = this.paramSchema.reduce(function (memo, pDef) { return applyPairs(memo, getParamVal(pDef)); }, {}); - return this; - }; - /** Gets a specific [[Param]] metadata that belongs to the node */ - PathNode.prototype.parameter = function (name) { - return find(this.paramSchema, propEq("id", name)); - }; - /** - * @returns true if the state and parameter values for another PathNode are - * equal to the state and param values for this PathNode - */ - PathNode.prototype.equals = function (node, paramsFn) { - var diff = this.diff(node, paramsFn); - return diff && diff.length === 0; - }; - /** - * Finds Params with different parameter values on another PathNode. - * - * Given another node (of the same state), finds the parameter values which differ. - * Returns the [[Param]] (schema objects) whose parameter values differ. - * - * Given another node for a different state, returns `false` - * - * @param node The node to compare to - * @param paramsFn A function that returns which parameters should be compared. - * @returns The [[Param]]s which differ, or null if the two nodes are for different states - */ - PathNode.prototype.diff = function (node, paramsFn) { - if (this.state !== node.state) - return false; - var params = paramsFn ? paramsFn(this) : this.paramSchema; - return Param.changed(params, this.paramValues, node.paramValues); - }; - /** Returns a clone of the PathNode */ - PathNode.clone = function (node) { - return new PathNode(node); - }; - return PathNode; -}()); - -/** @module path */ /** for typedoc */ -/** - * This class contains functions which convert TargetStates, Nodes and paths from one type to another. - */ -var PathUtils = (function () { - function PathUtils() { - } - /** Given a PathNode[], create an TargetState */ - PathUtils.makeTargetState = function (path) { - var state = tail(path).state; - return new TargetState(state, state, path.map(prop("paramValues")).reduce(mergeR, {})); - }; - PathUtils.buildPath = function (targetState) { - var toParams = targetState.params(); - return targetState.$state().path.map(function (state) { return new PathNode(state).applyRawParams(toParams); }); - }; - /** Given a fromPath: PathNode[] and a TargetState, builds a toPath: PathNode[] */ - PathUtils.buildToPath = function (fromPath, targetState) { - var toPath = PathUtils.buildPath(targetState); - if (targetState.options().inherit) { - return PathUtils.inheritParams(fromPath, toPath, Object.keys(targetState.params())); - } - return toPath; - }; - /** - * Creates ViewConfig objects and adds to nodes. - * - * On each [[PathNode]], creates ViewConfig objects from the views: property of the node's state - */ - PathUtils.applyViewConfigs = function ($view, path, states) { - // Only apply the viewConfigs to the nodes for the given states - path.filter(function (node) { return inArray(states, node.state); }).forEach(function (node) { - var viewDecls = values(node.state.views || {}); - var subPath = PathUtils.subPath(path, function (n) { return n === node; }); - var viewConfigs = viewDecls.map(function (view) { return $view.createViewConfig(subPath, view); }); - node.views = viewConfigs.reduce(unnestR, []); - }); - }; - /** - * Given a fromPath and a toPath, returns a new to path which inherits parameters from the fromPath - * - * For a parameter in a node to be inherited from the from path: - * - The toPath's node must have a matching node in the fromPath (by state). - * - The parameter name must not be found in the toKeys parameter array. - * - * Note: the keys provided in toKeys are intended to be those param keys explicitly specified by some - * caller, for instance, $state.transitionTo(..., toParams). If a key was found in toParams, - * it is not inherited from the fromPath. - */ - PathUtils.inheritParams = function (fromPath, toPath, toKeys) { - if (toKeys === void 0) { toKeys = []; } - function nodeParamVals(path, state) { - var node = find(path, propEq('state', state)); - return extend({}, node && node.paramValues); - } - var noInherit = fromPath.map(function (node) { return node.paramSchema; }) - .reduce(unnestR, []) - .filter(function (param) { return !param.inherit; }) - .map(prop('id')); - /** - * Given an [[PathNode]] "toNode", return a new [[PathNode]] with param values inherited from the - * matching node in fromPath. Only inherit keys that aren't found in "toKeys" from the node in "fromPath"" - */ - function makeInheritedParamsNode(toNode) { - // All param values for the node (may include default key/vals, when key was not found in toParams) - var toParamVals = extend({}, toNode && toNode.paramValues); - // limited to only those keys found in toParams - var incomingParamVals = pick(toParamVals, toKeys); - toParamVals = omit(toParamVals, toKeys); - var fromParamVals = omit(nodeParamVals(fromPath, toNode.state) || {}, noInherit); - // extend toParamVals with any fromParamVals, then override any of those those with incomingParamVals - var ownParamVals = extend(toParamVals, fromParamVals, incomingParamVals); - return new PathNode(toNode.state).applyRawParams(ownParamVals); - } - // The param keys specified by the incoming toParams - return toPath.map(makeInheritedParamsNode); - }; - /** - * Computes the tree changes (entering, exiting) between a fromPath and toPath. - */ - PathUtils.treeChanges = function (fromPath, toPath, reloadState) { - var keep = 0, max = Math.min(fromPath.length, toPath.length); - var nodesMatch = function (node1, node2) { - return node1.equals(node2, PathUtils.nonDynamicParams); - }; - while (keep < max && fromPath[keep].state !== reloadState && nodesMatch(fromPath[keep], toPath[keep])) { - keep++; - } - /** Given a retained node, return a new node which uses the to node's param values */ - function applyToParams(retainedNode, idx) { - var cloned = PathNode.clone(retainedNode); - cloned.paramValues = toPath[idx].paramValues; - return cloned; - } - var from, retained, exiting, entering, to; - from = fromPath; - retained = from.slice(0, keep); - exiting = from.slice(keep); - // Create a new retained path (with shallow copies of nodes) which have the params of the toPath mapped - var retainedWithToParams = retained.map(applyToParams); - entering = toPath.slice(keep); - to = (retainedWithToParams).concat(entering); - return { from: from, to: to, retained: retained, exiting: exiting, entering: entering }; - }; - /** - * Returns a new path which is: the subpath of the first path which matches the second path. - * - * The new path starts from root and contains any nodes that match the nodes in the second path. - * It stops before the first non-matching node. - * - * Nodes are compared using their state property and their parameter values. - * If a `paramsFn` is provided, only the [[Param]] returned by the function will be considered when comparing nodes. - * - * @param pathA the first path - * @param pathB the second path - * @param paramsFn a function which returns the parameters to consider when comparing - * - * @returns an array of PathNodes from the first path which match the nodes in the second path - */ - PathUtils.matching = function (pathA, pathB, paramsFn) { - var done = false; - var tuples = arrayTuples(pathA, pathB); - return tuples.reduce(function (matching, _a) { - var nodeA = _a[0], nodeB = _a[1]; - done = done || !nodeA.equals(nodeB, paramsFn); - return done ? matching : matching.concat(nodeA); - }, []); - }; - /** - * Returns true if two paths are identical. - * - * @param pathA - * @param pathB - * @param paramsFn a function which returns the parameters to consider when comparing - * @returns true if the the states and parameter values for both paths are identical - */ - PathUtils.equals = function (pathA, pathB, paramsFn) { - return pathA.length === pathB.length && - PathUtils.matching(pathA, pathB, paramsFn).length === pathA.length; - }; - /** - * Return a subpath of a path, which stops at the first matching node - * - * Given an array of nodes, returns a subset of the array starting from the first node, - * stopping when the first node matches the predicate. - * - * @param path a path of [[PathNode]]s - * @param predicate a [[Predicate]] fn that matches [[PathNode]]s - * @returns a subpath up to the matching node, or undefined if no match is found - */ - PathUtils.subPath = function (path, predicate) { - var node = find(path, predicate); - var elementIdx = path.indexOf(node); - return elementIdx === -1 ? undefined : path.slice(0, elementIdx + 1); - }; - return PathUtils; -}()); -PathUtils.nonDynamicParams = function (node) { - return node.state.parameters({ inherit: false }) - .filter(function (param) { return !param.dynamic; }); -}; -/** Gets the raw parameter values from a path */ -PathUtils.paramValues = function (path) { - return path.reduce(function (acc, node) { return extend(acc, node.paramValues); }, {}); -}; - -/** - * @coreapi - * @module resolve - */ /** for typedoc */ -// TODO: explicitly make this user configurable -var defaultResolvePolicy = { - when: "LAZY", - async: "WAIT" -}; -/** - * The basic building block for the resolve system. - * - * Resolvables encapsulate a state's resolve's resolveFn, the resolveFn's declared dependencies, the wrapped (.promise), - * and the unwrapped-when-complete (.data) result of the resolveFn. - * - * Resolvable.get() either retrieves the Resolvable's existing promise, or else invokes resolve() (which invokes the - * resolveFn) and returns the resulting promise. - * - * Resolvable.get() and Resolvable.resolve() both execute within a context path, which is passed as the first - * parameter to those fns. - */ -var Resolvable = (function () { - function Resolvable(arg1, resolveFn, deps, policy, data) { - this.resolved = false; - this.promise = undefined; - if (arg1 instanceof Resolvable) { - extend(this, arg1); - } - else if (isFunction(resolveFn)) { - if (arg1 == null || arg1 == undefined) - throw new Error("new Resolvable(): token argument is required"); - if (!isFunction(resolveFn)) - throw new Error("new Resolvable(): resolveFn argument must be a function"); - this.token = arg1; - this.policy = policy; - this.resolveFn = resolveFn; - this.deps = deps || []; - this.data = data; - this.resolved = data !== undefined; - this.promise = this.resolved ? services.$q.when(this.data) : undefined; - } - else if (isObject(arg1) && arg1.token && isFunction(arg1.resolveFn)) { - var literal = arg1; - return new Resolvable(literal.token, literal.resolveFn, literal.deps, literal.policy, literal.data); - } - } - Resolvable.prototype.getPolicy = function (state) { - var thisPolicy = this.policy || {}; - var statePolicy = state && state.resolvePolicy || {}; - return { - when: thisPolicy.when || statePolicy.when || defaultResolvePolicy.when, - async: thisPolicy.async || statePolicy.async || defaultResolvePolicy.async, - }; - }; - /** - * Asynchronously resolve this Resolvable's data - * - * Given a ResolveContext that this Resolvable is found in: - * Wait for this Resolvable's dependencies, then invoke this Resolvable's function - * and update the Resolvable's state - */ - Resolvable.prototype.resolve = function (resolveContext, trans) { - var _this = this; - var $q = services.$q; - // Gets all dependencies from ResolveContext and wait for them to be resolved - var getResolvableDependencies = function () { - return $q.all(resolveContext.getDependencies(_this).map(function (resolvable) { - return resolvable.get(resolveContext, trans); - })); - }; - // Invokes the resolve function passing the resolved dependencies as arguments - var invokeResolveFn = function (resolvedDeps) { - return _this.resolveFn.apply(null, resolvedDeps); - }; - /** - * For RXWAIT policy: - * - * Given an observable returned from a resolve function: - * - enables .cache() mode (this allows multicast subscribers) - * - then calls toPromise() (this triggers subscribe() and thus fetches) - * - Waits for the promise, then return the cached observable (not the first emitted value). - */ - var waitForRx = function (observable$) { - var cached = observable$.cache(1); - return cached.take(1).toPromise().then(function () { return cached; }); - }; - // If the resolve policy is RXWAIT, wait for the observable to emit something. otherwise pass through. - var node = resolveContext.findNode(this); - var state = node && node.state; - var maybeWaitForRx = this.getPolicy(state).async === "RXWAIT" ? waitForRx : identity; - // After the final value has been resolved, update the state of the Resolvable - var applyResolvedValue = function (resolvedValue) { - _this.data = resolvedValue; - _this.resolved = true; - trace.traceResolvableResolved(_this, trans); - return _this.data; - }; - // Sets the promise property first, then getsResolvableDependencies in the context of the promise chain. Always waits one tick. - return this.promise = $q.when() - .then(getResolvableDependencies) - .then(invokeResolveFn) - .then(maybeWaitForRx) - .then(applyResolvedValue); - }; - /** - * Gets a promise for this Resolvable's data. - * - * Fetches the data and returns a promise. - * Returns the existing promise if it has already been fetched once. - */ - Resolvable.prototype.get = function (resolveContext, trans) { - return this.promise || this.resolve(resolveContext, trans); - }; - Resolvable.prototype.toString = function () { - return "Resolvable(token: " + stringify(this.token) + ", requires: [" + this.deps.map(stringify) + "])"; - }; - Resolvable.prototype.clone = function () { - return new Resolvable(this); - }; - return Resolvable; -}()); -Resolvable.fromData = function (token, data) { - return new Resolvable(token, function () { return data; }, null, null, data); -}; - -/** @internalapi */ -var resolvePolicies = { - when: { - LAZY: "LAZY", - EAGER: "EAGER" - }, - async: { - WAIT: "WAIT", - NOWAIT: "NOWAIT", - RXWAIT: "RXWAIT" - } -}; - -/** @module resolve */ -/** for typedoc */ -var when = resolvePolicies.when; -var ALL_WHENS = [when.EAGER, when.LAZY]; -var EAGER_WHENS = [when.EAGER]; -var NATIVE_INJECTOR_TOKEN = "Native Injector"; -/** - * Encapsulates Dependency Injection for a path of nodes - * - * UI-Router states are organized as a tree. - * A nested state has a path of ancestors to the root of the tree. - * When a state is being activated, each element in the path is wrapped as a [[PathNode]]. - * A `PathNode` is a stateful object that holds things like parameters and resolvables for the state being activated. - * - * The ResolveContext closes over the [[PathNode]]s, and provides DI for the last node in the path. - */ -var ResolveContext = (function () { - function ResolveContext(_path) { - this._path = _path; - } - /** Gets all the tokens found in the resolve context, de-duplicated */ - ResolveContext.prototype.getTokens = function () { - return this._path.reduce(function (acc, node) { return acc.concat(node.resolvables.map(function (r) { return r.token; })); }, []).reduce(uniqR, []); - }; - /** - * Gets the Resolvable that matches the token - * - * Gets the last Resolvable that matches the token in this context, or undefined. - * Throws an error if it doesn't exist in the ResolveContext - */ - ResolveContext.prototype.getResolvable = function (token) { - var matching = this._path.map(function (node) { return node.resolvables; }) - .reduce(unnestR, []) - .filter(function (r) { return r.token === token; }); - return tail(matching); - }; - /** Returns the [[ResolvePolicy]] for the given [[Resolvable]] */ - ResolveContext.prototype.getPolicy = function (resolvable) { - var node = this.findNode(resolvable); - return resolvable.getPolicy(node.state); - }; - /** - * Returns a ResolveContext that includes a portion of this one - * - * Given a state, this method creates a new ResolveContext from this one. - * The new context starts at the first node (root) and stops at the node for the `state` parameter. - * - * #### Why - * - * When a transition is created, the nodes in the "To Path" are injected from a ResolveContext. - * A ResolveContext closes over a path of [[PathNode]]s and processes the resolvables. - * The "To State" can inject values from its own resolvables, as well as those from all its ancestor state's (node's). - * This method is used to create a narrower context when injecting ancestor nodes. - * - * @example - * `let ABCD = new ResolveContext([A, B, C, D]);` - * - * Given a path `[A, B, C, D]`, where `A`, `B`, `C` and `D` are nodes for states `a`, `b`, `c`, `d`: - * When injecting `D`, `D` should have access to all resolvables from `A`, `B`, `C`, `D`. - * However, `B` should only be able to access resolvables from `A`, `B`. - * - * When resolving for the `B` node, first take the full "To Path" Context `[A,B,C,D]` and limit to the subpath `[A,B]`. - * `let AB = ABCD.subcontext(a)` - */ - ResolveContext.prototype.subContext = function (state) { - return new ResolveContext(PathUtils.subPath(this._path, function (node) { return node.state === state; })); - }; - /** - * Adds Resolvables to the node that matches the state - * - * This adds a [[Resolvable]] (generally one created on the fly; not declared on a [[StateDeclaration.resolve]] block). - * The resolvable is added to the node matching the `state` parameter. - * - * These new resolvables are not automatically fetched. - * The calling code should either fetch them, fetch something that depends on them, - * or rely on [[resolvePath]] being called when some state is being entered. - * - * Note: each resolvable's [[ResolvePolicy]] is merged with the state's policy, and the global default. - * - * @param newResolvables the new Resolvables - * @param state Used to find the node to put the resolvable on - */ - ResolveContext.prototype.addResolvables = function (newResolvables, state) { - var node = find(this._path, propEq('state', state)); - var keys = newResolvables.map(function (r) { return r.token; }); - node.resolvables = node.resolvables.filter(function (r) { return keys.indexOf(r.token) === -1; }).concat(newResolvables); - }; - /** - * Returns a promise for an array of resolved path Element promises - * - * @param when - * @param trans - * @returns {Promise|any} - */ - ResolveContext.prototype.resolvePath = function (when, trans) { - var _this = this; - if (when === void 0) { when = "LAZY"; } - // This option determines which 'when' policy Resolvables we are about to fetch. - var whenOption = inArray(ALL_WHENS, when) ? when : "LAZY"; - // If the caller specified EAGER, only the EAGER Resolvables are fetched. - // if the caller specified LAZY, both EAGER and LAZY Resolvables are fetched.` - var matchedWhens = whenOption === resolvePolicies.when.EAGER ? EAGER_WHENS : ALL_WHENS; - // get the subpath to the state argument, if provided - trace.traceResolvePath(this._path, when, trans); - var matchesPolicy = function (acceptedVals, whenOrAsync) { - return function (resolvable) { - return inArray(acceptedVals, _this.getPolicy(resolvable)[whenOrAsync]); - }; - }; - // Trigger all the (matching) Resolvables in the path - // Reduce all the "WAIT" Resolvables into an array - var promises = this._path.reduce(function (acc, node) { - var nodeResolvables = node.resolvables.filter(matchesPolicy(matchedWhens, 'when')); - var nowait = nodeResolvables.filter(matchesPolicy(['NOWAIT'], 'async')); - var wait = nodeResolvables.filter(not(matchesPolicy(['NOWAIT'], 'async'))); - // For the matching Resolvables, start their async fetch process. - var subContext = _this.subContext(node.state); - var getResult = function (r) { return r.get(subContext, trans) - .then(function (value) { return ({ token: r.token, value: value }); }); }; - nowait.forEach(getResult); - return acc.concat(wait.map(getResult)); - }, []); - // Wait for all the "WAIT" resolvables - return services.$q.all(promises); - }; - ResolveContext.prototype.injector = function () { - return this._injector || (this._injector = new UIInjectorImpl(this)); - }; - ResolveContext.prototype.findNode = function (resolvable) { - return find(this._path, function (node) { return inArray(node.resolvables, resolvable); }); - }; - /** - * Gets the async dependencies of a Resolvable - * - * Given a Resolvable, returns its dependencies as a Resolvable[] - */ - ResolveContext.prototype.getDependencies = function (resolvable) { - var _this = this; - var node = this.findNode(resolvable); - // Find which other resolvables are "visible" to the `resolvable` argument - // subpath stopping at resolvable's node, or the whole path (if the resolvable isn't in the path) - var subPath = PathUtils.subPath(this._path, function (x) { return x === node; }) || this._path; - var availableResolvables = subPath - .reduce(function (acc, node) { return acc.concat(node.resolvables); }, []) //all of subpath's resolvables - .filter(function (res) { return res !== resolvable; }); // filter out the `resolvable` argument - var getDependency = function (token) { - var matching = availableResolvables.filter(function (r) { return r.token === token; }); - if (matching.length) - return tail(matching); - var fromInjector = _this.injector().getNative(token); - if (!fromInjector) { - throw new Error("Could not find Dependency Injection token: " + stringify(token)); - } - return new Resolvable(token, function () { return fromInjector; }, [], fromInjector); - }; - return resolvable.deps.map(getDependency); - }; - return ResolveContext; -}()); -var UIInjectorImpl = (function () { - function UIInjectorImpl(context) { - this.context = context; - this.native = this.get(NATIVE_INJECTOR_TOKEN) || services.$injector; - } - UIInjectorImpl.prototype.get = function (token) { - var resolvable = this.context.getResolvable(token); - if (resolvable) { - if (this.context.getPolicy(resolvable).async === 'NOWAIT') { - return resolvable.get(this.context); - } - if (!resolvable.resolved) { - throw new Error("Resolvable async .get() not complete:" + stringify(resolvable.token)); - } - return resolvable.data; - } - return this.native && this.native.get(token); - }; - UIInjectorImpl.prototype.getAsync = function (token) { - var resolvable = this.context.getResolvable(token); - if (resolvable) - return resolvable.get(this.context); - return services.$q.when(this.native.get(token)); - }; - UIInjectorImpl.prototype.getNative = function (token) { - return this.native && this.native.get(token); - }; - return UIInjectorImpl; -}()); - -/** - * @coreapi - * @module transition - */ -/** for typedoc */ -/** @hidden */ -var stateSelf = prop("self"); -/** - * Represents a transition between two states. - * - * When navigating to a state, we are transitioning **from** the current state **to** the new state. - * - * This object contains all contextual information about the to/from states, parameters, resolves. - * It has information about all states being entered and exited as a result of the transition. - */ -var Transition = (function () { - /** - * Creates a new Transition object. - * - * If the target state is not valid, an error is thrown. - * - * @internalapi - * - * @param fromPath The path of [[PathNode]]s from which the transition is leaving. The last node in the `fromPath` - * encapsulates the "from state". - * @param targetState The target state and parameters being transitioned to (also, the transition options) - * @param router The [[UIRouter]] instance - */ - function Transition(fromPath, targetState, router) { - var _this = this; - /** @hidden */ - this._deferred = services.$q.defer(); - /** - * This promise is resolved or rejected based on the outcome of the Transition. - * - * When the transition is successful, the promise is resolved - * When the transition is unsuccessful, the promise is rejected with the [[Rejection]] or javascript error - */ - this.promise = this._deferred.promise; - /** @hidden Holds the hook registration functions such as those passed to Transition.onStart() */ - this._registeredHooks = {}; - /** @hidden */ - this._hookBuilder = new HookBuilder(this); - /** Checks if this transition is currently active/running. */ - this.isActive = function () { - return _this.router.globals.transition === _this; - }; - this.router = router; - this._targetState = targetState; - if (!targetState.valid()) { - throw new Error(targetState.error()); - } - // current() is assumed to come from targetState.options, but provide a naive implementation otherwise. - this._options = extend({ current: val(this) }, targetState.options()); - this.$id = router.transitionService._transitionCount++; - var toPath = PathUtils.buildToPath(fromPath, targetState); - this._treeChanges = PathUtils.treeChanges(fromPath, toPath, this._options.reloadState); - this.createTransitionHookRegFns(); - var onCreateHooks = this._hookBuilder.buildHooksForPhase(exports.TransitionHookPhase.CREATE); - TransitionHook.invokeHooks(onCreateHooks, function () { return null; }); - this.applyViewConfigs(router); - } - /** @hidden */ - Transition.prototype.onBefore = function (criteria, callback, options) { return; }; - /** @inheritdoc */ - Transition.prototype.onStart = function (criteria, callback, options) { return; }; - /** @inheritdoc */ - Transition.prototype.onExit = function (criteria, callback, options) { return; }; - /** @inheritdoc */ - Transition.prototype.onRetain = function (criteria, callback, options) { return; }; - /** @inheritdoc */ - Transition.prototype.onEnter = function (criteria, callback, options) { return; }; - /** @inheritdoc */ - Transition.prototype.onFinish = function (criteria, callback, options) { return; }; - /** @inheritdoc */ - Transition.prototype.onSuccess = function (criteria, callback, options) { return; }; - /** @inheritdoc */ - Transition.prototype.onError = function (criteria, callback, options) { return; }; - /** @hidden - * Creates the transition-level hook registration functions - * (which can then be used to register hooks) - */ - Transition.prototype.createTransitionHookRegFns = function () { - var _this = this; - this.router.transitionService._pluginapi._getEvents() - .filter(function (type) { return type.hookPhase !== exports.TransitionHookPhase.CREATE; }) - .forEach(function (type) { return makeEvent(_this, _this.router.transitionService, type); }); - }; - /** @internalapi */ - Transition.prototype.getHooks = function (hookName) { - return this._registeredHooks[hookName]; - }; - Transition.prototype.applyViewConfigs = function (router) { - var enteringStates = this._treeChanges.entering.map(function (node) { return node.state; }); - PathUtils.applyViewConfigs(router.transitionService.$view, this._treeChanges.to, enteringStates); - }; - /** - * @internalapi - * - * @returns the internal from [State] object - */ - Transition.prototype.$from = function () { - return tail(this._treeChanges.from).state; - }; - /** - * @internalapi - * - * @returns the internal to [State] object - */ - Transition.prototype.$to = function () { - return tail(this._treeChanges.to).state; - }; - /** - * Returns the "from state" - * - * Returns the state that the transition is coming *from*. - * - * @returns The state declaration object for the Transition's ("from state"). - */ - Transition.prototype.from = function () { - return this.$from().self; - }; - /** - * Returns the "to state" - * - * Returns the state that the transition is going *to*. - * - * @returns The state declaration object for the Transition's target state ("to state"). - */ - Transition.prototype.to = function () { - return this.$to().self; - }; - /** - * Gets the Target State - * - * A transition's [[TargetState]] encapsulates the [[to]] state, the [[params]], and the [[options]] as a single object. - * - * @returns the [[TargetState]] of this Transition - */ - Transition.prototype.targetState = function () { - return this._targetState; - }; - /** - * Determines whether two transitions are equivalent. - * @deprecated - */ - Transition.prototype.is = function (compare) { - if (compare instanceof Transition) { - // TODO: Also compare parameters - return this.is({ to: compare.$to().name, from: compare.$from().name }); - } - return !((compare.to && !matchState(this.$to(), compare.to)) || - (compare.from && !matchState(this.$from(), compare.from))); - }; - Transition.prototype.params = function (pathname) { - if (pathname === void 0) { pathname = "to"; } - return Object.freeze(this._treeChanges[pathname].map(prop("paramValues")).reduce(mergeR, {})); - }; - /** - * Creates a [[UIInjector]] Dependency Injector - * - * Returns a Dependency Injector for the Transition's target state (to state). - * The injector provides resolve values which the target state has access to. - * - * The `UIInjector` can also provide values from the native root/global injector (ng1/ng2). - * - * #### Example: - * ```js - * .onEnter({ entering: 'myState' }, trans => { - * var myResolveValue = trans.injector().get('myResolve'); - * // Inject a global service from the global/native injector (if it exists) - * var MyService = trans.injector().get('MyService'); - * }) - * ``` - * - * In some cases (such as `onBefore`), you may need access to some resolve data but it has not yet been fetched. - * You can use [[UIInjector.getAsync]] to get a promise for the data. - * #### Example: - * ```js - * .onBefore({}, trans => { - * return trans.injector().getAsync('myResolve').then(myResolveValue => - * return myResolveValue !== 'ABORT'; - * }); - * }); - * ``` - * - * If a `state` is provided, the injector that is returned will be limited to resolve values that the provided state has access to. - * This can be useful if both a parent state `foo` and a child state `foo.bar` have both defined a resolve such as `data`. - * #### Example: - * ```js - * .onEnter({ to: 'foo.bar' }, trans => { - * // returns result of `foo` state's `data` resolve - * // even though `foo.bar` also has a `data` resolve - * var fooData = trans.injector('foo').get('data'); - * }); - * ``` - * - * If you need resolve data from the exiting states, pass `'from'` as `pathName`. - * The resolve data from the `from` path will be returned. - * #### Example: - * ```js - * .onExit({ exiting: 'foo.bar' }, trans => { - * // Gets the resolve value of `data` from the exiting state. - * var fooData = trans.injector(null, 'foo.bar').get('data'); - * }); - * ``` - * - * - * @param state Limits the resolves provided to only the resolves the provided state has access to. - * @param pathName Default: `'to'`: Chooses the path for which to create the injector. Use this to access resolves for `exiting` states. - * - * @returns a [[UIInjector]] - */ - Transition.prototype.injector = function (state, pathName) { - if (pathName === void 0) { pathName = "to"; } - var path = this._treeChanges[pathName]; - if (state) - path = PathUtils.subPath(path, function (node) { return node.state === state || node.state.name === state; }); - return new ResolveContext(path).injector(); - }; - /** - * Gets all available resolve tokens (keys) - * - * This method can be used in conjunction with [[injector]] to inspect the resolve values - * available to the Transition. - * - * This returns all the tokens defined on [[StateDeclaration.resolve]] blocks, for the states - * in the Transition's [[TreeChanges.to]] path. - * - * #### Example: - * This example logs all resolve values - * ```js - * let tokens = trans.getResolveTokens(); - * tokens.forEach(token => console.log(token + " = " + trans.injector().get(token))); - * ``` - * - * #### Example: - * This example creates promises for each resolve value. - * This triggers fetches of resolves (if any have not yet been fetched). - * When all promises have all settled, it logs the resolve values. - * ```js - * let tokens = trans.getResolveTokens(); - * let promise = tokens.map(token => trans.injector().getAsync(token)); - * Promise.all(promises).then(values => console.log("Resolved values: " + values)); - * ``` - * - * Note: Angular 1 users whould use `$q.all()` - * - * @param pathname resolve context's path name (e.g., `to` or `from`) - * - * @returns an array of resolve tokens (keys) - */ - Transition.prototype.getResolveTokens = function (pathname) { - if (pathname === void 0) { pathname = "to"; } - return new ResolveContext(this._treeChanges[pathname]).getTokens(); - }; - /** - * Dynamically adds a new [[Resolvable]] (i.e., [[StateDeclaration.resolve]]) to this transition. - * - * #### Example: - * ```js - * transitionService.onBefore({}, transition => { - * transition.addResolvable({ - * token: 'myResolve', - * deps: ['MyService'], - * resolveFn: myService => myService.getData() - * }); - * }); - * ``` - * - * @param resolvable a [[ResolvableLiteral]] object (or a [[Resolvable]]) - * @param state the state in the "to path" which should receive the new resolve (otherwise, the root state) - */ - Transition.prototype.addResolvable = function (resolvable, state) { - if (state === void 0) { state = ""; } - resolvable = is(Resolvable)(resolvable) ? resolvable : new Resolvable(resolvable); - var stateName = (typeof state === "string") ? state : state.name; - var topath = this._treeChanges.to; - var targetNode = find(topath, function (node) { return node.state.name === stateName; }); - var resolveContext = new ResolveContext(topath); - resolveContext.addResolvables([resolvable], targetNode.state); - }; - /** - * Gets the transition from which this transition was redirected. - * - * If the current transition is a redirect, this method returns the transition that was redirected. - * - * #### Example: - * ```js - * let transitionA = $state.go('A').transition - * transitionA.onStart({}, () => $state.target('B')); - * $transitions.onSuccess({ to: 'B' }, (trans) => { - * trans.to().name === 'B'; // true - * trans.redirectedFrom() === transitionA; // true - * }); - * ``` - * - * @returns The previous Transition, or null if this Transition is not the result of a redirection - */ - Transition.prototype.redirectedFrom = function () { - return this._options.redirectedFrom || null; - }; - /** - * Gets the original transition in a redirect chain - * - * A transition might belong to a long chain of multiple redirects. - * This method walks the [[redirectedFrom]] chain back to the original (first) transition in the chain. - * - * #### Example: - * ```js - * // states - * registry.register({ name: 'A', redirectTo: 'B' }); - * registry.register({ name: 'B', redirectTo: 'C' }); - * registry.register({ name: 'C', redirectTo: 'D' }); - * registry.register({ name: 'D' }); - * - * let transitionA = $state.go('A').transition - * - * $transitions.onSuccess({ to: 'D' }, (trans) => { - * trans.to().name === 'D'; // true - * trans.redirectedFrom().to().name === 'C'; // true - * trans.originalTransition() === transitionA; // true - * trans.originalTransition().to().name === 'A'; // true - * }); - * ``` - * - * @returns The original Transition that started a redirect chain - */ - Transition.prototype.originalTransition = function () { - var rf = this.redirectedFrom(); - return (rf && rf.originalTransition()) || this; - }; - /** - * Get the transition options - * - * @returns the options for this Transition. - */ - Transition.prototype.options = function () { - return this._options; - }; - /** - * Gets the states being entered. - * - * @returns an array of states that will be entered during this transition. - */ - Transition.prototype.entering = function () { - return map(this._treeChanges.entering, prop('state')).map(stateSelf); - }; - /** - * Gets the states being exited. - * - * @returns an array of states that will be exited during this transition. - */ - Transition.prototype.exiting = function () { - return map(this._treeChanges.exiting, prop('state')).map(stateSelf).reverse(); - }; - /** - * Gets the states being retained. - * - * @returns an array of states that are already entered from a previous Transition, that will not be - * exited during this Transition - */ - Transition.prototype.retained = function () { - return map(this._treeChanges.retained, prop('state')).map(stateSelf); - }; - /** - * Get the [[ViewConfig]]s associated with this Transition - * - * Each state can define one or more views (template/controller), which are encapsulated as `ViewConfig` objects. - * This method fetches the `ViewConfigs` for a given path in the Transition (e.g., "to" or "entering"). - * - * @param pathname the name of the path to fetch views for: - * (`'to'`, `'from'`, `'entering'`, `'exiting'`, `'retained'`) - * @param state If provided, only returns the `ViewConfig`s for a single state in the path - * - * @returns a list of ViewConfig objects for the given path. - */ - Transition.prototype.views = function (pathname, state) { - if (pathname === void 0) { pathname = "entering"; } - var path = this._treeChanges[pathname]; - path = !state ? path : path.filter(propEq('state', state)); - return path.map(prop("views")).filter(identity).reduce(unnestR, []); - }; - Transition.prototype.treeChanges = function (pathname) { - return pathname ? this._treeChanges[pathname] : this._treeChanges; - }; - /** - * Creates a new transition that is a redirection of the current one. - * - * This transition can be returned from a [[TransitionService]] hook to - * redirect a transition to a new state and/or set of parameters. - * - * @internalapi - * - * @returns Returns a new [[Transition]] instance. - */ - Transition.prototype.redirect = function (targetState) { - var redirects = 1, trans = this; - while ((trans = trans.redirectedFrom()) != null) { - if (++redirects > 20) - throw new Error("Too many consecutive Transition redirects (20+)"); - } - var redirectOpts = { redirectedFrom: this, source: "redirect" }; - // If the original transition was caused by URL sync, then use { location: 'replace' } - // on the new transition (unless the target state explicitly specifies location: false). - // This causes the original url to be replaced with the url for the redirect target - // so the original url disappears from the browser history. - if (this.options().source === 'url' && targetState.options().location !== false) { - redirectOpts.location = 'replace'; - } - var newOptions = extend({}, this.options(), targetState.options(), redirectOpts); - targetState = new TargetState(targetState.identifier(), targetState.$state(), targetState.params(), newOptions); - var newTransition = this.router.transitionService.create(this._treeChanges.from, targetState); - var originalEnteringNodes = this._treeChanges.entering; - var redirectEnteringNodes = newTransition._treeChanges.entering; - // --- Re-use resolve data from original transition --- - // When redirecting from a parent state to a child state where the parent parameter values haven't changed - // (because of the redirect), the resolves fetched by the original transition are still valid in the - // redirected transition. - // - // This allows you to define a redirect on a parent state which depends on an async resolve value. - // You can wait for the resolve, then redirect to a child state based on the result. - // The redirected transition does not have to re-fetch the resolve. - // --------------------------------------------------------- - var nodeIsReloading = function (reloadState) { return function (node) { - return reloadState && node.state.includes[reloadState.name]; - }; }; - // Find any "entering" nodes in the redirect path that match the original path and aren't being reloaded - var matchingEnteringNodes = PathUtils.matching(redirectEnteringNodes, originalEnteringNodes, PathUtils.nonDynamicParams) - .filter(not(nodeIsReloading(targetState.options().reloadState))); - // Use the existing (possibly pre-resolved) resolvables for the matching entering nodes. - matchingEnteringNodes.forEach(function (node, idx) { - node.resolvables = originalEnteringNodes[idx].resolvables; - }); - return newTransition; - }; - /** @hidden If a transition doesn't exit/enter any states, returns any [[Param]] whose value changed */ - Transition.prototype._changedParams = function () { - var tc = this._treeChanges; - /** Return undefined if it's not a "dynamic" transition, for the following reasons */ - // If user explicitly wants a reload - if (this._options.reload) - return undefined; - // If any states are exiting or entering - if (tc.exiting.length || tc.entering.length) - return undefined; - // If to/from path lengths differ - if (tc.to.length !== tc.from.length) - return undefined; - // If the to/from paths are different - var pathsDiffer = arrayTuples(tc.to, tc.from) - .map(function (tuple) { return tuple[0].state !== tuple[1].state; }) - .reduce(anyTrueR, false); - if (pathsDiffer) - return undefined; - // Find any parameter values that differ - var nodeSchemas = tc.to.map(function (node) { return node.paramSchema; }); - var _a = [tc.to, tc.from].map(function (path) { return path.map(function (x) { return x.paramValues; }); }), toValues = _a[0], fromValues = _a[1]; - var tuples = arrayTuples(nodeSchemas, toValues, fromValues); - return tuples.map(function (_a) { - var schema = _a[0], toVals = _a[1], fromVals = _a[2]; - return Param.changed(schema, toVals, fromVals); - }).reduce(unnestR, []); - }; - /** - * Returns true if the transition is dynamic. - * - * A transition is dynamic if no states are entered nor exited, but at least one dynamic parameter has changed. - * - * @returns true if the Transition is dynamic - */ - Transition.prototype.dynamic = function () { - var changes = this._changedParams(); - return !changes ? false : changes.map(function (x) { return x.dynamic; }).reduce(anyTrueR, false); - }; - /** - * Returns true if the transition is ignored. - * - * A transition is ignored if no states are entered nor exited, and no parameter values have changed. - * - * @returns true if the Transition is ignored. - */ - Transition.prototype.ignored = function () { - return !!this._ignoredReason(); - }; - /** @hidden */ - Transition.prototype._ignoredReason = function () { - var pending = this.router.globals.transition; - var reloadState = this._options.reloadState; - var same = function (pathA, pathB) { - if (pathA.length !== pathB.length) - return false; - var matching = PathUtils.matching(pathA, pathB); - return pathA.length === matching.filter(function (node) { return !reloadState || !node.state.includes[reloadState.name]; }).length; - }; - var newTC = this.treeChanges(); - var pendTC = pending && pending.treeChanges(); - if (pendTC && same(pendTC.to, newTC.to) && same(pendTC.exiting, newTC.exiting)) - return "SameAsPending"; - if (newTC.exiting.length === 0 && newTC.entering.length === 0 && same(newTC.from, newTC.to)) - return "SameAsCurrent"; - }; - /** - * Runs the transition - * - * This method is generally called from the [[StateService.transitionTo]] - * - * @internalapi - * - * @returns a promise for a successful transition. - */ - Transition.prototype.run = function () { - var _this = this; - var runAllHooks = TransitionHook.runAllHooks; - // Gets transition hooks array for the given phase - var getHooksFor = function (phase) { - return _this._hookBuilder.buildHooksForPhase(phase); - }; - // When the chain is complete, then resolve or reject the deferred - var transitionSuccess = function () { - trace.traceSuccess(_this.$to(), _this); - _this.success = true; - _this._deferred.resolve(_this.to()); - runAllHooks(getHooksFor(exports.TransitionHookPhase.SUCCESS)); - }; - var transitionError = function (reason) { - trace.traceError(reason, _this); - _this.success = false; - _this._deferred.reject(reason); - _this._error = reason; - runAllHooks(getHooksFor(exports.TransitionHookPhase.ERROR)); - }; - var runTransition = function () { - // Wait to build the RUN hook chain until the BEFORE hooks are done - // This allows a BEFORE hook to dynamically add additional RUN hooks via the Transition object. - var allRunHooks = getHooksFor(exports.TransitionHookPhase.RUN); - var done = function () { return services.$q.when(undefined); }; - return TransitionHook.invokeHooks(allRunHooks, done); - }; - var startTransition = function () { - var globals = _this.router.globals; - globals.lastStartedTransitionId = _this.$id; - globals.transition = _this; - globals.transitionHistory.enqueue(_this); - trace.traceTransitionStart(_this); - return services.$q.when(undefined); - }; - var allBeforeHooks = getHooksFor(exports.TransitionHookPhase.BEFORE); - TransitionHook.invokeHooks(allBeforeHooks, startTransition) - .then(runTransition) - .then(transitionSuccess, transitionError); - return this.promise; - }; - /** - * Checks if the Transition is valid - * - * @returns true if the Transition is valid - */ - Transition.prototype.valid = function () { - return !this.error() || this.success !== undefined; - }; - /** - * Aborts this transition - * - * Imperative API to abort a Transition. - * This only applies to Transitions that are not yet complete. - */ - Transition.prototype.abort = function () { - // Do not set flag if the transition is already complete - if (isUndefined(this.success)) { - this._aborted = true; - } - }; - /** - * The Transition error reason. - * - * If the transition is invalid (and could not be run), returns the reason the transition is invalid. - * If the transition was valid and ran, but was not successful, returns the reason the transition failed. - * - * @returns an error message explaining why the transition is invalid, or the reason the transition failed. - */ - Transition.prototype.error = function () { - var state = this.$to(); - if (state.self.abstract) - return "Cannot transition to abstract state '" + state.name + "'"; - if (!Param.validates(state.parameters(), this.params())) - return "Param values not valid for state '" + state.name + "'"; - if (this.success === false) - return this._error; - }; - /** - * A string representation of the Transition - * - * @returns A string representation of the Transition - */ - Transition.prototype.toString = function () { - var fromStateOrName = this.from(); - var toStateOrName = this.to(); - var avoidEmptyHash = function (params) { - return (params["#"] !== null && params["#"] !== undefined) ? params : omit(params, ["#"]); - }; - // (X) means the to state is invalid. - var id = this.$id, from = isObject(fromStateOrName) ? fromStateOrName.name : fromStateOrName, fromParams = toJson(avoidEmptyHash(this._treeChanges.from.map(prop('paramValues')).reduce(mergeR, {}))), toValid = this.valid() ? "" : "(X) ", to = isObject(toStateOrName) ? toStateOrName.name : toStateOrName, toParams = toJson(avoidEmptyHash(this.params())); - return "Transition#" + id + "( '" + from + "'" + fromParams + " -> " + toValid + "'" + to + "'" + toParams + " )"; - }; - return Transition; -}()); -/** @hidden */ -Transition.diToken = Transition; - -/** - * Functions that manipulate strings - * - * Although these functions are exported, they are subject to change without notice. - * - * @module common_strings - */ /** */ -/** - * Returns a string shortened to a maximum length - * - * If the string is already less than the `max` length, return the string. - * Else return the string, shortened to `max - 3` and append three dots ("..."). - * - * @param max the maximum length of the string to return - * @param str the input string - */ -function maxLength(max, str) { - if (str.length <= max) - return str; - return str.substr(0, max - 3) + "..."; -} -/** - * Returns a string, with spaces added to the end, up to a desired str length - * - * If the string is already longer than the desired length, return the string. - * Else returns the string, with extra spaces on the end, such that it reaches `length` characters. - * - * @param length the desired length of the string to return - * @param str the input string - */ -function padString(length, str) { - while (str.length < length) - str += " "; - return str; -} -function kebobString(camelCase) { - return camelCase - .replace(/^([A-Z])/, function ($1) { return $1.toLowerCase(); }) // replace first char - .replace(/([A-Z])/g, function ($1) { return "-" + $1.toLowerCase(); }); // replace rest -} -function functionToString(fn) { - var fnStr = fnToString(fn); - var namedFunctionMatch = fnStr.match(/^(function [^ ]+\([^)]*\))/); - var toStr = namedFunctionMatch ? namedFunctionMatch[1] : fnStr; - var fnName = fn['name'] || ""; - if (fnName && toStr.match(/function \(/)) { - return 'function ' + fnName + toStr.substr(9); - } - return toStr; -} -function fnToString(fn) { - var _fn = isArray(fn) ? fn.slice(-1)[0] : fn; - return _fn && _fn.toString() || "undefined"; -} -var stringifyPatternFn = null; -var stringifyPattern = function (value) { - var isRejection = Rejection.isRejectionPromise; - stringifyPatternFn = stringifyPatternFn || pattern([ - [not(isDefined), val("undefined")], - [isNull, val("null")], - [isPromise, val("[Promise]")], - [isRejection, function (x) { return x._transitionRejection.toString(); }], - [is(Rejection), invoke("toString")], - [is(Transition), invoke("toString")], - [is(Resolvable), invoke("toString")], - [isInjectable, functionToString], - [val(true), identity] - ]); - return stringifyPatternFn(value); -}; -function stringify(o) { - var seen = []; - function format(val$$1) { - if (isObject(val$$1)) { - if (seen.indexOf(val$$1) !== -1) - return '[circular ref]'; - seen.push(val$$1); - } - return stringifyPattern(val$$1); - } - return JSON.stringify(o, function (key, val$$1) { return format(val$$1); }).replace(/\\"/g, '"'); -} -/** Returns a function that splits a string on a character or substring */ -var beforeAfterSubstr = function (char) { return function (str) { - if (!str) - return ["", ""]; - var idx = str.indexOf(char); - if (idx === -1) - return [str, ""]; - return [str.substr(0, idx), str.substr(idx + 1)]; -}; }; -/** - * Splits on a delimiter, but returns the delimiters in the array - * - * #### Example: - * ```js - * var splitOnSlashes = splitOnDelim('/'); - * splitOnSlashes("/foo"); // ["/", "foo"] - * splitOnSlashes("/foo/"); // ["/", "foo", "/"] - * ``` - */ -function splitOnDelim(delim) { - var re = new RegExp("(" + delim + ")", "g"); - return function (str) { - return str.split(re).filter(identity); - }; -} - -/** - * Reduce fn that joins neighboring strings - * - * Given an array of strings, returns a new array - * where all neighboring strings have been joined. - * - * #### Example: - * ```js - * let arr = ["foo", "bar", 1, "baz", "", "qux" ]; - * arr.reduce(joinNeighborsR, []) // ["foobar", 1, "bazqux" ] - * ``` - */ -function joinNeighborsR(acc, x) { - if (isString(tail(acc)) && isString(x)) - return acc.slice(0, -1).concat(tail(acc) + x); - return pushR(acc, x); -} - -/** @module common */ /** for typedoc */ - -/** - * @coreapi - * @module params - */ -/** */ -/** - * A registry for parameter types. - * - * This registry manages the built-in (and custom) parameter types. - * - * The built-in parameter types are: - * - * - [[string]] - * - [[path]] - * - [[query]] - * - [[hash]] - * - [[int]] - * - [[bool]] - * - [[date]] - * - [[json]] - * - [[any]] - */ -var ParamTypes = (function () { - /** @internalapi */ - function ParamTypes() { - /** @hidden */ - this.enqueue = true; - /** @hidden */ - this.typeQueue = []; - /** @internalapi */ - this.defaultTypes = pick(ParamTypes.prototype, ["hash", "string", "query", "path", "int", "bool", "date", "json", "any"]); - // Register default types. Store them in the prototype of this.types. - var makeType = function (definition, name) { - return new ParamType(extend({ name: name }, definition)); - }; - this.types = inherit(map(this.defaultTypes, makeType), {}); - } - /** @internalapi */ - ParamTypes.prototype.dispose = function () { - this.types = {}; - }; - /** - * Registers a parameter type - * - * End users should call [[UrlMatcherFactory.type]], which delegates to this method. - */ - ParamTypes.prototype.type = function (name, definition, definitionFn) { - if (!isDefined(definition)) - return this.types[name]; - if (this.types.hasOwnProperty(name)) - throw new Error("A type named '" + name + "' has already been defined."); - this.types[name] = new ParamType(extend({ name: name }, definition)); - if (definitionFn) { - this.typeQueue.push({ name: name, def: definitionFn }); - if (!this.enqueue) - this._flushTypeQueue(); - } - return this; - }; - /** @internalapi */ - ParamTypes.prototype._flushTypeQueue = function () { - while (this.typeQueue.length) { - var type = this.typeQueue.shift(); - if (type.pattern) - throw new Error("You cannot override a type's .pattern at runtime."); - extend(this.types[type.name], services.$injector.invoke(type.def)); - } - }; - return ParamTypes; -}()); -/** @hidden */ -function initDefaultTypes() { - var makeDefaultType = function (def) { - var valToString = function (val$$1) { - return val$$1 != null ? val$$1.toString() : val$$1; - }; - var defaultTypeBase = { - encode: valToString, - decode: valToString, - is: is(String), - pattern: /.*/, - equals: function (a, b) { return a == b; }, - }; - return extend({}, defaultTypeBase, def); - }; - // Default Parameter Type Definitions - extend(ParamTypes.prototype, { - string: makeDefaultType({}), - path: makeDefaultType({ - pattern: /[^/]*/, - }), - query: makeDefaultType({}), - hash: makeDefaultType({ - inherit: false, - }), - int: makeDefaultType({ - decode: function (val$$1) { return parseInt(val$$1, 10); }, - is: function (val$$1) { - return !isNullOrUndefined(val$$1) && this.decode(val$$1.toString()) === val$$1; - }, - pattern: /-?\d+/, - }), - bool: makeDefaultType({ - encode: function (val$$1) { return val$$1 && 1 || 0; }, - decode: function (val$$1) { return parseInt(val$$1, 10) !== 0; }, - is: is(Boolean), - pattern: /0|1/ - }), - date: makeDefaultType({ - encode: function (val$$1) { - return !this.is(val$$1) ? undefined : [ - val$$1.getFullYear(), - ('0' + (val$$1.getMonth() + 1)).slice(-2), - ('0' + val$$1.getDate()).slice(-2) - ].join("-"); - }, - decode: function (val$$1) { - if (this.is(val$$1)) - return val$$1; - var match = this.capture.exec(val$$1); - return match ? new Date(match[1], match[2] - 1, match[3]) : undefined; - }, - is: function (val$$1) { return val$$1 instanceof Date && !isNaN(val$$1.valueOf()); }, - equals: function (l, r) { - return ['getFullYear', 'getMonth', 'getDate'] - .reduce(function (acc, fn) { return acc && l[fn]() === r[fn](); }, true); - }, - pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/, - capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/ - }), - json: makeDefaultType({ - encode: toJson, - decode: fromJson, - is: is(Object), - equals: equals, - pattern: /[^/]*/ - }), - // does not encode/decode - any: makeDefaultType({ - encode: identity, - decode: identity, - is: function () { return true; }, - equals: equals, - }), - }); -} -initDefaultTypes(); - -/** - * @coreapi - * @module params - */ -/** */ -/** @internalapi */ -var StateParams = (function () { - function StateParams(params) { - if (params === void 0) { params = {}; } - extend(this, params); - } - /** - * Merges a set of parameters with all parameters inherited between the common parents of the - * current state and a given destination state. - * - * @param {Object} newParams The set of parameters which will be composited with inherited params. - * @param {Object} $current Internal definition of object representing the current state. - * @param {Object} $to Internal definition of object representing state to transition to. - */ - StateParams.prototype.$inherit = function (newParams, $current, $to) { - var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = []; - for (var i in parents) { - if (!parents[i] || !parents[i].params) - continue; - parentParams = Object.keys(parents[i].params); - if (!parentParams.length) - continue; - for (var j in parentParams) { - if (inheritList.indexOf(parentParams[j]) >= 0) - continue; - inheritList.push(parentParams[j]); - inherited[parentParams[j]] = this[parentParams[j]]; - } - } - return extend({}, inherited, newParams); - }; - - return StateParams; -}()); - -/** @module path */ /** for typedoc */ - -/** @module resolve */ /** for typedoc */ - -/** @module state */ /** for typedoc */ -var parseUrl = function (url) { - if (!isString(url)) - return false; - var root = url.charAt(0) === '^'; - return { val: root ? url.substring(1) : url, root: root }; -}; -function nameBuilder(state) { - return state.name; -} -function selfBuilder(state) { - state.self.$$state = function () { return state; }; - return state.self; -} -function dataBuilder(state) { - if (state.parent && state.parent.data) { - state.data = state.self.data = inherit(state.parent.data, state.data); - } - return state.data; -} -var getUrlBuilder = function ($urlMatcherFactoryProvider, root) { - return function urlBuilder(state) { - var stateDec = state; - // For future states, i.e., states whose name ends with `.**`, - // match anything that starts with the url prefix - if (stateDec && stateDec.url && stateDec.name && stateDec.name.match(/\.\*\*$/)) { - stateDec.url += "{remainder:any}"; // match any path (.*) - } - var parsed = parseUrl(stateDec.url), parent = state.parent; - var url = !parsed ? stateDec.url : $urlMatcherFactoryProvider.compile(parsed.val, { - params: state.params || {}, - paramMap: function (paramConfig, isSearch) { - if (stateDec.reloadOnSearch === false && isSearch) - paramConfig = extend(paramConfig || {}, { dynamic: true }); - return paramConfig; - } - }); - if (!url) - return null; - if (!$urlMatcherFactoryProvider.isMatcher(url)) - throw new Error("Invalid url '" + url + "' in state '" + state + "'"); - return (parsed && parsed.root) ? url : ((parent && parent.navigable) || root()).url.append(url); - }; -}; -var getNavigableBuilder = function (isRoot) { - return function navigableBuilder(state) { - return !isRoot(state) && state.url ? state : (state.parent ? state.parent.navigable : null); - }; -}; -var getParamsBuilder = function (paramFactory) { - return function paramsBuilder(state) { - var makeConfigParam = function (config, id) { return paramFactory.fromConfig(id, null, config); }; - var urlParams = (state.url && state.url.parameters({ inherit: false })) || []; - var nonUrlParams = values(mapObj(omit(state.params || {}, urlParams.map(prop('id'))), makeConfigParam)); - return urlParams.concat(nonUrlParams).map(function (p) { return [p.id, p]; }).reduce(applyPairs, {}); - }; -}; -function pathBuilder(state) { - return state.parent ? state.parent.path.concat(state) : [state]; -} -function includesBuilder(state) { - var includes = state.parent ? extend({}, state.parent.includes) : {}; - includes[state.name] = true; - return includes; -} -/** - * This is a [[StateBuilder.builder]] function for the `resolve:` block on a [[StateDeclaration]]. - * - * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder - * validates the `resolve` property and converts it to a [[Resolvable]] array. - * - * resolve: input value can be: - * - * { - * // analyzed but not injected - * myFooResolve: function() { return "myFooData"; }, - * - * // function.toString() parsed, "DependencyName" dep as string (not min-safe) - * myBarResolve: function(DependencyName) { return DependencyName.fetchSomethingAsPromise() }, - * - * // Array split; "DependencyName" dep as string - * myBazResolve: [ "DependencyName", function(dep) { return dep.fetchSomethingAsPromise() }, - * - * // Array split; DependencyType dep as token (compared using ===) - * myQuxResolve: [ DependencyType, function(dep) { return dep.fetchSometingAsPromise() }, - * - * // val.$inject used as deps - * // where: - * // corgeResolve.$inject = ["DependencyName"]; - * // function corgeResolve(dep) { dep.fetchSometingAsPromise() } - * // then "DependencyName" dep as string - * myCorgeResolve: corgeResolve, - * - * // inject service by name - * // When a string is found, desugar creating a resolve that injects the named service - * myGraultResolve: "SomeService" - * } - * - * or: - * - * [ - * new Resolvable("myFooResolve", function() { return "myFooData" }), - * new Resolvable("myBarResolve", function(dep) { return dep.fetchSomethingAsPromise() }, [ "DependencyName" ]), - * { provide: "myBazResolve", useFactory: function(dep) { dep.fetchSomethingAsPromise() }, deps: [ "DependencyName" ] } - * ] - */ -function resolvablesBuilder(state) { - /** convert resolve: {} and resolvePolicy: {} objects to an array of tuples */ - var objects2Tuples = function (resolveObj, resolvePolicies) { - return Object.keys(resolveObj || {}).map(function (token) { return ({ token: token, val: resolveObj[token], deps: undefined, policy: resolvePolicies[token] }); }); - }; - /** fetch DI annotations from a function or ng1-style array */ - var annotate = function (fn) { - var $injector = services.$injector; - // ng1 doesn't have an $injector until runtime. - // If the $injector doesn't exist, use "deferred" literal as a - // marker indicating they should be annotated when runtime starts - return fn['$inject'] || ($injector && $injector.annotate(fn, $injector.strictDi)) || "deferred"; - }; - /** true if the object has both `token` and `resolveFn`, and is probably a [[ResolveLiteral]] */ - var isResolveLiteral = function (obj) { return !!(obj.token && obj.resolveFn); }; - /** true if the object looks like a provide literal, or a ng2 Provider */ - var isLikeNg2Provider = function (obj) { return !!((obj.provide || obj.token) && (obj.useValue || obj.useFactory || obj.useExisting || obj.useClass)); }; - /** true if the object looks like a tuple from obj2Tuples */ - var isTupleFromObj = function (obj) { return !!(obj && obj.val && (isString(obj.val) || isArray(obj.val) || isFunction(obj.val))); }; - /** extracts the token from a Provider or provide literal */ - var token = function (p) { return p.provide || p.token; }; - /** Given a literal resolve or provider object, returns a Resolvable */ - var literal2Resolvable = pattern([ - [prop('resolveFn'), function (p) { return new Resolvable(token(p), p.resolveFn, p.deps, p.policy); }], - [prop('useFactory'), function (p) { return new Resolvable(token(p), p.useFactory, (p.deps || p.dependencies), p.policy); }], - [prop('useClass'), function (p) { return new Resolvable(token(p), function () { return new p.useClass(); }, [], p.policy); }], - [prop('useValue'), function (p) { return new Resolvable(token(p), function () { return p.useValue; }, [], p.policy, p.useValue); }], - [prop('useExisting'), function (p) { return new Resolvable(token(p), identity, [p.useExisting], p.policy); }], - ]); - var tuple2Resolvable = pattern([ - [pipe(prop("val"), isString), function (tuple) { return new Resolvable(tuple.token, identity, [tuple.val], tuple.policy); }], - [pipe(prop("val"), isArray), function (tuple) { return new Resolvable(tuple.token, tail(tuple.val), tuple.val.slice(0, -1), tuple.policy); }], - [pipe(prop("val"), isFunction), function (tuple) { return new Resolvable(tuple.token, tuple.val, annotate(tuple.val), tuple.policy); }], - ]); - var item2Resolvable = pattern([ - [is(Resolvable), function (r) { return r; }], - [isResolveLiteral, literal2Resolvable], - [isLikeNg2Provider, literal2Resolvable], - [isTupleFromObj, tuple2Resolvable], - [val(true), function (obj) { throw new Error("Invalid resolve value: " + stringify(obj)); }] - ]); - // If resolveBlock is already an array, use it as-is. - // Otherwise, assume it's an object and convert to an Array of tuples - var decl = state.resolve; - var items = isArray(decl) ? decl : objects2Tuples(decl, state.resolvePolicy || {}); - return items.map(item2Resolvable); -} -/** - * @internalapi A internal global service - * - * StateBuilder is a factory for the internal [[StateObject]] objects. - * - * When you register a state with the [[StateRegistry]], you register a plain old javascript object which - * conforms to the [[StateDeclaration]] interface. This factory takes that object and builds the corresponding - * [[StateObject]] object, which has an API and is used internally. - * - * Custom properties or API may be added to the internal [[StateObject]] object by registering a decorator function - * using the [[builder]] method. - */ -var StateBuilder = (function () { - function StateBuilder(matcher, urlMatcherFactory) { - this.matcher = matcher; - var self = this; - var root = function () { return matcher.find(""); }; - var isRoot = function (state) { return state.name === ""; }; - function parentBuilder(state) { - if (isRoot(state)) - return null; - return matcher.find(self.parentName(state)) || root(); - } - this.builders = { - name: [nameBuilder], - self: [selfBuilder], - parent: [parentBuilder], - data: [dataBuilder], - // Build a URLMatcher if necessary, either via a relative or absolute URL - url: [getUrlBuilder(urlMatcherFactory, root)], - // Keep track of the closest ancestor state that has a URL (i.e. is navigable) - navigable: [getNavigableBuilder(isRoot)], - params: [getParamsBuilder(urlMatcherFactory.paramFactory)], - // Each framework-specific ui-router implementation should define its own `views` builder - // e.g., src/ng1/statebuilders/views.ts - views: [], - // Keep a full path from the root down to this state as this is needed for state activation. - path: [pathBuilder], - // Speed up $state.includes() as it's used a lot - includes: [includesBuilder], - resolvables: [resolvablesBuilder] - }; - } - /** - * Registers a [[BuilderFunction]] for a specific [[StateObject]] property (e.g., `parent`, `url`, or `path`). - * More than one BuilderFunction can be registered for a given property. - * - * The BuilderFunction(s) will be used to define the property on any subsequently built [[StateObject]] objects. - * - * @param name The name of the State property being registered for. - * @param fn The BuilderFunction which will be used to build the State property - * @returns a function which deregisters the BuilderFunction - */ - StateBuilder.prototype.builder = function (name, fn) { - var builders = this.builders; - var array = builders[name] || []; - // Backwards compat: if only one builder exists, return it, else return whole arary. - if (isString(name) && !isDefined(fn)) - return array.length > 1 ? array : array[0]; - if (!isString(name) || !isFunction(fn)) - return; - builders[name] = array; - builders[name].push(fn); - return function () { return builders[name].splice(builders[name].indexOf(fn, 1)) && null; }; - }; - /** - * Builds all of the properties on an essentially blank State object, returning a State object which has all its - * properties and API built. - * - * @param state an uninitialized State object - * @returns the built State object - */ - StateBuilder.prototype.build = function (state) { - var _a = this, matcher = _a.matcher, builders = _a.builders; - var parent = this.parentName(state); - if (parent && !matcher.find(parent, undefined, false)) { - return null; - } - for (var key in builders) { - if (!builders.hasOwnProperty(key)) - continue; - var chain = builders[key].reduce(function (parentFn, step) { return function (_state) { return step(_state, parentFn); }; }, noop$1); - state[key] = chain(state); - } - return state; - }; - StateBuilder.prototype.parentName = function (state) { - var name = state.name || ""; - var segments = name.split('.'); - if (segments.length > 1) { - if (state.parent) { - throw new Error("States that specify the 'parent:' property should not have a '.' in their name (" + name + ")"); - } - var lastSegment = segments.pop(); - if (lastSegment === '**') - segments.pop(); - return segments.join("."); - } - if (!state.parent) - return ""; - return isString(state.parent) ? state.parent : state.parent.name; - }; - StateBuilder.prototype.name = function (state) { - var name = state.name; - if (name.indexOf('.') !== -1 || !state.parent) - return name; - var parentName = isString(state.parent) ? state.parent : state.parent.name; - return parentName ? parentName + "." + name : name; - }; - return StateBuilder; -}()); - -/** @module state */ /** for typedoc */ -var StateMatcher = (function () { - function StateMatcher(_states) { - this._states = _states; - } - StateMatcher.prototype.isRelative = function (stateName) { - stateName = stateName || ""; - return stateName.indexOf(".") === 0 || stateName.indexOf("^") === 0; - }; - StateMatcher.prototype.find = function (stateOrName, base, matchGlob) { - if (matchGlob === void 0) { matchGlob = true; } - if (!stateOrName && stateOrName !== "") - return undefined; - var isStr = isString(stateOrName); - var name = isStr ? stateOrName : stateOrName.name; - if (this.isRelative(name)) - name = this.resolvePath(name, base); - var state = this._states[name]; - if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) { - return state; - } - else if (isStr && matchGlob) { - var _states = values(this._states); - var matches = _states.filter(function (state) { - return state.__stateObjectCache.nameGlob && - state.__stateObjectCache.nameGlob.matches(name); - }); - if (matches.length > 1) { - console.log("stateMatcher.find: Found multiple matches for " + name + " using glob: ", matches.map(function (match) { return match.name; })); - } - return matches[0]; - } - return undefined; - }; - StateMatcher.prototype.resolvePath = function (name, base) { - if (!base) - throw new Error("No reference point given for path '" + name + "'"); - var baseState = this.find(base); - var splitName = name.split("."), i = 0, pathLength = splitName.length, current = baseState; - for (; i < pathLength; i++) { - if (splitName[i] === "" && i === 0) { - current = baseState; - continue; - } - if (splitName[i] === "^") { - if (!current.parent) - throw new Error("Path '" + name + "' not valid for state '" + baseState.name + "'"); - current = current.parent; - continue; - } - break; - } - var relName = splitName.slice(i).join("."); - return current.name + (current.name && relName ? "." : "") + relName; - }; - return StateMatcher; -}()); - -/** @module state */ /** for typedoc */ -/** @internalapi */ -var StateQueueManager = (function () { - function StateQueueManager($registry, $urlRouter, states, builder, listeners) { - this.$registry = $registry; - this.$urlRouter = $urlRouter; - this.states = states; - this.builder = builder; - this.listeners = listeners; - this.queue = []; - this.matcher = $registry.matcher; - } - /** @internalapi */ - StateQueueManager.prototype.dispose = function () { - this.queue = []; - }; - StateQueueManager.prototype.register = function (stateDecl) { - var queue = this.queue; - var state = StateObject.create(stateDecl); - var name = state.name; - if (!isString(name)) - throw new Error("State must have a valid name"); - if (this.states.hasOwnProperty(name) || inArray(queue.map(prop('name')), name)) - throw new Error("State '" + name + "' is already defined"); - queue.push(state); - this.flush(); - return state; - }; - StateQueueManager.prototype.flush = function () { - var _this = this; - var _a = this, queue = _a.queue, states = _a.states, builder = _a.builder; - var registered = [], // states that got registered - orphans = [], // states that don't yet have a parent registered - previousQueueLength = {}; // keep track of how long the queue when an orphan was first encountered - var getState = function (name) { - return _this.states.hasOwnProperty(name) && _this.states[name]; - }; - while (queue.length > 0) { - var state = queue.shift(); - var name_1 = state.name; - var result = builder.build(state); - var orphanIdx = orphans.indexOf(state); - if (result) { - var existingState = getState(name_1); - if (existingState && existingState.name === name_1) { - throw new Error("State '" + name_1 + "' is already defined"); - } - var existingFutureState = getState(name_1 + ".**"); - if (existingFutureState) { - // Remove future state of the same name - this.$registry.deregister(existingFutureState); - } - states[name_1] = state; - this.attachRoute(state); - if (orphanIdx >= 0) - orphans.splice(orphanIdx, 1); - registered.push(state); - continue; - } - var prev = previousQueueLength[name_1]; - previousQueueLength[name_1] = queue.length; - if (orphanIdx >= 0 && prev === queue.length) { - // Wait until two consecutive iterations where no additional states were dequeued successfully. - // throw new Error(`Cannot register orphaned state '${name}'`); - queue.push(state); - return states; - } - else if (orphanIdx < 0) { - orphans.push(state); - } - queue.push(state); - } - if (registered.length) { - this.listeners.forEach(function (listener) { return listener("registered", registered.map(function (s) { return s.self; })); }); - } - return states; - }; - StateQueueManager.prototype.attachRoute = function (state) { - if (state.abstract || !state.url) - return; - this.$urlRouter.rule(this.$urlRouter.urlRuleFactory.create(state)); - }; - return StateQueueManager; -}()); - -/** - * @coreapi - * @module state - */ /** for typedoc */ -var StateRegistry = (function () { - /** @internalapi */ - function StateRegistry(_router) { - this._router = _router; - this.states = {}; - this.listeners = []; - this.matcher = new StateMatcher(this.states); - this.builder = new StateBuilder(this.matcher, _router.urlMatcherFactory); - this.stateQueue = new StateQueueManager(this, _router.urlRouter, this.states, this.builder, this.listeners); - this._registerRoot(); - } - /** @internalapi */ - StateRegistry.prototype._registerRoot = function () { - var rootStateDef = { - name: '', - url: '^', - views: null, - params: { - '#': { value: null, type: 'hash', dynamic: true } - }, - abstract: true - }; - var _root = this._root = this.stateQueue.register(rootStateDef); - _root.navigable = null; - }; - /** @internalapi */ - StateRegistry.prototype.dispose = function () { - var _this = this; - this.stateQueue.dispose(); - this.listeners = []; - this.get().forEach(function (state) { return _this.get(state) && _this.deregister(state); }); - }; - /** - * Listen for a State Registry events - * - * Adds a callback that is invoked when states are registered or deregistered with the StateRegistry. - * - * #### Example: - * ```js - * let allStates = registry.get(); - * - * // Later, invoke deregisterFn() to remove the listener - * let deregisterFn = registry.onStatesChanged((event, states) => { - * switch(event) { - * case: 'registered': - * states.forEach(state => allStates.push(state)); - * break; - * case: 'deregistered': - * states.forEach(state => { - * let idx = allStates.indexOf(state); - * if (idx !== -1) allStates.splice(idx, 1); - * }); - * break; - * } - * }); - * ``` - * - * @param listener a callback function invoked when the registered states changes. - * The function receives two parameters, `event` and `state`. - * See [[StateRegistryListener]] - * @return a function that deregisters the listener - */ - StateRegistry.prototype.onStatesChanged = function (listener) { - this.listeners.push(listener); - return function deregisterListener() { - removeFrom(this.listeners)(listener); - }.bind(this); - }; - /** - * Gets the implicit root state - * - * Gets the root of the state tree. - * The root state is implicitly created by UI-Router. - * Note: this returns the internal [[StateObject]] representation, not a [[StateDeclaration]] - * - * @return the root [[StateObject]] - */ - StateRegistry.prototype.root = function () { - return this._root; - }; - /** - * Adds a state to the registry - * - * Registers a [[StateDeclaration]] or queues it for registration. - * - * Note: a state will be queued if the state's parent isn't yet registered. - * - * @param stateDefinition the definition of the state to register. - * @returns the internal [[StateObject]] object. - * If the state was successfully registered, then the object is fully built (See: [[StateBuilder]]). - * If the state was only queued, then the object is not fully built. - */ - StateRegistry.prototype.register = function (stateDefinition) { - return this.stateQueue.register(stateDefinition); - }; - /** @hidden */ - StateRegistry.prototype._deregisterTree = function (state) { - var _this = this; - var all$$1 = this.get().map(function (s) { return s.$$state(); }); - var getChildren = function (states) { - var children = all$$1.filter(function (s) { return states.indexOf(s.parent) !== -1; }); - return children.length === 0 ? children : children.concat(getChildren(children)); - }; - var children = getChildren([state]); - var deregistered = [state].concat(children).reverse(); - deregistered.forEach(function (state) { - var $ur = _this._router.urlRouter; - // Remove URL rule - $ur.rules().filter(propEq("state", state)).forEach($ur.removeRule.bind($ur)); - // Remove state from registry - delete _this.states[state.name]; - }); - return deregistered; - }; - /** - * Removes a state from the registry - * - * This removes a state from the registry. - * If the state has children, they are are also removed from the registry. - * - * @param stateOrName the state's name or object representation - * @returns {StateObject[]} a list of removed states - */ - StateRegistry.prototype.deregister = function (stateOrName) { - var _state = this.get(stateOrName); - if (!_state) - throw new Error("Can't deregister state; not found: " + stateOrName); - var deregisteredStates = this._deregisterTree(_state.$$state()); - this.listeners.forEach(function (listener) { return listener("deregistered", deregisteredStates.map(function (s) { return s.self; })); }); - return deregisteredStates; - }; - StateRegistry.prototype.get = function (stateOrName, base) { - var _this = this; - if (arguments.length === 0) - return Object.keys(this.states).map(function (name) { return _this.states[name].self; }); - var found = this.matcher.find(stateOrName, base); - return found && found.self || null; - }; - StateRegistry.prototype.decorator = function (name, func) { - return this.builder.builder(name, func); - }; - return StateRegistry; -}()); - -/** - * @coreapi - * @module url - */ -/** for typedoc */ -/** @hidden */ -function quoteRegExp(string, param) { - var surroundPattern = ['', ''], result = string.replace(/[\\\[\]\^$*+?.()|{}]/g, "\\$&"); - if (!param) - return result; - switch (param.squash) { - case false: - surroundPattern = ['(', ')' + (param.isOptional ? '?' : '')]; - break; - case true: - result = result.replace(/\/$/, ''); - surroundPattern = ['(?:\/(', ')|\/)?']; - break; - default: - surroundPattern = ["(" + param.squash + "|", ')?']; - break; - } - return result + surroundPattern[0] + param.type.pattern.source + surroundPattern[1]; -} -/** @hidden */ -var memoizeTo = function (obj, prop$$1, fn) { - return obj[prop$$1] = obj[prop$$1] || fn(); -}; -/** @hidden */ -var splitOnSlash = splitOnDelim('/'); -/** - * Matches URLs against patterns. - * - * Matches URLs against patterns and extracts named parameters from the path or the search - * part of the URL. - * - * A URL pattern consists of a path pattern, optionally followed by '?' and a list of search (query) - * parameters. Multiple search parameter names are separated by '&'. Search parameters - * do not influence whether or not a URL is matched, but their values are passed through into - * the matched parameters returned by [[UrlMatcher.exec]]. - * - * - *Path parameters* are defined using curly brace placeholders (`/somepath/{param}`) - * or colon placeholders (`/somePath/:param`). - * - * - *A parameter RegExp* may be defined for a param after a colon - * (`/somePath/{param:[a-zA-Z0-9]+}`) in a curly brace placeholder. - * The regexp must match for the url to be matched. - * Should the regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash. - * - * Note: a RegExp parameter will encode its value using either [[ParamTypes.path]] or [[ParamTypes.query]]. - * - * - *Custom parameter types* may also be specified after a colon (`/somePath/{param:int}`) in curly brace parameters. - * See [[UrlMatcherFactory.type]] for more information. - * - * - *Catch-all parameters* are defined using an asterisk placeholder (`/somepath/*catchallparam`). - * A catch-all * parameter value will contain the remainder of the URL. - * - * --- - * - * Parameter names may contain only word characters (latin letters, digits, and underscore) and - * must be unique within the pattern (across both path and search parameters). - * A path parameter matches any number of characters other than '/'. For catch-all - * placeholders the path parameter matches any number of characters. - * - * Examples: - * - * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for - * trailing slashes, and patterns have to match the entire path, not just a prefix. - * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or - * '/user/bob/details'. The second path segment will be captured as the parameter 'id'. - * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax. - * * `'/user/{id:[^/]*}'` - Same as the previous example. - * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id - * parameter consists of 1 to 8 hex digits. - * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the - * path into the parameter 'path'. - * * `'/files/*path'` - ditto. - * * `'/calendar/{start:date}'` - Matches "/calendar/2014-11-12" (because the pattern defined - * in the built-in `date` ParamType matches `2014-11-12`) and provides a Date object in $stateParams.start - * - */ -var UrlMatcher = (function () { - /** - * @param pattern The pattern to compile into a matcher. - * @param paramTypes The [[ParamTypes]] registry - * @param config A configuration object - * - `caseInsensitive` - `true` if URL matching should be case insensitive, otherwise `false`, the default value (for backward compatibility) is `false`. - * - `strict` - `false` if matching against a URL with a trailing slash should be treated as equivalent to a URL without a trailing slash, the default value is `true`. - */ - function UrlMatcher(pattern$$1, paramTypes, paramFactory, config) { - var _this = this; - this.config = config; - /** @hidden */ - this._cache = { path: [this] }; - /** @hidden */ - this._children = []; - /** @hidden */ - this._params = []; - /** @hidden */ - this._segments = []; - /** @hidden */ - this._compiled = []; - this.pattern = pattern$$1; - this.config = defaults(this.config, { - params: {}, - strict: true, - caseInsensitive: false, - paramMap: identity - }); - // Find all placeholders and create a compiled pattern, using either classic or curly syntax: - // '*' name - // ':' name - // '{' name '}' - // '{' name ':' regexp '}' - // The regular expression is somewhat complicated due to the need to allow curly braces - // inside the regular expression. The placeholder regexp breaks down as follows: - // ([:*])([\w\[\]]+) - classic placeholder ($1 / $2) (search version has - for snake-case) - // \{([\w\[\]]+)(?:\:\s*( ... ))?\} - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case - // (?: ... | ... | ... )+ - the regexp consists of any number of atoms, an atom being either - // [^{}\\]+ - anything other than curly braces or backslash - // \\. - a backslash escape - // \{(?:[^{}\\]+|\\.)*\} - a matched set of curly braces containing other atoms - var placeholder = /([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g, searchPlaceholder = /([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g, last = 0, m, patterns = []; - var checkParamErrors = function (id) { - if (!UrlMatcher.nameValidator.test(id)) - throw new Error("Invalid parameter name '" + id + "' in pattern '" + pattern$$1 + "'"); - if (find(_this._params, propEq('id', id))) - throw new Error("Duplicate parameter name '" + id + "' in pattern '" + pattern$$1 + "'"); - }; - // Split into static segments separated by path parameter placeholders. - // The number of segments is always 1 more than the number of parameters. - var matchDetails = function (m, isSearch) { - // IE[78] returns '' for unmatched groups instead of null - var id = m[2] || m[3]; - var regexp = isSearch ? m[4] : m[4] || (m[1] === '*' ? '.*' : null); - var makeRegexpType = function (regexp) { return inherit(paramTypes.type(isSearch ? "query" : "path"), { - pattern: new RegExp(regexp, _this.config.caseInsensitive ? 'i' : undefined) - }); }; - return { - id: id, - regexp: regexp, - cfg: _this.config.params[id], - segment: pattern$$1.substring(last, m.index), - type: !regexp ? null : paramTypes.type(regexp) || makeRegexpType(regexp) - }; - }; - var p, segment; - while ((m = placeholder.exec(pattern$$1))) { - p = matchDetails(m, false); - if (p.segment.indexOf('?') >= 0) - break; // we're into the search part - checkParamErrors(p.id); - this._params.push(paramFactory.fromPath(p.id, p.type, this.config.paramMap(p.cfg, false))); - this._segments.push(p.segment); - patterns.push([p.segment, tail(this._params)]); - last = placeholder.lastIndex; - } - segment = pattern$$1.substring(last); - // Find any search parameter names and remove them from the last segment - var i = segment.indexOf('?'); - if (i >= 0) { - var search = segment.substring(i); - segment = segment.substring(0, i); - if (search.length > 0) { - last = 0; - while ((m = searchPlaceholder.exec(search))) { - p = matchDetails(m, true); - checkParamErrors(p.id); - this._params.push(paramFactory.fromSearch(p.id, p.type, this.config.paramMap(p.cfg, true))); - last = placeholder.lastIndex; - // check if ?& - } - } - } - this._segments.push(segment); - this._compiled = patterns.map(function (pattern$$1) { return quoteRegExp.apply(null, pattern$$1); }).concat(quoteRegExp(segment)); - } - /** - * Creates a new concatenated UrlMatcher - * - * Builds a new UrlMatcher by appending another UrlMatcher to this one. - * - * @param url A `UrlMatcher` instance to append as a child of the current `UrlMatcher`. - */ - UrlMatcher.prototype.append = function (url) { - this._children.push(url); - url._cache = { - path: this._cache.path.concat(url), - parent: this, - pattern: null, - }; - return url; - }; - /** @hidden */ - UrlMatcher.prototype.isRoot = function () { - return this._cache.path[0] === this; - }; - /** Returns the input pattern string */ - UrlMatcher.prototype.toString = function () { - return this.pattern; - }; - /** - * Tests the specified url/path against this matcher. - * - * Tests if the given url matches this matcher's pattern, and returns an object containing the captured - * parameter values. Returns null if the path does not match. - * - * The returned object contains the values - * of any search parameters that are mentioned in the pattern, but their value may be null if - * they are not present in `search`. This means that search parameters are always treated - * as optional. - * - * #### Example: - * ```js - * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', { - * x: '1', q: 'hello' - * }); - * // returns { id: 'bob', q: 'hello', r: null } - * ``` - * - * @param path The URL path to match, e.g. `$location.path()`. - * @param search URL search parameters, e.g. `$location.search()`. - * @param hash URL hash e.g. `$location.hash()`. - * @param options - * - * @returns The captured parameter values. - */ - UrlMatcher.prototype.exec = function (path, search, hash, options) { - var _this = this; - if (search === void 0) { search = {}; } - if (options === void 0) { options = {}; } - var match = memoizeTo(this._cache, 'pattern', function () { - return new RegExp([ - '^', - unnest(_this._cache.path.map(prop('_compiled'))).join(''), - _this.config.strict === false ? '\/?' : '', - '$' - ].join(''), _this.config.caseInsensitive ? 'i' : undefined); - }).exec(path); - if (!match) - return null; - //options = defaults(options, { isolate: false }); - var allParams = this.parameters(), pathParams = allParams.filter(function (param) { return !param.isSearch(); }), searchParams = allParams.filter(function (param) { return param.isSearch(); }), nPathSegments = this._cache.path.map(function (urlm) { return urlm._segments.length - 1; }).reduce(function (a, x) { return a + x; }), values$$1 = {}; - if (nPathSegments !== match.length - 1) - throw new Error("Unbalanced capture group in route '" + this.pattern + "'"); - function decodePathArray(string) { - var reverseString = function (str) { return str.split("").reverse().join(""); }; - var unquoteDashes = function (str) { return str.replace(/\\-/g, "-"); }; - var split = reverseString(string).split(/-(?!\\)/); - var allReversed = map(split, reverseString); - return map(allReversed, unquoteDashes).reverse(); - } - for (var i = 0; i < nPathSegments; i++) { - var param = pathParams[i]; - var value = match[i + 1]; - // if the param value matches a pre-replace pair, replace the value before decoding. - for (var j = 0; j < param.replace.length; j++) { - if (param.replace[j].from === value) - value = param.replace[j].to; - } - if (value && param.array === true) - value = decodePathArray(value); - if (isDefined(value)) - value = param.type.decode(value); - values$$1[param.id] = param.value(value); - } - searchParams.forEach(function (param) { - var value = search[param.id]; - for (var j = 0; j < param.replace.length; j++) { - if (param.replace[j].from === value) - value = param.replace[j].to; - } - if (isDefined(value)) - value = param.type.decode(value); - values$$1[param.id] = param.value(value); - }); - if (hash) - values$$1["#"] = hash; - return values$$1; - }; - /** - * @hidden - * Returns all the [[Param]] objects of all path and search parameters of this pattern in order of appearance. - * - * @returns {Array.} An array of [[Param]] objects. Must be treated as read-only. If the - * pattern has no parameters, an empty array is returned. - */ - UrlMatcher.prototype.parameters = function (opts) { - if (opts === void 0) { opts = {}; } - if (opts.inherit === false) - return this._params; - return unnest(this._cache.path.map(function (matcher) { return matcher._params; })); - }; - /** - * @hidden - * Returns a single parameter from this UrlMatcher by id - * - * @param id - * @param opts - * @returns {T|Param|any|boolean|UrlMatcher|null} - */ - UrlMatcher.prototype.parameter = function (id, opts) { - var _this = this; - if (opts === void 0) { opts = {}; } - var findParam = function () { - for (var _i = 0, _a = _this._params; _i < _a.length; _i++) { - var param = _a[_i]; - if (param.id === id) - return param; - } - }; - var parent = this._cache.parent; - return findParam() || (opts.inherit !== false && parent && parent.parameter(id, opts)) || null; - }; - /** - * Validates the input parameter values against this UrlMatcher - * - * Checks an object hash of parameters to validate their correctness according to the parameter - * types of this `UrlMatcher`. - * - * @param params The object hash of parameters to validate. - * @returns Returns `true` if `params` validates, otherwise `false`. - */ - UrlMatcher.prototype.validates = function (params) { - var validParamVal = function (param, val$$1) { - return !param || param.validates(val$$1); - }; - params = params || {}; - // I'm not sure why this checks only the param keys passed in, and not all the params known to the matcher - var paramSchema = this.parameters().filter(function (paramDef) { return params.hasOwnProperty(paramDef.id); }); - return paramSchema.map(function (paramDef) { return validParamVal(paramDef, params[paramDef.id]); }).reduce(allTrueR, true); - }; - /** - * Given a set of parameter values, creates a URL from this UrlMatcher. - * - * Creates a URL that matches this pattern by substituting the specified values - * for the path and search parameters. - * - * #### Example: - * ```js - * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' }); - * // returns '/user/bob?q=yes' - * ``` - * - * @param values the values to substitute for the parameters in this pattern. - * @returns the formatted URL (path and optionally search part). - */ - UrlMatcher.prototype.format = function (values$$1) { - if (values$$1 === void 0) { values$$1 = {}; } - // Build the full path of UrlMatchers (including all parent UrlMatchers) - var urlMatchers = this._cache.path; - // Extract all the static segments and Params (processed as ParamDetails) - // into an ordered array - var pathSegmentsAndParams = urlMatchers.map(UrlMatcher.pathSegmentsAndParams) - .reduce(unnestR, []) - .map(function (x) { return isString(x) ? x : getDetails(x); }); - // Extract the query params into a separate array - var queryParams = urlMatchers.map(UrlMatcher.queryParams) - .reduce(unnestR, []) - .map(getDetails); - var isInvalid = function (param) { return param.isValid === false; }; - if (pathSegmentsAndParams.concat(queryParams).filter(isInvalid).length) { - return null; - } - /** - * Given a Param, applies the parameter value, then returns detailed information about it - */ - function getDetails(param) { - // Normalize to typed value - var value = param.value(values$$1[param.id]); - var isValid = param.validates(value); - var isDefaultValue = param.isDefaultValue(value); - // Check if we're in squash mode for the parameter - var squash = isDefaultValue ? param.squash : false; - // Allow the Parameter's Type to encode the value - var encoded = param.type.encode(value); - return { param: param, value: value, isValid: isValid, isDefaultValue: isDefaultValue, squash: squash, encoded: encoded }; - } - // Build up the path-portion from the list of static segments and parameters - var pathString = pathSegmentsAndParams.reduce(function (acc, x) { - // The element is a static segment (a raw string); just append it - if (isString(x)) - return acc + x; - // Otherwise, it's a ParamDetails. - var squash = x.squash, encoded = x.encoded, param = x.param; - // If squash is === true, try to remove a slash from the path - if (squash === true) - return (acc.match(/\/$/)) ? acc.slice(0, -1) : acc; - // If squash is a string, use the string for the param value - if (isString(squash)) - return acc + squash; - if (squash !== false) - return acc; // ? - if (encoded == null) - return acc; - // If this parameter value is an array, encode the value using encodeDashes - if (isArray(encoded)) - return acc + map(encoded, UrlMatcher.encodeDashes).join("-"); - // If the parameter type is "raw", then do not encodeURIComponent - if (param.raw) - return acc + encoded; - // Encode the value - return acc + encodeURIComponent(encoded); - }, ""); - // Build the query string by applying parameter values (array or regular) - // then mapping to key=value, then flattening and joining using "&" - var queryString = queryParams.map(function (paramDetails) { - var param = paramDetails.param, squash = paramDetails.squash, encoded = paramDetails.encoded, isDefaultValue = paramDetails.isDefaultValue; - if (encoded == null || (isDefaultValue && squash !== false)) - return; - if (!isArray(encoded)) - encoded = [encoded]; - if (encoded.length === 0) - return; - if (!param.raw) - encoded = map(encoded, encodeURIComponent); - return encoded.map(function (val$$1) { return param.id + "=" + val$$1; }); - }).filter(identity).reduce(unnestR, []).join("&"); - // Concat the pathstring with the queryString (if exists) and the hashString (if exists) - return pathString + (queryString ? "?" + queryString : "") + (values$$1["#"] ? "#" + values$$1["#"] : ""); - }; - /** @hidden */ - UrlMatcher.encodeDashes = function (str) { - return encodeURIComponent(str).replace(/-/g, function (c) { return "%5C%" + c.charCodeAt(0).toString(16).toUpperCase(); }); - }; - /** @hidden Given a matcher, return an array with the matcher's path segments and path params, in order */ - UrlMatcher.pathSegmentsAndParams = function (matcher) { - var staticSegments = matcher._segments; - var pathParams = matcher._params.filter(function (p) { return p.location === exports.DefType.PATH; }); - return arrayTuples(staticSegments, pathParams.concat(undefined)) - .reduce(unnestR, []) - .filter(function (x) { return x !== "" && isDefined(x); }); - }; - /** @hidden Given a matcher, return an array with the matcher's query params */ - UrlMatcher.queryParams = function (matcher) { - return matcher._params.filter(function (p) { return p.location === exports.DefType.SEARCH; }); - }; - /** - * Compare two UrlMatchers - * - * This comparison function converts a UrlMatcher into static and dynamic path segments. - * Each static path segment is a static string between a path separator (slash character). - * Each dynamic segment is a path parameter. - * - * The comparison function sorts static segments before dynamic ones. - */ - UrlMatcher.compare = function (a, b) { - /** - * Turn a UrlMatcher and all its parent matchers into an array - * of slash literals '/', string literals, and Param objects - * - * This example matcher matches strings like "/foo/:param/tail": - * var matcher = $umf.compile("/foo").append($umf.compile("/:param")).append($umf.compile("/")).append($umf.compile("tail")); - * var result = segments(matcher); // [ '/', 'foo', '/', Param, '/', 'tail' ] - * - * Caches the result as `matcher._cache.segments` - */ - var segments = function (matcher) { - return matcher._cache.segments = matcher._cache.segments || - matcher._cache.path.map(UrlMatcher.pathSegmentsAndParams) - .reduce(unnestR, []) - .reduce(joinNeighborsR, []) - .map(function (x) { return isString(x) ? splitOnSlash(x) : x; }) - .reduce(unnestR, []); - }; - /** - * Gets the sort weight for each segment of a UrlMatcher - * - * Caches the result as `matcher._cache.weights` - */ - var weights = function (matcher) { - return matcher._cache.weights = matcher._cache.weights || - segments(matcher).map(function (segment) { - // Sort slashes first, then static strings, the Params - if (segment === '/') - return 1; - if (isString(segment)) - return 2; - if (segment instanceof Param) - return 3; - }); - }; - var cmp, i, pairs$$1 = arrayTuples(weights(a), weights(b)); - for (i = 0; i < pairs$$1.length; i++) { - cmp = pairs$$1[i][0] - pairs$$1[i][1]; - if (cmp !== 0) - return cmp; - } - return 0; - }; - return UrlMatcher; -}()); -/** @hidden */ -UrlMatcher.nameValidator = /^\w+([-.]+\w+)*(?:\[\])?$/; - -/** - * @internalapi - * @module url - */ /** for typedoc */ -/** - * Factory for [[UrlMatcher]] instances. - * - * The factory is available to ng1 services as - * `$urlMatcherFactor` or ng1 providers as `$urlMatcherFactoryProvider`. - */ -var UrlMatcherFactory = (function () { - function UrlMatcherFactory() { - var _this = this; - /** @hidden */ this.paramTypes = new ParamTypes(); - /** @hidden */ this._isCaseInsensitive = false; - /** @hidden */ this._isStrictMode = true; - /** @hidden */ this._defaultSquashPolicy = false; - /** @hidden */ - this._getConfig = function (config) { - return extend({ strict: _this._isStrictMode, caseInsensitive: _this._isCaseInsensitive }, config); - }; - /** @internalapi Creates a new [[Param]] for a given location (DefType) */ - this.paramFactory = { - /** Creates a new [[Param]] from a CONFIG block */ - fromConfig: function (id, type, config) { - return new Param(id, type, config, exports.DefType.CONFIG, _this); - }, - /** Creates a new [[Param]] from a url PATH */ - fromPath: function (id, type, config) { - return new Param(id, type, config, exports.DefType.PATH, _this); - }, - /** Creates a new [[Param]] from a url SEARCH */ - fromSearch: function (id, type, config) { - return new Param(id, type, config, exports.DefType.SEARCH, _this); - }, - }; - extend(this, { UrlMatcher: UrlMatcher, Param: Param }); - } - /** @inheritdoc */ - UrlMatcherFactory.prototype.caseInsensitive = function (value) { - return this._isCaseInsensitive = isDefined(value) ? value : this._isCaseInsensitive; - }; - /** @inheritdoc */ - UrlMatcherFactory.prototype.strictMode = function (value) { - return this._isStrictMode = isDefined(value) ? value : this._isStrictMode; - }; - /** @inheritdoc */ - UrlMatcherFactory.prototype.defaultSquashPolicy = function (value) { - if (isDefined(value) && value !== true && value !== false && !isString(value)) - throw new Error("Invalid squash policy: " + value + ". Valid policies: false, true, arbitrary-string"); - return this._defaultSquashPolicy = isDefined(value) ? value : this._defaultSquashPolicy; - }; - /** - * Creates a [[UrlMatcher]] for the specified pattern. - * - * @param pattern The URL pattern. - * @param config The config object hash. - * @returns The UrlMatcher. - */ - UrlMatcherFactory.prototype.compile = function (pattern, config) { - return new UrlMatcher(pattern, this.paramTypes, this.paramFactory, this._getConfig(config)); - }; - /** - * Returns true if the specified object is a [[UrlMatcher]], or false otherwise. - * - * @param object The object to perform the type check against. - * @returns `true` if the object matches the `UrlMatcher` interface, by - * implementing all the same methods. - */ - UrlMatcherFactory.prototype.isMatcher = function (object) { - // TODO: typeof? - if (!isObject(object)) - return false; - var result = true; - forEach(UrlMatcher.prototype, function (val, name) { - if (isFunction(val)) - result = result && (isDefined(object[name]) && isFunction(object[name])); - }); - return result; - }; - - /** - * Creates and registers a custom [[ParamType]] object - * - * A [[ParamType]] can be used to generate URLs with typed parameters. - * - * @param name The type name. - * @param definition The type definition. See [[ParamTypeDefinition]] for information on the values accepted. - * @param definitionFn A function that is injected before the app runtime starts. - * The result of this function should be a [[ParamTypeDefinition]]. - * The result is merged into the existing `definition`. - * See [[ParamType]] for information on the values accepted. - * - * @returns - if a type was registered: the [[UrlMatcherFactory]] - * - if only the `name` parameter was specified: the currently registered [[ParamType]] object, or undefined - * - * Note: Register custom types *before using them* in a state definition. - * - * See [[ParamTypeDefinition]] for examples - */ - UrlMatcherFactory.prototype.type = function (name, definition, definitionFn) { - var type = this.paramTypes.type(name, definition, definitionFn); - return !isDefined(definition) ? type : this; - }; - - /** @hidden */ - UrlMatcherFactory.prototype.$get = function () { - this.paramTypes.enqueue = false; - this.paramTypes._flushTypeQueue(); - return this; - }; - - /** @internalapi */ - UrlMatcherFactory.prototype.dispose = function () { - this.paramTypes.dispose(); - }; - return UrlMatcherFactory; -}()); - -/** - * @coreapi - * @module url - */ /** */ -/** - * Creates a [[UrlRule]] - * - * Creates a [[UrlRule]] from a: - * - * - `string` - * - [[UrlMatcher]] - * - `RegExp` - * - [[StateObject]] - * @internalapi - */ -var UrlRuleFactory = (function () { - function UrlRuleFactory(router) { - this.router = router; - } - UrlRuleFactory.prototype.compile = function (str) { - return this.router.urlMatcherFactory.compile(str); - }; - UrlRuleFactory.prototype.create = function (what, handler) { - var _this = this; - var makeRule = pattern([ - [isString, function (_what) { return makeRule(_this.compile(_what)); }], - [is(UrlMatcher), function (_what) { return _this.fromUrlMatcher(_what, handler); }], - [isState, function (_what) { return _this.fromState(_what, _this.router); }], - [is(RegExp), function (_what) { return _this.fromRegExp(_what, handler); }], - [isFunction, function (_what) { return new BaseUrlRule(_what, handler); }], - ]); - var rule = makeRule(what); - if (!rule) - throw new Error("invalid 'what' in when()"); - return rule; - }; - /** - * A UrlRule which matches based on a UrlMatcher - * - * The `handler` may be either a `string`, a [[UrlRuleHandlerFn]] or another [[UrlMatcher]] - * - * ## Handler as a function - * - * If `handler` is a function, the function is invoked with: - * - * - matched parameter values ([[RawParams]] from [[UrlMatcher.exec]]) - * - url: the current Url ([[UrlParts]]) - * - router: the router object ([[UIRouter]]) - * - * #### Example: - * ```js - * var urlMatcher = $umf.compile("/foo/:fooId/:barId"); - * var rule = factory.fromUrlMatcher(urlMatcher, match => "/home/" + match.fooId + "/" + match.barId); - * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' } - * var result = rule.handler(match); // '/home/123/456' - * ``` - * - * ## Handler as UrlMatcher - * - * If `handler` is a UrlMatcher, the handler matcher is used to create the new url. - * The `handler` UrlMatcher is formatted using the matched param from the first matcher. - * The url is replaced with the result. - * - * #### Example: - * ```js - * var urlMatcher = $umf.compile("/foo/:fooId/:barId"); - * var handler = $umf.compile("/home/:fooId/:barId"); - * var rule = factory.fromUrlMatcher(urlMatcher, handler); - * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' } - * var result = rule.handler(match); // '/home/123/456' - * ``` - */ - UrlRuleFactory.prototype.fromUrlMatcher = function (urlMatcher, handler) { - var _handler = handler; - if (isString(handler)) - handler = this.router.urlMatcherFactory.compile(handler); - if (is(UrlMatcher)(handler)) - _handler = function (match) { return handler.format(match); }; - function match(url) { - var match = urlMatcher.exec(url.path, url.search, url.hash); - return urlMatcher.validates(match) && match; - } - // Prioritize URLs, lowest to highest: - // - Some optional URL parameters, but none matched - // - No optional parameters in URL - // - Some optional parameters, some matched - // - Some optional parameters, all matched - function matchPriority(params) { - var optional = urlMatcher.parameters().filter(function (param) { return param.isOptional; }); - if (!optional.length) - return 0.000001; - var matched = optional.filter(function (param) { return params[param.id]; }); - return matched.length / optional.length; - } - var details = { urlMatcher: urlMatcher, matchPriority: matchPriority, type: "URLMATCHER" }; - return extend(new BaseUrlRule(match, _handler), details); - }; - /** - * A UrlRule which matches a state by its url - * - * #### Example: - * ```js - * var rule = factory.fromState($state.get('foo'), router); - * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' } - * var result = rule.handler(match); - * // Starts a transition to 'foo' with params: { fooId: '123', barId: '456' } - * ``` - */ - UrlRuleFactory.prototype.fromState = function (state, router) { - /** - * Handles match by transitioning to matched state - * - * First checks if the router should start a new transition. - * A new transition is not required if the current state's URL - * and the new URL are already identical - */ - var handler = function (match) { - var $state = router.stateService; - var globals = router.globals; - if ($state.href(state, match) !== $state.href(globals.current, globals.params)) { - $state.transitionTo(state, match, { inherit: true, source: "url" }); - } - }; - var details = { state: state, type: "STATE" }; - return extend(this.fromUrlMatcher(state.url, handler), details); - }; - /** - * A UrlRule which matches based on a regular expression - * - * The `handler` may be either a [[UrlRuleHandlerFn]] or a string. - * - * ## Handler as a function - * - * If `handler` is a function, the function is invoked with: - * - * - regexp match array (from `regexp`) - * - url: the current Url ([[UrlParts]]) - * - router: the router object ([[UIRouter]]) - * - * #### Example: - * ```js - * var rule = factory.fromRegExp(/^\/foo\/(bar|baz)$/, match => "/home/" + match[1]) - * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ] - * var result = rule.handler(match); // '/home/bar' - * ``` - * - * ## Handler as string - * - * If `handler` is a string, the url is *replaced by the string* when the Rule is invoked. - * The string is first interpolated using `string.replace()` style pattern. - * - * #### Example: - * ```js - * var rule = factory.fromRegExp(/^\/foo\/(bar|baz)$/, "/home/$1") - * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ] - * var result = rule.handler(match); // '/home/bar' - * ``` - */ - UrlRuleFactory.prototype.fromRegExp = function (regexp, handler) { - if (regexp.global || regexp.sticky) - throw new Error("Rule RegExp must not be global or sticky"); - /** - * If handler is a string, the url will be replaced by the string. - * If the string has any String.replace() style variables in it (like `$2`), - * they will be replaced by the captures from [[match]] - */ - var redirectUrlTo = function (match) { - // Interpolates matched values into $1 $2, etc using a String.replace()-style pattern - return handler.replace(/\$(\$|\d{1,2})/, function (m, what) { - return match[what === '$' ? 0 : Number(what)]; - }); - }; - var _handler = isString(handler) ? redirectUrlTo : handler; - var match = function (url) { - return regexp.exec(url.path); - }; - var details = { regexp: regexp, type: "REGEXP" }; - return extend(new BaseUrlRule(match, _handler), details); - }; - return UrlRuleFactory; -}()); -UrlRuleFactory.isUrlRule = function (obj) { - return obj && ['type', 'match', 'handler'].every(function (key) { return isDefined(obj[key]); }); -}; -/** - * A base rule which calls `match` - * - * The value from the `match` function is passed through to the `handler`. - * @internalapi - */ -var BaseUrlRule = (function () { - function BaseUrlRule(match, handler) { - var _this = this; - this.match = match; - this.type = "RAW"; - this.matchPriority = function (match) { return 0 - _this.$id; }; - this.handler = handler || identity; - } - return BaseUrlRule; -}()); - -/** - * @internalapi - * @module url - */ -/** for typedoc */ -/** @hidden */ -function appendBasePath(url, isHtml5, absolute, baseHref) { - if (baseHref === '/') - return url; - if (isHtml5) - return baseHref.slice(0, -1) + url; - if (absolute) - return baseHref.slice(1) + url; - return url; -} -/** @hidden */ -var getMatcher = prop("urlMatcher"); -/** - * Default rule priority sorting function. - * - * Sorts rules by: - * - * - Explicit priority (set rule priority using [[UrlRulesApi.when]]) - * - Rule type (STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1) - * - `UrlMatcher` specificity ([[UrlMatcher.compare]]): works for STATE and URLMATCHER types to pick the most specific rule. - * - Registration order (for rule types other than STATE and URLMATCHER) - * - * @coreapi - */ -var defaultRuleSortFn; -defaultRuleSortFn = composeSort(sortBy(pipe(prop("priority"), function (x) { return -x; })), sortBy(pipe(prop("type"), function (type) { return ({ "STATE": 4, "URLMATCHER": 4, "REGEXP": 3, "RAW": 2, "OTHER": 1 })[type]; })), function (a, b) { return (getMatcher(a) && getMatcher(b)) ? UrlMatcher.compare(getMatcher(a), getMatcher(b)) : 0; }, sortBy(prop("$id"), inArray(["REGEXP", "RAW", "OTHER"]))); -/** - * Updates URL and responds to URL changes - * - * ### Deprecation warning: - * This class is now considered to be an internal API - * Use the [[UrlService]] instead. - * For configuring URL rules, use the [[UrlRulesApi]] which can be found as [[UrlService.rules]]. - * - * This class updates the URL when the state changes. - * It also responds to changes in the URL. - */ -var UrlRouter = (function () { - /** @hidden */ - function UrlRouter(router) { - /** @hidden */ this._sortFn = defaultRuleSortFn; - /** @hidden */ this._rules = []; - /** @hidden */ this.interceptDeferred = false; - /** @hidden */ this._id = 0; - /** @hidden */ this._sorted = false; - this._router = router; - this.urlRuleFactory = new UrlRuleFactory(router); - createProxyFunctions(val(UrlRouter.prototype), this, val(this)); - } - /** @internalapi */ - UrlRouter.prototype.dispose = function () { - this.listen(false); - this._rules = []; - delete this._otherwiseFn; - }; - /** @inheritdoc */ - UrlRouter.prototype.sort = function (compareFn) { - this._rules.sort(this._sortFn = compareFn || this._sortFn); - this._sorted = true; - }; - UrlRouter.prototype.ensureSorted = function () { - this._sorted || this.sort(); - }; - /** - * Given a URL, check all rules and return the best [[MatchResult]] - * @param url - * @returns {MatchResult} - */ - UrlRouter.prototype.match = function (url) { - var _this = this; - this.ensureSorted(); - url = extend({ path: '', search: {}, hash: '' }, url); - var rules = this.rules(); - if (this._otherwiseFn) - rules.push(this._otherwiseFn); - // Checks a single rule. Returns { rule: rule, match: match, weight: weight } if it matched, or undefined - var checkRule = function (rule) { - var match = rule.match(url, _this._router); - return match && { match: match, rule: rule, weight: rule.matchPriority(match) }; - }; - // The rules are pre-sorted. - // - Find the first matching rule. - // - Find any other matching rule that sorted *exactly the same*, according to `.sort()`. - // - Choose the rule with the highest match weight. - var best; - for (var i = 0; i < rules.length; i++) { - // Stop when there is a 'best' rule and the next rule sorts differently than it. - if (best && this._sortFn(rules[i], best.rule) !== 0) - break; - var current = checkRule(rules[i]); - // Pick the best MatchResult - best = (!best || current && current.weight > best.weight) ? current : best; - } - return best; - }; - /** @inheritdoc */ - UrlRouter.prototype.sync = function (evt) { - if (evt && evt.defaultPrevented) - return; - var router = this._router, $url = router.urlService, $state = router.stateService; - var url = { - path: $url.path(), search: $url.search(), hash: $url.hash(), - }; - var best = this.match(url); - var applyResult = pattern([ - [isString, function (newurl) { return $url.url(newurl, true); }], - [TargetState.isDef, function (def) { return $state.go(def.state, def.params, def.options); }], - [is(TargetState), function (target) { return $state.go(target.state(), target.params(), target.options()); }], - ]); - applyResult(best && best.rule.handler(best.match, url, router)); - }; - /** @inheritdoc */ - UrlRouter.prototype.listen = function (enabled) { - var _this = this; - if (enabled === false) { - this._stopFn && this._stopFn(); - delete this._stopFn; - } - else { - return this._stopFn = this._stopFn || this._router.urlService.onChange(function (evt) { return _this.sync(evt); }); - } - }; - /** - * Internal API. - * @internalapi - */ - UrlRouter.prototype.update = function (read) { - var $url = this._router.locationService; - if (read) { - this.location = $url.path(); - return; - } - if ($url.path() === this.location) - return; - $url.url(this.location, true); - }; - /** - * Internal API. - * - * Pushes a new location to the browser history. - * - * @internalapi - * @param urlMatcher - * @param params - * @param options - */ - UrlRouter.prototype.push = function (urlMatcher, params, options) { - var replace = options && !!options.replace; - this._router.urlService.url(urlMatcher.format(params || {}), replace); - }; - /** - * Builds and returns a URL with interpolated parameters - * - * #### Example: - * ```js - * matcher = $umf.compile("/about/:person"); - * params = { person: "bob" }; - * $bob = $urlRouter.href(matcher, params); - * // $bob == "/about/bob"; - * ``` - * - * @param urlMatcher The [[UrlMatcher]] object which is used as the template of the URL to generate. - * @param params An object of parameter values to fill the matcher's required parameters. - * @param options Options object. The options are: - * - * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl". - * - * @returns Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher` - */ - UrlRouter.prototype.href = function (urlMatcher, params, options) { - var url = urlMatcher.format(params); - if (url == null) - return null; - options = options || { absolute: false }; - var cfg = this._router.urlService.config; - var isHtml5 = cfg.html5Mode(); - if (!isHtml5 && url !== null) { - url = "#" + cfg.hashPrefix() + url; - } - url = appendBasePath(url, isHtml5, options.absolute, cfg.baseHref()); - if (!options.absolute || !url) { - return url; - } - var slash = (!isHtml5 && url ? '/' : ''), port = cfg.port(); - port = (port === 80 || port === 443 ? '' : ':' + port); - return [cfg.protocol(), '://', cfg.host(), port, slash, url].join(''); - }; - /** - * Manually adds a URL Rule. - * - * Usually, a url rule is added using [[StateDeclaration.url]] or [[when]]. - * This api can be used directly for more control (to register a [[BaseUrlRule]], for example). - * Rules can be created using [[UrlRouter.urlRuleFactory]], or create manually as simple objects. - * - * A rule should have a `match` function which returns truthy if the rule matched. - * It should also have a `handler` function which is invoked if the rule is the best match. - * - * @return a function that deregisters the rule - */ - UrlRouter.prototype.rule = function (rule) { - var _this = this; - if (!UrlRuleFactory.isUrlRule(rule)) - throw new Error("invalid rule"); - rule.$id = this._id++; - rule.priority = rule.priority || 0; - this._rules.push(rule); - this._sorted = false; - return function () { return _this.removeRule(rule); }; - }; - /** @inheritdoc */ - UrlRouter.prototype.removeRule = function (rule) { - removeFrom(this._rules, rule); - }; - /** @inheritdoc */ - UrlRouter.prototype.rules = function () { - this.ensureSorted(); - return this._rules.slice(); - }; - /** @inheritdoc */ - UrlRouter.prototype.otherwise = function (handler) { - var handlerFn = getHandlerFn(handler); - this._otherwiseFn = this.urlRuleFactory.create(val(true), handlerFn); - this._sorted = false; - }; - - /** @inheritdoc */ - UrlRouter.prototype.initial = function (handler) { - var handlerFn = getHandlerFn(handler); - var matchFn = function (urlParts, router) { - return router.globals.transitionHistory.size() === 0 && !!/^\/?$/.exec(urlParts.path); - }; - this.rule(this.urlRuleFactory.create(matchFn, handlerFn)); - }; - - /** @inheritdoc */ - UrlRouter.prototype.when = function (matcher, handler, options) { - var rule = this.urlRuleFactory.create(matcher, handler); - if (isDefined(options && options.priority)) - rule.priority = options.priority; - this.rule(rule); - return rule; - }; - - /** @inheritdoc */ - UrlRouter.prototype.deferIntercept = function (defer) { - if (defer === undefined) - defer = true; - this.interceptDeferred = defer; - }; - - return UrlRouter; -}()); -function getHandlerFn(handler) { - if (!isFunction(handler) && !isString(handler) && !is(TargetState)(handler) && !TargetState.isDef(handler)) { - throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property"); - } - return isFunction(handler) ? handler : val(handler); -} - -/** - * @coreapi - * @module view - */ /** for typedoc */ -/** - * The View service - * - * This service pairs existing `ui-view` components (which live in the DOM) - * with view configs (from the state declaration objects: [[StateDeclaration.views]]). - * - * - After a successful Transition, the views from the newly entered states are activated via [[activateViewConfig]]. - * The views from exited states are deactivated via [[deactivateViewConfig]]. - * (See: the [[registerActivateViews]] Transition Hook) - * - * - As `ui-view` components pop in and out of existence, they register themselves using [[registerUIView]]. - * - * - When the [[sync]] function is called, the registered `ui-view`(s) ([[ActiveUIView]]) - * are configured with the matching [[ViewConfig]](s) - * - */ -var ViewService = (function () { - function ViewService() { - var _this = this; - this._uiViews = []; - this._viewConfigs = []; - this._viewConfigFactories = {}; - this._pluginapi = { - _rootViewContext: this._rootViewContext.bind(this), - _viewConfigFactory: this._viewConfigFactory.bind(this), - _registeredUIViews: function () { return _this._uiViews; }, - _activeViewConfigs: function () { return _this._viewConfigs; }, - }; - } - ViewService.prototype._rootViewContext = function (context) { - return this._rootContext = context || this._rootContext; - }; - - ViewService.prototype._viewConfigFactory = function (viewType, factory) { - this._viewConfigFactories[viewType] = factory; - }; - ViewService.prototype.createViewConfig = function (path, decl) { - var cfgFactory = this._viewConfigFactories[decl.$type]; - if (!cfgFactory) - throw new Error("ViewService: No view config factory registered for type " + decl.$type); - var cfgs = cfgFactory(path, decl); - return isArray(cfgs) ? cfgs : [cfgs]; - }; - /** - * Deactivates a ViewConfig. - * - * This function deactivates a `ViewConfig`. - * After calling [[sync]], it will un-pair from any `ui-view` with which it is currently paired. - * - * @param viewConfig The ViewConfig view to deregister. - */ - ViewService.prototype.deactivateViewConfig = function (viewConfig) { - trace.traceViewServiceEvent("<- Removing", viewConfig); - removeFrom(this._viewConfigs, viewConfig); - }; - ViewService.prototype.activateViewConfig = function (viewConfig) { - trace.traceViewServiceEvent("-> Registering", viewConfig); - this._viewConfigs.push(viewConfig); - }; - ViewService.prototype.sync = function () { - var _this = this; - var uiViewsByFqn = this._uiViews.map(function (uiv) { return [uiv.fqn, uiv]; }).reduce(applyPairs, {}); - // Return a weighted depth value for a uiView. - // The depth is the nesting depth of ui-views (based on FQN; times 10,000) - // plus the depth of the state that is populating the uiView - function uiViewDepth(uiView) { - var stateDepth = function (context) { - return context && context.parent ? stateDepth(context.parent) + 1 : 1; - }; - return (uiView.fqn.split(".").length * 10000) + stateDepth(uiView.creationContext); - } - // Return the ViewConfig's context's depth in the context tree. - function viewConfigDepth(config) { - var context = config.viewDecl.$context, count = 0; - while (++count && context.parent) - context = context.parent; - return count; - } - // Given a depth function, returns a compare function which can return either ascending or descending order - var depthCompare = curry(function (depthFn, posNeg, left, right) { return posNeg * (depthFn(left) - depthFn(right)); }); - var matchingConfigPair = function (uiView) { - var matchingConfigs = _this._viewConfigs.filter(ViewService.matches(uiViewsByFqn, uiView)); - if (matchingConfigs.length > 1) { - // This is OK. Child states can target a ui-view that the parent state also targets (the child wins) - // Sort by depth and return the match from the deepest child - // console.log(`Multiple matching view configs for ${uiView.fqn}`, matchingConfigs); - matchingConfigs.sort(depthCompare(viewConfigDepth, -1)); // descending - } - return [uiView, matchingConfigs[0]]; - }; - var configureUIView = function (_a) { - var uiView = _a[0], viewConfig = _a[1]; - // If a parent ui-view is reconfigured, it could destroy child ui-views. - // Before configuring a child ui-view, make sure it's still in the active uiViews array. - if (_this._uiViews.indexOf(uiView) !== -1) - uiView.configUpdated(viewConfig); - }; - // Sort views by FQN and state depth. Process uiviews nearest the root first. - this._uiViews.sort(depthCompare(uiViewDepth, 1)).map(matchingConfigPair).forEach(configureUIView); - }; - - /** - * Registers a `ui-view` component - * - * When a `ui-view` component is created, it uses this method to register itself. - * After registration the [[sync]] method is used to ensure all `ui-view` are configured with the proper [[ViewConfig]]. - * - * Note: the `ui-view` component uses the `ViewConfig` to determine what view should be loaded inside the `ui-view`, - * and what the view's state context is. - * - * Note: There is no corresponding `deregisterUIView`. - * A `ui-view` should hang on to the return value of `registerUIView` and invoke it to deregister itself. - * - * @param uiView The metadata for a UIView - * @return a de-registration function used when the view is destroyed. - */ - ViewService.prototype.registerUIView = function (uiView) { - trace.traceViewServiceUIViewEvent("-> Registering", uiView); - var uiViews = this._uiViews; - var fqnMatches = function (uiv) { return uiv.fqn === uiView.fqn; }; - if (uiViews.filter(fqnMatches).length) - trace.traceViewServiceUIViewEvent("!!!! duplicate uiView named:", uiView); - uiViews.push(uiView); - this.sync(); - return function () { - var idx = uiViews.indexOf(uiView); - if (idx === -1) { - trace.traceViewServiceUIViewEvent("Tried removing non-registered uiView", uiView); - return; - } - trace.traceViewServiceUIViewEvent("<- Deregistering", uiView); - removeFrom(uiViews)(uiView); - }; - }; - - /** - * Returns the list of views currently available on the page, by fully-qualified name. - * - * @return {Array} Returns an array of fully-qualified view names. - */ - ViewService.prototype.available = function () { - return this._uiViews.map(prop("fqn")); - }; - /** - * Returns the list of views on the page containing loaded content. - * - * @return {Array} Returns an array of fully-qualified view names. - */ - ViewService.prototype.active = function () { - return this._uiViews.filter(prop("$config")).map(prop("name")); - }; - /** - * Normalizes a view's name from a state.views configuration block. - * - * This should be used by a framework implementation to calculate the values for - * [[_ViewDeclaration.$uiViewName]] and [[_ViewDeclaration.$uiViewContextAnchor]]. - * - * @param context the context object (state declaration) that the view belongs to - * @param rawViewName the name of the view, as declared in the [[StateDeclaration.views]] - * - * @returns the normalized uiViewName and uiViewContextAnchor that the view targets - */ - ViewService.normalizeUIViewTarget = function (context, rawViewName) { - if (rawViewName === void 0) { rawViewName = ""; } - // TODO: Validate incoming view name with a regexp to allow: - // ex: "view.name@foo.bar" , "^.^.view.name" , "view.name@^.^" , "" , - // "@" , "$default@^" , "!$default.$default" , "!foo.bar" - var viewAtContext = rawViewName.split("@"); - var uiViewName = viewAtContext[0] || "$default"; // default to unnamed view - var uiViewContextAnchor = isString(viewAtContext[1]) ? viewAtContext[1] : "^"; // default to parent context - // Handle relative view-name sugar syntax. - // Matches rawViewName "^.^.^.foo.bar" into array: ["^.^.^.foo.bar", "^.^.^", "foo.bar"], - var relativeViewNameSugar = /^(\^(?:\.\^)*)\.(.*$)/.exec(uiViewName); - if (relativeViewNameSugar) { - // Clobbers existing contextAnchor (rawViewName validation will fix this) - uiViewContextAnchor = relativeViewNameSugar[1]; // set anchor to "^.^.^" - uiViewName = relativeViewNameSugar[2]; // set view-name to "foo.bar" - } - if (uiViewName.charAt(0) === '!') { - uiViewName = uiViewName.substr(1); - uiViewContextAnchor = ""; // target absolutely from root - } - // handle parent relative targeting "^.^.^" - var relativeMatch = /^(\^(?:\.\^)*)$/; - if (relativeMatch.exec(uiViewContextAnchor)) { - var anchor = uiViewContextAnchor.split(".").reduce((function (anchor, x) { return anchor.parent; }), context); - uiViewContextAnchor = anchor.name; - } - else if (uiViewContextAnchor === '.') { - uiViewContextAnchor = context.name; - } - return { uiViewName: uiViewName, uiViewContextAnchor: uiViewContextAnchor }; - }; - return ViewService; -}()); -/** - * Given a ui-view and a ViewConfig, determines if they "match". - * - * A ui-view has a fully qualified name (fqn) and a context object. The fqn is built from its overall location in - * the DOM, describing its nesting relationship to any parent ui-view tags it is nested inside of. - * - * A ViewConfig has a target ui-view name and a context anchor. The ui-view name can be a simple name, or - * can be a segmented ui-view path, describing a portion of a ui-view fqn. - * - * In order for a ui-view to match ViewConfig, ui-view's $type must match the ViewConfig's $type - * - * If the ViewConfig's target ui-view name is a simple name (no dots), then a ui-view matches if: - * - the ui-view's name matches the ViewConfig's target name - * - the ui-view's context matches the ViewConfig's anchor - * - * If the ViewConfig's target ui-view name is a segmented name (with dots), then a ui-view matches if: - * - There exists a parent ui-view where: - * - the parent ui-view's name matches the first segment (index 0) of the ViewConfig's target name - * - the parent ui-view's context matches the ViewConfig's anchor - * - And the remaining segments (index 1..n) of the ViewConfig's target name match the tail of the ui-view's fqn - * - * Example: - * - * DOM: - * - * - * - * - * - * - * - * - * - * uiViews: [ - * { fqn: "$default", creationContext: { name: "" } }, - * { fqn: "$default.foo", creationContext: { name: "A" } }, - * { fqn: "$default.foo.$default", creationContext: { name: "A.B" } } - * { fqn: "$default.foo.$default.bar", creationContext: { name: "A.B.C" } } - * ] - * - * These four view configs all match the ui-view with the fqn: "$default.foo.$default.bar": - * - * - ViewConfig1: { uiViewName: "bar", uiViewContextAnchor: "A.B.C" } - * - ViewConfig2: { uiViewName: "$default.bar", uiViewContextAnchor: "A.B" } - * - ViewConfig3: { uiViewName: "foo.$default.bar", uiViewContextAnchor: "A" } - * - ViewConfig4: { uiViewName: "$default.foo.$default.bar", uiViewContextAnchor: "" } - * - * Using ViewConfig3 as an example, it matches the ui-view with fqn "$default.foo.$default.bar" because: - * - The ViewConfig's segmented target name is: [ "foo", "$default", "bar" ] - * - There exists a parent ui-view (which has fqn: "$default.foo") where: - * - the parent ui-view's name "foo" matches the first segment "foo" of the ViewConfig's target name - * - the parent ui-view's context "A" matches the ViewConfig's anchor context "A" - * - And the remaining segments [ "$default", "bar" ].join("."_ of the ViewConfig's target name match - * the tail of the ui-view's fqn "default.bar" - * - * @internalapi - */ -ViewService.matches = function (uiViewsByFqn, uiView) { return function (viewConfig) { - // Don't supply an ng1 ui-view with an ng2 ViewConfig, etc - if (uiView.$type !== viewConfig.viewDecl.$type) - return false; - // Split names apart from both viewConfig and uiView into segments - var vc = viewConfig.viewDecl; - var vcSegments = vc.$uiViewName.split("."); - var uivSegments = uiView.fqn.split("."); - // Check if the tails of the segment arrays match. ex, these arrays' tails match: - // vc: ["foo", "bar"], uiv fqn: ["$default", "foo", "bar"] - if (!equals(vcSegments, uivSegments.slice(0 - vcSegments.length))) - return false; - // Now check if the fqn ending at the first segment of the viewConfig matches the context: - // ["$default", "foo"].join(".") == "$default.foo", does the ui-view $default.foo context match? - var negOffset = (1 - vcSegments.length) || undefined; - var fqnToFirstSegment = uivSegments.slice(0, negOffset).join("."); - var uiViewContext = uiViewsByFqn[fqnToFirstSegment].creationContext; - return vc.$uiViewContextAnchor === (uiViewContext && uiViewContext.name); -}; }; - -/** - * @coreapi - * @module core - */ /** */ -/** - * Global router state - * - * This is where we hold the global mutable state such as current state, current - * params, current transition, etc. - */ -var UIRouterGlobals = (function () { - function UIRouterGlobals() { - /** - * Current parameter values - * - * The parameter values from the latest successful transition - */ - this.params = new StateParams(); - /** @internalapi */ - this.lastStartedTransitionId = -1; - /** @internalapi */ - this.transitionHistory = new Queue([], 1); - /** @internalapi */ - this.successfulTransitions = new Queue([], 1); - } - UIRouterGlobals.prototype.dispose = function () { - this.transitionHistory.clear(); - this.successfulTransitions.clear(); - this.transition = null; - }; - return UIRouterGlobals; -}()); - -/** - * @coreapi - * @module url - */ /** */ -/** @hidden */ -var makeStub = function (keys) { - return keys.reduce(function (acc, key) { return (acc[key] = notImplemented(key), acc); }, { dispose: noop$1 }); -}; -/** @hidden */ var locationServicesFns = ["url", "path", "search", "hash", "onChange"]; -/** @hidden */ var locationConfigFns = ["port", "protocol", "host", "baseHref", "html5Mode", "hashPrefix"]; -/** @hidden */ var umfFns = ["type", "caseInsensitive", "strictMode", "defaultSquashPolicy"]; -/** @hidden */ var rulesFns = ["sort", "when", "initial", "otherwise", "rules", "rule", "removeRule"]; -/** @hidden */ var syncFns = ["deferIntercept", "listen", "sync", "match"]; -/** - * API for URL management - */ -var UrlService = (function () { - /** @hidden */ - function UrlService(router, lateBind) { - if (lateBind === void 0) { lateBind = true; } - this.router = router; - this.rules = {}; - this.config = {}; - // proxy function calls from UrlService to the LocationService/LocationConfig - var locationServices = function () { return router.locationService; }; - createProxyFunctions(locationServices, this, locationServices, locationServicesFns, lateBind); - var locationConfig = function () { return router.locationConfig; }; - createProxyFunctions(locationConfig, this.config, locationConfig, locationConfigFns, lateBind); - var umf = function () { return router.urlMatcherFactory; }; - createProxyFunctions(umf, this.config, umf, umfFns); - var urlRouter = function () { return router.urlRouter; }; - createProxyFunctions(urlRouter, this.rules, urlRouter, rulesFns); - createProxyFunctions(urlRouter, this, urlRouter, syncFns); - } - UrlService.prototype.url = function (newurl, replace, state) { return; }; - - /** @inheritdoc */ - UrlService.prototype.path = function () { return; }; - - /** @inheritdoc */ - UrlService.prototype.search = function () { return; }; - - /** @inheritdoc */ - UrlService.prototype.hash = function () { return; }; - - /** @inheritdoc */ - UrlService.prototype.onChange = function (callback) { return; }; - - /** - * Returns the current URL parts - * - * This method returns the current URL components as a [[UrlParts]] object. - * - * @returns the current url parts - */ - UrlService.prototype.parts = function () { - return { path: this.path(), search: this.search(), hash: this.hash() }; - }; - UrlService.prototype.dispose = function () { }; - /** @inheritdoc */ - UrlService.prototype.sync = function (evt) { return; }; - /** @inheritdoc */ - UrlService.prototype.listen = function (enabled) { return; }; - - /** @inheritdoc */ - UrlService.prototype.deferIntercept = function (defer) { return; }; - /** @inheritdoc */ - UrlService.prototype.match = function (urlParts) { return; }; - return UrlService; -}()); -/** @hidden */ -UrlService.locationServiceStub = makeStub(locationServicesFns); -/** @hidden */ -UrlService.locationConfigStub = makeStub(locationConfigFns); - -/** - * @coreapi - * @module core - */ /** */ -/** @hidden */ -var _routerInstance = 0; -/** - * The master class used to instantiate an instance of UI-Router. - * - * UI-Router (for each specific framework) will create an instance of this class during bootstrap. - * This class instantiates and wires the UI-Router services together. - * - * After a new instance of the UIRouter class is created, it should be configured for your app. - * For instance, app states should be registered with the [[UIRouter.stateRegistry]]. - * - * --- - * - * Normally the framework code will bootstrap UI-Router. - * If you are bootstrapping UIRouter manually, tell it to monitor the URL by calling - * [[UrlService.listen]] then [[UrlService.sync]]. - */ -var UIRouter = (function () { - /** - * Creates a new `UIRouter` object - * - * @param locationService a [[LocationServices]] implementation - * @param locationConfig a [[LocationConfig]] implementation - * @internalapi - */ - function UIRouter(locationService, locationConfig) { - if (locationService === void 0) { locationService = UrlService.locationServiceStub; } - if (locationConfig === void 0) { locationConfig = UrlService.locationConfigStub; } - this.locationService = locationService; - this.locationConfig = locationConfig; - /** @hidden */ this.$id = _routerInstance++; - /** @hidden */ this._disposed = false; - /** @hidden */ this._disposables = []; - /** Provides trace information to the console */ - this.trace = trace; - /** Provides services related to ui-view synchronization */ - this.viewService = new ViewService(); - /** Provides services related to Transitions */ - this.transitionService = new TransitionService(this); - /** Global router state */ - this.globals = new UIRouterGlobals(); - /** - * Deprecated for public use. Use [[urlService]] instead. - * @deprecated Use [[urlService]] instead - */ - this.urlMatcherFactory = new UrlMatcherFactory(); - /** - * Deprecated for public use. Use [[urlService]] instead. - * @deprecated Use [[urlService]] instead - */ - this.urlRouter = new UrlRouter(this); - /** Provides a registry for states, and related registration services */ - this.stateRegistry = new StateRegistry(this); - /** Provides services related to states */ - this.stateService = new StateService(this); - /** Provides services related to the URL */ - this.urlService = new UrlService(this); - /** @hidden */ - this._plugins = {}; - this.viewService._pluginapi._rootViewContext(this.stateRegistry.root()); - this.globals.$current = this.stateRegistry.root(); - this.globals.current = this.globals.$current.self; - this.disposable(this.globals); - this.disposable(this.stateService); - this.disposable(this.stateRegistry); - this.disposable(this.transitionService); - this.disposable(this.urlRouter); - this.disposable(locationService); - this.disposable(locationConfig); - } - /** Registers an object to be notified when the router is disposed */ - UIRouter.prototype.disposable = function (disposable) { - this._disposables.push(disposable); - }; - /** - * Disposes this router instance - * - * When called, clears resources retained by the router by calling `dispose(this)` on all - * registered [[disposable]] objects. - * - * Or, if a `disposable` object is provided, calls `dispose(this)` on that object only. - * - * @param disposable (optional) the disposable to dispose - */ - UIRouter.prototype.dispose = function (disposable) { - var _this = this; - if (disposable && isFunction(disposable.dispose)) { - disposable.dispose(this); - return undefined; - } - this._disposed = true; - this._disposables.slice().forEach(function (d) { - try { - typeof d.dispose === 'function' && d.dispose(_this); - removeFrom(_this._disposables, d); - } - catch (ignored) { } - }); - }; - /** - * Adds a plugin to UI-Router - * - * This method adds a UI-Router Plugin. - * A plugin can enhance or change UI-Router behavior using any public API. - * - * #### Example: - * ```js - * import { MyCoolPlugin } from "ui-router-cool-plugin"; - * - * var plugin = router.addPlugin(MyCoolPlugin); - * ``` - * - * ### Plugin authoring - * - * A plugin is simply a class (or constructor function) which accepts a [[UIRouter]] instance and (optionally) an options object. - * - * The plugin can implement its functionality using any of the public APIs of [[UIRouter]]. - * For example, it may configure router options or add a Transition Hook. - * - * The plugin can then be published as a separate module. - * - * #### Example: - * ```js - * export class MyAuthPlugin implements UIRouterPlugin { - * constructor(router: UIRouter, options: any) { - * this.name = "MyAuthPlugin"; - * let $transitions = router.transitionService; - * let $state = router.stateService; - * - * let authCriteria = { - * to: (state) => state.data && state.data.requiresAuth - * }; - * - * function authHook(transition: Transition) { - * let authService = transition.injector().get('AuthService'); - * if (!authService.isAuthenticated()) { - * return $state.target('login'); - * } - * } - * - * $transitions.onStart(authCriteria, authHook); - * } - * } - * ``` - * - * @param plugin one of: - * - a plugin class which implements [[UIRouterPlugin]] - * - a constructor function for a [[UIRouterPlugin]] which accepts a [[UIRouter]] instance - * - a factory function which accepts a [[UIRouter]] instance and returns a [[UIRouterPlugin]] instance - * @param options options to pass to the plugin class/factory - * @returns the registered plugin instance - */ - UIRouter.prototype.plugin = function (plugin, options) { - if (options === void 0) { options = {}; } - var pluginInstance = new plugin(this, options); - if (!pluginInstance.name) - throw new Error("Required property `name` missing on plugin: " + pluginInstance); - this._disposables.push(pluginInstance); - return this._plugins[pluginInstance.name] = pluginInstance; - }; - UIRouter.prototype.getPlugin = function (pluginName) { - return pluginName ? this._plugins[pluginName] : values(this._plugins); - }; - return UIRouter; -}()); - -/** @module hooks */ /** */ -function addCoreResolvables(trans) { - trans.addResolvable({ token: UIRouter, deps: [], resolveFn: function () { return trans.router; }, data: trans.router }, ""); - trans.addResolvable({ token: Transition, deps: [], resolveFn: function () { return trans; }, data: trans }, ""); - trans.addResolvable({ token: '$transition$', deps: [], resolveFn: function () { return trans; }, data: trans }, ""); - trans.addResolvable({ token: '$stateParams', deps: [], resolveFn: function () { return trans.params(); }, data: trans.params() }, ""); - trans.entering().forEach(function (state) { - trans.addResolvable({ token: '$state$', deps: [], resolveFn: function () { return state; }, data: state }, state); - }); -} -var registerAddCoreResolvables = function (transitionService) { - return transitionService.onCreate({}, addCoreResolvables); -}; - -/** @module hooks */ /** */ -/** - * A [[TransitionHookFn]] that redirects to a different state or params - * - * Registered using `transitionService.onStart({ to: (state) => !!state.redirectTo }, redirectHook);` - * - * See [[StateDeclaration.redirectTo]] - */ -var redirectToHook = function (trans) { - var redirect = trans.to().redirectTo; - if (!redirect) - return; - var $state = trans.router.stateService; - function handleResult(result) { - if (!result) - return; - if (result instanceof TargetState) - return result; - if (isString(result)) - return $state.target(result, trans.params(), trans.options()); - if (result['state'] || result['params']) - return $state.target(result['state'] || trans.to(), result['params'] || trans.params(), trans.options()); - } - if (isFunction(redirect)) { - return services.$q.when(redirect(trans)).then(handleResult); - } - return handleResult(redirect); -}; -var registerRedirectToHook = function (transitionService) { - return transitionService.onStart({ to: function (state) { return !!state.redirectTo; } }, redirectToHook); -}; - -/** - * A factory which creates an onEnter, onExit or onRetain transition hook function - * - * The returned function invokes the (for instance) state.onEnter hook when the - * state is being entered. - * - * @hidden - */ -function makeEnterExitRetainHook(hookName) { - return function (transition, state) { - var _state = state.$$state(); - var hookFn = _state[hookName]; - return hookFn(transition, state); - }; -} -/** - * The [[TransitionStateHookFn]] for onExit - * - * When the state is being exited, the state's .onExit function is invoked. - * - * Registered using `transitionService.onExit({ exiting: (state) => !!state.onExit }, onExitHook);` - * - * See: [[IHookRegistry.onExit]] - */ -var onExitHook = makeEnterExitRetainHook('onExit'); -var registerOnExitHook = function (transitionService) { - return transitionService.onExit({ exiting: function (state) { return !!state.onExit; } }, onExitHook); -}; -/** - * The [[TransitionStateHookFn]] for onRetain - * - * When the state was already entered, and is not being exited or re-entered, the state's .onRetain function is invoked. - * - * Registered using `transitionService.onRetain({ retained: (state) => !!state.onRetain }, onRetainHook);` - * - * See: [[IHookRegistry.onRetain]] - */ -var onRetainHook = makeEnterExitRetainHook('onRetain'); -var registerOnRetainHook = function (transitionService) { - return transitionService.onRetain({ retained: function (state) { return !!state.onRetain; } }, onRetainHook); -}; -/** - * The [[TransitionStateHookFn]] for onEnter - * - * When the state is being entered, the state's .onEnter function is invoked. - * - * Registered using `transitionService.onEnter({ entering: (state) => !!state.onEnter }, onEnterHook);` - * - * See: [[IHookRegistry.onEnter]] - */ -var onEnterHook = makeEnterExitRetainHook('onEnter'); -var registerOnEnterHook = function (transitionService) { - return transitionService.onEnter({ entering: function (state) { return !!state.onEnter; } }, onEnterHook); -}; - -/** @module hooks */ -/** for typedoc */ -/** - * A [[TransitionHookFn]] which resolves all EAGER Resolvables in the To Path - * - * Registered using `transitionService.onStart({}, eagerResolvePath);` - * - * When a Transition starts, this hook resolves all the EAGER Resolvables, which the transition then waits for. - * - * See [[StateDeclaration.resolve]] - */ -var eagerResolvePath = function (trans) { - return new ResolveContext(trans.treeChanges().to) - .resolvePath("EAGER", trans) - .then(noop$1); -}; -var registerEagerResolvePath = function (transitionService) { - return transitionService.onStart({}, eagerResolvePath, { priority: 1000 }); -}; -/** - * A [[TransitionHookFn]] which resolves all LAZY Resolvables for the state (and all its ancestors) in the To Path - * - * Registered using `transitionService.onEnter({ entering: () => true }, lazyResolveState);` - * - * When a State is being entered, this hook resolves all the Resolvables for this state, which the transition then waits for. - * - * See [[StateDeclaration.resolve]] - */ -var lazyResolveState = function (trans, state) { - return new ResolveContext(trans.treeChanges().to) - .subContext(state.$$state()) - .resolvePath("LAZY", trans) - .then(noop$1); -}; -var registerLazyResolveState = function (transitionService) { - return transitionService.onEnter({ entering: val(true) }, lazyResolveState, { priority: 1000 }); -}; - -/** @module hooks */ /** for typedoc */ -/** - * A [[TransitionHookFn]] which waits for the views to load - * - * Registered using `transitionService.onStart({}, loadEnteringViews);` - * - * Allows the views to do async work in [[ViewConfig.load]] before the transition continues. - * In angular 1, this includes loading the templates. - */ -var loadEnteringViews = function (transition) { - var $q = services.$q; - var enteringViews = transition.views("entering"); - if (!enteringViews.length) - return; - return $q.all(enteringViews.map(function (view) { return $q.when(view.load()); })).then(noop$1); -}; -var registerLoadEnteringViews = function (transitionService) { - return transitionService.onFinish({}, loadEnteringViews); -}; -/** - * A [[TransitionHookFn]] which activates the new views when a transition is successful. - * - * Registered using `transitionService.onSuccess({}, activateViews);` - * - * After a transition is complete, this hook deactivates the old views from the previous state, - * and activates the new views from the destination state. - * - * See [[ViewService]] - */ -var activateViews = function (transition) { - var enteringViews = transition.views("entering"); - var exitingViews = transition.views("exiting"); - if (!enteringViews.length && !exitingViews.length) - return; - var $view = transition.router.viewService; - exitingViews.forEach(function (vc) { return $view.deactivateViewConfig(vc); }); - enteringViews.forEach(function (vc) { return $view.activateViewConfig(vc); }); - $view.sync(); -}; -var registerActivateViews = function (transitionService) { - return transitionService.onSuccess({}, activateViews); -}; - -/** - * A [[TransitionHookFn]] which updates global UI-Router state - * - * Registered using `transitionService.onBefore({}, updateGlobalState);` - * - * Before a [[Transition]] starts, updates the global value of "the current transition" ([[Globals.transition]]). - * After a successful [[Transition]], updates the global values of "the current state" - * ([[Globals.current]] and [[Globals.$current]]) and "the current param values" ([[Globals.params]]). - * - * See also the deprecated properties: - * [[StateService.transition]], [[StateService.current]], [[StateService.params]] - */ -var updateGlobalState = function (trans) { - var globals = trans.router.globals; - var transitionSuccessful = function () { - globals.successfulTransitions.enqueue(trans); - globals.$current = trans.$to(); - globals.current = globals.$current.self; - copy(trans.params(), globals.params); - }; - var clearCurrentTransition = function () { - // Do not clear globals.transition if a different transition has started in the meantime - if (globals.transition === trans) - globals.transition = null; - }; - trans.onSuccess({}, transitionSuccessful, { priority: 10000 }); - trans.promise.then(clearCurrentTransition, clearCurrentTransition); -}; -var registerUpdateGlobalState = function (transitionService) { - return transitionService.onCreate({}, updateGlobalState); -}; - -/** - * A [[TransitionHookFn]] which updates the URL after a successful transition - * - * Registered using `transitionService.onSuccess({}, updateUrl);` - */ -var updateUrl = function (transition) { - var options = transition.options(); - var $state = transition.router.stateService; - var $urlRouter = transition.router.urlRouter; - // Dont update the url in these situations: - // The transition was triggered by a URL sync (options.source === 'url') - // The user doesn't want the url to update (options.location === false) - // The destination state, and all parents have no navigable url - if (options.source !== 'url' && options.location && $state.$current.navigable) { - var urlOptions = { replace: options.location === 'replace' }; - $urlRouter.push($state.$current.navigable.url, $state.params, urlOptions); - } - $urlRouter.update(true); -}; -var registerUpdateUrl = function (transitionService) { - return transitionService.onSuccess({}, updateUrl, { priority: 9999 }); -}; - -/** - * A [[TransitionHookFn]] that performs lazy loading - * - * When entering a state "abc" which has a `lazyLoad` function defined: - * - Invoke the `lazyLoad` function (unless it is already in process) - * - Flag the hook function as "in process" - * - The function should return a promise (that resolves when lazy loading is complete) - * - Wait for the promise to settle - * - If the promise resolves to a [[LazyLoadResult]], then register those states - * - Flag the hook function as "not in process" - * - If the hook was successful - * - Remove the `lazyLoad` function from the state declaration - * - If all the hooks were successful - * - Retry the transition (by returning a TargetState) - * - * ``` - * .state('abc', { - * component: 'fooComponent', - * lazyLoad: () => System.import('./fooComponent') - * }); - * ``` - * - * See [[StateDeclaration.lazyLoad]] - */ -var lazyLoadHook = function (transition) { - var router = transition.router; - function retryTransition() { - if (transition.originalTransition().options().source !== 'url') { - // The original transition was not triggered via url sync - // The lazy state should be loaded now, so re-try the original transition - var orig = transition.targetState(); - return router.stateService.target(orig.identifier(), orig.params(), orig.options()); - } - // The original transition was triggered via url sync - // Run the URL rules and find the best match - var $url = router.urlService; - var result = $url.match($url.parts()); - var rule = result && result.rule; - // If the best match is a state, redirect the transition (instead - // of calling sync() which supersedes the current transition) - if (rule && rule.type === "STATE") { - var state = rule.state; - var params = result.match; - return router.stateService.target(state, params, transition.options()); - } - // No matching state found, so let .sync() choose the best non-state match/otherwise - router.urlService.sync(); - } - var promises = transition.entering() - .filter(function (state) { return !!state.$$state().lazyLoad; }) - .map(function (state) { return lazyLoadState(transition, state); }); - return services.$q.all(promises).then(retryTransition); -}; -var registerLazyLoadHook = function (transitionService) { - return transitionService.onBefore({ entering: function (state) { return !!state.lazyLoad; } }, lazyLoadHook); -}; -/** - * Invokes a state's lazy load function - * - * @param transition a Transition context - * @param state the state to lazy load - * @returns A promise for the lazy load result - */ -function lazyLoadState(transition, state) { - var lazyLoadFn = state.$$state().lazyLoad; - // Store/get the lazy load promise on/from the hookfn so it doesn't get re-invoked - var promise = lazyLoadFn['_promise']; - if (!promise) { - var success = function (result) { - delete state.lazyLoad; - delete state.$$state().lazyLoad; - delete lazyLoadFn['_promise']; - return result; - }; - var error = function (err) { - delete lazyLoadFn['_promise']; - return services.$q.reject(err); - }; - promise = lazyLoadFn['_promise'] = - services.$q.when(lazyLoadFn(transition, state)) - .then(updateStateRegistry) - .then(success, error); - } - /** Register any lazy loaded state definitions */ - function updateStateRegistry(result) { - if (result && Array.isArray(result.states)) { - result.states.forEach(function (state) { return transition.router.stateRegistry.register(state); }); - } - return result; - } - return promise; -} - -/** - * This class defines a type of hook, such as `onBefore` or `onEnter`. - * Plugins can define custom hook types, such as sticky states does for `onInactive`. - * - * @interalapi - */ -var TransitionEventType = (function () { - function TransitionEventType(name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) { - if (reverseSort === void 0) { reverseSort = false; } - if (getResultHandler === void 0) { getResultHandler = TransitionHook.HANDLE_RESULT; } - if (getErrorHandler === void 0) { getErrorHandler = TransitionHook.REJECT_ERROR; } - if (synchronous === void 0) { synchronous = false; } - this.name = name; - this.hookPhase = hookPhase; - this.hookOrder = hookOrder; - this.criteriaMatchPath = criteriaMatchPath; - this.reverseSort = reverseSort; - this.getResultHandler = getResultHandler; - this.getErrorHandler = getErrorHandler; - this.synchronous = synchronous; - } - return TransitionEventType; -}()); - -/** @module hooks */ /** */ -/** - * A [[TransitionHookFn]] that skips a transition if it should be ignored - * - * This hook is invoked at the end of the onBefore phase. - * - * If the transition should be ignored (because no parameter or states changed) - * then the transition is ignored and not processed. - */ -function ignoredHook(trans) { - var ignoredReason = trans._ignoredReason(); - if (!ignoredReason) - return; - trace.traceTransitionIgnored(trans); - var pending = trans.router.globals.transition; - // The user clicked a link going back to the *current state* ('A') - // However, there is also a pending transition in flight (to 'B') - // Abort the transition to 'B' because the user now wants to be back at 'A'. - if (ignoredReason === 'SameAsCurrent' && pending) { - pending.abort(); - } - return Rejection.ignored().toPromise(); -} -var registerIgnoredTransitionHook = function (transitionService) { - return transitionService.onBefore({}, ignoredHook, { priority: -9999 }); -}; - -/** @module hooks */ /** */ -/** - * A [[TransitionHookFn]] that rejects the Transition if it is invalid - * - * This hook is invoked at the end of the onBefore phase. - * If the transition is invalid (for example, param values do not validate) - * then the transition is rejected. - */ -function invalidTransitionHook(trans) { - if (!trans.valid()) { - throw new Error(trans.error()); - } -} -var registerInvalidTransitionHook = function (transitionService) { - return transitionService.onBefore({}, invalidTransitionHook, { priority: -10000 }); -}; - -/** - * @coreapi - * @module transition - */ -/** for typedoc */ -/** - * The default [[Transition]] options. - * - * Include this object when applying custom defaults: - * let reloadOpts = { reload: true, notify: true } - * let options = defaults(theirOpts, customDefaults, defaultOptions); - */ -var defaultTransOpts = { - location: true, - relative: null, - inherit: false, - notify: true, - reload: false, - custom: {}, - current: function () { return null; }, - source: "unknown" -}; -/** - * This class provides services related to Transitions. - * - * - Most importantly, it allows global Transition Hooks to be registered. - * - It allows the default transition error handler to be set. - * - It also has a factory function for creating new [[Transition]] objects, (used internally by the [[StateService]]). - * - * At bootstrap, [[UIRouter]] creates a single instance (singleton) of this class. - */ -var TransitionService = (function () { - /** @hidden */ - function TransitionService(_router) { - /** @hidden */ - this._transitionCount = 0; - /** @hidden The transition hook types, such as `onEnter`, `onStart`, etc */ - this._eventTypes = []; - /** @hidden The registered transition hooks */ - this._registeredHooks = {}; - /** @hidden The paths on a criteria object */ - this._criteriaPaths = {}; - this._router = _router; - this.$view = _router.viewService; - this._deregisterHookFns = {}; - this._pluginapi = createProxyFunctions(val(this), {}, val(this), [ - '_definePathType', - '_defineEvent', - '_getPathTypes', - '_getEvents', - 'getHooks', - ]); - this._defineCorePaths(); - this._defineCoreEvents(); - this._registerCoreTransitionHooks(); - } - /** - * Registers a [[TransitionHookFn]], called *while a transition is being constructed*. - * - * Registers a transition lifecycle hook, which is invoked during transition construction. - * - * This low level hook should only be used by plugins. - * This can be a useful time for plugins to add resolves or mutate the transition as needed. - * The Sticky States plugin uses this hook to modify the treechanges. - * - * ### Lifecycle - * - * `onCreate` hooks are invoked *while a transition is being constructed*. - * - * ### Return value - * - * The hook's return value is ignored - * - * @internalapi - * @param criteria defines which Transitions the Hook should be invoked for. - * @param callback the hook function which will be invoked. - * @param options the registration options - * @returns a function which deregisters the hook. - */ - TransitionService.prototype.onCreate = function (criteria, callback, options) { return; }; - /** @inheritdoc */ - TransitionService.prototype.onBefore = function (criteria, callback, options) { return; }; - /** @inheritdoc */ - TransitionService.prototype.onStart = function (criteria, callback, options) { return; }; - /** @inheritdoc */ - TransitionService.prototype.onExit = function (criteria, callback, options) { return; }; - /** @inheritdoc */ - TransitionService.prototype.onRetain = function (criteria, callback, options) { return; }; - /** @inheritdoc */ - TransitionService.prototype.onEnter = function (criteria, callback, options) { return; }; - /** @inheritdoc */ - TransitionService.prototype.onFinish = function (criteria, callback, options) { return; }; - /** @inheritdoc */ - TransitionService.prototype.onSuccess = function (criteria, callback, options) { return; }; - /** @inheritdoc */ - TransitionService.prototype.onError = function (criteria, callback, options) { return; }; - /** - * dispose - * @internalapi - */ - TransitionService.prototype.dispose = function (router) { - values(this._registeredHooks).forEach(function (hooksArray) { return hooksArray.forEach(function (hook) { - hook._deregistered = true; - removeFrom(hooksArray, hook); - }); }); - }; - /** - * Creates a new [[Transition]] object - * - * This is a factory function for creating new Transition objects. - * It is used internally by the [[StateService]] and should generally not be called by application code. - * - * @param fromPath the path to the current state (the from state) - * @param targetState the target state (destination) - * @returns a Transition - */ - TransitionService.prototype.create = function (fromPath, targetState) { - return new Transition(fromPath, targetState, this._router); - }; - /** @hidden */ - TransitionService.prototype._defineCoreEvents = function () { - var Phase = exports.TransitionHookPhase; - var TH = TransitionHook; - var paths = this._criteriaPaths; - var NORMAL_SORT = false, REVERSE_SORT = true; - var ASYNCHRONOUS = false, SYNCHRONOUS = true; - this._defineEvent("onCreate", Phase.CREATE, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.THROW_ERROR, SYNCHRONOUS); - this._defineEvent("onBefore", Phase.BEFORE, 0, paths.to); - this._defineEvent("onStart", Phase.RUN, 0, paths.to); - this._defineEvent("onExit", Phase.RUN, 100, paths.exiting, REVERSE_SORT); - this._defineEvent("onRetain", Phase.RUN, 200, paths.retained); - this._defineEvent("onEnter", Phase.RUN, 300, paths.entering); - this._defineEvent("onFinish", Phase.RUN, 400, paths.to); - this._defineEvent("onSuccess", Phase.SUCCESS, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.LOG_ERROR, SYNCHRONOUS); - this._defineEvent("onError", Phase.ERROR, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.LOG_ERROR, SYNCHRONOUS); - }; - /** @hidden */ - TransitionService.prototype._defineCorePaths = function () { - var STATE = exports.TransitionHookScope.STATE, TRANSITION = exports.TransitionHookScope.TRANSITION; - this._definePathType("to", TRANSITION); - this._definePathType("from", TRANSITION); - this._definePathType("exiting", STATE); - this._definePathType("retained", STATE); - this._definePathType("entering", STATE); - }; - /** @hidden */ - TransitionService.prototype._defineEvent = function (name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) { - if (reverseSort === void 0) { reverseSort = false; } - if (getResultHandler === void 0) { getResultHandler = TransitionHook.HANDLE_RESULT; } - if (getErrorHandler === void 0) { getErrorHandler = TransitionHook.REJECT_ERROR; } - if (synchronous === void 0) { synchronous = false; } - var eventType = new TransitionEventType(name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous); - this._eventTypes.push(eventType); - makeEvent(this, this, eventType); - }; - - /** @hidden */ - TransitionService.prototype._getEvents = function (phase) { - var transitionHookTypes = isDefined(phase) ? - this._eventTypes.filter(function (type) { return type.hookPhase === phase; }) : - this._eventTypes.slice(); - return transitionHookTypes.sort(function (l, r) { - var cmpByPhase = l.hookPhase - r.hookPhase; - return cmpByPhase === 0 ? l.hookOrder - r.hookOrder : cmpByPhase; - }); - }; - /** - * Adds a Path to be used as a criterion against a TreeChanges path - * - * For example: the `exiting` path in [[HookMatchCriteria]] is a STATE scoped path. - * It was defined by calling `defineTreeChangesCriterion('exiting', TransitionHookScope.STATE)` - * Each state in the exiting path is checked against the criteria and returned as part of the match. - * - * Another example: the `to` path in [[HookMatchCriteria]] is a TRANSITION scoped path. - * It was defined by calling `defineTreeChangesCriterion('to', TransitionHookScope.TRANSITION)` - * Only the tail of the `to` path is checked against the criteria and returned as part of the match. - * - * @hidden - */ - TransitionService.prototype._definePathType = function (name, hookScope) { - this._criteriaPaths[name] = { name: name, scope: hookScope }; - }; - /** * @hidden */ - TransitionService.prototype._getPathTypes = function () { - return this._criteriaPaths; - }; - /** @hidden */ - TransitionService.prototype.getHooks = function (hookName) { - return this._registeredHooks[hookName]; - }; - /** @hidden */ - TransitionService.prototype._registerCoreTransitionHooks = function () { - var fns = this._deregisterHookFns; - fns.addCoreResolves = registerAddCoreResolvables(this); - fns.ignored = registerIgnoredTransitionHook(this); - fns.invalid = registerInvalidTransitionHook(this); - // Wire up redirectTo hook - fns.redirectTo = registerRedirectToHook(this); - // Wire up onExit/Retain/Enter state hooks - fns.onExit = registerOnExitHook(this); - fns.onRetain = registerOnRetainHook(this); - fns.onEnter = registerOnEnterHook(this); - // Wire up Resolve hooks - fns.eagerResolve = registerEagerResolvePath(this); - fns.lazyResolve = registerLazyResolveState(this); - // Wire up the View management hooks - fns.loadViews = registerLoadEnteringViews(this); - fns.activateViews = registerActivateViews(this); - // Updates global state after a transition - fns.updateGlobals = registerUpdateGlobalState(this); - // After globals.current is updated at priority: 10000 - fns.updateUrl = registerUpdateUrl(this); - // Lazy load state trees - fns.lazyLoad = registerLazyLoadHook(this); - }; - return TransitionService; -}()); - -/** - * @coreapi - * @module state - */ -/** */ -/** - * Provides state related service functions - * - * This class provides services related to ui-router states. - * An instance of this class is located on the global [[UIRouter]] object. - */ -var StateService = (function () { - /** @internalapi */ - function StateService(router) { - this.router = router; - /** @internalapi */ - this.invalidCallbacks = []; - /** @hidden */ - this._defaultErrorHandler = function $defaultErrorHandler($error$) { - if ($error$ instanceof Error && $error$.stack) { - console.error($error$); - console.error($error$.stack); - } - else if ($error$ instanceof Rejection) { - console.error($error$.toString()); - if ($error$.detail && $error$.detail.stack) - console.error($error$.detail.stack); - } - else { - console.error($error$); - } - }; - var getters = ['current', '$current', 'params', 'transition']; - var boundFns = Object.keys(StateService.prototype).filter(not(inArray(getters))); - createProxyFunctions(val(StateService.prototype), this, val(this), boundFns); - } - Object.defineProperty(StateService.prototype, "transition", { - /** - * The [[Transition]] currently in progress (or null) - * - * This is a passthrough through to [[UIRouterGlobals.transition]] - */ - get: function () { return this.router.globals.transition; }, - enumerable: true, - configurable: true - }); - Object.defineProperty(StateService.prototype, "params", { - /** - * The latest successful state parameters - * - * This is a passthrough through to [[UIRouterGlobals.params]] - */ - get: function () { return this.router.globals.params; }, - enumerable: true, - configurable: true - }); - Object.defineProperty(StateService.prototype, "current", { - /** - * The current [[StateDeclaration]] - * - * This is a passthrough through to [[UIRouterGlobals.current]] - */ - get: function () { return this.router.globals.current; }, - enumerable: true, - configurable: true - }); - Object.defineProperty(StateService.prototype, "$current", { - /** - * The current [[StateObject]] - * - * This is a passthrough through to [[UIRouterGlobals.$current]] - */ - get: function () { return this.router.globals.$current; }, - enumerable: true, - configurable: true - }); - /** @internalapi */ - StateService.prototype.dispose = function () { - this.defaultErrorHandler(noop$1); - this.invalidCallbacks = []; - }; - /** - * Handler for when [[transitionTo]] is called with an invalid state. - * - * Invokes the [[onInvalid]] callbacks, in natural order. - * Each callback's return value is checked in sequence until one of them returns an instance of TargetState. - * The results of the callbacks are wrapped in $q.when(), so the callbacks may return promises. - * - * If a callback returns an TargetState, then it is used as arguments to $state.transitionTo() and the result returned. - * - * @internalapi - */ - StateService.prototype._handleInvalidTargetState = function (fromPath, toState) { - var _this = this; - var fromState = PathUtils.makeTargetState(fromPath); - var globals = this.router.globals; - var latestThing = function () { return globals.transitionHistory.peekTail(); }; - var latest = latestThing(); - var callbackQueue = new Queue(this.invalidCallbacks.slice()); - var injector = new ResolveContext(fromPath).injector(); - var checkForRedirect = function (result) { - if (!(result instanceof TargetState)) { - return; - } - var target = result; - // Recreate the TargetState, in case the state is now defined. - target = _this.target(target.identifier(), target.params(), target.options()); - if (!target.valid()) { - return Rejection.invalid(target.error()).toPromise(); - } - if (latestThing() !== latest) { - return Rejection.superseded().toPromise(); - } - return _this.transitionTo(target.identifier(), target.params(), target.options()); - }; - function invokeNextCallback() { - var nextCallback = callbackQueue.dequeue(); - if (nextCallback === undefined) - return Rejection.invalid(toState.error()).toPromise(); - var callbackResult = services.$q.when(nextCallback(toState, fromState, injector)); - return callbackResult.then(checkForRedirect).then(function (result) { return result || invokeNextCallback(); }); - } - return invokeNextCallback(); - }; - /** - * Registers an Invalid State handler - * - * Registers a [[OnInvalidCallback]] function to be invoked when [[StateService.transitionTo]] - * has been called with an invalid state reference parameter - * - * Example: - * ```js - * stateService.onInvalid(function(to, from, injector) { - * if (to.name() === 'foo') { - * let lazyLoader = injector.get('LazyLoadService'); - * return lazyLoader.load('foo') - * .then(() => stateService.target('foo')); - * } - * }); - * ``` - * - * @param {function} callback invoked when the toState is invalid - * This function receives the (invalid) toState, the fromState, and an injector. - * The function may optionally return a [[TargetState]] or a Promise for a TargetState. - * If one is returned, it is treated as a redirect. - * - * @returns a function which deregisters the callback - */ - StateService.prototype.onInvalid = function (callback) { - this.invalidCallbacks.push(callback); - return function deregisterListener() { - removeFrom(this.invalidCallbacks)(callback); - }.bind(this); - }; - /** - * Reloads the current state - * - * A method that force reloads the current state, or a partial state hierarchy. - * All resolves are re-resolved, and components reinstantiated. - * - * #### Example: - * ```js - * let app angular.module('app', ['ui.router']); - * - * app.controller('ctrl', function ($scope, $state) { - * $scope.reload = function(){ - * $state.reload(); - * } - * }); - * ``` - * - * Note: `reload()` is just an alias for: - * - * ```js - * $state.transitionTo($state.current, $state.params, { - * reload: true, inherit: false - * }); - * ``` - * - * @param reloadState A state name or a state object. - * If present, this state and all its children will be reloaded, but ancestors will not reload. - * - * #### Example: - * ```js - * //assuming app application consists of 3 states: 'contacts', 'contacts.detail', 'contacts.detail.item' - * //and current state is 'contacts.detail.item' - * let app angular.module('app', ['ui.router']); - * - * app.controller('ctrl', function ($scope, $state) { - * $scope.reload = function(){ - * //will reload 'contact.detail' and nested 'contact.detail.item' states - * $state.reload('contact.detail'); - * } - * }); - * ``` - * - * @returns A promise representing the state of the new transition. See [[StateService.go]] - */ - StateService.prototype.reload = function (reloadState) { - return this.transitionTo(this.current, this.params, { - reload: isDefined(reloadState) ? reloadState : true, - inherit: false, - notify: false, - }); - }; - - /** - * Transition to a different state and/or parameters - * - * Convenience method for transitioning to a new state. - * - * `$state.go` calls `$state.transitionTo` internally but automatically sets options to - * `{ location: true, inherit: true, relative: router.globals.$current, notify: true }`. - * This allows you to use either an absolute or relative `to` argument (because of `relative: router.globals.$current`). - * It also allows you to specify * only the parameters you'd like to update, while letting unspecified parameters - * inherit from the current parameter values (because of `inherit: true`). - * - * #### Example: - * ```js - * let app = angular.module('app', ['ui.router']); - * - * app.controller('ctrl', function ($scope, $state) { - * $scope.changeState = function () { - * $state.go('contact.detail'); - * }; - * }); - * ``` - * - * @param to Absolute state name, state object, or relative state path (relative to current state). - * - * Some examples: - * - * - `$state.go('contact.detail')` - will go to the `contact.detail` state - * - `$state.go('^')` - will go to the parent state - * - `$state.go('^.sibling')` - if current state is `home.child`, will go to the `home.sibling` state - * - `$state.go('.child.grandchild')` - if current state is home, will go to the `home.child.grandchild` state - * - * @param params A map of the parameters that will be sent to the state, will populate $stateParams. - * - * Any parameters that are not specified will be inherited from current parameter values (because of `inherit: true`). - * This allows, for example, going to a sibling state that shares parameters defined by a parent state. - * - * @param options Transition options - * - * @returns {promise} A promise representing the state of the new transition. - */ - StateService.prototype.go = function (to, params, options) { - var defautGoOpts = { relative: this.$current, inherit: true }; - var transOpts = defaults(options, defautGoOpts, defaultTransOpts); - return this.transitionTo(to, params, transOpts); - }; - - /** - * Creates a [[TargetState]] - * - * This is a factory method for creating a TargetState - * - * This may be returned from a Transition Hook to redirect a transition, for example. - */ - StateService.prototype.target = function (identifier, params, options) { - if (options === void 0) { options = {}; } - // If we're reloading, find the state object to reload from - if (isObject(options.reload) && !options.reload.name) - throw new Error('Invalid reload state object'); - var reg = this.router.stateRegistry; - options.reloadState = options.reload === true ? reg.root() : reg.matcher.find(options.reload, options.relative); - if (options.reload && !options.reloadState) - throw new Error("No such reload state '" + (isString(options.reload) ? options.reload : options.reload.name) + "'"); - var stateDefinition = reg.matcher.find(identifier, options.relative); - return new TargetState(identifier, stateDefinition, params, options); - }; - - StateService.prototype.getCurrentPath = function () { - var _this = this; - var globals = this.router.globals; - var latestSuccess = globals.successfulTransitions.peekTail(); - var rootPath = function () { return [new PathNode(_this.router.stateRegistry.root())]; }; - return latestSuccess ? latestSuccess.treeChanges().to : rootPath(); - }; - /** - * Low-level method for transitioning to a new state. - * - * The [[go]] method (which uses `transitionTo` internally) is recommended in most situations. - * - * #### Example: - * ```js - * let app = angular.module('app', ['ui.router']); - * - * app.controller('ctrl', function ($scope, $state) { - * $scope.changeState = function () { - * $state.transitionTo('contact.detail'); - * }; - * }); - * ``` - * - * @param to State name or state object. - * @param toParams A map of the parameters that will be sent to the state, - * will populate $stateParams. - * @param options Transition options - * - * @returns A promise representing the state of the new transition. See [[go]] - */ - StateService.prototype.transitionTo = function (to, toParams, options) { - var _this = this; - if (toParams === void 0) { toParams = {}; } - if (options === void 0) { options = {}; } - var router = this.router; - var globals = router.globals; - options = defaults(options, defaultTransOpts); - var getCurrent = function () { - return globals.transition; - }; - options = extend(options, { current: getCurrent }); - var ref = this.target(to, toParams, options); - var currentPath = this.getCurrentPath(); - if (!ref.exists()) - return this._handleInvalidTargetState(currentPath, ref); - if (!ref.valid()) - return silentRejection(ref.error()); - /** - * Special handling for Ignored, Aborted, and Redirected transitions - * - * The semantics for the transition.run() promise and the StateService.transitionTo() - * promise differ. For instance, the run() promise may be rejected because it was - * IGNORED, but the transitionTo() promise is resolved because from the user perspective - * no error occurred. Likewise, the transition.run() promise may be rejected because of - * a Redirect, but the transitionTo() promise is chained to the new Transition's promise. - */ - var rejectedTransitionHandler = function (transition) { return function (error) { - if (error instanceof Rejection) { - var isLatest = router.globals.lastStartedTransitionId === transition.$id; - if (error.type === exports.RejectType.IGNORED) { - isLatest && router.urlRouter.update(); - // Consider ignored `Transition.run()` as a successful `transitionTo` - return services.$q.when(globals.current); - } - var detail = error.detail; - if (error.type === exports.RejectType.SUPERSEDED && error.redirected && detail instanceof TargetState) { - // If `Transition.run()` was redirected, allow the `transitionTo()` promise to resolve successfully - // by returning the promise for the new (redirect) `Transition.run()`. - var redirect = transition.redirect(detail); - return redirect.run().catch(rejectedTransitionHandler(redirect)); - } - if (error.type === exports.RejectType.ABORTED) { - isLatest && router.urlRouter.update(); - return services.$q.reject(error); - } - } - var errorHandler = _this.defaultErrorHandler(); - errorHandler(error); - return services.$q.reject(error); - }; }; - var transition = this.router.transitionService.create(currentPath, ref); - var transitionToPromise = transition.run().catch(rejectedTransitionHandler(transition)); - silenceUncaughtInPromise(transitionToPromise); // issue #2676 - // Return a promise for the transition, which also has the transition object on it. - return extend(transitionToPromise, { transition: transition }); - }; - - /** - * Checks if the current state *is* the provided state - * - * Similar to [[includes]] but only checks for the full state name. - * If params is supplied then it will be tested for strict equality against the current - * active params object, so all params must match with none missing and no extras. - * - * #### Example: - * ```js - * $state.$current.name = 'contacts.details.item'; - * - * // absolute name - * $state.is('contact.details.item'); // returns true - * $state.is(contactDetailItemStateObject); // returns true - * ``` - * - * // relative name (. and ^), typically from a template - * // E.g. from the 'contacts.details' template - * ```html - *
Item
- * ``` - * - * @param stateOrName The state name (absolute or relative) or state object you'd like to check. - * @param params A param object, e.g. `{sectionId: section.id}`, that you'd like - * to test against the current active state. - * @param options An options object. The options are: - * - `relative`: If `stateOrName` is a relative state name and `options.relative` is set, .is will - * test relative to `options.relative` state (or name). - * - * @returns Returns true if it is the state. - */ - StateService.prototype.is = function (stateOrName, params, options) { - options = defaults(options, { relative: this.$current }); - var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative); - if (!isDefined(state)) - return undefined; - if (this.$current !== state) - return false; - if (!params) - return true; - var schema = state.parameters({ inherit: true, matchingKeys: params }); - return Param.equals(schema, Param.values(schema, params), this.params); - }; - - /** - * Checks if the current state *includes* the provided state - * - * A method to determine if the current active state is equal to or is the child of the - * state stateName. If any params are passed then they will be tested for a match as well. - * Not all the parameters need to be passed, just the ones you'd like to test for equality. - * - * #### Example when `$state.$current.name === 'contacts.details.item'` - * ```js - * // Using partial names - * $state.includes("contacts"); // returns true - * $state.includes("contacts.details"); // returns true - * $state.includes("contacts.details.item"); // returns true - * $state.includes("contacts.list"); // returns false - * $state.includes("about"); // returns false - * ``` - * - * #### Glob Examples when `* $state.$current.name === 'contacts.details.item.url'`: - * ```js - * $state.includes("*.details.*.*"); // returns true - * $state.includes("*.details.**"); // returns true - * $state.includes("**.item.**"); // returns true - * $state.includes("*.details.item.url"); // returns true - * $state.includes("*.details.*.url"); // returns true - * $state.includes("*.details.*"); // returns false - * $state.includes("item.**"); // returns false - * ``` - * - * @param stateOrName A partial name, relative name, glob pattern, - * or state object to be searched for within the current state name. - * @param params A param object, e.g. `{sectionId: section.id}`, - * that you'd like to test against the current active state. - * @param options An options object. The options are: - * - `relative`: If `stateOrName` is a relative state name and `options.relative` is set, .is will - * test relative to `options.relative` state (or name). - * - * @returns {boolean} Returns true if it does include the state - */ - StateService.prototype.includes = function (stateOrName, params, options) { - options = defaults(options, { relative: this.$current }); - var glob = isString(stateOrName) && Glob.fromString(stateOrName); - if (glob) { - if (!glob.matches(this.$current.name)) - return false; - stateOrName = this.$current.name; - } - var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative), include = this.$current.includes; - if (!isDefined(state)) - return undefined; - if (!isDefined(include[state.name])) - return false; - if (!params) - return true; - var schema = state.parameters({ inherit: true, matchingKeys: params }); - return Param.equals(schema, Param.values(schema, params), this.params); - }; - - /** - * Generates a URL for a state and parameters - * - * Returns the url for the given state populated with the given params. - * - * #### Example: - * ```js - * expect($state.href("about.person", { person: "bob" })).toEqual("/about/bob"); - * ``` - * - * @param stateOrName The state name or state object you'd like to generate a url from. - * @param params An object of parameter values to fill the state's required parameters. - * @param options Options object. The options are: - * - * @returns {string} compiled state url - */ - StateService.prototype.href = function (stateOrName, params, options) { - var defaultHrefOpts = { - lossy: true, - inherit: true, - absolute: false, - relative: this.$current, - }; - options = defaults(options, defaultHrefOpts); - params = params || {}; - var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative); - if (!isDefined(state)) - return null; - if (options.inherit) - params = this.params.$inherit(params, this.$current, state); - var nav = (state && options.lossy) ? state.navigable : state; - if (!nav || nav.url === undefined || nav.url === null) { - return null; - } - return this.router.urlRouter.href(nav.url, params, { - absolute: options.absolute, - }); - }; - - /** - * Sets or gets the default [[transitionTo]] error handler. - * - * The error handler is called when a [[Transition]] is rejected or when any error occurred during the Transition. - * This includes errors caused by resolves and transition hooks. - * - * Note: - * This handler does not receive certain Transition rejections. - * Redirected and Ignored Transitions are not considered to be errors by [[StateService.transitionTo]]. - * - * The built-in default error handler logs the error to the console. - * - * You can provide your own custom handler. - * - * #### Example: - * ```js - * stateService.defaultErrorHandler(function() { - * // Do not log transitionTo errors - * }); - * ``` - * - * @param handler a global error handler function - * @returns the current global error handler - */ - StateService.prototype.defaultErrorHandler = function (handler) { - return this._defaultErrorHandler = handler || this._defaultErrorHandler; - }; - StateService.prototype.get = function (stateOrName, base) { - var reg = this.router.stateRegistry; - if (arguments.length === 0) - return reg.get(); - return reg.get(stateOrName, base || this.$current); - }; - /** - * Lazy loads a state - * - * Explicitly runs a state's [[StateDeclaration.lazyLoad]] function. - * - * @param stateOrName the state that should be lazy loaded - * @param transition the optional Transition context to use (if the lazyLoad function requires an injector, etc) - * Note: If no transition is provided, a noop transition is created using the from the current state to the current state. - * This noop transition is not actually run. - * - * @returns a promise to lazy load - */ - StateService.prototype.lazyLoad = function (stateOrName, transition) { - var state = this.get(stateOrName); - if (!state || !state.lazyLoad) - throw new Error("Can not lazy load " + stateOrName); - var currentPath = this.getCurrentPath(); - var target = PathUtils.makeTargetState(currentPath); - transition = transition || this.router.transitionService.create(currentPath, target); - return lazyLoadState(transition, state); - }; - return StateService; -}()); - -/** - * # Transition subsystem - * - * This module contains APIs related to a Transition. - * - * See: - * - [[TransitionService]] - * - [[Transition]] - * - [[HookFn]], [[TransitionHookFn]], [[TransitionStateHookFn]], [[HookMatchCriteria]], [[HookResult]] - * - * @coreapi - * @preferred - * @module transition - */ /** for typedoc */ - -/** - * @internalapi - * @module vanilla - */ -/** */ -/** - * An angular1-like promise api - * - * This object implements four methods similar to the - * [angular 1 promise api](https://docs.angularjs.org/api/ng/service/$q) - * - * UI-Router evolved from an angular 1 library to a framework agnostic library. - * However, some of the `@uirouter/core` code uses these ng1 style APIs to support ng1 style dependency injection. - * - * This API provides native ES6 promise support wrapped as a $q-like API. - * Internally, UI-Router uses this $q object to perform promise operations. - * The `angular-ui-router` (ui-router for angular 1) uses the $q API provided by angular. - * - * $q-like promise api - */ -var $q = { - /** Normalizes a value as a promise */ - when: function (val$$1) { return new Promise(function (resolve, reject) { return resolve(val$$1); }); }, - /** Normalizes a value as a promise rejection */ - reject: function (val$$1) { return new Promise(function (resolve, reject) { reject(val$$1); }); }, - /** @returns a deferred object, which has `resolve` and `reject` functions */ - defer: function () { - var deferred = {}; - deferred.promise = new Promise(function (resolve, reject) { - deferred.resolve = resolve; - deferred.reject = reject; - }); - return deferred; - }, - /** Like Promise.all(), but also supports object key/promise notation like $q */ - all: function (promises) { - if (isArray(promises)) { - return Promise.all(promises); - } - if (isObject(promises)) { - // Convert promises map to promises array. - // When each promise resolves, map it to a tuple { key: key, val: val } - var chain = Object.keys(promises) - .map(function (key) { return promises[key].then(function (val$$1) { return ({ key: key, val: val$$1 }); }); }); - // Then wait for all promises to resolve, and convert them back to an object - return $q.all(chain).then(function (values$$1) { - return values$$1.reduce(function (acc, tuple) { acc[tuple.key] = tuple.val; return acc; }, {}); - }); - } - } -}; - -/** - * @internalapi - * @module vanilla - */ -/** */ -// globally available injectables -var globals = {}; -var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg; -var ARGUMENT_NAMES = /([^\s,]+)/g; -/** - * A basic angular1-like injector api - * - * This object implements four methods similar to the - * [angular 1 dependency injector](https://docs.angularjs.org/api/auto/service/$injector) - * - * UI-Router evolved from an angular 1 library to a framework agnostic library. - * However, some of the `@uirouter/core` code uses these ng1 style APIs to support ng1 style dependency injection. - * - * This object provides a naive implementation of a globally scoped dependency injection system. - * It supports the following DI approaches: - * - * ### Function parameter names - * - * A function's `.toString()` is called, and the parameter names are parsed. - * This only works when the parameter names aren't "mangled" by a minifier such as UglifyJS. - * - * ```js - * function injectedFunction(FooService, BarService) { - * // FooService and BarService are injected - * } - * ``` - * - * ### Function annotation - * - * A function may be annotated with an array of dependency names as the `$inject` property. - * - * ```js - * injectedFunction.$inject = [ 'FooService', 'BarService' ]; - * function injectedFunction(fs, bs) { - * // FooService and BarService are injected as fs and bs parameters - * } - * ``` - * - * ### Array notation - * - * An array provides the names of the dependencies to inject (as strings). - * The function is the last element of the array. - * - * ```js - * [ 'FooService', 'BarService', function (fs, bs) { - * // FooService and BarService are injected as fs and bs parameters - * }] - * ``` - * - * @type {$InjectorLike} - */ -var $injector = { - /** Gets an object from DI based on a string token */ - get: function (name) { return globals[name]; }, - /** Returns true if an object named `name` exists in global DI */ - has: function (name) { return $injector.get(name) != null; }, - /** - * Injects a function - * - * @param fn the function to inject - * @param context the function's `this` binding - * @param locals An object with additional DI tokens and values, such as `{ someToken: { foo: 1 } }` - */ - invoke: function (fn, context, locals) { - var all$$1 = extend({}, globals, locals || {}); - var params = $injector.annotate(fn); - var ensureExist = assertPredicate(function (key) { return all$$1.hasOwnProperty(key); }, function (key) { return "DI can't find injectable: '" + key + "'"; }); - var args = params.filter(ensureExist).map(function (x) { return all$$1[x]; }); - if (isFunction(fn)) - return fn.apply(context, args); - else - return fn.slice(-1)[0].apply(context, args); - }, - /** - * Returns a function's dependencies - * - * Analyzes a function (or array) and returns an array of DI tokens that the function requires. - * @return an array of `string`s - */ - annotate: function (fn) { - if (!isInjectable(fn)) - throw new Error("Not an injectable function: " + fn); - if (fn && fn.$inject) - return fn.$inject; - if (isArray(fn)) - return fn.slice(0, -1); - var fnStr = fn.toString().replace(STRIP_COMMENTS, ''); - var result = fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(ARGUMENT_NAMES); - return result || []; - } -}; - -/** - * @internalapi - * @module vanilla - */ -/** */ -var beforeAfterSubstr$1 = function (char) { return function (str) { - if (!str) - return ["", ""]; - var idx = str.indexOf(char); - if (idx === -1) - return [str, ""]; - return [str.substr(0, idx), str.substr(idx + 1)]; -}; }; -var splitHash = beforeAfterSubstr$1("#"); -var splitQuery = beforeAfterSubstr$1("?"); -var splitEqual = beforeAfterSubstr$1("="); -var trimHashVal = function (str) { return str ? str.replace(/^#/, "") : ""; }; -var keyValsToObjectR = function (accum, _a) { - var key = _a[0], val$$1 = _a[1]; - if (!accum.hasOwnProperty(key)) { - accum[key] = val$$1; - } - else if (isArray(accum[key])) { - accum[key].push(val$$1); - } - else { - accum[key] = [accum[key], val$$1]; - } - return accum; -}; -var getParams = function (queryString) { - return queryString.split("&").filter(identity).map(splitEqual).reduce(keyValsToObjectR, {}); -}; -function parseUrl$1(url) { - var orEmptyString = function (x) { return x || ""; }; - var _a = splitHash(url).map(orEmptyString), beforehash = _a[0], hash = _a[1]; - var _b = splitQuery(beforehash).map(orEmptyString), path = _b[0], search = _b[1]; - return { path: path, search: search, hash: hash, url: url }; -} -var buildUrl = function (loc) { - var path = loc.path(); - var searchObject = loc.search(); - var hash = loc.hash(); - var search = Object.keys(searchObject).map(function (key) { - var param = searchObject[key]; - var vals = isArray(param) ? param : [param]; - return vals.map(function (val$$1) { return key + "=" + val$$1; }); - }).reduce(unnestR, []).join("&"); - return path + (search ? "?" + search : "") + (hash ? "#" + hash : ""); -}; -function locationPluginFactory(name, isHtml5, serviceClass, configurationClass) { - return function (router) { - var service = router.locationService = new serviceClass(router); - var configuration = router.locationConfig = new configurationClass(router, isHtml5); - function dispose(router) { - router.dispose(service); - router.dispose(configuration); - } - return { name: name, service: service, configuration: configuration, dispose: dispose }; - }; -} - -/** - * @internalapi - * @module vanilla - */ /** */ -/** A base `LocationServices` */ -var BaseLocationServices = (function () { - function BaseLocationServices(router, fireAfterUpdate) { - var _this = this; - this.fireAfterUpdate = fireAfterUpdate; - this._listener = function (evt) { return _this._listeners.forEach(function (cb) { return cb(evt); }); }; - this._listeners = []; - this.hash = function () { return parseUrl$1(_this._get()).hash; }; - this.path = function () { return parseUrl$1(_this._get()).path; }; - this.search = function () { return getParams(parseUrl$1(_this._get()).search); }; - this._location = window && window.location; - this._history = window && window.history; - } - BaseLocationServices.prototype.url = function (url, replace) { - if (replace === void 0) { replace = true; } - if (isDefined(url) && url !== this._get()) { - this._set(null, null, url, replace); - if (this.fireAfterUpdate) { - var evt_1 = extend(new Event("locationchange"), { url: url }); - this._listeners.forEach(function (cb) { return cb(evt_1); }); - } - } - return buildUrl(this); - }; - BaseLocationServices.prototype.onChange = function (cb) { - var _this = this; - this._listeners.push(cb); - return function () { return removeFrom(_this._listeners, cb); }; - }; - BaseLocationServices.prototype.dispose = function (router) { - deregAll(this._listeners); - }; - return BaseLocationServices; -}()); - -var __extends = (undefined && undefined.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -/** - * @internalapi - * @module vanilla - */ -/** */ -/** A `LocationServices` that uses the browser hash "#" to get/set the current location */ -var HashLocationService = (function (_super) { - __extends(HashLocationService, _super); - function HashLocationService(router) { - var _this = _super.call(this, router, false) || this; - window.addEventListener('hashchange', _this._listener, false); - return _this; - } - HashLocationService.prototype._get = function () { - return trimHashVal(this._location.hash); - }; - HashLocationService.prototype._set = function (state, title, url, replace) { - this._location.hash = url; - }; - HashLocationService.prototype.dispose = function (router) { - _super.prototype.dispose.call(this, router); - window.removeEventListener('hashchange', this._listener); - }; - return HashLocationService; -}(BaseLocationServices)); - -var __extends$1 = (undefined && undefined.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -/** - * @internalapi - * @module vanilla - */ -/** */ -/** A `LocationServices` that gets/sets the current location from an in-memory object */ -var MemoryLocationService = (function (_super) { - __extends$1(MemoryLocationService, _super); - function MemoryLocationService(router) { - return _super.call(this, router, true) || this; - } - MemoryLocationService.prototype._get = function () { - return this._url; - }; - MemoryLocationService.prototype._set = function (state, title, url, replace) { - this._url = url; - }; - return MemoryLocationService; -}(BaseLocationServices)); - -var __extends$2 = (undefined && undefined.__extends) || (function () { - var extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -/** - * A `LocationServices` that gets/sets the current location using the browser's `location` and `history` apis - * - * Uses `history.pushState` and `history.replaceState` - */ -var PushStateLocationService = (function (_super) { - __extends$2(PushStateLocationService, _super); - function PushStateLocationService(router) { - var _this = _super.call(this, router, true) || this; - _this._config = router.urlService.config; - window.addEventListener("popstate", _this._listener, false); - return _this; - } - - PushStateLocationService.prototype._get = function () { - var _a = this._location, pathname = _a.pathname, hash = _a.hash, search = _a.search; - search = splitQuery(search)[1]; // strip ? if found - hash = splitHash(hash)[1]; // strip # if found - return pathname + (search ? "?" + search : "") + (hash ? "$" + search : ""); - }; - PushStateLocationService.prototype._set = function (state, title, url, replace) { - var _a = this, _config = _a._config, _history = _a._history; - var fullUrl = _config.baseHref() + url; - if (replace) { - _history.replaceState(state, title, fullUrl); - } - else { - _history.pushState(state, title, fullUrl); - } - }; - PushStateLocationService.prototype.dispose = function (router) { - _super.prototype.dispose.call(this, router); - window.removeEventListener("popstate", this._listener); - }; - return PushStateLocationService; -}(BaseLocationServices)); - -/** A `LocationConfig` mock that gets/sets all config from an in-memory object */ -var MemoryLocationConfig = (function () { - function MemoryLocationConfig() { - var _this = this; - this._baseHref = ''; - this._port = 80; - this._protocol = "http"; - this._host = "localhost"; - this._hashPrefix = ""; - this.port = function () { return _this._port; }; - this.protocol = function () { return _this._protocol; }; - this.host = function () { return _this._host; }; - this.baseHref = function () { return _this._baseHref; }; - this.html5Mode = function () { return false; }; - this.hashPrefix = function (newval) { return isDefined(newval) ? _this._hashPrefix = newval : _this._hashPrefix; }; - this.dispose = noop$1; - } - return MemoryLocationConfig; -}()); - -/** - * @internalapi - * @module vanilla - */ -/** */ -/** A `LocationConfig` that delegates to the browser's `location` object */ -var BrowserLocationConfig = (function () { - function BrowserLocationConfig(router, _isHtml5) { - if (_isHtml5 === void 0) { _isHtml5 = false; } - this._isHtml5 = _isHtml5; - this._baseHref = undefined; - this._hashPrefix = ""; - } - BrowserLocationConfig.prototype.port = function () { - if (location.port) { - return Number(location.port); - } - return this.protocol() === 'https' ? 443 : 80; - }; - BrowserLocationConfig.prototype.protocol = function () { - return location.protocol.replace(/:/g, ''); - }; - BrowserLocationConfig.prototype.host = function () { - return location.host; - }; - BrowserLocationConfig.prototype.html5Mode = function () { - return this._isHtml5; - }; - BrowserLocationConfig.prototype.hashPrefix = function (newprefix) { - return isDefined(newprefix) ? this._hashPrefix = newprefix : this._hashPrefix; - }; - - BrowserLocationConfig.prototype.baseHref = function (href) { - return isDefined(href) ? this._baseHref = href : this._baseHref || this.applyDocumentBaseHref(); - }; - BrowserLocationConfig.prototype.applyDocumentBaseHref = function () { - var baseTags = document.getElementsByTagName("base"); - return this._baseHref = baseTags.length ? baseTags[0].href.substr(location.origin.length) : ""; - }; - BrowserLocationConfig.prototype.dispose = function () { }; - return BrowserLocationConfig; -}()); - -/** - * @internalapi - * @module vanilla - */ -/** */ -function servicesPlugin(router) { - services.$injector = $injector; - services.$q = $q; - return { name: "vanilla.services", $q: $q, $injector: $injector, dispose: function () { return null; } }; -} -/** A `UIRouterPlugin` uses the browser hash to get/set the current location */ -var hashLocationPlugin = locationPluginFactory('vanilla.hashBangLocation', false, HashLocationService, BrowserLocationConfig); -/** A `UIRouterPlugin` that gets/sets the current location using the browser's `location` and `history` apis */ -var pushStateLocationPlugin = locationPluginFactory("vanilla.pushStateLocation", true, PushStateLocationService, BrowserLocationConfig); -/** A `UIRouterPlugin` that gets/sets the current location from an in-memory object */ -var memoryLocationPlugin = locationPluginFactory("vanilla.memoryLocation", false, MemoryLocationService, MemoryLocationConfig); - -/** - * @internalapi - * @module vanilla - */ -/** */ - -/** - * # Core classes and interfaces - * - * The classes and interfaces that are core to ui-router and do not belong - * to a more specific subsystem (such as resolve). - * - * @coreapi - * @preferred - * @module core - */ /** for typedoc */ -/** @internalapi */ -var UIRouterPluginBase = (function () { - function UIRouterPluginBase() { - } - UIRouterPluginBase.prototype.dispose = function (router) { }; - return UIRouterPluginBase; -}()); - -/** - * @coreapi - * @module common - */ /** */ - - - -var index$1 = Object.freeze({ - fromJson: fromJson, - toJson: toJson, - copy: copy, - forEach: forEach, - extend: extend, - equals: equals, - identity: identity, - noop: noop$1, - createProxyFunctions: createProxyFunctions, - inherit: inherit, - inArray: inArray, - _inArray: _inArray, - removeFrom: removeFrom, - _removeFrom: _removeFrom, - pushTo: pushTo, - _pushTo: _pushTo, - deregAll: deregAll, - defaults: defaults, - mergeR: mergeR, - ancestors: ancestors, - pick: pick, - omit: omit, - pluck: pluck, - filter: filter, - find: find, - mapObj: mapObj, - map: map, - values: values, - allTrueR: allTrueR, - anyTrueR: anyTrueR, - unnestR: unnestR, - flattenR: flattenR, - pushR: pushR, - uniqR: uniqR, - unnest: unnest, - flatten: flatten, - assertPredicate: assertPredicate, - assertMap: assertMap, - assertFn: assertFn, - pairs: pairs, - arrayTuples: arrayTuples, - applyPairs: applyPairs, - tail: tail, - _extend: _extend, - sortBy: sortBy, - composeSort: composeSort, - silenceUncaughtInPromise: silenceUncaughtInPromise, - silentRejection: silentRejection, - notImplemented: notImplemented, - services: services, - Glob: Glob, - curry: curry, - compose: compose, - pipe: pipe, - prop: prop, - propEq: propEq, - parse: parse, - not: not, - and: and, - or: or, - all: all, - any: any, - is: is, - eq: eq, - val: val, - invoke: invoke, - pattern: pattern, - isUndefined: isUndefined, - isDefined: isDefined, - isNull: isNull, - isNullOrUndefined: isNullOrUndefined, - isFunction: isFunction, - isNumber: isNumber, - isString: isString, - isObject: isObject, - isArray: isArray, - isDate: isDate, - isRegExp: isRegExp, - isState: isState, - isInjectable: isInjectable, - isPromise: isPromise, - Queue: Queue, - maxLength: maxLength, - padString: padString, - kebobString: kebobString, - functionToString: functionToString, - fnToString: fnToString, - stringify: stringify, - beforeAfterSubstr: beforeAfterSubstr, - splitOnDelim: splitOnDelim, - joinNeighborsR: joinNeighborsR, - get Category () { return exports.Category; }, - Trace: Trace, - trace: trace, - get DefType () { return exports.DefType; }, - Param: Param, - ParamTypes: ParamTypes, - StateParams: StateParams, - ParamType: ParamType, - PathNode: PathNode, - PathUtils: PathUtils, - resolvePolicies: resolvePolicies, - defaultResolvePolicy: defaultResolvePolicy, - Resolvable: Resolvable, - NATIVE_INJECTOR_TOKEN: NATIVE_INJECTOR_TOKEN, - ResolveContext: ResolveContext, - resolvablesBuilder: resolvablesBuilder, - StateBuilder: StateBuilder, - StateObject: StateObject, - StateMatcher: StateMatcher, - StateQueueManager: StateQueueManager, - StateRegistry: StateRegistry, - StateService: StateService, - TargetState: TargetState, - get TransitionHookPhase () { return exports.TransitionHookPhase; }, - get TransitionHookScope () { return exports.TransitionHookScope; }, - HookBuilder: HookBuilder, - matchState: matchState, - RegisteredHook: RegisteredHook, - makeEvent: makeEvent, - get RejectType () { return exports.RejectType; }, - Rejection: Rejection, - Transition: Transition, - TransitionHook: TransitionHook, - TransitionEventType: TransitionEventType, - defaultTransOpts: defaultTransOpts, - TransitionService: TransitionService, - UrlMatcher: UrlMatcher, - UrlMatcherFactory: UrlMatcherFactory, - UrlRouter: UrlRouter, - UrlRuleFactory: UrlRuleFactory, - BaseUrlRule: BaseUrlRule, - UrlService: UrlService, - ViewService: ViewService, - UIRouterGlobals: UIRouterGlobals, - UIRouter: UIRouter, - $q: $q, - $injector: $injector, - BaseLocationServices: BaseLocationServices, - HashLocationService: HashLocationService, - MemoryLocationService: MemoryLocationService, - PushStateLocationService: PushStateLocationService, - MemoryLocationConfig: MemoryLocationConfig, - BrowserLocationConfig: BrowserLocationConfig, - splitHash: splitHash, - splitQuery: splitQuery, - splitEqual: splitEqual, - trimHashVal: trimHashVal, - keyValsToObjectR: keyValsToObjectR, - getParams: getParams, - parseUrl: parseUrl$1, - buildUrl: buildUrl, - locationPluginFactory: locationPluginFactory, - servicesPlugin: servicesPlugin, - hashLocationPlugin: hashLocationPlugin, - pushStateLocationPlugin: pushStateLocationPlugin, - memoryLocationPlugin: memoryLocationPlugin, - UIRouterPluginBase: UIRouterPluginBase -}); - -var ng_from_global = angular; -var ng = (ng_from_import && ng_from_import.module) ? ng_from_import : ng_from_global; - -function getNg1ViewConfigFactory() { - var templateFactory = null; - return function (path, view) { - templateFactory = templateFactory || services.$injector.get("$templateFactory"); - return [new Ng1ViewConfig(path, view, templateFactory)]; - }; -} -var hasAnyKey = function (keys, obj) { - return keys.reduce(function (acc, key) { return acc || isDefined(obj[key]); }, false); -}; -/** - * This is a [[StateBuilder.builder]] function for angular1 `views`. - * - * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder - * handles the `views` property with logic specific to @uirouter/angularjs (ng1). - * - * If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object - * and applies the state-level configuration to a view named `$default`. - */ -function ng1ViewsBuilder(state) { - // Do not process root state - if (!state.parent) - return {}; - var tplKeys = ['templateProvider', 'templateUrl', 'template', 'notify', 'async'], ctrlKeys = ['controller', 'controllerProvider', 'controllerAs', 'resolveAs'], compKeys = ['component', 'bindings', 'componentProvider'], nonCompKeys = tplKeys.concat(ctrlKeys), allViewKeys = compKeys.concat(nonCompKeys); - // Do not allow a state to have both state-level props and also a `views: {}` property. - // A state without a `views: {}` property can declare properties for the `$default` view as properties of the state. - // However, the `$default` approach should not be mixed with a separate `views: ` block. - if (isDefined(state.views) && hasAnyKey(allViewKeys, state)) { - throw new Error("State '" + state.name + "' has a 'views' object. " + - "It cannot also have \"view properties\" at the state level. " + - "Move the following properties into a view (in the 'views' object): " + - (" " + allViewKeys.filter(function (key) { return isDefined(state[key]); }).join(", "))); - } - var views = {}, viewsObject = state.views || { "$default": pick(state, allViewKeys) }; - forEach(viewsObject, function (config, name) { - // Account for views: { "": { template... } } - name = name || "$default"; - // Account for views: { header: "headerComponent" } - if (isString(config)) - config = { component: config }; - // Make a shallow copy of the config object - config = extend({}, config); - // Do not allow a view to mix props for component-style view with props for template/controller-style view - if (hasAnyKey(compKeys, config) && hasAnyKey(nonCompKeys, config)) { - throw new Error("Cannot combine: " + compKeys.join("|") + " with: " + nonCompKeys.join("|") + " in stateview: '" + name + "@" + state.name + "'"); - } - config.resolveAs = config.resolveAs || '$resolve'; - config.$type = "ng1"; - config.$context = state; - config.$name = name; - var normalized = ViewService.normalizeUIViewTarget(config.$context, config.$name); - config.$uiViewName = normalized.uiViewName; - config.$uiViewContextAnchor = normalized.uiViewContextAnchor; - views[name] = config; - }); - return views; -} -var id$1 = 0; -var Ng1ViewConfig = (function () { - function Ng1ViewConfig(path, viewDecl, factory) { - var _this = this; - this.path = path; - this.viewDecl = viewDecl; - this.factory = factory; - this.$id = id$1++; - this.loaded = false; - this.getTemplate = function (uiView, context) { - return _this.component ? _this.factory.makeComponentTemplate(uiView, context, _this.component, _this.viewDecl.bindings) : _this.template; - }; - } - Ng1ViewConfig.prototype.load = function () { - var _this = this; - var $q$$1 = services.$q; - var context = new ResolveContext(this.path); - var params = this.path.reduce(function (acc, node) { return extend(acc, node.paramValues); }, {}); - var promises = { - template: $q$$1.when(this.factory.fromConfig(this.viewDecl, params, context)), - controller: $q$$1.when(this.getController(context)) - }; - return $q$$1.all(promises).then(function (results) { - trace.traceViewServiceEvent("Loaded", _this); - _this.controller = results.controller; - extend(_this, results.template); // Either { template: "tpl" } or { component: "cmpName" } - return _this; - }); - }; - /** - * Gets the controller for a view configuration. - * - * @returns {Function|Promise.} Returns a controller, or a promise that resolves to a controller. - */ - Ng1ViewConfig.prototype.getController = function (context) { - var provider = this.viewDecl.controllerProvider; - if (!isInjectable(provider)) - return this.viewDecl.controller; - var deps = services.$injector.annotate(provider); - var providerFn = isArray(provider) ? tail(provider) : provider; - var resolvable = new Resolvable("", providerFn, deps); - return resolvable.get(context); - }; - return Ng1ViewConfig; -}()); - -/** @module view */ -/** for typedoc */ -/** - * Service which manages loading of templates from a ViewConfig. - */ -var TemplateFactory = (function () { - function TemplateFactory() { - var _this = this; - /** @hidden */ this._useHttp = ng.version.minor < 3; - /** @hidden */ this.$get = ['$http', '$templateCache', '$injector', function ($http, $templateCache, $injector$$1) { - _this.$templateRequest = $injector$$1.has && $injector$$1.has('$templateRequest') && $injector$$1.get('$templateRequest'); - _this.$http = $http; - _this.$templateCache = $templateCache; - return _this; - }]; - } - /** @hidden */ - TemplateFactory.prototype.useHttpService = function (value) { - this._useHttp = value; - }; - - /** - * Creates a template from a configuration object. - * - * @param config Configuration object for which to load a template. - * The following properties are search in the specified order, and the first one - * that is defined is used to create the template: - * - * @param params Parameters to pass to the template function. - * @param context The resolve context associated with the template's view - * - * @return {string|object} The template html as a string, or a promise for - * that string,or `null` if no template is configured. - */ - TemplateFactory.prototype.fromConfig = function (config, params, context) { - var defaultTemplate = ""; - var asTemplate = function (result) { return services.$q.when(result).then(function (str) { return ({ template: str }); }); }; - var asComponent = function (result) { return services.$q.when(result).then(function (str) { return ({ component: str }); }); }; - return (isDefined(config.template) ? asTemplate(this.fromString(config.template, params)) : - isDefined(config.templateUrl) ? asTemplate(this.fromUrl(config.templateUrl, params)) : - isDefined(config.templateProvider) ? asTemplate(this.fromProvider(config.templateProvider, params, context)) : - isDefined(config.component) ? asComponent(config.component) : - isDefined(config.componentProvider) ? asComponent(this.fromComponentProvider(config.componentProvider, params, context)) : - asTemplate(defaultTemplate)); - }; - - /** - * Creates a template from a string or a function returning a string. - * - * @param template html template as a string or function that returns an html template as a string. - * @param params Parameters to pass to the template function. - * - * @return {string|object} The template html as a string, or a promise for that - * string. - */ - TemplateFactory.prototype.fromString = function (template, params) { - return isFunction(template) ? template(params) : template; - }; - - /** - * Loads a template from the a URL via `$http` and `$templateCache`. - * - * @param {string|Function} url url of the template to load, or a function - * that returns a url. - * @param {Object} params Parameters to pass to the url function. - * @return {string|Promise.} The template html as a string, or a promise - * for that string. - */ - TemplateFactory.prototype.fromUrl = function (url, params) { - if (isFunction(url)) - url = url(params); - if (url == null) - return null; - if (this._useHttp) { - return this.$http.get(url, { cache: this.$templateCache, headers: { Accept: 'text/html' } }) - .then(function (response) { - return response.data; - }); - } - return this.$templateRequest(url); - }; - - /** - * Creates a template by invoking an injectable provider function. - * - * @param provider Function to invoke via `locals` - * @param {Function} injectFn a function used to invoke the template provider - * @return {string|Promise.} The template html as a string, or a promise - * for that string. - */ - TemplateFactory.prototype.fromProvider = function (provider, params, context) { - var deps = services.$injector.annotate(provider); - var providerFn = isArray(provider) ? tail(provider) : provider; - var resolvable = new Resolvable("", providerFn, deps); - return resolvable.get(context); - }; - - /** - * Creates a component's template by invoking an injectable provider function. - * - * @param provider Function to invoke via `locals` - * @param {Function} injectFn a function used to invoke the template provider - * @return {string} The template html as a string: "". - */ - TemplateFactory.prototype.fromComponentProvider = function (provider, params, context) { - var deps = services.$injector.annotate(provider); - var providerFn = isArray(provider) ? tail(provider) : provider; - var resolvable = new Resolvable("", providerFn, deps); - return resolvable.get(context); - }; - - /** - * Creates a template from a component's name - * - * This implements route-to-component. - * It works by retrieving the component (directive) metadata from the injector. - * It analyses the component's bindings, then constructs a template that instantiates the component. - * The template wires input and output bindings to resolves or from the parent component. - * - * @param uiView {object} The parent ui-view (for binding outputs to callbacks) - * @param context The ResolveContext (for binding outputs to callbacks returned from resolves) - * @param component {string} Component's name in camel case. - * @param bindings An object defining the component's bindings: {foo: '<'} - * @return {string} The template as a string: "". - */ - TemplateFactory.prototype.makeComponentTemplate = function (uiView, context, component, bindings) { - bindings = bindings || {}; - // Bind once prefix - var prefix = ng.version.minor >= 3 ? "::" : ""; - // Convert to kebob name. Add x- prefix if the string starts with `x-` or `data-` - var kebob = function (camelCase) { - var kebobed = kebobString(camelCase); - return /^(x|data)-/.exec(kebobed) ? "x-" + kebobed : kebobed; - }; - var attributeTpl = function (input) { - var name = input.name, type = input.type; - var attrName = kebob(name); - // If the ui-view has an attribute which matches a binding on the routed component - // then pass that attribute through to the routed component template. - // Prefer ui-view wired mappings to resolve data, unless the resolve was explicitly bound using `bindings:` - if (uiView.attr(attrName) && !bindings[name]) - return attrName + "='" + uiView.attr(attrName) + "'"; - var resolveName = bindings[name] || name; - // Pre-evaluate the expression for "@" bindings by enclosing in {{ }} - // some-attr="{{ ::$resolve.someResolveName }}" - if (type === '@') - return attrName + "='{{" + prefix + "$resolve." + resolveName + "}}'"; - // Wire "&" callbacks to resolves that return a callback function - // Get the result of the resolve (should be a function) and annotate it to get its arguments. - // some-attr="$resolve.someResolveResultName(foo, bar)" - if (type === '&') { - var res = context.getResolvable(resolveName); - var fn = res && res.data; - var args = fn && services.$injector.annotate(fn) || []; - // account for array style injection, i.e., ['foo', function(foo) {}] - var arrayIdxStr = isArray(fn) ? "[" + (fn.length - 1) + "]" : ''; - return attrName + "='$resolve." + resolveName + arrayIdxStr + "(" + args.join(",") + ")'"; - } - // some-attr="::$resolve.someResolveName" - return attrName + "='" + prefix + "$resolve." + resolveName + "'"; - }; - var attrs = getComponentBindings(component).map(attributeTpl).join(" "); - var kebobName = kebob(component); - return "<" + kebobName + " " + attrs + ">"; - }; - - return TemplateFactory; -}()); -// Gets all the directive(s)' inputs ('@', '=', and '<') and outputs ('&') -function getComponentBindings(name) { - var cmpDefs = services.$injector.get(name + "Directive"); // could be multiple - if (!cmpDefs || !cmpDefs.length) - throw new Error("Unable to find component named '" + name + "'"); - return cmpDefs.map(getBindings).reduce(unnestR, []); -} -// Given a directive definition, find its object input attributes -// Use different properties, depending on the type of directive (component, bindToController, normal) -var getBindings = function (def) { - if (isObject(def.bindToController)) - return scopeBindings(def.bindToController); - return scopeBindings(def.scope); -}; -// for ng 1.2 style, process the scope: { input: "=foo" } -// for ng 1.3 through ng 1.5, process the component's bindToController: { input: "=foo" } object -var scopeBindings = function (bindingsObj) { return Object.keys(bindingsObj || {}) - .map(function (key) { return [key, /^([=<@&])[?]?(.*)/.exec(bindingsObj[key])]; }) - .filter(function (tuple) { return isDefined(tuple) && isArray(tuple[1]); }) - .map(function (tuple) { return ({ name: tuple[1][2] || tuple[0], type: tuple[1][1] }); }); }; - -/** @module ng1 */ /** for typedoc */ -/** - * The Angular 1 `StateProvider` - * - * The `$stateProvider` works similar to Angular's v1 router, but it focuses purely - * on state. - * - * A state corresponds to a "place" in the application in terms of the overall UI and - * navigation. A state describes (via the controller / template / view properties) what - * the UI looks like and does at that place. - * - * States often have things in common, and the primary way of factoring out these - * commonalities in this model is via the state hierarchy, i.e. parent/child states aka - * nested states. - * - * The `$stateProvider` provides interfaces to declare these states for your app. - */ -var StateProvider = (function () { - function StateProvider(stateRegistry, stateService) { - this.stateRegistry = stateRegistry; - this.stateService = stateService; - createProxyFunctions(val(StateProvider.prototype), this, val(this)); - } - /** - * Decorates states when they are registered - * - * Allows you to extend (carefully) or override (at your own peril) the - * `stateBuilder` object used internally by [[StateRegistry]]. - * This can be used to add custom functionality to ui-router, - * for example inferring templateUrl based on the state name. - * - * When passing only a name, it returns the current (original or decorated) builder - * function that matches `name`. - * - * The builder functions that can be decorated are listed below. Though not all - * necessarily have a good use case for decoration, that is up to you to decide. - * - * In addition, users can attach custom decorators, which will generate new - * properties within the state's internal definition. There is currently no clear - * use-case for this beyond accessing internal states (i.e. $state.$current), - * however, expect this to become increasingly relevant as we introduce additional - * meta-programming features. - * - * **Warning**: Decorators should not be interdependent because the order of - * execution of the builder functions in non-deterministic. Builder functions - * should only be dependent on the state definition object and super function. - * - * - * Existing builder functions and current return values: - * - * - **parent** `{object}` - returns the parent state object. - * - **data** `{object}` - returns state data, including any inherited data that is not - * overridden by own values (if any). - * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher} - * or `null`. - * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is - * navigable). - * - **params** `{object}` - returns an array of state params that are ensured to - * be a super-set of parent's params. - * - **views** `{object}` - returns a views object where each key is an absolute view - * name (i.e. "viewName@stateName") and each value is the config object - * (template, controller) for the view. Even when you don't use the views object - * explicitly on a state config, one is still created for you internally. - * So by decorating this builder function you have access to decorating template - * and controller properties. - * - **ownParams** `{object}` - returns an array of params that belong to the state, - * not including any params defined by ancestor states. - * - **path** `{string}` - returns the full path from the root down to this state. - * Needed for state activation. - * - **includes** `{object}` - returns an object that includes every state that - * would pass a `$state.includes()` test. - * - * #### Example: - * Override the internal 'views' builder with a function that takes the state - * definition, and a reference to the internal function being overridden: - * ```js - * $stateProvider.decorator('views', function (state, parent) { - * let result = {}, - * views = parent(state); - * - * angular.forEach(views, function (config, name) { - * let autoName = (state.name + '.' + name).replace('.', '/'); - * config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html'; - * result[name] = config; - * }); - * return result; - * }); - * - * $stateProvider.state('home', { - * views: { - * 'contact.list': { controller: 'ListController' }, - * 'contact.item': { controller: 'ItemController' } - * } - * }); - * ``` - * - * - * ```js - * // Auto-populates list and item views with /partials/home/contact/list.html, - * // and /partials/home/contact/item.html, respectively. - * $state.go('home'); - * ``` - * - * @param {string} name The name of the builder function to decorate. - * @param {object} func A function that is responsible for decorating the original - * builder function. The function receives two parameters: - * - * - `{object}` - state - The state config object. - * - `{object}` - super - The original builder function. - * - * @return {object} $stateProvider - $stateProvider instance - */ - StateProvider.prototype.decorator = function (name, func) { - return this.stateRegistry.decorator(name, func) || this; - }; - StateProvider.prototype.state = function (name, definition) { - if (isObject(name)) { - definition = name; - } - else { - definition.name = name; - } - this.stateRegistry.register(definition); - return this; - }; - /** - * Registers an invalid state handler - * - * This is a passthrough to [[StateService.onInvalid]] for ng1. - */ - StateProvider.prototype.onInvalid = function (callback) { - return this.stateService.onInvalid(callback); - }; - return StateProvider; -}()); - -/** @module ng1 */ /** */ -/** - * This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`, - * `onRetain` callback hooks on a [[Ng1StateDeclaration]]. - * - * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder - * ensures that those hooks are injectable for @uirouter/angularjs (ng1). - */ -var getStateHookBuilder = function (hookName) { - return function stateHookBuilder(state, parentFn) { - var hook = state[hookName]; - var pathname = hookName === 'onExit' ? 'from' : 'to'; - function decoratedNg1Hook(trans, state) { - var resolveContext = new ResolveContext(trans.treeChanges(pathname)); - var locals = extend(getLocals(resolveContext), { $state$: state, $transition$: trans }); - return services.$injector.invoke(hook, this, locals); - } - return hook ? decoratedNg1Hook : undefined; - }; -}; - -/** - * Implements UI-Router LocationServices and LocationConfig using Angular 1's $location service - */ -var Ng1LocationServices = (function () { - function Ng1LocationServices($locationProvider) { - // .onChange() registry - this._urlListeners = []; - this.$locationProvider = $locationProvider; - var _lp = val($locationProvider); - createProxyFunctions(_lp, this, _lp, ['hashPrefix']); - } - Ng1LocationServices.prototype.dispose = function () { }; - Ng1LocationServices.prototype.onChange = function (callback) { - var _this = this; - this._urlListeners.push(callback); - return function () { return removeFrom(_this._urlListeners)(callback); }; - }; - Ng1LocationServices.prototype.html5Mode = function () { - var html5Mode = this.$locationProvider.html5Mode(); - html5Mode = isObject(html5Mode) ? html5Mode.enabled : html5Mode; - return html5Mode && this.$sniffer.history; - }; - Ng1LocationServices.prototype.url = function (newUrl, replace, state) { - if (replace === void 0) { replace = false; } - if (newUrl) - this.$location.url(newUrl); - if (replace) - this.$location.replace(); - if (state) - this.$location.state(state); - return this.$location.url(); - }; - Ng1LocationServices.prototype._runtimeServices = function ($rootScope, $location, $sniffer, $browser) { - var _this = this; - this.$location = $location; - this.$sniffer = $sniffer; - // Bind $locationChangeSuccess to the listeners registered in LocationService.onChange - $rootScope.$on("$locationChangeSuccess", function (evt) { return _this._urlListeners.forEach(function (fn) { return fn(evt); }); }); - var _loc = val($location); - var _browser = val($browser); - // Bind these LocationService functions to $location - createProxyFunctions(_loc, this, _loc, ["replace", "path", "search", "hash"]); - // Bind these LocationConfig functions to $location - createProxyFunctions(_loc, this, _loc, ['port', 'protocol', 'host']); - // Bind these LocationConfig functions to $browser - createProxyFunctions(_browser, this, _browser, ['baseHref']); - }; - /** - * Applys ng1-specific path parameter encoding - * - * The Angular 1 `$location` service is a bit weird. - * It doesn't allow slashes to be encoded/decoded bi-directionally. - * - * See the writeup at https://github.com/angular-ui/ui-router/issues/2598 - * - * This code patches the `path` parameter type so it encoded/decodes slashes as ~2F - * - * @param router - */ - Ng1LocationServices.monkeyPatchPathParameterType = function (router) { - var pathType = router.urlMatcherFactory.type('path'); - pathType.encode = function (val$$1) { - return val$$1 != null ? val$$1.toString().replace(/(~|\/)/g, function (m) { return ({ '~': '~~', '/': '~2F' }[m]); }) : val$$1; - }; - pathType.decode = function (val$$1) { - return val$$1 != null ? val$$1.toString().replace(/(~~|~2F)/g, function (m) { return ({ '~~': '~', '~2F': '/' }[m]); }) : val$$1; - }; - }; - return Ng1LocationServices; -}()); - -/** @module url */ /** */ -/** - * Manages rules for client-side URL - * - * ### Deprecation warning: - * This class is now considered to be an internal API - * Use the [[UrlService]] instead. - * For configuring URL rules, use the [[UrlRulesApi]] which can be found as [[UrlService.rules]]. - * - * This class manages the router rules for what to do when the URL changes. - * - * This provider remains for backwards compatibility. - * - * @deprecated - */ -var UrlRouterProvider = (function () { - /** @hidden */ - function UrlRouterProvider(router) { - this._router = router; - this._urlRouter = router.urlRouter; - } - /** @hidden */ - UrlRouterProvider.prototype.$get = function () { - var urlRouter = this._urlRouter; - urlRouter.update(true); - if (!urlRouter.interceptDeferred) - urlRouter.listen(); - return urlRouter; - }; - /** - * Registers a url handler function. - * - * Registers a low level url handler (a `rule`). - * A rule detects specific URL patterns and returns a redirect, or performs some action. - * - * If a rule returns a string, the URL is replaced with the string, and all rules are fired again. - * - * #### Example: - * ```js - * var app = angular.module('app', ['ui.router.router']); - * - * app.config(function ($urlRouterProvider) { - * // Here's an example of how you might allow case insensitive urls - * $urlRouterProvider.rule(function ($injector, $location) { - * var path = $location.path(), - * normalized = path.toLowerCase(); - * - * if (path !== normalized) { - * return normalized; - * } - * }); - * }); - * ``` - * - * @param ruleFn - * Handler function that takes `$injector` and `$location` services as arguments. - * You can use them to detect a url and return a different url as a string. - * - * @return [[UrlRouterProvider]] (`this`) - */ - UrlRouterProvider.prototype.rule = function (ruleFn) { - var _this = this; - if (!isFunction(ruleFn)) - throw new Error("'rule' must be a function"); - var match = function () { - return ruleFn(services.$injector, _this._router.locationService); - }; - var rule = new BaseUrlRule(match, identity); - this._urlRouter.rule(rule); - return this; - }; - - /** - * Defines the path or behavior to use when no url can be matched. - * - * #### Example: - * ```js - * var app = angular.module('app', ['ui.router.router']); - * - * app.config(function ($urlRouterProvider) { - * // if the path doesn't match any of the urls you configured - * // otherwise will take care of routing the user to the - * // specified url - * $urlRouterProvider.otherwise('/index'); - * - * // Example of using function rule as param - * $urlRouterProvider.otherwise(function ($injector, $location) { - * return '/a/valid/url'; - * }); - * }); - * ``` - * - * @param rule - * The url path you want to redirect to or a function rule that returns the url path or performs a `$state.go()`. - * The function version is passed two params: `$injector` and `$location` services, and should return a url string. - * - * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance - */ - UrlRouterProvider.prototype.otherwise = function (rule) { - var _this = this; - var urlRouter = this._urlRouter; - if (isString(rule)) { - urlRouter.otherwise(rule); - } - else if (isFunction(rule)) { - urlRouter.otherwise(function () { return rule(services.$injector, _this._router.locationService); }); - } - else { - throw new Error("'rule' must be a string or function"); - } - return this; - }; - - /** - * Registers a handler for a given url matching. - * - * If the handler is a string, it is - * treated as a redirect, and is interpolated according to the syntax of match - * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise). - * - * If the handler is a function, it is injectable. - * It gets invoked if `$location` matches. - * You have the option of inject the match object as `$match`. - * - * The handler can return - * - * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter` - * will continue trying to find another one that matches. - * - **string** which is treated as a redirect and passed to `$location.url()` - * - **void** or any **truthy** value tells `$urlRouter` that the url was handled. - * - * #### Example: - * ```js - * var app = angular.module('app', ['ui.router.router']); - * - * app.config(function ($urlRouterProvider) { - * $urlRouterProvider.when($state.url, function ($match, $stateParams) { - * if ($state.$current.navigable !== state || - * !equalForKeys($match, $stateParams) { - * $state.transitionTo(state, $match, false); - * } - * }); - * }); - * ``` - * - * @param what A pattern string to match, compiled as a [[UrlMatcher]]. - * @param handler The path (or function that returns a path) that you want to redirect your user to. - * @param ruleCallback [optional] A callback that receives the `rule` registered with [[UrlMatcher.rule]] - * - * Note: the handler may also invoke arbitrary code, such as `$state.go()` - */ - UrlRouterProvider.prototype.when = function (what, handler) { - if (isArray(handler) || isFunction(handler)) { - handler = UrlRouterProvider.injectableHandler(this._router, handler); - } - this._urlRouter.when(what, handler); - return this; - }; - - UrlRouterProvider.injectableHandler = function (router, handler) { - return function (match) { - return services.$injector.invoke(handler, null, { $match: match, $stateParams: router.globals.params }); - }; - }; - /** - * Disables monitoring of the URL. - * - * Call this method before UI-Router has bootstrapped. - * It will stop UI-Router from performing the initial url sync. - * - * This can be useful to perform some asynchronous initialization before the router starts. - * Once the initialization is complete, call [[listen]] to tell UI-Router to start watching and synchronizing the URL. - * - * #### Example: - * ```js - * var app = angular.module('app', ['ui.router']); - * - * app.config(function ($urlRouterProvider) { - * // Prevent $urlRouter from automatically intercepting URL changes; - * $urlRouterProvider.deferIntercept(); - * }) - * - * app.run(function (MyService, $urlRouter, $http) { - * $http.get("/stuff").then(function(resp) { - * MyService.doStuff(resp.data); - * $urlRouter.listen(); - * $urlRouter.sync(); - * }); - * }); - * ``` - * - * @param defer Indicates whether to defer location change interception. - * Passing no parameter is equivalent to `true`. - */ - UrlRouterProvider.prototype.deferIntercept = function (defer) { - this._urlRouter.deferIntercept(defer); - }; - - return UrlRouterProvider; -}()); - -/** - * # Angular 1 types - * - * UI-Router core provides various Typescript types which you can use for code completion and validating parameter values, etc. - * The customizations to the core types for Angular UI-Router are documented here. - * - * The optional [[$resolve]] service is also documented here. - * - * @module ng1 - * @preferred - */ -/** for typedoc */ -ng.module("ui.router.angular1", []); -var mod_init = ng.module('ui.router.init', []); -var mod_util = ng.module('ui.router.util', ['ng', 'ui.router.init']); -var mod_rtr = ng.module('ui.router.router', ['ui.router.util']); -var mod_state = ng.module('ui.router.state', ['ui.router.router', 'ui.router.util', 'ui.router.angular1']); -var mod_main = ng.module('ui.router', ['ui.router.init', 'ui.router.state', 'ui.router.angular1']); -var mod_cmpt = ng.module('ui.router.compat', ['ui.router']); // tslint:disable-line -var router = null; -$uiRouter.$inject = ['$locationProvider']; -/** This angular 1 provider instantiates a Router and exposes its services via the angular injector */ -function $uiRouter($locationProvider) { - // Create a new instance of the Router when the $uiRouterProvider is initialized - router = this.router = new UIRouter(); - router.stateProvider = new StateProvider(router.stateRegistry, router.stateService); - // Apply ng1 specific StateBuilder code for `views`, `resolve`, and `onExit/Retain/Enter` properties - router.stateRegistry.decorator("views", ng1ViewsBuilder); - router.stateRegistry.decorator("onExit", getStateHookBuilder("onExit")); - router.stateRegistry.decorator("onRetain", getStateHookBuilder("onRetain")); - router.stateRegistry.decorator("onEnter", getStateHookBuilder("onEnter")); - router.viewService._pluginapi._viewConfigFactory('ng1', getNg1ViewConfigFactory()); - var ng1LocationService = router.locationService = router.locationConfig = new Ng1LocationServices($locationProvider); - Ng1LocationServices.monkeyPatchPathParameterType(router); - // backwards compat: also expose router instance as $uiRouterProvider.router - router['router'] = router; - router['$get'] = $get; - $get.$inject = ['$location', '$browser', '$sniffer', '$rootScope', '$http', '$templateCache']; - function $get($location, $browser, $sniffer, $rootScope, $http, $templateCache) { - ng1LocationService._runtimeServices($rootScope, $location, $sniffer, $browser); - delete router['router']; - delete router['$get']; - return router; - } - return router; -} -var getProviderFor = function (serviceName) { return ['$uiRouterProvider', function ($urp) { - var service = $urp.router[serviceName]; - service["$get"] = function () { return service; }; - return service; - }]; }; -// This effectively calls $get() on `$uiRouterProvider` to trigger init (when ng enters runtime) -runBlock.$inject = ['$injector', '$q', '$uiRouter']; -function runBlock($injector$$1, $q$$1, $uiRouter) { - services.$injector = $injector$$1; - services.$q = $q$$1; - // The $injector is now available. - // Find any resolvables that had dependency annotation deferred - $uiRouter.stateRegistry.get() - .map(function (x) { return x.$$state().resolvables; }) - .reduce(unnestR, []) - .filter(function (x) { return x.deps === "deferred"; }) - .forEach(function (resolvable) { return resolvable.deps = $injector$$1.annotate(resolvable.resolveFn); }); -} -// $urlRouter service and $urlRouterProvider -var getUrlRouterProvider = function (uiRouter) { - return uiRouter.urlRouterProvider = new UrlRouterProvider(uiRouter); -}; -// $state service and $stateProvider -// $urlRouter service and $urlRouterProvider -var getStateProvider = function () { - return extend(router.stateProvider, { $get: function () { return router.stateService; } }); -}; -watchDigests.$inject = ['$rootScope']; -function watchDigests($rootScope) { - $rootScope.$watch(function () { trace.approximateDigests++; }); -} -mod_init.provider("$uiRouter", $uiRouter); -mod_rtr.provider('$urlRouter', ['$uiRouterProvider', getUrlRouterProvider]); -mod_util.provider('$urlService', getProviderFor('urlService')); -mod_util.provider('$urlMatcherFactory', ['$uiRouterProvider', function () { return router.urlMatcherFactory; }]); -mod_util.provider('$templateFactory', function () { return new TemplateFactory(); }); -mod_state.provider('$stateRegistry', getProviderFor('stateRegistry')); -mod_state.provider('$uiRouterGlobals', getProviderFor('globals')); -mod_state.provider('$transitions', getProviderFor('transitionService')); -mod_state.provider('$state', ['$uiRouterProvider', getStateProvider]); -mod_state.factory('$stateParams', ['$uiRouter', function ($uiRouter) { return $uiRouter.globals.params; }]); -mod_main.factory('$view', function () { return router.viewService; }); -mod_main.service("$trace", function () { return trace; }); -mod_main.run(watchDigests); -mod_util.run(['$urlMatcherFactory', function ($urlMatcherFactory) { }]); -mod_state.run(['$state', function ($state) { }]); -mod_rtr.run(['$urlRouter', function ($urlRouter) { }]); -mod_init.run(runBlock); -/** @hidden TODO: find a place to move this */ -var getLocals = function (ctx) { - var tokens = ctx.getTokens().filter(isString); - var tuples = tokens.map(function (key) { - var resolvable = ctx.getResolvable(key); - var waitPolicy = ctx.getPolicy(resolvable).async; - return [key, waitPolicy === 'NOWAIT' ? resolvable.promise : resolvable.data]; - }); - return tuples.reduce(applyPairs, {}); -}; - -/** - * # Angular 1 injectable services - * - * This is a list of the objects which can be injected using angular's injector. - * - * There are three different kind of injectable objects: - * - * ## **Provider** objects - * #### injectable into a `.config()` block during configtime - * - * - [[$uiRouterProvider]]: The UI-Router instance - * - [[$stateProvider]]: State registration - * - [[$transitionsProvider]]: Transition hooks - * - [[$urlServiceProvider]]: All URL related public APIs - * - * - [[$uiViewScrollProvider]]: Disable ui-router view scrolling - * - [[$urlRouterProvider]]: (deprecated) Url matching rules - * - [[$urlMatcherFactoryProvider]]: (deprecated) Url parsing config - * - * ## **Service** objects - * #### injectable globally during runtime - * - * - [[$uiRouter]]: The UI-Router instance - * - [[$trace]]: Enable transition trace/debug - * - [[$transitions]]: Transition hooks - * - [[$state]]: Imperative state related APIs - * - [[$stateRegistry]]: State registration - * - [[$urlService]]: All URL related public APIs - * - [[$uiRouterGlobals]]: Global variables - * - [[$uiViewScroll]]: Scroll an element into view - * - * - [[$stateParams]]: (deprecated) Global state param values - * - [[$urlRouter]]: (deprecated) URL synchronization - * - [[$urlMatcherFactory]]: (deprecated) URL parsing config - * - * ## **Per-Transition** objects - * - * - These kind of objects are injectable into: - * - Resolves ([[Ng1StateDeclaration.resolve]]), - * - Transition Hooks ([[TransitionService.onStart]], etc), - * - Routed Controllers ([[Ng1ViewDeclaration.controller]]) - * - * #### Different instances are injected based on the [[Transition]] - * - * - [[$transition$]]: The current Transition object - * - [[$stateParams]]: State param values for pending Transition (deprecated) - * - Any resolve data defined using [[Ng1StateDeclaration.resolve]] - * - * @ng1api - * @preferred - * @module injectables - */ /** */ -/** - * The current (or pending) State Parameters - * - * An injectable global **Service Object** which holds the state parameters for the latest **SUCCESSFUL** transition. - * - * The values are not updated until *after* a `Transition` successfully completes. - * - * **Also:** an injectable **Per-Transition Object** object which holds the pending state parameters for the pending `Transition` currently running. - * - * ### Deprecation warning: - * - * The value injected for `$stateParams` is different depending on where it is injected. - * - * - When injected into an angular service, the object injected is the global **Service Object** with the parameter values for the latest successful `Transition`. - * - When injected into transition hooks, resolves, or view controllers, the object is the **Per-Transition Object** with the parameter values for the running `Transition`. - * - * Because of these confusing details, this service is deprecated. - * - * ### Instead of using the global `$stateParams` service object, - * inject [[$uiRouterGlobals]] and use [[UIRouterGlobals.params]] - * - * ```js - * MyService.$inject = ['$uiRouterGlobals']; - * function MyService($uiRouterGlobals) { - * return { - * paramValues: function () { - * return $uiRouterGlobals.params; - * } - * } - * } - * ``` - * - * ### Instead of using the per-transition `$stateParams` object, - * inject the current `Transition` (as [[$transition$]]) and use [[Transition.params]] - * - * ```js - * MyController.$inject = ['$transition$']; - * function MyController($transition$) { - * var username = $transition$.params().username; - * // .. do something with username - * } - * ``` - * - * --- - * - * This object can be injected into other services. - * - * #### Deprecated Example: - * ```js - * SomeService.$inject = ['$http', '$stateParams']; - * function SomeService($http, $stateParams) { - * return { - * getUser: function() { - * return $http.get('/api/users/' + $stateParams.username); - * } - * } - * }; - * angular.service('SomeService', SomeService); - * ``` - * @deprecated - */ - -/** - * # Angular 1 Directives - * - * These are the directives included in UI-Router for Angular 1. - * These directives are used in templates to create viewports and link/navigate to states. - * - * @ng1api - * @preferred - * @module directives - */ /** for typedoc */ -/** @hidden */ -function parseStateRef(ref) { - var paramsOnly = ref.match(/^\s*({[^}]*})\s*$/), parsed; - if (paramsOnly) - ref = '(' + paramsOnly[1] + ')'; - parsed = ref.replace(/\n/g, " ").match(/^\s*([^(]*?)\s*(\((.*)\))?\s*$/); - if (!parsed || parsed.length !== 4) - throw new Error("Invalid state ref '" + ref + "'"); - return { state: parsed[1] || null, paramExpr: parsed[3] || null }; -} -/** @hidden */ -function stateContext(el) { - var $uiView = el.parent().inheritedData('$uiView'); - var path = parse('$cfg.path')($uiView); - return path ? tail(path).state.name : undefined; -} -/** @hidden */ -function processedDef($state, $element, def) { - var uiState = def.uiState || $state.current.name; - var uiStateOpts = extend(defaultOpts($element, $state), def.uiStateOpts || {}); - var href = $state.href(uiState, def.uiStateParams, uiStateOpts); - return { uiState: uiState, uiStateParams: def.uiStateParams, uiStateOpts: uiStateOpts, href: href }; -} -/** @hidden */ -function getTypeInfo(el) { - // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute. - var isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]'; - var isForm = el[0].nodeName === "FORM"; - return { - attr: isForm ? "action" : (isSvg ? 'xlink:href' : 'href'), - isAnchor: el.prop("tagName").toUpperCase() === "A", - clickable: !isForm - }; -} -/** @hidden */ -function clickHook(el, $state, $timeout, type, getDef) { - return function (e) { - var button = e.which || e.button, target = getDef(); - if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || el.attr('target'))) { - // HACK: This is to allow ng-clicks to be processed before the transition is initiated: - var transition = $timeout(function () { - $state.go(target.uiState, target.uiStateParams, target.uiStateOpts); - }); - e.preventDefault(); - // if the state has no URL, ignore one preventDefault from the directive. - var ignorePreventDefaultCount = type.isAnchor && !target.href ? 1 : 0; - e.preventDefault = function () { - if (ignorePreventDefaultCount-- <= 0) - $timeout.cancel(transition); - }; - } - }; -} -/** @hidden */ -function defaultOpts(el, $state) { - return { - relative: stateContext(el) || $state.$current, - inherit: true, - source: "sref" - }; -} -/** @hidden */ -function bindEvents(element, scope, hookFn, uiStateOpts) { - var events; - if (uiStateOpts) { - events = uiStateOpts.events; - } - if (!isArray(events)) { - events = ['click']; - } - var on = element.on ? 'on' : 'bind'; - for (var _i = 0, events_1 = events; _i < events_1.length; _i++) { - var event_1 = events_1[_i]; - element[on](event_1, hookFn); - } - scope.$on('$destroy', function () { - var off = element.off ? 'off' : 'unbind'; - for (var _i = 0, events_2 = events; _i < events_2.length; _i++) { - var event_2 = events_2[_i]; - element[off](event_2, hookFn); - } - }); -} -/** - * `ui-sref`: A directive for linking to a state - * - * A directive which links to a state (and optionally, parameters). - * When clicked, this directive activates the linked state with the supplied parameter values. - * - * ### Linked State - * The attribute value of the `ui-sref` is the name of the state to link to. - * - * #### Example: - * This will activate the `home` state when the link is clicked. - * ```html - * Home - * ``` - * - * ### Relative Links - * You can also use relative state paths within `ui-sref`, just like a relative path passed to `$state.go()` ([[StateService.go]]). - * You just need to be aware that the path is relative to the state that *created* the link. - * This allows a state to create a relative `ui-sref` which always targets the same destination. - * - * #### Example: - * Both these links are relative to the parent state, even when a child state is currently active. - * ```html - * child 1 state - * child 2 state - * ``` - * - * This link activates the parent state. - * ```html - * Return - * ``` - * - * ### hrefs - * If the linked state has a URL, the directive will automatically generate and - * update the `href` attribute (using the [[StateService.href]] method). - * - * #### Example: - * Assuming the `users` state has a url of `/users/` - * ```html - * Users - * ``` - * - * ### Parameter Values - * In addition to the state name, a `ui-sref` can include parameter values which are applied when activating the state. - * Param values can be provided in the `ui-sref` value after the state name, enclosed by parentheses. - * The content inside the parentheses is an expression, evaluated to the parameter values. - * - * #### Example: - * This example renders a list of links to users. - * The state's `userId` parameter value comes from each user's `user.id` property. - * ```html - *
  • - * {{ user.displayName }} - *
  • - * ``` - * - * Note: - * The parameter values expression is `$watch`ed for updates. - * - * ### Transition Options - * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-sref-opts` attribute. - * Options are restricted to `location`, `inherit`, and `reload`. - * - * #### Example: - * ```html - * Home - * ``` - * - * ### Other DOM Events - * - * You can also customize which DOM events to respond to (instead of `click`) by - * providing an `events` array in the `ui-sref-opts` attribute. - * - * #### Example: - * ```html - * - * ``` - * - * ### Highlighting the active link - * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link. - * - * ### Examples - * If you have the following template: - * - * ```html - * Home - * About - * Next page - * - * - * ``` - * - * Then (assuming the current state is `contacts`) the rendered html including hrefs would be: - * - * ```html - * Home - * About - * Next page - * - *
      - *
    • - * Joe - *
    • - *
    • - * Alice - *
    • - *
    • - * Bob - *
    • - *
    - * - * Home - * ``` - * - * ### Notes - * - * - You can use `ui-sref` to change **only the parameter values** by omitting the state name and parentheses. - * #### Example: - * Sets the `lang` parameter to `en` and remains on the same state. - * - * ```html - * English - * ``` - * - * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example. - * - * - Unlike the parameter values expression, the state name is not `$watch`ed (for performance reasons). - * If you need to dynamically update the state being linked to, use the fully dynamic [[uiState]] directive. - */ -var uiSref; -uiSref = ['$uiRouter', '$timeout', - function $StateRefDirective($uiRouter, $timeout) { - var $state = $uiRouter.stateService; - return { - restrict: 'A', - require: ['?^uiSrefActive', '?^uiSrefActiveEq'], - link: function (scope, element, attrs, uiSrefActive) { - var type = getTypeInfo(element); - var active = uiSrefActive[1] || uiSrefActive[0]; - var unlinkInfoFn = null; - var hookFn; - var rawDef = {}; - var getDef = function () { return processedDef($state, element, rawDef); }; - var ref = parseStateRef(attrs.uiSref); - rawDef.uiState = ref.state; - rawDef.uiStateOpts = attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {}; - function update() { - var def = getDef(); - if (unlinkInfoFn) - unlinkInfoFn(); - if (active) - unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams); - if (def.href != null) - attrs.$set(type.attr, def.href); - } - if (ref.paramExpr) { - scope.$watch(ref.paramExpr, function (val$$1) { - rawDef.uiStateParams = extend({}, val$$1); - update(); - }, true); - rawDef.uiStateParams = extend({}, scope.$eval(ref.paramExpr)); - } - update(); - scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update)); - scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update)); - if (!type.clickable) - return; - hookFn = clickHook(element, $state, $timeout, type, getDef); - bindEvents(element, scope, hookFn, rawDef.uiStateOpts); - } - }; - }]; -/** - * `ui-state`: A fully dynamic directive for linking to a state - * - * A directive which links to a state (and optionally, parameters). - * When clicked, this directive activates the linked state with the supplied parameter values. - * - * **This directive is very similar to [[uiSref]], but it `$observe`s and `$watch`es/evaluates all its inputs.** - * - * A directive which links to a state (and optionally, parameters). - * When clicked, this directive activates the linked state with the supplied parameter values. - * - * ### Linked State - * The attribute value of `ui-state` is an expression which is `$watch`ed and evaluated as the state to link to. - * **This is in contrast with `ui-sref`, which takes a state name as a string literal.** - * - * #### Example: - * Create a list of links. - * ```html - *
  • - * {{ link.displayName }} - *
  • - * ``` - * - * ### Relative Links - * If the expression evaluates to a relative path, it is processed like [[uiSref]]. - * You just need to be aware that the path is relative to the state that *created* the link. - * This allows a state to create relative `ui-state` which always targets the same destination. - * - * ### hrefs - * If the linked state has a URL, the directive will automatically generate and - * update the `href` attribute (using the [[StateService.href]] method). - * - * ### Parameter Values - * In addition to the state name expression, a `ui-state` can include parameter values which are applied when activating the state. - * Param values should be provided using the `ui-state-params` attribute. - * The `ui-state-params` attribute value is `$watch`ed and evaluated as an expression. - * - * #### Example: - * This example renders a list of links with param values. - * The state's `userId` parameter value comes from each user's `user.id` property. - * ```html - *
  • - * {{ link.displayName }} - *
  • - * ``` - * - * ### Transition Options - * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-state-opts` attribute. - * Options are restricted to `location`, `inherit`, and `reload`. - * The value of the `ui-state-opts` is `$watch`ed and evaluated as an expression. - * - * #### Example: - * ```html - * Home - * ``` - * - * ### Other DOM Events - * - * You can also customize which DOM events to respond to (instead of `click`) by - * providing an `events` array in the `ui-state-opts` attribute. - * - * #### Example: - * ```html - * - * ``` - * - * ### Highlighting the active link - * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link. - * - * ### Notes - * - * - You can use `ui-params` to change **only the parameter values** by omitting the state name and supplying only `ui-state-params`. - * However, it might be simpler to use [[uiSref]] parameter-only links. - * - * #### Example: - * Sets the `lang` parameter to `en` and remains on the same state. - * - * ```html - * English - * ``` - * - * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example. - * ``` - */ -var uiState; -uiState = ['$uiRouter', '$timeout', - function $StateRefDynamicDirective($uiRouter, $timeout) { - var $state = $uiRouter.stateService; - return { - restrict: 'A', - require: ['?^uiSrefActive', '?^uiSrefActiveEq'], - link: function (scope, element, attrs, uiSrefActive) { - var type = getTypeInfo(element); - var active = uiSrefActive[1] || uiSrefActive[0]; - var unlinkInfoFn = null; - var hookFn; - var rawDef = {}; - var getDef = function () { return processedDef($state, element, rawDef); }; - var inputAttrs = ['uiState', 'uiStateParams', 'uiStateOpts']; - var watchDeregFns = inputAttrs.reduce(function (acc, attr) { return (acc[attr] = noop$1, acc); }, {}); - function update() { - var def = getDef(); - if (unlinkInfoFn) - unlinkInfoFn(); - if (active) - unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams); - if (def.href != null) - attrs.$set(type.attr, def.href); - } - inputAttrs.forEach(function (field) { - rawDef[field] = attrs[field] ? scope.$eval(attrs[field]) : null; - attrs.$observe(field, function (expr) { - watchDeregFns[field](); - watchDeregFns[field] = scope.$watch(expr, function (newval) { - rawDef[field] = newval; - update(); - }, true); - }); - }); - update(); - scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update)); - scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update)); - if (!type.clickable) - return; - hookFn = clickHook(element, $state, $timeout, type, getDef); - bindEvents(element, scope, hookFn, rawDef.uiStateOpts); - } - }; - }]; -/** - * `ui-sref-active` and `ui-sref-active-eq`: A directive that adds a CSS class when a `ui-sref` is active - * - * A directive working alongside [[uiSref]] and [[uiState]] to add classes to an element when the - * related directive's state is active (and remove them when it is inactive). - * - * The primary use-case is to highlight the active link in navigation menus, - * distinguishing it from the inactive menu items. - * - * ### Linking to a `ui-sref` or `ui-state` - * `ui-sref-active` can live on the same element as `ui-sref`/`ui-state`, or it can be on a parent element. - * If a `ui-sref-active` is a parent to more than one `ui-sref`/`ui-state`, it will apply the CSS class when **any of the links are active**. - * - * ### Matching - * - * The `ui-sref-active` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state **or any child state is active**. - * This is a "fuzzy match" which uses [[StateService.includes]]. - * - * The `ui-sref-active-eq` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state is directly active (not when child states are active). - * This is an "exact match" which uses [[StateService.is]]. - * - * ### Parameter values - * If the `ui-sref`/`ui-state` includes parameter values, the current parameter values must match the link's values for the link to be highlighted. - * This allows a list of links to the same state with different parameters to be rendered, and the correct one highlighted. - * - * #### Example: - * ```html - *
  • - * {{ user.lastName }} - *
  • - * ``` - * - * ### Examples - * - * Given the following template: - * #### Example: - * ```html - * - * ``` - * - * When the app state is `app.user` (or any child state), - * and contains the state parameter "user" with value "bilbobaggins", - * the resulting HTML will appear as (note the 'active' class): - * - * ```html - * - * ``` - * - * ### Glob mode - * - * It is possible to pass `ui-sref-active` an expression that evaluates to an object. - * The objects keys represent active class names and values represent the respective state names/globs. - * `ui-sref-active` will match if the current active state **includes** any of - * the specified state names/globs, even the abstract ones. - * - * #### Example: - * Given the following template, with "admin" being an abstract state: - * ```html - *
    - * Roles - *
    - * ``` - * - * When the current state is "admin.roles" the "active" class will be applied to both the
    and elements. - * It is important to note that the state names/globs passed to `ui-sref-active` override any state provided by a linked `ui-sref`. - * - * ### Notes: - * - * - The class name is interpolated **once** during the directives link time (any further changes to the - * interpolated value are ignored). - * - * - Multiple classes may be specified in a space-separated format: `ui-sref-active='class1 class2 class3'` - */ -var uiSrefActive; -uiSrefActive = ['$state', '$stateParams', '$interpolate', '$uiRouter', - function $StateRefActiveDirective($state, $stateParams, $interpolate, $uiRouter) { - return { - restrict: "A", - controller: ['$scope', '$element', '$attrs', - function ($scope, $element, $attrs) { - var states = [], activeEqClass, uiSrefActive; - // There probably isn't much point in $observing this - // uiSrefActive and uiSrefActiveEq share the same directive object with some - // slight difference in logic routing - activeEqClass = $interpolate($attrs.uiSrefActiveEq || '', false)($scope); - try { - uiSrefActive = $scope.$eval($attrs.uiSrefActive); - } - catch (e) { - // Do nothing. uiSrefActive is not a valid expression. - // Fall back to using $interpolate below - } - uiSrefActive = uiSrefActive || $interpolate($attrs.uiSrefActive || '', false)($scope); - if (isObject(uiSrefActive)) { - forEach(uiSrefActive, function (stateOrName, activeClass) { - if (isString(stateOrName)) { - var ref = parseStateRef(stateOrName); - addState(ref.state, $scope.$eval(ref.paramExpr), activeClass); - } - }); - } - // Allow uiSref to communicate with uiSrefActive[Equals] - this.$$addStateInfo = function (newState, newParams) { - // we already got an explicit state provided by ui-sref-active, so we - // shadow the one that comes from ui-sref - if (isObject(uiSrefActive) && states.length > 0) { - return; - } - var deregister = addState(newState, newParams, uiSrefActive); - update(); - return deregister; - }; - function updateAfterTransition(trans) { - trans.promise.then(update); - } - $scope.$on('$stateChangeSuccess', update); - $scope.$on('$destroy', $uiRouter.transitionService.onStart({}, updateAfterTransition)); - if ($uiRouter.globals.transition) { - updateAfterTransition($uiRouter.globals.transition); - } - function addState(stateName, stateParams, activeClass) { - var state = $state.get(stateName, stateContext($element)); - var stateInfo = { - state: state || { name: stateName }, - params: stateParams, - activeClass: activeClass - }; - states.push(stateInfo); - return function removeState() { - removeFrom(states)(stateInfo); - }; - } - // Update route state - function update() { - var splitClasses = function (str) { - return str.split(/\s/).filter(identity); - }; - var getClasses = function (stateList) { - return stateList.map(function (x) { return x.activeClass; }).map(splitClasses).reduce(unnestR, []); - }; - var allClasses = getClasses(states).concat(splitClasses(activeEqClass)).reduce(uniqR, []); - var fuzzyClasses = getClasses(states.filter(function (x) { return $state.includes(x.state.name, x.params); })); - var exactlyMatchesAny = !!states.filter(function (x) { return $state.is(x.state.name, x.params); }).length; - var exactClasses = exactlyMatchesAny ? splitClasses(activeEqClass) : []; - var addClasses = fuzzyClasses.concat(exactClasses).reduce(uniqR, []); - var removeClasses = allClasses.filter(function (cls) { return !inArray(addClasses, cls); }); - $scope.$evalAsync(function () { - addClasses.forEach(function (className) { return $element.addClass(className); }); - removeClasses.forEach(function (className) { return $element.removeClass(className); }); - }); - } - update(); - }] - }; - }]; -ng.module('ui.router.state') - .directive('uiSref', uiSref) - .directive('uiSrefActive', uiSrefActive) - .directive('uiSrefActiveEq', uiSrefActive) - .directive('uiState', uiState); - -/** @module ng1 */ /** for typedoc */ -/** - * `isState` Filter: truthy if the current state is the parameter - * - * Translates to [[StateService.is]] `$state.is("stateName")`. - * - * #### Example: - * ```html - *
    show if state is 'stateName'
    - * ``` - */ -$IsStateFilter.$inject = ['$state']; -function $IsStateFilter($state) { - var isFilter = function (state, params, options) { - return $state.is(state, params, options); - }; - isFilter.$stateful = true; - return isFilter; -} -/** - * `includedByState` Filter: truthy if the current state includes the parameter - * - * Translates to [[StateService.includes]]` $state.is("fullOrPartialStateName")`. - * - * #### Example: - * ```html - *
    show if state includes 'fullOrPartialStateName'
    - * ``` - */ -$IncludedByStateFilter.$inject = ['$state']; -function $IncludedByStateFilter($state) { - var includesFilter = function (state, params, options) { - return $state.includes(state, params, options); - }; - includesFilter.$stateful = true; - return includesFilter; -} -ng.module('ui.router.state') - .filter('isState', $IsStateFilter) - .filter('includedByState', $IncludedByStateFilter); - -/** - * @ng1api - * @module directives - */ /** for typedoc */ -/** - * `ui-view`: A viewport directive which is filled in by a view from the active state. - * - * ### Attributes - * - * - `name`: (Optional) A view name. - * The name should be unique amongst the other views in the same state. - * You can have views of the same name that live in different states. - * The ui-view can be targeted in a View using the name ([[Ng1StateDeclaration.views]]). - * - * - `autoscroll`: an expression. When it evaluates to true, the `ui-view` will be scrolled into view when it is activated. - * Uses [[$uiViewScroll]] to do the scrolling. - * - * - `onload`: Expression to evaluate whenever the view updates. - * - * #### Example: - * A view can be unnamed or named. - * ```html - * - *
    - * - * - *
    - * - * - * - * ``` - * - * You can only have one unnamed view within any template (or root html). If you are only using a - * single view and it is unnamed then you can populate it like so: - * - * ```html - *
    - * $stateProvider.state("home", { - * template: "

    HELLO!

    " - * }) - * ``` - * - * The above is a convenient shortcut equivalent to specifying your view explicitly with the - * [[Ng1StateDeclaration.views]] config property, by name, in this case an empty name: - * - * ```js - * $stateProvider.state("home", { - * views: { - * "": { - * template: "

    HELLO!

    " - * } - * } - * }) - * ``` - * - * But typically you'll only use the views property if you name your view or have more than one view - * in the same template. There's not really a compelling reason to name a view if its the only one, - * but you could if you wanted, like so: - * - * ```html - *
    - * ``` - * - * ```js - * $stateProvider.state("home", { - * views: { - * "main": { - * template: "

    HELLO!

    " - * } - * } - * }) - * ``` - * - * Really though, you'll use views to set up multiple views: - * - * ```html - *
    - *
    - *
    - * ``` - * - * ```js - * $stateProvider.state("home", { - * views: { - * "": { - * template: "

    HELLO!

    " - * }, - * "chart": { - * template: "" - * }, - * "data": { - * template: "" - * } - * } - * }) - * ``` - * - * #### Examples for `autoscroll`: - * ```html - * - * - * - * - * - * - * - * ``` - * - * Resolve data: - * - * The resolved data from the state's `resolve` block is placed on the scope as `$resolve` (this - * can be customized using [[Ng1ViewDeclaration.resolveAs]]). This can be then accessed from the template. - * - * Note that when `controllerAs` is being used, `$resolve` is set on the controller instance *after* the - * controller is instantiated. The `$onInit()` hook can be used to perform initialization code which - * depends on `$resolve` data. - * - * #### Example: - * ```js - * $stateProvider.state('home', { - * template: '', - * resolve: { - * user: function(UserService) { return UserService.fetchUser(); } - * } - * }); - * ``` - */ -var uiView; -uiView = ['$view', '$animate', '$uiViewScroll', '$interpolate', '$q', - function $ViewDirective($view, $animate, $uiViewScroll, $interpolate, $q$$1) { - function getRenderer(attrs, scope) { - return { - enter: function (element, target, cb) { - if (ng.version.minor > 2) { - $animate.enter(element, null, target).then(cb); - } - else { - $animate.enter(element, null, target, cb); - } - }, - leave: function (element, cb) { - if (ng.version.minor > 2) { - $animate.leave(element).then(cb); - } - else { - $animate.leave(element, cb); - } - } - }; - } - function configsEqual(config1, config2) { - return config1 === config2; - } - var rootData = { - $cfg: { viewDecl: { $context: $view._pluginapi._rootViewContext() } }, - $uiView: {} - }; - var directive = { - count: 0, - restrict: 'ECA', - terminal: true, - priority: 400, - transclude: 'element', - compile: function (tElement, tAttrs, $transclude) { - return function (scope, $element, attrs) { - var previousEl, currentEl, currentScope, unregister, onloadExp = attrs['onload'] || '', autoScrollExp = attrs['autoscroll'], renderer = getRenderer(attrs, scope), viewConfig = undefined, inherited = $element.inheritedData('$uiView') || rootData, name = $interpolate(attrs['uiView'] || attrs['name'] || '')(scope) || '$default'; - var activeUIView = { - $type: 'ng1', - id: directive.count++, - name: name, - fqn: inherited.$uiView.fqn ? inherited.$uiView.fqn + "." + name : name, - config: null, - configUpdated: configUpdatedCallback, - get creationContext() { - var fromParentTagConfig = parse('$cfg.viewDecl.$context')(inherited); - // Allow - // See https://github.com/angular-ui/ui-router/issues/3355 - var fromParentTag = parse('$uiView.creationContext')(inherited); - return fromParentTagConfig || fromParentTag; - } - }; - trace.traceUIViewEvent("Linking", activeUIView); - function configUpdatedCallback(config) { - if (config && !(config instanceof Ng1ViewConfig)) - return; - if (configsEqual(viewConfig, config)) - return; - trace.traceUIViewConfigUpdated(activeUIView, config && config.viewDecl && config.viewDecl.$context); - viewConfig = config; - updateView(config); - } - $element.data('$uiView', { $uiView: activeUIView }); - updateView(); - unregister = $view.registerUIView(activeUIView); - scope.$on("$destroy", function () { - trace.traceUIViewEvent("Destroying/Unregistering", activeUIView); - unregister(); - }); - function cleanupLastView() { - if (previousEl) { - trace.traceUIViewEvent("Removing (previous) el", previousEl.data('$uiView')); - previousEl.remove(); - previousEl = null; - } - if (currentScope) { - trace.traceUIViewEvent("Destroying scope", activeUIView); - currentScope.$destroy(); - currentScope = null; - } - if (currentEl) { - var _viewData_1 = currentEl.data('$uiViewAnim'); - trace.traceUIViewEvent("Animate out", _viewData_1); - renderer.leave(currentEl, function () { - _viewData_1.$$animLeave.resolve(); - previousEl = null; - }); - previousEl = currentEl; - currentEl = null; - } - } - function updateView(config) { - var newScope = scope.$new(); - var animEnter = $q$$1.defer(), animLeave = $q$$1.defer(); - var $uiViewData = { - $cfg: config, - $uiView: activeUIView, - }; - var $uiViewAnim = { - $animEnter: animEnter.promise, - $animLeave: animLeave.promise, - $$animLeave: animLeave - }; - /** - * @ngdoc event - * @name ui.router.state.directive:ui-view#$viewContentLoading - * @eventOf ui.router.state.directive:ui-view - * @eventType emits on ui-view directive scope - * @description - * - * Fired once the view **begins loading**, *before* the DOM is rendered. - * - * @param {Object} event Event object. - * @param {string} viewName Name of the view. - */ - newScope.$emit('$viewContentLoading', name); - var cloned = $transclude(newScope, function (clone) { - clone.data('$uiViewAnim', $uiViewAnim); - clone.data('$uiView', $uiViewData); - renderer.enter(clone, $element, function onUIViewEnter() { - animEnter.resolve(); - if (currentScope) - currentScope.$emit('$viewContentAnimationEnded'); - if (isDefined(autoScrollExp) && !autoScrollExp || scope.$eval(autoScrollExp)) { - $uiViewScroll(clone); - } - }); - cleanupLastView(); - }); - currentEl = cloned; - currentScope = newScope; - /** - * @ngdoc event - * @name ui.router.state.directive:ui-view#$viewContentLoaded - * @eventOf ui.router.state.directive:ui-view - * @eventType emits on ui-view directive scope - * @description * - * Fired once the view is **loaded**, *after* the DOM is rendered. - * - * @param {Object} event Event object. - */ - currentScope.$emit('$viewContentLoaded', config || viewConfig); - currentScope.$eval(onloadExp); - } - }; - } - }; - return directive; - }]; -$ViewDirectiveFill.$inject = ['$compile', '$controller', '$transitions', '$view', '$q', '$timeout']; -/** @hidden */ -function $ViewDirectiveFill($compile, $controller, $transitions, $view, $q$$1, $timeout) { - var getControllerAs = parse('viewDecl.controllerAs'); - var getResolveAs = parse('viewDecl.resolveAs'); - return { - restrict: 'ECA', - priority: -400, - compile: function (tElement) { - var initial = tElement.html(); - tElement.empty(); - return function (scope, $element) { - var data = $element.data('$uiView'); - if (!data) { - $element.html(initial); - $compile($element.contents())(scope); - return; - } - var cfg = data.$cfg || { viewDecl: {}, getTemplate: ng_from_import.noop }; - var resolveCtx = cfg.path && new ResolveContext(cfg.path); - $element.html(cfg.getTemplate($element, resolveCtx) || initial); - trace.traceUIViewFill(data.$uiView, $element.html()); - var link = $compile($element.contents()); - var controller = cfg.controller; - var controllerAs = getControllerAs(cfg); - var resolveAs = getResolveAs(cfg); - var locals = resolveCtx && getLocals(resolveCtx); - scope[resolveAs] = locals; - if (controller) { - var controllerInstance = $controller(controller, extend({}, locals, { $scope: scope, $element: $element })); - if (controllerAs) { - scope[controllerAs] = controllerInstance; - scope[controllerAs][resolveAs] = locals; - } - // TODO: Use $view service as a central point for registering component-level hooks - // Then, when a component is created, tell the $view service, so it can invoke hooks - // $view.componentLoaded(controllerInstance, { $scope: scope, $element: $element }); - // scope.$on('$destroy', () => $view.componentUnloaded(controllerInstance, { $scope: scope, $element: $element })); - $element.data('$ngControllerController', controllerInstance); - $element.children().data('$ngControllerController', controllerInstance); - registerControllerCallbacks($q$$1, $transitions, controllerInstance, scope, cfg); - } - // Wait for the component to appear in the DOM - if (isString(cfg.viewDecl.component)) { - var cmp_1 = cfg.viewDecl.component; - var kebobName = kebobString(cmp_1); - var tagRegexp_1 = new RegExp("^(x-|data-)?" + kebobName + "$", "i"); - var getComponentController = function () { - var directiveEl = [].slice.call($element[0].children) - .filter(function (el) { return el && el.tagName && tagRegexp_1.exec(el.tagName); }); - return directiveEl && ng.element(directiveEl).data("$" + cmp_1 + "Controller"); - }; - var deregisterWatch_1 = scope.$watch(getComponentController, function (ctrlInstance) { - if (!ctrlInstance) - return; - registerControllerCallbacks($q$$1, $transitions, ctrlInstance, scope, cfg); - deregisterWatch_1(); - }); - } - link(scope); - }; - } - }; -} -/** @hidden */ -var hasComponentImpl = typeof ng.module('ui.router')['component'] === 'function'; -/** @hidden incrementing id */ -var _uiCanExitId = 0; -/** @hidden TODO: move these callbacks to $view and/or `/hooks/components.ts` or something */ -function registerControllerCallbacks($q$$1, $transitions, controllerInstance, $scope, cfg) { - // Call $onInit() ASAP - if (isFunction(controllerInstance.$onInit) && !(cfg.viewDecl.component && hasComponentImpl)) { - controllerInstance.$onInit(); - } - var viewState = tail(cfg.path).state.self; - var hookOptions = { bind: controllerInstance }; - // Add component-level hook for onParamsChange - if (isFunction(controllerInstance.uiOnParamsChanged)) { - var resolveContext = new ResolveContext(cfg.path); - var viewCreationTrans_1 = resolveContext.getResolvable('$transition$').data; - // Fire callback on any successful transition - var paramsUpdated = function ($transition$) { - // Exit early if the $transition$ is the same as the view was created within. - // Exit early if the $transition$ will exit the state the view is for. - if ($transition$ === viewCreationTrans_1 || $transition$.exiting().indexOf(viewState) !== -1) - return; - var toParams = $transition$.params("to"); - var fromParams = $transition$.params("from"); - var toSchema = $transition$.treeChanges().to.map(function (node) { return node.paramSchema; }).reduce(unnestR, []); - var fromSchema = $transition$.treeChanges().from.map(function (node) { return node.paramSchema; }).reduce(unnestR, []); - // Find the to params that have different values than the from params - var changedToParams = toSchema.filter(function (param) { - var idx = fromSchema.indexOf(param); - return idx === -1 || !fromSchema[idx].type.equals(toParams[param.id], fromParams[param.id]); - }); - // Only trigger callback if a to param has changed or is new - if (changedToParams.length) { - var changedKeys_1 = changedToParams.map(function (x) { return x.id; }); - // Filter the params to only changed/new to params. `$transition$.params()` may be used to get all params. - var newValues = filter(toParams, function (val$$1, key) { return changedKeys_1.indexOf(key) !== -1; }); - controllerInstance.uiOnParamsChanged(newValues, $transition$); - } - }; - $scope.$on('$destroy', $transitions.onSuccess({}, paramsUpdated, hookOptions)); - } - // Add component-level hook for uiCanExit - if (isFunction(controllerInstance.uiCanExit)) { - var id_1 = _uiCanExitId++; - var cacheProp_1 = '_uiCanExitIds'; - // Returns true if a redirect transition already answered truthy - var prevTruthyAnswer_1 = function (trans) { - return !!trans && (trans[cacheProp_1] && trans[cacheProp_1][id_1] === true || prevTruthyAnswer_1(trans.redirectedFrom())); - }; - // If a user answered yes, but the transition was later redirected, don't also ask for the new redirect transition - var wrappedHook = function (trans) { - var promise, ids = trans[cacheProp_1] = trans[cacheProp_1] || {}; - if (!prevTruthyAnswer_1(trans)) { - promise = $q$$1.when(controllerInstance.uiCanExit(trans)); - promise.then(function (val$$1) { return ids[id_1] = (val$$1 !== false); }); - } - return promise; - }; - var criteria = { exiting: viewState.name }; - $scope.$on('$destroy', $transitions.onBefore(criteria, wrappedHook, hookOptions)); - } -} -ng.module('ui.router.state').directive('uiView', uiView); -ng.module('ui.router.state').directive('uiView', $ViewDirectiveFill); - -/** @module ng1 */ /** */ -/** @hidden */ -function $ViewScrollProvider() { - var useAnchorScroll = false; - this.useAnchorScroll = function () { - useAnchorScroll = true; - }; - this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) { - if (useAnchorScroll) { - return $anchorScroll; - } - return function ($element) { - return $timeout(function () { - $element[0].scrollIntoView(); - }, 0, false); - }; - }]; -} -ng.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider); - -/** - * Main entry point for angular 1.x build - * @module ng1 - */ /** */ -var index = "ui.router"; - -exports.core = index$1; -exports['default'] = index; -exports.fromJson = fromJson; -exports.toJson = toJson; -exports.copy = copy; -exports.forEach = forEach; -exports.extend = extend; -exports.equals = equals; -exports.identity = identity; -exports.noop = noop$1; -exports.createProxyFunctions = createProxyFunctions; -exports.inherit = inherit; -exports.inArray = inArray; -exports._inArray = _inArray; -exports.removeFrom = removeFrom; -exports._removeFrom = _removeFrom; -exports.pushTo = pushTo; -exports._pushTo = _pushTo; -exports.deregAll = deregAll; -exports.defaults = defaults; -exports.mergeR = mergeR; -exports.ancestors = ancestors; -exports.pick = pick; -exports.omit = omit; -exports.pluck = pluck; -exports.filter = filter; -exports.find = find; -exports.mapObj = mapObj; -exports.map = map; -exports.values = values; -exports.allTrueR = allTrueR; -exports.anyTrueR = anyTrueR; -exports.unnestR = unnestR; -exports.flattenR = flattenR; -exports.pushR = pushR; -exports.uniqR = uniqR; -exports.unnest = unnest; -exports.flatten = flatten; -exports.assertPredicate = assertPredicate; -exports.assertMap = assertMap; -exports.assertFn = assertFn; -exports.pairs = pairs; -exports.arrayTuples = arrayTuples; -exports.applyPairs = applyPairs; -exports.tail = tail; -exports._extend = _extend; -exports.sortBy = sortBy; -exports.composeSort = composeSort; -exports.silenceUncaughtInPromise = silenceUncaughtInPromise; -exports.silentRejection = silentRejection; -exports.notImplemented = notImplemented; -exports.services = services; -exports.Glob = Glob; -exports.curry = curry; -exports.compose = compose; -exports.pipe = pipe; -exports.prop = prop; -exports.propEq = propEq; -exports.parse = parse; -exports.not = not; -exports.and = and; -exports.or = or; -exports.all = all; -exports.any = any; -exports.is = is; -exports.eq = eq; -exports.val = val; -exports.invoke = invoke; -exports.pattern = pattern; -exports.isUndefined = isUndefined; -exports.isDefined = isDefined; -exports.isNull = isNull; -exports.isNullOrUndefined = isNullOrUndefined; -exports.isFunction = isFunction; -exports.isNumber = isNumber; -exports.isString = isString; -exports.isObject = isObject; -exports.isArray = isArray; -exports.isDate = isDate; -exports.isRegExp = isRegExp; -exports.isState = isState; -exports.isInjectable = isInjectable; -exports.isPromise = isPromise; -exports.Queue = Queue; -exports.maxLength = maxLength; -exports.padString = padString; -exports.kebobString = kebobString; -exports.functionToString = functionToString; -exports.fnToString = fnToString; -exports.stringify = stringify; -exports.beforeAfterSubstr = beforeAfterSubstr; -exports.splitOnDelim = splitOnDelim; -exports.joinNeighborsR = joinNeighborsR; -exports.Trace = Trace; -exports.trace = trace; -exports.Param = Param; -exports.ParamTypes = ParamTypes; -exports.StateParams = StateParams; -exports.ParamType = ParamType; -exports.PathNode = PathNode; -exports.PathUtils = PathUtils; -exports.resolvePolicies = resolvePolicies; -exports.defaultResolvePolicy = defaultResolvePolicy; -exports.Resolvable = Resolvable; -exports.NATIVE_INJECTOR_TOKEN = NATIVE_INJECTOR_TOKEN; -exports.ResolveContext = ResolveContext; -exports.resolvablesBuilder = resolvablesBuilder; -exports.StateBuilder = StateBuilder; -exports.StateObject = StateObject; -exports.StateMatcher = StateMatcher; -exports.StateQueueManager = StateQueueManager; -exports.StateRegistry = StateRegistry; -exports.StateService = StateService; -exports.TargetState = TargetState; -exports.HookBuilder = HookBuilder; -exports.matchState = matchState; -exports.RegisteredHook = RegisteredHook; -exports.makeEvent = makeEvent; -exports.Rejection = Rejection; -exports.Transition = Transition; -exports.TransitionHook = TransitionHook; -exports.TransitionEventType = TransitionEventType; -exports.defaultTransOpts = defaultTransOpts; -exports.TransitionService = TransitionService; -exports.UrlMatcher = UrlMatcher; -exports.UrlMatcherFactory = UrlMatcherFactory; -exports.UrlRouter = UrlRouter; -exports.UrlRuleFactory = UrlRuleFactory; -exports.BaseUrlRule = BaseUrlRule; -exports.UrlService = UrlService; -exports.ViewService = ViewService; -exports.UIRouterGlobals = UIRouterGlobals; -exports.UIRouter = UIRouter; -exports.$q = $q; -exports.$injector = $injector; -exports.BaseLocationServices = BaseLocationServices; -exports.HashLocationService = HashLocationService; -exports.MemoryLocationService = MemoryLocationService; -exports.PushStateLocationService = PushStateLocationService; -exports.MemoryLocationConfig = MemoryLocationConfig; -exports.BrowserLocationConfig = BrowserLocationConfig; -exports.splitHash = splitHash; -exports.splitQuery = splitQuery; -exports.splitEqual = splitEqual; -exports.trimHashVal = trimHashVal; -exports.keyValsToObjectR = keyValsToObjectR; -exports.getParams = getParams; -exports.parseUrl = parseUrl$1; -exports.buildUrl = buildUrl; -exports.locationPluginFactory = locationPluginFactory; -exports.servicesPlugin = servicesPlugin; -exports.hashLocationPlugin = hashLocationPlugin; -exports.pushStateLocationPlugin = pushStateLocationPlugin; -exports.memoryLocationPlugin = memoryLocationPlugin; -exports.UIRouterPluginBase = UIRouterPluginBase; -exports.watchDigests = watchDigests; -exports.getLocals = getLocals; -exports.getNg1ViewConfigFactory = getNg1ViewConfigFactory; -exports.ng1ViewsBuilder = ng1ViewsBuilder; -exports.Ng1ViewConfig = Ng1ViewConfig; -exports.StateProvider = StateProvider; -exports.UrlRouterProvider = UrlRouterProvider; - -Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=angular-ui-router.js.map diff --git a/stackle_app/app/vendor/auth0-angular.js b/stackle_app/app/vendor/auth0-angular.js deleted file mode 100644 index 761005e..0000000 --- a/stackle_app/app/vendor/auth0-angular.js +++ /dev/null @@ -1,889 +0,0 @@ -/** - * Angular SDK to use with Auth0 - * @version v4.2.7 - 2016-10-31 - * @link https://auth0.com - * @author Martin Gontovnikas - * @license MIT License, http://www.opensource.org/licenses/MIT - */ - - angular.module('auth0', ['auth0.service', 'auth0.utils', 'auth0.directives']) - .run(['auth', function(auth) { - auth.hookEvents(); - }]); - - -/* -* -* Utility service to assist with: - * 1. Capitalization - * 2. Retrieve function name - * 3. Angular's $rootScope.$apply - * 4. Creates an 'applied' callback - * 5. Convert callbacks to promises - * - * */ - - angular.module('auth0.utils', []) - .provider('authUtils', function() { - var Utils = { - /* - * - * DESCRIPTION: Capitalize strings - * INPUT: string - * OUTPUT: string - * - * */ - capitalize: function(string) { - return string ? string.charAt(0).toUpperCase() + string.substring(1).toLowerCase() : null; - }, - - /* - * - * DESCRIPTION: Retrieve the name of a supplied function - * INPUT: function - * OUTPUT: string - * - * */ - fnName : function(fun) { - var ret = fun.toString(); - ret = ret.substr('function '.length); - ret = ret.substr(0, ret.indexOf('(')); - return ret ? ret.trim() : ret; - } - }; - - angular.extend(this, Utils); - - this.$get = ['$rootScope', '$q', function($rootScope, $q) { - var authUtils = {}; - angular.extend(authUtils, Utils); - - /* - * - * DESCRIPTION: Checks if Angular is in the $apply or $digest phase - * before calling $rootScope.$apply on a fn passed to it - * - * INPUT: function - * - * */ - - authUtils.safeApply = function(fn) { - var phase = $rootScope.$root.$$phase; - if(phase === '$apply' || phase === '$digest') { - if(fn && (typeof(fn) === 'function')) { - fn(); - } - } else { - $rootScope.$apply(fn); - } - }; - - /* - * - * DESCRIPTION: Creates an 'applied callback using Angular's $apply() - * INPUT: function - * OUTPUT: function - * - * */ - - authUtils.callbackify = function (nodeback, success, error, self) { - if (angular.isFunction(nodeback)) { - return function (args) { - args = Array.prototype.slice.call(arguments); - var callback = function (err, response, etc) { - if (err) { - error && error(err); - return; - } - // if more arguments then turn into an array for .spread() - etc = Array.prototype.slice.call(arguments, 1); - success && success.apply(null, etc); - }; - if (success || error) { - args.push( (!success) ? authUtils.errorHandler(callback) : authUtils.applied(callback) ); - } - nodeback.apply(self, args); - }; - } - }; - - /* - * - * DESCRIPTION: Creates a promise from where a callback is expected - * INPUT: function - * OUTPUT: function - * - * */ - - authUtils.promisify = function (nodeback, self) { - if (angular.isFunction(nodeback)) { - return function (args) { - args = Array.prototype.slice.call(arguments); - var dfd = $q.defer(); - var callback = function (err, response, etc) { - if (err) { - dfd.reject(err); - return; - } - // if more arguments then turn into an array for .spread() - etc = Array.prototype.slice.call(arguments, 1); - dfd.resolve(etc.length > 1 ? etc : response); - }; - - args.push(authUtils.applied(callback)); - nodeback.apply(self, args); - // spread polyfill only for promisify - dfd.promise.spread = dfd.promise.spread || function (fulfilled, rejected) { - return dfd.promise.then(function (array) { - return Array.isArray(array) ? fulfilled.apply(null, array) : fulfilled(array); - }, rejected); - }; - return dfd.promise; - }; - } - }; - - /* - * - * DESCRIPTION: Uses safeApply() on a callback after passing in the callback arguments - * INPUT: function - * OUTPUT: function - * - * */ - - authUtils.applied = function(fn) { - // Adding arguments just due to a bug in Auth0.js. - return function (err, response) { - // Using variables so that they don't get deleted by UglifyJS - err = err; - response = response; - var argsCall = arguments; - authUtils.safeApply(function() { - fn.apply(null, argsCall); - }); - }; - }; - - /* - * - * DESCRIPTION: Uses safeApply() on a callback after passing in the callback arguments - * INPUT: function - * OUTPUT: function - * - * */ - - authUtils.errorHandler = function(fn) { - return function () { - var args = Array.prototype.slice.call(arguments); - if (args[0] !== null) { - authUtils.safeApply(function () { - fn.apply(null, args); - }); - } - }; - }; - - - return authUtils; - }]; - - - - }); - - - angular.module('auth0.service', ['auth0.utils']) - .provider('auth', ['authUtilsProvider', function(authUtilsProvider) { - var defaultOptions = { - callbackOnLocationHash: true - }; - var config = this; - - var innerAuth0libraryConfiguration = { - 'Auth0': { - signin: 'login', - signinOnly: 'signinOnly', - signup: 'signup', - reset: 'changePassword', - validateUser: 'validateUser', - library: function() { - return config.auth0js; - }, - parseOptions: function(options) { - var retOptions = angular.copy(options); - if (retOptions.authParams) { - angular.extend(retOptions, retOptions.authParams); - delete retOptions.authParams; - } - return retOptions; - } - }, - 'Auth0Lock': { - signin: 'show', - signinOnly: 'showSignin', - signup: 'showSignup', - reset: 'showReset', - library: function() { - return config.auth0lib; - }, - parseOptions: function(options) { - return angular.copy(options); - } - } - }; - - /* - * - * DESCRIPTION: Get a method from the libraries - * - * INPUT: method name (string), library name (string) - * OUTPUT: String - * - * */ - - function getInnerLibraryMethod(name, libName) { - libName = libName || config.lib; - var library = innerAuth0libraryConfiguration[libName].library(); - return library[innerAuth0libraryConfiguration[libName][name]]; - } - - /* - * - * DESCRIPTION: Get a config from the libraries - * - * INPUT: config name (string), library name (string) - * OUTPUT: String - * - * */ - function getInnerLibraryConfigField(name, libName) { - libName = libName || config.lib; - return innerAuth0libraryConfiguration[libName][name]; - } - - /* - * - * DESCRIPTION: Returns a constructor: Defaults to a function if provided. - * Defaults to a Lock if library is included and function is not provided - * - * INPUT: function - * OUTPUT: object - * - * */ - function constructorName(fun) { - if (fun) { - return { - lib: authUtilsProvider.fnName(fun), - constructor: fun - }; - } - - /* jshint ignore:start */ - if (null != window.Auth0Lock) { - return { - lib: 'Auth0Lock', - constructor: window.Auth0Lock - }; - } - - if (null != window.Auth0) { - return { - lib: 'Auth0', - constructor: window.Auth0 - }; - } - - if (typeof Auth0Widget !== 'undefined') { - throw new Error('Auth0Widget is not supported with this version of auth0-angular' + - 'anymore. Please try with an older one'); - } - - throw new Error('Cannot initialize Auth0Angular. Auth0Lock or Auth0 must be available'); - /* jshint ignore:end */ - } - - /* - * - * DESCRIPTION: Configures provider with provided options - * - * INPUT: option (object) and constructor - * - * */ - this.init = function(options, Auth0Constructor) { - if (!options) { - throw new Error('You must set options when calling init'); - } - this.loginUrl = options.loginUrl; - this.loginUrlParams = options.loginUrlParams; - this.loginState = options.loginState; - this.loginStateParams = options.loginStateParams; - this.clientID = options.clientID || options.clientId; - var domain = options.domain; - this.domain = domain; - this.sso = options.sso; - - var constructorInfo = constructorName(Auth0Constructor); - this.lib = constructorInfo.lib; - if (constructorInfo.lib === 'Auth0Lock') { - this.auth0lib = new constructorInfo.constructor(this.clientID, domain, angular.extend(defaultOptions, options)); - this.auth0js = this.auth0lib.getClient(); - this.isLock = true; - } else { - this.auth0lib = new constructorInfo.constructor(angular.extend(defaultOptions, options)); - this.auth0js = this.auth0lib; - this.isLock = false; - } - - this.initialized = true; - }; - - - this.eventHandlers = {}; - - this.on = function(anEvent, handler) { - if (!this.eventHandlers[anEvent]) { - this.eventHandlers[anEvent] = []; - } - this.eventHandlers[anEvent].push(handler); - }; - - var events = ['loginSuccess', 'loginFailure', 'logout', 'forbidden', 'authenticated']; - angular.forEach(events, function(anEvent) { - config['add' + authUtilsProvider.capitalize(anEvent) + 'Handler'] = function(handler) { - config.on(anEvent, handler); - }; - }); - - this.$get = ['$rootScope', '$q', '$injector', '$window', '$location', 'authUtils', '$http', - function($rootScope, $q, $injector, $window, $location, authUtils, $http) { - var auth = { - isAuthenticated: false - }; - - $rootScope.isAuthenticated = false; - - var getHandlers = function(anEvent) { - return config.eventHandlers[anEvent]; - }; - - var callHandler = function(anEvent, locals) { - $rootScope.$broadcast('auth0.' + anEvent, locals); - angular.forEach(getHandlers(anEvent) || [], function(handler) { - $injector.invoke(handler, auth, locals); - }); - }; - - - // SignIn - - var onSigninOk = function(idToken, accessToken, state, refreshToken, profile, isRefresh) { - - idToken = idToken || (profile ? profile.idToken : null); - accessToken = accessToken || (profile ? profile.accessToken : null); - state = state || (profile ? profile.state : null); - refreshToken = refreshToken || (profile ? profile.refreshToken : null); - - var profilePromise = auth.getProfile(idToken); - - var response = { - idToken: idToken, - accessToken: accessToken, - state: state, - refreshToken: refreshToken, - profile: profile, - isAuthenticated: true - }; - - $rootScope.isAuthenticated = true; - - angular.extend(auth, response); - callHandler(!isRefresh ? 'loginSuccess' : 'authenticated', angular.extend({ - profilePromise: profilePromise - }, response)); - - return profilePromise; - }; - - function forbidden() { - if (config.loginUrl) { - $location.path(config.loginUrl, config.loginUrlParams); - } else if (config.loginState) { - $injector.get('$state').go(config.loginState, config.loginStateParams); - } else { - callHandler('forbidden'); - } - } - - // Redirect mode - $rootScope.$on('$locationChangeStart', function() { - if (!config.initialized) { - return; - } - - var hashResult = config.auth0lib.parseHash($window.location.hash); - if (!auth.isAuthenticated) { - if (hashResult && (hashResult.idToken || hashResult.id_token)) { - onSigninOk(hashResult.idToken || hashResult.id_token, hashResult.accessToken || hashResult.access_token, hashResult.state, hashResult.refreshToken || hashResult.refresh_token); - return; - } - } - }); - - $rootScope.$on('auth0.forbiddenRequest', function() { - forbidden(); - }); - - if (config.loginUrl) { - $rootScope.$on('$routeChangeStart', function(e, nextRoute) { - if (!config.initialized) { - return; - } - - verifyRoute( - (nextRoute.$$route && nextRoute.$$route.requiresLogin), - e, - function(){ - return JSON.stringify({ - redirect_to: { - path: $location.path() - } - }); - }, - function(){ - $location.path(config.loginUrl, config.loginUrlParams); - } - ); - }); - } - - - if (config.loginState) { - $rootScope.$on('$stateChangeStart', function(e, to, toParams) { - if (!config.initialized) { - return; - } - - - verifyRoute( - (to.data && to.data.requiresLogin), - e, - function() { - return JSON.stringify({ - redirect_to: { - state: to.name, - params: toParams - } - }); - }, - function() { - $injector.get('$state').go(config.loginState, config.loginStateParams); - } - ); - }); - } - - /*jshint latedef: nofunc */ - - function verifyRoute(requiresLogin, e, getState, redirectToLogin) { - if (!auth.isAuthenticated && !auth.refreshTokenPromise) { - if (config.sso) { - if (requiresLogin) {e.preventDefault();} - config.auth0js.getSSOData(authUtils.applied(function(err, ssoData) { - if (ssoData.sso) { - var loginOptions = { - popup: false, - callbackOnLocationHash: true, - connection: ssoData.lastUsedConnection.name, - authParams: { - state: getState() - } - }; - callHandler('ssoLogin', { loginOptions: loginOptions }); - auth.signin(loginOptions, null, null, 'Auth0'); - } else if (requiresLogin) { - e.preventDefault(); - redirectToLogin(); - } - })); - } else if (requiresLogin) { - e.preventDefault(); - redirectToLogin(); - } - } - } - - // Start auth service - - auth.config = config; - - var checkHandlers = function(options, successCallback) { - var successHandlers = getHandlers('loginSuccess'); - if (!successCallback && !options.username && !options.email && (!successHandlers || successHandlers.length === 0)) { - throw new Error('You must define a loginSuccess handler ' + - 'if not using popup mode or not doing ro call because that means you are doing a redirect'); - } - }; - - var linkAccount = function(primaryJWT, secondaryJWT, profile){ - var user_id = profile.user_id; - return $http( - { - method: 'POST', - url: 'https://' + config.domain + '/api/v2/users/' + user_id + '/identities', - headers: { - Authorization: 'Bearer ' + primaryJWT - }, - data:{ - link_with: secondaryJWT - } - } - ); - }; - - var unLinkAccount = function(primaryJWT, user_id, secondaryProvider, secondaryUserId){ - return $http( - { - method: 'DELETE', - url: 'https://' + config.domain + '/api/v2/users/' + user_id + '/identities/' + secondaryProvider + '/' + secondaryUserId, - headers: { - Authorization: 'Bearer ' + primaryJWT - } - } - ); - }; - - auth.hookEvents = function() { - // Does nothing. Hook events on application's run - }; - - auth.init = angular.bind(config, config.init); - - - /* - * - * DESCRIPTION: Fetch a delegation token - * INPUT: Config object - * OUTPUT: Promise - * - * */ - auth.getToken = function(options) { - options = options || { scope: 'openid' }; - - if (!options.id_token && !options.refresh_token) { - options.id_token = auth.idToken; - } - - var getDelegationTokenAsync = authUtils.promisify(config.auth0js.getDelegationToken, config.auth0js); - - return getDelegationTokenAsync(options); - }; - - /* - * - * DESCRIPTION: Refresh Token - * INPUT: token (string) - * OUTPUT: Promise - * - * */ - auth.refreshIdToken = function(refresh_token) { - var refreshTokenAsync = authUtils.promisify(config.auth0js.refreshToken, config.auth0js); - - auth.refreshTokenPromise = refreshTokenAsync(refresh_token || auth.refreshToken).then(function (delegationResult) { - return delegationResult.id_token; - })['finally'](function() { - auth.refreshTokenPromise = null; - }); - - return auth.refreshTokenPromise; - }; - - /* - * - * DESCRIPTION: Renew user's token - * INPUT: token (string) - * OUTPUT: Promise - * - * */ - auth.renewIdToken = function(id_token) { - var renewIdTokenAsync = authUtils.promisify(config.auth0js.renewIdToken, config.auth0js); - - return renewIdTokenAsync(id_token || auth.idToken).then(function (delegationResult) { - return delegationResult.id_token; - }); - }; - - /* - * - * DESCRIPTION: Sign a user in - * INPUT: config options, success callback fxn, err callback fxn, library name - * The Library name is either 'Auth0' or 'Auth0Lock' - * - * */ - auth.signin = function(options, successCallback, errorCallback, libName) { - options = options || {}; - checkHandlers(options, successCallback, errorCallback); - options = getInnerLibraryConfigField('parseOptions', libName)(options); - - var signinMethod = getInnerLibraryMethod('signin', libName); - var successFn = !successCallback ? null : function(profile, idToken, accessToken, state, refreshToken) { - - idToken = idToken || profile.idToken; - accessToken = accessToken || profile.accessToken; - state = state || profile.state; - refreshToken = refreshToken || profile.refreshToken; - - if (!idToken && !angular.isUndefined(options.loginAfterSignup) && !options.loginAfterSignup) { - successCallback(); - } else { - onSigninOk(idToken, accessToken, state, refreshToken, profile).then(function(profile) { - if (successCallback) { - successCallback(profile, idToken, accessToken, state, refreshToken); - } - }); - } - }; - - var errorFn = (!errorCallback && !getHandlers('loginFailure')) ? null : function(err) { - callHandler('loginFailure', { error: err }); - if (errorCallback) { - errorCallback(err); - } - }; - - var signinCall = authUtils.callbackify(signinMethod, successFn, errorFn , innerAuth0libraryConfiguration[libName || config.lib].library()); - - signinCall(options); - }; - - auth.signinOnly = function(options, successCallback, errorCallback, libName) { - options = options || {}; - checkHandlers(options, successCallback, errorCallback); - options = getInnerLibraryConfigField('parseOptions', libName)(options); - - var signinMethod = getInnerLibraryMethod('signinOnly', libName); - var successFn = !successCallback ? null : function(profile, idToken, accessToken, state, refreshToken) { - if (!idToken && !angular.isUndefined(options.loginAfterSignup) && !options.loginAfterSignup) { - successCallback(); - } else { - onSigninOk(idToken, accessToken, state, refreshToken, profile).then(function(profile) { - if (successCallback) { - successCallback(profile, idToken, accessToken, state, refreshToken); - } - }); - } - }; - - var errorFn = (!errorCallback && !getHandlers('loginFailure')) ? null : function(err) { - callHandler('loginFailure', { error: err }); - if (errorCallback) { - errorCallback(err); - } - }; - - var signinCall = authUtils.callbackify(signinMethod, successFn, errorFn , innerAuth0libraryConfiguration[libName || config.lib].library()); - - signinCall(options); - }; - - /* - * - * DESCRIPTION: Sign's up a user - * INPUT: config options, success callback fxn, err callback fxn - * - * */ - - auth.signup = function(options, successCallback, errorCallback) { - options = options || {}; - checkHandlers(options, successCallback, errorCallback); - options = getInnerLibraryConfigField('parseOptions')(options); - - var successFn = !successCallback ? null : function(profile, idToken, accessToken, state, refreshToken) { - if (!angular.isUndefined(options.auto_login) && !options.auto_login) { - successCallback(); - } else { - onSigninOk(idToken, accessToken, state, refreshToken, profile).then(function(profile) { - if (successCallback) { - successCallback(profile, idToken, accessToken, state, refreshToken); - } - }); - } - }; - - var errorFn = (!errorCallback && !getHandlers('loginFailure')) ? null : function(err) { - callHandler('loginFailure', { error: err }); - if (errorCallback) { - errorCallback(err); - } - }; - - var auth0lib = config.auth0lib; - var signupCall = authUtils.callbackify(getInnerLibraryMethod('signup'),successFn , errorFn, auth0lib); - - signupCall(options); - }; - - /* - * - * DESCRIPTION: Link multiple accounts (e.g: FB, Twitter, Google) - * - * INPUT: primaryJWT (string): Initial JWT assigned to User, - * primaryProfile (object): Primary account user profile, - * options (object): Auth options - * Success Callback fxn, Err Callback fxn and Library Name - * - * */ - auth.linkAccount = function (primaryJWT, primaryProfile, options, successCallback, errorCallback, libName) { - var defaultConfig = {popup: true}; - if (!primaryJWT || !primaryProfile){ - throw new Error('Available token and profile is needed to link to another'); - } - - if(!options.connection){ - throw new Error('Connection type (eg: facebook, github) is required to link account'); - } - - options = options || {}; - - checkHandlers(options, successCallback, errorCallback); - angular.extend(options, defaultConfig); - options = getInnerLibraryConfigField('parseOptions', libName)(options); - - var signinMethod = getInnerLibraryMethod('signin', libName); - - var successFn = function(profile, idToken) { - linkAccount(primaryJWT, idToken, primaryProfile).then(function(response){ - - successCallback(response); - - }, function(err) { - errorCallback(err); - }); - }; - - var errorFn = (!errorCallback && !getHandlers('loginFailure')) ? null : function(err) { - if (errorCallback) { - errorCallback(err); - } - }; - - - var linkAccountCall = authUtils.callbackify(signinMethod, successFn, errorFn , innerAuth0libraryConfiguration[libName || config.lib].library()); - - linkAccountCall(options); - - }; - - /* - * - * DESCRIPTION: Unlink linked accounts - * - * INPUT: primaryJWT (string): Initial JWT assigned to User, - * user_id (string): Primary account user id, - * secondaryProvider (string): Provider of account to unlink (eg: Facebook), - * secondaryUserId: Secondary account user id - * - * OUTPUT: Promise - * - * */ - auth.unLinkAccount = function (primaryJWT, user_id, secondaryProvider, secondaryUserId) { - if (!primaryJWT || !user_id || !secondaryProvider || !secondaryUserId){ - throw new Error('All the arguments are required to unlink. Please refer to documentation for the arguments'); - } - - return unLinkAccount(primaryJWT, user_id, secondaryProvider, secondaryUserId); - - }; - - /* - * - * DESCRIPTION: Performs forgot your password flow - * - * INPUT: config options (object), Callbacks - * - * - * */ - - auth.reset = function(options, successCallback, errorCallback) { - options = options || {}; - - options = getInnerLibraryConfigField('parseOptions')(options); - var auth0lib = config.auth0lib; - var resetCall = authUtils.callbackify(getInnerLibraryMethod('reset'), successCallback, errorCallback, auth0lib); - - resetCall(options); - }; - - auth.validateUser = function(options, successCallback, errorCallback) { - options = options || {}; - - options = getInnerLibraryConfigField('parseOptions')(options); - var auth0lib = config.auth0lib; - var validateUserCall = authUtils.callbackify(getInnerLibraryMethod('validateUser'), successCallback, errorCallback, auth0lib); - - validateUserCall(options); - }; - - /* - * - * DESCRIPTION: Sign user out - * - * - * */ - auth.signout = function() { - auth.isAuthenticated = false; - auth.profile = null; - auth.profilePromise = null; - auth.idToken = null; - auth.state = null; - auth.accessToken = null; - auth.tokenPayload = null; - $rootScope.isAuthenticated = false; - callHandler('logout'); - }; - - auth.authenticate = function(profile, idToken, accessToken, state, refreshToken) { - return onSigninOk(idToken, accessToken, state, refreshToken, profile, true); - }; - - /* - * - * DESCRIPTION: Fetch user profile - * - * INPUT: token (string) - * OUTPUT: Promise - * - * */ - auth.getProfile = function(idToken) { - var getProfilePromisify = authUtils.promisify(config.auth0lib.getProfile, config.auth0lib); - auth.profilePromise = getProfilePromisify(idToken || auth.idToken); - return auth.profilePromise.then(function(profile) { - auth.profile = profile; - return profile; - }); - }; - - auth.hide = function(callback) { - config.auth0lib.hide(callback); - }; - - return auth; - }]; - }]); - - -angular.module('auth0.directives', ['auth0.service']); - -angular.module('auth0.directives') - .directive('ifUser', ['$rootScope', function($rootScope){ - return { - link: function(scope, element){ - $rootScope.$watch('isAuthenticated',function(isAuth){ - if(isAuth){ - element.removeClass('ng-hide'); - }else{ - element.addClass('ng-hide'); - } - }); - } - }; - }]); - diff --git a/stackle_app/app/vendor/auth0.js b/stackle_app/app/vendor/auth0.js deleted file mode 100644 index 9a00f60..0000000 --- a/stackle_app/app/vendor/auth0.js +++ /dev/null @@ -1,5630 +0,0 @@ -;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 11 - else if (ua.indexOf('Trident') > -1) { - re = new RegExp('rv:([0-9]{2,2}[\.0-9]{0,})'); - if (re.exec(ua) !== null) { - rv = parseFloat(RegExp.$1); - } - } - - return rv; -} - -/** - * Stringify popup options object into - * `window.open` string options format - * - * @param {Object} popupOptions - * @private - */ - -function stringifyPopupSettings(popupOptions) { - var settings = ''; - - for (var key in popupOptions) { - settings += key + '=' + popupOptions[key] + ','; - } - - return settings.slice(0, -1); -} - - -/** - * Check that a key has been set to something different than null - * or undefined. - * - * @param {Object} obj - * @param {String} key - */ -function checkIfSet(obj, key) { - /* - * false != null -> true - * true != null -> true - * undefined != null -> false - * null != null -> false - */ - return !!(obj && obj[key] != null); -} - -function handleRequestError(err, callback) { - var status = err.status; - var responseText = 'string' === typeof err.responseText ? err.responseText : err; - - var isAffectedIEVersion = isInternetExplorer() === 10 || isInternetExplorer() === 11; - var zeroStatus = (!status || status === 0); - - var onLine = !!window.navigator.onLine; - - // Request failed because we are offline. - if (zeroStatus && !onLine ) { - status = 0; - responseText = { - code: 'offline' - }; - // http://stackoverflow.com/questions/23229723/ie-10-11-cors-status-0 - // XXX IE10 when a request fails in CORS returns status code 0 - // See: http://caniuse.com/#search=navigator.onLine - } else if (zeroStatus && isAffectedIEVersion) { - status = 401; - responseText = { - code: 'invalid_user_password' - }; - // If not IE10/11 and not offline it means that Auth0 host is unreachable: - // Connection Timeout or Connection Refused. - } else if (zeroStatus) { - status = 0; - responseText = { - code: 'connection_refused_timeout' - }; - } - - var error = new LoginError(status, responseText); - callback(error); -} - -/** - * join url from protocol - */ - -function joinUrl(protocol, domain, endpoint) { - return protocol + '//' + domain + endpoint; -} - -/** - * Create an `Auth0` instance with `options` - * - * @class Auth0 - * @constructor - */ -function Auth0 (options) { - // XXX Deprecated: We prefer new Auth0(...) - if (!(this instanceof Auth0)) { - return new Auth0(options); - } - - assert_required(options, 'clientID'); - assert_required(options, 'domain'); - - this._useJSONP = null != options.forceJSONP ? - !!options.forceJSONP : - use_jsonp() && !same_origin('https:', options.domain); - - this._clientID = options.clientID; - this._callbackURL = options.callbackURL || document.location.href; - this._shouldRedirect = !!options.callbackURL; - this._domain = options.domain; - this._responseType = this._parseResponseType(options, true) || "code"; - this._responseMode = this._parseResponseMode(options, true); - this._cordovaSocialPlugins = { - facebook: this._phonegapFacebookLogin - }; - this._useCordovaSocialPlugins = false || options.useCordovaSocialPlugins; - this._sendClientInfo = null != options.sendSDKClientInfo ? options.sendSDKClientInfo : true; - - this._scope = options.scope || 'openid'; - this._audience = options.audience || null; - this._tenant = options.__tenant || this._domain.split('.')[0]; - this._token_issuer = options.__token_issuer || 'https://' + this._domain + '/'; -} - -/** - * Export version with `Auth0` constructor - * - * @property {String} version - */ - -Auth0.version = require('./version').str; - -/** - * Export client info object - * - * - * @property {Hash} - */ - -Auth0.clientInfo = { name: 'auth0.js', version: Auth0.version }; - - -/** - * Wraps calls to window.open so it can be overriden in Electron. - * - * In Electron, window.open returns an object which provides limited control - * over the opened window (see - * http://electron.atom.io/docs/v0.36.0/api/window-open/). - */ -Auth0.prototype.openWindow = function(url, name, options) { - return window.open(url, name, stringifyPopupSettings(options)); -} - -/** - * Redirect current location to `url` - * - * @param {String} url - * @private - */ - -Auth0.prototype._redirect = function (url) { - global.window.location = url; -}; - -Auth0.prototype._getResponseType = function(opts) { - return this._parseResponseType(opts) || this._responseType; -}; - -Auth0.prototype._getCallbackOnLocationHash = function(options) { - return this._getResponseMode(options) !== "form_post" - && this._getResponseType(options) !== "code"; -}; - -Auth0.prototype._getResponseMode = function(opts) { - var result = this._parseResponseMode(opts) || this._responseMode; - return result === "form_post" - ? "form_post" - : null; -}; - -Auth0.prototype._getCallbackURL = function(options) { - return (options && typeof options.callbackURL !== 'undefined') ? - options.callbackURL : this._callbackURL; -}; - -Auth0.prototype._getClientInfoString = function () { - var clientInfo = JSON.stringify(Auth0.clientInfo); - return Base64Url.encode(clientInfo); -}; - -Auth0.prototype._getClientInfoHeader = function () { - return this._sendClientInfo - ? { 'Auth0-Client': this._getClientInfoString() } - : {}; -}; - -/** - * Renders and submits a WSFed form - * - * @param {Object} options - * @param {Function} formHtml - * @private - */ - -Auth0.prototype._renderAndSubmitWSFedForm = function (options, formHtml) { - var div = document.createElement('div'); - div.innerHTML = formHtml; - var form = document.body.appendChild(div).children[0]; - - if (options.popup && !this._getCallbackOnLocationHash(options)) { - form.target = 'auth0_signup_popup'; - } - - form.submit(); -}; - -/** - * Resolve response type as `token` or `code` - * - * @return {Object} `scope` and `response_type` properties - * @private - */ - -Auth0.prototype._getMode = function (options) { - var result = { - scope: this._scope, - response_type: this._getResponseType(options) - }; - - var responseMode = this._getResponseMode(options); - if (responseMode) { - result.response_mode = responseMode; - } - - return result; -}; - -Auth0.prototype._configureOfflineMode = function(options) { - if (options.scope && options.scope.indexOf('offline_access') >= 0) { - options.device = options.device || 'Browser'; - } -}; - -/** - * Get user information from API - * - * @param {Object} profile - * @param {String} id_token - * @param {Function} callback - * @private - */ - -Auth0.prototype._getUserInfo = function (profile, id_token, callback) { - - warn("DEPRECATION NOTICE: This method will be soon deprecated, use `getUserInfo` instead.") - - if (!(profile && !profile.user_id)) { - return callback(null, profile); - } - - // the scope was just openid - var _this = this; - var protocol = 'https:'; - var domain = this._domain; - var endpoint = '/tokeninfo'; - var url = joinUrl(protocol, domain, endpoint); - - var fail = function (status, description) { - var error = new Error(status + ': ' + (description || '')); - - // These two properties are added for compatibility with old versions (no Error instance was returned) - error.error = status; - error.error_description = description; - - callback(error); - }; - - if (this._useJSONP) { - return jsonp(url + '?' + qs.stringify({id_token: id_token}), jsonpOpts, function (err, resp) { - if (err) { - return fail(0, err.toString()); - } - - return resp.status === 200 ? - callback(null, resp.user) : - fail(resp.status, resp.err || resp.error); - }); - } - - return reqwest({ - url: same_origin(protocol, domain) ? endpoint : url, - method: 'post', - type: 'json', - crossOrigin: !same_origin(protocol, domain), - data: {id_token: id_token} - }).fail(function (err) { - fail(err.status, err.responseText); - }).then(function (userinfo) { - callback(null, userinfo); - }); - -}; - -/** - * Get user information from API - * - * @param {Object} profile - * @param {String} id_token - * @param {Function} callback - * @private - */ - -Auth0.prototype.getUserInfo = function (access_token, callback) { - - if ('function' !== typeof callback) { - throw new Error('A callback function is required'); - } - if (!access_token || typeof access_token !== 'string') { - return callback(new Error('Invalid token')); - } - - var _this = this; - var protocol = 'https:'; - var domain = this._domain; - var endpoint = '/userinfo'; - var url = joinUrl(protocol, domain, endpoint); - - var fail = function (status, description) { - var error = new Error(status + ': ' + (description || '')); - - // These two properties are added for compatibility with old versions (no Error instance was returned) - error.error = status; - error.error_description = description; - - callback(error); - }; - - return reqwest({ - url: same_origin(protocol, domain) ? endpoint : url, - method: 'post', - type: 'json', - crossOrigin: !same_origin(protocol, domain), - headers: { - 'Authorization': 'Bearer ' + access_token - } - }).fail(function (err) { - fail(err.status, err.responseText); - }).then(function (userinfo) { - callback(null, userinfo); - }); - -}; - -/** - * Get profile data by `id_token` - * - * @param {String} id_token - * @param {Function} callback - * @method getProfile - */ - -Auth0.prototype.getProfile = function (id_token, callback) { - if ('function' !== typeof callback) { - throw new Error('A callback function is required'); - } - if (!id_token || typeof id_token !== 'string') { - return callback(new Error('Invalid token')); - } - - this._getUserInfo(this.decodeJwt(id_token), id_token, callback); -}; - -/** - * Validate a user - * - * @param {Object} options - * @param {Function} callback - * @method validateUser - */ - -Auth0.prototype.validateUser = function (options, callback) { - var protocol = 'https:'; - var domain = this._domain; - var endpoint = '/public/api/users/validate_userpassword'; - var url = joinUrl(protocol, domain, endpoint); - - var query = xtend( - options, - { - client_id: this._clientID, - username: trim(options.username || options.email || '') - }); - - if (this._useJSONP) { - return jsonp(url + '?' + qs.stringify(query), jsonpOpts, function (err, resp) { - if (err) { - return callback(err); - } - if('error' in resp && resp.status !== 404) { - return callback(new Error(resp.error)); - } - callback(null, resp.status === 200); - }); - } - - reqwest({ - url: same_origin(protocol, domain) ? endpoint : url, - method: 'post', - type: 'text', - data: query, - crossOrigin: !same_origin(protocol, domain), - error: function (err) { - if (err.status !== 404) { return callback(new Error(err.responseText)); } - callback(null, false); - }, - success: function (resp) { - callback(null, resp.status === 200); - } - }); -}; - -/** - * Decode Json Web Token - * - * @param {String} jwt - * @method decodeJwt - */ - -Auth0.prototype.decodeJwt = function (jwt) { - var encoded = jwt && jwt.split('.')[1]; - return json_parse(Base64Url.decode(encoded)); -}; - -/** - * Given the hash (or a query) of an URL returns a dictionary with only relevant - * authentication information. If succeeds it will return the following fields: - * `profile`, `id_token`, `access_token` and `state`. In case of error, it will - * return `error` and `error_description`. - * - * @method parseHash - * @param {String} [hash=window.location.hash] URL to be parsed - * @example - * var auth0 = new Auth0({...}); - * - * // Returns {profile: {** decoded id token **}, state: "good"} - * auth0.parseHash('#id_token=.....&state=good&foo=bar'); - * - * // Returns {error: "invalid_credentials", error_description: undefined} - * auth0.parseHash('#error=invalid_credentials'); - * - * // Returns {error: "invalid_credentials", error_description: undefined} - * auth0.parseHash('?error=invalid_credentials'); - * - */ - -Auth0.prototype.parseHash = function (hash, options) { - options = options || {}; - hash = hash || window.location.hash; - hash = hash.replace(/^#?\/?/, ''); - var parsed_qs = qs.parse(hash); - - if (parsed_qs.hasOwnProperty('error')) { - var err = { - error: parsed_qs.error, - error_description: parsed_qs.error_description - }; - - if (parsed_qs.state) { - err.state = parsed_qs.state; - } - - return err; - } - - if (!parsed_qs.hasOwnProperty('access_token') - && !parsed_qs.hasOwnProperty('id_token') - && !parsed_qs.hasOwnProperty('refresh_token')) { - return null; - } - - var prof; - - if (parsed_qs.id_token) { - var invalidJwt = function (error) { - var err = { - error: 'invalid_token', - error_description: error - }; - return err; - }; - - prof = this.decodeJwt(parsed_qs.id_token); - - // aud should be the clientID - var audiences = is_array(prof.aud) ? prof.aud : [ prof.aud ]; - if (index_of(audiences, this._clientID) === -1) { - return invalidJwt( - 'The clientID configured (' + this._clientID + ') does not match with the clientID set in the token (' + audiences.join(', ') + ').'); - } - - // iss should be the Auth0 domain (i.e.: https://contoso.auth0.com/) - if (prof.iss && prof.iss !== this._token_issuer) { - return invalidJwt( - 'The domain configured (' + this._token_issuer + ') does not match with the domain set in the token (' + prof.iss + ').'); - } - - var nonce; - - if (options.nonce) { - nonce = options.nonce; - } else if (window.localStorage) { - try { - nonce = window.localStorage.getItem('com.auth0.auth.nonce'); - window.localStorage.removeItem('com.auth0.auth.nonce'); - } catch(e) { - // will fail because nonce is undefined - } - } - - if ((nonce || prof.nonce) && prof.nonce !== nonce) { - return invalidJwt('The nonce does not match.'); - } - } - - return { - accessToken: parsed_qs.access_token, - idToken: parsed_qs.id_token, - idTokenPayload: prof, - refreshToken: parsed_qs.refresh_token, - state: parsed_qs.state - }; -}; - -/** - * Signup - * - * @param {Object} options Signup Options - * @param {String} email New user email - * @param {String} password New user password - * - * @param {Function} callback - * @method signup - */ - -Auth0.prototype.signup = function (options, callback) { - var _this = this; - - var opts = { - client_id: this._clientID, - redirect_uri: this._getCallbackURL(options), - email: trim(options.email || options.username || '') - }; - - if (typeof options.username === 'string') { - opts.username = trim(options.username); - } - - var query = xtend(this._getMode(options), options, opts); - - this._configureOfflineMode(query); - - // TODO Change this to a property named 'disableSSO' for consistency. - // By default, options.sso is true - if (!checkIfSet(options, 'sso')) { - options.sso = true; - } - - if (!checkIfSet(options, 'auto_login')) { - options.auto_login = true; - } - - var popup; - - var will_popup = options.auto_login && options.popup - && (!this._getCallbackOnLocationHash(options) || options.sso); - - if (will_popup) { - popup = this._buildPopupWindow(options); - } - - function success () { - if (options.auto_login) { - return _this.login(options, callback); - } - - if ('function' === typeof callback) { - return callback(); - } - } - - function fail (status, resp) { - var error = new LoginError(status, resp); - - // when failed we want the popup closed if opened - if (popup && 'function' === typeof popup.kill) { - popup.kill(); - } - - if ('function' === typeof callback) { - return callback(error); - } - - throw error; - } - - var protocol = 'https:'; - var domain = this._domain; - var endpoint = '/dbconnections/signup'; - var url = joinUrl(protocol, domain, endpoint); - - if (this._useJSONP) { - return jsonp(url + '?' + qs.stringify(query), jsonpOpts, function (err, resp) { - if (err) { - return fail(0, err); - } - - return resp.status == 200 ? success() : - fail(resp.status, resp.err || resp.error); - }); - } - - reqwest({ - url: same_origin(protocol, domain) ? endpoint : url, - method: 'post', - type: 'html', - data: query, - success: success, - crossOrigin: !same_origin(protocol, domain), - error: function (err) { - fail(err.status, err.responseText); - } - }); -}; - -/** - * Change password - * - * @param {Object} options - * @param {Function} callback - * @method changePassword - */ - -Auth0.prototype.changePassword = function (options, callback) { - var query = { - client_id: this._clientID, - connection: options.connection, - email: trim(options.email || '') - }; - - if (typeof options.password === "string") { - query.password = options.password; - } - - function fail (status, resp) { - var error = new LoginError(status, resp); - if (callback) { - return callback(error); - } - } - - var protocol = 'https:'; - var domain = this._domain; - var endpoint = '/dbconnections/change_password'; - var url = joinUrl(protocol, domain, endpoint); - - if (this._useJSONP) { - return jsonp(url + '?' + qs.stringify(query), jsonpOpts, function (err, resp) { - if (err) { - return fail(0, err); - } - return resp.status == 200 ? - callback(null, resp.message) : - fail(resp.status, resp.err || resp.error); - }); - } - - reqwest({ - url: same_origin(protocol, domain) ? endpoint : url, - method: 'post', - type: 'html', - data: query, - crossOrigin: !same_origin(protocol, domain), - error: function (err) { - fail(err.status, err.responseText); - }, - success: function (r) { - callback(null, r); - } - }); -}; - -/** - * Builds query string to be passed to /authorize based on dict key and values. - * - * @param {Array} args - * @param {Array} blacklist - * @private - */ - -Auth0.prototype._buildAuthorizeQueryString = function (args, blacklist) { - var query = this._buildAuthorizationParameters(args, blacklist); - return qs.stringify(query); -}; - -/** - * Builds parameter dictionary to be passed to /authorize based on dict key and values. - * - * @param {Array} args - * @param {Array} blacklist - * @private - */ - -Auth0.prototype._buildAuthorizationParameters = function(args, blacklist) { - var query = xtend.apply(null, args); - - // Adds offline mode to the query - this._configureOfflineMode(query); - - // Adds client SDK information (when enabled) - if ( this._sendClientInfo ) query['auth0Client'] = this._getClientInfoString(); - - // Elements to filter from query string - blacklist = blacklist || ['popup', 'popupOptions']; - - var i, key; - - for (i = 0; i < blacklist.length; i++) { - key = blacklist[i]; - delete query[key]; - } - - if (query.connection_scope && is_array(query.connection_scope)){ - query.connection_scope = query.connection_scope.join(','); - } - - return query; -}; - -Auth0.prototype._buildAuthorizeUrl = function(options) { - var constructorOptions = {}; - - if (this._scope) { - constructorOptions.scope = this._scope; - } - - if (this._audience) { - constructorOptions.audience = this._audience; - } - - - var qs = [ - this._getMode(options), - constructorOptions, - options, - { - client_id: this._clientID, - redirect_uri: this._getCallbackURL(options) - } - ]; - - var query = this._buildAuthorizeQueryString(qs); - - return joinUrl('https:', this._domain, '/authorize?' + query); -} - -/** - * Login user - * - * @param {Object} options - * @param {Function} callback - * @method login - */ - -Auth0.prototype.login = Auth0.prototype.signin = function (options, callback) { - // TODO Change this to a property named 'disableSSO' for consistency. - // By default, options.sso is true - if (!checkIfSet(options, 'sso')) { - options.sso = true; - } - - if (this._responseType.indexOf('id_token') > -1 && !options.nonce) { - if (typeof options.passcode === 'undefined' && ( - ((typeof options.username !== 'undefined' || typeof options.email !== 'undefined') && !callback) || - (typeof options.username === 'undefined' && typeof options.email === 'undefined') - ) ) { - - if (window.localStorage) { - var nonce = nonceGenerator.randomString(16); - if (nonce) { - try { - options.nonce = nonce; - window.localStorage.setItem('com.auth0.auth.nonce', nonce); - } - catch(e) { - options.nonce = undefined; - } - } - } else { - throw new Error('Unable to generate and store nonce to request id_token. Please provide a nonce value via options'); - } - } - } - - if (typeof options.passcode !== 'undefined') { - return this.loginWithPasscode(options, callback); - } - - if (typeof options.username !== 'undefined' || - typeof options.email !== 'undefined') { - return this.loginWithUsernamePassword(options, callback); - } - - if (!!window.cordova || !!window.electron) { - return this.loginPhonegap(options, callback); - } - - if (!!options.popup && this._getCallbackOnLocationHash(options)) { - return this.loginWithPopup(options, callback); - } - - if (!options.nonce && this._responseType.indexOf('id_token') > -1) { - throw new Error('nonce is mandatory'); - } - - this._authorize(options); -}; - -Auth0.prototype._authorize = function(options) { - var url = this._buildAuthorizeUrl(options); - - if (options.popup) { - this._buildPopupWindow(options, url); - } else { - this._redirect(url); - } -}; - -/** - * Compute `options.width` and `options.height` for the popup to - * open and return and extended object with optimal `top` and `left` - * position arguments for the popup windows - * - * @param {Object} options - * @private - */ - -Auth0.prototype._computePopupPosition = function (options) { - options = options || {}; - var width = options.width || 500; - var height = options.height || 600; - - var screenX = typeof window.screenX !== 'undefined' ? window.screenX : window.screenLeft; - var screenY = typeof window.screenY !== 'undefined' ? window.screenY : window.screenTop; - var outerWidth = typeof window.outerWidth !== 'undefined' ? window.outerWidth : document.body.clientWidth; - var outerHeight = typeof window.outerHeight !== 'undefined' ? window.outerHeight : (document.body.clientHeight - 22); - // XXX: what is the 22? - - // Use `outerWidth - width` and `outerHeight - height` for help in - // positioning the popup centered relative to the current window - var left = screenX + (outerWidth - width) / 2; - var top = screenY + (outerHeight - height) / 2; - - return { width: width, height: height, left: left, top: top }; -}; - -/** - * loginPhonegap method is triggered when !!window.cordova is true. - * - * @method loginPhonegap - * @private - * @param {Object} options Login options. - * @param {Function} callback To be called after login happened. Callback arguments - * should be: - * function (err, profile, idToken, accessToken, state) - * - * @example - * var auth0 = new Auth0({ clientId: '...', domain: '...'}); - * - * auth0.signin({}, function (err, profile, idToken, accessToken, state) { - * if (err) { - * alert(err); - * return; - * } - * - * alert('Welcome ' + profile.name); - * }); - */ - -Auth0.prototype.loginPhonegap = function (options, callback) { - if (this._shouldAuthenticateWithCordovaPlugin(options.connection)) { - this._socialPhonegapLogin(options, callback); - return; - } - - var mobileCallbackURL = joinUrl('https:', this._domain, '/mobile'); - var _this = this; - var qs = [ - this._getMode(options), - options, - { - client_id: this._clientID, - redirect_uri: mobileCallbackURL - } - ]; - - if ( this._sendClientInfo ) { - qs.push({ auth0Client: this._getClientInfoString() }); - } - - var query = this._buildAuthorizeQueryString(qs); - - var popupUrl = joinUrl('https:', this._domain, '/authorize?' + query); - - var popupOptions = xtend({location: 'yes'} , - options.popupOptions); - - // This wasn't send before so we don't send it now either - delete popupOptions.width; - delete popupOptions.height; - - var ref = this.openWindow(popupUrl, '_blank', popupOptions); - var answered = false; - - function errorHandler(event) { - if (answered) { return; } - answered = true; - ref.close(); - callback(new Error(event.message), null); - } - - function startHandler(event) { - if (answered) { return; } - - if ( event.url && !(event.url.indexOf(mobileCallbackURL + '#') === 0 || - event.url.indexOf(mobileCallbackURL + '?') === 0)) { return; } - - var result = _this.parseHash(event.url.slice(mobileCallbackURL.length)); - - if (!result) { - answered = true; - ref.close(); - callback(new Error('Error parsing hash'), null); - return; - } - - if (result.idToken) { - answered = true; - ref.close(); - callback(null, result); - return; - } - - - // Case where we've found an error - answered = true; - ref.close(); - callback(new Error(result.err || result.error || 'Something went wrong'), null); - } - - function exitHandler() { - if (answered) { return; } - - ref.removeEventListener('loaderror', errorHandler); - ref.removeEventListener('loadstart', startHandler); - ref.removeEventListener('exit', exitHandler); - - callback(new Error('Browser window closed'), null); - } - - ref.addEventListener('loaderror', errorHandler); - ref.addEventListener('loadstart', startHandler); - ref.addEventListener('exit', exitHandler); - -}; - -/** - * loginWithPopup method is triggered when login method receives a {popup: true} in - * the login options. - * - * @method loginWithPopup - * @param {Object} options Login options. - * @param {function} callback To be called after login happened (whether - * success or failure). This parameter is mandatory when - * option callbackOnLocationHash is truthy but should not - * be used when falsy. - * @example - * var auth0 = new Auth0({ clientId: '...', domain: '...', callbackOnLocationHash: true }); - * - * // Error! No callback - * auth0.login({popup: true}); - * - * // Ok! - * auth0.login({popup: true}, function () { }); - * - * @example - * var auth0 = new Auth0({ clientId: '...', domain: '...'}); - * - * // Ok! - * auth0.login({popup: true}); - * - * // Error! No callback will be executed on response_type=code - * auth0.login({popup: true}, function () { }); - * @private - */ - -Auth0.prototype.loginWithPopup = function(options, callback) { - var _this = this; - - if (!callback) { - throw new Error('popup mode should receive a mandatory callback'); - } - - if (!options.nonce && this._responseType.indexOf('id_token') > -1) { - throw new Error('nonce is mandatory'); - } - - var qs = [this._getMode(options), options, { client_id: this._clientID, owp: true }]; - - if (this._sendClientInfo) { - qs.push({ auth0Client: this._getClientInfoString() }); - } - - var query = this._buildAuthorizeQueryString(qs); - var popupUrl = joinUrl('https:', this._domain, '/authorize?' + query); - - var popupPosition = this._computePopupPosition(options.popupOptions); - var popupOptions = xtend(popupPosition, options.popupOptions); - - var popup = WinChan.open({ - url: popupUrl, - relay_url: 'https://' + this._domain + '/relay.html', - window_features: stringifyPopupSettings(popupOptions) - }, function (err, result) { - // Eliminate `_current_popup` reference manually because - // Winchan removes `.kill()` method from window and also - // doesn't call `.kill()` by itself - _this._current_popup = null; - - // Winchan always returns string errors, we wrap them inside Error objects - if (err) { - return callback(new LoginError(err), null, null, null, null, null); - } - - // Handle edge case with generic error - if (!result) { - return callback(new LoginError('Something went wrong'), null, null, null, null, null); - } - - // Handle profile retrieval from id_token and respond - if (result.access_token || result.id_token) { - return callback(null, _this._prepareResult(result)); - } - - // Case where the error is returned at an `err` property from the result - if (result.err) { - return callback(new LoginError(result.err.status, result.err.details || result.err), null, null, null, null, null); - } - - // Case for sso_dbconnection_popup returning error at result.error instead of result.err - if (result.error) { - return callback(new LoginError(result.status, result.details || result), null, null, null, null, null); - } - - // Case we couldn't match any error, we return a generic one - return callback(new LoginError('Something went wrong'), null, null, null, null, null); - }); - - popup.focus(); -}; - -/** - * _shouldAuthenticateWithCordovaPlugin method checks whether Auth0 is properly configured to - * handle authentication of a social connnection using a phonegap plugin. - * - * @param {String} connection Name of the connection. - * @private - */ - -Auth0.prototype._shouldAuthenticateWithCordovaPlugin = function(connection) { - var socialPlugin = this._cordovaSocialPlugins[connection]; - return this._useCordovaSocialPlugins && !!socialPlugin; -}; - -/** - * _socialPhonegapLogin performs social authentication using a phonegap plugin - * - * @param {String} connection Name of the connection. - * @param {function} callback To be called after login happened (whether - * success or failure). - * @private - */ - -Auth0.prototype._socialPhonegapLogin = function(options, callback) { - var socialAuthentication = this._cordovaSocialPlugins[options.connection]; - var _this = this; - socialAuthentication(options.connection_scope, function(error, accessToken, extras) { - if (error) { - callback(error, null, null, null, null); - return; - } - var loginOptions = xtend({ access_token: accessToken }, options, extras); - _this.loginWithSocialAccessToken(loginOptions, callback); - }); -}; - -/** - * _phonegapFacebookLogin performs social authentication with Facebook using phonegap-facebook-plugin - * - * @param {Object} scopes FB scopes used to login. It can be an Array of String or a single String. - * By default is ["public_profile"] - * @param {function} callback To be called after login happened (whether success or failure). It will - * yield the accessToken and any extra information neeeded by Auth0 API - * or an Error if the authentication fails. Callback should be: - * function (err, accessToken, extras) { } - * @private - */ - -Auth0.prototype._phonegapFacebookLogin = function(scopes, callback) { - if (!window.facebookConnectPlugin || !window.facebookConnectPlugin.login) { - callback(new Error('missing plugin phonegap-facebook-plugin'), null, null); - return; - } - - var fbScopes; - if (scopes && is_array(scopes)){ - fbScopes = scopes; - } else if (scopes) { - fbScopes = [scopes]; - } else { - fbScopes = ['public_profile']; - } - window.facebookConnectPlugin.login(fbScopes, function (state) { - callback(null, state.authResponse.accessToken, {}); - }, function(error) { - callback(new Error(error), null, null); - }); -}; - -/** - * This method handles the scenario where a db connection is used with - * popup: true and sso: true. - * - * @private - */ -Auth0.prototype.loginWithUsernamePasswordAndSSO = function (options, callback) { - var _this = this; - var popupPosition = this._computePopupPosition(options.popupOptions); - var popupOptions = xtend(popupPosition, options.popupOptions); - - if (!options.nonce && this._responseType.indexOf('id_token') > -1) { - throw new Error('nonce is mandatory'); - } - - var winchanOptions = { - url: 'https://' + this._domain + '/sso_dbconnection_popup/' + this._clientID, - relay_url: 'https://' + this._domain + '/relay.html', - window_features: stringifyPopupSettings(popupOptions), - popup: this._current_popup, - params: { - domain: this._domain, - clientID: this._clientID, - options: { - // TODO What happens with i18n? - username: trim(options.username || options.email || ''), - password: options.password, - connection: options.connection, - state: options.state, - scope: options.scope - } - } - }; - - if (options._csrf) { - winchanOptions.params.options._csrf = options._csrf; - } - - if (options.device) { - winchanOptions.params.options.device = options.device; - } - - var popup = WinChan.open(winchanOptions, function (err, result) { - // Eliminate `_current_popup` reference manually because - // Winchan removes `.kill()` method from window and also - // doesn't call `.kill()` by itself - _this._current_popup = null; - - // Winchan always returns string errors, we wrap them inside Error objects - if (err) { - return callback(new LoginError(err), null, null, null, null, null); - } - - // Handle edge case with generic error - if (!result) { - return callback(new LoginError('Something went wrong'), null, null, null, null, null); - } - - // Handle profile retrieval from id_token and respond - if (result.id_token) { - return callback(null, _this._prepareResult(result)); - } - - // Case where the error is returned at an `err` property from the result - if (result.err) { - return callback(new LoginError(result.err.status, result.err.details || result.err), null, null, null, null, null); - } - - // Case for sso_dbconnection_popup returning error at result.error instead of result.err - if (result.error) { - return callback(new LoginError(result.status, result.details || result), null, null, null, null, null); - } - - // Case we couldn't match any error, we return a generic one - return callback(new LoginError('Something went wrong'), null, null, null, null, null); - }); - - popup.focus(); -}; - -/** - * Login with Resource Owner (RO) - * - * @param {Object} options - * @param {Function} callback - * @method loginWithResourceOwner - */ - -Auth0.prototype.loginWithResourceOwner = function (options, callback) { - var _this = this; - var query = xtend( - this._getMode(options), - options, - { - client_id: this._clientID, - username: trim(options.username || options.email || ''), - grant_type: 'password' - }); - - this._configureOfflineMode(query); - - var protocol = 'https:'; - var domain = this._domain; - var endpoint = '/oauth/ro'; - var url = joinUrl(protocol, domain, endpoint); - - if ( this._sendClientInfo && this._useJSONP ) { - query['auth0Client'] = this._getClientInfoString(); - } - - if (this._useJSONP) { - return jsonp(url + '?' + qs.stringify(query), jsonpOpts, function (err, resp) { - if (err) { - return callback(err); - } - if('error' in resp) { - var error = new LoginError(resp.status, resp.error); - return callback(error); - } - callback(null, _this._prepareResult(resp)); - }); - } - - reqwest({ - url: same_origin(protocol, domain) ? endpoint : url, - method: 'post', - type: 'json', - data: query, - headers: this._getClientInfoHeader(), - crossOrigin: !same_origin(protocol, domain), - success: function (resp) { - callback(null, _this._prepareResult(resp)); - }, - error: function (err) { - handleRequestError(err, callback); - } - }); -}; - -/** - * Login with Social Access Token - * - * @param {Object} options - * @param {Function} callback - * @method loginWithSocialAccessToken - */ - -Auth0.prototype.loginWithSocialAccessToken = function (options, callback) { - var _this = this; - var query = this._buildAuthorizationParameters([ - { scope: this._scope }, - options, - { client_id: this._clientID } - ]); - - var protocol = 'https:'; - var domain = this._domain; - var endpoint = '/oauth/access_token'; - var url = joinUrl(protocol, domain, endpoint); - - if (this._useJSONP) { - return jsonp(url + '?' + qs.stringify(query), jsonpOpts, function (err, resp) { - if (err) { - return callback(err); - } - if('error' in resp) { - var error = new LoginError(resp.status, resp.error); - return callback(error); - } - callback(null, _this._prepareResult(resp)); - }); - } - - reqwest({ - url: same_origin(protocol, domain) ? endpoint : url, - method: 'post', - type: 'json', - data: query, - headers: this._getClientInfoHeader(), - crossOrigin: !same_origin(protocol, domain), - success: function (resp) { - callback(null, _this._prepareResult(resp)); - }, - error: function (err) { - handleRequestError(err, callback); - } - }); -}; - -/** - * Open a popup, store the winref in the instance and return it. - * - * We usually need to call this method before any ajax transaction in order - * to prevent the browser to block the popup. - * - * @param {[type]} options [description] - * @param {Function} callback [description] - * @return {[type]} [description] - * @private - */ - -Auth0.prototype._buildPopupWindow = function (options, url) { - if (this._current_popup && !this._current_popup.closed) { - return this._current_popup; - } - - url = url || 'about:blank' - - var _this = this; - var defaults = { width: 500, height: 600 }; - var opts = xtend(defaults, options.popupOptions || {}); - var popupOptions = stringifyPopupSettings(opts); - - this._current_popup = window.open(url, 'auth0_signup_popup', popupOptions); - - if (!this._current_popup) { - throw new Error('Popup window cannot not been created. Disable popup blocker or make sure to call Auth0 login or singup on an UI event.'); - } - - this._current_popup.kill = function () { - this.close(); - _this._current_popup = null; - }; - - return this._current_popup; -}; - -/** - * Login with Username and Password - * - * @param {Object} options - * @param {Function} callback - * @method loginWithUsernamePassword - */ - -Auth0.prototype.loginWithUsernamePassword = function (options, callback) { - // XXX: Warning: This check is whether callback arguments are - // fn(err) case callback.length === 1 (a redirect should be performed) vs. - // fn(err, profile, id_token, access_token, state) callback.length > 1 (no - // redirect should be performed) - // - // Note: Phonegap/Cordova: - // As the popup is launched using the InAppBrowser plugin the SSO cookie will - // be set on the InAppBrowser browser. That's why the browser where the app runs - // won't get the sso cookie. Therefore, we don't allow username password using - // popup with sso: true in Cordova/Phonegap and we default to resource owner auth. - if (callback && callback.length > 1 && (!options.sso || window.cordova)) { - return this.loginWithResourceOwner(options, callback); - } - - var _this = this; - var popup; - - // TODO We should deprecate this, really hacky and confuses people. - if (options.popup && !this._getCallbackOnLocationHash(options)) { - popup = this._buildPopupWindow(options); - } - - if (!options.nonce && this._responseType.indexOf('id_token') > -1) { - throw new Error('nonce is mandatory'); - } - - // When a callback with more than one argument is specified and sso: true then - // we open a popup and do authentication there. - if (callback && callback.length > 1 && options.sso ) { - return this.loginWithUsernamePasswordAndSSO(options, callback); - } - - var query = xtend( - this._getMode(options), - options, - { - client_id: this._clientID, - redirect_uri: this._getCallbackURL(options), - username: trim(options.username || options.email || ''), - tenant: this._tenant - }); - - this._configureOfflineMode(query); - - var protocol = 'https:'; - var domain = this._domain; - var endpoint = '/usernamepassword/login'; - var url = joinUrl(protocol, domain, endpoint); - - if (this._useJSONP) { - return jsonp(url + '?' + qs.stringify(query), jsonpOpts, function (err, resp) { - if (err) { - if (popup && popup.kill) { popup.kill(); } - return callback(err); - } - if('error' in resp) { - if (popup && popup.kill) { popup.kill(); } - var error = new LoginError(resp.status, resp.error); - return callback(error); - } - _this._renderAndSubmitWSFedForm(options, resp.form); - }); - } - - function return_error (error) { - if (callback) { - return callback(error); - } - throw error; - } - - reqwest({ - url: same_origin(protocol, domain) ? endpoint : url, - method: 'post', - type: 'html', - data: query, - headers: this._getClientInfoHeader(), - crossOrigin: !same_origin(protocol, domain), - success: function (resp) { - _this._renderAndSubmitWSFedForm(options, resp); - }, - error: function (err) { - if (popup && popup.kill) { - popup.kill(); - } - handleRequestError(err, return_error); - } - }); -}; - -/** - * Login with phone number and passcode - * - * @param {Object} options - * @param {Function} callback - * @method loginWithPhoneNumber - */ -Auth0.prototype.loginWithPasscode = function (options, callback) { - - if (options.email == null && options.phoneNumber == null) { - throw new Error('email or phoneNumber is required for authentication'); - } - - if (options.passcode == null) { - throw new Error('passcode is required for authentication'); - } - - options.connection = options.email == null ? 'sms' : 'email'; - - if (!this._shouldRedirect) { - options = xtend(options, { - username: options.email == null ? options.phoneNumber : options.email, - password: options.passcode, - sso: false - }); - - delete options.email; - delete options.phoneNumber; - delete options.passcode; - - return this.loginWithResourceOwner(options, callback); - } - - var verifyOptions = {connection: options.connection}; - - if (options.phoneNumber) { - options.phone_number = options.phoneNumber; - delete options.phoneNumber; - - verifyOptions.phone_number = options.phone_number; - } - - if (options.email) { - verifyOptions.email = options.email; - } - - options.verification_code = options.passcode; - delete options.passcode; - - verifyOptions.verification_code = options.verification_code; - - var _this = this; - this._verify(verifyOptions, function(error) { - if (error) { - return callback(error); - } - _this._verify_redirect(options); - }); -}; - -Auth0.prototype._verify = function(options, callback) { - var protocol = 'https:'; - var domain = this._domain; - var endpoint = '/passwordless/verify'; - var url = joinUrl(protocol, domain, endpoint); - - var data = options; - - if (this._useJSONP) { - if (this._sendClientInfo) { - data['auth0Client'] = this._getClientInfoString(); - } - - return jsonp(url + '?' + qs.stringify(data), jsonpOpts, function (err, resp) { - if (err) { - return callback(new Error(0 + ': ' + err.toString())); - } - // /**/ typeof __auth0jp0 === 'function' && __auth0jp0({"status":400}); - return resp.status === 200 ? callback(null, true) : callback({status: resp.status}); - }); - } - - return reqwest({ - url: same_origin(protocol, domain) ? endpoint : url, - method: 'post', - headers: this._getClientInfoHeader(), - crossOrigin: !same_origin(protocol, domain), - data: data - }) - .fail(function (err) { - try { - callback(JSON.parse(err.responseText)); - } catch (e) { - var error = new Error(err.status + '(' + err.statusText + '): ' + err.responseText); - error.statusCode = err.status; - error.error = err.statusText; - error.message = err.responseText; - callback(error); - } - }) - .then(function (result) { - callback(null, result); - }); -} - -Auth0.prototype._verify_redirect = function(options) { - var qs = [ - this._getMode(options), - options, - { - client_id: this._clientID, - redirect_uri: this._getCallbackURL(options) - } - ]; - - var query = this._buildAuthorizeQueryString(qs); - var url = joinUrl('https:', this._domain, '/passwordless/verify_redirect?' + query); - - this._redirect(url); -}; - -// TODO Document me -Auth0.prototype.renewIdToken = function (id_token, callback) { - this.getDelegationToken({ - id_token: id_token, - scope: 'passthrough', - api: 'auth0' - }, callback); -}; - -// TODO Document me -Auth0.prototype.refreshToken = function (refresh_token, callback) { - this.getDelegationToken({ - refresh_token: refresh_token, - scope: 'passthrough', - api: 'auth0' - }, callback); -}; - -/** - * Get delegation token for certain addon or certain other clientId - * - * @example - * - * auth0.getDelegationToken({ - * id_token: '', - * target: '' - * api_type: 'auth0' - * }, function (err, delegationResult) { - * if (err) return console.log(err.message); - * // Do stuff with delegation token - * expect(delegationResult.id_token).to.exist; - * expect(delegationResult.token_type).to.eql('Bearer'); - * expect(delegationResult.expires_in).to.eql(36000); - * }); - * - * @example - * - * // get a delegation token from a Firebase API App - * auth0.getDelegationToken({ - * id_token: '', - * target: '' - * api_type: 'firebase' - * }, function (err, delegationResult) { - * // Use your firebase token here - * }); - * - * @method getDelegationToken - * @param {Object} [options] - * @param {String} [id_token] - * @param {String} [target] - * @param {String} [api_type] - * @param {Function} [callback] - */ -Auth0.prototype.getDelegationToken = function (options, callback) { - options = options || {}; - - if (!options.id_token && !options.refresh_token ) { - throw new Error('You must send either an id_token or a refresh_token to get a delegation token.'); - } - - var query = xtend({ - grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer', - client_id: this._clientID, - target: options.targetClientId || this._clientID, - api_type: options.api - }, options); - - delete query.hasOwnProperty; - delete query.targetClientId; - delete query.api; - - var protocol = 'https:'; - var domain = this._domain; - var endpoint = '/delegation'; - var url = joinUrl(protocol, domain, endpoint); - - if (this._useJSONP) { - return jsonp(url + '?' + qs.stringify(query), jsonpOpts, function (err, resp) { - if (err) { - return callback(err); - } - if('error' in resp) { - var error = new LoginError(resp.status, resp.error_description || resp.error); - return callback(error); - } - callback(null, resp); - }); - } - - reqwest({ - url: same_origin(protocol, domain) ? endpoint : url, - method: 'post', - type: 'json', - data: query, - crossOrigin: !same_origin(protocol, domain), - success: function (resp) { - callback(null, resp); - }, - error: function (err) { - try { - callback(JSON.parse(err.responseText)); - } - catch (e) { - var er = err; - var isAffectedIEVersion = isInternetExplorer() === 10 || isInternetExplorer() === 11; - var zeroStatus = (!er.status || er.status === 0); - - // Request failed because we are offline. - // See: http://caniuse.com/#search=navigator.onLine - if (zeroStatus && !window.navigator.onLine) { - er = {}; - er.status = 0; - er.responseText = { - code: 'offline' - }; - // http://stackoverflow.com/questions/23229723/ie-10-11-cors-status-0 - // XXX IE10 when a request fails in CORS returns status code 0 - // XXX This is not handled by handleRequestError as the errors are different - } else if (zeroStatus && isAffectedIEVersion) { - er = {}; - er.status = 401; - er.responseText = { - code: 'invalid_operation' - }; - // If not IE10/11 and not offline it means that Auth0 host is unreachable: - // Connection Timeout or Connection Refused. - } else if (zeroStatus) { - er = {}; - er.status = 0; - er.responseText = { - code: 'connection_refused_timeout' - }; - } else { - er.responseText = err; - } - callback(new LoginError(er.status, er.responseText)); - } - } - }); -}; - -/** - * Fetches a new id_token/access_token from Auth0 - * - * @example - * - * auth0.silentAuthentication({}, function(error, result) { - * if (error) { - * console.log(error); - * } - * // result.id_token - * }); - * - * @example - * - * auth0.silentAuthentication({callbackUrl: "https://site.com/silentCallback"}, function(error, result) { - * if (error) { - * console.log(error); - * } - * // result.id_token - * }); - * - * @method silentAutnetication - * @param {Object} options - * @param {function} callback - */ -Auth0.prototype.silentAuthentication = function (options, callback) { - var usePostMessage = options.usePostMessage || false; - - delete options.usePostMessage; - - options = xtend(options, {prompt:'none'}); - var handler = new SilentAuthenticationHandler(this, this._buildAuthorizeUrl(options)); - handler.login(callback, usePostMessage); -}; - -/** - * Trigger logout redirect with - * params from `query` object - * - * @example - * - * auth0.logout(); - * // redirects to -> 'https://yourapp.auth0.com/logout' - * - * @example - * - * auth0.logout({returnTo: 'http://logout'}); - * // redirects to -> 'https://yourapp.auth0.com/logout?returnTo=http://logout' - * - * @example - * - * auth0.logout(null, {version: 'v2'}); - * // redirects to -> 'https://yourapp.auth0.com/v2/logout' - * - * @example - * - * auth0.logout({returnTo: 'http://logout'}, {version: 2}); - * // redirects to -> 'https://yourapp.auth0.com/v2/logout?returnTo=http://logout' - * - * @method logout - * @param {Object} query - */ - -Auth0.prototype.logout = function (query, options) { - var pathName = '/logout'; - options = options || {}; - - if (options.version == 'v2') { - pathName = '/v2' + pathName - } - - var url = joinUrl('https:', this._domain, pathName); - - if (query) { - url += '?' + qs.stringify(query); - } - - this._redirect(url); -}; - -/** - * Get single sign on Data - * - * @example - * - * auth0.getSSOData(function (err, ssoData) { - * if (err) return console.log(err.message); - * expect(ssoData.sso).to.exist; - * }); - * - * @example - * - * auth0.getSSOData(false, fn); - * - * @method getSSOData - * @param {Boolean} withActiveDirectories - * @param {Function} cb - */ - -Auth0.prototype.getSSOData = function (withActiveDirectories, cb) { - if (typeof withActiveDirectories === 'function') { - cb = withActiveDirectories; - withActiveDirectories = false; - } - - var noResult = {sso: false}; - - if (this._useJSONP) { - var error = new Error("The SSO data can't be obtained using JSONP"); - setTimeout(function() { cb(error, noResult) }, 0); - return; - } - - var protocol = 'https:'; - var domain = this._domain; - var endpoint = '/user/ssodata'; - var url = joinUrl(protocol, domain, endpoint); - var sameOrigin = same_origin(protocol, domain); - var data = {}; - - if (withActiveDirectories) { - data = {ldaps: 1, client_id: this._clientID}; - } - - return reqwest({ - url: sameOrigin ? endpoint : url, - method: 'get', - type: 'json', - data: data, - crossOrigin: !sameOrigin, - withCredentials: !sameOrigin, - timeout: 3000 - }).fail(function(err) { - var error = new Error("There was an error in the request that obtains the user's SSO data."); - error.cause = err; - cb(error, noResult); - }).then(function(resp) { - cb(null, resp); - }); -}; - -/** - * Get all configured connections for a client - * - * @method getConnections - * @param {Function} callback - * @deprecated This method is deprecated. If you need to get the connections please use Management API https://auth0.com/docs/api/management/v2#!/Connections/get_connections - */ - -Auth0.prototype.getConnections = function (callback) { - warn('getConnections is deprecated and will be removed shortly. Please use Management API endpoint /connections to list the connections'); - return jsonp('https://' + this._domain + '/public/api/' + this._clientID + '/connections', jsonpOpts, callback); -}; - -/** - * Send email or SMS to do passwordless authentication - * - * @example - * // To send an email - * auth0.startPasswordless({email: 'foo@bar.com'}, function (err, result) { - * if (err) return console.log(err.error_description); - * console.log(result); - * }); - * - * @example - * // To send a SMS - * auth0.startPasswordless({phoneNumber: '+14251112222'}, function (err, result) { - * if (err) return console.log(err.error_description); - * console.log(result); - * }); - * - * @method startPasswordless - * @param {Object} options - * @param {Function} callback - */ - -Auth0.prototype.startPasswordless = function (options, callback) { - if ('object' !== typeof options) { - throw new Error('An options object is required'); - } - if ('function' !== typeof callback) { - throw new Error('A callback function is required'); - } - if (!options.email && !options.phoneNumber) { - throw new Error('An `email` or a `phoneNumber` is required.'); - } - - var protocol = 'https:'; - var domain = this._domain; - var endpoint = '/passwordless/start'; - var url = joinUrl(protocol, domain, endpoint); - - var data = {client_id: this._clientID}; - if (options.email) { - data.email = options.email; - data.connection = 'email'; - if (options.authParams) { - data.authParams = options.authParams; - } - - if (!options.send || options.send === "link") { - if (!data.authParams) { - data.authParams = {}; - } - - data.authParams.redirect_uri = options.callbackURL || this._callbackURL; - data.authParams.response_type = this._getResponseType(options); - } - - if (options.send) { - data.send = options.send; - } - } else { - data.phone_number = options.phoneNumber; - data.connection = 'sms'; - } - - if (this._useJSONP) { - if (this._sendClientInfo) { - data['auth0Client'] = this._getClientInfoString(); - } - - return jsonp(url + '?' + qs.stringify(data), jsonpOpts, function (err, resp) { - if (err) { - return callback(new Error(0 + ': ' + err.toString())); - } - return resp.status === 200 ? callback(null, true) : callback(resp.err || resp.error); - }); - } - - return reqwest({ - url: same_origin(protocol, domain) ? endpoint : url, - method: 'post', - type: 'json', - headers: this._getClientInfoHeader(), - crossOrigin: !same_origin(protocol, domain), - data: data - }) - .fail(function (err) { - try { - callback(JSON.parse(err.responseText)); - } catch (e) { - var error = new Error(err.status + '(' + err.statusText + '): ' + err.responseText); - error.statusCode = err.status; - error.error = err.statusText; - error.message = err.responseText; - callback(error); - } - }) - .then(function (result) { - callback(null, result); - }); -}; - -Auth0.prototype.requestMagicLink = function(attrs, cb) { - return this.startPasswordless(attrs, cb); -}; - -Auth0.prototype.requestEmailCode = function(attrs, cb) { - attrs.send = "code"; - return this.startPasswordless(attrs, cb); -}; - -Auth0.prototype.verifyEmailCode = function(attrs, cb) { - attrs.passcode = attrs.code; - delete attrs.code; - return this.login(attrs, cb); -}; - -Auth0.prototype.requestSMSCode = function(attrs, cb) { - return this.startPasswordless(attrs, cb); -}; - -Auth0.prototype.verifySMSCode = function(attrs, cb) { - attrs.passcode = attrs.code; - delete attrs.code; - return this.login(attrs, cb); -}; - -/** - * Returns the ISO 3166-1 code for the country where the request is - * originating. - * - * Fails if the request has to be made using JSONP. - * - * @private - */ -Auth0.prototype.getUserCountry = function(cb) { - var protocol = 'https:'; - var domain = this._domain; - var endpoint = "/user/geoloc/country"; - var url = joinUrl(protocol, domain, endpoint); - - if (this._useJSONP) { - var error = new Error("The user's country can't be obtained using JSONP"); - setTimeout(function() { cb(error) }, 0); - return; - } - - reqwest({ - url: same_origin(protocol, domain) ? endpoint : url, - method: "get", - type: "json", - headers: this._getClientInfoHeader(), - crossOrigin: !same_origin(protocol, domain), - success: function(resp) { - cb(null, resp.country_code) - }, - error: function(err) { - var error = new Error("There was an error in the request that obtains the user's country"); - error.cause = err; - cb(error); - } - }); -} - -Auth0.prototype._prepareResult = function(result) { - if (!result || typeof result !== "object") { - return; - } - - var decodedIdToken = result.id_token ? this.decodeJwt(result.id_token) : undefined; - - return { - accessToken: result.access_token, - idToken: result.id_token, - idTokenPayload: result.profile || decodedIdToken, - refreshToken: result.refresh_token, - state: result.state - }; -} - -Auth0.prototype._parseResponseType = function(opts, setFlags) { - if (!opts) opts = {}; - - if (setFlags - && !this._providedResponseOptions - && opts.hasOwnProperty("callbackOnLocationHash")) { - this._providedCallbackOnLocationHash = true; - } - - if (setFlags - && !this._providedCallbackOnLocationHash - && opts.hasOwnProperty("responseType")) { - this._providedResponseOptions = true; - } - - if (!this._providedCallbackOnLocationHash - && !this._providedResponseOptions - && opts.hasOwnProperty("callbackOnLocationHash") - && opts.hasOwnProperty("responseType")) { - warn("The responseType option will be ignored. Both callbackOnLocationHash and responseType options were provided and they can't be used together."); - } - - if (this._providedCallbackOnLocationHash - && opts.hasOwnProperty("responseType")) { - warn("The responseType option will be ignored. The callbackOnLocationHash option was provided to the constructor and they can't be mixed."); - } - - if (this._providedResponseOptions - && opts.hasOwnProperty("callbackOnLocationHash")) { - warn("The callbackOnLocationHash option will be ignored. The responseType option was provided to the constructor and they can't be mixed."); - } - - if (!this._providedCallbackOnLocationHash - && !opts.hasOwnProperty("callbackOnLocationHash") - && opts.responseType - && !validResponseType(opts.responseType)) { - warn("The responseType option will be ignored. Its valid values are \"code\", \"id_token\", \"token\" or any combination of them."); - } - - var result = undefined; - - if (!this._providedResponseOptions - && null != opts.callbackOnLocationHash) { - result = callbackOnLocationHashToResponseType(opts.callbackOnLocationHash); - } - - if (!this._providedCallbackOnLocationHash - && !opts.hasOwnProperty("callbackOnLocationHash") - && opts.responseType - && validResponseType(opts.responseType)) { - result = opts.responseType; - } - - return result; -} - -Auth0.prototype._parseResponseMode = function(opts, setFlags) { - if (!opts) opts = {}; - - if (setFlags - && !this._providedCallbackOnLocationHash - && opts.hasOwnProperty("responseMode")) { - this._providedResponseOptions = true; - } - - if (this._providedCallbackOnLocationHash - && opts.hasOwnProperty("responseMode")) { - warn("The responseMode option will be ignored. The callbackOnLocationHash option was provided to the constructor and they can't be mixed."); - } - - if (!this._providedCallbackOnLocationHash - && !this._providedResponseOptions - && opts.hasOwnProperty("callbackOnLocationHash") - && opts.hasOwnProperty("responseMode")) { - warn("The responseMode option will be ignored. Both callbackOnLocationHash and responseMode options were provided and they can't be used together."); - } - - var result = undefined; - - if (!this._providedCallbackOnLocationHash - && opts.responseMode - && !validResponseMode(opts.responseMode)) { - warn("The responseMode option will be ignored. Its only valid value is \"form_post\"."); - } - - if (!this._providedCallbackOnLocationHash - && validResponseMode(opts.responseMode)) { - result = opts.responseMode; - } - - return result; -} - -function callbackOnLocationHashToResponseType(x) { - return x ? "token" : "code"; -} - -function validResponseType(str) { - if (typeof str !== "string") return false; - - var RESPONSE_TYPES = ["code", "id_token", "token"]; - var parts = str.split(" "); - - for (var i = 0; i < parts.length; i++) { - if (RESPONSE_TYPES.indexOf(parts[i]) === -1) return false; - } - - return parts.length >= 1; -} - -function validResponseMode(str) { - return str === "form_post"; -} - - -function warn(str) { - if (console && console.warn) { - console.warn(str); - } -} - -/** - * Expose `Auth0` constructor - */ - -module.exports = Auth0; - -},{"./lib/LoginError":3,"./lib/SilentAuthenticationHandler":4,"./lib/assert_required":5,"./lib/base64_url":6,"./lib/index-of":7,"./lib/is-array":8,"./lib/json-parse":9,"./lib/nonce-generator":10,"./lib/same-origin":11,"./lib/use_jsonp":12,"./version":36,"jsonp":17,"qs":22,"reqwest":26,"trim":27,"winchan":28,"xtend":30}],2:[function(require,module,exports){ -var IframeHandler = function (options) { - this.auth0 = options.auth0; - this.url = options.url; - this.callback = options.callback; - this.timeout = options.timeout || 60 * 1000; - this.timeoutCallback = options.timeoutCallback || null; - this.usePostMessage = options.usePostMessage || false; - this.iframe = null; - this.timeoutHandle = null; - this._destroyTimeout = null; - this.transientMessageEventListener = null; - this.transientEventListener = null; -} - -IframeHandler.prototype.init = function (url) { - this.iframe = document.createElement('iframe'); - this.iframe.style.display = "none"; - this.iframe.src = this.url; - - var _this = this; - - if (this.usePostMessage) { - - // Workaround to avoid using bind that does not work in IE8 - this.transientMessageEventListener = function(e) { - _this.messageEventListener(e); - }; - - window.addEventListener("message", this.transientMessageEventListener, false); - } - else { - - // Workaround to avoid using bind that does not work in IE8 - this.transientEventListener = function() { - _this.loadEventListener(); - }; - - this.iframe.addEventListener("load", this.transientEventListener, false); - } - - document.body.appendChild(this.iframe); - - this.timeoutHandle = setTimeout(function() { - _this.timeoutHandler(); - }, this.timeout); -} - -IframeHandler.prototype.messageEventListener = function (e) { - this.callbackHandler(e.data); - - this.destroy() -} - -IframeHandler.prototype.loadEventListener = function () { - var result = this.auth0.parseHash(this.iframe.contentWindow.location.hash); - - if (!result) return; - - this.callbackHandler(result); - - this.destroy(); -} - -IframeHandler.prototype.callbackHandler = function (result) { - var error = null; - - if (result.error) { - error = result; - result = null; - } - - this.callback(error, result); -} - -IframeHandler.prototype.timeoutHandler = function () { - if (this.timeoutCallback) { - this.timeoutCallback(); - } - this.destroy(); -} -IframeHandler.prototype.destroy = function () { - var _this = this; - - if (this.timeoutHandle) { - clearTimeout(this.timeoutHandle); - } - - this._destroyTimeout = setTimeout(function () { - if (_this.usePostMessage) { - window.removeEventListener("message", _this.transientMessageEventListener, false); - } - else { - _this.iframe.removeEventListener("load", _this.transientEventListener, false); - } - document.body.removeChild(_this.iframe) - }, 0); -} - - -module.exports = IframeHandler; -},{}],3:[function(require,module,exports){ -/** - * Module dependencies. - */ - -var json_parse = require('./json-parse'); - -/** - * Expose `LoginError` - */ - -module.exports = LoginError; - -/** - * Create a `LoginError` by extend of `Error` - * - * @param {Number} status - * @param {String} details - * @public - */ - -function LoginError(status, details) { - var obj; - - if (typeof details == 'string') { - try { - obj = json_parse(details); - } catch (er) { - obj = { message: details }; - } - } else { - obj = details || { description: 'server error' }; - } - - if (!obj.code) { - obj.code = obj.error; - } - - if ('unauthorized' === obj.code) { - status = 401; - } - - var message = obj.description || obj.message || obj.error; - - if ('PasswordStrengthError' === obj.name) { - message = "Password is not strong enough."; - } - - var err = Error.call(this, message); - - err.status = status; - err.name = obj.code; - err.code = obj.code; - err.details = obj; - - if (status === 0) { - if (!err.code || err.code !== 'offline') { - err.code = 'Unknown'; - err.message = 'Unknown error.'; - } - } - - return err; -} - -/** - * Extend `LoginError.prototype` with `Error.prototype` - * and `LoginError` as constructor - */ - -if (Object && Object.create) { - LoginError.prototype = Object.create(Error.prototype, { - constructor: { value: LoginError } - }); -} - -},{"./json-parse":9}],4:[function(require,module,exports){ -var IframeHandler = require('./IframeHandler'); - -var SilentAuthenticationHandler = function (auth0, authenticationUrl, timeout) { - - this.auth0 = auth0; - this.authenticationUrl = authenticationUrl; - this.timeout = timeout || 60 * 1000; - this.handler = null; - -} - -SilentAuthenticationHandler.prototype.timeoutCallback = function () { - - console.error('Timeout during silent authentication.') - -} - -SilentAuthenticationHandler.prototype.login = function (callback, usePostMessage) { - - this.handler = new IframeHandler({ - auth0:this.auth0, - url: this.authenticationUrl, - callback: callback, - timeout: this.timeout, - timeoutCallback: this.timeoutCallback, - usePostMessage: usePostMessage || false - }); - - this.handler.init(); - -} - - -module.exports = SilentAuthenticationHandler; -},{"./IframeHandler":2}],5:[function(require,module,exports){ -/** - * Expose `required` - */ - -module.exports = required; - -/** - * Assert `prop` as requirement of `obj` - * - * @param {Object} obj - * @param {prop} prop - * @public - */ - -function required (obj, prop) { - if (!obj[prop]) { - throw new Error(prop + ' is required.'); - } -} - -},{}],6:[function(require,module,exports){ -/** - * Module dependencies. - */ - -var Base64 = require('Base64'); - -/** - * Expose `base64_url_decode` - */ - -module.exports = { - encode: encode, - decode: decode -}; - -/** - * Encode a `base64` `encodeURIComponent` string - * - * @param {string} str - * @public - */ - -function encode(str) { - return Base64.btoa(str) - .replace(/\+/g, '-') // Convert '+' to '-' - .replace(/\//g, '_') // Convert '/' to '_' - .replace(/=+$/, ''); // Remove ending '=' -} - -/** - * Decode a `base64` `encodeURIComponent` string - * - * @param {string} str - * @public - */ - -function decode(str) { - // Add removed at end '=' - str += Array(5 - str.length % 4).join('='); - - str = str - .replace(/\-/g, '+') // Convert '-' to '+' - .replace(/\_/g, '/'); // Convert '_' to '/' - - return Base64.atob(str); -} -},{"Base64":13}],7:[function(require,module,exports){ -/** - * Resolve `isArray` as native or fallback - */ - -module.exports = Array.prototype.indexOf - ? nativeIndexOf - : polyfillIndexOf; - - -function nativeIndexOf(array, searchElement, fromIndex) { - return array.indexOf(searchElement, fromIndex); -} - - -function polyfillIndexOf(array, searchElement, fromIndex) { - // Production steps of ECMA-262, Edition 5, 15.4.4.14 - // Reference: http://es5.github.io/#x15.4.4.14 - - var k; - - // 1. Let O be the result of calling ToObject passing - // the array value as the argument. - if (array == null) { - throw new TypeError('"array" is null or not defined'); - } - - var O = Object(array); - - // 2. Let lenValue be the result of calling the Get - // internal method of O with the argument "length". - // 3. Let len be ToUint32(lenValue). - var len = O.length >>> 0; - - // 4. If len is 0, return -1. - if (len === 0) { - return -1; - } - - // 5. If argument fromIndex was passed let n be - // ToInteger(fromIndex); else let n be 0. - var n = +fromIndex || 0; - - if (Math.abs(n) === Infinity) { - n = 0; - } - - // 6. If n >= len, return -1. - if (n >= len) { - return -1; - } - - // 7. If n >= 0, then Let k be n. - // 8. Else, n<0, Let k be len - abs(n). - // If k is less than 0, then let k be 0. - k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); - - // 9. Repeat, while k < len - while (k < len) { - // a. Let Pk be ToString(k). - // This is implicit for LHS operands of the in operator - // b. Let kPresent be the result of calling the - // HasProperty internal method of O with argument Pk. - // This step can be combined with c - // c. If kPresent is true, then - // i. Let elementK be the result of calling the Get - // internal method of O with the argument ToString(k). - // ii. Let same be the result of applying the - // Strict Equality Comparison Algorithm to - // searchElement and elementK. - // iii. If same is true, return k. - if (k in O && O[k] === searchElement) { - return k; - } - k++; - } - return -1; -}; - -},{}],8:[function(require,module,exports){ -/** - * Module dependencies. - */ - -var toString = Object.prototype.toString; - -/** - * Resolve `isArray` as native or fallback - */ - -module.exports = null != Array.isArray - ? Array.isArray - : isArray; - -/** - * Wrap `Array.isArray` Polyfill for IE9 - * source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray - * - * @param {Array} array - * @public - */ - -function isArray (array) { - return toString.call(array) === '[object Array]'; -}; - -},{}],9:[function(require,module,exports){ -/** - * Expose `JSON.parse` method or fallback if not - * exists on `window` - */ - -module.exports = 'undefined' === typeof JSON - ? require('json-fallback').parse - : JSON.parse; - -},{"json-fallback":16}],10:[function(require,module,exports){ -function randomString(length) { - var bytes = new Uint8Array(length); - var cryptoObj = window.crypto || window.msCrypto; - - if (!cryptoObj) { - return null; - } - - var random = cryptoObj.getRandomValues(bytes); - var result = []; - var charset = '0123456789ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvwxyz-._~'; - random.forEach(function (c) { - result.push(charset[c % charset.length]); - }); - return result.join(''); -} - -module.exports = { - randomString: randomString -}; -},{}],11:[function(require,module,exports){ -/** - * Check for same origin policy - */ - -module.exports = same_origin; - -function same_origin (tprotocol, tdomain, tport) { - var protocol = window.location.protocol; - var domain = window.location.hostname; - var port = window.location.port; - - tport = tport || ''; - return protocol === tprotocol && domain === tdomain && port === tport; -} - -},{}],12:[function(require,module,exports){ -/** - * Expose `use_jsonp` - */ - -module.exports = use_jsonp; - -/** - * Return true if `jsonp` is required - * - * @return {Boolean} - * @public - */ - -function use_jsonp() { - var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : null; - - if (xhr && 'withCredentials' in xhr) { - return false; - } - - // We no longer support XDomainRequest for IE8 and IE9 for CORS because it has many quirks. - // if ('XDomainRequest' in window && window.location.protocol === 'https:') { - // return false; - // } - - return true; -} -},{}],13:[function(require,module,exports){ -;(function () { - - var - object = typeof exports != 'undefined' ? exports : this, // #8: web workers - chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=', - INVALID_CHARACTER_ERR = (function () { - // fabricate a suitable error object - try { document.createElement('$'); } - catch (error) { return error; }}()); - - // encoder - // [https://gist.github.com/999166] by [https://github.com/nignag] - object.btoa || ( - object.btoa = function (input) { - for ( - // initialize result and counter - var block, charCode, idx = 0, map = chars, output = ''; - // if the next input index does not exist: - // change the mapping table to "=" - // check if d has no fractional digits - input.charAt(idx | 0) || (map = '=', idx % 1); - // "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8 - output += map.charAt(63 & block >> 8 - idx % 1 * 8) - ) { - charCode = input.charCodeAt(idx += 3/4); - if (charCode > 0xFF) throw INVALID_CHARACTER_ERR; - block = block << 8 | charCode; - } - return output; - }); - - // decoder - // [https://gist.github.com/1020396] by [https://github.com/atk] - object.atob || ( - object.atob = function (input) { - input = input.replace(/=+$/, '') - if (input.length % 4 == 1) throw INVALID_CHARACTER_ERR; - for ( - // initialize result and counters - var bc = 0, bs, buffer, idx = 0, output = ''; - // get next character - buffer = input.charAt(idx++); - // character found in table? initialize bit storage and add its ascii value; - ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, - // and if not first of each 4 characters, - // convert the first 8 bits to one ascii character - bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 - ) { - // try to find character in table (0-63, not found => -1) - buffer = chars.indexOf(buffer); - } - return output; - }); - -}()); - -},{}],14:[function(require,module,exports){ - -},{}],15:[function(require,module,exports){ -// shim for using process in browser - -var process = module.exports = {}; - -process.nextTick = (function () { - var canSetImmediate = typeof window !== 'undefined' - && window.setImmediate; - var canPost = typeof window !== 'undefined' - && window.postMessage && window.addEventListener - ; - - if (canSetImmediate) { - return function (f) { return window.setImmediate(f) }; - } - - if (canPost) { - var queue = []; - window.addEventListener('message', function (ev) { - var source = ev.source; - if ((source === window || source === null) && ev.data === 'process-tick') { - ev.stopPropagation(); - if (queue.length > 0) { - var fn = queue.shift(); - fn(); - } - } - }, true); - - return function nextTick(fn) { - queue.push(fn); - window.postMessage('process-tick', '*'); - }; - } - - return function nextTick(fn) { - setTimeout(fn, 0); - }; -})(); - -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -} - -// TODO(shtylman) -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; - -},{}],16:[function(require,module,exports){ -/* - json2.js - 2011-10-19 - - 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, regexp: true */ - -/*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) { - if (typeof rep[i] === 'string') { - k = rep[i]; - 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.prototype.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.prototype.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'); - }; - } -}()); - -module.exports = JSON -},{}],17:[function(require,module,exports){ -/** - * Module dependencies - */ - -var debug = require('debug')('jsonp'); - -/** - * Module exports. - */ - -module.exports = jsonp; - -/** - * Callback index. - */ - -var count = 0; - -/** - * Noop function. - */ - -function noop(){} - -/** - * JSONP handler - * - * Options: - * - param {String} qs parameter (`callback`) - * - timeout {Number} how long after a timeout error is emitted (`60000`) - * - * @param {String} url - * @param {Object|Function} optional options / callback - * @param {Function} optional callback - */ - -function jsonp(url, opts, fn){ - if ('function' == typeof opts) { - fn = opts; - opts = {}; - } - if (!opts) opts = {}; - - var prefix = opts.prefix || '__jp'; - var param = opts.param || 'callback'; - var timeout = null != opts.timeout ? opts.timeout : 60000; - var enc = encodeURIComponent; - var target = document.getElementsByTagName('script')[0] || document.head; - var script; - var timer; - - // generate a unique id for this request - var id = prefix + (count++); - - if (timeout) { - timer = setTimeout(function(){ - cleanup(); - if (fn) fn(new Error('Timeout')); - }, timeout); - } - - function cleanup(){ - script.parentNode.removeChild(script); - window[id] = noop; - } - - window[id] = function(data){ - debug('jsonp got', data); - if (timer) clearTimeout(timer); - cleanup(); - if (fn) fn(null, data); - }; - - // add qs component - url += (~url.indexOf('?') ? '&' : '?') + param + '=' + enc(id); - url = url.replace('?&', '?'); - - debug('jsonp req "%s"', url); - - // create script - script = document.createElement('script'); - script.src = url; - target.parentNode.insertBefore(script, target); -} - -},{"debug":19}],18:[function(require,module,exports){ -/** - * Helpers. - */ - -var s = 1000 -var m = s * 60 -var h = m * 60 -var d = h * 24 -var y = d * 365.25 - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} options - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - -module.exports = function (val, options) { - options = options || {} - var type = typeof val - if (type === 'string' && val.length > 0) { - return parse(val) - } else if (type === 'number' && isNaN(val) === false) { - return options.long ? - fmtLong(val) : - fmtShort(val) - } - throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)) -} - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = String(str) - if (str.length > 10000) { - return - } - var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str) - if (!match) { - return - } - var n = parseFloat(match[1]) - var type = (match[2] || 'ms').toLowerCase() - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y - case 'days': - case 'day': - case 'd': - return n * d - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n - default: - return undefined - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtShort(ms) { - if (ms >= d) { - return Math.round(ms / d) + 'd' - } - if (ms >= h) { - return Math.round(ms / h) + 'h' - } - if (ms >= m) { - return Math.round(ms / m) + 'm' - } - if (ms >= s) { - return Math.round(ms / s) + 's' - } - return ms + 'ms' -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtLong(ms) { - return plural(ms, d, 'day') || - plural(ms, h, 'hour') || - plural(ms, m, 'minute') || - plural(ms, s, 'second') || - ms + ' ms' -} - -/** - * Pluralization helper. - */ - -function plural(ms, n, name) { - if (ms < n) { - return - } - if (ms < n * 1.5) { - return Math.floor(ms / n) + ' ' + name - } - return Math.ceil(ms / n) + ' ' + name + 's' -} - -},{}],19:[function(require,module,exports){ -var process=require("__browserify_process");/** - * This is the web browser implementation of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = require('./debug'); -exports.log = log; -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = 'undefined' != typeof chrome - && 'undefined' != typeof chrome.storage - ? chrome.storage.local - : localstorage(); - -/** - * Colors. - */ - -exports.colors = [ - 'lightseagreen', - 'forestgreen', - 'goldenrod', - 'dodgerblue', - 'darkorchid', - 'crimson' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window && typeof window.process !== 'undefined' && window.process.type === 'renderer') { - return true; - } - - // is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - return (typeof document !== 'undefined' && document && 'WebkitAppearance' in document.documentElement.style) || - // is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window && window.console && (console.firebug || (console.exception && console.table))) || - // is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || - // double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); -} - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -exports.formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (err) { - return '[UnexpectedJSONParseError]: ' + err.message; - } -}; - - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs(args) { - var useColors = this.useColors; - - args[0] = (useColors ? '%c' : '') - + this.namespace - + (useColors ? ' %c' : ' ') - + args[0] - + (useColors ? '%c ' : ' ') - + '+' + exports.humanize(this.diff); - - if (!useColors) return; - - var c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit') - - // the final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - var index = 0; - var lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, function(match) { - if ('%%' === match) return; - index++; - if ('%c' === match) { - // we only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); -} - -/** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". - * - * @api public - */ - -function log() { - // this hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return 'object' === typeof console - && console.log - && Function.prototype.apply.call(console.log, console, arguments); -} - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ - -function save(namespaces) { - try { - if (null == namespaces) { - exports.storage.removeItem('debug'); - } else { - exports.storage.debug = namespaces; - } - } catch(e) {} -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ - -function load() { - try { - return exports.storage.debug; - } catch(e) {} - - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if (typeof process !== 'undefined' && 'env' in process) { - return process.env.DEBUG; - } -} - -/** - * Enable namespaces listed in `localStorage.debug` initially. - */ - -exports.enable(load()); - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage() { - try { - return window.localStorage; - } catch (e) {} -} - -},{"./debug":20,"__browserify_process":15}],20:[function(require,module,exports){ - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - * - * Expose `debug()` as the module. - */ - -exports = module.exports = createDebug.debug = createDebug.default = createDebug; -exports.coerce = coerce; -exports.disable = disable; -exports.enable = enable; -exports.enabled = enabled; -exports.humanize = require('ms'); - -/** - * The currently active debug mode names, and names to skip. - */ - -exports.names = []; -exports.skips = []; - -/** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - -exports.formatters = {}; - -/** - * Previous log timestamp. - */ - -var prevTime; - -/** - * Select a color. - * @param {String} namespace - * @return {Number} - * @api private - */ - -function selectColor(namespace) { - var hash = 0, i; - - for (i in namespace) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } - - return exports.colors[Math.abs(hash) % exports.colors.length]; -} - -/** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - -function createDebug(namespace) { - - function debug() { - // disabled? - if (!debug.enabled) return; - - var self = debug; - - // set `diff` timestamp - var curr = +new Date(); - var ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - // turn the `arguments` into a proper Array - var args = new Array(arguments.length); - for (var i = 0; i < args.length; i++) { - args[i] = arguments[i]; - } - - args[0] = exports.coerce(args[0]); - - if ('string' !== typeof args[0]) { - // anything else let's inspect with %O - args.unshift('%O'); - } - - // apply any `formatters` transformations - var index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) { - // if we encounter an escaped % then don't increase the array index - if (match === '%%') return match; - index++; - var formatter = exports.formatters[format]; - if ('function' === typeof formatter) { - var val = args[index]; - match = formatter.call(self, val); - - // now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - // apply env-specific formatting (colors, etc.) - exports.formatArgs.call(self, args); - - var logFn = debug.log || exports.log || console.log.bind(console); - logFn.apply(self, args); - } - - debug.namespace = namespace; - debug.enabled = exports.enabled(namespace); - debug.useColors = exports.useColors(); - debug.color = selectColor(namespace); - - // env-specific initialization logic for debug instances - if ('function' === typeof exports.init) { - exports.init(debug); - } - - return debug; -} - -/** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - -function enable(namespaces) { - exports.save(namespaces); - - var split = (namespaces || '').split(/[\s,]+/); - var len = split.length; - - for (var i = 0; i < len; i++) { - if (!split[i]) continue; // ignore empty strings - namespaces = split[i].replace(/\*/g, '.*?'); - if (namespaces[0] === '-') { - exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - exports.names.push(new RegExp('^' + namespaces + '$')); - } - } -} - -/** - * Disable debug output. - * - * @api public - */ - -function disable() { - exports.enable(''); -} - -/** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - -function enabled(name) { - var i, len; - for (i = 0, len = exports.skips.length; i < len; i++) { - if (exports.skips[i].test(name)) { - return false; - } - } - for (i = 0, len = exports.names.length; i < len; i++) { - if (exports.names[i].test(name)) { - return true; - } - } - return false; -} - -/** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - -function coerce(val) { - if (val instanceof Error) return val.stack || val.message; - return val; -} - -},{"ms":18}],21:[function(require,module,exports){ -'use strict'; - -var replace = String.prototype.replace; -var percentTwenties = /%20/g; - -module.exports = { - 'default': 'RFC3986', - formatters: { - RFC1738: function (value) { - return replace.call(value, percentTwenties, '+'); - }, - RFC3986: function (value) { - return value; - } - }, - RFC1738: 'RFC1738', - RFC3986: 'RFC3986' -}; - -},{}],22:[function(require,module,exports){ -'use strict'; - -var stringify = require('./stringify'); -var parse = require('./parse'); -var formats = require('./formats'); - -module.exports = { - formats: formats, - parse: parse, - stringify: stringify -}; - -},{"./formats":21,"./parse":23,"./stringify":24}],23:[function(require,module,exports){ -'use strict'; - -var utils = require('./utils'); - -var has = Object.prototype.hasOwnProperty; - -var defaults = { - allowDots: false, - allowPrototypes: false, - arrayLimit: 20, - decoder: utils.decode, - delimiter: '&', - depth: 5, - parameterLimit: 1000, - plainObjects: false, - strictNullHandling: false -}; - -var parseValues = function parseValues(str, options) { - var obj = {}; - var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit); - - for (var i = 0; i < parts.length; ++i) { - var part = parts[i]; - var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1; - - var key, val; - if (pos === -1) { - key = options.decoder(part); - val = options.strictNullHandling ? null : ''; - } else { - key = options.decoder(part.slice(0, pos)); - val = options.decoder(part.slice(pos + 1)); - } - if (has.call(obj, key)) { - obj[key] = [].concat(obj[key]).concat(val); - } else { - obj[key] = val; - } - } - - return obj; -}; - -var parseObject = function parseObject(chain, val, options) { - if (!chain.length) { - return val; - } - - var root = chain.shift(); - - var obj; - if (root === '[]') { - obj = []; - obj = obj.concat(parseObject(chain, val, options)); - } else { - obj = options.plainObjects ? Object.create(null) : {}; - var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root; - var index = parseInt(cleanRoot, 10); - if ( - !isNaN(index) && - root !== cleanRoot && - String(index) === cleanRoot && - index >= 0 && - (options.parseArrays && index <= options.arrayLimit) - ) { - obj = []; - obj[index] = parseObject(chain, val, options); - } else { - obj[cleanRoot] = parseObject(chain, val, options); - } - } - - return obj; -}; - -var parseKeys = function parseKeys(givenKey, val, options) { - if (!givenKey) { - return; - } - - // Transform dot notation to bracket notation - var key = options.allowDots ? givenKey.replace(/\.([^\.\[]+)/g, '[$1]') : givenKey; - - // The regex chunks - - var parent = /^([^\[\]]*)/; - var child = /(\[[^\[\]]*\])/g; - - // Get the parent - - var segment = parent.exec(key); - - // Stash the parent if it exists - - var keys = []; - if (segment[1]) { - // If we aren't using plain objects, optionally prefix keys - // that would overwrite object prototype properties - if (!options.plainObjects && has.call(Object.prototype, segment[1])) { - if (!options.allowPrototypes) { - return; - } - } - - keys.push(segment[1]); - } - - // Loop through children appending to the array until we hit depth - - var i = 0; - while ((segment = child.exec(key)) !== null && i < options.depth) { - i += 1; - if (!options.plainObjects && has.call(Object.prototype, segment[1].replace(/\[|\]/g, ''))) { - if (!options.allowPrototypes) { - continue; - } - } - keys.push(segment[1]); - } - - // If there's a remainder, just add whatever is left - - if (segment) { - keys.push('[' + key.slice(segment.index) + ']'); - } - - return parseObject(keys, val, options); -}; - -module.exports = function (str, opts) { - var options = opts || {}; - - if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { - throw new TypeError('Decoder has to be a function.'); - } - - options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; - options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; - options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; - options.parseArrays = options.parseArrays !== false; - options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; - options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; - options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; - options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; - options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; - options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; - - if (str === '' || str === null || typeof str === 'undefined') { - return options.plainObjects ? Object.create(null) : {}; - } - - var tempObj = typeof str === 'string' ? parseValues(str, options) : str; - var obj = options.plainObjects ? Object.create(null) : {}; - - // Iterate over the keys and setup the new object - - var keys = Object.keys(tempObj); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - var newObj = parseKeys(key, tempObj[key], options); - obj = utils.merge(obj, newObj, options); - } - - return utils.compact(obj); -}; - -},{"./utils":25}],24:[function(require,module,exports){ -'use strict'; - -var utils = require('./utils'); -var formats = require('./formats'); - -var arrayPrefixGenerators = { - brackets: function brackets(prefix) { - return prefix + '[]'; - }, - indices: function indices(prefix, key) { - return prefix + '[' + key + ']'; - }, - repeat: function repeat(prefix) { - return prefix; - } -}; - -var toISO = Date.prototype.toISOString; - -var defaults = { - delimiter: '&', - encode: true, - encoder: utils.encode, - serializeDate: function serializeDate(date) { - return toISO.call(date); - }, - skipNulls: false, - strictNullHandling: false -}; - -var stringify = function stringify(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots, serializeDate, formatter) { - var obj = object; - if (typeof filter === 'function') { - obj = filter(prefix, obj); - } else if (obj instanceof Date) { - obj = serializeDate(obj); - } else if (obj === null) { - if (strictNullHandling) { - return encoder ? encoder(prefix) : prefix; - } - - obj = ''; - } - - if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) { - if (encoder) { - return [formatter(encoder(prefix)) + '=' + formatter(encoder(obj))]; - } - return [formatter(prefix) + '=' + formatter(String(obj))]; - } - - var values = []; - - if (typeof obj === 'undefined') { - return values; - } - - var objKeys; - if (Array.isArray(filter)) { - objKeys = filter; - } else { - var keys = Object.keys(obj); - objKeys = sort ? keys.sort(sort) : keys; - } - - for (var i = 0; i < objKeys.length; ++i) { - var key = objKeys[i]; - - if (skipNulls && obj[key] === null) { - continue; - } - - if (Array.isArray(obj)) { - values = values.concat(stringify( - obj[key], - generateArrayPrefix(prefix, key), - generateArrayPrefix, - strictNullHandling, - skipNulls, - encoder, - filter, - sort, - allowDots, - serializeDate, - formatter - )); - } else { - values = values.concat(stringify( - obj[key], - prefix + (allowDots ? '.' + key : '[' + key + ']'), - generateArrayPrefix, - strictNullHandling, - skipNulls, - encoder, - filter, - sort, - allowDots, - serializeDate, - formatter - )); - } - } - - return values; -}; - -module.exports = function (object, opts) { - var obj = object; - var options = opts || {}; - var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; - var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; - var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; - var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; - var encoder = encode ? (typeof options.encoder === 'function' ? options.encoder : defaults.encoder) : null; - var sort = typeof options.sort === 'function' ? options.sort : null; - var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; - var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate; - if (typeof options.format === 'undefined') { - options.format = formats.default; - } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) { - throw new TypeError('Unknown format option provided.'); - } - var formatter = formats.formatters[options.format]; - var objKeys; - var filter; - - if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { - throw new TypeError('Encoder has to be a function.'); - } - - if (typeof options.filter === 'function') { - filter = options.filter; - obj = filter('', obj); - } else if (Array.isArray(options.filter)) { - filter = options.filter; - objKeys = filter; - } - - var keys = []; - - if (typeof obj !== 'object' || obj === null) { - return ''; - } - - var arrayFormat; - if (options.arrayFormat in arrayPrefixGenerators) { - arrayFormat = options.arrayFormat; - } else if ('indices' in options) { - arrayFormat = options.indices ? 'indices' : 'repeat'; - } else { - arrayFormat = 'indices'; - } - - var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; - - if (!objKeys) { - objKeys = Object.keys(obj); - } - - if (sort) { - objKeys.sort(sort); - } - - for (var i = 0; i < objKeys.length; ++i) { - var key = objKeys[i]; - - if (skipNulls && obj[key] === null) { - continue; - } - - keys = keys.concat(stringify( - obj[key], - key, - generateArrayPrefix, - strictNullHandling, - skipNulls, - encoder, - filter, - sort, - allowDots, - serializeDate, - formatter - )); - } - - return keys.join(delimiter); -}; - -},{"./formats":21,"./utils":25}],25:[function(require,module,exports){ -'use strict'; - -var has = Object.prototype.hasOwnProperty; - -var hexTable = (function () { - var array = []; - for (var i = 0; i < 256; ++i) { - array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); - } - - return array; -}()); - -exports.arrayToObject = function (source, options) { - var obj = options && options.plainObjects ? Object.create(null) : {}; - for (var i = 0; i < source.length; ++i) { - if (typeof source[i] !== 'undefined') { - obj[i] = source[i]; - } - } - - return obj; -}; - -exports.merge = function (target, source, options) { - if (!source) { - return target; - } - - if (typeof source !== 'object') { - if (Array.isArray(target)) { - target.push(source); - } else if (typeof target === 'object') { - target[source] = true; - } else { - return [target, source]; - } - - return target; - } - - if (typeof target !== 'object') { - return [target].concat(source); - } - - var mergeTarget = target; - if (Array.isArray(target) && !Array.isArray(source)) { - mergeTarget = exports.arrayToObject(target, options); - } - - if (Array.isArray(target) && Array.isArray(source)) { - source.forEach(function (item, i) { - if (has.call(target, i)) { - if (target[i] && typeof target[i] === 'object') { - target[i] = exports.merge(target[i], item, options); - } else { - target.push(item); - } - } else { - target[i] = item; - } - }); - return target; - } - - return Object.keys(source).reduce(function (acc, key) { - var value = source[key]; - - if (Object.prototype.hasOwnProperty.call(acc, key)) { - acc[key] = exports.merge(acc[key], value, options); - } else { - acc[key] = value; - } - return acc; - }, mergeTarget); -}; - -exports.decode = function (str) { - try { - return decodeURIComponent(str.replace(/\+/g, ' ')); - } catch (e) { - return str; - } -}; - -exports.encode = function (str) { - // This code was originally written by Brian White (mscdex) for the io.js core querystring library. - // It has been adapted here for stricter adherence to RFC 3986 - if (str.length === 0) { - return str; - } - - var string = typeof str === 'string' ? str : String(str); - - var out = ''; - for (var i = 0; i < string.length; ++i) { - var c = string.charCodeAt(i); - - if ( - c === 0x2D || // - - c === 0x2E || // . - c === 0x5F || // _ - c === 0x7E || // ~ - (c >= 0x30 && c <= 0x39) || // 0-9 - (c >= 0x41 && c <= 0x5A) || // a-z - (c >= 0x61 && c <= 0x7A) // A-Z - ) { - out += string.charAt(i); - continue; - } - - if (c < 0x80) { - out = out + hexTable[c]; - continue; - } - - if (c < 0x800) { - out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); - continue; - } - - if (c < 0xD800 || c >= 0xE000) { - out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); - continue; - } - - i += 1; - c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); - out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; - } - - return out; -}; - -exports.compact = function (obj, references) { - if (typeof obj !== 'object' || obj === null) { - return obj; - } - - var refs = references || []; - var lookup = refs.indexOf(obj); - if (lookup !== -1) { - return refs[lookup]; - } - - refs.push(obj); - - if (Array.isArray(obj)) { - var compacted = []; - - for (var i = 0; i < obj.length; ++i) { - if (obj[i] && typeof obj[i] === 'object') { - compacted.push(exports.compact(obj[i], refs)); - } else if (typeof obj[i] !== 'undefined') { - compacted.push(obj[i]); - } - } - - return compacted; - } - - var keys = Object.keys(obj); - keys.forEach(function (key) { - obj[key] = exports.compact(obj[key], refs); - }); - - return obj; -}; - -exports.isRegExp = function (obj) { - return Object.prototype.toString.call(obj) === '[object RegExp]'; -}; - -exports.isBuffer = function (obj) { - if (obj === null || typeof obj === 'undefined') { - return false; - } - - return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); -}; - -},{}],26:[function(require,module,exports){ -/*! - * Reqwest! A general purpose XHR connection manager - * license MIT (c) Dustin Diaz 2015 - * https://github.com/ded/reqwest - */ - -!function (name, context, definition) { - if (typeof module != 'undefined' && module.exports) module.exports = definition() - else if (typeof define == 'function' && define.amd) define(definition) - else context[name] = definition() -}('reqwest', this, function () { - - var context = this - - if ('window' in context) { - var doc = document - , byTag = 'getElementsByTagName' - , head = doc[byTag]('head')[0] - } else { - var XHR2 - try { - XHR2 = require('xhr2') - } catch (ex) { - throw new Error('Peer dependency `xhr2` required! Please npm install xhr2') - } - } - - - var httpsRe = /^http/ - , protocolRe = /(^\w+):\/\// - , twoHundo = /^(20\d|1223)$/ //http://stackoverflow.com/questions/10046972/msie-returns-status-code-of-1223-for-ajax-request - , readyState = 'readyState' - , contentType = 'Content-Type' - , requestedWith = 'X-Requested-With' - , uniqid = 0 - , callbackPrefix = 'reqwest_' + (+new Date()) - , lastValue // data stored by the most recent JSONP callback - , xmlHttpRequest = 'XMLHttpRequest' - , xDomainRequest = 'XDomainRequest' - , noop = function () {} - - , isArray = typeof Array.isArray == 'function' - ? Array.isArray - : function (a) { - return a instanceof Array - } - - , defaultHeaders = { - 'contentType': 'application/x-www-form-urlencoded' - , 'requestedWith': xmlHttpRequest - , 'accept': { - '*': 'text/javascript, text/html, application/xml, text/xml, */*' - , 'xml': 'application/xml, text/xml' - , 'html': 'text/html' - , 'text': 'text/plain' - , 'json': 'application/json, text/javascript' - , 'js': 'application/javascript, text/javascript' - } - } - - , xhr = function(o) { - // is it x-domain - if (o['crossOrigin'] === true) { - var xhr = context[xmlHttpRequest] ? new XMLHttpRequest() : null - if (xhr && 'withCredentials' in xhr) { - return xhr - } else if (context[xDomainRequest]) { - return new XDomainRequest() - } else { - throw new Error('Browser does not support cross-origin requests') - } - } else if (context[xmlHttpRequest]) { - return new XMLHttpRequest() - } else if (XHR2) { - return new XHR2() - } else { - return new ActiveXObject('Microsoft.XMLHTTP') - } - } - , globalSetupOptions = { - dataFilter: function (data) { - return data - } - } - - function succeed(r) { - var protocol = protocolRe.exec(r.url) - protocol = (protocol && protocol[1]) || context.location.protocol - return httpsRe.test(protocol) ? twoHundo.test(r.request.status) : !!r.request.response - } - - function handleReadyState(r, success, error) { - return function () { - // use _aborted to mitigate against IE err c00c023f - // (can't read props on aborted request objects) - if (r._aborted) return error(r.request) - if (r._timedOut) return error(r.request, 'Request is aborted: timeout') - if (r.request && r.request[readyState] == 4) { - r.request.onreadystatechange = noop - if (succeed(r)) success(r.request) - else - error(r.request) - } - } - } - - function setHeaders(http, o) { - var headers = o['headers'] || {} - , h - - headers['Accept'] = headers['Accept'] - || defaultHeaders['accept'][o['type']] - || defaultHeaders['accept']['*'] - - var isAFormData = typeof FormData !== 'undefined' && (o['data'] instanceof FormData); - // breaks cross-origin requests with legacy browsers - if (!o['crossOrigin'] && !headers[requestedWith]) headers[requestedWith] = defaultHeaders['requestedWith'] - if (!headers[contentType] && !isAFormData) headers[contentType] = o['contentType'] || defaultHeaders['contentType'] - for (h in headers) - headers.hasOwnProperty(h) && 'setRequestHeader' in http && http.setRequestHeader(h, headers[h]) - } - - function setCredentials(http, o) { - if (typeof o['withCredentials'] !== 'undefined' && typeof http.withCredentials !== 'undefined') { - http.withCredentials = !!o['withCredentials'] - } - } - - function generalCallback(data) { - lastValue = data - } - - function urlappend (url, s) { - return url + (/\?/.test(url) ? '&' : '?') + s - } - - function handleJsonp(o, fn, err, url) { - var reqId = uniqid++ - , cbkey = o['jsonpCallback'] || 'callback' // the 'callback' key - , cbval = o['jsonpCallbackName'] || reqwest.getcallbackPrefix(reqId) - , cbreg = new RegExp('((^|\\?|&)' + cbkey + ')=([^&]+)') - , match = url.match(cbreg) - , script = doc.createElement('script') - , loaded = 0 - , isIE10 = navigator.userAgent.indexOf('MSIE 10.0') !== -1 - - if (match) { - if (match[3] === '?') { - url = url.replace(cbreg, '$1=' + cbval) // wildcard callback func name - } else { - cbval = match[3] // provided callback func name - } - } else { - url = urlappend(url, cbkey + '=' + cbval) // no callback details, add 'em - } - - context[cbval] = generalCallback - - script.type = 'text/javascript' - script.src = url - script.async = true - if (typeof script.onreadystatechange !== 'undefined' && !isIE10) { - // need this for IE due to out-of-order onreadystatechange(), binding script - // execution to an event listener gives us control over when the script - // is executed. See http://jaubourg.net/2010/07/loading-script-as-onclick-handler-of.html - script.htmlFor = script.id = '_reqwest_' + reqId - } - - script.onload = script.onreadystatechange = function () { - if ((script[readyState] && script[readyState] !== 'complete' && script[readyState] !== 'loaded') || loaded) { - return false - } - script.onload = script.onreadystatechange = null - script.onclick && script.onclick() - // Call the user callback with the last value stored and clean up values and scripts. - fn(lastValue) - lastValue = undefined - head.removeChild(script) - loaded = 1 - } - - // Add the script to the DOM head - head.appendChild(script) - - // Enable JSONP timeout - return { - abort: function () { - script.onload = script.onreadystatechange = null - err({}, 'Request is aborted: timeout', {}) - lastValue = undefined - head.removeChild(script) - loaded = 1 - } - } - } - - function getRequest(fn, err) { - var o = this.o - , method = (o['method'] || 'GET').toUpperCase() - , url = typeof o === 'string' ? o : o['url'] - // convert non-string objects to query-string form unless o['processData'] is false - , data = (o['processData'] !== false && o['data'] && typeof o['data'] !== 'string') - ? reqwest.toQueryString(o['data']) - : (o['data'] || null) - , http - , sendWait = false - - // if we're working on a GET request and we have data then we should append - // query string to end of URL and not post data - if ((o['type'] == 'jsonp' || method == 'GET') && data) { - url = urlappend(url, data) - data = null - } - - if (o['type'] == 'jsonp') return handleJsonp(o, fn, err, url) - - // get the xhr from the factory if passed - // if the factory returns null, fall-back to ours - http = (o.xhr && o.xhr(o)) || xhr(o) - - http.open(method, url, o['async'] === false ? false : true) - setHeaders(http, o) - setCredentials(http, o) - if (context[xDomainRequest] && http instanceof context[xDomainRequest]) { - http.onload = fn - http.onerror = err - // NOTE: see - // http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/30ef3add-767c-4436-b8a9-f1ca19b4812e - http.onprogress = function() {} - sendWait = true - } else { - http.onreadystatechange = handleReadyState(this, fn, err) - } - o['before'] && o['before'](http) - if (sendWait) { - setTimeout(function () { - http.send(data) - }, 200) - } else { - http.send(data) - } - return http - } - - function Reqwest(o, fn) { - this.o = o - this.fn = fn - - init.apply(this, arguments) - } - - function setType(header) { - // json, javascript, text/plain, text/html, xml - if (header === null) return undefined; //In case of no content-type. - if (header.match('json')) return 'json' - if (header.match('javascript')) return 'js' - if (header.match('text')) return 'html' - if (header.match('xml')) return 'xml' - } - - function init(o, fn) { - - this.url = typeof o == 'string' ? o : o['url'] - this.timeout = null - - // whether request has been fulfilled for purpose - // of tracking the Promises - this._fulfilled = false - // success handlers - this._successHandler = function(){} - this._fulfillmentHandlers = [] - // error handlers - this._errorHandlers = [] - // complete (both success and fail) handlers - this._completeHandlers = [] - this._erred = false - this._responseArgs = {} - - var self = this - - fn = fn || function () {} - - if (o['timeout']) { - this.timeout = setTimeout(function () { - timedOut() - }, o['timeout']) - } - - if (o['success']) { - this._successHandler = function () { - o['success'].apply(o, arguments) - } - } - - if (o['error']) { - this._errorHandlers.push(function () { - o['error'].apply(o, arguments) - }) - } - - if (o['complete']) { - this._completeHandlers.push(function () { - o['complete'].apply(o, arguments) - }) - } - - function complete (resp) { - o['timeout'] && clearTimeout(self.timeout) - self.timeout = null - while (self._completeHandlers.length > 0) { - self._completeHandlers.shift()(resp) - } - } - - function success (resp) { - var type = o['type'] || resp && setType(resp.getResponseHeader('Content-Type')) // resp can be undefined in IE - resp = (type !== 'jsonp') ? self.request : resp - // use global data filter on response text - var filteredResponse = globalSetupOptions.dataFilter(resp.responseText, type) - , r = filteredResponse - try { - resp.responseText = r - } catch (e) { - // can't assign this in IE<=8, just ignore - } - if (r) { - switch (type) { - case 'json': - try { - resp = context.JSON ? context.JSON.parse(r) : eval('(' + r + ')') - } catch (err) { - return error(resp, 'Could not parse JSON in response', err) - } - break - case 'js': - resp = eval(r) - break - case 'html': - resp = r - break - case 'xml': - resp = resp.responseXML - && resp.responseXML.parseError // IE trololo - && resp.responseXML.parseError.errorCode - && resp.responseXML.parseError.reason - ? null - : resp.responseXML - break - } - } - - self._responseArgs.resp = resp - self._fulfilled = true - fn(resp) - self._successHandler(resp) - while (self._fulfillmentHandlers.length > 0) { - resp = self._fulfillmentHandlers.shift()(resp) - } - - complete(resp) - } - - function timedOut() { - self._timedOut = true - self.request.abort() - } - - function error(resp, msg, t) { - resp = self.request - self._responseArgs.resp = resp - self._responseArgs.msg = msg - self._responseArgs.t = t - self._erred = true - while (self._errorHandlers.length > 0) { - self._errorHandlers.shift()(resp, msg, t) - } - complete(resp) - } - - this.request = getRequest.call(this, success, error) - } - - Reqwest.prototype = { - abort: function () { - this._aborted = true - this.request.abort() - } - - , retry: function () { - init.call(this, this.o, this.fn) - } - - /** - * Small deviation from the Promises A CommonJs specification - * http://wiki.commonjs.org/wiki/Promises/A - */ - - /** - * `then` will execute upon successful requests - */ - , then: function (success, fail) { - success = success || function () {} - fail = fail || function () {} - if (this._fulfilled) { - this._responseArgs.resp = success(this._responseArgs.resp) - } else if (this._erred) { - fail(this._responseArgs.resp, this._responseArgs.msg, this._responseArgs.t) - } else { - this._fulfillmentHandlers.push(success) - this._errorHandlers.push(fail) - } - return this - } - - /** - * `always` will execute whether the request succeeds or fails - */ - , always: function (fn) { - if (this._fulfilled || this._erred) { - fn(this._responseArgs.resp) - } else { - this._completeHandlers.push(fn) - } - return this - } - - /** - * `fail` will execute when the request fails - */ - , fail: function (fn) { - if (this._erred) { - fn(this._responseArgs.resp, this._responseArgs.msg, this._responseArgs.t) - } else { - this._errorHandlers.push(fn) - } - return this - } - , 'catch': function (fn) { - return this.fail(fn) - } - } - - function reqwest(o, fn) { - return new Reqwest(o, fn) - } - - // normalize newline variants according to spec -> CRLF - function normalize(s) { - return s ? s.replace(/\r?\n/g, '\r\n') : '' - } - - function serial(el, cb) { - var n = el.name - , t = el.tagName.toLowerCase() - , optCb = function (o) { - // IE gives value="" even where there is no value attribute - // 'specified' ref: http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-862529273 - if (o && !o['disabled']) - cb(n, normalize(o['attributes']['value'] && o['attributes']['value']['specified'] ? o['value'] : o['text'])) - } - , ch, ra, val, i - - // don't serialize elements that are disabled or without a name - if (el.disabled || !n) return - - switch (t) { - case 'input': - if (!/reset|button|image|file/i.test(el.type)) { - ch = /checkbox/i.test(el.type) - ra = /radio/i.test(el.type) - val = el.value - // WebKit gives us "" instead of "on" if a checkbox has no value, so correct it here - ;(!(ch || ra) || el.checked) && cb(n, normalize(ch && val === '' ? 'on' : val)) - } - break - case 'textarea': - cb(n, normalize(el.value)) - break - case 'select': - if (el.type.toLowerCase() === 'select-one') { - optCb(el.selectedIndex >= 0 ? el.options[el.selectedIndex] : null) - } else { - for (i = 0; el.length && i < el.length; i++) { - el.options[i].selected && optCb(el.options[i]) - } - } - break - } - } - - // collect up all form elements found from the passed argument elements all - // the way down to child elements; pass a '
    ' or form fields. - // called with 'this'=callback to use for serial() on each element - function eachFormElement() { - var cb = this - , e, i - , serializeSubtags = function (e, tags) { - var i, j, fa - for (i = 0; i < tags.length; i++) { - fa = e[byTag](tags[i]) - for (j = 0; j < fa.length; j++) serial(fa[j], cb) - } - } - - for (i = 0; i < arguments.length; i++) { - e = arguments[i] - if (/input|select|textarea/i.test(e.tagName)) serial(e, cb) - serializeSubtags(e, [ 'input', 'select', 'textarea' ]) - } - } - - // standard query string style serialization - function serializeQueryString() { - return reqwest.toQueryString(reqwest.serializeArray.apply(null, arguments)) - } - - // { 'name': 'value', ... } style serialization - function serializeHash() { - var hash = {} - eachFormElement.apply(function (name, value) { - if (name in hash) { - hash[name] && !isArray(hash[name]) && (hash[name] = [hash[name]]) - hash[name].push(value) - } else hash[name] = value - }, arguments) - return hash - } - - // [ { name: 'name', value: 'value' }, ... ] style serialization - reqwest.serializeArray = function () { - var arr = [] - eachFormElement.apply(function (name, value) { - arr.push({name: name, value: value}) - }, arguments) - return arr - } - - reqwest.serialize = function () { - if (arguments.length === 0) return '' - var opt, fn - , args = Array.prototype.slice.call(arguments, 0) - - opt = args.pop() - opt && opt.nodeType && args.push(opt) && (opt = null) - opt && (opt = opt.type) - - if (opt == 'map') fn = serializeHash - else if (opt == 'array') fn = reqwest.serializeArray - else fn = serializeQueryString - - return fn.apply(null, args) - } - - reqwest.toQueryString = function (o, trad) { - var prefix, i - , traditional = trad || false - , s = [] - , enc = encodeURIComponent - , add = function (key, value) { - // If value is a function, invoke it and return its value - value = ('function' === typeof value) ? value() : (value == null ? '' : value) - s[s.length] = enc(key) + '=' + enc(value) - } - // If an array was passed in, assume that it is an array of form elements. - if (isArray(o)) { - for (i = 0; o && i < o.length; i++) add(o[i]['name'], o[i]['value']) - } else { - // If traditional, encode the "old" way (the way 1.3.2 or older - // did it), otherwise encode params recursively. - for (prefix in o) { - if (o.hasOwnProperty(prefix)) buildParams(prefix, o[prefix], traditional, add) - } - } - - // spaces should be + according to spec - return s.join('&').replace(/%20/g, '+') - } - - function buildParams(prefix, obj, traditional, add) { - var name, i, v - , rbracket = /\[\]$/ - - if (isArray(obj)) { - // Serialize array item. - for (i = 0; obj && i < obj.length; i++) { - v = obj[i] - if (traditional || rbracket.test(prefix)) { - // Treat each array item as a scalar. - add(prefix, v) - } else { - buildParams(prefix + '[' + (typeof v === 'object' ? i : '') + ']', v, traditional, add) - } - } - } else if (obj && obj.toString() === '[object Object]') { - // Serialize object item. - for (name in obj) { - buildParams(prefix + '[' + name + ']', obj[name], traditional, add) - } - - } else { - // Serialize scalar item. - add(prefix, obj) - } - } - - reqwest.getcallbackPrefix = function () { - return callbackPrefix - } - - // jQuery and Zepto compatibility, differences can be remapped here so you can call - // .ajax.compat(options, callback) - reqwest.compat = function (o, fn) { - if (o) { - o['type'] && (o['method'] = o['type']) && delete o['type'] - o['dataType'] && (o['type'] = o['dataType']) - o['jsonpCallback'] && (o['jsonpCallbackName'] = o['jsonpCallback']) && delete o['jsonpCallback'] - o['jsonp'] && (o['jsonpCallback'] = o['jsonp']) - } - return new Reqwest(o, fn) - } - - reqwest.ajaxSetup = function (options) { - options = options || {} - for (var k in options) { - globalSetupOptions[k] = options[k] - } - } - - return reqwest -}); - -},{"xhr2":14}],27:[function(require,module,exports){ - -exports = module.exports = trim; - -function trim(str){ - return str.replace(/^\s*|\s*$/g, ''); -} - -exports.left = function(str){ - return str.replace(/^\s*/, ''); -}; - -exports.right = function(str){ - return str.replace(/\s*$/, ''); -}; - -},{}],28:[function(require,module,exports){ -var WinChan = (function() { - var RELAY_FRAME_NAME = "__winchan_relay_frame"; - var CLOSE_CMD = "die"; - - // a portable addListener implementation - function addListener(w, event, cb) { - if(w.attachEvent) w.attachEvent('on' + event, cb); - else if (w.addEventListener) w.addEventListener(event, cb, false); - } - - // a portable removeListener implementation - function removeListener(w, event, cb) { - if(w.detachEvent) w.detachEvent('on' + event, cb); - else if (w.removeEventListener) w.removeEventListener(event, cb, false); - } - - - // checking for IE8 or above - function isInternetExplorer() { - if (typeof navigator === 'undefined') { - return false; - } - - var rv = -1; // Return value assumes failure. - var ua = navigator.userAgent; - if (navigator.appName === 'Microsoft Internet Explorer') { - var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})"); - if (re.exec(ua) != null) - rv = parseFloat(RegExp.$1); - } - // IE > 11 - else if (ua.indexOf("Trident") > -1) { - var re = new RegExp("rv:([0-9]{2,2}[\.0-9]{0,})"); - if (re.exec(ua) !== null) { - rv = parseFloat(RegExp.$1); - } - } - - return rv >= 8; - } - - // checking Mobile Firefox (Fennec) - function isFennec() { - try { - // We must check for both XUL and Java versions of Fennec. Both have - // distinct UA strings. - var userAgent = navigator.userAgent; - return (userAgent.indexOf('Fennec/') != -1) || // XUL - (userAgent.indexOf('Firefox/') != -1 && userAgent.indexOf('Android') != -1); // Java - } catch(e) {} - return false; - } - - // feature checking to see if this platform is supported at all - function isSupported() { - return (typeof window !== 'undefined' && window.JSON && window.JSON.stringify && - window.JSON.parse && window.postMessage); - } - - // given a URL, extract the origin. Taken from: https://github.com/firebase/firebase-simple-login/blob/d2cb95b9f812d8488bdbfba51c3a7c153ba1a074/js/src/simple-login/transports/WinChan.js#L25-L30 - function extractOrigin(url) { - if (!/^https?:\/\//.test(url)) url = window.location.href; - var m = /^(https?:\/\/[\-_a-zA-Z\.0-9:]+)/.exec(url); - if (m) return m[1]; - return url; - } - - // find the relay iframe in the opener - function findRelay() { - var loc = window.location; - var frames = window.opener.frames; - for (var i = frames.length - 1; i >= 0; i--) { - try { - if (frames[i].location.protocol === window.location.protocol && - frames[i].location.host === window.location.host && - frames[i].name === RELAY_FRAME_NAME) - { - return frames[i]; - } - } catch(e) { } - } - return; - } - - var isIE = isInternetExplorer(); - - if (isSupported()) { - /* General flow: - * 0. user clicks - * (IE SPECIFIC) 1. caller adds relay iframe (served from trusted domain) to DOM - * 2. caller opens window (with content from trusted domain) - * 3. window on opening adds a listener to 'message' - * (IE SPECIFIC) 4. window on opening finds iframe - * 5. window checks if iframe is "loaded" - has a 'doPost' function yet - * (IE SPECIFIC5) 5a. if iframe.doPost exists, window uses it to send ready event to caller - * (IE SPECIFIC5) 5b. if iframe.doPost doesn't exist, window waits for frame ready - * (IE SPECIFIC5) 5bi. once ready, window calls iframe.doPost to send ready event - * 6. caller upon reciept of 'ready', sends args - */ - return { - open: function(opts, cb) { - if (!cb) throw "missing required callback argument"; - - // test required options - var err; - if (!opts.url) err = "missing required 'url' parameter"; - if (!opts.relay_url) err = "missing required 'relay_url' parameter"; - if (err) setTimeout(function() { cb(err); }, 0); - - // supply default options - if (!opts.window_name) opts.window_name = null; - if (!opts.window_features || isFennec()) opts.window_features = undefined; - - // opts.params may be undefined - - var iframe; - - // sanity check, are url and relay_url the same origin? - var origin = extractOrigin(opts.url); - if (origin !== extractOrigin(opts.relay_url)) { - return setTimeout(function() { - cb('invalid arguments: origin of url and relay_url must match'); - }, 0); - } - - var messageTarget; - - if (isIE) { - // first we need to add a "relay" iframe to the document that's served - // from the target domain. We can postmessage into a iframe, but not a - // window - iframe = document.createElement("iframe"); - // iframe.setAttribute('name', framename); - iframe.setAttribute('src', opts.relay_url); - iframe.style.display = "none"; - iframe.setAttribute('name', RELAY_FRAME_NAME); - document.body.appendChild(iframe); - messageTarget = iframe.contentWindow; - } - - var w = opts.popup || window.open(opts.url, opts.window_name, opts.window_features); - if (opts.popup) { - w.location.href = opts.url; - } - - if (!messageTarget) messageTarget = w; - - // lets listen in case the window blows up before telling us - var closeInterval = setInterval(function() { - if (w && w.closed) { - cleanup(); - if (cb) { - cb('User closed the popup window'); - cb = null; - } - } - }, 500); - - var req = JSON.stringify({a: 'request', d: opts.params}); - - // cleanup on unload - function cleanup() { - if (iframe) document.body.removeChild(iframe); - iframe = undefined; - if (closeInterval) closeInterval = clearInterval(closeInterval); - removeListener(window, 'message', onMessage); - removeListener(window, 'unload', cleanup); - if (w) { - try { - w.close(); - } catch (securityViolation) { - // This happens in Opera 12 sometimes - // see https://github.com/mozilla/browserid/issues/1844 - messageTarget.postMessage(CLOSE_CMD, origin); - } - } - w = messageTarget = undefined; - } - - addListener(window, 'unload', cleanup); - - function onMessage(e) { - if (e.origin !== origin) { return; } - try { - var d = JSON.parse(e.data); - if (d.a === 'ready') messageTarget.postMessage(req, origin); - else if (d.a === 'error') { - cleanup(); - if (cb) { - cb(d.d); - cb = null; - } - } else if (d.a === 'response') { - cleanup(); - if (cb) { - cb(null, d.d); - cb = null; - } - } - } catch(err) { } - } - - addListener(window, 'message', onMessage); - - return { - close: cleanup, - focus: function() { - if (w) { - try { - w.focus(); - } catch (e) { - // IE7 blows up here, do nothing - } - } - } - }; - }, - onOpen: function(cb) { - var o = "*"; - var msgTarget = isIE ? findRelay() : window.opener; - if (!msgTarget) throw "can't find relay frame"; - function doPost(msg) { - msg = JSON.stringify(msg); - if (isIE) msgTarget.doPost(msg, o); - else msgTarget.postMessage(msg, o); - } - - function onMessage(e) { - // only one message gets through, but let's make sure it's actually - // the message we're looking for (other code may be using - // postmessage) - we do this by ensuring the payload can - // be parsed, and it's got an 'a' (action) value of 'request'. - var d; - try { - d = JSON.parse(e.data); - } catch(err) { } - if (!d || d.a !== 'request') return; - removeListener(window, 'message', onMessage); - o = e.origin; - if (cb) { - // this setTimeout is critically important for IE8 - - // in ie8 sometimes addListener for 'message' can synchronously - // cause your callback to be invoked. awesome. - setTimeout(function() { - cb(o, d.d, function(r) { - cb = undefined; - doPost({a: 'response', d: r}); - }); - }, 0); - } - } - - function onDie(e) { - if (e.data === CLOSE_CMD) { - try { window.close(); } catch (o_O) {} - } - } - addListener(isIE ? msgTarget : window, 'message', onMessage); - addListener(isIE ? msgTarget : window, 'message', onDie); - - // we cannot post to our parent that we're ready before the iframe - // is loaded. (IE specific possible failure) - try { - doPost({a: "ready"}); - } catch(e) { - // this code should never be exectued outside IE - addListener(msgTarget, 'load', function(e) { - doPost({a: "ready"}); - }); - } - - // if window is unloaded and the client hasn't called cb, it's an error - var onUnload = function() { - try { - // IE8 doesn't like this... - removeListener(isIE ? msgTarget : window, 'message', onDie); - } catch (ohWell) { } - if (cb) doPost({ a: 'error', d: 'client closed window' }); - cb = undefined; - // explicitly close the window, in case the client is trying to reload or nav - try { window.close(); } catch (e) { } - }; - addListener(window, 'unload', onUnload); - return { - detach: function() { - removeListener(window, 'unload', onUnload); - } - }; - } - }; - } else { - return { - open: function(url, winopts, arg, cb) { - setTimeout(function() { cb("unsupported browser"); }, 0); - }, - onOpen: function(cb) { - setTimeout(function() { cb("unsupported browser"); }, 0); - } - }; - } -})(); - -if (typeof module !== 'undefined' && module.exports) { - module.exports = WinChan; -} - -},{}],29:[function(require,module,exports){ -module.exports = hasKeys - -function hasKeys(source) { - return source !== null && - (typeof source === "object" || - typeof source === "function") -} - -},{}],30:[function(require,module,exports){ -var Keys = require("object-keys") -var hasKeys = require("./has-keys") - -module.exports = extend - -function extend() { - var target = {} - - for (var i = 0; i < arguments.length; i++) { - var source = arguments[i] - - if (!hasKeys(source)) { - continue - } - - var keys = Keys(source) - - for (var j = 0; j < keys.length; j++) { - var name = keys[j] - target[name] = source[name] - } - } - - return target -} - -},{"./has-keys":29,"object-keys":32}],31:[function(require,module,exports){ -var hasOwn = Object.prototype.hasOwnProperty; -var toString = Object.prototype.toString; - -var isFunction = function (fn) { - var isFunc = (typeof fn === 'function' && !(fn instanceof RegExp)) || toString.call(fn) === '[object Function]'; - if (!isFunc && typeof window !== 'undefined') { - isFunc = fn === window.setTimeout || fn === window.alert || fn === window.confirm || fn === window.prompt; - } - return isFunc; -}; - -module.exports = function forEach(obj, fn) { - if (!isFunction(fn)) { - throw new TypeError('iterator must be a function'); - } - var i, k, - isString = typeof obj === 'string', - l = obj.length, - context = arguments.length > 2 ? arguments[2] : null; - if (l === +l) { - for (i = 0; i < l; i++) { - if (context === null) { - fn(isString ? obj.charAt(i) : obj[i], i, obj); - } else { - fn.call(context, isString ? obj.charAt(i) : obj[i], i, obj); - } - } - } else { - for (k in obj) { - if (hasOwn.call(obj, k)) { - if (context === null) { - fn(obj[k], k, obj); - } else { - fn.call(context, obj[k], k, obj); - } - } - } - } -}; - - -},{}],32:[function(require,module,exports){ -module.exports = Object.keys || require('./shim'); - - -},{"./shim":34}],33:[function(require,module,exports){ -var toString = Object.prototype.toString; - -module.exports = function isArguments(value) { - var str = toString.call(value); - var isArguments = str === '[object Arguments]'; - if (!isArguments) { - isArguments = str !== '[object Array]' - && value !== null - && typeof value === 'object' - && typeof value.length === 'number' - && value.length >= 0 - && toString.call(value.callee) === '[object Function]'; - } - return isArguments; -}; - - -},{}],34:[function(require,module,exports){ -(function () { - "use strict"; - - // modified from https://github.com/kriskowal/es5-shim - var has = Object.prototype.hasOwnProperty, - toString = Object.prototype.toString, - forEach = require('./foreach'), - isArgs = require('./isArguments'), - hasDontEnumBug = !({'toString': null}).propertyIsEnumerable('toString'), - hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'), - dontEnums = [ - "toString", - "toLocaleString", - "valueOf", - "hasOwnProperty", - "isPrototypeOf", - "propertyIsEnumerable", - "constructor" - ], - keysShim; - - keysShim = function keys(object) { - var isObject = object !== null && typeof object === 'object', - isFunction = toString.call(object) === '[object Function]', - isArguments = isArgs(object), - theKeys = []; - - if (!isObject && !isFunction && !isArguments) { - throw new TypeError("Object.keys called on a non-object"); - } - - if (isArguments) { - forEach(object, function (value) { - theKeys.push(value); - }); - } else { - var name, - skipProto = hasProtoEnumBug && isFunction; - - for (name in object) { - if (!(skipProto && name === 'prototype') && has.call(object, name)) { - theKeys.push(name); - } - } - } - - if (hasDontEnumBug) { - var ctor = object.constructor, - skipConstructor = ctor && ctor.prototype === object; - - forEach(dontEnums, function (dontEnum) { - if (!(skipConstructor && dontEnum === 'constructor') && has.call(object, dontEnum)) { - theKeys.push(dontEnum); - } - }); - } - return theKeys; - }; - - module.exports = keysShim; -}()); - - -},{"./foreach":31,"./isArguments":33}],35:[function(require,module,exports){ -var global=typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {};/* - * - * This is used to build the bundle with browserify. - * - * The bundle is used by people who doesn't use browserify. - * Those who use browserify will install with npm and require the module, - * the package.json file points to index.js. - */ -var Auth0 = require('./index'); - -//use amd or just throught to window object. -if (typeof global.window.define == 'function' && global.window.define.amd) { - global.window.define('auth0', function () { return Auth0; }); -} else if (global.window) { - global.window.Auth0 = Auth0; -} - -},{"./index":1}],36:[function(require,module,exports){ -module.exports = { str: "7.6.1" }; - -},{}]},{},[35]) -//@ sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi92YXIvbGliL2plbmtpbnMvd29ya3NwYWNlL2F1dGgwLWpzL2luZGV4LmpzIiwiL3Zhci9saWIvamVua2lucy93b3Jrc3BhY2UvYXV0aDAtanMvbGliL0lmcmFtZUhhbmRsZX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HwgJycpXG4gICAgfSk7XG5cbiAgaWYgKHRoaXMuX3VzZUpTT05QKSB7XG4gICAgcmV0dXJuIGpzb25wKHVybCArICc/JyArIHFzLnN0cmluZ2lmeShxdWVyeSksIGpzb25wT3B0cywgZnVuY3Rpb24gKGVyciwgcmVzcCkge1xuICAgICAgaWYgKGVycikge1xuICAgICAgICByZXR1cm4gY2FsbGJhY2soZXJyKTtcbiAgICAgIH1cbiAgICAgIGlmKCdlcnJvcicgaW4gcmVzcCAmJiByZXNwLnN0YXR1cyAhPT0gNDA0KSB7XG4gICAgICAgIHJldHVybiBjYWxsYmFjayhuZXcgRXJyb3IocmVzcC5lcnJvcikpO1xuICAgICAgfVxuICAgICAgY2FsbGJhY2sobnVsbCwgcmVzcC5zdGF0dXMgPT09IDIwMCk7XG4gICAgfSk7XG4gIH1cblxuICByZXF3ZXN0KHtcbiAgICB1cmw6ICAgICBzYW1lX29yaWdpbihwcm90b2NvbCwgZG9tYWluKSA/IGVuZHBvaW50IDogdXJsLFxuICAgIG1ldGhvZDogICdwb3N0JyxcbiAgICB0eXBlOiAgICAndGV4dCcsXG4gICAgZGF0YTogICAgcXVlcnksXG4gICAgY3Jvc3NPcmlnaW46ICFzYW1lX29yaWdpbihwcm90b2NvbCwgZG9tYWluKSxcbiAgICBlcnJvcjogZnVuY3Rpb24gKGVycikge1xuICAgICAgaWYgKGVyci5zdGF0dXMgIT09IDQwNCkgeyByZXR1cm4gY2FsbGJhY2sobmV3IEVycm9yKGVyci5yZXNwb25zZVRleHQpKTsgfVxuICAgICAgY2FsbGJhY2sobnVsbCwgZmFsc2UpO1xuICAgIH0sXG4gICAgc3VjY2VzczogZnVuY3Rpb24gKHJlc3ApIHtcbiAgICAgIGNhbGxiYWNrKG51bGwsIHJlc3Auc3RhdHVzID09PSAyMDApO1xuICAgIH1cbiAgfSk7XG59O1xuXG4vKipcbiAqIERlY29kZSBKc29uIFdlYiBUb2tlblxuICpcbiAqIEBwYXJhbSB7U3RyaW5nfSBq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xuICAgIDtcblxuICAgIGlmIChjYW5TZXRJbW1lZGlhdGUpIHtcbiAgICAgICAgcmV0dXJuIGZ1bmN0aW9uIChmKSB7IHJldHVybiB3aW5kb3cuc2V0SW1tZWRpYXRlKGYpIH07XG4gICAgfVxuXG4gICAgaWYgKGNhblBvc3QpIHtcbiAgICAgICAgdmFyIHF1ZXVlID0gW107XG4gICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCdtZXNzYWdlJywgZnVuY3Rpb24gKGV2KSB7XG4gICAgICAgICAgICB2YXIgc291cmNlID0gZXYuc291cmNlO1xuICAgICAgICAgICAgaWYgKChzb3VyY2UgPT09IHdpbmRvdyB8fCBzb3VyY2UgPT09IG51bGwpICYmIGV2LmRhdGEgPT09ICdwcm9jZXNzLXRpY2snKSB7XG4gICAgICAgICAgICAgICAgZXYuc3RvcFByb3BhZ2F0aW9uKCk7XG4gICAgICAgICAgICAgICAgaWYgKHF1ZXVlLmxlbmd0aCA+IDApIHtcbiAgICAgICAgICAgICAgICAgICAgdmFyIGZuID0gcXVldWUuc2hpZnQoKTtcbiAgICAgICAgICAgICAgICAgICAgZm4oKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sIHRydWUpO1xuXG4gICAgICAgIHJldHVybiBmdW5jdGlvbiBuZXh0VGljayhmbikge1xuICAgICAgICAgICAgcXVldWUucHVzaChmbik7XG4gICAgICAgICAgICB3aW5kb3cucG9zdE1lc3NhZ2UoJ3Byb2Nlc3MtdGljaycsICcqJyk7XG4gICAgICAgIH07XG4gICAgfVxuXG4gICAgcmV0dXJuIGZ1bmN0aW9uIG5leHRUaWNrKGZuKSB7XG4gICAgICAgIHNldFRpbWVvdXQoZm4sIDApO1xuICAgIH07XG59KSgpO1xuXG5wcm9jZXNzLnRpdGxlID0gJ2Jyb3dzZXInO1xucHJvY2Vzcy5icm93c2VyID0gdHJ1ZTtcbnByb2Nlc3MuZW52ID0ge307XG5wcm9jZXNz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AgdmFsdWUgICAgICAgYW55IEphdmFTY3JpcHQgdmFsdWUsIHVzdWFsbHkgYW4gb2JqZWN0IG9yIGFycmF5LlxuXG4gICAgICAgICAgICByZXBsYWNlciAgICBhbiBvcHRpb25hbCBwYXJhbWV0ZXIgdGhhdCBkZXRlcm1pbmVzIGhvdyBvYmplY3RcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlcyBhcmUgc3RyaW5naWZpZWQgZm9yIG9iamVjdHMuIEl0IGNhbiBiZSBhXG4gICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBvciBhbiBhcnJheSBvZiBzdHJpbmdzLlxuXG4gICAgICAgICAgICBzcGFjZSAgICAgICBhbiBvcHRpb25hbCBwYXJhbWV0ZXIgdGhhdCBzcGVjaWZpZXMgdGhlIGluZGVudGF0aW9uXG4gICAgICAgICAgICAgICAgICAgICAgICBvZiBuZXN0ZWQgc3RydWN0dXJlcy4gSWYgaXQgaXMgb21pdHRlZCwgdGhlIHRleHQgd2lsbFxuICAgICAgICAgICAgICAgICAgICAgICAgYmUgcGFja2VkIHdpdGhvdXQgZXh0cmEgd2hpdGVzcGFjZS4gSWYgaXQgaXMgYSBudW1iZXIsXG4gICAgICAgICAgICAgICAgICAgICAgICBpdCB3aWxsIHNwZWNpZnkgdGhlIG51bWJlciBvZiBzcGFjZXMgdG8gaW5kZW50IGF0IGVhY2hcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldmVsLiBJZiBpdCBpcyBhIHN0cmluZyAoc3VjaCBhcyAnXFx0JyBvciAnJm5ic3A7JyksXG4gICAgICAgICAgICAgICAgICAgICAgICBpdCBjb250YWlucyB0aGUgY2hhcmFjdGVycyB1c2VkIHRvIGluZGVudCBhdCBlYWNoIGxldmVsLlxuXG4gICAgICAgICAgICBUaGlzIG1ldGhvZCBwcm9kdWNlcyBhIEpTT04gdGV4dCBmcm9tIGEgSmF2YVNjcmlwdCB2YWx1ZS5cblxuICAgICAgICAgICAgV2hlbiBhbiBv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RnVsbFllYXIoKSAgICsgJy0nICtcbiAgICAgICAgICAgICAgICAgICAgICAgICBmKHRoaXMuZ2V0VVRDTW9udGgoKSArIDEpICsgJy0nICtcbiAgICAgICAgICAgICAgICAgICAgICAgICBmKHRoaXMuZ2V0VVRDRGF0ZSgpKSAgICAgICsgJ1QnICtcbiAgICAgICAgICAgICAgICAgICAgICAgICBmKHRoaXMuZ2V0VVRDSG91cnMoKSkgICAgICsgJzonICtcbiAgICAgICAgICAgICAgICAgICAgICAgICBmKHRoaXMuZ2V0VVRDTWludXRlcygpKSAgICsgJzonICtcbiAgICAgICAgICAgICAgICAgICAgICAgICBmKHRoaXMuZ2V0VVRDU2Vjb25kcygpKSAgICsgJ1onO1xuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIFlvdSBjYW4gcHJvdmlkZSBhbiBvcHRpb25hbCByZXBsYWNlciBtZXRob2QuIEl0IHdpbGwgYmUgcGFzc2VkIHRoZVxuICAgICAgICAgICAga2V5IGFuZCB2YWx1ZSBvZiBlYWNoIG1lbWJlciwgd2l0aCB0aGlzIGJvdW5kIHRvIHRoZSBjb250YWluaW5nXG4gICAgICAgICAgICBvYmplY3QuIFRoZSB2YWx1ZSB0aGF0IGlzIHJldHVybmVkIGZyb20geW91ciBtZXRob2Qgd2lsbCBiZVxuICAgICAgICAgICAgc2VyaWFsaXplZC4gSWYgeW91ciBtZXRob2QgcmV0dXJucyB1bmRlZmluZWQsIHRoZW4gdGhlIG1lbWJlciB3aWxsXG4gICAgICAgICAgICBiZSBleGNsdWRlZCBmcm9tIHRoZSBzZXJpYWxpemF0aW9uLlxuXG4gICAgICAgICAgICBJZiB0aGUgcmVwbGFjZXIgcGFyYW1ldGVyIGlzIGFuIGFycmF5IG9mIHN0cmluZ3MsIHRoZW4gaXQgd2lsbCBiZVxuICAgICAgICAgICAgdXNlZCB0byBzZWxlY3QgdGhlIG1lbWJlcnMgdG8gYmUgc2VyaWFsaXplZC4gSXQgZmlsdGVycyB0aG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ArYVs0XSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICArYVs1XSwgK2FbNl0pKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gdmFsdWU7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgbXlEYXRhID0gSlNPTi5wYXJzZSgnW1wiRGF0ZSgwOS8wOS8yMDAxKVwiXScsIGZ1bmN0aW9uIChrZXksIHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgdmFyIGQ7XG4gICAgICAgICAgICAgICAgaWYgKHR5cGVvZiB2YWx1ZSA9PT0gJ3N0cmluZycgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlLnNsaWNlKDAsIDUpID09PSAnRGF0ZSgnICYmXG4gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZS5zbGljZSgtMSkgPT09ICcpJykge1xuICAgICAgICAgICAgICAgICAgICBkID0gbmV3IERhdGUodmFsdWUuc2xpY2UoNSwgLTEpKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBkO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgICAgICAgIH0pO1xuXG5cbiAgICBUaGlzIGlzIGEgcmVmZXJlbmNlIGltcGxlbWVudGF0aW9uLiBZb3UgYXJlIGZyZWUgdG8gY29weSwgbW9kaWZ5LCBvclxuICAgIHJlZGlzdHJpYnV0ZS5cbiovXG5cbi8qanNsaW50IGV2aWw6IHRydWUsIHJlZ2V4cDogdHJ1ZSAqL1xuXG4vKm1lbWJlcnMgXCJcIiwgXCJcXGJcIiwgXCJcXHRcIiwgXCJcXG5cIiwgXCJcXGZcIiwgXCJcXHJcIiwgXCJcXFwiXCIsIEpTT04sIFwiXFxcXFwiLCBhcHBseSxcb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gKyAxKSArICctJyArXG4gICAgICAgICAgICAgICAgICAgIGYodGhpcy5nZXRVVENEYXRlKCkpICAgICAgKyAnVCcgK1xuICAgICAgICAgICAgICAgICAgICBmKHRoaXMuZ2V0VVRDSG91cnMoKSkgICAgICsgJzonICtcbiAgICAgICAgICAgICAgICAgICAgZih0aGlzLmdldFVUQ01pbnV0ZXMoKSkgICArICc6JyArXG4gICAgICAgICAgICAgICAgICAgIGYodGhpcy5nZXRVVENTZWNvbmRzKCkpICAgKyAnWidcbiAgICAgICAgICAgICAgICA6IG51bGw7XG4gICAgICAgIH07XG5cbiAgICAgICAgU3RyaW5nLnByb3RvdHlwZS50b0pTT04gICAgICA9XG4gICAgICAgICAgICBOdW1iZXIucHJvdG90eXBlLnRvSlNPTiAgPVxuICAgICAgICAgICAgQm9vbGVhbi5wcm90b3R5cGUudG9KU09OID0gZnVuY3Rpb24gKGtleSkge1xuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLnZhbHVlT2YoKTtcbiAgICAgICAgICAgIH07XG4gICAgfVxuXG4gICAgdmFyIGN4ID0gL1tcXHUwMDAwXFx1MDBhZFxcdTA2MDAtXFx1MDYwNFxcdTA3MGZcXHUxN2I0XFx1MTdiNVxcdTIwMGMtXFx1MjAwZlxcdTIwMjgtXFx1MjAyZlxcdTIwNjAtXFx1MjA2ZlxcdWZlZmZcXHVmZmYwLVxcdWZmZmZdL2csXG4gICAgICAgIGVzY2FwYWJsZSA9IC9bXFxcXFxcXCJcXHgwMC1cXHgxZlxceDdmLVxceDlmXFx1MDBhZFxcdTA2MDAtXFx1MDYwNFxcdTA3MGZcXHUxN2I0XFx1MTdiNVxcdTIwMGMtXFx1MjAwZlxcdTIwMjgtXFx1MjAyZlxcdTIwNjAtXFx1MjA2ZlxcdWZlZmZcXHVmZmYwLVxcdWZmZmZdL2csXG4gICAgICAgIGdhcCxcbiAgICAgICAgaW5kZW50LFxuICAgICAgICBtZXRhID0geyAgICAvLyB0YWJsZSBvZiBjaGFyY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G4nICsgbWluZCArICddJ1xuICAgICAgICAgICAgICAgICAgICA6ICdbJyArIHBhcnRpYWwuam9pbignLCcpICsgJ10nO1xuICAgICAgICAgICAgICAgIGdhcCA9IG1pbmQ7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHY7XG4gICAgICAgICAgICB9XG5cbi8vIElmIHRoZSByZXBsYWNlciBpcyBhbiBhcnJheSwgdXNlIGl0IHRvIHNlbGVjdCB0aGUgbWVtYmVycyB0byBiZSBzdHJpbmdpZmllZC5cblxuICAgICAgICAgICAgaWYgKHJlcCAmJiB0eXBlb2YgcmVwID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgIGxlbmd0aCA9IHJlcC5sZW5ndGg7XG4gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGxlbmd0aDsgaSArPSAxKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgcmVwW2ldID09PSAnc3RyaW5nJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgayA9IHJlcFtpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHYgPSBzdHIoaywgdmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHYpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJ0aWFsLnB1c2gocXVvdGUoaykgKyAoZ2FwID8gJzogJyA6ICc6JykgKyB2KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gZWxzZSB7XG5cbi8vIE90aGVyd2lzZSwgaXRlcmF0ZSB0aHJvdWdoIGFsbCBvZiB0aGUga2V5cyBpbiB0aGUgb2JqZWN0LlxuXG4gICAgICAgICAgICAgICAgZm9yIChrIGluIHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwodmFsdWUsIGspKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB2ID0gc3RyKGssIHZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFydGlhbC5wdXNoKHF1b3RlKGspICsgKGdhcCA/ICc6ICcgOiAnOicpICsgdik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbi8vIEpvaW4gYWxsIG9mIHRoZSBtZW1iZXIgdGV4dHMgdG9nZXRoZXIsIHNlcGFyYXRlZCB3aXRoIGNvbW1hcyxcbi8vIGFuZCB3cmFwIHRoZW0gaW4gYnJhY2VzLlxuXG4gICAgICAgICAgICB2ID0gcGFydGlhbC5sZW5ndGggPT09IDBcbiAgICAgICAgICAgICAgICA/ICd7fSdcbiAgICAgICAgICAgICAgICA6IGdhcFxuICAgICAgICAgICAgICAgID8gJ3tcXG4nICsgZ2FwICsgcGFydGlhbC5qb2luKCcsXFxuJyArIGdhcCkgKyAnXFxuJyArIG1pbmQgKyAnfSdcbiAgICAgICAgICAgICAgICA6ICd7JyArIHBhcnRpYWwuam9pbignLCcpICsgJ30nO1xuICAgICAgICAgICAgZ2FwID0gbWluZDtcbiAgICAgICAgICAgIHJldHVybiB2O1xuICAgICAgICB9XG4gICAgfVxuXG4vLyBJZiB0aGUgSlNPTiBvYmplY3QgZG9lcyBub3QgeWV0IGhhdmUgYSBzdHJpbmdpZnkgbWV0aG9kLCBnaXZlIGl0IG9uZS5cblxuICAgIGlmICh0eXBlb2YgSlNPTi5zdHJpbmdpZnkgIT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgSlNPTi5zdHJpbmdpZnkgPSBmdW5jdGlvbiAodmFsdWUsIHJlcGxhY2VyLCBzcGFjZSkge1xuXG4vLyBUaGUgc3RyaW5naWZ5IG1ldGhvZCB0YWtlcyBhIHZhbHVlIGFu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aWYgdGhlIHRleHQgaXMgYSB2YWxpZCBKU09OIHRleHQuXG5cbiAgICAgICAgICAgIHZhciBqO1xuXG4gICAgICAgICAgICBmdW5jdGlvbiB3YWxrKGhvbGRlciwga2V5KSB7XG5cbi8vIFRoZSB3YWxrIG1ldGhvZCBpcyB1c2VkIHRvIHJlY3Vyc2l2ZWx5IHdhbGsgdGhlIHJlc3VsdGluZyBzdHJ1Y3R1cmUgc29cbi8vIHRoYXQgbW9kaWZpY2F0aW9ucyBjYW4gYmUgbWFkZS5cblxuICAgICAgICAgICAgICAgIHZhciBrLCB2LCB2YWx1ZSA9IGhvbGRlcltrZXldO1xuICAgICAgICAgICAgICAgIGlmICh2YWx1ZSAmJiB0eXBlb2YgdmFsdWUgPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgICAgIGZvciAoayBpbiB2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHkuY2FsbCh2YWx1ZSwgaykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ID0gd2Fsayh2YWx1ZSwgayk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHYgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZVtrXSA9IHY7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIHZhbHVlW2tdO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXR1cm4gcmV2aXZlci5jYWxsKGhvbGRlciwga2V5LCB2YWx1ZSk7XG4gICAgICAgICAgICB9XG5cblxuLy8gUGFyc2luZyBoYXBw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jdHMgPyBPYmplY3QuY3JlYXRlKG51bGwpIDoge307XG4gICAgICAgIHZhciBjbGVhblJvb3QgPSByb290WzBdID09PSAnWycgJiYgcm9vdFtyb290Lmxlbmd0aCAtIDFdID09PSAnXScgPyByb290LnNsaWNlKDEsIHJvb3QubGVuZ3RoIC0gMSkgOiByb290O1xuICAgICAgICB2YXIgaW5kZXggPSBwYXJzZUludChjbGVhblJvb3QsIDEwKTtcbiAgICAgICAgaWYgKFxuICAgICAgICAgICAgIWlzTmFOKGluZGV4KSAmJlxuICAgICAgICAgICAgcm9vdCAhPT0gY2xlYW5Sb290ICYmXG4gICAgICAgICAgICBTdHJpbmcoaW5kZXgpID09PSBjbGVhblJvb3QgJiZcbiAgICAgICAgICAgIGluZGV4ID49IDAgJiZcbiAgICAgICAgICAgIChvcHRpb25zLnBhcnNlQXJyYXlzICYmIGluZGV4IDw9IG9wdGlvbnMuYXJyYXlMaW1pdClcbiAgICAgICAgKSB7XG4gICAgICAgICAgICBvYmogPSBbXTtcbiAgICAgICAgICAgIG9ialtpbmRleF0gPSBwYXJzZU9iamVjdChjaGFpbiwgdmFsLCBvcHRpb25zKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIG9ialtjbGVhblJvb3RdID0gcGFyc2VPYmplY3QoY2hhaW4sIHZhbCwgb3B0aW9ucyk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gb2JqO1xufTtcblxudmFyIHBhcnNlS2V5cyA9IGZ1bmN0aW9uIHBhcnNlS2V5cyhnaXZlbktleSwgdmFsLCBvcHRpb25zKSB7XG4gICAgaWYgKCFnaXZlbktleSkge1xuICAgICAgICByZXR1cm47XG4gICAgfVxuXG4gICAgLy8gVHJhbnNmb3JtIGRvdCBub3RhdGlvbiB0byBicmFja2V0IG5vdGF0aW9uXG4gICAgdmFyIGtleSA9IG9wdGlvbnMuYWxsb3dEb3RzID8gZ2l2ZW5LZXkucmVwbGFjZSgvXFwuKFteXFwuXFxb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0aW9uJykge1xuICAgICAgICBvYmogPSBmaWx0ZXIocHJlZml4LCBvYmopO1xuICAgIH0gZWxzZSBpZiAob2JqIGluc3RhbmNlb2YgRGF0ZSkge1xuICAgICAgICBvYmogPSBzZXJpYWxpemVEYXRlKG9iaik7XG4gICAgfSBlbHNlIGlmIChvYmogPT09IG51bGwpIHtcbiAgICAgICAgaWYgKHN0cmljdE51bGxIYW5kbGluZykge1xuICAgICAgICAgICAgcmV0dXJuIGVuY29kZXIgPyBlbmNvZGVyKHByZWZpeCkgOiBwcmVmaXg7XG4gICAgICAgIH1cblxuICAgICAgICBvYmogPSAnJztcbiAgICB9XG5cbiAgICBpZiAodHlwZW9mIG9iaiA9PT0gJ3N0cmluZycgfHwgdHlwZW9mIG9iaiA9PT0gJ251bWJlcicgfHwgdHlwZW9mIG9iaiA9PT0gJ2Jvb2xlYW4nIHx8IHV0aWxzLmlzQnVmZmVyKG9iaikpIHtcbiAgICAgICAgaWYgKGVuY29kZXIpIHtcbiAgICAgICAgICAgIHJldHVybiBbZm9ybWF0dGVyKGVuY29kZXIocHJlZml4KSkgKyAnPScgKyBmb3JtYXR0ZXIoZW5jb2RlcihvYmopKV07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIFtmb3JtYXR0ZXIocHJlZml4KSArICc9JyArIGZvcm1hdHRlcihTdHJpbmcob2JqKSldO1xuICAgIH1cblxuICAgIHZhciB2YWx1ZXMgPSBbXTtcblxuICAgIGlmICh0eXBlb2Ygb2JqID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICByZXR1cm4gdmFsdWVzO1xuICAgIH1cblxuICAgIHZhciBvYmpLZXlzO1xuICAgIGlmIChBcnJheS5pc0FycmF5KGZpbHRlcikpIHtcbiAgICAgICAgb2JqS2V5cyA9IGZpbHRlcjtcbiAgICB9IGVsc2Uge1xuICAgICAgICB2YXIga2V5cyA9IE9iamVjdC5rZXlzKG9iaik7XG4gICAgICAgIG9iaktleXMgPSBzb3J0ID8ga2V5cy5zb3J0KHNvcnQpIDoga2V5cztcbiAgICB9XG5cbiAgICBmb3IgKHZhciBpID0gMDsgaSA8IG9iaktleXMubGVuZ3RoOyArK2kpIHtcbiAgICAgICAgdmFyIGtleSA9IG9iaktleXNbaV07XG5cbiAgICAgICAgaWYgKHNraXBOdWxscyAmJiBvYmpba2V5XSA9PT0gbnVsbCkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoQXJyYXkuaXNBcnJheShvYmopKSB7XG4gICAgICAgICAgICB2YWx1ZXMgPSB2YWx1ZXMuY29uY2F0KHN0cmluZ2lmeShcbiAgICAgICAgICAgICAgICBvYmpba2V5XSxcbiAgICAgICAgICAgICAgICBnZW5lcmF0ZUFycmF5UHJlZml4KHByZWZpeCwga2V5KSxcbiAgICAgICAgICAgICAgICBnZW5lcmF0ZUFycmF5UHJlZml4LFxuICAgICAgICAgICAgICAgIHN0cmljdE51bGxIYW5kbGluZyxcbiAgICAgICAgICAgICAgICBza2lwTnVsbHMsXG4gICAgICAgICAgICAgICAgZW5jb2RlcixcbiAgICAgICAgICAgICAgICBmaWx0ZXIsXG4gICAgICAgICAgICAgICAgc29ydCxcbiAgICAgICAgICAgICAgICBhbGxvd0RvdHMsXG4gICAgICAgICAgICAgICAgc2VyaWFsaXplRGF0ZSxcbiAgICAgICAgICAgICAgICBmb3JtYXR0ZXJcbiAgICAgICAgICAgICkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdmFsdWVzID0gdmFsdWVzLmNvbmNhdChzdHJpbmdpZnkoXG4gICAgICAgICAgICAgICAgb2JqW2tleV0sXG4gICAgICAgICAgICAgICAgcHJlZml4ICsgKGFsbG93RG90cyA/ICcuJyArIGtleSA6ICdbJyArIGtleSArICddJyksXG4gICAgICAgICAgICAgICAgZ2VuZXJhdGVBcnJheVByZWZpeCxcbiAgICAgICAgICAgICAgICBzdHJpY3ROdWxsSGFuZGxpbmcsXG4gICAgICAgICAgICAgICAgc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iAgICAgICAgb2JqS2V5cy5zb3J0KHNvcnQpO1xuICAgIH1cblxuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgb2JqS2V5cy5sZW5ndGg7ICsraSkge1xuICAgICAgICB2YXIga2V5ID0gb2JqS2V5c1tpXTtcblxuICAgICAgICBpZiAoc2tpcE51bGxzICYmIG9ialtrZXldID09PSBudWxsKSB7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGtleXMgPSBrZXlzLmNvbmNhdChzdHJpbmdpZnkoXG4gICAgICAgICAgICBvYmpba2V5XSxcbiAgICAgICAgICAgIGtleSxcbiAgICAgICAgICAgIGdlbmVyYXRlQXJyYXlQcmVmaXgsXG4gICAgICAgICAgICBzdHJpY3ROdWxsSGFuZGxpbmcsXG4gICAgICAgICAgICBza2lwTnVsbHMsXG4gICAgICAgICAgICBlbmNvZGVyLFxuICAgICAgICAgICAgZmlsdGVyLFxuICAgICAgICAgICAgc29ydCxcbiAgICAgICAgICAgIGFsbG93RG90cyxcbiAgICAgICAgICAgIHNlcmlhbGl6ZURhdGUsXG4gICAgICAgICAgICBmb3JtYXR0ZXJcbiAgICAgICAgKSk7XG4gICAgfVxuXG4gICAgcmV0dXJuIGtleXMuam9pbihkZWxpbWl0ZXIpO1xufTtcbiIsIid1c2Ugc3RyaWN0JztcblxudmFyIGhhcyA9IE9iamVjdC5wcm90b3R5cGUuaGFzT3duUHJvcGVydHk7XG5cbnZhciBoZXhUYWJsZSA9IChmdW5jdGlvbiAoKSB7XG4gICAgdmFyIGFycmF5ID0gW107XG4gICAgZm9yICh2YXIgaSA9IDA7IGkgPCAyNTY7ICsraSkge1xuICAgICAgICBhcnJheS5wdXNoKCclJyArICgoaSA8IDE2ID8gJzAnIDogJycpICsgaS50b1N0cmluZygxNikpLnRvVXBwZXJDYXNlKCkpO1xuICAgIH1cblxuICAgIHJldHVybiBhcnJheTtcbn0oKSk7XG5cbmV4cG9ydHMuYXJyYXlUb09iamVj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iAgICAgICAgICAgIChjID49IDB4MzAgJiYgYyA8PSAweDM5KSB8fCAvLyAwLTlcbiAgICAgICAgICAgIChjID49IDB4NDEgJiYgYyA8PSAweDVBKSB8fCAvLyBhLXpcbiAgICAgICAgICAgIChjID49IDB4NjEgJiYgYyA8PSAweDdBKSAvLyBBLVpcbiAgICAgICAgKSB7XG4gICAgICAgICAgICBvdXQgKz0gc3RyaW5nLmNoYXJBdChpKTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGMgPCAweDgwKSB7XG4gICAgICAgICAgICBvdXQgPSBvdXQgKyBoZXhUYWJsZVtjXTtcbiAgICAgICAgICAgIGNvbnRpbnVlO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKGMgPCAweDgwMCkge1xuICAgICAgICAgICAgb3V0ID0gb3V0ICsgKGhleFRhYmxlWzB4QzAgfCAoYyA+PiA2KV0gKyBoZXhUYWJsZVsweDgwIHwgKGMgJiAweDNGKV0pO1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoYyA8IDB4RDgwMCB8fCBjID49IDB4RTAwMCkge1xuICAgICAgICAgICAgb3V0ID0gb3V0ICsgKGhleFRhYmxlWzB4RTAgfCAoYyA+PiAxMildICsgaGV4VGFibGVbMHg4MCB8ICgoYyA+PiA2KSAmIDB4M0YpXSArIGhleFRhYmxlWzB4ODAgfCAoYyAmIDB4M0YpXSk7XG4gICAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGkgKz0gMTtcbiAgICAgICAgYyA9IDB4MTAwMDAgKyAoKChjICYgMHgzRkYpIDw8IDEwKSB8IChzdHJpbmcuY2hhckNvZGVBdChpKSAmIDB4M0ZGKSk7XG4gICAgICAgIG91dCArPSBoZXhUYWJsZVsweEYwIHwgKGMgPj4gMTgpXSArIGhleFRhYmxlWzB4ODAgfCAoKGMgPj4gMTIpICYgMHgzRildICsgaG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xuICAgIHZhciBmcmFtZXMgPSB3aW5kb3cub3BlbmVyLmZyYW1lcztcbiAgICBmb3IgKHZhciBpID0gZnJhbWVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgaS0tKSB7XG4gICAgICB0cnkge1xuICAgICAgICBpZiAoZnJhbWVzW2ldLmxvY2F0aW9uLnByb3RvY29sID09PSB3aW5kb3cubG9jYXRpb24ucHJvdG9jb2wgJiZcbiAgICAgICAgICAgIGZyYW1lc1tpXS5sb2NhdGlvbi5ob3N0ID09PSB3aW5kb3cubG9jYXRpb24uaG9zdCAmJlxuICAgICAgICAgICAgZnJhbWVzW2ldLm5hbWUgPT09IFJFTEFZX0ZSQU1FX05BTUUpXG4gICAgICAgIHtcbiAgICAgICAgICByZXR1cm4gZnJhbWVzW2ldO1xuICAgICAgICB9XG4gICAgICB9IGNhdGNoKGUpIHsgfVxuICAgIH1cbiAgICByZXR1cm47XG4gIH1cblxuICB2YXIgaXNJRSA9IGlzSW50ZXJuZXRFeHBsb3JlcigpO1xuXG4gIGlmIChpc1N1cHBvcnRlZCgpKSB7XG4gICAgLyogIEdlbmVyYWwgZmxvdzpcbiAgICAgKiAgICAgICAgICAgICAgICAgIDAuIHVzZXIgY2xpY2tzXG4gICAgICogIChJRSBTUEVDSUZJQykgICAxLiBjYWxsZXIgYWRkcyByZWxheSBpZnJhbWUgKHNlcnZlZCBmcm9tIHRydXN0ZWQgZG9tYWluKSB0byBET01cbiAgICAgKiAgICAgICAgICAgICAgICAgIDIuIGNhbGxlciBvcGVucyB3aW5kb3cgKHdpdGggY29udGVudCBmcm9tIHRydXN0ZWQgZG9tYWluKVxuICAgICAqICAgICAgICAgICAgICAgICAgMy4gd2luZG93IG9uIG9wZW5pbmcgYWRkcyBhIGxpc3RlbmVyIHRvICdtZXNzYWdlJ1xuICAgICAqICAoSUUgU1BFQ0lGSUMpICAgNC4gd2luZG93IG9uIG9wZW5pbmcgZmluZHMgaWZyYW1lXG4gICAgICogICAgICAgICAgICAgICAg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ICAgICAgICAgY2IgPSBudWxsO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgfSwgNTAwKTtcblxuICAgICAgICB2YXIgcmVxID0gSlNPTi5zdHJpbmdpZnkoe2E6ICdyZXF1ZXN0JywgZDogb3B0cy5wYXJhbXN9KTtcblxuICAgICAgICAvLyBjbGVhbnVwIG9uIHVubG9hZFxuICAgICAgICBmdW5jdGlvbiBjbGVhbnVwKCkge1xuICAgICAgICAgIGlmIChpZnJhbWUpIGRvY3VtZW50LmJvZHkucmVtb3ZlQ2hpbGQoaWZyYW1lKTtcbiAgICAgICAgICBpZnJhbWUgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgaWYgKGNsb3NlSW50ZXJ2YWwpIGNsb3NlSW50ZXJ2YWwgPSBjbGVhckludGVydmFsKGNsb3NlSW50ZXJ2YWwpO1xuICAgICAgICAgIHJlbW92ZUxpc3RlbmVyKHdpbmRvdywgJ21lc3NhZ2UnLCBvbk1lc3NhZ2UpO1xuICAgICAgICAgIHJlbW92ZUxpc3RlbmVyKHdpbmRvdywgJ3VubG9hZCcsIGNsZWFudXApO1xuICAgICAgICAgIGlmICh3KSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICB3LmNsb3NlKCk7XG4gICAgICAgICAgICB9IGNhdGNoIChzZWN1cml0eVZpb2xhdGlvbikge1xuICAgICAgICAgICAgICAvLyBUaGlzIGhhcHBlbnMgaW4gT3BlcmEgMTIgc29tZXRpbWVzXG4gICAgICAgICAgICAgIC8vIHNlZSBodHRwczovL2dpdGh1Yi5jb20vbW96aWxsYS9icm93c2VyaWQvaXNzdWVzLzE4NDRcbiAgICAgICAgICAgICAgbWVzc2FnZVRhcmdldC5wb3N0TWVzc2FnZShDTE9TRV9DTUQsIG9yaWdpbik7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIHcgPSBtZXNzYWdlVGFyZ2V0ID0gdW5kZWZpbmVkO1xuICAgICAgICB9XG5cbiAgICAgICAgYWRkTGlzdGVuZXIod2luZG93LCAndW5sb2FkJywgY2xlYW51cCk7XG5cbiAgICAgICAgZnVuY3Rpb24gb25NZXNzYWdlKGUpIHtcbiAgICAgICAgICBpZiAoZS5vcmlnaW4gIT09IG9yaWdpbikgeyByZXR1cm47IH1cbiAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgdmFyIGQgPSBKU09OLnBhcnNlKGUuZGF0YSk7XG4gICAgICAgICAgICBpZiAoZC5hID09PSAncmVhZHknKSBtZXNzYWdlVGFyZ2V0LnBvc3RNZXNzYWdlKHJlcSwgb3JpZ2luKTtcbiAgICAgICAgICAgIGVsc2UgaWYgKGQuYSA9PT0gJ2Vycm9yJykge1xuICAgICAgICAgICAgICBjbGVhbnVwKCk7XG4gICAgICAgICAgICAgIGlmIChjYikge1xuICAgICAgICAgICAgICAgIGNiKGQuZCk7XG4gICAgICAgICAgICAgICAgY2IgPSBudWxsO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2UgaWYgKGQuYSA9PT0gJ3Jlc3BvbnNlJykge1xuICAgICAgICAgICAgICBjbGVhbnVwKCk7XG4gICAgICAgICAgICAgIGlmIChjYikge1xuICAgICAgICAgICAgICAgIGNiKG51bGwsIGQuZCk7XG4gICAgICAgICAgICAgICAgY2IgPSBudWxsO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBjYXRjaChlcnIpIHsgfVxuICAgICAgICB9XG5cbiAgICAgICAgYWRkTGlzdGVuZXIod2luZG93LCAnbWVzc2FnZScsIG9uTWVzc2FnZSk7XG5cbiAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICBjbG9zZTogY2xlYW51cCxcbiAgICAgICAgICBmb2N1czogZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICBpZiAodykge1xuICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIHcuZm9jdXMoKTtcbiAgICAgICAgICAgICAgfSBjYX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HtcbiAgICAgICAgICAgIGQgPSBKU09OLnBhcnNlKGUuZGF0YSk7XG4gICAgICAgICAgfSBjYXRjaChlcnIpIHsgfVxuICAgICAgICAgIGlmICghZCB8fCBkLmEgIT09ICdyZXF1ZXN0JykgcmV0dXJuO1xuICAgICAgICAgIHJlbW92ZUxpc3RlbmVyKHdpbmRvdywgJ21lc3NhZ2UnLCBvbk1lc3NhZ2UpO1xuICAgICAgICAgIG8gPSBlLm9yaWdpbjtcbiAgICAgICAgICBpZiAoY2IpIHtcbiAgICAgICAgICAgIC8vIHRoaXMgc2V0VGltZW91dCBpcyBjcml0aWNhbGx5IGltcG9ydGFudCBmb3IgSUU4IC1cbiAgICAgICAgICAgIC8vIGluIGllOCBzb21ldGltZXMgYWRkTGlzdGVuZXIgZm9yICdtZXNzYWdlJyBjYW4gc3luY2hyb25vdXNseVxuICAgICAgICAgICAgLy8gY2F1c2UgeW91ciBjYWxsYmFjayB0byBiZSBpbnZva2VkLiAgYXdlc29tZS5cbiAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgICAgIGNiKG8sIGQuZCwgZnVuY3Rpb24ocikge1xuICAgICAgICAgICAgICAgIGNiID0gdW5kZWZpbmVkO1xuICAgICAgICAgICAgICAgIGRvUG9zdCh7YTogJ3Jlc3BvbnNlJywgZDogcn0pO1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0sIDApO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuXG4gICAgICAgIGZ1bmN0aW9uIG9uRGllKGUpIHtcbiAgICAgICAgICBpZiAoZS5kYXRhID09PSBDTE9TRV9DTUQpIHtcbiAgICAgICAgICAgIHRyeSB7IHdpbmRvdy5jbG9zZSgpOyB9IGNhdGNoIChvX08pIHt9XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGFkZExpc3RlbmVyKGlzSUUgPyBtc2dUYXJnZXQgOiB3aW5kb3csICdtZXNzYWdlJywgb25N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ZW9mIHNlbGYgIT09IFwidW5kZWZpbmVkXCIgPyBzZWxmIDogdHlwZW9mIHdpbmRvdyAhPT0gXCJ1bmRlZmluZWRcIiA/IHdpbmRvdyA6IHt9Oy8qXG4gKlxuICogVGhpcyBpcyB1c2VkIHRvIGJ1aWxkIHRoZSBidW5kbGUgd2l0aCBicm93c2VyaWZ5LlxuICpcbiAqIFRoZSBidW5kbGUgaXMgdXNlZCBieSBwZW9wbGUgd2hvIGRvZXNuJ3QgdXNlIGJyb3dzZXJpZnkuXG4gKiBUaG9zZSB3aG8gdXNlIGJyb3dzZXJpZnkgd2lsbCBpbnN0YWxsIHdpdGggbnBtIGFuZCByZXF1aXJlIHRoZSBtb2R1bGUsXG4gKiB0aGUgcGFja2FnZS5qc29uIGZpbGUgcG9pbnRzIHRvIGluZGV4LmpzLlxuICovXG52YXIgQXV0aDAgPSByZXF1aXJlKCcuL2luZGV4Jyk7XG5cbi8vdXNlIGFtZCBvciBqdXN0IHRocm91Z2h0IHRvIHdpbmRvdyBvYmplY3QuXG5pZiAodHlwZW9mIGdsb2JhbC53aW5kb3cuZGVmaW5lID09ICdmdW5jdGlvbicgJiYgZ2xvYmFsLndpbmRvdy5kZWZpbmUuYW1kKSB7XG4gIGdsb2JhbC53aW5kb3cuZGVmaW5lKCdhdXRoMCcsIGZ1bmN0aW9uICgpIHsgcmV0dXJuIEF1dGgwOyB9KTtcbn0gZWxzZSBpZiAoZ2xvYmFsLndpbmRvdykge1xuICBnbG9iYWwud2luZG93LkF1dGgwID0gQXV0aDA7XG59XG4iLCJtb2R1bGUuZXhwb3J0cyA9IHsgc3RyOiBcIjcuNi4xXCIgfTtcbiJdfQ== -; \ No newline at end of file diff --git a/stackle_app/app/views/home.html b/stackle_app/app/views/home.html deleted file mode 100644 index 8b2e0f8..0000000 --- a/stackle_app/app/views/home.html +++ /dev/null @@ -1,4 +0,0 @@ - -

    Stackle is a Web communication portal for Open Source Orgranizations

    -

    Get the word going. We are buidling it

    -
    diff --git a/stackle_app/app/views/landing.html b/stackle_app/app/views/landing.html deleted file mode 100644 index 512d2f0..0000000 --- a/stackle_app/app/views/landing.html +++ /dev/null @@ -1,75 +0,0 @@ -
    -
    -
    -
    -
    - - - - - - - {{result}} - -
    -
    - - {{org}} - -
    -
    - -
    - - {{stack}} - -
    -
    -
    -
    -
    -
    -
    -

    {{post.title}}

    -

    {{post.org_name}} - {{post.repository}} -

    - -

    {{post.description}}

    - - - {{post.org_name}} - -

    Posted by {{post.user}} on {{post.date}} | {{post.comments.length}} Comments

    -
    -
    -
    - Your Feed -
    -

    {{post.title}}

    -

    {{post.org_name}} - {{post.repository}} -

    - -

    {{post.description}}

    - - - {{post.org_name}} - -

    Posted by {{post.user}} on {{post.date}} | {{post.comments.length}} Comments

    -
    - -
    -
    -
    - -
    -
    \ No newline at end of file diff --git a/stackle_app/app/views/main.html b/stackle_app/app/views/main.html deleted file mode 100644 index 8b2e0f8..0000000 --- a/stackle_app/app/views/main.html +++ /dev/null @@ -1,4 +0,0 @@ - -

    Stackle is a Web communication portal for Open Source Orgranizations

    -

    Get the word going. We are buidling it

    -
    diff --git a/stackle_app/app/views/posts/create-post.html b/stackle_app/app/views/posts/create-post.html deleted file mode 100644 index b72802d..0000000 --- a/stackle_app/app/views/posts/create-post.html +++ /dev/null @@ -1,27 +0,0 @@ -
    -
    -
    - Create your Post - - - - - -
    - - - - -
    - - - - -
    - - - - -
    -
    -
    \ No newline at end of file diff --git a/stackle_app/app/views/posts/view-post.html b/stackle_app/app/views/posts/view-post.html deleted file mode 100644 index ce382c3..0000000 --- a/stackle_app/app/views/posts/view-post.html +++ /dev/null @@ -1,40 +0,0 @@ -
    -
    -
    -
    -

    {{post.votes}}

    -
    -
    -
    -

    {{post.title}}

    -
    - - {{tag}} - -
    - {{post.description}} -

    Posted by {{post.user}}

    -
    -
    -
    - {{comment.votes}} -
    -
    -
    - {{comment.description}} -

    by {{comment.user}}

    -
    -
    -
    -
    -
    - - - - Comment -
    -
    -
    -
    -
    -
    \ No newline at end of file diff --git a/stackle_app/app/views/profile.html b/stackle_app/app/views/profile.html deleted file mode 100644 index 581774b..0000000 --- a/stackle_app/app/views/profile.html +++ /dev/null @@ -1,36 +0,0 @@ - -
    -
    -
    -
    - -
    -
    - -
    -
    -

    {{profile.name}}

    -
    -
    -
    Username : {{profile.nickname}}
    -
    -
    -
    GitHub URL : {{profile.html_url}}
    -
    -
    -
    E mail : {{profile.email}}
    -
    -
    -
    Total Private Repos : {{profile.total_private_repos}}
    -
    -
    -
    Total Public Repos : {{profile.public_repos}}
    -
    -
    -
    -
    -
    -
    -
    -
    - diff --git a/stackle_app/app/views/toolbar.html b/stackle_app/app/views/toolbar.html deleted file mode 100644 index 2b56860..0000000 --- a/stackle_app/app/views/toolbar.html +++ /dev/null @@ -1,35 +0,0 @@ - -
    -

    - Stackle - By Open Source for Open Source -

    - - - - Login - - - Home - - - Profile - - - Logout - -
    -
    diff --git a/stackle_app/bower.json b/stackle_app/bower.json deleted file mode 100644 index 5126ad9..0000000 --- a/stackle_app/bower.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "stackle-app", - "version": "0.0.0", - "dependencies": { - "angular": "^1.4.0", - "bootstrap": "^3.2.0", - "angular-animate": "^1.4.0", - "angular-cookies": "^1.4.0", - "angular-resource": "^1.4.0", - "angular-route": "^1.4.0", - "angular-sanitize": "^1.4.0", - "angular-touch": "^1.4.0", - "angular-material": "^1.1.4", - "angular-auth0": "^1.0.7", - "auth0-angular": "^4.2.7" - }, - "devDependencies": { - "angular-mocks": "^1.4.0" - }, - "appPath": "app", - "moduleName": "stackleAppApp", - "overrides": { - "bootstrap": { - "main": [ - "less/bootstrap.less", - "dist/css/bootstrap.css", - "dist/js/bootstrap.js" - ] - } - } -} diff --git a/stackle_app/gulpfile.js b/stackle_app/gulpfile.js deleted file mode 100644 index 9a0c1a6..0000000 --- a/stackle_app/gulpfile.js +++ /dev/null @@ -1,200 +0,0 @@ -// Generated on 2017-06-03 using generator-angular 0.16.0 -'use strict'; - -var gulp = require('gulp'); -var $ = require('gulp-load-plugins')(); -var openURL = require('open'); -var lazypipe = require('lazypipe'); -var rimraf = require('rimraf'); -var wiredep = require('wiredep').stream; -var runSequence = require('run-sequence'); - -var yeoman = { - app: require('./bower.json').appPath || 'app', - dist: 'dist' -}; - -var paths = { - scripts: [yeoman.app + '/scripts/**/*.js'], - styles: [yeoman.app + '/styles/**/*.css'], - test: ['test/spec/**/*.js'], - testRequire: [ - yeoman.app + '/bower_components/angular/angular.js', - yeoman.app + '/bower_components/angular-mocks/angular-mocks.js', - yeoman.app + '/bower_components/angular-resource/angular-resource.js', - yeoman.app + '/bower_components/angular-cookies/angular-cookies.js', - yeoman.app + '/bower_components/angular-sanitize/angular-sanitize.js', - yeoman.app + '/bower_components/angular-route/angular-route.js', - 'test/mock/**/*.js', - 'test/spec/**/*.js' - ], - karma: 'karma.conf.js', - views: { - main: yeoman.app + '/index.html', - files: [yeoman.app + '/views/**/*.html'] - } -}; - -//////////////////////// -// Reusable pipelines // -//////////////////////// - -var lintScripts = lazypipe() - .pipe($.jshint, '.jshintrc') - .pipe($.jshint.reporter, 'jshint-stylish'); - -var styles = lazypipe() - .pipe($.autoprefixer, 'last 1 version') - .pipe(gulp.dest, '.tmp/styles'); - -/////////// -// Tasks // -/////////// - -gulp.task('styles', function () { - return gulp.src(paths.styles) - .pipe(styles()); -}); - -gulp.task('lint:scripts', function () { - return gulp.src(paths.scripts) - .pipe(lintScripts()); -}); - -gulp.task('clean:tmp', function (cb) { - rimraf('./.tmp', cb); -}); - -gulp.task('start:client', ['start:server', 'styles'], function () { - openURL('http://localhost:9000'); -}); - -gulp.task('start:server', function() { - $.connect.server({ - root: [yeoman.app, '.tmp'], - livereload: true, - // Change this to '0.0.0.0' to access the server from outside. - port: 9000 - }); -}); - -gulp.task('start:server:test', function() { - $.connect.server({ - root: ['test', yeoman.app, '.tmp'], - livereload: true, - port: 9001 - }); -}); - -gulp.task('watch', function () { - $.watch(paths.styles) - .pipe($.plumber()) - .pipe(styles()) - .pipe($.connect.reload()); - - $.watch(paths.views.files) - .pipe($.plumber()) - .pipe($.connect.reload()); - - $.watch(paths.scripts) - .pipe($.plumber()) - .pipe(lintScripts()) - .pipe($.connect.reload()); - - $.watch(paths.test) - .pipe($.plumber()) - .pipe(lintScripts()); - - gulp.watch('bower.json', ['bower']); -}); - -gulp.task('serve', function (cb) { - runSequence('clean:tmp', - ['lint:scripts'], - ['start:client'], - 'watch', cb); -}); - -gulp.task('serve:prod', function() { - $.connect.server({ - root: [yeoman.dist], - livereload: true, - port: 9000 - }); -}); - -gulp.task('test', ['start:server:test'], function () { - var testToFiles = paths.testRequire.concat(paths.scripts, paths.test); - return gulp.src(testToFiles) - .pipe($.karma({ - configFile: paths.karma, - action: 'watch' - })); -}); - -// inject bower components -gulp.task('bower', function () { - return gulp.src(paths.views.main) - .pipe(wiredep({ - directory: yeoman.app + '/bower_components', - ignorePath: '..' - })) - .pipe(gulp.dest(yeoman.app + '/views')); -}); - -/////////// -// Build // -/////////// - -gulp.task('clean:dist', function (cb) { - rimraf('./dist', cb); -}); - -gulp.task('client:build', ['html', 'styles'], function () { - var jsFilter = $.filter('**/*.js'); - var cssFilter = $.filter('**/*.css'); - - return gulp.src(paths.views.files) - .pipe($.useref()) - .pipe(jsFilter) - .pipe($.ngAnnotate()) - .pipe($.uglify()) - .pipe(jsFilter.restore()) - .pipe(cssFilter) - .pipe($.minifyCss({cache: true})) - .pipe(cssFilter.restore()) - .pipe($.rev()) - .pipe($.revReplace()) - .pipe(gulp.dest(yeoman.dist)); -}); - -gulp.task('html', function () { - return gulp.src(yeoman.app + '/views/**/*') - .pipe(gulp.dest(yeoman.dist + '/views')); -}); - -gulp.task('images', function () { - return gulp.src(yeoman.app + '/images/**/*') - .pipe($.cache($.imagemin({ - optimizationLevel: 5, - progressive: true, - interlaced: true - }))) - .pipe(gulp.dest(yeoman.dist + '/images')); -}); - -gulp.task('copy:extras', function () { - return gulp.src(yeoman.app + '/*/.*', { dot: true }) - .pipe(gulp.dest(yeoman.dist)); -}); - -gulp.task('copy:fonts', function () { - return gulp.src(yeoman.app + '/fonts/**/*') - .pipe(gulp.dest(yeoman.dist + '/fonts')); -}); - -gulp.task('build', ['clean:dist'], function () { - runSequence(['images', 'copy:extras', 'copy:fonts', 'client:build']); -}); - -gulp.task('default', ['build']); diff --git a/stackle_app/package.json b/stackle_app/package.json deleted file mode 100644 index 50109c5..0000000 --- a/stackle_app/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "stackleapp", - "private": true, - "scripts": { - "start": "gulp serve" - }, - "devDependencies": { - "gulp": "^3.9.0", - "gulp-connect": "^2.2.0", - "gulp-autoprefixer": "2.3.1", - "gulp-cache": "^0.2.10", - "rimraf": "^2.4.0", - "gulp-filter": "^2.0.2", - "gulp-imagemin": "^2.3.0", - "gulp-jshint": "^1.11.1", - "gulp-karma": "0.0.4", - "gulp-load-plugins": "^0.10.0", - "gulp-plumber": "^1.0.1", - "gulp-minify-css": "^1.2.0", - "gulp-rev": "^5.0.1", - "gulp-rev-replace": "^0.4.2", - "gulp-uglify": "^1.2.0", - "gulp-useref": "^3.0.0", - "gulp-util": "^3.0.6", - "gulp-watch": "^4.2.4", - "run-sequence": "^1.1.1", - "wiredep": "^2.2.2", - "lazypipe": "^0.2.4", - "gulp-ng-annotate": "^1.0.0", - "open": "0.0.5", - "jshint-stylish": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - }, - "dependencies": { - "angular-jwt": "^0.1.9", - "angular-storage": "0.0.15", - "angular-ui-router": "^1.0.3" - } -} diff --git a/stackle_app/test/.jshintrc b/stackle_app/test/.jshintrc deleted file mode 100644 index b2ce4ef..0000000 --- a/stackle_app/test/.jshintrc +++ /dev/null @@ -1,18 +0,0 @@ -{ - "bitwise": true, - "browser": true, - "curly": true, - "eqeqeq": true, - "esnext": true, - "jasmine": true, - "latedef": true, - "noarg": true, - "node": true, - "strict": true, - "undef": true, - "unused": true, - "globals": { - "angular": false, - "inject": false - } -} diff --git a/stackle_app/test/spec/controllers/main.js b/stackle_app/test/spec/controllers/main.js deleted file mode 100644 index cbdcbc0..0000000 --- a/stackle_app/test/spec/controllers/main.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -describe('Controller: MainCtrl', function () { - - // load the controller's module - beforeEach(module('stackleAppApp')); - - var MainCtrl, - scope; - - // Initialize the controller and a mock scope - beforeEach(inject(function ($controller, $rootScope) { - scope = $rootScope.$new(); - MainCtrl = $controller('MainCtrl', { - $scope: scope - // place here mocked dependencies - }); - })); - - it('should attach a list of awesomeThings to the scope', function () { - expect(MainCtrl.awesomeThings.length).toBe(3); - }); -}); diff --git a/ui-tests.sh b/ui-tests.sh new file mode 100755 index 0000000..e9fe63e --- /dev/null +++ b/ui-tests.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +echo "Running front end tests for Stackle using Protractor"; +cd stackle_app; +protractor conf.js; +echo "Tests Ended";