import{a as H}from"./chunk-IDKT5PCT.js";import{a as z}from"./chunk-6CNPPKIW.js";import{a as O}from"./chunk-ZV3BGPM5.js";import{a as W}from"./chunk-QYJGZ7EQ.js";import{a as $}from"./chunk-GCX3G43W.js";import"./chunk-BTNSHOI7.js";import"./chunk-JAY45DEO.js";import"./chunk-LINAD4CC.js";import"./chunk-HTEZFA6O.js";import"./chunk-LH4LY7P4.js";import{Ca as R,Na as V}from"./chunk-IDENGFF3.js";import"./chunk-2MCAID7M.js";import{a as P,b as C}from"./chunk-IGFM5CCE.js";import"./chunk-FWAWZDGH.js";import"./chunk-WUNNKW5D.js";import"./chunk-IFY4UZPR.js";import"./chunk-IXRBBB6V.js";import{a as N}from"./chunk-PLVHWZTL.js";import"./chunk-PDYJ5OYY.js";import"./chunk-M6NTKB7A.js";import{i as j}from"./chunk-YMOV4UGM.js";import"./chunk-TDUJNOEU.js";import{Db as B,Ec as _,Hb as D,Ib as x,Jc as E,K as s,Lc as I,Zc as M,dc as c,ec as f,fc as b,fd as A,ga as a,gc as g,gd as T,kd as v,la as u,lb as d,nc as F,tc as U,ua as S,va as w,wb as l,zd as L}from"./chunk-I3FGJX2C.js";import"./chunk-AKP2VPKK.js";import"./chunk-ML3VIXIY.js";import{d as y,n as Y}from"./chunk-INB5GR2I.js";import"./chunk-B7YGBANW.js";var p=(()=>{let e=class e{constructor(t){this._http=t}getAll(t){return this._http.post("/api/admin/users/all",t,{headers:N})}block(t){return this._http.put(`/api/admin/users/${t}/block`,null)}unblock(t){return this._http.put(`/api/admin/users/${t}/unblock`,null)}};e.\u0275fac=function(n){return new(n||e)(u(j))},e.\u0275prov=a({token:e,factory:e.\u0275fac});let i=e;return i})();var m=(()=>{let e=class e{constructor(t){this._userServiceApi=t}getAll(t){return this._userServiceApi.getAll(t).pipe(s(1))}block(t){return this._userServiceApi.block(t).pipe(s(1))}unblock(t){return this._userServiceApi.unblock(t).pipe(s(1))}};e.\u0275fac=function(n){return new(n||e)(u(p))},e.\u0275prov=a({token:e,factory:e.\u0275fac});let i=e;return i})();Y();var K=[{caption:"\u0410\u0439\u0434\u0438",dataField:"id",width:"320px",minWidth:320},{caption:"\u0418\u043C\u044F",dataField:"fullName",showDashIfEmpty:!0,width:"25%",minWidth:130},{caption:"\u041D\u043E\u043C\u0435\u0440 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430",dataField:"login",width:"20%",minWidth:130,isCustom:!0},{caption:"\u041A\u043E\u043C\u043F\u0430\u043D\u0438\u044F",dataField:"companyNames",width:"25%",minWidth:130,showDashIfEmpty:!0},{caption:"\u0421\u0442\u0430\u0442\u0443\u0441",dataField:"isBlocked",isCustom:!0,width:"80px",minWidth:100}];var X=(i,e)=>({login:i,isBlocked:e});function Z(i,e){if(i&1&&(E(0),A(1,"phoneFormat")),i&2){let r=e.$implicit;I(" ",T(1,1,r.login),`
`)}}function ee(i,e){if(i&1&&(f(0,"div",5),g(1,"wk-badge",6),b()),i&2){let r=e.$implicit;d(),c("text",r.isBlocked?"\u0417\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u043D":"\u0410\u043A\u0442\u0438\u0432\u0435\u043D")("variant",r.isBlocked?"error":"success")("stylingMode","outlined")}}var o,h=(o=class extends z{get criteria(){return{search:{id:this.searchValue,name:this.searchValue,login:this.searchValue,company:this.searchValue},filter:null}}constructor(e,r,t){super(r,t),this._userService=e,this.columns=K,this.menuItems=[{text:"\u0417\u0430\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C",action:n=>this._blockUser(n.id),visible:n=>!n.isBlocked},{text:"\u0420\u0430\u0437\u0431\u043B\u043E\u043A\u0438\u0440\u043E\u0432\u0430\u0442\u044C",action:n=>this._unBlockUser(n.id),visible:n=>n.isBlocked}]}getLoadMethod(e){return this._userService.getAll(e)}_blockUser(e){this._userService.block(e).pipe(C(this)).subscribe(()=>{this.table?.refresh()})}_unBlockUser(e){this._userService.unblock(e).pipe(C(this)).subscribe(()=>{this.table?.refresh()})}},o.\u0275fac=function(r){return new(r||o)(l(m),l(L),l(V))},o.\u0275cmp=B({type:o,selectors:[["tis-user-list"]],features:[D],decls:8,vars:16,consts:[["table",""],["phone",""],["isBlockedTmpl",""],["title","\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0438",1,"header",3,"showBackButton"],["searchPlaceholder","\u041F\u043E\u0438\u0441\u043A \u043F\u043E ID, \u0438\u043C\u0435\u043D\u0438, \u043D\u043E\u043C\u0435\u0440\u0443 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430 \u0438 \u043A\u043E\u043C\u043F\u0430\u043D\u0438\u0438",3,"changedSearch","allowColumnResizing","data","columns","menuItems","enableContextMenu","enablePagination","hoverable","pageNavigation","enableToolbar","enableFilters","enableSpinner","customTemplates"],[1,"status-badge"],[3,"text","variant","stylingMode"]],template:function(r,t){if(r&1){let n=F();g(0,"tis-subheader",3),f(1,"tis-main-layout")(2,"tis-table",4,0),U("changedSearch",function(Q){return S(n),w(t.changedSearch(Q))}),b()(),x(4,Z,2,3,"ng-template",null,1,v)(6,ee,2,3,"ng-template",null,2,v)}if(r&2){let n=_(5),k=_(7);c("showBackButton",!1),d(2),c("allowColumnResizing",!0)("data",t.dataSource)("columns",t.columns)("menuItems",t.menuItems)("enableContextMenu",!0)("enablePagination",!0)("hoverable",!0)("pageNavigation",!0)("enableToolbar",!0)("enableFilters",!1)("enableSpinner",!0)("customTemplates",M(13,X,n,k))}},dependencies:[O,W,$,R,H],styles:[`[_nghost-%COMP%]{display:flex;flex-direction:column;min-height:100%}.header[_ngcontent-%COMP%]{top:0;position:sticky;z-index:10}.status-badge[_ngcontent-%COMP%]{width:100%;display:flex;align-items:center;justify-content:center}
/*# sourceMappingURL=user-list.component-WYTKQDBD.css.map */`],changeDetection:0}),o);h=y([P()],h);var ve=[{path:"",component:h,pathMatch:"full",providers:[p,m]},{path:"**",redirectTo:""}];export{ve as routes};
//# sourceMappingURL=users.routes-TSA4HVBN.js.map
