From 50477f747eecf2578c3176067318c024d65b4834 Mon Sep 17 00:00:00 2001 From: Altamash Shaikh Date: Wed, 4 Sep 2024 19:59:44 +0530 Subject: [PATCH] Add event to alter delete website confirmation (#22484) * Adds event to alter delete website explanation, #PG-3574 * Refactor code to getDeleteExplantionText only when deleteAction is triggered * Ui test updated * Updated UI screenshot * Updated UI screenshot * Apply PR feedback * Updated UI screenshot * Apply PR feedbacks * Fixes failing tests * Removes TagManager dependent test * Changes for even space * Applied PR feedback --------- Co-authored-by: Michal Kleiner --- plugins/SitesManager/API.php | 26 +++++++ .../tests/Integration/ApiTest.php | 19 +++++ .../SitesManager/vue/dist/SitesManager.umd.js | 76 ++++++++++++------- .../vue/dist/SitesManager.umd.min.js | 8 +- .../vue/src/SiteFields/SiteFields.vue | 19 ++++- 5 files changed, 115 insertions(+), 33 deletions(-) diff --git a/plugins/SitesManager/API.php b/plugins/SitesManager/API.php index 76f70522bc2..1b84c8975c2 100644 --- a/plugins/SitesManager/API.php +++ b/plugins/SitesManager/API.php @@ -394,6 +394,32 @@ public function getSitesWithAdminAccess($fetchAliasUrls = false, $pattern = fals return $sites; } + /** + * Returns the messages to warn users on site deletion. + * + * @param int $idSite + * @return array messages to warn users + * @throws Exception if the website ID doesn't exist or the user doesn't have super user access to it + * @internal + * @unsanitized + */ + public function getMessagesToWarnOnSiteRemoval(int $idSite): array + { + $messages = []; + Piwik::checkUserHasSuperUserAccess(); + /** + * Triggered before a modal to delete a measurable is displayed + * + * A plugin can listen to it and add additional information to be displayed in the measurable delete modal body + * + * @param array &$messages Additional messages to be shown in the delete measurable modal body + * @param int $idSite The idSite to be deleted + */ + Piwik::postEvent('SitesManager.getMessagesToWarnOnSiteRemoval', [&$messages, $idSite]); + + return $messages; + } + /** * Returns the list of websites with the 'view' access for the current user. * For the superUser it doesn't return any result because the superUser has admin access on all the websites (use getSitesWithAtLeastViewAccess() instead). diff --git a/plugins/SitesManager/tests/Integration/ApiTest.php b/plugins/SitesManager/tests/Integration/ApiTest.php index 43a3da1472b..92a00e2de2e 100644 --- a/plugins/SitesManager/tests/Integration/ApiTest.php +++ b/plugins/SitesManager/tests/Integration/ApiTest.php @@ -714,6 +714,25 @@ public function testGetSitesWithAdminAccessShouldApplyPatternAndLimit() $this->assertReturnedSitesContainsSiteIds([5, 15], $sites); } + public function testGetMessagesToWarnOnSiteRemovalShouldReturnDefaultValue() + { + $pluginManager = Plugin\Manager::getInstance(); + if ($pluginManager->isPluginActivated('TagManager')) { + $pluginManager->deactivatePlugin('TagManager'); + } + API::getInstance()->addSite("site1", ["http://piwik.net", "http://piwik.com"]); + API::getInstance()->addSite("site2", ["http://piwik.com", "http://piwik.net"]); + $this->assertEmpty(API::getInstance()->getMessagesToWarnOnSiteRemoval(1)); + $this->assertEmpty(API::getInstance()->getMessagesToWarnOnSiteRemoval(2)); + } + + public function testGetMessagesToWarnOnSiteRemovalShouldThrowExceptionIfNotSuperUser() + { + $this->expectException(\Exception::class); + $this->createManySitesWithAdminAccess(1); + API::getInstance()->getMessagesToWarnOnSiteRemoval(1); + } + private function createManySitesWithAdminAccess($numSites) { for ($i = 1; $i <= $numSites; $i++) { diff --git a/plugins/SitesManager/vue/dist/SitesManager.umd.js b/plugins/SitesManager/vue/dist/SitesManager.umd.js index 1b945cfad8e..6f4955e8468 100644 --- a/plugins/SitesManager/vue/dist/SitesManager.umd.js +++ b/plugins/SitesManager/vue/dist/SitesManager.umd.js @@ -794,45 +794,45 @@ function ButtonBarvue_type_template_id_d473a694_render(_ctx, _cache, $props, $se ButtonBarvue_type_script_lang_ts.render = ButtonBarvue_type_template_id_d473a694_render /* harmony default export */ var ButtonBar = (ButtonBarvue_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/SitesManager/vue/src/SiteFields/SiteFields.vue?vue&type=template&id=f44bdef6 +// 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/SitesManager/vue/src/SiteFields/SiteFields.vue?vue&type=template&id=b900a09c -var SiteFieldsvue_type_template_id_f44bdef6_hoisted_1 = ["idsite", "type"]; -var SiteFieldsvue_type_template_id_f44bdef6_hoisted_2 = { +var SiteFieldsvue_type_template_id_b900a09c_hoisted_1 = ["idsite", "type"]; +var SiteFieldsvue_type_template_id_b900a09c_hoisted_2 = { class: "card-content" }; -var SiteFieldsvue_type_template_id_f44bdef6_hoisted_3 = { +var SiteFieldsvue_type_template_id_b900a09c_hoisted_3 = { key: 0, class: "row" }; -var SiteFieldsvue_type_template_id_f44bdef6_hoisted_4 = { +var SiteFieldsvue_type_template_id_b900a09c_hoisted_4 = { class: "col m3" }; -var SiteFieldsvue_type_template_id_f44bdef6_hoisted_5 = { +var SiteFieldsvue_type_template_id_b900a09c_hoisted_5 = { class: "title" }; -var SiteFieldsvue_type_template_id_f44bdef6_hoisted_6 = { +var SiteFieldsvue_type_template_id_b900a09c_hoisted_6 = { class: "title" }; -var SiteFieldsvue_type_template_id_f44bdef6_hoisted_7 = ["target", "title", "href"]; -var SiteFieldsvue_type_template_id_f44bdef6_hoisted_8 = { +var SiteFieldsvue_type_template_id_b900a09c_hoisted_7 = ["target", "title", "href"]; +var SiteFieldsvue_type_template_id_b900a09c_hoisted_8 = { class: "col m4" }; -var SiteFieldsvue_type_template_id_f44bdef6_hoisted_9 = { +var SiteFieldsvue_type_template_id_b900a09c_hoisted_9 = { class: "title" }; -var SiteFieldsvue_type_template_id_f44bdef6_hoisted_10 = { +var SiteFieldsvue_type_template_id_b900a09c_hoisted_10 = { class: "title" }; -var SiteFieldsvue_type_template_id_f44bdef6_hoisted_11 = { +var SiteFieldsvue_type_template_id_b900a09c_hoisted_11 = { class: "title" }; -var SiteFieldsvue_type_template_id_f44bdef6_hoisted_12 = { +var SiteFieldsvue_type_template_id_b900a09c_hoisted_12 = { class: "title" }; -var SiteFieldsvue_type_template_id_f44bdef6_hoisted_13 = { +var SiteFieldsvue_type_template_id_b900a09c_hoisted_13 = { class: "col m4" }; -var SiteFieldsvue_type_template_id_f44bdef6_hoisted_14 = { +var SiteFieldsvue_type_template_id_b900a09c_hoisted_14 = { class: "title" }; @@ -906,11 +906,9 @@ var _hoisted_39 = { }; var _hoisted_40 = ["disabled", "value"]; var _hoisted_41 = ["disabled"]; -function SiteFieldsvue_type_template_id_f44bdef6_render(_ctx, _cache, $props, $setup, $data, $options) { - var _ctx$theSite$excluded, - _ctx$theSite$excluded2, - _ctx$theSite$excluded3, - _this = this; +var _hoisted_42 = ["innerHTML"]; +function SiteFieldsvue_type_template_id_b900a09c_render(_ctx, _cache, $props, $setup, $data, $options) { + var _ctx$theSite$excluded, _ctx$theSite$excluded2, _ctx$theSite$excluded3; var _component_ActivityIndicator = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ActivityIndicator"); @@ -927,11 +925,11 @@ function SiteFieldsvue_type_template_id_f44bdef6_render(_ctx, _cache, $props, $s idsite: _ctx.theSite.idsite, type: _ctx.theSite.type, ref: "root" - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteFieldsvue_type_template_id_f44bdef6_hoisted_2, [!_ctx.editMode ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", SiteFieldsvue_type_template_id_f44bdef6_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteFieldsvue_type_template_id_f44bdef6_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h4", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.theSite.name), 1), 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_["createElementVNode"])("span", SiteFieldsvue_type_template_id_f44bdef6_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Id')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.theSite.idsite), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SiteFieldsvue_type_template_id_f44bdef6_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Type')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.currentType.name), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.availableTypes.length > 1]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteFieldsvue_type_template_id_b900a09c_hoisted_2, [!_ctx.editMode ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", SiteFieldsvue_type_template_id_b900a09c_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteFieldsvue_type_template_id_b900a09c_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h4", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.theSite.name), 1), 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_["createElementVNode"])("span", SiteFieldsvue_type_template_id_b900a09c_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Id')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.theSite.idsite), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SiteFieldsvue_type_template_id_b900a09c_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Type')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.currentType.name), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.availableTypes.length > 1]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { target: _ctx.isInternalSetupUrl ? '_self' : '_blank', title: _ctx.translate('SitesManager_ShowTrackingTag'), href: _ctx.setupUrl - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_ShowTrackingTag')), 9, SiteFieldsvue_type_template_id_f44bdef6_hoisted_7)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.theSite.idsite && _ctx.howToSetupUrl]])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteFieldsvue_type_template_id_f44bdef6_hoisted_8, [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_["createElementVNode"])("span", SiteFieldsvue_type_template_id_f44bdef6_hoisted_9, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Timezone')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.theSite.timezone_name), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SiteFieldsvue_type_template_id_f44bdef6_hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Currency')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.theSite.currency_name), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SiteFieldsvue_type_template_id_f44bdef6_hoisted_11, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Goals_Ecommerce')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Yes')), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.theSite.ecommerce === 1 || _ctx.theSite.ecommerce === '1']]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SiteFieldsvue_type_template_id_f44bdef6_hoisted_12, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Actions_SubmenuSitesearch')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Yes')), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.theSite.sitesearch === 1 || _ctx.theSite.sitesearch === '1']])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteFieldsvue_type_template_id_f44bdef6_hoisted_13, [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_["createElementVNode"])("span", SiteFieldsvue_type_template_id_f44bdef6_hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Urls')), 1), _hoisted_15, (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), 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_["renderList"])(_ctx.theSite.alias_urls, function (url, index) { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_ShowTrackingTag')), 9, SiteFieldsvue_type_template_id_b900a09c_hoisted_7)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.theSite.idsite && _ctx.howToSetupUrl]])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteFieldsvue_type_template_id_b900a09c_hoisted_8, [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_["createElementVNode"])("span", SiteFieldsvue_type_template_id_b900a09c_hoisted_9, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Timezone')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.theSite.timezone_name), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SiteFieldsvue_type_template_id_b900a09c_hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Currency')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.theSite.currency_name), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SiteFieldsvue_type_template_id_b900a09c_hoisted_11, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Goals_Ecommerce')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Yes')), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.theSite.ecommerce === 1 || _ctx.theSite.ecommerce === '1']]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SiteFieldsvue_type_template_id_b900a09c_hoisted_12, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Actions_SubmenuSitesearch')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Yes')), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.theSite.sitesearch === 1 || _ctx.theSite.sitesearch === '1']])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteFieldsvue_type_template_id_b900a09c_hoisted_13, [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_["createElementVNode"])("span", SiteFieldsvue_type_template_id_b900a09c_hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_Urls')), 1), _hoisted_15, (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), 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_["renderList"])(_ctx.theSite.alias_urls, function (url, index) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", { key: url }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { @@ -948,7 +946,7 @@ function SiteFieldsvue_type_template_id_f44bdef6_render(_ctx, _cache, $props, $s }, _hoisted_26, 8, _hoisted_24)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("button", { class: "table-action", onClick: _cache[1] || (_cache[1] = function ($event) { - return _this.showRemoveDialog = true; + return _ctx.getMessagesToWarnOnSiteRemoval(); }), title: _ctx.translate('General_Delete') }, _hoisted_29, 8, _hoisted_27), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.theSite.idsite]])])])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.editMode ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_30, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_31, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_32, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { @@ -1013,12 +1011,15 @@ function SiteFieldsvue_type_template_id_f44bdef6_render(_ctx, _cache, $props, $s onConfirmed: _ctx.deleteSite }, { default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { - return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.removeDialogTitle), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_DeleteSiteExplanation')), 1)]; + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.removeDialogTitle), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_DeleteSiteExplanation')), 1), _ctx.deleteSiteExplanation ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", { + key: 0, + innerHTML: _ctx.$sanitize(_ctx.deleteSiteExplanation) + }, null, 8, _hoisted_42)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]; }), _: 1 - }, 8, ["modelValue", "onConfirmed"])], 10, SiteFieldsvue_type_template_id_f44bdef6_hoisted_1); + }, 8, ["modelValue", "onConfirmed"])], 10, SiteFieldsvue_type_template_id_b900a09c_hoisted_1); } -// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SiteFields/SiteFields.vue?vue&type=template&id=f44bdef6 +// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SiteFields/SiteFields.vue?vue&type=template&id=b900a09c // EXTERNAL MODULE: external "CorePluginsAdmin" var external_CorePluginsAdmin_ = __webpack_require__("a5a2"); @@ -1085,7 +1086,8 @@ function isSiteNew(site) { theSite: Object.assign({}, this.site), measurableSettings: [], settingValues: {}, - showRemoveDialog: false + showRemoveDialog: false, + deleteSiteExplanation: '' }; }, components: { @@ -1279,6 +1281,24 @@ function isSiteNew(site) { }).then(function () { _this3.$emit('delete', _this3.theSite); }); + }, + getMessagesToWarnOnSiteRemoval: function getMessagesToWarnOnSiteRemoval() { + var _this4 = this; + + external_CoreHome_["AjaxHelper"].post({ + idSite: this.theSite.idsite, + module: 'API', + format: 'json', + method: 'SitesManager.getMessagesToWarnOnSiteRemoval' + }).then(function (response) { + _this4.deleteSiteExplanation = ''; + + if (response.length) { + _this4.deleteSiteExplanation += response.join('
'); + } + + _this4.showRemoveDialog = true; + }); } }, computed: { @@ -1362,7 +1382,7 @@ function isSiteNew(site) { -SiteFieldsvue_type_script_lang_ts.render = SiteFieldsvue_type_template_id_f44bdef6_render +SiteFieldsvue_type_script_lang_ts.render = SiteFieldsvue_type_template_id_b900a09c_render /* harmony default export */ var SiteFields = (SiteFieldsvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/SitesManager/vue/src/GlobalSettingsStore/GlobalSettingsStore.ts diff --git a/plugins/SitesManager/vue/dist/SitesManager.umd.min.js b/plugins/SitesManager/vue/dist/SitesManager.umd.min.js index 093a7175cdd..497aa0e33e8 100644 --- a/plugins/SitesManager/vue/dist/SitesManager.umd.min.js +++ b/plugins/SitesManager/vue/dist/SitesManager.umd.min.js @@ -1,4 +1,4 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["SitesManager"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["SitesManager"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/SitesManager/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},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"SiteTypesStore",(function(){return h})),n.d(t,"CurrencyStore",(function(){return O})),n.d(t,"TimezoneStore",(function(){return D})),n.d(t,"SitesManagement",(function(){return bt})),n.d(t,"ManageGlobalSettings",(function(){return zt})),n.d(t,"SiteWithoutData",(function(){return un})),"undefined"!==typeof window){var a=window.document.currentScript,i=a&&a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var r=n("8bbf"),l=n("19dc");function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,a=new Array(t);ne.length)&&(t=e.length);for(var n=0,a=new Array(t);n1?e.translate("SitesManager_AddMeasurable"):e.translate("SitesManager_AddSite")),3),[[r["vShow"],e.hasSuperUserAccess&&e.availableTypes]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",q,[Object(r["createElementVNode"])("input",{value:e.searchTerm,onKeydown:t[1]||(t[1]=function(t){return e.onKeydown(t)}),placeholder:e.translate("Actions_SubmenuSitesearch"),type:"text",disabled:e.siteIsBeingEdited},null,40,Y),Object(r["createElementVNode"])("div",{onClick:t[2]||(t[2]=function(t){return e.searchSite()}),title:e.translate("General_ClickToSearch"),class:"search_ico icon-search"},null,8,X)],512),[[r["vShow"],e.hasPrev||e.hasNext||e.isSearching]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",J,[Object(r["createElementVNode"])("a",{class:"btn prev",disabled:!(e.hasPrev&&!e.isLoading&&!e.siteIsBeingEdited)||void 0,onClick:t[3]||(t[3]=function(t){return e.previousPage()})},[Object(r["createElementVNode"])("span",ee,"« "+Object(r["toDisplayString"])(e.translate("General_Previous")),1)],8,Z),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",te,[Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(e.paginationText),1)],512),[[r["vShow"],e.hasPrev||e.hasNext]]),Object(r["createElementVNode"])("a",{class:"btn next",disabled:!(e.hasNext&&!e.isLoading&&!e.siteIsBeingEdited)||void 0,onClick:t[4]||(t[4]=function(t){return e.nextPage()})},[Object(r["createElementVNode"])("span",ae,Object(r["toDisplayString"])(e.translate("General_Next"))+" »",1)],8,ne)],512),[[r["vShow"],e.hasPrev||e.hasNext]])])}var re=Object(r["defineComponent"])({props:{siteIsBeingEdited:{type:Boolean,required:!0},hasPrev:{type:Boolean,required:!0},hasNext:{type:Boolean,required:!0},offsetStart:{type:Number,required:!0},offsetEnd:{type:Number,required:!0},totalNumberOfSites:{type:Number},isLoading:{type:Boolean,required:!0},searchTerm:{type:String,required:!0},isSearching:{type:Boolean,required:!0}},emits:["add","search","prev","next","update:searchTerm"],created:function(){h.init(),this.onKeydown=Object(l["debounce"])(this.onKeydown,50)},computed:{hasSuperUserAccess:function(){return l["Matomo"].hasSuperUserAccess},availableTypes:function(){return h.types.value},paginationText:function(){var e;return e=this.isSearching?Object(l["translate"])("General_PaginationWithoutTotal","".concat(this.offsetStart),"".concat(this.offsetEnd)):Object(l["translate"])("General_Pagination","".concat(this.offsetStart),"".concat(this.offsetEnd),null===this.totalNumberOfSites?"?":"".concat(this.totalNumberOfSites))," ".concat(e," ")}},methods:{addNewEntity:function(){this.$emit("add")},searchSite:function(){this.siteIsBeingEdited||this.$emit("search")},previousPage:function(){this.$emit("prev")},nextPage:function(){this.$emit("next")},onKeydown:function(e){var t=this;setTimeout((function(){"Enter"!==e.key?t.$emit("update:searchTerm",e.target.value):t.searchSiteOnEnter(e)}))},searchSiteOnEnter:function(e){e.preventDefault(),this.searchSite()}}});re.render=ie;var le=re,oe=["idsite","type"],se={class:"card-content"},ce={key:0,class:"row"},de={class:"col m3"},ue={class:"title"},me={class:"title"},be=["target","title","href"],he={class:"col m4"},pe={class:"title"},ge={class:"title"},fe={class:"title"},Se={class:"title"},je={class:"col m4"},Oe={class:"title"},ve=Object(r["createTextVNode"])(": "),ye=["href"],Ee={key:0},Ne={class:"title"},Ve={key:1},Me={class:"title"},xe={key:2},we={class:"title"},Te={class:"col m1 text-right"},Ce=["title"],ke=Object(r["createElementVNode"])("span",{class:"icon-edit"},null,-1),De=[ke],_e=["title"],Ae=Object(r["createElementVNode"])("span",{class:"icon-delete"},null,-1),Pe=[Ae],Ge={key:1},Le={class:"form-group row"},Ue={class:"col s12 m6 input-field"},Be=["placeholder"],Ie=Object(r["createElementVNode"])("div",{class:"col s12 m6"},null,-1),ze={id:"timezoneHelpText",class:"inline-help-node"},He={key:0},Fe=Object(r["createElementVNode"])("br",null,null,-1),Re=Object(r["createElementVNode"])("br",null,null,-1),We={class:"editingSiteFooter"},Ke=["disabled","value"],Qe=["disabled"];function $e(e,t,n,a,i,l){var o,s,c,d=this,u=Object(r["resolveComponent"])("ActivityIndicator"),m=Object(r["resolveComponent"])("GroupedSettings"),b=Object(r["resolveComponent"])("Field"),h=Object(r["resolveComponent"])("PasswordConfirmation");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{class:Object(r["normalizeClass"])(["site card hoverable",{editingSite:!!e.editMode}]),idsite:e.theSite.idsite,type:e.theSite.type,ref:"root"},[Object(r["createElementVNode"])("div",se,[e.editMode?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",ce,[Object(r["createElementVNode"])("div",de,[Object(r["createElementVNode"])("h4",null,Object(r["toDisplayString"])(e.theSite.name),1),Object(r["createElementVNode"])("ul",null,[Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("span",ue,Object(r["toDisplayString"])(e.translate("General_Id"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.theSite.idsite),1)]),Object(r["withDirectives"])(Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("span",me,Object(r["toDisplayString"])(e.translate("SitesManager_Type"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.currentType.name),1)],512),[[r["vShow"],e.availableTypes.length>1]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("a",{target:e.isInternalSetupUrl?"_self":"_blank",title:e.translate("SitesManager_ShowTrackingTag"),href:e.setupUrl},Object(r["toDisplayString"])(e.translate("SitesManager_ShowTrackingTag")),9,be)],512),[[r["vShow"],e.theSite.idsite&&e.howToSetupUrl]])])]),Object(r["createElementVNode"])("div",he,[Object(r["createElementVNode"])("ul",null,[Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("span",pe,Object(r["toDisplayString"])(e.translate("SitesManager_Timezone"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.theSite.timezone_name),1)]),Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("span",ge,Object(r["toDisplayString"])(e.translate("SitesManager_Currency"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.theSite.currency_name),1)]),Object(r["withDirectives"])(Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("span",fe,Object(r["toDisplayString"])(e.translate("Goals_Ecommerce"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_Yes")),1)],512),[[r["vShow"],1===e.theSite.ecommerce||"1"===e.theSite.ecommerce]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("span",Se,Object(r["toDisplayString"])(e.translate("Actions_SubmenuSitesearch"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_Yes")),1)],512),[[r["vShow"],1===e.theSite.sitesearch||"1"===e.theSite.sitesearch]])])]),Object(r["createElementVNode"])("div",je,[Object(r["createElementVNode"])("ul",null,[Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("span",Oe,Object(r["toDisplayString"])(e.translate("SitesManager_Urls")),1),ve,(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.theSite.alias_urls,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:t},[Object(r["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:t},Object(r["toDisplayString"])(t)+Object(r["toDisplayString"])(n===e.theSite.alias_urls.length-1?"":", "),9,ye)])})),128))]),null!==(o=e.theSite.excluded_ips)&&void 0!==o&&o.length?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",Ee,[Object(r["createElementVNode"])("span",Ne,Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedIps"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.theSite.excluded_ips.split(/\s*,\s*/g).join(", ")),1)])):Object(r["createCommentVNode"])("",!0),null!==(s=e.theSite.excluded_parameters)&&void 0!==s&&s.length?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",Ve,[Object(r["createElementVNode"])("span",Me,Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedParameters"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.theSite.excluded_parameters.split(/\s*,\s*/g).join(", ")),1)])):Object(r["createCommentVNode"])("",!0),null!==(c=e.theSite.excluded_user_agents)&&void 0!==c&&c.length?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",xe,[Object(r["createElementVNode"])("span",we,Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedUserAgents"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.theSite.excluded_user_agents.split(/\s*,\s*/g).join(", ")),1)])):Object(r["createCommentVNode"])("",!0)])]),Object(r["createElementVNode"])("div",Te,[Object(r["createElementVNode"])("ul",null,[Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("button",{class:"table-action",onClick:t[0]||(t[0]=function(t){return e.editSite()}),title:e.translate("General_Edit")},De,8,Ce)]),Object(r["createElementVNode"])("li",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("button",{class:"table-action",onClick:t[1]||(t[1]=function(e){return d.showRemoveDialog=!0}),title:e.translate("General_Delete")},Pe,8,_e),[[r["vShow"],e.theSite.idsite]])])])])])),e.editMode?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ge,[Object(r["createElementVNode"])("div",Le,[Object(r["createElementVNode"])("div",Ue,[Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[2]||(t[2]=function(t){return e.theSite.name=t}),maxlength:"90",placeholder:e.translate("General_Name")},null,8,Be),[[r["vModelText"],e.theSite.name]]),Object(r["createElementVNode"])("label",null,Object(r["toDisplayString"])(e.translate("General_Name")),1)]),Ie]),Object(r["createVNode"])(u,{loading:e.isLoading},null,8,["loading"]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.measurableSettings,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{key:t.pluginName},[Object(r["createVNode"])(m,{"group-name":t.pluginName,settings:t.settings,"all-setting-values":e.settingValues,onChange:function(n){return e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}},null,8,["group-name","settings","all-setting-values","onChange"])])})),128)),Object(r["createVNode"])(b,{uicontrol:"select",name:"currency",modelValue:e.theSite.currency,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.theSite.currency=t}),title:e.translate("SitesManager_Currency"),"inline-help":e.translate("SitesManager_CurrencySymbolWillBeUsedForGoals"),options:e.currencies},null,8,["modelValue","title","inline-help","options"]),Object(r["createVNode"])(b,{uicontrol:"select",name:"timezone",modelValue:e.theSite.timezone,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.theSite.timezone=t}),title:e.translate("SitesManager_Timezone"),"inline-help":"#timezoneHelpText",options:e.timezones},null,8,["modelValue","title","options"]),Object(r["createElementVNode"])("div",ze,[Object(r["createElementVNode"])("div",null,[e.timezoneSupportEnabled?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",He,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_AdvancedTimezoneSupportNotFound"))+" ",1),Fe])),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.utcTimeIs)+" ",1),Re,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward")),1)])]),Object(r["createElementVNode"])("div",We,[Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{disabled:e.isSaving,type:"submit",class:"btn",value:e.translate("General_Save"),onClick:t[5]||(t[5]=function(t){return e.saveSite()})},null,8,Ke),[[r["vShow"],!e.isLoading]]),Object(r["createElementVNode"])("button",{class:"btn btn-link",disabled:e.isSaving,onClick:t[6]||(t[6]=function(t){return e.cancelEditSite(e.site)})},Object(r["toDisplayString"])(e.translate("General_Cancel","","")),9,Qe)])])):Object(r["createCommentVNode"])("",!0)]),Object(r["createVNode"])(h,{modelValue:e.showRemoveDialog,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.showRemoveDialog=t}),onConfirmed:e.deleteSite},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.removeDialogTitle),1),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("SitesManager_DeleteSiteExplanation")),1)]})),_:1},8,["modelValue","onConfirmed"])],10,oe)}var qe=n("a5a2");function Ye(e,t){return tt(e)||et(e,t)||Je(e,t)||Xe()}function Xe(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Je(e,t){if(e){if("string"===typeof e)return Ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ze(e,t):void 0}}function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n","")},hasPrev:function(){return this.currentPage>=1},hasNext:function(){return this.fetchedSites.filter((function(e){return!!e.idsite})).length>=this.pageSize+1},offsetStart:function(){return this.currentPage*this.pageSize+1},offsetEnd:function(){return this.offsetStart+this.sites.filter((function(e){return!!e.idsite})).length-1}},methods:{checkGlobalSettingsHash:function(){var e=l["MatomoUrl"].hashQuery.value;!l["Matomo"].hasSuperUserAccess||"globalSettings"!==e&&"/globalSettings"!==e||l["MatomoUrl"].updateLocation(Object.assign(Object.assign({},l["MatomoUrl"].urlParsed.value),{},{action:"globalSettings"}))},addNewEntity:function(){this.availableTypes.length>1?this.showAddSiteDialog=!0:1===this.availableTypes.length&&this.addSite(this.availableTypes[0].id)},addSite:function(e){var t=e,n={isAllowed:!0,measurableType:t};l["Matomo"].postEvent("SitesManager.initAddSite",n),n&&!n.isAllowed||(t||(t="website"),this.fetchedSites.unshift({type:t}),this.isSiteBeingEdited=!0)},afterCancelEdit:function(e){var t=e.site,n=e.element;this.isSiteBeingEdited=!1,t.idsite?n.scrollIntoView():this.fetchedSites=this.fetchedSites.filter((function(e){return!!e.idsite}))},fetchLimitedSitesWithAdminAccess:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.fetchLimitedSitesAbortController&&this.fetchLimitedSitesAbortController.abort(),this.fetchLimitedSitesAbortController=new AbortController;var n=this.pageSize+1,a=this.currentPage*this.pageSize,i={method:"SitesManager.getSitesWithAdminAccess",fetchAliasUrls:1,limit:n+a,filter_offset:a,filter_limit:n};return t&&(i.pattern=t),l["AjaxHelper"].fetch(i).then((function(t){e.fetchedSites=t||[]})).then((function(n){return e.activeSearchTerm=t,n})).finally((function(){e.fetchLimitedSitesAbortController=null}))},getTotalNumberOfSites:function(){var e=this;return l["AjaxHelper"].fetch({method:"SitesManager.getSitesIdWithAdminAccess",filter_limit:"-1"}).then((function(t){e.totalNumberOfSites=t.length}))},triggerAddSiteIfRequested:function(){var e=h.getEditSiteIdParameter(),t=l["MatomoUrl"].urlParsed.value.showaddsite;"1"===t?this.addNewEntity():e&&(this.searchTerm=e,this.fetchLimitedSitesWithAdminAccess(this.searchTerm))},previousPage:function(){this.currentPage=Math.max(0,this.currentPage-1),this.fetchLimitedSitesWithAdminAccess(this.activeSearchTerm)},nextPage:function(){this.currentPage=Math.max(0,this.currentPage+1),this.fetchLimitedSitesWithAdminAccess(this.activeSearchTerm)},searchSites:function(){this.currentPage=0,this.fetchLimitedSitesWithAdminAccess(this.searchTerm)},afterDelete:function(e){var t={showaddsite:0};if(l["MatomoUrl"].urlParsed.value.idSite==="".concat(e.idsite)){var n=this.sites.find((function(t){return t.idsite!==e.idsite}));n&&(t=Object.assign(Object.assign({},t),{},{idSite:n.idsite}))}l["Matomo"].helper.redirect(t)},afterSave:function(e,t,n,a){var i=["excluded_ips","excluded_parameters","excluded_user_agents","sitesearch_keyword_parameters","sitesearch_category_parameters"],r=Object.assign({},e);Object.values(t).forEach((function(e){e.forEach((function(e){"urls"===e.name?r.alias_urls=e.value:-1!==i.indexOf(e.name)?r[e.name]=e.value.join(", "):r[e.name]=e.value}))})),this.fetchedSites[n]=r,a&&null!==this.totalNumberOfSites&&(this.totalNumberOfSites+=1),this.isSiteBeingEdited=!1}}});mt.render=Q;var bt=mt,ht={class:"SitesManager"},pt=Object(r["createElementVNode"])("a",{name:"globalSettings",id:"globalSettings"},null,-1),gt={id:"excludedIpsGlobalHelp",class:"inline-help-node"},ft=Object(r["createElementVNode"])("br",null,null,-1),St=Object(r["createElementVNode"])("br",null,null,-1),jt=["innerHTML"],Ot={id:"excludedQueryParametersGlobalHelp",class:"inline-help-node"},vt=Object(r["createElementVNode"])("br",null,null,-1),yt=Object(r["createElementVNode"])("br",null,null,-1),Et={id:"excludedUserAgentsGlobalHelp",class:"inline-help-node"},Nt=Object(r["createElementVNode"])("br",null,null,-1),Vt=Object(r["createElementVNode"])("br",null,null,-1),Mt={id:"excludedReferrersGlobalHelp",class:"inline-help-node"},xt=Object(r["createElementVNode"])("br",null,null,-1),wt=Object(r["createElementVNode"])("br",null,null,-1),Tt=Object(r["createElementVNode"])("br",null,null,-1),Ct=Object(r["createElementVNode"])("br",null,null,-1),kt=Object(r["createElementVNode"])("br",null,null,-1),Dt={id:"timezoneHelp",class:"inline-help-node"},_t={key:0},At=Object(r["createElementVNode"])("br",null,null,-1),Pt=Object(r["createElementVNode"])("br",null,null,-1),Gt={id:"keepURLFragmentsHelp",class:"inline-help-node"},Lt=["innerHTML"],Ut={class:"alert alert-info"};function Bt(e,t,n,a,i,l){var o=Object(r["resolveComponent"])("Field"),s=Object(r["resolveComponent"])("SaveButton"),c=Object(r["resolveComponent"])("ContentBlock");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",ht,[Object(r["withDirectives"])(Object(r["createVNode"])(c,{"content-title":e.translate("SitesManager_GlobalWebsitesSettings")},{default:Object(r["withCtx"])((function(){return[pt,Object(r["createElementVNode"])("div",gt,[Object(r["createElementVNode"])("div",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_HelpExcludedIpAddresses","1.2.3.4/24","1.2.3.*","1.2.*.*"))+" ",1),ft,St,Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.yourCurrentIpAddressIs)},null,8,jt)])]),Object(r["createElementVNode"])("div",Ot,[Object(r["createElementVNode"])("div",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_ListOfQueryParametersToExclude","/^sess.*|.*[dD]ate$/"))+" ",1),vt,yt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_PiwikWillAutomaticallyExcludeCommonSessionParameters","phpsessid, sessionid, ...")),1)])]),Object(r["createElementVNode"])("div",Et,[Object(r["createElementVNode"])("div",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp1"))+" ",1),Nt,Vt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_GlobalListExcludedUserAgents_Desc"))+" "+Object(r["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp2"))+" "+Object(r["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp3","/bot|spider|crawl|scanner/i")),1)])]),Object(r["createElementVNode"])("div",Mt,[Object(r["createElementVNode"])("div",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelp"))+" ",1),xt,wt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpDetails"))+" ",1),Tt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpExamples","www.example.org","http://example.org/mypath","https://www.example.org/?param=1","https://sub.example.org/"))+" ",1),Ct,kt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpSubDomains",".sub.example.org","http://sub.example.org/mypath","https://new.sub.example.org/")),1)])]),Object(r["createElementVNode"])("div",Dt,[Object(r["createElementVNode"])("div",null,[e.timezoneSupportEnabled?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",_t,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_AdvancedTimezoneSupportNotFound"))+" ",1),At])),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_UTCTimeIs",e.utcTimeDate))+" ",1),Pt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward")),1)])]),Object(r["createElementVNode"])("div",Gt,[Object(r["createElementVNode"])("div",{innerHTML:e.$sanitize(e.keepUrlFragmentHelp)},null,8,Lt),Object(r["createElementVNode"])("div",null,Object(r["toDisplayString"])(e.translate("SitesManager_KeepURLFragmentsHelp2")),1)]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"textarea",name:"excludedIpsGlobal","var-type":"array",modelValue:e.excludedIpsGlobal,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.excludedIpsGlobal=t}),title:e.translate("SitesManager_ListOfIpsToBeExcludedOnAllWebsites"),introduction:e.translate("SitesManager_GlobalListExcludedIps"),"inline-help":"#excludedIpsGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"textarea",name:"excludedQueryParametersGlobal","var-type":"array",modelValue:e.excludedQueryParametersGlobal,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.excludedQueryParametersGlobal=t}),title:e.translate("SitesManager_ListOfQueryParametersToBeExcludedOnAllWebsites"),introduction:e.translate("SitesManager_GlobalListExcludedQueryParameters"),"inline-help":"#excludedQueryParametersGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"textarea",name:"excludedUserAgentsGlobal","var-type":"array",modelValue:e.excludedUserAgentsGlobal,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.excludedUserAgentsGlobal=t}),title:e.translate("SitesManager_GlobalListExcludedUserAgents_Desc"),introduction:e.translate("SitesManager_GlobalListExcludedUserAgents"),"inline-help":"#excludedUserAgentsGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"textarea",name:"excludedReferrersGlobal","var-type":"array",modelValue:e.excludedReferrersGlobal,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.excludedReferrersGlobal=t}),title:e.translate("SitesManager_GlobalListExcludedReferrersDesc"),introduction:e.translate("SitesManager_GlobalListExcludedReferrers"),"inline-help":"#excludedReferrersGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"checkbox",name:"keepURLFragmentsGlobal",modelValue:e.keepURLFragmentsGlobal,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.keepURLFragmentsGlobal=t}),title:e.translate("SitesManager_KeepURLFragmentsLong"),introduction:e.translate("SitesManager_KeepURLFragments"),"inline-help":"#keepURLFragmentsHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(r["createElementVNode"])("h3",null,Object(r["toDisplayString"])(e.translate("SitesManager_TrackingSiteSearch")),1),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteSearchUse")),1),Object(r["createElementVNode"])("div",Ut,Object(r["toDisplayString"])(e.translate("SitesManager_SearchParametersNote"))+" "+Object(r["toDisplayString"])(e.translate("SitesManager_SearchParametersNote2")),1),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"text",name:"searchKeywordParametersGlobal","var-type":"array",modelValue:e.searchKeywordParametersGlobal,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.searchKeywordParametersGlobal=t}),title:e.translate("SitesManager_SearchKeywordLabel"),"inline-help":e.translate("SitesManager_SearchKeywordParametersDesc"),disabled:e.isLoading},null,8,["modelValue","title","inline-help","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"text",name:"searchCategoryParametersGlobal","var-type":"array",modelValue:e.searchCategoryParametersGlobal,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.searchCategoryParametersGlobal=t}),title:e.translate("SitesManager_SearchCategoryLabel"),"inline-help":e.searchCategoryParamsInlineHelp,disabled:e.isLoading},null,8,["modelValue","title","inline-help","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"select",name:"defaultTimezone",options:e.timezoneOptions,title:e.translate("SitesManager_SelectDefaultTimezone"),introduction:e.translate("SitesManager_DefaultTimezoneForNewWebsites"),"inline-help":"#timezoneHelp",disabled:e.isLoading,modelValue:e.defaultTimezone,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.defaultTimezone=t})},null,8,["options","title","introduction","disabled","modelValue"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"select",name:"defaultCurrency",modelValue:e.defaultCurrency,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.defaultCurrency=t}),options:e.currencies,title:e.translate("SitesManager_SelectDefaultCurrency"),introduction:e.translate("SitesManager_DefaultCurrencyForNewWebsites"),"inline-help":e.translate("SitesManager_CurrencySymbolWillBeUsedForGoals"),disabled:e.isLoading},null,8,["modelValue","options","title","introduction","inline-help","disabled"])]),Object(r["createVNode"])(s,{saving:e.isSaving,onConfirm:t[9]||(t[9]=function(t){return e.saveGlobalSettings()})},null,8,["saving"])]})),_:1},8,["content-title"]),[[r["vShow"],e.hasSuperUserAccess]])])}var It=Object(r["defineComponent"])({props:{dummy:String},components:{ContentBlock:l["ContentBlock"],Field:qe["Field"],SaveButton:qe["SaveButton"]},data:function(){var e=new Date,t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds()),n=ut.globalSettings.value;return{currentIpAddress:null,utcTime:t,keepURLFragmentsGlobal:n.keepURLFragmentsGlobal,defaultTimezone:n.defaultTimezone,defaultCurrency:n.defaultCurrency,excludedIpsGlobal:(n.excludedIpsGlobal||"").split(","),excludedQueryParametersGlobal:(n.excludedQueryParametersGlobal||"").split(","),excludedUserAgentsGlobal:(n.excludedUserAgentsGlobal||"").split(","),excludedReferrersGlobal:(n.excludedReferrersGlobal||"").split(","),searchKeywordParametersGlobal:(n.searchKeywordParametersGlobal||"").split(","),searchCategoryParametersGlobal:(n.searchCategoryParametersGlobal||"").split(","),isSaving:!1}},created:function(){var e=this;O.init(),D.init(),ut.init(),Object(r["watch"])((function(){return ut.globalSettings.value}),(function(t){e.keepURLFragmentsGlobal=t.keepURLFragmentsGlobal,e.defaultTimezone=t.defaultTimezone,e.defaultCurrency=t.defaultCurrency,e.excludedIpsGlobal=(t.excludedIpsGlobal||"").split(","),e.excludedQueryParametersGlobal=(t.excludedQueryParametersGlobal||"").split(","),e.excludedUserAgentsGlobal=(t.excludedUserAgentsGlobal||"").split(","),e.excludedReferrersGlobal=(t.excludedReferrersGlobal||"").split(","),e.searchKeywordParametersGlobal=(t.searchKeywordParametersGlobal||"").split(","),e.searchCategoryParametersGlobal=(t.searchCategoryParametersGlobal||"").split(",")})),l["AjaxHelper"].fetch({method:"API.getIpFromHeader"}).then((function(t){e.currentIpAddress=t.value}))},methods:{saveGlobalSettings:function(){var e=this;this.isSaving=!0,ut.saveGlobalSettings({keepURLFragments:this.keepURLFragmentsGlobal,currency:this.defaultCurrency,timezone:this.defaultTimezone,excludedIps:this.excludedIpsGlobal.join(","),excludedQueryParameters:this.excludedQueryParametersGlobal.join(","),excludedUserAgents:this.excludedUserAgentsGlobal.join(","),excludedReferrers:this.excludedReferrersGlobal.join(","),searchKeywordParameters:this.searchKeywordParametersGlobal.join(","),searchCategoryParameters:this.searchCategoryParametersGlobal.join(",")}).then((function(){l["Matomo"].helper.redirect({showaddsite:!1})})).finally((function(){e.isSaving=!1}))}},computed:{isLoading:function(){return ut.isLoading.value||D.isLoading.value||O.isLoading.value},timezones:function(){return D.timezones.value},timezoneOptions:function(){return this.timezones.map((function(e){var t=e.group,n=e.label,a=e.code;return{group:t,key:n,value:a}}))},currencies:function(){return O.currencies.value},hasSuperUserAccess:function(){return l["Matomo"].hasSuperUserAccess},yourCurrentIpAddressIs:function(){return Object(l["translate"])("SitesManager_YourCurrentIpAddressIs","".concat(this.currentIpAddress,""))},timezoneSupportEnabled:function(){return D.timezoneSupportEnabled.value},utcTimeDate:function(){var e=this.utcTime,t=function(e){return e.toString().padStart(2,"0")},n=t(e.getHours()),a=t(e.getMinutes()),i=t(e.getSeconds());return"".concat(Object(l["format"])(this.utcTime)," ").concat(n,":").concat(a,":").concat(i)},keepUrlFragmentHelp:function(){return Object(l["translate"])("SitesManager_KeepURLFragmentsHelp","#","example.org/index.html#first_section","example.org/index.html")},searchCategoryParamsInlineHelp:function(){var e=[Object(l["translate"])("Goals_Optional"),Object(l["translate"])("SitesManager_SearchCategoryDesc"),Object(l["translate"])("SitesManager_SearchCategoryParametersDesc")];return e.join(" ")}}});It.render=Bt;var zt=It,Ht=Object(r["createElementVNode"])("span",{class:"icon-chevron-left"},null,-1),Ft={id:"start-tracking-data-header"},Rt={key:0,class:"row",id:"start-tracking-detection"},Wt=["src","alt"],Kt=["href"],Qt={class:"row",id:"start-tracking-method-list"},$t=Object(r["createElementVNode"])("span",{class:"icon-search"},null,-1),qt=["href","onClick"],Yt=["src"],Xt={class:"list-entry-text"},Jt={id:"start-tracking-skip"},Zt=["href"],en=["data-method"],tn=["src","alt"];function nn(e,t,n,a,i,l){var o=Object(r["resolveComponent"])("VueEntryContainer"),s=Object(r["resolveComponent"])("ActivityIndicator");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",null,[e.showMethodDetails?(Object(r["openBlock"])(),Object(r["createElementBlock"])("a",{key:0,id:"start-tracking-back",onClick:t[0]||(t[0]=Object(r["withModifiers"])((function(t){e.showOverview()}),["prevent"]))},[Ht,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("Mobile_NavigationBack")),1)])):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("h1",Ft,Object(r["toDisplayString"])(e.headline),1),Object(r["createVNode"])(o,{id:"start-tracking-cta",html:e.ctaContent},null,8,["html"]),Object(r["createVNode"])(s,{"loading-message":"".concat(e.translate("SitesManager_DetectingYourSite"),"…"),loading:e.loading},null,8,["loading-message","loading"]),e.loading||e.showMethodDetails?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])(r["Fragment"],{key:1},[e.recommendedMethod?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Rt,[Object(r["createElementVNode"])("img",{src:e.recommendedMethod.icon,alt:"".concat(e.recommendedMethod.name," logo")},null,8,Wt),Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.recommendedMethod.recommendationTitle),1),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.recommendedMethod.recommendationText),1),Object(r["createElementVNode"])("a",{href:"#".concat(e.recommendedMethod.id.toLowerCase()),class:"btn",id:"showMethod",onClick:t[1]||(t[1]=Object(r["withModifiers"])((function(t){return e.showMethod(e.recommendedMethod.id)}),["prevent"]))},Object(r["toDisplayString"])(e.recommendedMethod.recommendationButton),9,Kt)])):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("div",Qt,[$t,Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataOtherInstallMethods")),1),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataOtherInstallMethodsIntro")),1),Object(r["createElementVNode"])("ul",null,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.trackingMethods,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{class:"list-entry",key:t.id},[Object(r["createElementVNode"])("a",{href:"#".concat(t.id.toLowerCase()),onClick:Object(r["withModifiers"])((function(n){return e.showMethod(t.id)}),["prevent"])},[t.icon?(Object(r["openBlock"])(),Object(r["createElementBlock"])("img",{key:0,src:t.icon,class:"list-entry-icon"},null,8,Yt)):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("span",Xt,Object(r["toDisplayString"])(t.name),1)],8,qt)])})),128))])]),Object(r["createElementVNode"])("div",Jt,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataNotYetReady")),1),Object(r["createElementVNode"])("div",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataTemporarilyHidePage")),1),Object(r["createElementVNode"])("a",{href:e.ignoreSitesWithoutDataLink,class:"ignoreSitesWithoutData"},Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataHidePageForHour")),9,Zt)])],64)),e.showMethodDetails?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{key:2,id:"start-tracking-details","data-method":e.showMethodDetails.id},[Object(r["createElementVNode"])("img",{src:e.showMethodDetails.icon,alt:"".concat(e.showMethodDetails.name," logo")},null,8,tn),Object(r["createVNode"])(o,{html:e.showMethodDetails.content},null,8,["html"])],8,en)):Object(r["createCommentVNode"])("",!0)])}function an(e,t){return cn(e)||sn(e,t)||ln(e,t)||rn()}function rn(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ln(e,t){if(e){if("string"===typeof e)return on(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?on(e,t):void 0}}function on(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n1?Object(l["translate"])("General_Measurables"):Object(l["translate"])("SitesManager_Sites"))},mainDescription:function(){return Object(l["translate"])("SitesManager_YouCurrentlyHaveAccessToNWebsites","".concat(this.totalNumberOfSites,""))},hasSuperUserAccess:function(){return l["Matomo"].hasSuperUserAccess},superUserAccessMessage:function(){return Object(l["translate"])("SitesManager_SuperUserAccessCan","","")},hasPrev:function(){return this.currentPage>=1},hasNext:function(){return this.fetchedSites.filter((function(e){return!!e.idsite})).length>=this.pageSize+1},offsetStart:function(){return this.currentPage*this.pageSize+1},offsetEnd:function(){return this.offsetStart+this.sites.filter((function(e){return!!e.idsite})).length-1}},methods:{checkGlobalSettingsHash:function(){var e=l["MatomoUrl"].hashQuery.value;!l["Matomo"].hasSuperUserAccess||"globalSettings"!==e&&"/globalSettings"!==e||l["MatomoUrl"].updateLocation(Object.assign(Object.assign({},l["MatomoUrl"].urlParsed.value),{},{action:"globalSettings"}))},addNewEntity:function(){this.availableTypes.length>1?this.showAddSiteDialog=!0:1===this.availableTypes.length&&this.addSite(this.availableTypes[0].id)},addSite:function(e){var t=e,n={isAllowed:!0,measurableType:t};l["Matomo"].postEvent("SitesManager.initAddSite",n),n&&!n.isAllowed||(t||(t="website"),this.fetchedSites.unshift({type:t}),this.isSiteBeingEdited=!0)},afterCancelEdit:function(e){var t=e.site,n=e.element;this.isSiteBeingEdited=!1,t.idsite?n.scrollIntoView():this.fetchedSites=this.fetchedSites.filter((function(e){return!!e.idsite}))},fetchLimitedSitesWithAdminAccess:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.fetchLimitedSitesAbortController&&this.fetchLimitedSitesAbortController.abort(),this.fetchLimitedSitesAbortController=new AbortController;var n=this.pageSize+1,a=this.currentPage*this.pageSize,i={method:"SitesManager.getSitesWithAdminAccess",fetchAliasUrls:1,limit:n+a,filter_offset:a,filter_limit:n};return t&&(i.pattern=t),l["AjaxHelper"].fetch(i).then((function(t){e.fetchedSites=t||[]})).then((function(n){return e.activeSearchTerm=t,n})).finally((function(){e.fetchLimitedSitesAbortController=null}))},getTotalNumberOfSites:function(){var e=this;return l["AjaxHelper"].fetch({method:"SitesManager.getSitesIdWithAdminAccess",filter_limit:"-1"}).then((function(t){e.totalNumberOfSites=t.length}))},triggerAddSiteIfRequested:function(){var e=h.getEditSiteIdParameter(),t=l["MatomoUrl"].urlParsed.value.showaddsite;"1"===t?this.addNewEntity():e&&(this.searchTerm=e,this.fetchLimitedSitesWithAdminAccess(this.searchTerm))},previousPage:function(){this.currentPage=Math.max(0,this.currentPage-1),this.fetchLimitedSitesWithAdminAccess(this.activeSearchTerm)},nextPage:function(){this.currentPage=Math.max(0,this.currentPage+1),this.fetchLimitedSitesWithAdminAccess(this.activeSearchTerm)},searchSites:function(){this.currentPage=0,this.fetchLimitedSitesWithAdminAccess(this.searchTerm)},afterDelete:function(e){var t={showaddsite:0};if(l["MatomoUrl"].urlParsed.value.idSite==="".concat(e.idsite)){var n=this.sites.find((function(t){return t.idsite!==e.idsite}));n&&(t=Object.assign(Object.assign({},t),{},{idSite:n.idsite}))}l["Matomo"].helper.redirect(t)},afterSave:function(e,t,n,a){var i=["excluded_ips","excluded_parameters","excluded_user_agents","sitesearch_keyword_parameters","sitesearch_category_parameters"],r=Object.assign({},e);Object.values(t).forEach((function(e){e.forEach((function(e){"urls"===e.name?r.alias_urls=e.value:-1!==i.indexOf(e.name)?r[e.name]=e.value.join(", "):r[e.name]=e.value}))})),this.fetchedSites[n]=r,a&&null!==this.totalNumberOfSites&&(this.totalNumberOfSites+=1),this.isSiteBeingEdited=!1}}});bt.render=$;var ht=bt,pt={class:"SitesManager"},gt=Object(r["createElementVNode"])("a",{name:"globalSettings",id:"globalSettings"},null,-1),ft={id:"excludedIpsGlobalHelp",class:"inline-help-node"},St=Object(r["createElementVNode"])("br",null,null,-1),jt=Object(r["createElementVNode"])("br",null,null,-1),Ot=["innerHTML"],vt={id:"excludedQueryParametersGlobalHelp",class:"inline-help-node"},yt=Object(r["createElementVNode"])("br",null,null,-1),Et=Object(r["createElementVNode"])("br",null,null,-1),Nt={id:"excludedUserAgentsGlobalHelp",class:"inline-help-node"},Vt=Object(r["createElementVNode"])("br",null,null,-1),Mt=Object(r["createElementVNode"])("br",null,null,-1),xt={id:"excludedReferrersGlobalHelp",class:"inline-help-node"},wt=Object(r["createElementVNode"])("br",null,null,-1),Tt=Object(r["createElementVNode"])("br",null,null,-1),kt=Object(r["createElementVNode"])("br",null,null,-1),Ct=Object(r["createElementVNode"])("br",null,null,-1),Dt=Object(r["createElementVNode"])("br",null,null,-1),_t={id:"timezoneHelp",class:"inline-help-node"},At={key:0},Pt=Object(r["createElementVNode"])("br",null,null,-1),Gt=Object(r["createElementVNode"])("br",null,null,-1),Lt={id:"keepURLFragmentsHelp",class:"inline-help-node"},Ut=["innerHTML"],Bt={class:"alert alert-info"};function It(e,t,n,a,i,l){var o=Object(r["resolveComponent"])("Field"),s=Object(r["resolveComponent"])("SaveButton"),c=Object(r["resolveComponent"])("ContentBlock");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",pt,[Object(r["withDirectives"])(Object(r["createVNode"])(c,{"content-title":e.translate("SitesManager_GlobalWebsitesSettings")},{default:Object(r["withCtx"])((function(){return[gt,Object(r["createElementVNode"])("div",ft,[Object(r["createElementVNode"])("div",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_HelpExcludedIpAddresses","1.2.3.4/24","1.2.3.*","1.2.*.*"))+" ",1),St,jt,Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.yourCurrentIpAddressIs)},null,8,Ot)])]),Object(r["createElementVNode"])("div",vt,[Object(r["createElementVNode"])("div",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_ListOfQueryParametersToExclude","/^sess.*|.*[dD]ate$/"))+" ",1),yt,Et,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_PiwikWillAutomaticallyExcludeCommonSessionParameters","phpsessid, sessionid, ...")),1)])]),Object(r["createElementVNode"])("div",Nt,[Object(r["createElementVNode"])("div",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp1"))+" ",1),Vt,Mt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_GlobalListExcludedUserAgents_Desc"))+" "+Object(r["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp2"))+" "+Object(r["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp3","/bot|spider|crawl|scanner/i")),1)])]),Object(r["createElementVNode"])("div",xt,[Object(r["createElementVNode"])("div",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelp"))+" ",1),wt,Tt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpDetails"))+" ",1),kt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpExamples","www.example.org","http://example.org/mypath","https://www.example.org/?param=1","https://sub.example.org/"))+" ",1),Ct,Dt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpSubDomains",".sub.example.org","http://sub.example.org/mypath","https://new.sub.example.org/")),1)])]),Object(r["createElementVNode"])("div",_t,[Object(r["createElementVNode"])("div",null,[e.timezoneSupportEnabled?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",At,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_AdvancedTimezoneSupportNotFound"))+" ",1),Pt])),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_UTCTimeIs",e.utcTimeDate))+" ",1),Gt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward")),1)])]),Object(r["createElementVNode"])("div",Lt,[Object(r["createElementVNode"])("div",{innerHTML:e.$sanitize(e.keepUrlFragmentHelp)},null,8,Ut),Object(r["createElementVNode"])("div",null,Object(r["toDisplayString"])(e.translate("SitesManager_KeepURLFragmentsHelp2")),1)]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"textarea",name:"excludedIpsGlobal","var-type":"array",modelValue:e.excludedIpsGlobal,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.excludedIpsGlobal=t}),title:e.translate("SitesManager_ListOfIpsToBeExcludedOnAllWebsites"),introduction:e.translate("SitesManager_GlobalListExcludedIps"),"inline-help":"#excludedIpsGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"textarea",name:"excludedQueryParametersGlobal","var-type":"array",modelValue:e.excludedQueryParametersGlobal,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.excludedQueryParametersGlobal=t}),title:e.translate("SitesManager_ListOfQueryParametersToBeExcludedOnAllWebsites"),introduction:e.translate("SitesManager_GlobalListExcludedQueryParameters"),"inline-help":"#excludedQueryParametersGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"textarea",name:"excludedUserAgentsGlobal","var-type":"array",modelValue:e.excludedUserAgentsGlobal,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.excludedUserAgentsGlobal=t}),title:e.translate("SitesManager_GlobalListExcludedUserAgents_Desc"),introduction:e.translate("SitesManager_GlobalListExcludedUserAgents"),"inline-help":"#excludedUserAgentsGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"textarea",name:"excludedReferrersGlobal","var-type":"array",modelValue:e.excludedReferrersGlobal,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.excludedReferrersGlobal=t}),title:e.translate("SitesManager_GlobalListExcludedReferrersDesc"),introduction:e.translate("SitesManager_GlobalListExcludedReferrers"),"inline-help":"#excludedReferrersGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"checkbox",name:"keepURLFragmentsGlobal",modelValue:e.keepURLFragmentsGlobal,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.keepURLFragmentsGlobal=t}),title:e.translate("SitesManager_KeepURLFragmentsLong"),introduction:e.translate("SitesManager_KeepURLFragments"),"inline-help":"#keepURLFragmentsHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(r["createElementVNode"])("h3",null,Object(r["toDisplayString"])(e.translate("SitesManager_TrackingSiteSearch")),1),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteSearchUse")),1),Object(r["createElementVNode"])("div",Bt,Object(r["toDisplayString"])(e.translate("SitesManager_SearchParametersNote"))+" "+Object(r["toDisplayString"])(e.translate("SitesManager_SearchParametersNote2")),1),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"text",name:"searchKeywordParametersGlobal","var-type":"array",modelValue:e.searchKeywordParametersGlobal,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.searchKeywordParametersGlobal=t}),title:e.translate("SitesManager_SearchKeywordLabel"),"inline-help":e.translate("SitesManager_SearchKeywordParametersDesc"),disabled:e.isLoading},null,8,["modelValue","title","inline-help","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"text",name:"searchCategoryParametersGlobal","var-type":"array",modelValue:e.searchCategoryParametersGlobal,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.searchCategoryParametersGlobal=t}),title:e.translate("SitesManager_SearchCategoryLabel"),"inline-help":e.searchCategoryParamsInlineHelp,disabled:e.isLoading},null,8,["modelValue","title","inline-help","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"select",name:"defaultTimezone",options:e.timezoneOptions,title:e.translate("SitesManager_SelectDefaultTimezone"),introduction:e.translate("SitesManager_DefaultTimezoneForNewWebsites"),"inline-help":"#timezoneHelp",disabled:e.isLoading,modelValue:e.defaultTimezone,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.defaultTimezone=t})},null,8,["options","title","introduction","disabled","modelValue"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"select",name:"defaultCurrency",modelValue:e.defaultCurrency,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.defaultCurrency=t}),options:e.currencies,title:e.translate("SitesManager_SelectDefaultCurrency"),introduction:e.translate("SitesManager_DefaultCurrencyForNewWebsites"),"inline-help":e.translate("SitesManager_CurrencySymbolWillBeUsedForGoals"),disabled:e.isLoading},null,8,["modelValue","options","title","introduction","inline-help","disabled"])]),Object(r["createVNode"])(s,{saving:e.isSaving,onConfirm:t[9]||(t[9]=function(t){return e.saveGlobalSettings()})},null,8,["saving"])]})),_:1},8,["content-title"]),[[r["vShow"],e.hasSuperUserAccess]])])}var zt=Object(r["defineComponent"])({props:{dummy:String},components:{ContentBlock:l["ContentBlock"],Field:Ye["Field"],SaveButton:Ye["SaveButton"]},data:function(){var e=new Date,t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds()),n=mt.globalSettings.value;return{currentIpAddress:null,utcTime:t,keepURLFragmentsGlobal:n.keepURLFragmentsGlobal,defaultTimezone:n.defaultTimezone,defaultCurrency:n.defaultCurrency,excludedIpsGlobal:(n.excludedIpsGlobal||"").split(","),excludedQueryParametersGlobal:(n.excludedQueryParametersGlobal||"").split(","),excludedUserAgentsGlobal:(n.excludedUserAgentsGlobal||"").split(","),excludedReferrersGlobal:(n.excludedReferrersGlobal||"").split(","),searchKeywordParametersGlobal:(n.searchKeywordParametersGlobal||"").split(","),searchCategoryParametersGlobal:(n.searchCategoryParametersGlobal||"").split(","),isSaving:!1}},created:function(){var e=this;O.init(),D.init(),mt.init(),Object(r["watch"])((function(){return mt.globalSettings.value}),(function(t){e.keepURLFragmentsGlobal=t.keepURLFragmentsGlobal,e.defaultTimezone=t.defaultTimezone,e.defaultCurrency=t.defaultCurrency,e.excludedIpsGlobal=(t.excludedIpsGlobal||"").split(","),e.excludedQueryParametersGlobal=(t.excludedQueryParametersGlobal||"").split(","),e.excludedUserAgentsGlobal=(t.excludedUserAgentsGlobal||"").split(","),e.excludedReferrersGlobal=(t.excludedReferrersGlobal||"").split(","),e.searchKeywordParametersGlobal=(t.searchKeywordParametersGlobal||"").split(","),e.searchCategoryParametersGlobal=(t.searchCategoryParametersGlobal||"").split(",")})),l["AjaxHelper"].fetch({method:"API.getIpFromHeader"}).then((function(t){e.currentIpAddress=t.value}))},methods:{saveGlobalSettings:function(){var e=this;this.isSaving=!0,mt.saveGlobalSettings({keepURLFragments:this.keepURLFragmentsGlobal,currency:this.defaultCurrency,timezone:this.defaultTimezone,excludedIps:this.excludedIpsGlobal.join(","),excludedQueryParameters:this.excludedQueryParametersGlobal.join(","),excludedUserAgents:this.excludedUserAgentsGlobal.join(","),excludedReferrers:this.excludedReferrersGlobal.join(","),searchKeywordParameters:this.searchKeywordParametersGlobal.join(","),searchCategoryParameters:this.searchCategoryParametersGlobal.join(",")}).then((function(){l["Matomo"].helper.redirect({showaddsite:!1})})).finally((function(){e.isSaving=!1}))}},computed:{isLoading:function(){return mt.isLoading.value||D.isLoading.value||O.isLoading.value},timezones:function(){return D.timezones.value},timezoneOptions:function(){return this.timezones.map((function(e){var t=e.group,n=e.label,a=e.code;return{group:t,key:n,value:a}}))},currencies:function(){return O.currencies.value},hasSuperUserAccess:function(){return l["Matomo"].hasSuperUserAccess},yourCurrentIpAddressIs:function(){return Object(l["translate"])("SitesManager_YourCurrentIpAddressIs","".concat(this.currentIpAddress,""))},timezoneSupportEnabled:function(){return D.timezoneSupportEnabled.value},utcTimeDate:function(){var e=this.utcTime,t=function(e){return e.toString().padStart(2,"0")},n=t(e.getHours()),a=t(e.getMinutes()),i=t(e.getSeconds());return"".concat(Object(l["format"])(this.utcTime)," ").concat(n,":").concat(a,":").concat(i)},keepUrlFragmentHelp:function(){return Object(l["translate"])("SitesManager_KeepURLFragmentsHelp","#","example.org/index.html#first_section","example.org/index.html")},searchCategoryParamsInlineHelp:function(){var e=[Object(l["translate"])("Goals_Optional"),Object(l["translate"])("SitesManager_SearchCategoryDesc"),Object(l["translate"])("SitesManager_SearchCategoryParametersDesc")];return e.join(" ")}}});zt.render=It;var Ht=zt,Ft=Object(r["createElementVNode"])("span",{class:"icon-chevron-left"},null,-1),Rt={id:"start-tracking-data-header"},Wt={key:0,class:"row",id:"start-tracking-detection"},Kt=["src","alt"],$t=["href"],Qt={class:"row",id:"start-tracking-method-list"},qt=Object(r["createElementVNode"])("span",{class:"icon-search"},null,-1),Yt=["href","onClick"],Xt=["src"],Jt={class:"list-entry-text"},Zt={id:"start-tracking-skip"},en=["href"],tn=["data-method"],nn=["src","alt"];function an(e,t,n,a,i,l){var o=Object(r["resolveComponent"])("VueEntryContainer"),s=Object(r["resolveComponent"])("ActivityIndicator");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",null,[e.showMethodDetails?(Object(r["openBlock"])(),Object(r["createElementBlock"])("a",{key:0,id:"start-tracking-back",onClick:t[0]||(t[0]=Object(r["withModifiers"])((function(t){e.showOverview()}),["prevent"]))},[Ft,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("Mobile_NavigationBack")),1)])):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("h1",Rt,Object(r["toDisplayString"])(e.headline),1),Object(r["createVNode"])(o,{id:"start-tracking-cta",html:e.ctaContent},null,8,["html"]),Object(r["createVNode"])(s,{"loading-message":"".concat(e.translate("SitesManager_DetectingYourSite"),"…"),loading:e.loading},null,8,["loading-message","loading"]),e.loading||e.showMethodDetails?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])(r["Fragment"],{key:1},[e.recommendedMethod?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Wt,[Object(r["createElementVNode"])("img",{src:e.recommendedMethod.icon,alt:"".concat(e.recommendedMethod.name," logo")},null,8,Kt),Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.recommendedMethod.recommendationTitle),1),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.recommendedMethod.recommendationText),1),Object(r["createElementVNode"])("a",{href:"#".concat(e.recommendedMethod.id.toLowerCase()),class:"btn",id:"showMethod",onClick:t[1]||(t[1]=Object(r["withModifiers"])((function(t){return e.showMethod(e.recommendedMethod.id)}),["prevent"]))},Object(r["toDisplayString"])(e.recommendedMethod.recommendationButton),9,$t)])):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("div",Qt,[qt,Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataOtherInstallMethods")),1),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataOtherInstallMethodsIntro")),1),Object(r["createElementVNode"])("ul",null,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.trackingMethods,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{class:"list-entry",key:t.id},[Object(r["createElementVNode"])("a",{href:"#".concat(t.id.toLowerCase()),onClick:Object(r["withModifiers"])((function(n){return e.showMethod(t.id)}),["prevent"])},[t.icon?(Object(r["openBlock"])(),Object(r["createElementBlock"])("img",{key:0,src:t.icon,class:"list-entry-icon"},null,8,Xt)):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("span",Jt,Object(r["toDisplayString"])(t.name),1)],8,Yt)])})),128))])]),Object(r["createElementVNode"])("div",Zt,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataNotYetReady")),1),Object(r["createElementVNode"])("div",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataTemporarilyHidePage")),1),Object(r["createElementVNode"])("a",{href:e.ignoreSitesWithoutDataLink,class:"ignoreSitesWithoutData"},Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataHidePageForHour")),9,en)])],64)),e.showMethodDetails?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{key:2,id:"start-tracking-details","data-method":e.showMethodDetails.id},[Object(r["createElementVNode"])("img",{src:e.showMethodDetails.icon,alt:"".concat(e.showMethodDetails.name," logo")},null,8,nn),Object(r["createVNode"])(o,{html:e.showMethodDetails.content},null,8,["html"])],8,tn)):Object(r["createCommentVNode"])("",!0)])}function rn(e,t){return dn(e)||cn(e,t)||on(e,t)||ln()}function ln(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function on(e,t){if(e){if("string"===typeof e)return sn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?sn(e,t):void 0}}function sn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n @@ -187,6 +187,7 @@ >

{{ removeDialogTitle }}

{{ translate('SitesManager_DeleteSiteExplanation') }}

+

@@ -222,6 +223,7 @@ interface SiteFieldsState { measurableSettings: DeepReadonly; settingValues: Record; showRemoveDialog: boolean; + deleteSiteExplanation: string; } interface CreateEditSiteResponse { @@ -267,6 +269,7 @@ export default defineComponent({ measurableSettings: [], settingValues: {}, showRemoveDialog: false, + deleteSiteExplanation: '', }; }, components: { @@ -452,6 +455,20 @@ export default defineComponent({ this.$emit('delete', this.theSite); }); }, + getMessagesToWarnOnSiteRemoval() { + AjaxHelper.post({ + idSite: this.theSite.idsite, + module: 'API', + format: 'json', + method: 'SitesManager.getMessagesToWarnOnSiteRemoval', + }).then((response) => { + this.deleteSiteExplanation = ''; + if (response.length) { + this.deleteSiteExplanation += response.join('
'); + } + this.showRemoveDialog = true; + }); + }, }, computed: { availableTypes() {