diff --git a/apps/Core/Components/Devtools/Modules/ModulesComponent.php b/apps/Core/Components/Devtools/Modules/ModulesComponent.php index 3a02cda21..de4b51cbe 100644 --- a/apps/Core/Components/Devtools/Modules/ModulesComponent.php +++ b/apps/Core/Components/Devtools/Modules/ModulesComponent.php @@ -187,6 +187,7 @@ public function viewAction() unset($modules['apptypes']); unset($modules['bundles']); + $modifiedModules = []; foreach ($modules as $moduleType => &$modulesTypeArr) { if (isset($modulesTypeArr['childs']) && count($modulesTypeArr['childs']) > 0) { foreach ($modulesTypeArr['childs'] as $childKey => &$child) { @@ -195,12 +196,18 @@ public function viewAction() if ($child['repoExists'] && !$child['isModified'] && $child['latestRelease']) { unset($modules[$moduleType]['childs'][$childKey]); } + + if (isset($child['modified_files']) && count($child['modified_files']) > 0) { + $modifiedModules[$child['id']] = $child['modified_files']; + } } } } $this->view->modules = $modules; + $this->view->modifiedModules = $modifiedModules; + $this->view->pick('modules/changes'); return; @@ -385,7 +392,7 @@ public function viewAction() $module['id'] = $module['module_details']['id']; } catch (\throwable $e) { - throw new \Exception($e->getMessage()); + throw $e; } } } @@ -857,4 +864,28 @@ public function checkVersionAction() $this->modulesPackage->packagesData->responseCode ); } + + public function reCalculateFilesHashAction() + { + $this->requestIsPost(); + + $this->modulesPackage->reCalculateFilesHash($this->postData(), false, false, false, true); + + $this->addResponse( + $this->modulesPackage->packagesData->responseMessage, + $this->modulesPackage->packagesData->responseCode + ); + } + + public function getModifiedFilesHashAction() + { + $this->requestIsPost(); + + $this->modulesPackage->getModifiedFilesHash($this->postData()); + + $this->addResponse( + $this->modulesPackage->packagesData->responseMessage, + $this->modulesPackage->packagesData->responseCode + ); + } } \ No newline at end of file diff --git a/apps/Core/Components/System/Geo/Cities/CitiesComponent.php b/apps/Core/Components/System/Geo/Cities/CitiesComponent.php index 9001d8c6c..86b7bab22 100644 --- a/apps/Core/Components/System/Geo/Cities/CitiesComponent.php +++ b/apps/Core/Components/System/Geo/Cities/CitiesComponent.php @@ -28,34 +28,19 @@ public function viewAction() if ($this->getData()['id'] != 0) { $city = $this->basepackages->geoCities->getById($this->getData()['id']); - if (!$city) { - return $this->throwIdNotFound(); - } - $this->view->city = $city; - } else { - $this->view->city = []; } - $this->view->pick('cities/view'); - $this->view->countries = $countriesArr; - $this->view->states = $statesArr; - return; - } + if (!$this->view->city) { + return $this->throwIdNotFound(); + } - $countries = []; - $states = []; + $this->view->pick('cities/view'); - if ($countriesArr) { - foreach ($countriesArr as $countriesKey => $country) { - $countries[$country['id']] = $country['name'] . ' (' . $country['id'] . ')'; - } - } + $this->view->countries = [$countriesArr[$city['country_id']]]; + $this->view->states = [$statesArr[$city['state_id']]]; - if ($statesArr) { - foreach ($statesArr as $statesKey => $state) { - $states[$state['id']] = $state['name'] . ' (' . $state['id'] . ')'; - } + return; } $controlActions = @@ -63,11 +48,26 @@ public function viewAction() // 'includeQ' => true, 'actionsToEnable' => [ - 'edit' => 'system/geo/cities', + 'view' => 'system/geo/cities', ] ]; if ($this->request->isPost()) { + $countries = []; + $states = []; + + if ($countriesArr) { + foreach ($countriesArr as $countriesKey => $country) { + $countries[$country['id']] = $country['name'] . ' (' . $country['id'] . ')'; + } + } + + if ($statesArr) { + foreach ($statesArr as $statesKey => $state) { + $states[$state['id']] = $state['name'] . ' (' . $state['id'] . ')'; + } + } + $replaceColumns = [ 'country_id' => @@ -141,13 +141,13 @@ public function searchCityAction() return; } - $searchCities = $this->basepackages->geoCities->searchCities($searchQuery); - - if ($searchCities) { - $this->view->responseCode = $this->basepackages->geoCities->packagesData->responseCode; + $this->basepackages->geoCities->searchCities($searchQuery); - $this->view->cities = $this->basepackages->geoCities->packagesData->cities; - } + $this->addResponse( + $this->basepackages->geoCities->packagesData->responseMessage, + $this->basepackages->geoCities->packagesData->responseCode, + $this->basepackages->geoCities->packagesData->responseData ?? [] + ); } else { $this->addResponse('Search Query Missing', 1); } @@ -164,13 +164,13 @@ public function searchPostCodeAction() return; } - $searchPostCodes = $this->basepackages->geoCities->searchPostCodes($searchQuery); + $this->basepackages->geoCities->searchPostCodes($searchQuery); - if ($searchPostCodes) { - $this->view->responseCode = $this->basepackages->geoCities->packagesData->responseCode; - - $this->view->postCodes = $this->basepackages->geoCities->packagesData->postCodes; - } + $this->addResponse( + $this->basepackages->geoCities->packagesData->responseMessage, + $this->basepackages->geoCities->packagesData->responseCode, + $this->basepackages->geoCities->packagesData->responseData ?? [] + ); } else { $this->addResponse('Search Query Missing', 1); } diff --git a/apps/Core/Components/System/Geo/Countries/CountriesComponent.php b/apps/Core/Components/System/Geo/Countries/CountriesComponent.php index a2ebf446f..b4373783c 100644 --- a/apps/Core/Components/System/Geo/Countries/CountriesComponent.php +++ b/apps/Core/Components/System/Geo/Countries/CountriesComponent.php @@ -4,7 +4,6 @@ use Apps\Core\Packages\Adminltetags\Traits\DynamicTable; use System\Base\BaseComponent; -use System\Base\Providers\BasepackagesServiceProvider\Packages\Geo\GeoExtractData; class CountriesComponent extends BaseComponent { @@ -26,14 +25,13 @@ public function viewAction() if ($this->getData()['id'] != 0) { $country = $this->basepackages->geoCountries->getById($this->getData()['id']); - if (!$country) { - return $this->throwIdNotFound(); - } - $this->view->country = $country; - } else { - $this->view->country = []; } + + if (!$this->view->country) { + return $this->throwIdNotFound(); + } + $this->view->pick('countries/view'); return; @@ -41,31 +39,12 @@ public function viewAction() $controlActions = [ - // 'includeQ' => true, 'actionsToEnable' => [ 'edit' => 'system/geo/countries', ] ]; - // $dtAdditionControlButtons = - // [ - // 'includeId' => true, - // // 'includeQ' => true, //Only true when not adding /q/ in link below. - // 'buttons' => [ - // 'states' => [ - // 'title' => 'states', - // 'icon' => 'map-marked', - // 'link' => $this->links->url('system/geo/q/type/states') - // ], - // 'cities' => [ - // 'title' => 'cities', - // 'icon' => 'map-marked-alt', - // 'link' => $this->links->url('system/geo/q/type/cities') - // ] - // ] - // ]; - $replaceColumns = [ 'installed' => @@ -97,7 +76,6 @@ public function viewAction() null, $replaceColumns, 'name', - // $dtAdditionControlButtons ); $this->view->pick('countries/list'); @@ -118,6 +96,7 @@ public function apiViewAction() return $this->throwIdNotFound(); } } + $this->addResponse('Ok', 0, ['data' => $geoCountry]); return; @@ -132,29 +111,12 @@ public function apiViewAction() ['name', 'capital', 'currency', 'installed', 'enabled'] ); - if ($data) { - $this->addResponse('Ok', 0, ['data' => $data]); - } + $this->addResponse('Ok', 0, ['data' => $data ?? []]); return; } } - /** - * @acl(name=add) - */ - public function addAction() - { - $this->requestIsPost(); - - $this->geoCountries->addCountry($this->postData()); - - $this->addResponse( - $this->geoCountries->packagesData->responseMessage, - $this->geoCountries->packagesData->responseCode - ); - } - /** * @acl(name=update) */ @@ -178,13 +140,22 @@ public function installAction() $this->addResponse( $this->geoCountries->packagesData->responseMessage, - $this->geoCountries->packagesData->responseCode + $this->geoCountries->packagesData->responseCode, + $this->geoCountries->packagesData->responseData ?? [] ); } public function uninstallAction() { - // + $this->requestIsPost(); + + $this->geoCountries->uninstallCountry($this->postData()); + + $this->addResponse( + $this->geoCountries->packagesData->responseMessage, + $this->geoCountries->packagesData->responseCode, + $this->geoCountries->packagesData->responseData ?? [] + ); } public function searchCountryAction() @@ -198,17 +169,15 @@ public function searchCountryAction() return; } - $searchCountries = $this->geoCountries->searchCountries($searchQuery); + $countries = $this->geoCountries->searchCountries($searchQuery); - if ($searchCountries) { - $this->view->responseCode = $this->geoCountries->packagesData->responseCode; + $countries = msort($countries, 'id'); - $countries = $this->geoCountries->packagesData->countries; - - $countries = msort($countries, 'id'); - - $this->view->countries = $countries; - } + $this->addResponse( + $this->geoCountries->packagesData->responseMessage, + $this->geoCountries->packagesData->responseCode, + ['countries' => $countries] ?? [] + ); } else { $this->addResponse('Search Query Missing', 1); } diff --git a/apps/Core/Components/System/Geo/Holidays/HolidaysComponent.php b/apps/Core/Components/System/Geo/Holidays/HolidaysComponent.php new file mode 100644 index 000000000..23e8fd12c --- /dev/null +++ b/apps/Core/Components/System/Geo/Holidays/HolidaysComponent.php @@ -0,0 +1,184 @@ +geoHolidays = $this->basepackages->geoHolidays->init(); + } + + /** + * @acl(name=view) + */ + public function viewAction() + { + $enabledCountries = $this->basepackages->geoCountries->isEnabled(null, true); + + $enabledStates = []; + + if ($enabledCountries && count($enabledCountries) > 0) { + $enabledCountries = msort($enabledCountries, 'name'); + + foreach ($enabledCountries as $enabledCountry) { + $states = $this->basepackages->geoStates->searchStatesByCountryId($enabledCountry['id']); + + $states = msort($states, 'name'); + + if ($states && count($states) > 0) { + $enabledStates[$enabledCountry['id']] = $states; + } + } + } + + if (isset($this->getData()['id'])) { + $holidayTags = []; + + if ($this->getData()['id'] != 0) { + $holiday = $this->basepackages->geoHolidays->getById($this->getData()['id']); + + $this->view->holiday = $holiday; + + if (!$this->view->holiday) { + return $this->throwIdNotFound(); + } + + $holidayTagsArr = $this->basepackages->tags->getTagsByPackageNameAndPackageRowId('GeoHolidays', $holiday['id']); + + if (count($holidayTagsArr) > 0) { + foreach ($holidayTagsArr as $tag) { + array_push($holidayTags, $tag['id']); + } + } + } else { + $this->view->weekdays = $this->basepackages->workers->schedules->getWeekdays(); + } + + $this->view->countries = $enabledCountries; + + $this->view->states = $enabledStates; + + $this->view->holidayTags = $holidayTags; + + $this->view->tags = $this->basepackages->tags->getTagsByPackageName('GeoHolidays'); + + $this->view->pick('holidays/view'); + + return; + } + + $controlActions = + [ + 'actionsToEnable' => + [ + 'edit' => 'system/geo/holidays', + 'remove' => 'system/geo/holidays/remove', + ] + ]; + + $replaceColumns = + function ($dataArr) { + if ($dataArr && is_array($dataArr) && count($dataArr) > 0) { + foreach ($dataArr as &$data) { + if ($data['is_national_holiday'] == '1') { + $data['is_national_holiday'] = 'Yes'; + $data['state_id'] = '-'; + } else { + $data['is_national_holiday'] = 'No'; + + $state = $this->basepackages->geoStates->getById($data['state_id']); + + if ($state) { + $data['state_id'] = $state['name']; + } else { + $data['state_id'] = '-'; + } + } + } + } + + return $dataArr; + }; + + $this->generateDTContent( + $this->geoHolidays, + 'system/geo/holidays/view', + null, + ['name', 'date', 'is_national_holiday', 'state_id'], + true, + ['name', 'date', 'is_national_holiday', 'state_id'], + $controlActions, + ['state_id' => 'State'], + $replaceColumns, + 'name' + ); + + $this->view->pick('holidays/list'); + } + + /** + * @acl(name=add) + */ + public function addAction() + { + $this->requestIsPost(); + + $this->geoHolidays->addHoliday($this->postData()); + + $this->addResponse( + $this->geoHolidays->packagesData->responseMessage, + $this->geoHolidays->packagesData->responseCode + ); + } + + /** + * @acl(name=update) + */ + public function updateAction() + { + $this->requestIsPost(); + + $this->geoHolidays->updateHoliday($this->postData()); + + $this->addResponse( + $this->geoHolidays->packagesData->responseMessage, + $this->geoHolidays->packagesData->responseCode + ); + } + + /** + * @acl(name=remove) + */ + public function removeAction() + { + $this->requestIsPost(); + + $this->geoHolidays->removeHoliday($this->postData()['id']); + + $this->addResponse( + $this->geoHolidays->packagesData->responseMessage, + $this->geoHolidays->packagesData->responseCode + ); + } + + public function generateRecurringDatesAction() + { + $this->requestIsPost(); + + $this->geoHolidays->generateRecurringDates($this->postData()); + + $this->addResponse( + $this->geoHolidays->packagesData->responseMessage, + $this->geoHolidays->packagesData->responseCode, + $this->geoHolidays->packagesData->responseData ?? [] + ); + } +} \ No newline at end of file diff --git a/apps/Core/Components/System/Geo/Holidays/Install/component.json b/apps/Core/Components/System/Geo/Holidays/Install/component.json new file mode 100644 index 000000000..8600704e1 --- /dev/null +++ b/apps/Core/Components/System/Geo/Holidays/Install/component.json @@ -0,0 +1,60 @@ +{ + "name" : "Geo Holidays", + "route" : "system/geo/holidays", + "description" : "

Manage geo holidays via this component

", + "module_type" : "components", + "app_type" : "core", + "category" : "admin", + "version" : "0.0.0", + "repo" : "https://.../", + "class" : "Apps\\Core\\Components\\System\\Geo\\Holidays\\HolidaysComponent", + "dependencies" : + { + "core" : + { + "name" : "Core", + "version" : "0.0.0", + "repo" : "https://.../" + }, + "components" : [], + "packages" : [], + "middlewares" : [], + "views" : [], + "external" : [], + "externals" : [] + }, + "menu" : + { + "system" : + { + "title" : "system", + "icon" : "cogs", + "childs" : + { + "geolocations" : + { + "title" : "geo locations", + "icon" : "globe", + "childs" : + { + "holidays" : + { + "title" : "holidays", + "icon" : "circle-dot", + "link" : "system/geo/holidays" + } + } + } + } + }, + "seq" : "0" + }, + "settings" : + { + "mandatory" : + { + "core" : true + } + }, + "widgets" : [] +} \ No newline at end of file diff --git a/apps/Core/Components/System/Geo/Regions/Install/component.json b/apps/Core/Components/System/Geo/Regions/Install/component.json new file mode 100644 index 000000000..e877d42dc --- /dev/null +++ b/apps/Core/Components/System/Geo/Regions/Install/component.json @@ -0,0 +1,60 @@ +{ + "name" : "Geo Regions", + "route" : "system/geo/regions", + "description" : "

Manage geo regions via this component

", + "module_type" : "components", + "app_type" : "core", + "category" : "admin", + "version" : "0.0.0", + "repo" : "https://.../", + "class" : "Apps\\Core\\Components\\System\\Geo\\Regions\\RegionsComponent", + "dependencies" : + { + "core" : + { + "name" : "Core", + "version" : "0.0.0", + "repo" : "https://.../" + }, + "components" : [], + "packages" : [], + "middlewares" : [], + "views" : [], + "external" : [], + "externals" : [] + }, + "menu" : + { + "system" : + { + "title" : "system", + "icon" : "cogs", + "childs" : + { + "geolocations" : + { + "title" : "geo locations", + "icon" : "globe", + "childs" : + { + "regions" : + { + "title" : "regions", + "icon" : "circle-dot", + "link" : "system/geo/regions" + } + } + } + } + }, + "seq" : "0" + }, + "settings" : + { + "mandatory" : + { + "core" : true + } + }, + "widgets" : [] +} \ No newline at end of file diff --git a/apps/Core/Components/System/Geo/Regions/RegionsComponent.php b/apps/Core/Components/System/Geo/Regions/RegionsComponent.php new file mode 100644 index 000000000..7919a57bd --- /dev/null +++ b/apps/Core/Components/System/Geo/Regions/RegionsComponent.php @@ -0,0 +1,110 @@ +geoRegions = $this->basepackages->geoRegions->init(); + } + + /** + * @acl(name=view) + */ + public function viewAction() + { + $regionsArr = $this->basepackages->geoRegions->getAll()->geoRegions; + + if (isset($this->getData()['id'])) { + if ($this->getData()['id'] != 0) { + $region = $this->basepackages->geoRegions->getById($this->getData()['id']); + + $this->view->region = $region; + } + + if (!$this->view->region) { + return $this->throwIdNotFound(); + } + + $this->view->regions = [$regionsArr[$region['parent_region_id']]]; + + $this->view->pick('regions/view'); + + return; + } + + $controlActions = + [ + 'actionsToEnable' => + [ + 'view' => 'system/geo/regions', + ] + ]; + + + if ($this->request->isPost()) { + $replaceColumns = + function ($dataArr) use ($regionsArr) { + if ($dataArr && is_array($dataArr) && count($dataArr) > 0) { + return $this->replaceColumns($regionsArr, $dataArr); + } + + return $dataArr; + }; + } else { + $replaceColumns = []; + } + + $this->generateDTContent( + $this->geoRegions, + 'system/geo/regions/view', + null, + ['name', 'parent_region_id'], + true, + ['name', 'parent_region_id'], + $controlActions, + ['parent_region_id' => 'Parent Region'], + $replaceColumns, + 'name', + ); + + $this->view->pick('regions/list'); + } + + protected function replaceColumns($regionsArr, $dataArr) + { + foreach ($dataArr as $dataKey => &$data) { + if (isset($data['parent_region_id']) && isset($regionsArr[$data['parent_region_id']])) { + $data['parent_region_id'] = $regionsArr[$data['parent_region_id']]['name']; + } else { + $data['parent_region_id'] = '-'; + } + } + + return $dataArr; + } + + /** + * @acl(name=add) + */ + public function addAction() + { + // + } + + /** + * @acl(name=update) + */ + public function updateAction() + { + // + } +} \ No newline at end of file diff --git a/apps/Core/Components/System/Geo/States/StatesComponent.php b/apps/Core/Components/System/Geo/States/StatesComponent.php index 81f293554..6e2495d80 100644 --- a/apps/Core/Components/System/Geo/States/StatesComponent.php +++ b/apps/Core/Components/System/Geo/States/StatesComponent.php @@ -27,37 +27,36 @@ public function viewAction() if ($this->getData()['id'] != 0) { $state = $this->basepackages->geoStates->getById($this->getData()['id']); - if (!$state) { - return $this->throwIdNotFound(); - } - $this->view->state = $state; - } else { - $this->view->state = []; } - $this->view->countries = $countriesArr; + if (!$this->view->state) { + return $this->throwIdNotFound(); + } + + $this->view->countries = [$countriesArr[$state['country_id']]]; $this->view->pick('states/view'); return; } - $countries = []; - - foreach ($countriesArr as $countriesKey => $country) { - $countries[$country['id']] = $country['name'] . ' (' . $country['id'] . ')'; - } $controlActions = [ // 'includeQ' => true, 'actionsToEnable' => [ - 'edit' => 'system/geo/states', + 'view' => 'system/geo/states', ] ]; if ($this->request->isPost()) { + $countries = []; + + foreach ($countriesArr as $countriesKey => $country) { + $countries[$country['id']] = $country['name'] . ' (' . $country['id'] . ')'; + } + $replaceColumns = [ 'country_id' => @@ -92,14 +91,7 @@ public function viewAction() */ public function addAction() { - $this->requestIsPost(); - - $this->geoStates->addState($this->postData()); - - $this->addResponse( - $this->geoStates->packagesData->responseMessage, - $this->geoStates->packagesData->responseCode - ); + // } /** @@ -107,14 +99,7 @@ public function addAction() */ public function updateAction() { - $this->requestIsPost(); - - $this->geoStates->updateState($this->postData()); - - $this->addResponse( - $this->geoStates->packagesData->responseMessage, - $this->geoStates->packagesData->responseCode - ); + // } public function searchStateAction() @@ -128,13 +113,15 @@ public function searchStateAction() return; } - $searchStates = $this->basepackages->geoStates->searchStates($searchQuery); + $states = $this->geoStates->searchStates($searchQuery); - if ($searchStates) { - $this->view->responseCode = $this->basepackages->geoStates->packagesData->responseCode; + $states = msort($states, 'id'); - $this->view->states = $this->basepackages->geoStates->packagesData->states; - } + $this->addResponse( + $this->geoStates->packagesData->responseMessage, + $this->geoStates->packagesData->responseCode, + ['states' => $states] ?? [] + ); } else { $this->addResponse('Search Query Missing', 1); } diff --git a/apps/Core/Components/System/Geo/Timezones/TimezonesComponent.php b/apps/Core/Components/System/Geo/Timezones/TimezonesComponent.php index ea5eb52b2..b87ed925b 100644 --- a/apps/Core/Components/System/Geo/Timezones/TimezonesComponent.php +++ b/apps/Core/Components/System/Geo/Timezones/TimezonesComponent.php @@ -4,7 +4,6 @@ use Apps\Core\Packages\Adminltetags\Traits\DynamicTable; use System\Base\BaseComponent; -use System\Base\Providers\BasepackagesServiceProvider\Packages\Geo\GeoExtractData; class TimezonesComponent extends BaseComponent { @@ -22,55 +21,31 @@ public function initialize() */ public function viewAction() { - $countriesArr = $this->basepackages->geoCountries->getAll()->geoCountries; - if (isset($this->getData()['id'])) { if ($this->getData()['id'] != 0) { $timezone = $this->basepackages->geoTimezones->getById($this->getData()['id']); - if (!$timezone) { - return $this->throwIdNotFound(); - } - $this->view->timezone = $timezone; - } else { - $this->view->timezone = []; } - $this->view->countries = $countriesArr; + if (!$this->view->timezone) { + return $this->throwIdNotFound(); + } $this->view->pick('timezones/view'); return; } - $countries = []; - - foreach ($countriesArr as $countriesKey => $country) { - $countries[$country['id']] = $country['name'] . ' (' . $country['id'] . ')'; - } $controlActions = [ // 'includeQ' => true, 'actionsToEnable' => [ - 'edit' => 'system/geo/timezones', + 'view' => 'system/geo/timezones', ] ]; - if ($this->request->isPost()) { - $replaceColumns = - [ - 'country_id' => - [ - 'html' => $countries - ] - ]; - - } else { - $replaceColumns = []; - } - $this->generateDTContent( $this->geoTimezones, 'system/geo/timezones/view', @@ -80,9 +55,8 @@ public function viewAction() ['zone_name', 'tz_name', 'gmt_offset', 'gmt_offset_name', 'abbreviation', 'gmt_offset_dst', 'gmt_offset_name_dst', 'abbreviation_dst'], $controlActions, ['gmt_offset'=>'gmt offset (secs)','gmt_offset_dst'=>'gmt offset DST (secs)','tz_name'=>'time zone name'], - $replaceColumns, - 'zone_name', - // $dtAdditionControlButtons + null, + 'zone_name' ); $this->view->pick('timezones/list'); @@ -93,14 +67,7 @@ public function viewAction() */ public function addAction() { - $this->requestIsPost(); - - $this->geoTimezones->addTimezone($this->postData()); - - $this->addResponse( - $this->geoTimezones->packagesData->responseMessage, - $this->geoTimezones->packagesData->responseCode - ); + // } /** @@ -108,36 +75,6 @@ public function addAction() */ public function updateAction() { - $this->requestIsPost(); - - $this->geoTimezones->updateTimezone($this->postData()); - - $this->addResponse( - $this->geoStates->packagesData->responseMessage, - $this->geoStates->packagesData->responseCode - ); - } - - public function searchTimezonesAction() - { - $this->requestIsPost(); - - if ($this->postData()['search']) { - $searchQuery = $this->postData()['search']; - - if (strlen($searchQuery) < 3) { - return; - } - - $searchTimezones = $this->basepackages->geoTimezones->searchTimezones($searchQuery); - - if ($searchTimezones) { - $this->view->responseCode = $this->basepackages->geoTimezones->packagesData->responseCode; - - $this->view->timezones = $this->basepackages->geoTimezones->packagesData->timezones; - } - } else { - $this->addResponse('Search Query Missing', 1); - } + // } } \ No newline at end of file diff --git a/apps/Core/Components/System/Tags/Install/component.json b/apps/Core/Components/System/Tags/Install/component.json new file mode 100644 index 000000000..31a478016 --- /dev/null +++ b/apps/Core/Components/System/Tags/Install/component.json @@ -0,0 +1,52 @@ +{ + "name" : "Tags", + "route" : "system/tags", + "description" : "

Manage Tags via this component

", + "module_type" : "components", + "app_type" : "core", + "category" : "admin", + "version" : "0.0.0", + "repo" : "https://.../", + "class" : "Apps\\Core\\Components\\System\\Tags\\TagsComponent", + "dependencies" : + { + "core" : + { + "name" : "Core", + "version" : "0.0.0", + "repo" : "https://.../" + }, + "components" : [], + "packages" : [], + "middlewares" : [], + "views" : [], + "external" : [], + "externals" : [] + }, + "menu" : + { + "system" : + { + "title" : "system", + "icon" : "cogs", + "childs" : + { + "tags" : + { + "title" : "tags", + "icon" : "tags", + "link" : "system/tags" + } + } + }, + "seq" : "0" + }, + "settings" : + { + "mandatory" : + { + "core" : true + } + }, + "widgets" : [] +} \ No newline at end of file diff --git a/apps/Core/Components/System/Tags/TagsComponent.php b/apps/Core/Components/System/Tags/TagsComponent.php new file mode 100644 index 000000000..e61056e27 --- /dev/null +++ b/apps/Core/Components/System/Tags/TagsComponent.php @@ -0,0 +1,129 @@ +tags = $this->basepackages->tags->init(); + } + + /** + * @acl(name=view) + */ + public function viewAction() + { + if (isset($this->getData()['id'])) { + $this->view->packages = $this->modules->packages->packages; + + if ($this->getData()['id'] != 0) { + $tag = $this->basepackages->tags->getById((int) $this->getData()['id']); + + $this->view->tag = $tag; + + if (!$this->view->tag) { + return $this->throwIdNotFound(); + } + } + + $this->view->pick('tags/view'); + + return; + } + + $controlActions = + [ + 'actionsToEnable' => + [ + 'edit' => 'system/tags', + 'remove' => 'system/tags/remove', + ] + ]; + + if ($this->request->isPost()) { + $numberOfTimesUsed = 0; + + $replaceColumns = + function ($dataArr) { + if ($dataArr && is_array($dataArr) && count($dataArr) > 0) { + foreach ($dataArr as &$data) { + $data['package_row_ids'] = count($data['package_row_ids']); + $data['name'] = '' . $data['name'] . ''; + } + } + + return $dataArr; + }; + } else { + $replaceColumns = []; + } + + $this->generateDTContent( + package : $this->tags, + postUrl : 'system/tags/view', + postUrlParams : null, + columnsForTable : ['name', 'package_name', 'swatch', 'package_row_ids'], + columnsForFilter : ['name', 'package_name', 'swatch'], + controlActions : $controlActions, + dtReplaceColumnsTitle : ['package_row_ids' => '# of times used'], + dtReplaceColumns :$replaceColumns, + dtNotificationTextFromColumn :'name', + excludeColumns : ['swatch'] + ); + + $this->view->pick('tags/list'); + } + + /** + * @acl(name=add) + */ + public function addAction() + { + $this->requestIsPost(); + + $this->tags->addTag($this->postData()); + + $this->addResponse( + $this->tags->packagesData->responseMessage, + $this->tags->packagesData->responseCode + ); + } + + /** + * @acl(name=update) + */ + public function updateAction() + { + $this->requestIsPost(); + + $this->tags->updateTag($this->postData()); + + $this->addResponse( + $this->tags->packagesData->responseMessage, + $this->tags->packagesData->responseCode + ); + } + + /** + * @acl(name=remove) + */ + public function removeAction() + { + $this->requestIsPost(); + + $this->tags->removeTag($this->postData()); + + $this->addResponse( + $this->tags->packagesData->responseMessage, + $this->tags->packagesData->responseCode + ); + } +} \ No newline at end of file diff --git a/apps/Core/Components/System/Users/Roles/RolesComponent.php b/apps/Core/Components/System/Users/Roles/RolesComponent.php index 775d4b840..827b2e830 100644 --- a/apps/Core/Components/System/Users/Roles/RolesComponent.php +++ b/apps/Core/Components/System/Users/Roles/RolesComponent.php @@ -35,7 +35,7 @@ public function viewAction() if ($role) { $app = $this->apps->getAppInfo(); - $middlewares = $this->modules->middlewares->getMiddlewaresForAppType($app['app_type'],null); + $middlewares = $this->modules->middlewares->middlewares; $middlewareEnabledForApps = []; @@ -59,6 +59,7 @@ public function viewAction() if (count($middlewareEnabledForApps) > 0) { $this->view->aclMiddlewareEnabled = true; + foreach ($components as $key => $component) { if (!in_array($component['id'], $middlewareEnabledForApps)) { unset($components[$key]); diff --git a/apps/Core/Packages/Adminltetags/Tags/Addresses/Single.php b/apps/Core/Packages/Adminltetags/Tags/Addresses/Single.php index 816236fa2..8022a454f 100644 --- a/apps/Core/Packages/Adminltetags/Tags/Addresses/Single.php +++ b/apps/Core/Packages/Adminltetags/Tags/Addresses/Single.php @@ -701,8 +701,9 @@ protected function inclCityJs() $("#security-token").attr("name", response.tokenKey); $("#security-token").val(response.token); } - if (response.cities) { - return response.cities; + + if (response.responseData.cities) { + return response.responseData.cities; } else { return []; } @@ -827,8 +828,9 @@ protected function inclPostCodeJs() $("#security-token").attr("postcode", response.tokenKey); $("#security-token").val(response.token); } - if (response.postCodes) { - return response.postCodes; + + if (response.responseData.postCodes) { + return response.responseData.postCodes; } else { return []; } @@ -951,8 +953,9 @@ protected function inclStateJs() $("#security-token").attr("name", response.tokenKey); $("#security-token").val(response.token); } - if (response.states) { - return response.states; + + if (response.responseData.states) { + return response.responseData.states; } else { return []; } @@ -1062,8 +1065,8 @@ protected function inclCountryJs() $("#security-token").val(response.token); } - if (response.countries) { - return response.countries; + if (response.responseData.countries) { + return response.responseData.countries; } else { return []; } diff --git a/apps/Core/Packages/Adminltetags/Tags/Fields/Files/Dropzone.php b/apps/Core/Packages/Adminltetags/Tags/Fields/Files/Dropzone.php index e05a9940f..157a7dfb4 100644 --- a/apps/Core/Packages/Adminltetags/Tags/Fields/Files/Dropzone.php +++ b/apps/Core/Packages/Adminltetags/Tags/Fields/Files/Dropzone.php @@ -311,7 +311,7 @@ protected function generateContent() } $this->content .= - '
  • '; + '
  • '; if (isset($this->params['sortable']) && $this->params['sortable'] === true @@ -631,7 +631,7 @@ function initEvents() { var newList = ""; newList += - \'
  • \'; + \'
  • \'; if (sortable === true) { newList += @@ -953,4 +953,4 @@ function collectData() { return $inclJs; } -} \ No newline at end of file +} diff --git a/apps/Core/Packages/Adminltetags/Tags/Fields/Jstree.php b/apps/Core/Packages/Adminltetags/Tags/Fields/Jstree.php index c645a1755..ea9bee220 100644 --- a/apps/Core/Packages/Adminltetags/Tags/Fields/Jstree.php +++ b/apps/Core/Packages/Adminltetags/Tags/Fields/Jstree.php @@ -184,10 +184,16 @@ protected function generateContent() ] ); + if (!isset($this->params['fieldJstreeHeight'])) { + $this->fieldParams['fieldJstreeHeight'] = '400'; + } else { + $this->fieldParams['fieldJstreeHeight'] = $this->params['fieldJstreeHeight']; + } + if (!isset($this->params['fieldJstreeAdditionalClass'])) { - $this->fieldParams['fieldJstreeAdditionalClass'] = 'height-control-400'; + $this->fieldParams['fieldJstreeAdditionalClass'] = 'height-control-' . $this->fieldParams['fieldJstreeHeight']; } else { - $this->fieldParams['fieldJstreeAdditionalClass'] = $this->params['fieldJstreeAdditionalClass'] . ' height-control-400'; + $this->fieldParams['fieldJstreeAdditionalClass'] = $this->params['fieldJstreeAdditionalClass'] . ' height-control-' . $this->fieldParams['fieldJstreeHeight']; } $this->content .= diff --git a/apps/Core/Packages/Adminltetags/Tags/Fields/Textarea.php b/apps/Core/Packages/Adminltetags/Tags/Fields/Textarea.php index b6faf31d7..38b6367e0 100644 --- a/apps/Core/Packages/Adminltetags/Tags/Fields/Textarea.php +++ b/apps/Core/Packages/Adminltetags/Tags/Fields/Textarea.php @@ -58,6 +58,10 @@ protected function generateContent() 'cols="' . $this->params['fieldTextareaCols'] . '"' : ''; + if (is_array($this->fieldParams['fieldValue'])) { + $this->fieldParams['fieldValue'] = $this->adminLTETags->helper->encode($this->fieldParams['fieldValue']); + } + $this->content .= ''; } diff --git a/apps/Core/Packages/Devtools/DicExtractData/Data/words_alpha.txt b/apps/Core/Packages/Devtools/DicExtractData/Data/words_alpha.txt index 82fb0a0c9..d3a119e7c 100644 --- a/apps/Core/Packages/Devtools/DicExtractData/Data/words_alpha.txt +++ b/apps/Core/Packages/Devtools/DicExtractData/Data/words_alpha.txt @@ -56939,6 +56939,7 @@ cibation cibbaria cibboria cybele +cyber cybercultural cyberculture cybernate @@ -346813,7 +346814,6 @@ unneath unneatly unneatness unnebulous -unneccessary unnecessary unnecessaries unnecessarily diff --git a/apps/Core/Packages/Devtools/GeoExtractData/Data b/apps/Core/Packages/Devtools/GeoExtractData/Data index ef904824b..16e6db886 160000 --- a/apps/Core/Packages/Devtools/GeoExtractData/Data +++ b/apps/Core/Packages/Devtools/GeoExtractData/Data @@ -1 +1 @@ -Subproject commit ef904824bd7591cb6120a707920f313590f30e8f +Subproject commit 16e6db886f6a19ba8860686614567fd0c74edcdd diff --git a/apps/Core/Packages/Devtools/Modules/DevtoolsModules.php b/apps/Core/Packages/Devtools/Modules/DevtoolsModules.php index e651ca3e8..2f82a280a 100644 --- a/apps/Core/Packages/Devtools/Modules/DevtoolsModules.php +++ b/apps/Core/Packages/Devtools/Modules/DevtoolsModules.php @@ -359,9 +359,13 @@ protected function precheck($data) if ($data['api_id'] != '0' && ($data['repo'] === 'https://.../' || $data['repo'] === '') ) { - $this->addResponse('Repository is not local, please provide correct module repo url.', 1); + if ($data['app_type'] !== 'core' || + ($data['app_type'] === 'core' && $data['name'] === 'Core') + ) { + $this->addResponse('Repository is not local, please provide correct module repo url.', 1); - return false; + return false; + } } if (!isset($data['module_type']) || @@ -380,36 +384,46 @@ protected function precheck($data) return false; } - if ($data['module_type'] === 'components') { - $data = $this->checkAppType($data); - $data = $this->checkModuleTypeAndCategory($data); - $data['class'] = str_replace('Apps\\' . ucfirst($data['app_type']) . '\\' . ucfirst($data['module_type']) . '\\', '', $data['class']); - $data['class'] = str_replace('Component', '', $data['class']); - $classArr = explode('\\', $data['class']); - array_pop($classArr); + if (isset($data['module_type'])) { + if ($data['module_type'] === 'components') { + $data = $this->checkAppType($data); + $data = $this->checkModuleTypeAndCategory($data); + $data['class'] = str_replace('Apps\\' . ucfirst($data['app_type']) . '\\' . ucfirst($data['module_type']) . '\\', '', $data['class']); + $data['class'] = str_replace('Component', '', $data['class']); + $classArr = explode('\\', $data['class']); + array_pop($classArr); - $routeArr = explode('/', trim($data['route'], '/')); - array_walk($routeArr, function(&$route) { - $route = ucfirst($route); - }); + $routeArr = explode('/', trim($data['route'], '/')); + array_walk($routeArr, function(&$route) { + $route = ucfirst($route); + }); - $compare = array_diff($classArr, $routeArr); + $compare = array_diff($classArr, $routeArr); - if (count($compare) > 0) { - $this->addResponse('Route and class do not match!', 1); + if (count($compare) > 0) { + $this->addResponse('Route and class do not match!', 1); - return false; - } - } else if ($data['module_type'] === 'packages' || $data['module_type'] === 'middlewares') { - $classArr = explode('\\', $data['class']); + return false; + } + } else if ($data['module_type'] === 'packages' || $data['module_type'] === 'middlewares') { + $classArr = explode('\\', $data['class']); - if (strtolower($this->helper->last($classArr)) !== strtolower($data['name'])) { - $this->addResponse('Name and class do not match!', 1); + if (strtolower($this->helper->last($classArr)) !== strtolower($data['name'])) { + $this->addResponse('Name and class do not match!', 1); - return false; + return false; + } + } else if ($data['module_type'] === 'views') { + if (isset($data['is_subview']) && $data['is_subview'] == true) { + if (!isset($data['base_view_module_id']) || + (isset($data['base_view_module_id']) && $data['base_view_module_id'] == 0) + ) { + $this->addResponse('Please add base view in dependencies!', 1); + + return false; + } + } } - } else if ($data['module_type'] === 'views') { - // } return true; @@ -493,7 +507,7 @@ public function removeModule($data) $this->modules->{$module['module_type']}->remove($module['id']); } - if ($data['module_type'] !== 'bundles') { + if (isset($module['module_type']) && $data['module_type'] !== 'bundles') { $this->reCalculateFilesHash($module, true); } @@ -537,8 +551,12 @@ protected function getFilesHash($module) return $filesHash; } - public function reCalculateFilesHash($module, $remove = false, $viaGenerateRelease = false, $viaValidation = false) + public function reCalculateFilesHash($module, $remove = false, $viaGenerateRelease = false, $viaValidation = false, $force = false) { + if ($force) { + $module = $this->modules->{$module['module_type']}->getById($module['id']); + } + if (!$viaValidation) { $filesHash = $this->getFilesHash($module); @@ -551,8 +569,8 @@ public function reCalculateFilesHash($module, $remove = false, $viaGenerateRelea $filesHash = false; } - if (!$filesHash || $viaGenerateRelease) {//We only generate hash when there is no entry or when we generate a new release - if (!$viaGenerateRelease) { + if (!$filesHash || $viaGenerateRelease || $force) {//We only generate hash when there is no entry or when we generate a new release + if (!$viaGenerateRelease && !$force) { $filesHash = []; $filesHash['module_type'] = $module['module_type']; $filesHash['module_id'] = $module['id']; @@ -733,6 +751,8 @@ public function validateFilesHash($module) } if ($moduleLocationFiles && count($moduleLocationFiles['files']) > 0) { + $module['modified_files'] = []; + foreach ($moduleLocationFiles['files'] as $file) { $filePath = $file; @@ -744,9 +764,9 @@ public function validateFilesHash($module) (isset($filesHash['files_hash'][$file]) && $filesHash['files_hash'][$file] !== $hash) ) { - $module['isModified'] = true; + array_push($module['modified_files'], $file); - break; + $module['isModified'] = true; } } } @@ -919,7 +939,11 @@ protected function runInstallUninstallTruncateTable($data) $moduleToReinstall['app_type'] === 'core' ) {//Core packages. This can be a problem for packages that are not registered in the system, example(modules_packages, modules_external...) //so, the user has to update whole core. - $class = 'System\\Base\\Providers\\CoreServiceProvider\\Install\\Install'; + if ($moduleToReinstall['name'] === 'Core') { + $class = 'System\\Base\\Providers\\CoreServiceProvider\\Install\\Install'; + } else { + $class = $moduleToReinstall['class']; + } } $path = lcfirst(str_replace('\\', '/', $class) . '.php'); @@ -940,7 +964,9 @@ protected function runInstallUninstallTruncateTable($data) if (isset($data['truncate_table']) && $data['truncate_table'] == true) { $coreInstall->init([$moduleModel->getSource()])->truncate(); - } else if (isset($data['run_install_uninstall']) && $data['run_install_uninstall'] == true) { + } + + if (isset($data['run_install_uninstall']) && $data['run_install_uninstall'] == true) { if ($data['installed'] == true) { $coreInstall->init([$moduleModel->getSource()])->install(); } else { @@ -953,7 +979,9 @@ protected function runInstallUninstallTruncateTable($data) if (isset($data['truncate_table']) && $data['truncate_table'] == true && method_exists($module, 'truncate')) { $module->init()->truncate(); - } else if (isset($data['run_install_uninstall']) && $data['run_install_uninstall'] == true) { + } + + if (isset($data['run_install_uninstall']) && $data['run_install_uninstall'] == true) { if ($data['installed'] == true) { $module->init()->install(); } else { @@ -3525,7 +3553,7 @@ public function generateModuleRepoUrl($data) $this->validation->init()->add('api_id', PresenceOf::class, ["message" => "Please provide api id."]); $this->validation->add('app_type', PresenceOf::class, ["message" => "Please provide app type."]); $this->validation->add('module_type', PresenceOf::class, ["message" => "Please provide module type."]); - if ($data['module_type'] !== 'bundles') { + if ($data['module_type'] !== 'bundles' && $data['module_type'] !== 'apps_types') { $this->validation->add('category', PresenceOf::class, ["message" => "Please provide module category."]); } diff --git a/apps/Core/Views/Default/html/dashboards/dashboards.html b/apps/Core/Views/Default/html/dashboards/dashboards.html index 4296b35be..bb70ba958 100644 --- a/apps/Core/Views/Default/html/dashboards/dashboards.html +++ b/apps/Core/Views/Default/html/dashboards/dashboards.html @@ -496,6 +496,7 @@
    No widgets added to this d href + e.params.data.id ); + $('#{{componentId}}-{{sectionId}}-no-widgets').attr('hidden', true); $('#{{componentId}}-{{sectionId}}-dashboard-loader').attr('hidden', false); initGrid(); populateGridStructure(); diff --git a/apps/Core/Views/Default/html/dashboards/dashboards/dashboard.html b/apps/Core/Views/Default/html/dashboards/dashboards/dashboard.html index 69ece22a4..fb419dad9 100644 --- a/apps/Core/Views/Default/html/dashboards/dashboards/dashboard.html +++ b/apps/Core/Views/Default/html/dashboards/dashboards/dashboard.html @@ -5,6 +5,24 @@ {% set dashboardId = '' %} {% set title = 'New Dashboard' %} {% endif %} +{% set formButtons = + [ + 'updateButtonId' : dashboardId, + 'addActionUrl' : 'dashboards/add', + 'addSuccessRedirectUrl' : 'dashboards', + 'updateActionUrl' : 'dashboards/update', + 'updateSuccessRedirectUrl' : 'dashboards', + 'cancelActionUrl' : 'dashboards', + 'closeActionUrl' : 'dashboards' + ] +%} +{% if dashboard['app_default'] is defined and dashboard['app_default'] == true %} +{% set formButtons = + [ + 'closeActionUrl' : 'dashboards' + ] +%} +{% endif %} {{adminltetags.useTag('content', [ 'component' : component, @@ -20,15 +38,6 @@ 'cardTitle' : title, 'cardAdditionalClass' : 'rounded-0', 'cardBodyInclude' : 'dashboards/dashboards/form', - 'formButtons' : - [ - 'updateButtonId' : dashboardId, - 'addActionUrl' : 'dashboards/add', - 'addSuccessRedirectUrl' : 'dashboards', - 'updateActionUrl' : 'dashboards/update', - 'updateSuccessRedirectUrl' : 'dashboards', - 'cancelActionUrl' : 'dashboards', - 'closeActionUrl' : 'dashboards' - ] + 'formButtons' : formButtons ] )}} \ No newline at end of file diff --git a/apps/Core/Views/Default/html/dashboards/dashboards/form.html b/apps/Core/Views/Default/html/dashboards/dashboards/form.html index 87341fd9c..5d35fcd68 100644 --- a/apps/Core/Views/Default/html/dashboards/dashboards/form.html +++ b/apps/Core/Views/Default/html/dashboards/dashboards/form.html @@ -1,3 +1,4 @@ +{% set nameDisabled = false %} {% set defaultDisabled = false %} {% set defaultChecked = false %} {% set appDefaultChecked = false %} @@ -10,6 +11,7 @@ {% if dashboard['app_default'] is defined and dashboard['app_default'] == true %} {% set appDefaultChecked = true %} {% set defaultDisabled = true %} + {% set nameDisabled = true %} {% endif %} {% set dashboardShared = dashboard['shared'] %} {% else %} @@ -56,6 +58,7 @@ 'fieldHelp' : true, 'fieldHelpTooltipContent' : 'Dashboard Name', 'fieldRequired' : true, + 'fieldDisabled' : nameDisabled, 'fieldBazScan' : true, 'fieldBazJstreeSearch' : true, 'fieldBazPostOnCreate' : true, @@ -66,80 +69,85 @@ ] )}} -
    - {{adminltetags.useTag('fields', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'sectionId' : sectionId, - 'fieldId' : 'user_default', - 'fieldLabel' : 'Dashboard is user default?', - 'fieldHelp' : true, - 'fieldHelpTooltipContent' : "Check to make the dashboard user's default dashboard.", - 'fieldType' : 'checkbox', - 'fieldDisabled' : false, - 'fieldCheckboxType' : 'info', - 'fieldCheckboxChecked' : defaultChecked, - 'fieldCheckboxAdditionClass' : 'text-sm text-uppercase', - 'fieldBazPostOnCreate' : true, - 'fieldBazPostOnUpdate' : true, - 'fieldBazJstreeSearch' : true, - 'fieldBazScan' : true - ] - )}} -
    -
    - {{adminltetags.useTag('fields', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'sectionId' : sectionId, - 'fieldId' : 'app_default', - 'fieldLabel' : 'Dashboard is App default?', - 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'Check to make the dashboard default dashboard.', - 'fieldType' : 'checkbox', - 'fieldDisabled' : true, - 'fieldCheckboxType' : 'success', - 'fieldCheckboxChecked' : appDefaultChecked, - 'fieldCheckboxAdditionClass' : 'text-sm text-uppercase', - 'fieldBazPostOnCreate' : false, - 'fieldBazPostOnUpdate' : false, - 'fieldBazJstreeSearch' : true, - 'fieldBazScan' : true - ] - )}} -
    + {% if not appDefaultChecked %} +
    + {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'user_default', + 'fieldLabel' : 'Dashboard is user default?', + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : "Check to make the dashboard user's default dashboard.", + 'fieldType' : 'checkbox', + 'fieldDisabled' : false, + 'fieldCheckboxType' : 'info', + 'fieldCheckboxChecked' : defaultChecked, + 'fieldCheckboxAdditionClass' : 'text-sm text-uppercase', + 'fieldBazPostOnCreate' : true, + 'fieldBazPostOnUpdate' : true, + 'fieldBazJstreeSearch' : true, + 'fieldBazScan' : true + ] + )}} +
    + {% else %} +
    + {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'app_default', + 'fieldLabel' : 'Dashboard is App default?', + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Check to make the dashboard default dashboard.', + 'fieldType' : 'checkbox', + 'fieldDisabled' : true, + 'fieldCheckboxType' : 'success', + 'fieldCheckboxChecked' : appDefaultChecked, + 'fieldCheckboxAdditionClass' : 'text-sm text-uppercase', + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldBazJstreeSearch' : true, + 'fieldBazScan' : true + ] + )}} +
    + {% endif %} -
    -
    - {{adminltetags.useTag('fields', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'sectionId' : sectionId, - 'fieldId' : 'shared', - 'fieldLabel' : 'Shared', - 'fieldType' : 'select2', - 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'Select Accounts to share dashboard with', - 'fieldBazScan' : true, - 'fieldRequired' : false, - 'fieldBazPostOnCreate' : true, - 'fieldBazPostOnUpdate' : true, - 'fieldDataSelect2Options' : sharedAccounts, - 'fieldDataSelect2Multiple' : true, - 'fieldDataSelect2OptionsKey' : 'id', - 'fieldDataSelect2OptionsValue' : 'email', - 'fieldDataSelect2OptionsArray' : true, - 'fieldDataSelect2OptionsSelected': dashboardShared - ] - )}} + {% if not appDefaultChecked %} +
    +
    + {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'shared', + 'fieldLabel' : 'Shared', + 'fieldType' : 'select2', + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Select Accounts to share dashboard with', + 'fieldBazScan' : true, + 'fieldRequired' : false, + 'fieldBazPostOnCreate' : true, + 'fieldBazPostOnUpdate' : true, + 'fieldDataSelect2Options' : sharedAccounts, + 'fieldDataSelect2Multiple' : true, + 'fieldDataSelect2OptionsKey' : 'id', + 'fieldDataSelect2OptionsValue' : 'email', + 'fieldDataSelect2OptionsArray' : true, + 'fieldDataSelect2OptionsSelected': dashboardShared + ] + )}} +
    -
    + {% endif %} + \ No newline at end of file diff --git a/apps/Core/Views/Default/html/devtools/modules/local.html b/apps/Core/Views/Default/html/devtools/modules/local.html new file mode 100644 index 000000000..a93e96eb9 --- /dev/null +++ b/apps/Core/Views/Default/html/devtools/modules/local.html @@ -0,0 +1,265 @@ + +{% set apptypesURL = links.url('devtools/modules/q/module/true/type/apptypes/id/0') %} +{% set componentsURL = links.url('devtools/modules/q/module/true/type/components/id/0') %} +{% set packagesURL = links.url('devtools/modules/q/module/true/type/packages/id/0') %} +{% set middlewaresURL = links.url('devtools/modules/q/module/true/type/middlewares/id/0') %} +{% set viewsURL = links.url('devtools/modules/q/module/true/type/views/id/0') %} +{% set subViewsURL = links.url('devtools/modules/q/module/true/type/views/subview/true/id/0') %} +{% set bundlesURL = links.url('devtools/modules/q/bundles/true/id/0') %} +{% if includecoremodules is defined and includecoremodules === true %} + {% set componentsURL = componentsURL ~ '/includecoremodules/true' %} + {% set packagesURL = packagesURL ~ '/includecoremodules/true' %} + {% set middlewaresURL = middlewaresURL ~ '/includecoremodules/true' %} + {% set viewsURL = viewsURL ~ '/includecoremodules/true' %} +{% endif %} +
    +
    + {% set includeCoreModulesChecked = false %} + {% if includecoremodules is defined and includecoremodules == true %} + {% set includeCoreModulesChecked = true %} + {% endif %} + {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'include_core_modules', + 'fieldLabel' : 'Include Core Modules?', + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Include Core modules in the list of modules?', + 'fieldType' : 'checkbox', + 'fieldCheckboxType' : 'info', + 'fieldCheckboxChecked' : includeCoreModulesChecked, + 'fieldCheckboxAdditionClass' : 'text-sm text-uppercase', + 'fieldBazPostOnCreate' : true, + 'fieldBazPostOnUpdate' : true, + 'fieldBazJstreeSearch' : true, + 'fieldBazScan' : true + ] + )}} +
    +
    + {{adminltetags.useTag('buttons', + [ + 'componentId' : componentId, + 'sectionId' : sectionId, + 'buttonType' : 'button', + 'buttons' : + [ + 'check-for-changes' : [ + 'title' : 'Check for module changes', + 'type' : 'info', + 'icon' : 'code' + ] + ] + ] + )}} +
    +
    + {{adminltetags.useTag('buttons', + [ + 'componentId' : componentId, + 'sectionId' : sectionId, + 'buttonType' : 'DropdownSplitButtons', + 'buttonLabel' : false, + 'dropdownButtonId' : 'main', + 'dropdownButtonTitle' : 'Add new module', + 'dropdownButtonIcon' : 'plus', + 'dropdownButtonAdditionalClass' : 'text-uppercase', + 'dropdownAlign' : 'right', + 'buttonPosition' : 'right', + 'dropdowns' : + { + 'apptypes' : { + 'title' : 'App Type', + 'type' : 'primary', + 'additionalClass' : 'contentAjaxLink', + 'url' : apptypesURL + }, + 'components' : { + 'title' : 'Component', + 'type' : 'primary', + 'additionalClass' : 'contentAjaxLink', + 'url' : componentsURL + }, + 'packages' : { + 'title' : 'Package', + 'type' : 'primary', + 'additionalClass' : 'contentAjaxLink', + 'url' : packagesURL + }, + 'middlewares' : { + 'title' : 'Middleware', + 'type' : 'primary', + 'additionalClass' : 'contentAjaxLink', + 'url' : middlewaresURL + }, + 'views' : { + 'title' : 'View', + 'type' : 'primary', + 'additionalClass' : 'contentAjaxLink', + 'url' : viewsURL + }, + 'subviews' : { + 'title' : 'Sub View', + 'type' : 'primary', + 'additionalClass' : 'contentAjaxLink', + 'url' : subViewsURL + }, + 'divider' : 'divider', + 'bundles' : { + 'title' : 'Modules Bundle', + 'type' : 'primary', + 'additionalClass' : 'contentAjaxLink', + 'url' : bundlesURL + } + } + ] + )}} + {{adminltetags.useTag('buttons', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'buttonType' : 'button', + 'buttons' : + [ + 'modules-link' : [ + 'title' : 'link', + 'size' : 'xs', + 'disabled' : true, + 'hidden' : true, + 'url' : '#' + ] + ] + ] + )}} +
    +
    +
    +
    +
    + {% set modulesTable = '' %} + {% for moduletype, modulesArr in modules %} + {% if modulesArr['childs'] is defined and modulesArr['childs']|length > 0 %} + {% for module in modulesArr['childs'] %} + {% set installed = 'NO' %} + {% if module['name'] == 'Core' %} + {% set installed = 'YES' %} + {% endif %} + {% if module['installed'] is defined and module['installed'] == true %} + {% set installed = 'YES' %} + {% endif %} + {% if module['display_name'] is not defined %} + {% set module['display_name'] = module['name'] %} + {% endif %} + {% if module['module_type'] is not defined %} + {% set module['module_type'] = moduletype %} + {% endif %} + {% set subview = '' %} + {% set moduleType = module['module_type'] %} + {% if module['module_type'] == 'views' %} + {% set subview = 'data-subview="false"' %} + {% if module['is_subview'] == true %} + {% set moduleType = 'views (sub)' %} + {% set subview = 'data-subview="true"' %} + {% endif %} + {% endif %} + {% set dropdowns = + ' + Generate Release + ' + %} + {% if module['name'] != 'Core' %} + {% if module['module_type'] != 'apptypes' and module['module_type'] != 'bundles' %} + {% set dropdowns = dropdowns ~ + ' + Clone + ' + %} + {% endif %} + {% set dropdowns = dropdowns ~ + ' + + Remove + ' + %} + {% if module['module_type'] == 'bundles' %} + {% set dropdowns = dropdowns ~ + ' + + Commit Bundle Json To Repo + ' + %} + {% endif %} + {% endif %} + {% set actionButtons = + '
    + + Edit + + +
    ' + %} + {% set modulesTable = modulesTable ~ + '' ~ + '' ~ module['id'] ~ '' ~ + '' ~ module['name'] ~ '' ~ + '' ~ module['display_name'] ~ '' ~ + '' ~ module['app_type'] ~ '' ~ + '' ~ moduleType ~ '' ~ + '' ~ module['version'] ~ '' ~ + '' ~ installed ~ '' ~ + '' ~ actionButtons ~ '' ~ + '' + %} + {# {{ trace([module]) }} #} + {% endfor %} + {% endif %} + {% endfor %} + {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'modules', + 'fieldLabel' : 'Modules', + 'fieldType' : 'html', + 'fieldAdditionalClass' : 'mb-0', + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Modules', + 'fieldRequired' : false, + 'fieldBazScan' : true, + 'fieldBazPostOnUpdate' : true, + 'fieldHtmlContent' : + '
    ' ~ + '
    ' ~ + ' ' ~ + ' ' ~ + ' ' ~ + ' ' ~ + ' ' ~ + ' ' ~ + ' ' ~ + ' ' ~ + ' ' ~ + ' ' ~ + ' ' ~ + ' ' ~ + ' ' ~ + ' ' ~ + modulesTable ~ + ' ' ~ + '
    IDnameDisplay nameapp typemodule typeversioninstalledActions
    ' ~ + '
    ' ~ + '
    ' + ] + )}} +
    +
    diff --git a/apps/Core/Views/Default/html/devtools/modules/module/menu.html b/apps/Core/Views/Default/html/devtools/modules/module/menu.html index 8673a4ec7..71365bca6 100644 --- a/apps/Core/Views/Default/html/devtools/modules/module/menu.html +++ b/apps/Core/Views/Default/html/devtools/modules/module/menu.html @@ -236,7 +236,7 @@
    {% set noMenuChecked = false %} - {% if moduleMenu == 'false' %} + {% if moduleMenu == 'false' or moduleMenu == '"false"' or moduleMenu == false %} {% set noMenuChecked = true %} {% endif %} {{adminltetags.useTag('fields', @@ -722,26 +722,27 @@
    This tool will help you cr for (var i = 0; i < parents.length; i++) { var parentNode = $('#{{componentId}}-{{sectionId}}-menu_structure').jstree().get_node(parents[i]); - var parentNodeText = parentNode.text.toLowerCase(); + var parentNodeTitle = parentNode.text.toLowerCase(); + var parentNodeKey = parentNodeTitle.replace(/ /g, ''); - menu[parentNodeText] = { }; - menu[parentNodeText]['title'] = parentNodeText; + menu[parentNodeKey] = { }; + menu[parentNodeKey]['title'] = parentNodeTitle; if (parentNode.icon) { $(parentNode.icon.split(' ')).each(function(i, iconText) { if (iconText.startsWith('fa-')) { if (iconText !== 'fa-fw') { - menu[parentNodeText]['icon'] = iconText.replace('fa-', ''); + menu[parentNodeKey]['icon'] = iconText.replace('fa-', ''); } } }); } if (parentNode.data && parentNode.data.link) { - menu[parentNodeText]['link'] = parentNode.data.link; + menu[parentNodeKey]['link'] = parentNode.data.link; } else { if (parents.length === 1) { - menu[parentNodeText]['link'] = $('#{{componentId}}-{{sectionId}}-route').val(); + menu[parentNodeKey]['link'] = $('#{{componentId}}-{{sectionId}}-route').val(); if ($('#{{componentId}}-{{sectionId}}-route').val() === '') { paginatedPNotify('error', {text: 'Link is not added to menu item because component route is missing.'}); } @@ -750,7 +751,7 @@
    This tool will help you cr var [removed, ...nodeParents] = parents; if (parents.length > 0) { - menu[parentNodeText]['childs'] = generateMenuHierarchy(nodeParents); + menu[parentNodeKey]['childs'] = generateMenuHierarchy(nodeParents); break; } diff --git a/apps/Core/Views/Default/html/devtools/modules/remote.html b/apps/Core/Views/Default/html/devtools/modules/remote.html new file mode 100644 index 000000000..a7b98f37f --- /dev/null +++ b/apps/Core/Views/Default/html/devtools/modules/remote.html @@ -0,0 +1,45 @@ +
    +
    + {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'api_id', + 'fieldLabel' : 'Remote Repo', + 'fieldType' : 'select2', + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Select repo to manage.', + 'fieldRequired' : true, + 'fieldBazScan' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : false, + 'fieldDataSelect2OptionsArray' : true, + 'fieldDataSelect2Options' : apis, + 'fieldDataSelect2OptionsKey' : 'id', + 'fieldDataSelect2OptionsValue' : 'name', + 'fieldDataSelect2OptionsSelected' : '' + ] + )}} +
    +
    +
    +
    + {{adminltetags.useTag('buttons', + [ + 'componentId' : componentId, + 'sectionId' : sectionId, + 'buttonType' : 'button', + 'buttons' : + [ + 'browse-remote-repo' : [ + 'title' : 'Browse Repo', + 'position' : 'right', + 'disabled' : true + ] + ] + ] + )}} +
    +
    \ No newline at end of file diff --git a/apps/Core/Views/Default/html/devtools/modules/repo.html b/apps/Core/Views/Default/html/devtools/modules/repo.html index 2782bda31..c5a7d4927 100644 --- a/apps/Core/Views/Default/html/devtools/modules/repo.html +++ b/apps/Core/Views/Default/html/devtools/modules/repo.html @@ -5,14 +5,18 @@ 'componentId' : componentId, 'parentComponentId' : parent, 'sectionId' : 'repo', - 'contentType' : 'section', + 'contentType' : 'sectionWithForm', 'cardHeader' : true, - 'cardFooter' : false, + 'cardFooter' : true, 'cardType' : 'primary', 'cardIcon' : 'th', 'cardTitle' : 'Remote Repo', 'cardAdditionalClass' : 'rounded-0', 'cardShowTools' : ['packageSettings'], - 'cardBodyInclude' : 'modules/repo/view' + 'cardBodyInclude' : 'modules/repo/view', + 'formButtons' : + [ + 'closeActionUrl' : 'devtools/modules' + ] ] )}} \ No newline at end of file diff --git a/apps/Core/Views/Default/html/devtools/modules/select.html b/apps/Core/Views/Default/html/devtools/modules/select.html index 88672f422..7ede26dbd 100644 --- a/apps/Core/Views/Default/html/devtools/modules/select.html +++ b/apps/Core/Views/Default/html/devtools/modules/select.html @@ -1,315 +1,26 @@ -{% set apptypesURL = links.url('devtools/modules/q/module/true/type/apptypes/id/0') %} -{% set componentsURL = links.url('devtools/modules/q/module/true/type/components/id/0') %} -{% set packagesURL = links.url('devtools/modules/q/module/true/type/packages/id/0') %} -{% set middlewaresURL = links.url('devtools/modules/q/module/true/type/middlewares/id/0') %} -{% set viewsURL = links.url('devtools/modules/q/module/true/type/views/id/0') %} -{% set subViewsURL = links.url('devtools/modules/q/module/true/type/views/subview/true/id/0') %} -{% set bundlesURL = links.url('devtools/modules/q/bundles/true/id/0') %} -{% if includecoremodules is defined and includecoremodules === true %} - {% set componentsURL = componentsURL ~ '/includecoremodules/true' %} - {% set packagesURL = packagesURL ~ '/includecoremodules/true' %} - {% set middlewaresURL = middlewaresURL ~ '/includecoremodules/true' %} - {% set viewsURL = viewsURL ~ '/includecoremodules/true' %} -{% endif %} -
    -
    -
    -
    - {{adminltetags.useTag('fields', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'sectionId' : sectionId, - 'fieldId' : 'local_modules', - 'fieldLabel' : 'Manage Local Modules', - 'fieldLabelLegend' : true, - 'fieldHidden' : false, - 'fieldType' : 'html', - 'fieldBazScan' : false, - 'fieldBazPostOnCreate' : false, - 'fieldBazPostOnUpdate' : false, - 'fieldBazJstreeSearch' : true, - 'fieldHtmlContent' : '' - ] - )}} -
    -
    -
    -
    - {% set includeCoreModulesChecked = false %} - {% if includecoremodules is defined and includecoremodules == true %} - {% set includeCoreModulesChecked = true %} - {% endif %} - {{adminltetags.useTag('fields', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'sectionId' : sectionId, - 'fieldId' : 'include_core_modules', - 'fieldLabel' : 'Include Core Modules?', - 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'Include Core modules in the list of modules?', - 'fieldType' : 'checkbox', - 'fieldCheckboxType' : 'info', - 'fieldCheckboxChecked' : includeCoreModulesChecked, - 'fieldCheckboxAdditionClass' : 'text-sm text-uppercase', - 'fieldBazPostOnCreate' : true, - 'fieldBazPostOnUpdate' : true, - 'fieldBazJstreeSearch' : true, - 'fieldBazScan' : true - ] - )}} -
    -
    - {{adminltetags.useTag('buttons', - [ - 'componentId' : componentId, - 'sectionId' : sectionId, - 'buttonType' : 'button', - 'buttons' : - [ - 'check-for-changes' : [ - 'title' : 'Check for module changes', - 'type' : 'primary', - 'icon' : 'code' - ] - ] - ] - )}} - {{adminltetags.useTag('buttons', - [ - 'componentId' : componentId, - 'sectionId' : sectionId, - 'buttonType' : 'DropdownSplitButtons', - 'buttonLabel' : false, - 'dropdownButtonId' : 'main', - 'dropdownButtonTitle' : 'Add new', - 'dropdownButtonIcon' : 'plus', - 'dropdownButtonAdditionalClass' : 'text-uppercase', - 'dropdownAlign' : 'right', - 'buttonPosition' : 'right', - 'dropdowns' : - { - 'apptypes' : { - 'title' : 'App Type', - 'type' : 'primary', - 'additionalClass' : 'contentAjaxLink', - 'url' : apptypesURL - }, - 'components' : { - 'title' : 'Component', - 'type' : 'primary', - 'additionalClass' : 'contentAjaxLink', - 'url' : componentsURL - }, - 'packages' : { - 'title' : 'Package', - 'type' : 'primary', - 'additionalClass' : 'contentAjaxLink', - 'url' : packagesURL - }, - 'middlewares' : { - 'title' : 'Middleware', - 'type' : 'primary', - 'additionalClass' : 'contentAjaxLink', - 'url' : middlewaresURL - }, - 'views' : { - 'title' : 'View', - 'type' : 'primary', - 'additionalClass' : 'contentAjaxLink', - 'url' : viewsURL - }, - 'subviews' : { - 'title' : 'Sub View', - 'type' : 'primary', - 'additionalClass' : 'contentAjaxLink', - 'url' : subViewsURL - }, - 'divider' : 'divider', - 'bundles' : { - 'title' : 'Modules Bundle', - 'type' : 'primary', - 'additionalClass' : 'contentAjaxLink', - 'url' : bundlesURL - } - } - ] - )}} -
    -
    -
    -
    - {{adminltetags.useTag('fields', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'sectionId' : sectionId, - 'fieldId' : 'modules', - 'fieldLabel' : 'Select Module', - 'fieldType' : 'select2', - 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'Module', - 'fieldRequired' : true, - 'fieldBazScan' : true, - 'fieldBazPostOnCreate' : true, - 'fieldBazPostOnUpdate' : true, - 'fieldDataSelect2AddDataAttrFromData' : ['installed', 'is_subview'], - 'fieldDataSelect2Options' : modules, - 'fieldDataSelect2OptionsKey' : 'id', - 'fieldDataSelect2OptionsValue' : 'display_name:app_type|name:app_type', - 'fieldDataSelect2OptionsSelected' : '' - ] - )}} - {{adminltetags.useTag('buttons', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'sectionId' : sectionId, - 'buttonType' : 'button', - 'buttons' : - [ - 'modules-link' : [ - 'title' : 'link', - 'size' : 'xs', - 'disabled' : true, - 'hidden' : true, - 'url' : '#' - ] - ] - ] - )}} -
    -
    -
    -
    - {{adminltetags.useTag('buttons', - [ - 'componentId' : componentId, - 'sectionId' : sectionId, - 'buttonType' : 'button', - 'buttons' : - [ - 'edit-module' : [ - 'title' : 'Edit', - 'size' : 'xs', - 'type' : 'primary', - 'icon' : 'edit', - 'position' : 'left', - 'disabled' : true - ], - 'clone-module' : [ - 'title' : 'Clone', - 'size' : 'xs', - 'type' : 'primary', - 'icon' : 'copy', - 'position' : 'left', - 'disabled' : true - ], - 'remove-module' : [ - 'title' : 'Remove', - 'size' : 'xs', - 'type' : 'danger', - 'icon' : 'trash', - 'position' : 'left', - 'disabled' : true - ], - 'generate-new-release' : [ - 'title' : 'Generate New Release', - 'size' : 'xs', - 'type' : 'success', - 'position' : 'right', - 'icon' : 'wand-magic-sparkles', - 'disabled' : true - ], - 'commit-bundle-json' : [ - 'title' : 'Commit Bundle Json to repo', - 'size' : 'xs', - 'type' : 'primary', - 'position' : 'right', - 'icon' : 'code', - 'disabled' : true - ] - ] - ] - )}} -
    -
    -
    -
    -
    -
    - {{adminltetags.useTag('fields', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'sectionId' : sectionId, - 'fieldId' : 'remote_modules', - 'fieldLabel' : 'Manage Remote Modules', - 'fieldLabelLegend' : true, - 'fieldHidden' : false, - 'fieldType' : 'html', - 'fieldBazScan' : false, - 'fieldBazPostOnCreate' : false, - 'fieldBazPostOnUpdate' : false, - 'fieldBazJstreeSearch' : true, - 'fieldHtmlContent' : '' - ] - )}} -
    -
    -
    -
    - {{adminltetags.useTag('fields', - [ - 'component' : component, - 'componentName' : componentName, - 'componentId' : componentId, - 'sectionId' : sectionId, - 'fieldId' : 'api_id', - 'fieldLabel' : 'Remote Repo', - 'fieldType' : 'select2', - 'fieldHelp' : true, - 'fieldHelpTooltipContent' : 'Select repo to manage.', - 'fieldRequired' : true, - 'fieldBazScan' : true, - 'fieldBazPostOnCreate' : false, - 'fieldBazPostOnUpdate' : false, - 'fieldDataSelect2OptionsArray' : true, - 'fieldDataSelect2Options' : apis, - 'fieldDataSelect2OptionsKey' : 'id', - 'fieldDataSelect2OptionsValue' : 'name', - 'fieldDataSelect2OptionsSelected' : '' - ] - )}} -
    -
    -
    -
    - {{adminltetags.useTag('buttons', - [ - 'componentId' : componentId, - 'sectionId' : sectionId, - 'buttonType' : 'button', - 'buttons' : - [ - 'browse-remote-repo' : [ - 'title' : 'Browse Repo', - 'position' : 'right', - 'disabled' : true - ] - ] - ] - )}} -
    -
    -
    -
    +{{adminltetags.useTag('tabs', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : 'main', + 'tabsId' : 'tabs', + 'tabsStyle' : 'card-outline-tabs', + 'tabsData' : + [ + 'local' : + [ + 'tabTitle' : 'Local', + 'tabInclude' : 'modules/local' + ], + 'remote' : + [ + 'tabTitle' : 'Remote', + 'tabInclude' : 'modules/remote' + ] + ] + ] +)}} \ No newline at end of file diff --git a/apps/Core/Views/Default/html/system/geo/holidays/list.html b/apps/Core/Views/Default/html/system/geo/holidays/list.html new file mode 100644 index 000000000..fe6eddf58 --- /dev/null +++ b/apps/Core/Views/Default/html/system/geo/holidays/list.html @@ -0,0 +1,50 @@ +{{adminltetags.useTag('content', + [ + 'component' : table['component'], + 'componentName' : componentName, + 'componentId' : componentId, + 'parentComponentId' : parent, + 'sectionId' : 'listing', + 'contentType' : 'sectionWithListing', + 'cardHeader' : true, + 'cardType' : 'primary', + 'cardIcon' : 'globe', + 'cardTitle' : 'Geo Locations (Holidays)', + 'cardAdditionalClass' : 'rounded-0', + 'cardShowTools' : ['maximize'], + 'dtFilter' : true, + 'dtFilterShowQuickFilter' : true, + 'dtFilters' : table['filters'], + 'dtFilterColumns' : table['filterColumns'], + 'dtFixedHeader' : true, + 'dtPrimaryButtons' : + { + 'componentId' : componentId, + 'sectionId' : 'listing', + 'buttonType' : 'button', + 'buttons' : + { + 'add-account' : { + 'title' : 'Add New Holiday', + 'size' : 'sm', + 'type' : 'primary', + 'icon' : 'plus', + 'buttonAdditionalClass' : 'contentAjaxLink', + 'position' : 'right', + 'url' : links.url('system/geo/holidays/q/id/0') + } + } + }, + 'dtTable' : table, + 'dtColumns' : table['columns'], + 'dtPostUrl' : table['postUrl'], + 'dtPostUrlParams' : table['postUrlParams'], + 'dtStriped' : true, + 'dtStateSave' : false, + 'dtBordered' : false, + 'dtHideIdColumn' : true, + 'dtNoOfColumnsToShow' : 6, + 'dtTableCompact' : true, + 'dtZeroRecords' : 'No holidays data available.' + ] +)}} \ No newline at end of file diff --git a/apps/Core/Views/Default/html/system/geo/holidays/view.html b/apps/Core/Views/Default/html/system/geo/holidays/view.html new file mode 100644 index 000000000..8c221aea8 --- /dev/null +++ b/apps/Core/Views/Default/html/system/geo/holidays/view.html @@ -0,0 +1,35 @@ +{% if holiday['id'] is defined %} + {% set title = 'Holiday (' ~ holiday['name'] ~ ')' %} + {% set holidayId = holiday['id'] %} +{% else %} + {% set title = 'New Holiday' %} + {% set holidayId = '' %} +{% endif %} + +{{adminltetags.useTag('content', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'parentComponentId' : parent, + 'sectionId' : 'main', + 'contentType' : 'sectionWithForm', + 'cardHeader' : true, + 'cardFooter' : true, + 'cardType' : 'primary', + 'cardIcon' : 'globe', + 'cardTitle' : title, + 'cardAdditionalClass' : 'rounded-0', + 'cardBodyInclude' : 'holidays/form', + 'formButtons' : + [ + 'updateButtonId' : holidayId, + 'addActionUrl' : 'system/geo/holidays/add', + 'addSuccessRedirectUrl' : 'system/geo/holidays', + 'updateActionUrl' : 'system/geo/holidays/update', + 'updateSuccessRedirectUrl' : 'system/geo/holidays', + 'cancelActionUrl' : 'system/geo/holidays', + 'closeActionUrl' : 'system/geo/holidays' + ] + ] +)}} \ No newline at end of file diff --git a/apps/Core/Views/Default/html/system/geo/regions/form.html b/apps/Core/Views/Default/html/system/geo/regions/form.html new file mode 100644 index 000000000..0460ad7b8 --- /dev/null +++ b/apps/Core/Views/Default/html/system/geo/regions/form.html @@ -0,0 +1,128 @@ +{% if region['id'] is defined %} + {% set regionId = region['id'] %} + {% set regionName = region['name'] %} + {% set regionParentId = region['parent_region_id'] %} +{% else %} + {% set regionId = '' %} + {% set regionName = '' %} + {% set regionParentId = '' %} +{% endif %} +
    +
    +
    +
    + {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'id', + 'fieldLabel' : 'Region ID', + 'fieldType' : 'input', + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Region ID', + 'fieldRequired' : true, + 'fieldBazScan' : true, + 'fieldBazPostOnCreate' : false, + 'fieldBazPostOnUpdate' : true, + 'fieldHidden' : true, + 'fieldDisabled' : true, + 'fieldValue' : regionId + ] + )}} +
    +
    +
    +
    + {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'name', + 'fieldLabel' : 'Name', + 'fieldType' : 'input', + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Name Example: Asian', + 'fieldRequired' : true, + 'fieldBazScan' : true, + 'fieldBazPostOnCreate' : true, + 'fieldBazPostOnUpdate' : true, + 'fieldDataInputMinLength' : 1, + 'fieldDataInputMaxLength' : 100, + 'fieldValue' : regionName + ] + )}} +
    +
    + {{adminltetags.useTag('fields', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'sectionId' : sectionId, + 'fieldId' : 'parent_region_id', + 'fieldLabel' : 'Parent Region', + 'fieldType' : 'select2', + 'fieldHelp' : true, + 'fieldHelpTooltipContent' : 'Parent Region', + 'fieldRequired' : true, + 'fieldBazScan' : true, + 'fieldBazPostOnCreate' : true, + 'fieldBazPostOnUpdate' : true, + 'fieldDataSelect2Options' : regions, + 'fieldDataSelect2OptionsKey' : 'id', + 'fieldDataSelect2OptionsValue' : 'name', + 'fieldDataSelect2OptionsArray' : true, + 'fieldDataSelect2OptionsSelected' : regionParentId + ] + )}} +
    +
    +
    +
    + \ No newline at end of file diff --git a/apps/Core/Views/Default/html/system/geo/regions/list.html b/apps/Core/Views/Default/html/system/geo/regions/list.html new file mode 100644 index 000000000..adf49a108 --- /dev/null +++ b/apps/Core/Views/Default/html/system/geo/regions/list.html @@ -0,0 +1,32 @@ +{{adminltetags.useTag('content', + [ + 'component' : table['component'], + 'componentName' : componentName, + 'componentId' : componentId, + 'parentComponentId' : parent, + 'sectionId' : 'listing', + 'contentType' : 'sectionWithListing', + 'cardHeader' : true, + 'cardType' : 'primary', + 'cardIcon' : 'globe', + 'cardTitle' : 'Geo Locations (Countries)', + 'cardAdditionalClass' : 'rounded-0', + 'cardShowTools' : ['maximize'], + 'dtFilter' : true, + 'dtFilterShowQuickFilter' : true, + 'dtFilters' : table['filters'], + 'dtFilterColumns' : table['filterColumns'], + 'dtFixedHeader' : true, + 'dtTable' : table, + 'dtColumns' : table['columns'], + 'dtPostUrl' : table['postUrl'], + 'dtPostUrlParams' : table['postUrlParams'], + 'dtStriped' : true, + 'dtStateSave' : false, + 'dtBordered' : false, + 'dtHideIdColumn' : true, + 'dtNoOfColumnsToShow' : 6, + 'dtTableCompact' : true, + 'dtZeroRecords' : 'No regions data available. Please contact developer.' + ] +)}} \ No newline at end of file diff --git a/apps/Core/Views/Default/html/system/geo/regions/view.html b/apps/Core/Views/Default/html/system/geo/regions/view.html new file mode 100644 index 000000000..9bd245741 --- /dev/null +++ b/apps/Core/Views/Default/html/system/geo/regions/view.html @@ -0,0 +1,26 @@ +{% if region['id'] is defined %} + {% set title = 'Region (' ~ region['name'] ~ ')' %} +{% else %} + {% set title = 'New Region' %} +{% endif %} +{{adminltetags.useTag('content', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'parentComponentId' : parent, + 'sectionId' : 'main', + 'contentType' : 'sectionWithForm', + 'cardHeader' : true, + 'cardFooter' : true, + 'cardType' : 'primary', + 'cardIcon' : 'map', + 'cardTitle' : title, + 'cardAdditionalClass' : 'rounded-0', + 'cardBodyInclude' : 'regions/form', + 'formButtons' : + [ + 'closeActionUrl' : 'system/geo/regions' + ] + ] +)}} \ No newline at end of file diff --git a/apps/Core/Views/Default/html/system/geo/states/list.html b/apps/Core/Views/Default/html/system/geo/states/list.html index bb3ea6d04..16757653f 100644 --- a/apps/Core/Views/Default/html/system/geo/states/list.html +++ b/apps/Core/Views/Default/html/system/geo/states/list.html @@ -17,24 +17,6 @@ 'dtFilters' : table['filters'], 'dtFilterColumns' : table['filterColumns'], 'dtFixedHeader' : true, - 'dtPrimaryButtons' : - { - 'componentId' : componentId, - 'sectionId' : 'listing', - 'buttonType' : 'button', - 'buttons' : - { - 'add-state' : { - 'title' : 'Add New State', - 'size' : 'sm', - 'type' : 'primary', - 'icon' : 'plus', - 'buttonAdditionalClass' : 'contentAjaxLink', - 'position' : 'right', - 'url' : links.url('system/geo/states/q/id/0') - } - } - }, 'dtTable' : table, 'dtColumns' : table['columns'], 'dtPostUrl' : table['postUrl'], @@ -45,6 +27,6 @@ 'dtHideIdColumn' : true, 'dtNoOfColumnsToShow' : 6, 'dtTableCompact' : true, - 'dtZeroRecords' : 'No states data available. Make sure state is installed and enabled or add state by clicking the Add new state button.' + 'dtZeroRecords' : 'No states data available. States are available when country is installed and enabled.' ] )}} \ No newline at end of file diff --git a/apps/Core/Views/Default/html/system/geo/states/view.html b/apps/Core/Views/Default/html/system/geo/states/view.html index ca24f50ab..51d2435cb 100644 --- a/apps/Core/Views/Default/html/system/geo/states/view.html +++ b/apps/Core/Views/Default/html/system/geo/states/view.html @@ -1,8 +1,6 @@ {% if state['id'] is defined %} - {% set stateId = state['id'] %} {% set title = 'State (' ~ state['name'] ~ ')' %} {% else %} - {% set stateId = '' %} {% set title = 'New State' %} {% endif %} @@ -23,12 +21,6 @@ 'cardBodyInclude' : 'states/form', 'formButtons' : [ - 'updateButtonId' : stateId, - 'addActionUrl' : 'system/geo/states/add', - 'addSuccessRedirectUrl' : 'system/geo/states', - 'updateActionUrl' : 'system/geo/states/update', - 'updateSuccessRedirectUrl' : 'system/geo/states', - 'cancelActionUrl' : 'system/geo/states', 'closeActionUrl' : 'system/geo/states' ] ] diff --git a/apps/Core/Views/Default/html/system/geo/timezones/list.html b/apps/Core/Views/Default/html/system/geo/timezones/list.html index f3724b53d..b535a9456 100644 --- a/apps/Core/Views/Default/html/system/geo/timezones/list.html +++ b/apps/Core/Views/Default/html/system/geo/timezones/list.html @@ -17,24 +17,6 @@ 'dtFilters' : table['filters'], 'dtFilterColumns' : table['filterColumns'], 'dtFixedHeader' : true, - 'dtPrimaryButtons' : - { - 'componentId' : componentId, - 'sectionId' : 'listing', - 'buttonType' : 'button', - 'buttons' : - { - 'add-timezone' : { - 'title' : 'Add New Timezone', - 'size' : 'sm', - 'type' : 'primary', - 'icon' : 'plus', - 'buttonAdditionalClass' : 'contentAjaxLink', - 'position' : 'right', - 'url' : links.url('system/geo/timezones/q/id/0') - } - } - }, 'dtTable' : table, 'dtColumns' : table['columns'], 'dtPostUrl' : table['postUrl'], @@ -45,6 +27,6 @@ 'dtHideIdColumn' : true, 'dtNoOfColumnsToShow' : 6, 'dtTableCompact' : true, - 'dtZeroRecords' : 'No timezones data available. Add timezone by clicking the add new timezone button.' + 'dtZeroRecords' : 'No timezones data available. Please contact developer.' ] )}} \ No newline at end of file diff --git a/apps/Core/Views/Default/html/system/geo/timezones/view.html b/apps/Core/Views/Default/html/system/geo/timezones/view.html index e21c75115..17faab269 100644 --- a/apps/Core/Views/Default/html/system/geo/timezones/view.html +++ b/apps/Core/Views/Default/html/system/geo/timezones/view.html @@ -1,8 +1,6 @@ {% if timezone['id'] is defined %} - {% set timezoneId = timezone['id'] %} {% set title = 'Timezone (' ~ timezone['zone_name'] ~ ')' %} {% else %} - {% set timezoneId = '' %} {% set title = 'New Timezone' %} {% endif %} @@ -23,12 +21,6 @@ 'cardBodyInclude' : 'timezones/form', 'formButtons' : [ - 'updateButtonId' : timezoneId, - 'addActionUrl' : 'system/geo/timezones/add', - 'addSuccessRedirectUrl' : 'system/geo/timezones', - 'updateActionUrl' : 'system/geo/timezones/update', - 'updateSuccessRedirectUrl' : 'system/geo/timezones', - 'cancelActionUrl' : 'system/geo/timezones', 'closeActionUrl' : 'system/geo/timezones' ] ] diff --git a/apps/Core/Views/Default/html/system/menus/form.html b/apps/Core/Views/Default/html/system/menus/form.html index cf26b9432..956f021e6 100644 --- a/apps/Core/Views/Default/html/system/menus/form.html +++ b/apps/Core/Views/Default/html/system/menus/form.html @@ -110,6 +110,7 @@
    +{% set menuMenu = escaper.js(json_encode(menuMenu, 16)) %} \ No newline at end of file diff --git a/apps/Core/Views/Default/html/system/tags/list.html b/apps/Core/Views/Default/html/system/tags/list.html new file mode 100644 index 000000000..7090c039a --- /dev/null +++ b/apps/Core/Views/Default/html/system/tags/list.html @@ -0,0 +1,50 @@ +{{adminltetags.useTag('content', + [ + 'component' : table['component'], + 'componentName' : componentName, + 'componentId' : componentId, + 'parentComponentId' : parent, + 'sectionId' : 'listing', + 'contentType' : 'sectionWithListing', + 'cardHeader' : true, + 'cardType' : 'primary', + 'cardIcon' : 'tags', + 'cardTitle' : 'Tags', + 'cardAdditionalClass' : 'rounded-0', + 'cardShowTools' : ['maximize'], + 'dtFilter' : true, + 'dtFilterShowQuickFilter' : true, + 'dtFilters' : table['filters'], + 'dtFilterColumns' : table['filterColumns'], + 'dtFixedHeader' : true, + 'dtPrimaryButtons' : + { + 'componentId' : componentId, + 'sectionId' : 'listing', + 'buttonType' : 'button', + 'buttons' : + { + 'add-tags' : { + 'title' : 'Add New Tag', + 'size' : 'sm', + 'type' : 'primary', + 'icon' : 'plus', + 'buttonAdditionalClass' : 'contentAjaxLink', + 'position' : 'right', + 'url' : links.url('system/tags/q/id/0') + } + } + }, + 'dtTable' : table, + 'dtColumns' : table['columns'], + 'dtPostUrl' : table['postUrl'], + 'dtPostUrlParams' : table['postUrlParams'], + 'dtStriped' : true, + 'dtStateSave' : false, + 'dtBordered' : false, + 'dtHideIdColumn' : true, + 'dtNoOfColumnsToShow' : 6, + 'dtTableCompact' : true, + 'dtZeroRecords' : 'No tags data available.' + ] +)}} \ No newline at end of file diff --git a/apps/Core/Views/Default/html/system/tags/view.html b/apps/Core/Views/Default/html/system/tags/view.html new file mode 100644 index 000000000..3f2ee5e83 --- /dev/null +++ b/apps/Core/Views/Default/html/system/tags/view.html @@ -0,0 +1,35 @@ +{% if tag['id'] is defined %} + {% set title = 'Tag (' ~ tag['name'] ~ ')' %} + {% set tagId = tag['id'] %} +{% else %} + {% set title = 'New Tag' %} + {% set tagId = '' %} +{% endif %} + +{{adminltetags.useTag('content', + [ + 'component' : component, + 'componentName' : componentName, + 'componentId' : componentId, + 'parentComponentId' : parent, + 'sectionId' : 'main', + 'contentType' : 'sectionWithForm', + 'cardHeader' : true, + 'cardFooter' : true, + 'cardType' : 'primary', + 'cardIcon' : 'tags', + 'cardTitle' : title, + 'cardAdditionalClass' : 'rounded-0', + 'cardBodyInclude' : 'tags/form', + 'formButtons' : + [ + 'updateButtonId' : tagId, + 'addActionUrl' : 'system/tags/add', + 'addSuccessRedirectUrl' : 'system/tags', + 'updateActionUrl' : 'system/tags/update', + 'updateSuccessRedirectUrl' : 'system/tags', + 'cancelActionUrl' : 'system/tags', + 'closeActionUrl' : 'system/tags' + ] + ] +)}} \ No newline at end of file diff --git a/docker b/docker index a0446586f..b1bd675e1 160000 --- a/docker +++ b/docker @@ -1 +1 @@ -Subproject commit a0446586fd5379d8cdc6523cee8f13650dfc57ad +Subproject commit b1bd675e1de774dff354f7f35625ba1df8f561c0 diff --git a/public/core/default/css/core.css b/public/core/default/css/core.css index 6078b81c2..54bdb24c3 100644 --- a/public/core/default/css/core.css +++ b/public/core/default/css/core.css @@ -42562,3 +42562,6 @@ a.disabled { color: white; } } +.flatpickr-wrapper { + width: 100%; +} diff --git a/public/core/default/css/plugins/select2/4.0.13/select2.min.css b/public/core/default/css/plugins/select2/4.0.13/select2.min.css new file mode 100644 index 000000000..a15f12771 --- /dev/null +++ b/public/core/default/css/plugins/select2/4.0.13/select2.min.css @@ -0,0 +1 @@ +.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px;padding:1px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb} \ No newline at end of file diff --git a/public/core/default/js/footer/core/Baz/BazContentFields.js b/public/core/default/js/footer/core/Baz/BazContentFields.js index 739fe4f49..1847057a8 100644 --- a/public/core/default/js/footer/core/Baz/BazContentFields.js +++ b/public/core/default/js/footer/core/Baz/BazContentFields.js @@ -595,9 +595,7 @@ var BazContentFields = function() { options.beforeInit(); } - var id = $('#' + fieldId).parents('.input-group')[0].id; - - dataCollection[componentId][sectionId][fieldId]['colorpicker'] = $('#' + id).colorpicker(options); + dataCollection[componentId][sectionId][fieldId]['colorpicker'] = $('#' + fieldId).colorpicker(options); if (options.afterInit) { options.afterInit(dataCollection, options); @@ -1049,4 +1047,4 @@ var BazContentFields = function() { // Object.defineProperty(exports, '__esModule', { value: true }); -// })); \ No newline at end of file +// })); diff --git a/public/core/default/js/footer/jsFooterCore.js b/public/core/default/js/footer/jsFooterCore.js index 80ff8e7e3..b1234cc29 100644 --- a/public/core/default/js/footer/jsFooterCore.js +++ b/public/core/default/js/footer/jsFooterCore.js @@ -9238,9 +9238,7 @@ var BazContentFields = function() { options.beforeInit(); } - var id = $('#' + fieldId).parents('.input-group')[0].id; - - dataCollection[componentId][sectionId][fieldId]['colorpicker'] = $('#' + id).colorpicker(options); + dataCollection[componentId][sectionId][fieldId]['colorpicker'] = $('#' + fieldId).colorpicker(options); if (options.afterInit) { options.afterInit(dataCollection, options); @@ -9693,6 +9691,7 @@ var BazContentFields = function() { // Object.defineProperty(exports, '__esModule', { value: true }); // })); + /* exported BazContentFieldsValidator */ /* globals */ /* diff --git a/public/core/default/js/footer/jsFooterPlugins.js b/public/core/default/js/footer/jsFooterPlugins.js index 48decfe16..95305a149 100644 --- a/public/core/default/js/footer/jsFooterPlugins.js +++ b/public/core/default/js/footer/jsFooterPlugins.js @@ -787,8 +787,8 @@ tabletPattern:/android|ipad|playbook|silk/i};var h,i=Object.prototype.hasOwnProp * http://jqueryvalidation.org/ * Copyright (c) 2015 Jörn Zaefferer; Licensed MIT */ !function(a){"function"==typeof define&&define.amd?define(["jquery","./jquery.validate.min"],a):a(jQuery)}(function(a){!function(){function b(a){return a.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}a.validator.addMethod("maxWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length<=d},a.validator.format("Please enter {0} words or less.")),a.validator.addMethod("minWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length>=d},a.validator.format("Please enter at least {0} words.")),a.validator.addMethod("rangeWords",function(a,c,d){var e=b(a),f=/\b\w+\b/g;return this.optional(c)||e.match(f).length>=d[0]&&e.match(f).length<=d[1]},a.validator.format("Please enter between {0} and {1} words."))}(),a.validator.addMethod("accept",function(b,c,d){var e,f,g="string"==typeof d?d.replace(/\s/g,"").replace(/,/g,"|"):"image/*",h=this.optional(c);if(h)return h;if("file"===a(c).attr("type")&&(g=g.replace(/\*/g,".*"),c.files&&c.files.length))for(e=0;ec;c++)d=h-c,e=f.substring(c,c+1),g+=d*e;return g%11===0},"Please specify a valid bank account number"),a.validator.addMethod("bankorgiroaccountNL",function(b,c){return this.optional(c)||a.validator.methods.bankaccountNL.call(this,b,c)||a.validator.methods.giroaccountNL.call(this,b,c)},"Please specify a valid bank or giro account number"),a.validator.addMethod("bic",function(a,b){return this.optional(b)||/^([A-Z]{6}[A-Z2-9][A-NP-Z1-2])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test(a)},"Please specify a valid BIC code"),a.validator.addMethod("cifES",function(a){"use strict";var b,c,d,e,f,g,h=[];if(a=a.toUpperCase(),!a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)"))return!1;for(d=0;9>d;d++)h[d]=parseInt(a.charAt(d),10);for(c=h[2]+h[4]+h[6],e=1;8>e;e+=2)f=(2*h[e]).toString(),g=f.charAt(1),c+=parseInt(f.charAt(0),10)+(""===g?0:parseInt(g,10));return/^[ABCDEFGHJNPQRSUVW]{1}/.test(a)?(c+="",b=10-parseInt(c.charAt(c.length-1),10),a+=b,h[8].toString()===String.fromCharCode(64+b)||h[8].toString()===a.charAt(a.length-1)):!1},"Please specify a valid CIF number."),a.validator.addMethod("cpfBR",function(a){if(a=a.replace(/([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g,""),11!==a.length)return!1;var b,c,d,e,f=0;if(b=parseInt(a.substring(9,10),10),c=parseInt(a.substring(10,11),10),d=function(a,b){var c=10*a%11;return(10===c||11===c)&&(c=0),c===b},""===a||"00000000000"===a||"11111111111"===a||"22222222222"===a||"33333333333"===a||"44444444444"===a||"55555555555"===a||"66666666666"===a||"77777777777"===a||"88888888888"===a||"99999999999"===a)return!1;for(e=1;9>=e;e++)f+=parseInt(a.substring(e-1,e),10)*(11-e);if(d(f,b)){for(f=0,e=1;10>=e;e++)f+=parseInt(a.substring(e-1,e),10)*(12-e);return d(f,c)}return!1},"Please specify a valid CPF number"),a.validator.addMethod("creditcardtypes",function(a,b,c){if(/[^0-9\-]+/.test(a))return!1;a=a.replace(/\D/g,"");var d=0;return c.mastercard&&(d|=1),c.visa&&(d|=2),c.amex&&(d|=4),c.dinersclub&&(d|=8),c.enroute&&(d|=16),c.discover&&(d|=32),c.jcb&&(d|=64),c.unknown&&(d|=128),c.all&&(d=255),1&d&&/^(5[12345])/.test(a)?16===a.length:2&d&&/^(4)/.test(a)?16===a.length:4&d&&/^(3[47])/.test(a)?15===a.length:8&d&&/^(3(0[012345]|[68]))/.test(a)?14===a.length:16&d&&/^(2(014|149))/.test(a)?15===a.length:32&d&&/^(6011)/.test(a)?16===a.length:64&d&&/^(3)/.test(a)?16===a.length:64&d&&/^(2131|1800)/.test(a)?15===a.length:128&d?!0:!1},"Please enter a valid credit card number."),a.validator.addMethod("currency",function(a,b,c){var d,e="string"==typeof c,f=e?c:c[0],g=e?!0:c[1];return f=f.replace(/,/g,""),f=g?f+"]":f+"]?",d="^["+f+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",d=new RegExp(d),this.optional(b)||d.test(a)},"Please specify a valid currency"),a.validator.addMethod("dateFA",function(a,b){return this.optional(b)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(a)},a.validator.messages.date),a.validator.addMethod("dateITA",function(a,b){var c,d,e,f,g,h=!1,i=/^\d{1,2}\/\d{1,2}\/\d{4}$/;return i.test(a)?(c=a.split("/"),d=parseInt(c[0],10),e=parseInt(c[1],10),f=parseInt(c[2],10),g=new Date(Date.UTC(f,e-1,d,12,0,0,0)),h=g.getUTCFullYear()===f&&g.getUTCMonth()===e-1&&g.getUTCDate()===d?!0:!1):h=!1,this.optional(b)||h},a.validator.messages.date),a.validator.addMethod("dateNL",function(a,b){return this.optional(b)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(a)},a.validator.messages.date),a.validator.addMethod("extension",function(a,b,c){return c="string"==typeof c?c.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(b)||a.match(new RegExp("\\.("+c+")$","i"))},a.validator.format("Please enter a value with a valid extension.")),a.validator.addMethod("giroaccountNL",function(a,b){return this.optional(b)||/^[0-9]{1,7}$/.test(a)},"Please specify a valid giro account number"),a.validator.addMethod("iban",function(a,b){if(this.optional(b))return!0;var c,d,e,f,g,h,i,j,k,l=a.replace(/ /g,"").toUpperCase(),m="",n=!0,o="",p="";if(c=l.substring(0,2),h={AL:"\\d{8}[\\dA-Z]{16}",AD:"\\d{8}[\\dA-Z]{12}",AT:"\\d{16}",AZ:"[\\dA-Z]{4}\\d{20}",BE:"\\d{12}",BH:"[A-Z]{4}[\\dA-Z]{14}",BA:"\\d{16}",BR:"\\d{23}[A-Z][\\dA-Z]",BG:"[A-Z]{4}\\d{6}[\\dA-Z]{8}",CR:"\\d{17}",HR:"\\d{17}",CY:"\\d{8}[\\dA-Z]{16}",CZ:"\\d{20}",DK:"\\d{14}",DO:"[A-Z]{4}\\d{20}",EE:"\\d{16}",FO:"\\d{14}",FI:"\\d{14}",FR:"\\d{10}[\\dA-Z]{11}\\d{2}",GE:"[\\dA-Z]{2}\\d{16}",DE:"\\d{18}",GI:"[A-Z]{4}[\\dA-Z]{15}",GR:"\\d{7}[\\dA-Z]{16}",GL:"\\d{14}",GT:"[\\dA-Z]{4}[\\dA-Z]{20}",HU:"\\d{24}",IS:"\\d{22}",IE:"[\\dA-Z]{4}\\d{14}",IL:"\\d{19}",IT:"[A-Z]\\d{10}[\\dA-Z]{12}",KZ:"\\d{3}[\\dA-Z]{13}",KW:"[A-Z]{4}[\\dA-Z]{22}",LV:"[A-Z]{4}[\\dA-Z]{13}",LB:"\\d{4}[\\dA-Z]{20}",LI:"\\d{5}[\\dA-Z]{12}",LT:"\\d{16}",LU:"\\d{3}[\\dA-Z]{13}",MK:"\\d{3}[\\dA-Z]{10}\\d{2}",MT:"[A-Z]{4}\\d{5}[\\dA-Z]{18}",MR:"\\d{23}",MU:"[A-Z]{4}\\d{19}[A-Z]{3}",MC:"\\d{10}[\\dA-Z]{11}\\d{2}",MD:"[\\dA-Z]{2}\\d{18}",ME:"\\d{18}",NL:"[A-Z]{4}\\d{10}",NO:"\\d{11}",PK:"[\\dA-Z]{4}\\d{16}",PS:"[\\dA-Z]{4}\\d{21}",PL:"\\d{24}",PT:"\\d{21}",RO:"[A-Z]{4}[\\dA-Z]{16}",SM:"[A-Z]\\d{10}[\\dA-Z]{12}",SA:"\\d{2}[\\dA-Z]{18}",RS:"\\d{18}",SK:"\\d{20}",SI:"\\d{15}",ES:"\\d{20}",SE:"\\d{20}",CH:"\\d{5}[\\dA-Z]{12}",TN:"\\d{20}",TR:"\\d{5}[\\dA-Z]{17}",AE:"\\d{3}\\d{16}",GB:"[A-Z]{4}\\d{14}",VG:"[\\dA-Z]{4}\\d{16}"},g=h[c],"undefined"!=typeof g&&(i=new RegExp("^[A-Z]{2}\\d{2}"+g+"$",""),!i.test(l)))return!1;for(d=l.substring(4,l.length)+l.substring(0,4),j=0;j9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number"),a.validator.addMethod("nieES",function(a){"use strict";return a=a.toUpperCase(),a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")?/^[T]{1}/.test(a)?a[8]===/^[T]{1}[A-Z0-9]{8}$/.test(a):/^[XYZ]{1}/.test(a)?a[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.replace("X","0").replace("Y","1").replace("Z","2").substring(0,8)%23):!1:!1},"Please specify a valid NIE number."),a.validator.addMethod("nifES",function(a){"use strict";return a=a.toUpperCase(),a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")?/^[0-9]{8}[A-Z]{1}$/.test(a)?"TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8,0)%23)===a.charAt(8):/^[KLM]{1}/.test(a)?a[8]===String.fromCharCode(64):!1:!1},"Please specify a valid NIF number."),jQuery.validator.addMethod("notEqualTo",function(b,c,d){return this.optional(c)||!a.validator.methods.equalTo.call(this,b,c,d)},"Please enter a different value, values must not be the same."),a.validator.addMethod("nowhitespace",function(a,b){return this.optional(b)||/^\S+$/i.test(a)},"No white space please"),a.validator.addMethod("pattern",function(a,b,c){return this.optional(b)?!0:("string"==typeof c&&(c=new RegExp("^(?:"+c+")$")),c.test(a))},"Invalid format."),a.validator.addMethod("phoneNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid phone number."),a.validator.addMethod("phoneUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)},"Please specify a valid phone number"),a.validator.addMethod("phoneUS",function(a,b){return a=a.replace(/\s+/g,""),this.optional(b)||a.length>9&&a.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/)},"Please specify a valid phone number"),a.validator.addMethod("phonesUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number"),a.validator.addMethod("postalCodeCA",function(a,b){return this.optional(b)||/^[ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeBR",function(a,b){return this.optional(b)||/^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test(a)},"Informe um CEP válido."),a.validator.addMethod("postalcodeIT",function(a,b){return this.optional(b)||/^\d{5}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeNL",function(a,b){return this.optional(b)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postcodeUK",function(a,b){return this.optional(b)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(a)},"Please specify a valid UK postcode"),a.validator.addMethod("require_from_group",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_req_grp")?f.data("valid_req_grp"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length>=d[0];return f.data("valid_req_grp",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),h},a.validator.format("Please fill at least {0} of these fields.")),a.validator.addMethod("skip_or_fill_minimum",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_skip")?f.data("valid_skip"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length,i=0===h||h>=d[0];return f.data("valid_skip",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),i},a.validator.format("Please either skip these fields or fill at least {0} of them.")),a.validator.addMethod("stateUS",function(a,b,c){var d,e="undefined"==typeof c,f=e||"undefined"==typeof c.caseSensitive?!1:c.caseSensitive,g=e||"undefined"==typeof c.includeTerritories?!1:c.includeTerritories,h=e||"undefined"==typeof c.includeMilitary?!1:c.includeMilitary;return d=g||h?g&&h?"^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":g?"^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":"^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$":"^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$",d=f?new RegExp(d):new RegExp(d,"i"),this.optional(b)||d.test(a)},"Please specify a valid state"),a.validator.addMethod("strippedminlength",function(b,c,d){return a(b).text().length>=d},a.validator.format("Please enter at least {0} characters")),a.validator.addMethod("time",function(a,b){return this.optional(b)||/^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test(a)},"Please enter a valid time, between 00:00 and 23:59"),a.validator.addMethod("time12h",function(a,b){return this.optional(b)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(a)},"Please enter a valid time in 12-hour am/pm format"),a.validator.addMethod("url2",function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},a.validator.messages.url),a.validator.addMethod("vinUS",function(a){if(17!==a.length)return!1;var b,c,d,e,f,g,h=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],i=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],j=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],k=0;for(b=0;17>b;b++){if(e=j[b],d=a.slice(b,b+1),8===b&&(g=d),isNaN(d)){for(c=0;c":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},r.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},r.__cache={};var n=0;return r.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},r.StoreData=function(e,t,n){var i=r.GetUniqueElementId(e);r.__cache[i]||(r.__cache[i]={}),r.__cache[i][t]=n},r.GetData=function(e,t){var n=r.GetUniqueElementId(e);return t?r.__cache[n]&&null!=r.__cache[n][t]?r.__cache[n][t]:o(e).data(t):r.__cache[n]},r.RemoveData=function(e){var t=r.GetUniqueElementId(e);null!=r.__cache[t]&&delete r.__cache[t],e.removeAttribute("data-select2-id")},r}),e.define("select2/results",["jquery","./utils"],function(h,f){function i(e,t,n){this.$element=e,this.data=n,this.options=t,i.__super__.constructor.call(this)}return f.Extend(i,f.Observable),i.prototype.render=function(){var e=h('
      ');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h(''),i=this.options.get("translations").get(e.message);n.append(t(i(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n",{class:"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},i.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var i=n-1;0===e.length&&(i=0);var r=t.eq(i);r.trigger("mouseenter");var o=l.$results.offset().top,s=r.offset().top,a=l.$results.scrollTop()+(s-o);0===i?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var i=t.eq(n);i.trigger("mouseenter");var r=l.$results.offset().top+l.$results.outerHeight(!1),o=i.offset().top+i.outerHeight(!1),s=l.$results.scrollTop()+o-r;0===n?l.$results.scrollTop(0):rthis.$results.outerHeight()||o<0)&&this.$results.scrollTop(r)}},i.prototype.template=function(e,t){var n=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),r=n(e,t);null==r?t.style.display="none":"string"==typeof r?t.innerHTML=i(r):h(t).append(r)},i}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,i,r){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return i.Extend(o,i.Observable),o.prototype.render=function(){var e=n('');return this._tabindex=0,null!=i.GetData(this.$element[0],"old-tabindex")?this._tabindex=i.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,i=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===r.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",i),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&i.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html(''),e},r.prototype.bind=function(t,e){var n=this;r.__super__.bind.apply(this,arguments);var i=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},r.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return e("")},r.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i);var r=t.title||t.text;r?n.attr("title",r):n.removeAttr("title")}else this.clear()},r}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(r,e,l){function n(e,t){n.__super__.constructor.apply(this,arguments)}return l.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('
        '),e},n.prototype.bind=function(e,t){var i=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){i.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!i.options.get("disabled")){var t=r(this).parent(),n=l.GetData(t[0],"data");i.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return r('
      • ×
      • ')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n×');a.StoreData(i[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(i)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(i,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=i('');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),t.on("open",function(){i.$search.attr("aria-controls",r),i.$search.trigger("focus")}),t.on("close",function(){i.$search.val(""),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.trigger("focus")}),t.on("enable",function(){i.$search.prop("disabled",!1),i._transferTabIndex()}),t.on("disable",function(){i.$search.prop("disabled",!0)}),t.on("focus",function(e){i.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){i.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){i._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===i.$search.val()){var t=i.$searchContainer.prev(".select2-selection__choice");if(0this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(){i._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var i=this;this._checkIfMaximumSelected(function(){e.call(i,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var i=this;this.current(function(e){var t=null!=e?e.length:0;0=i.maximumSelectionLength?i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):n&&n()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o('');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){i.handleSearch(e)}),t.on("open",function(){i.$search.attr("tabindex",0),i.$search.attr("aria-controls",r),i.$search.trigger("focus"),window.setTimeout(function(){i.$search.trigger("focus")},0)}),t.on("close",function(){i.$search.attr("tabindex",-1),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.val(""),i.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||i.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;0<=i;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",function(e){i.lastParams=e,i.loading=!0}),t.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('
      • '),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),i._bindContainerResultHandlers(t)}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f(""),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,i="scroll.select2."+t.id,r="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(i,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(i+" "+r+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,i="resize.select2."+t.id,r="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+i+" "+r)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),i=null,r=this.$container.offset();r.bottom=r.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=r.top,o.bottom=r.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=ar.bottom+s,d={left:r.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};f.contains(document.body,p[0])&&(h=p.offset()),d.top-=h.top,d.left-=h.left,t||n||(i="below"),u||!c||t?!c&&u&&t&&(i="below"):i="above",("above"==i||t&&"below"!==i)&&(d.top=o.top-h.top-s),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,i=0;i');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("select2/compat/utils",["jquery"],function(s){return{syncCssClasses:function(e,t,n){var i,r,o=[];(i=s.trim(e.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0===this.indexOf("select2-")&&o.push(this)}),(i=s.trim(t.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(r=n(this))&&o.push(r)}),e.attr("class",o.join(" "))}}}),e.define("select2/compat/containerCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("containerCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptContainerCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}var o=this.options.get("containerCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/dropdownCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("dropdownCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptDropdownCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}var o=this.options.get("dropdownCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/initSelection",["jquery"],function(i){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return e.prototype.current=function(e,t){var n=this;this._isInitialized?e.call(this,t):this.initSelection.call(null,this.$element,function(e){n._isInitialized=!0,i.isArray(e)||(e=[e]),t(e)})},e}),e.define("select2/compat/inputData",["jquery","../utils"],function(s,i){function e(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `
      • ');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),t.on("open",function(){i.$search.attr("aria-controls",r),i.$search.trigger("focus")}),t.on("close",function(){i.$search.val(""),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.trigger("focus")}),t.on("enable",function(){i.$search.prop("disabled",!1),i._transferTabIndex()}),t.on("disable",function(){i.$search.prop("disabled",!0)}),t.on("focus",function(e){i.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){i.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){i._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===i.$search.val()){var t=i.$searchContainer.prev(".select2-selection__choice");if(0this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(){i._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var i=this;this._checkIfMaximumSelected(function(){e.call(i,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var i=this;this.current(function(e){var t=null!=e?e.length:0;0=i.maximumSelectionLength?i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):n&&n()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o('');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){i.handleSearch(e)}),t.on("open",function(){i.$search.attr("tabindex",0),i.$search.attr("aria-controls",r),i.$search.trigger("focus"),window.setTimeout(function(){i.$search.trigger("focus")},0)}),t.on("close",function(){i.$search.attr("tabindex",-1),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.val(""),i.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||i.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;0<=i;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",function(e){i.lastParams=e,i.loading=!0}),t.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('
      • '),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),i._bindContainerResultHandlers(t)}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f(""),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,i="scroll.select2."+t.id,r="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(i,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(i+" "+r+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,i="resize.select2."+t.id,r="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+i+" "+r)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),i=null,r=this.$container.offset();r.bottom=r.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=r.top,o.bottom=r.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=ar.bottom+s,d={left:r.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};(f.contains(document.body,p[0])||p[0].isConnected)&&(h=p.offset()),d.top-=h.top,d.left-=h.left,t||n||(i="below"),u||!c||t?!c&&u&&t&&(i="below"):i="above",("above"==i||t&&"below"!==i)&&(d.top=o.top-h.top-s),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,i=0;i');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("select2/compat/utils",["jquery"],function(s){return{syncCssClasses:function(e,t,n){var i,r,o=[];(i=s.trim(e.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0===this.indexOf("select2-")&&o.push(this)}),(i=s.trim(t.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(r=n(this))&&o.push(r)}),e.attr("class",o.join(" "))}}}),e.define("select2/compat/containerCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("containerCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptContainerCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}var o=this.options.get("containerCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/dropdownCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("dropdownCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptDropdownCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}var o=this.options.get("dropdownCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/initSelection",["jquery"],function(i){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return e.prototype.current=function(e,t){var n=this;this._isInitialized?e.call(this,t):this.initSelection.call(null,this.$element,function(e){n._isInitialized=!0,i.isArray(e)||(e=[e]),t(e)})},e}),e.define("select2/compat/inputData",["jquery","../utils"],function(s,i){function e(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `",{value:d,class:"jstree-rename-input",css:{padding:"0",border:"1px solid silver","box-sizing":"border-box",display:"inline-block",height:this._data.core.li_height+"px",lineHeight:this._data.core.li_height+"px",width:"150px"},blur:function(e){e.stopImmediatePropagation(),e.preventDefault();var t,i=n.children(".jstree-rename-input").val(),e=this.settings.core.force_text,e;""===i&&(i=d),o.remove(),n.replaceWith(a),n.remove(),d=e?d:E("
        ").append(E.parseHTML(d)).html(),r=this.get_node(r),this.set_text(r,d),(e=!!this.rename_node(r,e?E("
        ").text(i).text():E("
        ").append(E.parseHTML(i)).html()))||this.set_text(r,d),this._data.core.focused=l.id,setTimeout(function(){var e=this.get_node(l.id,!0);e.length&&(this._data.core.focused=l.id,e.children(".jstree-anchor").trigger("focus"))}.bind(this),0),s&&s.call(this,l,e,h,i),c=null}.bind(this),keydown:function(e){var t=e.which;27===t&&(h=!0,this.value=d),27!==t&&13!==t&&37!==t&&38!==t&&39!==t&&40!==t&&32!==t||e.stopImmediatePropagation(),27!==t&&13!==t||(e.preventDefault(),this.blur())},click:function(e){e.stopImmediatePropagation()},mousedown:function(e){e.stopImmediatePropagation()},keyup:function(e){c.width(Math.min(o.text("pW"+this.value).width(),i))},keypress:function(e){if(13===e.which)return!1}}),t={fontFamily:a.css("fontFamily")||"",fontSize:a.css("fontSize")||"",fontWeight:a.css("fontWeight")||"",fontStyle:a.css("fontStyle")||"",fontStretch:a.css("fontStretch")||"",fontVariant:a.css("fontVariant")||"",letterSpacing:a.css("letterSpacing")||"",wordSpacing:a.css("wordSpacing")||""},n.attr("class",a.attr("class")).append(a.contents().clone()).append(c),a.replaceWith(n),o.css(t),c.css(t).width(Math.min(o.text("pW"+c[0].value).width(),i))[0].select(),void E(b).one("mousedown.jstree touchstart.jstree dnd_start.vakata",function(e){c&&e.target!==c&&E(c).trigger("blur")})):(this.settings.core.error.call(this,this._data.core.last_error),!1))},set_theme:function(e,t){if(!e)return!1;var i,i;(t=!0===t?(i=(i=this.settings.core.themes.dir)||E.jstree.path+"/themes")+"/"+e+"/style.css":t)&&-1===E.inArray(t,r)&&(E("head").append(''),r.push(t)),this._data.core.themes.name&&this.element.removeClass("jstree-"+this._data.core.themes.name),this._data.core.themes.name=e,this.element.addClass("jstree-"+e),this.element[this.settings.core.themes.responsive?"addClass":"removeClass"]("jstree-"+e+"-responsive"),this.trigger("set_theme",{theme:e})},get_theme:function(){return this._data.core.themes.name},set_theme_variant:function(e){this._data.core.themes.variant&&this.element.removeClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant),(this._data.core.themes.variant=e)&&this.element.addClass("jstree-"+this._data.core.themes.name+"-"+this._data.core.themes.variant)},get_theme_variant:function(){return this._data.core.themes.variant},show_stripes:function(){this._data.core.themes.stripes=!0,this.get_container_ul().addClass("jstree-striped"),this.trigger("show_stripes")},hide_stripes:function(){this._data.core.themes.stripes=!1,this.get_container_ul().removeClass("jstree-striped"),this.trigger("hide_stripes")},toggle_stripes:function(){this._data.core.themes.stripes?this.hide_stripes():this.show_stripes()},show_dots:function(){this._data.core.themes.dots=!0,this.get_container_ul().removeClass("jstree-no-dots"),this.trigger("show_dots")},hide_dots:function(){this._data.core.themes.dots=!1,this.get_container_ul().addClass("jstree-no-dots"),this.trigger("hide_dots")},toggle_dots:function(){this._data.core.themes.dots?this.hide_dots():this.show_dots()},show_icons:function(){this._data.core.themes.icons=!0,this.get_container_ul().removeClass("jstree-no-icons"),this.trigger("show_icons")},hide_icons:function(){this._data.core.themes.icons=!1,this.get_container_ul().addClass("jstree-no-icons"),this.trigger("hide_icons")},toggle_icons:function(){this._data.core.themes.icons?this.hide_icons():this.show_icons()},show_ellipsis:function(){this._data.core.themes.ellipsis=!0,this.get_container_ul().addClass("jstree-ellipsis"),this.trigger("show_ellipsis")},hide_ellipsis:function(){this._data.core.themes.ellipsis=!1,this.get_container_ul().removeClass("jstree-ellipsis"),this.trigger("hide_ellipsis")},toggle_ellipsis:function(){this._data.core.themes.ellipsis?this.hide_ellipsis():this.show_ellipsis()},set_icon:function(e,t){var i,r,s,a;if(E.vakata.is_array(e)){for(i=0,r=(e=e.slice()).length;i "),r=!1,i+="
      • ",i+="",h.vakata.context.settings.icons&&(i+="'+(t.shortcut_label||"")+"":"")+"",t.submenu&&(s=h.vakata.context._parse(t.submenu,!0))&&(i+=s),i+="
      • ",void(t.separator_after&&(i+="
      •  
      • ",r=!0)))}),i=i.replace(/
      • <\/li\>$/,""),t&&(i+=""),t||(g.html=i,h.vakata.context._trigger("parse")),10"),g.element.on("mouseenter","li",function(e){e.stopImmediatePropagation(),h.contains(this,e.relatedTarget)||(i&&clearTimeout(i),g.element.find(".vakata-context-hover").removeClass("vakata-context-hover").end(),h(this).siblings().find("ul").hide().end().end().parentsUntil(".vakata-context","li").addBack().addClass("vakata-context-hover"),h.vakata.context._show_submenu(this))}).on("mouseleave","li",function(e){h.contains(this,e.relatedTarget)||h(this).find(".vakata-context-hover").addBack().removeClass("vakata-context-hover")}).on("mouseleave",function(e){var t;h(this).find(".vakata-context-hover").removeClass("vakata-context-hover"),h.vakata.context.settings.hide_onmouseleave&&(i=setTimeout((t=this,function(){h.vakata.context.hide()}),h.vakata.context.settings.hide_onmouseleave))}).on("click","a",function(e){e.preventDefault(),h(this).trigger("blur").parent().hasClass("vakata-context-disabled")||!1===h.vakata.context._execute(h(this).attr("rel"))||h.vakata.context.hide()}).on("keydown","a",function(e){var t=null;switch(e.which){case 13:case 32:e.type="click",e.preventDefault(),h(e.currentTarget).trigger(e);break;case 37:g.is_visible&&(g.element.find(".vakata-context-hover").last().closest("li").first().find("ul").hide().find(".vakata-context-hover").removeClass("vakata-context-hover").end().end().children("a").trigger("focus"),e.stopImmediatePropagation(),e.preventDefault());break;case 38:g.is_visible&&((t=!(t=g.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").prevAll("li:not(.vakata-context-separator)").first()).length?g.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").last():t).addClass("vakata-context-hover").children("a").trigger("focus"),e.stopImmediatePropagation(),e.preventDefault());break;case 39:g.is_visible&&(g.element.find(".vakata-context-hover").last().children("ul").show().children("li:not(.vakata-context-separator)").removeClass("vakata-context-hover").first().addClass("vakata-context-hover").children("a").trigger("focus"),e.stopImmediatePropagation(),e.preventDefault());break;case 40:g.is_visible&&((t=!(t=g.element.find("ul:visible").addBack().last().children(".vakata-context-hover").removeClass("vakata-context-hover").nextAll("li:not(.vakata-context-separator)").first()).length?g.element.find("ul:visible").addBack().last().children("li:not(.vakata-context-separator)").first():t).addClass("vakata-context-hover").children("a").trigger("focus"),e.stopImmediatePropagation(),e.preventDefault());break;case 27:h.vakata.context.hide(),e.preventDefault()}}).on("keydown",function(e){e.preventDefault();var e=g.element.find(".vakata-contextmenu-shortcut-"+e.which).parent();e.parent().not(".vakata-context-disabled")&&e.trigger("click")}),h(b).on("mousedown.vakata.jstree",function(e){g.is_visible&&g.element[0]!==e.target&&!h.contains(g.element[0],e.target)&&h.vakata.context.hide()}).on("context_show.vakata.jstree",function(e,t){g.element.find("li:has(ul)").children("a").addClass("vakata-context-parent"),_&&g.element.addClass("vakata-context-rtl").css("direction","rtl"),g.element.find("ul").hide().end()})}),E.jstree.defaults.dnd={copy:!0,open_timeout:500,is_draggable:!0,check_while_dragging:!0,always_copy:!1,inside_pos:0,drag_selection:!0,touch:!0,large_drop_target:!1,large_drag_target:!1,use_html5:!1,blank_space_drop:!1},E.jstree.plugins.dnd=function(e,d){this.init=function(e,t){d.init.call(this,e,t),this.settings.dnd.use_html5=this.settings.dnd.use_html5&&"draggable"in b.createElement("span")},this.bind=function(){d.bind.call(this),this.element.on(this.settings.dnd.use_html5?"dragstart.jstree":"mousedown.jstree touchstart.jstree",this.settings.dnd.large_drag_target?".jstree-node":".jstree-anchor",function(e){if(this.settings.dnd.large_drag_target&&E(e.target).closest(".jstree-node")[0]!==e.currentTarget)return!0;if("touchstart"===e.type&&(!this.settings.dnd.touch||"selected"===this.settings.dnd.touch&&!E(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").hasClass("jstree-clicked")))return!0;var t=this.get_node(e.target),i=this.is_selected(t)&&this.settings.dnd.drag_selection?this.get_top_selected().length:1,r=1'+r+'+');E.vakata.dnd._trigger("start",e,{helper:E(),element:u,data:o})}}.bind(this)),this.settings.dnd.use_html5&&this.element.on("dragover.jstree",function(e){return e.preventDefault(),E.vakata.dnd._trigger("move",e,{helper:E(),element:u,data:o}),!1}).on("drop.jstree",function(e){return e.preventDefault(),E.vakata.dnd._trigger("stop",e,{helper:E(),element:u,data:o}),!1}.bind(this))},this.redraw_node=function(e,t,i,r){if((e=d.redraw_node.apply(this,arguments))&&this.settings.dnd.use_html5)if(this.settings.dnd.large_drag_target)e.setAttribute("draggable",!0);else{for(var s,a,n=null,s=0,a=e.childNodes.length;s ').hide();E(b).on("dragover.vakata.jstree",function(e){u&&E.vakata.dnd._trigger("move",e,{helper:E(),element:u,data:o})}).on("drop.vakata.jstree",function(e){u&&(E.vakata.dnd._trigger("stop",e,{helper:E(),element:u,data:o}),o=u=null)}).on("dnd_start.vakata.jstree",function(e,t){O=N=!1,t&&t.data&&t.data.jstree&&S.appendTo(b.body)}).on("dnd_move.vakata.jstree",function(e,s){var a=s.event.target!==O.target;if(A&&(s.event&&"dragover"===s.event.type&&!a||clearTimeout(A)),s&&s.data&&s.data.jstree&&(!s.event.target.id||"jstree-marker"!==s.event.target.id)){O=s.event;var n=E.jstree.reference(s.event.target),d=!1,o=!1,t=!1,i,c,l,h,_,g,u,f,p,m,v,j,k,b,y,x,w,C;if(n&&n._data&&n._data.dnd)if(S.attr("class","jstree-"+n.get_theme()+(n.settings.core.themes.responsive?" jstree-dnd-responsive":"")),x=s.data.origin&&(s.data.origin.settings.dnd.always_copy||s.data.origin.settings.dnd.copy&&(s.event.metaKey||s.event.ctrlKey)),s.helper.children().attr("class","jstree-"+n.get_theme()+" jstree-"+n.get_theme()+"-"+n.get_theme_variant()+" "+(n.settings.core.themes.responsive?" jstree-dnd-responsive":"")).find(".jstree-copy").first()[x?"show":"hide"](),s.event.target!==n.element[0]&&s.event.target!==n.get_container_ul()[0]||0!==n.get_container_ul().children().length&&!n.settings.dnd.blank_space_drop){if((d=n.settings.dnd.large_drop_target?E(s.event.target).closest(".jstree-node").children(".jstree-anchor"):E(s.event.target).closest(".jstree-anchor"))&&d.length&&d.parent().is(".jstree-closed, .jstree-open, .jstree-leaf")&&(o=d.offset(),t=(s.event.pageY!==P?s.event:s.event.originalEvent).pageY-o.top,h=d.outerHeight(),u=tE.inArray(s.data.nodes[p],k.children)&&--j),!(f=f&&(n&&n.settings&&n.settings.dnd&&!1===n.settings.dnd.check_while_dragging||n.check(v,s.data.origin&&s.data.origin!==n?s.data.origin.get_node(s.data.nodes[p]):s.data.nodes[p],_,j,{dnd:!0,ref:n.get_node(d.parent()),pos:t,origin:s.data.origin,is_multi:s.data.origin&&s.data.origin!==n,is_foreign:!s.data.origin})))){n&&n.last_error&&(T=n.last_error());break}var i,r;if("i"===t&&d.parent().is(".jstree-closed")&&n.settings.dnd.open_timeout&&(s.event&&"dragover"===s.event.type&&!a||(A&&clearTimeout(A),A=setTimeout((r=d,function(){i.open_node(r)}),(i=n).settings.dnd.open_timeout))),f)return(w=n.get_node(_,!0)).hasClass(".jstree-dnd-parent")||(E(".jstree-dnd-parent").removeClass("jstree-dnd-parent"),w.addClass("jstree-dnd-parent")),N={ins:n,par:_,pos:"i"!==t||"last"!==b||0!==g||n.is_loaded(y)?g:"last"},S.css({left:c+"px",top:l+"px"}).show(),S.removeClass("jstree-above jstree-inside jstree-below").addClass(C),s.helper.find(".jstree-icon").first().removeClass("jstree-er").addClass("jstree-ok"),s.event.originalEvent&&s.event.originalEvent.dataTransfer&&(s.event.originalEvent.dataTransfer.dropEffect=x?"copy":"move"),T={},!(u=!0)}),!0===u))return}else{for(f=!0,p=0,m=s.data.nodes.length;p"),escape:function(e){return f.vakata.html.div.text(e).html()},strip:function(e){return f.vakata.html.div.empty().append(f.parseHTML(e)).text()}}),target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1},f.vakata.dnd={settings:{scroll_speed:10,scroll_proximity:20,helper_left:5,helper_top:10,threshold:5,threshold_touch:10},_trigger:function(e,t,i){(i=i===P?f.vakata.dnd._get():i).event=t,f(b).triggerHandler("dnd_"+e+".vakata",i)},_get:function(){return{data:p.data,element:p.element,helper:p.helper}},_clean:function(){p.helper&&p.helper.remove(),p.scroll_i&&(clearInterval(p.scroll_i),p.scroll_i=!1),p={element:!1,target:!1,is_down:!1,is_drag:!1,helper:!1,helper_w:0,data:!1,init_x:0,init_y:0,scroll_l:0,scroll_t:0,scroll_e:!1,scroll_i:!1,is_touch:!1},u=null,f(b).off("mousemove.vakata.jstree touchmove.vakata.jstree",f.vakata.dnd.drag),f(b).off("mouseup.vakata.jstree touchend.vakata.jstree",f.vakata.dnd.stop)},_scroll:function(e){if(!p.scroll_e||!p.scroll_l&&!p.scroll_t)return p.scroll_i&&(clearInterval(p.scroll_i),p.scroll_i=!1),!1;if(!p.scroll_i)return p.scroll_i=setInterval(f.vakata.dnd._scroll,100),!1;if(!0===e)return!1;var t=p.scroll_e.scrollTop(),e=p.scroll_e.scrollLeft();p.scroll_e.scrollTop(t+p.scroll_t*f.vakata.dnd.settings.scroll_speed),p.scroll_e.scrollLeft(e+p.scroll_l*f.vakata.dnd.settings.scroll_speed),t===p.scroll_e.scrollTop()&&e===p.scroll_e.scrollLeft()||f.vakata.dnd._trigger("scroll",p.scroll_e)},start:function(e,t,i){"touchstart"===e.type&&e.originalEvent&&e.originalEvent.changedTouches&&e.originalEvent.changedTouches[0]&&(e.pageX=e.originalEvent.changedTouches[0].pageX,e.pageY=e.originalEvent.changedTouches[0].pageY,e.target=b.elementFromPoint(e.originalEvent.changedTouches[0].pageX-window.pageXOffset,e.originalEvent.changedTouches[0].pageY-window.pageYOffset)),p.is_drag&&f.vakata.dnd.stop({});try{e.currentTarget.unselectable="on",e.currentTarget.onselectstart=function(){return!1},e.currentTarget.style&&(e.currentTarget.style.touchAction="none",e.currentTarget.style.msTouchAction="none",e.currentTarget.style.MozUserSelect="none")}catch(e){}return p.init_x=e.pageX,p.init_y=e.pageY,p.data=t,p.is_down=!0,p.element=e.currentTarget,p.target=e.target,p.is_touch="touchstart"===e.type,!1!==i&&(p.helper=f("
        ").html(i).css({display:"block",margin:"0",padding:"0",position:"absolute",top:"-2000px",lineHeight:"16px",zIndex:"10000"})),f(b).on("mousemove.vakata.jstree touchmove.vakata.jstree",f.vakata.dnd.drag),f(b).on("mouseup.vakata.jstree touchend.vakata.jstree",f.vakata.dnd.stop),!1},drag:function(i){if("touchmove"===i.type&&i.originalEvent&&i.originalEvent.changedTouches&&i.originalEvent.changedTouches[0]&&(i.pageX=i.originalEvent.changedTouches[0].pageX,i.pageY=i.originalEvent.changedTouches[0].pageY,i.target=b.elementFromPoint(i.originalEvent.changedTouches[0].pageX-window.pageXOffset,i.originalEvent.changedTouches[0].pageY-window.pageYOffset)),p.is_down){if(!p.is_drag){if(!(Math.abs(i.pageX-p.init_x)>(p.is_touch?f.vakata.dnd.settings.threshold_touch:f.vakata.dnd.settings.threshold)||Math.abs(i.pageY-p.init_y)>(p.is_touch?f.vakata.dnd.settings.threshold_touch:f.vakata.dnd.settings.threshold)))return;p.helper&&(p.helper.appendTo(b.body),p.helper_w=p.helper.outerWidth()),p.is_drag=!0,f(p.target).one("click.vakata",!1),f.vakata.dnd._trigger("start",i)}var e=!1,t=!1,r=!1,s=!1,a=!1,n=!1,d=!1,o=!1,c=!1,l=!1;return p.scroll_t=0,p.scroll_l=0,p.scroll_e=!1,f(f(i.target).parentsUntil("body").addBack().get().reverse()).filter(function(){return this.ownerDocument&&/^auto|scroll$/.test(f(this).css("overflow"))&&(this.scrollHeight>this.offsetHeight||this.scrollWidth>this.offsetWidth)}).each(function(){var e=f(this),t=e.offset();if(this.scrollHeight>this.offsetHeight&&(t.top+e.height()-i.pageYthis.offsetWidth&&(t.left+e.width()-i.pageXa&&(l=a-(p.helper_w+2)),p.helper.css({left:l+"px",top:(c=r&&rs)break;c=_}return{isMatch:0<=a,score:u}},!0===e?{search:t}:t(e)},w.vakata.search.defaults={location:0,distance:100,threshold:.6,fuzzy:!1,caseSensitive:!1},E.jstree.defaults.sort=function(e,t){return this.get_text(e)>this.get_text(t)?1:-1};var m=!(E.jstree.plugins.sort=function(e,t){this.bind=function(){t.bind.call(this),this.element.on("model.jstree",function(e,t){this.sort(t.parent,!0)}.bind(this)).on("rename_node.jstree create_node.jstree",function(e,t){this.sort(t.parent||t.node.parent,!1),this.redraw_node(t.parent||t.node.parent,!0)}.bind(this)).on("move_node.jstree copy_node.jstree",function(e,t){this.sort(t.parent,!1),this.redraw_node(t.parent,!0)}.bind(this))},this.sort=function(e,t){var i,r;if((e=this.get_node(e))&&e.children&&e.children.length&&(e.children.sort(this.settings.sort.bind(this)),t))for(i=0,r=e.children_d.length;ii.ttl)&&(!!(i=(i=i&&i.state?i.state:i)&&E.vakata.is_function(this.settings.state.filter)?this.settings.state.filter.call(this,i):i)&&(this.settings.state.preserve_loaded||delete i.core.loaded,this.element.one("set_state.jstree",function(e,t){t.instance.trigger("restore_state",{state:E.extend(!0,{},i)})}),this.set_state(i),!0))},this.clear_state=function(){return E.vakata.storage.del(this.settings.state.key)}},E.vakata.storage={set:function(e,t){return window.localStorage.setItem(e,t)},get:function(e){return window.localStorage.getItem(e)},del:function(e){return window.localStorage.removeItem(e)}},E.jstree.defaults.types={default:{}},E.jstree.defaults.types[E.jstree.root]={},E.jstree.plugins.types=function(e,l){this.init=function(e,t){var i,r;if(t&&t.types&&t.types.default)for(i in t.types)if("default"!==i&&i!==E.jstree.root&&t.types.hasOwnProperty(i))for(r in t.types.default)t.types.default.hasOwnProperty(r)&&t.types[i][r]===P&&(t.types[i][r]=t.types.default[r]);l.init.call(this,e,t),this._model.data[E.jstree.root].type=E.jstree.root},this.refresh=function(e,t){l.refresh.call(this,e,t),this._model.data[E.jstree.root].type=E.jstree.root},this.bind=function(){this.element.on("model.jstree",function(e,t){for(var i=this._model.data,r=t.nodes,s=this.settings.types,a,n,d="default",o,a=0,n=r.length;a .jstree-ocl",function(e){e.stopImmediatePropagation();var t=E.Event("click",{metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey});E(e.currentTarget).closest(".jstree-node").children(".jstree-anchor").first().trigger(t).trigger("focus")}.bind(this)).on("mouseover.jstree",".jstree-wholerow, .jstree-icon",function(e){return e.stopImmediatePropagation(),this.is_disabled(e.currentTarget)||this.hover_node(e.currentTarget),!1}.bind(this)).on("mouseleave.jstree",".jstree-node",function(e){this.dehover_node(e.currentTarget)}.bind(this))},this.teardown=function(){this.settings.wholerow&&this.element.find(".jstree-wholerow").remove(),a.teardown.call(this)},this.redraw_node=function(e,t,i,r){var s;return(e=a.redraw_node.apply(this,arguments))&&(s=j.cloneNode(!0),-1!==E.inArray(e.id,this._data.core.selected)&&(s.className+=" jstree-wholerow-clicked"),this._data.core.focused&&this._data.core.focused===e.id&&(s.className+=" jstree-wholerow-hovered"),e.insertBefore(s,e.childNodes[0])),e}},window.customElements&&Object&&Object.create){var e=Object.create(HTMLElement.prototype);e.createdCallback=function(){var e={core:{},plugins:[]},t;for(t in E.jstree.plugins)E.jstree.plugins.hasOwnProperty(t)&&this.attributes[t]&&(e.plugins.push(t),this.getAttribute(t)&&JSON.parse(this.getAttribute(t))&&(e[t]=JSON.parse(this.getAttribute(t))));for(t in E.jstree.defaults.core)E.jstree.defaults.core.hasOwnProperty(t)&&this.attributes[t]&&(e.core[t]=JSON.parse(this.getAttribute(t))||this.getAttribute(t));E(this).jstree(e)};try{window.customElements.define("vakata-jstree",function(){},{prototype:e})}catch(e){}}}}); diff --git a/public/core/default/js/footer/plugins/select2/4.0.13/select2.full.min.js b/public/core/default/js/footer/plugins/select2/4.0.13/select2.full.min.js new file mode 100644 index 000000000..683301daf --- /dev/null +++ b/public/core/default/js/footer/plugins/select2/4.0.13/select2.full.min.js @@ -0,0 +1,2 @@ +/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ +!function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(d){var e=function(){if(d&&d.fn&&d.fn.select2&&d.fn.select2.amd)var e=d.fn.select2.amd;var t,n,i,h,o,s,f,g,m,v,y,_,r,a,w,l;function b(e,t){return r.call(e,t)}function c(e,t){var n,i,r,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&w.test(e[s])&&(e[s]=e[s].replace(w,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},r.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},r.__cache={};var n=0;return r.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},r.StoreData=function(e,t,n){var i=r.GetUniqueElementId(e);r.__cache[i]||(r.__cache[i]={}),r.__cache[i][t]=n},r.GetData=function(e,t){var n=r.GetUniqueElementId(e);return t?r.__cache[n]&&null!=r.__cache[n][t]?r.__cache[n][t]:o(e).data(t):r.__cache[n]},r.RemoveData=function(e){var t=r.GetUniqueElementId(e);null!=r.__cache[t]&&delete r.__cache[t],e.removeAttribute("data-select2-id")},r}),e.define("select2/results",["jquery","./utils"],function(h,f){function i(e,t,n){this.$element=e,this.data=n,this.options=t,i.__super__.constructor.call(this)}return f.Extend(i,f.Observable),i.prototype.render=function(){var e=h('
          ');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h('
        • '),i=this.options.get("translations").get(e.message);n.append(t(i(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n",{class:"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},i.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var i=n-1;0===e.length&&(i=0);var r=t.eq(i);r.trigger("mouseenter");var o=l.$results.offset().top,s=r.offset().top,a=l.$results.scrollTop()+(s-o);0===i?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var i=t.eq(n);i.trigger("mouseenter");var r=l.$results.offset().top+l.$results.outerHeight(!1),o=i.offset().top+i.outerHeight(!1),s=l.$results.scrollTop()+o-r;0===n?l.$results.scrollTop(0):rthis.$results.outerHeight()||o<0)&&this.$results.scrollTop(r)}},i.prototype.template=function(e,t){var n=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),r=n(e,t);null==r?t.style.display="none":"string"==typeof r?t.innerHTML=i(r):h(t).append(r)},i}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,i,r){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return i.Extend(o,i.Observable),o.prototype.render=function(){var e=n('');return this._tabindex=0,null!=i.GetData(this.$element[0],"old-tabindex")?this._tabindex=i.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,i=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===r.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",i),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&i.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html(''),e},r.prototype.bind=function(t,e){var n=this;r.__super__.bind.apply(this,arguments);var i=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},r.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return e("")},r.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i);var r=t.title||t.text;r?n.attr("title",r):n.removeAttr("title")}else this.clear()},r}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(r,e,l){function n(e,t){n.__super__.constructor.apply(this,arguments)}return l.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('
            '),e},n.prototype.bind=function(e,t){var i=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){i.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!i.isDisabled()){var t=r(this).parent(),n=l.GetData(t[0],"data");i.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return r('
          • ×
          • ')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n×');a.StoreData(i[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(i)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(i,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=i('');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),t.on("open",function(){i.$search.attr("aria-controls",r),i.$search.trigger("focus")}),t.on("close",function(){i.$search.val(""),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.trigger("focus")}),t.on("enable",function(){i.$search.prop("disabled",!1),i._transferTabIndex()}),t.on("disable",function(){i.$search.prop("disabled",!0)}),t.on("focus",function(e){i.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){i.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){i._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===i.$search.val()){var t=i.$searchContainer.prev(".select2-selection__choice");if(0this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(){i._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var i=this;this._checkIfMaximumSelected(function(){e.call(i,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var i=this;this.current(function(e){var t=null!=e?e.length:0;0=i.maximumSelectionLength?i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):n&&n()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o('');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){i.handleSearch(e)}),t.on("open",function(){i.$search.attr("tabindex",0),i.$search.attr("aria-controls",r),i.$search.trigger("focus"),window.setTimeout(function(){i.$search.trigger("focus")},0)}),t.on("close",function(){i.$search.attr("tabindex",-1),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.val(""),i.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||i.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;0<=i;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",function(e){i.lastParams=e,i.loading=!0}),t.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('
          • '),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),i._bindContainerResultHandlers(t)}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f(""),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,i="scroll.select2."+t.id,r="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(i,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(i+" "+r+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,i="resize.select2."+t.id,r="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+i+" "+r)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),i=null,r=this.$container.offset();r.bottom=r.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=r.top,o.bottom=r.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=ar.bottom+s,d={left:r.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};(f.contains(document.body,p[0])||p[0].isConnected)&&(h=p.offset()),d.top-=h.top,d.left-=h.left,t||n||(i="below"),u||!c||t?!c&&u&&t&&(i="below"):i="above",("above"==i||t&&"below"!==i)&&(d.top=o.top-h.top-s),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,i=0;i');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("select2/compat/utils",["jquery"],function(s){return{syncCssClasses:function(e,t,n){var i,r,o=[];(i=s.trim(e.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0===this.indexOf("select2-")&&o.push(this)}),(i=s.trim(t.attr("class")))&&s((i=""+i).split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(r=n(this))&&o.push(r)}),e.attr("class",o.join(" "))}}}),e.define("select2/compat/containerCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("containerCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptContainerCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}var o=this.options.get("containerCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/dropdownCss",["jquery","./utils"],function(s,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("dropdownCssClass")||"";s.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptDropdownCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var r=i;i=function(e){var t=r(e);return null!=t?t+" "+e:e}}var o=this.options.get("dropdownCss")||{};return s.isFunction(o)&&(o=o(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(o),t.addClass(n),t},e}),e.define("select2/compat/initSelection",["jquery"],function(i){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return e.prototype.current=function(e,t){var n=this;this._isInitialized?e.call(this,t):this.initSelection.call(null,this.$element,function(e){n._isInitialized=!0,i.isArray(e)||(e=[e]),t(e)})},e}),e.define("select2/compat/inputData",["jquery","../utils"],function(s,i){function e(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `