diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2021-11-09 00:23:21 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-09 00:23:21 +0300 |
commit | 312d3a0c0ec44c7ac38be43af9b290b2ba7aeefd (patch) | |
tree | f688035cfc8bd5b647b5c5eeb06449fec3f79971 /plugins/CoreHome/vue | |
parent | 27d714e93cf78df3d72435b3995d5a275284f1d5 (diff) |
Mark IE11 as no longer supported browsers (#18199)
* Revert "add warning about dropping support for users using IE (#18037)"
This reverts commit 962bd82b8069af16bb5fcfcc7d2ef75731a5bf2e.
* Mark IE11 as unsupported browser
* update browserslist dependencies to > 0.05% usage
* update other browser versions
* debug browser not supported ui test failure
* reset user agent in optoutform UI test
* reset user agent after optoutform test
* another user agent in tests tweak
* remove supported browser debugging output
Co-authored-by: diosmosis <diosmosis@users.noreply.github.com>
Diffstat (limited to 'plugins/CoreHome/vue')
-rw-r--r-- | plugins/CoreHome/vue/dist/CoreHome.umd.js | 2834 | ||||
-rw-r--r-- | plugins/CoreHome/vue/dist/CoreHome.umd.min.js | 51 |
2 files changed, 1640 insertions, 1245 deletions
diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.js b/plugins/CoreHome/vue/dist/CoreHome.umd.js index 6dc2a61e5d..cd4dcc3fd0 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.js @@ -174,6 +174,12 @@ var noAdblockFlag = __webpack_require__("2342"); var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Periods.ts +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _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 _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + function _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; } /*! @@ -219,48 +225,70 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope * view/edit aren't, since there is currently no way to use a * custom UI for a custom period. */ -class Periods { - constructor() { +var Periods = /*#__PURE__*/function () { + function Periods() { + _classCallCheck(this, Periods); + _defineProperty(this, "periods", {}); _defineProperty(this, "periodOrder", []); } - addCustomPeriod(name, periodClass) { - if (this.periods[name]) { - throw new Error(`The "${name}" period already exists! It cannot be overridden.`); + _createClass(Periods, [{ + key: "addCustomPeriod", + value: function addCustomPeriod(name, periodClass) { + if (this.periods[name]) { + throw new Error("The \"".concat(name, "\" period already exists! It cannot be overridden.")); + } + + this.periods[name] = periodClass; + this.periodOrder.push(name); } + }, { + key: "getAllLabels", + value: function getAllLabels() { + return Array().concat(this.periodOrder); + } + }, { + key: "get", + value: function get(strPeriod) { + var periodClass = this.periods[strPeriod]; - this.periods[name] = periodClass; - this.periodOrder.push(name); - } + if (!periodClass) { + throw new Error("Invalid period label: ".concat(strPeriod)); + } - getAllLabels() { - return Array().concat(this.periodOrder); - } + return periodClass; + } + }, { + key: "parse", + value: function parse(strPeriod, strDate) { + return this.get(strPeriod).parse(strDate); + } + }, { + key: "isRecognizedPeriod", + value: function isRecognizedPeriod(strPeriod) { + return !!this.periods[strPeriod]; + } + }]); - get(strPeriod) { - const periodClass = this.periods[strPeriod]; + return Periods; +}(); - if (!periodClass) { - throw new Error(`Invalid period label: ${strPeriod}`); - } +/* harmony default export */ var Periods_Periods = (new Periods()); +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Matomo/Matomo.ts +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } - return periodClass; - } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } - parse(strPeriod, strDate) { - return this.get(strPeriod).parse(strDate); - } +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); } - isRecognizedPeriod(strPeriod) { - return !!this.periods[strPeriod]; - } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -} +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +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; } -/* harmony default export */ var Periods_Periods = (new Periods()); -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Matomo/Matomo.ts /*! * Matomo - free/libre analytics platform * @@ -268,12 +296,11 @@ class Periods { * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -let originalTitle; -const { - piwik: Matomo_piwik, - broadcast: Matomo_broadcast, - piwikHelper: Matomo_piwikHelper -} = window; +var originalTitle; +var _window = window, + Matomo_piwik = _window.piwik, + Matomo_broadcast = _window.broadcast, + Matomo_piwikHelper = _window.piwikHelper; Matomo_piwik.helper = Matomo_piwikHelper; Matomo_piwik.broadcast = Matomo_broadcast; @@ -286,8 +313,8 @@ Matomo_piwik.updateDateInTitle = function updateDateInTitle(date, period) { originalTitle = originalTitle || document.title; if (originalTitle.indexOf(Matomo_piwik.siteName) === 0) { - const dateString = ` - ${Periods_Periods.parse(period, date).getPrettyString()} `; - document.title = `${Matomo_piwik.siteName}${dateString}${originalTitle.substr(Matomo_piwik.siteName.length)}`; + var dateString = " - ".concat(Periods_Periods.parse(period, date).getPrettyString(), " "); + document.title = "".concat(Matomo_piwik.siteName).concat(dateString).concat(originalTitle.substr(Matomo_piwik.siteName.length)); } }; @@ -297,7 +324,7 @@ Matomo_piwik.hasUserCapability = function hasUserCapability(capability) { Matomo_piwik.on = function addMatomoEventListener(eventName, listener) { function listenerWrapper(evt) { - listener(...evt.detail); // eslint-disable-line + listener.apply(void 0, _toConsumableArray(evt.detail)); // eslint-disable-line } listener.wrapper = listenerWrapper; @@ -310,24 +337,30 @@ Matomo_piwik.off = function removeMatomoEventListener(eventName, listener) { } }; -Matomo_piwik.postEventNoEmit = function postEventNoEmit(eventName, ...args // eslint-disable-line -) { - const event = new CustomEvent(eventName, { +Matomo_piwik.postEventNoEmit = function postEventNoEmit(eventName) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var event = new CustomEvent(eventName, { detail: args }); window.dispatchEvent(event); }; -Matomo_piwik.postEvent = function postMatomoEvent(eventName, ...args // eslint-disable-line -) { - Matomo_piwik.postEventNoEmit(eventName, ...args); // required until angularjs is removed +Matomo_piwik.postEvent = function postMatomoEvent(eventName) { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + Matomo_piwik.postEventNoEmit.apply(Matomo_piwik, [eventName].concat(args)); // required until angularjs is removed - const $rootScope = Matomo_piwik.helper.getAngularDependency('$rootScope'); // eslint-disable-line + var $rootScope = Matomo_piwik.helper.getAngularDependency('$rootScope'); // eslint-disable-line - return $rootScope.$oldEmit(eventName, ...args); + return $rootScope.$oldEmit.apply($rootScope, [eventName].concat(args)); }; -const Matomo = Matomo_piwik; +var Matomo = Matomo_piwik; /* harmony default export */ var Matomo_Matomo = (Matomo); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/translate.ts /*! @@ -336,11 +369,15 @@ const Matomo = Matomo_piwik; * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function translate(translationStringId, ...values) { - let pkArgs = values; // handle variadic args AND single array of values (to match _pk_translate signature) +function translate(translationStringId) { + for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + values[_key - 1] = arguments[_key]; + } + + var pkArgs = values; // handle variadic args AND single array of values (to match _pk_translate signature) if (values.length === 1 && values[0] && values[0] instanceof Array) { - [pkArgs] = values; + pkArgs = values[0]; } return window._pk_translate(translationStringId, pkArgs); // eslint-disable-line @@ -356,7 +393,7 @@ function format(date) { return $.datepicker.formatDate('yy-mm-dd', date); } function getToday() { - const date = new Date(Date.now()); // undo browser timezone + var date = new Date(Date.now()); // undo browser timezone date.setTime(date.getTime() + date.getTimezoneOffset() * 60 * 1000); // apply Matomo site timezone (if it exists) @@ -373,7 +410,7 @@ function parseDate(date) { return date; } - const strDate = decodeURIComponent(date).trim(); + var strDate = decodeURIComponent(date).trim(); if (strDate === '') { throw new Error('Invalid date, empty string.'); @@ -385,26 +422,26 @@ function parseDate(date) { if (strDate === 'yesterday' // note: ignoring the 'same time' part since the frontend doesn't care about the time || strDate === 'yesterdaySameTime') { - const yesterday = getToday(); + var yesterday = getToday(); yesterday.setDate(yesterday.getDate() - 1); return yesterday; } if (strDate.match(/last[ -]?week/i)) { - const lastWeek = getToday(); + var lastWeek = getToday(); lastWeek.setDate(lastWeek.getDate() - 7); return lastWeek; } if (strDate.match(/last[ -]?month/i)) { - const lastMonth = getToday(); + var lastMonth = getToday(); lastMonth.setDate(1); lastMonth.setMonth(lastMonth.getMonth() - 1); return lastMonth; } if (strDate.match(/last[ -]?year/i)) { - const lastYear = getToday(); + var lastYear = getToday(); lastYear.setFullYear(lastYear.getFullYear() - 1); return lastYear; } @@ -423,6 +460,24 @@ function todayIsInRange(dateRange) { return false; } // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Range.ts +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || Range_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 Range_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Range_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 Range_arrayLikeToArray(o, minLen); } + +function Range_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 Range_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Range_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 Range_createClass(Constructor, protoProps, staticProps) { if (protoProps) Range_defineProperties(Constructor.prototype, protoProps); if (staticProps) Range_defineProperties(Constructor, staticProps); return Constructor; } + function Range_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; } /*! @@ -434,8 +489,11 @@ function Range_defineProperty(obj, key, value) { if (key in obj) { Object.define -class Range_RangePeriod { - constructor(startDate, endDate, childPeriodType) { + +var Range_RangePeriod = /*#__PURE__*/function () { + function RangePeriod(startDate, endDate, childPeriodType) { + Range_classCallCheck(this, RangePeriod); + Range_defineProperty(this, "startDate", void 0); Range_defineProperty(this, "endDate", void 0); @@ -451,160 +509,194 @@ class Range_RangePeriod { */ - static getLastNRange(childPeriodType, strAmount, strEndDate) { - const nAmount = Math.max(parseInt(strAmount.toString(), 10) - 1, 0); - - if (Number.isNaN(nAmount)) { - throw new Error('Invalid range strAmount'); + Range_createClass(RangePeriod, [{ + key: "getPrettyString", + value: function getPrettyString() { + var start = format(this.startDate); + var end = format(this.endDate); + return translate('General_DateRangeFromTo', [start, end]); + } + }, { + key: "getDateRange", + value: function getDateRange() { + return [this.startDate, this.endDate]; } + }, { + key: "containsToday", + value: function containsToday() { + return todayIsInRange(this.getDateRange()); + } + }], [{ + key: "getLastNRange", + value: function getLastNRange(childPeriodType, strAmount, strEndDate) { + var nAmount = Math.max(parseInt(strAmount.toString(), 10) - 1, 0); - let endDate = strEndDate ? parseDate(strEndDate) : getToday(); - let startDate = new Date(endDate.getTime()); + if (Number.isNaN(nAmount)) { + throw new Error('Invalid range strAmount'); + } - if (childPeriodType === 'day') { - startDate.setDate(startDate.getDate() - nAmount); - } else if (childPeriodType === 'week') { - startDate.setDate(startDate.getDate() - nAmount * 7); - } else if (childPeriodType === 'month') { - startDate.setDate(1); - startDate.setMonth(startDate.getMonth() - nAmount); - } else if (childPeriodType === 'year') { - startDate.setFullYear(startDate.getFullYear() - nAmount); - } else { - throw new Error(`Unknown period type '${childPeriodType}'.`); - } + var endDate = strEndDate ? parseDate(strEndDate) : getToday(); + var startDate = new Date(endDate.getTime()); + + if (childPeriodType === 'day') { + startDate.setDate(startDate.getDate() - nAmount); + } else if (childPeriodType === 'week') { + startDate.setDate(startDate.getDate() - nAmount * 7); + } else if (childPeriodType === 'month') { + startDate.setDate(1); + startDate.setMonth(startDate.getMonth() - nAmount); + } else if (childPeriodType === 'year') { + startDate.setFullYear(startDate.getFullYear() - nAmount); + } else { + throw new Error("Unknown period type '".concat(childPeriodType, "'.")); + } - if (childPeriodType !== 'day') { - const startPeriod = Periods_Periods.periods[childPeriodType].parse(startDate); - const endPeriod = Periods_Periods.periods[childPeriodType].parse(endDate); - [startDate] = startPeriod.getDateRange(); - [, endDate] = endPeriod.getDateRange(); - } + if (childPeriodType !== 'day') { + var startPeriod = Periods_Periods.periods[childPeriodType].parse(startDate); + var endPeriod = Periods_Periods.periods[childPeriodType].parse(endDate); + + var _startPeriod$getDateR = startPeriod.getDateRange(); - const firstWebsiteDate = new Date(1991, 7, 6); + var _startPeriod$getDateR2 = _slicedToArray(_startPeriod$getDateR, 1); - if (startDate.getTime() - firstWebsiteDate.getTime() < 0) { - switch (childPeriodType) { - case 'year': - startDate = new Date(1992, 0, 1); - break; + startDate = _startPeriod$getDateR2[0]; - case 'month': - startDate = new Date(1991, 8, 1); - break; + var _endPeriod$getDateRan = endPeriod.getDateRange(); - case 'week': - startDate = new Date(1991, 8, 12); - break; + var _endPeriod$getDateRan2 = _slicedToArray(_endPeriod$getDateRan, 2); - case 'day': - default: - startDate = firstWebsiteDate; - break; + endDate = _endPeriod$getDateRan2[1]; } - } - return new Range_RangePeriod(startDate, endDate, childPeriodType); - } - /** - * Returns a range representing a specific child date range counted back from the end date - * - * @param childPeriodType Type of the period, eg. day, week, year - * @param rangeEndDate - * @param countBack Return only the child date range for this specific period number - * @returns {RangePeriod} - */ + var firstWebsiteDate = new Date(1991, 7, 6); + + if (startDate.getTime() - firstWebsiteDate.getTime() < 0) { + switch (childPeriodType) { + case 'year': + startDate = new Date(1992, 0, 1); + break; + + case 'month': + startDate = new Date(1991, 8, 1); + break; + case 'week': + startDate = new Date(1991, 8, 12); + break; - static getLastNRangeChild(childPeriodType, rangeEndDate, countBack) { - const ed = rangeEndDate ? parseDate(rangeEndDate) : getToday(); - let startDate = new Date(ed.getTime()); - let endDate = new Date(ed.getTime()); - - if (childPeriodType === 'day') { - startDate.setDate(startDate.getDate() - countBack); - endDate.setDate(endDate.getDate() - countBack); - } else if (childPeriodType === 'week') { - startDate.setDate(startDate.getDate() - countBack * 7); - endDate.setDate(endDate.getDate() - countBack * 7); - } else if (childPeriodType === 'month') { - startDate.setDate(1); - startDate.setMonth(startDate.getMonth() - countBack); - endDate.setDate(1); - endDate.setMonth(endDate.getMonth() - countBack); - } else if (childPeriodType === 'year') { - startDate.setFullYear(startDate.getFullYear() - countBack); - endDate.setFullYear(endDate.getFullYear() - countBack); - } else { - throw new Error(`Unknown period type '${childPeriodType}'.`); - } - - if (childPeriodType !== 'day') { - const startPeriod = Periods_Periods.periods[childPeriodType].parse(startDate); - const endPeriod = Periods_Periods.periods[childPeriodType].parse(endDate); - [startDate] = startPeriod.getDateRange(); - [, endDate] = endPeriod.getDateRange(); - } - - const firstWebsiteDate = new Date(1991, 7, 6); - - if (startDate.getTime() - firstWebsiteDate.getTime() < 0) { - switch (childPeriodType) { - case 'year': - startDate = new Date(1992, 0, 1); - break; - - case 'month': - startDate = new Date(1991, 8, 1); - break; - - case 'week': - startDate = new Date(1991, 8, 12); - break; - - case 'day': - default: - startDate = firstWebsiteDate; - break; + case 'day': + default: + startDate = firstWebsiteDate; + break; + } } + + return new RangePeriod(startDate, endDate, childPeriodType); } + /** + * Returns a range representing a specific child date range counted back from the end date + * + * @param childPeriodType Type of the period, eg. day, week, year + * @param rangeEndDate + * @param countBack Return only the child date range for this specific period number + * @returns {RangePeriod} + */ - return new Range_RangePeriod(startDate, endDate, childPeriodType); - } + }, { + key: "getLastNRangeChild", + value: function getLastNRangeChild(childPeriodType, rangeEndDate, countBack) { + var ed = rangeEndDate ? parseDate(rangeEndDate) : getToday(); + var startDate = new Date(ed.getTime()); + var endDate = new Date(ed.getTime()); + + if (childPeriodType === 'day') { + startDate.setDate(startDate.getDate() - countBack); + endDate.setDate(endDate.getDate() - countBack); + } else if (childPeriodType === 'week') { + startDate.setDate(startDate.getDate() - countBack * 7); + endDate.setDate(endDate.getDate() - countBack * 7); + } else if (childPeriodType === 'month') { + startDate.setDate(1); + startDate.setMonth(startDate.getMonth() - countBack); + endDate.setDate(1); + endDate.setMonth(endDate.getMonth() - countBack); + } else if (childPeriodType === 'year') { + startDate.setFullYear(startDate.getFullYear() - countBack); + endDate.setFullYear(endDate.getFullYear() - countBack); + } else { + throw new Error("Unknown period type '".concat(childPeriodType, "'.")); + } - static parse(strDate, childPeriodType = 'day') { - if (/^previous/.test(strDate)) { - const endDate = Range_RangePeriod.getLastNRange(childPeriodType, '2').startDate; - return Range_RangePeriod.getLastNRange(childPeriodType, strDate.substring(8), endDate); - } + if (childPeriodType !== 'day') { + var startPeriod = Periods_Periods.periods[childPeriodType].parse(startDate); + var endPeriod = Periods_Periods.periods[childPeriodType].parse(endDate); + + var _startPeriod$getDateR3 = startPeriod.getDateRange(); + + var _startPeriod$getDateR4 = _slicedToArray(_startPeriod$getDateR3, 1); + + startDate = _startPeriod$getDateR4[0]; + + var _endPeriod$getDateRan3 = endPeriod.getDateRange(); + + var _endPeriod$getDateRan4 = _slicedToArray(_endPeriod$getDateRan3, 2); + + endDate = _endPeriod$getDateRan4[1]; + } + + var firstWebsiteDate = new Date(1991, 7, 6); + + if (startDate.getTime() - firstWebsiteDate.getTime() < 0) { + switch (childPeriodType) { + case 'year': + startDate = new Date(1992, 0, 1); + break; + + case 'month': + startDate = new Date(1991, 8, 1); + break; - if (/^last/.test(strDate)) { - return Range_RangePeriod.getLastNRange(childPeriodType, strDate.substring(4)); + case 'week': + startDate = new Date(1991, 8, 12); + break; + + case 'day': + default: + startDate = firstWebsiteDate; + break; + } + } + + return new RangePeriod(startDate, endDate, childPeriodType); } + }, { + key: "parse", + value: function parse(strDate) { + var childPeriodType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'day'; - const parts = decodeURIComponent(strDate).split(','); - return new Range_RangePeriod(parseDate(parts[0]), parseDate(parts[1]), childPeriodType); - } + if (/^previous/.test(strDate)) { + var endDate = RangePeriod.getLastNRange(childPeriodType, '2').startDate; + return RangePeriod.getLastNRange(childPeriodType, strDate.substring(8), endDate); + } - static getDisplayText() { - return translate('General_DateRangeInPeriodList'); - } + if (/^last/.test(strDate)) { + return RangePeriod.getLastNRange(childPeriodType, strDate.substring(4)); + } - getPrettyString() { - const start = format(this.startDate); - const end = format(this.endDate); - return translate('General_DateRangeFromTo', [start, end]); - } + var parts = decodeURIComponent(strDate).split(','); + return new RangePeriod(parseDate(parts[0]), parseDate(parts[1]), childPeriodType); + } + }, { + key: "getDisplayText", + value: function getDisplayText() { + return translate('General_DateRangeInPeriodList'); + } + }]); - getDateRange() { - return [this.startDate, this.endDate]; - } + return RangePeriod; +}(); - containsToday() { - return todayIsInRange(this.getDateRange()); - } -} Periods_Periods.addCustomPeriod('range', Range_RangePeriod); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Periods.adapter.ts /*! @@ -633,6 +725,12 @@ function piwikPeriods() { window.angular.module('piwikApp.service').factory('piwikPeriods', piwikPeriods); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Day.ts +function Day_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Day_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 Day_createClass(Constructor, protoProps, staticProps) { if (protoProps) Day_defineProperties(Constructor.prototype, protoProps); if (staticProps) Day_defineProperties(Constructor, staticProps); return Constructor; } + function Day_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; } /*! @@ -644,36 +742,55 @@ function Day_defineProperty(obj, key, value) { if (key in obj) { Object.definePr -class Day_DayPeriod { - constructor(dateInPeriod) { - Day_defineProperty(this, "dateInPeriod", void 0); - this.dateInPeriod = dateInPeriod; - } +var Day_DayPeriod = /*#__PURE__*/function () { + function DayPeriod(dateInPeriod) { + Day_classCallCheck(this, DayPeriod); - static parse(strDate) { - return new Day_DayPeriod(parseDate(strDate)); - } + Day_defineProperty(this, "dateInPeriod", void 0); - static getDisplayText() { - return translate('Intl_PeriodDay'); + this.dateInPeriod = dateInPeriod; } - getPrettyString() { - return format(this.dateInPeriod); - } + Day_createClass(DayPeriod, [{ + key: "getPrettyString", + value: function getPrettyString() { + return format(this.dateInPeriod); + } + }, { + key: "getDateRange", + value: function getDateRange() { + return [new Date(this.dateInPeriod.getTime()), new Date(this.dateInPeriod.getTime())]; + } + }, { + key: "containsToday", + value: function containsToday() { + return todayIsInRange(this.getDateRange()); + } + }], [{ + key: "parse", + value: function parse(strDate) { + return new DayPeriod(parseDate(strDate)); + } + }, { + key: "getDisplayText", + value: function getDisplayText() { + return translate('Intl_PeriodDay'); + } + }]); - getDateRange() { - return [new Date(this.dateInPeriod.getTime()), new Date(this.dateInPeriod.getTime())]; - } + return DayPeriod; +}(); - containsToday() { - return todayIsInRange(this.getDateRange()); - } -} Periods_Periods.addCustomPeriod('day', Day_DayPeriod); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Week.ts +function Week_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Week_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 Week_createClass(Constructor, protoProps, staticProps) { if (protoProps) Week_defineProperties(Constructor.prototype, protoProps); if (staticProps) Week_defineProperties(Constructor, staticProps); return Constructor; } + function Week_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; } /*! @@ -685,44 +802,63 @@ function Week_defineProperty(obj, key, value) { if (key in obj) { Object.defineP -class Week_WeekPeriod { - constructor(dateInPeriod) { - Week_defineProperty(this, "dateInPeriod", void 0); - this.dateInPeriod = dateInPeriod; - } +var Week_WeekPeriod = /*#__PURE__*/function () { + function WeekPeriod(dateInPeriod) { + Week_classCallCheck(this, WeekPeriod); - static parse(strDate) { - return new Week_WeekPeriod(parseDate(strDate)); - } + Week_defineProperty(this, "dateInPeriod", void 0); - static getDisplayText() { - return translate('Intl_PeriodWeek'); + this.dateInPeriod = dateInPeriod; } - getPrettyString() { - const weekDates = this.getDateRange(); - const startWeek = format(weekDates[0]); - const endWeek = format(weekDates[1]); - return translate('General_DateRangeFromTo', [startWeek, endWeek]); - } + Week_createClass(WeekPeriod, [{ + key: "getPrettyString", + value: function getPrettyString() { + var weekDates = this.getDateRange(); + var startWeek = format(weekDates[0]); + var endWeek = format(weekDates[1]); + return translate('General_DateRangeFromTo', [startWeek, endWeek]); + } + }, { + key: "getDateRange", + value: function getDateRange() { + var daysToMonday = (this.dateInPeriod.getDay() + 6) % 7; + var startWeek = new Date(this.dateInPeriod.getTime()); + startWeek.setDate(this.dateInPeriod.getDate() - daysToMonday); + var endWeek = new Date(startWeek.getTime()); + endWeek.setDate(startWeek.getDate() + 6); + return [startWeek, endWeek]; + } + }, { + key: "containsToday", + value: function containsToday() { + return todayIsInRange(this.getDateRange()); + } + }], [{ + key: "parse", + value: function parse(strDate) { + return new WeekPeriod(parseDate(strDate)); + } + }, { + key: "getDisplayText", + value: function getDisplayText() { + return translate('Intl_PeriodWeek'); + } + }]); - getDateRange() { - const daysToMonday = (this.dateInPeriod.getDay() + 6) % 7; - const startWeek = new Date(this.dateInPeriod.getTime()); - startWeek.setDate(this.dateInPeriod.getDate() - daysToMonday); - const endWeek = new Date(startWeek.getTime()); - endWeek.setDate(startWeek.getDate() + 6); - return [startWeek, endWeek]; - } + return WeekPeriod; +}(); - containsToday() { - return todayIsInRange(this.getDateRange()); - } -} Periods_Periods.addCustomPeriod('week', Week_WeekPeriod); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Month.ts +function Month_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Month_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 Month_createClass(Constructor, protoProps, staticProps) { if (protoProps) Month_defineProperties(Constructor.prototype, protoProps); if (staticProps) Month_defineProperties(Constructor, staticProps); return Constructor; } + function Month_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; } /*! @@ -734,43 +870,62 @@ function Month_defineProperty(obj, key, value) { if (key in obj) { Object.define -class Month_MonthPeriod { - constructor(dateInPeriod) { - Month_defineProperty(this, "dateInPeriod", void 0); - this.dateInPeriod = dateInPeriod; - } +var Month_MonthPeriod = /*#__PURE__*/function () { + function MonthPeriod(dateInPeriod) { + Month_classCallCheck(this, MonthPeriod); - static parse(strDate) { - return new Month_MonthPeriod(parseDate(strDate)); - } + Month_defineProperty(this, "dateInPeriod", void 0); - static getDisplayText() { - return translate('Intl_PeriodMonth'); + this.dateInPeriod = dateInPeriod; } - getPrettyString() { - const month = translate(`Intl_Month_Long_StandAlone_${this.dateInPeriod.getMonth() + 1}`); - return `${month} ${this.dateInPeriod.getFullYear()}`; - } + Month_createClass(MonthPeriod, [{ + key: "getPrettyString", + value: function getPrettyString() { + var month = translate("Intl_Month_Long_StandAlone_".concat(this.dateInPeriod.getMonth() + 1)); + return "".concat(month, " ").concat(this.dateInPeriod.getFullYear()); + } + }, { + key: "getDateRange", + value: function getDateRange() { + var startMonth = new Date(this.dateInPeriod.getTime()); + startMonth.setDate(1); + var endMonth = new Date(this.dateInPeriod.getTime()); + endMonth.setDate(1); + endMonth.setMonth(endMonth.getMonth() + 1); + endMonth.setDate(0); + return [startMonth, endMonth]; + } + }, { + key: "containsToday", + value: function containsToday() { + return todayIsInRange(this.getDateRange()); + } + }], [{ + key: "parse", + value: function parse(strDate) { + return new MonthPeriod(parseDate(strDate)); + } + }, { + key: "getDisplayText", + value: function getDisplayText() { + return translate('Intl_PeriodMonth'); + } + }]); - getDateRange() { - const startMonth = new Date(this.dateInPeriod.getTime()); - startMonth.setDate(1); - const endMonth = new Date(this.dateInPeriod.getTime()); - endMonth.setDate(1); - endMonth.setMonth(endMonth.getMonth() + 1); - endMonth.setDate(0); - return [startMonth, endMonth]; - } + return MonthPeriod; +}(); - containsToday() { - return todayIsInRange(this.getDateRange()); - } -} Periods_Periods.addCustomPeriod('month', Month_MonthPeriod); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/Year.ts +function Year_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Year_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 Year_createClass(Constructor, protoProps, staticProps) { if (protoProps) Year_defineProperties(Constructor.prototype, protoProps); if (staticProps) Year_defineProperties(Constructor, staticProps); return Constructor; } + function Year_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; } /*! @@ -782,40 +937,53 @@ function Year_defineProperty(obj, key, value) { if (key in obj) { Object.defineP -class Year_YearPeriod { - constructor(dateInPeriod) { - Year_defineProperty(this, "dateInPeriod", void 0); - this.dateInPeriod = dateInPeriod; - } +var Year_YearPeriod = /*#__PURE__*/function () { + function YearPeriod(dateInPeriod) { + Year_classCallCheck(this, YearPeriod); - static parse(strDate) { - return new Year_YearPeriod(parseDate(strDate)); - } + Year_defineProperty(this, "dateInPeriod", void 0); - static getDisplayText() { - return translate('Intl_PeriodYear'); + this.dateInPeriod = dateInPeriod; } - getPrettyString() { - return this.dateInPeriod.getFullYear().toString(); - } + Year_createClass(YearPeriod, [{ + key: "getPrettyString", + value: function getPrettyString() { + return this.dateInPeriod.getFullYear().toString(); + } + }, { + key: "getDateRange", + value: function getDateRange() { + var startYear = new Date(this.dateInPeriod.getTime()); + startYear.setMonth(0); + startYear.setDate(1); + var endYear = new Date(this.dateInPeriod.getTime()); + endYear.setMonth(12); + endYear.setDate(0); + return [startYear, endYear]; + } + }, { + key: "containsToday", + value: function containsToday() { + return todayIsInRange(this.getDateRange()); + } + }], [{ + key: "parse", + value: function parse(strDate) { + return new YearPeriod(parseDate(strDate)); + } + }, { + key: "getDisplayText", + value: function getDisplayText() { + return translate('Intl_PeriodYear'); + } + }]); - getDateRange() { - const startYear = new Date(this.dateInPeriod.getTime()); - startYear.setMonth(0); - startYear.setDate(1); - const endYear = new Date(this.dateInPeriod.getTime()); - endYear.setMonth(12); - endYear.setDate(0); - return [startYear, endYear]; - } + return YearPeriod; +}(); - containsToday() { - return todayIsInRange(this.getDateRange()); - } -} Periods_Periods.addCustomPeriod('year', Year_YearPeriod); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Periods/index.ts /*! @@ -833,6 +1001,16 @@ Periods_Periods.addCustomPeriod('year', Year_YearPeriod); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.ts +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { MatomoUrl_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function MatomoUrl_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function MatomoUrl_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 MatomoUrl_createClass(Constructor, protoProps, staticProps) { if (protoProps) MatomoUrl_defineProperties(Constructor.prototype, protoProps); if (staticProps) MatomoUrl_defineProperties(Constructor, staticProps); return Constructor; } + function MatomoUrl_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; } /*! @@ -845,10 +1023,9 @@ function MatomoUrl_defineProperty(obj, key, value) { if (key in obj) { Object.de // important to load all periods here -const { - piwik: MatomoUrl_piwik, - broadcast: MatomoUrl_broadcast -} = window; +var MatomoUrl_window = window, + MatomoUrl_piwik = MatomoUrl_window.piwik, + MatomoUrl_broadcast = MatomoUrl_window.broadcast; function isValidPeriod(periodStr, dateStr) { try { @@ -863,98 +1040,117 @@ function isValidPeriod(periodStr, dateStr) { */ -class MatomoUrl_MatomoUrl { - constructor() { +var MatomoUrl_MatomoUrl = /*#__PURE__*/function () { + function MatomoUrl() { + var _this = this; + + MatomoUrl_classCallCheck(this, MatomoUrl); + MatomoUrl_defineProperty(this, "urlQuery", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])('')); MatomoUrl_defineProperty(this, "hashQuery", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])('')); - MatomoUrl_defineProperty(this, "urlParsed", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(MatomoUrl_broadcast.getValuesFromUrl(`?${this.urlQuery.value}`, true)))); + MatomoUrl_defineProperty(this, "urlParsed", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(MatomoUrl_broadcast.getValuesFromUrl("?".concat(_this.urlQuery.value), true)); + })); - MatomoUrl_defineProperty(this, "hashParsed", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(MatomoUrl_broadcast.getValuesFromUrl(`?${this.hashQuery.value}`, true)))); + MatomoUrl_defineProperty(this, "hashParsed", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(MatomoUrl_broadcast.getValuesFromUrl("?".concat(_this.hashQuery.value), true)); + })); - MatomoUrl_defineProperty(this, "parsed", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])({ ...this.urlParsed.value, - ...this.hashParsed.value - }))); + MatomoUrl_defineProperty(this, "parsed", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_objectSpread(_objectSpread({}, _this.urlParsed.value), _this.hashParsed.value)); + })); this.setUrlQuery(window.location.search); this.setHashQuery(window.location.hash); // $locationChangeSuccess is triggered before angularjs changes actual window the hash, so we // have to hook into this method if we want our event handlers to execute before other angularjs // handlers (like the reporting page one) - Matomo_Matomo.on('$locationChangeSuccess', absUrl => { - const url = new URL(absUrl); - this.setUrlQuery(url.search.replace(/^\?/, '')); - this.setHashQuery(url.hash.replace(/^#/, '')); + Matomo_Matomo.on('$locationChangeSuccess', function (absUrl) { + var url = new URL(absUrl); + + _this.setUrlQuery(url.search.replace(/^\?/, '')); + + _this.setHashQuery(url.hash.replace(/^#/, '')); }); this.updatePeriodParamsFromUrl(); } - updateHash(params) { - const serializedParams = typeof params !== 'string' ? this.stringify(params) : params; - const $location = Matomo_Matomo.helper.getAngularDependency('$location'); - $location.search(serializedParams); - } - - getSearchParam(paramName) { - const hash = window.location.href.split('#'); - const regex = new RegExp(`${paramName}(\\[]|=)`); - - if (hash && hash[1] && regex.test(decodeURIComponent(hash[1]))) { - const valueFromHash = window.broadcast.getValueFromHash(paramName, window.location.href); // for date, period and idsite fall back to parameter from url, if non in hash was provided - - if (valueFromHash || paramName !== 'date' && paramName !== 'period' && paramName !== 'idSite') { - return valueFromHash; - } + MatomoUrl_createClass(MatomoUrl, [{ + key: "updateHash", + value: function updateHash(params) { + var serializedParams = typeof params !== 'string' ? this.stringify(params) : params; + var $location = Matomo_Matomo.helper.getAngularDependency('$location'); + $location.search(serializedParams); } + }, { + key: "getSearchParam", + value: function getSearchParam(paramName) { + var hash = window.location.href.split('#'); + var regex = new RegExp("".concat(paramName, "(\\[]|=)")); - return window.broadcast.getValueFromUrl(paramName, window.location.search); - } - - stringify(search) { - // TODO: using $ since URLSearchParams does not handle array params the way Matomo uses them - return $.param(search).replace(/%5B%5D/g, '[]'); - } + if (hash && hash[1] && regex.test(decodeURIComponent(hash[1]))) { + var valueFromHash = window.broadcast.getValueFromHash(paramName, window.location.href); // for date, period and idsite fall back to parameter from url, if non in hash was provided - updatePeriodParamsFromUrl() { - let date = this.getSearchParam('date'); - const period = this.getSearchParam('period'); + if (valueFromHash || paramName !== 'date' && paramName !== 'period' && paramName !== 'idSite') { + return valueFromHash; + } + } - if (!isValidPeriod(period, date)) { - // invalid data in URL - return; + return window.broadcast.getValueFromUrl(paramName, window.location.search); } - - if (MatomoUrl_piwik.period === period && MatomoUrl_piwik.currentDateString === date) { - // this period / date is already loaded - return; + }, { + key: "stringify", + value: function stringify(search) { + // TODO: using $ since URLSearchParams does not handle array params the way Matomo uses them + return $.param(search).replace(/%5B%5D/g, '[]'); } + }, { + key: "updatePeriodParamsFromUrl", + value: function updatePeriodParamsFromUrl() { + var date = this.getSearchParam('date'); + var period = this.getSearchParam('period'); - MatomoUrl_piwik.period = period; - const dateRange = Periods_Periods.parse(period, date).getDateRange(); - MatomoUrl_piwik.startDateString = format(dateRange[0]); - MatomoUrl_piwik.endDateString = format(dateRange[1]); - MatomoUrl_piwik.updateDateInTitle(date, period); // do not set anything to previousN/lastN, as it's more useful to plugins - // to have the dates than previousN/lastN. + if (!isValidPeriod(period, date)) { + // invalid data in URL + return; + } - if (MatomoUrl_piwik.period === 'range') { - date = `${MatomoUrl_piwik.startDateString},${MatomoUrl_piwik.endDateString}`; - } + if (MatomoUrl_piwik.period === period && MatomoUrl_piwik.currentDateString === date) { + // this period / date is already loaded + return; + } - MatomoUrl_piwik.currentDateString = date; - } + MatomoUrl_piwik.period = period; + var dateRange = Periods_Periods.parse(period, date).getDateRange(); + MatomoUrl_piwik.startDateString = format(dateRange[0]); + MatomoUrl_piwik.endDateString = format(dateRange[1]); + MatomoUrl_piwik.updateDateInTitle(date, period); // do not set anything to previousN/lastN, as it's more useful to plugins + // to have the dates than previousN/lastN. - setUrlQuery(search) { - this.urlQuery.value = search.replace(/^\?/, ''); - } + if (MatomoUrl_piwik.period === 'range') { + date = "".concat(MatomoUrl_piwik.startDateString, ",").concat(MatomoUrl_piwik.endDateString); + } - setHashQuery(hash) { - this.hashQuery.value = hash.replace(/^[#/?]+/, ''); - } + MatomoUrl_piwik.currentDateString = date; + } + }, { + key: "setUrlQuery", + value: function setUrlQuery(search) { + this.urlQuery.value = search.replace(/^\?/, ''); + } + }, { + key: "setHashQuery", + value: function setHashQuery(hash) { + this.hashQuery.value = hash.replace(/^[#/?]+/, ''); + } + }]); -} + return MatomoUrl; +}(); -const instance = new MatomoUrl_MatomoUrl(); +var instance = new MatomoUrl_MatomoUrl(); /* harmony default export */ var src_MatomoUrl_MatomoUrl = (instance); MatomoUrl_piwik.updatePeriodParamsFromUrl = instance.updatePeriodParamsFromUrl.bind(instance); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MatomoUrl/MatomoUrl.adapter.ts @@ -967,7 +1163,7 @@ MatomoUrl_piwik.updatePeriodParamsFromUrl = instance.updatePeriodParamsFromUrl.b function piwikUrl() { - const model = { + var model = { getSearchParam: src_MatomoUrl_MatomoUrl.getSearchParam.bind(src_MatomoUrl_MatomoUrl) }; return model; @@ -994,15 +1190,23 @@ function initPiwikService(piwik, $rootScope) { // overwrite $rootScope so all events also go through Matomo.postEvent(...) too. $rootScope.$oldEmit = $rootScope.$emit; // eslint-disable-line - $rootScope.$emit = function emitWrapper(name, ...args) { - return Matomo_Matomo.postEvent(name, ...args); + $rootScope.$emit = function emitWrapper(name) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + return Matomo_Matomo.postEvent.apply(Matomo_Matomo, [name].concat(args)); }; $rootScope.$oldBroadcast = $rootScope.$broadcast; // eslint-disable-line - $rootScope.$broadcast = function broadcastWrapper(name, ...args) { - Matomo_Matomo.postEventNoEmit(name, ...args); - return $rootScope.$oldBroadcast(name, ...args); // eslint-disable-line + $rootScope.$broadcast = function broadcastWrapper(name) { + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + Matomo_Matomo.postEventNoEmit.apply(Matomo_Matomo, [name].concat(args)); + return $rootScope.$oldBroadcast.apply($rootScope, [name].concat(args)); // eslint-disable-line }; $rootScope.$on('$locationChangeSuccess', piwik.updatePeriodParamsFromUrl); @@ -1011,6 +1215,16 @@ function initPiwikService(piwik, $rootScope) { initPiwikService.$inject = ['piwik', '$rootScope']; window.angular.module('piwikApp.service').run(initPiwikService); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.ts +function AjaxHelper_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function AjaxHelper_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { AjaxHelper_ownKeys(Object(source), true).forEach(function (key) { AjaxHelper_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { AjaxHelper_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function AjaxHelper_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function AjaxHelper_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 AjaxHelper_createClass(Constructor, protoProps, staticProps) { if (protoProps) AjaxHelper_defineProperties(Constructor.prototype, protoProps); if (staticProps) AjaxHelper_defineProperties(Constructor, staticProps); return Constructor; } + function AjaxHelper_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; } /*! @@ -1025,24 +1239,32 @@ window.globalAjaxQueue = []; window.globalAjaxQueue.active = 0; window.globalAjaxQueue.clean = function globalAjaxQueueClean() { - for (let i = this.length; i >= 0; i -= 1) { + for (var i = this.length; i >= 0; i -= 1) { if (!this[i] || this[i].readyState === 4) { this.splice(i, 1); } } }; -window.globalAjaxQueue.push = function globalAjaxQueuePush(...args) { +window.globalAjaxQueue.push = function globalAjaxQueuePush() { + var _Array$prototype$push; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + this.active += args.length; // cleanup ajax queue this.clean(); // call original array push - return Array.prototype.push.call(this, ...args); + return (_Array$prototype$push = Array.prototype.push).call.apply(_Array$prototype$push, [this].concat(args)); }; window.globalAjaxQueue.abort = function globalAjaxQueueAbort() { // abort all queued requests if possible - this.forEach(x => x && x.abort && x.abort()); // remove all elements from array + this.forEach(function (x) { + return x && x.abort && x.abort(); + }); // remove all elements from array this.splice(0, this.length); this.active = 0; @@ -1059,12 +1281,12 @@ function defaultErrorCallback(deferred, status) { } if (typeof Piwik_Popover === 'undefined') { - console.log(`Request failed: ${deferred.responseText}`); // mostly for tests + console.log("Request failed: ".concat(deferred.responseText)); // mostly for tests return; } - const loadingError = $('#loadingError'); + var loadingError = $('#loadingError'); if (Piwik_Popover.isOpen() && deferred && deferred.status === 500) { if (deferred && deferred.status === 500) { @@ -1079,80 +1301,10 @@ function defaultErrorCallback(deferred, status) { */ -class AjaxHelper_AjaxHelper { - /** - * Format of response - */ - - /** - * A timeout for the request which will override any global timeout - */ - - /** - * Callback function to be executed on success - */ - - /** - * Use this.callback if an error is returned - */ - - /** - * Callback function to be executed on error - * - * @deprecated use the jquery promise API - */ - - /** - * Callback function to be executed on complete (after error or success) - * - * @deprecated use the jquery promise API - */ - - /** - * Params to be passed as GET params - * @see ajaxHelper.mixinDefaultGetParams - */ - - /** - * Base URL used in the AJAX request. Can be set by setUrl. - * - * It is set to '?' rather than 'index.php?' to increase chances that it works - * including for users who have an automatic 301 redirection from index.php? to ? - * POST values are missing when there is such 301 redirection. So by by-passing - * this 301 redirection, we avoid this issue. - * - * @see ajaxHelper.setUrl - */ - - /** - * Params to be passed as GET params - * @see ajaxHelper.mixinDefaultPostParams - */ +var AjaxHelper_AjaxHelper = /*#__PURE__*/function () { + function AjaxHelper() { + AjaxHelper_classCallCheck(this, AjaxHelper); - /** - * Element to be displayed while loading - */ - - /** - * Element to be displayed on error - */ - - /** - * Handle for current request - */ - // helper method entry point - static fetch(params) { - const helper = new AjaxHelper_AjaxHelper(); - helper.setFormat('json'); - helper.addParams({ - module: 'API', - format: 'json', - ...params - }, 'get'); - return helper.send(); - } - - constructor() { AjaxHelper_defineProperty(this, "format", 'json'); AjaxHelper_defineProperty(this, "timeout", null); @@ -1193,368 +1345,487 @@ class AjaxHelper_AjaxHelper { */ - addParams(initialParams, type) { - const params = typeof initialParams === 'string' ? window.broadcast.getValuesFromUrl(initialParams) : initialParams; - const arrayParams = ['compareSegments', 'comparePeriods', 'compareDates']; - Object.keys(params).forEach(key => { - const value = params[key]; - - if (arrayParams.indexOf(key) !== -1 && !value) { - return; - } - - if (type.toLowerCase() === 'get') { - this.getParams[key] = value; - } else if (type.toLowerCase() === 'post') { - this.postParams[key] = value; - } - }); - } + AjaxHelper_createClass(AjaxHelper, [{ + key: "addParams", + value: function addParams(initialParams, type) { + var _this = this; - withTokenInUrl() { - this.withToken = true; - } - /** - * Sets the base URL to use in the AJAX request. - */ + var params = typeof initialParams === 'string' ? window.broadcast.getValuesFromUrl(initialParams) : initialParams; + var arrayParams = ['compareSegments', 'comparePeriods', 'compareDates']; + Object.keys(params).forEach(function (key) { + var value = params[key]; + if (arrayParams.indexOf(key) !== -1 && !value) { + return; + } - setUrl(url) { - this.addParams(broadcast.getValuesFromUrl(url), 'GET'); - } - /** - * Gets this helper instance ready to send a bulk request. Each argument to this - * function is a single request to use. - */ + if (type.toLowerCase() === 'get') { + _this.getParams[key] = value; + } else if (type.toLowerCase() === 'post') { + _this.postParams[key] = value; + } + }); + } + }, { + key: "withTokenInUrl", + value: function withTokenInUrl() { + this.withToken = true; + } + /** + * Sets the base URL to use in the AJAX request. + */ + }, { + key: "setUrl", + value: function setUrl(url) { + this.addParams(broadcast.getValuesFromUrl(url), 'GET'); + } + /** + * Gets this helper instance ready to send a bulk request. Each argument to this + * function is a single request to use. + */ - setBulkRequests(...urls) { - const urlsProcessed = urls.map(u => typeof u === 'string' ? u : $.param(u)); - this.addParams({ - module: 'API', - method: 'API.getBulkRequest', - urls: urlsProcessed, - format: 'json' - }, 'post'); - } - /** - * Set a timeout (in milliseconds) for the request. This will override any global timeout. - * - * @param timeout Timeout in milliseconds - */ + }, { + key: "setBulkRequests", + value: function setBulkRequests() { + for (var _len2 = arguments.length, urls = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + urls[_key2] = arguments[_key2]; + } + var urlsProcessed = urls.map(function (u) { + return typeof u === 'string' ? u : $.param(u); + }); + this.addParams({ + module: 'API', + method: 'API.getBulkRequest', + urls: urlsProcessed, + format: 'json' + }, 'post'); + } + /** + * Set a timeout (in milliseconds) for the request. This will override any global timeout. + * + * @param timeout Timeout in milliseconds + */ - setTimeout(timeout) { - this.timeout = timeout; - } - /** - * Sets the callback called after the request finishes - * - * @param callback Callback function - * @deprecated use the jquery promise API - */ + }, { + key: "setTimeout", + value: function setTimeout(timeout) { + this.timeout = timeout; + } + /** + * Sets the callback called after the request finishes + * + * @param callback Callback function + * @deprecated use the jquery promise API + */ + }, { + key: "setCallback", + value: function setCallback(callback) { + this.callback = callback; + } + /** + * Set that the callback passed to setCallback() should be used if an application error (i.e. an + * Exception in PHP) is returned. + */ - setCallback(callback) { - this.callback = callback; - } - /** - * Set that the callback passed to setCallback() should be used if an application error (i.e. an - * Exception in PHP) is returned. - */ + }, { + key: "useCallbackInCaseOfError", + value: function useCallbackInCaseOfError() { + this.useRegularCallbackInCaseOfError = true; + } + /** + * Set callback to redirect on success handler + * &update=1(+x) will be appended to the current url + * + * @param [params] to modify in redirect url + * @return {void} + */ + }, { + key: "redirectOnSuccess", + value: function redirectOnSuccess(params) { + this.setCallback(function () { + piwikHelper.redirect(params); + }); + } + /** + * Sets the callback called in case of an error within the request + * + * @deprecated use the jquery promise API + */ - useCallbackInCaseOfError() { - this.useRegularCallbackInCaseOfError = true; - } - /** - * Set callback to redirect on success handler - * &update=1(+x) will be appended to the current url - * - * @param [params] to modify in redirect url - * @return {void} - */ + }, { + key: "setErrorCallback", + value: function setErrorCallback(callback) { + this.errorCallback = callback; + } + /** + * Sets the complete callback which is called after an error or success callback. + * + * @deprecated use the jquery promise API + */ + }, { + key: "setCompleteCallback", + value: function setCompleteCallback(callback) { + this.completeCallback = callback; + } + /** + * Sets the response format for the request + * + * @param format response format (e.g. json, html, ...) + */ - redirectOnSuccess(params) { - this.setCallback(() => { - piwikHelper.redirect(params); - }); - } - /** - * Sets the callback called in case of an error within the request - * - * @deprecated use the jquery promise API - */ + }, { + key: "setFormat", + value: function setFormat(format) { + this.format = format; + } + /** + * Set the div element to show while request is loading + * + * @param [element] selector for the loading element + */ + }, { + key: "setLoadingElement", + value: function setLoadingElement(element) { + this.loadingElement = element || '#ajaxLoadingDiv'; + } + /** + * Set the div element to show on error + * + * @param element selector for the error element + */ - setErrorCallback(callback) { - this.errorCallback = callback; - } - /** - * Sets the complete callback which is called after an error or success callback. - * - * @deprecated use the jquery promise API - */ + }, { + key: "setErrorElement", + value: function setErrorElement(element) { + if (!element) { + return; + } + this.errorElement = element; + } + /** + * Detect whether are allowed to use the given default parameter or not + */ - setCompleteCallback(callback) { - this.completeCallback = callback; - } - /** - * Sets the response format for the request - * - * @param format response format (e.g. json, html, ...) - */ + }, { + key: "useGETDefaultParameter", + value: function useGETDefaultParameter(parameter) { + if (parameter && this.defaultParams) { + for (var i = 0; i < this.defaultParams.length; i += 1) { + if (this.defaultParams[i] === parameter) { + return true; + } + } + } + return false; + } + /** + * Removes a default parameter that is usually send automatically along the request. + * + * @param parameter A name such as "period", "date", "segment". + */ - setFormat(format) { - this.format = format; - } - /** - * Set the div element to show while request is loading - * - * @param [element] selector for the loading element - */ + }, { + key: "removeDefaultParameter", + value: function removeDefaultParameter(parameter) { + if (parameter && this.defaultParams) { + for (var i = 0; i < this.defaultParams.length; i += 1) { + if (this.defaultParams[i] === parameter) { + this.defaultParams.splice(i, 1); + } + } + } + } + /** + * Send the request + */ + }, { + key: "send", + value: function send() { + var _this2 = this; - setLoadingElement(element) { - this.loadingElement = element || '#ajaxLoadingDiv'; - } - /** - * Set the div element to show on error - * - * @param element selector for the error element - */ + if ($(this.errorElement).length) { + $(this.errorElement).hide(); + } + if (this.loadingElement) { + $(this.loadingElement).fadeIn(); + } - setErrorElement(element) { - if (!element) { - return; + this.requestHandle = this.buildAjaxCall(); + window.globalAjaxQueue.push(this.requestHandle); + return new Promise(function (resolve, reject) { + _this2.requestHandle.then(resolve).fail(function (xhr) { + if (xhr.statusText !== 'abort') { + console.log("Warning: the ".concat($.param(_this2.getParams), " request failed!")); + reject(xhr); + } + }); + }); } + /** + * Aborts the current request if it is (still) running + */ - this.errorElement = element; - } - /** - * Detect whether are allowed to use the given default parameter or not - */ - - - useGETDefaultParameter(parameter) { - if (parameter && this.defaultParams) { - for (let i = 0; i < this.defaultParams.length; i += 1) { - if (this.defaultParams[i] === parameter) { - return true; - } + }, { + key: "abort", + value: function abort() { + if (this.requestHandle && typeof this.requestHandle.abort === 'function') { + this.requestHandle.abort(); + this.requestHandle = null; } } + /** + * Builds and sends the ajax requests + */ - return false; - } - /** - * Removes a default parameter that is usually send automatically along the request. - * - * @param parameter A name such as "period", "date", "segment". - */ + }, { + key: "buildAjaxCall", + value: function buildAjaxCall() { + var _this3 = this; + var self = this; + var parameters = this.mixinDefaultGetParams(this.getParams); + var url = this.getUrl; - removeDefaultParameter(parameter) { - if (parameter && this.defaultParams) { - for (let i = 0; i < this.defaultParams.length; i += 1) { - if (this.defaultParams[i] === parameter) { - this.defaultParams.splice(i, 1); - } - } - } - } - /** - * Send the request - */ + if (url[url.length - 1] !== '?') { + url += '&'; + } // we took care of encoding &segment properly already, so we don't use $.param for it ($.param + // URL encodes the values) - send() { - if ($(this.errorElement).length) { - $(this.errorElement).hide(); - } + if (parameters.segment) { + url = "".concat(url, "segment=").concat(parameters.segment, "&"); + delete parameters.segment; + } - if (this.loadingElement) { - $(this.loadingElement).fadeIn(); - } + if (parameters.date) { + url = "".concat(url, "date=").concat(decodeURIComponent(parameters.date.toString()), "&"); + delete parameters.date; + } - this.requestHandle = this.buildAjaxCall(); - window.globalAjaxQueue.push(this.requestHandle); - return new Promise((resolve, reject) => { - this.requestHandle.then(resolve).fail(xhr => { - if (xhr.statusText !== 'abort') { - console.log(`Warning: the ${$.param(this.getParams)} request failed!`); - reject(xhr); - } - }); - }); - } - /** - * Aborts the current request if it is (still) running - */ + url += $.param(parameters); + var ajaxCall = { + type: 'POST', + async: true, + url: url, + dataType: this.format || 'json', + complete: this.completeCallback, + error: function errorCallback() { + window.globalAjaxQueue.active -= 1; + + if (self.errorCallback) { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + self.errorCallback.apply(this, args); + } + }, + success: function success(response, status, request) { + if (_this3.loadingElement) { + $(_this3.loadingElement).hide(); + } - abort() { - if (this.requestHandle && typeof this.requestHandle.abort === 'function') { - this.requestHandle.abort(); - this.requestHandle = null; - } - } - /** - * Builds and sends the ajax requests - */ + if (response && response.result === 'error' && !_this3.useRegularCallbackInCaseOfError) { + var placeAt = null; + var type = 'toast'; + if ($(_this3.errorElement).length && response.message) { + $(_this3.errorElement).show(); + placeAt = _this3.errorElement; + type = null; + } - buildAjaxCall() { - const self = this; - const parameters = this.mixinDefaultGetParams(this.getParams); - let url = this.getUrl; + if (response.message) { + var UI = window['require']('piwik/UI'); // eslint-disable-line - if (url[url.length - 1] !== '?') { - url += '&'; - } // we took care of encoding &segment properly already, so we don't use $.param for it ($.param - // URL encodes the values) + var notification = new UI.Notification(); + notification.show(response.message, { + placeat: placeAt, + context: 'error', + type: type, + id: 'ajaxHelper' + }); + notification.scrollToNotification(); + } + } else if (_this3.callback) { + _this3.callback(response, status, request); + } + window.globalAjaxQueue.active -= 1; - if (parameters.segment) { - url = `${url}segment=${parameters.segment}&`; - delete parameters.segment; + if (Matomo_Matomo.ajaxRequestFinished) { + Matomo_Matomo.ajaxRequestFinished(); + } + }, + data: this.mixinDefaultPostParams(this.postParams), + timeout: this.timeout !== null ? this.timeout : undefined + }; + return $.ajax(ajaxCall); } + }, { + key: "isRequestToApiMethod", + value: function isRequestToApiMethod() { + return this.getParams && this.getParams.module === 'API' && this.getParams.method || this.postParams && this.postParams.module === 'API' && this.postParams.method; + } + }, { + key: "isWidgetizedRequest", + value: function isWidgetizedRequest() { + return broadcast.getValueFromUrl('module') === 'Widgetize'; + } + }, { + key: "getDefaultPostParams", + value: function getDefaultPostParams() { + if (this.withToken || this.isRequestToApiMethod() || Matomo_Matomo.shouldPropagateTokenAuth) { + return { + token_auth: Matomo_Matomo.token_auth, + // When viewing a widgetized report there won't be any session that can be used, so don't + // force session usage + force_api_session: broadcast.isWidgetizeRequestWithoutSession() ? 0 : 1 + }; + } - if (parameters.date) { - url = `${url}date=${decodeURIComponent(parameters.date.toString())}&`; - delete parameters.date; + return {}; } + /** + * Mixin the default parameters to send as POST + * + * @param params parameter object + */ - url += $.param(parameters); - const ajaxCall = { - type: 'POST', - async: true, - url, - dataType: this.format || 'json', - complete: this.completeCallback, - error: function errorCallback(...args) { - window.globalAjaxQueue.active -= 1; + }, { + key: "mixinDefaultPostParams", + value: function mixinDefaultPostParams(params) { + var defaultParams = this.getDefaultPostParams(); - if (self.errorCallback) { - self.errorCallback.apply(this, args); - } - }, - success: (response, status, request) => { - if (this.loadingElement) { - $(this.loadingElement).hide(); - } + var mergedParams = AjaxHelper_objectSpread(AjaxHelper_objectSpread({}, defaultParams), params); - if (response && response.result === 'error' && !this.useRegularCallbackInCaseOfError) { - let placeAt = null; - let type = 'toast'; + return mergedParams; + } + /** + * Mixin the default parameters to send as GET + * + * @param params parameter object + */ - if ($(this.errorElement).length && response.message) { - $(this.errorElement).show(); - placeAt = this.errorElement; - type = null; - } + }, { + key: "mixinDefaultGetParams", + value: function mixinDefaultGetParams(originalParams) { + var _this4 = this; + + var segment = src_MatomoUrl_MatomoUrl.getSearchParam('segment'); + var defaultParams = { + idSite: Matomo_Matomo.idSite ? Matomo_Matomo.idSite.toString() : broadcast.getValueFromUrl('idSite'), + period: Matomo_Matomo.period || broadcast.getValueFromUrl('period'), + segment: segment + }; + var params = originalParams; // never append token_auth to url - if (response.message) { - const UI = window['require']('piwik/UI'); // eslint-disable-line + if (params.token_auth) { + params.token_auth = null; + delete params.token_auth; + } - const notification = new UI.Notification(); - notification.show(response.message, { - placeat: placeAt, - context: 'error', - type, - id: 'ajaxHelper' - }); - notification.scrollToNotification(); - } - } else if (this.callback) { - this.callback(response, status, request); + Object.keys(defaultParams).forEach(function (key) { + if (_this4.useGETDefaultParameter(key) && !params[key] && !_this4.postParams[key] && defaultParams[key]) { + params[key] = defaultParams[key]; } + }); // handle default date & period if not already set - window.globalAjaxQueue.active -= 1; + if (this.useGETDefaultParameter('date') && !params.date && !this.postParams.date) { + params.date = Matomo_Matomo.currentDateString; + } - if (Matomo_Matomo.ajaxRequestFinished) { - Matomo_Matomo.ajaxRequestFinished(); - } - }, - data: this.mixinDefaultPostParams(this.postParams), - timeout: this.timeout !== null ? this.timeout : undefined - }; - return $.ajax(ajaxCall); - } + return params; + } + }], [{ + key: "fetch", + value: + /** + * Format of response + */ - isRequestToApiMethod() { - return this.getParams && this.getParams.module === 'API' && this.getParams.method || this.postParams && this.postParams.module === 'API' && this.postParams.method; - } + /** + * A timeout for the request which will override any global timeout + */ - isWidgetizedRequest() { - return broadcast.getValueFromUrl('module') === 'Widgetize'; - } + /** + * Callback function to be executed on success + */ - getDefaultPostParams() { - if (this.withToken || this.isRequestToApiMethod() || Matomo_Matomo.shouldPropagateTokenAuth) { - return { - token_auth: Matomo_Matomo.token_auth, - // When viewing a widgetized report there won't be any session that can be used, so don't - // force session usage - force_api_session: broadcast.isWidgetizeRequestWithoutSession() ? 0 : 1 - }; - } + /** + * Use this.callback if an error is returned + */ - return {}; - } - /** - * Mixin the default parameters to send as POST - * - * @param params parameter object - */ + /** + * Callback function to be executed on error + * + * @deprecated use the jquery promise API + */ + /** + * Callback function to be executed on complete (after error or success) + * + * @deprecated use the jquery promise API + */ - mixinDefaultPostParams(params) { - const defaultParams = this.getDefaultPostParams(); - const mergedParams = { ...defaultParams, - ...params - }; - return mergedParams; - } - /** - * Mixin the default parameters to send as GET - * - * @param params parameter object - */ + /** + * Params to be passed as GET params + * @see ajaxHelper.mixinDefaultGetParams + */ + /** + * Base URL used in the AJAX request. Can be set by setUrl. + * + * It is set to '?' rather than 'index.php?' to increase chances that it works + * including for users who have an automatic 301 redirection from index.php? to ? + * POST values are missing when there is such 301 redirection. So by by-passing + * this 301 redirection, we avoid this issue. + * + * @see ajaxHelper.setUrl + */ - mixinDefaultGetParams(originalParams) { - const segment = src_MatomoUrl_MatomoUrl.getSearchParam('segment'); - const defaultParams = { - idSite: Matomo_Matomo.idSite ? Matomo_Matomo.idSite.toString() : broadcast.getValueFromUrl('idSite'), - period: Matomo_Matomo.period || broadcast.getValueFromUrl('period'), - segment - }; - const params = originalParams; // never append token_auth to url + /** + * Params to be passed as GET params + * @see ajaxHelper.mixinDefaultPostParams + */ - if (params.token_auth) { - params.token_auth = null; - delete params.token_auth; - } + /** + * Element to be displayed while loading + */ - Object.keys(defaultParams).forEach(key => { - if (this.useGETDefaultParameter(key) && !params[key] && !this.postParams[key] && defaultParams[key]) { - params[key] = defaultParams[key]; - } - }); // handle default date & period if not already set + /** + * Element to be displayed on error + */ - if (this.useGETDefaultParameter('date') && !params.date && !this.postParams.date) { - params.date = Matomo_Matomo.currentDateString; + /** + * Handle for current request + */ + // helper method entry point + function fetch(params) { + var helper = new AjaxHelper(); + helper.setFormat('json'); + helper.addParams(AjaxHelper_objectSpread({ + module: 'API', + format: 'json' + }, params), 'get'); + return helper.send(); } + }]); + + return AjaxHelper; +}(); - return params; - } -} // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.adapter.ts window.ajaxHelper = AjaxHelper_AjaxHelper; @@ -1566,7 +1837,7 @@ function ajaxQueue() { angular.module('piwikApp.service').service('globalAjaxQueue', ajaxQueue); // 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/CoreHome/vue/src/MatomoDialog/MatomoDialog.vue?vue&type=template&id=15ad69b4 -const _hoisted_1 = { +var _hoisted_1 = { ref: "root" }; function render(_ctx, _cache, $props, $setup, $data, $options) { @@ -1600,31 +1871,32 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { } }, emits: ['yes', 'no', 'closeEnd', 'close', 'update:modelValue'], - - activated() { + activated: function activated() { this.$emit('update:modelValue', false); }, - watch: { - modelValue(newValue, oldValue) { + modelValue: function modelValue(newValue, oldValue) { + var _this = this; + if (newValue) { - const slotElement = this.element || this.$refs.root.firstElementChild; + var slotElement = this.element || this.$refs.root.firstElementChild; Matomo_Matomo.helper.modalConfirm(slotElement, { - yes: () => { - this.$emit('yes'); + yes: function yes() { + _this.$emit('yes'); }, - no: () => { - this.$emit('no'); + no: function no() { + _this.$emit('no'); } }, { - onCloseEnd: () => { + onCloseEnd: function onCloseEnd() { // materialize removes the child element, so we move it back to the slot - if (!this.element) { - this.$refs.root.appendChild(slotElement); + if (!_this.element) { + _this.$refs.root.appendChild(slotElement); } - this.$emit('update:modelValue', false); - this.$emit('closeEnd'); + _this.$emit('update:modelValue', false); + + _this.$emit('closeEnd'); } }); } else if (newValue === false && oldValue === true) { @@ -1632,7 +1904,6 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { this.$emit('close'); } } - } })); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/MatomoDialog/MatomoDialog.vue?vue&type=script&lang=ts @@ -1645,6 +1916,18 @@ MatomoDialogvue_type_script_lang_ts.render = render /* harmony default export */ var MatomoDialog = (MatomoDialogvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/createAngularJsAdapter.ts +function createAngularJsAdapter_slicedToArray(arr, i) { return createAngularJsAdapter_arrayWithHoles(arr) || createAngularJsAdapter_iterableToArrayLimit(arr, i) || createAngularJsAdapter_unsupportedIterableToArray(arr, i) || createAngularJsAdapter_nonIterableRest(); } + +function createAngularJsAdapter_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 createAngularJsAdapter_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return createAngularJsAdapter_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 createAngularJsAdapter_arrayLikeToArray(o, minLen); } + +function createAngularJsAdapter_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 createAngularJsAdapter_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 createAngularJsAdapter_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + /*! * Matomo - free/libre analytics platform * @@ -1653,28 +1936,33 @@ MatomoDialogvue_type_script_lang_ts.render = render */ -let transcludeCounter = 0; +var transcludeCounter = 0; function createAngularJsAdapter(options) { - const { - component, - scope = {}, - events = {}, - $inject, - directiveName, - transclude, - mountPointFactory, - postCreate, - noScope, - restrict = 'A' - } = options; - const currentTranscludeCounter = transcludeCounter; + var component = options.component, + _options$scope = options.scope, + scope = _options$scope === void 0 ? {} : _options$scope, + _options$events = options.events, + events = _options$events === void 0 ? {} : _options$events, + $inject = options.$inject, + directiveName = options.directiveName, + transclude = options.transclude, + mountPointFactory = options.mountPointFactory, + postCreate = options.postCreate, + noScope = options.noScope, + _options$restrict = options.restrict, + restrict = _options$restrict === void 0 ? 'A' : _options$restrict; + var currentTranscludeCounter = transcludeCounter; if (transclude) { transcludeCounter += 1; } - const angularJsScope = {}; - Object.entries(scope).forEach(([scopeVarName, info]) => { + var angularJsScope = {}; + Object.entries(scope).forEach(function (_ref) { + var _ref2 = createAngularJsAdapter_slicedToArray(_ref, 2), + scopeVarName = _ref2[0], + info = _ref2[1]; + if (!info.vue) { info.vue = scopeVarName; } @@ -1684,21 +1972,30 @@ function createAngularJsAdapter(options) { } }); - function angularJsAdapter(...injectedServices) { - const adapter = { - restrict, + function angularJsAdapter() { + for (var _len = arguments.length, injectedServices = new Array(_len), _key = 0; _key < _len; _key++) { + injectedServices[_key] = arguments[_key]; + } + + var adapter = { + restrict: restrict, scope: noScope ? undefined : angularJsScope, compile: function angularJsAdapterCompile() { return { post: function angularJsAdapterLink(ngScope, ngElement, ngAttrs) { - const clone = transclude ? ngElement.find(`[ng-transclude][counter=${currentTranscludeCounter}]`) : null; - let rootVueTemplate = '<root-component'; - Object.entries(scope).forEach(([, info]) => { - rootVueTemplate += ` :${info.vue}="${info.vue}"`; + var clone = transclude ? ngElement.find("[ng-transclude][counter=".concat(currentTranscludeCounter, "]")) : null; + var rootVueTemplate = '<root-component'; + Object.entries(scope).forEach(function (_ref3) { + var _ref4 = createAngularJsAdapter_slicedToArray(_ref3, 2), + info = _ref4[1]; + + rootVueTemplate += " :".concat(info.vue, "=\"").concat(info.vue, "\""); }); - Object.entries(events).forEach(info => { - const [eventName] = info; - rootVueTemplate += ` @${eventName}="onEventHandler('${eventName}', $event)"`; + Object.entries(events).forEach(function (info) { + var _info = createAngularJsAdapter_slicedToArray(info, 1), + eventName = _info[0]; + + rootVueTemplate += " @".concat(eventName, "=\"onEventHandler('").concat(eventName, "', $event)\""); }); rootVueTemplate += '>'; @@ -1707,56 +2004,60 @@ function createAngularJsAdapter(options) { } rootVueTemplate += '</root-component>'; - const app = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createApp"])({ + var app = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createApp"])({ template: rootVueTemplate, + data: function data() { + var initialData = {}; + Object.entries(scope).forEach(function (_ref5) { + var _ref6 = createAngularJsAdapter_slicedToArray(_ref5, 2), + scopeVarName = _ref6[0], + info = _ref6[1]; - data() { - const initialData = {}; - Object.entries(scope).forEach(([scopeVarName, info]) => { - let value = ngScope[scopeVarName]; + var value = ngScope[scopeVarName]; if (typeof value === 'undefined' && typeof info.default !== 'undefined') { - value = info.default instanceof Function ? info.default(ngScope, ngElement, ngAttrs, ...injectedServices) : info.default; + value = info.default instanceof Function ? info.default.apply(info, [ngScope, ngElement, ngAttrs].concat(injectedServices)) : info.default; } initialData[info.vue] = value; }); return initialData; }, - - setup() { + setup: function setup() { if (transclude) { - const transcludeTarget = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(null); + var transcludeTarget = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["ref"])(null); return { - transcludeTarget + transcludeTarget: transcludeTarget }; } return undefined; }, - methods: { - onEventHandler(name, $event) { + onEventHandler: function onEventHandler(name, $event) { if (events[name]) { - events[name]($event, ngScope, ngElement, ngAttrs, ...injectedServices); + events[name].apply(events, [$event, ngScope, ngElement, ngAttrs].concat(injectedServices)); } } - } }); app.config.globalProperties.$sanitize = window.vueSanitize; app.config.globalProperties.translate = translate; app.component('root-component', component); - const mountPoint = mountPointFactory ? mountPointFactory(ngScope, ngElement, ngAttrs, ...injectedServices) : ngElement[0]; - const vm = app.mount(mountPoint); - Object.entries(scope).forEach(([scopeVarName, info]) => { + var mountPoint = mountPointFactory ? mountPointFactory.apply(void 0, [ngScope, ngElement, ngAttrs].concat(injectedServices)) : ngElement[0]; + var vm = app.mount(mountPoint); + Object.entries(scope).forEach(function (_ref7) { + var _ref8 = createAngularJsAdapter_slicedToArray(_ref7, 2), + scopeVarName = _ref8[0], + info = _ref8[1]; + if (!info.angularJsBind) { return; } - ngScope.$watch(scopeVarName, newValue => { + ngScope.$watch(scopeVarName, function (newValue) { if (typeof info.default !== 'undefined' && typeof newValue === 'undefined') { - vm[scopeVarName] = info.default instanceof Function ? info.default(ngScope, ngElement, ngAttrs, ...injectedServices) : info.default; + vm[scopeVarName] = info.default instanceof Function ? info.default.apply(info, [ngScope, ngElement, ngAttrs].concat(injectedServices)) : info.default; } else { vm[scopeVarName] = newValue; } @@ -1768,10 +2069,10 @@ function createAngularJsAdapter(options) { } if (postCreate) { - postCreate(vm, ngScope, ngElement, ngAttrs, ...injectedServices); + postCreate.apply(void 0, [vm, ngScope, ngElement, ngAttrs].concat(injectedServices)); } - ngElement.on('$destroy', () => { + ngElement.on('$destroy', function () { app.unmount(); }); } @@ -1781,7 +2082,7 @@ function createAngularJsAdapter(options) { if (transclude) { adapter.transclude = true; - adapter.template = `<div ng-transclude counter="${currentTranscludeCounter}"/>`; + adapter.template = "<div ng-transclude counter=\"".concat(currentTranscludeCounter, "\"/>"); } return adapter; @@ -1808,36 +2109,38 @@ function createAngularJsAdapter(options) { default: false }, element: { - default: (scope, element) => element[0] + default: function _default(scope, element) { + return element[0]; + } } }, events: { - yes: ($event, scope, element, attrs) => { + yes: function yes($event, scope, element, attrs) { if (attrs.yes) { scope.$eval(attrs.yes); - setTimeout(() => { + setTimeout(function () { scope.$apply(); }, 0); } }, - no: ($event, scope, element, attrs) => { + no: function no($event, scope, element, attrs) { if (attrs.no) { scope.$eval(attrs.no); - setTimeout(() => { + setTimeout(function () { scope.$apply(); }, 0); } }, - close: ($event, scope, element, attrs) => { + close: function close($event, scope, element, attrs) { if (attrs.close) { scope.$eval(attrs.close); - setTimeout(() => { + setTimeout(function () { scope.$apply(); }, 0); } }, - 'update:modelValue': (newValue, scope, element, attrs, $parse) => { - setTimeout(() => { + 'update:modelValue': function updateModelValue(newValue, scope, element, attrs, $parse) { + setTimeout(function () { scope.$apply($parse(attrs.piwikDialog).assign(scope, newValue)); }, 0); } @@ -1845,13 +2148,13 @@ function createAngularJsAdapter(options) { $inject: ['$parse'], directiveName: 'piwikDialog', transclude: true, - mountPointFactory: (scope, element) => { - const vueRootPlaceholder = $('<div class="vue-placeholder"/>'); + mountPointFactory: function mountPointFactory(scope, element) { + var vueRootPlaceholder = $('<div class="vue-placeholder"/>'); vueRootPlaceholder.appendTo(element); return vueRootPlaceholder[0]; }, - postCreate: (vm, scope, element, attrs) => { - scope.$watch(attrs.piwikDialog, (newValue, oldValue) => { + postCreate: function postCreate(vm, scope, element, attrs) { + scope.$watch(attrs.piwikDialog, function (newValue, oldValue) { if (oldValue !== newValue) { vm.modelValue = newValue || false; } @@ -1861,44 +2164,48 @@ function createAngularJsAdapter(options) { })); // 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/CoreHome/vue/src/EnrichedHeadline/EnrichedHeadline.vue?vue&type=template&id=5653b0bd -const EnrichedHeadlinevue_type_template_id_5653b0bd_hoisted_1 = { +var EnrichedHeadlinevue_type_template_id_5653b0bd_hoisted_1 = { key: 0, class: "title", tabindex: "6" }; -const _hoisted_2 = ["href", "title"]; -const _hoisted_3 = { +var _hoisted_2 = ["href", "title"]; +var _hoisted_3 = { class: "iconsBar" }; -const _hoisted_4 = ["href", "title"]; +var _hoisted_4 = ["href", "title"]; -const _hoisted_5 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { +var _hoisted_5 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "icon-help" }, null, -1); -const _hoisted_6 = [_hoisted_5]; -const _hoisted_7 = ["title"]; +var _hoisted_6 = [_hoisted_5]; +var _hoisted_7 = ["title"]; -const _hoisted_8 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { +var _hoisted_8 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "icon-info" }, null, -1); -const _hoisted_9 = [_hoisted_8]; -const _hoisted_10 = { +var _hoisted_9 = [_hoisted_8]; +var _hoisted_10 = { class: "ratingIcons" }; -const _hoisted_11 = { +var _hoisted_11 = { class: "inlineHelp" }; -const _hoisted_12 = ["innerHTML"]; -const _hoisted_13 = ["href"]; +var _hoisted_12 = ["innerHTML"]; +var _hoisted_13 = ["href"]; function EnrichedHeadlinevue_type_template_id_5653b0bd_render(_ctx, _cache, $props, $setup, $data, $options) { - const _component_RateFeature = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("RateFeature"); + var _component_RateFeature = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("RateFeature"); return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { class: "enrichedHeadline", - onMouseenter: _cache[1] || (_cache[1] = $event => _ctx.showIcons = true), - onMouseleave: _cache[2] || (_cache[2] = $event => _ctx.showIcons = false), + onMouseenter: _cache[1] || (_cache[1] = function ($event) { + return _ctx.showIcons = true; + }), + onMouseleave: _cache[2] || (_cache[2] = function ($event) { + return _ctx.showIcons = false; + }), ref: "root" }, [!_ctx.editUrl ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", EnrichedHeadlinevue_type_template_id_5653b0bd_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.editUrl ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { key: 1, @@ -1914,7 +2221,9 @@ function EnrichedHeadlinevue_type_template_id_5653b0bd_render(_ctx, _cache, $pro title: _ctx.translate('CoreHome_ExternalHelp') }, _hoisted_6, 8, _hoisted_4)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.actualInlineHelp ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { key: 1, - onClick: _cache[0] || (_cache[0] = $event => _ctx.showInlineHelp = !_ctx.showInlineHelp), + onClick: _cache[0] || (_cache[0] = function ($event) { + return _ctx.showInlineHelp = !_ctx.showInlineHelp; + }), class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["helpIcon", { 'active': _ctx.showInlineHelp }]), @@ -1942,11 +2251,13 @@ function EnrichedHeadlinevue_type_template_id_5653b0bd_render(_ctx, _cache, $pro // cyclic dependencies like this. it worked before because it was individual files // dependening on each other, not whole plugins. -const RateFeature = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineAsyncComponent"])(() => new Promise(resolve => { - window.$(document).ready(() => { - resolve(window.Feedback.RateFeature); // eslint-disable-line +var RateFeature = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineAsyncComponent"])(function () { + return new Promise(function (resolve) { + window.$(document).ready(function () { + resolve(window.Feedback.RateFeature); // eslint-disable-line + }); }); -})); +}); /** * Usage: * @@ -1994,10 +2305,9 @@ const RateFeature = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["define inlineHelp: String }, components: { - RateFeature + RateFeature: RateFeature }, - - data() { + data: function data() { return { showIcons: false, showInlineHelp: false, @@ -2005,26 +2315,22 @@ const RateFeature = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["define actualInlineHelp: this.inlineHelp }; }, - watch: { - inlineHelp(newValue) { + inlineHelp: function inlineHelp(newValue) { this.actualInlineHelp = newValue; }, - - featureName(newValue) { + featureName: function featureName(newValue) { this.actualFeatureName = newValue; } - }, + mounted: function mounted() { + var _this = this; - mounted() { - const { - root - } = this.$refs; // timeout used since angularjs does not fill out the transclude at this point + var root = this.$refs.root; // timeout used since angularjs does not fill out the transclude at this point - setTimeout(() => { - if (!this.actualInlineHelp) { - let helpNode = root.querySelector('.title .inlineHelp'); + setTimeout(function () { + if (!_this.actualInlineHelp) { + var helpNode = root.querySelector('.title .inlineHelp'); if (!helpNode && root.parentElement.nextElementSibling) { // hack for reports :( @@ -2035,23 +2341,25 @@ const RateFeature = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["define // hackish solution to get binded html of p tag within the help node // at this point the ng-bind-html is not yet converted into html when report is not // initially loaded. Using $compile doesn't work. So get and set it manually - const helpDocs = helpNode.getAttribute('data-content').trim(); + var helpDocs = helpNode.getAttribute('data-content').trim(); if (helpDocs.length) { - this.actualInlineHelp = `<p>${helpDocs}</p>`; - setTimeout(() => helpNode.remove(), 0); + _this.actualInlineHelp = "<p>".concat(helpDocs, "</p>"); + setTimeout(function () { + return helpNode.remove(); + }, 0); } } } - if (!this.actualFeatureName) { - this.actualFeatureName = root.querySelector('.title').textContent; + if (!_this.actualFeatureName) { + _this.actualFeatureName = root.querySelector('.title').textContent; } - if (this.reportGenerated && Periods_Periods.parse(Matomo_Matomo.period, Matomo_Matomo.currentDateString).containsToday()) { + if (_this.reportGenerated && Periods_Periods.parse(Matomo_Matomo.period, Matomo_Matomo.currentDateString).containsToday()) { window.$(root.querySelector('.report-generated')).tooltip({ track: true, - content: this.reportGenerated, + content: _this.reportGenerated, items: 'div', show: false, hide: false @@ -2059,7 +2367,6 @@ const RateFeature = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["define } }); } - })); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/EnrichedHeadline/EnrichedHeadline.vue?vue&type=script&lang=ts @@ -2103,33 +2410,35 @@ EnrichedHeadlinevue_type_script_lang_ts.render = EnrichedHeadlinevue_type_templa })); // 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/CoreHome/vue/src/ContentBlock/ContentBlock.vue?vue&type=template&id=09ef9e02 -const ContentBlockvue_type_template_id_09ef9e02_hoisted_1 = { +var ContentBlockvue_type_template_id_09ef9e02_hoisted_1 = { class: "card", ref: "root" }; -const ContentBlockvue_type_template_id_09ef9e02_hoisted_2 = { +var ContentBlockvue_type_template_id_09ef9e02_hoisted_2 = { class: "card-content" }; -const ContentBlockvue_type_template_id_09ef9e02_hoisted_3 = { +var ContentBlockvue_type_template_id_09ef9e02_hoisted_3 = { key: 0, class: "card-title" }; -const ContentBlockvue_type_template_id_09ef9e02_hoisted_4 = { +var ContentBlockvue_type_template_id_09ef9e02_hoisted_4 = { key: 1, class: "card-title" }; -const ContentBlockvue_type_template_id_09ef9e02_hoisted_5 = { +var ContentBlockvue_type_template_id_09ef9e02_hoisted_5 = { ref: "content" }; function ContentBlockvue_type_template_id_09ef9e02_render(_ctx, _cache, $props, $setup, $data, $options) { - const _component_EnrichedHeadline = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("EnrichedHeadline"); + var _component_EnrichedHeadline = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("EnrichedHeadline"); return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ContentBlockvue_type_template_id_09ef9e02_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", ContentBlockvue_type_template_id_09ef9e02_hoisted_2, [_ctx.contentTitle && !_ctx.actualFeature && !_ctx.helpUrl && !_ctx.actualHelpText ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("h2", ContentBlockvue_type_template_id_09ef9e02_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.contentTitle), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.contentTitle && (_ctx.actualFeature || _ctx.helpUrl || _ctx.actualHelpText) ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("h2", ContentBlockvue_type_template_id_09ef9e02_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_EnrichedHeadline, { "feature-name": _ctx.actualFeature, "help-url": _ctx.helpUrl, "inline-help": _ctx.actualHelpText }, { - default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(() => [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.contentTitle), 1)]), + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.contentTitle), 1)]; + }), _: 1 }, 8, ["feature-name", "help-url", "inline-help"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", ContentBlockvue_type_template_id_09ef9e02_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")], 512)])], 512); } @@ -2138,7 +2447,7 @@ function ContentBlockvue_type_template_id_09ef9e02_render(_ctx, _cache, $props, // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-3!./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/CoreHome/vue/src/ContentBlock/ContentBlock.vue?vue&type=script&lang=ts -let adminContent = null; +var adminContent = null; /* harmony default export */ var ContentBlockvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ props: { contentTitle: String, @@ -2150,42 +2459,38 @@ let adminContent = null; components: { EnrichedHeadline: EnrichedHeadline }, - - data() { + data: function data() { return { actualFeature: this.feature, actualHelpText: this.helpText }; }, - watch: { - feature(newValue) { + feature: function feature(newValue) { this.actualFeature = newValue; }, - - helpText(newValue) { + helpText: function helpText(newValue) { this.actualHelpText = newValue; } - }, + mounted: function mounted() { + var _this = this; - mounted() { - const { - root, - content - } = this.$refs; + var _this$$refs = this.$refs, + root = _this$$refs.root, + content = _this$$refs.content; if (this.anchor) { - const anchorElement = document.createElement('a'); + var anchorElement = document.createElement('a'); anchorElement.id = this.anchor; root.parentElement.prepend(anchorElement); } - setTimeout(() => { - const inlineHelp = content.querySelector('.contentHelp'); + setTimeout(function () { + var inlineHelp = content.querySelector('.contentHelp'); if (inlineHelp) { - this.actualHelpText = inlineHelp.innerHTML; + _this.actualHelpText = inlineHelp.innerHTML; inlineHelp.remove(); } }, 0); @@ -2199,18 +2504,18 @@ let adminContent = null; adminContent = document.querySelector('#content.admin'); } - let contentTopPosition; + var contentTopPosition; if (adminContent) { contentTopPosition = adminContent.offsetTop; } if (contentTopPosition || contentTopPosition === 0) { - const parents = root.closest('[piwik-widget-loader]'); // when shown within the widget loader, we need to get the offset of that element + var parents = root.closest('[piwik-widget-loader]'); // when shown within the widget loader, we need to get the offset of that element // as the widget loader might be still shown. Would otherwise not position correctly // the widgets on the admin home page - const topThis = parents ? parents.offsetTop : root.offsetTop; + var topThis = parents ? parents.offsetTop : root.offsetTop; if (topThis - contentTopPosition < 17) { // we make sure to display the first card with no margin-top to have it on same as line as @@ -2219,7 +2524,6 @@ let adminContent = null; } } } - })); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/ContentBlock/ContentBlock.vue?vue&type=script&lang=ts @@ -2262,6 +2566,12 @@ ContentBlockvue_type_script_lang_ts.render = ContentBlockvue_type_template_id_09 transclude: true })); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Segmentation/Segments.store.ts +function Segments_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Segments_store_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 Segments_store_createClass(Constructor, protoProps, staticProps) { if (protoProps) Segments_store_defineProperties(Constructor.prototype, protoProps); if (staticProps) Segments_store_defineProperties(Constructor, staticProps); return Constructor; } + function Segments_store_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; } /*! @@ -2273,31 +2583,64 @@ function Segments_store_defineProperty(obj, key, value) { if (key in obj) { Obje -class Segments_store_SegmentsStore { - get state() { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(this.segmentState); - } +var Segments_store_SegmentsStore = /*#__PURE__*/function () { + function SegmentsStore() { + var _this = this; + + Segments_store_classCallCheck(this, SegmentsStore); - constructor() { Segments_store_defineProperty(this, "segmentState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({ availableSegments: [] })); - Matomo_Matomo.on('piwikSegmentationInited', () => this.setSegmentState()); + Matomo_Matomo.on('piwikSegmentationInited', function () { + return _this.setSegmentState(); + }); } - setSegmentState() { - try { - const uiControlObject = $('.segmentEditorPanel').data('uiControlObject'); - this.segmentState.availableSegments = uiControlObject.impl.availableSegments || []; - } catch (e) {// segment editor is not initialized yet + Segments_store_createClass(SegmentsStore, [{ + key: "state", + get: function get() { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(this.segmentState); } - } + }, { + key: "setSegmentState", + value: function setSegmentState() { + try { + var uiControlObject = $('.segmentEditorPanel').data('uiControlObject'); + this.segmentState.availableSegments = uiControlObject.impl.availableSegments || []; + } catch (e) {// segment editor is not initialized yet + } + } + }]); -} + return SegmentsStore; +}(); /* harmony default export */ var Segments_store = (new Segments_store_SegmentsStore()); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Comparisons/Comparisons.store.ts +function Comparisons_store_toConsumableArray(arr) { return Comparisons_store_arrayWithoutHoles(arr) || Comparisons_store_iterableToArray(arr) || Comparisons_store_unsupportedIterableToArray(arr) || Comparisons_store_nonIterableSpread(); } + +function Comparisons_store_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function Comparisons_store_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Comparisons_store_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 Comparisons_store_arrayLikeToArray(o, minLen); } + +function Comparisons_store_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function Comparisons_store_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return Comparisons_store_arrayLikeToArray(arr); } + +function Comparisons_store_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 Comparisons_store_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function Comparisons_store_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { Comparisons_store_ownKeys(Object(source), true).forEach(function (key) { Comparisons_store_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { Comparisons_store_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function Comparisons_store_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function Comparisons_store_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 Comparisons_store_createClass(Constructor, protoProps, staticProps) { if (protoProps) Comparisons_store_defineProperties(Constructor.prototype, protoProps); if (staticProps) Comparisons_store_defineProperties(Constructor, staticProps); return Constructor; } + function Comparisons_store_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; } /*! @@ -2313,8 +2656,8 @@ function Comparisons_store_defineProperty(obj, key, value) { if (key in obj) { O -const SERIES_COLOR_COUNT = 8; -const SERIES_SHADE_COUNT = 3; +var SERIES_COLOR_COUNT = 8; +var SERIES_SHADE_COUNT = 3; function wrapArray(values) { if (!values) { @@ -2324,9 +2667,13 @@ function wrapArray(values) { return values instanceof Array ? values : [values]; } -class Comparisons_store_ComparisonsStore { +var Comparisons_store_ComparisonsStore = /*#__PURE__*/function () { // for tests - constructor() { + function ComparisonsStore() { + var _this = this; + + Comparisons_store_classCallCheck(this, ComparisonsStore); + Comparisons_store_defineProperty(this, "privateState", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["reactive"])({ comparisonsDisabledFor: [] })); @@ -2335,328 +2682,366 @@ class Comparisons_store_ComparisonsStore { Comparisons_store_defineProperty(this, "colors", {}); - Comparisons_store_defineProperty(this, "segmentComparisons", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => this.parseSegmentComparisons())); + Comparisons_store_defineProperty(this, "segmentComparisons", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return _this.parseSegmentComparisons(); + })); - Comparisons_store_defineProperty(this, "periodComparisons", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => this.parsePeriodComparisons())); + Comparisons_store_defineProperty(this, "periodComparisons", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return _this.parsePeriodComparisons(); + })); - Comparisons_store_defineProperty(this, "isEnabled", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => this.checkEnabledForCurrentPage())); + Comparisons_store_defineProperty(this, "isEnabled", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return _this.checkEnabledForCurrentPage(); + })); this.loadComparisonsDisabledFor(); - $(() => { - this.colors = this.getAllSeriesColors(); + $(function () { + _this.colors = _this.getAllSeriesColors(); }); - Object(external_commonjs_vue_commonjs2_vue_root_Vue_["watch"])(() => this.getComparisons(), () => Matomo_Matomo.postEvent('piwikComparisonsChanged'), { + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["watch"])(function () { + return _this.getComparisons(); + }, function () { + return Matomo_Matomo.postEvent('piwikComparisonsChanged'); + }, { deep: true }); } - getComparisons() { - return this.getSegmentComparisons().concat(this.getPeriodComparisons()); - } - - isComparing() { - return this.isComparisonEnabled() // first two in each array are for the currently selected segment/period - && (this.segmentComparisons.value.length > 1 || this.periodComparisons.value.length > 1); - } - - isComparingPeriods() { - return this.getPeriodComparisons().length > 1; // first is currently selected period - } - - getSegmentComparisons() { - if (!this.isComparisonEnabled()) { - return []; + Comparisons_store_createClass(ComparisonsStore, [{ + key: "getComparisons", + value: function getComparisons() { + return this.getSegmentComparisons().concat(this.getPeriodComparisons()); } - - return this.segmentComparisons.value; - } - - getPeriodComparisons() { - if (!this.isComparisonEnabled()) { - return []; + }, { + key: "isComparing", + value: function isComparing() { + return this.isComparisonEnabled() // first two in each array are for the currently selected segment/period + && (this.segmentComparisons.value.length > 1 || this.periodComparisons.value.length > 1); } - - return this.periodComparisons.value; - } - - getSeriesColor(segmentComparison, periodComparison, metricIndex = 0) { - const seriesIndex = this.getComparisonSeriesIndex(periodComparison.index, segmentComparison.index) % SERIES_COLOR_COUNT; - - if (metricIndex === 0) { - return this.colors[`series${seriesIndex}`]; + }, { + key: "isComparingPeriods", + value: function isComparingPeriods() { + return this.getPeriodComparisons().length > 1; // first is currently selected period } + }, { + key: "getSegmentComparisons", + value: function getSegmentComparisons() { + if (!this.isComparisonEnabled()) { + return []; + } - const shadeIndex = metricIndex % SERIES_SHADE_COUNT; - return this.colors[`series${seriesIndex}-shade${shadeIndex}`]; - } - - getSeriesColorName(seriesIndex, metricIndex) { - let colorName = `series${seriesIndex % SERIES_COLOR_COUNT}`; - - if (metricIndex > 0) { - colorName += `-shade${metricIndex % SERIES_SHADE_COUNT}`; + return this.segmentComparisons.value; } + }, { + key: "getPeriodComparisons", + value: function getPeriodComparisons() { + if (!this.isComparisonEnabled()) { + return []; + } - return colorName; - } + return this.periodComparisons.value; + } + }, { + key: "getSeriesColor", + value: function getSeriesColor(segmentComparison, periodComparison) { + var metricIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var seriesIndex = this.getComparisonSeriesIndex(periodComparison.index, segmentComparison.index) % SERIES_COLOR_COUNT; - isComparisonEnabled() { - return this.isEnabled.value; - } + if (metricIndex === 0) { + return this.colors["series".concat(seriesIndex)]; + } - getIndividualComparisonRowIndices(seriesIndex) { - const segmentCount = this.getSegmentComparisons().length; - const segmentIndex = seriesIndex % segmentCount; - const periodIndex = Math.floor(seriesIndex / segmentCount); - return { - segmentIndex, - periodIndex - }; - } + var shadeIndex = metricIndex % SERIES_SHADE_COUNT; + return this.colors["series".concat(seriesIndex, "-shade").concat(shadeIndex)]; + } + }, { + key: "getSeriesColorName", + value: function getSeriesColorName(seriesIndex, metricIndex) { + var colorName = "series".concat(seriesIndex % SERIES_COLOR_COUNT); - getComparisonSeriesIndex(periodIndex, segmentIndex) { - const segmentCount = this.getSegmentComparisons().length; - return periodIndex * segmentCount + segmentIndex; - } + if (metricIndex > 0) { + colorName += "-shade".concat(metricIndex % SERIES_SHADE_COUNT); + } - getAllComparisonSeries() { - const seriesInfo = []; - let seriesIndex = 0; - this.getPeriodComparisons().forEach(periodComp => { - this.getSegmentComparisons().forEach(segmentComp => { - seriesInfo.push({ - index: seriesIndex, - params: { ...segmentComp.params, - ...periodComp.params - }, - color: this.colors[`series${seriesIndex}`] + return colorName; + } + }, { + key: "isComparisonEnabled", + value: function isComparisonEnabled() { + return this.isEnabled.value; + } + }, { + key: "getIndividualComparisonRowIndices", + value: function getIndividualComparisonRowIndices(seriesIndex) { + var segmentCount = this.getSegmentComparisons().length; + var segmentIndex = seriesIndex % segmentCount; + var periodIndex = Math.floor(seriesIndex / segmentCount); + return { + segmentIndex: segmentIndex, + periodIndex: periodIndex + }; + } + }, { + key: "getComparisonSeriesIndex", + value: function getComparisonSeriesIndex(periodIndex, segmentIndex) { + var segmentCount = this.getSegmentComparisons().length; + return periodIndex * segmentCount + segmentIndex; + } + }, { + key: "getAllComparisonSeries", + value: function getAllComparisonSeries() { + var _this2 = this; + + var seriesInfo = []; + var seriesIndex = 0; + this.getPeriodComparisons().forEach(function (periodComp) { + _this2.getSegmentComparisons().forEach(function (segmentComp) { + seriesInfo.push({ + index: seriesIndex, + params: Comparisons_store_objectSpread(Comparisons_store_objectSpread({}, segmentComp.params), periodComp.params), + color: _this2.colors["series".concat(seriesIndex)] + }); + seriesIndex += 1; }); - seriesIndex += 1; }); - }); - return seriesInfo; - } - - removeSegmentComparison(index) { - if (!this.isComparisonEnabled()) { - throw new Error('Comparison disabled.'); + return seriesInfo; } + }, { + key: "removeSegmentComparison", + value: function removeSegmentComparison(index) { + if (!this.isComparisonEnabled()) { + throw new Error('Comparison disabled.'); + } - const newComparisons = [...this.segmentComparisons.value]; - newComparisons.splice(index, 1); - const extraParams = {}; + var newComparisons = Comparisons_store_toConsumableArray(this.segmentComparisons.value); - if (index === 0) { - extraParams.segment = newComparisons[0].params.segment; - } + newComparisons.splice(index, 1); + var extraParams = {}; - this.updateQueryParamsFromComparisons(newComparisons, this.periodComparisons.value, extraParams); - } + if (index === 0) { + extraParams.segment = newComparisons[0].params.segment; + } - addSegmentComparison(params) { - if (!this.isComparisonEnabled()) { - throw new Error('Comparison disabled.'); + this.updateQueryParamsFromComparisons(newComparisons, this.periodComparisons.value, extraParams); } + }, { + key: "addSegmentComparison", + value: function addSegmentComparison(params) { + if (!this.isComparisonEnabled()) { + throw new Error('Comparison disabled.'); + } - const newComparisons = this.segmentComparisons.value.concat([{ - params, - index: -1, - title: '' - }]); - this.updateQueryParamsFromComparisons(newComparisons, this.periodComparisons.value); - } + var newComparisons = this.segmentComparisons.value.concat([{ + params: params, + index: -1, + title: '' + }]); + this.updateQueryParamsFromComparisons(newComparisons, this.periodComparisons.value); + } + }, { + key: "updateQueryParamsFromComparisons", + value: function updateQueryParamsFromComparisons(segmentComparisons, periodComparisons) { + var extraParams = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + // get unique segments/periods/dates from new Comparisons + var compareSegments = {}; + var comparePeriodDatePairs = {}; + var firstSegment = false; + var firstPeriod = false; + segmentComparisons.forEach(function (comparison) { + if (firstSegment) { + compareSegments[comparison.params.segment] = true; + } else { + firstSegment = true; + } + }); + periodComparisons.forEach(function (comparison) { + if (firstPeriod) { + comparePeriodDatePairs["".concat(comparison.params.period, "|").concat(comparison.params.date)] = true; + } else { + firstPeriod = true; + } + }); + var comparePeriods = []; + var compareDates = []; + Object.keys(comparePeriodDatePairs).forEach(function (pair) { + var parts = pair.split('|'); + comparePeriods.push(parts[0]); + compareDates.push(parts[1]); + }); + var compareParams = { + compareSegments: Object.keys(compareSegments), + comparePeriods: comparePeriods, + compareDates: compareDates + }; // change the page w/ these new param values - updateQueryParamsFromComparisons(segmentComparisons, periodComparisons, extraParams = {}) { - // get unique segments/periods/dates from new Comparisons - const compareSegments = {}; - const comparePeriodDatePairs = {}; - let firstSegment = false; - let firstPeriod = false; - segmentComparisons.forEach(comparison => { - if (firstSegment) { - compareSegments[comparison.params.segment] = true; - } else { - firstSegment = true; - } - }); - periodComparisons.forEach(comparison => { - if (firstPeriod) { - comparePeriodDatePairs[`${comparison.params.period}|${comparison.params.date}`] = true; - } else { - firstPeriod = true; - } - }); - const comparePeriods = []; - const compareDates = []; - Object.keys(comparePeriodDatePairs).forEach(pair => { - const parts = pair.split('|'); - comparePeriods.push(parts[0]); - compareDates.push(parts[1]); - }); - const compareParams = { - compareSegments: Object.keys(compareSegments), - comparePeriods, - compareDates - }; // change the page w/ these new param values - - if (Matomo_Matomo.helper.isAngularRenderingThePage()) { - const search = src_MatomoUrl_MatomoUrl.hashParsed.value; - const newSearch = { ...search, - ...compareParams, - ...extraParams - }; - delete newSearch['compareSegments[]']; - delete newSearch['comparePeriods[]']; - delete newSearch['compareDates[]']; + if (Matomo_Matomo.helper.isAngularRenderingThePage()) { + var search = src_MatomoUrl_MatomoUrl.hashParsed.value; - if (JSON.stringify(newSearch) !== JSON.stringify(search)) { - src_MatomoUrl_MatomoUrl.updateHash(newSearch); - } + var newSearch = Comparisons_store_objectSpread(Comparisons_store_objectSpread(Comparisons_store_objectSpread({}, search), compareParams), extraParams); - return; - } + delete newSearch['compareSegments[]']; + delete newSearch['comparePeriods[]']; + delete newSearch['compareDates[]']; + + if (JSON.stringify(newSearch) !== JSON.stringify(search)) { + src_MatomoUrl_MatomoUrl.updateHash(newSearch); + } - const paramsToRemove = []; - ['compareSegments', 'comparePeriods', 'compareDates'].forEach(name => { - if (!compareParams[name].length) { - paramsToRemove.push(name); + return; } - }); // angular is not rendering the page (ie, we are in the embedded dashboard) or we need to change - // the segment - const url = src_MatomoUrl_MatomoUrl.stringify(extraParams); - const strHash = src_MatomoUrl_MatomoUrl.stringify(compareParams); - window.broadcast.propagateNewPage(url, undefined, strHash, paramsToRemove); - } + var paramsToRemove = []; + ['compareSegments', 'comparePeriods', 'compareDates'].forEach(function (name) { + if (!compareParams[name].length) { + paramsToRemove.push(name); + } + }); // angular is not rendering the page (ie, we are in the embedded dashboard) or we need to change + // the segment - getAllSeriesColors() { - const { - ColorManager - } = Matomo_Matomo; - const seriesColorNames = []; + var url = src_MatomoUrl_MatomoUrl.stringify(extraParams); + var strHash = src_MatomoUrl_MatomoUrl.stringify(compareParams); + window.broadcast.propagateNewPage(url, undefined, strHash, paramsToRemove); + } + }, { + key: "getAllSeriesColors", + value: function getAllSeriesColors() { + var ColorManager = Matomo_Matomo.ColorManager; + var seriesColorNames = []; - for (let i = 0; i < SERIES_COLOR_COUNT; i += 1) { - seriesColorNames.push(`series${i}`); + for (var i = 0; i < SERIES_COLOR_COUNT; i += 1) { + seriesColorNames.push("series".concat(i)); - for (let j = 0; j < SERIES_SHADE_COUNT; j += 1) { - seriesColorNames.push(`series${i}-shade${j}`); + for (var j = 0; j < SERIES_SHADE_COUNT; j += 1) { + seriesColorNames.push("series".concat(i, "-shade").concat(j)); + } } + + return ColorManager.getColors('comparison-series-color', seriesColorNames); } + }, { + key: "loadComparisonsDisabledFor", + value: function loadComparisonsDisabledFor() { + var _this3 = this; - return ColorManager.getColors('comparison-series-color', seriesColorNames); - } + AjaxHelper_AjaxHelper.fetch({ + module: 'API', + method: 'API.getPagesComparisonsDisabledFor' + }).then(function (result) { + _this3.privateState.comparisonsDisabledFor = result; + }); + } + }, { + key: "parseSegmentComparisons", + value: function parseSegmentComparisons() { + var availableSegments = Segments_store.state.availableSegments; - loadComparisonsDisabledFor() { - AjaxHelper_AjaxHelper.fetch({ - module: 'API', - method: 'API.getPagesComparisonsDisabledFor' - }).then(result => { - this.privateState.comparisonsDisabledFor = result; - }); - } + var compareSegments = Comparisons_store_toConsumableArray(wrapArray(src_MatomoUrl_MatomoUrl.parsed.value.compareSegments)); // add base comparisons + + + compareSegments.unshift(src_MatomoUrl_MatomoUrl.parsed.value.segment || ''); + var newSegmentComparisons = []; + compareSegments.forEach(function (segment, idx) { + var storedSegment; + availableSegments.forEach(function (s) { + if (s.definition === segment || s.definition === decodeURIComponent(segment) || decodeURIComponent(s.definition) === segment) { + storedSegment = s; + } + }); + var segmentTitle = storedSegment ? storedSegment.name : translate('General_Unknown'); - parseSegmentComparisons() { - const { - availableSegments - } = Segments_store.state; - const compareSegments = [...wrapArray(src_MatomoUrl_MatomoUrl.parsed.value.compareSegments)]; // add base comparisons - - compareSegments.unshift(src_MatomoUrl_MatomoUrl.parsed.value.segment || ''); - const newSegmentComparisons = []; - compareSegments.forEach((segment, idx) => { - let storedSegment; - availableSegments.forEach(s => { - if (s.definition === segment || s.definition === decodeURIComponent(segment) || decodeURIComponent(s.definition) === segment) { - storedSegment = s; + if (segment.trim() === '') { + segmentTitle = translate('SegmentEditor_DefaultAllVisits'); } + + newSegmentComparisons.push({ + params: { + segment: segment + }, + title: Matomo_Matomo.helper.htmlDecode(segmentTitle), + index: idx + }); }); - let segmentTitle = storedSegment ? storedSegment.name : translate('General_Unknown'); + return newSegmentComparisons; + } + }, { + key: "parsePeriodComparisons", + value: function parsePeriodComparisons() { + var comparePeriods = Comparisons_store_toConsumableArray(wrapArray(src_MatomoUrl_MatomoUrl.parsed.value.comparePeriods)); - if (segment.trim() === '') { - segmentTitle = translate('SegmentEditor_DefaultAllVisits'); - } + var compareDates = Comparisons_store_toConsumableArray(wrapArray(src_MatomoUrl_MatomoUrl.parsed.value.compareDates)); - newSegmentComparisons.push({ - params: { - segment - }, - title: Matomo_Matomo.helper.htmlDecode(segmentTitle), - index: idx - }); - }); - return newSegmentComparisons; - } + comparePeriods.unshift(src_MatomoUrl_MatomoUrl.parsed.value.period); + compareDates.unshift(src_MatomoUrl_MatomoUrl.parsed.value.date); + var newPeriodComparisons = []; - parsePeriodComparisons() { - const comparePeriods = [...wrapArray(src_MatomoUrl_MatomoUrl.parsed.value.comparePeriods)]; - const compareDates = [...wrapArray(src_MatomoUrl_MatomoUrl.parsed.value.compareDates)]; - comparePeriods.unshift(src_MatomoUrl_MatomoUrl.parsed.value.period); - compareDates.unshift(src_MatomoUrl_MatomoUrl.parsed.value.date); - const newPeriodComparisons = []; + for (var i = 0; i < Math.min(compareDates.length, comparePeriods.length); i += 1) { + var title = void 0; - for (let i = 0; i < Math.min(compareDates.length, comparePeriods.length); i += 1) { - let title; + try { + title = Periods_Periods.parse(comparePeriods[i], compareDates[i]).getPrettyString(); + } catch (e) { + title = translate('General_Error'); + } - try { - title = Periods_Periods.parse(comparePeriods[i], compareDates[i]).getPrettyString(); - } catch (e) { - title = translate('General_Error'); + newPeriodComparisons.push({ + params: { + date: compareDates[i], + period: comparePeriods[i] + }, + title: title, + index: i + }); } - newPeriodComparisons.push({ - params: { - date: compareDates[i], - period: comparePeriods[i] - }, - title, - index: i - }); + return newPeriodComparisons; } + }, { + key: "checkEnabledForCurrentPage", + value: function checkEnabledForCurrentPage() { + // category/subcategory is not included on top bar pages, so in that case we use module/action + var category = src_MatomoUrl_MatomoUrl.parsed.value.category || src_MatomoUrl_MatomoUrl.parsed.value.module; + var subcategory = src_MatomoUrl_MatomoUrl.parsed.value.subcategory || src_MatomoUrl_MatomoUrl.parsed.value.action; + var id = "".concat(category, ".").concat(subcategory); + var isEnabled = this.privateState.comparisonsDisabledFor.indexOf(id) === -1 && this.privateState.comparisonsDisabledFor.indexOf("".concat(category, ".*")) === -1; + document.documentElement.classList.toggle('comparisonsDisabled', !isEnabled); + return isEnabled; + } + }]); - return newPeriodComparisons; - } + return ComparisonsStore; +}(); - checkEnabledForCurrentPage() { - // category/subcategory is not included on top bar pages, so in that case we use module/action - const category = src_MatomoUrl_MatomoUrl.parsed.value.category || src_MatomoUrl_MatomoUrl.parsed.value.module; - const subcategory = src_MatomoUrl_MatomoUrl.parsed.value.subcategory || src_MatomoUrl_MatomoUrl.parsed.value.action; - const id = `${category}.${subcategory}`; - const isEnabled = this.privateState.comparisonsDisabledFor.indexOf(id) === -1 && this.privateState.comparisonsDisabledFor.indexOf(`${category}.*`) === -1; - document.documentElement.classList.toggle('comparisonsDisabled', !isEnabled); - return isEnabled; - } -} // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Comparisons/Comparisons.store.instance.ts /* harmony default export */ var Comparisons_store_instance = (new Comparisons_store_ComparisonsStore()); // 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/CoreHome/vue/src/Comparisons/Comparisons.vue?vue&type=template&id=1b8ecdd2 -const Comparisonsvue_type_template_id_1b8ecdd2_hoisted_1 = { +var Comparisonsvue_type_template_id_1b8ecdd2_hoisted_1 = { key: 0, ref: "root", class: "matomo-comparisons" }; -const Comparisonsvue_type_template_id_1b8ecdd2_hoisted_2 = { +var Comparisonsvue_type_template_id_1b8ecdd2_hoisted_2 = { class: "comparison-type" }; -const Comparisonsvue_type_template_id_1b8ecdd2_hoisted_3 = ["title"]; -const Comparisonsvue_type_template_id_1b8ecdd2_hoisted_4 = ["href"]; -const Comparisonsvue_type_template_id_1b8ecdd2_hoisted_5 = ["title"]; -const Comparisonsvue_type_template_id_1b8ecdd2_hoisted_6 = { +var Comparisonsvue_type_template_id_1b8ecdd2_hoisted_3 = ["title"]; +var Comparisonsvue_type_template_id_1b8ecdd2_hoisted_4 = ["href"]; +var Comparisonsvue_type_template_id_1b8ecdd2_hoisted_5 = ["title"]; +var Comparisonsvue_type_template_id_1b8ecdd2_hoisted_6 = { class: "comparison-period-label" }; -const Comparisonsvue_type_template_id_1b8ecdd2_hoisted_7 = ["onClick"]; -const Comparisonsvue_type_template_id_1b8ecdd2_hoisted_8 = ["title"]; -const Comparisonsvue_type_template_id_1b8ecdd2_hoisted_9 = { +var Comparisonsvue_type_template_id_1b8ecdd2_hoisted_7 = ["onClick"]; +var Comparisonsvue_type_template_id_1b8ecdd2_hoisted_8 = ["title"]; +var Comparisonsvue_type_template_id_1b8ecdd2_hoisted_9 = { class: "loadingPiwik", style: { "display": "none" } }; -const Comparisonsvue_type_template_id_1b8ecdd2_hoisted_10 = ["alt"]; +var Comparisonsvue_type_template_id_1b8ecdd2_hoisted_10 = ["alt"]; function Comparisonsvue_type_template_id_1b8ecdd2_render(_ctx, _cache, $props, $setup, $data, $options) { - return _ctx.isComparing ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Comparisonsvue_type_template_id_1b8ecdd2_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Comparisons')), 1), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.segmentComparisons, (comparison, $index) => { + return _ctx.isComparing ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Comparisonsvue_type_template_id_1b8ecdd2_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Comparisons')), 1), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.segmentComparisons, function (comparison, $index) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { class: "comparison card", key: comparison.index @@ -2666,7 +3051,7 @@ function Comparisonsvue_type_template_id_1b8ecdd2_render(_ctx, _cache, $props, $ }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { target: "_blank", href: _ctx.getUrlToSegment(comparison.params.segment) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(comparison.title), 9, Comparisonsvue_type_template_id_1b8ecdd2_hoisted_4)], 8, Comparisonsvue_type_template_id_1b8ecdd2_hoisted_3), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.periodComparisons, periodComparison => { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(comparison.title), 9, Comparisonsvue_type_template_id_1b8ecdd2_hoisted_4)], 8, Comparisonsvue_type_template_id_1b8ecdd2_hoisted_3), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.periodComparisons, function (periodComparison) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { class: "comparison-period", key: periodComparison.index, @@ -2680,7 +3065,9 @@ function Comparisonsvue_type_template_id_1b8ecdd2_render(_ctx, _cache, $props, $ }), 128)), _ctx.segmentComparisons.length > 1 ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { key: 0, class: "remove-button", - onClick: $event => _ctx.removeSegmentComparison($index) + onClick: function onClick($event) { + return _ctx.removeSegmentComparison($index); + } }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "icon icon-close", title: _ctx.translate('General_ClickToRemoveComp') @@ -2693,6 +3080,12 @@ function Comparisonsvue_type_template_id_1b8ecdd2_render(_ctx, _cache, $props, $ // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Comparisons/Comparisons.vue?vue&type=template&id=1b8ecdd2 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/@vue/cli-plugin-typescript/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-3!./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/CoreHome/vue/src/Comparisons/Comparisons.vue?vue&type=script&lang=ts +function Comparisonsvue_type_script_lang_ts_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; } + +function Comparisonsvue_type_script_lang_ts_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { Comparisonsvue_type_script_lang_ts_ownKeys(Object(source), true).forEach(function (key) { Comparisonsvue_type_script_lang_ts_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { Comparisonsvue_type_script_lang_ts_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } + +function Comparisonsvue_type_script_lang_ts_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; } + @@ -2701,78 +3094,73 @@ function Comparisonsvue_type_template_id_1b8ecdd2_render(_ctx, _cache, $props, $ /* harmony default export */ var Comparisonsvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ props: {}, - - data() { + data: function data() { return { comparisonTooltips: null }; }, - - setup() { + setup: function setup() { // accessing has to be done through a computed property so we can use the computed // instance directly in the template. unfortunately, vue won't register to changes. - const isComparing = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => Comparisons_store_instance.isComparing()); - const segmentComparisons = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => Comparisons_store_instance.getSegmentComparisons()); - const periodComparisons = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(() => Comparisons_store_instance.getPeriodComparisons()); - const getSeriesColor = Comparisons_store_instance.getSeriesColor.bind(Comparisons_store_instance); + var isComparing = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return Comparisons_store_instance.isComparing(); + }); + var segmentComparisons = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return Comparisons_store_instance.getSegmentComparisons(); + }); + var periodComparisons = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () { + return Comparisons_store_instance.getPeriodComparisons(); + }); + var getSeriesColor = Comparisons_store_instance.getSeriesColor.bind(Comparisons_store_instance); return { - isComparing, - segmentComparisons, - periodComparisons, - getSeriesColor + isComparing: isComparing, + segmentComparisons: segmentComparisons, + periodComparisons: periodComparisons, + getSeriesColor: getSeriesColor }; }, - methods: { - comparisonHasSegment(comparison) { + comparisonHasSegment: function comparisonHasSegment(comparison) { return typeof comparison.params.segment !== 'undefined'; }, - - removeSegmentComparison(index) { + removeSegmentComparison: function removeSegmentComparison(index) { // otherwise the tooltip will be stuck on the screen window.$(this.$refs.root).tooltip('destroy'); Comparisons_store_instance.removeSegmentComparison(index); }, - - getComparisonPeriodType(comparison) { - const { - period - } = comparison.params; + getComparisonPeriodType: function getComparisonPeriodType(comparison) { + var period = comparison.params.period; if (period === 'range') { return translate('CoreHome_PeriodRange'); } - const periodStr = translate(`Intl_Period${period.substring(0, 1).toUpperCase()}${period.substring(1)}`); + var periodStr = translate("Intl_Period".concat(period.substring(0, 1).toUpperCase()).concat(period.substring(1))); return periodStr.substring(0, 1).toUpperCase() + periodStr.substring(1); }, - - getComparisonTooltip(segmentComparison, periodComparison) { + getComparisonTooltip: function getComparisonTooltip(segmentComparison, periodComparison) { if (!this.comparisonTooltips || !Object.keys(this.comparisonTooltips).length) { return undefined; } return (this.comparisonTooltips[periodComparison.index] || {})[segmentComparison.index]; }, + getUrlToSegment: function getUrlToSegment(segment) { + var hash = Comparisonsvue_type_script_lang_ts_objectSpread({}, src_MatomoUrl_MatomoUrl.hashParsed.value); - getUrlToSegment(segment) { - const hash = { ...src_MatomoUrl_MatomoUrl.hashParsed.value - }; delete hash.comparePeriods; delete hash.compareDates; delete hash.compareSegments; hash.segment = segment; - return `${window.location.search}#?${src_MatomoUrl_MatomoUrl.stringify(hash)}`; + return "".concat(window.location.search, "#?").concat(src_MatomoUrl_MatomoUrl.stringify(hash)); }, - - setUpTooltips() { - const { - $ - } = window; + setUpTooltips: function setUpTooltips() { + var _window = window, + $ = _window.$; $(this.$refs.root).tooltip({ track: true, content: function transformTooltipContent() { - const title = $(this).attr('title'); + var title = $(this).attr('title'); return window.vueSanitize(title.replace(/\n/g, '<br />')); }, show: { @@ -2782,16 +3170,17 @@ function Comparisonsvue_type_template_id_1b8ecdd2_render(_ctx, _cache, $props, $ hide: false }); }, + onComparisonsChanged: function onComparisonsChanged() { + var _this = this; - onComparisonsChanged() { this.comparisonTooltips = null; if (!Comparisons_store_instance.isComparing()) { return; } - const periodComparisons = Comparisons_store_instance.getPeriodComparisons(); - const segmentComparisons = Comparisons_store_instance.getSegmentComparisons(); + var periodComparisons = Comparisons_store_instance.getPeriodComparisons(); + var segmentComparisons = Comparisons_store_instance.getSegmentComparisons(); AjaxHelper_AjaxHelper.fetch({ method: 'API.getProcessedReport', apiModule: 'VisitsSummary', @@ -2801,33 +3190,33 @@ function Comparisonsvue_type_template_id_1b8ecdd2_render(_ctx, _cache, $props, $ comparePeriods: src_MatomoUrl_MatomoUrl.getSearchParam('comparePeriods'), compareDates: src_MatomoUrl_MatomoUrl.getSearchParam('compareDates'), format_metrics: '1' - }).then(report => { - this.comparisonTooltips = {}; - periodComparisons.forEach(periodComp => { - this.comparisonTooltips[periodComp.index] = {}; - segmentComparisons.forEach(segmentComp => { - const tooltip = this.generateComparisonTooltip(report, periodComp, segmentComp); - this.comparisonTooltips[periodComp.index][segmentComp.index] = tooltip; + }).then(function (report) { + _this.comparisonTooltips = {}; + periodComparisons.forEach(function (periodComp) { + _this.comparisonTooltips[periodComp.index] = {}; + segmentComparisons.forEach(function (segmentComp) { + var tooltip = _this.generateComparisonTooltip(report, periodComp, segmentComp); + + _this.comparisonTooltips[periodComp.index][segmentComp.index] = tooltip; }); }); }); }, - - generateComparisonTooltip(visitsSummary, periodComp, segmentComp) { + generateComparisonTooltip: function generateComparisonTooltip(visitsSummary, periodComp, segmentComp) { if (!visitsSummary.reportData.comparisons) { // sanity check return ''; } - const firstRowIndex = Comparisons_store_instance.getComparisonSeriesIndex(periodComp.index, 0); - const firstRow = visitsSummary.reportData.comparisons[firstRowIndex]; - const comparisonRowIndex = Comparisons_store_instance.getComparisonSeriesIndex(periodComp.index, segmentComp.index); - const comparisonRow = visitsSummary.reportData.comparisons[comparisonRowIndex]; - const firstPeriodRow = visitsSummary.reportData.comparisons[segmentComp.index]; - let tooltip = '<div class="comparison-card-tooltip">'; - let visitsPercent = (comparisonRow.nb_visits / firstRow.nb_visits * 100).toFixed(2); - visitsPercent = `${visitsPercent}%`; - tooltip += translate('General_ComparisonCardTooltip1', [`'${comparisonRow.compareSegmentPretty}'`, comparisonRow.comparePeriodPretty, visitsPercent, comparisonRow.nb_visits.toString(), firstRow.nb_visits.toString()]); + var firstRowIndex = Comparisons_store_instance.getComparisonSeriesIndex(periodComp.index, 0); + var firstRow = visitsSummary.reportData.comparisons[firstRowIndex]; + var comparisonRowIndex = Comparisons_store_instance.getComparisonSeriesIndex(periodComp.index, segmentComp.index); + var comparisonRow = visitsSummary.reportData.comparisons[comparisonRowIndex]; + var firstPeriodRow = visitsSummary.reportData.comparisons[segmentComp.index]; + var tooltip = '<div class="comparison-card-tooltip">'; + var visitsPercent = (comparisonRow.nb_visits / firstRow.nb_visits * 100).toFixed(2); + visitsPercent = "".concat(visitsPercent, "%"); + tooltip += translate('General_ComparisonCardTooltip1', ["'".concat(comparisonRow.compareSegmentPretty, "'"), comparisonRow.comparePeriodPretty, visitsPercent, comparisonRow.nb_visits.toString(), firstRow.nb_visits.toString()]); if (periodComp.index > 0) { tooltip += '<br/><br/>'; @@ -2837,28 +3226,31 @@ function Comparisonsvue_type_template_id_1b8ecdd2_render(_ctx, _cache, $props, $ tooltip += '</div>'; return tooltip; } - }, + updated: function updated() { + var _this2 = this; - updated() { - setTimeout(() => this.setUpTooltips()); + setTimeout(function () { + return _this2.setUpTooltips(); + }); }, + mounted: function mounted() { + var _this3 = this; - mounted() { - Matomo_Matomo.on('piwikComparisonsChanged', () => { - this.onComparisonsChanged(); + Matomo_Matomo.on('piwikComparisonsChanged', function () { + _this3.onComparisonsChanged(); }); this.onComparisonsChanged(); - setTimeout(() => this.setUpTooltips()); + setTimeout(function () { + return _this3.setUpTooltips(); + }); }, - - beforeUnmount() { + beforeUnmount: function beforeUnmount() { try { window.$(this.refs.root).tooltip('destroy'); } catch (e) {// ignore } } - })); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Comparisons/Comparisons.vue?vue&type=script&lang=ts @@ -2893,11 +3285,11 @@ angular.module('piwikApp.service').factory('piwikComparisonsService', Comparison })); // 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/CoreHome/vue/src/ActivityIndicator/ActivityIndicator.vue?vue&type=template&id=6af4d064 -const ActivityIndicatorvue_type_template_id_6af4d064_hoisted_1 = { +var ActivityIndicatorvue_type_template_id_6af4d064_hoisted_1 = { class: "loadingPiwik" }; -const ActivityIndicatorvue_type_template_id_6af4d064_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { +var ActivityIndicatorvue_type_template_id_6af4d064_hoisted_2 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { src: "plugins/Morpheus/images/loading-blue.gif", alt: "" }, null, -1); @@ -2953,19 +3345,21 @@ ActivityIndicatorvue_type_script_lang_ts.render = ActivityIndicatorvue_type_temp loadingMessage: { vue: 'loadingMessage', angularJsBind: '<', - default: () => translate('General_LoadingData') + default: function _default() { + return translate('General_LoadingData'); + } } }, $inject: [], directiveName: 'piwikActivityIndicator' })); // 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/CoreHome/vue/src/Alert/Alert.vue?vue&type=template&id=c3863ae2 +function Alertvue_type_template_id_c3863ae2_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; } + function Alertvue_type_template_id_c3863ae2_render(_ctx, _cache, $props, $setup, $data, $options) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { - class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["alert", { - [`alert-${_ctx.severity}`]: true - }]) + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["alert", Alertvue_type_template_id_c3863ae2_defineProperty({}, "alert-".concat(_ctx.severity), true)]) }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "default")], 2); } // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Alert/Alert.vue?vue&type=template&id=c3863ae2 diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js index a98ec10354..1f6be602dd 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js @@ -1,152 +1,153 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["CoreHome"]=t(require("vue")):e["CoreHome"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="plugins/CoreHome/vue/dist/",r(r.s="fae3")}({2342:function(e,t,r){"use strict"; +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["CoreHome"]=t(require("vue")):e["CoreHome"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},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/CoreHome/vue/dist/",n(n.s="fae3")}({2342:function(e,t,n){"use strict"; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */window.hasBlockedContent=!1},"8bbf":function(t,r){t.exports=e},fae3:function(e,t,r){"use strict";if(r.r(t),r.d(t,"createAngularJsAdapter",(function(){return X})),r.d(t,"activityIndicatorAdapter",(function(){return Ke})),r.d(t,"ActivityIndicator",(function(){return Xe})),r.d(t,"translate",(function(){return g})),r.d(t,"alertAdapter",(function(){return rt})),r.d(t,"AjaxHelper",(function(){return G})),r.d(t,"MatomoUrl",(function(){return R})),r.d(t,"Matomo",(function(){return h})),r.d(t,"Periods",(function(){return l})),r.d(t,"Day",(function(){return O})),r.d(t,"Week",(function(){return S})),r.d(t,"Month",(function(){return E})),r.d(t,"Year",(function(){return x})),r.d(t,"Range",(function(){return C})),r.d(t,"format",(function(){return f})),r.d(t,"getToday",(function(){return b})),r.d(t,"parseDate",(function(){return w})),r.d(t,"todayIsInRange",(function(){return y})),r.d(t,"MatomoDialog",(function(){return Y})),r.d(t,"EnrichedHeadline",(function(){return he})),r.d(t,"ContentBlock",(function(){return je})),r.d(t,"Comparisons",(function(){return Le})),"undefined"!==typeof window){var n=window.document.currentScript,a=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);a&&(r.p=a[1])}r("2342");var o=r("8bbf");function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e} + */window.hasBlockedContent=!1},"8bbf":function(t,n){t.exports=e},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"createAngularJsAdapter",(function(){return Le})),n.d(t,"activityIndicatorAdapter",(function(){return un})),n.d(t,"ActivityIndicator",(function(){return ln})),n.d(t,"translate",(function(){return C})),n.d(t,"alertAdapter",(function(){return gn})),n.d(t,"AjaxHelper",(function(){return Ae})),n.d(t,"MatomoUrl",(function(){return ke})),n.d(t,"Matomo",(function(){return P})),n.d(t,"Periods",(function(){return p})),n.d(t,"Day",(function(){return J})),n.d(t,"Week",(function(){return K})),n.d(t,"Month",(function(){return re})),n.d(t,"Year",(function(){return ce})),n.d(t,"Range",(function(){return V})),n.d(t,"format",(function(){return S})),n.d(t,"getToday",(function(){return D})),n.d(t,"parseDate",(function(){return E})),n.d(t,"todayIsInRange",(function(){return T})),n.d(t,"MatomoDialog",(function(){return Be})),n.d(t,"EnrichedHeadline",(function(){return ct})),n.d(t,"ContentBlock",(function(){return vt})),n.d(t,"Comparisons",(function(){return nn})),"undefined"!==typeof window){var r=window.document.currentScript,a=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);a&&(n.p=a[1])}n("2342");var o=n("8bbf");function i(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 r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function l(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 - */class s{constructor(){i(this,"periods",{}),i(this,"periodOrder",[])}addCustomPeriod(e,t){if(this.periods[e])throw new Error(`The "${e}" period already exists! It cannot be overridden.`);this.periods[e]=t,this.periodOrder.push(e)}getAllLabels(){return Array().concat(this.periodOrder)}get(e){const t=this.periods[e];if(!t)throw new Error("Invalid period label: "+e);return t}parse(e,t){return this.get(e).parse(t)}isRecognizedPeriod(e){return!!this.periods[e]}}var l=new s; + */var u,d=function(){function e(){i(this,e),l(this,"periods",{}),l(this,"periodOrder",[])}return c(e,[{key:"addCustomPeriod",value:function(e,t){if(this.periods[e])throw new Error('The "'.concat(e,'" period already exists! It cannot be overridden.'));this.periods[e]=t,this.periodOrder.push(e)}},{key:"getAllLabels",value:function(){return Array().concat(this.periodOrder)}},{key:"get",value:function(e){var t=this.periods[e];if(!t)throw new Error("Invalid period label: ".concat(e));return t}},{key:"parse",value:function(e,t){return this.get(e).parse(t)}},{key:"isRecognizedPeriod",value:function(e){return!!this.periods[e]}}]),e}(),p=new d;function f(e){return v(e)||h(e)||g(e)||m()}function m(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function g(e,t){if(e){if("string"===typeof e)return b(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)?b(e,t):void 0}}function h(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function v(e){if(Array.isArray(e))return b(e)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */let c;const{piwik:d,broadcast:u,piwikHelper:p}=window;d.helper=p,d.broadcast=u,d.updateDateInTitle=function(e,t){if($(".top_controls #periodString").length&&(c=c||document.title,0===c.indexOf(d.siteName))){const r=` - ${l.parse(t,e).getPrettyString()} `;document.title=`${d.siteName}${r}${c.substr(d.siteName.length)}`}},d.hasUserCapability=function(e){return window.angular.isArray(d.userCapabilities)&&-1!==d.userCapabilities.indexOf(e)},d.on=function(e,t){function r(e){t(...e.detail)}t.wrapper=r,window.addEventListener(e,r)},d.off=function(e,t){t.wrapper&&window.removeEventListener(e,t.wrapper)},d.postEventNoEmit=function(e,...t){const r=new CustomEvent(e,{detail:t});window.dispatchEvent(r)},d.postEvent=function(e,...t){d.postEventNoEmit(e,...t);const r=d.helper.getAngularDependency("$rootScope");return r.$oldEmit(e,...t)};const m=d;var h=m; + */var y=window,w=y.piwik,k=y.broadcast,O=y.piwikHelper;w.helper=O,w.broadcast=k,w.updateDateInTitle=function(e,t){if($(".top_controls #periodString").length&&(u=u||document.title,0===u.indexOf(w.siteName))){var n=" - ".concat(p.parse(t,e).getPrettyString()," ");document.title="".concat(w.siteName).concat(n).concat(u.substr(w.siteName.length))}},w.hasUserCapability=function(e){return window.angular.isArray(w.userCapabilities)&&-1!==w.userCapabilities.indexOf(e)},w.on=function(e,t){function n(e){t.apply(void 0,f(e.detail))}t.wrapper=n,window.addEventListener(e,n)},w.off=function(e,t){t.wrapper&&window.removeEventListener(e,t.wrapper)},w.postEventNoEmit=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var a=new CustomEvent(e,{detail:n});window.dispatchEvent(a)},w.postEvent=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];w.postEventNoEmit.apply(w,[e].concat(n));var a=w.helper.getAngularDependency("$rootScope");return a.$oldEmit.apply(a,[e].concat(n))};var j=w,P=j; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function g(e,...t){let r=t;return 1===t.length&&t[0]&&t[0]instanceof Array&&([r]=t),window._pk_translate(e,r)} + */ +function C(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var a=n;return 1===n.length&&n[0]&&n[0]instanceof Array&&(a=n[0]),window._pk_translate(e,a)} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function f(e){return $.datepicker.formatDate("yy-mm-dd",e)}function b(){const e=new Date(Date.now());return e.setTime(e.getTime()+60*e.getTimezoneOffset()*1e3),e.setHours(e.getHours()+(window.piwik.timezoneOffset||0)/3600),e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e}function w(e){if(e instanceof Date)return e;const t=decodeURIComponent(e).trim();if(""===t)throw new Error("Invalid date, empty string.");if("today"===t||"now"===t)return b();if("yesterday"===t||"yesterdaySameTime"===t){const e=b();return e.setDate(e.getDate()-1),e}if(t.match(/last[ -]?week/i)){const e=b();return e.setDate(e.getDate()-7),e}if(t.match(/last[ -]?month/i)){const e=b();return e.setDate(1),e.setMonth(e.getMonth()-1),e}if(t.match(/last[ -]?year/i)){const e=b();return e.setFullYear(e.getFullYear()-1),e}return $.datepicker.parseDate("yy-mm-dd",t)}function y(e){return 2===e.length&&(b()>=e[0]&&b()<=e[1])}function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e} + */function S(e){return $.datepicker.formatDate("yy-mm-dd",e)}function D(){var e=new Date(Date.now());return e.setTime(e.getTime()+60*e.getTimezoneOffset()*1e3),e.setHours(e.getHours()+(window.piwik.timezoneOffset||0)/3600),e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e}function E(e){if(e instanceof Date)return e;var t=decodeURIComponent(e).trim();if(""===t)throw new Error("Invalid date, empty string.");if("today"===t||"now"===t)return D();if("yesterday"===t||"yesterdaySameTime"===t){var n=D();return n.setDate(n.getDate()-1),n}if(t.match(/last[ -]?week/i)){var r=D();return r.setDate(r.getDate()-7),r}if(t.match(/last[ -]?month/i)){var a=D();return a.setDate(1),a.setMonth(a.getMonth()-1),a}if(t.match(/last[ -]?year/i)){var o=D();return o.setFullYear(o.getFullYear()-1),o}return $.datepicker.parseDate("yy-mm-dd",t)}function T(e){return 2===e.length&&(D()>=e[0]&&D()<=e[1])}function I(e,t){return F(e)||N(e,t)||A(e,t)||x()}function x(){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 A(e,t){if(e){if("string"===typeof e)return H(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)?H(e,t):void 0}}function H(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function N(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done);i=!0)if(o.push(r.value),t&&o.length===t)break}catch(c){s=!0,a=c}finally{try{i||null==n["return"]||n["return"]()}finally{if(s)throw a}}return o}}function F(e){if(Array.isArray(e))return e}function B(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function U(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function R(e,t,n){return t&&U(e.prototype,t),n&&U(e,n),e}function _(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 - */class C{constructor(e,t,r){v(this,"startDate",void 0),v(this,"endDate",void 0),v(this,"childPeriodType",void 0),this.startDate=e,this.endDate=t,this.childPeriodType=r}static getLastNRange(e,t,r){const n=Math.max(parseInt(t.toString(),10)-1,0);if(Number.isNaN(n))throw new Error("Invalid range strAmount");let a=r?w(r):b(),o=new Date(a.getTime());if("day"===e)o.setDate(o.getDate()-n);else if("week"===e)o.setDate(o.getDate()-7*n);else if("month"===e)o.setDate(1),o.setMonth(o.getMonth()-n);else{if("year"!==e)throw new Error(`Unknown period type '${e}'.`);o.setFullYear(o.getFullYear()-n)}if("day"!==e){const t=l.periods[e].parse(o),r=l.periods[e].parse(a);[o]=t.getDateRange(),[,a]=r.getDateRange()}const i=new Date(1991,7,6);if(o.getTime()-i.getTime()<0)switch(e){case"year":o=new Date(1992,0,1);break;case"month":o=new Date(1991,8,1);break;case"week":o=new Date(1991,8,12);break;case"day":default:o=i;break}return new C(o,a,e)}static getLastNRangeChild(e,t,r){const n=t?w(t):b();let a=new Date(n.getTime()),o=new Date(n.getTime());if("day"===e)a.setDate(a.getDate()-r),o.setDate(o.getDate()-r);else if("week"===e)a.setDate(a.getDate()-7*r),o.setDate(o.getDate()-7*r);else if("month"===e)a.setDate(1),a.setMonth(a.getMonth()-r),o.setDate(1),o.setMonth(o.getMonth()-r);else{if("year"!==e)throw new Error(`Unknown period type '${e}'.`);a.setFullYear(a.getFullYear()-r),o.setFullYear(o.getFullYear()-r)}if("day"!==e){const t=l.periods[e].parse(a),r=l.periods[e].parse(o);[a]=t.getDateRange(),[,o]=r.getDateRange()}const i=new Date(1991,7,6);if(a.getTime()-i.getTime()<0)switch(e){case"year":a=new Date(1992,0,1);break;case"month":a=new Date(1991,8,1);break;case"week":a=new Date(1991,8,12);break;case"day":default:a=i;break}return new C(a,o,e)}static parse(e,t="day"){if(/^previous/.test(e)){const r=C.getLastNRange(t,"2").startDate;return C.getLastNRange(t,e.substring(8),r)}if(/^last/.test(e))return C.getLastNRange(t,e.substring(4));const r=decodeURIComponent(e).split(",");return new C(w(r[0]),w(r[1]),t)}static getDisplayText(){return g("General_DateRangeInPeriodList")}getPrettyString(){const e=f(this.startDate),t=f(this.endDate);return g("General_DateRangeFromTo",[e,t])}getDateRange(){return[this.startDate,this.endDate]}containsToday(){return y(this.getDateRange())}}function P(){return{getAllLabels:l.getAllLabels.bind(l),isRecognizedPeriod:l.isRecognizedPeriod.bind(l),get:l.get.bind(l),parse:l.parse.bind(l),parseDate:w,format:f,RangePeriod:C,todayIsInRange:y}}function j(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e} + */var V=function(){function e(t,n,r){B(this,e),_(this,"startDate",void 0),_(this,"endDate",void 0),_(this,"childPeriodType",void 0),this.startDate=t,this.endDate=n,this.childPeriodType=r}return R(e,[{key:"getPrettyString",value:function(){var e=S(this.startDate),t=S(this.endDate);return C("General_DateRangeFromTo",[e,t])}},{key:"getDateRange",value:function(){return[this.startDate,this.endDate]}},{key:"containsToday",value:function(){return T(this.getDateRange())}}],[{key:"getLastNRange",value:function(t,n,r){var a=Math.max(parseInt(n.toString(),10)-1,0);if(Number.isNaN(a))throw new Error("Invalid range strAmount");var o=r?E(r):D(),i=new Date(o.getTime());if("day"===t)i.setDate(i.getDate()-a);else if("week"===t)i.setDate(i.getDate()-7*a);else if("month"===t)i.setDate(1),i.setMonth(i.getMonth()-a);else{if("year"!==t)throw new Error("Unknown period type '".concat(t,"'."));i.setFullYear(i.getFullYear()-a)}if("day"!==t){var s=p.periods[t].parse(i),c=p.periods[t].parse(o),l=s.getDateRange(),u=I(l,1);i=u[0];var d=c.getDateRange(),f=I(d,2);o=f[1]}var m=new Date(1991,7,6);if(i.getTime()-m.getTime()<0)switch(t){case"year":i=new Date(1992,0,1);break;case"month":i=new Date(1991,8,1);break;case"week":i=new Date(1991,8,12);break;case"day":default:i=m;break}return new e(i,o,t)}},{key:"getLastNRangeChild",value:function(t,n,r){var a=n?E(n):D(),o=new Date(a.getTime()),i=new Date(a.getTime());if("day"===t)o.setDate(o.getDate()-r),i.setDate(i.getDate()-r);else if("week"===t)o.setDate(o.getDate()-7*r),i.setDate(i.getDate()-7*r);else if("month"===t)o.setDate(1),o.setMonth(o.getMonth()-r),i.setDate(1),i.setMonth(i.getMonth()-r);else{if("year"!==t)throw new Error("Unknown period type '".concat(t,"'."));o.setFullYear(o.getFullYear()-r),i.setFullYear(i.getFullYear()-r)}if("day"!==t){var s=p.periods[t].parse(o),c=p.periods[t].parse(i),l=s.getDateRange(),u=I(l,1);o=u[0];var d=c.getDateRange(),f=I(d,2);i=f[1]}var m=new Date(1991,7,6);if(o.getTime()-m.getTime()<0)switch(t){case"year":o=new Date(1992,0,1);break;case"month":o=new Date(1991,8,1);break;case"week":o=new Date(1991,8,12);break;case"day":default:o=m;break}return new e(o,i,t)}},{key:"parse",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"day";if(/^previous/.test(t)){var r=e.getLastNRange(n,"2").startDate;return e.getLastNRange(n,t.substring(8),r)}if(/^last/.test(t))return e.getLastNRange(n,t.substring(4));var a=decodeURIComponent(t).split(",");return new e(E(a[0]),E(a[1]),n)}},{key:"getDisplayText",value:function(){return C("General_DateRangeInPeriodList")}}]),e}();function M(){return{getAllLabels:p.getAllLabels.bind(p),isRecognizedPeriod:p.isRecognizedPeriod.bind(p),get:p.get.bind(p),parse:p.parse.bind(p),parseDate:E,format:S,RangePeriod:V,todayIsInRange:T}}function q(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 r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function L(e,t,n){return t&&G(e.prototype,t),n&&G(e,n),e}function Q(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 - */l.addCustomPeriod("range",C), + */p.addCustomPeriod("range",V), /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -window.piwik.addCustomPeriod=l.addCustomPeriod.bind(l),window.angular.module("piwikApp.service").factory("piwikPeriods",P);class O{constructor(e){j(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new O(w(e))}static getDisplayText(){return g("Intl_PeriodDay")}getPrettyString(){return f(this.dateInPeriod)}getDateRange(){return[new Date(this.dateInPeriod.getTime()),new Date(this.dateInPeriod.getTime())]}containsToday(){return y(this.getDateRange())}}function D(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e} +window.piwik.addCustomPeriod=p.addCustomPeriod.bind(p),window.angular.module("piwikApp.service").factory("piwikPeriods",M);var J=function(){function e(t){q(this,e),Q(this,"dateInPeriod",void 0),this.dateInPeriod=t}return L(e,[{key:"getPrettyString",value:function(){return S(this.dateInPeriod)}},{key:"getDateRange",value:function(){return[new Date(this.dateInPeriod.getTime()),new Date(this.dateInPeriod.getTime())]}},{key:"containsToday",value:function(){return T(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(E(t))}},{key:"getDisplayText",value:function(){return C("Intl_PeriodDay")}}]),e}();function z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function W(e,t,n){return t&&Y(e.prototype,t),n&&Y(e,n),e}function X(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 - */l.addCustomPeriod("day",O);class S{constructor(e){D(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new S(w(e))}static getDisplayText(){return g("Intl_PeriodWeek")}getPrettyString(){const e=this.getDateRange(),t=f(e[0]),r=f(e[1]);return g("General_DateRangeFromTo",[t,r])}getDateRange(){const e=(this.dateInPeriod.getDay()+6)%7,t=new Date(this.dateInPeriod.getTime());t.setDate(this.dateInPeriod.getDate()-e);const r=new Date(t.getTime());return r.setDate(t.getDate()+6),[t,r]}containsToday(){return y(this.getDateRange())}}function k(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e} + */p.addCustomPeriod("day",J);var K=function(){function e(t){z(this,e),X(this,"dateInPeriod",void 0),this.dateInPeriod=t}return W(e,[{key:"getPrettyString",value:function(){var e=this.getDateRange(),t=S(e[0]),n=S(e[1]);return C("General_DateRangeFromTo",[t,n])}},{key:"getDateRange",value:function(){var e=(this.dateInPeriod.getDay()+6)%7,t=new Date(this.dateInPeriod.getTime());t.setDate(this.dateInPeriod.getDate()-e);var n=new Date(t.getTime());return n.setDate(t.getDate()+6),[t,n]}},{key:"containsToday",value:function(){return T(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(E(t))}},{key:"getDisplayText",value:function(){return C("Intl_PeriodWeek")}}]),e}();function Z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function te(e,t,n){return t&&ee(e.prototype,t),n&&ee(e,n),e}function ne(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 - */l.addCustomPeriod("week",S);class E{constructor(e){k(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new E(w(e))}static getDisplayText(){return g("Intl_PeriodMonth")}getPrettyString(){const e=g("Intl_Month_Long_StandAlone_"+(this.dateInPeriod.getMonth()+1));return`${e} ${this.dateInPeriod.getFullYear()}`}getDateRange(){const e=new Date(this.dateInPeriod.getTime());e.setDate(1);const t=new Date(this.dateInPeriod.getTime());return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),[e,t]}containsToday(){return y(this.getDateRange())}}function T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e} + */p.addCustomPeriod("week",K);var re=function(){function e(t){Z(this,e),ne(this,"dateInPeriod",void 0),this.dateInPeriod=t}return te(e,[{key:"getPrettyString",value:function(){var e=C("Intl_Month_Long_StandAlone_".concat(this.dateInPeriod.getMonth()+1));return"".concat(e," ").concat(this.dateInPeriod.getFullYear())}},{key:"getDateRange",value:function(){var e=new Date(this.dateInPeriod.getTime());e.setDate(1);var t=new Date(this.dateInPeriod.getTime());return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),[e,t]}},{key:"containsToday",value:function(){return T(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(E(t))}},{key:"getDisplayText",value:function(){return C("Intl_PeriodMonth")}}]),e}();function ae(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function oe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ie(e,t,n){return t&&oe(e.prototype,t),n&&oe(e,n),e}function se(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 - */l.addCustomPeriod("month",E);class x{constructor(e){T(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new x(w(e))}static getDisplayText(){return g("Intl_PeriodYear")}getPrettyString(){return this.dateInPeriod.getFullYear().toString()}getDateRange(){const e=new Date(this.dateInPeriod.getTime());e.setMonth(0),e.setDate(1);const t=new Date(this.dateInPeriod.getTime());return t.setMonth(12),t.setDate(0),[e,t]}containsToday(){return y(this.getDateRange())}} + */p.addCustomPeriod("month",re);var ce=function(){function e(t){ae(this,e),se(this,"dateInPeriod",void 0),this.dateInPeriod=t}return ie(e,[{key:"getPrettyString",value:function(){return this.dateInPeriod.getFullYear().toString()}},{key:"getDateRange",value:function(){var e=new Date(this.dateInPeriod.getTime());e.setMonth(0),e.setDate(1);var t=new Date(this.dateInPeriod.getTime());return t.setMonth(12),t.setDate(0),[e,t]}},{key:"containsToday",value:function(){return T(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(E(t))}},{key:"getDisplayText",value:function(){return C("Intl_PeriodYear")}}]),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 I(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e} +function le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ue(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?le(Object(n),!0).forEach((function(t){me(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function de(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function fe(e,t,n){return t&&pe(e.prototype,t),n&&pe(e,n),e}function me(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 - */l.addCustomPeriod("year",x);const{piwik:H,broadcast:N}=window;function F(e,t){try{return l.parse(e,t),!0}catch(r){return!1}}class B{constructor(){I(this,"urlQuery",Object(o["ref"])("")),I(this,"hashQuery",Object(o["ref"])("")),I(this,"urlParsed",Object(o["computed"])(()=>Object(o["readonly"])(N.getValuesFromUrl("?"+this.urlQuery.value,!0)))),I(this,"hashParsed",Object(o["computed"])(()=>Object(o["readonly"])(N.getValuesFromUrl("?"+this.hashQuery.value,!0)))),I(this,"parsed",Object(o["computed"])(()=>Object(o["readonly"])({...this.urlParsed.value,...this.hashParsed.value}))),this.setUrlQuery(window.location.search),this.setHashQuery(window.location.hash),h.on("$locationChangeSuccess",e=>{const t=new URL(e);this.setUrlQuery(t.search.replace(/^\?/,"")),this.setHashQuery(t.hash.replace(/^#/,""))}),this.updatePeriodParamsFromUrl()}updateHash(e){const t="string"!==typeof e?this.stringify(e):e,r=h.helper.getAngularDependency("$location");r.search(t)}getSearchParam(e){const t=window.location.href.split("#"),r=new RegExp(e+"(\\[]|=)");if(t&&t[1]&&r.test(decodeURIComponent(t[1]))){const t=window.broadcast.getValueFromHash(e,window.location.href);if(t||"date"!==e&&"period"!==e&&"idSite"!==e)return t}return window.broadcast.getValueFromUrl(e,window.location.search)}stringify(e){return $.param(e).replace(/%5B%5D/g,"[]")}updatePeriodParamsFromUrl(){let e=this.getSearchParam("date");const t=this.getSearchParam("period");if(!F(t,e))return;if(H.period===t&&H.currentDateString===e)return;H.period=t;const r=l.parse(t,e).getDateRange();H.startDateString=f(r[0]),H.endDateString=f(r[1]),H.updateDateInTitle(e,t),"range"===H.period&&(e=`${H.startDateString},${H.endDateString}`),H.currentDateString=e}setUrlQuery(e){this.urlQuery.value=e.replace(/^\?/,"")}setHashQuery(e){this.hashQuery.value=e.replace(/^[#/?]+/,"")}}const A=new B;var R=A; + */p.addCustomPeriod("year",ce);var ge=window,he=ge.piwik,ve=ge.broadcast;function be(e,t){try{return p.parse(e,t),!0}catch(n){return!1}}var ye=function(){function e(){var t=this;de(this,e),me(this,"urlQuery",Object(o["ref"])("")),me(this,"hashQuery",Object(o["ref"])("")),me(this,"urlParsed",Object(o["computed"])((function(){return Object(o["readonly"])(ve.getValuesFromUrl("?".concat(t.urlQuery.value),!0))}))),me(this,"hashParsed",Object(o["computed"])((function(){return Object(o["readonly"])(ve.getValuesFromUrl("?".concat(t.hashQuery.value),!0))}))),me(this,"parsed",Object(o["computed"])((function(){return Object(o["readonly"])(ue(ue({},t.urlParsed.value),t.hashParsed.value))}))),this.setUrlQuery(window.location.search),this.setHashQuery(window.location.hash),P.on("$locationChangeSuccess",(function(e){var n=new URL(e);t.setUrlQuery(n.search.replace(/^\?/,"")),t.setHashQuery(n.hash.replace(/^#/,""))})),this.updatePeriodParamsFromUrl()}return fe(e,[{key:"updateHash",value:function(e){var t="string"!==typeof e?this.stringify(e):e,n=P.helper.getAngularDependency("$location");n.search(t)}},{key:"getSearchParam",value:function(e){var t=window.location.href.split("#"),n=new RegExp("".concat(e,"(\\[]|=)"));if(t&&t[1]&&n.test(decodeURIComponent(t[1]))){var r=window.broadcast.getValueFromHash(e,window.location.href);if(r||"date"!==e&&"period"!==e&&"idSite"!==e)return r}return window.broadcast.getValueFromUrl(e,window.location.search)}},{key:"stringify",value:function(e){return $.param(e).replace(/%5B%5D/g,"[]")}},{key:"updatePeriodParamsFromUrl",value:function(){var e=this.getSearchParam("date"),t=this.getSearchParam("period");if(be(t,e)&&(he.period!==t||he.currentDateString!==e)){he.period=t;var n=p.parse(t,e).getDateRange();he.startDateString=S(n[0]),he.endDateString=S(n[1]),he.updateDateInTitle(e,t),"range"===he.period&&(e="".concat(he.startDateString,",").concat(he.endDateString)),he.currentDateString=e}}},{key:"setUrlQuery",value:function(e){this.urlQuery.value=e.replace(/^\?/,"")}},{key:"setHashQuery",value:function(e){this.hashQuery.value=e.replace(/^[#/?]+/,"")}}]),e}(),we=new ye,ke=we; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function U(){const e={getSearchParam:R.getSearchParam.bind(R)};return e} +function Oe(){var e={getSearchParam:ke.getSearchParam.bind(ke)};return 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 _(){return h}function V(e,t){t.$oldEmit=t.$emit,t.$emit=function(e,...t){return h.postEvent(e,...t)},t.$oldBroadcast=t.$broadcast,t.$broadcast=function(e,...r){return h.postEventNoEmit(e,...r),t.$oldBroadcast(e,...r)},t.$on("$locationChangeSuccess",e.updatePeriodParamsFromUrl)}function M(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e} +function je(){return P}function Pe(e,t){t.$oldEmit=t.$emit,t.$emit=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return P.postEvent.apply(P,[e].concat(n))},t.$oldBroadcast=t.$broadcast,t.$broadcast=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return P.postEventNoEmit.apply(P,[e].concat(r)),t.$oldBroadcast.apply(t,[e].concat(r))},t.$on("$locationChangeSuccess",e.updatePeriodParamsFromUrl)}function Ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ce(Object(n),!0).forEach((function(t){Ie(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function De(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Te(e,t,n){return t&&Ee(e.prototype,t),n&&Ee(e,n),e}function Ie(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 q(e,t){if("abort"===t)return;if("undefined"===typeof Piwik_Popover)return void console.log("Request failed: "+e.responseText);const r=$("#loadingError");Piwik_Popover.isOpen()&&e&&500===e.status?e&&500===e.status&&$(document.body).html(piwikHelper.escape(e.responseText)):r.show()}H.updatePeriodParamsFromUrl=A.updatePeriodParamsFromUrl.bind(A),U.$inject=[],angular.module("piwikApp.service").service("piwikUrl",U),window.angular.module("piwikApp.service").service("piwik",_),V.$inject=["piwik","$rootScope"],window.angular.module("piwikApp.service").run(V),window.globalAjaxQueue=[],window.globalAjaxQueue.active=0,window.globalAjaxQueue.clean=function(){for(let e=this.length;e>=0;e-=1)this[e]&&4!==this[e].readyState||this.splice(e,1)},window.globalAjaxQueue.push=function(...e){return this.active+=e.length,this.clean(),Array.prototype.push.call(this,...e)},window.globalAjaxQueue.abort=function(){this.forEach(e=>e&&e.abort&&e.abort()),this.splice(0,this.length),this.active=0};class G{static fetch(e){const t=new G;return t.setFormat("json"),t.addParams({module:"API",format:"json",...e},"get"),t.send()}constructor(){M(this,"format","json"),M(this,"timeout",null),M(this,"callback",null),M(this,"useRegularCallbackInCaseOfError",!1),M(this,"errorCallback",void 0),M(this,"withToken",!1),M(this,"completeCallback",void 0),M(this,"getParams",{}),M(this,"getUrl","?"),M(this,"postParams",{}),M(this,"loadingElement",null),M(this,"errorElement","#ajaxError"),M(this,"requestHandle",null),M(this,"defaultParams",["idSite","period","date","segment"]),this.errorCallback=q}addParams(e,t){const r="string"===typeof e?window.broadcast.getValuesFromUrl(e):e,n=["compareSegments","comparePeriods","compareDates"];Object.keys(r).forEach(e=>{const a=r[e];(-1===n.indexOf(e)||a)&&("get"===t.toLowerCase()?this.getParams[e]=a:"post"===t.toLowerCase()&&(this.postParams[e]=a))})}withTokenInUrl(){this.withToken=!0}setUrl(e){this.addParams(broadcast.getValuesFromUrl(e),"GET")}setBulkRequests(...e){const t=e.map(e=>"string"===typeof e?e:$.param(e));this.addParams({module:"API",method:"API.getBulkRequest",urls:t,format:"json"},"post")}setTimeout(e){this.timeout=e}setCallback(e){this.callback=e}useCallbackInCaseOfError(){this.useRegularCallbackInCaseOfError=!0}redirectOnSuccess(e){this.setCallback(()=>{piwikHelper.redirect(e)})}setErrorCallback(e){this.errorCallback=e}setCompleteCallback(e){this.completeCallback=e}setFormat(e){this.format=e}setLoadingElement(e){this.loadingElement=e||"#ajaxLoadingDiv"}setErrorElement(e){e&&(this.errorElement=e)}useGETDefaultParameter(e){if(e&&this.defaultParams)for(let t=0;t<this.defaultParams.length;t+=1)if(this.defaultParams[t]===e)return!0;return!1}removeDefaultParameter(e){if(e&&this.defaultParams)for(let t=0;t<this.defaultParams.length;t+=1)this.defaultParams[t]===e&&this.defaultParams.splice(t,1)}send(){return $(this.errorElement).length&&$(this.errorElement).hide(),this.loadingElement&&$(this.loadingElement).fadeIn(),this.requestHandle=this.buildAjaxCall(),window.globalAjaxQueue.push(this.requestHandle),new Promise((e,t)=>{this.requestHandle.then(e).fail(e=>{"abort"!==e.statusText&&(console.log(`Warning: the ${$.param(this.getParams)} request failed!`),t(e))})})}abort(){this.requestHandle&&"function"===typeof this.requestHandle.abort&&(this.requestHandle.abort(),this.requestHandle=null)}buildAjaxCall(){const e=this,t=this.mixinDefaultGetParams(this.getParams);let r=this.getUrl;"?"!==r[r.length-1]&&(r+="&"),t.segment&&(r=`${r}segment=${t.segment}&`,delete t.segment),t.date&&(r=`${r}date=${decodeURIComponent(t.date.toString())}&`,delete t.date),r+=$.param(t);const n={type:"POST",async:!0,url:r,dataType:this.format||"json",complete:this.completeCallback,error:function(...t){window.globalAjaxQueue.active-=1,e.errorCallback&&e.errorCallback.apply(this,t)},success:(e,t,r)=>{if(this.loadingElement&&$(this.loadingElement).hide(),e&&"error"===e.result&&!this.useRegularCallbackInCaseOfError){let t=null,r="toast";if($(this.errorElement).length&&e.message&&($(this.errorElement).show(),t=this.errorElement,r=null),e.message){const n=window["require"]("piwik/UI"),a=new n.Notification;a.show(e.message,{placeat:t,context:"error",type:r,id:"ajaxHelper"}),a.scrollToNotification()}}else this.callback&&this.callback(e,t,r);window.globalAjaxQueue.active-=1,h.ajaxRequestFinished&&h.ajaxRequestFinished()},data:this.mixinDefaultPostParams(this.postParams),timeout:null!==this.timeout?this.timeout:void 0};return $.ajax(n)}isRequestToApiMethod(){return this.getParams&&"API"===this.getParams.module&&this.getParams.method||this.postParams&&"API"===this.postParams.module&&this.postParams.method}isWidgetizedRequest(){return"Widgetize"===broadcast.getValueFromUrl("module")}getDefaultPostParams(){return this.withToken||this.isRequestToApiMethod()||h.shouldPropagateTokenAuth?{token_auth:h.token_auth,force_api_session:broadcast.isWidgetizeRequestWithoutSession()?0:1}:{}}mixinDefaultPostParams(e){const t=this.getDefaultPostParams(),r={...t,...e};return r}mixinDefaultGetParams(e){const t=R.getSearchParam("segment"),r={idSite:h.idSite?h.idSite.toString():broadcast.getValueFromUrl("idSite"),period:h.period||broadcast.getValueFromUrl("period"),segment:t},n=e;return n.token_auth&&(n.token_auth=null,delete n.token_auth),Object.keys(r).forEach(e=>{this.useGETDefaultParameter(e)&&!n[e]&&!this.postParams[e]&&r[e]&&(n[e]=r[e])}),!this.useGETDefaultParameter("date")||n.date||this.postParams.date||(n.date=h.currentDateString),n}}function L(){return globalAjaxQueue}window.ajaxHelper=G,angular.module("piwikApp.service").service("globalAjaxQueue",L);const Q={ref:"root"};function J(e,t,r,n,a,i){return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Q,[Object(o["renderSlot"])(e.$slots,"default")],512)),[[o["vShow"],e.modelValue]])}var z=Object(o["defineComponent"])({props:{modelValue:{type:Boolean,required:!0},element:{type:HTMLElement,required:!1}},emits:["yes","no","closeEnd","close","update:modelValue"],activated(){this.$emit("update:modelValue",!1)},watch:{modelValue(e,t){if(e){const e=this.element||this.$refs.root.firstElementChild;h.helper.modalConfirm(e,{yes:()=>{this.$emit("yes")},no:()=>{this.$emit("no")}},{onCloseEnd:()=>{this.element||this.$refs.root.appendChild(e),this.$emit("update:modelValue",!1),this.$emit("closeEnd")}})}else!1===e&&!0===t&&this.$emit("close")}}});z.render=J;var Y=z; + */function xe(e,t){if("abort"!==t)if("undefined"!==typeof Piwik_Popover){var n=$("#loadingError");Piwik_Popover.isOpen()&&e&&500===e.status?e&&500===e.status&&$(document.body).html(piwikHelper.escape(e.responseText)):n.show()}else console.log("Request failed: ".concat(e.responseText))}he.updatePeriodParamsFromUrl=we.updatePeriodParamsFromUrl.bind(we),Oe.$inject=[],angular.module("piwikApp.service").service("piwikUrl",Oe),window.angular.module("piwikApp.service").service("piwik",je),Pe.$inject=["piwik","$rootScope"],window.angular.module("piwikApp.service").run(Pe),window.globalAjaxQueue=[],window.globalAjaxQueue.active=0,window.globalAjaxQueue.clean=function(){for(var e=this.length;e>=0;e-=1)this[e]&&4!==this[e].readyState||this.splice(e,1)},window.globalAjaxQueue.push=function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return this.active+=n.length,this.clean(),(e=Array.prototype.push).call.apply(e,[this].concat(n))},window.globalAjaxQueue.abort=function(){this.forEach((function(e){return e&&e.abort&&e.abort()})),this.splice(0,this.length),this.active=0};var Ae=function(){function e(){De(this,e),Ie(this,"format","json"),Ie(this,"timeout",null),Ie(this,"callback",null),Ie(this,"useRegularCallbackInCaseOfError",!1),Ie(this,"errorCallback",void 0),Ie(this,"withToken",!1),Ie(this,"completeCallback",void 0),Ie(this,"getParams",{}),Ie(this,"getUrl","?"),Ie(this,"postParams",{}),Ie(this,"loadingElement",null),Ie(this,"errorElement","#ajaxError"),Ie(this,"requestHandle",null),Ie(this,"defaultParams",["idSite","period","date","segment"]),this.errorCallback=xe}return Te(e,[{key:"addParams",value:function(e,t){var n=this,r="string"===typeof e?window.broadcast.getValuesFromUrl(e):e,a=["compareSegments","comparePeriods","compareDates"];Object.keys(r).forEach((function(e){var o=r[e];(-1===a.indexOf(e)||o)&&("get"===t.toLowerCase()?n.getParams[e]=o:"post"===t.toLowerCase()&&(n.postParams[e]=o))}))}},{key:"withTokenInUrl",value:function(){this.withToken=!0}},{key:"setUrl",value:function(e){this.addParams(broadcast.getValuesFromUrl(e),"GET")}},{key:"setBulkRequests",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map((function(e){return"string"===typeof e?e:$.param(e)}));this.addParams({module:"API",method:"API.getBulkRequest",urls:r,format:"json"},"post")}},{key:"setTimeout",value:function(e){this.timeout=e}},{key:"setCallback",value:function(e){this.callback=e}},{key:"useCallbackInCaseOfError",value:function(){this.useRegularCallbackInCaseOfError=!0}},{key:"redirectOnSuccess",value:function(e){this.setCallback((function(){piwikHelper.redirect(e)}))}},{key:"setErrorCallback",value:function(e){this.errorCallback=e}},{key:"setCompleteCallback",value:function(e){this.completeCallback=e}},{key:"setFormat",value:function(e){this.format=e}},{key:"setLoadingElement",value:function(e){this.loadingElement=e||"#ajaxLoadingDiv"}},{key:"setErrorElement",value:function(e){e&&(this.errorElement=e)}},{key:"useGETDefaultParameter",value:function(e){if(e&&this.defaultParams)for(var t=0;t<this.defaultParams.length;t+=1)if(this.defaultParams[t]===e)return!0;return!1}},{key:"removeDefaultParameter",value:function(e){if(e&&this.defaultParams)for(var t=0;t<this.defaultParams.length;t+=1)this.defaultParams[t]===e&&this.defaultParams.splice(t,1)}},{key:"send",value:function(){var e=this;return $(this.errorElement).length&&$(this.errorElement).hide(),this.loadingElement&&$(this.loadingElement).fadeIn(),this.requestHandle=this.buildAjaxCall(),window.globalAjaxQueue.push(this.requestHandle),new Promise((function(t,n){e.requestHandle.then(t).fail((function(t){"abort"!==t.statusText&&(console.log("Warning: the ".concat($.param(e.getParams)," request failed!")),n(t))}))}))}},{key:"abort",value:function(){this.requestHandle&&"function"===typeof this.requestHandle.abort&&(this.requestHandle.abort(),this.requestHandle=null)}},{key:"buildAjaxCall",value:function(){var e=this,t=this,n=this.mixinDefaultGetParams(this.getParams),r=this.getUrl;"?"!==r[r.length-1]&&(r+="&"),n.segment&&(r="".concat(r,"segment=").concat(n.segment,"&"),delete n.segment),n.date&&(r="".concat(r,"date=").concat(decodeURIComponent(n.date.toString()),"&"),delete n.date),r+=$.param(n);var a={type:"POST",async:!0,url:r,dataType:this.format||"json",complete:this.completeCallback,error:function(){if(window.globalAjaxQueue.active-=1,t.errorCallback){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.errorCallback.apply(this,n)}},success:function(t,n,r){if(e.loadingElement&&$(e.loadingElement).hide(),t&&"error"===t.result&&!e.useRegularCallbackInCaseOfError){var a=null,o="toast";if($(e.errorElement).length&&t.message&&($(e.errorElement).show(),a=e.errorElement,o=null),t.message){var i=window["require"]("piwik/UI"),s=new i.Notification;s.show(t.message,{placeat:a,context:"error",type:o,id:"ajaxHelper"}),s.scrollToNotification()}}else e.callback&&e.callback(t,n,r);window.globalAjaxQueue.active-=1,P.ajaxRequestFinished&&P.ajaxRequestFinished()},data:this.mixinDefaultPostParams(this.postParams),timeout:null!==this.timeout?this.timeout:void 0};return $.ajax(a)}},{key:"isRequestToApiMethod",value:function(){return this.getParams&&"API"===this.getParams.module&&this.getParams.method||this.postParams&&"API"===this.postParams.module&&this.postParams.method}},{key:"isWidgetizedRequest",value:function(){return"Widgetize"===broadcast.getValueFromUrl("module")}},{key:"getDefaultPostParams",value:function(){return this.withToken||this.isRequestToApiMethod()||P.shouldPropagateTokenAuth?{token_auth:P.token_auth,force_api_session:broadcast.isWidgetizeRequestWithoutSession()?0:1}:{}}},{key:"mixinDefaultPostParams",value:function(e){var t=this.getDefaultPostParams(),n=Se(Se({},t),e);return n}},{key:"mixinDefaultGetParams",value:function(e){var t=this,n=ke.getSearchParam("segment"),r={idSite:P.idSite?P.idSite.toString():broadcast.getValueFromUrl("idSite"),period:P.period||broadcast.getValueFromUrl("period"),segment:n},a=e;return a.token_auth&&(a.token_auth=null,delete a.token_auth),Object.keys(r).forEach((function(e){t.useGETDefaultParameter(e)&&!a[e]&&!t.postParams[e]&&r[e]&&(a[e]=r[e])})),!this.useGETDefaultParameter("date")||a.date||this.postParams.date||(a.date=P.currentDateString),a}}],[{key:"fetch",value:function(t){var n=new e;return n.setFormat("json"),n.addParams(Se({module:"API",format:"json"},t),"get"),n.send()}}]),e}();function $e(){return globalAjaxQueue}window.ajaxHelper=Ae,angular.module("piwikApp.service").service("globalAjaxQueue",$e);var He={ref:"root"};function Ne(e,t,n,r,a,i){return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",He,[Object(o["renderSlot"])(e.$slots,"default")],512)),[[o["vShow"],e.modelValue]])}var Fe=Object(o["defineComponent"])({props:{modelValue:{type:Boolean,required:!0},element:{type:HTMLElement,required:!1}},emits:["yes","no","closeEnd","close","update:modelValue"],activated:function(){this.$emit("update:modelValue",!1)},watch:{modelValue:function(e,t){var n=this;if(e){var r=this.element||this.$refs.root.firstElementChild;P.helper.modalConfirm(r,{yes:function(){n.$emit("yes")},no:function(){n.$emit("no")}},{onCloseEnd:function(){n.element||n.$refs.root.appendChild(r),n.$emit("update:modelValue",!1),n.$emit("closeEnd")}})}else!1===e&&!0===t&&this.$emit("close")}}});Fe.render=Ne;var Be=Fe;function Ue(e,t){return qe(e)||Me(e,t)||_e(e,t)||Re()}function Re(){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 Ve(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)?Ve(e,t):void 0}}function Ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Me(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done);i=!0)if(o.push(r.value),t&&o.length===t)break}catch(c){s=!0,a=c}finally{try{i||null==n["return"]||n["return"]()}finally{if(s)throw a}}return o}}function qe(e){if(Array.isArray(e))return e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */let W=0;function X(e){const{component:t,scope:r={},events:n={},$inject:a,directiveName:i,transclude:s,mountPointFactory:l,postCreate:c,noScope:d,restrict:u="A"}=e,p=W;s&&(W+=1);const m={};function h(...e){const a={restrict:u,scope:d?void 0:m,compile:function(){return{post:function(a,i,d){const u=s?i.find(`[ng-transclude][counter=${p}]`):null;let m="<root-component";Object.entries(r).forEach(([,e])=>{m+=` :${e.vue}="${e.vue}"`}),Object.entries(n).forEach(e=>{const[t]=e;m+=` @${t}="onEventHandler('${t}', $event)"`}),m+=">",s&&(m+='<div ref="transcludeTarget"/>'),m+="</root-component>";const h=Object(o["createApp"])({template:m,data(){const t={};return Object.entries(r).forEach(([r,n])=>{let o=a[r];"undefined"===typeof o&&"undefined"!==typeof n.default&&(o=n.default instanceof Function?n.default(a,i,d,...e):n.default),t[n.vue]=o}),t},setup(){if(s){const e=Object(o["ref"])(null);return{transcludeTarget:e}}},methods:{onEventHandler(t,r){n[t]&&n[t](r,a,i,d,...e)}}});h.config.globalProperties.$sanitize=window.vueSanitize,h.config.globalProperties.translate=g,h.component("root-component",t);const f=l?l(a,i,d,...e):i[0],b=h.mount(f);Object.entries(r).forEach(([t,r])=>{r.angularJsBind&&a.$watch(t,n=>{"undefined"!==typeof r.default&&"undefined"===typeof n?b[t]=r.default instanceof Function?r.default(a,i,d,...e):r.default:b[t]=n})}),s&&$(b.transcludeTarget).append(u),c&&c(b,a,i,d,...e),i.on("$destroy",()=>{h.unmount()})}}}};return s&&(a.transclude=!0,a.template=`<div ng-transclude counter="${p}"/>`),a}return Object.entries(r).forEach(([e,t])=>{t.vue||(t.vue=e),t.angularJsBind&&(m[e]=t.angularJsBind)}),h.$inject=a||[],angular.module("piwikApp").directive(i,h),h} + */var Ge=0;function Le(e){var t=e.component,n=e.scope,r=void 0===n?{}:n,a=e.events,i=void 0===a?{}:a,s=e.$inject,c=e.directiveName,l=e.transclude,u=e.mountPointFactory,d=e.postCreate,p=e.noScope,f=e.restrict,m=void 0===f?"A":f,g=Ge;l&&(Ge+=1);var h={};function v(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];var s={restrict:m,scope:p?void 0:h,compile:function(){return{post:function(e,a,s){var c=l?a.find("[ng-transclude][counter=".concat(g,"]")):null,p="<root-component";Object.entries(r).forEach((function(e){var t=Ue(e,2),n=t[1];p+=" :".concat(n.vue,'="').concat(n.vue,'"')})),Object.entries(i).forEach((function(e){var t=Ue(e,1),n=t[0];p+=" @".concat(n,"=\"onEventHandler('").concat(n,"', $event)\"")})),p+=">",l&&(p+='<div ref="transcludeTarget"/>'),p+="</root-component>";var f=Object(o["createApp"])({template:p,data:function(){var t={};return Object.entries(r).forEach((function(r){var o=Ue(r,2),i=o[0],c=o[1],l=e[i];"undefined"===typeof l&&"undefined"!==typeof c.default&&(l=c.default instanceof Function?c.default.apply(c,[e,a,s].concat(n)):c.default),t[c.vue]=l})),t},setup:function(){if(l){var e=Object(o["ref"])(null);return{transcludeTarget:e}}},methods:{onEventHandler:function(t,r){i[t]&&i[t].apply(i,[r,e,a,s].concat(n))}}});f.config.globalProperties.$sanitize=window.vueSanitize,f.config.globalProperties.translate=C,f.component("root-component",t);var m=u?u.apply(void 0,[e,a,s].concat(n)):a[0],h=f.mount(m);Object.entries(r).forEach((function(t){var r=Ue(t,2),o=r[0],i=r[1];i.angularJsBind&&e.$watch(o,(function(t){"undefined"!==typeof i.default&&"undefined"===typeof t?h[o]=i.default instanceof Function?i.default.apply(i,[e,a,s].concat(n)):i.default:h[o]=t}))})),l&&$(h.transcludeTarget).append(c),d&&d.apply(void 0,[h,e,a,s].concat(n)),a.on("$destroy",(function(){f.unmount()}))}}}};return l&&(s.transclude=!0,s.template='<div ng-transclude counter="'.concat(g,'"/>')),s}return Object.entries(r).forEach((function(e){var t=Ue(e,2),n=t[0],r=t[1];r.vue||(r.vue=n),r.angularJsBind&&(h[n]=r.angularJsBind)})),v.$inject=s||[],angular.module("piwikApp").directive(c,v),v} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */X({component:Y,scope:{show:{vue:"modelValue",default:!1},element:{default:(e,t)=>t[0]}},events:{yes:(e,t,r,n)=>{n.yes&&(t.$eval(n.yes),setTimeout(()=>{t.$apply()},0))},no:(e,t,r,n)=>{n.no&&(t.$eval(n.no),setTimeout(()=>{t.$apply()},0))},close:(e,t,r,n)=>{n.close&&(t.$eval(n.close),setTimeout(()=>{t.$apply()},0))},"update:modelValue":(e,t,r,n,a)=>{setTimeout(()=>{t.$apply(a(n.piwikDialog).assign(t,e))},0)}},$inject:["$parse"],directiveName:"piwikDialog",transclude:!0,mountPointFactory:(e,t)=>{const r=$('<div class="vue-placeholder"/>');return r.appendTo(t),r[0]},postCreate:(e,t,r,n)=>{t.$watch(n.piwikDialog,(t,r)=>{r!==t&&(e.modelValue=t||!1)})},noScope:!0});const K={key:0,class:"title",tabindex:"6"},Z=["href","title"],ee={class:"iconsBar"},te=["href","title"],re=Object(o["createElementVNode"])("span",{class:"icon-help"},null,-1),ne=[re],ae=["title"],oe=Object(o["createElementVNode"])("span",{class:"icon-info"},null,-1),ie=[oe],se={class:"ratingIcons"},le={class:"inlineHelp"},ce=["innerHTML"],de=["href"];function ue(e,t,r,n,a,i){const s=Object(o["resolveComponent"])("RateFeature");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:"enrichedHeadline",onMouseenter:t[1]||(t[1]=t=>e.showIcons=!0),onMouseleave:t[2]||(t[2]=t=>e.showIcons=!1),ref:"root"},[e.editUrl?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",K,[Object(o["renderSlot"])(e.$slots,"default")])),e.editUrl?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:1,class:"title",href:e.editUrl,title:e.translate("CoreHome_ClickToEditX",e.$sanitize(e.actualFeatureName))},[Object(o["renderSlot"])(e.$slots,"default")],8,Z)):Object(o["createCommentVNode"])("",!0),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",ee,[e.helpUrl&&!e.actualInlineHelp?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"helpIcon",href:e.helpUrl,title:e.translate("CoreHome_ExternalHelp")},ne,8,te)):Object(o["createCommentVNode"])("",!0),e.actualInlineHelp?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:1,onClick:t[0]||(t[0]=t=>e.showInlineHelp=!e.showInlineHelp),class:Object(o["normalizeClass"])(["helpIcon",{active:e.showInlineHelp}]),title:e.translate(e.reportGenerated?"General_HelpReport":"General_Help")},ie,10,ae)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",se,[Object(o["createVNode"])(s,{title:e.actualFeatureName},null,8,["title"])])],512),[[o["vShow"],e.showIcons||e.showInlineHelp]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",le,[Object(o["createElementVNode"])("div",{innerHTML:e.$sanitize(e.actualInlineHelp)},null,8,ce),e.helpUrl?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"readMore",href:e.helpUrl},Object(o["toDisplayString"])(e.translate("General_MoreDetails")),9,de)):Object(o["createCommentVNode"])("",!0)],512),[[o["vShow"],e.showInlineHelp]])],544)}const pe=Object(o["defineAsyncComponent"])(()=>new Promise(e=>{window.$(document).ready(()=>{e(window.Feedback.RateFeature)})}));var me=Object(o["defineComponent"])({props:{helpUrl:{type:String,default:""},editUrl:{type:String,default:""},reportGenerated:String,featureName:String,inlineHelp:String},components:{RateFeature:pe},data(){return{showIcons:!1,showInlineHelp:!1,actualFeatureName:this.featureName,actualInlineHelp:this.inlineHelp}},watch:{inlineHelp(e){this.actualInlineHelp=e},featureName(e){this.actualFeatureName=e}},mounted(){const{root:e}=this.$refs;setTimeout(()=>{if(!this.actualInlineHelp){let t=e.querySelector(".title .inlineHelp");if(!t&&e.parentElement.nextElementSibling&&(t=e.parentElement.nextElementSibling.querySelector(".reportDocumentation")),t){const e=t.getAttribute("data-content").trim();e.length&&(this.actualInlineHelp=`<p>${e}</p>`,setTimeout(()=>t.remove(),0))}}this.actualFeatureName||(this.actualFeatureName=e.querySelector(".title").textContent),this.reportGenerated&&l.parse(h.period,h.currentDateString).containsToday()&&window.$(e.querySelector(".report-generated")).tooltip({track:!0,content:this.reportGenerated,items:"div",show:!1,hide:!1})})}});me.render=ue;var he=me; + */Le({component:Be,scope:{show:{vue:"modelValue",default:!1},element:{default:function(e,t){return t[0]}}},events:{yes:function(e,t,n,r){r.yes&&(t.$eval(r.yes),setTimeout((function(){t.$apply()}),0))},no:function(e,t,n,r){r.no&&(t.$eval(r.no),setTimeout((function(){t.$apply()}),0))},close:function(e,t,n,r){r.close&&(t.$eval(r.close),setTimeout((function(){t.$apply()}),0))},"update:modelValue":function(e,t,n,r,a){setTimeout((function(){t.$apply(a(r.piwikDialog).assign(t,e))}),0)}},$inject:["$parse"],directiveName:"piwikDialog",transclude:!0,mountPointFactory:function(e,t){var n=$('<div class="vue-placeholder"/>');return n.appendTo(t),n[0]},postCreate:function(e,t,n,r){t.$watch(r.piwikDialog,(function(t,n){n!==t&&(e.modelValue=t||!1)}))},noScope:!0});var Qe={key:0,class:"title",tabindex:"6"},Je=["href","title"],ze={class:"iconsBar"},Ye=["href","title"],We=Object(o["createElementVNode"])("span",{class:"icon-help"},null,-1),Xe=[We],Ke=["title"],Ze=Object(o["createElementVNode"])("span",{class:"icon-info"},null,-1),et=[Ze],tt={class:"ratingIcons"},nt={class:"inlineHelp"},rt=["innerHTML"],at=["href"];function ot(e,t,n,r,a,i){var s=Object(o["resolveComponent"])("RateFeature");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:"enrichedHeadline",onMouseenter:t[1]||(t[1]=function(t){return e.showIcons=!0}),onMouseleave:t[2]||(t[2]=function(t){return e.showIcons=!1}),ref:"root"},[e.editUrl?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Qe,[Object(o["renderSlot"])(e.$slots,"default")])),e.editUrl?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:1,class:"title",href:e.editUrl,title:e.translate("CoreHome_ClickToEditX",e.$sanitize(e.actualFeatureName))},[Object(o["renderSlot"])(e.$slots,"default")],8,Je)):Object(o["createCommentVNode"])("",!0),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",ze,[e.helpUrl&&!e.actualInlineHelp?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"helpIcon",href:e.helpUrl,title:e.translate("CoreHome_ExternalHelp")},Xe,8,Ye)):Object(o["createCommentVNode"])("",!0),e.actualInlineHelp?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:1,onClick:t[0]||(t[0]=function(t){return e.showInlineHelp=!e.showInlineHelp}),class:Object(o["normalizeClass"])(["helpIcon",{active:e.showInlineHelp}]),title:e.translate(e.reportGenerated?"General_HelpReport":"General_Help")},et,10,Ke)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",tt,[Object(o["createVNode"])(s,{title:e.actualFeatureName},null,8,["title"])])],512),[[o["vShow"],e.showIcons||e.showInlineHelp]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("div",nt,[Object(o["createElementVNode"])("div",{innerHTML:e.$sanitize(e.actualInlineHelp)},null,8,rt),e.helpUrl?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"readMore",href:e.helpUrl},Object(o["toDisplayString"])(e.translate("General_MoreDetails")),9,at)):Object(o["createCommentVNode"])("",!0)],512),[[o["vShow"],e.showInlineHelp]])],544)}var it=Object(o["defineAsyncComponent"])((function(){return new Promise((function(e){window.$(document).ready((function(){e(window.Feedback.RateFeature)}))}))})),st=Object(o["defineComponent"])({props:{helpUrl:{type:String,default:""},editUrl:{type:String,default:""},reportGenerated:String,featureName:String,inlineHelp:String},components:{RateFeature:it},data:function(){return{showIcons:!1,showInlineHelp:!1,actualFeatureName:this.featureName,actualInlineHelp:this.inlineHelp}},watch:{inlineHelp:function(e){this.actualInlineHelp=e},featureName:function(e){this.actualFeatureName=e}},mounted:function(){var e=this,t=this.$refs.root;setTimeout((function(){if(!e.actualInlineHelp){var n=t.querySelector(".title .inlineHelp");if(!n&&t.parentElement.nextElementSibling&&(n=t.parentElement.nextElementSibling.querySelector(".reportDocumentation")),n){var r=n.getAttribute("data-content").trim();r.length&&(e.actualInlineHelp="<p>".concat(r,"</p>"),setTimeout((function(){return n.remove()}),0))}}e.actualFeatureName||(e.actualFeatureName=t.querySelector(".title").textContent),e.reportGenerated&&p.parse(P.period,P.currentDateString).containsToday()&&window.$(t.querySelector(".report-generated")).tooltip({track:!0,content:e.reportGenerated,items:"div",show:!1,hide:!1})}))}});st.render=ot;var ct=st,lt=(Le({component:ct,scope:{helpUrl:{angularJsBind:"@"},editUrl:{angularJsBind:"@"},reportGenerated:{angularJsBind:"@?"},featureName:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@?"}},directiveName:"piwikEnrichedHeadline",transclude:!0}),{class:"card",ref:"root"}),ut={class:"card-content"},dt={key:0,class:"card-title"},pt={key:1,class:"card-title"},ft={ref:"content"}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */X({component:he,scope:{helpUrl:{angularJsBind:"@"},editUrl:{angularJsBind:"@"},reportGenerated:{angularJsBind:"@?"},featureName:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@?"}},directiveName:"piwikEnrichedHeadline",transclude:!0});const ge={class:"card",ref:"root"},fe={class:"card-content"},be={key:0,class:"card-title"},we={key:1,class:"card-title"},ye={ref:"content"};function ve(e,t,r,n,a,i){const s=Object(o["resolveComponent"])("EnrichedHeadline");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ge,[Object(o["createElementVNode"])("div",fe,[!e.contentTitle||e.actualFeature||e.helpUrl||e.actualHelpText?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",be,Object(o["toDisplayString"])(e.contentTitle),1)),e.contentTitle&&(e.actualFeature||e.helpUrl||e.actualHelpText)?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",we,[Object(o["createVNode"])(s,{"feature-name":e.actualFeature,"help-url":e.helpUrl,"inline-help":e.actualHelpText},{default:Object(o["withCtx"])(()=>[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.contentTitle),1)]),_:1},8,["feature-name","help-url","inline-help"])])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",ye,[Object(o["renderSlot"])(e.$slots,"default")],512)])],512)}let Ce=null;var Pe=Object(o["defineComponent"])({props:{contentTitle:String,feature:String,helpUrl:String,helpText:String,anchor:String},components:{EnrichedHeadline:he},data(){return{actualFeature:this.feature,actualHelpText:this.helpText}},watch:{feature(e){this.actualFeature=e},helpText(e){this.actualHelpText=e}},mounted(){const{root:e,content:t}=this.$refs;if(this.anchor){const t=document.createElement("a");t.id=this.anchor,e.parentElement.prepend(t)}let r;if(setTimeout(()=>{const e=t.querySelector(".contentHelp");e&&(this.actualHelpText=e.innerHTML,e.remove())},0),!this.actualFeature||!0!==this.actualFeature&&"true"!==this.actualFeature||(this.actualFeature=this.contentTitle),null===Ce&&(Ce=document.querySelector("#content.admin")),Ce&&(r=Ce.offsetTop),r||0===r){const t=e.closest("[piwik-widget-loader]"),n=t?t.offsetTop:e.offsetTop;n-r<17&&(e.style.marginTop=0)}}});Pe.render=ve;var je=Pe; + */function mt(e,t,n,r,a,i){var s=Object(o["resolveComponent"])("EnrichedHeadline");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",lt,[Object(o["createElementVNode"])("div",ut,[!e.contentTitle||e.actualFeature||e.helpUrl||e.actualHelpText?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",dt,Object(o["toDisplayString"])(e.contentTitle),1)),e.contentTitle&&(e.actualFeature||e.helpUrl||e.actualHelpText)?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",pt,[Object(o["createVNode"])(s,{"feature-name":e.actualFeature,"help-url":e.helpUrl,"inline-help":e.actualHelpText},{default:Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.contentTitle),1)]})),_:1},8,["feature-name","help-url","inline-help"])])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",ft,[Object(o["renderSlot"])(e.$slots,"default")],512)])],512)}var gt=null,ht=Object(o["defineComponent"])({props:{contentTitle:String,feature:String,helpUrl:String,helpText:String,anchor:String},components:{EnrichedHeadline:ct},data:function(){return{actualFeature:this.feature,actualHelpText:this.helpText}},watch:{feature:function(e){this.actualFeature=e},helpText:function(e){this.actualHelpText=e}},mounted:function(){var e,t=this,n=this.$refs,r=n.root,a=n.content;if(this.anchor){var o=document.createElement("a");o.id=this.anchor,r.parentElement.prepend(o)}if(setTimeout((function(){var e=a.querySelector(".contentHelp");e&&(t.actualHelpText=e.innerHTML,e.remove())}),0),!this.actualFeature||!0!==this.actualFeature&&"true"!==this.actualFeature||(this.actualFeature=this.contentTitle),null===gt&&(gt=document.querySelector("#content.admin")),gt&&(e=gt.offsetTop),e||0===e){var i=r.closest("[piwik-widget-loader]"),s=i?i.offsetTop:r.offsetTop;s-e<17&&(r.style.marginTop=0)}}});ht.render=mt;var vt=ht; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */X({component:je,scope:{contentTitle:{angularJsBind:"@"},feature:{angularJsBind:"@"},helpUrl:{angularJsBind:"@"},helpText:{angularJsBind:"@"},anchor:{angularJsBind:"@?"}},directiveName:"piwikContentBlock",transclude:!0});function Oe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e} + */Le({component:vt,scope:{contentTitle:{angularJsBind:"@"},feature:{angularJsBind:"@"},helpUrl:{angularJsBind:"@"},helpText:{angularJsBind:"@"},anchor:{angularJsBind:"@?"}},directiveName:"piwikContentBlock",transclude:!0});function bt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function wt(e,t,n){return t&&yt(e.prototype,t),n&&yt(e,n),e}function kt(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 - */class De{get state(){return Object(o["readonly"])(this.segmentState)}constructor(){Oe(this,"segmentState",Object(o["reactive"])({availableSegments:[]})),h.on("piwikSegmentationInited",()=>this.setSegmentState())}setSegmentState(){try{const e=$(".segmentEditorPanel").data("uiControlObject");this.segmentState.availableSegments=e.impl.availableSegments||[]}catch(e){}}}var Se=new De;function ke(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e} + */var Ot=function(){function e(){var t=this;bt(this,e),kt(this,"segmentState",Object(o["reactive"])({availableSegments:[]})),P.on("piwikSegmentationInited",(function(){return t.setSegmentState()}))}return wt(e,[{key:"state",get:function(){return Object(o["readonly"])(this.segmentState)}},{key:"setSegmentState",value:function(){try{var e=$(".segmentEditorPanel").data("uiControlObject");this.segmentState.availableSegments=e.impl.availableSegments||[]}catch(t){}}}]),e}(),jt=new Ot;function Pt(e){return Et(e)||Dt(e)||St(e)||Ct()}function Ct(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function St(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 Dt(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Et(e){if(Array.isArray(e))return Tt(e)}function Tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function It(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?It(Object(n),!0).forEach((function(t){Nt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):It(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function At(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ht(e,t,n){return t&&$t(e.prototype,t),n&&$t(e,n),e}function Nt(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 - */const Ee=8,Te=3;function $e(e){return e?e instanceof Array?e:[e]:[]}class xe{constructor(){ke(this,"privateState",Object(o["reactive"])({comparisonsDisabledFor:[]})),ke(this,"state",Object(o["readonly"])(this.privateState)),ke(this,"colors",{}),ke(this,"segmentComparisons",Object(o["computed"])(()=>this.parseSegmentComparisons())),ke(this,"periodComparisons",Object(o["computed"])(()=>this.parsePeriodComparisons())),ke(this,"isEnabled",Object(o["computed"])(()=>this.checkEnabledForCurrentPage())),this.loadComparisonsDisabledFor(),$(()=>{this.colors=this.getAllSeriesColors()}),Object(o["watch"])(()=>this.getComparisons(),()=>h.postEvent("piwikComparisonsChanged"),{deep:!0})}getComparisons(){return this.getSegmentComparisons().concat(this.getPeriodComparisons())}isComparing(){return this.isComparisonEnabled()&&(this.segmentComparisons.value.length>1||this.periodComparisons.value.length>1)}isComparingPeriods(){return this.getPeriodComparisons().length>1}getSegmentComparisons(){return this.isComparisonEnabled()?this.segmentComparisons.value:[]}getPeriodComparisons(){return this.isComparisonEnabled()?this.periodComparisons.value:[]}getSeriesColor(e,t,r=0){const n=this.getComparisonSeriesIndex(t.index,e.index)%Ee;if(0===r)return this.colors["series"+n];const a=r%Te;return this.colors[`series${n}-shade${a}`]}getSeriesColorName(e,t){let r="series"+e%Ee;return t>0&&(r+="-shade"+t%Te),r}isComparisonEnabled(){return this.isEnabled.value}getIndividualComparisonRowIndices(e){const t=this.getSegmentComparisons().length,r=e%t,n=Math.floor(e/t);return{segmentIndex:r,periodIndex:n}}getComparisonSeriesIndex(e,t){const r=this.getSegmentComparisons().length;return e*r+t}getAllComparisonSeries(){const e=[];let t=0;return this.getPeriodComparisons().forEach(r=>{this.getSegmentComparisons().forEach(n=>{e.push({index:t,params:{...n.params,...r.params},color:this.colors["series"+t]}),t+=1})}),e}removeSegmentComparison(e){if(!this.isComparisonEnabled())throw new Error("Comparison disabled.");const t=[...this.segmentComparisons.value];t.splice(e,1);const r={};0===e&&(r.segment=t[0].params.segment),this.updateQueryParamsFromComparisons(t,this.periodComparisons.value,r)}addSegmentComparison(e){if(!this.isComparisonEnabled())throw new Error("Comparison disabled.");const t=this.segmentComparisons.value.concat([{params:e,index:-1,title:""}]);this.updateQueryParamsFromComparisons(t,this.periodComparisons.value)}updateQueryParamsFromComparisons(e,t,r={}){const n={},a={};let o=!1,i=!1;e.forEach(e=>{o?n[e.params.segment]=!0:o=!0}),t.forEach(e=>{i?a[`${e.params.period}|${e.params.date}`]=!0:i=!0});const s=[],l=[];Object.keys(a).forEach(e=>{const t=e.split("|");s.push(t[0]),l.push(t[1])});const c={compareSegments:Object.keys(n),comparePeriods:s,compareDates:l};if(h.helper.isAngularRenderingThePage()){const e=R.hashParsed.value,t={...e,...c,...r};return delete t["compareSegments[]"],delete t["comparePeriods[]"],delete t["compareDates[]"],void(JSON.stringify(t)!==JSON.stringify(e)&&R.updateHash(t))}const d=[];["compareSegments","comparePeriods","compareDates"].forEach(e=>{c[e].length||d.push(e)});const u=R.stringify(r),p=R.stringify(c);window.broadcast.propagateNewPage(u,void 0,p,d)}getAllSeriesColors(){const{ColorManager:e}=h,t=[];for(let r=0;r<Ee;r+=1){t.push("series"+r);for(let e=0;e<Te;e+=1)t.push(`series${r}-shade${e}`)}return e.getColors("comparison-series-color",t)}loadComparisonsDisabledFor(){G.fetch({module:"API",method:"API.getPagesComparisonsDisabledFor"}).then(e=>{this.privateState.comparisonsDisabledFor=e})}parseSegmentComparisons(){const{availableSegments:e}=Se.state,t=[...$e(R.parsed.value.compareSegments)];t.unshift(R.parsed.value.segment||"");const r=[];return t.forEach((t,n)=>{let a;e.forEach(e=>{e.definition!==t&&e.definition!==decodeURIComponent(t)&&decodeURIComponent(e.definition)!==t||(a=e)});let o=a?a.name:g("General_Unknown");""===t.trim()&&(o=g("SegmentEditor_DefaultAllVisits")),r.push({params:{segment:t},title:h.helper.htmlDecode(o),index:n})}),r}parsePeriodComparisons(){const e=[...$e(R.parsed.value.comparePeriods)],t=[...$e(R.parsed.value.compareDates)];e.unshift(R.parsed.value.period),t.unshift(R.parsed.value.date);const r=[];for(let a=0;a<Math.min(t.length,e.length);a+=1){let o;try{o=l.parse(e[a],t[a]).getPrettyString()}catch(n){o=g("General_Error")}r.push({params:{date:t[a],period:e[a]},title:o,index:a})}return r}checkEnabledForCurrentPage(){const e=R.parsed.value.category||R.parsed.value.module,t=R.parsed.value.subcategory||R.parsed.value.action,r=`${e}.${t}`,n=-1===this.privateState.comparisonsDisabledFor.indexOf(r)&&-1===this.privateState.comparisonsDisabledFor.indexOf(e+".*");return document.documentElement.classList.toggle("comparisonsDisabled",!n),n}}var Ie=new xe;const He={key:0,ref:"root",class:"matomo-comparisons"},Ne={class:"comparison-type"},Fe=["title"],Be=["href"],Ae=["title"],Re={class:"comparison-period-label"},Ue=["onClick"],_e=["title"],Ve={class:"loadingPiwik",style:{display:"none"}},Me=["alt"];function qe(e,t,r,n,a,i){return e.isComparing?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",He,[Object(o["createElementVNode"])("h3",null,Object(o["toDisplayString"])(e.translate("General_Comparisons")),1),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.segmentComparisons,(t,r)=>(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:"comparison card",key:t.index},[Object(o["createElementVNode"])("div",Ne,Object(o["toDisplayString"])(e.translate("General_Segment")),1),Object(o["createElementVNode"])("div",{class:"title",title:t.title+"<br/>"+decodeURIComponent(t.params.segment)},[Object(o["createElementVNode"])("a",{target:"_blank",href:e.getUrlToSegment(t.params.segment)},Object(o["toDisplayString"])(t.title),9,Be)],8,Fe),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.periodComparisons,r=>(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:"comparison-period",key:r.index,title:e.getComparisonTooltip(t,r)},[Object(o["createElementVNode"])("span",{class:"comparison-dot",style:Object(o["normalizeStyle"])({"background-color":e.getSeriesColor(t,r)})},null,4),Object(o["createElementVNode"])("span",Re,Object(o["toDisplayString"])(r.title)+" ("+Object(o["toDisplayString"])(e.getComparisonPeriodType(r))+") ",1)],8,Ae))),128)),e.segmentComparisons.length>1?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,class:"remove-button",onClick:t=>e.removeSegmentComparison(r)},[Object(o["createElementVNode"])("span",{class:"icon icon-close",title:e.translate("General_ClickToRemoveComp")},null,8,_e)],8,Ue)):Object(o["createCommentVNode"])("",!0)]))),128)),Object(o["createElementVNode"])("div",Ve,[Object(o["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,Me),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_LoadingData")),1)])],512)):Object(o["createCommentVNode"])("",!0)}var Ge=Object(o["defineComponent"])({props:{},data(){return{comparisonTooltips:null}},setup(){const e=Object(o["computed"])(()=>Ie.isComparing()),t=Object(o["computed"])(()=>Ie.getSegmentComparisons()),r=Object(o["computed"])(()=>Ie.getPeriodComparisons()),n=Ie.getSeriesColor.bind(Ie);return{isComparing:e,segmentComparisons:t,periodComparisons:r,getSeriesColor:n}},methods:{comparisonHasSegment(e){return"undefined"!==typeof e.params.segment},removeSegmentComparison(e){window.$(this.$refs.root).tooltip("destroy"),Ie.removeSegmentComparison(e)},getComparisonPeriodType(e){const{period:t}=e.params;if("range"===t)return g("CoreHome_PeriodRange");const r=g(`Intl_Period${t.substring(0,1).toUpperCase()}${t.substring(1)}`);return r.substring(0,1).toUpperCase()+r.substring(1)},getComparisonTooltip(e,t){if(this.comparisonTooltips&&Object.keys(this.comparisonTooltips).length)return(this.comparisonTooltips[t.index]||{})[e.index]},getUrlToSegment(e){const t={...R.hashParsed.value};return delete t.comparePeriods,delete t.compareDates,delete t.compareSegments,t.segment=e,`${window.location.search}#?${R.stringify(t)}`},setUpTooltips(){const{$:e}=window;e(this.$refs.root).tooltip({track:!0,content:function(){const t=e(this).attr("title");return window.vueSanitize(t.replace(/\n/g,"<br />"))},show:{delay:200,duration:200},hide:!1})},onComparisonsChanged(){if(this.comparisonTooltips=null,!Ie.isComparing())return;const e=Ie.getPeriodComparisons(),t=Ie.getSegmentComparisons();G.fetch({method:"API.getProcessedReport",apiModule:"VisitsSummary",apiAction:"get",compare:"1",compareSegments:R.getSearchParam("compareSegments"),comparePeriods:R.getSearchParam("comparePeriods"),compareDates:R.getSearchParam("compareDates"),format_metrics:"1"}).then(r=>{this.comparisonTooltips={},e.forEach(e=>{this.comparisonTooltips[e.index]={},t.forEach(t=>{const n=this.generateComparisonTooltip(r,e,t);this.comparisonTooltips[e.index][t.index]=n})})})},generateComparisonTooltip(e,t,r){if(!e.reportData.comparisons)return"";const n=Ie.getComparisonSeriesIndex(t.index,0),a=e.reportData.comparisons[n],o=Ie.getComparisonSeriesIndex(t.index,r.index),i=e.reportData.comparisons[o],s=e.reportData.comparisons[r.index];let l='<div class="comparison-card-tooltip">',c=(i.nb_visits/a.nb_visits*100).toFixed(2);return c+="%",l+=g("General_ComparisonCardTooltip1",[`'${i.compareSegmentPretty}'`,i.comparePeriodPretty,c,i.nb_visits.toString(),a.nb_visits.toString()]),t.index>0&&(l+="<br/><br/>",l+=g("General_ComparisonCardTooltip2",[i.nb_visits_change.toString(),s.compareSegmentPretty,s.comparePeriodPretty])),l+="</div>",l}},updated(){setTimeout(()=>this.setUpTooltips())},mounted(){h.on("piwikComparisonsChanged",()=>{this.onComparisonsChanged()}),this.onComparisonsChanged(),setTimeout(()=>this.setUpTooltips())},beforeUnmount(){try{window.$(this.refs.root).tooltip("destroy")}catch(e){}}});Ge.render=qe;var Le=Ge; + */var Ft=8,Bt=3;function Ut(e){return e?e instanceof Array?e:[e]:[]}var Rt=function(){function e(){var t=this;At(this,e),Nt(this,"privateState",Object(o["reactive"])({comparisonsDisabledFor:[]})),Nt(this,"state",Object(o["readonly"])(this.privateState)),Nt(this,"colors",{}),Nt(this,"segmentComparisons",Object(o["computed"])((function(){return t.parseSegmentComparisons()}))),Nt(this,"periodComparisons",Object(o["computed"])((function(){return t.parsePeriodComparisons()}))),Nt(this,"isEnabled",Object(o["computed"])((function(){return t.checkEnabledForCurrentPage()}))),this.loadComparisonsDisabledFor(),$((function(){t.colors=t.getAllSeriesColors()})),Object(o["watch"])((function(){return t.getComparisons()}),(function(){return P.postEvent("piwikComparisonsChanged")}),{deep:!0})}return Ht(e,[{key:"getComparisons",value:function(){return this.getSegmentComparisons().concat(this.getPeriodComparisons())}},{key:"isComparing",value:function(){return this.isComparisonEnabled()&&(this.segmentComparisons.value.length>1||this.periodComparisons.value.length>1)}},{key:"isComparingPeriods",value:function(){return this.getPeriodComparisons().length>1}},{key:"getSegmentComparisons",value:function(){return this.isComparisonEnabled()?this.segmentComparisons.value:[]}},{key:"getPeriodComparisons",value:function(){return this.isComparisonEnabled()?this.periodComparisons.value:[]}},{key:"getSeriesColor",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.getComparisonSeriesIndex(t.index,e.index)%Ft;if(0===n)return this.colors["series".concat(r)];var a=n%Bt;return this.colors["series".concat(r,"-shade").concat(a)]}},{key:"getSeriesColorName",value:function(e,t){var n="series".concat(e%Ft);return t>0&&(n+="-shade".concat(t%Bt)),n}},{key:"isComparisonEnabled",value:function(){return this.isEnabled.value}},{key:"getIndividualComparisonRowIndices",value:function(e){var t=this.getSegmentComparisons().length,n=e%t,r=Math.floor(e/t);return{segmentIndex:n,periodIndex:r}}},{key:"getComparisonSeriesIndex",value:function(e,t){var n=this.getSegmentComparisons().length;return e*n+t}},{key:"getAllComparisonSeries",value:function(){var e=this,t=[],n=0;return this.getPeriodComparisons().forEach((function(r){e.getSegmentComparisons().forEach((function(a){t.push({index:n,params:xt(xt({},a.params),r.params),color:e.colors["series".concat(n)]}),n+=1}))})),t}},{key:"removeSegmentComparison",value:function(e){if(!this.isComparisonEnabled())throw new Error("Comparison disabled.");var t=Pt(this.segmentComparisons.value);t.splice(e,1);var n={};0===e&&(n.segment=t[0].params.segment),this.updateQueryParamsFromComparisons(t,this.periodComparisons.value,n)}},{key:"addSegmentComparison",value:function(e){if(!this.isComparisonEnabled())throw new Error("Comparison disabled.");var t=this.segmentComparisons.value.concat([{params:e,index:-1,title:""}]);this.updateQueryParamsFromComparisons(t,this.periodComparisons.value)}},{key:"updateQueryParamsFromComparisons",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r={},a={},o=!1,i=!1;e.forEach((function(e){o?r[e.params.segment]=!0:o=!0})),t.forEach((function(e){i?a["".concat(e.params.period,"|").concat(e.params.date)]=!0:i=!0}));var s=[],c=[];Object.keys(a).forEach((function(e){var t=e.split("|");s.push(t[0]),c.push(t[1])}));var l={compareSegments:Object.keys(r),comparePeriods:s,compareDates:c};if(P.helper.isAngularRenderingThePage()){var u=ke.hashParsed.value,d=xt(xt(xt({},u),l),n);return delete d["compareSegments[]"],delete d["comparePeriods[]"],delete d["compareDates[]"],void(JSON.stringify(d)!==JSON.stringify(u)&&ke.updateHash(d))}var p=[];["compareSegments","comparePeriods","compareDates"].forEach((function(e){l[e].length||p.push(e)}));var f=ke.stringify(n),m=ke.stringify(l);window.broadcast.propagateNewPage(f,void 0,m,p)}},{key:"getAllSeriesColors",value:function(){for(var e=P.ColorManager,t=[],n=0;n<Ft;n+=1){t.push("series".concat(n));for(var r=0;r<Bt;r+=1)t.push("series".concat(n,"-shade").concat(r))}return e.getColors("comparison-series-color",t)}},{key:"loadComparisonsDisabledFor",value:function(){var e=this;Ae.fetch({module:"API",method:"API.getPagesComparisonsDisabledFor"}).then((function(t){e.privateState.comparisonsDisabledFor=t}))}},{key:"parseSegmentComparisons",value:function(){var e=jt.state.availableSegments,t=Pt(Ut(ke.parsed.value.compareSegments));t.unshift(ke.parsed.value.segment||"");var n=[];return t.forEach((function(t,r){var a;e.forEach((function(e){e.definition!==t&&e.definition!==decodeURIComponent(t)&&decodeURIComponent(e.definition)!==t||(a=e)}));var o=a?a.name:C("General_Unknown");""===t.trim()&&(o=C("SegmentEditor_DefaultAllVisits")),n.push({params:{segment:t},title:P.helper.htmlDecode(o),index:r})})),n}},{key:"parsePeriodComparisons",value:function(){var e=Pt(Ut(ke.parsed.value.comparePeriods)),t=Pt(Ut(ke.parsed.value.compareDates));e.unshift(ke.parsed.value.period),t.unshift(ke.parsed.value.date);for(var n=[],r=0;r<Math.min(t.length,e.length);r+=1){var a=void 0;try{a=p.parse(e[r],t[r]).getPrettyString()}catch(o){a=C("General_Error")}n.push({params:{date:t[r],period:e[r]},title:a,index:r})}return n}},{key:"checkEnabledForCurrentPage",value:function(){var e=ke.parsed.value.category||ke.parsed.value.module,t=ke.parsed.value.subcategory||ke.parsed.value.action,n="".concat(e,".").concat(t),r=-1===this.privateState.comparisonsDisabledFor.indexOf(n)&&-1===this.privateState.comparisonsDisabledFor.indexOf("".concat(e,".*"));return document.documentElement.classList.toggle("comparisonsDisabled",!r),r}}]),e}(),_t=new Rt,Vt={key:0,ref:"root",class:"matomo-comparisons"},Mt={class:"comparison-type"},qt=["title"],Gt=["href"],Lt=["title"],Qt={class:"comparison-period-label"},Jt=["onClick"],zt=["title"],Yt={class:"loadingPiwik",style:{display:"none"}},Wt=["alt"];function Xt(e,t,n,r,a,i){return e.isComparing?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Vt,[Object(o["createElementVNode"])("h3",null,Object(o["toDisplayString"])(e.translate("General_Comparisons")),1),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.segmentComparisons,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:"comparison card",key:t.index},[Object(o["createElementVNode"])("div",Mt,Object(o["toDisplayString"])(e.translate("General_Segment")),1),Object(o["createElementVNode"])("div",{class:"title",title:t.title+"<br/>"+decodeURIComponent(t.params.segment)},[Object(o["createElementVNode"])("a",{target:"_blank",href:e.getUrlToSegment(t.params.segment)},Object(o["toDisplayString"])(t.title),9,Gt)],8,qt),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.periodComparisons,(function(n){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:"comparison-period",key:n.index,title:e.getComparisonTooltip(t,n)},[Object(o["createElementVNode"])("span",{class:"comparison-dot",style:Object(o["normalizeStyle"])({"background-color":e.getSeriesColor(t,n)})},null,4),Object(o["createElementVNode"])("span",Qt,Object(o["toDisplayString"])(n.title)+" ("+Object(o["toDisplayString"])(e.getComparisonPeriodType(n))+") ",1)],8,Lt)})),128)),e.segmentComparisons.length>1?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,class:"remove-button",onClick:function(t){return e.removeSegmentComparison(n)}},[Object(o["createElementVNode"])("span",{class:"icon icon-close",title:e.translate("General_ClickToRemoveComp")},null,8,zt)],8,Jt)):Object(o["createCommentVNode"])("",!0)])})),128)),Object(o["createElementVNode"])("div",Yt,[Object(o["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,Wt),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_LoadingData")),1)])],512)):Object(o["createCommentVNode"])("",!0)}function Kt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Zt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kt(Object(n),!0).forEach((function(t){en(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function en(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tn=Object(o["defineComponent"])({props:{},data:function(){return{comparisonTooltips:null}},setup:function(){var e=Object(o["computed"])((function(){return _t.isComparing()})),t=Object(o["computed"])((function(){return _t.getSegmentComparisons()})),n=Object(o["computed"])((function(){return _t.getPeriodComparisons()})),r=_t.getSeriesColor.bind(_t);return{isComparing:e,segmentComparisons:t,periodComparisons:n,getSeriesColor:r}},methods:{comparisonHasSegment:function(e){return"undefined"!==typeof e.params.segment},removeSegmentComparison:function(e){window.$(this.$refs.root).tooltip("destroy"),_t.removeSegmentComparison(e)},getComparisonPeriodType:function(e){var t=e.params.period;if("range"===t)return C("CoreHome_PeriodRange");var n=C("Intl_Period".concat(t.substring(0,1).toUpperCase()).concat(t.substring(1)));return n.substring(0,1).toUpperCase()+n.substring(1)},getComparisonTooltip:function(e,t){if(this.comparisonTooltips&&Object.keys(this.comparisonTooltips).length)return(this.comparisonTooltips[t.index]||{})[e.index]},getUrlToSegment:function(e){var t=Zt({},ke.hashParsed.value);return delete t.comparePeriods,delete t.compareDates,delete t.compareSegments,t.segment=e,"".concat(window.location.search,"#?").concat(ke.stringify(t))},setUpTooltips:function(){var e=window,t=e.$;t(this.$refs.root).tooltip({track:!0,content:function(){var e=t(this).attr("title");return window.vueSanitize(e.replace(/\n/g,"<br />"))},show:{delay:200,duration:200},hide:!1})},onComparisonsChanged:function(){var e=this;if(this.comparisonTooltips=null,_t.isComparing()){var t=_t.getPeriodComparisons(),n=_t.getSegmentComparisons();Ae.fetch({method:"API.getProcessedReport",apiModule:"VisitsSummary",apiAction:"get",compare:"1",compareSegments:ke.getSearchParam("compareSegments"),comparePeriods:ke.getSearchParam("comparePeriods"),compareDates:ke.getSearchParam("compareDates"),format_metrics:"1"}).then((function(r){e.comparisonTooltips={},t.forEach((function(t){e.comparisonTooltips[t.index]={},n.forEach((function(n){var a=e.generateComparisonTooltip(r,t,n);e.comparisonTooltips[t.index][n.index]=a}))}))}))}},generateComparisonTooltip:function(e,t,n){if(!e.reportData.comparisons)return"";var r=_t.getComparisonSeriesIndex(t.index,0),a=e.reportData.comparisons[r],o=_t.getComparisonSeriesIndex(t.index,n.index),i=e.reportData.comparisons[o],s=e.reportData.comparisons[n.index],c='<div class="comparison-card-tooltip">',l=(i.nb_visits/a.nb_visits*100).toFixed(2);return l="".concat(l,"%"),c+=C("General_ComparisonCardTooltip1",["'".concat(i.compareSegmentPretty,"'"),i.comparePeriodPretty,l,i.nb_visits.toString(),a.nb_visits.toString()]),t.index>0&&(c+="<br/><br/>",c+=C("General_ComparisonCardTooltip2",[i.nb_visits_change.toString(),s.compareSegmentPretty,s.comparePeriodPretty])),c+="</div>",c}},updated:function(){var e=this;setTimeout((function(){return e.setUpTooltips()}))},mounted:function(){var e=this;P.on("piwikComparisonsChanged",(function(){e.onComparisonsChanged()})),this.onComparisonsChanged(),setTimeout((function(){return e.setUpTooltips()}))},beforeUnmount:function(){try{window.$(this.refs.root).tooltip("destroy")}catch(e){}}});tn.render=Xt;var nn=tn; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Qe(){return Ie}Qe.$inject=[],angular.module("piwikApp.service").factory("piwikComparisonsService",Qe);X({component:Le,directiveName:"piwikComparisons",restrict:"E"});const Je={class:"loadingPiwik"},ze=Object(o["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:""},null,-1);function Ye(e,t,r,n,a,i){return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Je,[ze,Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.loadingMessage),1)],512)),[[o["vShow"],e.loading]])}var We=Object(o["defineComponent"])({props:{loading:{type:Boolean,required:!0,default:!1},loadingMessage:{type:String,required:!1,default:g("General_LoadingData")}}});We.render=Ye;var Xe=We,Ke=X({component:Xe,scope:{loading:{vue:"loading",angularJsBind:"<"},loadingMessage:{vue:"loadingMessage",angularJsBind:"<",default:()=>g("General_LoadingData")}},$inject:[],directiveName:"piwikActivityIndicator"}); + */function rn(){return _t}rn.$inject=[],angular.module("piwikApp.service").factory("piwikComparisonsService",rn);Le({component:nn,directiveName:"piwikComparisons",restrict:"E"});var an={class:"loadingPiwik"},on=Object(o["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:""},null,-1);function sn(e,t,n,r,a,i){return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",an,[on,Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.loadingMessage),1)],512)),[[o["vShow"],e.loading]])}var cn=Object(o["defineComponent"])({props:{loading:{type:Boolean,required:!0,default:!1},loadingMessage:{type:String,required:!1,default:C("General_LoadingData")}}});cn.render=sn;var ln=cn,un=Le({component:ln,scope:{loading:{vue:"loading",angularJsBind:"<"},loadingMessage:{vue:"loadingMessage",angularJsBind:"<",default:function(){return C("General_LoadingData")}}},$inject:[],directiveName:"piwikActivityIndicator"}); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Ze(e,t,r,n,a,i){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["alert",{["alert-"+e.severity]:!0}])},[Object(o["renderSlot"])(e.$slots,"default")],2)}var et=Object(o["defineComponent"])({props:{severity:{type:String,required:!0}}});et.render=Ze;var tt=et,rt=X({component:tt,scope:{severity:{vue:"severity",angularJsBind:"@piwikAlert"}},directiveName:"piwikAlert",transclude:!0}); + */function dn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pn(e,t,n,r,a,i){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["alert",dn({},"alert-".concat(e.severity),!0)])},[Object(o["renderSlot"])(e.$slots,"default")],2)}var fn=Object(o["defineComponent"])({props:{severity:{type:String,required:!0}}});fn.render=pn;var mn=fn,gn=Le({component:mn,scope:{severity:{vue:"severity",angularJsBind:"@piwikAlert"}},directiveName:"piwikAlert",transclude:!0}); /*! * Matomo - free/libre analytics platform * |