"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/smb/user/list"],{1293:(e,t,s)=>{s.r(t),s.d(t,{default:()=>d});var a=s(247),r=s.n(a),i=s(90),n=s(1034);const l={hint:r().string.isRequired,expandable:r().bool},o=(0,n.default)(i.Hint,Object.keys(l),{hint:"setHint"});o.displayName="JswHint",o.propTypes=l,o.defaultProps={expandable:!1};const d=o},1033:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var a=s(247),r=s.n(a),i=s(90),n=s(1034);const l={id:r().string,dataUrl:r().string,operations:r().array,itemActions:r().object,columns:r().array,data:r().shape({data:r().array,state:r().object,pager:r().object,locale:r().object,additional:r().object,pathbar:r().any}),searchFilters:r().object,searchOveral:r().string,disabledSelectHint:r().string,isDisabledItem:r().func,onRedraw:r().func,emptyViewMode:r().oneOf(["all","items"]),emptyView:r().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,Object.keys(l));d.displayName="JswList",d.propTypes=l,d.defaultProps=o;const c=d},1037:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var a=s(247),r=s.n(a),i=s(246),n=s(90),l=s(787),o=s(245);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:r().arrayOf(r().shape({title:r().string.isRequired,href:r().string.isRequired,containerCls:r().string}))},d.defaultProps={items:void 0};const c=d},1034:(e,t,s)=>{s.r(t),s.d(t,{default:()=>i});var a=s(245),r=s(90);const i=(e,t=[],s={})=>i=>{const n=(0,a.useRef)(),l=(0,a.useRef)(),[o,d]=Object.entries(i).reduce(((e,[s,a])=>(e[t.includes(s)?0:1][s]=a,e)),[{},{}]),c=t.map((e=>{const t=o[e];return s[e]?(l.current?.[s[e]](t),null):t}));return(0,a.useLayoutEffect)((()=>(l.current=new e(o),(0,r.render)(n.current,l.current),()=>{l.current.remove(),l.current=null})),[d.key,...c]),(0,a.jsx)("div",{ref:n,...d})}},1325:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var a=s(245),r=s(247),i=s.n(r),n=s(90),l=s(1033);const o=n.Locale.getSection("smb.components.lists.users"),d=({data:e,searchFilters:t,currentUserId:s})=>{const r=(0,a.useMemo)((()=>[n.list.COLUMN_SELECTION,{header:o.lmsg("contactName"),sortable:!0,dataIndex:"contactName",renderer(e){const t=e.contactName?e.contactName:e.login;return`<a data-cy="${(0,n.escapeHtml)(e.login)}" href="/smb/user/overview/id/${e.id}">${(0,n.escapeHtml)(t)}</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,a.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,a.useCallback)((e=>1==e.isBuiltIn||e.id==s),[s]);return(0,a.jsx)(l.default,{id:"users-list",data:e,dataUrl:"/smb/user/list-data",disabledSelectHint:o.lmsg("disabledSelectHint"),searchOveral:"name",searchFilters:t,isDisabledItem:d,columns:r,operations:i})};d.propTypes={data:l.default.propTypes.data.isRequired,searchFilters:l.default.propTypes.searchFilters.isRequired,currentUserId:i().string.isRequired};const c=d},1324:(e,t,s)=>{s.r(t),s.d(t,{default:()=>u});var a=s(90),r=s(1293),i=s(1037),n=s(751),l=s(1325),o=s(245);const d=a.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)(r.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)}}]);
//# sourceMappingURL=list.js.map?d38adcfe74d854d4df13