"use strict";(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["views/smb/user/list"],{1571(e,t,s){s.r(t),s.d(t,{default:()=>c});var a=s(669),r=s.n(a),i=s(90),l=s(1572);const n={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,l.default)(i.List,{propsList:Object.keys(n),defaultProps:o});d.displayName="JswList",d.propTypes=n;const c=d},1572(e,t,s){s.r(t),s.d(t,{default:()=>i});var a=s(296),r=s(90);const i=(e,{propsList:t=[],setters:s={},defaultProps:i={}})=>l=>{const n=(0,a.useRef)(),o=(0,a.useRef)(),[d,c]=Object.entries({...i,...l}).reduce((e,[s,a])=>(e[t.includes(s)?0:1][s]=a,e),[{},{}]),u=t.map(e=>{const t=d[e];return s[e]?(o.current?.[s[e]](t),null):t});return(0,a.useLayoutEffect)(()=>(o.current=new e(d),(0,r.render)(n.current,o.current),()=>{o.current.remove(),o.current=null}),[c.key,...u]),(0,a.jsx)("div",{ref:n,...c})}},1575(e,t,s){s.r(t),s.d(t,{default:()=>c});var a=s(669),r=s.n(a),i=s(297),l=s(90),n=s(714),o=s(296);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:n.default,to:(0,l.prepareUrl)(t)},s))}):null;d.propTypes={items:r().arrayOf(r().shape({title:r().string.isRequired,href:r().string.isRequired,containerCls:r().string}))};const c=d},1841(e,t,s){s.r(t),s.d(t,{default:()=>d});var a=s(669),r=s.n(a),i=s(90),l=s(1572);const n={hint:r().string.isRequired,expandable:r().bool},o=(0,l.default)(i.Hint,{propsList:Object.keys(n),setters:{hint:"setHint"},defaultProps:{expandable:!1}});o.displayName="JswHint",o.propTypes=n;const d=o},1883(e,t,s){s.r(t),s.d(t,{default:()=>u});var a=s(90),r=s(1841),i=s(1575),l=s(683),n=s(1884),o=s(296);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)(n.default,{...t})]});c.propTypes={tabs:i.default.propTypes.items.isRequired};const u=(0,l.withPageLayout)(c)},1884(e,t,s){s.r(t),s.d(t,{default:()=>c});var a=s(296),r=s(669),i=s.n(r),l=s(90),n=s(1571);const o=l.Locale.getSection("smb.components.lists.users"),d=({data:e,searchFilters:t,currentUserId:s})=>{const r=(0,a.useMemo)(()=>[l.list.COLUMN_SELECTION,{header:o.lmsg("contactName"),sortable:!0,dataIndex:"contactName",renderer:e=>`<a data-cy="${(0,l.escapeHtml)(e.login)}" href="/smb/user/overview/id/${e.id}">${(0,l.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,a.useMemo)(()=>[{componentType:l.SmallButton,title:o.lmsg("buttonAddNewUser"),description:o.lmsg("hintAddNewUser"),addCls:"sb-add-user btn-primary",href:"/smb/user/create"},{componentType:l.bar.Separator},{componentType:l.SmallButton,id:"buttonRemoveUser",title:o.lmsg("remove"),description:o.lmsg("hintRemove"),addCls:"sb-remove-selected",handler(e){(0,l.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)(n.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:n.default.propTypes.data.isRequired,searchFilters:n.default.propTypes.searchFilters.isRequired,currentUserId:i().string.isRequired};const c=d}}]);
//# sourceMappingURL=list.js.map?77333086070d4a60e267