diff options
author | sgiehl <stefan@matomo.org> | 2022-08-05 11:11:10 +0300 |
---|---|---|
committer | sgiehl <stefan@matomo.org> | 2022-08-05 11:11:10 +0300 |
commit | 75519b09a56e79096b0dc058ca098ce6f318423d (patch) | |
tree | bf347122dfbe19277c02febb1df4349f6d164a88 /plugins/SitesManager | |
parent | fd3c1d4bf330c228c0363cd7646f1b808fa03259 (diff) | |
parent | ffb210bc547b7f42d77080c7ff44aa218c8a30f3 (diff) |
Merge branch '4.x-dev' into 5.x-dev
Diffstat (limited to 'plugins/SitesManager')
-rw-r--r-- | plugins/SitesManager/API.php | 7 | ||||
-rw-r--r-- | plugins/SitesManager/vue/dist/SitesManager.umd.js | 73 | ||||
-rw-r--r-- | plugins/SitesManager/vue/dist/SitesManager.umd.min.js | 6 | ||||
-rw-r--r-- | plugins/SitesManager/vue/src/SiteFields/SiteFields.vue | 23 |
4 files changed, 49 insertions, 60 deletions
diff --git a/plugins/SitesManager/API.php b/plugins/SitesManager/API.php index 4b4b6c6175..80f2ddd252 100644 --- a/plugins/SitesManager/API.php +++ b/plugins/SitesManager/API.php @@ -817,13 +817,18 @@ class API extends \Piwik\Plugin\API * Requires Super User access. * * @param int $idSite + * @param string $passwordConfirmation the current user's password, only required when the request is authenticated with session token auth * @throws Exception */ - public function deleteSite($idSite) + public function deleteSite($idSite, $passwordConfirmation = null) { Piwik::checkUserHasSuperUserAccess(); SitesManager::dieIfSitesAdminIsDisabled(); + if (Common::getRequestVar('force_api_session', 0)) { + $this->confirmCurrentUserPassword($passwordConfirmation); + } + $idSites = $this->getSitesId(); if (!in_array($idSite, $idSites)) { throw new Exception("website id = $idSite not found"); diff --git a/plugins/SitesManager/vue/dist/SitesManager.umd.js b/plugins/SitesManager/vue/dist/SitesManager.umd.js index dedc66b356..8b0340a6b5 100644 --- a/plugins/SitesManager/vue/dist/SitesManager.umd.js +++ b/plugins/SitesManager/vue/dist/SitesManager.umd.js @@ -798,45 +798,45 @@ function ButtonBarvue_type_template_id_e81d4006_render(_ctx, _cache, $props, $se ButtonBarvue_type_script_lang_ts.render = ButtonBarvue_type_template_id_e81d4006_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=648e955b +// 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=f4f3f31a -var SiteFieldsvue_type_template_id_648e955b_hoisted_1 = ["idsite", "type"]; -var SiteFieldsvue_type_template_id_648e955b_hoisted_2 = { +var SiteFieldsvue_type_template_id_f4f3f31a_hoisted_1 = ["idsite", "type"]; +var SiteFieldsvue_type_template_id_f4f3f31a_hoisted_2 = { class: "card-content" }; -var SiteFieldsvue_type_template_id_648e955b_hoisted_3 = { +var SiteFieldsvue_type_template_id_f4f3f31a_hoisted_3 = { key: 0, class: "row" }; -var SiteFieldsvue_type_template_id_648e955b_hoisted_4 = { +var SiteFieldsvue_type_template_id_f4f3f31a_hoisted_4 = { class: "col m3" }; -var SiteFieldsvue_type_template_id_648e955b_hoisted_5 = { +var SiteFieldsvue_type_template_id_f4f3f31a_hoisted_5 = { class: "title" }; -var SiteFieldsvue_type_template_id_648e955b_hoisted_6 = { +var SiteFieldsvue_type_template_id_f4f3f31a_hoisted_6 = { class: "title" }; -var SiteFieldsvue_type_template_id_648e955b_hoisted_7 = ["target", "title", "href"]; -var SiteFieldsvue_type_template_id_648e955b_hoisted_8 = { +var SiteFieldsvue_type_template_id_f4f3f31a_hoisted_7 = ["target", "title", "href"]; +var SiteFieldsvue_type_template_id_f4f3f31a_hoisted_8 = { class: "col m4" }; -var SiteFieldsvue_type_template_id_648e955b_hoisted_9 = { +var SiteFieldsvue_type_template_id_f4f3f31a_hoisted_9 = { class: "title" }; -var SiteFieldsvue_type_template_id_648e955b_hoisted_10 = { +var SiteFieldsvue_type_template_id_f4f3f31a_hoisted_10 = { class: "title" }; -var SiteFieldsvue_type_template_id_648e955b_hoisted_11 = { +var SiteFieldsvue_type_template_id_f4f3f31a_hoisted_11 = { class: "title" }; -var SiteFieldsvue_type_template_id_648e955b_hoisted_12 = { +var SiteFieldsvue_type_template_id_f4f3f31a_hoisted_12 = { class: "title" }; -var SiteFieldsvue_type_template_id_648e955b_hoisted_13 = { +var SiteFieldsvue_type_template_id_f4f3f31a_hoisted_13 = { class: "col m4" }; -var SiteFieldsvue_type_template_id_648e955b_hoisted_14 = { +var SiteFieldsvue_type_template_id_f4f3f31a_hoisted_14 = { class: "title" }; @@ -909,12 +909,7 @@ var _hoisted_39 = { class: "editingSiteFooter" }; var _hoisted_40 = ["value"]; -var _hoisted_41 = { - class: "ui-confirm" -}; -var _hoisted_42 = ["value"]; -var _hoisted_43 = ["value"]; -function SiteFieldsvue_type_template_id_648e955b_render(_ctx, _cache, $props, $setup, $data, $options) { +function SiteFieldsvue_type_template_id_f4f3f31a_render(_ctx, _cache, $props, $setup, $data, $options) { var _ctx$theSite$excluded, _ctx$theSite$excluded2, _ctx$theSite$excluded3, @@ -926,7 +921,7 @@ function SiteFieldsvue_type_template_id_648e955b_render(_ctx, _cache, $props, $s var _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field"); - var _component_MatomoDialog = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("MatomoDialog"); + var _component_PasswordConfirmation = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("PasswordConfirmation"); return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["site card hoverable", { @@ -935,11 +930,11 @@ function SiteFieldsvue_type_template_id_648e955b_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_648e955b_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_648e955b_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteFieldsvue_type_template_id_648e955b_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_648e955b_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_648e955b_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_f4f3f31a_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_f4f3f31a_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", SiteFieldsvue_type_template_id_f4f3f31a_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_f4f3f31a_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_f4f3f31a_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_648e955b_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_648e955b_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_648e955b_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_648e955b_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_648e955b_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_648e955b_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_648e955b_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_648e955b_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_f4f3f31a_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_f4f3f31a_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_f4f3f31a_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_f4f3f31a_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_f4f3f31a_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_f4f3f31a_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_f4f3f31a_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_f4f3f31a_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", { @@ -1011,30 +1006,20 @@ function SiteFieldsvue_type_template_id_648e955b_render(_ctx, _cache, $props, $s onClick: _cache[6] || (_cache[6] = function ($event) { return _ctx.cancelEditSite(_ctx.site); }) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Cancel', '', '')), 1)])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_MatomoDialog, { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Cancel', '', '')), 1)])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_PasswordConfirmation, { modelValue: _ctx.showRemoveDialog, "onUpdate:modelValue": _cache[7] || (_cache[7] = function ($event) { return _ctx.showRemoveDialog = $event; }), - onYes: _cache[8] || (_cache[8] = function ($event) { - return _ctx.deleteSite(); - }) + onConfirmed: _ctx.deleteSite }, { default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { - return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_41, [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), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - type: "button", - value: _ctx.translate('General_Yes'), - role: "yes" - }, null, 8, _hoisted_42), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { - type: "button", - value: _ctx.translate('General_No'), - role: "no" - }, null, 8, _hoisted_43)])]; + 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), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ConfirmWithPassword')), 1)]; }), _: 1 - }, 8, ["modelValue"])], 10, SiteFieldsvue_type_template_id_648e955b_hoisted_1); + }, 8, ["modelValue", "onConfirmed"])], 10, SiteFieldsvue_type_template_id_f4f3f31a_hoisted_1); } -// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SiteFields/SiteFields.vue?vue&type=template&id=648e955b +// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SiteFields/SiteFields.vue?vue&type=template&id=f4f3f31a // EXTERNAL MODULE: external "CorePluginsAdmin" var external_CorePluginsAdmin_ = __webpack_require__("a5a2"); @@ -1104,7 +1089,7 @@ function isSiteNew(site) { }; }, components: { - MatomoDialog: external_CoreHome_["MatomoDialog"], + PasswordConfirmation: external_CorePluginsAdmin_["PasswordConfirmation"], Field: external_CorePluginsAdmin_["Field"], GroupedSettings: external_CorePluginsAdmin_["GroupedSettings"], ActivityIndicator: external_CoreHome_["ActivityIndicator"] @@ -1274,14 +1259,16 @@ function isSiteNew(site) { element: this.$refs.root }); }, - deleteSite: function deleteSite() { + deleteSite: function deleteSite(password) { var _this3 = this; - external_CoreHome_["AjaxHelper"].fetch({ + external_CoreHome_["AjaxHelper"].post({ idSite: this.theSite.idsite, module: 'API', format: 'json', method: 'SitesManager.deleteSite' + }, { + passwordConfirmation: password }).then(function () { _this3.$emit('delete', _this3.theSite); }); @@ -1368,7 +1355,7 @@ function isSiteNew(site) { -SiteFieldsvue_type_script_lang_ts.render = SiteFieldsvue_type_template_id_648e955b_render +SiteFieldsvue_type_script_lang_ts.render = SiteFieldsvue_type_template_id_f4f3f31a_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 ddaf07fe5b..7c8f37f515 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 _})),n.d(t,"SitesManagement",(function(){return pt})),n.d(t,"ManageGlobalSettings",(function(){return Ft})),n.d(t,"SiteWithoutData",(function(){return Jt})),"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;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 c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function u(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")):"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 _})),n.d(t,"SitesManagement",(function(){return bt})),n.d(t,"ManageGlobalSettings",(function(){return zt})),n.d(t,"SiteWithoutData",(function(){return $t})),"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;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 c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function u(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 * @@ -16,13 +16,13 @@ * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var D=function(){function e(){var t=this;T(this,e),w(this,"privateState",Object(r["reactive"])({isLoading:!1,timezones:[],timezoneSupportEnabled:!1})),w(this,"state",Object(r["computed"])((function(){return Object(r["readonly"])(t.privateState)}))),w(this,"timezones",Object(r["computed"])((function(){return t.state.value.timezones}))),w(this,"timezoneSupportEnabled",Object(r["computed"])((function(){return t.state.value.timezoneSupportEnabled}))),w(this,"isLoading",Object(r["computed"])((function(){return t.state.value.isLoading}))),w(this,"initializePromise",null)}return C(e,[{key:"init",value:function(){var e=this;return this.initializePromise||(this.privateState.isLoading=!0,this.initializePromise=Promise.all([this.checkTimezoneSupportEnabled(),this.fetchTimezones()]).finally((function(){e.privateState.isLoading=!1}))),this.initializePromise}},{key:"fetchTimezones",value:function(){var e=this;return l["AjaxHelper"].fetch({method:"SitesManager.getTimezonesList"}).then((function(t){var n=[];Object.entries(t).forEach((function(e){var t=v(e,2),a=t[0],i=t[1];Object.entries(i).forEach((function(e){var t=v(e,2),i=t[0],r=t[1];n.push({group:a,label:i,code:r})}))})),e.privateState.timezones=n}))}},{key:"checkTimezoneSupportEnabled",value:function(){var e=this;return l["AjaxHelper"].fetch({method:"SitesManager.isTimezoneSupportEnabled"}).then((function(t){e.privateState.timezoneSupportEnabled=t.value}))}}]),e}(),_=new D,G={class:"SitesManager",ref:"root"},k={class:"sites-manager-header"},A=["innerHTML"],P=Object(r["createElementVNode"])("br",null,null,-1),L=["innerHTML"],U={class:"loadingPiwik"},B=["alt"],z={class:"ui-confirm"},I={class:"center"},H=["title","onClick"],F={class:"ui-button-text"},R={class:"sitesManagerList"},W={key:0},K={class:"bottomButtonBar"};function q(e,t,n,a,i,l){var o=this,s=Object(r["resolveComponent"])("EnrichedHeadline"),c=Object(r["resolveComponent"])("ButtonBar"),u=Object(r["resolveComponent"])("MatomoDialog"),d=Object(r["resolveComponent"])("SiteFields"),b=Object(r["resolveDirective"])("content-intro");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",G,[Object(r["createElementVNode"])("div",k,[Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("h2",null,[Object(r["createVNode"])(s,{"help-url":"https://matomo.org/docs/manage-websites/","feature-name":e.translate("SitesManager_WebsitesManagement")},{default:Object(r["withCtx"])((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.headlineText),1)]})),_:1},8,["help-url","feature-name"])],512),[[r["vShow"],e.availableTypes.length]]),Object(r["createElementVNode"])("p",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_MainDescription"))+" ",1),Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.mainDescription)},null,8,A),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",null,[P,Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.superUserAccessMessage)},null,8,L)],512),[[r["vShow"],e.hasSuperUserAccess]])])],512),[[b]])]),Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("div",{class:Object(r["normalizeClass"])({hide_only:!e.isLoading})},[Object(r["createElementVNode"])("div",U,[Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,B),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])],2)]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(c,{"site-is-being-edited":e.isSiteBeingEdited,"has-prev":e.hasPrev,hasNext:e.hasNext,"offset-start":e.offsetStart,"offset-end":e.offsetEnd,"total-number-of-sites":e.totalNumberOfSites,"is-loading":e.isLoading,"search-term":e.searchTerm,"is-searching":!!e.activeSearchTerm,"onUpdate:searchTerm":t[0]||(t[0]=function(t){return e.searchTerm=t}),onAdd:t[1]||(t[1]=function(t){return e.addNewEntity()}),onSearch:t[2]||(t[2]=function(t){return e.searchSites(t)}),onPrev:t[3]||(t[3]=function(t){return e.previousPage()}),onNext:t[4]||(t[4]=function(t){return e.nextPage()})},null,8,["site-is-being-edited","has-prev","hasNext","offset-start","offset-end","total-number-of-sites","is-loading","search-term","is-searching"])]),Object(r["createVNode"])(u,{modelValue:e.showAddSiteDialog,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.showAddSiteDialog=t})},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("div",z,[Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("SitesManager_ChooseMeasurableTypeHeadline")),1),Object(r["createElementVNode"])("div",I,[Object(r["createElementVNode"])("p",null,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.availableTypes,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("button",{type:"button",key:t.id,title:t.description,class:"modal-close btn",style:{"margin-left":"20px"},onClick:function(n){e.addSite(t.id)},"aria-disabled":"false"},[Object(r["createElementVNode"])("span",F,Object(r["toDisplayString"])(t.name),1)],8,H)})),128))])])])])]})),_:1},8,["modelValue"]),Object(r["createElementVNode"])("div",R,[e.activeSearchTerm&&0===e.sites.length&&!e.isLoading?(Object(r["openBlock"])(),Object(r["createElementBlock"])("p",W,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_NotFound"))+" ",1),Object(r["createElementVNode"])("strong",null,Object(r["toDisplayString"])(e.activeSearchTerm),1)])):Object(r["createCommentVNode"])("",!0),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sites,(function(n,a){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{key:n.idsite},[Object(r["createVNode"])(d,{site:n,"timezone-support-enabled":e.timezoneSupportEnabled,"utc-time":e.utcTime,"global-settings":e.globalSettings,onEditSite:t[6]||(t[6]=function(e){return o.isSiteBeingEdited=!0}),onCancelEditSite:t[7]||(t[7]=function(t){return e.afterCancelEdit(t)}),onDelete:t[8]||(t[8]=function(t){return e.afterDelete(t)}),onSave:function(t){return e.afterSave(t.site,t.settingValues,a,t.isNew)}},null,8,["site","timezone-support-enabled","utc-time","global-settings","onSave"])])})),128))]),Object(r["createElementVNode"])("div",K,[Object(r["createVNode"])(c,{"site-is-being-edited":e.isSiteBeingEdited,"has-prev":e.hasPrev,hasNext:e.hasNext,"offset-start":e.offsetStart,"offset-end":e.offsetEnd,"total-number-of-sites":e.totalNumberOfSites,"is-loading":e.isLoading,"search-term":e.searchTerm,"is-searching":!!e.activeSearchTerm,"onUpdate:searchTerm":t[9]||(t[9]=function(t){return e.searchTerm=t}),onAdd:t[10]||(t[10]=function(t){return e.addNewEntity()}),onSearch:t[11]||(t[11]=function(t){return e.searchSites(t)}),onPrev:t[12]||(t[12]=function(t){return e.previousPage()}),onNext:t[13]||(t[13]=function(t){return e.nextPage()})},null,8,["site-is-being-edited","has-prev","hasNext","offset-start","offset-end","total-number-of-sites","is-loading","search-term","is-searching"])])],512)}var Q={class:"sitesButtonBar clearfix"},$={class:"search"},Y=["value","placeholder","disabled"],X=["title"],J={class:"paging"},Z=["disabled"],ee={style:{cursor:"pointer"}},te={class:"counter"},ne=["disabled"],ae={style:{cursor:"pointer"},class:"pointer"};function ie(e,t,n,a,i,l){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Q,[Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:Object(r["normalizeClass"])(["btn addSite",{disabled:e.siteIsBeingEdited}]),onClick:t[0]||(t[0]=function(t){return e.addNewEntity()}),tabindex:"1"},Object(r["toDisplayString"])(e.availableTypes.length>1?e.translate("SitesManager_AddMeasurable"):e.translate("SitesManager_AddSite")),3),[[r["vShow"],e.hasSuperUserAccess&&e.availableTypes]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",$,[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"])("img",{onClick:t[2]||(t[2]=function(t){return e.searchSite()}),title:e.translate("General_ClickToSearch"),class:"search_ico",src:"plugins/Morpheus/images/search_ico.png"},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"},ue={class:"col m3"},de={class:"title"},be={class:"title"},me=["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},xe={class:"title"},Te={key:2},Me={class:"title"},Ce={class:"col m1 text-right"},we=["title"],De=Object(r["createElementVNode"])("span",{class:"icon-edit"},null,-1),_e=[De],Ge=["title"],ke=Object(r["createElementVNode"])("span",{class:"icon-delete"},null,-1),Ae=[ke],Pe={key:1},Le={class:"form-group row"},Ue={class:"col s12 m6 input-field"},Be=["placeholder"],ze=Object(r["createElementVNode"])("div",{class:"col s12 m6"},null,-1),Ie={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=["value"],qe={class:"ui-confirm"},Qe=["value"],$e=["value"];function Ye(e,t,n,a,i,l){var o,s,c,u=this,d=Object(r["resolveComponent"])("ActivityIndicator"),b=Object(r["resolveComponent"])("GroupedSettings"),m=Object(r["resolveComponent"])("Field"),h=Object(r["resolveComponent"])("MatomoDialog");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",ue,[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",de,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",be,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,me)],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",xe,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",Te,[Object(r["createElementVNode"])("span",Me,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",Ce,[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")},_e,8,we)]),Object(r["createElementVNode"])("li",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("button",{class:"table-action",onClick:t[1]||(t[1]=function(e){return u.showRemoveDialog=!0}),title:e.translate("General_Delete")},Ae,8,Ge),[[r["vShow"],e.theSite.idsite]])])])])])),e.editMode?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Pe,[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)]),ze]),Object(r["createVNode"])(d,{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"])(b,{"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"])(m,{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"])(m,{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",Ie,[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",{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",onClick:t[6]||(t[6]=function(t){return e.cancelEditSite(e.site)})},Object(r["toDisplayString"])(e.translate("General_Cancel","","")),1)])])):Object(r["createCommentVNode"])("",!0)]),Object(r["createVNode"])(h,{modelValue:e.showRemoveDialog,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.showRemoveDialog=t}),onYes:t[8]||(t[8]=function(t){return e.deleteSite()})},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("div",qe,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.removeDialogTitle),1),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("SitesManager_DeleteSiteExplanation")),1),Object(r["createElementVNode"])("input",{type:"button",value:e.translate("General_Yes"),role:"yes"},null,8,Qe),Object(r["createElementVNode"])("input",{type:"button",value:e.translate("General_No"),role:"no"},null,8,$e)])]})),_:1},8,["modelValue"])],10,oe)}var Xe=n("a5a2");function Je(e,t){return at(e)||nt(e,t)||et(e,t)||Ze()}function Ze(){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 et(e,t){if(e){if("string"===typeof e)return tt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tt(e,t):void 0}}function tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function nt(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,i,r=[],l=!0,o=!1;try{for(n=n.call(e);!(l=(a=n.next()).done);l=!0)if(r.push(a.value),t&&r.length===t)break}catch(s){o=!0,i=s}finally{try{l||null==n["return"]||n["return"]()}finally{if(o)throw i}}return r}}function at(e){if(Array.isArray(e))return e}var it=Object(r["computed"])((function(){return _.timezones.value.map((function(e){var t=e.group,n=e.label,a=e.code;return{group:t,key:n,value:a}}))}));function rt(e){return"undefined"===typeof e.idsite}var lt=Object(r["defineComponent"])({props:{site:{type:Object,required:!0},timezoneSupportEnabled:{type:Boolean},utcTime:{type:Date,required:!0},globalSettings:{type:Object,required:!0}},data:function(){return{isLoading:!1,editMode:!1,theSite:Object.assign({},this.site),measurableSettings:[],settingValues:{},showRemoveDialog:!1}},components:{MatomoDialog:l["MatomoDialog"],Field:Xe["Field"],GroupedSettings:Xe["GroupedSettings"],ActivityIndicator:l["ActivityIndicator"]},emits:["delete","editSite","cancelEditSite","save"],created:function(){O.init(),_.init(),h.init(),this.onSiteChanged()},watch:{site:function(){this.onSiteChanged()},measurableSettings:function(e){if(e.length){var t={};e.forEach((function(e){e.settings.forEach((function(n){t["".concat(e.pluginName,".").concat(n.name)]=n.value}))})),this.settingValues=t}}},methods:{onSiteChanged:function(){var e=this.site;this.theSite=Object.assign({},e);var t=rt(e);if(t){var n=this.globalSettings;this.theSite.timezone=n.defaultTimezone,this.theSite.currency=n.defaultCurrency}var a=h.getEditSiteIdParameter();(t||a&&"".concat(e.idsite)===a)&&this.editSite()},editSite:function(){var e=this;if(this.editMode=!0,this.$emit("editSite",{idSite:this.theSite.idsite}),this.measurableSettings=[],rt(this.theSite)){if(!this.currentType)return;this.measurableSettings=this.currentType.settings||[]}else this.isLoading=!0,l["AjaxHelper"].fetch({method:"SitesManager.getSiteSettings",idSite:this.theSite.idsite}).then((function(t){e.measurableSettings=t})).finally((function(){e.isLoading=!1}))},saveSite:function(){var e=this,t={siteName:this.theSite.name,timezone:this.theSite.timezone,currency:this.theSite.currency,type:this.theSite.type,settingValues:{}},n=rt(this.theSite),a="SitesManager.addSite";n||(a="SitesManager.updateSite",t.idSite=this.theSite.idsite),Object.entries(this.settingValues).forEach((function(e){var n=Je(e,2),a=n[0],i=n[1],r=a.split("."),l=Je(r,2),o=l[0],s=l[1],c=t.settingValues;c[o]||(c[o]=[]);var u=i;!1===i?u="0":!0===i?u="1":Array.isArray(i)&&(u=i.filter((function(e){return!!e}))),c[o].push({name:s,value:u})})),l["AjaxHelper"].post({method:a},t).then((function(a){e.editMode=!1,!e.theSite.idsite&&a&&a.value&&(e.theSite.idsite="".concat(a.value));var i=_.timezones.value.find((function(t){return t.code===e.theSite.timezone}));e.theSite.timezone_name=(null===i||void 0===i?void 0:i.label)||e.theSite.timezone,e.theSite.currency&&(e.theSite.currency_name=O.currencies.value[e.theSite.currency]);var r=l["NotificationsStore"].show({message:n?Object(l["translate"])("SitesManager_WebsiteCreated"):Object(l["translate"])("SitesManager_WebsiteUpdated"),context:"success",id:"websitecreated",type:"transient"});l["NotificationsStore"].scrollToNotification(r),h.removeEditSiteIdParameterFromHash(),e.$emit("save",{site:e.theSite,settingValues:t.settingValues,isNew:n})}))},cancelEditSite:function(e){this.editMode=!1,h.removeEditSiteIdParameterFromHash(),this.$emit("cancelEditSite",{site:e,element:this.$refs.root})},deleteSite:function(){var e=this;l["AjaxHelper"].fetch({idSite:this.theSite.idsite,module:"API",format:"json",method:"SitesManager.deleteSite"}).then((function(){e.$emit("delete",e.theSite)}))}},computed:{availableTypes:function(){return h.types.value},setupUrl:function(){var e=this.theSite,t="",n="";return this.isInternalSetupUrl&&(t=l["MatomoUrl"].stringify({idSite:e.idsite,period:l["MatomoUrl"].parsed.value.period,date:l["MatomoUrl"].parsed.value.date,updated:"false"}),n=-1===this.howToSetupUrl.indexOf("?")?"?":"&"),"".concat(this.howToSetupUrl).concat(n).concat(t)},utcTimeIs: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()),r="".concat(Object(l["format"])(this.utcTime)," ").concat(n,":").concat(a,":").concat(i);return Object(l["translate"])("SitesManager_UTCTimeIs",r)},timezones:function(){return it.value},currencies:function(){return O.currencies.value},currentType:function(){var e=this.site,t=h.typesById.value[e.type];return t||{name:e.type}},howToSetupUrl:function(){var e=this.currentType;if(e)return e.howToSetupUrl},isInternalSetupUrl:function(){var e=this.howToSetupUrl;return!!e&&"?"==="".concat(e).substring(0,1)},removeDialogTitle:function(){return Object(l["translate"])("SitesManager_DeleteConfirm",'"'.concat(this.theSite.name,'" (idSite = ').concat(this.theSite.idsite,")"))}}});lt.render=Ye;var ot=lt;function st(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ct(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 ut(e,t,n){return t&&ct(e.prototype,t),n&&ct(e,n),e}function dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */var D=function(){function e(){var t=this;T(this,e),w(this,"privateState",Object(r["reactive"])({isLoading:!1,timezones:[],timezoneSupportEnabled:!1})),w(this,"state",Object(r["computed"])((function(){return Object(r["readonly"])(t.privateState)}))),w(this,"timezones",Object(r["computed"])((function(){return t.state.value.timezones}))),w(this,"timezoneSupportEnabled",Object(r["computed"])((function(){return t.state.value.timezoneSupportEnabled}))),w(this,"isLoading",Object(r["computed"])((function(){return t.state.value.isLoading}))),w(this,"initializePromise",null)}return C(e,[{key:"init",value:function(){var e=this;return this.initializePromise||(this.privateState.isLoading=!0,this.initializePromise=Promise.all([this.checkTimezoneSupportEnabled(),this.fetchTimezones()]).finally((function(){e.privateState.isLoading=!1}))),this.initializePromise}},{key:"fetchTimezones",value:function(){var e=this;return l["AjaxHelper"].fetch({method:"SitesManager.getTimezonesList"}).then((function(t){var n=[];Object.entries(t).forEach((function(e){var t=v(e,2),a=t[0],i=t[1];Object.entries(i).forEach((function(e){var t=v(e,2),i=t[0],r=t[1];n.push({group:a,label:i,code:r})}))})),e.privateState.timezones=n}))}},{key:"checkTimezoneSupportEnabled",value:function(){var e=this;return l["AjaxHelper"].fetch({method:"SitesManager.isTimezoneSupportEnabled"}).then((function(t){e.privateState.timezoneSupportEnabled=t.value}))}}]),e}(),_=new D,P={class:"SitesManager",ref:"root"},k={class:"sites-manager-header"},G=["innerHTML"],A=Object(r["createElementVNode"])("br",null,null,-1),L=["innerHTML"],U={class:"loadingPiwik"},B=["alt"],z={class:"ui-confirm"},I={class:"center"},H=["title","onClick"],F={class:"ui-button-text"},R={class:"sitesManagerList"},W={key:0},K={class:"bottomButtonBar"};function q(e,t,n,a,i,l){var o=this,s=Object(r["resolveComponent"])("EnrichedHeadline"),c=Object(r["resolveComponent"])("ButtonBar"),u=Object(r["resolveComponent"])("MatomoDialog"),d=Object(r["resolveComponent"])("SiteFields"),b=Object(r["resolveDirective"])("content-intro");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",P,[Object(r["createElementVNode"])("div",k,[Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("h2",null,[Object(r["createVNode"])(s,{"help-url":"https://matomo.org/docs/manage-websites/","feature-name":e.translate("SitesManager_WebsitesManagement")},{default:Object(r["withCtx"])((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.headlineText),1)]})),_:1},8,["help-url","feature-name"])],512),[[r["vShow"],e.availableTypes.length]]),Object(r["createElementVNode"])("p",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_MainDescription"))+" ",1),Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.mainDescription)},null,8,G),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",null,[A,Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.superUserAccessMessage)},null,8,L)],512),[[r["vShow"],e.hasSuperUserAccess]])])],512),[[b]])]),Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("div",{class:Object(r["normalizeClass"])({hide_only:!e.isLoading})},[Object(r["createElementVNode"])("div",U,[Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,B),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])],2)]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(c,{"site-is-being-edited":e.isSiteBeingEdited,"has-prev":e.hasPrev,hasNext:e.hasNext,"offset-start":e.offsetStart,"offset-end":e.offsetEnd,"total-number-of-sites":e.totalNumberOfSites,"is-loading":e.isLoading,"search-term":e.searchTerm,"is-searching":!!e.activeSearchTerm,"onUpdate:searchTerm":t[0]||(t[0]=function(t){return e.searchTerm=t}),onAdd:t[1]||(t[1]=function(t){return e.addNewEntity()}),onSearch:t[2]||(t[2]=function(t){return e.searchSites(t)}),onPrev:t[3]||(t[3]=function(t){return e.previousPage()}),onNext:t[4]||(t[4]=function(t){return e.nextPage()})},null,8,["site-is-being-edited","has-prev","hasNext","offset-start","offset-end","total-number-of-sites","is-loading","search-term","is-searching"])]),Object(r["createVNode"])(u,{modelValue:e.showAddSiteDialog,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.showAddSiteDialog=t})},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("div",z,[Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("SitesManager_ChooseMeasurableTypeHeadline")),1),Object(r["createElementVNode"])("div",I,[Object(r["createElementVNode"])("p",null,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.availableTypes,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("button",{type:"button",key:t.id,title:t.description,class:"modal-close btn",style:{"margin-left":"20px"},onClick:function(n){e.addSite(t.id)},"aria-disabled":"false"},[Object(r["createElementVNode"])("span",F,Object(r["toDisplayString"])(t.name),1)],8,H)})),128))])])])])]})),_:1},8,["modelValue"]),Object(r["createElementVNode"])("div",R,[e.activeSearchTerm&&0===e.sites.length&&!e.isLoading?(Object(r["openBlock"])(),Object(r["createElementBlock"])("p",W,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_NotFound"))+" ",1),Object(r["createElementVNode"])("strong",null,Object(r["toDisplayString"])(e.activeSearchTerm),1)])):Object(r["createCommentVNode"])("",!0),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sites,(function(n,a){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{key:n.idsite},[Object(r["createVNode"])(d,{site:n,"timezone-support-enabled":e.timezoneSupportEnabled,"utc-time":e.utcTime,"global-settings":e.globalSettings,onEditSite:t[6]||(t[6]=function(e){return o.isSiteBeingEdited=!0}),onCancelEditSite:t[7]||(t[7]=function(t){return e.afterCancelEdit(t)}),onDelete:t[8]||(t[8]=function(t){return e.afterDelete(t)}),onSave:function(t){return e.afterSave(t.site,t.settingValues,a,t.isNew)}},null,8,["site","timezone-support-enabled","utc-time","global-settings","onSave"])])})),128))]),Object(r["createElementVNode"])("div",K,[Object(r["createVNode"])(c,{"site-is-being-edited":e.isSiteBeingEdited,"has-prev":e.hasPrev,hasNext:e.hasNext,"offset-start":e.offsetStart,"offset-end":e.offsetEnd,"total-number-of-sites":e.totalNumberOfSites,"is-loading":e.isLoading,"search-term":e.searchTerm,"is-searching":!!e.activeSearchTerm,"onUpdate:searchTerm":t[9]||(t[9]=function(t){return e.searchTerm=t}),onAdd:t[10]||(t[10]=function(t){return e.addNewEntity()}),onSearch:t[11]||(t[11]=function(t){return e.searchSites(t)}),onPrev:t[12]||(t[12]=function(t){return e.previousPage()}),onNext:t[13]||(t[13]=function(t){return e.nextPage()})},null,8,["site-is-being-edited","has-prev","hasNext","offset-start","offset-end","total-number-of-sites","is-loading","search-term","is-searching"])])],512)}var Q={class:"sitesButtonBar clearfix"},$={class:"search"},Y=["value","placeholder","disabled"],X=["title"],J={class:"paging"},Z=["disabled"],ee={style:{cursor:"pointer"}},te={class:"counter"},ne=["disabled"],ae={style:{cursor:"pointer"},class:"pointer"};function ie(e,t,n,a,i,l){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Q,[Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:Object(r["normalizeClass"])(["btn addSite",{disabled:e.siteIsBeingEdited}]),onClick:t[0]||(t[0]=function(t){return e.addNewEntity()}),tabindex:"1"},Object(r["toDisplayString"])(e.availableTypes.length>1?e.translate("SitesManager_AddMeasurable"):e.translate("SitesManager_AddSite")),3),[[r["vShow"],e.hasSuperUserAccess&&e.availableTypes]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",$,[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"])("img",{onClick:t[2]||(t[2]=function(t){return e.searchSite()}),title:e.translate("General_ClickToSearch"),class:"search_ico",src:"plugins/Morpheus/images/search_ico.png"},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"},ue={class:"col m3"},de={class:"title"},be={class:"title"},me=["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},xe={class:"title"},Te={key:2},Me={class:"title"},Ce={class:"col m1 text-right"},we=["title"],De=Object(r["createElementVNode"])("span",{class:"icon-edit"},null,-1),_e=[De],Pe=["title"],ke=Object(r["createElementVNode"])("span",{class:"icon-delete"},null,-1),Ge=[ke],Ae={key:1},Le={class:"form-group row"},Ue={class:"col s12 m6 input-field"},Be=["placeholder"],ze=Object(r["createElementVNode"])("div",{class:"col s12 m6"},null,-1),Ie={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=["value"];function qe(e,t,n,a,i,l){var o,s,c,u=this,d=Object(r["resolveComponent"])("ActivityIndicator"),b=Object(r["resolveComponent"])("GroupedSettings"),m=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",ue,[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",de,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",be,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,me)],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",xe,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",Te,[Object(r["createElementVNode"])("span",Me,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",Ce,[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")},_e,8,we)]),Object(r["createElementVNode"])("li",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("button",{class:"table-action",onClick:t[1]||(t[1]=function(e){return u.showRemoveDialog=!0}),title:e.translate("General_Delete")},Ge,8,Pe),[[r["vShow"],e.theSite.idsite]])])])])])),e.editMode?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ae,[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)]),ze]),Object(r["createVNode"])(d,{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"])(b,{"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"])(m,{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"])(m,{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",Ie,[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",{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",onClick:t[6]||(t[6]=function(t){return e.cancelEditSite(e.site)})},Object(r["toDisplayString"])(e.translate("General_Cancel","","")),1)])])):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),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])],10,oe)}var Qe=n("a5a2");function $e(e,t){return et(e)||Ze(e,t)||Xe(e,t)||Ye()}function Ye(){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 Xe(e,t){if(e){if("string"===typeof e)return Je(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)?Je(e,t):void 0}}function Je(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function Ze(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,i,r=[],l=!0,o=!1;try{for(n=n.call(e);!(l=(a=n.next()).done);l=!0)if(r.push(a.value),t&&r.length===t)break}catch(s){o=!0,i=s}finally{try{l||null==n["return"]||n["return"]()}finally{if(o)throw i}}return r}}function et(e){if(Array.isArray(e))return e}var tt=Object(r["computed"])((function(){return _.timezones.value.map((function(e){var t=e.group,n=e.label,a=e.code;return{group:t,key:n,value:a}}))}));function nt(e){return"undefined"===typeof e.idsite}var at=Object(r["defineComponent"])({props:{site:{type:Object,required:!0},timezoneSupportEnabled:{type:Boolean},utcTime:{type:Date,required:!0},globalSettings:{type:Object,required:!0}},data:function(){return{isLoading:!1,editMode:!1,theSite:Object.assign({},this.site),measurableSettings:[],settingValues:{},showRemoveDialog:!1}},components:{PasswordConfirmation:Qe["PasswordConfirmation"],Field:Qe["Field"],GroupedSettings:Qe["GroupedSettings"],ActivityIndicator:l["ActivityIndicator"]},emits:["delete","editSite","cancelEditSite","save"],created:function(){O.init(),_.init(),h.init(),this.onSiteChanged()},watch:{site:function(){this.onSiteChanged()},measurableSettings:function(e){if(e.length){var t={};e.forEach((function(e){e.settings.forEach((function(n){t["".concat(e.pluginName,".").concat(n.name)]=n.value}))})),this.settingValues=t}}},methods:{onSiteChanged:function(){var e=this.site;this.theSite=Object.assign({},e);var t=nt(e);if(t){var n=this.globalSettings;this.theSite.timezone=n.defaultTimezone,this.theSite.currency=n.defaultCurrency}var a=h.getEditSiteIdParameter();(t||a&&"".concat(e.idsite)===a)&&this.editSite()},editSite:function(){var e=this;if(this.editMode=!0,this.$emit("editSite",{idSite:this.theSite.idsite}),this.measurableSettings=[],nt(this.theSite)){if(!this.currentType)return;this.measurableSettings=this.currentType.settings||[]}else this.isLoading=!0,l["AjaxHelper"].fetch({method:"SitesManager.getSiteSettings",idSite:this.theSite.idsite}).then((function(t){e.measurableSettings=t})).finally((function(){e.isLoading=!1}))},saveSite:function(){var e=this,t={siteName:this.theSite.name,timezone:this.theSite.timezone,currency:this.theSite.currency,type:this.theSite.type,settingValues:{}},n=nt(this.theSite),a="SitesManager.addSite";n||(a="SitesManager.updateSite",t.idSite=this.theSite.idsite),Object.entries(this.settingValues).forEach((function(e){var n=$e(e,2),a=n[0],i=n[1],r=a.split("."),l=$e(r,2),o=l[0],s=l[1],c=t.settingValues;c[o]||(c[o]=[]);var u=i;!1===i?u="0":!0===i?u="1":Array.isArray(i)&&(u=i.filter((function(e){return!!e}))),c[o].push({name:s,value:u})})),l["AjaxHelper"].post({method:a},t).then((function(a){e.editMode=!1,!e.theSite.idsite&&a&&a.value&&(e.theSite.idsite="".concat(a.value));var i=_.timezones.value.find((function(t){return t.code===e.theSite.timezone}));e.theSite.timezone_name=(null===i||void 0===i?void 0:i.label)||e.theSite.timezone,e.theSite.currency&&(e.theSite.currency_name=O.currencies.value[e.theSite.currency]);var r=l["NotificationsStore"].show({message:n?Object(l["translate"])("SitesManager_WebsiteCreated"):Object(l["translate"])("SitesManager_WebsiteUpdated"),context:"success",id:"websitecreated",type:"transient"});l["NotificationsStore"].scrollToNotification(r),h.removeEditSiteIdParameterFromHash(),e.$emit("save",{site:e.theSite,settingValues:t.settingValues,isNew:n})}))},cancelEditSite:function(e){this.editMode=!1,h.removeEditSiteIdParameterFromHash(),this.$emit("cancelEditSite",{site:e,element:this.$refs.root})},deleteSite:function(e){var t=this;l["AjaxHelper"].post({idSite:this.theSite.idsite,module:"API",format:"json",method:"SitesManager.deleteSite"},{passwordConfirmation:e}).then((function(){t.$emit("delete",t.theSite)}))}},computed:{availableTypes:function(){return h.types.value},setupUrl:function(){var e=this.theSite,t="",n="";return this.isInternalSetupUrl&&(t=l["MatomoUrl"].stringify({idSite:e.idsite,period:l["MatomoUrl"].parsed.value.period,date:l["MatomoUrl"].parsed.value.date,updated:"false"}),n=-1===this.howToSetupUrl.indexOf("?")?"?":"&"),"".concat(this.howToSetupUrl).concat(n).concat(t)},utcTimeIs: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()),r="".concat(Object(l["format"])(this.utcTime)," ").concat(n,":").concat(a,":").concat(i);return Object(l["translate"])("SitesManager_UTCTimeIs",r)},timezones:function(){return tt.value},currencies:function(){return O.currencies.value},currentType:function(){var e=this.site,t=h.typesById.value[e.type];return t||{name:e.type}},howToSetupUrl:function(){var e=this.currentType;if(e)return e.howToSetupUrl},isInternalSetupUrl:function(){var e=this.howToSetupUrl;return!!e&&"?"==="".concat(e).substring(0,1)},removeDialogTitle:function(){return Object(l["translate"])("SitesManager_DeleteConfirm",'"'.concat(this.theSite.name,'" (idSite = ').concat(this.theSite.idsite,")"))}}});at.render=qe;var it=at;function rt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lt(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 ot(e,t,n){return t&<(e.prototype,t),n&<(e,n),e}function st(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 bt=function(){function e(){var t=this;st(this,e),dt(this,"privateState",Object(r["reactive"])({isLoading:!1,globalSettings:{keepURLFragmentsGlobal:!1,defaultCurrency:"",defaultTimezone:"",excludedIpsGlobal:"",excludedQueryParametersGlobal:"",excludedUserAgentsGlobal:"",excludedReferrersGlobal:"",searchKeywordParametersGlobal:"",searchCategoryParametersGlobal:""}})),dt(this,"isLoading",Object(r["computed"])((function(){return Object(r["readonly"])(t.privateState).isLoading}))),dt(this,"globalSettings",Object(r["computed"])((function(){return Object(r["readonly"])(t.privateState).globalSettings})))}return ut(e,[{key:"init",value:function(){return this.fetchGlobalSettings()}},{key:"saveGlobalSettings",value:function(e){var t=this;return this.privateState.isLoading=!0,l["AjaxHelper"].post({module:"SitesManager",format:"json",action:"setGlobalSettings"},e,{withTokenInUrl:!0}).finally((function(){t.privateState.isLoading=!1}))}},{key:"fetchGlobalSettings",value:function(){var e=this;this.privateState.isLoading=!0,l["AjaxHelper"].fetch({module:"SitesManager",action:"getGlobalSettings"}).then((function(t){e.privateState.globalSettings=Object.assign(Object.assign({},t),{},{excludedIpsGlobal:t.excludedIpsGlobal||"",excludedQueryParametersGlobal:t.excludedQueryParametersGlobal||"",excludedUserAgentsGlobal:t.excludedUserAgentsGlobal||"",excludedReferrersGlobal:t.excludedReferrersGlobal||"",searchKeywordParametersGlobal:t.searchKeywordParametersGlobal||"",searchCategoryParametersGlobal:t.searchCategoryParametersGlobal||""})})).finally((function(){e.privateState.isLoading=!1}))}}]),e}(),mt=new bt,ht=Object(r["defineComponent"])({props:{dummy:String},components:{MatomoDialog:l["MatomoDialog"],ButtonBar:le,SiteFields:ot,EnrichedHeadline:l["EnrichedHeadline"]},directives:{ContentIntro:l["ContentIntro"]},data:function(){var e=new Date,t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds());return{pageSize:10,currentPage:0,showAddSiteDialog:!1,searchTerm:"",activeSearchTerm:"",fetchedSites:[],isLoadingInitialEntities:!1,utcTime:t,totalNumberOfSites:null,isSiteBeingEdited:!1,fetchLimitedSitesAbortController:null}},created:function(){var e=this;_.init(),h.init(),mt.init(),this.isLoadingInitialEntities=!0,Promise.all([h.fetchAvailableTypes(),this.fetchLimitedSitesWithAdminAccess(),this.getTotalNumberOfSites()]).then((function(){e.triggerAddSiteIfRequested()})).finally((function(){e.isLoadingInitialEntities=!1})),Object(r["watch"])((function(){return l["MatomoUrl"].hashQuery.value}),(function(){e.checkGlobalSettingsHash()}))},computed:{sites:function(){var e=this.fetchedSites.filter((function(e){return!e.idsite})).length;return this.fetchedSites.slice(0,this.pageSize+e)},isLoading:function(){return!!this.fetchLimitedSitesAbortController||this.isLoadingInitialEntities||null===this.totalNumberOfSites||h.isLoading.value||_.isLoading.value||mt.isLoading.value},availableTypes:function(){return h.types.value},timezoneSupportEnabled:function(){return _.timezoneSupportEnabled.value},globalSettings:function(){return mt.globalSettings.value},headlineText:function(){return Object(l["translate"])("SitesManager_XManagement",this.availableTypes.length>1?Object(l["translate"])("General_Measurables"):Object(l["translate"])("SitesManager_Sites"))},mainDescription:function(){return Object(l["translate"])("SitesManager_YouCurrentlyHaveAccessToNWebsites","<strong>".concat(this.totalNumberOfSites,"</strong>"))},hasSuperUserAccess:function(){return l["Matomo"].hasSuperUserAccess},superUserAccessMessage:function(){return Object(l["translate"])("SitesManager_SuperUserAccessCan","<a href='#globalSettings'>","</a>")},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}}});ht.render=q;var pt=ht,gt={class:"SitesManager"},ft=Object(r["createElementVNode"])("a",{name:"globalSettings",id:"globalSettings"},null,-1),St={id:"excludedIpsGlobalHelp",class:"inline-help-node"},jt=Object(r["createElementVNode"])("br",null,null,-1),Ot=Object(r["createElementVNode"])("br",null,null,-1),vt=["innerHTML"],yt={id:"excludedQueryParametersGlobalHelp",class:"inline-help-node"},Et=Object(r["createElementVNode"])("br",null,null,-1),Nt=Object(r["createElementVNode"])("br",null,null,-1),Vt={id:"excludedUserAgentsGlobalHelp",class:"inline-help-node"},xt=Object(r["createElementVNode"])("br",null,null,-1),Tt=Object(r["createElementVNode"])("br",null,null,-1),Mt={id:"excludedReferrersGlobalHelp",class:"inline-help-node"},Ct=Object(r["createElementVNode"])("br",null,null,-1),wt=Object(r["createElementVNode"])("br",null,null,-1),Dt=Object(r["createElementVNode"])("br",null,null,-1),_t=Object(r["createElementVNode"])("br",null,null,-1),Gt=Object(r["createElementVNode"])("br",null,null,-1),kt={id:"timezoneHelp",class:"inline-help-node"},At={key:0},Pt=Object(r["createElementVNode"])("br",null,null,-1),Lt=Object(r["createElementVNode"])("br",null,null,-1),Ut={id:"keepURLFragmentsHelp",class:"inline-help-node"},Bt=["innerHTML"],zt={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",gt,[Object(r["withDirectives"])(Object(r["createVNode"])(c,{"content-title":e.translate("SitesManager_GlobalWebsitesSettings")},{default:Object(r["withCtx"])((function(){return[ft,Object(r["createElementVNode"])("div",St,[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),jt,Ot,Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.yourCurrentIpAddressIs)},null,8,vt)])]),Object(r["createElementVNode"])("div",yt,[Object(r["createElementVNode"])("div",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_ListOfQueryParametersToExclude","/^sess.*|.*[dD]ate$/"))+" ",1),Et,Nt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_PiwikWillAutomaticallyExcludeCommonSessionParameters","phpsessid, sessionid, ...")),1)])]),Object(r["createElementVNode"])("div",Vt,[Object(r["createElementVNode"])("div",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp1"))+" ",1),xt,Tt,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),Ct,wt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpDetails"))+" ",1),Dt,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),_t,Gt,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",kt,[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),Lt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward")),1)])]),Object(r["createElementVNode"])("div",Ut,[Object(r["createElementVNode"])("div",{innerHTML:e.$sanitize(e.keepUrlFragmentHelp)},null,8,Bt),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",zt,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 Ht=Object(r["defineComponent"])({props:{dummy:String},components:{ContentBlock:l["ContentBlock"],Field:Xe["Field"],SaveButton:Xe["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(),_.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||_.isLoading.value||O.isLoading.value},timezones:function(){return _.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","<i>".concat(this.currentIpAddress,"</i>"))},timezoneSupportEnabled:function(){return _.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","<em>#</em>","<em>example.org/index.html#first_section</em>","<em>example.org/index.html</em>")},searchCategoryParamsInlineHelp:function(){var e=[Object(l["translate"])("Goals_Optional"),Object(l["translate"])("SitesManager_SearchCategoryDesc"),Object(l["translate"])("SitesManager_SearchCategoryParametersDesc")];return e.join(" ")}}});Ht.render=It;var Ft=Ht,Rt=Object(r["createElementVNode"])("p",null," ",-1),Wt=["innerHTML"],Kt=Object(r["createElementVNode"])("hr",null,null,-1),qt=["href"],Qt=Object(r["createElementVNode"])("br",null,null,-1),$t=["href"];function Yt(e,t,n,a,i,l){var o=Object(r["resolveComponent"])("WidgetLoader"),s=Object(r["resolveComponent"])("VueEntryContainer"),c=Object(r["resolveComponent"])("ContentBlock");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",null,[Object(r["createVNode"])(c,{"content-title":"".concat(e.translate("SitesManager_SiteWithoutDataTitle")," 🚀")},{default:Object(r["withCtx"])((function(){return[Rt,Object(r["createElementVNode"])("p",{innerHTML:e.$sanitize(e.siteWithoutDataDesc)},null,8,Wt),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataMessageDisappears")),1),Object(r["createElementVNode"])("h3",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataChoosePreferredWay")),1),Object(r["createVNode"])(o,{"widget-params":{module:"SitesManager",action:"siteWithoutDataTabs"},"loading-message":"".concat(e.translate("SitesManager_DetectingYourSite"),"...")},null,8,["loading-message"]),Kt,Object(r["createElementVNode"])("a",{class:"btn",id:"emailTrackingCodeBtn",href:e.emailInstructionsLink},Object(r["toDisplayString"])(e.translate("SitesManager_EmailInstructionsButton")),9,qt),Object(r["createVNode"])(s,{html:e.afterIntroEventContent},null,8,["html"]),Qt,Object(r["createElementVNode"])("a",{href:e.ignoreSitesWithoutDataLink,class:"btn ignoreSitesWithoutData"},Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataIgnoreMessage")),9,$t)]})),_:1},8,["content-title"]),Object(r["createVNode"])(s,{html:e.afterTrackingHelpEventContent},null,8,["html"])])}var Xt=Object(r["defineComponent"])({props:{emailBody:{type:String,required:!0},afterIntroEventContent:String,afterTrackingHelpEventContent:String},components:{ContentBlock:l["ContentBlock"],WidgetLoader:l["WidgetLoader"],VueEntryContainer:l["VueEntryContainer"]},computed:{siteWithoutDataDesc:function(){return Object(l["translate"])("SitesManager_SiteWithoutDataDescription",'<a href="'.concat(this.emailInstructionsLink,'">'),"</a>")},emailInstructionsLink:function(){return"mailto:?".concat(l["MatomoUrl"].stringify({subject:Object(l["translate"])("SitesManager_EmailInstructionsSubject"),body:this.emailBody}))},ignoreSitesWithoutDataLink:function(){return"?".concat(l["MatomoUrl"].stringify(Object.assign(Object.assign({},l["MatomoUrl"].urlParsed.value),{},{module:"SitesManager",action:"ignoreNoDataMessage"})))}}});Xt.render=Yt;var Jt=Xt; + */var ct=function(){function e(){var t=this;rt(this,e),st(this,"privateState",Object(r["reactive"])({isLoading:!1,globalSettings:{keepURLFragmentsGlobal:!1,defaultCurrency:"",defaultTimezone:"",excludedIpsGlobal:"",excludedQueryParametersGlobal:"",excludedUserAgentsGlobal:"",excludedReferrersGlobal:"",searchKeywordParametersGlobal:"",searchCategoryParametersGlobal:""}})),st(this,"isLoading",Object(r["computed"])((function(){return Object(r["readonly"])(t.privateState).isLoading}))),st(this,"globalSettings",Object(r["computed"])((function(){return Object(r["readonly"])(t.privateState).globalSettings})))}return ot(e,[{key:"init",value:function(){return this.fetchGlobalSettings()}},{key:"saveGlobalSettings",value:function(e){var t=this;return this.privateState.isLoading=!0,l["AjaxHelper"].post({module:"SitesManager",format:"json",action:"setGlobalSettings"},e,{withTokenInUrl:!0}).finally((function(){t.privateState.isLoading=!1}))}},{key:"fetchGlobalSettings",value:function(){var e=this;this.privateState.isLoading=!0,l["AjaxHelper"].fetch({module:"SitesManager",action:"getGlobalSettings"}).then((function(t){e.privateState.globalSettings=Object.assign(Object.assign({},t),{},{excludedIpsGlobal:t.excludedIpsGlobal||"",excludedQueryParametersGlobal:t.excludedQueryParametersGlobal||"",excludedUserAgentsGlobal:t.excludedUserAgentsGlobal||"",excludedReferrersGlobal:t.excludedReferrersGlobal||"",searchKeywordParametersGlobal:t.searchKeywordParametersGlobal||"",searchCategoryParametersGlobal:t.searchCategoryParametersGlobal||""})})).finally((function(){e.privateState.isLoading=!1}))}}]),e}(),ut=new ct,dt=Object(r["defineComponent"])({props:{dummy:String},components:{MatomoDialog:l["MatomoDialog"],ButtonBar:le,SiteFields:it,EnrichedHeadline:l["EnrichedHeadline"]},directives:{ContentIntro:l["ContentIntro"]},data:function(){var e=new Date,t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds());return{pageSize:10,currentPage:0,showAddSiteDialog:!1,searchTerm:"",activeSearchTerm:"",fetchedSites:[],isLoadingInitialEntities:!1,utcTime:t,totalNumberOfSites:null,isSiteBeingEdited:!1,fetchLimitedSitesAbortController:null}},created:function(){var e=this;_.init(),h.init(),ut.init(),this.isLoadingInitialEntities=!0,Promise.all([h.fetchAvailableTypes(),this.fetchLimitedSitesWithAdminAccess(),this.getTotalNumberOfSites()]).then((function(){e.triggerAddSiteIfRequested()})).finally((function(){e.isLoadingInitialEntities=!1})),Object(r["watch"])((function(){return l["MatomoUrl"].hashQuery.value}),(function(){e.checkGlobalSettingsHash()}))},computed:{sites:function(){var e=this.fetchedSites.filter((function(e){return!e.idsite})).length;return this.fetchedSites.slice(0,this.pageSize+e)},isLoading:function(){return!!this.fetchLimitedSitesAbortController||this.isLoadingInitialEntities||null===this.totalNumberOfSites||h.isLoading.value||_.isLoading.value||ut.isLoading.value},availableTypes:function(){return h.types.value},timezoneSupportEnabled:function(){return _.timezoneSupportEnabled.value},globalSettings:function(){return ut.globalSettings.value},headlineText:function(){return Object(l["translate"])("SitesManager_XManagement",this.availableTypes.length>1?Object(l["translate"])("General_Measurables"):Object(l["translate"])("SitesManager_Sites"))},mainDescription:function(){return Object(l["translate"])("SitesManager_YouCurrentlyHaveAccessToNWebsites","<strong>".concat(this.totalNumberOfSites,"</strong>"))},hasSuperUserAccess:function(){return l["Matomo"].hasSuperUserAccess},superUserAccessMessage:function(){return Object(l["translate"])("SitesManager_SuperUserAccessCan","<a href='#globalSettings'>","</a>")},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}}});dt.render=q;var bt=dt,mt={class:"SitesManager"},ht=Object(r["createElementVNode"])("a",{name:"globalSettings",id:"globalSettings"},null,-1),pt={id:"excludedIpsGlobalHelp",class:"inline-help-node"},gt=Object(r["createElementVNode"])("br",null,null,-1),ft=Object(r["createElementVNode"])("br",null,null,-1),St=["innerHTML"],jt={id:"excludedQueryParametersGlobalHelp",class:"inline-help-node"},Ot=Object(r["createElementVNode"])("br",null,null,-1),vt=Object(r["createElementVNode"])("br",null,null,-1),yt={id:"excludedUserAgentsGlobalHelp",class:"inline-help-node"},Et=Object(r["createElementVNode"])("br",null,null,-1),Nt=Object(r["createElementVNode"])("br",null,null,-1),Vt={id:"excludedReferrersGlobalHelp",class:"inline-help-node"},xt=Object(r["createElementVNode"])("br",null,null,-1),Tt=Object(r["createElementVNode"])("br",null,null,-1),Mt=Object(r["createElementVNode"])("br",null,null,-1),Ct=Object(r["createElementVNode"])("br",null,null,-1),wt=Object(r["createElementVNode"])("br",null,null,-1),Dt={id:"timezoneHelp",class:"inline-help-node"},_t={key:0},Pt=Object(r["createElementVNode"])("br",null,null,-1),kt=Object(r["createElementVNode"])("br",null,null,-1),Gt={id:"keepURLFragmentsHelp",class:"inline-help-node"},At=["innerHTML"],Lt={class:"alert alert-info"};function Ut(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",mt,[Object(r["withDirectives"])(Object(r["createVNode"])(c,{"content-title":e.translate("SitesManager_GlobalWebsitesSettings")},{default:Object(r["withCtx"])((function(){return[ht,Object(r["createElementVNode"])("div",pt,[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),gt,ft,Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.yourCurrentIpAddressIs)},null,8,St)])]),Object(r["createElementVNode"])("div",jt,[Object(r["createElementVNode"])("div",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_ListOfQueryParametersToExclude","/^sess.*|.*[dD]ate$/"))+" ",1),Ot,vt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_PiwikWillAutomaticallyExcludeCommonSessionParameters","phpsessid, sessionid, ...")),1)])]),Object(r["createElementVNode"])("div",yt,[Object(r["createElementVNode"])("div",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp1"))+" ",1),Et,Nt,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",Vt,[Object(r["createElementVNode"])("div",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelp"))+" ",1),xt,Tt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpDetails"))+" ",1),Mt,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,wt,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),Pt])),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_UTCTimeIs",e.utcTimeDate))+" ",1),kt,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,At),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",Lt,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 Bt=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(),_.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||_.isLoading.value||O.isLoading.value},timezones:function(){return _.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","<i>".concat(this.currentIpAddress,"</i>"))},timezoneSupportEnabled:function(){return _.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","<em>#</em>","<em>example.org/index.html#first_section</em>","<em>example.org/index.html</em>")},searchCategoryParamsInlineHelp:function(){var e=[Object(l["translate"])("Goals_Optional"),Object(l["translate"])("SitesManager_SearchCategoryDesc"),Object(l["translate"])("SitesManager_SearchCategoryParametersDesc")];return e.join(" ")}}});Bt.render=Ut;var zt=Bt,It=Object(r["createElementVNode"])("p",null," ",-1),Ht=["innerHTML"],Ft=Object(r["createElementVNode"])("hr",null,null,-1),Rt=["href"],Wt=Object(r["createElementVNode"])("br",null,null,-1),Kt=["href"];function qt(e,t,n,a,i,l){var o=Object(r["resolveComponent"])("WidgetLoader"),s=Object(r["resolveComponent"])("VueEntryContainer"),c=Object(r["resolveComponent"])("ContentBlock");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",null,[Object(r["createVNode"])(c,{"content-title":"".concat(e.translate("SitesManager_SiteWithoutDataTitle")," 🚀")},{default:Object(r["withCtx"])((function(){return[It,Object(r["createElementVNode"])("p",{innerHTML:e.$sanitize(e.siteWithoutDataDesc)},null,8,Ht),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataMessageDisappears")),1),Object(r["createElementVNode"])("h3",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataChoosePreferredWay")),1),Object(r["createVNode"])(o,{"widget-params":{module:"SitesManager",action:"siteWithoutDataTabs"},"loading-message":"".concat(e.translate("SitesManager_DetectingYourSite"),"...")},null,8,["loading-message"]),Ft,Object(r["createElementVNode"])("a",{class:"btn",id:"emailTrackingCodeBtn",href:e.emailInstructionsLink},Object(r["toDisplayString"])(e.translate("SitesManager_EmailInstructionsButton")),9,Rt),Object(r["createVNode"])(s,{html:e.afterIntroEventContent},null,8,["html"]),Wt,Object(r["createElementVNode"])("a",{href:e.ignoreSitesWithoutDataLink,class:"btn ignoreSitesWithoutData"},Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataIgnoreMessage")),9,Kt)]})),_:1},8,["content-title"]),Object(r["createVNode"])(s,{html:e.afterTrackingHelpEventContent},null,8,["html"])])}var Qt=Object(r["defineComponent"])({props:{emailBody:{type:String,required:!0},afterIntroEventContent:String,afterTrackingHelpEventContent:String},components:{ContentBlock:l["ContentBlock"],WidgetLoader:l["WidgetLoader"],VueEntryContainer:l["VueEntryContainer"]},computed:{siteWithoutDataDesc:function(){return Object(l["translate"])("SitesManager_SiteWithoutDataDescription",'<a href="'.concat(this.emailInstructionsLink,'">'),"</a>")},emailInstructionsLink:function(){return"mailto:?".concat(l["MatomoUrl"].stringify({subject:Object(l["translate"])("SitesManager_EmailInstructionsSubject"),body:this.emailBody}))},ignoreSitesWithoutDataLink:function(){return"?".concat(l["MatomoUrl"].stringify(Object.assign(Object.assign({},l["MatomoUrl"].urlParsed.value),{},{module:"SitesManager",action:"ignoreNoDataMessage"})))}}});Qt.render=qt;var $t=Qt; /*! * Matomo - free/libre analytics platform * diff --git a/plugins/SitesManager/vue/src/SiteFields/SiteFields.vue b/plugins/SitesManager/vue/src/SiteFields/SiteFields.vue index 1e744b8487..70cb864979 100644 --- a/plugins/SitesManager/vue/src/SiteFields/SiteFields.vue +++ b/plugins/SitesManager/vue/src/SiteFields/SiteFields.vue @@ -178,19 +178,14 @@ </div> </div> - <MatomoDialog + <PasswordConfirmation v-model="showRemoveDialog" - @yes="deleteSite()" + @confirmed="deleteSite" > - <div class="ui-confirm"> <h2>{{ removeDialogTitle }}</h2> - <p>{{ translate('SitesManager_DeleteSiteExplanation') }}</p> - - <input type="button" :value="translate('General_Yes')" role="yes"/> - <input type="button" :value="translate('General_No')" role="no" /> - </div> - </MatomoDialog> + <p>{{ translate('UsersManager_ConfirmWithPassword') }}</p> + </PasswordConfirmation> </div> </template> @@ -202,7 +197,6 @@ import { ActivityIndicator, format, translate, - MatomoDialog, AjaxHelper, NotificationsStore, } from 'CoreHome'; @@ -211,6 +205,7 @@ import { GroupedSettings, SettingsForSinglePlugin, Setting, + PasswordConfirmation, } from 'CorePluginsAdmin'; import TimezoneStore from '../TimezoneStore/TimezoneStore'; import CurrencyStore from '../CurrencyStore/CurrencyStore'; @@ -271,7 +266,7 @@ export default defineComponent({ }; }, components: { - MatomoDialog, + PasswordConfirmation, Field, GroupedSettings, ActivityIndicator, @@ -433,12 +428,14 @@ export default defineComponent({ this.$emit('cancelEditSite', { site, element: this.$refs.root as HTMLElement }); }, - deleteSite() { - AjaxHelper.fetch({ + deleteSite(password: string) { + AjaxHelper.post({ idSite: this.theSite.idsite, module: 'API', format: 'json', method: 'SitesManager.deleteSite', + }, { + passwordConfirmation: password, }).then(() => { this.$emit('delete', this.theSite); }); |