(self["webpackJsonp@lyrio/ui"]=self["webpackJsonp@lyrio/ui"]||[]).push([[171],{1557:function(e,r,t){"use strict";t.r(r);var n,a=t(80),c=t(10),i=t.n(c),s=t(15),u=t(29),l=t(1),j=t(0),o=t(601),b=t(99),f=t(617),m=t(55),p=t(39),O=t(1799),d=t(738),h=t.n(d),v=t(9),x=t(22),y=t(183),P=t(686),g=t(37);!function(e){e.Profile="profile",e.Preference="preference",e.Security="security",e.Privilege="privilege",e.Audit="audit"}(n||(n={}));var w=function(e){var r=Object(x.i)("user_edit"),t=Object(p.e)(),a=Object(x.k)(),c=e.view,i=Object(j.useMemo)((function(){var r;return e.username===(null===(r=v.a.currentUser)||void 0===r?void 0:r.username)}),[]),s=v.a.currentUserPrivileges.length>0||v.a.currentUser.isAdmin||e.type===n.Privilege;return Object(l.jsx)(l.Fragment,{children:Object(l.jsxs)("div",{className:h.a.container,children:[Object(l.jsxs)("div",{className:h.a.menu,children:[Object(l.jsxs)(o.a,{secondary:!0,vertical:!0,children:[Object(l.jsxs)(o.a.Item,{active:e.type===n.Profile,as:x.a,href:"../profile",children:[Object(l.jsx)(b.a,{name:"user"}),r(".menu.profile")]}),Object(l.jsxs)(o.a.Item,{active:e.type===n.Preference,as:x.a,href:"../preference",children:[Object(l.jsx)(b.a,{name:"setting"}),r(".menu.preference")]}),Object(l.jsxs)(o.a.Item,{active:e.type===n.Security,as:x.a,href:"../security",children:[Object(l.jsx)(b.a,{name:"lock"}),r(".menu.security")]}),s&&Object(l.jsxs)(o.a.Item,{active:e.type===n.Privilege,as:x.a,href:"../privilege",children:[Object(l.jsx)(b.a,{name:"key"}),r(".menu.privilege")]}),Object(l.jsxs)(o.a.Item,{active:e.type===n.Audit,as:x.a,href:"../audit",children:[Object(l.jsxs)(b.a.Group,{children:[Object(l.jsx)(b.a,{name:"list alternate"}),Object(l.jsx)(b.a,{corner:!0,name:"check"})]}),r(".menu.audit")]})]}),!i&&Object(l.jsx)(f.a,{className:h.a.adminWarning,content:r(".admin_warning"),warning:!0}),Object(l.jsxs)(x.a,{href:"../..",children:[Object(l.jsx)(b.a,{name:"arrow left"}),r(i?".back_to_profile":".back_to_profile_of_user")]})]}),Object(l.jsx)("div",{className:h.a.main,children:Object(l.jsx)(c,Object(u.a)(Object(u.a)({},e.data),{},{onChangeUsername:function(e){var r=t.url.pathname.split("/");r[2]=e,a.navigate(r.join("/"))}}))})]})})};function k(e,r,t){return _.apply(this,arguments)}function _(){return(_=Object(s.a)(i.a.mark((function e(r,c,s){var u,j,o,b,f;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Object.values(n).includes(c)||(c=n.Profile),e.next=3,(u={},Object(a.a)(u,n.Profile,(function(){return Promise.all([t.e(0),t.e(1),t.e(3),t.e(4),t.e(5),t.e(10),t.e(32),t.e(77),t.e(125),t.e(9),t.e(23),t.e(169)]).then(t.bind(null,1666))})),Object(a.a)(u,n.Preference,(function(){return Promise.all([t.e(12),t.e(0),t.e(1),t.e(3),t.e(4),t.e(14),t.e(39),t.e(91),t.e(13),t.e(30),t.e(54),t.e(109),t.e(167)]).then(t.bind(null,1668))})),Object(a.a)(u,n.Security,(function(){return Promise.all([t.e(0),t.e(1),t.e(6),t.e(11),t.e(58),t.e(77),t.e(110),t.e(243),t.e(84),t.e(170)]).then(t.bind(null,1669))})),Object(a.a)(u,n.Privilege,(function(){return Promise.all([t.e(0),t.e(3),t.e(168)]).then(t.bind(null,1671))})),Object(a.a)(u,n.Audit,(function(){return Promise.all([t.e(12),t.e(26),t.e(0),t.e(1),t.e(3),t.e(4),t.e(5),t.e(10),t.e(11),t.e(14),t.e(25),t.e(52),t.e(87),t.e(121),t.e(8),t.e(13),t.e(23),t.e(20),t.e(28),t.e(41),t.e(50),t.e(57),t.e(84),t.e(166)]).then(t.bind(null,1672))})),u)[c]();case 3:return j=e.sent,o=j.fetchData,b=j.View,e.next=8,o(r,s);case 8:return f=e.sent,e.abrupt("return",Object(l.jsx)(w,{username:r,type:c,data:f,view:b},Object(O.a)()));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}w=Object(m.a)(w),r.default=Object(y.c)(function(){var e=Object(s.a)(i.a.mark((function e(r){var t;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=r.params.username,Object(P.f)(t)){e.next=3;break}throw new y.a(Object(g.c)("user_edit.errors.NO_SUCH_USER"));case 3:return e.next=5,k(r.params.username,r.params.type,r.query);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})));return function(r){return e.apply(this,arguments)}}())}}]);
//# sourceMappingURL=171.f5aa6e45.chunk.js.map