diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2022-04-11 17:57:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-11 17:57:52 +0300 |
commit | 5531607b5d17ab67957eb4ab092f5cd20232fc07 (patch) | |
tree | 37767aca7a8d2ee93a812150d359596ca6fa35ed /plugins | |
parent | 8a8b51243641b08064a1b57813da711e96e76298 (diff) |
[Vue] migrate opt-out-customizer to Vue (#19003)
* migrate opt-out-customizer to vue
* update expected screenshot
* remove angularjs files
* remove left over todo
* built vue files
Co-authored-by: sgiehl <stefan@matomo.org>
Co-authored-by: sgiehl <sgiehl@users.noreply.github.com>
Diffstat (limited to 'plugins')
15 files changed, 459 insertions, 181 deletions
diff --git a/plugins/MobileMessaging/vue/dist/umd.metadata.json b/plugins/MobileMessaging/vue/dist/umd.metadata.json index b0a1ba0ec5..dce4477a3c 100644 --- a/plugins/MobileMessaging/vue/dist/umd.metadata.json +++ b/plugins/MobileMessaging/vue/dist/umd.metadata.json @@ -1,7 +1,6 @@ { "dependsOn": [ "CoreHome", - "CorePluginsAdmin", - "ScheduledReports" + "CorePluginsAdmin" ] }
\ No newline at end of file diff --git a/plugins/PrivacyManager/PrivacyManager.php b/plugins/PrivacyManager/PrivacyManager.php index 130175589d..3b8c24e1ba 100644 --- a/plugins/PrivacyManager/PrivacyManager.php +++ b/plugins/PrivacyManager/PrivacyManager.php @@ -179,7 +179,6 @@ class PrivacyManager extends Plugin public function registerEvents() { return [ - 'AssetManager.getJavaScriptFiles' => 'getJsFiles', 'AssetManager.getStylesheetFiles' => 'getStylesheetFiles', 'Tracker.setTrackerCacheGeneral' => 'setTrackerCacheGeneral', 'Tracker.isExcludedVisit' => [$this->dntChecker, 'checkHeaderInTracker'], @@ -366,15 +365,9 @@ class PrivacyManager extends Plugin $cacheContent['delete_logs_older_than'] = $purgeSettings['delete_logs_older_than']; } - public function getJsFiles(&$jsFiles) - { - $jsFiles[] = "plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.controller.js"; - $jsFiles[] = "plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.directive.js"; - } - public function getStylesheetFiles(&$stylesheets) { - $stylesheets[] = "plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.directive.less"; + $stylesheets[] = "plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.less"; $stylesheets[] = "plugins/PrivacyManager/vue/src/ManageGdpr/ManageGdpr.less"; $stylesheets[] = "plugins/PrivacyManager/stylesheets/gdprOverview.less"; $stylesheets[] = "plugins/PrivacyManager/vue/src/AnonymizeLogData/AnonymizeLogData.less"; diff --git a/plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.controller.js b/plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.controller.js deleted file mode 100644 index 3f5163131c..0000000000 --- a/plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.controller.js +++ /dev/null @@ -1,62 +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 - */ -(function () { - angular.module('piwikApp').controller('OptOutCustomizerController', OptOutCustomizerController); - - OptOutCustomizerController.$inject = ["$scope"]; - - function OptOutCustomizerController($scope) { - var vm = this; - vm.piwikurl = $scope.piwikurl; - vm.language = $scope.language; - vm.fontSizeUnit = 'px'; - vm.fontSizeWithUnit = ''; - vm.backgroundColor = ''; - vm.fontColor = ''; - vm.fontSize = ''; - vm.fontFamily = ''; - vm.updateFontSize = function () { - if (vm.fontSize) { - vm.fontSizeWithUnit = vm.fontSize + vm.fontSizeUnit; - } else { - vm.fontSizeWithUnit = ""; - } - this.onUpdate(); - }; - vm.onUpdate = function () { - if (vm.piwikurl) { - if (vm.backgroundColor === '' && vm.fontColor !== '' && vm.nearlyWhite(vm.fontColor.substr(1))) { - $('#previewIframe').addClass('withBg'); - } else { - $('#previewIframe').removeClass('withBg'); - } - var value = vm.piwikurl + "index.php?module=CoreAdminHome&action=optOut&language=" + vm.language + "&backgroundColor=" + vm.backgroundColor.substr(1) + "&fontColor=" + vm.fontColor.substr(1) + "&fontSize=" + vm.fontSizeWithUnit + "&fontFamily=" + encodeURIComponent(vm.fontFamily); - var isAnimationAlreadyRunning = $('.optOutCustomizer pre').queue('fx').length > 0; - if (value !== vm.iframeUrl && !isAnimationAlreadyRunning) { - $('.optOutCustomizer pre').effect("highlight", {}, 1500); - } - vm.iframeUrl = value; - - } else { - vm.iframeUrl = ""; - }; - } - vm.nearlyWhite = function (hex) { - var bigint = parseInt(hex, 16); - var r = (bigint >> 16) & 255; - var g = (bigint >> 8) & 255; - var b = bigint & 255; - - return (r >= 225 && g >= 225 && b >= 225); - } - vm.onUpdate(); - - $scope.$watch('piwikurl', function (val, oldVal) { - vm.onUpdate(); - }); - } -})(); diff --git a/plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.directive.html b/plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.directive.html deleted file mode 100644 index 1afa765676..0000000000 --- a/plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.directive.html +++ /dev/null @@ -1,52 +0,0 @@ -<div class="optOutCustomizer"> - <p> - {{ 'CoreAdminHome_OptOutExplanation'|translate }} - <span ng-bind-html="'General_ReadThisToLearnMore'|translate:'<a rel=\'noreferrer noopener\' target=\'_blank\' href=\'https://matomo.org/faq/how-to/faq_25918/\'>':'</a>'"></span> - </p> - - <h3>{{ 'PrivacyManager_OptOutCustomize'|translate }}</h3> - <div> - <p> - <span> - {{ 'PrivacyManager_FontColor'|translate }}: - <input type="color" ng-model="optOutCustomizer.fontColor" ng-change="optOutCustomizer.onUpdate()"> - </span> - - <span> - {{ 'PrivacyManager_BackgroundColor'|translate }}: - <input type="color" ng-model="optOutCustomizer.backgroundColor" ng-change="optOutCustomizer.onUpdate()"> - </span> - - <span> - {{ 'PrivacyManager_FontSize'|translate }}: - <input id=FontSizeInput type="number" min="1" max="100" ng-model="optOutCustomizer.fontSize" ng-change="optOutCustomizer.updateFontSize()"> - </span> - - <span> - <select class="browser-default" ng-model="optOutCustomizer.fontSizeUnit" ng-change="optOutCustomizer.updateFontSize()"> - <option value="px">px</option> - <option value="pt">pt</option> - <option value="em">em</option> - <option value="rem">rem</option> - <option value="%">%</option> - </select> - </span> - - <span> - {{ 'PrivacyManager_FontFamily'|translate }}: - <input id=FontFamilyInput type="text" ng-model="optOutCustomizer.fontFamily" ng-change="optOutCustomizer.onUpdate()"> - </span> - - </p> - </div> - </p> - <h3>{{ 'PrivacyManager_OptOutHtmlCode'|translate }}</h3> - <pre piwik-select-on-focus><iframe - style="border: 0; height: 200px; width: 600px;" - src="{{ optOutCustomizer.iframeUrl }}" - ></iframe></pre> - <p ng-bind-html="'CoreAdminHome_OptOutExplanationIntro'|translate:'<a href=\'' + optOutCustomizer.iframeUrl + '\' rel=\'noreferrer noopener\' target=\'_blank\'>':'</a>'"> - </p> - <h3>{{ 'PrivacyManager_OptOutPreview'|translate }}</h3> - <iframe id="previewIframe" ng-src="{{ optOutCustomizer.iframeUrl }}" style="border: 1px solid #333; height: 200px; width: 600px;" /> -</div> diff --git a/plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.directive.js b/plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.directive.js deleted file mode 100644 index c85a7cb4ab..0000000000 --- a/plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.directive.js +++ /dev/null @@ -1,45 +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-opt-out-customizer> - */ -(function () { - angular.module('piwikApp').directive('piwikOptOutCustomizer', piwikOptOutCustomizer); - - piwikOptOutCustomizer.$inject = ['piwik']; - - function piwikOptOutCustomizer(piwik){ - var defaults = { - // showAllSitesItem: 'true' - }; - - return { - restrict: 'A', - scope: { - language: '@', - piwikurl: '@' - }, - templateUrl: 'plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.directive.html?cb=' + piwik.cacheBuster, - controller: 'OptOutCustomizerController', - controllerAs: 'optOutCustomizer', - compile: function (element, attrs) { - - for (var index in defaults) { - if (defaults.hasOwnProperty(index) && attrs[index] === undefined) { - attrs[index] = defaults[index]; - } - } - - return function (scope, element, attrs) { - - }; - } - }; - } -})();
\ No newline at end of file diff --git a/plugins/PrivacyManager/templates/usersOptOut.twig b/plugins/PrivacyManager/templates/usersOptOut.twig index c9def239b9..8d8af0e218 100644 --- a/plugins/PrivacyManager/templates/usersOptOut.twig +++ b/plugins/PrivacyManager/templates/usersOptOut.twig @@ -4,8 +4,7 @@ {% block content %} <div piwik-content-block content-title="{{ 'PrivacyManager_TrackingOptOut'|translate|e('html_attr') }}"> - <div piwik-opt-out-customizer piwikurl="{{ piwikUrl }}" language="{{ language }}"> - + <div vue-entry="PrivacyManager.OptOutCustomizer" piwikurl="{{ piwikUrl }}" language="{{ language }}"> </div> </div> diff --git a/plugins/PrivacyManager/tests/UI/expected-screenshots/PrivacyManager_users_opt_out_default.png b/plugins/PrivacyManager/tests/UI/expected-screenshots/PrivacyManager_users_opt_out_default.png index 983273e198..1e1ad7a3ae 100644 --- a/plugins/PrivacyManager/tests/UI/expected-screenshots/PrivacyManager_users_opt_out_default.png +++ b/plugins/PrivacyManager/tests/UI/expected-screenshots/PrivacyManager_users_opt_out_default.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:198f5b0776e315bee6cee74b29c8c2bdeef6d266137191a967e09577a779841a -size 154938 +oid sha256:eec1af1a85700d4dee52736d02efc228a9cca205dccf0801e6179a178ff32841 +size 153732 diff --git a/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.js b/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.js index 7c48fb405b..27f00026f5 100644 --- a/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.js +++ b/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.js @@ -134,6 +134,7 @@ __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, "ManageGdpr", function() { return /* reexport */ ManageGdpr; }); __webpack_require__.d(__webpack_exports__, "AnonymizeIp", function() { return /* reexport */ AnonymizeIp; }); +__webpack_require__.d(__webpack_exports__, "OptOutCustomizer", function() { return /* reexport */ OptOutCustomizer; }); __webpack_require__.d(__webpack_exports__, "AnonymizeLogData", function() { return /* reexport */ AnonymizeLogData; }); __webpack_require__.d(__webpack_exports__, "DoNotTrackPreference", function() { return /* reexport */ DoNotTrackPreference; }); __webpack_require__.d(__webpack_exports__, "ReportDeletionSettings", function() { return /* reexport */ ReportDeletionSettings_store; }); @@ -818,6 +819,207 @@ function AnonymizeIpvue_type_template_id_536c794c_render(_ctx, _cache, $props, $ AnonymizeIpvue_type_script_lang_ts.render = AnonymizeIpvue_type_template_id_536c794c_render /* harmony default export */ var AnonymizeIp = (AnonymizeIpvue_type_script_lang_ts); +// 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/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.vue?vue&type=template&id=7ea00f35 + +var OptOutCustomizervue_type_template_id_7ea00f35_hoisted_1 = { + class: "optOutCustomizer" +}; +var OptOutCustomizervue_type_template_id_7ea00f35_hoisted_2 = ["innerHTML"]; +var OptOutCustomizervue_type_template_id_7ea00f35_hoisted_3 = ["value"]; +var OptOutCustomizervue_type_template_id_7ea00f35_hoisted_4 = ["value"]; + +var OptOutCustomizervue_type_template_id_7ea00f35_hoisted_5 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createStaticVNode"])("<option value=\"px\">px</option><option value=\"pt\">pt</option><option value=\"em\">em</option><option value=\"rem\">rem</option><option value=\"%\">%</option>", 5); + +var OptOutCustomizervue_type_template_id_7ea00f35_hoisted_10 = [OptOutCustomizervue_type_template_id_7ea00f35_hoisted_5]; +var OptOutCustomizervue_type_template_id_7ea00f35_hoisted_11 = { + ref: "pre" +}; +var OptOutCustomizervue_type_template_id_7ea00f35_hoisted_12 = ["innerHTML"]; +var OptOutCustomizervue_type_template_id_7ea00f35_hoisted_13 = ["src"]; +function OptOutCustomizervue_type_template_id_7ea00f35_render(_ctx, _cache, $props, $setup, $data, $options) { + var _directive_select_on_focus = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("select-on-focus"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", OptOutCustomizervue_type_template_id_7ea00f35_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('CoreAdminHome_OptOutExplanation')) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + innerHTML: _ctx.$sanitize(_ctx.readThisToLearnMore) + }, null, 8, OptOutCustomizervue_type_template_id_7ea00f35_hoisted_2)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_OptOutCustomize')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_FontColor')) + ": ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "color", + value: _ctx.fontColor, + onKeydown: _cache[0] || (_cache[0] = function ($event) { + return _ctx.onFontColorChange($event); + }), + onChange: _cache[1] || (_cache[1] = function ($event) { + return _ctx.onFontColorChange($event); + }) + }, null, 40, OptOutCustomizervue_type_template_id_7ea00f35_hoisted_3)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_BackgroundColor')) + ": ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "color", + value: _ctx.backgroundColor, + onKeydown: _cache[2] || (_cache[2] = function ($event) { + return _ctx.onBgColorChange($event); + }), + onChange: _cache[3] || (_cache[3] = function ($event) { + return _ctx.onBgColorChange($event); + }) + }, null, 40, OptOutCustomizervue_type_template_id_7ea00f35_hoisted_4)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_FontSize')) + ": ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + id: "FontSizeInput", + type: "number", + min: "1", + max: "100", + onKeydown: _cache[4] || (_cache[4] = function ($event) { + return _ctx.onFontSizeChange($event); + }), + onChange: _cache[5] || (_cache[5] = function ($event) { + return _ctx.onFontSizeChange($event); + }) + }, null, 32)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("select", { + class: "browser-default", + onKeydown: _cache[6] || (_cache[6] = function ($event) { + return _ctx.onFontSizeUnitChange($event); + }), + onChange: _cache[7] || (_cache[7] = function ($event) { + return _ctx.onFontSizeUnitChange($event); + }) + }, OptOutCustomizervue_type_template_id_7ea00f35_hoisted_10, 32)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_FontFamily')) + ": ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + id: "FontFamilyInput", + type: "text", + onKeydown: _cache[8] || (_cache[8] = function ($event) { + return _ctx.onFontFamilyChange($event); + }), + onChange: _cache[9] || (_cache[9] = function ($event) { + return _ctx.onFontFamilyChange($event); + }) + }, null, 32)])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_OptOutHtmlCode')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("pre", OptOutCustomizervue_type_template_id_7ea00f35_hoisted_11, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])("<iframe\n style=\"border: 0; height: 200px; width: 600px;\"\n src=\"" + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.iframeUrl) + "\"\n ></iframe>", 1)], 512), [[_directive_select_on_focus, {}]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", { + innerHTML: _ctx.$sanitize(_ctx.optOutExplanationIntro) + }, null, 8, OptOutCustomizervue_type_template_id_7ea00f35_hoisted_12), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_OptOutPreview')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("iframe", { + id: "previewIframe", + style: { + "border": "1px solid #333", + "height": "200px", + "width": "600px" + }, + src: _ctx.iframeUrl, + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])({ + withBg: _ctx.withBg + }) + }, null, 10, OptOutCustomizervue_type_template_id_7ea00f35_hoisted_13)]); +} +// CONCATENATED MODULE: ./plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.vue?vue&type=template&id=7ea00f35 + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./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/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.vue?vue&type=script&lang=ts +/* eslint-disable no-mixed-operators */ + +/* eslint-disable no-bitwise */ + + + +function nearlyWhite(hex) { + var bigint = parseInt(hex, 16); + var r = bigint >> 16 & 255; + var g = bigint >> 8 & 255; + var b = bigint & 255; + return r >= 225 && g >= 225 && b >= 225; +} + +var _window = window, + OptOutCustomizervue_type_script_lang_ts_$ = _window.$; +/* harmony default export */ var OptOutCustomizervue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + language: { + type: String, + required: true + }, + piwikurl: String + }, + directives: { + SelectOnFocus: external_CoreHome_["SelectOnFocus"] + }, + data: function data() { + return { + fontSizeUnit: 'px', + backgroundColor: '', + fontColor: '', + fontSize: '', + fontFamily: '' + }; + }, + created: function created() { + this.onFontColorChange = Object(external_CoreHome_["debounce"])(this.onFontColorChange, 50); + this.onBgColorChange = Object(external_CoreHome_["debounce"])(this.onBgColorChange, 50); + this.onFontSizeChange = Object(external_CoreHome_["debounce"])(this.onFontSizeChange, 50); + this.onFontSizeUnitChange = Object(external_CoreHome_["debounce"])(this.onFontSizeUnitChange, 50); + this.onFontFamilyChange = Object(external_CoreHome_["debounce"])(this.onFontFamilyChange, 50); + }, + methods: { + onFontColorChange: function onFontColorChange(event) { + this.fontColor = event.target.value; + }, + onBgColorChange: function onBgColorChange(event) { + this.backgroundColor = event.target.value; + }, + onFontSizeChange: function onFontSizeChange(event) { + this.fontSize = event.target.value; + }, + onFontSizeUnitChange: function onFontSizeUnitChange(event) { + this.fontSizeUnit = event.target.value; + }, + onFontFamilyChange: function onFontFamilyChange(event) { + this.fontFamily = event.target.value; + } + }, + watch: { + iframeUrl: function iframeUrl() { + var pre = this.$refs.pre; + var isAnimationAlreadyRunning = OptOutCustomizervue_type_script_lang_ts_$(pre).queue('fx').length > 0; + + if (!isAnimationAlreadyRunning) { + OptOutCustomizervue_type_script_lang_ts_$(pre).effect('highlight', {}, 1500); + } + } + }, + computed: { + fontSizeWithUnit: function fontSizeWithUnit() { + if (this.fontSize) { + return "".concat(this.fontSize).concat(this.fontSizeUnit); + } + + return ''; + }, + withBg: function withBg() { + return !!this.piwikurl && this.backgroundColor === '' && this.fontColor !== '' && nearlyWhite(this.fontColor.substr(1)); + }, + iframeUrl: function iframeUrl() { + if (this.piwikurl) { + var query = external_CoreHome_["MatomoUrl"].stringify({ + module: 'CoreAdminHome', + action: 'optOut', + language: this.language, + backgroundColor: this.backgroundColor.substr(1), + fontColor: this.fontColor.substr(1), + fontSize: this.fontSizeWithUnit, + fontFamily: this.fontFamily + }); + return "".concat(this.piwikurl, "index.php?").concat(query); + } + + return ''; + }, + readThisToLearnMore: function readThisToLearnMore() { + var link = 'https://matomo.org/faq/how-to/faq_25918/'; + return Object(external_CoreHome_["translate"])('General_ReadThisToLearnMore', "<a rel='noreferrer noopener' target='_blank' href='".concat(link, "'>"), '</a>'); + }, + optOutExplanationIntro: function optOutExplanationIntro() { + return Object(external_CoreHome_["translate"])('CoreAdminHome_OptOutExplanationIntro', "<a href=\"".concat(this.iframeUrl, "\" rel=\"noreferrer noopener\" target=\"_blank\">"), '</a>'); + } + } +})); +// CONCATENATED MODULE: ./plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.vue + + + +OptOutCustomizervue_type_script_lang_ts.render = OptOutCustomizervue_type_template_id_7ea00f35_render + +/* harmony default export */ var OptOutCustomizer = (OptOutCustomizervue_type_script_lang_ts); // 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/PrivacyManager/vue/src/AnonymizeLogData/AnonymizeLogData.vue?vue&type=template&id=bdf32a0e var AnonymizeLogDatavue_type_template_id_bdf32a0e_hoisted_1 = { @@ -1544,8 +1746,8 @@ function DeleteOldLogsvue_type_template_id_2d91a21d_render(_ctx, _cache, $props, -var _window = window, - DeleteOldLogsvue_type_script_lang_ts_$ = _window.$; +var DeleteOldLogsvue_type_script_lang_ts_window = window, + DeleteOldLogsvue_type_script_lang_ts_$ = DeleteOldLogsvue_type_script_lang_ts_window.$; /* harmony default export */ var DeleteOldLogsvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ props: { isDataPurgeSettingsEnabled: Boolean, @@ -2123,6 +2325,7 @@ ScheduleReportDeletionvue_type_script_lang_ts.render = ScheduleReportDeletionvue + // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js diff --git a/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.min.js b/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.min.js index 6d27e42721..44139e19f0 100644 --- a/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.min.js +++ b/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.min.js @@ -1,10 +1,10 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin"),require("SegmentEditor")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin","SegmentEditor"],t):"object"===typeof exports?exports["PrivacyManager"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin"),require("SegmentEditor")):e["PrivacyManager"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"],e["SegmentEditor"])})("undefined"!==typeof self?self:this,(function(e,t,n,a){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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 a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},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/PrivacyManager/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},f06f:function(e,t){e.exports=a},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"ManageGdpr",(function(){return ne})),n.d(t,"AnonymizeIp",(function(){return be})),n.d(t,"AnonymizeLogData",(function(){return et})),n.d(t,"DoNotTrackPreference",(function(){return at})),n.d(t,"ReportDeletionSettings",(function(){return st})),n.d(t,"DeleteOldLogs",(function(){return Ot})),n.d(t,"DeleteOldReports",(function(){return Mt})),n.d(t,"ScheduleReportDeletion",(function(){return Yt})),"undefined"!==typeof window){var a=window.document.currentScript,i=a&&a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var o=n("8bbf"),l={class:"manageGdpr"},r={class:"intro"},c=Object(o["createElementVNode"])("br",null,null,-1),s=Object(o["createElementVNode"])("br",null,null,-1),d=Object(o["createElementVNode"])("br",null,null,-1),u=Object(o["createElementVNode"])("br",null,null,-1),m=["innerHTML"],b={class:"form-group row"},p={class:"col s12 input-field"},v={for:"gdprsite",class:"siteSelectorLabel"},g={class:"sites_autocomplete"},j={class:"form-group row segmentFilterGroup"},h={class:"col s12"},O={style:{margin:"8px 0",display:"inline-block"}},f=Object(o["createElementVNode"])("br",null,null,-1),y=Object(o["createTextVNode"])(),V=Object(o["createElementVNode"])("br",null,null,-1),D=Object(o["createElementVNode"])("br",null,null,-1),S=Object(o["createElementVNode"])("br",null,null,-1),N={class:"checkInclude"},E={colspan:"8"},_=["title"],k={class:"checkInclude"},P=["title"],C={class:"visitId"},M={class:"visitorId"},w=["title","onClick"],A={class:"visitorIp"},I=["title","onClick"],z={class:"userId"},L=["title","onClick"],T=["title"],F=["src"],x=["title"],B=["src"],R=["title"],U=["src"],G=["title"],H=["src"],q=["onClick"],K=Object(o["createElementVNode"])("img",{src:"plugins/Live/images/visitorProfileLaunch.png",style:{"margin-right":"3.5px"}},null,-1),W={class:"ui-confirm",id:"confirmDeleteDataSubject",ref:"confirmDeleteDataSubject"},Y=["value"],J=["value"];function Q(e,t,n,a,i,$){var Q=Object(o["resolveComponent"])("SiteSelector"),X=Object(o["resolveComponent"])("SegmentGenerator"),Z=Object(o["resolveComponent"])("SaveButton"),ee=Object(o["resolveComponent"])("ContentBlock"),te=Object(o["resolveComponent"])("Field"),ne=Object(o["resolveDirective"])("content-table");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",l,[Object(o["createVNode"])(ee,{"content-title":e.translate("PrivacyManager_GdprTools")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("div",r,[Object(o["createElementVNode"])("p",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntro1"))+" ",1),c,s,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntro2"))+" ",1),d]),Object(o["createElementVNode"])("ol",null,[Object(o["createElementVNode"])("li",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntroAccessRight")),1),Object(o["createElementVNode"])("li",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntroEraseRight")),1)]),Object(o["createElementVNode"])("p",null,[u,Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.overviewHintText)},null,8,m)])]),Object(o["createElementVNode"])("h3",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_SearchForDataSubject")),1),Object(o["createElementVNode"])("div",b,[Object(o["createElementVNode"])("div",p,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",v,Object(o["toDisplayString"])(e.translate("PrivacyManager_SelectWebsite")),1),Object(o["createElementVNode"])("div",g,[Object(o["createVNode"])(Q,{id:"gdprsite",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),"show-all-sites-item":!0,"switch-site-on-select":!1,"show-selected-site":!0},null,8,["modelValue"])])])])]),Object(o["createElementVNode"])("div",j,[Object(o["createElementVNode"])("div",h,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",O,Object(o["toDisplayString"])(e.translate("PrivacyManager_FindDataSubjectsBy")),1),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(X,{modelValue:e.segment_filter,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.segment_filter=t}),"visit-segments-only":!0,idsite:e.site.id},null,8,["modelValue","idsite"])])])])]),Object(o["createVNode"])(Z,{class:"findDataSubjects",value:e.translate("PrivacyManager_FindMatchingDataSubjects"),onConfirm:t[2]||(t[2]=function(t){return e.findDataSubjects()}),disabled:!e.segment_filter,saving:e.isLoading},null,8,["value","disabled","saving"])]})),_:1},8,["content-title"]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_NoDataSubjectsFound")),1)],512),[[o["vShow"],!e.dataSubjects.length&&e.hasSearched]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_MatchingDataSubjects")),1),Object(o["createElementVNode"])("p",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("PrivacyManager_VisitsMatchedCriteria"))+" "+Object(o["toDisplayString"])(e.translate("PrivacyManager_ExportingNote"))+" ",1),f,y,V,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("PrivacyManager_DeletionFromMatomoOnly"))+" ",1),D,S,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("PrivacyManager_ResultIncludesAllVisits")),1)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("table",null,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",N,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(te,{uicontrol:"checkbox",name:"activateAll","model-value":e.toggleAll,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.toggleAll=t,e.toggleActivateAll()}),"full-width":!0},null,8,["model-value"])])]),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Website")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_VisitId")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_VisitorID")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_VisitorIP")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_UserId")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Details")),1),Object(o["withDirectives"])(Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Action")),513),[[o["vShow"],e.profileEnabled]])])]),Object(o["createElementVNode"])("tbody",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("td",E,Object(o["toDisplayString"])(e.translate("PrivacyManager_ResultTruncated","400")),1)],512),[[o["vShow"],e.dataSubjects.length>400]]),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.dataSubjects,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{title:"".concat(e.translate("PrivacyManager_LastAction"),": ").concat(t.lastActionDateTime),key:n},[Object(o["createElementVNode"])("td",k,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(te,{uicontrol:"checkbox",name:"subject".concat(t.idVisit),modelValue:e.dataSubjectsActive[n],"onUpdate:modelValue":function(t){return e.dataSubjectsActive[n]=t},"full-width":!0},null,8,["name","modelValue","onUpdate:modelValue"])])]),Object(o["createElementVNode"])("td",{class:"site",title:"(".concat(e.translate("General_Id")," ").concat(t.idSite,")")},Object(o["toDisplayString"])(t.siteName),9,P),Object(o["createElementVNode"])("td",C,Object(o["toDisplayString"])(t.idVisit),1),Object(o["createElementVNode"])("td",M,[Object(o["createElementVNode"])("a",{title:e.translate("PrivacyManager_AddVisitorIdToSearch"),onClick:function(n){return e.addFilter("visitorId",t.visitorId)}},Object(o["toDisplayString"])(t.visitorId),9,w)]),Object(o["createElementVNode"])("td",A,[Object(o["createElementVNode"])("a",{title:e.translate("PrivacyManager_AddVisitorIPToSearch"),onClick:function(n){return e.addFilter("visitIp",t.visitIp)}},Object(o["toDisplayString"])(t.visitIp),9,I)]),Object(o["createElementVNode"])("td",z,[Object(o["createElementVNode"])("a",{title:e.translate("PrivacyManager_AddUserIdToSearch"),onClick:function(n){return e.addFilter("userId",t.userId)}},Object(o["toDisplayString"])(t.userId),9,L)]),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("span",{title:"".concat(t.deviceType," ").concat(t.deviceModel),style:{"margin-right":"3.5px"}},[Object(o["createElementVNode"])("img",{height:"16",src:t.deviceTypeIcon},null,8,F)],8,T),Object(o["createElementVNode"])("span",{title:t.operatingSystem,style:{"margin-right":"3.5px"}},[Object(o["createElementVNode"])("img",{height:"16",src:t.operatingSystemIcon},null,8,B)],8,x),Object(o["createElementVNode"])("span",{title:"".concat(t.browser," ").concat(t.browserFamilyDescription),style:{"margin-right":"3.5px"}},[Object(o["createElementVNode"])("img",{height:"16",src:t.browserIcon},null,8,U)],8,R),Object(o["createElementVNode"])("span",{title:"".concat(t.country," ").concat(t.region||"")},[Object(o["createElementVNode"])("img",{height:"16",src:t.countryFlag},null,8,H)],8,G)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("a",{class:"visitorLogTooltip",title:"View visitor profile",onClick:function(n){return e.showProfile(t.visitorId,t.idSite)}},[K,Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.translate("Live_ViewVisitorProfile")),1)],8,q)],512),[[o["vShow"],e.profileEnabled]])],8,_)})),128))])],512),[[ne]]),Object(o["createVNode"])(Z,{class:"exportDataSubjects",style:{"margin-right":"3.5px"},onConfirm:t[4]||(t[4]=function(t){return e.exportDataSubject()}),disabled:!e.hasActiveDataSubjects,value:e.translate("PrivacyManager_ExportSelectedVisits")},null,8,["disabled","value"]),Object(o["createVNode"])(Z,{class:"deleteDataSubjects",onConfirm:t[5]||(t[5]=function(t){return e.deleteDataSubject()}),disabled:!e.hasActiveDataSubjects||e.isDeleting,value:e.translate("PrivacyManager_DeleteSelectedVisits")},null,8,["disabled","value"])],512),[[o["vShow"],e.dataSubjects.length]]),Object(o["createElementVNode"])("div",W,[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_DeleteVisitsConfirm")),1),Object(o["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,Y),Object(o["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,J)],512)])}var X=n("19dc"),Z=n("f06f"),ee=n("a5a2"),te=Object(o["defineComponent"])({components:{ContentBlock:X["ContentBlock"],SiteSelector:X["SiteSelector"],SegmentGenerator:Z["SegmentGenerator"],SaveButton:ee["SaveButton"],Field:ee["Field"]},directives:{ContentTable:X["ContentTable"]},data:function(){return{isLoading:!1,isDeleting:!1,site:{id:"all",name:Object(X["translate"])("UsersManager_AllWebsites")},segment_filter:"userId==",dataSubjects:[],toggleAll:!0,hasSearched:!1,profileEnabled:X["Matomo"].visitorProfileEnabled,dataSubjectsActive:[]}},setup:function(){var e=X["AjaxHelper"].fetch({method:"SitesManager.getSitesIdWithAdminAccess",filter_limit:"-1"});return{getSites:function(){return e}}},methods:{showSuccessNotification:function(e){var t=X["NotificationsStore"].show({message:e,context:"success",id:"manageGdpr",type:"transient"});setTimeout((function(){X["NotificationsStore"].scrollToNotification(t)}),200)},linkTo:function(e){return"?".concat(X["MatomoUrl"].stringify(Object.assign(Object.assign({},X["MatomoUrl"].urlParsed.value),{},{module:"PrivacyManager",action:e})))},toggleActivateAll:function(){this.dataSubjectsActive.fill(this.toggleAll)},showProfile:function(e,t){X["Matomo"].helper.showVisitorProfilePopup(e,t)},exportDataSubject:function(){var e=this,t=this.activatedDataSubjects;X["AjaxHelper"].post({module:"API",method:"PrivacyManager.exportDataSubjects",format:"json",filter_limit:-1},{visits:t}).then((function(t){e.showSuccessNotification(Object(X["translate"])("PrivacyManager_VisitsSuccessfullyExported")),X["Matomo"].helper.sendContentAsDownload("exported_data_subjects.json",JSON.stringify(t))}))},deleteDataSubject:function(){var e=this;X["Matomo"].helper.modalConfirm(this.$refs.confirmDeleteDataSubject,{yes:function(){e.isDeleting=!0;var t=e.activatedDataSubjects;X["AjaxHelper"].post({module:"API",method:"PrivacyManager.deleteDataSubjects",filter_limit:-1},{visits:t}).then((function(){e.dataSubjects=[],e.showSuccessNotification(Object(X["translate"])("PrivacyManager_VisitsSuccessfullyDeleted")),e.findDataSubjects()})).finally((function(){e.isDeleting=!1}))}})},addFilter:function(e,t){this.segment_filter+=",".concat(e,"==").concat(t),this.findDataSubjects()},findDataSubjects:function(){var e=this;this.dataSubjects=[],this.dataSubjectsActive=[],this.isLoading=!0,this.toggleAll=!0,this.hasSearched=!1,this.getSites().then((function(t){var n=e.site.id;"all"!==n||X["Matomo"].hasSuperUserAccess||(n=t,Array.isArray(t)&&(n=t.join(","))),X["AjaxHelper"].fetch({idSite:n,module:"API",method:"PrivacyManager.findDataSubjects",segment:e.segment_filter}).then((function(t){e.hasSearched=!0,e.dataSubjectsActive=t.map((function(){return!0})),e.dataSubjects=t})).finally((function(){e.isLoading=!1}))}))}},computed:{hasActiveDataSubjects:function(){return!!this.activatedDataSubjects.length},activatedDataSubjects:function(){var e=this;return this.dataSubjects.filter((function(t,n){return e.dataSubjectsActive[n]})).map((function(e){return{idsite:e.idSite,idvisit:e.idVisit}}))},overviewHintText:function(){return Object(X["translate"])("PrivacyManager_GdprToolsOverviewHint",'<a href="'.concat(this.linkTo("gdprOverview"),'">'),"</a>")}}});te.render=Q;var ne=te,ae=Object(o["createElementVNode"])("br",null,null,-1),ie=Object(o["createElementVNode"])("br",null,null,-1),oe=Object(o["createElementVNode"])("br",null,null,-1),le=Object(o["createElementVNode"])("br",null,null,-1),re={key:0},ce=Object(o["createElementVNode"])("br",null,null,-1),se=Object(o["createElementVNode"])("br",null,null,-1),de={class:"alert-warning alert"};function ue(e,t,n,a,i,l){var r=Object(o["resolveComponent"])("Field"),c=Object(o["resolveComponent"])("SaveButton"),s=Object(o["resolveDirective"])("form");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"anonymizeIpSettings",title:e.translate("PrivacyManager_UseAnonymizeIp"),modelValue:e.actualEnabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.actualEnabled=t}),"inline-help":e.anonymizeIpEnabledHelp},null,8,["title","modelValue","inline-help"])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"radio",name:"maskLength",title:e.translate("PrivacyManager_AnonymizeIpMaskLengtDescription"),modelValue:e.actualMaskLength,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.actualMaskLength=t}),options:e.maskLengthOptions,"inline-help":e.translate("PrivacyManager_GeolocationAnonymizeIpNote")},null,8,["title","modelValue","options","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"radio",name:"useAnonymizedIpForVisitEnrichment",title:e.translate("PrivacyManager_UseAnonymizedIpForVisitEnrichment"),modelValue:e.actualUseAnonymizedIpForVisitEnrichment,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.actualUseAnonymizedIpForVisitEnrichment=t}),options:e.useAnonymizedIpForVisitEnrichmentOptions,"inline-help":e.translate("PrivacyManager_UseAnonymizedIpForVisitEnrichmentNote")},null,8,["title","modelValue","options","inline-help"])])],512),[[o["vShow"],e.actualEnabled]]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"anonymizeUserId",title:e.translate("PrivacyManager_PseudonymizeUserId"),modelValue:e.actualAnonymizeUserId,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.actualAnonymizeUserId=t})},{"inline-help":Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("PrivacyManager_PseudonymizeUserIdNote"))+" ",1),ae,ie,Object(o["createElementVNode"])("em",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_PseudonymizeUserIdNote2")),1)]})),_:1},8,["title","modelValue"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"anonymizeOrderId",title:e.translate("PrivacyManager_UseAnonymizeOrderId"),modelValue:e.actualAnonymizeOrderId,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.actualAnonymizeOrderId=t}),"inline-help":e.translate("PrivacyManager_AnonymizeOrderIdNote")},null,8,["title","modelValue","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"forceCookielessTracking",title:e.translate("PrivacyManager_ForceCookielessTracking"),modelValue:e.actualForceCookielessTracking,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.actualForceCookielessTracking=t})},{"inline-help":Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescription",e.trackerFileName))+" ",1),oe,le,Object(o["createElementVNode"])("em",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescription2")),1),e.trackerWritable?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",re,[ce,se,Object(o["createElementVNode"])("p",de,Object(o["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescriptionNotWritable",e.trackerFileName)),1)]))]})),_:1},8,["title","modelValue"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"select",name:"anonymizeReferrer",title:e.translate("PrivacyManager_AnonymizeReferrer"),modelValue:e.actualAnonymizeReferrer,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.actualAnonymizeReferrer=t}),options:e.referrerAnonymizationOptions,"inline-help":e.translate("PrivacyManager_AnonymizeReferrerNote")},null,8,["title","modelValue","options","inline-help"])]),Object(o["createVNode"])(c,{onConfirm:t[7]||(t[7]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[s]])}var me=Object(o["defineComponent"])({props:{anonymizeIpEnabled:Boolean,anonymizeUserId:Boolean,maskLength:{type:Number,required:!0},useAnonymizedIpForVisitEnrichment:Boolean,anonymizeOrderId:Boolean,forceCookielessTracking:Boolean,anonymizeReferrer:String,maskLengthOptions:{type:Array,required:!0},useAnonymizedIpForVisitEnrichmentOptions:{type:Array,required:!0},trackerFileName:{type:String,required:!0},trackerWritable:{type:Boolean,required:!0},referrerAnonymizationOptions:{type:Object,required:!0}},components:{Field:ee["Field"],SaveButton:ee["SaveButton"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,actualEnabled:!!this.anonymizeIpEnabled,actualMaskLength:this.maskLength,actualUseAnonymizedIpForVisitEnrichment:this.useAnonymizedIpForVisitEnrichment?"1":"0",actualAnonymizeUserId:!!this.anonymizeUserId,actualAnonymizeOrderId:!!this.anonymizeOrderId,actualForceCookielessTracking:!!this.forceCookielessTracking,actualAnonymizeReferrer:this.anonymizeReferrer}},methods:{save:function(){var e=this;this.isLoading=!0,X["AjaxHelper"].post({module:"API",method:"PrivacyManager.setAnonymizeIpSettings"},{anonymizeIPEnable:this.actualEnabled?"1":"0",anonymizeUserId:this.actualAnonymizeUserId?"1":"0",anonymizeOrderId:this.actualAnonymizeOrderId?"1":"0",forceCookielessTracking:this.actualForceCookielessTracking?"1":"0",anonymizeReferrer:this.actualAnonymizeReferrer?this.actualAnonymizeReferrer:"",maskLength:this.actualMaskLength,useAnonymizedIpForVisitEnrichment:this.actualUseAnonymizedIpForVisitEnrichment?"1":"0"}).then((function(){var e=X["NotificationsStore"].show({message:Object(X["translate"])("CoreAdminHome_SettingsSaveSuccess"),context:"success",id:"privacyManagerSettings",type:"toast"});X["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}},computed:{anonymizeIpEnabledHelp:function(){var e=Object(X["translate"])("PrivacyManager_AnonymizeIpInlineHelp"),t=Object(X["translate"])("PrivacyManager_AnonymizeIpDescription");return"".concat(e," ").concat(t)}}});me.render=ue;var be=me,pe={class:"anonymizeLogData"},ve={class:"form-group row"},ge={class:"col s12 input-field"},je={for:"anonymizeSite",class:"siteSelectorLabel"},he={class:"sites_autocomplete"},Oe={class:"form-group row"},fe={class:"col s6 input-field"},ye={for:"anonymizeStartDate",class:"active"},Ve=["value"],De={class:"col s6 input-field"},Se={for:"anonymizeEndDate",class:"active"},Ne=["value"],Ee={name:"anonymizeIp"},_e={name:"anonymizeLocation"},ke={name:"anonymizeTheUserId"},Pe={class:"form-group row"},Ce={class:"col s12 m6"},Me={for:"visit_columns"},we={class:"innerFormField",name:"visit_columns"},Ae=["onClick","title"],Ie={class:"col s12 m6"},ze={class:"form-help"},Le={class:"inline-help"},Te={class:"form-group row"},Fe={class:"col s12"},xe={class:"form-group row"},Be={class:"col s12 m6"},Re={for:"action_columns"},Ue={class:"innerFormField",name:"action_columns"},Ge=["onClick","title"],He={class:"col s12 m6"},qe={class:"form-help"},Ke={class:"inline-help"},We=Object(o["createElementVNode"])("span",{class:"icon-info"},null,-1),$e={class:"ui-confirm",id:"confirmAnonymizeLogData",ref:"confirmAnonymizeLogData"},Ye=["value"],Je=["value"];function Qe(e,t,n,a,i,l){var r=Object(o["resolveComponent"])("SiteSelector"),c=Object(o["resolveComponent"])("Field"),s=Object(o["resolveComponent"])("SaveButton");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",pe,[Object(o["createElementVNode"])("div",ve,[Object(o["createElementVNode"])("div",ge,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",je,Object(o["toDisplayString"])(e.translate("PrivacyManager_AnonymizeSites")),1),Object(o["createElementVNode"])("div",he,[Object(o["createVNode"])(r,{id:"anonymizeSite",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),"show-all-sites-item":!0,"switch-site-on-select":!1,"show-selected-site":!0},null,8,["modelValue"])])])])]),Object(o["createElementVNode"])("div",Oe,[Object(o["createElementVNode"])("div",fe,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",ye,Object(o["toDisplayString"])(e.translate("PrivacyManager_AnonymizeRowDataFrom")),1),Object(o["createElementVNode"])("input",{type:"text",id:"anonymizeStartDate",class:"anonymizeStartDate",ref:"anonymizeStartDate",name:"anonymizeStartDate",value:e.startDate,onKeydown:t[1]||(t[1]=function(t){return e.onKeydownStartDate(t)}),onChange:t[2]||(t[2]=function(t){return e.onKeydownStartDate(t)})},null,40,Ve)])]),Object(o["createElementVNode"])("div",De,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",Se,Object(o["toDisplayString"])(e.translate("PrivacyManager_AnonymizeRowDataTo")),1),Object(o["createElementVNode"])("input",{type:"text",class:"anonymizeEndDate",id:"anonymizeEndDate",ref:"anonymizeEndDate",name:"anonymizeEndDate",value:e.endDate,onKeydown:t[3]||(t[3]=function(t){return e.onKeydownEndDate(t)}),onChange:t[4]||(t[4]=function(t){return e.onKeydownEndDate(t)})},null,40,Ne)])])]),Object(o["createElementVNode"])("div",Ee,[Object(o["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeIp",title:e.translate("PrivacyManager_AnonymizeIp"),modelValue:e.anonymizeIp,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.anonymizeIp=t}),introduction:e.translate("General_Visit"),"inline-help":e.translate("PrivacyManager_AnonymizeIpHelp")},null,8,["title","modelValue","introduction","inline-help"])]),Object(o["createElementVNode"])("div",_e,[Object(o["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeLocation",title:e.translate("PrivacyManager_AnonymizeLocation"),modelValue:e.anonymizeLocation,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.anonymizeLocation=t}),"inline-help":e.translate("PrivacyManager_AnonymizeLocationHelp")},null,8,["title","modelValue","inline-help"])]),Object(o["createElementVNode"])("div",ke,[Object(o["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeTheUserId",title:e.translate("PrivacyManager_AnonymizeUserId"),modelValue:e.anonymizeUserId,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.anonymizeUserId=t}),"inline-help":e.translate("PrivacyManager_AnonymizeUserIdHelp")},null,8,["title","modelValue","inline-help"])]),Object(o["createElementVNode"])("div",Pe,[Object(o["createElementVNode"])("div",Ce,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",Me,Object(o["toDisplayString"])(e.translate("PrivacyManager_UnsetVisitColumns")),1),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.selectedVisitColumns,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])("selectedVisitColumns selectedVisitColumns".concat(n," multiple valign-wrapper")),key:n},[Object(o["createElementVNode"])("div",we,[Object(o["createVNode"])(c,{uicontrol:"select",name:"visit_columns","model-value":t.column,"onUpdate:modelValue":function(n){t.column=n,e.onVisitColumnChange()},"full-width":!0,options:e.availableVisitColumns},null,8,["model-value","onUpdate:modelValue","options"])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"icon-minus valign",onClick:function(t){return e.removeVisitColumn(n)},title:e.translate("General_Remove")},null,8,Ae),[[o["vShow"],n+1!==e.selectedVisitColumns.length]])],2)})),128))])]),Object(o["createElementVNode"])("div",Ie,[Object(o["createElementVNode"])("div",ze,[Object(o["createElementVNode"])("span",Le,Object(o["toDisplayString"])(e.translate("PrivacyManager_UnsetVisitColumnsHelp")),1)])])]),Object(o["createElementVNode"])("div",Te,[Object(o["createElementVNode"])("div",Fe,[Object(o["createElementVNode"])("h3",null,Object(o["toDisplayString"])(e.translate("General_Action")),1)])]),Object(o["createElementVNode"])("div",xe,[Object(o["createElementVNode"])("div",Be,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("label",Re,Object(o["toDisplayString"])(e.translate("PrivacyManager_UnsetActionColumns")),1),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.selectedActionColumns,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])("selectedActionColumns selectedActionColumns".concat(n," multiple valign-wrapper")),key:n},[Object(o["createElementVNode"])("div",Ue,[Object(o["createVNode"])(c,{uicontrol:"select",name:"action_columns","model-value":t.column,"onUpdate:modelValue":function(n){t.column=n,e.onActionColumnChange()},"full-width":!0,options:e.availableActionColumns},null,8,["model-value","onUpdate:modelValue","options"])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"icon-minus valign",onClick:function(t){return e.removeActionColumn(n)},title:e.translate("General_Remove")},null,8,Ge),[[o["vShow"],n+1!==e.selectedActionColumns.length]])],2)})),128))])]),Object(o["createElementVNode"])("div",He,[Object(o["createElementVNode"])("div",qe,[Object(o["createElementVNode"])("span",Ke,Object(o["toDisplayString"])(e.translate("PrivacyManager_UnsetActionColumnsHelp")),1)])])]),Object(o["createElementVNode"])("p",null,[We,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("PrivacyManager_AnonymizeProcessInfo")),1)]),Object(o["createVNode"])(s,{class:"anonymizePastData",onConfirm:t[8]||(t[8]=function(t){return e.scheduleAnonymization()}),disabled:e.isAnonymizePastDataDisabled,value:e.translate("PrivacyManager_AnonymizeDataNow")},null,8,["disabled","value"]),Object(o["createElementVNode"])("div",$e,[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_AnonymizeDataConfirm")),1),Object(o["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,Ye),Object(o["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,Je)],512)])}function Xe(e){return e<10?"0".concat(e):e}var Ze=Object(o["defineComponent"])({components:{SiteSelector:X["SiteSelector"],Field:ee["Field"],SaveButton:ee["SaveButton"]},data:function(){var e=new Date,t="".concat(e.getFullYear(),"-").concat(Xe(e.getMonth()+1),"-").concat(Xe(e.getDay()+1));return{isLoading:!1,isDeleting:!1,anonymizeIp:!1,anonymizeLocation:!1,anonymizeUserId:!1,site:{id:"all",name:"All Websites"},availableVisitColumns:[],availableActionColumns:[],selectedVisitColumns:[{column:""}],selectedActionColumns:[{column:""}],startDate:t,endDate:t}},created:function(){var e=this;this.onKeydownStartDate=Object(X["debounce"])(this.onKeydownStartDate,50),this.onKeydownEndDate=Object(X["debounce"])(this.onKeydownEndDate,50),X["AjaxHelper"].fetch({method:"PrivacyManager.getAvailableVisitColumnsToAnonymize"}).then((function(t){e.availableVisitColumns=[],t.forEach((function(t){e.availableVisitColumns.push({key:t.column_name,value:t.column_name})}))})),X["AjaxHelper"].fetch({method:"PrivacyManager.getAvailableLinkVisitActionColumnsToAnonymize"}).then((function(t){e.availableActionColumns=[],t.forEach((function(t){e.availableActionColumns.push({key:t.column_name,value:t.column_name})}))})),setTimeout((function(){var t=X["Matomo"].getBaseDatePickerOptions(null),n=X["Matomo"].getBaseDatePickerOptions(null);$(e.$refs.anonymizeStartDate).datepicker(t),$(e.$refs.anonymizeEndDate).datepicker(n)}))},methods:{onVisitColumnChange:function(){var e=this.selectedVisitColumns.every((function(e){return!(null===e||void 0===e||!e.column)}));e&&this.addVisitColumn()},addVisitColumn:function(){this.selectedVisitColumns.push({column:""})},removeVisitColumn:function(e){if(e>-1){var t=this.selectedVisitColumns.length-1;t===e?this.selectedVisitColumns[e]={column:""}:this.selectedVisitColumns.splice(e,1)}},onActionColumnChange:function(){var e=this.selectedActionColumns.every((function(e){return!(null===e||void 0===e||!e.column)}));e&&this.addActionColumn()},addActionColumn:function(){this.selectedActionColumns.push({column:""})},removeActionColumn:function(e){if(e>-1){var t=this.selectedActionColumns.length-1;t===e?this.selectedActionColumns[e]={column:""}:this.selectedActionColumns.splice(e,1)}},scheduleAnonymization:function(){var e="".concat(this.startDate,",").concat(this.endDate);this.startDate===this.endDate&&(e=this.startDate);var t={date:e};t.idSites=this.site.id,t.anonymizeIp=this.anonymizeIp?"1":"0",t.anonymizeLocation=this.anonymizeLocation?"1":"0",t.anonymizeUserId=this.anonymizeUserId?"1":"0",t.unsetVisitColumns=this.selectedVisitColumns.filter((function(e){return!(null===e||void 0===e||!e.column)})).map((function(e){return e.column})),t.unsetLinkVisitActionColumns=this.selectedActionColumns.filter((function(e){return!(null===e||void 0===e||!e.column)})).map((function(e){return e.column})),X["Matomo"].helper.modalConfirm(this.$refs.confirmAnonymizeLogData,{yes:function(){X["AjaxHelper"].post({method:"PrivacyManager.anonymizeSomeRawData"},t).then((function(){window.location.reload(!0)}))}})},onKeydownStartDate:function(e){this.startDate=e.target.value},onKeydownEndDate:function(e){this.endDate=e.target.value}},computed:{isAnonymizePastDataDisabled:function(){return!this.anonymizeIp&&!this.anonymizeLocation&&!this.selectedVisitColumns&&!this.selectedActionColumns}}});Ze.render=Qe;var et=Ze;function tt(e,t,n,a,i,l){var r=Object(o["resolveComponent"])("Field"),c=Object(o["resolveComponent"])("SaveButton"),s=Object(o["resolveDirective"])("form");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"radio",name:"doNotTrack",modelValue:e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.enabled=t}),options:e.doNotTrackOptions,"inline-help":e.translate("PrivacyManager_DoNotTrack_Description")},null,8,["modelValue","options","inline-help"])]),Object(o["createVNode"])(c,{onConfirm:t[1]||(t[1]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[s]])}var nt=Object(o["defineComponent"])({props:{dntSupport:Boolean,doNotTrackOptions:{type:Array,required:!0}},components:{Field:ee["Field"],SaveButton:ee["SaveButton"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,enabled:this.dntSupport?1:0}},methods:{save:function(){var e=this;this.isLoading=!0;var t="deactivateDoNotTrack";this.enabled&&"0"!==this.enabled&&(t="activateDoNotTrack"),X["AjaxHelper"].post({module:"API",method:"PrivacyManager.".concat(t)}).then((function(){var e=X["NotificationsStore"].show({message:Object(X["translate"])("CoreAdminHome_SettingsSaveSuccess"),context:"success",id:"privacyManagerSettings",type:"transient"});X["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}}});nt.render=tt;var at=nt;function it(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ot(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function lt(e,t,n){return t&&ot(e.prototype,t),n&&ot(e,n),e}function rt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin"),require("SegmentEditor")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin","SegmentEditor"],t):"object"===typeof exports?exports["PrivacyManager"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin"),require("SegmentEditor")):e["PrivacyManager"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"],e["SegmentEditor"])})("undefined"!==typeof self?self:this,(function(e,t,n,a){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var o=t[a]={i:a,l:!1,exports:{}};return e[a].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},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 a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(a,o,function(t){return e[t]}.bind(null,o));return a},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/PrivacyManager/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},f06f:function(e,t){e.exports=a},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"ManageGdpr",(function(){return ne})),n.d(t,"AnonymizeIp",(function(){return be})),n.d(t,"OptOutCustomizer",(function(){return ke})),n.d(t,"AnonymizeLogData",(function(){return gt})),n.d(t,"DoNotTrackPreference",(function(){return Ot})),n.d(t,"ReportDeletionSettings",(function(){return Dt})),n.d(t,"DeleteOldLogs",(function(){return zt})),n.d(t,"DeleteOldReports",(function(){return Kt})),n.d(t,"ScheduleReportDeletion",(function(){return un})),"undefined"!==typeof window){var a=window.document.currentScript,o=a&&a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(n.p=o[1])}var i=n("8bbf"),l={class:"manageGdpr"},r={class:"intro"},c=Object(i["createElementVNode"])("br",null,null,-1),s=Object(i["createElementVNode"])("br",null,null,-1),d=Object(i["createElementVNode"])("br",null,null,-1),u=Object(i["createElementVNode"])("br",null,null,-1),m=["innerHTML"],b={class:"form-group row"},p={class:"col s12 input-field"},g={for:"gdprsite",class:"siteSelectorLabel"},v={class:"sites_autocomplete"},h={class:"form-group row segmentFilterGroup"},O={class:"col s12"},j={style:{margin:"8px 0",display:"inline-block"}},f=Object(i["createElementVNode"])("br",null,null,-1),y=Object(i["createTextVNode"])(),V=Object(i["createElementVNode"])("br",null,null,-1),S=Object(i["createElementVNode"])("br",null,null,-1),D=Object(i["createElementVNode"])("br",null,null,-1),N={class:"checkInclude"},E={colspan:"8"},C=["title"],k={class:"checkInclude"},_=["title"],P={class:"visitId"},w={class:"visitorId"},M=["title","onClick"],A={class:"visitorIp"},z=["title","onClick"],I={class:"userId"},F=["title","onClick"],T=["title"],x=["src"],L=["title"],B=["src"],U=["title"],R=["src"],H=["title"],G=["src"],q=["onClick"],K=Object(i["createElementVNode"])("img",{src:"plugins/Live/images/visitorProfileLaunch.png",style:{"margin-right":"3.5px"}},null,-1),W={class:"ui-confirm",id:"confirmDeleteDataSubject",ref:"confirmDeleteDataSubject"},Y=["value"],J=["value"];function Q(e,t,n,a,o,$){var Q=Object(i["resolveComponent"])("SiteSelector"),X=Object(i["resolveComponent"])("SegmentGenerator"),Z=Object(i["resolveComponent"])("SaveButton"),ee=Object(i["resolveComponent"])("ContentBlock"),te=Object(i["resolveComponent"])("Field"),ne=Object(i["resolveDirective"])("content-table");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",l,[Object(i["createVNode"])(ee,{"content-title":e.translate("PrivacyManager_GdprTools")},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",r,[Object(i["createElementVNode"])("p",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntro1"))+" ",1),c,s,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntro2"))+" ",1),d]),Object(i["createElementVNode"])("ol",null,[Object(i["createElementVNode"])("li",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntroAccessRight")),1),Object(i["createElementVNode"])("li",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_GdprToolsPageIntroEraseRight")),1)]),Object(i["createElementVNode"])("p",null,[u,Object(i["createElementVNode"])("span",{innerHTML:e.$sanitize(e.overviewHintText)},null,8,m)])]),Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_SearchForDataSubject")),1),Object(i["createElementVNode"])("div",b,[Object(i["createElementVNode"])("div",p,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",g,Object(i["toDisplayString"])(e.translate("PrivacyManager_SelectWebsite")),1),Object(i["createElementVNode"])("div",v,[Object(i["createVNode"])(Q,{id:"gdprsite",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),"show-all-sites-item":!0,"switch-site-on-select":!1,"show-selected-site":!0},null,8,["modelValue"])])])])]),Object(i["createElementVNode"])("div",h,[Object(i["createElementVNode"])("div",O,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",j,Object(i["toDisplayString"])(e.translate("PrivacyManager_FindDataSubjectsBy")),1),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(X,{modelValue:e.segment_filter,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.segment_filter=t}),"visit-segments-only":!0,idsite:e.site.id},null,8,["modelValue","idsite"])])])])]),Object(i["createVNode"])(Z,{class:"findDataSubjects",value:e.translate("PrivacyManager_FindMatchingDataSubjects"),onConfirm:t[2]||(t[2]=function(t){return e.findDataSubjects()}),disabled:!e.segment_filter,saving:e.isLoading},null,8,["value","disabled","saving"])]})),_:1},8,["content-title"]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_NoDataSubjectsFound")),1)],512),[[i["vShow"],!e.dataSubjects.length&&e.hasSearched]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_MatchingDataSubjects")),1),Object(i["createElementVNode"])("p",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_VisitsMatchedCriteria"))+" "+Object(i["toDisplayString"])(e.translate("PrivacyManager_ExportingNote"))+" ",1),f,y,V,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("PrivacyManager_DeletionFromMatomoOnly"))+" ",1),S,D,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("PrivacyManager_ResultIncludesAllVisits")),1)]),Object(i["withDirectives"])(Object(i["createElementVNode"])("table",null,[Object(i["createElementVNode"])("thead",null,[Object(i["createElementVNode"])("tr",null,[Object(i["createElementVNode"])("th",N,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(te,{uicontrol:"checkbox",name:"activateAll","model-value":e.toggleAll,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.toggleAll=t,e.toggleActivateAll()}),"full-width":!0},null,8,["model-value"])])]),Object(i["createElementVNode"])("th",null,Object(i["toDisplayString"])(e.translate("General_Website")),1),Object(i["createElementVNode"])("th",null,Object(i["toDisplayString"])(e.translate("General_VisitId")),1),Object(i["createElementVNode"])("th",null,Object(i["toDisplayString"])(e.translate("General_VisitorID")),1),Object(i["createElementVNode"])("th",null,Object(i["toDisplayString"])(e.translate("General_VisitorIP")),1),Object(i["createElementVNode"])("th",null,Object(i["toDisplayString"])(e.translate("General_UserId")),1),Object(i["createElementVNode"])("th",null,Object(i["toDisplayString"])(e.translate("General_Details")),1),Object(i["withDirectives"])(Object(i["createElementVNode"])("th",null,Object(i["toDisplayString"])(e.translate("General_Action")),513),[[i["vShow"],e.profileEnabled]])])]),Object(i["createElementVNode"])("tbody",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("tr",null,[Object(i["createElementVNode"])("td",E,Object(i["toDisplayString"])(e.translate("PrivacyManager_ResultTruncated","400")),1)],512),[[i["vShow"],e.dataSubjects.length>400]]),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.dataSubjects,(function(t,n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("tr",{title:"".concat(e.translate("PrivacyManager_LastAction"),": ").concat(t.lastActionDateTime),key:n},[Object(i["createElementVNode"])("td",k,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(te,{uicontrol:"checkbox",name:"subject".concat(t.idVisit),modelValue:e.dataSubjectsActive[n],"onUpdate:modelValue":function(t){return e.dataSubjectsActive[n]=t},"full-width":!0},null,8,["name","modelValue","onUpdate:modelValue"])])]),Object(i["createElementVNode"])("td",{class:"site",title:"(".concat(e.translate("General_Id")," ").concat(t.idSite,")")},Object(i["toDisplayString"])(t.siteName),9,_),Object(i["createElementVNode"])("td",P,Object(i["toDisplayString"])(t.idVisit),1),Object(i["createElementVNode"])("td",w,[Object(i["createElementVNode"])("a",{title:e.translate("PrivacyManager_AddVisitorIdToSearch"),onClick:function(n){return e.addFilter("visitorId",t.visitorId)}},Object(i["toDisplayString"])(t.visitorId),9,M)]),Object(i["createElementVNode"])("td",A,[Object(i["createElementVNode"])("a",{title:e.translate("PrivacyManager_AddVisitorIPToSearch"),onClick:function(n){return e.addFilter("visitIp",t.visitIp)}},Object(i["toDisplayString"])(t.visitIp),9,z)]),Object(i["createElementVNode"])("td",I,[Object(i["createElementVNode"])("a",{title:e.translate("PrivacyManager_AddUserIdToSearch"),onClick:function(n){return e.addFilter("userId",t.userId)}},Object(i["toDisplayString"])(t.userId),9,F)]),Object(i["createElementVNode"])("td",null,[Object(i["createElementVNode"])("span",{title:"".concat(t.deviceType," ").concat(t.deviceModel),style:{"margin-right":"3.5px"}},[Object(i["createElementVNode"])("img",{height:"16",src:t.deviceTypeIcon},null,8,x)],8,T),Object(i["createElementVNode"])("span",{title:t.operatingSystem,style:{"margin-right":"3.5px"}},[Object(i["createElementVNode"])("img",{height:"16",src:t.operatingSystemIcon},null,8,B)],8,L),Object(i["createElementVNode"])("span",{title:"".concat(t.browser," ").concat(t.browserFamilyDescription),style:{"margin-right":"3.5px"}},[Object(i["createElementVNode"])("img",{height:"16",src:t.browserIcon},null,8,R)],8,U),Object(i["createElementVNode"])("span",{title:"".concat(t.country," ").concat(t.region||"")},[Object(i["createElementVNode"])("img",{height:"16",src:t.countryFlag},null,8,G)],8,H)]),Object(i["withDirectives"])(Object(i["createElementVNode"])("td",null,[Object(i["createElementVNode"])("a",{class:"visitorLogTooltip",title:"View visitor profile",onClick:function(n){return e.showProfile(t.visitorId,t.idSite)}},[K,Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("Live_ViewVisitorProfile")),1)],8,q)],512),[[i["vShow"],e.profileEnabled]])],8,C)})),128))])],512),[[ne]]),Object(i["createVNode"])(Z,{class:"exportDataSubjects",style:{"margin-right":"3.5px"},onConfirm:t[4]||(t[4]=function(t){return e.exportDataSubject()}),disabled:!e.hasActiveDataSubjects,value:e.translate("PrivacyManager_ExportSelectedVisits")},null,8,["disabled","value"]),Object(i["createVNode"])(Z,{class:"deleteDataSubjects",onConfirm:t[5]||(t[5]=function(t){return e.deleteDataSubject()}),disabled:!e.hasActiveDataSubjects||e.isDeleting,value:e.translate("PrivacyManager_DeleteSelectedVisits")},null,8,["disabled","value"])],512),[[i["vShow"],e.dataSubjects.length]]),Object(i["createElementVNode"])("div",W,[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteVisitsConfirm")),1),Object(i["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,Y),Object(i["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,J)],512)])}var X=n("19dc"),Z=n("f06f"),ee=n("a5a2"),te=Object(i["defineComponent"])({components:{ContentBlock:X["ContentBlock"],SiteSelector:X["SiteSelector"],SegmentGenerator:Z["SegmentGenerator"],SaveButton:ee["SaveButton"],Field:ee["Field"]},directives:{ContentTable:X["ContentTable"]},data:function(){return{isLoading:!1,isDeleting:!1,site:{id:"all",name:Object(X["translate"])("UsersManager_AllWebsites")},segment_filter:"userId==",dataSubjects:[],toggleAll:!0,hasSearched:!1,profileEnabled:X["Matomo"].visitorProfileEnabled,dataSubjectsActive:[]}},setup:function(){var e=X["AjaxHelper"].fetch({method:"SitesManager.getSitesIdWithAdminAccess",filter_limit:"-1"});return{getSites:function(){return e}}},methods:{showSuccessNotification:function(e){var t=X["NotificationsStore"].show({message:e,context:"success",id:"manageGdpr",type:"transient"});setTimeout((function(){X["NotificationsStore"].scrollToNotification(t)}),200)},linkTo:function(e){return"?".concat(X["MatomoUrl"].stringify(Object.assign(Object.assign({},X["MatomoUrl"].urlParsed.value),{},{module:"PrivacyManager",action:e})))},toggleActivateAll:function(){this.dataSubjectsActive.fill(this.toggleAll)},showProfile:function(e,t){X["Matomo"].helper.showVisitorProfilePopup(e,t)},exportDataSubject:function(){var e=this,t=this.activatedDataSubjects;X["AjaxHelper"].post({module:"API",method:"PrivacyManager.exportDataSubjects",format:"json",filter_limit:-1},{visits:t}).then((function(t){e.showSuccessNotification(Object(X["translate"])("PrivacyManager_VisitsSuccessfullyExported")),X["Matomo"].helper.sendContentAsDownload("exported_data_subjects.json",JSON.stringify(t))}))},deleteDataSubject:function(){var e=this;X["Matomo"].helper.modalConfirm(this.$refs.confirmDeleteDataSubject,{yes:function(){e.isDeleting=!0;var t=e.activatedDataSubjects;X["AjaxHelper"].post({module:"API",method:"PrivacyManager.deleteDataSubjects",filter_limit:-1},{visits:t}).then((function(){e.dataSubjects=[],e.showSuccessNotification(Object(X["translate"])("PrivacyManager_VisitsSuccessfullyDeleted")),e.findDataSubjects()})).finally((function(){e.isDeleting=!1}))}})},addFilter:function(e,t){this.segment_filter+=",".concat(e,"==").concat(t),this.findDataSubjects()},findDataSubjects:function(){var e=this;this.dataSubjects=[],this.dataSubjectsActive=[],this.isLoading=!0,this.toggleAll=!0,this.hasSearched=!1,this.getSites().then((function(t){var n=e.site.id;"all"!==n||X["Matomo"].hasSuperUserAccess||(n=t,Array.isArray(t)&&(n=t.join(","))),X["AjaxHelper"].fetch({idSite:n,module:"API",method:"PrivacyManager.findDataSubjects",segment:e.segment_filter}).then((function(t){e.hasSearched=!0,e.dataSubjectsActive=t.map((function(){return!0})),e.dataSubjects=t})).finally((function(){e.isLoading=!1}))}))}},computed:{hasActiveDataSubjects:function(){return!!this.activatedDataSubjects.length},activatedDataSubjects:function(){var e=this;return this.dataSubjects.filter((function(t,n){return e.dataSubjectsActive[n]})).map((function(e){return{idsite:e.idSite,idvisit:e.idVisit}}))},overviewHintText:function(){return Object(X["translate"])("PrivacyManager_GdprToolsOverviewHint",'<a href="'.concat(this.linkTo("gdprOverview"),'">'),"</a>")}}});te.render=Q;var ne=te,ae=Object(i["createElementVNode"])("br",null,null,-1),oe=Object(i["createElementVNode"])("br",null,null,-1),ie=Object(i["createElementVNode"])("br",null,null,-1),le=Object(i["createElementVNode"])("br",null,null,-1),re={key:0},ce=Object(i["createElementVNode"])("br",null,null,-1),se=Object(i["createElementVNode"])("br",null,null,-1),de={class:"alert-warning alert"};function ue(e,t,n,a,o,l){var r=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("SaveButton"),s=Object(i["resolveDirective"])("form");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"checkbox",name:"anonymizeIpSettings",title:e.translate("PrivacyManager_UseAnonymizeIp"),modelValue:e.actualEnabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.actualEnabled=t}),"inline-help":e.anonymizeIpEnabledHelp},null,8,["title","modelValue","inline-help"])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"radio",name:"maskLength",title:e.translate("PrivacyManager_AnonymizeIpMaskLengtDescription"),modelValue:e.actualMaskLength,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.actualMaskLength=t}),options:e.maskLengthOptions,"inline-help":e.translate("PrivacyManager_GeolocationAnonymizeIpNote")},null,8,["title","modelValue","options","inline-help"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"radio",name:"useAnonymizedIpForVisitEnrichment",title:e.translate("PrivacyManager_UseAnonymizedIpForVisitEnrichment"),modelValue:e.actualUseAnonymizedIpForVisitEnrichment,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.actualUseAnonymizedIpForVisitEnrichment=t}),options:e.useAnonymizedIpForVisitEnrichmentOptions,"inline-help":e.translate("PrivacyManager_UseAnonymizedIpForVisitEnrichmentNote")},null,8,["title","modelValue","options","inline-help"])])],512),[[i["vShow"],e.actualEnabled]]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"checkbox",name:"anonymizeUserId",title:e.translate("PrivacyManager_PseudonymizeUserId"),modelValue:e.actualAnonymizeUserId,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.actualAnonymizeUserId=t})},{"inline-help":Object(i["withCtx"])((function(){return[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_PseudonymizeUserIdNote"))+" ",1),ae,oe,Object(i["createElementVNode"])("em",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_PseudonymizeUserIdNote2")),1)]})),_:1},8,["title","modelValue"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"checkbox",name:"anonymizeOrderId",title:e.translate("PrivacyManager_UseAnonymizeOrderId"),modelValue:e.actualAnonymizeOrderId,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.actualAnonymizeOrderId=t}),"inline-help":e.translate("PrivacyManager_AnonymizeOrderIdNote")},null,8,["title","modelValue","inline-help"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"checkbox",name:"forceCookielessTracking",title:e.translate("PrivacyManager_ForceCookielessTracking"),modelValue:e.actualForceCookielessTracking,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.actualForceCookielessTracking=t})},{"inline-help":Object(i["withCtx"])((function(){return[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescription",e.trackerFileName))+" ",1),ie,le,Object(i["createElementVNode"])("em",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescription2")),1),e.trackerWritable?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",re,[ce,se,Object(i["createElementVNode"])("p",de,Object(i["toDisplayString"])(e.translate("PrivacyManager_ForceCookielessTrackingDescriptionNotWritable",e.trackerFileName)),1)]))]})),_:1},8,["title","modelValue"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"select",name:"anonymizeReferrer",title:e.translate("PrivacyManager_AnonymizeReferrer"),modelValue:e.actualAnonymizeReferrer,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.actualAnonymizeReferrer=t}),options:e.referrerAnonymizationOptions,"inline-help":e.translate("PrivacyManager_AnonymizeReferrerNote")},null,8,["title","modelValue","options","inline-help"])]),Object(i["createVNode"])(c,{onConfirm:t[7]||(t[7]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[s]])}var me=Object(i["defineComponent"])({props:{anonymizeIpEnabled:Boolean,anonymizeUserId:Boolean,maskLength:{type:Number,required:!0},useAnonymizedIpForVisitEnrichment:Boolean,anonymizeOrderId:Boolean,forceCookielessTracking:Boolean,anonymizeReferrer:String,maskLengthOptions:{type:Array,required:!0},useAnonymizedIpForVisitEnrichmentOptions:{type:Array,required:!0},trackerFileName:{type:String,required:!0},trackerWritable:{type:Boolean,required:!0},referrerAnonymizationOptions:{type:Object,required:!0}},components:{Field:ee["Field"],SaveButton:ee["SaveButton"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,actualEnabled:!!this.anonymizeIpEnabled,actualMaskLength:this.maskLength,actualUseAnonymizedIpForVisitEnrichment:this.useAnonymizedIpForVisitEnrichment?"1":"0",actualAnonymizeUserId:!!this.anonymizeUserId,actualAnonymizeOrderId:!!this.anonymizeOrderId,actualForceCookielessTracking:!!this.forceCookielessTracking,actualAnonymizeReferrer:this.anonymizeReferrer}},methods:{save:function(){var e=this;this.isLoading=!0,X["AjaxHelper"].post({module:"API",method:"PrivacyManager.setAnonymizeIpSettings"},{anonymizeIPEnable:this.actualEnabled?"1":"0",anonymizeUserId:this.actualAnonymizeUserId?"1":"0",anonymizeOrderId:this.actualAnonymizeOrderId?"1":"0",forceCookielessTracking:this.actualForceCookielessTracking?"1":"0",anonymizeReferrer:this.actualAnonymizeReferrer?this.actualAnonymizeReferrer:"",maskLength:this.actualMaskLength,useAnonymizedIpForVisitEnrichment:this.actualUseAnonymizedIpForVisitEnrichment?"1":"0"}).then((function(){var e=X["NotificationsStore"].show({message:Object(X["translate"])("CoreAdminHome_SettingsSaveSuccess"),context:"success",id:"privacyManagerSettings",type:"toast"});X["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}},computed:{anonymizeIpEnabledHelp:function(){var e=Object(X["translate"])("PrivacyManager_AnonymizeIpInlineHelp"),t=Object(X["translate"])("PrivacyManager_AnonymizeIpDescription");return"".concat(e," ").concat(t)}}});me.render=ue;var be=me,pe={class:"optOutCustomizer"},ge=["innerHTML"],ve=["value"],he=["value"],Oe=Object(i["createStaticVNode"])('<option value="px">px</option><option value="pt">pt</option><option value="em">em</option><option value="rem">rem</option><option value="%">%</option>',5),je=[Oe],fe={ref:"pre"},ye=["innerHTML"],Ve=["src"];function Se(e,t,n,a,o,l){var r=Object(i["resolveDirective"])("select-on-focus");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",pe,[Object(i["createElementVNode"])("p",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("CoreAdminHome_OptOutExplanation"))+" ",1),Object(i["createElementVNode"])("span",{innerHTML:e.$sanitize(e.readThisToLearnMore)},null,8,ge)]),Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutCustomize")),1),Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("span",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_FontColor"))+": ",1),Object(i["createElementVNode"])("input",{type:"color",value:e.fontColor,onKeydown:t[0]||(t[0]=function(t){return e.onFontColorChange(t)}),onChange:t[1]||(t[1]=function(t){return e.onFontColorChange(t)})},null,40,ve)]),Object(i["createElementVNode"])("span",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_BackgroundColor"))+": ",1),Object(i["createElementVNode"])("input",{type:"color",value:e.backgroundColor,onKeydown:t[2]||(t[2]=function(t){return e.onBgColorChange(t)}),onChange:t[3]||(t[3]=function(t){return e.onBgColorChange(t)})},null,40,he)]),Object(i["createElementVNode"])("span",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_FontSize"))+": ",1),Object(i["createElementVNode"])("input",{id:"FontSizeInput",type:"number",min:"1",max:"100",onKeydown:t[4]||(t[4]=function(t){return e.onFontSizeChange(t)}),onChange:t[5]||(t[5]=function(t){return e.onFontSizeChange(t)})},null,32)]),Object(i["createElementVNode"])("span",null,[Object(i["createElementVNode"])("select",{class:"browser-default",onKeydown:t[6]||(t[6]=function(t){return e.onFontSizeUnitChange(t)}),onChange:t[7]||(t[7]=function(t){return e.onFontSizeUnitChange(t)})},je,32)]),Object(i["createElementVNode"])("span",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_FontFamily"))+": ",1),Object(i["createElementVNode"])("input",{id:"FontFamilyInput",type:"text",onKeydown:t[8]||(t[8]=function(t){return e.onFontFamilyChange(t)}),onChange:t[9]||(t[9]=function(t){return e.onFontFamilyChange(t)})},null,32)])])]),Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutHtmlCode")),1),Object(i["withDirectives"])(Object(i["createElementVNode"])("pre",fe,[Object(i["createTextVNode"])('<iframe\n style="border: 0; height: 200px; width: 600px;"\n src="'+Object(i["toDisplayString"])(e.iframeUrl)+'"\n ></iframe>',1)],512),[[r,{}]]),Object(i["createElementVNode"])("p",{innerHTML:e.$sanitize(e.optOutExplanationIntro)},null,8,ye),Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutPreview")),1),Object(i["createElementVNode"])("iframe",{id:"previewIframe",style:{border:"1px solid #333",height:"200px",width:"600px"},src:e.iframeUrl,class:Object(i["normalizeClass"])({withBg:e.withBg})},null,10,Ve)])}function De(e){var t=parseInt(e,16),n=t>>16&255,a=t>>8&255,o=255&t;return n>=225&&a>=225&&o>=225}var Ne=window,Ee=Ne.$,Ce=Object(i["defineComponent"])({props:{language:{type:String,required:!0},piwikurl:String},directives:{SelectOnFocus:X["SelectOnFocus"]},data:function(){return{fontSizeUnit:"px",backgroundColor:"",fontColor:"",fontSize:"",fontFamily:""}},created:function(){this.onFontColorChange=Object(X["debounce"])(this.onFontColorChange,50),this.onBgColorChange=Object(X["debounce"])(this.onBgColorChange,50),this.onFontSizeChange=Object(X["debounce"])(this.onFontSizeChange,50),this.onFontSizeUnitChange=Object(X["debounce"])(this.onFontSizeUnitChange,50),this.onFontFamilyChange=Object(X["debounce"])(this.onFontFamilyChange,50)},methods:{onFontColorChange:function(e){this.fontColor=e.target.value},onBgColorChange:function(e){this.backgroundColor=e.target.value},onFontSizeChange:function(e){this.fontSize=e.target.value},onFontSizeUnitChange:function(e){this.fontSizeUnit=e.target.value},onFontFamilyChange:function(e){this.fontFamily=e.target.value}},watch:{iframeUrl:function(){var e=this.$refs.pre,t=Ee(e).queue("fx").length>0;t||Ee(e).effect("highlight",{},1500)}},computed:{fontSizeWithUnit:function(){return this.fontSize?"".concat(this.fontSize).concat(this.fontSizeUnit):""},withBg:function(){return!!this.piwikurl&&""===this.backgroundColor&&""!==this.fontColor&&De(this.fontColor.substr(1))},iframeUrl:function(){if(this.piwikurl){var e=X["MatomoUrl"].stringify({module:"CoreAdminHome",action:"optOut",language:this.language,backgroundColor:this.backgroundColor.substr(1),fontColor:this.fontColor.substr(1),fontSize:this.fontSizeWithUnit,fontFamily:this.fontFamily});return"".concat(this.piwikurl,"index.php?").concat(e)}return""},readThisToLearnMore:function(){var e="https://matomo.org/faq/how-to/faq_25918/";return Object(X["translate"])("General_ReadThisToLearnMore","<a rel='noreferrer noopener' target='_blank' href='".concat(e,"'>"),"</a>")},optOutExplanationIntro:function(){return Object(X["translate"])("CoreAdminHome_OptOutExplanationIntro",'<a href="'.concat(this.iframeUrl,'" rel="noreferrer noopener" target="_blank">'),"</a>")}}});Ce.render=Se;var ke=Ce,_e={class:"anonymizeLogData"},Pe={class:"form-group row"},we={class:"col s12 input-field"},Me={for:"anonymizeSite",class:"siteSelectorLabel"},Ae={class:"sites_autocomplete"},ze={class:"form-group row"},Ie={class:"col s6 input-field"},Fe={for:"anonymizeStartDate",class:"active"},Te=["value"],xe={class:"col s6 input-field"},Le={for:"anonymizeEndDate",class:"active"},Be=["value"],Ue={name:"anonymizeIp"},Re={name:"anonymizeLocation"},He={name:"anonymizeTheUserId"},Ge={class:"form-group row"},qe={class:"col s12 m6"},Ke={for:"visit_columns"},We={class:"innerFormField",name:"visit_columns"},$e=["onClick","title"],Ye={class:"col s12 m6"},Je={class:"form-help"},Qe={class:"inline-help"},Xe={class:"form-group row"},Ze={class:"col s12"},et={class:"form-group row"},tt={class:"col s12 m6"},nt={for:"action_columns"},at={class:"innerFormField",name:"action_columns"},ot=["onClick","title"],it={class:"col s12 m6"},lt={class:"form-help"},rt={class:"inline-help"},ct=Object(i["createElementVNode"])("span",{class:"icon-info"},null,-1),st={class:"ui-confirm",id:"confirmAnonymizeLogData",ref:"confirmAnonymizeLogData"},dt=["value"],ut=["value"];function mt(e,t,n,a,o,l){var r=Object(i["resolveComponent"])("SiteSelector"),c=Object(i["resolveComponent"])("Field"),s=Object(i["resolveComponent"])("SaveButton");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",_e,[Object(i["createElementVNode"])("div",Pe,[Object(i["createElementVNode"])("div",we,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",Me,Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeSites")),1),Object(i["createElementVNode"])("div",Ae,[Object(i["createVNode"])(r,{id:"anonymizeSite",modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t}),"show-all-sites-item":!0,"switch-site-on-select":!1,"show-selected-site":!0},null,8,["modelValue"])])])])]),Object(i["createElementVNode"])("div",ze,[Object(i["createElementVNode"])("div",Ie,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",Fe,Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeRowDataFrom")),1),Object(i["createElementVNode"])("input",{type:"text",id:"anonymizeStartDate",class:"anonymizeStartDate",ref:"anonymizeStartDate",name:"anonymizeStartDate",value:e.startDate,onKeydown:t[1]||(t[1]=function(t){return e.onKeydownStartDate(t)}),onChange:t[2]||(t[2]=function(t){return e.onKeydownStartDate(t)})},null,40,Te)])]),Object(i["createElementVNode"])("div",xe,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",Le,Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeRowDataTo")),1),Object(i["createElementVNode"])("input",{type:"text",class:"anonymizeEndDate",id:"anonymizeEndDate",ref:"anonymizeEndDate",name:"anonymizeEndDate",value:e.endDate,onKeydown:t[3]||(t[3]=function(t){return e.onKeydownEndDate(t)}),onChange:t[4]||(t[4]=function(t){return e.onKeydownEndDate(t)})},null,40,Be)])])]),Object(i["createElementVNode"])("div",Ue,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeIp",title:e.translate("PrivacyManager_AnonymizeIp"),modelValue:e.anonymizeIp,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.anonymizeIp=t}),introduction:e.translate("General_Visit"),"inline-help":e.translate("PrivacyManager_AnonymizeIpHelp")},null,8,["title","modelValue","introduction","inline-help"])]),Object(i["createElementVNode"])("div",Re,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeLocation",title:e.translate("PrivacyManager_AnonymizeLocation"),modelValue:e.anonymizeLocation,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.anonymizeLocation=t}),"inline-help":e.translate("PrivacyManager_AnonymizeLocationHelp")},null,8,["title","modelValue","inline-help"])]),Object(i["createElementVNode"])("div",He,[Object(i["createVNode"])(c,{uicontrol:"checkbox",name:"anonymizeTheUserId",title:e.translate("PrivacyManager_AnonymizeUserId"),modelValue:e.anonymizeUserId,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.anonymizeUserId=t}),"inline-help":e.translate("PrivacyManager_AnonymizeUserIdHelp")},null,8,["title","modelValue","inline-help"])]),Object(i["createElementVNode"])("div",Ge,[Object(i["createElementVNode"])("div",qe,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",Ke,Object(i["toDisplayString"])(e.translate("PrivacyManager_UnsetVisitColumns")),1),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.selectedVisitColumns,(function(t,n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:Object(i["normalizeClass"])("selectedVisitColumns selectedVisitColumns".concat(n," multiple valign-wrapper")),key:n},[Object(i["createElementVNode"])("div",We,[Object(i["createVNode"])(c,{uicontrol:"select",name:"visit_columns","model-value":t.column,"onUpdate:modelValue":function(n){t.column=n,e.onVisitColumnChange()},"full-width":!0,options:e.availableVisitColumns},null,8,["model-value","onUpdate:modelValue","options"])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",{class:"icon-minus valign",onClick:function(t){return e.removeVisitColumn(n)},title:e.translate("General_Remove")},null,8,$e),[[i["vShow"],n+1!==e.selectedVisitColumns.length]])],2)})),128))])]),Object(i["createElementVNode"])("div",Ye,[Object(i["createElementVNode"])("div",Je,[Object(i["createElementVNode"])("span",Qe,Object(i["toDisplayString"])(e.translate("PrivacyManager_UnsetVisitColumnsHelp")),1)])])]),Object(i["createElementVNode"])("div",Xe,[Object(i["createElementVNode"])("div",Ze,[Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("General_Action")),1)])]),Object(i["createElementVNode"])("div",et,[Object(i["createElementVNode"])("div",tt,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",nt,Object(i["toDisplayString"])(e.translate("PrivacyManager_UnsetActionColumns")),1),(Object(i["openBlock"])(!0),Object(i["createElementBlock"])(i["Fragment"],null,Object(i["renderList"])(e.selectedActionColumns,(function(t,n){return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{class:Object(i["normalizeClass"])("selectedActionColumns selectedActionColumns".concat(n," multiple valign-wrapper")),key:n},[Object(i["createElementVNode"])("div",at,[Object(i["createVNode"])(c,{uicontrol:"select",name:"action_columns","model-value":t.column,"onUpdate:modelValue":function(n){t.column=n,e.onActionColumnChange()},"full-width":!0,options:e.availableActionColumns},null,8,["model-value","onUpdate:modelValue","options"])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",{class:"icon-minus valign",onClick:function(t){return e.removeActionColumn(n)},title:e.translate("General_Remove")},null,8,ot),[[i["vShow"],n+1!==e.selectedActionColumns.length]])],2)})),128))])]),Object(i["createElementVNode"])("div",it,[Object(i["createElementVNode"])("div",lt,[Object(i["createElementVNode"])("span",rt,Object(i["toDisplayString"])(e.translate("PrivacyManager_UnsetActionColumnsHelp")),1)])])]),Object(i["createElementVNode"])("p",null,[ct,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeProcessInfo")),1)]),Object(i["createVNode"])(s,{class:"anonymizePastData",onConfirm:t[8]||(t[8]=function(t){return e.scheduleAnonymization()}),disabled:e.isAnonymizePastDataDisabled,value:e.translate("PrivacyManager_AnonymizeDataNow")},null,8,["disabled","value"]),Object(i["createElementVNode"])("div",st,[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeDataConfirm")),1),Object(i["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,dt),Object(i["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,ut)],512)])}function bt(e){return e<10?"0".concat(e):e}var pt=Object(i["defineComponent"])({components:{SiteSelector:X["SiteSelector"],Field:ee["Field"],SaveButton:ee["SaveButton"]},data:function(){var e=new Date,t="".concat(e.getFullYear(),"-").concat(bt(e.getMonth()+1),"-").concat(bt(e.getDay()+1));return{isLoading:!1,isDeleting:!1,anonymizeIp:!1,anonymizeLocation:!1,anonymizeUserId:!1,site:{id:"all",name:"All Websites"},availableVisitColumns:[],availableActionColumns:[],selectedVisitColumns:[{column:""}],selectedActionColumns:[{column:""}],startDate:t,endDate:t}},created:function(){var e=this;this.onKeydownStartDate=Object(X["debounce"])(this.onKeydownStartDate,50),this.onKeydownEndDate=Object(X["debounce"])(this.onKeydownEndDate,50),X["AjaxHelper"].fetch({method:"PrivacyManager.getAvailableVisitColumnsToAnonymize"}).then((function(t){e.availableVisitColumns=[],t.forEach((function(t){e.availableVisitColumns.push({key:t.column_name,value:t.column_name})}))})),X["AjaxHelper"].fetch({method:"PrivacyManager.getAvailableLinkVisitActionColumnsToAnonymize"}).then((function(t){e.availableActionColumns=[],t.forEach((function(t){e.availableActionColumns.push({key:t.column_name,value:t.column_name})}))})),setTimeout((function(){var t=X["Matomo"].getBaseDatePickerOptions(null),n=X["Matomo"].getBaseDatePickerOptions(null);$(e.$refs.anonymizeStartDate).datepicker(t),$(e.$refs.anonymizeEndDate).datepicker(n)}))},methods:{onVisitColumnChange:function(){var e=this.selectedVisitColumns.every((function(e){return!(null===e||void 0===e||!e.column)}));e&&this.addVisitColumn()},addVisitColumn:function(){this.selectedVisitColumns.push({column:""})},removeVisitColumn:function(e){if(e>-1){var t=this.selectedVisitColumns.length-1;t===e?this.selectedVisitColumns[e]={column:""}:this.selectedVisitColumns.splice(e,1)}},onActionColumnChange:function(){var e=this.selectedActionColumns.every((function(e){return!(null===e||void 0===e||!e.column)}));e&&this.addActionColumn()},addActionColumn:function(){this.selectedActionColumns.push({column:""})},removeActionColumn:function(e){if(e>-1){var t=this.selectedActionColumns.length-1;t===e?this.selectedActionColumns[e]={column:""}:this.selectedActionColumns.splice(e,1)}},scheduleAnonymization:function(){var e="".concat(this.startDate,",").concat(this.endDate);this.startDate===this.endDate&&(e=this.startDate);var t={date:e};t.idSites=this.site.id,t.anonymizeIp=this.anonymizeIp?"1":"0",t.anonymizeLocation=this.anonymizeLocation?"1":"0",t.anonymizeUserId=this.anonymizeUserId?"1":"0",t.unsetVisitColumns=this.selectedVisitColumns.filter((function(e){return!(null===e||void 0===e||!e.column)})).map((function(e){return e.column})),t.unsetLinkVisitActionColumns=this.selectedActionColumns.filter((function(e){return!(null===e||void 0===e||!e.column)})).map((function(e){return e.column})),X["Matomo"].helper.modalConfirm(this.$refs.confirmAnonymizeLogData,{yes:function(){X["AjaxHelper"].post({method:"PrivacyManager.anonymizeSomeRawData"},t).then((function(){window.location.reload(!0)}))}})},onKeydownStartDate:function(e){this.startDate=e.target.value},onKeydownEndDate:function(e){this.endDate=e.target.value}},computed:{isAnonymizePastDataDisabled:function(){return!this.anonymizeIp&&!this.anonymizeLocation&&!this.selectedVisitColumns&&!this.selectedActionColumns}}});pt.render=mt;var gt=pt;function vt(e,t,n,a,o,l){var r=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("SaveButton"),s=Object(i["resolveDirective"])("form");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",null,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"radio",name:"doNotTrack",modelValue:e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.enabled=t}),options:e.doNotTrackOptions,"inline-help":e.translate("PrivacyManager_DoNotTrack_Description")},null,8,["modelValue","options","inline-help"])]),Object(i["createVNode"])(c,{onConfirm:t[1]||(t[1]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[s]])}var ht=Object(i["defineComponent"])({props:{dntSupport:Boolean,doNotTrackOptions:{type:Array,required:!0}},components:{Field:ee["Field"],SaveButton:ee["SaveButton"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,enabled:this.dntSupport?1:0}},methods:{save:function(){var e=this;this.isLoading=!0;var t="deactivateDoNotTrack";this.enabled&&"0"!==this.enabled&&(t="activateDoNotTrack"),X["AjaxHelper"].post({module:"API",method:"PrivacyManager.".concat(t)}).then((function(){var e=X["NotificationsStore"].show({message:Object(X["translate"])("CoreAdminHome_SettingsSaveSuccess"),context:"success",id:"privacyManagerSettings",type:"transient"});X["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.isLoading=!1}))}}});ht.render=vt;var Ot=ht;function jt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ft(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function yt(e,t,n){return t&&ft(e.prototype,t),n&&ft(e,n),e}function Vt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var ct=function(){function e(){var t=this;it(this,e),rt(this,"privateState",Object(o["reactive"])({settings:{},showEstimate:!1,loadingEstimation:!1,estimation:"",isModified:!1})),rt(this,"state",Object(o["computed"])((function(){return Object(o["readonly"])(t.privateState)}))),rt(this,"enableDeleteReports",Object(o["computed"])((function(){return t.state.value.settings.enableDeleteReports}))),rt(this,"enableDeleteLogs",Object(o["computed"])((function(){return t.state.value.settings.enableDeleteLogs}))),rt(this,"currentRequest",void 0)}return lt(e,[{key:"updateSettings",value:function(e){this.initSettings(e),this.privateState.isModified=!0}},{key:"initSettings",value:function(e){this.privateState.settings=Object.assign(Object.assign({},this.privateState.settings),e),this.reloadDbStats()}},{key:"savePurgeDataSettings",value:function(e,t){return this.privateState.isModified=!1,X["AjaxHelper"].post({module:"API",method:e},Object.assign(Object.assign({},t),{},{enableDeleteLogs:t.enableDeleteLogs?"1":"0",enableDeleteReports:t.enableDeleteReports?"1":"0"})).then((function(){var e=X["NotificationsStore"].show({message:Object(X["translate"])("CoreAdminHome_SettingsSaveSuccess"),context:"success",id:"privacyManagerSettings",type:"toast"});X["NotificationsStore"].scrollToNotification(e)}))}},{key:"isEitherDeleteSectionEnabled",value:function(){return this.state.value.settings.enableDeleteLogs||this.state.value.settings.enableDeleteReports}},{key:"isManualEstimationLinkShowing",value:function(){return window.$("#getPurgeEstimateLink").length>0}},{key:"reloadDbStats",value:function(e){var t=this;if(this.currentRequest&&(this.currentRequest.abort(),this.currentRequest=void 0),e||this.isEitherDeleteSectionEnabled()&&!this.isManualEstimationLinkShowing()){this.privateState.loadingEstimation=!0,this.privateState.estimation="",this.privateState.showEstimate=!1;var n=this.privateState.settings,a=Object.assign(Object.assign({},n),{},{enableDeleteLogs:n.enableDeleteLogs?"1":"0",enableDeleteReports:n.enableDeleteReports?"1":"0"});!0===e&&(a.forceEstimate=1),this.currentRequest=new AbortController,X["AjaxHelper"].post({module:"PrivacyManager",action:"getDatabaseSize",format:"html"},a,{abortController:this.currentRequest,format:"html"}).then((function(e){t.privateState.estimation=e,t.privateState.showEstimate=!0,t.privateState.loadingEstimation=!1})).finally((function(){t.currentRequest=void 0,t.privateState.loadingEstimation=!1}))}}}]),e}(),st=new ct,dt={id:"formDeleteSettings"},ut={id:"deleteLogSettingEnabled"},mt={class:"alert alert-warning deleteOldLogsWarning",style:{width:"50%"}},bt={href:"https://matomo.org/faq/general/#faq_125",rel:"noreferrer noopener",target:"_blank"},pt={id:"deleteLogSettings"};function vt(e,t,n,a,i,l){var r=Object(o["resolveComponent"])("Field"),c=Object(o["resolveComponent"])("SaveButton"),s=Object(o["resolveDirective"])("form");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",dt,[Object(o["createElementVNode"])("div",ut,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"deleteEnable","model-value":e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.enabled=t,e.reloadDbStats()}),title:e.translate("PrivacyManager_UseDeleteLog"),"inline-help":e.translate("PrivacyManager_DeleteRawDataInfo")},null,8,["model-value","title","inline-help"])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",mt,[Object(o["createElementVNode"])("a",bt,Object(o["toDisplayString"])(e.translate("General_ClickHere")),1)],512),[[o["vShow"],e.enabled]])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",pt,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"text",name:"deleteOlderThan","model-value":e.deleteOlderThan,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.deleteOlderThan=t,e.reloadDbStats()}),title:e.deleteOlderThanTitle,"inline-help":e.translate("PrivacyManager_LeastDaysInput","1")},null,8,["model-value","title","inline-help"])])],512),[[o["vShow"],e.enabled]]),Object(o["createVNode"])(c,{onConfirm:t[2]||(t[2]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[s]])}var gt=window,jt=gt.$,ht=Object(o["defineComponent"])({props:{isDataPurgeSettingsEnabled:Boolean,deleteData:{type:Object,required:!0},scheduleDeletionOptions:{type:Object,required:!0}},components:{Field:ee["Field"],SaveButton:ee["SaveButton"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,enabled:"1"===this.deleteData.config.delete_logs_enable,deleteOlderThan:this.deleteData.config.delete_logs_older_than}},created:function(){var e=this;setTimeout((function(){st.initSettings(e.settings)}))},methods:{saveSettings:function(){var e=this,t="PrivacyManager.setDeleteLogsSettings";this.isLoading=!0,st.savePurgeDataSettings(t,this.settings).finally((function(){e.isLoading=!1}))},reloadDbStats:function(){st.updateSettings(this.settings)},save:function(){var e=this;if(this.enabled){var t="deleteLogsConfirm";st.enableDeleteReports.value&&(t="deleteBothConfirm"),jt("#confirmDeleteSettings").find(">h2").hide(),jt("#".concat(t)).show(),X["Matomo"].helper.modalConfirm("#confirmDeleteSettings",{yes:function(){e.saveSettings()}})}else this.saveSettings()}},computed:{settings:function(){return{enableDeleteLogs:!!this.enabled,deleteLogsOlderThan:this.deleteOlderThan}},deleteOlderThanTitle:function(){return"".concat(Object(X["translate"])("PrivacyManager_DeleteLogsOlderThan")," (").concat(Object(X["translate"])("Intl_PeriodDays"),")")}}});ht.render=vt;var Ot=ht,ft={id:"formDeleteSettings"},yt={id:"deleteReportsSettingEnabled"},Vt={class:"alert alert-warning",style:{width:"50%"}},Dt=Object(o["createElementVNode"])("br",null,null,-1),St=Object(o["createElementVNode"])("br",null,null,-1),Nt={id:"deleteReportsSettings"};function Et(e,t,n,a,i,l){var r=Object(o["resolveComponent"])("Field"),c=Object(o["resolveComponent"])("SaveButton"),s=Object(o["resolveDirective"])("form");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ft,[Object(o["createElementVNode"])("div",yt,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"deleteReportsEnable","model-value":e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.enabled=t,e.reloadDbStats()}),title:e.translate("PrivacyManager_UseDeleteReports"),"inline-help":e.translate("PrivacyManager_DeleteAggregateReportsDetailedInfo")},null,8,["model-value","title","inline-help"])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",Vt,[Object(o["createElementVNode"])("span",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("PrivacyManager_DeleteReportsInfo2",e.deleteOldLogsText)),1),Dt,St,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("PrivacyManager_DeleteReportsInfo3",e.deleteOldLogsText)),1)])],512),[[o["vShow"],e.enabled]])]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",Nt,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"text",name:"deleteReportsOlderThan","model-value":e.deleteOlderThan,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.deleteOlderThan=t,e.reloadDbStats()}),title:e.deleteReportsOlderThanTitle,"inline-help":e.translate("PrivacyManager_LeastMonthsInput","1")},null,8,["model-value","title","inline-help"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"deleteReportsKeepBasic","model-value":e.keepBasic,"onUpdate:modelValue":t[2]||(t[2]=function(t){e.keepBasic=t,e.reloadDbStats()}),title:e.deleteReportsKeepBasicTitle,"inline-help":e.translate("PrivacyManager_KeepBasicMetricsReportsDetailedInfo")},null,8,["model-value","title","inline-help"])]),Object(o["createElementVNode"])("h3",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_KeepDataFor")),1),Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"deleteReportsKeepDay","model-value":e.keepDataForDay,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.keepDataForDay=t,e.reloadDbStats()}),title:e.translate("General_DailyReports")},null,8,["model-value","title"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"deleteReportsKeepWeek","model-value":e.keepDataForWeek,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.keepDataForWeek=t,e.reloadDbStats()}),title:e.translate("General_WeeklyReports")},null,8,["model-value","title"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"deleteReportsKeepMonth","model-value":e.keepDataForMonth,"onUpdate:modelValue":t[5]||(t[5]=function(t){e.keepDataForMonth=t,e.reloadDbStats()}),title:"".concat(e.translate("General_MonthlyReports")," (").concat(e.translate("General_Recommended"),")")},null,8,["model-value","title"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"deleteReportsKeepYear","model-value":e.keepDataForYear,"onUpdate:modelValue":t[6]||(t[6]=function(t){e.keepDataForYear=t,e.reloadDbStats()}),title:"".concat(e.translate("General_YearlyReports")," (").concat(e.translate("General_Recommended"),")")},null,8,["model-value","title"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"deleteReportsKeepRange","model-value":e.keepDataForRange,"onUpdate:modelValue":t[7]||(t[7]=function(t){e.keepDataForRange=t,e.reloadDbStats()}),title:e.translate("General_RangeReports")},null,8,["model-value","title"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(r,{uicontrol:"checkbox",name:"deleteReportsKeepSegments","model-value":e.keepDataForSegments,"onUpdate:modelValue":t[8]||(t[8]=function(t){e.keepDataForSegments=t,e.reloadDbStats()}),title:e.translate("PrivacyManager_KeepReportSegments")},null,8,["model-value","title"])])])],512),[[o["vShow"],e.enabled]]),Object(o["createVNode"])(c,{onConfirm:t[9]||(t[9]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[s]])}function _t(e){return e?"1":"0"}var kt=window,Pt=kt.$,Ct=Object(o["defineComponent"])({props:{isDataPurgeSettingsEnabled:Boolean,deleteData:{type:Object,required:!0},scheduleDeletionOptions:{type:Object,required:!0}},components:{Field:ee["Field"],SaveButton:ee["SaveButton"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,enabled:1===parseInt(this.deleteData.config.delete_reports_enable,10),deleteOlderThan:this.deleteData.config.delete_reports_older_than,keepBasic:1===parseInt(this.deleteData.config.delete_reports_keep_basic_metrics,10),keepDataForDay:1===parseInt(this.deleteData.config.delete_reports_keep_day_reports,10),keepDataForWeek:1===parseInt(this.deleteData.config.delete_reports_keep_week_reports,10),keepDataForMonth:1===parseInt(this.deleteData.config.delete_reports_keep_month_reports,10),keepDataForYear:1===parseInt(this.deleteData.config.delete_reports_keep_year_reports,10),keepDataForRange:1===parseInt(this.deleteData.config.delete_reports_keep_range_reports,10),keepDataForSegments:1===parseInt(this.deleteData.config.delete_reports_keep_segment_reports,10)}},created:function(){var e=this;setTimeout((function(){st.initSettings(e.settings)}))},methods:{saveSettings:function(){var e=this,t="PrivacyManager.setDeleteReportsSettings";this.isLoading=!0,st.savePurgeDataSettings(t,this.settings).finally((function(){e.isLoading=!1}))},reloadDbStats:function(){st.updateSettings(this.settings)},save:function(){var e=this;if(this.enabled){var t="deleteReportsConfirm";st.enableDeleteLogs.value&&(t="deleteBothConfirm"),Pt("#confirmDeleteSettings").find(">h2").hide(),Pt("#".concat(t)).show(),X["Matomo"].helper.modalConfirm("#confirmDeleteSettings",{yes:function(){e.saveSettings()}})}else this.saveSettings()}},computed:{settings:function(){return{enableDeleteReports:this.enabled,deleteReportsOlderThan:this.deleteOlderThan,keepBasic:_t(this.keepBasic),keepDay:_t(this.keepDataForDay),keepWeek:_t(this.keepDataForWeek),keepMonth:_t(this.keepDataForMonth),keepYear:_t(this.keepDataForYear),keepRange:_t(this.keepDataForRange),keepSegments:_t(this.keepDataForSegments)}},deleteOldLogsText:function(){return Object(X["translate"])("PrivacyManager_UseDeleteLog")},deleteReportsOlderThanTitle:function(){var e=Object(X["translate"])("PrivacyManager_DeleteReportsOlderThan");return"".concat(e," (").concat(Object(X["translate"])("Intl_PeriodMonths"),")")},deleteReportsKeepBasicTitle:function(){var e=Object(X["translate"])("PrivacyManager_KeepBasicMetrics");return"".concat(e," (").concat(Object(X["translate"])("General_Recommended"),")")}}});Ct.render=Et;var Mt=Ct,wt={id:"formDeleteSettings"},At={id:"deleteSchedulingSettings"},It={id:"deleteSchedulingSettingsInlineHelp",class:"inline-help-node"},zt={key:0},Lt=Object(o["createElementVNode"])("br",null,null,-1),Tt=Object(o["createElementVNode"])("br",null,null,-1),Ft=Object(o["createElementVNode"])("br",null,null,-1),xt=Object(o["createElementVNode"])("br",null,null,-1),Bt={key:0,id:"deleteDataEstimateSect",class:"form-group row"},Rt={class:"col s12",id:"databaseSizeHeadline"},Ut={class:"col s12 m6"},Gt=["innerHTML"],Ht=Object(o["createTextVNode"])(" "),qt={class:"col s12 m6"},Kt={key:0,class:"form-help"};function Wt(e,t,n,a,i,l){var r=Object(o["resolveComponent"])("ActivityIndicator"),c=Object(o["resolveComponent"])("Field"),s=Object(o["resolveComponent"])("SaveButton"),d=Object(o["resolveComponent"])("ContentBlock"),u=Object(o["resolveDirective"])("form");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",wt,[Object(o["withDirectives"])(Object(o["createVNode"])(d,{id:"scheduleSettingsHeadline","content-title":e.translate("PrivacyManager_DeleteSchedulingSettings")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("div",At,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(c,{uicontrol:"select",name:"deleteLowestInterval",title:e.translate("PrivacyManager_DeleteDataInterval"),modelValue:e.deleteLowestInterval,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.deleteLowestInterval=t}),options:e.scheduleDeletionOptions},{"inline-help":Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("div",It,[e.deleteData.lastRun?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",zt,[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_LastDelete"))+":",1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.deleteData.lastRunPretty)+" ",1),Lt,Tt])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("PrivacyManager_NextDelete"))+":",1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.deleteData.nextRunPretty)+" ",1),Ft,xt,Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{id:"purgeDataNowLink",href:"#",onClick:t[0]||(t[0]=function(t){return e.executeDataPurgeNow()})},Object(o["toDisplayString"])(e.translate("PrivacyManager_PurgeNow")),513),[[o["vShow"],e.showPurgeNowLink]]),Object(o["createVNode"])(r,{"loading-message":e.translate("PrivacyManager_PurgingData"),loading:e.loadingDataPurge},null,8,["loading-message","loading"]),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{id:"db-purged-message"},Object(o["toDisplayString"])(e.translate("PrivacyManager_DBPurged")),513),[[o["vShow"],e.dataWasPurged]])])]})),_:1},8,["title","modelValue","options"])])]),"1"===e.deleteData.config.enable_database_size_estimate||1===e.deleteData.config.enable_database_size_estimate?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Bt,[Object(o["createElementVNode"])("h3",Rt,Object(o["toDisplayString"])(e.translate("PrivacyManager_ReportsDataSavedEstimate")),1),Object(o["createElementVNode"])("div",Ut,[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",{id:"deleteDataEstimate",innerHTML:e.$sanitize(e.estimation)},null,8,Gt),[[o["vShow"],e.showEstimate]]),Ht,Object(o["createVNode"])(r,{loading:e.loadingEstimation},null,8,["loading"])]),Object(o["createElementVNode"])("div",qt,["1"!==e.deleteData.config.enable_auto_database_size_estimate&&1!==e.deleteData.config.enable_auto_database_size_estimate?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Kt,[Object(o["createElementVNode"])("a",{id:"getPurgeEstimateLink",href:"#",onClick:t[2]||(t[2]=Object(o["withModifiers"])((function(t){return e.getPurgeEstimate()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("PrivacyManager_GetPurgeEstimate")),1)])):Object(o["createCommentVNode"])("",!0)])])):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(s,{onConfirm:t[3]||(t[3]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])]})),_:1},8,["content-title"]),[[o["vShow"],e.isEitherDeleteSectionEnabled]])],512)),[[u]])}var $t=Object(o["defineComponent"])({props:{isDataPurgeSettingsEnabled:Boolean,deleteData:{type:Object,required:!0},scheduleDeletionOptions:{type:Object,required:!0}},components:{ContentBlock:X["ContentBlock"],ActivityIndicator:X["ActivityIndicator"],Field:ee["Field"],SaveButton:ee["SaveButton"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,loadingDataPurge:!1,dataWasPurged:!1,showPurgeNowLink:!0,deleteLowestInterval:this.deleteData.config.delete_logs_schedule_lowest_interval}},methods:{save:function(){var e="PrivacyManager.setScheduleReportDeletionSettings";st.savePurgeDataSettings(e,{deleteLowestInterval:this.deleteLowestInterval})},executeDataPurgeNow:function(){var e=this;st.state.value.isModified?X["Matomo"].helper.modalConfirm("#saveSettingsBeforePurge",{yes:function(){return null}}):X["Matomo"].helper.modalConfirm("#confirmPurgeNow",{yes:function(){e.loadingDataPurge=!0,e.showPurgeNowLink=!1,X["AjaxHelper"].fetch({module:"PrivacyManager",action:"executeDataPurge",format:"html"},{withTokenInUrl:!0}).then((function(){st.reloadDbStats(),e.dataWasPurged=!0,setTimeout((function(){e.dataWasPurged=!1,e.showPurgeNowLink=!0}),2e3)})).finally((function(){e.loadingDataPurge=!1}))}})},getPurgeEstimate:function(){return st.reloadDbStats(!0)}},computed:{showEstimate:function(){return st.state.value.showEstimate},isEitherDeleteSectionEnabled:function(){return st.isEitherDeleteSectionEnabled()},estimation:function(){return st.state.value.estimation},loadingEstimation:function(){return st.state.value.loadingEstimation}}});$t.render=Wt;var Yt=$t; + */var St=function(){function e(){var t=this;jt(this,e),Vt(this,"privateState",Object(i["reactive"])({settings:{},showEstimate:!1,loadingEstimation:!1,estimation:"",isModified:!1})),Vt(this,"state",Object(i["computed"])((function(){return Object(i["readonly"])(t.privateState)}))),Vt(this,"enableDeleteReports",Object(i["computed"])((function(){return t.state.value.settings.enableDeleteReports}))),Vt(this,"enableDeleteLogs",Object(i["computed"])((function(){return t.state.value.settings.enableDeleteLogs}))),Vt(this,"currentRequest",void 0)}return yt(e,[{key:"updateSettings",value:function(e){this.initSettings(e),this.privateState.isModified=!0}},{key:"initSettings",value:function(e){this.privateState.settings=Object.assign(Object.assign({},this.privateState.settings),e),this.reloadDbStats()}},{key:"savePurgeDataSettings",value:function(e,t){return this.privateState.isModified=!1,X["AjaxHelper"].post({module:"API",method:e},Object.assign(Object.assign({},t),{},{enableDeleteLogs:t.enableDeleteLogs?"1":"0",enableDeleteReports:t.enableDeleteReports?"1":"0"})).then((function(){var e=X["NotificationsStore"].show({message:Object(X["translate"])("CoreAdminHome_SettingsSaveSuccess"),context:"success",id:"privacyManagerSettings",type:"toast"});X["NotificationsStore"].scrollToNotification(e)}))}},{key:"isEitherDeleteSectionEnabled",value:function(){return this.state.value.settings.enableDeleteLogs||this.state.value.settings.enableDeleteReports}},{key:"isManualEstimationLinkShowing",value:function(){return window.$("#getPurgeEstimateLink").length>0}},{key:"reloadDbStats",value:function(e){var t=this;if(this.currentRequest&&(this.currentRequest.abort(),this.currentRequest=void 0),e||this.isEitherDeleteSectionEnabled()&&!this.isManualEstimationLinkShowing()){this.privateState.loadingEstimation=!0,this.privateState.estimation="",this.privateState.showEstimate=!1;var n=this.privateState.settings,a=Object.assign(Object.assign({},n),{},{enableDeleteLogs:n.enableDeleteLogs?"1":"0",enableDeleteReports:n.enableDeleteReports?"1":"0"});!0===e&&(a.forceEstimate=1),this.currentRequest=new AbortController,X["AjaxHelper"].post({module:"PrivacyManager",action:"getDatabaseSize",format:"html"},a,{abortController:this.currentRequest,format:"html"}).then((function(e){t.privateState.estimation=e,t.privateState.showEstimate=!0,t.privateState.loadingEstimation=!1})).finally((function(){t.currentRequest=void 0,t.privateState.loadingEstimation=!1}))}}}]),e}(),Dt=new St,Nt={id:"formDeleteSettings"},Et={id:"deleteLogSettingEnabled"},Ct={class:"alert alert-warning deleteOldLogsWarning",style:{width:"50%"}},kt={href:"https://matomo.org/faq/general/#faq_125",rel:"noreferrer noopener",target:"_blank"},_t={id:"deleteLogSettings"};function Pt(e,t,n,a,o,l){var r=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("SaveButton"),s=Object(i["resolveDirective"])("form");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Nt,[Object(i["createElementVNode"])("div",Et,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"checkbox",name:"deleteEnable","model-value":e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.enabled=t,e.reloadDbStats()}),title:e.translate("PrivacyManager_UseDeleteLog"),"inline-help":e.translate("PrivacyManager_DeleteRawDataInfo")},null,8,["model-value","title","inline-help"])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Ct,[Object(i["createElementVNode"])("a",kt,Object(i["toDisplayString"])(e.translate("General_ClickHere")),1)],512),[[i["vShow"],e.enabled]])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",_t,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"text",name:"deleteOlderThan","model-value":e.deleteOlderThan,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.deleteOlderThan=t,e.reloadDbStats()}),title:e.deleteOlderThanTitle,"inline-help":e.translate("PrivacyManager_LeastDaysInput","1")},null,8,["model-value","title","inline-help"])])],512),[[i["vShow"],e.enabled]]),Object(i["createVNode"])(c,{onConfirm:t[2]||(t[2]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[s]])}var wt=window,Mt=wt.$,At=Object(i["defineComponent"])({props:{isDataPurgeSettingsEnabled:Boolean,deleteData:{type:Object,required:!0},scheduleDeletionOptions:{type:Object,required:!0}},components:{Field:ee["Field"],SaveButton:ee["SaveButton"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,enabled:"1"===this.deleteData.config.delete_logs_enable,deleteOlderThan:this.deleteData.config.delete_logs_older_than}},created:function(){var e=this;setTimeout((function(){Dt.initSettings(e.settings)}))},methods:{saveSettings:function(){var e=this,t="PrivacyManager.setDeleteLogsSettings";this.isLoading=!0,Dt.savePurgeDataSettings(t,this.settings).finally((function(){e.isLoading=!1}))},reloadDbStats:function(){Dt.updateSettings(this.settings)},save:function(){var e=this;if(this.enabled){var t="deleteLogsConfirm";Dt.enableDeleteReports.value&&(t="deleteBothConfirm"),Mt("#confirmDeleteSettings").find(">h2").hide(),Mt("#".concat(t)).show(),X["Matomo"].helper.modalConfirm("#confirmDeleteSettings",{yes:function(){e.saveSettings()}})}else this.saveSettings()}},computed:{settings:function(){return{enableDeleteLogs:!!this.enabled,deleteLogsOlderThan:this.deleteOlderThan}},deleteOlderThanTitle:function(){return"".concat(Object(X["translate"])("PrivacyManager_DeleteLogsOlderThan")," (").concat(Object(X["translate"])("Intl_PeriodDays"),")")}}});At.render=Pt;var zt=At,It={id:"formDeleteSettings"},Ft={id:"deleteReportsSettingEnabled"},Tt={class:"alert alert-warning",style:{width:"50%"}},xt=Object(i["createElementVNode"])("br",null,null,-1),Lt=Object(i["createElementVNode"])("br",null,null,-1),Bt={id:"deleteReportsSettings"};function Ut(e,t,n,a,o,l){var r=Object(i["resolveComponent"])("Field"),c=Object(i["resolveComponent"])("SaveButton"),s=Object(i["resolveDirective"])("form");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",It,[Object(i["createElementVNode"])("div",Ft,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"checkbox",name:"deleteReportsEnable","model-value":e.enabled,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.enabled=t,e.reloadDbStats()}),title:e.translate("PrivacyManager_UseDeleteReports"),"inline-help":e.translate("PrivacyManager_DeleteAggregateReportsDetailedInfo")},null,8,["model-value","title","inline-help"])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Tt,[Object(i["createElementVNode"])("span",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteReportsInfo2",e.deleteOldLogsText)),1),xt,Lt,Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteReportsInfo3",e.deleteOldLogsText)),1)])],512),[[i["vShow"],e.enabled]])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Bt,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"text",name:"deleteReportsOlderThan","model-value":e.deleteOlderThan,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.deleteOlderThan=t,e.reloadDbStats()}),title:e.deleteReportsOlderThanTitle,"inline-help":e.translate("PrivacyManager_LeastMonthsInput","1")},null,8,["model-value","title","inline-help"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"checkbox",name:"deleteReportsKeepBasic","model-value":e.keepBasic,"onUpdate:modelValue":t[2]||(t[2]=function(t){e.keepBasic=t,e.reloadDbStats()}),title:e.deleteReportsKeepBasicTitle,"inline-help":e.translate("PrivacyManager_KeepBasicMetricsReportsDetailedInfo")},null,8,["model-value","title","inline-help"])]),Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_KeepDataFor")),1),Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"checkbox",name:"deleteReportsKeepDay","model-value":e.keepDataForDay,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.keepDataForDay=t,e.reloadDbStats()}),title:e.translate("General_DailyReports")},null,8,["model-value","title"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"checkbox",name:"deleteReportsKeepWeek","model-value":e.keepDataForWeek,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.keepDataForWeek=t,e.reloadDbStats()}),title:e.translate("General_WeeklyReports")},null,8,["model-value","title"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"checkbox",name:"deleteReportsKeepMonth","model-value":e.keepDataForMonth,"onUpdate:modelValue":t[5]||(t[5]=function(t){e.keepDataForMonth=t,e.reloadDbStats()}),title:"".concat(e.translate("General_MonthlyReports")," (").concat(e.translate("General_Recommended"),")")},null,8,["model-value","title"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"checkbox",name:"deleteReportsKeepYear","model-value":e.keepDataForYear,"onUpdate:modelValue":t[6]||(t[6]=function(t){e.keepDataForYear=t,e.reloadDbStats()}),title:"".concat(e.translate("General_YearlyReports")," (").concat(e.translate("General_Recommended"),")")},null,8,["model-value","title"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"checkbox",name:"deleteReportsKeepRange","model-value":e.keepDataForRange,"onUpdate:modelValue":t[7]||(t[7]=function(t){e.keepDataForRange=t,e.reloadDbStats()}),title:e.translate("General_RangeReports")},null,8,["model-value","title"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"checkbox",name:"deleteReportsKeepSegments","model-value":e.keepDataForSegments,"onUpdate:modelValue":t[8]||(t[8]=function(t){e.keepDataForSegments=t,e.reloadDbStats()}),title:e.translate("PrivacyManager_KeepReportSegments")},null,8,["model-value","title"])])])],512),[[i["vShow"],e.enabled]]),Object(i["createVNode"])(c,{onConfirm:t[9]||(t[9]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])],512)),[[s]])}function Rt(e){return e?"1":"0"}var Ht=window,Gt=Ht.$,qt=Object(i["defineComponent"])({props:{isDataPurgeSettingsEnabled:Boolean,deleteData:{type:Object,required:!0},scheduleDeletionOptions:{type:Object,required:!0}},components:{Field:ee["Field"],SaveButton:ee["SaveButton"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,enabled:1===parseInt(this.deleteData.config.delete_reports_enable,10),deleteOlderThan:this.deleteData.config.delete_reports_older_than,keepBasic:1===parseInt(this.deleteData.config.delete_reports_keep_basic_metrics,10),keepDataForDay:1===parseInt(this.deleteData.config.delete_reports_keep_day_reports,10),keepDataForWeek:1===parseInt(this.deleteData.config.delete_reports_keep_week_reports,10),keepDataForMonth:1===parseInt(this.deleteData.config.delete_reports_keep_month_reports,10),keepDataForYear:1===parseInt(this.deleteData.config.delete_reports_keep_year_reports,10),keepDataForRange:1===parseInt(this.deleteData.config.delete_reports_keep_range_reports,10),keepDataForSegments:1===parseInt(this.deleteData.config.delete_reports_keep_segment_reports,10)}},created:function(){var e=this;setTimeout((function(){Dt.initSettings(e.settings)}))},methods:{saveSettings:function(){var e=this,t="PrivacyManager.setDeleteReportsSettings";this.isLoading=!0,Dt.savePurgeDataSettings(t,this.settings).finally((function(){e.isLoading=!1}))},reloadDbStats:function(){Dt.updateSettings(this.settings)},save:function(){var e=this;if(this.enabled){var t="deleteReportsConfirm";Dt.enableDeleteLogs.value&&(t="deleteBothConfirm"),Gt("#confirmDeleteSettings").find(">h2").hide(),Gt("#".concat(t)).show(),X["Matomo"].helper.modalConfirm("#confirmDeleteSettings",{yes:function(){e.saveSettings()}})}else this.saveSettings()}},computed:{settings:function(){return{enableDeleteReports:this.enabled,deleteReportsOlderThan:this.deleteOlderThan,keepBasic:Rt(this.keepBasic),keepDay:Rt(this.keepDataForDay),keepWeek:Rt(this.keepDataForWeek),keepMonth:Rt(this.keepDataForMonth),keepYear:Rt(this.keepDataForYear),keepRange:Rt(this.keepDataForRange),keepSegments:Rt(this.keepDataForSegments)}},deleteOldLogsText:function(){return Object(X["translate"])("PrivacyManager_UseDeleteLog")},deleteReportsOlderThanTitle:function(){var e=Object(X["translate"])("PrivacyManager_DeleteReportsOlderThan");return"".concat(e," (").concat(Object(X["translate"])("Intl_PeriodMonths"),")")},deleteReportsKeepBasicTitle:function(){var e=Object(X["translate"])("PrivacyManager_KeepBasicMetrics");return"".concat(e," (").concat(Object(X["translate"])("General_Recommended"),")")}}});qt.render=Ut;var Kt=qt,Wt={id:"formDeleteSettings"},$t={id:"deleteSchedulingSettings"},Yt={id:"deleteSchedulingSettingsInlineHelp",class:"inline-help-node"},Jt={key:0},Qt=Object(i["createElementVNode"])("br",null,null,-1),Xt=Object(i["createElementVNode"])("br",null,null,-1),Zt=Object(i["createElementVNode"])("br",null,null,-1),en=Object(i["createElementVNode"])("br",null,null,-1),tn={key:0,id:"deleteDataEstimateSect",class:"form-group row"},nn={class:"col s12",id:"databaseSizeHeadline"},an={class:"col s12 m6"},on=["innerHTML"],ln=Object(i["createTextVNode"])(" "),rn={class:"col s12 m6"},cn={key:0,class:"form-help"};function sn(e,t,n,a,o,l){var r=Object(i["resolveComponent"])("ActivityIndicator"),c=Object(i["resolveComponent"])("Field"),s=Object(i["resolveComponent"])("SaveButton"),d=Object(i["resolveComponent"])("ContentBlock"),u=Object(i["resolveDirective"])("form");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Wt,[Object(i["withDirectives"])(Object(i["createVNode"])(d,{id:"scheduleSettingsHeadline","content-title":e.translate("PrivacyManager_DeleteSchedulingSettings")},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",$t,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{uicontrol:"select",name:"deleteLowestInterval",title:e.translate("PrivacyManager_DeleteDataInterval"),modelValue:e.deleteLowestInterval,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.deleteLowestInterval=t}),options:e.scheduleDeletionOptions},{"inline-help":Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",Yt,[e.deleteData.lastRun?(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",Jt,[Object(i["createElementVNode"])("strong",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_LastDelete"))+":",1),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.deleteData.lastRunPretty)+" ",1),Qt,Xt])):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("strong",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_NextDelete"))+":",1),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.deleteData.nextRunPretty)+" ",1),Zt,en,Object(i["withDirectives"])(Object(i["createElementVNode"])("a",{id:"purgeDataNowLink",href:"#",onClick:t[0]||(t[0]=function(t){return e.executeDataPurgeNow()})},Object(i["toDisplayString"])(e.translate("PrivacyManager_PurgeNow")),513),[[i["vShow"],e.showPurgeNowLink]]),Object(i["createVNode"])(r,{"loading-message":e.translate("PrivacyManager_PurgingData"),loading:e.loadingDataPurge},null,8,["loading-message","loading"]),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",{id:"db-purged-message"},Object(i["toDisplayString"])(e.translate("PrivacyManager_DBPurged")),513),[[i["vShow"],e.dataWasPurged]])])]})),_:1},8,["title","modelValue","options"])])]),"1"===e.deleteData.config.enable_database_size_estimate||1===e.deleteData.config.enable_database_size_estimate?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",tn,[Object(i["createElementVNode"])("h3",nn,Object(i["toDisplayString"])(e.translate("PrivacyManager_ReportsDataSavedEstimate")),1),Object(i["createElementVNode"])("div",an,[Object(i["withDirectives"])(Object(i["createElementVNode"])("div",{id:"deleteDataEstimate",innerHTML:e.$sanitize(e.estimation)},null,8,on),[[i["vShow"],e.showEstimate]]),ln,Object(i["createVNode"])(r,{loading:e.loadingEstimation},null,8,["loading"])]),Object(i["createElementVNode"])("div",rn,["1"!==e.deleteData.config.enable_auto_database_size_estimate&&1!==e.deleteData.config.enable_auto_database_size_estimate?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",cn,[Object(i["createElementVNode"])("a",{id:"getPurgeEstimateLink",href:"#",onClick:t[2]||(t[2]=Object(i["withModifiers"])((function(t){return e.getPurgeEstimate()}),["prevent"]))},Object(i["toDisplayString"])(e.translate("PrivacyManager_GetPurgeEstimate")),1)])):Object(i["createCommentVNode"])("",!0)])])):Object(i["createCommentVNode"])("",!0),Object(i["createVNode"])(s,{onConfirm:t[3]||(t[3]=function(t){return e.save()}),saving:e.isLoading},null,8,["saving"])]})),_:1},8,["content-title"]),[[i["vShow"],e.isEitherDeleteSectionEnabled]])],512)),[[u]])}var dn=Object(i["defineComponent"])({props:{isDataPurgeSettingsEnabled:Boolean,deleteData:{type:Object,required:!0},scheduleDeletionOptions:{type:Object,required:!0}},components:{ContentBlock:X["ContentBlock"],ActivityIndicator:X["ActivityIndicator"],Field:ee["Field"],SaveButton:ee["SaveButton"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,loadingDataPurge:!1,dataWasPurged:!1,showPurgeNowLink:!0,deleteLowestInterval:this.deleteData.config.delete_logs_schedule_lowest_interval}},methods:{save:function(){var e="PrivacyManager.setScheduleReportDeletionSettings";Dt.savePurgeDataSettings(e,{deleteLowestInterval:this.deleteLowestInterval})},executeDataPurgeNow:function(){var e=this;Dt.state.value.isModified?X["Matomo"].helper.modalConfirm("#saveSettingsBeforePurge",{yes:function(){return null}}):X["Matomo"].helper.modalConfirm("#confirmPurgeNow",{yes:function(){e.loadingDataPurge=!0,e.showPurgeNowLink=!1,X["AjaxHelper"].fetch({module:"PrivacyManager",action:"executeDataPurge",format:"html"},{withTokenInUrl:!0}).then((function(){Dt.reloadDbStats(),e.dataWasPurged=!0,setTimeout((function(){e.dataWasPurged=!1,e.showPurgeNowLink=!0}),2e3)})).finally((function(){e.loadingDataPurge=!1}))}})},getPurgeEstimate:function(){return Dt.reloadDbStats(!0)}},computed:{showEstimate:function(){return Dt.state.value.showEstimate},isEitherDeleteSectionEnabled:function(){return Dt.isEitherDeleteSectionEnabled()},estimation:function(){return Dt.state.value.estimation},loadingEstimation:function(){return Dt.state.value.loadingEstimation}}});dn.render=sn;var un=dn; /*! * Matomo - free/libre analytics platform * diff --git a/plugins/PrivacyManager/vue/dist/umd.metadata.json b/plugins/PrivacyManager/vue/dist/umd.metadata.json index 3abfd129f0..66244dc900 100644 --- a/plugins/PrivacyManager/vue/dist/umd.metadata.json +++ b/plugins/PrivacyManager/vue/dist/umd.metadata.json @@ -1,7 +1,7 @@ { "dependsOn": [ "CoreHome", - "CorePluginsAdmin", - "SegmentEditor" + "SegmentEditor", + "CorePluginsAdmin" ] }
\ No newline at end of file diff --git a/plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.adapter.ts b/plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.adapter.ts new file mode 100644 index 0000000000..750141b6af --- /dev/null +++ b/plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.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 { createAngularJsAdapter } from 'CoreHome'; +import OptOutCustomizer from './OptOutCustomizer.vue'; + +export default createAngularJsAdapter({ + component: OptOutCustomizer, + scope: { + language: { + angularJsBind: '@', + }, + piwikurl: { + angularJsBind: '@', + }, + }, + directiveName: 'piwikOptOutCustomizer', +}); diff --git a/plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.directive.less b/plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.less index 6ef302393b..6ef302393b 100644 --- a/plugins/PrivacyManager/angularjs/opt-out-customizer/opt-out-customizer.directive.less +++ b/plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.less diff --git a/plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.vue b/plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.vue new file mode 100644 index 0000000000..f894c40c30 --- /dev/null +++ b/plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.vue @@ -0,0 +1,220 @@ +<!-- + 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="optOutCustomizer"> + <p> + {{ translate('CoreAdminHome_OptOutExplanation') }} + <span + v-html="$sanitize(readThisToLearnMore)" + /> + </p> + <h3>{{ translate('PrivacyManager_OptOutCustomize') }}</h3> + <div> + <p> + <span> + {{ translate('PrivacyManager_FontColor') }}: + <input + type="color" + :value="fontColor" + @keydown="onFontColorChange($event)" + @change="onFontColorChange($event)" + /> + </span> + <span> + {{ translate('PrivacyManager_BackgroundColor') }}: + <input + type="color" + :value="backgroundColor" + @keydown="onBgColorChange($event)" + @change="onBgColorChange($event)" + /> + </span> + <span> + {{ translate('PrivacyManager_FontSize') }}: + <input + id="FontSizeInput" + type="number" + min="1" + max="100" + @keydown="onFontSizeChange($event)" + @change="onFontSizeChange($event)" + /> + </span> + <span> + <select + class="browser-default" + @keydown="onFontSizeUnitChange($event)" + @change="onFontSizeUnitChange($event)" + > + <option value="px">px</option> + <option value="pt">pt</option> + <option value="em">em</option> + <option value="rem">rem</option> + <option value="%">%</option> + </select> + </span> + <span> + {{ translate('PrivacyManager_FontFamily') }}: + <input + id="FontFamilyInput" + type="text" + @keydown="onFontFamilyChange($event)" + @change="onFontFamilyChange($event)" + /> + </span> + </p> + </div> + <h3>{{ translate('PrivacyManager_OptOutHtmlCode') }}</h3> + <pre v-select-on-focus="{}" ref="pre"><iframe + style="border: 0; height: 200px; width: 600px;" + src="{{ iframeUrl }}" + ></iframe></pre> + <p + v-html="$sanitize(optOutExplanationIntro)"> + </p> + <h3>{{ translate('PrivacyManager_OptOutPreview') }}</h3> + <iframe + id="previewIframe" + style="border: 1px solid #333; height: 200px; width: 600px;" + :src="iframeUrl" + :class="{ withBg }" + /> + </div> +</template> + +<script lang="ts"> +/* eslint-disable no-mixed-operators */ +/* eslint-disable no-bitwise */ + +import { defineComponent } from 'vue'; +import { + translate, + SelectOnFocus, + MatomoUrl, + debounce, +} from 'CoreHome'; + +interface OptOutCustomizerState { + fontSizeUnit: string; + backgroundColor: string; + fontColor: string; + fontSize: string; + fontFamily: string; +} + +function nearlyWhite(hex: string) { + const bigint = parseInt(hex, 16); + const r = bigint >> 16 & 255; + const g = bigint >> 8 & 255; + const b = bigint & 255; + return r >= 225 && g >= 225 && b >= 225; +} + +const { $ } = window; + +export default defineComponent({ + props: { + language: { + type: String, + required: true, + }, + piwikurl: String, + }, + directives: { + SelectOnFocus, + }, + data(): OptOutCustomizerState { + return { + fontSizeUnit: 'px', + backgroundColor: '', + fontColor: '', + fontSize: '', + fontFamily: '', + }; + }, + created() { + this.onFontColorChange = debounce(this.onFontColorChange, 50); + this.onBgColorChange = debounce(this.onBgColorChange, 50); + this.onFontSizeChange = debounce(this.onFontSizeChange, 50); + this.onFontSizeUnitChange = debounce(this.onFontSizeUnitChange, 50); + this.onFontFamilyChange = debounce(this.onFontFamilyChange, 50); + }, + methods: { + onFontColorChange(event: Event) { + this.fontColor = (event.target as HTMLInputElement).value; + }, + onBgColorChange(event: Event) { + this.backgroundColor = (event.target as HTMLInputElement).value; + }, + onFontSizeChange(event: Event) { + this.fontSize = (event.target as HTMLInputElement).value; + }, + onFontSizeUnitChange(event: Event) { + this.fontSizeUnit = (event.target as HTMLInputElement).value; + }, + onFontFamilyChange(event: Event) { + this.fontFamily = (event.target as HTMLInputElement).value; + }, + }, + watch: { + iframeUrl() { + const pre = this.$refs.pre as HTMLElement; + const isAnimationAlreadyRunning = $(pre).queue('fx').length > 0; + if (!isAnimationAlreadyRunning) { + $(pre).effect('highlight', {}, 1500); + } + }, + }, + computed: { + fontSizeWithUnit(): string { + if (this.fontSize) { + return `${this.fontSize}${this.fontSizeUnit}`; + } + + return ''; + }, + withBg(): boolean { + return !!this.piwikurl + && this.backgroundColor === '' + && this.fontColor !== '' + && nearlyWhite(this.fontColor.substr(1)); + }, + iframeUrl(): string { + if (this.piwikurl) { + const query = MatomoUrl.stringify({ + module: 'CoreAdminHome', + action: 'optOut', + language: this.language, + backgroundColor: this.backgroundColor.substr(1), + fontColor: this.fontColor.substr(1), + fontSize: this.fontSizeWithUnit, + fontFamily: this.fontFamily, + }); + + return `${this.piwikurl}index.php?${query}`; + } + + return ''; + }, + readThisToLearnMore() { + const link = 'https://matomo.org/faq/how-to/faq_25918/'; + return translate( + 'General_ReadThisToLearnMore', + `<a rel='noreferrer noopener' target='_blank' href='${link}'>`, + '</a>', + ); + }, + optOutExplanationIntro() { + return translate( + 'CoreAdminHome_OptOutExplanationIntro', + `<a href="${this.iframeUrl}" rel="noreferrer noopener" target="_blank">`, + '</a>', + ); + }, + }, +}); +</script> diff --git a/plugins/PrivacyManager/vue/src/index.ts b/plugins/PrivacyManager/vue/src/index.ts index a62cd90413..5d475fa9ca 100644 --- a/plugins/PrivacyManager/vue/src/index.ts +++ b/plugins/PrivacyManager/vue/src/index.ts @@ -7,6 +7,7 @@ export { default as ManageGdpr } from './ManageGdpr/ManageGdpr.vue'; export { default as AnonymizeIp } from './AnonymizeIp/AnonymizeIp.vue'; +export { default as OptOutCustomizer } from './OptOutCustomizer/OptOutCustomizer.vue'; export { default as AnonymizeLogData } from './AnonymizeLogData/AnonymizeLogData.vue'; export { default as DoNotTrackPreference } from './DoNotTrackPreference/DoNotTrackPreference.vue'; export { diff --git a/plugins/SitesManager/vue/dist/umd.metadata.json b/plugins/SitesManager/vue/dist/umd.metadata.json index 6eb1c55162..dce4477a3c 100644 --- a/plugins/SitesManager/vue/dist/umd.metadata.json +++ b/plugins/SitesManager/vue/dist/umd.metadata.json @@ -1,6 +1,6 @@ { "dependsOn": [ - "CorePluginsAdmin", - "CoreHome" + "CoreHome", + "CorePluginsAdmin" ] }
\ No newline at end of file |