(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue")):"function"===typeof define&&define.amd?define(["CoreHome"],t):"object"===typeof exports?exports["Dashboard"]=t(require("CoreHome"),require("vue")):e["Dashboard"]=t(e["CoreHome"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t){return function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},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 o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},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/Dashboard/vue/dist/",r(r.s="fae3")}({"19dc":function(t,r){t.exports=e},"8bbf":function(e,r){e.exports=t},fae3:function(e,t,r){"use strict";if(r.r(t),r.d(t,"DashboardStore",(function(){return f})),r.d(t,"Dashboard",(function(){return S})),"undefined"!==typeof window){var o=window.document.currentScript,n=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);n&&(r.p=n[1])}var a=r("8bbf"),i=r("19dc");function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,o=new Array(t);rdiv");n.each((function(){var e=[];w("div",this).each((function(){e.push(this.className.replace(/width-/,""))})),w(this).attr("layout",e.join("-"))})),n.off("click.renderDashboard"),n.on("click.renderDashboard",(function(){n.removeClass("choosen"),w(this).addClass("choosen")}))}function j(e){return window.globalAjaxQueue.abort(),new Promise((function(e){return setTimeout(e)})).then((function(){return Promise.resolve(window.widgetsHelper.firstGetAvailableWidgetsCall)})).then((function(){var t=w("#dashboardWidgetsArea");return t.dashboard("destroyWidgets"),t.empty(),Promise.all([f.getDashboard(e),f.getDashboardLayout(e)])})).then((function(t){var r=h(t,2),o=r[0],n=r[1];return new Promise((function(t){w((function(){D(e,o,n),t()}))}))}))}function A(){w(".top_controls .dashboard-manager").hide(),w("#dashboardWidgetsArea").dashboard("destroy")}function P(e){"Widgetize"!==e.module&&"Dashboard_Dashboard"!==e.category&&A()}function x(e){"Dashboard_Dashboard"===e.category&&w.isNumeric(e.subcategory)&&(e.promise=j(parseInt(e.subcategory,10)))}function O(e){j(e)}var S={mounted:function(e,t){j(t.value.idDashboard),Object(a["watch"])((function(){return i["MatomoUrl"].parsed.value}),(function(e){P(e)})),i["Matomo"].on("ReportingPage.loadPage",x),i["Matomo"].on("Dashboard.loadDashboard",O)},unmounted:function(){P(i["MatomoUrl"].parsed.value),i["Matomo"].off("ReportingPage.loadPage",x),i["Matomo"].off("Dashboard.loadDashboard",O)}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */function k(){return{restrict:"A",scope:{dashboardid:"=",layout:"="},link:function(e,t){var r={instance:null,value:{idDashboard:e.dashboardid,layout:e.layout},oldValue:null,modifiers:{},dir:{}};S.mounted(t[0],r),e.$on("$destroy",(function(){S.unmounted()}))}}}window.angular.module("piwikApp").directive("piwikDashboard",k)}})})); //# sourceMappingURL=Dashboard.umd.min.js.map