diff options
author | Stefan Giehl <stefan@matomo.org> | 2022-08-05 10:29:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-05 10:29:01 +0300 |
commit | ffb210bc547b7f42d77080c7ff44aa218c8a30f3 (patch) | |
tree | e5d6ec937c0caeb2922a2b4cef56bc50fecacafe /plugins/SitesManager | |
parent | c40b160f0f68546c1db0055f5ced49d286f74c7c (diff) |
Require password confirmation when removing a site in UI (#19591)
* Require password confirmation when removing a site in UI
* Add changelog
* Update plugins/SitesManager/API.php
Co-authored-by: Ben Burgess <88810029+bx80@users.noreply.github.com>
* updates expected test files
Co-authored-by: Ben Burgess <88810029+bx80@users.noreply.github.com>
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 | 14 | ||||
-rw-r--r-- | plugins/SitesManager/vue/src/SiteFields/SiteFields.vue | 23 |
4 files changed, 53 insertions, 64 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 aa0ff4d137..25fce0d1c5 100644 --- a/plugins/SitesManager/vue/dist/SitesManager.umd.js +++ b/plugins/SitesManager/vue/dist/SitesManager.umd.js @@ -646,45 +646,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" }; @@ -757,12 +757,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, @@ -774,7 +769,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", { @@ -783,11 +778,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", { @@ -859,30 +854,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"); @@ -1142,7 +1127,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"] @@ -1312,14 +1297,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); }); @@ -1406,7 +1393,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 dea9ca88c0..abefddc5f1 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 p})),n.d(t,"CurrencyStore",(function(){return Xe})),n.d(t,"TimezoneStore",(function(){return We})),n.d(t,"SitesManagement",(function(){return gt})),n.d(t,"ManageGlobalSettings",(function(){return Rt})),"undefined"!==typeof window){var a=window.document.currentScript,i=a&&a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var r=n("19dc"),l=n("8bbf");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 p})),n.d(t,"CurrencyStore",(function(){return $e})),n.d(t,"TimezoneStore",(function(){return Fe})),n.d(t,"SitesManagement",(function(){return mt})),n.d(t,"ManageGlobalSettings",(function(){return Bt})),"undefined"!==typeof window){var a=window.document.currentScript,i=a&&a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var r=n("19dc"),l=n("8bbf");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 * @@ -11,35 +11,35 @@ * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function h(){return{get typesById(){return Object(r["clone"])(p.typesById.value)},fetchTypeById:function(e){var t=this;return p.fetchAvailableTypes().then((function(){return Object(r["cloneThenApply"])(t.typesById[e])}))},fetchAvailableTypes:function(){return p.fetchAvailableTypes().then((function(e){return Object(r["cloneThenApply"])(e)}))},hasMultipleTypes:function(){return p.fetchAvailableTypes().then((function(e){return e&&Object.keys(e).length>1}))},removeEditSiteIdParameterFromHash:p.removeEditSiteIdParameterFromHash.bind(p),getEditSiteIdParameter:p.getEditSiteIdParameter.bind(p)}}window.angular.module("piwikApp.service").factory("sitesManagerTypeModel",h);var g={class:"SitesManager",ref:"root"},f={class:"sites-manager-header"},S=["innerHTML"],j=Object(l["createElementVNode"])("br",null,null,-1),O=["innerHTML"],v={class:"loadingPiwik"},y=["alt"],E={class:"ui-confirm"},N={class:"center"},V=["title","onClick"],x={class:"ui-button-text"},T={class:"sitesManagerList"},M={key:0},w={class:"bottomButtonBar"};function A(e,t,n,a,i,r){var o=this,s=Object(l["resolveComponent"])("EnrichedHeadline"),c=Object(l["resolveComponent"])("ButtonBar"),u=Object(l["resolveComponent"])("MatomoDialog"),d=Object(l["resolveComponent"])("SiteFields"),b=Object(l["resolveDirective"])("content-intro");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",g,[Object(l["createElementVNode"])("div",f,[Object(l["withDirectives"])(Object(l["createElementVNode"])("div",null,[Object(l["withDirectives"])(Object(l["createElementVNode"])("h2",null,[Object(l["createVNode"])(s,{"help-url":"https://matomo.org/docs/manage-websites/","feature-name":e.translate("SitesManager_WebsitesManagement")},{default:Object(l["withCtx"])((function(){return[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.headlineText),1)]})),_:1},8,["help-url","feature-name"])],512),[[l["vShow"],e.availableTypes.length]]),Object(l["createElementVNode"])("p",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_MainDescription"))+" ",1),Object(l["createElementVNode"])("span",{innerHTML:e.$sanitize(e.mainDescription)},null,8,S),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",null,[j,Object(l["createElementVNode"])("span",{innerHTML:e.$sanitize(e.superUserAccessMessage)},null,8,O)],512),[[l["vShow"],e.hasSuperUserAccess]])])],512),[[b]])]),Object(l["createElementVNode"])("div",null,[Object(l["createElementVNode"])("div",{class:Object(l["normalizeClass"])({hide_only:!e.isLoading})},[Object(l["createElementVNode"])("div",v,[Object(l["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,y),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("General_LoadingData")),1)])],2)]),Object(l["createElementVNode"])("div",null,[Object(l["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(l["createVNode"])(u,{modelValue:e.showAddSiteDialog,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.showAddSiteDialog=t})},{default:Object(l["withCtx"])((function(){return[Object(l["createElementVNode"])("div",E,[Object(l["createElementVNode"])("div",null,[Object(l["createElementVNode"])("h2",null,Object(l["toDisplayString"])(e.translate("SitesManager_ChooseMeasurableTypeHeadline")),1),Object(l["createElementVNode"])("div",N,[Object(l["createElementVNode"])("p",null,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableTypes,(function(t){return Object(l["openBlock"])(),Object(l["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(l["createElementVNode"])("span",x,Object(l["toDisplayString"])(t.name),1)],8,V)})),128))])])])])]})),_:1},8,["modelValue"]),Object(l["createElementVNode"])("div",T,[e.activeSearchTerm&&0===e.sites.length&&!e.isLoading?(Object(l["openBlock"])(),Object(l["createElementBlock"])("p",M,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_NotFound"))+" ",1),Object(l["createElementVNode"])("strong",null,Object(l["toDisplayString"])(e.activeSearchTerm),1)])):Object(l["createCommentVNode"])("",!0),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.sites,(function(n,a){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{key:n.idsite},[Object(l["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(l["createElementVNode"])("div",w,[Object(l["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 _={class:"sitesButtonBar clearfix"},C={class:"search"},G=["value","placeholder","disabled"],P=["title"],D={class:"paging"},k=["disabled"],U={style:{cursor:"pointer"}},L={class:"counter"},z=["disabled"],I={style:{cursor:"pointer"},class:"pointer"};function B(e,t,n,a,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",_,[Object(l["withDirectives"])(Object(l["createElementVNode"])("a",{class:Object(l["normalizeClass"])(["btn addSite",{disabled:e.siteIsBeingEdited}]),onClick:t[0]||(t[0]=function(t){return e.addNewEntity()}),tabindex:"1"},Object(l["toDisplayString"])(e.availableTypes.length>1?e.translate("SitesManager_AddMeasurable"):e.translate("SitesManager_AddSite")),3),[[l["vShow"],e.hasSuperUserAccess&&e.availableTypes]]),Object(l["withDirectives"])(Object(l["createElementVNode"])("div",C,[Object(l["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,G),Object(l["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,P)],512),[[l["vShow"],e.hasPrev||e.hasNext||e.isSearching]]),Object(l["withDirectives"])(Object(l["createElementVNode"])("div",D,[Object(l["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(l["createElementVNode"])("span",U,"« "+Object(l["toDisplayString"])(e.translate("General_Previous")),1)],8,k),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",L,[Object(l["createElementVNode"])("span",null,Object(l["toDisplayString"])(e.paginationText),1)],512),[[l["vShow"],e.hasPrev||e.hasNext]]),Object(l["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(l["createElementVNode"])("span",I,Object(l["toDisplayString"])(e.translate("General_Next"))+" »",1)],8,z)],512),[[l["vShow"],e.hasPrev||e.hasNext]])])}var H=Object(l["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(){p.init(),this.onKeydown=Object(r["debounce"])(this.onKeydown,50)},computed:{hasSuperUserAccess:function(){return r["Matomo"].hasSuperUserAccess},availableTypes:function(){return p.types.value},paginationText:function(){var e;return e=this.isSearching?Object(r["translate"])("General_PaginationWithoutTotal","".concat(this.offsetStart),"".concat(this.offsetEnd)):Object(r["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()}}});H.render=B;var F=H,R=["idsite","type"],K={class:"card-content"},W={key:0,class:"row"},Q={class:"col m3"},q={class:"title"},$={class:"title"},Y=["target","title","href"],J={class:"col m4"},X={class:"title"},Z={class:"title"},ee={class:"title"},te={class:"title"},ne={class:"col m4"},ae={class:"title"},ie=Object(l["createTextVNode"])(": "),re=["href"],le={key:0},oe={class:"title"},se={key:1},ce={class:"title"},ue={key:2},de={class:"title"},be={class:"col m1 text-right"},me=["title"],pe=Object(l["createElementVNode"])("span",{class:"icon-edit"},null,-1),he=[pe],ge=["title"],fe=Object(l["createElementVNode"])("span",{class:"icon-delete"},null,-1),Se=[fe],je={key:1},Oe={class:"form-group row"},ve={class:"col s12 m6 input-field"},ye=["placeholder"],Ee=Object(l["createElementVNode"])("div",{class:"col s12 m6"},null,-1),Ne={id:"timezoneHelpText",class:"inline-help-node"},Ve={key:0},xe=Object(l["createElementVNode"])("br",null,null,-1),Te=Object(l["createElementVNode"])("br",null,null,-1),Me={class:"editingSiteFooter"},we=["value"],Ae={class:"ui-confirm"},_e=["value"],Ce=["value"];function Ge(e,t,n,a,i,r){var o,s,c,u=this,d=Object(l["resolveComponent"])("ActivityIndicator"),b=Object(l["resolveComponent"])("GroupedSettings"),m=Object(l["resolveComponent"])("Field"),p=Object(l["resolveComponent"])("MatomoDialog");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{class:Object(l["normalizeClass"])(["site card hoverable",{editingSite:!!e.editMode}]),idsite:e.theSite.idsite,type:e.theSite.type,ref:"root"},[Object(l["createElementVNode"])("div",K,[e.editMode?Object(l["createCommentVNode"])("",!0):(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",W,[Object(l["createElementVNode"])("div",Q,[Object(l["createElementVNode"])("h4",null,Object(l["toDisplayString"])(e.theSite.name),1),Object(l["createElementVNode"])("ul",null,[Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",q,Object(l["toDisplayString"])(e.translate("General_Id"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.idsite),1)]),Object(l["withDirectives"])(Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",$,Object(l["toDisplayString"])(e.translate("SitesManager_Type"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.currentType.name),1)],512),[[l["vShow"],e.availableTypes.length>1]]),Object(l["withDirectives"])(Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("a",{target:e.isInternalSetupUrl?"_self":"_blank",title:e.translate("SitesManager_ShowTrackingTag"),href:e.setupUrl},Object(l["toDisplayString"])(e.translate("SitesManager_ShowTrackingTag")),9,Y)],512),[[l["vShow"],e.theSite.idsite&&e.howToSetupUrl]])])]),Object(l["createElementVNode"])("div",J,[Object(l["createElementVNode"])("ul",null,[Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",X,Object(l["toDisplayString"])(e.translate("SitesManager_Timezone"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.timezone_name),1)]),Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",Z,Object(l["toDisplayString"])(e.translate("SitesManager_Currency"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.currency_name),1)]),Object(l["withDirectives"])(Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",ee,Object(l["toDisplayString"])(e.translate("Goals_Ecommerce"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("General_Yes")),1)],512),[[l["vShow"],1===e.theSite.ecommerce||"1"===e.theSite.ecommerce]]),Object(l["withDirectives"])(Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",te,Object(l["toDisplayString"])(e.translate("Actions_SubmenuSitesearch"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("General_Yes")),1)],512),[[l["vShow"],1===e.theSite.sitesearch||"1"===e.theSite.sitesearch]])])]),Object(l["createElementVNode"])("div",ne,[Object(l["createElementVNode"])("ul",null,[Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",ae,Object(l["toDisplayString"])(e.translate("SitesManager_Urls")),1),ie,(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.theSite.alias_urls,(function(t,n){return Object(l["openBlock"])(),Object(l["createElementBlock"])("span",{key:t},[Object(l["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:t},Object(l["toDisplayString"])(t)+Object(l["toDisplayString"])(n===e.theSite.alias_urls.length-1?"":", "),9,re)])})),128))]),null!==(o=e.theSite.excluded_ips)&&void 0!==o&&o.length?(Object(l["openBlock"])(),Object(l["createElementBlock"])("li",le,[Object(l["createElementVNode"])("span",oe,Object(l["toDisplayString"])(e.translate("SitesManager_ExcludedIps"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.excluded_ips.split(/\s*,\s*/g).join(", ")),1)])):Object(l["createCommentVNode"])("",!0),null!==(s=e.theSite.excluded_parameters)&&void 0!==s&&s.length?(Object(l["openBlock"])(),Object(l["createElementBlock"])("li",se,[Object(l["createElementVNode"])("span",ce,Object(l["toDisplayString"])(e.translate("SitesManager_ExcludedParameters"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.excluded_parameters.split(/\s*,\s*/g).join(", ")),1)])):Object(l["createCommentVNode"])("",!0),null!==(c=e.theSite.excluded_user_agents)&&void 0!==c&&c.length?(Object(l["openBlock"])(),Object(l["createElementBlock"])("li",ue,[Object(l["createElementVNode"])("span",de,Object(l["toDisplayString"])(e.translate("SitesManager_ExcludedUserAgents"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.excluded_user_agents.split(/\s*,\s*/g).join(", ")),1)])):Object(l["createCommentVNode"])("",!0)])]),Object(l["createElementVNode"])("div",be,[Object(l["createElementVNode"])("ul",null,[Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("button",{class:"table-action",onClick:t[0]||(t[0]=function(t){return e.editSite()}),title:e.translate("General_Edit")},he,8,me)]),Object(l["createElementVNode"])("li",null,[Object(l["withDirectives"])(Object(l["createElementVNode"])("button",{class:"table-action",onClick:t[1]||(t[1]=function(e){return u.showRemoveDialog=!0}),title:e.translate("General_Delete")},Se,8,ge),[[l["vShow"],e.theSite.idsite]])])])])])),e.editMode?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",je,[Object(l["createElementVNode"])("div",Oe,[Object(l["createElementVNode"])("div",ve,[Object(l["withDirectives"])(Object(l["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,ye),[[l["vModelText"],e.theSite.name]]),Object(l["createElementVNode"])("label",null,Object(l["toDisplayString"])(e.translate("General_Name")),1)]),Ee]),Object(l["createVNode"])(d,{loading:e.isLoading},null,8,["loading"]),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.measurableSettings,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{key:t.pluginName},[Object(l["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(l["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(l["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(l["createElementVNode"])("div",Ne,[Object(l["createElementVNode"])("div",null,[e.timezoneSupportEnabled?Object(l["createCommentVNode"])("",!0):(Object(l["openBlock"])(),Object(l["createElementBlock"])("span",Ve,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_AdvancedTimezoneSupportNotFound"))+" ",1),xe])),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.utcTimeIs)+" ",1),Te,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward")),1)])]),Object(l["createElementVNode"])("div",Me,[Object(l["withDirectives"])(Object(l["createElementVNode"])("input",{type:"submit",class:"btn",value:e.translate("General_Save"),onClick:t[5]||(t[5]=function(t){return e.saveSite()})},null,8,we),[[l["vShow"],!e.isLoading]]),Object(l["createElementVNode"])("button",{class:"btn btn-link",onClick:t[6]||(t[6]=function(t){return e.cancelEditSite(e.site)})},Object(l["toDisplayString"])(e.translate("General_Cancel","","")),1)])])):Object(l["createCommentVNode"])("",!0)]),Object(l["createVNode"])(p,{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(l["withCtx"])((function(){return[Object(l["createElementVNode"])("div",Ae,[Object(l["createElementVNode"])("h2",null,Object(l["toDisplayString"])(e.removeDialogTitle),1),Object(l["createElementVNode"])("p",null,Object(l["toDisplayString"])(e.translate("SitesManager_DeleteSiteExplanation")),1),Object(l["createElementVNode"])("input",{type:"button",value:e.translate("General_Yes"),role:"yes"},null,8,_e),Object(l["createElementVNode"])("input",{type:"button",value:e.translate("General_No"),role:"no"},null,8,Ce)])]})),_:1},8,["modelValue"])],10,R)}var Pe=n("a5a2");function De(e,t){return Ie(e)||ze(e,t)||Ue(e,t)||ke()}function ke(){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 Ue(e,t){if(e){if("string"===typeof e)return Le(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)?Le(e,t):void 0}}function Le(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 Ie(e){if(Array.isArray(e))return e}function Be(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function He(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 Fe(e,t,n){return t&&He(e.prototype,t),n&&He(e,n),e}function Re(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} +function h(){return{get typesById(){return Object(r["clone"])(p.typesById.value)},fetchTypeById:function(e){var t=this;return p.fetchAvailableTypes().then((function(){return Object(r["cloneThenApply"])(t.typesById[e])}))},fetchAvailableTypes:function(){return p.fetchAvailableTypes().then((function(e){return Object(r["cloneThenApply"])(e)}))},hasMultipleTypes:function(){return p.fetchAvailableTypes().then((function(e){return e&&Object.keys(e).length>1}))},removeEditSiteIdParameterFromHash:p.removeEditSiteIdParameterFromHash.bind(p),getEditSiteIdParameter:p.getEditSiteIdParameter.bind(p)}}window.angular.module("piwikApp.service").factory("sitesManagerTypeModel",h);var g={class:"SitesManager",ref:"root"},f={class:"sites-manager-header"},S=["innerHTML"],j=Object(l["createElementVNode"])("br",null,null,-1),O=["innerHTML"],v={class:"loadingPiwik"},y=["alt"],E={class:"ui-confirm"},N={class:"center"},V=["title","onClick"],x={class:"ui-button-text"},T={class:"sitesManagerList"},M={key:0},w={class:"bottomButtonBar"};function C(e,t,n,a,i,r){var o=this,s=Object(l["resolveComponent"])("EnrichedHeadline"),c=Object(l["resolveComponent"])("ButtonBar"),u=Object(l["resolveComponent"])("MatomoDialog"),d=Object(l["resolveComponent"])("SiteFields"),b=Object(l["resolveDirective"])("content-intro");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",g,[Object(l["createElementVNode"])("div",f,[Object(l["withDirectives"])(Object(l["createElementVNode"])("div",null,[Object(l["withDirectives"])(Object(l["createElementVNode"])("h2",null,[Object(l["createVNode"])(s,{"help-url":"https://matomo.org/docs/manage-websites/","feature-name":e.translate("SitesManager_WebsitesManagement")},{default:Object(l["withCtx"])((function(){return[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.headlineText),1)]})),_:1},8,["help-url","feature-name"])],512),[[l["vShow"],e.availableTypes.length]]),Object(l["createElementVNode"])("p",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_MainDescription"))+" ",1),Object(l["createElementVNode"])("span",{innerHTML:e.$sanitize(e.mainDescription)},null,8,S),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",null,[j,Object(l["createElementVNode"])("span",{innerHTML:e.$sanitize(e.superUserAccessMessage)},null,8,O)],512),[[l["vShow"],e.hasSuperUserAccess]])])],512),[[b]])]),Object(l["createElementVNode"])("div",null,[Object(l["createElementVNode"])("div",{class:Object(l["normalizeClass"])({hide_only:!e.isLoading})},[Object(l["createElementVNode"])("div",v,[Object(l["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,y),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("General_LoadingData")),1)])],2)]),Object(l["createElementVNode"])("div",null,[Object(l["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(l["createVNode"])(u,{modelValue:e.showAddSiteDialog,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.showAddSiteDialog=t})},{default:Object(l["withCtx"])((function(){return[Object(l["createElementVNode"])("div",E,[Object(l["createElementVNode"])("div",null,[Object(l["createElementVNode"])("h2",null,Object(l["toDisplayString"])(e.translate("SitesManager_ChooseMeasurableTypeHeadline")),1),Object(l["createElementVNode"])("div",N,[Object(l["createElementVNode"])("p",null,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableTypes,(function(t){return Object(l["openBlock"])(),Object(l["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(l["createElementVNode"])("span",x,Object(l["toDisplayString"])(t.name),1)],8,V)})),128))])])])])]})),_:1},8,["modelValue"]),Object(l["createElementVNode"])("div",T,[e.activeSearchTerm&&0===e.sites.length&&!e.isLoading?(Object(l["openBlock"])(),Object(l["createElementBlock"])("p",M,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_NotFound"))+" ",1),Object(l["createElementVNode"])("strong",null,Object(l["toDisplayString"])(e.activeSearchTerm),1)])):Object(l["createCommentVNode"])("",!0),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.sites,(function(n,a){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{key:n.idsite},[Object(l["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(l["createElementVNode"])("div",w,[Object(l["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 A={class:"sitesButtonBar clearfix"},_={class:"search"},P=["value","placeholder","disabled"],G=["title"],D={class:"paging"},k=["disabled"],U={style:{cursor:"pointer"}},L={class:"counter"},z=["disabled"],I={style:{cursor:"pointer"},class:"pointer"};function B(e,t,n,a,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",A,[Object(l["withDirectives"])(Object(l["createElementVNode"])("a",{class:Object(l["normalizeClass"])(["btn addSite",{disabled:e.siteIsBeingEdited}]),onClick:t[0]||(t[0]=function(t){return e.addNewEntity()}),tabindex:"1"},Object(l["toDisplayString"])(e.availableTypes.length>1?e.translate("SitesManager_AddMeasurable"):e.translate("SitesManager_AddSite")),3),[[l["vShow"],e.hasSuperUserAccess&&e.availableTypes]]),Object(l["withDirectives"])(Object(l["createElementVNode"])("div",_,[Object(l["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,P),Object(l["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,G)],512),[[l["vShow"],e.hasPrev||e.hasNext||e.isSearching]]),Object(l["withDirectives"])(Object(l["createElementVNode"])("div",D,[Object(l["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(l["createElementVNode"])("span",U,"« "+Object(l["toDisplayString"])(e.translate("General_Previous")),1)],8,k),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",L,[Object(l["createElementVNode"])("span",null,Object(l["toDisplayString"])(e.paginationText),1)],512),[[l["vShow"],e.hasPrev||e.hasNext]]),Object(l["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(l["createElementVNode"])("span",I,Object(l["toDisplayString"])(e.translate("General_Next"))+" »",1)],8,z)],512),[[l["vShow"],e.hasPrev||e.hasNext]])])}var H=Object(l["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(){p.init(),this.onKeydown=Object(r["debounce"])(this.onKeydown,50)},computed:{hasSuperUserAccess:function(){return r["Matomo"].hasSuperUserAccess},availableTypes:function(){return p.types.value},paginationText:function(){var e;return e=this.isSearching?Object(r["translate"])("General_PaginationWithoutTotal","".concat(this.offsetStart),"".concat(this.offsetEnd)):Object(r["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()}}});H.render=B;var F=H,R=["idsite","type"],W={class:"card-content"},K={key:0,class:"row"},Q={class:"col m3"},q={class:"title"},$={class:"title"},Y=["target","title","href"],J={class:"col m4"},X={class:"title"},Z={class:"title"},ee={class:"title"},te={class:"title"},ne={class:"col m4"},ae={class:"title"},ie=Object(l["createTextVNode"])(": "),re=["href"],le={key:0},oe={class:"title"},se={key:1},ce={class:"title"},ue={key:2},de={class:"title"},be={class:"col m1 text-right"},me=["title"],pe=Object(l["createElementVNode"])("span",{class:"icon-edit"},null,-1),he=[pe],ge=["title"],fe=Object(l["createElementVNode"])("span",{class:"icon-delete"},null,-1),Se=[fe],je={key:1},Oe={class:"form-group row"},ve={class:"col s12 m6 input-field"},ye=["placeholder"],Ee=Object(l["createElementVNode"])("div",{class:"col s12 m6"},null,-1),Ne={id:"timezoneHelpText",class:"inline-help-node"},Ve={key:0},xe=Object(l["createElementVNode"])("br",null,null,-1),Te=Object(l["createElementVNode"])("br",null,null,-1),Me={class:"editingSiteFooter"},we=["value"];function Ce(e,t,n,a,i,r){var o,s,c,u=this,d=Object(l["resolveComponent"])("ActivityIndicator"),b=Object(l["resolveComponent"])("GroupedSettings"),m=Object(l["resolveComponent"])("Field"),p=Object(l["resolveComponent"])("PasswordConfirmation");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{class:Object(l["normalizeClass"])(["site card hoverable",{editingSite:!!e.editMode}]),idsite:e.theSite.idsite,type:e.theSite.type,ref:"root"},[Object(l["createElementVNode"])("div",W,[e.editMode?Object(l["createCommentVNode"])("",!0):(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",K,[Object(l["createElementVNode"])("div",Q,[Object(l["createElementVNode"])("h4",null,Object(l["toDisplayString"])(e.theSite.name),1),Object(l["createElementVNode"])("ul",null,[Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",q,Object(l["toDisplayString"])(e.translate("General_Id"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.idsite),1)]),Object(l["withDirectives"])(Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",$,Object(l["toDisplayString"])(e.translate("SitesManager_Type"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.currentType.name),1)],512),[[l["vShow"],e.availableTypes.length>1]]),Object(l["withDirectives"])(Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("a",{target:e.isInternalSetupUrl?"_self":"_blank",title:e.translate("SitesManager_ShowTrackingTag"),href:e.setupUrl},Object(l["toDisplayString"])(e.translate("SitesManager_ShowTrackingTag")),9,Y)],512),[[l["vShow"],e.theSite.idsite&&e.howToSetupUrl]])])]),Object(l["createElementVNode"])("div",J,[Object(l["createElementVNode"])("ul",null,[Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",X,Object(l["toDisplayString"])(e.translate("SitesManager_Timezone"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.timezone_name),1)]),Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",Z,Object(l["toDisplayString"])(e.translate("SitesManager_Currency"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.currency_name),1)]),Object(l["withDirectives"])(Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",ee,Object(l["toDisplayString"])(e.translate("Goals_Ecommerce"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("General_Yes")),1)],512),[[l["vShow"],1===e.theSite.ecommerce||"1"===e.theSite.ecommerce]]),Object(l["withDirectives"])(Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",te,Object(l["toDisplayString"])(e.translate("Actions_SubmenuSitesearch"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("General_Yes")),1)],512),[[l["vShow"],1===e.theSite.sitesearch||"1"===e.theSite.sitesearch]])])]),Object(l["createElementVNode"])("div",ne,[Object(l["createElementVNode"])("ul",null,[Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("span",ae,Object(l["toDisplayString"])(e.translate("SitesManager_Urls")),1),ie,(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.theSite.alias_urls,(function(t,n){return Object(l["openBlock"])(),Object(l["createElementBlock"])("span",{key:t},[Object(l["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:t},Object(l["toDisplayString"])(t)+Object(l["toDisplayString"])(n===e.theSite.alias_urls.length-1?"":", "),9,re)])})),128))]),null!==(o=e.theSite.excluded_ips)&&void 0!==o&&o.length?(Object(l["openBlock"])(),Object(l["createElementBlock"])("li",le,[Object(l["createElementVNode"])("span",oe,Object(l["toDisplayString"])(e.translate("SitesManager_ExcludedIps"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.excluded_ips.split(/\s*,\s*/g).join(", ")),1)])):Object(l["createCommentVNode"])("",!0),null!==(s=e.theSite.excluded_parameters)&&void 0!==s&&s.length?(Object(l["openBlock"])(),Object(l["createElementBlock"])("li",se,[Object(l["createElementVNode"])("span",ce,Object(l["toDisplayString"])(e.translate("SitesManager_ExcludedParameters"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.excluded_parameters.split(/\s*,\s*/g).join(", ")),1)])):Object(l["createCommentVNode"])("",!0),null!==(c=e.theSite.excluded_user_agents)&&void 0!==c&&c.length?(Object(l["openBlock"])(),Object(l["createElementBlock"])("li",ue,[Object(l["createElementVNode"])("span",de,Object(l["toDisplayString"])(e.translate("SitesManager_ExcludedUserAgents"))+":",1),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.theSite.excluded_user_agents.split(/\s*,\s*/g).join(", ")),1)])):Object(l["createCommentVNode"])("",!0)])]),Object(l["createElementVNode"])("div",be,[Object(l["createElementVNode"])("ul",null,[Object(l["createElementVNode"])("li",null,[Object(l["createElementVNode"])("button",{class:"table-action",onClick:t[0]||(t[0]=function(t){return e.editSite()}),title:e.translate("General_Edit")},he,8,me)]),Object(l["createElementVNode"])("li",null,[Object(l["withDirectives"])(Object(l["createElementVNode"])("button",{class:"table-action",onClick:t[1]||(t[1]=function(e){return u.showRemoveDialog=!0}),title:e.translate("General_Delete")},Se,8,ge),[[l["vShow"],e.theSite.idsite]])])])])])),e.editMode?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",je,[Object(l["createElementVNode"])("div",Oe,[Object(l["createElementVNode"])("div",ve,[Object(l["withDirectives"])(Object(l["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,ye),[[l["vModelText"],e.theSite.name]]),Object(l["createElementVNode"])("label",null,Object(l["toDisplayString"])(e.translate("General_Name")),1)]),Ee]),Object(l["createVNode"])(d,{loading:e.isLoading},null,8,["loading"]),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.measurableSettings,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{key:t.pluginName},[Object(l["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(l["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(l["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(l["createElementVNode"])("div",Ne,[Object(l["createElementVNode"])("div",null,[e.timezoneSupportEnabled?Object(l["createCommentVNode"])("",!0):(Object(l["openBlock"])(),Object(l["createElementBlock"])("span",Ve,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_AdvancedTimezoneSupportNotFound"))+" ",1),xe])),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.utcTimeIs)+" ",1),Te,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward")),1)])]),Object(l["createElementVNode"])("div",Me,[Object(l["withDirectives"])(Object(l["createElementVNode"])("input",{type:"submit",class:"btn",value:e.translate("General_Save"),onClick:t[5]||(t[5]=function(t){return e.saveSite()})},null,8,we),[[l["vShow"],!e.isLoading]]),Object(l["createElementVNode"])("button",{class:"btn btn-link",onClick:t[6]||(t[6]=function(t){return e.cancelEditSite(e.site)})},Object(l["toDisplayString"])(e.translate("General_Cancel","","")),1)])])):Object(l["createCommentVNode"])("",!0)]),Object(l["createVNode"])(p,{modelValue:e.showRemoveDialog,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.showRemoveDialog=t}),onConfirmed:e.deleteSite},{default:Object(l["withCtx"])((function(){return[Object(l["createElementVNode"])("h2",null,Object(l["toDisplayString"])(e.removeDialogTitle),1),Object(l["createElementVNode"])("p",null,Object(l["toDisplayString"])(e.translate("SitesManager_DeleteSiteExplanation")),1),Object(l["createElementVNode"])("p",null,Object(l["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])],10,R)}var Ae=n("a5a2");function _e(e,t){return Ue(e)||ke(e,t)||Ge(e,t)||Pe()}function Pe(){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 Ge(e,t){if(e){if("string"===typeof e)return De(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)?De(e,t):void 0}}function De(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 ke(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 Ue(e){if(Array.isArray(e))return e}function Le(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ze(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 Ie(e,t,n){return t&&ze(e.prototype,t),n&&ze(e,n),e}function Be(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 Ke=function(){function e(){var t=this;Be(this,e),Re(this,"privateState",Object(l["reactive"])({isLoading:!1,timezones:[],timezoneSupportEnabled:!1})),Re(this,"state",Object(l["computed"])((function(){return Object(l["readonly"])(t.privateState)}))),Re(this,"timezones",Object(l["computed"])((function(){return t.state.value.timezones}))),Re(this,"timezoneSupportEnabled",Object(l["computed"])((function(){return t.state.value.timezoneSupportEnabled}))),Re(this,"isLoading",Object(l["computed"])((function(){return t.state.value.isLoading}))),Re(this,"initializePromise",null)}return Fe(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 r["AjaxHelper"].fetch({method:"SitesManager.getTimezonesList"}).then((function(t){var n=[];Object.entries(t).forEach((function(e){var t=De(e,2),a=t[0],i=t[1];Object.entries(i).forEach((function(e){var t=De(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 r["AjaxHelper"].fetch({method:"SitesManager.isTimezoneSupportEnabled"}).then((function(t){e.privateState.timezoneSupportEnabled=t.value}))}}]),e}(),We=new Ke;function Qe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qe(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 $e(e,t,n){return t&&qe(e.prototype,t),n&&qe(e,n),e}function Ye(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */var He=function(){function e(){var t=this;Le(this,e),Be(this,"privateState",Object(l["reactive"])({isLoading:!1,timezones:[],timezoneSupportEnabled:!1})),Be(this,"state",Object(l["computed"])((function(){return Object(l["readonly"])(t.privateState)}))),Be(this,"timezones",Object(l["computed"])((function(){return t.state.value.timezones}))),Be(this,"timezoneSupportEnabled",Object(l["computed"])((function(){return t.state.value.timezoneSupportEnabled}))),Be(this,"isLoading",Object(l["computed"])((function(){return t.state.value.isLoading}))),Be(this,"initializePromise",null)}return Ie(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 r["AjaxHelper"].fetch({method:"SitesManager.getTimezonesList"}).then((function(t){var n=[];Object.entries(t).forEach((function(e){var t=_e(e,2),a=t[0],i=t[1];Object.entries(i).forEach((function(e){var t=_e(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 r["AjaxHelper"].fetch({method:"SitesManager.isTimezoneSupportEnabled"}).then((function(t){e.privateState.timezoneSupportEnabled=t.value}))}}]),e}(),Fe=new He;function Re(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function We(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 Ke(e,t,n){return t&&We(e.prototype,t),n&&We(e,n),e}function Qe(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 Je=function(){function e(){var t=this;Qe(this,e),Ye(this,"privateState",Object(l["reactive"])({isLoading:!1,currencies:{}})),Ye(this,"currencies",Object(l["computed"])((function(){return Object(l["readonly"])(t.privateState).currencies}))),Ye(this,"isLoading",Object(l["computed"])((function(){return Object(l["readonly"])(t.privateState).isLoading}))),Ye(this,"initializePromise",null)}return $e(e,[{key:"init",value:function(){return this.initializePromise||(this.initializePromise=this.fetchCurrencies()),this.initializePromise}},{key:"fetchCurrencies",value:function(){var e=this;return this.privateState.isLoading=!0,r["AjaxHelper"].fetch({method:"SitesManager.getCurrencyList"}).then((function(t){e.privateState.currencies=t})).finally((function(){e.privateState.isLoading=!1}))}}]),e}(),Xe=new Je;function Ze(e,t){return it(e)||at(e,t)||tt(e,t)||et()}function et(){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 tt(e,t){if(e){if("string"===typeof e)return nt(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)?nt(e,t):void 0}}function nt(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 at(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 it(e){if(Array.isArray(e))return e}var rt=Object(l["computed"])((function(){return We.timezones.value.map((function(e){var t=e.group,n=e.label,a=e.code;return{group:t,key:n,value:a}}))}));function lt(e){return"undefined"===typeof e.idsite}var ot=Object(l["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:r["MatomoDialog"],Field:Pe["Field"],GroupedSettings:Pe["GroupedSettings"],ActivityIndicator:r["ActivityIndicator"]},emits:["delete","editSite","cancelEditSite","save"],created:function(){Xe.init(),We.init(),p.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=lt(e);if(t){var n=this.globalSettings;this.theSite.timezone=n.defaultTimezone,this.theSite.currency=n.defaultCurrency}var a=p.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=[],lt(this.theSite)){if(!this.currentType)return;this.measurableSettings=this.currentType.settings||[]}else this.isLoading=!0,r["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=lt(this.theSite),a="SitesManager.addSite";n||(a="SitesManager.updateSite",t.idSite=this.theSite.idsite),Object.entries(this.settingValues).forEach((function(e){var n=Ze(e,2),a=n[0],i=n[1],r=a.split("."),l=Ze(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})})),r["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=We.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=Xe.currencies.value[e.theSite.currency]);var l=r["NotificationsStore"].show({message:n?Object(r["translate"])("SitesManager_WebsiteCreated"):Object(r["translate"])("SitesManager_WebsiteUpdated"),context:"success",id:"websitecreated",type:"transient"});r["NotificationsStore"].scrollToNotification(l),p.removeEditSiteIdParameterFromHash(),e.$emit("save",{site:e.theSite,settingValues:t.settingValues,isNew:n})}))},cancelEditSite:function(e){this.editMode=!1,p.removeEditSiteIdParameterFromHash(),this.$emit("cancelEditSite",{site:e,element:this.$refs.root})},deleteSite:function(){var e=this;r["AjaxHelper"].fetch({idSite:this.theSite.idsite,module:"API",format:"json",method:"SitesManager.deleteSite"}).then((function(){e.$emit("delete",e.theSite)}))}},computed:{availableTypes:function(){return p.types.value},setupUrl:function(){var e=this.theSite,t="",n="";return this.isInternalSetupUrl&&(t=r["MatomoUrl"].stringify({idSite:e.idsite,period:r["MatomoUrl"].parsed.value.period,date:r["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()),l="".concat(Object(r["format"])(this.utcTime)," ").concat(n,":").concat(a,":").concat(i);return Object(r["translate"])("SitesManager_UTCTimeIs",l)},timezones:function(){return rt.value},currencies:function(){return Xe.currencies.value},currentType:function(){var e=this.site,t=p.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(r["translate"])("SitesManager_DeleteConfirm",'"'.concat(this.theSite.name,'" (idSite = ').concat(this.theSite.idsite,")"))}}});ot.render=Ge;var st=ot;function ct(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ut(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 dt(e,t,n){return t&&ut(e.prototype,t),n&&ut(e,n),e}function bt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} + */var qe=function(){function e(){var t=this;Re(this,e),Qe(this,"privateState",Object(l["reactive"])({isLoading:!1,currencies:{}})),Qe(this,"currencies",Object(l["computed"])((function(){return Object(l["readonly"])(t.privateState).currencies}))),Qe(this,"isLoading",Object(l["computed"])((function(){return Object(l["readonly"])(t.privateState).isLoading}))),Qe(this,"initializePromise",null)}return Ke(e,[{key:"init",value:function(){return this.initializePromise||(this.initializePromise=this.fetchCurrencies()),this.initializePromise}},{key:"fetchCurrencies",value:function(){var e=this;return this.privateState.isLoading=!0,r["AjaxHelper"].fetch({method:"SitesManager.getCurrencyList"}).then((function(t){e.privateState.currencies=t})).finally((function(){e.privateState.isLoading=!1}))}}]),e}(),$e=new qe;function Ye(e,t){return tt(e)||et(e,t)||Xe(e,t)||Je()}function Je(){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 Ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ze(e,t):void 0}}function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function et(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 tt(e){if(Array.isArray(e))return e}var nt=Object(l["computed"])((function(){return Fe.timezones.value.map((function(e){var t=e.group,n=e.label,a=e.code;return{group:t,key:n,value:a}}))}));function at(e){return"undefined"===typeof e.idsite}var it=Object(l["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:Ae["PasswordConfirmation"],Field:Ae["Field"],GroupedSettings:Ae["GroupedSettings"],ActivityIndicator:r["ActivityIndicator"]},emits:["delete","editSite","cancelEditSite","save"],created:function(){$e.init(),Fe.init(),p.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=at(e);if(t){var n=this.globalSettings;this.theSite.timezone=n.defaultTimezone,this.theSite.currency=n.defaultCurrency}var a=p.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=[],at(this.theSite)){if(!this.currentType)return;this.measurableSettings=this.currentType.settings||[]}else this.isLoading=!0,r["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=at(this.theSite),a="SitesManager.addSite";n||(a="SitesManager.updateSite",t.idSite=this.theSite.idsite),Object.entries(this.settingValues).forEach((function(e){var n=Ye(e,2),a=n[0],i=n[1],r=a.split("."),l=Ye(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})})),r["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=Fe.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=$e.currencies.value[e.theSite.currency]);var l=r["NotificationsStore"].show({message:n?Object(r["translate"])("SitesManager_WebsiteCreated"):Object(r["translate"])("SitesManager_WebsiteUpdated"),context:"success",id:"websitecreated",type:"transient"});r["NotificationsStore"].scrollToNotification(l),p.removeEditSiteIdParameterFromHash(),e.$emit("save",{site:e.theSite,settingValues:t.settingValues,isNew:n})}))},cancelEditSite:function(e){this.editMode=!1,p.removeEditSiteIdParameterFromHash(),this.$emit("cancelEditSite",{site:e,element:this.$refs.root})},deleteSite:function(e){var t=this;r["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 p.types.value},setupUrl:function(){var e=this.theSite,t="",n="";return this.isInternalSetupUrl&&(t=r["MatomoUrl"].stringify({idSite:e.idsite,period:r["MatomoUrl"].parsed.value.period,date:r["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()),l="".concat(Object(r["format"])(this.utcTime)," ").concat(n,":").concat(a,":").concat(i);return Object(r["translate"])("SitesManager_UTCTimeIs",l)},timezones:function(){return nt.value},currencies:function(){return $e.currencies.value},currentType:function(){var e=this.site,t=p.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(r["translate"])("SitesManager_DeleteConfirm",'"'.concat(this.theSite.name,'" (idSite = ').concat(this.theSite.idsite,")"))}}});it.render=Ce;var rt=it;function lt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ot(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function st(e,t,n){return t&&ot(e.prototype,t),n&&ot(e,n),e}function ct(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 mt=function(){function e(){var t=this;ct(this,e),bt(this,"privateState",Object(l["reactive"])({isLoading:!1,globalSettings:{keepURLFragmentsGlobal:!1,defaultCurrency:"",defaultTimezone:"",excludedIpsGlobal:"",excludedQueryParametersGlobal:"",excludedUserAgentsGlobal:"",excludedReferrersGlobal:"",searchKeywordParametersGlobal:"",searchCategoryParametersGlobal:""}})),bt(this,"isLoading",Object(l["computed"])((function(){return Object(l["readonly"])(t.privateState).isLoading}))),bt(this,"globalSettings",Object(l["computed"])((function(){return Object(l["readonly"])(t.privateState).globalSettings})))}return dt(e,[{key:"init",value:function(){return this.fetchGlobalSettings()}},{key:"saveGlobalSettings",value:function(e){var t=this;return this.privateState.isLoading=!0,r["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,r["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}(),pt=new mt,ht=Object(l["defineComponent"])({props:{dummy:String},components:{MatomoDialog:r["MatomoDialog"],ButtonBar:F,SiteFields:st,EnrichedHeadline:r["EnrichedHeadline"]},directives:{ContentIntro:r["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;We.init(),p.init(),pt.init(),this.isLoadingInitialEntities=!0,Promise.all([p.fetchAvailableTypes(),this.fetchLimitedSitesWithAdminAccess(),this.getTotalNumberOfSites()]).then((function(){e.triggerAddSiteIfRequested()})).finally((function(){e.isLoadingInitialEntities=!1})),Object(l["watch"])((function(){return r["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||p.isLoading.value||We.isLoading.value||pt.isLoading.value},availableTypes:function(){return p.types.value},timezoneSupportEnabled:function(){return We.timezoneSupportEnabled.value},globalSettings:function(){return pt.globalSettings.value},headlineText:function(){return Object(r["translate"])("SitesManager_XManagement",this.availableTypes.length>1?Object(r["translate"])("General_Measurables"):Object(r["translate"])("SitesManager_Sites"))},mainDescription:function(){return Object(r["translate"])("SitesManager_YouCurrentlyHaveAccessToNWebsites","<strong>".concat(this.totalNumberOfSites,"</strong>"))},hasSuperUserAccess:function(){return r["Matomo"].hasSuperUserAccess},superUserAccessMessage:function(){return Object(r["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=r["MatomoUrl"].hashQuery.value;!r["Matomo"].hasSuperUserAccess||"globalSettings"!==e&&"/globalSettings"!==e||r["MatomoUrl"].updateLocation(Object.assign(Object.assign({},r["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};r["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),r["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 r["AjaxHelper"].fetch({method:"SitesManager.getSitesIdWithAdminAccess",filter_limit:"-1"}).then((function(t){e.totalNumberOfSites=t.length}))},triggerAddSiteIfRequested:function(){var e=p.getEditSiteIdParameter(),t=r["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(r["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}))}r["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=A;var gt=ht; + */var ut=function(){function e(){var t=this;lt(this,e),ct(this,"privateState",Object(l["reactive"])({isLoading:!1,globalSettings:{keepURLFragmentsGlobal:!1,defaultCurrency:"",defaultTimezone:"",excludedIpsGlobal:"",excludedQueryParametersGlobal:"",excludedUserAgentsGlobal:"",excludedReferrersGlobal:"",searchKeywordParametersGlobal:"",searchCategoryParametersGlobal:""}})),ct(this,"isLoading",Object(l["computed"])((function(){return Object(l["readonly"])(t.privateState).isLoading}))),ct(this,"globalSettings",Object(l["computed"])((function(){return Object(l["readonly"])(t.privateState).globalSettings})))}return st(e,[{key:"init",value:function(){return this.fetchGlobalSettings()}},{key:"saveGlobalSettings",value:function(e){var t=this;return this.privateState.isLoading=!0,r["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,r["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}(),dt=new ut,bt=Object(l["defineComponent"])({props:{dummy:String},components:{MatomoDialog:r["MatomoDialog"],ButtonBar:F,SiteFields:rt,EnrichedHeadline:r["EnrichedHeadline"]},directives:{ContentIntro:r["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;Fe.init(),p.init(),dt.init(),this.isLoadingInitialEntities=!0,Promise.all([p.fetchAvailableTypes(),this.fetchLimitedSitesWithAdminAccess(),this.getTotalNumberOfSites()]).then((function(){e.triggerAddSiteIfRequested()})).finally((function(){e.isLoadingInitialEntities=!1})),Object(l["watch"])((function(){return r["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||p.isLoading.value||Fe.isLoading.value||dt.isLoading.value},availableTypes:function(){return p.types.value},timezoneSupportEnabled:function(){return Fe.timezoneSupportEnabled.value},globalSettings:function(){return dt.globalSettings.value},headlineText:function(){return Object(r["translate"])("SitesManager_XManagement",this.availableTypes.length>1?Object(r["translate"])("General_Measurables"):Object(r["translate"])("SitesManager_Sites"))},mainDescription:function(){return Object(r["translate"])("SitesManager_YouCurrentlyHaveAccessToNWebsites","<strong>".concat(this.totalNumberOfSites,"</strong>"))},hasSuperUserAccess:function(){return r["Matomo"].hasSuperUserAccess},superUserAccessMessage:function(){return Object(r["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=r["MatomoUrl"].hashQuery.value;!r["Matomo"].hasSuperUserAccess||"globalSettings"!==e&&"/globalSettings"!==e||r["MatomoUrl"].updateLocation(Object.assign(Object.assign({},r["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};r["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),r["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 r["AjaxHelper"].fetch({method:"SitesManager.getSitesIdWithAdminAccess",filter_limit:"-1"}).then((function(t){e.totalNumberOfSites=t.length}))},triggerAddSiteIfRequested:function(){var e=p.getEditSiteIdParameter(),t=r["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(r["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}))}r["Matomo"].helper.redirect(t)},afterSave:function(e,t,n,a){var i=["excluded_ips","excluded_parameters","excluded_user_agents","sitesearch_keyword_parameters","sitesearch_category_parameters"],r=Object.assign({},e);Object.values(t).forEach((function(e){e.forEach((function(e){"urls"===e.name?r.alias_urls=e.value:-1!==i.indexOf(e.name)?r[e.name]=e.value.join(", "):r[e.name]=e.value}))})),this.fetchedSites[n]=r,a&&null!==this.totalNumberOfSites&&(this.totalNumberOfSites+=1),this.isSiteBeingEdited=!1}}});bt.render=C;var mt=bt; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */Object(r["createAngularJsAdapter"])({component:gt,scope:{},directiveName:"matomoSitesManagement"});window.angular.module("piwikApp").factory("sitesManagerAPI",(function(){return{}}));var ft={class:"SitesManager"},St=Object(l["createElementVNode"])("a",{name:"globalSettings",id:"globalSettings"},null,-1),jt={id:"excludedIpsGlobalHelp",class:"inline-help-node"},Ot=Object(l["createElementVNode"])("br",null,null,-1),vt=Object(l["createElementVNode"])("br",null,null,-1),yt=["innerHTML"],Et={id:"excludedQueryParametersGlobalHelp",class:"inline-help-node"},Nt=Object(l["createElementVNode"])("br",null,null,-1),Vt=Object(l["createElementVNode"])("br",null,null,-1),xt={id:"excludedUserAgentsGlobalHelp",class:"inline-help-node"},Tt=Object(l["createElementVNode"])("br",null,null,-1),Mt=Object(l["createElementVNode"])("br",null,null,-1),wt={id:"excludedReferrersGlobalHelp",class:"inline-help-node"},At=Object(l["createElementVNode"])("br",null,null,-1),_t=Object(l["createElementVNode"])("br",null,null,-1),Ct=Object(l["createElementVNode"])("br",null,null,-1),Gt=Object(l["createElementVNode"])("br",null,null,-1),Pt=Object(l["createElementVNode"])("br",null,null,-1),Dt={id:"timezoneHelp",class:"inline-help-node"},kt={key:0},Ut=Object(l["createElementVNode"])("br",null,null,-1),Lt=Object(l["createElementVNode"])("br",null,null,-1),zt={id:"keepURLFragmentsHelp",class:"inline-help-node"},It=["innerHTML"],Bt={class:"alert alert-info"};function Ht(e,t,n,a,i,r){var o=Object(l["resolveComponent"])("Field"),s=Object(l["resolveComponent"])("SaveButton"),c=Object(l["resolveComponent"])("ContentBlock");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",ft,[Object(l["withDirectives"])(Object(l["createVNode"])(c,{"content-title":e.translate("SitesManager_GlobalWebsitesSettings")},{default:Object(l["withCtx"])((function(){return[St,Object(l["createElementVNode"])("div",jt,[Object(l["createElementVNode"])("div",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_HelpExcludedIpAddresses","1.2.3.4/24","1.2.3.*","1.2.*.*"))+" ",1),Ot,vt,Object(l["createElementVNode"])("span",{innerHTML:e.$sanitize(e.yourCurrentIpAddressIs)},null,8,yt)])]),Object(l["createElementVNode"])("div",Et,[Object(l["createElementVNode"])("div",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_ListOfQueryParametersToExclude","/^sess.*|.*[dD]ate$/"))+" ",1),Nt,Vt,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_PiwikWillAutomaticallyExcludeCommonSessionParameters","phpsessid, sessionid, ...")),1)])]),Object(l["createElementVNode"])("div",xt,[Object(l["createElementVNode"])("div",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp1"))+" ",1),Tt,Mt,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_GlobalListExcludedUserAgents_Desc"))+" "+Object(l["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp2"))+" "+Object(l["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp3","/bot|spider|crawl|scanner/i")),1)])]),Object(l["createElementVNode"])("div",wt,[Object(l["createElementVNode"])("div",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelp"))+" ",1),At,_t,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpDetails"))+" ",1),Ct,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpExamples","www.example.org","http://example.org/mypath","https://www.example.org/?param=1","https://sub.example.org/"))+" ",1),Gt,Pt,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpSubDomains",".sub.example.org","http://sub.example.org/mypath","https://new.sub.example.org/")),1)])]),Object(l["createElementVNode"])("div",Dt,[Object(l["createElementVNode"])("div",null,[e.timezoneSupportEnabled?Object(l["createCommentVNode"])("",!0):(Object(l["openBlock"])(),Object(l["createElementBlock"])("span",kt,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_AdvancedTimezoneSupportNotFound"))+" ",1),Ut])),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_UTCTimeIs",e.utcTimeDate))+" ",1),Lt,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward")),1)])]),Object(l["createElementVNode"])("div",zt,[Object(l["createElementVNode"])("div",{innerHTML:e.$sanitize(e.keepUrlFragmentHelp)},null,8,It),Object(l["createElementVNode"])("div",null,Object(l["toDisplayString"])(e.translate("SitesManager_KeepURLFragmentsHelp2")),1)]),Object(l["createElementVNode"])("div",null,[Object(l["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(l["createElementVNode"])("div",null,[Object(l["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(l["createElementVNode"])("div",null,[Object(l["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(l["createElementVNode"])("div",null,[Object(l["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(l["createElementVNode"])("div",null,[Object(l["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(l["createElementVNode"])("h3",null,Object(l["toDisplayString"])(e.translate("SitesManager_TrackingSiteSearch")),1),Object(l["createElementVNode"])("p",null,Object(l["toDisplayString"])(e.translate("SitesManager_SiteSearchUse")),1),Object(l["createElementVNode"])("div",Bt,Object(l["toDisplayString"])(e.translate("SitesManager_SearchParametersNote"))+" "+Object(l["toDisplayString"])(e.translate("SitesManager_SearchParametersNote2")),1),Object(l["createElementVNode"])("div",null,[Object(l["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(l["createElementVNode"])("div",null,[Object(l["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(l["createElementVNode"])("div",null,[Object(l["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(l["createElementVNode"])("div",null,[Object(l["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(l["createVNode"])(s,{saving:e.isSaving,onConfirm:t[9]||(t[9]=function(t){return e.saveGlobalSettings()})},null,8,["saving"])]})),_:1},8,["content-title"]),[[l["vShow"],e.hasSuperUserAccess]])])}var Ft=Object(l["defineComponent"])({props:{dummy:String},components:{ContentBlock:r["ContentBlock"],Field:Pe["Field"],SaveButton:Pe["SaveButton"]},data:function(){var e=new Date,t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds()),n=pt.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;Xe.init(),We.init(),pt.init(),Object(l["watch"])((function(){return pt.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(",")})),r["AjaxHelper"].fetch({method:"API.getIpFromHeader"}).then((function(t){e.currentIpAddress=t.value}))},methods:{saveGlobalSettings:function(){var e=this;this.isSaving=!0,pt.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(){r["Matomo"].helper.redirect({showaddsite:!1})})).finally((function(){e.isSaving=!1}))}},computed:{isLoading:function(){return pt.isLoading.value||We.isLoading.value||Xe.isLoading.value},timezones:function(){return We.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 Xe.currencies.value},hasSuperUserAccess:function(){return r["Matomo"].hasSuperUserAccess},yourCurrentIpAddressIs:function(){return Object(r["translate"])("SitesManager_YourCurrentIpAddressIs","<i>".concat(this.currentIpAddress,"</i>"))},timezoneSupportEnabled:function(){return We.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(r["format"])(this.utcTime)," ").concat(n,":").concat(a,":").concat(i)},keepUrlFragmentHelp:function(){return Object(r["translate"])("SitesManager_KeepURLFragmentsHelp","<em>#</em>","<em>example.org/index.html#first_section</em>","<em>example.org/index.html</em>")},searchCategoryParamsInlineHelp:function(){var e=[Object(r["translate"])("Goals_Optional"),Object(r["translate"])("SitesManager_SearchCategoryDesc"),Object(r["translate"])("SitesManager_SearchCategoryParametersDesc")];return e.join(" ")}}});Ft.render=Ht;var Rt=Ft; + */Object(r["createAngularJsAdapter"])({component:mt,scope:{},directiveName:"matomoSitesManagement"});window.angular.module("piwikApp").factory("sitesManagerAPI",(function(){return{}}));var pt={class:"SitesManager"},ht=Object(l["createElementVNode"])("a",{name:"globalSettings",id:"globalSettings"},null,-1),gt={id:"excludedIpsGlobalHelp",class:"inline-help-node"},ft=Object(l["createElementVNode"])("br",null,null,-1),St=Object(l["createElementVNode"])("br",null,null,-1),jt=["innerHTML"],Ot={id:"excludedQueryParametersGlobalHelp",class:"inline-help-node"},vt=Object(l["createElementVNode"])("br",null,null,-1),yt=Object(l["createElementVNode"])("br",null,null,-1),Et={id:"excludedUserAgentsGlobalHelp",class:"inline-help-node"},Nt=Object(l["createElementVNode"])("br",null,null,-1),Vt=Object(l["createElementVNode"])("br",null,null,-1),xt={id:"excludedReferrersGlobalHelp",class:"inline-help-node"},Tt=Object(l["createElementVNode"])("br",null,null,-1),Mt=Object(l["createElementVNode"])("br",null,null,-1),wt=Object(l["createElementVNode"])("br",null,null,-1),Ct=Object(l["createElementVNode"])("br",null,null,-1),At=Object(l["createElementVNode"])("br",null,null,-1),_t={id:"timezoneHelp",class:"inline-help-node"},Pt={key:0},Gt=Object(l["createElementVNode"])("br",null,null,-1),Dt=Object(l["createElementVNode"])("br",null,null,-1),kt={id:"keepURLFragmentsHelp",class:"inline-help-node"},Ut=["innerHTML"],Lt={class:"alert alert-info"};function zt(e,t,n,a,i,r){var o=Object(l["resolveComponent"])("Field"),s=Object(l["resolveComponent"])("SaveButton"),c=Object(l["resolveComponent"])("ContentBlock");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",pt,[Object(l["withDirectives"])(Object(l["createVNode"])(c,{"content-title":e.translate("SitesManager_GlobalWebsitesSettings")},{default:Object(l["withCtx"])((function(){return[ht,Object(l["createElementVNode"])("div",gt,[Object(l["createElementVNode"])("div",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_HelpExcludedIpAddresses","1.2.3.4/24","1.2.3.*","1.2.*.*"))+" ",1),ft,St,Object(l["createElementVNode"])("span",{innerHTML:e.$sanitize(e.yourCurrentIpAddressIs)},null,8,jt)])]),Object(l["createElementVNode"])("div",Ot,[Object(l["createElementVNode"])("div",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_ListOfQueryParametersToExclude","/^sess.*|.*[dD]ate$/"))+" ",1),vt,yt,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_PiwikWillAutomaticallyExcludeCommonSessionParameters","phpsessid, sessionid, ...")),1)])]),Object(l["createElementVNode"])("div",Et,[Object(l["createElementVNode"])("div",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp1"))+" ",1),Nt,Vt,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_GlobalListExcludedUserAgents_Desc"))+" "+Object(l["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp2"))+" "+Object(l["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp3","/bot|spider|crawl|scanner/i")),1)])]),Object(l["createElementVNode"])("div",xt,[Object(l["createElementVNode"])("div",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelp"))+" ",1),Tt,Mt,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpDetails"))+" ",1),wt,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpExamples","www.example.org","http://example.org/mypath","https://www.example.org/?param=1","https://sub.example.org/"))+" ",1),Ct,At,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpSubDomains",".sub.example.org","http://sub.example.org/mypath","https://new.sub.example.org/")),1)])]),Object(l["createElementVNode"])("div",_t,[Object(l["createElementVNode"])("div",null,[e.timezoneSupportEnabled?Object(l["createCommentVNode"])("",!0):(Object(l["openBlock"])(),Object(l["createElementBlock"])("span",Pt,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(e.translate("SitesManager_AdvancedTimezoneSupportNotFound"))+" ",1),Gt])),Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_UTCTimeIs",e.utcTimeDate))+" ",1),Dt,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward")),1)])]),Object(l["createElementVNode"])("div",kt,[Object(l["createElementVNode"])("div",{innerHTML:e.$sanitize(e.keepUrlFragmentHelp)},null,8,Ut),Object(l["createElementVNode"])("div",null,Object(l["toDisplayString"])(e.translate("SitesManager_KeepURLFragmentsHelp2")),1)]),Object(l["createElementVNode"])("div",null,[Object(l["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(l["createElementVNode"])("div",null,[Object(l["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(l["createElementVNode"])("div",null,[Object(l["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(l["createElementVNode"])("div",null,[Object(l["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(l["createElementVNode"])("div",null,[Object(l["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(l["createElementVNode"])("h3",null,Object(l["toDisplayString"])(e.translate("SitesManager_TrackingSiteSearch")),1),Object(l["createElementVNode"])("p",null,Object(l["toDisplayString"])(e.translate("SitesManager_SiteSearchUse")),1),Object(l["createElementVNode"])("div",Lt,Object(l["toDisplayString"])(e.translate("SitesManager_SearchParametersNote"))+" "+Object(l["toDisplayString"])(e.translate("SitesManager_SearchParametersNote2")),1),Object(l["createElementVNode"])("div",null,[Object(l["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(l["createElementVNode"])("div",null,[Object(l["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(l["createElementVNode"])("div",null,[Object(l["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(l["createElementVNode"])("div",null,[Object(l["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(l["createVNode"])(s,{saving:e.isSaving,onConfirm:t[9]||(t[9]=function(t){return e.saveGlobalSettings()})},null,8,["saving"])]})),_:1},8,["content-title"]),[[l["vShow"],e.hasSuperUserAccess]])])}var It=Object(l["defineComponent"])({props:{dummy:String},components:{ContentBlock:r["ContentBlock"],Field:Ae["Field"],SaveButton:Ae["SaveButton"]},data:function(){var e=new Date,t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds()),n=dt.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;$e.init(),Fe.init(),dt.init(),Object(l["watch"])((function(){return dt.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(",")})),r["AjaxHelper"].fetch({method:"API.getIpFromHeader"}).then((function(t){e.currentIpAddress=t.value}))},methods:{saveGlobalSettings:function(){var e=this;this.isSaving=!0,dt.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(){r["Matomo"].helper.redirect({showaddsite:!1})})).finally((function(){e.isSaving=!1}))}},computed:{isLoading:function(){return dt.isLoading.value||Fe.isLoading.value||$e.isLoading.value},timezones:function(){return Fe.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 $e.currencies.value},hasSuperUserAccess:function(){return r["Matomo"].hasSuperUserAccess},yourCurrentIpAddressIs:function(){return Object(r["translate"])("SitesManager_YourCurrentIpAddressIs","<i>".concat(this.currentIpAddress,"</i>"))},timezoneSupportEnabled:function(){return Fe.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(r["format"])(this.utcTime)," ").concat(n,":").concat(a,":").concat(i)},keepUrlFragmentHelp:function(){return Object(r["translate"])("SitesManager_KeepURLFragmentsHelp","<em>#</em>","<em>example.org/index.html#first_section</em>","<em>example.org/index.html</em>")},searchCategoryParamsInlineHelp:function(){var e=[Object(r["translate"])("Goals_Optional"),Object(r["translate"])("SitesManager_SearchCategoryDesc"),Object(r["translate"])("SitesManager_SearchCategoryParametersDesc")];return e.join(" ")}}});It.render=zt;var Bt=It; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */Object(r["createAngularJsAdapter"])({component:Rt,scope:{},directiveName:"matomoGlobalSettings"})}})})); + */Object(r["createAngularJsAdapter"])({component:Bt,scope:{},directiveName:"matomoGlobalSettings"})}})})); //# sourceMappingURL=SitesManager.umd.min.js.map
\ No newline at end of file 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); }); |