diff options
author | Ben Burgess <88810029+bx80@users.noreply.github.com> | 2022-09-09 07:08:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-09 07:08:01 +0300 |
commit | 178c87bdba89ec714805e346d97fdda7af79498c (patch) | |
tree | 94522a17183c1f3517be02596fa12abfadce091c | |
parent | 437dfd2e2b21d3aa875d33d4a095ff784a26a310 (diff) |
Improved opt out (#19528)
* New opt out UI, self-contained code - WIP
* Updated translation
* built vue files
* Added OptOutJS functionality, code improvements, show custom guide link on UI
* Rebuild Vue
* built vue files
* Fix typo
* Default iframe out-out to show intro, minor code tidy, updated UI test screenshots
* built vue files
* Replaced let with var
* Improved warning when opt-out content div is missing, added info box to recommend testing
* built vue files
* Update UI test screenshots
* Show intro parameter show as zero if not set, hide opt out complete message if not showing intro, added additional opt out url exclusions, reverted incorrect regex adjustments
* built vue files
* Annotated new core home embed code methods as internal
* Simplify code
Co-authored-by: Stefan Giehl <stefan@matomo.org>
* Updated parameter name, added trailing url trimming
* Added language choice selection for self-contained opt-out code
* Increased test_TotalPiwikFilesSize_isWithinReasonnableSize size from 58MiB to 60MiB
* Adjust layout
* Update UI test screenshot
* Prevent session start for optOutJS controller method
* Fix conflicts
* Fix for vue error
* built vue files
* Added content type and cache control headers when serving the opt out javascript
* Added option to apply styling (disabled by default), improved reminder box visibility, updated developer log, added what's new, added title to opt-out developer guide section
* built vue files
* Fix typo
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
* Update tests
* Update UI test screenshot
* Moved inline CSS style to less
* built vue files
* Update UI test screenshot
* Update test reminder section style
* built vue files
* Update UI test screenshot
* Accept cookie path and cookie domain as URL parameters, revert loading (incorrect) cookie settings from config
* Bump to retry random test fail
* Local vue build
* built vue files
* Added blog post link to the what's new notification
* Update UI test screenshot
* Update "What's New?" link url
Co-authored-by: bx80 <bx80@users.noreply.github.com>
Co-authored-by: Stefan Giehl <stefan@matomo.org>
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
22 files changed, 1027 insertions, 156 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index d57015bafd..29b6ee8b4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,10 @@ The Product Changelog at **[matomo.org/changelog](https://matomo.org/changelog)* * Added new event `Login.userRequiresPasswordConfirmation`, which can be used in login plugins to circumvent the password confirmation in UI and for certain API methods +### New Privacy Opt-Out Options + +* The privacy manager iframe opt-out UI has been replaced with a choice of either generating JavaScript opt-out code which uses the Matomo tracker, or generating self-contained JavaScript opt-out code which directly sets the consent cookies. Existing iframe opt-outs will still work, but iframe opt-out code will no longer be generated by the UI as support for third party cookies in iframes is being discontinued by most major browsers. + ### JavaScript Tracker #### New APIs diff --git a/core/FrontController.php b/core/FrontController.php index 3227ffa330..36ebdb0f37 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -539,7 +539,7 @@ class FrontController extends Singleton protected function handleSSLRedirection() { // Specifically disable for the opt out iframe - if (Piwik::getModule() == 'CoreAdminHome' && Piwik::getAction() == 'optOut') { + if (Piwik::getModule() == 'CoreAdminHome' && (Piwik::getAction() == 'optOut' || Piwik::getAction() == 'optOutJS')) { return; } // Disable Https for VisitorGenerator @@ -706,6 +706,7 @@ class FrontController extends Singleton // so we do it here, if this is not an API request. if (SettingsPiwik::isMatomoInstalled() && ($module !== 'API' || ($action && $action !== 'index')) + && !($module === 'CoreAdminHome' && $action === 'optOutJS') ) { /** * @ignore diff --git a/core/Session.php b/core/Session.php index 096914e6e0..e802705aa2 100644 --- a/core/Session.php +++ b/core/Session.php @@ -174,7 +174,7 @@ class Session extends Zend_Session $method = Common::getRequestVar('method', '', 'string'); $referer = Url::getReferrer(); - $isOptOutRequest = $module == 'CoreAdminHome' && $action == 'optOut'; + $isOptOutRequest = $module == 'CoreAdminHome' && ($action == 'optOut' || $action == 'optOutJS'); $shouldUseNone = !empty($general['enable_framed_pages']) || $isOptOutRequest || Overlay::isOverlayRequest($module, $action, $method, $referer); if ($shouldUseNone && ProxyHttp::isHttps()) { diff --git a/plugins/CoreAdminHome/API.php b/plugins/CoreAdminHome/API.php index b922733c45..4b0e4380c2 100644 --- a/plugins/CoreAdminHome/API.php +++ b/plugins/CoreAdminHome/API.php @@ -48,11 +48,18 @@ class API extends \Piwik\Plugin\API */ private $trackingFailures; - public function __construct(Scheduler $scheduler, ArchiveInvalidator $invalidator, Failures $trackingFailures) + /** + * @var OptOutManager + */ + private $optOutManager; + + public function __construct(Scheduler $scheduler, ArchiveInvalidator $invalidator, Failures $trackingFailures, + OptOutManager $optOutManager) { $this->scheduler = $scheduler; $this->invalidator = $invalidator; $this->trackingFailures = $trackingFailures; + $this->optOutManager = $optOutManager; } /** @@ -335,4 +342,52 @@ class API extends \Piwik\Plugin\API return array($toInvalidate, $invalidDates); } + + /** + * Show the JavaScript opt out code + * + * @param string $backgroundColor + * @param string $fontColor + * @param string $fontSize + * @param string $fontFamily + * @param bool $applyStyling + * @param bool $showIntro + * @param string $matomoUrl + * @param string $language + * + * @return string + * + * @internal + */ + public function getOptOutJSEmbedCode(string $backgroundColor, string $fontColor, + string $fontSize, string $fontFamily, bool $applyStyling, bool $showIntro, + string $matomoUrl, string $language): string + { + + return $this->optOutManager->getOptOutJSEmbedCode($matomoUrl, $language, $backgroundColor, $fontColor, $fontSize, + $fontFamily, $applyStyling, $showIntro); + } + + /** + * Show the self-contained JavaScript opt out code + * + * @param string $backgroundColor + * @param string $fontColor + * @param string $fontSize + * @param string $fontFamily + * @param bool $applyStyling + * @param bool $showIntro + * + * @return string + * + * @internal + */ + public function getOptOutSelfContainedEmbedCode(string $backgroundColor, + string $fontColor, string $fontSize, string $fontFamily, + bool $applyStyling = false, bool $showIntro = true): string + { + return $this->optOutManager->getOptOutSelfContainedEmbedCode($backgroundColor, $fontColor, $fontSize, $fontFamily, $applyStyling, $showIntro); + } + + }
\ No newline at end of file diff --git a/plugins/CoreAdminHome/Controller.php b/plugins/CoreAdminHome/Controller.php index 20283d6d4c..4af369a7ae 100644 --- a/plugins/CoreAdminHome/Controller.php +++ b/plugins/CoreAdminHome/Controller.php @@ -255,11 +255,24 @@ class Controller extends ControllerAdmin } /** - * Shows the "Track Visits" checkbox. + * Shows the "Track Visits" checkbox - iFrame (deprecated) */ public function optOut() { - return $this->optOutManager->getOptOutView()->render(); + return $this->optOutManager->getOptOutViewIframe()->render(); + } + + /** + * Shows the Javascript opt out + * + * @return string + * @throws Exception + */ + public function optOutJS(): string + { + Common::sendHeader('Content-Type: application/javascript; charset=utf-8'); + Common::sendHeader('Cache-Control: no-store'); + return $this->optOutManager->getOptOutJS(); } public function uploadCustomLogo() diff --git a/plugins/CoreAdminHome/OptOutManager.php b/plugins/CoreAdminHome/OptOutManager.php index 5f994e2559..927e3ad630 100644 --- a/plugins/CoreAdminHome/OptOutManager.php +++ b/plugins/CoreAdminHome/OptOutManager.php @@ -10,6 +10,7 @@ namespace Piwik\Plugins\CoreAdminHome; use Piwik\Common; use Piwik\Nonce; +use Piwik\Piwik; use Piwik\Plugins\LanguagesManager\API as APILanguagesManager; use Piwik\Plugins\LanguagesManager\LanguagesManager; use Piwik\Plugins\PrivacyManager\DoNotTrackHeaderChecker; @@ -17,6 +18,27 @@ use Piwik\Tracker\IgnoreCookie; use Piwik\Url; use Piwik\View; +/* + * There are three different opt-out choices: + * + * iFrame : an <iframe> tag is added to the webpage with a Matomo URL as the source, this URL serves the opt-out + * content and sets the opt-out cookie for the Matomo URL domain. Translation and styling is done + * server side, a third party cookie is set. Not well supported with modern browser third party cookie + * restrictions, no longer offered as an option in the UI but the content URL is supported for existing + * webpages still using the iFrame code. + * + * JavaScript : an empty <div> tag is added to the webpage along with a <script> reference which loads dynamic + * JavaScript from a Matomo URL, the JavaScript then populates the empty div with the opt-out content. + * Translation and styling is read server side and built into the JavaScript, the Matomo tracker is + * used to set a first party cookie if it is loaded, otherwise the first party cookie is set directly. + * Can be broken by ad blockers that prevent third party scripts. + * + * Self-Contained: an empty <div> tag is added to the webpage along with an inline <script> tag containing the entire + * opt-out JavaScript. Translation and styling are built into the script when it is generated by the UI + * and any changes require modifying the code on each webpage. A first party cookie is set. It is + * unlikely that the script will be blocked as it is fully self-contained and part of the webpage. + * + */ class OptOutManager { /** @var DoNotTrackHeaderChecker */ @@ -38,7 +60,7 @@ class OptOutManager private $queryParameters = array(); /** - * @param DoNotTrackHeaderChecker $doNotTrackHeaderChecker + * @param DoNotTrackHeaderChecker|null $doNotTrackHeaderChecker */ public function __construct(DoNotTrackHeaderChecker $doNotTrackHeaderChecker = null) { @@ -158,10 +180,349 @@ class OptOutManager } /** + * Return the HTML code to be added to pages for the JavaScript opt-out + * + * @param string $matomoUrl + * @param string $language + * @param string $backgroundColor + * @param string $fontColor + * @param string $fontSize + * @param string $fontFamily + * @param bool $applyStyling + * @param bool $showIntro + * + * @return string + */ + public function getOptOutJSEmbedCode(string $matomoUrl, string $language, string $backgroundColor, string $fontColor, + string $fontSize, string $fontFamily, bool $applyStyling, bool $showIntro): string + { + return '<div id="matomo-opt-out"></div> +<script src="'.rtrim($matomoUrl, '/').'/index.php?module=CoreAdminHome&action=optOutJS&div=matomo-opt-out&language='.$language.($applyStyling ? '&backgroundColor='.$backgroundColor.'&fontColor='.$fontColor.'&fontSize='.$fontSize.'&fontFamily='.$fontFamily : '').'&showIntro='.($showIntro ? '1' : '0').'"></script>'; + } + + /** + * Return the HTML code to be added to pages for the self-contained opt-out + * + * @param string $backgroundColor + * @param string $fontColor + * @param string $fontSize + * @param string $fontFamily + * @param bool $applyStyling + * @param bool $showIntro + * + * @return string + */ + public function getOptOutSelfContainedEmbedCode(string $backgroundColor, string $fontColor, string $fontSize, + string $fontFamily, bool $applyStyling, bool $showIntro): string + { + + $cookiePath = Common::getRequestVar('cookiePath', '', 'string'); + $cookieDomain = Common::getRequestVar('cookieDomain', '', 'string'); + + $settings = [ + 'showIntro' => $showIntro, + 'divId' => 'matomo-opt-out', + 'useSecureCookies' => true, + 'cookiePath' => ($cookiePath !== '' ? $cookiePath : null), + 'cookieDomain' => ($cookieDomain !== '' ? $cookieDomain : null), + 'cookieSameSite' => Common::getRequestVar('cookieSameSite', 'Lax', 'string'), + ]; + + // Self contained code translations are static and always use the language of the user who generated the embed code + $settings = array_merge($settings, $this->getTranslations()); + $settingsString = 'var settings = '.json_encode($settings).';'; + + $styleSheet = $this->optOutStyling($fontSize, $fontColor, $fontFamily, $backgroundColor, true); + +$code = <<<HTML +<div id="matomo-opt-out" style=""></div> +<script> + var settings = {}; + document.addEventListener('DOMContentLoaded', function() { + window.MatomoConsent.init(settings.useSecureCookies, settings.cookiePath, settings.cookieDomain, settings.cookieSameSite); + showContent(window.MatomoConsent.hasConsent()); + }); + + window.MatomoConsent = { }; +</script> +HTML; + return str_replace('window.MatomoConsent = { };', $this->getOptOutCommonJS(), + str_replace('style=""', ($applyStyling ? 'style="'.$styleSheet.'"' : ''), + str_replace("var settings = {};", $settingsString, $code))); + } + + /** + * Generate and return JavaScript to show the opt-out option + * + * All optOutJS URL params: + * backgroundColor + * fontColor + * fontSize + * fontFamily + * language (default "auto") Language code for the translations or "auto" to use the browser language + * showIntro (default 1) Should the opt-out intro text be shown? + * divId (default "matomo-opt-out") The id of the div which will contain the opt-out form + * useCookiesIfNoTracker (default 1) Should consent cookies be read/written directly if the tracker can't be found? + * useCookiesTimeout (default 10) How long to wait for the tracker to be detected? + * useSecureCookies (default 1) Set secure cookies? + * cookiePath (default blank) Use this path for consent cookies + * cookieDomain (default blank) Use this domain for consent cookies + * + * @return string + */ + public function getOptOutJS() : string + { + + $language = Common::getRequestVar('language', 'auto', 'string'); + $showIntro = Common::getRequestVar('showIntro', 1, 'int'); + $divId = Common::getRequestVar('divId', 'matomo-opt-out', 'string'); + $useCookiesIfNoTracker = Common::getRequestVar('useCookiesIfNoTracker', 1, 'int'); + $useCookiesTimeout = Common::getRequestVar('useCookiesTimeout', 10, 'int'); + $useSecureCookies = Common::getRequestVar('useSecureCookies', 1, 'int'); + $cookiePath = Common::getRequestVar('cookiePath', '', 'string'); + $cookieDomain = Common::getRequestVar('cookieDomain', '', 'string'); + + // If the language parameter is 'auto' then use the browser language + if ($language === 'auto') { + $language = Common::extractLanguageCodeFromBrowserLanguage(Common::getBrowserLanguage(), + APILanguagesManager::getInstance()->getAvailableLanguages()); + } + + $settings = [ + 'showIntro' => $showIntro, + 'divId' => $divId, + 'useSecureCookies' => $useSecureCookies, + 'cookiePath' => ($cookiePath !== '' ? $cookiePath : null), + 'cookieDomain' => ($cookieDomain !== '' ? $cookieDomain : null), + 'useCookiesIfNoTracker' => $useCookiesIfNoTracker, + 'useCookiesTimeout' => $useCookiesTimeout, + ]; + + // Self contained code translations are static and always use the language of the user who generated the embed code + $translations = $this->getTranslations($language); + $translations['OptOutErrorNoTracker'] = Piwik::translate('CoreAdminHome_OptOutErrorNoTracker', [], $language); + $settings = array_merge($settings, $translations); + $settingsString = 'var settings = '.json_encode($settings).';'; + + $styleSheet = $this->optOutStyling(null, null, null, null, true); + + /** @lang JavaScript */ + $code = <<<JS + + var settings = {}; + var checkForTrackerTried = 0; + var checkForTrackerTries = (settings.useCookiesTimeout * 4); + var checkForTrackerInterval = 250; + var optOutDiv = null; + + function optOutInit() { + optOutDiv = document.getElementById(settings.divId); + if (optOutDiv) { + optOutDiv.style.cssText += 'stylecss'; // Appending css to avoid overwritting existing inline div styles + } else { + showContent(false, null, true); // will show unable to find opt-out div error + return; + } + checkForMatomoTracker(); + } + + function checkForMatomoTracker() { + if (typeof _paq !== 'undefined') { + showOptOutTracker(); + return; + } + + if (checkForTrackerTried < checkForTrackerTries) { + setTimeout(checkForMatomoTracker, checkForTrackerInterval); + checkForTrackerTried++; + return; + } + + if (settings.useCookiesIfNoTracker) { + showOptOutDirect(); + return; + } + + console.log('Matomo OptOutJS: failed to find Matomo tracker after '+(checkForTrackerTries*checkForTrackerInterval / 1000)+' seconds'); + } + + function showOptOutTracker() { + _paq.push([function () { + if (settings.cookieDomain) { + _paq.push(['setCookieDomain', settings.cookieDomain]); + } + if (settings.cookiePath) { + _paq.push(['setCookiePath', settings.cookiePath]); + } + if (this.isUserOptedOut()) { + _paq.push(['forgetUserOptOut']); + showContent(false, null, true); + } else { + _paq.push(['optUserOut']); + showContent(true, null, true); + } + }]); + } + + function showOptOutDirect() { + window.MatomoConsent.init(settings.useSecureCookies, settings.cookiePath, settings.cookieDomain, settings.cookieSameSite); + showContent(window.MatomoConsent.hasConsent()); + } + + document.addEventListener('DOMContentLoaded', optOutInit()); + + window.MatomoConsent = { }; +JS; + + return str_replace('window.MatomoConsent = { };', $this->getOptOutCommonJS(), + str_replace('stylecss', $styleSheet, + str_replace("var settings = {};", $settingsString, $code))); + + } + + /** + * Return the shared opt-out JavaScript (used by self-contained and tracker versions) + * + * @return string + */ + private function getOptOutCommonJS() : string + { + /** @lang JavaScript */ + return <<<JS + + function showContent(consent, errorMessage = null, useTracker = false) { + + var errorBlock = '<p style="color: red; font-weight: bold;">'; + + var div = document.getElementById(settings.divId); + if (!div) { + const warningDiv = document.createElement("div"); + var msg = 'Unable to find opt-out content div: "'+settings.divId+'"'; + warningDiv.id = settings.divId+'-warning'; + warningDiv.innerHTML = errorBlock+msg+'</p>'; + document.body.insertBefore(warningDiv, document.body.firstChild); + console.log(msg); + return; + } + + if (!navigator || !navigator.cookieEnabled) { + div.innerHTML = errorBlock+settings.OptOutErrorNoCookies+'</p>'; + return; + } + if (location.protocol !== 'https:') { + div.innerHTML = errorBlock+settings.OptOutErrorNotHttps+'</p>'; + return; + } + if (errorMessage !== null) { + div.innerHTML = errorBlock+errorMessage+'</p>'; + return; + } + var content = ''; + if (consent) { + if (settings.showIntro) { + content += '<p>'+settings.YouMayOptOut2+' '+settings.YouMayOptOut3+'</p>'; + } + if (useTracker) { + content += '<input onclick="_paq.push([\'optUserOut\']);showContent(false, null, true);" id="trackVisits" type="checkbox" checked="checked" />'; + } else { + content += '<input onclick="window.MatomoConsent.consentRevoked();showContent(false);" id="trackVisits" type="checkbox" checked="checked" />'; + } + content += '<label for="trackVisits"><strong><span>'+settings.YouAreNotOptedOut+' '+settings.UncheckToOptOut+'</span></strong></label>'; + } else { + if (settings.showIntro) { + content += '<p>'+settings.OptOutComplete+' '+settings.OptOutCompleteBis+'</p>'; + } + if (useTracker) { + content += '<input onclick="_paq.push([\'forgetUserOptOut\']);showContent(true, null, true);" id="trackVisits" type="checkbox" />'; + } else { + content += '<input onclick="window.MatomoConsent.consentGiven();showContent(true);" id="trackVisits" type="checkbox" />'; + } + content += '<label for="trackVisits"><strong><span>'+settings.YouAreOptedOut+' '+settings.CheckToOptIn+'</span></strong></label>'; + } + div.innerHTML = content; + }; + + window.MatomoConsent = { + cookiesDisabled: (!navigator || !navigator.cookieEnabled), + CONSENT_COOKIE_NAME: 'mtm_consent', CONSENT_REMOVED_COOKIE_NAME: 'mtm_consent_removed', + cookieIsSecure: false, useSecureCookies: true, cookiePath: '', cookieDomain: '', cookieSameSite: 'Lax', + init: function(useSecureCookies, cookiePath, cookieDomain, cookieSameSite) { + this.useSecureCookies = useSecureCookies; this.cookiePath = cookiePath; + this.cookieDomain = cookieDomain; this.cookieSameSite = cookieSameSite; + if(useSecureCookies && location.protocol !== 'https:') { + console.log('Error with setting useSecureCookies: You cannot use this option on http.'); + } else { + this.cookieIsSecure = useSecureCookies; + } + }, + hasConsent: function() { + var value = this.getCookie(this.CONSENT_COOKIE_NAME); + if (this.getCookie(this.CONSENT_REMOVED_COOKIE_NAME) && value) { + this.setCookie(this.CONSENT_COOKIE_NAME, '', -129600000); + return false; + } + return (value || value !== 0); + }, + consentGiven: function() { + this.setCookie(this.CONSENT_REMOVED_COOKIE_NAME, '', -129600000); + this.setCookie(this.CONSENT_COOKIE_NAME, new Date().getTime(), 946080000000); + }, + consentRevoked: function() { + this.setCookie(this.CONSENT_COOKIE_NAME, '', -129600000); + this.setCookie(this.CONSENT_REMOVED_COOKIE_NAME, new Date().getTime(), 946080000000); + }, + getCookie: function(cookieName) { + var cookiePattern = new RegExp('(^|;)[ ]*' + cookieName + '=([^;]*)'), cookieMatch = cookiePattern.exec(document.cookie); + return cookieMatch ? window.decodeURIComponent(cookieMatch[2]) : 0; + }, + setCookie: function(cookieName, value, msToExpire) { + var expiryDate = new Date(); + expiryDate.setTime((new Date().getTime()) + msToExpire); + document.cookie = cookieName + '=' + window.encodeURIComponent(value) + + (msToExpire ? ';expires=' + expiryDate.toGMTString() : '') + + ';path=' + (this.cookiePath || '/') + + (this.cookieDomain ? ';domain=' + this.cookieDomain : '') + + (this.cookieIsSecure ? ';secure' : '') + + ';SameSite=' + this.cookieSameSite; + if ((!msToExpire || msToExpire >= 0) && this.getCookie(cookieName) !== String(value)) { + console.log('There was an error setting cookie `' + cookieName + '`. Please check domain and path.'); + } + } + }; +JS; + + } + + /** + * Get translations used by the opt-out popup + * + * @param string|null $language + * + * @return array + */ + private function getTranslations(string $language = null) : array + { + return [ + 'OptOutComplete' => Piwik::translate('CoreAdminHome_OptOutComplete', [], $language), + 'OptOutCompleteBis' => Piwik::translate('CoreAdminHome_OptOutCompleteBis', [], $language), + 'YouMayOptOut2' => Piwik::translate('CoreAdminHome_YouMayOptOut2', [], $language), + 'YouMayOptOut3' => Piwik::translate('CoreAdminHome_YouMayOptOut3', [], $language), + 'OptOutErrorNoCookies' => Piwik::translate('CoreAdminHome_OptOutErrorNoCookies', [], $language), + 'OptOutErrorNotHttps' => Piwik::translate('CoreAdminHome_OptOutErrorNotHttps', [], $language), + 'YouAreNotOptedOut' => Piwik::translate('CoreAdminHome_YouAreNotOptedOut', [], $language), + 'UncheckToOptOut' => Piwik::translate('CoreAdminHome_UncheckToOptOut', [], $language), + 'YouAreOptedOut' => Piwik::translate('CoreAdminHome_YouAreOptedOut', [], $language), + 'CheckToOptIn' => Piwik::translate('CoreAdminHome_CheckToOptIn', [], $language), + ]; + } + + /** + * Return the content of the iFrame opt out + * * @return View * @throws \Exception */ - public function getOptOutView() + public function getOptOutViewIFrame() { if ($this->view) { return $this->view; @@ -182,7 +543,7 @@ class OptOutManager $reloadUrl = Url::getCurrentQueryStringWithParametersModified(array( 'showConfirmOnly' => 1, 'setCookieInNewWindow' => 0, - 'nonce' => $nonce ? $nonce : '' + 'nonce' => $nonce ? : '' )); } else { $reloadUrl = false; @@ -210,7 +571,9 @@ class OptOutManager 'nonce' => $nonce ), false); - $this->addStylesheet($this->optOutStyling()); + if (Common::getRequestVar('applyStyling', 1, 'int')) { + $this->addStylesheet($this->optOutStyling()); + } $this->view = new View("@CoreAdminHome/optOut"); @@ -221,6 +584,7 @@ class OptOutManager $this->view->trackVisits = $trackVisits; $this->view->nonce = $nonce; $this->view->language = $lang; + $this->view->showIntro = Common::getRequestVar('showIntro', 1, 'int'); $this->view->showConfirmOnly = Common::getRequestVar('showConfirmOnly', false, 'int'); $this->view->reloadUrl = $reloadUrl; $this->view->javascripts = $this->getJavaScripts(); @@ -230,13 +594,31 @@ class OptOutManager return $this->view; } - private function optOutStyling() + /** + * Provide a CSS style sheet based on the chosen opt out style options + * + * @param string|null $fontSize + * @param string|null $fontColor + * @param string|null $fontFamily + * @param string|null $backgroundColor + * @param bool $noBody + * + * @return string + * @throws \Exception + */ + private function optOutStyling(?string $fontSize = null, ?string $fontColor = null, ?string $fontFamily = null, + ?string $backgroundColor = null, bool $noBody = false): string { - $cssfontsize = Common::unsanitizeInputValue(Common::getRequestVar('fontSize', false, 'string')); - $cssfontcolour = Common::unsanitizeInputValue(Common::getRequestVar('fontColor', false, 'string')); - $cssfontfamily = Common::unsanitizeInputValue(Common::getRequestVar('fontFamily', false, 'string')); - $cssbackgroundcolor = Common::unsanitizeInputValue(Common::getRequestVar('backgroundColor', false, 'string')); - $cssbody = 'body { '; + $cssfontsize = ($fontSize ? : Common::unsanitizeInputValue(Common::getRequestVar('fontSize', false, 'string'))); + $cssfontcolour = ($fontColor ? : Common::unsanitizeInputValue(Common::getRequestVar('fontColor', false, 'string'))); + $cssfontfamily = ($fontFamily ? : Common::unsanitizeInputValue(Common::getRequestVar('fontFamily', false, 'string'))); + $cssbackgroundcolor = ($backgroundColor ? : Common::unsanitizeInputValue(Common::getRequestVar('backgroundColor', false, 'string'))); + + if (!$noBody) { + $cssbody = 'body { '; + } else { + $cssbody = ''; + } $hexstrings = array( 'fontColor' => $cssfontcolour, @@ -248,12 +630,14 @@ class OptOutManager } } + /** @noinspection RegExpRedundantEscape */ if ($cssfontsize && (preg_match("/^[0-9]+[\.]?[0-9]*(px|pt|em|rem|%)$/", $cssfontsize))) { $cssbody .= 'font-size: ' . $cssfontsize . '; '; } else if ($cssfontsize) { throw new \Exception("The URL parameter fontSize value of '$cssfontsize' is not valid. Expected value is for example '15pt', '1.2em' or '13px'.\n"); } + /** @noinspection RegExpRedundantEscape */ if ($cssfontfamily && (preg_match('/^[a-zA-Z0-9-\ ,\'"]+$/', $cssfontfamily))) { $cssbody .= 'font-family: ' . $cssfontfamily . '; '; } else if ($cssfontfamily) { @@ -267,7 +651,9 @@ class OptOutManager $cssbody .= 'background-color: #' . $cssbackgroundcolor . '; '; } - $cssbody .= '}'; + if (!$noBody) { + $cssbody .= '}'; + } return $cssbody; } /** diff --git a/plugins/CoreAdminHome/lang/en.json b/plugins/CoreAdminHome/lang/en.json index 92e6d1aaa8..380e0a42cb 100644 --- a/plugins/CoreAdminHome/lang/en.json +++ b/plugins/CoreAdminHome/lang/en.json @@ -91,9 +91,11 @@ "OptOutDntFound": "You are not being tracked since your browser is reporting that you do not want to. This is a setting of your browser so you won't be able to opt-in until you disable the 'Do Not Track' feature.", "OptOutErrorNoCookies": "The tracking opt-out feature requires cookies to be enabled.", "OptOutErrorNotHttps": "The tracking opt-out feature may not work because this site was not loaded over HTTPS. Please reload the page to check if your opt out status changed.", - "OptOutErrorWindowOpen": "The tracking Opt-out feature may not work because it looks like the opt out popup was blocked. Please reload the page to check if your opt out status changed.", + "OptOutErrorWindowOpen": "The tracking opt-out feature may not work because it looks like the opt out popup was blocked. Please reload the page to check if your opt out status changed.", + "OptOutErrorNoTracker": "The tracking opt-out feature was unable to find the Matomo Tracker code on this page", "OptOutExplanation": "Matomo is dedicated to providing privacy on the Internet. To provide your visitors with the choice of opting-out of Matomo Web Analytics, you can add the following HTML code on one of your website page, for example in a Privacy Policy page.", - "OptOutExplanationIntro": "This code will display an iFrame containing a link for your visitors to opt-out of Matomo by setting an opt-out cookie in their web browsers. See below (or %1$sclick here%2$s) to view the content that will be displayed by the iFrame.", + "OptOutExplanationIntro": "This code will display a div containing a link for your visitors to opt-out of Matomo by setting an opt-out cookie in their web browsers. See below (or %1$sclick here%2$s) to view the content that will be displayed by the div.", + "OptOutCustomOptOutLink": "You can also create a completely custom opt-out form using HTML and JavaScript, as explained in this developer %1$sguide%2$s.", "OptOutForYourVisitors": "Matomo opt-out for your visitors", "OptingYouOut": "Opting you out, please wait…", "PersonalPluginSettings": "Personal Plugin Settings", diff --git a/plugins/CoreAdminHome/templates/optOut.twig b/plugins/CoreAdminHome/templates/optOut.twig index 1ad00ea29b..6a81e33ec7 100644 --- a/plugins/CoreAdminHome/templates/optOut.twig +++ b/plugins/CoreAdminHome/templates/optOut.twig @@ -45,6 +45,7 @@ <noscript> {% endif %} + {% if showIntro %} <p id="textOptIn" {% if trackVisits %}style=" display:none"{% endif %}> {{ 'CoreAdminHome_OptOutComplete'|translate }} @@ -53,6 +54,7 @@ <p id="textOptOut" {% if not trackVisits %}style="display:none"{% endif %}> {{ 'CoreAdminHome_YouMayOptOut2'|translate }} {{ 'CoreAdminHome_YouMayOptOut3'|translate }} </p> + {% endif %} <p id="textError_cookies" style="display:none; color: red; font-weight: bold;" %}> {{ 'CoreAdminHome_OptOutErrorNoCookies'|translate }} diff --git a/plugins/CoreHome/LoginAllowlist.php b/plugins/CoreHome/LoginAllowlist.php index 5101e7e3d9..630d50de85 100644 --- a/plugins/CoreHome/LoginAllowlist.php +++ b/plugins/CoreHome/LoginAllowlist.php @@ -34,8 +34,11 @@ class LoginAllowlist return false; } - // ignore whitelist checks for opt out iframe - if (!SettingsServer::isTrackerApiRequest() && 'CoreAdminHome' === Piwik::getModule() && 'optOut' === Piwik::getAction()) { + // ignore whitelist checks for opt out iframe or opt out JS + if (!SettingsServer::isTrackerApiRequest() + && (('CoreAdminHome' === Piwik::getModule() && ('optOut' === Piwik::getAction() || 'optOutJS' === Piwik::getAction()))) + ) + { return false; } diff --git a/plugins/CoreHome/tests/Integration/ChangesTest.php b/plugins/CoreHome/tests/Integration/ChangesTest.php index 3c22ad03f3..f722b15324 100644 --- a/plugins/CoreHome/tests/Integration/ChangesTest.php +++ b/plugins/CoreHome/tests/Integration/ChangesTest.php @@ -27,7 +27,7 @@ class ChangesTest extends IntegrationTestCase public function test_CoreHomeChanges_ShouldSortChangeListMostRecentFirst() { - $json = '{"idchange":5,"plugin_name":"CoreHome","version":"4.6.0b5","title":"New feature x added","description":"Now you can do a with b like this","link_name":"For more information go here","link":"https:\/\/www.matomo.org"}'; + $json = '{"idchange":6,"plugin_name":"CoreHome","version":"4.6.0b5","title":"New feature x added","description":"Now you can do a with b like this","link_name":"For more information go here","link":"https:\/\/www.matomo.org"}'; $changesModel = new ChangesModel(); $changes = $changesModel->getChangeItems(); $r = reset($changes); @@ -37,7 +37,7 @@ class ChangesTest extends IntegrationTestCase public function test_CoreHomeChanges_ShouldAllowChangeItemAddWithoutLink() { - $json = '{"idchange":4,"plugin_name":"CoreHome","version":"4.5.0","title":"New feature y added","description":"Now you can do c with d like this","link_name":null,"link":null}'; + $json = '{"idchange":5,"plugin_name":"CoreHome","version":"4.5.0","title":"New feature y added","description":"Now you can do c with d like this","link_name":null,"link":null}'; $changesModel = new ChangesModel(); $changes = $changesModel->getChangeItems(); $r = $changes[1]; diff --git a/plugins/CoreHome/tests/UI/expected-screenshots/Changes_show_popover.png b/plugins/CoreHome/tests/UI/expected-screenshots/Changes_show_popover.png index bd5f69163c..1e99a11bb8 100644 --- a/plugins/CoreHome/tests/UI/expected-screenshots/Changes_show_popover.png +++ b/plugins/CoreHome/tests/UI/expected-screenshots/Changes_show_popover.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f844aa8ae955f79da1581be5763ba61d01774043be2b5856df5f3b7894dbc24c -size 72788 +oid sha256:67388f4d2ea66a2e8e47a7c2d722088e7ea5b319ecfaf78dc1cc9dd1e5beaa2b +size 103258 diff --git a/plugins/PrivacyManager/Controller.php b/plugins/PrivacyManager/Controller.php index bc4241ee6a..189b0ae748 100644 --- a/plugins/PrivacyManager/Controller.php +++ b/plugins/PrivacyManager/Controller.php @@ -20,6 +20,7 @@ use Piwik\Piwik; use Piwik\Plugin\Manager; use Piwik\Plugins\CustomJsTracker\File; use Piwik\Plugins\LanguagesManager\LanguagesManager; +use Piwik\Plugins\LanguagesManager\API as APILanguagesManager; use Piwik\Scheduler\Scheduler; use Piwik\Tracker\TrackerCodeGenerator; use Piwik\View; @@ -59,7 +60,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin */ private function getPurgeSettingsFromRequest() { - $settings = array(); + $settings = []; // delete logs settings $settings['delete_logs_enable'] = Common::getRequestVar("enableDeleteLogs", 0); @@ -131,22 +132,33 @@ class Controller extends \Piwik\Plugin\ControllerAdmin Piwik::checkUserHasSomeAdminAccess(); $language = LanguagesManager::getLanguageCodeForCurrentUser(); - $doNotTrackOptions = array( - array('key' => '1', + $doNotTrackOptions = [ + ['key' => '1', 'value' => Piwik::translate('PrivacyManager_DoNotTrack_Enable'), - 'description' => Piwik::translate('General_Recommended')), - array('key' => '0', + 'description' => Piwik::translate('General_Recommended')], + ['key' => '0', 'value' => Piwik::translate('PrivacyManager_DoNotTrack_Disable'), - 'description' => Piwik::translate('General_NotRecommended')) - ); + 'description' => Piwik::translate('General_NotRecommended')] + ]; $dntChecker = new DoNotTrackHeaderChecker(); - return $this->renderTemplate('usersOptOut', array( + $languages = APILanguagesManager::getInstance()->getAvailableLanguageNames(); + $languageOptions = []; + foreach ($languages as $language) { + $languageOptions[] = [ + 'key' => $language['code'], + 'value' => $language['name'] + ]; + } + + return $this->renderTemplate('usersOptOut', [ 'language' => $language, + 'currentLanguageCode' => LanguagesManager::getLanguageCodeForCurrentUser(), + 'languageOptions' => $languageOptions, 'doNotTrackOptions' => $doNotTrackOptions, 'dntSupport' => $dntChecker->isActive() - )); + ]); } public function consent() @@ -202,38 +214,38 @@ class Controller extends \Piwik\Plugin\ControllerAdmin $view->deactivateNonce = Nonce::getNonce(self::DEACTIVATE_DNT_NONCE); $view->activateNonce = Nonce::getNonce(self::ACTIVATE_DNT_NONCE); - $view->maskLengthOptions = array( - array('key' => '1', - 'value' => Piwik::translate('PrivacyManager_AnonymizeIpMaskLength', array("1","192.168.100.xxx")), - 'description' => ''), - array('key' => '2', - 'value' => Piwik::translate('PrivacyManager_AnonymizeIpMaskLength', array("2","192.168.xxx.xxx")), - 'description' => Piwik::translate('General_Recommended')), - array('key' => '3', - 'value' => Piwik::translate('PrivacyManager_AnonymizeIpMaskLength', array("3","192.xxx.xxx.xxx")), - 'description' => ''), - array('key' => '4', + $view->maskLengthOptions = [ + ['key' => '1', + 'value' => Piwik::translate('PrivacyManager_AnonymizeIpMaskLength', ["1","192.168.100.xxx"]), + 'description' => ''], + ['key' => '2', + 'value' => Piwik::translate('PrivacyManager_AnonymizeIpMaskLength', ["2","192.168.xxx.xxx"]), + 'description' => Piwik::translate('General_Recommended')], + ['key' => '3', + 'value' => Piwik::translate('PrivacyManager_AnonymizeIpMaskLength', ["3","192.xxx.xxx.xxx"]), + 'description' => ''], + ['key' => '4', 'value' => Piwik::translate('PrivacyManager_AnonymizeIpMaskFully'), - 'description' => '') - ); - $view->useAnonymizedIpForVisitEnrichmentOptions = array( - array('key' => '1', + 'description' => ''] + ]; + $view->useAnonymizedIpForVisitEnrichmentOptions = [ + ['key' => '1', 'value' => Piwik::translate('General_Yes'), - 'description' => Piwik::translate('PrivacyManager_RecommendedForPrivacy')), - array( + 'description' => Piwik::translate('PrivacyManager_RecommendedForPrivacy')], + [ 'key' => '0', 'value' => Piwik::translate('General_No'), 'description' => '' - ) - ); - $view->scheduleDeletionOptions = array( - array('key' => '1', - 'value' => Piwik::translate('Intl_PeriodDay')), - array('key' => '7', - 'value' => Piwik::translate('Intl_PeriodWeek')), - array('key' => '30', - 'value' => Piwik::translate('Intl_PeriodMonth')) - ); + ] + ]; + $view->scheduleDeletionOptions = [ + ['key' => '1', + 'value' => Piwik::translate('Intl_PeriodDay')], + ['key' => '7', + 'value' => Piwik::translate('Intl_PeriodWeek')], + ['key' => '30', + 'value' => Piwik::translate('Intl_PeriodMonth')] + ]; $view->referrerAnonymizationOptions = $this->referrerAnonymizer->getAvailableAnonymizationOptions(); } $view->language = LanguagesManager::getLanguageCodeForCurrentUser(); @@ -267,9 +279,9 @@ class Controller extends \Piwik\Plugin\ControllerAdmin } $formatter = new Formatter(); - $result = array( + $result = [ 'currentSize' => $formatter->getPrettySizeFromBytes($totalBytes) - ); + ]; // if the db size estimate feature is enabled, get the estimate if ($doDatabaseSizeEstimate || $forceEstimate == 1) { @@ -305,7 +317,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin private function getAnonymizeIPInfo() { Piwik::checkUserHasSuperUserAccess(); - $anonymizeIP = array(); + $anonymizeIP = []; $privacyConfig = new Config(); $anonymizeIP["enabled"] = IPAnonymizer::isActive(); @@ -325,7 +337,7 @@ class Controller extends \Piwik\Plugin\ControllerAdmin private function getDeleteDataInfo() { Piwik::checkUserHasSuperUserAccess(); - $deleteDataInfos = array(); + $deleteDataInfos = []; $deleteDataInfos["config"] = PrivacyManager::getPurgeDataSettings(); $deleteDataInfos["deleteTables"] = "<br/>" . implode(", ", LogDataPurger::getDeleteTableLogTables()); diff --git a/plugins/PrivacyManager/PrivacyManager.php b/plugins/PrivacyManager/PrivacyManager.php index 4e81c8cf11..3629488e57 100644 --- a/plugins/PrivacyManager/PrivacyManager.php +++ b/plugins/PrivacyManager/PrivacyManager.php @@ -241,6 +241,7 @@ class PrivacyManager extends Plugin { $translationKeys[] = 'CoreAdminHome_OptOutExplanation'; $translationKeys[] = 'CoreAdminHome_OptOutExplanationIntro'; + $translationKeys[] = 'CoreAdminHome_OptOutCustomOptOutLink'; $translationKeys[] = 'CoreAdminHome_SettingsSaveSuccess'; $translationKeys[] = 'General_Action'; $translationKeys[] = 'General_ClickHere'; @@ -282,7 +283,9 @@ class PrivacyManager extends Plugin $translationKeys[] = 'PrivacyManager_AnonymizeSites'; $translationKeys[] = 'PrivacyManager_AnonymizeUserId'; $translationKeys[] = 'PrivacyManager_AnonymizeUserIdHelp'; + $translationKeys[] = 'PrivacyManager_ApplyStyling'; $translationKeys[] = 'PrivacyManager_BackgroundColor'; + $translationKeys[] = 'PrivacyManager_BuildYourOwn'; $translationKeys[] = 'PrivacyManager_DBPurged'; $translationKeys[] = 'PrivacyManager_DeleteAggregateReportsDetailedInfo'; $translationKeys[] = 'PrivacyManager_DeleteBothConfirm'; @@ -329,9 +332,19 @@ class PrivacyManager extends Plugin $translationKeys[] = 'PrivacyManager_MatchingDataSubjects'; $translationKeys[] = 'PrivacyManager_NextDelete'; $translationKeys[] = 'PrivacyManager_NoDataSubjectsFound'; + $translationKeys[] = 'PrivacyManager_OptOutAppearance'; $translationKeys[] = 'PrivacyManager_OptOutCustomize'; $translationKeys[] = 'PrivacyManager_OptOutHtmlCode'; $translationKeys[] = 'PrivacyManager_OptOutPreview'; + $translationKeys[] = 'PrivacyManager_OptOutUseTracker'; + $translationKeys[] = 'PrivacyManager_OptOutUseStandalone'; + $translationKeys[] = 'PrivacyManager_OptOutCodeTypeExplanation'; + $translationKeys[] = 'PrivacyManager_OptOutRememberToTest'; + $translationKeys[] = 'PrivacyManager_OptOutRememberToTestBody'; + $translationKeys[] = 'PrivacyManager_OptOutRememberToTestStep1'; + $translationKeys[] = 'PrivacyManager_OptOutRememberToTestStep2'; + $translationKeys[] = 'PrivacyManager_OptOutRememberToTestStep3'; + $translationKeys[] = 'PrivacyManager_OptOutRememberToTestStep4'; $translationKeys[] = 'PrivacyManager_PseudonymizeUserId'; $translationKeys[] = 'PrivacyManager_PseudonymizeUserIdNote'; $translationKeys[] = 'PrivacyManager_PseudonymizeUserIdNote2'; @@ -344,6 +357,7 @@ class PrivacyManager extends Plugin $translationKeys[] = 'PrivacyManager_SaveSettingsBeforePurge'; $translationKeys[] = 'PrivacyManager_SearchForDataSubject'; $translationKeys[] = 'PrivacyManager_SelectWebsite'; + $translationKeys[] = 'PrivacyManager_ShowIntro'; $translationKeys[] = 'PrivacyManager_UnsetActionColumns'; $translationKeys[] = 'PrivacyManager_UnsetActionColumnsHelp'; $translationKeys[] = 'PrivacyManager_UnsetVisitColumns'; diff --git a/plugins/PrivacyManager/changes.json b/plugins/PrivacyManager/changes.json new file mode 100644 index 0000000000..9a3f42abea --- /dev/null +++ b/plugins/PrivacyManager/changes.json @@ -0,0 +1,9 @@ +[ + { + "title": "Privacy Manager - User Opt-Out Improvements", + "description": "The privacy manager user opt-out has been updated to provide new code generation options that improve compatibility and allow additional customisation.", + "version": "4.12.0", + "link_name": "For more information go here", + "link": "https://matomo.org/blog/2022/09/weve-improved-the-opt-out-feature" + } +]
\ No newline at end of file diff --git a/plugins/PrivacyManager/lang/en.json b/plugins/PrivacyManager/lang/en.json index 7271aad3f1..067bda31bf 100644 --- a/plugins/PrivacyManager/lang/en.json +++ b/plugins/PrivacyManager/lang/en.json @@ -161,13 +161,26 @@ "UseAnonymizeTrackingData": "Anonymize Tracking Data", "UseAnonymizeUserId": "Anonymize User ID", "PseudonymizeUserId": "Replace User ID with a pseudonym", - "OptOutCustomize": "Customize the Opt-out iframe", + "OptOutAppearance": "Customize the opt-out appearance", + "OptOutCustomize": "Customize the opt-out iframe", "OptOutHtmlCode": "HTML code to embed on your website", "OptOutPreview": "Preview of the Opt-out as it will appear on your website", + "OptOutCodeTypeExplanation": "The opt-out can either be set by using the Matomo tracker code which means less code to add to your website pages and less likely to need updating in the future, or using standalone code which is more likely to work for visitors with script blockers but will need to be updated on each webpage if you change any settings.", + "OptOutUseTracker": "Use the Matomo tracker code to set the opt out", + "OptOutUseStandalone": "Use self-contained code to set the opt out", + "OptOutRememberToTest": "Remember to test your opt-out!", + "OptOutRememberToTestBody": "To ensure that your opt-out is working properly with your website it is recommended to perform the following quick test after adding the opt out code.", + "OptOutRememberToTestStep1": "Browse to your main website page.", + "OptOutRememberToTestStep2": "Once the page has loaded you should see the opt-out box.", + "OptOutRememberToTestStep3": "Unchecking the checkbox to opt-out should show the opted-out message.", + "OptOutRememberToTestStep4": "Checking the checkbox to opt-in should show the opted-in message.", "FontColor": "Font Color", "FontSize": "Font Size", "FontFamily": "Font Family", "BackgroundColor": "Background Color", + "ShowIntro": "Show introduction text", + "ApplyStyling": "Apply a custom style", + "BuildYourOwn": "Build Your Own", "TrackingOptOut": "Let users opt-out of tracking", "UseAnonymizeOrderId": "Anonymize Order ID", "UseDeleteLog": "Regularly delete old raw data from the database", diff --git a/plugins/PrivacyManager/templates/usersOptOut.twig b/plugins/PrivacyManager/templates/usersOptOut.twig index 8d8af0e218..1f51e7cdad 100644 --- a/plugins/PrivacyManager/templates/usersOptOut.twig +++ b/plugins/PrivacyManager/templates/usersOptOut.twig @@ -4,7 +4,11 @@ {% block content %} <div piwik-content-block content-title="{{ 'PrivacyManager_TrackingOptOut'|translate|e('html_attr') }}"> - <div vue-entry="PrivacyManager.OptOutCustomizer" piwikurl="{{ piwikUrl }}" language="{{ language }}"> + <div vue-entry="PrivacyManager.OptOutCustomizer" + matomo-url="{{ piwikUrl }}" + current-language-code="{{ currentLanguageCode }}" + language-options="{{ languageOptions|json_encode|e('html_attr') }}" + > </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 1e1ad7a3ae..fd8d9d0fa5 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:eec1af1a85700d4dee52736d02efc228a9cca205dccf0801e6179a178ff32841 -size 153732 +oid sha256:b9a1693bfdabc6c080495bfce4d5a34859e85c3e1ef097d3536a36415978a1f0 +size 234967 diff --git a/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.js b/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.js index 040c2de781..a30435825a 100644 --- a/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.js +++ b/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.js @@ -824,77 +824,136 @@ function configBoolToInt(value) { AnonymizeIpvue_type_script_lang_ts.render = AnonymizeIpvue_type_template_id_3a6e17ea_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=5d0d1c62 +// 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=6dd3db1e -var OptOutCustomizervue_type_template_id_5d0d1c62_hoisted_1 = { +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_1 = { class: "optOutCustomizer" }; -var OptOutCustomizervue_type_template_id_5d0d1c62_hoisted_2 = ["innerHTML"]; -var OptOutCustomizervue_type_template_id_5d0d1c62_hoisted_3 = ["value"]; -var OptOutCustomizervue_type_template_id_5d0d1c62_hoisted_4 = ["value"]; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_2 = ["innerHTML"]; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_3 = { + key: 0, + id: "opt-out-styling" +}; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_4 = ["value"]; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_5 = ["value"]; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_6 = ["value"]; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_7 = ["value"]; -var OptOutCustomizervue_type_template_id_5d0d1c62_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_6dd3db1e_hoisted_8 = /*#__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_5d0d1c62_hoisted_10 = [OptOutCustomizervue_type_template_id_5d0d1c62_hoisted_5]; -var OptOutCustomizervue_type_template_id_5d0d1c62_hoisted_11 = { +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_13 = [OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_8]; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_14 = ["value"]; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_15 = ["src"]; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_16 = { + class: "form-group row" +}; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_17 = { + class: "col s12 m6" +}; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_18 = { + for: "codeType1" +}; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_19 = { + for: "codeType2" +}; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_20 = { + key: 0 +}; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_21 = { + class: "col s12 m6" +}; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_22 = ["innerHTML"]; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_23 = { ref: "pre" }; -var OptOutCustomizervue_type_template_id_5d0d1c62_hoisted_12 = ["innerHTML"]; -var OptOutCustomizervue_type_template_id_5d0d1c62_hoisted_13 = ["src"]; -function OptOutCustomizervue_type_template_id_5d0d1c62_render(_ctx, _cache, $props, $setup, $data, $options) { +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_24 = ["innerHTML"]; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_25 = { + class: "system notification notification-info optOutTestReminder" +}; +var OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_26 = ["innerHTML"]; +function OptOutCustomizervue_type_template_id_6dd3db1e_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field"); + 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_5d0d1c62_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", { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", OptOutCustomizervue_type_template_id_6dd3db1e_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_5d0d1c62_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", { + }, null, 8, OptOutCustomizervue_type_template_id_6dd3db1e_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_OptOutAppearance')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + id: "applyStyling", + type: "checkbox", + name: "applyStyling", + "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { + return _ctx.applyStyling = $event; + }), + onKeydown: _cache[1] || (_cache[1] = function ($event) { + return _ctx.updateCode(); + }), + onChange: _cache[2] || (_cache[2] = function ($event) { + return _ctx.updateCode(); + }) + }, null, 544), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelCheckbox"], _ctx.applyStyling]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_ApplyStyling')), 1)])])]), _ctx.applyStyling ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_3, [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) { + onKeydown: _cache[3] || (_cache[3] = function ($event) { return _ctx.onFontColorChange($event); }), - onChange: _cache[1] || (_cache[1] = function ($event) { + onChange: _cache[4] || (_cache[4] = function ($event) { return _ctx.onFontColorChange($event); }) - }, null, 40, OptOutCustomizervue_type_template_id_5d0d1c62_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", { + }, null, 40, OptOutCustomizervue_type_template_id_6dd3db1e_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_BackgroundColor')) + ": ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { type: "color", value: _ctx.backgroundColor, - onKeydown: _cache[2] || (_cache[2] = function ($event) { + onKeydown: _cache[5] || (_cache[5] = function ($event) { return _ctx.onBgColorChange($event); }), - onChange: _cache[3] || (_cache[3] = function ($event) { + onChange: _cache[6] || (_cache[6] = function ($event) { return _ctx.onBgColorChange($event); }) - }, null, 40, OptOutCustomizervue_type_template_id_5d0d1c62_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", { + }, null, 40, OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_5)]), 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) { + value: _ctx.fontSize, + onKeydown: _cache[7] || (_cache[7] = function ($event) { return _ctx.onFontSizeChange($event); }), - onChange: _cache[5] || (_cache[5] = function ($event) { + onChange: _cache[8] || (_cache[8] = 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", { + }, null, 40, OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_6)]), 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) { + value: _ctx.fontSizeUnit, + onKeydown: _cache[9] || (_cache[9] = function ($event) { return _ctx.onFontSizeUnitChange($event); }), - onChange: _cache[7] || (_cache[7] = function ($event) { + onChange: _cache[10] || (_cache[10] = function ($event) { return _ctx.onFontSizeUnitChange($event); }) - }, OptOutCustomizervue_type_template_id_5d0d1c62_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", { + }, OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_13, 40, OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_7)]), 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) { + value: _ctx.fontFamily, + onKeydown: _cache[11] || (_cache[11] = function ($event) { return _ctx.onFontFamilyChange($event); }), - onChange: _cache[9] || (_cache[9] = function ($event) { + onChange: _cache[12] || (_cache[12] = 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_5d0d1c62_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_5d0d1c62_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", { + }, null, 40, OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_14)])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + id: "showIntro", + type: "checkbox", + name: "showIntro", + "onUpdate:modelValue": _cache[13] || (_cache[13] = function ($event) { + return _ctx.showIntro = $event; + }), + onKeydown: _cache[14] || (_cache[14] = function ($event) { + return _ctx.updateCode(); + }), + onChange: _cache[15] || (_cache[15] = function ($event) { + return _ctx.updateCode(); + }) + }, null, 544), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelCheckbox"], _ctx.showIntro]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_ShowIntro')), 1)])])]), 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", @@ -905,9 +964,59 @@ function OptOutCustomizervue_type_template_id_5d0d1c62_render(_ctx, _cache, $pro class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])({ withBg: _ctx.withBg }) - }, null, 10, OptOutCustomizervue_type_template_id_5d0d1c62_hoisted_13)]); + }, null, 10, OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_15)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_16, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_17, [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_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_18, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "radio", + id: "codeType1", + name: "codeType", + value: "tracker", + "onUpdate:modelValue": _cache[16] || (_cache[16] = function ($event) { + return _ctx.codeType = $event; + }), + onKeydown: _cache[17] || (_cache[17] = function ($event) { + return _ctx.updateCode(); + }), + onChange: _cache[18] || (_cache[18] = function ($event) { + return _ctx.updateCode(); + }) + }, null, 544), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelRadio"], _ctx.codeType]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_OptOutUseTracker')), 1)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_19, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "radio", + id: "codeType2", + name: "codeType", + value: "selfContained", + "onUpdate:modelValue": _cache[19] || (_cache[19] = function ($event) { + return _ctx.codeType = $event; + }), + onKeydown: _cache[20] || (_cache[20] = function ($event) { + return _ctx.updateCode(); + }), + onChange: _cache[21] || (_cache[21] = function ($event) { + return _ctx.updateCode(); + }) + }, null, 544), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelRadio"], _ctx.codeType]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_OptOutUseStandalone')), 1)])]), _ctx.codeType === 'selfContained' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_20, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "select", + name: "language", + modelValue: _ctx.language, + "onUpdate:modelValue": _cache[22] || (_cache[22] = function ($event) { + return _ctx.language = $event; + }), + title: _ctx.translate('General_Language'), + options: _ctx.languageOptions, + onKeydown: _cache[23] || (_cache[23] = function ($event) { + return _ctx.updateCode(); + }), + onChange: _cache[24] || (_cache[24] = function ($event) { + return _ctx.updateCode(); + }) + }, null, 8, ["modelValue", "title", "options"])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_21, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + class: "form-help", + innerHTML: _ctx.$sanitize(_ctx.codeTypeHelp) + }, null, 8, OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_22)])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("pre", OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_23, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])("" + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.codeBox) + "\n ", 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_6dd3db1e_hoisted_24), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_25, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("strong", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_OptOutRememberToTest')), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_OptOutRememberToTestBody')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_OptOutRememberToTestStep1')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_OptOutRememberToTestStep2')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_OptOutRememberToTestStep3')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_OptOutRememberToTestStep4')), 1)])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('PrivacyManager_BuildYourOwn')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", { + innerHTML: _ctx.$sanitize(_ctx.optOutCustomOptOutLink) + }, null, 8, OptOutCustomizervue_type_template_id_6dd3db1e_hoisted_26)])], 64); } -// CONCATENATED MODULE: ./plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.vue?vue&type=template&id=5d0d1c62 +// CONCATENATED MODULE: ./plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.vue?vue&type=template&id=6dd3db1e // 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 */ @@ -916,6 +1025,7 @@ function OptOutCustomizervue_type_template_id_5d0d1c62_render(_ctx, _cache, $pro + function nearlyWhite(hex) { var bigint = parseInt(hex, 16); var r = bigint >> 16 & 255; @@ -928,11 +1038,18 @@ 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: { + currentLanguageCode: { type: String, required: true }, - piwikurl: String + languageOptions: { + type: Object, + required: true + }, + matomoUrl: String + }, + components: { + Field: external_CorePluginsAdmin_["Field"] }, directives: { SelectOnFocus: external_CoreHome_["SelectOnFocus"] @@ -940,10 +1057,15 @@ var _window = window, data: function data() { return { fontSizeUnit: 'px', - backgroundColor: '', - fontColor: '', - fontSize: '', - fontFamily: '' + backgroundColor: '#FFFFFF', + fontColor: '#000000', + fontSize: '12', + fontFamily: 'Arial', + showIntro: true, + applyStyling: false, + codeType: 'tracker', + code: '', + language: this.currentLanguageCode }; }, created: function created() { @@ -952,26 +1074,58 @@ var _window = window, 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); + + if (this.matomoUrl) { + this.updateCode(); + } }, methods: { onFontColorChange: function onFontColorChange(event) { this.fontColor = event.target.value; + this.updateCode(); }, onBgColorChange: function onBgColorChange(event) { this.backgroundColor = event.target.value; + this.updateCode(); }, onFontSizeChange: function onFontSizeChange(event) { this.fontSize = event.target.value; + this.updateCode(); }, onFontSizeUnitChange: function onFontSizeUnitChange(event) { this.fontSizeUnit = event.target.value; + this.updateCode(); }, onFontFamilyChange: function onFontFamilyChange(event) { this.fontFamily = event.target.value; + this.updateCode(); + }, + updateCode: function updateCode() { + var _this = this; + + var methodName = 'CoreAdminHome.getOptOutJSEmbedCode'; + + if (this.codeType === 'selfContained') { + methodName = 'CoreAdminHome.getOptOutSelfContainedEmbedCode'; + } + + external_CoreHome_["AjaxHelper"].fetch({ + method: methodName, + backgroundColor: this.backgroundColor.substr(1), + fontColor: this.fontColor.substr(1), + fontSize: this.fontSizeWithUnit, + fontFamily: this.fontFamily, + showIntro: this.showIntro === true ? 1 : 0, + applyStyling: this.applyStyling === true ? 1 : 0, + matomoUrl: this.matomoUrl, + language: this.codeType === 'selfContained' ? this.language : 'auto' + }).then(function (data) { + _this.code = data.value || ''; + }); } }, watch: { - iframeUrl: function iframeUrl() { + codeBox: function codeBox() { var pre = this.$refs.pre; var isAnimationAlreadyRunning = OptOutCustomizervue_type_script_lang_ts_$(pre).queue('fx').length > 0; @@ -989,30 +1143,42 @@ var _window = window, return ''; }, withBg: function withBg() { - return !!this.piwikurl && this.backgroundColor === '' && this.fontColor !== '' && nearlyWhite(this.fontColor.slice(1)); + return !!this.matomoUrl && this.backgroundColor === '' && this.fontColor !== '' && nearlyWhite(this.fontColor.slice(1)); }, - iframeUrl: function iframeUrl() { - if (this.piwikurl) { - var query = external_CoreHome_["MatomoUrl"].stringify({ - module: 'CoreAdminHome', - action: 'optOut', - language: this.language, - backgroundColor: this.backgroundColor.slice(1), - fontColor: this.fontColor.slice(1), - fontSize: this.fontSizeWithUnit, - fontFamily: this.fontFamily - }); - return "".concat(this.piwikurl, "index.php?").concat(query); + codeBox: function codeBox() { + if (this.matomoUrl) { + return this.code; } return ''; }, + iframeUrl: function iframeUrl() { + 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, + applyStyling: this.applyStyling === true ? 1 : 0, + showIntro: this.showIntro === true ? 1 : 0 + }); + return "".concat(this.matomoUrl, "index.php?").concat(query); + }, 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>'); + }, + optOutCustomOptOutLink: function optOutCustomOptOutLink() { + var link = 'https://developer.matomo.org/guides/tracking-javascript-guide#optional-creating-a-custom-opt-out-form'; + return Object(external_CoreHome_["translate"])('CoreAdminHome_OptOutCustomOptOutLink', "<a href=\"".concat(link, "\" rel=\"noreferrer noopener\" target=\"_blank\">"), '</a>'); + }, + codeTypeHelp: function codeTypeHelp() { + return Object(external_CoreHome_["translate"])('PrivacyManager_OptOutCodeTypeExplanation'); } } })); @@ -1022,7 +1188,7 @@ var _window = window, -OptOutCustomizervue_type_script_lang_ts.render = OptOutCustomizervue_type_template_id_5d0d1c62_render +OptOutCustomizervue_type_script_lang_ts.render = OptOutCustomizervue_type_template_id_6dd3db1e_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=cccc64d4 diff --git a/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.min.js b/plugins/PrivacyManager/vue/dist/PrivacyManager.umd.min.js index 121149da97..e131bc4554 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 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 pe})),n.d(t,"OptOutCustomizer",(function(){return we})),n.d(t,"AnonymizeLogData",(function(){return bt})),n.d(t,"DoNotTrackPreference",(function(){return vt})),n.d(t,"ReportDeletionSettings",(function(){return Vt})),n.d(t,"DeleteOldLogs",(function(){return zt})),n.d(t,"DeleteOldReports",(function(){return $t})),n.d(t,"ScheduleReportDeletion",(function(){return gn})),"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"},O={class:"form-group row segmentFilterGroup"},h={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"},w=["title"],P={class:"visitId"},_={class:"visitorId"},M=["title","onClick"],A={class:"visitorIp"},z=["title","onClick"],F={class:"userId"},I=["title","onClick"],x=["title"],B=["src"],T=["title"],L=["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",O,[Object(i["createElementVNode"])("div",h,[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,w),Object(i["createElementVNode"])("td",P,Object(i["toDisplayString"])(t.idVisit),1),Object(i["createElementVNode"])("td",_,[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",F,[Object(i["createElementVNode"])("a",{title:e.translate("PrivacyManager_AddUserIdToSearch"),onClick:function(n){return e.addFilter("userId",t.userId)}},Object(i["toDisplayString"])(t.userId),9,I)]),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,B)],8,x),Object(i["createElementVNode"])("span",{title:t.operatingSystem,style:{"margin-right":"3.5px"}},[Object(i["createElementVNode"])("img",{height:"16",src:t.operatingSystemIcon},null,8,L)],8,T),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]])}function me(e){return!0===e||1===e||"1"===e?1:0}var be=Object(i["defineComponent"])({props:{anonymizeIpEnabled:Boolean,anonymizeUserId:Boolean,maskLength:{type:Number,required:!0},useAnonymizedIpForVisitEnrichment:[Boolean,String,Number],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:me(this.useAnonymizedIpForVisitEnrichment),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}).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)}}});be.render=ue;var pe=be,ge={class:"optOutCustomizer"},ve=["innerHTML"],Oe=["value"],he=["value"],je=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),fe=[je],ye={ref:"pre"},Ve=["innerHTML"],Se=["src"];function De(e,t,n,a,o,l){var r=Object(i["resolveDirective"])("select-on-focus");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",ge,[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,ve)]),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,Oe)]),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)})},fe,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",ye,[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,Ve),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,Se)])}function Ne(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 Ee=window,Ce=Ee.$,ke=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=Ce(e).queue("fx").length>0;t||Ce(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&&Ne(this.fontColor.slice(1))},iframeUrl:function(){if(this.piwikurl){var e=X["MatomoUrl"].stringify({module:"CoreAdminHome",action:"optOut",language:this.language,backgroundColor:this.backgroundColor.slice(1),fontColor:this.fontColor.slice(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>")}}});ke.render=De;var we=ke,Pe={class:"anonymizeLogData"},_e={class:"form-group row"},Me={class:"col s12 input-field"},Ae={for:"anonymizeSite",class:"siteSelectorLabel"},ze={class:"sites_autocomplete"},Fe={class:"form-group row"},Ie={class:"col s6 input-field"},xe={for:"anonymizeStartDate",class:"active"},Be=["value"],Te={class:"col s6 input-field"},Le={for:"anonymizeEndDate",class:"active"},Ue=["value"],Re={name:"anonymizeIp"},He={name:"anonymizeLocation"},Ge={name:"anonymizeTheUserId"},qe={class:"form-group row"},Ke={class:"col s12 m6"},We={for:"visit_columns"},$e={class:"innerFormField",name:"visit_columns"},Ye=["onClick","title"],Je={class:"col s12 m6"},Qe={class:"form-help"},Xe={class:"inline-help"},Ze={class:"form-group row"},et={class:"col s12"},tt={class:"form-group row"},nt={class:"col s12 m6"},at={for:"action_columns"},ot={class:"innerFormField",name:"action_columns"},it=["onClick","title"],lt={class:"col s12 m6"},rt={class:"form-help"},ct={class:"inline-help"},st=Object(i["createElementVNode"])("span",{class:"icon-info"},null,-1);function dt(e,t,n,a,o,l){var r=Object(i["resolveComponent"])("SiteSelector"),c=Object(i["resolveComponent"])("Field"),s=Object(i["resolveComponent"])("SaveButton"),d=Object(i["resolveComponent"])("PasswordConfirmation");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Pe,[Object(i["createElementVNode"])("div",_e,[Object(i["createElementVNode"])("div",Me,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",Ae,Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeSites")),1),Object(i["createElementVNode"])("div",ze,[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",Fe,[Object(i["createElementVNode"])("div",Ie,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",xe,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,Be)])]),Object(i["createElementVNode"])("div",Te,[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,Ue)])])]),Object(i["createElementVNode"])("div",Re,[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",He,[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",Ge,[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",qe,[Object(i["createElementVNode"])("div",Ke,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",We,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",$e,[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,Ye),[[i["vShow"],n+1!==e.selectedVisitColumns.length]])],2)})),128))])]),Object(i["createElementVNode"])("div",Je,[Object(i["createElementVNode"])("div",Qe,[Object(i["createElementVNode"])("span",Xe,Object(i["toDisplayString"])(e.translate("PrivacyManager_UnsetVisitColumnsHelp")),1)])])]),Object(i["createElementVNode"])("div",Ze,[Object(i["createElementVNode"])("div",et,[Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("General_Action")),1)])]),Object(i["createElementVNode"])("div",tt,[Object(i["createElementVNode"])("div",nt,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",at,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",ot,[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,it),[[i["vShow"],n+1!==e.selectedActionColumns.length]])],2)})),128))])]),Object(i["createElementVNode"])("div",lt,[Object(i["createElementVNode"])("div",rt,[Object(i["createElementVNode"])("span",ct,Object(i["toDisplayString"])(e.translate("PrivacyManager_UnsetActionColumnsHelp")),1)])])]),Object(i["createElementVNode"])("p",null,[st,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.showPasswordConfirmModal=!0}),disabled:e.isAnonymizePastDataDisabled,value:e.translate("PrivacyManager_AnonymizeDataNow")},null,8,["disabled","value"]),Object(i["createVNode"])(d,{modelValue:e.showPasswordConfirmModal,"onUpdate:modelValue":t[9]||(t[9]=function(t){return e.showPasswordConfirmModal=t}),onConfirmed:e.scheduleAnonymization},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeDataConfirm")),1),Object(i["createElementVNode"])("div",null,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])])}function ut(e){return e<10?"0".concat(e):e}var mt=Object(i["defineComponent"])({components:{PasswordConfirmation:ee["PasswordConfirmation"],SiteSelector:X["SiteSelector"],Field:ee["Field"],SaveButton:ee["SaveButton"]},data:function(){var e=new Date,t="".concat(e.getFullYear(),"-").concat(ut(e.getMonth()+1),"-").concat(ut(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,showPasswordConfirmModal:!1}},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(e){var t="".concat(this.startDate,",").concat(this.endDate);this.startDate===this.endDate&&(t=this.startDate);var n={date:t};n.idSites=this.site.id,n.anonymizeIp=this.anonymizeIp?"1":"0",n.anonymizeLocation=this.anonymizeLocation?"1":"0",n.anonymizeUserId=this.anonymizeUserId?"1":"0",n.unsetVisitColumns=this.selectedVisitColumns.filter((function(e){return!(null===e||void 0===e||!e.column)})).map((function(e){return e.column})),n.unsetLinkVisitActionColumns=this.selectedActionColumns.filter((function(e){return!(null===e||void 0===e||!e.column)})).map((function(e){return e.column})),n.passwordConfirmation=e,X["AjaxHelper"].post({method:"PrivacyManager.anonymizeSomeRawData"},n).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}}});mt.render=dt;var bt=mt;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",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 gt=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}))}}});gt.render=pt;var vt=gt;function Ot(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ht(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 jt(e,t,n){return t&&ht(e.prototype,t),n&&ht(e,n),e}function ft(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 pe})),n.d(t,"OptOutCustomizer",(function(){return Re})),n.d(t,"AnonymizeLogData",(function(){return Et})),n.d(t,"DoNotTrackPreference",(function(){return wt})),n.d(t,"ReportDeletionSettings",(function(){return Ft})),n.d(t,"DeleteOldLogs",(function(){return Wt})),n.d(t,"DeleteOldReports",(function(){return cn})),n.d(t,"ScheduleReportDeletion",(function(){return kn})),"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"},O={class:"sites_autocomplete"},j={class:"form-group row segmentFilterGroup"},v={class:"col s12"},h={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"},w=["title"],P={class:"visitId"},_={class:"visitorId"},M=["title","onClick"],A={class:"visitorIp"},z=["title","onClick"],F={class:"userId"},I=["title","onClick"],T=["title"],x=["src"],B=["title"],L=["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",O,[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",j,[Object(i["createElementVNode"])("div",v,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",h,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,w),Object(i["createElementVNode"])("td",P,Object(i["toDisplayString"])(t.idVisit),1),Object(i["createElementVNode"])("td",_,[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",F,[Object(i["createElementVNode"])("a",{title:e.translate("PrivacyManager_AddUserIdToSearch"),onClick:function(n){return e.addFilter("userId",t.userId)}},Object(i["toDisplayString"])(t.userId),9,I)]),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,L)],8,B),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]])}function me(e){return!0===e||1===e||"1"===e?1:0}var be=Object(i["defineComponent"])({props:{anonymizeIpEnabled:Boolean,anonymizeUserId:Boolean,maskLength:{type:Number,required:!0},useAnonymizedIpForVisitEnrichment:[Boolean,String,Number],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:me(this.useAnonymizedIpForVisitEnrichment),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}).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)}}});be.render=ue;var pe=be,ge={class:"optOutCustomizer"},Oe=["innerHTML"],je={key:0,id:"opt-out-styling"},ve=["value"],he=["value"],fe=["value"],ye=["value"],Ve=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),Se=[Ve],De=["value"],Ne=["src"],Ee={class:"form-group row"},Ce={class:"col s12 m6"},ke={for:"codeType1"},we={for:"codeType2"},Pe={key:0},_e={class:"col s12 m6"},Me=["innerHTML"],Ae={ref:"pre"},ze=["innerHTML"],Fe={class:"system notification notification-info optOutTestReminder"},Ie=["innerHTML"];function Te(e,t,n,a,o,l){var r=Object(i["resolveComponent"])("Field"),c=Object(i["resolveDirective"])("select-on-focus");return Object(i["openBlock"])(),Object(i["createElementBlock"])(i["Fragment"],null,[Object(i["createElementVNode"])("div",ge,[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,Oe)]),Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutAppearance")),1),Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("span",null,[Object(i["createElementVNode"])("label",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{id:"applyStyling",type:"checkbox",name:"applyStyling","onUpdate:modelValue":t[0]||(t[0]=function(t){return e.applyStyling=t}),onKeydown:t[1]||(t[1]=function(t){return e.updateCode()}),onChange:t[2]||(t[2]=function(t){return e.updateCode()})},null,544),[[i["vModelCheckbox"],e.applyStyling]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_ApplyStyling")),1)])])]),e.applyStyling?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",je,[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[3]||(t[3]=function(t){return e.onFontColorChange(t)}),onChange:t[4]||(t[4]=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[5]||(t[5]=function(t){return e.onBgColorChange(t)}),onChange:t[6]||(t[6]=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",value:e.fontSize,onKeydown:t[7]||(t[7]=function(t){return e.onFontSizeChange(t)}),onChange:t[8]||(t[8]=function(t){return e.onFontSizeChange(t)})},null,40,fe)]),Object(i["createElementVNode"])("span",null,[Object(i["createElementVNode"])("select",{class:"browser-default",value:e.fontSizeUnit,onKeydown:t[9]||(t[9]=function(t){return e.onFontSizeUnitChange(t)}),onChange:t[10]||(t[10]=function(t){return e.onFontSizeUnitChange(t)})},Se,40,ye)]),Object(i["createElementVNode"])("span",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_FontFamily"))+": ",1),Object(i["createElementVNode"])("input",{id:"FontFamilyInput",type:"text",value:e.fontFamily,onKeydown:t[11]||(t[11]=function(t){return e.onFontFamilyChange(t)}),onChange:t[12]||(t[12]=function(t){return e.onFontFamilyChange(t)})},null,40,De)])])])):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("span",null,[Object(i["createElementVNode"])("label",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{id:"showIntro",type:"checkbox",name:"showIntro","onUpdate:modelValue":t[13]||(t[13]=function(t){return e.showIntro=t}),onKeydown:t[14]||(t[14]=function(t){return e.updateCode()}),onChange:t[15]||(t[15]=function(t){return e.updateCode()})},null,544),[[i["vModelCheckbox"],e.showIntro]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_ShowIntro")),1)])])]),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,Ne)]),Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("div",Ee,[Object(i["createElementVNode"])("div",Ce,[Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutHtmlCode")),1),Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("label",ke,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"radio",id:"codeType1",name:"codeType",value:"tracker","onUpdate:modelValue":t[16]||(t[16]=function(t){return e.codeType=t}),onKeydown:t[17]||(t[17]=function(t){return e.updateCode()}),onChange:t[18]||(t[18]=function(t){return e.updateCode()})},null,544),[[i["vModelRadio"],e.codeType]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutUseTracker")),1)])]),Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("label",we,[Object(i["withDirectives"])(Object(i["createElementVNode"])("input",{type:"radio",id:"codeType2",name:"codeType",value:"selfContained","onUpdate:modelValue":t[19]||(t[19]=function(t){return e.codeType=t}),onKeydown:t[20]||(t[20]=function(t){return e.updateCode()}),onChange:t[21]||(t[21]=function(t){return e.updateCode()})},null,544),[[i["vModelRadio"],e.codeType]]),Object(i["createElementVNode"])("span",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutUseStandalone")),1)])]),"selfContained"===e.codeType?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Pe,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(r,{uicontrol:"select",name:"language",modelValue:e.language,"onUpdate:modelValue":t[22]||(t[22]=function(t){return e.language=t}),title:e.translate("General_Language"),options:e.languageOptions,onKeydown:t[23]||(t[23]=function(t){return e.updateCode()}),onChange:t[24]||(t[24]=function(t){return e.updateCode()})},null,8,["modelValue","title","options"])])])):Object(i["createCommentVNode"])("",!0)]),Object(i["createElementVNode"])("div",_e,[Object(i["createElementVNode"])("div",{class:"form-help",innerHTML:e.$sanitize(e.codeTypeHelp)},null,8,Me)])])]),Object(i["createElementVNode"])("div",null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("pre",Ae,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.codeBox)+"\n ",1)],512),[[c,{}]]),Object(i["createElementVNode"])("p",{innerHTML:e.$sanitize(e.optOutExplanationIntro)},null,8,ze),Object(i["createElementVNode"])("div",Fe,[Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("strong",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutRememberToTest")),1)]),Object(i["createElementVNode"])("p",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutRememberToTestBody")),1),Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("ul",null,[Object(i["createElementVNode"])("li",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutRememberToTestStep1")),1),Object(i["createElementVNode"])("li",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutRememberToTestStep2")),1),Object(i["createElementVNode"])("li",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutRememberToTestStep3")),1),Object(i["createElementVNode"])("li",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_OptOutRememberToTestStep4")),1)])])]),Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_BuildYourOwn")),1),Object(i["createElementVNode"])("p",{innerHTML:e.$sanitize(e.optOutCustomOptOutLink)},null,8,Ie)])],64)}function xe(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 Be=window,Le=Be.$,Ue=Object(i["defineComponent"])({props:{currentLanguageCode:{type:String,required:!0},languageOptions:{type:Object,required:!0},matomoUrl:String},components:{Field:ee["Field"]},directives:{SelectOnFocus:X["SelectOnFocus"]},data:function(){return{fontSizeUnit:"px",backgroundColor:"#FFFFFF",fontColor:"#000000",fontSize:"12",fontFamily:"Arial",showIntro:!0,applyStyling:!1,codeType:"tracker",code:"",language:this.currentLanguageCode}},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),this.matomoUrl&&this.updateCode()},methods:{onFontColorChange:function(e){this.fontColor=e.target.value,this.updateCode()},onBgColorChange:function(e){this.backgroundColor=e.target.value,this.updateCode()},onFontSizeChange:function(e){this.fontSize=e.target.value,this.updateCode()},onFontSizeUnitChange:function(e){this.fontSizeUnit=e.target.value,this.updateCode()},onFontFamilyChange:function(e){this.fontFamily=e.target.value,this.updateCode()},updateCode:function(){var e=this,t="CoreAdminHome.getOptOutJSEmbedCode";"selfContained"===this.codeType&&(t="CoreAdminHome.getOptOutSelfContainedEmbedCode"),X["AjaxHelper"].fetch({method:t,backgroundColor:this.backgroundColor.substr(1),fontColor:this.fontColor.substr(1),fontSize:this.fontSizeWithUnit,fontFamily:this.fontFamily,showIntro:!0===this.showIntro?1:0,applyStyling:!0===this.applyStyling?1:0,matomoUrl:this.matomoUrl,language:"selfContained"===this.codeType?this.language:"auto"}).then((function(t){e.code=t.value||""}))}},watch:{codeBox:function(){var e=this.$refs.pre,t=Le(e).queue("fx").length>0;t||Le(e).effect("highlight",{},1500)}},computed:{fontSizeWithUnit:function(){return this.fontSize?"".concat(this.fontSize).concat(this.fontSizeUnit):""},withBg:function(){return!!this.matomoUrl&&""===this.backgroundColor&&""!==this.fontColor&&xe(this.fontColor.slice(1))},codeBox:function(){return this.matomoUrl?this.code:""},iframeUrl:function(){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,applyStyling:!0===this.applyStyling?1:0,showIntro:!0===this.showIntro?1:0});return"".concat(this.matomoUrl,"index.php?").concat(e)},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>")},optOutCustomOptOutLink:function(){var e="https://developer.matomo.org/guides/tracking-javascript-guide#optional-creating-a-custom-opt-out-form";return Object(X["translate"])("CoreAdminHome_OptOutCustomOptOutLink",'<a href="'.concat(e,'" rel="noreferrer noopener" target="_blank">'),"</a>")},codeTypeHelp:function(){return Object(X["translate"])("PrivacyManager_OptOutCodeTypeExplanation")}}});Ue.render=Te;var Re=Ue,He={class:"anonymizeLogData"},Ge={class:"form-group row"},qe={class:"col s12 input-field"},Ke={for:"anonymizeSite",class:"siteSelectorLabel"},We={class:"sites_autocomplete"},$e={class:"form-group row"},Ye={class:"col s6 input-field"},Je={for:"anonymizeStartDate",class:"active"},Qe=["value"],Xe={class:"col s6 input-field"},Ze={for:"anonymizeEndDate",class:"active"},et=["value"],tt={name:"anonymizeIp"},nt={name:"anonymizeLocation"},at={name:"anonymizeTheUserId"},ot={class:"form-group row"},it={class:"col s12 m6"},lt={for:"visit_columns"},rt={class:"innerFormField",name:"visit_columns"},ct=["onClick","title"],st={class:"col s12 m6"},dt={class:"form-help"},ut={class:"inline-help"},mt={class:"form-group row"},bt={class:"col s12"},pt={class:"form-group row"},gt={class:"col s12 m6"},Ot={for:"action_columns"},jt={class:"innerFormField",name:"action_columns"},vt=["onClick","title"],ht={class:"col s12 m6"},ft={class:"form-help"},yt={class:"inline-help"},Vt=Object(i["createElementVNode"])("span",{class:"icon-info"},null,-1);function St(e,t,n,a,o,l){var r=Object(i["resolveComponent"])("SiteSelector"),c=Object(i["resolveComponent"])("Field"),s=Object(i["resolveComponent"])("SaveButton"),d=Object(i["resolveComponent"])("PasswordConfirmation");return Object(i["openBlock"])(),Object(i["createElementBlock"])("div",He,[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_AnonymizeSites")),1),Object(i["createElementVNode"])("div",We,[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",$e,[Object(i["createElementVNode"])("div",Ye,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",Je,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,Qe)])]),Object(i["createElementVNode"])("div",Xe,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",Ze,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,et)])])]),Object(i["createElementVNode"])("div",tt,[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",nt,[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",at,[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",ot,[Object(i["createElementVNode"])("div",it,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",lt,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",rt,[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,ct),[[i["vShow"],n+1!==e.selectedVisitColumns.length]])],2)})),128))])]),Object(i["createElementVNode"])("div",st,[Object(i["createElementVNode"])("div",dt,[Object(i["createElementVNode"])("span",ut,Object(i["toDisplayString"])(e.translate("PrivacyManager_UnsetVisitColumnsHelp")),1)])])]),Object(i["createElementVNode"])("div",mt,[Object(i["createElementVNode"])("div",bt,[Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("General_Action")),1)])]),Object(i["createElementVNode"])("div",pt,[Object(i["createElementVNode"])("div",gt,[Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("label",Ot,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",jt,[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,vt),[[i["vShow"],n+1!==e.selectedActionColumns.length]])],2)})),128))])]),Object(i["createElementVNode"])("div",ht,[Object(i["createElementVNode"])("div",ft,[Object(i["createElementVNode"])("span",yt,Object(i["toDisplayString"])(e.translate("PrivacyManager_UnsetActionColumnsHelp")),1)])])]),Object(i["createElementVNode"])("p",null,[Vt,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.showPasswordConfirmModal=!0}),disabled:e.isAnonymizePastDataDisabled,value:e.translate("PrivacyManager_AnonymizeDataNow")},null,8,["disabled","value"]),Object(i["createVNode"])(d,{modelValue:e.showPasswordConfirmModal,"onUpdate:modelValue":t[9]||(t[9]=function(t){return e.showPasswordConfirmModal=t}),onConfirmed:e.scheduleAnonymization},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_AnonymizeDataConfirm")),1),Object(i["createElementVNode"])("div",null,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])])}function Dt(e){return e<10?"0".concat(e):e}var Nt=Object(i["defineComponent"])({components:{PasswordConfirmation:ee["PasswordConfirmation"],SiteSelector:X["SiteSelector"],Field:ee["Field"],SaveButton:ee["SaveButton"]},data:function(){var e=new Date,t="".concat(e.getFullYear(),"-").concat(Dt(e.getMonth()+1),"-").concat(Dt(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,showPasswordConfirmModal:!1}},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(e){var t="".concat(this.startDate,",").concat(this.endDate);this.startDate===this.endDate&&(t=this.startDate);var n={date:t};n.idSites=this.site.id,n.anonymizeIp=this.anonymizeIp?"1":"0",n.anonymizeLocation=this.anonymizeLocation?"1":"0",n.anonymizeUserId=this.anonymizeUserId?"1":"0",n.unsetVisitColumns=this.selectedVisitColumns.filter((function(e){return!(null===e||void 0===e||!e.column)})).map((function(e){return e.column})),n.unsetLinkVisitActionColumns=this.selectedActionColumns.filter((function(e){return!(null===e||void 0===e||!e.column)})).map((function(e){return e.column})),n.passwordConfirmation=e,X["AjaxHelper"].post({method:"PrivacyManager.anonymizeSomeRawData"},n).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}}});Nt.render=St;var Et=Nt;function Ct(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 kt=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}))}}});kt.render=Ct;var wt=kt;function Pt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _t(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 Mt(e,t,n){return t&&_t(e.prototype,t),n&&_t(e,n),e}function At(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 yt=function(){function e(){var t=this;Ot(this,e),ft(this,"privateState",Object(i["reactive"])({settings:{},showEstimate:!1,loadingEstimation:!1,estimation:"",isModified:!1})),ft(this,"state",Object(i["computed"])((function(){return Object(i["readonly"])(t.privateState)}))),ft(this,"enableDeleteReports",Object(i["computed"])((function(){return t.state.value.settings.enableDeleteReports}))),ft(this,"enableDeleteLogs",Object(i["computed"])((function(){return t.state.value.settings.enableDeleteLogs}))),ft(this,"currentRequest",void 0)}return jt(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,n){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",passwordConfirmation:n})).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}(),Vt=new yt,St={id:"formDeleteSettings"},Dt={id:"deleteLogSettingEnabled"},Nt={class:"alert alert-warning deleteOldLogsWarning",style:{width:"50%"}},Et={href:"https://matomo.org/faq/general/faq_125",rel:"noreferrer noopener",target:"_blank"},Ct={id:"deleteLogSettings"},kt={key:0},wt={key:1},Pt={key:2},_t={key:3};function Mt(e,t,n,a,o,l){var r=this,c=Object(i["resolveComponent"])("Field"),s=Object(i["resolveComponent"])("SaveButton"),d=Object(i["resolveComponent"])("PasswordConfirmation"),u=Object(i["resolveDirective"])("form");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",St,[Object(i["createElementVNode"])("div",Dt,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{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",Nt,[Object(i["createElementVNode"])("a",Et,Object(i["toDisplayString"])(e.translate("General_ClickHere")),1)],512),[[i["vShow"],e.enabled]])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Ct,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{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"])(s,{onConfirm:t[2]||(t[2]=function(e){return r.showPasswordConfirmModal=!0}),saving:e.isLoading},null,8,["saving"]),Object(i["createVNode"])(d,{modelValue:e.showPasswordConfirmModal,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.showPasswordConfirmModal=t}),onConfirmed:e.saveSettings},{default:Object(i["withCtx"])((function(){return[e.enabled&&!e.enableDeleteReports?(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",kt,Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteLogsConfirm")),1)):Object(i["createCommentVNode"])("",!0),e.enabled&&e.enableDeleteReports?(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",wt,Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteBothConfirm")),1)):Object(i["createCommentVNode"])("",!0),e.enabled?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Pt,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)):Object(i["createCommentVNode"])("",!0),e.enabled?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",_t,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1))]})),_:1},8,["modelValue","onConfirmed"])],512)),[[u]])}var At=Object(i["defineComponent"])({props:{isDataPurgeSettingsEnabled:Boolean,deleteData:{type:Object,required:!0},scheduleDeletionOptions:{type:Object,required:!0}},components:{PasswordConfirmation:ee["PasswordConfirmation"],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,showPasswordConfirmModal:!1}},created:function(){var e=this;setTimeout((function(){Vt.initSettings(e.settings)}))},methods:{saveSettings:function(e){var t=this,n="PrivacyManager.setDeleteLogsSettings";this.isLoading=!0,Vt.savePurgeDataSettings(n,this.settings,e).finally((function(){t.isLoading=!1}))},reloadDbStats:function(){Vt.updateSettings(this.settings)}},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"),")")},enableDeleteReports:function(){return!!Vt.enableDeleteReports.value}}});At.render=Mt;var zt=At,Ft={id:"formDeleteSettings"},It={id:"deleteReportsSettingEnabled"},xt={class:"alert alert-warning",style:{width:"50%"}},Bt=Object(i["createElementVNode"])("br",null,null,-1),Tt=Object(i["createElementVNode"])("br",null,null,-1),Lt={id:"deleteReportsSettings"},Ut={key:0},Rt={key:1},Ht={key:2},Gt={key:3};function qt(e,t,n,a,o,l){var r=this,c=Object(i["resolveComponent"])("Field"),s=Object(i["resolveComponent"])("SaveButton"),d=Object(i["resolveComponent"])("PasswordConfirmation"),u=Object(i["resolveDirective"])("form");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ft,[Object(i["createElementVNode"])("div",It,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{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",xt,[Object(i["createElementVNode"])("span",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteReportsInfo2",e.deleteOldLogsText)),1),Bt,Tt,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",Lt,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{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"])(c,{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"])(c,{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"])(c,{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"])(c,{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"])(c,{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"])(c,{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"])(c,{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"])(s,{onConfirm:t[9]||(t[9]=function(e){return r.showPasswordConfirmModal=!0}),saving:e.isLoading},null,8,["saving"]),Object(i["createVNode"])(d,{modelValue:e.showPasswordConfirmModal,"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.showPasswordConfirmModal=t}),onConfirmed:e.saveSettings},{default:Object(i["withCtx"])((function(){return[e.enabled&&!e.enableDeleteLogs?(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",Ut,Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteReportsConfirm")),1)):Object(i["createCommentVNode"])("",!0),e.enabled&&e.enableDeleteLogs?(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",Rt,Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteBothConfirm")),1)):Object(i["createCommentVNode"])("",!0),e.enabled?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ht,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)):Object(i["createCommentVNode"])("",!0),e.enabled?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",Gt,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1))]})),_:1},8,["modelValue","onConfirmed"])],512)),[[u]])}function Kt(e){return e?"1":"0"}var Wt=Object(i["defineComponent"])({props:{isDataPurgeSettingsEnabled:Boolean,deleteData:{type:Object,required:!0},scheduleDeletionOptions:{type:Object,required:!0}},components:{Field:ee["Field"],SaveButton:ee["SaveButton"],PasswordConfirmation:ee["PasswordConfirmation"]},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),showPasswordConfirmModal:!1}},created:function(){var e=this;setTimeout((function(){Vt.initSettings(e.settings)}))},methods:{saveSettings:function(e){var t=this,n="PrivacyManager.setDeleteReportsSettings";this.isLoading=!0,Vt.savePurgeDataSettings(n,this.settings,e).finally((function(){t.isLoading=!1}))},reloadDbStats:function(){Vt.updateSettings(this.settings)}},computed:{settings:function(){return{enableDeleteReports:this.enabled,deleteReportsOlderThan:this.deleteOlderThan,keepBasic:Kt(this.keepBasic),keepDay:Kt(this.keepDataForDay),keepWeek:Kt(this.keepDataForWeek),keepMonth:Kt(this.keepDataForMonth),keepYear:Kt(this.keepDataForYear),keepRange:Kt(this.keepDataForRange),keepSegments:Kt(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"),")")},enableDeleteLogs:function(){return!!Vt.enableDeleteLogs.value}}});Wt.render=qt;var $t=Wt,Yt={id:"formDeleteSettings"},Jt={id:"deleteSchedulingSettings"},Qt={id:"deleteSchedulingSettingsInlineHelp",class:"inline-help-node"},Xt={key:0},Zt=Object(i["createElementVNode"])("br",null,null,-1),en=Object(i["createElementVNode"])("br",null,null,-1),tn=Object(i["createElementVNode"])("br",null,null,-1),nn=Object(i["createElementVNode"])("br",null,null,-1),an={key:0,id:"deleteDataEstimateSect",class:"form-group row"},on={class:"col s12",id:"databaseSizeHeadline"},ln={class:"col s12 m6"},rn=["innerHTML"],cn=Object(i["createTextVNode"])(" "),sn={class:"col s12 m6"},dn={key:0,class:"form-help"},un={class:"ui-confirm",id:"saveSettingsBeforePurge"},mn=Object(i["createElementVNode"])("input",{role:"yes",type:"button",value:"{{ translate('General_Ok') }}"},null,-1);function bn(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"])("PasswordConfirmation"),u=Object(i["resolveComponent"])("ContentBlock"),m=Object(i["resolveDirective"])("form");return Object(i["openBlock"])(),Object(i["createElementBlock"])(i["Fragment"],null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Yt,[Object(i["withDirectives"])(Object(i["createVNode"])(u,{id:"scheduleSettingsHeadline","content-title":e.translate("PrivacyManager_DeleteSchedulingSettings")},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",Jt,[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",Qt,[e.deleteData.lastRun?(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",Xt,[Object(i["createElementVNode"])("strong",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_LastDelete"))+":",1),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.deleteData.lastRunPretty)+" ",1),Zt,en])):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),tn,nn,Object(i["withDirectives"])(Object(i["createElementVNode"])("a",{id:"purgeDataNowLink",href:"#",onClick:t[0]||(t[0]=Object(i["withModifiers"])((function(t){return e.executeDataPurge()}),["prevent"]))},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",an,[Object(i["createElementVNode"])("h3",on,Object(i["toDisplayString"])(e.translate("PrivacyManager_ReportsDataSavedEstimate")),1),Object(i["createElementVNode"])("div",ln,[Object(i["withDirectives"])(Object(i["createElementVNode"])("div",{id:"deleteDataEstimate",innerHTML:e.$sanitize(e.estimation)},null,8,rn),[[i["vShow"],e.showEstimate]]),cn,Object(i["createVNode"])(r,{loading:e.loadingEstimation},null,8,["loading"])]),Object(i["createElementVNode"])("div",sn,["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",dn,[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.showPasswordConfirmModal=!0}),saving:e.isLoading},null,8,["saving"]),Object(i["createVNode"])(d,{modelValue:e.showPasswordConfirmModal,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.showPasswordConfirmModal=t}),onConfirmed:e.save},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"]),Object(i["createVNode"])(d,{modelValue:e.showPasswordConfirmModalForPurge,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.showPasswordConfirmModalForPurge=t}),onConfirmed:e.executePurgeNow},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_PurgeNowConfirm")),1),Object(i["createElementVNode"])("div",null,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])]})),_:1},8,["content-title"]),[[i["vShow"],e.isEitherDeleteSectionEnabled]])],512),[[m]]),Object(i["createElementVNode"])("div",un,[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_SaveSettingsBeforePurge")),1),mn])],64)}var pn=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"],PasswordConfirmation:ee["PasswordConfirmation"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,loadingDataPurge:!1,dataWasPurged:!1,showPurgeNowLink:!0,deleteLowestInterval:this.deleteData.config.delete_logs_schedule_lowest_interval,showPasswordConfirmModal:!1,showPasswordConfirmModalForPurge:!1}},methods:{save:function(e){var t="PrivacyManager.setScheduleReportDeletionSettings";Vt.savePurgeDataSettings(t,{deleteLowestInterval:this.deleteLowestInterval},e)},executeDataPurge:function(){Vt.state.value.isModified?X["Matomo"].helper.modalConfirm("#saveSettingsBeforePurge",{yes:function(){return null}}):this.showPasswordConfirmModalForPurge=!0},getPurgeEstimate:function(){return Vt.reloadDbStats(!0)},executePurgeNow:function(e){var t=this;return this.loadingDataPurge=!0,this.showPurgeNowLink=!1,X["AjaxHelper"].post({module:"API",method:"PrivacyManager.executeDataPurge"},{passwordConfirmation:e}).then((function(){Vt.reloadDbStats(),t.dataWasPurged=!0,setTimeout((function(){t.dataWasPurged=!1,t.showPurgeNowLink=!0}),2e3)})).catch((function(){t.showPurgeNowLink=!0})).finally((function(){t.loadingDataPurge=!1}))}},computed:{showEstimate:function(){return Vt.state.value.showEstimate},isEitherDeleteSectionEnabled:function(){return Vt.isEitherDeleteSectionEnabled()},estimation:function(){return Vt.state.value.estimation},loadingEstimation:function(){return Vt.state.value.loadingEstimation}}});pn.render=bn;var gn=pn; + */var zt=function(){function e(){var t=this;Pt(this,e),At(this,"privateState",Object(i["reactive"])({settings:{},showEstimate:!1,loadingEstimation:!1,estimation:"",isModified:!1})),At(this,"state",Object(i["computed"])((function(){return Object(i["readonly"])(t.privateState)}))),At(this,"enableDeleteReports",Object(i["computed"])((function(){return t.state.value.settings.enableDeleteReports}))),At(this,"enableDeleteLogs",Object(i["computed"])((function(){return t.state.value.settings.enableDeleteLogs}))),At(this,"currentRequest",void 0)}return Mt(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,n){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",passwordConfirmation:n})).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}(),Ft=new zt,It={id:"formDeleteSettings"},Tt={id:"deleteLogSettingEnabled"},xt={class:"alert alert-warning deleteOldLogsWarning",style:{width:"50%"}},Bt={href:"https://matomo.org/faq/general/faq_125",rel:"noreferrer noopener",target:"_blank"},Lt={id:"deleteLogSettings"},Ut={key:0},Rt={key:1},Ht={key:2},Gt={key:3};function qt(e,t,n,a,o,l){var r=this,c=Object(i["resolveComponent"])("Field"),s=Object(i["resolveComponent"])("SaveButton"),d=Object(i["resolveComponent"])("PasswordConfirmation"),u=Object(i["resolveDirective"])("form");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",It,[Object(i["createElementVNode"])("div",Tt,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{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",xt,[Object(i["createElementVNode"])("a",Bt,Object(i["toDisplayString"])(e.translate("General_ClickHere")),1)],512),[[i["vShow"],e.enabled]])]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",Lt,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{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"])(s,{onConfirm:t[2]||(t[2]=function(e){return r.showPasswordConfirmModal=!0}),saving:e.isLoading},null,8,["saving"]),Object(i["createVNode"])(d,{modelValue:e.showPasswordConfirmModal,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.showPasswordConfirmModal=t}),onConfirmed:e.saveSettings},{default:Object(i["withCtx"])((function(){return[e.enabled&&!e.enableDeleteReports?(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",Ut,Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteLogsConfirm")),1)):Object(i["createCommentVNode"])("",!0),e.enabled&&e.enableDeleteReports?(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",Rt,Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteBothConfirm")),1)):Object(i["createCommentVNode"])("",!0),e.enabled?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",Ht,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)):Object(i["createCommentVNode"])("",!0),e.enabled?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",Gt,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1))]})),_:1},8,["modelValue","onConfirmed"])],512)),[[u]])}var Kt=Object(i["defineComponent"])({props:{isDataPurgeSettingsEnabled:Boolean,deleteData:{type:Object,required:!0},scheduleDeletionOptions:{type:Object,required:!0}},components:{PasswordConfirmation:ee["PasswordConfirmation"],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,showPasswordConfirmModal:!1}},created:function(){var e=this;setTimeout((function(){Ft.initSettings(e.settings)}))},methods:{saveSettings:function(e){var t=this,n="PrivacyManager.setDeleteLogsSettings";this.isLoading=!0,Ft.savePurgeDataSettings(n,this.settings,e).finally((function(){t.isLoading=!1}))},reloadDbStats:function(){Ft.updateSettings(this.settings)}},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"),")")},enableDeleteReports:function(){return!!Ft.enableDeleteReports.value}}});Kt.render=qt;var Wt=Kt,$t={id:"formDeleteSettings"},Yt={id:"deleteReportsSettingEnabled"},Jt={class:"alert alert-warning",style:{width:"50%"}},Qt=Object(i["createElementVNode"])("br",null,null,-1),Xt=Object(i["createElementVNode"])("br",null,null,-1),Zt={id:"deleteReportsSettings"},en={key:0},tn={key:1},nn={key:2},an={key:3};function on(e,t,n,a,o,l){var r=this,c=Object(i["resolveComponent"])("Field"),s=Object(i["resolveComponent"])("SaveButton"),d=Object(i["resolveComponent"])("PasswordConfirmation"),u=Object(i["resolveDirective"])("form");return Object(i["withDirectives"])((Object(i["openBlock"])(),Object(i["createElementBlock"])("div",$t,[Object(i["createElementVNode"])("div",Yt,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{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",Jt,[Object(i["createElementVNode"])("span",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteReportsInfo2",e.deleteOldLogsText)),1),Qt,Xt,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",Zt,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(c,{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"])(c,{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"])(c,{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"])(c,{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"])(c,{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"])(c,{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"])(c,{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"])(c,{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"])(s,{onConfirm:t[9]||(t[9]=function(e){return r.showPasswordConfirmModal=!0}),saving:e.isLoading},null,8,["saving"]),Object(i["createVNode"])(d,{modelValue:e.showPasswordConfirmModal,"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.showPasswordConfirmModal=t}),onConfirmed:e.saveSettings},{default:Object(i["withCtx"])((function(){return[e.enabled&&!e.enableDeleteLogs?(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",en,Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteReportsConfirm")),1)):Object(i["createCommentVNode"])("",!0),e.enabled&&e.enableDeleteLogs?(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",tn,Object(i["toDisplayString"])(e.translate("PrivacyManager_DeleteBothConfirm")),1)):Object(i["createCommentVNode"])("",!0),e.enabled?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",nn,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)):Object(i["createCommentVNode"])("",!0),e.enabled?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("h2",an,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1))]})),_:1},8,["modelValue","onConfirmed"])],512)),[[u]])}function ln(e){return e?"1":"0"}var rn=Object(i["defineComponent"])({props:{isDataPurgeSettingsEnabled:Boolean,deleteData:{type:Object,required:!0},scheduleDeletionOptions:{type:Object,required:!0}},components:{Field:ee["Field"],SaveButton:ee["SaveButton"],PasswordConfirmation:ee["PasswordConfirmation"]},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),showPasswordConfirmModal:!1}},created:function(){var e=this;setTimeout((function(){Ft.initSettings(e.settings)}))},methods:{saveSettings:function(e){var t=this,n="PrivacyManager.setDeleteReportsSettings";this.isLoading=!0,Ft.savePurgeDataSettings(n,this.settings,e).finally((function(){t.isLoading=!1}))},reloadDbStats:function(){Ft.updateSettings(this.settings)}},computed:{settings:function(){return{enableDeleteReports:this.enabled,deleteReportsOlderThan:this.deleteOlderThan,keepBasic:ln(this.keepBasic),keepDay:ln(this.keepDataForDay),keepWeek:ln(this.keepDataForWeek),keepMonth:ln(this.keepDataForMonth),keepYear:ln(this.keepDataForYear),keepRange:ln(this.keepDataForRange),keepSegments:ln(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"),")")},enableDeleteLogs:function(){return!!Ft.enableDeleteLogs.value}}});rn.render=on;var cn=rn,sn={id:"formDeleteSettings"},dn={id:"deleteSchedulingSettings"},un={id:"deleteSchedulingSettingsInlineHelp",class:"inline-help-node"},mn={key:0},bn=Object(i["createElementVNode"])("br",null,null,-1),pn=Object(i["createElementVNode"])("br",null,null,-1),gn=Object(i["createElementVNode"])("br",null,null,-1),On=Object(i["createElementVNode"])("br",null,null,-1),jn={key:0,id:"deleteDataEstimateSect",class:"form-group row"},vn={class:"col s12",id:"databaseSizeHeadline"},hn={class:"col s12 m6"},fn=["innerHTML"],yn=Object(i["createTextVNode"])(" "),Vn={class:"col s12 m6"},Sn={key:0,class:"form-help"},Dn={class:"ui-confirm",id:"saveSettingsBeforePurge"},Nn=Object(i["createElementVNode"])("input",{role:"yes",type:"button",value:"{{ translate('General_Ok') }}"},null,-1);function En(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"])("PasswordConfirmation"),u=Object(i["resolveComponent"])("ContentBlock"),m=Object(i["resolveDirective"])("form");return Object(i["openBlock"])(),Object(i["createElementBlock"])(i["Fragment"],null,[Object(i["withDirectives"])(Object(i["createElementVNode"])("div",sn,[Object(i["withDirectives"])(Object(i["createVNode"])(u,{id:"scheduleSettingsHeadline","content-title":e.translate("PrivacyManager_DeleteSchedulingSettings")},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",dn,[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",un,[e.deleteData.lastRun?(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",mn,[Object(i["createElementVNode"])("strong",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_LastDelete"))+":",1),Object(i["createTextVNode"])(" "+Object(i["toDisplayString"])(e.deleteData.lastRunPretty)+" ",1),bn,pn])):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),gn,On,Object(i["withDirectives"])(Object(i["createElementVNode"])("a",{id:"purgeDataNowLink",href:"#",onClick:t[0]||(t[0]=Object(i["withModifiers"])((function(t){return e.executeDataPurge()}),["prevent"]))},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",jn,[Object(i["createElementVNode"])("h3",vn,Object(i["toDisplayString"])(e.translate("PrivacyManager_ReportsDataSavedEstimate")),1),Object(i["createElementVNode"])("div",hn,[Object(i["withDirectives"])(Object(i["createElementVNode"])("div",{id:"deleteDataEstimate",innerHTML:e.$sanitize(e.estimation)},null,8,fn),[[i["vShow"],e.showEstimate]]),yn,Object(i["createVNode"])(r,{loading:e.loadingEstimation},null,8,["loading"])]),Object(i["createElementVNode"])("div",Vn,["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",Sn,[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.showPasswordConfirmModal=!0}),saving:e.isLoading},null,8,["saving"]),Object(i["createVNode"])(d,{modelValue:e.showPasswordConfirmModal,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.showPasswordConfirmModal=t}),onConfirmed:e.save},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"]),Object(i["createVNode"])(d,{modelValue:e.showPasswordConfirmModalForPurge,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.showPasswordConfirmModalForPurge=t}),onConfirmed:e.executePurgeNow},{default:Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_PurgeNowConfirm")),1),Object(i["createElementVNode"])("div",null,Object(i["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])]})),_:1},8,["content-title"]),[[i["vShow"],e.isEitherDeleteSectionEnabled]])],512),[[m]]),Object(i["createElementVNode"])("div",Dn,[Object(i["createElementVNode"])("h2",null,Object(i["toDisplayString"])(e.translate("PrivacyManager_SaveSettingsBeforePurge")),1),Nn])],64)}var Cn=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"],PasswordConfirmation:ee["PasswordConfirmation"]},directives:{Form:ee["Form"]},data:function(){return{isLoading:!1,loadingDataPurge:!1,dataWasPurged:!1,showPurgeNowLink:!0,deleteLowestInterval:this.deleteData.config.delete_logs_schedule_lowest_interval,showPasswordConfirmModal:!1,showPasswordConfirmModalForPurge:!1}},methods:{save:function(e){var t="PrivacyManager.setScheduleReportDeletionSettings";Ft.savePurgeDataSettings(t,{deleteLowestInterval:this.deleteLowestInterval},e)},executeDataPurge:function(){Ft.state.value.isModified?X["Matomo"].helper.modalConfirm("#saveSettingsBeforePurge",{yes:function(){return null}}):this.showPasswordConfirmModalForPurge=!0},getPurgeEstimate:function(){return Ft.reloadDbStats(!0)},executePurgeNow:function(e){var t=this;return this.loadingDataPurge=!0,this.showPurgeNowLink=!1,X["AjaxHelper"].post({module:"API",method:"PrivacyManager.executeDataPurge"},{passwordConfirmation:e}).then((function(){Ft.reloadDbStats(),t.dataWasPurged=!0,setTimeout((function(){t.dataWasPurged=!1,t.showPurgeNowLink=!0}),2e3)})).catch((function(){t.showPurgeNowLink=!0})).finally((function(){t.loadingDataPurge=!1}))}},computed:{showEstimate:function(){return Ft.state.value.showEstimate},isEitherDeleteSectionEnabled:function(){return Ft.isEitherDeleteSectionEnabled()},estimation:function(){return Ft.state.value.estimation},loadingEstimation:function(){return Ft.state.value.loadingEstimation}}});Cn.render=En;var kn=Cn; /*! * Matomo - free/libre analytics platform * diff --git a/plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.less b/plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.less index 6ef302393b..a4d8558485 100644 --- a/plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.less +++ b/plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.less @@ -28,3 +28,13 @@ } } } + +.optOutTestReminder { + + p { + color: #ffffff !important; + } +} + + + diff --git a/plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.vue b/plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.vue index ca9435ae39..fc0d43a250 100644 --- a/plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.vue +++ b/plugins/PrivacyManager/vue/src/OptOutCustomizer/OptOutCustomizer.vue @@ -12,8 +12,25 @@ v-html="$sanitize(readThisToLearnMore)" /> </p> - <h3>{{ translate('PrivacyManager_OptOutCustomize') }}</h3> + <h3>{{ translate('PrivacyManager_OptOutAppearance') }}</h3> <div> + <span> + <label> + <input + id="applyStyling" + type="checkbox" + name="applyStyling" + v-model="applyStyling" + @keydown="updateCode()" + @change="updateCode()" + /> + <span> + {{ translate('PrivacyManager_ApplyStyling') }} + </span> + </label> + </span> + </div> + <div v-if="applyStyling" id="opt-out-styling"> <p> <span> {{ translate('PrivacyManager_FontColor') }}: @@ -40,6 +57,7 @@ type="number" min="1" max="100" + :value="fontSize" @keydown="onFontSizeChange($event)" @change="onFontSizeChange($event)" /> @@ -47,6 +65,7 @@ <span> <select class="browser-default" + :value="fontSizeUnit" @keydown="onFontSizeUnitChange($event)" @change="onFontSizeUnitChange($event)" > @@ -62,20 +81,30 @@ <input id="FontFamilyInput" type="text" + :value="fontFamily" @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> + <div> + <span> + <label> + <input + id="showIntro" + type="checkbox" + name="showIntro" + v-model="showIntro" + @keydown="updateCode()" + @change="updateCode()" + /> + <span> + {{ translate('PrivacyManager_ShowIntro') }} + </span> + </label> + </span> + </div> <h3>{{ translate('PrivacyManager_OptOutPreview') }}</h3> <iframe id="previewIframe" @@ -84,6 +113,91 @@ :class="{ withBg }" /> </div> + <div> + <div class="form-group row"> + <div class="col s12 m6"> + <h3>{{ translate('PrivacyManager_OptOutHtmlCode') }}</h3> + <p> + <label for="codeType1"> + <input + type="radio" + id="codeType1" + name="codeType" + value="tracker" + v-model="codeType" + @keydown="updateCode()" + @change="updateCode()" + /> + <span>{{ translate('PrivacyManager_OptOutUseTracker') }}</span> + </label> + </p> + + <p> + <label for="codeType2"> + <input + type="radio" + id="codeType2" + name="codeType" + value="selfContained" + v-model="codeType" + @keydown="updateCode()" + @change="updateCode()" + /> + <span>{{ translate('PrivacyManager_OptOutUseStandalone') }}</span> + </label> + </p> + + <div v-if="codeType === 'selfContained'"> + <div> + <Field + uicontrol="select" + name="language" + v-model="language" + :title="translate('General_Language')" + :options="languageOptions" + @keydown="updateCode()" + @change="updateCode()" + /> + </div> + </div> + + </div> + <div class="col s12 m6"> + <div class="form-help" v-html="$sanitize(codeTypeHelp)"> + </div> + </div> + </div> + </div> + + <div> + <pre v-select-on-focus="{}" ref="pre"> +{{ codeBox }} + </pre> + <p + v-html="$sanitize(optOutExplanationIntro)"> + </p> + <div class="system notification notification-info optOutTestReminder"> + <p> + <strong>{{ translate('PrivacyManager_OptOutRememberToTest') }}</strong> + </p> + <p> + {{ translate('PrivacyManager_OptOutRememberToTestBody') }} + </p> + <p> + <ul> + <li>{{ translate('PrivacyManager_OptOutRememberToTestStep1') }}</li> + <li>{{ translate('PrivacyManager_OptOutRememberToTestStep2') }}</li> + <li>{{ translate('PrivacyManager_OptOutRememberToTestStep3') }}</li> + <li>{{ translate('PrivacyManager_OptOutRememberToTestStep4') }}</li> + </ul> + </p> + </div> + <h3>{{ translate('PrivacyManager_BuildYourOwn') }}</h3> + <p + v-html="$sanitize(optOutCustomOptOutLink)"> + </p> + + </div> </template> <script lang="ts"> @@ -94,9 +208,13 @@ import { defineComponent } from 'vue'; import { translate, SelectOnFocus, - MatomoUrl, debounce, + MatomoUrl, + AjaxHelper, } from 'CoreHome'; +import { + Field, +} from 'CorePluginsAdmin'; interface OptOutCustomizerState { fontSizeUnit: string; @@ -104,6 +222,11 @@ interface OptOutCustomizerState { fontColor: string; fontSize: string; fontFamily: string; + showIntro: null|boolean; + applyStyling: boolean; + codeType: string; + code: string; + language: string; } function nearlyWhite(hex: string) { @@ -118,11 +241,18 @@ const { $ } = window; export default defineComponent({ props: { - language: { + currentLanguageCode: { type: String, required: true, }, - piwikurl: String, + languageOptions: { + type: Object, + required: true, + }, + matomoUrl: String, + }, + components: { + Field, }, directives: { SelectOnFocus, @@ -130,10 +260,15 @@ export default defineComponent({ data(): OptOutCustomizerState { return { fontSizeUnit: 'px', - backgroundColor: '', - fontColor: '', - fontSize: '', - fontFamily: '', + backgroundColor: '#FFFFFF', + fontColor: '#000000', + fontSize: '12', + fontFamily: 'Arial', + showIntro: true, + applyStyling: false, + codeType: 'tracker', + code: '', + language: this.currentLanguageCode, }; }, created() { @@ -142,26 +277,54 @@ export default defineComponent({ this.onFontSizeChange = debounce(this.onFontSizeChange, 50); this.onFontSizeUnitChange = debounce(this.onFontSizeUnitChange, 50); this.onFontFamilyChange = debounce(this.onFontFamilyChange, 50); + + if (this.matomoUrl) { + this.updateCode(); + } }, methods: { onFontColorChange(event: Event) { this.fontColor = (event.target as HTMLInputElement).value; + this.updateCode(); }, onBgColorChange(event: Event) { this.backgroundColor = (event.target as HTMLInputElement).value; + this.updateCode(); }, onFontSizeChange(event: Event) { this.fontSize = (event.target as HTMLInputElement).value; + this.updateCode(); }, onFontSizeUnitChange(event: Event) { this.fontSizeUnit = (event.target as HTMLInputElement).value; + this.updateCode(); }, onFontFamilyChange(event: Event) { this.fontFamily = (event.target as HTMLInputElement).value; + this.updateCode(); + }, + updateCode() { + let methodName = 'CoreAdminHome.getOptOutJSEmbedCode'; + if (this.codeType === 'selfContained') { + methodName = 'CoreAdminHome.getOptOutSelfContainedEmbedCode'; + } + AjaxHelper.fetch({ + method: methodName, + backgroundColor: this.backgroundColor.substr(1), + fontColor: this.fontColor.substr(1), + fontSize: this.fontSizeWithUnit, + fontFamily: this.fontFamily, + showIntro: (this.showIntro === true ? 1 : 0), + applyStyling: (this.applyStyling === true ? 1 : 0), + matomoUrl: this.matomoUrl, + language: (this.codeType === 'selfContained' ? this.language : 'auto'), + }).then((data) => { + this.code = data.value || ''; + }); }, }, watch: { - iframeUrl() { + codeBox() { const pre = this.$refs.pre as HTMLElement; const isAnimationAlreadyRunning = $(pre).queue('fx').length > 0; if (!isAnimationAlreadyRunning) { @@ -178,28 +341,31 @@ export default defineComponent({ return ''; }, withBg(): boolean { - return !!this.piwikurl + return !!this.matomoUrl && this.backgroundColor === '' && this.fontColor !== '' && nearlyWhite(this.fontColor.slice(1)); }, - iframeUrl(): string { - if (this.piwikurl) { - const query = MatomoUrl.stringify({ - module: 'CoreAdminHome', - action: 'optOut', - language: this.language, - backgroundColor: this.backgroundColor.slice(1), - fontColor: this.fontColor.slice(1), - fontSize: this.fontSizeWithUnit, - fontFamily: this.fontFamily, - }); - - return `${this.piwikurl}index.php?${query}`; + codeBox(): string { + if (this.matomoUrl) { + return this.code; } - return ''; }, + iframeUrl(): string { + 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, + applyStyling: (this.applyStyling === true ? 1 : 0), + showIntro: (this.showIntro === true ? 1 : 0), + }); + return `${this.matomoUrl}index.php?${query}`; + }, readThisToLearnMore() { const link = 'https://matomo.org/faq/how-to/faq_25918/'; return translate( @@ -215,6 +381,17 @@ export default defineComponent({ '</a>', ); }, + optOutCustomOptOutLink() { + const link = 'https://developer.matomo.org/guides/tracking-javascript-guide#optional-creating-a-custom-opt-out-form'; + return translate( + 'CoreAdminHome_OptOutCustomOptOutLink', + `<a href="${link}" rel="noreferrer noopener" target="_blank">`, + '</a>', + ); + }, + codeTypeHelp() { + return translate('PrivacyManager_OptOutCodeTypeExplanation'); + }, }, }); </script> diff --git a/tests/PHPUnit/Integration/ReleaseCheckListTest.php b/tests/PHPUnit/Integration/ReleaseCheckListTest.php index a2cbc873bb..ed53ffc5c0 100644 --- a/tests/PHPUnit/Integration/ReleaseCheckListTest.php +++ b/tests/PHPUnit/Integration/ReleaseCheckListTest.php @@ -614,7 +614,7 @@ class ReleaseCheckListTest extends \PHPUnit\Framework\TestCase // Don't run the test on local dev machine, as we may have other files (not in GIT) that would fail this test $this->markTestSkipped("Skipped this test on local dev environment."); } - $maximumTotalFilesizesExpectedInMb = 58; + $maximumTotalFilesizesExpectedInMb = 60; $minimumTotalFilesizesExpectedInMb = 38; $minimumExpectedFilesCount = 7000; |