diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..801f3ca --- /dev/null +++ b/.eslintignore @@ -0,0 +1,6 @@ +**/lwc/**/*.css +**/lwc/**/*.html +**/lwc/**/*.json +**/lwc/**/*.svg +**/lwc/**/*.xml +.sfdx \ No newline at end of file diff --git a/.forceignore b/.forceignore new file mode 100755 index 0000000..a868252 --- /dev/null +++ b/.forceignore @@ -0,0 +1,20 @@ +# List files or directories below to ignore them when running force:source:push, force:source:pull, and force:source:status +# More information: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_exclude_source.htm +# + +package.xml + +# LWC configuration files +**/jsconfig.json +**/.eslintrc.json + +# LWC Jest +**/__tests__/** + +# Standard metadata +package.xml +**appMenu +**appSwitcher +**objectTranslations +**profiles +**settings \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8078245 --- /dev/null +++ b/.gitignore @@ -0,0 +1,35 @@ +# This file is used for Git repositories to specify intentionally untracked files that Git should ignore. +# If you are not using git, you can delete this file. For more information see: https://git-scm.com/docs/gitignore +# For useful gitignore templates see: https://github.com/github/gitignore + +# Salesforce cache +.sfdx/ +.localdevserver/ + +# LWC VSCode autocomplete +**/lwc/jsconfig.json + +# LWC Jest coverage reports +coverage/ + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Dependency directories +node_modules/ + +# Eslint cache +.eslintcache + +# MacOS system files +.DS_Store + +# Windows system files +Thumbs.db +ehthumbs.db +[Dd]esktop.ini +$RECYCLE.BIN/ diff --git a/.prettierignore b/.prettierignore new file mode 100755 index 0000000..2ce88aa --- /dev/null +++ b/.prettierignore @@ -0,0 +1,13 @@ +# List files or directories below to ignore them when running prettier +# More information: https://prettier.io/docs/en/ignore.html +# + +**/staticresources/** +.localdevserver +.sfdx + +coverage/ + +# because of +force-app/main/default/components/BracketsPredictionsFootballPlayoffs.component +force-app/main/default/components/BracketsPredictionsStandard.component \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100755 index 0000000..b4e9e8c --- /dev/null +++ b/.prettierrc @@ -0,0 +1,15 @@ +{ + "trailingComma": "none", + "singleQuote": true, + "tabWidth": 4, + "overrides": [ + { + "files": "**/lwc/**/*.html", + "options": { "parser": "lwc" } + }, + { + "files": "*.{cmp,page,component}", + "options": { "parser": "html" } + } + ] +} diff --git a/.project b/.project deleted file mode 100644 index 18cb526..0000000 --- a/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - Brackets - - - - - - com.salesforce.ide.builder.default - - - - - com.salesforce.ide.builder.online - - - - - - com.salesforce.ide.nature.default - com.salesforce.ide.nature.online - - diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..13c1ea2 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "salesforce.salesforcedx-vscode", + "redhat.vscode-xml", + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode" + ] +} diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..a83dd06 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Apex Replay Debugger", + "type": "apex-replay", + "request": "launch", + "logFile": "${command:AskForLogFileName}", + "stopOnEntry": true, + "trace": true + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..65b8f07 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "search.exclude": { + "**/node_modules": true, + "**/bower_components": true, + "**/.sfdx": true + } +} diff --git a/README b/README deleted file mode 100644 index 3c9eeb2..0000000 --- a/README +++ /dev/null @@ -1,6 +0,0 @@ -Brackets helps you run tournament prediction games in Force.com. - -You can install it quickly and easily into your free Force.com Developer Edition -- get one: http://developer.force.com/join -- from the AppExchange (click the Home link) or using the Force.com Ant Migration Tool. - - - diff --git a/README.md b/README.md new file mode 100644 index 0000000..05d2528 --- /dev/null +++ b/README.md @@ -0,0 +1,129 @@ +# Brackets + +Brackets helps you run tournament prediction games in Force.com. + +## Table of contents + +- [Installing the app using a Scratch Org](#installing-the-app-using-a-scratch-org): This is the recommended installation option. Use this option if you are a developer who wants to experience the app and the code. + +- [Installing the app using a Developer Edition Org or a Trailhead Playground](#installing-the-app-using-a-developer-edition-org-or-a-trailhead-playground): Useful when tackling Trailhead Badges or if you want the app deployed to a more permanent environment than a Scratch org. + +- [Optional installation instructions](#optional-installation-instructions) + +## Installing the app using a Scratch Org + +1. Set up your environment. Follow the steps in the [Quick Start: Lightning Web Components](https://trailhead.salesforce.com/content/learn/projects/quick-start-lightning-web-components/) Trailhead project. The steps include: + + - Enable Dev Hub in your Trailhead Playground + - Install Salesforce CLI + - Install Visual Studio Code + - Install the Visual Studio Code Salesforce extensions, including the Lightning Web Components extension + +2. If you haven't already done so, authorize your hub org and provide it with an alias (**myhuborg** in the command below): + + ``` + sfdx force:auth:web:login -d -a myhuborg + ``` + +3. Clone the brackets repository: + + ``` + git clone https://github.com/salesforcelabs/brackets + cd brackets + ``` + +4. Create a scratch org and provide it with an alias (**brackets** in the command below): + + ``` + sfdx force:org:create -s -f config/project-scratch-def.json -a brackets + ``` + +5. Push the app to your scratch org: + + ``` + sfdx force:source:push + ``` + +6. Assign the `brackets` permission set to the default user. + + ``` + sfdx force:user:permset:assign -n brackets + ``` + +7. Open the scratch org: + + ``` + sfdx force:org:open + ``` + +8. In App Launcher, click **View All** then select the **Brackets** app. + +## Installing the App using a Developer Edition Org or a Trailhead Playground + +Follow this set of instructions if you want to deploy the app to a more permanent environment than a Scratch org. +This includes non source-tracked orgs such as a [free Developer Edition Org](https://developer.salesforce.com/signup) or a [Trailhead Playground](https://trailhead.salesforce.com/). + +Make sure to start from a brand-new environment to avoid conflicts with previous work you may have done. + +1. Authorize your Trailhead Playground or Developer org and provide it with an alias (**mydevorg** in the command below): + + ``` + sfdx force:auth:web:login -d -a mydevorg + ``` + +2. Clone this repository: + + ``` + git clone https://github.com/salesforcelabs/brackets + cd brackets + ``` + +3. If you are setting up a Developer Edition: go to **Setup**, under **My Domain**, [register a My Domain](https://help.salesforce.com/articleView?id=domain_name_setup.htm&type=5). + +4. Run this command in a terminal to deploy the app. + + ``` + sfdx force:source:deploy -p force-app + ``` + +5. If your org isn't already open, open it now: + + ``` + sfdx force:org:open -u mydevorg + ``` + +6. Assign the `brackets` permission set to the default user. + + ``` + sfdx force:user:permset:assign -n brackets + ``` + +7. In App Launcher, select the **brackets** app. + +## Optional Installation Instructions + +This repository contains several files that are relevant if you want to integrate modern web development tooling to your Salesforce development processes, or to your continuous integration/continuous deployment processes. + +### Code formatting + +[Prettier](https://prettier.io/) is a code formatter used to ensure consistent formatting across your code base. To use Prettier with Visual Studio Code, install [this extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) from the Visual Studio Code Marketplace. The [.prettierignore](/.prettierignore) and [.prettierrc](/.prettierrc) files are provided as part of this repository to control the behavior of the Prettier formatter. + +### Code linting + +[ESLint](https://eslint.org/) is a popular JavaScript linting tool used to identify stylistic errors and erroneous constructs. To use ESLint with Visual Studio Code, install [this extension](https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode-lwc) from the Visual Studio Code Marketplace. The [.eslintignore](/.eslintignore) file is provided as part of this repository to exclude specific files from the linting process in the context of Lightning Web Components development. + +### Pre-commit hook + +This repository also comes with a [package.json](./package.json) file that makes it easy to set up a pre-commit hook that enforces code formatting and linting by running Prettier and ESLint every time you `git commit` changes. + +To set up the formatting and linting pre-commit hook: + +1. Install [Node.js](https://nodejs.org) if you haven't already done so +2. Run `npm install` in your project's root folder to install the ESLint and Prettier modules (Note: Mac users should verify that Xcode command line tools are installed before running this command.) + +Prettier and ESLint will now run automatically every time you commit changes. The commit will fail if linting errors are detected. You can also run the formatting and linting from the command line using the following commands (check out [package.json](./package.json) for the full list): + +``` +npm run lint:lwc +npm run prettier +``` diff --git a/bin/check-version.js b/bin/check-version.js new file mode 100644 index 0000000..317ff18 --- /dev/null +++ b/bin/check-version.js @@ -0,0 +1,10 @@ +const semver = require('semver'); +const pjson = require('../package.json'); + +const version = pjson.engines.node; +if (!semver.satisfies(process.version, version)) { + console.log( + `\n\nRequired node version ${version} not satisfied with current version ${process.version}.\n\n` + ); + process.exit(1); +} diff --git a/bin/orgInit.sh b/bin/orgInit.sh new file mode 100644 index 0000000..a827ecb --- /dev/null +++ b/bin/orgInit.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +DURATION=7 + +if [ "$#" -eq 1 ]; then + DURATION=$1 +fi + +sfdx force:org:create -a recipes -s -f config/project-scratch-def.json -d $DURATION +sfdx force:source:push +sfdx force:user:permset:assign -n brackets +sfdx force:org:open -p /lightning/page/home +echo "Org is set up" \ No newline at end of file diff --git a/config/project-scratch-def.json b/config/project-scratch-def.json new file mode 100644 index 0000000..4712501 --- /dev/null +++ b/config/project-scratch-def.json @@ -0,0 +1,19 @@ +{ + "orgName": "Brackets", + "edition": "Developer", + "language": "en_US", + "features": [], + "settings": { + "lightningExperienceSettings": { + "enableS1DesktopEnabled": true + }, + "securitySettings": { + "passwordPolicies": { + "enableSetPasswordInApi": true + } + }, + "mobileSettings": { + "enableS1EncryptedStoragePref2": false + } + } +} diff --git a/force-app/main/default/applications/Brackets.app-meta.xml b/force-app/main/default/applications/Brackets.app-meta.xml new file mode 100644 index 0000000..61c5f0c --- /dev/null +++ b/force-app/main/default/applications/Brackets.app-meta.xml @@ -0,0 +1,16 @@ + + + Matches_Predictions + Large + false + false + + About_Brackets + Matches_Predictions + View_Leaderboard + standard-Chatter + Brackets_Tournament__c + Brackets_Group__c + Brackets_Team__c + Import_Tournament + diff --git a/src/classes/BracketsBatchUserMatchPrediction.cls b/force-app/main/default/classes/BracketsBatchUserMatchPrediction.cls similarity index 57% rename from src/classes/BracketsBatchUserMatchPrediction.cls rename to force-app/main/default/classes/BracketsBatchUserMatchPrediction.cls index 5f3238e..62962f3 100644 --- a/src/classes/BracketsBatchUserMatchPrediction.cls +++ b/force-app/main/default/classes/BracketsBatchUserMatchPrediction.cls @@ -27,49 +27,37 @@ OF THE POSSIBILITY OF SUCH DAMAGE. */ global virtual class BracketsBatchUserMatchPrediction implements Database.Batchable { - - global final String query; - - /** - * Constructor - */ - global BracketsBatchUserMatchPrediction(String query){ - this.query = query; - } - - global Database.Querylocator start(Database.BatchableContext bc){ - return Database.getQueryLocator(query); - } - - global void execute(Database.BatchableContext bc,List objectList){ - Brackets_UserMatchPred__c prediction; - List predictions = new List(); - for(SObject soobject : objectList){ - prediction = (Brackets_UserMatchPred__c) soobject; - predictions.add(prediction); - } - predictions = BracketsMatchesPredictionUtil.updatePointsMatched(predictions); - if(!predictions.isEmpty()){ - update predictions; - } - } - - global void finish(Database.BatchableContext bc){ - - } - - private static testMethod void testAllMethod(){ - String query = ''; - BracketsBatchUserMatchPrediction batchUMP = new BracketsBatchUserMatchPrediction(query); - - try{ - batchUMP.start(null); - System.assert(false,'This line shouldn\'t be executed.'); - }catch(Exception e){ - System.assert(true,'This line should be executed.'); - } - - batchUMP.execute(null, new List()); - batchUMP.finish(null); - } -} \ No newline at end of file + global final String query; + + /** + * Constructor + */ + global BracketsBatchUserMatchPrediction(String query) { + this.query = query; + } + + global Database.Querylocator start(Database.BatchableContext bc) { + return Database.getQueryLocator(query); + } + + global void execute( + Database.BatchableContext bc, + List objectList + ) { + Brackets_UserMatchPred__c prediction; + List predictions = new List(); + for (SObject soobject : objectList) { + prediction = (Brackets_UserMatchPred__c) soobject; + predictions.add(prediction); + } + predictions = BracketsMatchesPredictionUtil.updatePointsMatched( + predictions + ); + if (!predictions.isEmpty()) { + update predictions; + } + } + + global void finish(Database.BatchableContext bc) { + } +} diff --git a/src/classes/BracketsBatchUserMatchPrediction.cls-meta.xml b/force-app/main/default/classes/BracketsBatchUserMatchPrediction.cls-meta.xml similarity index 57% rename from src/classes/BracketsBatchUserMatchPrediction.cls-meta.xml rename to force-app/main/default/classes/BracketsBatchUserMatchPrediction.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsBatchUserMatchPrediction.cls-meta.xml +++ b/force-app/main/default/classes/BracketsBatchUserMatchPrediction.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsBatchUserMatchPredictionTest.cls b/force-app/main/default/classes/BracketsBatchUserMatchPredictionTest.cls new file mode 100644 index 0000000..6c323bd --- /dev/null +++ b/force-app/main/default/classes/BracketsBatchUserMatchPredictionTest.cls @@ -0,0 +1,20 @@ +@isTest +class BracketsBatchUserMatchPredictionTest { + @isTest + static void testAllMethod() { + String query = ''; + BracketsBatchUserMatchPrediction batchUMP = new BracketsBatchUserMatchPrediction( + query + ); + + try { + batchUMP.start(null); + System.assert(false, 'This line shouldn\'t be executed.'); + } catch (Exception e) { + System.assert(true, 'This line should be executed.'); + } + + batchUMP.execute(null, new List()); + batchUMP.finish(null); + } +} diff --git a/force-app/main/default/classes/BracketsBatchUserMatchPredictionTest.cls-meta.xml b/force-app/main/default/classes/BracketsBatchUserMatchPredictionTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsBatchUserMatchPredictionTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/src/classes/BracketsException.cls b/force-app/main/default/classes/BracketsException.cls similarity index 99% rename from src/classes/BracketsException.cls rename to force-app/main/default/classes/BracketsException.cls index 6a2d7a4..772b314 100644 --- a/src/classes/BracketsException.cls +++ b/force-app/main/default/classes/BracketsException.cls @@ -27,5 +27,4 @@ OF THE POSSIBILITY OF SUCH DAMAGE. */ public with sharing class BracketsException extends Exception { - -} \ No newline at end of file +} diff --git a/src/classes/BracketsException.cls-meta.xml b/force-app/main/default/classes/BracketsException.cls-meta.xml similarity index 57% rename from src/classes/BracketsException.cls-meta.xml rename to force-app/main/default/classes/BracketsException.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsException.cls-meta.xml +++ b/force-app/main/default/classes/BracketsException.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsExportImportTest.cls b/force-app/main/default/classes/BracketsExportImportTest.cls new file mode 100644 index 0000000..3b2fd76 --- /dev/null +++ b/force-app/main/default/classes/BracketsExportImportTest.cls @@ -0,0 +1,422 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ +@isTest +class BracketsExportImportTest { + @isTest + static void testSimpleExportImport() { + BracketsTournamentUtilities.CreatingTournamentTree = false; + + //Create a user + User testUser = BracketsTestUtilities.createUser(); + + System.runAs(testUser) { + List baselineTeams = [ + SELECT Id, Name, ExternalId__c + FROM Brackets_Team__c + ]; + List baselineTour = [ + SELECT Id, Name, ExternalId__c + FROM Brackets_Tournament__c + ]; + List baselineRound = [ + SELECT Id, Name, ExternalId__c + FROM Brackets_Round__c + ]; + List baselineMatch = [ + SELECT Id, Name, ExternalId__c + FROM Brackets_Match__c + ]; + + Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament( + 'Small Season 2010 ' + Datetime.now(), + 12, + BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE + ); + + Brackets_Group__c groupp = BracketsTestUtilities.getGroup( + tournament.Id + ); + + Brackets_Team__c teamA = BracketsTestUtilities.createTeam( + 'A-Team' + Datetime.now() + ); + Brackets_Team__c teamB = BracketsTestUtilities.createTeam( + 'B-Team' + Datetime.now() + ); + Brackets_Team__c teamC = BracketsTestUtilities.createTeam( + 'C-Team' + Datetime.now() + ); + Brackets_Team__c teamD = BracketsTestUtilities.createTeam( + 'D-Team' + Datetime.now() + ); + Brackets_Team__c teamE = BracketsTestUtilities.createTeam( + 'E-Team' + Datetime.now() + ); + Brackets_Team__c teamF = BracketsTestUtilities.createTeam( + 'F-Team' + Datetime.now() + ); + Brackets_Team__c teamG = BracketsTestUtilities.createTeam( + 'G-Team' + Datetime.now() + ); + Brackets_Team__c teamH = BracketsTestUtilities.createTeam( + 'H-Team' + Datetime.now() + ); + Brackets_Team__c teamI = BracketsTestUtilities.createTeam( + 'I-Team' + Datetime.now() + ); + Brackets_Team__c teamJ = BracketsTestUtilities.createTeam( + 'J-Team' + Datetime.now() + ); + Brackets_Team__c teamK = BracketsTestUtilities.createTeam( + 'K-Team' + Datetime.now() + ); + Brackets_Team__c teamL = BracketsTestUtilities.createTeam( + 'L-Team' + Datetime.now() + ); + + List auxList = new List(); + auxList.add(teamA); + auxList.add(teamB); + auxList.add(teamC); + auxList.add(teamD); + auxList.add(teamE); + auxList.add(teamF); + auxList.add(teamG); + auxList.add(teamH); + auxList.add(teamI); + auxList.add(teamJ); + auxList.add(teamK); + auxList.add(teamL); + upsert auxList; + + //let's make sure we have four rounds + List rounds = [ + SELECT Id, Name, Deadline__c + FROM Brackets_Round__c + WHERE Brackets_Tournament__c = :tournament.id + ORDER BY RoundNumber__c + ]; + + //make sure that round 0 has 4 matches + Brackets_Round__c r = rounds.get(0); + List matches = [ + SELECT + Id, + Name, + Conference__c, + Position__c, + FollowingBrackets_Match__c, + Schedule__c + FROM Brackets_Match__c + WHERE Brackets_Round__c = :r.id + ORDER BY Position__c + ]; + + Brackets_Match__c m1 = matches.get(0); + m1.HomeBrackets_Team__c = teamA.id; + m1.VisitorBrackets_Team__c = teamB.id; + Datetime originalSchedule = Datetime.now().addMinutes(10); + m1.Schedule__c = originalSchedule; + + Brackets_Match__c m2 = matches.get(1); + m2.HomeBrackets_Team__c = teamC.id; + m2.VisitorBrackets_Team__c = teamD.id; + + Brackets_Match__c m3 = matches.get(2); + m3.HomeBrackets_Team__c = teamE.id; + m3.VisitorBrackets_Team__c = teamF.id; + + Brackets_Match__c m4 = matches.get(3); + m4.HomeBrackets_Team__c = teamG.id; + m4.VisitorBrackets_Team__c = teamH.id; + + update matches; + + Brackets_Round__c r2 = rounds.get(1); + List matches2 = [ + SELECT + Id, + Name, + Conference__c, + Position__c, + FollowingBrackets_Match__c, + Schedule__c + FROM Brackets_Match__c + WHERE Brackets_Round__c = :r2.id + ORDER BY Position__c + ]; + + Brackets_Match__c m5 = matches2.get(0); + //m5.HomeBrackets_Team__c = teamA.id; + m5.VisitorBrackets_Team__c = teamI.id; + System.assert(m1.FollowingBrackets_Match__c == m5.Id); + + Brackets_Match__c m6 = matches2.get(1); + m6.HomeBrackets_Team__c = teamJ.id; + //m5.VisitorBrackets_Team__c = teamI.id; + + Brackets_Match__c m7 = matches2.get(2); + //m7.HomeBrackets_Team__c = teamK.id; + m7.VisitorBrackets_Team__c = teamK.id; + + Brackets_Match__c m8 = matches2.get(3); + m8.HomeBrackets_Team__c = teamL.id; + //m8.VisitorBrackets_Team__c = teamL.id; + + update matches2; + + //validation + tournament.deadline__c = Datetime.now().addMinutes(1); + tournament.Allow_Update__c = true; + tournament.Version__c = 2.0; + update tournament; + + System.assert( + [ + SELECT Id, Deadline__c + FROM Brackets_Tournament__c + WHERE Id = :tournament.Id + ] + .Deadline__c != null + ); + + //now we should be able to export, delete and reimport + Apexpages.currentPage().getParameters().put('id', tournament.Id); + Apexpages.currentPage().getParameters().put('tVersion', '1'); + BracketsSitesTournamentPublisher ut = new BracketsSitesTournamentPublisher(); + + String updateVersion1 = ut.getOutputXml(); + system.assert(updateVersion1 != null); + + //now we'll make some modifications and get an update version 2. + String teamAName = teamA.Name; + String teamANewName = 'teamA update update ' + Datetime.now(); + teamA.Name = teamANewName; + update teamA; + + //update match1 so it has a winner. + m1.WinnerBrackets_Team__c = teamA.id; + m1.HomeScore__c = 10; + Datetime updatedSchedule = Datetime.now().addMinutes(5); + m1.Schedule__c = updatedSchedule; + update m1; + + //update the version of the tournament + tournament.Version__c = 3.0; + update tournament; + + //get a new version of the code + Apexpages.currentPage().getParameters().put('id', tournament.Id); + Apexpages.currentPage().getParameters().put('tVersion', '2'); + BracketsSitesTournamentPublisher ut2 = new BracketsSitesTournamentPublisher(); + + String updateVersion2 = ut2.getOutputXml(); + system.assert(updateVersion2 != null); + System.debug('1234'); + + //now clean update a bunch of stuff + delete tournament; + List postDelete = [ + SELECT Id, Name + FROM Brackets_Round__c + WHERE Brackets_Tournament__c = :tournament.id + ]; + System.assert(postDelete.size() == 0); + List originalteams = [ + SELECT Id, Name + FROM Brackets_Team__c + WHERE Id IN :auxList + ]; + System.assert(originalTeams.size() == 12); + delete originalTeams; + List originalteams2 = [ + SELECT Id, Name + FROM Brackets_Team__c + WHERE Id IN :auxList + ]; + System.assert(originalTeams2.size() == 0); + BracketsImportTournament importTournament = new BracketsImportTournament( + 'manual' + ); + + //get all tournaments + List allTournamentsPostUpdate = [ + SELECT Id, Name + FROM Brackets_Tournament__c + ]; + List allTeams = [ + SELECT Id, Name, ExternalId__c + FROM Brackets_Team__c + ]; + System.assert(allTeams.size() == baselineTeams.size()); + + importTournament.processImportedDocument(updateVersion1); + + //validate that the correct number of teams are here + System.assert( + [SELECT Id FROM Brackets_Tournament__c].size() == + baselineTour.size() + 1 + ); + System.assert( + [SELECT Id FROM Brackets_Team__c].size() == + baselineTeams.size() + auxList.size() + ); + System.assert( + [SELECT Id FROM Brackets_Round__c].size() == + baselineRound.size() + 4 + ); + System.assert( + [SELECT Id FROM Brackets_Match__c].size() == + baselineMatch.size() + 11 + ); + + Brackets_Tournament__c newTournament = importTournament.tournament; + + System.debug(logginglevel.info, '12345: ' + newTournament); + + System.assert(newTournament.id != tournament.id); + System.assert(newTournament.name == tournament.name); + System.assert(newTournament.deadline__c != null); + + List newRounds = [ + SELECT Id, Name + FROM Brackets_Round__c + WHERE Brackets_Tournament__c = :newTournament.id + ]; + System.assert(newRounds.size() == 4); + + Brackets_Round__c newRound1 = newRounds.get(0); + List newMatches = [ + SELECT + Id, + Name, + Conference__c, + Position__c, + Schedule__c, + FollowingBrackets_Match__c, + HomeBrackets_Team__c, + VisitorBrackets_Team__c + FROM Brackets_Match__c + WHERE Brackets_Round__c = :newRound1.id + ORDER BY Position__c + ]; + Brackets_Match__c newm1 = newMatches.get(0); + System.assert(newm1.Schedule__c != null); + System.assert(originalSchedule != null); + System.assert( + newm1.Schedule__c.minuteGmt() == originalSchedule.minuteGmt(), + 'Original: ' + + originalSchedule + + ' Match: ' + + newm1.Schedule__c + ); + Brackets_Team__c newTeamA = [ + SELECT Id, Name, ExternalId__c + FROM Brackets_Team__c + WHERE Id = :newm1.HomeBrackets_Team__c + ]; + System.assert(newTeamA.Name == teamAName); + System.assert(newTeamA.Id != teamA.Id); + System.assert(newTeamA.ExternalId__c == teamA.Id); + + //now let's do another update + BracketsImportTournament importTournament2 = new BracketsImportTournament( + 'manual' + ); + importTournament2.processImportedDocument(updateVersion2); + //validate that the correct number of teams are here + System.assert( + [SELECT Id FROM Brackets_Tournament__c].size() == + baselineTour.size() + 1 + ); + System.assert( + [SELECT Id FROM Brackets_Team__c].size() == + baselineTeams.size() + auxList.size() + ); + System.assert( + [SELECT Id FROM Brackets_Round__c].size() == + baselineRound.size() + 4 + ); + System.assert( + [SELECT Id FROM Brackets_Match__c].size() == + baselineMatch.size() + 11 + ); + + //now on to the detail validation + Brackets_Tournament__c newTournament2 = importTournament2.tournament; + System.assert(newTournament2.id != tournament.id); + System.assert(newTournament2.name == tournament.name); + + List newRoundsA = [ + SELECT Id, Name + FROM Brackets_Round__c + WHERE Brackets_Tournament__c = :newTournament2.id + ]; + System.assert(newRoundsA.size() == 4); + + Brackets_Round__c newRound1A = newRoundsA.get(0); + List newMatchesA = [ + SELECT + Id, + Name, + Conference__c, + Schedule__c, + Position__c, + FollowingBrackets_Match__c, + HomeBrackets_Team__c, + VisitorBrackets_Team__c, + WinnerBrackets_Team__c, + HomeScore__c + FROM Brackets_Match__c + WHERE Brackets_Round__c = :newRound1A.id + ORDER BY Position__c + ]; + Brackets_Match__c newm1A = newMatchesA.get(0); + System.assert( + newm1A.Schedule__c.minuteGmt() != originalSchedule.minuteGmt() + ); + System.assert( + newm1A.Schedule__c.minuteGmt() == updatedSchedule.minuteGmt() + ); + Brackets_Team__c newTeamAA = [ + SELECT Id, Name, ExternalId__c + FROM Brackets_Team__c + WHERE Id = :newm1A.HomeBrackets_Team__c + ]; + System.assert(newTeamAA.Name == teamANewName); + System.assert(newTeamAA.Id != teamA.Id); + System.assert(newTeamAA.ExternalId__c == teamA.Id); + + System.assert(newm1A.WinnerBrackets_Team__c != null); + System.assert(newm1A.WinnerBrackets_Team__c == newTeamAA.Id); + System.assert(newm1A.HomeScore__c == m1.HomeScore__c); + } + + } +} diff --git a/src/classes/BracketsExportImportTest.cls-meta.xml b/force-app/main/default/classes/BracketsExportImportTest.cls-meta.xml similarity index 57% rename from src/classes/BracketsExportImportTest.cls-meta.xml rename to force-app/main/default/classes/BracketsExportImportTest.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsExportImportTest.cls-meta.xml +++ b/force-app/main/default/classes/BracketsExportImportTest.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsExportTeams.cls b/force-app/main/default/classes/BracketsExportTeams.cls new file mode 100644 index 0000000..92ad99b --- /dev/null +++ b/force-app/main/default/classes/BracketsExportTeams.cls @@ -0,0 +1,119 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ +public with sharing class BracketsExportTeams { + private String tournamentId { get; set; } + public Xmlstreamwriter out { get; set; } + + /** + * Constructor + * @param tourId + * @param writer + */ + public BracketsExportTeams(String tourId, Xmlstreamwriter writer) { + this.tournamentId = tourId; + this.out = writer; + } + + /** + * Method in charge of handling the export task related + * @return Xmlstreamwriter + */ + public Xmlstreamwriter BracketsexportTeams() { + List matches = [ + SELECT + m.VisitorBrackets_Team__c, + m.Brackets_Round__r.Brackets_Tournament__c, + m.Brackets_Round__c, + m.Name, + m.Id, + m.HomeBrackets_Team__c + FROM Brackets_Match__c m + WHERE + m.Brackets_Round__r.Brackets_Tournament__c = :this.tournamentId + ]; + + Set teamIds = new Set(); + for (Brackets_Match__c match : matches) { + teamIds.add(match.HomeBrackets_Team__c); + teamIds.add(match.VisitorBrackets_Team__c); + } + + List teams = [ + SELECT Id, Name, ShortName__c, Description__c, Rank__c + FROM Brackets_Team__c + WHERE Id IN :teamIds + ]; + + this.buildXmlString(teams); + + return this.out; + } + + /** + * Method in charge of compiling XML document with Team Information + * @param teamList + */ + public void buildXmlString(List teamList) { + this.out.writeStartElement(null, 'Teams', null); + + for (Brackets_Team__c team : teamList) { + this.out.writeStartElement(null, 'Team', null); + + BracketsImportExportUtilities.writeElement( + this.out, + 'id', + '' + team.Id + ); + BracketsImportExportUtilities.writeElement( + this.out, + 'name', + '' + team.Name + ); + BracketsImportExportUtilities.writeElement( + this.out, + 'description', + '' + team.Description__c + ); + BracketsImportExportUtilities.writeElement( + this.out, + 'rank', + '' + team.Rank__c + ); + BracketsImportExportUtilities.writeElement( + this.out, + 'shortname', + '' + team.ShortName__c + ); + + this.out.writeEndElement(); + } + + this.out.writeEndElement(); + } +} diff --git a/src/classes/BracketsExportTeams.cls-meta.xml b/force-app/main/default/classes/BracketsExportTeams.cls-meta.xml similarity index 57% rename from src/classes/BracketsExportTeams.cls-meta.xml rename to force-app/main/default/classes/BracketsExportTeams.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsExportTeams.cls-meta.xml +++ b/force-app/main/default/classes/BracketsExportTeams.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsExportTeamsTest.cls b/force-app/main/default/classes/BracketsExportTeamsTest.cls new file mode 100644 index 0000000..477aca9 --- /dev/null +++ b/force-app/main/default/classes/BracketsExportTeamsTest.cls @@ -0,0 +1,78 @@ +@isTest +class BracketsExportTeamsTest { + @isTest + static void testExportTeams() { + Brackets_Tournament__c tournament = BracketsTestUtilities.createFullTournament( + 4, + BracketsTournamentUtilities.STANDARD_TOURNAMENT_TYPE + ); + BracketsExportTeams bracketsExportTeams = new BracketsExportTeams( + tournament.Id, + new Xmlstreamwriter() + ); + Xmlstreamwriter writer = bracketsExportTeams.BracketsexportTeams(); + System.assert(writer.getXmlString() != null); + } + + @isTest + static void testExportTeamsWithImport() { + Brackets_Team__c teamA = BracketsTestUtilities.createTeam( + 'A-Team' + Datetime.now() + ); + Brackets_Team__c teamB = BracketsTestUtilities.createTeam( + 'B-Team' + Datetime.now() + ); + Brackets_Team__c teamC = BracketsTestUtilities.createTeam( + 'C-Team' + Datetime.now() + ); + Brackets_Team__c teamD = BracketsTestUtilities.createTeam( + 'D-Team' + Datetime.now() + ); + + List teams = new List(); + teams.add(teamA); + teams.add(teamB); + teams.add(teamC); + teams.add(teamD); + + insert teams; + + List allTeams = [ + SELECT Id, Name, ExternalID__c + FROM Brackets_Team__c + ]; + + delete teams; + + BracketsExportTeams exportTeams = new BracketsExportTeams( + null, + new Xmlstreamwriter() + ); + + exportTeams.buildXmlString(teams); + + String s = exportTeams.out.getXmlString(); + + System.debug(LoggingLevel.Info, '1234' + s); + + BracketsImportTeams importTeams = new BracketsImportTeams(); + + importTeams.processImportedDocument(s); + + List allTeams2 = [ + SELECT Id, Name, ExternalID__c + FROM Brackets_Team__c + ]; + + System.assert(allTeams.size() == allTeams2.size()); + + importTeams.processImportedDocument(s); + + List allTeams3 = [ + SELECT Id, Name, ExternalID__c + FROM Brackets_Team__c + ]; + + System.assert(allTeams.size() == allTeams3.size()); + } +} diff --git a/force-app/main/default/classes/BracketsExportTeamsTest.cls-meta.xml b/force-app/main/default/classes/BracketsExportTeamsTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsExportTeamsTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/src/classes/BracketsImportExportUtilities.cls b/force-app/main/default/classes/BracketsFeedItemUtility.cls similarity index 57% rename from src/classes/BracketsImportExportUtilities.cls rename to force-app/main/default/classes/BracketsFeedItemUtility.cls index 408a224..d456e61 100644 --- a/src/classes/BracketsImportExportUtilities.cls +++ b/force-app/main/default/classes/BracketsFeedItemUtility.cls @@ -26,36 +26,37 @@ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISE OF THE POSSIBILITY OF SUCH DAMAGE. */ -public with sharing class BracketsImportExportUtilities{ - - public static final String NOT_UPDATES_FOUND = 'No Updates found.'; - public static final String JSON_PARAMENTER = 'json'; - public static final String MISSING_TOURNAMENT = 'The tournament was deleted.'; - public static final String SUCCESSFUL_TOURNAMENT_IMPORT = 'Import successful.'; - public static final String FAIL_TOURNAMENT_IMPORT = 'Import failed.'; - public static final String PARENT_TOURNAMENT_SITE_ERRORS = 'Tournament source site reports errors: '; - public static final String ERROR_TAG = 'error'; - - /** - * Method used for sanatizing input for XML document - * @param out - * @param tag - * @param content - */ - public static void writeElement( Xmlstreamwriter out, String tag, String content ){ - - out.writeStartElement( null, tag, null ); - out.writeCharacters( EncodingUtil.urlEncode( content, 'UTF-8' ) ); - out.writeEndElement(); - - } - - /** - * Method for decoding strings from XML document - * @param reader - * @return String - */ - public static String getDecodedString( Xmlstreamreader reader ){ - return EncodingUtil.urlDecode( reader.getText(), 'UTF-8' ).trim(); - } -} \ No newline at end of file +public class BracketsFeedItemUtility { + public Boolean isStandardUser() { + return UserInfo.getUserType() == 'Standard'; + } + + public String getLastTournamentGroupChatter(Id groupId, Integer maxLength) { + if (!isStandardUser()) { + return ''; + } + + String ret = ''; + + List items = [ + SELECT Id, Body + FROM Brackets_Group__Feed + WHERE ParentId = :groupId AND Type = 'TextPost' + ORDER BY CreatedDate DESC + LIMIT 1 + ]; + + if (items.size() == 1) { + Brackets_Group__Feed item = items.get(0); + ret = item.Body; + if (ret.length() > maxLength) { + ret = ret.substring(0, maxLength - 3); + if (item.Body.length() > ret.length()) { + ret += '...'; + } + } + } + + return ret; + } +} diff --git a/src/classes/BracketsFeedItemUtility.cls-meta.xml b/force-app/main/default/classes/BracketsFeedItemUtility.cls-meta.xml similarity index 77% rename from src/classes/BracketsFeedItemUtility.cls-meta.xml rename to force-app/main/default/classes/BracketsFeedItemUtility.cls-meta.xml index 5723dc0..c0118fb 100644 --- a/src/classes/BracketsFeedItemUtility.cls-meta.xml +++ b/force-app/main/default/classes/BracketsFeedItemUtility.cls-meta.xml @@ -1,4 +1,4 @@ - + 21.0 Active diff --git a/force-app/main/default/classes/BracketsFeedItemUtilityTest.cls b/force-app/main/default/classes/BracketsFeedItemUtilityTest.cls new file mode 100644 index 0000000..e25a560 --- /dev/null +++ b/force-app/main/default/classes/BracketsFeedItemUtilityTest.cls @@ -0,0 +1,51 @@ +@isTest +class BracketsFeedItemUtilityTest { + @isTest + static void testLastChatter() { + BracketsTournamentUtilities.CreatingTournamentTree = true; + //Create a user + User testUser = BracketsTestUtilities.createUser(); + + System.runAs(testUser) { + Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament( + 'Test1 RoundByRound', + 4 + ); + + List ts = new List(); + ts.add(tournament.Id); + + Brackets_Group__c groupA = BracketsTestUtilities.getGroup( + tournament.Id, + BracketsGroupUtilities.BET_TYPE_BY_ROUND + ); + + BracketsFeedItemUtility util = new BracketsFeedItemUtility(); + + String s = util.getLastTournamentGroupChatter(groupA.id, 40); + + System.assertEquals(s, ''); + + FeedItem item = new FeedItem(); + item.parentId = groupA.id; + item.body = 'This is a test'; + insert item; + + s = util.getLastTournamentGroupChatter(groupA.id, 40); + + System.assert(s != null); + System.assertEquals(s, 'This is a test'); + + FeedItem item2 = new FeedItem(); + item2.parentId = groupA.id; + item2.body = 'This is a test56789 123456789 123456789 123456789'; + insert item2; + + s = util.getLastTournamentGroupChatter(groupA.id, 40); + + System.assert(s != null); + System.assertEquals(s, 'This is a test56789 123456789 1234567...'); + } + + } +} diff --git a/force-app/main/default/classes/BracketsFeedItemUtilityTest.cls-meta.xml b/force-app/main/default/classes/BracketsFeedItemUtilityTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsFeedItemUtilityTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsGetStartedController.cls b/force-app/main/default/classes/BracketsGetStartedController.cls new file mode 100644 index 0000000..61ddc97 --- /dev/null +++ b/force-app/main/default/classes/BracketsGetStartedController.cls @@ -0,0 +1,165 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ +public with sharing class BracketsGetStartedController { + //public final String TOURNAMENT_SOURCE = 'http://free-12415f14c3a-124e539428a-12d5e7eb4ff.force.com/?id=a0MA00000034DNRMA2'; + //public final String TOURNAMENT_SOURCE = 'http://free-12415f14c3a-124e539428a-12d5e7eb4ff.force.com/?id=a0MA00000034OoeMAE'; + + //For basketball release + public final String SAMPLE_SOURCE = 'http://free-12415f14c3a-124e539428a-12d5e7eb4ff.force.com/?id=a06A000000AylgsIAB'; + public final String FULL_SOURCE = 'http://free-12415f14c3a-124e539428a-12d5e7eb4ff.force.com/?id=a06A000000AylunIAB'; + + public Boolean isCompleteStep1 { get; set; } + public Boolean isCompleteStep2 { get; set; } + public Boolean isError { get; set; } + public String errorMessage { get; set; } + + public BracketsGetStartedController() { + isCompleteStep1 = false; + isCompleteStep2 = false; + isError = false; + + BracketsSettingsPersonal__c settings = BracketsSettingsPersonal__c.getOrgDefaults(); + if (settings != null && settings.Initial_Setup_Complete__c) { + //this.isError = true; + //this.errorMessage = 'Initial setup is already complete.'; + this.isCompleteStep1 = true; + } + + if (settings != null && settings.Initial_Setup_Step_2_Complete__c) { + this.isCompleteStep2 = true; + } + } + + public void getStarted() { + BracketsSettingsPersonal__c settings = BracketsSettingsPersonal__c.getOrgDefaults(); + if (settings != null && settings.Initial_Setup_Complete__c) { + this.isError = true; + this.errorMessage = 'Initial setup is already complete.'; + this.isCompleteStep1 = true; + return; + } + + try { + handleGetStarted(SAMPLE_SOURCE); + + //create settings + settings = BracketsSettingsPersonal__c.getOrgDefaults(); + if (settings == null) { + settings = new BracketsSettingsPersonal__c(); + } + settings.Initial_Setup_Complete__c = true; + upsert settings; + + this.isCompleteStep1 = true; + } catch (Exception e) { + this.isError = true; + this.isCompleteStep1 = false; + this.errorMessage = + 'Unable to complete installation [BracketsGetStartedController]: ' + + e.getMessage(); + } + } + + public void handleGetStarted(String targetURL) { + //Baseline tournaments in case this is a re-rerun + //List baselineTournaments = [Select Id, Name From Brackets_Tournament__c Limit ]; + + //import a tournament + BracketsProccessUpdate processUpdate = new BracketsProccessUpdate( + targetURL + ); + + //new tournament + Brackets_Tournament__c importedTournament = [ + SELECT Id, Name + FROM Brackets_Tournament__c + ORDER BY CreatedDate DESC + LIMIT 1 + ]; + + //based on the imported tournament, create a pool + Brackets_Group__c newGroup = new Brackets_Group__c(); + newGroup.Brackets_Tournament__c = importedTournament.id; + newGroup.Type__c = BracketsGroupUtilities.BET_TYPE_FULL_TOURNAMENT; + newGroup.Name = importedTournament.Name + ' [Full]'; + insert newGroup; + + //join the current user to that pool + Brackets_UserTournament__c userTour = new Brackets_UserTournament__c(); + userTour.Brackets_Tournament__c = importedTournament.id; + userTour.Brackets_Group__c = newGroup.id; + userTour.User__c = Userinfo.getUserId(); + insert userTour; + + //based on the imported tournament, create a pool + Brackets_Group__c newGroup2 = new Brackets_Group__c(); + newGroup2.Brackets_Tournament__c = importedTournament.id; + newGroup2.Type__c = BracketsGroupUtilities.BET_TYPE_BY_ROUND; + newGroup2.Name = importedTournament.Name + ' [Round]'; + insert newGroup2; + + //join the current user to that pool + Brackets_UserTournament__c userTour2 = new Brackets_UserTournament__c(); + userTour2.Brackets_Tournament__c = importedTournament.id; + userTour2.Brackets_Group__c = newGroup2.id; + userTour2.User__c = Userinfo.getUserId(); + insert userTour2; + } + public void getStartedStep2() { + BracketsSettingsPersonal__c settings = BracketsSettingsPersonal__c.getOrgDefaults(); + if (settings != null && settings.Initial_Setup_Step_2_Complete__c) { + this.isError = true; + this.errorMessage = 'Initial setup 2 is already complete.'; + this.isCompleteStep2 = true; + return; + } + + try { + handleGetStarted(FULL_SOURCE); + + //create settings + settings = BracketsSettingsPersonal__c.getOrgDefaults(); + if (settings == null) { + settings = new BracketsSettingsPersonal__c(); + } + settings.Initial_Setup_Step_2_Complete__c = true; + upsert settings; + + this.isCompleteStep2 = true; + } catch (Exception e) { + System.debug('Yes I found the error'); + this.isError = true; + this.isCompleteStep1 = false; + this.isCompleteStep2 = false; + this.errorMessage = + 'Unable to complete installation [BracketsGetStartedController]: ' + + e.getMessage(); + } + } +} diff --git a/src/classes/BracketsGetStartedController.cls-meta.xml b/force-app/main/default/classes/BracketsGetStartedController.cls-meta.xml similarity index 77% rename from src/classes/BracketsGetStartedController.cls-meta.xml rename to force-app/main/default/classes/BracketsGetStartedController.cls-meta.xml index 5723dc0..c0118fb 100644 --- a/src/classes/BracketsGetStartedController.cls-meta.xml +++ b/force-app/main/default/classes/BracketsGetStartedController.cls-meta.xml @@ -1,4 +1,4 @@ - + 21.0 Active diff --git a/force-app/main/default/classes/BracketsGroupUtilities.cls b/force-app/main/default/classes/BracketsGroupUtilities.cls new file mode 100644 index 0000000..a8205b4 --- /dev/null +++ b/force-app/main/default/classes/BracketsGroupUtilities.cls @@ -0,0 +1,122 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ +public with sharing class BracketsGroupUtilities { + public static final String BET_TYPE_BY_ROUND = 'Round By Round'; + public static final String BET_TYPE_FULL_TOURNAMENT = 'Full Tournament'; + + /** + * Return a list of groups for each tournament + * + * @param tournaments List of tournamntes + * @param userd User (if not null, then filter by user too) + */ + public static Map> getGroups( + List tournaments, + Id userid + ) { + Map> mapOfListGroup = new Map>(); + List listOfGroup; + List groupsByTournament; + + // Select groups + if (userid != null) { + groupsByTournament = [ + SELECT Id, Name, Brackets_Tournament__c + FROM Brackets_Group__c + WHERE + Id IN ( + SELECT ut.Brackets_Group__c + FROM Brackets_UserTournament__c ut + WHERE + ut.User__c = :userid + AND ut.Brackets_Tournament__c IN :tournaments + ) + ]; + } else { + groupsByTournament = [ + SELECT Id, Name, Brackets_Tournament__c + FROM Brackets_Group__c + WHERE Brackets_Tournament__c IN :tournaments + ]; + } + + // Process data in a list of tournaments by group + for (Brackets_Group__c groupy : groupsByTournament) { + for (Id tournamentId : tournaments) { + if (groupy.Brackets_Tournament__c == tournamentId) { + listOfGroup = mapOfListGroup.get(tournamentId); + if (listOfGroup == null) { + listOfGroup = new List(); + mapOfListGroup.put(tournamentId, listOfGroup); + } + listOfGroup.add(groupy); + } + } + } + + return mapOfListGroup; + } + + public static List getGroups(Id tournament, Id userid) { + List groups = new List(); + groups.add(tournament); + return getGroups(groups, userid).get(tournament); + } + + public static List getGroups(Id userId) { + return [ + SELECT + Id, + Name, + Brackets_Tournament__c, + NumOfMembers__c, + Status__c, + Type__c, + (SELECT Id FROM g.UserTornaments__r WHERE User__c = :userId) + FROM Brackets_Group__c g + LIMIT :Limits.getLimitQueryRows() + ]; + } + + public static Boolean hasUserTournament(Brackets_Group__c groupp) { + return groupp.UserTornaments__r.size() > 0; + } + + public static void deleteGroups(List tournaments) { + List tournamentsId = new List(); + for (Brackets_Tournament__c tournament : tournaments) { + tournamentsId.add(tournament.Id); + } + delete [ + SELECT Id + FROM Brackets_Group__c + WHERE Brackets_Tournament__c IN :tournamentsId + ]; + } +} diff --git a/src/classes/BracketsGroupUtilities.cls-meta.xml b/force-app/main/default/classes/BracketsGroupUtilities.cls-meta.xml similarity index 57% rename from src/classes/BracketsGroupUtilities.cls-meta.xml rename to force-app/main/default/classes/BracketsGroupUtilities.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsGroupUtilities.cls-meta.xml +++ b/force-app/main/default/classes/BracketsGroupUtilities.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsGroupUtilitiesTest.cls b/force-app/main/default/classes/BracketsGroupUtilitiesTest.cls new file mode 100644 index 0000000..6282164 --- /dev/null +++ b/force-app/main/default/classes/BracketsGroupUtilitiesTest.cls @@ -0,0 +1,66 @@ +@isTest +class BracketsGroupUtilitiesTest { + @isTest + static void testBasics() { + System.assert(BracketsGroupUtilities.BET_TYPE_BY_ROUND != null); + System.assert(BracketsGroupUtilities.BET_TYPE_FULL_TOURNAMENT != null); + } + + @isTest + static void testGetGroups() { + BracketsTournamentUtilities.CreatingTournamentTree = true; + //Create a user + User testUser = BracketsTestUtilities.createUser(); + + System.runAs(testUser) { + Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament( + 'Test1 RoundByRound', + 4 + ); + + List ts = new List(); + ts.add(tournament.Id); + + Brackets_Group__c groupA = BracketsTestUtilities.getGroup( + tournament.Id, + BracketsGroupUtilities.BET_TYPE_BY_ROUND + ); + Brackets_Group__c groupB = BracketsTestUtilities.getGroup( + tournament.Id, + BracketsGroupUtilities.BET_TYPE_BY_ROUND + ); + + Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament( + Userinfo.getUserId(), + tournament.Id, + groupA.Id + ); + + Map> results = BracketsGroupUtilities.getGroups( + ts, + testUser.id + ); + + System.assert(results != null); + System.assert(results.get(tournament.id) != null); + System.assert(results.get(tournament.id).size() == 1); + + Map> results2 = BracketsGroupUtilities.getGroups( + ts, + null + ); + + System.assert(results2 != null); + System.assert(results2.get(tournament.id) != null); + System.assert(results2.get(tournament.id).size() == 2); + + //just get the group + List groups = BracketsGroupUtilities.getGroups( + tournament.id, + testUser.id + ); + System.assert(groups.size() == 1); + } + + } +} diff --git a/force-app/main/default/classes/BracketsGroupUtilitiesTest.cls-meta.xml b/force-app/main/default/classes/BracketsGroupUtilitiesTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsGroupUtilitiesTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsImportExportUtilities.cls b/force-app/main/default/classes/BracketsImportExportUtilities.cls new file mode 100644 index 0000000..2d72c48 --- /dev/null +++ b/force-app/main/default/classes/BracketsImportExportUtilities.cls @@ -0,0 +1,62 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ +public with sharing class BracketsImportExportUtilities { + public static final String NOT_UPDATES_FOUND = 'No Updates found.'; + public static final String JSON_PARAMENTER = 'json'; + public static final String MISSING_TOURNAMENT = 'The tournament was deleted.'; + public static final String SUCCESSFUL_TOURNAMENT_IMPORT = 'Import successful.'; + public static final String FAIL_TOURNAMENT_IMPORT = 'Import failed.'; + public static final String PARENT_TOURNAMENT_SITE_ERRORS = 'Tournament source site reports errors: '; + public static final String ERROR_TAG = 'error'; + + /** + * Method used for sanatizing input for XML document + * @param out + * @param tag + * @param content + */ + public static void writeElement( + Xmlstreamwriter out, + String tag, + String content + ) { + out.writeStartElement(null, tag, null); + out.writeCharacters(EncodingUtil.urlEncode(content, 'UTF-8')); + out.writeEndElement(); + } + + /** + * Method for decoding strings from XML document + * @param reader + * @return String + */ + public static String getDecodedString(Xmlstreamreader reader) { + return EncodingUtil.urlDecode(reader.getText(), 'UTF-8').trim(); + } +} diff --git a/src/classes/BracketsImportExportUtilities.cls-meta.xml b/force-app/main/default/classes/BracketsImportExportUtilities.cls-meta.xml similarity index 57% rename from src/classes/BracketsImportExportUtilities.cls-meta.xml rename to force-app/main/default/classes/BracketsImportExportUtilities.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsImportExportUtilities.cls-meta.xml +++ b/force-app/main/default/classes/BracketsImportExportUtilities.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsImportTeams.cls b/force-app/main/default/classes/BracketsImportTeams.cls new file mode 100644 index 0000000..9ec73c2 --- /dev/null +++ b/force-app/main/default/classes/BracketsImportTeams.cls @@ -0,0 +1,170 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ +public with sharing class BracketsImportTeams { + private List teamList { get; set; } + + /** + * Constructor + */ + public BracketsImportTeams() { + } + + /** + * Method in charge of retrieving and compiling the data from imported file, + * for then inserting into the system. + * @param xml + */ + public void processImportedDocument(String xml) { + this.teamList = new List(); + + try { + this.readingTeamData(xml); + System.debug(LoggingLevel.Info, '12345:' + this.teamList); + upsert this.teamList ExternalId__c; + } catch (Exception ex) { + throw new BracketsException( + 'Error Importing your Tournament Template [BracketsImportTeams] ' + + ex.getMessage(), + ex + ); + } + } + + /** + * Method in charge of retrieving and compiling the Team data from imported file, + * for then inserting into the system. + * @param xml + */ + private void readingTeamData(String xml) { + Xmlstreamreader reader = new Xmlstreamreader(xml); + + while (reader.hasNext()) { + if ( + reader.getEventType() == XmlTag.START_ELEMENT && + reader.getLocalName() == 'Team' + ) { + this.parseTeamData(reader); + } + if ( + reader.getEventType() == XmlTag.END_ELEMENT && + reader.getLocalName() == 'Teams' + ) { + break; + } + reader.next(); + } + } + + /** + * Method in charge of parsing Team data from XMl document + * @param reader + * @return correctMetaData + */ + private void parseTeamData(Xmlstreamreader reader) { + Brackets_Team__c team = new Brackets_Team__c(); + + while (reader.hasNext()) { + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'name' + ) { + reader.next(); + team.Name = BracketsImportExportUtilities.getDecodedString( + reader + ); + //RSC - replaced using "ID" below. + //team.ExternalId__c = team.Name; + } + + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'shortname' + ) { + reader.next(); + team.ShortName__c = BracketsImportExportUtilities.getDecodedString( + reader + ); + team.ShortName__c = (team.ShortName__c.equalsIgnoreCase('null')) + ? null + : team.ShortName__c; + } + + //RSC added + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'id' + ) { + reader.next(); + team.ExternalId__c = BracketsImportExportUtilities.getDecodedString( + reader + ); + } + + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'description' + ) { + reader.next(); + String descValue = BracketsImportExportUtilities.getDecodedString( + reader + ); + if (descValue == 'null') { + team.Description__c = ''; + } else { + team.Description__c = descValue; + } + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'rank' + ) { + reader.next(); + String value = BracketsImportExportUtilities.getDecodedString( + reader + ); + if (value == 'null') { + team.Rank__c = null; + } else { + team.Rank__c = team.Rank__c = Decimal.valueOf(value); + } + } + //Validate end of tag + if ( + reader.getEventType() == XMLTag.END_ELEMENT && + reader.getLocalName() == 'Team' + ) { + break; + } + + reader.next(); + } + + this.teamList.add(team); + } +} diff --git a/src/classes/BracketsImportTeams.cls-meta.xml b/force-app/main/default/classes/BracketsImportTeams.cls-meta.xml similarity index 57% rename from src/classes/BracketsImportTeams.cls-meta.xml rename to force-app/main/default/classes/BracketsImportTeams.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsImportTeams.cls-meta.xml +++ b/force-app/main/default/classes/BracketsImportTeams.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsImportTeamsTest.cls b/force-app/main/default/classes/BracketsImportTeamsTest.cls new file mode 100644 index 0000000..1a796a4 --- /dev/null +++ b/force-app/main/default/classes/BracketsImportTeamsTest.cls @@ -0,0 +1,35 @@ +@isTest +class BracketsImportTeamsTest { + @isTest + static void testTeamImportValid() { + delete [SELECT Id FROM Brackets_Tournament__c]; + + BracketsImportTeams impTeams = new BracketsImportTeams(); + + try { + impTeams.processImportedDocument( + BracketsTestUtilities.xmlTournamentValid + ); + List teamList = [SELECT id FROM Brackets_Team__c]; + System.assert(teamList.size() > 0); + } catch (Exception ex) { + System.assert(false); + } + } + + @isTest + static void testTeamImportInvalid() { + delete [SELECT Id FROM Brackets_Tournament__c]; + + BracketsImportTeams impTeams = new BracketsImportTeams(); + + try { + impTeams.processImportedDocument( + BracketsTestUtilities.xmlTournamentTeamInValid + ); + System.assert(false); + } catch (Exception ex) { + System.assert(true); + } + } +} diff --git a/force-app/main/default/classes/BracketsImportTeamsTest.cls-meta.xml b/force-app/main/default/classes/BracketsImportTeamsTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsImportTeamsTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsImportTournament.cls b/force-app/main/default/classes/BracketsImportTournament.cls new file mode 100644 index 0000000..ec5dbae --- /dev/null +++ b/force-app/main/default/classes/BracketsImportTournament.cls @@ -0,0 +1,667 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +public with sharing class BracketsImportTournament { + private String source; + public Brackets_Tournament__c tournament { get; set; } + private List roundList { get; set; } + private List matchList { get; set; } + //ExternalId - ID + private Map teamList { get; set; } + //ExternalId - ID + private Map roundSync { get; set; } + private Map matchSync { get; set; } + private Map matchFollowingMatchId { get; set; } + private Map matchFollowingMatchSObject { + get; + set; + } + + /** + * Constructor + */ + public BracketsImportTournament(String source) { + this.source = source; + this.roundList = new List(); + this.matchList = new List(); + this.teamList = new Map(); + this.roundSync = new Map(); + this.matchSync = new Map(); + this.matchFollowingMatchId = new Map(); + this.matchFollowingMatchSObject = new Map(); + } + + /** + * Method in charge of retrieving and compiling the data from imported file, + * for then inserting into the system. + * @param document + */ + public void processImportedDocument(String xml) { + Brackets_Match__c followingMatch; + String followingMatchExternalId; + BracketsTournamentUtilities.CreatingTournamentTree = true; + Savepoint sp = Database.setSavepoint(); + + //Initialize the schedule job + //TODO FUTURE - Do we need this? + //BracketsScheduleJob.createSingleInstance(); + + this.validate(xml); + try { + try { + BracketsImportTeams impTeams = new BracketsImportTeams(); + impTeams.processImportedDocument(xml); + //creates internal map for use when importing Matches and refered teams + List teams = [ + SELECT t.Name, t.Id, t.ShortName__c, t.ExternalId__c + FROM Brackets_Team__c t + LIMIT 1000 + ]; + for (Brackets_Team__c team : teams) { + this.teamList.put(team.ExternalId__c, team.Id); + } + } catch (Exception ex) { + throw new BracketsException( + 'Error Importing: Please check your Team Data', + ex + ); + } + try { + this.readingTournamentData(xml); + upsert this.tournament ExternalId__c; + + //Map the Tournament Object again + this.tournament = [ + SELECT + t.isChild__c, + t.Version__c, + t.Update_Source__c, + t.Type__c, + t.TeamCount__c, + t.Start__c, + t.Name, + t.MaxRoundNumber__c, + t.Id, + t.ExternalId__c, + t.End__c, + t.Description__c, + t.CronTrigger__c, + t.Allow_Update__c, + t.Deadline__c + FROM Brackets_Tournament__c t + WHERE t.Id = :this.tournament.Id + ]; + + this.tournament.isChild__c = true; + this.tournament.Allow_Update__c = false; + upsert this.tournament ExternalId__c; + } catch (Exception ex) { + throw new BracketsException( + 'Error Importing: Please check your Tournament Data [BracketsImportTournament] ', + ex + ); + } + try { + this.readingRoundsData(xml); + upsert this.roundList ExternalId__c; + for (Brackets_Round__c r : this.roundList) { + this.roundSync.put(r.ExternalId__c, r.Id); + } + } catch (Exception ex) { + throw new BracketsException( + 'Error Importing: Please check your Round Data', + ex + ); + } + + try { + for (Brackets_Match__c m : this.matchList) { + String roundExtId = this.matchSync.get(m.ExternalId__c); + m.Brackets_Round__c = this.roundSync.get(roundExtId); + } + upsert this.matchList ExternalId__c; + + for (Brackets_Match__c m : this.matchList) { + followingMatchExternalId = this.matchFollowingMatchId.get( + m.ExternalId__c + ); + if (followingMatchExternalId != null) { + followingMatch = this.matchFollowingMatchSObject.get( + followingMatchExternalId + ); + if (followingMatch != null) { + m.FollowingBrackets_Match__c = followingMatch.Id; + } + } + } + upsert this.matchList; + + // Update predictdions points + BracketsMatchesPredictionUtil.updateUserMatchPredictionPoints( + this.matchList + ); + } catch (Exception ex) { + throw new BracketsException( + 'Error Importing: Please check you Mathes Data ' + + ex.getMessage(), + ex + ); + } + } catch (Exception e) { + Database.rollback(sp); + throw new BracketsException( + BracketsImportExportUtilities.FAIL_TOURNAMENT_IMPORT, + e + ); + } + } + + /** + * Method in charge of retrieving and compiling the Tournament data from imported file, + * for then inserting into the system. + * @param xml + */ + public void readingTournamentData(String xml) { + Xmlstreamreader reader = new Xmlstreamreader(xml); + + while (reader.hasNext()) { + if ( + reader.getEventType() == XmlTag.START_ELEMENT && + reader.getLocalName() == 'Tournament' + ) { + this.parseTournamentData(reader); + } + if ( + reader.getEventType() == XmlTag.END_ELEMENT && + reader.getLocalName() == 'Tournament' + ) { + break; + } + reader.next(); + } + } + + /** + * Method in charge of retrieving and compiling the Rounds Data data from imported file, + * for then inserting into the system. + * @param xml + */ + private void readingRoundsData(String xml) { + Xmlstreamreader reader = new Xmlstreamreader(xml); + + while (reader.hasNext()) { + if ( + reader.getEventType() == XmlTag.START_ELEMENT && + reader.getLocalName() == 'Round' + ) { + this.parseRoundData(reader); + } + if ( + reader.getEventType() == XmlTag.END_ELEMENT && + reader.getLocalName() == 'Rounds' + ) { + break; + } + reader.next(); + } + } + + /** + * Method in charge of retrieving and compiling the Matches Data data from imported file, + * for then inserting into the system. + * @param reader + */ + private void readingMatchesData(Xmlstreamreader reader) { + while (reader.hasNext()) { + if ( + reader.getEventType() == XmlTag.START_ELEMENT && + reader.getLocalName() == 'Match' + ) { + this.parseMatchData(reader); + } + if ( + reader.getEventType() == XmlTag.END_ELEMENT && + reader.getLocalName() == 'Matches' + ) { + break; + } + reader.next(); + } + } + + /** + * Method in charge of parsing Tournament data from XMl document + * @param reader + */ + private void parseTournamentData(Xmlstreamreader reader) { + this.tournament = new Brackets_Tournament__c(); + while (reader.hasNext()) { + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'name' + ) { + reader.next(); + this.tournament.Name = BracketsImportExportUtilities.getDecodedString( + reader + ); + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'description' + ) { + reader.next(); + String descValue = BracketsImportExportUtilities.getDecodedString( + reader + ); + this.tournament.Description__c = (descValue == 'null') + ? '' + : descValue; + } + + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'version' + ) { + reader.next(); + this.tournament.Version__c = Integer.valueOf( + BracketsImportExportUtilities.getDecodedString(reader) + ); + } + + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'type' + ) { + reader.next(); + this.tournament.Type__c = BracketsImportExportUtilities.getDecodedString( + reader + ); + } + + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'source' + ) { + reader.next(); + this.tournament.Update_Source__c = BracketsImportExportUtilities.getDecodedString( + reader + ); + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'deadline' + ) { + reader.next(); + String value = BracketsImportExportUtilities.getDecodedString( + reader + ); + if (value == 'null') { + tournament.Deadline__c = null; + } else { + tournament.Deadline__c = Datetime.valueOfGmt( + BracketsImportExportUtilities.getDecodedString(reader) + ); + } + } + + //RSC this should be id? + //if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'externalId' ){ + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'id' + ) { + reader.next(); + this.tournament.ExternalId__c = BracketsImportExportUtilities.getDecodedString( + reader + ); + } + + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'teamCount' + ) { + reader.next(); + this.tournament.TeamCount__c = Decimal.valueOf( + BracketsImportExportUtilities.getDecodedString(reader) + ); + } + + //Validate end of tag + if ( + reader.getEventType() == XMLTag.END_ELEMENT && + reader.getLocalName() == 'Tournament' + ) { + break; + } + + reader.next(); + } + } + + /** + * Method in charge of parsing round data from XMl document + * @param reader + */ + private void parseRoundData(Xmlstreamreader reader) { + Brackets_Round__c round = new Brackets_Round__c(); + round.Brackets_Tournament__c = this.tournament.Id; + + while (reader.hasNext()) { + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'name' + ) { + reader.next(); + round.Name = BracketsImportExportUtilities.getDecodedString( + reader + ); + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'deadline' + ) { + reader.next(); + String value = BracketsImportExportUtilities.getDecodedString( + reader + ); + if (value == 'null') { + round.Deadline__c = null; + } else { + round.Deadline__c = Datetime.valueOfGmt( + BracketsImportExportUtilities.getDecodedString(reader) + ); + } + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'roundNumber' + ) { + reader.next(); + round.RoundNumber__c = Decimal.valueOf( + BracketsImportExportUtilities.getDecodedString(reader) + ); + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'scorePoints' + ) { + reader.next(); + round.ScorePoints__c = Decimal.valueOf( + BracketsImportExportUtilities.getDecodedString(reader) + ); + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'id' + ) { + reader.next(); + round.ExternalId__c = BracketsImportExportUtilities.getDecodedString( + reader + ); + } + + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'Matches' + ) { + reader.next(); + this.readingMatchesData(reader); + } + + //Validate end of tag + if ( + reader.getEventType() == XMLTag.END_ELEMENT && + reader.getLocalName() == 'Round' + ) { + break; + } + + reader.next(); + } + + this.roundList.add(round); + } + + /** + * Method in charge of parsing the Match data from XMl document + * @param reader + */ + private void parseMatchData(Xmlstreamreader reader) { + Brackets_Match__c match = new Brackets_Match__c(); + String roundExternalId; + + while (reader.hasNext()) { + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'description' + ) { + reader.next(); + String descValue = BracketsImportExportUtilities.getDecodedString( + reader + ); + if (descValue == 'null') { + match.Description__c = ''; + } else { + match.Description__c = descValue; + } + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'followingMatch' + ) { + reader.next(); + + String followingMatch = BracketsImportExportUtilities.getDecodedString( + reader + ); + if (followingMatch != 'null') { + this.matchFollowingMatchId.put( + match.ExternalId__c, + followingMatch + ); + } + this.matchFollowingMatchSObject.put(match.ExternalId__c, match); + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'homeScore' + ) { + reader.next(); + match.HomeScore__c = Decimal.valueOf( + BracketsImportExportUtilities.getDecodedString(reader) + ); + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'homeTeam' + ) { + reader.next(); + String homeValue = BracketsImportExportUtilities.getDecodedString( + reader + ); + if (homeValue == 'null') { + match.HomeBrackets_Team__c = null; + } else { + match.HomeBrackets_Team__c = this.teamList.get(homeValue); + } + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'round' + ) { + reader.next(); + roundExternalId = BracketsImportExportUtilities.getDecodedString( + reader + ); + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'schedule' + ) { + reader.next(); + String schedule = BracketsImportExportUtilities.getDecodedString( + reader + ); + if (schedule == 'null') { + match.Schedule__c = null; + } else { + match.Schedule__c = Datetime.valueOfGmt(schedule); + } + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'visitorScore' + ) { + reader.next(); + match.VisitorScore__c = Decimal.valueOf( + BracketsImportExportUtilities.getDecodedString(reader) + ); + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'vistitorTeam' + ) { + reader.next(); + String vistitorTeam = BracketsImportExportUtilities.getDecodedString( + reader + ); + if (vistitorTeam == 'null') { + match.VisitorBrackets_Team__c = null; + } else { + match.VisitorBrackets_Team__c = this.teamList.get( + vistitorTeam + ); + } + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'winnerTeam' + ) { + reader.next(); + String winnerTeam = BracketsImportExportUtilities.getDecodedString( + reader + ); + if (winnerTeam == 'null') { + match.WinnerBrackets_Team__c = null; + } else { + match.WinnerBrackets_Team__c = this.teamList.get( + winnerTeam + ); + } + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'id' + ) { + reader.next(); + match.ExternalId__c = BracketsImportExportUtilities.getDecodedString( + reader + ); + } + + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'conference' + ) { + reader.next(); + match.Conference__c = BracketsImportExportUtilities.getDecodedString( + reader + ); + match.Conference__c = match.Conference__c.equalsIgnoreCase( + 'null' + ) + ? null + : match.Conference__c; + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'position' + ) { + reader.next(); + match.Position__c = Decimal.valueOf( + BracketsImportExportUtilities.getDecodedString(reader) + ); + } + if ( + reader.getEventType() == XMLTag.START_ELEMENT && + reader.getLocalName() == 'followingIsHome' + ) { + reader.next(); + match.FollowingIsHome__c = BracketsImportExportUtilities.getDecodedString( + reader + ) == 'true' + ? true + : false; + } + + //Validate end of tag + if ( + reader.getEventType() == XMLTag.END_ELEMENT && + reader.getLocalName() == 'Match' + ) { + break; + } + + reader.next(); + } + + this.matchSync.put(match.ExternalId__c, roundExternalId); + this.matchList.add(match); + } + + /** + * check if the xml is valid, other wise an exception is thrown. + * + * @param xml the source to be parsed. + */ + private void validate(String xml) { + Xmltag tag; + Xmlstreamreader reader = new Xmlstreamreader(xml); + //try{ + tag = reader.getEventType(); + if (tag == XmlTag.START_DOCUMENT) { + if (reader.hasNext()) { + reader.next(); + tag = reader.getEventType(); + if ( + reader.getLocalName() == + BracketsImportExportUtilities.ERROR_TAG + ) { + reader.next(); + throw new BracketsException( + BracketsImportExportUtilities.getDecodedString(reader) + ); + } + } + } + // }catch(XmlException ex){ + // throw new BracketsException(BracketsImportExportUtilities.PARENT_TOURNAMENT_SITE_ERRORS+this.source +ex.getMessage(), ex); + //} + } +} diff --git a/src/classes/BracketsImportTournament.cls-meta.xml b/force-app/main/default/classes/BracketsImportTournament.cls-meta.xml similarity index 57% rename from src/classes/BracketsImportTournament.cls-meta.xml rename to force-app/main/default/classes/BracketsImportTournament.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsImportTournament.cls-meta.xml +++ b/force-app/main/default/classes/BracketsImportTournament.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/src/classes/BracketsImportTournamentController.cls b/force-app/main/default/classes/BracketsImportTournamentController.cls similarity index 52% rename from src/classes/BracketsImportTournamentController.cls rename to force-app/main/default/classes/BracketsImportTournamentController.cls index 5d8c494..5e84cde 100644 --- a/src/classes/BracketsImportTournamentController.cls +++ b/force-app/main/default/classes/BracketsImportTournamentController.cls @@ -27,96 +27,66 @@ OF THE POSSIBILITY OF SUCH DAMAGE. */ -public with sharing class BracketsImportTournamentController{ - +public with sharing class BracketsImportTournamentController { public String statusText { get; set; } - public String sourceUrl { get; set; } + public String sourceUrl { get; set; } public String xmlMessage { get; set; } - - + /** - * Process URL and Import all Tournament - * @return page - */ - public PageReference importTournament(){ - if (this.sourceUrl == null || this.sourceUrl == '' || !this.sourceUrl.toLowerCase().startsWith('http')) { + * Process URL and Import all Tournament + * @return page + */ + public PageReference importTournament() { + if ( + this.sourceUrl == null || + this.sourceUrl == '' || + !this.sourceUrl.toLowerCase().startsWith('http') + ) { xmlMessage = 'You must enter a valid URL.'; return null; } - - try{ - new BracketsProccessUpdate( this.sourceUrl ); + + try { + new BracketsProccessUpdate(this.sourceUrl); xmlMessage = BracketsImportExportUtilities.SUCCESSFUL_TOURNAMENT_IMPORT; - } - catch ( Exception ex ) { + } catch (Exception ex) { this.xmlMessage = ex.getMessage(); - } - return null; + return null; } - + /** - * Get a list of tournaments - * @return tList - */ - public List getTList(){ - return [ Select Id, Name, Version__c, CreatedDate, LastModifiedDate, LastModifiedBy.Name, CreatedBy.Name from Brackets_Tournament__c where isChild__c = true limit 100 ]; + * Get a list of tournaments + * @return tList + */ + public List getTList() { + return [ + SELECT + Id, + Name, + Version__c, + CreatedDate, + LastModifiedDate, + LastModifiedBy.Name, + CreatedBy.Name + FROM Brackets_Tournament__c + WHERE isChild__c = true + LIMIT 100 + ]; } - + /** - * Execute Manual Update - */ + * Execute Manual Update + */ + public void doManualUpdate() { Id tId = Apexpages.currentPage().getParameters().get('tId'); - + try { - new BracketsProccessUpdate( tId ); + new BracketsProccessUpdate(tId); this.xmlMessage = 'Tournament has been updated!'; - } - catch( Exception ex ){ + } catch (Exception ex) { this.xmlMessage = ex.getMessage(); - } - } - - - - static testMethod void testManualUpdate(){ - - Brackets_Tournament__c t = BracketsTestUtilities.createFullTournament( 4, BracketsTournamentUtilities.STANDARD_TOURNAMENT_TYPE ); - t.isChild__c = true; - upsert t; - Apexpages.currentPage().getParameters().put('tId', t.Id ); - BracketsImportTournamentController c = new BracketsImportTournamentController(); - - //test tournament list - List ts = c.getTList(); - System.assert(ts.size() > 0); - - //test manu update - c.doManualUpdate(); - System.assert( c.xmlMessage != null ); - - //test garbage URL - c.importTournament(); - System.assert(c.xmlMessage != null); - - //test http - c.sourceUrl = 'http://garbage.c'; - c.importTournament(); - System.assert(c.xmlMessage != null); + } } - - - - - - - - - - - - - - -} \ No newline at end of file +} diff --git a/src/classes/BracketsImportTournamentController.cls-meta.xml b/force-app/main/default/classes/BracketsImportTournamentController.cls-meta.xml similarity index 57% rename from src/classes/BracketsImportTournamentController.cls-meta.xml rename to force-app/main/default/classes/BracketsImportTournamentController.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsImportTournamentController.cls-meta.xml +++ b/force-app/main/default/classes/BracketsImportTournamentController.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsImportTournamentControllerTest.cls b/force-app/main/default/classes/BracketsImportTournamentControllerTest.cls new file mode 100644 index 0000000..91cd0ec --- /dev/null +++ b/force-app/main/default/classes/BracketsImportTournamentControllerTest.cls @@ -0,0 +1,31 @@ +@isTest +class BracketsImportTournamentControllerTest { + @isTest + static void testManualUpdate() { + Brackets_Tournament__c t = BracketsTestUtilities.createFullTournament( + 4, + BracketsTournamentUtilities.STANDARD_TOURNAMENT_TYPE + ); + t.isChild__c = true; + upsert t; + Apexpages.currentPage().getParameters().put('tId', t.Id); + BracketsImportTournamentController c = new BracketsImportTournamentController(); + + //test tournament list + List ts = c.getTList(); + System.assert(ts.size() > 0); + + //test manu update + c.doManualUpdate(); + System.assert(c.xmlMessage != null); + + //test garbage URL + c.importTournament(); + System.assert(c.xmlMessage != null); + + //test http + c.sourceUrl = 'http://garbage.c'; + c.importTournament(); + System.assert(c.xmlMessage != null); + } +} diff --git a/force-app/main/default/classes/BracketsImportTournamentControllerTest.cls-meta.xml b/force-app/main/default/classes/BracketsImportTournamentControllerTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsImportTournamentControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsImportTournamentTest.cls b/force-app/main/default/classes/BracketsImportTournamentTest.cls new file mode 100644 index 0000000..3cff2ab --- /dev/null +++ b/force-app/main/default/classes/BracketsImportTournamentTest.cls @@ -0,0 +1,16 @@ +@isTest +class BracketsImportTournamentTest { + @isTest + static void testImport() { + try { + BracketsImportTournament controller = new BracketsImportTournament( + '' + ); + controller.processImportedDocument( + BracketsTestUtilities.xmlTournamentValid + ); + } catch (Exception ex) { + System.assert(true); + } + } +} diff --git a/force-app/main/default/classes/BracketsImportTournamentTest.cls-meta.xml b/force-app/main/default/classes/BracketsImportTournamentTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsImportTournamentTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/src/classes/BracketsJSONObject.cls b/force-app/main/default/classes/BracketsJSONObject.cls similarity index 53% rename from src/classes/BracketsJSONObject.cls rename to force-app/main/default/classes/BracketsJSONObject.cls index 814254b..b193992 100644 --- a/src/classes/BracketsJSONObject.cls +++ b/force-app/main/default/classes/BracketsJSONObject.cls @@ -1,5 +1,5 @@ public class BracketsJSONObject { -/* + /* Copyright (c) 2002 JSON.org Permission is hereby granted, free of charge, to any person obtaining a copy @@ -23,126 +23,146 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* - * A BracketsJSONObject is an unordered collection of name/value pairs. Its - * external form is a string wrapped in curly braces with colons between the - * names and values, and commas between the values and names. The internal form - * is an object having get and opt methods for - * accessing the values by name, and put methods for adding or - * replacing values by name. The values can be any of these types: - * Boolean, JSONArray, BracketsJSONObject, - * Number, String, or the BracketsJSONObject.NULL - * object. A BracketsJSONObject constructor can be used to convert an external form - * JSON text into an internal form whose values can be retrieved with the - * get and opt methods, or to convert values into a - * JSON text using the put and toString methods. - * A get method returns a value if one can be found, and throws an - * exception if one cannot be found. An opt method returns a - * default value instead of throwing an exception, and so is useful for - * obtaining optional values. - *

- * The generic get() and opt() methods return an - * object, which you can cast or query for type. There are also typed - * get and opt methods that do type checking and type - * coersion for you. - *

- * The put methods adds values to an object. For example,

- *     myString = new BracketsJSONObject().put('JSON', "Hello, World!").toString();
- * produces the string {"JSON": "Hello, World"}. - *

- * The texts produced by the toString methods strictly conform to - * the JSON sysntax rules. - * The constructors are more forgiving in the texts they will accept: - *

    - *
  • An extra , (comma) may appear just - * before the closing brace.
  • - *
  • Strings may be quoted with ' (single - * quote).
  • - *
  • Strings do not need to be quoted at all if they do not begin with a quote - * or single quote, and if they do not contain leading or trailing spaces, - * and if they do not contain any of these characters: - * { } [ ] / \ : , = ; # and if they do not look like numbers - * and if they are not the reserved words true, - * false, or null.
  • - *
  • Keys can be followed by = or => as well as - * by :.
  • - *
  • Values can be followed by ; (semicolon) as - * well as by , (comma).
  • - *
  • Numbers may have the 0- (octal) or - * 0x- (hex) prefix.
  • - *
  • Comments written in the slashshlash, slashstar, and hash conventions - * will be ignored.
  • - *
- * @author JSON.org - * @version 3 - */ - - /* - * Sept 2008, rhess - * begin simple port of this code to Force.com Apex Code - * currently this code is only building Apex objects from JSON, - * not outputing JSON from Apex - * Oct add valueToString - */ - public class value { - /* apex object to store one of several different data types - * see : http://www.json.org/ - */ - public value() { } - public value(boolean bb) { bool = bb;} - public value(integer ii) {num=ii;} - public value(Decimal ii) {dnum= ii;} - public value(string st) {str=st;} - public value( Bracketsjsonobject oo) { obj = oo; } - public value( list vary ) { values = vary; } - - public string str {get;set;} - public integer num {get;set;} - public double dnum {get;set;} - public BracketsJSONObject obj {get;set;} - public list values {get;set;} // array - public boolean bool {get;set;} - // if all members are null, value == null - // isNull() - /* - * value to string is used to output JSON for Google Visualization API - */ - public string valueToString() { - if ( this.bool != null ) return (this.bool?'true':'false'); - if ( this.str != null ) return '"'+this.str +'"'; - if ( this.num != null ) return String.valueof(this.num); - if ( this.dnum != null ) return String.valueof(this.dnum); - if ( this.values != null ) { - string ret = '['; - for ( value v:this.values) { - //system.debug( v ); - ret += v.valueToString() + ','; - } - if ( this.values.size() > 0 ) { - // remove last comma - ret = ret.substring(0,ret.length()-1); - } - return ret + ']'; - } - if ( this.obj != null ) { - return this.obj.valueToString(); - } - return 'null'; - } - - } // end of class value - + /* + * A BracketsJSONObject is an unordered collection of name/value pairs. Its + * external form is a string wrapped in curly braces with colons between the + * names and values, and commas between the values and names. The internal form + * is an object having get and opt methods for + * accessing the values by name, and put methods for adding or + * replacing values by name. The values can be any of these types: + * Boolean, JSONArray, BracketsJSONObject, + * Number, String, or the BracketsJSONObject.NULL + * object. A BracketsJSONObject constructor can be used to convert an external form + * JSON text into an internal form whose values can be retrieved with the + * get and opt methods, or to convert values into a + * JSON text using the put and toString methods. + * A get method returns a value if one can be found, and throws an + * exception if one cannot be found. An opt method returns a + * default value instead of throwing an exception, and so is useful for + * obtaining optional values. + *

+ * The generic get() and opt() methods return an + * object, which you can cast or query for type. There are also typed + * get and opt methods that do type checking and type + * coersion for you. + *

+ * The put methods adds values to an object. For example,

+     *     myString = new BracketsJSONObject().put('JSON', "Hello, World!").toString();
+ * produces the string {"JSON": "Hello, World"}. + *

+ * The texts produced by the toString methods strictly conform to + * the JSON sysntax rules. + * The constructors are more forgiving in the texts they will accept: + *

    + *
  • An extra , (comma) may appear just + * before the closing brace.
  • + *
  • Strings may be quoted with ' (single + * quote).
  • + *
  • Strings do not need to be quoted at all if they do not begin with a quote + * or single quote, and if they do not contain leading or trailing spaces, + * and if they do not contain any of these characters: + * { } [ ] / \ : , = ; # and if they do not look like numbers + * and if they are not the reserved words true, + * false, or null.
  • + *
  • Keys can be followed by = or => as well as + * by :.
  • + *
  • Values can be followed by ; (semicolon) as + * well as by , (comma).
  • + *
  • Numbers may have the 0- (octal) or + * 0x- (hex) prefix.
  • + *
  • Comments written in the slashshlash, slashstar, and hash conventions + * will be ignored.
  • + *
+ * @author JSON.org + * @version 3 + */ + + /* + * Sept 2008, rhess + * begin simple port of this code to Force.com Apex Code + * currently this code is only building Apex objects from JSON, + * not outputing JSON from Apex + * Oct add valueToString + */ + + public class value { + /* apex object to store one of several different data types + * see : http://www.json.org/ + */ + public value() { + } + public value(boolean bb) { + bool = bb; + } + public value(integer ii) { + num = ii; + } + public value(Decimal ii) { + dnum = ii; + } + public value(string st) { + str = st; + } + public value(Bracketsjsonobject oo) { + obj = oo; + } + public value(list vary) { + values = vary; + } + + public string str { get; set; } + public integer num { get; set; } + public double dnum { get; set; } + public BracketsJSONObject obj { get; set; } + public list values { get; set; } // array + public boolean bool { get; set; } + // if all members are null, value == null + // isNull() + /* + * value to string is used to output JSON for Google Visualization API + */ + public string valueToString() { + if (this.bool != null) + return (this.bool ? 'true' : 'false'); + if (this.str != null) + return '"' + this.str + '"'; + if (this.num != null) + return String.valueof(this.num); + if (this.dnum != null) + return String.valueof(this.dnum); + if (this.values != null) { + string ret = '['; + for (value v : this.values) { + //system.debug( v ); + ret += v.valueToString() + ','; + } + if (this.values.size() > 0) { + // remove last comma + ret = ret.substring(0, ret.length() - 1); + } + return ret + ']'; + } + if (this.obj != null) { + return this.obj.valueToString(); + } + return 'null'; + } + } // end of class value + /* ** * The map where the BracketsJSONObject's properties are kept. */ - private map data = new map(); - - public value getValue(string key) { return data.get(key); } + public map data = new Map(); + + public value getValue(string key) { + return data.get(key); + } /* ** * Construct an empty BracketsJSONObject. */ - public BracketsJSONObject() { } + public BracketsJSONObject() { + } /* * Construct a BracketsJSONObject from a JSONTokener. @@ -155,21 +175,25 @@ SOFTWARE. String key; if (x.nextClean() != '{') { - throw new jsonexception('A BracketsJSONObject text must begin with {'); + throw new jsonexception( + 'A BracketsJSONObject text must begin with {' + ); } for (;;) { c = x.nextClean(); - if ( c == null) { - throw new jsonexception('A BracketsJSONObject text must end with }'); - } else if ( c== '}' ) { + if (c == null) { + throw new jsonexception( + 'A BracketsJSONObject text must end with }' + ); + } else if (c == '}') { return; - } else { + } else { x.back(); - - key = (string)x.nextValue().str; - // system.debug( 'key is :'+key); } + + key = (string) x.nextValue().str; + // system.debug( 'key is :'+key); } } - + /* * The key is followed by ':'. We will also tolerate '=' or '=>'. */ @@ -182,28 +206,27 @@ SOFTWARE. } else if (c != ':') { throw new jsonexception('Expected a : after a key'); } - - putOpt(key, x.nextValue()); // load next value into data map - + + putOpt(key, x.nextValue()); // load next value into data map + /* * Pairs are separated by ','. We will also tolerate ';'. */ string nc = x.nextClean(); - if ( nc == ';' || nc == ',' ) { + if (nc == ';' || nc == ',') { if (x.nextClean() == '}') { return; } x.back(); - } else if ( nc == '}' ) { + } else if (nc == '}') { return; - } else { + } else { throw new jsonexception('Expected a , or }'); } } } - /* ** * Construct a BracketsJSONObject from a source JSON text string. * This is the most commonly used BracketsJSONObject constructor. @@ -212,14 +235,13 @@ SOFTWARE. * with } (right brace). * @exception JSONException If there is a syntax error in the source string. */ - public static BracketsJSONObject instance(String source) { - return new BracketsJSONObject( new JSONTokener(source) ); + public static BracketsJSONObject instance(String source) { + return new BracketsJSONObject(new JSONTokener(source)); } - public BracketsJSONObject (String source) { - this( new JSONTokener(source) ); + public BracketsJSONObject(String source) { + this(new JSONTokener(source)); } - /* ** * Produce a string from a double. The string 'null' will be returned if * the number is not finite. @@ -251,19 +273,25 @@ SOFTWARE. * @return The object associated with the key. * @throws JSONException if the key is not found. */ - public object get(string key) { - value ret = this.data.get(key); - if (ret == null) { - throw new JSONException('BracketsJSONObject[' + key + '] not found.'); + public object get(string key) { + value ret = this.data.get(key); + if (ret == null) { + throw new JSONException( + 'BracketsJSONObject[' + + key + + '] not found.' + ); } - if ( ret.str != null ) return ret.str; - if ( ret.num != null ) return ret.num; - if ( ret.bool != null ) return ret.bool; - system.assert( ret.obj == null , 'get cannot return nested json ojects'); - // array? - return null; - } - + if (ret.str != null) + return ret.str; + if (ret.num != null) + return ret.num; + if (ret.bool != null) + return ret.bool; + system.assert(ret.obj == null, 'get cannot return nested json ojects'); + // array? + return null; + } /* ** * Get the boolean value associated with a key. @@ -273,12 +301,16 @@ SOFTWARE. * @throws JSONException * if the value is not a Boolean or the String 'true' or 'false'. */ - public boolean getBoolean(String key) { + public boolean getBoolean(String key) { Object o = this.get(key); - if ( o!=null) return (boolean) o; - throw new JSONException('BracketsJSONObject[' + key + '] is not a Boolean.'); + if (o != null) + return (boolean) o; + throw new JSONException( + 'BracketsJSONObject[' + + key + + '] is not a Boolean.' + ); } - /* ** * Get the double value associated with a key. @@ -299,7 +331,6 @@ SOFTWARE. } }*/ - /* ** * Get the int value associated with a key. If the number value is too * large for an int, it will be clipped. @@ -315,7 +346,6 @@ SOFTWARE. ((Number)o).intValue() : (int)getDouble(key); } */ - /* * Get the JSONArray value associated with a key. * @@ -333,7 +363,6 @@ SOFTWARE. '] is not a JSONArray.'); }*/ - /* ** * Get the BracketsJSONObject value associated with a key. * @@ -411,7 +440,6 @@ SOFTWARE. return names; } */ - /* ** * Get the string associated with a key. * @@ -419,11 +447,10 @@ SOFTWARE. * @return A string which is the value. * @throws JSONException if the key is not found. */ - public String getString(String key) { + public String getString(String key) { return this.data.get(key).str; } - /* ** * Determine if the BracketsJSONObject contains a specific key. * @param key A key string. @@ -433,7 +460,6 @@ SOFTWARE. return this.data.containsKey(key); } - /* ** * Determine if the value associated with the key is null or if there is * no value. @@ -445,7 +471,7 @@ SOFTWARE. return BracketsJSONObject.NULL.equals(opt(key)); } */ - + /* ** * Get an enumeration of the keys of the BracketsJSONObject. * @@ -455,7 +481,6 @@ SOFTWARE. return this.data.keySet(); } - /* ** * Get the number of keys stored in the BracketsJSONObject. * @@ -465,7 +490,6 @@ SOFTWARE. return this.data.keySet().size(); } - /* ** * Produce a JSONArray containing the names of the elements of this * BracketsJSONObject. @@ -508,7 +532,6 @@ SOFTWARE. return s; } */ - /* ** * Get an optional value associated with a key. * @param key A key string. @@ -517,7 +540,6 @@ SOFTWARE. public Object opt(String key) { return key == null ? null : this.get(key); } - /* ** * Get an optional boolean associated with a key. @@ -531,7 +553,6 @@ SOFTWARE. return optBoolean(key, false); } - /* ** * Get an optional boolean associated with a key. * It returns the defaultValue if there is no such key, or if it is not @@ -547,8 +568,7 @@ SOFTWARE. } catch (Exception e) { return defaultValue; } - } - + } /* ** * Put a key/value pair in the BracketsJSONObject, where the value will be a @@ -563,7 +583,6 @@ SOFTWARE. return this; }*/ - /* ** * Get an optional double associated with a key, * or NaN if there is no such key or if its value is not a number. @@ -577,7 +596,6 @@ SOFTWARE. return optDouble(key, Double.NaN); } */ - /* ** * Get an optional double associated with a key, or the * defaultValue if there is no such key or if its value is not a number. @@ -598,7 +616,6 @@ SOFTWARE. } } */ - /* ** * Get an optional int value associated with a key, * or zero if there is no such key or if the value is not a number. @@ -612,7 +629,6 @@ SOFTWARE. return optInt(key, 0); } */ - /* ** * Get an optional int value associated with a key, * or the default if there is no such key or if the value is not a number. @@ -631,7 +647,6 @@ SOFTWARE. } }*/ - /* ** * Get an optional JSONArray associated with a key. * It returns null if there is no such key, or if its value is not a @@ -645,7 +660,6 @@ SOFTWARE. return o instanceof JSONArray ? (JSONArray)o : null; }*/ - /* ** * Get an optional BracketsJSONObject associated with a key. * It returns null if there is no such key, or if its value is not a @@ -673,7 +687,7 @@ SOFTWARE. return optLong(key, 0); } */ - + /* ** * Get an optional long value associated with a key, * or the default if there is no such key or if the value is not a number. @@ -692,7 +706,6 @@ SOFTWARE. } }*/ - /* ** * Get an optional string associated with a key. * It returns an empty string if there is no such key. If the value is not @@ -719,7 +732,6 @@ SOFTWARE. return o != null ? o.toString() : defaultValue; } */ - /* ** * Put a key/boolean pair in the BracketsJSONObject. * @@ -733,7 +745,6 @@ SOFTWARE. return this; } */ - /* ** * Put a key/double pair in the BracketsJSONObject. * @@ -747,7 +758,6 @@ SOFTWARE. return this; } */ - /* ** * Put a key/int pair in the BracketsJSONObject. * @@ -772,14 +782,13 @@ SOFTWARE. * @return this. * @ If the value is a non-finite number. */ - public BracketsJSONObject putOpt(String key, value value) { + public BracketsJSONObject putOpt(String key, value value) { if (key != null && value != null) { data.put(key, value); } return this; } - /* * Produce a string in double quotes with backslash sequences in all the * right places. A backslash will be inserted within @@ -940,9 +945,9 @@ SOFTWARE. return sb.toString(); } */ - + /* ** - * valueToString + * valueToString * Make a JSON text of an Object value. The method is required to produce a strictly * conforming text. If the object does not contain a toJSONString * method (which is the most common case), then a text will be @@ -958,236 +963,236 @@ SOFTWARE. * with } (right brace). * @ If the value is or contains an invalid number. */ - public String valueToString() { - string ret = '{'; - for ( string key: this.keys() ) { - ret += '"' + key + '": ' + this.getvalue(key).valueToString() + ','; - } - return ret.substring(0,ret.length()-1) + '}'; - } - - - -public class JSONException extends Exception {} - + public String valueToString() { + string ret = '{'; + for (string key : this.keys()) { + ret += '"' + key + '": ' + this.getvalue(key).valueToString() + ','; + } + return ret.substring(0, ret.length() - 1) + '}'; + } -public class JSONTokener { - /* - * A JSONTokener takes a source string and extracts characters and tokens from - * it. It is used by the BracketsJSONObject and JSONArray constructors to parse - * JSON source strings. - * @author JSON.org - * @version 3 - */ + public class JSONException extends Exception { + } - private integer index; - private string reader; - private string lastChar; - private boolean useLastChar; + public class JSONTokener { + /* + * A JSONTokener takes a source string and extracts characters and tokens from + * it. It is used by the BracketsJSONObject and JSONArray constructors to parse + * JSON source strings. + * @author JSON.org + * @version 3 + */ - /* - * Construct a JSONTokener from a string. - * - * @param s A source string. - */ - public JSONTokener(String s) { - this.useLastChar = false; - this.index = 0; - this.reader = s; - } + private integer index; + private string reader; + private string lastChar; + private boolean useLastChar; - /* - * Back up one character. This provides a sort of lookahead capability, - * so that you can test for a digit or letter before attempting to parse - * the next number or identifier. - */ - public void back() { - if (useLastChar || index <= 0) { - throw new JSONException('Stepping back two steps is not supported'); + /* + * Construct a JSONTokener from a string. + * + * @param s A source string. + */ + public JSONTokener(String s) { + this.useLastChar = false; + this.index = 0; + this.reader = s; } - index -= 1; - useLastChar = true; - } + /* + * Back up one character. This provides a sort of lookahead capability, + * so that you can test for a digit or letter before attempting to parse + * the next number or identifier. + */ + public void back() { + if (useLastChar || index <= 0) { + throw new JSONException( + 'Stepping back two steps is not supported' + ); + } + index -= 1; + useLastChar = true; + } - /* - * Determine if the source string still contains characters that next() - * can consume. - * @return true if not yet at the end of the source. - */ - public boolean more() { - String nextChar = next(); - if (nextChar == null) { - return false; - } - back(); - return true; - } - - string read( string reader) { - if ( index+1 > reader.length() ) return null; - return reader.substring(index,index+1); - } - - /* - * Get the next character in the source string. - * - * @return The next character, or 0 if past the end of the source string. - */ - public String next() { - if (this.useLastChar) { - this.useLastChar = false; - if (this.lastChar != null) { - this.index += 1; + /* + * Determine if the source string still contains characters that next() + * can consume. + * @return true if not yet at the end of the source. + */ + public boolean more() { + String nextChar = next(); + if (nextChar == null) { + return false; } - return this.lastChar; - } - string c; - try { - c = read(reader); - } catch (exception exc) { - throw new JSONException(exc); + back(); + return true; } - if (c == null) { // End of stream - this.lastChar = null; - return null; - } - this.index += 1; - this.lastChar = (String) c; - return this.lastChar; - } + string read(string reader) { + if (index + 1 > reader.length()) + return null; + return reader.substring(index, index + 1); + } + /* + * Get the next character in the source string. + * + * @return The next character, or 0 if past the end of the source string. + */ + public String next() { + if (this.useLastChar) { + this.useLastChar = false; + if (this.lastChar != null) { + this.index += 1; + } + return this.lastChar; + } + string c; + try { + c = read(reader); + } catch (exception exc) { + throw new JSONException(exc); + } - /* - * Consume the next character, and check that it matches a specified - * character. - * @param c The character to match. - * @return The character. - * @throws JSONException if the character does not match. - */ - public String next(String c) { - String n = next(); - if (n != c) { - throw new JSONException('Expected ' + c + ' and instead saw ' + n ); + if (c == null) { + // End of stream + this.lastChar = null; + return null; + } + this.index += 1; + this.lastChar = (String) c; + return this.lastChar; } - return n; - } + /* + * Consume the next character, and check that it matches a specified + * character. + * @param c The character to match. + * @return The character. + * @throws JSONException if the character does not match. + */ + public String next(String c) { + String n = next(); + if (n != c) { + throw new JSONException( + 'Expected ' + + c + + ' and instead saw ' + + n + ); + } + return n; + } - /* - * Get the next n characters. - * - * @param n The number of characters to take. - * @return A string of n characters. - * @throws JSONException - * Substring bounds error if there are not - * n characters remaining in the source string. - */ - public String next(integer n) { - if (n == 0) { - return ''; - } - - String buffer = ''; - integer pos = 0; + /* + * Get the next n characters. + * + * @param n The number of characters to take. + * @return A string of n characters. + * @throws JSONException + * Substring bounds error if there are not + * n characters remaining in the source string. + */ + public String next(integer n) { + if (n == 0) { + return ''; + } - if (this.useLastChar) { - this.useLastChar = false; - buffer = this.lastChar; - pos = 1; - } + String buffer = ''; + integer pos = 0; - try { - buffer = buffer + reader.substring(index, index+n); - pos += n; - } catch (Exception exc) { - throw new JSONException(exc.getMessage()); - } - this.index += pos; + if (this.useLastChar) { + this.useLastChar = false; + buffer = this.lastChar; + pos = 1; + } - if (pos < n) { - throw new JSONException('Substring bounds error'); - } + try { + buffer = buffer + reader.substring(index, index + n); + pos += n; + } catch (Exception exc) { + throw new JSONException(exc.getMessage()); + } + this.index += pos; - this.lastChar = buffer.substring( buffer.length()-1 ); - return buffer; - } + if (pos < n) { + throw new JSONException('Substring bounds error'); + } + this.lastChar = buffer.substring(buffer.length() - 1); + return buffer; + } - /* - * Get the next char in the string, skipping whitespace - * and comments (slashslash, slashstar, and hash). - * @throws JSONException - * @return A character, or 0 if there are no more characters. - */ - public string nextClean() { - for (;;) { - string c = next(); - //system.debug( 'next clean '+c); - - if (c == '/') { - string n = next(); - //system.debug( 'next clean '+n); - if ( n == '/' ) { + /* + * Get the next char in the string, skipping whitespace + * and comments (slashslash, slashstar, and hash). + * @throws JSONException + * @return A character, or 0 if there are no more characters. + */ + public string nextClean() { + for (;;) { + string c = next(); + //system.debug( 'next clean '+c); + + if (c == '/') { + string n = next(); + //system.debug( 'next clean '+n); + if (n == '/') { + do { + c = next(); + } while (c != '\n' && c != '\r' && c != null); + } else if (n == '*') { + for (;;) { + c = next(); + if (c == null) { + throw new JSONException('Unclosed comment'); + } + if (c == '*') { + if (next() == '/') { + break; + } + back(); + } + } + } else { + back(); + return '/'; + } + } else if (c == '#') { do { c = next(); } while (c != '\n' && c != '\r' && c != null); - - } - else - if (n == '*') { - for (;;) { - c = next(); - if (c == null) { - throw new JSONException('Unclosed comment'); - } - if (c == '*') { - if (next() == '/') { - break; - } - back(); - } - } - } else { - back(); - return '/'; } - } else if (c == '#') { - do { - c = next(); - } while (c != '\n' && c != '\r' && c != null); - } - if (c == null || c > ' ') { - //system.debug( 'nextClean returns :'+c); - return c; + if (c == null || c > ' ') { + //system.debug( 'nextClean returns :'+c); + return c; + } } + return null; } - return null; - } - /* - * Return the characters up to the next close quote character. - * Backslash processing is done. The formal JSON format does not - * allow strings in single quotes, but an implementation is allowed to - * accept them. - * @param quote The quoting character, either - * " (double quote) or - * ' (single quote). - * @return A String. - * @throws JSONException Unterminated string. - */ - public String nextString(string quote) { - //system.debug( 'nextString ' +quote); - string c; - string sb = ''; - for (;;) { - c = next(); //system.debug(c); - //switch (c) { - if ( c == null || c == '\n' || c == '\r') { - throw new JSONException('Unterminated string'); - } - /* + /* + * Return the characters up to the next close quote character. + * Backslash processing is done. The formal JSON format does not + * allow strings in single quotes, but an implementation is allowed to + * accept them. + * @param quote The quoting character, either + * " (double quote) or + * ' (single quote). + * @return A String. + * @throws JSONException Unterminated string. + */ + public String nextString(string quote) { + //system.debug( 'nextString ' +quote); + string c; + string sb = ''; + for (;;) { + c = next(); //system.debug(c); + //switch (c) { + if (c == null || c == '\n' || c == '\r') { + throw new JSONException('Unterminated string'); + } + /* if ( c == '/' ) { c = next(); if ( c == 'n') { sb += '\n'; continue; } @@ -1222,41 +1227,38 @@ public class JSONTokener { } break; */ - - if (c == quote) { - // system.debug( 'nextString returns :'+sb); - return sb; + + if (c == quote) { + // system.debug( 'nextString returns :'+sb); + return sb; + } + sb = sb + c; } - sb = sb + c; - + return ''; } - return ''; - } - - /** - * Get the text up but not including the specified character or the - * end of line, whichever comes first. - * @param d A delimiter character. - * @return A string. - */ - public String nextTo(string d) { - string sb = ''; - for (;;) { - string c = next(); - if (c == d || c == null || c == '\n' || c == '\r') { - if (c != null) { - back(); + /** + * Get the text up but not including the specified character or the + * end of line, whichever comes first. + * @param d A delimiter character. + * @return A string. + */ + public String nextTo(string d) { + string sb = ''; + for (;;) { + string c = next(); + if (c == d || c == null || c == '\n' || c == '\r') { + if (c != null) { + back(); + } + return sb.trim(); } - return sb.trim(); + sb = sb + c; } - sb = sb + c; - } - return ''; - } - + return ''; + } - /** + /** * Get the text up but not including one of the specified delimiter * characters or the end of line, whichever comes first. * @param delimiters A set of delimiter characters. @@ -1279,141 +1281,138 @@ public class JSONTokener { return ''; } */ + /* + * Get the next value. The value can be a Boolean, Double, Integer, + * JSONArray, BracketsJSONObject, Long, or String, or the BracketsJSONObject.NULL object. + * @throws JSONException If syntax error. + * + * @return An object. + */ - /* - * Get the next value. The value can be a Boolean, Double, Integer, - * JSONArray, BracketsJSONObject, Long, or String, or the BracketsJSONObject.NULL object. - * @throws JSONException If syntax error. - * - * @return An object. - */ + public value nextValue() { + string c = nextClean(); + // system.debug( 'nextValue ' +c); + String s; - - public value nextValue() { - - string c = nextClean(); - // system.debug( 'nextValue ' +c); - String s; - - if ( c == '"' || c == '\'' ) { - return new value( nextString(c) ); - } - if ( c == '{' ) { + if (c == '"' || c == '\'') { + return new value(nextString(c)); + } + if (c == '{') { back(); - return new value( new BracketsJSONObject(this) ); - } - if ( c == '[' || c == '(') { + return new value(new BracketsJSONObject(this)); + } + if (c == '[' || c == '(') { back(); - return new value( JSONArray(this) ); - } + return new value(JSONArray(this)); + } - /* - * Handle unquoted text. This could be the values true, false, or - * null, or it can be a number. An implementation (such as this one) - * is allowed to also accept non-standard forms. - * - * Accumulate characters until we reach the end of the text or a - * formatting character. - */ + /* + * Handle unquoted text. This could be the values true, false, or + * null, or it can be a number. An implementation (such as this one) + * is allowed to also accept non-standard forms. + * + * Accumulate characters until we reach the end of the text or a + * formatting character. + */ - String sb = ''; - string b = c; - while (c >= ' ' && '),:]}/\\\"[{;=#'.indexOf(c) < 0) { - sb = sb + c; - //system.debug(sb); - c = next(); - - } - back(); + String sb = ''; + string b = c; + while (c >= ' ' && '),:]}/\\\"[{;=#'.indexOf(c) < 0) { + sb = sb + c; + //system.debug(sb); + c = next(); + } + back(); - /* - * If it is true, false, or null, return the proper value. - */ + /* + * If it is true, false, or null, return the proper value. + */ - s = sb.trim(); - if (s.equals('')) { - throw new JSONException ('Missing value'); - } - if (s.equalsIgnoreCase('true')) { - - return new value(true); - } - if (s.equalsIgnoreCase('false')) { - return new value( false); - } - if (s.equalsIgnoreCase('null')) { - return new value(); - } + s = sb.trim(); + if (s.equals('')) { + throw new JSONException('Missing value'); + } + if (s.equalsIgnoreCase('true')) { + return new value(true); + } + if (s.equalsIgnoreCase('false')) { + return new value(false); + } + if (s.equalsIgnoreCase('null')) { + return new value(); + } - /* - * If it might be a number, try converting it. We support the 0- and 0x- - * conventions. If a number cannot be produced, then the value will just - * be a string. Note that the 0-, 0x-, plus, and implied string - * conventions are non-standard. A JSON parser is free to accept - * non-JSON forms as long as it accepts all correct JSON forms. - */ + /* + * If it might be a number, try converting it. We support the 0- and 0x- + * conventions. If a number cannot be produced, then the value will just + * be a string. Note that the 0-, 0x-, plus, and implied string + * conventions are non-standard. A JSON parser is free to accept + * non-JSON forms as long as it accepts all correct JSON forms. + */ - if ((b >= '0' && b <= '9') || b == '.' || b == '-' || b == '+') { - if (b == '0') { - if (s.length() > 2 && - (s.substring(1,2) == 'x' || s.substring(1,2) == 'X')) { - try { - return new value( Integer.valueof(s.substring(2)) ); - } catch (Exception e) { - /* Ignore the error */ - } - } else { - try { - return new value( Integer.valueof(s) ); - } catch (Exception e) { - /* Ignore the error */ + if ((b >= '0' && b <= '9') || b == '.' || b == '-' || b == '+') { + if (b == '0') { + if ( + s.length() > 2 && + (s.substring(1, 2) == 'x' || + s.substring(1, 2) == 'X') + ) { + try { + return new value(Integer.valueof(s.substring(2))); + } catch (Exception e) { + /* Ignore the error */ + } + } else { + try { + return new value(Integer.valueof(s)); + } catch (Exception e) { + /* Ignore the error */ + } } } - } - try { - Integer si = Integer.valueof(s); - return new value( si ); - } catch (System.TypeException e) { + try { + Integer si = Integer.valueof(s); + return new value(si); + } catch (System.TypeException e) { try { - return new value( Double.valueof(s) ); - } catch (System.TypeException g) { - // fall thru + return new value(Double.valueof(s)); + } catch (System.TypeException g) { + // fall thru + } } } + return new value(s); } - return new value( s ); - } + /** + * Skip characters until the next character is the requested character. + * If the requested character is not found, no characters are skipped. + * @param to A character to skip to. + * @return The requested character, or zero if the requested character + * is not found. + */ + public string skipTo(string to) { + string c; + try { + integer startIndex = this.index; + //reader.mark(Integer.MAX_VALUE); + do { + c = next(); + if (c == null) { + // reader.reset(); + this.index = startIndex; + return c; + } + } while (c != to); + } catch (Exception exc) { + throw new JSONException(exc); + } - /** - * Skip characters until the next character is the requested character. - * If the requested character is not found, no characters are skipped. - * @param to A character to skip to. - * @return The requested character, or zero if the requested character - * is not found. - */ - public string skipTo(string to) { - string c; - try { - integer startIndex = this.index; - //reader.mark(Integer.MAX_VALUE); - do { - c = next(); - if (c == null) { - // reader.reset(); - this.index = startIndex; - return c; - } - } while (c != to); - } catch (Exception exc) { - throw new JSONException(exc); + back(); + return c; } - back(); - return c; - } - - /* + /* * Make a printable string of this JSONTokener. * * @return ' at character [this.index]' @@ -1421,17 +1420,16 @@ public class JSONTokener { return ' at character ' + index; } */ - -} // end of tokener (sub) class + } // end of tokener (sub) class - /* + /* * Construct a JSONArray from a JSONTokener. * @param x A JSONTokener * @throws JSONException If there is a syntax error. */ public static list JSONArray(JSONTokener x) { //this(); - list myArrayList = new list(); + list myArrayList = new List(); string c = x.nextClean(); string q; if (c == '[') { @@ -1455,215 +1453,20 @@ public class JSONTokener { } c = x.nextClean(); //switch (c) { - if ( c == ';' || c == ',') { + if (c == ';' || c == ',') { if (x.nextClean() == ']') { return myArrayList; } x.back(); - - } else if ( c == ']' || c == ')') { + } else if (c == ']' || c == ')') { if (q != c) { throw new JSONException('Expected a >' + q + '<'); } return myArrayList; - } else { + } else { throw new JSONException('Expected a , or ]'); } - } - return null;// not reached - } - - - /* ************************** - * TEST Methods to achieve required code coverage - * many of these could be improved by using assert() instead of debug() - */ - public static testmethod void test_tokener_nl() { - //add a new line by inserting /n - BracketsJsonObject.JsonTokener tkr = new JsonTokener('quoted string foo"'); - system.debug( 'next string is >'+tkr.nextString('"') ); - system.assert( tkr != null ); - } - public static testmethod void test_tokener() { - BracketsJsonObject.JsonTokener tkr = new JsonTokener('//ff \n{}'); - tkr.nextClean(); - tkr = new JsonTokener('/*fff*/\n{}'); - tkr.nextClean(); - tkr = new JsonTokener('#ff*\n{}'); - tkr.nextClean(); - tkr = new JsonTokener('/**ff \n{}'); - try { tkr.nextClean(); } catch(exception ex) { - system.debug( ' expected >'+ex.getMessage() + '<' ); - system.assert( ex.getMessage() == 'Unclosed comment'); - } - } - public static testmethod void test_parsing() { BracketsJSONObject jj; BracketsJsonObject.JsonTokener tkr; - string simple = '{"translatedText": "Ciao mondo" }'; - string bool_simple = '{"responseBoolean" : true }'; - string nsimple = '{"responseData" : {"translatedText": "Ciao mondo" }, "responseDetails": null, "responseStatus": 200 }'; - - // three methods of constructing an object - system.debug( Bracketsjsonobject.instance( bool_simple ) ); - system.debug( new Bracketsjsonobject( bool_simple ) ); - system.debug( new BracketsJSONObject( new JsonTokener(simple) ) ); - - tkr = new JsonTokener(nsimple); - system.debug( tkr.more() ); - system.debug( tkr.next(1) ); - system.assert( tkr.next(0) == '' ); - - try { tkr.next(10000); } catch(exception ex) { - system.debug( ' expected >'+ex.getMessage() + '<' ); - system.assert( ex.getMessage() == 'Ending position out of bounds: 10002'); - } - - system.debug( tkr.next('r') ); - - try { tkr.next('z'); } catch(exception ex) { - system.debug( ' expected >'+ex.getMessage() + '<' ); - system.assert( ex.getMessage() == 'Expected z and instead saw e'); - } - - system.debug( tkr.nextTo('e') ); - system.debug( tkr.skipTo('p') ); - system.debug( tkr.skipTo('z') ); - - tkr = new JsonTokener(nsimple); - jj = new BracketsJSONObject( tkr); - - system.debug( jj.data ); - system.debug( jj.data.keySet() ); - - system.debug( 'response status ' + jj.data.get('responseStatus') ); - system.debug( 'response status ' + jj.get('responseStatus') ); - system.debug( 'response details ' + jj.get('responseDetails') ); - - system.debug( jj.getString('responseDetails') ); - system.assert( jj.getString('responseDetails') == null ,'expected null '); - - system.debug('value '+ jj.getValue('responseData') ); - - value v = jj.data.get('responseData'); - system.debug( jj.getString('responseDetails') ); - system.debug( 'response data is '+ v.obj); - - //system.assert( v.obj.valu != null); - system.debug( jj.data.keySet() ); - - - nsimple = '{"responseString" : "foo" }'; - tkr = new JsonTokener(nsimple); - jj = new BracketsJSONObject( tkr); - system.debug( jj.get('responseString') ); - - nsimple = '{"responseBoolean" : true }'; - tkr = new JsonTokener(nsimple); - jj = new BracketsJSONObject( tkr); - system.debug( jj.getValue('responseBoolean') ); - system.debug( jj.optBoolean('responseBoolean') ); - - - try { - system.debug ( new BracketsJSONObject ( new JSONTokener( 'sdfsdf' ) ) ); - } catch(exception ex) { - system.debug( ' expected >'+ex.getMessage() + '<' ); - system.assert( ex.getMessage() == 'A BracketsJSONObject text must begin with {'); - } - - try { - system.debug ( new BracketsJSONObject ( new JSONTokener( '{"sdfsdf": true' ) ) ); - } catch(exception ex) { - system.debug( ' expected >'+ex.getMessage() + '<' ); - system.assert( ex.getMessage() == 'Expected a , or }'); - } - - try { - system.debug ( new BracketsJSONObject ( new JSONTokener( '{"sdfsdf' ) ) ); - } catch(exception ex) { - system.debug( ' expected >'+ex.getMessage() + '<' ); - system.assert( ex.getMessage() == 'Unterminated string'); - } - - try { - system.debug ( new BracketsJSONObject ( new JSONTokener( '{"sdfsdf": 0x009.9 }' ) ) ); - } catch(exception ex) { - system.debug( ' expected >'+ex.getMessage() + '<' ); - system.assert( ex.getMessage() == 'Invalid integer: 009.9'); - } - - - system.assert ( new BracketsJSONObject ( new JSONTokener( '{"sdfsdf": 009 }' ) ).getValue('sdfsdf').num == 9 ); - - system.debug ( new BracketsJSONObject ( new JSONTokener( '{"foo": 009 }' ) ).get('foo') == 9 ); - - // array testing - system.debug ( BracketsJSONObject.jsonarray ( new JSONTokener( '[1,2,3]' ) ) ); - system.debug ( BracketsJSONObject.jsonarray ( new JSONTokener( '[1,2,3,]' ) ) ); - system.debug ( BracketsJSONObject.jsonarray ( new JSONTokener( '[]' ) ) ); - system.debug ( BracketsJSONObject.jsonarray ( new JSONTokener( '(1,2,3 )' ) ) ); - - try { - system.debug ( BracketsJSONObject.jsonarray ( new JSONTokener( '(1,2,3 ]' ) ) ); - } catch(exception ex) { - system.debug( ' expected >'+ex.getMessage() + '<' ); - system.assert( ex.getMessage() == 'Expected a >)<'); - } - - try { - system.debug ( BracketsJSONObject.jsonarray ( new JSONTokener( '1,2,3 ]' ) ) ); - } catch(exception ex) { - system.debug( ' expected >'+ex.getMessage() + '<' ); - system.assert( ex.getMessage() == 'A JSONArray text must start with ['); - } - - try { - system.debug ( jj.get('notfound') ); - } catch(exception ex) { - system.debug( ' expected >'+ex.getMessage() + '<' ); - system.assert( ex.getMessage() == 'BracketsJSONObject[notfound] not found.'); - } - - system.assert( jj.keys() != null ); - system.assert( jj.length() > 0 ); - system.assert( jj.opt('responseBoolean') != null ); - system.assert( jj.has( 'responseBoolean') ); - try { - system.debug ( jj.getBoolean('notfound') ); - } catch(exception ex) { - system.debug( ' expected >'+ex.getMessage() + '<' ); - system.assert( ex.getMessage() == 'BracketsJSONObject[notfound] not found.'); - } - } - - public static testmethod void test_valueToString() { - BracketsJsonObject json = new BracketsJsonObject(); - json.putOpt('foo', new BracketsJSONObject.value('bar')); - /* - Make sure that the JSON rendered by this class passes validation by parsers - from http://json.org/json2.js and http://www.jsonlint.com. - For example: {foo: "bar"} is invalid - {"foo": "bar"} is valid - */ - system.assertEquals( '{"foo": "bar"}', json.ValuetoString()); - } - - // test that we can parse json containing a dobule - public static testmethod void test_geocode() { - string simple = '{ "Point": { "coordinates": [ -122.0841430, 37.4219720, 0 ] } }'; - BracketsJSONObject jj = new BracketsJSONObject( new JsonTokener(simple) ) ; - value p = jj.getValue('Point'); - system.debug (p.obj.data.get('coordinates')); - value[] vals = p.obj.data.get('coordinates').values; - system.debug( vals[0].dnum); - system.assertEquals(3,vals.size()); - system.assertEquals(-122.0841430, vals[0].dnum); - system.assertEquals(37.4219720, vals[1].dnum); - system.assertEquals('0', vals[2].valueToString()); - } - public static testmethod void test_g(){ - string googlejson = '{ "name": "1600 Amphitheatre Parkway, Mountain View, CA", "Status": { "code": 200, "request": "geocode" }, "Placemark": [ { "id": "p1", "address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA", "AddressDetails": { "Accuracy" : 8, "Country" : { "AdministrativeArea" : { "AdministrativeAreaName" : "CA", "SubAdministrativeArea" : { "Locality" : { "LocalityName" : "Mountain View", "PostalCode" : { "PostalCodeNumber" : "94043" }, "Thoroughfare" : { "ThoroughfareName" : "1600 Amphitheatre Pkwy" } }, '+ - ' "SubAdministrativeAreaName" : "Santa Clara" } }, "CountryName" : "USA", "CountryNameCode" : "US" }}, "ExtendedData": { "LatLonBox": { "north": 37.4251466, "south": 37.4188514, "east": -122.0811574, "west": -122.0874526 } }, "Point": { "coordinates": [ -122.0843700, 37.4217590, 0 ] } } ]} '; - BracketsJSONObject jj = new BracketsJSONObject( new JsonTokener(googlejson) ); - system.assertNotEquals(null,jj); + } + return null; // not reached } -} \ No newline at end of file +} diff --git a/src/classes/BracketsJSONObject.cls-meta.xml b/force-app/main/default/classes/BracketsJSONObject.cls-meta.xml similarity index 57% rename from src/classes/BracketsJSONObject.cls-meta.xml rename to force-app/main/default/classes/BracketsJSONObject.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsJSONObject.cls-meta.xml +++ b/force-app/main/default/classes/BracketsJSONObject.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsJSONObjectHandler.cls b/force-app/main/default/classes/BracketsJSONObjectHandler.cls new file mode 100644 index 0000000..83ca416 --- /dev/null +++ b/force-app/main/default/classes/BracketsJSONObjectHandler.cls @@ -0,0 +1,170 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +public with sharing class BracketsJSONObjectHandler { + private Map fieldsSobjectMap; + private Sobject customObject; + private List customObjectList; + @TestVisible + private String jsonString; + private List fields; + private BracketsJSONObject jsonObject; + + /** + * Constructors + */ + private BracketsJSONObjectHandler() { + this.fields = new List(); + this.jsonObject = new BracketsJSONObject(); + } + + public BracketsJSONObjectHandler(String jsonString, Sobject obj) { + this(); + this.customObject = obj; + this.fieldsSobjectMap = obj.getSObjectType() + .getDescribe() + .fields.getMap(); + this.jsonString = jsonString; + } + + public BracketsJSONObjectHandler( + List sobjectList, + List fields + ) { + this(); + customObjectList = sobjectList; + this.fields = fields; + } + + public BracketsJSONObjectHandler(Sobject obj, List fields) { + this(); + customObject = obj; + this.fields = fields; + } + + /** + * Given a single object or a list of them ,return these in json objects. + * + * @param a json string. + */ + public String toJSON() { + String jsonResult = ''; + if (this.customObjectList != null) { + jsonResult += '['; + if (!this.customObjectList.isEmpty()) { + for (Sobject obj : customObjectList) { + jsonResult += toJSON(obj) + ','; + } + jsonResult = jsonResult.substring(0, jsonResult.length() - 1); + } + jsonResult += ']'; + } else if (this.customObject != null) { + jsonResult = toJSON(this.customObject); + } + return jsonResult; + } + + /** + * Build a sobject populating their fields with data from a json. + * + * @return a instance of SObject + */ + public Sobject toSObject() { + jsonObject = new BracketsJSONObject( + new BracketsJSONObject.JSONTokener(jsonString) + ); + return toSObject(jsonObject); + } + + /** + * Build a list of sobject populating their fields with data from a json. + * + * @return a list of SObject + */ + public List toSObjectArray() { + List sobjectList = new List(); + List valueObjects = BracketsJSONObject.JSONArray( + new BracketsJSONObject.JSONTokener(jsonString) + ); + for (BracketsJSONObject.value value : valueObjects) { + if (value.obj != null) { + sobjectList.add(toSObject(value.obj)); + } + } + return sobjectList; + } + + /** + * Generate a Sobject from a BracketsJSONObject object. + * + * @param obj a BracketsJSONObject object. + * @return a Sobject. + */ + private Sobject toSObject(BracketsJSONObject obj) { + Sobject sobjectClone = customObject.getSObjectType().newSObject(); + for (String key : obj.keys()) { + assignValue(key, (String) obj.get(key), sobjectClone); + } + return sobjectClone; + } + + private String toJSON(Sobject obj) { + for (String attribute : fields) { + jsonObject.putOpt( + attribute, + new BracketsJSONObject.value(String.valueOf(obj.get(attribute))) + ); + } + + return jsonObject.ValuetoString(); + } + + private void assignValue(String key, String value, Sobject obj) { + Object objValue; + Schema.Sobjectfield sobjectField; + Schema.DisplayType sobjectFieldType; + if (value != null) { + sobjectField = fieldsSobjectMap.get(key); + sobjectFieldType = sobjectField.getDescribe().getType(); + if (sobjectFieldType == Schema.DisplayType.Boolean) { + objValue = Boolean.valueOf(value); + } else if ( + sobjectFieldType == Schema.DisplayType.Double || + sobjectFieldType == Schema.DisplayType.Integer || + sobjectFieldType == Schema.DisplayType.Percent || + sobjectFieldType == Schema.DisplayType.Currency + ) { + objValue = Decimal.valueOf(value); + } else { + objValue = String.valueOf(value); + } + obj.put(key, objValue); + } + } +} diff --git a/src/classes/BracketsJSONObjectHandler.cls-meta.xml b/force-app/main/default/classes/BracketsJSONObjectHandler.cls-meta.xml similarity index 57% rename from src/classes/BracketsJSONObjectHandler.cls-meta.xml rename to force-app/main/default/classes/BracketsJSONObjectHandler.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsJSONObjectHandler.cls-meta.xml +++ b/force-app/main/default/classes/BracketsJSONObjectHandler.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsJSONObjectHandlerTest.cls b/force-app/main/default/classes/BracketsJSONObjectHandlerTest.cls new file mode 100644 index 0000000..34d4244 --- /dev/null +++ b/force-app/main/default/classes/BracketsJSONObjectHandlerTest.cls @@ -0,0 +1,49 @@ +@isTest +class BracketsJSONObjectHandlerTest { + @isTest + static void testAllMethods() { + List predictionsList; + String jsonResult; + Sobject obj; + Integer value = 25; + String fieldName = 'Points__c'; + List fields = new List{ fieldName }; + Brackets_UserMatchPred__c sobjecta = new Brackets_UserMatchPred__c(); + sobjecta.Points__c = value; + + // Serializing match prediction + BracketsJSONObjectHandler handler = new BracketsJSONObjectHandler( + sobjecta, + fields + ); + jsonResult = handler.toJSON(); + + System.assert( + jsonResult == + '{"' + fieldName + '": "' + String.valueOf(value) + '"}' + ); + + // Deserializing a single match prediction + handler = new BracketsJSONObjectHandler(jsonResult, sobjecta); + obj = handler.toSObject(); + + System.assert(obj.get(fieldName) == value); + + handler.jsonString = '[' + jsonResult + ']'; + predictionsList = handler.toSObjectArray(); + + System.assert(predictionsList.size() == 1); + System.assert(predictionsList.get(0).get(fieldName) == value); + + predictionsList = new List(); + predictionsList.add(sobjecta); + predictionsList.add(sobjecta); + + // Deserializing a list of match predictions + + handler = new BracketsJSONObjectHandler(predictionsList, fields); + jsonResult = handler.toJSON(); + System.assert(predictionsList.get(0).get(fieldName) == value); + System.assert(predictionsList.get(1).get(fieldName) == value); + } +} diff --git a/force-app/main/default/classes/BracketsJSONObjectHandlerTest.cls-meta.xml b/force-app/main/default/classes/BracketsJSONObjectHandlerTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsJSONObjectHandlerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsJSONObjectTest.cls b/force-app/main/default/classes/BracketsJSONObjectTest.cls new file mode 100644 index 0000000..9a9543d --- /dev/null +++ b/force-app/main/default/classes/BracketsJSONObjectTest.cls @@ -0,0 +1,281 @@ +@isTest +class BracketsJSONObjectTest { + /* ************************** + * TEST Methods to achieve required code coverage + * many of these could be improved by using assert() instead of debug() + */ + @isTest + static void test_tokener_nl() { + //add a new line by inserting /n + BracketsJsonObject.JsonTokener tkr = new BracketsJsonObject.JsonTokener( + 'quoted string foo"' + ); + system.debug('next string is >' + tkr.nextString('"')); + system.assert(tkr != null); + } + @isTest + static void test_tokener() { + BracketsJsonObject.JsonTokener tkr = new BracketsJsonObject.JsonTokener( + '//ff \n{}' + ); + tkr.nextClean(); + tkr = new BracketsJsonObject.JsonTokener('/*fff*/\n{}'); + tkr.nextClean(); + tkr = new BracketsJsonObject.JsonTokener('#ff*\n{}'); + tkr.nextClean(); + tkr = new BracketsJsonObject.JsonTokener('/**ff \n{}'); + try { + tkr.nextClean(); + } catch (exception ex) { + system.debug(' expected >' + ex.getMessage() + '<'); + system.assert(ex.getMessage() == 'Unclosed comment'); + } + } + @isTest + static void test_parsing() { + BracketsJSONObject jj; + BracketsJsonObject.JsonTokener tkr; + string simple = '{"translatedText": "Ciao mondo" }'; + string bool_simple = '{"responseBoolean" : true }'; + string nsimple = '{"responseData" : {"translatedText": "Ciao mondo" }, "responseDetails": null, "responseStatus": 200 }'; + + // three methods of constructing an object + system.debug(Bracketsjsonobject.instance(bool_simple)); + system.debug(new Bracketsjsonobject(bool_simple)); + system.debug( + new BracketsJSONObject(new BracketsJsonObject.JsonTokener(simple)) + ); + + tkr = new BracketsJsonObject.JsonTokener(nsimple); + system.debug(tkr.more()); + system.debug(tkr.next(1)); + system.assert(tkr.next(0) == ''); + + try { + tkr.next(10000); + } catch (exception ex) { + system.debug(' expected >' + ex.getMessage() + '<'); + system.assert( + ex.getMessage() == 'Ending position out of bounds: 10002' + ); + } + + system.debug(tkr.next('r')); + + try { + tkr.next('z'); + } catch (exception ex) { + system.debug(' expected >' + ex.getMessage() + '<'); + system.assert(ex.getMessage() == 'Expected z and instead saw e'); + } + + system.debug(tkr.nextTo('e')); + system.debug(tkr.skipTo('p')); + system.debug(tkr.skipTo('z')); + + tkr = new BracketsJsonObject.JsonTokener(nsimple); + jj = new BracketsJSONObject(tkr); + + system.debug(jj.data); + system.debug(jj.data.keySet()); + + system.debug('response status ' + jj.data.get('responseStatus')); + system.debug('response status ' + jj.get('responseStatus')); + system.debug('response details ' + jj.get('responseDetails')); + + system.debug(jj.getString('responseDetails')); + system.assert( + jj.getString('responseDetails') == null, + 'expected null ' + ); + + system.debug('value ' + jj.getValue('responseData')); + + BracketsJSONObject.value v = jj.data.get('responseData'); + system.debug(jj.getString('responseDetails')); + system.debug('response data is ' + v.obj); + + //system.assert( v.obj.valu != null); + system.debug(jj.data.keySet()); + + nsimple = '{"responseString" : "foo" }'; + tkr = new BracketsJSONObject.JsonTokener(nsimple); + jj = new BracketsJSONObject(tkr); + system.debug(jj.get('responseString')); + + nsimple = '{"responseBoolean" : true }'; + tkr = new BracketsJSONObject.JsonTokener(nsimple); + jj = new BracketsJSONObject(tkr); + system.debug(jj.getValue('responseBoolean')); + system.debug(jj.optBoolean('responseBoolean')); + + try { + system.debug( + new BracketsJSONObject( + new BracketsJSONObject.JSONTokener('sdfsdf') + ) + ); + } catch (exception ex) { + system.debug(' expected >' + ex.getMessage() + '<'); + system.assert( + ex.getMessage() == 'A BracketsJSONObject text must begin with {' + ); + } + + try { + system.debug( + new BracketsJSONObject( + new BracketsJSONObject.JSONTokener('{"sdfsdf": true') + ) + ); + } catch (exception ex) { + system.debug(' expected >' + ex.getMessage() + '<'); + system.assert(ex.getMessage() == 'Expected a , or }'); + } + + try { + system.debug( + new BracketsJSONObject( + new BracketsJSONObject.JSONTokener('{"sdfsdf') + ) + ); + } catch (exception ex) { + system.debug(' expected >' + ex.getMessage() + '<'); + system.assert(ex.getMessage() == 'Unterminated string'); + } + + try { + system.debug( + new BracketsJSONObject( + new BracketsJSONObject.JSONTokener('{"sdfsdf": 0x009.9 }') + ) + ); + } catch (exception ex) { + system.debug(' expected >' + ex.getMessage() + '<'); + system.assert(ex.getMessage() == 'Invalid integer: 009.9'); + } + + system.assert( + new BracketsJSONObject( + new BracketsJSONObject.JSONTokener('{"sdfsdf": 009 }') + ) + .getValue('sdfsdf') + .num == 9 + ); + + system.debug( + new BracketsJSONObject( + new BracketsJSONObject.JSONTokener('{"foo": 009 }') + ) + .get('foo') == 9 + ); + + // array testing + system.debug( + BracketsJSONObject.jsonarray( + new BracketsJSONObject.JSONTokener('[1,2,3]') + ) + ); + system.debug( + BracketsJSONObject.jsonarray( + new BracketsJSONObject.JSONTokener('[1,2,3,]') + ) + ); + system.debug( + BracketsJSONObject.jsonarray( + new BracketsJSONObject.JSONTokener('[]') + ) + ); + system.debug( + BracketsJSONObject.jsonarray( + new BracketsJSONObject.JSONTokener('(1,2,3 )') + ) + ); + + try { + system.debug( + BracketsJSONObject.jsonarray( + new BracketsJSONObject.JSONTokener('(1,2,3 ]') + ) + ); + } catch (exception ex) { + system.debug(' expected >' + ex.getMessage() + '<'); + system.assert(ex.getMessage() == 'Expected a >)<'); + } + + try { + system.debug( + BracketsJSONObject.jsonarray( + new BracketsJSONObject.JSONTokener('1,2,3 ]') + ) + ); + } catch (exception ex) { + system.debug(' expected >' + ex.getMessage() + '<'); + system.assert( + ex.getMessage() == 'A JSONArray text must start with [' + ); + } + + try { + system.debug(jj.get('notfound')); + } catch (exception ex) { + system.debug(' expected >' + ex.getMessage() + '<'); + system.assert( + ex.getMessage() == 'BracketsJSONObject[notfound] not found.' + ); + } + + system.assert(jj.keys() != null); + system.assert(jj.length() > 0); + system.assert(jj.opt('responseBoolean') != null); + system.assert(jj.has('responseBoolean')); + try { + system.debug(jj.getBoolean('notfound')); + } catch (exception ex) { + system.debug(' expected >' + ex.getMessage() + '<'); + system.assert( + ex.getMessage() == 'BracketsJSONObject[notfound] not found.' + ); + } + } + + @isTest + static void test_valueToString() { + BracketsJsonObject json = new BracketsJsonObject(); + json.putOpt('foo', new BracketsJSONObject.value('bar')); + /* + Make sure that the JSON rendered by this class passes validation by parsers + from http://json.org/json2.js and http://www.jsonlint.com. + For example: {foo: "bar"} is invalid + {"foo": "bar"} is valid + */ + system.assertEquals('{"foo": "bar"}', json.ValuetoString()); + } + + // test that we can parse json containing a dobule + @isTest + static void test_geocode() { + string simple = '{ "Point": { "coordinates": [ -122.0841430, 37.4219720, 0 ] } }'; + BracketsJSONObject jj = new BracketsJSONObject( + new BracketsJSONObject.JsonTokener(simple) + ); + BracketsJSONObject.value p = jj.getValue('Point'); + system.debug(p.obj.data.get('coordinates')); + BracketsJSONObject.value[] vals = p.obj.data.get('coordinates').values; + system.debug(vals[0].dnum); + system.assertEquals(3, vals.size()); + system.assertEquals(-122.0841430, vals[0].dnum); + system.assertEquals(37.4219720, vals[1].dnum); + system.assertEquals('0', vals[2].valueToString()); + } + @isTest + static void test_g() { + string googlejson = + '{ "name": "1600 Amphitheatre Parkway, Mountain View, CA", "Status": { "code": 200, "request": "geocode" }, "Placemark": [ { "id": "p1", "address": "1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA", "AddressDetails": { "Accuracy" : 8, "Country" : { "AdministrativeArea" : { "AdministrativeAreaName" : "CA", "SubAdministrativeArea" : { "Locality" : { "LocalityName" : "Mountain View", "PostalCode" : { "PostalCodeNumber" : "94043" }, "Thoroughfare" : { "ThoroughfareName" : "1600 Amphitheatre Pkwy" } }, ' + + ' "SubAdministrativeAreaName" : "Santa Clara" } }, "CountryName" : "USA", "CountryNameCode" : "US" }}, "ExtendedData": { "LatLonBox": { "north": 37.4251466, "south": 37.4188514, "east": -122.0811574, "west": -122.0874526 } }, "Point": { "coordinates": [ -122.0843700, 37.4217590, 0 ] } } ]} '; + BracketsJSONObject jj = new BracketsJSONObject( + new BracketsJSONObject.JsonTokener(googlejson) + ); + system.assertNotEquals(null, jj); + } +} diff --git a/force-app/main/default/classes/BracketsJSONObjectTest.cls-meta.xml b/force-app/main/default/classes/BracketsJSONObjectTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsJSONObjectTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsJoinInvitedUser.cls b/force-app/main/default/classes/BracketsJoinInvitedUser.cls new file mode 100644 index 0000000..bc77e8d --- /dev/null +++ b/force-app/main/default/classes/BracketsJoinInvitedUser.cls @@ -0,0 +1,110 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +public with sharing class BracketsJoinInvitedUser { + private final String UID = Userinfo.getUserId(); + private final String GID = Apexpages.currentPage() + .getParameters() + .get('gId'); + private Brackets_Tournament__c tour = new Brackets_Tournament__c(); + private Brackets_Group__c cGroup = new Brackets_Group__c(); + private Brackets_UserTournament__c uTour = new Brackets_UserTournament__c(); + public Boolean showButtons; + + /** + * Constructor + */ + public BracketsJoinInvitedUser() { + } + + /** + * Index + * @return null + */ + public Pagereference index() { + if (GID != null && GID != '') { + List cUserTournament = [ + SELECT Id + FROM Brackets_UserTournament__c + WHERE Brackets_Group__c = :GID AND User__c = :UID + ]; + if (cUserTournament.isEmpty()) { + cGroup = [ + SELECT Brackets_Tournament__c, Brackets_Tournament__r.Id, Id + FROM Brackets_Group__c + WHERE Id = :GID + LIMIT 1 + ]; + this.tour = cGroup.Brackets_Tournament__r; + this.showButtons = true; + return null; + } + } + return this.cancel(); + } + + public Boolean getShowButtons() { + return this.showButtons; + } + + /** + * Join User action + * @return pageref PageReference + */ + public Pagereference joinUser() { + this.uTour.Brackets_Group__c = GID; + this.uTour.Brackets_Tournament__c = this.tour.Id; + this.uTour.User__c = UID; + insert this.uTour; + + //join Chatter. + /* + Integer alreadySubscribed = [Select Count() From EntitySubscription Where SubscriberId = :UID and ParentId = :GID]; + + if (alreadySubscribed == 0) { + EntitySubscription es = new EntitySubscription(); + System.debug('UID ' + UID); + System.debug('GID ' + GID); + es.SubscriberId = UID; + es.ParentId = GID; + insert es; + } + */ + + return new Pagereference('/apex/BracketsPredictions?show=' + GID); + } + + /** + * Return to HomePage + * @return pageref PageReference + */ + public Pagereference cancel() { + return Page.BracketsPools; + } +} diff --git a/src/classes/BracketsJoinInvitedUser.cls-meta.xml b/force-app/main/default/classes/BracketsJoinInvitedUser.cls-meta.xml similarity index 57% rename from src/classes/BracketsJoinInvitedUser.cls-meta.xml rename to force-app/main/default/classes/BracketsJoinInvitedUser.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsJoinInvitedUser.cls-meta.xml +++ b/force-app/main/default/classes/BracketsJoinInvitedUser.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsJoinInvitedUserTest.cls b/force-app/main/default/classes/BracketsJoinInvitedUserTest.cls new file mode 100644 index 0000000..f1deffd --- /dev/null +++ b/force-app/main/default/classes/BracketsJoinInvitedUserTest.cls @@ -0,0 +1,71 @@ +@isTest +class BracketsJoinInvitedUserTest { + //Test Join Successfully + @isTest + static void test() { + //Create enviroment + Brackets_Group__c mGroup = BracketsTestUtilities.getGroup(null); + Apexpages.currentPage().getParameters().put('gId', mGroup.Id); + BracketsJoinInvitedUser cTest = new BracketsJoinInvitedUser(); + Test.startTest(); + Pagereference tRef = cTest.index(); + tRef = cTest.cancel(); + tRef = cTest.joinUser(); + Test.stopTest(); + List uTour = [ + SELECT Id + FROM Brackets_UserTournament__c + WHERE + User__c = :UserInfo.getUserId() + AND Brackets_Group__c = :mGroup.Id + ]; + System.assert(!uTour.isEmpty()); + } + + //Test Not URL parm + @isTest + static void test1() { + //Create enviroment + Brackets_Group__c mGroup = BracketsTestUtilities.getGroup(null); + BracketsJoinInvitedUser cTest = new BracketsJoinInvitedUser(); + Test.startTest(); + Pagereference tRef = cTest.index(); + Test.stopTest(); + List uTour = [ + SELECT Id + FROM Brackets_UserTournament__c + WHERE + User__c = :UserInfo.getUserId() + AND Brackets_Group__c = :mGroup.Id + ]; + System.assert(uTour.isEmpty()); + } + + //Test already Join + @isTest + static void test2() { + //Create enviroment + Brackets_Tournament__c mTour = BracketsTestUtilities.getNewStandardTournament(); + Brackets_Group__c mGroup = BracketsTestUtilities.getGroup(mTour.Id); + Brackets_UserTournament__c uTour = BracketsTestUtilities.createUserTournament( + Userinfo.getUserId(), + mTour.Id, + mGroup.Id + ); + Apexpages.currentPage().getParameters().put('gId', mGroup.Id); + + BracketsJoinInvitedUser cTest = new BracketsJoinInvitedUser(); + Test.startTest(); + Pagereference tRef = cTest.index(); + cTest.getShowButtons(); + Test.stopTest(); + List uTr = [ + SELECT Id + FROM Brackets_UserTournament__c + WHERE + User__c = :UserInfo.getUserId() + AND Brackets_Group__c = :mGroup.Id + ]; + System.assert(!uTr.isEmpty()); + } +} diff --git a/force-app/main/default/classes/BracketsJoinInvitedUserTest.cls-meta.xml b/force-app/main/default/classes/BracketsJoinInvitedUserTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsJoinInvitedUserTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/src/classes/BracketsLeaderboardController.cls b/force-app/main/default/classes/BracketsLeaderboardController.cls similarity index 57% rename from src/classes/BracketsLeaderboardController.cls rename to force-app/main/default/classes/BracketsLeaderboardController.cls index ab25707..de853fa 100644 --- a/src/classes/BracketsLeaderboardController.cls +++ b/force-app/main/default/classes/BracketsLeaderboardController.cls @@ -28,29 +28,54 @@ OF THE POSSIBILITY OF SUCH DAMAGE. */ public with sharing class BracketsLeaderboardController { - public Id groupId { get; set; } - + public List getLeaders() { List leaders = null; - + if (groupId != null) { - leaders = [Select Id, User__c, User__r.Name, Tiebreaker_Points__c, Brackets_Tournament__c, Brackets_Tournament__r.Name, Brackets_Group__c, Brackets_Group__r.Name, Points__c, View__c From Brackets_UserTournament__c Where Brackets_Group__c = :groupId Order By Brackets_Tournament__r.Name ASC, Brackets_Group__r.Name ASC, Points__c DESC LIMIT 1000]; + leaders = [ + SELECT + Id, + User__c, + User__r.Name, + Tiebreaker_Points__c, + Brackets_Tournament__c, + Brackets_Tournament__r.Name, + Brackets_Group__c, + Brackets_Group__r.Name, + Points__c, + View__c + FROM Brackets_UserTournament__c + WHERE Brackets_Group__c = :groupId + ORDER BY + Brackets_Tournament__r.Name ASC, + Brackets_Group__r.Name ASC, + Points__c DESC + LIMIT 1000 + ]; } else { - leaders = [Select Id, User__c, User__r.Name, Tiebreaker_Points__c, Brackets_Tournament__c, Brackets_Tournament__r.Name, Brackets_Group__c, Brackets_Group__r.Name, Points__c, View__c From Brackets_UserTournament__c Order By Brackets_Tournament__r.Name ASC, Brackets_Group__r.Name ASC, Points__c DESC LIMIT 1000]; + leaders = [ + SELECT + Id, + User__c, + User__r.Name, + Tiebreaker_Points__c, + Brackets_Tournament__c, + Brackets_Tournament__r.Name, + Brackets_Group__c, + Brackets_Group__r.Name, + Points__c, + View__c + FROM Brackets_UserTournament__c + ORDER BY + Brackets_Tournament__r.Name ASC, + Brackets_Group__r.Name ASC, + Points__c DESC + LIMIT 1000 + ]; } - + return leaders; } - - static TestMethod void testSimple() { - - BracketsLeaderboardController controller = new BracketsLeaderboardController(); - - List l = controller.getLeaders(); - - System.assert(l != null); - - } - -} \ No newline at end of file +} diff --git a/src/classes/BracketsLeaderboardController.cls-meta.xml b/force-app/main/default/classes/BracketsLeaderboardController.cls-meta.xml similarity index 57% rename from src/classes/BracketsLeaderboardController.cls-meta.xml rename to force-app/main/default/classes/BracketsLeaderboardController.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsLeaderboardController.cls-meta.xml +++ b/force-app/main/default/classes/BracketsLeaderboardController.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsLeaderboardControllerTest.cls b/force-app/main/default/classes/BracketsLeaderboardControllerTest.cls new file mode 100644 index 0000000..03428e4 --- /dev/null +++ b/force-app/main/default/classes/BracketsLeaderboardControllerTest.cls @@ -0,0 +1,11 @@ +@isTest +class BracketsLeaderboardControllerTest { + @isTest + static void testSimple() { + BracketsLeaderboardController controller = new BracketsLeaderboardController(); + + List l = controller.getLeaders(); + + System.assert(l != null); + } +} diff --git a/force-app/main/default/classes/BracketsLeaderboardControllerTest.cls-meta.xml b/force-app/main/default/classes/BracketsLeaderboardControllerTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsLeaderboardControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsMatchUtilities.cls b/force-app/main/default/classes/BracketsMatchUtilities.cls new file mode 100644 index 0000000..0c133f8 --- /dev/null +++ b/force-app/main/default/classes/BracketsMatchUtilities.cls @@ -0,0 +1,543 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +public with sharing class BracketsMatchUtilities { + public static final String TEAM_JUST_SELECTED = 'Some of the teams have been selected for another match in this round.'; + public static final String FIRST_ROUND_NOT_COMPLETED = 'Cannot publish. All starting matches much be complete before publishing. Check your matches and start again.'; + public static Boolean SKIP_TRIGGER = false; + + /** + * Check if all statics list of Tournament and Rounds are setted; + * @params newMatchList + */ + public static void getTriggerInstance( + List newMatchList + ) { + BracketsTriggerUtilities.newTriggerInstance(newMatchList); + } + + /** + * Check if Scheduler Match is greater than its predecessors and lower than the following match + * @param matchesNew a list of matches. + */ + public static void dateMatchesValidation( + List matchesNew + ) { + BracketsTriggerUtilities.newTriggerInstance(matchesNew); + Datetime mySchedule; + + for ( + Brackets_Match__c currentMatch : BracketsTriggerUtilities.triggerListObject.values() + ) { + Brackets_Match__c cMatch = BracketsTriggerUtilities.triggerListObject.get( + currentMatch.Id + ); + Brackets_Match__c fMatch = BracketsTriggerUtilities.triggerMatchMap.get( + currentMatch.FollowingBrackets_Match__c + ); + + if (fMatch != null) { + mySchedule = fMatch.Schedule__c; + if (currentMatch.Schedule__c > mySchedule) { + cMatch.Schedule__c.addError( + 'The date of a match must be lower than its successor [successor match] ' + + fMatch.id + + ' [scheduled] ' + + mySchedule + ); + return; + } + } + for ( + Brackets_Match__c verList : BracketsTriggerUtilities.triggerMatchList + ) { + fMatch = BracketsTriggerUtilities.triggerListObject.get( + currentMatch.Id + ); + if (verList.FollowingBrackets_Match__c == fMatch.Id) { + if (fMatch.Schedule__c < verList.Schedule__c) { + cMatch.Schedule__c.addError( + 'The date of a match must be greater than its predecessor' + ); + } + } + } + } + } + + /** + * Check if teams for new matches have been assigned the another matches in the same round. + * + * @param userMatchPredictionsNew a list of matches. + */ + public static void checkExistMatchesInRound( + List matchesNew + ) { + BracketsTriggerUtilities.newTriggerInstance(matchesNew); + List matches = new List(); + Boolean homeTeamInMatch = false; + Boolean visitorTeamInMatch = false; + Brackets_Round__c roundMatchNew; + Brackets_Round__c roundMatch; + Decimal roundMatchNewNumber; + Decimal roundMatchNumber; + Decimal diffRounds; + + for (Integer j = 0; j < matchesNew.size(); j++) { + for ( + Brackets_Match__c m : BracketsTriggerUtilities.triggerMatchList + ) { + roundMatch = BracketsTriggerUtilities.triggerRoundMap.get( + m.Brackets_Round__c + ); + roundMatchNew = BracketsTriggerUtilities.triggerRoundMap.get( + matchesNew.get(j).Brackets_Round__c + ); + roundMatchNewNumber = (Decimal) roundMatch.get( + 'RoundNumber__c' + ); + roundMatchNumber = (Decimal) roundMatchNew.get( + 'RoundNumber__c' + ); + diffRounds = Math.abs(roundMatchNewNumber - roundMatchNumber); + if (diffRounds <= 1) { + matches.add( + BracketsTriggerUtilities.triggerMatchMap.get(m.Id) + ); + } + } + } + + // Iterate over the matches to found if the team has already been used + for (Brackets_Match__c matchNew : matchesNew) { + for (Brackets_Match__c match : matches) { + if ( + match.Id != matchNew.Id && + match.Brackets_Round__c == matchNew.Brackets_Round__c + ) { + homeTeamInMatch = existsTeamInMatch( + matchNew.HomeBrackets_Team__c, + match + ); + visitorTeamInMatch = existsTeamInMatch( + matchNew.VisitorBrackets_Team__c, + match + ); + if (homeTeamInMatch || visitorTeamInMatch) { + System.debug( + '12345: [match1] ' + + match.Id + + ' [match2] ' + + matchNew.Id + + ' [team] ' + ); + break; + } + } + } + + if (homeTeamInMatch) { + matchNew.HomeBrackets_Team__c.addError(TEAM_JUST_SELECTED); + } else if (visitorTeamInMatch) { + matchNew.VisitorBrackets_Team__c.addError(TEAM_JUST_SELECTED); + } + } + } + + /** + * Given the winners of the matches, each one is set to the following match if exists one. + * @param matches List of new matches + */ + public static void updateFollowingMatches(List matches) { + BracketsTriggerUtilities.newTriggerInstance(matches); + List followingMatches = new List(); + + for (Brackets_Match__c match : matches) { + if ( + match.FollowingBrackets_Match__c != null && + match.WinnerBrackets_Team__c != null + ) { + followingMatches.add( + BracketsTriggerUtilities.triggerMatchMap.get( + match.FollowingBrackets_Match__c + ) + ); + } + } + + for ( + Brackets_Match__c match : BracketsTriggerUtilities.triggerListObject.values() + ) { + for (Brackets_Match__c followingMatch : followingMatches) { + if ( + match.FollowingBrackets_Match__c == followingMatch.Id && + followingMatch.WinnerBrackets_Team__c == null + ) { + if (match.FollowingIsHome__c) { + followingMatch.HomeBrackets_Team__c = match.WinnerBrackets_Team__c; + } else { + followingMatch.VisitorBrackets_Team__c = match.WinnerBrackets_Team__c; + } + break; + } else { + BracketsTriggerUtilities.triggerListObject.get(match.Id) + .WinnerBrackets_Team__c.addError( + 'You must remove the Teams from the next match first.' + ); + return; + } + } + } + + try { + if (!followingMatches.isEmpty()) { + BracketsMatchUtilities.SKIP_TRIGGER = true; + update followingMatches; + BracketsMatchUtilities.SKIP_TRIGGER = false; + } + } catch (Exception e) { + BracketsTriggerUtilities.triggerListObject.values() + .get(0) + .WinnerBrackets_Team__c.addError(e.getMessage()); + } + } + + /** + * Check if the Match is following of an other, if it is, the teams can not be changed or seted. + * @param matchListNew + * @param matchListOld + */ + public static void checkSetTeam( + List matchListNew, + List matchListOld + ) { + Brackets_Match__c matchNew; + Brackets_Match__c matchOld; + + for (Integer x = 0; x < matchListOld.size(); x++) { + matchNew = matchListNew.get(x); + matchOld = matchListOld.get(x); + + if ( + (matchOld.HomeBrackets_Team__c != + matchNew.HomeBrackets_Team__c) || + (matchOld.VisitorBrackets_Team__c != + matchNew.VisitorBrackets_Team__c) + ) { + for ( + Brackets_Match__c m : BracketsTriggerUtilities.triggerMatchList + ) { + if (m.FollowingBrackets_Match__c == matchOld.Id) { + Brackets_Round__c cRound = BracketsTriggerUtilities.triggerRoundMap.get( + m.Brackets_Round__c + ); + Brackets_Tournament__c cTour = BracketsTriggerUtilities.triggerTournamentMap.get( + cRound.Brackets_Tournament__c + ); + //System.assert(false,cRound.RoundNumber__c); + if ( + cTour.Type__c != + BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE || + cRound.RoundNumber__c != 1 + ) { + matchNew.addError('Teams can not be changed'); + return; + } else { + if (cRound.RoundNumber__c == 1) { + if ( + (m.Position__c == 1 || + m.Position__c == 3) && + (matchOld.HomeBrackets_Team__c != + matchNew.HomeBrackets_Team__c) + ) { + matchNew.addError( + 'Teams can not be changed' + ); + return; + } else if ( + (m.Position__c == 2 || + m.Position__c == 4) && + (matchOld.VisitorBrackets_Team__c != + matchNew.VisitorBrackets_Team__c) + ) { + matchNew.addError( + 'Teams can not be changed' + ); + return; + } + } + } + } + } + } + } + } + + /** + * When Winner team is removed from some match, we need check if the following match Winner team is also set + * so we block the update, else we need remove the team from following match + * @param matchListNew + * @param matchListOld + */ + public static void checkRemovedTeam( + List matchListNew, + List matchListOld + ) { + BracketsTriggerUtilities.newTriggerInstance(matchListNew); + List newList = BracketsTriggerUtilities.triggerListObject.values(); + List mList = new List(); + Brackets_Match__c matchNew; + Brackets_Match__c matchOld; + + for (Integer x = 0; x < matchListNew.size(); x++) { + matchNew = matchListNew.get(x); + matchOld = matchListOld.get(x); + if ( + !matchNew.isLocked__c && + matchNew.WinnerBrackets_Team__c == null && + (matchNew.WinnerBrackets_Team__c != + matchOld.WinnerBrackets_Team__c) + ) { + //First of all, check if the follower match have WinnerTeam + Brackets_Match__c fMatch = BracketsTriggerUtilities.triggerMatchMap.get( + matchOld.FollowingBrackets_Match__c + ); + + if (fMatch != null && fMatch.WinnerBrackets_Team__c != null) { + matchNew.WinnerBrackets_Team__c.addError( + 'Team can\'t be removed because the next match have a Winner Team' + ); + } else if (fMatch != null) { + if ( + fMatch.HomeBrackets_Team__c == + matchOld.WinnerBrackets_Team__c + ) { + fMatch.HomeBrackets_Team__c = null; + } else { + fMatch.VisitorBrackets_Team__c = null; + } + fMatch.VisitorScore__c = 0; + fMatch.HomeScore__c = 0; + mList.add(fMatch); + } + } + } + if (!mList.isEmpty()) { + BracketsMatchUtilities.SKIP_TRIGGER = true; + update mList; + BracketsMatchUtilities.SKIP_TRIGGER = false; + } + } + + /** + * If the Winner team is set, the previous match is locked in order to avoid tournament inconsistences. + * @param mListNew + * @param oListNew + */ + public static void setWinnerTeam( + List mListNew, + List mListOld + ) { + List lockedMatchList = new List(); + for (Integer x = 0; x < mListNew.size(); x++) { + if (mListNew.get(x).WinnerBrackets_Team__c != null) { + for ( + Brackets_Match__c match : BracketsTriggerUtilities.triggerMatchList + ) { + if ( + match.FollowingBrackets_Match__c == mListNew.get(x).Id + ) { + if (match != null) { + match.isLocked__c = true; + lockedMatchList.add(match); + } + } + } + } + } + BracketsMatchUtilities.SKIP_TRIGGER = true; + if (!lockedMatchList.isEmpty()) { + Database.update(lockedMatchList); + } + BracketsMatchUtilities.SKIP_TRIGGER = false; + } + + public static void checkLocked( + List mListOld, + List mListNew + ) { + for (Integer x = 0; x < mListNew.size(); x++) { + if (mListOld.get(x).isLocked__c) { + mListNew.get(x).addError('This Match can not be updated'); + } + } + } + + /** + * Given a team id, returns true if it is in the match, otherwise false. + * + * @param teamId + * @param match + * @return if exists the team in the match + */ + private static Boolean existsTeamInMatch( + Id teamId, + Brackets_Match__c match + ) { + return teamId != null && + (teamId == match.HomeBrackets_Team__c || + teamId == match.VisitorBrackets_Team__c); + } + + /** + * Method used to insert External Ids on Match objects + * @param matchList + */ + //TODO do we need this? + /* + public static void addExternalId( List matchList ){ + + for( Brackets_Match__c match : matchList ){ + if( match.ExternalId__c == null ){ + match.ExternalId__c = BracketsTournamentUtilities.generateRandomExternalId(); + } + } + } + */ + + /** + * Given one list of mathces, check if there changes in them to update the tournament. + * + * @param newMatchList a list of match sobjects + */ + public static void publishOff(List newMatchList) { + BracketsMatchUtilities.getTriggerInstance(newMatchList); + BracketsTournamentUtilities.publishTournamentOff( + BracketsTriggerUtilities.triggerTournamentList + ); + } + + /** + * Check the teams for the matches of first level if they are filled. + * + * @param tournament + */ + public static void checkFirstLevelCompleted( + Brackets_Tournament__c tournament, + Map matches + ) { + Brackets_Match__c match; + Id matchFollowingId; + List matchesFirstRound = new List(); + Set allMatchesId = new Set(); + // in this set are the id with more than one reference of the match in the following match field. + Set matchesIdWithFollowging = new Set(); + // in this set are the id with no references of this match in the following match field. + Set matchesIdWithOutFollowing = new Set(); + // in this set are the id with any reference of the match in the following match field. + Set matchesIdPotencial = new Set(); + + // obtain whole the matches id from a tournament + allMatchesId.addAll(matches.keySet()); + matchesIdWithOutFollowing = allMatchesId; + + // obtain the matches id which are set as following match + for (Id matchId : matches.keySet()) { + match = matches.get(matchId); + matchFollowingId = match.FollowingBrackets_Match__c; + if (matchId != null) { + if (matchesIdPotencial.contains(matchFollowingId)) { + matchesIdWithFollowging.add(matchFollowingId); + } else { + // in this case add the id because there's more than one reference of the match. + matchesIdPotencial.add(matchFollowingId); + } + } + } + + // obtain the matches id which are not following of any match + matchesIdWithOutFollowing.removeAll(matchesIdWithFollowging); + // obtain the matches id which are referenced one time in the followingMatch field. + matchesIdPotencial.removeAll(matchesIdWithFollowging); + for (Id matchId : matchesIdWithOutFollowing) { + match = matches.get(matchId); + matchesFirstRound.add(match); + } + + checkCompletedMatches(matchesFirstRound, matchesIdPotencial); + } + + public static Map getMatchesMap( + List matchesId + ) { + return new Map( + [ + SELECT + Id, + ExternalId__c, + HomeBrackets_Team__c, + VisitorBrackets_Team__c + FROM Brackets_Match__c + WHERE id IN :matchesId + ] + ); + } + + /** + * Check if a list of matches have their teams set. + * + * @param matches a list of matches + * @param matchesIdSet a set of matches id to check both teams or not + */ + private static void checkCompletedMatches( + List matches, + Set matchesIdSet + ) { + Boolean checkCompletedMatch = true; + for (Brackets_Match__c match : matches) { + checkCompletedMatch = + (matchesIdSet.contains(match.Id) && + (match.HomeBrackets_Team__c != null || + match.VisitorBrackets_Team__c != null)) || + (match.HomeBrackets_Team__c != null && + match.VisitorBrackets_Team__c != null); + if (!checkCompletedMatch) { + break; + } + } + if (!checkCompletedMatch) { + throw new CustomException( + BracketsMatchUtilities.FIRST_ROUND_NOT_COMPLETED + ); + } + } + + public class CustomException extends Exception { + } +} diff --git a/src/classes/BracketsMatchUtilities.cls-meta.xml b/force-app/main/default/classes/BracketsMatchUtilities.cls-meta.xml similarity index 57% rename from src/classes/BracketsMatchUtilities.cls-meta.xml rename to force-app/main/default/classes/BracketsMatchUtilities.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsMatchUtilities.cls-meta.xml +++ b/force-app/main/default/classes/BracketsMatchUtilities.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsMatchUtilitiesTest.cls b/force-app/main/default/classes/BracketsMatchUtilitiesTest.cls new file mode 100644 index 0000000..480f460 --- /dev/null +++ b/force-app/main/default/classes/BracketsMatchUtilitiesTest.cls @@ -0,0 +1,122 @@ +@isTest +class BracketsMatchUtilitiesTest { + //------------------------------------------------------------------------- + // Test Methods + //------------------------------------------------------------------------- + + @isTest + static void testDateMatchesValidation() { + Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament( + 'Checking dates', + 2 + ); + Brackets_Round__c round = BracketsTestUtilities.createRound( + tournament, + 1, + DateTime.now(), + 3, + 'First Round' + ); + + Brackets_Team__c homeTeam, visitorTeam; + List matches = new List{ + new Brackets_Match__c(), + new Brackets_Match__c(), + new Brackets_Match__c() + }; + + // Standard flow + matches[0].Schedule__c = DateTime.now().addDays(1); + matches[0].Brackets_Round__c = round.Id; + + matches[1].Schedule__c = DateTime.now().addDays(2); + matches[1].Brackets_Round__c = round.Id; + + matches[2].Schedule__c = DateTime.now().addDays(5); + matches[2].Brackets_Round__c = round.Id; + + insert matches; + + matches[0].FollowingBrackets_Match__c = matches[1].Id; + matches[1].FollowingBrackets_Match__c = matches[2].Id; + + upsert matches; + + matches[1].Schedule__c = DateTime.now().addDays(3); + + upsert matches; + + system.assert(matches.size() == 3); + } + + @isTest + static void testUpdateFollowingMatchesWinner() { + Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament( + 'Checking winners', + 2 + ); + Brackets_Round__c firstRound = BracketsTestUtilities.createRound( + tournament, + 1, + DateTime.now(), + 3, + 'First Round' + ); + Brackets_Round__c secondRound = BracketsTestUtilities.createRound( + tournament, + 2, + DateTime.now().addDays(5), + 5, + 'Second Round' + ); + List teams = BracketsTestUtilities.createTeamList(2); + insert teams; + + Brackets_Team__c homeTeam, visitorTeam; + List matches = new List{ + new Brackets_Match__c(), + new Brackets_Match__c() + }; + + matches[0].Brackets_Round__c = firstRound.Id; + matches[0].HomeBrackets_Team__c = teams[0].Id; + matches[0].VisitorBrackets_Team__c = teams[1].Id; + matches[1].Brackets_Round__c = secondRound.Id; + insert matches; + + matches[0].FollowingBrackets_Match__c = matches[1].Id; + matches[0].HomeScore__c = 25; + matches[0].VisitorScore__c = 24; + matches[0].WinnerBrackets_Team__c = teams[0].Id; + update matches[0]; + + Map matchesMap = new Map(); + matchesMap.put(matches[0].Id, matches[0]); + System.assert( + matches[0].HomeBrackets_Team__c == matches[0].WinnerBrackets_Team__c + ); + + //check the first level completed for the matches[0] + try { + BracketsMatchUtilities.checkFirstLevelCompleted( + tournament, + matchesMap + ); + System.assert(true, 'This line should be executed.'); + } catch (Exception e) { + System.assert(false, 'This line shouldn\'t be executed.'); + } + + matchesMap.put(matches[1].Id, matches[1]); + //check the first level completed for the whole matches + try { + BracketsMatchUtilities.checkFirstLevelCompleted( + tournament, + matchesMap + ); + System.assert(false, 'This line shouldn\'t be executed.'); + } catch (Exception e) { + System.assert(true, 'This line should be executed.'); + } + } +} diff --git a/force-app/main/default/classes/BracketsMatchUtilitiesTest.cls-meta.xml b/force-app/main/default/classes/BracketsMatchUtilitiesTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsMatchUtilitiesTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsMatchesPredictionUtil.cls b/force-app/main/default/classes/BracketsMatchesPredictionUtil.cls new file mode 100644 index 0000000..2cc29ff --- /dev/null +++ b/force-app/main/default/classes/BracketsMatchesPredictionUtil.cls @@ -0,0 +1,228 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +public with sharing class BracketsMatchesPredictionUtil { + /** + * Upsert a list of match predictions in the database, filtering by the ones which have a predicted winner. + * + * @param a list of match predictions + */ + public static void save( + List userMatchPredictions + ) { + List userMatchPredictionsToSave = new List(); + for ( + Brackets_UserMatchPred__c userMatchPrediction : userMatchPredictions + ) { + if (userMatchPrediction.PredictedWinnerBrackets_Team__c != null) { + userMatchPredictionsToSave.add(userMatchPrediction); + } + } + if (!userMatchPredictionsToSave.isEmpty()) { + upsert userMatchPredictionsToSave; + } + } + + /** + * Given an json string, save the information contained in it. + * + * @param jsonString a string with json formant content. + */ + public static void saveFromJSON(String jsonString, Id UserId) { + List matchesPredictionsToUpdate; + List predictionIdListToUpdate; + List matchesIdList; + + BracketsUserMatchJSONObjectHandler handler; + + handler = new BracketsUserMatchJSONObjectHandler(); + handler.processJSON(jsonString); + + matchesPredictionsToUpdate = checkExistingPredictions( + handler.matchesPredictionList, + userId + ); + + // are there any predictions that + + // update the existing matches predictions + if (!matchesPredictionsToUpdate.isEmpty()) { + update matchesPredictionsToUpdate; + } + + // insert the new matches predictions + if (!handler.matchesPredictionList.isEmpty()) { + insert handler.matchesPredictionList; + } + } + + /** + * Check if a group of user have predicted these matches, if they have been done remove from the new list and do an updation. + * + * @param userMatchPredictionsNew a list of match predictions. + */ + public static List checkExistingPredictions( + List userMatchPredictionsNew, + Id userId + ) { + Brackets_UserMatchPred__c userMatchPrediction; + Brackets_UserMatchPred__c userMatchPredictionNew; + Set matchIdSet = new Set(); + Boolean predictionIsAlreadyDone = false; + List tournamentIds = new List(); + List userMatchPredictionToUpdateList = new List(); + for (Integer j = 0; j < userMatchPredictionsNew.size();) { + userMatchPredictionNew = userMatchPredictionsNew.get(j); + //check if not exist the match for this prediction + if ( + !matchIdSet.contains(userMatchPredictionNew.Brackets_Match__c) + ) { + matchIdSet.add(userMatchPredictionNew.Brackets_Match__c); + j++; + } else { + userMatchPredictionsNew.remove(j); + } + tournamentIds.add( + userMatchPredictionNew.Brackets_UserTournament__c + ); + } + List userMatchPredictions = [ + SELECT + Id, + Brackets_UserTournament__c, + Brackets_UserTournament__r.User__c, + Brackets_Match__c + FROM Brackets_UserMatchPred__c + WHERE + Brackets_UserTournament__c IN :tournamentIds + AND Brackets_Match__c IN :matchIdSet + AND Brackets_UserTournament__r.User__c = :userId + ]; + + //Iterate over Brackets_UserMatchPred__c's objects checking if the match's prediction has been done by the same user. + for (Integer i = 0; i < userMatchPredictions.size(); i++) { + userMatchPrediction = userMatchPredictions.get(i); + for (Integer j = 0; j < userMatchPredictionsNew.size(); j++) { + userMatchPredictionNew = userMatchPredictionsNew.get(j); + predictionIsAlreadyDone = + userMatchPrediction.Id != userMatchPredictionNew.Id && + userMatchPrediction.Brackets_UserTournament__r.User__c == + userId && + userMatchPrediction.Brackets_UserTournament__c == + userMatchPredictionNew.Brackets_UserTournament__c && + userMatchPrediction.Brackets_Match__c == + userMatchPredictionNew.Brackets_Match__c; + if (predictionIsAlreadyDone) { + // if there is an existing prediction update the predicted winner team and add to the new list to upate. + userMatchPrediction.PredictedWinnerBrackets_Team__c = userMatchPredictionNew.PredictedWinnerBrackets_Team__c; + // remove the new prediction from the list of prediction to insert. + userMatchPredictionsNew.remove(j); + // add to tne updated list. + userMatchPredictionToUpdateList.add(userMatchPrediction); + break; + } + } + } + // return the existing prediction with the predicted. + return userMatchPredictionToUpdateList; + } + + /** + * Updates the points of the user after a match result is updated depending on user prediction. + * + * @param matchesForUpdate List of matches to be updated + */ + public static void updateUserMatchPredictionPoints( + List matchesForUpdate + ) { + String query; + Brackets_Match__c match; + Id winner; + Decimal scorePoints; + List predictions = new List(); + String mfuIdsArrayString = '('; + for (Brackets_Match__c mfu : matchesForUpdate) { + mfuIdsArrayString += '\'' + mfu.Id + '\','; + } + if (!matchesForUpdate.isEmpty()) { + mfuIdsArrayString = mfuIdsArrayString.substring( + 0, + mfuIdsArrayString.length() - 1 + ); + } + mfuIdsArrayString += ')'; + + query = 'Select Id, PredictedWinnerBrackets_Team__c, Points__c, Brackets_Match__r.WinnerBrackets_Team__c,Brackets_Match__r.Brackets_Round__r.ScorePoints__c'; + query += ' From Brackets_UserMatchPred__c '; + query += + ' where Brackets_Match__r.Id in ' + + mfuIdsArrayString + + ' and Brackets_Match__r.WinnerBrackets_Team__c != null'; + predictions = Database.query(query); + predictions = updatePointsMatched(predictions); + + // Save results + massUpdate(predictions, query); + } + + public static List updatePointsMatched( + List predictions + ) { + List predictionsToUpdate = new List(); + for (Brackets_UserMatchPred__c prediction : predictions) { + if ( + prediction.PredictedWinnerBrackets_Team__c == + prediction.Brackets_Match__r.WinnerBrackets_Team__c + ) { + prediction.Points__c = prediction.Brackets_Match__r.Brackets_Round__r.ScorePoints__c; + predictionsToUpdate.add(prediction); + } + } + return predictionsToUpdate; + } + + /** + * Check if in the context the dml rows limit are exceeded execute the dml operation in a batch context. + */ + private static void massUpdate( + List predictions, + String query + ) { + if (predictions.size() > 0) { + if (predictions.size() >= Limits.getLimitDmlRows() / 2) { + Database.executeBatch( + new BracketsBatchUserMatchPrediction(query), + Limits.getLimitDmlRows() / 2 + ); + } else { + update predictions; + } + } + } +} diff --git a/src/classes/BracketsMatchesPredictionUtil.cls-meta.xml b/force-app/main/default/classes/BracketsMatchesPredictionUtil.cls-meta.xml similarity index 57% rename from src/classes/BracketsMatchesPredictionUtil.cls-meta.xml rename to force-app/main/default/classes/BracketsMatchesPredictionUtil.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsMatchesPredictionUtil.cls-meta.xml +++ b/force-app/main/default/classes/BracketsMatchesPredictionUtil.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsMatchesPredictionUtilTest.cls b/force-app/main/default/classes/BracketsMatchesPredictionUtilTest.cls new file mode 100644 index 0000000..ae7d88f --- /dev/null +++ b/force-app/main/default/classes/BracketsMatchesPredictionUtilTest.cls @@ -0,0 +1,38 @@ +@isTest +class BracketsMatchesPredictionUtilTest { + //Test checkExistingPredictions() + @isTest + static void testCheckExistingPredictions() { + //generate Enviroment + Brackets_Tournament__c myTour = BracketsTestUtilities.getNewStandardTournament(); + Brackets_Group__c myGroup = BracketsTestUtilities.getGroup(myTour.Id); + Brackets_UserTournament__c uTour = BracketsTestUtilities.createUserTournament( + UserInfo.getUserId(), + myTour.Id, + myGroup.Id + ); + BracketsTestUtilities.createUserMatchPrediction( + myTour.Id, + myGroup.Id, + uTour.Id + ); + List uMatchPred = [ + SELECT + u.Id, + u.Brackets_UserTournament__c, + u.PredictedWinnerBrackets_Team__c, + u.Brackets_Match__r.HomeBrackets_Team__c, + u.Brackets_Match__c + FROM Brackets_UserMatchPred__c u + WHERE u.Brackets_UserTournament__c = :uTour.Id + ]; + + BracketsMatchesPredictionUtil.checkExistingPredictions( + uMatchPred, + Userinfo.getUserId() + ); + System.assert(myTour != null); + + BracketsMatchesPredictionUtil.save(uMatchPred); + } +} diff --git a/force-app/main/default/classes/BracketsMatchesPredictionUtilTest.cls-meta.xml b/force-app/main/default/classes/BracketsMatchesPredictionUtilTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsMatchesPredictionUtilTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsPoolController.cls b/force-app/main/default/classes/BracketsPoolController.cls new file mode 100644 index 0000000..9cef734 --- /dev/null +++ b/force-app/main/default/classes/BracketsPoolController.cls @@ -0,0 +1,113 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +public with sharing class BracketsPoolController { + public List groups { get; set; } + public static Boolean showInvite { get; set; } + + public BracketsPoolController() { + this.groups = new List(); + for ( + Brackets_Group__c groupy : BracketsGroupUtilities.getGroups( + Userinfo.getUserId() + ) + ) { + this.groups.add(new GroupWrap(groupy)); + } + } + + public class GroupWrap { + public Boolean hasUserTournaments { get; set; } + public Brackets_Group__c groupp { get; set; } + public URLLink link { get; set; } + + public GroupWrap(Brackets_Group__c groupp) { + this.groupp = groupp; + this.link = null; + hasUserTournaments = BracketsGroupUtilities.hasUserTournament( + this.groupp + ); + + if (this.groupp.Status__c != 'Closed') { + if (hasUserTournaments) { + this.link = new URLLink( + 'Manage', + 'BracketsMatchesPrediction?show=' + groupp.Id + ); + } else { + //refactoring + this.link = new URLLink('Click Here to Join', ''); + } + } + } + + public String getStatus() { + String resultStatus; + if (hasUserTournaments) { + resultStatus = 'Joined'; + } else { + resultStatus = this.groupp.Status__c; + } + return resultStatus; + } + } + + public Boolean getCanCreate() { + return BracketsPoolController.checkObjectCrud('Brackets_Group__c'); + } + + /** + * Check over object if the loged User has rights + * @parms sObject + * @return Boolean + */ + public static Boolean checkObjectCrud(String objName) { + Schema.DescribeSObjectResult oResult = Schema.getGlobalDescribe() + .get(objName) + .getDescribe(); + return oResult.isCreateable(); + } + + public PageReference createNewPool() { + return new PageReference( + '/' + + Schema.Brackets_Group__c.SObjectType.getDescribe().getKeyPrefix() + + '/e' + ); + } + + public class URLLink { + public String name { get; set; } + public String value { get; set; } + public URLLink(String name, String value) { + this.name = name; + this.value = value; + } + } +} diff --git a/src/classes/BracketsPoolController.cls-meta.xml b/force-app/main/default/classes/BracketsPoolController.cls-meta.xml similarity index 57% rename from src/classes/BracketsPoolController.cls-meta.xml rename to force-app/main/default/classes/BracketsPoolController.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsPoolController.cls-meta.xml +++ b/force-app/main/default/classes/BracketsPoolController.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsPoolControllerTest.cls b/force-app/main/default/classes/BracketsPoolControllerTest.cls new file mode 100644 index 0000000..703d897 --- /dev/null +++ b/force-app/main/default/classes/BracketsPoolControllerTest.cls @@ -0,0 +1,41 @@ +@isTest +class BracketsPoolControllerTest { + @isTest + static void testTournamentTypes() { + delete [SELECT Id FROM Brackets_Group__c]; + Brackets_Tournament__c myTour = BracketsTestUtilities.getNewStandardTournament(); + Brackets_Group__c myOpenedGroup = BracketsTestUtilities.getGroup( + myTour.Id + ); + upsert myOpenedGroup; + Brackets_Group__c myClosedGroup = BracketsTestUtilities.getClosedGroup( + myTour.Id + ); + Brackets_UserTournament__c uTour = BracketsTestUtilities.createUserTournament( + UserInfo.getUserId(), + myTour.Id, + myOpenedGroup.Id + ); + BracketsTestUtilities.createUserMatchPrediction( + myTour.Id, + myOpenedGroup.Id, + uTour.Id + ); + BracketsPoolController controller = new BracketsPoolController(); + Boolean testBool = controller.getCanCreate(); + PageReference testPage = controller.createNewPool(); + testBool = BracketsPoolController.checkObjectCrud('Brackets_Group__c'); + + BracketsPoolController.GroupWrap innerClass = new BracketsPoolController.GroupWrap( + myOpenedGroup + ); + String testStr = innerClass.getStatus(); + innerClass.hasUserTournaments = true; + testStr = innerClass.getStatus(); + + System.assert( + controller.groups.size() == 2, + 'The number of groups should be two.' + ); + } +} diff --git a/force-app/main/default/classes/BracketsPoolControllerTest.cls-meta.xml b/force-app/main/default/classes/BracketsPoolControllerTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsPoolControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsPredictionsController.cls b/force-app/main/default/classes/BracketsPredictionsController.cls new file mode 100644 index 0000000..0243e09 --- /dev/null +++ b/force-app/main/default/classes/BracketsPredictionsController.cls @@ -0,0 +1,286 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +public with sharing class BracketsPredictionsController { + public Boolean showTree { get; set; } + public String singleRound { get; set; } + public String targetPool { get; set; } + public Brackets_UserTournament__c target { get; set; } + + public String json { get; set; } + public String message { get; set; } + public String messageType { get; set; } + + public Boolean hideDialog { get; set; } + + //pool type -- + public Boolean isFullTournament { get; set; } + + //might be locked for any number of reasons + public Boolean isLocked { get; set; } + + //useful for both full tournament and round by round pools + public Datetime nextDeadline { get; set; } + public String formattedNextDeadline { get; set; } + + //for round by round pools, it indicates the active round + public Integer activeRound { get; set; } + + //for viewing another person's predictions + public Id targetUserTournament { get; set; } + public String userTournamentUser { get; set; } + + /** + * Constructor + */ + public BracketsPredictionsController() { + targetPool = Apexpages.currentPage().getParameters().get('show'); + if (targetPool == null) { + targetUserTournament = Apexpages.currentPage() + .getParameters() + .get('view'); + } + showTree = false; + List userTournaments = this.userJoinedPools(); + this.singleRound = null; + if (userTournaments.size() == 1) { + target = userTournaments.get(0); + targetPool = target.Brackets_Group__c; + this.singleRound = target.Brackets_Group__c; + initNextDeadline(); + if (targetUserTournament == null) { + BracketsSettings2__c settings = BracketsSettings2__c.getInstance( + UserInfo.getUserId() + ); + if (settings != null) { + hideDialog = settings.Hide_Help_Dialog__c; + } + showTree = true; + } else { + if (this.isLocked) { + showTree = true; + } else { + this.message = 'Cannot view a prediction tree before the deadline.'; + showTree = false; + } + this.userTournamentUser = target.User__r.Name; + hideDialog = true; + } + } + } + + public PageReference goToPoolList() { + return Page.BracketsPools; + } + + public PageReference gotoPoolDetail() { + return new ApexPages.Pagereference('/' + targetPool); + } + + /** + * Get the User joined Pools + * @return UserTournament List + */ + public List userJoinedPools() { + List userTournaments = null; + + if (targetPool == null && targetUserTournament == null) { + userTournaments = [ + SELECT + Id, + Brackets_Group__c, + Brackets_Group__r.TournamentType__c, + Brackets_Group__r.Name, + Brackets_Group__r.Type__c, + Brackets_Tournament__r.Name, + Brackets_Tournament__r.Deadline__c, + Championship_Point_Prediction__c + FROM Brackets_UserTournament__c + WHERE User__c = :Userinfo.getUserId() + ]; + } else if (targetUserTournament != null && targetPool == null) { + userTournaments = [ + SELECT + Id, + Brackets_Group__c, + Brackets_Group__r.TournamentType__c, + Brackets_Group__r.Name, + Brackets_Group__r.Type__c, + Brackets_Tournament__r.Name, + Brackets_Tournament__r.Deadline__c, + User__r.Name, + Championship_Point_Prediction__c + FROM Brackets_UserTournament__c + WHERE Id = :targetUserTournament + ]; + } else { + userTournaments = [ + SELECT + Id, + Brackets_Group__c, + Brackets_Group__r.TournamentType__c, + Brackets_Group__r.Name, + Brackets_Group__r.Type__c, + Brackets_Tournament__r.Name, + Brackets_Tournament__r.Deadline__c, + Championship_Point_Prediction__c + FROM Brackets_UserTournament__c + WHERE + Brackets_Group__c = :targetPool + AND User__c = :Userinfo.getUserId() + ]; + } + + return userTournaments; + } + + /** + * Parse string and save predictions + */ + + public PageReference saveAllPred() { + PageReference page = null; + + if (!isLocked) { + try { + if (this.json.length() > 0) { + BracketsMatchesPredictionUtil.saveFromJSON( + this.json, + Userinfo.getUserId() + ); + } + System.debug('12345' + target); + update target; + //init(); + this.message = 'All your predictions has been saved successfully!!'; + this.messageType = 'success'; + page = new PageReference( + '/apex/BracketsMatchesPrediction?show=' + this.targetPool + ); + page.setRedirect(true); + } catch (Exception e) { + System.debug('exception1:' + e); + this.message = e.getMessage(); + this.messageType = 'error'; + } + } else { + this.messageType = 'locked'; + this.message = 'Predictions are currently locked.'; + } + + updateHideDialog(); + + return null; + //return page; + } + + public void initNextDeadline() { + isLocked = false; + + if ( + target.Brackets_Group__r.Type__c == + BracketsGroupUtilities.BET_TYPE_FULL_TOURNAMENT + ) { + isFullTournament = true; + nextDeadline = target.Brackets_Tournament__r.Deadline__c; + if (nextDeadline < Datetime.now()) { + isLocked = true; + } + } else { + //figure out the next deadline based on + isFullTournament = false; + List rounds = [ + SELECT Id, Name, Deadline__c, RoundNumber__c + FROM Brackets_Round__c + WHERE + Brackets_Tournament__c = :target.Brackets_Tournament__c + AND Deadline__c > :Datetime.now() + LIMIT 1 + ]; + if (rounds.size() == 0) { + isLocked = true; + } else { + Brackets_Round__c r = rounds.get(0); + nextDeadline = r.Deadline__c; + activeRound = Integer.valueOf('' + r.RoundNumber__c); + } + } + + //we should have a deadline and if we don't that's problematic + if (!isLocked && nextDeadline == null) { + throw new BracketsException( + 'Unable to initialize the next deadline. For Full Tournament pools, this is on the Tournament Object. For Round By Round pools, this is on the individual Round.' + ); + } + + if (isLocked) { + formattedNextDeadline = 'Locked'; + } else { + //get the current users' timezone setting + User current = [ + SELECT Id, TimeZoneSidKey + FROM User + WHERE Id = :UserInfo.getUserId() + ]; + //now make sure the deadline is in the current users' Z + formattedNextDeadline = nextDeadline.format( + 'EEE, d MMM yyyy HH:mm a', + current.TimeZoneSidKey + ); + } + } + + public void updateHideDialog() { + System.debug('Update Hide Dialog' + this.hideDialog); + + if (this.hideDialog == null) { + this.hideDialog = false; + } + + BracketsSettings2__c settings = BracketsSettings2__c.getInstance( + UserInfo.getUserId() + ); + if (settings == null) { + settings = new BracketsSettings2__c(); + settings.Name = UserInfo.getUserId(); + } + settings.Hide_Help_Dialog__c = this.hideDialog; + upsert settings; + } + + public String getLastChatterUpdate() { + String ret = new BracketsFeedItemUtility() + .getLastTournamentGroupChatter(target.Brackets_Group__c, 75); + + if (ret == '') { + ret = 'No updates yet - be the first!'; + } + return ret; + } +} diff --git a/src/classes/BracketsPredictionsController.cls-meta.xml b/force-app/main/default/classes/BracketsPredictionsController.cls-meta.xml similarity index 57% rename from src/classes/BracketsPredictionsController.cls-meta.xml rename to force-app/main/default/classes/BracketsPredictionsController.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsPredictionsController.cls-meta.xml +++ b/force-app/main/default/classes/BracketsPredictionsController.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsPredictionsControllerTest.cls b/force-app/main/default/classes/BracketsPredictionsControllerTest.cls new file mode 100644 index 0000000..840f759 --- /dev/null +++ b/force-app/main/default/classes/BracketsPredictionsControllerTest.cls @@ -0,0 +1,483 @@ +@isTest +class BracketsPredictionsControllerTest { + @isTest + static void testPredictionController() { + BracketsTournamentUtilities.CreatingTournamentTree = true; + + //Create a user + User testUser = BracketsTestUtilities.createUser(); + + System.runAs(testUser) { + //test that we get a !showTree when there are no user predictions + BracketsPredictionsController controller = new BracketsPredictionsController(); + System.assert(!controller.showTree); + + Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament( + 'Test1 General Prediction Controller', + 4 + ); + + Brackets_Group__c groupp = BracketsTestUtilities.getGroup( + tournament.Id + ); + Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); + Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team'); + + List auxList = new List(); + auxList.add(teamA); + auxList.add(teamB); + upsert auxList; + + Brackets_Round__c round = BracketsTestUtilities.createRound( + tournament, + 1, + null, + 4, + 'Round1-Test' + ); + + Brackets_Match__c match = BracketsTestUtilities.createMatch( + teamA, + teamB, + round, + BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN + ); + round.Deadline__c = match.schedule__c.addMinutes(-5); + update round; + + Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament( + Userinfo.getUserId(), + tournament.Id, + groupp.Id + ); + + //single user tournament so it should automatically show tree + controller = new BracketsPredictionsController(); + System.assert(controller.showTree); + + //multi user tournament so it should problem for which tournament to show + Brackets_Group__c groupp2 = BracketsTestUtilities.getGroup( + tournament.Id + ); + Brackets_UserTournament__c userTournament2 = BracketsTestUtilities.createUserTournament( + Userinfo.getUserId(), + tournament.Id, + groupp2.Id + ); + controller = new BracketsPredictionsController(); + System.assert(!controller.showTree); + + //multi user tournament with show parameter + ApexPages.currentPage().getParameters().put('show', groupp.Id); + controller = new BracketsPredictionsController(); + System.assert(controller.showTree); + + //multi user tournament with a deadline that is before now and should be locked + tournament.Deadline__c = Datetime.now().addMinutes(-1); + update tournament; + ApexPages.currentPage().getParameters().put('show', groupp.Id); + controller = new BracketsPredictionsController(); + System.assert(controller.showTree); + System.assert(controller.isLocked); + + //a couple of Booleans + System.assert(controller.activeRound == null); + System.assert(controller.isFullTournament); + } + + } + + @isTest + static void testSaveAllPred() { + BracketsTournamentUtilities.CreatingTournamentTree = true; + + Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament( + 'Test1 RoundByRound', + 4 + ); + + Brackets_Group__c groupp = BracketsTestUtilities.getGroup( + tournament.Id + ); + Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); + Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team'); + + List auxList = new List(); + auxList.add(teamA); + auxList.add(teamB); + upsert auxList; + + Brackets_Round__c round = BracketsTestUtilities.createRound( + tournament, + 1, + null, + 4, + 'Round1-Test' + ); + + Brackets_Match__c match = BracketsTestUtilities.createMatch( + teamA, + teamB, + round, + BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN + ); + round.Deadline__c = match.schedule__c.addMinutes(-5); + update round; + + Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament( + Userinfo.getUserId(), + tournament.Id, + groupp.Id + ); + + String jsonString = + '{ "0" : { "matchId" : "' + + match.Id + + '" ,"userTour" : "' + + userTournament.Id + + '", "teamId" : "' + + teamA.Id + + '" , "userPred" : "" }}'; + + ApexPages.currentPage().getParameters().put('show', groupp.Id); + + BracketsPredictionsController controller = new BracketsPredictionsController(); + + controller.json = jsonString; + controller.saveAllPred(); + + System.assert( + controller.messageType == 'success', + 'The result of save the prediction should be sucessful. message is : ' + + controller.messageType + ); + } + + //makes sure all the first round stuff works + @isTest + static void testRoundByRoundOne() { + BracketsTournamentUtilities.CreatingTournamentTree = true; + //Create a user + User testUser = BracketsTestUtilities.createUser(); + + System.runAs(testUser) { + Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament( + 'Test1 RoundByRound', + 4 + ); + + Brackets_Group__c groupp = BracketsTestUtilities.getGroup( + tournament.Id, + BracketsGroupUtilities.BET_TYPE_BY_ROUND + ); + + Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); + Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team'); + Brackets_Team__c teamC = BracketsTestUtilities.createTeam('C-Team'); + Brackets_Team__c teamD = BracketsTestUtilities.createTeam('D-Team'); + + List auxList = new List(); + auxList.add(teamA); + auxList.add(teamB); + auxList.add(teamC); + auxList.add(teamD); + upsert auxList; + + Brackets_Round__c round = BracketsTestUtilities.createRound( + tournament, + 1, + null, + 4, + 'Round1-Test' + ); + + Brackets_Round__c round2 = BracketsTestUtilities.createRound( + tournament, + 2, + null, + 8, + 'Round2-Test' + ); + + Brackets_Match__c match = BracketsTestUtilities.createMatch( + teamA, + teamB, + round, + BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN + ); + + Brackets_Match__c match2 = BracketsTestUtilities.createMatch( + teamC, + teamD, + round, + BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN + ); + + round.Deadline__c = match.schedule__c.addMinutes(-5); + update round; + + Brackets_Match__c match3 = BracketsTestUtilities.createMatch( + null, + null, + round2, + BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN + ); + round2.Deadline__c = match3.schedule__c.addMinutes(-5); + update round2; + + Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament( + Userinfo.getUserId(), + tournament.Id, + groupp.Id + ); + + ApexPages.currentPage().getParameters().put('show', groupp.Id); + BracketsPredictionsController controller = new BracketsPredictionsController(); + System.assert(controller.showTree); + System.assert(!controller.isLocked); + + System.debug( + '\n\nNextDeadline: ' + + controller.nextDeadline + + ' but the round deadline is ' + + round.Deadline__c + ); + System.assert( + round.Deadline__c.format() == controller.nextDeadline.format() + ); + + System.assert(!controller.isFullTournament); + System.assert( + controller.activeRound == + Integer.valueOf('' + round.RoundNumber__c) + ); + } + } + + //makes sure all the second round stuff workds + @isTest + static void testRoundByRoundTwo() { + BracketsTournamentUtilities.CreatingTournamentTree = true; + //Create a user + User testUser = BracketsTestUtilities.createUser(); + + System.runAs(testUser) { + Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament( + 'Test1 RoundByRound', + 4 + ); + tournament.deadline__c = tournament.deadline__c.addMinutes(-60); + update tournament; + + Brackets_Group__c groupp = BracketsTestUtilities.getGroup( + tournament.Id, + BracketsGroupUtilities.BET_TYPE_BY_ROUND + ); + + Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); + Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team'); + Brackets_Team__c teamC = BracketsTestUtilities.createTeam('C-Team'); + Brackets_Team__c teamD = BracketsTestUtilities.createTeam('D-Team'); + + List auxList = new List(); + auxList.add(teamA); + auxList.add(teamB); + auxList.add(teamC); + auxList.add(teamD); + upsert auxList; + + Brackets_Round__c round = BracketsTestUtilities.createRound( + tournament, + 1, + null, + 4, + 'Round1-Test' + ); + + Brackets_Round__c round2 = BracketsTestUtilities.createRound( + tournament, + 2, + null, + 8, + 'Round2-Test' + ); + + Brackets_Match__c match = BracketsTestUtilities.createMatch( + teamA, + teamB, + round, + BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN + ); + match.Schedule__c = Datetime.now().addMinutes(-30); + update match; + + Brackets_Match__c match2 = BracketsTestUtilities.createMatch( + teamC, + teamD, + round, + BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN + ); + match2.Schedule__c = Datetime.now().addMinutes(-30); + update match2; + + round.Deadline__c = match.schedule__c.addMinutes(-5); + update round; + + Brackets_Match__c match3 = BracketsTestUtilities.createMatch( + null, + null, + round2, + BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN + ); + round2.Deadline__c = match3.schedule__c.addMinutes(-5); + update round2; + + Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament( + Userinfo.getUserId(), + tournament.Id, + groupp.Id + ); + + ApexPages.currentPage().getParameters().put('show', groupp.Id); + BracketsPredictionsController controller = new BracketsPredictionsController(); + System.assert(controller.showTree); + System.assert(!controller.isLocked); + + System.debug( + '\n\nNextDeadline: ' + + controller.nextDeadline + + ' but the round deadline is ' + + round.Deadline__c + ); + System.assert( + round2.Deadline__c.format() == controller.nextDeadline.format() + ); + + System.assert(!controller.isFullTournament); + System.assert( + controller.activeRound == + Integer.valueOf('' + round2.RoundNumber__c) + ); + } + + } + + //makes sure everything shows as locked. + @isTest + static void testRoundByRoundThree() { + BracketsTournamentUtilities.CreatingTournamentTree = true; + //Create a user + User testUser = BracketsTestUtilities.createUser(); + + System.runAs(testUser) { + Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament( + 'Test1 RoundByRound', + 4 + ); + tournament.deadline__c = tournament.deadline__c.addMinutes(-60); + update tournament; + + Brackets_Group__c groupp = BracketsTestUtilities.getGroup( + tournament.Id, + BracketsGroupUtilities.BET_TYPE_BY_ROUND + ); + + Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); + Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team'); + Brackets_Team__c teamC = BracketsTestUtilities.createTeam('C-Team'); + Brackets_Team__c teamD = BracketsTestUtilities.createTeam('D-Team'); + + List auxList = new List(); + auxList.add(teamA); + auxList.add(teamB); + auxList.add(teamC); + auxList.add(teamD); + upsert auxList; + + Brackets_Round__c round = BracketsTestUtilities.createRound( + tournament, + 1, + null, + 4, + 'Round1-Test' + ); + + Brackets_Round__c round2 = BracketsTestUtilities.createRound( + tournament, + 2, + null, + 8, + 'Round2-Test' + ); + + Brackets_Match__c match = BracketsTestUtilities.createMatch( + teamA, + teamB, + round, + BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN + ); + match.Schedule__c = Datetime.now().addMinutes(-45); + update match; + + Brackets_Match__c match2 = BracketsTestUtilities.createMatch( + teamC, + teamD, + round, + BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN + ); + match2.Schedule__c = Datetime.now().addMinutes(-45); + update match2; + + round.Deadline__c = match.schedule__c.addMinutes(-5); + update round; + + Brackets_Match__c match3 = BracketsTestUtilities.createMatch( + null, + null, + round2, + BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN + ); + match3.Schedule__c = Datetime.now().addMinutes(-30); + update match3; + + round2.Deadline__c = match3.schedule__c.addMinutes(-5); + update round2; + + Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament( + Userinfo.getUserId(), + tournament.Id, + groupp.Id + ); + + ApexPages.currentPage().getParameters().put('show', groupp.Id); + BracketsPredictionsController controller = new BracketsPredictionsController(); + System.assert(controller.showTree); + + System.debug( + '\n\nNextDeadline: ' + + controller.nextDeadline + + ' but the round deadline is ' + + round.Deadline__c + ); + System.assert(controller.nextDeadline == null); + System.assert(controller.isLocked); + + System.assert(!controller.isFullTournament); + System.assert(controller.activeRound == null); + } + + } + + @isTest + static void testSimplePageRefs() { + BracketsPredictionsController c = new BracketsPredictionsController(); + + Pagereference p1 = c.gotoPoolDetail(); + + System.assert(p1 != null); + + Pagereference p2 = c.goToPoolList(); + + System.assert(p2 != null); + } +} diff --git a/force-app/main/default/classes/BracketsPredictionsControllerTest.cls-meta.xml b/force-app/main/default/classes/BracketsPredictionsControllerTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsPredictionsControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsProccessUpdate.cls b/force-app/main/default/classes/BracketsProccessUpdate.cls new file mode 100644 index 0000000..f2e3772 --- /dev/null +++ b/force-app/main/default/classes/BracketsProccessUpdate.cls @@ -0,0 +1,130 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +public with sharing class BracketsProccessUpdate { + @TestVisible + private Brackets_Tournament__c tourament; + private String xmlTournamentReceived; + + /** + * Constructor Manual Update + * + * @param tournamentId + */ + public BracketsProccessUpdate(Id tournamentId) { + this.processManualUpdate(tournamentId); + } + + /** + * Constructor Manual Import + * + * @param Source + */ + public BracketsProccessUpdate(String source) { + this.tourament = new Brackets_Tournament__c(); + this.tourament.Update_Source__c = source; + this.getTournamentUpdate(); + BracketsImportTournament itProcess = new BracketsImportTournament( + source + ); + itProcess.processImportedDocument(xmlTournamentReceived); + } + + /** + * Process multiple update of tournaments + * + * @param tournamentsList a list of tournament + */ + public static void proccessMultipleUpdate( + List tournamentsList + ) { + for (Brackets_Tournament__c tournament : tournamentsList) { + processSingleUpdate((String) tournament.Update_Source__c); + } + } + + /** + * Process a single update + * + * @param source the url to import the recent data from a tournament + */ + @future(callout=true) + public static void processSingleUpdate(String source) { + try { + new BracketsProccessUpdate(source); + } catch (Exception e) { + } + } + + /** + * Get the XML from the URL saved on Tournament Object + */ + private void getTournamentUpdate() { + try { + String uSource = this.tourament.Update_Source__c; + HttpRequest req = new HttpRequest(); + req.setEndpoint(uSource); + req.setMethod('GET'); + Http http = new Http(); + HTTPResponse res = http.send(req); + xmlTournamentReceived = res.getBody(); + } catch (Calloutexception ex) { + throw new BracketsException(ex.getMessage(), ex); + } + } + + /** + * Proccess the Manual Update + * + * @param tournamentId + */ + private void processManualUpdate(Id tournamentId) { + //Get the Tournament by Tournament Id + this.tourament = [ + SELECT + t.Update_Source__c, + t.TeamCount__c, + t.Start__c, + t.Name, + t.MaxRoundNumber__c, + t.Id, + t.ExternalId__c, + t.End__c, + t.Description__c + FROM Brackets_Tournament__c t + WHERE t.Id = :tournamentId + ]; + this.getTournamentUpdate(); + //this.synchronizeUserStatisticSend(); + BracketsImportTournament itProcess = new BracketsImportTournament( + (String) tourament.Update_Source__c + ); + itProcess.processImportedDocument(xmlTournamentReceived); + } +} diff --git a/src/classes/BracketsProccessUpdate.cls-meta.xml b/force-app/main/default/classes/BracketsProccessUpdate.cls-meta.xml similarity index 57% rename from src/classes/BracketsProccessUpdate.cls-meta.xml rename to force-app/main/default/classes/BracketsProccessUpdate.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsProccessUpdate.cls-meta.xml +++ b/force-app/main/default/classes/BracketsProccessUpdate.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsProcessUpdateTest.cls b/force-app/main/default/classes/BracketsProcessUpdateTest.cls new file mode 100644 index 0000000..925930e --- /dev/null +++ b/force-app/main/default/classes/BracketsProcessUpdateTest.cls @@ -0,0 +1,60 @@ +@isTest +class BracketsProcessUpdateTest { + @isTest + static void test2() { + Brackets_Tournament__c myTour = BracketsTestUtilities.createFullTournament( + 2, + BracketsTournamentUtilities.DEFAULT_TOURNAMENT_TYPE + ); + myTour.isChild__c = true; + myTour.Update_Source__c = 'http://www.salesforce.com'; + update myTour; + List myTourList = new List{ + myTour + }; + + Test.startTest(); + BracketsProccessUpdate cTest = new BracketsProccessUpdate(myTour.Id); + + System.assert(cTest.tourament != null); + Test.stopTest(); + } + + @isTest + static void test3() { + Brackets_Tournament__c myTour = BracketsTestUtilities.createFullTournament( + 2, + BracketsTournamentUtilities.DEFAULT_TOURNAMENT_TYPE + ); + myTour.isChild__c = true; + myTour.Update_Source__c = 'http://www.salesforce.com'; + update myTour; + List myTourList = new List{ + myTour + }; + + Test.startTest(); + BracketsProccessUpdate.processSingleUpdate(myTour.Update_Source__c); + System.assert(myTour != null); + Test.stopTest(); + } + + @isTest + static void test4() { + Brackets_Tournament__c myTour = BracketsTestUtilities.createFullTournament( + 2, + BracketsTournamentUtilities.DEFAULT_TOURNAMENT_TYPE + ); + myTour.isChild__c = true; + myTour.Update_Source__c = 'http://www.salesforce.com'; + update myTour; + List myTourList = new List{ + myTour + }; + + Test.startTest(); + BracketsProccessUpdate.proccessMultipleUpdate(myTourList); + System.assert(myTour != null); + Test.stopTest(); + } +} diff --git a/force-app/main/default/classes/BracketsProcessUpdateTest.cls-meta.xml b/force-app/main/default/classes/BracketsProcessUpdateTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsProcessUpdateTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsRoundUtilities.cls b/force-app/main/default/classes/BracketsRoundUtilities.cls new file mode 100644 index 0000000..383c474 --- /dev/null +++ b/force-app/main/default/classes/BracketsRoundUtilities.cls @@ -0,0 +1,208 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +public with sharing class BracketsRoundUtilities { + public static final String roundAfterDeadline = 'The current deadline is after previous rounds'; + public static final String roundBeforeDeadline = 'The current deadline is before following rounds'; + public static final String roundNameUnique = 'The round name must be unique in a tournament.'; + + /** + * Set the RoundNumber__c + * @parms insertedRounds : A list of inserted rounds for this tournament + */ + public static void roundNumberOnInsert( + List insertedRounds + ) { + System.debug('\n\n***RoundNumberOnInsert'); + List roundTournamentIds = new List(); + Map tournamentRounds = new Map(); + Double iter; + for (Brackets_Round__c nRound : insertedRounds) { + if (nRound.Brackets_Tournament__c != null) { + roundTournamentIds.add(nRound.Brackets_Tournament__c); + } + } + + Map tournaments = new Map( + [ + SELECT MaxRoundNumber__c + FROM Brackets_Tournament__c + WHERE Id IN :roundTournamentIds + ] + ); + System.debug('\n\n***Tournaments ' + tournaments); + Map auxMap = new Map(); + + for (Brackets_Round__c nRound : insertedRounds) { + if (auxMap.get(nRound.Brackets_Tournament__c) == null) { + auxMap.put(nRound.Brackets_Tournament__c, 1); + } + + iter = (tournaments.get(nRound.Brackets_Tournament__c) + .MaxRoundNumber__c == null) + ? 0 + : tournaments.get(nRound.Brackets_Tournament__c) + .MaxRoundNumber__c; + + nRound.RoundNumber__c = + iter + auxMap.get(nRound.Brackets_Tournament__c); + auxMap.put( + nRound.Brackets_Tournament__c, + auxMap.get(nRound.Brackets_Tournament__c) + 1 + ); + } + } + + /** + * Method used to insert External Ids on Round objects + * @param roundList : A list of Rounds to set the ExtrenalId + */ + //RSC Do we need this? + /* + public static void addExternalId( List roundList ){ + + for( Brackets_Round__c round : roundList ){ + if( round.ExternalId__c == null ){ + round.ExternalId__c = BracketsTournamentUtilities.generateRandomExternalId(); + } + } + } + */ + + /** + * Check the integrity between rounds of the same tournaments + * + * @param roundListToCheck a list of rounds. + */ + public static void checkRoundsIntegrity( + List roundListToCheck + ) { + System.debug('CheckRoundsIntegrityRSC'); + + List roundList = new List(); + List tournamentIds = new List(); + + for (Brackets_Round__c round : roundListToCheck) { + tournamentIds.add(round.Brackets_Tournament__c); + } + + List existingRounds = [ + SELECT Deadline__c, RoundNumber__c, Name, Brackets_Tournament__c + FROM Brackets_Round__c + WHERE Brackets_Tournament__c IN :tournamentIds + ORDER BY RoundNumber__c ASC + ]; + + for (Brackets_Round__c currentExisting : existingRounds) { + for (Brackets_Round__c newRound : roundListToCheck) { + if (newRound.Id != currentExisting.Id) { + // check round name is unique per tournament + Boolean roundNameIsNotUnique = + currentExisting.Brackets_Tournament__c == + newRound.Brackets_Tournament__c && + (newRound.Name == currentExisting.Name); + // check current deadline is before to previous rounds. + Boolean roundAfter = + currentExisting.Brackets_Tournament__c == + newRound.Brackets_Tournament__c && + (newRound.RoundNumber__c < + currentExisting.RoundNumber__c && + newRound.Deadline__c > currentExisting.Deadline__c); + + // check current deadline is after to following rounds. + Boolean roundBefore = + currentExisting.Brackets_Tournament__c == + newRound.Brackets_Tournament__c && + (newRound.RoundNumber__c > + currentExisting.RoundNumber__c && + newRound.Deadline__c < currentExisting.Deadline__c); + + if (roundAfter) { + System.debug('\n\n\nRoundAfter'); + System.debug('currentExisting: ' + currentExisting); + System.debug('newRound: ' + newRound); + newRound.Deadline__c.addError(roundAfterDeadline); + } + + if (roundBefore) { + System.debug('\n\nSurprise here I am roundbefore'); + System.debug( + '\n\n\nDeadlineXX ToCheck ' + newRound.Deadline__c + ); + System.debug( + 'Identifying the roundToCheck ' + newRound.name + ); + + System.debug( + '\n\n\nDeadlineXX Round' + + currentExisting.Deadline__c + ); + System.debug( + 'Identifying the round ' + currentExisting.name + ); + newRound.Deadline__c.addError(roundBeforeDeadline); + } + + if (roundNameIsNotUnique) { + newRound.Name.addError(roundNameUnique); + } + } + } + } + } + + /** + * Given a list of rounds, check if there changes in them to update the tournament. + * + * @param newRoundList a list of match sobjects + */ + public static void publishOff(List newRoundList) { + List tournamentIdList = new List(); + List roundIdList = new List(); + for (Brackets_Round__c round : newRoundList) { + roundIdList.add(round.Id); + } + for (Brackets_Round__c round : [ + SELECT Id, Brackets_Tournament__c + FROM Brackets_Round__c + WHERE + Brackets_Tournament__r.isChild__c = false + AND Id IN :roundIdList + ]) { + tournamentIdList.add(round.Brackets_Tournament__c); + } + + List tournamentList = [ + SELECT Id, Allow_Update__c + FROM Brackets_Tournament__c + WHERE Id IN :tournamentIdList + ]; + BracketsTournamentUtilities.publishTournamentOff(tournamentList); + } +} diff --git a/src/classes/BracketsRoundUtilities.cls-meta.xml b/force-app/main/default/classes/BracketsRoundUtilities.cls-meta.xml similarity index 57% rename from src/classes/BracketsRoundUtilities.cls-meta.xml rename to force-app/main/default/classes/BracketsRoundUtilities.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsRoundUtilities.cls-meta.xml +++ b/force-app/main/default/classes/BracketsRoundUtilities.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsSitesTournamentPublisher.cls b/force-app/main/default/classes/BracketsSitesTournamentPublisher.cls new file mode 100644 index 0000000..d4ca8fa --- /dev/null +++ b/force-app/main/default/classes/BracketsSitesTournamentPublisher.cls @@ -0,0 +1,393 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +public with sharing class BracketsSitesTournamentPublisher { + private Brackets_Tournament__c tournament; + + public BracketsSitesTournamentPublisher() { + this.tournament = this.getTournament(); + } + + /** + * Retrive last update from the refered tournament + * @return oXml : Returns the XML Body; + */ + public String getOutputXml() { + String result; + if (this.tournament.Id == null) { + System.debug('1234 is null'); + result = this.getXmlError(); + } else { + System.debug('1234tournament id is not null'); + result = this.getTournamentXml(); + } + return result; + } + + /** + * Get Brackets_Tournament__c object + * @return tournament + */ + private Brackets_Tournament__c getTournament() { + Brackets_Tournament__c ret = [ + SELECT + t.TeamCount__c, + t.Start__c, + t.Name, + t.Id, + t.ExternalId__c, + t.End__c, + t.Description__c, + t.Version__c, + t.Allow_Update__c, + t.Update_Source__c, + t.Type__c, + Deadline__c + FROM Brackets_Tournament__c t + WHERE Id = :this.getTournamentId() + ]; + + System.debug('1234 allow update ' + ret.Allow_Update__c); + + return ret; + } + + /** + * Return an Error + * @return oXml + */ + private String getXmlError() { + Xmlstreamwriter oXml = new Xmlstreamwriter(); + oXml.writeStartElement( + null, + BracketsImportExportUtilities.ERROR_TAG, + null + ); + oXml.writeCharacters(BracketsImportExportUtilities.MISSING_TOURNAMENT); + oXml.writeEndElement(); + oXml.writeEndDocument(); + return oXml.getXmlString(); + } + + /** + * Check if exist an parameter json in the headers + */ + private Boolean hasUserStatistic() { + return Apexpages.currentPage().getHeaders().get('json') != null; + } + + /** + * Method in charge of compiling XML document + * @return ret : Write a XML Body then return it + */ + private String getTournamentXml() { + Xmlstreamwriter out = new Xmlstreamwriter(); + out.writeStartDocument(null, '1.0'); + System.debug( + '1234 allow update ' + + tournament.Allow_Update__c + + ' and version ' + + tournament.Version__c + ); + if ( + tournament.Allow_Update__c && + tournament.Version__c > this.getClientVersion() + ) { + BracketsExportTeams expTeams = new BracketsExportTeams( + tournament.Id, + out + ); + out.writeStartElement(null, 'export', null); + out = expTeams.BracketsexportTeams(); + + out.writeStartElement(null, 'Tournament', null); + + BracketsImportExportUtilities.writeElement( + out, + 'id', + '' + tournament.Id + ); + //RSC do we need this? + //BracketsImportExportUtilities.writeElement( out, 'externalId', '' + tournament.ExternalId__c ); + BracketsImportExportUtilities.writeElement( + out, + 'name', + '' + tournament.Name + ); + BracketsImportExportUtilities.writeElement( + out, + 'description', + '' + tournament.Description__c + ); + BracketsImportExportUtilities.writeElement( + out, + 'teamCount', + '' + String.valueOf(tournament.TeamCount__c) + ); + BracketsImportExportUtilities.writeElement( + out, + 'version', + '' + tournament.Version__c + ); + BracketsImportExportUtilities.writeElement( + out, + 'type', + '' + tournament.Type__c + ); + BracketsImportExportUtilities.writeElement( + out, + 'source', + '' + tournament.Update_Source__c + ); + BracketsImportExportUtilities.writeElement( + out, + 'deadline', + '' + String.valueOf(tournament.Deadline__c) + ); + + out.writeEndElement(); + + List rounds = [ + SELECT + r.Brackets_Tournament__c, + r.Start__c, + r.ScorePoints__c, + r.RoundNumber__c, + r.Name, + r.Id, + r.ExternalId__c, + r.End__c, + r.Deadline__c, + ( + SELECT + Name, + Brackets_Round__c, + Conference__c, + Description__c, + FollowingBrackets_Match__c, + FollowingIsHome__c, + HomeScore__c, + HomeBrackets_Team__c, + Schedule__c, + VisitorScore__c, + VisitorBrackets_Team__c, + WinnerBrackets_Team__c, + ExternalId__c, + Position__c + FROM Matches__r + ORDER BY Position__c + ) + FROM Brackets_Round__c r + WHERE r.Brackets_Tournament__c = :tournament.Id + ORDER BY RoundNumber__c + ]; + + //---------------------------------------------------- + List roundIds = new List(); + for (Brackets_Round__c round : rounds) { + roundIds.add(round.Id); + } + Map matches = new Map( + [ + SELECT + m.Id, + m.Position__c, + m.VisitorBrackets_Team__c, + m.VisitorBrackets_Team__r.ExternalId__c, + m.HomeBrackets_Team__c, + m.HomeBrackets_Team__r.ExternalId__c, + m.WinnerBrackets_Team__c, + m.WinnerBrackets_Team__r.ExternalId__c, + m.FollowingBrackets_Match__c, + m.FollowingBrackets_Match__r.ExternalId__c, + m.Conference__c + FROM Brackets_Match__c m + WHERE m.Brackets_Round__c IN :roundIds + ORDER BY m.Brackets_Round__r.RoundNumber__c, m.Position__c + ] + ); + //---------------------------------------------------- + + out.writeStartElement(null, 'Rounds', null); + for (Brackets_Round__c round : rounds) { + out.writeStartElement(null, 'Round', null); + + BracketsImportExportUtilities.writeElement( + out, + 'id', + '' + round.Id + ); + //RSC Do we need this? + //BracketsImportExportUtilities.writeElement( out, 'ExternalId', '' + round.ExternalId__c ); + BracketsImportExportUtilities.writeElement( + out, + 'name', + '' + round.Name + ); + BracketsImportExportUtilities.writeElement( + out, + 'deadline', + '' + String.valueOf(round.Deadline__c) + ); + BracketsImportExportUtilities.writeElement( + out, + 'roundNumber', + '' + String.valueOf(round.RoundNumber__c) + ); + BracketsImportExportUtilities.writeElement( + out, + 'scorePoints', + '' + String.valueOf(round.ScorePoints__c) + ); + BracketsImportExportUtilities.writeElement( + out, + 'tournament', + '' + round.Brackets_Tournament__c + ); + + out.writeStartElement(null, 'Matches', null); + + for (Brackets_Match__c match : round.Matches__r) { + out.writeStartElement(null, 'Match', null); + + BracketsImportExportUtilities.writeElement( + out, + 'id', + '' + match.Id + ); + BracketsImportExportUtilities.writeElement( + out, + 'number', + '' + match.Name + ); + BracketsImportExportUtilities.writeElement( + out, + 'description', + '' + match.Description__c + ); + BracketsImportExportUtilities.writeElement( + out, + 'position', + '' + match.Position__c + ); + BracketsImportExportUtilities.writeElement( + out, + 'homeScore', + '' + String.valueOf(match.HomeScore__c) + ); + + BracketsImportExportUtilities.writeElement( + out, + 'homeTeam', + '' + matches.get(match.Id).HomeBrackets_Team__c + ); + BracketsImportExportUtilities.writeElement( + out, + 'vistitorTeam', + '' + matches.get(match.Id).VisitorBrackets_Team__c + ); + BracketsImportExportUtilities.writeElement( + out, + 'winnerTeam', + '' + matches.get(match.Id).WinnerBrackets_Team__c + ); + BracketsImportExportUtilities.writeElement( + out, + 'followingMatch', + '' + matches.get(match.Id).FollowingBrackets_Match__c + ); + BracketsImportExportUtilities.writeElement( + out, + 'round', + '' + String.valueOf(round.id) + ); + + BracketsImportExportUtilities.writeElement( + out, + 'schedule', + '' + String.valueOf(match.Schedule__c) + ); + BracketsImportExportUtilities.writeElement( + out, + 'visitorScore', + '' + String.valueOf(match.VisitorScore__c) + ); + BracketsImportExportUtilities.writeElement( + out, + 'conference', + '' + match.Conference__c + ); + BracketsImportExportUtilities.writeElement( + out, + 'followingIsHome', + '' + String.valueOf(match.FollowingIsHome__c) + ); + + out.writeEndElement(); + } + + out.writeEndElement(); //End Matches + out.writeEndElement(); //End Round + } + + out.writeEndElement(); //End Rounds + out.writeEndElement(); //End Export + } else { + out.writeStartElement( + null, + BracketsImportExportUtilities.ERROR_TAG, + null + ); + out.writeCharacters( + BracketsImportExportUtilities.NOT_UPDATES_FOUND + ); + out.writeEndElement(); + out.writeEndDocument(); + } + return out.getXmlString(); + } + + /** + * Return the related tournament ID + * @return tournamentId + */ + public String getTournamentId() { + String tournamentId = Apexpages.currentPage().getParameters().get('id'); + return tournamentId; + } + + /** + * Return the Client Tournament Version + * @return version + */ + public Integer getClientVersion() { + String ver = Apexpages.currentPage().getParameters().get('tVersion'); + return (ver != null) ? Integer.valueOf(ver) : 0; + } +} diff --git a/src/classes/BracketsSitesTournamentPublisher.cls-meta.xml b/force-app/main/default/classes/BracketsSitesTournamentPublisher.cls-meta.xml similarity index 57% rename from src/classes/BracketsSitesTournamentPublisher.cls-meta.xml rename to force-app/main/default/classes/BracketsSitesTournamentPublisher.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsSitesTournamentPublisher.cls-meta.xml +++ b/force-app/main/default/classes/BracketsSitesTournamentPublisher.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsSitesTournamentPublisherTest.cls b/force-app/main/default/classes/BracketsSitesTournamentPublisherTest.cls new file mode 100644 index 0000000..f7f554d --- /dev/null +++ b/force-app/main/default/classes/BracketsSitesTournamentPublisherTest.cls @@ -0,0 +1,37 @@ +@isTest +class BracketsSitesTournamentPublisherTest { + //------------------------------------------------------------------------- + // Test methods + //------------------------------------------------------------------------- + + @isTest + static void testGetOutputXml() { + BracketsTournamentUtilities.CreatingTournamentTree = true; + + Brackets_Tournament__c tournament = new Brackets_Tournament__c(); + tournament.Name = 'Test'; + tournament.TeamCount__c = 4; + tournament.Type__c = 'Standard'; + tournament.Deadline__c = Datetime.now(); + tournament.Allow_Update__c = true; + tournament.Version__c = 2; + + insert tournament; + + Apexpages.currentPage().getParameters().put('id', tournament.Id); + Apexpages.currentPage().getParameters().put('tVersion', '1'); + BracketsSitesTournamentPublisher ut = new BracketsSitesTournamentPublisher(); + system.assert(ut.getOutputXml() != ''); + + system.debug(LoggingLevel.Info, ut.getOutputXml()); + + BracketsImportTournament importTour = new BracketsImportTournament( + null + ); + + importTour.readingTournamentData(ut.getOutputXml()); + Brackets_Tournament__c t = importTour.tournament; + system.debug(LoggingLevel.Info, t); + System.assert(t.deadline__c != null); + } +} diff --git a/force-app/main/default/classes/BracketsSitesTournamentPublisherTest.cls-meta.xml b/force-app/main/default/classes/BracketsSitesTournamentPublisherTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsSitesTournamentPublisherTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsTeamUtilities.cls b/force-app/main/default/classes/BracketsTeamUtilities.cls new file mode 100644 index 0000000..b2e00d8 --- /dev/null +++ b/force-app/main/default/classes/BracketsTeamUtilities.cls @@ -0,0 +1,54 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +public with sharing class BracketsTeamUtilities { + /** + * Method which validates if teams are able to be deleted + * @param teamList + * @return Boolean + */ + public static Boolean canDeleteTeams(List teamList) { + Set teamIds = new Set(); + + List availableMatches = [ + SELECT Id, VisitorBrackets_Team__c, HomeBrackets_Team__c + FROM Brackets_Match__c + WHERE + HomeBrackets_Team__c IN :teamList + OR VisitorBrackets_Team__c IN :teamList + ]; + if (availableMatches.size() > 0) { + //cannot delete teams + return false; + } else { + //can delete teams + return true; + } + } +} diff --git a/src/classes/BracketsTeamUtilities.cls-meta.xml b/force-app/main/default/classes/BracketsTeamUtilities.cls-meta.xml similarity index 57% rename from src/classes/BracketsTeamUtilities.cls-meta.xml rename to force-app/main/default/classes/BracketsTeamUtilities.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsTeamUtilities.cls-meta.xml +++ b/force-app/main/default/classes/BracketsTeamUtilities.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsTeamUtilitiesTest.cls b/force-app/main/default/classes/BracketsTeamUtilitiesTest.cls new file mode 100644 index 0000000..eaa83e0 --- /dev/null +++ b/force-app/main/default/classes/BracketsTeamUtilitiesTest.cls @@ -0,0 +1,52 @@ +@isTest +class BracketsTeamUtilitiesTest { + @isTest + static void testCanDeleteTeams() { + List teamList = BracketsTestUtilities.createTeamList( + 10 + ); + upsert teamList; + //not connected to a tournament so its fine. + system.assert(BracketsTeamUtilities.canDeleteTeams(teamList)); + + BracketsTournamentUtilities.CreatingTournamentTree = true; + //Create a user + User testUser = BracketsTestUtilities.createUser(); + + System.runAs(testUser) { + Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament( + 'Test1 RoundByRound', + 4 + ); + Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); + + List auxList = new List(); + auxList.add(teamA); + upsert auxList; + + Brackets_Round__c round = BracketsTestUtilities.createRound( + tournament, + 1, + null, + 4, + 'Round1-Test' + ); + Brackets_Match__c match = BracketsTestUtilities.createMatch( + teamA, + null, + round, + BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN + ); + + system.assert(!BracketsTeamUtilities.canDeleteTeams(auxList)); + + //so now test the trigger + try { + delete teamA; + System.assert(false); + } catch (Exception e) { + //correct + } + } + } +} diff --git a/force-app/main/default/classes/BracketsTeamUtilitiesTest.cls-meta.xml b/force-app/main/default/classes/BracketsTeamUtilitiesTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsTeamUtilitiesTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/src/classes/BracketsTestUtilities.cls b/force-app/main/default/classes/BracketsTestUtilities.cls similarity index 58% rename from src/classes/BracketsTestUtilities.cls rename to force-app/main/default/classes/BracketsTestUtilities.cls index 0d774fb..32952ef 100644 --- a/src/classes/BracketsTestUtilities.cls +++ b/force-app/main/default/classes/BracketsTestUtilities.cls @@ -26,281 +26,374 @@ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISE OF THE POSSIBILITY OF SUCH DAMAGE. */ -public with sharing class BracketsTestUtilities{ - +public with sharing class BracketsTestUtilities { //------------------------------------------------------------------------- // Private variables & constants //------------------------------------------------------------------------- private static Datetime lastMatchDate = null; - + //------------------------------------------------------------------------- // Public Methods //------------------------------------------------------------------------- - + public static String xmlTournamentValid = 'Tournament+Templatemat+menForce.com+Labs2010-09-08+13%3A17%3A42a025000000DPa9sAADSunsnullnulla025000000DPa9tAADBullsnullnulla025000000DPa9uAADLakersnullnulla025000000DPa9vAADHawksnullnulla025000000DPhKvAALsandiegonullnulla025000000DPhL0AALhornetsnullnulla025000000DPhL5AALshperesnullnulla025000000DPhLFAA1bakersnullnulla035000000BguqpAABSample+NBanull8m23oSFl3gGa015000000WyG4iAAFround+1null13Activea035000000BguqpAABEA5iHGBGXma005000000H2crPAARMA-00034null0bakersshperesnullnullEA5iHGBGXm2010-09-14+05%3A52%3A000fnBddNQncKa005000000H2creAABMA-00037null0LakersHawksnullnullEA5iHGBGXm2010-09-19+05%3A53%3A000efYAkARQo6a005000000H2crZAARMA-00036null0SunsBullsnullnullEA5iHGBGXm2010-09-16+05%3A53%3A000clIR0dUIQOa005000000H2crUAARMA-00035null0hornetssandiegonullnullEA5iHGBGXm2010-09-15+05%3A52%3A000nmrZOHQ6EZ'; public static String xmlTournamentTeamInValid = 'Tournament+Templatemat+menForce.com+Labs2010-09-08+13%3A17%3A42a025000000DPa9eam>Bullsnullnulla025000000DPa9uAADLakersnullnulla025000000DPa9vAADHawksnullnulla025000000DPhKvAALsandiegonullnulla025000000DPhL0AALhornetsnullnulla025000000DPhL5AALshperesnullnulla025000000DPhLFAA1bakersnullnulla035000000BguqpAABSample+NBanull8m23oSFl3gGa015000000WyG4iAAFround+12010-09-17+05%3A51%3A0013Activea035000000BguqpAABEA5iHGBGXma005000000H2crPAARMA-00034null0bakersshperesnullnullEA5iHGBGXm2010-09-13+05%3A52%3A000fnBddNQncKa005000000H2creAABMA-00037null0LakersHawksnullnullEA5iHGBGXm2010-09-19+05%3A53%3A000efYAkARQo6a005000000H2crZAARMA-00036null0SunsBullsnullnullEA5iHGBGXm2010-09-16+05%3A53%3A000clIR0dUIQOa005000000H2crUAARMA-00035null0hornetssandiegonullnullEA5iHGBGXm2010-09-15+05%3A52%3A000nmrZOHQ6EZ'; public static String xmlTournamentInValidMetaData = 'Tournament+Templatemat+menForce.com+Labs2010-09-08+13%3A17%3A42a025000000DPa9sAADSunsnullnulla025000000DPa9tAADBullsnullnulla025000000DPa9uAADLakersnullnulla025000000DPa9vAADHawksnullnulla025000000DPhKvAALsandiegonullnulla025000000DPhL0AALhornetsnullnulla025000000DPhL5AALshperesnullnulla025000000DPhLFAA1bakersnullnulla035000000BguqpAABSample+NBanull8m23oSFl3gGa015000000WyG4iAAFround+12010-09-17+05%3A51%3A0013Activea035000000BguqpAABEA5iHGBGXma005000000H2crPAARMA-00034null0bakersshperesnullnullEA5iHGBGXm2010-09-13+05%3A52%3A000fnBddNQncKa005000000H2creAABMA-00037null0LakersHawksnullnullEA5iHGBGXm2010-09-19+05%3A53%3A000efYAkARQo6a005000000H2crZAARMA-00036null0SunsBullsnullnullEA5iHGBGXm2010-09-16+05%3A53%3A000clIR0dUIQOa005000000H2crUAARMA-00035null0hornetssandiegonullnullEA5iHGBGXm2010-09-15+05%3A52%3A000nmrZOHQ6EZ'; public static String xmlTournamentRoundInValid = 'Tournament+Templatemat+menForce.com+Labs2010-09-08+13%3A17%3A42a025000000DPa9sAADSunsnullnulla025000000DPa9tAADBullsnullnulla025000000DPa9uAADLakersnullnulla025000000DPa9vAADHawksnullnulla025000000DPhKvAALsandiegonullnulla025000000DPhL0AALhornetsnullnulla025000000DPhL5AALshperesnullnulla025000000DPhLFAA1bakersnullnulla035000000BguqpAABSample+NBanull8m23oSFl3gGa015000000WyG4iAAF13Activea035000000BguqpAABEA5iHGBGXma005000000H2crPAARMA-00034null0bakersshperesnullnullEA5iHGBGXm2010-09-13+05%3A52%3A000fnBddNQncKa005000000H2creAABMA-00037null0LakersHawksnullnullEA5iHGBGXm2010-09-19+05%3A53%3A000efYAkARQo6a005000000H2crZAARMA-00036null0SunsBullsnullnullEA5iHGBGXm2010-09-16+05%3A53%3A000clIR0dUIQOa005000000H2crUAARMA-00035null0hornetssandiegonullnullEA5iHGBGXm2010-09-15+05%3A52%3A000nmrZOHQ6EZ'; public static String xmlTournamenMatchesInValid = 'Tournament+Templatemat+menForce.com+Labs2010-09-08+13%3A17%3A42a025000000DPa9sAADSunsnullnulla025000000DPa9tAADBullsnullnulla025000000DPa9uAADLakersnullnulla025000000DPa9vAADHawksnullnulla025000000DPhKvAALsandiegonullnulla025000000DPhL0AALhornetsnullnulla025000000DPhL5AALshperesnullnulla025000000DPhLFAA1bakersnullnulla035000000BguqpAABSample+NBanull8m23oSFl3gGa015000000WyG4iAAFround+12010-09-17+05%3A51%3A0013Activea035000000BguqpAABEA5iHGBGXmMA-00034nullbakersshperesnullnullEA5iHGBGXm2010-09-13+05%3A52%3A00a005000000H2cmber>MA-00037null0LakersHawksnullnullEA5iHGBGXm2010-09-19+05%3A53%3A000efYAkARQo6a005000000H2crZAARMA-00036null0SunsBullsnullnullEA5iHGBGXm2010-09-16+05%3A53%3A000clIR0dUIQOa005000000H2crUAARMA-00035null0hornetssandiegonullnullEA5iHGBGXm2010-09-15+05%3A52%3A000nmrZOHQ6EZ'; public static String xmlTournamentInValid = 'Tournament+Templatemat+menForce.com+Labs2010-09-08+13%3A17%3A42a025000000DPa9sAADSunsnullnulla025000000DPa9tAADBullsnullnulla025000000DPa9uAADLakersnullnulla025000000DPa9vAADHawksnullnulla025000000DPhKvAALsandiegonullnulla025000000DPhL0AALhornetsnullnulla025000000DPhL5AALshperesnullnulla025000000DPhLFAA1bakersnullnullSample+Ndescription>null8m23oSFl3gGa015000000WyG4iAAFround+12010-09-17+05%3A51%3A0013Activea035000000BguqpAABEA5iHGBGXma005000000H2crPAARMA-00034null0bakersshperesnullnullEA5iHGBGXm2010-09-13+05%3A52%3A000fnBddNQncKa005000000H2creAABMA-00037null0LakersHawksnullnullEA5iHGBGXm2010-09-19+05%3A53%3A000efYAkARQo6a005000000H2crZAARMA-00036null0SunsBullsnullnullEA5iHGBGXm2010-09-16+05%3A53%3A000clIR0dUIQOa005000000H2crUAARMA-00035null0hornetssandiegonullnullEA5iHGBGXm2010-09-15+05%3A52%3A000nmrZOHQ6EZ'; - + public static Brackets_Tournament__c createFullTournament() { - - return BracketsTestUtilities.createFullTournament(12, BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE); - + return BracketsTestUtilities.createFullTournament( + 12, + BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE + ); } - + /** - * Create a tournament with the first round and predictions for users - */ - public static Brackets_Tournament__c createFullTournament(Integer teamCount, String tournamentType ){ + * Create a tournament with the first round and predictions for users + */ + + public static Brackets_Tournament__c createFullTournament( + Integer teamCount, + String tournamentType + ) { List users = new List(); users.add(BracketsTestUtilities.createUser()); - return createFullTournamentUsers(users, teamCount, tournamentType, new Brackets_Group__c()); + return createFullTournamentUsers( + users, + teamCount, + tournamentType, + new Brackets_Group__c() + ); } /** - * Create a tournament with the first round and predictions for users - * @users List of users with predictions - */ - public static Brackets_Tournament__c createFullTournamentUsers( List users, Integer teamCount, String tournamentType, Brackets_Group__c gr){ + * Create a tournament with the first round and predictions for users + * @users List of users with predictions + */ + + public static Brackets_Tournament__c createFullTournamentUsers( + List users, + Integer teamCount, + String tournamentType, + Brackets_Group__c gr + ) { // Create tournament, rounds and matches BracketsTournamentUtilities.CreatingTournamentTree = true; - - Brackets_Tournament__c tournament = null; - - if( BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE.equalsIgnoreCase( tournamentType ) ){ - tournament = BracketsTestUtilities.createTournament('Small Season 2010', 12, BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE); - BracketsTournamentUtilities.createNFLPlayoffTournamentTreeMethod( tournament.Id ); - } - else if( BracketsTournamentUtilities.STANDARD_TOURNAMENT_TYPE.equalsIgnoreCase( tournamentType ) ) { - tournament = BracketsTestUtilities.createTournament('Small Season 2010', teamCount); - BracketsTournamentUtilities.createTournamentTreeMethod( tournament.Id, teamCount, BracketsTournamentUtilities.roundCount(teamCount) ); + + Brackets_Tournament__c tournament = null; + + if ( + BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE.equalsIgnoreCase( + tournamentType + ) + ) { + tournament = BracketsTestUtilities.createTournament( + 'Small Season 2010', + 12, + BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE + ); + BracketsTournamentUtilities.createNFLPlayoffTournamentTreeMethod( + tournament.Id + ); + } else if ( + BracketsTournamentUtilities.STANDARD_TOURNAMENT_TYPE.equalsIgnoreCase( + tournamentType + ) + ) { + tournament = BracketsTestUtilities.createTournament( + 'Small Season 2010', + teamCount + ); + BracketsTournamentUtilities.createTournamentTreeMethod( + tournament.Id, + teamCount, + BracketsTournamentUtilities.roundCount(teamCount) + ); } - + // Associate group gr.Brackets_Tournament__c = tournament.Id; upsert gr; - + //Add Users and UserTournaments - List userTs = new List(); - userTs.add( BracketsTestUtilities.createUserTournament( users[0].Id, tournament.Id, gr.Id) ); + List userTs = new List(); + userTs.add( + BracketsTestUtilities.createUserTournament( + users[0].Id, + tournament.Id, + gr.Id + ) + ); // Create teams - List teams = BracketsTestUtilities.createTeamList(teamCount); + List teams = BracketsTestUtilities.createTeamList( + teamCount + ); upsert teams; - + // Set random teams to the first round - Brackets_Round__c firstRound = [SELECT Id, Name, RoundNumber__c, Deadline__c - FROM Brackets_Round__c - WHERE Brackets_Tournament__c =: tournament.Id - ORDER BY RoundNumber__c ASC - LIMIT 1]; - - List matches = new List(); - matches = [SELECT Id, HomeBrackets_Team__c, VisitorBrackets_Team__c - FROM Brackets_Match__c - WHERE Brackets_Round__r.Brackets_Tournament__c =: tournament.Id - AND Brackets_Round__c =: firstRound.Id]; + Brackets_Round__c firstRound = [ + SELECT Id, Name, RoundNumber__c, Deadline__c + FROM Brackets_Round__c + WHERE Brackets_Tournament__c = :tournament.Id + ORDER BY RoundNumber__c ASC + LIMIT 1 + ]; - for(Brackets_Match__c m : matches){ + List matches = new List(); + matches = [ + SELECT Id, HomeBrackets_Team__c, VisitorBrackets_Team__c + FROM Brackets_Match__c + WHERE + Brackets_Round__r.Brackets_Tournament__c = :tournament.Id + AND Brackets_Round__c = :firstRound.Id + ]; + + for (Brackets_Match__c m : matches) { BracketsTestUtilities.setMatch( - m, + m, BracketsTestUtilities.getRandomTeam(teams), BracketsTestUtilities.getRandomTeam(teams) ); } upsert matches; - + return tournament; } - /** - * Create a new Match - */ - public static Brackets_Match__c createMatch( Brackets_Team__c home, Brackets_Team__c visitor, Brackets_Round__c round, String conference){ + * Create a new Match + */ + public static Brackets_Match__c createMatch( + Brackets_Team__c home, + Brackets_Team__c visitor, + Brackets_Round__c round, + String conference + ) { Brackets_Match__c match = new Brackets_Match__c(); - //RSC Changed to work with round deadline instead. - /* + //RSC Changed to work with round deadline instead. + /* BracketsTestUtilities.lastMatchDate = BracketsTestUtilities.lastMatchDate == null ? DateTime.now().addMonths(2 + BracketsTestUtilities.rand(10)) : BracketsTestUtilities.lastMatchDate + 1; */ - - - + Datetime schedule = Datetime.now(); - - Integer i = Integer.valueOf(''+round.RoundNumber__c); - - schedule = schedule.addMinutes(10*i); - - System.debug('\n\n\nattempting insert round deadline ' + round.Deadline__c + ' match ' + schedule + ' round number ' + round.RoundNumber__c); - - match.HomeBrackets_Team__c = home != null ? home.Id : null; + + Integer i = Integer.valueOf('' + round.RoundNumber__c); + + schedule = schedule.addMinutes(10 * i); + + System.debug( + '\n\n\nattempting insert round deadline ' + + round.Deadline__c + + ' match ' + + schedule + + ' round number ' + + round.RoundNumber__c + ); + + match.HomeBrackets_Team__c = home != null ? home.Id : null; match.VisitorBrackets_Team__c = visitor != null ? visitor.Id : null; - match.Brackets_Round__c = Round.Id; - match.WinnerBrackets_Team__c = null; - match.Schedule__c = schedule; + match.Brackets_Round__c = Round.Id; + match.WinnerBrackets_Team__c = null; + match.Schedule__c = schedule; match.Conference__c = conference; insert match; - + return match; } - /** - * Set an existing Match - */ - private static void setMatch( Brackets_Match__c match, Brackets_Team__c home, Brackets_Team__c visitor){ - BracketsTestUtilities.lastMatchDate = BracketsTestUtilities.lastMatchDate == null - ? DateTime.now().addMonths(2 + BracketsTestUtilities.rand(10)) + * Set an existing Match + */ + private static void setMatch( + Brackets_Match__c match, + Brackets_Team__c home, + Brackets_Team__c visitor + ) { + BracketsTestUtilities.lastMatchDate = BracketsTestUtilities.lastMatchDate == + null + ? DateTime.now().addMonths(2 + BracketsTestUtilities.rand(10)) : BracketsTestUtilities.lastMatchDate + 1; - - match.HomeBrackets_Team__c = home != null ? home.Id : null; + + match.HomeBrackets_Team__c = home != null ? home.Id : null; match.VisitorBrackets_Team__c = visitor != null ? visitor.Id : null; - match.WinnerBrackets_Team__c = null; - match.Schedule__c = BracketsTestUtilities.lastMatchDate; + match.WinnerBrackets_Team__c = null; + match.Schedule__c = BracketsTestUtilities.lastMatchDate; } - - - /** - * Create new NFL Tournament w/o automatic creation - * Set flag on true in order to avoid automatic creation of Rounds and Matches - */ - public static Brackets_Tournament__c getNewNFLTournament(){ - return BracketsTestUtilities.getNewTournament( BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE ); - } - + * Create new NFL Tournament w/o automatic creation + * Set flag on true in order to avoid automatic creation of Rounds and Matches + */ + public static Brackets_Tournament__c getNewNFLTournament() { + return BracketsTestUtilities.getNewTournament( + BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE + ); + } + /** - * Create new Standard Tournament w/o automatic creation - * Set flag on true in order to avoid automatic creation of Rounds and Matches - */ - public static Brackets_Tournament__c getNewStandardTournament(){ - return BracketsTestUtilities.getNewTournament( BracketsTournamentUtilities.DEFAULT_TOURNAMENT_TYPE ); - } - - - - private static Brackets_Tournament__c getNewTournament( String tType ) { + * Create new Standard Tournament w/o automatic creation + * Set flag on true in order to avoid automatic creation of Rounds and Matches + */ + public static Brackets_Tournament__c getNewStandardTournament() { + return BracketsTestUtilities.getNewTournament( + BracketsTournamentUtilities.DEFAULT_TOURNAMENT_TYPE + ); + } + private static Brackets_Tournament__c getNewTournament(String tType) { //Set the flag to avoid autocreation BracketsTournamentUtilities.CreatingTournamentTree = true; - + Brackets_Tournament__c myTour = new Brackets_Tournament__c(); myTour = BracketsTestUtilities.createTournament('Name', 4); - - if( BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE.equalsIgnoreCase( tType ) ){ - BracketsTournamentUtilities.createNFLPlayoffTournamentTreeMethod( myTour.Id ); - } - else if( BracketsTournamentUtilities.DEFAULT_TOURNAMENT_TYPE.equalsIgnoreCase( tType ) ) { - BracketsTournamentUtilities.createTournamentTreeMethod( myTour.Id, 4, 2 ); + + if ( + BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE.equalsIgnoreCase( + tType + ) + ) { + BracketsTournamentUtilities.createNFLPlayoffTournamentTreeMethod( + myTour.Id + ); + } else if ( + BracketsTournamentUtilities.DEFAULT_TOURNAMENT_TYPE.equalsIgnoreCase( + tType + ) + ) { + BracketsTournamentUtilities.createTournamentTreeMethod( + myTour.Id, + 4, + 2 + ); } - - return myTour; + + return myTour; } - - - - + /** - * Create a new Round with default values - * @param tournament Tournament the round will be played - */ - public static Brackets_Round__c createSimpleRound( Brackets_Tournament__c tournament ){ - + * Create a new Round with default values + * @param tournament Tournament the round will be played + */ + public static Brackets_Round__c createSimpleRound( + Brackets_Tournament__c tournament + ) { return BracketsTestUtilities.createRound( tournament, - BracketsTestUtilities.rand(10) + 1, DateTime.now(), + BracketsTestUtilities.rand(10) + 1, + DateTime.now(), 3, BracketsTestUtilities.createRandomWord('Round-') ); } - /** - * Create a new Round - * @param tournament Tournament the round will be played - * @param number Round number - * @param deadline Last date to make predictions in the round - * @param points Score points for the round - * @param name Name of the round - */ - public static Brackets_Round__c createRound( Brackets_Tournament__c tournament, - Integer rnumber, - DateTime deadline, - Integer points, - String name ){ + * Create a new Round + * @param tournament Tournament the round will be played + * @param number Round number + * @param deadline Last date to make predictions in the round + * @param points Score points for the round + * @param name Name of the round + */ + public static Brackets_Round__c createRound( + Brackets_Tournament__c tournament, + Integer rnumber, + DateTime deadline, + Integer points, + String name + ) { Brackets_Round__c round = new Brackets_Round__c(); - + round.RoundNumber__c = rnumber; - round.Brackets_Tournament__c = tournament.Id; - round.Deadline__c = deadline; + round.Brackets_Tournament__c = tournament.Id; + round.Deadline__c = deadline; round.ScorePoints__c = points; - round.Name = name; - + round.Name = name; + insert round; - + return round; } - /** - * Create a UserMatchPrediction for a Tournament - * @param tId ( Affected Brackets_Tournament__c Id ) - * @return ump - */ - public static List createUserMatchPrediction( Id tId, Id gId, Id uId ){ - - if( uId == null ) { - Brackets_UserTournament__c ut = new Brackets_UserTournament__c( User__c = UserInfo.getUserId(), Brackets_Tournament__c = tId, Brackets_Group__c = gId ); + * Create a UserMatchPrediction for a Tournament + * @param tId ( Affected Brackets_Tournament__c Id ) + * @return ump + */ + public static List createUserMatchPrediction( + Id tId, + Id gId, + Id uId + ) { + if (uId == null) { + Brackets_UserTournament__c ut = new Brackets_UserTournament__c( + User__c = UserInfo.getUserId(), + Brackets_Tournament__c = tId, + Brackets_Group__c = gId + ); insert ut; uId = ut.Id; } - + List uMatchPred = new List(); Integer i = 0; - for( Brackets_Round__c round : [select Id, ScorePoints__c, Brackets_Tournament__c,( select Id, HomeBrackets_Team__c, VisitorBrackets_Team__c, WinnerBrackets_Team__c from Matches__r ) from Brackets_Round__c where Brackets_Tournament__c =: tId ] ) { - - if( i < 1 ) { - for( Brackets_Match__c match : round.Matches__r ) { - + for (Brackets_Round__c round : [ + SELECT + Id, + ScorePoints__c, + Brackets_Tournament__c, + ( + SELECT + Id, + HomeBrackets_Team__c, + VisitorBrackets_Team__c, + WinnerBrackets_Team__c + FROM Matches__r + ) + FROM Brackets_Round__c + WHERE Brackets_Tournament__c = :tId + ]) { + if (i < 1) { + for (Brackets_Match__c match : round.Matches__r) { Brackets_UserMatchPred__c ump = new Brackets_UserMatchPred__c(); ump.PredictedWinnerBrackets_Team__c = match.VisitorBrackets_Team__c; - ump.Brackets_UserTournament__c = uId; - ump.Brackets_Match__c = match.Id; - uMatchPred.add( ump ); - + ump.Brackets_UserTournament__c = uId; + ump.Brackets_Match__c = match.Id; + uMatchPred.add(ump); } } i++; } insert uMatchPred; - + return uMatchPred; } - - - public static Brackets_UserMatchPred__c createPrediction(Brackets_UserTournament__c ut, Brackets_Match__c match, Brackets_Team__c winner) { - Brackets_UserMatchPred__c ret = new Brackets_UserMatchPred__c(); - ret.Brackets_UserTournament__c = ut.id; - ret.Brackets_Match__c = match.id; - ret.PredictedWinnerBrackets_Team__c = winner.id; - insert ret; - return ret; + + public static Brackets_UserMatchPred__c createPrediction( + Brackets_UserTournament__c ut, + Brackets_Match__c match, + Brackets_Team__c winner + ) { + Brackets_UserMatchPred__c ret = new Brackets_UserMatchPred__c(); + ret.Brackets_UserTournament__c = ut.id; + ret.Brackets_Match__c = match.id; + ret.PredictedWinnerBrackets_Team__c = winner.id; + insert ret; + return ret; } /** - * Create a UserMatchPrediction list for a Tournament - * - * @param userId an id of a user - * @return a list of prediction - */ + * Create a UserMatchPrediction list for a Tournament + * + * @param userId an id of a user + * @return a list of prediction + */ //2011-03-07 Not in use? /* public static List createUserMatchPredictionList(Id userId){ @@ -326,180 +419,199 @@ public with sharing class BracketsTestUtilities{ return uMatchPred; } */ - + /** - * Create a new UserTournament - * @return userTournament - */ - public static Brackets_UserTournament__c createUserTournament( Id userId, Id tournamentId, Id groupId ){ - + * Create a new UserTournament + * @return userTournament + */ + public static Brackets_UserTournament__c createUserTournament( + Id userId, + Id tournamentId, + Id groupId + ) { Brackets_UserTournament__c userTournament = new Brackets_UserTournament__c(); - userTournament.User__c = userId; - userTournament.Brackets_Tournament__c = tournamentId; - userTournament.Brackets_Group__c = groupId; + userTournament.User__c = userId; + userTournament.Brackets_Tournament__c = tournamentId; + userTournament.Brackets_Group__c = groupId; insert userTournament; - + return userTournament; } /** - * Create a new Tournament - * @return tournament - */ - public static Brackets_Tournament__c createTournament(String name, Integer teamCount){ - - return BracketsTestUtilities.createTournament(name, teamCount, 'Standard'); - + * Create a new Tournament + * @return tournament + */ + public static Brackets_Tournament__c createTournament( + String name, + Integer teamCount + ) { + return BracketsTestUtilities.createTournament( + name, + teamCount, + 'Standard' + ); } - public static Brackets_Tournament__c createTournament(String name, Integer teamCount, String tournamentType){ - + public static Brackets_Tournament__c createTournament( + String name, + Integer teamCount, + String tournamentType + ) { Brackets_Tournament__c tournament = new Brackets_Tournament__c(); - Datetime deadline = Datetime.now(); - deadline = deadline.addMinutes(2); - - tournament.Name = name; - tournament.Description__c = 'Test tournament'; - tournament.Version__c = BracketsTestUtilities.rand(100); - tournament.TeamCount__c = teamCount; - tournament.Type__c = tournamentType; - tournament.Deadline__c = deadline; - + Datetime deadline = Datetime.now(); + deadline = deadline.addMinutes(2); + + tournament.Name = name; + tournament.Description__c = 'Test tournament'; + tournament.Version__c = BracketsTestUtilities.rand(100); + tournament.TeamCount__c = teamCount; + tournament.Type__c = tournamentType; + tournament.Deadline__c = deadline; + insert tournament; - + return tournament; } - + /** - * Returns a random team from the team list - * @return team - */ - public static Brackets_Team__c getRandomTeam( List teams ){ - Integer index = BracketsTestUtilities.rand( teams.size() ); - Brackets_Team__c res = teams[index]; + * Returns a random team from the team list + * @return team + */ + public static Brackets_Team__c getRandomTeam(List teams) { + Integer index = BracketsTestUtilities.rand(teams.size()); + Brackets_Team__c res = teams[index]; teams.remove(index); return res; } - + /** - * Create a list of Teams - * @return teamList - */ - public static List createTeamList( Integer count ){ - - List teamList = new List(); - List nbaTeams = new List{ 'Atlanta Hawks', - 'Boston Celtics', - 'Charlotte Bobcats', - 'Chicago Bulls', - 'Cleveland Cavaliers', - 'Dallas Mavericks', - 'Denver Nuggets', - 'Detroit Pistons', - 'Golden State Warriors', - 'Houston Rockets', - 'Indiana Pacers', - 'Los Angeles Clippers', - 'Los Angeles Lakers', - 'Memphis Grizzlies', - 'Miami Heat', - 'Milwaukee Bucks', - 'Minnesota Timberwolves', - 'New Jersey Nets', - 'New Orleans Hornets', - 'New York Knicks', - 'Oklahoma City Thunder', - 'Orlando Magic', - 'Philadelphia 76ers', - 'Phoenix Suns', - 'Portland Trail Blazers', - 'Sacramento Kings', - 'San Antonio Spurs', - 'Toronto Raptors', - 'Utah Jazz', - 'Washington Wizards ' }; - Integer teamCount = ( count > nbaTeams.size() || count == 0 ) ? nbaTeams.size() : count; - - for( Integer i = 0; i < teamCount; i++ ){ - teamList.add( new Brackets_Team__c( Name = nbaTeams[i] ) ); + * Create a list of Teams + * @return teamList + */ + public static List createTeamList(Integer count) { + List teamList = new List(); + List nbaTeams = new List{ + 'Atlanta Hawks', + 'Boston Celtics', + 'Charlotte Bobcats', + 'Chicago Bulls', + 'Cleveland Cavaliers', + 'Dallas Mavericks', + 'Denver Nuggets', + 'Detroit Pistons', + 'Golden State Warriors', + 'Houston Rockets', + 'Indiana Pacers', + 'Los Angeles Clippers', + 'Los Angeles Lakers', + 'Memphis Grizzlies', + 'Miami Heat', + 'Milwaukee Bucks', + 'Minnesota Timberwolves', + 'New Jersey Nets', + 'New Orleans Hornets', + 'New York Knicks', + 'Oklahoma City Thunder', + 'Orlando Magic', + 'Philadelphia 76ers', + 'Phoenix Suns', + 'Portland Trail Blazers', + 'Sacramento Kings', + 'San Antonio Spurs', + 'Toronto Raptors', + 'Utah Jazz', + 'Washington Wizards ' + }; + Integer teamCount = (count > nbaTeams.size() || + count == 0) + ? nbaTeams.size() + : count; + + for (Integer i = 0; i < teamCount; i++) { + teamList.add(new Brackets_Team__c(Name = nbaTeams[i])); } - + return teamList; } - /** - * Create a new Team - * @return team - */ - public static Brackets_Team__c createTeam( String name ){ - return new Brackets_Team__c( Name = name ); + * Create a new Team + * @return team + */ + public static Brackets_Team__c createTeam(String name) { + return new Brackets_Team__c(Name = name); } /** - * Create a new Brackets_Group__c - * @params tId ( tournament Id ) - * @return cGroup - */ - public static Brackets_Group__c getGroup( String tId ) { - return BracketsTestUtilities.getGroup(tId, BracketsGroupUtilities.BET_TYPE_FULL_TOURNAMENT); + * Create a new Brackets_Group__c + * @params tId ( tournament Id ) + * @return cGroup + */ + public static Brackets_Group__c getGroup(String tId) { + return BracketsTestUtilities.getGroup( + tId, + BracketsGroupUtilities.BET_TYPE_FULL_TOURNAMENT + ); } - - public static Brackets_Group__c getGroup( String tId, String groupType ) { - Brackets_Group__c cGroup = new Brackets_Group__c(); - cGroup.Brackets_Tournament__c = ( tId != null && tId != '' ) ? tId : BracketsTestUtilities.getNewNFLTournament().Id; - cGroup.Type__c = groupType; + + public static Brackets_Group__c getGroup(String tId, String groupType) { + Brackets_Group__c cGroup = new Brackets_Group__c(); + cGroup.Brackets_Tournament__c = (tId != null && + tId != '') + ? tId + : BracketsTestUtilities.getNewNFLTournament().Id; + cGroup.Type__c = groupType; insert cGroup; return cGroup; } - - - public static Brackets_Group__c getClosedGroup(String tId){ + + public static Brackets_Group__c getClosedGroup(String tId) { Brackets_Group__c groupp = getGroup(tId); update groupp; return groupp; } - - /* - * Create a new User without profile - * @return testUser - */ - public static User createUser(){ + * Create a new User without profile + * @return testUser + */ + public static User createUser() { Sobject p; - for( Sobject prof : Database.query('Select Id, PermissionsModifyAllData, Name from Profile limit 100')){ - if( Boolean.valueOf(prof.get('PermissionsModifyAllData')) ){ + for ( + Sobject prof : Database.query( + 'Select Id, PermissionsModifyAllData, Name from Profile limit 100' + ) + ) { + if (Boolean.valueOf(prof.get('PermissionsModifyAllData'))) { p = prof; break; } } - return BracketsTestUtilities.createUser( p ); - + return BracketsTestUtilities.createUser(p); } /* - * Create a new User - * @param p New user profile - * @return testUser - */ - public static User createUser( Sobject p ){ - + * Create a new User + * @param p New user profile + * @return testUser + */ + public static User createUser(Sobject p) { String namePrefix = BracketsTestUtilities.createRandomWord(); - User testUser = new User(); - - testUser.Email = 'test@test.com'; - testUser.Username = namePrefix + '@testuser.com'; - testUser.LastName = 'test'; - testUser.Alias = 'test'; - testUser.ProfileId = p.Id; - testUser.LanguageLocaleKey = 'en_US'; - testUser.LocaleSidKey = 'en_US'; - testUser.TimeZoneSidKey = 'America/Chicago'; - testUser.EmailEncodingKey = 'UTF-8'; + User testUser = new User(); + + testUser.Email = 'test@test.com'; + testUser.Username = namePrefix + '@testuser.com'; + testUser.LastName = 'test'; + testUser.Alias = 'test'; + testUser.ProfileId = p.Id; + testUser.LanguageLocaleKey = 'en_US'; + testUser.LocaleSidKey = 'en_US'; + testUser.TimeZoneSidKey = 'America/Chicago'; + testUser.EmailEncodingKey = 'UTF-8'; insert testUser; @@ -507,24 +619,24 @@ public with sharing class BracketsTestUtilities{ } /** - * Create a random word - */ - public static String createRandomWord(){ - return BracketsTestUtilities.createRandomWord('word'); + * Create a random word + */ + public static String createRandomWord() { + return BracketsTestUtilities.createRandomWord('word'); } /** - * Create a random word - * @param prefix Prefix for the generated word - */ - public static String createRandomWord( String prefix ){ - String ret = prefix + math.rint( math.random() * 100000 ); - - return ret; + * Create a random word + * @param prefix Prefix for the generated word + */ + public static String createRandomWord(String prefix) { + String ret = prefix + math.rint(math.random() * 100000); + + return ret; } - //RSC 2011-03-07 Not in use. - /* + //RSC 2011-03-07 Not in use. + /* public static Brackets_Group__c createRandomGroup(){ Brackets_Group__c groupp = new Brackets_Group__c(); groupp.Name = createRandomWord(); @@ -533,141 +645,50 @@ public with sharing class BracketsTestUtilities{ return groupp; } */ - - /** - * Generate random integer between 0 and max-1 - */ - public static Integer rand( Integer max ){ - return Math.mod( Math.round( Math.random() * 10000 ), max ); - } - - /** - * Filter the possible teams what can play a match. - * - * @param match the selected match to check the teams - * @param matchesMap all the matches - * @param possibleTeamsResult a list of candidates teams to play this match. - */ - private static void possibleTeamsForMatch(Brackets_Match__c match,MapmatchesMap,ListpossibleTeamsResult){ - Boolean matched = false; - for(Brackets_Match__c currentMatch :matchesMap.values()){ - if(currentMatch.FollowingBrackets_Match__c == match.Id){ - matched = true; - if(currentMatch.Brackets_Round__r.RoundNumber__c == 1.0){ - if(currentMatch.FollowingIsHome__c && match.VisitorBrackets_Team__c != null){ - possibleTeamsResult.add(match.VisitorBrackets_Team__c); - }else if(match.HomeBrackets_Team__c != null){ - possibleTeamsResult.add(match.HomeBrackets_Team__c); - } - } - possibleTeamsForMatch(currentMatch,matchesMap,possibleTeamsResult); - } - } - if(!matched){ - possibleTeamsResult.add(match.HomeBrackets_Team__c); - possibleTeamsResult.add(match.VisitorBrackets_Team__c); - } - } - - //------------------------------------------------------------------------- - // Test Methods - //------------------------------------------------------------------------- - - static testmethod void testRandomWord(){ - System.assert( BracketsTestUtilities.createRandomWord() != BracketsTestUtilities.createRandomWord() ); - } - - public testmethod static void testCreateUser(){ - - User u = BracketsTestUtilities.createUser(); - system.assert( u != null ); - system.assert( u.Id != null ); - } - - public testmethod static void testCreateAndUpsertTeam(){ - - Brackets_Team__c team = BracketsTestUtilities.createTeam('MyTeam'); - system.assert( team != null ); - system.assert( team.Name == 'MyTeam' ); - } - - public testmethod static void testCreateTeamList(){ - List someTeams = BracketsTestUtilities.createTeamList(4); - system.assert( someTeams.size() == 4 ); - } - - public testmethod static void testGetRandomTeam(){ - - List teams = BracketsTestUtilities.createTeamList(2); - - upsert teams; - - Brackets_Team__c t = BracketsTestUtilities.getRandomTeam( teams ); - system.assert( t != null ); - system.assert( t.Name != null && t.Name != ''); - } - - public testmethod static void testCreateTournamet(){ - - Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament('Tournament-',2); - system.assert( tournament != null ); - } - - public testmethod static void testCreateRound(){ - - Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament('Tournament-',2); - Brackets_Round__c round = BracketsTestUtilities.createSimpleRound( tournament ); - system.assert( round != null ); - } - - public testmethod static void testCreateMatch(){ - - Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament('Tournament-',2); - Brackets_Round__c round = BracketsTestUtilities.createSimpleRound( tournament ); - Brackets_Match__c match = BracketsTestUtilities.createMatch( null, null, round, null ); - - system.assert( match != null ); - } - - public testmethod static void testCreateUserTournamet(){ - - User user = BracketsTestUtilities.createUser(); - Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament('Tournament-',2); - Brackets_Group__c groupp = BracketsTestUtilities.getGroup(tournament.Id); - Brackets_UserTournament__c ut = BracketsTestUtilities.createUserTournament(user.Id, tournament.Id, groupp.Id); - system.assert( ut != null ); + * Generate random integer between 0 and max-1 + */ + public static Integer rand(Integer max) { + return Math.mod(Math.round(Math.random() * 10000), max); } - public testmethod static void testCreateUserMatchPrediction(){ - - User user = BracketsTestUtilities.createUser(); - Brackets_Tournament__c tournament = BracketsTestUtilities.getNewStandardTournament(); - Brackets_Group__c uGroup = BracketsTestUtilities.getGroup( tournament.Id ); - Brackets_UserTournament__c ut = BracketsTestUtilities.createUserTournament(user.Id, tournament.Id, uGroup.Id); - Brackets_Round__c round = BracketsTestUtilities.createSimpleRound(tournament); - List teams = BracketsTestUtilities.createTeamList(2); - - Brackets_Team__c home = teams[0]; - Brackets_Team__c visitor = teams[1]; - upsert teams; - - Brackets_Match__c match = BracketsTestUtilities.createMatch(home, visitor, round, null); - Brackets_Team__c winner = home; - - BracketsTestUtilities.createUserMatchPrediction( tournament.Id, uGroup.Id, ut.Id ); - - List predictions = [select Id from Brackets_UserMatchPred__c where Brackets_UserTournament__c =: ut.Id ]; - system.assert( !predictions.isEmpty(), predictions ); - - } - - public testmethod static void testCreateFullTournament(){ - Brackets_Tournament__c tournament = BracketsTestUtilities.createFullTournament(4,BracketsTournamentUtilities.DEFAULT_TOURNAMENT_TYPE); - system.assert( tournament != null ); + /** + * Filter the possible teams what can play a match. + * + * @param match the selected match to check the teams + * @param matchesMap all the matches + * @param possibleTeamsResult a list of candidates teams to play this match. + */ + private static void possibleTeamsForMatch( + Brackets_Match__c match, + Map matchesMap, + List possibleTeamsResult + ) { + Boolean matched = false; + for (Brackets_Match__c currentMatch : matchesMap.values()) { + if (currentMatch.FollowingBrackets_Match__c == match.Id) { + matched = true; + if (currentMatch.Brackets_Round__r.RoundNumber__c == 1.0) { + if ( + currentMatch.FollowingIsHome__c && + match.VisitorBrackets_Team__c != null + ) { + possibleTeamsResult.add(match.VisitorBrackets_Team__c); + } else if (match.HomeBrackets_Team__c != null) { + possibleTeamsResult.add(match.HomeBrackets_Team__c); + } + } + possibleTeamsForMatch( + currentMatch, + matchesMap, + possibleTeamsResult + ); + } + } + if (!matched) { + possibleTeamsResult.add(match.HomeBrackets_Team__c); + possibleTeamsResult.add(match.VisitorBrackets_Team__c); + } } - - - -} \ No newline at end of file +} diff --git a/src/classes/BracketsTestUtilities.cls-meta.xml b/force-app/main/default/classes/BracketsTestUtilities.cls-meta.xml similarity index 57% rename from src/classes/BracketsTestUtilities.cls-meta.xml rename to force-app/main/default/classes/BracketsTestUtilities.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsTestUtilities.cls-meta.xml +++ b/force-app/main/default/classes/BracketsTestUtilities.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsTestUtilitiesTest.cls b/force-app/main/default/classes/BracketsTestUtilitiesTest.cls new file mode 100644 index 0000000..74e937d --- /dev/null +++ b/force-app/main/default/classes/BracketsTestUtilitiesTest.cls @@ -0,0 +1,153 @@ +@isTest +class BracketsTestUtilitiesTest { + @isTest + static void testRandomWord() { + System.assert( + BracketsTestUtilities.createRandomWord() != + BracketsTestUtilities.createRandomWord() + ); + } + + @isTest + static void testCreateUser() { + User u = BracketsTestUtilities.createUser(); + system.assert(u != null); + system.assert(u.Id != null); + } + + @isTest + static void testCreateAndUpsertTeam() { + Brackets_Team__c team = BracketsTestUtilities.createTeam('MyTeam'); + system.assert(team != null); + system.assert(team.Name == 'MyTeam'); + } + + @isTest + static void testCreateTeamList() { + List someTeams = BracketsTestUtilities.createTeamList( + 4 + ); + system.assert(someTeams.size() == 4); + } + + @isTest + static void testGetRandomTeam() { + List teams = BracketsTestUtilities.createTeamList(2); + + upsert teams; + + Brackets_Team__c t = BracketsTestUtilities.getRandomTeam(teams); + system.assert(t != null); + system.assert(t.Name != null && t.Name != ''); + } + + @isTest + static void testCreateTournamet() { + Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament( + 'Tournament-', + 2 + ); + system.assert(tournament != null); + } + + @isTest + static void testCreateRound() { + Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament( + 'Tournament-', + 2 + ); + Brackets_Round__c round = BracketsTestUtilities.createSimpleRound( + tournament + ); + system.assert(round != null); + } + + @isTest + static void testCreateMatch() { + Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament( + 'Tournament-', + 2 + ); + Brackets_Round__c round = BracketsTestUtilities.createSimpleRound( + tournament + ); + Brackets_Match__c match = BracketsTestUtilities.createMatch( + null, + null, + round, + null + ); + + system.assert(match != null); + } + + @isTest + static void testCreateUserTournamet() { + User user = BracketsTestUtilities.createUser(); + Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament( + 'Tournament-', + 2 + ); + Brackets_Group__c groupp = BracketsTestUtilities.getGroup( + tournament.Id + ); + Brackets_UserTournament__c ut = BracketsTestUtilities.createUserTournament( + user.Id, + tournament.Id, + groupp.Id + ); + system.assert(ut != null); + } + + @isTest + static void testCreateUserMatchPrediction() { + User user = BracketsTestUtilities.createUser(); + Brackets_Tournament__c tournament = BracketsTestUtilities.getNewStandardTournament(); + Brackets_Group__c uGroup = BracketsTestUtilities.getGroup( + tournament.Id + ); + Brackets_UserTournament__c ut = BracketsTestUtilities.createUserTournament( + user.Id, + tournament.Id, + uGroup.Id + ); + Brackets_Round__c round = BracketsTestUtilities.createSimpleRound( + tournament + ); + List teams = BracketsTestUtilities.createTeamList(2); + + Brackets_Team__c home = teams[0]; + Brackets_Team__c visitor = teams[1]; + upsert teams; + + Brackets_Match__c match = BracketsTestUtilities.createMatch( + home, + visitor, + round, + null + ); + Brackets_Team__c winner = home; + + BracketsTestUtilities.createUserMatchPrediction( + tournament.Id, + uGroup.Id, + ut.Id + ); + + List predictions = [ + SELECT Id + FROM Brackets_UserMatchPred__c + WHERE Brackets_UserTournament__c = :ut.Id + ]; + system.assert(!predictions.isEmpty(), predictions); + } + + @isTest + static void testCreateFullTournament() { + Brackets_Tournament__c tournament = BracketsTestUtilities.createFullTournament( + 4, + BracketsTournamentUtilities.DEFAULT_TOURNAMENT_TYPE + ); + system.assert(tournament != null); + } +} diff --git a/force-app/main/default/classes/BracketsTestUtilitiesTest.cls-meta.xml b/force-app/main/default/classes/BracketsTestUtilitiesTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsTestUtilitiesTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsTournamentButtonsController.cls b/force-app/main/default/classes/BracketsTournamentButtonsController.cls new file mode 100644 index 0000000..15f3273 --- /dev/null +++ b/force-app/main/default/classes/BracketsTournamentButtonsController.cls @@ -0,0 +1,228 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +public with sharing class BracketsTournamentButtonsController { + private List siteList { get; set; } + public Brackets_Tournament__c myTournament { get; set; } + public String tId { get; set; } + public String ShareUrl { get; set; } + public Boolean showUpdateButton { get; set; } + public Boolean showPublishButton { get; set; } + public Boolean publishHasErrors { get; set; } + public String subDomain { get; set; } + public String domain { get; set; } + public String urlParam { get; set; } + public String finalUrl { get; set; } + public String xmlMessage { get; set; } + Map matches; + + public BracketsTournamentButtonsController( + Apexpages.StandardController stdController + ) { + this.tId = (Id) stdController.getId(); + this.index(); + } + + /** + * Dummy Method + */ + public void index() { + this.myTournament = this.getTournament(); + this.showPublishButton = (!this.myTournament.Allow_Update__c && + !this.myTournament.isChild__c); + this.showUpdateButton = (this.myTournament.isChild__c && + this.myTournament.Update_Source__c != ''); + this.siteList = this.getMySite(); + this.domain = (this.siteList.size() > 0) + ? String.valueOf(this.siteList.get(0).get('Subdomain')) + : ''; + this.finalUrl = this.myTournament.Update_Source__c; + this.matches = new Map( + [ + SELECT + Id, + HomeBrackets_Team__c, + VisitorBrackets_Team__c, + FollowingBrackets_Match__c + FROM Brackets_Match__c + WHERE + Brackets_Round__r.Brackets_Tournament__c = :this.myTournament.Id + ] + ); + } + + /** + * Check if the current Tournament can be Published checking First Leven Complete + * Cannot publish. All starting matches much be complete before publishing. + * @return canPublish + */ + public Boolean getCanPublish() { + // Cannot publish. All starting matches much be complete before publishing. Check your matches and start again. + try { + BracketsMatchUtilities.checkFirstLevelCompleted( + this.myTournament, + this.matches + ); + return true; + } catch (Exception e) { + return false; + } + } + + /** + * Getter of ShowUrlSelection, establish if the Url section need be showed + * @return siteList size + */ + public Boolean getShowUrlSelection() { + return (!this.siteList.isEmpty() && + this.myTournament.Update_Source__c == null); + } + + /** + * Getter of ShowCreateSiteMsg + * @return siteList is Empty + */ + public Boolean getShowCreateSiteMsg() { + return this.siteList.isEmpty(); + } + + /** + * Return the selected Tournament + * @return : tournament + */ + private Brackets_Tournament__c getTournament() { + return [ + SELECT + t.isChild__c, + t.Version__c, + t.Update_Source__c, + t.Allow_Update__c + FROM Brackets_Tournament__c t + WHERE t.Id = :this.tId + ]; + } + + /** + * Get Site parameters and return it + * return Select; + */ + public List getMySite() { + List sites = new List(); + if (Schema.getGlobalDescribe().get('Site') != null) { + sites = Database.query( + 'Select Id, Name, Subdomain, UrlPathPrefix from Site limit 20' + ); + } + return sites; + } + + /** + * Get all SIte Folders + * return options; + */ + public List getUrlPathPrefix() { + Object urlPathPrefixObject; + String urlPathPrefixValue; + List options = new List(); + for (Sobject s : this.siteList) { + urlPathPrefixObject = s.get('UrlPathPrefix'); + if (urlPathPrefixObject != null) { + urlPathPrefixValue = String.valueOf(urlPathPrefixObject); + options.add( + new SelectOption( + urlPathPrefixValue + '/', + urlPathPrefixValue + ) + ); + } + } + return options; + } + + public String getSitePath() { + for (Sobject s : this.siteList) { + return String.valueOf(s.get('UrlPathPrefix')); + } + return null; + } + + /** + * Get selected site and save it into related Tournament + */ + public void saveUrl() { + if (this.getUrlPathPrefix().size() == 1) { + this.finalUrl = + this.urlParam + + this.getSitePath() + + '?id=' + + this.myTournament.Id; + } else { + this.subDomain = (this.subDomain != null) ? this.subDomain : ''; + this.finalUrl = + this.urlParam + + this.subDomain + + '?id=' + + this.myTournament.Id; + } + + this.myTournament.Update_Source__c = this.finalUrl; + update this.myTournament; + this.index(); + } + + /** + * Execute Manual Update + */ + public void doManualUpdate() { + try { + new BracketsProccessUpdate(this.myTournament.Id); + this.index(); + this.xmlMessage = 'Tournament has been updated!'; + } catch (Exception ex) { + this.xmlMessage = ex.getMessage(); + } + } + + /** + * Publish tournament + */ + public void publish2() { + try { + myTournament.Allow_Update__c = true; + myTournament.Version__c++; + + update this.myTournament; + this.showPublishButton = false; + this.xmlMessage = 'Tournament has been published!!!'; + } catch (Exception e) { + this.publishHasErrors = true; + this.xmlMessage = 'Error : ' + e.getMessage(); + } + } +} diff --git a/src/classes/BracketsTournamentButtonsController.cls-meta.xml b/force-app/main/default/classes/BracketsTournamentButtonsController.cls-meta.xml similarity index 57% rename from src/classes/BracketsTournamentButtonsController.cls-meta.xml rename to force-app/main/default/classes/BracketsTournamentButtonsController.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsTournamentButtonsController.cls-meta.xml +++ b/force-app/main/default/classes/BracketsTournamentButtonsController.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsTournamentButtonsControllerTest.cls b/force-app/main/default/classes/BracketsTournamentButtonsControllerTest.cls new file mode 100644 index 0000000..22ff7a4 --- /dev/null +++ b/force-app/main/default/classes/BracketsTournamentButtonsControllerTest.cls @@ -0,0 +1,24 @@ +@isTest +class BracketsTournamentButtonsControllerTest { + @isTest + static void test() { + Brackets_Tournament__c t = BracketsTestUtilities.createTournament( + 'test', + 2 + ); + BracketsTournamentButtonsController cont = new BracketsTournamentButtonsController( + new Apexpages.Standardcontroller(t) + ); + + List test = cont.getUrlPathPrefix(); + cont.getUrlPathPrefix(); + cont.saveUrl(); + cont.getSitePath(); + cont.publish2(); + System.assert(!cont.getCanPublish()); + cont.getShowUrlSelection(); + cont.getShowCreateSiteMsg(); + cont.doManualUpdate(); + System.assert(cont.xmlMessage != null); + } +} diff --git a/force-app/main/default/classes/BracketsTournamentButtonsControllerTest.cls-meta.xml b/force-app/main/default/classes/BracketsTournamentButtonsControllerTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsTournamentButtonsControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsTournamentUtilities.cls b/force-app/main/default/classes/BracketsTournamentUtilities.cls new file mode 100644 index 0000000..6a3be4c --- /dev/null +++ b/force-app/main/default/classes/BracketsTournamentUtilities.cls @@ -0,0 +1,640 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +public with sharing class BracketsTournamentUtilities { + //------------------------------------------------------------------------- + // Constants & Variables + //------------------------------------------------------------------------- + public static final Integer DEFAULT_ROUND_SCORE_POINTS = 1; + public static final String DEFAULT_TOURNAMENT_TYPE = 'Standard'; + public static final String STANDARD_TOURNAMENT_TYPE = 'Standard'; + public static final String NFL_PLAYOFF_TOURNAMENT_TYPE = 'NFL Playoff'; + public static final String NFL_CONFERENCE_AMERICAN = 'AFC'; + public static final String NFL_CONFERENCE_NATIONAL = 'NFC'; + + private static final String DEFAULT_ROUND_NAME_PREFIX = 'Round '; + private static final String NOT_POW_TWO_TEAM_COUNT = 'This number must be power of two, for example: 2,4,8,16,32,64,128,256, ..'; + private static final String FIELD_NOT_UPDATEABLE = 'This field is not updatable.'; + private static final String NFL_TEAM_COUNT_ERROR = 'NFL team count must be 12'; + private static final Integer NFL_PLAYOFF_TEAMS = 12; + private static final Integer TEAMS_COUNT_MAX = 32; + + public static Boolean CreatingTournamentTree = false; + + //------------------------------------------------------------------------- + // Public Methods + //------------------------------------------------------------------------- + + /** + * Create a tournament skeleton + * + * @param tournamentCol Tournament insert list + */ + public static void createTournamentTree( + List tournamentCol + ) { + Integer teamCount, roundCount; + Id playoffCol = null; + Id standardCol = null; + Map teamsCol = new Map(); + Map roundsCol = new Map(); + + for (Brackets_Tournament__c tournament : tournamentCol) { + if (tournament.Type__c == NFL_PLAYOFF_TOURNAMENT_TYPE) { + playoffCol = tournament.Id; + } else { + standardCol = tournament.Id; + teamCount = (tournament.TeamCount__c == null) + ? 0 + : Math.floor(tournament.TeamCount__c).intValue(); + roundCount = roundCount(teamCount); + } + break; + } + + if (playoffCol != null) { + BracketsTournamentUtilities.createNFLPlayoffTournamentTree( + playoffCol + ); + } + + if (standardCol != null) { + if (teamCount > TEAMS_COUNT_MAX) { + BracketsTournamentUtilities.createTournamentTreeFuture( + standardCol, + teamCount, + roundCount + ); + } else { + BracketsTournamentUtilities.createTournamentTreeCall( + standardCol, + teamCount, + roundCount + ); + } + } + } + + /** + * Create a NFL Playoff tournament + * + * @param tournamentCol Set of tournament identifiers + */ + public static void createNFLPlayoffTournamentTree(Id tid) { + createNFLPlayoffTournamentTreeMethod(tid); + } + + /** + * Create a standard tournament skeleton for each tournament + * + * @param tournamentCol Set of tournament identifiers + * @param teamsCount Number of teams for each tournament + * @param roundsCount Number of rounds for each tournament + */ + public static void createTournamentTreeCall( + Id tid, + Integer teamsCount, + Integer roundsCount + ) { + createTournamentTreeMethod(tid, teamsCount, roundsCount); + } + + @future + public static void createTournamentTreeFuture( + Id tid, + Integer teamsCount, + Integer roundsCount + ) { + createTournamentTreeCall(tid, teamsCount, roundsCount); + } + + /** + * Check if the team count is power of 2 and return the number of rounds + * + * @param teamCount Total of teams + * @return Number of Rounds + */ + public static Integer roundCount(Integer teamCount) { + Integer i = teamCount; + Integer r = 0; + + while (i > 1) { + if (Math.mod(i, 2) == 0) { + i = i / 2; + r = r + 1; + } else { + return 0; + } + } + + return r; + } + + /** + * Method used to generate random alfa-numeric strings + * + * @return result + */ + //TODO Delete + /* + public Static String generateRandomExternalId(){ + + String[] code = new String[]{'A','B','C','D','E','F','G','H','I','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'}; + String result = ''; + + for( Integer i = 0; i < 10; i++ ){ + Integer index = Math.mod( (Math.random() * 100).intValue(), 60); + result += code[ index ]; + } + + return result; + } + */ + + /** + * Method used to insert External Ids on tournament objects + * + * @param tournamentList + */ + //TODO DELETE + /* + public static void addExternalId( List tournamentList ){ + + for( Brackets_Tournament__c tour : tournamentList ){ + if( tour.ExternalId__c == null ){ + tour.ExternalId__c = BracketsTournamentUtilities.generateRandomExternalId(); + } + } + } + */ + /** + * Given a list of tournament, check the teamCount field if it is pow of 2. + * + * @param tournamentList A list of tournament. + */ + public static void checkTeamCount( + List tournamentList + ) { + Integer roundCount; + Integer teamCount; + for (Brackets_Tournament__c tournament : tournamentList) { + if ( + tournament.Type__c == DEFAULT_TOURNAMENT_TYPE && + tournament.TeamCount__c != null + ) { + teamCount = Math.floor(tournament.TeamCount__c).intValue(); + roundCount = BracketsTournamentUtilities.roundCount(teamCount); + if (teamCount != 0 && roundCount == 0) { + tournament.addError(NOT_POW_TWO_TEAM_COUNT); + } + } else if (tournament.Type__c == NFL_PLAYOFF_TOURNAMENT_TYPE) { + tournament.TeamCount__c = NFL_PLAYOFF_TEAMS; + } + } + } + + /** + * Given a two list of tournament sobjects, checks the field named TeamCount__c is not updateable. + */ + public static void checkTeamCountNotUpdateable( + List tournamentNewList, + List tournamentOldList + ) { + Brackets_Tournament__c oldTournament, newTournament; + for (Integer i = 0; i < tournamentNewList.size(); i++) { + oldTournament = tournamentOldList.get(i); + newTournament = tournamentNewList.get(i); + if (newTournament.Type__c == NFL_PLAYOFF_TOURNAMENT_TYPE) { + if ( + newTournament.TeamCount__c.intValue() != NFL_PLAYOFF_TEAMS + ) { + newTournament.TeamCount__c.addError(NFL_TEAM_COUNT_ERROR); + } + } else if ( + oldTournament.TeamCount__c != newTournament.TeamCount__c + ) { + newTournament.TeamCount__c.addError(FIELD_NOT_UPDATEABLE); + } + } + } + + /** + * Given a list of tournament ids, returns a list of tournament sobjects. + * + * @param tournamentList a list of tournament ids. + * @return a list of tournament sobjects. + */ + public static List getTournamentList( + List tournamentIdList + ) { + return [ + SELECT Id, Name + FROM Brackets_Tournament__c + WHERE Id IN :tournamentIdList + ]; + } + + /** + * Return a list of imported tournaments to be updated, the ones with oldest LastModifiedDate field. + * + * @param size number of tournament + * @return a list of imported tournament + */ + public static List getTournamentList(Integer size) { + return [ + SELECT Id, Update_Source__c, LastModifiedDate + FROM Brackets_Tournament__c + WHERE isChild__c = true + ORDER BY LastModifiedDate ASC + LIMIT :size + ]; + } + + /** + * Create a tournament skeleton + * + * @param tournamentId Tournament identifier + * @param teamCount Number of teams + * @param roundCount Number of rounds + */ + + public static void createTournamentTreeMethod( + String tournamentId, + Integer teamCount, + Integer roundCount + ) { + // Set global flag + BracketsTournamentUtilities.CreatingTournamentTree = true; + + if (tournamentId != null) { + // Create Rounds + Brackets_Round__c round; + List roundCol = new List(); + + for (Integer i = 0; i < roundCount; i++) { + round = new Brackets_Round__c(); + + round.Brackets_Tournament__c = tournamentId; + round.ScorePoints__c = DEFAULT_ROUND_SCORE_POINTS; + round.Name = DEFAULT_ROUND_NAME_PREFIX + (i + 1).format(); + round.RoundNumber__c = i + 1; + + roundCol.add(round); + } + + insert roundCol; + + // Create Matches + Integer matchCount = teamCount; + List currRoundMatches = new List(); + List prevRoundMatches = new List(); + Brackets_Match__c match; + Integer currMatch; + + for ( + Integer roundNumber = 0; roundNumber < roundCount; roundNumber++ + ) { + matchCount = matchCount / 2; + prevRoundMatches = currRoundMatches; + currRoundMatches = new List(); + + // Create current round matches + for (Integer k = 0; k < matchCount; k++) { + match = new Brackets_Match__c(); + + match.Brackets_Round__c = roundCol[roundNumber].Id; + match.Position__c = k + 1; + + currRoundMatches.add(match); + } + + insert currRoundMatches; + + // Link previous round matches + if (prevRoundMatches.size() != 0) { + for ( + Integer prevMatch = 0; + prevMatch < prevRoundMatches.size(); + prevMatch++ + ) { + currMatch = Math.floor(prevMatch / 2).intValue(); + prevRoundMatches[prevMatch] + .FollowingBrackets_Match__c = currRoundMatches[ + currMatch + ] + .Id; + prevRoundMatches[prevMatch] + .FollowingIsHome__c = Math.mod(prevMatch, 2) == 0 + ? true + : false; + } + + update prevRoundMatches; + } + } + } + + // Unset global flag + BracketsTournamentUtilities.CreatingTournamentTree = false; + } + + /** + * Create a NFL Playoff tournament + * + * @param tournamentId Tournament identifier + */ + public static void createNFLPlayoffTournamentTreeMethod( + String tournamentId + ) { + // Set global flag + BracketsTournamentUtilities.CreatingTournamentTree = true; + + if (tournamentId != null) { + // Create Rounds + List roundCol = BracketsTournamentUtilities.createNFLRounds( + tournamentId + ); + + /** + * Hack to fix security scanner bugs + */ + // Init matches + List allNFLMatches = new List(); + Brackets_Match__c mTemp; + for (Integer i = 0; i < 11; i++) { + mTemp = new Brackets_Match__c(); + + if (i < 4) { + mTemp.Brackets_Round__c = roundCol[0].Id; + } else if (i >= 4 && i < 8) { + mTemp.Brackets_Round__c = roundCol[1].Id; + } else if (i >= 8 && i < 10) { + mTemp.Brackets_Round__c = roundCol[2].Id; + } else { + mTemp.Brackets_Round__c = roundCol[3].Id; + } + + allNFLMatches.add(mTemp); + } + + insert allNFLMatches; + + // Create Matches + BracketsTournamentUtilities.createNFLWCRoundMatches(allNFLMatches); + + // 2. Divisional Round + BracketsTournamentUtilities.createNFLDRoundMatches(allNFLMatches); + + // 3. Conference Championships + BracketsTournamentUtilities.createNFLCRoundMatches(allNFLMatches); + + // 4. Super Bowl + BracketsTournamentUtilities.createNFLSuperBowlMatch(allNFLMatches); + + upsert allNFLMatches; + } + + // Unset global flag + BracketsTournamentUtilities.CreatingTournamentTree = false; + } + + //------------------------------------------------------------------------- + // Private methods + //------------------------------------------------------------------------- + + /** + * Create NFL playoff rounds + * + * @param tournamentId Id of the new tournament + * @return List of NFL playoff rounds + */ + private static List createNFLRounds( + String tournamentId + ) { + Brackets_Round__c round; + List roundCol = new List(); + + // Wild Card Round + round = new Brackets_Round__c(); + + round.Brackets_Tournament__c = tournamentId; + round.ScorePoints__c = 5; + round.Name = 'Wild Card Round'; + round.RoundNumber__c = 1; + + roundCol.add(round); + + // Divisional Round + round = new Brackets_Round__c(); + + round.Brackets_Tournament__c = tournamentId; + round.ScorePoints__c = 7; + round.Name = 'Divisional Round'; + round.RoundNumber__c = 2; + + roundCol.add(round); + + // Conference championship + round = new Brackets_Round__c(); + + round.Brackets_Tournament__c = tournamentId; + round.ScorePoints__c = 11; + round.Name = 'Conference Championship'; + round.RoundNumber__c = 3; + + roundCol.add(round); + + // Super Bowl + round = new Brackets_Round__c(); + + round.Brackets_Tournament__c = tournamentId; + round.ScorePoints__c = 17; + round.Name = 'Super Bowl'; + round.RoundNumber__c = 4; + + roundCol.add(round); + + insert roundCol; + + return roundCol; + } + + /** + * Create NFL Playoff "Wild Card Round" matches + */ + public static void createNFLWCRoundMatches( + List matchCol + ) { + // First Match + matchCol[0].Position__c = 1; + matchCol[0].Conference__c = NFL_CONFERENCE_AMERICAN; + matchCol[0] + .Description__c = 'Wild Card 1 ( Team 1 ) vs Division Winner 4 ( Team 2 )'; + matchCol[0].FollowingIsHome__c = true; + matchCol[0].FollowingBrackets_Match__c = matchCol[4].Id; + + // Second Match + matchCol[1].Position__c = 2; + matchCol[1].Conference__c = NFL_CONFERENCE_AMERICAN; + matchCol[1] + .Description__c = 'Division Winner 3 ( Team 1 ) vs Wild Card 2 ( Team 2 )'; + matchCol[1].FollowingIsHome__c = false; + matchCol[1].FollowingBrackets_Match__c = matchCol[5].Id; + + // Third Match + matchCol[2].Position__c = 3; + matchCol[2].Conference__c = NFL_CONFERENCE_NATIONAL; + matchCol[2] + .Description__c = 'Wild Card 1 ( Team 1 ) vs Division Winner 4 ( Team 2 )'; + matchCol[2].FollowingIsHome__c = true; + matchCol[2].FollowingBrackets_Match__c = matchCol[6].Id; + + // Fourth Match + matchCol[3].Position__c = 4; + matchCol[3].Conference__c = NFL_CONFERENCE_NATIONAL; + matchCol[3] + .Description__c = 'Division Winner 3 ( Team 1 ) vs Wild Card 2 ( Team 2 )'; + matchCol[3].FollowingIsHome__c = false; + matchCol[3].FollowingBrackets_Match__c = matchCol[7].Id; + } + + /** + * Create NFL Playoff "Divisional Round" matches + */ + public static void createNFLDRoundMatches( + List matchCol + ) { + // First Match + matchCol[4].Position__c = 1; + matchCol[4].Conference__c = NFL_CONFERENCE_AMERICAN; + matchCol[4] + .Description__c = 'DW 4, WC 1 or WC 2 ( Team 1 ) vs Division Winner 1 ( Team 2 )'; + matchCol[4].FollowingIsHome__c = true; + matchCol[4].FollowingBrackets_Match__c = matchCol[8].Id; + + // Second Match + matchCol[5].Position__c = 2; + matchCol[5].Conference__c = NFL_CONFERENCE_AMERICAN; + matchCol[5] + .Description__c = 'Division Winner 2 ( Team 1 ) vs DW 3, DW 4 or WC 1 ( Team 2 )'; + matchCol[5].FollowingIsHome__c = false; + matchCol[5].FollowingBrackets_Match__c = matchCol[8].Id; + + // Third Match + matchCol[6].Position__c = 3; + matchCol[6].Conference__c = NFL_CONFERENCE_NATIONAL; + matchCol[6] + .Description__c = 'DW 4, WC 1 or WC 2 ( Team 1 ) vs Division Winner 1 ( Team 2 )'; + matchCol[6].FollowingIsHome__c = true; + matchCol[6].FollowingBrackets_Match__c = matchCol[9].Id; + + // Fourth Match + matchCol[7].Position__c = 4; + matchCol[7].Conference__c = NFL_CONFERENCE_NATIONAL; + matchCol[7] + .Description__c = 'Division Winner 2 ( Team 1 ) vs DW 3, DW 4 or WC 1 ( Team 2 )'; + matchCol[7].FollowingIsHome__c = false; + matchCol[7].FollowingBrackets_Match__c = matchCol[9].Id; + } + + /** + * Create NFL Playoff "Conference Championship" round matches + */ + public static void createNFLCRoundMatches( + List matchCol + ) { + // AFC Championship match + matchCol[8].Position__c = 1; + matchCol[8].Conference__c = NFL_CONFERENCE_AMERICAN; + matchCol[8].Description__c = 'DR1 ( Team 1 ) vs DR2 ( Team 2 )'; + matchCol[8].FollowingIsHome__c = true; + matchCol[8].FollowingBrackets_Match__c = matchCol[10].Id; + + // NFC Championship match + matchCol[9].Position__c = 2; + matchCol[9].Conference__c = NFL_CONFERENCE_NATIONAL; + matchCol[9].Description__c = 'DR3 ( Team 1 ) vs DR4 ( Team 2 )'; + matchCol[9].FollowingIsHome__c = false; + matchCol[9].FollowingBrackets_Match__c = matchCol[10].Id; + } + + /** + * Create NFL Playoff "Super Bowl" match + */ + public static void createNFLSuperBowlMatch( + List matchCol + ) { + matchCol[10].Position__c = 1; + matchCol[10] + .Description__c = 'AFC Champion ( Team 1 ) vs NFC Champion ( Team 2 )'; + } + + /** + * Given two list of tournaments, update the field Allow_Update if there are changes. + * + * @param newTournamentList a list of tournament sobjects + */ + public static void publishOff( + List newList, + List oldList + ) { + System.debug('1234: in publish off'); + for (Integer i = 0; i < newList.size(); i++) { + if ( + newList.get(i).Allow_Update__c && oldList.get(i).Allow_Update__c + ) { + System.debug('1234: here I am turning allow update off'); + newList.get(i).Allow_Update__c = false; + } + } + } + + /** + * Given a list of tournaments, update the tournaments modified. + * + * @param tournamentList a list of tournament sobjects + */ + public static void publishTournamentOff( + List tournamentList + ) { + for (Brackets_Tournament__c tournament : tournamentList) { + tournament.Allow_Update__c = false; + } + update tournamentList; + } + + public static void checkIfIsPublished(List myTour) { + for (Brackets_Tournament__c to : myTour) { + System.assert( + !to.Allow_Update__c, + 'This Tournament can not be deleted!' + ); + } + } +} diff --git a/src/classes/BracketsTournamentUtilities.cls-meta.xml b/force-app/main/default/classes/BracketsTournamentUtilities.cls-meta.xml similarity index 57% rename from src/classes/BracketsTournamentUtilities.cls-meta.xml rename to force-app/main/default/classes/BracketsTournamentUtilities.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsTournamentUtilities.cls-meta.xml +++ b/force-app/main/default/classes/BracketsTournamentUtilities.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsTournamentUtilitiesTest.cls b/force-app/main/default/classes/BracketsTournamentUtilitiesTest.cls new file mode 100644 index 0000000..87b3673 --- /dev/null +++ b/force-app/main/default/classes/BracketsTournamentUtilitiesTest.cls @@ -0,0 +1,75 @@ +@isTest +class BracketsTournamentUtilitiesTest { + @isTest + static void testRoundCount() { + system.assert(BracketsTournamentUtilities.roundCount(4) == 2); + system.assert(BracketsTournamentUtilities.roundCount(5) == 0); + system.assert(BracketsTournamentUtilities.roundCount(32) == 5); + } + + @isTest + static void testCreateTournamentTree() { + Brackets_Tournament__c tournament = new Brackets_Tournament__c(); + tournament.Name = 'Test'; + tournament.TeamCount__c = 8; + + insert tournament; + + system.assert(tournament.Id != null); + } + + @isTest + static void testCreateNFLPlayoffs() { + Brackets_Tournament__c tournament = new Brackets_Tournament__c(); + tournament.Name = 'Test'; + tournament.Type__c = BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE; + + insert tournament; + + system.assert(tournament.Id != null); + } + + @isTest + static void testCheckTeamCountNotUpdateable() { + Brackets_Tournament__c tournament = new Brackets_Tournament__c(); + tournament.Name = 'Test'; + tournament.Type__c = BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE; + + insert tournament; + + tournament.TeamCount__c = 18; + + try { + upsert tournament; + } catch (DmlException e) { + system.assert( + e.getMessage().contains('FIELD_CUSTOM_VALIDATION_EXCEPTION') + ); + } + } + + @isTest + static void testTournamentList() { + BracketsTournamentUtilities.CreatingTournamentTree = true; + + Brackets_Tournament__c tournament = new Brackets_Tournament__c(); + tournament.Name = 'Test'; + tournament.Type__c = BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE; + tournament.isChild__c = true; + insert tournament; + + List ids = new List(); + ids.add(tournament.id); + + List tours = BracketsTournamentUtilities.getTournamentList( + ids + ); + System.assert(tours.size() == 1); + System.assert(tours.get(0).name == tournament.name); + + List tours2 = BracketsTournamentUtilities.getTournamentList( + 1 + ); + System.assert(tours2.size() == 1); + } +} diff --git a/force-app/main/default/classes/BracketsTournamentUtilitiesTest.cls-meta.xml b/force-app/main/default/classes/BracketsTournamentUtilitiesTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsTournamentUtilitiesTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsTreeView.cls b/force-app/main/default/classes/BracketsTreeView.cls new file mode 100644 index 0000000..7492e7c --- /dev/null +++ b/force-app/main/default/classes/BracketsTreeView.cls @@ -0,0 +1,479 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ +public with sharing class BracketsTreeView { + //------------------------------------------------------------------------- + // DataTypes + //------------------------------------------------------------------------- + + /** + * Round data type, keeps information to draw the round + */ + public class RoundData { + public Brackets_Round__c round { get; set; } + public List matches { get; set; } + public String className { get; set; } + + public RoundData() { + this.round = new Brackets_Round__c(); + this.matches = new List(); + this.className = ''; + } + } + + /** + * Match data type, keeps information to draw each match + */ + public class MatchData { + public Brackets_Match__c match { get; set; } + public TeamData home { get; set; } + public TeamData visitor { get; set; } + public TeamData winner { get; set; } + public TeamData prediction { get; set; } + public TeamData champion { get; set; } + public String className { get; set; } + public Boolean spacer { get; set; } + public Boolean isFinal { get; set; } + public String predId { get; set; } + public String extraInfo { get; set; } + public Integer spacerHeight { get; set; } + public Integer blockHeight { get; set; } + public Boolean isLocked { get; set; } + public Boolean isPlayed { + get { + if (winner.team != null) { + return true; + } else { + return false; + } + } + } + + public MatchData() { + this.match = new Brackets_Match__c(); + this.home = new TeamData(); + this.visitor = new TeamData(); + this.winner = new TeamData(); + this.prediction = new TeamData(); + this.champion = null; + this.className = ''; + this.spacer = true; + this.isFinal = false; + this.predId = ''; + this.extraInfo = ''; + this.spacerHeight = 0; + this.blockHeight = 0; + this.isLocked = false; + } + } + + /** + * Team data type, keeps information for each team + */ + public class TeamData { + public Brackets_Team__c team { get; set; } + public Brackets_Team__c predicted { get; set; } + public String className { get; set; } + public String predId { get; set; } + public Integer score { get; set; } + + public TeamData() { + this.team = null; + this.predicted = null; + this.className = ''; + this.predId = ''; + this.score = 0; + } + } + + //------------------------------------------------------------------------- + // Constants & Variables + //------------------------------------------------------------------------- + + public Boolean isLocked = false; + + public Brackets_Group__c betGroup = null; + + public List roundsByNumber = null; + public List matchesByPosition = null; + public Map matchMap = null; + public Map teamMap = null; + public List matchData = new List(); + + public Map predictionMapByMatch = new Map(); + public Map homePredictionMap = new Map(); + public Map visitorPredictionMap = new Map(); + + //------------------------------------------------------------------------- + // Getters and Setters + //------------------------------------------------------------------------- + + public String tournamentId { get; set; } + public String groupId { get; set; } + public String userTournamentId { get; set; } + public Brackets_Tournament__c tournament { get; set; } + public String tournamentClass { get; set; } + public Brackets_UserTournament__c userTournament { get; set; } + + //------------------------------------------------------------------------- + // Constructors + //------------------------------------------------------------------------- + + /** + * Create a new controller instance // with a known group + */ + public BracketsTreeView( + String tId, + Brackets_Group__c targetGroup, + Boolean isLocked, + String userTournamentId + ) { + this.tournamentId = tId; + this.groupId = targetGroup.Id; + this.betGroup = targetGroup; + this.isLocked = isLocked; + this.userTournamentId = userTournamentId; + handleInit(); + } + + public void handleInit() { + if ( + this.tournamentId == null || + this.groupId == null || + this.isLocked == null + ) { + throw new BracketsException( + 'initialization failed - tournament, group and locked indicator are required.' + ); + } + this.tournamentClass = ''; + this.initTournament(); + this.initRounds(); + this.initMatches(); + this.initTeams(); + this.initGroup(); + this.initUserTournament(); + this.initPredictions(); + } + + /** + * List of matches filtered by conference + * + * @param conference NFL conference (or division) + * @return List of matches for the given conference + */ + public List filterMatchesByConference( + String conference + ) { + List result = new List(); + + for (Brackets_Match__c m : this.matchesByPosition) { + if (m.Conference__c == conference) { + result.add(this.matchMap.get(m.Id)); + } + } + + return result; + } + + /** + * List of matches filtered by round + * + * @param roundId Round to filter the matches + * @param source List of matches to filter + * @return Filtered list of matches for the round + */ + public List filterMatchesByRound( + Id roundId, + List source + ) { + List mlst = new List(); + + // Filter matches + for (Brackets_Match__c m : source) { + if (m.Brackets_Round__c == (String) roundId) { + mlst.add(this.matchMap.get(m.Id)); + } + } + + return mlst; + } + + /** + * Get following matches from a list of matches + * + * @param currentMatches List of current matches + * @return List of following matches + */ + public List getNextMatches( + List currentMatches + ) { + List result = new List(); + Set duplicates = new Set(); + + for (Brackets_Match__c cm : currentMatches) { + if ( + cm.FollowingBrackets_Match__c != null && + !duplicates.contains(cm.FollowingBrackets_Match__c) + ) { + duplicates.add(cm.FollowingBrackets_Match__c); + result.add(this.matchMap.get(cm.FollowingBrackets_Match__c)); + } + } + + return result; + } + + /** + * Return TRUE if the match should be locked + * + * @param match Match to check + * @param round Round where the match belongs + * @return TRUE if the match must be locked + */ + public Boolean lockMatch(Brackets_Match__c match, Brackets_Round__c round) { + if (this.isLocked) { + return true; + } + + if (match == null || match.WinnerBrackets_Team__c != null) { + return true; + } + + return false; + } + + /** + * Return TRUE if the betting type is by round + */ + public Boolean isGroupByRound() { + if ( + this.betGroup != null && + this.betGroup.Type__c == BracketsGroupUtilities.BET_TYPE_BY_ROUND + ) { + return true; + } + + return false; + } + + //------------------------------------------------------------------------- + // Private methods + //------------------------------------------------------------------------- + + /** + * Initialize tournament + */ + private void initTournament() { + this.tournament = [ + SELECT Id, Type__c, Deadline__c + FROM Brackets_Tournament__c + WHERE Id = :tournamentId + LIMIT 1 + ]; + + this.tournamentClass += 'tournament'; + } + + /** + * Initialize rounds + */ + private void initRounds() { + this.roundsByNumber = [ + SELECT Id, Name, RoundNumber__c, Deadline__c + FROM Brackets_Round__c + WHERE Brackets_Tournament__c = :tournamentId + ORDER BY RoundNumber__c ASC + ]; + } + + /** + * Initialize matches + */ + private void initMatches() { + // Select all tournament matches + this.matchMap = new Map( + [ + SELECT + Id, + WinnerBrackets_Team__r.Name, + Brackets_Round__c, + Conference__c, + HomeBrackets_Team__c, + VisitorBrackets_Team__c, + Schedule__c, + VisitorScore__c, + HomeScore__c, + Brackets_Round__r.RoundNumber__c, + Brackets_Round__r.Name, + Position__c, + FollowingBrackets_Match__c, + FollowingIsHome__c + FROM Brackets_Match__c + WHERE Brackets_Round__r.Brackets_Tournament__c = :tournamentId + ] + ); + + for (Brackets_Match__c match : this.matchMap.values()) { + if (match.Schedule__c != null) + match.Schedule__c = Datetime.valueOfGmt( + String.valueOf(match.Schedule__c) + ); + } + + this.matchesByPosition = [ + SELECT + Id, + Conference__c, + Brackets_Round__c, + Position__c, + Schedule__c, + FollowingBrackets_Match__c, + FollowingIsHome__c + FROM Brackets_Match__c + WHERE Brackets_Round__r.Brackets_Tournament__c = :tournamentId + ORDER BY Position__c + ]; + for (Brackets_Match__c match : this.matchesByPosition) { + if (match.Schedule__c != null) + match.Schedule__c = Datetime.valueOfGmt( + String.valueOf(match.Schedule__c) + ); + } + } + + /** + * Initialize teams + */ + private void initTeams() { + // Collect tournament teams + Set teamIds = new Set(); + + for (Id mid : this.matchMap.keySet()) { + if (this.matchMap.get(mid).HomeBrackets_Team__c != null) { + teamIds.add(this.matchMap.get(mid).HomeBrackets_Team__c); + } + if (this.matchMap.get(mid).VisitorBrackets_Team__c != null) { + teamIds.add(this.matchMap.get(mid).VisitorBrackets_Team__c); + } + } + + // Select teams + this.teamMap = new Map( + [ + SELECT Id, Name, ShortName__c, Description__c + FROM Brackets_Team__c + WHERE Id IN :teamIds + ] + ); + } + + /** + * Initialize group + */ + private void initGroup() { + if (this.betGroup == null) { + this.betGroup = [ + SELECT Id, Type__c + FROM Brackets_Group__c + WHERE Id = :groupId + LIMIT 1 + ]; + } + + // Check tournament deadline + if ( + this.betGroup.Type__c == + BracketsGroupUtilities.BET_TYPE_FULL_TOURNAMENT && + this.tournament.Deadline__c <= Datetime.now() + ) { + tournamentClass += ' tournament-disabled'; + } + } + + /** + * Initialize user tournament + */ + private void initUserTournament() { + if (this.userTournamentId == null) { + this.userTournament = [ + SELECT Id + FROM Brackets_UserTournament__c + WHERE + Brackets_Group__c = :this.groupId + AND User__c = :UserInfo.getUserId() + LIMIT 1 + ]; + } else { + this.userTournament = [ + SELECT Id + FROM Brackets_UserTournament__c + WHERE Id = :this.userTournamentId + ]; + } + } + + /** + * Init user predictions + */ + private void initPredictions() { + if (this.userTournament == null) { + throw new BracketsException( + 'cannot init predicitons without a user tournament being set.' + ); + } + List ump = [ + SELECT Id, Brackets_Match__c, PredictedWinnerBrackets_Team__c + FROM Brackets_UserMatchPred__c + WHERE Brackets_UserTournament__c = :userTournament.Id + ]; + + for (Brackets_UserMatchPred__c u : ump) { + this.predictionMapByMatch.put(u.Brackets_Match__c, u); + } + + for (Brackets_Match__c m : this.matchMap.values()) { + if ( + this.predictionMapByMatch.get(m.Id) != null && + m.FollowingBrackets_Match__c != null + ) { + if (m.FollowingIsHome__c) { + this.homePredictionMap.put( + m.FollowingBrackets_Match__c, + m.Id + ); + } else { + this.visitorPredictionMap.put( + m.FollowingBrackets_Match__c, + m.Id + ); + } + } + } + } +} diff --git a/src/classes/BracketsTreeView.cls-meta.xml b/force-app/main/default/classes/BracketsTreeView.cls-meta.xml similarity index 57% rename from src/classes/BracketsTreeView.cls-meta.xml rename to force-app/main/default/classes/BracketsTreeView.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsTreeView.cls-meta.xml +++ b/force-app/main/default/classes/BracketsTreeView.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsTreeViewController.cls b/force-app/main/default/classes/BracketsTreeViewController.cls new file mode 100644 index 0000000..63a1c8e --- /dev/null +++ b/force-app/main/default/classes/BracketsTreeViewController.cls @@ -0,0 +1,137 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ +public with sharing class BracketsTreeViewController { + //------------------------------------------------------------------------- + // Constants & Variables + //------------------------------------------------------------------------- + + private BracketsTreeView baseTree = null; + + //------------------------------------------------------------------------- + // Getters and Setters + //------------------------------------------------------------------------- + + public String tournamentId { get; set; } + public Brackets_Group__c targetGroup { get; set; } + public Boolean showSaveAll { get; set; } + public String json { get; set; } + public String message { get; set; } + public String messageType { get; set; } + public Boolean isRoundByRound { get; set; } + + //component arguments + public String groupId { get; set; } + public String userTournamentId { get; set; } + public Datetime nextDeadline { get; set; } + public Integer activeRound { get; set; } + public Boolean isLocked { get; set; } + + public BracketsTreeViewFootball nflTree { get; set; } + public BracketsTreeViewStandard stdTree { get; set; } + + public Boolean getIsRenderable() { + init(); + return true; + } + + /** + * Initialize controller + */ + public void init() { + if (this.groupId == null) { + throw new BracketsException( + 'Cannot initialize without a group id. [BracketsTreeViewController]' + ); + } + if (this.isLocked == null) { + throw new BracketsException( + 'Cannot initialize without an indicator for isLocked (currently null) [BracketsTreeViewController]' + ); + } + + if (this.tournamentId == null) { + Brackets_Group__c target = [ + SELECT Id, Name, Type__c, Brackets_Tournament__c + FROM Brackets_Group__c + WHERE Id = :this.groupId + ]; + if (target == null) { + throw new BracketsException('Could not locate tournament.'); + } + this.tournamentId = target.Brackets_Tournament__c; + this.targetGroup = target; + this.isRoundByRound = + target.Type__c == BracketsGroupUtilities.BET_TYPE_BY_ROUND; + } + createTree(); + + Boolean hasStdDisabled = + this.stdTree != null && + stdTree.getTournamentClass().contains('tournament-disabled'); + Boolean hasNflDisabled = + this.nflTree != null && + this.nflTree.getTournamentClass().contains('tournament-disabled'); + + if (hasStdDisabled || hasNflDisabled) { + this.showSaveAll = false; + } else { + this.showSaveAll = true; + } + } + + //------------------------------------------------------------------------- + // Private Methods + //------------------------------------------------------------------------- + + /** + * Creates trees depending on the type + */ + public void createTree() { + this.baseTree = new BracketsTreeView( + this.tournamentId, + this.targetGroup, + this.isLocked, + this.userTournamentId + ); + + if (this.baseTree != null) { + if ( + this.baseTree.tournament.Type__c == + BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE + ) { + this.nflTree = new BracketsTreeViewFootball(this.baseTree); + } else if ( + this.baseTree.tournament.Type__c == + BracketsTournamentUtilities.STANDARD_TOURNAMENT_TYPE + ) { + this.stdTree = new BracketsTreeViewStandard(this.baseTree); + } + } + } +} diff --git a/src/classes/BracketsTreeViewController.cls-meta.xml b/force-app/main/default/classes/BracketsTreeViewController.cls-meta.xml similarity index 57% rename from src/classes/BracketsTreeViewController.cls-meta.xml rename to force-app/main/default/classes/BracketsTreeViewController.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsTreeViewController.cls-meta.xml +++ b/force-app/main/default/classes/BracketsTreeViewController.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsTreeViewControllerTest.cls b/force-app/main/default/classes/BracketsTreeViewControllerTest.cls new file mode 100644 index 0000000..6761d9e --- /dev/null +++ b/force-app/main/default/classes/BracketsTreeViewControllerTest.cls @@ -0,0 +1,28 @@ +@isTest +class BracketsTreeViewControllerTest { + @isTest + static void testConstructors() { + Brackets_Tournament__c tournament = BracketsTestUtilities.getNewStandardTournament(); + Brackets_Group__c groupp = BracketsTestUtilities.getGroup( + tournament.Id + ); + Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament( + Userinfo.getUserId(), + tournament.Id, + groupp.Id + ); + + //constructor without parameters + + BracketsTreeViewController controller = new BracketsTreeViewController(); + controller.groupId = groupp.Id; + controller.isLocked = false; + + System.assert(controller.getIsRenderable()); + + System.assert(controller.tournamentId == tournament.Id); + + System.assert(controller.nflTree == null); + System.assert(controller.stdTree != null); + } +} diff --git a/force-app/main/default/classes/BracketsTreeViewControllerTest.cls-meta.xml b/force-app/main/default/classes/BracketsTreeViewControllerTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsTreeViewControllerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsTreeViewFootball.cls b/force-app/main/default/classes/BracketsTreeViewFootball.cls new file mode 100644 index 0000000..1e129da --- /dev/null +++ b/force-app/main/default/classes/BracketsTreeViewFootball.cls @@ -0,0 +1,509 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ +public with sharing class BracketsTreeViewFootball { + //------------------------------------------------------------------------- + // Constants & Variables + //------------------------------------------------------------------------- + + public static final String CHAMPIONSHIP_FLAG = 'NFL_SUPERBOWL'; + + private BracketsTreeView parent = null; /* Prototypal inheritance */ + private Integer currentInitHeight = 0; + private Integer currentBlockHeight = 0; + + private Map nextMatchPredictionMap = new Map(); + + //------------------------------------------------------------------------- + // Getters and Setters + //------------------------------------------------------------------------- + + public List orderedAFCRounds { get; set; } + public List orderedNFCRounds { get; set; } + public BracketsTreeView.MatchData biggame { get; set; } + + public String getTournamentId() { + return this.parent.tournamentId; + } + public String getGroupId() { + return this.parent.groupId; + } + public Brackets_Tournament__c getTournament() { + return this.parent.tournament; + } + public Brackets_UserTournament__c getUserTournament() { + return this.parent.userTournament; + } + public String getTournamentClass() { + return this.parent.tournamentClass; + } + + public List getMatches() { + return this.parent.matchesByPosition; + } + + //------------------------------------------------------------------------- + // Constructors + //------------------------------------------------------------------------- + + /** + * Create a new controller instance + */ + public BracketsTreeViewFootball(BracketsTreeView parentTree) { + this.parent = parentTree; + this.orderedAFCRounds = populateRoundData( + BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN + ); + this.orderedNFCRounds = populateRoundData( + BracketsTournamentUtilities.NFL_CONFERENCE_NATIONAL + ); + this.biggame = populatebiggame(); + } + + //------------------------------------------------------------------------- + // Private methods + //------------------------------------------------------------------------- + + /** + * Populate round datatypes + * + * @param conference NFL conference (or division) + * @result List of round data + */ + private List populateRoundData( + String conference + ) { + List conferenceMatches = this.parent.filterMatchesByConference( + conference + ); + Brackets_Round__c currentRound = null; + List currentRoundMatches = new List(); + List nextRoundMatches = new List(); + + List result = new List(); + BracketsTreeView.RoundData rdt = null; + + this.currentInitHeight = 0; + this.currentBlockHeight = 0; + + for (Integer i = 0; i < 3; i++) { + currentRound = this.parent.roundsByNumber[i]; + + rdt = new BracketsTreeView.RoundData(); + rdt.round = currentRound; + rdt.className = 'round'; + + if (this.parent.isGroupByRound()) { + if ( + currentRound.Deadline__c == null || + (currentRound.Deadline__c <= Date.today()) + ) { + rdt.className += ' round-disabled'; + } + } + + // First round + if (i == 0) { + currentRoundMatches = this.parent.filterMatchesByRound( + currentRound.Id, + conferenceMatches + ); + nextRoundMatches = this.parent.getNextMatches( + currentRoundMatches + ); + } else { + // Inner round + currentRoundMatches = nextRoundMatches; + nextRoundMatches = this.parent.getNextMatches( + currentRoundMatches + ); + } + + this.currentBlockHeight = 40 * Math.pow(2, i).intValue(); + this.currentInitHeight = + this.currentInitHeight + this.currentBlockHeight / 2; + + rdt.matches = populateMatchData( + conference, + currentRound, + i, + currentRoundMatches + ); + result.add(rdt); + } + + if (conference == BracketsTournamentUtilities.NFL_CONFERENCE_NATIONAL) { + List reverseResult = new List(); + + // Reverse List + for (Integer j = (result.size() - 1); j >= 0; j--) { + reverseResult.add(result[j]); + } + + result = reverseResult; + } + + return result; + } + + /** + * Populate match datatypes + * + * @param conference NFL conference or division + * @param round Round where the match is being played + * @param roundNumber Order number of the round + * @param source List of source matches + * @return List of match data + */ + private List populateMatchData( + String conference, + Brackets_Round__c round, + Integer roundNumber, + List source + ) { + List result = new List(); + Integer matchCount = roundNumber == 0 ? 4 : (roundNumber == 1 ? 2 : 1); + Integer matchIndex = -1; + + for (Integer i = 0; i < matchCount; i++) { + if (roundNumber == 0) { + if (i == 0) { + matchIndex = 0; + } else { + if (i == 3) { + matchIndex = 1; + } else { + matchIndex = -1; + } + } + } else { + matchIndex = i; + } + //matchIndex = roundNumber == 0 ? ( i == 0 ? 0 : ( i == 3 ? 1 : -1) ) : i; + result.add( + populateMatchData( + conference, + round, + roundNumber, + (matchIndex == -1 ? null : source[matchIndex]), + i + ) + ); + } + + return result; + } + + /** + * Populate match datatype + * + * @param conference NFL conference or division + * @param round Round where the match is being played + * @param roundNumber Order number of current round + * @param match Source match + * @param matchNumber Order number of current match + * @return Match data + */ + private BracketsTreeView.MatchData populateMatchData( + String conference, + Brackets_Round__c round, + Integer roundNumber, + Brackets_Match__c match, + Integer matchNumber + ) { + BracketsTreeView.MatchData md = new BracketsTreeView.MatchData(); + + md.spacerHeight = roundNumber == 0 + ? this.currentBlockHeight + : (matchNumber == 0 + ? this.currentInitHeight + : this.currentBlockHeight); + md.blockHeight = this.currentBlockHeight - 2; + + // Empty match + if (roundNumber == 0 && (matchNumber == 1 || matchNumber == 2)) { + //updated from 'match hidden' 12/22 + md.className = 'spacer'; + } else { + // Match + md.className = 'match'; + + if (match != null) { + md.match = match; + md.home = populateTeamData( + conference, + round, + roundNumber, + match, + matchNumber, + this.parent.teamMap.get(match.HomeBrackets_Team__c), + true + ); + md.visitor = populateTeamData( + conference, + round, + roundNumber, + match, + matchNumber, + this.parent.teamMap.get(match.VisitorBrackets_Team__c), + false + ); + + if (match.WinnerBrackets_Team__c != null) { + md.winner.team = this.parent.teamMap.get( + match.WinnerBrackets_Team__c + ); + } + + if (this.parent.predictionMapByMatch.get(match.Id) != null) { + md.prediction.team = this.parent.teamMap.get( + this.parent.predictionMapByMatch.get(match.Id) + .PredictedWinnerBrackets_Team__c + ); + } + } + + // Draw spacer? + if (roundNumber == 0 && matchNumber == 0) { + md.spacer = false; + } + } + + // Conference final + if (roundNumber == 2) { + md.isFinal = true; + } + + return md; + } + + /** + * Populate team datatype + * + * @param conference NFL conference or division + * @param round Current round + * @param roundNumber Order number of current round + * @param match Current match + * @param matchNumber Order number of current match + * @param team Source team + * @param isHome True if the source team is the home team + * @return Team data + */ + private BracketsTreeView.TeamData populateTeamData( + String conference, + Brackets_Round__c round, + Integer roundNumber, + Brackets_Match__c match, + Integer matchNumber, + Brackets_Team__c team, + Boolean isHome + ) { + BracketsTreeView.TeamData td = new BracketsTreeView.TeamData(); + Boolean locked = true; + Brackets_Team__c predTeam = null; + Id predId = null; + Id predMatchId = null; + + td.className = 'team'; + td.className += isHome ? ' home' : ' visitor'; + + if (conference == CHAMPIONSHIP_FLAG) { + td.className += isHome ? ' champion-left' : ' champion-right'; + } else { + // Tree nodes + if ( + roundNumber == 2 || + (roundNumber == 1 && + ((matchNumber == 0 && isHome) || (matchNumber == 1 && !isHome))) + ) { + td.className += ' inner'; + } + } + + // Match locked/unlocked + if (!this.parent.lockMatch(match, round)) { + locked = false; + if (conference != CHAMPIONSHIP_FLAG) { + td.className += ' unlocked '; + } + } + + if (!locked) { + td.className += ' draggable '; + } + + // Score + td.score = isHome + ? match.HomeScore__c.intValue() + : match.VisitorScore__c.intValue(); + + // Prediction + if (isHome && this.parent.homePredictionMap.get(match.Id) != null) { + predMatchId = this.parent.homePredictionMap.get(match.Id); + predTeam = this.parent.teamMap.get( + this.parent.predictionMapByMatch.get(predMatchId) + .PredictedWinnerBrackets_Team__c + ); + + td.predId = this.parent.predictionMapByMatch.get(predMatchId).Id; + } else if ( + !isHome && this.parent.visitorPredictionMap.get(match.Id) != null + ) { + predMatchId = this.parent.visitorPredictionMap.get(match.Id); + predTeam = this.parent.teamMap.get( + this.parent.predictionMapByMatch.get(predMatchId) + .PredictedWinnerBrackets_Team__c + ); + + td.predId = this.parent.predictionMapByMatch.get(predMatchId).Id; + } + + // Team + if (team != null && predTeam != null) { + td.team = team; + td.predicted = predTeam; + td.className += predTeam.Id == team.Id ? ' success' : ' failure'; + } else if (team != null && predTeam == null) { + td.team = team; + } else if (team == null && predTeam != null) { + td.predicted = predTeam; + td.className += ' prediction droppable'; + } else { + td.className += conference != CHAMPIONSHIP_FLAG + ? ' team-empty droppable' + : ' champion-empty droppable'; + } + + return td; + } + + /** + * Populate final + */ + private BracketsTreeView.MatchData populatebiggame() { + Brackets_Round__c lastRound = this.parent.roundsByNumber[ + this.parent.roundsByNumber.size() - 1 + ]; + Integer lastRoundNumber = lastRound.RoundNumber__c.intValue(); + Brackets_Match__c sbmatch; + Brackets_Team__c champion; + BracketsTreeView.MatchData sbmdata = new BracketsTreeView.MatchData(); + BracketsTreeView.TeamData td = new BracketsTreeView.TeamData(); + Brackets_Team__c predTeam = null; + + sbmdata.className = 'match'; + + // Block round + if (this.parent.isGroupByRound()) { + if ( + lastRound.Deadline__c == null || + (lastRound.Deadline__c <= Date.today()) + ) { + sbmdata.extraInfo = 'round-disabled'; + } + } + + // Filter matches + for (Brackets_Match__c m : this.parent.matchMap.values()) { + if ( + m.Brackets_Round__r.RoundNumber__c.intValue() == lastRoundNumber + ) { + sbmatch = m; + break; + } + } + + champion = this.parent.teamMap.get(sbmatch.WinnerBrackets_Team__c); + + // Populate Home/Visitor + sbmdata.match = sbmatch; + sbmdata.home = populateTeamData( + CHAMPIONSHIP_FLAG, + lastRound, + lastRoundNumber, + sbmatch, + 0, + this.parent.teamMap.get(sbmatch.HomeBrackets_Team__c), + true + ); + sbmdata.visitor = populateTeamData( + CHAMPIONSHIP_FLAG, + lastRound, + lastRoundNumber, + sbmatch, + 0, + this.parent.teamMap.get(sbmatch.VisitorBrackets_Team__c), + false + ); + + if (sbmatch.WinnerBrackets_Team__c != null) { + sbmdata.winner.team = this.parent.teamMap.get( + sbmatch.WinnerBrackets_Team__c + ); + } + + if (this.parent.predictionMapByMatch.get(sbmatch.Id) != null) { + sbmdata.prediction.team = this.parent.teamMap.get( + this.parent.predictionMapByMatch.get(sbmatch.Id) + .PredictedWinnerBrackets_Team__c + ); + } + + // biggame champion + td.className = 'team superchampion'; + + // biggame prediction + if (this.parent.predictionMapByMatch.get(sbmatch.Id) != null) { + td.predId = this.parent.predictionMapByMatch.get(sbmatch.Id).Id; + predTeam = this.parent.teamMap.get( + this.parent.predictionMapByMatch.get(sbmatch.Id) + .PredictedWinnerBrackets_Team__c + ); + } + + // Champion + if (champion != null && predTeam != null) { + td.team = champion; + td.predicted = predTeam; + td.className += predTeam.Id == champion.Id + ? ' success' + : ' failure'; + } else if (champion != null && predTeam == null) { + td.team = champion; + } else if (champion == null && predTeam != null) { + td.predicted = predTeam; + td.className += ' prediction droppable'; + } else { + td.className += ' superchampion-empty droppable'; + } + + sbmdata.champion = td; + + return sbmdata; + } +} diff --git a/src/classes/BracketsTreeViewFootball.cls-meta.xml b/force-app/main/default/classes/BracketsTreeViewFootball.cls-meta.xml similarity index 57% rename from src/classes/BracketsTreeViewFootball.cls-meta.xml rename to force-app/main/default/classes/BracketsTreeViewFootball.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsTreeViewFootball.cls-meta.xml +++ b/force-app/main/default/classes/BracketsTreeViewFootball.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsTreeViewStandard.cls b/force-app/main/default/classes/BracketsTreeViewStandard.cls new file mode 100644 index 0000000..4541176 --- /dev/null +++ b/force-app/main/default/classes/BracketsTreeViewStandard.cls @@ -0,0 +1,355 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +public with sharing class BracketsTreeViewStandard { + //------------------------------------------------------------------------- + // Constants & Variables + //------------------------------------------------------------------------- + + public static final String FINAL_FLAG = 'CHAMPIONSHIP'; + + private BracketsTreeView parent = null; + private Integer currentInitHeight = 0; + private Integer currentBlockHeight = 0; + + //------------------------------------------------------------------------- + // Getters and Setters + //------------------------------------------------------------------------- + + public List orderedRounds { get; set; } + + public String getTournamentId() { + return this.parent.tournamentId; + } + public String getGroupId() { + return this.parent.groupId; + } + public Brackets_Tournament__c getTournament() { + return this.parent.tournament; + } + public Brackets_UserTournament__c getUserTournament() { + return this.parent.userTournament; + } + public String getTournamentClass() { + return this.parent.tournamentClass; + } + + public List getMatches() { + return this.parent.matchesByPosition; + } + + //------------------------------------------------------------------------- + // Constructors + //------------------------------------------------------------------------- + + /** + * Create a new controller instance + */ + public BracketsTreeViewStandard(BracketsTreeView parentTree) { + this.parent = parentTree; + this.orderedRounds = populateRoundData(); + } + + //------------------------------------------------------------------------- + // Private methods + //------------------------------------------------------------------------- + + /** + * Populate round datatypes + */ + private List populateRoundData() { + Brackets_Round__c currentRound = null; + List currentRoundMatches = new List(); + List nextRoundMatches = new List(); + + List result = new List(); + BracketsTreeView.RoundData rdt = null; + Integer roundTotal = this.parent.roundsByNumber.size() - 1; + + this.currentInitHeight = 0; + this.currentBlockHeight = 0; + + for (Integer i = 0; i < this.parent.roundsByNumber.size(); i++) { + currentRound = this.parent.roundsByNumber[i]; + + rdt = new BracketsTreeView.RoundData(); + rdt.round = currentRound; + rdt.className = 'round'; + + // Block round + //RSC Legacy + /* + if( this.parent.isGroupByRound() ){ + if( currentRound.Deadline__c == null || (currentRound.Deadline__c <= Date.today()) ){ + rdt.className += ' round-disabled'; + } + } + */ + + // First round + if (i == 0) { + currentRoundMatches = this.parent.filterMatchesByRound( + currentRound.Id, + this.parent.matchesByPosition + ); + nextRoundMatches = this.parent.getNextMatches( + currentRoundMatches + ); + } else if (i == roundTotal) { + // Final + currentRoundMatches = nextRoundMatches; + } else { + // Inner round + currentRoundMatches = nextRoundMatches; + nextRoundMatches = this.parent.getNextMatches( + currentRoundMatches + ); + } + + this.currentBlockHeight = 40 * Math.pow(2, i).intValue(); + + rdt.matches = populateMatchData( + currentRound, + i, + currentRoundMatches, + (i == roundTotal ? true : false) + ); + result.add(rdt); + } + + return result; + } + + /** + * Populate match datatypes + */ + private List populateMatchData( + Brackets_Round__c round, + Integer roundNumber, + List source, + Boolean isFinal + ) { + List result = new List(); + + for (Integer i = 0; i < source.size(); i++) { + result.add( + populateMatchData(round, roundNumber, source[i], i, isFinal) + ); + } + + return result; + } + + /** + * Populate match datatype + */ + private BracketsTreeView.MatchData populateMatchData( + Brackets_Round__c round, + Integer roundNumber, + Brackets_Match__c match, + Integer matchNumber, + Boolean isFinal + ) { + BracketsTreeView.MatchData md = new BracketsTreeView.MatchData(); + + md.isFinal = isFinal; + md.className = 'match'; + md.spacerHeight = roundNumber == 0 + ? this.currentBlockHeight + : (matchNumber == 0 + ? this.currentInitHeight + : this.currentBlockHeight); + md.blockHeight = this.currentBlockHeight - 2; + + if (matchNumber == 0) { + this.currentInitHeight = this.currentBlockHeight / 2; + } + + if (match != null) { + md.match = match; + md.home = populateTeamData( + round, + roundNumber, + match, + this.parent.teamMap.get(match.HomeBrackets_Team__c), + true + ); + md.visitor = populateTeamData( + round, + roundNumber, + match, + this.parent.teamMap.get(match.VisitorBrackets_Team__c), + false + ); + + if (match.WinnerBrackets_Team__c != null) { + md.winner.team = this.parent.teamMap.get( + match.WinnerBrackets_Team__c + ); + } + + if (this.parent.predictionMapByMatch.get(match.Id) != null) { + md.prediction.team = this.parent.teamMap.get( + this.parent.predictionMapByMatch.get(match.Id) + .PredictedWinnerBrackets_Team__c + ); + } + } + + // Draw spacer? + if (roundNumber == 0 && matchNumber == 0) { + md.spacer = false; + } + + // Champion + if (isFinal) { + md.champion = populateChampion( + match, + this.parent.teamMap.get(match.WinnerBrackets_Team__c) + ); + } + + return md; + } + + /** + * Populate team datatype + */ + private BracketsTreeView.TeamData populateTeamData( + Brackets_Round__c round, + Integer roundNumber, + Brackets_Match__c match, + Brackets_Team__c team, + Boolean isHome + ) { + BracketsTreeView.TeamData td = new BracketsTreeView.TeamData(); + Boolean locked = true; + Brackets_Team__c predTeam = null; + Id predId = null; + Id predMatchId = null; + + td.className = 'team'; + td.className += isHome ? ' home' : ' visitor'; + + // Not first round + if (roundNumber != 0) { + td.className += ' inner'; + } + + // Match locked/unlocked + if (!this.parent.lockMatch(match, round)) { + locked = false; + td.className += ' unlocked'; + } + + // Score + td.score = isHome + ? match.HomeScore__c.intValue() + : match.VisitorScore__c.intValue(); + + // Prediction + if (isHome && this.parent.homePredictionMap.get(match.Id) != null) { + predMatchId = this.parent.homePredictionMap.get(match.Id); + predTeam = this.parent.teamMap.get( + this.parent.predictionMapByMatch.get(predMatchId) + .PredictedWinnerBrackets_Team__c + ); + + td.predId = this.parent.predictionMapByMatch.get(predMatchId).Id; + } else if ( + !isHome && this.parent.visitorPredictionMap.get(match.Id) != null + ) { + predMatchId = this.parent.visitorPredictionMap.get(match.Id); + predTeam = this.parent.teamMap.get( + this.parent.predictionMapByMatch.get(predMatchId) + .PredictedWinnerBrackets_Team__c + ); + + td.predId = this.parent.predictionMapByMatch.get(predMatchId).Id; + } + + // Team + if (team != null && predTeam != null) { + td.team = team; + td.predicted = predTeam; + td.className += predTeam.Id == team.Id ? ' success' : ' failure'; + } else if (team != null && predTeam == null) { + td.team = team; + } else if (team == null && predTeam != null) { + td.predicted = predTeam; + td.className += ' prediction droppable'; + } else { + td.className += ' team-empty droppable'; + } + + td.className += !locked ? ' draggable' : ''; + + return td; + } + + /** + * Populate final + */ + private BracketsTreeView.TeamData populateChampion( + Brackets_Match__c match, + Brackets_Team__c champion + ) { + BracketsTreeView.TeamData td = new BracketsTreeView.TeamData(); + Brackets_Team__c predTeam = null; + + td.className = 'team champion'; + + // Prediction + if (this.parent.predictionMapByMatch.get(match.Id) != null) { + td.predId = this.parent.predictionMapByMatch.get(match.Id).Id; + predTeam = this.parent.teamMap.get( + this.parent.predictionMapByMatch.get(match.Id) + .PredictedWinnerBrackets_Team__c + ); + } + + // Champion + if (champion != null && predTeam != null) { + td.team = champion; + td.predicted = predTeam; + td.className += predTeam.Id == champion.Id + ? ' success' + : ' failure'; + } else if (champion != null && predTeam == null) { + td.team = champion; + } else if (champion == null && predTeam != null) { + td.predicted = predTeam; + td.className += ' prediction droppable'; + } else { + td.className += ' champion-empty droppable'; + } + + return td; + } +} diff --git a/src/classes/BracketsTreeViewStandard.cls-meta.xml b/force-app/main/default/classes/BracketsTreeViewStandard.cls-meta.xml similarity index 57% rename from src/classes/BracketsTreeViewStandard.cls-meta.xml rename to force-app/main/default/classes/BracketsTreeViewStandard.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsTreeViewStandard.cls-meta.xml +++ b/force-app/main/default/classes/BracketsTreeViewStandard.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsTreeViewTest.cls b/force-app/main/default/classes/BracketsTreeViewTest.cls new file mode 100644 index 0000000..8d9b0f0 --- /dev/null +++ b/force-app/main/default/classes/BracketsTreeViewTest.cls @@ -0,0 +1,391 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ +@isTest +private class BracketsTreeViewTest { + @isTest + static void testStandardTree() { + BracketsTournamentUtilities.CreatingTournamentTree = true; + + //Create a user + User testUser = BracketsTestUtilities.createUser(); + + System.runAs(testUser) { + Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament( + 'Test1 General Prediction Controller', + 4 + ); + + Brackets_Group__c groupp = BracketsTestUtilities.getGroup( + tournament.Id + ); + + Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); + Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team'); + Brackets_Team__c teamC = BracketsTestUtilities.createTeam('C-Team'); + Brackets_Team__c teamD = BracketsTestUtilities.createTeam('D-Team'); + + List auxList = new List(); + auxList.add(teamA); + auxList.add(teamB); + auxList.add(teamC); + auxList.add(teamD); + upsert auxList; + + Brackets_Round__c round = BracketsTestUtilities.createRound( + tournament, + 1, + null, + 4, + 'Round1-Test' + ); + + Brackets_Round__c round2 = BracketsTestUtilities.createRound( + tournament, + 2, + null, + 8, + 'Round2-Test' + ); + + Brackets_Match__c match = BracketsTestUtilities.createMatch( + teamA, + teamB, + round, + BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN + ); + + Brackets_Match__c match2 = BracketsTestUtilities.createMatch( + teamC, + teamD, + round, + BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN + ); + + round.Deadline__c = match.schedule__c.addMinutes(-5); + update round; + + Brackets_Match__c match3 = BracketsTestUtilities.createMatch( + null, + null, + round2, + BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN + ); + round2.Deadline__c = match3.schedule__c.addMinutes(-5); + update round2; + + match.FollowingBrackets_Match__c = match3.id; + match.FollowingIsHome__c = true; + update match; + + match2.FollowingBrackets_Match__c = match3.id; + update match2; + + Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament( + Userinfo.getUserId(), + tournament.Id, + groupp.Id + ); + + //build the base controller + BracketsTreeView tree = new BracketsTreeView( + tournament.id, + groupp, + false, + null + ); + + //test basics + System.assert(tree.tournament != null); + System.assert(tree.teamMap.size() == auxList.size()); + System.assert(tree.roundsByNumber.size() == 2); + System.assert(tree.matchesByPosition.size() == 3); + + //now we should test the tree view standard + BracketsTreeViewStandard standard = new BracketsTreeViewStandard( + tree + ); + + //so some additional tests + System.assert(standard.orderedRounds != null); + System.assert(standard.orderedRounds.size() == 2); + System.assert(standard.getTournamentId() == '' + tournament.id); + System.assert(standard.getGroupId() == '' + groupp.id); + + //lets do some work on the orderedRounds + for (BracketsTreeView.RoundData current : standard.orderedRounds) { + System.assert(current.matches != null); + System.assert(current.round != null); + } + BracketsTreeView.RoundData postRound1 = standard.orderedRounds.get( + 0 + ); + System.assert(postRound1.matches.size() == 2); + BracketsTreeView.MatchData postMatch1 = postRound1.matches.get(0); + System.assert(postMatch1.match != null); + System.assert(postMatch1.home != null); + System.assert(postMatch1.home.team.Name == teamA.name); + System.assert(postMatch1.visitor.team.Name == teamB.name); + + BracketsTreeView.MatchData postMatch2 = postRound1.matches.get(1); + System.assert(postMatch2.match != null); + System.assert(postMatch2.home != null); + System.assert(postMatch2.home.team.Name == teamC.name); + System.assert(postMatch2.visitor.team.Name == teamD.name); + + BracketsTreeView.RoundData postRound2 = standard.orderedRounds.get( + 1 + ); + System.debug('postRound2: ' + postRound2); + System.assert(postRound2.matches.size() == 1); + BracketsTreeView.MatchData postMatch3 = postRound2.matches.get(0); + System.assert(postMatch3.match != null); + System.assert(postMatch3.home != null); + System.assert(postMatch3.home.team == null); + System.assert(postMatch3.visitor != null); + System.assert(postMatch3.visitor.team == null); + + //lets turn off + BracketsTournamentUtilities.CreatingTournamentTree = true; + + //now let's create a prediction or two + Brackets_UserMatchPred__c p1 = BracketsTestUtilities.createPrediction( + userTournament, + match, + teamA + ); + Brackets_UserMatchPred__c p2 = BracketsTestUtilities.createPrediction( + userTournament, + match2, + teamD + ); + Brackets_UserMatchPred__c p3 = BracketsTestUtilities.createPrediction( + userTournament, + match3, + teamA + ); + + //now let's mark one team a winner + match.WinnerBrackets_Team__c = teamA.Id; + match.HomeScore__c = 10; + update match; + + //now let's rebuild some objects and see how it looks + tree = new BracketsTreeView(tournament.id, groupp, false, null); + standard = new BracketsTreeViewStandard(tree); + + //double check a few things + postRound1 = standard.orderedRounds.get(0); + System.assert(postRound1.matches.size() == 2); + postMatch1 = postRound1.matches.get(0); + System.assert(postMatch1.match != null); + System.assert(postMatch1.home != null); + System.assert(postMatch1.home.team.Name == teamA.name); + System.assert(postMatch1.home.predicted == null); + System.assert(postMatch1.visitor.team.Name == teamB.name); + System.assert(postMatch1.visitor.predicted == null); + System.assert(postMatch1.winner.team != null); + System.assert(postMatch1.winner.team.Name == teamA.name); + + postMatch2 = postRound1.matches.get(1); + System.assert(postMatch2.match != null); + System.assert(postMatch2.home != null); + System.assert(postMatch2.home.team.Name == teamC.name); + System.assert(postMatch2.visitor.team.Name == teamD.name); + System.assert(postMatch2.winner.team == null); + System.assert(postMatch2.prediction.team.Name == teamD.name); + + postRound2 = standard.orderedRounds.get(1); + System.assert(postRound2.matches.size() == 1); + postMatch3 = postRound2.matches.get(0); + System.assert(postMatch3.match != null); + System.assert(postMatch3.home.team == null); + System.assert(postMatch3.home.predicted != null); + System.assert(postMatch3.champion != null); + + System.assert(postMatch3.visitor != null); + System.assert(postMatch3.visitor.team == null); + } + + } + + @isTest + static void testFootballTree() { + BracketsTournamentUtilities.CreatingTournamentTree = false; + + //Create a user + User testUser = BracketsTestUtilities.createUser(); + + System.runAs(testUser) { + Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament( + 'Small Season 2010', + 12, + BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE + ); + + Brackets_Group__c groupp = BracketsTestUtilities.getGroup( + tournament.Id + ); + + Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); + Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team'); + Brackets_Team__c teamC = BracketsTestUtilities.createTeam('C-Team'); + Brackets_Team__c teamD = BracketsTestUtilities.createTeam('D-Team'); + Brackets_Team__c teamE = BracketsTestUtilities.createTeam('E-Team'); + Brackets_Team__c teamF = BracketsTestUtilities.createTeam('F-Team'); + Brackets_Team__c teamG = BracketsTestUtilities.createTeam('G-Team'); + Brackets_Team__c teamH = BracketsTestUtilities.createTeam('H-Team'); + Brackets_Team__c teamI = BracketsTestUtilities.createTeam('I-Team'); + Brackets_Team__c teamJ = BracketsTestUtilities.createTeam('J-Team'); + Brackets_Team__c teamK = BracketsTestUtilities.createTeam('K-Team'); + Brackets_Team__c teamL = BracketsTestUtilities.createTeam('L-Team'); + + List auxList = new List(); + auxList.add(teamA); + auxList.add(teamB); + auxList.add(teamC); + auxList.add(teamD); + auxList.add(teamE); + auxList.add(teamF); + auxList.add(teamG); + auxList.add(teamH); + auxList.add(teamI); + auxList.add(teamJ); + auxList.add(teamK); + auxList.add(teamL); + upsert auxList; + + //let's make sure we have four rounds + List rounds = [ + SELECT Id, Name, Deadline__c + FROM Brackets_Round__c + WHERE Brackets_Tournament__c = :tournament.id + ORDER BY RoundNumber__c + ]; + System.assert(rounds.size() == 4); + + //make sure that round 0 has 4 matches + Brackets_Round__c r = rounds.get(0); + List matches = [ + SELECT + Id, + Name, + Conference__c, + Position__c, + FollowingBrackets_Match__c + FROM Brackets_Match__c + WHERE Brackets_Round__c = :r.id + ORDER BY Position__c + ]; + System.assert(matches.size() == 4); + + Brackets_Match__c m1 = matches.get(0); + m1.HomeBrackets_Team__c = teamA.id; + m1.VisitorBrackets_Team__c = teamB.id; + + Brackets_Match__c m2 = matches.get(1); + m2.HomeBrackets_Team__c = teamC.id; + m2.VisitorBrackets_Team__c = teamD.id; + + Brackets_Match__c m3 = matches.get(2); + m3.HomeBrackets_Team__c = teamE.id; + m3.VisitorBrackets_Team__c = teamF.id; + + Brackets_Match__c m4 = matches.get(3); + m4.HomeBrackets_Team__c = teamG.id; + m4.VisitorBrackets_Team__c = teamH.id; + + update matches; + + Brackets_Round__c r2 = rounds.get(1); + List matches2 = [ + SELECT + Id, + Name, + Conference__c, + Position__c, + FollowingBrackets_Match__c + FROM Brackets_Match__c + WHERE Brackets_Round__c = :r2.id + ORDER BY Position__c + ]; + + Brackets_Match__c m5 = matches2.get(0); + //m5.HomeBrackets_Team__c = teamA.id; + m5.VisitorBrackets_Team__c = teamI.id; + System.assert(m1.FollowingBrackets_Match__c == m5.Id); + + Brackets_Match__c m6 = matches2.get(1); + m6.HomeBrackets_Team__c = teamJ.id; + //m5.VisitorBrackets_Team__c = teamI.id; + System.assert(m2.FollowingBrackets_Match__c == m6.Id); + + Brackets_Match__c m7 = matches2.get(2); + //m7.HomeBrackets_Team__c = teamK.id; + m7.VisitorBrackets_Team__c = teamK.id; + System.assert(m3.FollowingBrackets_Match__c == m7.Id); + + Brackets_Match__c m8 = matches2.get(3); + m8.HomeBrackets_Team__c = teamL.id; + //m8.VisitorBrackets_Team__c = teamL.id; + System.assert(m4.FollowingBrackets_Match__c == m8.Id); + + update matches2; + + //now start to get a bunch of the football tree + Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament( + Userinfo.getUserId(), + tournament.Id, + groupp.Id + ); + + //build the base controller + BracketsTreeView tree = new BracketsTreeView( + tournament.id, + groupp, + false, + null + ); + + //test basics + System.assert(tree.tournament != null); + System.assert(tree.teamMap.size() == auxList.size()); + System.assert(tree.roundsByNumber.size() == 4); + System.assert(tree.matchesByPosition.size() == 11); + + //now we should test the tree view football + BracketsTreeViewFootball football = new BracketsTreeViewFootball( + tree + ); + + //make sure some of the basics work + System.assert(football.orderedAFCRounds.size() == 3); + System.assert(football.orderedNFCRounds.size() == 3); + } + } +} diff --git a/src/classes/BracketsTreeViewTest.cls-meta.xml b/force-app/main/default/classes/BracketsTreeViewTest.cls-meta.xml similarity index 57% rename from src/classes/BracketsTreeViewTest.cls-meta.xml rename to force-app/main/default/classes/BracketsTreeViewTest.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsTreeViewTest.cls-meta.xml +++ b/force-app/main/default/classes/BracketsTreeViewTest.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsTriggerUtilities.cls b/force-app/main/default/classes/BracketsTriggerUtilities.cls new file mode 100644 index 0000000..9b9a016 --- /dev/null +++ b/force-app/main/default/classes/BracketsTriggerUtilities.cls @@ -0,0 +1,149 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +public with sharing class BracketsTriggerUtilities { + //Brackets_Match__c + public static List triggerMatchList = new List(); + public static Map triggerMatchMap = new Map(); + public static List triggerMatchIds = new List(); + public static Map triggerListObject = new Map(); + + //Brackets_Round__c + public static List triggerRoundList = new List(); + public static Map triggerRoundMap = new Map(); + public static List triggerRoundIds = new List(); + public static Map triggerRoundObject = new Map(); + + //Brackets_Tournament__c + public static List triggerTournamentList = new List(); + public static Map triggerTournamentMap = new Map(); + public static List triggerTournamentIds = new List(); + public static Map triggerTournamentObject = new Map(); + + /** + * Populate all list if are not yet. + * @params matchList : Get the list of current Matchs + */ + public static void newTriggerInstance(List matchList) { + if ( + BracketsTriggerUtilities.triggerTournamentList.isEmpty() && + !matchList.isEmpty() + ) { + List auxMatch = new List(); + String auxTourId; + for (Brackets_Match__c mi : matchList) { + auxMatch.add(mi.Id); + } + for (Brackets_Match__c t : [ + SELECT Brackets_Round__r.Brackets_Tournament__c + FROM Brackets_Match__c + WHERE Id IN :auxMatch + ]) { + auxTourId = t.Brackets_Round__r.Brackets_Tournament__c; + break; + } + + for (Brackets_Tournament__c t : [ + SELECT + t.isChild__c, + t.Version__c, + t.Update_Source__c, + t.Type__c, + t.TeamCount__c, + t.Start__c, + t.Allow_Update__c, + t.Name, + t.MaxRoundNumber__c, + t.Id, + t.ExternalId__c, + t.End__c, + t.Description__c, + t.CronTrigger__c, + ( + SELECT + Id, + Name, + Deadline__c, + ExternalId__c, + RoundNumber__c, + ScorePoints__c, + End__c, + MinScheduleBrackets_Match__c, + Start__c, + Brackets_Tournament__c + FROM Rounds__r + ) + FROM Brackets_Tournament__c t + WHERE t.Id = :auxTourId + ]) { + //-------- Populate the Different List and Maps -----------------// + + //Tournament + BracketsTriggerUtilities.triggerTournamentList.add(t); + BracketsTriggerUtilities.triggerTournamentMap.put(t.Id, t); + BracketsTriggerUtilities.triggerTournamentIds.add(t.Id); + + //Rounds + for (Brackets_Round__c r : t.Rounds__r) { + BracketsTriggerUtilities.triggerRoundList.add(r); + BracketsTriggerUtilities.triggerRoundIds.add(r.Id); + BracketsTriggerUtilities.triggerRoundMap.put(r.Id, r); + } + } //EndFor + + //Populate Brackets_Match__c with all matches for this tournament + for (Brackets_Match__c m : [ + SELECT + m.WinnerBrackets_Team__c, + m.VisitorBrackets_Team__c, + m.VisitorScore__c, + m.Schedule__c, + m.Brackets_Round__c, + m.Position__c, + m.Name, + m.Id, + m.HomeBrackets_Team__c, + m.HomeScore__c, + m.FollowingBrackets_Match__c, + m.FollowingIsHome__c, + m.ExternalId__c, + m.Description__c, + m.Conference__c + FROM Brackets_Match__c m + WHERE + m.Brackets_Round__c IN :BracketsTriggerUtilities.triggerRoundIds + ]) { + //-------- Populate Match List and Maps -----------------// + BracketsTriggerUtilities.triggerMatchList.add(m); + BracketsTriggerUtilities.triggerMatchIds.add(m.Id); + BracketsTriggerUtilities.triggerMatchMap.put(m.Id, m); + } + } //EndIf + } +} diff --git a/src/classes/BracketsTriggerUtilities.cls-meta.xml b/force-app/main/default/classes/BracketsTriggerUtilities.cls-meta.xml similarity index 57% rename from src/classes/BracketsTriggerUtilities.cls-meta.xml rename to force-app/main/default/classes/BracketsTriggerUtilities.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsTriggerUtilities.cls-meta.xml +++ b/force-app/main/default/classes/BracketsTriggerUtilities.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsUserMatchJSONObjectHandler.cls b/force-app/main/default/classes/BracketsUserMatchJSONObjectHandler.cls new file mode 100644 index 0000000..857a9e3 --- /dev/null +++ b/force-app/main/default/classes/BracketsUserMatchJSONObjectHandler.cls @@ -0,0 +1,87 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +public with sharing class BracketsUserMatchJSONObjectHandler { + public static final String matchKey = 'matchId'; + public static final String teamKey = 'teamId'; + public static final String userMatchPredictionKey = 'userPred'; + public static final String userTournamentKey = 'userTour'; + + public List matchesPredictionList; + + /** + * Constructor + */ + public BracketsUserMatchJSONObjectHandler() { + matchesPredictionList = new List(); + } + + /** + * Given an string with json, map this to a map of sObject. + * + * @param jsonString a string containing a json array + */ + public void processJSON(String jsonString) { + Brackets_UserMatchPred__c userMatchPrediction; + String userMatchPredId; + BracketsJSONObject bracketsjsonObjectChild; + BracketsJSONObject bracketsjsonObject; + try { + bracketsjsonObject = new BracketsJSONObject( + new BracketsJSONObject.JSONTokener(jsonString) + ); + for (String key : bracketsjsonObject.keys()) { + bracketsjsonObjectChild = bracketsjsonObject.getValue(key).obj; + userMatchPrediction = createMatchPredictionSObject( + bracketsjsonObjectChild + ); + matchesPredictionList.add(userMatchPrediction); + } + } catch (BracketsJSONObject.JSONException e) { + throw (Exception) e; + } + } + + private Brackets_UserMatchPred__c createMatchPredictionSObject( + BracketsJSONObject bracketsjsonObject + ) { + Brackets_UserMatchPred__c userMatchPrediction = new Brackets_UserMatchPred__c(); + String teamId = (String) bracketsjsonObject.get(teamKey); + String matchId = (String) bracketsjsonObject.get(matchKey); + String userTournamentId = (String) bracketsjsonObject.get( + userTournamentKey + ); + if (teamId != '') { + userMatchPrediction.PredictedWinnerBrackets_Team__c = (Id) teamId; + } + userMatchPrediction.Brackets_Match__c = (Id) matchId; + userMatchPrediction.Brackets_UserTournament__c = (Id) userTournamentId; + return userMatchPrediction; + } +} diff --git a/src/classes/BracketsUserMatchJSONObjectHandler.cls-meta.xml b/force-app/main/default/classes/BracketsUserMatchJSONObjectHandler.cls-meta.xml similarity index 57% rename from src/classes/BracketsUserMatchJSONObjectHandler.cls-meta.xml rename to force-app/main/default/classes/BracketsUserMatchJSONObjectHandler.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsUserMatchJSONObjectHandler.cls-meta.xml +++ b/force-app/main/default/classes/BracketsUserMatchJSONObjectHandler.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsUserMatchJSONObjectHandlerTest.cls b/force-app/main/default/classes/BracketsUserMatchJSONObjectHandlerTest.cls new file mode 100644 index 0000000..18d03b5 --- /dev/null +++ b/force-app/main/default/classes/BracketsUserMatchJSONObjectHandlerTest.cls @@ -0,0 +1,76 @@ +@isTest +class BracketsUserMatchJSONObjectHandlerTest { + @isTest + static void testProcessJSON() { + Brackets_Tournament__c tournament = BracketsTestUtilities.getNewStandardTournament(); + Brackets_Group__c groupp = BracketsTestUtilities.getGroup( + tournament.Id + ); + Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); + Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team'); + + List auxList = new List(); + auxList.add(teamA); + auxList.add(teamB); + upsert auxList; + + Brackets_Round__c round = BracketsTestUtilities.createSimpleRound( + tournament + ); + Brackets_Match__c match = BracketsTestUtilities.createMatch( + teamA, + teamB, + round, + null + ); + Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament( + Userinfo.getUserId(), + tournament.Id, + groupp.Id + ); + String jsonString = + '{ "0" : { "matchId" : "' + + match.Id + + '" ,"userTour" : "' + + userTournament.Id + + '", "teamId" : "' + + teamA.Id + + '" , "userPred" : "" }}'; + + BracketsUserMatchJSONObjectHandler handler = new BracketsUserMatchJSONObjectHandler(); + handler.processJSON(jsonString); + System.assert( + handler.matchesPredictionList.size() == 1, + 'Should have a user match prediction empty at least.' + ); + Brackets_UserMatchPred__c prediction = handler.matchesPredictionList.get( + 0 + ); + System.assert( + prediction.Brackets_Match__c == match.Id && + prediction.Brackets_UserTournament__c == userTournament.Id && + prediction.PredictedWinnerBrackets_Team__c == teamA.Id, + 'This prediction should have a match ' + + match.Id + + ' ,an userTournament ' + + userTournament.Id + + ' and a predictedWinnerTeam ' + + teamA.Id + ); + } + + @isTest + static void testProcessWrongJSON() { + String jsonString = ' "0" : { "matchId" : "" ,"userTour" : "", "teamId" : "" , "userPred" : "" }}'; + BracketsUserMatchJSONObjectHandler handler = new BracketsUserMatchJSONObjectHandler(); + try { + handler.processJSON(jsonString); + System.assert(false, 'This line shouldn\'t be executed'); + } catch (Exception e) { + System.assert( + true, + 'An error should happen when parsing the JSON.' + ); + } + } +} diff --git a/force-app/main/default/classes/BracketsUserMatchJSONObjectHandlerTest.cls-meta.xml b/force-app/main/default/classes/BracketsUserMatchJSONObjectHandlerTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsUserMatchJSONObjectHandlerTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/classes/BracketsUserTournamentUtilities.cls b/force-app/main/default/classes/BracketsUserTournamentUtilities.cls new file mode 100644 index 0000000..665788c --- /dev/null +++ b/force-app/main/default/classes/BracketsUserTournamentUtilities.cls @@ -0,0 +1,210 @@ +/* +Copyright (c) 2011, salesforce.com, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name of the salesforce.com, Inc. nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +*/ + +public with sharing class BracketsUserTournamentUtilities { + public static String userTournamentAlreadyRegisteredError = 'You were already registered to this tournament.'; + + /** + * Given a user id returns all the matche predictions of him. + * + * @param user user to obtain the info. + * @return a list of user tournaments. + */ + public static List getUserTournamentsFromUser( + Id user + ) { + List userTournamentList = new List(); + Map userTournamentMap = new Map(); + for (Brackets_UserTournament__c userTournament : [ + SELECT + Id, + Brackets_Tournament__r.Id, + Brackets_Tournament__r.Name, + Brackets_Group__c, + Brackets_Tournament__c, + User__c + FROM Brackets_UserTournament__c + WHERE user__c = :user + ]) { + userTournamentMap.put( + userTournament.Brackets_Tournament__r.Id, + userTournament + ); + } + for (String id : userTournamentMap.keySet()) { + userTournamentList.add(userTournamentMap.get(id)); + } + return userTournamentList; + } + + /** + * Given a user id returns all the matche predictions of him. + * + * @param tournamentId tournament id + * @param groupId group id + * @param userId user to obtain the info. + * @return a list of user tournaments. + */ + public static List getUserTournaments( + Id tournamentId, + Id groupId, + Id userId + ) { + return [ + SELECT Id, Name, Brackets_Group__c, Brackets_Tournament__c, User__c + FROM Brackets_UserTournament__c + WHERE + Brackets_Group__c = :groupId + AND Brackets_Tournament__c = :tournamentId + AND User__c = :userId + ]; + } + + /** + * Save a list of user tournaments + * + * @param userTournamentList a list of user tournament + */ + public static void save( + List userTournamentList + ) { + List userTournamentListToSave = new List(); + try { + for ( + Brackets_UserTournament__c userTournament : userTournamentList + ) { + if (userTournament.Brackets_Group__c != null) { + userTournamentListToSave.add(userTournament); + } + } + Database.upsert(userTournamentListToSave, false); + + suscribe(userTournamentListToSave); + } catch (Exception e) { + throw e; + } + } + + /** + * Check existing joined to tournaments + * + * @param userTournamentList a list of usertournament sobject to join tournamento to groups + */ + public static void checkJoinedTournaments( + List userTournamentNewList + ) { + Boolean isAlreadyJoined = false; + List groupIds = new List(); + List tournamentIds = new List(); + for ( + Brackets_UserTournament__c userTournamentNew : userTournamentNewList + ) { + groupIds.add(userTournamentNew.Brackets_Group__c); + tournamentIds.add(userTournamentNew.Brackets_Tournament__c); + } + + for (Brackets_UserTournament__c userTournament : [ + SELECT + Id, + Brackets_Group__c, + Brackets_Group__r.Name, + Brackets_Tournament__c, + User__c + FROM Brackets_UserTournament__c + WHERE + Brackets_Tournament__c IN :tournamentIds + AND Brackets_Group__c IN :groupIds + ]) { + for ( + Brackets_UserTournament__c userTournamentNew : userTournamentNewList + ) { + isAlreadyJoined = + userTournament.Id != userTournamentNew.Id && + userTournament.Brackets_Tournament__c == + userTournamentNew.Brackets_Tournament__c && + userTournament.Brackets_Group__c == + userTournamentNew.Brackets_Group__c && + userTournament.User__c == userTournamentNew.User__c; + if (isAlreadyJoined) { + userTournamentNew.Brackets_Group__c.addError( + 'You can\'t join again.' + ); + break; + } + } + } + } + + /** + * Enter a EntitySubcription + */ + public static void userSuscribe( + List utNewList + ) { + try { + List entSusc = new List(); + for (Brackets_UserTournament__c ut : utNewList) { + EntitySubscription ents = new EntitySubscription(); + ents.ParentId = ut.Brackets_Group__c; + ents.SubscriberId = Userinfo.getUserId(); + entSusc.add(ents); + } + upsert entSusc; + } catch (Exception e) { + } + } + + /** + * Given a list of usertournament, create the necessary suscription to follow to its corresponding + * group. + * + * @param userTournamentList a list of usertournament sobject. + */ + private static void suscribe( + List userTournamentList + ) { + List entitySuscriptionsList = new List(); + EntitySubscription entitySubscription; + for (Brackets_UserTournament__c userTournament : userTournamentList) { + if (userTournament.Id != null) { + entitySubscription = new EntitySubscription(); + entitySubscription.ParentId = userTournament.Brackets_Group__c; + entitySubscription.SubscriberId = userTournament.User__c; + entitySuscriptionsList.add(entitySubscription); + } + } + if (!entitySuscriptionsList.isEmpty()) { + try { + Database.insert(entitySuscriptionsList, false); + } catch (Exception e) { + //if this part of the code some subscriptions were already done. + } + } + } +} diff --git a/src/classes/BracketsUserTournamentUtilities.cls-meta.xml b/force-app/main/default/classes/BracketsUserTournamentUtilities.cls-meta.xml similarity index 57% rename from src/classes/BracketsUserTournamentUtilities.cls-meta.xml rename to force-app/main/default/classes/BracketsUserTournamentUtilities.cls-meta.xml index b6a4861..b709043 100644 --- a/src/classes/BracketsUserTournamentUtilities.cls-meta.xml +++ b/force-app/main/default/classes/BracketsUserTournamentUtilities.cls-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/classes/BracketsUserTournamentUtilitiesTest.cls b/force-app/main/default/classes/BracketsUserTournamentUtilitiesTest.cls new file mode 100644 index 0000000..c69599d --- /dev/null +++ b/force-app/main/default/classes/BracketsUserTournamentUtilitiesTest.cls @@ -0,0 +1,45 @@ +@isTest +class BracketsUserTournamentUtilitiesTest { + @isTest + static void allMethods() { + delete [SELECT id FROM Brackets_UserTournament__c]; + Brackets_UserTournament__c userTournamentRetrieved; + Brackets_Tournament__c myTour = BracketsTestUtilities.getNewStandardTournament(); + Brackets_Group__c myGroup = BracketsTestUtilities.getGroup(myTour.Id); + Brackets_UserTournament__c uTour = BracketsTestUtilities.createUserTournament( + UserInfo.getUserId(), + myTour.Id, + myGroup.Id + ); + + List userTournaments = BracketsUserTournamentUtilities.getUserTournaments( + myTour.Id, + myGroup.Id, + UserInfo.getUserId() + ); + System.assert( + !userTournaments.isEmpty(), + 'Should have a user tournament with group ' + + myGroup.Id + + ' and tournament ' + + myTour.Id + ); + userTournamentRetrieved = userTournaments.get(0); + System.assert(userTournamentRetrieved.Id == uTour.Id); + + userTournaments = BracketsUserTournamentUtilities.getUserTournamentsFromUser( + UserInfo.getUserId() + ); + System.assert( + !userTournaments.isEmpty(), + 'Should have a user tournament with group ' + + myGroup.Id + + ' and tournament ' + + myTour.Id + ); + + BracketsUserTournamentUtilities.save(userTournaments); + BracketsUserTournamentUtilities.checkJoinedTournaments(userTournaments); + BracketsUserTournamentUtilities.userSuscribe(userTournaments); + } +} diff --git a/force-app/main/default/classes/BracketsUserTournamentUtilitiesTest.cls-meta.xml b/force-app/main/default/classes/BracketsUserTournamentUtilitiesTest.cls-meta.xml new file mode 100644 index 0000000..b709043 --- /dev/null +++ b/force-app/main/default/classes/BracketsUserTournamentUtilitiesTest.cls-meta.xml @@ -0,0 +1,5 @@ + + + 48.0 + Active + diff --git a/force-app/main/default/components/BracketsChatter.component b/force-app/main/default/components/BracketsChatter.component new file mode 100644 index 0000000..5f9a085 --- /dev/null +++ b/force-app/main/default/components/BracketsChatter.component @@ -0,0 +1,10 @@ + + + + diff --git a/force-app/main/default/components/BracketsChatter.component-meta.xml b/force-app/main/default/components/BracketsChatter.component-meta.xml new file mode 100644 index 0000000..cc4f0a9 --- /dev/null +++ b/force-app/main/default/components/BracketsChatter.component-meta.xml @@ -0,0 +1,7 @@ + + + 48.0 + This is a generic template for Apex Component. With this template, you may adjust the default elements and values and add new elements and values. + + diff --git a/force-app/main/default/components/BracketsLeaderboard.component b/force-app/main/default/components/BracketsLeaderboard.component new file mode 100644 index 0000000..2ec24a9 --- /dev/null +++ b/force-app/main/default/components/BracketsLeaderboard.component @@ -0,0 +1,46 @@ + + + +

Sorted by tournament, pool and then points; first 1000.

+ + + User + + + + Tournament + + + + Pool + + + + Points + + + + Tiebreaker + + + + View + + + +
+
diff --git a/force-app/main/default/components/BracketsLeaderboard.component-meta.xml b/force-app/main/default/components/BracketsLeaderboard.component-meta.xml new file mode 100644 index 0000000..8ae2d6a --- /dev/null +++ b/force-app/main/default/components/BracketsLeaderboard.component-meta.xml @@ -0,0 +1,7 @@ + + + 48.0 + This is a generic template for Apex Component. With this template, you may adjust the default elements and values and add new elements and values. + + diff --git a/force-app/main/default/components/BracketsPoolList.component b/force-app/main/default/components/BracketsPoolList.component new file mode 100644 index 0000000..1524b77 --- /dev/null +++ b/force-app/main/default/components/BracketsPoolList.component @@ -0,0 +1,61 @@ + + + + + + + + + + + Action + + Join This Pool + + + Play Now + + + + Name + + {!groupWrap.groupp.Name} + + + + Tournament + + + + Type + + + + Members + + + + Status + {!groupWrap.Status} + + + + diff --git a/force-app/main/default/components/BracketsPoolList.component-meta.xml b/force-app/main/default/components/BracketsPoolList.component-meta.xml new file mode 100644 index 0000000..3c1e13f --- /dev/null +++ b/force-app/main/default/components/BracketsPoolList.component-meta.xml @@ -0,0 +1,7 @@ + + + 48.0 + This is a generic template for Apex Component. With this template, you may adjust the default elements and values and add new elements and values. + + diff --git a/force-app/main/default/components/BracketsPredictionGameDetailHover.component b/force-app/main/default/components/BracketsPredictionGameDetailHover.component new file mode 100644 index 0000000..c5931e8 --- /dev/null +++ b/force-app/main/default/components/BracketsPredictionGameDetailHover.component @@ -0,0 +1,62 @@ + + + + + + + + +
+
+
+ +
+
+
+ +
+
+
+
diff --git a/force-app/main/default/components/BracketsPredictionGameDetailHover.component-meta.xml b/force-app/main/default/components/BracketsPredictionGameDetailHover.component-meta.xml new file mode 100644 index 0000000..d280761 --- /dev/null +++ b/force-app/main/default/components/BracketsPredictionGameDetailHover.component-meta.xml @@ -0,0 +1,7 @@ + + + 48.0 + This is a generic template for Apex Component. With this template, you may adjust the default elements and values and add new elements and values. + + diff --git a/force-app/main/default/components/BracketsPredictionMatchDetail.component b/force-app/main/default/components/BracketsPredictionMatchDetail.component new file mode 100644 index 0000000..a037cb5 --- /dev/null +++ b/force-app/main/default/components/BracketsPredictionMatchDetail.component @@ -0,0 +1,156 @@ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + +
+ {!match.Brackets_Round__r.Name} +
+ {!IF(home.ShortName__c != null, home.ShortName__c, + home.Name)} + + {!IF(homePredicted.ShortName__c != null, + homePredicted.ShortName__c, homePredicted.Name)} + + + {!CEILING(scoreHome)} + -- +  :  + -- + {!CEILING(scoreVisitor)} + + {!IF(visitor.ShortName__c != null, + visitor.ShortName__c, visitor.Name)} + {!IF(visitorPredicted.ShortName__c!= null, + visitorPredicted.ShortName__c, visitorPredicted.Name)} + +
+ + + + {!IF(NOT(ISNULL(winner.ShortName__c)), + winner.ShortName__c, winner.Name )} + + + Prediction : {!predicted.Name } + +
+
+
diff --git a/force-app/main/default/components/BracketsPredictionMatchDetail.component-meta.xml b/force-app/main/default/components/BracketsPredictionMatchDetail.component-meta.xml new file mode 100644 index 0000000..79fe0a4 --- /dev/null +++ b/force-app/main/default/components/BracketsPredictionMatchDetail.component-meta.xml @@ -0,0 +1,7 @@ + + + 48.0 + This is a generic template for Apex Component. With this template, you may adjust the default elements and values and add new elements and values. + + diff --git a/force-app/main/default/components/BracketsPredictionSingleTeam.component b/force-app/main/default/components/BracketsPredictionSingleTeam.component new file mode 100644 index 0000000..02b8526 --- /dev/null +++ b/force-app/main/default/components/BracketsPredictionSingleTeam.component @@ -0,0 +1,105 @@ + + + + + + +
+
+ +
+ + + ? + + + +
+ +
+ + + {!IF(team.ShortName__c != null, + team.ShortName__c,team.Name)} + +   + + + {!IF(predicted.ShortName__c != null, + predicted.ShortName__c,predicted.Name)} + +   + + + {!score} +
+
+
diff --git a/force-app/main/default/components/BracketsPredictionSingleTeam.component-meta.xml b/force-app/main/default/components/BracketsPredictionSingleTeam.component-meta.xml new file mode 100644 index 0000000..7604198 --- /dev/null +++ b/force-app/main/default/components/BracketsPredictionSingleTeam.component-meta.xml @@ -0,0 +1,7 @@ + + + 48.0 + This is a generic template for Apex Component. With this template, you may adjust the default elements and values and add new elements and values. + + diff --git a/force-app/main/default/components/BracketsPredictionsFootballPlayoffs.component b/force-app/main/default/components/BracketsPredictionsFootballPlayoffs.component new file mode 100644 index 0000000..d2ab9ae --- /dev/null +++ b/force-app/main/default/components/BracketsPredictionsFootballPlayoffs.component @@ -0,0 +1,146 @@ + + + + + + + + + +
+
+ + + + + + + + + + +
Round 1Round 2Round 3Round 4 +
 
Round 3Round 2Round 1
+
+
+
+ + + +
+ + +
+ + + + + +
+
+ + +
+ + + + + + + +
+
+
+
+
+ +
+
+
+ + + +
+ + + + + + +
+
+
+ +
+ +
+ + + + + +
+
+ + +
+ + + + + + + +
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/force-app/main/default/components/BracketsPredictionsFootballPlayoffs.component-meta.xml b/force-app/main/default/components/BracketsPredictionsFootballPlayoffs.component-meta.xml new file mode 100644 index 0000000..5fd4cbe --- /dev/null +++ b/force-app/main/default/components/BracketsPredictionsFootballPlayoffs.component-meta.xml @@ -0,0 +1,7 @@ + + + 48.0 + This is a generic template for Apex Component. With this template, you may adjust the default elements and values and add new elements and values. + + diff --git a/force-app/main/default/components/BracketsPredictionsStandard.component b/force-app/main/default/components/BracketsPredictionsStandard.component new file mode 100644 index 0000000..8a23322 --- /dev/null +++ b/force-app/main/default/components/BracketsPredictionsStandard.component @@ -0,0 +1,70 @@ + + + + + + + + + + +
+ + +
+ + + + +
+ + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/force-app/main/default/components/BracketsPredictionsStandard.component-meta.xml b/force-app/main/default/components/BracketsPredictionsStandard.component-meta.xml new file mode 100644 index 0000000..1e8cd72 --- /dev/null +++ b/force-app/main/default/components/BracketsPredictionsStandard.component-meta.xml @@ -0,0 +1,7 @@ + + + 48.0 + This is a generic template for Apex Component. With this template, you may adjust the default elements and values and add new elements and values. + + diff --git a/src/layouts/Brackets_Group__c-Group Layout.layout b/force-app/main/default/layouts/Brackets_Group__c-Group Layout.layout-meta.xml similarity index 95% rename from src/layouts/Brackets_Group__c-Group Layout.layout rename to force-app/main/default/layouts/Brackets_Group__c-Group Layout.layout-meta.xml index af16ddc..0a550f5 100644 --- a/src/layouts/Brackets_Group__c-Group Layout.layout +++ b/force-app/main/default/layouts/Brackets_Group__c-Group Layout.layout-meta.xml @@ -1,4 +1,4 @@ - + Join Manage @@ -58,9 +58,9 @@ false true - - - + + + false diff --git a/src/layouts/Brackets_Group__c-Pool Layout.layout b/force-app/main/default/layouts/Brackets_Group__c-Pool Layout.layout-meta.xml similarity index 96% rename from src/layouts/Brackets_Group__c-Pool Layout.layout rename to force-app/main/default/layouts/Brackets_Group__c-Pool Layout.layout-meta.xml index fe41ac5..cd26585 100644 --- a/src/layouts/Brackets_Group__c-Pool Layout.layout +++ b/force-app/main/default/layouts/Brackets_Group__c-Pool Layout.layout-meta.xml @@ -1,4 +1,4 @@ - + Manage Join @@ -63,9 +63,9 @@ false true - - - + + + diff --git a/src/layouts/Brackets_Match__c-Match Layout.layout b/force-app/main/default/layouts/Brackets_Match__c-Match Layout.layout-meta.xml similarity index 95% rename from src/layouts/Brackets_Match__c-Match Layout.layout rename to force-app/main/default/layouts/Brackets_Match__c-Match Layout.layout-meta.xml index 05f5a68..5c95787 100644 --- a/src/layouts/Brackets_Match__c-Match Layout.layout +++ b/force-app/main/default/layouts/Brackets_Match__c-Match Layout.layout-meta.xml @@ -1,4 +1,4 @@ - + Clone Delete @@ -50,7 +50,7 @@ Conference__c - + @@ -77,9 +77,9 @@ false true - - - + + + diff --git a/src/layouts/Brackets_Round__c-Round Layout.layout b/force-app/main/default/layouts/Brackets_Round__c-Round Layout.layout-meta.xml similarity index 95% rename from src/layouts/Brackets_Round__c-Round Layout.layout rename to force-app/main/default/layouts/Brackets_Round__c-Round Layout.layout-meta.xml index 4e06424..896ab5c 100644 --- a/src/layouts/Brackets_Round__c-Round Layout.layout +++ b/force-app/main/default/layouts/Brackets_Round__c-Round Layout.layout-meta.xml @@ -1,4 +1,4 @@ - + Submit @@ -36,7 +36,7 @@ ScorePoints__c - + @@ -63,9 +63,9 @@ false true - - - + + + diff --git a/src/layouts/Brackets_Team__c-Team Layout.layout b/force-app/main/default/layouts/Brackets_Team__c-Team Layout.layout-meta.xml similarity index 95% rename from src/layouts/Brackets_Team__c-Team Layout.layout rename to force-app/main/default/layouts/Brackets_Team__c-Team Layout.layout-meta.xml index 56c1b79..bee9a93 100644 --- a/src/layouts/Brackets_Team__c-Team Layout.layout +++ b/force-app/main/default/layouts/Brackets_Team__c-Team Layout.layout-meta.xml @@ -1,4 +1,4 @@ - + Submit @@ -56,9 +56,9 @@ false true - - - + + + false diff --git a/src/layouts/Brackets_Tournament__c-Admin Brackets Tournament Layout.layout b/force-app/main/default/layouts/Brackets_Tournament__c-Admin Brackets Tournament Layout.layout-meta.xml similarity index 95% rename from src/layouts/Brackets_Tournament__c-Admin Brackets Tournament Layout.layout rename to force-app/main/default/layouts/Brackets_Tournament__c-Admin Brackets Tournament Layout.layout-meta.xml index 038afa3..063fb5d 100644 --- a/src/layouts/Brackets_Tournament__c-Admin Brackets Tournament Layout.layout +++ b/force-app/main/default/layouts/Brackets_Tournament__c-Admin Brackets Tournament Layout.layout-meta.xml @@ -1,4 +1,4 @@ - + Share Submit @@ -69,9 +69,9 @@ false true - - - + + + @@ -110,7 +110,8 @@ User__c Points__c Championship_Point_Prediction__c - Brackets_UserTournament__c.Brackets_Tournament__c + Brackets_UserTournament__c.Brackets_Tournament__c false false diff --git a/src/layouts/Brackets_Tournament__c-Tournament Layout.layout b/force-app/main/default/layouts/Brackets_Tournament__c-Tournament Layout.layout-meta.xml similarity index 95% rename from src/layouts/Brackets_Tournament__c-Tournament Layout.layout rename to force-app/main/default/layouts/Brackets_Tournament__c-Tournament Layout.layout-meta.xml index 80a1524..93a09ec 100644 --- a/src/layouts/Brackets_Tournament__c-Tournament Layout.layout +++ b/force-app/main/default/layouts/Brackets_Tournament__c-Tournament Layout.layout-meta.xml @@ -1,4 +1,4 @@ - + Submit @@ -84,9 +84,9 @@ false true - - - + + + @@ -104,7 +104,8 @@ User__c Brackets_Group__c Points__c - Brackets_UserTournament__c.Brackets_Tournament__c + Brackets_UserTournament__c.Brackets_Tournament__c Points__c Asc diff --git a/src/layouts/Brackets_Tournament__c-User Brackets Tournament Layout.layout b/force-app/main/default/layouts/Brackets_Tournament__c-User Brackets Tournament Layout.layout-meta.xml similarity index 95% rename from src/layouts/Brackets_Tournament__c-User Brackets Tournament Layout.layout rename to force-app/main/default/layouts/Brackets_Tournament__c-User Brackets Tournament Layout.layout-meta.xml index c4b0543..68524fc 100644 --- a/src/layouts/Brackets_Tournament__c-User Brackets Tournament Layout.layout +++ b/force-app/main/default/layouts/Brackets_Tournament__c-User Brackets Tournament Layout.layout-meta.xml @@ -1,4 +1,4 @@ - + Share Submit @@ -50,9 +50,9 @@ false true - - - + + + diff --git a/src/layouts/Brackets_UserMatchPred__c-UserMatchPrediction Layout.layout b/force-app/main/default/layouts/Brackets_UserMatchPred__c-UserMatchPrediction Layout.layout-meta.xml similarity index 93% rename from src/layouts/Brackets_UserMatchPred__c-UserMatchPrediction Layout.layout rename to force-app/main/default/layouts/Brackets_UserMatchPred__c-UserMatchPrediction Layout.layout-meta.xml index d94a670..3f2a1de 100644 --- a/src/layouts/Brackets_UserMatchPred__c-UserMatchPrediction Layout.layout +++ b/force-app/main/default/layouts/Brackets_UserMatchPred__c-UserMatchPrediction Layout.layout-meta.xml @@ -1,4 +1,4 @@ - + false @@ -19,7 +19,7 @@ Name - + @@ -45,9 +45,9 @@ false false true - - - + + + diff --git a/src/layouts/Brackets_UserTournament__c-Pool Members Layout.layout b/force-app/main/default/layouts/Brackets_UserTournament__c-Pool Members Layout.layout-meta.xml similarity index 94% rename from src/layouts/Brackets_UserTournament__c-Pool Members Layout.layout rename to force-app/main/default/layouts/Brackets_UserTournament__c-Pool Members Layout.layout-meta.xml index 4499b12..c7877a6 100644 --- a/src/layouts/Brackets_UserTournament__c-Pool Members Layout.layout +++ b/force-app/main/default/layouts/Brackets_UserTournament__c-Pool Members Layout.layout-meta.xml @@ -1,4 +1,4 @@ - + Clone Delete @@ -35,7 +35,7 @@ Tiebreaker_Points__c - + @@ -62,9 +62,9 @@ false true - - - + + + false diff --git a/src/layouts/Brackets_UserTournament__c-User Tournament Layout.layout b/force-app/main/default/layouts/Brackets_UserTournament__c-User Tournament Layout.layout-meta.xml similarity index 93% rename from src/layouts/Brackets_UserTournament__c-User Tournament Layout.layout rename to force-app/main/default/layouts/Brackets_UserTournament__c-User Tournament Layout.layout-meta.xml index 6417a5b..efb2136 100644 --- a/src/layouts/Brackets_UserTournament__c-User Tournament Layout.layout +++ b/force-app/main/default/layouts/Brackets_UserTournament__c-User Tournament Layout.layout-meta.xml @@ -1,4 +1,4 @@ - + false @@ -27,7 +27,7 @@ Tiebreaker_Points__c - + @@ -53,9 +53,9 @@ false false true - - - + + + diff --git a/src/layouts/Brackets_UserTournament__c-UserTournament Layout.layout b/force-app/main/default/layouts/Brackets_UserTournament__c-UserTournament Layout.layout-meta.xml similarity index 91% rename from src/layouts/Brackets_UserTournament__c-UserTournament Layout.layout rename to force-app/main/default/layouts/Brackets_UserTournament__c-UserTournament Layout.layout-meta.xml index e99f7f4..44ecc4b 100644 --- a/src/layouts/Brackets_UserTournament__c-UserTournament Layout.layout +++ b/force-app/main/default/layouts/Brackets_UserTournament__c-UserTournament Layout.layout-meta.xml @@ -1,4 +1,4 @@ - + Clone Submit @@ -41,7 +41,7 @@ Tiebreaker_Points__c - + @@ -68,14 +68,15 @@ false true - - - + + + NAME - Brackets_UserMatchPred__c.Brackets_UserTournament__c + Brackets_UserMatchPred__c.Brackets_UserTournament__c false false diff --git a/force-app/main/default/lwc/.eslintrc.json b/force-app/main/default/lwc/.eslintrc.json new file mode 100755 index 0000000..4c832a7 --- /dev/null +++ b/force-app/main/default/lwc/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": ["@salesforce/eslint-config-lwc/recommended"] +} diff --git a/force-app/main/default/objects/BracketsSettings2__c/BracketsSettings2__c.object-meta.xml b/force-app/main/default/objects/BracketsSettings2__c/BracketsSettings2__c.object-meta.xml new file mode 100644 index 0000000..da04f12 --- /dev/null +++ b/force-app/main/default/objects/BracketsSettings2__c/BracketsSettings2__c.object-meta.xml @@ -0,0 +1,8 @@ + + + List + + false + false + + diff --git a/force-app/main/default/objects/BracketsSettings2__c/fields/Hide_Help_Dialog__c.field-meta.xml b/force-app/main/default/objects/BracketsSettings2__c/fields/Hide_Help_Dialog__c.field-meta.xml new file mode 100644 index 0000000..d3d467e --- /dev/null +++ b/force-app/main/default/objects/BracketsSettings2__c/fields/Hide_Help_Dialog__c.field-meta.xml @@ -0,0 +1,8 @@ + + + Hide_Help_Dialog__c + false + false + + Checkbox + diff --git a/force-app/main/default/objects/BracketsSettingsPersonal__c/BracketsSettingsPersonal__c.object-meta.xml b/force-app/main/default/objects/BracketsSettingsPersonal__c/BracketsSettingsPersonal__c.object-meta.xml new file mode 100644 index 0000000..efb9de8 --- /dev/null +++ b/force-app/main/default/objects/BracketsSettingsPersonal__c/BracketsSettingsPersonal__c.object-meta.xml @@ -0,0 +1,8 @@ + + + Hierarchy + + false + false + + diff --git a/force-app/main/default/objects/BracketsSettingsPersonal__c/fields/Hide_Dialog_Predictions__c.field-meta.xml b/force-app/main/default/objects/BracketsSettingsPersonal__c/fields/Hide_Dialog_Predictions__c.field-meta.xml new file mode 100644 index 0000000..973cfcd --- /dev/null +++ b/force-app/main/default/objects/BracketsSettingsPersonal__c/fields/Hide_Dialog_Predictions__c.field-meta.xml @@ -0,0 +1,8 @@ + + + Hide_Dialog_Predictions__c + false + false + + Checkbox + diff --git a/force-app/main/default/objects/BracketsSettingsPersonal__c/fields/Initial_Setup_Complete__c.field-meta.xml b/force-app/main/default/objects/BracketsSettingsPersonal__c/fields/Initial_Setup_Complete__c.field-meta.xml new file mode 100644 index 0000000..21d49e3 --- /dev/null +++ b/force-app/main/default/objects/BracketsSettingsPersonal__c/fields/Initial_Setup_Complete__c.field-meta.xml @@ -0,0 +1,8 @@ + + + Initial_Setup_Complete__c + false + false + + Checkbox + diff --git a/force-app/main/default/objects/BracketsSettingsPersonal__c/fields/Initial_Setup_Step_2_Complete__c.field-meta.xml b/force-app/main/default/objects/BracketsSettingsPersonal__c/fields/Initial_Setup_Step_2_Complete__c.field-meta.xml new file mode 100644 index 0000000..c6187d5 --- /dev/null +++ b/force-app/main/default/objects/BracketsSettingsPersonal__c/fields/Initial_Setup_Step_2_Complete__c.field-meta.xml @@ -0,0 +1,8 @@ + + + Initial_Setup_Step_2_Complete__c + false + false + + Checkbox + diff --git a/force-app/main/default/objects/Brackets_Group__c/Brackets_Group__c.object-meta.xml b/force-app/main/default/objects/Brackets_Group__c/Brackets_Group__c.object-meta.xml new file mode 100644 index 0000000..75490f5 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Group__c/Brackets_Group__c.object-meta.xml @@ -0,0 +1,50 @@ + + + + Accept + Default + + + Clone + Default + + + Delete + Default + + + Edit + Default + + + List + Default + + + New + Default + + + Tab + Default + + + View + Default + + Deployed + false + false + true + false + false + + + + false + Text + + Pools + + ReadWrite + diff --git a/force-app/main/default/objects/Brackets_Group__c/fields/Brackets_Tournament__c.field-meta.xml b/force-app/main/default/objects/Brackets_Group__c/fields/Brackets_Tournament__c.field-meta.xml new file mode 100644 index 0000000..18524cd --- /dev/null +++ b/force-app/main/default/objects/Brackets_Group__c/fields/Brackets_Tournament__c.field-meta.xml @@ -0,0 +1,10 @@ + + + Brackets_Tournament__c + false + + Brackets_Tournament__c + Pools + false + Lookup + diff --git a/force-app/main/default/objects/Brackets_Group__c/fields/NumOfMembers__c.field-meta.xml b/force-app/main/default/objects/Brackets_Group__c/fields/NumOfMembers__c.field-meta.xml new file mode 100644 index 0000000..2091a46 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Group__c/fields/NumOfMembers__c.field-meta.xml @@ -0,0 +1,11 @@ + + + NumOfMembers__c + Numbers of members joined to this group. + false + + Brackets_UserTournament__c.Brackets_Group__c + count + Summary + diff --git a/force-app/main/default/objects/Brackets_Group__c/fields/Status__c.field-meta.xml b/force-app/main/default/objects/Brackets_Group__c/fields/Status__c.field-meta.xml new file mode 100644 index 0000000..49353d1 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Group__c/fields/Status__c.field-meta.xml @@ -0,0 +1,23 @@ + + + Status__c + false + + + + false + + Open + true + + + + Closed + false + + + + + false + Picklist + diff --git a/force-app/main/default/objects/Brackets_Group__c/fields/TournamentType__c.field-meta.xml b/force-app/main/default/objects/Brackets_Group__c/fields/TournamentType__c.field-meta.xml new file mode 100644 index 0000000..6ba97d3 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Group__c/fields/TournamentType__c.field-meta.xml @@ -0,0 +1,11 @@ + + + TournamentType__c + false + Text(Brackets_Tournament__r.Type__c) + BlankAsZero + + false + Text + false + diff --git a/force-app/main/default/objects/Brackets_Group__c/fields/Type__c.field-meta.xml b/force-app/main/default/objects/Brackets_Group__c/fields/Type__c.field-meta.xml new file mode 100644 index 0000000..154540f --- /dev/null +++ b/force-app/main/default/objects/Brackets_Group__c/fields/Type__c.field-meta.xml @@ -0,0 +1,25 @@ + + + Type__c + false + Round By Round lets users predict a single round at a time. Full Tournament requires full prediction up front and cannot be changed. + + + + false + + Full Tournament + true + + + + Round By Round + false + + + + + false + Picklist + diff --git a/force-app/main/default/objects/Brackets_Group__c/validationRules/TournamentNotUpdatable.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Group__c/validationRules/TournamentNotUpdatable.validationRule-meta.xml new file mode 100644 index 0000000..c06c6ce --- /dev/null +++ b/force-app/main/default/objects/Brackets_Group__c/validationRules/TournamentNotUpdatable.validationRule-meta.xml @@ -0,0 +1,9 @@ + + + TournamentNotUpdatable + true + NOT(ISNEW()) && ISCHANGED( Brackets_Tournament__c ) + Brackets_Tournament__c + This field can't be updated. + diff --git a/force-app/main/default/objects/Brackets_Group__c/validationRules/TypeNotUpdatable.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Group__c/validationRules/TypeNotUpdatable.validationRule-meta.xml new file mode 100644 index 0000000..588e628 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Group__c/validationRules/TypeNotUpdatable.validationRule-meta.xml @@ -0,0 +1,9 @@ + + + TypeNotUpdatable + true + NOT(ISNEW()) && ISCHANGED( Type__c ) + Type__c + This field can't be updated. + diff --git a/force-app/main/default/objects/Brackets_Group__c/webLinks/Join.webLink-meta.xml b/force-app/main/default/objects/Brackets_Group__c/webLinks/Join.webLink-meta.xml new file mode 100644 index 0000000..c9ba5d7 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Group__c/webLinks/Join.webLink-meta.xml @@ -0,0 +1,12 @@ + + + Join + online + button + javascript + Join + onClickJavaScript + false + location.href="/apex/BracketsJoinInvitedUser?gId={!Brackets_Group__c.Id}"; + diff --git a/force-app/main/default/objects/Brackets_Group__c/webLinks/Manage.webLink-meta.xml b/force-app/main/default/objects/Brackets_Group__c/webLinks/Manage.webLink-meta.xml new file mode 100644 index 0000000..5757a24 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Group__c/webLinks/Manage.webLink-meta.xml @@ -0,0 +1,13 @@ + + + Manage + online + button + UTF-8 + 600 + url + Manage + sidebar + false + /apex/BracketsPredictions?show={!Brackets_Group__c.Id} + diff --git a/force-app/main/default/objects/Brackets_Match__c/Brackets_Match__c.object-meta.xml b/force-app/main/default/objects/Brackets_Match__c/Brackets_Match__c.object-meta.xml new file mode 100644 index 0000000..68a38fe --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/Brackets_Match__c.object-meta.xml @@ -0,0 +1,52 @@ + + + + Accept + Default + + + Clone + Default + + + Delete + Default + + + Edit + Default + + + List + Default + + + New + Default + + + Tab + Default + + + View + Default + + Deployed + false + false + false + false + true + + + MA-{00000} + + AutoNumber + + Matches + + New + + ControlledByParent + diff --git a/force-app/main/default/objects/Brackets_Match__c/fields/Brackets_Round__c.field-meta.xml b/force-app/main/default/objects/Brackets_Match__c/fields/Brackets_Round__c.field-meta.xml new file mode 100644 index 0000000..9efb311 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/fields/Brackets_Round__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Brackets_Round__c + false + + Brackets_Round__c + Matches + Matches + 0 + MasterDetail + false + diff --git a/force-app/main/default/objects/Brackets_Match__c/fields/Conference__c.field-meta.xml b/force-app/main/default/objects/Brackets_Match__c/fields/Conference__c.field-meta.xml new file mode 100644 index 0000000..565232d --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/fields/Conference__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Conference__c + false + If rounds are grouped in conferences, this is the conference the match is part of. + + 255 + false + Text + false + diff --git a/force-app/main/default/objects/Brackets_Match__c/fields/Description__c.field-meta.xml b/force-app/main/default/objects/Brackets_Match__c/fields/Description__c.field-meta.xml new file mode 100644 index 0000000..7cc7299 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/fields/Description__c.field-meta.xml @@ -0,0 +1,9 @@ + + + Description__c + false + Short description of the match + + false + TextArea + diff --git a/force-app/main/default/objects/Brackets_Match__c/fields/ExternalId__c.field-meta.xml b/force-app/main/default/objects/Brackets_Match__c/fields/ExternalId__c.field-meta.xml new file mode 100644 index 0000000..1797d4b --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/fields/ExternalId__c.field-meta.xml @@ -0,0 +1,10 @@ + + + ExternalId__c + true + + 50 + false + Text + false + diff --git a/force-app/main/default/objects/Brackets_Match__c/fields/FollowingBrackets_Match__c.field-meta.xml b/force-app/main/default/objects/Brackets_Match__c/fields/FollowingBrackets_Match__c.field-meta.xml new file mode 100644 index 0000000..dbf92d5 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/fields/FollowingBrackets_Match__c.field-meta.xml @@ -0,0 +1,10 @@ + + + FollowingBrackets_Match__c + false + + Brackets_Match__c + PreviousMatches + PreviousMatches + Lookup + diff --git a/force-app/main/default/objects/Brackets_Match__c/fields/FollowingIsHome__c.field-meta.xml b/force-app/main/default/objects/Brackets_Match__c/fields/FollowingIsHome__c.field-meta.xml new file mode 100644 index 0000000..8b6f655 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/fields/FollowingIsHome__c.field-meta.xml @@ -0,0 +1,8 @@ + + + FollowingIsHome__c + true + false + + Checkbox + diff --git a/force-app/main/default/objects/Brackets_Match__c/fields/HomeBrackets_Team__c.field-meta.xml b/force-app/main/default/objects/Brackets_Match__c/fields/HomeBrackets_Team__c.field-meta.xml new file mode 100644 index 0000000..1eba9c7 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/fields/HomeBrackets_Team__c.field-meta.xml @@ -0,0 +1,10 @@ + + + HomeBrackets_Team__c + false + + Brackets_Team__c + HomeMatches + HomeMatch + Lookup + diff --git a/force-app/main/default/objects/Brackets_Match__c/fields/HomePrediction__c.field-meta.xml b/force-app/main/default/objects/Brackets_Match__c/fields/HomePrediction__c.field-meta.xml new file mode 100644 index 0000000..26d0f5e --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/fields/HomePrediction__c.field-meta.xml @@ -0,0 +1,12 @@ + + + HomePrediction__c + 0 + false + + 18 + false + 0 + Number + false + diff --git a/force-app/main/default/objects/Brackets_Match__c/fields/HomeScore__c.field-meta.xml b/force-app/main/default/objects/Brackets_Match__c/fields/HomeScore__c.field-meta.xml new file mode 100644 index 0000000..1acd106 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/fields/HomeScore__c.field-meta.xml @@ -0,0 +1,13 @@ + + + HomeScore__c + 0 + false + Score of Team 1 after the match end. + + 10 + false + 0 + Number + false + diff --git a/force-app/main/default/objects/Brackets_Match__c/fields/Position__c.field-meta.xml b/force-app/main/default/objects/Brackets_Match__c/fields/Position__c.field-meta.xml new file mode 100644 index 0000000..c1eb74f --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/fields/Position__c.field-meta.xml @@ -0,0 +1,14 @@ + + + Position__c + 1 + Keep the position respect to its round, each position should be unique. + false + + 18 + false + 0 + Number + false + diff --git a/force-app/main/default/objects/Brackets_Match__c/fields/Schedule__c.field-meta.xml b/force-app/main/default/objects/Brackets_Match__c/fields/Schedule__c.field-meta.xml new file mode 100644 index 0000000..016f0b5 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/fields/Schedule__c.field-meta.xml @@ -0,0 +1,9 @@ + + + Schedule__c + false + Date of the match + + false + DateTime + diff --git a/force-app/main/default/objects/Brackets_Match__c/fields/VisitorBrackets_Team__c.field-meta.xml b/force-app/main/default/objects/Brackets_Match__c/fields/VisitorBrackets_Team__c.field-meta.xml new file mode 100644 index 0000000..761effa --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/fields/VisitorBrackets_Team__c.field-meta.xml @@ -0,0 +1,10 @@ + + + VisitorBrackets_Team__c + false + + Brackets_Team__c + VisitorMatches + VisitorMatches + Lookup + diff --git a/force-app/main/default/objects/Brackets_Match__c/fields/VisitorPrediction__c.field-meta.xml b/force-app/main/default/objects/Brackets_Match__c/fields/VisitorPrediction__c.field-meta.xml new file mode 100644 index 0000000..66c770c --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/fields/VisitorPrediction__c.field-meta.xml @@ -0,0 +1,12 @@ + + + VisitorPrediction__c + 0 + false + + 18 + false + 0 + Number + false + diff --git a/force-app/main/default/objects/Brackets_Match__c/fields/VisitorScore__c.field-meta.xml b/force-app/main/default/objects/Brackets_Match__c/fields/VisitorScore__c.field-meta.xml new file mode 100644 index 0000000..9d8c0fc --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/fields/VisitorScore__c.field-meta.xml @@ -0,0 +1,13 @@ + + + VisitorScore__c + 0 + false + Score of Team 2 after the match end. + + 10 + false + 0 + Number + false + diff --git a/force-app/main/default/objects/Brackets_Match__c/fields/WinnerBrackets_Team__c.field-meta.xml b/force-app/main/default/objects/Brackets_Match__c/fields/WinnerBrackets_Team__c.field-meta.xml new file mode 100644 index 0000000..386d281 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/fields/WinnerBrackets_Team__c.field-meta.xml @@ -0,0 +1,11 @@ + + + WinnerBrackets_Team__c + false + Match winner (Team 1 or Team 2) + + Brackets_Team__c + WinnerMatches + WinnerMatches + Lookup + diff --git a/force-app/main/default/objects/Brackets_Match__c/fields/isLocked__c.field-meta.xml b/force-app/main/default/objects/Brackets_Match__c/fields/isLocked__c.field-meta.xml new file mode 100644 index 0000000..cee8912 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/fields/isLocked__c.field-meta.xml @@ -0,0 +1,8 @@ + + + isLocked__c + false + false + + Checkbox + diff --git a/force-app/main/default/objects/Brackets_Match__c/listViews/All.listView-meta.xml b/force-app/main/default/objects/Brackets_Match__c/listViews/All.listView-meta.xml new file mode 100644 index 0000000..093e9dc --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/listViews/All.listView-meta.xml @@ -0,0 +1,14 @@ + + + All + HomeBrackets_Team__c + HomeScore__c + VisitorBrackets_Team__c + VisitorScore__c + VisitorPrediction__c + isLocked__c + Position__c + FollowingBrackets_Match__c + Everything + + diff --git a/force-app/main/default/objects/Brackets_Match__c/validationRules/Conference_read_only.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Match__c/validationRules/Conference_read_only.validationRule-meta.xml new file mode 100644 index 0000000..626c223 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/validationRules/Conference_read_only.validationRule-meta.xml @@ -0,0 +1,9 @@ + + + Conference_read_only + false + NOT(ISNEW()) && ISCHANGED( Conference__c ) + Conference__c + This field is not updatable. + diff --git a/force-app/main/default/objects/Brackets_Match__c/validationRules/DifferentTeams.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Match__c/validationRules/DifferentTeams.validationRule-meta.xml new file mode 100644 index 0000000..8f89deb --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/validationRules/DifferentTeams.validationRule-meta.xml @@ -0,0 +1,10 @@ + + + DifferentTeams + true + The home and visitor teams must be different teams + AND(AND(NOT( ISBLANK( VisitorBrackets_Team__c ) ),NOT( ISBLANK( HomeBrackets_Team__c ) )),HomeBrackets_Team__c = VisitorBrackets_Team__c) + Team 1 and Team 2 must be different + diff --git a/force-app/main/default/objects/Brackets_Match__c/validationRules/PositiveScores.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Match__c/validationRules/PositiveScores.validationRule-meta.xml new file mode 100644 index 0000000..a5e246e --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/validationRules/PositiveScores.validationRule-meta.xml @@ -0,0 +1,9 @@ + + + PositiveScores + true + Scores must be a positive numbers + HomeScore__c < 0 || VisitorScore__c < 0 + The score must be a positive number + diff --git a/force-app/main/default/objects/Brackets_Match__c/validationRules/ScheduleAfterDeadlineRound.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Match__c/validationRules/ScheduleAfterDeadlineRound.validationRule-meta.xml new file mode 100644 index 0000000..a008019 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/validationRules/ScheduleAfterDeadlineRound.validationRule-meta.xml @@ -0,0 +1,13 @@ + + + ScheduleAfterDeadlineRound + true + And ( +!isBlank(Schedule__c), +!isBlank(Brackets_Round__r.Deadline__c), +Schedule__c < Brackets_Round__r.Deadline__c +) + Schedule__c + This date must be greater than the round's deadline. + diff --git a/force-app/main/default/objects/Brackets_Match__c/validationRules/Scores_can_not_be_null.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Match__c/validationRules/Scores_can_not_be_null.validationRule-meta.xml new file mode 100644 index 0000000..33e394b --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/validationRules/Scores_can_not_be_null.validationRule-meta.xml @@ -0,0 +1,11 @@ + + + Scores_can_not_be_null + true + If the Winner Team is establish, the scores can not be null or empty + !ISNULL( WinnerBrackets_Team__c ) && +( !ISNUMBER( TEXT(VisitorScore__c) ) || !ISNUMBER( TEXT(HomeScore__c)) ) + WinnerBrackets_Team__c + Scores can not be null + diff --git a/force-app/main/default/objects/Brackets_Match__c/validationRules/Scores_with_no_winner.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Match__c/validationRules/Scores_with_no_winner.validationRule-meta.xml new file mode 100644 index 0000000..d880d5c --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/validationRules/Scores_with_no_winner.validationRule-meta.xml @@ -0,0 +1,11 @@ + + + Scores_with_no_winner + true + Avoid to set scores when the Winner team is not established. + (HomeScore__c > 0 || VisitorScore__c > 0) && WinnerBrackets_Team__c == null + WinnerBrackets_Team__c + Select the Winner Team + diff --git a/force-app/main/default/objects/Brackets_Match__c/validationRules/WinnerTeamGreaterScoreThanOpponent.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Match__c/validationRules/WinnerTeamGreaterScoreThanOpponent.validationRule-meta.xml new file mode 100644 index 0000000..a3d2e04 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/validationRules/WinnerTeamGreaterScoreThanOpponent.validationRule-meta.xml @@ -0,0 +1,17 @@ + + + WinnerTeamGreaterScoreThanOpponent + true + IF( ISBLANK( WinnerBrackets_Team__c),false, + OR( + AND( + WinnerBrackets_Team__c == HomeBrackets_Team__c,HomeScore__c <= VisitorScore__c + ), + AND( + WinnerBrackets_Team__c == VisitorBrackets_Team__c,HomeScore__c >= VisitorScore__c ) + ) +) + WinnerBrackets_Team__c + A Winner must have an score greater than its opponent. + diff --git a/force-app/main/default/objects/Brackets_Match__c/validationRules/WinnerTeamSubset.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Match__c/validationRules/WinnerTeamSubset.validationRule-meta.xml new file mode 100644 index 0000000..85d07c2 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Match__c/validationRules/WinnerTeamSubset.validationRule-meta.xml @@ -0,0 +1,13 @@ + + + WinnerTeamSubset + true + The winner team can be empty or must be the Team 1 or Team 2 + WinnerBrackets_Team__c <> "" && +WinnerBrackets_Team__c <> HomeBrackets_Team__c && +WinnerBrackets_Team__c <> VisitorBrackets_Team__c + WinnerBrackets_Team__c + The winner must be the Team 1 or the Team 2 + diff --git a/force-app/main/default/objects/Brackets_Round__c/Brackets_Round__c.object-meta.xml b/force-app/main/default/objects/Brackets_Round__c/Brackets_Round__c.object-meta.xml new file mode 100644 index 0000000..49223fa --- /dev/null +++ b/force-app/main/default/objects/Brackets_Round__c/Brackets_Round__c.object-meta.xml @@ -0,0 +1,51 @@ + + + + Accept + Default + + + Clone + Default + + + Delete + Default + + + Edit + Default + + + List + Default + + + New + Default + + + Tab + Default + + + View + Default + + Deployed + false + false + false + false + true + + + + Text + + Rounds + + New + + ControlledByParent + diff --git a/force-app/main/default/objects/Brackets_Round__c/fields/Brackets_Tournament__c.field-meta.xml b/force-app/main/default/objects/Brackets_Round__c/fields/Brackets_Tournament__c.field-meta.xml new file mode 100644 index 0000000..c09423b --- /dev/null +++ b/force-app/main/default/objects/Brackets_Round__c/fields/Brackets_Tournament__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Brackets_Tournament__c + false + + Brackets_Tournament__c + Rounds + Rounds + 0 + MasterDetail + false + diff --git a/force-app/main/default/objects/Brackets_Round__c/fields/Deadline__c.field-meta.xml b/force-app/main/default/objects/Brackets_Round__c/fields/Deadline__c.field-meta.xml new file mode 100644 index 0000000..7520606 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Round__c/fields/Deadline__c.field-meta.xml @@ -0,0 +1,10 @@ + + + Deadline__c + false + Last date to make predictions for the round. + + false + DateTime + diff --git a/force-app/main/default/objects/Brackets_Round__c/fields/End__c.field-meta.xml b/force-app/main/default/objects/Brackets_Round__c/fields/End__c.field-meta.xml new file mode 100644 index 0000000..d5e15d1 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Round__c/fields/End__c.field-meta.xml @@ -0,0 +1,12 @@ + + + End__c + false + End date of the round, calculated with the date of the last match. + + Brackets_Match__c.Schedule__c + Brackets_Match__c.Brackets_Round__c + max + Summary + diff --git a/force-app/main/default/objects/Brackets_Round__c/fields/ExternalId__c.field-meta.xml b/force-app/main/default/objects/Brackets_Round__c/fields/ExternalId__c.field-meta.xml new file mode 100644 index 0000000..1797d4b --- /dev/null +++ b/force-app/main/default/objects/Brackets_Round__c/fields/ExternalId__c.field-meta.xml @@ -0,0 +1,10 @@ + + + ExternalId__c + true + + 50 + false + Text + false + diff --git a/force-app/main/default/objects/Brackets_Round__c/fields/MinScheduleBrackets_Match__c.field-meta.xml b/force-app/main/default/objects/Brackets_Round__c/fields/MinScheduleBrackets_Match__c.field-meta.xml new file mode 100644 index 0000000..b88f3d7 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Round__c/fields/MinScheduleBrackets_Match__c.field-meta.xml @@ -0,0 +1,10 @@ + + + MinScheduleBrackets_Match__c + false + + Brackets_Match__c.Schedule__c + Brackets_Match__c.Brackets_Round__c + min + Summary + diff --git a/force-app/main/default/objects/Brackets_Round__c/fields/RoundNumber__c.field-meta.xml b/force-app/main/default/objects/Brackets_Round__c/fields/RoundNumber__c.field-meta.xml new file mode 100644 index 0000000..0d859db --- /dev/null +++ b/force-app/main/default/objects/Brackets_Round__c/fields/RoundNumber__c.field-meta.xml @@ -0,0 +1,14 @@ + + + RoundNumber__c + 0 + false + Number indicating the position of the round, being 1 the first round + + 18 + false + 0 + Number + false + diff --git a/force-app/main/default/objects/Brackets_Round__c/fields/ScorePoints__c.field-meta.xml b/force-app/main/default/objects/Brackets_Round__c/fields/ScorePoints__c.field-meta.xml new file mode 100644 index 0000000..bb13c44 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Round__c/fields/ScorePoints__c.field-meta.xml @@ -0,0 +1,14 @@ + + + ScorePoints__c + 0 + false + Points a user wins for each correct prediction in the round + + 10 + true + 0 + Number + false + diff --git a/force-app/main/default/objects/Brackets_Round__c/fields/Start__c.field-meta.xml b/force-app/main/default/objects/Brackets_Round__c/fields/Start__c.field-meta.xml new file mode 100644 index 0000000..3d64ea6 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Round__c/fields/Start__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Start__c + false + Start date of the round, calculated with the date of the first match. + + Brackets_Match__c.Schedule__c + Brackets_Match__c.Brackets_Round__c + min + Summary + diff --git a/force-app/main/default/objects/Brackets_Round__c/validationRules/DeadlineBeforeSchedule.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Round__c/validationRules/DeadlineBeforeSchedule.validationRule-meta.xml new file mode 100644 index 0000000..39f8050 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Round__c/validationRules/DeadlineBeforeSchedule.validationRule-meta.xml @@ -0,0 +1,10 @@ + + + DeadlineBeforeSchedule + true + Deadline__c > MinScheduleBrackets_Match__c + Deadline__c + This date is greater than their matches's schedule. + diff --git a/force-app/main/default/objects/Brackets_Round__c/validationRules/DeadlineBeforeStart.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Round__c/validationRules/DeadlineBeforeStart.validationRule-meta.xml new file mode 100644 index 0000000..37f2b31 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Round__c/validationRules/DeadlineBeforeStart.validationRule-meta.xml @@ -0,0 +1,12 @@ + + + DeadlineBeforeStart + true + The deadline must be before the first game + and ( +!isblank(Deadline__c), +!isblank(Start__c), +Deadline__c > Start__c ) + The deadline must be before the first game (round) + diff --git a/force-app/main/default/objects/Brackets_Round__c/validationRules/PositiveScorePoints.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Round__c/validationRules/PositiveScorePoints.validationRule-meta.xml new file mode 100644 index 0000000..387f949 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Round__c/validationRules/PositiveScorePoints.validationRule-meta.xml @@ -0,0 +1,8 @@ + + + PositiveScorePoints + true + The score points must be a positive integer + ScorePoints__c < 0 + Score points must be positive + diff --git a/force-app/main/default/objects/Brackets_Round__c/validationRules/PositveRoundNumber.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Round__c/validationRules/PositveRoundNumber.validationRule-meta.xml new file mode 100644 index 0000000..e519120 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Round__c/validationRules/PositveRoundNumber.validationRule-meta.xml @@ -0,0 +1,8 @@ + + + PositveRoundNumber + true + The round number must be positive + RoundNumber__c < 0 + The round number must be positive + diff --git a/force-app/main/default/objects/Brackets_Round__c/validationRules/RoundNumberNotUpdateable.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Round__c/validationRules/RoundNumberNotUpdateable.validationRule-meta.xml new file mode 100644 index 0000000..8d43d9b --- /dev/null +++ b/force-app/main/default/objects/Brackets_Round__c/validationRules/RoundNumberNotUpdateable.validationRule-meta.xml @@ -0,0 +1,9 @@ + + + RoundNumberNotUpdateable + true + NOT(ISNEW()) && ISCHANGED( RoundNumber__c ) + RoundNumber__c + This field is not updatable. + diff --git a/force-app/main/default/objects/Brackets_Team__c/Brackets_Team__c.object-meta.xml b/force-app/main/default/objects/Brackets_Team__c/Brackets_Team__c.object-meta.xml new file mode 100644 index 0000000..4aa7dcb --- /dev/null +++ b/force-app/main/default/objects/Brackets_Team__c/Brackets_Team__c.object-meta.xml @@ -0,0 +1,50 @@ + + + + Accept + Default + + + Clone + Default + + + Delete + Default + + + Edit + Default + + + List + Default + + + New + Default + + + Tab + Default + + + View + Default + + Deployed + false + false + true + false + true + + + + false + Text + + Teams + + ReadWrite + diff --git a/force-app/main/default/objects/Brackets_Team__c/fields/Description__c.field-meta.xml b/force-app/main/default/objects/Brackets_Team__c/fields/Description__c.field-meta.xml new file mode 100644 index 0000000..8ad5e91 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Team__c/fields/Description__c.field-meta.xml @@ -0,0 +1,10 @@ + + + Description__c + false + Team full description + + false + false + TextArea + diff --git a/force-app/main/default/objects/Brackets_Team__c/fields/ExternalId__c.field-meta.xml b/force-app/main/default/objects/Brackets_Team__c/fields/ExternalId__c.field-meta.xml new file mode 100644 index 0000000..82fb01c --- /dev/null +++ b/force-app/main/default/objects/Brackets_Team__c/fields/ExternalId__c.field-meta.xml @@ -0,0 +1,11 @@ + + + ExternalId__c + true + + 50 + false + false + Text + false + diff --git a/force-app/main/default/objects/Brackets_Team__c/fields/Rank__c.field-meta.xml b/force-app/main/default/objects/Brackets_Team__c/fields/Rank__c.field-meta.xml new file mode 100644 index 0000000..e22960c --- /dev/null +++ b/force-app/main/default/objects/Brackets_Team__c/fields/Rank__c.field-meta.xml @@ -0,0 +1,13 @@ + + + Rank__c + false + Team ranking + + 10 + false + 0 + false + Number + false + diff --git a/force-app/main/default/objects/Brackets_Team__c/fields/ShortName__c.field-meta.xml b/force-app/main/default/objects/Brackets_Team__c/fields/ShortName__c.field-meta.xml new file mode 100644 index 0000000..f360f8e --- /dev/null +++ b/force-app/main/default/objects/Brackets_Team__c/fields/ShortName__c.field-meta.xml @@ -0,0 +1,13 @@ + + + ShortName__c + false + Short name (max 9 chars) to show on predictions tree + + 9 + false + false + Text + false + diff --git a/force-app/main/default/objects/Brackets_Team__c/listViews/All.listView-meta.xml b/force-app/main/default/objects/Brackets_Team__c/listViews/All.listView-meta.xml new file mode 100644 index 0000000..20fab59 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Team__c/listViews/All.listView-meta.xml @@ -0,0 +1,9 @@ + + + All + NAME + ShortName__c + Description__c + Everything + + diff --git a/force-app/main/default/objects/Brackets_Team__c/listViews/All1.listView-meta.xml b/force-app/main/default/objects/Brackets_Team__c/listViews/All1.listView-meta.xml new file mode 100644 index 0000000..19b33da --- /dev/null +++ b/force-app/main/default/objects/Brackets_Team__c/listViews/All1.listView-meta.xml @@ -0,0 +1,6 @@ + + + All1 + Everything + + diff --git a/force-app/main/default/objects/Brackets_Team__c/validationRules/RankGreaterOrEqualThanZero.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Team__c/validationRules/RankGreaterOrEqualThanZero.validationRule-meta.xml new file mode 100644 index 0000000..dc9f14f --- /dev/null +++ b/force-app/main/default/objects/Brackets_Team__c/validationRules/RankGreaterOrEqualThanZero.validationRule-meta.xml @@ -0,0 +1,8 @@ + + + RankGreaterOrEqualThanZero + true + Rank__c < 0 + Rank__c + This value must be greater or equal than zero. + diff --git a/force-app/main/default/objects/Brackets_Team__c/webLinks/Export.webLink-meta.xml b/force-app/main/default/objects/Brackets_Team__c/webLinks/Export.webLink-meta.xml new file mode 100644 index 0000000..aebd327 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Team__c/webLinks/Export.webLink-meta.xml @@ -0,0 +1,26 @@ + + + Export + online + massActionButton + javascript + Export + onClickJavaScript + false + true + var records = {!GETRECORDIDS( $ObjectType.Brackets_Team__c )} ; +var oName = 'Team'; +var error = false; +var msj = ''; +if( records.length < 1 ){ + error = true; + msj = 'Please select at least one Team!'; +} + +if( error ) { + alert( msj ); +} +else{ + location.href = '/apex/ExportTeams?refId='+records+'&refType='+oName; +} + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/Brackets_Tournament__c.object-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/Brackets_Tournament__c.object-meta.xml new file mode 100644 index 0000000..73a37cc --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/Brackets_Tournament__c.object-meta.xml @@ -0,0 +1,49 @@ + + + + Accept + Default + + + Clone + Default + + + Delete + Default + + + Edit + Default + + + List + Default + + + New + Default + + + Tab + Default + + + View + Default + + Deployed + false + false + false + false + true + + + + Text + + Tournaments + + ReadWrite + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/fields/Allow_Update__c.field-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/fields/Allow_Update__c.field-meta.xml new file mode 100644 index 0000000..1a1fff0 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/fields/Allow_Update__c.field-meta.xml @@ -0,0 +1,8 @@ + + + Allow_Update__c + false + false + + Checkbox + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/fields/CronTrigger__c.field-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/fields/CronTrigger__c.field-meta.xml new file mode 100644 index 0000000..9cd7f33 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/fields/CronTrigger__c.field-meta.xml @@ -0,0 +1,12 @@ + + + CronTrigger__c + false + Save CronTrigger Referenced ID + false + + 255 + false + Text + true + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/fields/Deadline__c.field-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/fields/Deadline__c.field-meta.xml new file mode 100644 index 0000000..223c361 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/fields/Deadline__c.field-meta.xml @@ -0,0 +1,10 @@ + + + Deadline__c + false + Deadline for the "Full tournament" type pools. + + false + DateTime + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/fields/Description__c.field-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/fields/Description__c.field-meta.xml new file mode 100644 index 0000000..f1d4a68 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/fields/Description__c.field-meta.xml @@ -0,0 +1,9 @@ + + + Description__c + false + General description of the tournament. + + false + TextArea + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/fields/End__c.field-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/fields/End__c.field-meta.xml new file mode 100644 index 0000000..af0b34b --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/fields/End__c.field-meta.xml @@ -0,0 +1,13 @@ + + + End__c + false + Tournament end date, calculated with the date of the last match played + + Brackets_Round__c.End__c + Brackets_Round__c.Brackets_Tournament__c + max + Summary + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/fields/ExternalId__c.field-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/fields/ExternalId__c.field-meta.xml new file mode 100644 index 0000000..1797d4b --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/fields/ExternalId__c.field-meta.xml @@ -0,0 +1,10 @@ + + + ExternalId__c + true + + 50 + false + Text + false + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/fields/MaxRoundNumber__c.field-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/fields/MaxRoundNumber__c.field-meta.xml new file mode 100644 index 0000000..44d160a --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/fields/MaxRoundNumber__c.field-meta.xml @@ -0,0 +1,11 @@ + + + MaxRoundNumber__c + false + + Brackets_Round__c.RoundNumber__c + Brackets_Round__c.Brackets_Tournament__c + max + Summary + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/fields/Start__c.field-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/fields/Start__c.field-meta.xml new file mode 100644 index 0000000..41266fe --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/fields/Start__c.field-meta.xml @@ -0,0 +1,13 @@ + + + Start__c + false + Tournament start date, calculated with the date of the first match played + + Brackets_Round__c.Start__c + Brackets_Round__c.Brackets_Tournament__c + min + Summary + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/fields/TeamCount__c.field-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/fields/TeamCount__c.field-meta.xml new file mode 100644 index 0000000..f6adaae --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/fields/TeamCount__c.field-meta.xml @@ -0,0 +1,14 @@ + + + TeamCount__c + 0 + false + Number of teams that participate in the tournament + + 10 + true + 0 + Number + false + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/fields/Type__c.field-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/fields/Type__c.field-meta.xml new file mode 100644 index 0000000..6ddd5d6 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/fields/Type__c.field-meta.xml @@ -0,0 +1,25 @@ + + + Type__c + false + Which type of tournament this is? + +Types supported include: "NFL Playoff" with fixed 12 teams and "Standard" a single elimination type of tournament. + + + + + NFL Playoff + false + + + + Standard + true + + + false + + + Picklist + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/fields/Update_Source__c.field-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/fields/Update_Source__c.field-meta.xml new file mode 100644 index 0000000..1339274 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/fields/Update_Source__c.field-meta.xml @@ -0,0 +1,8 @@ + + + Update_Source__c + false + + false + Url + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/fields/Version__c.field-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/fields/Version__c.field-meta.xml new file mode 100644 index 0000000..4d4998e --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/fields/Version__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Version__c + 1 + false + + 18 + false + 0 + Number + false + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/fields/isChild__c.field-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/fields/isChild__c.field-meta.xml new file mode 100644 index 0000000..91d1433 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/fields/isChild__c.field-meta.xml @@ -0,0 +1,9 @@ + + + isChild__c + false + Enabled if a tournament is imported from a URL + false + + Checkbox + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/listViews/All.listView-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/listViews/All.listView-meta.xml new file mode 100644 index 0000000..0503433 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/listViews/All.listView-meta.xml @@ -0,0 +1,12 @@ + + + All + NAME + Allow_Update__c + isChild__c + Type__c + Update_Source__c + Version__c + Everything + + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/validationRules/DeadlineBeforeStart.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/validationRules/DeadlineBeforeStart.validationRule-meta.xml new file mode 100644 index 0000000..6efe4db --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/validationRules/DeadlineBeforeStart.validationRule-meta.xml @@ -0,0 +1,11 @@ + + + DeadlineBeforeStart + true + Tournament deadline must be set before the first match + NOT(ISNULL(Deadline__c)) && NOT(ISNULL( Start__c)) && Deadline__c > Start__c + The tournament deadline must be before the first game. + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/validationRules/TeamCountGraterThanTwo.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/validationRules/TeamCountGraterThanTwo.validationRule-meta.xml new file mode 100644 index 0000000..7291431 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/validationRules/TeamCountGraterThanTwo.validationRule-meta.xml @@ -0,0 +1,9 @@ + + + TeamCountGraterThanTwo + true + TeamCount must be greater than 2 + ISPICKVAL( Type__c, "Standard" ) && ( TeamCount__c < 2 ) + The tournament must have at least 2 teams + diff --git a/force-app/main/default/objects/Brackets_Tournament__c/validationRules/TypeNotUpdateable.validationRule-meta.xml b/force-app/main/default/objects/Brackets_Tournament__c/validationRules/TypeNotUpdateable.validationRule-meta.xml new file mode 100644 index 0000000..a43fdc4 --- /dev/null +++ b/force-app/main/default/objects/Brackets_Tournament__c/validationRules/TypeNotUpdateable.validationRule-meta.xml @@ -0,0 +1,9 @@ + + + TypeNotUpdateable + true + NOT(ISNEW()) && ISCHANGED( Type__c ) + Type__c + This field can't be updated. + diff --git a/force-app/main/default/objects/Brackets_UserMatchPred__c/Brackets_UserMatchPred__c.object-meta.xml b/force-app/main/default/objects/Brackets_UserMatchPred__c/Brackets_UserMatchPred__c.object-meta.xml new file mode 100644 index 0000000..f9060dc --- /dev/null +++ b/force-app/main/default/objects/Brackets_UserMatchPred__c/Brackets_UserMatchPred__c.object-meta.xml @@ -0,0 +1,50 @@ + + + + Accept + Default + + + Clone + Default + + + Delete + Default + + + Edit + Default + + + List + Default + + + New + Default + + + Tab + Default + + + View + Default + + Deployed + false + false + false + false + true + + + UMP-{00000} + + AutoNumber + + UserMatchPredictions + + ControlledByParent + diff --git a/force-app/main/default/objects/Brackets_UserMatchPred__c/fields/Brackets_Match__c.field-meta.xml b/force-app/main/default/objects/Brackets_UserMatchPred__c/fields/Brackets_Match__c.field-meta.xml new file mode 100644 index 0000000..332e79e --- /dev/null +++ b/force-app/main/default/objects/Brackets_UserMatchPred__c/fields/Brackets_Match__c.field-meta.xml @@ -0,0 +1,10 @@ + + + Brackets_Match__c + false + + Brackets_Match__c + UserMatchPredictions + UserMatchPredictions + Lookup + diff --git a/force-app/main/default/objects/Brackets_UserMatchPred__c/fields/Brackets_UserTournament__c.field-meta.xml b/force-app/main/default/objects/Brackets_UserMatchPred__c/fields/Brackets_UserTournament__c.field-meta.xml new file mode 100644 index 0000000..edaa3e7 --- /dev/null +++ b/force-app/main/default/objects/Brackets_UserMatchPred__c/fields/Brackets_UserTournament__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Brackets_UserTournament__c + false + + Brackets_UserTournament__c + UserMatchPredictions + UserMatchPredictions + 0 + MasterDetail + false + diff --git a/force-app/main/default/objects/Brackets_UserMatchPred__c/fields/Points__c.field-meta.xml b/force-app/main/default/objects/Brackets_UserMatchPred__c/fields/Points__c.field-meta.xml new file mode 100644 index 0000000..3f2a5dc --- /dev/null +++ b/force-app/main/default/objects/Brackets_UserMatchPred__c/fields/Points__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Points__c + 0 + false + + 10 + false + 0 + Number + false + diff --git a/force-app/main/default/objects/Brackets_UserMatchPred__c/fields/PredictedWinnerBrackets_Team__c.field-meta.xml b/force-app/main/default/objects/Brackets_UserMatchPred__c/fields/PredictedWinnerBrackets_Team__c.field-meta.xml new file mode 100644 index 0000000..d9cbf85 --- /dev/null +++ b/force-app/main/default/objects/Brackets_UserMatchPred__c/fields/PredictedWinnerBrackets_Team__c.field-meta.xml @@ -0,0 +1,10 @@ + + + PredictedWinnerBrackets_Team__c + false + + Brackets_Team__c + UserMatchPredictions + UserMatchPredictions + Lookup + diff --git a/force-app/main/default/objects/Brackets_UserMatchPred__c/validationRules/UserPredictionBeforeDeadlineRound.validationRule-meta.xml b/force-app/main/default/objects/Brackets_UserMatchPred__c/validationRules/UserPredictionBeforeDeadlineRound.validationRule-meta.xml new file mode 100644 index 0000000..c7ac60c --- /dev/null +++ b/force-app/main/default/objects/Brackets_UserMatchPred__c/validationRules/UserPredictionBeforeDeadlineRound.validationRule-meta.xml @@ -0,0 +1,14 @@ + + + UserPredictionBeforeDeadlineRound + true + //deactivated as we need to update this object with points scored -- gives a false positive. + IF( +and( +ISPICKVAL(Brackets_UserTournament__r.Brackets_Group__r.Type__c, 'Round'), +ISCHANGED( PredictedWinnerBrackets_Team__c ) ) +,Brackets_Match__r.Brackets_Round__r.Deadline__c < NOW(), false) + Prediction for this match can be done after deadline of its round. + diff --git a/force-app/main/default/objects/Brackets_UserTournament__c/Brackets_UserTournament__c.object-meta.xml b/force-app/main/default/objects/Brackets_UserTournament__c/Brackets_UserTournament__c.object-meta.xml new file mode 100644 index 0000000..b33b321 --- /dev/null +++ b/force-app/main/default/objects/Brackets_UserTournament__c/Brackets_UserTournament__c.object-meta.xml @@ -0,0 +1,56 @@ + + + + Accept + Default + + + Clone + Default + + + Delete + Default + + + Edit + Default + + + List + Default + + + New + Default + + + Tab + Default + + + View + Default + + Deployed + false + false + false + false + true + + + UT-{00000} + + AutoNumber + + Pool Members + + New + ChangeOwner + Accept + Brackets_Tournament__c + + ControlledByParent + diff --git a/force-app/main/default/objects/Brackets_UserTournament__c/fields/Brackets_Group__c.field-meta.xml b/force-app/main/default/objects/Brackets_UserTournament__c/fields/Brackets_Group__c.field-meta.xml new file mode 100644 index 0000000..8c581e7 --- /dev/null +++ b/force-app/main/default/objects/Brackets_UserTournament__c/fields/Brackets_Group__c.field-meta.xml @@ -0,0 +1,11 @@ + + + Brackets_Group__c + false + + Brackets_Group__c + UserTornaments + 0 + MasterDetail + false + diff --git a/force-app/main/default/objects/Brackets_UserTournament__c/fields/Brackets_Tournament__c.field-meta.xml b/force-app/main/default/objects/Brackets_UserTournament__c/fields/Brackets_Tournament__c.field-meta.xml new file mode 100644 index 0000000..0ace227 --- /dev/null +++ b/force-app/main/default/objects/Brackets_UserTournament__c/fields/Brackets_Tournament__c.field-meta.xml @@ -0,0 +1,9 @@ + + + Brackets_Tournament__c + false + + Brackets_Tournament__c + UserTornaments + Lookup + diff --git a/force-app/main/default/objects/Brackets_UserTournament__c/fields/Championship_Point_Prediction__c.field-meta.xml b/force-app/main/default/objects/Brackets_UserTournament__c/fields/Championship_Point_Prediction__c.field-meta.xml new file mode 100644 index 0000000..6f12112 --- /dev/null +++ b/force-app/main/default/objects/Brackets_UserTournament__c/fields/Championship_Point_Prediction__c.field-meta.xml @@ -0,0 +1,13 @@ + + + Championship_Point_Prediction__c + false + Used for breaking any ties. Enter the total number of points scored by both teams in the championship game. + + 4 + false + 0 + Number + false + diff --git a/force-app/main/default/objects/Brackets_UserTournament__c/fields/Points__c.field-meta.xml b/force-app/main/default/objects/Brackets_UserTournament__c/fields/Points__c.field-meta.xml new file mode 100644 index 0000000..fe90a8a --- /dev/null +++ b/force-app/main/default/objects/Brackets_UserTournament__c/fields/Points__c.field-meta.xml @@ -0,0 +1,11 @@ + + + Points__c + false + + Brackets_UserMatchPred__c.Points__c + Brackets_UserMatchPred__c.Brackets_UserTournament__c + sum + Summary + diff --git a/force-app/main/default/objects/Brackets_UserTournament__c/fields/Tiebreaker_Points__c.field-meta.xml b/force-app/main/default/objects/Brackets_UserTournament__c/fields/Tiebreaker_Points__c.field-meta.xml new file mode 100644 index 0000000..ad8a2ba --- /dev/null +++ b/force-app/main/default/objects/Brackets_UserTournament__c/fields/Tiebreaker_Points__c.field-meta.xml @@ -0,0 +1,12 @@ + + + Tiebreaker_Points__c + false + if (now() > Brackets_Group__r.Brackets_Tournament__r.End__c ,text(Championship_Point_Prediction__c) , 'xxx') + BlankAsZero + + false + Text + false + diff --git a/force-app/main/default/objects/Brackets_UserTournament__c/fields/User__c.field-meta.xml b/force-app/main/default/objects/Brackets_UserTournament__c/fields/User__c.field-meta.xml new file mode 100644 index 0000000..80c117c --- /dev/null +++ b/force-app/main/default/objects/Brackets_UserTournament__c/fields/User__c.field-meta.xml @@ -0,0 +1,9 @@ + + + User__c + false + + User + UserTornaments + Lookup + diff --git a/force-app/main/default/objects/Brackets_UserTournament__c/fields/View__c.field-meta.xml b/force-app/main/default/objects/Brackets_UserTournament__c/fields/View__c.field-meta.xml new file mode 100644 index 0000000..89b7980 --- /dev/null +++ b/force-app/main/default/objects/Brackets_UserTournament__c/fields/View__c.field-meta.xml @@ -0,0 +1,14 @@ + + + View__c + false + IF( +$User.Id == User__r.Id , +HYPERLINK('/apex/BracketsPredictions?show=' + Brackets_Group__c , 'Manage Predictions'), +HYPERLINK('/apex/BracketsPredictions?view=' + Id , 'Show Predictions')) + BlankAsZero + + false + Text + false + diff --git a/force-app/main/default/objects/Brackets_UserTournament__c/listViews/All1.listView-meta.xml b/force-app/main/default/objects/Brackets_UserTournament__c/listViews/All1.listView-meta.xml new file mode 100644 index 0000000..0fd3670 --- /dev/null +++ b/force-app/main/default/objects/Brackets_UserTournament__c/listViews/All1.listView-meta.xml @@ -0,0 +1,11 @@ + + + All1 + User__c + Brackets_Tournament__c + Brackets_Group__c + Points__c + View__c + Everything + + diff --git a/force-app/main/default/objects/Brackets_UserTournament__c/listViews/All_Tournaments.listView-meta.xml b/force-app/main/default/objects/Brackets_UserTournament__c/listViews/All_Tournaments.listView-meta.xml new file mode 100644 index 0000000..16bd9e8 --- /dev/null +++ b/force-app/main/default/objects/Brackets_UserTournament__c/listViews/All_Tournaments.listView-meta.xml @@ -0,0 +1,11 @@ + + + All_Tournaments + User__c + Points__c + Brackets_Tournament__c + Brackets_Group__c + View__c + Everything + + diff --git a/force-app/main/default/pages/BracketsAbout.page b/force-app/main/default/pages/BracketsAbout.page new file mode 100644 index 0000000..375fc34 --- /dev/null +++ b/force-app/main/default/pages/BracketsAbout.page @@ -0,0 +1,360 @@ + + + + +

+ Congratulations! You have successfully + installed Brackets. +

+

+ Brackets is easy to configure and simple to play. This screen + helps you initialize your app in two steps. The first gives you + a sample to experiment with now, the second will give you the + full 64 team tournament when it is ready. +

+

+ The Configuration Guide at the bottom of this page shows you how + to configure your profile permissions for players. Also, there + are a number of Handy Links at the bottom. +

+

+ Have questions? Please post them to + Salesforce Answers. +

+
+ +
    +
  • + All Tournament, All Groups Leaderboard +
  • +
  • + Import Tournament Page - Also Use For + Updates +
  • +
  • + Tournaments + - List all Tournaments. +
  • +
  • + Pools + - List all Pools. +
  • +
  • + Teams + - List all Teams. +
  • +
+
+
+ + + + +

+ Import this short SAMPLE tournament in order to + familiarize yourself and your users with the + app. +

+ +

+ Error + +

+
+ + + + + + + + + + + + + + + +

+ Congratulations! You have + successfully imported the sample tournament. +

+

+ Visit the  + + Play Brackets  page now. +

+
+
+
+
+
+
+
+ + +

+ Import the full 64 team basketball tournament bracket. + Bracket will be ready on March 14, 2011, at Noon EST. + Note: this tournament will skip the initial four play-in + games and start with "Round 2". +

+ +

+ Error:   + +

+
+ + + + + + + + + + + + + + + +

Step 2 Ready to Play

+
+
+
+
+
+ + + +

+ Step 1: Update Tab Visibility Settings +

+

+ Users should only see tabs they might use. This means you should + hide the "Admins Get Started Here" tab. +

+

+ Step 2: Ensure Appropriate Object Access +

+

+ +

+

+ Step 3: Enable Apex Classes and Visualforce Pages +

+

+ Once you have updated the object access rights, save your + profile changes. On the detail screen for that profile, scroll + until you see the Enabled Apex Class Access and the Enabled + Visualforce Page Access section. Enable your users for all + classes and pages that start with "Brackets". +

+

+ +

+
+ +

+ Once Brackets is configured, users should always land on the + "Play Brackets" home page. +

+

Setup > App Setup > Create > Apps > Brackets > Edit.

+

+ +

+
+ +

+ Once Brackets is installed and configured, it's easy for your + users to join in. +

+
    +
  • + Step 1: Tell your users about the app. Send an email. Post + about it on Chatter. Let them know about the sample + tournament and that the full tournament will be coming on + Monday. +
  • +
  • + Step 2: March 14, 15 and 16th will be heavy activity days + for basketball fans. Remind them that the app exists. +
  • +
  • + Step 3: Reach out to marginal sports fans and tell them + about Round-By-Round games where they can pick new teams + every time. +
  • +
  • + Step 4: Keep your tournament results up to date! You won't + need to do any data entry, but you will need to click an + "Update" button once or twice a day. +
  • +
+

+ Sample Chatter Post +

+

+ Hello everyone! We've deployed a great app to help you manage + your basketball brackets. It's called Brackets and it's in the + menu at the top of your screen. It's easy to play so check it + out today. +

+

+ Sample With Screenshots +

+

+ Hi everyone -- Check out what's new in the app -- Brackets!! + Joining is as simple as 1-2-3. Try it today! Everything kicks + off on March 14th! +

+

+ +

+

+ +

+
+ +

+ Keeping your tournaments up to date is easy. Click on the + Import Tournaments + link and click on the "Update" button near your tournament. +

+

Note: you can update as often as you like. There is no limit.

+

+ +

+
+ +
    +
  • + All Tournament, All Groups Leaderboard +
  • +
  • + Import Tournament Page - Also Use For + Updates +
  • +
  • + Tournaments + - List all Tournaments. +
  • +
  • + Pools + - List all Pools. +
  • +
  • + Teams + - List all Teams. +
  • +
+
+ +

+ In the event of a tie, how do I see players' Championship + Points predictions? + Points will show on the Leaderboard once the tournament end day + has passed. +

+
+
+ diff --git a/src/pages/BracketsAbout.page-meta.xml b/force-app/main/default/pages/BracketsAbout.page-meta.xml similarity index 58% rename from src/pages/BracketsAbout.page-meta.xml rename to force-app/main/default/pages/BracketsAbout.page-meta.xml index ad37a0b..ec145cb 100644 --- a/src/pages/BracketsAbout.page-meta.xml +++ b/force-app/main/default/pages/BracketsAbout.page-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 diff --git a/force-app/main/default/pages/BracketsImportTournament.page b/force-app/main/default/pages/BracketsImportTournament.page new file mode 100644 index 0000000..358138a --- /dev/null +++ b/force-app/main/default/pages/BracketsImportTournament.page @@ -0,0 +1,173 @@ + + + + + + + + + + +
+ Important: You must add the URL to Remote Sites : + Setup->Security->Remote Site Setting. +
+
+ + + + + + + + + + +
+ + {!statusText} + +
+ + + + + {!xmlMessage} + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameVersionCreated ByCreated DateLast Modify ByLast Modify DateActions
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
diff --git a/src/pages/BracketsImportTournament.page-meta.xml b/force-app/main/default/pages/BracketsImportTournament.page-meta.xml similarity index 59% rename from src/pages/BracketsImportTournament.page-meta.xml rename to force-app/main/default/pages/BracketsImportTournament.page-meta.xml index e6c17fb..3446e0a 100644 --- a/src/pages/BracketsImportTournament.page-meta.xml +++ b/force-app/main/default/pages/BracketsImportTournament.page-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 diff --git a/force-app/main/default/pages/BracketsJoinInvitedUser.page b/force-app/main/default/pages/BracketsJoinInvitedUser.page new file mode 100644 index 0000000..c537d21 --- /dev/null +++ b/force-app/main/default/pages/BracketsJoinInvitedUser.page @@ -0,0 +1,36 @@ + + + + + + + + + Do you want to join this pool? +
+
+ + +
+
+
+
+
+
+
+ +
+ +
diff --git a/src/pages/BracketsJoinInvitedUser.page-meta.xml b/force-app/main/default/pages/BracketsJoinInvitedUser.page-meta.xml similarity index 60% rename from src/pages/BracketsJoinInvitedUser.page-meta.xml rename to force-app/main/default/pages/BracketsJoinInvitedUser.page-meta.xml index 21af09d..19d6d2d 100644 --- a/src/pages/BracketsJoinInvitedUser.page-meta.xml +++ b/force-app/main/default/pages/BracketsJoinInvitedUser.page-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 diff --git a/force-app/main/default/pages/BracketsPools.page b/force-app/main/default/pages/BracketsPools.page new file mode 100644 index 0000000..4d13e08 --- /dev/null +++ b/force-app/main/default/pages/BracketsPools.page @@ -0,0 +1,3 @@ + + + diff --git a/src/pages/BracketsPools.page-meta.xml b/force-app/main/default/pages/BracketsPools.page-meta.xml similarity index 58% rename from src/pages/BracketsPools.page-meta.xml rename to force-app/main/default/pages/BracketsPools.page-meta.xml index 21328d4..915e3bb 100644 --- a/src/pages/BracketsPools.page-meta.xml +++ b/force-app/main/default/pages/BracketsPools.page-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 diff --git a/force-app/main/default/pages/BracketsPredictions.page b/force-app/main/default/pages/BracketsPredictions.page new file mode 100644 index 0000000..7c915e5 --- /dev/null +++ b/force-app/main/default/pages/BracketsPredictions.page @@ -0,0 +1,316 @@ + + + + + + + + +
+ Predictions for this round are not allowed! +
+
+ Predictions for the tournament are not allowed! +
+ + + + +
+

+  -  + +

+
+ +
+ Predictions for:   + +
+
+ + +
+ + + + + + + + +
+
+ Help   +
+
+ Predictions Remaining:  + +
+ +
+ Active Round:  + +
+
+
+
+ Deadline:  + +
+ + + Pool Predictions Are LOCKED. + +
+
+ + Total Championship Game Points Prediction: + + + +
+
+
+ + + Latest Chatter :  + {!lastChatterUpdate} + + (more) + + +
+
+ + +
+ + +
+ + +
+
+
+ +
+ +
+
    +
  • Double click on a team to make your prediction.
  • +
  • Hover on a team name to see team details.
  • +
  • Click on an arrow to see the team page.
  • +
  • Hover on a diamond to see game details.
  • +
  • + Click save when you have completed your predictions. +
  • +
  • + Be sure to enter your championship game points + prediciton. +
  • +
  • + View performance on the  + Leaderboard. +
  • +
+ +

+ + Hide this dialog +

+
+
+ +
+ + +
+
+ +
+ + +

+ +

+
+ + + + diff --git a/src/pages/BracketsPredictions.page-meta.xml b/force-app/main/default/pages/BracketsPredictions.page-meta.xml similarity index 57% rename from src/pages/BracketsPredictions.page-meta.xml rename to force-app/main/default/pages/BracketsPredictions.page-meta.xml index e68e3f3..d1bccee 100644 --- a/src/pages/BracketsPredictions.page-meta.xml +++ b/force-app/main/default/pages/BracketsPredictions.page-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 diff --git a/src/pages/BracketsScoreBoard.page b/force-app/main/default/pages/BracketsScoreBoard.page similarity index 53% rename from src/pages/BracketsScoreBoard.page rename to force-app/main/default/pages/BracketsScoreBoard.page index f4c7854..bf55b69 100644 --- a/src/pages/BracketsScoreBoard.page +++ b/force-app/main/default/pages/BracketsScoreBoard.page @@ -1,4 +1,3 @@ - - + - \ No newline at end of file + diff --git a/src/pages/BracketsScoreBoard.page-meta.xml b/force-app/main/default/pages/BracketsScoreBoard.page-meta.xml similarity index 59% rename from src/pages/BracketsScoreBoard.page-meta.xml rename to force-app/main/default/pages/BracketsScoreBoard.page-meta.xml index b082308..270bed9 100644 --- a/src/pages/BracketsScoreBoard.page-meta.xml +++ b/force-app/main/default/pages/BracketsScoreBoard.page-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 diff --git a/force-app/main/default/pages/BracketsTournamentLayoutButtons.page b/force-app/main/default/pages/BracketsTournamentLayoutButtons.page new file mode 100644 index 0000000..3a231f2 --- /dev/null +++ b/force-app/main/default/pages/BracketsTournamentLayoutButtons.page @@ -0,0 +1,187 @@ + + + + + + + +
+ In order to publish, Site must be created +
+
+ + +
+ + + + + + +
Is ready to publish
+
+
+
+
+ +
+ Cannot publish yet. All starting matches + much be complete before publishing. Check + your matches. +
+
+
+
+
+ +
+ Tournament has been published!. +
Import Link : + {!finalUrl} +
+
+
+
+ + + + + + + / + + + ?id={!HTMLENCODE(myTournament.Id)} +
+ +
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + {!xmlMessage} + + + + + + + +
+ +
+ +
+ +
diff --git a/src/pages/BracketsTournamentLayoutButtons.page-meta.xml b/force-app/main/default/pages/BracketsTournamentLayoutButtons.page-meta.xml similarity index 62% rename from src/pages/BracketsTournamentLayoutButtons.page-meta.xml rename to force-app/main/default/pages/BracketsTournamentLayoutButtons.page-meta.xml index 4d3acbd..b443c85 100644 --- a/src/pages/BracketsTournamentLayoutButtons.page-meta.xml +++ b/force-app/main/default/pages/BracketsTournamentLayoutButtons.page-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 diff --git a/force-app/main/default/pages/BracketsUpdateTournament.page b/force-app/main/default/pages/BracketsUpdateTournament.page new file mode 100644 index 0000000..336246b --- /dev/null +++ b/force-app/main/default/pages/BracketsUpdateTournament.page @@ -0,0 +1,9 @@ + + + diff --git a/src/pages/BracketsUpdateTournament.page-meta.xml b/force-app/main/default/pages/BracketsUpdateTournament.page-meta.xml similarity index 61% rename from src/pages/BracketsUpdateTournament.page-meta.xml rename to force-app/main/default/pages/BracketsUpdateTournament.page-meta.xml index 2805519..447d894 100644 --- a/src/pages/BracketsUpdateTournament.page-meta.xml +++ b/force-app/main/default/pages/BracketsUpdateTournament.page-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 diff --git a/force-app/main/default/permissionsets/Brackets.permissionset-meta.xml b/force-app/main/default/permissionsets/Brackets.permissionset-meta.xml new file mode 100644 index 0000000..e4ea87b --- /dev/null +++ b/force-app/main/default/permissionsets/Brackets.permissionset-meta.xml @@ -0,0 +1,624 @@ + + + + Brackets + true + + + BracketsBatchUserMatchPrediction + true + + + BracketsBatchUserMatchPredictionTest + true + + + BracketsException + true + + + BracketsExportImportTest + true + + + BracketsExportTeams + true + + + BracketsExportTeamsTest + true + + + BracketsFeedItemUtility + true + + + BracketsFeedItemUtilityTest + true + + + BracketsGetStartedController + true + + + BracketsGroupUtilities + true + + + BracketsGroupUtilitiesTest + true + + + BracketsImportExportUtilities + true + + + BracketsImportTeams + true + + + BracketsImportTeamsTest + true + + + BracketsImportTournament + true + + + BracketsImportTournamentController + true + + + BracketsImportTournamentControllerTest + true + + + BracketsImportTournamentTest + true + + + BracketsJSONObject + true + + + BracketsJSONObjectHandler + true + + + BracketsJSONObjectHandlerTest + true + + + BracketsJSONObjectTest + true + + + BracketsJoinInvitedUser + true + + + BracketsJoinInvitedUserTest + true + + + BracketsLeaderboardController + true + + + BracketsLeaderboardControllerTest + true + + + BracketsMatchUtilities + true + + + BracketsMatchUtilitiesTest + true + + + BracketsMatchesPredictionUtil + true + + + BracketsMatchesPredictionUtilTest + true + + + BracketsPoolController + true + + + BracketsPoolControllerTest + true + + + BracketsPredictionsController + true + + + BracketsPredictionsControllerTest + true + + + BracketsProccessUpdate + true + + + BracketsProcessUpdateTest + true + + + BracketsRoundUtilities + true + + + BracketsSitesTournamentPublisher + true + + + BracketsSitesTournamentPublisherTest + true + + + BracketsTeamUtilities + true + + + BracketsTeamUtilitiesTest + true + + + BracketsTestUtilities + true + + + BracketsTestUtilitiesTest + true + + + BracketsTournamentButtonsController + true + + + BracketsTournamentButtonsControllerTest + true + + + BracketsTournamentUtilities + true + + + BracketsTournamentUtilitiesTest + true + + + BracketsTreeView + true + + + BracketsTreeViewController + true + + + BracketsTreeViewControllerTest + true + + + BracketsTreeViewFootball + true + + + BracketsTreeViewStandard + true + + + BracketsTreeViewTest + true + + + BracketsTriggerUtilities + true + + + BracketsUserMatchJSONObjectHandler + true + + + BracketsUserMatchJSONObjectHandlerTest + true + + + BracketsUserTournamentUtilities + true + + + BracketsUserTournamentUtilitiesTest + true + + + true + BracketsSettings2__c + + + true + BracketsSettingsPersonal__c + + + true + Brackets_Group__c.Brackets_Tournament__c + true + + + false + Brackets_Group__c.NumOfMembers__c + true + + + true + Brackets_Group__c.Status__c + true + + + false + Brackets_Group__c.TournamentType__c + true + + + true + Brackets_Group__c.Type__c + true + + + true + Brackets_Match__c.Conference__c + true + + + true + Brackets_Match__c.Description__c + true + + + true + Brackets_Match__c.ExternalId__c + true + + + true + Brackets_Match__c.FollowingBrackets_Match__c + true + + + true + Brackets_Match__c.FollowingIsHome__c + true + + + true + Brackets_Match__c.HomeBrackets_Team__c + true + + + true + Brackets_Match__c.HomePrediction__c + true + + + true + Brackets_Match__c.HomeScore__c + true + + + true + Brackets_Match__c.Position__c + true + + + true + Brackets_Match__c.Schedule__c + true + + + true + Brackets_Match__c.VisitorBrackets_Team__c + true + + + true + Brackets_Match__c.VisitorPrediction__c + true + + + true + Brackets_Match__c.VisitorScore__c + true + + + true + Brackets_Match__c.WinnerBrackets_Team__c + true + + + true + Brackets_Match__c.isLocked__c + true + + + true + Brackets_Round__c.Deadline__c + true + + + false + Brackets_Round__c.End__c + true + + + true + Brackets_Round__c.ExternalId__c + true + + + false + Brackets_Round__c.MinScheduleBrackets_Match__c + true + + + true + Brackets_Round__c.RoundNumber__c + true + + + false + Brackets_Round__c.Start__c + true + + + true + Brackets_Team__c.Description__c + true + + + true + Brackets_Team__c.ExternalId__c + true + + + true + Brackets_Team__c.Rank__c + true + + + true + Brackets_Team__c.ShortName__c + true + + + true + Brackets_Tournament__c.Allow_Update__c + true + + + true + Brackets_Tournament__c.CronTrigger__c + true + + + true + Brackets_Tournament__c.Deadline__c + true + + + true + Brackets_Tournament__c.Description__c + true + + + false + Brackets_Tournament__c.End__c + true + + + true + Brackets_Tournament__c.ExternalId__c + true + + + false + Brackets_Tournament__c.MaxRoundNumber__c + true + + + false + Brackets_Tournament__c.Start__c + true + + + true + Brackets_Tournament__c.Type__c + true + + + true + Brackets_Tournament__c.Update_Source__c + true + + + true + Brackets_Tournament__c.Version__c + true + + + true + Brackets_Tournament__c.isChild__c + true + + + true + Brackets_UserMatchPred__c.Brackets_Match__c + true + + + true + Brackets_UserMatchPred__c.Points__c + true + + + true + Brackets_UserMatchPred__c.PredictedWinnerBrackets_Team__c + true + + + true + Brackets_UserTournament__c.Brackets_Tournament__c + true + + + true + Brackets_UserTournament__c.Championship_Point_Prediction__c + true + + + false + Brackets_UserTournament__c.Points__c + true + + + false + Brackets_UserTournament__c.Tiebreaker_Points__c + true + + + true + Brackets_UserTournament__c.User__c + true + + + false + Brackets_UserTournament__c.View__c + true + + false + + + true + true + true + true + true + Brackets_Group__c + true + + + true + true + true + true + true + Brackets_Match__c + true + + + true + true + true + true + true + Brackets_Round__c + true + + + true + true + true + true + true + Brackets_Team__c + true + + + true + true + true + true + true + Brackets_Tournament__c + true + + + true + true + true + true + true + Brackets_UserMatchPred__c + true + + + true + true + true + true + true + Brackets_UserTournament__c + true + + + BracketsAbout + true + + + BracketsImportTournament + true + + + BracketsJoinInvitedUser + true + + + BracketsPools + true + + + BracketsPredictions + true + + + BracketsScoreBoard + true + + + BracketsTournamentLayoutButtons + true + + + BracketsUpdateTournament + true + + + About_Brackets + Visible + + + Brackets_Group__c + Visible + + + Brackets_Team__c + Visible + + + Import_Tournament + Visible + + + Matches_Predictions + Visible + + + View_Leaderboard + Visible + + diff --git a/src/remoteSiteSettings/BracketsGettingStartedTournament.remoteSite b/force-app/main/default/remoteSiteSettings/BracketsGettingStartedTournament.remoteSite-meta.xml similarity index 86% rename from src/remoteSiteSettings/BracketsGettingStartedTournament.remoteSite rename to force-app/main/default/remoteSiteSettings/BracketsGettingStartedTournament.remoteSite-meta.xml index fb01871..79e38c3 100644 --- a/src/remoteSiteSettings/BracketsGettingStartedTournament.remoteSite +++ b/force-app/main/default/remoteSiteSettings/BracketsGettingStartedTournament.remoteSite-meta.xml @@ -1,4 +1,4 @@ - + false true diff --git a/src/staticresources/Brackets.resource-meta.xml b/force-app/main/default/staticresources/Brackets.resource-meta.xml similarity index 72% rename from src/staticresources/Brackets.resource-meta.xml rename to force-app/main/default/staticresources/Brackets.resource-meta.xml index 664da7f..d52577b 100644 --- a/src/staticresources/Brackets.resource-meta.xml +++ b/force-app/main/default/staticresources/Brackets.resource-meta.xml @@ -1,5 +1,5 @@ - + Private application/zip - + \ No newline at end of file diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/._css b/force-app/main/default/staticresources/Brackets/__MACOSX/._css new file mode 100644 index 0000000..34622c1 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/._css differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/._images b/force-app/main/default/staticresources/Brackets/__MACOSX/._images new file mode 100644 index 0000000..886bcfa Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/._images differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/._js b/force-app/main/default/staticresources/Brackets/__MACOSX/._js new file mode 100644 index 0000000..f72b47f Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/._js differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/._shots b/force-app/main/default/staticresources/Brackets/__MACOSX/._shots new file mode 100644 index 0000000..97779f9 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/._shots differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/._.DS_Store b/force-app/main/default/staticresources/Brackets/__MACOSX/css/._.DS_Store new file mode 100644 index 0000000..68dd176 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/._.DS_Store differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/._ImportTornament.css b/force-app/main/default/staticresources/Brackets/__MACOSX/css/._ImportTornament.css new file mode 100644 index 0000000..e645191 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/._ImportTornament.css differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/._brackets.css b/force-app/main/default/staticresources/Brackets/__MACOSX/css/._brackets.css new file mode 100644 index 0000000..9a98a2b Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/._brackets.css differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/._images b/force-app/main/default/staticresources/Brackets/__MACOSX/css/._images new file mode 100644 index 0000000..baf7013 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/._images differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/._jquery-ui-1.8.7.custom.css b/force-app/main/default/staticresources/Brackets/__MACOSX/css/._jquery-ui-1.8.7.custom.css new file mode 100644 index 0000000..a1af56d Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/._jquery-ui-1.8.7.custom.css differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/._tipsy.css b/force-app/main/default/staticresources/Brackets/__MACOSX/css/._tipsy.css new file mode 100644 index 0000000..57fcd08 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/._tipsy.css differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._.DS_Store b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._.DS_Store new file mode 100644 index 0000000..2ba6ab8 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._.DS_Store differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._tipsy.gif b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._tipsy.gif new file mode 100644 index 0000000..b9453c6 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._tipsy.gif differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_flat_0_aaaaaa_40x100.png b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_flat_0_aaaaaa_40x100.png new file mode 100644 index 0000000..8841207 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_flat_75_ffffff_40x100.png b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_flat_75_ffffff_40x100.png new file mode 100644 index 0000000..42ec478 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_flat_75_ffffff_40x100.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_glass_55_fbf9ee_1x400.png b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_glass_55_fbf9ee_1x400.png new file mode 100644 index 0000000..77056a3 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_glass_65_ffffff_1x400.png b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_glass_65_ffffff_1x400.png new file mode 100644 index 0000000..46ac18d Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_glass_65_ffffff_1x400.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_glass_75_dadada_1x400.png b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_glass_75_dadada_1x400.png new file mode 100644 index 0000000..d4ddc08 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_glass_75_dadada_1x400.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_glass_75_e6e6e6_1x400.png b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_glass_75_e6e6e6_1x400.png new file mode 100644 index 0000000..9bc31b3 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_glass_95_fef1ec_1x400.png b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_glass_95_fef1ec_1x400.png new file mode 100644 index 0000000..31fef07 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_highlight-soft_75_cccccc_1x100.png b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100644 index 0000000..5770f75 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-icons_222222_256x240.png b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-icons_222222_256x240.png new file mode 100644 index 0000000..765c9bd Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-icons_222222_256x240.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-icons_2e83ff_256x240.png b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-icons_2e83ff_256x240.png new file mode 100644 index 0000000..e12b1dc Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-icons_2e83ff_256x240.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-icons_454545_256x240.png b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-icons_454545_256x240.png new file mode 100644 index 0000000..ef008cd Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-icons_454545_256x240.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-icons_888888_256x240.png b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-icons_888888_256x240.png new file mode 100644 index 0000000..f663abf Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-icons_888888_256x240.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-icons_cd0a0a_256x240.png b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-icons_cd0a0a_256x240.png new file mode 100644 index 0000000..1da3a48 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/css/images/._ui-icons_cd0a0a_256x240.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/images/._arrowOut10x10.png b/force-app/main/default/staticresources/Brackets/__MACOSX/images/._arrowOut10x10.png new file mode 100644 index 0000000..40fcd9b Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/images/._arrowOut10x10.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/images/._bck_blue.png b/force-app/main/default/staticresources/Brackets/__MACOSX/images/._bck_blue.png new file mode 100644 index 0000000..05e1d06 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/images/._bck_blue.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/images/._bck_grey.png b/force-app/main/default/staticresources/Brackets/__MACOSX/images/._bck_grey.png new file mode 100644 index 0000000..b94d5c9 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/images/._bck_grey.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/images/._cross.png b/force-app/main/default/staticresources/Brackets/__MACOSX/images/._cross.png new file mode 100644 index 0000000..3c153a5 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/images/._cross.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/images/._drop-no.gif b/force-app/main/default/staticresources/Brackets/__MACOSX/images/._drop-no.gif new file mode 100644 index 0000000..356c857 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/images/._drop-no.gif differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/images/._help_orange.png b/force-app/main/default/staticresources/Brackets/__MACOSX/images/._help_orange.png new file mode 100644 index 0000000..394c59e Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/images/._help_orange.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/images/._loading.gif b/force-app/main/default/staticresources/Brackets/__MACOSX/images/._loading.gif new file mode 100644 index 0000000..1929dfc Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/images/._loading.gif differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/images/._tick.png b/force-app/main/default/staticresources/Brackets/__MACOSX/images/._tick.png new file mode 100644 index 0000000..4eddccf Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/images/._tick.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/js/._jquery-ui-1.8.7.custom.min.js b/force-app/main/default/staticresources/Brackets/__MACOSX/js/._jquery-ui-1.8.7.custom.min.js new file mode 100644 index 0000000..c2b35f1 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/js/._jquery-ui-1.8.7.custom.min.js differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/js/._jquery.min.js b/force-app/main/default/staticresources/Brackets/__MACOSX/js/._jquery.min.js new file mode 100644 index 0000000..924957f Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/js/._jquery.min.js differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/js/._jquery.tipsy.min.js b/force-app/main/default/staticresources/Brackets/__MACOSX/js/._jquery.tipsy.min.js new file mode 100644 index 0000000..a15a6ea Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/js/._jquery.tipsy.min.js differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._.DS_Store b/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._.DS_Store new file mode 100644 index 0000000..d2b35bd Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._.DS_Store differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._app1.png b/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._app1.png new file mode 100644 index 0000000..a46ffe4 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._app1.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._join1.png b/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._join1.png new file mode 100644 index 0000000..86d1131 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._join1.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._sample1.png b/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._sample1.png new file mode 100644 index 0000000..63f1e9c Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._sample1.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._security1.png b/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._security1.png new file mode 100644 index 0000000..0739731 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._security1.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._security2.png b/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._security2.png new file mode 100644 index 0000000..20b8709 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._security2.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._security3.png b/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._security3.png new file mode 100644 index 0000000..e2a34d4 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._security3.png differ diff --git a/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._update1.png b/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._update1.png new file mode 100644 index 0000000..054982c Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/__MACOSX/shots/._update1.png differ diff --git a/force-app/main/default/staticresources/Brackets/css/ImportTornament.css b/force-app/main/default/staticresources/Brackets/css/ImportTornament.css new file mode 100644 index 0000000..1fda25c --- /dev/null +++ b/force-app/main/default/staticresources/Brackets/css/ImportTornament.css @@ -0,0 +1,55 @@ +.import_section input.url { + margin:0 10px; + width:400px; + background : url("/img/alohaSkin/feeds/textfield_bg80opacity.png") repeat-x scroll center top #FFF; + font-size:1.2em; + min-height:1.3em; + border:1px solid #999999; + margin:0; + padding:4px; + } +.tournamentlist { + border : 0; + background: transparent; +} + +.tournamentlist thead tr th { border-bottom : 1px solid #999999!important; } + +.tournamentlist th, .tournamentlist td { + line-height: 25px; +} + +.message.infoM2 { + margin : 10px 0px ; +} +.message.infoM2 span { + float : left; +} +.statusStart { + background:url("/img/loading.gif") no-repeat scroll 0 0 transparent; + display:block; + float:left; + margin:4px; + width:18px; + overflow: hidden; + text-indent: -500%; +} +.statusStop { display:none; } + +div.attention{ + background:none repeat scroll 0 0 #FFFFCC; + border:1px solid #E56363; + font-weight:bold; + padding:10px 10px 10px 10px; + text-align : center; +} + +.import_loading { + text-indent : -500%; + width : 32px; + height : 32px; + display : block; + overflow : hidden; + background : url("images/loading.gif") no-repeat scroll 50% 50% transparent; + float : left; +} \ No newline at end of file diff --git a/force-app/main/default/staticresources/Brackets/css/brackets.css b/force-app/main/default/staticresources/Brackets/css/brackets.css new file mode 100644 index 0000000..fdc6255 --- /dev/null +++ b/force-app/main/default/staticresources/Brackets/css/brackets.css @@ -0,0 +1,322 @@ +/* -------------------------------------------------------------------------- */ +/* TOURNAMENT */ +/* -------------------------------------------------------------------------- */ + +.tournament .round { + width : 155px; + float : left; + position : relative; + padding : 0; +} + +.tournament .spacer { + clear: both; +} + +.tournament .match { + border-bottom : 1px solid black; + border-top : 1px solid black; + border-right : 1px solid black; + padding : 0; +} + +.tournament .team { + background : transparent url("../images/bck_blue.png") no-repeat scroll left top; + overflow : hidden; + color : white; + text-align : left; + padding : 0 10px; + height : 20px; + font-size : 0.7em; + font-family : sans-serif; + text-align : left; + width : 135px; + line-height : 20px; +} + +.tournament .team-empty, .tournament .champion-empty , .tournament .superchampion-empty { + background : transparent url("../images/bck_grey.png") no-repeat scroll left top; + text-align : center; +} + +.tournament .highlight { + background-position: 0 -20px; +} + +.tournament .success { + border : 0 none; + font-weight : normal; + padding-top : 0; + margin-top : 0; +} + +.tournament .failure { +} + +.tournament .home { + position : relative; + top : -7px; +} + +.tournament .visitor { + position : relative; + bottom : -7px; +} + +.tournament .inner { + left : 5px; +} + +.tournament .team .state{ + float : left; + margin-right : 5px; + position : relative; + top : 5px; + width : 9px; + height : 9px; +} + +.tournament .champion { + position : relative; + left : 50%; + text-align : center; +} + +.tournament .team span.name { + width : 90px; + overflow : hidden; + height : 20px; + cursor : pointer; + float : left; +} + +.tournament .team span.score { + color : black; + text-align : right; + font-size : 1em; + padding-left : 5px; + font-weight : bold; + float : left; +} + +.tournament .prediction{ + font-style : italic; +} + + .tournament .hidden { + visibility : hidden; + } + + .tournament .right .match { + border-right : none; + border-left : 1px solid black; + } + + .tournament .right .team { + right : -10px; + } + +.tournament .champion-left { + position : relative; + text-align: center; + top: 80px; + right: 100px; +} + +.tournament .champion-right { + position : relative; + text-align: center; + top: 100px; + left: 110px; +} + +.tournament .superchampion { + position : relative; + text-align: center; + left: 5px; +} + +.tournament .championship{ + position : relative; + z-index : 1; +} + +.tournament .championship .round { + border-bottom:1px solid black; + height:130px; +} + +.tournament .championship .round .hline { + border-right:1px solid black; + height:100%; + left:0; + position:absolute; + top:0; + width:50%; +} + +.tournament .championship .round .match { + border: none; +} + +.missing-predictions { + clear: both; + position: relative; + top: 30px; + font-family: sans-serif; +} + +/* -------------------------------------------------------------------------- */ +/* BracketsAdmin */ +/* -------------------------------------------------------------------------- */ + +.h1Title { + font-size: 14px; +} + +/* -------------------------------------------------------------------------- */ +/* BracketsMatchesPrediction */ +/* -------------------------------------------------------------------------- */ + +#theTable { + width : 100%; +} +/* -------------------------------------------------------------------------- */ +/* BracketsTournamentLayoutButtons */ +/* -------------------------------------------------------------------------- */ + +.attention, .success{ + margin-top:10px; + background:none repeat scroll 0 0 #FFFFCC; + font-weight:bold; + padding:10px 10px 10px 10px; + text-align : center; +} + +.success { + border:1px solid #006400; + color:#006400; +} + +.attention{ + border:1px solid #E56363; +} + +div.success b{ + display:block; + font-size:12px; + margin:10px auto; + width:100%; +} + +div.success em{ + display:block; + font-size:12px; + margin:10px auto; + width:100%; +} + +.statusStart{ + margin:10px auto; + padding:1px 20px; + width:35px; + height:35px; + display: block; +} + +.statusStop{ + display:none; +} + +#loader { + display:none; + background:url("../images/loading.gif") no-repeat scroll 50% 50% #F8F8F8; + height:55%; + position:absolute; + width:96%; +} + + .errorBlock { + margin: 0pt -150px; + padding: 10px; + border: 2px solid #B7191B; + background: none repeat scroll 0pt 0pt #FFFFCC; + color: #B7191B; + font-weight: bold; + display : none; + position : absolute; + top : 10px; + width: 300px; + left : 50%; + text-align: center; + } + + + + .diamond { + border-color: transparent #000000 transparent transparent; + border-style: solid; + border-width: 5px 5px 5px 0; + cursor: help; + height: 0; + margin: -5px 0; + position: absolute; + right: 0; + top: 50%; + width: 0; + } + + .diamond.rightFont { + border-color: transparent transparent transparent #000000; + border-width: 5px 0 5px 5px; + right: -6px; + z-index: 2000; + } + + .right .diamond { + left: -6px; + } + .right .diamond.leftFont{ + border-color: transparent transparent transparent #000000; + border-width: 5px 0 5px 5px; + left: 0px; + z-index: 2000; + } + + .diamontDivConteiner{ display:block;width:10px; height:10px;position:absolute;right:0;top: 50%; } + + .MatchDetail { font-family : sans-serif; font-size:11px; } + + .winner{ + background: none repeat scroll 0 0 #FFFFCC; + border: 1px solid #339900; + display: block; + font-size: 12px; + font-weight: bold; + margin: 10px 0; + padding: 5px; + text-align: center; + width: 190px; + } + + .teamDescriptionPage { + background: url("../images/arrowOut10x10.png") no-repeat scroll 0 0 transparent; + display: block; + float: left; + height: 10px; + margin-top: 5px; + width: 20px; + } + + + A:link.teamDescriptionPage {text-decoration: none} + A:visited.teamDescriptionPage {text-decoration: none} + A:active.teamDescriptionPage {text-decoration: none} + A:hover.teamDescriptionPage {text-decoration: none} + + + .team i { font-style:normal;float:left; } + + .matchDetailHTML{ display : none; } + + diff --git a/force-app/main/default/staticresources/Brackets/css/images/tipsy.gif b/force-app/main/default/staticresources/Brackets/css/images/tipsy.gif new file mode 100644 index 0000000..eb7718d Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/css/images/tipsy.gif differ diff --git a/force-app/main/default/staticresources/Brackets/css/images/ui-bg_flat_0_aaaaaa_40x100.png b/force-app/main/default/staticresources/Brackets/css/images/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100644 index 0000000..5b5dab2 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/css/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/force-app/main/default/staticresources/Brackets/css/images/ui-bg_flat_75_ffffff_40x100.png b/force-app/main/default/staticresources/Brackets/css/images/ui-bg_flat_75_ffffff_40x100.png new file mode 100644 index 0000000..ac8b229 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/css/images/ui-bg_flat_75_ffffff_40x100.png differ diff --git a/force-app/main/default/staticresources/Brackets/css/images/ui-bg_glass_55_fbf9ee_1x400.png b/force-app/main/default/staticresources/Brackets/css/images/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100644 index 0000000..ad3d634 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/css/images/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/force-app/main/default/staticresources/Brackets/css/images/ui-bg_glass_65_ffffff_1x400.png b/force-app/main/default/staticresources/Brackets/css/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100644 index 0000000..42ccba2 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/css/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/force-app/main/default/staticresources/Brackets/css/images/ui-bg_glass_75_dadada_1x400.png b/force-app/main/default/staticresources/Brackets/css/images/ui-bg_glass_75_dadada_1x400.png new file mode 100644 index 0000000..5a46b47 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/css/images/ui-bg_glass_75_dadada_1x400.png differ diff --git a/force-app/main/default/staticresources/Brackets/css/images/ui-bg_glass_75_e6e6e6_1x400.png b/force-app/main/default/staticresources/Brackets/css/images/ui-bg_glass_75_e6e6e6_1x400.png new file mode 100644 index 0000000..86c2baa Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/css/images/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/force-app/main/default/staticresources/Brackets/css/images/ui-bg_glass_95_fef1ec_1x400.png b/force-app/main/default/staticresources/Brackets/css/images/ui-bg_glass_95_fef1ec_1x400.png new file mode 100644 index 0000000..4443fdc Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/css/images/ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/force-app/main/default/staticresources/Brackets/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/force-app/main/default/staticresources/Brackets/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100644 index 0000000..7c9fa6c Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/force-app/main/default/staticresources/Brackets/css/images/ui-icons_222222_256x240.png b/force-app/main/default/staticresources/Brackets/css/images/ui-icons_222222_256x240.png new file mode 100644 index 0000000..b273ff1 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/css/images/ui-icons_222222_256x240.png differ diff --git a/force-app/main/default/staticresources/Brackets/css/images/ui-icons_2e83ff_256x240.png b/force-app/main/default/staticresources/Brackets/css/images/ui-icons_2e83ff_256x240.png new file mode 100644 index 0000000..09d1cdc Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/css/images/ui-icons_2e83ff_256x240.png differ diff --git a/force-app/main/default/staticresources/Brackets/css/images/ui-icons_454545_256x240.png b/force-app/main/default/staticresources/Brackets/css/images/ui-icons_454545_256x240.png new file mode 100644 index 0000000..59bd45b Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/css/images/ui-icons_454545_256x240.png differ diff --git a/force-app/main/default/staticresources/Brackets/css/images/ui-icons_888888_256x240.png b/force-app/main/default/staticresources/Brackets/css/images/ui-icons_888888_256x240.png new file mode 100644 index 0000000..6d02426 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/css/images/ui-icons_888888_256x240.png differ diff --git a/force-app/main/default/staticresources/Brackets/css/images/ui-icons_cd0a0a_256x240.png b/force-app/main/default/staticresources/Brackets/css/images/ui-icons_cd0a0a_256x240.png new file mode 100644 index 0000000..2ab019b Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/css/images/ui-icons_cd0a0a_256x240.png differ diff --git a/force-app/main/default/staticresources/Brackets/css/jquery-ui-1.8.7.custom.css b/force-app/main/default/staticresources/Brackets/css/jquery-ui-1.8.7.custom.css new file mode 100644 index 0000000..2442626 --- /dev/null +++ b/force-app/main/default/staticresources/Brackets/css/jquery-ui-1.8.7.custom.css @@ -0,0 +1,572 @@ +/* + * jQuery UI CSS Framework 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + + +/* + * jQuery UI CSS Framework 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + * + * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px + */ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } +.ui-widget-content a { color: #222222; } +.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } +.ui-widget-header a { color: #222222; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; } +.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } +.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } +.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } +.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } +.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } +.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } +.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } +.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } + +/* Overlays */ +.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* + * jQuery UI Resizable 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizable#theming + */ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* + * jQuery UI Selectable 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectable#theming + */ +.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } +/* + * jQuery UI Accordion 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Accordion#theming + */ +/* IE/Win - Fix animation bug - #4615 */ +.ui-accordion { width: 100%; } +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; }/* + * jQuery UI Autocomplete 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete#theming + */ +.ui-autocomplete { position: absolute; cursor: default; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* + * jQuery UI Menu 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; + float: left; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} +/* + * jQuery UI Button 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Button#theming + */ +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } +.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } +.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-buttonset { margin-right: 7px; } +.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ +/* + * jQuery UI Dialog 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog#theming + */ +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } +/* + * jQuery UI Slider 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Slider#theming + */ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; }/* + * jQuery UI Tabs 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs#theming + */ +.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } +.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } +/* + * jQuery UI Datepicker 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Datepicker#theming + */ +.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +}/* + * jQuery UI Progressbar 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar#theming + */ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/force-app/main/default/staticresources/Brackets/css/tipsy.css b/force-app/main/default/staticresources/Brackets/css/tipsy.css new file mode 100644 index 0000000..abe8d51 --- /dev/null +++ b/force-app/main/default/staticresources/Brackets/css/tipsy.css @@ -0,0 +1,26 @@ +.tipsy { + padding: 5px; + font-size: 12px; + /* opacity: 0; filter: alpha(opacity=80); + background-repeat: no-repeat; + background-image: url(images/tipsy.gif); */ + position: absolute; + z-index: 2001; +} + .tipsy-inner { + padding: 5px 8px 4px 8px; + background-color: #D8ECF3; + color: black; + max-width: 200px; + text-align: left; + } + + .tipsy-inner img { + max-width : 190px; + } + + .tipsy-inner { -moz-border-radius:3px; -webkit-border-radius:3px; } + .tipsy-north { background-position: top center; } + .tipsy-south { background-position: bottom center; } + .tipsy-east { background-position: right center; } + .tipsy-west { background-position: left center; } diff --git a/force-app/main/default/staticresources/Brackets/images/arrowOut10x10.png b/force-app/main/default/staticresources/Brackets/images/arrowOut10x10.png new file mode 100644 index 0000000..8c7f5a4 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/images/arrowOut10x10.png differ diff --git a/force-app/main/default/staticresources/Brackets/images/bck_blue.png b/force-app/main/default/staticresources/Brackets/images/bck_blue.png new file mode 100644 index 0000000..dd95a1a Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/images/bck_blue.png differ diff --git a/force-app/main/default/staticresources/Brackets/images/bck_grey.png b/force-app/main/default/staticresources/Brackets/images/bck_grey.png new file mode 100644 index 0000000..ef64e8b Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/images/bck_grey.png differ diff --git a/force-app/main/default/staticresources/Brackets/images/cross.png b/force-app/main/default/staticresources/Brackets/images/cross.png new file mode 100644 index 0000000..69c3ef6 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/images/cross.png differ diff --git a/force-app/main/default/staticresources/Brackets/images/drop-no.gif b/force-app/main/default/staticresources/Brackets/images/drop-no.gif new file mode 100644 index 0000000..08d0833 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/images/drop-no.gif differ diff --git a/force-app/main/default/staticresources/Brackets/images/help_orange.png b/force-app/main/default/staticresources/Brackets/images/help_orange.png new file mode 100644 index 0000000..81e22af Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/images/help_orange.png differ diff --git a/force-app/main/default/staticresources/Brackets/images/loading.gif b/force-app/main/default/staticresources/Brackets/images/loading.gif new file mode 100644 index 0000000..b932b77 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/images/loading.gif differ diff --git a/force-app/main/default/staticresources/Brackets/images/tick.png b/force-app/main/default/staticresources/Brackets/images/tick.png new file mode 100644 index 0000000..ca8b3ca Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/images/tick.png differ diff --git a/force-app/main/default/staticresources/Brackets/js/brackets.js b/force-app/main/default/staticresources/Brackets/js/brackets.js new file mode 100644 index 0000000..de46c1a --- /dev/null +++ b/force-app/main/default/staticresources/Brackets/js/brackets.js @@ -0,0 +1,682 @@ +//////////////////////////////////////////////////////////////////////////////// +// This file contains the following modules : +// +// * Predictions +// * Utils +// * BracketsImportTournament +// * BracketsTournamentsLayoutButtons +// * BracketsMatchesPrediction +// * BracketsTreeViewHTML +/////////////////////////////////////////////////////////////////////////////// + +//Remove all jQuery variables from the global scope +var brackets = jQuery.noConflict(); + +//functions + + + +//------------------------------------------------------------------------------ +// Predictions module +//------------------------------------------------------------------------------ + +var Predictions = Predictions || function(brackets){ + //-------------------------------------------------------------------------- + // Private attributes + //-------------------------------------------------------------------------- + + var ROUND_WIDTH = 155; + var matchData = {}; + var cupImg = ''; + var nflImg = ''; + var userTournament = ''; + var group = ''; + var predictionsCol = []; + var isNfl = false; + + //-------------------------------------------------------------------------- + // Setters / Getters + //-------------------------------------------------------------------------- + + function setImages( c, n ) { cupImg = c; nflImg = n; } + function setUserTournament( ut ) { userTournament = ut; } + function setGroup( g ) { group = g; } + function setIsNfl( nfl ) { isNfl = nfl; } + function setMatchData( k, v) { matchData[k] = v } + + //-------------------------------------------------------------------------- + // Private methods + //-------------------------------------------------------------------------- + + /** + * Init predictions module + * + * @param md Match data associative array + */ + function init(){ + setSizes(); + initTeamsAndMatches(); + if( group ){ + // Tournament disabled? + brackets('div.tournament.tournament-disabled').click( function(){ + parent.jQuery('.tournamentBlock').fadeIn( function(){ + setTimeout('parent.jQuery(".tournamentBlock").fadeOut()',5000); + } ); + }); + + initRounds(); + initDragAndDrop(); + } + }; + + /** + * Init rounds + */ + function initRounds(){ + brackets('div.tournament .round-disabled').click( function(){ + var teamObj = brackets(this).children( '.team:not(.superchampion, champion)' ); + parent.jQuery('.roundBlock').fadeIn( function(){ + if( teamObj.size() ){ showMatchDetail(teamObj); } + setTimeout('parent.jQuery(".roundBlock").fadeOut()',5000); + } ); + + }); + } + + /** + * Init team related + */ + function initTeamsAndMatches(){ + brackets('.tournament .team').hover( + function(){ brackets(this).addClass('highlight'); }, + function(){ brackets(this).removeClass('highlight') } + ); + + brackets('.tournament div.diamond').hover( + function(){ showMatchDetail( brackets(this) ) }, + function(){ brackets(this).tipsy("hide"); } + ); + + brackets('.team').hover( + function(){ tipsyTeam( brackets(this) ); }, + function(){ brackets(this).tipsy("hide"); } + ); + + } + + function showMatchDetail( obj ){ + obj.tipsy({ + trigger: 'manual', + html : true, + gravity: 'nw', + opacity: 1.0, + title: function() { return brackets('#detail'+ obj.parent().parent().attr('Id')).html() } + }); + obj.tipsy("show"); + } + + /** + * Show team popup + */ + function tipsyTeam( elem ){ + elem.tipsy({ + gravity : 'nw', + opacity : 1.0, + trigger : 'manual', + html : true, + title : function(){ + return brackets('div[name=teamDescription]', elem).html(); + } + }); + elem.tipsy("show"); + } + + /** + * Init draggable & droppable elements + */ + function initDragAndDrop(){ + if( !brackets( ".tournament.tournament-disabled" ).size() ){ + brackets( ".tournament .draggable" ).filter( function(){ + return !brackets(this).parents().hasClass('round-disabled') && + !(brackets(this).hasClass('team-empty') || + brackets(this).hasClass('champion-empty') || + brackets(this).hasClass('superchampion-empty')); + }).dblclick(function(){ + makeDrop(brackets(this)); + save(); + }); + emtpyTeamsCount(); + } + } + + + /** + * Make team drop + */ + function makeDrop( teamSource ) { + var objMatch = matchData[ teamSource.parent().parent().attr('id') ]; + var matchDest = objMatch.next; + var CleanPath = true; + + if( matchDest != '' ){ + var teamDest = brackets( 'div#' + matchDest +' div.team' ).filter(function(){ + return objMatch.nextIsHome && brackets( this ).hasClass('home') + || !objMatch.nextIsHome && brackets( this ).hasClass('visitor'); + }); + }else{ + var teamDest = brackets( 'div#' + matchDest +' div.champion' ).add(' div.superchampion'); + CleanPath = false; + } + + + + var match = matchDest; + var currentTeam = teamDest.attr('name'); + var currentMatch = match; + var matchPath = []; + + + if( teamSource.attr('name') != currentTeam ){ + // Create team node + brackets( teamDest ).replaceWith(function(){ + if( brackets(this).hasClass('champion') ){ + return '
' + + teamSource.find('div[name=teamDescription]').html() + '
' + teamSource.find('.name').text() + '
'; + } + else if( brackets(this).hasClass('superchampion') ){ + return '
' + + teamSource.find('div[name=teamDescription]').html() + '
' + + teamSource.find('.name').text() + '
'; + } + else if( brackets(this).hasClass('champion-left') ){ + return '
' + + teamSource.find('div[name=teamDescription]').html() + '
' + + teamSource.find('.name').text() + '
'; + } + else if( brackets(this).hasClass('champion-right') ){ + return '
' + + teamSource.find('div[name=teamDescription]').html() + '
' + + teamSource.find('.name').text() + '
'; + } + else{ + return '
' + + teamSource.find('div[name=teamDescription]').html() + '
' + + teamSource.find('.name').text() + '
'; + } + }); + + // Clean path + if( currentTeam && CleanPath ){ + var nodeSet; + + if( matchData[currentMatch].next == ''){ + nodeSet = brackets('.tournament div.champion').add('.tournament div.superchampion'); + } + else{ + do { + matchPath.push( '.tournament div#' + currentMatch ); + currentMatch = matchData[currentMatch].next; + } while( matchData[currentMatch] ); + + nodeSet = brackets( matchPath.join(',') ).find('div.champion, div[name=' + currentTeam + ']'); + } + + nodeSet.replaceWith(function(){ + if( brackets(this).hasClass('champion') ){ + return '
?
'; + } + else if( brackets(this).hasClass('superchampion') ){ + return '
?
'; + } + else if( brackets(this).hasClass('champion-left') ){ + return '
?
'; + } + else if( brackets(this).hasClass('champion-right') ){ + return '
?
'; + } + else{ + return '
?
'; + } + }); + } + + // Update + setSizes(); + initDragAndDrop(); + + brackets('.team').hover( + function(){ tipsyTeam( brackets(this) ); }, + function(){ brackets(this).tipsy("hide"); } + ); + } + } + + /** + * Returns true if can accept the team drag and drop + */ + function acceptDrag(draggable){ + var matchid = draggable.parent().attr('id'); + + if( matchData[matchid] ) { + var isHome = brackets(this).hasClass('home'); + var isPrevMatch = (this.parentNode && matchData[matchid].next == this.parentNode.id ) && + ((matchData[matchid].nextIsHome && isHome ) || (!matchData[matchid].nextIsHome && !isHome)) && + !( brackets(this).hasClass('superchampion') || brackets(this).hasClass('champion')); + var isLastMatch; + + if( isNfl ){ + isLastMatch = matchid && !matchData[matchid].next && brackets(this).hasClass('superchampion'); + } + else{ + isLastMatch = matchid && !matchData[matchid].next && brackets(this).hasClass('champion'); + } + + if( isPrevMatch || isLastMatch ){ + return true; + } + } + + return false; + } + + /** + * Set the tree elements height + */ + function setSizes(){ + if( isNfl ){ + brackets('div.tournament').css('width', (ROUND_WIDTH * 7) + 'px'); + setNflHeights(); + } + else{ + var round_size = brackets('.tournament .round').size(); + brackets('div.tournament').css('width', (ROUND_WIDTH * round_size) + 'px'); + setStandardHeights(); + } + brackets('div.tournament').css('margin-left', 'auto'); + brackets('div.tournament').css('margin-right', 'auto'); + } + + /** + * Set the tree elements height + */ + function setStandardHeights(){ + var h_block = 0; + var h_ini = 0; + + // Rounds + brackets('.tournament .round').each(function(i, round){ + h_block = 40 * Math.pow(2, i); + + // Spacers + brackets('.spacer', round).each(function(j, spacer){ + brackets(spacer).height( !i ? h_block : (!j ? h_ini : h_block)); + }); + + h_ini += h_block / 2; + + // Matches + brackets('.match', round).each(function(k, match){ + brackets(match).height(h_block - 2); + + // Teams + brackets('.team', match).each(function(l, team){ + if( brackets(team).hasClass('champion') ){ + brackets(team).css('top', (h_block/2 - 50) + 'px'); + } + else if(l){ + brackets(team).css('bottom', (-10 + 3 -(h_block - 40)) + 'px'); + } + }); + }); + }); + } + + /** + * Set the tree elements height + */ + function setNflHeights(){ + var h_block = []; + var h_ini = []; + var index_map = [0, 1, 2, -1, 2, 1, 0]; + + h_ini.push(0); + + // Rounds + brackets('.tournament .round').each(function(i, round){ + if( i < 3){ + h_block.push( 40 * Math.pow(2, i) ); + h_ini.push( h_ini[h_ini.length - 1] + h_block[i] / 2 ); + } + + if( i != 3 ){ + // Spacers + brackets('.spacer', round).each(function(j, spacer){ + brackets(spacer).height( !index_map[i] ? h_block[index_map[i]] : (!j ? h_ini[index_map[i]] : h_block[index_map[i]]) ); + }); + + // Matches + brackets('.match', round).each(function(k, match){ + brackets(match).height(h_block[index_map[i]] - 2); + + // Teams + brackets('.team', match).each(function(l, team){ + brackets(team).css('bottom', (-10 + 3 -(h_block[index_map[i]] - 40)) + 'px'); + }); + }); + } + }); + } + + + /** + * Save the predictions + */ + function save(){ + addPredictions(); + + brackets('#ShowMsg').removeAttr('class').text('').fadeOut(); + + brackets('div#jSonField input').val( predToJSON() ); + //doSave(); + } + + /** + * Add new or updated predictions to collection + */ + function addPredictions(){ + predictionsCol = []; + + // Add new and updated predictions + brackets('.tournament div.prediction').each(function(){ + var isHome = brackets(this).hasClass('home'); + var isChampion = isNfl ? brackets(this).hasClass('superchampion') : brackets(this).hasClass('champion'); + var teamid = brackets(this).attr('name'); + var predid = isChampion + ? brackets(this).attr('predid') + : isHome ? brackets(this).parent().parent().attr('hpredid') : brackets(this).parent().parent().attr('vpredid'); + var fmatchid = brackets(this).parent().parent().attr('id'); + var matchid = isChampion ? fmatchid : getPredictionMatch( fmatchid, isHome ); + + predictionsCol.push({ + 'matchId' : matchid, + 'teamId' : teamid, + 'userPred' : predid, + 'userTour' : userTournament + }); + }); + + // Add empty predictions + brackets('.tournament .team-empty').add('.tournament .champion-empty').add('.tournament .superchampion-empty').each(function(){ + var isHome = brackets(this).hasClass('home'); + var isChampion = isNfl ? brackets(this).hasClass('superchampion') : brackets(this).hasClass('champion'); + var predid = isChampion + ? brackets(this).attr('predid') + : isHome ? brackets(this).parent().parent().attr('hpredid') : brackets(this).parent().parent().attr('vpredid'); + + if( predid && predid != '' ){ + var fmatchid = brackets(this).parent().parent().attr('id'); + var matchid = isChampion ? fmatchid : getPredictionMatch( fmatchid, isHome ); + + predictionsCol.push({ + 'matchId' : matchid, + 'teamId' : '', + 'userPred' : predid, + 'userTour' : userTournament + }); + } + }); + } + + + /** + * Returns the parent match id + * + * @param fmatchid Id of the current match + * @param isHome True if the current team is home + */ + function getPredictionMatch( matchid, isHome ){ + var pid = matchid; + + for( var mid in matchData ){ + if( (matchData[mid].next == matchid) && + ((matchData[mid].nextIsHome && isHome) || (!matchData[mid].nextIsHome && !isHome)) + ){ + pid = mid; + break; + } + } + + return pid; + } + + /** + * Parse the prediction collection to a JSON string + */ + function predToJSON(){ + var jsonSTR = '{ '; + + for(var i=0 ; i < predictionsCol.length ; i++){ + jsonSTR += '"'+ i +'" : { '; + + jsonSTR += ' "matchId" : '; + jsonSTR += '"'+ predictionsCol[i].matchId + '" , '; + + jsonSTR += ' "teamId" : '; + jsonSTR += '"'+ predictionsCol[i].teamId + '" , '; + + jsonSTR += ' "userPred" : '; + jsonSTR += ' "'+ predictionsCol[i].userPred + '" , '; + + jsonSTR += ' "userTour" : '; + jsonSTR += ' "'+ predictionsCol[i].userTour + '" },'; + } + + jsonSTR = jsonSTR.substr(0,jsonSTR.length-1) + '}'; + return jsonSTR; + } + + /** + * Count empty teams + */ + function emtpyTeamsCount(){ + brackets('.missing-predictions-number').html( + brackets('.team-empty').add('.champion-empty').add('.superchampion-empty').size() + ); + } + + //-------------------------------------------------------------------------- + // Public methods + //-------------------------------------------------------------------------- + + return { + setImages : setImages, + setUserTournament : setUserTournament, + setGroup : setGroup, + setIsNfl : setIsNfl, + setMatchData : setMatchData, + acceptDrag : acceptDrag, + makeDrop : makeDrop, + init : init, + initDragAndDrop : initDragAndDrop, + setSizes : setSizes, + save : save, + tipsyTeam : tipsyTeam + } +}(jQuery); + +//------------------------------------------------------------------------------ +// Utils Module +//------------------------------------------------------------------------------ +var BracketsUtils = BracketsUtils || function(brackets){ + + //-------------------------------------------------------------------------- + // Private methods + //-------------------------------------------------------------------------- + + /** + * Returns a part of Domain of Salesforce with dots like : ' .na7.force.com ' + * @return domainUrl + */ + function domainUrl(domain){ + return 'http://'+domain + getNAHost() + 'force.com/'; + } + + /** + * Get the 'na?' subdomain from salesforce; + * @return naHost + */ + function getNAHost(){ + var url = location.href; + var reg = new RegExp('\\.([a-zA-Z]{2}[0-9])\\.'); + var naHost = reg.exec( url ); + return ( naHost.length > 0 ) ? naHost[0] : ''; + } + + function isValidUrl(url) { + return url.match(/^\s*(ht|f)tps?:\/\/[a-z0-9-\.]+\.[a-z]{2,4}\/?([^\s<>\#%"\,\{\}\\|\\\^\[\]`]+)?\s*brackets/); + } + //-------------------------------------------------------------------------- + // Public methods + //-------------------------------------------------------------------------- + return { + domainUrl : domainUrl, + getNAHost : getNAHost, + isValidUrl : isValidUrl + } +}(jQuery); + +//------------------------------------------------------------------------------ +// BracketsTournamentsLayoutButtons Module +//------------------------------------------------------------------------------ + +var BracketsTournamentsLayoutButtons = BracketsTournamentsLayoutButtons || function (brackets){ + + //workaround + var that = this; + //-------------------------------------------------------------------------- + // Private attributes + //-------------------------------------------------------------------------- + var domain; + + //-------------------------------------------------------------------------- + // Private methods + //-------------------------------------------------------------------------- + + function init(domain){ + that.domain = domain; + brackets(document).ready(function(){ + setText(); + }); + } + + function setText(){ + brackets('.scg span').text( BracketsUtils.domainUrl(that.domain) ); + brackets('#urlparm input').val( BracketsUtils.domainUrl(that.domain) ); + } + + function publish(){ + showloader(); + if(doPublish){ + doPublish(); + } + } + + function showloader() { + if( brackets('#loader').is(':visible') ){ + brackets('#loader').fadeOut(); + }else{ + brackets('#loader').fadeIn(); + } + } + + function finishPublish(){ + setText(); + } + + //-------------------------------------------------------------------------- + // Public methods + //-------------------------------------------------------------------------- + return { + init : init, + publish : publish, + showloader : showloader, + finishPublish : finishPublish + } +}(jQuery); + +//------------------------------------------------------------------------------ +// BracketsImportTournament Module +//------------------------------------------------------------------------------ + +var BracketsImportTournament = BracketsImportTournament || function(brackets){ + + //-------------------------------------------------------------------------- + // Private methods + //-------------------------------------------------------------------------- + function init(){ + brackets(document).ready(function(){ + brackets('input.url_btn.btn').click( function(){ + var url = brackets('input.url').val(); + if( BracketsUtils.isValidUrl( url ) ){ + doImport(); + brackets('input.url').val(''); + brackets(this).hide(); + } + else { + alert('Invalid URL\nPlease verify if all the parameters and protocol( "http:,https:" ) are included') + }; + }); + }); + } + + function allowButton(){ + brackets('input.url_btn.btn').show(); + } + //-------------------------------------------------------------------------- + // Public methods + //-------------------------------------------------------------------------- + + return { + init : init, + allow : allowButton + } +}(jQuery) + +var BracketsMatchesPrediction = BracketsMatchesPrediction || function(brackets){ + + var that = this; + //-------------------------------------------------------------------------- + // Private attributes + //-------------------------------------------------------------------------- + //-------------------------------------------------------------------------- + // Private methods + //-------------------------------------------------------------------------- + + + function resizeFrame( minHeight ){ + var divHe = parent && parent.TreeFrame && parent.TreeFrame.document.getElementById('bodyHeight'); + if( minHeight ){ + var he = divHe + ? divHe.offsetHeight > minHeight ? divHe.offsetHeight + 120 : minHeight + : minHeight; + + brackets('#TreeFrame', parent.document).attr('height', he ); + } + else if( divHe != null ) { + var he = divHe.offsetHeight + 120; + brackets('#TreeFrame', parent.document).attr('height', he ); + } + } + //-------------------------------------------------------------------------- + // Public methods + //-------------------------------------------------------------------------- + + return { + resizeFrame : resizeFrame + } +}(jQuery); diff --git a/force-app/main/default/staticresources/Brackets/js/jquery-ui-1.8.7.custom.min.js b/force-app/main/default/staticresources/Brackets/js/jquery-ui-1.8.7.custom.min.js new file mode 100644 index 0000000..b03a87e --- /dev/null +++ b/force-app/main/default/staticresources/Brackets/js/jquery-ui-1.8.7.custom.min.js @@ -0,0 +1,781 @@ +/*! + * jQuery UI 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.7",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106, +NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this, +"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position"); +if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f, +"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h, +d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}}); +c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a); +return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&c.data(a.target,this.widgetName+".preventClickEvent", +true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); +;/* + * jQuery UI Position 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Position + */ +(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, +left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= +k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+parseInt(c.curCSS(this,"marginRight",true))||0,w=m+q+parseInt(c.curCSS(this,"marginBottom",true))||0,i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-=m/2; +i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= +d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= +a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), +g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); +;/* + * jQuery UI Draggable 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== +"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= +this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- +this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions(); +d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis|| +this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode)return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element, +b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== +a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]|| +0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], +this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top- +(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment== +"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[(a.containment=="document"?0:d(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(a.containment=="document"?0:d(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"? +0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"), +10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor== +Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop(): +f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY; +if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.leftthis.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/ +b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?e:!(e-this.offset.click.left
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})}, +stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!= +document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>= +i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f
').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), +top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= +this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", +nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d
');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== +String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),k=0;k=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,k);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); +this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){e(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; +if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(), +d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset= +this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio: +this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize", +b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height; +f={width:c.size.width-(f?0:c.sizeDiff.width),height:c.size.height-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop", +b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(l(b.left))this.position.left=b.left;if(l(b.top))this.position.top=b.top;if(l(b.height))this.size.height=b.height;if(l(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top= +a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,d=l(b.width)&&a.maxWidth&&a.maxWidthb.width,h=l(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height, +k=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&k)b.left=i-a.minWidth;if(d&&k)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a
');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+ +a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this, +arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable, +{version:"1.8.7"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize, +function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var k=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:k.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n= +(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(k.css("position"))){c._revertToRelativePosition=true;k.css({position:"absolute",top:"auto",left:"auto"})}k.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition= +false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left- +a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize", +b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top", +"Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset, +f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left= +a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+ +a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&& +e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative", +height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width= +d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},l=function(b){return!isNaN(parseInt(b,10))}})(jQuery); +;/* + * jQuery UI Selectable 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), +selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, +c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting", +c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d= +this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); +this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this, +arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem= +c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset, +{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment(); +if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start", +a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute"); +if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a, +c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]== +document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp();this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate", +null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem): +d(this.domPosition.parent).prepend(this.currentItem);return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute|| +"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")}, +_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!= +this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a= +this.currentItem.find(":data(sortable-item)"),b=0;b=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable"); +if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h= +0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width= +this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f}, +update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b= +null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this)); +this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])? +g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive", +g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over= +0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"); +a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); +if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var f=d.closest(".ui-accordion-header");a.active=f.length?f:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion", +function(g){return a._keydown(g)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(g){a._clickHandler.call(a,g,this);g.preventDefault()})},_createIcons:function(){var a=this.options;if(a.icons){c("").addClass("ui-icon "+ +a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex"); +this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons(); +b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,f=this.headers.index(a.target),g=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:g=this.headers[(f+1)%d];break;case b.LEFT:case b.UP:g=this.headers[(f-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target); +a.preventDefault()}if(g){c(a.target).attr("tabIndex",-1);c(g).attr("tabIndex",0);g.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+ +c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options; +if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected); +a.next().addClass("ui-accordion-content-active")}h=a.next();f=this.active.next();g={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):h,oldContent:f};d=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(h,f,g,b,d)}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); +this.active.next().addClass("ui-accordion-content-active");var f=this.active.next(),g={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:f},h=this.active=c([]);this._toggle(h,f,g)}},_toggle:function(a,b,d,f,g){var h=this,e=h.options;h.toShow=a;h.toHide=b;h.data=d;var j=function(){if(h)return h._completed.apply(h,arguments)};h._trigger("changestart",null,h.data);h.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&f?{toShow:c([]),toHide:b,complete:j, +down:g,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:g,autoHeight:e.autoHeight||e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;f=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!f[k]&&!c.easing[k])k="slide";f[k]||(f[k]=function(l){this.slide(l,{easing:k,duration:i||700})}); +f[k](d)}else{if(e.collapsible&&f)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.7",animations:{slide:function(a, +b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),f=0,g={},h={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){h[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/);g[i]={value:j[1], +unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(h,{step:function(j,i){if(i.prop=="height")f=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=f*g[i.prop].value+g[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide",paddingTop:"hide", +paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery); +;/* + * jQuery UI Autocomplete 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + */ +(function(d){d.widget("ui.autocomplete",{options:{appendTo:"body",delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},_create:function(){var a=this,b=this.element[0].ownerDocument,f;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.attr("readonly"))){f=false;var e=d.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:a._move("previousPage", +c);break;case e.PAGE_DOWN:a._move("nextPage",c);break;case e.UP:a._move("previous",c);c.preventDefault();break;case e.DOWN:a._move("next",c);c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:if(a.menu.active){f=true;c.preventDefault()}case e.TAB:if(!a.menu.active)return;a.menu.select(c);break;case e.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay); +break}}}).bind("keypress.autocomplete",function(c){if(f){f=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};this.menu=d("
    ").addClass("ui-autocomplete").appendTo(d(this.options.appendTo|| +"body",b)[0]).mousedown(function(c){var e=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(g){g.target!==a.element[0]&&g.target!==e&&!d.ui.contains(e,g.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,e){e=e.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:e})&&/^key/.test(c.originalEvent.type)&&a.element.val(e.value)},selected:function(c,e){var g=e.item.data("item.autocomplete"), +h=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=h;setTimeout(function(){a.previous=h;a.selectedItem=g},1)}false!==a._trigger("select",c,{item:g})&&a.element.val(g.value);a.term=a.element.val();a.close(c);a.selectedItem=g},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"); +this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0])},_initSource:function(){var a=this,b,f;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,e){e(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){f=this.options.source;this.source= +function(c,e){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:f,data:c,dataType:"json",success:function(g,h,i){i===a.xhr&&e(g);a.xhr=null},error:function(g){g===a.xhr&&e([]);a.xhr=null}})}}else this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length").data("item.autocomplete",b).append(d("").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}}); +d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(a,b){var f=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return f.test(c.label||c.value||c)})}})})(jQuery); +(function(d){d.widget("ui.menu",{_create:function(){var a=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(b){if(d(b.target).closest(".ui-menu-item a").length){b.preventDefault();a.select(b)}});this.refresh()},refresh:function(){var a=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", +-1).mouseenter(function(b){a.activate(b,d(this).parent())}).mouseleave(function(){a.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var f=b.offset().top-this.element.offset().top,c=this.element.attr("scrollTop"),e=this.element.height();if(f<0)this.element.attr("scrollTop",c+f);else f>=e&&this.element.attr("scrollTop",c+f-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",a,{item:b})}, +deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null}},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,f){if(this.active){a=this.active[a+"All"](".ui-menu-item").eq(0); +a.length?this.activate(f,a):this.activate(f,this.element.children(b))}else this.activate(f,this.element.children(b))},nextPage:function(a){if(this.hasScroll())if(!this.active||this.last())this.activate(a,this.element.children(".ui-menu-item:first"));else{var b=this.active.offset().top,f=this.element.height(),c=this.element.children(".ui-menu-item").filter(function(){var e=d(this).offset().top-b-f+d(this).height();return e<10&&e>-10});c.length||(c=this.element.children(".ui-menu-item:last"));this.activate(a, +c)}else this.activate(a,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(a){if(this.hasScroll())if(!this.active||this.first())this.activate(a,this.element.children(".ui-menu-item:last"));else{var b=this.active.offset().top,f=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-b+f-d(this).height();return c<10&&c>-10});result.length||(result=this.element.children(".ui-menu-item:first")); +this.activate(a,result)}else this.activate(a,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary;if(d.primary||d.secondary){b.addClass("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary"));d.primary&&b.prepend("");d.secondary&&b.append("");if(!this.options.text){b.addClass(e?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary"); +this.hasTitle||b.attr("title",c)}}else b.addClass("ui-button-text-only")}}});a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()}, +destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");a.Widget.prototype.destroy.call(this)}})})(jQuery); +;/* + * jQuery UI Dialog 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.button.js + * jquery.ui.draggable.js + * jquery.ui.mouse.js + * jquery.ui.position.js + * jquery.ui.resizable.js + */ +(function(c,j){var k={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},l={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&& +c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
    ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex", +-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role", +"button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id",e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose= +b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");a.uiDialog.remove();a.originalTitle&& +a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==b.uiDialog[0]){e=c(this).css("z-index"); +isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=1;d.uiDialog.css("z-index",c.ui.dialog.maxZ); +d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target===f[0]&&e.shiftKey){g.focus(1);return false}}}); +c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("
    ").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,function(){return!(d=true)});if(d){c.each(a,function(f, +h){h=c.isFunction(h)?{click:h,text:f}:h;f=c('').attr(h,true).unbind("click").click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.fn.button&&f.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g= +d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,originalSize:f.originalSize, +position:f.position,size:f.size}}a=a===j?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize",f,b(h))},stop:function(f, +h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):[a[0],a[1]];if(b.length=== +1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f);if(g in k)e=true;if(g in +l)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):e.removeClass("ui-dialog-disabled"); +break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a=this.options,b,d,e= +this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height-b,0));this.uiDialog.is(":data(resizable)")&& +this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.7",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(a){if(this.instances.length=== +0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()
    ").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(), +height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight); +b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a
    ");if(!a.values)a.values=[this._valueMin(),this._valueMin()];if(a.values.length&&a.values.length!==2)a.values=[a.values[0],a.values[0]]}else this.range=d("
    ");this.range.appendTo(this.element).addClass("ui-slider-range");if(a.range==="min"||a.range==="max")this.range.addClass("ui-slider-range-"+a.range);this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("").appendTo(this.element).addClass("ui-slider-handle"); +if(a.values&&a.values.length)for(;d(".ui-slider-handle",this.element).length").appendTo(this.element).addClass("ui-slider-handle");this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){a.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(a.disabled)d(this).blur(); +else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),h,g,i;if(!b.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e= +false;if(!b._keySliding){b._keySliding=true;d(this).addClass("ui-state-active");h=b._start(c,f);if(h===false)return}break}i=b.options.step;h=b.options.values&&b.options.values.length?(g=b.values(f)):(g=b.value());switch(c.keyCode){case d.ui.keyCode.HOME:g=b._valueMin();break;case d.ui.keyCode.END:g=b._valueMax();break;case d.ui.keyCode.PAGE_UP:g=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:g=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(h=== +b._valueMax())return;g=b._trimAlignValue(h+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(h===b._valueMin())return;g=b._trimAlignValue(h-i);break}b._slide(c,f,g);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(c,e);b._change(c,e);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"); +this._mouseDestroy();return this},_mouseCapture:function(b){var a=this.options,c,e,f,h,g;if(a.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:b.pageX,y:b.pageY});e=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(i){var j=Math.abs(c-h.values(i));if(e>j){e=j;f=d(this);g=i}});if(a.range===true&&this.values(1)===a.min){g+=1;f=d(this.handles[g])}if(this._start(b, +g)===false)return false;this._mouseSliding=true;h._handleIndex=g;f.addClass("ui-state-active").focus();a=f.offset();this._clickOffset=!d(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-a.left-f.width()/2,top:b.pageY-a.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(b,g,c);return this._animateOff=true},_mouseStart:function(){return true}, +_mouseDrag:function(b){var a=this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,a);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var a; +if(this.orientation==="horizontal"){a=this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{a=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}a=b/a;if(a>1)a=1;if(a<0)a=0;if(this.orientation==="vertical")a=1-a;b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+a*b)},_start:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value= +this.values(a);c.values=this.values()}return this._trigger("start",b,c)},_slide:function(b,a,c){var e;if(this.options.values&&this.options.values.length){e=this.values(a?0:1);if(this.options.values.length===2&&this.options.range===true&&(a===0&&c>e||a===1&&c1){this.options.values[b]=this._trimAlignValue(a);this._refreshValue();this._change(null,b)}if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var a=this.options.step>0?this.options.step:1,c=(b-this._valueMin())%a;alignValue=b-c;if(Math.abs(c)*2>=a)alignValue+=c>0?a:-a;return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max}, +_refreshValue:function(){var b=this.options.range,a=this.options,c=this,e=!this._animateOff?a.animate:false,f,h={},g,i,j,l;if(this.options.values&&this.options.values.length)this.handles.each(function(k){f=(c.values(k)-c._valueMin())/(c._valueMax()-c._valueMin())*100;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](h,a.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(k===0)c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},a.animate); +if(k===1)c.range[e?"animate":"css"]({width:f-g+"%"},{queue:false,duration:a.animate})}else{if(k===0)c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},a.animate);if(k===1)c.range[e?"animate":"css"]({height:f-g+"%"},{queue:false,duration:a.animate})}g=f});else{i=this.value();j=this._valueMin();l=this._valueMax();f=l!==j?(i-j)/(l-j)*100:0;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](h,a.animate);if(b==="min"&&this.orientation==="horizontal")this.range.stop(1, +1)[e?"animate":"css"]({width:f+"%"},a.animate);if(b==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:a.animate});if(b==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},a.animate);if(b==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:a.animate})}}});d.extend(d.ui.slider,{version:"1.8.7"})})(jQuery); +;/* + * jQuery UI Tabs 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
    ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&& +e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b= +d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]|| +(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); +this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected= +this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); +if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); +this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+ +g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", +function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")}; +this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected= +-1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; +d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e= +d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b, +e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]); +j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove(); +if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null, +this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this}, +load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c, +"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, +url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.7"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k')}function E(a,b){d.extend(a,b);for(var c in b)if(b[c]== +null||b[c]==G)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.7"}});var y=(new Date).getTime();d.extend(K.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){E(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase(); +f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('
    ')}}, +_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&& +b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f== +""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a, +c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b), +true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}E(a.settings,e||{}); +b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass); +this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup", +this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs, +function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null: +f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true}, +_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");E(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos= +d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b, +c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&& +d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a));var e=a.dpDiv.find("iframe.ui-datepicker-cover");e.length&&e.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout", +function(){d(this).removeClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!= +-1&&d(this).addClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a, +"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input.focus();if(a.yearshtml){var f=a.yearshtml;setTimeout(function(){f===a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);f=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]}, +_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e- +g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1);)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]? +b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")}, +_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"): +0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear= +false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay= +d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a); +else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b= +a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;for(var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff,f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames, +j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=z+1-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}w=this._daylightSavingAdjust(new Date(c,j-1,l));if(w.getFullYear()!=c||w.getMonth()+1!=j||w.getDate()!=l)throw"Invalid date";return w},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y", +RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay= +a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(), +b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n= +this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+n+"";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+r+"":f?"":''+r+"";j=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,r,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
    '+(c?h:"")+(this._isInRange(a,r)?'":"")+(c?"":h)+"
    ":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z= +this._get(a,"monthNames"),w=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),v=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var L=this._getDefaultDate(a),I="",C=0;C1)switch(D){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]- +1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='
    '+(/all|left/.test(t)&&C==0?c?f:n:"")+(/all|right/.test(t)&&C==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,C>0||D>0,z,w)+'
    ';var A=j?'":"";for(t=0;t<7;t++){var q= +(t+h)%7;A+="=5?' class="ui-datepicker-week-end"':"")+'>'+s[q]+""}x+=A+"";A=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,A);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;A=l?6:Math.ceil((t+A)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O";var P=!j?"":'";for(t=0;t<7;t++){var F= +p?p.apply(a.input?a.input[0]:null,[q]):[true,""],B=q.getMonth()!=g,J=B&&!H||!F[0]||k&&qo;P+='";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+= +P+""}g++;if(g>11){g=0;m++}x+="
    '+this._get(a,"weekHeader")+"
    '+this._get(a,"calculateWeek")(q)+""+(B&&!v?" ":J?''+q.getDate()+"":''+q.getDate()+"")+"
    "+(l?""+(i[0]>0&&D==i[1]-1?'
    ':""):"");M+=x}I+=M}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'':"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='
    ', +o="";if(h||!j)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(k+=o+(h||!(j&& +l)?" ":""));a.yearshtml="";if(h||!l)k+=''+c+"";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='";if(d.browser.mozilla)k+='";else{k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="
    ";return k},_adjustInstDate:function(a,b,c){var e= +a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a, +"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a); +c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a, +"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker= +function(a){if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b)); +return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new K;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.7";window["DP_jQuery_"+y]=d})(jQuery); +;/* + * jQuery UI Progressbar 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("
    ").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); +this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100* +this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.7"})})(jQuery); +;/* + * jQuery UI Effects 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/ + */ +jQuery.effects||function(f,j){function n(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], +16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return o.transparent;return o[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return n(b)}function p(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, +a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function q(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d= +a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function m(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor", +"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=n(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var o={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0, +0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211, +211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},r=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b, +d){if(f.isFunction(b)){d=b;b=null}return this.each(function(){f.queue(this,"fx",function(){var e=f(this),g=e.attr("style")||" ",h=q(p.call(this)),l,v=e.attr("className");f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});l=q(p.call(this));e.attr("className",v);e.animate(u(h,l),a,b,function(){f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)});h=f.queue(this);l= +h.splice(h.length-1,1)[0];h.splice(1,0,l);f.dequeue(this)})})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c}, +b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.7",save:function(c,a){for(var b=0;b").addClass("ui-effects-wrapper").css({fontSize:"100%", +background:"transparent",border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c); +return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(m(c))return this._show.apply(this,arguments); +else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(m(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(m(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c), +b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c, +a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c, +a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a== +e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ +e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); +;/* + * jQuery UI Effects Fade 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fade + * + * Depends: + * jquery.effects.core.js + */ +(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); +;/* + * jQuery UI Effects Fold 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fold + * + * Depends: + * jquery.effects.core.js + */ +(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","left"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],10)/100* +f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); +;/* + * jQuery UI Effects Highlight 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Highlight + * + * Depends: + * jquery.effects.core.js + */ +(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& +this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); +;/* + * jQuery UI Effects Pulsate 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Pulsate + * + * Depends: + * jquery.effects.core.js + */ +(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); +b.dequeue()})})}})(jQuery); +; \ No newline at end of file diff --git a/force-app/main/default/staticresources/Brackets/js/jquery.min.js b/force-app/main/default/staticresources/Brackets/js/jquery.min.js new file mode 100644 index 0000000..27206f3 --- /dev/null +++ b/force-app/main/default/staticresources/Brackets/js/jquery.min.js @@ -0,0 +1,166 @@ +/*! + * jQuery JavaScript Library v1.4.3 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu Oct 14 23:10:06 2010 -0400 + */ +(function(E,A){function U(){return false}function ba(){return true}function ja(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ga(a){var b,d,e=[],f=[],h,k,l,n,s,v,B,D;k=c.data(this,this.nodeType?"events":"__events__");if(typeof k==="function")k=k.events;if(!(a.liveFired===this||!k||!k.live||a.button&&a.type==="click")){if(a.namespace)D=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var H=k.live.slice(0);for(n=0;nd)break;a.currentTarget=f.elem;a.data=f.handleObj.data; +a.handleObj=f.handleObj;D=f.handleObj.origHandler.apply(f.elem,arguments);if(D===false||a.isPropagationStopped()){d=f.level;if(D===false)b=false}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(Ha,"`").replace(Ia,"&")}function ka(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Ja.test(b))return c.filter(b, +e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function la(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this,e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var k in e[h])c.event.add(this,h,e[h][k],e[h][k].data)}}})}function Ka(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)} +function ma(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?La:Ma,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a,"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function ca(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Na.test(a)?e(a,h):ca(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)? +e(a,""):c.each(b,function(f,h){ca(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(na.concat.apply([],na.slice(0,b)),function(){d[this]=a});return d}function oa(a){if(!da[a]){var b=c("<"+a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";da[a]=d}return da[a]}function ea(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var u=E.document,c=function(){function a(){if(!b.isReady){try{u.documentElement.doScroll("left")}catch(i){setTimeout(a, +1);return}b.ready()}}var b=function(i,r){return new b.fn.init(i,r)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,k=/\S/,l=/^\s+/,n=/\s+$/,s=/\W/,v=/\d/,B=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,D=/^[\],:{}\s]*$/,H=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,G=/(?:^|:|,)(?:\s*\[)+/g,M=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,j=/(msie) ([\w.]+)/,o=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false, +q=[],t,x=Object.prototype.toString,C=Object.prototype.hasOwnProperty,P=Array.prototype.push,N=Array.prototype.slice,R=String.prototype.trim,Q=Array.prototype.indexOf,L={};b.fn=b.prototype={init:function(i,r){var y,z,F;if(!i)return this;if(i.nodeType){this.context=this[0]=i;this.length=1;return this}if(i==="body"&&!r&&u.body){this.context=u;this[0]=u.body;this.selector="body";this.length=1;return this}if(typeof i==="string")if((y=h.exec(i))&&(y[1]||!r))if(y[1]){F=r?r.ownerDocument||r:u;if(z=B.exec(i))if(b.isPlainObject(r)){i= +[u.createElement(z[1])];b.fn.attr.call(i,r,true)}else i=[F.createElement(z[1])];else{z=b.buildFragment([y[1]],[F]);i=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this,i)}else{if((z=u.getElementById(y[2]))&&z.parentNode){if(z.id!==y[2])return f.find(i);this.length=1;this[0]=z}this.context=u;this.selector=i;return this}else if(!r&&!s.test(i)){this.selector=i;this.context=u;i=u.getElementsByTagName(i);return b.merge(this,i)}else return!r||r.jquery?(r||f).find(i):b(r).find(i); +else if(b.isFunction(i))return f.ready(i);if(i.selector!==A){this.selector=i.selector;this.context=i.context}return b.makeArray(i,this)},selector:"",jquery:"1.4.3",length:0,size:function(){return this.length},toArray:function(){return N.call(this,0)},get:function(i){return i==null?this.toArray():i<0?this.slice(i)[0]:this[i]},pushStack:function(i,r,y){var z=b();b.isArray(i)?P.apply(z,i):b.merge(z,i);z.prevObject=this;z.context=this.context;if(r==="find")z.selector=this.selector+(this.selector?" ": +"")+y;else if(r)z.selector=this.selector+"."+r+"("+y+")";return z},each:function(i,r){return b.each(this,i,r)},ready:function(i){b.bindReady();if(b.isReady)i.call(u,b);else q&&q.push(i);return this},eq:function(i){return i===-1?this.slice(i):this.slice(i,+i+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(i){return this.pushStack(b.map(this,function(r,y){return i.call(r, +y,r)}))},end:function(){return this.prevObject||b(null)},push:P,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var i=arguments[0]||{},r=1,y=arguments.length,z=false,F,I,K,J,fa;if(typeof i==="boolean"){z=i;i=arguments[1]||{};r=2}if(typeof i!=="object"&&!b.isFunction(i))i={};if(y===r){i=this;--r}for(;r0)){if(q){for(var r=0;i=q[r++];)i.call(u,b);q=null}b.fn.triggerHandler&&b(u).triggerHandler("ready")}}},bindReady:function(){if(!p){p=true;if(u.readyState==="complete")return setTimeout(b.ready, +1);if(u.addEventListener){u.addEventListener("DOMContentLoaded",t,false);E.addEventListener("load",b.ready,false)}else if(u.attachEvent){u.attachEvent("onreadystatechange",t);E.attachEvent("onload",b.ready);var i=false;try{i=E.frameElement==null}catch(r){}u.documentElement.doScroll&&i&&a()}}},isFunction:function(i){return b.type(i)==="function"},isArray:Array.isArray||function(i){return b.type(i)==="array"},isWindow:function(i){return i&&typeof i==="object"&&"setInterval"in i},isNaN:function(i){return i== +null||!v.test(i)||isNaN(i)},type:function(i){return i==null?String(i):L[x.call(i)]||"object"},isPlainObject:function(i){if(!i||b.type(i)!=="object"||i.nodeType||b.isWindow(i))return false;if(i.constructor&&!C.call(i,"constructor")&&!C.call(i.constructor.prototype,"isPrototypeOf"))return false;for(var r in i);return r===A||C.call(i,r)},isEmptyObject:function(i){for(var r in i)return false;return true},error:function(i){throw i;},parseJSON:function(i){if(typeof i!=="string"||!i)return null;i=b.trim(i); +if(D.test(i.replace(H,"@").replace(w,"]").replace(G,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(i):(new Function("return "+i))();else b.error("Invalid JSON: "+i)},noop:function(){},globalEval:function(i){if(i&&k.test(i)){var r=u.getElementsByTagName("head")[0]||u.documentElement,y=u.createElement("script");y.type="text/javascript";if(b.support.scriptEval)y.appendChild(u.createTextNode(i));else y.text=i;r.insertBefore(y,r.firstChild);r.removeChild(y)}},nodeName:function(i,r){return i.nodeName&&i.nodeName.toUpperCase()=== +r.toUpperCase()},each:function(i,r,y){var z,F=0,I=i.length,K=I===A||b.isFunction(i);if(y)if(K)for(z in i){if(r.apply(i[z],y)===false)break}else for(;F";a=u.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var s=u.createElement("div"); +s.style.width=s.style.paddingLeft="1px";u.body.appendChild(s);c.boxModel=c.support.boxModel=s.offsetWidth===2;if("zoom"in s.style){s.style.display="inline";s.style.zoom=1;c.support.inlineBlockNeedsLayout=s.offsetWidth===2;s.style.display="";s.innerHTML="
    ";c.support.shrinkWrapBlocks=s.offsetWidth!==2}s.innerHTML="
    t
    ";var v=s.getElementsByTagName("td");c.support.reliableHiddenOffsets=v[0].offsetHeight=== +0;v[0].style.display="";v[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&v[0].offsetHeight===0;s.innerHTML="";u.body.removeChild(s).style.display="none"});a=function(s){var v=u.createElement("div");s="on"+s;var B=s in v;if(!B){v.setAttribute(s,"return;");B=typeof v[s]==="function"}return B};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength", +cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var pa={},Oa=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?pa:a;var e=a.nodeType,f=e?a[c.expando]:null,h=c.cache;if(!(e&&!f&&typeof b==="string"&&d===A)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]= +c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==A)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?pa:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando);else if(d)delete f[e];else for(var k in a)delete a[k]}},acceptData:function(a){if(a.nodeName){var b= +c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){if(typeof a==="undefined")return this.length?c.data(this[0]):null;else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===A){var e=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(e===A&&this.length){e=c.data(this[0],a);if(e===A&&this[0].nodeType===1){e=this[0].getAttribute("data-"+a);if(typeof e=== +"string")try{e=e==="true"?true:e==="false"?false:e==="null"?null:!c.isNaN(e)?parseFloat(e):Oa.test(e)?c.parseJSON(e):e}catch(f){}else e=A}}return e===A&&d[1]?this.data(d[0]):e}else return this.each(function(){var h=c(this),k=[d[0],b];h.triggerHandler("setData"+d[1]+"!",k);c.data(this,a,b);h.triggerHandler("changeData"+d[1]+"!",k)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var e=c.data(a,b);if(!d)return e|| +[];if(!e||c.isArray(d))e=c.data(a,b,c.makeArray(d));else e.push(d);return e}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),e=d.shift();if(e==="inprogress")e=d.shift();if(e){b==="fx"&&d.unshift("inprogress");e.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===A)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this, +a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var qa=/[\n\t]/g,ga=/\s+/,Pa=/\r/g,Qa=/^(?:href|src|style)$/,Ra=/^(?:button|input)$/i,Sa=/^(?:button|input|object|select|textarea)$/i,Ta=/^a(?:rea)?$/i,ra=/^(?:radio|checkbox)$/i;c.fn.extend({attr:function(a,b){return c.access(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this, +a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(s){var v=c(this);v.addClass(a.call(this,s,v.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ga),d=0,e=this.length;d-1)return true;return false}, +val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one";if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h=0;else if(c.nodeName(this,"select")){var B=c.makeArray(v);c("option",this).each(function(){this.selected= +c.inArray(c(this).val(),B)>=0});if(!B.length)this.selectedIndex=-1}else this.value=v}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return A;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==A;b=e&&c.props[b]||b;if(a.nodeType===1){var h=Qa.test(b);if((b in a||a[b]!==A)&&e&&!h){if(f){b==="type"&&Ra.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); +if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:Sa.test(a.nodeName)||Ta.test(a.nodeName)&&a.href?0:A;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return A;a=!c.support.hrefNormalized&&e&& +h?a.getAttribute(b,2):a.getAttribute(b);return a===null?A:a}}});var X=/\.(.*)$/,ha=/^(?:textarea|input|select)$/i,Ha=/\./g,Ia=/ /g,Ua=/[^\w\s.|`]/g,Va=function(a){return a.replace(Ua,"\\$&")},sa={focusin:0,focusout:0};c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var k=a.nodeType?"events":"__events__",l=h[k],n=h.handle;if(typeof l=== +"function"){n=l.handle;l=l.events}else if(!l){a.nodeType||(h[k]=h=function(){});h.events=l={}}if(!n)h.handle=n=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(n.elem,arguments):A};n.elem=a;b=b.split(" ");for(var s=0,v;k=b[s++];){h=f?c.extend({},f):{handler:d,data:e};if(k.indexOf(".")>-1){v=k.split(".");k=v.shift();h.namespace=v.slice(0).sort().join(".")}else{v=[];h.namespace=""}h.type=k;if(!h.guid)h.guid=d.guid;var B=l[k],D=c.event.special[k]||{};if(!B){B=l[k]=[]; +if(!D.setup||D.setup.call(a,e,v,n)===false)if(a.addEventListener)a.addEventListener(k,n,false);else a.attachEvent&&a.attachEvent("on"+k,n)}if(D.add){D.add.call(a,h);if(!h.handler.guid)h.handler.guid=d.guid}B.push(h);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,k=0,l,n,s,v,B,D,H=a.nodeType?"events":"__events__",w=c.data(a),G=w&&w[H];if(w&&G){if(typeof G==="function"){w=G;G=G.events}if(b&&b.type){d=b.handler;b=b.type}if(!b|| +typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in G)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[k++];){v=f;l=f.indexOf(".")<0;n=[];if(!l){n=f.split(".");f=n.shift();s=RegExp("(^|\\.)"+c.map(n.slice(0).sort(),Va).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(B=G[f])if(d){v=c.event.special[f]||{};for(h=e||0;h=0){a.type= +f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return A;a.result=A;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)=== +false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){e=a.target;var k,l=f.replace(X,""),n=c.nodeName(e,"a")&&l==="click",s=c.event.special[l]||{};if((!s._default||s._default.call(d,a)===false)&&!n&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[l]){if(k=e["on"+l])e["on"+l]=null;c.event.triggered=true;e[l]()}}catch(v){}if(k)e["on"+l]=k;c.event.triggered=false}}},handle:function(a){var b,d,e; +d=[];var f,h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var k=d.length;f-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ha.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=va(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===A||f===e))if(e!=null||f){a.type="change";a.liveFired= +A;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",va(a))}},setup:function(){if(this.type=== +"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ha.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ha.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}u.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){sa[b]++===0&&u.addEventListener(a,d,true)},teardown:function(){--sa[b]=== +0&&u.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=A}var k=b==="one"?c.proxy(f,function(n){c(this).unbind(n,k);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var l=this.length;h0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); +(function(){function a(g,j,o,m,p,q){p=0;for(var t=m.length;p0){C=x;break}}x=x[g]}m[p]=C}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,k=true;[0,0].sort(function(){k=false;return 0});var l=function(g,j,o,m){o=o||[];var p=j=j||u;if(j.nodeType!==1&&j.nodeType!==9)return[];if(!g||typeof g!=="string")return o;var q=[],t,x,C,P,N=true,R=l.isXML(j),Q=g,L;do{d.exec("");if(t=d.exec(Q)){Q=t[3];q.push(t[1]);if(t[2]){P=t[3]; +break}}}while(t);if(q.length>1&&s.exec(g))if(q.length===2&&n.relative[q[0]])x=M(q[0]+q[1],j);else for(x=n.relative[q[0]]?[j]:l(q.shift(),j);q.length;){g=q.shift();if(n.relative[g])g+=q.shift();x=M(g,x)}else{if(!m&&q.length>1&&j.nodeType===9&&!R&&n.match.ID.test(q[0])&&!n.match.ID.test(q[q.length-1])){t=l.find(q.shift(),j,R);j=t.expr?l.filter(t.expr,t.set)[0]:t.set[0]}if(j){t=m?{expr:q.pop(),set:D(m)}:l.find(q.pop(),q.length===1&&(q[0]==="~"||q[0]==="+")&&j.parentNode?j.parentNode:j,R);x=t.expr?l.filter(t.expr, +t.set):t.set;if(q.length>0)C=D(x);else N=false;for(;q.length;){t=L=q.pop();if(n.relative[L])t=q.pop();else L="";if(t==null)t=j;n.relative[L](C,t,R)}}else C=[]}C||(C=x);C||l.error(L||g);if(f.call(C)==="[object Array]")if(N)if(j&&j.nodeType===1)for(g=0;C[g]!=null;g++){if(C[g]&&(C[g]===true||C[g].nodeType===1&&l.contains(j,C[g])))o.push(x[g])}else for(g=0;C[g]!=null;g++)C[g]&&C[g].nodeType===1&&o.push(x[g]);else o.push.apply(o,C);else D(C,o);if(P){l(P,p,o,m);l.uniqueSort(o)}return o};l.uniqueSort=function(g){if(w){h= +k;g.sort(w);if(h)for(var j=1;j0};l.find=function(g,j,o){var m;if(!g)return[];for(var p=0,q=n.order.length;p":function(g,j){var o=typeof j==="string",m,p=0,q=g.length;if(o&&!/\W/.test(j))for(j=j.toLowerCase();p=0))o||m.push(t);else if(o)j[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var j=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=j[1]+(j[2]||1)-0;g[3]=j[3]-0}g[0]=e++;return g},ATTR:function(g,j,o, +m,p,q){j=g[1].replace(/\\/g,"");if(!q&&n.attrMap[j])g[1]=n.attrMap[j];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,j,o,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=l(g[3],null,null,j);else{g=l.filter(g[3],j,o,true^p);o||m.push.apply(m,g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled=== +true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,j,o){return!!l(o[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"=== +g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,j){return j===0},last:function(g,j,o,m){return j===m.length-1},even:function(g,j){return j%2===0},odd:function(g,j){return j%2===1},lt:function(g,j,o){return jo[3]-0},nth:function(g,j,o){return o[3]- +0===j},eq:function(g,j,o){return o[3]-0===j}},filter:{PSEUDO:function(g,j,o,m){var p=j[1],q=n.filters[p];if(q)return q(g,o,j,m);else if(p==="contains")return(g.textContent||g.innerText||l.getText([g])||"").indexOf(j[3])>=0;else if(p==="not"){j=j[3];o=0;for(m=j.length;o=0}},ID:function(g,j){return g.nodeType===1&&g.getAttribute("id")===j},TAG:function(g,j){return j==="*"&&g.nodeType===1||g.nodeName.toLowerCase()=== +j},CLASS:function(g,j){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(j)>-1},ATTR:function(g,j){var o=j[1];o=n.attrHandle[o]?n.attrHandle[o](g):g[o]!=null?g[o]:g.getAttribute(o);var m=o+"",p=j[2],q=j[4];return o==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&o!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,j,o,m){var p=n.setFilters[j[2]]; +if(p)return p(g,o,j,m)}}},s=n.match.POS,v=function(g,j){return"\\"+(j-0+1)},B;for(B in n.match){n.match[B]=RegExp(n.match[B].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[B]=RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[B].source.replace(/\\(\d+)/g,v))}var D=function(g,j){g=Array.prototype.slice.call(g,0);if(j){j.push.apply(j,g);return j}return g};try{Array.prototype.slice.call(u.documentElement.childNodes,0)}catch(H){D=function(g,j){var o=j||[],m=0;if(f.call(g)==="[object Array]")Array.prototype.push.apply(o, +g);else if(typeof g.length==="number")for(var p=g.length;m";var o=u.documentElement;o.insertBefore(g,o.firstChild);if(u.getElementById(j)){n.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:A:[]};n.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}o.removeChild(g); +o=g=null})();(function(){var g=u.createElement("div");g.appendChild(u.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(j,o){var m=o.getElementsByTagName(j[1]);if(j[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(j){return j.getAttribute("href",2)};g=null})();u.querySelectorAll&& +function(){var g=l,j=u.createElement("div");j.innerHTML="

    ";if(!(j.querySelectorAll&&j.querySelectorAll(".TEST").length===0)){l=function(m,p,q,t){p=p||u;if(!t&&!l.isXML(p))if(p.nodeType===9)try{return D(p.querySelectorAll(m),q)}catch(x){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var C=p.id,P=p.id="__sizzle__";try{return D(p.querySelectorAll("#"+P+" "+m),q)}catch(N){}finally{if(C)p.id=C;else p.removeAttribute("id")}}return g(m,p,q,t)};for(var o in g)l[o]=g[o]; +j=null}}();(function(){var g=u.documentElement,j=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,o=false;try{j.call(u.documentElement,":sizzle")}catch(m){o=true}if(j)l.matchesSelector=function(p,q){try{if(o||!n.match.PSEUDO.test(q))return j.call(p,q)}catch(t){}return l(q,null,null,[p]).length>0}})();(function(){var g=u.createElement("div");g.innerHTML="
    ";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length=== +0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(j,o,m){if(typeof o.getElementsByClassName!=="undefined"&&!m)return o.getElementsByClassName(j[1])};g=null}}})();l.contains=u.documentElement.contains?function(g,j){return g!==j&&(g.contains?g.contains(j):true)}:function(g,j){return!!(g.compareDocumentPosition(j)&16)};l.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var M=function(g, +j){for(var o=[],m="",p,q=j.nodeType?[j]:j;p=n.match.PSEUDO.exec(g);){m+=p[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;p=0;for(var t=q.length;p0)for(var h=d;h0},closest:function(a, +b){var d=[],e,f,h=this[0];if(c.isArray(a)){var k={},l,n=1;if(h&&a.length){e=0;for(f=a.length;e-1:c(h).is(e))d.push({selector:l,elem:h,level:n})}h=h.parentNode;n++}}return d}k=$a.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h|| +!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context):c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}}); +c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling", +d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Wa.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||Ya.test(e))&&Xa.test(a))f=f.reverse();return this.pushStack(f,a,Za.call(arguments).join(","))}}); +c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===A||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&&e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var xa=/ jQuery\d+="(?:\d+|null)"/g, +$=/^\s+/,ya=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,za=/<([\w:]+)/,ab=/\s]+\/)>/g,O={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "], +area:[1,"",""],_default:[0,"",""]};O.optgroup=O.option;O.tbody=O.tfoot=O.colgroup=O.caption=O.thead;O.th=O.td;if(!c.support.htmlSerialize)O._default=[1,"div
    ","
    "];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==A)return this.empty().append((this[0]&&this[0].ownerDocument||u).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this, +d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})}, +unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a= +c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*")); +c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(xa,"").replace(cb,'="$1">').replace($, +"")],e)[0]}else return this.cloneNode(true)});if(a===true){la(this,b);la(this.find("*"),b.find("*"))}return b},html:function(a){if(a===A)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(xa,""):null;else if(typeof a==="string"&&!Aa.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!O[(za.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ya,"<$1>");try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?l.cloneNode(true):l)}k.length&&c.each(k,Ka)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:u;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===u&&!Aa.test(a[0])&&(c.support.checkClone|| +!Ba.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h= +d.length;f0?this.clone(true):this).get();c(d[f])[b](k);e=e.concat(k)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||u;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||u;for(var f=[],h=0,k;(k=a[h])!=null;h++){if(typeof k==="number")k+="";if(k){if(typeof k==="string"&&!bb.test(k))k=b.createTextNode(k);else if(typeof k==="string"){k=k.replace(ya,"<$1>");var l=(za.exec(k)||["",""])[1].toLowerCase(),n=O[l]||O._default, +s=n[0],v=b.createElement("div");for(v.innerHTML=n[1]+k+n[2];s--;)v=v.lastChild;if(!c.support.tbody){s=ab.test(k);l=l==="table"&&!s?v.firstChild&&v.firstChild.childNodes:n[1]===""&&!s?v.childNodes:[];for(n=l.length-1;n>=0;--n)c.nodeName(l[n],"tbody")&&!l[n].childNodes.length&&l[n].parentNode.removeChild(l[n])}!c.support.leadingWhitespace&&$.test(k)&&v.insertBefore(b.createTextNode($.exec(k)[0]),v.firstChild);k=v.childNodes}if(k.nodeType)f.push(k);else f=c.merge(f,k)}}if(d)for(h=0;f[h];h++)if(e&& +c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script"))));d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,k=0,l;(l=a[k])!=null;k++)if(!(l.nodeName&&c.noData[l.nodeName.toLowerCase()]))if(d=l[c.expando]){if((b=e[d])&&b.events)for(var n in b.events)f[n]? +c.event.remove(l,n):c.removeEvent(l,n,b.handle);if(h)delete l[c.expando];else l.removeAttribute&&l.removeAttribute(c.expando);delete e[d]}}});var Ca=/alpha\([^)]*\)/i,db=/opacity=([^)]*)/,eb=/-([a-z])/ig,fb=/([A-Z])/g,Da=/^-?\d+(?:px)?$/i,gb=/^-?\d/,hb={position:"absolute",visibility:"hidden",display:"block"},La=["Left","Right"],Ma=["Top","Bottom"],W,ib=u.defaultView&&u.defaultView.getComputedStyle,jb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===A)return this; +return c.access(this,a,b,true,function(d,e,f){return f!==A?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true,zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),k=a.style,l=c.cssHooks[h];b=c.cssProps[h]|| +h;if(d!==A){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!l||!("set"in l)||(d=l.set(a,d))!==A)try{k[b]=d}catch(n){}}}else{if(l&&"get"in l&&(f=l.get(a,false,e))!==A)return f;return k[b]}}},css:function(a,b,d){var e,f=c.camelCase(b),h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==A)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]= +e[f]},camelCase:function(a){return a.replace(eb,jb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=ma(d,b,f);else c.swap(d,hb,function(){h=ma(d,b,f)});return h+"px"}},set:function(d,e){if(Da.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return db.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"": +b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f=d.filter||"";d.filter=Ca.test(f)?f.replace(Ca,e):d.filter+" "+e}};if(ib)W=function(a,b,d){var e;d=d.replace(fb,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return A;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};else if(u.documentElement.currentStyle)W=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b], +h=a.style;if(!Da.test(f)&&gb.test(f)){d=h.left;e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f};if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var kb=c.now(),lb=/)<[^<]*)*<\/script>/gi, +mb=/^(?:select|textarea)/i,nb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ob=/^(?:GET|HEAD|DELETE)$/,Na=/\[\]$/,T=/\=\?(&|$)/,ia=/\?/,pb=/([?&])_=[^&]*/,qb=/^(\w+:)?\/\/([^\/?#]+)/,rb=/%20/g,sb=/#.*$/,Ea=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ea)return Ea.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d= +b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(k,l){if(l==="success"||l==="notmodified")h.html(f?c("
    ").append(k.responseText.replace(lb,"")).find(f):k.responseText);d&&h.each(d,[k.responseText,l,k])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& +!this.disabled&&(this.checked||mb.test(this.nodeName)||nb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, +getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", +script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),k=ob.test(h);b.url=b.url.replace(sb,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ia.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| +!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+kb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var l=E[d];E[d]=function(m){f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);if(c.isFunction(l))l(m);else{E[d]=A;try{delete E[d]}catch(p){}}v&&v.removeChild(B)}}if(b.dataType==="script"&&b.cache===null)b.cache= +false;if(b.cache===false&&h==="GET"){var n=c.now(),s=b.url.replace(pb,"$1_="+n);b.url=s+(s===b.url?(ia.test(b.url)?"&":"?")+"_="+n:"")}if(b.data&&h==="GET")b.url+=(ia.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");n=(n=qb.exec(b.url))&&(n[1]&&n[1]!==location.protocol||n[2]!==location.host);if(b.dataType==="script"&&h==="GET"&&n){var v=u.getElementsByTagName("head")[0]||u.documentElement,B=u.createElement("script");if(b.scriptCharset)B.charset=b.scriptCharset;B.src= +b.url;if(!d){var D=false;B.onload=B.onreadystatechange=function(){if(!D&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){D=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);B.onload=B.onreadystatechange=null;v&&B.parentNode&&v.removeChild(B)}}}v.insertBefore(B,v.firstChild);return A}var H=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!k||a&&a.contentType)w.setRequestHeader("Content-Type", +b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}n||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(G){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& +c.triggerGlobal(b,"ajaxSend",[w,b]);var M=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){H||c.handleComplete(b,w,e,f);H=true;if(w)w.onreadystatechange=c.noop}else if(!H&&w&&(w.readyState===4||m==="timeout")){H=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| +c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&g.call&&g.call(w);M("abort")}}catch(j){}b.async&&b.timeout>0&&setTimeout(function(){w&&!H&&M("timeout")},b.timeout);try{w.send(k||b.data==null?null:b.data)}catch(o){c.handleError(b,w,null,o);c.handleComplete(b,w,e,f)}b.async||M();return w}},param:function(a,b){var d=[],e=function(h,k){k=c.isFunction(k)?k():k;d[d.length]=encodeURIComponent(h)+ +"="+encodeURIComponent(k)};if(b===A)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)ca(f,a[f],b,e);return d.join("&").replace(rb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess",[b,a])},handleComplete:function(a, +b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),e=a.getResponseHeader("Etag"); +if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}});if(E.ActiveXObject)c.ajaxSettings.xhr= +function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var da={},tb=/^(?:toggle|show|hide)$/,ub=/^([+\-]=)?([\d+.\-]+)(.*)$/,aa,na=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show",3),a,b,d);else{a= +0;for(b=this.length;a=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, +d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* +Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(h){return f.step(h)} +this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;var f=this;a=c.fx;e.elem=this.elem;if(e()&&c.timers.push(e)&&!aa)aa=setInterval(a.tick,a.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; +this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(l,n){f.style["overflow"+n]=h.overflow[l]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| +this.options.show)for(var k in this.options.curAnim)c.style(this.elem,k,this.options.orig[k]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= +c.timers,b=0;b-1;e={};var s={};if(n)s=f.position();k=n?s.top:parseInt(k,10)||0;l=n?s.left:parseInt(l,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+k;if(b.left!=null)e.left=b.left-h.left+l;"using"in b?b.using.call(a, +e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Fa.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||u.body;a&&!Fa.test(a.nodeName)&& +c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==A)return this.each(function(){if(h=ea(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=ea(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); +c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(h){var k=c(this);k[d](e.call(this,h,k[d]()))});return c.isWindow(f)?f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b]:f.nodeType===9?Math.max(f.documentElement["client"+ +b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]):e===A?parseFloat(c.css(f,d)):this.css(d,typeof e==="string"?e:e+"px")}})})(window); diff --git a/force-app/main/default/staticresources/Brackets/js/jquery.tipsy.min.js b/force-app/main/default/staticresources/Brackets/js/jquery.tipsy.min.js new file mode 100644 index 0000000..25a4916 --- /dev/null +++ b/force-app/main/default/staticresources/Brackets/js/jquery.tipsy.min.js @@ -0,0 +1 @@ +(function(b){function a(d,c){this.$element=b(d);this.options=c;this.enabled=true;this.fixTitle()}a.prototype={show:function(){var f=this.getTitle();if(f&&this.enabled){var e=this.tip();e.find(".tipsy-inner")[this.options.html?"html":"text"](f);e[0].className="tipsy";e.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).appendTo(document.body);var i=b.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight});var c=e[0].offsetWidth,h=e[0].offsetHeight;var g=(typeof this.options.gravity=="function")?this.options.gravity.call(this.$element[0]):this.options.gravity;var d;switch(g.charAt(0)){case"n":d={top:i.top+i.height+this.options.offset,left:i.left+i.width/2-c/2};break;case"s":d={top:i.top-h-this.options.offset,left:i.left+i.width/2-c/2};break;case"e":d={top:i.top+i.height/2-h/2,left:i.left-c-this.options.offset};break;case"w":d={top:i.top+i.height/2-h/2,left:i.left+i.width+this.options.offset};break}if(g.length==2){if(g.charAt(1)=="w"){d.left=i.left+i.width/2-15}else{d.left=i.left+i.width/2-c+15}}e.css(d).addClass("tipsy-"+g);if(this.options.fade){e.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity})}else{e.css({visibility:"visible",opacity:this.options.opacity})}}},hide:function(){if(this.options.fade){this.tip().stop().fadeOut(function(){b(this).remove()})}else{this.tip().remove()}},fixTitle:function(){var c=this.$element;if(c.attr("title")||typeof(c.attr("original-title"))!="string"){c.attr("original-title",c.attr("title")||"").removeAttr("title")}},getTitle:function(){var e,c=this.$element,d=this.options;this.fixTitle();var e,d=this.options;if(typeof d.title=="string"){e=c.attr(d.title=="title"?"original-title":d.title)}else{if(typeof d.title=="function"){e=d.title.call(c[0])}}e=(""+e).replace(/(^\s*|\s*$)/,"");return e||d.fallback},tip:function(){if(!this.$tip){this.$tip=b('
    ').html('
    ')}return this.$tip},validate:function(){if(!this.$element[0].parentNode){this.hide();this.$element=null;this.options=null}},enable:function(){this.enabled=true},disable:function(){this.enabled=false},toggleEnabled:function(){this.enabled=!this.enabled}};b.fn.tipsy=function(g){if(g===true){return this.data("tipsy")}else{if(typeof g=="string"){var i=this.data("tipsy");if(i){i[g]()}return this}}g=b.extend({},b.fn.tipsy.defaults,g);function f(k){var l=b.data(k,"tipsy");if(!l){l=new a(k,b.fn.tipsy.elementOptions(k,g));b.data(k,"tipsy",l)}return l}function j(){var k=f(this);k.hoverState="in";if(g.delayIn==0){k.show()}else{k.fixTitle();setTimeout(function(){if(k.hoverState=="in"){k.show()}},g.delayIn)}}function e(){var k=f(this);k.hoverState="out";if(g.delayOut==0){k.hide()}else{setTimeout(function(){if(k.hoverState=="out"){k.hide()}},g.delayOut)}}if(!g.live){this.each(function(){f(this)})}if(g.trigger!="manual"){var c=g.live?"live":"bind",h=g.trigger=="hover"?"mouseenter":"focus",d=g.trigger=="hover"?"mouseleave":"blur";this[c](h,j)[c](d,e)}return this};b.fn.tipsy.defaults={delayIn:0,delayOut:0,fade:false,fallback:"",gravity:"n",html:false,live:false,offset:0,opacity:0.8,title:"title",trigger:"hover"};b.fn.tipsy.elementOptions=function(d,c){return b.metadata?b.extend({},c,b(d).metadata()):c};b.fn.tipsy.autoNS=function(){return b(this).offset().top>(b(document).scrollTop()+b(window).height()/2)?"s":"n"};b.fn.tipsy.autoWE=function(){return b(this).offset().left>(b(document).scrollLeft()+b(window).width()/2)?"e":"w"}})(jQuery); \ No newline at end of file diff --git a/force-app/main/default/staticresources/Brackets/shots/app1.png b/force-app/main/default/staticresources/Brackets/shots/app1.png new file mode 100644 index 0000000..a9e19ab Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/shots/app1.png differ diff --git a/force-app/main/default/staticresources/Brackets/shots/join1.png b/force-app/main/default/staticresources/Brackets/shots/join1.png new file mode 100644 index 0000000..5340839 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/shots/join1.png differ diff --git a/force-app/main/default/staticresources/Brackets/shots/sample1.png b/force-app/main/default/staticresources/Brackets/shots/sample1.png new file mode 100644 index 0000000..66b8c1c Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/shots/sample1.png differ diff --git a/force-app/main/default/staticresources/Brackets/shots/security1.png b/force-app/main/default/staticresources/Brackets/shots/security1.png new file mode 100644 index 0000000..a6549f9 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/shots/security1.png differ diff --git a/force-app/main/default/staticresources/Brackets/shots/security2.png b/force-app/main/default/staticresources/Brackets/shots/security2.png new file mode 100644 index 0000000..87c13de Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/shots/security2.png differ diff --git a/force-app/main/default/staticresources/Brackets/shots/security3.png b/force-app/main/default/staticresources/Brackets/shots/security3.png new file mode 100644 index 0000000..7d62390 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/shots/security3.png differ diff --git a/force-app/main/default/staticresources/Brackets/shots/update1.png b/force-app/main/default/staticresources/Brackets/shots/update1.png new file mode 100644 index 0000000..78b37f7 Binary files /dev/null and b/force-app/main/default/staticresources/Brackets/shots/update1.png differ diff --git a/src/tabs/About_Brackets.tab b/force-app/main/default/tabs/About_Brackets.tab-meta.xml similarity index 68% rename from src/tabs/About_Brackets.tab rename to force-app/main/default/tabs/About_Brackets.tab-meta.xml index e92c051..838760b 100644 --- a/src/tabs/About_Brackets.tab +++ b/force-app/main/default/tabs/About_Brackets.tab-meta.xml @@ -1,7 +1,7 @@ - + - false + Custom64: Compass BracketsAbout diff --git a/force-app/main/default/tabs/Brackets_Group__c.tab-meta.xml b/force-app/main/default/tabs/Brackets_Group__c.tab-meta.xml new file mode 100644 index 0000000..1965cbd --- /dev/null +++ b/force-app/main/default/tabs/Brackets_Group__c.tab-meta.xml @@ -0,0 +1,5 @@ + + + true + Custom12: Circle + diff --git a/force-app/main/default/tabs/Brackets_Team__c.tab-meta.xml b/force-app/main/default/tabs/Brackets_Team__c.tab-meta.xml new file mode 100644 index 0000000..9b6841a --- /dev/null +++ b/force-app/main/default/tabs/Brackets_Team__c.tab-meta.xml @@ -0,0 +1,5 @@ + + + true + Custom15: People + diff --git a/force-app/main/default/tabs/Brackets_Tournament__c.tab-meta.xml b/force-app/main/default/tabs/Brackets_Tournament__c.tab-meta.xml new file mode 100644 index 0000000..c862797 --- /dev/null +++ b/force-app/main/default/tabs/Brackets_Tournament__c.tab-meta.xml @@ -0,0 +1,5 @@ + + + true + Custom47: Chess piece + diff --git a/force-app/main/default/tabs/Import_Tournament.tab-meta.xml b/force-app/main/default/tabs/Import_Tournament.tab-meta.xml new file mode 100644 index 0000000..a91d43d --- /dev/null +++ b/force-app/main/default/tabs/Import_Tournament.tab-meta.xml @@ -0,0 +1,6 @@ + + + + Custom67: Gears + BracketsImportTournament + diff --git a/src/tabs/Matches_Predictions.tab b/force-app/main/default/tabs/Matches_Predictions.tab-meta.xml similarity index 67% rename from src/tabs/Matches_Predictions.tab rename to force-app/main/default/tabs/Matches_Predictions.tab-meta.xml index 4ba8507..858355d 100644 --- a/src/tabs/Matches_Predictions.tab +++ b/force-app/main/default/tabs/Matches_Predictions.tab-meta.xml @@ -1,7 +1,7 @@ - + - false + Custom82: Whistle BracketsPredictions diff --git a/force-app/main/default/tabs/View_Leaderboard.tab-meta.xml b/force-app/main/default/tabs/View_Leaderboard.tab-meta.xml new file mode 100644 index 0000000..ac1c82b --- /dev/null +++ b/force-app/main/default/tabs/View_Leaderboard.tab-meta.xml @@ -0,0 +1,6 @@ + + + + Custom11: Star + BracketsScoreBoard + diff --git a/force-app/main/default/triggers/BracketsMatch.trigger b/force-app/main/default/triggers/BracketsMatch.trigger new file mode 100644 index 0000000..40cd192 --- /dev/null +++ b/force-app/main/default/triggers/BracketsMatch.trigger @@ -0,0 +1,60 @@ +trigger BracketsMatch on Brackets_Match__c( + after insert, + after update, + after delete, + before update, + before insert +) { + if ( + !BracketsMatchUtilities.SKIP_TRIGGER && + !BracketsTournamentUtilities.CreatingTournamentTree + ) { + if (Trigger.isAfter || (Trigger.isUpdate && Trigger.isBefore)) { + BracketsTriggerUtilities.triggerListObject = Trigger.newMap; + } + BracketsTriggerUtilities.newTriggerInstance(Trigger.new); + + if (Trigger.isAfter) { + if (Trigger.isInsert) { + } + + if (Trigger.isUpdate) { + BracketsMatchUtilities.checkLocked(Trigger.old, Trigger.new); + // Update UserMatchPrediction points + BracketsMatchesPredictionUtil.updateUserMatchPredictionPoints( + Trigger.new + ); + //Update the following matches + BracketsMatchUtilities.updateFollowingMatches(Trigger.new); + } + + if (Trigger.isDelete) { + BracketsMatchUtilities.checkLocked(Trigger.old, Trigger.new); + } + } + + if (Trigger.isBefore) { + if (Trigger.isInsert) { + BracketsMatchUtilities.checkExistMatchesInRound(Trigger.new); + BracketsMatchUtilities.dateMatchesValidation(Trigger.new); + } + + if (Trigger.isUpdate) { + BracketsMatchUtilities.checkLocked(Trigger.old, Trigger.new); + BracketsMatchUtilities.checkSetTeam(Trigger.new, Trigger.old); + BracketsMatchUtilities.setWinnerTeam(Trigger.new, Trigger.old); + BracketsMatchUtilities.checkRemovedTeam( + Trigger.new, + Trigger.old + ); + BracketsMatchUtilities.publishOff(Trigger.new); + BracketsMatchUtilities.checkExistMatchesInRound(Trigger.new); + BracketsMatchUtilities.dateMatchesValidation(Trigger.new); + } + + if (Trigger.isDelete) { + BracketsMatchUtilities.checkLocked(Trigger.old, Trigger.new); + } + } + } +} diff --git a/src/triggers/BracketsMatch.trigger-meta.xml b/force-app/main/default/triggers/BracketsMatch.trigger-meta.xml similarity index 58% rename from src/triggers/BracketsMatch.trigger-meta.xml rename to force-app/main/default/triggers/BracketsMatch.trigger-meta.xml index f6325d6..e912813 100644 --- a/src/triggers/BracketsMatch.trigger-meta.xml +++ b/force-app/main/default/triggers/BracketsMatch.trigger-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/triggers/BracketsRound.trigger b/force-app/main/default/triggers/BracketsRound.trigger new file mode 100644 index 0000000..5c0c7e7 --- /dev/null +++ b/force-app/main/default/triggers/BracketsRound.trigger @@ -0,0 +1,15 @@ +trigger BracketsRound on Brackets_Round__c(before insert, before update) { + if (!BracketsTournamentUtilities.CreatingTournamentTree) { + if (Trigger.isBefore) { + if (Trigger.isInsert || Trigger.isUpdate) { + BracketsRoundUtilities.checkRoundsIntegrity(Trigger.new); + } + if (Trigger.isUpdate) { + BracketsRoundUtilities.publishOff(Trigger.new); + } + if (Trigger.isInsert) { + BracketsRoundUtilities.roundNumberOnInsert(Trigger.new); + } + } + } +} diff --git a/src/triggers/BracketsRound.trigger-meta.xml b/force-app/main/default/triggers/BracketsRound.trigger-meta.xml similarity index 58% rename from src/triggers/BracketsRound.trigger-meta.xml rename to force-app/main/default/triggers/BracketsRound.trigger-meta.xml index f6325d6..e912813 100644 --- a/src/triggers/BracketsRound.trigger-meta.xml +++ b/force-app/main/default/triggers/BracketsRound.trigger-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/triggers/BracketsTeam.trigger b/force-app/main/default/triggers/BracketsTeam.trigger new file mode 100644 index 0000000..8999423 --- /dev/null +++ b/force-app/main/default/triggers/BracketsTeam.trigger @@ -0,0 +1,15 @@ +trigger BracketsTeam on Brackets_Team__c( + before insert, + before update, + before delete +) { + if (Trigger.isBefore && Trigger.isDelete) { + if (!BracketsTeamUtilities.canDeleteTeams(Trigger.old)) { + Trigger.old + .get(0) + .addError( + 'Teams cannot be deleted, already in use within a Tournament!' + ); + } + } +} diff --git a/src/triggers/BracketsTeam.trigger-meta.xml b/force-app/main/default/triggers/BracketsTeam.trigger-meta.xml similarity index 58% rename from src/triggers/BracketsTeam.trigger-meta.xml rename to force-app/main/default/triggers/BracketsTeam.trigger-meta.xml index f6325d6..e912813 100644 --- a/src/triggers/BracketsTeam.trigger-meta.xml +++ b/force-app/main/default/triggers/BracketsTeam.trigger-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/triggers/BracketsTournament.trigger b/force-app/main/default/triggers/BracketsTournament.trigger new file mode 100644 index 0000000..e9fe51b --- /dev/null +++ b/force-app/main/default/triggers/BracketsTournament.trigger @@ -0,0 +1,27 @@ +trigger BracketsTournament on Brackets_Tournament__c( + before insert, + before update, + after insert, + before delete +) { + if (!BracketsTournamentUtilities.CreatingTournamentTree) { + if (Trigger.isBefore && Trigger.isInsert) { + BracketsTournamentUtilities.checkTeamCount(Trigger.new); + } + if (Trigger.isBefore && Trigger.isUpdate) { + BracketsTournamentUtilities.publishOff(Trigger.new, Trigger.old); + BracketsTournamentUtilities.checkTeamCountNotUpdateable( + Trigger.new, + Trigger.old + ); + } + // Create tourament tree skeleton + if (Trigger.isAfter && Trigger.isInsert) { + BracketsTournamentUtilities.createTournamentTree(Trigger.new); + } + } + + if (Trigger.isBefore && Trigger.isDelete) { + BracketsGroupUtilities.deleteGroups(Trigger.old); + } +} diff --git a/src/triggers/BracketsTournament.trigger-meta.xml b/force-app/main/default/triggers/BracketsTournament.trigger-meta.xml similarity index 58% rename from src/triggers/BracketsTournament.trigger-meta.xml rename to force-app/main/default/triggers/BracketsTournament.trigger-meta.xml index f6325d6..e912813 100644 --- a/src/triggers/BracketsTournament.trigger-meta.xml +++ b/force-app/main/default/triggers/BracketsTournament.trigger-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/force-app/main/default/triggers/BracketsUserTournament.trigger b/force-app/main/default/triggers/BracketsUserTournament.trigger new file mode 100644 index 0000000..0e933e4 --- /dev/null +++ b/force-app/main/default/triggers/BracketsUserTournament.trigger @@ -0,0 +1,19 @@ +trigger BracketsUserTournament on Brackets_UserTournament__c( + after insert, + after update, + after delete, + before update, + before insert +) { + // Check Existing join to tournaments + if (Trigger.isBefore && Trigger.isInsert) { + BracketsUserTournamentUtilities.checkJoinedTournaments(Trigger.new); + } + + if (Trigger.isAfter) { + if (Trigger.isInsert) { + BracketsUserTournamentUtilities.userSuscribe(Trigger.new); + } + } + +} diff --git a/src/triggers/BracketsUserTournament.trigger-meta.xml b/force-app/main/default/triggers/BracketsUserTournament.trigger-meta.xml similarity index 58% rename from src/triggers/BracketsUserTournament.trigger-meta.xml rename to force-app/main/default/triggers/BracketsUserTournament.trigger-meta.xml index f6325d6..e912813 100644 --- a/src/triggers/BracketsUserTournament.trigger-meta.xml +++ b/force-app/main/default/triggers/BracketsUserTournament.trigger-meta.xml @@ -1,5 +1,5 @@ - + - 20.0 + 48.0 Active diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..264d851 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,12935 @@ +{ + "name": "brackets", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", + "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "dev": true, + "requires": { + "@babel/highlight": "^7.8.3" + } + }, + "@babel/core": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.1.0.tgz", + "integrity": "sha512-9EWmD0cQAbcXSc+31RIoYgEHx3KQ2CCSMDBhnXrShWvo45TMw+3/55KVxlhkG53kw9tl87DqINgHDgFVhZJV/Q==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/generator": "^7.0.0", + "@babel/helpers": "^7.1.0", + "@babel/parser": "^7.1.0", + "@babel/template": "^7.1.0", + "@babel/traverse": "^7.1.0", + "@babel/types": "^7.0.0", + "convert-source-map": "^1.1.0", + "debug": "^3.1.0", + "json5": "^0.5.0", + "lodash": "^4.17.10", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.6.tgz", + "integrity": "sha512-+htwWKJbH2bL72HRluF8zumBxzuX0ZZUFl3JLNyoUjM/Ho8wnVpPXM6aUz8cfKDqQ/h7zHqKt4xzJteUosckqQ==", + "dev": true, + "requires": { + "@babel/types": "^7.9.6", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-annotate-as-pure": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.8.3.tgz", + "integrity": "sha512-6o+mJrZBxOoEX77Ezv9zwW7WV8DdluouRKNY/IR5u/YTMuKHgugHOzYWlYvYLpLA9nPsQCAAASpCIbjI9Mv+Uw==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.8.3.tgz", + "integrity": "sha512-5eFOm2SyFPK4Rh3XMMRDjN7lBH0orh3ss0g3rTYZnBQ+r6YPj7lgDyCvPphynHvUrobJmeMignBr6Acw9mAPlw==", + "dev": true, + "requires": { + "@babel/helper-explode-assignable-expression": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-call-delegate": { + "version": "7.8.7", + "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.8.7.tgz", + "integrity": "sha512-doAA5LAKhsFCR0LAFIf+r2RSMmC+m8f/oQ+URnUET/rWeEzC0yTRmAGyWkD4sSu3xwbS7MYQ2u+xlt1V5R56KQ==", + "dev": true, + "requires": { + "@babel/helper-hoist-variables": "^7.8.3", + "@babel/traverse": "^7.8.3", + "@babel/types": "^7.8.7" + } + }, + "@babel/helper-define-map": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.8.3.tgz", + "integrity": "sha512-PoeBYtxoZGtct3md6xZOCWPcKuMuk3IHhgxsRRNtnNShebf4C8YonTSblsK4tvDbm+eJAw2HAPOfCr+Q/YRG/g==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.8.3", + "@babel/types": "^7.8.3", + "lodash": "^4.17.13" + } + }, + "@babel/helper-explode-assignable-expression": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.8.3.tgz", + "integrity": "sha512-N+8eW86/Kj147bO9G2uclsg5pwfs/fqqY5rwgIL7eTBklgXjcOJ3btzS5iM6AitJcftnY7pm2lGsrJVYLGjzIw==", + "dev": true, + "requires": { + "@babel/traverse": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-function-name": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz", + "integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.8.3", + "@babel/template": "^7.8.3", + "@babel/types": "^7.9.5" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", + "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.8.3.tgz", + "integrity": "sha512-ky1JLOjcDUtSc+xkt0xhYff7Z6ILTAHKmZLHPxAhOP0Nd77O+3nCsd6uSVYur6nJnCI029CrNbYlc0LoPfAPQg==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", + "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-module-imports": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz", + "integrity": "sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-module-transforms": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", + "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.8.3", + "@babel/helper-replace-supers": "^7.8.6", + "@babel/helper-simple-access": "^7.8.3", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/template": "^7.8.6", + "@babel/types": "^7.9.0", + "lodash": "^4.17.13" + }, + "dependencies": { + "@babel/helper-module-imports": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", + "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + } + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", + "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", + "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "dev": true + }, + "@babel/helper-regex": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.8.3.tgz", + "integrity": "sha512-BWt0QtYv/cg/NecOAZMdcn/waj/5P26DR4mVLXfFtDokSR6fyuG0Pj+e2FqtSME+MqED1khnSMulkmGl8qWiUQ==", + "dev": true, + "requires": { + "lodash": "^4.17.13" + } + }, + "@babel/helper-remap-async-to-generator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.8.3.tgz", + "integrity": "sha512-kgwDmw4fCg7AVgS4DukQR/roGp+jP+XluJE5hsRZwxCYGg+Rv9wSGErDWhlI90FODdYfd4xG4AQRiMDjjN0GzA==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.8.3", + "@babel/helper-wrap-function": "^7.8.3", + "@babel/template": "^7.8.3", + "@babel/traverse": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-replace-supers": { + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.9.6.tgz", + "integrity": "sha512-qX+chbxkbArLyCImk3bWV+jB5gTNU/rsze+JlcF6Nf8tVTigPJSI1o1oBow/9Resa1yehUO9lIipsmu9oG4RzA==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.8.3", + "@babel/helper-optimise-call-expression": "^7.8.3", + "@babel/traverse": "^7.9.6", + "@babel/types": "^7.9.6" + } + }, + "@babel/helper-simple-access": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", + "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", + "dev": true, + "requires": { + "@babel/template": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", + "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "dev": true, + "requires": { + "@babel/types": "^7.8.3" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.9.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", + "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "dev": true + }, + "@babel/helper-wrap-function": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.8.3.tgz", + "integrity": "sha512-LACJrbUET9cQDzb6kG7EeD7+7doC3JNvUgTEQOx2qaO1fKlzE/Bf05qs9w1oXQMmXlPO65lC3Tq9S6gZpTErEQ==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.8.3", + "@babel/template": "^7.8.3", + "@babel/traverse": "^7.8.3", + "@babel/types": "^7.8.3" + } + }, + "@babel/helpers": { + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.6.tgz", + "integrity": "sha512-tI4bUbldloLcHWoRUMAj4g1bF313M/o6fBKhIsb3QnGVPwRm9JsNf/gqMkQ7zjqReABiffPV6RWj7hEglID5Iw==", + "dev": true, + "requires": { + "@babel/template": "^7.8.3", + "@babel/traverse": "^7.9.6", + "@babel/types": "^7.9.6" + } + }, + "@babel/highlight": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", + "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.9.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@babel/parser": { + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", + "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==", + "dev": true + }, + "@babel/plugin-proposal-class-properties": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.1.0.tgz", + "integrity": "sha512-/PCJWN+CKt5v1xcGn4vnuu13QDoV+P7NcICP44BoonAJoPSGwVkgrXihFIQGiEjjPlUDBIw1cM7wYFLARS2/hw==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-member-expression-to-functions": "^7.0.0", + "@babel/helper-optimise-call-expression": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-replace-supers": "^7.1.0", + "@babel/plugin-syntax-class-properties": "^7.0.0" + } + }, + "@babel/plugin-proposal-object-rest-spread": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.0.0.tgz", + "integrity": "sha512-14fhfoPcNu7itSen7Py1iGN0gEm87hX/B+8nZPqkdmANyyYWYMY2pjA3r8WXbWVKMzfnSNS0xY8GVS0IjXi/iw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-object-rest-spread": "^7.0.0" + } + }, + "@babel/plugin-syntax-class-properties": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.8.3.tgz", + "integrity": "sha512-UcAyQWg2bAN647Q+O811tG9MrJ38Z10jjhQdKNAL8fsyPzE3cCN/uT+f55cFVY4aGO4jqJAvmqsuY3GQDwAoXg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.3" + } + }, + "@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-transform-arrow-functions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0.tgz", + "integrity": "sha512-2EZDBl1WIO/q4DIkIp4s86sdp4ZifL51MoIviLY/gG/mLSuOIEg7J8o6mhbxOTvUJkaN50n+8u41FVsr5KLy/w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-async-to-generator": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.1.0.tgz", + "integrity": "sha512-rNmcmoQ78IrvNCIt/R9U+cixUHeYAzgusTFgIAv+wQb9HJU4szhpDD6e5GCACmj/JP5KxuCwM96bX3L9v4ZN/g==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-remap-async-to-generator": "^7.1.0" + } + }, + "@babel/plugin-transform-block-scoped-functions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.0.0.tgz", + "integrity": "sha512-AOBiyUp7vYTqz2Jibe1UaAWL0Hl9JUXEgjFvvvcSc9MVDItv46ViXFw2F7SVt1B5k+KWjl44eeXOAk3UDEaJjQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-block-scoping": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.0.0.tgz", + "integrity": "sha512-GWEMCrmHQcYWISilUrk9GDqH4enf3UmhOEbNbNrlNAX1ssH3MsS1xLOS6rdjRVPgA7XXVPn87tRkdTEoA/dxEg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "lodash": "^4.17.10" + } + }, + "@babel/plugin-transform-classes": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.1.0.tgz", + "integrity": "sha512-rNaqoD+4OCBZjM7VaskladgqnZ1LO6o2UxuWSDzljzW21pN1KXkB7BstAVweZdxQkHAujps5QMNOTWesBciKFg==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.0.0", + "@babel/helper-define-map": "^7.1.0", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-optimise-call-expression": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-replace-supers": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.0.0", + "globals": "^11.1.0" + } + }, + "@babel/plugin-transform-computed-properties": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.0.0.tgz", + "integrity": "sha512-ubouZdChNAv4AAWAgU7QKbB93NU5sHwInEWfp+/OzJKA02E6Woh9RVoX4sZrbRwtybky/d7baTUqwFx+HgbvMA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-destructuring": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.0.0.tgz", + "integrity": "sha512-Fr2GtF8YJSXGTyFPakPFB4ODaEKGU04bPsAllAIabwoXdFrPxL0LVXQX5dQWoxOjjgozarJcC9eWGsj0fD6Zsg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-duplicate-keys": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.0.0.tgz", + "integrity": "sha512-w2vfPkMqRkdxx+C71ATLJG30PpwtTpW7DDdLqYt2acXU7YjztzeWW2Jk1T6hKqCLYCcEA5UQM/+xTAm+QCSnuQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-exponentiation-operator": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.1.0.tgz", + "integrity": "sha512-uZt9kD1Pp/JubkukOGQml9tqAeI8NkE98oZnHZ2qHRElmeKCodbTZgOEUtujSCSLhHSBWbzNiFSDIMC4/RBTLQ==", + "dev": true, + "requires": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.1.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-for-of": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.0.0.tgz", + "integrity": "sha512-TlxKecN20X2tt2UEr2LNE6aqA0oPeMT1Y3cgz8k4Dn1j5ObT8M3nl9aA37LLklx0PBZKETC9ZAf9n/6SujTuXA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-function-name": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.1.0.tgz", + "integrity": "sha512-VxOa1TMlFMtqPW2IDYZQaHsFrq/dDoIjgN098NowhexhZcz3UGlvPgZXuE1jEvNygyWyxRacqDpCZt+par1FNg==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-instanceof": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-instanceof/-/plugin-transform-instanceof-7.0.0.tgz", + "integrity": "sha512-Dv6MtJZOjjGjnHlSwQVpYlwZBkPzaWX/1zoHUW82fmKmUNOp+XnYA1lCYCB+7RXkX8rBa6IuNZ9Y8u3MLJCxuQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-literals": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.0.0.tgz", + "integrity": "sha512-1NTDBWkeNXgpUcyoVFxbr9hS57EpZYXpje92zv0SUzjdu3enaRwF/l3cmyRnXLtIdyJASyiS6PtybK+CgKf7jA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-modules-amd": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.1.0.tgz", + "integrity": "sha512-wt8P+xQ85rrnGNr2x1iV3DW32W8zrB6ctuBkYBbf5/ZzJY99Ob4MFgsZDFgczNU76iy9PWsy4EuxOliDjdKw6A==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.1.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-modules-commonjs": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.1.0.tgz", + "integrity": "sha512-wtNwtMjn1XGwM0AXPspQgvmE6msSJP15CX2RVfpTSTNPLhKhaOjaIfBaVfj4iUZ/VrFSodcFedwtPg/NxwQlPA==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.1.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-simple-access": "^7.1.0" + } + }, + "@babel/plugin-transform-modules-systemjs": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.0.0.tgz", + "integrity": "sha512-8EDKMAsitLkiF/D4Zhe9CHEE2XLh4bfLbb9/Zf3FgXYQOZyZYyg7EAel/aT2A7bHv62jwHf09q2KU/oEexr83g==", + "dev": true, + "requires": { + "@babel/helper-hoist-variables": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-modules-umd": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.1.0.tgz", + "integrity": "sha512-enrRtn5TfRhMmbRwm7F8qOj0qEYByqUvTttPEGimcBH4CJHphjyK1Vg7sdU7JjeEmgSpM890IT/efS2nMHwYig==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.1.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-object-super": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.1.0.tgz", + "integrity": "sha512-/O02Je1CRTSk2SSJaq0xjwQ8hG4zhZGNjE8psTsSNPXyLRCODv7/PBozqT5AmQMzp7MI3ndvMhGdqp9c96tTEw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-replace-supers": "^7.1.0" + } + }, + "@babel/plugin-transform-parameters": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.1.0.tgz", + "integrity": "sha512-vHV7oxkEJ8IHxTfRr3hNGzV446GAb+0hgbA7o/0Jd76s+YzccdWuTU296FOCOl/xweU4t/Ya4g41yWz80RFCRw==", + "dev": true, + "requires": { + "@babel/helper-call-delegate": "^7.1.0", + "@babel/helper-get-function-arity": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-regenerator": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.0.0.tgz", + "integrity": "sha512-sj2qzsEx8KDVv1QuJc/dEfilkg3RRPvPYx/VnKLtItVQRWt1Wqf5eVCOLZm29CiGFfYYsA3VPjfizTCV0S0Dlw==", + "dev": true, + "requires": { + "regenerator-transform": "^0.13.3" + } + }, + "@babel/plugin-transform-runtime": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.1.0.tgz", + "integrity": "sha512-WFLMgzu5DLQEah0lKTJzYb14vd6UiES7PTnXcvrPZ1VrwFeJ+mTbvr65fFAsXYMt2bIoOoC0jk76zY1S7HZjUg==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "resolve": "^1.8.1", + "semver": "^5.5.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "@babel/plugin-transform-shorthand-properties": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.0.0.tgz", + "integrity": "sha512-g/99LI4vm5iOf5r1Gdxq5Xmu91zvjhEG5+yZDJW268AZELAu4J1EiFLnkSG3yuUsZyOipVOVUKoGPYwfsTymhw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-spread": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.0.0.tgz", + "integrity": "sha512-L702YFy2EvirrR4shTj0g2xQp7aNwZoWNCkNu2mcoU0uyzMl0XRwDSwzB/xp6DSUFiBmEXuyAyEN16LsgVqGGQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-sticky-regex": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.0.0.tgz", + "integrity": "sha512-LFUToxiyS/WD+XEWpkx/XJBrUXKewSZpzX68s+yEOtIbdnsRjpryDw9U06gYc6klYEij/+KQVRnD3nz3AoKmjw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-regex": "^7.0.0" + } + }, + "@babel/plugin-transform-template-literals": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.0.0.tgz", + "integrity": "sha512-vA6rkTCabRZu7Nbl9DfLZE1imj4tzdWcg5vtdQGvj+OH9itNNB6hxuRMHuIY8SGnEt1T9g5foqs9LnrHzsqEFg==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-typeof-symbol": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.0.0.tgz", + "integrity": "sha512-1r1X5DO78WnaAIvs5uC48t41LLckxsYklJrZjNKcevyz83sF2l4RHbw29qrCPr/6ksFsdfRpT/ZgxNWHXRnffg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-unicode-regex": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.0.0.tgz", + "integrity": "sha512-uJBrJhBOEa3D033P95nPHu3nbFwFE9ZgXsfEitzoIXIwqAZWk7uXcg06yFKXz9FSxBH5ucgU/cYdX0IV8ldHKw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-regex": "^7.0.0", + "regexpu-core": "^4.1.3" + } + }, + "@babel/template": { + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", + "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@babel/parser": "^7.8.6", + "@babel/types": "^7.8.6" + } + }, + "@babel/traverse": { + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.6.tgz", + "integrity": "sha512-b3rAHSjbxy6VEAvlxM8OV/0X4XrG72zoxme6q1MOoe2vd0bEc+TwayhuC1+Dfgqh1QEG+pj7atQqvUprHIccsg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "@babel/generator": "^7.9.6", + "@babel/helper-function-name": "^7.9.5", + "@babel/helper-split-export-declaration": "^7.8.3", + "@babel/parser": "^7.9.6", + "@babel/types": "^7.9.6", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.9.5", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "@cnakazawa/watch": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", + "integrity": "sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ==", + "dev": true, + "requires": { + "exec-sh": "^0.3.2", + "minimist": "^1.2.0" + } + }, + "@hapi/address": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@hapi/address/-/address-4.0.1.tgz", + "integrity": "sha512-0oEP5UiyV4f3d6cBL8F3Z5S7iWSX39Knnl0lY8i+6gfmmIBj44JCBNtcMgwyS+5v7j3VYavNay0NFHDS+UGQcw==", + "dev": true, + "requires": { + "@hapi/hoek": "^9.0.0" + } + }, + "@hapi/formula": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@hapi/formula/-/formula-2.0.0.tgz", + "integrity": "sha512-V87P8fv7PI0LH7LiVi8Lkf3x+KCO7pQozXRssAHNXXL9L1K+uyu4XypLXwxqVDKgyQai6qj3/KteNlrqDx4W5A==", + "dev": true + }, + "@hapi/hoek": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.0.4.tgz", + "integrity": "sha512-EwaJS7RjoXUZ2cXXKZZxZqieGtc7RbvQhUy8FwDoMQtxWVi14tFjeFCYPZAM1mBCpOpiBpyaZbb9NeHc7eGKgw==", + "dev": true + }, + "@hapi/joi": { + "version": "17.1.1", + "resolved": "https://registry.npmjs.org/@hapi/joi/-/joi-17.1.1.tgz", + "integrity": "sha512-p4DKeZAoeZW4g3u7ZeRo+vCDuSDgSvtsB/NpfjXEHTUjSeINAi/RrVOWiVQ1isaoLzMvFEhe8n5065mQq1AdQg==", + "dev": true, + "requires": { + "@hapi/address": "^4.0.1", + "@hapi/formula": "^2.0.0", + "@hapi/hoek": "^9.0.0", + "@hapi/pinpoint": "^2.0.0", + "@hapi/topo": "^5.0.0" + } + }, + "@hapi/pinpoint": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@hapi/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-vzXR5MY7n4XeIvLpfl3HtE3coZYO4raKXW766R6DZw/6aLqR26iuZ109K7a0NtF2Db0jxqh7xz2AxkUwpUFybw==", + "dev": true + }, + "@hapi/topo": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.0.0.tgz", + "integrity": "sha512-tFJlT47db0kMqVm3H4nQYgn6Pwg10GTZHb1pwmSiv1K4ks6drQOtfEF5ZnPjkvC+y4/bUPHK+bc87QvLcL+WMw==", + "dev": true, + "requires": { + "@hapi/hoek": "^9.0.0" + } + }, + "@jest/console": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.9.0.tgz", + "integrity": "sha512-Zuj6b8TnKXi3q4ymac8EQfc3ea/uhLeCGThFqXeC8H9/raaH8ARPUTdId+XyGd03Z4In0/VjD2OYFcBF09fNLQ==", + "dev": true, + "requires": { + "@jest/source-map": "^24.9.0", + "chalk": "^2.0.1", + "slash": "^2.0.0" + }, + "dependencies": { + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@jest/core": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-24.9.0.tgz", + "integrity": "sha512-Fogg3s4wlAr1VX7q+rhV9RVnUv5tD7VuWfYy1+whMiWUrvl7U3QJSJyWcDio9Lq2prqYsZaeTv2Rz24pWGkJ2A==", + "dev": true, + "requires": { + "@jest/console": "^24.7.1", + "@jest/reporters": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "graceful-fs": "^4.1.15", + "jest-changed-files": "^24.9.0", + "jest-config": "^24.9.0", + "jest-haste-map": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-regex-util": "^24.3.0", + "jest-resolve": "^24.9.0", + "jest-resolve-dependencies": "^24.9.0", + "jest-runner": "^24.9.0", + "jest-runtime": "^24.9.0", + "jest-snapshot": "^24.9.0", + "jest-util": "^24.9.0", + "jest-validate": "^24.9.0", + "jest-watcher": "^24.9.0", + "micromatch": "^3.1.10", + "p-each-series": "^1.0.0", + "realpath-native": "^1.1.0", + "rimraf": "^2.5.4", + "slash": "^2.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "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.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "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.0.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.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "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.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "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=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, + "@jest/environment": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-24.9.0.tgz", + "integrity": "sha512-5A1QluTPhvdIPFYnO3sZC3smkNeXPVELz7ikPbhUj0bQjB07EoE9qtLrem14ZUYWdVayYbsjVwIiL4WBIMV4aQ==", + "dev": true, + "requires": { + "@jest/fake-timers": "^24.9.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "jest-mock": "^24.9.0" + } + }, + "@jest/fake-timers": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-24.9.0.tgz", + "integrity": "sha512-eWQcNa2YSwzXWIMC5KufBh3oWRIijrQFROsIqt6v/NS9Io/gknw1jsAC9c+ih/RQX4A3O7SeWAhQeN0goKhT9A==", + "dev": true, + "requires": { + "@jest/types": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-mock": "^24.9.0" + } + }, + "@jest/reporters": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-24.9.0.tgz", + "integrity": "sha512-mu4X0yjaHrffOsWmVLzitKmmmWSQ3GGuefgNscUSWNiUNcEOSEQk9k3pERKEQVBb0Cnn88+UESIsZEMH3o88Gw==", + "dev": true, + "requires": { + "@jest/environment": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "glob": "^7.1.2", + "istanbul-lib-coverage": "^2.0.2", + "istanbul-lib-instrument": "^3.0.1", + "istanbul-lib-report": "^2.0.4", + "istanbul-lib-source-maps": "^3.0.1", + "istanbul-reports": "^2.2.6", + "jest-haste-map": "^24.9.0", + "jest-resolve": "^24.9.0", + "jest-runtime": "^24.9.0", + "jest-util": "^24.9.0", + "jest-worker": "^24.6.0", + "node-notifier": "^5.4.2", + "slash": "^2.0.0", + "source-map": "^0.6.0", + "string-length": "^2.0.0" + }, + "dependencies": { + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "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 + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@jest/source-map": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-24.9.0.tgz", + "integrity": "sha512-/Xw7xGlsZb4MJzNDgB7PW5crou5JqWiBQaz6xyPd3ArOg2nfn/PunV8+olXbbEZzNl591o5rWKE9BRDaFAuIBg==", + "dev": true, + "requires": { + "callsites": "^3.0.0", + "graceful-fs": "^4.1.15", + "source-map": "^0.6.0" + }, + "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 + } + } + }, + "@jest/test-result": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-24.9.0.tgz", + "integrity": "sha512-XEFrHbBonBJ8dGp2JmF8kP/nQI/ImPpygKHwQ/SY+es59Z3L5PI4Qb9TQQMAEeYsThG1xF0k6tmG0tIKATNiiA==", + "dev": true, + "requires": { + "@jest/console": "^24.9.0", + "@jest/types": "^24.9.0", + "@types/istanbul-lib-coverage": "^2.0.0" + } + }, + "@jest/test-sequencer": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-24.9.0.tgz", + "integrity": "sha512-6qqsU4o0kW1dvA95qfNog8v8gkRN9ph6Lz7r96IvZpHdNipP2cBcb07J1Z45mz/VIS01OHJ3pY8T5fUY38tg4A==", + "dev": true, + "requires": { + "@jest/test-result": "^24.9.0", + "jest-haste-map": "^24.9.0", + "jest-runner": "^24.9.0", + "jest-runtime": "^24.9.0" + } + }, + "@jest/transform": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-24.9.0.tgz", + "integrity": "sha512-TcQUmyNRxV94S0QpMOnZl0++6RMiqpbH/ZMccFB/amku6Uwvyb1cjYX7xkp5nGNkbX4QPH/FcB6q1HBTHynLmQ==", + "dev": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/types": "^24.9.0", + "babel-plugin-istanbul": "^5.1.0", + "chalk": "^2.0.1", + "convert-source-map": "^1.4.0", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.1.15", + "jest-haste-map": "^24.9.0", + "jest-regex-util": "^24.9.0", + "jest-util": "^24.9.0", + "micromatch": "^3.1.10", + "pirates": "^4.0.1", + "realpath-native": "^1.1.0", + "slash": "^2.0.0", + "source-map": "^0.6.1", + "write-file-atomic": "2.4.1" + }, + "dependencies": { + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "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.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "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.0.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.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "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.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "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 + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "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=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, + "@jest/types": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz", + "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^13.0.0" + } + }, + "@lwc/babel-plugin-component": { + "version": "1.1.13-224.4", + "resolved": "https://registry.npmjs.org/@lwc/babel-plugin-component/-/babel-plugin-component-1.1.13-224.4.tgz", + "integrity": "sha512-ViwqukZPJIF3gjLaoCCxDfpGuo2ZzNNcWYvay8KndjNvX89pWZAaUX2kEzi/RB0xaEnFzyScfQ3qVhgiNTYOdA==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "7.0.0", + "@babel/plugin-proposal-class-properties": "7.1.0", + "@lwc/errors": "1.1.13-224.4", + "line-column": "^1.0.2" + } + }, + "@lwc/compiler": { + "version": "1.1.13-224.4", + "resolved": "https://registry.npmjs.org/@lwc/compiler/-/compiler-1.1.13-224.4.tgz", + "integrity": "sha512-fqGNiXEegzkJ4smkJaF+oP6UxGS9yKJHQrzhVuKVy8kLX6SQ9TUXP5MmktTPrjejnGGb6kSL8BcpWG0JvC/fsg==", + "dev": true, + "requires": { + "@babel/core": "7.1.0", + "@babel/plugin-proposal-object-rest-spread": "7.0.0", + "@lwc/babel-plugin-component": "1.1.13-224.4", + "@lwc/errors": "1.1.13-224.4", + "@lwc/shared": "1.1.13-224.4", + "@lwc/style-compiler": "1.1.13-224.4", + "@lwc/template-compiler": "1.1.13-224.4", + "babel-preset-compat": "0.21.7", + "rollup": "^1.7.4", + "rollup-plugin-replace": "^2.1.0", + "terser": "^3.17.0" + } + }, + "@lwc/engine": { + "version": "1.1.13-224.4", + "resolved": "https://registry.npmjs.org/@lwc/engine/-/engine-1.1.13-224.4.tgz", + "integrity": "sha512-6ORVKhbb75m7VkTUohfrezb+RXd7BTst1SY4EHFVWrR19/3ta3D83hvbCOn73DR2gIlnLNEJDVcfG/c6B6KAvQ==", + "dev": true, + "requires": { + "observable-membrane": "0.26.1" + } + }, + "@lwc/errors": { + "version": "1.1.13-224.4", + "resolved": "https://registry.npmjs.org/@lwc/errors/-/errors-1.1.13-224.4.tgz", + "integrity": "sha512-LqCZcj8ZPpjnmkUwJG4DkDk6lYUitUz25kiHBDuwe4aK4V+DwvbL4ckxnqunOXonyGlW3Ln5oJAdwlS5KLq/5Q==", + "dev": true + }, + "@lwc/eslint-plugin-lwc": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/@lwc/eslint-plugin-lwc/-/eslint-plugin-lwc-0.9.0.tgz", + "integrity": "sha512-JKcyZICV2V/IhWhNqHUXXIk5eD8ZYCkGmxfbt/FPaYS2e363yLi7zlhzQlopxduq2LbcQjQKKrJRBhYcjTC++A==", + "dev": true + }, + "@lwc/jest-preset": { + "version": "4.1.0-224.3", + "resolved": "https://registry.npmjs.org/@lwc/jest-preset/-/jest-preset-4.1.0-224.3.tgz", + "integrity": "sha512-8rT3UOmR3aOPrxZZ5rAzyysd2/Xo56wCzP3ej0BYztZ0WV71VqIUq60fAqPebQG6IxUUGhE8LsecC2dzC2OrYg==", + "dev": true, + "requires": { + "@lwc/jest-resolver": "4.1.0-224.3", + "@lwc/jest-serializer": "4.1.0-224.3", + "@lwc/jest-transformer": "4.1.0-224.3", + "jest-environment-jsdom-fifteen": "^1.0.2" + } + }, + "@lwc/jest-resolver": { + "version": "4.1.0-224.3", + "resolved": "https://registry.npmjs.org/@lwc/jest-resolver/-/jest-resolver-4.1.0-224.3.tgz", + "integrity": "sha512-ppSZbJYhcnOnH4HmmEqmP90590JpWPw9A2QkQ6FXy5i1OZTv1q5IPqqS1KQBcr6T4+JoAcZ+WvLmaTr/xY7Gvg==", + "dev": true + }, + "@lwc/jest-serializer": { + "version": "4.1.0-224.3", + "resolved": "https://registry.npmjs.org/@lwc/jest-serializer/-/jest-serializer-4.1.0-224.3.tgz", + "integrity": "sha512-85CIEz5WlX157XLZET47VkKtm/8asEFso5FlgTvRlASt0VuF6fh+xPnjl8aHxFoEqsnfFB39AI+TbYryAyq0nQ==", + "dev": true, + "requires": { + "pretty-format": "~24.8.0" + } + }, + "@lwc/jest-transformer": { + "version": "4.1.0-224.3", + "resolved": "https://registry.npmjs.org/@lwc/jest-transformer/-/jest-transformer-4.1.0-224.3.tgz", + "integrity": "sha512-crYfGyB0BpKt6AYKFQs4EKaTPnNd5temTFKTKV+QLD6OmscDEB8917Wf3o1par8bYO/U7kHGz5Lmk4aTnFdx/g==", + "dev": true, + "requires": { + "@babel/core": "7.1.0", + "@babel/plugin-transform-modules-commonjs": "7.1.0", + "@babel/template": "~7.1.2", + "babel-plugin-transform-dynamic-import": "^2.1.0", + "babel-preset-jest": "^24.0.0" + }, + "dependencies": { + "@babel/template": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.1.2.tgz", + "integrity": "sha512-SY1MmplssORfFiLDcOETrW7fCLl+PavlwMh92rrGcikQaRq4iWPVH0MpwPpY3etVMx6RnDjXtr6VZYr/IbP/Ag==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.1.2", + "@babel/types": "^7.1.2" + } + } + } + }, + "@lwc/module-resolver": { + "version": "1.1.13-224.4", + "resolved": "https://registry.npmjs.org/@lwc/module-resolver/-/module-resolver-1.1.13-224.4.tgz", + "integrity": "sha512-B7EUcpN6N+kNLxbsii0Z+jAkYTFIqwEeClVB//NhsZ2VKcAE5X6pk24CZ9CGz5sCnjepeHVYujuHTm/Q+sAYBw==", + "dev": true + }, + "@lwc/shared": { + "version": "1.1.13-224.4", + "resolved": "https://registry.npmjs.org/@lwc/shared/-/shared-1.1.13-224.4.tgz", + "integrity": "sha512-xMCWD+buRHVVAOop/woULXKJI4vrict+dpyVT5d5EKLbxGHiYd2ZtS3QfrNRbZDywuAZNV7xAcLsEhMI4DRHyw==", + "dev": true + }, + "@lwc/style-compiler": { + "version": "1.1.13-224.4", + "resolved": "https://registry.npmjs.org/@lwc/style-compiler/-/style-compiler-1.1.13-224.4.tgz", + "integrity": "sha512-AeFEtXlIV4NSuIKP9xCKDDiorN3E1Un3XikFivO4rqGSMbHc7lPdReDrfTPFr4AKuUpL+9ZNmToVzVtKyq9I6w==", + "dev": true, + "requires": { + "cssnano": "~3.10.0", + "postcss": "~7.0.5", + "postcss-selector-parser": "~6.0.2", + "postcss-value-parser": "~4.0.2" + } + }, + "@lwc/synthetic-shadow": { + "version": "1.1.13-224.4", + "resolved": "https://registry.npmjs.org/@lwc/synthetic-shadow/-/synthetic-shadow-1.1.13-224.4.tgz", + "integrity": "sha512-Eb7zWrIWHqv+Rnh4mBWHCUHMKXNqIRXEDPe84mmS4zdXLgiYfJXUOqMUlZVYAnPfh+snKU/JoYZCdVlV7St0xw==", + "dev": true + }, + "@lwc/template-compiler": { + "version": "1.1.13-224.4", + "resolved": "https://registry.npmjs.org/@lwc/template-compiler/-/template-compiler-1.1.13-224.4.tgz", + "integrity": "sha512-yr1hAVObun8LSfI/4OpMVqqECdUcRj3woUnaFoxzaRj8SO3Z1oKkqQHZWpow29D0FSvdZ/7UIw0mYgrhdyin1A==", + "dev": true, + "requires": { + "@babel/generator": "~7.1.5", + "@babel/parser": "~7.1.5", + "@babel/template": "~7.1.2", + "@babel/traverse": "~7.1.5", + "@babel/types": "~7.1.5", + "@lwc/errors": "1.1.13-224.4", + "@lwc/shared": "1.1.13-224.4", + "camelcase": "~5.0.0", + "esutils": "^2.0.2", + "he": "^1.1.1", + "parse5-with-errors": "4.0.3-beta1" + }, + "dependencies": { + "@babel/generator": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.1.6.tgz", + "integrity": "sha512-brwPBtVvdYdGxtenbQgfCdDPmtkmUBZPjUoK5SXJEBuHaA5BCubh9ly65fzXz7R6o5rA76Rs22ES8Z+HCc0YIQ==", + "dev": true, + "requires": { + "@babel/types": "^7.1.6", + "jsesc": "^2.5.1", + "lodash": "^4.17.10", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" + } + }, + "@babel/parser": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.1.6.tgz", + "integrity": "sha512-dWP6LJm9nKT6ALaa+bnL247GHHMWir3vSlZ2+IHgHgktZQx0L3Uvq2uAWcuzIe+fujRsYWBW2q622C5UvGK9iQ==", + "dev": true + }, + "@babel/template": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.1.2.tgz", + "integrity": "sha512-SY1MmplssORfFiLDcOETrW7fCLl+PavlwMh92rrGcikQaRq4iWPVH0MpwPpY3etVMx6RnDjXtr6VZYr/IbP/Ag==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.1.2", + "@babel/types": "^7.1.2" + } + }, + "@babel/traverse": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.1.6.tgz", + "integrity": "sha512-CXedit6GpISz3sC2k2FsGCUpOhUqKdyL0lqNrImQojagnUMXf8hex4AxYFRuMkNGcvJX5QAFGzB5WJQmSv8SiQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/generator": "^7.1.6", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.0.0", + "@babel/parser": "^7.1.6", + "@babel/types": "^7.1.6", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.10" + } + }, + "@babel/types": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.1.6.tgz", + "integrity": "sha512-DMiUzlY9DSjVsOylJssxLHSgj6tWM9PRFJOGW/RaOglVOK9nzTxoOMfTfRQXGUCUQ/HmlG2efwC+XqUEJ5ay4w==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.10", + "to-fast-properties": "^2.0.0" + } + }, + "camelcase": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", + "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", + "dev": true + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@lwc/wire-service": { + "version": "1.1.13-224.4", + "resolved": "https://registry.npmjs.org/@lwc/wire-service/-/wire-service-1.1.13-224.4.tgz", + "integrity": "sha512-5AJw1Ybux4+w+ep6ixIOn7QI1LpG3sgzuiLPayteoMySlbBLDXM1lPKVWviRXWXhzT+w2/5Zj0f72M5d4zW6uA==", + "dev": true + }, + "@prettier/plugin-xml": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/@prettier/plugin-xml/-/plugin-xml-0.7.2.tgz", + "integrity": "sha512-c6i6OQ2y9kvWeUTrfkwHy+jdJXI3bpO8TT9EoVjJIEAApj5gLtJ/O2D9qthxWXh5zbipngueDEC2CT6tBZzBdA==", + "dev": true, + "requires": { + "@xml-tools/parser": "^1.0.2", + "prettier": ">=1.10" + } + }, + "@salesforce/eslint-config-lwc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@salesforce/eslint-config-lwc/-/eslint-config-lwc-0.5.0.tgz", + "integrity": "sha512-t2lwpxIylyKkEtE2q5rb1qZigrTMq4Q2j2xMUzGKkIIDD+kA3LRLU8rAD/WxOJG8ihFuF705d1VGsIGdrOSc4A==", + "dev": true, + "requires": { + "@lwc/eslint-plugin-lwc": "^0.9.0", + "babel-eslint": "^10.0.3", + "eslint-plugin-import": "^2.20.1", + "eslint-plugin-jest": "^23.6.0", + "eslint-restricted-globals": "^0.2.0" + } + }, + "@salesforce/sfdx-lwc-jest": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/@salesforce/sfdx-lwc-jest/-/sfdx-lwc-jest-0.7.1.tgz", + "integrity": "sha512-qXLWkdvNfGoEfFa/2u1V09MfyR/9WO2RrkwgbNOuTF6yfqyr2Vzyc6xfbRMOVQY3xgzM38VekFavS+K+TGArBQ==", + "dev": true, + "requires": { + "@lwc/compiler": "1.1.13-224.4", + "@lwc/engine": "1.1.13-224.4", + "@lwc/jest-preset": "4.1.0-224.3", + "@lwc/jest-resolver": "4.1.0-224.3", + "@lwc/jest-serializer": "4.1.0-224.3", + "@lwc/jest-transformer": "4.1.0-224.3", + "@lwc/module-resolver": "1.1.13-224.4", + "@lwc/synthetic-shadow": "1.1.13-224.4", + "@lwc/wire-service": "1.1.13-224.4", + "@salesforce/wire-service-jest-util": "^2.2.5", + "chalk": "^2.4.2", + "glob": "^7.1.5", + "jest": "24.9.0", + "yargs": "^14.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "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 + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "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 + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "yargs": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", + "integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^15.0.1" + } + }, + "yargs-parser": { + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz", + "integrity": "sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "@salesforce/wire-service-jest-util": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@salesforce/wire-service-jest-util/-/wire-service-jest-util-2.4.0.tgz", + "integrity": "sha512-/2fAgbv/bdFEtH1p7x7O8yifOw2jimgvv3nfI2ehR6s65OJIg8Pnb55itotBmHgbb6Ld6Wm9rte+3BS0ef9/gA==", + "dev": true + }, + "@samverschueren/stream-to-observable": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz", + "integrity": "sha512-MI4Xx6LHs4Webyvi6EbspgyAb4D2Q2VtnCQ1blOJcoLS6mVa8lNN2rkIy1CVxfTUpoyIbCTkXES1rLXztFD1lg==", + "dev": true, + "requires": { + "any-observable": "^0.3.0" + } + }, + "@types/babel__core": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.7.tgz", + "integrity": "sha512-RL62NqSFPCDK2FM1pSDH0scHpJvsXtZNiYlMB73DgPBaG1E38ZYVL+ei5EkWRbr+KC4YNiAUNBnRj+bgwpgjMw==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "@types/babel__generator": { + "version": "7.6.1", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.1.tgz", + "integrity": "sha512-bBKm+2VPJcMRVwNhxKu8W+5/zT7pwNEqeokFOmbvVSqGzFneNxYcEBro9Ac7/N9tlsaPYnZLK8J1LWKkMsLAew==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@types/babel__template": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.0.2.tgz", + "integrity": "sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@types/babel__traverse": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.11.tgz", + "integrity": "sha512-ddHK5icION5U6q11+tV2f9Mo6CZVuT8GJKld2q9LqHSZbvLbH34Kcu2yFGckZut453+eQU6btIA3RihmnRgI+Q==", + "dev": true, + "requires": { + "@babel/types": "^7.3.0" + } + }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", + "dev": true + }, + "@types/estree": { + "version": "0.0.44", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.44.tgz", + "integrity": "sha512-iaIVzr+w2ZJ5HkidlZ3EJM8VTZb2MJLCjw3V+505yVts0gRC4UMvjw0d1HPtGqI/HQC/KdsYtayfzl+AXY2R8g==", + "dev": true + }, + "@types/istanbul-lib-coverage": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.2.tgz", + "integrity": "sha512-rsZg7eL+Xcxsxk2XlBt9KcG8nOp9iYdKCOikY9x2RFJCyOdNj4MKPQty0e8oZr29vVAzKXr1BmR+kZauti3o1w==", + "dev": true + }, + "@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz", + "integrity": "sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*", + "@types/istanbul-lib-report": "*" + } + }, + "@types/json-schema": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.4.tgz", + "integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==", + "dev": true + }, + "@types/node": { + "version": "6.14.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-6.14.10.tgz", + "integrity": "sha512-pF4HjZGSog75kGq7B1InK/wt/N08BuPATo+7HRfv7gZUzccebwv/fmWVGs/j6LvSiLWpCuGGhql51M/wcQsNzA==", + "dev": true + }, + "@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, + "@types/stack-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", + "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==", + "dev": true + }, + "@types/yargs": { + "version": "13.0.9", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.9.tgz", + "integrity": "sha512-xrvhZ4DZewMDhoH1utLtOAwYQy60eYFoXeje30TzM3VOvQlBwQaEpKFq5m34k1wOw2AKIi2pwtiAjdmhvlBUzg==", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "15.0.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-15.0.0.tgz", + "integrity": "sha512-FA/BWv8t8ZWJ+gEOnLLd8ygxH/2UFbAvgEonyfN6yWGLKc7zVjbpl2Y4CTjid9h2RfgPP6SEt6uHwEOply00yw==", + "dev": true + }, + "@typescript-eslint/experimental-utils": { + "version": "2.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-2.34.0.tgz", + "integrity": "sha512-eS6FTkq+wuMJ+sgtuNTtcqavWXqsflWcfBnlYhg/nS4aZ1leewkXGbvBhaapn1q6qf4M71bsR1tez5JTRMuqwA==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "2.34.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "2.34.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-2.34.0.tgz", + "integrity": "sha512-OMAr+nJWKdlVM9LOqCqh3pQQPwxHAN7Du8DR6dmwCrAmxtiXQnhHJ6tBNtf+cggqfo51SG/FCwnKhXCIM7hnVg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@xml-tools/parser": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@xml-tools/parser/-/parser-1.0.5.tgz", + "integrity": "sha512-c3ZWjRNDDH/h3i/aYe7y4FPowRynNXOHW4+N+G/DekV1le6IZMu5MueSUXXk8+6XenxTry7ugHYqdbyTd5F1HA==", + "dev": true, + "requires": { + "chevrotain": "7.0.1" + } + }, + "abab": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.3.tgz", + "integrity": "sha512-tsFzPpcttalNjFBCFMqsKYQcWxxen1pgJR56by//QwvJc4/OUS3kPOOttx2tSIfjsylB0pYu7f5D3K1RCxUnUg==", + "dev": true + }, + "acorn": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.2.0.tgz", + "integrity": "sha512-apwXVmYVpQ34m/i71vrApRrRKCWQnZZF1+npOD0WV5xZFfwWOmKGQ2RWlfdy9vWITsenisM8M0Qeq8agcFHNiQ==", + "dev": true + }, + "acorn-globals": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.4.tgz", + "integrity": "sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A==", + "dev": true, + "requires": { + "acorn": "^6.0.1", + "acorn-walk": "^6.0.1" + }, + "dependencies": { + "acorn": { + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz", + "integrity": "sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==", + "dev": true + } + } + }, + "acorn-jsx": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", + "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", + "dev": true + }, + "acorn-walk": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz", + "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==", + "dev": true + }, + "aggregate-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, + "ajv": { + "version": "6.12.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", + "integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "alphanum-sort": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/alphanum-sort/-/alphanum-sort-1.0.2.tgz", + "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", + "dev": true + }, + "ansi-colors": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.4.tgz", + "integrity": "sha512-hHUXGagefjN2iRrID63xckIvotOXOojhQKWIPUZ4mNUZ9nLZW+7FMNoE1lOkEhNWYsx/7ysGIuJYCiMAA9FnrA==", + "dev": true + }, + "ansi-escapes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "any-observable": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/any-observable/-/any-observable-0.3.0.tgz", + "integrity": "sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog==", + "dev": true + }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "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.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "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.0.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.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "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.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "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.0.1" + } + }, + "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=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "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 + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-equal": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", + "dev": true + }, + "array-includes": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.1.tgz", + "integrity": "sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0", + "is-string": "^1.0.5" + } + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "array.prototype.flat": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.2.3.tgz", + "integrity": "sha512-gBlRZV0VSmfPIeWfuuy56XZMvbVfbEUnOXUvt3F/eUUUSyzlgLxhEX4YAEpxNAogRGehPSnfXyPtYyKAhkzQhQ==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "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=", + "dev": true + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "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.6", + "caniuse-db": "^1.0.30000634", + "normalize-range": "^0.1.2", + "num2fraction": "^1.2.2", + "postcss": "^5.2.16", + "postcss-value-parser": "^3.2.3" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "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.0.0" + } + }, + "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" + } + } + } + }, + "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=", + "dev": true + }, + "aws4": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", + "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==", + "dev": true + }, + "axios": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz", + "integrity": "sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==", + "dev": true, + "requires": { + "follow-redirects": "1.5.10" + } + }, + "babel-eslint": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", + "integrity": "sha512-ifWaTHQ0ce+448CYop8AdrQiBsGrnC+bMgfyKFdi6EsPLTAWG+QfyDeM6OH+FmWnKvEq5NnBMLvlBUPKQZoDSg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.0", + "@babel/traverse": "^7.7.0", + "@babel/types": "^7.7.0", + "eslint-visitor-keys": "^1.0.0", + "resolve": "^1.12.0" + } + }, + "babel-jest": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.9.0.tgz", + "integrity": "sha512-ntuddfyiN+EhMw58PTNL1ph4C9rECiQXjI4nMMBKBaNjXvqLdkXpPRcMSr4iyBrJg/+wz9brFUD6RhOAT6r4Iw==", + "dev": true, + "requires": { + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "@types/babel__core": "^7.1.0", + "babel-plugin-istanbul": "^5.1.0", + "babel-preset-jest": "^24.9.0", + "chalk": "^2.4.2", + "slash": "^2.0.0" + }, + "dependencies": { + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "babel-plugin-istanbul": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz", + "integrity": "sha512-5LphC0USA8t4i1zCtjbbNb6jJj/9+X6P37Qfirc/70EQ34xKlMW+a1RHGwxGI+SwWpNwZ27HqvzAobeqaXwiZw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "find-up": "^3.0.0", + "istanbul-lib-instrument": "^3.3.0", + "test-exclude": "^5.2.3" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "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 + } + } + }, + "babel-plugin-jest-hoist": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.9.0.tgz", + "integrity": "sha512-2EMA2P8Vp7lG0RAzr4HXqtYwacfMErOuv1U3wrvxHX6rD1sV6xS3WXG3r8TRQ2r6w8OhvSdWt+z41hQNwNm3Xw==", + "dev": true, + "requires": { + "@types/babel__traverse": "^7.0.6" + } + }, + "babel-plugin-transform-dynamic-import": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-dynamic-import/-/babel-plugin-transform-dynamic-import-2.1.0.tgz", + "integrity": "sha512-ja4NWc37+7bV6/uJKCERJEGHEyK1DXgXp8teHvjKC4Jsj3Ib484dJdamFIBtSb40JFniyWZo6ML46usVvfdsSg==", + "dev": true, + "requires": { + "@babel/plugin-syntax-dynamic-import": "^7.0.0" + } + }, + "babel-plugin-transform-proxy-compat": { + "version": "0.21.7", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-proxy-compat/-/babel-plugin-transform-proxy-compat-0.21.7.tgz", + "integrity": "sha512-GStyg3hYkmX9T/Pgx8Pypyelib0v989/R8VoUOF8tTsTI/F3es1SBWH9N6M4Ib8Gu4HeTaRYrNJcildjqUadyQ==", + "dev": true, + "requires": { + "@babel/types": "7.0.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0.tgz", + "integrity": "sha512-5tPDap4bGKTLPtci2SUl/B7Gv8RnuJFuQoWx26RJobS0fFrz4reUA3JnwIM+HVHEmWE0C1mzKhDtTp8NsWY02Q==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.10", + "to-fast-properties": "^2.0.0" + } + } + } + }, + "babel-preset-compat": { + "version": "0.21.7", + "resolved": "https://registry.npmjs.org/babel-preset-compat/-/babel-preset-compat-0.21.7.tgz", + "integrity": "sha512-visueCbdzXeqxXbmzw2MgYqxuVj4EGC14K8TU6DCLxpvFJ5zBwsFu/xrPSzZ35yRZz4UcTyrTfc0c3B4ofo3rw==", + "dev": true, + "requires": { + "@babel/plugin-proposal-class-properties": "7.1.0", + "@babel/plugin-proposal-object-rest-spread": "7.0.0", + "@babel/plugin-transform-arrow-functions": "7.0.0", + "@babel/plugin-transform-async-to-generator": "7.1.0", + "@babel/plugin-transform-block-scoped-functions": "7.0.0", + "@babel/plugin-transform-block-scoping": "7.0.0", + "@babel/plugin-transform-classes": "7.1.0", + "@babel/plugin-transform-computed-properties": "7.0.0", + "@babel/plugin-transform-destructuring": "7.0.0", + "@babel/plugin-transform-duplicate-keys": "7.0.0", + "@babel/plugin-transform-exponentiation-operator": "7.1.0", + "@babel/plugin-transform-for-of": "7.0.0", + "@babel/plugin-transform-function-name": "7.1.0", + "@babel/plugin-transform-instanceof": "7.0.0", + "@babel/plugin-transform-literals": "7.0.0", + "@babel/plugin-transform-modules-amd": "7.1.0", + "@babel/plugin-transform-modules-commonjs": "7.1.0", + "@babel/plugin-transform-modules-systemjs": "7.0.0", + "@babel/plugin-transform-modules-umd": "7.1.0", + "@babel/plugin-transform-object-super": "7.1.0", + "@babel/plugin-transform-parameters": "7.1.0", + "@babel/plugin-transform-regenerator": "7.0.0", + "@babel/plugin-transform-runtime": "7.1.0", + "@babel/plugin-transform-shorthand-properties": "7.0.0", + "@babel/plugin-transform-spread": "7.0.0", + "@babel/plugin-transform-sticky-regex": "7.0.0", + "@babel/plugin-transform-template-literals": "7.0.0", + "@babel/plugin-transform-typeof-symbol": "7.0.0", + "@babel/plugin-transform-unicode-regex": "7.0.0", + "babel-plugin-transform-proxy-compat": "0.21.7" + } + }, + "babel-preset-jest": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.9.0.tgz", + "integrity": "sha512-izTUuhE4TMfTRPF92fFwD2QfdXaZW08qvWTFCI51V8rW5x00UuPgc3ajRoWofXOuxjfcOM5zzSYsQS3H8KGCAg==", + "dev": true, + "requires": { + "@babel/plugin-syntax-object-rest-spread": "^7.0.0", + "babel-plugin-jest-hoist": "^24.9.0" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.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=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "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==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "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==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "browser-process-hrtime": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", + "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", + "dev": true + }, + "browser-resolve": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz", + "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==", + "dev": true, + "requires": { + "resolve": "1.1.7" + }, + "dependencies": { + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + } + } + }, + "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.30000639", + "electron-to-chromium": "^1.2.7" + } + }, + "bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "requires": { + "node-int64": "^0.4.0" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "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": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "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.3.6", + "caniuse-db": "^1.0.30000529", + "lodash.memoize": "^4.1.2", + "lodash.uniq": "^4.5.0" + } + }, + "caniuse-db": { + "version": "1.0.30001063", + "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30001063.tgz", + "integrity": "sha512-RRS541oLJICqyQKDRHZE/Bje429SsQeaNAUR+KNqmnj4EmIAHQU8LQTD/EIdAOq5IsH1BaFm4ZuX7cOMs5Sigg==", + "dev": true + }, + "capture-exit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", + "integrity": "sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==", + "dev": true, + "requires": { + "rsvp": "^4.8.4" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.0.0.tgz", + "integrity": "sha512-N9oWFcegS0sFr9oh1oz2d7Npos6vNoWW9HvtCg5N1KRFpUhaAhvTv5Y58g880fZaEYSNm3qDz8SU1UrGvp+n7A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "chevrotain": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/chevrotain/-/chevrotain-7.0.1.tgz", + "integrity": "sha512-B/44jrdw5GAzy483LEeVSgXSX0qOYM8lUd3l5+yf6Vl6OQjEUCm2BUiYbHRCIK6xCEvCLAFe1kj8uyV6+zdaVw==", + "dev": true, + "requires": { + "regexp-to-ast": "0.5.0" + } + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "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-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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "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.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 + } + } + }, + "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==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "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=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-truncate": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", + "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", + "dev": true, + "requires": { + "slice-ansi": "^3.0.0", + "string-width": "^4.2.0" + } + }, + "cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", + "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==", + "dev": true + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + }, + "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.1.2" + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "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.3.0", + "color-string": "^0.3.0" + }, + "dependencies": { + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "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.0.0" + } + }, + "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.0", + "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 + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "dev": true + }, + "compare-versions": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", + "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "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 + }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + }, + "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==", + "dev": true + } + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "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 + }, + "cosmiconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "dev": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.7.2" + } + }, + "cross-spawn": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", + "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "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 + }, + "cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true + }, + "cssfontparser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/cssfontparser/-/cssfontparser-1.2.1.tgz", + "integrity": "sha1-9AIvyPlwDGgCnVQghK+69CWj8+M=", + "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.3.1", + "decamelize": "^1.1.2", + "defined": "^1.0.0", + "has": "^1.0.1", + "object-assign": "^4.0.1", + "postcss": "^5.0.14", + "postcss-calc": "^5.2.0", + "postcss-colormin": "^2.1.8", + "postcss-convert-values": "^2.3.4", + "postcss-discard-comments": "^2.0.4", + "postcss-discard-duplicates": "^2.0.1", + "postcss-discard-empty": "^2.0.1", + "postcss-discard-overridden": "^0.1.1", + "postcss-discard-unused": "^2.2.1", + "postcss-filter-plugins": "^2.0.0", + "postcss-merge-idents": "^2.1.5", + "postcss-merge-longhand": "^2.0.1", + "postcss-merge-rules": "^2.0.3", + "postcss-minify-font-values": "^1.0.2", + "postcss-minify-gradients": "^1.0.1", + "postcss-minify-params": "^1.0.4", + "postcss-minify-selectors": "^2.0.4", + "postcss-normalize-charset": "^1.1.0", + "postcss-normalize-url": "^3.0.7", + "postcss-ordered-values": "^2.1.0", + "postcss-reduce-idents": "^2.2.2", + "postcss-reduce-initial": "^1.0.0", + "postcss-reduce-transforms": "^1.0.3", + "postcss-svgo": "^2.1.1", + "postcss-unique-selectors": "^2.0.2", + "postcss-value-parser": "^3.2.3", + "postcss-zindex": "^2.0.1" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "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.0.0" + } + }, + "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" + } + } + } + }, + "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.0.9", + "source-map": "^0.5.3" + } + }, + "cssom": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", + "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", + "dev": true + }, + "cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "dev": true, + "requires": { + "cssom": "~0.3.6" + }, + "dependencies": { + "cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "dev": true + } + } + }, + "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" + } + }, + "data-urls": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", + "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==", + "dev": true, + "requires": { + "abab": "^2.0.0", + "whatwg-mimetype": "^2.2.0", + "whatwg-url": "^7.0.0" + } + }, + "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" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "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=", + "dev": true + }, + "dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "dev": true, + "requires": { + "clone": "^1.0.2" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "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==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "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==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "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=", + "dev": true + }, + "detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true + }, + "diff-sequences": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.9.0.tgz", + "integrity": "sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew==", + "dev": true + }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "domexception": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", + "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", + "dev": true, + "requires": { + "webidl-conversions": "^4.0.2" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "electron-to-chromium": { + "version": "1.3.450", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.450.tgz", + "integrity": "sha512-m6iTlzM12aBf0W8E+Lhj8tUsO5bsYXzGkQ7x4VEqLLwziFN5uecajjOKJaIR25xrHYwnwHteHy1yzJ+mN6QTWA==", + "dev": true + }, + "elegant-spinner": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/elegant-spinner/-/elegant-spinner-2.0.0.tgz", + "integrity": "sha512-5YRYHhvhYzV/FC4AiMdeSIg3jAYGq9xFvbhZMpPlJoBsfYgrw2DSCYeXfat6tYBu45PWiyRr3+flaCPPmviPaA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "enquirer": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.5.tgz", + "integrity": "sha512-BNT1C08P9XD0vNg3J475yIUG+mVdp9T6towYFHUv897X0KoHBjB1shyrNmhmtHWKP17iSWgo7Gqh7BBuzLZMSA==", + "dev": true, + "requires": { + "ansi-colors": "^3.2.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "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 + }, + "escodegen": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.1.tgz", + "integrity": "sha512-Bmt7NcRySdIfNPfU2ZoXDrrXsG9ZjvDxcAlMfDUgRBjLOWTuIACXPBFJH7Z+cLb40JeQco5toikyc9t9P8E9SQ==", + "dev": true, + "requires": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "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, + "optional": true + } + } + }, + "eslint": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz", + "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.3", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", + "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "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 + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "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 + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "eslint-import-resolver-node": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.3.tgz", + "integrity": "sha512-b8crLDo0M5RSe5YG8Pu2DYBj71tSB6OvXkfzwbJU2w7y8P4/yo0MyF8jU26IEuEuHF2K5/gcAJE3LhQGqBBbVg==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "resolve": "^1.13.1" + }, + "dependencies": { + "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": "2.0.0" + } + } + } + }, + "eslint-module-utils": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.0.tgz", + "integrity": "sha512-6j9xxegbqe8/kZY8cYpcp0xhbK0EgJlg3g9mib3/miLaExuuwc3n5UEfSnU6hWMbT0FAYVvDbL9RrRgpUeQIvA==", + "dev": true, + "requires": { + "debug": "^2.6.9", + "pkg-dir": "^2.0.0" + }, + "dependencies": { + "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": "2.0.0" + } + }, + "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" + } + }, + "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" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "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-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "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 + }, + "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" + } + } + } + }, + "eslint-plugin-import": { + "version": "2.20.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.20.2.tgz", + "integrity": "sha512-FObidqpXrR8OnCh4iNsxy+WACztJLXAHBO5hK79T1Hc77PgQZkyDGA5Ag9xAvRpglvLNxhH/zSmZ70/pZ31dHg==", + "dev": true, + "requires": { + "array-includes": "^3.0.3", + "array.prototype.flat": "^1.2.1", + "contains-path": "^0.1.0", + "debug": "^2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "^0.3.2", + "eslint-module-utils": "^2.4.1", + "has": "^1.0.3", + "minimatch": "^3.0.4", + "object.values": "^1.1.0", + "read-pkg-up": "^2.0.0", + "resolve": "^1.12.0" + }, + "dependencies": { + "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": "2.0.0" + } + } + } + }, + "eslint-plugin-jest": { + "version": "23.13.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.13.1.tgz", + "integrity": "sha512-TRLJH6M6EDvGocD98a7yVThrAOCK9WJfo9phuUb0MJptcrOYZeCKzC9aOzZCD93sxXCsiJVZywaTHdI/mAi0FQ==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "^2.5.0" + } + }, + "eslint-restricted-globals": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eslint-restricted-globals/-/eslint-restricted-globals-0.2.0.tgz", + "integrity": "sha512-kwYJALm5KS2QW3Mc1PgObO4V+pTR6RQtRT65L1GQILlEnAhabUQqGAX7/qUjoQR4KZJKehWpBtyDEiDecwmY9A==", + "dev": true + }, + "eslint-scope": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", + "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.0.0.tgz", + "integrity": "sha512-0HCPuJv+7Wv1bACm8y5/ECVfYdfsAm9xmVb7saeFlxjPYALefjhbYoCkBjPdPzGH8wWyTpAez82Fh3VKYEZ8OA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", + "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "dev": true + }, + "espree": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-6.2.1.tgz", + "integrity": "sha512-ysCxRQY3WaXJz9tdbWOwuWr5Y/XrPTGX9Kiz3yoUXwW0VZ4w30HTkQLaGx/+ttFjF8i+ACbArnB4ce68a9m5hw==", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.1.0.tgz", + "integrity": "sha512-FyohXK+R0vE+y1nHLoBM7ZTyqRpqAlhdZHCWIWEviFLiGB8b04H6bQs8G+XTthacvT8VuwvteiP7RJSxMs8UEw==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "exec-sh": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.4.tgz", + "integrity": "sha512-sEFIkc61v75sWeOe72qyrqg2Qg0OuLESziUDk/O/z2qgS15y2gWVFrI6f2Qn/qw/0/NCfCEsmNA4zOjkwEZT1A==", + "dev": true + }, + "execa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.1.tgz", + "integrity": "sha512-SCjM/zlBdOK8Q5TIjOn6iEHZaPHFsMoTxXQ2nvUvtPnuohz3H2dIozSg+etNR98dGoYUp2ENSKLL/XaMmbxVgw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "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": "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=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expect": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-24.9.0.tgz", + "integrity": "sha512-wvVAx8XIol3Z5m9zvZXiyZOQ+sRJqNTIm6sGjdWlaZIeupQGO3WbYI+15D/AmEwZywL6wtJkbAbJtzkOfBuR0Q==", + "dev": true, + "requires": { + "@jest/types": "^24.9.0", + "ansi-styles": "^3.2.0", + "jest-get-type": "^24.9.0", + "jest-matcher-utils": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-regex-util": "^24.9.0" + }, + "dependencies": { + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "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==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "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.0", + "snapdragon": "^0.8.1", + "to-regex": "^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=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "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==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "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==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.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": "3.1.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", + "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fb-watchman": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", + "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "dev": true, + "requires": { + "bser": "2.1.1" + } + }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "find-versions": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz", + "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==", + "dev": true, + "requires": { + "semver-regex": "^2.0.0" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + }, + "dependencies": { + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", + "dev": true + }, + "flatten": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.3.tgz", + "integrity": "sha512-dVsPA/UwQ8+2uoFe5GHtiBMu48dWLTdsuEd7CKGlZlD78r1TTWBvDuFaFGKCo/ZfEr95Uk56vZoX86OsHkUeIg==", + "dev": true + }, + "follow-redirects": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", + "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", + "dev": true, + "requires": { + "debug": "=3.1.0" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "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.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "dev": true, + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-own-enumerable-property-symbols": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", + "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", + "dev": true + }, + "get-stream": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", + "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "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" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "growly": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", + "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", + "dev": true + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "dev": true, + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "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.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + } + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "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=", + "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.0.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.5" + } + } + } + }, + "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.5" + } + } + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, + "html-comment-regex": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.2.tgz", + "integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==", + "dev": true + }, + "html-encoding-sniffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", + "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", + "dev": true, + "requires": { + "whatwg-encoding": "^1.0.1" + } + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "dev": true + }, + "husky": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.2.5.tgz", + "integrity": "sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "ci-info": "^2.0.0", + "compare-versions": "^3.6.0", + "cosmiconfig": "^6.0.0", + "find-versions": "^3.2.0", + "opencollective-postinstall": "^2.0.2", + "pkg-dir": "^4.2.0", + "please-upgrade-node": "^3.2.0", + "slash": "^3.0.0", + "which-pm-runs": "^1.0.0" + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "import-local": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", + "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", + "dev": true, + "requires": { + "pkg-dir": "^3.0.0", + "resolve-cwd": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "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 + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + } + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, + "indexes-of": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", + "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=", + "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.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "inquirer": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.1.0.tgz", + "integrity": "sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.5.3", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + } + } + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "ip-regex": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", + "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", + "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-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=", + "dev": true, + "requires": { + "kind-of": "^3.0.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.5" + } + } + } + }, + "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-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-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "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=", + "dev": true, + "requires": { + "kind-of": "^3.0.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.5" + } + } + } + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.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==", + "dev": true + } + } + }, + "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-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, + "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" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", + "dev": true + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, + "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.0" + } + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "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-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "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=", + "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": "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" + } + }, + "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-lib-coverage": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", + "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", + "dev": true, + "requires": { + "@babel/generator": "^7.4.0", + "@babel/parser": "^7.4.3", + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0", + "istanbul-lib-coverage": "^2.0.5", + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz", + "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "supports-color": "^6.1.0" + }, + "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", + "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "rimraf": "^2.6.3", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "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 + } + } + }, + "istanbul-reports": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.7.tgz", + "integrity": "sha512-uu1F/L1o5Y6LzPVSVZXNOoD/KXpJue9aeLRd0sM9uMXfZvzomB0WxVamWb5ue8kA2vVWEmW7EG+A5n3f1kqHKg==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0" + } + }, + "jest": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-24.9.0.tgz", + "integrity": "sha512-YvkBL1Zm7d2B1+h5fHEOdyjCG+sGMz4f8D86/0HiqJ6MB4MnDc8FgP5vdWsGnemOQro7lnYo8UakZ3+5A0jxGw==", + "dev": true, + "requires": { + "import-local": "^2.0.0", + "jest-cli": "^24.9.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "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 + }, + "jest-cli": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.9.0.tgz", + "integrity": "sha512-+VLRKyitT3BWoMeSUIHRxV/2g8y9gw91Jh5z2UmXZzkZKpbC08CSehVxgHUwTpy+HwGcns/tqafQDJW7imYvGg==", + "dev": true, + "requires": { + "@jest/core": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "import-local": "^2.0.0", + "is-ci": "^2.0.0", + "jest-config": "^24.9.0", + "jest-util": "^24.9.0", + "jest-validate": "^24.9.0", + "prompts": "^2.0.1", + "realpath-native": "^1.1.0", + "yargs": "^13.3.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "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 + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "jest-canvas-mock": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/jest-canvas-mock/-/jest-canvas-mock-2.2.0.tgz", + "integrity": "sha512-DcJdchb7eWFZkt6pvyceWWnu3lsp5QWbUeXiKgEMhwB3sMm5qHM1GQhDajvJgBeiYpgKcojbzZ53d/nz6tXvJw==", + "dev": true, + "requires": { + "cssfontparser": "^1.2.1", + "parse-color": "^1.0.0" + } + }, + "jest-changed-files": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.9.0.tgz", + "integrity": "sha512-6aTWpe2mHF0DhL28WjdkO8LyGjs3zItPET4bMSeXU6T3ub4FPMw+mcOcbdGXQOAfmLcxofD23/5Bl9Z4AkFwqg==", + "dev": true, + "requires": { + "@jest/types": "^24.9.0", + "execa": "^1.0.0", + "throat": "^4.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "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.0" + } + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "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 + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "jest-config": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.9.0.tgz", + "integrity": "sha512-RATtQJtVYQrp7fvWg6f5y3pEFj9I+H8sWw4aKxnDZ96mob5i5SD6ZEGWgMLXQ4LE8UurrjbdlLWdUeo+28QpfQ==", + "dev": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/test-sequencer": "^24.9.0", + "@jest/types": "^24.9.0", + "babel-jest": "^24.9.0", + "chalk": "^2.0.1", + "glob": "^7.1.1", + "jest-environment-jsdom": "^24.9.0", + "jest-environment-node": "^24.9.0", + "jest-get-type": "^24.9.0", + "jest-jasmine2": "^24.9.0", + "jest-regex-util": "^24.3.0", + "jest-resolve": "^24.9.0", + "jest-util": "^24.9.0", + "jest-validate": "^24.9.0", + "micromatch": "^3.1.10", + "pretty-format": "^24.9.0", + "realpath-native": "^1.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "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.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "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.0.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.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "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.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "pretty-format": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", + "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", + "dev": true, + "requires": { + "@jest/types": "^24.9.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "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=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, + "jest-diff": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.9.0.tgz", + "integrity": "sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "diff-sequences": "^24.9.0", + "jest-get-type": "^24.9.0", + "pretty-format": "^24.9.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "pretty-format": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", + "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", + "dev": true, + "requires": { + "@jest/types": "^24.9.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-docblock": { + "version": "25.3.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-25.3.0.tgz", + "integrity": "sha512-aktF0kCar8+zxRHxQZwxMy70stc9R1mOmrLsT5VO3pIT0uzGRSDAXxSlz4NqQWpuLjPpuMhPRl7H+5FRsvIQAg==", + "dev": true, + "requires": { + "detect-newline": "^3.0.0" + } + }, + "jest-each": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-24.9.0.tgz", + "integrity": "sha512-ONi0R4BvW45cw8s2Lrx8YgbeXL1oCQ/wIDwmsM3CqM/nlblNCPmnC3IPQlMbRFZu3wKdQ2U8BqM6lh3LJ5Bsog==", + "dev": true, + "requires": { + "@jest/types": "^24.9.0", + "chalk": "^2.0.1", + "jest-get-type": "^24.9.0", + "jest-util": "^24.9.0", + "pretty-format": "^24.9.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "pretty-format": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", + "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", + "dev": true, + "requires": { + "@jest/types": "^24.9.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-environment-jsdom": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-24.9.0.tgz", + "integrity": "sha512-Zv9FV9NBRzLuALXjvRijO2351DRQeLYXtpD4xNvfoVFw21IOKNhZAEUKcbiEtjTkm2GsJ3boMVgkaR7rN8qetA==", + "dev": true, + "requires": { + "@jest/environment": "^24.9.0", + "@jest/fake-timers": "^24.9.0", + "@jest/types": "^24.9.0", + "jest-mock": "^24.9.0", + "jest-util": "^24.9.0", + "jsdom": "^11.5.1" + }, + "dependencies": { + "acorn": { + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", + "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", + "dev": true + }, + "cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "dev": true + }, + "cssstyle": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.4.0.tgz", + "integrity": "sha512-GBrLZYZ4X4x6/QEoBnIrqb8B/f5l4+8me2dkom/j1Gtbxy0kBv6OGzKuAsGM75bkGwGAFkt56Iwg28S3XTZgSA==", + "dev": true, + "requires": { + "cssom": "0.3.x" + } + }, + "jsdom": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz", + "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==", + "dev": true, + "requires": { + "abab": "^2.0.0", + "acorn": "^5.5.3", + "acorn-globals": "^4.1.0", + "array-equal": "^1.0.0", + "cssom": ">= 0.3.2 < 0.4.0", + "cssstyle": "^1.0.0", + "data-urls": "^1.0.0", + "domexception": "^1.0.1", + "escodegen": "^1.9.1", + "html-encoding-sniffer": "^1.0.2", + "left-pad": "^1.3.0", + "nwsapi": "^2.0.7", + "parse5": "4.0.0", + "pn": "^1.1.0", + "request": "^2.87.0", + "request-promise-native": "^1.0.5", + "sax": "^1.2.4", + "symbol-tree": "^3.2.2", + "tough-cookie": "^2.3.4", + "w3c-hr-time": "^1.0.1", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.3", + "whatwg-mimetype": "^2.1.0", + "whatwg-url": "^6.4.1", + "ws": "^5.2.0", + "xml-name-validator": "^3.0.0" + } + }, + "parse5": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", + "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==", + "dev": true + }, + "whatwg-url": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", + "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "ws": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", + "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0" + } + } + } + }, + "jest-environment-jsdom-fifteen": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom-fifteen/-/jest-environment-jsdom-fifteen-1.0.2.tgz", + "integrity": "sha512-nfrnAfwklE1872LIB31HcjM65cWTh1wzvMSp10IYtPJjLDUbTTvDpajZgIxUnhRmzGvogdHDayCIlerLK0OBBg==", + "dev": true, + "requires": { + "@jest/environment": "^24.3.0", + "@jest/fake-timers": "^24.3.0", + "@jest/types": "^24.3.0", + "jest-mock": "^24.0.0", + "jest-util": "^24.0.0", + "jsdom": "^15.2.1" + } + }, + "jest-environment-node": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-24.9.0.tgz", + "integrity": "sha512-6d4V2f4nxzIzwendo27Tr0aFm+IXWa0XEUnaH6nU0FMaozxovt+sfRvh4J47wL1OvF83I3SSTu0XK+i4Bqe7uA==", + "dev": true, + "requires": { + "@jest/environment": "^24.9.0", + "@jest/fake-timers": "^24.9.0", + "@jest/types": "^24.9.0", + "jest-mock": "^24.9.0", + "jest-util": "^24.9.0" + } + }, + "jest-get-type": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.9.0.tgz", + "integrity": "sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q==", + "dev": true + }, + "jest-haste-map": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.9.0.tgz", + "integrity": "sha512-kfVFmsuWui2Sj1Rp1AJ4D9HqJwE4uwTlS/vO+eRUaMmd54BFpli2XhMQnPC2k4cHFVbB2Q2C+jtI1AGLgEnCjQ==", + "dev": true, + "requires": { + "@jest/types": "^24.9.0", + "anymatch": "^2.0.0", + "fb-watchman": "^2.0.0", + "fsevents": "^1.2.7", + "graceful-fs": "^4.1.15", + "invariant": "^2.2.4", + "jest-serializer": "^24.9.0", + "jest-util": "^24.9.0", + "jest-worker": "^24.9.0", + "micromatch": "^3.1.10", + "sane": "^4.0.3", + "walker": "^1.0.7" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "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.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "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.0.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.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "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.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "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=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, + "jest-jasmine2": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-24.9.0.tgz", + "integrity": "sha512-Cq7vkAgaYKp+PsX+2/JbTarrk0DmNhsEtqBXNwUHkdlbrTBLtMJINADf2mf5FkowNsq8evbPc07/qFO0AdKTzw==", + "dev": true, + "requires": { + "@babel/traverse": "^7.1.0", + "@jest/environment": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "chalk": "^2.0.1", + "co": "^4.6.0", + "expect": "^24.9.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^24.9.0", + "jest-matcher-utils": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-runtime": "^24.9.0", + "jest-snapshot": "^24.9.0", + "jest-util": "^24.9.0", + "pretty-format": "^24.9.0", + "throat": "^4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "pretty-format": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", + "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", + "dev": true, + "requires": { + "@jest/types": "^24.9.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-leak-detector": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.9.0.tgz", + "integrity": "sha512-tYkFIDsiKTGwb2FG1w8hX9V0aUb2ot8zY/2nFg087dUageonw1zrLMP4W6zsRO59dPkTSKie+D4rhMuP9nRmrA==", + "dev": true, + "requires": { + "jest-get-type": "^24.9.0", + "pretty-format": "^24.9.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "pretty-format": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", + "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", + "dev": true, + "requires": { + "@jest/types": "^24.9.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + } + } + } + }, + "jest-matcher-utils": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-24.9.0.tgz", + "integrity": "sha512-OZz2IXsu6eaiMAwe67c1T+5tUAtQyQx27/EMEkbFAGiw52tB9em+uGbzpcgYVpA8wl0hlxKPZxrly4CXU/GjHA==", + "dev": true, + "requires": { + "chalk": "^2.0.1", + "jest-diff": "^24.9.0", + "jest-get-type": "^24.9.0", + "pretty-format": "^24.9.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "pretty-format": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", + "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", + "dev": true, + "requires": { + "@jest/types": "^24.9.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-message-util": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-24.9.0.tgz", + "integrity": "sha512-oCj8FiZ3U0hTP4aSui87P4L4jC37BtQwUMqk+zk/b11FR19BJDeZsZAvIHutWnmtw7r85UmR3CEWZ0HWU2mAlw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "@types/stack-utils": "^1.0.1", + "chalk": "^2.0.1", + "micromatch": "^3.1.10", + "slash": "^2.0.0", + "stack-utils": "^1.0.1" + }, + "dependencies": { + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "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.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "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.0.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.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "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.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "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=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, + "jest-mock": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-24.9.0.tgz", + "integrity": "sha512-3BEYN5WbSq9wd+SyLDES7AHnjH9A/ROBwmz7l2y+ol+NtSFO8DYiEBzoO1CeFc9a8DYy10EO4dDFVv/wN3zl1w==", + "dev": true, + "requires": { + "@jest/types": "^24.9.0" + } + }, + "jest-pnp-resolver": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz", + "integrity": "sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ==", + "dev": true + }, + "jest-regex-util": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-24.9.0.tgz", + "integrity": "sha512-05Cmb6CuxaA+Ys6fjr3PhvV3bGQmO+2p2La4hFbU+W5uOc479f7FdLXUWXw4pYMAhhSZIuKHwSXSu6CsSBAXQA==", + "dev": true + }, + "jest-resolve": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.9.0.tgz", + "integrity": "sha512-TaLeLVL1l08YFZAt3zaPtjiVvyy4oSA6CRe+0AFPPVX3Q/VI0giIWWoAvoS5L96vj9Dqxj4fB5p2qrHCmTU/MQ==", + "dev": true, + "requires": { + "@jest/types": "^24.9.0", + "browser-resolve": "^1.11.3", + "chalk": "^2.0.1", + "jest-pnp-resolver": "^1.2.1", + "realpath-native": "^1.1.0" + }, + "dependencies": { + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-resolve-dependencies": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.9.0.tgz", + "integrity": "sha512-Fm7b6AlWnYhT0BXy4hXpactHIqER7erNgIsIozDXWl5dVm+k8XdGVe1oTg1JyaFnOxarMEbax3wyRJqGP2Pq+g==", + "dev": true, + "requires": { + "@jest/types": "^24.9.0", + "jest-regex-util": "^24.3.0", + "jest-snapshot": "^24.9.0" + } + }, + "jest-runner": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-24.9.0.tgz", + "integrity": "sha512-KksJQyI3/0mhcfspnxxEOBueGrd5E4vV7ADQLT9ESaCzz02WnbdbKWIf5Mkaucoaj7obQckYPVX6JJhgUcoWWg==", + "dev": true, + "requires": { + "@jest/console": "^24.7.1", + "@jest/environment": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "chalk": "^2.4.2", + "exit": "^0.1.2", + "graceful-fs": "^4.1.15", + "jest-config": "^24.9.0", + "jest-docblock": "^24.3.0", + "jest-haste-map": "^24.9.0", + "jest-jasmine2": "^24.9.0", + "jest-leak-detector": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-resolve": "^24.9.0", + "jest-runtime": "^24.9.0", + "jest-util": "^24.9.0", + "jest-worker": "^24.6.0", + "source-map-support": "^0.5.6", + "throat": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "detect-newline": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", + "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "jest-docblock": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-24.9.0.tgz", + "integrity": "sha512-F1DjdpDMJMA1cN6He0FNYNZlo3yYmOtRUnktrT9Q37njYzC5WEaDdmbynIgy0L/IvXvvgsG8OsqhLPXTpfmZAA==", + "dev": true, + "requires": { + "detect-newline": "^2.1.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-runtime": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-24.9.0.tgz", + "integrity": "sha512-8oNqgnmF3v2J6PVRM2Jfuj8oX3syKmaynlDMMKQ4iyzbQzIG6th5ub/lM2bCMTmoTKM3ykcUYI2Pw9xwNtjMnw==", + "dev": true, + "requires": { + "@jest/console": "^24.7.1", + "@jest/environment": "^24.9.0", + "@jest/source-map": "^24.3.0", + "@jest/transform": "^24.9.0", + "@jest/types": "^24.9.0", + "@types/yargs": "^13.0.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.1.15", + "jest-config": "^24.9.0", + "jest-haste-map": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-mock": "^24.9.0", + "jest-regex-util": "^24.3.0", + "jest-resolve": "^24.9.0", + "jest-snapshot": "^24.9.0", + "jest-util": "^24.9.0", + "jest-validate": "^24.9.0", + "realpath-native": "^1.1.0", + "slash": "^2.0.0", + "strip-bom": "^3.0.0", + "yargs": "^13.3.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "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 + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "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 + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "jest-serializer": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-24.9.0.tgz", + "integrity": "sha512-DxYipDr8OvfrKH3Kel6NdED3OXxjvxXZ1uIY2I9OFbGg+vUkkg7AGvi65qbhbWNPvDckXmzMPbK3u3HaDO49bQ==", + "dev": true + }, + "jest-snapshot": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-24.9.0.tgz", + "integrity": "sha512-uI/rszGSs73xCM0l+up7O7a40o90cnrk429LOiK3aeTvfC0HHmldbd81/B7Ix81KSFe1lwkbl7GnBGG4UfuDew==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0", + "@jest/types": "^24.9.0", + "chalk": "^2.0.1", + "expect": "^24.9.0", + "jest-diff": "^24.9.0", + "jest-get-type": "^24.9.0", + "jest-matcher-utils": "^24.9.0", + "jest-message-util": "^24.9.0", + "jest-resolve": "^24.9.0", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "pretty-format": "^24.9.0", + "semver": "^6.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "pretty-format": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", + "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", + "dev": true, + "requires": { + "@jest/types": "^24.9.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-util": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-24.9.0.tgz", + "integrity": "sha512-x+cZU8VRmOJxbA1K5oDBdxQmdq0OIdADarLxk0Mq+3XS4jgvhG/oKGWcIDCtPG0HgjxOYvF+ilPJQsAyXfbNOg==", + "dev": true, + "requires": { + "@jest/console": "^24.9.0", + "@jest/fake-timers": "^24.9.0", + "@jest/source-map": "^24.9.0", + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "callsites": "^3.0.0", + "chalk": "^2.0.1", + "graceful-fs": "^4.1.15", + "is-ci": "^2.0.0", + "mkdirp": "^0.5.1", + "slash": "^2.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "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 + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-validate": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.9.0.tgz", + "integrity": "sha512-HPIt6C5ACwiqSiwi+OfSSHbK8sG7akG8eATl+IPKaeIjtPOeBUd/g3J7DghugzxrGjI93qS/+RPKe1H6PqvhRQ==", + "dev": true, + "requires": { + "@jest/types": "^24.9.0", + "camelcase": "^5.3.1", + "chalk": "^2.0.1", + "jest-get-type": "^24.9.0", + "leven": "^3.1.0", + "pretty-format": "^24.9.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "pretty-format": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz", + "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==", + "dev": true, + "requires": { + "@jest/types": "^24.9.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-watcher": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-24.9.0.tgz", + "integrity": "sha512-+/fLOfKPXXYJDYlks62/4R4GoT+GU1tYZed99JSCOsmzkkF7727RqKrjNAxtfO4YpGv11wybgRvCjR73lK2GZw==", + "dev": true, + "requires": { + "@jest/test-result": "^24.9.0", + "@jest/types": "^24.9.0", + "@types/yargs": "^13.0.0", + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.1", + "jest-util": "^24.9.0", + "string-length": "^2.0.0" + }, + "dependencies": { + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + }, + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "jest-worker": { + "version": "24.9.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz", + "integrity": "sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw==", + "dev": true, + "requires": { + "merge-stream": "^2.0.0", + "supports-color": "^6.1.0" + }, + "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "js-base64": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.2.tgz", + "integrity": "sha512-Vg8czh0Q7sFBSUMWWArX/miJeBWYBPpdU/3M/DKSaekLMqrqVPaedp+5mZhie/r0lgrcaYBfwXatEew6gwgiQQ==", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "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.7", + "esprima": "^2.6.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "jsdom": { + "version": "15.2.1", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-15.2.1.tgz", + "integrity": "sha512-fAl1W0/7T2G5vURSyxBzrJ1LSdQn6Tr5UX/xD4PXDx/PDgwygedfW6El/KIj3xJ7FU61TTYnc/l/B7P49Eqt6g==", + "dev": true, + "requires": { + "abab": "^2.0.0", + "acorn": "^7.1.0", + "acorn-globals": "^4.3.2", + "array-equal": "^1.0.0", + "cssom": "^0.4.1", + "cssstyle": "^2.0.0", + "data-urls": "^1.1.0", + "domexception": "^1.0.1", + "escodegen": "^1.11.1", + "html-encoding-sniffer": "^1.0.2", + "nwsapi": "^2.2.0", + "parse5": "5.1.0", + "pn": "^1.1.0", + "request": "^2.88.0", + "request-promise-native": "^1.0.7", + "saxes": "^3.1.9", + "symbol-tree": "^3.2.2", + "tough-cookie": "^3.0.1", + "w3c-hr-time": "^1.0.1", + "w3c-xmlserializer": "^1.1.2", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.5", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^7.0.0", + "ws": "^7.0.0", + "xml-name-validator": "^3.0.0" + }, + "dependencies": { + "tough-cookie": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", + "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", + "dev": true, + "requires": { + "ip-regex": "^2.1.0", + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + } + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "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.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "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 + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", + "dev": true + }, + "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" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true + }, + "left-pad": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", + "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==", + "dev": true + }, + "leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "line-column": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/line-column/-/line-column-1.0.2.tgz", + "integrity": "sha1-0lryk2tvSEkXKzEuR5LR2Ye8NKI=", + "dev": true, + "requires": { + "isarray": "^1.0.0", + "isobject": "^2.0.0" + } + }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "lint-staged": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.2.6.tgz", + "integrity": "sha512-2oEBWyPZHkdyjKcIv2U6ay80Q52ZMlZZrUnfsV0WTVcgzPlt3o2t5UFy2v8ETUTsIDZ0xSJVnffWCgD3LF6xTQ==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "cli-truncate": "2.1.0", + "commander": "^5.1.0", + "cosmiconfig": "^6.0.0", + "debug": "^4.1.1", + "dedent": "^0.7.0", + "execa": "^4.0.1", + "listr2": "^2.0.2", + "log-symbols": "^4.0.0", + "micromatch": "^4.0.2", + "normalize-path": "^3.0.0", + "please-upgrade-node": "^3.2.0", + "string-argv": "0.3.1", + "stringify-object": "^3.3.0" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "listr2": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-2.0.4.tgz", + "integrity": "sha512-oJaAcplPsa72rKW0eg4P4LbEJjhH+UO2I8uqR/I2wzHrVg16ohSfUy0SlcHS21zfYXxtsUpL8YXGHjyfWMR0cg==", + "dev": true, + "requires": { + "@samverschueren/stream-to-observable": "^0.3.0", + "chalk": "^4.0.0", + "cli-cursor": "^3.1.0", + "cli-truncate": "^2.1.0", + "elegant-spinner": "^2.0.0", + "enquirer": "^2.3.5", + "figures": "^3.2.0", + "indent-string": "^4.0.0", + "log-update": "^4.0.0", + "p-map": "^4.0.0", + "pad": "^3.2.0", + "rxjs": "^6.5.5", + "through": "^2.3.8", + "uuid": "^7.0.2" + }, + "dependencies": { + "uuid": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", + "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==", + "dev": true + } + } + }, + "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.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" + }, + "dependencies": { + "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.2.0" + } + } + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "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.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", + "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 + }, + "log-symbols": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", + "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "dev": true, + "requires": { + "chalk": "^4.0.0" + } + }, + "log-update": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", + "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", + "dev": true, + "requires": { + "ansi-escapes": "^4.3.0", + "cli-cursor": "^3.1.0", + "slice-ansi": "^4.0.0", + "wrap-ansi": "^6.2.0" + }, + "dependencies": { + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + } + } + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "magic-string": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", + "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.4" + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "dependencies": { + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "makeerror": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", + "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", + "dev": true, + "requires": { + "tmpl": "1.0.x" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "math-expression-evaluator": { + "version": "1.2.22", + "resolved": "https://registry.npmjs.org/math-expression-evaluator/-/math-expression-evaluator-1.2.22.tgz", + "integrity": "sha512-L0j0tFVZBQQLeEjmWOvDLoRciIY8gQGWahvkztXUal8jH8R5Rlqo9GCvgqvXcy9LQhEWdQCVvzqAbxgYNt4blQ==", + "dev": true + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "dev": true + }, + "mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "dev": true, + "requires": { + "mime-db": "1.44.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "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.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "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==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "nan": { + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "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-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "dev": true + }, + "node-modules-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", + "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", + "dev": true + }, + "node-notifier": { + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.4.3.tgz", + "integrity": "sha512-M4UBGcs4jeOK9CjTsYwkvH6/MzuUmGCyTW+kCY7uO+1ZVr0+FHGdPdIf5CCLqAaxnRrWidyoQlNkMIIVwbKB8Q==", + "dev": true, + "requires": { + "growly": "^1.3.0", + "is-wsl": "^1.1.0", + "semver": "^5.5.0", + "shellwords": "^0.1.1", + "which": "^1.3.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "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.0.1", + "prepend-http": "^1.0.0", + "query-string": "^4.1.0", + "sort-keys": "^1.0.0" + } + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "num2fraction": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", + "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=", + "dev": true + }, + "nwsapi": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", + "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", + "dev": true + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "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=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "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=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "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.5" + } + } + } + }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.getownpropertydescriptors": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", + "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "object.values": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.1.tgz", + "integrity": "sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "has": "^1.0.3" + } + }, + "observable-membrane": { + "version": "0.26.1", + "resolved": "https://registry.npmjs.org/observable-membrane/-/observable-membrane-0.26.1.tgz", + "integrity": "sha512-fBxLHtd0pUFI/rKh6Dfn9fxjEgY4NkRIqlPEKa9fR28rC9CQDfQ5P+t292CtAArtXOQ1mF8Nq9m1cF52IdN8DA==", + "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" + } + }, + "onetime": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "opencollective-postinstall": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz", + "integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==", + "dev": true + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "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 + }, + "p-each-series": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-1.0.0.tgz", + "integrity": "sha1-kw89Et0fUOdDRFeiLNbwSsatf3E=", + "dev": true, + "requires": { + "p-reduce": "^1.0.0" + } + }, + "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": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, + "p-reduce": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz", + "integrity": "sha1-GMKw3ZNqRpClKfgjH1ig/bakffo=", + "dev": true + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "pad": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/pad/-/pad-3.2.0.tgz", + "integrity": "sha512-2u0TrjcGbOjBTJpyewEl4hBO3OeX5wWue7eIFPzQTg6wFSvoaHcBTTUY5m+n0hd04gmTCPuY0kCpVIVuw5etwg==", + "dev": true, + "requires": { + "wcwidth": "^1.0.1" + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-color": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-color/-/parse-color-1.0.0.tgz", + "integrity": "sha1-e3SLlag/A/FqlPU15S1/PZRlhhk=", + "dev": true, + "requires": { + "color-convert": "~0.5.0" + }, + "dependencies": { + "color-convert": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-0.5.3.tgz", + "integrity": "sha1-vbbGnOZg+t/+CwAHzER+G59ygr0=", + "dev": true + } + } + }, + "parse-json": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.0.0.tgz", + "integrity": "sha512-OOY5b7PAEFV0E2Fir1KOkxchnZNCdowAJgQ5NuxjpBKTRP3pQhwkrkxqQjeoKJ+fO7bCpmIZaogI4eZGDMEGOw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + } + }, + "parse5": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.0.tgz", + "integrity": "sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ==", + "dev": true + }, + "parse5-with-errors": { + "version": "4.0.3-beta1", + "resolved": "https://registry.npmjs.org/parse5-with-errors/-/parse5-with-errors-4.0.3-beta1.tgz", + "integrity": "sha512-Y6IDQO1t0ZT0FuYJhoVh1W1+FS25EG1xBeQPtnX8gyQGcT4JvT3de7hCWHAOStdKW8/9cw9iS0WoFcIxjI8Ymg==", + "dev": true, + "requires": { + "@types/node": "^6.0.46" + } + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "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-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pirates": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", + "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", + "dev": true, + "requires": { + "node-modules-regexp": "^1.0.0" + } + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "dev": true, + "requires": { + "semver-compare": "^1.0.0" + } + }, + "pn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", + "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", + "dev": true + }, + "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=", + "dev": true + }, + "postcss": { + "version": "7.0.30", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.30.tgz", + "integrity": "sha512-nu/0m+NtIzoubO+xdAlwZl/u5S5vi/y6BCsoL8D+8IxsD3XvBS8X4YEADNIVXKVuQvduiucnRv+vPIqj56EGMQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "source-map": "^0.6.1", + "supports-color": "^6.1.0" + }, + "dependencies": { + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "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 + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.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.0.2", + "postcss-message-helpers": "^2.0.0", + "reduce-css-calc": "^1.2.6" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "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.0.0" + } + }, + "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-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.0.5", + "postcss": "^5.0.13", + "postcss-value-parser": "^3.2.3" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "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.0.0" + } + }, + "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-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.0.11", + "postcss-value-parser": "^3.1.2" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "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.0.0" + } + }, + "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-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.0.14" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "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.0.0" + } + }, + "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-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.0.4" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "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.0.0" + } + }, + "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-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.0.14" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "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.0.0" + } + }, + "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-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.0.16" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "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.0.0" + } + }, + "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-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.0.14", + "uniqs": "^2.0.0" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "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.0.0" + } + }, + "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-filter-plugins": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/postcss-filter-plugins/-/postcss-filter-plugins-2.0.3.tgz", + "integrity": "sha512-T53GVFsdinJhgwm7rg1BzbeBRomOg9y5MBVhGcsV0CxurUdVj1UlPdKtn7aqYA/c/QVkzKMjq2bSV5dKG5+AwQ==", + "dev": true, + "requires": { + "postcss": "^5.0.4" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "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.0.0" + } + }, + "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-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.0.10", + "postcss-value-parser": "^3.1.1" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "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.0.0" + } + }, + "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-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.0.4" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "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.0.0" + } + }, + "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-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.5.2", + "caniuse-api": "^1.5.2", + "postcss": "^5.0.4", + "postcss-selector-parser": "^2.2.2", + "vendors": "^1.0.0" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "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" + } + }, + "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.0.0" + } + }, + "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-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.0.1", + "postcss": "^5.0.4", + "postcss-value-parser": "^3.0.2" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "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.0.0" + } + }, + "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-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.0.12", + "postcss-value-parser": "^3.3.0" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "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.0.0" + } + }, + "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-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.1", + "postcss": "^5.0.2", + "postcss-value-parser": "^3.0.2", + "uniqs": "^2.0.0" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "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.0.0" + } + }, + "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-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.0.14", + "postcss-selector-parser": "^2.0.0" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "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" + } + }, + "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.0.0" + } + }, + "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-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.0.5" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "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.0.0" + } + }, + "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-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.0.0", + "normalize-url": "^1.4.0", + "postcss": "^5.0.14", + "postcss-value-parser": "^3.2.3" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "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.0.0" + } + }, + "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-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.0.4", + "postcss-value-parser": "^3.0.1" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "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.0.0" + } + }, + "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-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.0.4", + "postcss-value-parser": "^3.0.2" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "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.0.0" + } + }, + "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-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.0.4" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "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.0.0" + } + }, + "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-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.0.8", + "postcss-value-parser": "^3.0.1" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "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.0.0" + } + }, + "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-selector-parser": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.2.tgz", + "integrity": "sha512-36P2QR59jDTOAiIkqEprfJDsoNrvwFei3eCqKd1Y0tUsBimsq39BLp7RD+JWny3WgB1zGhJX8XVePwm9k4wdBg==", + "dev": true, + "requires": { + "cssesc": "^3.0.0", + "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.0.0", + "postcss": "^5.0.14", + "postcss-value-parser": "^3.2.3", + "svgo": "^0.7.0" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", + "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.0.0" + } + }, + "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-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.1", + "postcss": "^5.0.4", + "uniqs": "^2.0.0" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "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.0.0" + } + }, + "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-value-parser": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.0.3.tgz", + "integrity": "sha512-N7h4pG+Nnu5BEIzyeaaIYWs0LI5XC40OrRh5L60z0QjFsqGWcHcbkBvpe1WYpcIS9yQ8sOi/vIPt1ejQCrMVrg==", + "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.0.4", + "uniqs": "^2.0.0" + }, + "dependencies": { + "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": "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.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "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 + }, + "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.1.9", + "source-map": "^0.5.6", + "supports-color": "^3.2.3" + } + }, + "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.0.0" + } + }, + "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" + } + } + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "prepend-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", + "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", + "dev": true + }, + "prettier": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.0.5.tgz", + "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", + "dev": true + }, + "prettier-plugin-apex": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-apex/-/prettier-plugin-apex-1.4.0.tgz", + "integrity": "sha512-yKqiXxAH3s/NBIxMT2Uni4mHK33tzOlOV6+98+mB4lGcrn/5iKpRxFVNsCXFrls+WLYMYFwmbpf14K0hHIrkpg==", + "dev": true, + "requires": { + "axios": "^0.19.0", + "jest-docblock": "^25.1.0", + "wait-on": "^4.0.0", + "yargs": "^15.0.1" + } + }, + "pretty-format": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz", + "integrity": "sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==", + "dev": true, + "requires": { + "@jest/types": "^24.8.0", + "ansi-regex": "^4.0.0", + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + } + } + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "prompts": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.3.2.tgz", + "integrity": "sha512-Q06uKs2CkNYVID0VqwfAl9mipo99zkBv/n2JtWY89Yxa3ZabWSrs0e2KTudKVa3peLUvYXMefDqIleLPVUBZMA==", + "dev": true, + "requires": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.4" + } + }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "q": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "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.0", + "strict-uri-encode": "^1.0.0" + } + }, + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true + }, + "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.3.2", + "path-type": "^2.0.0" + }, + "dependencies": { + "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.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.0.0", + "read-pkg": "^2.0.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" + } + }, + "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" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "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-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "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 + } + } + }, + "realpath-native": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.1.0.tgz", + "integrity": "sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA==", + "dev": true, + "requires": { + "util.promisify": "^1.0.0" + } + }, + "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.14", + "reduce-function-call": "^1.0.1" + }, + "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.3", + "resolved": "https://registry.npmjs.org/reduce-function-call/-/reduce-function-call-1.0.3.tgz", + "integrity": "sha512-Hl/tuV2VDgWgCSEeWMLwxLZqX7OK59eU1guxXsRKTAyeYimivsKdtcV4fu3r710tpG5GmDKDhQ0HSZLExnNmyQ==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0" + } + }, + "regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", + "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", + "dev": true, + "requires": { + "regenerate": "^1.4.0" + } + }, + "regenerator-transform": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.13.4.tgz", + "integrity": "sha512-T0QMBjK3J0MtxjPmdIMXm72Wvj2Abb0Bd4HADdfijwMdoIsyQZ6fWC7kDFhk2YinBBEMZDL7Y7wh0J1sGx3S4A==", + "dev": true, + "requires": { + "private": "^0.1.6" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexp-to-ast": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/regexp-to-ast/-/regexp-to-ast-0.5.0.tgz", + "integrity": "sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw==", + "dev": true + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, + "regexpu-core": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.0.tgz", + "integrity": "sha512-TQ4KXRnIn6tz6tjnrXEkD/sshygKH/j5KzK86X8MkeHyZ8qst/LZ89j3X4/8HEIfHANTFIP/AbXakeRhWIl5YQ==", + "dev": true, + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.2.0", + "regjsgen": "^0.5.1", + "regjsparser": "^0.6.4", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.2.0" + } + }, + "regjsgen": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.1.tgz", + "integrity": "sha512-5qxzGZjDs9w4tzT3TPhCJqWdCc3RLYwy9J2NB0nm5Lz+S273lvWcpjaTGHsT1dc6Hhfq41uSEOw8wBmxrKOuyg==", + "dev": true + }, + "regjsparser": { + "version": "0.6.4", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz", + "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "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 + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "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 + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, + "request-promise-core": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.3.tgz", + "integrity": "sha512-QIs2+ArIGQVp5ZYbWD5ZLCY29D5CfWizP8eWnm8FoGD1TX61veauETVQbrV60662V0oFBkrDOuaBI8XgtuyYAQ==", + "dev": true, + "requires": { + "lodash": "^4.17.15" + } + }, + "request-promise-native": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.8.tgz", + "integrity": "sha512-dapwLGqkHtwL5AEbfenuzjTYg35Jd6KPytsC2/TLkVMz8rm+tNt72MGUWT1RP/aYawMpN6HqbNGBQaRcBtjQMQ==", + "dev": true, + "requires": { + "request-promise-core": "1.1.3", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" + } + }, + "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-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "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" + }, + "dependencies": { + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + } + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "rollup": { + "version": "1.32.1", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.32.1.tgz", + "integrity": "sha512-/2HA0Ec70TvQnXdzynFffkjA6XN+1e2pEv/uKS5Ulca40g2L7KuOE3riasHoNVHOsFD5KKZgDsMk1CP3Tw9s+A==", + "dev": true, + "requires": { + "@types/estree": "*", + "@types/node": "*", + "acorn": "^7.1.0" + } + }, + "rollup-plugin-replace": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-replace/-/rollup-plugin-replace-2.2.0.tgz", + "integrity": "sha512-/5bxtUPkDHyBJAKketb4NfaeZjL5yLZdeUihSfbF2PQMz+rSTEb8ARKoOl3UBT4m7/X+QOXJo3sLTcq+yMMYTA==", + "dev": true, + "requires": { + "magic-string": "^0.25.2", + "rollup-pluginutils": "^2.6.0" + } + }, + "rollup-pluginutils": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", + "dev": true, + "requires": { + "estree-walker": "^0.6.1" + } + }, + "rsvp": { + "version": "4.8.5", + "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz", + "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==", + "dev": true + }, + "run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true + }, + "rxjs": { + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.5.tgz", + "integrity": "sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "sane": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/sane/-/sane-4.1.0.tgz", + "integrity": "sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA==", + "dev": true, + "requires": { + "@cnakazawa/watch": "^1.0.3", + "anymatch": "^2.0.0", + "capture-exit": "^2.0.0", + "exec-sh": "^0.3.2", + "execa": "^1.0.0", + "fb-watchman": "^2.0.0", + "micromatch": "^3.1.4", + "minimist": "^1.1.1", + "walker": "~1.0.5" + }, + "dependencies": { + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "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.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.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=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "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.0.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.5" + } + } + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "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.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.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.0" + } + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "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 + }, + "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=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.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 + }, + "saxes": { + "version": "3.1.11", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-3.1.11.tgz", + "integrity": "sha512-Ydydq3zC+WYDJK1+gRxRapLIED9PWeSuuS41wqyoRmzvhhh9nc+QQrVMKJYzJFULazeGhzSV0QleN2wD3boh2g==", + "dev": true, + "requires": { + "xmlchars": "^2.1.1" + } + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true + }, + "semver-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz", + "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==", + "dev": true + }, + "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-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "shellwords": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", + "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", + "dev": true + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "slice-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", + "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "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==", + "dev": true, + "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=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "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==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "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=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "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==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "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==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "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.5" + } + } + } + }, + "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.0.0" + } + }, + "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-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "requires": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "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 + } + } + }, + "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=", + "dev": true + }, + "sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "dev": true + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true + }, + "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==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "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.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "stack-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.2.tgz", + "integrity": "sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA==", + "dev": true + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "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=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", + "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-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "dev": true + }, + "string-length": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz", + "integrity": "sha1-1A27aGo6zpYMHP/KVivyxF+DY+0=", + "dev": true, + "requires": { + "astral-regex": "^1.0.0", + "strip-ansi": "^4.0.0" + }, + "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 + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "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" + } + } + } + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trimleft": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", + "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimstart": "^1.0.0" + } + }, + "string.prototype.trimright": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", + "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimend": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "stringify-object": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", + "dev": true, + "requires": { + "get-own-enumerable-property-symbols": "^3.0.0", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.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 + }, + "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-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.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.1", + "colors": "~1.1.2", + "csso": "~2.3.1", + "js-yaml": "~3.7.0", + "mkdirp": "~0.5.1", + "sax": "~1.2.1", + "whet.extend": "~0.9.9" + } + }, + "symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "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==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "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 + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "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 + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + } + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "terser": { + "version": "3.17.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-3.17.0.tgz", + "integrity": "sha512-/FQzzPJmCpjAH9Xvk2paiWrFq+5M6aVOf+2KRbwhByISDX/EujxsK+BAvrhb6H+2rtrLCHK9N01wO014vrIwVQ==", + "dev": true, + "requires": { + "commander": "^2.19.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.10" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "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 + } + } + }, + "test-exclude": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", + "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", + "dev": true, + "requires": { + "glob": "^7.1.3", + "minimatch": "^3.0.4", + "read-pkg-up": "^4.0.0", + "require-main-filename": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "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 + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", + "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "dev": true, + "requires": { + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" + } + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "throat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz", + "integrity": "sha1-iQN8vJLFarGJJua6TLsgDhVnKmo=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "tmpl": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", + "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", + "dev": true + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "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=", + "dev": true, + "requires": { + "kind-of": "^3.0.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.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "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 + }, + "tslib": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", + "dev": true + }, + "tsutils": { + "version": "3.17.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", + "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "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.0.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 + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + }, + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", + "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", + "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "uniq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=", + "dev": true + }, + "uniqs": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/uniqs/-/uniqs-2.0.0.tgz", + "integrity": "sha1-/+3ks2slKQaW5uFl1KWe25mOawI=", + "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=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "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" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util.promisify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", + "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.2", + "has-symbols": "^1.0.1", + "object.getownpropertydescriptors": "^2.1.0" + } + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "dev": true + }, + "v8-compile-cache": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", + "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "vendors": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/vendors/-/vendors-1.0.4.tgz", + "integrity": "sha512-/juG65kTL4Cy2su4P8HjtkTxk6VmJDiOPBufWniqQ6wknac6jNiXS9vU+hO3wgusiyqWlzTbVHi0dyJqRONg3w==", + "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.2.0" + } + }, + "w3c-hr-time": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", + "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", + "dev": true, + "requires": { + "browser-process-hrtime": "^1.0.0" + } + }, + "w3c-xmlserializer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz", + "integrity": "sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg==", + "dev": true, + "requires": { + "domexception": "^1.0.1", + "webidl-conversions": "^4.0.2", + "xml-name-validator": "^3.0.0" + } + }, + "wait-on": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-4.0.2.tgz", + "integrity": "sha512-Qpmgm3Hw/sXm7xK68FBsYy5r+Uid94/QymwnEjn9GTpfiWTUVYm0bccivVwY/BXGYO2r+5Cd8S/DzrRZqHK/9w==", + "dev": true, + "requires": { + "@hapi/joi": "^17.1.1", + "lodash": "^4.17.15", + "minimist": "^1.2.5", + "request": "^2.88.2", + "request-promise-native": "^1.0.8", + "rxjs": "^6.5.5" + } + }, + "walker": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", + "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", + "dev": true, + "requires": { + "makeerror": "1.0.x" + } + }, + "wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "dev": true, + "requires": { + "defaults": "^1.0.3" + } + }, + "webidl-conversions": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", + "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==", + "dev": true + }, + "whatwg-encoding": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", + "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "dev": true, + "requires": { + "iconv-lite": "0.4.24" + } + }, + "whatwg-mimetype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", + "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", + "dev": true + }, + "whatwg-url": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz", + "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, + "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": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "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 + }, + "which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", + "dev": true + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, + "write-file-atomic": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.1.tgz", + "integrity": "sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, + "ws": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz", + "integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w==", + "dev": true + }, + "xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true + }, + "xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yaml": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", + "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", + "dev": true + }, + "yargs": { + "version": "15.3.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", + "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.1" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..51f4f02 --- /dev/null +++ b/package.json @@ -0,0 +1,58 @@ +{ + "name": "brackets", + "private": true, + "version": "1.0.0", + "description": "Salesforce Labs Brackets App", + "scripts": { + "lint": "npm run lint:lwc && npm run lint:aura", + "lint:lwc": "eslint **/lwc/**", + "lint:aura": "sfdx force:lightning:lint force-app/main/default/aura --exit", + "test": "npm run lint && npm run test:unit", + "test:unit": "sfdx-lwc-jest", + "test:unit:watch": "sfdx-lwc-jest --watch", + "test:unit:debug": "sfdx-lwc-jest --debug", + "test:unit:coverage": "sfdx-lwc-jest --coverage", + "prettier": "prettier --write \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"", + "prettier:verify": "prettier --list-different \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"", + "postinstall": "node bin/check-version.js" + }, + "author": "ForceDotComLabs", + "license": "CC0-1.0", + "repository": { + "type": "git", + "url": "git+https://github.com/SalesforceLabs/Brackets.git" + }, + "bugs": { + "url": "https://github.com/SalesforceLabs/Brackets/issues" + }, + "homepage": "https://github.com/SalesforceLabs/Brackets#readme", + "engines": { + "node": ">= 14.3.0", + "npm": ">= 6.14.4" + }, + "devDependencies": { + "@prettier/plugin-xml": "^0.7.2", + "@salesforce/eslint-config-lwc": "^0.5.0", + "@salesforce/sfdx-lwc-jest": "^0.7.1", + "eslint": "^6.8.0", + "husky": "^4.2.5", + "jest-canvas-mock": "^2.2.0", + "lint-staged": "^10.2.6", + "prettier": "^2.0.5", + "prettier-plugin-apex": "^1.4.0", + "semver": "^7.3.2" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged && npm run lint:aura" + } + }, + "lint-staged": { + "**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}": [ + "prettier --write" + ], + "**/lwc/**": [ + "eslint" + ] + } +} diff --git a/salesforce.schema b/salesforce.schema deleted file mode 100644 index e332fb6..0000000 --- a/salesforce.schema +++ /dev/null @@ -1 +0,0 @@ -place holder \ No newline at end of file diff --git a/scripts/apex/hello.apex b/scripts/apex/hello.apex new file mode 100644 index 0000000..1fba732 --- /dev/null +++ b/scripts/apex/hello.apex @@ -0,0 +1,10 @@ +// Use .apex files to store anonymous Apex. +// You can execute anonymous Apex in VS Code by selecting the +// apex text and running the command: +// SFDX: Execute Anonymous Apex with Currently Selected Text +// You can also execute the entire file by running the command: +// SFDX: Execute Anonymous Apex with Editor Contents + +string tempvar = 'Enter_your_name_here'; +System.debug('Hello World!'); +System.debug('My name is ' + tempvar); \ No newline at end of file diff --git a/scripts/soql/account.soql b/scripts/soql/account.soql new file mode 100644 index 0000000..b70934f --- /dev/null +++ b/scripts/soql/account.soql @@ -0,0 +1,6 @@ +// Use .soql files to store SOQL queries. +// You can execute queries in VS Code by selecting the +// query text and running the command: +// SFDX: Execute SOQL Query with Currently Selected Text + +SELECT Id, Name FROM Account; \ No newline at end of file diff --git a/sfdx-project.json b/sfdx-project.json new file mode 100644 index 0000000..252be1d --- /dev/null +++ b/sfdx-project.json @@ -0,0 +1,11 @@ +{ + "packageDirectories": [ + { + "path": "force-app", + "default": true + } + ], + "namespace": "", + "sfdcLoginUrl": "https://login.salesforce.com", + "sourceApiVersion": "48.0" +} diff --git a/src/applications/Brackets.app b/src/applications/Brackets.app deleted file mode 100644 index f069e50..0000000 --- a/src/applications/Brackets.app +++ /dev/null @@ -1,7 +0,0 @@ - - - About_Brackets - - About_Brackets - Matches_Predictions - diff --git a/src/classes/BracketsExportImportTest.cls b/src/classes/BracketsExportImportTest.cls deleted file mode 100644 index 029e2d0..0000000 --- a/src/classes/BracketsExportImportTest.cls +++ /dev/null @@ -1,252 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ -@isTest -class BracketsExportImportTest { - - static testmethod void testSimpleExportImport() { - - BracketsTournamentUtilities.CreatingTournamentTree = false; - - //Create a user - User testUser = BracketsTestUtilities.createUser(); - - System.runAs(testUser) { - - List baselineTeams = [Select Id, Name, ExternalId__c From Brackets_Team__c]; - List baselineTour = [Select Id, Name, ExternalId__c From Brackets_Tournament__c]; - List baselineRound = [Select Id, Name, ExternalId__c From Brackets_Round__c]; - List baselineMatch = [Select Id, Name, ExternalId__c From Brackets_Match__c]; - - Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament('Small Season 2010 ' + Datetime.now(), 12, BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE); - - - - - Brackets_Group__c groupp = BracketsTestUtilities.getGroup(tournament.Id); - - Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team' + Datetime.now()); - Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team' + Datetime.now()); - Brackets_Team__c teamC = BracketsTestUtilities.createTeam('C-Team' + Datetime.now()); - Brackets_Team__c teamD = BracketsTestUtilities.createTeam('D-Team' + Datetime.now()); - Brackets_Team__c teamE = BracketsTestUtilities.createTeam('E-Team' + Datetime.now()); - Brackets_Team__c teamF = BracketsTestUtilities.createTeam('F-Team' + Datetime.now()); - Brackets_Team__c teamG = BracketsTestUtilities.createTeam('G-Team' + Datetime.now()); - Brackets_Team__c teamH = BracketsTestUtilities.createTeam('H-Team' + Datetime.now()); - Brackets_Team__c teamI = BracketsTestUtilities.createTeam('I-Team' + Datetime.now()); - Brackets_Team__c teamJ = BracketsTestUtilities.createTeam('J-Team' + Datetime.now()); - Brackets_Team__c teamK = BracketsTestUtilities.createTeam('K-Team' + Datetime.now()); - Brackets_Team__c teamL = BracketsTestUtilities.createTeam('L-Team' + Datetime.now()); - - List auxList = new List(); - auxList.add( teamA ); - auxList.add( teamB ); - auxList.add( teamC ); - auxList.add( teamD ); - auxList.add( teamE ); - auxList.add( teamF ); - auxList.add( teamG ); - auxList.add( teamH ); - auxList.add( teamI ); - auxList.add( teamJ ); - auxList.add( teamK ); - auxList.add( teamL ); - upsert auxList; - - //let's make sure we have four rounds - List rounds = [Select Id, Name, Deadline__c From Brackets_Round__c Where Brackets_Tournament__c =: tournament.id Order By RoundNumber__c]; - - //make sure that round 0 has 4 matches - Brackets_Round__c r = rounds.get(0); - List matches = [Select Id, Name, Conference__c, Position__c, FollowingBrackets_Match__c, Schedule__c From Brackets_Match__c where Brackets_Round__c =: r.id Order By Position__c]; - - Brackets_Match__c m1 = matches.get(0); - m1.HomeBrackets_Team__c = teamA.id; - m1.VisitorBrackets_Team__c = teamB.id; - Datetime originalSchedule = Datetime.now().addMinutes(10); - m1.Schedule__c = originalSchedule; - - Brackets_Match__c m2 = matches.get(1); - m2.HomeBrackets_Team__c = teamC.id; - m2.VisitorBrackets_Team__c = teamD.id; - - Brackets_Match__c m3 = matches.get(2); - m3.HomeBrackets_Team__c = teamE.id; - m3.VisitorBrackets_Team__c = teamF.id; - - Brackets_Match__c m4 = matches.get(3); - m4.HomeBrackets_Team__c = teamG.id; - m4.VisitorBrackets_Team__c = teamH.id; - - update matches; - - Brackets_Round__c r2 = rounds.get(1); - List matches2 = [Select Id, Name, Conference__c, Position__c, FollowingBrackets_Match__c, Schedule__c From Brackets_Match__c where Brackets_Round__c =: r2.id Order By Position__c]; - - Brackets_Match__c m5 = matches2.get(0); - //m5.HomeBrackets_Team__c = teamA.id; - m5.VisitorBrackets_Team__c = teamI.id; - System.assert(m1.FollowingBrackets_Match__c == m5.Id); - - Brackets_Match__c m6 = matches2.get(1); - m6.HomeBrackets_Team__c = teamJ.id; - //m5.VisitorBrackets_Team__c = teamI.id; - - Brackets_Match__c m7 = matches2.get(2); - //m7.HomeBrackets_Team__c = teamK.id; - m7.VisitorBrackets_Team__c = teamK.id; - - Brackets_Match__c m8 = matches2.get(3); - m8.HomeBrackets_Team__c = teamL.id; - //m8.VisitorBrackets_Team__c = teamL.id; - - update matches2; - - //validation - tournament.deadline__c = Datetime.now().addMinutes(1); - tournament.Allow_Update__c = true; - tournament.Version__c = 2.0; - update tournament; - - System.assert([Select Id, Deadline__c From Brackets_Tournament__c Where Id =: tournament.Id].Deadline__c != null); - - //now we should be able to export, delete and reimport - Apexpages.currentPage().getParameters().put( 'id', tournament.Id ); - Apexpages.currentPage().getParameters().put( 'tVersion', '1' ); - BracketsSitesTournamentPublisher ut = new BracketsSitesTournamentPublisher (); - - String updateVersion1 = ut.getOutputXml(); - system.assert(updateVersion1 != null); - - //now we'll make some modifications and get an update version 2. - String teamAName = teamA.Name; - String teamANewName = 'teamA update update ' + Datetime.now(); - teamA.Name = teamANewName; - update teamA; - - //update match1 so it has a winner. - m1.WinnerBrackets_Team__c = teamA.id; - m1.HomeScore__c = 10; - Datetime updatedSchedule = Datetime.now().addMinutes(5); - m1.Schedule__c = updatedSchedule; - update m1; - - //update the version of the tournament - tournament.Version__c = 3.0; - update tournament; - - //get a new version of the code - Apexpages.currentPage().getParameters().put( 'id', tournament.Id ); - Apexpages.currentPage().getParameters().put( 'tVersion', '2' ); - BracketsSitesTournamentPublisher ut2 = new BracketsSitesTournamentPublisher (); - - String updateVersion2 = ut2.getOutputXml(); - system.assert(updateVersion2 != null); - System.debug('1234'); - - //now clean update a bunch of stuff - delete tournament; - List postDelete = [Select Id, Name From Brackets_Round__c Where Brackets_Tournament__c =: tournament.id]; - System.assert(postDelete.size() == 0); - List originalteams = [Select Id, Name From Brackets_Team__c Where Id in: auxList]; - System.assert(originalTeams.size() == 12); - delete originalTeams; - List originalteams2 = [Select Id, Name From Brackets_Team__c Where Id in: auxList]; - System.assert(originalTeams2.size() == 0); - BracketsImportTournament importTournament = new BracketsImportTournament('manual'); - - //get all tournaments - List allTournamentsPostUpdate = [Select Id, Name From Brackets_Tournament__c]; - List allTeams = [Select Id, Name, ExternalId__c From Brackets_Team__c]; - System.assert(allTeams.size() == baselineTeams.size()); - - importTournament.processImportedDocument(updateVersion1); - - //validate that the correct number of teams are here - System.assert([Select Id From Brackets_Tournament__c].size() == baselineTour.size() + 1); - System.assert([Select Id From Brackets_Team__c].size() == baselineTeams.size() + auxList.size()); - System.assert([Select Id From Brackets_Round__c].size() == baselineRound.size() + 4); - System.assert([Select Id From Brackets_Match__c].size() == baselineMatch.size() + 11); - - Brackets_Tournament__c newTournament = importTournament.tournament; - - System.debug(logginglevel.info, '12345: ' + newTournament); - - System.assert(newTournament.id != tournament.id); - System.assert(newTournament.name == tournament.name); - System.assert(newTournament.deadline__c != null); - - List newRounds = [Select Id, Name From Brackets_Round__c where Brackets_Tournament__c =: newTournament.id]; - System.assert(newRounds.size() == 4); - - Brackets_Round__c newRound1 = newRounds.get(0); - List newMatches = [Select Id, Name, Conference__c, Position__c, Schedule__c, FollowingBrackets_Match__c, HomeBrackets_Team__c, VisitorBrackets_Team__c From Brackets_Match__c where Brackets_Round__c =: newRound1.id Order By Position__c]; - Brackets_Match__c newm1 = newMatches.get(0); - System.assert(newm1.Schedule__c != null); - System.assert(originalSchedule != null); - System.assert(newm1.Schedule__c.minuteGmt() == originalSchedule.minuteGmt(), 'Original: ' + originalSchedule + ' Match: ' + newm1.Schedule__c); - Brackets_Team__c newTeamA = [Select Id, Name, ExternalId__c From Brackets_Team__c Where Id =: newm1.HomeBrackets_Team__c]; - System.assert(newTeamA.Name == teamAName); - System.assert(newTeamA.Id != teamA.Id); - System.assert(newTeamA.ExternalId__c == teamA.Id); - - //now let's do another update - BracketsImportTournament importTournament2 = new BracketsImportTournament('manual'); - importTournament2.processImportedDocument(updateVersion2); - //validate that the correct number of teams are here - System.assert([Select Id From Brackets_Tournament__c].size() == baselineTour.size() + 1); - System.assert([Select Id From Brackets_Team__c].size() == baselineTeams.size() + auxList.size()); - System.assert([Select Id From Brackets_Round__c].size() == baselineRound.size() + 4); - System.assert([Select Id From Brackets_Match__c].size() == baselineMatch.size() + 11); - - - //now on to the detail validation - Brackets_Tournament__c newTournament2 = importTournament2.tournament; - System.assert(newTournament2.id != tournament.id); - System.assert(newTournament2.name == tournament.name); - - List newRoundsA = [Select Id, Name From Brackets_Round__c where Brackets_Tournament__c =: newTournament2.id]; - System.assert(newRoundsA.size() == 4); - - Brackets_Round__c newRound1A = newRoundsA.get(0); - List newMatchesA = [Select Id, Name, Conference__c, Schedule__c, Position__c, FollowingBrackets_Match__c, HomeBrackets_Team__c, VisitorBrackets_Team__c, WinnerBrackets_Team__c, HomeScore__c From Brackets_Match__c where Brackets_Round__c =: newRound1A.id Order By Position__c]; - Brackets_Match__c newm1A = newMatchesA.get(0); - System.assert(newm1A.Schedule__c.minuteGmt() != originalSchedule.minuteGmt()); - System.assert(newm1A.Schedule__c.minuteGmt() == updatedSchedule.minuteGmt()); - Brackets_Team__c newTeamAA = [Select Id, Name, ExternalId__c From Brackets_Team__c Where Id =: newm1A.HomeBrackets_Team__c]; - System.assert(newTeamAA.Name == teamANewName); - System.assert(newTeamAA.Id != teamA.Id); - System.assert(newTeamAA.ExternalId__c == teamA.Id); - - System.assert(newm1A.WinnerBrackets_Team__c != null); - System.assert(newm1A.WinnerBrackets_Team__c == newTeamAA.Id); - System.assert(newm1A.HomeScore__c == m1.HomeScore__c); - } - - } -} \ No newline at end of file diff --git a/src/classes/BracketsExportTeams.cls b/src/classes/BracketsExportTeams.cls deleted file mode 100644 index e4c416c..0000000 --- a/src/classes/BracketsExportTeams.cls +++ /dev/null @@ -1,143 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ -public with sharing class BracketsExportTeams{ - - private String tournamentId { get; set; } - public Xmlstreamwriter out { get; set; } - - /** - * Constructor - * @param tourId - * @param writer - */ - public BracketsExportTeams( String tourId, Xmlstreamwriter writer ){ - - this.tournamentId = tourId; - this.out = writer; - } - - /** - * Method in charge of handling the export task related - * @return Xmlstreamwriter - */ - public Xmlstreamwriter BracketsexportTeams(){ - - List matches = [ Select m.VisitorBrackets_Team__c, m.Brackets_Round__r.Brackets_Tournament__c, m.Brackets_Round__c, m.Name, m.Id, m.HomeBrackets_Team__c - From Brackets_Match__c m where m.Brackets_Round__r.Brackets_Tournament__c =: this.tournamentId ]; - - Set teamIds = new Set(); - for( Brackets_Match__c match : matches ){ - teamIds.add( match.HomeBrackets_Team__c ); - teamIds.add( match.VisitorBrackets_Team__c ); - } - - List teams = [ Select Id , Name, ShortName__c, Description__c, Rank__c from Brackets_Team__c where Id IN : teamIds ]; - - this.buildXmlString( teams ); - - return this.out; - } - - /** - * Method in charge of compiling XML document with Team Information - * @param teamList - */ - public void buildXmlString( List teamList ){ - - this.out.writeStartElement( null, 'Teams', null ); - - for( Brackets_Team__c team : teamList ){ - - this.out.writeStartElement( null, 'Team', null ); - - BracketsImportExportUtilities.writeElement( this.out, 'id', '' + team.Id ); - BracketsImportExportUtilities.writeElement( this.out, 'name', '' + team.Name ); - BracketsImportExportUtilities.writeElement( this.out, 'description', '' + team.Description__c ); - BracketsImportExportUtilities.writeElement( this.out, 'rank', '' + team.Rank__c ); - BracketsImportExportUtilities.writeElement( this.out, 'shortname', '' + team.ShortName__c ); - - this.out.writeEndElement(); - } - - this.out.writeEndElement(); - } - - private static testMethod void testExportTeams(){ - Brackets_Tournament__c tournament = BracketsTestUtilities.createFullTournament(4,BracketsTournamentUtilities.STANDARD_TOURNAMENT_TYPE); - BracketsExportTeams bracketsExportTeams = new BracketsExportTeams(tournament.Id,new Xmlstreamwriter()); - Xmlstreamwriter writer = bracketsExportTeams.BracketsexportTeams(); - System.assert(writer.getXmlString() != null); - } - - private static testmethod void testExportTeamsWithImport() { - - - Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team' + Datetime.now()); - Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team' + Datetime.now()); - Brackets_Team__c teamC = BracketsTestUtilities.createTeam('C-Team' + Datetime.now()); - Brackets_Team__c teamD = BracketsTestUtilities.createTeam('D-Team' + Datetime.now()); - - List teams = new List(); - teams.add( teamA ); - teams.add( teamB ); - teams.add( teamC ); - teams.add( teamD ); - - insert teams; - - List allTeams = [Select Id, Name, ExternalID__c From Brackets_Team__c]; - - delete teams; - - BracketsExportTeams exportTeams = new BracketsExportTeams(null, new Xmlstreamwriter()); - - exportTeams.buildXmlString(teams); - - String s = exportTeams.out.getXmlString(); - - System.debug(LoggingLevel.Info, '1234' + s); - - - BracketsImportTeams importTeams = new BracketsImportTeams(); - - importTeams.processImportedDocument(s); - - List allTeams2 = [Select Id, Name, ExternalID__c From Brackets_Team__c]; - - System.assert(allTeams.size() == allTeams2.size()); - - importTeams.processImportedDocument(s); - - List allTeams3 = [Select Id, Name, ExternalID__c From Brackets_Team__c]; - - System.assert(allTeams.size() == allTeams3.size()); - - - } -} \ No newline at end of file diff --git a/src/classes/BracketsFeedItemUtility.cls b/src/classes/BracketsFeedItemUtility.cls deleted file mode 100644 index d96d114..0000000 --- a/src/classes/BracketsFeedItemUtility.cls +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ -public Class BracketsFeedItemUtility { - - public Boolean isStandardUser() { - - return UserInfo.getUserType() == 'Standard'; - - } - - public String getLastTournamentGroupChatter(Id groupId, Integer maxLength) { - - if (!isStandardUser()) { - return ''; - } - - String ret = ''; - - List items = [Select Id, Body From Brackets_Group__Feed Where - ParentId =: groupId - and Type = 'TextPost' - Order By CreatedDate Desc Limit 1]; - - if (items.size() ==1 ) { - Brackets_Group__Feed item = items.get(0); - ret = item.Body; - if (ret.length() > maxLength) { - ret = ret.substring(0,maxLength-3); - if (item.Body.length() > ret.length()) { - ret += '...'; - } - } - } - - return ret; - - } - - static TestMethod void testLastChatter() { - - BracketsTournamentUtilities.CreatingTournamentTree = true; - //Create a user - User testUser = BracketsTestUtilities.createUser(); - - System.runAs(testUser) { - - - Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament('Test1 RoundByRound', 4); - - List ts = new List(); - ts.add(tournament.Id); - - Brackets_Group__c groupA = BracketsTestUtilities.getGroup(tournament.Id, BracketsGroupUtilities.BET_TYPE_BY_ROUND); - - BracketsFeedItemUtility util = new BracketsFeedItemUtility(); - - String s = util.getLastTournamentGroupChatter(groupA.id,40); - - System.assertEquals(s,''); - - FeedItem item = new FeedItem(); - item.parentId = groupA.id; - item.body = 'This is a test'; - insert item; - - - s = util.getLastTournamentGroupChatter(groupA.id,40); - - System.assert(s != null); - System.assertEquals(s,'This is a test'); - - FeedItem item2 = new FeedItem(); - item2.parentId = groupA.id; - item2.body = 'This is a test56789 123456789 123456789 123456789'; - insert item2; - - s = util.getLastTournamentGroupChatter(groupA.id,40); - - System.assert(s != null); - System.assertEquals(s,'This is a test56789 123456789 1234567...'); - } - - } - - - - -} \ No newline at end of file diff --git a/src/classes/BracketsGetStartedController.cls b/src/classes/BracketsGetStartedController.cls deleted file mode 100644 index bbc97b1..0000000 --- a/src/classes/BracketsGetStartedController.cls +++ /dev/null @@ -1,176 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ -public with sharing class BracketsGetStartedController { - - - - //public final String TOURNAMENT_SOURCE = 'http://free-12415f14c3a-124e539428a-12d5e7eb4ff.force.com/?id=a0MA00000034DNRMA2'; - //public final String TOURNAMENT_SOURCE = 'http://free-12415f14c3a-124e539428a-12d5e7eb4ff.force.com/?id=a0MA00000034OoeMAE'; - - //For basketball release - public final String SAMPLE_SOURCE = 'http://free-12415f14c3a-124e539428a-12d5e7eb4ff.force.com/?id=a06A000000AylgsIAB'; - public final String FULL_SOURCE = 'http://free-12415f14c3a-124e539428a-12d5e7eb4ff.force.com/?id=a06A000000AylunIAB'; - - - public Boolean isCompleteStep1 { get; set; } - public Boolean isCompleteStep2 { get; set; } - public Boolean isError { get; set; } - public String errorMessage { get; set; } - - public BracketsGetStartedController() { - isCompleteStep1 = false; - isCompleteStep2 = false; - isError = false; - - BracketsSettingsPersonal__c settings = BracketsSettingsPersonal__c.getOrgDefaults(); - if (settings != null && settings.Initial_Setup_Complete__c) { - //this.isError = true; - //this.errorMessage = 'Initial setup is already complete.'; - this.isCompleteStep1 = true; - - } - - if (settings != null && settings.Initial_Setup_Step_2_Complete__c) { - this.isCompleteStep2 = true; - } - } - - public void getStarted() { - - BracketsSettingsPersonal__c settings = BracketsSettingsPersonal__c.getOrgDefaults(); - if (settings != null && settings.Initial_Setup_Complete__c) { - this.isError = true; - this.errorMessage = 'Initial setup is already complete.'; - this.isCompleteStep1 = true; - return; - } - - try { - handleGetStarted(SAMPLE_SOURCE); - - //create settings - settings = BracketsSettingsPersonal__c.getOrgDefaults(); - if (settings == null) { - settings = new BracketsSettingsPersonal__c(); - } - settings.Initial_Setup_Complete__c = true; - upsert settings; - - this.isCompleteStep1 = true; - - } catch (Exception e) { - this.isError = true; - this.isCompleteStep1 = false; - this.errorMessage = 'Unable to complete installation [BracketsGetStartedController]: ' + e.getMessage(); - } - - } - - public void handleGetStarted(String targetURL) { - - - - //Baseline tournaments in case this is a re-rerun - //List baselineTournaments = [Select Id, Name From Brackets_Tournament__c Limit ]; - - - //import a tournament - BracketsProccessUpdate processUpdate = new BracketsProccessUpdate(targetURL); - - //new tournament - Brackets_Tournament__c importedTournament = [Select Id, Name From Brackets_Tournament__c Order By CreatedDate DESC Limit 1]; - - //based on the imported tournament, create a pool - Brackets_Group__c newGroup = new Brackets_Group__c(); - newGroup.Brackets_Tournament__c = importedTournament.id; - newGroup.Type__c = BracketsGroupUtilities.BET_TYPE_FULL_TOURNAMENT; - newGroup.Name = importedTournament.Name + ' [Full]'; - insert newGroup; - - //join the current user to that pool - Brackets_UserTournament__c userTour = new Brackets_UserTournament__c(); - userTour.Brackets_Tournament__c = importedTournament.id; - userTour.Brackets_Group__c = newGroup.id; - userTour.User__c = Userinfo.getUserId(); - insert userTour; - - //based on the imported tournament, create a pool - Brackets_Group__c newGroup2 = new Brackets_Group__c(); - newGroup2.Brackets_Tournament__c = importedTournament.id; - newGroup2.Type__c = BracketsGroupUtilities.BET_TYPE_BY_ROUND; - newGroup2.Name = importedTournament.Name + ' [Round]'; - insert newGroup2; - - //join the current user to that pool - Brackets_UserTournament__c userTour2 = new Brackets_UserTournament__c(); - userTour2.Brackets_Tournament__c = importedTournament.id; - userTour2.Brackets_Group__c = newGroup2.id; - userTour2.User__c = Userinfo.getUserId(); - insert userTour2; - - - - } - public void getStartedStep2() { - - BracketsSettingsPersonal__c settings = BracketsSettingsPersonal__c.getOrgDefaults(); - if (settings != null && settings.Initial_Setup_Step_2_Complete__c) { - this.isError = true; - this.errorMessage = 'Initial setup 2 is already complete.'; - this.isCompleteStep2 = true; - return; - } - - try { - handleGetStarted(FULL_SOURCE); - - //create settings - settings = BracketsSettingsPersonal__c.getOrgDefaults(); - if (settings == null) { - settings = new BracketsSettingsPersonal__c(); - } - settings.Initial_Setup_Step_2_Complete__c = true; - upsert settings; - - this.isCompleteStep2 = true; - - } catch (Exception e) { - System.debug('Yes I found the error'); - this.isError = true; - this.isCompleteStep1 = false; - this.isCompleteStep2 = false; - this.errorMessage = 'Unable to complete installation [BracketsGetStartedController]: ' + e.getMessage(); - } - - - } - - - -} \ No newline at end of file diff --git a/src/classes/BracketsGroupUtilities.cls b/src/classes/BracketsGroupUtilities.cls deleted file mode 100644 index 79a298a..0000000 --- a/src/classes/BracketsGroupUtilities.cls +++ /dev/null @@ -1,150 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ -public with sharing class BracketsGroupUtilities{ - - public static final String BET_TYPE_BY_ROUND = 'Round By Round'; - public static final String BET_TYPE_FULL_TOURNAMENT = 'Full Tournament'; - - /** - * Return a list of groups for each tournament - * - * @param tournaments List of tournamntes - * @param userd User (if not null, then filter by user too) - */ - public static Map> getGroups( List tournaments, Id userid ){ - Map> mapOfListGroup = new Map>(); - List listOfGroup; - List groupsByTournament; - - // Select groups - if( userid != null ){ - groupsByTournament = [ - SELECT Id, Name, Brackets_Tournament__c - FROM Brackets_Group__c - WHERE Id IN ( - SELECT ut.Brackets_Group__c - FROM Brackets_UserTournament__c ut - WHERE ut.User__c = :userid - AND ut.Brackets_Tournament__c IN : tournaments - )]; - } - else{ - groupsByTournament = [SELECT Id, Name, Brackets_Tournament__c - FROM Brackets_Group__c - WHERE Brackets_Tournament__c IN : tournaments]; - } - - // Process data in a list of tournaments by group - for(Brackets_Group__c groupy : groupsByTournament){ - for(Id tournamentId : tournaments){ - if(groupy.Brackets_Tournament__c == tournamentId){ - listOfGroup = mapOfListGroup.get(tournamentId); - if(listOfGroup == null){ - listOfGroup = new List(); - mapOfListGroup.put(tournamentId, listOfGroup); - } - listOfGroup.add(groupy); - } - } - } - - return mapOfListGroup; - } - - public static List getGroups( Id tournament, Id userid){ - List groups = new List(); - groups.add(tournament); - return getGroups(groups, userid).get(tournament); - } - - public static List getGroups(Id userId){ - return [SELECT Id,Name,Brackets_Tournament__c,NumOfMembers__c,Status__c,Type__c, - (SELECT Id FROM g.UserTornaments__r WHERE User__c=: userId) - FROM Brackets_Group__c g LIMIT :Limits.getLimitQueryRows() ]; - } - - public static Boolean hasUserTournament(Brackets_Group__c groupp){ - return groupp.UserTornaments__r.size() > 0; - } - - public static void deleteGroups(List tournaments){ - List tournamentsId = new List(); - for(Brackets_Tournament__c tournament : tournaments){ - tournamentsId.add(tournament.Id); - } - delete [select Id from Brackets_Group__c where Brackets_Tournament__c in :tournamentsId]; - - } - - static testmethod void testBasics() { - - System.assert(BracketsGroupUtilities.BET_TYPE_BY_ROUND != null); - System.assert(BracketsGroupUtilities.BET_TYPE_FULL_TOURNAMENT != null); - - } - - static testmethod void testGetGroups() { - - BracketsTournamentUtilities.CreatingTournamentTree = true; - //Create a user - User testUser = BracketsTestUtilities.createUser(); - - System.runAs(testUser) { - - - Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament('Test1 RoundByRound', 4); - - List ts = new List(); - ts.add(tournament.Id); - - Brackets_Group__c groupA = BracketsTestUtilities.getGroup(tournament.Id, BracketsGroupUtilities.BET_TYPE_BY_ROUND); - Brackets_Group__c groupB = BracketsTestUtilities.getGroup(tournament.Id, BracketsGroupUtilities.BET_TYPE_BY_ROUND); - - Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament(Userinfo.getUserId(), tournament.Id, groupA.Id); - - Map> results = BracketsGroupUtilities.getGroups(ts, testUser.id); - - System.assert(results != null); - System.assert(results.get(tournament.id) != null); - System.assert(results.get(tournament.id).size() == 1); - - Map> results2 = BracketsGroupUtilities.getGroups(ts, null); - - System.assert(results2 != null); - System.assert(results2.get(tournament.id) != null); - System.assert(results2.get(tournament.id).size() == 2); - - //just get the group - List groups = BracketsGroupUtilities.getGroups(tournament.id, testUser.id); - System.assert(groups.size() == 1); - } - - } - -} \ No newline at end of file diff --git a/src/classes/BracketsImportTeams.cls b/src/classes/BracketsImportTeams.cls deleted file mode 100644 index 98dcf1a..0000000 --- a/src/classes/BracketsImportTeams.cls +++ /dev/null @@ -1,167 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ -public with sharing class BracketsImportTeams{ - - private List teamList { get; set; } - - /** - * Constructor - */ - public BracketsImportTeams(){ - - - } - - /** - * Method in charge of retrieving and compiling the data from imported file, - * for then inserting into the system. - * @param xml - */ - public void processImportedDocument( String xml ){ - - this.teamList = new List(); - - try{ - this.readingTeamData( xml ); - System.debug(LoggingLevel.Info, '12345:'+this.teamList); - upsert this.teamList ExternalId__c; - }catch( Exception ex ){ - throw new BracketsException( 'Error Importing your Tournament Template [BracketsImportTeams] ' + ex.getMessage(), ex); - } - } - - /** - * Method in charge of retrieving and compiling the Team data from imported file, - * for then inserting into the system. - * @param xml - */ - private void readingTeamData( String xml ){ - - Xmlstreamreader reader = new Xmlstreamreader( xml ); - - while( reader.hasNext() ){ - if( reader.getEventType() == XmlTag.START_ELEMENT && reader.getLocalName() == 'Team' ){ - this.parseTeamData( reader ); - } - if( reader.getEventType() == XmlTag.END_ELEMENT && reader.getLocalName() == 'Teams' ){ - break; - } - reader.next(); - } - } - - /** - * Method in charge of parsing Team data from XMl document - * @param reader - * @return correctMetaData - */ - private void parseTeamData( Xmlstreamreader reader ){ - - Brackets_Team__c team = new Brackets_Team__c(); - - while( reader.hasNext() ){ - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'name' ){ - reader.next(); - team.Name = BracketsImportExportUtilities.getDecodedString( reader ); - //RSC - replaced using "ID" below. - //team.ExternalId__c = team.Name; - } - - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'shortname' ){ - reader.next(); - team.ShortName__c = BracketsImportExportUtilities.getDecodedString( reader ); - team.ShortName__c = ( team.ShortName__c.equalsIgnoreCase('null') ) ? null : team.ShortName__c; - } - - //RSC added - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'id' ){ - reader.next(); - team.ExternalId__c = BracketsImportExportUtilities.getDecodedString( reader ); - } - - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'description' ){ - reader.next(); - String descValue = BracketsImportExportUtilities.getDecodedString( reader ); - if( descValue == 'null' ){ - team.Description__c = ''; - } - else{ - team.Description__c = descValue; - } - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'rank' ){ - reader.next(); - String value = BracketsImportExportUtilities.getDecodedString( reader ); - if( value == 'null' ){ - team.Rank__c = null; - } - else{ - team.Rank__c = team.Rank__c = Decimal.valueOf( value ); - } - } - //Validate end of tag - if( reader.getEventType() == XMLTag.END_ELEMENT && reader.getLocalName() == 'Team' ){ - break; - } - - reader.next(); - } - - this.teamList.add( team ); - } - - public static testmethod void testTeamImportValid(){ - - delete [ select Id from Brackets_Tournament__c ]; - - BracketsImportTeams impTeams = new BracketsImportTeams(); - - try{ - impTeams.processImportedDocument( BracketsTestUtilities.xmlTournamentValid ); - List teamList = [ select id from Brackets_Team__c ]; - System.assert( teamList.size() > 0 ); - }catch( Exception ex ){ - System.assert( false ); - } - } - - public static testmethod void testTeamImportInvalid(){ - - delete [ select Id from Brackets_Tournament__c ]; - - BracketsImportTeams impTeams = new BracketsImportTeams(); - - try{ - impTeams.processImportedDocument( BracketsTestUtilities.xmlTournamentTeamInValid ); - System.assert( false ); - }catch( Exception ex ){ - System.assert( true ); - } - } -} \ No newline at end of file diff --git a/src/classes/BracketsImportTournament.cls b/src/classes/BracketsImportTournament.cls deleted file mode 100644 index d5028b3..0000000 --- a/src/classes/BracketsImportTournament.cls +++ /dev/null @@ -1,471 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -public with sharing class BracketsImportTournament{ - - private String source; - public Brackets_Tournament__c tournament { get; set; } - private List roundList { get; set; } - private List matchList { get; set; } - //ExternalId - ID - private Map teamList { get; set; } - //ExternalId - ID - private Map roundSync { get; set; } - private Map matchSync { get; set; } - private Map matchFollowingMatchId { get; set; } - private Map matchFollowingMatchSObject { get; set;} - - /** - * Constructor - */ - public BracketsImportTournament(String source){ - this.source = source; - this.roundList = new List(); - this.matchList = new List(); - this.teamList = new Map(); - this.roundSync = new Map(); - this.matchSync = new Map(); - this.matchFollowingMatchId = new Map(); - this.matchFollowingMatchSObject = new Map(); - } - - /** - * Method in charge of retrieving and compiling the data from imported file, - * for then inserting into the system. - * @param document - */ - public void processImportedDocument( String xml ){ - - Brackets_Match__c followingMatch; - String followingMatchExternalId; - BracketsTournamentUtilities.CreatingTournamentTree = true; - Savepoint sp = Database.setSavepoint(); - - //Initialize the schedule job - //TODO FUTURE - Do we need this? - //BracketsScheduleJob.createSingleInstance(); - - this.validate(xml); - try{ - try{ - BracketsImportTeams impTeams = new BracketsImportTeams(); - impTeams.processImportedDocument( xml ); - //creates internal map for use when importing Matches and refered teams - List teams = [ select t.Name, t.Id, t.ShortName__c, t.ExternalId__c From Brackets_Team__c t limit 1000 ]; - for( Brackets_Team__c team : teams ){ - this.teamList.put( team.ExternalId__c, team.Id ); - } - - }catch( Exception ex ){ - throw new BracketsException( 'Error Importing: Please check your Team Data', ex ); - } - try{ - this.readingTournamentData( xml ); - upsert this.tournament ExternalId__c; - - //Map the Tournament Object again - this.tournament = [Select t.isChild__c, t.Version__c, t.Update_Source__c, t.Type__c, t.TeamCount__c, t.Start__c, - t.Name, t.MaxRoundNumber__c, t.Id, t.ExternalId__c, t.End__c, t.Description__c, - t.CronTrigger__c, t.Allow_Update__c, t.Deadline__c From Brackets_Tournament__c t WHERE t.Id =: this.tournament.Id]; - - this.tournament.isChild__c = true; - this.tournament.Allow_Update__c = false; - upsert this.tournament ExternalId__c; - - }catch( Exception ex ){ - throw new BracketsException( 'Error Importing: Please check your Tournament Data [BracketsImportTournament] ', ex ); - } - try{ - this.readingRoundsData( xml ); - upsert this.roundList ExternalId__c; - for( Brackets_Round__c r : this.roundList ){ - this.roundSync.put( r.ExternalId__c, r.Id ); - } - }catch( Exception ex ){ - throw new BracketsException( 'Error Importing: Please check your Round Data', ex); - } - - try{ - for( Brackets_Match__c m : this.matchList ){ - String roundExtId = this.matchSync.get( m.ExternalId__c ); - m.Brackets_Round__c = this.roundSync.get( roundExtId ); - } - upsert this.matchList ExternalId__c; - - for( Brackets_Match__c m : this.matchList ){ - followingMatchExternalId = this.matchFollowingMatchId.get(m.ExternalId__c); - if(followingMatchExternalId != null){ - followingMatch = this.matchFollowingMatchSObject.get(followingMatchExternalId); - if(followingMatch != null){ - m.FollowingBrackets_Match__c = followingMatch.Id; - } - } - } - upsert this.matchList; - - // Update predictdions points - BracketsMatchesPredictionUtil.updateUserMatchPredictionPoints(this.matchList); - - }catch( Exception ex ){ - throw new BracketsException( 'Error Importing: Please check you Mathes Data '+ex.getMessage(), ex ); - } - } - catch(Exception e){ - Database.rollback(sp); - throw new BracketsException( BracketsImportExportUtilities.FAIL_TOURNAMENT_IMPORT, e ); - } - } - - /** - * Method in charge of retrieving and compiling the Tournament data from imported file, - * for then inserting into the system. - * @param xml - */ - public void readingTournamentData( String xml ){ - - Xmlstreamreader reader = new Xmlstreamreader( xml ); - - while( reader.hasNext() ){ - if( reader.getEventType() == XmlTag.START_ELEMENT && reader.getLocalName() == 'Tournament' ){ - this.parseTournamentData( reader ); - } - if( reader.getEventType() == XmlTag.END_ELEMENT && reader.getLocalName() == 'Tournament' ){ - break; - } - reader.next(); - } - } - - /** - * Method in charge of retrieving and compiling the Rounds Data data from imported file, - * for then inserting into the system. - * @param xml - */ - private void readingRoundsData( String xml ){ - - Xmlstreamreader reader = new Xmlstreamreader( xml ); - - while( reader.hasNext() ){ - if( reader.getEventType() == XmlTag.START_ELEMENT && reader.getLocalName() == 'Round' ){ - this.parseRoundData( reader ); - } - if( reader.getEventType() == XmlTag.END_ELEMENT && reader.getLocalName() == 'Rounds' ){ - break; - } - reader.next(); - } - } - - /** - * Method in charge of retrieving and compiling the Matches Data data from imported file, - * for then inserting into the system. - * @param reader - */ - private void readingMatchesData( Xmlstreamreader reader ){ - - while( reader.hasNext() ){ - if( reader.getEventType() == XmlTag.START_ELEMENT && reader.getLocalName() == 'Match' ){ - this.parseMatchData( reader ); - } - if( reader.getEventType() == XmlTag.END_ELEMENT && reader.getLocalName() == 'Matches' ){ - break; - } - reader.next(); - } - } - - /** - * Method in charge of parsing Tournament data from XMl document - * @param reader - */ - private void parseTournamentData( Xmlstreamreader reader ){ - - this.tournament = new Brackets_Tournament__c(); - while( reader.hasNext() ){ - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'name' ){ - reader.next(); - this.tournament.Name = BracketsImportExportUtilities.getDecodedString( reader ); - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'description' ){ - reader.next(); - String descValue = BracketsImportExportUtilities.getDecodedString( reader ); - this.tournament.Description__c = ( descValue == 'null' ) ? '' : descValue ; - } - - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'version' ){ - reader.next(); - this.tournament.Version__c = Integer.valueOf( BracketsImportExportUtilities.getDecodedString( reader ) ); - } - - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'type' ){ - reader.next(); - this.tournament.Type__c = BracketsImportExportUtilities.getDecodedString( reader ); - } - - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'source' ){ - reader.next(); - this.tournament.Update_Source__c = BracketsImportExportUtilities.getDecodedString( reader ); - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'deadline' ){ - reader.next(); - String value = BracketsImportExportUtilities.getDecodedString( reader ); - if( value == 'null' ){ - - tournament.Deadline__c = null; - } - else{ - tournament.Deadline__c = Datetime.valueOfGmt( BracketsImportExportUtilities.getDecodedString( reader ) ); - } - } - - //RSC this should be id? - //if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'externalId' ){ - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'id' ){ - reader.next(); - this.tournament.ExternalId__c = BracketsImportExportUtilities.getDecodedString( reader ); - } - - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'teamCount' ){ - reader.next(); - this.tournament.TeamCount__c = Decimal.valueOf(BracketsImportExportUtilities.getDecodedString( reader )); - } - - //Validate end of tag - if( reader.getEventType() == XMLTag.END_ELEMENT && reader.getLocalName() == 'Tournament' ){ - break; - } - - reader.next(); - } - } - - /** - * Method in charge of parsing round data from XMl document - * @param reader - */ - private void parseRoundData( Xmlstreamreader reader ){ - - Brackets_Round__c round = new Brackets_Round__c(); - round.Brackets_Tournament__c = this.tournament.Id; - - while( reader.hasNext() ){ - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'name' ){ - reader.next(); - round.Name = BracketsImportExportUtilities.getDecodedString( reader ); - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'deadline' ){ - reader.next(); - String value = BracketsImportExportUtilities.getDecodedString( reader ); - if( value == 'null' ){ - round.Deadline__c = null; - } - else{ - round.Deadline__c = Datetime.valueOfGmt( BracketsImportExportUtilities.getDecodedString( reader ) ); - } - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'roundNumber' ){ - reader.next(); - round.RoundNumber__c = Decimal.valueOf( BracketsImportExportUtilities.getDecodedString( reader ) ); - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'scorePoints' ){ - reader.next(); - round.ScorePoints__c = Decimal.valueOf( BracketsImportExportUtilities.getDecodedString( reader ) ); - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'id' ){ - reader.next(); - round.ExternalId__c = BracketsImportExportUtilities.getDecodedString( reader ); - } - - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'Matches' ){ - reader.next(); - this.readingMatchesData( reader ); - } - - //Validate end of tag - if( reader.getEventType() == XMLTag.END_ELEMENT && reader.getLocalName() == 'Round' ){ - break; - } - - reader.next(); - } - - this.roundList.add( round ); - } - - /** - * Method in charge of parsing the Match data from XMl document - * @param reader - */ - private void parseMatchData( Xmlstreamreader reader ){ - - Brackets_Match__c match = new Brackets_Match__c(); - String roundExternalId; - - while( reader.hasNext() ){ - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'description' ){ - reader.next(); - String descValue = BracketsImportExportUtilities.getDecodedString( reader ); - if( descValue == 'null' ){ - match.Description__c = ''; - } - else{ - match.Description__c = descValue; - } - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'followingMatch' ){ - reader.next(); - - String followingMatch = BracketsImportExportUtilities.getDecodedString( reader ); - if( followingMatch != 'null' ){ - this.matchFollowingMatchId.put(match.ExternalId__c, followingMatch); - } - this.matchFollowingMatchSObject.put(match.ExternalId__c, match); - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'homeScore' ){ - reader.next(); - match.HomeScore__c = Decimal.valueOf( BracketsImportExportUtilities.getDecodedString( reader ) ); - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'homeTeam' ){ - reader.next(); - String homeValue = BracketsImportExportUtilities.getDecodedString( reader ); - if( homeValue == 'null' ){ - match.HomeBrackets_Team__c = null; - } - else{ - match.HomeBrackets_Team__c = this.teamList.get( homeValue ); - } - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'round' ){ - reader.next(); - roundExternalId = BracketsImportExportUtilities.getDecodedString( reader ); - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'schedule' ){ - reader.next(); - String schedule = BracketsImportExportUtilities.getDecodedString( reader ); - if( schedule == 'null' ){ - match.Schedule__c = null; - } - else{ - match.Schedule__c = Datetime.valueOfGmt( schedule ); - } - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'visitorScore' ){ - reader.next(); - match.VisitorScore__c = Decimal.valueOf( BracketsImportExportUtilities.getDecodedString( reader ) ); - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'vistitorTeam' ){ - reader.next(); - String vistitorTeam = BracketsImportExportUtilities.getDecodedString( reader ); - if( vistitorTeam == 'null' ){ - match.VisitorBrackets_Team__c = null; - } - else{ - match.VisitorBrackets_Team__c = this.teamList.get( vistitorTeam ); - } - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'winnerTeam' ){ - reader.next(); - String winnerTeam = BracketsImportExportUtilities.getDecodedString( reader ); - if( winnerTeam == 'null' ){ - match.WinnerBrackets_Team__c = null; - } - else{ - match.WinnerBrackets_Team__c = this.teamList.get( winnerTeam ); - } - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'id' ){ - reader.next(); - match.ExternalId__c = BracketsImportExportUtilities.getDecodedString( reader ); - } - - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'conference' ){ - reader.next(); - match.Conference__c = BracketsImportExportUtilities.getDecodedString( reader ); - match.Conference__c = match.Conference__c.equalsIgnoreCase('null') ? null : match.Conference__c; - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'position' ){ - reader.next(); - match.Position__c = Decimal.valueOf(BracketsImportExportUtilities.getDecodedString( reader )); - - } - if( reader.getEventType() == XMLTag.START_ELEMENT && reader.getLocalName() == 'followingIsHome' ){ - reader.next(); - match.FollowingIsHome__c = BracketsImportExportUtilities.getDecodedString( reader ) == 'true' ? true : false; - } - - - //Validate end of tag - if( reader.getEventType() == XMLTag.END_ELEMENT && reader.getLocalName() == 'Match' ){ - break; - } - - reader.next(); - } - - this.matchSync.put( match.ExternalId__c, roundExternalId ); - this.matchList.add(match); - } - - /** - * check if the xml is valid, other wise an exception is thrown. - * - * @param xml the source to be parsed. - */ - private void validate(String xml){ - Xmltag tag; - Xmlstreamreader reader = new Xmlstreamreader(xml); - //try{ - tag = reader.getEventType(); - if( tag == XmlTag.START_DOCUMENT ){ - if(reader.hasNext()){ - reader.next(); - tag = reader.getEventType(); - if( reader.getLocalName() == BracketsImportExportUtilities.ERROR_TAG){ - reader.next(); - throw new BracketsException(BracketsImportExportUtilities.getDecodedString( reader )); - } - } - } - // }catch(XmlException ex){ - // throw new BracketsException(BracketsImportExportUtilities.PARENT_TOURNAMENT_SITE_ERRORS+this.source +ex.getMessage(), ex); - //} - - } - - public static testmethod void testImport(){ - - try{ - BracketsImportTournament controller = new BracketsImportTournament(''); - controller.processImportedDocument( BracketsTestUtilities.xmlTournamentValid ); - }catch(Exception ex){ - System.assert( true ); - } - - } -} \ No newline at end of file diff --git a/src/classes/BracketsJSONObjectHandler.cls b/src/classes/BracketsJSONObjectHandler.cls deleted file mode 100644 index 4244689..0000000 --- a/src/classes/BracketsJSONObjectHandler.cls +++ /dev/null @@ -1,200 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -public with sharing class BracketsJSONObjectHandler { - - private Map fieldsSobjectMap; - private Sobject customObject; - private List customObjectList; - private String jsonString; - private List fields; - private BracketsJSONObject jsonObject; - - /** - * Constructors - */ - private BracketsJSONObjectHandler(){ - this.fields = new List(); - this.jsonObject = new BracketsJSONObject(); - } - - public BracketsJSONObjectHandler(String jsonString,Sobject obj){ - this(); - this.customObject = obj; - this.fieldsSobjectMap = obj.getSObjectType().getDescribe().fields.getMap(); - this.jsonString = jsonString; - } - - public BracketsJSONObjectHandler(List sobjectList,List fields){ - this(); - customObjectList = sobjectList; - this.fields = fields; - } - - public BracketsJSONObjectHandler(Sobject obj,List fields){ - this(); - customObject = obj; - this.fields = fields; - } - - /** - * Given a single object or a list of them ,return these in json objects. - * - * @param a json string. - */ - public String toJSON(){ - String jsonResult = ''; - if(this.customObjectList != null){ - jsonResult +='['; - if(!this.customObjectList.isEmpty()){ - for(Sobject obj : customObjectList){ - jsonResult += toJSON(obj)+ ','; - } - jsonResult = jsonResult.substring(0,jsonResult.length()-1); - } - jsonResult += ']'; - }else if(this.customObject != null){ - jsonResult = toJSON(this.customObject); - } - return jsonResult; - } - - /** - * Build a sobject populating their fields with data from a json. - * - * @return a instance of SObject - */ - public Sobject toSObject(){ - jsonObject = new BracketsJSONObject(new BracketsJSONObject.JSONTokener(jsonString)); - return toSObject(jsonObject); - } - - /** - * Build a list of sobject populating their fields with data from a json. - * - * @return a list of SObject - */ - public List toSObjectArray(){ - List sobjectList = new List(); - List valueObjects = BracketsJSONObject.JSONArray(new BracketsJSONObject.JSONTokener(jsonString)); - for(BracketsJSONObject.value value : valueObjects){ - if(value.obj != null){ - sobjectList.add(toSObject(value.obj)); - } - } - return sobjectList; - } - - /** - * Generate a Sobject from a BracketsJSONObject object. - * - * @param obj a BracketsJSONObject object. - * @return a Sobject. - */ - private Sobject toSObject(BracketsJSONObject obj){ - Sobject sobjectClone = customObject.getSObjectType().newSObject(); - for(String key : obj.keys()){ - assignValue(key, (String)obj.get(key),sobjectClone); - } - return sobjectClone; - } - - private String toJSON(Sobject obj){ - for(String attribute : fields){ - jsonObject.putOpt(attribute, new BracketsJSONObject.value(String.valueOf(obj.get(attribute)))); - } - - return jsonObject.ValuetoString(); - } - - - private void assignValue(String key, String value, Sobject obj){ - Object objValue; - Schema.Sobjectfield sobjectField; - Schema.DisplayType sobjectFieldType; - if(value != null){ - sobjectField = fieldsSobjectMap.get(key); - sobjectFieldType = sobjectField.getDescribe().getType(); - if(sobjectFieldType == Schema.DisplayType.Boolean){ - objValue = Boolean.valueOf(value); - }else if(sobjectFieldType == Schema.DisplayType.Double || - sobjectFieldType == Schema.DisplayType.Integer || - sobjectFieldType == Schema.DisplayType.Percent || - sobjectFieldType == Schema.DisplayType.Currency){ - objValue = Decimal.valueOf(value); - }else{ - objValue = String.valueOf(value); - } - obj.put(key, objValue); - } - } - - private static testMethod void testAllMethods(){ - List predictionsList; - String jsonResult; - Sobject obj; - Integer value = 25; - String fieldName = 'Points__c'; - List fields = new List{fieldName}; - Brackets_UserMatchPred__c sobjecta = new Brackets_UserMatchPred__c(); - sobjecta.Points__c = value; - - // Serializing match prediction - BracketsJSONObjectHandler handler = new BracketsJSONObjectHandler(sobjecta,fields); - jsonResult = handler.toJSON(); - - System.assert(jsonResult == '{"'+fieldName+'": "'+String.valueOf(value)+'"}'); - - // Deserializing a single match prediction - handler = new BracketsJSONObjectHandler(jsonResult,sobjecta); - obj = handler.toSObject(); - - System.assert(obj.get(fieldName) == value); - - handler.jsonString = '['+jsonResult+']'; - predictionsList = handler.toSObjectArray(); - - System.assert(predictionsList.size() == 1); - System.assert(predictionsList.get(0).get(fieldName) == value); - - predictionsList = new List(); - predictionsList.add(sobjecta); - predictionsList.add(sobjecta); - - // Deserializing a list of match predictions - - handler = new BracketsJSONObjectHandler(predictionsList,fields); - jsonResult = handler.toJSON(); - System.assert(predictionsList.get(0).get(fieldName) == value); - System.assert(predictionsList.get(1).get(fieldName) == value); - - } - - -} \ No newline at end of file diff --git a/src/classes/BracketsJoinInvitedUser.cls b/src/classes/BracketsJoinInvitedUser.cls deleted file mode 100644 index 6181cbf..0000000 --- a/src/classes/BracketsJoinInvitedUser.cls +++ /dev/null @@ -1,154 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -public with sharing class BracketsJoinInvitedUser { - - private final String UID = Userinfo.getUserId(); - private final String GID = Apexpages.currentPage().getParameters().get('gId'); - private Brackets_Tournament__c tour = new Brackets_Tournament__c(); - private Brackets_Group__c cGroup = new Brackets_Group__c(); - private Brackets_UserTournament__c uTour = new Brackets_UserTournament__c(); - public Boolean showButtons; - - /** - * Constructor - */ - public BracketsJoinInvitedUser() { } - - - /** - * Index - * @return null - */ - public Pagereference index() { - if( GID != null && GID != '' ) { - List cUserTournament = [ Select Id from Brackets_UserTournament__c where Brackets_Group__c =: GID and User__c =: UID ]; - if( cUserTournament.isEmpty() ){ - cGroup = [Select Brackets_Tournament__c, Brackets_Tournament__r.Id, Id from Brackets_Group__c where Id =: GID limit 1]; - this.tour = cGroup.Brackets_Tournament__r; - this.showButtons = true; - return null; - } - } - return this.cancel(); - } - - - public Boolean getShowButtons() { - return this.showButtons; - } - - - - /** - * Join User action - * @return pageref PageReference - */ - public Pagereference joinUser() { - - - this.uTour.Brackets_Group__c = GID; - this.uTour.Brackets_Tournament__c = this.tour.Id; - this.uTour.User__c = UID; - insert this.uTour; - - //join Chatter. - /* - Integer alreadySubscribed = [Select Count() From EntitySubscription Where SubscriberId = :UID and ParentId = :GID]; - - if (alreadySubscribed == 0) { - EntitySubscription es = new EntitySubscription(); - System.debug('UID ' + UID); - System.debug('GID ' + GID); - es.SubscriberId = UID; - es.ParentId = GID; - insert es; - } - */ - - return new Pagereference('/apex/BracketsPredictions?show='+GID); - } - - /** - * Return to HomePage - * @return pageref PageReference - */ - public Pagereference cancel(){ - return Page.BracketsPools; - } - - - /** - * Test Methods - */ - - //Test Join Successfully - public static testMethod void test(){ - //Create enviroment - Brackets_Group__c mGroup = BracketsTestUtilities.getGroup(null); - Apexpages.currentPage().getParameters().put( 'gId', mGroup.Id ); - BracketsJoinInvitedUser cTest = new BracketsJoinInvitedUser(); - Test.startTest(); - Pagereference tRef = cTest.index(); - tRef = cTest.cancel(); - tRef = cTest.joinUser(); - Test.stopTest(); - List uTour = [Select Id from Brackets_UserTournament__c where User__c =: UserInfo.getUserId() and Brackets_Group__c =: mGroup.Id]; - System.assert( !uTour.isEmpty() ); - } - - //Test Not URL parm - public static testMethod void test1(){ - //Create enviroment - Brackets_Group__c mGroup = BracketsTestUtilities.getGroup( null ); - BracketsJoinInvitedUser cTest = new BracketsJoinInvitedUser(); - Test.startTest(); - Pagereference tRef = cTest.index(); - Test.stopTest(); - List uTour = [Select Id from Brackets_UserTournament__c where User__c =: UserInfo.getUserId() and Brackets_Group__c =: mGroup.Id]; - System.assert( uTour.isEmpty() ); - } - - //Test already Join - public static testMethod void test2(){ - //Create enviroment - Brackets_Tournament__c mTour = BracketsTestUtilities.getNewStandardTournament(); - Brackets_Group__c mGroup = BracketsTestUtilities.getGroup( mTour.Id ); - Brackets_UserTournament__c uTour = BracketsTestUtilities.createUserTournament( Userinfo.getUserId() , mTour.Id, mGroup.Id ); - Apexpages.currentPage().getParameters().put( 'gId', mGroup.Id ); - - BracketsJoinInvitedUser cTest = new BracketsJoinInvitedUser(); - Test.startTest(); - Pagereference tRef = cTest.index(); - cTest.getShowButtons(); - Test.stopTest(); - List uTr = [Select Id from Brackets_UserTournament__c where User__c =: UserInfo.getUserId() and Brackets_Group__c =: mGroup.Id]; - System.assert( !uTr.isEmpty() ); - } -} \ No newline at end of file diff --git a/src/classes/BracketsMatchUtilities.cls b/src/classes/BracketsMatchUtilities.cls deleted file mode 100644 index 2172d63..0000000 --- a/src/classes/BracketsMatchUtilities.cls +++ /dev/null @@ -1,484 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -public with sharing class BracketsMatchUtilities { - - public static final String TEAM_JUST_SELECTED = 'Some of the teams have been selected for another match in this round.'; - public static final String FIRST_ROUND_NOT_COMPLETED = 'Cannot publish. All starting matches much be complete before publishing. Check your matches and start again.'; - public static Boolean SKIP_TRIGGER = false; - - /** - * Check if all statics list of Tournament and Rounds are setted; - * @params newMatchList - */ - public static void getTriggerInstance( List newMatchList ){ - BracketsTriggerUtilities.newTriggerInstance( newMatchList ); - } - - - /** - * Check if Scheduler Match is greater than its predecessors and lower than the following match - * @param matchesNew a list of matches. - */ - public static void dateMatchesValidation( List matchesNew ){ - BracketsTriggerUtilities.newTriggerInstance( matchesNew ); - Datetime mySchedule; - - - for ( Brackets_Match__c currentMatch : BracketsTriggerUtilities.triggerListObject.values() ){ - Brackets_Match__c cMatch = BracketsTriggerUtilities.triggerListObject.get( currentMatch.Id ); - Brackets_Match__c fMatch = BracketsTriggerUtilities.triggerMatchMap.get( currentMatch.FollowingBrackets_Match__c ); - - if ( fMatch != null ) { - mySchedule = fMatch.Schedule__c; - if( currentMatch.Schedule__c > mySchedule ){ - cMatch.Schedule__c.addError( 'The date of a match must be lower than its successor [successor match] ' + fMatch.id + ' [scheduled] ' + mySchedule ); - return; - } - } - for ( Brackets_Match__c verList : BracketsTriggerUtilities.triggerMatchList ) { - fMatch = BracketsTriggerUtilities.triggerListObject.get( currentMatch.Id ); - if ( verList.FollowingBrackets_Match__c == fMatch.Id) { - if( fMatch.Schedule__c < verList.Schedule__c ) { - cMatch.Schedule__c.addError( 'The date of a match must be greater than its predecessor' ); - } - } - } - } - } - - /** - * Check if teams for new matches have been assigned the another matches in the same round. - * - * @param userMatchPredictionsNew a list of matches. - */ - public static void checkExistMatchesInRound( List matchesNew ){ - - BracketsTriggerUtilities.newTriggerInstance( matchesNew ); - List matches = new List(); - Boolean homeTeamInMatch = false; - Boolean visitorTeamInMatch = false; - Brackets_Round__c roundMatchNew; - Brackets_Round__c roundMatch; - Decimal roundMatchNewNumber; - Decimal roundMatchNumber; - Decimal diffRounds; - - for( Integer j=0; j< matchesNew.size(); j++ ){ - for( Brackets_Match__c m : BracketsTriggerUtilities.triggerMatchList ) { - roundMatch = BracketsTriggerUtilities.triggerRoundMap.get(m.Brackets_Round__c); - roundMatchNew = BracketsTriggerUtilities.triggerRoundMap.get(matchesNew.get(j).Brackets_Round__c); - roundMatchNewNumber = (Decimal)roundMatch.get('RoundNumber__c'); - roundMatchNumber = (Decimal)roundMatchNew.get('RoundNumber__c'); - diffRounds = Math.abs(roundMatchNewNumber - roundMatchNumber); - if( diffRounds <=1 ){ - matches.add( BracketsTriggerUtilities.triggerMatchMap.get( m.Id ) ); - } - } - } - - // Iterate over the matches to found if the team has already been used - for( Brackets_Match__c matchNew : matchesNew ){ - for( Brackets_Match__c match: matches ){ - if( match.Id != matchNew.Id && match.Brackets_Round__c == matchNew.Brackets_Round__c){ - homeTeamInMatch = existsTeamInMatch(matchNew.HomeBrackets_Team__c, match); - visitorTeamInMatch = existsTeamInMatch(matchNew.VisitorBrackets_Team__c, match); - if(homeTeamInMatch || visitorTeamInMatch){ - System.debug('12345: [match1] ' + match.Id + ' [match2] ' + matchNew.Id + ' [team] '); - break; - } - } - } - - if(homeTeamInMatch) { - matchNew.HomeBrackets_Team__c.addError(TEAM_JUST_SELECTED); - } - else if(visitorTeamInMatch){ - matchNew.VisitorBrackets_Team__c.addError(TEAM_JUST_SELECTED); - } - } - } - - /** - * Given the winners of the matches, each one is set to the following match if exists one. - * @param matches List of new matches - */ - public static void updateFollowingMatches( List matches ){ - BracketsTriggerUtilities.newTriggerInstance( matches ); - List followingMatches = new List(); - - for( Brackets_Match__c match : matches) { - if( match.FollowingBrackets_Match__c != null && match.WinnerBrackets_Team__c != null ){ - followingMatches.add( BracketsTriggerUtilities.triggerMatchMap.get( match.FollowingBrackets_Match__c ) ); - } - } - - for( Brackets_Match__c match : BracketsTriggerUtilities.triggerListObject.values() ){ - for( Brackets_Match__c followingMatch : followingMatches ) { - if( match.FollowingBrackets_Match__c == followingMatch.Id && followingMatch.WinnerBrackets_Team__c == null ){ - if( match.FollowingIsHome__c ) { followingMatch.HomeBrackets_Team__c = match.WinnerBrackets_Team__c; } - else { followingMatch.VisitorBrackets_Team__c = match.WinnerBrackets_Team__c; } - break; - } - else{ - BracketsTriggerUtilities.triggerListObject.get( match.Id ).WinnerBrackets_Team__c.addError( 'You must remove the Teams from the next match first.' ); - return; - } - } - } - - try { - if( !followingMatches.isEmpty() ) { - BracketsMatchUtilities.SKIP_TRIGGER = true; - update followingMatches; - BracketsMatchUtilities.SKIP_TRIGGER = false; - } - } - catch( Exception e ){ - BracketsTriggerUtilities.triggerListObject.values().get(0).WinnerBrackets_Team__c.addError( e.getMessage() ); - } - - } - - /** - * Check if the Match is following of an other, if it is, the teams can not be changed or seted. - * @param matchListNew - * @param matchListOld - */ - public static void checkSetTeam( List matchListNew, List matchListOld ){ - Brackets_Match__c matchNew; - Brackets_Match__c matchOld; - - for( Integer x = 0; x < matchListOld.size(); x++ ){ - matchNew = matchListNew.get(x); - matchOld = matchListOld.get(x); - - if( (matchOld.HomeBrackets_Team__c != matchNew.HomeBrackets_Team__c ) || (matchOld.VisitorBrackets_Team__c != matchNew.VisitorBrackets_Team__c ) ){ - for( Brackets_Match__c m : BracketsTriggerUtilities.triggerMatchList ){ - if( m.FollowingBrackets_Match__c == matchOld.Id ){ - - Brackets_Round__c cRound = BracketsTriggerUtilities.triggerRoundMap.get( m.Brackets_Round__c ); - Brackets_Tournament__c cTour = BracketsTriggerUtilities.triggerTournamentMap.get( cRound.Brackets_Tournament__c ); - //System.assert(false,cRound.RoundNumber__c); - if( cTour.Type__c != BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE || cRound.RoundNumber__c != 1 ) { - matchNew.addError( 'Teams can not be changed' ); - return; - } - else{ - if( cRound.RoundNumber__c == 1 ){ - if( ( m.Position__c == 1 || m.Position__c == 3 ) && (matchOld.HomeBrackets_Team__c != matchNew.HomeBrackets_Team__c ) ){ - matchNew.addError( 'Teams can not be changed' ); - return; - } - else if( ( m.Position__c == 2 || m.Position__c == 4 ) && (matchOld.VisitorBrackets_Team__c != matchNew.VisitorBrackets_Team__c ) ){ - matchNew.addError( 'Teams can not be changed' ); - return; - } - - } - } - } - } - } - - } - } - - - /** - * When Winner team is removed from some match, we need check if the following match Winner team is also set - * so we block the update, else we need remove the team from following match - * @param matchListNew - * @param matchListOld - */ - public static void checkRemovedTeam( List matchListNew, List matchListOld ){ - BracketsTriggerUtilities.newTriggerInstance( matchListNew ); - List newList = BracketsTriggerUtilities.triggerListObject.values(); - List mList = new List(); - Brackets_Match__c matchNew; - Brackets_Match__c matchOld; - - for( Integer x = 0; x < matchListNew.size(); x++ ){ - matchNew = matchListNew.get(x); - matchOld = matchListOld.get(x); - if( !matchNew.isLocked__c && matchNew.WinnerBrackets_Team__c == null && ( matchNew.WinnerBrackets_Team__c != matchOld.WinnerBrackets_Team__c ) ) { - - //First of all, check if the follower match have WinnerTeam - Brackets_Match__c fMatch = BracketsTriggerUtilities.triggerMatchMap.get( matchOld.FollowingBrackets_Match__c ); - - if( fMatch != null && fMatch.WinnerBrackets_Team__c != null ) { - matchNew.WinnerBrackets_Team__c.addError('Team can\'t be removed because the next match have a Winner Team'); - } - - else if( fMatch != null ){ - if( fMatch.HomeBrackets_Team__c == matchOld.WinnerBrackets_Team__c ){ - fMatch.HomeBrackets_Team__c = null; - } - else{ - fMatch.VisitorBrackets_Team__c = null; - } - fMatch.VisitorScore__c = 0; - fMatch.HomeScore__c = 0; - mList.add( fMatch ); - } - } - } - if( !mList.isEmpty() ){ - BracketsMatchUtilities.SKIP_TRIGGER = true; - update mList; - BracketsMatchUtilities.SKIP_TRIGGER = false; - } - - } - - /** - * If the Winner team is set, the previous match is locked in order to avoid tournament inconsistences. - * @param mListNew - * @param oListNew - */ - public static void setWinnerTeam( List mListNew, List mListOld ){ - List lockedMatchList = new List(); - for( Integer x = 0; x < mListNew.size(); x++ ) { - if( mListNew.get( x ).WinnerBrackets_Team__c != null ) { - for ( Brackets_Match__c match : BracketsTriggerUtilities.triggerMatchList ) { - if( match.FollowingBrackets_Match__c == mListNew.get( x ).Id ){ - if( match != null) { - match.isLocked__c = true; - lockedMatchList.add( match ); - } - } - } - } - } - BracketsMatchUtilities.SKIP_TRIGGER = true; - if ( !lockedMatchList.isEmpty() ){ Database.update( lockedMatchList ); } - BracketsMatchUtilities.SKIP_TRIGGER = false; - } - - public static void checkLocked( List mListOld, List mListNew ){ - for( Integer x = 0; x < mListNew.size(); x++ ) { - if( mListOld.get( x ).isLocked__c ){ - mListNew.get( x ).addError( 'This Match can not be updated' ); - } - } - } - - - /** - * Given a team id, returns true if it is in the match, otherwise false. - * - * @param teamId - * @param match - * @return if exists the team in the match - */ - private static Boolean existsTeamInMatch(Id teamId, Brackets_Match__c match){ - return teamId != null && (teamId == match.HomeBrackets_Team__c || teamId == match.VisitorBrackets_Team__c); - } - - /** - * Method used to insert External Ids on Match objects - * @param matchList - */ - //TODO do we need this? - /* - public static void addExternalId( List matchList ){ - - for( Brackets_Match__c match : matchList ){ - if( match.ExternalId__c == null ){ - match.ExternalId__c = BracketsTournamentUtilities.generateRandomExternalId(); - } - } - } - */ - - /** - * Given one list of mathces, check if there changes in them to update the tournament. - * - * @param newMatchList a list of match sobjects - */ - public static void publishOff(List newMatchList){ - BracketsMatchUtilities.getTriggerInstance( newMatchList ); - BracketsTournamentUtilities.publishTournamentOff( BracketsTriggerUtilities.triggerTournamentList ); - } - - /** - * Check the teams for the matches of first level if they are filled. - * - * @param tournament - */ - public static void checkFirstLevelCompleted(Brackets_Tournament__c tournament,Map matches){ - Brackets_Match__c match; - Id matchFollowingId; - List matchesFirstRound = new List(); - Set allMatchesId = new Set(); - // in this set are the id with more than one reference of the match in the following match field. - Set matchesIdWithFollowging = new Set(); - // in this set are the id with no references of this match in the following match field. - Set matchesIdWithOutFollowing = new Set(); - // in this set are the id with any reference of the match in the following match field. - Set matchesIdPotencial = new Set(); - - // obtain whole the matches id from a tournament - allMatchesId.addAll(matches.keySet()); - matchesIdWithOutFollowing = allMatchesId; - - // obtain the matches id which are set as following match - for(Id matchId : matches.keySet()){ - match = matches.get(matchId); - matchFollowingId = match.FollowingBrackets_Match__c; - if(matchId != null){ - if(matchesIdPotencial.contains(matchFollowingId)){ - matchesIdWithFollowging.add(matchFollowingId); - }else{ - // in this case add the id because there's more than one reference of the match. - matchesIdPotencial.add(matchFollowingId); - } - } - } - - // obtain the matches id which are not following of any match - matchesIdWithOutFollowing.removeAll(matchesIdWithFollowging); - // obtain the matches id which are referenced one time in the followingMatch field. - matchesIdPotencial.removeAll(matchesIdWithFollowging); - for(Id matchId : matchesIdWithOutFollowing){ - match = matches.get(matchId); - matchesFirstRound.add(match); - } - - checkCompletedMatches(matchesFirstRound,matchesIdPotencial); - - } - - public static Map getMatchesMap(List matchesId){ - return new Map([select Id,ExternalId__c,HomeBrackets_Team__c,VisitorBrackets_Team__c from Brackets_Match__c where id in :matchesId]); - } - - /** - * Check if a list of matches have their teams set. - * - * @param matches a list of matches - * @param matchesIdSet a set of matches id to check both teams or not - */ - private static void checkCompletedMatches(List matches, Set matchesIdSet){ - Boolean checkCompletedMatch = true; - for(Brackets_Match__c match : matches){ - checkCompletedMatch = (matchesIdSet.contains(match.Id) && (match.HomeBrackets_Team__c != null || match.VisitorBrackets_Team__c != null)) || - (match.HomeBrackets_Team__c != null && match.VisitorBrackets_Team__c != null); - if(!checkCompletedMatch){ - break; - } - } - if(!checkCompletedMatch){ - throw new CustomException(BracketsMatchUtilities.FIRST_ROUND_NOT_COMPLETED); - } - } - - public class CustomException extends Exception {} - //------------------------------------------------------------------------- - // Test Methods - //------------------------------------------------------------------------- - - - public testmethod static void testDateMatchesValidation(){ - - Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament('Checking dates', 2); - Brackets_Round__c round = BracketsTestUtilities.createRound(tournament, 1, DateTime.now(), 3, 'First Round'); - - Brackets_Team__c homeTeam, visitorTeam; - List matches = new List{ new Brackets_Match__c(), new Brackets_Match__c(), new Brackets_Match__c() }; - - // Standard flow - matches[0].Schedule__c = DateTime.now().addDays(1); - matches[0].Brackets_Round__c = round.Id; - - matches[1].Schedule__c = DateTime.now().addDays(2); - matches[1].Brackets_Round__c = round.Id; - - matches[2].Schedule__c = DateTime.now().addDays(5); - matches[2].Brackets_Round__c = round.Id; - - insert matches; - - matches[0].FollowingBrackets_Match__c = matches[1].Id; - matches[1].FollowingBrackets_Match__c = matches[2].Id; - - upsert matches; - - matches[1].Schedule__c = DateTime.now().addDays(3); - - upsert matches; - - system.assert(matches.size() == 3); - } - - public testmethod static void testUpdateFollowingMatchesWinner(){ - Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament('Checking winners', 2); - Brackets_Round__c firstRound = BracketsTestUtilities.createRound(tournament, 1, DateTime.now(), 3, 'First Round'); - Brackets_Round__c secondRound = BracketsTestUtilities.createRound(tournament, 2, DateTime.now().addDays(5), 5, 'Second Round'); - List teams = BracketsTestUtilities.createTeamList(2); - insert teams; - - Brackets_Team__c homeTeam, visitorTeam; - List matches = new List{new Brackets_Match__c(), new Brackets_Match__c()}; - - matches[0].Brackets_Round__c = firstRound.Id; - matches[0].HomeBrackets_Team__c = teams[0].Id; - matches[0].VisitorBrackets_Team__c = teams[1].Id; - matches[1].Brackets_Round__c = secondRound.Id; - insert matches; - - matches[0].FollowingBrackets_Match__c = matches[1].Id; - matches[0].HomeScore__c = 25; - matches[0].VisitorScore__c = 24; - matches[0].WinnerBrackets_Team__c = teams[0].Id; - update matches[0]; - - Map matchesMap = new Map(); - matchesMap.put(matches[0].Id,matches[0]); - System.assert(matches[0].HomeBrackets_Team__c == matches[0].WinnerBrackets_Team__c); - - //check the first level completed for the matches[0] - try{ - checkFirstLevelCompleted(tournament,matchesMap); - System.assert(true,'This line should be executed.'); - }catch(Exception e){ - System.assert(false,'This line shouldn\'t be executed.'); - } - - matchesMap.put(matches[1].Id,matches[1]); - //check the first level completed for the whole matches - try{ - checkFirstLevelCompleted(tournament,matchesMap); - System.assert(false,'This line shouldn\'t be executed.'); - }catch(Exception e){ - System.assert(true,'This line should be executed.'); - } - - } -} \ No newline at end of file diff --git a/src/classes/BracketsMatchesPredictionUtil.cls b/src/classes/BracketsMatchesPredictionUtil.cls deleted file mode 100644 index 4ae73d9..0000000 --- a/src/classes/BracketsMatchesPredictionUtil.cls +++ /dev/null @@ -1,211 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -public with sharing class BracketsMatchesPredictionUtil { - - /** - * Upsert a list of match predictions in the database, filtering by the ones which have a predicted winner. - * - * @param a list of match predictions - */ - public static void save( List userMatchPredictions){ - List userMatchPredictionsToSave = new List(); - for(Brackets_UserMatchPred__c userMatchPrediction : userMatchPredictions){ - if(userMatchPrediction.PredictedWinnerBrackets_Team__c != null){ - userMatchPredictionsToSave.add(userMatchPrediction); - } - } - if(!userMatchPredictionsToSave.isEmpty()){ - upsert userMatchPredictionsToSave; - } - - } - - /** - * Given an json string, save the information contained in it. - * - * @param jsonString a string with json formant content. - */ - public static void saveFromJSON(String jsonString,Id UserId){ - List matchesPredictionsToUpdate; - List predictionIdListToUpdate; - List matchesIdList; - - BracketsUserMatchJSONObjectHandler handler; - - handler = new BracketsUserMatchJSONObjectHandler(); - handler.processJSON( jsonString ); - - - matchesPredictionsToUpdate = checkExistingPredictions(handler.matchesPredictionList,userId); - - // are there any predictions that - - - // update the existing matches predictions - if(!matchesPredictionsToUpdate.isEmpty()){ - update matchesPredictionsToUpdate; - } - - // insert the new matches predictions - if(!handler.matchesPredictionList.isEmpty()){ - insert handler.matchesPredictionList; - } - } - - /** - * Check if a group of user have predicted these matches, if they have been done remove from the new list and do an updation. - * - * @param userMatchPredictionsNew a list of match predictions. - */ - public static List checkExistingPredictions( List userMatchPredictionsNew,Id userId){ - Brackets_UserMatchPred__c userMatchPrediction; - Brackets_UserMatchPred__c userMatchPredictionNew; - Set matchIdSet = new Set(); - Boolean predictionIsAlreadyDone = false; - List tournamentIds = new List(); - List userMatchPredictionToUpdateList = new List(); - for(Integer j=0; j< userMatchPredictionsNew.size();){ - userMatchPredictionNew = userMatchPredictionsNew.get(j); - //check if not exist the match for this prediction - if(!matchIdSet.contains(userMatchPredictionNew.Brackets_Match__c)){ - matchIdSet.add(userMatchPredictionNew.Brackets_Match__c); - j++; - }else{ - userMatchPredictionsNew.remove(j); - } - tournamentIds.add(userMatchPredictionNew.Brackets_UserTournament__c); - } - List userMatchPredictions = [SELECT Id,Brackets_UserTournament__c,Brackets_UserTournament__r.User__c,Brackets_Match__c - FROM Brackets_UserMatchPred__c - WHERE Brackets_UserTournament__c IN: tournamentIds AND - Brackets_Match__c IN: matchIdSet AND Brackets_UserTournament__r.User__c =: userId]; - - //Iterate over Brackets_UserMatchPred__c's objects checking if the match's prediction has been done by the same user. - for(Integer i=0; i matchesForUpdate ){ - - String query; - Brackets_Match__c match; - Id winner; - Decimal scorePoints; - List predictions = new List(); - String mfuIdsArrayString = '('; - for( Brackets_Match__c mfu : matchesForUpdate ){ - mfuIdsArrayString += '\''+ mfu.Id +'\',' ; - } - if(!matchesForUpdate.isEmpty()){ - mfuIdsArrayString = mfuIdsArrayString.substring(0,mfuIdsArrayString.length()-1); - } - mfuIdsArrayString += ')'; - - - query = 'Select Id, PredictedWinnerBrackets_Team__c, Points__c, Brackets_Match__r.WinnerBrackets_Team__c,Brackets_Match__r.Brackets_Round__r.ScorePoints__c'; - query += ' From Brackets_UserMatchPred__c '; - query += ' where Brackets_Match__r.Id in '+mfuIdsArrayString+' and Brackets_Match__r.WinnerBrackets_Team__c != null'; - predictions = Database.query(query); - predictions = updatePointsMatched(predictions); - - // Save results - massUpdate(predictions,query); - - } - - public static List updatePointsMatched(List predictions){ - List predictionsToUpdate = new List(); - for(Brackets_UserMatchPred__c prediction : predictions){ - if(prediction.PredictedWinnerBrackets_Team__c == prediction.Brackets_Match__r.WinnerBrackets_Team__c){ - prediction.Points__c = prediction.Brackets_Match__r.Brackets_Round__r.ScorePoints__c; - predictionsToUpdate.add(prediction); - } - } - return predictionsToUpdate; - - } - - /** - * Check if in the context the dml rows limit are exceeded execute the dml operation in a batch context. - */ - private static void massUpdate(List predictions,String query){ - if(predictions.size()>0){ - if(predictions.size() >= Limits.getLimitDmlRows()/2){ - Database.executeBatch(new BracketsBatchUserMatchPrediction(query), Limits.getLimitDmlRows()/2); - }else{ - update predictions; - } - } - } - - /** - * Test Methods - */ - - //Test checkExistingPredictions() - private static testMethod void testCheckExistingPredictions() { - //generate Enviroment - Brackets_Tournament__c myTour = BracketsTestUtilities.getNewStandardTournament(); - Brackets_Group__c myGroup = BracketsTestUtilities.getGroup( myTour.Id ); - Brackets_UserTournament__c uTour = BracketsTestUtilities.createUserTournament( UserInfo.getUserId(), myTour.Id, myGroup.Id ); - BracketsTestUtilities.createUserMatchPrediction( myTour.Id, myGroup.Id, uTour.Id ); - List uMatchPred = [ Select u.Id, u.Brackets_UserTournament__c, u.PredictedWinnerBrackets_Team__c, u.Brackets_Match__r.HomeBrackets_Team__c, u.Brackets_Match__c - From Brackets_UserMatchPred__c u where u.Brackets_UserTournament__c =: uTour.Id ]; - - BracketsMatchesPredictionUtil.checkExistingPredictions( uMatchPred, Userinfo.getUserId() ); - System.assert( myTour != null ); - - BracketsMatchesPredictionUtil.save(uMatchPred); - } -} \ No newline at end of file diff --git a/src/classes/BracketsPoolController.cls b/src/classes/BracketsPoolController.cls deleted file mode 100644 index 663a2d5..0000000 --- a/src/classes/BracketsPoolController.cls +++ /dev/null @@ -1,130 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -public with sharing class BracketsPoolController { - - public List groups {get; set;} - public static Boolean showInvite {get; set;} - - - public BracketsPoolController(){ - this.groups = new List(); - for(Brackets_Group__c groupy : BracketsGroupUtilities.getGroups( Userinfo.getUserId())){ - this.groups.add(new GroupWrap(groupy)); - } - } - - - - public class GroupWrap { - public Boolean hasUserTournaments { get; set; } - public Brackets_Group__c groupp { get; set; } - public URLLink link { get; set; } - - public GroupWrap( Brackets_Group__c groupp ){ - this.groupp = groupp; - this.link = null; - hasUserTournaments = BracketsGroupUtilities.hasUserTournament( this.groupp ); - - - if( this.groupp.Status__c != 'Closed' ){ - - if( hasUserTournaments ) { - this.link = new URLLink('Manage','BracketsMatchesPrediction?show='+groupp.Id); - } - else { - //refactoring - this.link = new URLLink('Click Here to Join', '' ); - } - } - - } - - - public String getStatus(){ - String resultStatus; - if(hasUserTournaments){ resultStatus = 'Joined'; } - else { resultStatus = this.groupp.Status__c; } - return resultStatus; - } - - } - - public Boolean getCanCreate(){ - return BracketsPoolController.checkObjectCrud('Brackets_Group__c'); - } - - - /** - * Check over object if the loged User has rights - * @parms sObject - * @return Boolean - */ - public static Boolean checkObjectCrud( String objName ){ - Schema.DescribeSObjectResult oResult = Schema.getGlobalDescribe().get( objName ).getDescribe(); - return oResult.isCreateable(); - } - - public PageReference createNewPool(){ - return new PageReference('/'+Schema.Brackets_Group__c.SObjectType.getDescribe().getKeyPrefix()+'/e' ); - } - - - public class URLLink{ - public String name {get;set;} - public String value {get;set;} - public URLLink( String name, String value ) { - this.name = name; - this.value = value; - } - } - - - - private static testMethod void testTournamentTypes(){ - delete [select Id from Brackets_Group__c]; - Brackets_Tournament__c myTour = BracketsTestUtilities.getNewStandardTournament(); - Brackets_Group__c myOpenedGroup = BracketsTestUtilities.getGroup( myTour.Id ); - upsert myOpenedGroup; - Brackets_Group__c myClosedGroup = BracketsTestUtilities.getClosedGroup(myTour.Id); - Brackets_UserTournament__c uTour = BracketsTestUtilities.createUserTournament( UserInfo.getUserId(), myTour.Id, myOpenedGroup.Id ); - BracketsTestUtilities.createUserMatchPrediction( myTour.Id, myOpenedGroup.Id, uTour.Id ); - BracketsPoolController controller = new BracketsPoolController(); - Boolean testBool = controller.getCanCreate(); - PageReference testPage = controller.createNewPool(); - testBool = BracketsPoolController.checkObjectCrud('Brackets_Group__c'); - - GroupWrap innerClass = new GroupWrap( myOpenedGroup ); - String testStr = innerClass.getStatus(); - innerClass.hasUserTournaments = true; - testStr = innerClass.getStatus(); - - System.assert(controller.groups.size() == 2,'The number of groups should be two.'); - } -} \ No newline at end of file diff --git a/src/classes/BracketsPredictionsController.cls b/src/classes/BracketsPredictionsController.cls deleted file mode 100644 index 6805a7e..0000000 --- a/src/classes/BracketsPredictionsController.cls +++ /dev/null @@ -1,552 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -public with sharing class BracketsPredictionsController { - public Boolean showTree { get; set; } - public String singleRound { get; set; } - public String targetPool { get; set; } - public Brackets_UserTournament__c target {get; set; } - - public String json { get; set; } - public String message { get; set; } - public String messageType { get; set; } - - public Boolean hideDialog { get; set; } - - //pool type -- - public Boolean isFullTournament { get; set; } - - //might be locked for any number of reasons - public Boolean isLocked { get; set; } - - //useful for both full tournament and round by round pools - public Datetime nextDeadline { get; set; } - public String formattedNextDeadline { get; set; } - - //for round by round pools, it indicates the active round - public Integer activeRound { get; set; } - - //for viewing another person's predictions - public Id targetUserTournament { get; set; } - public String userTournamentUser { get; set; } - - - /** - * Constructor - */ - public BracketsPredictionsController() { - - targetPool = Apexpages.currentPage().getParameters().get( 'show' ); - if (targetPool == null) { - targetUserTournament = Apexpages.currentPage().getParameters().get( 'view' ); - } - showTree = false; - List userTournaments = this.userJoinedPools(); - this.singleRound = null; - if( userTournaments.size() == 1 ){ - target = userTournaments.get(0); - targetPool = target.Brackets_Group__c; - this.singleRound = target.Brackets_Group__c; - initNextDeadline(); - if (targetUserTournament == null) { - - BracketsSettings2__c settings = BracketsSettings2__c.getInstance(UserInfo.getUserId()); - if (settings != null) { - hideDialog = settings.Hide_Help_Dialog__c; - } - showTree = true; - } else { - if (this.isLocked) { - showTree = true; - } else { - this.message = 'Cannot view a prediction tree before the deadline.'; - showTree = false; - } - this.userTournamentUser = target.User__r.Name; - hideDialog = true; - } - - } - - - } - - - public PageReference goToPoolList(){ - return Page.BracketsPools; - } - - public PageReference gotoPoolDetail(){ - return new ApexPages.Pagereference('/'+targetPool); - } - - /** - * Get the User joined Pools - * @return UserTournament List - */ - public List userJoinedPools(){ - List userTournaments = null; - - if (targetPool == null && targetUserTournament == null) { - userTournaments = [Select Id, Brackets_Group__c, Brackets_Group__r.TournamentType__c, Brackets_Group__r.Name, Brackets_Group__r.Type__c, Brackets_Tournament__r.Name, Brackets_Tournament__r.Deadline__c, Championship_Point_Prediction__c from Brackets_UserTournament__c where User__c =: Userinfo.getUserId() ]; - } else if (targetUserTournament != null && targetPool == null) { - userTournaments = [Select Id, Brackets_Group__c, Brackets_Group__r.TournamentType__c, Brackets_Group__r.Name, Brackets_Group__r.Type__c, Brackets_Tournament__r.Name, Brackets_Tournament__r.Deadline__c, User__r.Name, Championship_Point_Prediction__c from Brackets_UserTournament__c where Id =: targetUserTournament ]; - } else { - userTournaments = [Select Id, Brackets_Group__c, Brackets_Group__r.TournamentType__c, Brackets_Group__r.Name, Brackets_Group__r.Type__c, Brackets_Tournament__r.Name, Brackets_Tournament__r.Deadline__c, Championship_Point_Prediction__c from Brackets_UserTournament__c where Brackets_Group__c =: targetPool and User__c =: Userinfo.getUserId() ]; - } - - return userTournaments; - } - - /** - * Parse string and save predictions - */ - public PageReference saveAllPred(){ - - PageReference page = null; - - if (!isLocked) { - try { - if (this.json.length() > 0) { - BracketsMatchesPredictionUtil.saveFromJSON( this.json ,Userinfo.getUserId()); - } - System.debug('12345'+target); - update target; - //init(); - this.message = 'All your predictions has been saved successfully!!'; - this.messageType = 'success'; - page = new PageReference('/apex/BracketsMatchesPrediction?show='+this.targetPool); - page.setRedirect(true); - } - catch( Exception e ) { - System.debug('exception1:' + e); - this.message = e.getMessage(); - this.messageType = 'error'; - } - } else { - this.messageType = 'locked'; - this.message = 'Predictions are currently locked.'; - } - - updateHideDialog(); - - return null; - //return page; - } - - public void initNextDeadline() { - - isLocked = false; - - if (target.Brackets_Group__r.Type__c == BracketsGroupUtilities.BET_TYPE_FULL_TOURNAMENT) { - isFullTournament = true; - nextDeadline = target.Brackets_Tournament__r.Deadline__c; - if (nextDeadline < Datetime.now()) { - isLocked = true; - } - } else { - //figure out the next deadline based on - isFullTournament = false; - List rounds = [Select Id, Name, Deadline__c, RoundNumber__c From Brackets_Round__c Where Brackets_Tournament__c =: target.Brackets_Tournament__c AND Deadline__c >: Datetime.now() LIMIT 1]; - if (rounds.size() == 0) { - isLocked = true; - } else { - Brackets_Round__c r = rounds.get(0); - nextDeadline = r.Deadline__c; - activeRound = Integer.valueOf(''+r.RoundNumber__c); - } - } - - //we should have a deadline and if we don't that's problematic - if (!isLocked && nextDeadline == null) { - throw new BracketsException('Unable to initialize the next deadline. For Full Tournament pools, this is on the Tournament Object. For Round By Round pools, this is on the individual Round.'); - } - - if (isLocked) { - formattedNextDeadline = 'Locked'; - } else { - //get the current users' timezone setting - User current = [Select Id, TimeZoneSidKey From User Where Id =: UserInfo.getUserId()]; - //now make sure the deadline is in the current users' Z - formattedNextDeadline = nextDeadline.format('EEE, d MMM yyyy HH:mm a', current.TimeZoneSidKey); - } - - } - - public void updateHideDialog() { - - System.debug('Update Hide Dialog' + this.hideDialog); - - if (this.hideDialog == null) { - this.hideDialog = false; - } - - BracketsSettings2__c settings = BracketsSettings2__c.getInstance(UserInfo.getUserId()); - if (settings == null) { - settings = new BracketsSettings2__c(); - settings.Name = UserInfo.getUserId(); - - } - settings.Hide_Help_Dialog__c = this.hideDialog; - upsert settings; - - } - - public String getLastChatterUpdate() { - - String ret = new BracketsFeedItemUtility().getLastTournamentGroupChatter(target.Brackets_Group__c,75); - - if (ret == '') { - ret = 'No updates yet - be the first!'; - } - return ret; - } - - private static testMethod void testPredictionController(){ - - BracketsTournamentUtilities.CreatingTournamentTree = true; - - //Create a user - User testUser = BracketsTestUtilities.createUser(); - - System.runAs(testUser) { - - //test that we get a !showTree when there are no user predictions - BracketsPredictionsController controller = new BracketsPredictionsController(); - System.assert(!controller.showTree); - - Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament('Test1 General Prediction Controller', 4); - - Brackets_Group__c groupp = BracketsTestUtilities.getGroup(tournament.Id); - Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); - Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team'); - - List auxList = new List(); - auxList.add( teamA ); - auxList.add( teamB ); - upsert auxList; - - Brackets_Round__c round = BracketsTestUtilities.createRound(tournament,1, null,4,'Round1-Test'); - - Brackets_Match__c match = BracketsTestUtilities.createMatch(teamA, teamB, round, BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN); - round.Deadline__c = match.schedule__c.addMinutes(-5); - update round; - - Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament(Userinfo.getUserId(), tournament.Id, groupp.Id); - - //single user tournament so it should automatically show tree - controller = new BracketsPredictionsController(); - System.assert(controller.showTree); - - //multi user tournament so it should problem for which tournament to show - Brackets_Group__c groupp2 = BracketsTestUtilities.getGroup(tournament.Id); - Brackets_UserTournament__c userTournament2 = BracketsTestUtilities.createUserTournament(Userinfo.getUserId(), tournament.Id, groupp2.Id); - controller = new BracketsPredictionsController(); - System.assert(!controller.showTree); - - //multi user tournament with show parameter - ApexPages.currentPage().getParameters().put('show', groupp.Id); - controller = new BracketsPredictionsController(); - System.assert(controller.showTree); - - //multi user tournament with a deadline that is before now and should be locked - tournament.Deadline__c = Datetime.now().addMinutes(-1); - update tournament; - ApexPages.currentPage().getParameters().put('show', groupp.Id); - controller = new BracketsPredictionsController(); - System.assert(controller.showTree); - System.assert(controller.isLocked); - - //a couple of Booleans - System.assert(controller.activeRound == null); - System.assert(controller.isFullTournament); - - - - } - - } - - - - public testmethod static void testSaveAllPred(){ - - BracketsTournamentUtilities.CreatingTournamentTree = true; - - - Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament('Test1 RoundByRound', 4); - - Brackets_Group__c groupp = BracketsTestUtilities.getGroup(tournament.Id); - Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); - Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team'); - - List auxList = new List(); - auxList.add( teamA ); - auxList.add( teamB ); - upsert auxList; - - Brackets_Round__c round = BracketsTestUtilities.createRound(tournament,1, null,4,'Round1-Test'); - - Brackets_Match__c match = BracketsTestUtilities.createMatch(teamA, teamB, round, BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN); - round.Deadline__c = match.schedule__c.addMinutes(-5); - update round; - - Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament(Userinfo.getUserId(), tournament.Id, groupp.Id); - - String jsonString = '{ "0" : { "matchId" : "'+match.Id+'" ,"userTour" : "'+userTournament.Id+'", "teamId" : "'+teamA.Id+'" , "userPred" : "" }}'; - - - ApexPages.currentPage().getParameters().put('show', groupp.Id); - - BracketsPredictionsController controller = new BracketsPredictionsController(); - - controller.json = jsonString; - controller.saveAllPred(); - - - System.assert(controller.messageType == 'success','The result of save the prediction should be sucessful. message is : ' + controller.messageType ); - } - - - //makes sure all the first round stuff works - public testmethod static void testRoundByRoundOne() { - - BracketsTournamentUtilities.CreatingTournamentTree = true; - //Create a user - User testUser = BracketsTestUtilities.createUser(); - - System.runAs(testUser) { - - - Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament('Test1 RoundByRound', 4); - - Brackets_Group__c groupp = BracketsTestUtilities.getGroup(tournament.Id, BracketsGroupUtilities.BET_TYPE_BY_ROUND); - - Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); - Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team'); - Brackets_Team__c teamC = BracketsTestUtilities.createTeam('C-Team'); - Brackets_Team__c teamD = BracketsTestUtilities.createTeam('D-Team'); - - List auxList = new List(); - auxList.add( teamA ); - auxList.add( teamB ); - auxList.add( teamC ); - auxList.add( teamD ); - upsert auxList; - - - Brackets_Round__c round = BracketsTestUtilities.createRound(tournament,1, null,4,'Round1-Test'); - - Brackets_Round__c round2 = BracketsTestUtilities.createRound(tournament,2, null,8,'Round2-Test'); - - - Brackets_Match__c match = BracketsTestUtilities.createMatch(teamA, teamB, round, BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN); - - Brackets_Match__c match2 = BracketsTestUtilities.createMatch(teamC, teamD, round, BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN); - - round.Deadline__c = match.schedule__c.addMinutes(-5); - update round; - - Brackets_Match__c match3 = BracketsTestUtilities.createMatch(null, null, round2, BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN); - round2.Deadline__c = match3.schedule__c.addMinutes(-5); - update round2; - - - Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament(Userinfo.getUserId(), tournament.Id, groupp.Id); - - ApexPages.currentPage().getParameters().put('show', groupp.Id); - BracketsPredictionsController controller = new BracketsPredictionsController(); - System.assert(controller.showTree); - System.assert(!controller.isLocked); - - System.debug('\n\nNextDeadline: ' + controller.nextDeadline + ' but the round deadline is ' + round.Deadline__c); - System.assert(round.Deadline__c.format() == controller.nextDeadline.format()); - - System.assert(!controller.isFullTournament); - System.assert(controller.activeRound == Integer.valueOf(''+round.RoundNumber__c)); - - } - } - - //makes sure all the second round stuff workds - public testmethod static void testRoundByRoundTwo() { - - BracketsTournamentUtilities.CreatingTournamentTree = true; - //Create a user - User testUser = BracketsTestUtilities.createUser(); - - System.runAs(testUser) { - - - Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament('Test1 RoundByRound', 4); - tournament.deadline__c = tournament.deadline__c.addMinutes(-60); - update tournament; - - Brackets_Group__c groupp = BracketsTestUtilities.getGroup(tournament.Id, BracketsGroupUtilities.BET_TYPE_BY_ROUND); - - Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); - Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team'); - Brackets_Team__c teamC = BracketsTestUtilities.createTeam('C-Team'); - Brackets_Team__c teamD = BracketsTestUtilities.createTeam('D-Team'); - - List auxList = new List(); - auxList.add( teamA ); - auxList.add( teamB ); - auxList.add( teamC ); - auxList.add( teamD ); - upsert auxList; - - - Brackets_Round__c round = BracketsTestUtilities.createRound(tournament,1, null,4,'Round1-Test'); - - Brackets_Round__c round2 = BracketsTestUtilities.createRound(tournament,2, null,8,'Round2-Test'); - - - Brackets_Match__c match = BracketsTestUtilities.createMatch(teamA, teamB, round, BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN); - match.Schedule__c = Datetime.now().addMinutes(-30); - update match; - - Brackets_Match__c match2 = BracketsTestUtilities.createMatch(teamC, teamD, round, BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN); - match2.Schedule__c = Datetime.now().addMinutes(-30); - update match2; - - round.Deadline__c = match.schedule__c.addMinutes(-5); - update round; - - Brackets_Match__c match3 = BracketsTestUtilities.createMatch(null, null, round2, BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN); - round2.Deadline__c = match3.schedule__c.addMinutes(-5); - update round2; - - - Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament(Userinfo.getUserId(), tournament.Id, groupp.Id); - - ApexPages.currentPage().getParameters().put('show', groupp.Id); - BracketsPredictionsController controller = new BracketsPredictionsController(); - System.assert(controller.showTree); - System.assert(!controller.isLocked); - - System.debug('\n\nNextDeadline: ' + controller.nextDeadline + ' but the round deadline is ' + round.Deadline__c); - System.assert(round2.Deadline__c.format() == controller.nextDeadline.format()); - - System.assert(!controller.isFullTournament); - System.assert(controller.activeRound == Integer.valueOf(''+round2.RoundNumber__c)); - - - } - - - - } - - - //makes sure everything shows as locked. - public testmethod static void testRoundByRoundThree() { - - BracketsTournamentUtilities.CreatingTournamentTree = true; - //Create a user - User testUser = BracketsTestUtilities.createUser(); - - System.runAs(testUser) { - - - Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament('Test1 RoundByRound', 4); - tournament.deadline__c = tournament.deadline__c.addMinutes(-60); - update tournament; - - Brackets_Group__c groupp = BracketsTestUtilities.getGroup(tournament.Id, BracketsGroupUtilities.BET_TYPE_BY_ROUND); - - Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); - Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team'); - Brackets_Team__c teamC = BracketsTestUtilities.createTeam('C-Team'); - Brackets_Team__c teamD = BracketsTestUtilities.createTeam('D-Team'); - - List auxList = new List(); - auxList.add( teamA ); - auxList.add( teamB ); - auxList.add( teamC ); - auxList.add( teamD ); - upsert auxList; - - - Brackets_Round__c round = BracketsTestUtilities.createRound(tournament,1, null,4,'Round1-Test'); - - Brackets_Round__c round2 = BracketsTestUtilities.createRound(tournament,2, null,8,'Round2-Test'); - - - Brackets_Match__c match = BracketsTestUtilities.createMatch(teamA, teamB, round, BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN); - match.Schedule__c = Datetime.now().addMinutes(-45); - update match; - - Brackets_Match__c match2 = BracketsTestUtilities.createMatch(teamC, teamD, round, BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN); - match2.Schedule__c = Datetime.now().addMinutes(-45); - update match2; - - round.Deadline__c = match.schedule__c.addMinutes(-5); - update round; - - Brackets_Match__c match3 = BracketsTestUtilities.createMatch(null, null, round2, BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN); - match3.Schedule__c = Datetime.now().addMinutes(-30); - update match3; - - round2.Deadline__c = match3.schedule__c.addMinutes(-5); - update round2; - - - Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament(Userinfo.getUserId(), tournament.Id, groupp.Id); - - ApexPages.currentPage().getParameters().put('show', groupp.Id); - BracketsPredictionsController controller = new BracketsPredictionsController(); - System.assert(controller.showTree); - - System.debug('\n\nNextDeadline: ' + controller.nextDeadline + ' but the round deadline is ' + round.Deadline__c); - System.assert(controller.nextDeadline == null); - System.assert(controller.isLocked); - - System.assert(!controller.isFullTournament); - System.assert(controller.activeRound == null); - - } - - - - } - - static testmethod void testSimplePageRefs() { - - BracketsPredictionsController c = new BracketsPredictionsController(); - - Pagereference p1 = c.gotoPoolDetail(); - - System.assert(p1 != null); - - Pagereference p2 = c.goToPoolList(); - - System.assert(p2 != null); - } -} \ No newline at end of file diff --git a/src/classes/BracketsProccessUpdate.cls b/src/classes/BracketsProccessUpdate.cls deleted file mode 100644 index aff1cf1..0000000 --- a/src/classes/BracketsProccessUpdate.cls +++ /dev/null @@ -1,160 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -public with sharing class BracketsProccessUpdate { - - private Brackets_Tournament__c tourament; - private String xmlTournamentReceived; - - /** - * Constructor Manual Update - * - * @param tournamentId - */ - public BracketsProccessUpdate( Id tournamentId ){ - this.processManualUpdate( tournamentId ); - } - - /** - * Constructor Manual Import - * - * @param Source - */ - public BracketsProccessUpdate( String source ){ - this.tourament = new Brackets_Tournament__c(); - this.tourament.Update_Source__c = source; - this.getTournamentUpdate(); - BracketsImportTournament itProcess = new BracketsImportTournament(source); - itProcess.processImportedDocument( xmlTournamentReceived ); - - } - - /** - * Process multiple update of tournaments - * - * @param tournamentsList a list of tournament - */ - public static void proccessMultipleUpdate(List tournamentsList){ - for( Brackets_Tournament__c tournament : tournamentsList){ - processSingleUpdate((String)tournament.Update_Source__c); - } - } - - /** - * Process a single update - * - * @param source the url to import the recent data from a tournament - */ - @future(callout=true) - public static void processSingleUpdate(String source){ - try{ - new BracketsProccessUpdate( source ); - }catch(Exception e){ - } - } - - /** - * Get the XML from the URL saved on Tournament Object - */ - private void getTournamentUpdate() { - try{ - String uSource = this.tourament.Update_Source__c; - HttpRequest req = new HttpRequest(); - req.setEndpoint( uSource ); - req.setMethod('GET'); - Http http = new Http(); - HTTPResponse res = http.send( req ); - xmlTournamentReceived = res.getBody(); - - } - catch( Calloutexception ex ) { - throw new BracketsException(ex.getMessage(), ex); - } - } - - - /** - * Proccess the Manual Update - * - * @param tournamentId - */ - private void processManualUpdate( Id tournamentId ){ - //Get the Tournament by Tournament Id - this.tourament = [Select t.Update_Source__c, t.TeamCount__c, t.Start__c, t.Name, t.MaxRoundNumber__c, t.Id, t.ExternalId__c, t.End__c, t.Description__c - From Brackets_Tournament__c t - where t.Id =: tournamentId ]; - this.getTournamentUpdate(); - //this.synchronizeUserStatisticSend(); - BracketsImportTournament itProcess = new BracketsImportTournament( (String)tourament.Update_Source__c ); - itProcess.processImportedDocument( xmlTournamentReceived ); - } - - - public static testMethod void test2(){ - Brackets_Tournament__c myTour = BracketsTestUtilities.createFullTournament( 2, BracketsTournamentUtilities.DEFAULT_TOURNAMENT_TYPE ); - myTour.isChild__c = true; - myTour.Update_Source__c = 'http://www.salesforce.com'; - update myTour; - List myTourList = new List{ myTour }; - - Test.startTest(); - BracketsProccessUpdate cTest = new BracketsProccessUpdate( myTour.Id ); - - System.assert( cTest.tourament != null ); - Test.stopTest(); - } - - public static testMethod void test3(){ - Brackets_Tournament__c myTour = BracketsTestUtilities.createFullTournament( 2, BracketsTournamentUtilities.DEFAULT_TOURNAMENT_TYPE ); - myTour.isChild__c = true; - myTour.Update_Source__c = 'http://www.salesforce.com'; - update myTour; - List myTourList = new List{ myTour }; - - Test.startTest(); - BracketsProccessUpdate.processSingleUpdate(myTour.Update_Source__c); - System.assert( myTour != null ); - Test.stopTest(); - } - - public static testMethod void test4(){ - Brackets_Tournament__c myTour = BracketsTestUtilities.createFullTournament( 2, BracketsTournamentUtilities.DEFAULT_TOURNAMENT_TYPE ); - myTour.isChild__c = true; - myTour.Update_Source__c = 'http://www.salesforce.com'; - update myTour; - List myTourList = new List{ myTour }; - - Test.startTest(); - BracketsProccessUpdate.proccessMultipleUpdate( myTourList ); - System.assert( myTour != null ); - Test.stopTest(); - } - - -} \ No newline at end of file diff --git a/src/classes/BracketsRoundUtilities.cls b/src/classes/BracketsRoundUtilities.cls deleted file mode 100644 index e5d0b44..0000000 --- a/src/classes/BracketsRoundUtilities.cls +++ /dev/null @@ -1,163 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -public with sharing class BracketsRoundUtilities { - - - public static final String roundAfterDeadline = 'The current deadline is after previous rounds'; - public static final String roundBeforeDeadline = 'The current deadline is before following rounds'; - public static final String roundNameUnique = 'The round name must be unique in a tournament.'; - - /** - * Set the RoundNumber__c - * @parms insertedRounds : A list of inserted rounds for this tournament - */ - public static void roundNumberOnInsert( List insertedRounds ){ - - System.debug('\n\n***RoundNumberOnInsert'); - List roundTournamentIds = new List(); - Map tournamentRounds = new Map(); - Double iter; - for( Brackets_Round__c nRound : insertedRounds ){ - if( nRound.Brackets_Tournament__c != null ){ - roundTournamentIds.add( nRound.Brackets_Tournament__c ); - } - } - - Map tournaments = new Map( [Select MaxRoundNumber__c from Brackets_Tournament__c where Id IN: roundTournamentIds ] ); - System.debug('\n\n***Tournaments ' + tournaments); - Map auxMap = new Map(); - - for( Brackets_Round__c nRound : insertedRounds ) { - if( auxMap.get( nRound.Brackets_Tournament__c ) == null ) { - auxMap.put( nRound.Brackets_Tournament__c, 1 ); - } - - iter = ( tournaments.get( nRound.Brackets_Tournament__c ).MaxRoundNumber__c == null) ? 0 : tournaments.get( nRound.Brackets_Tournament__c ).MaxRoundNumber__c ; - - nRound.RoundNumber__c = iter + auxMap.get( nRound.Brackets_Tournament__c ); - auxMap.put( nRound.Brackets_Tournament__c, auxMap.get( nRound.Brackets_Tournament__c ) + 1 ); - } - } - - /** - * Method used to insert External Ids on Round objects - * @param roundList : A list of Rounds to set the ExtrenalId - */ - //RSC Do we need this? - /* - public static void addExternalId( List roundList ){ - - for( Brackets_Round__c round : roundList ){ - if( round.ExternalId__c == null ){ - round.ExternalId__c = BracketsTournamentUtilities.generateRandomExternalId(); - } - } - } - */ - - /** - * Check the integrity between rounds of the same tournaments - * - * @param roundListToCheck a list of rounds. - */ - public static void checkRoundsIntegrity(List roundListToCheck){ - - System.debug('CheckRoundsIntegrityRSC'); - - List roundList = new List(); - List tournamentIds = new List(); - - for( Brackets_Round__c round : roundListToCheck ){ - tournamentIds.add(round.Brackets_Tournament__c); - } - - List existingRounds = [select Deadline__c,RoundNumber__c,Name,Brackets_Tournament__c - from Brackets_Round__c where Brackets_Tournament__c in : tournamentIds order by RoundNumber__c asc]; - - for( Brackets_Round__c currentExisting : existingRounds){ - for( Brackets_Round__c newRound : roundListToCheck ){ - - if (newRound.Id != currentExisting.Id) { - // check round name is unique per tournament - Boolean roundNameIsNotUnique = currentExisting.Brackets_Tournament__c == newRound.Brackets_Tournament__c && - (newRound.Name == currentExisting.Name); - // check current deadline is before to previous rounds. - Boolean roundAfter = currentExisting.Brackets_Tournament__c == newRound.Brackets_Tournament__c - && (newRound.RoundNumber__c < currentExisting.RoundNumber__c && newRound.Deadline__c > currentExisting.Deadline__c); - - // check current deadline is after to following rounds. - Boolean roundBefore = currentExisting.Brackets_Tournament__c == newRound.Brackets_Tournament__c - && (newRound.RoundNumber__c > currentExisting.RoundNumber__c && newRound.Deadline__c < currentExisting.Deadline__c); - - if(roundAfter){ - System.debug('\n\n\nRoundAfter'); - System.debug('currentExisting: ' + currentExisting); - System.debug('newRound: ' + newRound); - newRound.Deadline__c.addError(roundAfterDeadline); - } - - if(roundBefore){ - System.debug('\n\nSurprise here I am roundbefore'); - System.debug('\n\n\nDeadlineXX ToCheck ' + newRound.Deadline__c); - System.debug('Identifying the roundToCheck ' + newRound.name); - - System.debug('\n\n\nDeadlineXX Round' + currentExisting.Deadline__c); - System.debug('Identifying the round ' + currentExisting.name); - newRound.Deadline__c.addError(roundBeforeDeadline); - } - - if(roundNameIsNotUnique){ - newRound.Name.addError(roundNameUnique); - } - } - } - } - } - - /** - * Given a list of rounds, check if there changes in them to update the tournament. - * - * @param newRoundList a list of match sobjects - */ - public static void publishOff(List newRoundList){ - List tournamentIdList = new List(); - List roundIdList = new List(); - for(Brackets_Round__c round : newRoundList){ - roundIdList.add(round.Id); - } - for(Brackets_Round__c round : [select Id,Brackets_Tournament__c from Brackets_Round__c where - Brackets_Tournament__r.isChild__c = false and Id in:roundIdList]){ - tournamentIdList.add(round.Brackets_Tournament__c); - } - - List tournamentList = [select Id,Allow_Update__c from Brackets_Tournament__c where Id in:tournamentIdList]; - BracketsTournamentUtilities.publishTournamentOff(tournamentList); - } -} \ No newline at end of file diff --git a/src/classes/BracketsSitesTournamentPublisher.cls b/src/classes/BracketsSitesTournamentPublisher.cls deleted file mode 100644 index 40eb129..0000000 --- a/src/classes/BracketsSitesTournamentPublisher.cls +++ /dev/null @@ -1,256 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -public with sharing class BracketsSitesTournamentPublisher { - - private Brackets_Tournament__c tournament; - - public BracketsSitesTournamentPublisher (){ - this.tournament = this.getTournament(); - } - - - /** - * Retrive last update from the refered tournament - * @return oXml : Returns the XML Body; - */ - public String getOutputXml() { - String result; - if(this.tournament.Id == null){ - System.debug('1234 is null'); - result = this.getXmlError(); - }else{ - System.debug('1234tournament id is not null'); - result = this.getTournamentXml(); - } - return result; - } - - - /** - * Get Brackets_Tournament__c object - * @return tournament - */ - private Brackets_Tournament__c getTournament() { - Brackets_Tournament__c ret = [ Select t.TeamCount__c, t.Start__c, t.Name, t.Id, t.ExternalId__c, t.End__c, t.Description__c, - t.Version__c, t.Allow_Update__c, t.Update_Source__c, t.Type__c, Deadline__c - From Brackets_Tournament__c t - where Id =: this.getTournamentId() ]; - - System.debug('1234 allow update ' + ret.Allow_Update__c); - - return ret; - } - - - /** - * Return an Error - * @return oXml - */ - private String getXmlError(){ - Xmlstreamwriter oXml = new Xmlstreamwriter(); - oXml.writeStartElement( null, BracketsImportExportUtilities.ERROR_TAG, null ); - oXml.writeCharacters(BracketsImportExportUtilities.MISSING_TOURNAMENT); - oXml.writeEndElement(); - oXml.writeEndDocument(); - return oXml.getXmlString(); - } - - /** - * Check if exist an parameter json in the headers - */ - private Boolean hasUserStatistic(){ - return Apexpages.currentPage().getHeaders().get('json') != null; - } - - - /** - * Method in charge of compiling XML document - * @return ret : Write a XML Body then return it - */ - private String getTournamentXml(){ - Xmlstreamwriter out = new Xmlstreamwriter(); - out.writeStartDocument(null, '1.0'); - System.debug('1234 allow update ' + tournament.Allow_Update__c + ' and version ' + tournament.Version__c); - if( tournament.Allow_Update__c && tournament.Version__c > this.getClientVersion() ) { - - - BracketsExportTeams expTeams = new BracketsExportTeams( tournament.Id, out ); - out.writeStartElement( null, 'export', null ); - out = expTeams.BracketsexportTeams(); - - out.writeStartElement( null, 'Tournament', null ); - - BracketsImportExportUtilities.writeElement( out, 'id', '' + tournament.Id ); - //RSC do we need this? - //BracketsImportExportUtilities.writeElement( out, 'externalId', '' + tournament.ExternalId__c ); - BracketsImportExportUtilities.writeElement( out, 'name', '' + tournament.Name ); - BracketsImportExportUtilities.writeElement( out, 'description', '' + tournament.Description__c ); - BracketsImportExportUtilities.writeElement( out, 'teamCount', '' + String.valueOf( tournament.TeamCount__c ) ); - BracketsImportExportUtilities.writeElement( out, 'version', '' + tournament.Version__c ); - BracketsImportExportUtilities.writeElement( out, 'type', '' + tournament.Type__c ); - BracketsImportExportUtilities.writeElement( out, 'source', '' + tournament.Update_Source__c ); - BracketsImportExportUtilities.writeElement( out, 'deadline', '' + String.valueOf( tournament.Deadline__c ) ); - - out.writeEndElement(); - - List rounds = [ Select r.Brackets_Tournament__c, r.Start__c, r.ScorePoints__c, r.RoundNumber__c, r.Name, r.Id, r.ExternalId__c, r.End__c, r.Deadline__c, - ( Select Name, Brackets_Round__c, Conference__c, Description__c, FollowingBrackets_Match__c, FollowingIsHome__c, HomeScore__c, HomeBrackets_Team__c, Schedule__c, VisitorScore__c, VisitorBrackets_Team__c, - WinnerBrackets_Team__c, ExternalId__c, Position__c - From Matches__r Order By Position__c) - From Brackets_Round__c r where r.Brackets_Tournament__c =: tournament.Id Order By RoundNumber__c]; - - //---------------------------------------------------- - List roundIds = new List(); - for( Brackets_Round__c round : rounds ){ - roundIds.add( round.Id ); - } - Map matches = new Map( [ Select m.Id, m.Position__c, - m.VisitorBrackets_Team__c, m.VisitorBrackets_Team__r.ExternalId__c, - m.HomeBrackets_Team__c, m.HomeBrackets_Team__r.ExternalId__c, - m.WinnerBrackets_Team__c, m.WinnerBrackets_Team__r.ExternalId__c, - m.FollowingBrackets_Match__c, m.FollowingBrackets_Match__r.ExternalId__c, m.Conference__c - From Brackets_Match__c m where m.Brackets_Round__c IN : roundIds Order By m.Brackets_Round__r.RoundNumber__c, m.Position__c] ); - //---------------------------------------------------- - - out.writeStartElement( null, 'Rounds', null ); - for( Brackets_Round__c round : rounds ){ - - out.writeStartElement( null, 'Round', null ); - - BracketsImportExportUtilities.writeElement( out, 'id', '' + round.Id ); - //RSC Do we need this? - //BracketsImportExportUtilities.writeElement( out, 'ExternalId', '' + round.ExternalId__c ); - BracketsImportExportUtilities.writeElement( out, 'name', '' + round.Name ); - BracketsImportExportUtilities.writeElement( out, 'deadline', '' + String.valueOf( round.Deadline__c ) ); - BracketsImportExportUtilities.writeElement( out, 'roundNumber', '' + String.valueOf( round.RoundNumber__c ) ); - BracketsImportExportUtilities.writeElement( out, 'scorePoints', '' + String.valueOf( round.ScorePoints__c ) ); - BracketsImportExportUtilities.writeElement( out, 'tournament', '' + round.Brackets_Tournament__c ); - - out.writeStartElement( null, 'Matches', null ); - - for( Brackets_Match__c match : round.Matches__r ){ - - out.writeStartElement( null, 'Match', null ); - - BracketsImportExportUtilities.writeElement( out, 'id', '' + match.Id ); - BracketsImportExportUtilities.writeElement( out, 'number', '' + match.Name ); - BracketsImportExportUtilities.writeElement( out, 'description', '' + match.Description__c ); - BracketsImportExportUtilities.writeElement( out, 'position', '' + match.Position__c ); - BracketsImportExportUtilities.writeElement( out, 'homeScore', '' + String.valueOf( match.HomeScore__c ) ); - - - BracketsImportExportUtilities.writeElement( out, 'homeTeam', '' + matches.get( match.Id ).HomeBrackets_Team__c); - BracketsImportExportUtilities.writeElement( out, 'vistitorTeam', '' + matches.get( match.Id ).VisitorBrackets_Team__c ); - BracketsImportExportUtilities.writeElement( out, 'winnerTeam', '' + matches.get( match.Id ).WinnerBrackets_Team__c ); - BracketsImportExportUtilities.writeElement( out, 'followingMatch', '' + matches.get( match.Id ).FollowingBrackets_Match__c ); - BracketsImportExportUtilities.writeElement( out, 'round', '' + String.valueOf( round.id ) ); - - - BracketsImportExportUtilities.writeElement( out, 'schedule', '' + String.valueOf( match.Schedule__c ) ); - BracketsImportExportUtilities.writeElement( out, 'visitorScore', '' + String.valueOf( match.VisitorScore__c ) ); - BracketsImportExportUtilities.writeElement( out, 'conference', '' + match.Conference__c ); - BracketsImportExportUtilities.writeElement( out, 'followingIsHome', '' + String.valueOf(match.FollowingIsHome__c ) ); - - out.writeEndElement(); - } - - out.writeEndElement();//End Matches - out.writeEndElement();//End Round - } - - out.writeEndElement();//End Rounds - out.writeEndElement();//End Export - } - else { - out.writeStartElement( null,BracketsImportExportUtilities.ERROR_TAG, null ); - out.writeCharacters(BracketsImportExportUtilities.NOT_UPDATES_FOUND); - out.writeEndElement(); - out.writeEndDocument(); - } - return out.getXmlString(); - } - - /** - * Return the related tournament ID - * @return tournamentId - */ - public String getTournamentId(){ - String tournamentId = Apexpages.currentPage().getParameters().get('id'); - return tournamentId; - } - - /** - * Return the Client Tournament Version - * @return version - */ - public Integer getClientVersion(){ - String ver = Apexpages.currentPage().getParameters().get('tVersion'); - return ( ver != null ) ? Integer.valueOf( ver ) : 0; - } - - - //------------------------------------------------------------------------- - // Test methods - //------------------------------------------------------------------------- - - public testmethod static void testGetOutputXml(){ - - BracketsTournamentUtilities.CreatingTournamentTree = true; - - Brackets_Tournament__c tournament = new Brackets_Tournament__c(); - tournament.Name = 'Test'; - tournament.TeamCount__c = 4; - tournament.Type__c = 'Standard'; - tournament.Deadline__c = Datetime.now(); - tournament.Allow_Update__c = true; - tournament.Version__c = 2; - - insert tournament; - - Apexpages.currentPage().getParameters().put( 'id', tournament.Id ); - Apexpages.currentPage().getParameters().put( 'tVersion', '1' ); - BracketsSitesTournamentPublisher ut = new BracketsSitesTournamentPublisher (); - system.assert(ut.getOutputXml() != ''); - - system.debug(LoggingLevel.Info,ut.getOutputXml()); - - BracketsImportTournament importTour = new BracketsImportTournament(null); - - - importTour.readingTournamentData(ut.getOutputXml()); - Brackets_Tournament__c t = importTour.tournament; - system.debug(LoggingLevel.Info,t); - System.assert(t.deadline__c != null); - - - } - - -} \ No newline at end of file diff --git a/src/classes/BracketsTeamUtilities.cls b/src/classes/BracketsTeamUtilities.cls deleted file mode 100644 index 3a2ae23..0000000 --- a/src/classes/BracketsTeamUtilities.cls +++ /dev/null @@ -1,93 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -public with sharing class BracketsTeamUtilities { - - /** - * Method which validates if teams are able to be deleted - * @param teamList - * @return Boolean - */ - public static Boolean canDeleteTeams( List teamList ){ - - Set teamIds = new Set(); - - - List availableMatches = [ select Id, VisitorBrackets_Team__c, HomeBrackets_Team__c - from Brackets_Match__c - where HomeBrackets_Team__c IN : teamList OR VisitorBrackets_Team__c IN : teamList]; - if( availableMatches.size() > 0 ){ - //cannot delete teams - return false; - } - else{ - //can delete teams - return true; - } - } - - - public testmethod static void testCanDeleteTeams(){ - List teamList = BracketsTestUtilities.createTeamList( 10 ); - upsert teamList; - //not connected to a tournament so its fine. - system.assert( BracketsTeamUtilities.canDeleteTeams(teamList)); - - BracketsTournamentUtilities.CreatingTournamentTree = true; - //Create a user - User testUser = BracketsTestUtilities.createUser(); - - System.runAs(testUser) { - - - Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament('Test1 RoundByRound', 4); - Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); - - List auxList = new List(); - auxList.add( teamA ); - upsert auxList; - - Brackets_Round__c round = BracketsTestUtilities.createRound(tournament,1, null,4,'Round1-Test'); - Brackets_Match__c match = BracketsTestUtilities.createMatch(teamA, null, round, BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN); - - system.assert( !BracketsTeamUtilities.canDeleteTeams(auxList)); - - //so now test the trigger - try { - delete teamA; - System.assert(false); - } catch (Exception e) { - //correct - } - } - } - - - -} \ No newline at end of file diff --git a/src/classes/BracketsTournamentButtonsController.cls b/src/classes/BracketsTournamentButtonsController.cls deleted file mode 100644 index 4910440..0000000 --- a/src/classes/BracketsTournamentButtonsController.cls +++ /dev/null @@ -1,213 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -public with sharing class BracketsTournamentButtonsController { - - private List siteList { get; set ;} - public Brackets_Tournament__c myTournament { get; set; } - public String tId { get; set; } - public String ShareUrl { get; set; } - public Boolean showUpdateButton { get; set; } - public Boolean showPublishButton { get; set; } - public Boolean publishHasErrors { get; set; } - public String subDomain { get; set ;} - public String domain { get; set ;} - public String urlParam { get; set ;} - public String finalUrl { get; set ;} - public String xmlMessage { get; set ;} - Map matches; - - public BracketsTournamentButtonsController( Apexpages.StandardController stdController ) { - this.tId = (Id)stdController.getId(); - this.index(); - } - - /** - * Dummy Method - */ - public void index(){ - this.myTournament = this.getTournament(); - this.showPublishButton = ( !this.myTournament.Allow_Update__c && !this.myTournament.isChild__c ); - this.showUpdateButton = ( this.myTournament.isChild__c && this.myTournament.Update_Source__c != '' ); - this.siteList = this.getMySite(); - this.domain = ( this.siteList.size() > 0 ) ? String.valueOf(this.siteList.get(0).get('Subdomain')) : ''; - this.finalUrl = this.myTournament.Update_Source__c; - this.matches = new Map([select Id,HomeBrackets_Team__c,VisitorBrackets_Team__c,FollowingBrackets_Match__c from Brackets_Match__c where Brackets_Round__r.Brackets_Tournament__c =: this.myTournament.Id]); - } - - /** - * Check if the current Tournament can be Published checking First Leven Complete - * Cannot publish. All starting matches much be complete before publishing. - * @return canPublish - */ - public Boolean getCanPublish(){ - // Cannot publish. All starting matches much be complete before publishing. Check your matches and start again. - try{ - BracketsMatchUtilities.checkFirstLevelCompleted(this.myTournament,this.matches); - return true; - } - catch (Exception e){ - return false; - } - } - - /** - * Getter of ShowUrlSelection, establish if the Url section need be showed - * @return siteList size - */ - public Boolean getShowUrlSelection(){ - return ( !this.siteList.isEmpty() && this.myTournament.Update_Source__c == null ) ; - } - - /** - * Getter of ShowCreateSiteMsg - * @return siteList is Empty - */ - public Boolean getShowCreateSiteMsg(){ - return this.siteList.isEmpty() ; - } - - - - /** - * Return the selected Tournament - * @return : tournament - */ - private Brackets_Tournament__c getTournament() { - return [Select t.isChild__c, t.Version__c, t.Update_Source__c, t.Allow_Update__c From Brackets_Tournament__c t where t.Id =: this.tId]; - } - - /** - * Get Site parameters and return it - * return Select; - */ - public List getMySite(){ - List sites = new List(); - if( Schema.getGlobalDescribe().get('Site') != null){ - sites = Database.query('Select Id, Name, Subdomain, UrlPathPrefix from Site limit 20'); - } - return sites; - } - - /** - * Get all SIte Folders - * return options; - */ - public List getUrlPathPrefix() { - Object urlPathPrefixObject; - String urlPathPrefixValue; - List options = new List(); - for( Sobject s : this.siteList ) { - urlPathPrefixObject = s.get('UrlPathPrefix'); - if( urlPathPrefixObject != null ) { - urlPathPrefixValue = String.valueOf(urlPathPrefixObject); - options.add( new SelectOption( urlPathPrefixValue+'/', urlPathPrefixValue ) ); - } - } - return options; - } - - - public String getSitePath(){ - for(Sobject s : this.siteList){ return String.valueOf( s.get('UrlPathPrefix') );} - return null; - } - - /** - * Get selected site and save it into related Tournament - */ - public void saveUrl() { - - - if( this.getUrlPathPrefix().size() == 1 ){ - this.finalUrl = this.urlParam + this.getSitePath() + '?id='+ this.myTournament.Id; - } - else{ - this.subDomain = ( this.subDomain != null ) ? this.subDomain :''; - this.finalUrl = this.urlParam + this.subDomain + '?id='+ this.myTournament.Id; - } - - this.myTournament.Update_Source__c = this.finalUrl; - update this.myTournament; - this.index(); - } - - /** - * Execute Manual Update - */ - public void doManualUpdate(){ - try { - new BracketsProccessUpdate( this.myTournament.Id ); - this.index(); - this.xmlMessage = 'Tournament has been updated!'; - } - catch( Exception ex ){ - this.xmlMessage = ex.getMessage(); - } - } - - /** - * Publish tournament - */ - public void publish2(){ - try{ - myTournament.Allow_Update__c = true; - myTournament.Version__c++; - - update this.myTournament; - this.showPublishButton = false; - this.xmlMessage = 'Tournament has been published!!!'; - } - catch (Exception e){ - this.publishHasErrors = true; - this.xmlMessage = 'Error : '+e.getMessage(); - } - - } - - /** - * Unit Test Method - */ - public static testMethod void test(){ - Brackets_Tournament__c t = BracketsTestUtilities.createTournament('test',2); - BracketsTournamentButtonsController cont = new BracketsTournamentButtonsController( new Apexpages.Standardcontroller( t ) ); - - List test = cont.getUrlPathPrefix(); - cont.getUrlPathPrefix(); - cont.saveUrl(); - cont.getSitePath(); - cont.publish2(); - System.assert(!cont.getCanPublish()); - cont.getShowUrlSelection(); - cont.getShowCreateSiteMsg(); - cont.doManualUpdate(); - System.assert(cont.xmlMessage != null); - } - -} \ No newline at end of file diff --git a/src/classes/BracketsTournamentUtilities.cls b/src/classes/BracketsTournamentUtilities.cls deleted file mode 100644 index 37d476f..0000000 --- a/src/classes/BracketsTournamentUtilities.cls +++ /dev/null @@ -1,624 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -public with sharing class BracketsTournamentUtilities { - - //------------------------------------------------------------------------- - // Constants & Variables - //------------------------------------------------------------------------- - public static final Integer DEFAULT_ROUND_SCORE_POINTS = 1; - public static final String DEFAULT_TOURNAMENT_TYPE = 'Standard'; - public static final String STANDARD_TOURNAMENT_TYPE = 'Standard'; - public static final String NFL_PLAYOFF_TOURNAMENT_TYPE = 'NFL Playoff'; - public static final String NFL_CONFERENCE_AMERICAN = 'AFC'; - public static final String NFL_CONFERENCE_NATIONAL = 'NFC'; - - private static final String DEFAULT_ROUND_NAME_PREFIX = 'Round '; - private static final String NOT_POW_TWO_TEAM_COUNT = 'This number must be power of two, for example: 2,4,8,16,32,64,128,256, ..'; - private static final String FIELD_NOT_UPDATEABLE = 'This field is not updatable.'; - private static final String NFL_TEAM_COUNT_ERROR = 'NFL team count must be 12'; - private static final Integer NFL_PLAYOFF_TEAMS = 12; - private static final Integer TEAMS_COUNT_MAX = 32; - - - public static Boolean CreatingTournamentTree = false; - - - //------------------------------------------------------------------------- - // Public Methods - //------------------------------------------------------------------------- - - /** - * Create a tournament skeleton - * - * @param tournamentCol Tournament insert list - */ - public static void createTournamentTree( List tournamentCol ){ - Integer teamCount, roundCount; - Id playoffCol = null; - Id standardCol = null; - Map teamsCol = new Map(); - Map roundsCol = new Map(); - - for( Brackets_Tournament__c tournament : tournamentCol ){ - if( tournament.Type__c == NFL_PLAYOFF_TOURNAMENT_TYPE ) { - playoffCol = tournament.Id ; - } - else { - standardCol = tournament.Id ; - teamCount = ( tournament.TeamCount__c == null ) ? 0 : Math.floor(tournament.TeamCount__c).intValue(); - roundCount = roundCount( teamCount ); - } - break; - } - - if( playoffCol != null ){ - BracketsTournamentUtilities.createNFLPlayoffTournamentTree( playoffCol ); - } - - if( standardCol != null ){ - if( teamCount > TEAMS_COUNT_MAX){ - BracketsTournamentUtilities.createTournamentTreeFuture( standardCol, teamCount, roundCount ); - }else{ - BracketsTournamentUtilities.createTournamentTreeCall( standardCol, teamCount, roundCount ); - } - - } - } - - - /** - * Create a NFL Playoff tournament - * - * @param tournamentCol Set of tournament identifiers - */ - public static void createNFLPlayoffTournamentTree(Id tid){ - createNFLPlayoffTournamentTreeMethod(tid); - } - - /** - * Create a standard tournament skeleton for each tournament - * - * @param tournamentCol Set of tournament identifiers - * @param teamsCount Number of teams for each tournament - * @param roundsCount Number of rounds for each tournament - */ - public static void createTournamentTreeCall( Id tid, Integer teamsCount, Integer roundsCount ){ - createTournamentTreeMethod( tid, teamsCount, roundsCount ); - } - - @future - public static void createTournamentTreeFuture( Id tid, Integer teamsCount, Integer roundsCount ){ - createTournamentTreeCall( tid,teamsCount,roundsCount ); - } - - /** - * Check if the team count is power of 2 and return the number of rounds - * - * @param teamCount Total of teams - * @return Number of Rounds - */ - public static Integer roundCount(Integer teamCount){ - Integer i = teamCount; - Integer r = 0; - - while( i > 1 ){ - if( Math.mod(i, 2) == 0 ){ - i = i / 2; - r = r + 1; - } - else{ - return 0; - } - } - - return r; - } - - /** - * Method used to generate random alfa-numeric strings - * - * @return result - */ - //TODO Delete - /* - public Static String generateRandomExternalId(){ - - String[] code = new String[]{'A','B','C','D','E','F','G','H','I','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9'}; - String result = ''; - - for( Integer i = 0; i < 10; i++ ){ - Integer index = Math.mod( (Math.random() * 100).intValue(), 60); - result += code[ index ]; - } - - return result; - } - */ - - /** - * Method used to insert External Ids on tournament objects - * - * @param tournamentList - */ - //TODO DELETE - /* - public static void addExternalId( List tournamentList ){ - - for( Brackets_Tournament__c tour : tournamentList ){ - if( tour.ExternalId__c == null ){ - tour.ExternalId__c = BracketsTournamentUtilities.generateRandomExternalId(); - } - } - } - */ - /** - * Given a list of tournament, check the teamCount field if it is pow of 2. - * - * @param tournamentList A list of tournament. - */ - public static void checkTeamCount(List tournamentList){ - Integer roundCount; - Integer teamCount; - for( Brackets_Tournament__c tournament : tournamentList ){ - if(tournament.Type__c == DEFAULT_TOURNAMENT_TYPE && tournament.TeamCount__c != null){ - teamCount = Math.floor(tournament.TeamCount__c).intValue(); - roundCount = BracketsTournamentUtilities.roundCount(teamCount); - if(teamCount != 0 && roundCount == 0){ - tournament.addError(NOT_POW_TWO_TEAM_COUNT); - } - } - else if(tournament.Type__c == NFL_PLAYOFF_TOURNAMENT_TYPE){ - tournament.TeamCount__c = NFL_PLAYOFF_TEAMS; - } - } - } - - /** - * Given a two list of tournament sobjects, checks the field named TeamCount__c is not updateable. - */ - public static void checkTeamCountNotUpdateable(List tournamentNewList,List tournamentOldList){ - - Brackets_Tournament__c oldTournament,newTournament; - for(Integer i = 0;i getTournamentList(List tournamentIdList){ - return [select Id,Name from Brackets_Tournament__c where Id in : tournamentIdList]; - } - - /** - * Return a list of imported tournaments to be updated, the ones with oldest LastModifiedDate field. - * - * @param size number of tournament - * @return a list of imported tournament - */ - public static List getTournamentList(Integer size){ - return [select Id,Update_Source__c,LastModifiedDate from Brackets_Tournament__c - where isChild__c = true order by LastModifiedDate asc limit :size]; - } - - - /** - * Create a tournament skeleton - * - * @param tournamentId Tournament identifier - * @param teamCount Number of teams - * @param roundCount Number of rounds - */ - - public static void createTournamentTreeMethod( String tournamentId, Integer teamCount, Integer roundCount ){ - // Set global flag - BracketsTournamentUtilities.CreatingTournamentTree = true; - - if( tournamentId != null ){ - // Create Rounds - Brackets_Round__c round; - List roundCol = new List(); - - for(Integer i = 0; i < roundCount; i++){ - round = new Brackets_Round__c(); - - round.Brackets_Tournament__c = tournamentId; - round.ScorePoints__c = DEFAULT_ROUND_SCORE_POINTS; - round.Name = DEFAULT_ROUND_NAME_PREFIX + (i + 1).format(); - round.RoundNumber__c = i + 1; - - roundCol.add(round); - } - - insert roundCol; - - // Create Matches - Integer matchCount = teamCount; - List currRoundMatches = new List(); - List prevRoundMatches = new List(); - Brackets_Match__c match; - Integer currMatch; - - for(Integer roundNumber = 0; roundNumber < roundCount; roundNumber++){ - matchCount = matchCount / 2; - prevRoundMatches = currRoundMatches; - currRoundMatches = new List(); - - // Create current round matches - for(Integer k = 0; k < matchCount; k++){ - match = new Brackets_Match__c(); - - match.Brackets_Round__c = roundCol[roundNumber].Id; - match.Position__c = k + 1; - - currRoundMatches.add(match); - } - - insert currRoundMatches; - - // Link previous round matches - if( prevRoundMatches.size() != 0 ){ - for(Integer prevMatch = 0; prevMatch < prevRoundMatches.size(); prevMatch++){ - currMatch = Math.floor(prevMatch / 2).intValue(); - prevRoundMatches[prevMatch].FollowingBrackets_Match__c = currRoundMatches[currMatch].Id; - prevRoundMatches[prevMatch].FollowingIsHome__c = Math.mod(prevMatch, 2) == 0 ? true : false; - } - - update prevRoundMatches; - } - } - } - - // Unset global flag - BracketsTournamentUtilities.CreatingTournamentTree = false; - } - - /** - * Create a NFL Playoff tournament - * - * @param tournamentId Tournament identifier - */ - public static void createNFLPlayoffTournamentTreeMethod( String tournamentId ){ - // Set global flag - BracketsTournamentUtilities.CreatingTournamentTree = true; - - if( tournamentId != null ){ - // Create Rounds - List roundCol = BracketsTournamentUtilities.createNFLRounds( tournamentId ); - - /** - * Hack to fix security scanner bugs - */ - // Init matches - List allNFLMatches = new List(); - Brackets_Match__c mTemp; - for(Integer i = 0; i < 11; i++){ - mTemp = new Brackets_Match__c(); - - if( i < 4 ) { mTemp.Brackets_Round__c = roundCol[0].Id; } - else if( i >= 4 && i < 8) { mTemp.Brackets_Round__c = roundCol[1].Id; } - else if (i >= 8 && i < 10) { mTemp.Brackets_Round__c = roundCol[2].Id; } - else { mTemp.Brackets_Round__c = roundCol[3].Id; } - - allNFLMatches.add( mTemp ); - } - - insert allNFLMatches; - - // Create Matches - BracketsTournamentUtilities.createNFLWCRoundMatches( allNFLMatches ); - - // 2. Divisional Round - BracketsTournamentUtilities.createNFLDRoundMatches( allNFLMatches ); - - // 3. Conference Championships - BracketsTournamentUtilities.createNFLCRoundMatches( allNFLMatches ); - - // 4. Super Bowl - BracketsTournamentUtilities.createNFLSuperBowlMatch( allNFLMatches ); - - upsert allNFLMatches; - } - - // Unset global flag - BracketsTournamentUtilities.CreatingTournamentTree = false; - } - - //------------------------------------------------------------------------- - // Private methods - //------------------------------------------------------------------------- - - /** - * Create NFL playoff rounds - * - * @param tournamentId Id of the new tournament - * @return List of NFL playoff rounds - */ - private static List createNFLRounds( String tournamentId ){ - Brackets_Round__c round; - List roundCol = new List(); - - // Wild Card Round - round = new Brackets_Round__c(); - - round.Brackets_Tournament__c = tournamentId; - round.ScorePoints__c = 5; - round.Name = 'Wild Card Round'; - round.RoundNumber__c = 1; - - roundCol.add(round); - - // Divisional Round - round = new Brackets_Round__c(); - - round.Brackets_Tournament__c = tournamentId; - round.ScorePoints__c = 7; - round.Name = 'Divisional Round'; - round.RoundNumber__c = 2; - - roundCol.add(round); - - // Conference championship - round = new Brackets_Round__c(); - - round.Brackets_Tournament__c = tournamentId; - round.ScorePoints__c = 11; - round.Name = 'Conference Championship'; - round.RoundNumber__c = 3; - - roundCol.add(round); - - // Super Bowl - round = new Brackets_Round__c(); - - round.Brackets_Tournament__c = tournamentId; - round.ScorePoints__c = 17; - round.Name = 'Super Bowl'; - round.RoundNumber__c = 4; - - roundCol.add(round); - - insert roundCol; - - return roundCol; - } - - /** - * Create NFL Playoff "Wild Card Round" matches - */ - public static void createNFLWCRoundMatches( List matchCol ){ - // First Match - matchCol[0].Position__c = 1; - matchCol[0].Conference__c = NFL_CONFERENCE_AMERICAN; - matchCol[0].Description__c = 'Wild Card 1 ( Team 1 ) vs Division Winner 4 ( Team 2 )'; - matchCol[0].FollowingIsHome__c = true; - matchCol[0].FollowingBrackets_Match__c = matchCol[4].Id; - - // Second Match - matchCol[1].Position__c = 2; - matchCol[1].Conference__c = NFL_CONFERENCE_AMERICAN; - matchCol[1].Description__c = 'Division Winner 3 ( Team 1 ) vs Wild Card 2 ( Team 2 )'; - matchCol[1].FollowingIsHome__c = false; - matchCol[1].FollowingBrackets_Match__c = matchCol[5].Id; - - // Third Match - matchCol[2].Position__c = 3; - matchCol[2].Conference__c = NFL_CONFERENCE_NATIONAL; - matchCol[2].Description__c = 'Wild Card 1 ( Team 1 ) vs Division Winner 4 ( Team 2 )'; - matchCol[2].FollowingIsHome__c = true; - matchCol[2].FollowingBrackets_Match__c = matchCol[6].Id; - - // Fourth Match - matchCol[3].Position__c = 4; - matchCol[3].Conference__c = NFL_CONFERENCE_NATIONAL; - matchCol[3].Description__c = 'Division Winner 3 ( Team 1 ) vs Wild Card 2 ( Team 2 )'; - matchCol[3].FollowingIsHome__c = false; - matchCol[3].FollowingBrackets_Match__c = matchCol[7].Id; - } - - /** - * Create NFL Playoff "Divisional Round" matches - */ - public static void createNFLDRoundMatches( List matchCol ){ - // First Match - matchCol[4].Position__c = 1; - matchCol[4].Conference__c = NFL_CONFERENCE_AMERICAN; - matchCol[4].Description__c = 'DW 4, WC 1 or WC 2 ( Team 1 ) vs Division Winner 1 ( Team 2 )'; - matchCol[4].FollowingIsHome__c = true; - matchCol[4].FollowingBrackets_Match__c = matchCol[8].Id; - - // Second Match - matchCol[5].Position__c = 2; - matchCol[5].Conference__c = NFL_CONFERENCE_AMERICAN; - matchCol[5].Description__c = 'Division Winner 2 ( Team 1 ) vs DW 3, DW 4 or WC 1 ( Team 2 )'; - matchCol[5].FollowingIsHome__c = false; - matchCol[5].FollowingBrackets_Match__c = matchCol[8].Id; - - // Third Match - matchCol[6].Position__c = 3; - matchCol[6].Conference__c = NFL_CONFERENCE_NATIONAL; - matchCol[6].Description__c = 'DW 4, WC 1 or WC 2 ( Team 1 ) vs Division Winner 1 ( Team 2 )'; - matchCol[6].FollowingIsHome__c = true; - matchCol[6].FollowingBrackets_Match__c = matchCol[9].Id; - - // Fourth Match - matchCol[7].Position__c = 4; - matchCol[7].Conference__c = NFL_CONFERENCE_NATIONAL; - matchCol[7].Description__c = 'Division Winner 2 ( Team 1 ) vs DW 3, DW 4 or WC 1 ( Team 2 )'; - matchCol[7].FollowingIsHome__c = false; - matchCol[7].FollowingBrackets_Match__c = matchCol[9].Id; - } - - /** - * Create NFL Playoff "Conference Championship" round matches - */ - public static void createNFLCRoundMatches( List matchCol ){ - // AFC Championship match - matchCol[8].Position__c = 1; - matchCol[8].Conference__c = NFL_CONFERENCE_AMERICAN; - matchCol[8].Description__c = 'DR1 ( Team 1 ) vs DR2 ( Team 2 )'; - matchCol[8].FollowingIsHome__c = true; - matchCol[8].FollowingBrackets_Match__c = matchCol[10].Id; - - // NFC Championship match - matchCol[9].Position__c = 2; - matchCol[9].Conference__c = NFL_CONFERENCE_NATIONAL; - matchCol[9].Description__c = 'DR3 ( Team 1 ) vs DR4 ( Team 2 )'; - matchCol[9].FollowingIsHome__c = false; - matchCol[9].FollowingBrackets_Match__c = matchCol[10].Id; - } - - - /** - * Create NFL Playoff "Super Bowl" match - */ - public static void createNFLSuperBowlMatch( List matchCol ){ - matchCol[10].Position__c = 1; - matchCol[10].Description__c = 'AFC Champion ( Team 1 ) vs NFC Champion ( Team 2 )'; - } - - /** - * Given two list of tournaments, update the field Allow_Update if there are changes. - * - * @param newTournamentList a list of tournament sobjects - */ - public static void publishOff(List newList , List oldList){ - - System.debug('1234: in publish off' ); - for(Integer i = 0; i < newList.size(); i++) { - if( newList.get(i).Allow_Update__c && oldList.get(i).Allow_Update__c ){ - System.debug('1234: here I am turning allow update off' ); - newList.get(i).Allow_Update__c = false; - } - } - } - - /** - * Given a list of tournaments, update the tournaments modified. - * - * @param tournamentList a list of tournament sobjects - */ - public static void publishTournamentOff(List tournamentList){ - - for( Brackets_Tournament__c tournament : tournamentList ) { tournament.Allow_Update__c = false; } - update tournamentList; - } - - public static void checkIfIsPublished( List myTour ) { - - for( Brackets_Tournament__c to : myTour ) { - System.assert( !to.Allow_Update__c, 'This Tournament can not be deleted!' ); - } - } - - //------------------------------------------------------------------------- - // Test Methods - //------------------------------------------------------------------------- - - public testmethod static void testRoundCount(){ - system.assert(BracketsTournamentUtilities.roundCount(4) == 2); - system.assert(BracketsTournamentUtilities.roundCount(5) == 0); - system.assert(BracketsTournamentUtilities.roundCount(32) == 5); - } - - public testmethod static void testCreateTournamentTree(){ - Brackets_Tournament__c tournament = new Brackets_Tournament__c(); - tournament.Name = 'Test'; - tournament.TeamCount__c = 8; - - insert tournament; - - system.assert( tournament.Id != null ); - } - - public testmethod static void testCreateNFLPlayoffs(){ - Brackets_Tournament__c tournament = new Brackets_Tournament__c(); - tournament.Name = 'Test'; - tournament.Type__c = NFL_PLAYOFF_TOURNAMENT_TYPE; - - insert tournament; - - system.assert( tournament.Id != null ); - } - - public testmethod static void testCheckTeamCountNotUpdateable(){ - Brackets_Tournament__c tournament = new Brackets_Tournament__c(); - tournament.Name = 'Test'; - tournament.Type__c = NFL_PLAYOFF_TOURNAMENT_TYPE; - - insert tournament; - - tournament.TeamCount__c = 18; - - try{ - upsert tournament; - } - catch(DmlException e){ - system.assert( e.getMessage().contains('FIELD_CUSTOM_VALIDATION_EXCEPTION') ); - } - - } - - static testMethod void testTournamentList() { - - BracketsTournamentUtilities.CreatingTournamentTree = true; - - Brackets_Tournament__c tournament = new Brackets_Tournament__c(); - tournament.Name = 'Test'; - tournament.Type__c = NFL_PLAYOFF_TOURNAMENT_TYPE; - tournament.isChild__c = true; - insert tournament; - - List ids = new List(); - ids.add(tournament.id); - - List tours = BracketsTournamentUtilities.getTournamentList(ids); - System.assert(tours.size() == 1); - System.assert(tours.get(0).name == tournament.name); - - List tours2 = BracketsTournamentUtilities.getTournamentList(1); - System.assert(tours2.size() == 1); - - } - -} \ No newline at end of file diff --git a/src/classes/BracketsTreeView.cls b/src/classes/BracketsTreeView.cls deleted file mode 100644 index 83c8089..0000000 --- a/src/classes/BracketsTreeView.cls +++ /dev/null @@ -1,408 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ -public with sharing class BracketsTreeView { - - //------------------------------------------------------------------------- - // DataTypes - //------------------------------------------------------------------------- - - /** - * Round data type, keeps information to draw the round - */ - public class RoundData { - public Brackets_Round__c round { get; set; } - public List matches { get; set; } - public String className { get; set; } - - public RoundData(){ - this.round = new Brackets_Round__c(); - this.matches = new List(); - this.className = ''; - } - } - - /** - * Match data type, keeps information to draw each match - */ - public class MatchData { - public Brackets_Match__c match { get; set; } - public TeamData home { get; set; } - public TeamData visitor { get; set; } - public TeamData winner { get; set; } - public TeamData prediction { get; set; } - public TeamData champion { get; set; } - public String className { get; set; } - public Boolean spacer { get; set; } - public Boolean isFinal { get; set; } - public String predId { get; set; } - public String extraInfo { get; set; } - public Integer spacerHeight { get; set; } - public Integer blockHeight { get; set; } - public Boolean isLocked { get; set; } - public Boolean isPlayed { get { if (winner.team != null) { return true; } else { return false; } } } - - public MatchData(){ - this.match = new Brackets_Match__c(); - this.home = new TeamData(); - this.visitor = new TeamData(); - this.winner = new TeamData(); - this.prediction = new TeamData(); - this.champion = null; - this.className = ''; - this.spacer = true; - this.isFinal = false; - this.predId = ''; - this.extraInfo = ''; - this.spacerHeight = 0; - this.blockHeight = 0; - this.isLocked = false; - } - } - - /** - * Team data type, keeps information for each team - */ - public class TeamData{ - public Brackets_Team__c team { get; set; } - public Brackets_Team__c predicted { get; set; } - public String className { get; set; } - public String predId { get; set; } - public Integer score { get; set; } - - public TeamData(){ - this.team = null; - this.predicted = null; - this.className = ''; - this.predId = ''; - this.score = 0; - } - } - - //------------------------------------------------------------------------- - // Constants & Variables - //------------------------------------------------------------------------- - - public Boolean isLocked = false; - - public Brackets_Group__c betGroup = null; - - public List roundsByNumber = null; - public List matchesByPosition = null; - public Map matchMap = null; - public Map teamMap = null; - public List matchData = new List(); - - public Map predictionMapByMatch = new Map(); - public Map homePredictionMap = new Map(); - public Map visitorPredictionMap = new Map(); - - //------------------------------------------------------------------------- - // Getters and Setters - //------------------------------------------------------------------------- - - public String tournamentId { get; set; } - public String groupId { get; set; } - public String userTournamentId { get; set; } - public Brackets_Tournament__c tournament { get; set; } - public String tournamentClass { get; set; } - public Brackets_UserTournament__c userTournament { get; set; } - - //------------------------------------------------------------------------- - // Constructors - //------------------------------------------------------------------------- - - /** - * Create a new controller instance // with a known group - */ - public BracketsTreeView (String tId, Brackets_Group__c targetGroup, Boolean isLocked, String userTournamentId){ - this.tournamentId = tId; - this.groupId = targetGroup.Id; - this.betGroup = targetGroup; - this.isLocked = isLocked; - this.userTournamentId = userTournamentId; - handleInit(); - } - - public void handleInit() { - if (this.tournamentId == null || this.groupId == null || this.isLocked == null) { - throw new BracketsException('initialization failed - tournament, group and locked indicator are required.'); - } - this.tournamentClass = ''; - this.initTournament(); - this.initRounds(); - this.initMatches(); - this.initTeams(); - this.initGroup(); - this.initUserTournament(); - this.initPredictions(); - - } - - /** - * List of matches filtered by conference - * - * @param conference NFL conference (or division) - * @return List of matches for the given conference - */ - public List filterMatchesByConference(String conference){ - List result = new List(); - - for(Brackets_Match__c m : this.matchesByPosition ){ - if( m.Conference__c == conference ){ - result.add( this.matchMap.get(m.Id) ); - } - } - - return result; - } - - - /** - * List of matches filtered by round - * - * @param roundId Round to filter the matches - * @param source List of matches to filter - * @return Filtered list of matches for the round - */ - public List filterMatchesByRound(Id roundId, List source){ - List mlst = new List(); - - // Filter matches - for(Brackets_Match__c m : source){ - if( m.Brackets_Round__c == (String)roundId ){ - mlst.add( this.matchMap.get(m.Id) ); - } - } - - return mlst; - } - - - /** - * Get following matches from a list of matches - * - * @param currentMatches List of current matches - * @return List of following matches - */ - public List getNextMatches( List currentMatches ){ - List result = new List(); - Set duplicates = new Set(); - - for( Brackets_Match__c cm : currentMatches ){ - if( cm.FollowingBrackets_Match__c != null && !duplicates.contains(cm.FollowingBrackets_Match__c) ){ - duplicates.add(cm.FollowingBrackets_Match__c); - result.add( this.matchMap.get(cm.FollowingBrackets_Match__c) ); - } - } - - return result; - } - - /** - * Return TRUE if the match should be locked - * - * @param match Match to check - * @param round Round where the match belongs - * @return TRUE if the match must be locked - */ - public Boolean lockMatch(Brackets_Match__c match, Brackets_Round__c round){ - if (this.isLocked) { - return true; - } - - if( match == null || match.WinnerBrackets_Team__c != null ){ - return true; - } - - return false; - - } - - /** - * Return TRUE if the betting type is by round - */ - public Boolean isGroupByRound(){ - if( this.betGroup != null && this.betGroup.Type__c == BracketsGroupUtilities.BET_TYPE_BY_ROUND ){ - return true; - } - - return false; - } - - //------------------------------------------------------------------------- - // Private methods - //------------------------------------------------------------------------- - - /** - * Initialize tournament - */ - private void initTournament(){ - - - this.tournament = [SELECT Id, Type__c, Deadline__c - FROM Brackets_Tournament__c - WHERE Id =: tournamentId - LIMIT 1]; - - - this.tournamentClass += 'tournament'; - } - - /** - * Initialize rounds - */ - private void initRounds(){ - this.roundsByNumber = [SELECT Id, Name, RoundNumber__c, Deadline__c - FROM Brackets_Round__c - WHERE Brackets_Tournament__c =: tournamentId - ORDER BY RoundNumber__c ASC]; - } - - /** - * Initialize matches - */ - private void initMatches(){ - // Select all tournament matches - this.matchMap = new Map( - [SELECT Id, WinnerBrackets_Team__r.Name, Brackets_Round__c, Conference__c, - HomeBrackets_Team__c, VisitorBrackets_Team__c, Schedule__c, - VisitorScore__c, HomeScore__c, - Brackets_Round__r.RoundNumber__c, Brackets_Round__r.Name, Position__c, - FollowingBrackets_Match__c, FollowingIsHome__c - FROM Brackets_Match__c - WHERE Brackets_Round__r.Brackets_Tournament__c =: tournamentId]); - - for(Brackets_Match__c match : this.matchMap.values()){ - if(match.Schedule__c != null) - match.Schedule__c = Datetime.valueOfGmt(String.valueOf(match.Schedule__c)); - } - - this.matchesByPosition = [SELECT Id, Conference__c, Brackets_Round__c, - Position__c, Schedule__c, - FollowingBrackets_Match__c, FollowingIsHome__c - FROM Brackets_Match__c - WHERE Brackets_Round__r.Brackets_Tournament__c =: tournamentId - ORDER BY Position__c]; - for(Brackets_Match__c match : this.matchesByPosition){ - if(match.Schedule__c != null) - match.Schedule__c = Datetime.valueOfGmt(String.valueOf(match.Schedule__c)); - } - - } - - - /** - * Initialize teams - */ - private void initTeams(){ - // Collect tournament teams - Set teamIds = new Set(); - - for( Id mid : this.matchMap.keySet() ){ - if( this.matchMap.get(mid).HomeBrackets_Team__c != null ){ - teamIds.add(this.matchMap.get(mid).HomeBrackets_Team__c); - } - if( this.matchMap.get(mid).VisitorBrackets_Team__c != null ){ - teamIds.add(this.matchMap.get(mid).VisitorBrackets_Team__c); - } - } - - // Select teams - this.teamMap = new Map( - [SELECT Id, Name , ShortName__c, Description__c - FROM Brackets_Team__c - WHERE Id IN :teamIds]); - } - - /** - * Initialize group - */ - private void initGroup(){ - - if (this.betGroup == null) { - this.betGroup = [SELECT Id, Type__c - FROM Brackets_Group__c - WHERE Id =: groupId - LIMIT 1]; - } - - // Check tournament deadline - if( this.betGroup.Type__c == BracketsGroupUtilities.BET_TYPE_FULL_TOURNAMENT && - this.tournament.Deadline__c <= Datetime.now() ){ - tournamentClass += ' tournament-disabled'; - } - } - - /** - * Initialize user tournament - */ - private void initUserTournament(){ - if (this.userTournamentId == null) { - this.userTournament = [SELECT Id - FROM Brackets_UserTournament__c - WHERE Brackets_Group__c =: this.groupId AND - User__c =: UserInfo.getUserId() - LIMIT 1]; - } else { - this.userTournament = [SELECT Id - FROM Brackets_UserTournament__c - WHERE Id =: this.userTournamentId]; - - } - } - - /** - * Init user predictions - */ - private void initPredictions(){ - if (this.userTournament == null) { - throw new BracketsException('cannot init predicitons without a user tournament being set.'); - } - List ump = [SELECT Id, Brackets_Match__c, - PredictedWinnerBrackets_Team__c - FROM Brackets_UserMatchPred__c - WHERE Brackets_UserTournament__c =: userTournament.Id]; - - for(Brackets_UserMatchPred__c u : ump){ - this.predictionMapByMatch.put( u.Brackets_Match__c, u); - } - - for(Brackets_Match__c m : this.matchMap.values() ){ - if( this.predictionMapByMatch.get(m.Id) != null && m.FollowingBrackets_Match__c != null ){ - if( m.FollowingIsHome__c ){ - this.homePredictionMap.put(m.FollowingBrackets_Match__c, m.Id); - } - else{ - this.visitorPredictionMap.put(m.FollowingBrackets_Match__c, m.Id); - } - } - } - - } -} \ No newline at end of file diff --git a/src/classes/BracketsTreeViewController.cls b/src/classes/BracketsTreeViewController.cls deleted file mode 100644 index e568fb6..0000000 --- a/src/classes/BracketsTreeViewController.cls +++ /dev/null @@ -1,150 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ -public with sharing class BracketsTreeViewController { - - //------------------------------------------------------------------------- - // Constants & Variables - //------------------------------------------------------------------------- - - private BracketsTreeView baseTree = null; - - //------------------------------------------------------------------------- - // Getters and Setters - //------------------------------------------------------------------------- - - public String tournamentId { get; set; } - public Brackets_Group__c targetGroup { get; set; } - public Boolean showSaveAll { get; set; } - public String json { get; set; } - public String message { get; set; } - public String messageType { get; set; } - public Boolean isRoundByRound { get; set; } - - //component arguments - public String groupId { get; set; } - public String userTournamentId { get; set; } - public Datetime nextDeadline { get; set; } - public Integer activeRound {get; set; } - public Boolean isLocked { get; set; } - - public BracketsTreeViewFootball nflTree { get; set; } - public BracketsTreeViewStandard stdTree { get; set; } - - public Boolean getIsRenderable() { - init(); - return true; - } - - /** - * Initialize controller - */ - public void init(){ - if (this.groupId == null) { - throw new BracketsException('Cannot initialize without a group id. [BracketsTreeViewController]'); - } - if (this.isLocked == null) { - throw new BracketsException('Cannot initialize without an indicator for isLocked (currently null) [BracketsTreeViewController]'); - } - - if( this.tournamentId == null ) { - Brackets_Group__c target = [Select Id, Name, Type__c, Brackets_Tournament__c from Brackets_Group__c where Id =: this.groupId]; - if (target == null) { - throw new BracketsException('Could not locate tournament.'); - } - this.tournamentId = target.Brackets_Tournament__c; - this.targetGroup = target; - this.isRoundByRound = target.Type__c == BracketsGroupUtilities.BET_TYPE_BY_ROUND; - } - createTree(); - - Boolean hasStdDisabled = this.stdTree != null && stdTree.getTournamentClass().contains('tournament-disabled'); - Boolean hasNflDisabled = this.nflTree != null && this.nflTree.getTournamentClass().contains('tournament-disabled'); - - if (hasStdDisabled || hasNflDisabled) { - this.showSaveAll = false; - } else { - this.showSaveAll = true; - } - - - } - - - - - //------------------------------------------------------------------------- - // Private Methods - //------------------------------------------------------------------------- - - /** - * Creates trees depending on the type - */ - public void createTree() { - - this.baseTree = new BracketsTreeView( this.tournamentId, this.targetGroup, this.isLocked, this.userTournamentId ); - - if( this.baseTree != null ){ - if( this.baseTree.tournament.Type__c == BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE ){ - this.nflTree = new BracketsTreeViewFootball(this.baseTree); - } - else if( this.baseTree.tournament.Type__c == BracketsTournamentUtilities.STANDARD_TOURNAMENT_TYPE ){ - this.stdTree = new BracketsTreeViewStandard(this.baseTree); - } - } - } - - //------------------------------------------------------------------------- - // Test Methods - //------------------------------------------------------------------------- - - - private testmethod static void testConstructors(){ - Brackets_Tournament__c tournament = BracketsTestUtilities.getNewStandardTournament(); - Brackets_Group__c groupp = BracketsTestUtilities.getGroup(tournament.Id); - Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament(Userinfo.getUserId(), tournament.Id, groupp.Id); - - //constructor without parameters - - BracketsTreeViewController controller = new BracketsTreeViewController(); - controller.groupId = groupp.Id; - controller.isLocked = false; - - System.assert(controller.getIsRenderable()); - - System.assert(controller.tournamentId == tournament.Id); - - System.assert(controller.nflTree == null); - System.assert(controller.stdTree != null); - - - } - - - -} \ No newline at end of file diff --git a/src/classes/BracketsTreeViewFootball.cls b/src/classes/BracketsTreeViewFootball.cls deleted file mode 100644 index 18e4630..0000000 --- a/src/classes/BracketsTreeViewFootball.cls +++ /dev/null @@ -1,392 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ -public with sharing class BracketsTreeViewFootball { - - //------------------------------------------------------------------------- - // Constants & Variables - //------------------------------------------------------------------------- - - public static final String CHAMPIONSHIP_FLAG = 'NFL_SUPERBOWL'; - - private BracketsTreeView parent = null; /* Prototypal inheritance */ - private Integer currentInitHeight = 0; - private Integer currentBlockHeight = 0; - - private Map nextMatchPredictionMap = new Map(); - - //------------------------------------------------------------------------- - // Getters and Setters - //------------------------------------------------------------------------- - - public List orderedAFCRounds { get; set; } - public List orderedNFCRounds { get; set; } - public BracketsTreeView.MatchData biggame { get; set; } - - public String getTournamentId() { return this.parent.tournamentId; } - public String getGroupId() { return this.parent.groupId; } - public Brackets_Tournament__c getTournament() { return this.parent.tournament; } - public Brackets_UserTournament__c getUserTournament() { return this.parent.userTournament; } - public String getTournamentClass() { return this.parent.tournamentClass; } - - - public List getMatches() { return this.parent.matchesByPosition; } - - //------------------------------------------------------------------------- - // Constructors - //------------------------------------------------------------------------- - - /** - * Create a new controller instance - */ - public BracketsTreeViewFootball(BracketsTreeView parentTree){ - this.parent = parentTree; - this.orderedAFCRounds = populateRoundData(BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN); - this.orderedNFCRounds = populateRoundData(BracketsTournamentUtilities.NFL_CONFERENCE_NATIONAL); - this.biggame = populatebiggame(); - } - - //------------------------------------------------------------------------- - // Private methods - //------------------------------------------------------------------------- - - /** - * Populate round datatypes - * - * @param conference NFL conference (or division) - * @result List of round data - */ - private List populateRoundData( String conference ){ - List conferenceMatches = this.parent.filterMatchesByConference( conference ); - Brackets_Round__c currentRound = null; - List currentRoundMatches = new List(); - List nextRoundMatches = new List(); - - List result = new List(); - BracketsTreeView.RoundData rdt = null; - - this.currentInitHeight = 0; - this.currentBlockHeight = 0; - - for(Integer i = 0; i < 3; i++){ - currentRound = this.parent.roundsByNumber[i]; - - rdt = new BracketsTreeView.RoundData(); - rdt.round = currentRound; - rdt.className = 'round'; - - if( this.parent.isGroupByRound() ){ - if( currentRound.Deadline__c == null || (currentRound.Deadline__c <= Date.today()) ){ - rdt.className += ' round-disabled'; - } - } - - // First round - if( i == 0 ){ - currentRoundMatches = this.parent.filterMatchesByRound( currentRound.Id, conferenceMatches ); - nextRoundMatches = this.parent.getNextMatches( currentRoundMatches ); - } - // Inner round - else{ - currentRoundMatches = nextRoundMatches; - nextRoundMatches = this.parent.getNextMatches( currentRoundMatches ); - } - - this.currentBlockHeight = 40 * Math.pow(2, i).intValue(); - this.currentInitHeight = this.currentInitHeight + this.currentBlockHeight / 2; - - rdt.matches = populateMatchData( conference, currentRound, i, currentRoundMatches ); - result.add(rdt); - - } - - if( conference == BracketsTournamentUtilities.NFL_CONFERENCE_NATIONAL ){ - List reverseResult = new List(); - - // Reverse List - for(Integer j = (result.size() - 1); j >= 0; j--){ - reverseResult.add( result[j] ); - } - - result = reverseResult; - } - - return result; - } - - /** - * Populate match datatypes - * - * @param conference NFL conference or division - * @param round Round where the match is being played - * @param roundNumber Order number of the round - * @param source List of source matches - * @return List of match data - */ - private List populateMatchData(String conference, Brackets_Round__c round, Integer roundNumber, List source){ - List result = new List(); - Integer matchCount = roundNumber == 0 ? 4 : (roundNumber == 1 ? 2 : 1); - Integer matchIndex = -1; - - for(Integer i = 0; i < matchCount; i++){ - if (roundNumber == 0) { - if (i == 0) { - matchIndex = 0; - } else { - if (i == 3) { - matchIndex = 1; - } else { - matchIndex = -1; - } - } - } else { - matchIndex = i; - } - //matchIndex = roundNumber == 0 ? ( i == 0 ? 0 : ( i == 3 ? 1 : -1) ) : i; - result.add( populateMatchData(conference, round, roundNumber, ( matchIndex == -1 ? null : source[matchIndex]), i) ); - } - - return result; - } - - /** - * Populate match datatype - * - * @param conference NFL conference or division - * @param round Round where the match is being played - * @param roundNumber Order number of current round - * @param match Source match - * @param matchNumber Order number of current match - * @return Match data - */ - private BracketsTreeView.MatchData populateMatchData( String conference, Brackets_Round__c round, Integer roundNumber, Brackets_Match__c match, Integer matchNumber){ - BracketsTreeView.MatchData md = new BracketsTreeView.MatchData(); - - md.spacerHeight = roundNumber == 0 ? this.currentBlockHeight : (matchNumber == 0 ? this.currentInitHeight : this.currentBlockHeight); - md.blockHeight = this.currentBlockHeight - 2; - - // Empty match - if( roundNumber == 0 && (matchNumber == 1 || matchNumber == 2) ){ - //updated from 'match hidden' 12/22 - md.className = 'spacer'; - } - // Match - else{ - md.className = 'match'; - - if( match != null ){ - md.match = match; - md.home = populateTeamData( conference, round, roundNumber, match, matchNumber, this.parent.teamMap.get( match.HomeBrackets_Team__c ), true ); - md.visitor = populateTeamData( conference, round, roundNumber, match, matchNumber, this.parent.teamMap.get( match.VisitorBrackets_Team__c), false ); - - if( match.WinnerBrackets_Team__c != null ){ - md.winner.team = this.parent.teamMap.get( match.WinnerBrackets_Team__c ); - } - - if( this.parent.predictionMapByMatch.get( match.Id ) != null ){ - md.prediction.team = this.parent.teamMap.get( this.parent.predictionMapByMatch.get( match.Id ).PredictedWinnerBrackets_Team__c ); - } - } - - // Draw spacer? - if( roundNumber == 0 && matchNumber == 0 ){ - md.spacer = false; - } - } - - // Conference final - if( roundNumber == 2 ){ - md.isFinal = true; - } - - return md; - } - - - /** - * Populate team datatype - * - * @param conference NFL conference or division - * @param round Current round - * @param roundNumber Order number of current round - * @param match Current match - * @param matchNumber Order number of current match - * @param team Source team - * @param isHome True if the source team is the home team - * @return Team data - */ - private BracketsTreeView.TeamData populateTeamData( String conference, Brackets_Round__c round, Integer roundNumber, Brackets_Match__c match, Integer matchNumber, Brackets_Team__c team, Boolean isHome ){ - BracketsTreeView.TeamData td = new BracketsTreeView.TeamData(); - Boolean locked = true; - Brackets_Team__c predTeam = null; - Id predId = null; - Id predMatchId = null; - - td.className = 'team'; - td.className += isHome ? ' home' : ' visitor'; - - if( conference == CHAMPIONSHIP_FLAG ){ - td.className += isHome ? ' champion-left' : ' champion-right'; - } - else { - // Tree nodes - if( roundNumber == 2 || ( roundNumber == 1 && ( (matchNumber == 0 && isHome) || (matchNumber == 1 && !isHome) ) ) ){ - td.className += ' inner'; - } - } - - // Match locked/unlocked - if( !this.parent.lockMatch(match, round) ){ - locked = false; - if( conference != CHAMPIONSHIP_FLAG ){ - td.className += ' unlocked '; - } - } - - if (!locked) { - td.className += ' draggable '; - } - - // Score - td.score = isHome ? match.HomeScore__c.intValue() : match.VisitorScore__c.intValue(); - - // Prediction - if( isHome && this.parent.homePredictionMap.get(match.Id) != null ){ - predMatchId = this.parent.homePredictionMap.get(match.Id); - predTeam = this.parent.teamMap.get( this.parent.predictionMapByMatch.get( predMatchId ).PredictedWinnerBrackets_Team__c ); - - td.predId = this.parent.predictionMapByMatch.get(predMatchId).Id; - } - else if( !isHome && this.parent.visitorPredictionMap.get(match.Id) != null ){ - predMatchId = this.parent.visitorPredictionMap.get(match.Id); - predTeam = this.parent.teamMap.get( this.parent.predictionMapByMatch.get( predMatchId ).PredictedWinnerBrackets_Team__c ); - - td.predId = this.parent.predictionMapByMatch.get(predMatchId).Id; - } - - // Team - if( team != null && predTeam != null ){ - td.team = team; - td.predicted = predTeam; - td.className += predTeam.Id == team.Id ? ' success' : ' failure'; - } - else if( team != null && predTeam == null ){ - td.team = team; - } - else if( team == null && predTeam != null ){ - td.predicted = predTeam; - td.className += ' prediction droppable'; - } - else { - td.className += conference != CHAMPIONSHIP_FLAG ? ' team-empty droppable' : ' champion-empty droppable'; - } - - return td; - } - - /** - * Populate final - */ - private BracketsTreeView.MatchData populatebiggame(){ - Brackets_Round__c lastRound = this.parent.roundsByNumber[this.parent.roundsByNumber.size() - 1]; - Integer lastRoundNumber = lastRound.RoundNumber__c.intValue(); - Brackets_Match__c sbmatch; - Brackets_Team__c champion; - BracketsTreeView.MatchData sbmdata = new BracketsTreeView.MatchData(); - BracketsTreeView.TeamData td = new BracketsTreeView.TeamData(); - Brackets_Team__c predTeam = null; - - sbmdata.className = 'match'; - - // Block round - if( this.parent.isGroupByRound() ){ - if( lastRound.Deadline__c == null || (lastRound.Deadline__c <= Date.today()) ){ - sbmdata.extraInfo = 'round-disabled'; - } - } - - // Filter matches - for( Brackets_Match__c m : this.parent.matchMap.values() ){ - if( m.Brackets_Round__r.RoundNumber__c.intValue() == lastRoundNumber ){ - sbmatch = m; - break; - } - } - - champion = this.parent.teamMap.get( sbmatch.WinnerBrackets_Team__c ); - - // Populate Home/Visitor - sbmdata.match = sbmatch; - sbmdata.home = populateTeamData( CHAMPIONSHIP_FLAG, lastRound, lastRoundNumber, sbmatch, 0, this.parent.teamMap.get( sbmatch.HomeBrackets_Team__c ), true ); - sbmdata.visitor = populateTeamData( CHAMPIONSHIP_FLAG, lastRound, lastRoundNumber, sbmatch, 0, this.parent.teamMap.get( sbmatch.VisitorBrackets_Team__c ), false ); - - if( sbmatch.WinnerBrackets_Team__c != null ){ - sbmdata.winner.team = this.parent.teamMap.get( sbmatch.WinnerBrackets_Team__c ); - } - - if( this.parent.predictionMapByMatch.get( sbmatch.Id ) != null ){ - sbmdata.prediction.team = this.parent.teamMap.get( - this.parent.predictionMapByMatch.get( sbmatch.Id ).PredictedWinnerBrackets_Team__c - ); - } - - // biggame champion - td.className = 'team superchampion'; - - // biggame prediction - if( this.parent.predictionMapByMatch.get(sbmatch.Id) != null ){ - td.predId = this.parent.predictionMapByMatch.get(sbmatch.Id).Id; - predTeam = this.parent.teamMap.get( this.parent.predictionMapByMatch.get( sbmatch.Id ).PredictedWinnerBrackets_Team__c ); - } - - // Champion - if( champion != null && predTeam != null){ - td.team = champion; - td.predicted = predTeam; - td.className += predTeam.Id == champion.Id ? ' success' : ' failure'; - } - else if( champion != null && predTeam == null){ - td.team = champion; - } - else if( champion == null && predTeam != null ){ - td.predicted = predTeam; - td.className += ' prediction droppable'; - } - else{ - td.className += ' superchampion-empty droppable'; - } - - sbmdata.champion = td; - - return sbmdata; - } - - - - -} \ No newline at end of file diff --git a/src/classes/BracketsTreeViewStandard.cls b/src/classes/BracketsTreeViewStandard.cls deleted file mode 100644 index c77975c..0000000 --- a/src/classes/BracketsTreeViewStandard.cls +++ /dev/null @@ -1,282 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -public with sharing class BracketsTreeViewStandard { - - //------------------------------------------------------------------------- - // Constants & Variables - //------------------------------------------------------------------------- - - public static final String FINAL_FLAG = 'CHAMPIONSHIP'; - - private BracketsTreeView parent = null; - private Integer currentInitHeight = 0; - private Integer currentBlockHeight = 0; - - //------------------------------------------------------------------------- - // Getters and Setters - //------------------------------------------------------------------------- - - public List orderedRounds { get; set; } - - public String getTournamentId() { return this.parent.tournamentId; } - public String getGroupId() { return this.parent.groupId; } - public Brackets_Tournament__c getTournament() { return this.parent.tournament; } - public Brackets_UserTournament__c getUserTournament() { return this.parent.userTournament; } - public String getTournamentClass() { return this.parent.tournamentClass; } - - public List getMatches() { return this.parent.matchesByPosition; } - - //------------------------------------------------------------------------- - // Constructors - //------------------------------------------------------------------------- - - /** - * Create a new controller instance - */ - public BracketsTreeViewStandard(BracketsTreeView parentTree){ - this.parent = parentTree; - this.orderedRounds = populateRoundData(); - } - - //------------------------------------------------------------------------- - // Private methods - //------------------------------------------------------------------------- - - /** - * Populate round datatypes - */ - private List populateRoundData(){ - Brackets_Round__c currentRound = null; - List currentRoundMatches = new List(); - List nextRoundMatches = new List(); - - List result = new List(); - BracketsTreeView.RoundData rdt = null; - Integer roundTotal = this.parent.roundsByNumber.size() - 1; - - this.currentInitHeight = 0; - this.currentBlockHeight = 0; - - for(Integer i = 0; i < this.parent.roundsByNumber.size(); i++){ - currentRound = this.parent.roundsByNumber[i]; - - rdt = new BracketsTreeView.RoundData(); - rdt.round = currentRound; - rdt.className = 'round'; - - // Block round - //RSC Legacy - /* - if( this.parent.isGroupByRound() ){ - if( currentRound.Deadline__c == null || (currentRound.Deadline__c <= Date.today()) ){ - rdt.className += ' round-disabled'; - } - } - */ - - // First round - if( i == 0 ){ - currentRoundMatches = this.parent.filterMatchesByRound( currentRound.Id, this.parent.matchesByPosition ); - nextRoundMatches = this.parent.getNextMatches( currentRoundMatches ); - } - // Final - else if( i == roundTotal ){ - currentRoundMatches = nextRoundMatches; - } - // Inner round - else{ - currentRoundMatches = nextRoundMatches; - nextRoundMatches = this.parent.getNextMatches( currentRoundMatches ); - } - - this.currentBlockHeight = 40 * Math.pow(2, i).intValue(); - - rdt.matches = populateMatchData( currentRound, i, currentRoundMatches, (i == roundTotal ? true : false) ); - result.add(rdt); - } - - return result; - } - - /** - * Populate match datatypes - */ - private List populateMatchData(Brackets_Round__c round, Integer roundNumber, List source, Boolean isFinal ){ - List result = new List(); - - for(Integer i = 0; i < source.size(); i++){ - result.add( populateMatchData(round, roundNumber, source[i], i, isFinal) ); - } - - return result; - } - - /** - * Populate match datatype - */ - private BracketsTreeView.MatchData populateMatchData( Brackets_Round__c round, Integer roundNumber, Brackets_Match__c match, Integer matchNumber, Boolean isFinal ){ - BracketsTreeView.MatchData md = new BracketsTreeView.MatchData(); - - md.isFinal = isFinal; - md.className = 'match'; - md.spacerHeight = roundNumber == 0 ? this.currentBlockHeight : (matchNumber == 0 ? this.currentInitHeight : this.currentBlockHeight); - md.blockHeight = this.currentBlockHeight - 2; - - if( matchNumber == 0 ){ - this.currentInitHeight = this.currentBlockHeight / 2; - } - - if( match != null ){ - md.match = match; - md.home = populateTeamData( round, roundNumber, match, this.parent.teamMap.get( match.HomeBrackets_Team__c ), true ); - md.visitor = populateTeamData( round, roundNumber, match, this.parent.teamMap.get( match.VisitorBrackets_Team__c), false ); - - if( match.WinnerBrackets_Team__c != null ){ - md.winner.team = this.parent.teamMap.get( match.WinnerBrackets_Team__c ); - } - - if( this.parent.predictionMapByMatch.get( match.Id ) != null ){ - md.prediction.team = this.parent.teamMap.get( this.parent.predictionMapByMatch.get( match.Id ).PredictedWinnerBrackets_Team__c ); - } - } - - // Draw spacer? - if( roundNumber == 0 && matchNumber == 0 ){ - md.spacer = false; - } - - // Champion - if( isFinal ){ - md.champion = populateChampion( match, this.parent.teamMap.get( match.WinnerBrackets_Team__c ) ); - } - - return md; - } - - /** - * Populate team datatype - */ - private BracketsTreeView.TeamData populateTeamData( Brackets_Round__c round, Integer roundNumber, Brackets_Match__c match, Brackets_Team__c team, Boolean isHome ){ - BracketsTreeView.TeamData td = new BracketsTreeView.TeamData(); - Boolean locked = true; - Brackets_Team__c predTeam = null; - Id predId = null; - Id predMatchId = null; - - td.className = 'team'; - td.className += isHome ? ' home' : ' visitor'; - - // Not first round - if( roundNumber != 0 ){ - td.className += ' inner'; - } - - // Match locked/unlocked - if( !this.parent.lockMatch(match, round) ){ - locked = false; - td.className += ' unlocked'; - } - - // Score - td.score = isHome ? match.HomeScore__c.intValue() : match.VisitorScore__c.intValue(); - - // Prediction - if( isHome && this.parent.homePredictionMap.get(match.Id) != null ){ - predMatchId = this.parent.homePredictionMap.get(match.Id); - predTeam = this.parent.teamMap.get( this.parent.predictionMapByMatch.get( predMatchId ).PredictedWinnerBrackets_Team__c ); - - td.predId = this.parent.predictionMapByMatch.get(predMatchId).Id; - } - else if( !isHome && this.parent.visitorPredictionMap.get(match.Id) != null ){ - predMatchId = this.parent.visitorPredictionMap.get(match.Id); - predTeam = this.parent.teamMap.get( this.parent.predictionMapByMatch.get( predMatchId ).PredictedWinnerBrackets_Team__c ); - - td.predId = this.parent.predictionMapByMatch.get(predMatchId).Id; - } - - // Team - if( team != null && predTeam != null ){ - td.team = team; - td.predicted = predTeam; - td.className += predTeam.Id == team.Id ? ' success' : ' failure'; - } - else if( team != null && predTeam == null ){ - td.team = team; - } - else if( team == null && predTeam != null ){ - td.predicted = predTeam; - td.className += ' prediction droppable'; - } - else { - td.className += ' team-empty droppable'; - } - - td.className += !locked ? ' draggable' : ''; - - return td; - } - - /** - * Populate final - */ - private BracketsTreeView.TeamData populateChampion( Brackets_Match__c match, Brackets_Team__c champion ){ - BracketsTreeView.TeamData td = new BracketsTreeView.TeamData(); - Brackets_Team__c predTeam = null; - - td.className = 'team champion'; - - // Prediction - if( this.parent.predictionMapByMatch.get(match.Id) != null ){ - td.predId = this.parent.predictionMapByMatch.get(match.Id).Id; - predTeam = this.parent.teamMap.get( this.parent.predictionMapByMatch.get( match.Id ).PredictedWinnerBrackets_Team__c ); - } - - // Champion - if( champion != null && predTeam != null){ - td.team = champion; - td.predicted = predTeam; - td.className += predTeam.Id == champion.Id ? ' success' : ' failure'; - } - else if( champion != null && predTeam == null){ - td.team = champion; - } - else if( champion == null && predTeam != null ){ - td.predicted = predTeam; - td.className += ' prediction droppable'; - } - else{ - td.className += ' champion-empty droppable'; - } - - return td; - } - - -} \ No newline at end of file diff --git a/src/classes/BracketsTreeViewTest.cls b/src/classes/BracketsTreeViewTest.cls deleted file mode 100644 index dc60a9b..0000000 --- a/src/classes/BracketsTreeViewTest.cls +++ /dev/null @@ -1,304 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ -@isTest -private class BracketsTreeViewTest { - - static testmethod void testStandardTree() { - - BracketsTournamentUtilities.CreatingTournamentTree = true; - - //Create a user - User testUser = BracketsTestUtilities.createUser(); - - System.runAs(testUser) { - - - Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament('Test1 General Prediction Controller', 4); - - Brackets_Group__c groupp = BracketsTestUtilities.getGroup(tournament.Id); - - Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); - Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team'); - Brackets_Team__c teamC = BracketsTestUtilities.createTeam('C-Team'); - Brackets_Team__c teamD = BracketsTestUtilities.createTeam('D-Team'); - - List auxList = new List(); - auxList.add( teamA ); - auxList.add( teamB ); - auxList.add( teamC ); - auxList.add( teamD ); - upsert auxList; - - - Brackets_Round__c round = BracketsTestUtilities.createRound(tournament,1, null,4,'Round1-Test'); - - Brackets_Round__c round2 = BracketsTestUtilities.createRound(tournament,2, null,8,'Round2-Test'); - - - Brackets_Match__c match = BracketsTestUtilities.createMatch(teamA, teamB, round, BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN); - - Brackets_Match__c match2 = BracketsTestUtilities.createMatch(teamC, teamD, round, BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN); - - round.Deadline__c = match.schedule__c.addMinutes(-5); - update round; - - Brackets_Match__c match3 = BracketsTestUtilities.createMatch(null, null, round2, BracketsTournamentUtilities.NFL_CONFERENCE_AMERICAN); - round2.Deadline__c = match3.schedule__c.addMinutes(-5); - update round2; - - match.FollowingBrackets_Match__c = match3.id; - match.FollowingIsHome__c = true; - update match; - - match2.FollowingBrackets_Match__c = match3.id; - update match2; - - Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament(Userinfo.getUserId(), tournament.Id, groupp.Id); - - //build the base controller - BracketsTreeView tree = new BracketsTreeView(tournament.id, groupp, false, null); - - //test basics - System.assert(tree.tournament != null); - System.assert(tree.teamMap.size() == auxList.size()); - System.assert(tree.roundsByNumber.size() == 2); - System.assert(tree.matchesByPosition.size() == 3); - - //now we should test the tree view standard - BracketsTreeViewStandard standard = new BracketsTreeViewStandard(tree); - - //so some additional tests - System.assert(standard.orderedRounds != null); - System.assert(standard.orderedRounds.size() == 2); - System.assert(standard.getTournamentId() == ''+tournament.id); - System.assert(standard.getGroupId() == ''+groupp.id); - - //lets do some work on the orderedRounds - for (BracketsTreeView.RoundData current : standard.orderedRounds) { - System.assert(current.matches != null); - System.assert(current.round != null); - } - BracketsTreeView.RoundData postRound1 = standard.orderedRounds.get(0); - System.assert(postRound1.matches.size() ==2); - BracketsTreeView.MatchData postMatch1 = postRound1.matches.get(0); - System.assert(postMatch1.match != null); - System.assert(postMatch1.home != null); - System.assert(postMatch1.home.team.Name == teamA.name); - System.assert(postMatch1.visitor.team.Name == teamB.name); - - BracketsTreeView.MatchData postMatch2 = postRound1.matches.get(1); - System.assert(postMatch2.match != null); - System.assert(postMatch2.home != null); - System.assert(postMatch2.home.team.Name == teamC.name); - System.assert(postMatch2.visitor.team.Name == teamD.name); - - BracketsTreeView.RoundData postRound2 = standard.orderedRounds.get(1); - System.debug('postRound2: ' +postRound2 ); - System.assert(postRound2.matches.size() ==1); - BracketsTreeView.MatchData postMatch3 = postRound2.matches.get(0); - System.assert(postMatch3.match != null); - System.assert(postMatch3.home != null); - System.assert(postMatch3.home.team == null); - System.assert(postMatch3.visitor != null); - System.assert(postMatch3.visitor.team == null); - - //lets turn off - BracketsTournamentUtilities.CreatingTournamentTree = true; - - //now let's create a prediction or two - Brackets_UserMatchPred__c p1 = BracketsTestUtilities.createPrediction(userTournament, match, teamA); - Brackets_UserMatchPred__c p2 = BracketsTestUtilities.createPrediction(userTournament, match2, teamD); - Brackets_UserMatchPred__c p3 = BracketsTestUtilities.createPrediction(userTournament, match3, teamA); - - //now let's mark one team a winner - match.WinnerBrackets_Team__c = teamA.Id; - match.HomeScore__c = 10; - update match; - - //now let's rebuild some objects and see how it looks - tree = new BracketsTreeView(tournament.id, groupp, false, null); - standard = new BracketsTreeViewStandard(tree); - - //double check a few things - postRound1 = standard.orderedRounds.get(0); - System.assert(postRound1.matches.size() ==2); - postMatch1 = postRound1.matches.get(0); - System.assert(postMatch1.match != null); - System.assert(postMatch1.home != null); - System.assert(postMatch1.home.team.Name == teamA.name); - System.assert(postMatch1.home.predicted == null); - System.assert(postMatch1.visitor.team.Name == teamB.name); - System.assert(postMatch1.visitor.predicted == null); - System.assert(postMatch1.winner.team != null); - System.assert(postMatch1.winner.team.Name == teamA.name); - - postMatch2 = postRound1.matches.get(1); - System.assert(postMatch2.match != null); - System.assert(postMatch2.home != null); - System.assert(postMatch2.home.team.Name == teamC.name); - System.assert(postMatch2.visitor.team.Name == teamD.name); - System.assert(postMatch2.winner.team == null); - System.assert(postMatch2.prediction.team.Name == teamD.name); - - postRound2 = standard.orderedRounds.get(1); - System.assert(postRound2.matches.size() ==1); - postMatch3 = postRound2.matches.get(0); - System.assert(postMatch3.match != null); - System.assert(postMatch3.home.team == null); - System.assert(postMatch3.home.predicted != null); - System.assert(postMatch3.champion != null); - - System.assert(postMatch3.visitor != null); - System.assert(postMatch3.visitor.team == null); - - - } - - - - } - - static testmethod void testFootballTree() { - - BracketsTournamentUtilities.CreatingTournamentTree = false; - - //Create a user - User testUser = BracketsTestUtilities.createUser(); - - System.runAs(testUser) { - - - Brackets_Tournament__c tournament = BracketsTestUtilities.createTournament('Small Season 2010', 12, BracketsTournamentUtilities.NFL_PLAYOFF_TOURNAMENT_TYPE); - - Brackets_Group__c groupp = BracketsTestUtilities.getGroup(tournament.Id); - - Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); - Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team'); - Brackets_Team__c teamC = BracketsTestUtilities.createTeam('C-Team'); - Brackets_Team__c teamD = BracketsTestUtilities.createTeam('D-Team'); - Brackets_Team__c teamE = BracketsTestUtilities.createTeam('E-Team'); - Brackets_Team__c teamF = BracketsTestUtilities.createTeam('F-Team'); - Brackets_Team__c teamG = BracketsTestUtilities.createTeam('G-Team'); - Brackets_Team__c teamH = BracketsTestUtilities.createTeam('H-Team'); - Brackets_Team__c teamI = BracketsTestUtilities.createTeam('I-Team'); - Brackets_Team__c teamJ = BracketsTestUtilities.createTeam('J-Team'); - Brackets_Team__c teamK = BracketsTestUtilities.createTeam('K-Team'); - Brackets_Team__c teamL = BracketsTestUtilities.createTeam('L-Team'); - - List auxList = new List(); - auxList.add( teamA ); - auxList.add( teamB ); - auxList.add( teamC ); - auxList.add( teamD ); - auxList.add( teamE ); - auxList.add( teamF ); - auxList.add( teamG ); - auxList.add( teamH ); - auxList.add( teamI ); - auxList.add( teamJ ); - auxList.add( teamK ); - auxList.add( teamL ); - upsert auxList; - - //let's make sure we have four rounds - List rounds = [Select Id, Name, Deadline__c From Brackets_Round__c Where Brackets_Tournament__c =: tournament.id Order By RoundNumber__c]; - System.assert(rounds.size() == 4); - - //make sure that round 0 has 4 matches - Brackets_Round__c r = rounds.get(0); - List matches = [Select Id, Name, Conference__c, Position__c, FollowingBrackets_Match__c From Brackets_Match__c where Brackets_Round__c =: r.id Order By Position__c]; - System.assert(matches.size() ==4); - - Brackets_Match__c m1 = matches.get(0); - m1.HomeBrackets_Team__c = teamA.id; - m1.VisitorBrackets_Team__c = teamB.id; - - Brackets_Match__c m2 = matches.get(1); - m2.HomeBrackets_Team__c = teamC.id; - m2.VisitorBrackets_Team__c = teamD.id; - - Brackets_Match__c m3 = matches.get(2); - m3.HomeBrackets_Team__c = teamE.id; - m3.VisitorBrackets_Team__c = teamF.id; - - Brackets_Match__c m4 = matches.get(3); - m4.HomeBrackets_Team__c = teamG.id; - m4.VisitorBrackets_Team__c = teamH.id; - - update matches; - - Brackets_Round__c r2 = rounds.get(1); - List matches2 = [Select Id, Name, Conference__c, Position__c, FollowingBrackets_Match__c From Brackets_Match__c where Brackets_Round__c =: r2.id Order By Position__c]; - - Brackets_Match__c m5 = matches2.get(0); - //m5.HomeBrackets_Team__c = teamA.id; - m5.VisitorBrackets_Team__c = teamI.id; - System.assert(m1.FollowingBrackets_Match__c == m5.Id); - - Brackets_Match__c m6 = matches2.get(1); - m6.HomeBrackets_Team__c = teamJ.id; - //m5.VisitorBrackets_Team__c = teamI.id; - System.assert(m2.FollowingBrackets_Match__c == m6.Id); - - Brackets_Match__c m7 = matches2.get(2); - //m7.HomeBrackets_Team__c = teamK.id; - m7.VisitorBrackets_Team__c = teamK.id; - System.assert(m3.FollowingBrackets_Match__c == m7.Id); - - Brackets_Match__c m8 = matches2.get(3); - m8.HomeBrackets_Team__c = teamL.id; - //m8.VisitorBrackets_Team__c = teamL.id; - System.assert(m4.FollowingBrackets_Match__c == m8.Id); - - update matches2; - - //now start to get a bunch of the football tree - Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament(Userinfo.getUserId(), tournament.Id, groupp.Id); - - //build the base controller - BracketsTreeView tree = new BracketsTreeView(tournament.id, groupp, false, null); - - //test basics - System.assert(tree.tournament != null); - System.assert(tree.teamMap.size() == auxList.size()); - System.assert(tree.roundsByNumber.size() == 4); - System.assert(tree.matchesByPosition.size() == 11); - - //now we should test the tree view football - BracketsTreeViewFootball football = new BracketsTreeViewFootball(tree); - - //make sure some of the basics work - System.assert(football.orderedAFCRounds.size() == 3); - System.assert(football.orderedNFCRounds.size() == 3); - - } - } - - -} \ No newline at end of file diff --git a/src/classes/BracketsTriggerUtilities.cls b/src/classes/BracketsTriggerUtilities.cls deleted file mode 100644 index 627d12c..0000000 --- a/src/classes/BracketsTriggerUtilities.cls +++ /dev/null @@ -1,108 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -public with sharing class BracketsTriggerUtilities { - - //Brackets_Match__c - public static List triggerMatchList = new List(); - public static Map triggerMatchMap = new Map(); - public static List triggerMatchIds = new List(); - public static Map triggerListObject = new Map (); - - //Brackets_Round__c - public static List triggerRoundList = new List(); - public static Map triggerRoundMap = new Map(); - public static List triggerRoundIds = new List(); - public static Map triggerRoundObject = new Map(); - - //Brackets_Tournament__c - public static List triggerTournamentList = new List(); - public static Map triggerTournamentMap = new Map(); - public static List triggerTournamentIds = new List(); - public static Map triggerTournamentObject = new Map(); - - - - /** - * Populate all list if are not yet. - * @params matchList : Get the list of current Matchs - */ - public static void newTriggerInstance( List matchList ) { - - - - if( BracketsTriggerUtilities.triggerTournamentList.isEmpty() && !matchList.isEmpty() ) { - - List auxMatch = new List(); - String auxTourId; - for( Brackets_Match__c mi : matchList ) { auxMatch.add( mi.Id ); } - for( Brackets_Match__c t : [Select Brackets_Round__r.Brackets_Tournament__c from Brackets_Match__c where Id IN : auxMatch] ){ - auxTourId = t.Brackets_Round__r.Brackets_Tournament__c; - break; - } - - - - for( Brackets_Tournament__c t : [ Select t.isChild__c, t.Version__c, t.Update_Source__c, t.Type__c, t.TeamCount__c, t.Start__c, t.Allow_Update__c, - t.Name, t.MaxRoundNumber__c, t.Id, t.ExternalId__c, t.End__c, t.Description__c, t.CronTrigger__c, - (Select Id, Name, Deadline__c, ExternalId__c, RoundNumber__c, ScorePoints__c, End__c, - MinScheduleBrackets_Match__c, Start__c, Brackets_Tournament__c From Rounds__r) - from Brackets_Tournament__c t where t.Id =: auxTourId ] ) { - //-------- Populate the Different List and Maps -----------------// - - //Tournament - BracketsTriggerUtilities.triggerTournamentList.add( t ) ; - BracketsTriggerUtilities.triggerTournamentMap.put( t.Id , t ); - BracketsTriggerUtilities.triggerTournamentIds.add( t.Id ); - - //Rounds - for( Brackets_Round__c r : t.Rounds__r ) { - BracketsTriggerUtilities.triggerRoundList.add( r ) ; - BracketsTriggerUtilities.triggerRoundIds.add( r.Id ); - BracketsTriggerUtilities.triggerRoundMap.put( r.Id, r ); - } - }//EndFor - - //Populate Brackets_Match__c with all matches for this tournament - for( Brackets_Match__c m : [ Select m.WinnerBrackets_Team__c, m.VisitorBrackets_Team__c, m.VisitorScore__c, m.Schedule__c, m.Brackets_Round__c, - m.Position__c, m.Name, m.Id, m.HomeBrackets_Team__c, m.HomeScore__c, m.FollowingBrackets_Match__c, - m.FollowingIsHome__c, m.ExternalId__c, m.Description__c, m.Conference__c From Brackets_Match__c m - where m.Brackets_Round__c IN: BracketsTriggerUtilities.triggerRoundIds ] ){ - - //-------- Populate Match List and Maps -----------------// - BracketsTriggerUtilities.triggerMatchList.add( m ) ; - BracketsTriggerUtilities.triggerMatchIds.add( m.Id ); - BracketsTriggerUtilities.triggerMatchMap.put( m.Id, m ); - - } - - }//EndIf - } - -} \ No newline at end of file diff --git a/src/classes/BracketsUserMatchJSONObjectHandler.cls b/src/classes/BracketsUserMatchJSONObjectHandler.cls deleted file mode 100644 index d4fb08b..0000000 --- a/src/classes/BracketsUserMatchJSONObjectHandler.cls +++ /dev/null @@ -1,119 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -public with sharing class BracketsUserMatchJSONObjectHandler { - - public static final String matchKey = 'matchId'; - public static final String teamKey = 'teamId'; - public static final String userMatchPredictionKey = 'userPred'; - public static final String userTournamentKey = 'userTour'; - - public List matchesPredictionList; - - /** - * Constructor - */ - public BracketsUserMatchJSONObjectHandler(){ - matchesPredictionList = new List(); - } - - /** - * Given an string with json, map this to a map of sObject. - * - * @param jsonString a string containing a json array - */ - public void processJSON( String jsonString){ - Brackets_UserMatchPred__c userMatchPrediction; - String userMatchPredId; - BracketsJSONObject bracketsjsonObjectChild; - BracketsJSONObject bracketsjsonObject; - try{ - bracketsjsonObject = new BracketsJSONObject(new BracketsJSONObject.JSONTokener(jsonString)); - for(String key : bracketsjsonObject.keys()){ - bracketsjsonObjectChild = bracketsjsonObject.getValue(key).obj; - userMatchPrediction = createMatchPredictionSObject(bracketsjsonObjectChild); - matchesPredictionList.add(userMatchPrediction); - } - } - catch(BracketsJSONObject.JSONException e){ - throw (Exception)e; - } - } - - private Brackets_UserMatchPred__c createMatchPredictionSObject(BracketsJSONObject bracketsjsonObject){ - Brackets_UserMatchPred__c userMatchPrediction = new Brackets_UserMatchPred__c(); - String teamId = (String)bracketsjsonObject.get(teamKey); - String matchId = (String)bracketsjsonObject.get(matchKey); - String userTournamentId = (String)bracketsjsonObject.get(userTournamentKey); - if(teamId != ''){ - userMatchPrediction.PredictedWinnerBrackets_Team__c = (Id)teamId; - } - userMatchPrediction.Brackets_Match__c = (Id)matchId; - userMatchPrediction.Brackets_UserTournament__c = (Id)userTournamentId; - return userMatchPrediction; - } - - public static testMethod void testProcessJSON(){ - Brackets_Tournament__c tournament = BracketsTestUtilities.getNewStandardTournament(); - Brackets_Group__c groupp = BracketsTestUtilities.getGroup(tournament.Id); - Brackets_Team__c teamA = BracketsTestUtilities.createTeam('A-Team'); - Brackets_Team__c teamB = BracketsTestUtilities.createTeam('B-Team'); - - List auxList = new List(); - auxList.add( teamA ); - auxList.add( teamB ); - upsert auxList; - - Brackets_Round__c round = BracketsTestUtilities.createSimpleRound(tournament); - Brackets_Match__c match = BracketsTestUtilities.createMatch( teamA,teamB,round, null); - Brackets_UserTournament__c userTournament = BracketsTestUtilities.createUserTournament(Userinfo.getUserId(), tournament.Id, groupp.Id); - String jsonString = '{ "0" : { "matchId" : "'+match.Id+'" ,"userTour" : "'+userTournament.Id+'", "teamId" : "'+teamA.Id+'" , "userPred" : "" }}'; - - BracketsUserMatchJSONObjectHandler handler = new BracketsUserMatchJSONObjectHandler(); - handler.processJSON(jsonString); - System.assert(handler.matchesPredictionList.size() == 1,'Should have a user match prediction empty at least.'); - Brackets_UserMatchPred__c prediction = handler.matchesPredictionList.get(0); - System.assert( prediction.Brackets_Match__c == match.Id && - prediction.Brackets_UserTournament__c == userTournament.Id && - prediction.PredictedWinnerBrackets_Team__c == teamA.Id, 'This prediction should have a match '+match.Id+ - ' ,an userTournament '+userTournament.Id+' and a predictedWinnerTeam '+ teamA.Id); - } - - public static testMethod void testProcessWrongJSON(){ - String jsonString = ' "0" : { "matchId" : "" ,"userTour" : "", "teamId" : "" , "userPred" : "" }}'; - BracketsUserMatchJSONObjectHandler handler = new BracketsUserMatchJSONObjectHandler(); - try{ - handler.processJSON(jsonString); - System.assert(false,'This line shouldn\'t be executed'); - }catch(Exception e){ - System.assert(true,'An error should happen when parsing the JSON.'); - } - - } -} \ No newline at end of file diff --git a/src/classes/BracketsUserTournamentUtilities.cls b/src/classes/BracketsUserTournamentUtilities.cls deleted file mode 100644 index 165e86a..0000000 --- a/src/classes/BracketsUserTournamentUtilities.cls +++ /dev/null @@ -1,188 +0,0 @@ -/* -Copyright (c) 2011, salesforce.com, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the salesforce.com, Inc. nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - -*/ - -public with sharing class BracketsUserTournamentUtilities { - - public static String userTournamentAlreadyRegisteredError = 'You were already registered to this tournament.'; - - /** - * Given a user id returns all the matche predictions of him. - * - * @param user user to obtain the info. - * @return a list of user tournaments. - */ - public static List getUserTournamentsFromUser(Id user){ - List userTournamentList = new List(); - Map userTournamentMap = new Map (); - for(Brackets_UserTournament__c userTournament : [select Id,Brackets_Tournament__r.Id,Brackets_Tournament__r.Name,Brackets_Group__c,Brackets_Tournament__c,User__c from Brackets_UserTournament__c where user__c =: user]){ - userTournamentMap.put(userTournament.Brackets_Tournament__r.Id, userTournament); - } - for(String id : userTournamentMap.keySet()){ - userTournamentList.add(userTournamentMap.get(id)); - } - return userTournamentList; - } - - /** - * Given a user id returns all the matche predictions of him. - * - * @param tournamentId tournament id - * @param groupId group id - * @param userId user to obtain the info. - * @return a list of user tournaments. - */ - public static List getUserTournaments(Id tournamentId,Id groupId, Id userId ){ - return [select Id,Name,Brackets_Group__c,Brackets_Tournament__c,User__c from Brackets_UserTournament__c where Brackets_Group__c =: groupId and Brackets_Tournament__c =:tournamentId and User__c =: userId]; - } - - - /** - * Save a list of user tournaments - * - * @param userTournamentList a list of user tournament - */ - public static void save( List userTournamentList ){ - List userTournamentListToSave = new List(); - try{ - for(Brackets_UserTournament__c userTournament : userTournamentList){ - if(userTournament.Brackets_Group__c != null){ - userTournamentListToSave.add(userTournament); - } - - } - Database.upsert(userTournamentListToSave, false); - - suscribe(userTournamentListToSave); - }catch(Exception e){ - throw e; - } - } - - /** - * Check existing joined to tournaments - * - * @param userTournamentList a list of usertournament sobject to join tournamento to groups - */ - public static void checkJoinedTournaments(List userTournamentNewList){ - Boolean isAlreadyJoined = false; - List groupIds = new List(); - List tournamentIds = new List(); - for(Brackets_UserTournament__c userTournamentNew : userTournamentNewList){ - groupIds.add(userTournamentNew.Brackets_Group__c); - tournamentIds.add(userTournamentNew.Brackets_Tournament__c); - } - - for(Brackets_UserTournament__c userTournament : [SELECT Id,Brackets_Group__c,Brackets_Group__r.Name, Brackets_Tournament__c,User__c - FROM Brackets_UserTournament__c - WHERE Brackets_Tournament__c IN: tournamentIds AND - Brackets_Group__c IN: groupIds]){ - for(Brackets_UserTournament__c userTournamentNew : userTournamentNewList){ - isAlreadyJoined = userTournament.Id != userTournamentNew.Id && - userTournament.Brackets_Tournament__c == userTournamentNew.Brackets_Tournament__c && - userTournament.Brackets_Group__c == userTournamentNew.Brackets_Group__c && - userTournament.User__c == userTournamentNew.User__c; - if(isAlreadyJoined){ - userTournamentNew.Brackets_Group__c.addError('You can\'t join again.'); - break; - } - } - } - } - - - - /** - * Enter a EntitySubcription - */ - public static void userSuscribe( List utNewList ){ - try { - List entSusc = new List(); - for( Brackets_UserTournament__c ut : utNewList ){ - EntitySubscription ents = new EntitySubscription(); - ents.ParentId = ut.Brackets_Group__c; - ents.SubscriberId = Userinfo.getUserId(); - entSusc.add( ents ); - } - upsert entSusc; - } - catch( Exception e ){ - } - } - - - /** - * Given a list of usertournament, create the necessary suscription to follow to its corresponding - * group. - * - * @param userTournamentList a list of usertournament sobject. - */ - private static void suscribe(List userTournamentList){ - List entitySuscriptionsList = new List(); - EntitySubscription entitySubscription; - for(Brackets_UserTournament__c userTournament : userTournamentList){ - if(userTournament.Id != null){ - entitySubscription = new EntitySubscription(); - entitySubscription.ParentId = userTournament.Brackets_Group__c; - entitySubscription.SubscriberId = userTournament.User__c; - entitySuscriptionsList.add(entitySubscription); - } - } - if(!entitySuscriptionsList.isEmpty()){ - try{ - Database.insert(entitySuscriptionsList,false) ; - }catch(Exception e){ - //if this part of the code some subscriptions were already done. - } - } - } - - private static testMethod void allMethods(){ - delete [select id from Brackets_UserTournament__c]; - Brackets_UserTournament__c userTournamentRetrieved; - Brackets_Tournament__c myTour = BracketsTestUtilities.getNewStandardTournament(); - Brackets_Group__c myGroup = BracketsTestUtilities.getGroup( myTour.Id ); - Brackets_UserTournament__c uTour = BracketsTestUtilities.createUserTournament( UserInfo.getUserId(), myTour.Id, myGroup.Id ); - - List userTournaments = BracketsUserTournamentUtilities.getUserTournaments(myTour.Id, myGroup.Id, UserInfo.getUserId()); - System.assert(!userTournaments.isEmpty(),'Should have a user tournament with group '+myGroup.Id+' and tournament '+myTour.Id); - userTournamentRetrieved = userTournaments.get(0); - System.assert(userTournamentRetrieved.Id == uTour.Id); - - userTournaments = BracketsUserTournamentUtilities.getUserTournamentsFromUser(UserInfo.getUserId()); - System.assert(!userTournaments.isEmpty(),'Should have a user tournament with group '+myGroup.Id+' and tournament '+myTour.Id); - - BracketsUserTournamentUtilities.save(userTournaments); - BracketsUserTournamentUtilities.checkJoinedTournaments(userTournaments); - BracketsUserTournamentUtilities.userSuscribe(userTournaments); - - - - } - -} \ No newline at end of file diff --git a/src/components/BracketsChatter.component b/src/components/BracketsChatter.component deleted file mode 100644 index 2d95cb8..0000000 --- a/src/components/BracketsChatter.component +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/components/BracketsChatter.component-meta.xml b/src/components/BracketsChatter.component-meta.xml deleted file mode 100644 index dc9cd49..0000000 --- a/src/components/BracketsChatter.component-meta.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - 20.0 - This is a generic template for Apex Component. With this template, you may adjust the default elements and values and add new elements and values. - - diff --git a/src/components/BracketsLeaderboard.component b/src/components/BracketsLeaderboard.component deleted file mode 100644 index 0625272..0000000 --- a/src/components/BracketsLeaderboard.component +++ /dev/null @@ -1,38 +0,0 @@ - - - - - -

    Sorted by tournament, pool and then points; first 1000.

    - - - - User - - - - Tournament - - - - Pool - - - - Points - - - - Tiebreaker - - - - View - - - - - -
    - -
    \ No newline at end of file diff --git a/src/components/BracketsLeaderboard.component-meta.xml b/src/components/BracketsLeaderboard.component-meta.xml deleted file mode 100644 index 7a09b39..0000000 --- a/src/components/BracketsLeaderboard.component-meta.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - 20.0 - This is a generic template for Apex Component. With this template, you may adjust the default elements and values and add new elements and values. - - diff --git a/src/components/BracketsPoolList.component b/src/components/BracketsPoolList.component deleted file mode 100644 index 6e505d5..0000000 --- a/src/components/BracketsPoolList.component +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - Action - - Join This Pool - - - Play Now - - - - - Name - - {!groupWrap.groupp.Name} - - - - - - - Tournament - - - - - Type - - - - - Members - - - - - Status - {!groupWrap.Status} - - - - - - - - - - \ No newline at end of file diff --git a/src/components/BracketsPoolList.component-meta.xml b/src/components/BracketsPoolList.component-meta.xml deleted file mode 100644 index 13d65de..0000000 --- a/src/components/BracketsPoolList.component-meta.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - 20.0 - This is a generic template for Apex Component. With this template, you may adjust the default elements and values and add new elements and values. - - diff --git a/src/components/BracketsPredictionGameDetailHover.component b/src/components/BracketsPredictionGameDetailHover.component deleted file mode 100644 index c52bbaf..0000000 --- a/src/components/BracketsPredictionGameDetailHover.component +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - -
    -
    -
    - - -
    -
    -
    - - -
    -
    -
    -
    \ No newline at end of file diff --git a/src/components/BracketsPredictionGameDetailHover.component-meta.xml b/src/components/BracketsPredictionGameDetailHover.component-meta.xml deleted file mode 100644 index 720faba..0000000 --- a/src/components/BracketsPredictionGameDetailHover.component-meta.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - 20.0 - This is a generic template for Apex Component. With this template, you may adjust the default elements and values and add new elements and values. - - diff --git a/src/components/BracketsPredictionMatchDetail.component b/src/components/BracketsPredictionMatchDetail.component deleted file mode 100644 index 88edf1b..0000000 --- a/src/components/BracketsPredictionMatchDetail.component +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - - - - - -
    - - - -
    {!match.Brackets_Round__r.Name}
    - {!IF(home.ShortName__c != null, home.ShortName__c, home.Name)} - {!IF(homePredicted.ShortName__c != null, homePredicted.ShortName__c, homePredicted.Name)} - - {!CEILING(scoreHome)} - -- -  :  - -- - {!CEILING(scoreVisitor)} - - {!IF(visitor.ShortName__c != null, visitor.ShortName__c, visitor.Name)} - {!IF(visitorPredicted.ShortName__c!= null, visitorPredicted.ShortName__c, visitorPredicted.Name)} -
    - - - - {!IF(NOT(ISNULL(winner.ShortName__c)), winner.ShortName__c, winner.Name )} - - - - Prediction : {!predicted.Name } - -
    - - - - \ No newline at end of file diff --git a/src/components/BracketsPredictionMatchDetail.component-meta.xml b/src/components/BracketsPredictionMatchDetail.component-meta.xml deleted file mode 100644 index a92a1e7..0000000 --- a/src/components/BracketsPredictionMatchDetail.component-meta.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - 20.0 - This is a generic template for Apex Component. With this template, you may adjust the default elements and values and add new elements and values. - - diff --git a/src/components/BracketsPredictionSingleTeam.component b/src/components/BracketsPredictionSingleTeam.component deleted file mode 100644 index 2c6813a..0000000 --- a/src/components/BracketsPredictionSingleTeam.component +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - -
    -
    - - - - ? - - - - -
    - -
    - - - {!IF(team.ShortName__c != null, team.ShortName__c,team.Name)} -   - - - - {!IF(predicted.ShortName__c != null, predicted.ShortName__c,predicted.Name)} -   - - - - {!score} -
    -
    - - -
    \ No newline at end of file diff --git a/src/components/BracketsPredictionSingleTeam.component-meta.xml b/src/components/BracketsPredictionSingleTeam.component-meta.xml deleted file mode 100644 index 523524a..0000000 --- a/src/components/BracketsPredictionSingleTeam.component-meta.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - 20.0 - This is a generic template for Apex Component. With this template, you may adjust the default elements and values and add new elements and values. - - diff --git a/src/components/BracketsPredictionsFootballPlayoffs.component b/src/components/BracketsPredictionsFootballPlayoffs.component deleted file mode 100644 index 0234d64..0000000 --- a/src/components/BracketsPredictionsFootballPlayoffs.component +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - - - - - - - - -
    -
    - - - - - - - - - - -
    Round 1Round 2Round 3Round 4
     
    Round 3Round 2Round 1
    -
    -
    -
    - - - - - - - - - - -
    - - - - - -
    - - - - - - - -
    -
    - - - -
    - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    - - -
    -
    -
    - - - - - - - - -
    - - - - - - - - - - - - -
    -
    -
    - - -
    - -
    - - - - - -
    -
    - - -
    - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    -
    - - -
    - - - - - - - -
    \ No newline at end of file diff --git a/src/components/BracketsPredictionsFootballPlayoffs.component-meta.xml b/src/components/BracketsPredictionsFootballPlayoffs.component-meta.xml deleted file mode 100644 index 8b8798b..0000000 --- a/src/components/BracketsPredictionsFootballPlayoffs.component-meta.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - 20.0 - This is a generic template for Apex Component. With this template, you may adjust the default elements and values and add new elements and values. - - diff --git a/src/components/BracketsPredictionsStandard.component b/src/components/BracketsPredictionsStandard.component deleted file mode 100644 index 019d5d8..0000000 --- a/src/components/BracketsPredictionsStandard.component +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - -
    - - -
    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    -
    -
    -
    -
    -
    - -
    \ No newline at end of file diff --git a/src/components/BracketsPredictionsStandard.component-meta.xml b/src/components/BracketsPredictionsStandard.component-meta.xml deleted file mode 100644 index f41a99e..0000000 --- a/src/components/BracketsPredictionsStandard.component-meta.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - 20.0 - This is a generic template for Apex Component. With this template, you may adjust the default elements and values and add new elements and values. - - diff --git a/src/objects/BracketsSettings2__c.object b/src/objects/BracketsSettings2__c.object deleted file mode 100644 index 86b11d8..0000000 --- a/src/objects/BracketsSettings2__c.object +++ /dev/null @@ -1,15 +0,0 @@ - - - List - Protected - false - false - - Hide_Help_Dialog__c - false - false - - Checkbox - - - diff --git a/src/objects/BracketsSettingsPersonal__c.object b/src/objects/BracketsSettingsPersonal__c.object deleted file mode 100644 index 3530c25..0000000 --- a/src/objects/BracketsSettingsPersonal__c.object +++ /dev/null @@ -1,29 +0,0 @@ - - - Hierarchy - Public - false - false - - Hide_Dialog_Predictions__c - false - false - - Checkbox - - - Initial_Setup_Complete__c - false - false - - Checkbox - - - Initial_Setup_Step_2_Complete__c - false - false - - Checkbox - - - diff --git a/src/objects/Brackets_Group__c.object b/src/objects/Brackets_Group__c.object deleted file mode 100644 index 97fdf80..0000000 --- a/src/objects/Brackets_Group__c.object +++ /dev/null @@ -1,150 +0,0 @@ - - - - Accept - Default - - - Clone - Default - - - Delete - Default - - - Edit - Default - - - List - Default - - - New - Default - - - Tab - Default - - - View - Default - - Deployed - false - false - true - false - false - - Brackets_Tournament__c - false - - Brackets_Tournament__c - Pools - false - Lookup - - - NumOfMembers__c - Numbers of members joined to this group. - false - - Brackets_UserTournament__c.Brackets_Group__c - count - Summary - - - Status__c - false - - - - Open - true - - - Closed - false - - false - - false - Picklist - - - TournamentType__c - false - Text(Brackets_Tournament__r.Type__c) - BlankAsZero - - false - Text - false - - - Type__c - false - Round By Round lets users predict a single round at a time. Full Tournament requires full prediction up front and cannot be changed. - - - - Full Tournament - true - - - Round By Round - false - - false - - false - Picklist - - - - - false - Text - - Pools - - ReadWrite - - TournamentNotUpdatable - true - NOT(ISNEW()) && ISCHANGED( Brackets_Tournament__c ) - Brackets_Tournament__c - This field can't be updated. - - - TypeNotUpdatable - true - NOT(ISNEW()) && ISCHANGED( Type__c ) - Type__c - This field can't be updated. - - - Join - online - button - javascript - Join - onClickJavaScript - false - location.href="/apex/BracketsJoinInvitedUser?gId={!Brackets_Group__c.Id}"; - - - Manage - online - button - 600 - url - Manage - sidebar - false - /apex/BracketsPredictions?show={!Brackets_Group__c.Id} - - diff --git a/src/objects/Brackets_Match__c.object b/src/objects/Brackets_Match__c.object deleted file mode 100644 index 0f33d31..0000000 --- a/src/objects/Brackets_Match__c.object +++ /dev/null @@ -1,294 +0,0 @@ - - - - Accept - Default - - - Clone - Default - - - Delete - Default - - - Edit - Default - - - List - Default - - - New - Default - - - Tab - Default - - - View - Default - - Deployed - false - false - false - false - true - - Brackets_Round__c - false - - Brackets_Round__c - Matches - Matches - 0 - MasterDetail - false - - - Conference__c - false - If rounds are grouped in conferences, this is the conference the match is part of. - - 255 - false - Text - false - - - Description__c - false - Short description of the match - - false - TextArea - - - ExternalId__c - true - - 50 - false - Text - false - - - FollowingBrackets_Match__c - false - - Brackets_Match__c - PreviousMatches - PreviousMatches - Lookup - - - FollowingIsHome__c - true - false - - Checkbox - - - HomeBrackets_Team__c - false - - Brackets_Team__c - HomeMatches - HomeMatch - Lookup - - - HomePrediction__c - 0 - false - - 18 - false - 0 - Number - false - - - HomeScore__c - 0 - false - Score of Team 1 after the match end. - - 10 - false - 0 - Number - false - - - Position__c - 1 - Keep the position respect to its round, each position should be unique. - false - - 18 - false - 0 - Number - false - - - Schedule__c - false - Date of the match - - false - DateTime - - - VisitorBrackets_Team__c - false - - Brackets_Team__c - VisitorMatches - VisitorMatches - Lookup - - - VisitorPrediction__c - 0 - false - - 18 - false - 0 - Number - false - - - VisitorScore__c - 0 - false - Score of Team 2 after the match end. - - 10 - false - 0 - Number - false - - - WinnerBrackets_Team__c - false - Match winner (Team 1 or Team 2) - - Brackets_Team__c - WinnerMatches - WinnerMatches - Lookup - - - isLocked__c - false - false - - Checkbox - - - - All - HomeBrackets_Team__c - HomeScore__c - VisitorBrackets_Team__c - VisitorScore__c - VisitorPrediction__c - isLocked__c - Position__c - FollowingBrackets_Match__c - Everything - - - - MA-{00000} - - AutoNumber - - Matches - - New - - ControlledByParent - - Conference_read_only - false - NOT(ISNEW()) && ISCHANGED( Conference__c ) - Conference__c - This field is not updatable. - - - DifferentTeams - true - The home and visitor teams must be different teams - AND(AND(NOT( ISBLANK( VisitorBrackets_Team__c ) ),NOT( ISBLANK( HomeBrackets_Team__c ) )),HomeBrackets_Team__c = VisitorBrackets_Team__c) - Team 1 and Team 2 must be different - - - PositiveScores - true - Scores must be a positive numbers - HomeScore__c < 0 || VisitorScore__c < 0 - The score must be a positive number - - - ScheduleAfterDeadlineRound - true - And ( -!isBlank(Schedule__c), -!isBlank(Brackets_Round__r.Deadline__c), -Schedule__c < Brackets_Round__r.Deadline__c -) - Schedule__c - This date must be greater than the round's deadline. - - - Scores_can_not_be_null - true - If the Winner Team is establish, the scores can not be null or empty - !ISNULL( WinnerBrackets_Team__c ) && -( !ISNUMBER( TEXT(VisitorScore__c) ) || !ISNUMBER( TEXT(HomeScore__c)) ) - WinnerBrackets_Team__c - Scores can not be null - - - Scores_with_no_winner - true - Avoid to set scores when the Winner team is not established. - (HomeScore__c > 0 || VisitorScore__c > 0) && WinnerBrackets_Team__c == null - WinnerBrackets_Team__c - Select the Winner Team - - - WinnerTeamGreaterScoreThanOpponent - true - IF( ISBLANK( WinnerBrackets_Team__c),false, - OR( - AND( - WinnerBrackets_Team__c == HomeBrackets_Team__c,HomeScore__c <= VisitorScore__c - ), - AND( - WinnerBrackets_Team__c == VisitorBrackets_Team__c,HomeScore__c >= VisitorScore__c ) - ) -) - WinnerBrackets_Team__c - A Winner must have an score greater than its opponent. - - - WinnerTeamSubset - true - The winner team can be empty or must be the Team 1 or Team 2 - WinnerBrackets_Team__c <> "" && -WinnerBrackets_Team__c <> HomeBrackets_Team__c && -WinnerBrackets_Team__c <> VisitorBrackets_Team__c - WinnerBrackets_Team__c - The winner must be the Team 1 or the Team 2 - - diff --git a/src/objects/Brackets_Round__c.object b/src/objects/Brackets_Round__c.object deleted file mode 100644 index 055bdce..0000000 --- a/src/objects/Brackets_Round__c.object +++ /dev/null @@ -1,170 +0,0 @@ - - - - Accept - Default - - - Clone - Default - - - Delete - Default - - - Edit - Default - - - List - Default - - - New - Default - - - Tab - Default - - - View - Default - - Deployed - false - false - false - false - true - - Brackets_Tournament__c - false - - Brackets_Tournament__c - Rounds - Rounds - 0 - MasterDetail - false - - - Deadline__c - false - Last date to make predictions for the round. - - false - DateTime - - - End__c - false - End date of the round, calculated with the date of the last match. - - Brackets_Match__c.Schedule__c - Brackets_Match__c.Brackets_Round__c - max - Summary - - - ExternalId__c - true - - 50 - false - Text - false - - - MinScheduleBrackets_Match__c - false - - Brackets_Match__c.Schedule__c - Brackets_Match__c.Brackets_Round__c - min - Summary - - - RoundNumber__c - 0 - false - Number indicating the position of the round, being 1 the first round - - 18 - false - 0 - Number - false - - - ScorePoints__c - 0 - false - Points a user wins for each correct prediction in the round - - 10 - true - 0 - Number - false - - - Start__c - false - Start date of the round, calculated with the date of the first match. - - Brackets_Match__c.Schedule__c - Brackets_Match__c.Brackets_Round__c - min - Summary - - - - - Text - - Rounds - - New - - ControlledByParent - - DeadlineBeforeSchedule - true - Deadline__c > MinScheduleBrackets_Match__c - Deadline__c - This date is greater than their matches's schedule. - - - DeadlineBeforeStart - true - The deadline must be before the first game - and ( -!isblank(Deadline__c), -!isblank(Start__c), -Deadline__c > Start__c ) - The deadline must be before the first game (round) - - - PositiveScorePoints - true - The score points must be a positive integer - ScorePoints__c < 0 - Score points must be positive - - - PositveRoundNumber - true - The round number must be positive - RoundNumber__c < 0 - The round number must be positive - - - RoundNumberNotUpdateable - true - NOT(ISNEW()) && ISCHANGED( RoundNumber__c ) - RoundNumber__c - This field is not updatable. - - diff --git a/src/objects/Brackets_Team__c.object b/src/objects/Brackets_Team__c.object deleted file mode 100644 index d39c41e..0000000 --- a/src/objects/Brackets_Team__c.object +++ /dev/null @@ -1,137 +0,0 @@ - - - - Accept - Default - - - Clone - Default - - - Delete - Default - - - Edit - Default - - - List - Default - - - New - Default - - - Tab - Default - - - View - Default - - Deployed - false - false - true - false - true - - Description__c - false - Team full description - - false - false - TextArea - - - ExternalId__c - true - - 50 - false - false - Text - false - - - Rank__c - false - Team ranking - - 10 - false - 0 - false - Number - false - - - ShortName__c - false - Short name (max 9 chars) to show on predictions tree - - 9 - false - false - Text - false - - - - All - NAME - ShortName__c - Description__c - Everything - - - - All1 - Everything - - - - - false - Text - - Teams - - ReadWrite - - RankGreaterOrEqualThanZero - true - Rank__c < 0 - Rank__c - This value must be greater or equal than zero. - - - Export - online - massActionButton - javascript - Export - onClickJavaScript - false - true - var records = {!GETRECORDIDS( $ObjectType.Brackets_Team__c )} ; -var oName = 'Team'; -var error = false; -var msj = ''; -if( records.length < 1 ){ - error = true; - msj = 'Please select at least one Team!'; -} - -if( error ) { - alert( msj ); -} -else{ - location.href = '/apex/ExportTeams?refId='+records+'&refType='+oName; -} - - diff --git a/src/objects/Brackets_Tournament__c.object b/src/objects/Brackets_Tournament__c.object deleted file mode 100644 index 3ca4b53..0000000 --- a/src/objects/Brackets_Tournament__c.object +++ /dev/null @@ -1,211 +0,0 @@ - - - - Accept - Default - - - Clone - Default - - - Delete - Default - - - Edit - Default - - - List - Default - - - New - Default - - - Tab - Default - - - View - Default - - Deployed - false - false - false - false - true - - Allow_Update__c - false - false - - Checkbox - - - CronTrigger__c - false - Save CronTrigger Referenced ID - false - - 255 - false - Text - true - - - Deadline__c - false - Deadline for the "Full tournament" type pools. - - false - DateTime - - - Description__c - false - General description of the tournament. - - false - TextArea - - - End__c - false - Tournament end date, calculated with the date of the last match played - - Brackets_Round__c.End__c - Brackets_Round__c.Brackets_Tournament__c - max - Summary - - - ExternalId__c - true - - 50 - false - Text - false - - - MaxRoundNumber__c - false - - Brackets_Round__c.RoundNumber__c - Brackets_Round__c.Brackets_Tournament__c - max - Summary - - - Start__c - false - Tournament start date, calculated with the date of the first match played - - Brackets_Round__c.Start__c - Brackets_Round__c.Brackets_Tournament__c - min - Summary - - - TeamCount__c - 0 - false - Number of teams that participate in the tournament - - 10 - true - 0 - Number - false - - - Type__c - false - Which type of tournament this is? - -Types supported include: "NFL Playoff" with fixed 12 teams and "Standard" a single elimination type of tournament. - - - - NFL Playoff - false - - - Standard - true - - false - - Picklist - - - Update_Source__c - false - - false - Url - - - Version__c - 1 - false - - 18 - false - 0 - Number - false - - - isChild__c - false - Enabled if a tournament is imported from a URL - false - - Checkbox - - - - All - NAME - Allow_Update__c - isChild__c - Type__c - Update_Source__c - Version__c - Everything - - - - - Text - - Tournaments - - ReadWrite - - DeadlineBeforeStart - true - Tournament deadline must be set before the first match - NOT(ISNULL(Deadline__c)) && NOT(ISNULL( Start__c)) && Deadline__c > Start__c - The tournament deadline must be before the first game. - - - TeamCountGraterThanTwo - true - TeamCount must be greater than 2 - ISPICKVAL( Type__c, "Standard" ) && ( TeamCount__c < 2 ) - The tournament must have at least 2 teams - - - TypeNotUpdateable - true - NOT(ISNEW()) && ISCHANGED( Type__c ) - Type__c - This field can't be updated. - - diff --git a/src/objects/Brackets_UserMatchPred__c.object b/src/objects/Brackets_UserMatchPred__c.object deleted file mode 100644 index 4aa6359..0000000 --- a/src/objects/Brackets_UserMatchPred__c.object +++ /dev/null @@ -1,101 +0,0 @@ - - - - Accept - Default - - - Clone - Default - - - Delete - Default - - - Edit - Default - - - List - Default - - - New - Default - - - Tab - Default - - - View - Default - - Deployed - false - false - false - false - true - - Brackets_Match__c - false - - Brackets_Match__c - UserMatchPredictions - UserMatchPredictions - Lookup - - - Brackets_UserTournament__c - false - - Brackets_UserTournament__c - UserMatchPredictions - UserMatchPredictions - 0 - MasterDetail - false - - - Points__c - 0 - false - - 10 - false - 0 - Number - false - - - PredictedWinnerBrackets_Team__c - false - - Brackets_Team__c - UserMatchPredictions - UserMatchPredictions - Lookup - - - - UMP-{00000} - - AutoNumber - - UserMatchPredictions - - ControlledByParent - - UserPredictionBeforeDeadlineRound - true - //deactivated as we need to update this object with points scored -- gives a false positive. - IF( -and( -ISPICKVAL(Brackets_UserTournament__r.Brackets_Group__r.Type__c, 'Round'), -ISCHANGED( PredictedWinnerBrackets_Team__c ) ) -,Brackets_Match__r.Brackets_Round__r.Deadline__c < NOW(), false) - Prediction for this match can be done after deadline of its round. - - diff --git a/src/objects/Brackets_UserTournament__c.object b/src/objects/Brackets_UserTournament__c.object deleted file mode 100644 index 3ad78fe..0000000 --- a/src/objects/Brackets_UserTournament__c.object +++ /dev/null @@ -1,144 +0,0 @@ - - - - Accept - Default - - - Clone - Default - - - Delete - Default - - - Edit - Default - - - List - Default - - - New - Default - - - Tab - Default - - - View - Default - - Deployed - false - false - false - false - true - - Brackets_Group__c - false - - Brackets_Group__c - UserTornaments - 0 - MasterDetail - false - - - Brackets_Tournament__c - false - - Brackets_Tournament__c - UserTornaments - Lookup - - - Championship_Point_Prediction__c - false - Used for breaking any ties. Enter the total number of points scored by both teams in the championship game. - - 4 - false - 0 - Number - false - - - Points__c - false - - Brackets_UserMatchPred__c.Points__c - Brackets_UserMatchPred__c.Brackets_UserTournament__c - sum - Summary - - - Tiebreaker_Points__c - false - if (now() > Brackets_Group__r.Brackets_Tournament__r.End__c ,text(Championship_Point_Prediction__c) , 'xxx') - BlankAsZero - - false - Text - false - - - User__c - false - - User - UserTornaments - Lookup - - - View__c - false - IF( -$User.Id == User__r.Id , -HYPERLINK('/apex/BracketsPredictions?show=' + Brackets_Group__c , 'Manage Predictions'), -HYPERLINK('/apex/BracketsPredictions?view=' + Id , 'Show Predictions')) - BlankAsZero - - false - Text - false - - - - All1 - User__c - Brackets_Tournament__c - Brackets_Group__c - Points__c - View__c - Everything - - - - All_Tournaments - User__c - Points__c - Brackets_Tournament__c - Brackets_Group__c - View__c - Everything - - - - UT-{00000} - - AutoNumber - - Pool Members - - New - ChangeOwner - Accept - Brackets_Tournament__c - - ControlledByParent - diff --git a/src/package.xml b/src/package.xml deleted file mode 100644 index ec14b91..0000000 --- a/src/package.xml +++ /dev/null @@ -1,96 +0,0 @@ - - - - BracketsBatchUserMatchPrediction - BracketsException - BracketsExportImportTest - BracketsExportTeams - BracketsFeedItemUtility - BracketsGetStartedController - BracketsGroupUtilities - BracketsImportExportUtilities - BracketsImportTeams - BracketsImportTournament - BracketsImportTournamentController - BracketsJSONObject - BracketsJSONObjectHandler - BracketsJoinInvitedUser - BracketsLeaderboardController - BracketsMatchUtilities - BracketsMatchesPredictionUtil - BracketsPoolController - BracketsPredictionsController - BracketsProccessUpdate - BracketsRoundUtilities - BracketsSitesTournamentPublisher - BracketsTeamUtilities - BracketsTestUtilities - BracketsTournamentButtonsController - BracketsTournamentUtilities - BracketsTreeView - BracketsTreeViewController - BracketsTreeViewFootball - BracketsTreeViewStandard - BracketsTreeViewTest - BracketsTriggerUtilities - BracketsUserMatchJSONObjectHandler - BracketsUserTournamentUtilities - ApexClass - - - * - ApexComponent - - - BracketsAbout - BracketsImportTournament - BracketsJoinInvitedUser - BracketsPools - BracketsPredictions - BracketsScoreBoard - BracketsTournamentLayoutButtons - BracketsUpdateTournament - ApexPage - - - * - ApexTrigger - - - Brackets - CustomApplication - - - * - CustomObject - - - About_Brackets - Matches_Predictions - CustomTab - - - Brackets_Group__c-Group Layout - Brackets_Group__c-Pool Layout - Brackets_Match__c-Match Layout - Brackets_Round__c-Round Layout - Brackets_Team__c-Team Layout - Brackets_Tournament__c-Admin Brackets Tournament Layout - Brackets_Tournament__c-Tournament Layout - Brackets_Tournament__c-User Brackets Tournament Layout - Brackets_UserMatchPred__c-UserMatchPrediction Layout - Brackets_UserTournament__c-Pool Members Layout - Brackets_UserTournament__c-User Tournament Layout - Brackets_UserTournament__c-UserTournament Layout - Layout - - - BracketsGettingStartedTournament - RemoteSiteSetting - - - * - StaticResource - - 20.0 - diff --git a/src/pages/BracketsAbout.page b/src/pages/BracketsAbout.page deleted file mode 100644 index 05b2a7c..0000000 --- a/src/pages/BracketsAbout.page +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - -

    Congratulations! You have successfully installed Brackets.

    - -

    Brackets is easy to configure and simple to play. - This screen helps you initialize your app in two steps. - The first gives you a sample to experiment with now, the second will give you the full 64 team tournament when it is ready.

    - -

    The Configuration Guide at the bottom of this page shows you how to configure your profile permissions for players. Also, there are a number of Handy Links at the bottom.

    - -

    Have questions? Please post them to Salesforce Answers.

    - -
    - - - -
      -
    • All Tournament, All Groups Leaderboard
    • -
    • Import Tournament Page - Also Use For Updates
    • -
    • Tournaments - List all Tournaments.
    • -
    • Pools - List all Pools.
    • -
    • Teams - List all Teams.
    • -
    - -
    - - -
    - - - - - - - - - - -

    Import this short SAMPLE tournament in order to familiarize yourself and your users with the app.

    - - -

    Error

    -
    - - - - - - - - - - - - - - - - - - - -

    Congratulations! You have successfully imported the sample tournament.

    - -

    Visit the Play Brackets page now.

    - -
    - - -
    - -
    - -
    -
    -
    -
    - - - - - -

    Import the full 64 team basketball tournament bracket. Bracket will be ready on March 14, 2011, at Noon EST. - Note: this tournament will skip the initial four play-in games and start with "Round 2".

    - - -

    Error:  

    -
    - - - - - - - - - - - - - - - - - - - -

    Step 2 Ready to Play

    -
    - - -
    - - - -
    -
    - -
    - - - - - - - -

    Step 1: Update Tab Visibility Settings

    - -

    Users should only see tabs they might use. This means you should hide the "Admins Get Started Here" tab.

    - -

    Step 2: Ensure Appropriate Object Access

    - -

    - -

    Step 3: Enable Apex Classes and Visualforce Pages

    - -

    Once you have updated the object access rights, save your profile changes. - On the detail screen for that profile, scroll until you see the Enabled Apex Class Access and the Enabled Visualforce Page Access section. - Enable your users for all classes and pages that start with "Brackets".

    - -

    - -
    - - - -

    Once Brackets is configured, users should always land on the "Play Brackets" home page.

    - -

    Setup > App Setup > Create > Apps > Brackets > Edit.

    - -

    - -
    - - - -

    Once Brackets is installed and configured, it's easy for your users to join in.

    - -
      - -
    • Step 1: Tell your users about the app. Send an email. Post about it on Chatter. Let them know about the sample tournament and that the full tournament will be coming on Monday.
    • - -
    • Step 2: March 14, 15 and 16th will be heavy activity days for basketball fans. Remind them that the app exists.
    • - -
    • Step 3: Reach out to marginal sports fans and tell them about Round-By-Round games where they can pick new teams every time.
    • - -
    • Step 4: Keep your tournament results up to date! You won't need to do any data entry, but you will need to click an "Update" button once or twice a day.
    • - -
    - -

    Sample Chatter Post

    - -

    Hello everyone! - We've deployed a great app to help you manage your basketball brackets. - It's called Brackets and it's in the menu at the top of your screen. It's easy to play so check it out today.

    - -

    Sample With Screenshots

    - -

    Hi everyone -- Check out what's new in the app -- Brackets!! Joining is as simple as 1-2-3. Try it today! Everything kicks off on March 14th!

    - -

    - -

    - - - - -
    - - - -

    Keeping your tournaments up to date is easy. Click on the Import Tournaments link and click on the "Update" button near your tournament.

    - -

    Note: you can update as often as you like. There is no limit.

    - -

    - -
    - - - -
      -
    • All Tournament, All Groups Leaderboard
    • -
    • Import Tournament Page - Also Use For Updates
    • -
    • Tournaments - List all Tournaments.
    • -
    • Pools - List all Pools.
    • -
    • Teams - List all Teams.
    • -
    - -
    - - - -

    In the event of a tie, how do I see players' Championship Points predictions? Points will show on the Leaderboard once the tournament end day has passed.

    - - - - -
    - -
    - - - \ No newline at end of file diff --git a/src/pages/BracketsImportTournament.page b/src/pages/BracketsImportTournament.page deleted file mode 100644 index 5d873ea..0000000 --- a/src/pages/BracketsImportTournament.page +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - -
    - Important: You must add the URL to Remote Sites : - Setup->Security->Remote Site Setting. -
    -
    - - - - - - - - - - - - -
    - - - {!statusText} - - -
    - - - - - - - {!xmlMessage} - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameVersionCreated ByCreated DateLast Modify ByLast Modify DateActions
    - - - - - - - - - - -
    -
    -
    - -
    -
    -
    - -
    \ No newline at end of file diff --git a/src/pages/BracketsJoinInvitedUser.page b/src/pages/BracketsJoinInvitedUser.page deleted file mode 100644 index e067f6e..0000000 --- a/src/pages/BracketsJoinInvitedUser.page +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - Do you want to join this pool?

    - - -

    -
    -
    -
    -
    - -
    - - -
    - - -
    \ No newline at end of file diff --git a/src/pages/BracketsPools.page b/src/pages/BracketsPools.page deleted file mode 100644 index 59c866f..0000000 --- a/src/pages/BracketsPools.page +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/pages/BracketsPredictions.page b/src/pages/BracketsPredictions.page deleted file mode 100644 index b235e69..0000000 --- a/src/pages/BracketsPredictions.page +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - - - - - - -
    Predictions for this round are not allowed!
    -
    Predictions for the tournament are not allowed!
    - - - - - - - - - - - - -
    -

     - 

    -
    - -
    - Predictions for:   -
    -
    - - - -
    - - - - - - - - -
    -
    - Help   -
    -
    - Predictions Remaining:  -
    - -
    - Active Round:  -
    -
    -
    -
    - Deadline:  -
    - - - Pool Predictions Are LOCKED. - -
    -
    - - Total Championship Game Points Prediction: - - - -
    -
    -
    - - Latest Chatter{!lastChatterUpdate} (more) - -
    -
    - - - - - - -
    - - - -
    - - - - - -
    -
    - - -
    - - -
    -
      -
    • Double click on a team to make your prediction.
    • -
    • Hover on a team name to see team details.
    • -
    • Click on an arrow to see the team page.
    • -
    • Hover on a diamond to see game details.
    • -
    • Click save when you have completed your predictions.
    • -
    • Be sure to enter your championship game points prediciton.
    • -
    • View performance on the Leaderboard.
    • -
    - -

    Hide this dialog

    -
    -
    - - - -
    - - - -
    - -
    - -
    - - - - - - -

    -
    - - - - - - - - - - \ No newline at end of file diff --git a/src/pages/BracketsTournamentLayoutButtons.page b/src/pages/BracketsTournamentLayoutButtons.page deleted file mode 100644 index bea613b..0000000 --- a/src/pages/BracketsTournamentLayoutButtons.page +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - - - -
    In order to publish, Site must be created
    -
    - - - - -
    - - - - - - - - -
    Is ready to publish



    -
    - - -
    Cannot publish yet. All starting matches much be complete before publishing. Check your matches.
    -


    -
    - - -
    - Tournament has been published!.
    - Import Link : {!finalUrl} -
    -
    - -
    - -
    - - - - - - - - - - / - - - - - ?id={!HTMLENCODE(myTournament.Id)}
    - -



    -
    - -
    - -
    -
    - -
    - - - - - - - - - - - - - - {!xmlMessage} - - - - - - - -
    - -
    - -
    \ No newline at end of file diff --git a/src/pages/BracketsUpdateTournament.page b/src/pages/BracketsUpdateTournament.page deleted file mode 100644 index 80ede53..0000000 --- a/src/pages/BracketsUpdateTournament.page +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/src/staticresources/Brackets.resource b/src/staticresources/Brackets.resource deleted file mode 100644 index fe1aef8..0000000 Binary files a/src/staticresources/Brackets.resource and /dev/null differ diff --git a/src/triggers/BracketsMatch.trigger b/src/triggers/BracketsMatch.trigger deleted file mode 100644 index 3c82059..0000000 --- a/src/triggers/BracketsMatch.trigger +++ /dev/null @@ -1,51 +0,0 @@ -trigger BracketsMatch on Brackets_Match__c (after insert, after update, after delete, before update, before insert) { - - - if( !BracketsMatchUtilities.SKIP_TRIGGER && !BracketsTournamentUtilities.CreatingTournamentTree ) { - - if( trigger.isAfter || ( trigger.isUpdate && trigger.isBefore ) ){ BracketsTriggerUtilities.triggerListObject = trigger.newMap; } - BracketsTriggerUtilities.newTriggerInstance( trigger.new ); - - if( Trigger.isAfter ) { - - if( trigger.isInsert ) { - - } - - if( trigger.isUpdate ) { - BracketsMatchUtilities.checkLocked( Trigger.old , Trigger.new ); - // Update UserMatchPrediction points - BracketsMatchesPredictionUtil.updateUserMatchPredictionPoints(Trigger.new); - //Update the following matches - BracketsMatchUtilities.updateFollowingMatches( Trigger.new ); - } - - if( trigger.isDelete ) { - BracketsMatchUtilities.checkLocked( Trigger.old , Trigger.new ); - } - } - - if( trigger.isBefore ) { - - if( trigger.isInsert ) { - BracketsMatchUtilities.checkExistMatchesInRound( Trigger.new ); - BracketsMatchUtilities.dateMatchesValidation( Trigger.new ); - } - - if( trigger.isUpdate ) { - BracketsMatchUtilities.checkLocked( Trigger.old , Trigger.new ); - BracketsMatchUtilities.checkSetTeam( Trigger.new , Trigger.old ); - BracketsMatchUtilities.setWinnerTeam( Trigger.new , Trigger.old ); - BracketsMatchUtilities.checkRemovedTeam( Trigger.new , Trigger.old ); - BracketsMatchUtilities.publishOff(Trigger.new); - BracketsMatchUtilities.checkExistMatchesInRound( Trigger.new ); - BracketsMatchUtilities.dateMatchesValidation( Trigger.new ); - } - - if( trigger.isDelete ) { - BracketsMatchUtilities.checkLocked( Trigger.old , Trigger.new ); - } - - } - } -} \ No newline at end of file diff --git a/src/triggers/BracketsRound.trigger b/src/triggers/BracketsRound.trigger deleted file mode 100644 index cefb4c3..0000000 --- a/src/triggers/BracketsRound.trigger +++ /dev/null @@ -1,16 +0,0 @@ -trigger BracketsRound on Brackets_Round__c( before insert, before update ){ - - if( !BracketsTournamentUtilities.CreatingTournamentTree ){ - if( Trigger.isBefore){ - if(Trigger.isInsert || Trigger.isUpdate){ - BracketsRoundUtilities.checkRoundsIntegrity( Trigger.new ); - } - if(Trigger.isUpdate){ - BracketsRoundUtilities.publishOff(Trigger.new); - } - if(Trigger.isInsert){ - BracketsRoundUtilities.roundNumberOnInsert( Trigger.new ); - } - } - } -} \ No newline at end of file diff --git a/src/triggers/BracketsTeam.trigger b/src/triggers/BracketsTeam.trigger deleted file mode 100644 index fe20aa9..0000000 --- a/src/triggers/BracketsTeam.trigger +++ /dev/null @@ -1,8 +0,0 @@ -trigger BracketsTeam on Brackets_Team__c( before insert, before update, before delete ){ - - if( trigger.isBefore && trigger.isDelete ){ - if( !BracketsTeamUtilities.canDeleteTeams( trigger.old ) ){ - trigger.old.get(0).addError( 'Teams cannot be deleted, already in use within a Tournament!' ); - } - } -} \ No newline at end of file diff --git a/src/triggers/BracketsTournament.trigger b/src/triggers/BracketsTournament.trigger deleted file mode 100644 index 757daee..0000000 --- a/src/triggers/BracketsTournament.trigger +++ /dev/null @@ -1,21 +0,0 @@ -trigger BracketsTournament on Brackets_Tournament__c( before insert, before update, after insert, before delete ){ - - - if( !BracketsTournamentUtilities.CreatingTournamentTree ){ - if( Trigger.isBefore && Trigger.isInsert){ - BracketsTournamentUtilities.checkTeamCount(Trigger.new); - } - if( Trigger.isBefore && Trigger.isUpdate){ - BracketsTournamentUtilities.publishOff(Trigger.new, Trigger.old); - BracketsTournamentUtilities.checkTeamCountNotUpdateable(Trigger.new,Trigger.old); - } - // Create tourament tree skeleton - if( Trigger.isAfter && Trigger.isInsert){ - BracketsTournamentUtilities.createTournamentTree(Trigger.new); - } - } - - if( Trigger.isBefore && Trigger.isDelete ){ - BracketsGroupUtilities.deleteGroups(Trigger.old); - } -} \ No newline at end of file diff --git a/src/triggers/BracketsUserTournament.trigger b/src/triggers/BracketsUserTournament.trigger deleted file mode 100644 index 4df2eaa..0000000 --- a/src/triggers/BracketsUserTournament.trigger +++ /dev/null @@ -1,14 +0,0 @@ -trigger BracketsUserTournament on Brackets_UserTournament__c (after insert, after update, after delete, before update, before insert) { - - // Check Existing join to tournaments - if( Trigger.isBefore && Trigger.isInsert ){ - BracketsUserTournamentUtilities.checkJoinedTournaments( Trigger.new ); - } - - if( trigger.isAfter ){ - if( trigger.isInsert ){ - BracketsUserTournamentUtilities.userSuscribe( Trigger.new ); - } - } - -} \ No newline at end of file