diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2022-07-28 10:23:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-28 10:23:18 +0300 |
commit | 7ec141f6bfa845b98659a3f29af0531618953794 (patch) | |
tree | d79d48dca4d4cb8146512a19a766b47178455d2a /plugins/SitesManager | |
parent | 1869d8c8dae99be2fabd7b98f0e048bc8712e590 (diff) |
[Vue] Remove use of angularjs from SitesManager plugin (#19390)
* Remove use of angularjs from SitesManager plugin and add VueEntryContainer for more convenient embedding of vue-entry use from within other Vue components (primarily for supporting twig Template... events in Vue).
* forgot to export
* built vue files
* fix ui test issues
* remove use of unneeded html_attr escape
Co-authored-by: sgiehl <stefan@matomo.org>
Diffstat (limited to 'plugins/SitesManager')
13 files changed, 391 insertions, 381 deletions
diff --git a/plugins/SitesManager/SitesManager.php b/plugins/SitesManager/SitesManager.php index a43ed32813..05cdc7d8ca 100644 --- a/plugins/SitesManager/SitesManager.php +++ b/plugins/SitesManager/SitesManager.php @@ -464,6 +464,12 @@ class SitesManager extends \Piwik\Plugin $translationKeys[] = "SitesManager_JsTrackingTagHelp"; $translationKeys[] = "SitesManager_SiteWithoutDataSinglePageApplication"; $translationKeys[] = "SitesManager_SiteWithoutDataSinglePageApplicationDescription"; + $translationKeys[] = 'SitesManager_SiteWithoutDataTitle'; + $translationKeys[] = 'SitesManager_SiteWithoutDataDescription'; + $translationKeys[] = 'SitesManager_SiteWithoutDataMessageDisappears'; + $translationKeys[] = 'SitesManager_SiteWithoutDataChoosePreferredWay'; + $translationKeys[] = 'SitesManager_DetectingYourSite'; + $translationKeys[] = 'SitesManager_SiteWithoutDataIgnoreMessage'; $translationKeys[] = "SitesManager_GlobalListExcludedReferrers"; $translationKeys[] = "SitesManager_GlobalListExcludedReferrersDesc"; $translationKeys[] = "SitesManager_ExcludedReferrers"; @@ -471,5 +477,6 @@ class SitesManager extends \Piwik\Plugin $translationKeys[] = "SitesManager_ExcludedReferrersHelpDetails"; $translationKeys[] = "SitesManager_ExcludedReferrersHelpExamples"; $translationKeys[] = "SitesManager_ExcludedReferrersHelpSubDomains"; + $translationKeys[] = 'Goals_Optional'; } } diff --git a/plugins/SitesManager/templates/_displayJavascriptCode.twig b/plugins/SitesManager/templates/_displayJavascriptCode.twig index d2dabea355..dc8b116d3a 100644 --- a/plugins/SitesManager/templates/_displayJavascriptCode.twig +++ b/plugins/SitesManager/templates/_displayJavascriptCode.twig @@ -1,7 +1,7 @@ <div class="trackingHelpHeader"> <h2>{{ 'SitesManager_TrackingTags'|translate(displaySiteName) }}</h2> <a class="btn" - href="mailto:?subject={{ 'SitesManager_EmailInstructionsSubject'|translate|url_encode|e('html_attr') }}&body={{ emailBody|url_encode|e('html_attr') }}"> + href="mailto:?subject={{ 'SitesManager_EmailInstructionsSubject'|translate|url_encode }}&body={{ emailBody|url_encode }}"> {{ 'SitesManager_EmailInstructionsButton'|translate }} </a> </div> @@ -15,7 +15,7 @@ <p>{{ 'CoreAdminHome_JSTracking_CodeNoteBeforeClosingHead'|translate("</head>")|raw }}</p> - <pre piwik-select-on-focus>{{ jsTag|raw }}</pre> + <pre vue-directive="CoreHome.SelectOnFocus">{{ jsTag|raw }}</pre> <p>{{ 'CoreAdminHome_JSTrackingIntro5'|translate('<a rel="noreferrer noopener" target="_blank" href="https://developer.matomo.org/guides/tracking-javascript-guide">','</a>')|raw }}</p> diff --git a/plugins/SitesManager/templates/_siteWithoutDataTabs.twig b/plugins/SitesManager/templates/_siteWithoutDataTabs.twig index 5604415723..ff82596f22 100644 --- a/plugins/SitesManager/templates/_siteWithoutDataTabs.twig +++ b/plugins/SitesManager/templates/_siteWithoutDataTabs.twig @@ -41,8 +41,8 @@ <p>{{ 'CoreAdminHome_JSTrackingIntro3b'|translate|raw }}</p> <br> <p>{{ 'SitesManager_ExtraInformationNeeded'|translate }}</p> - <p>Matomo URL: <code piwik-select-on-focus>{{ piwikUrl }}</code></p> - <p>{{ 'SitesManager_EmailInstructionsYourSiteId'|translate('<code piwik-select-on-focus>' ~ idSite ~ '</code>')|raw }}</p> + <p>Matomo URL: <code vue-directive="CoreHome.SelectOnFocus">{{ piwikUrl }}</code></p> + <p>{{ 'SitesManager_EmailInstructionsYourSiteId'|translate('<code vue-directive="CoreHome.SelectOnFocus">' ~ idSite ~ '</code>')|raw }}</p> {% endif %} </div> @@ -51,7 +51,7 @@ <p>{{ 'CoreAdminHome_JSTracking_CodeNoteBeforeClosingHead'|translate("</head>")|raw }}</p> - <pre piwik-select-on-focus>{{ jsTag|raw }}</pre> + <pre vue-directive="CoreHome.SelectOnFocus">{{ jsTag|raw }}</pre> <p>{{ 'CoreAdminHome_JSTrackingIntro5'|translate('<a rel="noreferrer noopener" target="_blank" href="https://developer.matomo.org/guides/tracking-javascript-guide">','</a>')|raw }}</p> diff --git a/plugins/SitesManager/templates/globalSettings.twig b/plugins/SitesManager/templates/globalSettings.twig index 915e5b9743..f8c0c94c5b 100644 --- a/plugins/SitesManager/templates/globalSettings.twig +++ b/plugins/SitesManager/templates/globalSettings.twig @@ -4,6 +4,6 @@ {% block content %} - <div matomo-global-settings></div> + <div vue-entry="SitesManager.ManageGlobalSettings"></div> {% endblock %} diff --git a/plugins/SitesManager/templates/index.twig b/plugins/SitesManager/templates/index.twig index a611f03fa7..f4a0e9e4e6 100644 --- a/plugins/SitesManager/templates/index.twig +++ b/plugins/SitesManager/templates/index.twig @@ -4,6 +4,6 @@ {% block content %} - <div matomo-sites-management></div> + <div vue-entry="SitesManager.SitesManagement"></div> {% endblock %} diff --git a/plugins/SitesManager/templates/siteWithoutData.twig b/plugins/SitesManager/templates/siteWithoutData.twig index 8193fac0ce..1115a07076 100644 --- a/plugins/SitesManager/templates/siteWithoutData.twig +++ b/plugins/SitesManager/templates/siteWithoutData.twig @@ -25,33 +25,15 @@ </script> <div class="site-without-data"> - <div piwik-content-block content-title="{{ 'SitesManager_SiteWithoutDataTitle'|translate|e('html_attr') }} 🚀"> - - <p> </p> - <p>{{ 'SitesManager_SiteWithoutDataDescription'|translate('<a href="mailto:?subject=' ~ 'SitesManager_EmailInstructionsSubject'|translate|url_encode|e('html_attr') ~ '&body=' ~ emailBody|url_encode|e('html_attr') ~ '">', '</a>')|raw }}</p> - <p>{{ 'SitesManager_SiteWithoutDataMessageDisappears'|translate }}</p> - - <h3>{{ 'SitesManager_SiteWithoutDataChoosePreferredWay'|translate }}</h3> - - <div piwik-widget-loader='{"module":"SitesManager","action":"siteWithoutDataTabs"}' loading-message="{{ 'SitesManager_DetectingYourSite'|translate|e('html_attr') }}..."></div> - - <hr> - - <a class="btn" id="emailTrackingCodeBtn" - href="mailto:?subject={{ 'SitesManager_EmailInstructionsSubject'|translate|url_encode|e('html_attr') }}&body={{ emailBody|url_encode|e('html_attr') }}" - >{{ 'SitesManager_EmailInstructionsButton'|translate }}</a> - - {{ postEvent('Template.siteWithoutData.afterIntro') }} - <br /> - <br /> - <a href="{{ linkTo({module: 'SitesManager', action: 'ignoreNoDataMessage'}) }}" - class="btn ignoreSitesWithoutData" - > - {{ 'SitesManager_SiteWithoutDataIgnoreMessage'|translate }} - </a> - </div> - - {{ postEvent('Template.siteWithoutData.afterTrackingHelp') }} + {% set afterIntroEventContent %}{{ postEvent('Template.siteWithoutData.afterIntro') }}{% endset %} + {% set afterTrackingHelpEventContent %}{{ postEvent('Template.siteWithoutData.afterTrackingHelp') }}{% endset %} + + <div + vue-entry="SitesManager.SiteWithoutData" + email-body="{{ emailBody|json_encode }}" + after-intro-event-content="{{ afterIntroEventContent|json_encode }}" + after-tracking-help-event-content="{{ afterTrackingHelpEventContent|json_encode }}" + ></div> </div> {% endblock %} diff --git a/plugins/SitesManager/vue/dist/SitesManager.umd.js b/plugins/SitesManager/vue/dist/SitesManager.umd.js index aa0ff4d137..dedc66b356 100644 --- a/plugins/SitesManager/vue/dist/SitesManager.umd.js +++ b/plugins/SitesManager/vue/dist/SitesManager.umd.js @@ -130,6 +130,7 @@ __webpack_require__.d(__webpack_exports__, "CurrencyStore", function() { return __webpack_require__.d(__webpack_exports__, "TimezoneStore", function() { return /* reexport */ src_TimezoneStore_TimezoneStore; }); __webpack_require__.d(__webpack_exports__, "SitesManagement", function() { return /* reexport */ SitesManagement; }); __webpack_require__.d(__webpack_exports__, "ManageGlobalSettings", function() { return /* reexport */ ManageGlobalSettings; }); +__webpack_require__.d(__webpack_exports__, "SiteWithoutData", function() { return /* reexport */ SiteWithoutData; }); // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js // This file is imported into lib/wc client bundles. @@ -147,12 +148,12 @@ if (typeof window !== 'undefined') { // Indicate to webpack that this file can be concatenated /* harmony default export */ var setPublicPath = (null); -// EXTERNAL MODULE: external "CoreHome" -var external_CoreHome_ = __webpack_require__("19dc"); - // EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); +// EXTERNAL MODULE: external "CoreHome" +var external_CoreHome_ = __webpack_require__("19dc"); + // CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SiteTypesStore/SiteTypesStore.ts function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -259,7 +260,15 @@ var SiteTypesStore_SiteTypesStore = /*#__PURE__*/function () { }(); /* harmony default export */ var src_SiteTypesStore_SiteTypesStore = (new SiteTypesStore_SiteTypesStore()); -// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SiteTypesStore/SiteTypesStore.adapter.ts +// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/CurrencyStore/CurrencyStore.ts +function CurrencyStore_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function CurrencyStore_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function CurrencyStore_createClass(Constructor, protoProps, staticProps) { if (protoProps) CurrencyStore_defineProperties(Constructor.prototype, protoProps); if (staticProps) CurrencyStore_defineProperties(Constructor, staticProps); return Constructor; } + +function CurrencyStore_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + /*! * Matomo - free/libre analytics platform * @@ -269,35 +278,178 @@ var SiteTypesStore_SiteTypesStore = /*#__PURE__*/function () { -function sitesManagerTypeModelAdapter() { - return { - get typesById() { - return Object(external_CoreHome_["clone"])(src_SiteTypesStore_SiteTypesStore.typesById.value); - }, +var CurrencyStore_CurrencyStore = /*#__PURE__*/function () { + function CurrencyStore() { + var _this = this; - fetchTypeById: function fetchTypeById(typeId) { - var _this = this; + CurrencyStore_classCallCheck(this, CurrencyStore); + + CurrencyStore_defineProperty(this, "privateState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({ + isLoading: false, + currencies: {} + })); + + CurrencyStore_defineProperty(this, "currencies", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_this.privateState).currencies; + })); + + CurrencyStore_defineProperty(this, "isLoading", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_this.privateState).isLoading; + })); - return src_SiteTypesStore_SiteTypesStore.fetchAvailableTypes().then(function () { - return Object(external_CoreHome_["cloneThenApply"])(_this.typesById[typeId]); + CurrencyStore_defineProperty(this, "initializePromise", null); + } + + CurrencyStore_createClass(CurrencyStore, [{ + key: "init", + value: function init() { + if (!this.initializePromise) { + this.initializePromise = this.fetchCurrencies(); + } + + return this.initializePromise; + } + }, { + key: "fetchCurrencies", + value: function fetchCurrencies() { + var _this2 = this; + + this.privateState.isLoading = true; + return external_CoreHome_["AjaxHelper"].fetch({ + method: 'SitesManager.getCurrencyList' + }).then(function (currencies) { + _this2.privateState.currencies = currencies; + }).finally(function () { + _this2.privateState.isLoading = false; }); - }, - fetchAvailableTypes: function fetchAvailableTypes() { - return src_SiteTypesStore_SiteTypesStore.fetchAvailableTypes().then(function (types) { - return Object(external_CoreHome_["cloneThenApply"])(types); + } + }]); + + return CurrencyStore; +}(); + +/* harmony default export */ var src_CurrencyStore_CurrencyStore = (new CurrencyStore_CurrencyStore()); +// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/TimezoneStore/TimezoneStore.ts +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { 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 _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function TimezoneStore_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function TimezoneStore_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function TimezoneStore_createClass(Constructor, protoProps, staticProps) { if (protoProps) TimezoneStore_defineProperties(Constructor.prototype, protoProps); if (staticProps) TimezoneStore_defineProperties(Constructor, staticProps); return Constructor; } + +function TimezoneStore_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + + + +var TimezoneStore_TimezoneStore = /*#__PURE__*/function () { + function TimezoneStore() { + var _this = this; + + TimezoneStore_classCallCheck(this, TimezoneStore); + + TimezoneStore_defineProperty(this, "privateState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({ + isLoading: false, + timezones: [], + timezoneSupportEnabled: false + })); + + TimezoneStore_defineProperty(this, "state", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_this.privateState); + })); + + TimezoneStore_defineProperty(this, "timezones", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return _this.state.value.timezones; + })); + + TimezoneStore_defineProperty(this, "timezoneSupportEnabled", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return _this.state.value.timezoneSupportEnabled; + })); + + TimezoneStore_defineProperty(this, "isLoading", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return _this.state.value.isLoading; + })); + + TimezoneStore_defineProperty(this, "initializePromise", null); + } + + TimezoneStore_createClass(TimezoneStore, [{ + key: "init", + value: function init() { + var _this2 = this; + + if (!this.initializePromise) { + this.privateState.isLoading = true; + this.initializePromise = Promise.all([this.checkTimezoneSupportEnabled(), this.fetchTimezones()]).finally(function () { + _this2.privateState.isLoading = false; + }); + } + + return this.initializePromise; + } + }, { + key: "fetchTimezones", + value: function fetchTimezones() { + var _this3 = this; + + return external_CoreHome_["AjaxHelper"].fetch({ + method: 'SitesManager.getTimezonesList' + }).then(function (grouped) { + var flattened = []; + Object.entries(grouped).forEach(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + group = _ref2[0], + timezonesGroup = _ref2[1]; + + Object.entries(timezonesGroup).forEach(function (_ref3) { + var _ref4 = _slicedToArray(_ref3, 2), + label = _ref4[0], + code = _ref4[1]; + + flattened.push({ + group: group, + label: label, + code: code + }); + }); + }); + _this3.privateState.timezones = flattened; }); - }, - hasMultipleTypes: function hasMultipleTypes() { - return src_SiteTypesStore_SiteTypesStore.fetchAvailableTypes().then(function (types) { - return types && Object.keys(types).length > 1; + } + }, { + key: "checkTimezoneSupportEnabled", + value: function checkTimezoneSupportEnabled() { + var _this4 = this; + + return external_CoreHome_["AjaxHelper"].fetch({ + method: 'SitesManager.isTimezoneSupportEnabled' + }).then(function (response) { + _this4.privateState.timezoneSupportEnabled = response.value; }); - }, - removeEditSiteIdParameterFromHash: src_SiteTypesStore_SiteTypesStore.removeEditSiteIdParameterFromHash.bind(src_SiteTypesStore_SiteTypesStore), - getEditSiteIdParameter: src_SiteTypesStore_SiteTypesStore.getEditSiteIdParameter.bind(src_SiteTypesStore_SiteTypesStore) - }; -} + } + }]); -window.angular.module('piwikApp.service').factory('sitesManagerTypeModel', sitesManagerTypeModelAdapter); + return TimezoneStore; +}(); + +/* harmony default export */ var src_TimezoneStore_TimezoneStore = (new TimezoneStore_TimezoneStore()); // 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/SitesManagement/SitesManagement.vue?vue&type=template&id=469792ff var _hoisted_1 = { @@ -887,196 +1039,6 @@ function SiteFieldsvue_type_template_id_648e955b_render(_ctx, _cache, $props, $s // EXTERNAL MODULE: external "CorePluginsAdmin" var external_CorePluginsAdmin_ = __webpack_require__("a5a2"); -// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/TimezoneStore/TimezoneStore.ts -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } - -function _nonIterableRest() { 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 _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } - -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } - -function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } - -function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } - -function TimezoneStore_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function TimezoneStore_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function TimezoneStore_createClass(Constructor, protoProps, staticProps) { if (protoProps) TimezoneStore_defineProperties(Constructor.prototype, protoProps); if (staticProps) TimezoneStore_defineProperties(Constructor, staticProps); return Constructor; } - -function TimezoneStore_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - - - -var TimezoneStore_TimezoneStore = /*#__PURE__*/function () { - function TimezoneStore() { - var _this = this; - - TimezoneStore_classCallCheck(this, TimezoneStore); - - TimezoneStore_defineProperty(this, "privateState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({ - isLoading: false, - timezones: [], - timezoneSupportEnabled: false - })); - - TimezoneStore_defineProperty(this, "state", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_this.privateState); - })); - - TimezoneStore_defineProperty(this, "timezones", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { - return _this.state.value.timezones; - })); - - TimezoneStore_defineProperty(this, "timezoneSupportEnabled", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { - return _this.state.value.timezoneSupportEnabled; - })); - - TimezoneStore_defineProperty(this, "isLoading", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { - return _this.state.value.isLoading; - })); - - TimezoneStore_defineProperty(this, "initializePromise", null); - } - - TimezoneStore_createClass(TimezoneStore, [{ - key: "init", - value: function init() { - var _this2 = this; - - if (!this.initializePromise) { - this.privateState.isLoading = true; - this.initializePromise = Promise.all([this.checkTimezoneSupportEnabled(), this.fetchTimezones()]).finally(function () { - _this2.privateState.isLoading = false; - }); - } - - return this.initializePromise; - } - }, { - key: "fetchTimezones", - value: function fetchTimezones() { - var _this3 = this; - - return external_CoreHome_["AjaxHelper"].fetch({ - method: 'SitesManager.getTimezonesList' - }).then(function (grouped) { - var flattened = []; - Object.entries(grouped).forEach(function (_ref) { - var _ref2 = _slicedToArray(_ref, 2), - group = _ref2[0], - timezonesGroup = _ref2[1]; - - Object.entries(timezonesGroup).forEach(function (_ref3) { - var _ref4 = _slicedToArray(_ref3, 2), - label = _ref4[0], - code = _ref4[1]; - - flattened.push({ - group: group, - label: label, - code: code - }); - }); - }); - _this3.privateState.timezones = flattened; - }); - } - }, { - key: "checkTimezoneSupportEnabled", - value: function checkTimezoneSupportEnabled() { - var _this4 = this; - - return external_CoreHome_["AjaxHelper"].fetch({ - method: 'SitesManager.isTimezoneSupportEnabled' - }).then(function (response) { - _this4.privateState.timezoneSupportEnabled = response.value; - }); - } - }]); - - return TimezoneStore; -}(); - -/* harmony default export */ var src_TimezoneStore_TimezoneStore = (new TimezoneStore_TimezoneStore()); -// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/CurrencyStore/CurrencyStore.ts -function CurrencyStore_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function CurrencyStore_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function CurrencyStore_createClass(Constructor, protoProps, staticProps) { if (protoProps) CurrencyStore_defineProperties(Constructor.prototype, protoProps); if (staticProps) CurrencyStore_defineProperties(Constructor, staticProps); return Constructor; } - -function CurrencyStore_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - - - -var CurrencyStore_CurrencyStore = /*#__PURE__*/function () { - function CurrencyStore() { - var _this = this; - - CurrencyStore_classCallCheck(this, CurrencyStore); - - CurrencyStore_defineProperty(this, "privateState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({ - isLoading: false, - currencies: {} - })); - - CurrencyStore_defineProperty(this, "currencies", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_this.privateState).currencies; - })); - - CurrencyStore_defineProperty(this, "isLoading", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_this.privateState).isLoading; - })); - - CurrencyStore_defineProperty(this, "initializePromise", null); - } - - CurrencyStore_createClass(CurrencyStore, [{ - key: "init", - value: function init() { - if (!this.initializePromise) { - this.initializePromise = this.fetchCurrencies(); - } - - return this.initializePromise; - } - }, { - key: "fetchCurrencies", - value: function fetchCurrencies() { - var _this2 = this; - - this.privateState.isLoading = true; - return external_CoreHome_["AjaxHelper"].fetch({ - method: 'SitesManager.getCurrencyList' - }).then(function (currencies) { - _this2.privateState.currencies = currencies; - }).finally(function () { - _this2.privateState.isLoading = false; - }); - } - }]); - - return CurrencyStore; -}(); - -/* harmony default export */ var src_CurrencyStore_CurrencyStore = (new CurrencyStore_CurrencyStore()); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/SitesManager/vue/src/SiteFields/SiteFields.vue?vue&type=script&lang=ts function SiteFieldsvue_type_script_lang_ts_slicedToArray(arr, i) { return SiteFieldsvue_type_script_lang_ts_arrayWithHoles(arr) || SiteFieldsvue_type_script_lang_ts_iterableToArrayLimit(arr, i) || SiteFieldsvue_type_script_lang_ts_unsupportedIterableToArray(arr, i) || SiteFieldsvue_type_script_lang_ts_nonIterableRest(); } @@ -1789,25 +1751,6 @@ var GlobalSettingsStore_GlobalSettingsStore = /*#__PURE__*/function () { SitesManagementvue_type_script_lang_ts.render = render /* harmony default export */ var SitesManagement = (SitesManagementvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SitesManagement/SitesManagement.adapter.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - - -/* harmony default export */ var SitesManagement_adapter = (Object(external_CoreHome_["createAngularJsAdapter"])({ - component: SitesManagement, - scope: {}, - directiveName: 'matomoSitesManagement' -})); // sitesManagerAPI no longer exists, but it is still referenced by a premium feature. the feature -// doesn't actually use it though so we can just create an empty object for an adapter. - -window.angular.module('piwikApp').factory('sitesManagerAPI', function () { - return {}; -}); // 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/ManageGlobalSettings/ManageGlobalSettings.vue?vue&type=template&id=5467128a var ManageGlobalSettingsvue_type_template_id_5467128a_hoisted_1 = { @@ -2161,20 +2104,101 @@ function ManageGlobalSettingsvue_type_template_id_5467128a_render(_ctx, _cache, ManageGlobalSettingsvue_type_script_lang_ts.render = ManageGlobalSettingsvue_type_template_id_5467128a_render /* harmony default export */ var ManageGlobalSettings = (ManageGlobalSettingsvue_type_script_lang_ts); -// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.adapter.ts -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ +// 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/SiteWithoutData/SiteWithoutData.vue?vue&type=template&id=fe787fea + + +var SiteWithoutDatavue_type_template_id_fe787fea_hoisted_1 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, " ", -1); + +var SiteWithoutDatavue_type_template_id_fe787fea_hoisted_2 = ["innerHTML"]; + +var SiteWithoutDatavue_type_template_id_fe787fea_hoisted_3 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("hr", null, null, -1); + +var SiteWithoutDatavue_type_template_id_fe787fea_hoisted_4 = ["href"]; + +var SiteWithoutDatavue_type_template_id_fe787fea_hoisted_5 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); +var SiteWithoutDatavue_type_template_id_fe787fea_hoisted_6 = ["href"]; +function SiteWithoutDatavue_type_template_id_fe787fea_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_WidgetLoader = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("WidgetLoader"); -/* harmony default export */ var ManageGlobalSettings_adapter = (Object(external_CoreHome_["createAngularJsAdapter"])({ - component: ManageGlobalSettings, - scope: {}, - directiveName: 'matomoGlobalSettings' + var _component_VueEntryContainer = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("VueEntryContainer"); + + var _component_ContentBlock = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ContentBlock"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ContentBlock, { + "content-title": "".concat(_ctx.translate('SitesManager_SiteWithoutDataTitle'), " \uD83D\uDE80") + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [SiteWithoutDatavue_type_template_id_fe787fea_hoisted_1, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", { + innerHTML: _ctx.$sanitize(_ctx.siteWithoutDataDesc) + }, null, 8, SiteWithoutDatavue_type_template_id_fe787fea_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_SiteWithoutDataMessageDisappears')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_SiteWithoutDataChoosePreferredWay')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_WidgetLoader, { + "widget-params": { + module: 'SitesManager', + action: 'siteWithoutDataTabs' + }, + "loading-message": "".concat(_ctx.translate('SitesManager_DetectingYourSite'), "...") + }, null, 8, ["loading-message"]), SiteWithoutDatavue_type_template_id_fe787fea_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + class: "btn", + id: "emailTrackingCodeBtn", + href: _ctx.emailInstructionsLink + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_EmailInstructionsButton')), 9, SiteWithoutDatavue_type_template_id_fe787fea_hoisted_4), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_VueEntryContainer, { + html: _ctx.afterIntroEventContent + }, null, 8, ["html"]), SiteWithoutDatavue_type_template_id_fe787fea_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + href: _ctx.ignoreSitesWithoutDataLink, + class: "btn ignoreSitesWithoutData" + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_SiteWithoutDataIgnoreMessage')), 9, SiteWithoutDatavue_type_template_id_fe787fea_hoisted_6)]; + }), + _: 1 + }, 8, ["content-title"]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_VueEntryContainer, { + html: _ctx.afterTrackingHelpEventContent + }, null, 8, ["html"])]); +} +// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SiteWithoutData/SiteWithoutData.vue?vue&type=template&id=fe787fea + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/SitesManager/vue/src/SiteWithoutData/SiteWithoutData.vue?vue&type=script&lang=ts + + +/* harmony default export */ var SiteWithoutDatavue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + emailBody: { + type: String, + required: true + }, + afterIntroEventContent: String, + afterTrackingHelpEventContent: String + }, + components: { + ContentBlock: external_CoreHome_["ContentBlock"], + WidgetLoader: external_CoreHome_["WidgetLoader"], + VueEntryContainer: external_CoreHome_["VueEntryContainer"] + }, + computed: { + siteWithoutDataDesc: function siteWithoutDataDesc() { + return Object(external_CoreHome_["translate"])('SitesManager_SiteWithoutDataDescription', "<a href=\"".concat(this.emailInstructionsLink, "\">"), '</a>'); + }, + emailInstructionsLink: function emailInstructionsLink() { + return "mailto:?".concat(external_CoreHome_["MatomoUrl"].stringify({ + subject: Object(external_CoreHome_["translate"])('SitesManager_EmailInstructionsSubject'), + body: this.emailBody + })); + }, + ignoreSitesWithoutDataLink: function ignoreSitesWithoutDataLink() { + return "?".concat(external_CoreHome_["MatomoUrl"].stringify(Object.assign(Object.assign({}, external_CoreHome_["MatomoUrl"].urlParsed.value), {}, { + module: 'SitesManager', + action: 'ignoreNoDataMessage' + }))); + } + } })); +// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SiteWithoutData/SiteWithoutData.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/SitesManager/vue/src/SiteWithoutData/SiteWithoutData.vue + + + +SiteWithoutDatavue_type_script_lang_ts.render = SiteWithoutDatavue_type_template_id_fe787fea_render + +/* harmony default export */ var SiteWithoutData = (SiteWithoutDatavue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/SitesManager/vue/src/index.ts /*! * Matomo - free/libre analytics platform @@ -2188,8 +2212,6 @@ ManageGlobalSettingsvue_type_script_lang_ts.render = ManageGlobalSettingsvue_typ - - // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js diff --git a/plugins/SitesManager/vue/dist/SitesManager.umd.min.js b/plugins/SitesManager/vue/dist/SitesManager.umd.min.js index dea9ca88c0..ddaf07fe5b 100644 --- a/plugins/SitesManager/vue/dist/SitesManager.umd.min.js +++ b/plugins/SitesManager/vue/dist/SitesManager.umd.min.js @@ -1,45 +1,32 @@ -(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 h})),n.d(t,"CurrencyStore",(function(){return O})),n.d(t,"TimezoneStore",(function(){return _})),n.d(t,"SitesManagement",(function(){return pt})),n.d(t,"ManageGlobalSettings",(function(){return Ft})),n.d(t,"SiteWithoutData",(function(){return Jt})),"undefined"!==typeof window){var a=window.document.currentScript,i=a&&a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var r=n("8bbf"),l=n("19dc");function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var d=window,b=d.$,m=function(){function e(){var t=this;o(this,e),u(this,"state",Object(l["reactive"])({isLoading:!1,typesById:{}})),u(this,"typesById",Object(l["computed"])((function(){return Object(l["readonly"])(t.state).typesById}))),u(this,"isLoading",Object(l["computed"])((function(){return Object(l["readonly"])(t.state).isLoading}))),u(this,"types",Object(l["computed"])((function(){return Object.values(t.typesById.value)}))),u(this,"response",void 0)}return c(e,[{key:"init",value:function(){return this.fetchAvailableTypes()}},{key:"fetchAvailableTypes",value:function(){var e=this;return this.response?Promise.resolve(this.response):(this.state.isLoading=!0,this.response=r["AjaxHelper"].fetch({method:"API.getAvailableMeasurableTypes",filter_limit:"-1"}).then((function(t){return t.forEach((function(t){e.state.typesById[t.id]=t})),e.types.value})).finally((function(){e.state.isLoading=!1})),this.response)}},{key:"getEditSiteIdParameter",value:function(){var e=r["MatomoUrl"].hashQuery.value.match(/editsiteid=([0-9]+)/);if(e){var t="1"===r["MatomoUrl"].urlParsed.value.showaddsite||"true"===r["MatomoUrl"].urlParsed.value.showaddsite,n=e[1];return n&&b.isNumeric(n)&&!t?n:void 0}}},{key:"removeEditSiteIdParameterFromHash",value:function(){var e=Object.assign({},r["MatomoUrl"].hashParsed.value);delete e.editsiteid,r["MatomoUrl"].updateHash(e)}}]),e}(),p=new m; + */var d=window,b=d.$,m=function(){function e(){var t=this;o(this,e),u(this,"state",Object(r["reactive"])({isLoading:!1,typesById:{}})),u(this,"typesById",Object(r["computed"])((function(){return Object(r["readonly"])(t.state).typesById}))),u(this,"isLoading",Object(r["computed"])((function(){return Object(r["readonly"])(t.state).isLoading}))),u(this,"types",Object(r["computed"])((function(){return Object.values(t.typesById.value)}))),u(this,"response",void 0)}return c(e,[{key:"init",value:function(){return this.fetchAvailableTypes()}},{key:"fetchAvailableTypes",value:function(){var e=this;return this.response?Promise.resolve(this.response):(this.state.isLoading=!0,this.response=l["AjaxHelper"].fetch({method:"API.getAvailableMeasurableTypes",filter_limit:"-1"}).then((function(t){return t.forEach((function(t){e.state.typesById[t.id]=t})),e.types.value})).finally((function(){e.state.isLoading=!1})),this.response)}},{key:"getEditSiteIdParameter",value:function(){var e=l["MatomoUrl"].hashQuery.value.match(/editsiteid=([0-9]+)/);if(e){var t="1"===l["MatomoUrl"].urlParsed.value.showaddsite||"true"===l["MatomoUrl"].urlParsed.value.showaddsite,n=e[1];return n&&b.isNumeric(n)&&!t?n:void 0}}},{key:"removeEditSiteIdParameterFromHash",value:function(){var e=Object.assign({},l["MatomoUrl"].hashParsed.value);delete e.editsiteid,l["MatomoUrl"].updateHash(e)}}]),e}(),h=new m;function p(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(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 f(e,t,n){return t&&g(e.prototype,t),n&&g(e,n),e}function S(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 - */ -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} + */var j=function(){function e(){var t=this;p(this,e),S(this,"privateState",Object(r["reactive"])({isLoading:!1,currencies:{}})),S(this,"currencies",Object(r["computed"])((function(){return Object(r["readonly"])(t.privateState).currencies}))),S(this,"isLoading",Object(r["computed"])((function(){return Object(r["readonly"])(t.privateState).isLoading}))),S(this,"initializePromise",null)}return f(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,l["AjaxHelper"].fetch({method:"SitesManager.getCurrencyList"}).then((function(t){e.privateState.currencies=t})).finally((function(){e.privateState.isLoading=!1}))}}]),e}(),O=new j;function v(e,t){return x(e)||V(e,t)||E(e,t)||y()}function y(){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 E(e,t){if(e){if("string"===typeof e)return N(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)?N(e,t):void 0}}function N(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 V(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 x(e){if(Array.isArray(e))return e}function T(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M(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&&M(e.prototype,t),n&&M(e,n),e}function w(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 D=function(){function e(){var t=this;T(this,e),w(this,"privateState",Object(r["reactive"])({isLoading:!1,timezones:[],timezoneSupportEnabled:!1})),w(this,"state",Object(r["computed"])((function(){return Object(r["readonly"])(t.privateState)}))),w(this,"timezones",Object(r["computed"])((function(){return t.state.value.timezones}))),w(this,"timezoneSupportEnabled",Object(r["computed"])((function(){return t.state.value.timezoneSupportEnabled}))),w(this,"isLoading",Object(r["computed"])((function(){return t.state.value.isLoading}))),w(this,"initializePromise",null)}return C(e,[{key:"init",value:function(){var e=this;return this.initializePromise||(this.privateState.isLoading=!0,this.initializePromise=Promise.all([this.checkTimezoneSupportEnabled(),this.fetchTimezones()]).finally((function(){e.privateState.isLoading=!1}))),this.initializePromise}},{key:"fetchTimezones",value:function(){var e=this;return l["AjaxHelper"].fetch({method:"SitesManager.getTimezonesList"}).then((function(t){var n=[];Object.entries(t).forEach((function(e){var t=v(e,2),a=t[0],i=t[1];Object.entries(i).forEach((function(e){var t=v(e,2),i=t[0],r=t[1];n.push({group:a,label:i,code:r})}))})),e.privateState.timezones=n}))}},{key:"checkTimezoneSupportEnabled",value:function(){var e=this;return l["AjaxHelper"].fetch({method:"SitesManager.isTimezoneSupportEnabled"}).then((function(t){e.privateState.timezoneSupportEnabled=t.value}))}}]),e}(),_=new D,G={class:"SitesManager",ref:"root"},k={class:"sites-manager-header"},A=["innerHTML"],P=Object(r["createElementVNode"])("br",null,null,-1),L=["innerHTML"],U={class:"loadingPiwik"},B=["alt"],z={class:"ui-confirm"},I={class:"center"},H=["title","onClick"],F={class:"ui-button-text"},R={class:"sitesManagerList"},W={key:0},K={class:"bottomButtonBar"};function q(e,t,n,a,i,l){var o=this,s=Object(r["resolveComponent"])("EnrichedHeadline"),c=Object(r["resolveComponent"])("ButtonBar"),u=Object(r["resolveComponent"])("MatomoDialog"),d=Object(r["resolveComponent"])("SiteFields"),b=Object(r["resolveDirective"])("content-intro");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",G,[Object(r["createElementVNode"])("div",k,[Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("h2",null,[Object(r["createVNode"])(s,{"help-url":"https://matomo.org/docs/manage-websites/","feature-name":e.translate("SitesManager_WebsitesManagement")},{default:Object(r["withCtx"])((function(){return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.headlineText),1)]})),_:1},8,["help-url","feature-name"])],512),[[r["vShow"],e.availableTypes.length]]),Object(r["createElementVNode"])("p",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_MainDescription"))+" ",1),Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.mainDescription)},null,8,A),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",null,[P,Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.superUserAccessMessage)},null,8,L)],512),[[r["vShow"],e.hasSuperUserAccess]])])],512),[[b]])]),Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("div",{class:Object(r["normalizeClass"])({hide_only:!e.isLoading})},[Object(r["createElementVNode"])("div",U,[Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,B),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])],2)]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(c,{"site-is-being-edited":e.isSiteBeingEdited,"has-prev":e.hasPrev,hasNext:e.hasNext,"offset-start":e.offsetStart,"offset-end":e.offsetEnd,"total-number-of-sites":e.totalNumberOfSites,"is-loading":e.isLoading,"search-term":e.searchTerm,"is-searching":!!e.activeSearchTerm,"onUpdate:searchTerm":t[0]||(t[0]=function(t){return e.searchTerm=t}),onAdd:t[1]||(t[1]=function(t){return e.addNewEntity()}),onSearch:t[2]||(t[2]=function(t){return e.searchSites(t)}),onPrev:t[3]||(t[3]=function(t){return e.previousPage()}),onNext:t[4]||(t[4]=function(t){return e.nextPage()})},null,8,["site-is-being-edited","has-prev","hasNext","offset-start","offset-end","total-number-of-sites","is-loading","search-term","is-searching"])]),Object(r["createVNode"])(u,{modelValue:e.showAddSiteDialog,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.showAddSiteDialog=t})},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("div",z,[Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("SitesManager_ChooseMeasurableTypeHeadline")),1),Object(r["createElementVNode"])("div",I,[Object(r["createElementVNode"])("p",null,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.availableTypes,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("button",{type:"button",key:t.id,title:t.description,class:"modal-close btn",style:{"margin-left":"20px"},onClick:function(n){e.addSite(t.id)},"aria-disabled":"false"},[Object(r["createElementVNode"])("span",F,Object(r["toDisplayString"])(t.name),1)],8,H)})),128))])])])])]})),_:1},8,["modelValue"]),Object(r["createElementVNode"])("div",R,[e.activeSearchTerm&&0===e.sites.length&&!e.isLoading?(Object(r["openBlock"])(),Object(r["createElementBlock"])("p",W,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_NotFound"))+" ",1),Object(r["createElementVNode"])("strong",null,Object(r["toDisplayString"])(e.activeSearchTerm),1)])):Object(r["createCommentVNode"])("",!0),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sites,(function(n,a){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{key:n.idsite},[Object(r["createVNode"])(d,{site:n,"timezone-support-enabled":e.timezoneSupportEnabled,"utc-time":e.utcTime,"global-settings":e.globalSettings,onEditSite:t[6]||(t[6]=function(e){return o.isSiteBeingEdited=!0}),onCancelEditSite:t[7]||(t[7]=function(t){return e.afterCancelEdit(t)}),onDelete:t[8]||(t[8]=function(t){return e.afterDelete(t)}),onSave:function(t){return e.afterSave(t.site,t.settingValues,a,t.isNew)}},null,8,["site","timezone-support-enabled","utc-time","global-settings","onSave"])])})),128))]),Object(r["createElementVNode"])("div",K,[Object(r["createVNode"])(c,{"site-is-being-edited":e.isSiteBeingEdited,"has-prev":e.hasPrev,hasNext:e.hasNext,"offset-start":e.offsetStart,"offset-end":e.offsetEnd,"total-number-of-sites":e.totalNumberOfSites,"is-loading":e.isLoading,"search-term":e.searchTerm,"is-searching":!!e.activeSearchTerm,"onUpdate:searchTerm":t[9]||(t[9]=function(t){return e.searchTerm=t}),onAdd:t[10]||(t[10]=function(t){return e.addNewEntity()}),onSearch:t[11]||(t[11]=function(t){return e.searchSites(t)}),onPrev:t[12]||(t[12]=function(t){return e.previousPage()}),onNext:t[13]||(t[13]=function(t){return e.nextPage()})},null,8,["site-is-being-edited","has-prev","hasNext","offset-start","offset-end","total-number-of-sites","is-loading","search-term","is-searching"])])],512)}var Q={class:"sitesButtonBar clearfix"},$={class:"search"},Y=["value","placeholder","disabled"],X=["title"],J={class:"paging"},Z=["disabled"],ee={style:{cursor:"pointer"}},te={class:"counter"},ne=["disabled"],ae={style:{cursor:"pointer"},class:"pointer"};function ie(e,t,n,a,i,l){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Q,[Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:Object(r["normalizeClass"])(["btn addSite",{disabled:e.siteIsBeingEdited}]),onClick:t[0]||(t[0]=function(t){return e.addNewEntity()}),tabindex:"1"},Object(r["toDisplayString"])(e.availableTypes.length>1?e.translate("SitesManager_AddMeasurable"):e.translate("SitesManager_AddSite")),3),[[r["vShow"],e.hasSuperUserAccess&&e.availableTypes]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",$,[Object(r["createElementVNode"])("input",{value:e.searchTerm,onKeydown:t[1]||(t[1]=function(t){return e.onKeydown(t)}),placeholder:e.translate("Actions_SubmenuSitesearch"),type:"text",disabled:e.siteIsBeingEdited},null,40,Y),Object(r["createElementVNode"])("img",{onClick:t[2]||(t[2]=function(t){return e.searchSite()}),title:e.translate("General_ClickToSearch"),class:"search_ico",src:"plugins/Morpheus/images/search_ico.png"},null,8,X)],512),[[r["vShow"],e.hasPrev||e.hasNext||e.isSearching]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",J,[Object(r["createElementVNode"])("a",{class:"btn prev",disabled:!(e.hasPrev&&!e.isLoading&&!e.siteIsBeingEdited)||void 0,onClick:t[3]||(t[3]=function(t){return e.previousPage()})},[Object(r["createElementVNode"])("span",ee,"« "+Object(r["toDisplayString"])(e.translate("General_Previous")),1)],8,Z),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",te,[Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(e.paginationText),1)],512),[[r["vShow"],e.hasPrev||e.hasNext]]),Object(r["createElementVNode"])("a",{class:"btn next",disabled:!(e.hasNext&&!e.isLoading&&!e.siteIsBeingEdited)||void 0,onClick:t[4]||(t[4]=function(t){return e.nextPage()})},[Object(r["createElementVNode"])("span",ae,Object(r["toDisplayString"])(e.translate("General_Next"))+" »",1)],8,ne)],512),[[r["vShow"],e.hasPrev||e.hasNext]])])}var re=Object(r["defineComponent"])({props:{siteIsBeingEdited:{type:Boolean,required:!0},hasPrev:{type:Boolean,required:!0},hasNext:{type:Boolean,required:!0},offsetStart:{type:Number,required:!0},offsetEnd:{type:Number,required:!0},totalNumberOfSites:{type:Number},isLoading:{type:Boolean,required:!0},searchTerm:{type:String,required:!0},isSearching:{type:Boolean,required:!0}},emits:["add","search","prev","next","update:searchTerm"],created:function(){h.init(),this.onKeydown=Object(l["debounce"])(this.onKeydown,50)},computed:{hasSuperUserAccess:function(){return l["Matomo"].hasSuperUserAccess},availableTypes:function(){return h.types.value},paginationText:function(){var e;return e=this.isSearching?Object(l["translate"])("General_PaginationWithoutTotal","".concat(this.offsetStart),"".concat(this.offsetEnd)):Object(l["translate"])("General_Pagination","".concat(this.offsetStart),"".concat(this.offsetEnd),null===this.totalNumberOfSites?"?":"".concat(this.totalNumberOfSites))," ".concat(e," ")}},methods:{addNewEntity:function(){this.$emit("add")},searchSite:function(){this.siteIsBeingEdited||this.$emit("search")},previousPage:function(){this.$emit("prev")},nextPage:function(){this.$emit("next")},onKeydown:function(e){var t=this;setTimeout((function(){"Enter"!==e.key?t.$emit("update:searchTerm",e.target.value):t.searchSiteOnEnter(e)}))},searchSiteOnEnter:function(e){e.preventDefault(),this.searchSite()}}});re.render=ie;var le=re,oe=["idsite","type"],se={class:"card-content"},ce={key:0,class:"row"},ue={class:"col m3"},de={class:"title"},be={class:"title"},me=["target","title","href"],he={class:"col m4"},pe={class:"title"},ge={class:"title"},fe={class:"title"},Se={class:"title"},je={class:"col m4"},Oe={class:"title"},ve=Object(r["createTextVNode"])(": "),ye=["href"],Ee={key:0},Ne={class:"title"},Ve={key:1},xe={class:"title"},Te={key:2},Me={class:"title"},Ce={class:"col m1 text-right"},we=["title"],De=Object(r["createElementVNode"])("span",{class:"icon-edit"},null,-1),_e=[De],Ge=["title"],ke=Object(r["createElementVNode"])("span",{class:"icon-delete"},null,-1),Ae=[ke],Pe={key:1},Le={class:"form-group row"},Ue={class:"col s12 m6 input-field"},Be=["placeholder"],ze=Object(r["createElementVNode"])("div",{class:"col s12 m6"},null,-1),Ie={id:"timezoneHelpText",class:"inline-help-node"},He={key:0},Fe=Object(r["createElementVNode"])("br",null,null,-1),Re=Object(r["createElementVNode"])("br",null,null,-1),We={class:"editingSiteFooter"},Ke=["value"],qe={class:"ui-confirm"},Qe=["value"],$e=["value"];function Ye(e,t,n,a,i,l){var o,s,c,u=this,d=Object(r["resolveComponent"])("ActivityIndicator"),b=Object(r["resolveComponent"])("GroupedSettings"),m=Object(r["resolveComponent"])("Field"),h=Object(r["resolveComponent"])("MatomoDialog");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{class:Object(r["normalizeClass"])(["site card hoverable",{editingSite:!!e.editMode}]),idsite:e.theSite.idsite,type:e.theSite.type,ref:"root"},[Object(r["createElementVNode"])("div",se,[e.editMode?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",ce,[Object(r["createElementVNode"])("div",ue,[Object(r["createElementVNode"])("h4",null,Object(r["toDisplayString"])(e.theSite.name),1),Object(r["createElementVNode"])("ul",null,[Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("span",de,Object(r["toDisplayString"])(e.translate("General_Id"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.theSite.idsite),1)]),Object(r["withDirectives"])(Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("span",be,Object(r["toDisplayString"])(e.translate("SitesManager_Type"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.currentType.name),1)],512),[[r["vShow"],e.availableTypes.length>1]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("a",{target:e.isInternalSetupUrl?"_self":"_blank",title:e.translate("SitesManager_ShowTrackingTag"),href:e.setupUrl},Object(r["toDisplayString"])(e.translate("SitesManager_ShowTrackingTag")),9,me)],512),[[r["vShow"],e.theSite.idsite&&e.howToSetupUrl]])])]),Object(r["createElementVNode"])("div",he,[Object(r["createElementVNode"])("ul",null,[Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("span",pe,Object(r["toDisplayString"])(e.translate("SitesManager_Timezone"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.theSite.timezone_name),1)]),Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("span",ge,Object(r["toDisplayString"])(e.translate("SitesManager_Currency"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.theSite.currency_name),1)]),Object(r["withDirectives"])(Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("span",fe,Object(r["toDisplayString"])(e.translate("Goals_Ecommerce"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_Yes")),1)],512),[[r["vShow"],1===e.theSite.ecommerce||"1"===e.theSite.ecommerce]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("span",Se,Object(r["toDisplayString"])(e.translate("Actions_SubmenuSitesearch"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_Yes")),1)],512),[[r["vShow"],1===e.theSite.sitesearch||"1"===e.theSite.sitesearch]])])]),Object(r["createElementVNode"])("div",je,[Object(r["createElementVNode"])("ul",null,[Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("span",Oe,Object(r["toDisplayString"])(e.translate("SitesManager_Urls")),1),ve,(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.theSite.alias_urls,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:t},[Object(r["createElementVNode"])("a",{target:"_blank",rel:"noreferrer noopener",href:t},Object(r["toDisplayString"])(t)+Object(r["toDisplayString"])(n===e.theSite.alias_urls.length-1?"":", "),9,ye)])})),128))]),null!==(o=e.theSite.excluded_ips)&&void 0!==o&&o.length?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",Ee,[Object(r["createElementVNode"])("span",Ne,Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedIps"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.theSite.excluded_ips.split(/\s*,\s*/g).join(", ")),1)])):Object(r["createCommentVNode"])("",!0),null!==(s=e.theSite.excluded_parameters)&&void 0!==s&&s.length?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",Ve,[Object(r["createElementVNode"])("span",xe,Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedParameters"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.theSite.excluded_parameters.split(/\s*,\s*/g).join(", ")),1)])):Object(r["createCommentVNode"])("",!0),null!==(c=e.theSite.excluded_user_agents)&&void 0!==c&&c.length?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",Te,[Object(r["createElementVNode"])("span",Me,Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedUserAgents"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.theSite.excluded_user_agents.split(/\s*,\s*/g).join(", ")),1)])):Object(r["createCommentVNode"])("",!0)])]),Object(r["createElementVNode"])("div",Ce,[Object(r["createElementVNode"])("ul",null,[Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("button",{class:"table-action",onClick:t[0]||(t[0]=function(t){return e.editSite()}),title:e.translate("General_Edit")},_e,8,we)]),Object(r["createElementVNode"])("li",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("button",{class:"table-action",onClick:t[1]||(t[1]=function(e){return u.showRemoveDialog=!0}),title:e.translate("General_Delete")},Ae,8,Ge),[[r["vShow"],e.theSite.idsite]])])])])])),e.editMode?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Pe,[Object(r["createElementVNode"])("div",Le,[Object(r["createElementVNode"])("div",Ue,[Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[2]||(t[2]=function(t){return e.theSite.name=t}),maxlength:"90",placeholder:e.translate("General_Name")},null,8,Be),[[r["vModelText"],e.theSite.name]]),Object(r["createElementVNode"])("label",null,Object(r["toDisplayString"])(e.translate("General_Name")),1)]),ze]),Object(r["createVNode"])(d,{loading:e.isLoading},null,8,["loading"]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.measurableSettings,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{key:t.pluginName},[Object(r["createVNode"])(b,{"group-name":t.pluginName,settings:t.settings,"all-setting-values":e.settingValues,onChange:function(n){return e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}},null,8,["group-name","settings","all-setting-values","onChange"])])})),128)),Object(r["createVNode"])(m,{uicontrol:"select",name:"currency",modelValue:e.theSite.currency,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.theSite.currency=t}),title:e.translate("SitesManager_Currency"),"inline-help":e.translate("SitesManager_CurrencySymbolWillBeUsedForGoals"),options:e.currencies},null,8,["modelValue","title","inline-help","options"]),Object(r["createVNode"])(m,{uicontrol:"select",name:"timezone",modelValue:e.theSite.timezone,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.theSite.timezone=t}),title:e.translate("SitesManager_Timezone"),"inline-help":"#timezoneHelpText",options:e.timezones},null,8,["modelValue","title","options"]),Object(r["createElementVNode"])("div",Ie,[Object(r["createElementVNode"])("div",null,[e.timezoneSupportEnabled?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",He,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_AdvancedTimezoneSupportNotFound"))+" ",1),Fe])),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.utcTimeIs)+" ",1),Re,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward")),1)])]),Object(r["createElementVNode"])("div",We,[Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{type:"submit",class:"btn",value:e.translate("General_Save"),onClick:t[5]||(t[5]=function(t){return e.saveSite()})},null,8,Ke),[[r["vShow"],!e.isLoading]]),Object(r["createElementVNode"])("button",{class:"btn btn-link",onClick:t[6]||(t[6]=function(t){return e.cancelEditSite(e.site)})},Object(r["toDisplayString"])(e.translate("General_Cancel","","")),1)])])):Object(r["createCommentVNode"])("",!0)]),Object(r["createVNode"])(h,{modelValue:e.showRemoveDialog,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.showRemoveDialog=t}),onYes:t[8]||(t[8]=function(t){return e.deleteSite()})},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("div",qe,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.removeDialogTitle),1),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("SitesManager_DeleteSiteExplanation")),1),Object(r["createElementVNode"])("input",{type:"button",value:e.translate("General_Yes"),role:"yes"},null,8,Qe),Object(r["createElementVNode"])("input",{type:"button",value:e.translate("General_No"),role:"no"},null,8,$e)])]})),_:1},8,["modelValue"])],10,oe)}var Xe=n("a5a2");function Je(e,t){return at(e)||nt(e,t)||et(e,t)||Ze()}function Ze(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function et(e,t){if(e){if("string"===typeof e)return tt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tt(e,t):void 0}}function tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function nt(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,i,r=[],l=!0,o=!1;try{for(n=n.call(e);!(l=(a=n.next()).done);l=!0)if(r.push(a.value),t&&r.length===t)break}catch(s){o=!0,i=s}finally{try{l||null==n["return"]||n["return"]()}finally{if(o)throw i}}return r}}function at(e){if(Array.isArray(e))return e}var it=Object(r["computed"])((function(){return _.timezones.value.map((function(e){var t=e.group,n=e.label,a=e.code;return{group:t,key:n,value:a}}))}));function rt(e){return"undefined"===typeof e.idsite}var lt=Object(r["defineComponent"])({props:{site:{type:Object,required:!0},timezoneSupportEnabled:{type:Boolean},utcTime:{type:Date,required:!0},globalSettings:{type:Object,required:!0}},data:function(){return{isLoading:!1,editMode:!1,theSite:Object.assign({},this.site),measurableSettings:[],settingValues:{},showRemoveDialog:!1}},components:{MatomoDialog:l["MatomoDialog"],Field:Xe["Field"],GroupedSettings:Xe["GroupedSettings"],ActivityIndicator:l["ActivityIndicator"]},emits:["delete","editSite","cancelEditSite","save"],created:function(){O.init(),_.init(),h.init(),this.onSiteChanged()},watch:{site:function(){this.onSiteChanged()},measurableSettings:function(e){if(e.length){var t={};e.forEach((function(e){e.settings.forEach((function(n){t["".concat(e.pluginName,".").concat(n.name)]=n.value}))})),this.settingValues=t}}},methods:{onSiteChanged:function(){var e=this.site;this.theSite=Object.assign({},e);var t=rt(e);if(t){var n=this.globalSettings;this.theSite.timezone=n.defaultTimezone,this.theSite.currency=n.defaultCurrency}var a=h.getEditSiteIdParameter();(t||a&&"".concat(e.idsite)===a)&&this.editSite()},editSite:function(){var e=this;if(this.editMode=!0,this.$emit("editSite",{idSite:this.theSite.idsite}),this.measurableSettings=[],rt(this.theSite)){if(!this.currentType)return;this.measurableSettings=this.currentType.settings||[]}else this.isLoading=!0,l["AjaxHelper"].fetch({method:"SitesManager.getSiteSettings",idSite:this.theSite.idsite}).then((function(t){e.measurableSettings=t})).finally((function(){e.isLoading=!1}))},saveSite:function(){var e=this,t={siteName:this.theSite.name,timezone:this.theSite.timezone,currency:this.theSite.currency,type:this.theSite.type,settingValues:{}},n=rt(this.theSite),a="SitesManager.addSite";n||(a="SitesManager.updateSite",t.idSite=this.theSite.idsite),Object.entries(this.settingValues).forEach((function(e){var n=Je(e,2),a=n[0],i=n[1],r=a.split("."),l=Je(r,2),o=l[0],s=l[1],c=t.settingValues;c[o]||(c[o]=[]);var u=i;!1===i?u="0":!0===i?u="1":Array.isArray(i)&&(u=i.filter((function(e){return!!e}))),c[o].push({name:s,value:u})})),l["AjaxHelper"].post({method:a},t).then((function(a){e.editMode=!1,!e.theSite.idsite&&a&&a.value&&(e.theSite.idsite="".concat(a.value));var i=_.timezones.value.find((function(t){return t.code===e.theSite.timezone}));e.theSite.timezone_name=(null===i||void 0===i?void 0:i.label)||e.theSite.timezone,e.theSite.currency&&(e.theSite.currency_name=O.currencies.value[e.theSite.currency]);var r=l["NotificationsStore"].show({message:n?Object(l["translate"])("SitesManager_WebsiteCreated"):Object(l["translate"])("SitesManager_WebsiteUpdated"),context:"success",id:"websitecreated",type:"transient"});l["NotificationsStore"].scrollToNotification(r),h.removeEditSiteIdParameterFromHash(),e.$emit("save",{site:e.theSite,settingValues:t.settingValues,isNew:n})}))},cancelEditSite:function(e){this.editMode=!1,h.removeEditSiteIdParameterFromHash(),this.$emit("cancelEditSite",{site:e,element:this.$refs.root})},deleteSite:function(){var e=this;l["AjaxHelper"].fetch({idSite:this.theSite.idsite,module:"API",format:"json",method:"SitesManager.deleteSite"}).then((function(){e.$emit("delete",e.theSite)}))}},computed:{availableTypes:function(){return h.types.value},setupUrl:function(){var e=this.theSite,t="",n="";return this.isInternalSetupUrl&&(t=l["MatomoUrl"].stringify({idSite:e.idsite,period:l["MatomoUrl"].parsed.value.period,date:l["MatomoUrl"].parsed.value.date,updated:"false"}),n=-1===this.howToSetupUrl.indexOf("?")?"?":"&"),"".concat(this.howToSetupUrl).concat(n).concat(t)},utcTimeIs:function(){var e=this.utcTime,t=function(e){return e.toString().padStart(2,"0")},n=t(e.getHours()),a=t(e.getMinutes()),i=t(e.getSeconds()),r="".concat(Object(l["format"])(this.utcTime)," ").concat(n,":").concat(a,":").concat(i);return Object(l["translate"])("SitesManager_UTCTimeIs",r)},timezones:function(){return it.value},currencies:function(){return O.currencies.value},currentType:function(){var e=this.site,t=h.typesById.value[e.type];return t||{name:e.type}},howToSetupUrl:function(){var e=this.currentType;if(e)return e.howToSetupUrl},isInternalSetupUrl:function(){var e=this.howToSetupUrl;return!!e&&"?"==="".concat(e).substring(0,1)},removeDialogTitle:function(){return Object(l["translate"])("SitesManager_DeleteConfirm",'"'.concat(this.theSite.name,'" (idSite = ').concat(this.theSite.idsite,")"))}}});lt.render=Ye;var ot=lt;function st(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ct(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function ut(e,t,n){return t&&ct(e.prototype,t),n&&ct(e,n),e}function dt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * 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 bt=function(){function e(){var t=this;st(this,e),dt(this,"privateState",Object(r["reactive"])({isLoading:!1,globalSettings:{keepURLFragmentsGlobal:!1,defaultCurrency:"",defaultTimezone:"",excludedIpsGlobal:"",excludedQueryParametersGlobal:"",excludedUserAgentsGlobal:"",excludedReferrersGlobal:"",searchKeywordParametersGlobal:"",searchCategoryParametersGlobal:""}})),dt(this,"isLoading",Object(r["computed"])((function(){return Object(r["readonly"])(t.privateState).isLoading}))),dt(this,"globalSettings",Object(r["computed"])((function(){return Object(r["readonly"])(t.privateState).globalSettings})))}return ut(e,[{key:"init",value:function(){return this.fetchGlobalSettings()}},{key:"saveGlobalSettings",value:function(e){var t=this;return this.privateState.isLoading=!0,l["AjaxHelper"].post({module:"SitesManager",format:"json",action:"setGlobalSettings"},e,{withTokenInUrl:!0}).finally((function(){t.privateState.isLoading=!1}))}},{key:"fetchGlobalSettings",value:function(){var e=this;this.privateState.isLoading=!0,l["AjaxHelper"].fetch({module:"SitesManager",action:"getGlobalSettings"}).then((function(t){e.privateState.globalSettings=Object.assign(Object.assign({},t),{},{excludedIpsGlobal:t.excludedIpsGlobal||"",excludedQueryParametersGlobal:t.excludedQueryParametersGlobal||"",excludedUserAgentsGlobal:t.excludedUserAgentsGlobal||"",excludedReferrersGlobal:t.excludedReferrersGlobal||"",searchKeywordParametersGlobal:t.searchKeywordParametersGlobal||"",searchCategoryParametersGlobal:t.searchCategoryParametersGlobal||""})})).finally((function(){e.privateState.isLoading=!1}))}}]),e}(),mt=new bt,ht=Object(r["defineComponent"])({props:{dummy:String},components:{MatomoDialog:l["MatomoDialog"],ButtonBar:le,SiteFields:ot,EnrichedHeadline:l["EnrichedHeadline"]},directives:{ContentIntro:l["ContentIntro"]},data:function(){var e=new Date,t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds());return{pageSize:10,currentPage:0,showAddSiteDialog:!1,searchTerm:"",activeSearchTerm:"",fetchedSites:[],isLoadingInitialEntities:!1,utcTime:t,totalNumberOfSites:null,isSiteBeingEdited:!1,fetchLimitedSitesAbortController:null}},created:function(){var e=this;_.init(),h.init(),mt.init(),this.isLoadingInitialEntities=!0,Promise.all([h.fetchAvailableTypes(),this.fetchLimitedSitesWithAdminAccess(),this.getTotalNumberOfSites()]).then((function(){e.triggerAddSiteIfRequested()})).finally((function(){e.isLoadingInitialEntities=!1})),Object(r["watch"])((function(){return l["MatomoUrl"].hashQuery.value}),(function(){e.checkGlobalSettingsHash()}))},computed:{sites:function(){var e=this.fetchedSites.filter((function(e){return!e.idsite})).length;return this.fetchedSites.slice(0,this.pageSize+e)},isLoading:function(){return!!this.fetchLimitedSitesAbortController||this.isLoadingInitialEntities||null===this.totalNumberOfSites||h.isLoading.value||_.isLoading.value||mt.isLoading.value},availableTypes:function(){return h.types.value},timezoneSupportEnabled:function(){return _.timezoneSupportEnabled.value},globalSettings:function(){return mt.globalSettings.value},headlineText:function(){return Object(l["translate"])("SitesManager_XManagement",this.availableTypes.length>1?Object(l["translate"])("General_Measurables"):Object(l["translate"])("SitesManager_Sites"))},mainDescription:function(){return Object(l["translate"])("SitesManager_YouCurrentlyHaveAccessToNWebsites","<strong>".concat(this.totalNumberOfSites,"</strong>"))},hasSuperUserAccess:function(){return l["Matomo"].hasSuperUserAccess},superUserAccessMessage:function(){return Object(l["translate"])("SitesManager_SuperUserAccessCan","<a href='#globalSettings'>","</a>")},hasPrev:function(){return this.currentPage>=1},hasNext:function(){return this.fetchedSites.filter((function(e){return!!e.idsite})).length>=this.pageSize+1},offsetStart:function(){return this.currentPage*this.pageSize+1},offsetEnd:function(){return this.offsetStart+this.sites.filter((function(e){return!!e.idsite})).length-1}},methods:{checkGlobalSettingsHash:function(){var e=l["MatomoUrl"].hashQuery.value;!l["Matomo"].hasSuperUserAccess||"globalSettings"!==e&&"/globalSettings"!==e||l["MatomoUrl"].updateLocation(Object.assign(Object.assign({},l["MatomoUrl"].urlParsed.value),{},{action:"globalSettings"}))},addNewEntity:function(){this.availableTypes.length>1?this.showAddSiteDialog=!0:1===this.availableTypes.length&&this.addSite(this.availableTypes[0].id)},addSite:function(e){var t=e,n={isAllowed:!0,measurableType:t};l["Matomo"].postEvent("SitesManager.initAddSite",n),n&&!n.isAllowed||(t||(t="website"),this.fetchedSites.unshift({type:t}),this.isSiteBeingEdited=!0)},afterCancelEdit:function(e){var t=e.site,n=e.element;this.isSiteBeingEdited=!1,t.idsite?n.scrollIntoView():this.fetchedSites=this.fetchedSites.filter((function(e){return!!e.idsite}))},fetchLimitedSitesWithAdminAccess:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.fetchLimitedSitesAbortController&&this.fetchLimitedSitesAbortController.abort(),this.fetchLimitedSitesAbortController=new AbortController;var n=this.pageSize+1,a=this.currentPage*this.pageSize,i={method:"SitesManager.getSitesWithAdminAccess",fetchAliasUrls:1,limit:n+a,filter_offset:a,filter_limit:n};return t&&(i.pattern=t),l["AjaxHelper"].fetch(i).then((function(t){e.fetchedSites=t||[]})).then((function(n){return e.activeSearchTerm=t,n})).finally((function(){e.fetchLimitedSitesAbortController=null}))},getTotalNumberOfSites:function(){var e=this;return l["AjaxHelper"].fetch({method:"SitesManager.getSitesIdWithAdminAccess",filter_limit:"-1"}).then((function(t){e.totalNumberOfSites=t.length}))},triggerAddSiteIfRequested:function(){var e=h.getEditSiteIdParameter(),t=l["MatomoUrl"].urlParsed.value.showaddsite;"1"===t?this.addNewEntity():e&&(this.searchTerm=e,this.fetchLimitedSitesWithAdminAccess(this.searchTerm))},previousPage:function(){this.currentPage=Math.max(0,this.currentPage-1),this.fetchLimitedSitesWithAdminAccess(this.activeSearchTerm)},nextPage:function(){this.currentPage=Math.max(0,this.currentPage+1),this.fetchLimitedSitesWithAdminAccess(this.activeSearchTerm)},searchSites:function(){this.currentPage=0,this.fetchLimitedSitesWithAdminAccess(this.searchTerm)},afterDelete:function(e){var t={showaddsite:0};if(l["MatomoUrl"].urlParsed.value.idSite==="".concat(e.idsite)){var n=this.sites.find((function(t){return t.idsite!==e.idsite}));n&&(t=Object.assign(Object.assign({},t),{},{idSite:n.idsite}))}l["Matomo"].helper.redirect(t)},afterSave:function(e,t,n,a){var i=["excluded_ips","excluded_parameters","excluded_user_agents","sitesearch_keyword_parameters","sitesearch_category_parameters"],r=Object.assign({},e);Object.values(t).forEach((function(e){e.forEach((function(e){"urls"===e.name?r.alias_urls=e.value:-1!==i.indexOf(e.name)?r[e.name]=e.value.join(", "):r[e.name]=e.value}))})),this.fetchedSites[n]=r,a&&null!==this.totalNumberOfSites&&(this.totalNumberOfSites+=1),this.isSiteBeingEdited=!1}}});ht.render=q;var pt=ht,gt={class:"SitesManager"},ft=Object(r["createElementVNode"])("a",{name:"globalSettings",id:"globalSettings"},null,-1),St={id:"excludedIpsGlobalHelp",class:"inline-help-node"},jt=Object(r["createElementVNode"])("br",null,null,-1),Ot=Object(r["createElementVNode"])("br",null,null,-1),vt=["innerHTML"],yt={id:"excludedQueryParametersGlobalHelp",class:"inline-help-node"},Et=Object(r["createElementVNode"])("br",null,null,-1),Nt=Object(r["createElementVNode"])("br",null,null,-1),Vt={id:"excludedUserAgentsGlobalHelp",class:"inline-help-node"},xt=Object(r["createElementVNode"])("br",null,null,-1),Tt=Object(r["createElementVNode"])("br",null,null,-1),Mt={id:"excludedReferrersGlobalHelp",class:"inline-help-node"},Ct=Object(r["createElementVNode"])("br",null,null,-1),wt=Object(r["createElementVNode"])("br",null,null,-1),Dt=Object(r["createElementVNode"])("br",null,null,-1),_t=Object(r["createElementVNode"])("br",null,null,-1),Gt=Object(r["createElementVNode"])("br",null,null,-1),kt={id:"timezoneHelp",class:"inline-help-node"},At={key:0},Pt=Object(r["createElementVNode"])("br",null,null,-1),Lt=Object(r["createElementVNode"])("br",null,null,-1),Ut={id:"keepURLFragmentsHelp",class:"inline-help-node"},Bt=["innerHTML"],zt={class:"alert alert-info"};function It(e,t,n,a,i,l){var o=Object(r["resolveComponent"])("Field"),s=Object(r["resolveComponent"])("SaveButton"),c=Object(r["resolveComponent"])("ContentBlock");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",gt,[Object(r["withDirectives"])(Object(r["createVNode"])(c,{"content-title":e.translate("SitesManager_GlobalWebsitesSettings")},{default:Object(r["withCtx"])((function(){return[ft,Object(r["createElementVNode"])("div",St,[Object(r["createElementVNode"])("div",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_HelpExcludedIpAddresses","1.2.3.4/24","1.2.3.*","1.2.*.*"))+" ",1),jt,Ot,Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.yourCurrentIpAddressIs)},null,8,vt)])]),Object(r["createElementVNode"])("div",yt,[Object(r["createElementVNode"])("div",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_ListOfQueryParametersToExclude","/^sess.*|.*[dD]ate$/"))+" ",1),Et,Nt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_PiwikWillAutomaticallyExcludeCommonSessionParameters","phpsessid, sessionid, ...")),1)])]),Object(r["createElementVNode"])("div",Vt,[Object(r["createElementVNode"])("div",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp1"))+" ",1),xt,Tt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_GlobalListExcludedUserAgents_Desc"))+" "+Object(r["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp2"))+" "+Object(r["toDisplayString"])(e.translate("SitesManager_GlobalExcludedUserAgentHelp3","/bot|spider|crawl|scanner/i")),1)])]),Object(r["createElementVNode"])("div",Mt,[Object(r["createElementVNode"])("div",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelp"))+" ",1),Ct,wt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpDetails"))+" ",1),Dt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpExamples","www.example.org","http://example.org/mypath","https://www.example.org/?param=1","https://sub.example.org/"))+" ",1),_t,Gt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_ExcludedReferrersHelpSubDomains",".sub.example.org","http://sub.example.org/mypath","https://new.sub.example.org/")),1)])]),Object(r["createElementVNode"])("div",kt,[Object(r["createElementVNode"])("div",null,[e.timezoneSupportEnabled?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",At,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("SitesManager_AdvancedTimezoneSupportNotFound"))+" ",1),Pt])),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_UTCTimeIs",e.utcTimeDate))+" ",1),Lt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("SitesManager_ChangingYourTimezoneWillOnlyAffectDataForward")),1)])]),Object(r["createElementVNode"])("div",Ut,[Object(r["createElementVNode"])("div",{innerHTML:e.$sanitize(e.keepUrlFragmentHelp)},null,8,Bt),Object(r["createElementVNode"])("div",null,Object(r["toDisplayString"])(e.translate("SitesManager_KeepURLFragmentsHelp2")),1)]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"textarea",name:"excludedIpsGlobal","var-type":"array",modelValue:e.excludedIpsGlobal,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.excludedIpsGlobal=t}),title:e.translate("SitesManager_ListOfIpsToBeExcludedOnAllWebsites"),introduction:e.translate("SitesManager_GlobalListExcludedIps"),"inline-help":"#excludedIpsGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"textarea",name:"excludedQueryParametersGlobal","var-type":"array",modelValue:e.excludedQueryParametersGlobal,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.excludedQueryParametersGlobal=t}),title:e.translate("SitesManager_ListOfQueryParametersToBeExcludedOnAllWebsites"),introduction:e.translate("SitesManager_GlobalListExcludedQueryParameters"),"inline-help":"#excludedQueryParametersGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"textarea",name:"excludedUserAgentsGlobal","var-type":"array",modelValue:e.excludedUserAgentsGlobal,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.excludedUserAgentsGlobal=t}),title:e.translate("SitesManager_GlobalListExcludedUserAgents_Desc"),introduction:e.translate("SitesManager_GlobalListExcludedUserAgents"),"inline-help":"#excludedUserAgentsGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"textarea",name:"excludedReferrersGlobal","var-type":"array",modelValue:e.excludedReferrersGlobal,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.excludedReferrersGlobal=t}),title:e.translate("SitesManager_GlobalListExcludedReferrersDesc"),introduction:e.translate("SitesManager_GlobalListExcludedReferrers"),"inline-help":"#excludedReferrersGlobalHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"checkbox",name:"keepURLFragmentsGlobal",modelValue:e.keepURLFragmentsGlobal,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.keepURLFragmentsGlobal=t}),title:e.translate("SitesManager_KeepURLFragmentsLong"),introduction:e.translate("SitesManager_KeepURLFragments"),"inline-help":"#keepURLFragmentsHelp",disabled:e.isLoading},null,8,["modelValue","title","introduction","disabled"])]),Object(r["createElementVNode"])("h3",null,Object(r["toDisplayString"])(e.translate("SitesManager_TrackingSiteSearch")),1),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteSearchUse")),1),Object(r["createElementVNode"])("div",zt,Object(r["toDisplayString"])(e.translate("SitesManager_SearchParametersNote"))+" "+Object(r["toDisplayString"])(e.translate("SitesManager_SearchParametersNote2")),1),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"text",name:"searchKeywordParametersGlobal","var-type":"array",modelValue:e.searchKeywordParametersGlobal,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.searchKeywordParametersGlobal=t}),title:e.translate("SitesManager_SearchKeywordLabel"),"inline-help":e.translate("SitesManager_SearchKeywordParametersDesc"),disabled:e.isLoading},null,8,["modelValue","title","inline-help","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"text",name:"searchCategoryParametersGlobal","var-type":"array",modelValue:e.searchCategoryParametersGlobal,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.searchCategoryParametersGlobal=t}),title:e.translate("SitesManager_SearchCategoryLabel"),"inline-help":e.searchCategoryParamsInlineHelp,disabled:e.isLoading},null,8,["modelValue","title","inline-help","disabled"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"select",name:"defaultTimezone",options:e.timezoneOptions,title:e.translate("SitesManager_SelectDefaultTimezone"),introduction:e.translate("SitesManager_DefaultTimezoneForNewWebsites"),"inline-help":"#timezoneHelp",disabled:e.isLoading,modelValue:e.defaultTimezone,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.defaultTimezone=t})},null,8,["options","title","introduction","disabled","modelValue"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{uicontrol:"select",name:"defaultCurrency",modelValue:e.defaultCurrency,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.defaultCurrency=t}),options:e.currencies,title:e.translate("SitesManager_SelectDefaultCurrency"),introduction:e.translate("SitesManager_DefaultCurrencyForNewWebsites"),"inline-help":e.translate("SitesManager_CurrencySymbolWillBeUsedForGoals"),disabled:e.isLoading},null,8,["modelValue","options","title","introduction","inline-help","disabled"])]),Object(r["createVNode"])(s,{saving:e.isSaving,onConfirm:t[9]||(t[9]=function(t){return e.saveGlobalSettings()})},null,8,["saving"])]})),_:1},8,["content-title"]),[[r["vShow"],e.hasSuperUserAccess]])])}var Ht=Object(r["defineComponent"])({props:{dummy:String},components:{ContentBlock:l["ContentBlock"],Field:Xe["Field"],SaveButton:Xe["SaveButton"]},data:function(){var e=new Date,t=new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds()),n=mt.globalSettings.value;return{currentIpAddress:null,utcTime:t,keepURLFragmentsGlobal:n.keepURLFragmentsGlobal,defaultTimezone:n.defaultTimezone,defaultCurrency:n.defaultCurrency,excludedIpsGlobal:(n.excludedIpsGlobal||"").split(","),excludedQueryParametersGlobal:(n.excludedQueryParametersGlobal||"").split(","),excludedUserAgentsGlobal:(n.excludedUserAgentsGlobal||"").split(","),excludedReferrersGlobal:(n.excludedReferrersGlobal||"").split(","),searchKeywordParametersGlobal:(n.searchKeywordParametersGlobal||"").split(","),searchCategoryParametersGlobal:(n.searchCategoryParametersGlobal||"").split(","),isSaving:!1}},created:function(){var e=this;O.init(),_.init(),mt.init(),Object(r["watch"])((function(){return mt.globalSettings.value}),(function(t){e.keepURLFragmentsGlobal=t.keepURLFragmentsGlobal,e.defaultTimezone=t.defaultTimezone,e.defaultCurrency=t.defaultCurrency,e.excludedIpsGlobal=(t.excludedIpsGlobal||"").split(","),e.excludedQueryParametersGlobal=(t.excludedQueryParametersGlobal||"").split(","),e.excludedUserAgentsGlobal=(t.excludedUserAgentsGlobal||"").split(","),e.excludedReferrersGlobal=(t.excludedReferrersGlobal||"").split(","),e.searchKeywordParametersGlobal=(t.searchKeywordParametersGlobal||"").split(","),e.searchCategoryParametersGlobal=(t.searchCategoryParametersGlobal||"").split(",")})),l["AjaxHelper"].fetch({method:"API.getIpFromHeader"}).then((function(t){e.currentIpAddress=t.value}))},methods:{saveGlobalSettings:function(){var e=this;this.isSaving=!0,mt.saveGlobalSettings({keepURLFragments:this.keepURLFragmentsGlobal,currency:this.defaultCurrency,timezone:this.defaultTimezone,excludedIps:this.excludedIpsGlobal.join(","),excludedQueryParameters:this.excludedQueryParametersGlobal.join(","),excludedUserAgents:this.excludedUserAgentsGlobal.join(","),excludedReferrers:this.excludedReferrersGlobal.join(","),searchKeywordParameters:this.searchKeywordParametersGlobal.join(","),searchCategoryParameters:this.searchCategoryParametersGlobal.join(",")}).then((function(){l["Matomo"].helper.redirect({showaddsite:!1})})).finally((function(){e.isSaving=!1}))}},computed:{isLoading:function(){return mt.isLoading.value||_.isLoading.value||O.isLoading.value},timezones:function(){return _.timezones.value},timezoneOptions:function(){return this.timezones.map((function(e){var t=e.group,n=e.label,a=e.code;return{group:t,key:n,value:a}}))},currencies:function(){return O.currencies.value},hasSuperUserAccess:function(){return l["Matomo"].hasSuperUserAccess},yourCurrentIpAddressIs:function(){return Object(l["translate"])("SitesManager_YourCurrentIpAddressIs","<i>".concat(this.currentIpAddress,"</i>"))},timezoneSupportEnabled:function(){return _.timezoneSupportEnabled.value},utcTimeDate:function(){var e=this.utcTime,t=function(e){return e.toString().padStart(2,"0")},n=t(e.getHours()),a=t(e.getMinutes()),i=t(e.getSeconds());return"".concat(Object(l["format"])(this.utcTime)," ").concat(n,":").concat(a,":").concat(i)},keepUrlFragmentHelp:function(){return Object(l["translate"])("SitesManager_KeepURLFragmentsHelp","<em>#</em>","<em>example.org/index.html#first_section</em>","<em>example.org/index.html</em>")},searchCategoryParamsInlineHelp:function(){var e=[Object(l["translate"])("Goals_Optional"),Object(l["translate"])("SitesManager_SearchCategoryDesc"),Object(l["translate"])("SitesManager_SearchCategoryParametersDesc")];return e.join(" ")}}});Ht.render=It;var Ft=Ht,Rt=Object(r["createElementVNode"])("p",null," ",-1),Wt=["innerHTML"],Kt=Object(r["createElementVNode"])("hr",null,null,-1),qt=["href"],Qt=Object(r["createElementVNode"])("br",null,null,-1),$t=["href"];function Yt(e,t,n,a,i,l){var o=Object(r["resolveComponent"])("WidgetLoader"),s=Object(r["resolveComponent"])("VueEntryContainer"),c=Object(r["resolveComponent"])("ContentBlock");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",null,[Object(r["createVNode"])(c,{"content-title":"".concat(e.translate("SitesManager_SiteWithoutDataTitle")," 🚀")},{default:Object(r["withCtx"])((function(){return[Rt,Object(r["createElementVNode"])("p",{innerHTML:e.$sanitize(e.siteWithoutDataDesc)},null,8,Wt),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataMessageDisappears")),1),Object(r["createElementVNode"])("h3",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataChoosePreferredWay")),1),Object(r["createVNode"])(o,{"widget-params":{module:"SitesManager",action:"siteWithoutDataTabs"},"loading-message":"".concat(e.translate("SitesManager_DetectingYourSite"),"...")},null,8,["loading-message"]),Kt,Object(r["createElementVNode"])("a",{class:"btn",id:"emailTrackingCodeBtn",href:e.emailInstructionsLink},Object(r["toDisplayString"])(e.translate("SitesManager_EmailInstructionsButton")),9,qt),Object(r["createVNode"])(s,{html:e.afterIntroEventContent},null,8,["html"]),Qt,Object(r["createElementVNode"])("a",{href:e.ignoreSitesWithoutDataLink,class:"btn ignoreSitesWithoutData"},Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataIgnoreMessage")),9,$t)]})),_:1},8,["content-title"]),Object(r["createVNode"])(s,{html:e.afterTrackingHelpEventContent},null,8,["html"])])}var Xt=Object(r["defineComponent"])({props:{emailBody:{type:String,required:!0},afterIntroEventContent:String,afterTrackingHelpEventContent:String},components:{ContentBlock:l["ContentBlock"],WidgetLoader:l["WidgetLoader"],VueEntryContainer:l["VueEntryContainer"]},computed:{siteWithoutDataDesc:function(){return Object(l["translate"])("SitesManager_SiteWithoutDataDescription",'<a href="'.concat(this.emailInstructionsLink,'">'),"</a>")},emailInstructionsLink:function(){return"mailto:?".concat(l["MatomoUrl"].stringify({subject:Object(l["translate"])("SitesManager_EmailInstructionsSubject"),body:this.emailBody}))},ignoreSitesWithoutDataLink:function(){return"?".concat(l["MatomoUrl"].stringify(Object.assign(Object.assign({},l["MatomoUrl"].urlParsed.value),{},{module:"SitesManager",action:"ignoreNoDataMessage"})))}}});Xt.render=Yt;var Jt=Xt; /*! * 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; -/*! - * 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; -/*! - * 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"})}})})); + */}})})); //# sourceMappingURL=SitesManager.umd.min.js.map
\ No newline at end of file diff --git a/plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.adapter.ts b/plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.adapter.ts deleted file mode 100644 index 8f6b18c9a9..0000000000 --- a/plugins/SitesManager/vue/src/ManageGlobalSettings/ManageGlobalSettings.adapter.ts +++ /dev/null @@ -1,15 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -import { createAngularJsAdapter } from 'CoreHome'; -import ManageGlobalSettings from './ManageGlobalSettings.vue'; - -export default createAngularJsAdapter({ - component: ManageGlobalSettings, - scope: {}, - directiveName: 'matomoGlobalSettings', -}); diff --git a/plugins/SitesManager/vue/src/SiteTypesStore/SiteTypesStore.adapter.ts b/plugins/SitesManager/vue/src/SiteTypesStore/SiteTypesStore.adapter.ts deleted file mode 100644 index 7f3c2ac706..0000000000 --- a/plugins/SitesManager/vue/src/SiteTypesStore/SiteTypesStore.adapter.ts +++ /dev/null @@ -1,41 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -import { DeepReadonly } from 'vue'; -import { cloneThenApply, clone } from 'CoreHome'; -import SiteTypesStore from './SiteTypesStore'; -import SiteType from './SiteType'; - -function sitesManagerTypeModelAdapter() { - return { - get typesById() { - return clone(SiteTypesStore.typesById.value); - }, - fetchTypeById(typeId: string): Promise<DeepReadonly<SiteType>> { - return SiteTypesStore.fetchAvailableTypes().then( - () => cloneThenApply(this.typesById[typeId]), - ); - }, - fetchAvailableTypes(): ReturnType<typeof SiteTypesStore['fetchAvailableTypes']> { - return SiteTypesStore.fetchAvailableTypes().then((types) => cloneThenApply(types)); - }, - hasMultipleTypes(): Promise<boolean> { - return SiteTypesStore.fetchAvailableTypes().then( - (types) => types && Object.keys(types).length > 1, - ); - }, - removeEditSiteIdParameterFromHash: - SiteTypesStore.removeEditSiteIdParameterFromHash.bind(SiteTypesStore), - getEditSiteIdParameter: - SiteTypesStore.getEditSiteIdParameter.bind(SiteTypesStore), - }; -} - -window.angular.module('piwikApp.service').factory( - 'sitesManagerTypeModel', - sitesManagerTypeModelAdapter, -); diff --git a/plugins/SitesManager/vue/src/SiteWithoutData/SiteWithoutData.vue b/plugins/SitesManager/vue/src/SiteWithoutData/SiteWithoutData.vue new file mode 100644 index 0000000000..4c279bdb7c --- /dev/null +++ b/plugins/SitesManager/vue/src/SiteWithoutData/SiteWithoutData.vue @@ -0,0 +1,90 @@ +<!-- + Matomo - free/libre analytics platform + @link https://matomo.org + @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later +--> + +<template> + <div> + <ContentBlock :content-title="`${translate('SitesManager_SiteWithoutDataTitle')} 🚀`"> + <p> </p> + <p v-html="$sanitize(siteWithoutDataDesc)"></p> + <p>{{ translate('SitesManager_SiteWithoutDataMessageDisappears') }}</p> + + <h3>{{ translate('SitesManager_SiteWithoutDataChoosePreferredWay') }}</h3> + + <WidgetLoader + :widget-params="{module: 'SitesManager', action: 'siteWithoutDataTabs'}" + :loading-message="`${translate('SitesManager_DetectingYourSite')}...`" + /> + + <hr/> + + <a + class="btn" + id="emailTrackingCodeBtn" + :href="emailInstructionsLink" + >{{ translate('SitesManager_EmailInstructionsButton') }}</a> + + <VueEntryContainer :html="afterIntroEventContent"/> + + <br /> + <a :href="ignoreSitesWithoutDataLink" + class="btn ignoreSitesWithoutData" + > + {{ translate('SitesManager_SiteWithoutDataIgnoreMessage') }} + </a> + </ContentBlock> + + <VueEntryContainer :html="afterTrackingHelpEventContent"/> + </div> +</template> + +<script lang="ts"> +import { defineComponent } from 'vue'; +import { + ContentBlock, + translate, + MatomoUrl, + WidgetLoader, + VueEntryContainer, +} from 'CoreHome'; + +export default defineComponent({ + props: { + emailBody: { + type: String, + required: true, + }, + afterIntroEventContent: String, + afterTrackingHelpEventContent: String, + }, + components: { + ContentBlock, + WidgetLoader, + VueEntryContainer, + }, + computed: { + siteWithoutDataDesc() { + return translate( + 'SitesManager_SiteWithoutDataDescription', + `<a href="${this.emailInstructionsLink}">`, + '</a>', + ); + }, + emailInstructionsLink() { + return `mailto:?${MatomoUrl.stringify({ + subject: translate('SitesManager_EmailInstructionsSubject'), + body: this.emailBody, + })}`; + }, + ignoreSitesWithoutDataLink() { + return `?${MatomoUrl.stringify({ + ...MatomoUrl.urlParsed.value, + module: 'SitesManager', + action: 'ignoreNoDataMessage', + })}`; + }, + }, +}); +</script> diff --git a/plugins/SitesManager/vue/src/SitesManagement/SitesManagement.adapter.ts b/plugins/SitesManager/vue/src/SitesManagement/SitesManagement.adapter.ts deleted file mode 100644 index aaa8ef85fd..0000000000 --- a/plugins/SitesManager/vue/src/SitesManagement/SitesManagement.adapter.ts +++ /dev/null @@ -1,19 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -import { createAngularJsAdapter } from 'CoreHome'; -import SitesManagement from './SitesManagement.vue'; - -export default createAngularJsAdapter({ - component: SitesManagement, - scope: {}, - directiveName: 'matomoSitesManagement', -}); - -// sitesManagerAPI no longer exists, but it is still referenced by a premium feature. the feature -// doesn't actually use it though so we can just create an empty object for an adapter. -window.angular.module('piwikApp').factory('sitesManagerAPI', () => ({})); diff --git a/plugins/SitesManager/vue/src/index.ts b/plugins/SitesManager/vue/src/index.ts index a103620feb..a6407dcf39 100644 --- a/plugins/SitesManager/vue/src/index.ts +++ b/plugins/SitesManager/vue/src/index.ts @@ -5,13 +5,10 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -import './SiteTypesStore/SiteTypesStore.adapter'; -import './SitesManagement/SitesManagement.adapter'; -import './ManageGlobalSettings/ManageGlobalSettings.adapter'; - export { default as SiteType } from './SiteTypesStore/SiteType'; export { default as SiteTypesStore } from './SiteTypesStore/SiteTypesStore'; export { default as CurrencyStore } from './CurrencyStore/CurrencyStore'; export { default as TimezoneStore } from './TimezoneStore/TimezoneStore'; export { default as SitesManagement } from './SitesManagement/SitesManagement.vue'; export { default as ManageGlobalSettings } from './ManageGlobalSettings/ManageGlobalSettings.vue'; +export { default as SiteWithoutData } from './SiteWithoutData/SiteWithoutData.vue'; |