diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2021-12-21 23:29:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-21 23:29:51 +0300 |
commit | 10afd46db0e033e67127fb4e50eea986ed5296e6 (patch) | |
tree | 425661fd96c76773f663eb7edeec58309f240488 /plugins/CorePluginsAdmin | |
parent | 90658e4116ad4aca54ec79e12cdbd800e05a1359 (diff) |
[Vue] migrate remaining directives in CorePluginsAdmin (#18433)
* migrating reporting pages store
* make store adapters more immutable
* get service adapters to work
* fix a UI test
* another html fix
* migrate most of reporting menu directive and model
* Use themed font family for input forms to override materialize.css styling
* rebuild vue
* add a missing div
* ui test fixes
* update styling
* get to build
* get to load in the UI w/o error
* clone result of functions
* fix compile issue
* migrate widget loader and get to load in UI
* rebuild vue
* migrate widgetcontainer
* migrate widget bydimension container
* migrate widget + add tooltips directive
* quick fix
* Updating version to 4.6.0
* loading in page
* update expected screenshot
* add wait just in case travis is slow
* fix ordering bug
* add another wait
* rebuild vue
* css tweak
* fix some bugs and tests
* undo screenshot changes
* Menus test passing locally
* [Vue] date picker viewDate property is not kept up to date (#18385)
* viewDate ref is not kept up to date
* rebuild corehome
* reporting menu subcategory items are meant to be normal links
* update some screenshots
* use innerText instead of text() since angularjs maintains newlines in HTML that vue does not add
* trigger angularjs digest after ajaxhelper request
* rebuild vue
* update screenshots, fix bug in link generation in reporting menu and allow syncing multiple screenshot regexes at a time
* undo box-shadow change for UI tests
* fix more issues & update more tests
* update some screenshots
* fix some tests
* rebuild CoreHome
* quick fix
* built vue files
* fix angularjs issue
* add comment
* update umd files
* 4.6.1-rc1
* 4.6.1
* fix field array title
* apply some pr feedback
* apply more pr feedback
* another fix
* tweak
* fix ng-change not executed before ng-model
* fix another set of issues
* fix another issue
* rebuild vue
* better ng-change/ng-model fix
* update some screenshots
* rebuild vue
* remove some TODOs
* initiate initial ng-change ONLY for site selectors where this behavior applies
* emit/broadcast on correct scope in wrapper
* rebuild vue
* fix some issues
* couple more fixes
* fix another title issue
* rebuild vue
* do not report on ajax errors in notifications if not logged in
* migrate reporting page and model
* rebuild vue
* create sites selector model adapter
* fix siteselector vue bug, initial site is only set if there is just one site available
* rebuild vue
* migrate plugin settings directive
* remove TODO
* migrate plugin filter directive
* migrate two more plugins directives
* migrate save button
* fix a bunch of bugs
* fix another widget bug
* allow change event name between angularjs and vue
* rebuild vue
* migrate plugin form directive
* get to work
* built vue files
* fix function signature
* fix vue warning
* fix ajax request race condition
* rebuild vue
* add new notification type "help" so the help notification is not cleared when clearing transient notifications
* fix some bugs and tests
* update screenshot
* update screenshot & fix a test
* allow using unminified jquery ui + fix bug in last fix
* fix error when enrichedheadline is used in modal
* add polyfill min.js
* remove two todos
* fix widget url logic
* update some screenshots and fix sanitization/escape issue
* update screenshots
* rebuild vue
* fix url location updating regression in MatomoUrl.updateLocation use
* submodule
* update screenshots and fix possible error in json parse
* built vue files
* Merge branch 'vue-period-selector-regression' into vue-reporting-menu
* rebuild vue
* use correct variable
* rebuild vue
* fix widget url logic
* segment parameter can be undefined now for some reason
* fix ngmodel binding in siteselector adapter (for last time hopefully)
* the original site selector only set the first site to the first site in the initial sites query if there was only one site in the entire matomo instance
* fix sitesmanager ui test failure
* fix usersettings test failure
* rebuild vue
* more siteselector tweaks.
* build CoreHome
* more siteselector tweaks.
* another siteselector issue
* update screenshots
* update screenshot and try to fix random failure
* fix some issues in widget.vue when containerid is specified
* fix couple tests
* fix several test failures
* fix string concat
* fix test failure
* extra change
* fix last change and random failure
* styling fix
* fix last fix
* real fix this time
* fix stray request
* proper fix
* update build files
* try to fix random failure
* do not submit form
* check for api errors in promise chain in ajaxhelper.ts
* force a digest after a location change
* use proper abortcontroller method instead of promise hack, have to add new polyfill + try to fix random test failure
* some UI test fixes
* several save button fixes + make replace approximation in createAngularJsAdapter better
* apply after manual click triggering in savebutton
* update screenshots
* post loadPage event after url changes so URL changes are propagated properly to widgets, take columns param into account when re-rendering a page
* Update ReportingMenu.vue
merge conflicts
* built vue files
* revert invalid UI file changes
* fix two regressions in period selector comparison launching/detection (#18497)
* forward compareSegments in when applying period selector change + check if comparing periods in period selector
* built vue files
* fix piwik-widget selector in dataTable.js
* remove space
* extra scope apply after hash change so angularjs notices, change css class to use kebab case, check for field using css class as well in Widget.vue
* rebuild vue
* built vue files
* try to fix random failure
* fix order of JS in karma tests
* remove empty props
* use promise chaining
* remove form.directive.js and fix typings for test
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
Co-authored-by: justinvelluppillai <justinvelluppillai@users.noreply.github.com>
Co-authored-by: Matthieu Aubry <mattab@users.noreply.github.com>
Co-authored-by: Peter Zhang <peter@innocraft.com>
Co-authored-by: peterhashair <peterhashair@users.noreply.github.com>
Co-authored-by: sgiehl <stefan@matomo.org>
Diffstat (limited to 'plugins/CorePluginsAdmin')
19 files changed, 835 insertions, 309 deletions
diff --git a/plugins/CorePluginsAdmin/angularjs/form/form.directive.js b/plugins/CorePluginsAdmin/angularjs/form/form.directive.js deleted file mode 100644 index 3fec5db7e7..0000000000 --- a/plugins/CorePluginsAdmin/angularjs/form/form.directive.js +++ /dev/null @@ -1,39 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -/** - * Usage: - * <div piwik-form> - */ -(function () { - angular.module('piwikApp').directive('piwikForm', piwikForm); - - piwikForm.$inject = ['piwik', '$timeout']; - - function piwikForm(piwik, $timeout){ - - return { - restrict: 'A', - priority: '10', - compile: function (element, attrs) { - - return function (scope, element, attrs) { - - $timeout(function () { - - element.find('input[type=text]').keypress(function (e) { - var key = e.keyCode || e.which; - if (key == 13) { - element.find('[piwik-save-button] input').triggerHandler('click'); - } - }); - }); - }; - } - }; - } -})();
\ No newline at end of file diff --git a/plugins/CorePluginsAdmin/angularjs/plugins/plugin-filter.directive.js b/plugins/CorePluginsAdmin/angularjs/plugins/plugin-filter.directive.js deleted file mode 100644 index 8d34110152..0000000000 --- a/plugins/CorePluginsAdmin/angularjs/plugins/plugin-filter.directive.js +++ /dev/null @@ -1,113 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -/** - * Usage: - * <div piwik-plugin-filter> - */ -(function () { - angular.module('piwikApp').directive('piwikPluginFilter', piwikPluginFilter); - - piwikPluginFilter.$inject = ['piwik']; - - function piwikPluginFilter(piwik){ - - return { - restrict: 'A', - compile: function (element, attrs) { - - return function (scope, element, attrs) { - - updateAllNumbersOfMatchingPluginsInFilter(); - - function filterPlugins() - { - var filterOrigin = getCurrentFilterOrigin(); - var filterStatus = getCurrentFilterStatus(); - - var $nodesToEnable = getMatchingNodes(filterOrigin, filterStatus); - - $('#plugins tr[data-filter-origin][data-filter-status]').css('display', 'none'); - $nodesToEnable.css('display', 'table-row'); - - updateAllNumbersOfMatchingPluginsInFilter(); - } - - function updateAllNumbersOfMatchingPluginsInFilter() - { - var filterOrigin = getCurrentFilterOrigin(); - var filterStatus = getCurrentFilterStatus(); - - updateNumberOfMatchingPluginsInFilter('[data-filter-status="all"]', filterOrigin, 'all'); - updateNumberOfMatchingPluginsInFilter('[data-filter-status="active"]', filterOrigin, 'active'); - updateNumberOfMatchingPluginsInFilter('[data-filter-status="inactive"]', filterOrigin, 'inactive'); - - updateNumberOfMatchingPluginsInFilter('[data-filter-origin="all"]', 'all', filterStatus); - updateNumberOfMatchingPluginsInFilter('[data-filter-origin="core"]', 'core', filterStatus); - updateNumberOfMatchingPluginsInFilter('[data-filter-origin="official"]', 'official', filterStatus); - updateNumberOfMatchingPluginsInFilter('[data-filter-origin="thirdparty"]', 'thirdparty', filterStatus); - } - - function updateNumberOfMatchingPluginsInFilter(selectorFilterToUpdate, filterOrigin, filterStatus) - { - var numMatchingNodes = getMatchingNodes(filterOrigin, filterStatus).length; - var updatedCounterText = ' (' + numMatchingNodes + ')'; - - element.find(selectorFilterToUpdate + ' .counter').text(updatedCounterText); - } - - function getCurrentFilterOrigin() - { - return element.find('.origin a.active').data('filter-origin'); - } - - function getCurrentFilterStatus() - { - return element.find('.status a.active').data('filter-status'); - } - - function getMatchingNodes(filterOrigin, filterStatus) - { - var query = '#plugins tr'; - - if ('all' == filterOrigin) { - query += '[data-filter-origin]'; - } else { - query += '[data-filter-origin=' + filterOrigin + ']'; - } - - if ('all' == filterStatus) { - query += '[data-filter-status]'; - } else { - query += '[data-filter-status=' + filterStatus + ']'; - } - - return $(query); - } - - element.find('.status').on('click', 'a', function (event) { - event.preventDefault(); - - $(this).siblings().removeClass('active'); - $(this).addClass('active'); - - filterPlugins(); - }); - - element.find('.origin').on('click', 'a', function (event) { - event.preventDefault(); - - $(this).siblings().removeClass('active'); - $(this).addClass('active'); - - filterPlugins(); - }); - }; - } - }; - } -})();
\ No newline at end of file diff --git a/plugins/CorePluginsAdmin/angularjs/plugins/plugin-management.directive.js b/plugins/CorePluginsAdmin/angularjs/plugins/plugin-management.directive.js deleted file mode 100644 index c49443b0b0..0000000000 --- a/plugins/CorePluginsAdmin/angularjs/plugins/plugin-management.directive.js +++ /dev/null @@ -1,65 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -/** - * Usage: - * <div piwik-plugin-management> - */ -(function () { - - angular.module('piwikApp').directive('piwikPluginManagement', piwikPluginManagement); - - piwikPluginManagement.$inject = ['piwik']; - - function piwikPluginManagement(piwik){ - - return { - restrict: 'A', - compile: function (element, attrs) { - - return function (scope, element, attrs) { - - var uninstallConfirmMessage = ''; - - element.find('.uninstall').click(function (event) { - event.preventDefault(); - - var link = $(this).attr('href'); - var pluginName = $(this).attr('data-plugin-name'); - - if (!link || !pluginName) { - return; - } - - if (!uninstallConfirmMessage) { - uninstallConfirmMessage = $('#uninstallPluginConfirm').text(); - } - - var messageToDisplay = uninstallConfirmMessage.replace('%s', pluginName); - - $('#uninstallPluginConfirm').text(messageToDisplay); - - piwikHelper.modalConfirm('#confirmUninstallPlugin', { - yes: function () { - window.location = link; - } - }); - }); - - element.find('.plugin-donation-link').click(function (event) { - event.preventDefault(); - - var overlayId = $(this).data('overlay-id'); - - piwikHelper.modalConfirm('#'+overlayId, {}); - }); - - }; - } - }; - } -})();
\ No newline at end of file diff --git a/plugins/CorePluginsAdmin/angularjs/plugins/plugin-upload.directive.js b/plugins/CorePluginsAdmin/angularjs/plugins/plugin-upload.directive.js deleted file mode 100644 index dff036c519..0000000000 --- a/plugins/CorePluginsAdmin/angularjs/plugins/plugin-upload.directive.js +++ /dev/null @@ -1,49 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -/** - * Usage: - * <div piwik-plugin-upload> - */ -(function () { - - angular.module('piwikApp').directive('piwikPluginUpload', piwikPluginUpload); - - piwikPluginUpload.$inject = ['piwik']; - - function piwikPluginUpload(piwik){ - - return { - restrict: 'A', - compile: function (element, attrs) { - - return function (scope, element, attrs) { - - $('.uploadPlugin').click(function (event) { - event.preventDefault(); - - piwikHelper.modalConfirm('#installPluginByUpload', {}); - }); - - $('#uploadPluginForm').submit(function (event) { - - var $zipFile = $('[name=pluginZip]'); - var fileName = $zipFile.val(); - - if (!fileName || '.zip' != fileName.slice(-4)) { - event.preventDefault(); - alert(_pk_translate('CorePluginsAdmin_NoZipFileSelected')); - } else if ($zipFile.data('maxSize') > 0 && $zipFile[0].files[0].size > $zipFile.data('maxSize')*1048576) { - event.preventDefault(); - alert(_pk_translate('CorePluginsAdmin_FileExceedsUploadLimit')); - } - }); - }; - } - }; - } -})();
\ No newline at end of file diff --git a/plugins/CorePluginsAdmin/angularjs/save-button/save-button.directive.html b/plugins/CorePluginsAdmin/angularjs/save-button/save-button.directive.html deleted file mode 100644 index 61dc111280..0000000000 --- a/plugins/CorePluginsAdmin/angularjs/save-button/save-button.directive.html +++ /dev/null @@ -1,8 +0,0 @@ -<div style="display:inline-block;"> - <input type="button" - ng-click="onconfirm()" - value="{{ value ? value : ('General_Save'|translate) }}" - ng-disabled="saving || disabled" - class="btn"/> - <div piwik-activity-indicator loading="saving"></div> -</div>
\ No newline at end of file diff --git a/plugins/CorePluginsAdmin/angularjs/save-button/save-button.directive.js b/plugins/CorePluginsAdmin/angularjs/save-button/save-button.directive.js deleted file mode 100644 index 1ad8321558..0000000000 --- a/plugins/CorePluginsAdmin/angularjs/save-button/save-button.directive.js +++ /dev/null @@ -1,31 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -/** - * Usage: - * <div piwik-save-button> - */ -(function () { - angular.module('piwikApp').directive('piwikSaveButton', piwikSaveButton); - - piwikSaveButton.$inject = ['piwik']; - - function piwikSaveButton(piwik){ - - return { - restrict: 'A', - replace: true, - scope: { - saving: '=?', - value: '@?', - disabled: '=?', - onconfirm: '&?' - }, - templateUrl: 'plugins/CorePluginsAdmin/angularjs/save-button/save-button.directive.html?cb=' + piwik.cacheBuster - }; - } -})();
\ No newline at end of file diff --git a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js index 0e9a4c93e1..63d7863b7e 100644 --- a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js +++ b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js @@ -121,6 +121,11 @@ __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "FormField", function() { return /* reexport */ FormField; }); __webpack_require__.d(__webpack_exports__, "Field", function() { return /* reexport */ Field; }); __webpack_require__.d(__webpack_exports__, "PluginSettings", function() { return /* reexport */ PluginSettings; }); +__webpack_require__.d(__webpack_exports__, "PluginFilter", function() { return /* reexport */ PluginFilter; }); +__webpack_require__.d(__webpack_exports__, "PluginManagement", function() { return /* reexport */ PluginManagement; }); +__webpack_require__.d(__webpack_exports__, "PluginUpload", function() { return /* reexport */ PluginUpload; }); +__webpack_require__.d(__webpack_exports__, "SaveButton", function() { return /* reexport */ SaveButton; }); +__webpack_require__.d(__webpack_exports__, "Form", function() { return /* reexport */ Form; }); // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js // This file is imported into lib/wc client bundles. @@ -2839,6 +2844,371 @@ PluginSettingsvue_type_script_lang_ts.render = PluginSettingsvue_type_template_i }, directiveName: 'piwikPluginSettings' })); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Plugins/PluginManagement.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +var PluginManagement_window = window, + PluginManagement_$ = PluginManagement_window.$; + +function onClickUninstall(binding, event) { + event.preventDefault(); + var link = PluginManagement_$(event.target).attr('href'); + var pluginName = PluginManagement_$(event.target).attr('data-plugin-name'); + + if (!link || !pluginName) { + return; + } + + if (!binding.value.uninstallConfirmMessage) { + binding.value.uninstallConfirmMessage = PluginManagement_$('#uninstallPluginConfirm').text(); + } + + var messageToDisplay = binding.value.uninstallConfirmMessage.replace('%s', pluginName); + PluginManagement_$('#uninstallPluginConfirm').text(messageToDisplay); + external_CoreHome_["Matomo"].helper.modalConfirm('#confirmUninstallPlugin', { + yes: function yes() { + window.location = link; + } + }); +} + +function onDonateLinkClick(event) { + event.preventDefault(); + var overlayId = PluginManagement_$(event.target).data('overlay-id'); + external_CoreHome_["Matomo"].helper.modalConfirm("#".concat(overlayId), {}); +} + +/* harmony default export */ var PluginManagement = ({ + mounted: function mounted(el, binding) { + setTimeout(function () { + binding.value.uninstallConfirmMessage = ''; + PluginManagement_$(el).find('.uninstall').click(onClickUninstall.bind(null, binding)); + PluginManagement_$(el).find('.plugin-donation-link').click(onDonateLinkClick); + }); + } +}); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Plugins/PluginManagement.adapter.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +function piwikPluginManagement() { + return { + restrict: 'A', + link: function expandOnClickLink(scope, element) { + var binding = { + instance: null, + value: {}, + oldValue: null, + modifiers: {}, + dir: {} + }; + PluginManagement.mounted(element[0], binding); + } + }; +} +piwikPluginManagement.$inject = []; +angular.module('piwikApp').directive('piwikPluginManagement', piwikPluginManagement); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Plugins/PluginUpload.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +var PluginUpload_window = window, + PluginUpload_$ = PluginUpload_window.$; + +function onUploadPlugin(event) { + event.preventDefault(); + external_CoreHome_["Matomo"].helper.modalConfirm('#installPluginByUpload', {}); +} + +function onSubmitPlugin(event) { + var $zipFile = PluginUpload_$('[name=pluginZip]'); + var fileName = $zipFile.val(); + + if (!fileName || fileName.slice(-4) !== '.zip') { + event.preventDefault(); // eslint-disable-next-line no-alert + + alert(Object(external_CoreHome_["translate"])('CorePluginsAdmin_NoZipFileSelected')); + } else if ($zipFile.data('maxSize') > 0 && $zipFile[0].files[0].size > $zipFile.data('maxSize') * 1048576) { + event.preventDefault(); // eslint-disable-next-line no-alert + + alert(Object(external_CoreHome_["translate"])('CorePluginsAdmin_FileExceedsUploadLimit')); + } +} + +/* harmony default export */ var PluginUpload = ({ + mounted: function mounted() { + setTimeout(function () { + PluginUpload_$('.uploadPlugin').click(onUploadPlugin); + PluginUpload_$('#uploadPluginForm').submit(onSubmitPlugin); + }); + } +}); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Plugins/PluginUpload.adapter.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +function piwikPluginUpload() { + return { + restrict: 'A', + link: function expandOnClickLink() { + PluginUpload.mounted(); + } + }; +} +piwikPluginUpload.$inject = []; +angular.module('piwikApp').directive('piwikPluginUpload', piwikPluginUpload); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Plugins/PluginFilter.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +var PluginFilter_window = window, + PluginFilter_$ = PluginFilter_window.$; + +function getCurrentFilterOrigin(element) { + return element.find('.origin a.active').data('filter-origin'); +} + +function getCurrentFilterStatus(element) { + return element.find('.status a.active').data('filter-status'); +} + +function getMatchingNodes(filterOrigin, filterStatus) { + var query = '#plugins tr'; + + if (filterOrigin === 'all') { + query += '[data-filter-origin]'; + } else { + query += "[data-filter-origin=".concat(filterOrigin, "]"); + } + + if (filterStatus === 'all') { + query += '[data-filter-status]'; + } else { + query += "[data-filter-status=".concat(filterStatus, "]"); + } + + return PluginFilter_$(query); +} + +function updateNumberOfMatchingPluginsInFilter(element, selectorFilterToUpdate, filterOrigin, filterStatus) { + var numMatchingNodes = getMatchingNodes(filterOrigin, filterStatus).length; + var updatedCounterText = " (".concat(numMatchingNodes, ")"); + element.find("".concat(selectorFilterToUpdate, " .counter")).text(updatedCounterText); +} + +function updateAllNumbersOfMatchingPluginsInFilter(element) { + var filterOrigin = getCurrentFilterOrigin(element); + var filterStatus = getCurrentFilterStatus(element); + updateNumberOfMatchingPluginsInFilter(element, '[data-filter-status="all"]', filterOrigin, 'all'); + updateNumberOfMatchingPluginsInFilter(element, '[data-filter-status="active"]', filterOrigin, 'active'); + updateNumberOfMatchingPluginsInFilter(element, '[data-filter-status="inactive"]', filterOrigin, 'inactive'); + updateNumberOfMatchingPluginsInFilter(element, '[data-filter-origin="all"]', 'all', filterStatus); + updateNumberOfMatchingPluginsInFilter(element, '[data-filter-origin="core"]', 'core', filterStatus); + updateNumberOfMatchingPluginsInFilter(element, '[data-filter-origin="official"]', 'official', filterStatus); + updateNumberOfMatchingPluginsInFilter(element, '[data-filter-origin="thirdparty"]', 'thirdparty', filterStatus); +} + +function filterPlugins(element) { + var filterOrigin = getCurrentFilterOrigin(element); + var filterStatus = getCurrentFilterStatus(element); + var $nodesToEnable = getMatchingNodes(filterOrigin, filterStatus); + PluginFilter_$('#plugins tr[data-filter-origin][data-filter-status]').css('display', 'none'); + $nodesToEnable.css('display', 'table-row'); + updateAllNumbersOfMatchingPluginsInFilter(element); +} + +function onClickStatus(element, event) { + event.preventDefault(); + PluginFilter_$(event.target).siblings().removeClass('active'); + PluginFilter_$(event.target).addClass('active'); + filterPlugins(element); +} + +function onClickOrigin(element, event) { + event.preventDefault(); + PluginFilter_$(event.target).siblings().removeClass('active'); + PluginFilter_$(event.target).addClass('active'); + filterPlugins(element); +} + +/* harmony default export */ var PluginFilter = ({ + mounted: function mounted(el) { + setTimeout(function () { + updateAllNumbersOfMatchingPluginsInFilter(PluginFilter_$(el)); + PluginFilter_$(el).find('.status').on('click', 'a', onClickStatus.bind(null, PluginFilter_$(el))); + PluginFilter_$(el).find('.origin').on('click', 'a', onClickOrigin.bind(null, PluginFilter_$(el))); + }); + } +}); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Plugins/PluginFilter.adapter.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +function piwikPluginFilter() { + return { + restrict: 'A', + link: function expandOnClickLink(scope, element) { + PluginFilter.mounted(element[0]); + } + }; +} +piwikPluginFilter.$inject = []; +angular.module('piwikApp').directive('piwikPluginFilter', piwikPluginFilter); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/SaveButton/SaveButton.vue?vue&type=template&id=c302ef68 + +var SaveButtonvue_type_template_id_c302ef68_hoisted_1 = { + class: "matomo-save-button", + style: { + "display": "inline-block" + } +}; +var SaveButtonvue_type_template_id_c302ef68_hoisted_2 = ["disabled", "value"]; +function SaveButtonvue_type_template_id_c302ef68_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_ActivityIndicator = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ActivityIndicator"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", SaveButtonvue_type_template_id_c302ef68_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "button", + onClick: _cache[0] || (_cache[0] = function ($event) { + return _ctx.onConfirm($event); + }), + disabled: _ctx.saving || _ctx.disabled, + class: "btn", + value: _ctx.value ? _ctx.value : _ctx.translate('General_Save') + }, null, 8, SaveButtonvue_type_template_id_c302ef68_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ActivityIndicator, { + loading: _ctx.saving + }, null, 8, ["loading"])]); +} +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/SaveButton/SaveButton.vue?vue&type=template&id=c302ef68 + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-3!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/SaveButton/SaveButton.vue?vue&type=script&lang=ts + + +/* harmony default export */ var SaveButtonvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + saving: Boolean, + value: String, + disabled: Boolean + }, + components: { + ActivityIndicator: external_CoreHome_["ActivityIndicator"] + }, + emits: ['confirm'], + methods: { + onConfirm: function onConfirm($event) { + this.$emit('confirm', $event); + } + } +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/SaveButton/SaveButton.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/SaveButton/SaveButton.vue + + + +SaveButtonvue_type_script_lang_ts.render = SaveButtonvue_type_template_id_c302ef68_render + +/* harmony default export */ var SaveButton = (SaveButtonvue_type_script_lang_ts); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/SaveButton/SaveButton.adapter.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + + +/* harmony default export */ var SaveButton_adapter = (Object(external_CoreHome_["createAngularJsAdapter"])({ + component: SaveButton, + scope: { + saving: { + angularJsBind: '=?' + }, + value: { + angularJsBind: '@?' + }, + disabled: { + angularJsBind: '=?' + }, + onconfirm: { + angularJsBind: '&?', + vue: 'confirm' + } + }, + events: { + confirm: function confirm($event, vm, scope, element, attrs, controller, $timeout) { + element[0].click(); // this directive can be used on input's with ng-click specified + + $timeout(); + } + }, + replace: true, + directiveName: 'piwikSaveButton', + $inject: ['$timeout'] +})); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Form/Form.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +var Form_window = window, + Form_$ = Form_window.$; +/* harmony default export */ var Form = ({ + mounted: function mounted(el) { + setTimeout(function () { + Form_$(el).find('input[type=text]').keypress(function (e) { + var key = e.keyCode || e.which; + + if (key === 13) { + Form_$(el).find('.matomo-save-button input').triggerHandler('click'); + } + }); + }); + } +}); +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Form/Form.adapter.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +function piwikForm() { + return { + restrict: 'A', + link: function expandOnClickLink(scope, element) { + Form.mounted(element[0]); + } + }; +} +piwikForm.$inject = []; +angular.module('piwikApp').directive('piwikForm', piwikForm); // CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/index.ts /*! * Matomo - free/libre analytics platform @@ -2852,6 +3222,16 @@ PluginSettingsvue_type_script_lang_ts.render = PluginSettingsvue_type_template_i + + + + + + + + + + // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js diff --git a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js index 46d44fecfc..ff088e59bb 100644 --- a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js +++ b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js @@ -1,10 +1,10 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue")):"function"===typeof define&&define.amd?define(["CoreHome"],t):"object"===typeof exports?exports["CorePluginsAdmin"]=t(require("CoreHome"),require("vue")):e["CorePluginsAdmin"]=t(e["CoreHome"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/CorePluginsAdmin/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"FormField",(function(){return Kt})),n.d(t,"Field",(function(){return dn})),n.d(t,"PluginSettings",(function(){return Wn})),"undefined"!==typeof window){var r=window.document.currentScript,o=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(n.p=o[1])}var i=n("19dc"),l=n("8bbf");function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s={class:"form-group row matomo-form-field"},d={key:0,class:"col s12"},m={key:0,class:"form-help"},f={key:0,class:"inline-help",ref:"inlineHelp"},p=Object(l["createElementVNode"])("br",null,null,-1);function b(e,t,n,r,o,i){return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("div",s,[e.formField.introduction?(Object(l["openBlock"])(),Object(l["createElementBlock"])("h3",d,Object(l["toDisplayString"])(e.formField.introduction),1)):Object(l["createCommentVNode"])("",!0),Object(l["createElementVNode"])("div",{class:Object(l["normalizeClass"])(["col s12",{"input-field":"checkbox"!==e.formField.uiControl&&"radio"!==e.formField.uiControl,"file-field":"file"===e.formField.uiControl,m6:!e.formField.fullWidth}])},[(Object(l["openBlock"])(),Object(l["createBlock"])(Object(l["resolveDynamicComponent"])(e.childComponent),Object(l["mergeProps"])(u(u({formField:e.formField},e.formField),{},{modelValue:e.processedModelValue,availableOptions:e.availableOptions},e.extraChildComponentParams),{"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)})}),null,16))],2),Object(l["createElementVNode"])("div",{class:Object(l["normalizeClass"])(["col s12",{m6:!e.formField.fullWidth}])},[e.showFormHelp?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",m,[Object(l["withDirectives"])(Object(l["createElementVNode"])("div",{class:"form-description"},Object(l["toDisplayString"])(e.formField.description),513),[[l["vShow"],e.formField.description]]),e.formField.inlineHelp?(Object(l["openBlock"])(),Object(l["createElementBlock"])("span",f,null,512)):Object(l["createCommentVNode"])("",!0),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",null,[p,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("General_Default"))+": ",1),Object(l["createElementVNode"])("span",null,Object(l["toDisplayString"])(e.defaultValuePrettyTruncated),1)],512),[[l["vShow"],e.showDefaultValue]])])):Object(l["createCommentVNode"])("",!0)],2)],512)),[[l["vShow"],e.showField]])}var h={class:"checkbox"},O=["checked","id","name"],g=["innerHTML"];function v(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",h,[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},e.uiControlAttributes,{value:1,checked:!!e.modelValue,type:"checkbox",id:e.name,name:e.name}),null,16,O),Object(l["createElementVNode"])("span",{innerHTML:e.$sanitize(e.title)},null,8,g)])])}var y=Object(l["defineComponent"])({props:{modelValue:Boolean,uiControlAttributes:Object,name:String,title:String},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){this.modelValue!==e.target.checked&&this.$emit("update:modelValue",e.target.checked)}}});y.render=v;var j=y,w=["value","checked","onChange","id","name"];function V(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["withDirectives"])(Object(l["createElementVNode"])("label",{class:"fieldRadioTitle"},Object(l["toDisplayString"])(e.title),513),[[l["vShow"],e.title]]),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions,(function(t,n){return Object(l["openBlock"])(),Object(l["createElementBlock"])("p",{key:n,class:"checkbox"},[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({value:t.key,checked:!!e.checkboxStates[n],onChange:function(t){return e.onChange(n)}},e.uiControlAttributes,{type:"checkbox",id:"".concat(e.name).concat(t.key),name:t.name}),null,16,w),Object(l["createElementVNode"])("span",null,Object(l["toDisplayString"])(t.value),1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{class:"form-description"},Object(l["toDisplayString"])(t.description),513),[[l["vShow"],t.description]])])])})),128))])}function S(e){return F(e)||k(e)||A(e)||C()}function C(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function A(e,t){if(e){if("string"===typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}function k(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function F(e){if(Array.isArray(e))return E(e)}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function B(e,t){return(e||[]).map((function(e){return t&&-1!==t.indexOf(e.key)}))}var x=Object(l["defineComponent"])({props:{modelValue:Object,name:String,title:String,availableOptions:Array,uiControlAttributes:Object,type:String},inheritAttrs:!1,emits:["update:modelValue"],computed:{checkboxStates:function(){return B(this.availableOptions,this.modelValue)}},mounted:function(){window.Materialize.updateTextFields()},methods:{onChange:function(e){var t=S(this.checkboxStates);t[e]=!t[e];var n=[];Object.values(this.availableOptions).forEach((function(e,r){t[r]&&n.push(e.key)})),this.$emit("update:modelValue",n)}}});x.render=V;var N=x,P={class:"expandableSelector"},T=Object(l["createElementVNode"])("svg",{class:"caret",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},[Object(l["createElementVNode"])("path",{d:"M7 10l5 5 5-5z"}),Object(l["createElementVNode"])("path",{d:"M0 0h24v24H0z",fill:"none"})],-1),$=["value"],M={class:"expandableList z-depth-2"},D={class:"searchContainer"},J={class:"collection firstLevel"},H=["onClick"],L={class:"collection secondLevel"},I=["onClick"],z={class:"primary-content"},U=["title"];function K(e,t,n,r,o,i){var a=Object(l["resolveDirective"])("focus-if"),u=Object(l["resolveDirective"])("focus-anywhere-but-here");return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("div",P,[Object(l["createElementVNode"])("div",{onClick:t[0]||(t[0]=function(t){return e.showSelect=!e.showSelect}),class:"select-wrapper"},[T,Object(l["createElementVNode"])("input",{type:"text",class:"select-dropdown",readonly:"readonly",value:e.modelValueText},null,8,$)]),Object(l["withDirectives"])(Object(l["createElementVNode"])("div",M,[Object(l["createElementVNode"])("div",D,[Object(l["withDirectives"])(Object(l["createElementVNode"])("input",{type:"text",placeholder:"Search","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.searchTerm=t}),class:"expandableSearch browser-default"},null,512),[[l["vModelText"],e.searchTerm],[a,e.showSelect]])]),Object(l["createElementVNode"])("ul",J,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions,(function(t,n){return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("li",{class:"collection-item",key:n},[Object(l["createElementVNode"])("h4",{class:"expandableListCategory",onClick:function(n){return e.onCategoryClicked(t)}},[Object(l["createTextVNode"])(Object(l["toDisplayString"])(t.group)+" ",1),Object(l["createElementVNode"])("span",{class:Object(l["normalizeClass"])(["secondary-content",{"icon-arrow-right":e.showCategory!==t.group,"icon-arrow-bottom":e.showCategory===t.group}])},null,2)],8,H),Object(l["withDirectives"])(Object(l["createElementVNode"])("ul",L,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(t.values.filter((function(t){return-1!==t.value.indexOf(e.searchTerm)})),(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("li",{class:"expandableListItem collection-item valign-wrapper",key:t.key,onClick:function(n){return e.onValueClicked(t)}},[Object(l["createElementVNode"])("span",z,Object(l["toDisplayString"])(t.value),1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{title:t.tooltip,class:"secondary-content icon-help"},null,8,U),[[l["vShow"],t.tooltip]])],8,I)})),128))],512),[[l["vShow"],e.showCategory===t.group||e.searchTerm]])],512)),[[l["vShow"],t.values.filter((function(t){return-1!==t.value.indexOf(e.searchTerm)})).length]])})),128))])],512),[[l["vShow"],e.showSelect]])],512)),[[u,{blur:e.onBlur}]])}function _(e){var t=[],n={};return Object.values(e).forEach((function(e){var t=e,r=t.group||"";r in n&&n[r]||(n[r]={values:[],group:r});var o={key:t.key,value:t.value};"tooltip"in t&&t.tooltip&&(o.tooltip=t.tooltip),n[r].values.push(o)})),Object.values(n).forEach((function(e){e.values.length&&t.push(e)})),t}var q=Object(l["defineComponent"])({props:{modelValue:[Number,String],availableOptions:Array,title:String},directives:{FocusAnywhereButHere:i["FocusAnywhereButHere"],FocusIf:i["FocusIf"]},inheritAttrs:!1,emits:["update:modelValue"],data:function(){return{showSelect:!1,searchTerm:"",showCategory:""}},computed:{modelValueText:function(){if(this.title)return this.title;var e,t=this.modelValue;return(this.availableOptions||[]).some((function(n){return e=n.values.find((function(e){return e.key===t})),e})),e?e.value.toString():t}},methods:{onBlur:function(){this.showSelect=!1},onCategoryClicked:function(e){this.showCategory===e.group?this.showCategory="":this.showCategory=e.group},onValueClicked:function(e){this.$emit("update:modelValue",e.key),this.showSelect=!1}}});q.render=K;var R=q,W=["for","innerHTML"];function G(e,t,n,r,o,i){var a=Object(l["resolveComponent"])("FieldArray");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,W),Object(l["createVNode"])(a,{name:e.name,"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onValueUpdate(t)}),field:e.uiControlAttributes.field},null,8,["name","model-value","field"])])}var Y=Object(l["defineComponent"])({components:{FieldArray:i["FieldArray"]},props:{name:String,title:String,modelValue:null,uiControlAttributes:Object},inheritAttrs:!1,emits:["update:modelValue"],methods:{onValueUpdate:function(e){this.$emit("update:modelValue",e)}}});Y.render=G;var Z=Y,Q={class:"btn"},X=["for","innerHTML"],ee=["name","id"],te={class:"file-path-wrapper"},ne=["value"];function re(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("div",Q,[Object(l["createElementVNode"])("span",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,X),Object(l["createElementVNode"])("input",{ref:"fileInput",name:e.name,type:"file",id:e.name,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},null,40,ee)]),Object(l["createElementVNode"])("div",te,[Object(l["createElementVNode"])("input",{class:"file-path validate",value:e.modelValue,type:"text"},null,8,ne)])])}var oe=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:String},inheritAttrs:!1,emits:["update:modelValue"],setup:function(e){var t=Object(l["ref"])(null);return Object(l["watch"])((function(){return e.modelValue}),(function(e){if(""===e){var n=t.value;n.value=""}})),{fileInput:t}},methods:{onChange:function(e){var t=e.target.files.item(0);this.$emit("update:modelValue",t)}}});oe.render=re;var ie=oe,le=["type","name","value"];function ae(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("input",{type:e.uiControl,name:e.name,value:e.modelValue,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},null,40,le)])}var ue=Object(l["defineComponent"])({props:{modelValue:null,uiControl:String,name:String},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e.target.value)}}});ue.render=ae;var ce=ue,se={class:"fieldMultiTuple"},de=["for","innerHTML"];function me(e,t,n,r,o,i){var a=Object(l["resolveComponent"])("MultiPairField");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",se,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,de),Object(l["createVNode"])(a,{name:e.name,"model-value":e.modelValue,"onUpdate:modelValue":e.onUpdateValue,field1:e.uiControlAttributes.field1,field2:e.uiControlAttributes.field2,field3:e.uiControlAttributes.field3,field4:e.uiControlAttributes.field4},null,8,["name","model-value","onUpdate:modelValue","field1","field2","field3","field4"])])}var fe=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:null,uiControlAttributes:Object},inheritAttrs:!1,components:{MultiPairField:i["MultiPairField"]},emits:["update:modelValue"],methods:{onUpdateValue:function(e){this.$emit("update:modelValue",e)}}});fe.render=me;var pe=fe,be=["type","id","name","value"],he=["for","innerHTML"];function Oe(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,id:e.name,name:e.name,value:(e.modelValue||"").toString(),onKeydown:t[0]||(t[0]=function(t){return e.onChange(t)}),onChange:t[1]||(t[1]=function(t){return e.onChange(t)})},e.uiControlAttributes),null,16,be),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,he)],64)}var ge=Object(l["defineComponent"])({props:{uiControl:String,name:String,title:String,modelValue:[Number,String],uiControlAttributes:Object},inheritAttrs:!1,emits:["update:modelValue"],created:function(){this.onChange=Object(i["debounce"])(this.onChange.bind(this),50)},methods:{onChange:function(e){var t=parseFloat(e.target.value);this.$emit("update:modelValue",t)}},mounted:function(){window.Materialize.updateTextFields()},watch:{modelValue:function(){setTimeout((function(){window.Materialize.updateTextFields()}))}}});ge.render=Oe;var ve=ge,ye=["value","id","name","disabled","checked"];function je(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["withDirectives"])(Object(l["createElementVNode"])("label",{class:"fieldRadioTitle"},Object(l["toDisplayString"])(e.title),513),[[l["vShow"],e.title]]),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions||[],(function(n){return Object(l["openBlock"])(),Object(l["createElementBlock"])("p",{key:n.key,class:"radio"},[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({value:n.key,onChange:t[0]||(t[0]=function(t){return e.onChange(t)}),type:"radio",id:"".concat(e.name).concat(n.key),name:e.name,disabled:n.disabled||e.disabled},e.uiControlAttributes,{checked:e.modelValue===n.key||"".concat(e.modelValue)===n.key}),null,16,ye),Object(l["createElementVNode"])("span",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(n.value)+" ",1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{class:"form-description"},Object(l["toDisplayString"])(n.description),513),[[l["vShow"],n.description]])])])])})),128))])}var we=Object(l["defineComponent"])({props:{title:String,availableOptions:Array,name:String,disabled:Boolean,uiControlAttributes:Object,modelValue:[String,Number]},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e.target.value)}}});we.render=je;var Ve=we;function Se(e,t){return Ee(e)||Fe(e,t)||Ae(e,t)||Ce()}function Ce(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ae(e,t){if(e){if("string"===typeof e)return ke(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ke(e,t):void 0}}function ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Fe(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done);l=!0)if(i.push(r.value),t&&i.length===t)break}catch(u){a=!0,o=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw o}}return i}}function Ee(e){if(Array.isArray(e))return e}var Be={key:0,class:"matomo-field-select"},xe=["multiple","name"],Ne=["label"],Pe=["value","selected"],Te=["for","innerHTML"],$e={key:1,class:"matomo-field-select"},Me=["multiple","name"],De=["value","selected"],Je=["for","innerHTML"];function He(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[e.groupedOptions?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",Be,[Object(l["createElementVNode"])("select",Object(l["mergeProps"])({ref:"select",class:"grouped",multiple:e.multiple,name:e.name,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},e.uiControlAttributes),[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.groupedOptions,(function(t){var n=Se(t,2),r=n[0],o=n[1];return Object(l["openBlock"])(),Object(l["createElementBlock"])("optgroup",{key:r,label:r},[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(o,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("option",{key:t.key,value:"string:".concat(t.key),selected:e.multiple?e.modelValue&&-1!==e.modelValue.indexOf(t.key):e.modelValue===t.key},Object(l["toDisplayString"])(t.value),9,Pe)})),128))],8,Ne)})),128))],16,xe),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.title},null,8,Te)])):Object(l["createCommentVNode"])("",!0),!e.groupedOptions&&e.options?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",$e,[Object(l["createElementVNode"])("select",Object(l["mergeProps"])({class:"ungrouped",ref:"select",multiple:e.multiple,name:e.name,onChange:t[1]||(t[1]=function(t){return e.onChange(t)})},e.uiControlAttributes),[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.options,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("option",{key:t.key,value:"string:".concat(t.key),selected:e.multiple?e.modelValue&&-1!==e.modelValue.indexOf(t.key):e.modelValue===t.key},Object(l["toDisplayString"])(t.value),9,De)})),128))],16,Me),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.title},null,8,Je)])):Object(l["createCommentVNode"])("",!0)],64)}function Le(e){return Ue(e)||ze(e)||qe(e)||Ie()}function Ie(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ze(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Ue(e){if(Array.isArray(e))return Re(e)}function Ke(e,t){return Ge(e)||We(e,t)||qe(e,t)||_e()}function _e(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function qe(e,t){if(e){if("string"===typeof e)return Re(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Re(e,t):void 0}}function Re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function We(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done);l=!0)if(i.push(r.value),t&&i.length===t)break}catch(u){a=!0,o=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw o}}return i}}function Ge(e){if(Array.isArray(e))return e}function Ye(e){return Ye="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ye(e)}function Ze(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4?arguments[4]:void 0;if(e){var i=window.$(e);if(Array.from(e.options).forEach((function(e){e.selected=o?t&&-1!==t.indexOf(e.value.replace(/^string:/,"")):"string:".concat(t)===e.value})),i.formSelect(r),n){var l=i.closest(".select-wrapper").find("input");l.attr("placeholder",n)}}}function Qe(e){return!Array.isArray(e)&&"object"===Ye(e)&&Object.values(e).some((function(e){return"object"===Ye(e)}))}function Xe(e,t){return e.some((function(e){return e.key===t}))}function et(e,t,n){if(!e)return[];var r=!0,o=e;Qe(o)||(o={"":e},r=!1);var i=[];return Object.entries(o).forEach((function(e){var n=Ke(e,2),o=n[0],l=n[1];Object.entries(l).forEach((function(e){var n=Ke(e,2),l=n[0],a=n[1];if("object"!==Ye(a)||"undefined"===typeof a.key){var u=l;"integer"===t&&"string"===typeof l&&(u=parseInt(l,10)),i.push({group:r?o:void 0,key:u,value:a})}else i.push(a)}))})),n.placeholder&&!Xe(i,"")?[{key:"",value:""}].concat(i):i}function tt(e){return"string"===typeof e?e.replace(/^string:/,""):e}var nt=Object(l["defineComponent"])({props:{modelValue:null,multiple:Boolean,name:String,title:String,availableOptions:Array,uiControlAttributes:Object,uiControlOptions:Object},inheritAttrs:!1,emits:["update:modelValue"],computed:{options:function(){return!this.availableOptions||Xe(this.availableOptions,"")||"undefined"!==typeof this.modelValue&&null!==this.modelValue&&""!==this.modelValue?this.availableOptions:[{key:"",value:this.modelValue,group:this.hasGroups?"":void 0}].concat(Le(this.availableOptions))},hasGroups:function(){var e=this.availableOptions;return e&&e[0]&&"undefined"!==typeof e[0].group},groupedOptions:function(){if(!this.hasGroups)return null;var e=this.options,t={};e.forEach((function(e){t[e.group]=t[e.group]||[],t[e.group].push(e)}));var n=Object.entries(t);return n.sort((function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0})),n}},methods:{onChange:function(e){var t,n=e.target;this.multiple?(t=Array.from(n.options).filter((function(e){return e.selected})).map((function(e){return e.value})),t=t.map(tt)):(t=n.value,t=tt(t)),this.$emit("update:modelValue",t)}},watch:{modelValue:function(e){var t=this;window.$(this.$refs.select).val(e),setTimeout((function(){Ze(t.$refs.select,e,t.uiControlAttributes.placeholder,t.uiControlOptions,t.multiple)}))},"uiControlAttributes.disabled":{handler:function(e,t){var n=this;setTimeout((function(){e!==t&&Ze(n.$refs.select,n.modelValue,n.uiControlAttributes.placeholder,n.uiControlOptions,n.multiple)}))}},availableOptions:function(e,t){var n=this;e!==t&&setTimeout((function(){Ze(n.$refs.select,n.modelValue,n.uiControlAttributes.placeholder,n.uiControlOptions,n.multiple)}))}},mounted:function(){var e=this;setTimeout((function(){Ze(e.$refs.select,e.modelValue,e.uiControlAttributes.placeholder,e.uiControlOptions,e.multiple)}))}});nt.render=He;var rt=nt,ot=["for","innerHTML"],it={class:"sites_autocomplete"};function lt(e,t,n,r,o,i){var a=Object(l["resolveComponent"])("SiteSelector");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,class:"siteSelectorLabel",innerHTML:e.$sanitize(e.title)},null,8,ot),Object(l["createElementVNode"])("div",it,[Object(l["createVNode"])(a,Object(l["mergeProps"])({"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)}),id:e.name,"show-all-sites-item":e.uiControlAttributes.showAllSitesItem||!1,"switch-site-on-select":!1,"show-selected-site":!0,"only-sites-with-admin-access":e.uiControlAttributes.onlySitesWithAdminAccess||!1},e.uiControlAttributes),null,16,["model-value","id","show-all-sites-item","only-sites-with-admin-access"])])])}var at=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:Object,uiControlAttributes:Object},inheritAttrs:!1,components:{SiteSelector:i["SiteSelector"]},emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});at.render=lt;var ut=at,ct=["type","id","name","value"],st=["for","innerHTML"];function dt(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,id:e.name,name:e.name,value:e.modelValueText,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)})},e.uiControlAttributes),null,16,ct),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,st)],64)}var mt=Object(l["defineComponent"])({props:{title:String,name:String,uiControlAttributes:Object,modelValue:[String,Number],uiControl:String},inheritAttrs:!1,emits:["update:modelValue"],computed:{modelValueText:function(){return"undefined"===typeof this.modelValue||null===this.modelValue?"":this.modelValue.toString()}},created:function(){this.onKeydown=Object(i["debounce"])(this.onKeydown.bind(this),50)},mounted:function(){setTimeout((function(){window.Materialize.updateTextFields()}))},watch:{modelValue:function(){setTimeout((function(){window.Materialize.updateTextFields()}))}},methods:{onKeydown:function(e){this.$emit("update:modelValue",e.target.value)}}});mt.render=dt;var ft=mt,pt=["for","innerHTML"],bt=["type","name","value"];function ht(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,pt),Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,name:e.name,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),value:e.concattedValues},e.uiControlAttributes),null,16,bt)])}var Ot=Object(l["defineComponent"])({props:{name:String,title:String,uiControl:String,modelValue:Array,uiControlAttributes:Object},inheritAttrs:!1,computed:{concattedValues:function(){return"string"===typeof this.modelValue?this.modelValue:(this.modelValue||[]).join(", ")}},emits:["update:modelValue"],created:function(){this.onKeydown=Object(i["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=e.target.value.split(",").map((function(e){return e.trim()}));this.$emit("update:modelValue",t)}}});Ot.render=ht;var gt=Ot,vt=["name","id","value"],yt=["for","innerHTML"];function jt(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("textarea",Object(l["mergeProps"])({name:e.name},e.uiControlAttributes,{id:e.name,value:e.modelValue,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),class:"materialize-textarea",ref:"textarea"}),null,16,vt),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,yt)],64)}var wt=Object(l["defineComponent"])({props:{name:String,uiControlAttributes:Object,modelValue:String,title:String},inheritAttrs:!1,emits:["update:modelValue"],created:function(){this.onKeydown=Object(i["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){this.$emit("update:modelValue",e.target.value)}},watch:{modelValue:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}},mounted:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}});wt.render=jt;var Vt=wt,St=["for","innerHTML"],Ct=["name","value"];function At(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,St),Object(l["createElementVNode"])("textarea",Object(l["mergeProps"])({ref:"textarea",name:e.name},e.uiControlAttributes,{value:e.concattedValue,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),class:"materialize-textarea"}),null,16,Ct)])}var kt="\n",Ft=Object(l["defineComponent"])({props:{name:String,title:String,uiControlAttributes:Object,modelValue:[Array,String]},inheritAttrs:!1,emits:["update:modelValue"],computed:{concattedValue:function(){return"string"===typeof this.modelValue?this.modelValue:(this.modelValue||[]).join(kt)}},created:function(){this.onKeydown=Object(i["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=e.target.value.split(kt);this.$emit("update:modelValue",t)}},watch:{modelValue:function(e,t){var n=this;e!==t&&setTimeout((function(){window.Materialize.textareaAutoResize(n.$refs.textarea),window.Materialize.updateTextFields()}))}},mounted:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}});Ft.render=At;var Et=Ft;function Bt(e){return Bt="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bt(e)}function xt(e,t){return Mt(e)||$t(e,t)||Pt(e,t)||Nt()}function Nt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Pt(e,t){if(e){if("string"===typeof e)return Tt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tt(e,t):void 0}}function Tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $t(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done);l=!0)if(i.push(r.value),t&&i.length===t)break}catch(u){a=!0,o=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw o}}return i}}function Mt(e){if(Array.isArray(e))return e} +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue")):"function"===typeof define&&define.amd?define(["CoreHome"],t):"object"===typeof exports?exports["CorePluginsAdmin"]=t(require("CoreHome"),require("vue")):e["CorePluginsAdmin"]=t(e["CoreHome"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/CorePluginsAdmin/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"FormField",(function(){return Kt})),n.d(t,"Field",(function(){return dn})),n.d(t,"PluginSettings",(function(){return Wn})),n.d(t,"PluginFilter",(function(){return gr})),n.d(t,"PluginManagement",(function(){return Xn})),n.d(t,"PluginUpload",(function(){return ir})),n.d(t,"SaveButton",(function(){return Vr})),n.d(t,"Form",(function(){return kr})),"undefined"!==typeof window){var r=window.document.currentScript,o=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(n.p=o[1])}var i=n("19dc"),l=n("8bbf");function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s={class:"form-group row matomo-form-field"},d={key:0,class:"col s12"},m={key:0,class:"form-help"},f={key:0,class:"inline-help",ref:"inlineHelp"},p=Object(l["createElementVNode"])("br",null,null,-1);function b(e,t,n,r,o,i){return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("div",s,[e.formField.introduction?(Object(l["openBlock"])(),Object(l["createElementBlock"])("h3",d,Object(l["toDisplayString"])(e.formField.introduction),1)):Object(l["createCommentVNode"])("",!0),Object(l["createElementVNode"])("div",{class:Object(l["normalizeClass"])(["col s12",{"input-field":"checkbox"!==e.formField.uiControl&&"radio"!==e.formField.uiControl,"file-field":"file"===e.formField.uiControl,m6:!e.formField.fullWidth}])},[(Object(l["openBlock"])(),Object(l["createBlock"])(Object(l["resolveDynamicComponent"])(e.childComponent),Object(l["mergeProps"])(u(u({formField:e.formField},e.formField),{},{modelValue:e.processedModelValue,availableOptions:e.availableOptions},e.extraChildComponentParams),{"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)})}),null,16))],2),Object(l["createElementVNode"])("div",{class:Object(l["normalizeClass"])(["col s12",{m6:!e.formField.fullWidth}])},[e.showFormHelp?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",m,[Object(l["withDirectives"])(Object(l["createElementVNode"])("div",{class:"form-description"},Object(l["toDisplayString"])(e.formField.description),513),[[l["vShow"],e.formField.description]]),e.formField.inlineHelp?(Object(l["openBlock"])(),Object(l["createElementBlock"])("span",f,null,512)):Object(l["createCommentVNode"])("",!0),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",null,[p,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("General_Default"))+": ",1),Object(l["createElementVNode"])("span",null,Object(l["toDisplayString"])(e.defaultValuePrettyTruncated),1)],512),[[l["vShow"],e.showDefaultValue]])])):Object(l["createCommentVNode"])("",!0)],2)],512)),[[l["vShow"],e.showField]])}var v={class:"checkbox"},g=["checked","id","name"],h=["innerHTML"];function O(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",v,[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},e.uiControlAttributes,{value:1,checked:!!e.modelValue,type:"checkbox",id:e.name,name:e.name}),null,16,g),Object(l["createElementVNode"])("span",{innerHTML:e.$sanitize(e.title)},null,8,h)])])}var y=Object(l["defineComponent"])({props:{modelValue:Boolean,uiControlAttributes:Object,name:String,title:String},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){this.modelValue!==e.target.checked&&this.$emit("update:modelValue",e.target.checked)}}});y.render=O;var j=y,w=["value","checked","onChange","id","name"];function V(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["withDirectives"])(Object(l["createElementVNode"])("label",{class:"fieldRadioTitle"},Object(l["toDisplayString"])(e.title),513),[[l["vShow"],e.title]]),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions,(function(t,n){return Object(l["openBlock"])(),Object(l["createElementBlock"])("p",{key:n,class:"checkbox"},[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({value:t.key,checked:!!e.checkboxStates[n],onChange:function(t){return e.onChange(n)}},e.uiControlAttributes,{type:"checkbox",id:"".concat(e.name).concat(t.key),name:t.name}),null,16,w),Object(l["createElementVNode"])("span",null,Object(l["toDisplayString"])(t.value),1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{class:"form-description"},Object(l["toDisplayString"])(t.description),513),[[l["vShow"],t.description]])])])})),128))])}function C(e){return F(e)||A(e)||k(e)||S()}function S(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(e,t){if(e){if("string"===typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 0}}function A(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function F(e){if(Array.isArray(e))return E(e)}function E(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function B(e,t){return(e||[]).map((function(e){return t&&-1!==t.indexOf(e.key)}))}var x=Object(l["defineComponent"])({props:{modelValue:Object,name:String,title:String,availableOptions:Array,uiControlAttributes:Object,type:String},inheritAttrs:!1,emits:["update:modelValue"],computed:{checkboxStates:function(){return B(this.availableOptions,this.modelValue)}},mounted:function(){window.Materialize.updateTextFields()},methods:{onChange:function(e){var t=C(this.checkboxStates);t[e]=!t[e];var n=[];Object.values(this.availableOptions).forEach((function(e,r){t[r]&&n.push(e.key)})),this.$emit("update:modelValue",n)}}});x.render=V;var P=x,N={class:"expandableSelector"},T=Object(l["createElementVNode"])("svg",{class:"caret",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},[Object(l["createElementVNode"])("path",{d:"M7 10l5 5 5-5z"}),Object(l["createElementVNode"])("path",{d:"M0 0h24v24H0z",fill:"none"})],-1),$=["value"],M={class:"expandableList z-depth-2"},D={class:"searchContainer"},J={class:"collection firstLevel"},H=["onClick"],I={class:"collection secondLevel"},L=["onClick"],z={class:"primary-content"},U=["title"];function K(e,t,n,r,o,i){var a=Object(l["resolveDirective"])("focus-if"),u=Object(l["resolveDirective"])("focus-anywhere-but-here");return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("div",N,[Object(l["createElementVNode"])("div",{onClick:t[0]||(t[0]=function(t){return e.showSelect=!e.showSelect}),class:"select-wrapper"},[T,Object(l["createElementVNode"])("input",{type:"text",class:"select-dropdown",readonly:"readonly",value:e.modelValueText},null,8,$)]),Object(l["withDirectives"])(Object(l["createElementVNode"])("div",M,[Object(l["createElementVNode"])("div",D,[Object(l["withDirectives"])(Object(l["createElementVNode"])("input",{type:"text",placeholder:"Search","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.searchTerm=t}),class:"expandableSearch browser-default"},null,512),[[l["vModelText"],e.searchTerm],[a,e.showSelect]])]),Object(l["createElementVNode"])("ul",J,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions,(function(t,n){return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("li",{class:"collection-item",key:n},[Object(l["createElementVNode"])("h4",{class:"expandableListCategory",onClick:function(n){return e.onCategoryClicked(t)}},[Object(l["createTextVNode"])(Object(l["toDisplayString"])(t.group)+" ",1),Object(l["createElementVNode"])("span",{class:Object(l["normalizeClass"])(["secondary-content",{"icon-arrow-right":e.showCategory!==t.group,"icon-arrow-bottom":e.showCategory===t.group}])},null,2)],8,H),Object(l["withDirectives"])(Object(l["createElementVNode"])("ul",I,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(t.values.filter((function(t){return-1!==t.value.indexOf(e.searchTerm)})),(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("li",{class:"expandableListItem collection-item valign-wrapper",key:t.key,onClick:function(n){return e.onValueClicked(t)}},[Object(l["createElementVNode"])("span",z,Object(l["toDisplayString"])(t.value),1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{title:t.tooltip,class:"secondary-content icon-help"},null,8,U),[[l["vShow"],t.tooltip]])],8,L)})),128))],512),[[l["vShow"],e.showCategory===t.group||e.searchTerm]])],512)),[[l["vShow"],t.values.filter((function(t){return-1!==t.value.indexOf(e.searchTerm)})).length]])})),128))])],512),[[l["vShow"],e.showSelect]])],512)),[[u,{blur:e.onBlur}]])}function _(e){var t=[],n={};return Object.values(e).forEach((function(e){var t=e,r=t.group||"";r in n&&n[r]||(n[r]={values:[],group:r});var o={key:t.key,value:t.value};"tooltip"in t&&t.tooltip&&(o.tooltip=t.tooltip),n[r].values.push(o)})),Object.values(n).forEach((function(e){e.values.length&&t.push(e)})),t}var q=Object(l["defineComponent"])({props:{modelValue:[Number,String],availableOptions:Array,title:String},directives:{FocusAnywhereButHere:i["FocusAnywhereButHere"],FocusIf:i["FocusIf"]},inheritAttrs:!1,emits:["update:modelValue"],data:function(){return{showSelect:!1,searchTerm:"",showCategory:""}},computed:{modelValueText:function(){if(this.title)return this.title;var e,t=this.modelValue;return(this.availableOptions||[]).some((function(n){return e=n.values.find((function(e){return e.key===t})),e})),e?e.value.toString():t}},methods:{onBlur:function(){this.showSelect=!1},onCategoryClicked:function(e){this.showCategory===e.group?this.showCategory="":this.showCategory=e.group},onValueClicked:function(e){this.$emit("update:modelValue",e.key),this.showSelect=!1}}});q.render=K;var R=q,W=["for","innerHTML"];function G(e,t,n,r,o,i){var a=Object(l["resolveComponent"])("FieldArray");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,W),Object(l["createVNode"])(a,{name:e.name,"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onValueUpdate(t)}),field:e.uiControlAttributes.field},null,8,["name","model-value","field"])])}var Z=Object(l["defineComponent"])({components:{FieldArray:i["FieldArray"]},props:{name:String,title:String,modelValue:null,uiControlAttributes:Object},inheritAttrs:!1,emits:["update:modelValue"],methods:{onValueUpdate:function(e){this.$emit("update:modelValue",e)}}});Z.render=G;var Y=Z,Q={class:"btn"},X=["for","innerHTML"],ee=["name","id"],te={class:"file-path-wrapper"},ne=["value"];function re(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("div",Q,[Object(l["createElementVNode"])("span",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,X),Object(l["createElementVNode"])("input",{ref:"fileInput",name:e.name,type:"file",id:e.name,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},null,40,ee)]),Object(l["createElementVNode"])("div",te,[Object(l["createElementVNode"])("input",{class:"file-path validate",value:e.modelValue,type:"text"},null,8,ne)])])}var oe=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:String},inheritAttrs:!1,emits:["update:modelValue"],setup:function(e){var t=Object(l["ref"])(null);return Object(l["watch"])((function(){return e.modelValue}),(function(e){if(""===e){var n=t.value;n.value=""}})),{fileInput:t}},methods:{onChange:function(e){var t=e.target.files.item(0);this.$emit("update:modelValue",t)}}});oe.render=re;var ie=oe,le=["type","name","value"];function ae(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("input",{type:e.uiControl,name:e.name,value:e.modelValue,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},null,40,le)])}var ue=Object(l["defineComponent"])({props:{modelValue:null,uiControl:String,name:String},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e.target.value)}}});ue.render=ae;var ce=ue,se={class:"fieldMultiTuple"},de=["for","innerHTML"];function me(e,t,n,r,o,i){var a=Object(l["resolveComponent"])("MultiPairField");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",se,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,de),Object(l["createVNode"])(a,{name:e.name,"model-value":e.modelValue,"onUpdate:modelValue":e.onUpdateValue,field1:e.uiControlAttributes.field1,field2:e.uiControlAttributes.field2,field3:e.uiControlAttributes.field3,field4:e.uiControlAttributes.field4},null,8,["name","model-value","onUpdate:modelValue","field1","field2","field3","field4"])])}var fe=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:null,uiControlAttributes:Object},inheritAttrs:!1,components:{MultiPairField:i["MultiPairField"]},emits:["update:modelValue"],methods:{onUpdateValue:function(e){this.$emit("update:modelValue",e)}}});fe.render=me;var pe=fe,be=["type","id","name","value"],ve=["for","innerHTML"];function ge(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,id:e.name,name:e.name,value:(e.modelValue||"").toString(),onKeydown:t[0]||(t[0]=function(t){return e.onChange(t)}),onChange:t[1]||(t[1]=function(t){return e.onChange(t)})},e.uiControlAttributes),null,16,be),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,ve)],64)}var he=Object(l["defineComponent"])({props:{uiControl:String,name:String,title:String,modelValue:[Number,String],uiControlAttributes:Object},inheritAttrs:!1,emits:["update:modelValue"],created:function(){this.onChange=Object(i["debounce"])(this.onChange.bind(this),50)},methods:{onChange:function(e){var t=parseFloat(e.target.value);this.$emit("update:modelValue",t)}},mounted:function(){window.Materialize.updateTextFields()},watch:{modelValue:function(){setTimeout((function(){window.Materialize.updateTextFields()}))}}});he.render=ge;var Oe=he,ye=["value","id","name","disabled","checked"];function je(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["withDirectives"])(Object(l["createElementVNode"])("label",{class:"fieldRadioTitle"},Object(l["toDisplayString"])(e.title),513),[[l["vShow"],e.title]]),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions||[],(function(n){return Object(l["openBlock"])(),Object(l["createElementBlock"])("p",{key:n.key,class:"radio"},[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({value:n.key,onChange:t[0]||(t[0]=function(t){return e.onChange(t)}),type:"radio",id:"".concat(e.name).concat(n.key),name:e.name,disabled:n.disabled||e.disabled},e.uiControlAttributes,{checked:e.modelValue===n.key||"".concat(e.modelValue)===n.key}),null,16,ye),Object(l["createElementVNode"])("span",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(n.value)+" ",1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{class:"form-description"},Object(l["toDisplayString"])(n.description),513),[[l["vShow"],n.description]])])])])})),128))])}var we=Object(l["defineComponent"])({props:{title:String,availableOptions:Array,name:String,disabled:Boolean,uiControlAttributes:Object,modelValue:[String,Number]},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e.target.value)}}});we.render=je;var Ve=we;function Ce(e,t){return Ee(e)||Fe(e,t)||ke(e,t)||Se()}function Se(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ke(e,t){if(e){if("string"===typeof e)return Ae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ae(e,t):void 0}}function Ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Fe(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done);l=!0)if(i.push(r.value),t&&i.length===t)break}catch(u){a=!0,o=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw o}}return i}}function Ee(e){if(Array.isArray(e))return e}var Be={key:0,class:"matomo-field-select"},xe=["multiple","name"],Pe=["label"],Ne=["value","selected"],Te=["for","innerHTML"],$e={key:1,class:"matomo-field-select"},Me=["multiple","name"],De=["value","selected"],Je=["for","innerHTML"];function He(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[e.groupedOptions?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",Be,[Object(l["createElementVNode"])("select",Object(l["mergeProps"])({ref:"select",class:"grouped",multiple:e.multiple,name:e.name,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},e.uiControlAttributes),[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.groupedOptions,(function(t){var n=Ce(t,2),r=n[0],o=n[1];return Object(l["openBlock"])(),Object(l["createElementBlock"])("optgroup",{key:r,label:r},[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(o,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("option",{key:t.key,value:"string:".concat(t.key),selected:e.multiple?e.modelValue&&-1!==e.modelValue.indexOf(t.key):e.modelValue===t.key},Object(l["toDisplayString"])(t.value),9,Ne)})),128))],8,Pe)})),128))],16,xe),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.title},null,8,Te)])):Object(l["createCommentVNode"])("",!0),!e.groupedOptions&&e.options?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",$e,[Object(l["createElementVNode"])("select",Object(l["mergeProps"])({class:"ungrouped",ref:"select",multiple:e.multiple,name:e.name,onChange:t[1]||(t[1]=function(t){return e.onChange(t)})},e.uiControlAttributes),[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.options,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("option",{key:t.key,value:"string:".concat(t.key),selected:e.multiple?e.modelValue&&-1!==e.modelValue.indexOf(t.key):e.modelValue===t.key},Object(l["toDisplayString"])(t.value),9,De)})),128))],16,Me),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.title},null,8,Je)])):Object(l["createCommentVNode"])("",!0)],64)}function Ie(e){return Ue(e)||ze(e)||qe(e)||Le()}function Le(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ze(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Ue(e){if(Array.isArray(e))return Re(e)}function Ke(e,t){return Ge(e)||We(e,t)||qe(e,t)||_e()}function _e(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function qe(e,t){if(e){if("string"===typeof e)return Re(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Re(e,t):void 0}}function Re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function We(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done);l=!0)if(i.push(r.value),t&&i.length===t)break}catch(u){a=!0,o=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw o}}return i}}function Ge(e){if(Array.isArray(e))return e}function Ze(e){return Ze="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ze(e)}function Ye(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4?arguments[4]:void 0;if(e){var i=window.$(e);if(Array.from(e.options).forEach((function(e){e.selected=o?t&&-1!==t.indexOf(e.value.replace(/^string:/,"")):"string:".concat(t)===e.value})),i.formSelect(r),n){var l=i.closest(".select-wrapper").find("input");l.attr("placeholder",n)}}}function Qe(e){return!Array.isArray(e)&&"object"===Ze(e)&&Object.values(e).some((function(e){return"object"===Ze(e)}))}function Xe(e,t){return e.some((function(e){return e.key===t}))}function et(e,t,n){if(!e)return[];var r=!0,o=e;Qe(o)||(o={"":e},r=!1);var i=[];return Object.entries(o).forEach((function(e){var n=Ke(e,2),o=n[0],l=n[1];Object.entries(l).forEach((function(e){var n=Ke(e,2),l=n[0],a=n[1];if("object"!==Ze(a)||"undefined"===typeof a.key){var u=l;"integer"===t&&"string"===typeof l&&(u=parseInt(l,10)),i.push({group:r?o:void 0,key:u,value:a})}else i.push(a)}))})),n.placeholder&&!Xe(i,"")?[{key:"",value:""}].concat(i):i}function tt(e){return"string"===typeof e?e.replace(/^string:/,""):e}var nt=Object(l["defineComponent"])({props:{modelValue:null,multiple:Boolean,name:String,title:String,availableOptions:Array,uiControlAttributes:Object,uiControlOptions:Object},inheritAttrs:!1,emits:["update:modelValue"],computed:{options:function(){return!this.availableOptions||Xe(this.availableOptions,"")||"undefined"!==typeof this.modelValue&&null!==this.modelValue&&""!==this.modelValue?this.availableOptions:[{key:"",value:this.modelValue,group:this.hasGroups?"":void 0}].concat(Ie(this.availableOptions))},hasGroups:function(){var e=this.availableOptions;return e&&e[0]&&"undefined"!==typeof e[0].group},groupedOptions:function(){if(!this.hasGroups)return null;var e=this.options,t={};e.forEach((function(e){t[e.group]=t[e.group]||[],t[e.group].push(e)}));var n=Object.entries(t);return n.sort((function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0})),n}},methods:{onChange:function(e){var t,n=e.target;this.multiple?(t=Array.from(n.options).filter((function(e){return e.selected})).map((function(e){return e.value})),t=t.map(tt)):(t=n.value,t=tt(t)),this.$emit("update:modelValue",t)}},watch:{modelValue:function(e){var t=this;window.$(this.$refs.select).val(e),setTimeout((function(){Ye(t.$refs.select,e,t.uiControlAttributes.placeholder,t.uiControlOptions,t.multiple)}))},"uiControlAttributes.disabled":{handler:function(e,t){var n=this;setTimeout((function(){e!==t&&Ye(n.$refs.select,n.modelValue,n.uiControlAttributes.placeholder,n.uiControlOptions,n.multiple)}))}},availableOptions:function(e,t){var n=this;e!==t&&setTimeout((function(){Ye(n.$refs.select,n.modelValue,n.uiControlAttributes.placeholder,n.uiControlOptions,n.multiple)}))}},mounted:function(){var e=this;setTimeout((function(){Ye(e.$refs.select,e.modelValue,e.uiControlAttributes.placeholder,e.uiControlOptions,e.multiple)}))}});nt.render=He;var rt=nt,ot=["for","innerHTML"],it={class:"sites_autocomplete"};function lt(e,t,n,r,o,i){var a=Object(l["resolveComponent"])("SiteSelector");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,class:"siteSelectorLabel",innerHTML:e.$sanitize(e.title)},null,8,ot),Object(l["createElementVNode"])("div",it,[Object(l["createVNode"])(a,Object(l["mergeProps"])({"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)}),id:e.name,"show-all-sites-item":e.uiControlAttributes.showAllSitesItem||!1,"switch-site-on-select":!1,"show-selected-site":!0,"only-sites-with-admin-access":e.uiControlAttributes.onlySitesWithAdminAccess||!1},e.uiControlAttributes),null,16,["model-value","id","show-all-sites-item","only-sites-with-admin-access"])])])}var at=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:Object,uiControlAttributes:Object},inheritAttrs:!1,components:{SiteSelector:i["SiteSelector"]},emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});at.render=lt;var ut=at,ct=["type","id","name","value"],st=["for","innerHTML"];function dt(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,id:e.name,name:e.name,value:e.modelValueText,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)})},e.uiControlAttributes),null,16,ct),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,st)],64)}var mt=Object(l["defineComponent"])({props:{title:String,name:String,uiControlAttributes:Object,modelValue:[String,Number],uiControl:String},inheritAttrs:!1,emits:["update:modelValue"],computed:{modelValueText:function(){return"undefined"===typeof this.modelValue||null===this.modelValue?"":this.modelValue.toString()}},created:function(){this.onKeydown=Object(i["debounce"])(this.onKeydown.bind(this),50)},mounted:function(){setTimeout((function(){window.Materialize.updateTextFields()}))},watch:{modelValue:function(){setTimeout((function(){window.Materialize.updateTextFields()}))}},methods:{onKeydown:function(e){this.$emit("update:modelValue",e.target.value)}}});mt.render=dt;var ft=mt,pt=["for","innerHTML"],bt=["type","name","value"];function vt(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,pt),Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,name:e.name,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),value:e.concattedValues},e.uiControlAttributes),null,16,bt)])}var gt=Object(l["defineComponent"])({props:{name:String,title:String,uiControl:String,modelValue:Array,uiControlAttributes:Object},inheritAttrs:!1,computed:{concattedValues:function(){return"string"===typeof this.modelValue?this.modelValue:(this.modelValue||[]).join(", ")}},emits:["update:modelValue"],created:function(){this.onKeydown=Object(i["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=e.target.value.split(",").map((function(e){return e.trim()}));this.$emit("update:modelValue",t)}}});gt.render=vt;var ht=gt,Ot=["name","id","value"],yt=["for","innerHTML"];function jt(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("textarea",Object(l["mergeProps"])({name:e.name},e.uiControlAttributes,{id:e.name,value:e.modelValue,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),class:"materialize-textarea",ref:"textarea"}),null,16,Ot),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,yt)],64)}var wt=Object(l["defineComponent"])({props:{name:String,uiControlAttributes:Object,modelValue:String,title:String},inheritAttrs:!1,emits:["update:modelValue"],created:function(){this.onKeydown=Object(i["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){this.$emit("update:modelValue",e.target.value)}},watch:{modelValue:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}},mounted:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}});wt.render=jt;var Vt=wt,Ct=["for","innerHTML"],St=["name","value"];function kt(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Ct),Object(l["createElementVNode"])("textarea",Object(l["mergeProps"])({ref:"textarea",name:e.name},e.uiControlAttributes,{value:e.concattedValue,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),class:"materialize-textarea"}),null,16,St)])}var At="\n",Ft=Object(l["defineComponent"])({props:{name:String,title:String,uiControlAttributes:Object,modelValue:[Array,String]},inheritAttrs:!1,emits:["update:modelValue"],computed:{concattedValue:function(){return"string"===typeof this.modelValue?this.modelValue:(this.modelValue||[]).join(At)}},created:function(){this.onKeydown=Object(i["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=e.target.value.split(At);this.$emit("update:modelValue",t)}},watch:{modelValue:function(e,t){var n=this;e!==t&&setTimeout((function(){window.Materialize.textareaAutoResize(n.$refs.textarea),window.Materialize.updateTextFields()}))}},mounted:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}});Ft.render=kt;var Et=Ft;function Bt(e){return Bt="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bt(e)}function xt(e,t){return Mt(e)||$t(e,t)||Nt(e,t)||Pt()}function Pt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Nt(e,t){if(e){if("string"===typeof e)return Tt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tt(e,t):void 0}}function Tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $t(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done);l=!0)if(i.push(r.value),t&&i.length===t)break}catch(u){a=!0,o=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw o}}return i}}function Mt(e){if(Array.isArray(e))return e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Dt(e,t){if(!e)return[];var n=[];return Object.entries(e).forEach((function(e){var r=xt(e,2),o=r[0],i=r[1];if("object"!==Bt(i)||"undefined"===typeof i.key){var l=o;"integer"===t&&"string"===typeof o&&(l=parseInt(l,10)),n.push({key:l,value:i})}else n.push(i)})),n}function Jt(e){return Jt="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jt(e)}var Ht=["password","url","search","email"],Lt=["textarea","checkbox","text"],It={checkbox:"FieldCheckbox","expandable-select":"FieldExpandableSelect","field-array":"FieldFieldArray",file:"FieldFile",hidden:"FieldHidden",multiselect:"FieldSelect",multituple:"FieldMultituple",number:"FieldNumber",radio:"FieldRadio",select:"FieldSelect",site:"FieldSite",text:"FieldText",textarea:"FieldTextarea"},zt={FieldSelect:et,FieldCheckboxArray:Dt,FieldRadio:Dt,FieldExpandableSelect:_},Ut=Object(l["defineComponent"])({props:{modelValue:null,formField:{type:Object,required:!0},allSettings:[Object,Array]},emits:["update:modelValue"],components:{FieldCheckbox:j,FieldCheckboxArray:N,FieldExpandableSelect:R,FieldFieldArray:Z,FieldFile:ie,FieldHidden:ce,FieldMultituple:pe,FieldNumber:ve,FieldRadio:Ve,FieldSelect:rt,FieldSite:ut,FieldText:ft,FieldTextArray:gt,FieldTextarea:Vt,FieldTextareaArray:Et},setup:function(e){var t=Object(l["ref"])(null),n=function(e){var n;e&&(n="string"===typeof e&&e&&0===e.indexOf("#")?window.$(e):window.vueSanitize(e),window.$(t.value).html("").append(n))};return Object(l["watch"])((function(){return e.formField.inlineHelp}),n),Object(l["onMounted"])((function(){n(e.formField.inlineHelp)})),{inlineHelp:t}},computed:{childComponent:function(){if(this.formField.component)return this.formField.component;var e=this.formField.uiControl,t=It[e];return-1!==Ht.indexOf(e)&&(t="FieldText"),"array"===this.formField.type&&-1!==Lt.indexOf(e)&&(t="".concat(t,"Array")),t},extraChildComponentParams:function(){return"multiselect"===this.formField.uiControl?{multiple:!0}:{}},showFormHelp:function(){return this.formField.description||this.formField.inlineHelp||this.showDefaultValue},showDefaultValue:function(){return this.defaultValuePretty&&"checkbox"!==this.formField.uiControl&&"radio"!==this.formField.uiControl},showField:function(){if(!this.formField||!this.formField.condition)return!0;var e={};return Object.values(this.allSettings||{}).forEach((function(t){"0"===t.value?e[t.name]=0:e[t.name]=t.value})),this.formField.condition(e)},processedModelValue:function(){var e=this.formField;if("boolean"===e.type){var t=this.modelValue&&this.modelValue>0&&"0"!==this.modelValue;if("checkbox"===e.uiControl)return t;if("radio"===e.uiControl)return t?"1":"0"}return this.modelValue},defaultValue:function(){var e=this.formField.defaultValue;return Array.isArray(e)&&(e=e.join(",")),e},availableOptions:function(){var e=this.childComponent,t=this.formField;return t.availableValues&&zt[e]?zt[e](t.availableValues,t.type,t.uiControlAttributes):null},defaultValuePretty:function(){var e=this.formField.defaultValue,t=this.availableOptions;if("string"===typeof e&&e){var n=null;try{n=JSON.parse(e)}catch(o){}if(null!==n&&"object"===Jt(n))return""}if(!Array.isArray(t))return Array.isArray(e)?"":e?e.toString():"";var r=[];return Array.isArray(e)||(e=[e]),(t||[]).forEach((function(t){-1!==e.indexOf(t.key)&&"undefined"!==typeof t.value&&r.push(t.value)})),r.join(", ")},defaultValuePrettyTruncated:function(){return this.defaultValuePretty.substring(0,50)}},methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});Ut.render=b;var Kt=Ut,_t={ref:"root"};function qt(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",_t,null,512)}function Rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rt(Object(n),!0).forEach((function(t){Gt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yt(e){if("undefined"!==typeof e)return JSON.parse(JSON.stringify(e))}var Zt=Object(l["defineComponent"])({props:{modelValue:null,formField:null,templateFile:String},emits:["update:modelValue"],inheritAttrs:!1,setup:function(e,t){var n=Object(l["ref"])(null),r=window.$("<div ng-include=\"'".concat(e.templateFile,"?cb=").concat(i["Matomo"].cacheBuster,"'\"></div>")),o=i["Matomo"].helper.getAngularDependency("$timeout"),a=i["Matomo"].helper.getAngularDependency("$rootScope"),u=a.$new();return u.formField=Wt(Wt({},Yt(e.formField)),{},{value:Yt(e.modelValue)}),u.$watch("formField.value",(function(n,r){n!==r&&JSON.stringify(n)!==JSON.stringify(e.modelValue)&&t.emit("update:modelValue",Yt(n))})),Object(l["watch"])((function(){return e.modelValue}),(function(e){JSON.stringify(e)!==JSON.stringify(u.formField.value)&&o((function(){u.formField.value=e}))})),Object(l["watch"])((function(){return e.formField}),(function(e){o((function(){var t=u.formField.value;u.formField=Wt(Wt({},Yt(e)),{},{value:t})}))}),{deep:!0}),Object(l["onMounted"])((function(){window.$(n.value).append(r),i["Matomo"].helper.compileAngularComponents(r,{scope:u,params:{formField:Wt(Wt({},Yt(e.formField)),{},{value:e.modelValue})}})})),{root:n}}});Zt.render=qt;var Qt=Zt; + */function Dt(e,t){if(!e)return[];var n=[];return Object.entries(e).forEach((function(e){var r=xt(e,2),o=r[0],i=r[1];if("object"!==Bt(i)||"undefined"===typeof i.key){var l=o;"integer"===t&&"string"===typeof o&&(l=parseInt(l,10)),n.push({key:l,value:i})}else n.push(i)})),n}function Jt(e){return Jt="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jt(e)}var Ht=["password","url","search","email"],It=["textarea","checkbox","text"],Lt={checkbox:"FieldCheckbox","expandable-select":"FieldExpandableSelect","field-array":"FieldFieldArray",file:"FieldFile",hidden:"FieldHidden",multiselect:"FieldSelect",multituple:"FieldMultituple",number:"FieldNumber",radio:"FieldRadio",select:"FieldSelect",site:"FieldSite",text:"FieldText",textarea:"FieldTextarea"},zt={FieldSelect:et,FieldCheckboxArray:Dt,FieldRadio:Dt,FieldExpandableSelect:_},Ut=Object(l["defineComponent"])({props:{modelValue:null,formField:{type:Object,required:!0},allSettings:[Object,Array]},emits:["update:modelValue"],components:{FieldCheckbox:j,FieldCheckboxArray:P,FieldExpandableSelect:R,FieldFieldArray:Y,FieldFile:ie,FieldHidden:ce,FieldMultituple:pe,FieldNumber:Oe,FieldRadio:Ve,FieldSelect:rt,FieldSite:ut,FieldText:ft,FieldTextArray:ht,FieldTextarea:Vt,FieldTextareaArray:Et},setup:function(e){var t=Object(l["ref"])(null),n=function(e){var n;e&&(n="string"===typeof e&&e&&0===e.indexOf("#")?window.$(e):window.vueSanitize(e),window.$(t.value).html("").append(n))};return Object(l["watch"])((function(){return e.formField.inlineHelp}),n),Object(l["onMounted"])((function(){n(e.formField.inlineHelp)})),{inlineHelp:t}},computed:{childComponent:function(){if(this.formField.component)return this.formField.component;var e=this.formField.uiControl,t=Lt[e];return-1!==Ht.indexOf(e)&&(t="FieldText"),"array"===this.formField.type&&-1!==It.indexOf(e)&&(t="".concat(t,"Array")),t},extraChildComponentParams:function(){return"multiselect"===this.formField.uiControl?{multiple:!0}:{}},showFormHelp:function(){return this.formField.description||this.formField.inlineHelp||this.showDefaultValue},showDefaultValue:function(){return this.defaultValuePretty&&"checkbox"!==this.formField.uiControl&&"radio"!==this.formField.uiControl},showField:function(){if(!this.formField||!this.formField.condition)return!0;var e={};return Object.values(this.allSettings||{}).forEach((function(t){"0"===t.value?e[t.name]=0:e[t.name]=t.value})),this.formField.condition(e)},processedModelValue:function(){var e=this.formField;if("boolean"===e.type){var t=this.modelValue&&this.modelValue>0&&"0"!==this.modelValue;if("checkbox"===e.uiControl)return t;if("radio"===e.uiControl)return t?"1":"0"}return this.modelValue},defaultValue:function(){var e=this.formField.defaultValue;return Array.isArray(e)&&(e=e.join(",")),e},availableOptions:function(){var e=this.childComponent,t=this.formField;return t.availableValues&&zt[e]?zt[e](t.availableValues,t.type,t.uiControlAttributes):null},defaultValuePretty:function(){var e=this.formField.defaultValue,t=this.availableOptions;if("string"===typeof e&&e){var n=null;try{n=JSON.parse(e)}catch(o){}if(null!==n&&"object"===Jt(n))return""}if(!Array.isArray(t))return Array.isArray(e)?"":e?e.toString():"";var r=[];return Array.isArray(e)||(e=[e]),(t||[]).forEach((function(t){-1!==e.indexOf(t.key)&&"undefined"!==typeof t.value&&r.push(t.value)})),r.join(", ")},defaultValuePrettyTruncated:function(){return this.defaultValuePretty.substring(0,50)}},methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});Ut.render=b;var Kt=Ut,_t={ref:"root"};function qt(e,t,n,r,o,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",_t,null,512)}function Rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Wt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rt(Object(n),!0).forEach((function(t){Gt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zt(e){if("undefined"!==typeof e)return JSON.parse(JSON.stringify(e))}var Yt=Object(l["defineComponent"])({props:{modelValue:null,formField:null,templateFile:String},emits:["update:modelValue"],inheritAttrs:!1,setup:function(e,t){var n=Object(l["ref"])(null),r=window.$("<div ng-include=\"'".concat(e.templateFile,"?cb=").concat(i["Matomo"].cacheBuster,"'\"></div>")),o=i["Matomo"].helper.getAngularDependency("$timeout"),a=i["Matomo"].helper.getAngularDependency("$rootScope"),u=a.$new();return u.formField=Wt(Wt({},Zt(e.formField)),{},{value:Zt(e.modelValue)}),u.$watch("formField.value",(function(n,r){n!==r&&JSON.stringify(n)!==JSON.stringify(e.modelValue)&&t.emit("update:modelValue",Zt(n))})),Object(l["watch"])((function(){return e.modelValue}),(function(e){JSON.stringify(e)!==JSON.stringify(u.formField.value)&&o((function(){u.formField.value=e}))})),Object(l["watch"])((function(){return e.formField}),(function(e){o((function(){var t=u.formField.value;u.formField=Wt(Wt({},Zt(e)),{},{value:t})}))}),{deep:!0}),Object(l["onMounted"])((function(){window.$(n.value).append(r),i["Matomo"].helper.compileAngularComponents(r,{scope:u,params:{formField:Wt(Wt({},Zt(e.formField)),{},{value:e.modelValue})}})})),{root:n}}});Yt.render=qt;var Qt=Yt; /*! * Matomo - free/libre analytics platform * @@ -22,11 +22,56 @@ * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function bn(e,t,n){if("string"===typeof e&&e&&("array"===t||"multituple"===n||"field-array"===n||"multiselect"===n||"site"===n)){var r=JSON.parse(e);return"site"===n&&(r.name=i["Matomo"].helper.htmlDecode(r.name)),r}return"checkbox"===n&&"array"!==t?Object(i["transformAngularJsBoolAttr"])(e):e}Object(i["createAngularJsAdapter"])({component:dn,require:"?ngModel",scope:{uicontrol:{angularJsBind:"@"},name:{angularJsBind:"@"},value:{vue:"modelValue",angularJsBind:"@",transform:function(e,t,n){return bn(e,n.varType,n.uicontrol)}},default:{vue:"defaultValue",angularJsBind:"@"},options:{angularJsBind:"="},description:{angularJsBind:"@"},introduction:{angularJsBind:"@"},title:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@"},disabled:{angularJsBind:"=",transform:i["transformAngularJsBoolAttr"]},uiControlAttributes:{angularJsBind:"="},uiControlOptions:{angularJsBind:"="},autocomplete:{angularJsBind:"@",transform:i["transformAngularJsBoolAttr"]},condition:{angularJsBind:"@",transform:function(e,t,n){var r=e;return e&&(r=function(t){return n.$eval(e,t)}),r}},varType:{angularJsBind:"@"},autofocus:{angularJsBind:"@",transform:i["transformAngularJsBoolAttr"]},tabindex:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},fullWidth:{angularJsBind:"@",transform:i["transformAngularJsBoolAttr"]},maxlength:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},required:{angularJsBind:"@",transform:i["transformAngularJsBoolAttr"]},placeholder:{angularJsBind:"@"},rows:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},min:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},max:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},component:{angularJsBind:"<",transform:function(e,t,n){if(!e)return e;if(n.templateFile)return Object(l["shallowRef"])(Qt);var r=e.plugin,o=e.name;if(!r||!o)throw new Error("Invalid component property given to piwik-field directive, must be {plugin: '...',name: '...'}");return Object(l["shallowRef"])(Object(i["useExternalPluginComponent"])(r,o))}}},directiveName:"piwikField",$inject:["$timeout"],events:{"update:modelValue":function(e,t,n,r,o,i,l){var a=i?i.$viewValue:n.value;e!==a&&l((function(){i?(i.$setViewValue(e),i.$render()):n.value=e}))}},postCreate:function(e,t,n,r,o){var a=o;if(a){if(a.$render=function(){Object(l["nextTick"])((function(){e.modelValue=Object(i["removeAngularJsSpecificProperties"])(a.$viewValue)}))},"undefined"!==typeof t.value){var u=bn(t.value,t.varType,t.uicontrol);a.$setViewValue(u)}else a.$setViewValue(e.modelValue);"site"===t.uicontrol&&a.$viewValue&&setTimeout((function(){a.$setViewValue(fn({},a.$viewValue))}))}else t.$watch("value",(function(n){if(n!==e.modelValue){var r=bn(n,t.varType,t.uicontrol);Object(l["nextTick"])((function(){e.modelValue=r}))}}))}});var hn,On={class:"pluginSettings",ref:"root"},gn=["id"],vn={class:"card-content"},yn=["id"],jn=["onClick","disabled","value"],wn={class:"confirm-password-modal modal"},Vn={class:"modal-content"},Sn={class:"modal-footer"},Cn=["disabled"];function An(e,t,n,r,o,i){var a=this,u=Object(l["resolveComponent"])("PluginSetting"),c=Object(l["resolveComponent"])("ActivityIndicator"),s=Object(l["resolveComponent"])("Field");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",On,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.settingsPerPlugin,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{class:"card",id:"".concat(t.pluginName,"PluginSettings"),key:"".concat(t.pluginName,"PluginSettings")},[Object(l["createElementVNode"])("div",vn,[Object(l["createElementVNode"])("h2",{class:"card-title",id:t.pluginName},Object(l["toDisplayString"])(t.title),9,yn),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(t.settings,(function(n){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{key:"".concat(n.pluginName,".").concat(n.name)},[Object(l["createVNode"])(u,{modelValue:e.settingValues["".concat(t.pluginName,".").concat(n.name)],"onUpdate:modelValue":function(r){return e.settingValues["".concat(t.pluginName,".").concat(n.name)]=r},"plugin-name":t.pluginName,setting:n,"setting-values":e.settingValues},null,8,["modelValue","onUpdate:modelValue","plugin-name","setting","setting-values"])])})),128)),Object(l["createElementVNode"])("input",{type:"button",onClick:function(n){return e.saveSetting(t.pluginName)},disabled:e.isLoading,class:"pluginsSettingsSubmit btn",value:e.translate("General_Save")},null,8,jn),Object(l["createVNode"])(c,{loading:e.isLoading||e.isSaving[t.pluginName]},null,8,["loading"])])],8,gn)})),128)),Object(l["createElementVNode"])("div",wn,[Object(l["createElementVNode"])("div",Vn,[Object(l["createElementVNode"])("h2",null,Object(l["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1),Object(l["createElementVNode"])("div",null,[Object(l["createVNode"])(s,{modelValue:e.passwordConfirmation,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.passwordConfirmation=t}),uicontrol:"password",name:"currentUserPassword",autocomplete:!1,"full-width":!0,title:e.translate("UsersManager_YourCurrentPassword")},null,8,["modelValue","title"])])]),Object(l["createElementVNode"])("div",Sn,[Object(l["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",disabled:e.passwordConfirmation?void 0:"disabled",onClick:t[1]||(t[1]=function(t){t.preventDefault(),e.save(a.settingsToSave)})},Object(l["toDisplayString"])(e.translate("General_Yes")),9,Cn),Object(l["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[2]||(t[2]=function(e){return e.preventDefault()})},Object(l["toDisplayString"])(e.translate("General_No")),1)])])],512)}function kn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kn(Object(n),!0).forEach((function(t){En(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function En(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bn(e,t,n,r,o,i){var a=Object(l["resolveComponent"])("FormField");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createVNode"])(a,{"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.changeValue(t)}),"form-field":Fn(Fn({},e.setting),{},{condition:e.conditionFunction})},null,8,["model-value","form-field"])])}function xn(e,t){return Mn(e)||$n(e,t)||Pn(e,t)||Nn()}function Nn(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Pn(e,t){if(e){if("string"===typeof e)return Tn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tn(e,t):void 0}}function Tn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $n(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done);l=!0)if(i.push(r.value),t&&i.length===t)break}catch(u){a=!0,o=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw o}}return i}}function Mn(e){if(Array.isArray(e))return e}var Dn=Object(l["defineComponent"])({props:{pluginName:String,setting:Object,modelValue:null,settingValues:Object},components:{FormField:Kt},emits:["update:modelValue"],computed:{conditionFunction:function(){var e=this,t=this.setting.condition;if(t)return function(){if(!hn){var n=i["Matomo"].helper.getAngularDependency("$rootScope");hn=n.$new(!0)}return hn.$eval(t,e.conditionValues)}},conditionValues:function(){var e=this,t={};return Object.entries(this.settingValues).forEach((function(n){var r=xn(n,2),o=r[0],i=r[1],l=o.split("."),a=xn(l,2),u=a[0],c=a[1];u===e.pluginName&&(t[c]=i)})),t}},methods:{changeValue:function(e){this.$emit("update:modelValue",e)}}});Dn.render=Bn;var Jn=Dn;function Hn(e,t){return Kn(e)||Un(e,t)||In(e,t)||Ln()}function Ln(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function In(e,t){if(e){if("string"===typeof e)return zn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zn(e,t):void 0}}function zn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Un(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done);l=!0)if(i.push(r.value),t&&i.length===t)break}catch(u){a=!0,o=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw o}}return i}}function Kn(e){if(Array.isArray(e))return e}var _n=window,qn=_n.$,Rn=Object(l["defineComponent"])({props:{mode:String},components:{ActivityIndicator:i["ActivityIndicator"],Field:dn,PluginSetting:Jn},data:function(){return{isLoading:!0,isSaving:{},passwordConfirmation:"",settingsToSave:null,settingsPerPlugin:[],settingValues:{}}},created:function(){var e=this;i["AjaxHelper"].fetch({method:this.apiMethod}).then((function(t){e.isLoading=!1,e.settingsPerPlugin=t,t.forEach((function(t){t.settings.forEach((function(n){e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}))})),window.anchorLinkFix.scrollToAnchorInUrl(),e.addSectionsToTableOfContents()})).catch((function(){e.isLoading=!1}))},computed:{apiMethod:function(){return"admin"===this.mode?"CorePluginsAdmin.getSystemSettings":"CorePluginsAdmin.getUserSettings"},saveApiMethod:function(){return"admin"===this.mode?"CorePluginsAdmin.setSystemSettings":"CorePluginsAdmin.setUserSettings"}},methods:{addSectionsToTableOfContents:function(){var e=qn("#generalSettingsTOC");e.length&&this.settingsPerPlugin.forEach((function(t){var n=t.pluginName,r=t.settings;n&&("CoreAdminHome"===n&&r?r.filter((function(e){return e.introduction})).forEach((function(t){e.append('<a href="#/'.concat(n,'PluginSettings">').concat(t.introduction,"</a> "))})):e.append('<a href="#/'.concat(n,'">').concat(n.replace(/([A-Z])/g," $1").trim(),"</a> ")))}))},saveSetting:function(e){"admin"===this.mode?this.showPasswordConfirmModal(e):this.save(e)},showPasswordConfirmModal:function(e){var t=this;this.settingsToSave=e;var n=this.$refs.root,r=qn(n),o=function(n){var o=n.keyCode?n.keyCode:n.which;"13"===o&&(r.find(".confirm-password-modal").modal("close"),t.save(e))};r.find(".confirm-password-modal").modal({dismissible:!1,onOpenEnd:function(){var e=".modal.open #currentUserPassword";qn(e).focus(),qn(e).off("keypress").keypress(o)}}).modal("open")},save:function(e){var t=this,n=this.saveApiMethod;this.isSaving[e]=!0;var r=this.getValuesForPlugin(e);i["AjaxHelper"].post({method:n},{settingValues:r,passwordConfirmation:this.passwordConfirmation}).then((function(){t.isSaving[e]=!1,i["NotificationsStore"].show({message:Object(i["translate"])("CoreAdminHome_PluginSettingsSaveSuccess"),id:"generalSettings",context:"success",type:"transient"}),i["NotificationsStore"].scrollToNotification("generalSettings")})).catch((function(){t.isSaving[e]=!1})),this.passwordConfirmation="",this.settingsToSave=null},getValuesForPlugin:function(e){var t={};return t[e]||(t[e]=[]),Object.entries(this.settingValues).forEach((function(n){var r=Hn(n,2),o=r[0],i=r[1],l=o.split("."),a=Hn(l,2),u=a[0],c=a[1];if(u===e){var s=i;!1===s?s="0":!0===s&&(s="1"),t[u].push({name:c,value:s})}})),t}}});Rn.render=An;var Wn=Rn; + */function bn(e,t,n){if("string"===typeof e&&e&&("array"===t||"multituple"===n||"field-array"===n||"multiselect"===n||"site"===n)){var r=JSON.parse(e);return"site"===n&&(r.name=i["Matomo"].helper.htmlDecode(r.name)),r}return"checkbox"===n&&"array"!==t?Object(i["transformAngularJsBoolAttr"])(e):e}Object(i["createAngularJsAdapter"])({component:dn,require:"?ngModel",scope:{uicontrol:{angularJsBind:"@"},name:{angularJsBind:"@"},value:{vue:"modelValue",angularJsBind:"@",transform:function(e,t,n){return bn(e,n.varType,n.uicontrol)}},default:{vue:"defaultValue",angularJsBind:"@"},options:{angularJsBind:"="},description:{angularJsBind:"@"},introduction:{angularJsBind:"@"},title:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@"},disabled:{angularJsBind:"=",transform:i["transformAngularJsBoolAttr"]},uiControlAttributes:{angularJsBind:"="},uiControlOptions:{angularJsBind:"="},autocomplete:{angularJsBind:"@",transform:i["transformAngularJsBoolAttr"]},condition:{angularJsBind:"@",transform:function(e,t,n){var r=e;return e&&(r=function(t){return n.$eval(e,t)}),r}},varType:{angularJsBind:"@"},autofocus:{angularJsBind:"@",transform:i["transformAngularJsBoolAttr"]},tabindex:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},fullWidth:{angularJsBind:"@",transform:i["transformAngularJsBoolAttr"]},maxlength:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},required:{angularJsBind:"@",transform:i["transformAngularJsBoolAttr"]},placeholder:{angularJsBind:"@"},rows:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},min:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},max:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},component:{angularJsBind:"<",transform:function(e,t,n){if(!e)return e;if(n.templateFile)return Object(l["shallowRef"])(Qt);var r=e.plugin,o=e.name;if(!r||!o)throw new Error("Invalid component property given to piwik-field directive, must be {plugin: '...',name: '...'}");return Object(l["shallowRef"])(Object(i["useExternalPluginComponent"])(r,o))}}},directiveName:"piwikField",$inject:["$timeout"],events:{"update:modelValue":function(e,t,n,r,o,i,l){var a=i?i.$viewValue:n.value;e!==a&&l((function(){i?(i.$setViewValue(e),i.$render()):n.value=e}))}},postCreate:function(e,t,n,r,o){var a=o;if(a){if(a.$render=function(){Object(l["nextTick"])((function(){e.modelValue=Object(i["removeAngularJsSpecificProperties"])(a.$viewValue)}))},"undefined"!==typeof t.value){var u=bn(t.value,t.varType,t.uicontrol);a.$setViewValue(u)}else a.$setViewValue(e.modelValue);"site"===t.uicontrol&&a.$viewValue&&setTimeout((function(){a.$setViewValue(fn({},a.$viewValue))}))}else t.$watch("value",(function(n){if(n!==e.modelValue){var r=bn(n,t.varType,t.uicontrol);Object(l["nextTick"])((function(){e.modelValue=r}))}}))}});var vn,gn={class:"pluginSettings",ref:"root"},hn=["id"],On={class:"card-content"},yn=["id"],jn=["onClick","disabled","value"],wn={class:"confirm-password-modal modal"},Vn={class:"modal-content"},Cn={class:"modal-footer"},Sn=["disabled"];function kn(e,t,n,r,o,i){var a=this,u=Object(l["resolveComponent"])("PluginSetting"),c=Object(l["resolveComponent"])("ActivityIndicator"),s=Object(l["resolveComponent"])("Field");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",gn,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.settingsPerPlugin,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{class:"card",id:"".concat(t.pluginName,"PluginSettings"),key:"".concat(t.pluginName,"PluginSettings")},[Object(l["createElementVNode"])("div",On,[Object(l["createElementVNode"])("h2",{class:"card-title",id:t.pluginName},Object(l["toDisplayString"])(t.title),9,yn),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(t.settings,(function(n){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{key:"".concat(n.pluginName,".").concat(n.name)},[Object(l["createVNode"])(u,{modelValue:e.settingValues["".concat(t.pluginName,".").concat(n.name)],"onUpdate:modelValue":function(r){return e.settingValues["".concat(t.pluginName,".").concat(n.name)]=r},"plugin-name":t.pluginName,setting:n,"setting-values":e.settingValues},null,8,["modelValue","onUpdate:modelValue","plugin-name","setting","setting-values"])])})),128)),Object(l["createElementVNode"])("input",{type:"button",onClick:function(n){return e.saveSetting(t.pluginName)},disabled:e.isLoading,class:"pluginsSettingsSubmit btn",value:e.translate("General_Save")},null,8,jn),Object(l["createVNode"])(c,{loading:e.isLoading||e.isSaving[t.pluginName]},null,8,["loading"])])],8,hn)})),128)),Object(l["createElementVNode"])("div",wn,[Object(l["createElementVNode"])("div",Vn,[Object(l["createElementVNode"])("h2",null,Object(l["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1),Object(l["createElementVNode"])("div",null,[Object(l["createVNode"])(s,{modelValue:e.passwordConfirmation,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.passwordConfirmation=t}),uicontrol:"password",name:"currentUserPassword",autocomplete:!1,"full-width":!0,title:e.translate("UsersManager_YourCurrentPassword")},null,8,["modelValue","title"])])]),Object(l["createElementVNode"])("div",Cn,[Object(l["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",disabled:e.passwordConfirmation?void 0:"disabled",onClick:t[1]||(t[1]=function(t){t.preventDefault(),e.save(a.settingsToSave)})},Object(l["toDisplayString"])(e.translate("General_Yes")),9,Sn),Object(l["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[2]||(t[2]=function(e){return e.preventDefault()})},Object(l["toDisplayString"])(e.translate("General_No")),1)])])],512)}function An(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Fn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?An(Object(n),!0).forEach((function(t){En(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):An(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function En(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bn(e,t,n,r,o,i){var a=Object(l["resolveComponent"])("FormField");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createVNode"])(a,{"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.changeValue(t)}),"form-field":Fn(Fn({},e.setting),{},{condition:e.conditionFunction})},null,8,["model-value","form-field"])])}function xn(e,t){return Mn(e)||$n(e,t)||Nn(e,t)||Pn()}function Pn(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Nn(e,t){if(e){if("string"===typeof e)return Tn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tn(e,t):void 0}}function Tn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $n(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done);l=!0)if(i.push(r.value),t&&i.length===t)break}catch(u){a=!0,o=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw o}}return i}}function Mn(e){if(Array.isArray(e))return e}var Dn=Object(l["defineComponent"])({props:{pluginName:String,setting:Object,modelValue:null,settingValues:Object},components:{FormField:Kt},emits:["update:modelValue"],computed:{conditionFunction:function(){var e=this,t=this.setting.condition;if(t)return function(){if(!vn){var n=i["Matomo"].helper.getAngularDependency("$rootScope");vn=n.$new(!0)}return vn.$eval(t,e.conditionValues)}},conditionValues:function(){var e=this,t={};return Object.entries(this.settingValues).forEach((function(n){var r=xn(n,2),o=r[0],i=r[1],l=o.split("."),a=xn(l,2),u=a[0],c=a[1];u===e.pluginName&&(t[c]=i)})),t}},methods:{changeValue:function(e){this.$emit("update:modelValue",e)}}});Dn.render=Bn;var Jn=Dn;function Hn(e,t){return Kn(e)||Un(e,t)||Ln(e,t)||In()}function In(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ln(e,t){if(e){if("string"===typeof e)return zn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zn(e,t):void 0}}function zn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Un(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done);l=!0)if(i.push(r.value),t&&i.length===t)break}catch(u){a=!0,o=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw o}}return i}}function Kn(e){if(Array.isArray(e))return e}var _n=window,qn=_n.$,Rn=Object(l["defineComponent"])({props:{mode:String},components:{ActivityIndicator:i["ActivityIndicator"],Field:dn,PluginSetting:Jn},data:function(){return{isLoading:!0,isSaving:{},passwordConfirmation:"",settingsToSave:null,settingsPerPlugin:[],settingValues:{}}},created:function(){var e=this;i["AjaxHelper"].fetch({method:this.apiMethod}).then((function(t){e.isLoading=!1,e.settingsPerPlugin=t,t.forEach((function(t){t.settings.forEach((function(n){e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}))})),window.anchorLinkFix.scrollToAnchorInUrl(),e.addSectionsToTableOfContents()})).catch((function(){e.isLoading=!1}))},computed:{apiMethod:function(){return"admin"===this.mode?"CorePluginsAdmin.getSystemSettings":"CorePluginsAdmin.getUserSettings"},saveApiMethod:function(){return"admin"===this.mode?"CorePluginsAdmin.setSystemSettings":"CorePluginsAdmin.setUserSettings"}},methods:{addSectionsToTableOfContents:function(){var e=qn("#generalSettingsTOC");e.length&&this.settingsPerPlugin.forEach((function(t){var n=t.pluginName,r=t.settings;n&&("CoreAdminHome"===n&&r?r.filter((function(e){return e.introduction})).forEach((function(t){e.append('<a href="#/'.concat(n,'PluginSettings">').concat(t.introduction,"</a> "))})):e.append('<a href="#/'.concat(n,'">').concat(n.replace(/([A-Z])/g," $1").trim(),"</a> ")))}))},saveSetting:function(e){"admin"===this.mode?this.showPasswordConfirmModal(e):this.save(e)},showPasswordConfirmModal:function(e){var t=this;this.settingsToSave=e;var n=this.$refs.root,r=qn(n),o=function(n){var o=n.keyCode?n.keyCode:n.which;"13"===o&&(r.find(".confirm-password-modal").modal("close"),t.save(e))};r.find(".confirm-password-modal").modal({dismissible:!1,onOpenEnd:function(){var e=".modal.open #currentUserPassword";qn(e).focus(),qn(e).off("keypress").keypress(o)}}).modal("open")},save:function(e){var t=this,n=this.saveApiMethod;this.isSaving[e]=!0;var r=this.getValuesForPlugin(e);i["AjaxHelper"].post({method:n},{settingValues:r,passwordConfirmation:this.passwordConfirmation}).then((function(){t.isSaving[e]=!1,i["NotificationsStore"].show({message:Object(i["translate"])("CoreAdminHome_PluginSettingsSaveSuccess"),id:"generalSettings",context:"success",type:"transient"}),i["NotificationsStore"].scrollToNotification("generalSettings")})).catch((function(){t.isSaving[e]=!1})),this.passwordConfirmation="",this.settingsToSave=null},getValuesForPlugin:function(e){var t={};return t[e]||(t[e]=[]),Object.entries(this.settingValues).forEach((function(n){var r=Hn(n,2),o=r[0],i=r[1],l=o.split("."),a=Hn(l,2),u=a[0],c=a[1];if(u===e){var s=i;!1===s?s="0":!0===s&&(s="1"),t[u].push({name:c,value:s})}})),t}}});Rn.render=kn;var Wn=Rn,Gn=(Object(i["createAngularJsAdapter"])({component:Wn,scope:{mode:{angularJsBind:"@"}},directiveName:"piwikPluginSettings"}),window),Zn=Gn.$; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */Object(i["createAngularJsAdapter"])({component:Wn,scope:{mode:{angularJsBind:"@"}},directiveName:"piwikPluginSettings"})}})})); + */function Yn(e,t){t.preventDefault();var n=Zn(t.target).attr("href"),r=Zn(t.target).attr("data-plugin-name");if(n&&r){e.value.uninstallConfirmMessage||(e.value.uninstallConfirmMessage=Zn("#uninstallPluginConfirm").text());var o=e.value.uninstallConfirmMessage.replace("%s",r);Zn("#uninstallPluginConfirm").text(o),i["Matomo"].helper.modalConfirm("#confirmUninstallPlugin",{yes:function(){window.location=n}})}}function Qn(e){e.preventDefault();var t=Zn(e.target).data("overlay-id");i["Matomo"].helper.modalConfirm("#".concat(t),{})}var Xn={mounted:function(e,t){setTimeout((function(){t.value.uninstallConfirmMessage="",Zn(e).find(".uninstall").click(Yn.bind(null,t)),Zn(e).find(".plugin-donation-link").click(Qn)}))}}; +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */function er(){return{restrict:"A",link:function(e,t){var n={instance:null,value:{},oldValue:null,modifiers:{},dir:{}};Xn.mounted(t[0],n)}}}er.$inject=[],angular.module("piwikApp").directive("piwikPluginManagement",er); +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +var tr=window,nr=tr.$;function rr(e){e.preventDefault(),i["Matomo"].helper.modalConfirm("#installPluginByUpload",{})}function or(e){var t=nr("[name=pluginZip]"),n=t.val();n&&".zip"===n.slice(-4)?t.data("maxSize")>0&&t[0].files[0].size>1048576*t.data("maxSize")&&(e.preventDefault(),alert(Object(i["translate"])("CorePluginsAdmin_FileExceedsUploadLimit"))):(e.preventDefault(),alert(Object(i["translate"])("CorePluginsAdmin_NoZipFileSelected")))}var ir={mounted:function(){setTimeout((function(){nr(".uploadPlugin").click(rr),nr("#uploadPluginForm").submit(or)}))}}; +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */function lr(){return{restrict:"A",link:function(){ir.mounted()}}}lr.$inject=[],angular.module("piwikApp").directive("piwikPluginUpload",lr); +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +var ar=window,ur=ar.$;function cr(e){return e.find(".origin a.active").data("filter-origin")}function sr(e){return e.find(".status a.active").data("filter-status")}function dr(e,t){var n="#plugins tr";return n+="all"===e?"[data-filter-origin]":"[data-filter-origin=".concat(e,"]"),n+="all"===t?"[data-filter-status]":"[data-filter-status=".concat(t,"]"),ur(n)}function mr(e,t,n,r){var o=dr(n,r).length,i=" (".concat(o,")");e.find("".concat(t," .counter")).text(i)}function fr(e){var t=cr(e),n=sr(e);mr(e,'[data-filter-status="all"]',t,"all"),mr(e,'[data-filter-status="active"]',t,"active"),mr(e,'[data-filter-status="inactive"]',t,"inactive"),mr(e,'[data-filter-origin="all"]',"all",n),mr(e,'[data-filter-origin="core"]',"core",n),mr(e,'[data-filter-origin="official"]',"official",n),mr(e,'[data-filter-origin="thirdparty"]',"thirdparty",n)}function pr(e){var t=cr(e),n=sr(e),r=dr(t,n);ur("#plugins tr[data-filter-origin][data-filter-status]").css("display","none"),r.css("display","table-row"),fr(e)}function br(e,t){t.preventDefault(),ur(t.target).siblings().removeClass("active"),ur(t.target).addClass("active"),pr(e)}function vr(e,t){t.preventDefault(),ur(t.target).siblings().removeClass("active"),ur(t.target).addClass("active"),pr(e)}var gr={mounted:function(e){setTimeout((function(){fr(ur(e)),ur(e).find(".status").on("click","a",br.bind(null,ur(e))),ur(e).find(".origin").on("click","a",vr.bind(null,ur(e)))}))}}; +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */function hr(){return{restrict:"A",link:function(e,t){gr.mounted(t[0])}}}hr.$inject=[],angular.module("piwikApp").directive("piwikPluginFilter",hr);var Or={class:"matomo-save-button",style:{display:"inline-block"}},yr=["disabled","value"];function jr(e,t,n,r,o,i){var a=Object(l["resolveComponent"])("ActivityIndicator");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",Or,[Object(l["createElementVNode"])("input",{type:"button",onClick:t[0]||(t[0]=function(t){return e.onConfirm(t)}),disabled:e.saving||e.disabled,class:"btn",value:e.value?e.value:e.translate("General_Save")},null,8,yr),Object(l["createVNode"])(a,{loading:e.saving},null,8,["loading"])])}var wr=Object(l["defineComponent"])({props:{saving:Boolean,value:String,disabled:Boolean},components:{ActivityIndicator:i["ActivityIndicator"]},emits:["confirm"],methods:{onConfirm:function(e){this.$emit("confirm",e)}}});wr.render=jr;var Vr=wr,Cr=(Object(i["createAngularJsAdapter"])({component:Vr,scope:{saving:{angularJsBind:"=?"},value:{angularJsBind:"@?"},disabled:{angularJsBind:"=?"},onconfirm:{angularJsBind:"&?",vue:"confirm"}},events:{confirm:function(e,t,n,r,o,i,l){r[0].click(),l()}},replace:!0,directiveName:"piwikSaveButton",$inject:["$timeout"]}),window),Sr=Cr.$,kr={mounted:function(e){setTimeout((function(){Sr(e).find("input[type=text]").keypress((function(t){var n=t.keyCode||t.which;13===n&&Sr(e).find(".matomo-save-button input").triggerHandler("click")}))}))}}; +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +function Ar(){return{restrict:"A",link:function(e,t){kr.mounted(t[0])}}}Ar.$inject=[],angular.module("piwikApp").directive("piwikForm",Ar)}})})); //# sourceMappingURL=CorePluginsAdmin.umd.min.js.map
\ No newline at end of file diff --git a/plugins/CorePluginsAdmin/vue/src/Form/Form.adapter.ts b/plugins/CorePluginsAdmin/vue/src/Form/Form.adapter.ts new file mode 100644 index 0000000000..054af6c0e7 --- /dev/null +++ b/plugins/CorePluginsAdmin/vue/src/Form/Form.adapter.ts @@ -0,0 +1,22 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { IDirective, IScope } from 'angular'; +import Form from './Form'; + +export default function piwikForm(): IDirective { + return { + restrict: 'A', + link: function expandOnClickLink(scope: IScope, element: JQuery) { + Form.mounted(element[0]); + }, + }; +} + +piwikForm.$inject = []; + +angular.module('piwikApp').directive('piwikForm', piwikForm); diff --git a/plugins/CorePluginsAdmin/vue/src/Form/Form.ts b/plugins/CorePluginsAdmin/vue/src/Form/Form.ts new file mode 100644 index 0000000000..386eb2a6e1 --- /dev/null +++ b/plugins/CorePluginsAdmin/vue/src/Form/Form.ts @@ -0,0 +1,21 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +const { $ } = window; + +export default { + mounted(el: HTMLElement): void { + setTimeout(() => { + $(el).find('input[type=text]').keypress((e) => { + const key = e.keyCode || e.which; + if (key === 13) { + $(el).find('.matomo-save-button input').triggerHandler('click'); + } + }); + }); + }, +}; diff --git a/plugins/CorePluginsAdmin/vue/src/Plugins/PluginFilter.adapter.ts b/plugins/CorePluginsAdmin/vue/src/Plugins/PluginFilter.adapter.ts new file mode 100644 index 0000000000..557cca16ad --- /dev/null +++ b/plugins/CorePluginsAdmin/vue/src/Plugins/PluginFilter.adapter.ts @@ -0,0 +1,22 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { IDirective, IScope } from 'angular'; +import PluginFilter from './PluginFilter'; + +export default function piwikPluginFilter(): IDirective { + return { + restrict: 'A', + link: function expandOnClickLink(scope: IScope, element: JQuery) { + PluginFilter.mounted(element[0]); + }, + }; +} + +piwikPluginFilter.$inject = []; + +angular.module('piwikApp').directive('piwikPluginFilter', piwikPluginFilter); diff --git a/plugins/CorePluginsAdmin/vue/src/Plugins/PluginFilter.ts b/plugins/CorePluginsAdmin/vue/src/Plugins/PluginFilter.ts new file mode 100644 index 0000000000..e858b846a7 --- /dev/null +++ b/plugins/CorePluginsAdmin/vue/src/Plugins/PluginFilter.ts @@ -0,0 +1,101 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +const { $ } = window; + +function getCurrentFilterOrigin(element: JQuery) { + return element.find('.origin a.active').data('filter-origin'); +} + +function getCurrentFilterStatus(element: JQuery) { + return element.find('.status a.active').data('filter-status'); +} + +function getMatchingNodes(filterOrigin, filterStatus) { + let query = '#plugins tr'; + + if (filterOrigin === 'all') { + query += '[data-filter-origin]'; + } else { + query += `[data-filter-origin=${filterOrigin}]`; + } + + if (filterStatus === 'all') { + query += '[data-filter-status]'; + } else { + query += `[data-filter-status=${filterStatus}]`; + } + + return $(query); +} + +function updateNumberOfMatchingPluginsInFilter( + element: JQuery, + selectorFilterToUpdate, + filterOrigin, + filterStatus, +) { + const numMatchingNodes = getMatchingNodes(filterOrigin, filterStatus).length; + const updatedCounterText = ` (${numMatchingNodes})`; + + element.find(`${selectorFilterToUpdate} .counter`).text(updatedCounterText); +} + +function updateAllNumbersOfMatchingPluginsInFilter(element: JQuery) { + const filterOrigin = getCurrentFilterOrigin(element); + const filterStatus = getCurrentFilterStatus(element); + + updateNumberOfMatchingPluginsInFilter(element, '[data-filter-status="all"]', filterOrigin, 'all'); + updateNumberOfMatchingPluginsInFilter(element, '[data-filter-status="active"]', filterOrigin, 'active'); + updateNumberOfMatchingPluginsInFilter(element, '[data-filter-status="inactive"]', filterOrigin, 'inactive'); + + updateNumberOfMatchingPluginsInFilter(element, '[data-filter-origin="all"]', 'all', filterStatus); + updateNumberOfMatchingPluginsInFilter(element, '[data-filter-origin="core"]', 'core', filterStatus); + updateNumberOfMatchingPluginsInFilter(element, '[data-filter-origin="official"]', 'official', filterStatus); + updateNumberOfMatchingPluginsInFilter(element, '[data-filter-origin="thirdparty"]', 'thirdparty', filterStatus); +} + +function filterPlugins(element: JQuery) { + const filterOrigin = getCurrentFilterOrigin(element); + const filterStatus = getCurrentFilterStatus(element); + + const $nodesToEnable = getMatchingNodes(filterOrigin, filterStatus); + + $('#plugins tr[data-filter-origin][data-filter-status]').css('display', 'none'); + $nodesToEnable.css('display', 'table-row'); + + updateAllNumbersOfMatchingPluginsInFilter(element); +} + +function onClickStatus(element: JQuery, event) { + event.preventDefault(); + + $(event.target).siblings().removeClass('active'); + $(event.target).addClass('active'); + + filterPlugins(element); +} + +function onClickOrigin(element: JQuery, event) { + event.preventDefault(); + + $(event.target).siblings().removeClass('active'); + $(event.target).addClass('active'); + + filterPlugins(element); +} + +export default { + mounted(el: HTMLElement): void { + setTimeout(() => { + updateAllNumbersOfMatchingPluginsInFilter($(el)); + + $(el).find('.status').on('click', 'a', onClickStatus.bind(null, $(el))); + $(el).find('.origin').on('click', 'a', onClickOrigin.bind(null, $(el))); + }); + }, +}; diff --git a/plugins/CorePluginsAdmin/vue/src/Plugins/PluginManagement.adapter.ts b/plugins/CorePluginsAdmin/vue/src/Plugins/PluginManagement.adapter.ts new file mode 100644 index 0000000000..ac3c0020b7 --- /dev/null +++ b/plugins/CorePluginsAdmin/vue/src/Plugins/PluginManagement.adapter.ts @@ -0,0 +1,30 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { IDirective, IScope } from 'angular'; +import PluginManagement from './PluginManagement'; + +export default function piwikPluginManagement(): IDirective { + return { + restrict: 'A', + link: function expandOnClickLink(scope: IScope, element: JQuery) { + const binding = { + instance: null, + value: {}, + oldValue: null, + modifiers: {}, + dir: {}, + }; + + PluginManagement.mounted(element[0], binding); + }, + }; +} + +piwikPluginManagement.$inject = []; + +angular.module('piwikApp').directive('piwikPluginManagement', piwikPluginManagement); diff --git a/plugins/CorePluginsAdmin/vue/src/Plugins/PluginManagement.ts b/plugins/CorePluginsAdmin/vue/src/Plugins/PluginManagement.ts new file mode 100644 index 0000000000..cd8b22fafb --- /dev/null +++ b/plugins/CorePluginsAdmin/vue/src/Plugins/PluginManagement.ts @@ -0,0 +1,58 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { DirectiveBinding } from 'vue'; +import { Matomo } from 'CoreHome'; + +const { $ } = window; + +interface PluginManagementState { + uninstallConfirmMessage?: string; +} + +function onClickUninstall(binding: DirectiveBinding<PluginManagementState>, event: MouseEvent) { + event.preventDefault(); + + const link = $(event.target).attr('href'); + const pluginName = $(event.target).attr('data-plugin-name'); + + if (!link || !pluginName) { + return; + } + + if (!binding.value.uninstallConfirmMessage) { + binding.value.uninstallConfirmMessage = $('#uninstallPluginConfirm').text(); + } + + const messageToDisplay = binding.value.uninstallConfirmMessage.replace('%s', pluginName); + + $('#uninstallPluginConfirm').text(messageToDisplay); + + Matomo.helper.modalConfirm('#confirmUninstallPlugin', { + yes: () => { + window.location = link; + }, + }); +} + +function onDonateLinkClick(event: MouseEvent) { + event.preventDefault(); + + const overlayId = $(event.target).data('overlay-id'); + Matomo.helper.modalConfirm(`#${overlayId}`, {}); +} + +export default { + mounted(el: HTMLElement, binding: DirectiveBinding<PluginManagementState>): void { + setTimeout(() => { + binding.value.uninstallConfirmMessage = ''; + + $(el).find('.uninstall').click(onClickUninstall.bind(null, binding)); + $(el).find('.plugin-donation-link').click(onDonateLinkClick); + }); + }, +}; diff --git a/plugins/CorePluginsAdmin/vue/src/Plugins/PluginUpload.adapter.ts b/plugins/CorePluginsAdmin/vue/src/Plugins/PluginUpload.adapter.ts new file mode 100644 index 0000000000..c8e83ba31a --- /dev/null +++ b/plugins/CorePluginsAdmin/vue/src/Plugins/PluginUpload.adapter.ts @@ -0,0 +1,22 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { IDirective } from 'angular'; +import PluginUpload from './PluginUpload'; + +export default function piwikPluginUpload(): IDirective { + return { + restrict: 'A', + link: function expandOnClickLink() { + PluginUpload.mounted(); + }, + }; +} + +piwikPluginUpload.$inject = []; + +angular.module('piwikApp').directive('piwikPluginUpload', piwikPluginUpload); diff --git a/plugins/CorePluginsAdmin/vue/src/Plugins/PluginUpload.ts b/plugins/CorePluginsAdmin/vue/src/Plugins/PluginUpload.ts new file mode 100644 index 0000000000..9c620fd556 --- /dev/null +++ b/plugins/CorePluginsAdmin/vue/src/Plugins/PluginUpload.ts @@ -0,0 +1,40 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ +import { Matomo, translate } from 'CoreHome'; + +const { $ } = window; + +function onUploadPlugin(event: MouseEvent) { + event.preventDefault(); + Matomo.helper.modalConfirm('#installPluginByUpload', {}); +} + +function onSubmitPlugin(event: MouseEvent) { + const $zipFile = $('[name=pluginZip]'); + const fileName = $zipFile.val(); + + if (!fileName || fileName.slice(-4) !== '.zip') { + event.preventDefault(); + // eslint-disable-next-line no-alert + alert(translate('CorePluginsAdmin_NoZipFileSelected')); + } else if ($zipFile.data('maxSize') > 0 + && $zipFile[0].files[0].size > $zipFile.data('maxSize') * 1048576 + ) { + event.preventDefault(); + // eslint-disable-next-line no-alert + alert(translate('CorePluginsAdmin_FileExceedsUploadLimit')); + } +} + +export default { + mounted(): void { + setTimeout(() => { + $('.uploadPlugin').click(onUploadPlugin); + $('#uploadPluginForm').submit(onSubmitPlugin); + }); + }, +}; diff --git a/plugins/CorePluginsAdmin/vue/src/SaveButton/SaveButton.adapter.ts b/plugins/CorePluginsAdmin/vue/src/SaveButton/SaveButton.adapter.ts new file mode 100644 index 0000000000..b991c2912f --- /dev/null +++ b/plugins/CorePluginsAdmin/vue/src/SaveButton/SaveButton.adapter.ts @@ -0,0 +1,38 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { ITimeoutService } from 'angular'; +import { createAngularJsAdapter } from 'CoreHome'; +import SaveButton from './SaveButton.vue'; + +export default createAngularJsAdapter<[ITimeoutService]>({ + component: SaveButton, + scope: { + saving: { + angularJsBind: '=?', + }, + value: { + angularJsBind: '@?', + }, + disabled: { + angularJsBind: '=?', + }, + onconfirm: { + angularJsBind: '&?', + vue: 'confirm', + }, + }, + events: { + confirm($event, vm, scope, element, attrs, controller, $timeout) { + element[0].click(); // this directive can be used on input's with ng-click specified + $timeout(); + }, + }, + replace: true, + directiveName: 'piwikSaveButton', + $inject: ['$timeout'], +}); diff --git a/plugins/CorePluginsAdmin/vue/src/SaveButton/SaveButton.vue b/plugins/CorePluginsAdmin/vue/src/SaveButton/SaveButton.vue new file mode 100644 index 0000000000..9d2d9bc00d --- /dev/null +++ b/plugins/CorePluginsAdmin/vue/src/SaveButton/SaveButton.vue @@ -0,0 +1,42 @@ +<!-- + Matomo - free/libre analytics platform + @link https://matomo.org + @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later +--> + +<template> + <div class="matomo-save-button" style="display:inline-block;"> + <input + type="button" + @click="onConfirm($event)" + :disabled="saving || disabled" + class="btn" + :value="value ? value : translate('General_Save')" + /> + <ActivityIndicator + :loading="saving" + /> + </div> +</template> + +<script lang="ts"> +import { defineComponent } from 'vue'; +import { ActivityIndicator } from 'CoreHome'; + +export default defineComponent({ + props: { + saving: Boolean, + value: String, + disabled: Boolean, + }, + components: { + ActivityIndicator, + }, + emits: ['confirm'], + methods: { + onConfirm($event) { + this.$emit('confirm', $event); + }, + }, +}); +</script> diff --git a/plugins/CorePluginsAdmin/vue/src/index.ts b/plugins/CorePluginsAdmin/vue/src/index.ts index cc4b7ba1b8..ea1f7b9f41 100644 --- a/plugins/CorePluginsAdmin/vue/src/index.ts +++ b/plugins/CorePluginsAdmin/vue/src/index.ts @@ -7,7 +7,17 @@ import './FormField/FormField.adapter'; import './Field/Field.adapter'; import './PluginSettings/PluginSettings.adapter'; +import './Plugins/PluginManagement.adapter'; +import './Plugins/PluginUpload.adapter'; +import './Plugins/PluginFilter.adapter'; +import './SaveButton/SaveButton.adapter'; +import './Form/Form.adapter'; export { default as FormField } from './FormField/FormField.vue'; export { default as Field } from './Field/Field.vue'; export { default as PluginSettings } from './PluginSettings/PluginSettings.vue'; +export { default as PluginFilter } from './Plugins/PluginFilter'; +export { default as PluginManagement } from './Plugins/PluginManagement'; +export { default as PluginUpload } from './Plugins/PluginUpload'; +export { default as SaveButton } from './SaveButton/SaveButton.vue'; +export { default as Form } from './Form/Form'; |