diff --git a/.env.example b/.env.example index 337ec714db..20f71dc696 100755 --- a/.env.example +++ b/.env.example @@ -1,7 +1,7 @@ APP_ENV=production APP_DEBUG=false APP_KEY=SomeRandomStringOf32CharsExactly - +LOG_LEVEL=warning DB_CONNECTION=mysql DB_HOST=localhost diff --git a/.env.testing b/.env.testing index a7c8505a17..852745ab42 100755 --- a/.env.testing +++ b/.env.testing @@ -1,7 +1,7 @@ APP_ENV=testing APP_DEBUG=true APP_KEY=SomeRandomStringOf32CharsExactly - +LOG_LEVEL=debug DB_CONNECTION=sqlite DB_HOST=localhost diff --git a/.travis.yml b/.travis.yml index 61763a7648..f48b4f9dd9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ php: - 7 install: + - cp _development/phpunit.xml ./phpunit.xml - phpenv config-rm xdebug.ini - composer selfupdate - rm composer.lock diff --git a/CHANGELOG.md b/CHANGELOG.md index 90d89feb66..a54b72e062 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,20 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - No unreleased changes yet. +## [3.8.3] - 2016-04-17 +### Added +- New audit report to see what happened. + +### Changed +- New Chart JS release used. +- Help function is more reliable. + +### Fixed +- Expected bill amount is now correct. +- Upgrade will now invalidate cache. +- Search was broken. +- Queries run better + ## [3.8.2] - 2016-04-03 ### Added - Small user administration at /admin. diff --git a/.coveralls.yml b/_development/.coveralls.yml similarity index 100% rename from .coveralls.yml rename to _development/.coveralls.yml diff --git a/.csslintrc b/_development/.csslintrc similarity index 100% rename from .csslintrc rename to _development/.csslintrc diff --git a/.eslintignore b/_development/.eslintignore similarity index 100% rename from .eslintignore rename to _development/.eslintignore diff --git a/.eslintrc b/_development/.eslintrc similarity index 100% rename from .eslintrc rename to _development/.eslintrc diff --git a/.jshintrc b/_development/.jshintrc similarity index 100% rename from .jshintrc rename to _development/.jshintrc diff --git a/cover.sh b/_development/cover.sh similarity index 100% rename from cover.sh rename to _development/cover.sh diff --git a/favicon.pxm b/_development/favicon.pxm similarity index 100% rename from favicon.pxm rename to _development/favicon.pxm diff --git a/gulpfile.js b/_development/gulpfile.js similarity index 100% rename from gulpfile.js rename to _development/gulpfile.js diff --git a/phpspec.yml b/_development/phpspec.yml similarity index 100% rename from phpspec.yml rename to _development/phpspec.yml diff --git a/phpunit.cover.xml b/_development/phpunit.cover.xml similarity index 100% rename from phpunit.cover.xml rename to _development/phpunit.cover.xml diff --git a/phpunit.default.xml b/_development/phpunit.default.xml similarity index 100% rename from phpunit.default.xml rename to _development/phpunit.default.xml diff --git a/phpunit.xml b/_development/phpunit.xml similarity index 100% rename from phpunit.xml rename to _development/phpunit.xml diff --git a/pu.sh b/_development/pu.sh similarity index 100% rename from pu.sh rename to _development/pu.sh diff --git a/app/Bootstrap/ConfigureLogging.php b/app/Bootstrap/ConfigureLogging.php new file mode 100644 index 0000000000..23dc0980b8 --- /dev/null +++ b/app/Bootstrap/ConfigureLogging.php @@ -0,0 +1,43 @@ +useFiles($app->storagePath().'/logs/firefly-iii.log'); + } + + /** + * @param Application $app + * @param Writer $log + */ + protected function configureDailyHandler(Application $app, Writer $log) + { + $log->useDailyFiles( + $app->storagePath().'/logs/firefly-iii.log', + $app->make('config')->get('app.log_max_files', 5) + ); + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index d077819913..4540fcc9d8 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -22,6 +22,25 @@ use Illuminate\Foundation\Console\Kernel as ConsoleKernel; */ class Kernel extends ConsoleKernel { + + /** + * The bootstrap classes for the application. + * + * This needs to be for with the next upgrade. + * + * @var array + */ + protected $bootstrappers = [ + 'Illuminate\Foundation\Bootstrap\DetectEnvironment', + 'Illuminate\Foundation\Bootstrap\LoadConfiguration', + 'FireflyIII\Bootstrap\ConfigureLogging', + 'Illuminate\Foundation\Bootstrap\HandleExceptions', + 'Illuminate\Foundation\Bootstrap\RegisterFacades', + 'Illuminate\Foundation\Bootstrap\SetRequestForConsole', + 'Illuminate\Foundation\Bootstrap\RegisterProviders', + 'Illuminate\Foundation\Bootstrap\BootProviders', + ]; + /** * The Artisan commands provided by your application. * diff --git a/app/Events/TransactionJournalStored.php b/app/Events/TransactionJournalStored.php index a9b40ee71d..82653056a9 100644 --- a/app/Events/TransactionJournalStored.php +++ b/app/Events/TransactionJournalStored.php @@ -12,11 +12,11 @@ namespace FireflyIII\Events; use FireflyIII\Models\TransactionJournal; use Illuminate\Queue\SerializesModels; +use Log; /** * Class TransactionJournalStored * - * @codeCoverageIgnore * @package FireflyIII\Events */ class TransactionJournalStored extends Event @@ -35,6 +35,7 @@ class TransactionJournalStored extends Event */ public function __construct(TransactionJournal $journal, int $piggyBankId) { + Log::debug('Created new TransactionJournalStored.'); // $this->journal = $journal; $this->piggyBankId = $piggyBankId; diff --git a/app/Events/TransactionJournalUpdated.php b/app/Events/TransactionJournalUpdated.php index edb9a82a12..e6c11d44c1 100644 --- a/app/Events/TransactionJournalUpdated.php +++ b/app/Events/TransactionJournalUpdated.php @@ -5,11 +5,11 @@ namespace FireflyIII\Events; use FireflyIII\Models\TransactionJournal; use Illuminate\Queue\SerializesModels; +use Log; /** * Class TransactionJournalUpdated * - * @codeCoverageIgnore * @package FireflyIII\Events */ class TransactionJournalUpdated extends Event @@ -26,6 +26,7 @@ class TransactionJournalUpdated extends Event */ public function __construct(TransactionJournal $journal) { + Log::debug('Created new TransactionJournalUpdated'); // $this->journal = $journal; } diff --git a/app/Exceptions/FireflyException.php b/app/Exceptions/FireflyException.php index 88714ef34e..c931fa7e3a 100644 --- a/app/Exceptions/FireflyException.php +++ b/app/Exceptions/FireflyException.php @@ -6,7 +6,6 @@ namespace FireflyIII\Exceptions; /** * Class FireflyException * - * @codeCoverageIgnore * @package FireflyIII\Exceptions */ class FireflyException extends \Exception diff --git a/app/Exceptions/NotImplementedException.php b/app/Exceptions/NotImplementedException.php index 47c43b9e68..f5960285b8 100644 --- a/app/Exceptions/NotImplementedException.php +++ b/app/Exceptions/NotImplementedException.php @@ -6,7 +6,6 @@ namespace FireflyIII\Exceptions; /** * Class NotImplementedException * - * @codeCoverageIgnore * @package FireflyIII\Exceptions */ class NotImplementedException extends \Exception diff --git a/app/Exceptions/ValidationException.php b/app/Exceptions/ValidationException.php index 5da65aab66..a1b2ce127c 100644 --- a/app/Exceptions/ValidationException.php +++ b/app/Exceptions/ValidationException.php @@ -5,7 +5,6 @@ namespace FireflyIII\Exceptions; /** * Class ValidationExceptions * - * @codeCoverageIgnore * @package FireflyIII\Exception */ class ValidationException extends \Exception diff --git a/app/Export/Collector/AttachmentCollector.php b/app/Export/Collector/AttachmentCollector.php index 9eae15dc6e..ee361b604a 100644 --- a/app/Export/Collector/AttachmentCollector.php +++ b/app/Export/Collector/AttachmentCollector.php @@ -53,9 +53,9 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface } /** - * + * @return bool */ - public function run() + public function run(): bool { // grab all the users attachments: $attachments = $this->getAttachments(); @@ -70,6 +70,7 @@ class AttachmentCollector extends BasicCollector implements CollectorInterface $this->exportDisk->put($file, $this->explanationString); Log::debug('Also put explanation file "' . $file . '" in the zip.'); $this->getFiles()->push($file); + return true; } /** diff --git a/app/Export/Collector/BasicCollector.php b/app/Export/Collector/BasicCollector.php index ba597ebe40..fb894e0deb 100644 --- a/app/Export/Collector/BasicCollector.php +++ b/app/Export/Collector/BasicCollector.php @@ -40,7 +40,7 @@ class BasicCollector /** * @return Collection */ - public function getFiles() + public function getFiles(): Collection { return $this->files; } diff --git a/app/Export/Collector/CollectorInterface.php b/app/Export/Collector/CollectorInterface.php index e55d316733..303ffadfab 100644 --- a/app/Export/Collector/CollectorInterface.php +++ b/app/Export/Collector/CollectorInterface.php @@ -22,12 +22,12 @@ interface CollectorInterface /** * @return Collection */ - public function getFiles(); + public function getFiles(): Collection; /** * @return bool */ - public function run(); + public function run(): bool; /** * @param Collection $files diff --git a/app/Export/Collector/UploadCollector.php b/app/Export/Collector/UploadCollector.php index 25bfdf89b0..dc3a741fed 100644 --- a/app/Export/Collector/UploadCollector.php +++ b/app/Export/Collector/UploadCollector.php @@ -47,9 +47,9 @@ class UploadCollector extends BasicCollector implements CollectorInterface } /** - * + * @return bool */ - public function run() + public function run(): bool { // grab upload directory. $files = $this->uploadDisk->files(); @@ -58,6 +58,7 @@ class UploadCollector extends BasicCollector implements CollectorInterface foreach ($files as $entry) { $this->processOldUpload($entry); } + return true; } /** diff --git a/app/Export/ConfigurationFile.php b/app/Export/ConfigurationFile.php index f11fa68912..706b2550d7 100644 --- a/app/Export/ConfigurationFile.php +++ b/app/Export/ConfigurationFile.php @@ -38,9 +38,9 @@ class ConfigurationFile } /** - * @return bool + * @return string */ - public function make() + public function make(): string { $fields = array_keys(get_class_vars(Entry::class)); $types = Entry::getTypes(); diff --git a/app/Export/Entry.php b/app/Export/Entry.php index 59117e9bdb..4d6ea90311 100644 --- a/app/Export/Entry.php +++ b/app/Export/Entry.php @@ -171,7 +171,7 @@ class Entry /** * @return int */ - public function getBillId() + public function getBillId(): int { return $this->billId; } @@ -179,7 +179,7 @@ class Entry /** * @param int $billId */ - public function setBillId($billId) + public function setBillId(int $billId) { $this->billId = $billId; } @@ -187,7 +187,7 @@ class Entry /** * @return string */ - public function getBillName() + public function getBillName(): string { return $this->billName; } @@ -195,7 +195,7 @@ class Entry /** * @param string $billName */ - public function setBillName($billName) + public function setBillName(string $billName) { $this->billName = $billName; } @@ -203,7 +203,7 @@ class Entry /** * @return int */ - public function getBudgetId() + public function getBudgetId(): int { return $this->budgetId; } @@ -211,7 +211,7 @@ class Entry /** * @param int $budgetId */ - public function setBudgetId($budgetId) + public function setBudgetId(int $budgetId) { $this->budgetId = $budgetId; } @@ -219,7 +219,7 @@ class Entry /** * @return string */ - public function getBudgetName() + public function getBudgetName(): string { return $this->budgetName; } @@ -227,7 +227,7 @@ class Entry /** * @param string $budgetName */ - public function setBudgetName($budgetName) + public function setBudgetName(string $budgetName) { $this->budgetName = $budgetName; } @@ -235,7 +235,7 @@ class Entry /** * @return int */ - public function getCategoryId() + public function getCategoryId(): int { return $this->categoryId; } @@ -243,7 +243,7 @@ class Entry /** * @param int $categoryId */ - public function setCategoryId($categoryId) + public function setCategoryId(int $categoryId) { $this->categoryId = $categoryId; } @@ -251,7 +251,7 @@ class Entry /** * @return string */ - public function getCategoryName() + public function getCategoryName(): string { return $this->categoryName; } @@ -259,7 +259,7 @@ class Entry /** * @param string $categoryName */ - public function setCategoryName($categoryName) + public function setCategoryName(string $categoryName) { $this->categoryName = $categoryName; } @@ -267,7 +267,7 @@ class Entry /** * @return string */ - public function getDate() + public function getDate(): string { return $this->date; } @@ -283,7 +283,7 @@ class Entry /** * @return string */ - public function getDescription() + public function getDescription(): string { return $this->description; } @@ -299,7 +299,7 @@ class Entry /** * @return string */ - public function getFromAccountIban() + public function getFromAccountIban(): string { return $this->fromAccountIban; } @@ -307,7 +307,7 @@ class Entry /** * @param string $fromAccountIban */ - public function setFromAccountIban($fromAccountIban) + public function setFromAccountIban(string $fromAccountIban) { $this->fromAccountIban = $fromAccountIban; } @@ -315,7 +315,7 @@ class Entry /** * @return int */ - public function getFromAccountId() + public function getFromAccountId():int { return $this->fromAccountId; } @@ -323,7 +323,7 @@ class Entry /** * @param int $fromAccountId */ - public function setFromAccountId($fromAccountId) + public function setFromAccountId(int $fromAccountId) { $this->fromAccountId = $fromAccountId; } @@ -331,7 +331,7 @@ class Entry /** * @return string */ - public function getFromAccountName() + public function getFromAccountName(): string { return $this->fromAccountName; } @@ -339,23 +339,23 @@ class Entry /** * @param string $fromAccountName */ - public function setFromAccountName($fromAccountName) + public function setFromAccountName(string $fromAccountName) { $this->fromAccountName = $fromAccountName; } /** - * @return mixed + * @return string */ - public function getFromAccountNumber() + public function getFromAccountNumber(): string { return $this->fromAccountNumber; } /** - * @param mixed $fromAccountNumber + * @param string $fromAccountNumber */ - public function setFromAccountNumber($fromAccountNumber) + public function setFromAccountNumber(string $fromAccountNumber) { $this->fromAccountNumber = $fromAccountNumber; } @@ -363,7 +363,7 @@ class Entry /** * @return string */ - public function getFromAccountType() + public function getFromAccountType(): string { return $this->fromAccountType; } @@ -371,7 +371,7 @@ class Entry /** * @param string $fromAccountType */ - public function setFromAccountType($fromAccountType) + public function setFromAccountType(string $fromAccountType) { $this->fromAccountType = $fromAccountType; } @@ -379,7 +379,7 @@ class Entry /** * @return string */ - public function getToAccountIban() + public function getToAccountIban(): string { return $this->toAccountIban; } @@ -387,7 +387,7 @@ class Entry /** * @param string $toAccountIban */ - public function setToAccountIban($toAccountIban) + public function setToAccountIban(string $toAccountIban) { $this->toAccountIban = $toAccountIban; } @@ -395,7 +395,7 @@ class Entry /** * @return int */ - public function getToAccountId() + public function getToAccountId(): int { return $this->toAccountId; } @@ -403,7 +403,7 @@ class Entry /** * @param int $toAccountId */ - public function setToAccountId($toAccountId) + public function setToAccountId(int $toAccountId) { $this->toAccountId = $toAccountId; } @@ -411,7 +411,7 @@ class Entry /** * @return string */ - public function getToAccountName() + public function getToAccountName(): string { return $this->toAccountName; } @@ -419,23 +419,23 @@ class Entry /** * @param string $toAccountName */ - public function setToAccountName($toAccountName) + public function setToAccountName(string $toAccountName) { $this->toAccountName = $toAccountName; } /** - * @return mixed + * @return string */ - public function getToAccountNumber() + public function getToAccountNumber(): string { return $this->toAccountNumber; } /** - * @param mixed $toAccountNumber + * @param string $toAccountNumber */ - public function setToAccountNumber($toAccountNumber) + public function setToAccountNumber(string $toAccountNumber) { $this->toAccountNumber = $toAccountNumber; } @@ -443,7 +443,7 @@ class Entry /** * @return string */ - public function getToAccountType() + public function getToAccountType(): string { return $this->toAccountType; } @@ -451,7 +451,7 @@ class Entry /** * @param string $toAccountType */ - public function setToAccountType($toAccountType) + public function setToAccountType(string $toAccountType) { $this->toAccountType = $toAccountType; } diff --git a/app/Export/Exporter/BasicExporter.php b/app/Export/Exporter/BasicExporter.php index db686ea383..1c847a5ebe 100644 --- a/app/Export/Exporter/BasicExporter.php +++ b/app/Export/Exporter/BasicExporter.php @@ -39,7 +39,7 @@ class BasicExporter /** * @return Collection */ - public function getEntries() + public function getEntries(): Collection { return $this->entries; } diff --git a/app/Export/Exporter/CsvExporter.php b/app/Export/Exporter/CsvExporter.php index d646a36df9..6457b8609b 100644 --- a/app/Export/Exporter/CsvExporter.php +++ b/app/Export/Exporter/CsvExporter.php @@ -39,15 +39,15 @@ class CsvExporter extends BasicExporter implements ExporterInterface /** * @return string */ - public function getFileName() + public function getFileName(): string { return $this->fileName; } /** - * + * @return bool */ - public function run() + public function run(): bool { // create temporary file: $this->tempFile(); @@ -72,6 +72,7 @@ class CsvExporter extends BasicExporter implements ExporterInterface } $writer->insertAll($rows); + return true; } private function tempFile() diff --git a/app/Export/Exporter/ExporterInterface.php b/app/Export/Exporter/ExporterInterface.php index 67097c36df..57d1a174ad 100644 --- a/app/Export/Exporter/ExporterInterface.php +++ b/app/Export/Exporter/ExporterInterface.php @@ -22,17 +22,17 @@ interface ExporterInterface /** * @return Collection */ - public function getEntries(); + public function getEntries(): Collection; /** * @return string */ - public function getFileName(); + public function getFileName(): string; /** - * + * @return bool */ - public function run(); + public function run(): bool; /** * @param Collection $entries diff --git a/app/Export/Processor.php b/app/Export/Processor.php index 6eea9d1910..a5e8b1549b 100644 --- a/app/Export/Processor.php +++ b/app/Export/Processor.php @@ -73,19 +73,20 @@ class Processor } /** - * + * @return bool */ - public function collectAttachments() + public function collectAttachments(): bool { $attachmentCollector = app('FireflyIII\Export\Collector\AttachmentCollector', [$this->job]); $attachmentCollector->run(); $this->files = $this->files->merge($attachmentCollector->getFiles()); + return true; } /** - * + * @return bool */ - public function collectJournals() + public function collectJournals(): bool { $args = [$this->accounts, Auth::user(), $this->settings['startDate'], $this->settings['endDate']]; $journalCollector = app('FireflyIII\Repositories\Journal\JournalCollector', $args); @@ -97,20 +98,25 @@ class Processor $this->settings['endDate']->format('Y-m-d') . ').' ); + return true; } - public function collectOldUploads() + /** + * @return bool + */ + public function collectOldUploads(): bool { $uploadCollector = app('FireflyIII\Export\Collector\UploadCollector', [$this->job]); $uploadCollector->run(); $this->files = $this->files->merge($uploadCollector->getFiles()); + return true; } /** - * + * @return bool */ - public function convertJournals() + public function convertJournals(): bool { $count = 0; /** @var TransactionJournal $journal */ @@ -119,15 +125,24 @@ class Processor $count++; } Log::debug('Converted ' . $count . ' journals to "Entry" objects.'); + return true; } - public function createConfigFile() + /** + * @return bool + */ + public function createConfigFile(): bool { $this->configurationMaker = app('FireflyIII\Export\ConfigurationFile', [$this->job]); $this->files->push($this->configurationMaker->make()); + return true; } - public function createZipFile() + /** + * @return bool + * @throws FireflyException + */ + public function createZipFile(): bool { $zip = new ZipArchive; $file = $this->job->key . '.zip'; @@ -156,12 +171,13 @@ class Processor $disk->delete($file); } Log::debug('Done!'); + return true; } /** - * + * @return bool */ - public function exportJournals() + public function exportJournals(): bool { $exporterClass = Config::get('firefly.export_formats.' . $this->exportFormat); $exporter = app($exporterClass, [$this->job]); @@ -170,12 +186,13 @@ class Processor $exporter->run(); $this->files->push($exporter->getFileName()); Log::debug('Added "' . $exporter->getFileName() . '" to the list of files to include in the zip.'); + return true; } /** * @return Collection */ - public function getFiles() + public function getFiles(): Collection { return $this->files; } diff --git a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php index b3ee4fed05..30af6845e1 100644 --- a/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php +++ b/app/Generator/Chart/Bill/ChartJsBillChartGenerator.php @@ -31,18 +31,15 @@ class ChartJsBillChartGenerator implements BillChartGeneratorInterface public function frontpage(string $paid, string $unpaid): array { $data = [ - [ - 'value' => round($unpaid, 2), - 'color' => 'rgba(53, 124, 165,0.7)', - 'highlight' => 'rgba(53, 124, 165,0.9)', - 'label' => trans('firefly.unpaid'), - ], - [ - 'value' => round(bcmul($paid, '-1'), 2), // paid is negative, must be positive. - 'color' => 'rgba(0, 141, 76, 0.7)', - 'highlight' => 'rgba(0, 141, 76, 0.9)', - 'label' => trans('firefly.paid'), + 'datasets' => [ + [ + 'data' => [round($unpaid, 2), round(bcmul($paid, '-1'), 2)], + 'backgroundColor' => ['rgba(53, 124, 165,0.7)', 'rgba(0, 141, 76, 0.7)',], + ], + ], + 'labels' => [strval(trans('firefly.unpaid')), strval(trans('firefly.paid'))], + ]; return $data; @@ -77,14 +74,17 @@ class ChartJsBillChartGenerator implements BillChartGeneratorInterface } $data['datasets'][] = [ + 'type' => 'bar', 'label' => trans('firefly.minAmount'), 'data' => $minAmount, ]; $data['datasets'][] = [ + 'type' => 'line', 'label' => trans('firefly.billEntry'), 'data' => $actualAmount, ]; $data['datasets'][] = [ + 'type' => 'bar', 'label' => trans('firefly.maxAmount'), 'data' => $maxAmount, ]; diff --git a/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php b/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php index f0f3cce9a5..3cdd335b31 100644 --- a/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php +++ b/app/Generator/Chart/Budget/ChartJsBudgetChartGenerator.php @@ -50,7 +50,6 @@ class ChartJsBudgetChartGenerator implements BudgetChartGeneratorInterface } /** - * @codeCoverageIgnore * * @param Collection $entries * diff --git a/app/Generator/Chart/Category/CategoryChartGeneratorInterface.php b/app/Generator/Chart/Category/CategoryChartGeneratorInterface.php index ce02b93031..3533eefec3 100644 --- a/app/Generator/Chart/Category/CategoryChartGeneratorInterface.php +++ b/app/Generator/Chart/Category/CategoryChartGeneratorInterface.php @@ -25,7 +25,7 @@ interface CategoryChartGeneratorInterface * * @return array */ - public function all(Collection $entries); + public function all(Collection $entries): array; /** * @param Collection $categories diff --git a/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php b/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php index f2a2893cf7..e87a4543be 100644 --- a/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php +++ b/app/Generator/Chart/Category/ChartJsCategoryChartGenerator.php @@ -148,7 +148,6 @@ class ChartJsCategoryChartGenerator implements CategoryChartGeneratorInterface } /** - * @codeCoverageIgnore * * @param Collection $entries * diff --git a/app/Generator/Chart/Report/ChartJsReportChartGenerator.php b/app/Generator/Chart/Report/ChartJsReportChartGenerator.php index 43a2a73b51..df87ad0196 100644 --- a/app/Generator/Chart/Report/ChartJsReportChartGenerator.php +++ b/app/Generator/Chart/Report/ChartJsReportChartGenerator.php @@ -89,7 +89,7 @@ class ChartJsReportChartGenerator implements ReportChartGeneratorInterface 'labels' => [], 'datasets' => [ [ - 'label' => trans('firefly.net-worth'), + 'label' => trans('firefly.net_worth'), 'data' => [], ], ], diff --git a/app/Handlers/Events/FireRulesForStore.php b/app/Handlers/Events/FireRulesForStore.php index 1d33736afc..05ab7006d8 100644 --- a/app/Handlers/Events/FireRulesForStore.php +++ b/app/Handlers/Events/FireRulesForStore.php @@ -36,6 +36,7 @@ class FireRulesForStore */ public function handle(TransactionJournalStored $event): bool { + Log::debug('Now running FireRulesForStore because TransactionJournalStored fired.'); // get all the user's rule groups, with the rules, order by 'order'. /** @var User $user */ $user = Auth::user(); diff --git a/app/Handlers/Events/FireRulesForUpdate.php b/app/Handlers/Events/FireRulesForUpdate.php index 27aa80c39f..ae1e187d67 100644 --- a/app/Handlers/Events/FireRulesForUpdate.php +++ b/app/Handlers/Events/FireRulesForUpdate.php @@ -34,6 +34,7 @@ class FireRulesForUpdate */ public function handle(TransactionJournalUpdated $event): bool { + Log::debug('Now running FireRulesForUpdate because TransactionJournalUpdated fired.'); // get all the user's rule groups, with the rules, order by 'order'. /** @var User $user */ $user = Auth::user(); diff --git a/app/Handlers/Events/ScanForBillsAfterStore.php b/app/Handlers/Events/ScanForBillsAfterStore.php index ae477ed638..584e85160b 100644 --- a/app/Handlers/Events/ScanForBillsAfterStore.php +++ b/app/Handlers/Events/ScanForBillsAfterStore.php @@ -16,7 +16,6 @@ use FireflyIII\Support\Events\BillScanner; /** * Class RescanJournal * - * @codeCoverageIgnore * @package FireflyIII\Handlers\Events */ class ScanForBillsAfterStore diff --git a/app/Handlers/Events/ScanForBillsAfterUpdate.php b/app/Handlers/Events/ScanForBillsAfterUpdate.php index 2664cebeee..2f867e832b 100644 --- a/app/Handlers/Events/ScanForBillsAfterUpdate.php +++ b/app/Handlers/Events/ScanForBillsAfterUpdate.php @@ -16,7 +16,6 @@ use FireflyIII\Support\Events\BillScanner; /** * Class RescanJournal * - * @codeCoverageIgnore * @package FireflyIII\Handlers\Events */ class ScanForBillsAfterUpdate diff --git a/app/Handlers/Events/SendRegistrationMail.php b/app/Handlers/Events/SendRegistrationMail.php index 92b600acf6..04069d8cf6 100644 --- a/app/Handlers/Events/SendRegistrationMail.php +++ b/app/Handlers/Events/SendRegistrationMail.php @@ -38,13 +38,13 @@ class SendRegistrationMail * * @param UserRegistration $event * - * @return void + * @return bool */ - public function handle(UserRegistration $event) + public function handle(UserRegistration $event): bool { $sendMail = env('SEND_REGISTRATION_MAIL', true); if (!$sendMail) { - return; + return true; } // get the email address $email = $event->user->email; @@ -60,5 +60,6 @@ class SendRegistrationMail } catch (Swift_TransportException $e) { Log::error($e->getMessage()); } + return true; } } diff --git a/app/Handlers/Events/UpdateJournalConnection.php b/app/Handlers/Events/UpdateJournalConnection.php index 0a5e5f2804..bf385a6d50 100644 --- a/app/Handlers/Events/UpdateJournalConnection.php +++ b/app/Handlers/Events/UpdateJournalConnection.php @@ -10,7 +10,6 @@ use FireflyIII\Models\TransactionJournal; /** * Class UpdateJournalConnection * - * @codeCoverageIgnore * @package FireflyIII\Handlers\Events */ class UpdateJournalConnection diff --git a/app/Handlers/Events/UserConfirmation.php b/app/Handlers/Events/UserConfirmation.php index b90a10e27b..0c68908ca8 100644 --- a/app/Handlers/Events/UserConfirmation.php +++ b/app/Handlers/Events/UserConfirmation.php @@ -39,24 +39,30 @@ class UserConfirmation /** * @param ResendConfirmation $event + * + * @return bool */ - public function resendConfirmation(ResendConfirmation $event) + public function resendConfirmation(ResendConfirmation $event): bool { $user = $event->user; $ipAddress = $event->ipAddress; $this->doConfirm($user, $ipAddress); + return true; } /** * Handle the event. * * @param UserRegistration $event + * + * @return bool */ - public function sendConfirmation(UserRegistration $event) + public function sendConfirmation(UserRegistration $event): bool { $user = $event->user; $ipAddress = $event->ipAddress; $this->doConfirm($user, $ipAddress); + return true; } /** diff --git a/app/Handlers/Events/UserEventListener.php b/app/Handlers/Events/UserEventListener.php index 381edb7196..5f4e9b3029 100644 --- a/app/Handlers/Events/UserEventListener.php +++ b/app/Handlers/Events/UserEventListener.php @@ -21,8 +21,10 @@ class UserEventListener { /** * Handle user logout events. + * + * @return bool */ - public function onUserLogout() + public function onUserLogout(): bool { // dump stuff from the session: Session::forget('twofactor-authenticated'); diff --git a/app/Helpers/Collection/Account.php b/app/Helpers/Collection/Account.php index 24ef263642..a2bb85a899 100644 --- a/app/Helpers/Collection/Account.php +++ b/app/Helpers/Collection/Account.php @@ -5,7 +5,6 @@ namespace FireflyIII\Helpers\Collection; use Illuminate\Support\Collection; /** - * @codeCoverageIgnore * Class Account * * @package FireflyIII\Helpers\Collection diff --git a/app/Helpers/Collection/Balance.php b/app/Helpers/Collection/Balance.php index 41db832ef7..cb3b4fa3c8 100644 --- a/app/Helpers/Collection/Balance.php +++ b/app/Helpers/Collection/Balance.php @@ -5,7 +5,6 @@ namespace FireflyIII\Helpers\Collection; use Illuminate\Support\Collection; /** - * @codeCoverageIgnore * * Class Balance * diff --git a/app/Helpers/Collection/BalanceEntry.php b/app/Helpers/Collection/BalanceEntry.php index baa2f3d17c..3e798189d4 100644 --- a/app/Helpers/Collection/BalanceEntry.php +++ b/app/Helpers/Collection/BalanceEntry.php @@ -5,7 +5,6 @@ namespace FireflyIII\Helpers\Collection; use FireflyIII\Models\Account as AccountModel; /** - * @codeCoverageIgnore * * Class BalanceEntry * diff --git a/app/Helpers/Collection/BalanceHeader.php b/app/Helpers/Collection/BalanceHeader.php index 60ed221f7b..f49c37a2c5 100644 --- a/app/Helpers/Collection/BalanceHeader.php +++ b/app/Helpers/Collection/BalanceHeader.php @@ -6,7 +6,6 @@ use FireflyIII\Models\Account as AccountModel; use Illuminate\Support\Collection; /** - * @codeCoverageIgnore * * Class BalanceHeader * diff --git a/app/Helpers/Collection/BalanceLine.php b/app/Helpers/Collection/BalanceLine.php index a57a7b403b..c1544e1578 100644 --- a/app/Helpers/Collection/BalanceLine.php +++ b/app/Helpers/Collection/BalanceLine.php @@ -6,7 +6,6 @@ use FireflyIII\Models\Budget as BudgetModel; use Illuminate\Support\Collection; /** - * @codeCoverageIgnore * * Class BalanceLine * diff --git a/app/Helpers/Collection/Bill.php b/app/Helpers/Collection/Bill.php index f5b58b36ec..f535385013 100644 --- a/app/Helpers/Collection/Bill.php +++ b/app/Helpers/Collection/Bill.php @@ -6,7 +6,6 @@ namespace FireflyIII\Helpers\Collection; use Illuminate\Support\Collection; /** - * @codeCoverageIgnore * Class Bill * * @package FireflyIII\Helpers\Collection diff --git a/app/Helpers/Collection/BillLine.php b/app/Helpers/Collection/BillLine.php index 8c3141170e..ef55ef833e 100644 --- a/app/Helpers/Collection/BillLine.php +++ b/app/Helpers/Collection/BillLine.php @@ -5,7 +5,6 @@ namespace FireflyIII\Helpers\Collection; use FireflyIII\Models\Bill as BillModel; /** - * @codeCoverageIgnore * * Class BillLine * @@ -111,7 +110,7 @@ class BillLine } /** - * @return boolean + * @return bool */ public function isActive(): bool { @@ -127,7 +126,7 @@ class BillLine } /** - * @return boolean + * @return bool */ public function isHit(): bool { diff --git a/app/Helpers/Collection/Budget.php b/app/Helpers/Collection/Budget.php index 92d864eb06..eeaec0e782 100644 --- a/app/Helpers/Collection/Budget.php +++ b/app/Helpers/Collection/Budget.php @@ -5,7 +5,6 @@ namespace FireflyIII\Helpers\Collection; use Illuminate\Support\Collection; /** - * @codeCoverageIgnore * * Class Budget * diff --git a/app/Helpers/Collection/BudgetLine.php b/app/Helpers/Collection/BudgetLine.php index ecda6ac7ca..73ff155b3c 100644 --- a/app/Helpers/Collection/BudgetLine.php +++ b/app/Helpers/Collection/BudgetLine.php @@ -6,7 +6,6 @@ use FireflyIII\Models\Budget as BudgetModel; use FireflyIII\Models\LimitRepetition; /** - * @codeCoverageIgnore * * Class BudgetLine * diff --git a/app/Helpers/Collection/Category.php b/app/Helpers/Collection/Category.php index b8196fe05a..c44d4d1560 100644 --- a/app/Helpers/Collection/Category.php +++ b/app/Helpers/Collection/Category.php @@ -7,7 +7,6 @@ use Illuminate\Support\Collection; /** - * @codeCoverageIgnore * * Class Category * diff --git a/app/Helpers/Collection/Expense.php b/app/Helpers/Collection/Expense.php index b241f04f9f..f69a2db8ae 100644 --- a/app/Helpers/Collection/Expense.php +++ b/app/Helpers/Collection/Expense.php @@ -8,7 +8,6 @@ use Illuminate\Support\Collection; use stdClass; /** - * @codeCoverageIgnore * * Class Expense * diff --git a/app/Helpers/Collection/Income.php b/app/Helpers/Collection/Income.php index 17017e5129..c5cf254b3d 100644 --- a/app/Helpers/Collection/Income.php +++ b/app/Helpers/Collection/Income.php @@ -8,7 +8,6 @@ use Illuminate\Support\Collection; use stdClass; /** - * @codeCoverageIgnore * * Class Income * diff --git a/app/Helpers/Csv/Converter/AmountComma.php b/app/Helpers/Csv/Converter/AmountComma.php index 37b4d95841..1c9c585432 100644 --- a/app/Helpers/Csv/Converter/AmountComma.php +++ b/app/Helpers/Csv/Converter/AmountComma.php @@ -15,7 +15,7 @@ class AmountComma extends BasicConverter implements ConverterInterface /** * @return float|int */ - public function convert() + public function convert(): string { $value = str_replace(',', '.', strval($this->value)); diff --git a/app/Helpers/Csv/Converter/AssetAccountIban.php b/app/Helpers/Csv/Converter/AssetAccountIban.php index 327d6e882e..19e0a8aec0 100644 --- a/app/Helpers/Csv/Converter/AssetAccountIban.php +++ b/app/Helpers/Csv/Converter/AssetAccountIban.php @@ -6,6 +6,7 @@ use Auth; use Carbon\Carbon; use FireflyIII\Models\Account; use FireflyIII\Repositories\Account\AccountRepositoryInterface; +use Log; /** * Class AssetAccountIban @@ -26,6 +27,7 @@ class AssetAccountIban extends BasicConverter implements ConverterInterface // is mapped? Then it's easy! if (isset($this->mapped[$this->index][$this->value])) { $account = $repository->find($this->mapped[$this->index][$this->value]); + Log::debug('Found mapped account for value "' . $this->value . '". It is account #' . $account->id); return $account; } @@ -36,10 +38,14 @@ class AssetAccountIban extends BasicConverter implements ConverterInterface /** @var Account $entry */ foreach ($set as $entry) { if ($entry->iban == $this->value) { + Log::debug('Found an account with the same IBAN ("' . $this->value . '"). It is account #' . $entry->id); return $entry; } } + + Log::debug('Found no account with the same IBAN ("' . $this->value . '"), so will create a new one.'); + // create it if doesn't exist. $accountData = [ 'name' => $this->value, @@ -48,13 +54,12 @@ class AssetAccountIban extends BasicConverter implements ConverterInterface 'virtualBalanceCurrency' => 1, // hard coded. 'active' => true, 'user' => Auth::user()->id, - 'iban' => null, + 'iban' => $this->value, 'accountNumber' => $this->value, 'accountRole' => null, 'openingBalance' => 0, 'openingBalanceDate' => new Carbon, 'openingBalanceCurrency' => 1, // hard coded. - ]; $account = $repository->store($accountData); diff --git a/app/Helpers/Csv/Converter/AssetAccountName.php b/app/Helpers/Csv/Converter/AssetAccountName.php index 681e168021..72f4653605 100644 --- a/app/Helpers/Csv/Converter/AssetAccountName.php +++ b/app/Helpers/Csv/Converter/AssetAccountName.php @@ -18,7 +18,7 @@ class AssetAccountName extends BasicConverter implements ConverterInterface /** * @return Account|null */ - public function convert() + public function convert(): Account { /** @var AccountRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/AssetAccountNumber.php b/app/Helpers/Csv/Converter/AssetAccountNumber.php index 9aadeaa4d0..b61e35fb70 100644 --- a/app/Helpers/Csv/Converter/AssetAccountNumber.php +++ b/app/Helpers/Csv/Converter/AssetAccountNumber.php @@ -27,7 +27,7 @@ class AssetAccountNumber extends BasicConverter implements ConverterInterface /** * @return Account|null */ - public function convert() + public function convert(): Account { /** @var AccountRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/BasicConverter.php b/app/Helpers/Csv/Converter/BasicConverter.php index b1a262cae8..660202358a 100644 --- a/app/Helpers/Csv/Converter/BasicConverter.php +++ b/app/Helpers/Csv/Converter/BasicConverter.php @@ -23,7 +23,7 @@ class BasicConverter /** * @return array */ - public function getData() + public function getData(): array { return $this->data; } @@ -39,7 +39,7 @@ class BasicConverter /** * @return string */ - public function getField() + public function getField(): string { return $this->field; } @@ -47,7 +47,7 @@ class BasicConverter /** * @param string $field */ - public function setField($field) + public function setField(string $field) { $this->field = $field; } @@ -55,7 +55,7 @@ class BasicConverter /** * @return int */ - public function getIndex() + public function getIndex(): int { return $this->index; } @@ -63,7 +63,7 @@ class BasicConverter /** * @param int $index */ - public function setIndex($index) + public function setIndex(int $index) { $this->index = $index; } @@ -71,7 +71,7 @@ class BasicConverter /** * @return array */ - public function getMapped() + public function getMapped(): array { return $this->mapped; } @@ -79,7 +79,7 @@ class BasicConverter /** * @param array $mapped */ - public function setMapped($mapped) + public function setMapped(array $mapped) { $this->mapped = $mapped; } @@ -87,7 +87,7 @@ class BasicConverter /** * @return string */ - public function getValue() + public function getValue(): string { return $this->value; } @@ -95,7 +95,7 @@ class BasicConverter /** * @param string $value */ - public function setValue($value) + public function setValue(string $value) { $this->value = $value; } diff --git a/app/Helpers/Csv/Converter/BillId.php b/app/Helpers/Csv/Converter/BillId.php index 77e9efa000..b71f7b7fc4 100644 --- a/app/Helpers/Csv/Converter/BillId.php +++ b/app/Helpers/Csv/Converter/BillId.php @@ -16,7 +16,7 @@ class BillId extends BasicConverter implements ConverterInterface /** * @return Bill */ - public function convert() + public function convert(): Bill { /** @var BillRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Bill\BillRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/BillName.php b/app/Helpers/Csv/Converter/BillName.php index 5f6c008f25..043bf770f7 100644 --- a/app/Helpers/Csv/Converter/BillName.php +++ b/app/Helpers/Csv/Converter/BillName.php @@ -16,7 +16,7 @@ class BillName extends BasicConverter implements ConverterInterface /** * @return Bill */ - public function convert() + public function convert(): Bill { /** @var BillRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Bill\BillRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/BudgetId.php b/app/Helpers/Csv/Converter/BudgetId.php index 896178e822..f318464ff6 100644 --- a/app/Helpers/Csv/Converter/BudgetId.php +++ b/app/Helpers/Csv/Converter/BudgetId.php @@ -16,7 +16,7 @@ class BudgetId extends BasicConverter implements ConverterInterface /** * @return Budget */ - public function convert() + public function convert(): Budget { /** @var BudgetRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/BudgetName.php b/app/Helpers/Csv/Converter/BudgetName.php index dcf8844d3d..375442d08b 100644 --- a/app/Helpers/Csv/Converter/BudgetName.php +++ b/app/Helpers/Csv/Converter/BudgetName.php @@ -17,7 +17,7 @@ class BudgetName extends BasicConverter implements ConverterInterface /** * @return Budget */ - public function convert() + public function convert(): Budget { /** @var BudgetRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/CategoryId.php b/app/Helpers/Csv/Converter/CategoryId.php index 67c91fdb2b..b702f91a92 100644 --- a/app/Helpers/Csv/Converter/CategoryId.php +++ b/app/Helpers/Csv/Converter/CategoryId.php @@ -16,7 +16,7 @@ class CategoryId extends BasicConverter implements ConverterInterface /** * @return Category */ - public function convert() + public function convert(): Budget { /** @var SingleCategoryRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/CategoryName.php b/app/Helpers/Csv/Converter/CategoryName.php index 8ce036eddc..4ec0dc0ecd 100644 --- a/app/Helpers/Csv/Converter/CategoryName.php +++ b/app/Helpers/Csv/Converter/CategoryName.php @@ -17,7 +17,7 @@ class CategoryName extends BasicConverter implements ConverterInterface /** * @return Category */ - public function convert() + public function convert(): Budget { /** @var SingleCategoryRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Category\SingleCategoryRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/ConverterInterface.php b/app/Helpers/Csv/Converter/ConverterInterface.php index 643d17b6c1..b1b6f2922b 100644 --- a/app/Helpers/Csv/Converter/ConverterInterface.php +++ b/app/Helpers/Csv/Converter/ConverterInterface.php @@ -24,21 +24,21 @@ interface ConverterInterface * @param string $field * */ - public function setField($field); + public function setField(string $field); /** * @param int $index */ - public function setIndex($index); + public function setIndex(int $index); /** * @param array $mapped */ - public function setMapped($mapped); + public function setMapped(array $mapped); /** * @param string $value */ - public function setValue($value); + public function setValue(string $value); } diff --git a/app/Helpers/Csv/Converter/CurrencyCode.php b/app/Helpers/Csv/Converter/CurrencyCode.php index 7054b1f5d5..07e7c170fb 100644 --- a/app/Helpers/Csv/Converter/CurrencyCode.php +++ b/app/Helpers/Csv/Converter/CurrencyCode.php @@ -16,7 +16,7 @@ class CurrencyCode extends BasicConverter implements ConverterInterface /** * @return TransactionCurrency */ - public function convert() + public function convert(): TransactionCurrency { /** @var CurrencyRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Currency\CurrencyRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/CurrencyId.php b/app/Helpers/Csv/Converter/CurrencyId.php index ce21771f12..4ee65e950b 100644 --- a/app/Helpers/Csv/Converter/CurrencyId.php +++ b/app/Helpers/Csv/Converter/CurrencyId.php @@ -16,7 +16,7 @@ class CurrencyId extends BasicConverter implements ConverterInterface /** * @return TransactionCurrency */ - public function convert() + public function convert(): TransactionCurrency { /** @var CurrencyRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Currency\CurrencyRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/CurrencyName.php b/app/Helpers/Csv/Converter/CurrencyName.php index 336c533e6b..29fa7828c3 100644 --- a/app/Helpers/Csv/Converter/CurrencyName.php +++ b/app/Helpers/Csv/Converter/CurrencyName.php @@ -16,7 +16,7 @@ class CurrencyName extends BasicConverter implements ConverterInterface /** * @return TransactionCurrency */ - public function convert() + public function convert(): TransactionCurrency { /** @var CurrencyRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Currency\CurrencyRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/CurrencySymbol.php b/app/Helpers/Csv/Converter/CurrencySymbol.php index b27c122db3..4d0de8d70c 100644 --- a/app/Helpers/Csv/Converter/CurrencySymbol.php +++ b/app/Helpers/Csv/Converter/CurrencySymbol.php @@ -16,7 +16,7 @@ class CurrencySymbol extends BasicConverter implements ConverterInterface /** * @return TransactionCurrency */ - public function convert() + public function convert(): TransactionCurrency { /** @var CurrencyRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Currency\CurrencyRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/Date.php b/app/Helpers/Csv/Converter/Date.php index ca532738ba..e11338246f 100644 --- a/app/Helpers/Csv/Converter/Date.php +++ b/app/Helpers/Csv/Converter/Date.php @@ -19,7 +19,7 @@ class Date extends BasicConverter implements ConverterInterface * @return Carbon * @throws FireflyException */ - public function convert() + public function convert(): Carbon { $format = session('csv-date-format'); try { diff --git a/app/Helpers/Csv/Converter/Description.php b/app/Helpers/Csv/Converter/Description.php index 98cfd1b4bf..ac12542a46 100644 --- a/app/Helpers/Csv/Converter/Description.php +++ b/app/Helpers/Csv/Converter/Description.php @@ -14,7 +14,7 @@ class Description extends BasicConverter implements ConverterInterface /** * @return string */ - public function convert() + public function convert(): string { $description = $this->data['description'] ?? ''; diff --git a/app/Helpers/Csv/Converter/INGDebetCredit.php b/app/Helpers/Csv/Converter/INGDebetCredit.php index ac36539e22..1b01998232 100644 --- a/app/Helpers/Csv/Converter/INGDebetCredit.php +++ b/app/Helpers/Csv/Converter/INGDebetCredit.php @@ -24,7 +24,7 @@ class INGDebetCredit extends BasicConverter implements ConverterInterface /** * @return int */ - public function convert() + public function convert(): int { if ($this->value === 'Af') { return -1; diff --git a/app/Helpers/Csv/Converter/OpposingAccountId.php b/app/Helpers/Csv/Converter/OpposingAccountId.php index 3c11791fb8..6b6ec84f60 100644 --- a/app/Helpers/Csv/Converter/OpposingAccountId.php +++ b/app/Helpers/Csv/Converter/OpposingAccountId.php @@ -17,7 +17,7 @@ class OpposingAccountId extends BasicConverter implements ConverterInterface /** * @return Account */ - public function convert() + public function convert(): Account { /** @var AccountRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Account\AccountRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/RabobankDebetCredit.php b/app/Helpers/Csv/Converter/RabobankDebetCredit.php index a0945fcf5e..ac73d9e206 100644 --- a/app/Helpers/Csv/Converter/RabobankDebetCredit.php +++ b/app/Helpers/Csv/Converter/RabobankDebetCredit.php @@ -15,7 +15,7 @@ class RabobankDebetCredit extends BasicConverter implements ConverterInterface /** * @return int */ - public function convert() + public function convert(): int { if ($this->value == 'D') { return -1; diff --git a/app/Helpers/Csv/Converter/TagsComma.php b/app/Helpers/Csv/Converter/TagsComma.php index 6c8715b01c..a38d64cce8 100644 --- a/app/Helpers/Csv/Converter/TagsComma.php +++ b/app/Helpers/Csv/Converter/TagsComma.php @@ -16,7 +16,7 @@ class TagsComma extends BasicConverter implements ConverterInterface /** * @return Collection */ - public function convert() + public function convert(): Collection { /** @var TagRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Tag\TagRepositoryInterface'); diff --git a/app/Helpers/Csv/Converter/TagsSpace.php b/app/Helpers/Csv/Converter/TagsSpace.php index 72f41503dc..60eeba8b7d 100644 --- a/app/Helpers/Csv/Converter/TagsSpace.php +++ b/app/Helpers/Csv/Converter/TagsSpace.php @@ -16,7 +16,7 @@ class TagsSpace extends BasicConverter implements ConverterInterface /** * @return Collection */ - public function convert() + public function convert(): Collection { /** @var TagRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Tag\TagRepositoryInterface'); diff --git a/app/Helpers/Csv/Data.php b/app/Helpers/Csv/Data.php index b45edd5211..606ae42bbe 100644 --- a/app/Helpers/Csv/Data.php +++ b/app/Helpers/Csv/Data.php @@ -57,7 +57,7 @@ class Data * * @return string */ - public function getCsvFileContent() + public function getCsvFileContent(): string { return $this->csvFileContent ?? ''; } @@ -72,10 +72,10 @@ class Data } /** - * + * FIXME may return null * @return string */ - public function getCsvFileLocation() + public function getCsvFileLocation(): string { return $this->csvFileLocation; } @@ -91,10 +91,10 @@ class Data } /** - * + * FIXME may return null * @return string */ - public function getDateFormat() + public function getDateFormat(): string { return $this->dateFormat; } @@ -110,10 +110,10 @@ class Data } /** - * + * FIXME may return null * @return string */ - public function getDelimiter() + public function getDelimiter(): string { return $this->delimiter; } @@ -132,7 +132,7 @@ class Data * * @return array */ - public function getMap() + public function getMap(): array { return $this->map; } @@ -151,7 +151,7 @@ class Data * * @return array */ - public function getMapped() + public function getMapped(): array { return $this->mapped; } @@ -170,7 +170,7 @@ class Data * * @return Reader */ - public function getReader() + public function getReader(): Reader { if (!is_null($this->csvFileContent) && strlen($this->csvFileContent) === 0) { $this->loadCsvFile(); @@ -188,7 +188,7 @@ class Data * * @return array */ - public function getRoles() + public function getRoles(): array { return $this->roles; } @@ -207,7 +207,7 @@ class Data * * @return array */ - public function getSpecifix() + public function getSpecifix(): array { return is_array($this->specifix) ? $this->specifix : []; } @@ -226,7 +226,7 @@ class Data * * @return bool */ - public function hasHeaders() + public function hasHeaders(): bool { return $this->hasHeaders; } diff --git a/app/Helpers/Csv/Importer.php b/app/Helpers/Csv/Importer.php index 77553dab89..90aadc3a0e 100644 --- a/app/Helpers/Csv/Importer.php +++ b/app/Helpers/Csv/Importer.php @@ -4,19 +4,15 @@ namespace FireflyIII\Helpers\Csv; use Auth; use Config; +use FireflyIII\Events\TransactionJournalStored; use FireflyIII\Exceptions\FireflyException; use FireflyIII\Helpers\Csv\Converter\ConverterInterface; use FireflyIII\Helpers\Csv\PostProcessing\PostProcessorInterface; use FireflyIII\Helpers\Csv\Specifix\SpecifixInterface; use FireflyIII\Models\Account; -use FireflyIII\Models\Rule; -use FireflyIII\Models\RuleGroup; use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; -use FireflyIII\Rules\Processor; -use FireflyIII\User; -use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Support\Collection; use Illuminate\Support\MessageBag; use Log; @@ -57,7 +53,7 @@ class Importer * * @return array */ - public function getErrors() + public function getErrors(): array { return $this->errors; } @@ -67,7 +63,7 @@ class Importer * * @return int */ - public function getImported() + public function getImported(): int { return $this->imported; } @@ -75,7 +71,7 @@ class Importer /** * @return Collection */ - public function getJournals() + public function getJournals(): Collection { return $this->journals; } @@ -85,7 +81,7 @@ class Importer * * @return int */ - public function getRows() + public function getRows(): int { return $this->rows; } @@ -93,7 +89,7 @@ class Importer /** * @return array */ - public function getSpecifix() + public function getSpecifix(): array { return is_array($this->specifix) ? $this->specifix : []; } @@ -120,19 +116,13 @@ class Importer Log::error('Caught error at row #' . $index . ': ' . $result); $this->errors[$index] = $result; } else { - - $this->imported++; $this->journals->push($result); + event(new TransactionJournalStored($result, 0)); } Log::debug('---'); } } - - // once all journals have been imported (or not) - // fire the rules. - $this->fireRules(); - } /** @@ -144,7 +134,6 @@ class Importer } /** - * * @return TransactionJournal|string */ protected function createTransactionJournal() @@ -361,55 +350,6 @@ class Importer return true; } - /** - * @param Collection $groups - * @param TransactionJournal $journal - */ - private function fireRule(Collection $groups, TransactionJournal $journal) - { - /** @var RuleGroup $group */ - foreach ($groups as $group) { - - /** @var Rule $rule */ - foreach ($group->rules as $rule) { - $processor = Processor::make($rule); - $processor->handleTransactionJournal($journal); - if ($rule->stop_processing) { - break; - } - } - } - } - - private function fireRules() - { - // get all users rules. - /** @var User $user */ - $user = Auth::user(); - $groups = $user - ->ruleGroups() - ->where('rule_groups.active', 1) - ->orderBy('order', 'ASC') - ->with( - [ - 'rules' => function (HasMany $q) { - $q->leftJoin('rule_triggers', 'rules.id', '=', 'rule_triggers.rule_id') - ->where('rule_triggers.trigger_type', 'user_action') - ->where('rule_triggers.trigger_value', 'store-journal') - ->where('rules.active', 1) - ->orderBy('rules.order', 'ASC'); - }, - ] - ) - ->get(); - - /** @var TransactionJournal $journal */ - foreach ($this->journals as $journal) { - $this->fireRule($groups, $journal); - } - - } - /** * @return array */ diff --git a/app/Helpers/Csv/Mapper/AnyAccount.php b/app/Helpers/Csv/Mapper/AnyAccount.php index 573e025f04..f4486d8e8b 100644 --- a/app/Helpers/Csv/Mapper/AnyAccount.php +++ b/app/Helpers/Csv/Mapper/AnyAccount.php @@ -16,7 +16,7 @@ class AnyAccount implements MapperInterface /** * @return array */ - public function getMap() + public function getMap(): array { $result = Auth::user()->accounts()->with('accountType')->orderBy('accounts.name', 'ASC')->get(['accounts.*']); diff --git a/app/Helpers/Csv/Mapper/AssetAccount.php b/app/Helpers/Csv/Mapper/AssetAccount.php index 4060bc0055..c2dd12bac7 100644 --- a/app/Helpers/Csv/Mapper/AssetAccount.php +++ b/app/Helpers/Csv/Mapper/AssetAccount.php @@ -17,7 +17,7 @@ class AssetAccount implements MapperInterface /** * @return array */ - public function getMap() + public function getMap(): array { $result = Auth::user()->accounts()->with( ['accountmeta' => function (HasMany $query) { diff --git a/app/Helpers/Csv/Mapper/Bill.php b/app/Helpers/Csv/Mapper/Bill.php index d0f9cb8c3d..5c56324df6 100644 --- a/app/Helpers/Csv/Mapper/Bill.php +++ b/app/Helpers/Csv/Mapper/Bill.php @@ -16,7 +16,7 @@ class Bill implements MapperInterface /** * @return array */ - public function getMap() + public function getMap(): array { $result = Auth::user()->bills()->get(['bills.*']); $list = []; diff --git a/app/Helpers/Csv/Mapper/Budget.php b/app/Helpers/Csv/Mapper/Budget.php index f5de27f0ff..972a75f5a1 100644 --- a/app/Helpers/Csv/Mapper/Budget.php +++ b/app/Helpers/Csv/Mapper/Budget.php @@ -16,7 +16,7 @@ class Budget implements MapperInterface /** * @return array */ - public function getMap() + public function getMap(): array { $result = Auth::user()->budgets()->get(['budgets.*']); $list = []; diff --git a/app/Helpers/Csv/Mapper/Category.php b/app/Helpers/Csv/Mapper/Category.php index cd9af4aba9..48d53135eb 100644 --- a/app/Helpers/Csv/Mapper/Category.php +++ b/app/Helpers/Csv/Mapper/Category.php @@ -16,7 +16,7 @@ class Category implements MapperInterface /** * @return array */ - public function getMap() + public function getMap(): array { $result = Auth::user()->categories()->get(['categories.*']); $list = []; diff --git a/app/Helpers/Csv/Mapper/MapperInterface.php b/app/Helpers/Csv/Mapper/MapperInterface.php index a8822163b4..78fd647a99 100644 --- a/app/Helpers/Csv/Mapper/MapperInterface.php +++ b/app/Helpers/Csv/Mapper/MapperInterface.php @@ -12,5 +12,5 @@ interface MapperInterface /** * @return array */ - public function getMap(); + public function getMap(): array; } diff --git a/app/Helpers/Csv/Mapper/Tag.php b/app/Helpers/Csv/Mapper/Tag.php index d0a7feba36..9fff15873e 100644 --- a/app/Helpers/Csv/Mapper/Tag.php +++ b/app/Helpers/Csv/Mapper/Tag.php @@ -16,7 +16,7 @@ class Tag implements MapperInterface /** * @return array */ - public function getMap() + public function getMap(): array { $result = Auth::user()->budgets()->get(['tags.*']); $list = []; diff --git a/app/Helpers/Csv/Mapper/TransactionCurrency.php b/app/Helpers/Csv/Mapper/TransactionCurrency.php index 636b19520d..3712b98f5e 100644 --- a/app/Helpers/Csv/Mapper/TransactionCurrency.php +++ b/app/Helpers/Csv/Mapper/TransactionCurrency.php @@ -15,7 +15,7 @@ class TransactionCurrency implements MapperInterface /** * @return array */ - public function getMap() + public function getMap(): array { $currencies = TC::get(); $list = []; diff --git a/app/Helpers/Csv/PostProcessing/Amount.php b/app/Helpers/Csv/PostProcessing/Amount.php index fc5f9b9fc7..b955fca50d 100644 --- a/app/Helpers/Csv/PostProcessing/Amount.php +++ b/app/Helpers/Csv/PostProcessing/Amount.php @@ -17,7 +17,7 @@ class Amount implements PostProcessorInterface /** * @return array */ - public function process() + public function process(): array { $amount = $this->data['amount'] ?? '0'; $modifier = strval($this->data['amount-modifier']); diff --git a/app/Helpers/Csv/PostProcessing/AssetAccount.php b/app/Helpers/Csv/PostProcessing/AssetAccount.php index 7ee7986b76..542c72e0be 100644 --- a/app/Helpers/Csv/PostProcessing/AssetAccount.php +++ b/app/Helpers/Csv/PostProcessing/AssetAccount.php @@ -23,7 +23,7 @@ class AssetAccount implements PostProcessorInterface /** * @return array */ - public function process() + public function process(): array { $result = $this->checkIdNameObject(); // has object in ID or Name? if (!is_null($result)) { diff --git a/app/Helpers/Csv/PostProcessing/Bill.php b/app/Helpers/Csv/PostProcessing/Bill.php index de81b8b3c4..9369fc26ad 100644 --- a/app/Helpers/Csv/PostProcessing/Bill.php +++ b/app/Helpers/Csv/PostProcessing/Bill.php @@ -16,7 +16,7 @@ class Bill implements PostProcessorInterface /** * @return array */ - public function process() + public function process(): array { // get bill id. diff --git a/app/Helpers/Csv/PostProcessing/Currency.php b/app/Helpers/Csv/PostProcessing/Currency.php index 91d34f8677..62b14fb430 100644 --- a/app/Helpers/Csv/PostProcessing/Currency.php +++ b/app/Helpers/Csv/PostProcessing/Currency.php @@ -19,7 +19,7 @@ class Currency implements PostProcessorInterface /** * @return array */ - public function process() + public function process(): array { // fix currency diff --git a/app/Helpers/Csv/PostProcessing/Description.php b/app/Helpers/Csv/PostProcessing/Description.php index 64c0e8ed8b..51ddca637b 100644 --- a/app/Helpers/Csv/PostProcessing/Description.php +++ b/app/Helpers/Csv/PostProcessing/Description.php @@ -16,7 +16,7 @@ class Description implements PostProcessorInterface /** * @return array */ - public function process() + public function process(): array { $description = $this->data['description'] ?? ''; $this->data['description'] = trim($description); diff --git a/app/Helpers/Csv/PostProcessing/OpposingAccount.php b/app/Helpers/Csv/PostProcessing/OpposingAccount.php index 0bc038bba3..dece4bea05 100644 --- a/app/Helpers/Csv/PostProcessing/OpposingAccount.php +++ b/app/Helpers/Csv/PostProcessing/OpposingAccount.php @@ -22,7 +22,7 @@ class OpposingAccount implements PostProcessorInterface /** * @return array */ - public function process() + public function process(): array { // three values: // opposing-account-id, opposing-account-iban, opposing-account-name diff --git a/app/Helpers/Csv/PostProcessing/PostProcessorInterface.php b/app/Helpers/Csv/PostProcessing/PostProcessorInterface.php index a6a793c3d5..bc67b7d9cf 100644 --- a/app/Helpers/Csv/PostProcessing/PostProcessorInterface.php +++ b/app/Helpers/Csv/PostProcessing/PostProcessorInterface.php @@ -14,7 +14,7 @@ interface PostProcessorInterface /** * @return array */ - public function process(); + public function process(): array; /** * @param array $data diff --git a/app/Helpers/Csv/Specifix/AbnAmroDescription.php b/app/Helpers/Csv/Specifix/AbnAmroDescription.php index c5f0cb1245..4c3cfce346 100644 --- a/app/Helpers/Csv/Specifix/AbnAmroDescription.php +++ b/app/Helpers/Csv/Specifix/AbnAmroDescription.php @@ -32,7 +32,7 @@ class AbnAmroDescription extends Specifix implements SpecifixInterface /** * @return array */ - public function fix() + public function fix(): array { // Try to parse the description in known formats. $parsed = $this->parseSepaDescription() || $this->parseTRTPDescription() || $this->parseGEABEADescription() || $this->parseABNAMRODescription(); @@ -65,7 +65,7 @@ class AbnAmroDescription extends Specifix implements SpecifixInterface /** * Parses the current description with costs from ABN AMRO itself * - * @return boolean true if the description is GEA/BEA-format, false otherwise + * @return bool true if the description is GEA/BEA-format, false otherwise */ protected function parseABNAMRODescription() { @@ -85,7 +85,7 @@ class AbnAmroDescription extends Specifix implements SpecifixInterface /** * Parses the current description in GEA/BEA format * - * @return boolean true if the description is GEA/BEAformat, false otherwise + * @return bool true if the description is GEA/BEAformat, false otherwise */ protected function parseGEABEADescription() { @@ -111,7 +111,7 @@ class AbnAmroDescription extends Specifix implements SpecifixInterface /** * Parses the current description in SEPA format * - * @return boolean true if the description is SEPA format, false otherwise + * @return bool true if the description is SEPA format, false otherwise */ protected function parseSepaDescription() { @@ -168,7 +168,7 @@ class AbnAmroDescription extends Specifix implements SpecifixInterface /** * Parses the current description in TRTP format * - * @return boolean true if the description is TRTP format, false otherwise + * @return bool true if the description is TRTP format, false otherwise */ protected function parseTRTPDescription() { diff --git a/app/Helpers/Csv/Specifix/Dummy.php b/app/Helpers/Csv/Specifix/Dummy.php index 2e4263a4d5..5d84545619 100644 --- a/app/Helpers/Csv/Specifix/Dummy.php +++ b/app/Helpers/Csv/Specifix/Dummy.php @@ -26,7 +26,7 @@ class Dummy extends Specifix implements SpecifixInterface /** * @return array */ - public function fix() + public function fix(): array { return $this->data; diff --git a/app/Helpers/Csv/Specifix/RabobankDescription.php b/app/Helpers/Csv/Specifix/RabobankDescription.php index 249fc00cfe..19e018b5ec 100644 --- a/app/Helpers/Csv/Specifix/RabobankDescription.php +++ b/app/Helpers/Csv/Specifix/RabobankDescription.php @@ -29,7 +29,7 @@ class RabobankDescription extends Specifix implements SpecifixInterface /** * @return array */ - public function fix() + public function fix(): array { $this->rabobankFixEmptyOpposing(); diff --git a/app/Helpers/Csv/Specifix/Specifix.php b/app/Helpers/Csv/Specifix/Specifix.php index 37c40ccc27..fcceeb3652 100644 --- a/app/Helpers/Csv/Specifix/Specifix.php +++ b/app/Helpers/Csv/Specifix/Specifix.php @@ -24,7 +24,7 @@ class Specifix /** * @return int */ - public function getProcessorType() + public function getProcessorType(): int { return $this->processorType; } diff --git a/app/Helpers/Csv/Specifix/SpecifixInterface.php b/app/Helpers/Csv/Specifix/SpecifixInterface.php index b6534fbe51..79e701d8fc 100644 --- a/app/Helpers/Csv/Specifix/SpecifixInterface.php +++ b/app/Helpers/Csv/Specifix/SpecifixInterface.php @@ -20,7 +20,7 @@ interface SpecifixInterface /** * @return int */ - public function getProcessorType(); + public function getProcessorType(): int; /** * @param array $data diff --git a/app/Helpers/Csv/Wizard.php b/app/Helpers/Csv/Wizard.php index dcb8424dc3..33d76f0499 100644 --- a/app/Helpers/Csv/Wizard.php +++ b/app/Helpers/Csv/Wizard.php @@ -29,7 +29,7 @@ class Wizard implements WizardInterface * * @return array */ - public function getMappableValues(Reader $reader, array $map, bool $hasHeaders) + public function getMappableValues(Reader $reader, array $map, bool $hasHeaders): array { $values = []; /* @@ -59,7 +59,7 @@ class Wizard implements WizardInterface * * @return array */ - public function processSelectedMapping(array $roles, array $map) + public function processSelectedMapping(array $roles, array $map): array { $configRoles = Config::get('csv.roles'); $maps = []; @@ -86,7 +86,7 @@ class Wizard implements WizardInterface * * @return array */ - public function processSelectedRoles(array $input) + public function processSelectedRoles(array $input): array { $roles = []; @@ -110,7 +110,7 @@ class Wizard implements WizardInterface * * @return bool */ - public function sessionHasValues(array $fields) + public function sessionHasValues(array $fields): bool { foreach ($fields as $field) { if (!Session::has($field)) { @@ -129,7 +129,7 @@ class Wizard implements WizardInterface * @return array * @throws FireflyException */ - public function showOptions(array $map) + public function showOptions(array $map): array { $options = []; foreach ($map as $index => $columnRole) { @@ -157,7 +157,7 @@ class Wizard implements WizardInterface * * @return string */ - public function storeCsvFile(string $path) + public function storeCsvFile(string $path): string { $time = str_replace(' ', '-', microtime()); $fileName = 'csv-upload-' . Auth::user()->id . '-' . $time . '.csv.encrypted'; diff --git a/app/Helpers/Csv/WizardInterface.php b/app/Helpers/Csv/WizardInterface.php index 815a432a43..815a800c27 100644 --- a/app/Helpers/Csv/WizardInterface.php +++ b/app/Helpers/Csv/WizardInterface.php @@ -19,7 +19,7 @@ interface WizardInterface * * @return array */ - public function getMappableValues(Reader $reader, array $map, bool $hasHeaders); + public function getMappableValues(Reader $reader, array $map, bool $hasHeaders): array; /** * @param array $roles @@ -27,34 +27,34 @@ interface WizardInterface * * @return array */ - public function processSelectedMapping(array $roles, array $map); + public function processSelectedMapping(array $roles, array $map): array; /** * @param array $input * * @return array */ - public function processSelectedRoles(array $input); + public function processSelectedRoles(array $input): array; /** * @param array $fields * * @return bool */ - public function sessionHasValues(array $fields); + public function sessionHasValues(array $fields): bool; /** * @param array $map * * @return array */ - public function showOptions(array $map); + public function showOptions(array $map): array; /** * @param string $path * * @return string */ - public function storeCsvFile(string $path); + public function storeCsvFile(string $path): string; } diff --git a/app/Helpers/FiscalHelper.php b/app/Helpers/FiscalHelper.php index 224fc5a025..3f5c9eebc9 100644 --- a/app/Helpers/FiscalHelper.php +++ b/app/Helpers/FiscalHelper.php @@ -20,7 +20,6 @@ class FiscalHelper implements FiscalHelperInterface /** * FiscalHelper constructor. * - * @codeCoverageIgnore * */ public function __construct() @@ -37,7 +36,7 @@ class FiscalHelper implements FiscalHelperInterface * * @return Carbon date object */ - public function endOfFiscalYear(Carbon $date) + public function endOfFiscalYear(Carbon $date): Carbon { // get start of fiscal year for passed date $endDate = $this->startOfFiscalYear($date); @@ -58,7 +57,7 @@ class FiscalHelper implements FiscalHelperInterface * * @return Carbon date object */ - public function startOfFiscalYear(Carbon $date) + public function startOfFiscalYear(Carbon $date): Carbon { // get start mm-dd. Then create a start date in the year passed. $startDate = clone $date; diff --git a/app/Helpers/FiscalHelperInterface.php b/app/Helpers/FiscalHelperInterface.php index b812fb9324..1d31ad0e18 100644 --- a/app/Helpers/FiscalHelperInterface.php +++ b/app/Helpers/FiscalHelperInterface.php @@ -21,7 +21,7 @@ interface FiscalHelperInterface * * @return Carbon date object */ - public function endOfFiscalYear(Carbon $date); + public function endOfFiscalYear(Carbon $date): Carbon; /** * This method produces a clone of the Carbon date object passed, checks preferences @@ -31,6 +31,6 @@ interface FiscalHelperInterface * * @return Carbon date object */ - public function startOfFiscalYear(Carbon $date); + public function startOfFiscalYear(Carbon $date): Carbon; } diff --git a/app/Helpers/Help/Help.php b/app/Helpers/Help/Help.php index 881006afe0..25fa36fe99 100644 --- a/app/Helpers/Help/Help.php +++ b/app/Helpers/Help/Help.php @@ -17,7 +17,6 @@ class Help implements HelpInterface { /** - * @codeCoverageIgnore * * @param string $key * @@ -68,7 +67,6 @@ class Help implements HelpInterface } /** - * @codeCoverageIgnore * * @param string $route * @@ -80,7 +78,6 @@ class Help implements HelpInterface } /** - * @codeCoverageIgnore * * @param string $route * @@ -92,16 +89,16 @@ class Help implements HelpInterface } /** - * @codeCoverageIgnore * * @param string $route + * @param string $language * @param array $content * * @internal param $title */ - public function putInCache(string $route, array $content) + public function putInCache(string $route, string $language, array $content) { - Cache::put('help.' . $route . '.text', $content['text'], 10080); // a week. - Cache::put('help.' . $route . '.title', $content['title'], 10080); + Cache::put('help.' . $route . '.text.' . $language, $content['text'], 10080); // a week. + Cache::put('help.' . $route . '.title.' . $language, $content['title'], 10080); } } diff --git a/app/Helpers/Help/HelpInterface.php b/app/Helpers/Help/HelpInterface.php index 5f2c07b215..28c30e11ea 100644 --- a/app/Helpers/Help/HelpInterface.php +++ b/app/Helpers/Help/HelpInterface.php @@ -41,7 +41,8 @@ interface HelpInterface /** * @param string $route + * @param string $language * @param array $content */ - public function putInCache(string $route, array $content); + public function putInCache(string $route, string $language, array $content); } diff --git a/app/Helpers/Report/AccountReportHelper.php b/app/Helpers/Report/AccountReportHelper.php index 1a1157d0ec..43d58a136d 100644 --- a/app/Helpers/Report/AccountReportHelper.php +++ b/app/Helpers/Report/AccountReportHelper.php @@ -34,7 +34,7 @@ class AccountReportHelper implements AccountReportHelperInterface * * @return AccountCollection */ - public function getAccountReport(Carbon $start, Carbon $end, Collection $accounts) + public function getAccountReport(Carbon $start, Carbon $end, Collection $accounts): AccountCollection { $startAmount = '0'; $endAmount = '0'; diff --git a/app/Helpers/Report/AccountReportHelperInterface.php b/app/Helpers/Report/AccountReportHelperInterface.php index 02e56274f3..673168b18a 100644 --- a/app/Helpers/Report/AccountReportHelperInterface.php +++ b/app/Helpers/Report/AccountReportHelperInterface.php @@ -32,6 +32,6 @@ interface AccountReportHelperInterface * * @return AccountCollection */ - public function getAccountReport(Carbon $start, Carbon $end, Collection $accounts); + public function getAccountReport(Carbon $start, Carbon $end, Collection $accounts): AccountCollection; } diff --git a/app/Helpers/Report/BalanceReportHelper.php b/app/Helpers/Report/BalanceReportHelper.php index 290f6896ba..a529ac104a 100644 --- a/app/Helpers/Report/BalanceReportHelper.php +++ b/app/Helpers/Report/BalanceReportHelper.php @@ -40,7 +40,6 @@ class BalanceReportHelper implements BalanceReportHelperInterface /** * ReportHelper constructor. * - * @codeCoverageIgnore * * @param BudgetRepositoryInterface $budgetRepository * @param TagRepositoryInterface $tagRepository @@ -59,7 +58,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface * * @return Balance */ - public function getBalanceReport(Carbon $start, Carbon $end, Collection $accounts) + public function getBalanceReport(Carbon $start, Carbon $end, Collection $accounts): Balance { $balance = new Balance; @@ -92,7 +91,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface * * @return BalanceLine */ - private function createBalanceLine(BudgetModel $budget, Collection $accounts, Collection $spentData) + private function createBalanceLine(BudgetModel $budget, Collection $accounts, Collection $spentData): BalanceLine { $line = new BalanceLine; $line->setBudget($budget); @@ -129,7 +128,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface * * @return BalanceLine */ - private function createDifferenceBalanceLine(Collection $accounts, Collection $spentData, Carbon $start, Carbon $end) + private function createDifferenceBalanceLine(Collection $accounts, Collection $spentData, Carbon $start, Carbon $end): BalanceLine { $diff = new BalanceLine; $tagsLeft = $this->tagRepository->allCoveredByBalancingActs($accounts, $start, $end); @@ -174,7 +173,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface * * @return BalanceLine */ - private function createEmptyBalanceLine(Collection $accounts, Collection $spentData) + private function createEmptyBalanceLine(Collection $accounts, Collection $spentData): BalanceLine { $empty = new BalanceLine; @@ -207,7 +206,7 @@ class BalanceReportHelper implements BalanceReportHelperInterface * * @return BalanceLine */ - private function createTagsBalanceLine(Collection $accounts, Carbon $start, Carbon $end) + private function createTagsBalanceLine(Collection $accounts, Carbon $start, Carbon $end): BalanceLine { $tags = new BalanceLine; $tagsLeft = $this->tagRepository->allCoveredByBalancingActs($accounts, $start, $end); diff --git a/app/Helpers/Report/BalanceReportHelperInterface.php b/app/Helpers/Report/BalanceReportHelperInterface.php index d225e94781..9cdcdb19b7 100644 --- a/app/Helpers/Report/BalanceReportHelperInterface.php +++ b/app/Helpers/Report/BalanceReportHelperInterface.php @@ -29,5 +29,5 @@ interface BalanceReportHelperInterface * * @return Balance */ - public function getBalanceReport(Carbon $start, Carbon $end, Collection $accounts); + public function getBalanceReport(Carbon $start, Carbon $end, Collection $accounts): Balance; } diff --git a/app/Helpers/Report/BudgetReportHelperInterface.php b/app/Helpers/Report/BudgetReportHelperInterface.php index 1096a1b027..b1cd8fb955 100644 --- a/app/Helpers/Report/BudgetReportHelperInterface.php +++ b/app/Helpers/Report/BudgetReportHelperInterface.php @@ -29,5 +29,5 @@ interface BudgetReportHelperInterface * * @return BudgetCollection */ - public function getBudgetReport(Carbon $start, Carbon $end, Collection $accounts); + public function getBudgetReport(Carbon $start, Carbon $end, Collection $accounts): BudgetCollection; } diff --git a/app/Helpers/Report/ReportHelper.php b/app/Helpers/Report/ReportHelper.php index 93b7a12e07..d1f70d7826 100644 --- a/app/Helpers/Report/ReportHelper.php +++ b/app/Helpers/Report/ReportHelper.php @@ -37,7 +37,6 @@ class ReportHelper implements ReportHelperInterface /** * ReportHelper constructor. * - * @codeCoverageIgnore * * @param ReportQueryInterface $query * @param BudgetRepositoryInterface $budgetRepository @@ -62,7 +61,7 @@ class ReportHelper implements ReportHelperInterface * * @return BillCollection */ - public function getBillReport(Carbon $start, Carbon $end, Collection $accounts) + public function getBillReport(Carbon $start, Carbon $end, Collection $accounts): BillCollection { /** @var \FireflyIII\Repositories\Bill\BillRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Bill\BillRepositoryInterface'); @@ -109,7 +108,7 @@ class ReportHelper implements ReportHelperInterface * * @return CategoryCollection */ - public function getCategoryReport(Carbon $start, Carbon $end, Collection $accounts) + public function getCategoryReport(Carbon $start, Carbon $end, Collection $accounts): CategoryCollection { $object = new CategoryCollection; @@ -136,7 +135,7 @@ class ReportHelper implements ReportHelperInterface * * @return Expense */ - public function getExpenseReport(Carbon $start, Carbon $end, Collection $accounts) + public function getExpenseReport(Carbon $start, Carbon $end, Collection $accounts): Expense { $object = new Expense; $set = $this->query->expense($accounts, $start, $end); @@ -158,7 +157,7 @@ class ReportHelper implements ReportHelperInterface * * @return Income */ - public function getIncomeReport(Carbon $start, Carbon $end, Collection $accounts) + public function getIncomeReport(Carbon $start, Carbon $end, Collection $accounts): Income { $object = new Income; $set = $this->query->income($accounts, $start, $end); @@ -176,7 +175,7 @@ class ReportHelper implements ReportHelperInterface * * @return array */ - public function listOfMonths(Carbon $date) + public function listOfMonths(Carbon $date): array { /** @var FiscalHelperInterface $fiscalHelper */ $fiscalHelper = app('FireflyIII\Helpers\FiscalHelperInterface'); diff --git a/app/Helpers/Report/ReportHelperInterface.php b/app/Helpers/Report/ReportHelperInterface.php index e45fd3b56f..33be9fe4e8 100644 --- a/app/Helpers/Report/ReportHelperInterface.php +++ b/app/Helpers/Report/ReportHelperInterface.php @@ -30,7 +30,7 @@ interface ReportHelperInterface * * @return BillCollection */ - public function getBillReport(Carbon $start, Carbon $end, Collection $accounts); + public function getBillReport(Carbon $start, Carbon $end, Collection $accounts): BillCollection; /** * @param Carbon $start @@ -39,7 +39,7 @@ interface ReportHelperInterface * * @return CategoryCollection */ - public function getCategoryReport(Carbon $start, Carbon $end, Collection $accounts); + public function getCategoryReport(Carbon $start, Carbon $end, Collection $accounts): CategoryCollection; /** * Get a full report on the users expenses during the period for a list of accounts. @@ -50,7 +50,7 @@ interface ReportHelperInterface * * @return Expense */ - public function getExpenseReport(Carbon $start, Carbon $end, Collection $accounts); + public function getExpenseReport(Carbon $start, Carbon $end, Collection $accounts): Expense; /** * Get a full report on the users incomes during the period for the given accounts. @@ -61,14 +61,14 @@ interface ReportHelperInterface * * @return Income */ - public function getIncomeReport(Carbon $start, Carbon $end, Collection $accounts); + public function getIncomeReport(Carbon $start, Carbon $end, Collection $accounts): Income; /** * @param Carbon $date * * @return array */ - public function listOfMonths(Carbon $date); + public function listOfMonths(Carbon $date): array; /** * Returns an array of tags and their comparitive size with amounts bla bla. diff --git a/app/Helpers/Report/ReportQuery.php b/app/Helpers/Report/ReportQuery.php index da7269002f..dd451834b9 100644 --- a/app/Helpers/Report/ReportQuery.php +++ b/app/Helpers/Report/ReportQuery.php @@ -28,7 +28,7 @@ class ReportQuery implements ReportQueryInterface * * @return array */ - public function earnedPerMonth(Collection $accounts, Carbon $start, Carbon $end) + public function earnedPerMonth(Collection $accounts, Carbon $start, Carbon $end): array { $ids = $accounts->pluck('id')->toArray(); $query = Auth::user()->transactionjournals() @@ -72,7 +72,7 @@ class ReportQuery implements ReportQueryInterface * * @return Collection */ - public function expense(Collection $accounts, Carbon $start, Carbon $end) + public function expense(Collection $accounts, Carbon $start, Carbon $end): Collection { $ids = $accounts->pluck('id')->toArray(); $set = Auth::user()->transactionjournals() @@ -107,7 +107,7 @@ class ReportQuery implements ReportQueryInterface * * @return Collection */ - public function income(Collection $accounts, Carbon $start, Carbon $end) + public function income(Collection $accounts, Carbon $start, Carbon $end): Collection { $ids = $accounts->pluck('id')->toArray(); $set = Auth::user()->transactionjournals() @@ -142,7 +142,7 @@ class ReportQuery implements ReportQueryInterface * * @return array */ - public function spentPerMonth(Collection $accounts, Carbon $start, Carbon $end) + public function spentPerMonth(Collection $accounts, Carbon $start, Carbon $end): array { $ids = $accounts->pluck('id')->toArray(); $query = Auth::user()->transactionjournals() diff --git a/app/Helpers/Report/ReportQueryInterface.php b/app/Helpers/Report/ReportQueryInterface.php index db1efc6d5a..f746710ffb 100644 --- a/app/Helpers/Report/ReportQueryInterface.php +++ b/app/Helpers/Report/ReportQueryInterface.php @@ -24,7 +24,7 @@ interface ReportQueryInterface * * @return array */ - public function earnedPerMonth(Collection $accounts, Carbon $start, Carbon $end); + public function earnedPerMonth(Collection $accounts, Carbon $start, Carbon $end): array; /** * This method returns all the "out" transaction journals for the given account and given period. The amount @@ -36,7 +36,7 @@ interface ReportQueryInterface * * @return Collection */ - public function expense(Collection $accounts, Carbon $start, Carbon $end); + public function expense(Collection $accounts, Carbon $start, Carbon $end): Collection; /** * This method returns all the "in" transaction journals for the given account and given period. The amount @@ -48,7 +48,7 @@ interface ReportQueryInterface * * @return Collection */ - public function income(Collection $accounts, Carbon $start, Carbon $end); + public function income(Collection $accounts, Carbon $start, Carbon $end): Collection; /** * Returns an array of the amount of money spent in the given accounts (on withdrawals, opening balances and transfers) @@ -60,7 +60,7 @@ interface ReportQueryInterface * * @return array */ - public function spentPerMonth(Collection $accounts, Carbon $start, Carbon $end); + public function spentPerMonth(Collection $accounts, Carbon $start, Carbon $end): array; } diff --git a/app/Http/Controllers/Admin/HomeController.php b/app/Http/Controllers/Admin/HomeController.php index 81a75f086b..47dc4eee08 100644 --- a/app/Http/Controllers/Admin/HomeController.php +++ b/app/Http/Controllers/Admin/HomeController.php @@ -30,4 +30,4 @@ class HomeController extends Controller return view('admin.index', compact('title', 'mainTitleIcon')); } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/Admin/UserController.php b/app/Http/Controllers/Admin/UserController.php index ad404e3e9f..9dbc765d07 100644 --- a/app/Http/Controllers/Admin/UserController.php +++ b/app/Http/Controllers/Admin/UserController.php @@ -67,4 +67,4 @@ class UserController extends Controller } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/BudgetController.php b/app/Http/Controllers/BudgetController.php index 4305b02a8b..6223216e17 100644 --- a/app/Http/Controllers/BudgetController.php +++ b/app/Http/Controllers/BudgetController.php @@ -166,7 +166,7 @@ class BudgetController extends Controller foreach ($budgets as $budget) { $budget->spent = $repository->balanceInPeriod($budget, $start, $end, $accounts); $budget->currentRep = $repository->getCurrentRepetition($budget, $start, $end); - if ($budget->currentRep) { + if (!is_null($budget->currentRep->id)) { $budgeted = bcadd($budgeted, $budget->currentRep->amount); } $spent = bcadd($spent, $budget->spent); diff --git a/app/Http/Controllers/CategoryController.php b/app/Http/Controllers/CategoryController.php index ebc39a5f15..8bac8029d2 100644 --- a/app/Http/Controllers/CategoryController.php +++ b/app/Http/Controllers/CategoryController.php @@ -115,7 +115,7 @@ class CategoryController extends Controller */ public function index(CRI $repository, SCRI $singleRepository) { - $categories = $repository->listCategories(); + $categories = $repository->getCategories(); $categories->each( function (Category $category) use ($singleRepository) { diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.php index 4f0c5d365a..951e9bda4f 100644 --- a/app/Http/Controllers/Chart/AccountController.php +++ b/app/Http/Controllers/Chart/AccountController.php @@ -56,7 +56,7 @@ class AccountController extends Controller $cache->addProperty($reportType); $cache->addProperty($accounts); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } // make chart: @@ -86,7 +86,7 @@ class AccountController extends Controller $cache->addProperty('expenseAccounts'); $cache->addProperty('accounts'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $data = $this->generator->expenseAccounts($accounts, $start, $end); @@ -117,7 +117,7 @@ class AccountController extends Controller $cache->addProperty('frontpage'); $cache->addProperty('accounts'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $data = $this->generator->frontpage($accounts, $start, $end); @@ -149,7 +149,7 @@ class AccountController extends Controller $cache->addProperty('single'); $cache->addProperty($account->id); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $data = $this->generator->single($account, $start, $end); diff --git a/app/Http/Controllers/Chart/BillController.php b/app/Http/Controllers/Chart/BillController.php index aba1965f05..88c617a621 100644 --- a/app/Http/Controllers/Chart/BillController.php +++ b/app/Http/Controllers/Chart/BillController.php @@ -78,7 +78,7 @@ class BillController extends Controller $cache->addProperty('bill'); $cache->addProperty($bill->id); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } // get first transaction or today for start: diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index 7452997d4c..b7025dd279 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -57,7 +57,7 @@ class BudgetController extends Controller $cache->addProperty('budget'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $final = clone $last; @@ -108,7 +108,7 @@ class BudgetController extends Controller $cache->addProperty($budget->id); $cache->addProperty($repetition->id); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $set = $repository->getExpensesPerDay($budget, $start, $end); @@ -161,7 +161,7 @@ class BudgetController extends Controller $cache->addProperty('budget'); $cache->addProperty('all'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $budgets = $repository->getBudgetsAndLimitsInRange($start, $end); @@ -230,7 +230,7 @@ class BudgetController extends Controller $cache->addProperty('multiYearBudget'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } /* @@ -310,7 +310,7 @@ class BudgetController extends Controller $cache->addProperty('budget'); $cache->addProperty('year'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $budgetInformation = $repository->getBudgetsAndExpensesPerMonth($accounts, $start, $end); diff --git a/app/Http/Controllers/Chart/CategoryController.php b/app/Http/Controllers/Chart/CategoryController.php index b0e5eaf873..3eb80cf958 100644 --- a/app/Http/Controllers/Chart/CategoryController.php +++ b/app/Http/Controllers/Chart/CategoryController.php @@ -67,7 +67,7 @@ class CategoryController extends Controller $cache->addProperty('all'); $cache->addProperty('categories'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $spentArray = $repository->spentPerDay($category, $start, $end); $earnedArray = $repository->earnedPerDay($category, $start, $end); @@ -130,7 +130,7 @@ class CategoryController extends Controller $cache->addProperty('category'); $cache->addProperty('earned-in-period'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $set = $repository->earnedForAccountsPerMonth($accounts, $start, $end); @@ -169,7 +169,7 @@ class CategoryController extends Controller $cache->addProperty('category'); $cache->addProperty('frontpage'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } // get data for categories (and "no category"): @@ -215,7 +215,7 @@ class CategoryController extends Controller $cache->addProperty('multiYearCategory'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $entries = new Collection; @@ -321,7 +321,7 @@ class CategoryController extends Controller $cache->addProperty('category'); $cache->addProperty('spent-in-period'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } diff --git a/app/Http/Controllers/Chart/PiggyBankController.php b/app/Http/Controllers/Chart/PiggyBankController.php index bf2d91a445..1eab1366f0 100644 --- a/app/Http/Controllers/Chart/PiggyBankController.php +++ b/app/Http/Controllers/Chart/PiggyBankController.php @@ -47,11 +47,10 @@ class PiggyBankController extends Controller $cache->addProperty('piggy-history'); $cache->addProperty($piggyBank->id); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } - /** @var Collection $set */ - $set = new Collection($repository->getEventSummarySet($piggyBank)); + $set = $repository->getEventSummarySet($piggyBank); $data = $this->generator->history($set); $cache->store($data); diff --git a/app/Http/Controllers/Chart/ReportController.php b/app/Http/Controllers/Chart/ReportController.php index 7362ae68a8..8bcff1ec36 100644 --- a/app/Http/Controllers/Chart/ReportController.php +++ b/app/Http/Controllers/Chart/ReportController.php @@ -54,7 +54,7 @@ class ReportController extends Controller $cache->addProperty($accounts); $cache->addProperty($end); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $ids = $accounts->pluck('id')->toArray(); $current = clone $start; @@ -102,7 +102,7 @@ class ReportController extends Controller $cache->addProperty($accounts); $cache->addProperty($end); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } // spent per month, and earned per month. For a specific set of accounts @@ -146,7 +146,7 @@ class ReportController extends Controller $cache->addProperty($reportType); $cache->addProperty($accounts); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } // spent per month, and earned per month. For a specific set of accounts // grouped by month diff --git a/app/Http/Controllers/HelpController.php b/app/Http/Controllers/HelpController.php index 67e177a53d..9f7b58ff78 100644 --- a/app/Http/Controllers/HelpController.php +++ b/app/Http/Controllers/HelpController.php @@ -28,8 +28,9 @@ class HelpController extends Controller */ public function show(HelpInterface $help, string $route) { - $content = [ - 'text' => '

There is no help for this route!

', + $language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data; + $content = [ + 'text' => '

' . strval(trans('firefly.route_has_no_help')) . '

', 'title' => 'Help', ]; @@ -41,16 +42,17 @@ class HelpController extends Controller if ($help->inCache($route)) { $content = [ - 'text' => $help->getFromCache('help.' . $route . '.text'), - 'title' => $help->getFromCache('help.' . $route . '.title'), + 'text' => $help->getFromCache('help.' . $route . '.text.' . $language), + 'title' => $help->getFromCache('help.' . $route . '.title.' . $language), ]; return Response::json($content); } - $language = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'))->data; - $content = $help->getFromGithub($language, $route); - $help->putInCache($route, $content); + Log::debug('Will get help from Github for language "' . $language . '" and route "' . $route . '".'); + $content = $help->getFromGithub($language, $route); + + $help->putInCache($route, $language, $content); return Response::json($content); diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 5b76367ded..ee5a8a9147 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -1,5 +1,6 @@ sumOfEverything(); if (bccomp($sum, '0') !== 0) { - Session::flash( - 'error', 'Your transactions are unbalanced. This means a' - . ' withdrawal, deposit or transfer was not stored properly. ' - . 'Please check your accounts and transactions for errors (' . $sum . ').' - ); + Session::flash('error', strval(trans('firefly.unbalanced_error', ['amount' => Amount::format($sum,false)]))); } foreach ($accounts as $account) { diff --git a/app/Http/Controllers/JsonController.php b/app/Http/Controllers/JsonController.php index 229879cf1a..1df37061df 100644 --- a/app/Http/Controllers/JsonController.php +++ b/app/Http/Controllers/JsonController.php @@ -114,7 +114,7 @@ class JsonController extends Controller $cache->addProperty($end); $cache->addProperty('box-in'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $accounts = $accountRepository->getAccounts(['Default account', 'Asset account', 'Cash account']); $amount = $reportQuery->income($accounts, $start, $end)->sum('journalAmount'); @@ -145,7 +145,7 @@ class JsonController extends Controller $cache->addProperty($end); $cache->addProperty('box-out'); if ($cache->has()) { - return Response::json($cache->get()); // @codeCoverageIgnore + return Response::json($cache->get()); } $amount = $reportQuery->expense($accounts, $start, $end)->sum('journalAmount'); @@ -165,7 +165,7 @@ class JsonController extends Controller */ public function categories(CRI $repository) { - $list = $repository->listCategories(); + $list = $repository->getCategories(); $return = []; foreach ($list as $entry) { $return[] = $entry->name; diff --git a/app/Http/Controllers/Popup/ReportController.php b/app/Http/Controllers/Popup/ReportController.php index 47c76aed89..a0a0055b0d 100644 --- a/app/Http/Controllers/Popup/ReportController.php +++ b/app/Http/Controllers/Popup/ReportController.php @@ -231,4 +231,4 @@ class ReportController extends Controller return $attributes; } -} \ No newline at end of file +} diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.php index b416c7fa63..0873d45846 100644 --- a/app/Http/Controllers/ReportController.php +++ b/app/Http/Controllers/ReportController.php @@ -7,11 +7,15 @@ use FireflyIII\Helpers\Report\BalanceReportHelperInterface; use FireflyIII\Helpers\Report\BudgetReportHelperInterface; use FireflyIII\Helpers\Report\ReportHelperInterface; use FireflyIII\Models\Account; +use FireflyIII\Models\TransactionJournal; use FireflyIII\Repositories\Account\AccountRepositoryInterface as ARI; +use FireflyIII\Repositories\Budget\BudgetRepositoryInterface; +use FireflyIII\Repositories\Category\CategoryRepositoryInterface; use Illuminate\Support\Collection; use Log; use Preferences; use Session; +use Steam; use View; /** @@ -100,22 +104,22 @@ class ReportController extends Controller $start = session('first'); } + View::share( + 'subTitle', trans( + 'firefly.report_' . $reportType, + [ + 'start' => $start->formatLocalized($this->monthFormat), + 'end' => $end->formatLocalized($this->monthFormat), + ] + ) + ); + View::share('subTitleIcon', 'fa-calendar'); + switch ($reportType) { default: throw new FireflyException('Unfortunately, reports of the type "' . e($reportType) . '" are not yet available. '); case 'default': - View::share( - 'subTitle', trans( - 'firefly.report_default', - [ - 'start' => $start->formatLocalized($this->monthFormat), - 'end' => $end->formatLocalized($this->monthFormat), - ] - ) - ); - View::share('subTitleIcon', 'fa-calendar'); - // more than one year date difference means year report. if ($start->diffInMonths($end) > 12) { return $this->defaultMultiYear($reportType, $start, $end, $accounts); @@ -125,27 +129,92 @@ class ReportController extends Controller return $this->defaultYear($reportType, $start, $end, $accounts); } + // otherwise default return $this->defaultMonth($reportType, $start, $end, $accounts); case 'audit': - - View::share( - 'subTitle', trans( - 'firefly.report_audit', - [ - 'start' => $start->formatLocalized($this->monthFormat), - 'end' => $end->formatLocalized($this->monthFormat), - ] - ) - ); - View::share('subTitleIcon', 'fa-calendar'); - - throw new FireflyException('Unfortunately, reports of the type "' . e($reportType) . '" are not yet available. '); - break; + // always default + return $this->auditReport($start, $end, $accounts); } } + /** + * @param Carbon $start + * @param Carbon $end + * @param Collection $accounts + * + * @return View + */ + private function auditReport(Carbon $start, Carbon $end, Collection $accounts) + { + /** @var ARI $repos */ + $repos = app('FireflyIII\Repositories\Account\AccountRepositoryInterface'); + $auditData = []; + $dayBefore = clone $start; + $dayBefore->subDay(); + /** @var Account $account */ + foreach ($accounts as $account) { + + // balance the day before: + $id = $account->id; + $first = $repos->oldestJournalDate($account); + $last = $repos->newestJournalDate($account); + $exists = false; + $journals = new Collection; + $dayBeforeBalance = Steam::balance($account, $dayBefore); + + /* + * Is there even activity on this account between the requested dates? + */ + if ($start->between($first, $last) || $end->between($first, $last)) { + $exists = true; + $journals = $repos->getJournalsInRange($account, $start, $end); + + } + /* + * Reverse set, get balances. + */ + $journals = $journals->reverse(); + $startBalance = $dayBeforeBalance; + /** @var TransactionJournal $journal */ + foreach ($journals as $journal) { + $journal->before = $startBalance; + $transactionAmount = $journal->source_amount; + + // get currently relevant transaction: + if (intval($journal->destination_account_id) === $account->id) { + $transactionAmount = $journal->destination_amount; + } + $newBalance = bcadd($startBalance, $transactionAmount); + $journal->after = $newBalance; + $startBalance = $newBalance; + + } + + /* + * Reverse set again. + */ + $auditData[$id]['journals'] = $journals->reverse(); + $auditData[$id]['exists'] = $exists; + $auditData[$id]['end'] = $end->formatLocalized(trans('config.month_and_day')); + $auditData[$id]['endBalance'] = Steam::balance($account, $end); + $auditData[$id]['dayBefore'] = $dayBefore->formatLocalized(trans('config.month_and_day')); + $auditData[$id]['dayBeforeBalance'] = $dayBeforeBalance; + } + + + $reportType = 'audit'; + $accountIds = join(',', $accounts->pluck('id')->toArray()); + + $hideable = ['buttons', 'icon', 'description', 'balance_before', 'amount', 'balance_after', 'date', 'book_date', 'process_date', 'interest_date', + 'from', 'to', 'budget', 'category', 'bill', 'create_date', 'update_date', + ]; + $defaultShow = ['icon', 'description', 'balance_before', 'amount', 'balance_after', 'date', 'to']; + + return view('reports.audit.report', compact('start', 'end', 'reportType', 'accountIds', 'accounts', 'auditData', 'hideable', 'defaultShow')); + } + /** * @param $reportType * @param Carbon $start @@ -203,7 +272,7 @@ class ReportController extends Controller $expenseTopLength = 8; // list of users stuff: $budgets = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface')->getActiveBudgets(); - $categories = app('FireflyIII\Repositories\Category\CategoryRepositoryInterface')->listCategories(); + $categories = app('FireflyIII\Repositories\Category\CategoryRepositoryInterface')->getCategories(); $accountReport = $this->accountHelper->getAccountReport($start, $end, $accounts); $incomes = $this->helper->getIncomeReport($start, $end, $accounts); $expenses = $this->helper->getExpenseReport($start, $end, $accounts); @@ -264,6 +333,4 @@ class ReportController extends Controller ) ); } - - } diff --git a/app/Http/Controllers/TransactionController.php b/app/Http/Controllers/TransactionController.php index a0971dd904..b70fd3ac54 100644 --- a/app/Http/Controllers/TransactionController.php +++ b/app/Http/Controllers/TransactionController.php @@ -20,6 +20,7 @@ use FireflyIII\Repositories\Journal\JournalRepositoryInterface; use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface; use Illuminate\Support\Collection; use Input; +use Log; use Preferences; use Response; use Session; @@ -307,6 +308,7 @@ class TransactionController extends Controller Session::flash('info', $att->getMessages()->get('attachments')); } + Log::debug('Triggered TransactionJournalStored with transaction journal #' . $journal->id.' and piggy #' . intval($request->get('piggy_bank_id'))); event(new TransactionJournalStored($journal, intval($request->get('piggy_bank_id')))); Session::flash('success', strval(trans('firefly.stored_journal', ['description' => e($journal->description)]))); diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index 064d21119f..c7d8e2bb63 100644 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -29,6 +29,23 @@ use Illuminate\View\Middleware\ShareErrorsFromSession; */ class Kernel extends HttpKernel { + /** + * The bootstrap classes for the application. + * + * Next upgrade should verify these are all here. + * + * @var array + */ + protected $bootstrappers = [ + 'Illuminate\Foundation\Bootstrap\DetectEnvironment', + 'Illuminate\Foundation\Bootstrap\LoadConfiguration', + 'FireflyIII\Bootstrap\ConfigureLogging', + 'Illuminate\Foundation\Bootstrap\HandleExceptions', + 'Illuminate\Foundation\Bootstrap\RegisterFacades', + 'Illuminate\Foundation\Bootstrap\RegisterProviders', + 'Illuminate\Foundation\Bootstrap\BootProviders', + ]; + /** * The application's global HTTP middleware stack. * diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.php index 584611dc7c..43b8d5420f 100644 --- a/app/Http/Middleware/Range.php +++ b/app/Http/Middleware/Range.php @@ -69,7 +69,7 @@ class Range /** @var \FireflyIII\Repositories\Journal\JournalRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Journal\JournalRepositoryInterface'); $journal = $repository->first(); - if ($journal) { + if (!is_null($journal->id)) { Session::put('first', $journal->date); } else { Session::put('first', Carbon::now()->startOfYear()); diff --git a/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php b/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php index 242f9d85f1..20b33230e9 100644 --- a/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php +++ b/app/Jobs/ExecuteRuleGroupOnExistingTransactions.php @@ -44,7 +44,7 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue /** * @return Collection */ - public function getAccounts() + public function getAccounts(): Collection { return $this->accounts; } @@ -61,7 +61,7 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue /** * @return \Carbon\Carbon */ - public function getEndDate() + public function getEndDate(): Carbon { return $this->endDate; } @@ -78,7 +78,7 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue /** * @return \Carbon\Carbon */ - public function getStartDate() + public function getStartDate(): Carbon { return $this->startDate; } @@ -95,7 +95,7 @@ class ExecuteRuleGroupOnExistingTransactions extends Job implements ShouldQueue /** * @return User */ - public function getUser() + public function getUser(): User { return $this->user; } diff --git a/app/Jobs/MailError.php b/app/Jobs/MailError.php index 09b6af6cca..ff3298aa28 100644 --- a/app/Jobs/MailError.php +++ b/app/Jobs/MailError.php @@ -38,7 +38,6 @@ class MailError extends Job implements ShouldQueue * @param string $ipAddress * @param array $exceptionData * - * @internal param array $exception */ public function __construct(User $user, string $destination, string $ipAddress, array $exceptionData) { diff --git a/app/Models/Account.php b/app/Models/Account.php index 28a3c904ec..eaddfd0637 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -4,6 +4,8 @@ use Auth; use Crypt; use Illuminate\Database\Eloquent\Builder as EloquentBuilder; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\SoftDeletes; use Illuminate\Database\Query\JoinClause; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -146,36 +148,39 @@ class Account extends Model } /** - * @return \Illuminate\Database\Eloquent\Relations\HasMany + * @return HasMany */ - public function accountMeta() + public function accountMeta(): HasMany { return $this->hasMany('FireflyIII\Models\AccountMeta'); } /** - * @codeCoverageIgnore - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + * @return BelongsTo */ - public function accountType() + public function accountType(): BelongsTo { return $this->belongsTo('FireflyIII\Models\AccountType'); } /** - * @codeCoverageIgnore + * FIXME can return null * * @param $value * * @return string */ - public function getIbanAttribute($value) + public function getIbanAttribute($value): string { if (is_null($value)) { - return null; + return ''; + } + $result = Crypt::decrypt($value); + if (is_null($result)) { + return ''; } - return Crypt::decrypt($value); + return $result; } /** @@ -184,7 +189,7 @@ class Account extends Model * * @return string */ - public function getMeta($fieldName): string + public function getMeta(string $fieldName): string { foreach ($this->accountMeta as $meta) { if ($meta->name == $fieldName) { @@ -196,13 +201,12 @@ class Account extends Model } /** - * @codeCoverageIgnore * * @param $value * * @return string */ - public function getNameAttribute($value) + public function getNameAttribute($value): string { if (intval($this->encrypted) == 1) { @@ -216,7 +220,7 @@ class Account extends Model * * @return string */ - public function getNameForEditformAttribute() + public function getNameForEditformAttribute(): string { $name = $this->name; if ($this->accountType->type == 'Cash account') { @@ -227,16 +231,14 @@ class Account extends Model } /** - * @codeCoverageIgnore - * @return \Illuminate\Database\Eloquent\Relations\HasMany + * @return HasMany */ - public function piggyBanks() + public function piggyBanks(): HasMany { return $this->hasMany('FireflyIII\Models\PiggyBank'); } /** - * @codeCoverageIgnore * * @param EloquentBuilder $query * @param array $types @@ -251,7 +253,6 @@ class Account extends Model } /** - * @codeCoverageIgnore * * @param EloquentBuilder $query * @param string $name @@ -269,7 +270,6 @@ class Account extends Model } /** - * @codeCoverageIgnore * * @param $value */ @@ -279,7 +279,6 @@ class Account extends Model } /** - * @codeCoverageIgnore * * @param $value */ @@ -292,7 +291,6 @@ class Account extends Model /** * @param $value * - * @codeCoverageIgnore */ public function setVirtualBalanceAttribute($value) { @@ -300,19 +298,17 @@ class Account extends Model } /** - * @codeCoverageIgnore - * @return \Illuminate\Database\Eloquent\Relations\HasMany + * @return HasMany */ - public function transactions() + public function transactions(): HasMany { return $this->hasMany('FireflyIII\Models\Transaction'); } /** - * @codeCoverageIgnore - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + * @return BelongsTo */ - public function user() + public function user(): BelongsTo { return $this->belongsTo('FireflyIII\User'); } diff --git a/app/Models/AccountMeta.php b/app/Models/AccountMeta.php index aaa4f2ca44..794c3c2128 100644 --- a/app/Models/AccountMeta.php +++ b/app/Models/AccountMeta.php @@ -1,6 +1,7 @@ belongsTo('FireflyIII\Models\Account'); } diff --git a/app/Models/AccountType.php b/app/Models/AccountType.php index 7af6352c90..f9b6757fd1 100644 --- a/app/Models/AccountType.php +++ b/app/Models/AccountType.php @@ -1,6 +1,7 @@ hasMany('FireflyIII\Models\Account'); } diff --git a/app/Models/Attachment.php b/app/Models/Attachment.php index 7685847ac2..8252cbf65f 100644 --- a/app/Models/Attachment.php +++ b/app/Models/Attachment.php @@ -6,6 +6,8 @@ namespace FireflyIII\Models; use Auth; use Crypt; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\MorphTo; use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -70,8 +72,10 @@ class Attachment extends Model /** * Get all of the owning imageable models. + * + * @return MorphTo */ - public function attachable() + public function attachable(): MorphTo { return $this->morphTo(); } @@ -87,8 +91,6 @@ class Attachment extends Model } /** - * @codeCoverageIgnore - * * @param $value * * @return null|string @@ -103,8 +105,6 @@ class Attachment extends Model } /** - * @codeCoverageIgnore - * * @param $value * * @return null|string @@ -119,8 +119,6 @@ class Attachment extends Model } /** - * @codeCoverageIgnore - * * @param $value * * @return null|string @@ -135,7 +133,6 @@ class Attachment extends Model } /** - * @codeCoverageIgnore * * @param $value * @@ -151,7 +148,6 @@ class Attachment extends Model } /** - * @codeCoverageIgnore * * @param $value * @@ -169,7 +165,7 @@ class Attachment extends Model /** * @param string $value */ - public function setDescriptionAttribute($value) + public function setDescriptionAttribute(string $value) { $this->attributes['description'] = Crypt::encrypt($value); } @@ -177,7 +173,7 @@ class Attachment extends Model /** * @param string $value */ - public function setFilenameAttribute($value) + public function setFilenameAttribute(string $value) { $this->attributes['filename'] = Crypt::encrypt($value); } @@ -185,7 +181,7 @@ class Attachment extends Model /** * @param string $value */ - public function setMimeAttribute($value) + public function setMimeAttribute(string $value) { $this->attributes['mime'] = Crypt::encrypt($value); } @@ -193,7 +189,7 @@ class Attachment extends Model /** * @param string $value */ - public function setNotesAttribute($value) + public function setNotesAttribute(string $value) { $this->attributes['notes'] = Crypt::encrypt($value); } @@ -201,16 +197,15 @@ class Attachment extends Model /** * @param string $value */ - public function setTitleAttribute($value) + public function setTitleAttribute(string $value) { $this->attributes['title'] = Crypt::encrypt($value); } /** - * @codeCoverageIgnore - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + * @return BelongsTo */ - public function user() + public function user(): BelongsTo { return $this->belongsTo('FireflyIII\User'); } diff --git a/app/Models/Bill.php b/app/Models/Bill.php index 0742cc8e26..4ceb09a93e 100644 --- a/app/Models/Bill.php +++ b/app/Models/Bill.php @@ -3,6 +3,8 @@ use Auth; use Crypt; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\HasMany; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; /** @@ -135,17 +137,17 @@ class Bill extends Model } /** - * @return \Illuminate\Database\Eloquent\Relations\HasMany + * @return HasMany */ - public function transactionjournals() + public function transactionjournals(): HasMany { return $this->hasMany('FireflyIII\Models\TransactionJournal'); } /** - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + * @return BelongsTo */ - public function user() + public function user(): BelongsTo { return $this->belongsTo('FireflyIII\User'); } diff --git a/app/Models/Budget.php b/app/Models/Budget.php index 8b26f14c3c..092477fa6b 100644 --- a/app/Models/Budget.php +++ b/app/Models/Budget.php @@ -3,6 +3,7 @@ use Auth; use Crypt; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -136,9 +137,9 @@ class Budget extends Model } /** - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + * @return BelongsTo */ - public function user() + public function user(): BelongsTo { return $this->belongsTo('FireflyIII\User'); } diff --git a/app/Models/Category.php b/app/Models/Category.php index ef6d20c3f9..f3139fdf7f 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -3,6 +3,7 @@ use Auth; use Crypt; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; @@ -83,7 +84,6 @@ class Category extends Model } /** - * @codeCoverageIgnore * * @param $value * @@ -100,7 +100,6 @@ class Category extends Model } /** - * @codeCoverageIgnore * * @param $value */ @@ -111,7 +110,6 @@ class Category extends Model } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function transactionjournals() @@ -120,10 +118,9 @@ class Category extends Model } /** - * @codeCoverageIgnore - * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + * @return BelongsTo */ - public function user() + public function user(): BelongsTo { return $this->belongsTo('FireflyIII\User'); } diff --git a/app/Models/Component.php b/app/Models/Component.php index 5e8214d2aa..f4794eb3f2 100644 --- a/app/Models/Component.php +++ b/app/Models/Component.php @@ -25,14 +25,7 @@ use Illuminate\Database\Eloquent\Model; */ class Component extends Model { + protected $dates = ['created_at', 'updated_at', 'deleted_at']; protected $fillable = ['user_id', 'name', 'class']; - /** - * @return array - */ - public function getDates() - { - return ['created_at', 'updated_at', 'deleted_at']; - } - } diff --git a/app/Models/ExportJob.php b/app/Models/ExportJob.php index 22a6d4020e..e571bbfea0 100644 --- a/app/Models/ExportJob.php +++ b/app/Models/ExportJob.php @@ -64,7 +64,6 @@ class ExportJob extends Model } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user() diff --git a/app/Models/Tag.php b/app/Models/Tag.php index c7bcd66d71..9646cd855e 100644 --- a/app/Models/Tag.php +++ b/app/Models/Tag.php @@ -109,7 +109,6 @@ class Tag extends Model } /** - * @codeCoverageIgnore * * @param $value * @@ -125,7 +124,6 @@ class Tag extends Model } /** - * @codeCoverageIgnore * * @param $value * @@ -155,7 +153,6 @@ class Tag extends Model } /** - * @codeCoverageIgnore * * @param $value */ @@ -165,7 +162,6 @@ class Tag extends Model } /** - * @codeCoverageIgnore * * @param $value */ @@ -175,7 +171,6 @@ class Tag extends Model } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function transactionjournals() @@ -184,7 +179,6 @@ class Tag extends Model } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user() diff --git a/app/Models/TransactionJournal.php b/app/Models/TransactionJournal.php index 77e7601115..c87e3f426d 100644 --- a/app/Models/TransactionJournal.php +++ b/app/Models/TransactionJournal.php @@ -158,7 +158,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function bill() @@ -167,7 +166,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function budgets() @@ -176,7 +174,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function categories() @@ -185,7 +182,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * * @param $value * @@ -220,7 +216,7 @@ class TransactionJournal extends TransactionJournalSupport * * @return string */ - public function getMeta($fieldName): string + public function getMeta($fieldName) { foreach ($this->transactionjournalmeta as $meta) { if ($meta->name == $fieldName) { @@ -298,7 +294,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function piggyBankEvents() @@ -322,7 +317,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * * @param EloquentBuilder $query * @param Carbon $date @@ -335,7 +329,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * * @param EloquentBuilder $query * @param Carbon $date @@ -391,7 +384,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * * @param EloquentBuilder $query * @param array $types @@ -406,7 +398,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * * @param $value */ @@ -417,7 +408,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function tags() @@ -426,7 +416,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function transactionCurrency() @@ -435,7 +424,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function transactionType() @@ -444,7 +432,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany */ public function transactiongroups() @@ -461,7 +448,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\HasMany */ public function transactions() @@ -470,7 +456,6 @@ class TransactionJournal extends TransactionJournalSupport } /** - * @codeCoverageIgnore * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ public function user() diff --git a/app/Models/TransactionJournalMeta.php b/app/Models/TransactionJournalMeta.php index 2ebe924c1f..19687815cf 100644 --- a/app/Models/TransactionJournalMeta.php +++ b/app/Models/TransactionJournalMeta.php @@ -31,14 +31,36 @@ use Illuminate\Database\Eloquent\Relations\BelongsTo; * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionJournalMeta whereName($value) * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionJournalMeta whereData($value) * @mixin \Eloquent + * @property string $hash + * @method static \Illuminate\Database\Query\Builder|\FireflyIII\Models\TransactionJournalMeta whereHash($value) */ class TransactionJournalMeta extends Model { protected $dates = ['created_at', 'updated_at']; - protected $fillable = ['transaction_journal_id', 'name', 'data']; + protected $fillable = ['transaction_journal_id', 'name', 'data','hash']; protected $table = 'journal_meta'; + /** + * @param $value + * + * @return mixed + */ + public function getDataAttribute($value) + { + return json_decode($value); + } + + /** + * @param $value + */ + public function setDataAttribute($value) + { + $data = json_encode($value); + $this->attributes['data'] = $data; + $this->attributes['hash'] = hash('sha256', $data); + } + /** * * @return \Illuminate\Database\Eloquent\Relations\BelongsTo diff --git a/app/Models/TransactionType.php b/app/Models/TransactionType.php index c6c39a1946..0ee5638c96 100644 --- a/app/Models/TransactionType.php +++ b/app/Models/TransactionType.php @@ -63,7 +63,6 @@ class TransactionType extends Model } /** - * @codeCoverageIgnore * * @return \Illuminate\Database\Eloquent\Relations\HasMany */ diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index e370e91496..4475d28529 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -4,7 +4,8 @@ declare(strict_types = 1); namespace FireflyIII\Providers; use Illuminate\Support\ServiceProvider; - +use Log; +use Config; /** * Class AppServiceProvider * @@ -29,6 +30,10 @@ class AppServiceProvider extends ServiceProvider */ public function register() { - // + // make sure the logger doesn't log everything when it doesn't need to. + $monolog = Log::getMonolog(); + foreach ($monolog->getHandlers() as $handler) { + $handler->setLevel(Config::get('app.log-level')); + } } } diff --git a/app/Providers/EventServiceProvider.php b/app/Providers/EventServiceProvider.php index 6df4248721..929c1d5a3a 100644 --- a/app/Providers/EventServiceProvider.php +++ b/app/Providers/EventServiceProvider.php @@ -84,7 +84,7 @@ class EventServiceProvider extends ServiceProvider try { $repetition->save(); } catch (QueryException $e) { - Log::error('Trying to save new LimitRepetition failed: ' . $e->getMessage()); // @codeCoverageIgnore + Log::error('Trying to save new LimitRepetition failed: ' . $e->getMessage()); } } else { if ($set->count() == 1) { diff --git a/app/Providers/FireflyServiceProvider.php b/app/Providers/FireflyServiceProvider.php index 40018fdb48..9994b5ba36 100644 --- a/app/Providers/FireflyServiceProvider.php +++ b/app/Providers/FireflyServiceProvider.php @@ -24,7 +24,6 @@ use Validator; * Class FireflyServiceProvider * * @package FireflyIII\Providers - * @codeCoverageIgnore */ class FireflyServiceProvider extends ServiceProvider { diff --git a/app/Repositories/Account/AccountRepository.php b/app/Repositories/Account/AccountRepository.php index e37a21abbc..5de3ef5e38 100644 --- a/app/Repositories/Account/AccountRepository.php +++ b/app/Repositories/Account/AccountRepository.php @@ -14,6 +14,7 @@ use FireflyIII\Models\Transaction; use FireflyIII\Models\TransactionJournal; use FireflyIII\Models\TransactionType; use FireflyIII\User; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; @@ -62,7 +63,7 @@ class AccountRepository implements AccountRepositoryInterface * @param Account $account * @param Account $moveTo * - * @return boolean + * @return bool */ public function destroy(Account $account, Account $moveTo = null): bool { @@ -174,7 +175,7 @@ class AccountRepository implements AccountRepositoryInterface * * @return Collection */ - public function getExpensesByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end) + public function getExpensesByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end): Collection { $ids = $accounts->pluck('id')->toArray(); $journals = $this->user->transactionjournals() @@ -253,13 +254,38 @@ class AccountRepository implements AccountRepositoryInterface return $set; } + /** + * Returns a list of transactions TO the given (asset) $account, but none from the + * given list of accounts + * + * @param Account $account + * @param Collection $accounts + * @param Carbon $start + * @param Carbon $end + * + * @return Collection + */ + public function getIncomeByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end): Collection + { + $ids = $accounts->pluck('id')->toArray(); + $journals = $this->user->transactionjournals() + ->expanded() + ->before($end) + ->where('source_account.id', $account->id) + ->whereIn('destination_account.id', $ids) + ->after($start) + ->get(TransactionJournal::QUERYFIELDS); + + return $journals; + } + /** * @param Account $account * @param int $page * * @return LengthAwarePaginator */ - public function getJournals(Account $account, $page): LengthAwarePaginator + public function getJournals(Account $account, int $page): LengthAwarePaginator { $offset = ($page - 1) * 50; $query = $this->user @@ -280,6 +306,32 @@ class AccountRepository implements AccountRepositoryInterface } + /** + * @param Account $account + * @param Carbon $start + * @param Carbon $end + * + * @return Collection + */ + public function getJournalsInRange(Account $account, Carbon $start, Carbon $end): Collection + { + $query = $this->user + ->transactionJournals() + ->expanded() + ->where( + function (Builder $q) use ($account) { + $q->where('destination_account.id', $account->id); + $q->orWhere('source_account.id', $account->id); + } + ) + ->after($start) + ->before($end); + + $set = $query->get(TransactionJournal::QUERYFIELDS); + + return $set; + } + /** * Get the accounts of a user that have piggy banks connected to them. * @@ -297,7 +349,6 @@ class AccountRepository implements AccountRepositoryInterface if (count($ids) > 0) { $accounts = $this->user->accounts()->whereIn('id', $ids)->where('accounts.active', 1)->get(); } - bcscale(2); $accounts->each( function (Account $account) use ($start, $end) { @@ -338,8 +389,6 @@ class AccountRepository implements AccountRepositoryInterface $start = clone Session::get('start', new Carbon); $end = clone Session::get('end', new Carbon); - bcscale(2); - $accounts->each( function (Account $account) use ($start, $end) { $account->startBalance = Steam::balance($account, $start); @@ -387,6 +436,56 @@ class AccountRepository implements AccountRepositoryInterface } + /** + * Returns the date of the very last transaction in this account. + * + * @param Account $account + * + * @return Carbon + */ + public function newestJournalDate(Account $account): Carbon + { + /** @var TransactionJournal $journal */ + $journal = TransactionJournal:: + leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') + ->where('transactions.account_id', $account->id) + ->orderBy('transaction_journals.date', 'ASC') + ->first(['transaction_journals.*']); + if (is_null($journal)) { + $date = new Carbon; + $date->addYear(); // in the future. + } else { + $date = $journal->date; + } + + return $date; + } + + /** + * Returns the date of the very first transaction in this account. + * + * @param Account $account + * + * @return Carbon + */ + public function oldestJournalDate(Account $account): Carbon + { + /** @var TransactionJournal $journal */ + $journal = TransactionJournal:: + leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id') + ->where('transactions.account_id', $account->id) + ->orderBy('transaction_journals.date', 'DESC') + ->first(['transaction_journals.*']); + if (is_null($journal)) { + $date = new Carbon; + $date->addYear(); // in the future. + } else { + $date = $journal->date; + } + + return $date; + } + /** * @param Account $account * @@ -449,7 +548,7 @@ class AccountRepository implements AccountRepositoryInterface * * @return AccountMeta */ - public function storeMeta($account, $name, $value): AccountMeta + public function storeMeta(Account $account, string $name, $value): AccountMeta { return AccountMeta::create(['name' => $name, 'data' => $value, 'account_id' => $account->id,]); } @@ -542,9 +641,7 @@ class AccountRepository implements AccountRepositoryInterface if (!$existingAccount) { Log::error('Account create error: ' . $newAccount->getErrors()->toJson()); abort(500); - // @codeCoverageIgnoreStart } - // @codeCoverageIgnoreEnd $newAccount = $existingAccount; } @@ -676,29 +773,4 @@ class AccountRepository implements AccountRepositoryInterface } } - - /** - * Returns a list of transactions TO the given (asset) $account, but none from the - * given list of accounts - * - * @param Account $account - * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end - * - * @return Collection - */ - public function getIncomeByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end) - { - $ids = $accounts->pluck('id')->toArray(); - $journals = $this->user->transactionjournals() - ->expanded() - ->before($end) - ->where('source_account.id', $account->id) - ->whereIn('destination_account.id', $ids) - ->after($start) - ->get(TransactionJournal::QUERYFIELDS); - - return $journals; - } } diff --git a/app/Repositories/Account/AccountRepositoryInterface.php b/app/Repositories/Account/AccountRepositoryInterface.php index 0e7fba5fd0..68fb208b0b 100644 --- a/app/Repositories/Account/AccountRepositoryInterface.php +++ b/app/Repositories/Account/AccountRepositoryInterface.php @@ -31,7 +31,7 @@ interface AccountRepositoryInterface * @param Account $account * @param Account $moveTo * - * @return boolean + * @return bool */ public function destroy(Account $account, Account $moveTo): bool; @@ -82,7 +82,7 @@ interface AccountRepositoryInterface * * @return Collection */ - public function getExpensesByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end); + public function getExpensesByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end): Collection; /** * @param TransactionJournal $journal @@ -119,7 +119,7 @@ interface AccountRepositoryInterface * * @return Collection */ - public function getIncomeByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end); + public function getIncomeByDestination(Account $account, Collection $accounts, Carbon $start, Carbon $end): Collection; /** * @param Account $account @@ -127,7 +127,16 @@ interface AccountRepositoryInterface * * @return LengthAwarePaginator */ - public function getJournals(Account $account, $page): LengthAwarePaginator; + public function getJournals(Account $account, int $page): LengthAwarePaginator; + + /** + * @param Account $account + * @param Carbon $start + * @param Carbon $end + * + * @return Collection + */ + public function getJournalsInRange(Account $account, Carbon $start, Carbon $end): Collection; /** * Get the accounts of a user that have piggy banks connected to them. @@ -151,6 +160,24 @@ interface AccountRepositoryInterface */ public function leftOnAccount(Account $account, Carbon $date): string; + /** + * Returns the date of the very last transaction in this account. + * + * @param Account $account + * + * @return Carbon + */ + public function newestJournalDate(Account $account): Carbon; + + /** + * Returns the date of the very first transaction in this account. + * + * @param Account $account + * + * @return Carbon + */ + public function oldestJournalDate(Account $account): Carbon; + /** * @param Account $account * @@ -172,7 +199,7 @@ interface AccountRepositoryInterface * * @return AccountMeta */ - public function storeMeta($account, $name, $value): AccountMeta; + public function storeMeta(Account $account, string $name, $value): AccountMeta; /** * @return string diff --git a/app/Repositories/Bill/BillRepository.php b/app/Repositories/Bill/BillRepository.php index 6eb28ea1d3..7420b1f902 100644 --- a/app/Repositories/Bill/BillRepository.php +++ b/app/Repositories/Bill/BillRepository.php @@ -40,7 +40,7 @@ class BillRepository implements BillRepositoryInterface /** * @param Bill $bill * - * @return boolean + * @return bool */ public function destroy(Bill $bill): bool { @@ -77,7 +77,7 @@ class BillRepository implements BillRepositoryInterface ->get( [ 'bills.*', - DB::raw('(`bills`.`amount_min` + `bills`.`amount_max` / 2) as `expectedAmount`'), + DB::raw('((`bills`.`amount_min` + `bills`.`amount_max`) / 2) as `expectedAmount`'), ] )->sortBy('name'); diff --git a/app/Repositories/Budget/BudgetRepository.php b/app/Repositories/Budget/BudgetRepository.php index dd7cffd278..fee7ec4421 100644 --- a/app/Repositories/Budget/BudgetRepository.php +++ b/app/Repositories/Budget/BudgetRepository.php @@ -48,27 +48,28 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return string */ - public function balanceInPeriod(Budget $budget, Carbon $start, Carbon $end, Collection $accounts) + public function balanceInPeriod(Budget $budget, Carbon $start, Carbon $end, Collection $accounts): string { return $this->commonBalanceInPeriod($budget, $start, $end, $accounts); } /** - * @return void + * @return bool */ - public function cleanupBudgets() + public function cleanupBudgets(): bool { // delete limits with amount 0: BudgetLimit::where('amount', 0)->delete(); + return true; } /** * @param Budget $budget * - * @return boolean + * @return bool */ - public function destroy(Budget $budget) + public function destroy(Budget $budget): bool { $budget->delete(); @@ -114,7 +115,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Carbon */ - public function firstActivity(Budget $budget) + public function firstActivity(Budget $budget): Carbon { $first = $budget->transactionjournals()->orderBy('date', 'ASC')->first(); if ($first) { @@ -127,7 +128,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn /** * @return Collection */ - public function getActiveBudgets() + public function getActiveBudgets(): Collection { /** @var Collection $set */ $set = $this->user->budgets()->where('active', 1)->get(); @@ -147,7 +148,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Collection */ - public function getAllBudgetLimitRepetitions(Carbon $start, Carbon $end) + public function getAllBudgetLimitRepetitions(Carbon $start, Carbon $end): Collection { /** @var Collection $repetitions */ return LimitRepetition:: @@ -167,7 +168,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Collection */ - public function getAllWithoutBudget(Account $account, Collection $accounts, Carbon $start, Carbon $end) + public function getAllWithoutBudget(Account $account, Collection $accounts, Carbon $start, Carbon $end): Collection { $ids = $accounts->pluck('id')->toArray(); @@ -192,7 +193,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Collection */ - public function getBudgetedPerYear(Collection $budgets, Carbon $start, Carbon $end) + public function getBudgetedPerYear(Collection $budgets, Carbon $start, Carbon $end): Collection { $budgetIds = $budgets->pluck('id')->toArray(); @@ -218,7 +219,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn /** * @return Collection */ - public function getBudgets() + public function getBudgets(): Collection { /** @var Collection $set */ $set = $this->user->budgets()->get(); @@ -242,7 +243,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return array */ - public function getBudgetsAndExpensesPerMonth(Collection $accounts, Carbon $start, Carbon $end) + public function getBudgetsAndExpensesPerMonth(Collection $accounts, Carbon $start, Carbon $end): array { $ids = $accounts->pluck('id')->toArray(); @@ -303,7 +304,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return array */ - public function getBudgetsAndExpensesPerYear(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end) + public function getBudgetsAndExpensesPerYear(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end): array { $ids = $accounts->pluck('id')->toArray(); $budgetIds = $budgets->pluck('id')->toArray(); @@ -362,7 +363,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Collection */ - public function getBudgetsAndLimitsInRange(Carbon $start, Carbon $end) + public function getBudgetsAndLimitsInRange(Carbon $start, Carbon $end): Collection { /** @var Collection $set */ $set = $this->user @@ -402,14 +403,17 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * @param Carbon $start * @param Carbon $end * - * @return LimitRepetition|null + * @return LimitRepetition */ - public function getCurrentRepetition(Budget $budget, Carbon $start, Carbon $end) + public function getCurrentRepetition(Budget $budget, Carbon $start, Carbon $end): LimitRepetition { $data = $budget->limitrepetitions() ->where('limit_repetitions.startdate', $start->format('Y-m-d 00:00:00')) ->where('limit_repetitions.enddate', $end->format('Y-m-d 00:00:00')) ->first(['limit_repetitions.*']); + if(is_null($data)) { + return new LimitRepetition; + } return $data; } @@ -448,7 +452,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Collection */ - public function getExpensesPerDay(Budget $budget, Carbon $start, Carbon $end) + public function getExpensesPerDay(Budget $budget, Carbon $start, Carbon $end): Collection { $set = $this->user->budgets() ->leftJoin('budget_transaction_journal', 'budget_transaction_journal.budget_id', '=', 'budgets.id') @@ -471,7 +475,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Carbon */ - public function getFirstBudgetLimitDate(Budget $budget) + public function getFirstBudgetLimitDate(Budget $budget): Carbon { $limit = $budget->budgetlimits()->orderBy('startdate', 'ASC')->first(); if ($limit) { @@ -484,7 +488,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn /** * @return Collection */ - public function getInactiveBudgets() + public function getInactiveBudgets(): Collection { /** @var Collection $set */ $set = $this->user->budgets()->where('active', 0)->get(); @@ -507,7 +511,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return LengthAwarePaginator */ - public function getJournals(Budget $budget, LimitRepetition $repetition = null, int $take = 50) + public function getJournals(Budget $budget, LimitRepetition $repetition = null, int $take = 50): LengthAwarePaginator { $offset = intval(Input::get('page')) > 0 ? intval(Input::get('page')) * $take : 0; $setQuery = $budget->transactionjournals()->expanded() @@ -539,7 +543,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Collection */ - public function getWithoutBudget(Carbon $start, Carbon $end) + public function getWithoutBudget(Carbon $start, Carbon $end): Collection { return $this->user ->transactionjournals() @@ -559,7 +563,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Collection */ - public function getWithoutBudgetForAccounts(Collection $accounts, Carbon $start, Carbon $end) + public function getWithoutBudgetForAccounts(Collection $accounts, Carbon $start, Carbon $end): Collection { $ids = $accounts->pluck('id')->toArray(); @@ -633,7 +637,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return array */ - public function spentAllPerDayForAccounts(Collection $accounts, Carbon $start, Carbon $end) + public function spentAllPerDayForAccounts(Collection $accounts, Carbon $start, Carbon $end): array { $ids = $accounts->pluck('id')->toArray(); /** @var Collection $query */ @@ -674,7 +678,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Collection */ - public function spentPerBudgetPerAccount(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end) + public function spentPerBudgetPerAccount(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end): Collection { $accountIds = $accounts->pluck('id')->toArray(); $budgetIds = $budgets->pluck('id')->toArray(); @@ -752,7 +756,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Budget */ - public function store(array $data) + public function store(array $data): Budget { $newBudget = new Budget( [ @@ -771,7 +775,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return Budget */ - public function update(Budget $budget, array $data) + public function update(Budget $budget, array $data): Budget { // update the account: $budget->name = $data['name']; @@ -788,7 +792,7 @@ class BudgetRepository extends ComponentRepository implements BudgetRepositoryIn * * @return BudgetLimit */ - public function updateLimitAmount(Budget $budget, Carbon $date, int $amount) + public function updateLimitAmount(Budget $budget, Carbon $date, int $amount): BudgetLimit { // there should be a budget limit for this startdate: /** @var BudgetLimit $limit */ diff --git a/app/Repositories/Budget/BudgetRepositoryInterface.php b/app/Repositories/Budget/BudgetRepositoryInterface.php index 3c33aa0d0f..4d6e55cd52 100644 --- a/app/Repositories/Budget/BudgetRepositoryInterface.php +++ b/app/Repositories/Budget/BudgetRepositoryInterface.php @@ -6,6 +6,7 @@ namespace FireflyIII\Repositories\Budget; use Carbon\Carbon; use FireflyIII\Models\Account; use FireflyIII\Models\Budget; +use FireflyIII\Models\BudgetLimit; use FireflyIII\Models\LimitRepetition; use Illuminate\Pagination\LengthAwarePaginator; use Illuminate\Support\Collection; @@ -32,16 +33,16 @@ interface BudgetRepositoryInterface public function balanceInPeriod(Budget $budget, Carbon $start, Carbon $end, Collection $accounts); /** - * @return void + * @return bool */ - public function cleanupBudgets(); + public function cleanupBudgets(): bool; /** * @param Budget $budget * - * @return boolean + * @return bool */ - public function destroy(Budget $budget); + public function destroy(Budget $budget): bool; /** * @param Budget $budget @@ -67,12 +68,12 @@ interface BudgetRepositoryInterface * * @return Carbon */ - public function firstActivity(Budget $budget); + public function firstActivity(Budget $budget): Carbon; /** * @return Collection */ - public function getActiveBudgets(); + public function getActiveBudgets(): Collection; /** * @param Carbon $start @@ -80,17 +81,17 @@ interface BudgetRepositoryInterface * * @return Collection */ - public function getAllBudgetLimitRepetitions(Carbon $start, Carbon $end); + public function getAllBudgetLimitRepetitions(Carbon $start, Carbon $end): Collection; /** - * @param Account $account + * @param Account $account * @param Collection $accounts - * @param Carbon $start - * @param Carbon $end + * @param Carbon $start + * @param Carbon $end * * @return Collection */ - public function getAllWithoutBudget(Account $account, Collection $accounts, Carbon $start, Carbon $end); + public function getAllWithoutBudget(Account $account, Collection $accounts, Carbon $start, Carbon $end): Collection; /** * Get the budgeted amounts for each budgets in each year. @@ -101,12 +102,12 @@ interface BudgetRepositoryInterface * * @return Collection */ - public function getBudgetedPerYear(Collection $budgets, Carbon $start, Carbon $end); + public function getBudgetedPerYear(Collection $budgets, Carbon $start, Carbon $end): Collection; /** * @return Collection */ - public function getBudgets(); + public function getBudgets(): Collection; /** * Returns an array with every budget in it and the expenses for each budget @@ -118,7 +119,7 @@ interface BudgetRepositoryInterface * * @return array */ - public function getBudgetsAndExpensesPerMonth(Collection $accounts, Carbon $start, Carbon $end); + public function getBudgetsAndExpensesPerMonth(Collection $accounts, Carbon $start, Carbon $end): array; /** * Returns an array with every budget in it and the expenses for each budget @@ -131,7 +132,7 @@ interface BudgetRepositoryInterface * * @return array */ - public function getBudgetsAndExpensesPerYear(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end); + public function getBudgetsAndExpensesPerYear(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end): array; /** * Returns a list of budgets, budget limits and limit repetitions @@ -142,16 +143,16 @@ interface BudgetRepositoryInterface * * @return Collection */ - public function getBudgetsAndLimitsInRange(Carbon $start, Carbon $end); + public function getBudgetsAndLimitsInRange(Carbon $start, Carbon $end): Collection; /** * @param Budget $budget * @param Carbon $start * @param Carbon $end * - * @return LimitRepetition|null + * @return LimitRepetition */ - public function getCurrentRepetition(Budget $budget, Carbon $start, Carbon $end); + public function getCurrentRepetition(Budget $budget, Carbon $start, Carbon $end): LimitRepetition; /** * Returns all expenses for the given budget and the given accounts, in the given period. @@ -175,19 +176,19 @@ interface BudgetRepositoryInterface * * @return Collection */ - public function getExpensesPerDay(Budget $budget, Carbon $start, Carbon $end); + public function getExpensesPerDay(Budget $budget, Carbon $start, Carbon $end):Collection; /** * @param Budget $budget * * @return Carbon */ - public function getFirstBudgetLimitDate(Budget $budget); + public function getFirstBudgetLimitDate(Budget $budget):Carbon; /** * @return Collection */ - public function getInactiveBudgets(); + public function getInactiveBudgets(): Collection; /** * Returns all the transaction journals for a limit, possibly limited by a limit repetition. @@ -198,7 +199,7 @@ interface BudgetRepositoryInterface * * @return LengthAwarePaginator */ - public function getJournals(Budget $budget, LimitRepetition $repetition = null, int $take = 50); + public function getJournals(Budget $budget, LimitRepetition $repetition = null, int $take = 50): LengthAwarePaginator; /** * @param Carbon $start @@ -206,7 +207,7 @@ interface BudgetRepositoryInterface * * @return Collection */ - public function getWithoutBudget(Carbon $start, Carbon $end); + public function getWithoutBudget(Carbon $start, Carbon $end): Collection; /** * @param Collection $accounts @@ -215,7 +216,7 @@ interface BudgetRepositoryInterface * * @return Collection */ - public function getWithoutBudgetForAccounts(Collection $accounts, Carbon $start, Carbon $end); + public function getWithoutBudgetForAccounts(Collection $accounts, Carbon $start, Carbon $end): Collection; /** * @param Collection $accounts @@ -244,7 +245,7 @@ interface BudgetRepositoryInterface * * @return array */ - public function spentAllPerDayForAccounts(Collection $accounts, Carbon $start, Carbon $end); + public function spentAllPerDayForAccounts(Collection $accounts, Carbon $start, Carbon $end): array; /** * Returns a list of expenses (in the field "spent", grouped per budget per account. @@ -256,7 +257,7 @@ interface BudgetRepositoryInterface * * @return Collection */ - public function spentPerBudgetPerAccount(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end); + public function spentPerBudgetPerAccount(Collection $budgets, Collection $accounts, Carbon $start, Carbon $end): Collection; /** * Returns an array with the following key:value pairs: @@ -279,7 +280,7 @@ interface BudgetRepositoryInterface * * @return Budget */ - public function store(array $data); + public function store(array $data): Budget; /** * @param Budget $budget @@ -287,15 +288,15 @@ interface BudgetRepositoryInterface * * @return Budget */ - public function update(Budget $budget, array $data); + public function update(Budget $budget, array $data) : Budget; /** * @param Budget $budget * @param Carbon $date * @param int $amount * - * @return mixed + * @return BudgetLimit */ - public function updateLimitAmount(Budget $budget, Carbon $date, int $amount); + public function updateLimitAmount(Budget $budget, Carbon $date, int $amount) : BudgetLimit; } diff --git a/app/Repositories/Category/CategoryRepository.php b/app/Repositories/Category/CategoryRepository.php index fa9ecc98bf..14f5495fc4 100644 --- a/app/Repositories/Category/CategoryRepository.php +++ b/app/Repositories/Category/CategoryRepository.php @@ -7,7 +7,6 @@ use Carbon\Carbon; use DB; use FireflyIII\Models\Category; use FireflyIII\Models\TransactionType; -use FireflyIII\Sql\Query; use FireflyIII\User; use Illuminate\Database\Query\JoinClause; use Illuminate\Support\Collection; @@ -19,6 +18,10 @@ use Illuminate\Support\Collection; */ class CategoryRepository implements CategoryRepositoryInterface { + const SPENT = 1; + const EARNED = 2; + + /** @var User */ private $user; @@ -43,7 +46,7 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return Collection */ - public function earnedForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end) + public function earnedForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end): Collection { $collection = $this->user->categories() @@ -87,7 +90,7 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return Collection */ - public function listCategories() + public function getCategories(): Collection { /** @var Collection $set */ $set = $this->user->categories()->orderBy('name', 'ASC')->get(); @@ -114,7 +117,7 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return Collection */ - public function listMultiYear(Collection $categories, Collection $accounts, Carbon $start, Carbon $end) + public function listMultiYear(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): Collection { $set = $this->user->categories() @@ -152,7 +155,7 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return Collection */ - public function listNoCategory(Carbon $start, Carbon $end) + public function listNoCategory(Carbon $start, Carbon $end): Collection { return $this->user ->transactionjournals() @@ -177,7 +180,7 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return Collection */ - public function spentForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end) + public function spentForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end): Collection { $accountIds = $accounts->pluck('id')->toArray(); $query = $this->user->categories() @@ -228,9 +231,9 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return string */ - public function sumEarnedNoCategory(Collection $accounts, Carbon $start, Carbon $end) + public function sumEarnedNoCategory(Collection $accounts, Carbon $start, Carbon $end): string { - return $this->sumNoCategory($accounts, $start, $end, Query::EARNED); + return $this->sumNoCategory($accounts, $start, $end, self::EARNED); } /** @@ -243,9 +246,14 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return string */ - public function sumSpentNoCategory(Collection $accounts, Carbon $start, Carbon $end) + public function sumSpentNoCategory(Collection $accounts, Carbon $start, Carbon $end): string { - return $this->sumNoCategory($accounts, $start, $end, Query::SPENT); + $sum = $this->sumNoCategory($accounts, $start, $end, self::SPENT); + if (is_null($sum)) { + return '0'; + } + + return $sum; } /** @@ -259,10 +267,10 @@ class CategoryRepository implements CategoryRepositoryInterface * * @return string */ - protected function sumNoCategory(Collection $accounts, Carbon $start, Carbon $end, $group = Query::EARNED) + protected function sumNoCategory(Collection $accounts, Carbon $start, Carbon $end, $group = self::EARNED) { $accountIds = $accounts->pluck('id')->toArray(); - if ($group == Query::EARNED) { + if ($group == self::EARNED) { $types = [TransactionType::DEPOSIT]; } else { $types = [TransactionType::WITHDRAWAL]; diff --git a/app/Repositories/Category/CategoryRepositoryInterface.php b/app/Repositories/Category/CategoryRepositoryInterface.php index ec89ccec5e..5c5966c8b7 100644 --- a/app/Repositories/Category/CategoryRepositoryInterface.php +++ b/app/Repositories/Category/CategoryRepositoryInterface.php @@ -26,14 +26,14 @@ interface CategoryRepositoryInterface * * @return Collection */ - public function earnedForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end); + public function earnedForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end): Collection; /** * Returns a list of all the categories belonging to a user. * * @return Collection */ - public function listCategories(); + public function getCategories(): Collection; /** * This method returns a very special collection for each category: @@ -49,7 +49,7 @@ interface CategoryRepositoryInterface * * @return Collection */ - public function listMultiYear(Collection $categories, Collection $accounts, Carbon $start, Carbon $end); + public function listMultiYear(Collection $categories, Collection $accounts, Carbon $start, Carbon $end): Collection; /** * Returns a list of transaction journals in the range (all types, all accounts) that have no category @@ -60,7 +60,7 @@ interface CategoryRepositoryInterface * * @return Collection */ - public function listNoCategory(Carbon $start, Carbon $end); + public function listNoCategory(Carbon $start, Carbon $end): Collection; /** * Returns a collection of Categories appended with the amount of money that has been spent @@ -73,7 +73,7 @@ interface CategoryRepositoryInterface * * @return Collection */ - public function spentForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end); + public function spentForAccountsPerMonth(Collection $accounts, Carbon $start, Carbon $end): Collection; /** * Returns the total amount of money related to transactions without any category connected to @@ -85,7 +85,7 @@ interface CategoryRepositoryInterface * * @return string */ - public function sumEarnedNoCategory(Collection $accounts, Carbon $start, Carbon $end); + public function sumEarnedNoCategory(Collection $accounts, Carbon $start, Carbon $end): string; /** * Returns the total amount of money related to transactions without any category connected to @@ -97,6 +97,6 @@ interface CategoryRepositoryInterface * * @return string */ - public function sumSpentNoCategory(Collection $accounts, Carbon $start, Carbon $end); + public function sumSpentNoCategory(Collection $accounts, Carbon $start, Carbon $end): string; } diff --git a/app/Repositories/Category/SingleCategoryRepository.php b/app/Repositories/Category/SingleCategoryRepository.php index 1562ed4846..ea7dd6fc29 100644 --- a/app/Repositories/Category/SingleCategoryRepository.php +++ b/app/Repositories/Category/SingleCategoryRepository.php @@ -37,7 +37,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return int */ - public function countJournals(Category $category) + public function countJournals(Category $category): int { return $category->transactionjournals()->count(); @@ -51,7 +51,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return int */ - public function countJournalsInRange(Category $category, Carbon $start, Carbon $end) + public function countJournalsInRange(Category $category, Carbon $start, Carbon $end): int { return $category->transactionjournals()->before($end)->after($start)->count(); } @@ -59,9 +59,9 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate /** * @param Category $category * - * @return boolean + * @return bool */ - public function destroy(Category $category) + public function destroy(Category $category): bool { $category->delete(); @@ -82,7 +82,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return array */ - public function earnedPerDay(Category $category, Carbon $start, Carbon $end) + public function earnedPerDay(Category $category, Carbon $start, Carbon $end): array { /** @var Collection $query */ $query = $category->transactionjournals() @@ -123,7 +123,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return Carbon */ - public function getFirstActivityDate(Category $category) + public function getFirstActivityDate(Category $category): Carbon { /** @var TransactionJournal $first */ $first = $category->transactionjournals()->orderBy('date', 'ASC')->first(); @@ -141,7 +141,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return Collection */ - public function getJournals(Category $category, $page) + public function getJournals(Category $category, $page): Collection { $offset = $page > 0 ? $page * 50 : 0; @@ -162,7 +162,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return Collection */ - public function getJournalsForAccountsInRange(Category $category, Collection $accounts, Carbon $start, Carbon $end) + public function getJournalsForAccountsInRange(Category $category, Collection $accounts, Carbon $start, Carbon $end): Collection { $ids = $accounts->pluck('id')->toArray(); @@ -181,9 +181,9 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * @param Carbon $start * @param Carbon $end * - * @return mixed + * @return Collection */ - public function getJournalsInRange(Category $category, $page, Carbon $start, Carbon $end) + public function getJournalsInRange(Category $category, $page, Carbon $start, Carbon $end): Collection { $offset = $page > 0 ? $page * 50 : 0; @@ -201,7 +201,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return Carbon|null */ - public function getLatestActivity(Category $category) + public function getLatestActivity(Category $category): Carbon { $latest = $category->transactionjournals() ->orderBy('transaction_journals.date', 'DESC') @@ -212,7 +212,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate return $latest->date; } - return null; + return new Carbon('1900-01-01'); } /** @@ -229,7 +229,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return array */ - public function spentPerDay(Category $category, Carbon $start, Carbon $end) + public function spentPerDay(Category $category, Carbon $start, Carbon $end): array { /** @var Collection $query */ $query = $category->transactionjournals() @@ -253,7 +253,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return Category */ - public function store(array $data) + public function store(array $data): Category { $newCategory = Category::firstOrCreateEncrypted( [ @@ -272,7 +272,7 @@ class SingleCategoryRepository extends ComponentRepository implements SingleCate * * @return Category */ - public function update(Category $category, array $data) + public function update(Category $category, array $data): Category { // update the account: $category->name = $data['name']; diff --git a/app/Repositories/Category/SingleCategoryRepositoryInterface.php b/app/Repositories/Category/SingleCategoryRepositoryInterface.php index 88104b957b..29649457be 100644 --- a/app/Repositories/Category/SingleCategoryRepositoryInterface.php +++ b/app/Repositories/Category/SingleCategoryRepositoryInterface.php @@ -20,7 +20,7 @@ interface SingleCategoryRepositoryInterface * * @return int */ - public function countJournals(Category $category); + public function countJournals(Category $category): int; /** * @param Category $category @@ -30,14 +30,14 @@ interface SingleCategoryRepositoryInterface * * @return int */ - public function countJournalsInRange(Category $category, Carbon $start, Carbon $end); + public function countJournalsInRange(Category $category, Carbon $start, Carbon $end): int; /** * @param Category $category * - * @return boolean + * @return bool */ - public function destroy(Category $category); + public function destroy(Category $category): bool; /** * Returns an array with the following key:value pairs: @@ -53,7 +53,7 @@ interface SingleCategoryRepositoryInterface * * @return array */ - public function earnedPerDay(Category $category, Carbon $start, Carbon $end); + public function earnedPerDay(Category $category, Carbon $start, Carbon $end): array; /** * Find a category @@ -69,7 +69,7 @@ interface SingleCategoryRepositoryInterface * * @return Carbon */ - public function getFirstActivityDate(Category $category); + public function getFirstActivityDate(Category $category): Carbon; /** * @param Category $category @@ -77,7 +77,7 @@ interface SingleCategoryRepositoryInterface * * @return Collection */ - public function getJournals(Category $category, $page); + public function getJournals(Category $category, $page): Collection; /** * @param Category $category @@ -88,7 +88,7 @@ interface SingleCategoryRepositoryInterface * * @return Collection */ - public function getJournalsForAccountsInRange(Category $category, Collection $accounts, Carbon $start, Carbon $end); + public function getJournalsForAccountsInRange(Category $category, Collection $accounts, Carbon $start, Carbon $end): Collection; /** * @param Category $category @@ -99,14 +99,14 @@ interface SingleCategoryRepositoryInterface * * @return Collection */ - public function getJournalsInRange(Category $category, $page, Carbon $start, Carbon $end); + public function getJournalsInRange(Category $category, $page, Carbon $start, Carbon $end): Collection; /** * @param Category $category * - * @return Carbon|null + * @return Carbon */ - public function getLatestActivity(Category $category); + public function getLatestActivity(Category $category): Carbon; /** * Returns an array with the following key:value pairs: @@ -122,7 +122,7 @@ interface SingleCategoryRepositoryInterface * * @return array */ - public function spentPerDay(Category $category, Carbon $start, Carbon $end); + public function spentPerDay(Category $category, Carbon $start, Carbon $end): array; /** @@ -130,7 +130,7 @@ interface SingleCategoryRepositoryInterface * * @return Category */ - public function store(array $data); + public function store(array $data): Category; /** * @param Category $category @@ -138,5 +138,5 @@ interface SingleCategoryRepositoryInterface * * @return Category */ - public function update(Category $category, array $data); + public function update(Category $category, array $data): Category; } diff --git a/app/Repositories/Currency/CurrencyRepository.php b/app/Repositories/Currency/CurrencyRepository.php index 02328f291a..f9d60c9740 100644 --- a/app/Repositories/Currency/CurrencyRepository.php +++ b/app/Repositories/Currency/CurrencyRepository.php @@ -21,7 +21,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface * * @return int */ - public function countJournals(TransactionCurrency $currency) + public function countJournals(TransactionCurrency $currency): int { return $currency->transactionJournals()->count(); } @@ -98,7 +98,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface /** * @return Collection */ - public function get() + public function get(): Collection { return TransactionCurrency::get(); } @@ -108,7 +108,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface * * @return TransactionCurrency */ - public function getCurrencyByPreference(Preference $preference) + public function getCurrencyByPreference(Preference $preference): TransactionCurrency { $preferred = TransactionCurrency::whereCode($preference->data)->first(); if (is_null($preferred)) { @@ -123,7 +123,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface * * @return TransactionCurrency */ - public function store(array $data) + public function store(array $data): TransactionCurrency { $currency = TransactionCurrency::create( [ @@ -142,7 +142,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface * * @return TransactionCurrency */ - public function update(TransactionCurrency $currency, array $data) + public function update(TransactionCurrency $currency, array $data): TransactionCurrency { $currency->code = $data['code']; $currency->symbol = $data['symbol']; diff --git a/app/Repositories/Currency/CurrencyRepositoryInterface.php b/app/Repositories/Currency/CurrencyRepositoryInterface.php index 3b82882dd3..2aba1b93bc 100644 --- a/app/Repositories/Currency/CurrencyRepositoryInterface.php +++ b/app/Repositories/Currency/CurrencyRepositoryInterface.php @@ -20,7 +20,7 @@ interface CurrencyRepositoryInterface * * @return int */ - public function countJournals(TransactionCurrency $currency); + public function countJournals(TransactionCurrency $currency): int; /** * Find by ID @@ -61,21 +61,21 @@ interface CurrencyRepositoryInterface /** * @return Collection */ - public function get(); + public function get(): Collection; /** * @param Preference $preference * * @return TransactionCurrency */ - public function getCurrencyByPreference(Preference $preference); + public function getCurrencyByPreference(Preference $preference): TransactionCurrency; /** * @param array $data * * @return TransactionCurrency */ - public function store(array $data); + public function store(array $data): TransactionCurrency; /** * @param TransactionCurrency $currency @@ -83,6 +83,6 @@ interface CurrencyRepositoryInterface * * @return TransactionCurrency */ - public function update(TransactionCurrency $currency, array $data); + public function update(TransactionCurrency $currency, array $data): TransactionCurrency; } diff --git a/app/Repositories/ExportJob/ExportJobRepository.php b/app/Repositories/ExportJob/ExportJobRepository.php index 6d477feb5d..c913972cea 100644 --- a/app/Repositories/ExportJob/ExportJobRepository.php +++ b/app/Repositories/ExportJob/ExportJobRepository.php @@ -38,7 +38,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface /** * @return bool */ - public function cleanup() + public function cleanup(): bool { $dayAgo = Carbon::create()->subDay(); $set = ExportJob::where('created_at', '<', $dayAgo->format('Y-m-d H:i:s')) @@ -66,7 +66,7 @@ class ExportJobRepository implements ExportJobRepositoryInterface /** * @return ExportJob */ - public function create() + public function create(): ExportJob { $exportJob = new ExportJob; $exportJob->user()->associate($this->user); @@ -81,11 +81,14 @@ class ExportJobRepository implements ExportJobRepositoryInterface } /** + * + * FIXME this may return null + * * @param string $key * * @return ExportJob|null */ - public function findByKey(string $key) + public function findByKey(string $key): ExportJob { return $this->user->exportJobs()->where('key', $key)->first(); } diff --git a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php index 9c1dd4c434..43572ed1c2 100644 --- a/app/Repositories/ExportJob/ExportJobRepositoryInterface.php +++ b/app/Repositories/ExportJob/ExportJobRepositoryInterface.php @@ -22,18 +22,18 @@ interface ExportJobRepositoryInterface /** * @return bool */ - public function cleanup(); + public function cleanup(): bool; /** * @return ExportJob */ - public function create(); + public function create(): ExportJob; /** * @param string $key * * @return ExportJob|null */ - public function findByKey(string $key); + public function findByKey(string $key): ExportJob; } diff --git a/app/Repositories/Journal/JournalCollector.php b/app/Repositories/Journal/JournalCollector.php index c971f9091a..804b48c087 100644 --- a/app/Repositories/Journal/JournalCollector.php +++ b/app/Repositories/Journal/JournalCollector.php @@ -49,7 +49,7 @@ class JournalCollector /** * @return Collection */ - public function collect() + public function collect(): Collection { // get all the journals: $ids = $this->accounts->pluck('id')->toArray(); diff --git a/app/Repositories/Journal/JournalRepository.php b/app/Repositories/Journal/JournalRepository.php index 956a4645f3..aad47de6d3 100644 --- a/app/Repositories/Journal/JournalRepository.php +++ b/app/Repositories/Journal/JournalRepository.php @@ -44,7 +44,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return bool */ - public function delete(TransactionJournal $journal) + public function delete(TransactionJournal $journal): bool { $journal->delete(); @@ -56,9 +56,12 @@ class JournalRepository implements JournalRepositoryInterface * * @return TransactionJournal */ - public function first() + public function first(): TransactionJournal { $entry = $this->user->transactionjournals()->orderBy('date', 'ASC')->first(['transaction_journals.*']); + if (is_null($entry)) { + return new TransactionJournal; + } return $entry; } @@ -67,9 +70,9 @@ class JournalRepository implements JournalRepositoryInterface * @param TransactionJournal $journal * @param Transaction $transaction * - * @return integer + * @return string */ - public function getAmountBefore(TransactionJournal $journal, Transaction $transaction) + public function getAmountBefore(TransactionJournal $journal, Transaction $transaction): string { $set = $transaction->account->transactions()->leftJoin( 'transaction_journals', 'transaction_journals.id', '=', 'transactions.transaction_journal_id' @@ -94,7 +97,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return Collection */ - public function getCollectionOfTypes(array $types, int $offset, int $count) + public function getCollectionOfTypes(array $types, int $offset, int $count): Collection { $set = $this->user->transactionJournals() ->expanded() @@ -113,7 +116,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return Collection */ - public function getJournalsOfType(TransactionType $dbType) + public function getJournalsOfType(TransactionType $dbType): Collection { return $this->user->transactionjournals()->where('transaction_type_id', $dbType->id)->orderBy('id', 'DESC')->take(50)->get(); } @@ -127,7 +130,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return LengthAwarePaginator */ - public function getJournalsOfTypes(array $types, int $offset, int $page, int $pagesize = 50) + public function getJournalsOfTypes(array $types, int $offset, int $page, int $pagesize = 50): LengthAwarePaginator { $set = $this->user ->transactionJournals() @@ -151,7 +154,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return TransactionType */ - public function getTransactionType(string $type) + public function getTransactionType(string $type): TransactionType { return TransactionType::whereType($type)->first(); } @@ -162,7 +165,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return TransactionJournal */ - public function getWithDate(int $journalId, Carbon $date) + public function getWithDate(int $journalId, Carbon $date): TransactionJournal { return $this->user->transactionjournals()->where('id', $journalId)->where('date', $date->format('Y-m-d 00:00:00'))->first(); } @@ -175,9 +178,9 @@ class JournalRepository implements JournalRepositoryInterface * @param TransactionJournal $journal * @param array $array * - * @return void + * @return bool */ - public function saveTags(TransactionJournal $journal, array $array) + public function saveTags(TransactionJournal $journal, array $array): bool { /** @var \FireflyIII\Repositories\Tag\TagRepositoryInterface $tagRepository */ $tagRepository = app('FireflyIII\Repositories\Tag\TagRepositoryInterface'); @@ -190,6 +193,8 @@ class JournalRepository implements JournalRepositoryInterface } } } + + return true; } /** @@ -197,7 +202,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return TransactionJournal */ - public function store(array $data) + public function store(array $data): TransactionJournal { // find transaction type. $transactionType = TransactionType::where('type', ucfirst($data['what']))->first(); @@ -269,7 +274,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return TransactionJournal */ - public function update(TransactionJournal $journal, array $data) + public function update(TransactionJournal $journal, array $data): TransactionJournal { // update actual journal. $journal->transaction_currency_id = $data['amount_currency_id_amount']; @@ -329,9 +334,9 @@ class JournalRepository implements JournalRepositoryInterface * @param TransactionJournal $journal * @param array $array * - * @return void + * @return bool */ - public function updateTags(TransactionJournal $journal, array $array) + public function updateTags(TransactionJournal $journal, array $array): bool { // create tag repository /** @var \FireflyIII\Repositories\Tag\TagRepositoryInterface $tagRepository */ @@ -363,6 +368,8 @@ class JournalRepository implements JournalRepositoryInterface foreach ($tags as $tag) { $tagRepository->connect($journal, $tag); } + + return true; } /** @@ -373,7 +380,7 @@ class JournalRepository implements JournalRepositoryInterface * @throws FireflyException * @SuppressWarnings(PHPMD.CyclomaticComplexity) */ - protected function storeAccounts(TransactionType $type, array $data) + protected function storeAccounts(TransactionType $type, array $data): array { $fromAccount = null; $toAccount = null; @@ -395,18 +402,14 @@ class JournalRepository implements JournalRepositoryInterface if (is_null($toAccount)) { Log::error('"to"-account is null, so we cannot continue!'); throw new FireflyException('"to"-account is null, so we cannot continue!'); - // @codeCoverageIgnoreStart } - // @codeCoverageIgnoreEnd if (is_null($fromAccount)) { Log::error('"from"-account is null, so we cannot continue!'); throw new FireflyException('"from"-account is null, so we cannot continue!'); - // @codeCoverageIgnoreStart } - // @codeCoverageIgnoreEnd return [$fromAccount, $toAccount]; } @@ -416,7 +419,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return array */ - protected function storeDepositAccounts(array $data) + protected function storeDepositAccounts(array $data): array { $toAccount = Account::find($data['account_id']); @@ -440,7 +443,7 @@ class JournalRepository implements JournalRepositoryInterface * * @return array */ - protected function storeWithdrawalAccounts(array $data) + protected function storeWithdrawalAccounts(array $data): array { $fromAccount = Account::find($data['account_id']); diff --git a/app/Repositories/Journal/JournalRepositoryInterface.php b/app/Repositories/Journal/JournalRepositoryInterface.php index d917190cbc..e7bfa81bce 100644 --- a/app/Repositories/Journal/JournalRepositoryInterface.php +++ b/app/Repositories/Journal/JournalRepositoryInterface.php @@ -22,38 +22,22 @@ interface JournalRepositoryInterface * * @return bool */ - public function delete(TransactionJournal $journal); + public function delete(TransactionJournal $journal): bool; /** * Get users first transaction journal * * @return TransactionJournal */ - public function first(); + public function first(): TransactionJournal; /** * @param TransactionJournal $journal * @param Transaction $transaction * - * @return float + * @return string */ - public function getAmountBefore(TransactionJournal $journal, Transaction $transaction); - - /** - * @param TransactionType $dbType - * - * @return Collection - */ - public function getJournalsOfType(TransactionType $dbType); - - /** - * @param array $types - * @param int $offset - * @param int $page - * - * @return LengthAwarePaginator - */ - public function getJournalsOfTypes(array $types, int $offset, int $page); + public function getAmountBefore(TransactionJournal $journal, Transaction $transaction): string; /** * @param array $types @@ -62,14 +46,30 @@ interface JournalRepositoryInterface * * @return Collection */ - public function getCollectionOfTypes(array $types, int $offset, int $count); + public function getCollectionOfTypes(array $types, int $offset, int $count):Collection; + + /** + * @param TransactionType $dbType + * + * @return Collection + */ + public function getJournalsOfType(TransactionType $dbType): Collection; + + /** + * @param array $types + * @param int $offset + * @param int $page + * + * @return LengthAwarePaginator + */ + public function getJournalsOfTypes(array $types, int $offset, int $page): LengthAwarePaginator; /** * @param string $type * * @return TransactionType */ - public function getTransactionType(string $type); + public function getTransactionType(string $type): TransactionType; /** * @param int $journalId @@ -77,7 +77,7 @@ interface JournalRepositoryInterface * * @return TransactionJournal */ - public function getWithDate(int $journalId, Carbon $date); + public function getWithDate(int $journalId, Carbon $date): TransactionJournal; /** * @param TransactionJournal $journal @@ -90,30 +90,30 @@ interface JournalRepositoryInterface * @param TransactionJournal $journal * @param array $array * - * @return void + * @return bool */ - public function saveTags(TransactionJournal $journal, array $array); + public function saveTags(TransactionJournal $journal, array $array): bool; /** * @param array $data * * @return TransactionJournal */ - public function store(array $data); + public function store(array $data): TransactionJournal; /** * @param TransactionJournal $journal * @param array $data * - * @return mixed + * @return TransactionJournal */ - public function update(TransactionJournal $journal, array $data); + public function update(TransactionJournal $journal, array $data): TransactionJournal; /** * @param TransactionJournal $journal * @param array $array * - * @return mixed + * @return bool */ - public function updateTags(TransactionJournal $journal, array $array); + public function updateTags(TransactionJournal $journal, array $array): bool; } diff --git a/app/Repositories/PiggyBank/PiggyBankRepository.php b/app/Repositories/PiggyBank/PiggyBankRepository.php index 48b285486a..c288e8b3a8 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepository.php +++ b/app/Repositories/PiggyBank/PiggyBankRepository.php @@ -35,11 +35,23 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface * @param PiggyBank $piggyBank * @param string $amount * + * @return PiggyBankEvent + */ + public function createEvent(PiggyBank $piggyBank, string $amount): PiggyBankEvent + { + $event = PiggyBankEvent::create(['date' => Carbon::now(), 'amount' => $amount, 'piggy_bank_id' => $piggyBank->id]); + + return $event; + } + + /** + * @param PiggyBank $piggyBank + * * @return bool */ - public function createEvent(PiggyBank $piggyBank, string $amount) + public function destroy(PiggyBank $piggyBank): bool { - PiggyBankEvent::create(['date' => Carbon::now(), 'amount' => $amount, 'piggy_bank_id' => $piggyBank->id]); + $piggyBank->delete(); return true; } @@ -47,11 +59,13 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface /** * @param PiggyBank $piggyBank * - * @return boolean|null + * @return Collection */ - public function destroy(PiggyBank $piggyBank) + public function getEventSummarySet(PiggyBank $piggyBank): Collection { - return $piggyBank->delete(); + $var = DB::table('piggy_bank_events')->where('piggy_bank_id', $piggyBank->id)->groupBy('date')->get(['date', DB::raw('SUM(`amount`) AS `sum`')]); + + return new Collection($var); } /** @@ -59,17 +73,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface * * @return Collection */ - public function getEventSummarySet(PiggyBank $piggyBank) - { - return DB::table('piggy_bank_events')->where('piggy_bank_id', $piggyBank->id)->groupBy('date')->get(['date', DB::raw('SUM(`amount`) AS `sum`')]); - } - - /** - * @param PiggyBank $piggyBank - * - * @return Collection - */ - public function getEvents(PiggyBank $piggyBank) + public function getEvents(PiggyBank $piggyBank): Collection { return $piggyBank->piggyBankEvents()->orderBy('date', 'DESC')->orderBy('id', 'DESC')->get(); } @@ -77,7 +81,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface /** * @return int */ - public function getMaxOrder() + public function getMaxOrder(): int { return intval($this->user->piggyBanks()->max('order')); } @@ -85,7 +89,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface /** * @return Collection */ - public function getPiggyBanks() + public function getPiggyBanks(): Collection { /** @var Collection $set */ $set = $this->user->piggyBanks()->orderBy('order', 'ASC')->get(); @@ -96,9 +100,9 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface /** * Set all piggy banks to order 0. * - * @return boolean + * @return bool */ - public function reset() + public function reset(): bool { // split query to make it work in sqlite: $set = PiggyBank:: @@ -119,9 +123,9 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface * @param int $piggyBankId * @param int $order * - * @return void + * @return bool */ - public function setOrder(int $piggyBankId, int $order) + public function setOrder(int $piggyBankId, int $order): bool { $piggyBank = PiggyBank::leftJoin('accounts', 'accounts.id', '=', 'piggy_banks.account_id')->where('accounts.user_id', $this->user->id) ->where('piggy_banks.id', $piggyBankId)->first(['piggy_banks.*']); @@ -129,6 +133,8 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface $piggyBank->order = $order; $piggyBank->save(); } + + return true; } /** @@ -136,7 +142,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface * * @return PiggyBank */ - public function store(array $data) + public function store(array $data): PiggyBank { $data['remind_me'] = false; $data['reminder_skip'] = 0; @@ -152,7 +158,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface * * @return PiggyBank */ - public function update(PiggyBank $piggyBank, array $data) + public function update(PiggyBank $piggyBank, array $data): PiggyBank { $piggyBank->name = $data['name']; diff --git a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php index d57f6300c0..206e4704b8 100644 --- a/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php +++ b/app/Repositories/PiggyBank/PiggyBankRepositoryInterface.php @@ -4,6 +4,7 @@ declare(strict_types = 1); namespace FireflyIII\Repositories\PiggyBank; use FireflyIII\Models\PiggyBank; +use FireflyIII\Models\PiggyBankEvent; use Illuminate\Support\Collection; /** @@ -18,47 +19,47 @@ interface PiggyBankRepositoryInterface * @param PiggyBank $piggyBank * @param string $amount * - * @return bool + * @return PiggyBankEvent */ - public function createEvent(PiggyBank $piggyBank, string $amount); + public function createEvent(PiggyBank $piggyBank, string $amount): PiggyBankEvent; /** * @param PiggyBank $piggyBank * * @return bool */ - public function destroy(PiggyBank $piggyBank); + public function destroy(PiggyBank $piggyBank): bool; /** * @param PiggyBank $piggyBank * * @return Collection */ - public function getEventSummarySet(PiggyBank $piggyBank); + public function getEventSummarySet(PiggyBank $piggyBank) : Collection; /** * @param PiggyBank $piggyBank * * @return Collection */ - public function getEvents(PiggyBank $piggyBank); + public function getEvents(PiggyBank $piggyBank) : Collection; /** * @return int */ - public function getMaxOrder(); + public function getMaxOrder(): int; /** * @return Collection */ - public function getPiggyBanks(); + public function getPiggyBanks() : Collection; /** * Set all piggy banks to order 0. * - * @return void + * @return bool */ - public function reset(); + public function reset(): bool; /** * @@ -67,9 +68,9 @@ interface PiggyBankRepositoryInterface * @param int $piggyBankId * @param int $order * - * @return void + * @return bool */ - public function setOrder(int $piggyBankId, int $order); + public function setOrder(int $piggyBankId, int $order): bool; /** @@ -77,7 +78,7 @@ interface PiggyBankRepositoryInterface * * @return PiggyBank */ - public function store(array $data); + public function store(array $data): PiggyBank; /** * @param PiggyBank $piggyBank @@ -85,5 +86,5 @@ interface PiggyBankRepositoryInterface * * @return PiggyBank */ - public function update(PiggyBank $piggyBank, array $data); + public function update(PiggyBank $piggyBank, array $data): PiggyBank; } diff --git a/app/Repositories/Rule/RuleRepository.php b/app/Repositories/Rule/RuleRepository.php index f5351ab955..e2d83e1790 100644 --- a/app/Repositories/Rule/RuleRepository.php +++ b/app/Repositories/Rule/RuleRepository.php @@ -40,7 +40,7 @@ class RuleRepository implements RuleRepositoryInterface /** * @return int */ - public function count() + public function count(): int { return $this->user->rules()->count(); } @@ -50,7 +50,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return bool */ - public function destroy(Rule $rule) + public function destroy(Rule $rule): bool { foreach ($rule->ruleTriggers as $trigger) { $trigger->delete(); @@ -64,9 +64,11 @@ class RuleRepository implements RuleRepositoryInterface } /** + * FIXME can return null + * * @return RuleGroup */ - public function getFirstRuleGroup() + public function getFirstRuleGroup(): RuleGroup { return $this->user->ruleGroups()->first(); } @@ -76,7 +78,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return int */ - public function getHighestOrderInRuleGroup(RuleGroup $ruleGroup) + public function getHighestOrderInRuleGroup(RuleGroup $ruleGroup): int { return intval($ruleGroup->rules()->max('order')); } @@ -102,7 +104,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return bool */ - public function moveDown(Rule $rule) + public function moveDown(Rule $rule): bool { $order = $rule->order; @@ -117,6 +119,7 @@ class RuleRepository implements RuleRepositoryInterface $rule->order = ($rule->order + 1); $rule->save(); $this->resetRulesInGroupOrder($rule->ruleGroup); + return true; } /** @@ -124,7 +127,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return bool */ - public function moveUp(Rule $rule) + public function moveUp(Rule $rule): bool { $order = $rule->order; @@ -138,6 +141,7 @@ class RuleRepository implements RuleRepositoryInterface $rule->order = ($rule->order - 1); $rule->save(); $this->resetRulesInGroupOrder($rule->ruleGroup); + return true; } /** @@ -146,7 +150,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return bool */ - public function reorderRuleActions(Rule $rule, array $ids) + public function reorderRuleActions(Rule $rule, array $ids): bool { $order = 1; foreach ($ids as $actionId) { @@ -168,7 +172,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return bool */ - public function reorderRuleTriggers(Rule $rule, array $ids) + public function reorderRuleTriggers(Rule $rule, array $ids): bool { $order = 1; foreach ($ids as $triggerId) { @@ -189,7 +193,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return bool */ - public function resetRulesInGroupOrder(RuleGroup $ruleGroup) + public function resetRulesInGroupOrder(RuleGroup $ruleGroup): bool { $ruleGroup->rules()->whereNotNull('deleted_at')->update(['order' => 0]); @@ -214,7 +218,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return Rule */ - public function store(array $data) + public function store(array $data): Rule { /** @var RuleGroup $ruleGroup */ $ruleGroup = $this->user->ruleGroups()->find($data['rule_group_id']); @@ -250,7 +254,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return RuleAction */ - public function storeAction(Rule $rule, array $values) + public function storeAction(Rule $rule, array $values): RuleAction { $ruleAction = new RuleAction; $ruleAction->rule()->associate($rule); @@ -271,7 +275,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return RuleTrigger */ - public function storeTrigger(Rule $rule, array $values) + public function storeTrigger(Rule $rule, array $values): RuleTrigger { $ruleTrigger = new RuleTrigger; $ruleTrigger->rule()->associate($rule); @@ -291,7 +295,7 @@ class RuleRepository implements RuleRepositoryInterface * * @return Rule */ - public function update(Rule $rule, array $data) + public function update(Rule $rule, array $data): Rule { // update rule: $rule->active = $data['active']; @@ -319,8 +323,10 @@ class RuleRepository implements RuleRepositoryInterface /** * @param Rule $rule * @param array $data + * + * @return bool */ - private function storeActions(Rule $rule, array $data) + private function storeActions(Rule $rule, array $data): bool { $order = 1; foreach ($data['rule-actions'] as $index => $action) { @@ -336,14 +342,16 @@ class RuleRepository implements RuleRepositoryInterface $this->storeAction($rule, $actionValues); } + return true; } /** * @param Rule $rule * @param array $data + * @return bool */ - private function storeTriggers(Rule $rule, array $data) + private function storeTriggers(Rule $rule, array $data): bool { $order = 1; $stopProcessing = false; @@ -370,5 +378,6 @@ class RuleRepository implements RuleRepositoryInterface $this->storeTrigger($rule, $triggerValues); $order++; } + return true; } } diff --git a/app/Repositories/Rule/RuleRepositoryInterface.php b/app/Repositories/Rule/RuleRepositoryInterface.php index c3556c7bbb..4c98093d20 100644 --- a/app/Repositories/Rule/RuleRepositoryInterface.php +++ b/app/Repositories/Rule/RuleRepositoryInterface.php @@ -26,26 +26,26 @@ interface RuleRepositoryInterface /** * @return int */ - public function count(); + public function count(): int; /** * @param Rule $rule * * @return bool */ - public function destroy(Rule $rule); + public function destroy(Rule $rule): bool; /** * @return RuleGroup */ - public function getFirstRuleGroup(); + public function getFirstRuleGroup(): RuleGroup; /** * @param RuleGroup $ruleGroup * * @return int */ - public function getHighestOrderInRuleGroup(RuleGroup $ruleGroup); + public function getHighestOrderInRuleGroup(RuleGroup $ruleGroup): int; /** * @param Rule $rule @@ -59,14 +59,14 @@ interface RuleRepositoryInterface * * @return bool */ - public function moveDown(Rule $rule); + public function moveDown(Rule $rule): bool; /** * @param Rule $rule * * @return bool */ - public function moveUp(Rule $rule); + public function moveUp(Rule $rule): bool; /** * @param Rule $rule @@ -74,7 +74,7 @@ interface RuleRepositoryInterface * * @return bool */ - public function reorderRuleActions(Rule $rule, array $ids); + public function reorderRuleActions(Rule $rule, array $ids): bool; /** * @param Rule $rule @@ -82,21 +82,21 @@ interface RuleRepositoryInterface * * @return bool */ - public function reorderRuleTriggers(Rule $rule, array $ids); + public function reorderRuleTriggers(Rule $rule, array $ids): bool; /** * @param RuleGroup $ruleGroup * * @return bool */ - public function resetRulesInGroupOrder(RuleGroup $ruleGroup); + public function resetRulesInGroupOrder(RuleGroup $ruleGroup): bool; /** * @param array $data * * @return Rule */ - public function store(array $data); + public function store(array $data): Rule; /** * @param Rule $rule @@ -104,7 +104,7 @@ interface RuleRepositoryInterface * * @return RuleAction */ - public function storeAction(Rule $rule, array $values); + public function storeAction(Rule $rule, array $values): RuleAction; /** * @param Rule $rule @@ -112,7 +112,7 @@ interface RuleRepositoryInterface * * @return RuleTrigger */ - public function storeTrigger(Rule $rule, array $values); + public function storeTrigger(Rule $rule, array $values): RuleTrigger; /** * @param Rule $rule @@ -120,6 +120,6 @@ interface RuleRepositoryInterface * * @return Rule */ - public function update(Rule $rule, array $data); + public function update(Rule $rule, array $data): Rule; } diff --git a/app/Repositories/RuleGroup/RuleGroupRepository.php b/app/Repositories/RuleGroup/RuleGroupRepository.php index 8cacdc0fa8..f2e74925d8 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepository.php +++ b/app/Repositories/RuleGroup/RuleGroupRepository.php @@ -33,7 +33,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface /** * @return int */ - public function count() + public function count(): int { return $this->user->ruleGroups()->count(); } @@ -42,9 +42,9 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface * @param RuleGroup $ruleGroup * @param RuleGroup $moveTo * - * @return boolean + * @return bool */ - public function destroy(RuleGroup $ruleGroup, RuleGroup $moveTo = null) + public function destroy(RuleGroup $ruleGroup, RuleGroup $moveTo = null): bool { /** @var Rule $rule */ foreach ($ruleGroup->rules as $rule) { @@ -72,7 +72,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface /** * @return Collection */ - public function get() + public function get(): Collection { return $this->user->ruleGroups()->orderBy('order', 'ASC')->get(); } @@ -80,7 +80,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface /** * @return int */ - public function getHighestOrderRuleGroup() + public function getHighestOrderRuleGroup(): int { $entry = $this->user->ruleGroups()->max('order'); @@ -119,7 +119,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface * * @return bool */ - public function moveDown(RuleGroup $ruleGroup) + public function moveDown(RuleGroup $ruleGroup): bool { $order = $ruleGroup->order; @@ -133,6 +133,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface $ruleGroup->order = ($ruleGroup->order + 1); $ruleGroup->save(); $this->resetRuleGroupOrder(); + return true; } /** @@ -140,7 +141,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface * * @return bool */ - public function moveUp(RuleGroup $ruleGroup) + public function moveUp(RuleGroup $ruleGroup): bool { $order = $ruleGroup->order; @@ -154,12 +155,13 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface $ruleGroup->order = ($ruleGroup->order - 1); $ruleGroup->save(); $this->resetRuleGroupOrder(); + return true; } /** * @return bool */ - public function resetRuleGroupOrder() + public function resetRuleGroupOrder(): bool { $this->user->ruleGroups()->whereNotNull('deleted_at')->update(['order' => 0]); @@ -181,7 +183,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface * * @return bool */ - public function resetRulesInGroupOrder(RuleGroup $ruleGroup) + public function resetRulesInGroupOrder(RuleGroup $ruleGroup): bool { $ruleGroup->rules()->whereNotNull('deleted_at')->update(['order' => 0]); @@ -206,7 +208,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface * * @return RuleGroup */ - public function store(array $data) + public function store(array $data): RuleGroup { $order = $this->getHighestOrderRuleGroup(); @@ -233,7 +235,7 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface * * @return RuleGroup */ - public function update(RuleGroup $ruleGroup, array $data) + public function update(RuleGroup $ruleGroup, array $data): RuleGroup { // update the account: $ruleGroup->title = $data['title']; diff --git a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php index 332a481354..8e91189457 100644 --- a/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php +++ b/app/Repositories/RuleGroup/RuleGroupRepositoryInterface.php @@ -20,7 +20,7 @@ interface RuleGroupRepositoryInterface /** * @return int */ - public function count(); + public function count(): int; /** * @param RuleGroup $ruleGroup @@ -28,17 +28,17 @@ interface RuleGroupRepositoryInterface * * @return bool */ - public function destroy(RuleGroup $ruleGroup, RuleGroup $moveTo = null); + public function destroy(RuleGroup $ruleGroup, RuleGroup $moveTo = null): bool; /** * @return Collection */ - public function get(); + public function get(): Collection; /** * @return int */ - public function getHighestOrderRuleGroup(); + public function getHighestOrderRuleGroup(): int; /** * @param User $user @@ -52,33 +52,33 @@ interface RuleGroupRepositoryInterface * * @return bool */ - public function moveDown(RuleGroup $ruleGroup); + public function moveDown(RuleGroup $ruleGroup): bool; /** * @param RuleGroup $ruleGroup * * @return bool */ - public function moveUp(RuleGroup $ruleGroup); + public function moveUp(RuleGroup $ruleGroup): bool; /** * @return bool */ - public function resetRuleGroupOrder(); + public function resetRuleGroupOrder(): bool; /** * @param RuleGroup $ruleGroup * * @return bool */ - public function resetRulesInGroupOrder(RuleGroup $ruleGroup); + public function resetRulesInGroupOrder(RuleGroup $ruleGroup): bool; /** * @param array $data * * @return RuleGroup */ - public function store(array $data); + public function store(array $data): RuleGroup; /** * @param RuleGroup $ruleGroup @@ -86,7 +86,7 @@ interface RuleGroupRepositoryInterface * * @return RuleGroup */ - public function update(RuleGroup $ruleGroup, array $data); + public function update(RuleGroup $ruleGroup, array $data): RuleGroup; } diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index 7ec2bcd6c8..14fea48a91 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -42,7 +42,7 @@ class TagRepository implements TagRepositoryInterface * * @return Collection */ - public function allCoveredByBalancingActs(Collection $accounts, Carbon $start, Carbon $end) + public function allCoveredByBalancingActs(Collection $accounts, Carbon $start, Carbon $end): Collection { $ids = $accounts->pluck('id')->toArray(); $set = $this->user->tags() @@ -84,9 +84,9 @@ class TagRepository implements TagRepositoryInterface * * @SuppressWarnings(PHPMD.CyclomaticComplexity) // it's exactly 5. * - * @return boolean + * @return bool */ - public function connect(TransactionJournal $journal, Tag $tag) + public function connect(TransactionJournal $journal, Tag $tag): bool { /* * Already connected: @@ -125,7 +125,7 @@ class TagRepository implements TagRepositoryInterface * * @return string */ - public function coveredByBalancingActs(Account $account, Carbon $start, Carbon $end) + public function coveredByBalancingActs(Account $account, Carbon $start, Carbon $end): string { // the quickest way to do this is by scanning all balancingAct tags // because there will be less of them any way. @@ -152,20 +152,19 @@ class TagRepository implements TagRepositoryInterface /** * @param Tag $tag * - * @return boolean + * @return bool */ - public function destroy(Tag $tag) + public function destroy(Tag $tag): bool { $tag->delete(); return true; } - // @codeCoverageIgnoreEnd /** * @return Collection */ - public function get() + public function get(): Collection { /** @var Collection $tags */ $tags = $this->user->tags()->get(); @@ -183,7 +182,7 @@ class TagRepository implements TagRepositoryInterface * * @return Tag */ - public function store(array $data) + public function store(array $data): Tag { $tag = new Tag; $tag->tag = $data['tag']; @@ -208,7 +207,7 @@ class TagRepository implements TagRepositoryInterface * * @return bool */ - public function tagAllowAdvance(Tag $tag) + public function tagAllowAdvance(Tag $tag): bool { /* * If this tag is a balancing act, and it contains transfers, it cannot be @@ -247,7 +246,7 @@ class TagRepository implements TagRepositoryInterface * * @return bool */ - public function tagAllowBalancing(Tag $tag) + public function tagAllowBalancing(Tag $tag): bool { /* * If has more than two transactions already, cannot become a balancing act: @@ -275,7 +274,7 @@ class TagRepository implements TagRepositoryInterface * * @return Tag */ - public function update(Tag $tag, array $data) + public function update(Tag $tag, array $data): Tag { $tag->tag = $data['tag']; $tag->date = $data['date']; @@ -295,9 +294,9 @@ class TagRepository implements TagRepositoryInterface * * @SuppressWarnings(PHPMD.CyclomaticComplexity) * - * @return boolean + * @return bool */ - protected function connectAdvancePayment(TransactionJournal $journal, Tag $tag) + protected function connectAdvancePayment(TransactionJournal $journal, Tag $tag): bool { /** @var TransactionType $transfer */ $transfer = TransactionType::whereType(TransactionType::TRANSFER)->first(); @@ -332,7 +331,7 @@ class TagRepository implements TagRepositoryInterface } // this statement is unreachable. - return false; // @codeCoverageIgnore + return false; } @@ -340,9 +339,9 @@ class TagRepository implements TagRepositoryInterface * @param TransactionJournal $journal * @param Tag $tag * - * @return boolean + * @return bool */ - protected function connectBalancingAct(TransactionJournal $journal, Tag $tag) + protected function connectBalancingAct(TransactionJournal $journal, Tag $tag): bool { /** @var TransactionType $withdrawal */ $withdrawal = TransactionType::whereType(TransactionType::WITHDRAWAL)->first(); @@ -380,7 +379,7 @@ class TagRepository implements TagRepositoryInterface * * @return bool */ - protected function matchAll(TransactionJournal $journal, Tag $tag) + protected function matchAll(TransactionJournal $journal, Tag $tag): bool { $match = true; /** @var TransactionJournal $check */ diff --git a/app/Repositories/Tag/TagRepositoryInterface.php b/app/Repositories/Tag/TagRepositoryInterface.php index 77c2d73c8b..0520c1caaf 100644 --- a/app/Repositories/Tag/TagRepositoryInterface.php +++ b/app/Repositories/Tag/TagRepositoryInterface.php @@ -24,15 +24,15 @@ interface TagRepositoryInterface * * @return Collection */ - public function allCoveredByBalancingActs(Collection $accounts, Carbon $start, Carbon $end); + public function allCoveredByBalancingActs(Collection $accounts, Carbon $start, Carbon $end): Collection; /** * @param TransactionJournal $journal * @param Tag $tag * - * @return boolean + * @return bool */ - public function connect(TransactionJournal $journal, Tag $tag); + public function connect(TransactionJournal $journal, Tag $tag): bool; /** * @deprecated @@ -49,26 +49,26 @@ interface TagRepositoryInterface * * @return string */ - public function coveredByBalancingActs(Account $account, Carbon $start, Carbon $end); + public function coveredByBalancingActs(Account $account, Carbon $start, Carbon $end): string; /** * @param Tag $tag * - * @return boolean + * @return bool */ - public function destroy(Tag $tag); + public function destroy(Tag $tag): bool; /** * @return Collection */ - public function get(); + public function get(): Collection; /** * @param array $data * * @return Tag */ - public function store(array $data); + public function store(array $data): Tag; /** * Can a tag become an advance payment? @@ -77,7 +77,7 @@ interface TagRepositoryInterface * * @return bool */ - public function tagAllowAdvance(Tag $tag); + public function tagAllowAdvance(Tag $tag): bool; /** * Can a tag become a balancing act? @@ -86,7 +86,7 @@ interface TagRepositoryInterface * * @return bool */ - public function tagAllowBalancing(Tag $tag); + public function tagAllowBalancing(Tag $tag): bool; /** * @param Tag $tag @@ -94,5 +94,5 @@ interface TagRepositoryInterface * * @return Tag */ - public function update(Tag $tag, array $data); + public function update(Tag $tag, array $data): Tag; } diff --git a/app/Rules/Actions/ActionInterface.php b/app/Rules/Actions/ActionInterface.php index 8b90cb39df..42f95b37db 100644 --- a/app/Rules/Actions/ActionInterface.php +++ b/app/Rules/Actions/ActionInterface.php @@ -32,5 +32,5 @@ interface ActionInterface * * @return bool */ - public function act(TransactionJournal $journal); + public function act(TransactionJournal $journal): bool; } diff --git a/app/Rules/Actions/AddTag.php b/app/Rules/Actions/AddTag.php index 80a5750119..87d2b8e743 100644 --- a/app/Rules/Actions/AddTag.php +++ b/app/Rules/Actions/AddTag.php @@ -42,7 +42,7 @@ class AddTag implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { // journal has this tag maybe? $tag = Tag::firstOrCreateEncrypted(['tag' => $this->action->action_value, 'user_id' => Auth::user()->id]); diff --git a/app/Rules/Actions/AppendDescription.php b/app/Rules/Actions/AppendDescription.php index d858959025..281b1a0857 100644 --- a/app/Rules/Actions/AppendDescription.php +++ b/app/Rules/Actions/AppendDescription.php @@ -39,7 +39,7 @@ class AppendDescription implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { $journal->description = $journal->description . $this->action->action_value; $journal->save(); diff --git a/app/Rules/Actions/ClearBudget.php b/app/Rules/Actions/ClearBudget.php index 441157f07e..0cea12a61e 100644 --- a/app/Rules/Actions/ClearBudget.php +++ b/app/Rules/Actions/ClearBudget.php @@ -40,7 +40,7 @@ class ClearBudget implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { $journal->budgets()->detach(); diff --git a/app/Rules/Actions/ClearCategory.php b/app/Rules/Actions/ClearCategory.php index 16e435b505..3a1c5d1d7f 100644 --- a/app/Rules/Actions/ClearCategory.php +++ b/app/Rules/Actions/ClearCategory.php @@ -40,7 +40,7 @@ class ClearCategory implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { $journal->categories()->detach(); diff --git a/app/Rules/Actions/PrependDescription.php b/app/Rules/Actions/PrependDescription.php index a0eeca1549..52b4b4f2f0 100644 --- a/app/Rules/Actions/PrependDescription.php +++ b/app/Rules/Actions/PrependDescription.php @@ -39,7 +39,7 @@ class PrependDescription implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { $journal->description = $this->action->action_value . $journal->description; $journal->save(); diff --git a/app/Rules/Actions/RemoveAllTags.php b/app/Rules/Actions/RemoveAllTags.php index e3217011d9..3bcd36f8af 100644 --- a/app/Rules/Actions/RemoveAllTags.php +++ b/app/Rules/Actions/RemoveAllTags.php @@ -39,7 +39,7 @@ class RemoveAllTags implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { $journal->tags()->detach(); diff --git a/app/Rules/Actions/RemoveTag.php b/app/Rules/Actions/RemoveTag.php index a090e57009..a6b5c87327 100644 --- a/app/Rules/Actions/RemoveTag.php +++ b/app/Rules/Actions/RemoveTag.php @@ -42,7 +42,7 @@ class RemoveTag implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { // if tag does not exist, no need to continue: $name = $this->action->action_value; diff --git a/app/Rules/Actions/SetBudget.php b/app/Rules/Actions/SetBudget.php index 54847f836b..9ea73e2a39 100644 --- a/app/Rules/Actions/SetBudget.php +++ b/app/Rules/Actions/SetBudget.php @@ -43,7 +43,7 @@ class SetBudget implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { /** @var BudgetRepositoryInterface $repository */ $repository = app('FireflyIII\Repositories\Budget\BudgetRepositoryInterface'); diff --git a/app/Rules/Actions/SetCategory.php b/app/Rules/Actions/SetCategory.php index 24107459a5..86ccef422d 100644 --- a/app/Rules/Actions/SetCategory.php +++ b/app/Rules/Actions/SetCategory.php @@ -43,7 +43,7 @@ class SetCategory implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { $name = $this->action->action_value; $category = Category::firstOrCreateEncrypted(['name' => $name, 'user_id' => Auth::user()->id]); diff --git a/app/Rules/Actions/SetDescription.php b/app/Rules/Actions/SetDescription.php index a3c822ddb1..47dabc12d6 100644 --- a/app/Rules/Actions/SetDescription.php +++ b/app/Rules/Actions/SetDescription.php @@ -39,7 +39,7 @@ class SetDescription implements ActionInterface * * @return bool */ - public function act(TransactionJournal $journal) + public function act(TransactionJournal $journal): bool { $journal->description = $this->action->action_value; $journal->save(); diff --git a/app/Rules/Processor.php b/app/Rules/Processor.php index eb3d5da5e3..58e5d406e2 100644 --- a/app/Rules/Processor.php +++ b/app/Rules/Processor.php @@ -117,7 +117,7 @@ final class Processor * * @return \FireflyIII\Models\Rule */ - public function getRule() + public function getRule(): Rule { return $this->rule; } @@ -131,18 +131,20 @@ final class Processor * * @return bool */ - public function handleTransactionJournal(TransactionJournal $journal) + public function handleTransactionJournal(TransactionJournal $journal): bool { $this->journal = $journal; // get all triggers: $triggered = $this->triggered(); if ($triggered) { if ($this->actions->count() > 0) { + Log::debug('Journal #' . $journal->id . ' triggered, actions executed.'); $this->actions(); } return true; } + Log::debug('Journal #' . $journal->id . ' not triggered, did nothing.'); return false; diff --git a/app/Rules/TransactionMatcher.php b/app/Rules/TransactionMatcher.php index 3c970430dc..80be3c7366 100644 --- a/app/Rules/TransactionMatcher.php +++ b/app/Rules/TransactionMatcher.php @@ -115,7 +115,7 @@ class TransactionMatcher * * @return TransactionMatcher */ - public function setLimit($limit): TransactionMatcher + public function setLimit(int $limit): TransactionMatcher { $this->limit = $limit; @@ -135,7 +135,7 @@ class TransactionMatcher * * @return TransactionMatcher */ - public function setRange($range): TransactionMatcher + public function setRange(int $range): TransactionMatcher { $this->range = $range; @@ -156,7 +156,7 @@ class TransactionMatcher * * @return TransactionMatcher */ - public function setTriggers($triggers): TransactionMatcher + public function setTriggers(array $triggers): TransactionMatcher { $this->triggers = $triggers; diff --git a/app/Rules/Triggers/AmountExactly.php b/app/Rules/Triggers/AmountExactly.php index 0f2adce2a0..7a6ca714dd 100644 --- a/app/Rules/Triggers/AmountExactly.php +++ b/app/Rules/Triggers/AmountExactly.php @@ -51,7 +51,7 @@ final class AmountExactly extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $amount = $journal->destination_amount ?? TransactionJournal::amountPositive($journal); $compare = $this->triggerValue; diff --git a/app/Rules/Triggers/AmountLess.php b/app/Rules/Triggers/AmountLess.php index fa96f756dd..e6d8cc9c27 100644 --- a/app/Rules/Triggers/AmountLess.php +++ b/app/Rules/Triggers/AmountLess.php @@ -51,7 +51,7 @@ final class AmountLess extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $amount = $journal->destination_amount ?? TransactionJournal::amountPositive($journal); $compare = $this->triggerValue; diff --git a/app/Rules/Triggers/AmountMore.php b/app/Rules/Triggers/AmountMore.php index 8c95bf4568..ce8b2c7573 100644 --- a/app/Rules/Triggers/AmountMore.php +++ b/app/Rules/Triggers/AmountMore.php @@ -51,7 +51,7 @@ final class AmountMore extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $amount = $journal->destination_amount ?? TransactionJournal::amountPositive($journal); $compare = $this->triggerValue; diff --git a/app/Rules/Triggers/DescriptionContains.php b/app/Rules/Triggers/DescriptionContains.php index 284ffa311e..6f75479ce4 100644 --- a/app/Rules/Triggers/DescriptionContains.php +++ b/app/Rules/Triggers/DescriptionContains.php @@ -51,7 +51,7 @@ final class DescriptionContains extends AbstractTrigger implements TriggerInterf * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $search = strtolower($this->triggerValue); $source = strtolower($journal->description); diff --git a/app/Rules/Triggers/DescriptionEnds.php b/app/Rules/Triggers/DescriptionEnds.php index 8bec9cc1fe..751645ff85 100644 --- a/app/Rules/Triggers/DescriptionEnds.php +++ b/app/Rules/Triggers/DescriptionEnds.php @@ -50,7 +50,7 @@ final class DescriptionEnds extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $description = strtolower($journal->description); $descriptionLength = strlen($description); diff --git a/app/Rules/Triggers/DescriptionIs.php b/app/Rules/Triggers/DescriptionIs.php index 5dcec9b3d1..81bfb8ad7c 100644 --- a/app/Rules/Triggers/DescriptionIs.php +++ b/app/Rules/Triggers/DescriptionIs.php @@ -50,7 +50,7 @@ final class DescriptionIs extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $description = strtolower($journal->description); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/DescriptionStarts.php b/app/Rules/Triggers/DescriptionStarts.php index 5763f30d59..295333c95b 100644 --- a/app/Rules/Triggers/DescriptionStarts.php +++ b/app/Rules/Triggers/DescriptionStarts.php @@ -50,7 +50,7 @@ final class DescriptionStarts extends AbstractTrigger implements TriggerInterfac * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $description = strtolower($journal->description); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/FromAccountContains.php b/app/Rules/Triggers/FromAccountContains.php index 6510a1fb71..58799b60d4 100644 --- a/app/Rules/Triggers/FromAccountContains.php +++ b/app/Rules/Triggers/FromAccountContains.php @@ -50,7 +50,7 @@ final class FromAccountContains extends AbstractTrigger implements TriggerInterf * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $fromAccountName = strtolower($journal->source_account_name ?? TransactionJournal::sourceAccount($journal)->name); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/FromAccountEnds.php b/app/Rules/Triggers/FromAccountEnds.php index eaee5223fa..96e83fadcf 100644 --- a/app/Rules/Triggers/FromAccountEnds.php +++ b/app/Rules/Triggers/FromAccountEnds.php @@ -50,7 +50,7 @@ final class FromAccountEnds extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $name = strtolower($journal->source_account_name ?? TransactionJournal::sourceAccount($journal)->name); $nameLength = strlen($name); diff --git a/app/Rules/Triggers/FromAccountIs.php b/app/Rules/Triggers/FromAccountIs.php index 1344847929..061044cf7d 100644 --- a/app/Rules/Triggers/FromAccountIs.php +++ b/app/Rules/Triggers/FromAccountIs.php @@ -50,7 +50,7 @@ final class FromAccountIs extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $name = strtolower($journal->source_account_name ?? TransactionJournal::sourceAccount($journal)->name); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/FromAccountStarts.php b/app/Rules/Triggers/FromAccountStarts.php index 32027e4587..62eaafac67 100644 --- a/app/Rules/Triggers/FromAccountStarts.php +++ b/app/Rules/Triggers/FromAccountStarts.php @@ -50,7 +50,7 @@ final class FromAccountStarts extends AbstractTrigger implements TriggerInterfac * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $name = strtolower($journal->source_account_name ?? TransactionJournal::sourceAccount($journal)->name); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/ToAccountContains.php b/app/Rules/Triggers/ToAccountContains.php index e898743ab0..f6d7c31c68 100644 --- a/app/Rules/Triggers/ToAccountContains.php +++ b/app/Rules/Triggers/ToAccountContains.php @@ -50,7 +50,7 @@ final class ToAccountContains extends AbstractTrigger implements TriggerInterfac * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $toAccountName = strtolower($journal->destination_account_name ?? TransactionJournal::destinationAccount($journal)->name); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/ToAccountEnds.php b/app/Rules/Triggers/ToAccountEnds.php index a6acfafc90..f01d8d8ba5 100644 --- a/app/Rules/Triggers/ToAccountEnds.php +++ b/app/Rules/Triggers/ToAccountEnds.php @@ -50,7 +50,7 @@ final class ToAccountEnds extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $toAccountName = strtolower($journal->destination_account_name ?? TransactionJournal::destinationAccount($journal)->name); $toAccountNameLength = strlen($toAccountName); diff --git a/app/Rules/Triggers/ToAccountIs.php b/app/Rules/Triggers/ToAccountIs.php index 03506aa9bc..6d1ea0181e 100644 --- a/app/Rules/Triggers/ToAccountIs.php +++ b/app/Rules/Triggers/ToAccountIs.php @@ -50,7 +50,7 @@ final class ToAccountIs extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $toAccountName = strtolower($journal->destination_account_name ?? TransactionJournal::destinationAccount($journal)->name); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/ToAccountStarts.php b/app/Rules/Triggers/ToAccountStarts.php index 2e3c5655ce..8f00f80d0c 100644 --- a/app/Rules/Triggers/ToAccountStarts.php +++ b/app/Rules/Triggers/ToAccountStarts.php @@ -50,7 +50,7 @@ final class ToAccountStarts extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $toAccountName = strtolower($journal->destination_account_name ?? TransactionJournal::destinationAccount($journal)->name); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/TransactionType.php b/app/Rules/Triggers/TransactionType.php index b6a0669add..a57d1aa1cc 100644 --- a/app/Rules/Triggers/TransactionType.php +++ b/app/Rules/Triggers/TransactionType.php @@ -50,7 +50,7 @@ final class TransactionType extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { $type = !is_null($journal->transaction_type_type) ? $journal->transaction_type_type : strtolower($journal->transactionType->type); $search = strtolower($this->triggerValue); diff --git a/app/Rules/Triggers/TriggerInterface.php b/app/Rules/Triggers/TriggerInterface.php index 5b7dd50cbf..2cd5bd2c2c 100644 --- a/app/Rules/Triggers/TriggerInterface.php +++ b/app/Rules/Triggers/TriggerInterface.php @@ -43,5 +43,5 @@ interface TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal); + public function triggered(TransactionJournal $journal): bool; } diff --git a/app/Rules/Triggers/UserAction.php b/app/Rules/Triggers/UserAction.php index 7aa76ef43c..32f9698a91 100644 --- a/app/Rules/Triggers/UserAction.php +++ b/app/Rules/Triggers/UserAction.php @@ -48,7 +48,7 @@ final class UserAction extends AbstractTrigger implements TriggerInterface * * @return bool */ - public function triggered(TransactionJournal $journal) + public function triggered(TransactionJournal $journal): bool { return true; } diff --git a/app/Sql/Query.php b/app/Sql/Query.php deleted file mode 100644 index ccc9a6244f..0000000000 --- a/app/Sql/Query.php +++ /dev/null @@ -1,18 +0,0 @@ -get(); } @@ -120,7 +120,7 @@ class Amount /** * @return string */ - public function getCurrencyCode() + public function getCurrencyCode(): string { $cache = new CacheProperties; @@ -139,14 +139,14 @@ class Amount } $cache->store(env('DEFAULT_CURRENCY', 'EUR')); - return env('DEFAULT_CURRENCY', 'EUR'); // @codeCoverageIgnore + return env('DEFAULT_CURRENCY', 'EUR'); } } /** * @return string */ - public function getCurrencySymbol() + public function getCurrencySymbol(): string { $cache = new CacheProperties; $cache->addProperty('getCurrencySymbol'); @@ -165,7 +165,7 @@ class Amount /** * @return TransactionCurrency */ - public function getDefaultCurrency() + public function getDefaultCurrency(): TransactionCurrency { $cache = new CacheProperties; $cache->addProperty('getDefaultCurrency'); diff --git a/app/Support/CacheProperties.php b/app/Support/CacheProperties.php index 710b971eab..19f6c0f6cc 100644 --- a/app/Support/CacheProperties.php +++ b/app/Support/CacheProperties.php @@ -14,7 +14,6 @@ use Preferences as Prefs; /** * Class CacheProperties * - * @codeCoverageIgnore * @package FireflyIII\Support */ class CacheProperties diff --git a/app/Support/ExpandedForm.php b/app/Support/ExpandedForm.php index 65dcb3dd86..c92580de77 100644 --- a/app/Support/ExpandedForm.php +++ b/app/Support/ExpandedForm.php @@ -246,17 +246,15 @@ class ExpandedForm * * @return string */ - public function optionsList($type, $name): string + public function optionsList(string $type, string $name): string { $previousValue = null; - // @codeCoverageIgnoreStart try { $previousValue = Input::old('post_submit_action'); } catch (RuntimeException $e) { // don't care } - // @codeCoverageIgnoreEnd $previousValue = is_null($previousValue) ? 'store' : $previousValue; $html = view('form.options', compact('type', 'name', 'previousValue'))->render(); @@ -391,7 +389,6 @@ class ExpandedForm $preFilled = session('preFilled'); $value = isset($preFilled[$name]) && is_null($value) ? $preFilled[$name] : $value; } - // @codeCoverageIgnoreStart try { if (!is_null(Input::old($name))) { $value = Input::old($name); @@ -400,7 +397,6 @@ class ExpandedForm // don't care about session errors. } - // @codeCoverageIgnoreEnd return $value; } diff --git a/app/Support/Facades/Amount.php b/app/Support/Facades/Amount.php index c6d2b43250..ea067dcb32 100644 --- a/app/Support/Facades/Amount.php +++ b/app/Support/Facades/Amount.php @@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade; /** * Class Amount * - * @codeCoverageIgnore * @package FireflyIII\Support\Facades */ class Amount extends Facade diff --git a/app/Support/Facades/ExpandedForm.php b/app/Support/Facades/ExpandedForm.php index 006a88f2c3..50ad979629 100644 --- a/app/Support/Facades/ExpandedForm.php +++ b/app/Support/Facades/ExpandedForm.php @@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade; /** * Class Amount * - * @codeCoverageIgnore * @package FireflyIII\Support\Facades */ class ExpandedForm extends Facade diff --git a/app/Support/Facades/Navigation.php b/app/Support/Facades/Navigation.php index dba4ed838b..b00578a601 100644 --- a/app/Support/Facades/Navigation.php +++ b/app/Support/Facades/Navigation.php @@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade; /** * Class Navigation * - * @codeCoverageIgnore * @package FireflyIII\Support\Facades */ class Navigation extends Facade diff --git a/app/Support/Facades/Preferences.php b/app/Support/Facades/Preferences.php index 06b7033813..f51347a6e0 100644 --- a/app/Support/Facades/Preferences.php +++ b/app/Support/Facades/Preferences.php @@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade; /** * Class Preferences * - * @codeCoverageIgnore * @package FireflyIII\Support\Facades */ class Preferences extends Facade diff --git a/app/Support/Facades/Steam.php b/app/Support/Facades/Steam.php index 5c93adcd8b..9fa7b179b1 100644 --- a/app/Support/Facades/Steam.php +++ b/app/Support/Facades/Steam.php @@ -8,7 +8,6 @@ use Illuminate\Support\Facades\Facade; /** * Class Steam * - * @codeCoverageIgnore * @package FireflyIII\Support\Facades */ class Steam extends Facade diff --git a/app/Support/Models/TransactionJournalSupport.php b/app/Support/Models/TransactionJournalSupport.php index 2a2a5faf1a..253361547a 100644 --- a/app/Support/Models/TransactionJournalSupport.php +++ b/app/Support/Models/TransactionJournalSupport.php @@ -39,7 +39,7 @@ class TransactionJournalSupport extends Model $cache->addProperty('transaction-journal'); $cache->addProperty('amount'); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $transaction = $journal->transactions->sortByDesc('amount')->first(); @@ -66,7 +66,7 @@ class TransactionJournalSupport extends Model $cache->addProperty('transaction-journal'); $cache->addProperty('amount-positive'); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $amount = '0'; @@ -143,7 +143,7 @@ class TransactionJournalSupport extends Model $cache->addProperty('transaction-journal'); $cache->addProperty('destination-account'); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $transaction = $journal->transactions()->where('amount', '>', 0)->first(); if (!is_null($transaction)) { @@ -168,7 +168,7 @@ class TransactionJournalSupport extends Model $cache->addProperty('transaction-journal'); $cache->addProperty('destination-account-type-str'); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $account = self::destinationAccount($journal); @@ -225,7 +225,7 @@ class TransactionJournalSupport extends Model $cache->addProperty('transaction-journal'); $cache->addProperty('source-account'); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $transaction = $journal->transactions()->where('amount', '<', 0)->first(); if (!is_null($transaction)) { @@ -250,7 +250,7 @@ class TransactionJournalSupport extends Model $cache->addProperty('transaction-journal'); $cache->addProperty('source-account-type-str'); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $account = self::sourceAccount($journal); @@ -272,7 +272,7 @@ class TransactionJournalSupport extends Model $cache->addProperty('transaction-journal'); $cache->addProperty('type-string'); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $typeStr = $journal->transaction_type_type ?? $journal->transactionType->type; diff --git a/app/Support/Navigation.php b/app/Support/Navigation.php index 51cb6091bc..0d3777e93e 100644 --- a/app/Support/Navigation.php +++ b/app/Support/Navigation.php @@ -23,7 +23,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function addPeriod(Carbon $theDate, string $repeatFreq, int $skip) + public function addPeriod(Carbon $theDate, string $repeatFreq, int $skip): Carbon { $date = clone $theDate; $add = ($skip + 1); @@ -62,7 +62,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function endOfPeriod(Carbon $theCurrentEnd, string $repeatFreq) + public function endOfPeriod(Carbon $theCurrentEnd, string $repeatFreq): Carbon { $currentEnd = clone $theCurrentEnd; @@ -121,7 +121,7 @@ class Navigation * * @return \Carbon\Carbon */ - public function endOfX(Carbon $theCurrentEnd, string $repeatFreq, Carbon $maxDate = null) + public function endOfX(Carbon $theCurrentEnd, string $repeatFreq, Carbon $maxDate = null): Carbon { $functionMap = [ '1D' => 'endOfDay', @@ -162,7 +162,7 @@ class Navigation * @return string * @throws FireflyException */ - public function periodShow(Carbon $date, string $repeatFrequency) + public function periodShow(Carbon $date, string $repeatFrequency): string { $formatMap = [ '1D' => trans('config.specific_day'), @@ -197,7 +197,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function startOfPeriod(Carbon $theDate, string $repeatFreq) + public function startOfPeriod(Carbon $theDate, string $repeatFreq): Carbon { $date = clone $theDate; @@ -248,7 +248,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function subtractPeriod(Carbon $theDate, string $repeatFreq, int $subtract = 1) + public function subtractPeriod(Carbon $theDate, string $repeatFreq, int $subtract = 1): Carbon { $date = clone $theDate; // 1D 1W 1M 3M 6M 1Y @@ -308,7 +308,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function updateEndDate(string $range, Carbon $start) + public function updateEndDate(string $range, Carbon $start): Carbon { $functionMap = [ '1D' => 'endOfDay', @@ -344,7 +344,7 @@ class Navigation * @return \Carbon\Carbon * @throws FireflyException */ - public function updateStartDate(string $range, Carbon $start) + public function updateStartDate(string $range, Carbon $start): Carbon { $functionMap = [ '1D' => 'startOfDay', diff --git a/app/Support/Preferences.php b/app/Support/Preferences.php index a5652749f2..52b958816b 100644 --- a/app/Support/Preferences.php +++ b/app/Support/Preferences.php @@ -38,7 +38,7 @@ class Preferences * @param $name * @param null $default * - * @return Preference|null + * @return \FireflyIII\Models\Preference|null */ public function get($name, $default = null) { @@ -83,7 +83,7 @@ class Preferences /** * @return string */ - public function lastActivity() + public function lastActivity(): string { $preference = $this->get('lastActivity', microtime())->data; @@ -93,7 +93,7 @@ class Preferences /** * @return bool */ - public function mark() + public function mark(): bool { $this->set('lastActivity', microtime()); @@ -106,11 +106,15 @@ class Preferences * * @return Preference */ - public function set($name, $value) + public function set($name, $value): Preference { $user = Auth::user(); if (is_null($user)) { - return $value; + // make new preference, return it: + $pref = new Preference; + $pref->name = $name; + $pref->data = $value; + return $pref; } return $this->setForUser(Auth::user(), $name, $value); @@ -123,7 +127,7 @@ class Preferences * * @return Preference */ - public function setForUser(User $user, $name, $value) + public function setForUser(User $user, $name, $value): Preference { $fullName = 'preference' . $user->id . $name; Cache::forget($fullName); diff --git a/app/Support/Search/Search.php b/app/Support/Search/Search.php index 3a85e69577..deb68245dd 100644 --- a/app/Support/Search/Search.php +++ b/app/Support/Search/Search.php @@ -103,16 +103,16 @@ class Search implements SearchInterface public function searchTransactions(array $words): Collection { // decrypted transaction journals: - $decrypted = Auth::user()->transactionjournals()->expanded()->where('encrypted', 0)->where( + $decrypted = Auth::user()->transactionjournals()->expanded()->where('transaction_journals.encrypted', 0)->where( function (EloquentBuilder $q) use ($words) { foreach ($words as $word) { - $q->orWhere('description', 'LIKE', '%' . e($word) . '%'); + $q->orWhere('transaction_journals.description', 'LIKE', '%' . e($word) . '%'); } } )->get(TransactionJournal::QUERYFIELDS); // encrypted - $all = Auth::user()->transactionjournals()->expanded()->where('encrypted', 1)->get(TransactionJournal::QUERYFIELDS); + $all = Auth::user()->transactionjournals()->expanded()->where('transaction_journals.encrypted', 1)->get(TransactionJournal::QUERYFIELDS); $set = $all->filter( function (TransactionJournal $journal) use ($words) { foreach ($words as $word) { diff --git a/app/Support/Steam.php b/app/Support/Steam.php index b5c7c1db19..3e73432113 100644 --- a/app/Support/Steam.php +++ b/app/Support/Steam.php @@ -35,7 +35,7 @@ class Steam $cache->addProperty($date); $cache->addProperty($ignoreVirtualBalance); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $balance = strval( @@ -63,7 +63,7 @@ class Steam * * @return array */ - public function balanceInRange(Account $account, Carbon $start, Carbon $end) + public function balanceInRange(Account $account, Carbon $start, Carbon $end): array { // abuse chart properties: $cache = new CacheProperties; @@ -72,7 +72,7 @@ class Steam $cache->addProperty($start); $cache->addProperty($end); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $balances = []; @@ -110,7 +110,7 @@ class Steam * * @return array */ - public function balancesById(array $ids, Carbon $date) + public function balancesById(array $ids, Carbon $date): array { // abuse chart properties: @@ -119,7 +119,7 @@ class Steam $cache->addProperty('balances'); $cache->addProperty($date); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $balances = Transaction:: @@ -147,7 +147,7 @@ class Steam * * @return array */ - public function getLastActivities(array $accounts) + public function getLastActivities(array $accounts): array { $list = []; @@ -170,7 +170,7 @@ class Steam * * @return int */ - public function phpBytes($string) + public function phpBytes($string): int { $string = strtolower($string); diff --git a/app/Support/Twig/Budget.php b/app/Support/Twig/Budget.php index d3a1d0cd89..3363f356ac 100644 --- a/app/Support/Twig/Budget.php +++ b/app/Support/Twig/Budget.php @@ -10,7 +10,6 @@ use Twig_Extension; use Twig_SimpleFunction; /** - * @codeCoverageIgnore * Class Budget * * @package FireflyIII\Support\Twig @@ -29,7 +28,7 @@ class Budget extends Twig_Extension $cache->addProperty($repetition->id); $cache->addProperty('spentInRepetition'); if ($cache->has()) { - return $cache->get(); // @codeCoverageIgnore + return $cache->get(); } $sum = Auth::user()->transactionjournals() diff --git a/app/Support/Twig/General.php b/app/Support/Twig/General.php index 2a4b16e1d3..5373708ef6 100644 --- a/app/Support/Twig/General.php +++ b/app/Support/Twig/General.php @@ -14,7 +14,6 @@ use Twig_SimpleFilter; use Twig_SimpleFunction; /** - * @codeCoverageIgnore * * Class TwigSupport * diff --git a/app/Support/Twig/PiggyBank.php b/app/Support/Twig/PiggyBank.php index dd5d341ffa..4c101e21fb 100644 --- a/app/Support/Twig/PiggyBank.php +++ b/app/Support/Twig/PiggyBank.php @@ -8,7 +8,6 @@ use Twig_Extension; use Twig_SimpleFunction; /** - * @codeCoverageIgnore * * Class PiggyBank * @@ -20,7 +19,7 @@ class PiggyBank extends Twig_Extension /** * */ - public function getFunctions() + public function getFunctions(): array { $functions = []; @@ -38,7 +37,7 @@ class PiggyBank extends Twig_Extension * * @return string The extension name */ - public function getName() + public function getName(): string { return 'FireflyIII\Support\Twig\PiggyBank'; } diff --git a/app/Support/Twig/Rule.php b/app/Support/Twig/Rule.php index 8c83e2ca10..e91f16509e 100644 --- a/app/Support/Twig/Rule.php +++ b/app/Support/Twig/Rule.php @@ -18,7 +18,7 @@ class Rule extends Twig_Extension /** * @return Twig_SimpleFunction */ - public function allJournalTriggers() + public function allJournalTriggers(): Twig_SimpleFunction { return new Twig_SimpleFunction( 'allJournalTriggers', function () { @@ -33,7 +33,7 @@ class Rule extends Twig_Extension /** * @return Twig_SimpleFunction */ - public function allRuleTriggers() + public function allRuleTriggers(): Twig_SimpleFunction { return new Twig_SimpleFunction( 'allRuleTriggers', function () { @@ -56,7 +56,7 @@ class Rule extends Twig_Extension /** * @return Twig_SimpleFunction */ - public function allActionTriggers() + public function allActionTriggers(): Twig_SimpleFunction { return new Twig_SimpleFunction( 'allRuleActions', function () { @@ -76,7 +76,7 @@ class Rule extends Twig_Extension /** * @return array */ - public function getFunctions() + public function getFunctions(): array { return [ $this->allJournalTriggers(), @@ -91,7 +91,7 @@ class Rule extends Twig_Extension * * @return string The extension name */ - public function getName() + public function getName(): string { return 'FireflyIII\Support\Twig\Rule'; } diff --git a/app/Support/Twig/Translation.php b/app/Support/Twig/Translation.php index 028cc814a1..4af3055432 100644 --- a/app/Support/Twig/Translation.php +++ b/app/Support/Twig/Translation.php @@ -7,7 +7,6 @@ use Twig_Extension; use Twig_SimpleFilter; /** - * @codeCoverageIgnore * * Class Budget * @@ -19,7 +18,7 @@ class Translation extends Twig_Extension /** * @return array */ - public function getFilters() + public function getFilters(): array { $filters = []; @@ -37,7 +36,7 @@ class Translation extends Twig_Extension /** * {@inheritDoc} */ - public function getName() + public function getName(): string { return 'FireflyIII\Support\Twig\Translation'; } diff --git a/composer.json b/composer.json index 98a2dd3ee7..b1017007ed 100644 --- a/composer.json +++ b/composer.json @@ -57,6 +57,7 @@ "php artisan key:generate" ], "post-install-cmd": [ + "php artisan cache:clear", "php artisan clear-compiled", "php artisan optimize", "php artisan firefly:upgrade-instructions" @@ -65,6 +66,7 @@ "php artisan clear-compiled" ], "post-update-cmd": [ + "php artisan cache:clear", "php artisan optimize", "php artisan firefly:upgrade-instructions" ] diff --git a/composer.lock b/composer.lock index ca0d8be608..09584c13fc 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "c1638ed0abc18262bab1f791b48af111", + "hash": "eccf1460fa3a4cecc969593ffca9397e", "content-hash": "3551da50dc493828d3ae5d73c10984f0", "packages": [ { @@ -51,16 +51,16 @@ }, { "name": "christian-riesen/base32", - "version": "1.2.2", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/ChristianRiesen/base32.git", - "reference": "fbe67d49d45dc789f942ef828c787550ebb894bc" + "reference": "fde061a370b0a97fdcd33d9d5f7b1b70ce1f79d4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ChristianRiesen/base32/zipball/fbe67d49d45dc789f942ef828c787550ebb894bc", - "reference": "fbe67d49d45dc789f942ef828c787550ebb894bc", + "url": "https://api.github.com/repos/ChristianRiesen/base32/zipball/fde061a370b0a97fdcd33d9d5f7b1b70ce1f79d4", + "reference": "fde061a370b0a97fdcd33d9d5f7b1b70ce1f79d4", "shasum": "" }, "require": { @@ -101,7 +101,7 @@ "encode", "rfc4648" ], - "time": "2015-09-27 23:45:02" + "time": "2016-04-07 07:45:31" }, { "name": "classpreloader/classpreloader", @@ -1245,16 +1245,16 @@ }, { "name": "monolog/monolog", - "version": "1.18.2", + "version": "1.19.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "064b38c16790249488e7a8b987acf1c9d7383c09" + "reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/064b38c16790249488e7a8b987acf1c9d7383c09", - "reference": "064b38c16790249488e7a8b987acf1c9d7383c09", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5f56ed5212dc509c8dc8caeba2715732abb32dbf", + "reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf", "shasum": "" }, "require": { @@ -1319,7 +1319,7 @@ "logging", "psr-3" ], - "time": "2016-04-02 13:12:58" + "time": "2016-04-12 18:29:35" }, { "name": "mtdowling/cron-expression", @@ -2785,16 +2785,16 @@ }, { "name": "watson/validating", - "version": "2.1.1", + "version": "2.2.1", "source": { "type": "git", "url": "https://github.com/dwightwatson/validating.git", - "reference": "f86c284d599a66120c651b9cd41da60eb6124e96" + "reference": "64dc3d211372576d468e2bfaf3c7b7ace66ee970" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dwightwatson/validating/zipball/f86c284d599a66120c651b9cd41da60eb6124e96", - "reference": "f86c284d599a66120c651b9cd41da60eb6124e96", + "url": "https://api.github.com/repos/dwightwatson/validating/zipball/64dc3d211372576d468e2bfaf3c7b7ace66ee970", + "reference": "64dc3d211372576d468e2bfaf3c7b7ace66ee970", "shasum": "" }, "require": { @@ -2836,7 +2836,7 @@ "laravel", "validation" ], - "time": "2016-03-29 13:54:50" + "time": "2016-04-07 14:59:06" } ], "packages-dev": null, diff --git a/config/app.php b/config/app.php index 7efa1d2687..8ba2732c0d 100644 --- a/config/app.php +++ b/config/app.php @@ -108,7 +108,8 @@ return [ | */ - 'log' => env('APP_LOG', 'daily'), + 'log' => env('APP_LOG', 'daily'), + 'log-level' => env('LOG_LEVEL', 'info'), /* |-------------------------------------------------------------------------- diff --git a/config/cache.php b/config/cache.php index 379135b0eb..2a9a8d9613 100644 --- a/config/cache.php +++ b/config/cache.php @@ -74,6 +74,6 @@ return [ | */ - 'prefix' => 'laravel', + 'prefix' => 'firefly', ]; diff --git a/config/firefly.php b/config/firefly.php index 45a42815f5..ec3bb71294 100644 --- a/config/firefly.php +++ b/config/firefly.php @@ -2,7 +2,7 @@ return [ 'chart' => 'chartjs', - 'version' => '3.8.2', + 'version' => '3.8.3', 'index_periods' => ['1D', '1W', '1M', '3M', '6M', '1Y', 'custom'], 'budget_periods' => ['daily', 'weekly', 'monthly', 'quarterly', 'half-year', 'yearly'], 'csv_import_enabled' => true, diff --git a/database/migrations/2016_04_08_181054_changes_for_v383.php b/database/migrations/2016_04_08_181054_changes_for_v383.php new file mode 100644 index 0000000000..d39dcf77fd --- /dev/null +++ b/database/migrations/2016_04_08_181054_changes_for_v383.php @@ -0,0 +1,36 @@ +string('hash', 64)->nullable(); + } + ); + } +} diff --git a/public/bootstrap/css/bootstrap.min.css b/public/bootstrap/css/bootstrap.min.css deleted file mode 100644 index d65c66b1ba..0000000000 --- a/public/bootstrap/css/bootstrap.min.css +++ /dev/null @@ -1,5 +0,0 @@ -/*! - * Bootstrap v3.3.5 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff2) format('woff2'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=checkbox]:focus,input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:14.33px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default.disabled.active,.btn-default.disabled.focus,.btn-default.disabled:active,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled],.btn-default[disabled].active,.btn-default[disabled].focus,.btn-default[disabled]:active,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default,fieldset[disabled] .btn-default.active,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:active,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary.disabled.active,.btn-primary.disabled.focus,.btn-primary.disabled:active,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled],.btn-primary[disabled].active,.btn-primary[disabled].focus,.btn-primary[disabled]:active,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary,fieldset[disabled] .btn-primary.active,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:active,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success.disabled.active,.btn-success.disabled.focus,.btn-success.disabled:active,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled],.btn-success[disabled].active,.btn-success[disabled].focus,.btn-success[disabled]:active,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success,fieldset[disabled] .btn-success.active,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:active,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info.disabled.active,.btn-info.disabled.focus,.btn-info.disabled:active,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled],.btn-info[disabled].active,.btn-info[disabled].focus,.btn-info[disabled]:active,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info,fieldset[disabled] .btn-info.active,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:active,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning.disabled.active,.btn-warning.disabled.focus,.btn-warning.disabled:active,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled],.btn-warning[disabled].active,.btn-warning[disabled].focus,.btn-warning[disabled]:active,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning,fieldset[disabled] .btn-warning.active,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:active,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger.disabled.active,.btn-danger.disabled.focus,.btn-danger.disabled:active,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled],.btn-danger[disabled].active,.btn-danger[disabled].focus,.btn-danger[disabled]:active,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger,fieldset[disabled] .btn-danger.active,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:active,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:3;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:2;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%)}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{min-height:16.43px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;filter:alpha(opacity=0);opacity:0;line-break:auto}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{left:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{left:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-15px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-15px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}} \ No newline at end of file diff --git a/public/bootstrap/js/bootstrap.min.js b/public/bootstrap/js/bootstrap.min.js deleted file mode 100644 index 133aeecb98..0000000000 --- a/public/bootstrap/js/bootstrap.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v3.3.5 (http://getbootstrap.com) - * Copyright 2011-2015 Twitter, Inc. - * Licensed under the MIT license - */ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.5",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.5",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.5",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.5",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.5",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.5",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.5",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); \ No newline at end of file diff --git a/public/js/Chart.StackedBar.js b/public/js/Chart.StackedBar.js deleted file mode 100644 index 71b50ddf11..0000000000 --- a/public/js/Chart.StackedBar.js +++ /dev/null @@ -1,556 +0,0 @@ -(function (factory) { - "use strict"; - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define(['chart.js'], factory); - } else if (typeof exports === 'object') { - // Node/CommonJS - module.exports = factory(require('chart.js')); - } else { - // Global browser - factory(Chart); - } -}(function (Chart) { - "use strict"; - - var helpers = Chart.helpers; - - var defaultConfig = { - scaleBeginAtZero : true, - - //Boolean - Whether grid lines are shown across the chart - scaleShowGridLines : true, - - //String - Colour of the grid lines - scaleGridLineColor : "rgba(0,0,0,.05)", - - //Number - Width of the grid lines - scaleGridLineWidth : 1, - - //Boolean - Whether to show horizontal lines (except X axis) - scaleShowHorizontalLines: true, - - //Boolean - Whether to show vertical lines (except Y axis) - scaleShowVerticalLines: true, - - //Boolean - If there is a stroke on each bar - barShowStroke : true, - - //Number - Pixel width of the bar stroke - barStrokeWidth : 2, - - //Number - Spacing between each of the X value sets - barValueSpacing : 5, - - //Boolean - Whether bars should be rendered on a percentage base - relativeBars : false, - - //String - A legend template - legendTemplate : "
    -legend\"><% for (var i=0; i
  • \"><%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>
", - - //Boolean - Show total legend - showTotal: false, - - //String - Color of total legend - totalColor: '#fff', - - //String - Total Label - totalLabel: 'Total', - - //Boolean - Hide labels with value set to 0 - tooltipHideZero: false - }; - - Chart.Type.extend({ - name: "StackedBar", - defaults : defaultConfig, - initialize: function(data){ - //Expose options as a scope variable here so we can access it in the ScaleClass - var options = this.options; - - // Save data as a source for updating of values & methods - this.data = data; - - this.ScaleClass = Chart.Scale.extend({ - offsetGridLines : true, - calculateBarX : function(barIndex){ - return this.calculateX(barIndex); - }, - calculateBarY : function(datasets, dsIndex, barIndex, value){ - var offset = 0, - sum = 0; - - for(var i = 0; i < datasets.length; i++) { - sum += datasets[i].bars[barIndex].value; - } - for(i = dsIndex; i < datasets.length; i++) { - if(i === dsIndex && value) { - offset += value; - } else { - offset = +offset + +datasets[i].bars[barIndex].value; - } - } - - if(options.relativeBars) { - offset = offset / sum * 100; - } - - return this.calculateY(offset); - }, - calculateBaseWidth : function(){ - return (this.calculateX(1) - this.calculateX(0)) - (2*options.barValueSpacing); - }, - calculateBaseHeight : function(){ - return (this.calculateY(1) - this.calculateY(0)); - }, - calculateBarWidth : function(datasetCount){ - //The padding between datasets is to the right of each bar, providing that there are more than 1 dataset - return this.calculateBaseWidth(); - }, - calculateBarHeight : function(datasets, dsIndex, barIndex, value) { - var sum = 0; - - for(var i = 0; i < datasets.length; i++) { - sum += datasets[i].bars[barIndex].value; - } - - if(!value) { - value = datasets[dsIndex].bars[barIndex].value; - } - - if(options.relativeBars) { - value = value / sum * 100; - } - - return this.calculateY(value); - } - }); - - this.datasets = []; - - //Set up tooltip events on the chart - if (this.options.showTooltips){ - helpers.bindEvents(this, this.options.tooltipEvents, function(evt){ - var activeBars = (evt.type !== 'mouseout') ? this.getBarsAtEvent(evt) : []; - - this.eachBars(function(bar){ - bar.restore(['fillColor', 'strokeColor']); - }); - helpers.each(activeBars, function(activeBar){ - activeBar.fillColor = activeBar.highlightFill; - activeBar.strokeColor = activeBar.highlightStroke; - }); - this.showTooltip(activeBars); - }); - } - - //Declare the extension of the default point, to cater for the options passed in to the constructor - this.BarClass = Chart.Rectangle.extend({ - strokeWidth : this.options.barStrokeWidth, - showStroke : this.options.barShowStroke, - ctx : this.chart.ctx - }); - - //Iterate through each of the datasets, and build this into a property of the chart - helpers.each(data.datasets,function(dataset,datasetIndex){ - - var datasetObject = { - label : dataset.label || null, - fillColor : dataset.fillColor, - strokeColor : dataset.strokeColor, - bars : [] - }; - - this.datasets.push(datasetObject); - - helpers.each(dataset.data,function(dataPoint,index){ - if(!helpers.isNumber(dataPoint)){ - dataPoint = 0; - } - //Add a new point for each piece of data, passing any required data to draw. - //Add 0 as value if !isNumber (e.g. empty values are useful when 0 values should be hidden in tooltip) - datasetObject.bars.push(new this.BarClass({ - value : dataPoint, - label : data.labels[index], - datasetLabel: dataset.label, - strokeColor : dataset.strokeColor, - fillColor : dataset.fillColor, - highlightFill : dataset.highlightFill || dataset.fillColor, - highlightStroke : dataset.highlightStroke || dataset.strokeColor - })); - },this); - - },this); - - this.buildScale(data.labels); - - this.eachBars(function(bar, index, datasetIndex){ - helpers.extend(bar, { - base: this.scale.endPoint, - height: 0, - width : this.scale.calculateBarWidth(this.datasets.length), - x: this.scale.calculateBarX(index), - y: this.scale.endPoint - }); - bar.save(); - }, this); - - this.render(); - }, - showTooltip : function(ChartElements, forceRedraw){ - // Only redraw the chart if we've actually changed what we're hovering on. - if (typeof this.activeElements === 'undefined') this.activeElements = []; - - helpers = Chart.helpers; - - var isChanged = (function(Elements){ - var changed = false; - - if (Elements.length !== this.activeElements.length){ - changed = true; - return changed; - } - - helpers.each(Elements, function(element, index){ - if (element !== this.activeElements[index]){ - changed = true; - } - }, this); - return changed; - }).call(this, ChartElements); - - if (!isChanged && !forceRedraw){ - return; - } - else{ - this.activeElements = ChartElements; - } - this.draw(); - if(this.options.customTooltips){ - this.options.customTooltips(false); - } - if (ChartElements.length > 0){ - // If we have multiple datasets, show a MultiTooltip for all of the data points at that index - if (this.datasets && this.datasets.length > 1) { - var dataArray, - dataIndex; - - for (var i = this.datasets.length - 1; i >= 0; i--) { - dataArray = this.datasets[i].points || this.datasets[i].bars || this.datasets[i].segments; - dataIndex = helpers.indexOf(dataArray, ChartElements[0]); - if (dataIndex !== -1){ - break; - } - } - var tooltipLabels = [], - tooltipColors = [], - medianPosition = (function(index) { - - // Get all the points at that particular index - var Elements = [], - dataCollection, - xPositions = [], - yPositions = [], - xMax, - yMax, - xMin, - yMin; - helpers.each(this.datasets, function(dataset){ - dataCollection = dataset.points || dataset.bars || dataset.segments; - if (dataCollection[dataIndex] && dataCollection[dataIndex].hasValue()){ - Elements.push(dataCollection[dataIndex]); - } - }); - - var total = { - datasetLabel: this.options.totalLabel, - value: 0, - fillColor: this.options.totalColor, - strokeColor: this.options.totalColor - }; - - helpers.each(Elements, function(element) { - if (this.options.tooltipHideZero && element.value === 0) { - return; - } - - xPositions.push(element.x); - yPositions.push(element.y); - - total.value += element.value; - - //Include any colour information about the element - tooltipLabels.push(helpers.template(this.options.multiTooltipTemplate, element)); - tooltipColors.push({ - fill: element._saved.fillColor || element.fillColor, - stroke: element._saved.strokeColor || element.strokeColor - }); - - }, this); - - if (this.options.showTotal) { - tooltipLabels.push(helpers.template(this.options.multiTooltipTemplate, total)); - tooltipColors.push({ - fill: total.fillColor, - stroke: total.strokeColor - }); - } - - yMin = helpers.min(yPositions); - yMax = helpers.max(yPositions); - - xMin = helpers.min(xPositions); - xMax = helpers.max(xPositions); - - return { - x: (xMin > this.chart.width/2) ? xMin : xMax, - y: (yMin + yMax)/2 - }; - }).call(this, dataIndex); - - new Chart.MultiTooltip({ - x: medianPosition.x, - y: medianPosition.y, - xPadding: this.options.tooltipXPadding, - yPadding: this.options.tooltipYPadding, - xOffset: this.options.tooltipXOffset, - fillColor: this.options.tooltipFillColor, - textColor: this.options.tooltipFontColor, - fontFamily: this.options.tooltipFontFamily, - fontStyle: this.options.tooltipFontStyle, - fontSize: this.options.tooltipFontSize, - titleTextColor: this.options.tooltipTitleFontColor, - titleFontFamily: this.options.tooltipTitleFontFamily, - titleFontStyle: this.options.tooltipTitleFontStyle, - titleFontSize: this.options.tooltipTitleFontSize, - cornerRadius: this.options.tooltipCornerRadius, - labels: tooltipLabels, - legendColors: tooltipColors, - legendColorBackground : this.options.multiTooltipKeyBackground, - title: ChartElements[0].label, - chart: this.chart, - ctx: this.chart.ctx, - custom: this.options.customTooltips - }).draw(); - - } else { - helpers.each(ChartElements, function(Element) { - var tooltipPosition = Element.tooltipPosition(); - new Chart.Tooltip({ - x: Math.round(tooltipPosition.x), - y: Math.round(tooltipPosition.y), - xPadding: this.options.tooltipXPadding, - yPadding: this.options.tooltipYPadding, - fillColor: this.options.tooltipFillColor, - textColor: this.options.tooltipFontColor, - fontFamily: this.options.tooltipFontFamily, - fontStyle: this.options.tooltipFontStyle, - fontSize: this.options.tooltipFontSize, - caretHeight: this.options.tooltipCaretSize, - cornerRadius: this.options.tooltipCornerRadius, - text: helpers.template(this.options.tooltipTemplate, Element), - chart: this.chart, - custom: this.options.customTooltips - }).draw(); - }, this); - } - } - return this; - }, - update : function(){ - - //Iterate through each of the datasets, and build this into a property of the chart - helpers.each(this.data.datasets,function(dataset,datasetIndex){ - - helpers.extend(this.datasets[datasetIndex], { - label : dataset.label || null, - fillColor : dataset.fillColor, - strokeColor : dataset.strokeColor, - }); - - helpers.each(dataset.data,function(dataPoint,index){ - helpers.extend(this.datasets[datasetIndex].bars[index], { - value : dataPoint, - label : this.data.labels[index], - datasetLabel: dataset.label, - strokeColor : dataset.strokeColor, - fillColor : dataset.fillColor, - highlightFill : dataset.highlightFill || dataset.fillColor, - highlightStroke : dataset.highlightStroke || dataset.strokeColor - }); - },this); - - },this); - - - this.scale.update(); - // Reset any highlight colours before updating. - helpers.each(this.activeElements, function(activeElement){ - activeElement.restore(['fillColor', 'strokeColor']); - }); - - this.eachBars(function(bar){ - bar.save(); - }); - this.render(); - }, - eachBars : function(callback){ - helpers.each(this.datasets,function(dataset, datasetIndex){ - helpers.each(dataset.bars, callback, this, datasetIndex); - },this); - }, - getBarsAtEvent : function(e){ - var barsArray = [], - eventPosition = helpers.getRelativePosition(e), - datasetIterator = function(dataset){ - barsArray.push(dataset.bars[barIndex]); - }, - barIndex; - - for (var datasetIndex = 0; datasetIndex < this.datasets.length; datasetIndex++) { - for (barIndex = 0; barIndex < this.datasets[datasetIndex].bars.length; barIndex++) { - if (this.datasets[datasetIndex].bars[barIndex].inRange(eventPosition.x,eventPosition.y)){ - helpers.each(this.datasets, datasetIterator); - return barsArray; - } - } - } - - return barsArray; - }, - buildScale : function(labels){ - var self = this; - - var dataTotal = function(){ - var values = []; - helpers.each(self.datasets, function(dataset) { - helpers.each(dataset.bars, function(bar, barIndex) { - if(!values[barIndex]) values[barIndex] = 0; - if(self.options.relativeBars) { - values[barIndex] = 100; - } else { - values[barIndex] = +values[barIndex] + +bar.value; - } - }); - }); - return values; - }; - - var scaleOptions = { - templateString : this.options.scaleLabel, - height : this.chart.height, - width : this.chart.width, - ctx : this.chart.ctx, - textColor : this.options.scaleFontColor, - fontSize : this.options.scaleFontSize, - fontStyle : this.options.scaleFontStyle, - fontFamily : this.options.scaleFontFamily, - valuesCount : labels.length, - beginAtZero : this.options.scaleBeginAtZero, - integersOnly : this.options.scaleIntegersOnly, - calculateYRange: function(currentHeight){ - var updatedRanges = helpers.calculateScaleRange( - dataTotal(), - currentHeight, - this.fontSize, - this.beginAtZero, - this.integersOnly - ); - helpers.extend(this, updatedRanges); - }, - xLabels : this.options.xLabels || labels, - font : helpers.fontString(this.options.scaleFontSize, this.options.scaleFontStyle, this.options.scaleFontFamily), - lineWidth : this.options.scaleLineWidth, - lineColor : this.options.scaleLineColor, - gridLineWidth : (this.options.scaleShowGridLines) ? this.options.scaleGridLineWidth : 0, - gridLineColor : (this.options.scaleShowGridLines) ? this.options.scaleGridLineColor : "rgba(0,0,0,0)", - showHorizontalLines : this.options.scaleShowHorizontalLines, - showVerticalLines : this.options.scaleShowVerticalLines, - padding : (this.options.showScale) ? 0 : (this.options.barShowStroke) ? this.options.barStrokeWidth : 0, - showLabels : this.options.scaleShowLabels, - display : this.options.showScale - }; - - if (this.options.scaleOverride){ - helpers.extend(scaleOptions, { - calculateYRange: helpers.noop, - steps: this.options.scaleSteps, - stepValue: this.options.scaleStepWidth, - min: this.options.scaleStartValue, - max: this.options.scaleStartValue + (this.options.scaleSteps * this.options.scaleStepWidth) - }); - } - - this.scale = new this.ScaleClass(scaleOptions); - }, - addData : function(valuesArray,label){ - //Map the values array for each of the datasets - helpers.each(valuesArray,function(value,datasetIndex){ - if (helpers.isNumber(value)){ - //Add a new point for each piece of data, passing any required data to draw. - //Add 0 as value if !isNumber (e.g. empty values are useful when 0 values should be hidden in tooltip) - this.datasets[datasetIndex].bars.push(new this.BarClass({ - value : helpers.isNumber(value)?value:0, - label : label, - x: this.scale.calculateBarX(this.scale.valuesCount+1), - y: this.scale.endPoint, - width : this.scale.calculateBarWidth(this.datasets.length), - base : this.scale.endPoint, - strokeColor : this.datasets[datasetIndex].strokeColor, - fillColor : this.datasets[datasetIndex].fillColor - })); - } - },this); - - this.scale.addXLabel(label); - //Then re-render the chart. - this.update(); - }, - removeData : function(){ - this.scale.removeXLabel(); - //Then re-render the chart. - helpers.each(this.datasets,function(dataset){ - dataset.bars.shift(); - },this); - this.update(); - }, - reflow : function(){ - helpers.extend(this.BarClass.prototype,{ - y: this.scale.endPoint, - base : this.scale.endPoint - }); - var newScaleProps = helpers.extend({ - height : this.chart.height, - width : this.chart.width - }); - this.scale.update(newScaleProps); - }, - draw : function(ease){ - var easingDecimal = ease || 1; - this.clear(); - - var ctx = this.chart.ctx; - - this.scale.draw(easingDecimal); - - //Draw all the bars for each dataset - helpers.each(this.datasets,function(dataset,datasetIndex){ - helpers.each(dataset.bars,function(bar,index){ - var y = this.scale.calculateBarY(this.datasets, datasetIndex, index, bar.value), - height = this.scale.calculateBarHeight(this.datasets, datasetIndex, index, bar.value); - - //Transition then draw - if(bar.value > 0) { - bar.transition({ - base : this.scale.endPoint - (Math.abs(height) - Math.abs(y)), - x : this.scale.calculateBarX(index), - y : Math.abs(y), - height : Math.abs(height), - width : this.scale.calculateBarWidth(this.datasets.length) - }, easingDecimal).draw(); - } - },this); - },this); - } - }); -})); diff --git a/public/js/Chart.min.js b/public/js/Chart.min.js deleted file mode 100644 index 3a0a2c8734..0000000000 --- a/public/js/Chart.min.js +++ /dev/null @@ -1,11 +0,0 @@ -/*! - * Chart.js - * http://chartjs.org/ - * Version: 1.0.2 - * - * Copyright 2015 Nick Downie - * Released under the MIT license - * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md - */ -(function(){"use strict";var t=this,i=t.Chart,e=function(t){this.canvas=t.canvas,this.ctx=t;var i=function(t,i){return t["offset"+i]?t["offset"+i]:document.defaultView.getComputedStyle(t).getPropertyValue(i)},e=this.width=i(t.canvas,"Width"),n=this.height=i(t.canvas,"Height");t.canvas.width=e,t.canvas.height=n;var e=this.width=t.canvas.width,n=this.height=t.canvas.height;return this.aspectRatio=this.width/this.height,s.retinaScale(this),this};e.defaults={global:{animation:!0,animationSteps:60,animationEasing:"easeOutQuart",showScale:!0,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleIntegersOnly:!0,scaleBeginAtZero:!1,scaleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",responsive:!1,maintainAspectRatio:!0,showTooltips:!0,customTooltips:!1,tooltipEvents:["mousemove","touchstart","touchmove","mouseout"],tooltipFillColor:"rgba(0,0,0,0.8)",tooltipFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipFontSize:14,tooltipFontStyle:"normal",tooltipFontColor:"#fff",tooltipTitleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipTitleFontSize:14,tooltipTitleFontStyle:"bold",tooltipTitleFontColor:"#fff",tooltipYPadding:6,tooltipXPadding:6,tooltipCaretSize:8,tooltipCornerRadius:6,tooltipXOffset:10,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>",multiTooltipTemplate:"<%= value %>",multiTooltipKeyBackground:"#fff",onAnimationProgress:function(){},onAnimationComplete:function(){}}},e.types={};var s=e.helpers={},n=s.each=function(t,i,e){var s=Array.prototype.slice.call(arguments,3);if(t)if(t.length===+t.length){var n;for(n=0;n=0;s--){var n=t[s];if(i(n))return n}},s.inherits=function(t){var i=this,e=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return i.apply(this,arguments)},s=function(){this.constructor=e};return s.prototype=i.prototype,e.prototype=new s,e.extend=r,t&&a(e.prototype,t),e.__super__=i.prototype,e}),c=s.noop=function(){},u=s.uid=function(){var t=0;return function(){return"chart-"+t++}}(),d=s.warn=function(t){window.console&&"function"==typeof window.console.warn&&console.warn(t)},p=s.amd="function"==typeof define&&define.amd,f=s.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},g=s.max=function(t){return Math.max.apply(Math,t)},m=s.min=function(t){return Math.min.apply(Math,t)},v=(s.cap=function(t,i,e){if(f(i)){if(t>i)return i}else if(f(e)&&e>t)return e;return t},s.getDecimalPlaces=function(t){return t%1!==0&&f(t)?t.toString().split(".")[1].length:0}),S=s.radians=function(t){return t*(Math.PI/180)},x=(s.getAngleFromPoint=function(t,i){var e=i.x-t.x,s=i.y-t.y,n=Math.sqrt(e*e+s*s),o=2*Math.PI+Math.atan2(s,e);return 0>e&&0>s&&(o+=2*Math.PI),{angle:o,distance:n}},s.aliasPixel=function(t){return t%2===0?0:.5}),y=(s.splineCurve=function(t,i,e,s){var n=Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2)),o=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),a=s*n/(n+o),h=s*o/(n+o);return{inner:{x:i.x-a*(e.x-t.x),y:i.y-a*(e.y-t.y)},outer:{x:i.x+h*(e.x-t.x),y:i.y+h*(e.y-t.y)}}},s.calculateOrderOfMagnitude=function(t){return Math.floor(Math.log(t)/Math.LN10)}),C=(s.calculateScaleRange=function(t,i,e,s,n){var o=2,a=Math.floor(i/(1.5*e)),h=o>=a,l=g(t),r=m(t);l===r&&(l+=.5,r>=.5&&!s?r-=.5:l+=.5);for(var c=Math.abs(l-r),u=y(c),d=Math.ceil(l/(1*Math.pow(10,u)))*Math.pow(10,u),p=s?0:Math.floor(r/(1*Math.pow(10,u)))*Math.pow(10,u),f=d-p,v=Math.pow(10,u),S=Math.round(f/v);(S>a||a>2*S)&&!h;)if(S>a)v*=2,S=Math.round(f/v),S%1!==0&&(h=!0);else if(n&&u>=0){if(v/2%1!==0)break;v/=2,S=Math.round(f/v)}else v/=2,S=Math.round(f/v);return h&&(S=o,v=f/S),{steps:S,stepValue:v,min:p,max:p+S*v}},s.template=function(t,i){function e(t,i){var e=/\W/.test(t)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+t.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):s[t]=s[t];return i?e(i):e}if(t instanceof Function)return t(i);var s={};return e(t,i)}),w=(s.generateLabels=function(t,i,e,s){var o=new Array(i);return labelTemplateString&&n(o,function(i,n){o[n]=C(t,{value:e+s*(n+1)})}),o},s.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-0.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-1)*t*t+1)},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-0.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-1)*t*t*t*t+1)},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return-1*Math.cos(t/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-0.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-0.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:1==(t/=1)?1:(e||(e=.3),st?-.5*s*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e):s*Math.pow(2,-10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e)*.5+1)},easeInBack:function(t){var i=1.70158;return 1*(t/=1)*t*((i+1)*t-i)},easeOutBack:function(t){var i=1.70158;return 1*((t=t/1-1)*t*((i+1)*t+i)+1)},easeInOutBack:function(t){var i=1.70158;return(t/=.5)<1?.5*t*t*(((i*=1.525)+1)*t-i):.5*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)},easeInBounce:function(t){return 1-w.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?7.5625*t*t:2/2.75>t?1*(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return.5>t?.5*w.easeInBounce(2*t):.5*w.easeOutBounce(2*t-1)+.5}}),b=s.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),P=s.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t,1e3/60)}}(),L=(s.animationLoop=function(t,i,e,s,n,o){var a=0,h=w[e]||w.linear,l=function(){a++;var e=a/i,r=h(e);t.call(o,r,e,a),s.call(o,r,e),i>a?o.animationFrame=b(l):n.apply(o)};b(l)},s.getRelativePosition=function(t){var i,e,s=t.originalEvent||t,n=t.currentTarget||t.srcElement,o=n.getBoundingClientRect();return s.touches?(i=s.touches[0].clientX-o.left,e=s.touches[0].clientY-o.top):(i=s.clientX-o.left,e=s.clientY-o.top),{x:i,y:e}},s.addEvent=function(t,i,e){t.addEventListener?t.addEventListener(i,e):t.attachEvent?t.attachEvent("on"+i,e):t["on"+i]=e}),k=s.removeEvent=function(t,i,e){t.removeEventListener?t.removeEventListener(i,e,!1):t.detachEvent?t.detachEvent("on"+i,e):t["on"+i]=c},F=(s.bindEvents=function(t,i,e){t.events||(t.events={}),n(i,function(i){t.events[i]=function(){e.apply(t,arguments)},L(t.chart.canvas,i,t.events[i])})},s.unbindEvents=function(t,i){n(i,function(i,e){k(t.chart.canvas,e,i)})}),R=s.getMaximumWidth=function(t){var i=t.parentNode;return i.clientWidth},T=s.getMaximumHeight=function(t){var i=t.parentNode;return i.clientHeight},A=(s.getMaximumSize=s.getMaximumWidth,s.retinaScale=function(t){var i=t.ctx,e=t.canvas.width,s=t.canvas.height;window.devicePixelRatio&&(i.canvas.style.width=e+"px",i.canvas.style.height=s+"px",i.canvas.height=s*window.devicePixelRatio,i.canvas.width=e*window.devicePixelRatio,i.scale(window.devicePixelRatio,window.devicePixelRatio))}),M=s.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},W=s.fontString=function(t,i,e){return i+" "+t+"px "+e},z=s.longestText=function(t,i,e){t.font=i;var s=0;return n(e,function(i){var e=t.measureText(i).width;s=e>s?e:s}),s},B=s.drawRoundedRectangle=function(t,i,e,s,n,o){t.beginPath(),t.moveTo(i+o,e),t.lineTo(i+s-o,e),t.quadraticCurveTo(i+s,e,i+s,e+o),t.lineTo(i+s,e+n-o),t.quadraticCurveTo(i+s,e+n,i+s-o,e+n),t.lineTo(i+o,e+n),t.quadraticCurveTo(i,e+n,i,e+n-o),t.lineTo(i,e+o),t.quadraticCurveTo(i,e,i+o,e),t.closePath()};e.instances={},e.Type=function(t,i,s){this.options=i,this.chart=s,this.id=u(),e.instances[this.id]=this,i.responsive&&this.resize(),this.initialize.call(this,t)},a(e.Type.prototype,{initialize:function(){return this},clear:function(){return M(this.chart),this},stop:function(){return P(this.animationFrame),this},resize:function(t){this.stop();var i=this.chart.canvas,e=R(this.chart.canvas),s=this.options.maintainAspectRatio?e/this.chart.aspectRatio:T(this.chart.canvas);return i.width=this.chart.width=e,i.height=this.chart.height=s,A(this.chart),"function"==typeof t&&t.apply(this,Array.prototype.slice.call(arguments,1)),this},reflow:c,render:function(t){return t&&this.reflow(),this.options.animation&&!t?s.animationLoop(this.draw,this.options.animationSteps,this.options.animationEasing,this.options.onAnimationProgress,this.options.onAnimationComplete,this):(this.draw(),this.options.onAnimationComplete.call(this)),this},generateLegend:function(){return C(this.options.legendTemplate,this)},destroy:function(){this.clear(),F(this,this.events);var t=this.chart.canvas;t.width=this.chart.width,t.height=this.chart.height,t.style.removeProperty?(t.style.removeProperty("width"),t.style.removeProperty("height")):(t.style.removeAttribute("width"),t.style.removeAttribute("height")),delete e.instances[this.id]},showTooltip:function(t,i){"undefined"==typeof this.activeElements&&(this.activeElements=[]);var o=function(t){var i=!1;return t.length!==this.activeElements.length?i=!0:(n(t,function(t,e){t!==this.activeElements[e]&&(i=!0)},this),i)}.call(this,t);if(o||i){if(this.activeElements=t,this.draw(),this.options.customTooltips&&this.options.customTooltips(!1),t.length>0)if(this.datasets&&this.datasets.length>1){for(var a,h,r=this.datasets.length-1;r>=0&&(a=this.datasets[r].points||this.datasets[r].bars||this.datasets[r].segments,h=l(a,t[0]),-1===h);r--);var c=[],u=[],d=function(){var t,i,e,n,o,a=[],l=[],r=[];return s.each(this.datasets,function(i){t=i.points||i.bars||i.segments,t[h]&&t[h].hasValue()&&a.push(t[h])}),s.each(a,function(t){l.push(t.x),r.push(t.y),c.push(s.template(this.options.multiTooltipTemplate,t)),u.push({fill:t._saved.fillColor||t.fillColor,stroke:t._saved.strokeColor||t.strokeColor})},this),o=m(r),e=g(r),n=m(l),i=g(l),{x:n>this.chart.width/2?n:i,y:(o+e)/2}}.call(this,h);new e.MultiTooltip({x:d.x,y:d.y,xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,xOffset:this.options.tooltipXOffset,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,titleTextColor:this.options.tooltipTitleFontColor,titleFontFamily:this.options.tooltipTitleFontFamily,titleFontStyle:this.options.tooltipTitleFontStyle,titleFontSize:this.options.tooltipTitleFontSize,cornerRadius:this.options.tooltipCornerRadius,labels:c,legendColors:u,legendColorBackground:this.options.multiTooltipKeyBackground,title:t[0].label,chart:this.chart,ctx:this.chart.ctx,custom:this.options.customTooltips}).draw()}else n(t,function(t){var i=t.tooltipPosition();new e.Tooltip({x:Math.round(i.x),y:Math.round(i.y),xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,caretHeight:this.options.tooltipCaretSize,cornerRadius:this.options.tooltipCornerRadius,text:C(this.options.tooltipTemplate,t),chart:this.chart,custom:this.options.customTooltips}).draw()},this);return this}},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)}}),e.Type.extend=function(t){var i=this,s=function(){return i.apply(this,arguments)};if(s.prototype=o(i.prototype),a(s.prototype,t),s.extend=e.Type.extend,t.name||i.prototype.name){var n=t.name||i.prototype.name,l=e.defaults[i.prototype.name]?o(e.defaults[i.prototype.name]):{};e.defaults[n]=a(l,t.defaults),e.types[n]=s,e.prototype[n]=function(t,i){var o=h(e.defaults.global,e.defaults[n],i||{});return new s(t,o,this)}}else d("Name not provided for this chart, so it hasn't been registered");return i},e.Element=function(t){a(this,t),this.initialize.apply(this,arguments),this.save()},a(e.Element.prototype,{initialize:function(){},restore:function(t){return t?n(t,function(t){this[t]=this._saved[t]},this):a(this,this._saved),this},save:function(){return this._saved=o(this),delete this._saved._saved,this},update:function(t){return n(t,function(t,i){this._saved[i]=this[i],this[i]=t},this),this},transition:function(t,i){return n(t,function(t,e){this[e]=(t-this._saved[e])*i+this._saved[e]},this),this},tooltipPosition:function(){return{x:this.x,y:this.y}},hasValue:function(){return f(this.value)}}),e.Element.extend=r,e.Point=e.Element.extend({display:!0,inRange:function(t,i){var e=this.hitDetectionRadius+this.radius;return Math.pow(t-this.x,2)+Math.pow(i-this.y,2)=this.startAngle&&e.angle<=this.endAngle,o=e.distance>=this.innerRadius&&e.distance<=this.outerRadius;return n&&o},tooltipPosition:function(){var t=this.startAngle+(this.endAngle-this.startAngle)/2,i=(this.outerRadius-this.innerRadius)/2+this.innerRadius;return{x:this.x+Math.cos(t)*i,y:this.y+Math.sin(t)*i}},draw:function(t){var i=this.ctx;i.beginPath(),i.arc(this.x,this.y,this.outerRadius,this.startAngle,this.endAngle),i.arc(this.x,this.y,this.innerRadius,this.endAngle,this.startAngle,!0),i.closePath(),i.strokeStyle=this.strokeColor,i.lineWidth=this.strokeWidth,i.fillStyle=this.fillColor,i.fill(),i.lineJoin="bevel",this.showStroke&&i.stroke()}}),e.Rectangle=e.Element.extend({draw:function(){var t=this.ctx,i=this.width/2,e=this.x-i,s=this.x+i,n=this.base-(this.base-this.y),o=this.strokeWidth/2;this.showStroke&&(e+=o,s-=o,n+=o),t.beginPath(),t.fillStyle=this.fillColor,t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.moveTo(e,this.base),t.lineTo(e,n),t.lineTo(s,n),t.lineTo(s,this.base),t.fill(),this.showStroke&&t.stroke()},height:function(){return this.base-this.y},inRange:function(t,i){return t>=this.x-this.width/2&&t<=this.x+this.width/2&&i>=this.y&&i<=this.base}}),e.Tooltip=e.Element.extend({draw:function(){var t=this.chart.ctx;t.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.xAlign="center",this.yAlign="above";var i=this.caretPadding=2,e=t.measureText(this.text).width+2*this.xPadding,s=this.fontSize+2*this.yPadding,n=s+this.caretHeight+i;this.x+e/2>this.chart.width?this.xAlign="left":this.x-e/2<0&&(this.xAlign="right"),this.y-n<0&&(this.yAlign="below");var o=this.x-e/2,a=this.y-n;if(t.fillStyle=this.fillColor,this.custom)this.custom(this);else{switch(this.yAlign){case"above":t.beginPath(),t.moveTo(this.x,this.y-i),t.lineTo(this.x+this.caretHeight,this.y-(i+this.caretHeight)),t.lineTo(this.x-this.caretHeight,this.y-(i+this.caretHeight)),t.closePath(),t.fill();break;case"below":a=this.y+i+this.caretHeight,t.beginPath(),t.moveTo(this.x,this.y+i),t.lineTo(this.x+this.caretHeight,this.y+i+this.caretHeight),t.lineTo(this.x-this.caretHeight,this.y+i+this.caretHeight),t.closePath(),t.fill()}switch(this.xAlign){case"left":o=this.x-e+(this.cornerRadius+this.caretHeight);break;case"right":o=this.x-(this.cornerRadius+this.caretHeight)}B(t,o,a,e,s,this.cornerRadius),t.fill(),t.fillStyle=this.textColor,t.textAlign="center",t.textBaseline="middle",t.fillText(this.text,o+e/2,a+s/2)}}}),e.MultiTooltip=e.Element.extend({initialize:function(){this.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.titleFont=W(this.titleFontSize,this.titleFontStyle,this.titleFontFamily),this.height=this.labels.length*this.fontSize+(this.labels.length-1)*(this.fontSize/2)+2*this.yPadding+1.5*this.titleFontSize,this.ctx.font=this.titleFont;var t=this.ctx.measureText(this.title).width,i=z(this.ctx,this.font,this.labels)+this.fontSize+3,e=g([i,t]);this.width=e+2*this.xPadding;var s=this.height/2;this.y-s<0?this.y=s:this.y+s>this.chart.height&&(this.y=this.chart.height-s),this.x>this.chart.width/2?this.x-=this.xOffset+this.width:this.x+=this.xOffset},getLineHeight:function(t){var i=this.y-this.height/2+this.yPadding,e=t-1;return 0===t?i+this.titleFontSize/2:i+(1.5*this.fontSize*e+this.fontSize/2)+1.5*this.titleFontSize},draw:function(){if(this.custom)this.custom(this);else{B(this.ctx,this.x,this.y-this.height/2,this.width,this.height,this.cornerRadius);var t=this.ctx;t.fillStyle=this.fillColor,t.fill(),t.closePath(),t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.titleTextColor,t.font=this.titleFont,t.fillText(this.title,this.x+this.xPadding,this.getLineHeight(0)),t.font=this.font,s.each(this.labels,function(i,e){t.fillStyle=this.textColor,t.fillText(i,this.x+this.xPadding+this.fontSize+3,this.getLineHeight(e+1)),t.fillStyle=this.legendColorBackground,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize),t.fillStyle=this.legendColors[e].fill,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize)},this)}}}),e.Scale=e.Element.extend({initialize:function(){this.fit()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}));this.yLabelWidth=this.display&&this.showLabels?z(this.ctx,this.font,this.yLabels):0},addXLabel:function(t){this.xLabels.push(t),this.valuesCount++,this.fit()},removeXLabel:function(){this.xLabels.shift(),this.valuesCount--,this.fit()},fit:function(){this.startPoint=this.display?this.fontSize:0,this.endPoint=this.display?this.height-1.5*this.fontSize-5:this.height,this.startPoint+=this.padding,this.endPoint-=this.padding;var t,i=this.endPoint-this.startPoint;for(this.calculateYRange(i),this.buildYLabels(),this.calculateXLabelRotation();i>this.endPoint-this.startPoint;)i=this.endPoint-this.startPoint,t=this.yLabelWidth,this.calculateYRange(i),this.buildYLabels(),tthis.yLabelWidth+10?e/2:this.yLabelWidth+10,this.xLabelRotation=0,this.display){var n,o=z(this.ctx,this.font,this.xLabels);this.xLabelWidth=o;for(var a=Math.floor(this.calculateX(1)-this.calculateX(0))-6;this.xLabelWidth>a&&0===this.xLabelRotation||this.xLabelWidth>a&&this.xLabelRotation<=90&&this.xLabelRotation>0;)n=Math.cos(S(this.xLabelRotation)),t=n*e,i=n*s,t+this.fontSize/2>this.yLabelWidth+8&&(this.xScalePaddingLeft=t+this.fontSize/2),this.xScalePaddingRight=this.fontSize/2,this.xLabelRotation++,this.xLabelWidth=n*o;this.xLabelRotation>0&&(this.endPoint-=Math.sin(S(this.xLabelRotation))*o+3)}else this.xLabelWidth=0,this.xScalePaddingRight=this.padding,this.xScalePaddingLeft=this.padding},calculateYRange:c,drawingArea:function(){return this.startPoint-this.endPoint},calculateY:function(t){var i=this.drawingArea()/(this.min-this.max);return this.endPoint-i*(t-this.min)},calculateX:function(t){var i=(this.xLabelRotation>0,this.width-(this.xScalePaddingLeft+this.xScalePaddingRight)),e=i/Math.max(this.valuesCount-(this.offsetGridLines?0:1),1),s=e*t+this.xScalePaddingLeft;return this.offsetGridLines&&(s+=e/2),Math.round(s)},update:function(t){s.extend(this,t),this.fit()},draw:function(){var t=this.ctx,i=(this.endPoint-this.startPoint)/this.steps,e=Math.round(this.xScalePaddingLeft);this.display&&(t.fillStyle=this.textColor,t.font=this.font,n(this.yLabels,function(n,o){var a=this.endPoint-i*o,h=Math.round(a),l=this.showHorizontalLines;t.textAlign="right",t.textBaseline="middle",this.showLabels&&t.fillText(n,e-10,a),0!==o||l||(l=!0),l&&t.beginPath(),o>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),h+=s.aliasPixel(t.lineWidth),l&&(t.moveTo(e,h),t.lineTo(this.width,h),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(e-5,h),t.lineTo(e,h),t.stroke(),t.closePath()},this),n(this.xLabels,function(i,e){var s=this.calculateX(e)+x(this.lineWidth),n=this.calculateX(e-(this.offsetGridLines?.5:0))+x(this.lineWidth),o=this.xLabelRotation>0,a=this.showVerticalLines;0!==e||a||(a=!0),a&&t.beginPath(),e>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),a&&(t.moveTo(n,this.endPoint),t.lineTo(n,this.startPoint-3),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(n,this.endPoint),t.lineTo(n,this.endPoint+5),t.stroke(),t.closePath(),t.save(),t.translate(s,o?this.endPoint+12:this.endPoint+8),t.rotate(-1*S(this.xLabelRotation)),t.font=this.font,t.textAlign=o?"right":"center",t.textBaseline=o?"middle":"top",t.fillText(i,0,0),t.restore()},this))}}),e.RadialScale=e.Element.extend({initialize:function(){this.size=m([this.height,this.width]),this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2},calculateCenterOffset:function(t){var i=this.drawingArea/(this.max-this.min);return(t-this.min)*i},update:function(){this.lineArc?this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2:this.setScaleSize(),this.buildYLabels()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}))},getCircumference:function(){return 2*Math.PI/this.valuesCount},setScaleSize:function(){var t,i,e,s,n,o,a,h,l,r,c,u,d=m([this.height/2-this.pointLabelFontSize-5,this.width/2]),p=this.width,g=0;for(this.ctx.font=W(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),i=0;ip&&(p=t.x+s,n=i),t.x-sp&&(p=t.x+e,n=i):i>this.valuesCount/2&&t.x-e0){var s,n=e*(this.drawingArea/this.steps),o=this.yCenter-n;if(this.lineWidth>0)if(t.strokeStyle=this.lineColor,t.lineWidth=this.lineWidth,this.lineArc)t.beginPath(),t.arc(this.xCenter,this.yCenter,n,0,2*Math.PI),t.closePath(),t.stroke();else{t.beginPath();for(var a=0;a=0;i--){if(this.angleLineWidth>0){var e=this.getPointPosition(i,this.calculateCenterOffset(this.max));t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(e.x,e.y),t.stroke(),t.closePath()}var s=this.getPointPosition(i,this.calculateCenterOffset(this.max)+5);t.font=W(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),t.fillStyle=this.pointLabelFontColor;var o=this.labels.length,a=this.labels.length/2,h=a/2,l=h>i||i>o-h,r=i===h||i===o-h;t.textAlign=0===i?"center":i===a?"center":a>i?"left":"right",t.textBaseline=r?"middle":l?"bottom":"top",t.fillText(this.labels[i],s.x,s.y)}}}}}),s.addEvent(window,"resize",function(){var t;return function(){clearTimeout(t),t=setTimeout(function(){n(e.instances,function(t){t.options.responsive&&t.resize(t.render,!0)})},50)}}()),p?define(function(){return e}):"object"==typeof module&&module.exports&&(module.exports=e),t.Chart=e,e.noConflict=function(){return t.Chart=i,e}}).call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleBeginAtZero:!0,scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,legendTemplate:'
    <% for (var i=0; i
  • <%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>
'};i.Type.extend({name:"Bar",defaults:s,initialize:function(t){var s=this.options;this.ScaleClass=i.Scale.extend({offsetGridLines:!0,calculateBarX:function(t,i,e){var n=this.calculateBaseWidth(),o=this.calculateX(e)-n/2,a=this.calculateBarWidth(t);return o+a*i+i*s.barDatasetSpacing+a/2},calculateBaseWidth:function(){return this.calculateX(1)-this.calculateX(0)-2*s.barValueSpacing},calculateBarWidth:function(t){var i=this.calculateBaseWidth()-(t-1)*s.barDatasetSpacing;return i/t}}),this.datasets=[],this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getBarsAtEvent(t):[];this.eachBars(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),this.BarClass=i.Rectangle.extend({strokeWidth:this.options.barStrokeWidth,showStroke:this.options.barShowStroke,ctx:this.chart.ctx}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,bars:[]};this.datasets.push(s),e.each(i.data,function(e,n){s.bars.push(new this.BarClass({value:e,label:t.labels[n],datasetLabel:i.label,strokeColor:i.strokeColor,fillColor:i.fillColor,highlightFill:i.highlightFill||i.fillColor,highlightStroke:i.highlightStroke||i.strokeColor}))},this)},this),this.buildScale(t.labels),this.BarClass.prototype.base=this.scale.endPoint,this.eachBars(function(t,i,s){e.extend(t,{width:this.scale.calculateBarWidth(this.datasets.length),x:this.scale.calculateBarX(this.datasets.length,s,i),y:this.scale.endPoint}),t.save()},this),this.render()},update:function(){this.scale.update(),e.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachBars(function(t){t.save()}),this.render()},eachBars:function(t){e.each(this.datasets,function(i,s){e.each(i.bars,t,this,s)},this)},getBarsAtEvent:function(t){for(var i,s=[],n=e.getRelativePosition(t),o=function(t){s.push(t.bars[i])},a=0;a<% for (var i=0; i
  • <%if(segments[i].label){%><%=segments[i].label%><%}%>
  • <%}%>'};i.Type.extend({name:"Doughnut",defaults:s,initialize:function(t){this.segments=[],this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,this.SegmentArc=i.Arc.extend({ctx:this.chart.ctx,x:this.chart.width/2,y:this.chart.height/2}),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.calculateTotal(t),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({value:t.value,outerRadius:this.options.animateScale?0:this.outerRadius,innerRadius:this.options.animateScale?0:this.outerRadius/100*this.options.percentageInnerCutout,fillColor:t.color,highlightColor:t.highlight||t.color,showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,startAngle:1.5*Math.PI,circumference:this.options.animateRotate?0:this.calculateCircumference(t.value),label:t.label})),e||(this.reflow(),this.update())},calculateCircumference:function(t){return 2*Math.PI*(Math.abs(t)/this.total)},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=Math.abs(t.value)},this)},update:function(){this.calculateTotal(this.segments),e.each(this.activeElements,function(t){t.restore(["fillColor"])}),e.each(this.segments,function(t){t.save()}),this.render()},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,e.each(this.segments,function(t){t.update({outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout})},this)},draw:function(t){var i=t?t:1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.calculateCircumference(t.value),outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout},i),t.endAngle=t.startAngle+t.circumference,t.draw(),0===e&&(t.startAngle=1.5*Math.PI),e<% for (var i=0; i
  • <%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>'};i.Type.extend({name:"Line",defaults:s,initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx,inRange:function(t){return Math.pow(t-this.x,2)0&&ithis.scale.endPoint?t.controlPoints.outer.y=this.scale.endPoint:t.controlPoints.outer.ythis.scale.endPoint?t.controlPoints.inner.y=this.scale.endPoint:t.controlPoints.inner.y0&&(s.lineTo(h[h.length-1].x,this.scale.endPoint),s.lineTo(h[0].x,this.scale.endPoint),s.fillStyle=t.fillColor,s.closePath(),s.fill()),e.each(h,function(t){t.draw()})},this)}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBeginAtZero:!0,scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,scaleShowLine:!0,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'
      <% for (var i=0; i
    • <%if(segments[i].label){%><%=segments[i].label%><%}%>
    • <%}%>
    '};i.Type.extend({name:"PolarArea",defaults:s,initialize:function(t){this.segments=[],this.SegmentArc=i.Arc.extend({showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,ctx:this.chart.ctx,innerRadius:0,x:this.chart.width/2,y:this.chart.height/2}),this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,lineArc:!0,width:this.chart.width,height:this.chart.height,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,valuesCount:t.length}),this.updateScaleRange(t),this.scale.update(),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({fillColor:t.color,highlightColor:t.highlight||t.color,label:t.label,value:t.value,outerRadius:this.options.animateScale?0:this.scale.calculateCenterOffset(t.value),circumference:this.options.animateRotate?0:this.scale.getCircumference(),startAngle:1.5*Math.PI})),e||(this.reflow(),this.update())},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=t.value},this),this.scale.valuesCount=this.segments.length},updateScaleRange:function(t){var i=[];e.each(t,function(t){i.push(t.value)});var s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s,{size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2})},update:function(){this.calculateTotal(this.segments),e.each(this.segments,function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.updateScaleRange(this.segments),this.scale.update(),e.extend(this.scale,{xCenter:this.chart.width/2,yCenter:this.chart.height/2}),e.each(this.segments,function(t){t.update({outerRadius:this.scale.calculateCenterOffset(t.value)})},this)},draw:function(t){var i=t||1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.scale.getCircumference(),outerRadius:this.scale.calculateCenterOffset(t.value)},i),t.endAngle=t.startAngle+t.circumference,0===e&&(t.startAngle=1.5*Math.PI),e<% for (var i=0; i
  • <%if(datasets[i].label){%><%=datasets[i].label%><%}%>
  • <%}%>'},initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx}),this.datasets=[],this.buildScale(t),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,pointColor:i.pointColor,pointStrokeColor:i.pointStrokeColor,points:[]};this.datasets.push(s),e.each(i.data,function(e,n){var o;this.scale.animation||(o=this.scale.getPointPosition(n,this.scale.calculateCenterOffset(e))),s.points.push(new this.PointClass({value:e,label:t.labels[n],datasetLabel:i.label,x:this.options.animation?this.scale.xCenter:o.x,y:this.options.animation?this.scale.yCenter:o.y,strokeColor:i.pointStrokeColor,fillColor:i.pointColor,highlightFill:i.pointHighlightFill||i.pointColor,highlightStroke:i.pointHighlightStroke||i.pointStrokeColor}))},this)},this),this.render()},eachPoints:function(t){e.each(this.datasets,function(i){e.each(i.points,t,this)},this)},getPointsAtEvent:function(t){var i=e.getRelativePosition(t),s=e.getAngleFromPoint({x:this.scale.xCenter,y:this.scale.yCenter},i),n=2*Math.PI/this.scale.valuesCount,o=Math.round((s.angle-1.5*Math.PI)/n),a=[];return(o>=this.scale.valuesCount||0>o)&&(o=0),s.distance<=this.scale.drawingArea&&e.each(this.datasets,function(t){a.push(t.points[o])}),a},buildScale:function(t){this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,angleLineColor:this.options.angleLineColor,angleLineWidth:this.options.angleShowLineOut?this.options.angleLineWidth:0,pointLabelFontColor:this.options.pointLabelFontColor,pointLabelFontSize:this.options.pointLabelFontSize,pointLabelFontFamily:this.options.pointLabelFontFamily,pointLabelFontStyle:this.options.pointLabelFontStyle,height:this.chart.height,width:this.chart.width,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,labels:t.labels,valuesCount:t.datasets[0].data.length}),this.scale.setScaleSize(),this.updateScaleRange(t.datasets),this.scale.buildYLabels()},updateScaleRange:function(t){var i=function(){var i=[];return e.each(t,function(t){t.data?i=i.concat(t.data):e.each(t.points,function(t){i.push(t.value)})}),i}(),s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s)},addData:function(t,i){this.scale.valuesCount++,e.each(t,function(t,e){var s=this.scale.getPointPosition(this.scale.valuesCount,this.scale.calculateCenterOffset(t));this.datasets[e].points.push(new this.PointClass({value:t,label:i,x:s.x,y:s.y,strokeColor:this.datasets[e].pointStrokeColor,fillColor:this.datasets[e].pointColor}))},this),this.scale.labels.push(i),this.reflow(),this.update()},removeData:function(){this.scale.valuesCount--,this.scale.labels.shift(),e.each(this.datasets,function(t){t.points.shift()},this),this.reflow(),this.update()},update:function(){this.eachPoints(function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.scale,{width:this.chart.width,height:this.chart.height,size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2}),this.updateScaleRange(this.datasets),this.scale.setScaleSize(),this.scale.buildYLabels()},draw:function(t){var i=t||1,s=this.chart.ctx;this.clear(),this.scale.draw(),e.each(this.datasets,function(t){e.each(t.points,function(t,e){t.hasValue()&&t.transition(this.scale.getPointPosition(e,this.scale.calculateCenterOffset(t.value)),i)},this),s.lineWidth=this.options.datasetStrokeWidth,s.strokeStyle=t.strokeColor,s.beginPath(),e.each(t.points,function(t,i){0===i?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)},this),s.closePath(),s.stroke(),s.fillStyle=t.fillColor,s.fill(),e.each(t.points,function(t){t.hasValue()&&t.draw()})},this)}})}.call(this); \ No newline at end of file diff --git a/public/js/accounts/show.js b/public/js/ff/accounts/show.js similarity index 100% rename from public/js/accounts/show.js rename to public/js/ff/accounts/show.js diff --git a/public/js/bills.js b/public/js/ff/bills/show.js similarity index 100% rename from public/js/bills.js rename to public/js/ff/bills/show.js diff --git a/public/js/budgets.js b/public/js/ff/budgets/index.js similarity index 100% rename from public/js/budgets.js rename to public/js/ff/budgets/index.js diff --git a/public/js/ff/budgets/show.js b/public/js/ff/budgets/show.js new file mode 100644 index 0000000000..c8ca145734 --- /dev/null +++ b/public/js/ff/budgets/show.js @@ -0,0 +1,117 @@ +/* globals $, budgeted:true, currencySymbol, budgetIncomeTotal, columnChart, budgetedMuch, budgetedPercentage, token, budgetID, repetitionID, spent, lineChart */ + +function drawSpentBar() { + "use strict"; + if ($('.spentBar').length > 0) { + var overspent = spent > budgeted; + var pct; + + if (overspent) { + // draw overspent bar + pct = (budgeted / spent) * 100; + $('.spentBar .progress-bar-warning').css('width', pct + '%'); + $('.spentBar .progress-bar-danger').css('width', (100 - pct) + '%'); + } else { + // draw normal bar: + pct = (spent / budgeted) * 100; + $('.spentBar .progress-bar-info').css('width', pct + '%'); + } + } +} + +function drawBudgetedBar() { + "use strict"; + + if ($('.budgetedBar').length > 0) { + var budgetedMuch = budgeted > budgetIncomeTotal; + + // recalculate percentage: + + var pct; + if (budgetedMuch) { + // budgeted too much. + pct = (budgetIncomeTotal / budgeted) * 100; + $('.budgetedBar .progress-bar-warning').css('width', pct + '%'); + $('.budgetedBar .progress-bar-danger').css('width', (100 - pct) + '%'); + $('.budgetedBar .progress-bar-info').css('width', 0); + } else { + pct = (budgeted / budgetIncomeTotal) * 100; + $('.budgetedBar .progress-bar-warning').css('width', 0); + $('.budgetedBar .progress-bar-danger').css('width', 0); + $('.budgetedBar .progress-bar-info').css('width', pct + '%'); + } + + $('#budgetedAmount').html(currencySymbol + ' ' + budgeted.toFixed(2)); + } +} + +function updateBudgetedAmounts(e) { + "use strict"; + var target = $(e.target); + var id = target.data('id'); + var value = target.val(); + var original = target.data('original'); + var difference = value - original; + if (difference !== 0) { + // add difference to 'budgeted' var + budgeted = budgeted + difference; + + // update original: + target.data('original', value); + // run drawBudgetedBar() again: + drawBudgetedBar(); + + // send a post to Firefly to update the amount: + $.post('budgets/amount/' + id, {amount: value, _token: token}).done(function (data) { + // update the link if relevant: + if (data.repetition > 0) { + $('.budget-link[data-id="' + id + '"]').attr('href', 'budgets/show/' + id + '/' + data.repetition); + } else { + $('.budget-link[data-id="' + id + '"]').attr('href', 'budgets/show/' + id); + } + }); + } + + + console.log('Budget id is ' + id); + console.log('Difference = ' + (value - original )); + +} + +$(function () { + "use strict"; + + $('.updateIncome').on('click', updateIncome); + + /* + On start, fill the "spent"-bar using the content from the page. + */ + drawSpentBar(); + drawBudgetedBar(); + + /* + When the input changes, update the percentages for the budgeted bar: + */ + $('input[type="number"]').on('input', updateBudgetedAmounts); + + + /* + Draw the charts, if necessary: + */ + if (typeof budgetID !== 'undefined' && typeof repetitionID === 'undefined') { + columnChart('chart/budget/' + budgetID, 'budgetOverview'); + } + if (typeof budgetID !== 'undefined' && typeof repetitionID !== 'undefined') { + lineChart('chart/budget/' + budgetID + '/' + repetitionID, 'budgetOverview'); + } + +}); + +function updateIncome() { + "use strict"; + $('#defaultModal').empty().load('budgets/income', function () { + $('#defaultModal').modal('show'); + }); + + return false; +} diff --git a/public/js/categories.js b/public/js/ff/categories/index.js similarity index 100% rename from public/js/categories.js rename to public/js/ff/categories/index.js diff --git a/public/js/ff/categories/show.js b/public/js/ff/categories/show.js new file mode 100644 index 0000000000..8bf673924b --- /dev/null +++ b/public/js/ff/categories/show.js @@ -0,0 +1,19 @@ +/* globals $, categoryID, columnChart, categoryDate */ +$(function () { + "use strict"; + if (typeof categoryID !== 'undefined') { + // more splits: + if ($('#all').length > 0) { + columnChart('chart/category/' + categoryID + '/all', 'all'); + } + if ($('#period').length > 0) { + columnChart('chart/category/' + categoryID + '/period', 'period'); + } + + } + if (typeof categoryID !== 'undefined' && typeof categoryDate !== undefined) { + columnChart('chart/category/' + categoryID + '/period/' + categoryDate, 'period-specific-period'); + } + + +}); \ No newline at end of file diff --git a/public/js/ff/categories/show_with_date.js b/public/js/ff/categories/show_with_date.js new file mode 100644 index 0000000000..8bf673924b --- /dev/null +++ b/public/js/ff/categories/show_with_date.js @@ -0,0 +1,19 @@ +/* globals $, categoryID, columnChart, categoryDate */ +$(function () { + "use strict"; + if (typeof categoryID !== 'undefined') { + // more splits: + if ($('#all').length > 0) { + columnChart('chart/category/' + categoryID + '/all', 'all'); + } + if ($('#period').length > 0) { + columnChart('chart/category/' + categoryID + '/period', 'period'); + } + + } + if (typeof categoryID !== 'undefined' && typeof categoryDate !== undefined) { + columnChart('chart/category/' + categoryID + '/period/' + categoryDate, 'period-specific-period'); + } + + +}); \ No newline at end of file diff --git a/public/js/charts.js b/public/js/ff/charts.js similarity index 53% rename from public/js/charts.js rename to public/js/ff/charts.js index e65b106e55..7e30624236 100644 --- a/public/js/charts.js +++ b/public/js/ff/charts.js @@ -1,3 +1,11 @@ +/* + * charts.js + * Copyright (C) 2016 thegrumpydictator@gmail.com + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + /* globals $, Chart, currencySymbol,mon_decimal_point ,accounting, mon_thousands_sep, frac_digits */ /* @@ -20,7 +28,7 @@ var colourSet = [ [92, 107, 192], [240, 98, 146], [0, 121, 107], - [194, 24, 91], + [194, 24, 91] ]; @@ -50,82 +58,154 @@ for (var i = 0; i < colourSet.length; i++) { strokePointHighColors.push("rgba(" + colourSet[i][0] + ", " + colourSet[i][1] + ", " + colourSet[i][2] + ", 0.9)"); } +Chart.defaults.global.legend.display = false; +Chart.defaults.global.animation.duration = 0; +Chart.defaults.global.responsive = true; +Chart.defaults.global.maintainAspectRatio = false; + /* Set default options: */ var defaultAreaOptions = { - scaleShowGridLines: false, - pointDotRadius: 2, - datasetStrokeWidth: 1, - pointHitDetectionRadius: 5, - datasetFill: true, - animation: false, - scaleFontSize: 10, - responsive: false, - scaleLabel: " <%= accounting.formatMoney(value) %>", - tooltipFillColor: "rgba(0,0,0,0.5)", - multiTooltipTemplate: "<%=datasetLabel%>: <%= accounting.formatMoney(value) %>" + scales: { + xAxes: [ + { + gridLines: { + display: false + } + } + ], + yAxes: [{ + display: true, + ticks: { + callback: function (tickValue, index, ticks) { + "use strict"; + return accounting.formatMoney(tickValue); + + } + } + }] + }, + tooltips: { + mode: 'label', + callbacks: { + label: function (tooltipItem, data) { + "use strict"; + return data.datasets[tooltipItem.datasetIndex].label + ': ' + accounting.formatMoney(tooltipItem.yLabel); + } + } + } }; var defaultPieOptions = { - scaleShowGridLines: false, - pointDotRadius: 2, - datasetStrokeWidth: 1, - pointHitDetectionRadius: 5, - datasetFill: false, - animation: false, - scaleFontSize: 10, - responsive: false, - tooltipFillColor: "rgba(0,0,0,0.5)", - tooltipTemplate: "<%if (label){%><%=label%>: <%}%> <%= accounting.formatMoney(value) %>", - + tooltips: { + callbacks: { + label: function (tooltipItem, data) { + "use strict"; + var value = data.datasets[0].data[tooltipItem.index]; + return data.labels[tooltipItem.index] + ': ' + accounting.formatMoney(value); + } + } + } }; var defaultLineOptions = { - scaleShowGridLines: false, - pointDotRadius: 2, - datasetStrokeWidth: 1, - pointHitDetectionRadius: 5, - animation: false, - datasetFill: false, - scaleFontSize: 10, - responsive: false, - scaleLabel: " <%= accounting.formatMoney(value) %>", - tooltipFillColor: "rgba(0,0,0,0.5)", - tooltipTemplate: "<%if (label){%><%=label%>: <%}%> <%= accounting.formatMoney(value) %>", - multiTooltipTemplate: "<%=datasetLabel%>: <%= accounting.formatMoney(value) %>" + scales: { + xAxes: [ + { + gridLines: { + display: false + } + } + ], + yAxes: [{ + display: true, + ticks: { + callback: function (tickValue, index, ticks) { + "use strict"; + return accounting.formatMoney(tickValue); + + } + } + }] + }, + tooltips: { + mode: 'label', + callbacks: { + label: function (tooltipItem, data) { + "use strict"; + return data.datasets[tooltipItem.datasetIndex].label + ': ' + accounting.formatMoney(tooltipItem.yLabel); + } + } + } }; var defaultColumnOptions = { - scaleShowGridLines: false, - pointDotRadius: 2, - barStrokeWidth: 1, - pointHitDetectionRadius: 5, - datasetFill: false, - scaleFontSize: 10, - responsive: false, - animation: false, - scaleLabel: "<%= accounting.formatMoney(value) %>", - tooltipFillColor: "rgba(0,0,0,0.5)", - tooltipTemplate: "<%if (label){%><%=label%>: <%}%> <%= accounting.formatMoney(value) %>", - multiTooltipTemplate: "<%=datasetLabel%>: <%= accounting.formatMoney(value) %>" + scales: { + xAxes: [ + { + gridLines: { + display: false + } + } + ], + yAxes: [{ + ticks: { + callback: function (tickValue, index, ticks) { + "use strict"; + return accounting.formatMoney(tickValue); + + } + } + }] + }, + elements: { + line: { + fill: false + } + }, + tooltips: { + mode: 'label', + callbacks: { + label: function (tooltipItem, data) { + "use strict"; + return data.datasets[tooltipItem.datasetIndex].label + ': ' + accounting.formatMoney(tooltipItem.yLabel); + } + } + } }; var defaultStackedColumnOptions = { - scaleShowGridLines: false, - pointDotRadius: 2, - barStrokeWidth: 1, - pointHitDetectionRadius: 5, - datasetFill: false, - animation: false, - scaleFontSize: 10, - responsive: false, - scaleLabel: "<%= accounting.formatMoney(value) %>", - tooltipFillColor: "rgba(0,0,0,0.5)", - multiTooltipTemplate: "<%=datasetLabel%>: <%= accounting.formatMoney(value) %>" + stacked: true, + scales: { + xAxes: [{ + stacked: true, + gridLines: { + display: false + } + }], + yAxes: [{ + stacked: true, + ticks: { + callback: function (tickValue, index, ticks) { + "use strict"; + return accounting.formatMoney(tickValue); + } + } + }] + }, + tooltips: { + mode: 'label', + callbacks: { + label: function (tooltipItem, data) { + "use strict"; + return data.datasets[tooltipItem.datasetIndex].label + ': ' + accounting.formatMoney(tooltipItem.yLabel); + } + } + } }; /** @@ -137,6 +217,7 @@ var defaultStackedColumnOptions = { function lineChart(URL, container, options) { "use strict"; $.getJSON(URL).done(function (data) { + var ctx = document.getElementById(container).getContext("2d"); var newData = {}; newData.datasets = []; @@ -144,15 +225,15 @@ function lineChart(URL, container, options) { for (var i = 0; i < data.count; i++) { newData.labels = data.labels; var dataset = data.datasets[i]; - dataset.fillColor = fillColors[i]; - dataset.strokeColor = strokePointHighColors[i]; - dataset.pointColor = strokePointHighColors[i]; - dataset.pointStrokeColor = "#fff"; - dataset.pointHighlightFill = "#fff"; - dataset.pointHighlightStroke = strokePointHighColors[i]; + dataset.backgroundColor = fillColors[i]; newData.datasets.push(dataset); } - new Chart(ctx).Line(newData, defaultLineOptions); + + new Chart(ctx, { + type: 'line', + data: data, + options: defaultLineOptions + }); }).fail(function () { $('#' + container).addClass('general-chart-error'); @@ -178,15 +259,15 @@ function areaChart(URL, container, options) { for (var i = 0; i < data.count; i++) { newData.labels = data.labels; var dataset = data.datasets[i]; - dataset.fillColor = fillColors[i]; - dataset.strokeColor = strokePointHighColors[i]; - dataset.pointColor = strokePointHighColors[i]; - dataset.pointStrokeColor = "#fff"; - dataset.pointHighlightFill = "#fff"; - dataset.pointHighlightStroke = strokePointHighColors[i]; + dataset.backgroundColor = fillColors[i]; newData.datasets.push(dataset); } - new Chart(ctx).Line(newData, defaultAreaOptions); + + new Chart(ctx, { + type: 'line', + data: newData, + options: defaultAreaOptions + }); }).fail(function () { $('#' + container).addClass('general-chart-error'); @@ -224,15 +305,14 @@ function columnChart(URL, container, options) { for (var i = 0; i < data.count; i++) { newData.labels = data.labels; var dataset = data.datasets[i]; - dataset.fillColor = fillColors[i]; - dataset.strokeColor = strokePointHighColors[i]; - dataset.pointColor = strokePointHighColors[i]; - dataset.pointStrokeColor = "#fff"; - dataset.pointHighlightFill = "#fff"; - dataset.pointHighlightStroke = strokePointHighColors[i]; + dataset.backgroundColor = fillColors[i]; newData.datasets.push(dataset); } - new Chart(ctx).Bar(newData, defaultColumnOptions); + new Chart(ctx, { + type: 'bar', + data: data, + options: defaultColumnOptions + }); }).fail(function () { $('#' + container).addClass('general-chart-error'); @@ -270,15 +350,15 @@ function stackedColumnChart(URL, container, options) { for (var i = 0; i < data.count; i++) { newData.labels = data.labels; var dataset = data.datasets[i]; - dataset.fillColor = fillColors[i]; - dataset.strokeColor = strokePointHighColors[i]; - dataset.pointColor = strokePointHighColors[i]; - dataset.pointStrokeColor = "#fff"; - dataset.pointHighlightFill = "#fff"; - dataset.pointHighlightStroke = strokePointHighColors[i]; + dataset.backgroundColor = fillColors[i]; newData.datasets.push(dataset); } - new Chart(ctx).StackedBar(newData, defaultStackedColumnOptions); + new Chart(ctx, { + type: 'bar', + data: data, + options: defaultStackedColumnOptions + }); + }).fail(function () { $('#' + container).addClass('general-chart-error'); @@ -298,7 +378,11 @@ function pieChart(URL, container, options) { $.getJSON(URL).done(function (data) { var ctx = document.getElementById(container).getContext("2d"); - new Chart(ctx).Pie(data, defaultPieOptions); + new Chart(ctx, { + type: 'pie', + data: data, + options: defaultPieOptions + }); }).fail(function () { $('#' + container).addClass('general-chart-error'); diff --git a/public/js/export/index.js b/public/js/ff/export/index.js similarity index 100% rename from public/js/export/index.js rename to public/js/ff/export/index.js diff --git a/public/js/firefly.js b/public/js/ff/firefly.js similarity index 100% rename from public/js/firefly.js rename to public/js/ff/firefly.js diff --git a/public/js/guest.js b/public/js/ff/guest.js similarity index 100% rename from public/js/guest.js rename to public/js/ff/guest.js diff --git a/public/js/help.js b/public/js/ff/help.js similarity index 100% rename from public/js/help.js rename to public/js/ff/help.js diff --git a/public/js/index.js b/public/js/ff/index.js similarity index 100% rename from public/js/index.js rename to public/js/ff/index.js diff --git a/public/js/piggy-banks/index.js b/public/js/ff/piggy-banks/index.js similarity index 100% rename from public/js/piggy-banks/index.js rename to public/js/ff/piggy-banks/index.js diff --git a/public/js/piggy-banks/show.js b/public/js/ff/piggy-banks/show.js similarity index 100% rename from public/js/piggy-banks/show.js rename to public/js/ff/piggy-banks/show.js diff --git a/public/js/ff/reports/audit/all.js b/public/js/ff/reports/audit/all.js new file mode 100644 index 0000000000..c57875937c --- /dev/null +++ b/public/js/ff/reports/audit/all.js @@ -0,0 +1,114 @@ +/* + * all.js + * Copyright (C) 2016 thegrumpydictator@gmail.com + * + * This software may be modified and distributed under the terms + * of the MIT license. See the LICENSE file for details. + */ + +/* globals hideable */ + + +/** + * Created by sander on 01/04/16. + */ + +$(function () { + "use strict"; + + // scan current selection of checkboxes and put them in a cookie: + var arr; + if ((readCookie('audit-option-checkbox') !== null)) { + arr = readCookie('audit-option-checkbox').split(','); + arr.forEach(function (val) { + $('input[type="checkbox"][value="' + val + '"]').prop('checked', true); + }); + console.log('arr from cookie is ' + arr) + } else { + // no cookie? read list, store in array 'arr' + // all account ids: + arr = readCheckboxes(); + } + storeCheckboxes(arr); + + + // process options: + showOnlyColumns(arr); + + // respond to click each button: + $('.audit-option-checkbox').click(clickColumnOption); + +}); + +function clickColumnOption() { + "use strict"; + var newArr = readCheckboxes(); + showOnlyColumns(newArr); + storeCheckboxes(newArr); +} + +function storeCheckboxes(checkboxes) { + "use strict"; + // store new cookie with those options: + console.log('Store new cookie with those options: ' + checkboxes); + createCookie('audit-option-checkbox', checkboxes, 365); +} + +function readCheckboxes() { + "use strict"; + var checkboxes = []; + $.each($('.audit-option-checkbox'), function (i, v) { + var c = $(v); + if (c.prop('checked')) { + //url += c.val() + ','; + checkboxes.push(c.val()); + } + }); + console.log('arr is now (default): ' + checkboxes); + return checkboxes; +} + +function showOnlyColumns(checkboxes) { + "use strict"; + + for (var i = 0; i < hideable.length; i++) { + var opt = hideable[i]; + if(checkboxes.indexOf(opt) > -1) { + console.log(opt + ' is in checkboxes'); + $('td.hide-' + opt).show(); + $('th.hide-' + opt).show(); + } else { + console.log(opt + ' is NOT in checkboxes'); + $('th.hide-' + opt).hide(); + $('td.hide-' + opt).hide(); + } + } +} + + +function createCookie(name, value, days) { + "use strict"; + var expires; + + if (days) { + var date = new Date(); + date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); + expires = "; expires=" + date.toGMTString(); + } else { + expires = ""; + } + document.cookie = encodeURIComponent(name) + "=" + encodeURIComponent(value) + expires + "; path=/"; +} + +function readCookie(name) { + "use strict"; + var nameEQ = encodeURIComponent(name) + "="; + var ca = document.cookie.split(';'); + for (var i = 0; i < ca.length; i++) { + var c = ca[i]; + while (c.charAt(0) === ' ') c = c.substring(1, c.length); + if (c.indexOf(nameEQ) === 0) return decodeURIComponent(c.substring(nameEQ.length, c.length)); + } + return null; +} + diff --git a/public/js/reports/default/all.js b/public/js/ff/reports/default/all.js similarity index 100% rename from public/js/reports/default/all.js rename to public/js/ff/reports/default/all.js diff --git a/public/js/reports/default/month.js b/public/js/ff/reports/default/month.js similarity index 100% rename from public/js/reports/default/month.js rename to public/js/ff/reports/default/month.js diff --git a/public/js/reports/default/multi-year.js b/public/js/ff/reports/default/multi-year.js similarity index 100% rename from public/js/reports/default/multi-year.js rename to public/js/ff/reports/default/multi-year.js diff --git a/public/js/reports/default/year.js b/public/js/ff/reports/default/year.js similarity index 100% rename from public/js/reports/default/year.js rename to public/js/ff/reports/default/year.js diff --git a/public/js/reports/index.js b/public/js/ff/reports/index.js similarity index 100% rename from public/js/reports/index.js rename to public/js/ff/reports/index.js diff --git a/public/js/rules/create-edit.js b/public/js/ff/rules/create-edit.js similarity index 100% rename from public/js/rules/create-edit.js rename to public/js/ff/rules/create-edit.js diff --git a/public/js/rules/create.js b/public/js/ff/rules/create.js similarity index 100% rename from public/js/rules/create.js rename to public/js/ff/rules/create.js diff --git a/public/js/rules/edit.js b/public/js/ff/rules/edit.js similarity index 100% rename from public/js/rules/edit.js rename to public/js/ff/rules/edit.js diff --git a/public/js/rules/index.js b/public/js/ff/rules/index.js similarity index 100% rename from public/js/rules/index.js rename to public/js/ff/rules/index.js diff --git a/public/js/tags.js b/public/js/ff/tags/create.js similarity index 100% rename from public/js/tags.js rename to public/js/ff/tags/create.js diff --git a/public/js/ff/tags/edit.js b/public/js/ff/tags/edit.js new file mode 100644 index 0000000000..6ea5731733 --- /dev/null +++ b/public/js/ff/tags/edit.js @@ -0,0 +1,104 @@ +/* globals zoomLevel, token, google, latitude, longitude, doPlaceMarker */ +$(function () { + "use strict"; + + $('#clearLocation').click(clearLocation); + +}); + +/* + Some vars as prep for the map: + */ +var map; +var markers = []; +var setTag = false; + +var mapOptions = { + zoom: zoomLevel, + center: new google.maps.LatLng(latitude, longitude), + disableDefaultUI: true +}; + +/* + Clear location and reset zoomLevel. + */ +function clearLocation() { + "use strict"; + deleteMarkers(); + $('input[name="latitude"]').val(""); + $('input[name="longitude"]').val(""); + $('input[name="zoomLevel"]').val("6"); + setTag = false; + $('input[name="setTag"]').val('false'); + return false; +} + +function initialize() { + "use strict"; + /* + Create new map: + */ + map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); + + /* + Respond to click event. + */ + google.maps.event.addListener(map, 'rightclick', function (event) { + placeMarker(event); + }); + + /* + Respond to zoom event. + */ + google.maps.event.addListener(map, 'zoom_changed', function () { + saveZoomLevel(event); + }); + /* + Maybe place marker? + */ + if(doPlaceMarker) { + var myLatlng = new google.maps.LatLng(latitude,longitude); + var fakeEvent = {}; + fakeEvent.latLng = myLatlng; + placeMarker(fakeEvent); + + } +} + +/** + * save zoom level of map into hidden input. + */ +function saveZoomLevel() { + "use strict"; + $('input[name="zoomLevel"]').val(map.getZoom()); +} + +/** + * Place marker on map. + * @param event + */ +function placeMarker(event) { + "use strict"; + deleteMarkers(); + var marker = new google.maps.Marker({position: event.latLng, map: map}); + $('input[name="latitude"]').val(event.latLng.lat()); + $('input[name="longitude"]').val(event.latLng.lng()); + markers.push(marker); + setTag = true; + $('input[name="setTag"]').val('true'); +} + + +/** + * Deletes all markers in the array by removing references to them. + */ +function deleteMarkers() { + "use strict"; + for (var i = 0; i < markers.length; i++) { + markers[i].setMap(null); + } + markers = []; +} + + +google.maps.event.addDomListener(window, 'load', initialize); \ No newline at end of file diff --git a/public/js/ff/tags/index.js b/public/js/ff/tags/index.js new file mode 100644 index 0000000000..6ea5731733 --- /dev/null +++ b/public/js/ff/tags/index.js @@ -0,0 +1,104 @@ +/* globals zoomLevel, token, google, latitude, longitude, doPlaceMarker */ +$(function () { + "use strict"; + + $('#clearLocation').click(clearLocation); + +}); + +/* + Some vars as prep for the map: + */ +var map; +var markers = []; +var setTag = false; + +var mapOptions = { + zoom: zoomLevel, + center: new google.maps.LatLng(latitude, longitude), + disableDefaultUI: true +}; + +/* + Clear location and reset zoomLevel. + */ +function clearLocation() { + "use strict"; + deleteMarkers(); + $('input[name="latitude"]').val(""); + $('input[name="longitude"]').val(""); + $('input[name="zoomLevel"]').val("6"); + setTag = false; + $('input[name="setTag"]').val('false'); + return false; +} + +function initialize() { + "use strict"; + /* + Create new map: + */ + map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); + + /* + Respond to click event. + */ + google.maps.event.addListener(map, 'rightclick', function (event) { + placeMarker(event); + }); + + /* + Respond to zoom event. + */ + google.maps.event.addListener(map, 'zoom_changed', function () { + saveZoomLevel(event); + }); + /* + Maybe place marker? + */ + if(doPlaceMarker) { + var myLatlng = new google.maps.LatLng(latitude,longitude); + var fakeEvent = {}; + fakeEvent.latLng = myLatlng; + placeMarker(fakeEvent); + + } +} + +/** + * save zoom level of map into hidden input. + */ +function saveZoomLevel() { + "use strict"; + $('input[name="zoomLevel"]').val(map.getZoom()); +} + +/** + * Place marker on map. + * @param event + */ +function placeMarker(event) { + "use strict"; + deleteMarkers(); + var marker = new google.maps.Marker({position: event.latLng, map: map}); + $('input[name="latitude"]').val(event.latLng.lat()); + $('input[name="longitude"]').val(event.latLng.lng()); + markers.push(marker); + setTag = true; + $('input[name="setTag"]').val('true'); +} + + +/** + * Deletes all markers in the array by removing references to them. + */ +function deleteMarkers() { + "use strict"; + for (var i = 0; i < markers.length; i++) { + markers[i].setMap(null); + } + markers = []; +} + + +google.maps.event.addDomListener(window, 'load', initialize); \ No newline at end of file diff --git a/public/js/transactions/create-edit.js b/public/js/ff/transactions/create-edit.js similarity index 100% rename from public/js/transactions/create-edit.js rename to public/js/ff/transactions/create-edit.js diff --git a/public/js/transactions/create.js b/public/js/ff/transactions/create.js similarity index 100% rename from public/js/transactions/create.js rename to public/js/ff/transactions/create.js diff --git a/public/js/transactions/edit.js b/public/js/ff/transactions/edit.js similarity index 100% rename from public/js/transactions/edit.js rename to public/js/ff/transactions/edit.js diff --git a/public/js/jquery-2.1.3.min.js b/public/js/jquery-2.1.3.min.js deleted file mode 100644 index 25714ed29a..0000000000 --- a/public/js/jquery-2.1.3.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v2.1.3 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */ -!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.3",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)+1>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=hb(),z=hb(),A=hb(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},eb=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fb){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function gb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+rb(o[l]);w=ab.test(a)&&pb(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function hb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ib(a){return a[u]=!0,a}function jb(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function kb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function lb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function nb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function ob(a){return ib(function(b){return b=+b,ib(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pb(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=gb.support={},f=gb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=gb.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",eb,!1):e.attachEvent&&e.attachEvent("onunload",eb)),p=!f(g),c.attributes=jb(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=jb(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=jb(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(jb(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),jb(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&jb(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return lb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?lb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},gb.matches=function(a,b){return gb(a,null,null,b)},gb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return gb(b,n,null,[a]).length>0},gb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},gb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},gb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},gb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=gb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=gb.selectors={cacheLength:50,createPseudo:ib,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||gb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&gb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=gb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||gb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ib(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ib(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ib(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ib(function(a){return function(b){return gb(a,b).length>0}}),contains:ib(function(a){return a=a.replace(cb,db),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ib(function(a){return W.test(a||"")||gb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:ob(function(){return[0]}),last:ob(function(a,b){return[b-1]}),eq:ob(function(a,b,c){return[0>c?c+b:c]}),even:ob(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:ob(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:ob(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:ob(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function tb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ub(a,b,c){for(var d=0,e=b.length;e>d;d++)gb(a,b[d],c);return c}function vb(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wb(a,b,c,d,e,f){return d&&!d[u]&&(d=wb(d)),e&&!e[u]&&(e=wb(e,f)),ib(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ub(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:vb(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=vb(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=vb(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sb(function(a){return a===b},h,!0),l=sb(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sb(tb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wb(i>1&&tb(m),i>1&&rb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xb(a.slice(i,e)),f>e&&xb(a=a.slice(e)),f>e&&rb(a))}m.push(c)}return tb(m)}function yb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=vb(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&gb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ib(f):f}return h=gb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,yb(e,d)),f.selector=a}return f},i=gb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&pb(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&rb(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&pb(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=jb(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),jb(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||kb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&jb(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||kb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),jb(function(a){return null==a.getAttribute("disabled")})||kb(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),gb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+K.uid++}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c) -},removeData:function(a,b){M.remove(a,b)},_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthx",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*\s*$/g,ib={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("