From b66db307271ae8ec77d7d4a10b24b0991a7ef47a Mon Sep 17 00:00:00 2001 From: Stefan Giehl Date: Thu, 27 Jul 2023 16:31:45 +0200 Subject: [PATCH] Handle ajax call to resend an invitation correctly (#21013) * Handle ajax call to resend an invitatio correctly * built vue files * disallow sending password parameters as get * update other password usages --- plugins/CoreHome/vue/dist/CoreHome.umd.js | 5 + plugins/CoreHome/vue/dist/CoreHome.umd.min.js | 2 +- .../CoreHome/vue/src/AjaxHelper/AjaxHelper.ts | 6 + .../UsersManager/vue/dist/UsersManager.umd.js | 165 +++++++++--------- .../vue/dist/UsersManager.umd.min.js | 2 +- .../vue/src/UserEditForm/UserEditForm.vue | 1 + .../vue/src/UsersManager/UsersManager.vue | 7 +- 7 files changed, 103 insertions(+), 85 deletions(-) diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.js b/plugins/CoreHome/vue/dist/CoreHome.umd.js index d87a8a2fd69..bec0fbdddfb 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.js @@ -1998,6 +1998,11 @@ var AjaxHelper_AjaxHelper = /*#__PURE__*/function () { if (Array.isArray(params)) { helper.setBulkRequests.apply(helper, AjaxHelper_toConsumableArray(params)); } else { + Object.keys(params).forEach(function (key) { + if (/password/i.test(key)) { + throw new Error("Password parameters are not allowed to be sent as GET parameter. Please send ".concat(key, " as POST parameter instead.")); + } + }); helper.addParams(Object.assign(Object.assign({ module: 'API', format: options.format || 'json' diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js index 6bf3a2e419d..30d8dc7fa34 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js @@ -79,7 +79,7 @@ function se(e,t){return fe(e)||pe(e,t)||de(e,t)||ue()}function ue(){throw new Ty * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */Oe.updatePeriodParamsFromUrl=Se.updatePeriodParamsFromUrl.bind(Se);var Ge=window,Ye=Ge.$;function Je(e,t){if("abort"!==t)if("undefined"!==typeof Piwik_Popover){var n=Ye("#loadingError");Piwik_Popover.isOpen()&&e&&500===e.status?e&&500===e.status&&Ye(document.body).html(piwikHelper.escape(e.responseText)):n.show()}else console.log("Request failed: ".concat(e.responseText))}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;r1?i+="".concat(e," (").concat(a[e],"x)"):i+=e}));var l=null,c="toast";Ye(e.errorElement).length&&i.length&&(Ye(e.errorElement).show(),l=e.errorElement,c=null);var s=!document.querySelector("#login_form");if(i&&s){var u=window["require"]("piwik/UI"),d=new u.Notification;d.show(i,{placeat:l,context:"error",type:c,id:"ajaxHelper"}),d.scrollToNotification()}}else e.callback&&e.callback(t,n,r);window.globalAjaxQueue.active-=1,ce.ajaxRequestFinished&&ce.ajaxRequestFinished()},data:this.mixinDefaultPostParams(this.postParams),timeout:null!==this.timeout?this.timeout:void 0};return Ye.ajax(o)}},{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()||ce.shouldPropagateTokenAuth?{token_auth:ce.token_auth,force_api_session:broadcast.isWidgetizeRequestWithoutSession()?0:1}:{}}},{key:"mixinDefaultPostParams",value:function(e){var t=this.getDefaultPostParams(),n=Object.assign(Object.assign({},t),e);return n}},{key:"mixinDefaultGetParams",value:function(e){var t=this,n=Ce.getSearchParam("segment"),r={idSite:ce.idSite?ce.idSite.toString():broadcast.getValueFromUrl("idSite"),period:ce.period||broadcast.getValueFromUrl("period"),segment:n},o=e;return o.token_auth&&(o.token_auth=null,delete o.token_auth),Object.keys(r).forEach((function(e){!t.useGETDefaultParameter(e)||null!==o[e]&&"undefined"!==typeof o[e]&&""!==o[e]||null!==t.postParams[e]&&"undefined"!==typeof t.postParams[e]&&""!==t.postParams[e]||!r[e]||(o[e]=r[e])})),!this.useGETDefaultParameter("date")||o.date||this.postParams.date||(o.date=ce.currentDateString),o}},{key:"getRequestHandle",value:function(){return this.requestHandle}}],[{key:"fetch",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new e;n.withTokenInUrl&&r.withTokenInUrl(),n.errorElement&&r.setErrorElement(n.errorElement),n.redirectOnSuccess&&r.redirectOnSuccess(!0!==n.redirectOnSuccess?n.redirectOnSuccess:void 0),r.setFormat(n.format||"json"),Array.isArray(t)?r.setBulkRequests.apply(r,De(t)):r.addParams(Object.assign(Object.assign({module:"API",format:n.format||"json"},t),{},{segment:t.segment?encodeURIComponent(t.segment):void 0}),"get"),n.postParams&&r.addParams(n.postParams,"post"),n.headers&&(r.headers=Object.assign(Object.assign({},r.headers),n.headers));var o=!0;return"undefined"===typeof n.createErrorNotification||n.createErrorNotification||(r.useCallbackInCaseOfError(),r.setErrorCallback(null),o=!1),n.abortController&&(r.abortController=n.abortController),n.returnResponseObject&&(r.resolveWithHelper=!0),r.send().then((function(t){var n=t instanceof e?t.requestHandle.responseJSON:t,o="API.getBulkRequest"===r.postParams.method&&Array.isArray(n)?n:[n],a=o.filter((function(e){return"error"===e.result})).map((function(e){return e.message}));if(a.length)throw new Ke(a.filter((function(e){return e.length})).join("\n"));return t})).catch((function(e){if(o||e instanceof Ke)throw e;var t="Something went wrong";throw 504===e.status&&(t="Request was possibly aborted"),429===e.status&&(t="Rate Limit was exceed"),new Error(t)}))}},{key:"post",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.fetch(t,Object.assign(Object.assign({},r),{},{postParams:n}))}},{key:"oneAtATime",value:function(t,n){var r=null;return function(o,a){return r&&r.abort(),r=new AbortController,e.post(Object.assign(Object.assign({},o),{},{method:t}),a,Object.assign(Object.assign({},n),{},{abortController:r})).finally((function(){r=null}))}}}]),e}();function Xe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ze(e,t){for(var n=0;n=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;r1?i+="".concat(e," (").concat(a[e],"x)"):i+=e}));var l=null,c="toast";Ye(e.errorElement).length&&i.length&&(Ye(e.errorElement).show(),l=e.errorElement,c=null);var s=!document.querySelector("#login_form");if(i&&s){var u=window["require"]("piwik/UI"),d=new u.Notification;d.show(i,{placeat:l,context:"error",type:c,id:"ajaxHelper"}),d.scrollToNotification()}}else e.callback&&e.callback(t,n,r);window.globalAjaxQueue.active-=1,ce.ajaxRequestFinished&&ce.ajaxRequestFinished()},data:this.mixinDefaultPostParams(this.postParams),timeout:null!==this.timeout?this.timeout:void 0};return Ye.ajax(o)}},{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()||ce.shouldPropagateTokenAuth?{token_auth:ce.token_auth,force_api_session:broadcast.isWidgetizeRequestWithoutSession()?0:1}:{}}},{key:"mixinDefaultPostParams",value:function(e){var t=this.getDefaultPostParams(),n=Object.assign(Object.assign({},t),e);return n}},{key:"mixinDefaultGetParams",value:function(e){var t=this,n=Ce.getSearchParam("segment"),r={idSite:ce.idSite?ce.idSite.toString():broadcast.getValueFromUrl("idSite"),period:ce.period||broadcast.getValueFromUrl("period"),segment:n},o=e;return o.token_auth&&(o.token_auth=null,delete o.token_auth),Object.keys(r).forEach((function(e){!t.useGETDefaultParameter(e)||null!==o[e]&&"undefined"!==typeof o[e]&&""!==o[e]||null!==t.postParams[e]&&"undefined"!==typeof t.postParams[e]&&""!==t.postParams[e]||!r[e]||(o[e]=r[e])})),!this.useGETDefaultParameter("date")||o.date||this.postParams.date||(o.date=ce.currentDateString),o}},{key:"getRequestHandle",value:function(){return this.requestHandle}}],[{key:"fetch",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new e;n.withTokenInUrl&&r.withTokenInUrl(),n.errorElement&&r.setErrorElement(n.errorElement),n.redirectOnSuccess&&r.redirectOnSuccess(!0!==n.redirectOnSuccess?n.redirectOnSuccess:void 0),r.setFormat(n.format||"json"),Array.isArray(t)?r.setBulkRequests.apply(r,De(t)):(Object.keys(t).forEach((function(e){if(/password/i.test(e))throw new Error("Password parameters are not allowed to be sent as GET parameter. Please send ".concat(e," as POST parameter instead."))})),r.addParams(Object.assign(Object.assign({module:"API",format:n.format||"json"},t),{},{segment:t.segment?encodeURIComponent(t.segment):void 0}),"get")),n.postParams&&r.addParams(n.postParams,"post"),n.headers&&(r.headers=Object.assign(Object.assign({},r.headers),n.headers));var o=!0;return"undefined"===typeof n.createErrorNotification||n.createErrorNotification||(r.useCallbackInCaseOfError(),r.setErrorCallback(null),o=!1),n.abortController&&(r.abortController=n.abortController),n.returnResponseObject&&(r.resolveWithHelper=!0),r.send().then((function(t){var n=t instanceof e?t.requestHandle.responseJSON:t,o="API.getBulkRequest"===r.postParams.method&&Array.isArray(n)?n:[n],a=o.filter((function(e){return"error"===e.result})).map((function(e){return e.message}));if(a.length)throw new Ke(a.filter((function(e){return e.length})).join("\n"));return t})).catch((function(e){if(o||e instanceof Ke)throw e;var t="Something went wrong";throw 504===e.status&&(t="Request was possibly aborted"),429===e.status&&(t="Rate Limit was exceed"),new Error(t)}))}},{key:"post",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.fetch(t,Object.assign(Object.assign({},r),{},{postParams:n}))}},{key:"oneAtATime",value:function(t,n){var r=null;return function(o,a){return r&&r.abort(),r=new AbortController,e.post(Object.assign(Object.assign({},o),{},{method:t}),a,Object.assign(Object.assign({},n),{},{abortController:r})).finally((function(){r=null}))}}}]),e}();function Xe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ze(e,t){for(var n=0;n { // eslint-disable-line if (Array.isArray(params)) { helper.setBulkRequests(...(params as QueryParameters[])); } else { + Object.keys(params).forEach((key) => { + if (/password/i.test(key)) { + throw new Error(`Password parameters are not allowed to be sent as GET parameter. Please send ${key} as POST parameter instead.`); + } + }); + helper.addParams({ module: 'API', format: options.format || 'json', diff --git a/plugins/UsersManager/vue/dist/UsersManager.umd.js b/plugins/UsersManager/vue/dist/UsersManager.umd.js index 911d3436d1f..05d5b8ef870 100644 --- a/plugins/UsersManager/vue/dist/UsersManager.umd.js +++ b/plugins/UsersManager/vue/dist/UsersManager.umd.js @@ -1378,104 +1378,104 @@ var UserPermissionsEditvue_type_script_lang_ts_window = window, UserPermissionsEditvue_type_script_lang_ts.render = UserPermissionsEditvue_type_template_id_f66d5c46_render /* harmony default export */ var UserPermissionsEdit = (UserPermissionsEditvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue?vue&type=template&id=149d58f4 +// 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/UsersManager/vue/src/UserEditForm/UserEditForm.vue?vue&type=template&id=61edf210 -var UserEditFormvue_type_template_id_149d58f4_hoisted_1 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_1 = { class: "row" }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_2 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_2 = { key: 0, class: "col s12 m6 invite-notes" }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_3 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_3 = { class: "form-help" }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_4 = ["innerHTML"]; -var UserEditFormvue_type_template_id_149d58f4_hoisted_5 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_4 = ["innerHTML"]; +var UserEditFormvue_type_template_id_61edf210_hoisted_5 = { key: 1, class: "col m2 entityList" }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_6 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_6 = { class: "listCircle" }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_7 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_7 = { key: 0, class: "icon-warning" }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_8 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { +var UserEditFormvue_type_template_id_61edf210_hoisted_8 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { class: "save-button-spacer hide-on-small-only" }, null, -1); -var UserEditFormvue_type_template_id_149d58f4_hoisted_9 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_9 = { href: "", class: "entityCancelLink" }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_10 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { +var UserEditFormvue_type_template_id_61edf210_hoisted_10 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "icon-arrow-left-2" }, "  ", -1); -var UserEditFormvue_type_template_id_149d58f4_hoisted_11 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_11 = { class: "visibleTab col m10" }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_12 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_12 = { key: 0, class: "basic-info-tab" }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_13 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_13 = { class: "form-group row", style: { "position": "relative" } }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_14 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_14 = { class: "col s12 m6 save-button" }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_15 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_15 = { key: 0, class: "resend-notes" }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_16 = ["innerHTML"]; -var UserEditFormvue_type_template_id_149d58f4_hoisted_17 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_16 = ["innerHTML"]; +var UserEditFormvue_type_template_id_61edf210_hoisted_17 = { key: 0, class: "entityCancel" }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_18 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { +var UserEditFormvue_type_template_id_61edf210_hoisted_18 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "icon icon-arrow-left-2" }, "  ", -1); -var UserEditFormvue_type_template_id_149d58f4_hoisted_19 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_19 = { key: 1, class: "user-permissions" }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_20 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_20 = { key: 0 }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_21 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_21 = { key: 1, class: "alert alert-info" }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_22 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_22 = { key: 2, class: "superuser-access form-group" }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_23 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_23 = { key: 0 }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_24 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_24 = { key: 1 }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_25 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_25 = { key: 3, class: "twofa-reset form-group" }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_26 = { +var UserEditFormvue_type_template_id_61edf210_hoisted_26 = { class: "resetTwoFa" }; -var UserEditFormvue_type_template_id_149d58f4_hoisted_27 = ["innerHTML"]; -function UserEditFormvue_type_template_id_149d58f4_render(_ctx, _cache, $props, $setup, $data, $options) { +var UserEditFormvue_type_template_id_61edf210_hoisted_27 = ["innerHTML"]; +function UserEditFormvue_type_template_id_61edf210_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field"); var _component_SaveButton = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("SaveButton"); @@ -1495,9 +1495,9 @@ function UserEditFormvue_type_template_id_149d58f4_render(_ctx, _cache, $props, "content-title": "".concat(_ctx.formTitle, " ").concat(!_ctx.isAdd ? "".concat(_ctx.theUser.login) : '') }, { default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { - return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_149d58f4_hoisted_1, [_ctx.isAdd ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_149d58f4_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_149d58f4_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_61edf210_hoisted_1, [_ctx.isAdd ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_61edf210_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_61edf210_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { innerHTML: _ctx.$sanitize(_ctx.translate('UsersManager_InviteSuccessNotification', [_ctx.inviteTokenExpiryDays])) - }, null, 8, UserEditFormvue_type_template_id_149d58f4_hoisted_4)])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.isAdd ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_149d58f4_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", UserEditFormvue_type_template_id_149d58f4_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { + }, null, 8, UserEditFormvue_type_template_id_61edf210_hoisted_4)])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.isAdd ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_61edf210_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", UserEditFormvue_type_template_id_61edf210_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])([{ active: _ctx.activeTab === 'basic' }, "menuBasicInfo"]) @@ -1518,7 +1518,7 @@ function UserEditFormvue_type_template_id_149d58f4_render(_ctx, _cache, $props, style: { "margin-right": "3.5px" } - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_Permissions')), 1), !_ctx.userHasAccess && !_ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", UserEditFormvue_type_template_id_149d58f4_hoisted_7)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2), _ctx.currentUserRole === 'superuser' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_Permissions')), 1), !_ctx.userHasAccess && !_ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", UserEditFormvue_type_template_id_61edf210_hoisted_7)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2), _ctx.currentUserRole === 'superuser' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { key: 0, class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])([{ active: _ctx.activeTab === 'superuser' @@ -1538,12 +1538,12 @@ function UserEditFormvue_type_template_id_149d58f4_render(_ctx, _cache, $props, onClick: _cache[3] || (_cache[3] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { return _ctx.activeTab = '2fa'; }, ["prevent"])) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_TwoFactorAuthentication')), 1)], 2)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), UserEditFormvue_type_template_id_149d58f4_hoisted_8, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_TwoFactorAuthentication')), 1)], 2)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), UserEditFormvue_type_template_id_61edf210_hoisted_8, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { class: "entityCancel", onClick: _cache[4] || (_cache[4] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { return _ctx.onDoneEditing(); }, ["prevent"])) - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", UserEditFormvue_type_template_id_149d58f4_hoisted_9, [UserEditFormvue_type_template_id_149d58f4_hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_BackToUser')), 1)])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_149d58f4_hoisted_11, [_ctx.activeTab === 'basic' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_149d58f4_hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", UserEditFormvue_type_template_id_61edf210_hoisted_9, [UserEditFormvue_type_template_id_61edf210_hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_BackToUser')), 1)])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_61edf210_hoisted_11, [_ctx.activeTab === 'basic' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_61edf210_hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { modelValue: _ctx.theUser.login, "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) { return _ctx.theUser.login = $event; @@ -1592,19 +1592,19 @@ function UserEditFormvue_type_template_id_149d58f4_render(_ctx, _cache, $props, }, title: _ctx.translate('UsersManager_FirstWebsitePermission'), "inline-help": _ctx.translate('UsersManager_FirstSiteInlineHelp') - }, null, 8, ["modelValue", "disabled", "title", "inline-help"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_149d58f4_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_149d58f4_hoisted_14, [_ctx.currentUserRole === 'superuser' || _ctx.isAdd ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_SaveButton, { + }, null, 8, ["modelValue", "disabled", "title", "inline-help"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_61edf210_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_61edf210_hoisted_14, [_ctx.currentUserRole === 'superuser' || _ctx.isAdd ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_SaveButton, { key: 0, value: _ctx.saveButtonLabel, disabled: _ctx.isAdd && (!_ctx.firstSiteAccess || !_ctx.firstSiteAccess.id), saving: _ctx.isSavingUserInfo, onConfirm: _ctx.saveUserInfo - }, null, 8, ["value", "disabled", "saving", "onConfirm"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])]), _ctx.user && _ctx.isPending ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", UserEditFormvue_type_template_id_149d58f4_hoisted_15, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_InvitationSent')) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + }, null, 8, ["value", "disabled", "saving", "onConfirm"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])]), _ctx.user && _ctx.isPending ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", UserEditFormvue_type_template_id_61edf210_hoisted_15, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_InvitationSent')) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "resend-link", onClick: _cache[9] || (_cache[9] = function () { return _ctx.resendRequestedUser && _ctx.resendRequestedUser.apply(_ctx, arguments); }), innerHTML: _ctx.$sanitize(_ctx.translate('UsersManager_ResendInvite') + '/' + _ctx.translate('UsersManager_CopyLink')) - }, null, 8, UserEditFormvue_type_template_id_149d58f4_hoisted_16)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_PasswordConfirmation, { + }, null, 8, UserEditFormvue_type_template_id_61edf210_hoisted_16)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_PasswordConfirmation, { modelValue: _ctx.showPasswordConfirmationForInviteUser, "onUpdate:modelValue": _cache[10] || (_cache[10] = function ($event) { return _ctx.showPasswordConfirmationForInviteUser = $event; @@ -1615,13 +1615,13 @@ function UserEditFormvue_type_template_id_149d58f4_render(_ctx, _cache, $props, return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ConfirmWithPassword')), 1)]; }), _: 1 - }, 8, ["modelValue", "onConfirmed"])]), _ctx.isAdd ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_149d58f4_hoisted_17, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + }, 8, ["modelValue", "onConfirmed"])]), _ctx.isAdd ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_61edf210_hoisted_17, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { href: "", class: "entityCancelLink", onClick: _cache[11] || (_cache[11] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { return _ctx.onDoneEditing(); }, ["prevent"])) - }, [UserEditFormvue_type_template_id_149d58f4_hoisted_18, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_BackToUser')), 1)])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.isAdd ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_149d58f4_hoisted_19, [!_ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_149d58f4_hoisted_20, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_UserPermissionsEdit, { + }, [UserEditFormvue_type_template_id_61edf210_hoisted_18, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_BackToUser')), 1)])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.isAdd ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_61edf210_hoisted_19, [!_ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_61edf210_hoisted_20, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_UserPermissionsEdit, { "user-login": _ctx.theUser.login, onUserHasAccessDetected: _cache[12] || (_cache[12] = function ($event) { return _ctx.userHasAccess = $event.hasAccess; @@ -1631,7 +1631,7 @@ function UserEditFormvue_type_template_id_149d58f4_render(_ctx, _cache, $props, }), "access-levels": _ctx.accessLevels, "filter-access-levels": _ctx.filterAccessLevels - }, null, 8, ["user-login", "access-levels", "filter-access-levels"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_149d58f4_hoisted_21, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_SuperUsersPermissionsNotice')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.activeTab === 'permissions']]) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.activeTab === 'superuser' && _ctx.currentUserRole === 'superuser' && !_ctx.isAdd ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_149d58f4_hoisted_22, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_SuperUserIntro1')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("strong", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_SuperUserIntro2')), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + }, null, 8, ["user-login", "access-levels", "filter-access-levels"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_61edf210_hoisted_21, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_SuperUsersPermissionsNotice')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.activeTab === 'permissions']]) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.activeTab === 'superuser' && _ctx.currentUserRole === 'superuser' && !_ctx.isAdd ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_61edf210_hoisted_22, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_SuperUserIntro1')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("strong", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_SuperUserIntro2')), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { modelValue: _ctx.superUserAccessChecked, "onUpdate:modelValue": _cache[14] || (_cache[14] = function ($event) { return _ctx.superUserAccessChecked = $event; @@ -1654,10 +1654,10 @@ function UserEditFormvue_type_template_id_149d58f4_render(_ctx, _cache, $props, }) }, { default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { - return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_AreYouSure')), 1), _ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", UserEditFormvue_type_template_id_149d58f4_hoisted_23, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_RemoveSuperuserAccessConfirm')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", UserEditFormvue_type_template_id_149d58f4_hoisted_24, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_AddSuperuserAccessConfirm')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]; + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_AreYouSure')), 1), _ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", UserEditFormvue_type_template_id_61edf210_hoisted_23, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_RemoveSuperuserAccessConfirm')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", UserEditFormvue_type_template_id_61edf210_hoisted_24, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_AddSuperuserAccessConfirm')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]; }), _: 1 - }, 8, ["modelValue", "onConfirmed"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.currentUserRole === 'superuser' && !_ctx.isAdd ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_149d58f4_hoisted_25, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ResetTwoFactorAuthenticationInfo')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_149d58f4_hoisted_26, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SaveButton, { + }, 8, ["modelValue", "onConfirmed"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.currentUserRole === 'superuser' && !_ctx.isAdd ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_61edf210_hoisted_25, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ResetTwoFactorAuthenticationInfo')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_61edf210_hoisted_26, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SaveButton, { saving: _ctx.isResetting2FA, onConfirm: _cache[18] || (_cache[18] = function ($event) { return _ctx.confirmReset2FA(); @@ -1684,7 +1684,7 @@ function UserEditFormvue_type_template_id_149d58f4_render(_ctx, _cache, $props, default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", { innerHTML: _ctx.$sanitize(_ctx.changePasswordTitle) - }, null, 8, UserEditFormvue_type_template_id_149d58f4_hoisted_27), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ConfirmWithPassword')), 1)]; + }, null, 8, UserEditFormvue_type_template_id_61edf210_hoisted_27), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ConfirmWithPassword')), 1)]; }), _: 1 }, 8, ["modelValue", "onConfirmed"])]; @@ -1692,7 +1692,7 @@ function UserEditFormvue_type_template_id_149d58f4_render(_ctx, _cache, $props, _: 1 }, 8, ["class", "content-title"]); } -// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue?vue&type=template&id=149d58f4 +// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue?vue&type=template&id=61edf210 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue?vue&type=script&lang=ts @@ -1876,7 +1876,8 @@ var DEFAULT_USER = { this.isResetting2FA = true; return external_CoreHome_["AjaxHelper"].post({ - method: 'TwoFactorAuth.resetTwoFactorAuth', + method: 'TwoFactorAuth.resetTwoFactorAuth' + }, { userLogin: this.theUser.login, passwordConfirmation: password }).catch(function (e) { @@ -1958,7 +1959,7 @@ var DEFAULT_USER = { -UserEditFormvue_type_script_lang_ts.render = UserEditFormvue_type_template_id_149d58f4_render +UserEditFormvue_type_script_lang_ts.render = UserEditFormvue_type_template_id_61edf210_render /* harmony default export */ var UserEditForm = (UserEditFormvue_type_script_lang_ts); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/UsersManager/vue/src/PagedUsersList/PagedUsersList.vue?vue&type=template&id=a30e9fba @@ -2730,77 +2731,77 @@ var PagedUsersListvue_type_script_lang_ts_window = window, PagedUsersListvue_type_script_lang_ts.render = PagedUsersListvue_type_template_id_a30e9fba_render /* harmony default export */ var PagedUsersList = (PagedUsersListvue_type_script_lang_ts); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/UsersManager/vue/src/UsersManager/UsersManager.vue?vue&type=template&id=267f458b +// 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/UsersManager/vue/src/UsersManager/UsersManager.vue?vue&type=template&id=3b9986eb -var UsersManagervue_type_template_id_267f458b_hoisted_1 = { +var UsersManagervue_type_template_id_3b9986eb_hoisted_1 = { class: "usersManager" }; -var UsersManagervue_type_template_id_267f458b_hoisted_2 = { +var UsersManagervue_type_template_id_3b9986eb_hoisted_2 = { key: 0 }; -var UsersManagervue_type_template_id_267f458b_hoisted_3 = { +var UsersManagervue_type_template_id_3b9986eb_hoisted_3 = { key: 1 }; -var UsersManagervue_type_template_id_267f458b_hoisted_4 = { +var UsersManagervue_type_template_id_3b9986eb_hoisted_4 = { class: "row add-user-container" }; -var UsersManagervue_type_template_id_267f458b_hoisted_5 = { +var UsersManagervue_type_template_id_3b9986eb_hoisted_5 = { class: "col s12" }; -var UsersManagervue_type_template_id_267f458b_hoisted_6 = { +var UsersManagervue_type_template_id_3b9986eb_hoisted_6 = { class: "input-field", style: { "margin-right": "3.5px" } }; -var UsersManagervue_type_template_id_267f458b_hoisted_7 = { +var UsersManagervue_type_template_id_3b9986eb_hoisted_7 = { key: 0, class: "input-field" }; -var UsersManagervue_type_template_id_267f458b_hoisted_8 = { +var UsersManagervue_type_template_id_3b9986eb_hoisted_8 = { key: 0 }; -var UsersManagervue_type_template_id_267f458b_hoisted_9 = { +var UsersManagervue_type_template_id_3b9986eb_hoisted_9 = { class: "resend-invite-confirm-modal modal", ref: "resendInviteConfirmModal" }; -var UsersManagervue_type_template_id_267f458b_hoisted_10 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { +var UsersManagervue_type_template_id_3b9986eb_hoisted_10 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { class: "btn-close modal-close" }, [/*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("i", { class: "icon-close" })], -1); -var UsersManagervue_type_template_id_267f458b_hoisted_11 = { +var UsersManagervue_type_template_id_3b9986eb_hoisted_11 = { class: "modal-content" }; -var UsersManagervue_type_template_id_267f458b_hoisted_12 = { +var UsersManagervue_type_template_id_3b9986eb_hoisted_12 = { class: "modal-title" }; -var UsersManagervue_type_template_id_267f458b_hoisted_13 = ["innerHTML"]; -var UsersManagervue_type_template_id_267f458b_hoisted_14 = { +var UsersManagervue_type_template_id_3b9986eb_hoisted_13 = ["innerHTML"]; +var UsersManagervue_type_template_id_3b9986eb_hoisted_14 = { class: "modal-footer" }; -var UsersManagervue_type_template_id_267f458b_hoisted_15 = { +var UsersManagervue_type_template_id_3b9986eb_hoisted_15 = { key: 0, class: "success-copied" }; -var UsersManagervue_type_template_id_267f458b_hoisted_16 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("i", { +var UsersManagervue_type_template_id_3b9986eb_hoisted_16 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("i", { class: "icon-success" }, null, -1); -var UsersManagervue_type_template_id_267f458b_hoisted_17 = { +var UsersManagervue_type_template_id_3b9986eb_hoisted_17 = { class: "add-existing-user-modal modal", ref: "addExistingUserModal" }; -var UsersManagervue_type_template_id_267f458b_hoisted_18 = { +var UsersManagervue_type_template_id_3b9986eb_hoisted_18 = { class: "modal-content" }; -var UsersManagervue_type_template_id_267f458b_hoisted_19 = { +var UsersManagervue_type_template_id_3b9986eb_hoisted_19 = { class: "modal-footer" }; -function UsersManagervue_type_template_id_267f458b_render(_ctx, _cache, $props, $setup, $data, $options) { +function UsersManagervue_type_template_id_3b9986eb_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_EnrichedHeadline = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("EnrichedHeadline"); var _component_PagedUsersList = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("PagedUsersList"); @@ -2815,7 +2816,7 @@ function UsersManagervue_type_template_id_267f458b_render(_ctx, _cache, $props, var _directive_tooltips = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("tooltips"); - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UsersManagervue_type_template_id_267f458b_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_EnrichedHeadline, { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UsersManagervue_type_template_id_3b9986eb_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_EnrichedHeadline, { "help-url": "https://matomo.org/docs/manage-users/", "feature-name": "Users Management" }, { @@ -2823,12 +2824,12 @@ function UsersManagervue_type_template_id_267f458b_render(_ctx, _cache, $props, return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ManageUsers')), 1)]; }), _: 1 - })]), _ctx.currentUserRole === 'superuser' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", UsersManagervue_type_template_id_267f458b_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ManageUsersDesc')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.currentUserRole === 'admin' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", UsersManagervue_type_template_id_267f458b_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ManageUsersAdminDesc')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_267f458b_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_267f458b_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_267f458b_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + })]), _ctx.currentUserRole === 'superuser' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", UsersManagervue_type_template_id_3b9986eb_hoisted_2, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ManageUsersDesc')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.currentUserRole === 'admin' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", UsersManagervue_type_template_id_3b9986eb_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ManageUsersAdminDesc')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_3b9986eb_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_3b9986eb_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_3b9986eb_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { class: "btn add-new-user", onClick: _cache[0] || (_cache[0] = function ($event) { return _ctx.onAddNewUser(); }) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_InviteNewUser')), 1)]), _ctx.currentUserRole !== 'superuser' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UsersManagervue_type_template_id_267f458b_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_InviteNewUser')), 1)]), _ctx.currentUserRole !== 'superuser' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UsersManagervue_type_template_id_3b9986eb_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { class: "btn add-existing-user", onClick: _cache[1] || (_cache[1] = function ($event) { return _ctx.showAddExistingUserModal(); @@ -2861,7 +2862,7 @@ function UsersManagervue_type_template_id_267f458b_render(_ctx, _cache, $props, "search-params": _ctx.searchParams, users: _ctx.users, "total-entries": _ctx.totalEntries - }, null, 8, ["initial-site-id", "initial-site-name", "is-loading-users", "current-user-role", "access-levels", "filter-access-levels", "filter-status-levels", "search-params", "users", "total-entries"])], 512), [[_directive_content_intro]])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.isEditing]]), _ctx.isEditing ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UsersManagervue_type_template_id_267f458b_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_UserEditForm, { + }, null, 8, ["initial-site-id", "initial-site-name", "is-loading-users", "current-user-role", "access-levels", "filter-access-levels", "filter-status-levels", "search-params", "users", "total-entries"])], 512), [[_directive_content_intro]])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.isEditing]]), _ctx.isEditing ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UsersManagervue_type_template_id_3b9986eb_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_UserEditForm, { onDone: _cache[7] || (_cache[7] = function ($event) { return _ctx.onDoneEditing($event.isUserModified); }), @@ -2878,10 +2879,10 @@ function UsersManagervue_type_template_id_267f458b_render(_ctx, _cache, $props, onUpdated: _cache[9] || (_cache[9] = function ($event) { return _ctx.userBeingEdited = $event.user; }) - }, null, 8, ["user", "current-user-role", "invite-token-expiry-days", "access-levels", "filter-access-levels", "initial-site-id", "initial-site-name"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_267f458b_hoisted_9, [UsersManagervue_type_template_id_267f458b_hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_267f458b_hoisted_11, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", UsersManagervue_type_template_id_267f458b_hoisted_12, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ResendInvite')), 1), _ctx.userBeingEdited ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", { + }, null, 8, ["user", "current-user-role", "invite-token-expiry-days", "access-levels", "filter-access-levels", "initial-site-id", "initial-site-name"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_3b9986eb_hoisted_9, [UsersManagervue_type_template_id_3b9986eb_hoisted_10, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_3b9986eb_hoisted_11, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", UsersManagervue_type_template_id_3b9986eb_hoisted_12, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ResendInvite')), 1), _ctx.userBeingEdited ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", { key: 0, innerHTML: _ctx.$sanitize(_ctx.translate('UsersManager_InviteConfirmMessage', ["".concat(_ctx.userBeingEdited.login, ""), "".concat(_ctx.userBeingEdited.email, "")])) - }, null, 8, UsersManagervue_type_template_id_267f458b_hoisted_13)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("strong", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_InviteActionNotes', _ctx.inviteTokenExpiryDays)), 1)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_267f458b_hoisted_14, [_ctx.copied ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", UsersManagervue_type_template_id_267f458b_hoisted_15, [UsersManagervue_type_template_id_267f458b_hoisted_16, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_LinkCopied')), 1)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("button", { + }, null, 8, UsersManagervue_type_template_id_3b9986eb_hoisted_13)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("strong", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_InviteActionNotes', _ctx.inviteTokenExpiryDays)), 1)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_3b9986eb_hoisted_14, [_ctx.copied ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", UsersManagervue_type_template_id_3b9986eb_hoisted_15, [UsersManagervue_type_template_id_3b9986eb_hoisted_16, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_LinkCopied')), 1)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("button", { onClick: _cache[10] || (_cache[10] = function ($event) { return _ctx.showInviteActionPasswordConfirm('copy'); }), @@ -2894,14 +2895,14 @@ function UsersManagervue_type_template_id_267f458b_render(_ctx, _cache, $props, onClick: _cache[11] || (_cache[11] = function ($event) { return _ctx.showInviteActionPasswordConfirm('send'); }) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ResendInvite')), 1)])], 512), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_267f458b_hoisted_17, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_267f458b_hoisted_18, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_AddExistingUser')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_EnterUsernameOrEmail')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ResendInvite')), 1)])], 512), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_3b9986eb_hoisted_17, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_3b9986eb_hoisted_18, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_AddExistingUser')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_EnterUsernameOrEmail')) + ":", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { modelValue: _ctx.addNewUserLoginEmail, "onUpdate:modelValue": _cache[12] || (_cache[12] = function ($event) { return _ctx.addNewUserLoginEmail = $event; }), name: "add-existing-user-email", uicontrol: "text" - }, null, 8, ["modelValue"])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_267f458b_hoisted_19, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + }, null, 8, ["modelValue"])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UsersManagervue_type_template_id_3b9986eb_hoisted_19, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { href: "", class: "modal-action modal-close btn", onClick: _cache[13] || (_cache[13] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { @@ -2929,7 +2930,7 @@ function UsersManagervue_type_template_id_267f458b_render(_ctx, _cache, $props, _: 1 }, 8, ["modelValue", "onConfirmed"])], 512)), [[_directive_tooltips]]); } -// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/UsersManager/UsersManager.vue?vue&type=template&id=267f458b +// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/UsersManager/UsersManager.vue?vue&type=template&id=3b9986eb // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/UsersManager/vue/src/UsersManager/UsersManager.vue?vue&type=script&lang=ts /* eslint-disable newline-per-chained-call */ @@ -3175,8 +3176,9 @@ var UsersManagervue_type_script_lang_ts_window = window, this.loading = true; try { - var res = await external_CoreHome_["AjaxHelper"].fetch({ - method: 'UsersManager.generateInviteLink', + var res = await external_CoreHome_["AjaxHelper"].post({ + method: 'UsersManager.generateInviteLink' + }, { userLogin: this.userBeingEdited.login, passwordConfirmation: password }); @@ -3217,9 +3219,10 @@ var UsersManagervue_type_script_lang_ts_window = window, var _this3 = this; if (password === '') return; - external_CoreHome_["AjaxHelper"].fetch({ + external_CoreHome_["AjaxHelper"].post({ method: 'UsersManager.resendInvite', - userLogin: this.userBeingEdited.login, + userLogin: this.userBeingEdited.login + }, { passwordConfirmation: password }).then(function () { _this3.fetchUsers(); @@ -3304,7 +3307,7 @@ var UsersManagervue_type_script_lang_ts_window = window, -UsersManagervue_type_script_lang_ts.render = UsersManagervue_type_template_id_267f458b_render +UsersManagervue_type_script_lang_ts.render = UsersManagervue_type_template_id_3b9986eb_render /* harmony default export */ var UsersManager = (UsersManagervue_type_script_lang_ts); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/UsersManager/vue/src/AnonymousSettings/AnonymousSettings.vue?vue&type=template&id=49762f75 diff --git a/plugins/UsersManager/vue/dist/UsersManager.umd.min.js b/plugins/UsersManager/vue/dist/UsersManager.umd.min.js index 5a6033d738b..e5942f5c5e0 100644 --- a/plugins/UsersManager/vue/dist/UsersManager.umd.min.js +++ b/plugins/UsersManager/vue/dist/UsersManager.umd.min.js @@ -4,7 +4,7 @@ * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var C=function(){function e(){var t=this;h(this,e),v(this,"privateState",Object(o["reactive"])({isLoading:!1,capabilities:[]})),v(this,"state",Object(o["computed"])((function(){return Object(o["readonly"])(t.privateState)}))),v(this,"capabilities",Object(o["computed"])((function(){return t.state.value.capabilities}))),v(this,"isLoading",Object(o["computed"])((function(){return t.state.value.isLoading}))),v(this,"fetchPromise",void 0)}return j(e,[{key:"init",value:function(){return this.fetchCapabilities()}},{key:"fetchCapabilities",value:function(){var e=this;return this.fetchPromise||(this.privateState.isLoading=!0,this.fetchPromise=g["AjaxHelper"].fetch({method:"UsersManager.getAvailableCapabilities"}).then((function(t){return e.privateState.capabilities=t,e.capabilities.value})).finally((function(){e.privateState.isLoading=!1}))),this.fetchPromise}}]),e}(),y=new C,k=window,N=k.$,S=Object(o["defineComponent"])({props:{idsite:[String,Number],siteName:{type:String,required:!0},userLogin:{type:String,required:!0},userRole:{type:String,required:!0},capabilities:Array},components:{Field:f["Field"]},data:function(){return{theCapabilities:this.capabilities||[],isBusy:!1,isAddingCapability:!1,capabilityToAddId:null,capabilityToRemoveId:null,capabilityToAddOrRemove:null}},emits:["change"],watch:{capabilities:function(e){e&&(this.theCapabilities=e)}},created:function(){var e=this;y.init(),this.capabilities?this.theCapabilities=this.capabilities:(this.isBusy=!0,g["AjaxHelper"].fetch({method:"UsersManager.getUsersPlusRole",limit:"1",filter_search:this.userLogin}).then((function(e){return e&&e.capabilities?e.capabilities:[]})).then((function(t){e.theCapabilities=t})).finally((function(){e.isBusy=!1})))},methods:{onToggleCapability:function(e){var t=this;this.isAddingCapability=e;var n=e?this.capabilityToAddId:this.capabilityToRemoveId;this.capabilityToAddOrRemove=null,this.availableCapabilities.forEach((function(e){e.id===n&&(t.capabilityToAddOrRemove=e)})),this.$refs.confirmCapabilityToggleModal&&N(this.$refs.confirmCapabilityToggleModal).modal({dismissible:!1,yes:function(){return null}}).modal("open")},toggleCapability:function(){this.isAddingCapability?this.addCapability(this.capabilityToAddOrRemove):this.removeCapability(this.capabilityToAddOrRemove)},isIncludedInRole:function(e){return-1!==(e.includedInRoles||[]).indexOf(this.userRole)},getCapabilitiesList:function(){var e=this,t=[];return this.availableCapabilities.forEach((function(n){e.isIncludedInRole(n)||e.capabilitiesSet[n.id]&&t.push(n.id)})),t},addCapability:function(e){var t=this;this.isBusy=!0,g["AjaxHelper"].post({method:"UsersManager.addCapabilities"},{userLogin:this.userLogin,capabilities:e.id,idSites:this.idsite}).then((function(){t.$emit("change",t.getCapabilitiesList())})).finally((function(){t.isBusy=!1,t.capabilityToAddOrRemove=null,t.capabilityToAddId=null,t.capabilityToRemoveId=null}))},removeCapability:function(e){var t=this;this.isBusy=!0,g["AjaxHelper"].post({method:"UsersManager.removeCapabilities"},{userLogin:this.userLogin,capabilities:e.id,idSites:this.idsite}).then((function(){t.$emit("change",t.getCapabilitiesList())})).finally((function(){t.isBusy=!1,t.capabilityToAddOrRemove=null,t.capabilityToAddId=null,t.capabilityToRemoveId=null}))}},computed:{availableCapabilities:function(){return y.capabilities.value},confirmAddCapabilityToggleContent:function(){return Object(g["translate"])("UsersManager_AreYouSureAddCapability","".concat(this.userLogin,""),"".concat(this.capabilityToAddOrRemove?this.capabilityToAddOrRemove.name:"",""),"".concat(this.siteNameText,""))},confirmCapabilityToggleContent:function(){return Object(g["translate"])("UsersManager_AreYouSureRemoveCapability","".concat(this.capabilityToAddOrRemove?this.capabilityToAddOrRemove.name:"",""),"".concat(this.userLogin,""),"".concat(this.siteNameText,""))},siteNameText:function(){return g["Matomo"].helper.htmlEntities(this.siteName)},availableCapabilitiesGrouped:function(){var e=this,t=this.availableCapabilities.filter((function(t){return!e.capabilitiesSet[t.id]})).map((function(e){return{group:e.category,key:e.id,value:e.name,tooltip:e.description}}));return t.sort((function(e,t){return e.group===t.group?e.value===t.value?0:e.valuee.limit?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",q,[Object(o["createElementVNode"])("div",$,[Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["prev",{disabled:e.offset<=0}])},[Object(o["createElementVNode"])("span",{class:"pointer",onClick:t[6]||(t[6]=function(t){return e.gotoPreviousPage()})},"« "+Object(o["toDisplayString"])(e.translate("General_Previous")),1)],2),Object(o["createElementVNode"])("span",G,[Object(o["createElementVNode"])("span",{textContent:Object(o["toDisplayString"])(e.paginationText)},null,8,z)]),Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["next",{disabled:e.offset+e.limit>=e.totalEntries}])},[Object(o["createElementVNode"])("span",{class:"pointer",onClick:t[7]||(t[7]=function(t){return e.gotoNextPage()})},Object(o["toDisplayString"])(e.translate("General_Next"))+" »",1)],2)])])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",W,[e.isRoleHelpToggled?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,context:"info",type:"persistent",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.rolesHelpText)},null,8,Y)]})),_:1})):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",X,[e.isCapabilitiesHelpToggled?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,context:"info",type:"persistent",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.translate("UsersManager_CapabilitiesHelp")),1)]})),_:1})):Object(o["createCommentVNode"])("",!0)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("table",J,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",K,[Object(o["createElementVNode"])("span",Q,[Object(o["createElementVNode"])("label",null,[Object(o["createElementVNode"])("input",{type:"checkbox",id:"perm_edit_select_all",checked:e.isAllCheckboxSelected,onChange:t[8]||(t[8]=function(t){return e.onAllCheckboxChange(t)})},null,40,Z),ee])])]),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Name")),1),Object(o["createElementVNode"])("th",te,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize("".concat(e.translate("UsersManager_Role")," "))},null,8,ne),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["helpIcon",{sticky:e.isRoleHelpToggled}]),onClick:t[9]||(t[9]=Object(o["withModifiers"])((function(t){return e.isRoleHelpToggled=!e.isRoleHelpToggled}),["prevent"]))},re,2)]),Object(o["createElementVNode"])("th",oe,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize("".concat(e.translate("UsersManager_Capabilities")," "))},null,8,ie),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["helpIcon",{sticky:e.isCapabilitiesHelpToggled}]),onClick:t[10]||(t[10]=Object(o["withModifiers"])((function(t){return e.isCapabilitiesHelpToggled=!e.isCapabilitiesHelpToggled}),["prevent"]))},le,2)])])]),Object(o["createElementVNode"])("tbody",null,[e.isAllCheckboxSelected&&e.siteAccess.length=(this.totalEntries||0)||(this.offset=e,this.fetchAccess())},showRemoveAccessConfirm:function(){Pe(this.$refs.deleteAccessConfirmModal).modal({dismissible:!1}).modal("open")},changeUserRole:function(){var e=this,t=function(){var t=[];return Object.keys(e.selectedRows).forEach((function(n){e.selectedRows[n]&&e.siteAccess[n]&&t.push(e.siteAccess[n].idsite)})),t},n=function(){return g["AjaxHelper"].fetch({method:"UsersManager.getSitesAccessForUser",filter_search:e.siteNameFilter,filter_access:e.accessLevelFilter,userLogin:e.userLogin,filter_limit:"-1"}).then((function(e){return e.map((function(e){return e.idsite}))}))};return this.isLoadingAccess=!0,Promise.resolve().then((function(){return e.siteAccessToChange?[e.siteAccessToChange.idsite]:e.areAllResultsSelected?n():t()})).then((function(t){return g["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:e.userLogin,access:e.roleToChangeTo,idSites:t})})).catch((function(){})).then((function(){return e.$emit("accessChanged"),e.fetchAccess()}))},showChangeAccessConfirm:function(){var e=this;Pe(this.$refs.changeAccessConfirmModal).modal({dismissible:!1,onCloseEnd:function(){e.accessChangeEvent=null}}).modal("open")},getRoleDisplay:function(e){var t=null;return this.filteredAccessLevels.forEach((function(n){n.key===e&&(t=n.value)})),t},giveAccessToAllSites:function(){var e=this;this.isGivingAccessToAllSites=!0,g["AjaxHelper"].fetch({method:"SitesManager.getSitesWithAdminAccess",filter_limit:-1}).then((function(t){var n=t.map((function(e){return e.idsite}));return g["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:e.userLogin,access:e.allWebsitesAccssLevelSet,idSites:n})})).then((function(){return e.fetchAccess()})).finally((function(){e.isGivingAccessToAllSites=!1}))},showChangeAccessAllSitesModal:function(){Pe(this.$refs.confirmGiveAccessAllSitesModal).modal({dismissible:!1}).modal("open")},onChangeSiteFilter:function(e){var t=this;setTimeout((function(){var n=e.target.value;t.siteNameFilter!==n&&(t.siteNameFilter=n,t.offset=0,t.fetchAccess())}))},onRoleChange:function(e,t){this.siteAccessToChange=e,this.roleToChangeTo=t.value,this.accessChangeEvent=t,this.showChangeAccessConfirm()}},computed:{rolesHelpText:function(){return Object(g["translate"])("UsersManager_RolesHelp",'',"",'',"")},theDisplayedWebsitesAreSelectedText:function(){var e=Object(g["translate"])("UsersManager_TheDisplayedWebsitesAreSelected","".concat(this.siteAccess.length,""));return"".concat(e," ")},clickToSelectAllText:function(){return Object(g["translate"])("UsersManager_ClickToSelectAll","".concat(this.totalEntries,""))},allWebsitesAreSelectedText:function(){return Object(g["translate"])("UsersManager_AllWebsitesAreSelected","".concat(this.totalEntries,""))},clickToSelectDisplayedWebsitesText:function(){return Object(g["translate"])("UsersManager_ClickToSelectDisplayedWebsites","".concat(this.siteAccess.length,""))},deletePermConfirmSingleText:function(){return Object(g["translate"])("UsersManager_DeletePermConfirmSingle","".concat(this.userLogin,""),"".concat(this.siteAccessToChangeName,""))},deletePermConfirmMultipleText:function(){return Object(g["translate"])("UsersManager_DeletePermConfirmMultiple","".concat(this.userLogin,""),"".concat(this.affectedSitesCount,""))},changePermToSiteConfirmSingleText:function(){return Object(g["translate"])("UsersManager_ChangePermToSiteConfirmSingle","".concat(this.userLogin,""),"".concat(this.siteAccessToChangeName,""),"".concat(this.getRoleDisplay(this.roleToChangeTo),""))},changePermToSiteConfirmMultipleText:function(){return Object(g["translate"])("UsersManager_ChangePermToSiteConfirmMultiple","".concat(this.userLogin,""),"".concat(this.affectedSitesCount,""),"".concat(this.getRoleDisplay(this.roleToChangeTo),""))},changePermToAllSitesConfirmText:function(){return Object(g["translate"])("UsersManager_ChangePermToAllSitesConfirm","".concat(this.userLogin,""),"".concat(this.getRoleDisplay(this.allWebsitesAccssLevelSet),""))},paginationLowerBound:function(){return this.offset+1},paginationUpperBound:function(){return this.totalEntries?Math.min(this.offset+this.limit,this.totalEntries):"?"},filteredAccessLevels:function(){return this.accessLevels.filter((function(e){return"superuser"!==e.key&&"role"===e.type}))},filteredSelectAccessLevels:function(){return this.filterAccessLevels.filter((function(e){return"superuser"!==e.key}))},selectedRowsCount:function(){var e=0;return Object.values(this.selectedRows).forEach((function(t){t&&(e+=1)})),e},affectedSitesCount:function(){return this.areAllResultsSelected?this.totalEntries:this.selectedRowsCount},allPropsWatch:function(){return this.userLogin,this.limit,this.accessLevels,this.filterAccessLevels,Date.now()},siteAccessToChangeName:function(){return this.siteAccessToChange?g["Matomo"].helper.htmlEntities(this.siteAccessToChange.site_name):""},paginationText:function(){var e=Object(g["translate"])("General_Pagination","".concat(this.paginationLowerBound),"".concat(this.paginationUpperBound),"".concat(this.totalEntries));return" ".concat(e," ")}}});Re.render=xe;var Fe=Re,He={class:"row"},Ie={key:0,class:"col s12 m6 invite-notes"},qe={class:"form-help"},$e=["innerHTML"],Ge={key:1,class:"col m2 entityList"},ze={class:"listCircle"},We={key:0,class:"icon-warning"},Ye=Object(o["createElementVNode"])("div",{class:"save-button-spacer hide-on-small-only"},null,-1),Xe={href:"",class:"entityCancelLink"},Je=Object(o["createElementVNode"])("span",{class:"icon-arrow-left-2"},"  ",-1),Ke={class:"visibleTab col m10"},Qe={key:0,class:"basic-info-tab"},Ze={class:"form-group row",style:{position:"relative"}},et={class:"col s12 m6 save-button"},tt={key:0,class:"resend-notes"},nt=["innerHTML"],st={key:0,class:"entityCancel"},rt=Object(o["createElementVNode"])("span",{class:"icon icon-arrow-left-2"},"  ",-1),ot={key:1,class:"user-permissions"},it={key:0},at={key:1,class:"alert alert-info"},lt={key:2,class:"superuser-access form-group"},ct={key:0},dt={key:1},ut={key:3,class:"twofa-reset form-group"},mt={class:"resetTwoFa"},bt=["innerHTML"];function pt(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("SaveButton"),c=Object(o["resolveComponent"])("PasswordConfirmation"),d=Object(o["resolveComponent"])("UserPermissionsEdit"),u=Object(o["resolveComponent"])("ContentBlock"),m=Object(o["resolveDirective"])("form");return Object(o["openBlock"])(),Object(o["createBlock"])(u,{class:Object(o["normalizeClass"])(["userEditForm",{loading:e.isSavingUserInfo}]),"content-title":"".concat(e.formTitle," ").concat(e.isAdd?"":"".concat(e.theUser.login))},{default:Object(o["withCtx"])((function(){return[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",He,[e.isAdd?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ie,[Object(o["createElementVNode"])("div",qe,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("UsersManager_InviteSuccessNotification",[e.inviteTokenExpiryDays]))},null,8,$e)])])):Object(o["createCommentVNode"])("",!0),e.isAdd?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ge,[Object(o["createElementVNode"])("ul",ze,[Object(o["createElementVNode"])("li",{class:Object(o["normalizeClass"])([{active:"basic"===e.activeTab},"menuBasicInfo"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[0]||(t[0]=Object(o["withModifiers"])((function(t){return e.activeTab="basic"}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_BasicInformation")),1)],2),Object(o["createElementVNode"])("li",{class:Object(o["normalizeClass"])([{active:"permissions"===e.activeTab},"menuPermissions"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[1]||(t[1]=Object(o["withModifiers"])((function(t){return e.activeTab="permissions"}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("UsersManager_Permissions")),1),e.userHasAccess||e.theUser.superuser_access?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",We))],2),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:0,class:Object(o["normalizeClass"])([{active:"superuser"===e.activeTab},"menuSuperuser"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[2]||(t[2]=Object(o["withModifiers"])((function(t){return e.activeTab="superuser"}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_SuperUserAccess")),1)],2)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole&&e.theUser.uses_2fa&&!e.isAdd?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:1,class:Object(o["normalizeClass"])([{active:"2fa"===e.activeTab},"menuUserTwoFa"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[3]||(t[3]=Object(o["withModifiers"])((function(t){return e.activeTab="2fa"}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_TwoFactorAuthentication")),1)],2)):Object(o["createCommentVNode"])("",!0)]),Ye,Object(o["createElementVNode"])("div",{class:"entityCancel",onClick:t[4]||(t[4]=Object(o["withModifiers"])((function(t){return e.onDoneEditing()}),["prevent"]))},[Object(o["createElementVNode"])("a",Xe,[Je,Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_BackToUser")),1)])])])),Object(o["createElementVNode"])("div",Ke,["basic"===e.activeTab?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Qe,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{modelValue:e.theUser.login,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.theUser.login=t}),disabled:e.isSavingUserInfo||!e.isAdd||e.isShowingPasswordConfirm,autocomplete:"off",uicontrol:"text",name:"user_login",maxlength:100,title:e.translate("General_Username")},null,8,["modelValue","disabled","title"])]),Object(o["createElementVNode"])("div",null,[e.isPending?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,"model-value":e.theUser.password,disabled:e.isSavingUserInfo||"superuser"!==e.currentUserRole&&!e.isAdd||e.isShowingPasswordConfirm,"onUpdate:modelValue":t[6]||(t[6]=function(t){e.theUser.password=t,e.isPasswordModified=!0}),uicontrol:"password",name:"user_password",autocomplete:"new-password",title:e.translate("General_Password")},null,8,["model-value","disabled","title"]))]),Object(o["createElementVNode"])("div",null,["superuser"===e.currentUserRole||e.isAdd?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,modelValue:e.theUser.email,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.theUser.email=t}),disabled:e.isSavingUserInfo||"superuser"!==e.currentUserRole&&!e.isAdd||e.isShowingPasswordConfirm,uicontrol:"text",name:"user_email",autocomplete:"off",maxlength:100,title:e.translate("UsersManager_Email")},null,8,["modelValue","disabled","title"])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",null,[e.isAdd?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,modelValue:e.firstSiteAccess,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.firstSiteAccess=t}),disabled:e.isSavingUserInfo,uicontrol:"site",name:"user_site","ui-control-attributes":{onlySitesWithAdminAccess:!0},title:e.translate("UsersManager_FirstWebsitePermission"),"inline-help":e.translate("UsersManager_FirstSiteInlineHelp")},null,8,["modelValue","disabled","title","inline-help"])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",Ze,[Object(o["createElementVNode"])("div",et,["superuser"===e.currentUserRole||e.isAdd?(Object(o["openBlock"])(),Object(o["createBlock"])(l,{key:0,value:e.saveButtonLabel,disabled:e.isAdd&&(!e.firstSiteAccess||!e.firstSiteAccess.id),saving:e.isSavingUserInfo,onConfirm:e.saveUserInfo},null,8,["value","disabled","saving","onConfirm"])):Object(o["createCommentVNode"])("",!0)])]),e.user&&e.isPending?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",tt,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_InvitationSent"))+" ",1),Object(o["createElementVNode"])("span",{class:"resend-link",onClick:t[9]||(t[9]=function(){return e.resendRequestedUser&&e.resendRequestedUser.apply(e,arguments)}),innerHTML:e.$sanitize(e.translate("UsersManager_ResendInvite")+"/"+e.translate("UsersManager_CopyLink"))},null,8,nt)])):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(c,{modelValue:e.showPasswordConfirmationForInviteUser,"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.showPasswordConfirmationForInviteUser=t}),onConfirmed:e.inviteUser},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])]),e.isAdd?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",st,[Object(o["createElementVNode"])("a",{href:"",class:"entityCancelLink",onClick:t[11]||(t[11]=Object(o["withModifiers"])((function(t){return e.onDoneEditing()}),["prevent"]))},[rt,Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_BackToUser")),1)])])):Object(o["createCommentVNode"])("",!0)])):Object(o["createCommentVNode"])("",!0),e.isAdd?Object(o["createCommentVNode"])("",!0):Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ot,[e.theUser.superuser_access?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",it,[Object(o["createVNode"])(d,{"user-login":e.theUser.login,onUserHasAccessDetected:t[12]||(t[12]=function(t){return e.userHasAccess=t.hasAccess}),onAccessChanged:t[13]||(t[13]=function(t){return e.isUserModified=!0}),"access-levels":e.accessLevels,"filter-access-levels":e.filterAccessLevels},null,8,["user-login","access-levels","filter-access-levels"])])),e.theUser.superuser_access?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",at,Object(o["toDisplayString"])(e.translate("UsersManager_SuperUsersPermissionsNotice")),1)):Object(o["createCommentVNode"])("",!0)],512)),[[o["vShow"],"permissions"===e.activeTab]]),"superuser"!==e.activeTab||"superuser"!==e.currentUserRole||e.isAdd?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",lt,[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_SuperUserIntro1")),1),Object(o["createElementVNode"])("p",null,[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("UsersManager_SuperUserIntro2")),1)]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{modelValue:e.superUserAccessChecked,"onUpdate:modelValue":t[14]||(t[14]=function(t){return e.superUserAccessChecked=t}),onClick:t[15]||(t[15]=function(t){return e.confirmSuperUserChange()}),disabled:e.isSavingUserInfo,uicontrol:"checkbox",name:"superuser_access",title:e.translate("UsersManager_HasSuperUserAccess")},null,8,["modelValue","disabled","title"])]),Object(o["createVNode"])(c,{modelValue:e.showPasswordConfirmationForSuperUser,"onUpdate:modelValue":t[16]||(t[16]=function(t){return e.showPasswordConfirmationForSuperUser=t}),onConfirmed:e.toggleSuperuserAccess,onAborted:t[17]||(t[17]=function(t){return e.setSuperUserAccessChecked()})},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("UsersManager_AreYouSure")),1),e.theUser.superuser_access?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",ct,Object(o["toDisplayString"])(e.translate("UsersManager_RemoveSuperuserAccessConfirm")),1)):Object(o["createCommentVNode"])("",!0),e.theUser.superuser_access?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",dt,Object(o["toDisplayString"])(e.translate("UsersManager_AddSuperuserAccessConfirm")),1))]})),_:1},8,["modelValue","onConfirmed"])])),"superuser"!==e.currentUserRole||e.isAdd?Object(o["createCommentVNode"])("",!0):Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ut,[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ResetTwoFactorAuthenticationInfo")),1),Object(o["createElementVNode"])("div",mt,[Object(o["createVNode"])(l,{saving:e.isResetting2FA,onConfirm:t[18]||(t[18]=function(t){return e.confirmReset2FA()}),value:e.translate("UsersManager_ResetTwoFactorAuthentication")},null,8,["saving","value"])]),Object(o["createVNode"])(c,{modelValue:e.showPasswordConfirmationFor2FA,"onUpdate:modelValue":t[19]||(t[19]=function(t){return e.showPasswordConfirmationFor2FA=t}),onConfirmed:e.reset2FA},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("UsersManager_AreYouSure")),1),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])],512)),[[o["vShow"],"2fa"===e.activeTab]])])],512),[[m]]),Object(o["createVNode"])(c,{modelValue:e.isShowingPasswordConfirm,"onUpdate:modelValue":t[20]||(t[20]=function(t){return e.isShowingPasswordConfirm=t}),onConfirmed:e.updateUser},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("h2",{innerHTML:e.$sanitize(e.changePasswordTitle)},null,8,bt),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])]})),_:1},8,["class","content-title"])}var gt={login:"",superuser_access:!1,uses_2fa:!1,password:"",email:"",invite_status:""},ft=Object(o["defineComponent"])({props:{user:Object,currentUserRole:{type:String,required:!0},accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0},initialSiteId:{type:[String,Number],required:!0},initialSiteName:{type:String,required:!0},inviteTokenExpiryDays:{type:String,required:!0}},components:{ContentBlock:g["ContentBlock"],Field:f["Field"],SaveButton:f["SaveButton"],UserPermissionsEdit:Fe,PasswordConfirmation:f["PasswordConfirmation"]},directives:{Form:f["Form"]},data:function(){return{theUser:this.user||Object.assign({},gt),activeTab:"basic",permissionsForIdSite:1,isSavingUserInfo:!1,userHasAccess:!0,firstSiteAccess:{id:this.initialSiteId,name:this.initialSiteName},isUserModified:!1,isPasswordModified:!1,superUserAccessChecked:null,showPasswordConfirmationForSuperUser:!1,showPasswordConfirmationFor2FA:!1,showPasswordConfirmationForInviteUser:!1,isResetting2FA:!1,isShowingPasswordConfirm:!1}},emits:["done","updated","resendInvite"],watch:{user:function(e){this.onUserChange(e)}},created:function(){this.onUserChange(this.user)},methods:{onUserChange:function(e){this.theUser=e||Object.assign({},gt),this.theUser.password||this.resetPasswordVar(),this.setSuperUserAccessChecked()},confirmSuperUserChange:function(){this.showPasswordConfirmationForSuperUser=!0},confirmReset2FA:function(){this.showPasswordConfirmationFor2FA=!0},toggleSuperuserAccess:function(e){var t=this;this.isSavingUserInfo=!0,g["AjaxHelper"].post({method:"UsersManager.setSuperUserAccess"},{userLogin:this.theUser.login,hasSuperUserAccess:this.theUser.superuser_access?"0":"1",passwordConfirmation:e}).then((function(){t.theUser.superuser_access=!t.theUser.superuser_access})).catch((function(){})).then((function(){t.isSavingUserInfo=!1,t.setSuperUserAccessChecked()}))},saveUserInfo:function(){this.isAdd?this.showPasswordConfirmationForInviteUser=!0:this.isShowingPasswordConfirm=!0},resendRequestedUser:function(){this.$emit("resendInvite",{user:this.user})},inviteUser:function(e){var t=this;return this.isSavingUserInfo=!0,g["AjaxHelper"].post({method:"UsersManager.inviteUser"},{userLogin:this.theUser.login,email:this.theUser.email,initialIdSite:this.firstSiteAccess?this.firstSiteAccess.id:void 0,passwordConfirmation:e}).catch((function(e){throw t.isSavingUserInfo=!1,e})).then((function(){t.firstSiteAccess=null,t.isSavingUserInfo=!1,t.isUserModified=!0,t.theUser.invite_status="pending",t.resetPasswordVar(),t.showUserCreatedNotification(),t.$emit("updated",{user:Object(o["readonly"])(t.theUser)})}))},resetPasswordVar:function(){this.isAdd||(this.theUser.password="XXXXXXXX")},showUserSavedNotification:function(){g["NotificationsStore"].show({message:Object(g["translate"])("General_YourChangesHaveBeenSaved"),context:"success",type:"toast"})},showUserCreatedNotification:function(){g["NotificationsStore"].show({message:Object(g["translate"])("UsersManager_InviteSuccess"),context:"success",type:"toast"})},reset2FA:function(e){var t=this;return this.isResetting2FA=!0,g["AjaxHelper"].post({method:"TwoFactorAuth.resetTwoFactorAuth",userLogin:this.theUser.login,passwordConfirmation:e}).catch((function(e){throw t.isResetting2FA=!1,e})).then((function(){t.isResetting2FA=!1,t.theUser.uses_2fa=!1,t.activeTab="basic",t.showUserSavedNotification()}))},updateUser:function(e){var t=this;return this.isSavingUserInfo=!0,g["AjaxHelper"].post({method:"UsersManager.updateUser"},{userLogin:this.theUser.login,password:this.isPasswordModified&&this.theUser.password?this.theUser.password:void 0,passwordConfirmation:e,email:this.theUser.email}).then((function(){t.isSavingUserInfo=!1,t.isUserModified=!0,t.isPasswordModified=!1,t.resetPasswordVar(),t.showUserSavedNotification(),t.$emit("updated",{user:Object(o["readonly"])(t.theUser)})})).catch((function(){t.isSavingUserInfo=!1}))},setSuperUserAccessChecked:function(){this.superUserAccessChecked=!!this.theUser.superuser_access},onDoneEditing:function(){this.$emit("done",{isUserModified:this.isUserModified})}},computed:{formTitle:function(){return this.isAdd?Object(g["translate"])("UsersManager_InviteNewUser"):""},saveButtonLabel:function(){return this.isAdd?Object(g["translate"])("UsersManager_InviteUser"):Object(g["translate"])("UsersManager_SaveBasicInfo")},isPending:function(){return!this.user||!("pending"!==this.user.invite_status&&!Number.isInteger(this.user.invite_status))},isAdd:function(){return!this.user},changePasswordTitle:function(){return Object(g["translate"])("UsersManager_AreYouSureChangeDetails","".concat(this.theUser.login,""))}}});ft.render=pt;var ht=ft,Ot={class:"userListFilters row"},jt={class:"col s12 m12 l8"},vt={class:"input-field col s12 m3 l3"},Ct={id:"user-list-bulk-actions",class:"dropdown-content"},yt={class:"dropdown-trigger","data-target":"bulk-set-access"},kt={id:"bulk-set-access",class:"dropdown-content"},Nt=["onClick"],St={key:0},Vt={class:"input-field col s12 m3 l3"},Ut={class:"permissions-for-selector"},Et={class:"input-field col s12 m3 l3"},wt={class:"input-field col s12 m3 l3"},At={key:0,class:"input-field col s12 m12 l4 users-list-pagination-container"},Tt={class:"usersListPagination"},Mt={class:"pointer"},Bt={class:"counter"},_t={class:"pointer"},Dt={key:0,class:"roles-help-notification"},xt=["innerHTML"],Lt={class:"select-cell"},Pt={class:"checkbox-container"},Rt=Object(o["createElementVNode"])("span",null,null,-1),Ft={class:"first"},Ht={class:"role_header"},It={style:{"margin-right":"3.5px"}},qt=Object(o["createElementVNode"])("span",{class:"icon-help"},null,-1),$t=[qt],Gt={key:0},zt=["title"],Wt={key:2},Yt={class:"actions-cell-header"},Xt={key:0,class:"select-all-row"},Jt={colspan:"8"},Kt={key:0},Qt=["innerHTML"],Zt=["innerHTML"],en={key:1},tn=["innerHTML"],nn=["innerHTML"],sn=["id"],rn={class:"select-cell"},on={class:"checkbox-container"},an=["id","onUpdate:modelValue"],ln=Object(o["createElementVNode"])("span",null,null,-1),cn={id:"userLogin"},dn={class:"access-cell"},un={key:0,id:"email"},mn={key:1,id:"twofa"},bn={key:0,class:"icon-ok"},pn={key:1,class:"icon-close"},gn={key:2,id:"last_seen"},fn={id:"status"},hn=["title"],On={class:"center actions-cell"},jn=["onClick"],vn=Object(o["createElementVNode"])("span",{class:"icon-email"},null,-1),Cn=[vn],yn=["onClick"],kn=Object(o["createElementVNode"])("span",{class:"icon-edit"},null,-1),Nn=[kn],Sn=["onClick"],Vn=Object(o["createElementVNode"])("span",{class:"icon-delete"},null,-1),Un=[Vn],En=["innerHTML"],wn=["innerHTML"],An={class:"change-user-role-confirm-modal modal",ref:"changeUserRoleConfirmModal"},Tn={class:"modal-content"},Mn=["innerHTML"],Bn={key:1},_n=["innerHTML"],Dn=["innerHTML"],xn={class:"modal-footer"};function Ln(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("ActivityIndicator"),c=Object(o["resolveComponent"])("Notification"),d=Object(o["resolveComponent"])("ContentBlock"),u=Object(o["resolveComponent"])("PasswordConfirmation"),m=Object(o["resolveDirective"])("dropdown-menu"),b=Object(o["resolveDirective"])("content-table");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["pagedUsersList",{loading:e.isLoadingUsers}])},[Object(o["createElementVNode"])("div",Ot,[Object(o["createElementVNode"])("div",jt,[Object(o["createElementVNode"])("div",vt,[Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["dropdown-trigger btn bulk-actions",{disabled:e.isBulkActionsDisabled}]),href:"","data-target":"user-list-bulk-actions"},[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_BulkActions")),1)],2),[[m]]),Object(o["createElementVNode"])("ul",Ct,[Object(o["createElementVNode"])("li",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("a",yt,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_SetPermission")),1)],512),[[m]]),Object(o["createElementVNode"])("ul",kt,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.bulkActionAccessLevels,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:t.key},[Object(o["createElementVNode"])("a",{href:"",onClick:Object(o["withModifiers"])((function(n){e.userToChange=null,e.roleToChangeTo=t.key,e.showAccessChangeConfirm()}),["prevent"])},Object(o["toDisplayString"])(t.value),9,Nt)])})),128))])]),Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("a",{href:"",onClick:t[0]||(t[0]=Object(o["withModifiers"])((function(t){e.userToChange=null,e.roleToChangeTo="noaccess",e.showAccessChangeConfirm()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_RemovePermissions")),1)]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",St,[Object(o["createElementVNode"])("a",{href:"",onClick:t[1]||(t[1]=Object(o["withModifiers"])((function(t){return e.showDeleteConfirm()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_DeleteUsers")),1)])):Object(o["createCommentVNode"])("",!0)])]),Object(o["createElementVNode"])("div",Vt,[Object(o["createElementVNode"])("div",Ut,[Object(o["createVNode"])(a,{"model-value":e.userTextFilter,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.onUserTextFilterChange(t)}),name:"user-text-filter",uicontrol:"text","full-width":!0,placeholder:e.translate("UsersManager_UserSearch")},null,8,["model-value","placeholder"])])]),Object(o["createElementVNode"])("div",Et,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{"model-value":e.accessLevelFilter,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.accessLevelFilter=t,e.changeSearch({filter_access:e.accessLevelFilter,offset:0})}),name:"access-level-filter",uicontrol:"select",options:e.filterAccessLevels,"full-width":!0,placeholder:e.translate("UsersManager_FilterByAccess")},null,8,["model-value","options","placeholder"])])]),Object(o["createElementVNode"])("div",wt,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{"model-value":e.statusLevelFilter,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.statusLevelFilter=t,e.changeSearch({filter_status:e.statusLevelFilter,offset:0})}),name:"status-level-filter",uicontrol:"select",options:e.filterStatusLevels,"full-width":!0,placeholder:e.translate("UsersManager_FilterByStatus")},null,8,["model-value","options","placeholder"])])])]),e.totalEntries>e.searchParams.limit?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",At,[Object(o["createElementVNode"])("div",Tt,[Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["btn prev",{disabled:e.searchParams.offset<=0}]),onClick:t[5]||(t[5]=Object(o["withModifiers"])((function(t){return e.gotoPreviousPage()}),["prevent"]))},[Object(o["createElementVNode"])("span",Mt,"« "+Object(o["toDisplayString"])(e.translate("General_Previous")),1)],2),Object(o["createElementVNode"])("div",Bt,[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])({visibility:e.isLoadingUsers?"hidden":"visible"})},Object(o["toDisplayString"])(e.translate("General_Pagination",e.paginationLowerBound,e.paginationUpperBound,e.totalEntries)),3),Object(o["createVNode"])(l,{loading:e.isLoadingUsers},null,8,["loading"])]),Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["btn next",{disabled:e.searchParams.offset+e.searchParams.limit>=e.totalEntries}]),onClick:t[6]||(t[6]=Object(o["withModifiers"])((function(t){return e.gotoNextPage()}),["prevent"]))},[Object(o["createElementVNode"])("span",_t,Object(o["toDisplayString"])(e.translate("General_Next"))+" »",1)],2)])])):Object(o["createCommentVNode"])("",!0)]),e.isRoleHelpToggled?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Dt,[Object(o["createVNode"])(c,{context:"info",type:"persistent",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.rolesHelpText)},null,8,xt)]})),_:1})])):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(d,null,{default:Object(o["withCtx"])((function(){return[Object(o["withDirectives"])(Object(o["createElementVNode"])("table",{id:"manageUsersTable",class:Object(o["normalizeClass"])({loading:e.isLoadingUsers})},[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",Lt,[Object(o["createElementVNode"])("span",Pt,[Object(o["createElementVNode"])("label",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"checkbox",id:"paged_users_select_all",checked:"checked","onUpdate:modelValue":t[7]||(t[7]=function(t){return e.isAllCheckboxSelected=t}),onChange:t[8]||(t[8]=function(t){return e.onAllCheckboxChange()})},null,544),[[o["vModelCheckbox"],e.isAllCheckboxSelected]]),Rt])])]),Object(o["createElementVNode"])("th",Ft,Object(o["toDisplayString"])(e.translate("UsersManager_Username")),1),Object(o["createElementVNode"])("th",Ht,[Object(o["createElementVNode"])("span",It,Object(o["toDisplayString"])(e.translate("UsersManager_RoleFor")),1),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["helpIcon",{sticky:e.isRoleHelpToggled}]),onClick:t[9]||(t[9]=Object(o["withModifiers"])((function(t){return e.isRoleHelpToggled=!e.isRoleHelpToggled}),["prevent"]))},$t,2),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{class:"permissions-for-selector","model-value":e.permissionsForSite,"onUpdate:modelValue":t[10]||(t[10]=function(t){e.onPermissionsForUpdate(t)}),uicontrol:"site","ui-control-attributes":{onlySitesWithAdminAccess:"superuser"!==e.currentUserRole}},null,8,["model-value","ui-control-attributes"])])]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",Gt,Object(o["toDisplayString"])(e.translate("UsersManager_Email")),1)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:1,title:e.translate("UsersManager_UsesTwoFactorAuthentication")},Object(o["toDisplayString"])(e.translate("UsersManager_2FA")),9,zt)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",Wt,Object(o["toDisplayString"])(e.translate("UsersManager_LastSeen")),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("UsersManager_Status")),1),Object(o["createElementVNode"])("th",Yt,[Object(o["createElementVNode"])("div",null,Object(o["toDisplayString"])(e.translate("General_Actions")),1)])])]),Object(o["createElementVNode"])("tbody",null,[e.isAllCheckboxSelected&&e.users.length&&e.users.length".concat(e.users.length,""))),style:{"margin-right":"3.5px"}},null,8,Qt),Object(o["createElementVNode"])("a",{class:"toggle-select-all-in-search",href:"#",onClick:t[11]||(t[11]=Object(o["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.translate("UsersManager_ClickToSelectAll","".concat(e.totalEntries,"")))},null,8,Zt)])),e.areAllResultsSelected?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",en,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("UsersManager_AllUsersAreSelected","".concat(e.totalEntries,""))),style:{"margin-right":"3.5px"}},null,8,tn),Object(o["createElementVNode"])("a",{class:"toggle-select-all-in-search",href:"#",onClick:t[12]||(t[12]=Object(o["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.translate("UsersManager_ClickToSelectDisplayedUsers","".concat(e.users.length,"")))},null,8,nn)])):Object(o["createCommentVNode"])("",!0)])])):Object(o["createCommentVNode"])("",!0),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.users,(function(n,s){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{id:"row".concat(s),key:n.login},[Object(o["createElementVNode"])("td",rn,[Object(o["createElementVNode"])("span",on,[Object(o["createElementVNode"])("label",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"checkbox",id:"paged_users_select_row".concat(s),"onUpdate:modelValue":function(t){return e.selectedRows[s]=t},onClick:t[13]||(t[13]=function(t){return e.onRowSelected()})},null,8,an),[[o["vModelCheckbox"],e.selectedRows[s]]]),ln])])]),Object(o["createElementVNode"])("td",cn,Object(o["toDisplayString"])(n.login),1),Object(o["createElementVNode"])("td",dn,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{"model-value":n.role,"onUpdate:modelValue":function(t){e.userToChange=n,e.roleToChangeTo=t,e.showAccessChangeConfirm()},disabled:"superuser"===n.role,uicontrol:"select",options:"anonymous"===n.login?e.anonymousAccessLevels:"noaccess"===n.role?e.onlyRoleAccessLevels:e.accessLevels},null,8,["model-value","onUpdate:modelValue","disabled","options"])])]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",un,Object(o["toDisplayString"])(n.email),1)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",mn,[n.uses_2fa?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",bn)):Object(o["createCommentVNode"])("",!0),n.uses_2fa?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",pn))])):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",gn,Object(o["toDisplayString"])(n.last_seen?"".concat(n.last_seen," ago"):"-"),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("td",fn,[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(Number.isInteger(n.invite_status)?"pending":n.invite_status),title:"expired"===n.invite_status?e.translate("UsersManager_ExpiredInviteAutomaticallyRemoved","3"):""},Object(o["toDisplayString"])(e.getInviteStatus(n.invite_status)),11,hn)]),Object(o["createElementVNode"])("td",On,[("superuser"===e.currentUserRole||"admin"===e.currentUserRole&&n.invited_by===e.currentUserLogin)&&"active"!==n.invite_status?(Object(o["openBlock"])(),Object(o["createElementBlock"])("button",{key:0,class:"resend table-action",title:"Resend/Copy Invite Link",onClick:function(t){e.userToChange=n,e.resendRequestedUser()}},Cn,8,jn)):Object(o["createCommentVNode"])("",!0),"anonymous"!==n.login?(Object(o["openBlock"])(),Object(o["createElementBlock"])("button",{key:1,class:"edituser table-action",title:"Edit",onClick:function(t){return e.$emit("editUser",{user:n})}},Nn,8,yn)):Object(o["createCommentVNode"])("",!0),("superuser"===e.currentUserRole||"admin"===e.currentUserRole&&n.invited_by===e.currentUserLogin)&&"anonymous"!==n.login?(Object(o["openBlock"])(),Object(o["createElementBlock"])("button",{key:2,class:"deleteuser table-action",title:"Delete",onClick:function(t){e.userToChange=n,e.showDeleteConfirm()}},Un,8,Sn)):Object(o["createCommentVNode"])("",!0)])],8,sn)})),128))])],2),[[b]])]})),_:1}),Object(o["createVNode"])(u,{modelValue:e.showPasswordConfirmationForUserRemoval,"onUpdate:modelValue":t[14]||(t[14]=function(t){return e.showPasswordConfirmationForUserRemoval=t}),onConfirmed:e.deleteRequestedUsers,onAborted:t[15]||(t[15]=function(t){e.userToChange=null,e.roleToChangeTo=null})},{default:Object(o["withCtx"])((function(){return[e.userToChange?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",{key:0,innerHTML:e.$sanitize(e.translate("UsersManager_DeleteUserConfirmSingle","".concat(e.userToChange.login,"")))},null,8,En)):Object(o["createCommentVNode"])("",!0),e.userToChange?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",{key:1,innerHTML:e.$sanitize(e.translate("UsersManager_DeleteUserConfirmMultiple","".concat(e.affectedUsersCount,"")))},null,8,wn)),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"]),Object(o["createElementVNode"])("div",An,[Object(o["createElementVNode"])("div",Tn,[e.userToChange?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h3",{key:0,innerHTML:e.$sanitize(e.deleteUserPermConfirmSingleText)},null,8,Mn)):Object(o["createCommentVNode"])("",!0),e.userToChange&&"anonymous"===e.userToChange.login&&"view"===e.roleToChangeTo?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h3",Bn,[Object(o["createElementVNode"])("em",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_Note"))+": ",1),Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("UsersManager_AnonymousUserRoleChangeWarning","anonymous",e.getRoleDisplay(e.roleToChangeTo)))},null,8,_n)])])):Object(o["createCommentVNode"])("",!0),e.userToChange?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",{key:2,innerHTML:e.$sanitize(e.deleteUserPermConfirmMultipleText)},null,8,Dn))]),Object(o["createElementVNode"])("div",xn,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[16]||(t[16]=Object(o["withModifiers"])((function(t){return e.changeUserRole()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[17]||(t[17]=Object(o["withModifiers"])((function(t){e.userToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512)],2)}var Pn=window,Rn=Pn.$,Fn=Object(o["defineComponent"])({props:{initialSiteId:{type:[String,Number],required:!0},initialSiteName:{type:String,required:!0},currentUserRole:String,isLoadingUsers:Boolean,accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0},filterStatusLevels:{type:Array,required:!0},totalEntries:Number,users:{type:Array,required:!0},searchParams:{type:Object,required:!0}},components:{Field:f["Field"],ActivityIndicator:g["ActivityIndicator"],Notification:g["Notification"],ContentBlock:g["ContentBlock"],PasswordConfirmation:f["PasswordConfirmation"]},directives:{DropdownMenu:g["DropdownMenu"],ContentTable:g["ContentTable"]},data:function(){return{areAllResultsSelected:!1,selectedRows:{},isAllCheckboxSelected:!1,isBulkActionsDisabled:!0,userToChange:null,roleToChangeTo:null,accessLevelFilter:null,statusLevelFilter:null,isRoleHelpToggled:!1,userTextFilter:"",permissionsForSite:{id:this.initialSiteId,name:this.initialSiteName},showPasswordConfirmationForUserRemoval:!1}},emits:["editUser","changeUserRole","deleteUser","searchChange","resendInvite"],created:function(){this.onUserTextFilterChange=Object(g["debounce"])(this.onUserTextFilterChange,300)},watch:{users:function(){this.clearSelection()}},methods:{getInviteStatus:function(e){return Number.isInteger(e)?Object(g["translate"])("UsersManager_InviteDayLeft",e):"expired"===e?Object(g["translate"])("UsersManager_Expired"):Object(g["translate"])("UsersManager_Active")},onPermissionsForUpdate:function(e){this.permissionsForSite=e,this.changeSearch({idSite:this.permissionsForSite.id})},clearSelection:function(){this.selectedRows={},this.areAllResultsSelected=!1,this.isBulkActionsDisabled=!0,this.isAllCheckboxSelected=!1,this.userToChange=null},onAllCheckboxChange:function(){if(this.isAllCheckboxSelected){for(var e=0;e!==this.users.length;e+=1)this.selectedRows[e]=!0;this.isBulkActionsDisabled=!1}else this.clearSelection()},changeUserRole:function(){this.$emit("changeUserRole",{users:this.userOperationSubject,role:this.roleToChangeTo})},onRowSelected:function(){var e=this.selectedCount;this.isBulkActionsDisabled=0===e,this.isAllCheckboxSelected=e===this.users.length},deleteRequestedUsers:function(e){this.$emit("deleteUser",{users:this.userOperationSubject,password:e})},resendRequestedUser:function(){this.$emit("resendInvite",{user:this.userToChange})},showDeleteConfirm:function(){this.showPasswordConfirmationForUserRemoval=!0},showAccessChangeConfirm:function(){Rn(this.$refs.changeUserRoleConfirmModal).modal({dismissible:!1}).modal("open")},getRoleDisplay:function(e){var t=null;return this.accessLevels.forEach((function(n){n.key===e&&(t=n.value)})),t},changeSearch:function(e){var t=Object.assign(Object.assign({},this.searchParams),e);this.$emit("searchChange",{params:t})},gotoPreviousPage:function(){this.changeSearch({offset:Math.max(0,this.searchParams.offset-this.searchParams.limit)})},gotoNextPage:function(){var e=this.searchParams.offset+this.searchParams.limit;e>=this.totalEntries||this.changeSearch({offset:e})},onUserTextFilterChange:function(e){this.userTextFilter=e,this.changeSearch({filter_search:e,offset:0})}},computed:{currentUserLogin:function(){return g["Matomo"].userLogin},paginationLowerBound:function(){return this.searchParams.offset+1},paginationUpperBound:function(){if(null===this.totalEntries)return"?";var e=this.searchParams;return Math.min(e.offset+e.limit,this.totalEntries)},userOperationSubject:function(){return this.userToChange?[this.userToChange]:this.areAllResultsSelected?"all":this.selectedUsers},selectedUsers:function(){var e=this,t=this.users,n=[];return Object.keys(this.selectedRows).forEach((function(s){var r=parseInt(s,10);e.selectedRows[s]&&t[r]&&n.push(t[r])})),n},rolesHelpText:function(){var e="https://matomo.org/faq/general/faq_70/",t="https://matomo.org/faq/general/faq_69/";return Object(g["translate"])("UsersManager_RolesHelp",''),"",''),"")},affectedUsersCount:function(){return this.areAllResultsSelected?this.totalEntries||0:this.selectedCount},selectedCount:function(){var e=this,t=0;return Object.keys(this.selectedRows).forEach((function(n){e.selectedRows[n]&&(t+=1)})),t},deleteUserPermConfirmSingleText:function(){var e,t;return Object(g["translate"])("UsersManager_DeleteUserPermConfirmSingle","".concat((null===(e=this.userToChange)||void 0===e?void 0:e.login)||"",""),"".concat(this.getRoleDisplay(this.roleToChangeTo),""),"".concat(g["Matomo"].helper.htmlEntities((null===(t=this.permissionsForSite)||void 0===t?void 0:t.name)||""),""))},deleteUserPermConfirmMultipleText:function(){var e;return Object(g["translate"])("UsersManager_DeleteUserPermConfirmMultiple","".concat(this.affectedUsersCount,""),"".concat(this.getRoleDisplay(this.roleToChangeTo),""),"".concat(g["Matomo"].helper.htmlEntities((null===(e=this.permissionsForSite)||void 0===e?void 0:e.name)||""),""))},bulkActionAccessLevels:function(){return this.accessLevels.filter((function(e){return"noaccess"!==e.key&&"superuser"!==e.key}))},anonymousAccessLevels:function(){return this.accessLevels.filter((function(e){return"noaccess"===e.key||"view"===e.key}))},onlyRoleAccessLevels:function(){return this.accessLevels.filter((function(e){return"role"===e.type}))}}});Fn.render=Ln;var Hn=Fn,In={class:"usersManager"},qn={key:0},$n={key:1},Gn={class:"row add-user-container"},zn={class:"col s12"},Wn={class:"input-field",style:{"margin-right":"3.5px"}},Yn={key:0,class:"input-field"},Xn={key:0},Jn={class:"resend-invite-confirm-modal modal",ref:"resendInviteConfirmModal"},Kn=Object(o["createElementVNode"])("div",{class:"btn-close modal-close"},[Object(o["createElementVNode"])("i",{class:"icon-close"})],-1),Qn={class:"modal-content"},Zn={class:"modal-title"},es=["innerHTML"],ts={class:"modal-footer"},ns={key:0,class:"success-copied"},ss=Object(o["createElementVNode"])("i",{class:"icon-success"},null,-1),rs={class:"add-existing-user-modal modal",ref:"addExistingUserModal"},os={class:"modal-content"},is={class:"modal-footer"};function as(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("EnrichedHeadline"),l=Object(o["resolveComponent"])("PagedUsersList"),c=Object(o["resolveComponent"])("UserEditForm"),d=Object(o["resolveComponent"])("Field"),u=Object(o["resolveComponent"])("PasswordConfirmation"),m=Object(o["resolveDirective"])("content-intro"),b=Object(o["resolveDirective"])("tooltips");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",In,[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("h2",null,[Object(o["createVNode"])(a,{"help-url":"https://matomo.org/docs/manage-users/","feature-name":"Users Management"},{default:Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_ManageUsers")),1)]})),_:1})]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",qn,Object(o["toDisplayString"])(e.translate("UsersManager_ManageUsersDesc")),1)):Object(o["createCommentVNode"])("",!0),"admin"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",$n,Object(o["toDisplayString"])(e.translate("UsersManager_ManageUsersAdminDesc")),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Gn,[Object(o["createElementVNode"])("div",zn,[Object(o["createElementVNode"])("div",Wn,[Object(o["createElementVNode"])("a",{class:"btn add-new-user",onClick:t[0]||(t[0]=function(t){return e.onAddNewUser()})},Object(o["toDisplayString"])(e.translate("UsersManager_InviteNewUser")),1)]),"superuser"!==e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Yn,[Object(o["createElementVNode"])("a",{class:"btn add-existing-user",onClick:t[1]||(t[1]=function(t){return e.showAddExistingUserModal()})},Object(o["toDisplayString"])(e.translate("UsersManager_AddExistingUser")),1)])):Object(o["createCommentVNode"])("",!0)])]),Object(o["createVNode"])(l,{onEditUser:t[2]||(t[2]=function(t){return e.onEditUser(t.user)}),onChangeUserRole:t[3]||(t[3]=function(t){return e.onChangeUserRole(t.users,t.role)}),onDeleteUser:t[4]||(t[4]=function(t){return e.onDeleteUser(t.users,t.password)}),onSearchChange:t[5]||(t[5]=function(t){e.searchParams=t.params,e.fetchUsers()}),onResendInvite:t[6]||(t[6]=function(t){return e.showResendPopup(t.user)}),"initial-site-id":e.initialSiteId,"initial-site-name":e.initialSiteName,"is-loading-users":e.isLoadingUsers,"current-user-role":e.currentUserRole,"access-levels":e.accessLevels,"filter-access-levels":e.filterAccessLevels,"filter-status-levels":e.filterStatusLevels,"search-params":e.searchParams,users:e.users,"total-entries":e.totalEntries},null,8,["initial-site-id","initial-site-name","is-loading-users","current-user-role","access-levels","filter-access-levels","filter-status-levels","search-params","users","total-entries"])],512),[[m]])],512),[[o["vShow"],!e.isEditing]]),e.isEditing?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Xn,[Object(o["createVNode"])(c,{onDone:t[7]||(t[7]=function(t){return e.onDoneEditing(t.isUserModified)}),user:e.userBeingEdited,"current-user-role":e.currentUserRole,"invite-token-expiry-days":e.inviteTokenExpiryDays,"access-levels":e.accessLevels,"filter-access-levels":e.filterAccessLevels,"initial-site-id":e.initialSiteId,"initial-site-name":e.initialSiteName,onResendInvite:t[8]||(t[8]=function(t){return e.showResendPopup(t.user)}),onUpdated:t[9]||(t[9]=function(t){return e.userBeingEdited=t.user})},null,8,["user","current-user-role","invite-token-expiry-days","access-levels","filter-access-levels","initial-site-id","initial-site-name"])])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Jn,[Kn,Object(o["createElementVNode"])("div",Qn,[Object(o["createElementVNode"])("h2",Zn,Object(o["toDisplayString"])(e.translate("UsersManager_ResendInvite")),1),e.userBeingEdited?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",{key:0,innerHTML:e.$sanitize(e.translate("UsersManager_InviteConfirmMessage",["".concat(e.userBeingEdited.login,""),"".concat(e.userBeingEdited.email,"")]))},null,8,es)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("p",null,[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("UsersManager_InviteActionNotes",e.inviteTokenExpiryDays)),1)])]),Object(o["createElementVNode"])("div",ts,[e.copied?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",ns,[ss,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_LinkCopied")),1)])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("button",{onClick:t[10]||(t[10]=function(t){return e.showInviteActionPasswordConfirm("copy")}),class:"btn btn-copy-link modal-action",style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("UsersManager_CopyLink")),1),Object(o["createElementVNode"])("button",{class:"btn btn-resend modal-action modal-no",onClick:t[11]||(t[11]=function(t){return e.showInviteActionPasswordConfirm("send")})},Object(o["toDisplayString"])(e.translate("UsersManager_ResendInvite")),1)])],512),Object(o["createElementVNode"])("div",rs,[Object(o["createElementVNode"])("div",os,[Object(o["createElementVNode"])("h3",null,Object(o["toDisplayString"])(e.translate("UsersManager_AddExistingUser")),1),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_EnterUsernameOrEmail"))+":",1),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(d,{modelValue:e.addNewUserLoginEmail,"onUpdate:modelValue":t[12]||(t[12]=function(t){return e.addNewUserLoginEmail=t}),name:"add-existing-user-email",uicontrol:"text"},null,8,["modelValue"])])]),Object(o["createElementVNode"])("div",is,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[13]||(t[13]=Object(o["withModifiers"])((function(t){return e.addExistingUser()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Add")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[14]||(t[14]=Object(o["withModifiers"])((function(t){return e.addNewUserLoginEmail=null}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_Cancel")),1)])],512),Object(o["createVNode"])(u,{modelValue:e.showPasswordConfirmationForInviteAction,"onUpdate:modelValue":t[15]||(t[15]=function(t){return e.showPasswordConfirmationForInviteAction=t}),onConfirmed:e.onInviteAction},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])],512)),[[b]])}var ls=20,cs=window,ds=cs.$,us=Object(o["defineComponent"])({props:{currentUserRole:{type:String,required:!0},initialSiteName:{type:String,required:!0},initialSiteId:{type:String,required:!0},accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0},filterStatusLevels:{type:Array,required:!0},inviteTokenExpiryDays:{type:String,required:!0}},components:{PasswordConfirmation:f["PasswordConfirmation"],EnrichedHeadline:g["EnrichedHeadline"],PagedUsersList:Hn,UserEditForm:ht,Field:f["Field"]},directives:{ContentIntro:g["ContentIntro"],Tooltips:g["Tooltips"]},data:function(){return{isEditing:!!g["MatomoUrl"].urlParsed.value.showadduser,isCurrentUserSuperUser:!0,users:[],totalEntries:null,searchParams:{offset:0,limit:ls,filter_search:"",filter_access:"",filter_status:"",idSite:this.initialSiteId},isLoadingUsers:!1,userBeingEdited:null,addNewUserLoginEmail:"",copied:!1,loading:!1,showPasswordConfirmationForInviteAction:!1,inviteAction:""}},created:function(){this.fetchUsers()},watch:{limit:function(){this.fetchUsers()}},methods:{showInviteActionPasswordConfirm:function(e){this.loading||(this.showPasswordConfirmationForInviteAction=!0,this.inviteAction=e)},showResendPopup:function(e){this.userBeingEdited=e,ds(this.$refs.resendInviteConfirmModal).modal({dismissible:!1}).modal("open"),this.copied=!1},onInviteAction:function(e){"send"===this.inviteAction?this.onResendInvite(e):this.generateInviteLink(e)},onEditUser:function(e){g["Matomo"].helper.lazyScrollToContent(),this.isEditing=!0,this.userBeingEdited=e},onDoneEditing:function(e){this.isEditing=!1,e&&this.fetchUsers()},showAddExistingUserModal:function(){ds(this.$refs.addExistingUserModal).modal({dismissible:!1}).modal("open")},onChangeUserRole:function(e,t){var n=this;this.isLoadingUsers=!0,Promise.resolve().then((function(){return"all"===e?n.getAllUsersInSearch():e})).then((function(e){return e.filter((function(e){return"superuser"!==e.role})).map((function(e){return e.login}))})).then((function(e){var s,r=n.accessLevels.filter((function(e){return e.key===t})).map((function(e){return e.type}));return s=r.length&&"capability"===r[0]?e.map((function(e){return{method:"UsersManager.addCapabilities",userLogin:e,capabilities:t,idSites:n.searchParams.idSite}})):e.map((function(e){return{method:"UsersManager.setUserAccess",userLogin:e,access:t,idSites:n.searchParams.idSite}})),g["AjaxHelper"].fetch(s,{createErrorNotification:!0})})).catch((function(){})).then((function(){return n.fetchUsers()}))},getAllUsersInSearch:function(){return g["AjaxHelper"].fetch({method:"UsersManager.getUsersPlusRole",filter_search:this.searchParams.filter_search,filter_access:this.searchParams.filter_access,filter_status:this.searchParams.filter_status,idSite:this.searchParams.idSite,filter_limit:"-1"})},onDeleteUser:function(e,t){var n=this;this.isLoadingUsers=!0,Promise.resolve().then((function(){return"all"===e?n.getAllUsersInSearch():e})).then((function(e){return e.map((function(e){return e.login}))})).then((function(e){var n=e.map((function(e){return{method:"UsersManager.deleteUser",userLogin:e,passwordConfirmation:t}}));return g["AjaxHelper"].fetch(n,{createErrorNotification:!0})})).then((function(){g["NotificationsStore"].scrollToNotification(g["NotificationsStore"].show({id:"removeUserSuccess",message:Object(g["translate"])("UsersManager_DeleteSuccess"),context:"success",type:"toast"})),n.fetchUsers()}),(function(){"all"!==e&&e.length>1&&g["NotificationsStore"].show({id:"removeUserSuccess",message:Object(g["translate"])("UsersManager_DeleteNotSuccessful"),context:"warning",type:"toast"}),n.fetchUsers()}))},generateInviteLink:async function(e){if(!this.loading){this.loading=!0;try{var t=await g["AjaxHelper"].fetch({method:"UsersManager.generateInviteLink",userLogin:this.userBeingEdited.login,passwordConfirmation:e});await this.copyToClipboard(t.value)}catch(n){}this.loading=!1}},copyToClipboard:async function(e){try{var t=document.createElement("input");t.style.top="-100px",t.style.left="0",t.style.position="fixed",t.value=e,document.body.appendChild(t),t.select(),"https:"!==window.location.protocol?document.execCommand("copy"):await navigator.clipboard.writeText(t.value),document.body.removeChild(t),this.copied=!0}catch(s){var n=g["NotificationsStore"].show({message:"".concat(Object(g["translate"])("UsersManager_CopyDenied"),"
\n").concat(Object(g["translate"])("UsersManager_CopyDeniedHints",['
'.concat(e,"")])),id:"copyError",context:"error",type:"transient"});g["NotificationsStore"].scrollToNotification(n)}},onResendInvite:function(e){var t=this;""!==e&&g["AjaxHelper"].fetch({method:"UsersManager.resendInvite",userLogin:this.userBeingEdited.login,passwordConfirmation:e}).then((function(){t.fetchUsers(),ds(t.$refs.resendInviteConfirmModal).modal("close");var e=g["NotificationsStore"].show({message:Object(g["translate"])("UsersManager_InviteSuccess"),id:"resendInvite",context:"success",type:"transient"});g["NotificationsStore"].scrollToNotification(e)}))},fetchUsers:function(){var e=this;return this.isLoadingUsers=!0,g["AjaxHelper"].fetch(Object.assign(Object.assign({},this.searchParams),{},{method:"UsersManager.getUsersPlusRole"}),{returnResponseObject:!0}).then((function(t){var n=t.getRequestHandle();e.totalEntries=parseInt(n.getResponseHeader("x-matomo-total-results")||"0",10),e.users=n.responseJSON,e.isLoadingUsers=!1})).catch((function(){e.isLoadingUsers=!1}))},addExistingUser:function(){var e=this;return this.isLoadingUsers=!0,g["AjaxHelper"].fetch({method:"UsersManager.userExists",userLogin:this.addNewUserLoginEmail}).then((function(t){return t&&t.value?e.addNewUserLoginEmail:g["AjaxHelper"].fetch({method:"UsersManager.getUserLoginFromUserEmail",userEmail:e.addNewUserLoginEmail}).then((function(e){return e.value}))})).then((function(t){return g["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:t,access:"view",idSites:e.searchParams.idSite})})).then((function(){return e.fetchUsers()})).catch((function(){e.isLoadingUsers=!1}))},onAddNewUser:function(){var e={isAllowed:!0};g["Matomo"].postEvent("UsersManager.initAddUser",e),e&&!e.isAllowed||(this.isEditing=!0,this.userBeingEdited=null)}}});us.render=as;var ms=us,bs={key:0,class:"alert alert-info"},ps={key:1};function gs(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("SaveButton"),c=Object(o["resolveComponent"])("ContentBlock"),d=Object(o["resolveDirective"])("form");return Object(o["openBlock"])(),Object(o["createBlock"])(c,{"content-title":e.title},{default:Object(o["withCtx"])((function(){return[0===e.anonymousSites.length?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",bs,Object(o["toDisplayString"])(e.translate("UsersManager_NoteNoAnonymousUserAccessSettingsWontBeUsed2")),1)):Object(o["createCommentVNode"])("",!0),e.anonymousSites.length>0?Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ps,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"radio",name:"anonymousDefaultReport",modelValue:e.defaultReport,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.defaultReport=t}),introduction:e.translate("UsersManager_WhenUsersAreNotLoggedInAndVisitPiwikTheyShouldAccess"),options:e.defaultReportOptions},null,8,["modelValue","introduction","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"select",name:"anonymousDefaultReportWebsite",modelValue:e.defaultReportWebsite,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.defaultReportWebsite=t}),options:e.anonymousSites},null,8,["modelValue","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"radio",name:"anonymousDefaultDate",modelValue:e.defaultDate,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.defaultDate=t}),introduction:e.translate("UsersManager_ForAnonymousUsersReportDateToLoadByDefault"),options:e.availableDefaultDates},null,8,["modelValue","introduction","options"])]),Object(o["createVNode"])(l,{saving:e.loading,onConfirm:t[3]||(t[3]=function(t){return e.save()})},null,8,["saving"])],512)),[[d]]):Object(o["createCommentVNode"])("",!0)]})),_:1},8,["content-title"])}var fs=Object(o["defineComponent"])({props:{title:{type:String,required:!0},anonymousSites:{type:Array,required:!0},anonymousDefaultReport:{type:[String,Number],required:!0},anonymousDefaultSite:{type:String,required:!0},anonymousDefaultDate:{type:String,required:!0},availableDefaultDates:{type:Object,required:!0},defaultReportOptions:{type:Object,required:!0}},components:{ContentBlock:g["ContentBlock"],SaveButton:f["SaveButton"],Field:f["Field"]},directives:{Form:f["Form"]},data:function(){return{loading:!1,defaultReport:"".concat(this.anonymousDefaultReport),defaultReportWebsite:this.anonymousDefaultSite,defaultDate:this.anonymousDefaultDate}},methods:{save:function(){var e=this,t={anonymousDefaultReport:"1"===this.defaultReport?this.defaultReportWebsite:this.defaultReport,anonymousDefaultDate:this.defaultDate};this.loading=!0,g["AjaxHelper"].post({module:"UsersManager",action:"recordAnonymousUserSettings",format:"json"},t,{withTokenInUrl:!0}).then((function(){var e=g["NotificationsStore"].show({message:Object(g["translate"])("CoreAdminHome_SettingsSaveSuccess"),id:"anonymousUserSettings",context:"success",type:"transient"});g["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.loading=!1}))}}});fs.render=gs;var hs=fs,Os={id:"newsletterSignup"};function js(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("SaveButton"),c=Object(o["resolveComponent"])("ContentBlock");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Os,[Object(o["createVNode"])(c,{"content-title":e.translate("UsersManager_NewsletterSignupTitle")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"checkbox",name:"newsletterSignupCheckbox",id:"newsletterSignupCheckbox",modelValue:e.newsletterSignupCheckbox,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.newsletterSignupCheckbox=t}),"full-width":!0,title:e.signupTitleText},null,8,["modelValue","title"])]),Object(o["createVNode"])(l,{id:"newsletterSignupBtn",onConfirm:t[1]||(t[1]=function(t){return e.signupForNewsletter()}),disabled:!e.newsletterSignupCheckbox,value:e.newsletterSignupButtonTitle,saving:e.isProcessingNewsletterSignup},null,8,["disabled","value","saving"])]})),_:1},8,["content-title"])],512)),[[o["vShow"],e.showNewsletterSignup]])}var vs=Object(o["defineComponent"])({data:function(){return{showNewsletterSignup:!0,newsletterSignupCheckbox:!1,isProcessingNewsletterSignup:!1,newsletterSignupButtonTitle:Object(g["translate"])("General_Save")}},components:{ContentBlock:g["ContentBlock"],SaveButton:f["SaveButton"],Field:f["Field"]},computed:{signupTitleText:function(){return Object(g["translate"])("UsersManager_NewsletterSignupMessage",'',"")}},methods:{signupForNewsletter:function(){var e=this;this.newsletterSignupButtonTitle=Object(g["translate"])("General_Loading"),this.isProcessingNewsletterSignup=!0,g["AjaxHelper"].fetch({module:"API",method:"UsersManager.newsletterSignup"},{withTokenInUrl:!0}).then((function(){e.isProcessingNewsletterSignup=!1,e.showNewsletterSignup=!1;var t=g["NotificationsStore"].show({message:Object(g["translate"])("UsersManager_NewsletterSignupSuccessMessage"),id:"newslettersignup",context:"success",type:"transient"});g["NotificationsStore"].scrollToNotification(t)})).catch((function(){e.isProcessingNewsletterSignup=!1;var t=g["NotificationsStore"].show({message:Object(g["translate"])("UsersManager_NewsletterSignupFailureMessage"),id:"newslettersignup",context:"error",type:"transient"});g["NotificationsStore"].scrollToNotification(t),e.newsletterSignupButtonTitle=Object(g["translate"])("General_PleaseTryAgain")}))}}});vs.render=js;var Cs=vs,ys={id:"userSettingsTable"},ks={key:0},Ns={id:"languageHelp",class:"inline-help-node"},Ss={target:"_blank",rel:"noreferrer noopener",href:"https://matomo.org/translations/"},Vs={class:"sites_autocomplete"};function Us(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("SiteSelector"),c=Object(o["resolveComponent"])("SaveButton"),d=Object(o["resolveComponent"])("PasswordConfirmation"),u=Object(o["resolveComponent"])("ContentBlock"),m=Object(o["resolveDirective"])("form");return Object(o["openBlock"])(),Object(o["createBlock"])(u,{"content-title":e.title,feature:"true"},{default:Object(o["withCtx"])((function(){return[Object(o["withDirectives"])(Object(o["createElementVNode"])("form",ys,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"text",name:"username",title:e.translate("General_Username"),disabled:!0,modelValue:e.username,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.username=t}),"inline-help":e.translate("UsersManager_YourUsernameCannotBeChanged")},null,8,["title","modelValue","inline-help"])]),e.isUsersAdminEnabled?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ks,[Object(o["createVNode"])(a,{uicontrol:"text",name:"email","model-value":e.email,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.email=t,e.doesRequirePasswordConfirmation=!0}),maxlength:100,title:e.translate("UsersManager_Email")},null,8,["model-value","title"])])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Ns,[Object(o["createElementVNode"])("a",Ss,Object(o["toDisplayString"])(e.translate("LanguagesManager_AboutPiwikTranslations")),1)]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"select",name:"language",modelValue:e.language,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.language=t}),title:e.translate("General_Language"),options:e.languageOptions,"inline-help":"#languageHelp"},null,8,["modelValue","title","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"select",name:"timeformat",modelValue:e.timeformat,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.timeformat=t}),title:e.translate("General_TimeFormat"),options:e.timeFormats},null,8,["modelValue","title","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"radio",name:"defaultReport",modelValue:e.theDefaultReport,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.theDefaultReport=t}),introduction:e.translate("UsersManager_ReportToLoadByDefault"),title:e.translate("General_AllWebsitesDashboard"),options:e.defaultReportOptions},null,8,["modelValue","introduction","title","options"])]),Object(o["createElementVNode"])("div",Vs,[Object(o["createVNode"])(l,{modelValue:e.site,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.site=t}),"show-selected-site":!0,"switch-site-on-select":!1,"show-all-sites-item":!1,showselectedsite:!0,id:"defaultReportSiteSelector"},null,8,["modelValue"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"radio",name:"defaultDate",modelValue:e.theDefaultDate,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.theDefaultDate=t}),introduction:e.translate("UsersManager_ReportDateToLoadByDefault"),options:e.availableDefaultDates},null,8,["modelValue","introduction","options"])]),Object(o["createVNode"])(c,{onConfirm:t[7]||(t[7]=function(t){return e.save()}),saving:e.loading},null,8,["saving"]),Object(o["createVNode"])(d,{modelValue:e.showPasswordConfirmation,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.showPasswordConfirmation=t}),onConfirmed:e.doSave},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])],512),[[m]])]})),_:1},8,["content-title"])}var Es=Object(o["defineComponent"])({props:{isUsersAdminEnabled:{type:Boolean,required:!0},title:{type:String,required:!0},userLogin:{type:String,required:!0},userEmail:{type:String,required:!0},currentLanguageCode:{type:String,required:!0},languageOptions:{type:Object,required:!0},currentTimeformat:{type:Number,required:!0},timeFormats:{type:Object,required:!0},defaultReport:{type:[String,Number],required:!0},defaultReportOptions:{type:Object,required:!0},defaultReportIdSite:{type:[String,Number],required:!0},defaultReportSiteName:{type:String,required:!0},defaultDate:{type:String,required:!0},availableDefaultDates:{type:Object,required:!0}},components:{ContentBlock:g["ContentBlock"],SaveButton:f["SaveButton"],Field:f["Field"],SiteSelector:g["SiteSelector"],PasswordConfirmation:f["PasswordConfirmation"]},directives:{Form:f["Form"]},data:function(){return{doesRequirePasswordConfirmation:!1,username:this.userLogin,email:this.userEmail,language:this.currentLanguageCode,timeformat:this.currentTimeformat,theDefaultReport:this.defaultReport,site:{id:this.defaultReportIdSite,name:g["Matomo"].helper.htmlDecode(this.defaultReportSiteName)},theDefaultDate:this.defaultDate,loading:!1,showPasswordConfirmation:!1}},methods:{save:function(){this.doesRequirePasswordConfirmation?this.showPasswordConfirmation=!0:this.doSave()},doSave:function(e){var t=this,n={email:this.email,defaultReport:"MultiSites"===this.theDefaultReport?this.theDefaultReport:this.site.id,defaultDate:this.theDefaultDate,language:this.language,timeformat:this.timeformat};e&&(n.passwordConfirmation=e),this.loading=!0,g["AjaxHelper"].post({module:"UsersManager",action:"recordUserSettings",format:"json"},n,{withTokenInUrl:!0}).then((function(){var e=g["NotificationsStore"].show({message:Object(g["translate"])("CoreAdminHome_SettingsSaveSuccess"),id:"PersonalSettingsSuccess",context:"success",type:"transient"});g["NotificationsStore"].scrollToNotification(e),t.doesRequirePasswordConfirmation=!1,t.loading=!1})).catch((function(){t.loading=!1}))}}});Es.render=Us;var ws=Es,As={key:0},Ts={key:1,class:"alert alert-danger"},Ms=["action"],Bs=["value"],_s=["value"],Ds=["innerHTML"];function xs(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("ContentBlock");return Object(o["openBlock"])(),Object(o["createBlock"])(l,{"content-title":e.translate("UsersManager_AuthTokens")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_TokenAuthIntro")),1),e.noDescription?(Object(o["openBlock"])(),Object(o["createElementBlock"])("br",As)):Object(o["createCommentVNode"])("",!0),e.noDescription?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ts,Object(o["toDisplayString"])(e.translate("General_Description"))+": "+Object(o["toDisplayString"])(e.translate("General_ValidatorErrorEmptyValue")),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("form",{action:e.addNewTokenFormUrl,method:"post",class:"addTokenForm"},[Object(o["createVNode"])(a,{uicontrol:"text",name:"description",title:e.translate("General_Description"),maxlength:100,required:!0,"inline-help":e.translate("UsersManager_AuthTokenPurpose"),modelValue:e.tokenDescription,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.tokenDescription=t})},null,8,["title","inline-help","modelValue"]),Object(o["createVNode"])(a,{uicontrol:"checkbox",name:"post_only",title:e.translate("UsersManager_OnlyAllowPostRequests"),required:!1,"inline-help":e.postOnlyHelp,modelValue:e.tokenPostOnly,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.tokenPostOnly=t}),disabled:e.forcePostOnlyCalc},null,8,["title","inline-help","modelValue","disabled"]),Object(o["createElementVNode"])("input",{type:"hidden",value:e.formNonce,name:"nonce"},null,8,Bs),Object(o["createElementVNode"])("input",{type:"submit",value:e.translate("UsersManager_CreateNewToken"),class:"btn",style:{"margin-right":"3.5px"}},null,8,_s),Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.cancelLink)},null,8,Ds)],8,Ms)]})),_:1},8,["content-title"])}var Ls=Object(o["defineComponent"])({props:{formNonce:String,noDescription:Boolean,forcePostOnly:Boolean},components:{ContentBlock:g["ContentBlock"],Field:f["Field"]},data:function(){return{tokenDescription:"",tokenPostOnly:!0}},computed:{addNewTokenFormUrl:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"addNewToken"})))},cancelLink:function(){var e="?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"userSecurity"})));return Object(g["translate"])("General_OrCancel",""),"")},forcePostOnlyCalc:function(){return this.forcePostOnly},postOnlyHelp:function(){return this.forcePostOnly?Object(g["translate"])("UsersManager_AuthTokenPostOnlyHelpForced"):Object(g["translate"])("UsersManager_AuthTokenPostOnlyHelp")}}});Ls.render=xs;var Ps=Ls,Rs=Object(o["createElementVNode"])("br",null,null,-1),Fs={style:{"font-size":"40px"},class:"generatedTokenAuth"},Hs=["href"];function Is(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("ContentBlock"),l=Object(o["resolveDirective"])("copy-to-clipboard");return Object(o["openBlock"])(),Object(o["createBlock"])(a,{"content-title":e.translate("UsersManager_TokenSuccessfullyGenerated")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_PleaseStoreToken"))+" ",1),Rs,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_DoNotStoreToken")),1)]),Object(o["createElementVNode"])("div",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("pre",Fs,[Object(o["createElementVNode"])("code",null,Object(o["toDisplayString"])(e.generatedToken),1)],512),[[l,{}]])]),Object(o["createElementVNode"])("a",{href:e.userSecurityLink,class:"btn",style:{height:"auto"}},Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmTokenCopied"))+" "+Object(o["toDisplayString"])(e.translate("UsersManager_GoBackSecurityPage")),9,Hs)]})),_:1},8,["content-title"])}var qs=Object(o["defineComponent"])({props:{generatedToken:{type:String,required:!0}},components:{ContentBlock:g["ContentBlock"]},directives:{CopyToClipboard:g["CopyToClipboard"]},computed:{userSecurityLink:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"userSecurity"})))}}});qs.render=Is;var $s=qs,Gs=["action"],zs=["value"],Ws={key:0},Ys={class:"alert alert-info"},Xs=["value"],Js={key:1},Ks={class:"alert alert-danger"},Qs=["innerHTML"],Zs={ref:"afterPassword"},er=Object(o["createElementVNode"])("a",{name:"authtokens",id:"authtokens"},null,-1),tr={key:0},nr={class:"listAuthTokens"},sr=["title"],rr={key:0},or=["colspan","innerHTML"],ir={class:"creationDate"},ar=["title"],lr=["action"],cr=["value"],dr=["value"],ur=["title"],mr=Object(o["createElementVNode"])("span",{class:"icon-delete"},null,-1),br=[mr],pr={class:"tableActionBar"},gr=["href"],fr=Object(o["createElementVNode"])("span",{class:"icon-add"},null,-1),hr=["action"],Or=["value"],jr=Object(o["createElementVNode"])("input",{name:"idtokenauth",type:"hidden",value:"all"},null,-1),vr={type:"submit",class:"table-action"},Cr=Object(o["createElementVNode"])("span",{class:"icon-delete"},null,-1);function yr(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("ContentBlock"),c=Object(o["resolveDirective"])("content-table");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[e.isUsersAdminEnabled?(Object(o["openBlock"])(),Object(o["createBlock"])(l,{key:0,"content-title":e.translate("General_ChangePassword"),feature:"true"},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("form",{id:"userSettingsTable",method:"post",action:e.recordPasswordChangeAction},[Object(o["createElementVNode"])("input",{type:"hidden",value:e.changePasswordNonce,name:"nonce"},null,8,zs),e.isValidHost?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ws,[Object(o["createVNode"])(a,{uicontrol:"password",name:"password",autocomplete:!1,modelValue:e.password,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.password=t}),title:e.translate("Login_NewPassword"),"inline-help":e.translate("UsersManager_IfYouWouldLikeToChangeThePasswordTypeANewOne")},null,8,["modelValue","title","inline-help"]),Object(o["createVNode"])(a,{uicontrol:"password",name:"passwordBis",autocomplete:!1,modelValue:e.passwordBis,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.passwordBis=t}),title:e.translate("Login_NewPasswordRepeat"),"inline-help":e.translate("UsersManager_TypeYourPasswordAgain")},null,8,["modelValue","title","inline-help"]),Object(o["createVNode"])(a,{uicontrol:"password",name:"passwordConfirmation",autocomplete:!1,modelValue:e.passwordConfirmation,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.passwordConfirmation=t}),title:e.translate("UsersManager_YourCurrentPassword"),"inline-help":e.translate("UsersManager_TypeYourCurrentPassword")},null,8,["modelValue","title","inline-help"]),Object(o["createElementVNode"])("div",Ys,Object(o["toDisplayString"])(e.translate("UsersManager_PasswordChangeTerminatesOtherSessions")),1),Object(o["createElementVNode"])("input",{type:"submit",value:e.translate("General_Save"),class:"btn"},null,8,Xs)])):Object(o["createCommentVNode"])("",!0),e.isValidHost?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Js,[Object(o["createElementVNode"])("div",Ks,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_InjectedHostCannotChangePwd",e.invalidHost))+" ",1),e.isSuperUser?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.emailYourAdminText)},null,8,Qs))])]))],8,Gs)]})),_:1},8,["content-title"])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Zs,[e.isUsersAdminEnabled&&e.afterPasswordComponent?(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["resolveDynamicComponent"])(e.afterPasswordComponent),{key:0})):Object(o["createCommentVNode"])("",!0)],512),er,Object(o["createVNode"])(l,{"content-title":e.translate("UsersManager_AuthTokens")},{default:Object(o["withCtx"])((function(){var t,n;return[Object(o["createElementVNode"])("p",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_TokenAuthIntro"))+" ",1),e.hasTokensWithExpireDate?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",tr,Object(o["toDisplayString"])(e.translate("UsersManager_ExpiredTokensDeleteAutomatically")),1)):Object(o["createCommentVNode"])("",!0)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("table",nr,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_CreationDate")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Description")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("UsersManager_LastUsed")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("UsersManager_PostOnly")),1),e.hasTokensWithExpireDate?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:0,title:e.translate("UsersManager_TokensWithExpireDateCreationBySystem")},Object(o["toDisplayString"])(e.translate("UsersManager_ExpireDate")),9,sr)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Actions")),1)])]),Object(o["createElementVNode"])("tbody",null,[null!==(t=e.tokens)&&void 0!==t&&t.length?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",rr,[Object(o["createElementVNode"])("td",{colspan:e.hasTokensWithExpireDate?5:4,innerHTML:e.$sanitize(e.noTokenCreatedYetText)},null,8,or)])),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.tokens||[],(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{key:t.idusertokenauth},[Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("span",ir,Object(o["toDisplayString"])(t.date_created),1)]),Object(o["createElementVNode"])("td",null,Object(o["toDisplayString"])(t.description),1),Object(o["createElementVNode"])("td",null,Object(o["toDisplayString"])(t.last_used?t.last_used:e.translate("General_Never")),1),Object(o["createElementVNode"])("td",null,Object(o["toDisplayString"])(1===parseInt(t.post_only,10)?e.translate("General_Yes"):e.translate("General_No")),1),e.hasTokensWithExpireDate?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",{key:0,title:e.translate("UsersManager_TokensWithExpireDateCreationBySystem")},Object(o["toDisplayString"])(t.date_expired?t.date_expired:e.translate("General_Never")),9,ar)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("form",{method:"post",action:e.deleteTokenAction,style:{display:"inline"}},[Object(o["createElementVNode"])("input",{name:"nonce",type:"hidden",value:e.deleteTokenNonce},null,8,cr),Object(o["createElementVNode"])("input",{name:"idtokenauth",type:"hidden",value:t.idusertokenauth},null,8,dr),Object(o["createElementVNode"])("button",{type:"submit",class:"table-action",title:e.translate("General_Delete")},br,8,ur)],8,lr)])])})),128))])],512),[[c]]),Object(o["createElementVNode"])("div",pr,[Object(o["createElementVNode"])("a",{href:e.addNewTokenLink,class:"addNewToken"},[fr,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_CreateNewToken")),1)],8,gr),null!==(n=e.tokens)&&void 0!==n&&n.length?(Object(o["openBlock"])(),Object(o["createElementBlock"])("form",{key:0,method:"post",action:e.deleteTokenAction,style:{display:"inline"}},[Object(o["createElementVNode"])("input",{name:"nonce",type:"hidden",value:e.deleteTokenNonce},null,8,Or),jr,Object(o["createElementVNode"])("button",vr,[Cr,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_DeleteAllTokens")),1)])],8,hr)):Object(o["createCommentVNode"])("",!0)])]})),_:1},8,["content-title"])])}var kr=Object(o["defineComponent"])({props:{deleteTokenNonce:String,tokens:Array,hasTokensWithExpireDate:Boolean,isUsersAdminEnabled:Boolean,changePasswordNonce:String,isValidHost:Boolean,isSuperUser:Boolean,invalidHost:String,afterPasswordEventContent:String,invalidHostMailLinkStart:String},components:{ContentBlock:g["ContentBlock"],Field:f["Field"]},directives:{ContentTable:g["ContentTable"]},data:function(){return{password:"",passwordBis:"",passwordConfirmation:""}},mounted:function(){var e=this.$refs.afterPassword;g["Matomo"].helper.compileVueEntryComponents(e)},computed:{recordPasswordChangeAction:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"recordPasswordChange"})))},emailYourAdminText:function(){return Object(g["translate"])("UsersManager_EmailYourAdministrator",this.invalidHostMailLinkStart||"","")},noTokenCreatedYetText:function(){var e="?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"addNewToken"})));return Object(g["translate"])("UsersManager_NoTokenCreatedYetCreateNow",''),"")},deleteTokenAction:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"deleteToken"})))},addNewTokenLink:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"addNewToken"})))},afterPasswordComponent:function(){if(!this.afterPasswordEventContent)return null;var e=this.$refs.afterPassword;return Object(o["markRaw"])({template:this.afterPasswordEventContent,beforeUnmount:function(){g["Matomo"].helper.destroyVueComponent(e)}})}}});kr.render=yr;var Nr=kr,Sr=["innerHTML"],Vr={style:{"margin-left":"20px"}},Ur=["href"],Er=Object(o["createElementVNode"])("br",null,null,-1);function wr(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("PersonalSettings"),l=Object(o["resolveComponent"])("NewsletterSettings"),c=Object(o["resolveComponent"])("PluginSettings"),d=Object(o["resolveComponent"])("ContentBlock");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[Object(o["createVNode"])(a,{"is-users-admin-enabled":e.isUsersAdminEnabled,title:e.title,"user-login":e.userLogin,"user-email":e.userEmail,"current-language-code":e.currentLanguageCode,"language-options":e.languageOptions,"current-timeformat":e.currentTimeformat,"time-formats":e.timeFormats,"default-report":e.defaultReport,"default-report-options":e.defaultReportOptions,"default-report-id-site":e.defaultReportIdSite,"default-report-site-name":e.defaultReportSiteName,"default-date":e.defaultDate,"available-default-dates":e.availableDefaultDates},null,8,["is-users-admin-enabled","title","user-login","user-email","current-language-code","language-options","current-timeformat","time-formats","default-report","default-report-options","default-report-id-site","default-report-site-name","default-date","available-default-dates"]),e.showNewsletterSignup?(Object(o["openBlock"])(),Object(o["createBlock"])(l,{key:0})):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(c,{mode:"user"}),Object(o["createVNode"])(d,{"content-title":e.translate("UsersManager_ExcludeVisitsViaCookie")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",{innerHTML:e.$sanitize(e.yourVisitsAreText)},null,8,Sr),Object(o["createElementVNode"])("span",Vr,[Object(o["createElementVNode"])("a",{href:e.setIgnoreCookieLink},[Object(o["createTextVNode"])(" › "+Object(o["toDisplayString"])(e.ignoreCookieSet?e.translate("UsersManager_ClickHereToDeleteTheCookie"):e.translate("UsersManager_ClickHereToSetTheCookieOnDomain",e.piwikHost))+" ",1),Er],8,Ur)])]})),_:1},8,["content-title"])])}var Ar=Object(o["defineComponent"])({props:{isUsersAdminEnabled:{type:Boolean,required:!0},title:{type:String,required:!0},userLogin:{type:String,required:!0},userEmail:{type:String,required:!0},currentLanguageCode:{type:String,required:!0},languageOptions:{type:Object,required:!0},currentTimeformat:{type:Number,required:!0},timeFormats:{type:Object,required:!0},defaultReport:{type:[String,Number],required:!0},defaultReportOptions:{type:Object,required:!0},defaultReportIdSite:{type:[String,Number],required:!0},defaultReportSiteName:{type:String,required:!0},defaultDate:{type:String,required:!0},availableDefaultDates:{type:Object,required:!0},showNewsletterSignup:Boolean,ignoreCookieSet:Boolean,ignoreSalt:[String,Number,Boolean],piwikHost:{type:String,required:!0}},components:{ContentBlock:g["ContentBlock"],PersonalSettings:ws,NewsletterSettings:Cs,PluginSettings:f["PluginSettings"]},computed:{yourVisitsAreText:function(){return this.ignoreCookieSet?Object(g["translate"])("UsersManager_YourVisitsAreIgnoredOnDomain","",this.piwikHost,""):Object(g["translate"])("UsersManager_YourVisitsAreNotIgnored","","")},setIgnoreCookieLink:function(){return"?".concat(g["MatomoUrl"].stringify({ignoreSalt:this.ignoreSalt,module:"UsersManager",action:"setIgnoreCookie"}),"#excludeCookie")}}});Ar.render=wr;var Tr=Ar; + */var C=function(){function e(){var t=this;h(this,e),v(this,"privateState",Object(o["reactive"])({isLoading:!1,capabilities:[]})),v(this,"state",Object(o["computed"])((function(){return Object(o["readonly"])(t.privateState)}))),v(this,"capabilities",Object(o["computed"])((function(){return t.state.value.capabilities}))),v(this,"isLoading",Object(o["computed"])((function(){return t.state.value.isLoading}))),v(this,"fetchPromise",void 0)}return j(e,[{key:"init",value:function(){return this.fetchCapabilities()}},{key:"fetchCapabilities",value:function(){var e=this;return this.fetchPromise||(this.privateState.isLoading=!0,this.fetchPromise=g["AjaxHelper"].fetch({method:"UsersManager.getAvailableCapabilities"}).then((function(t){return e.privateState.capabilities=t,e.capabilities.value})).finally((function(){e.privateState.isLoading=!1}))),this.fetchPromise}}]),e}(),y=new C,k=window,N=k.$,S=Object(o["defineComponent"])({props:{idsite:[String,Number],siteName:{type:String,required:!0},userLogin:{type:String,required:!0},userRole:{type:String,required:!0},capabilities:Array},components:{Field:f["Field"]},data:function(){return{theCapabilities:this.capabilities||[],isBusy:!1,isAddingCapability:!1,capabilityToAddId:null,capabilityToRemoveId:null,capabilityToAddOrRemove:null}},emits:["change"],watch:{capabilities:function(e){e&&(this.theCapabilities=e)}},created:function(){var e=this;y.init(),this.capabilities?this.theCapabilities=this.capabilities:(this.isBusy=!0,g["AjaxHelper"].fetch({method:"UsersManager.getUsersPlusRole",limit:"1",filter_search:this.userLogin}).then((function(e){return e&&e.capabilities?e.capabilities:[]})).then((function(t){e.theCapabilities=t})).finally((function(){e.isBusy=!1})))},methods:{onToggleCapability:function(e){var t=this;this.isAddingCapability=e;var n=e?this.capabilityToAddId:this.capabilityToRemoveId;this.capabilityToAddOrRemove=null,this.availableCapabilities.forEach((function(e){e.id===n&&(t.capabilityToAddOrRemove=e)})),this.$refs.confirmCapabilityToggleModal&&N(this.$refs.confirmCapabilityToggleModal).modal({dismissible:!1,yes:function(){return null}}).modal("open")},toggleCapability:function(){this.isAddingCapability?this.addCapability(this.capabilityToAddOrRemove):this.removeCapability(this.capabilityToAddOrRemove)},isIncludedInRole:function(e){return-1!==(e.includedInRoles||[]).indexOf(this.userRole)},getCapabilitiesList:function(){var e=this,t=[];return this.availableCapabilities.forEach((function(n){e.isIncludedInRole(n)||e.capabilitiesSet[n.id]&&t.push(n.id)})),t},addCapability:function(e){var t=this;this.isBusy=!0,g["AjaxHelper"].post({method:"UsersManager.addCapabilities"},{userLogin:this.userLogin,capabilities:e.id,idSites:this.idsite}).then((function(){t.$emit("change",t.getCapabilitiesList())})).finally((function(){t.isBusy=!1,t.capabilityToAddOrRemove=null,t.capabilityToAddId=null,t.capabilityToRemoveId=null}))},removeCapability:function(e){var t=this;this.isBusy=!0,g["AjaxHelper"].post({method:"UsersManager.removeCapabilities"},{userLogin:this.userLogin,capabilities:e.id,idSites:this.idsite}).then((function(){t.$emit("change",t.getCapabilitiesList())})).finally((function(){t.isBusy=!1,t.capabilityToAddOrRemove=null,t.capabilityToAddId=null,t.capabilityToRemoveId=null}))}},computed:{availableCapabilities:function(){return y.capabilities.value},confirmAddCapabilityToggleContent:function(){return Object(g["translate"])("UsersManager_AreYouSureAddCapability","".concat(this.userLogin,""),"".concat(this.capabilityToAddOrRemove?this.capabilityToAddOrRemove.name:"",""),"".concat(this.siteNameText,""))},confirmCapabilityToggleContent:function(){return Object(g["translate"])("UsersManager_AreYouSureRemoveCapability","".concat(this.capabilityToAddOrRemove?this.capabilityToAddOrRemove.name:"",""),"".concat(this.userLogin,""),"".concat(this.siteNameText,""))},siteNameText:function(){return g["Matomo"].helper.htmlEntities(this.siteName)},availableCapabilitiesGrouped:function(){var e=this,t=this.availableCapabilities.filter((function(t){return!e.capabilitiesSet[t.id]})).map((function(e){return{group:e.category,key:e.id,value:e.name,tooltip:e.description}}));return t.sort((function(e,t){return e.group===t.group?e.value===t.value?0:e.valuee.limit?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",q,[Object(o["createElementVNode"])("div",$,[Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["prev",{disabled:e.offset<=0}])},[Object(o["createElementVNode"])("span",{class:"pointer",onClick:t[6]||(t[6]=function(t){return e.gotoPreviousPage()})},"« "+Object(o["toDisplayString"])(e.translate("General_Previous")),1)],2),Object(o["createElementVNode"])("span",G,[Object(o["createElementVNode"])("span",{textContent:Object(o["toDisplayString"])(e.paginationText)},null,8,z)]),Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["next",{disabled:e.offset+e.limit>=e.totalEntries}])},[Object(o["createElementVNode"])("span",{class:"pointer",onClick:t[7]||(t[7]=function(t){return e.gotoNextPage()})},Object(o["toDisplayString"])(e.translate("General_Next"))+" »",1)],2)])])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",W,[e.isRoleHelpToggled?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,context:"info",type:"persistent",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.rolesHelpText)},null,8,Y)]})),_:1})):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",X,[e.isCapabilitiesHelpToggled?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,context:"info",type:"persistent",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.translate("UsersManager_CapabilitiesHelp")),1)]})),_:1})):Object(o["createCommentVNode"])("",!0)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("table",J,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",K,[Object(o["createElementVNode"])("span",Q,[Object(o["createElementVNode"])("label",null,[Object(o["createElementVNode"])("input",{type:"checkbox",id:"perm_edit_select_all",checked:e.isAllCheckboxSelected,onChange:t[8]||(t[8]=function(t){return e.onAllCheckboxChange(t)})},null,40,Z),ee])])]),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Name")),1),Object(o["createElementVNode"])("th",te,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize("".concat(e.translate("UsersManager_Role")," "))},null,8,ne),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["helpIcon",{sticky:e.isRoleHelpToggled}]),onClick:t[9]||(t[9]=Object(o["withModifiers"])((function(t){return e.isRoleHelpToggled=!e.isRoleHelpToggled}),["prevent"]))},re,2)]),Object(o["createElementVNode"])("th",oe,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize("".concat(e.translate("UsersManager_Capabilities")," "))},null,8,ie),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["helpIcon",{sticky:e.isCapabilitiesHelpToggled}]),onClick:t[10]||(t[10]=Object(o["withModifiers"])((function(t){return e.isCapabilitiesHelpToggled=!e.isCapabilitiesHelpToggled}),["prevent"]))},le,2)])])]),Object(o["createElementVNode"])("tbody",null,[e.isAllCheckboxSelected&&e.siteAccess.length=(this.totalEntries||0)||(this.offset=e,this.fetchAccess())},showRemoveAccessConfirm:function(){Pe(this.$refs.deleteAccessConfirmModal).modal({dismissible:!1}).modal("open")},changeUserRole:function(){var e=this,t=function(){var t=[];return Object.keys(e.selectedRows).forEach((function(n){e.selectedRows[n]&&e.siteAccess[n]&&t.push(e.siteAccess[n].idsite)})),t},n=function(){return g["AjaxHelper"].fetch({method:"UsersManager.getSitesAccessForUser",filter_search:e.siteNameFilter,filter_access:e.accessLevelFilter,userLogin:e.userLogin,filter_limit:"-1"}).then((function(e){return e.map((function(e){return e.idsite}))}))};return this.isLoadingAccess=!0,Promise.resolve().then((function(){return e.siteAccessToChange?[e.siteAccessToChange.idsite]:e.areAllResultsSelected?n():t()})).then((function(t){return g["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:e.userLogin,access:e.roleToChangeTo,idSites:t})})).catch((function(){})).then((function(){return e.$emit("accessChanged"),e.fetchAccess()}))},showChangeAccessConfirm:function(){var e=this;Pe(this.$refs.changeAccessConfirmModal).modal({dismissible:!1,onCloseEnd:function(){e.accessChangeEvent=null}}).modal("open")},getRoleDisplay:function(e){var t=null;return this.filteredAccessLevels.forEach((function(n){n.key===e&&(t=n.value)})),t},giveAccessToAllSites:function(){var e=this;this.isGivingAccessToAllSites=!0,g["AjaxHelper"].fetch({method:"SitesManager.getSitesWithAdminAccess",filter_limit:-1}).then((function(t){var n=t.map((function(e){return e.idsite}));return g["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:e.userLogin,access:e.allWebsitesAccssLevelSet,idSites:n})})).then((function(){return e.fetchAccess()})).finally((function(){e.isGivingAccessToAllSites=!1}))},showChangeAccessAllSitesModal:function(){Pe(this.$refs.confirmGiveAccessAllSitesModal).modal({dismissible:!1}).modal("open")},onChangeSiteFilter:function(e){var t=this;setTimeout((function(){var n=e.target.value;t.siteNameFilter!==n&&(t.siteNameFilter=n,t.offset=0,t.fetchAccess())}))},onRoleChange:function(e,t){this.siteAccessToChange=e,this.roleToChangeTo=t.value,this.accessChangeEvent=t,this.showChangeAccessConfirm()}},computed:{rolesHelpText:function(){return Object(g["translate"])("UsersManager_RolesHelp",'',"",'',"")},theDisplayedWebsitesAreSelectedText:function(){var e=Object(g["translate"])("UsersManager_TheDisplayedWebsitesAreSelected","".concat(this.siteAccess.length,""));return"".concat(e," ")},clickToSelectAllText:function(){return Object(g["translate"])("UsersManager_ClickToSelectAll","".concat(this.totalEntries,""))},allWebsitesAreSelectedText:function(){return Object(g["translate"])("UsersManager_AllWebsitesAreSelected","".concat(this.totalEntries,""))},clickToSelectDisplayedWebsitesText:function(){return Object(g["translate"])("UsersManager_ClickToSelectDisplayedWebsites","".concat(this.siteAccess.length,""))},deletePermConfirmSingleText:function(){return Object(g["translate"])("UsersManager_DeletePermConfirmSingle","".concat(this.userLogin,""),"".concat(this.siteAccessToChangeName,""))},deletePermConfirmMultipleText:function(){return Object(g["translate"])("UsersManager_DeletePermConfirmMultiple","".concat(this.userLogin,""),"".concat(this.affectedSitesCount,""))},changePermToSiteConfirmSingleText:function(){return Object(g["translate"])("UsersManager_ChangePermToSiteConfirmSingle","".concat(this.userLogin,""),"".concat(this.siteAccessToChangeName,""),"".concat(this.getRoleDisplay(this.roleToChangeTo),""))},changePermToSiteConfirmMultipleText:function(){return Object(g["translate"])("UsersManager_ChangePermToSiteConfirmMultiple","".concat(this.userLogin,""),"".concat(this.affectedSitesCount,""),"".concat(this.getRoleDisplay(this.roleToChangeTo),""))},changePermToAllSitesConfirmText:function(){return Object(g["translate"])("UsersManager_ChangePermToAllSitesConfirm","".concat(this.userLogin,""),"".concat(this.getRoleDisplay(this.allWebsitesAccssLevelSet),""))},paginationLowerBound:function(){return this.offset+1},paginationUpperBound:function(){return this.totalEntries?Math.min(this.offset+this.limit,this.totalEntries):"?"},filteredAccessLevels:function(){return this.accessLevels.filter((function(e){return"superuser"!==e.key&&"role"===e.type}))},filteredSelectAccessLevels:function(){return this.filterAccessLevels.filter((function(e){return"superuser"!==e.key}))},selectedRowsCount:function(){var e=0;return Object.values(this.selectedRows).forEach((function(t){t&&(e+=1)})),e},affectedSitesCount:function(){return this.areAllResultsSelected?this.totalEntries:this.selectedRowsCount},allPropsWatch:function(){return this.userLogin,this.limit,this.accessLevels,this.filterAccessLevels,Date.now()},siteAccessToChangeName:function(){return this.siteAccessToChange?g["Matomo"].helper.htmlEntities(this.siteAccessToChange.site_name):""},paginationText:function(){var e=Object(g["translate"])("General_Pagination","".concat(this.paginationLowerBound),"".concat(this.paginationUpperBound),"".concat(this.totalEntries));return" ".concat(e," ")}}});Re.render=xe;var Fe=Re,He={class:"row"},Ie={key:0,class:"col s12 m6 invite-notes"},qe={class:"form-help"},$e=["innerHTML"],Ge={key:1,class:"col m2 entityList"},ze={class:"listCircle"},We={key:0,class:"icon-warning"},Ye=Object(o["createElementVNode"])("div",{class:"save-button-spacer hide-on-small-only"},null,-1),Xe={href:"",class:"entityCancelLink"},Je=Object(o["createElementVNode"])("span",{class:"icon-arrow-left-2"},"  ",-1),Ke={class:"visibleTab col m10"},Qe={key:0,class:"basic-info-tab"},Ze={class:"form-group row",style:{position:"relative"}},et={class:"col s12 m6 save-button"},tt={key:0,class:"resend-notes"},nt=["innerHTML"],st={key:0,class:"entityCancel"},rt=Object(o["createElementVNode"])("span",{class:"icon icon-arrow-left-2"},"  ",-1),ot={key:1,class:"user-permissions"},it={key:0},at={key:1,class:"alert alert-info"},lt={key:2,class:"superuser-access form-group"},ct={key:0},dt={key:1},ut={key:3,class:"twofa-reset form-group"},mt={class:"resetTwoFa"},bt=["innerHTML"];function pt(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("SaveButton"),c=Object(o["resolveComponent"])("PasswordConfirmation"),d=Object(o["resolveComponent"])("UserPermissionsEdit"),u=Object(o["resolveComponent"])("ContentBlock"),m=Object(o["resolveDirective"])("form");return Object(o["openBlock"])(),Object(o["createBlock"])(u,{class:Object(o["normalizeClass"])(["userEditForm",{loading:e.isSavingUserInfo}]),"content-title":"".concat(e.formTitle," ").concat(e.isAdd?"":"".concat(e.theUser.login))},{default:Object(o["withCtx"])((function(){return[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",He,[e.isAdd?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ie,[Object(o["createElementVNode"])("div",qe,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("UsersManager_InviteSuccessNotification",[e.inviteTokenExpiryDays]))},null,8,$e)])])):Object(o["createCommentVNode"])("",!0),e.isAdd?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ge,[Object(o["createElementVNode"])("ul",ze,[Object(o["createElementVNode"])("li",{class:Object(o["normalizeClass"])([{active:"basic"===e.activeTab},"menuBasicInfo"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[0]||(t[0]=Object(o["withModifiers"])((function(t){return e.activeTab="basic"}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_BasicInformation")),1)],2),Object(o["createElementVNode"])("li",{class:Object(o["normalizeClass"])([{active:"permissions"===e.activeTab},"menuPermissions"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[1]||(t[1]=Object(o["withModifiers"])((function(t){return e.activeTab="permissions"}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("UsersManager_Permissions")),1),e.userHasAccess||e.theUser.superuser_access?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",We))],2),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:0,class:Object(o["normalizeClass"])([{active:"superuser"===e.activeTab},"menuSuperuser"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[2]||(t[2]=Object(o["withModifiers"])((function(t){return e.activeTab="superuser"}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_SuperUserAccess")),1)],2)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole&&e.theUser.uses_2fa&&!e.isAdd?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:1,class:Object(o["normalizeClass"])([{active:"2fa"===e.activeTab},"menuUserTwoFa"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[3]||(t[3]=Object(o["withModifiers"])((function(t){return e.activeTab="2fa"}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_TwoFactorAuthentication")),1)],2)):Object(o["createCommentVNode"])("",!0)]),Ye,Object(o["createElementVNode"])("div",{class:"entityCancel",onClick:t[4]||(t[4]=Object(o["withModifiers"])((function(t){return e.onDoneEditing()}),["prevent"]))},[Object(o["createElementVNode"])("a",Xe,[Je,Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_BackToUser")),1)])])])),Object(o["createElementVNode"])("div",Ke,["basic"===e.activeTab?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Qe,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{modelValue:e.theUser.login,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.theUser.login=t}),disabled:e.isSavingUserInfo||!e.isAdd||e.isShowingPasswordConfirm,autocomplete:"off",uicontrol:"text",name:"user_login",maxlength:100,title:e.translate("General_Username")},null,8,["modelValue","disabled","title"])]),Object(o["createElementVNode"])("div",null,[e.isPending?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,"model-value":e.theUser.password,disabled:e.isSavingUserInfo||"superuser"!==e.currentUserRole&&!e.isAdd||e.isShowingPasswordConfirm,"onUpdate:modelValue":t[6]||(t[6]=function(t){e.theUser.password=t,e.isPasswordModified=!0}),uicontrol:"password",name:"user_password",autocomplete:"new-password",title:e.translate("General_Password")},null,8,["model-value","disabled","title"]))]),Object(o["createElementVNode"])("div",null,["superuser"===e.currentUserRole||e.isAdd?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,modelValue:e.theUser.email,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.theUser.email=t}),disabled:e.isSavingUserInfo||"superuser"!==e.currentUserRole&&!e.isAdd||e.isShowingPasswordConfirm,uicontrol:"text",name:"user_email",autocomplete:"off",maxlength:100,title:e.translate("UsersManager_Email")},null,8,["modelValue","disabled","title"])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",null,[e.isAdd?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,modelValue:e.firstSiteAccess,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.firstSiteAccess=t}),disabled:e.isSavingUserInfo,uicontrol:"site",name:"user_site","ui-control-attributes":{onlySitesWithAdminAccess:!0},title:e.translate("UsersManager_FirstWebsitePermission"),"inline-help":e.translate("UsersManager_FirstSiteInlineHelp")},null,8,["modelValue","disabled","title","inline-help"])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("div",Ze,[Object(o["createElementVNode"])("div",et,["superuser"===e.currentUserRole||e.isAdd?(Object(o["openBlock"])(),Object(o["createBlock"])(l,{key:0,value:e.saveButtonLabel,disabled:e.isAdd&&(!e.firstSiteAccess||!e.firstSiteAccess.id),saving:e.isSavingUserInfo,onConfirm:e.saveUserInfo},null,8,["value","disabled","saving","onConfirm"])):Object(o["createCommentVNode"])("",!0)])]),e.user&&e.isPending?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",tt,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_InvitationSent"))+" ",1),Object(o["createElementVNode"])("span",{class:"resend-link",onClick:t[9]||(t[9]=function(){return e.resendRequestedUser&&e.resendRequestedUser.apply(e,arguments)}),innerHTML:e.$sanitize(e.translate("UsersManager_ResendInvite")+"/"+e.translate("UsersManager_CopyLink"))},null,8,nt)])):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(c,{modelValue:e.showPasswordConfirmationForInviteUser,"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.showPasswordConfirmationForInviteUser=t}),onConfirmed:e.inviteUser},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])]),e.isAdd?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",st,[Object(o["createElementVNode"])("a",{href:"",class:"entityCancelLink",onClick:t[11]||(t[11]=Object(o["withModifiers"])((function(t){return e.onDoneEditing()}),["prevent"]))},[rt,Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_BackToUser")),1)])])):Object(o["createCommentVNode"])("",!0)])):Object(o["createCommentVNode"])("",!0),e.isAdd?Object(o["createCommentVNode"])("",!0):Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ot,[e.theUser.superuser_access?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",it,[Object(o["createVNode"])(d,{"user-login":e.theUser.login,onUserHasAccessDetected:t[12]||(t[12]=function(t){return e.userHasAccess=t.hasAccess}),onAccessChanged:t[13]||(t[13]=function(t){return e.isUserModified=!0}),"access-levels":e.accessLevels,"filter-access-levels":e.filterAccessLevels},null,8,["user-login","access-levels","filter-access-levels"])])),e.theUser.superuser_access?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",at,Object(o["toDisplayString"])(e.translate("UsersManager_SuperUsersPermissionsNotice")),1)):Object(o["createCommentVNode"])("",!0)],512)),[[o["vShow"],"permissions"===e.activeTab]]),"superuser"!==e.activeTab||"superuser"!==e.currentUserRole||e.isAdd?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",lt,[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_SuperUserIntro1")),1),Object(o["createElementVNode"])("p",null,[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("UsersManager_SuperUserIntro2")),1)]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{modelValue:e.superUserAccessChecked,"onUpdate:modelValue":t[14]||(t[14]=function(t){return e.superUserAccessChecked=t}),onClick:t[15]||(t[15]=function(t){return e.confirmSuperUserChange()}),disabled:e.isSavingUserInfo,uicontrol:"checkbox",name:"superuser_access",title:e.translate("UsersManager_HasSuperUserAccess")},null,8,["modelValue","disabled","title"])]),Object(o["createVNode"])(c,{modelValue:e.showPasswordConfirmationForSuperUser,"onUpdate:modelValue":t[16]||(t[16]=function(t){return e.showPasswordConfirmationForSuperUser=t}),onConfirmed:e.toggleSuperuserAccess,onAborted:t[17]||(t[17]=function(t){return e.setSuperUserAccessChecked()})},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("UsersManager_AreYouSure")),1),e.theUser.superuser_access?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",ct,Object(o["toDisplayString"])(e.translate("UsersManager_RemoveSuperuserAccessConfirm")),1)):Object(o["createCommentVNode"])("",!0),e.theUser.superuser_access?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",dt,Object(o["toDisplayString"])(e.translate("UsersManager_AddSuperuserAccessConfirm")),1))]})),_:1},8,["modelValue","onConfirmed"])])),"superuser"!==e.currentUserRole||e.isAdd?Object(o["createCommentVNode"])("",!0):Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ut,[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ResetTwoFactorAuthenticationInfo")),1),Object(o["createElementVNode"])("div",mt,[Object(o["createVNode"])(l,{saving:e.isResetting2FA,onConfirm:t[18]||(t[18]=function(t){return e.confirmReset2FA()}),value:e.translate("UsersManager_ResetTwoFactorAuthentication")},null,8,["saving","value"])]),Object(o["createVNode"])(c,{modelValue:e.showPasswordConfirmationFor2FA,"onUpdate:modelValue":t[19]||(t[19]=function(t){return e.showPasswordConfirmationFor2FA=t}),onConfirmed:e.reset2FA},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("UsersManager_AreYouSure")),1),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])],512)),[[o["vShow"],"2fa"===e.activeTab]])])],512),[[m]]),Object(o["createVNode"])(c,{modelValue:e.isShowingPasswordConfirm,"onUpdate:modelValue":t[20]||(t[20]=function(t){return e.isShowingPasswordConfirm=t}),onConfirmed:e.updateUser},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("h2",{innerHTML:e.$sanitize(e.changePasswordTitle)},null,8,bt),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])]})),_:1},8,["class","content-title"])}var gt={login:"",superuser_access:!1,uses_2fa:!1,password:"",email:"",invite_status:""},ft=Object(o["defineComponent"])({props:{user:Object,currentUserRole:{type:String,required:!0},accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0},initialSiteId:{type:[String,Number],required:!0},initialSiteName:{type:String,required:!0},inviteTokenExpiryDays:{type:String,required:!0}},components:{ContentBlock:g["ContentBlock"],Field:f["Field"],SaveButton:f["SaveButton"],UserPermissionsEdit:Fe,PasswordConfirmation:f["PasswordConfirmation"]},directives:{Form:f["Form"]},data:function(){return{theUser:this.user||Object.assign({},gt),activeTab:"basic",permissionsForIdSite:1,isSavingUserInfo:!1,userHasAccess:!0,firstSiteAccess:{id:this.initialSiteId,name:this.initialSiteName},isUserModified:!1,isPasswordModified:!1,superUserAccessChecked:null,showPasswordConfirmationForSuperUser:!1,showPasswordConfirmationFor2FA:!1,showPasswordConfirmationForInviteUser:!1,isResetting2FA:!1,isShowingPasswordConfirm:!1}},emits:["done","updated","resendInvite"],watch:{user:function(e){this.onUserChange(e)}},created:function(){this.onUserChange(this.user)},methods:{onUserChange:function(e){this.theUser=e||Object.assign({},gt),this.theUser.password||this.resetPasswordVar(),this.setSuperUserAccessChecked()},confirmSuperUserChange:function(){this.showPasswordConfirmationForSuperUser=!0},confirmReset2FA:function(){this.showPasswordConfirmationFor2FA=!0},toggleSuperuserAccess:function(e){var t=this;this.isSavingUserInfo=!0,g["AjaxHelper"].post({method:"UsersManager.setSuperUserAccess"},{userLogin:this.theUser.login,hasSuperUserAccess:this.theUser.superuser_access?"0":"1",passwordConfirmation:e}).then((function(){t.theUser.superuser_access=!t.theUser.superuser_access})).catch((function(){})).then((function(){t.isSavingUserInfo=!1,t.setSuperUserAccessChecked()}))},saveUserInfo:function(){this.isAdd?this.showPasswordConfirmationForInviteUser=!0:this.isShowingPasswordConfirm=!0},resendRequestedUser:function(){this.$emit("resendInvite",{user:this.user})},inviteUser:function(e){var t=this;return this.isSavingUserInfo=!0,g["AjaxHelper"].post({method:"UsersManager.inviteUser"},{userLogin:this.theUser.login,email:this.theUser.email,initialIdSite:this.firstSiteAccess?this.firstSiteAccess.id:void 0,passwordConfirmation:e}).catch((function(e){throw t.isSavingUserInfo=!1,e})).then((function(){t.firstSiteAccess=null,t.isSavingUserInfo=!1,t.isUserModified=!0,t.theUser.invite_status="pending",t.resetPasswordVar(),t.showUserCreatedNotification(),t.$emit("updated",{user:Object(o["readonly"])(t.theUser)})}))},resetPasswordVar:function(){this.isAdd||(this.theUser.password="XXXXXXXX")},showUserSavedNotification:function(){g["NotificationsStore"].show({message:Object(g["translate"])("General_YourChangesHaveBeenSaved"),context:"success",type:"toast"})},showUserCreatedNotification:function(){g["NotificationsStore"].show({message:Object(g["translate"])("UsersManager_InviteSuccess"),context:"success",type:"toast"})},reset2FA:function(e){var t=this;return this.isResetting2FA=!0,g["AjaxHelper"].post({method:"TwoFactorAuth.resetTwoFactorAuth"},{userLogin:this.theUser.login,passwordConfirmation:e}).catch((function(e){throw t.isResetting2FA=!1,e})).then((function(){t.isResetting2FA=!1,t.theUser.uses_2fa=!1,t.activeTab="basic",t.showUserSavedNotification()}))},updateUser:function(e){var t=this;return this.isSavingUserInfo=!0,g["AjaxHelper"].post({method:"UsersManager.updateUser"},{userLogin:this.theUser.login,password:this.isPasswordModified&&this.theUser.password?this.theUser.password:void 0,passwordConfirmation:e,email:this.theUser.email}).then((function(){t.isSavingUserInfo=!1,t.isUserModified=!0,t.isPasswordModified=!1,t.resetPasswordVar(),t.showUserSavedNotification(),t.$emit("updated",{user:Object(o["readonly"])(t.theUser)})})).catch((function(){t.isSavingUserInfo=!1}))},setSuperUserAccessChecked:function(){this.superUserAccessChecked=!!this.theUser.superuser_access},onDoneEditing:function(){this.$emit("done",{isUserModified:this.isUserModified})}},computed:{formTitle:function(){return this.isAdd?Object(g["translate"])("UsersManager_InviteNewUser"):""},saveButtonLabel:function(){return this.isAdd?Object(g["translate"])("UsersManager_InviteUser"):Object(g["translate"])("UsersManager_SaveBasicInfo")},isPending:function(){return!this.user||!("pending"!==this.user.invite_status&&!Number.isInteger(this.user.invite_status))},isAdd:function(){return!this.user},changePasswordTitle:function(){return Object(g["translate"])("UsersManager_AreYouSureChangeDetails","".concat(this.theUser.login,""))}}});ft.render=pt;var ht=ft,Ot={class:"userListFilters row"},jt={class:"col s12 m12 l8"},vt={class:"input-field col s12 m3 l3"},Ct={id:"user-list-bulk-actions",class:"dropdown-content"},yt={class:"dropdown-trigger","data-target":"bulk-set-access"},kt={id:"bulk-set-access",class:"dropdown-content"},Nt=["onClick"],St={key:0},Vt={class:"input-field col s12 m3 l3"},Ut={class:"permissions-for-selector"},Et={class:"input-field col s12 m3 l3"},wt={class:"input-field col s12 m3 l3"},At={key:0,class:"input-field col s12 m12 l4 users-list-pagination-container"},Tt={class:"usersListPagination"},Mt={class:"pointer"},Bt={class:"counter"},_t={class:"pointer"},Dt={key:0,class:"roles-help-notification"},xt=["innerHTML"],Lt={class:"select-cell"},Pt={class:"checkbox-container"},Rt=Object(o["createElementVNode"])("span",null,null,-1),Ft={class:"first"},Ht={class:"role_header"},It={style:{"margin-right":"3.5px"}},qt=Object(o["createElementVNode"])("span",{class:"icon-help"},null,-1),$t=[qt],Gt={key:0},zt=["title"],Wt={key:2},Yt={class:"actions-cell-header"},Xt={key:0,class:"select-all-row"},Jt={colspan:"8"},Kt={key:0},Qt=["innerHTML"],Zt=["innerHTML"],en={key:1},tn=["innerHTML"],nn=["innerHTML"],sn=["id"],rn={class:"select-cell"},on={class:"checkbox-container"},an=["id","onUpdate:modelValue"],ln=Object(o["createElementVNode"])("span",null,null,-1),cn={id:"userLogin"},dn={class:"access-cell"},un={key:0,id:"email"},mn={key:1,id:"twofa"},bn={key:0,class:"icon-ok"},pn={key:1,class:"icon-close"},gn={key:2,id:"last_seen"},fn={id:"status"},hn=["title"],On={class:"center actions-cell"},jn=["onClick"],vn=Object(o["createElementVNode"])("span",{class:"icon-email"},null,-1),Cn=[vn],yn=["onClick"],kn=Object(o["createElementVNode"])("span",{class:"icon-edit"},null,-1),Nn=[kn],Sn=["onClick"],Vn=Object(o["createElementVNode"])("span",{class:"icon-delete"},null,-1),Un=[Vn],En=["innerHTML"],wn=["innerHTML"],An={class:"change-user-role-confirm-modal modal",ref:"changeUserRoleConfirmModal"},Tn={class:"modal-content"},Mn=["innerHTML"],Bn={key:1},_n=["innerHTML"],Dn=["innerHTML"],xn={class:"modal-footer"};function Ln(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("ActivityIndicator"),c=Object(o["resolveComponent"])("Notification"),d=Object(o["resolveComponent"])("ContentBlock"),u=Object(o["resolveComponent"])("PasswordConfirmation"),m=Object(o["resolveDirective"])("dropdown-menu"),b=Object(o["resolveDirective"])("content-table");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["pagedUsersList",{loading:e.isLoadingUsers}])},[Object(o["createElementVNode"])("div",Ot,[Object(o["createElementVNode"])("div",jt,[Object(o["createElementVNode"])("div",vt,[Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["dropdown-trigger btn bulk-actions",{disabled:e.isBulkActionsDisabled}]),href:"","data-target":"user-list-bulk-actions"},[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_BulkActions")),1)],2),[[m]]),Object(o["createElementVNode"])("ul",Ct,[Object(o["createElementVNode"])("li",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("a",yt,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_SetPermission")),1)],512),[[m]]),Object(o["createElementVNode"])("ul",kt,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.bulkActionAccessLevels,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:t.key},[Object(o["createElementVNode"])("a",{href:"",onClick:Object(o["withModifiers"])((function(n){e.userToChange=null,e.roleToChangeTo=t.key,e.showAccessChangeConfirm()}),["prevent"])},Object(o["toDisplayString"])(t.value),9,Nt)])})),128))])]),Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("a",{href:"",onClick:t[0]||(t[0]=Object(o["withModifiers"])((function(t){e.userToChange=null,e.roleToChangeTo="noaccess",e.showAccessChangeConfirm()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_RemovePermissions")),1)]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",St,[Object(o["createElementVNode"])("a",{href:"",onClick:t[1]||(t[1]=Object(o["withModifiers"])((function(t){return e.showDeleteConfirm()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_DeleteUsers")),1)])):Object(o["createCommentVNode"])("",!0)])]),Object(o["createElementVNode"])("div",Vt,[Object(o["createElementVNode"])("div",Ut,[Object(o["createVNode"])(a,{"model-value":e.userTextFilter,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.onUserTextFilterChange(t)}),name:"user-text-filter",uicontrol:"text","full-width":!0,placeholder:e.translate("UsersManager_UserSearch")},null,8,["model-value","placeholder"])])]),Object(o["createElementVNode"])("div",Et,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{"model-value":e.accessLevelFilter,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.accessLevelFilter=t,e.changeSearch({filter_access:e.accessLevelFilter,offset:0})}),name:"access-level-filter",uicontrol:"select",options:e.filterAccessLevels,"full-width":!0,placeholder:e.translate("UsersManager_FilterByAccess")},null,8,["model-value","options","placeholder"])])]),Object(o["createElementVNode"])("div",wt,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{"model-value":e.statusLevelFilter,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.statusLevelFilter=t,e.changeSearch({filter_status:e.statusLevelFilter,offset:0})}),name:"status-level-filter",uicontrol:"select",options:e.filterStatusLevels,"full-width":!0,placeholder:e.translate("UsersManager_FilterByStatus")},null,8,["model-value","options","placeholder"])])])]),e.totalEntries>e.searchParams.limit?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",At,[Object(o["createElementVNode"])("div",Tt,[Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["btn prev",{disabled:e.searchParams.offset<=0}]),onClick:t[5]||(t[5]=Object(o["withModifiers"])((function(t){return e.gotoPreviousPage()}),["prevent"]))},[Object(o["createElementVNode"])("span",Mt,"« "+Object(o["toDisplayString"])(e.translate("General_Previous")),1)],2),Object(o["createElementVNode"])("div",Bt,[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])({visibility:e.isLoadingUsers?"hidden":"visible"})},Object(o["toDisplayString"])(e.translate("General_Pagination",e.paginationLowerBound,e.paginationUpperBound,e.totalEntries)),3),Object(o["createVNode"])(l,{loading:e.isLoadingUsers},null,8,["loading"])]),Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["btn next",{disabled:e.searchParams.offset+e.searchParams.limit>=e.totalEntries}]),onClick:t[6]||(t[6]=Object(o["withModifiers"])((function(t){return e.gotoNextPage()}),["prevent"]))},[Object(o["createElementVNode"])("span",_t,Object(o["toDisplayString"])(e.translate("General_Next"))+" »",1)],2)])])):Object(o["createCommentVNode"])("",!0)]),e.isRoleHelpToggled?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Dt,[Object(o["createVNode"])(c,{context:"info",type:"persistent",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.rolesHelpText)},null,8,xt)]})),_:1})])):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(d,null,{default:Object(o["withCtx"])((function(){return[Object(o["withDirectives"])(Object(o["createElementVNode"])("table",{id:"manageUsersTable",class:Object(o["normalizeClass"])({loading:e.isLoadingUsers})},[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",Lt,[Object(o["createElementVNode"])("span",Pt,[Object(o["createElementVNode"])("label",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"checkbox",id:"paged_users_select_all",checked:"checked","onUpdate:modelValue":t[7]||(t[7]=function(t){return e.isAllCheckboxSelected=t}),onChange:t[8]||(t[8]=function(t){return e.onAllCheckboxChange()})},null,544),[[o["vModelCheckbox"],e.isAllCheckboxSelected]]),Rt])])]),Object(o["createElementVNode"])("th",Ft,Object(o["toDisplayString"])(e.translate("UsersManager_Username")),1),Object(o["createElementVNode"])("th",Ht,[Object(o["createElementVNode"])("span",It,Object(o["toDisplayString"])(e.translate("UsersManager_RoleFor")),1),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["helpIcon",{sticky:e.isRoleHelpToggled}]),onClick:t[9]||(t[9]=Object(o["withModifiers"])((function(t){return e.isRoleHelpToggled=!e.isRoleHelpToggled}),["prevent"]))},$t,2),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{class:"permissions-for-selector","model-value":e.permissionsForSite,"onUpdate:modelValue":t[10]||(t[10]=function(t){e.onPermissionsForUpdate(t)}),uicontrol:"site","ui-control-attributes":{onlySitesWithAdminAccess:"superuser"!==e.currentUserRole}},null,8,["model-value","ui-control-attributes"])])]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",Gt,Object(o["toDisplayString"])(e.translate("UsersManager_Email")),1)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:1,title:e.translate("UsersManager_UsesTwoFactorAuthentication")},Object(o["toDisplayString"])(e.translate("UsersManager_2FA")),9,zt)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",Wt,Object(o["toDisplayString"])(e.translate("UsersManager_LastSeen")),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("UsersManager_Status")),1),Object(o["createElementVNode"])("th",Yt,[Object(o["createElementVNode"])("div",null,Object(o["toDisplayString"])(e.translate("General_Actions")),1)])])]),Object(o["createElementVNode"])("tbody",null,[e.isAllCheckboxSelected&&e.users.length&&e.users.length".concat(e.users.length,""))),style:{"margin-right":"3.5px"}},null,8,Qt),Object(o["createElementVNode"])("a",{class:"toggle-select-all-in-search",href:"#",onClick:t[11]||(t[11]=Object(o["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.translate("UsersManager_ClickToSelectAll","".concat(e.totalEntries,"")))},null,8,Zt)])),e.areAllResultsSelected?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",en,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("UsersManager_AllUsersAreSelected","".concat(e.totalEntries,""))),style:{"margin-right":"3.5px"}},null,8,tn),Object(o["createElementVNode"])("a",{class:"toggle-select-all-in-search",href:"#",onClick:t[12]||(t[12]=Object(o["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.translate("UsersManager_ClickToSelectDisplayedUsers","".concat(e.users.length,"")))},null,8,nn)])):Object(o["createCommentVNode"])("",!0)])])):Object(o["createCommentVNode"])("",!0),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.users,(function(n,s){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{id:"row".concat(s),key:n.login},[Object(o["createElementVNode"])("td",rn,[Object(o["createElementVNode"])("span",on,[Object(o["createElementVNode"])("label",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"checkbox",id:"paged_users_select_row".concat(s),"onUpdate:modelValue":function(t){return e.selectedRows[s]=t},onClick:t[13]||(t[13]=function(t){return e.onRowSelected()})},null,8,an),[[o["vModelCheckbox"],e.selectedRows[s]]]),ln])])]),Object(o["createElementVNode"])("td",cn,Object(o["toDisplayString"])(n.login),1),Object(o["createElementVNode"])("td",dn,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{"model-value":n.role,"onUpdate:modelValue":function(t){e.userToChange=n,e.roleToChangeTo=t,e.showAccessChangeConfirm()},disabled:"superuser"===n.role,uicontrol:"select",options:"anonymous"===n.login?e.anonymousAccessLevels:"noaccess"===n.role?e.onlyRoleAccessLevels:e.accessLevels},null,8,["model-value","onUpdate:modelValue","disabled","options"])])]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",un,Object(o["toDisplayString"])(n.email),1)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",mn,[n.uses_2fa?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",bn)):Object(o["createCommentVNode"])("",!0),n.uses_2fa?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",pn))])):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",gn,Object(o["toDisplayString"])(n.last_seen?"".concat(n.last_seen," ago"):"-"),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("td",fn,[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(Number.isInteger(n.invite_status)?"pending":n.invite_status),title:"expired"===n.invite_status?e.translate("UsersManager_ExpiredInviteAutomaticallyRemoved","3"):""},Object(o["toDisplayString"])(e.getInviteStatus(n.invite_status)),11,hn)]),Object(o["createElementVNode"])("td",On,[("superuser"===e.currentUserRole||"admin"===e.currentUserRole&&n.invited_by===e.currentUserLogin)&&"active"!==n.invite_status?(Object(o["openBlock"])(),Object(o["createElementBlock"])("button",{key:0,class:"resend table-action",title:"Resend/Copy Invite Link",onClick:function(t){e.userToChange=n,e.resendRequestedUser()}},Cn,8,jn)):Object(o["createCommentVNode"])("",!0),"anonymous"!==n.login?(Object(o["openBlock"])(),Object(o["createElementBlock"])("button",{key:1,class:"edituser table-action",title:"Edit",onClick:function(t){return e.$emit("editUser",{user:n})}},Nn,8,yn)):Object(o["createCommentVNode"])("",!0),("superuser"===e.currentUserRole||"admin"===e.currentUserRole&&n.invited_by===e.currentUserLogin)&&"anonymous"!==n.login?(Object(o["openBlock"])(),Object(o["createElementBlock"])("button",{key:2,class:"deleteuser table-action",title:"Delete",onClick:function(t){e.userToChange=n,e.showDeleteConfirm()}},Un,8,Sn)):Object(o["createCommentVNode"])("",!0)])],8,sn)})),128))])],2),[[b]])]})),_:1}),Object(o["createVNode"])(u,{modelValue:e.showPasswordConfirmationForUserRemoval,"onUpdate:modelValue":t[14]||(t[14]=function(t){return e.showPasswordConfirmationForUserRemoval=t}),onConfirmed:e.deleteRequestedUsers,onAborted:t[15]||(t[15]=function(t){e.userToChange=null,e.roleToChangeTo=null})},{default:Object(o["withCtx"])((function(){return[e.userToChange?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",{key:0,innerHTML:e.$sanitize(e.translate("UsersManager_DeleteUserConfirmSingle","".concat(e.userToChange.login,"")))},null,8,En)):Object(o["createCommentVNode"])("",!0),e.userToChange?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",{key:1,innerHTML:e.$sanitize(e.translate("UsersManager_DeleteUserConfirmMultiple","".concat(e.affectedUsersCount,"")))},null,8,wn)),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"]),Object(o["createElementVNode"])("div",An,[Object(o["createElementVNode"])("div",Tn,[e.userToChange?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h3",{key:0,innerHTML:e.$sanitize(e.deleteUserPermConfirmSingleText)},null,8,Mn)):Object(o["createCommentVNode"])("",!0),e.userToChange&&"anonymous"===e.userToChange.login&&"view"===e.roleToChangeTo?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h3",Bn,[Object(o["createElementVNode"])("em",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_Note"))+": ",1),Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("UsersManager_AnonymousUserRoleChangeWarning","anonymous",e.getRoleDisplay(e.roleToChangeTo)))},null,8,_n)])])):Object(o["createCommentVNode"])("",!0),e.userToChange?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",{key:2,innerHTML:e.$sanitize(e.deleteUserPermConfirmMultipleText)},null,8,Dn))]),Object(o["createElementVNode"])("div",xn,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[16]||(t[16]=Object(o["withModifiers"])((function(t){return e.changeUserRole()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[17]||(t[17]=Object(o["withModifiers"])((function(t){e.userToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512)],2)}var Pn=window,Rn=Pn.$,Fn=Object(o["defineComponent"])({props:{initialSiteId:{type:[String,Number],required:!0},initialSiteName:{type:String,required:!0},currentUserRole:String,isLoadingUsers:Boolean,accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0},filterStatusLevels:{type:Array,required:!0},totalEntries:Number,users:{type:Array,required:!0},searchParams:{type:Object,required:!0}},components:{Field:f["Field"],ActivityIndicator:g["ActivityIndicator"],Notification:g["Notification"],ContentBlock:g["ContentBlock"],PasswordConfirmation:f["PasswordConfirmation"]},directives:{DropdownMenu:g["DropdownMenu"],ContentTable:g["ContentTable"]},data:function(){return{areAllResultsSelected:!1,selectedRows:{},isAllCheckboxSelected:!1,isBulkActionsDisabled:!0,userToChange:null,roleToChangeTo:null,accessLevelFilter:null,statusLevelFilter:null,isRoleHelpToggled:!1,userTextFilter:"",permissionsForSite:{id:this.initialSiteId,name:this.initialSiteName},showPasswordConfirmationForUserRemoval:!1}},emits:["editUser","changeUserRole","deleteUser","searchChange","resendInvite"],created:function(){this.onUserTextFilterChange=Object(g["debounce"])(this.onUserTextFilterChange,300)},watch:{users:function(){this.clearSelection()}},methods:{getInviteStatus:function(e){return Number.isInteger(e)?Object(g["translate"])("UsersManager_InviteDayLeft",e):"expired"===e?Object(g["translate"])("UsersManager_Expired"):Object(g["translate"])("UsersManager_Active")},onPermissionsForUpdate:function(e){this.permissionsForSite=e,this.changeSearch({idSite:this.permissionsForSite.id})},clearSelection:function(){this.selectedRows={},this.areAllResultsSelected=!1,this.isBulkActionsDisabled=!0,this.isAllCheckboxSelected=!1,this.userToChange=null},onAllCheckboxChange:function(){if(this.isAllCheckboxSelected){for(var e=0;e!==this.users.length;e+=1)this.selectedRows[e]=!0;this.isBulkActionsDisabled=!1}else this.clearSelection()},changeUserRole:function(){this.$emit("changeUserRole",{users:this.userOperationSubject,role:this.roleToChangeTo})},onRowSelected:function(){var e=this.selectedCount;this.isBulkActionsDisabled=0===e,this.isAllCheckboxSelected=e===this.users.length},deleteRequestedUsers:function(e){this.$emit("deleteUser",{users:this.userOperationSubject,password:e})},resendRequestedUser:function(){this.$emit("resendInvite",{user:this.userToChange})},showDeleteConfirm:function(){this.showPasswordConfirmationForUserRemoval=!0},showAccessChangeConfirm:function(){Rn(this.$refs.changeUserRoleConfirmModal).modal({dismissible:!1}).modal("open")},getRoleDisplay:function(e){var t=null;return this.accessLevels.forEach((function(n){n.key===e&&(t=n.value)})),t},changeSearch:function(e){var t=Object.assign(Object.assign({},this.searchParams),e);this.$emit("searchChange",{params:t})},gotoPreviousPage:function(){this.changeSearch({offset:Math.max(0,this.searchParams.offset-this.searchParams.limit)})},gotoNextPage:function(){var e=this.searchParams.offset+this.searchParams.limit;e>=this.totalEntries||this.changeSearch({offset:e})},onUserTextFilterChange:function(e){this.userTextFilter=e,this.changeSearch({filter_search:e,offset:0})}},computed:{currentUserLogin:function(){return g["Matomo"].userLogin},paginationLowerBound:function(){return this.searchParams.offset+1},paginationUpperBound:function(){if(null===this.totalEntries)return"?";var e=this.searchParams;return Math.min(e.offset+e.limit,this.totalEntries)},userOperationSubject:function(){return this.userToChange?[this.userToChange]:this.areAllResultsSelected?"all":this.selectedUsers},selectedUsers:function(){var e=this,t=this.users,n=[];return Object.keys(this.selectedRows).forEach((function(s){var r=parseInt(s,10);e.selectedRows[s]&&t[r]&&n.push(t[r])})),n},rolesHelpText:function(){var e="https://matomo.org/faq/general/faq_70/",t="https://matomo.org/faq/general/faq_69/";return Object(g["translate"])("UsersManager_RolesHelp",''),"",''),"")},affectedUsersCount:function(){return this.areAllResultsSelected?this.totalEntries||0:this.selectedCount},selectedCount:function(){var e=this,t=0;return Object.keys(this.selectedRows).forEach((function(n){e.selectedRows[n]&&(t+=1)})),t},deleteUserPermConfirmSingleText:function(){var e,t;return Object(g["translate"])("UsersManager_DeleteUserPermConfirmSingle","".concat((null===(e=this.userToChange)||void 0===e?void 0:e.login)||"",""),"".concat(this.getRoleDisplay(this.roleToChangeTo),""),"".concat(g["Matomo"].helper.htmlEntities((null===(t=this.permissionsForSite)||void 0===t?void 0:t.name)||""),""))},deleteUserPermConfirmMultipleText:function(){var e;return Object(g["translate"])("UsersManager_DeleteUserPermConfirmMultiple","".concat(this.affectedUsersCount,""),"".concat(this.getRoleDisplay(this.roleToChangeTo),""),"".concat(g["Matomo"].helper.htmlEntities((null===(e=this.permissionsForSite)||void 0===e?void 0:e.name)||""),""))},bulkActionAccessLevels:function(){return this.accessLevels.filter((function(e){return"noaccess"!==e.key&&"superuser"!==e.key}))},anonymousAccessLevels:function(){return this.accessLevels.filter((function(e){return"noaccess"===e.key||"view"===e.key}))},onlyRoleAccessLevels:function(){return this.accessLevels.filter((function(e){return"role"===e.type}))}}});Fn.render=Ln;var Hn=Fn,In={class:"usersManager"},qn={key:0},$n={key:1},Gn={class:"row add-user-container"},zn={class:"col s12"},Wn={class:"input-field",style:{"margin-right":"3.5px"}},Yn={key:0,class:"input-field"},Xn={key:0},Jn={class:"resend-invite-confirm-modal modal",ref:"resendInviteConfirmModal"},Kn=Object(o["createElementVNode"])("div",{class:"btn-close modal-close"},[Object(o["createElementVNode"])("i",{class:"icon-close"})],-1),Qn={class:"modal-content"},Zn={class:"modal-title"},es=["innerHTML"],ts={class:"modal-footer"},ns={key:0,class:"success-copied"},ss=Object(o["createElementVNode"])("i",{class:"icon-success"},null,-1),rs={class:"add-existing-user-modal modal",ref:"addExistingUserModal"},os={class:"modal-content"},is={class:"modal-footer"};function as(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("EnrichedHeadline"),l=Object(o["resolveComponent"])("PagedUsersList"),c=Object(o["resolveComponent"])("UserEditForm"),d=Object(o["resolveComponent"])("Field"),u=Object(o["resolveComponent"])("PasswordConfirmation"),m=Object(o["resolveDirective"])("content-intro"),b=Object(o["resolveDirective"])("tooltips");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",In,[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("h2",null,[Object(o["createVNode"])(a,{"help-url":"https://matomo.org/docs/manage-users/","feature-name":"Users Management"},{default:Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_ManageUsers")),1)]})),_:1})]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",qn,Object(o["toDisplayString"])(e.translate("UsersManager_ManageUsersDesc")),1)):Object(o["createCommentVNode"])("",!0),"admin"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",$n,Object(o["toDisplayString"])(e.translate("UsersManager_ManageUsersAdminDesc")),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Gn,[Object(o["createElementVNode"])("div",zn,[Object(o["createElementVNode"])("div",Wn,[Object(o["createElementVNode"])("a",{class:"btn add-new-user",onClick:t[0]||(t[0]=function(t){return e.onAddNewUser()})},Object(o["toDisplayString"])(e.translate("UsersManager_InviteNewUser")),1)]),"superuser"!==e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Yn,[Object(o["createElementVNode"])("a",{class:"btn add-existing-user",onClick:t[1]||(t[1]=function(t){return e.showAddExistingUserModal()})},Object(o["toDisplayString"])(e.translate("UsersManager_AddExistingUser")),1)])):Object(o["createCommentVNode"])("",!0)])]),Object(o["createVNode"])(l,{onEditUser:t[2]||(t[2]=function(t){return e.onEditUser(t.user)}),onChangeUserRole:t[3]||(t[3]=function(t){return e.onChangeUserRole(t.users,t.role)}),onDeleteUser:t[4]||(t[4]=function(t){return e.onDeleteUser(t.users,t.password)}),onSearchChange:t[5]||(t[5]=function(t){e.searchParams=t.params,e.fetchUsers()}),onResendInvite:t[6]||(t[6]=function(t){return e.showResendPopup(t.user)}),"initial-site-id":e.initialSiteId,"initial-site-name":e.initialSiteName,"is-loading-users":e.isLoadingUsers,"current-user-role":e.currentUserRole,"access-levels":e.accessLevels,"filter-access-levels":e.filterAccessLevels,"filter-status-levels":e.filterStatusLevels,"search-params":e.searchParams,users:e.users,"total-entries":e.totalEntries},null,8,["initial-site-id","initial-site-name","is-loading-users","current-user-role","access-levels","filter-access-levels","filter-status-levels","search-params","users","total-entries"])],512),[[m]])],512),[[o["vShow"],!e.isEditing]]),e.isEditing?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Xn,[Object(o["createVNode"])(c,{onDone:t[7]||(t[7]=function(t){return e.onDoneEditing(t.isUserModified)}),user:e.userBeingEdited,"current-user-role":e.currentUserRole,"invite-token-expiry-days":e.inviteTokenExpiryDays,"access-levels":e.accessLevels,"filter-access-levels":e.filterAccessLevels,"initial-site-id":e.initialSiteId,"initial-site-name":e.initialSiteName,onResendInvite:t[8]||(t[8]=function(t){return e.showResendPopup(t.user)}),onUpdated:t[9]||(t[9]=function(t){return e.userBeingEdited=t.user})},null,8,["user","current-user-role","invite-token-expiry-days","access-levels","filter-access-levels","initial-site-id","initial-site-name"])])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Jn,[Kn,Object(o["createElementVNode"])("div",Qn,[Object(o["createElementVNode"])("h2",Zn,Object(o["toDisplayString"])(e.translate("UsersManager_ResendInvite")),1),e.userBeingEdited?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",{key:0,innerHTML:e.$sanitize(e.translate("UsersManager_InviteConfirmMessage",["".concat(e.userBeingEdited.login,""),"".concat(e.userBeingEdited.email,"")]))},null,8,es)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("p",null,[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("UsersManager_InviteActionNotes",e.inviteTokenExpiryDays)),1)])]),Object(o["createElementVNode"])("div",ts,[e.copied?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",ns,[ss,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_LinkCopied")),1)])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("button",{onClick:t[10]||(t[10]=function(t){return e.showInviteActionPasswordConfirm("copy")}),class:"btn btn-copy-link modal-action",style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("UsersManager_CopyLink")),1),Object(o["createElementVNode"])("button",{class:"btn btn-resend modal-action modal-no",onClick:t[11]||(t[11]=function(t){return e.showInviteActionPasswordConfirm("send")})},Object(o["toDisplayString"])(e.translate("UsersManager_ResendInvite")),1)])],512),Object(o["createElementVNode"])("div",rs,[Object(o["createElementVNode"])("div",os,[Object(o["createElementVNode"])("h3",null,Object(o["toDisplayString"])(e.translate("UsersManager_AddExistingUser")),1),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_EnterUsernameOrEmail"))+":",1),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(d,{modelValue:e.addNewUserLoginEmail,"onUpdate:modelValue":t[12]||(t[12]=function(t){return e.addNewUserLoginEmail=t}),name:"add-existing-user-email",uicontrol:"text"},null,8,["modelValue"])])]),Object(o["createElementVNode"])("div",is,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[13]||(t[13]=Object(o["withModifiers"])((function(t){return e.addExistingUser()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Add")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[14]||(t[14]=Object(o["withModifiers"])((function(t){return e.addNewUserLoginEmail=null}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_Cancel")),1)])],512),Object(o["createVNode"])(u,{modelValue:e.showPasswordConfirmationForInviteAction,"onUpdate:modelValue":t[15]||(t[15]=function(t){return e.showPasswordConfirmationForInviteAction=t}),onConfirmed:e.onInviteAction},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])],512)),[[b]])}var ls=20,cs=window,ds=cs.$,us=Object(o["defineComponent"])({props:{currentUserRole:{type:String,required:!0},initialSiteName:{type:String,required:!0},initialSiteId:{type:String,required:!0},accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0},filterStatusLevels:{type:Array,required:!0},inviteTokenExpiryDays:{type:String,required:!0}},components:{PasswordConfirmation:f["PasswordConfirmation"],EnrichedHeadline:g["EnrichedHeadline"],PagedUsersList:Hn,UserEditForm:ht,Field:f["Field"]},directives:{ContentIntro:g["ContentIntro"],Tooltips:g["Tooltips"]},data:function(){return{isEditing:!!g["MatomoUrl"].urlParsed.value.showadduser,isCurrentUserSuperUser:!0,users:[],totalEntries:null,searchParams:{offset:0,limit:ls,filter_search:"",filter_access:"",filter_status:"",idSite:this.initialSiteId},isLoadingUsers:!1,userBeingEdited:null,addNewUserLoginEmail:"",copied:!1,loading:!1,showPasswordConfirmationForInviteAction:!1,inviteAction:""}},created:function(){this.fetchUsers()},watch:{limit:function(){this.fetchUsers()}},methods:{showInviteActionPasswordConfirm:function(e){this.loading||(this.showPasswordConfirmationForInviteAction=!0,this.inviteAction=e)},showResendPopup:function(e){this.userBeingEdited=e,ds(this.$refs.resendInviteConfirmModal).modal({dismissible:!1}).modal("open"),this.copied=!1},onInviteAction:function(e){"send"===this.inviteAction?this.onResendInvite(e):this.generateInviteLink(e)},onEditUser:function(e){g["Matomo"].helper.lazyScrollToContent(),this.isEditing=!0,this.userBeingEdited=e},onDoneEditing:function(e){this.isEditing=!1,e&&this.fetchUsers()},showAddExistingUserModal:function(){ds(this.$refs.addExistingUserModal).modal({dismissible:!1}).modal("open")},onChangeUserRole:function(e,t){var n=this;this.isLoadingUsers=!0,Promise.resolve().then((function(){return"all"===e?n.getAllUsersInSearch():e})).then((function(e){return e.filter((function(e){return"superuser"!==e.role})).map((function(e){return e.login}))})).then((function(e){var s,r=n.accessLevels.filter((function(e){return e.key===t})).map((function(e){return e.type}));return s=r.length&&"capability"===r[0]?e.map((function(e){return{method:"UsersManager.addCapabilities",userLogin:e,capabilities:t,idSites:n.searchParams.idSite}})):e.map((function(e){return{method:"UsersManager.setUserAccess",userLogin:e,access:t,idSites:n.searchParams.idSite}})),g["AjaxHelper"].fetch(s,{createErrorNotification:!0})})).catch((function(){})).then((function(){return n.fetchUsers()}))},getAllUsersInSearch:function(){return g["AjaxHelper"].fetch({method:"UsersManager.getUsersPlusRole",filter_search:this.searchParams.filter_search,filter_access:this.searchParams.filter_access,filter_status:this.searchParams.filter_status,idSite:this.searchParams.idSite,filter_limit:"-1"})},onDeleteUser:function(e,t){var n=this;this.isLoadingUsers=!0,Promise.resolve().then((function(){return"all"===e?n.getAllUsersInSearch():e})).then((function(e){return e.map((function(e){return e.login}))})).then((function(e){var n=e.map((function(e){return{method:"UsersManager.deleteUser",userLogin:e,passwordConfirmation:t}}));return g["AjaxHelper"].fetch(n,{createErrorNotification:!0})})).then((function(){g["NotificationsStore"].scrollToNotification(g["NotificationsStore"].show({id:"removeUserSuccess",message:Object(g["translate"])("UsersManager_DeleteSuccess"),context:"success",type:"toast"})),n.fetchUsers()}),(function(){"all"!==e&&e.length>1&&g["NotificationsStore"].show({id:"removeUserSuccess",message:Object(g["translate"])("UsersManager_DeleteNotSuccessful"),context:"warning",type:"toast"}),n.fetchUsers()}))},generateInviteLink:async function(e){if(!this.loading){this.loading=!0;try{var t=await g["AjaxHelper"].post({method:"UsersManager.generateInviteLink"},{userLogin:this.userBeingEdited.login,passwordConfirmation:e});await this.copyToClipboard(t.value)}catch(n){}this.loading=!1}},copyToClipboard:async function(e){try{var t=document.createElement("input");t.style.top="-100px",t.style.left="0",t.style.position="fixed",t.value=e,document.body.appendChild(t),t.select(),"https:"!==window.location.protocol?document.execCommand("copy"):await navigator.clipboard.writeText(t.value),document.body.removeChild(t),this.copied=!0}catch(s){var n=g["NotificationsStore"].show({message:"".concat(Object(g["translate"])("UsersManager_CopyDenied"),"
\n").concat(Object(g["translate"])("UsersManager_CopyDeniedHints",['
'.concat(e,"")])),id:"copyError",context:"error",type:"transient"});g["NotificationsStore"].scrollToNotification(n)}},onResendInvite:function(e){var t=this;""!==e&&g["AjaxHelper"].post({method:"UsersManager.resendInvite",userLogin:this.userBeingEdited.login},{passwordConfirmation:e}).then((function(){t.fetchUsers(),ds(t.$refs.resendInviteConfirmModal).modal("close");var e=g["NotificationsStore"].show({message:Object(g["translate"])("UsersManager_InviteSuccess"),id:"resendInvite",context:"success",type:"transient"});g["NotificationsStore"].scrollToNotification(e)}))},fetchUsers:function(){var e=this;return this.isLoadingUsers=!0,g["AjaxHelper"].fetch(Object.assign(Object.assign({},this.searchParams),{},{method:"UsersManager.getUsersPlusRole"}),{returnResponseObject:!0}).then((function(t){var n=t.getRequestHandle();e.totalEntries=parseInt(n.getResponseHeader("x-matomo-total-results")||"0",10),e.users=n.responseJSON,e.isLoadingUsers=!1})).catch((function(){e.isLoadingUsers=!1}))},addExistingUser:function(){var e=this;return this.isLoadingUsers=!0,g["AjaxHelper"].fetch({method:"UsersManager.userExists",userLogin:this.addNewUserLoginEmail}).then((function(t){return t&&t.value?e.addNewUserLoginEmail:g["AjaxHelper"].fetch({method:"UsersManager.getUserLoginFromUserEmail",userEmail:e.addNewUserLoginEmail}).then((function(e){return e.value}))})).then((function(t){return g["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:t,access:"view",idSites:e.searchParams.idSite})})).then((function(){return e.fetchUsers()})).catch((function(){e.isLoadingUsers=!1}))},onAddNewUser:function(){var e={isAllowed:!0};g["Matomo"].postEvent("UsersManager.initAddUser",e),e&&!e.isAllowed||(this.isEditing=!0,this.userBeingEdited=null)}}});us.render=as;var ms=us,bs={key:0,class:"alert alert-info"},ps={key:1};function gs(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("SaveButton"),c=Object(o["resolveComponent"])("ContentBlock"),d=Object(o["resolveDirective"])("form");return Object(o["openBlock"])(),Object(o["createBlock"])(c,{"content-title":e.title},{default:Object(o["withCtx"])((function(){return[0===e.anonymousSites.length?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",bs,Object(o["toDisplayString"])(e.translate("UsersManager_NoteNoAnonymousUserAccessSettingsWontBeUsed2")),1)):Object(o["createCommentVNode"])("",!0),e.anonymousSites.length>0?Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ps,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"radio",name:"anonymousDefaultReport",modelValue:e.defaultReport,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.defaultReport=t}),introduction:e.translate("UsersManager_WhenUsersAreNotLoggedInAndVisitPiwikTheyShouldAccess"),options:e.defaultReportOptions},null,8,["modelValue","introduction","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"select",name:"anonymousDefaultReportWebsite",modelValue:e.defaultReportWebsite,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.defaultReportWebsite=t}),options:e.anonymousSites},null,8,["modelValue","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"radio",name:"anonymousDefaultDate",modelValue:e.defaultDate,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.defaultDate=t}),introduction:e.translate("UsersManager_ForAnonymousUsersReportDateToLoadByDefault"),options:e.availableDefaultDates},null,8,["modelValue","introduction","options"])]),Object(o["createVNode"])(l,{saving:e.loading,onConfirm:t[3]||(t[3]=function(t){return e.save()})},null,8,["saving"])],512)),[[d]]):Object(o["createCommentVNode"])("",!0)]})),_:1},8,["content-title"])}var fs=Object(o["defineComponent"])({props:{title:{type:String,required:!0},anonymousSites:{type:Array,required:!0},anonymousDefaultReport:{type:[String,Number],required:!0},anonymousDefaultSite:{type:String,required:!0},anonymousDefaultDate:{type:String,required:!0},availableDefaultDates:{type:Object,required:!0},defaultReportOptions:{type:Object,required:!0}},components:{ContentBlock:g["ContentBlock"],SaveButton:f["SaveButton"],Field:f["Field"]},directives:{Form:f["Form"]},data:function(){return{loading:!1,defaultReport:"".concat(this.anonymousDefaultReport),defaultReportWebsite:this.anonymousDefaultSite,defaultDate:this.anonymousDefaultDate}},methods:{save:function(){var e=this,t={anonymousDefaultReport:"1"===this.defaultReport?this.defaultReportWebsite:this.defaultReport,anonymousDefaultDate:this.defaultDate};this.loading=!0,g["AjaxHelper"].post({module:"UsersManager",action:"recordAnonymousUserSettings",format:"json"},t,{withTokenInUrl:!0}).then((function(){var e=g["NotificationsStore"].show({message:Object(g["translate"])("CoreAdminHome_SettingsSaveSuccess"),id:"anonymousUserSettings",context:"success",type:"transient"});g["NotificationsStore"].scrollToNotification(e)})).finally((function(){e.loading=!1}))}}});fs.render=gs;var hs=fs,Os={id:"newsletterSignup"};function js(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("SaveButton"),c=Object(o["resolveComponent"])("ContentBlock");return Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Os,[Object(o["createVNode"])(c,{"content-title":e.translate("UsersManager_NewsletterSignupTitle")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"checkbox",name:"newsletterSignupCheckbox",id:"newsletterSignupCheckbox",modelValue:e.newsletterSignupCheckbox,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.newsletterSignupCheckbox=t}),"full-width":!0,title:e.signupTitleText},null,8,["modelValue","title"])]),Object(o["createVNode"])(l,{id:"newsletterSignupBtn",onConfirm:t[1]||(t[1]=function(t){return e.signupForNewsletter()}),disabled:!e.newsletterSignupCheckbox,value:e.newsletterSignupButtonTitle,saving:e.isProcessingNewsletterSignup},null,8,["disabled","value","saving"])]})),_:1},8,["content-title"])],512)),[[o["vShow"],e.showNewsletterSignup]])}var vs=Object(o["defineComponent"])({data:function(){return{showNewsletterSignup:!0,newsletterSignupCheckbox:!1,isProcessingNewsletterSignup:!1,newsletterSignupButtonTitle:Object(g["translate"])("General_Save")}},components:{ContentBlock:g["ContentBlock"],SaveButton:f["SaveButton"],Field:f["Field"]},computed:{signupTitleText:function(){return Object(g["translate"])("UsersManager_NewsletterSignupMessage",'',"")}},methods:{signupForNewsletter:function(){var e=this;this.newsletterSignupButtonTitle=Object(g["translate"])("General_Loading"),this.isProcessingNewsletterSignup=!0,g["AjaxHelper"].fetch({module:"API",method:"UsersManager.newsletterSignup"},{withTokenInUrl:!0}).then((function(){e.isProcessingNewsletterSignup=!1,e.showNewsletterSignup=!1;var t=g["NotificationsStore"].show({message:Object(g["translate"])("UsersManager_NewsletterSignupSuccessMessage"),id:"newslettersignup",context:"success",type:"transient"});g["NotificationsStore"].scrollToNotification(t)})).catch((function(){e.isProcessingNewsletterSignup=!1;var t=g["NotificationsStore"].show({message:Object(g["translate"])("UsersManager_NewsletterSignupFailureMessage"),id:"newslettersignup",context:"error",type:"transient"});g["NotificationsStore"].scrollToNotification(t),e.newsletterSignupButtonTitle=Object(g["translate"])("General_PleaseTryAgain")}))}}});vs.render=js;var Cs=vs,ys={id:"userSettingsTable"},ks={key:0},Ns={id:"languageHelp",class:"inline-help-node"},Ss={target:"_blank",rel:"noreferrer noopener",href:"https://matomo.org/translations/"},Vs={class:"sites_autocomplete"};function Us(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("SiteSelector"),c=Object(o["resolveComponent"])("SaveButton"),d=Object(o["resolveComponent"])("PasswordConfirmation"),u=Object(o["resolveComponent"])("ContentBlock"),m=Object(o["resolveDirective"])("form");return Object(o["openBlock"])(),Object(o["createBlock"])(u,{"content-title":e.title,feature:"true"},{default:Object(o["withCtx"])((function(){return[Object(o["withDirectives"])(Object(o["createElementVNode"])("form",ys,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"text",name:"username",title:e.translate("General_Username"),disabled:!0,modelValue:e.username,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.username=t}),"inline-help":e.translate("UsersManager_YourUsernameCannotBeChanged")},null,8,["title","modelValue","inline-help"])]),e.isUsersAdminEnabled?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ks,[Object(o["createVNode"])(a,{uicontrol:"text",name:"email","model-value":e.email,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.email=t,e.doesRequirePasswordConfirmation=!0}),maxlength:100,title:e.translate("UsersManager_Email")},null,8,["model-value","title"])])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Ns,[Object(o["createElementVNode"])("a",Ss,Object(o["toDisplayString"])(e.translate("LanguagesManager_AboutPiwikTranslations")),1)]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"select",name:"language",modelValue:e.language,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.language=t}),title:e.translate("General_Language"),options:e.languageOptions,"inline-help":"#languageHelp"},null,8,["modelValue","title","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"select",name:"timeformat",modelValue:e.timeformat,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.timeformat=t}),title:e.translate("General_TimeFormat"),options:e.timeFormats},null,8,["modelValue","title","options"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"radio",name:"defaultReport",modelValue:e.theDefaultReport,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.theDefaultReport=t}),introduction:e.translate("UsersManager_ReportToLoadByDefault"),title:e.translate("General_AllWebsitesDashboard"),options:e.defaultReportOptions},null,8,["modelValue","introduction","title","options"])]),Object(o["createElementVNode"])("div",Vs,[Object(o["createVNode"])(l,{modelValue:e.site,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.site=t}),"show-selected-site":!0,"switch-site-on-select":!1,"show-all-sites-item":!1,showselectedsite:!0,id:"defaultReportSiteSelector"},null,8,["modelValue"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{uicontrol:"radio",name:"defaultDate",modelValue:e.theDefaultDate,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.theDefaultDate=t}),introduction:e.translate("UsersManager_ReportDateToLoadByDefault"),options:e.availableDefaultDates},null,8,["modelValue","introduction","options"])]),Object(o["createVNode"])(c,{onConfirm:t[7]||(t[7]=function(t){return e.save()}),saving:e.loading},null,8,["saving"]),Object(o["createVNode"])(d,{modelValue:e.showPasswordConfirmation,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.showPasswordConfirmation=t}),onConfirmed:e.doSave},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1)]})),_:1},8,["modelValue","onConfirmed"])],512),[[m]])]})),_:1},8,["content-title"])}var Es=Object(o["defineComponent"])({props:{isUsersAdminEnabled:{type:Boolean,required:!0},title:{type:String,required:!0},userLogin:{type:String,required:!0},userEmail:{type:String,required:!0},currentLanguageCode:{type:String,required:!0},languageOptions:{type:Object,required:!0},currentTimeformat:{type:Number,required:!0},timeFormats:{type:Object,required:!0},defaultReport:{type:[String,Number],required:!0},defaultReportOptions:{type:Object,required:!0},defaultReportIdSite:{type:[String,Number],required:!0},defaultReportSiteName:{type:String,required:!0},defaultDate:{type:String,required:!0},availableDefaultDates:{type:Object,required:!0}},components:{ContentBlock:g["ContentBlock"],SaveButton:f["SaveButton"],Field:f["Field"],SiteSelector:g["SiteSelector"],PasswordConfirmation:f["PasswordConfirmation"]},directives:{Form:f["Form"]},data:function(){return{doesRequirePasswordConfirmation:!1,username:this.userLogin,email:this.userEmail,language:this.currentLanguageCode,timeformat:this.currentTimeformat,theDefaultReport:this.defaultReport,site:{id:this.defaultReportIdSite,name:g["Matomo"].helper.htmlDecode(this.defaultReportSiteName)},theDefaultDate:this.defaultDate,loading:!1,showPasswordConfirmation:!1}},methods:{save:function(){this.doesRequirePasswordConfirmation?this.showPasswordConfirmation=!0:this.doSave()},doSave:function(e){var t=this,n={email:this.email,defaultReport:"MultiSites"===this.theDefaultReport?this.theDefaultReport:this.site.id,defaultDate:this.theDefaultDate,language:this.language,timeformat:this.timeformat};e&&(n.passwordConfirmation=e),this.loading=!0,g["AjaxHelper"].post({module:"UsersManager",action:"recordUserSettings",format:"json"},n,{withTokenInUrl:!0}).then((function(){var e=g["NotificationsStore"].show({message:Object(g["translate"])("CoreAdminHome_SettingsSaveSuccess"),id:"PersonalSettingsSuccess",context:"success",type:"transient"});g["NotificationsStore"].scrollToNotification(e),t.doesRequirePasswordConfirmation=!1,t.loading=!1})).catch((function(){t.loading=!1}))}}});Es.render=Us;var ws=Es,As={key:0},Ts={key:1,class:"alert alert-danger"},Ms=["action"],Bs=["value"],_s=["value"],Ds=["innerHTML"];function xs(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("ContentBlock");return Object(o["openBlock"])(),Object(o["createBlock"])(l,{"content-title":e.translate("UsersManager_AuthTokens")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_TokenAuthIntro")),1),e.noDescription?(Object(o["openBlock"])(),Object(o["createElementBlock"])("br",As)):Object(o["createCommentVNode"])("",!0),e.noDescription?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ts,Object(o["toDisplayString"])(e.translate("General_Description"))+": "+Object(o["toDisplayString"])(e.translate("General_ValidatorErrorEmptyValue")),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("form",{action:e.addNewTokenFormUrl,method:"post",class:"addTokenForm"},[Object(o["createVNode"])(a,{uicontrol:"text",name:"description",title:e.translate("General_Description"),maxlength:100,required:!0,"inline-help":e.translate("UsersManager_AuthTokenPurpose"),modelValue:e.tokenDescription,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.tokenDescription=t})},null,8,["title","inline-help","modelValue"]),Object(o["createVNode"])(a,{uicontrol:"checkbox",name:"post_only",title:e.translate("UsersManager_OnlyAllowPostRequests"),required:!1,"inline-help":e.postOnlyHelp,modelValue:e.tokenPostOnly,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.tokenPostOnly=t}),disabled:e.forcePostOnlyCalc},null,8,["title","inline-help","modelValue","disabled"]),Object(o["createElementVNode"])("input",{type:"hidden",value:e.formNonce,name:"nonce"},null,8,Bs),Object(o["createElementVNode"])("input",{type:"submit",value:e.translate("UsersManager_CreateNewToken"),class:"btn",style:{"margin-right":"3.5px"}},null,8,_s),Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.cancelLink)},null,8,Ds)],8,Ms)]})),_:1},8,["content-title"])}var Ls=Object(o["defineComponent"])({props:{formNonce:String,noDescription:Boolean,forcePostOnly:Boolean},components:{ContentBlock:g["ContentBlock"],Field:f["Field"]},data:function(){return{tokenDescription:"",tokenPostOnly:!0}},computed:{addNewTokenFormUrl:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"addNewToken"})))},cancelLink:function(){var e="?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"userSecurity"})));return Object(g["translate"])("General_OrCancel",""),"")},forcePostOnlyCalc:function(){return this.forcePostOnly},postOnlyHelp:function(){return this.forcePostOnly?Object(g["translate"])("UsersManager_AuthTokenPostOnlyHelpForced"):Object(g["translate"])("UsersManager_AuthTokenPostOnlyHelp")}}});Ls.render=xs;var Ps=Ls,Rs=Object(o["createElementVNode"])("br",null,null,-1),Fs={style:{"font-size":"40px"},class:"generatedTokenAuth"},Hs=["href"];function Is(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("ContentBlock"),l=Object(o["resolveDirective"])("copy-to-clipboard");return Object(o["openBlock"])(),Object(o["createBlock"])(a,{"content-title":e.translate("UsersManager_TokenSuccessfullyGenerated")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_PleaseStoreToken"))+" ",1),Rs,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_DoNotStoreToken")),1)]),Object(o["createElementVNode"])("div",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("pre",Fs,[Object(o["createElementVNode"])("code",null,Object(o["toDisplayString"])(e.generatedToken),1)],512),[[l,{}]])]),Object(o["createElementVNode"])("a",{href:e.userSecurityLink,class:"btn",style:{height:"auto"}},Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmTokenCopied"))+" "+Object(o["toDisplayString"])(e.translate("UsersManager_GoBackSecurityPage")),9,Hs)]})),_:1},8,["content-title"])}var qs=Object(o["defineComponent"])({props:{generatedToken:{type:String,required:!0}},components:{ContentBlock:g["ContentBlock"]},directives:{CopyToClipboard:g["CopyToClipboard"]},computed:{userSecurityLink:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"userSecurity"})))}}});qs.render=Is;var $s=qs,Gs=["action"],zs=["value"],Ws={key:0},Ys={class:"alert alert-info"},Xs=["value"],Js={key:1},Ks={class:"alert alert-danger"},Qs=["innerHTML"],Zs={ref:"afterPassword"},er=Object(o["createElementVNode"])("a",{name:"authtokens",id:"authtokens"},null,-1),tr={key:0},nr={class:"listAuthTokens"},sr=["title"],rr={key:0},or=["colspan","innerHTML"],ir={class:"creationDate"},ar=["title"],lr=["action"],cr=["value"],dr=["value"],ur=["title"],mr=Object(o["createElementVNode"])("span",{class:"icon-delete"},null,-1),br=[mr],pr={class:"tableActionBar"},gr=["href"],fr=Object(o["createElementVNode"])("span",{class:"icon-add"},null,-1),hr=["action"],Or=["value"],jr=Object(o["createElementVNode"])("input",{name:"idtokenauth",type:"hidden",value:"all"},null,-1),vr={type:"submit",class:"table-action"},Cr=Object(o["createElementVNode"])("span",{class:"icon-delete"},null,-1);function yr(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("ContentBlock"),c=Object(o["resolveDirective"])("content-table");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[e.isUsersAdminEnabled?(Object(o["openBlock"])(),Object(o["createBlock"])(l,{key:0,"content-title":e.translate("General_ChangePassword"),feature:"true"},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("form",{id:"userSettingsTable",method:"post",action:e.recordPasswordChangeAction},[Object(o["createElementVNode"])("input",{type:"hidden",value:e.changePasswordNonce,name:"nonce"},null,8,zs),e.isValidHost?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ws,[Object(o["createVNode"])(a,{uicontrol:"password",name:"password",autocomplete:!1,modelValue:e.password,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.password=t}),title:e.translate("Login_NewPassword"),"inline-help":e.translate("UsersManager_IfYouWouldLikeToChangeThePasswordTypeANewOne")},null,8,["modelValue","title","inline-help"]),Object(o["createVNode"])(a,{uicontrol:"password",name:"passwordBis",autocomplete:!1,modelValue:e.passwordBis,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.passwordBis=t}),title:e.translate("Login_NewPasswordRepeat"),"inline-help":e.translate("UsersManager_TypeYourPasswordAgain")},null,8,["modelValue","title","inline-help"]),Object(o["createVNode"])(a,{uicontrol:"password",name:"passwordConfirmation",autocomplete:!1,modelValue:e.passwordConfirmation,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.passwordConfirmation=t}),title:e.translate("UsersManager_YourCurrentPassword"),"inline-help":e.translate("UsersManager_TypeYourCurrentPassword")},null,8,["modelValue","title","inline-help"]),Object(o["createElementVNode"])("div",Ys,Object(o["toDisplayString"])(e.translate("UsersManager_PasswordChangeTerminatesOtherSessions")),1),Object(o["createElementVNode"])("input",{type:"submit",value:e.translate("General_Save"),class:"btn"},null,8,Xs)])):Object(o["createCommentVNode"])("",!0),e.isValidHost?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Js,[Object(o["createElementVNode"])("div",Ks,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_InjectedHostCannotChangePwd",e.invalidHost))+" ",1),e.isSuperUser?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.emailYourAdminText)},null,8,Qs))])]))],8,Gs)]})),_:1},8,["content-title"])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",Zs,[e.isUsersAdminEnabled&&e.afterPasswordComponent?(Object(o["openBlock"])(),Object(o["createBlock"])(Object(o["resolveDynamicComponent"])(e.afterPasswordComponent),{key:0})):Object(o["createCommentVNode"])("",!0)],512),er,Object(o["createVNode"])(l,{"content-title":e.translate("UsersManager_AuthTokens")},{default:Object(o["withCtx"])((function(){var t,n;return[Object(o["createElementVNode"])("p",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_TokenAuthIntro"))+" ",1),e.hasTokensWithExpireDate?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",tr,Object(o["toDisplayString"])(e.translate("UsersManager_ExpiredTokensDeleteAutomatically")),1)):Object(o["createCommentVNode"])("",!0)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("table",nr,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_CreationDate")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Description")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("UsersManager_LastUsed")),1),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("UsersManager_PostOnly")),1),e.hasTokensWithExpireDate?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:0,title:e.translate("UsersManager_TokensWithExpireDateCreationBySystem")},Object(o["toDisplayString"])(e.translate("UsersManager_ExpireDate")),9,sr)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Actions")),1)])]),Object(o["createElementVNode"])("tbody",null,[null!==(t=e.tokens)&&void 0!==t&&t.length?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",rr,[Object(o["createElementVNode"])("td",{colspan:e.hasTokensWithExpireDate?5:4,innerHTML:e.$sanitize(e.noTokenCreatedYetText)},null,8,or)])),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.tokens||[],(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{key:t.idusertokenauth},[Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("span",ir,Object(o["toDisplayString"])(t.date_created),1)]),Object(o["createElementVNode"])("td",null,Object(o["toDisplayString"])(t.description),1),Object(o["createElementVNode"])("td",null,Object(o["toDisplayString"])(t.last_used?t.last_used:e.translate("General_Never")),1),Object(o["createElementVNode"])("td",null,Object(o["toDisplayString"])(1===parseInt(t.post_only,10)?e.translate("General_Yes"):e.translate("General_No")),1),e.hasTokensWithExpireDate?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",{key:0,title:e.translate("UsersManager_TokensWithExpireDateCreationBySystem")},Object(o["toDisplayString"])(t.date_expired?t.date_expired:e.translate("General_Never")),9,ar)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("form",{method:"post",action:e.deleteTokenAction,style:{display:"inline"}},[Object(o["createElementVNode"])("input",{name:"nonce",type:"hidden",value:e.deleteTokenNonce},null,8,cr),Object(o["createElementVNode"])("input",{name:"idtokenauth",type:"hidden",value:t.idusertokenauth},null,8,dr),Object(o["createElementVNode"])("button",{type:"submit",class:"table-action",title:e.translate("General_Delete")},br,8,ur)],8,lr)])])})),128))])],512),[[c]]),Object(o["createElementVNode"])("div",pr,[Object(o["createElementVNode"])("a",{href:e.addNewTokenLink,class:"addNewToken"},[fr,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_CreateNewToken")),1)],8,gr),null!==(n=e.tokens)&&void 0!==n&&n.length?(Object(o["openBlock"])(),Object(o["createElementBlock"])("form",{key:0,method:"post",action:e.deleteTokenAction,style:{display:"inline"}},[Object(o["createElementVNode"])("input",{name:"nonce",type:"hidden",value:e.deleteTokenNonce},null,8,Or),jr,Object(o["createElementVNode"])("button",vr,[Cr,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_DeleteAllTokens")),1)])],8,hr)):Object(o["createCommentVNode"])("",!0)])]})),_:1},8,["content-title"])])}var kr=Object(o["defineComponent"])({props:{deleteTokenNonce:String,tokens:Array,hasTokensWithExpireDate:Boolean,isUsersAdminEnabled:Boolean,changePasswordNonce:String,isValidHost:Boolean,isSuperUser:Boolean,invalidHost:String,afterPasswordEventContent:String,invalidHostMailLinkStart:String},components:{ContentBlock:g["ContentBlock"],Field:f["Field"]},directives:{ContentTable:g["ContentTable"]},data:function(){return{password:"",passwordBis:"",passwordConfirmation:""}},mounted:function(){var e=this.$refs.afterPassword;g["Matomo"].helper.compileVueEntryComponents(e)},computed:{recordPasswordChangeAction:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"recordPasswordChange"})))},emailYourAdminText:function(){return Object(g["translate"])("UsersManager_EmailYourAdministrator",this.invalidHostMailLinkStart||"","")},noTokenCreatedYetText:function(){var e="?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"addNewToken"})));return Object(g["translate"])("UsersManager_NoTokenCreatedYetCreateNow",''),"")},deleteTokenAction:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"deleteToken"})))},addNewTokenLink:function(){return"?".concat(g["MatomoUrl"].stringify(Object.assign(Object.assign({},g["MatomoUrl"].urlParsed.value),{},{module:"UsersManager",action:"addNewToken"})))},afterPasswordComponent:function(){if(!this.afterPasswordEventContent)return null;var e=this.$refs.afterPassword;return Object(o["markRaw"])({template:this.afterPasswordEventContent,beforeUnmount:function(){g["Matomo"].helper.destroyVueComponent(e)}})}}});kr.render=yr;var Nr=kr,Sr=["innerHTML"],Vr={style:{"margin-left":"20px"}},Ur=["href"],Er=Object(o["createElementVNode"])("br",null,null,-1);function wr(e,t,n,s,r,i){var a=Object(o["resolveComponent"])("PersonalSettings"),l=Object(o["resolveComponent"])("NewsletterSettings"),c=Object(o["resolveComponent"])("PluginSettings"),d=Object(o["resolveComponent"])("ContentBlock");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",null,[Object(o["createVNode"])(a,{"is-users-admin-enabled":e.isUsersAdminEnabled,title:e.title,"user-login":e.userLogin,"user-email":e.userEmail,"current-language-code":e.currentLanguageCode,"language-options":e.languageOptions,"current-timeformat":e.currentTimeformat,"time-formats":e.timeFormats,"default-report":e.defaultReport,"default-report-options":e.defaultReportOptions,"default-report-id-site":e.defaultReportIdSite,"default-report-site-name":e.defaultReportSiteName,"default-date":e.defaultDate,"available-default-dates":e.availableDefaultDates},null,8,["is-users-admin-enabled","title","user-login","user-email","current-language-code","language-options","current-timeformat","time-formats","default-report","default-report-options","default-report-id-site","default-report-site-name","default-date","available-default-dates"]),e.showNewsletterSignup?(Object(o["openBlock"])(),Object(o["createBlock"])(l,{key:0})):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(c,{mode:"user"}),Object(o["createVNode"])(d,{"content-title":e.translate("UsersManager_ExcludeVisitsViaCookie")},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("p",{innerHTML:e.$sanitize(e.yourVisitsAreText)},null,8,Sr),Object(o["createElementVNode"])("span",Vr,[Object(o["createElementVNode"])("a",{href:e.setIgnoreCookieLink},[Object(o["createTextVNode"])(" › "+Object(o["toDisplayString"])(e.ignoreCookieSet?e.translate("UsersManager_ClickHereToDeleteTheCookie"):e.translate("UsersManager_ClickHereToSetTheCookieOnDomain",e.piwikHost))+" ",1),Er],8,Ur)])]})),_:1},8,["content-title"])])}var Ar=Object(o["defineComponent"])({props:{isUsersAdminEnabled:{type:Boolean,required:!0},title:{type:String,required:!0},userLogin:{type:String,required:!0},userEmail:{type:String,required:!0},currentLanguageCode:{type:String,required:!0},languageOptions:{type:Object,required:!0},currentTimeformat:{type:Number,required:!0},timeFormats:{type:Object,required:!0},defaultReport:{type:[String,Number],required:!0},defaultReportOptions:{type:Object,required:!0},defaultReportIdSite:{type:[String,Number],required:!0},defaultReportSiteName:{type:String,required:!0},defaultDate:{type:String,required:!0},availableDefaultDates:{type:Object,required:!0},showNewsletterSignup:Boolean,ignoreCookieSet:Boolean,ignoreSalt:[String,Number,Boolean],piwikHost:{type:String,required:!0}},components:{ContentBlock:g["ContentBlock"],PersonalSettings:ws,NewsletterSettings:Cs,PluginSettings:f["PluginSettings"]},computed:{yourVisitsAreText:function(){return this.ignoreCookieSet?Object(g["translate"])("UsersManager_YourVisitsAreIgnoredOnDomain","",this.piwikHost,""):Object(g["translate"])("UsersManager_YourVisitsAreNotIgnored","","")},setIgnoreCookieLink:function(){return"?".concat(g["MatomoUrl"].stringify({ignoreSalt:this.ignoreSalt,module:"UsersManager",action:"setIgnoreCookie"}),"#excludeCookie")}}});Ar.render=wr;var Tr=Ar; /*! * Matomo - free/libre analytics platform * diff --git a/plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue b/plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue index f0243f9cce3..a30c2dd8fba 100644 --- a/plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue +++ b/plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue @@ -478,6 +478,7 @@ export default defineComponent({ this.isResetting2FA = true; return AjaxHelper.post({ method: 'TwoFactorAuth.resetTwoFactorAuth', + }, { userLogin: this.theUser.login, passwordConfirmation: password, }).catch((e) => { diff --git a/plugins/UsersManager/vue/src/UsersManager/UsersManager.vue b/plugins/UsersManager/vue/src/UsersManager/UsersManager.vue index 9612f43a612..f6c0125708a 100644 --- a/plugins/UsersManager/vue/src/UsersManager/UsersManager.vue +++ b/plugins/UsersManager/vue/src/UsersManager/UsersManager.vue @@ -386,9 +386,10 @@ export default defineComponent({ } this.loading = true; try { - const res = await AjaxHelper.fetch<{ value: string }>( + const res = await AjaxHelper.post<{ value: string }>( { method: 'UsersManager.generateInviteLink', + }, { userLogin: this.userBeingEdited!.login, passwordConfirmation: password, }, @@ -431,10 +432,12 @@ ${translate('UsersManager_CopyDeniedHints', [`
${va }, onResendInvite(password: string) { if (password === '') return; - AjaxHelper.fetch( + AjaxHelper.post( { method: 'UsersManager.resendInvite', userLogin: this.userBeingEdited!.login, + }, + { passwordConfirmation: password, }, ).then(() => {