"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/smb/user/list"],{1555:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var r=s(667),a=s.n(r),i=s(90),n=s(1556);const l={id:a().string,dataUrl:a().string,operations:a().array,itemActions:a().object,columns:a().array,data:a().shape({data:a().array,state:a().object,pager:a().object,locale:a().object,additional:a().object,pathbar:a().any}),searchFilters:a().object,searchOveral:a().string,disabledSelectHint:a().string,isDisabledItem:a().func,onRedraw:a().func,emptyViewMode:a().oneOf(["all","items"]),emptyView:a().any},o={id:void 0,dataUrl:void 0,operations:void 0,itemActions:void 0,columns:void 0,data:void 0,searchFilters:void 0,searchOveral:void 0,disabledSelectHint:void 0,isDisabledItem:void 0,onRedraw:void 0,emptyViewMode:void 0,emptyView:void 0},d=(0,n.default)(i.List,{propsList:Object.keys(l),defaultProps:o});d.displayName="JswList",d.propTypes=l;const c=d},1556:(e,t,s)=>{s.r(t),s.d(t,{default:()=>i});var r=s(295),a=s(90);const i=(e,{propsList:t=[],setters:s={},defaultProps:i={}})=>n=>{const l=(0,r.useRef)(),o=(0,r.useRef)(),[d,c]=Object.entries({...i,...n}).reduce((e,[s,r])=>(e[t.includes(s)?0:1][s]=r,e),[{},{}]),u=t.map(e=>{const t=d[e];return s[e]?(o.current?.[s[e]](t),null):t});return(0,r.useLayoutEffect)(()=>(o.current=new e(d),(0,a.render)(l.current,o.current),()=>{o.current.remove(),o.current=null}),[c.key,...u]),(0,r.jsx)("div",{ref:l,...c})}},1559:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var r=s(667),a=s.n(r),i=s(296),n=s(90),l=s(717),o=s(295);const d=({items:e})=>e&&e.length>1?(0,o.jsx)(i.Tabs,{active:e.findIndex(({containerCls:e})=>"active"===e)+1,children:e.map(({title:e,href:t},s)=>(0,o.jsx)(i.Tab,{title:e,component:l.default,to:(0,n.prepareUrl)(t)},s))}):null;d.propTypes={items:a().arrayOf(a().shape({title:a().string.isRequired,href:a().string.isRequired,containerCls:a().string}))};const c=d},1818:(e,t,s)=>{s.r(t),s.d(t,{default:()=>d});var r=s(667),a=s.n(r),i=s(90),n=s(1556);const l={hint:a().string.isRequired,expandable:a().bool},o=(0,n.default)(i.Hint,{propsList:Object.keys(l),setters:{hint:"setHint"},defaultProps:{expandable:!1}});o.displayName="JswHint",o.propTypes=l;const d=o},1855:(e,t,s)=>{s.r(t),s.d(t,{default:()=>u});var r=s(90),a=s(1818),i=s(1559),n=s(674),l=s(1856),o=s(295);const d=r.Locale.getSection("smb.controllers.user.list"),c=({tabs:e,...t})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.default,{items:e}),(0,o.jsx)(a.default,{hint:d.lmsg("hint"),expandable:!0}),(0,o.jsx)(l.default,{...t})]});c.propTypes={tabs:i.default.propTypes.items.isRequired};const u=(0,n.withPageLayout)(c)},1856:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var r=s(295),a=s(667),i=s.n(a),n=s(90),l=s(1555);const o=n.Locale.getSection("smb.components.lists.users"),d=({data:e,searchFilters:t,currentUserId:s})=>{const a=(0,r.useMemo)(()=>[n.list.COLUMN_SELECTION,{header:o.lmsg("contactName"),sortable:!0,dataIndex:"contactName",renderer:e=>`<a data-cy="${(0,n.escapeHtml)(e.login)}" href="/smb/user/overview/id/${e.id}">${(0,n.escapeHtml)(e.contactName)}</a>`+(1==e.isLocked?`<span class="hint-attention ">${o.lmsg("statusBlocked")}</span>`:"")},{header:o.lmsg("email"),sortable:!0,cls:"minor",dataIndex:"email",renderer:e=>e.email?`<a href="mailto:${e.email}">${e.email}</a>`:""},{header:o.lmsg("role"),cls:"minor",sortable:!0,dataIndex:"roleName"}],[]),i=(0,r.useMemo)(()=>[{componentType:n.SmallButton,title:o.lmsg("buttonAddNewUser"),description:o.lmsg("hintAddNewUser"),addCls:"sb-add-user btn-primary",href:"/smb/user/create"},{componentType:n.bar.Separator},{componentType:n.SmallButton,id:"buttonRemoveUser",title:o.lmsg("remove"),description:o.lmsg("hintRemove"),addCls:"sb-remove-selected",handler(e){(0,n.getComponent)("users-list").execGroupOperation({url:"/smb/user/delete/?redirect=/smb/user/list/",subtype:"delete",mouseEvent:e,locale:{confirmOnGroupOperation:o.lmsg("confirmOnDelete")}})}}],[]),d=(0,r.useCallback)(e=>1==e.isBuiltIn||e.id==s,[s]);return(0,r.jsx)(l.default,{id:"users-list",data:e,dataUrl:"/smb/user/list-data",disabledSelectHint:o.lmsg("disabledSelectHint"),searchOveral:"name",searchFilters:t,isDisabledItem:d,columns:a,operations:i})};d.propTypes={data:l.default.propTypes.data.isRequired,searchFilters:l.default.propTypes.searchFilters.isRequired,currentUserId:i().string.isRequired};const c=d}}]);
//# sourceMappingURL=list.js.map?8f5925dc53aedbf7fa3f