-
Notifications
You must be signed in to change notification settings - Fork 0
/
358-es5.4122ea26f6cc04587c18.js
1 lines (1 loc) · 69.9 KB
/
358-es5.4122ea26f6cc04587c18.js
1
!function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}function n(e,n,a){return n&&t(e.prototype,n),a&&t(e,a),e}(self.webpackChunkmaterial=self.webpackChunkmaterial||[]).push([[358],{5358:function(t,a,i){"use strict";i.r(a),i.d(a,{AdminModule:function(){return Ye}});var r=i(61511),o=i(71398),l=i(31572),s=function(){var t=function(){function t(){e(this,t)}return n(t,[{key:"ngOnInit",value:function(){}}]),t}();return t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=l["\u0275\u0275defineComponent"]({type:t,selectors:[["app-dashboard"]],decls:2,vars:0,template:function(e,t){1&e&&(l["\u0275\u0275elementStart"](0,"p"),l["\u0275\u0275text"](1," dashboard works!\n"),l["\u0275\u0275elementEnd"]())},styles:[""]}),t}(),c=function t(n,a,i){e(this,t),this.name=n,this.email=a,this.password=i},d=i(1174),m=function t(){e(this,t),this.type="[Admin] GET_USERS"},u=function t(n){e(this,t),this.payload=n,this.type="[Admin] GET_USERS_SUCCESS"},p=function t(){e(this,t),this.type="[Admin] GET_USERS_ERROR"},f=function t(n){e(this,t),this.payload=n,this.type="[Admin] ASSIGN_ROLE"},g=function t(n){e(this,t),this.payload=n,this.type="[Admin] ASSIGN_ROLE_SUCCESS"},h=function t(){e(this,t),this.type="[Admin] ASSIGN_ROLE_ERROR"},b=function t(n){e(this,t),this.payload=n,this.type="[Admin] REMOVE_ROLE"},v=function t(n){e(this,t),this.payload=n,this.type="[Admin] REMOVE_ROLE_SUCCESS"},x=function t(){e(this,t),this.type="[Admin] REMOVE_ROLE_ERROR"},_=function t(n){e(this,t),this.payload=n,this.type="[Admin] CREATE_USER"},S=function t(n){e(this,t),this.payload=n,this.type="[Admin] CREATE_USER_SUCCESS"},E=function t(){e(this,t),this.type="[Admin] CREATE_USER_ERROR"},y=function t(n){e(this,t),this.payload=n,this.type="[Admin] UPDATE_USER"},w=function t(n){e(this,t),this.payload=n,this.type="[Admin] UPDATE_USER_SUCCESS"},C=function t(){e(this,t),this.type="[Admin] UPDATE_USER_ERROR"},k=i(84608),O=i(529),M=i(29063),P=function(){var t=function(){function t(n){e(this,t),this.http=n,this.apiUrl=O.N.apiUrl}return n(t,[{key:"getUsers",value:function(){return this.http.get(this.apiUrl+"management-console/users")}},{key:"getRoles",value:function(){return this.http.get(this.apiUrl+"management-console/user/get-roles")}},{key:"assignRole",value:function(e){return this.http.put(this.apiUrl+"management-console/user/assign-role",e)}},{key:"removeRole",value:function(e){return this.http.put(this.apiUrl+"management-console/user/remove-role",e)}},{key:"createUser",value:function(e){return this.http.post(this.apiUrl+"management-console/user/create",e)}},{key:"updateUser",value:function(e){return this.http.put(this.apiUrl+"management-console/user/update",e)}}]),t}();return t.\u0275fac=function(e){return new(e||t)(l["\u0275\u0275inject"](M.eN))},t.\u0275prov=l["\u0275\u0275defineInjectable"]({token:t,factory:t.\u0275fac,providedIn:"root"}),t}(),R=i(55959),U=i(25416),A=i(61593),I=i(35965),T=i(15980),j=i(46828),N=i(43691);function L(e,t){if(1&e){var n=l["\u0275\u0275getCurrentView"]();l["\u0275\u0275elementStart"](0,"div",14),l["\u0275\u0275elementStart"](1,"div",15),l["\u0275\u0275text"](2),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](3,"div",16),l["\u0275\u0275text"](4),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](5,"div",17),l["\u0275\u0275text"](6),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](7,"div",18),l["\u0275\u0275elementStart"](8,"button",19),l["\u0275\u0275listener"]("click",function(){var e=l["\u0275\u0275restoreView"](n).$implicit;return l["\u0275\u0275nextContext"](2).assignRole(e.id)}),l["\u0275\u0275elementStart"](9,"mat-icon",20),l["\u0275\u0275text"](10,"add"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"]()}if(2&e){var a=t.$implicit,i=l["\u0275\u0275nextContext"](2);l["\u0275\u0275classProp"]("role_assigned",i.userHasRole(a.name)),l["\u0275\u0275advance"](2),l["\u0275\u0275textInterpolate"](a.name),l["\u0275\u0275advance"](2),l["\u0275\u0275textInterpolate"](a.display_name),l["\u0275\u0275advance"](2),l["\u0275\u0275textInterpolate"](a.description),l["\u0275\u0275advance"](2),l["\u0275\u0275property"]("disabled",i.userHasRole(a.name))}}function $(e,t){if(1&e&&(l["\u0275\u0275elementStart"](0,"div",5),l["\u0275\u0275elementStart"](1,"div",6),l["\u0275\u0275elementStart"](2,"div",7),l["\u0275\u0275elementStart"](3,"div",8),l["\u0275\u0275text"](4,"Role"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](5,"div",9),l["\u0275\u0275text"](6,"Role Name"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](7,"div",10),l["\u0275\u0275text"](8,"Detail"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](9,"div",11),l["\u0275\u0275text"](10,"Actions"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](11,"div",12),l["\u0275\u0275template"](12,L,11,6,"div",13),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"]()),2&e){var n=l["\u0275\u0275nextContext"]();l["\u0275\u0275advance"](12),l["\u0275\u0275property"]("ngForOf",n.roles)}}var F=function(){var t=function(){function t(n,a,i,r,o){e(this,t),this.dialogRef=n,this.data=a,this.store=i,this.userService=r,this.updates$=o,this.onAdd=new l.EventEmitter,this.roles=[],this.destroySubject$=new R.xQ}return n(t,[{key:"ngOnInit",value:function(){var e=this;this.userService.getRoles().subscribe(function(t){e.roles=t})}},{key:"userHasRole",value:function(e){var t=!1;return this.data.roles.forEach(function(n){n.name===e&&(t=!0)}),t}},{key:"assignRole",value:function(e){var t=this;this.store.dispatch(new f({user_id:this.data.id,role_id:e})),this.onAdd.emit({user_id:this.data.id}),this.updates$.pipe((0,d.l4)("[Admin] ASSIGN_ROLE_SUCCESS"),(0,U.R)(this.destroySubject$)).subscribe(function(){t.store.select(function(e){return e.Admin.users}).subscribe(function(e){e.forEach(function(e){e.id===t.data.id&&(t.data=e)})})})}},{key:"closeDialog",value:function(e){this.dialogRef.close(e)}},{key:"doAdd",value:function(){this.closeDialog(!0),this.onAdd.emit()}},{key:"ngOnDestroy",value:function(){this.destroySubject$.next()}}]),t}();return t.\u0275fac=function(e){return new(e||t)(l["\u0275\u0275directiveInject"](k.so),l["\u0275\u0275directiveInject"](k.WI),l["\u0275\u0275directiveInject"](A.yh),l["\u0275\u0275directiveInject"](P),l["\u0275\u0275directiveInject"](d.eX))},t.\u0275cmp=l["\u0275\u0275defineComponent"]({type:t,selectors:[["assign-role-dialog"]],decls:6,vars:2,consts:[["mat-dialog-title",""],["mat-dialog-content",""],["fxLayout","row","fxLayoutWrap","wrap",2,"margin-top","20px"],["fxFlex.gt-sm","100","fxFlex","100"],["class","table-rasponsive",4,"ngIf"],[1,"table-rasponsive"],[1,"table"],[1,"table-header"],[1,"header__item","column-role"],[1,"header__item","column-name"],[1,"header__item","column-detail"],[1,"header__item","column-actions"],[1,"table-content"],["class","table-row",3,"role_assigned",4,"ngFor","ngForOf"],[1,"table-row"],[1,"table-data","column-role"],[1,"table-data","column-name"],["matTooltipPosition","below",1,"table-data","column-detail"],[1,"table-data","column-actions"],["mat-icon-button","","color","warn","matTooltip","Assign Role","matTooltipPosition","below",3,"disabled","click"],["aria-label","Edit"]],template:function(e,t){1&e&&(l["\u0275\u0275elementStart"](0,"h3",0),l["\u0275\u0275text"](1),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](2,"div",1),l["\u0275\u0275elementStart"](3,"div",2),l["\u0275\u0275elementStart"](4,"div",3),l["\u0275\u0275template"](5,$,13,1,"div",4),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"]()),2&e&&(l["\u0275\u0275advance"](1),l["\u0275\u0275textInterpolate1"]("Assign Role to ",t.data.name,""),l["\u0275\u0275advance"](4),l["\u0275\u0275property"]("ngIf",t.roles))},directives:[k.uh,k.xY,I.xw,I.yH,r.O5,r.sg,T.lW,j.gM,N.Hw],styles:['.table[_ngcontent-%COMP%]{width:100%;border:0 solid #eee}.table-header[_ngcontent-%COMP%]{padding:10px 0;font-size:12px}.table-header[_ngcontent-%COMP%], .table-row[_ngcontent-%COMP%]{display:flex;width:100%;border-bottom:1px solid #eee}.table-row[_ngcontent-%COMP%]{padding-left:10px 0;transition:all .2s ease-in-out}.table-row[_ngcontent-%COMP%]:hover{background-color:rgba(97,97,97,.068)}.table-row.role_assigned[_ngcontent-%COMP%]{background-color:rgba(127,255,212,.2)}.table-row[_ngcontent-%COMP%]:hover.role_assigned{background-color:rgba(127,255,212,.7)}.header__item[_ngcontent-%COMP%], .table-data[_ngcontent-%COMP%]{flex:1 1 20%;text-align:center;padding:5px}.header__item[_ngcontent-%COMP%]{text-transform:uppercase;font-family:Verdana,Geneva,Tahoma,sans-serif;font-size:12px}.filter__link[_ngcontent-%COMP%]{color:#fff;text-decoration:none;position:relative;display:inline-block;padding-left:24px;padding-right:24px}.filter__link[_ngcontent-%COMP%]:after{content:"";position:absolute;right:-18px;color:#fff;font-size:12px;top:50%;transform:translateY(-50%)}.filter__link.desc[_ngcontent-%COMP%]:after{content:"(desc)"}.filter__link.asc[_ngcontent-%COMP%]:after{content:"(asc)"}.column-name[_ngcontent-%COMP%], .column-role[_ngcontent-%COMP%]{flex:0 0 20%;font-size:12px;text-align:left;font-family:Verdana,Geneva,Tahoma,sans-serif}.column-detail[_ngcontent-%COMP%]{flex:0 0 40%;font-size:12px}.column-actions[_ngcontent-%COMP%]{flex:0 0 20%}']}),t}(),V=i(16073),z=i(66283),G=i(26756),D=function(){var t=function(){function t(n,a,i,r,o){e(this,t),this.dialogRef=n,this.data=a,this.store=i,this.userService=r,this.updates$=o,this.onAdd=new l.EventEmitter,this.user=new c(null,null,null)}return n(t,[{key:"ngOnInit",value:function(){}},{key:"addUser",value:function(){this.store.dispatch(new _(this.user)),this.onAdd.emit(),this.dialogRef.close(!0)}},{key:"closeDialog",value:function(e){this.dialogRef.close(e)}}]),t}();return t.\u0275fac=function(e){return new(e||t)(l["\u0275\u0275directiveInject"](k.so),l["\u0275\u0275directiveInject"](k.WI),l["\u0275\u0275directiveInject"](A.yh),l["\u0275\u0275directiveInject"](P),l["\u0275\u0275directiveInject"](d.eX))},t.\u0275cmp=l["\u0275\u0275defineComponent"]({type:t,selectors:[["add-user-dialog"]],decls:33,vars:7,consts:[["mat-dialog-title",""],[1,"basic-form"],["userForm","ngForm"],["mat-dialog-content",""],["fxLayout","row","fxLayoutWrap","wrap",2,"margin-top","20px"],["fxFlex.gt-sm","100","fxFlex","100"],["appearance","outline"],["matInput","","mat-autosize","","required","","name","tickerName",3,"ngModel","ngModelChange"],["fxLayout","row","fxLayoutWrap","wrap"],["type","password","matInput","","mat-autosize","","required","","name","tickerName",3,"ngModel","ngModelChange"],["mat-dialog-actions","","align","end"],["mat-button","","color","basic",3,"click"],["mat-raised-button","","color","primary",3,"disabled","click"]],template:function(e,t){if(1&e&&(l["\u0275\u0275elementStart"](0,"h3",0),l["\u0275\u0275text"](1,"Add User"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](2,"form",1,2),l["\u0275\u0275elementStart"](4,"div",3),l["\u0275\u0275elementStart"](5,"div",4),l["\u0275\u0275elementStart"](6,"div",5),l["\u0275\u0275elementStart"](7,"mat-form-field",6),l["\u0275\u0275elementStart"](8,"mat-label"),l["\u0275\u0275text"](9,"Name"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](10,"input",7),l["\u0275\u0275listener"]("ngModelChange",function(e){return t.user.name=e}),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](11,"div",8),l["\u0275\u0275elementStart"](12,"div",5),l["\u0275\u0275elementStart"](13,"mat-form-field",6),l["\u0275\u0275elementStart"](14,"mat-label"),l["\u0275\u0275text"](15,"Email"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](16,"input",7),l["\u0275\u0275listener"]("ngModelChange",function(e){return t.user.email=e}),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](17,"div",8),l["\u0275\u0275elementStart"](18,"div",5),l["\u0275\u0275elementStart"](19,"mat-form-field",6),l["\u0275\u0275elementStart"](20,"mat-label"),l["\u0275\u0275text"](21,"Password"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](22,"input",9),l["\u0275\u0275listener"]("ngModelChange",function(e){return t.user.password=e}),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](23,"div",8),l["\u0275\u0275elementStart"](24,"div",5),l["\u0275\u0275elementStart"](25,"code"),l["\u0275\u0275text"](26),l["\u0275\u0275pipe"](27,"json"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](28,"div",10),l["\u0275\u0275elementStart"](29,"button",11),l["\u0275\u0275listener"]("click",function(){return t.closeDialog(!0)}),l["\u0275\u0275text"](30,"Cancel"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](31,"button",12),l["\u0275\u0275listener"]("click",function(){return t.addUser()}),l["\u0275\u0275text"](32,"Add User"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"]()),2&e){var n=l["\u0275\u0275reference"](3);l["\u0275\u0275advance"](10),l["\u0275\u0275property"]("ngModel",t.user.name),l["\u0275\u0275advance"](6),l["\u0275\u0275property"]("ngModel",t.user.email),l["\u0275\u0275advance"](6),l["\u0275\u0275property"]("ngModel",t.user.password),l["\u0275\u0275advance"](4),l["\u0275\u0275textInterpolate"](l["\u0275\u0275pipeBind1"](27,5,t.user)),l["\u0275\u0275advance"](5),l["\u0275\u0275property"]("disabled",!n.form.valid)}},directives:[k.uh,V["\u0275NgNoValidate"],V.NgControlStatusGroup,V.NgForm,k.xY,I.xw,I.yH,z.KE,z.hX,G.Nt,V.DefaultValueAccessor,V.RequiredValidator,V.NgControlStatus,V.NgModel,k.H8,T.lW],pipes:[r.Ts],styles:['.table[_ngcontent-%COMP%]{width:100%;border:0 solid #eee}.table-header[_ngcontent-%COMP%]{padding:10px 0;font-size:12px}.table-header[_ngcontent-%COMP%], .table-row[_ngcontent-%COMP%]{display:flex;width:100%;border-bottom:1px solid #eee}.table-row[_ngcontent-%COMP%]{padding-left:10px 0;transition:all .2s ease-in-out}.table-row[_ngcontent-%COMP%]:hover{background-color:rgba(97,97,97,.068)}.table-row.role_assigned[_ngcontent-%COMP%]{background-color:rgba(127,255,212,.2)}.table-row[_ngcontent-%COMP%]:hover.role_assigned{background-color:rgba(127,255,212,.7)}.header__item[_ngcontent-%COMP%], .table-data[_ngcontent-%COMP%]{flex:1 1 20%;text-align:center;padding:5px}.header__item[_ngcontent-%COMP%]{text-transform:uppercase;font-family:Verdana,Geneva,Tahoma,sans-serif;font-size:12px}.filter__link[_ngcontent-%COMP%]{color:#fff;text-decoration:none;position:relative;display:inline-block;padding-left:24px;padding-right:24px}.filter__link[_ngcontent-%COMP%]:after{content:"";position:absolute;right:-18px;color:#fff;font-size:12px;top:50%;transform:translateY(-50%)}.filter__link.desc[_ngcontent-%COMP%]:after{content:"(desc)"}.filter__link.asc[_ngcontent-%COMP%]:after{content:"(asc)"}.column-name[_ngcontent-%COMP%], .column-role[_ngcontent-%COMP%]{flex:0 0 20%;font-size:12px;text-align:left;font-family:Verdana,Geneva,Tahoma,sans-serif}.column-detail[_ngcontent-%COMP%]{flex:0 0 40%;font-size:12px}.column-actions[_ngcontent-%COMP%]{flex:0 0 20%}']}),t}(),B=i(33191),H=i(71403),W=i(27439),q=i(25122),X=i(41293),Y=i(33104),K=i(85250),Q=i(71522),J=i(55109),Z=i(10033);function ee(e,t){1&e&&(l["\u0275\u0275elementStart"](0,"mat-icon",31),l["\u0275\u0275text"](1,"face"),l["\u0275\u0275elementEnd"]())}function te(e,t){1&e&&(l["\u0275\u0275elementStart"](0,"mat-icon",32),l["\u0275\u0275text"](1,"account_circle"),l["\u0275\u0275elementEnd"]())}function ne(e,t){1&e&&(l["\u0275\u0275elementStart"](0,"mat-icon",33),l["\u0275\u0275text"](1,"error_outline"),l["\u0275\u0275elementEnd"]())}function ae(e,t){1&e&&(l["\u0275\u0275elementStart"](0,"mat-icon",34),l["\u0275\u0275text"](1,"security"),l["\u0275\u0275elementEnd"]())}function ie(e,t){1&e&&(l["\u0275\u0275elementStart"](0,"mat-icon",32),l["\u0275\u0275text"](1,"security"),l["\u0275\u0275elementEnd"]())}function re(e,t){if(1&e){var n=l["\u0275\u0275getCurrentView"]();l["\u0275\u0275elementStart"](0,"mat-list-item",24),l["\u0275\u0275listener"]("click",function(){var e=l["\u0275\u0275restoreView"](n).$implicit;return l["\u0275\u0275nextContext"](2).onSelect(e)}),l["\u0275\u0275template"](1,ee,2,0,"mat-icon",25),l["\u0275\u0275template"](2,te,2,0,"mat-icon",26),l["\u0275\u0275template"](3,ne,2,0,"mat-icon",27),l["\u0275\u0275template"](4,ae,2,0,"mat-icon",28),l["\u0275\u0275template"](5,ie,2,0,"mat-icon",26),l["\u0275\u0275elementStart"](6,"b",29),l["\u0275\u0275text"](7),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](8,"p",30),l["\u0275\u0275text"](9),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"]()}if(2&e){var a=t.$implicit,i=l["\u0275\u0275nextContext"](2);l["\u0275\u0275styleProp"]("background-color",a.email==i.currentUserEmail?"rgba(127, 255, 212, 0.2)":"rgba(255, 255, 255, 0)"),l["\u0275\u0275advance"](1),l["\u0275\u0275property"]("ngIf",a.roles.length>0&&!i.checkRight("admin",a)),l["\u0275\u0275advance"](1),l["\u0275\u0275property"]("ngIf",a.roles.length>0&&i.checkRight("news-editor",a)||i.checkRight("n-editor",a)),l["\u0275\u0275advance"](1),l["\u0275\u0275property"]("ngIf",a.roles.length<=0),l["\u0275\u0275advance"](1),l["\u0275\u0275property"]("ngIf",i.checkRight("admin",a)&&i.checkRight("create-user",a)),l["\u0275\u0275advance"](1),l["\u0275\u0275property"]("ngIf",i.checkRight("admin",a)&&!i.checkRight("create-user",a)),l["\u0275\u0275advance"](2),l["\u0275\u0275textInterpolate"](a.name),l["\u0275\u0275advance"](2),l["\u0275\u0275textInterpolate"](a.email)}}function oe(e,t){if(1&e&&(l["\u0275\u0275elementStart"](0,"mat-nav-list"),l["\u0275\u0275template"](1,re,10,9,"mat-list-item",23),l["\u0275\u0275elementEnd"]()),2&e){var n=l["\u0275\u0275nextContext"]();l["\u0275\u0275advance"](1),l["\u0275\u0275property"]("ngForOf",n.users)}}function le(e,t){if(1&e&&l["\u0275\u0275element"](0,"img",37),2&e){var n=l["\u0275\u0275nextContext"](2);l["\u0275\u0275propertyInterpolate"]("src",n.storagePath+"profiles/default.jpg",l["\u0275\u0275sanitizeUrl"])}}function se(e,t){if(1&e&&l["\u0275\u0275element"](0,"img",37),2&e){var n=l["\u0275\u0275nextContext"](2);l["\u0275\u0275propertyInterpolate"]("src",n.storagePath+"profiles/user/"+n.selectedUser.profile.profilepic,l["\u0275\u0275sanitizeUrl"])}}function ce(e,t){if(1&e&&(l["\u0275\u0275elementStart"](0,"span",35),l["\u0275\u0275template"](1,le,1,1,"img",36),l["\u0275\u0275template"](2,se,1,1,"img",36),l["\u0275\u0275elementEnd"]()),2&e){var n=l["\u0275\u0275nextContext"]();l["\u0275\u0275advance"](1),l["\u0275\u0275property"]("ngIf",!n.selectedUser.profile),l["\u0275\u0275advance"](1),l["\u0275\u0275property"]("ngIf",n.selectedUser.profile)}}function de(e,t){if(1&e&&(l["\u0275\u0275elementStart"](0,"div",38),l["\u0275\u0275text"](1),l["\u0275\u0275elementEnd"]()),2&e){var n=l["\u0275\u0275nextContext"]();l["\u0275\u0275advance"](1),l["\u0275\u0275textInterpolate"](n.selectedUser.name)}}function me(e,t){if(1&e&&(l["\u0275\u0275elementStart"](0,"div",66),l["\u0275\u0275elementStart"](1,"div",67),l["\u0275\u0275text"](2),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](3,"div",68),l["\u0275\u0275text"](4),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](5,"div",69),l["\u0275\u0275text"](6),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](7,"div",70),l["\u0275\u0275text"](8),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](9,"div",71),l["\u0275\u0275text"](10),l["\u0275\u0275pipe"](11,"date"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"]()),2&e){var n=t.$implicit;l["\u0275\u0275advance"](2),l["\u0275\u0275textInterpolate"](n.id),l["\u0275\u0275advance"](2),l["\u0275\u0275textInterpolate"](n.log_name),l["\u0275\u0275advance"](2),l["\u0275\u0275textInterpolate"](n.description),l["\u0275\u0275advance"](2),l["\u0275\u0275textInterpolate"](n.subject_type),l["\u0275\u0275advance"](2),l["\u0275\u0275textInterpolate"](l["\u0275\u0275pipeBind2"](11,5,n.created_at,"medium"))}}function ue(e,t){if(1&e&&(l["\u0275\u0275elementStart"](0,"mat-chip",32),l["\u0275\u0275text"](1),l["\u0275\u0275elementEnd"]()),2&e){var n=t.$implicit;l["\u0275\u0275advance"](1),l["\u0275\u0275textInterpolate"](n.name)}}function pe(e,t){if(1&e){var n=l["\u0275\u0275getCurrentView"]();l["\u0275\u0275elementStart"](0,"div",66),l["\u0275\u0275elementStart"](1,"div",72),l["\u0275\u0275text"](2),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](3,"div",73),l["\u0275\u0275text"](4),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](5,"div",74),l["\u0275\u0275text"](6),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](7,"div",75),l["\u0275\u0275elementStart"](8,"mat-chip-list"),l["\u0275\u0275template"](9,ue,2,1,"mat-chip",76),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](10,"div",77),l["\u0275\u0275elementStart"](11,"button",78),l["\u0275\u0275listener"]("click",function(){var e=l["\u0275\u0275restoreView"](n).$implicit,t=l["\u0275\u0275nextContext"](2);return t.onRemoveRole(e.id,t.selectedUser.id)}),l["\u0275\u0275elementStart"](12,"mat-icon",79),l["\u0275\u0275text"](13,"clear"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"]()}if(2&e){var a=t.$implicit,i=l["\u0275\u0275nextContext"](2);l["\u0275\u0275advance"](2),l["\u0275\u0275textInterpolate"](a.name),l["\u0275\u0275advance"](2),l["\u0275\u0275textInterpolate"](a.display_name),l["\u0275\u0275advance"](2),l["\u0275\u0275textInterpolate"](a.description),l["\u0275\u0275advance"](3),l["\u0275\u0275property"]("ngForOf",a.permissions),l["\u0275\u0275advance"](2),l["\u0275\u0275property"]("disabled",i.selectedUser.email==i.currentUserEmail||!i.checkMyRight("create-user"))}}function fe(e,t){if(1&e){var n=l["\u0275\u0275getCurrentView"]();l["\u0275\u0275elementStart"](0,"div",39),l["\u0275\u0275elementStart"](1,"div",40),l["\u0275\u0275elementStart"](2,"div",41),l["\u0275\u0275elementStart"](3,"mat-card"),l["\u0275\u0275elementStart"](4,"mat-tab-group"),l["\u0275\u0275elementStart"](5,"mat-tab",42),l["\u0275\u0275elementStart"](6,"mat-card-content"),l["\u0275\u0275elementStart"](7,"form",43,44),l["\u0275\u0275elementStart"](9,"div",40),l["\u0275\u0275elementStart"](10,"div",45),l["\u0275\u0275elementStart"](11,"mat-form-field"),l["\u0275\u0275elementStart"](12,"input",46),l["\u0275\u0275listener"]("ngModelChange",function(e){return l["\u0275\u0275restoreView"](n),l["\u0275\u0275nextContext"]().updateUser.name=e}),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](13,"div",45),l["\u0275\u0275elementStart"](14,"mat-form-field"),l["\u0275\u0275elementStart"](15,"input",47),l["\u0275\u0275listener"]("ngModelChange",function(e){return l["\u0275\u0275restoreView"](n),l["\u0275\u0275nextContext"]().updateUser.email=e}),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](16,"div",45),l["\u0275\u0275elementStart"](17,"mat-form-field"),l["\u0275\u0275elementStart"](18,"input",48),l["\u0275\u0275listener"]("ngModelChange",function(e){return l["\u0275\u0275restoreView"](n),l["\u0275\u0275nextContext"]().updateUser.password=e}),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](19,"div",45),l["\u0275\u0275elementStart"](20,"button",22),l["\u0275\u0275listener"]("click",function(){return l["\u0275\u0275restoreView"](n),l["\u0275\u0275nextContext"]().onUpdateProfile()}),l["\u0275\u0275text"](21,"Update Profile"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](22,"mat-tab",49),l["\u0275\u0275elementStart"](23,"mat-card-content"),l["\u0275\u0275elementStart"](24,"mat-card-subtitle"),l["\u0275\u0275text"](25),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](26,"div",50),l["\u0275\u0275elementStart"](27,"div",51),l["\u0275\u0275elementStart"](28,"div",52),l["\u0275\u0275elementStart"](29,"div",53),l["\u0275\u0275text"](30,"Log Id"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](31,"div",54),l["\u0275\u0275text"](32,"Log Name"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](33,"div",55),l["\u0275\u0275text"](34,"Description"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](35,"div",56),l["\u0275\u0275text"](36,"Subject Type"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](37,"div",57),l["\u0275\u0275text"](38,"Log Date"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](39,"div",58),l["\u0275\u0275template"](40,me,12,8,"div",59),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](41,"mat-tab",60),l["\u0275\u0275elementStart"](42,"mat-card-content"),l["\u0275\u0275elementStart"](43,"div",50),l["\u0275\u0275elementStart"](44,"div",51),l["\u0275\u0275elementStart"](45,"div",52),l["\u0275\u0275elementStart"](46,"div",61),l["\u0275\u0275text"](47,"Role"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](48,"div",62),l["\u0275\u0275text"](49,"Role Name"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](50,"div",63),l["\u0275\u0275text"](51,"Detail"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](52,"div",64),l["\u0275\u0275text"](53,"Permission"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](54,"div",65),l["\u0275\u0275text"](55,"Actions"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](56,"div",58),l["\u0275\u0275template"](57,pe,14,5,"div",59),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"]()}if(2&e){var a=l["\u0275\u0275reference"](8),i=l["\u0275\u0275nextContext"]();l["\u0275\u0275advance"](12),l["\u0275\u0275property"]("ngModel",i.updateUser.name)("disabled",!i.checkMyRight("create-user")),l["\u0275\u0275advance"](3),l["\u0275\u0275property"]("ngModel",i.updateUser.email)("disabled",i.selectedUser.email==i.currentUserEmail||!i.checkMyRight("create-user")),l["\u0275\u0275advance"](3),l["\u0275\u0275property"]("ngModel",i.updateUser.password)("disabled",!i.checkMyRight("create-user")),l["\u0275\u0275advance"](2),l["\u0275\u0275property"]("disabled",!a.form.valid||!i.checkMyRight("create-user")),l["\u0275\u0275advance"](5),l["\u0275\u0275textInterpolate1"]("Last 200 Activity performed by ",i.selectedUser.name,""),l["\u0275\u0275advance"](15),l["\u0275\u0275property"]("ngForOf",i.selectedUser.activity),l["\u0275\u0275advance"](17),l["\u0275\u0275property"]("ngForOf",i.selectedUser.roles)}}function ge(e,t){1&e&&l["\u0275\u0275element"](0,"div",39)}var he=function(e,t){return{"side-panel-opened":e,"side-panel-closed":t}},be=function(){var t=function(){function t(n,a,i,r,o){e(this,t),this.store=n,this.updates$=a,this.dialog=i,this.sessionService=r,this.snackBar=o,this.sidePanelOpened=!0,this.users=[],this.selectedUser=null,this.destroySubject$=new R.xQ,this.updateUser=null}return n(t,[{key:"ngOnInit",value:function(){var e=this;this.storagePath=O.N.storageUrl,this.store.dispatch(new m),this.updates$.pipe((0,d.l4)("[Admin] GET_USERS_SUCCESS"),(0,U.R)(this.destroySubject$)).subscribe(function(){e.store.select(function(e){return e.Admin.users}).pipe((0,U.R)(e.destroySubject$)).subscribe(function(t){e.users=t})}),this.store.select(function(e){return e.UserState.user.email}).pipe((0,U.R)(this.destroySubject$)).subscribe(function(t){return e.currentUserEmail=t})}},{key:"onAddRole",value:function(){var e=this;this.dialog.open(F,{width:"95%",height:"60%",maxHeight:"95%",data:this.selectedUser}).componentInstance.onAdd.subscribe(function(t){e.updates$.pipe((0,d.l4)("[Admin] ASSIGN_ROLE_SUCCESS"),(0,U.R)(e.destroySubject$)).subscribe(function(){e.openSnackBar("Role Added to User!"),e.store.select(function(e){return e.Admin.users}).pipe((0,U.R)(e.destroySubject$)).subscribe(function(n){n.forEach(function(n){n.id===t.user_id&&(e.selectedUser=n)})})})})}},{key:"onRemoveRole",value:function(e,t){var n=this;this.store.dispatch(new b({user_id:this.selectedUser.id,role_id:e})),this.updates$.pipe((0,d.l4)("[Admin] REMOVE_ROLE_SUCCESS"),(0,U.R)(this.destroySubject$)).subscribe(function(){n.openSnackBar("Role Removed from User!"),n.store.select(function(e){return e.Admin.users}).pipe((0,U.R)(n.destroySubject$)).subscribe(function(e){e.forEach(function(e){e.id===t&&(n.selectedUser=e)})})})}},{key:"onAddUser",value:function(){var e=this;this.dialog.open(D,{width:"40%",height:"auto",maxHeight:"95%"}).componentInstance.onAdd.pipe((0,U.R)(this.destroySubject$)).subscribe(function(t){e.updates$.pipe((0,d.l4)("[Admin] CREATE_USER_SUCCESS"),(0,U.R)(e.destroySubject$)).subscribe(function(){e.openSnackBar("User Created!")})})}},{key:"checkRight",value:function(e,t){var n=!1;return t.roles.forEach(function(t){t.name===e&&(n=!0)}),n}},{key:"isOver",value:function(){return window.matchMedia("(max-width: 960px)").matches}},{key:"onSelect",value:function(e){this.selectedUser=e,this.updateUser=new c(this.selectedUser.name,this.selectedUser.email,null),this.updateUser.id=this.selectedUser.id}},{key:"onUpdateProfile",value:function(){var e=this;this.store.dispatch(new y(this.updateUser)),this.updates$.pipe((0,d.l4)("[Admin] UPDATE_USER_SUCCESS"),(0,U.R)(this.destroySubject$)).subscribe(function(){e.openSnackBar("User Data Updated!"),e.store.select(function(e){return e.Admin.users}).subscribe(function(t){e.users=t})})}},{key:"openSnackBar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"close";this.snackBar.open(e,t,{duration:1e3})}},{key:"ngOnDestroy",value:function(){this.destroySubject$.next()}},{key:"checkMyRight",value:function(e){return!!this.sessionService.checkRole("ticker-editor")||!!this.sessionService.checkRole("news-editor")}}]),t}();return t.\u0275fac=function(e){return new(e||t)(l["\u0275\u0275directiveInject"](A.yh),l["\u0275\u0275directiveInject"](d.eX),l["\u0275\u0275directiveInject"](k.uw),l["\u0275\u0275directiveInject"](B.m),l["\u0275\u0275directiveInject"](H.ux))},t.\u0275cmp=l["\u0275\u0275defineComponent"]({type:t,selectors:[["app-user"]],decls:32,vars:13,consts:[["fxLayout","row","fxLayoutAlign","center start"],["fxFlex.gt-md","100","fxFlex.gt-sm","100","fxFlex","100"],[1,"mat-card-top"],[3,"ngClass"],[3,"mode","opened","open","close"],["chatnav",""],["color","primary",1,"no-shadow"],["fxLayout","row","fxFlex","100"],[1,"m-t-0","font-14"],["mat-icon-button","",1,"mr-1"],["mat-mini-fab","","color","basic","align","end","matTooltip","Add User","matTooltipPosition","below",1,"mr-1",3,"disabled","click"],[4,"ngIf"],["color","warn",1,"bg-success","no-shadow","chat-right-panel"],["fxLayout","row","fxFlex","100","fxLayoutAlign","center center"],["mat-icon-button","",1,"mr-1",3,"click"],["class","top-avatar m-r-10",4,"ngIf"],["fxFlex",""],["class","font-14",4,"ngIf"],[1,"chat-middle-box"],["style","min-height: 500px;",4,"ngIf"],[1,"chat-footer"],["align","end"],["mat-raised-button","","color","primary",3,"disabled","click"],[3,"background-color","click",4,"ngFor","ngForOf"],[3,"click"],["color","basic",4,"ngIf"],["color","primary",4,"ngIf"],["class","label-light-warning",4,"ngIf"],["color","warn",4,"ngIf"],["matLine",""],["matLine","",1,"text-muted"],["color","basic"],["color","primary"],[1,"label-light-warning"],["color","warn"],[1,"top-avatar","m-r-10"],["class","img-circle",3,"src",4,"ngIf"],[1,"img-circle",3,"src"],[1,"font-14"],[2,"min-height","500px"],["fxLayout","row","fxLayoutWrap","wrap"],["fxFlex.gt-lg","100","fxFlex.gt-md","100","fxFlex.gt-xs","100","fxFlex","100"],["label","Profile"],[1,"basic-form"],["profileForm","ngForm"],["fxFlex.gt-sm","100","fxFlex","100"],["matInput","","placeholder","Name","required","","name","profileName",3,"ngModel","disabled","ngModelChange"],["matInput","","placeholder","Email","required","","type","email","name","profileEmail",3,"ngModel","disabled","ngModelChange"],["matInput","","placeholder","Password","type","password","name","profilePassword",3,"ngModel","disabled","ngModelChange"],["label","Activity"],[1,"table-rasponsive"],[1,"table"],[1,"table-header"],[1,"header__item","column-log_id"],[1,"header__item","column-log_name"],[1,"header__item","column-description"],[1,"header__item","column-subject"],[1,"header__item","column-date"],[1,"table-content"],["class","table-row",4,"ngFor","ngForOf"],["label","Roles & Permissions"],[1,"header__item","column-role"],[1,"header__item","column-name"],[1,"header__item","column-detail"],[1,"header__item","column-permission"],[1,"header__item","column-actions"],[1,"table-row"],[1,"table-data","column-log_id"],[1,"table-data","column-log_name"],["matTooltipPosition","below",1,"table-data","column-description"],["matTooltipPosition","below",1,"table-data","column-subject"],[1,"table-data","column-date"],[1,"table-data","column-role"],[1,"table-data","column-name"],["matTooltipPosition","below",1,"table-data","column-detail"],["matTooltipPosition","below",1,"table-data","column-permissions"],["color","primary",4,"ngFor","ngForOf"],[1,"table-data","column-actions"],["mat-icon-button","","color","warn","matTooltip","Remove Role","matTooltipPosition","below",3,"disabled","click"],["aria-label","Edit"]],template:function(e,t){if(1&e){var n=l["\u0275\u0275getCurrentView"]();l["\u0275\u0275elementStart"](0,"div",0),l["\u0275\u0275elementStart"](1,"div",1),l["\u0275\u0275elementStart"](2,"mat-card",2),l["\u0275\u0275elementStart"](3,"mat-sidenav-container",3),l["\u0275\u0275elementStart"](4,"mat-sidenav",4,5),l["\u0275\u0275listener"]("open",function(){return t.sidePanelOpened=!0})("close",function(){return t.sidePanelOpened=!1}),l["\u0275\u0275elementStart"](6,"mat-toolbar",6),l["\u0275\u0275elementStart"](7,"div",7),l["\u0275\u0275elementStart"](8,"span",8),l["\u0275\u0275elementStart"](9,"button",9),l["\u0275\u0275elementStart"](10,"mat-icon"),l["\u0275\u0275text"](11,"contacts"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275text"](12," Users "),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](13,"button",10),l["\u0275\u0275listener"]("click",function(){return t.onAddUser()}),l["\u0275\u0275elementStart"](14,"mat-icon"),l["\u0275\u0275text"](15,"person_add"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275template"](16,oe,2,1,"mat-nav-list",11),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](17,"mat-toolbar",12),l["\u0275\u0275elementStart"](18,"div",13),l["\u0275\u0275elementStart"](19,"button",14),l["\u0275\u0275listener"]("click",function(){return l["\u0275\u0275restoreView"](n),l["\u0275\u0275reference"](5).toggle()}),l["\u0275\u0275elementStart"](20,"mat-icon"),l["\u0275\u0275text"](21,"short_text"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275template"](22,ce,3,2,"span",15),l["\u0275\u0275elementStart"](23,"div",16),l["\u0275\u0275template"](24,de,2,1,"div",17),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](25,"mat-card-content",18),l["\u0275\u0275template"](26,fe,58,10,"div",19),l["\u0275\u0275template"](27,ge,1,0,"div",19),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](28,"mat-card-actions",20),l["\u0275\u0275elementStart"](29,"div",21),l["\u0275\u0275elementStart"](30,"button",22),l["\u0275\u0275listener"]("click",function(){return t.onAddRole()}),l["\u0275\u0275text"](31,"Assign Role"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"]()}2&e&&(l["\u0275\u0275advance"](3),l["\u0275\u0275property"]("ngClass",l["\u0275\u0275pureFunction2"](10,he,t.sidePanelOpened,!t.sidePanelOpened)),l["\u0275\u0275advance"](1),l["\u0275\u0275property"]("mode",t.isOver()?"over":"side")("opened",!t.isOver()),l["\u0275\u0275advance"](9),l["\u0275\u0275property"]("disabled",!t.checkMyRight("create-user")),l["\u0275\u0275advance"](3),l["\u0275\u0275property"]("ngIf",0!==t.users.length),l["\u0275\u0275advance"](6),l["\u0275\u0275property"]("ngIf",t.selectedUser),l["\u0275\u0275advance"](2),l["\u0275\u0275property"]("ngIf",t.selectedUser),l["\u0275\u0275advance"](2),l["\u0275\u0275property"]("ngIf",t.selectedUser),l["\u0275\u0275advance"](1),l["\u0275\u0275property"]("ngIf",!t.selectedUser),l["\u0275\u0275advance"](3),l["\u0275\u0275property"]("disabled",!t.selectedUser||!t.checkMyRight("create-user")))},directives:[I.xw,I.Wh,I.yH,W.a8,q.TM,r.mk,X.oO,q.JX,Y.Ye,T.lW,N.Hw,j.gM,r.O5,W.dn,W.hq,K.Hk,r.sg,K.Tg,Q.X2,J.SP,J.uX,V["\u0275NgNoValidate"],V.NgControlStatusGroup,V.NgForm,z.KE,G.Nt,V.DefaultValueAccessor,V.RequiredValidator,V.NgControlStatus,V.NgModel,W.$j,Z.qn,Z.HS],pipes:[r.uU],styles:['.ngx-datatable.datatable-body.datatable-row-wrapper.datatable-body-row.datatable-row-group.datatable-body-cell[_ngcontent-%COMP%] .ngx-datatable[_ngcontent-%COMP%]{padding:2px;font-family:Courier New,Courier,monospace}.table[_ngcontent-%COMP%]{width:100%;border:0 solid #eee}.table-header[_ngcontent-%COMP%]{padding:10px 0;font-size:12px}.table-header[_ngcontent-%COMP%], .table-row[_ngcontent-%COMP%]{display:flex;width:100%;border-bottom:1px solid #eee}.table-row[_ngcontent-%COMP%]{padding-left:10px 0;transition:all .2s ease-in-out}.table-row[_ngcontent-%COMP%]:hover{background-color:rgba(97,97,97,.068)}.table-row.status_breaker[_ngcontent-%COMP%]{background-color:rgba(127,255,212,.2)}.table-row[_ngcontent-%COMP%]:hover.status_breaker{background-color:rgba(127,255,212,.7)}.header__item[_ngcontent-%COMP%], .table-data[_ngcontent-%COMP%]{flex:1 1 20%;text-align:center;padding:5px}.header__item[_ngcontent-%COMP%]{text-transform:uppercase;font-family:Verdana,Geneva,Tahoma,sans-serif;font-size:12px}.filter__link[_ngcontent-%COMP%]{color:#fff;text-decoration:none;position:relative;display:inline-block;padding-left:24px;padding-right:24px}.filter__link[_ngcontent-%COMP%]:after{content:"";position:absolute;right:-18px;color:#fff;font-size:12px;top:50%;transform:translateY(-50%)}.filter__link.desc[_ngcontent-%COMP%]:after{content:"(desc)"}.filter__link.asc[_ngcontent-%COMP%]:after{content:"(asc)"}.column-name[_ngcontent-%COMP%], .column-role[_ngcontent-%COMP%]{flex:0 0 15%;font-size:12px;text-align:left;font-family:Verdana,Geneva,Tahoma,sans-serif}.column-detail[_ngcontent-%COMP%], .column-permissions[_ngcontent-%COMP%]{flex:0 0 30%;font-size:12px}.column-permissions[_ngcontent-%COMP%]{text-align:center}.column-actions[_ngcontent-%COMP%]{flex:0 0 10%}.column-log_id[_ngcontent-%COMP%]{flex:0 0 10%}.column-log_id[_ngcontent-%COMP%], .column-log_name[_ngcontent-%COMP%]{font-size:12px;text-align:left;font-family:Verdana,Geneva,Tahoma,sans-serif}.column-log_name[_ngcontent-%COMP%]{flex:0 0 20%}.column-description[_ngcontent-%COMP%], .column-subject[_ngcontent-%COMP%]{flex:0 0 25%;font-size:12px}.column-date[_ngcontent-%COMP%]{flex:0 0 20%;font-size:12px}']}),t}(),ve=function(){var t=function(){function t(n){e(this,t),this.http=n,this.apiUrl=O.N.apiUrl}return n(t,[{key:"getListTemplates",value:function(){return this.http.get(this.apiUrl+"management-console/news/list-templates")}},{key:"getListGenTime",value:function(){return this.http.get(this.apiUrl+"management-console/news/list-templates/time")}},{key:"enableListTemplate",value:function(e){return this.http.put(this.apiUrl+"management-console/news/list-templates/enable",e)}},{key:"disableListTemplate",value:function(e){return this.http.put(this.apiUrl+"management-console/news/list-templates/disable",e)}},{key:"setSettingsKey",value:function(e){return this.http.put(this.apiUrl+"management-console/settings/set",e)}},{key:"createListTemplate",value:function(e){return this.http.post(this.apiUrl+"management-console/news/list-templates/create",e)}},{key:"deleteListTemplate",value:function(e){return this.http.delete(this.apiUrl+"management-console/news/list-templates/"+e)}},{key:"getBreakers",value:function(){return this.http.get(this.apiUrl+"management-console/news/breakers/manage/get")}},{key:"createBreaker",value:function(e){return this.http.post(this.apiUrl+"management-console/news/breakers/manage/create",e)}},{key:"deleteBreakers",value:function(e){return this.http.delete(this.apiUrl+"management-console/news/breakers/manage/delete/"+e)}}]),t}();return t.\u0275fac=function(e){return new(e||t)(l["\u0275\u0275inject"](M.eN))},t.\u0275prov=l["\u0275\u0275defineInjectable"]({token:t,factory:t.\u0275fac,providedIn:"root"}),t}(),xe=function t(){e(this,t),this.list_name=""},_e=function t(){e(this,t)},Se=function(){var t=function(){function t(n,a,i,r,o){e(this,t),this.dialogRef=n,this.data=a,this.store=i,this.userService=r,this.updates$=o,this.onAdd=new l.EventEmitter,this.template=new xe}return n(t,[{key:"ngOnInit",value:function(){this.template.enabled=!0}},{key:"addTemplate",value:function(){this.onAdd.emit(this.template),this.dialogRef.close(!0)}},{key:"closeDialog",value:function(e){this.dialogRef.close(e)}}]),t}();return t.\u0275fac=function(e){return new(e||t)(l["\u0275\u0275directiveInject"](k.so),l["\u0275\u0275directiveInject"](k.WI),l["\u0275\u0275directiveInject"](A.yh),l["\u0275\u0275directiveInject"](P),l["\u0275\u0275directiveInject"](d.eX))},t.\u0275cmp=l["\u0275\u0275defineComponent"]({type:t,selectors:[["add-news-list-template-dialog"]],decls:16,vars:2,consts:[["mat-dialog-title",""],[1,"basic-form"],["userForm","ngForm"],["mat-dialog-content",""],["fxLayout","row","fxLayoutWrap","wrap",2,"margin-top","20px"],["fxFlex.gt-sm","100","fxFlex","100"],["appearance","outline"],["matInput","","mat-autosize","","required","","name","templateName",3,"ngModel","ngModelChange"],["mat-dialog-actions","","align","end"],["mat-button","","color","basic",3,"click"],["mat-raised-button","","color","primary",3,"disabled","click"]],template:function(e,t){if(1&e&&(l["\u0275\u0275elementStart"](0,"h3",0),l["\u0275\u0275text"](1,"Add News List Template"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](2,"form",1,2),l["\u0275\u0275elementStart"](4,"div",3),l["\u0275\u0275elementStart"](5,"div",4),l["\u0275\u0275elementStart"](6,"div",5),l["\u0275\u0275elementStart"](7,"mat-form-field",6),l["\u0275\u0275elementStart"](8,"mat-label"),l["\u0275\u0275text"](9,"Template Name"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](10,"input",7),l["\u0275\u0275listener"]("ngModelChange",function(e){return t.template.list_name=e}),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](11,"div",8),l["\u0275\u0275elementStart"](12,"button",9),l["\u0275\u0275listener"]("click",function(){return t.closeDialog(!0)}),l["\u0275\u0275text"](13,"Cancel"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](14,"button",10),l["\u0275\u0275listener"]("click",function(){return t.addTemplate()}),l["\u0275\u0275text"](15,"Add Template"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"]()),2&e){var n=l["\u0275\u0275reference"](3);l["\u0275\u0275advance"](10),l["\u0275\u0275property"]("ngModel",t.template.list_name),l["\u0275\u0275advance"](4),l["\u0275\u0275property"]("disabled",!n.form.valid)}},directives:[k.uh,V["\u0275NgNoValidate"],V.NgControlStatusGroup,V.NgForm,k.xY,I.xw,I.yH,z.KE,z.hX,G.Nt,V.DefaultValueAccessor,V.RequiredValidator,V.NgControlStatus,V.NgModel,k.H8,T.lW],styles:['.table[_ngcontent-%COMP%]{width:100%;border:0 solid #eee}.table-header[_ngcontent-%COMP%]{padding:10px 0;font-size:12px}.table-header[_ngcontent-%COMP%], .table-row[_ngcontent-%COMP%]{display:flex;width:100%;border-bottom:1px solid #eee}.table-row[_ngcontent-%COMP%]{padding-left:10px 0;transition:all .2s ease-in-out}.table-row[_ngcontent-%COMP%]:hover{background-color:rgba(97,97,97,.068)}.table-row.role_assigned[_ngcontent-%COMP%]{background-color:rgba(127,255,212,.2)}.table-row[_ngcontent-%COMP%]:hover.role_assigned{background-color:rgba(127,255,212,.7)}.header__item[_ngcontent-%COMP%], .table-data[_ngcontent-%COMP%]{flex:1 1 20%;text-align:center;padding:5px}.header__item[_ngcontent-%COMP%]{text-transform:uppercase;font-family:Verdana,Geneva,Tahoma,sans-serif;font-size:12px}.filter__link[_ngcontent-%COMP%]{color:#fff;text-decoration:none;position:relative;display:inline-block;padding-left:24px;padding-right:24px}.filter__link[_ngcontent-%COMP%]:after{content:"";position:absolute;right:-18px;color:#fff;font-size:12px;top:50%;transform:translateY(-50%)}.filter__link.desc[_ngcontent-%COMP%]:after{content:"(desc)"}.filter__link.asc[_ngcontent-%COMP%]:after{content:"(asc)"}.column-name[_ngcontent-%COMP%], .column-role[_ngcontent-%COMP%]{flex:0 0 20%;font-size:12px;text-align:left;font-family:Verdana,Geneva,Tahoma,sans-serif}.column-detail[_ngcontent-%COMP%]{flex:0 0 40%;font-size:12px}.column-actions[_ngcontent-%COMP%]{flex:0 0 20%}']}),t}(),Ee=i(56157);function ye(e,t){if(1&e){var n=l["\u0275\u0275getCurrentView"]();l["\u0275\u0275elementStart"](0,"button",23),l["\u0275\u0275listener"]("click",function(){l["\u0275\u0275restoreView"](n);var e=l["\u0275\u0275nextContext"]().$implicit;return l["\u0275\u0275nextContext"]().enable(e.id)}),l["\u0275\u0275elementStart"](1,"mat-icon",24),l["\u0275\u0275text"](2,"check_circle"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"]()}}function we(e,t){if(1&e){var n=l["\u0275\u0275getCurrentView"]();l["\u0275\u0275elementStart"](0,"button",25),l["\u0275\u0275listener"]("click",function(){l["\u0275\u0275restoreView"](n);var e=l["\u0275\u0275nextContext"]().$implicit;return l["\u0275\u0275nextContext"]().disable(e.id)}),l["\u0275\u0275elementStart"](1,"mat-icon",24),l["\u0275\u0275text"](2,"do_not_disturb_on"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"]()}}function Ce(e,t){if(1&e){var n=l["\u0275\u0275getCurrentView"]();l["\u0275\u0275elementStart"](0,"div"),l["\u0275\u0275elementStart"](1,"div",17),l["\u0275\u0275text"](2),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](3,"div",18),l["\u0275\u0275elementStart"](4,"button",19),l["\u0275\u0275listener"]("click",function(){var e=l["\u0275\u0275restoreView"](n).$implicit;return l["\u0275\u0275nextContext"]().onDeleteTemplate(e.id)}),l["\u0275\u0275elementStart"](5,"mat-icon",20),l["\u0275\u0275text"](6,"clear"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275template"](7,ye,3,0,"button",21),l["\u0275\u0275template"](8,we,3,0,"button",22),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"]()}if(2&e){var a=t.$implicit;l["\u0275\u0275classMapInterpolate1"]("table-row status_",a.enabled,""),l["\u0275\u0275advance"](2),l["\u0275\u0275textInterpolate"](a.list_name),l["\u0275\u0275advance"](5),l["\u0275\u0275property"]("ngIf",!a.enabled),l["\u0275\u0275advance"](1),l["\u0275\u0275property"]("ngIf",a.enabled)}}var ke=function(){var t=function(){function t(n,a,i){e(this,t),this.adminNewsService=n,this.dialog=a,this.snackBar=i,this.templates=[],this.generationTime=new _e,this.destroySubject$=new R.xQ}return n(t,[{key:"ngOnInit",value:function(){var e=this;this.generationTime.key="list_generation_time",this.adminNewsService.getListTemplates().pipe((0,U.R)(this.destroySubject$)).subscribe(function(t){return e.templates=t}),this.adminNewsService.getListGenTime().pipe((0,U.R)(this.destroySubject$)).subscribe(function(t){return e.generationTime.value=t.value})}},{key:"enable",value:function(e){var t=this;this.adminNewsService.enableListTemplate({template_id:e}).pipe((0,U.R)(this.destroySubject$)).subscribe(function(e){t.templates=e})}},{key:"disable",value:function(e){var t=this;this.adminNewsService.disableListTemplate({template_id:e}).pipe((0,U.R)(this.destroySubject$)).subscribe(function(e){t.templates=e})}},{key:"updateTime",value:function(){var e=this;this.adminNewsService.setSettingsKey(this.generationTime).pipe((0,U.R)(this.destroySubject$)).subscribe(function(t){e.generationTime=t,e.openSnackBar("List Generations Time updated!")})}},{key:"onAddTemplate",value:function(){var e=this;this.dialog.open(Se,{width:"40%",height:"auto",maxHeight:"95%"}).componentInstance.onAdd.pipe((0,U.R)(this.destroySubject$)).subscribe(function(t){e.adminNewsService.createListTemplate(t).pipe((0,U.R)(e.destroySubject$)).subscribe(function(t){e.templates=t})})}},{key:"onDeleteTemplate",value:function(e){var t=this,n=this.dialog.open(Ee.$,{width:"350px",data:{title:"Delete News List Template",message:"Are you sure you want to delete this Template?"}});n.afterClosed().pipe((0,U.R)(this.destroySubject$)).subscribe(function(a){n=null,a&&t.adminNewsService.deleteListTemplate(e).pipe((0,U.R)(t.destroySubject$)).subscribe(function(e){t.templates=e})})}},{key:"openSnackBar",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"close";this.snackBar.open(e,t,{duration:1e3})}},{key:"ngOnDestroy",value:function(){this.destroySubject$.next()}}]),t}();return t.\u0275fac=function(e){return new(e||t)(l["\u0275\u0275directiveInject"](ve),l["\u0275\u0275directiveInject"](k.uw),l["\u0275\u0275directiveInject"](H.ux))},t.\u0275cmp=l["\u0275\u0275defineComponent"]({type:t,selectors:[["app-news-list"]],decls:35,vars:2,consts:[["fxLayout","row","fxLayoutWrap","wrap"],["fxFlex.gt-lg","85","fxFlex.gt-md","75","fxFlex.gt-xs","100","fxFlex","100"],[1,"table-rasponsive"],[1,"table"],[1,"table-header"],[1,"header__item","column-name"],[1,"header__item","column-actions"],[1,"table-content"],[3,"class",4,"ngFor","ngForOf"],["align","end"],["mat-raised-button","","color","accent",3,"click"],["fxFlex.gt-lg","15","fxFlex.gt-md","25","fxFlex.gt-xs","100","fxFlex","100"],[1,"oh"],["fxFlex.gt-md","100","fxFlex","100"],["appearance","outline"],["matInput","","placeholder","News List Generation Time","required","","name","ListTime",3,"ngModel","ngModelChange"],["ListTime",""],[1,"table-data","column-name"],[1,"table-data","column-actions"],["mat-icon-button","","color","warn","matTooltip","Remove Template","matTooltipPosition","below",3,"click"],["aria-label","Edit"],["mat-icon-button","","color","basic","matTooltip","Enable Template","matTooltipPosition","below",3,"click",4,"ngIf"],["mat-icon-button","","color","warn","matTooltip","Disable Template","matTooltipPosition","below",3,"click",4,"ngIf"],["mat-icon-button","","color","basic","matTooltip","Enable Template","matTooltipPosition","below",3,"click"],["aria-label","Approve"],["mat-icon-button","","color","warn","matTooltip","Disable Template","matTooltipPosition","below",3,"click"]],template:function(e,t){1&e&&(l["\u0275\u0275elementStart"](0,"div",0),l["\u0275\u0275elementStart"](1,"div",1),l["\u0275\u0275elementStart"](2,"mat-card"),l["\u0275\u0275elementStart"](3,"mat-card-content"),l["\u0275\u0275elementStart"](4,"mat-card-title"),l["\u0275\u0275text"](5,"List Templates"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](6,"mat-card-subtitle"),l["\u0275\u0275text"](7,"News Lists to be generated everyday"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](8,"div",2),l["\u0275\u0275elementStart"](9,"div",3),l["\u0275\u0275elementStart"](10,"div",4),l["\u0275\u0275elementStart"](11,"div",5),l["\u0275\u0275text"](12,"List Name"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](13,"div",6),l["\u0275\u0275text"](14,"Actions"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](15,"div",7),l["\u0275\u0275template"](16,Ce,9,6,"div",8),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](17,"mat-card-actions",9),l["\u0275\u0275elementStart"](18,"button",10),l["\u0275\u0275listener"]("click",function(){return t.onAddTemplate()}),l["\u0275\u0275text"](19,"Add a Template"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](20,"div",11),l["\u0275\u0275elementStart"](21,"mat-card",12),l["\u0275\u0275elementStart"](22,"mat-card-content"),l["\u0275\u0275elementStart"](23,"p"),l["\u0275\u0275text"](24," News Lists generation time "),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](25,"div",0),l["\u0275\u0275elementStart"](26,"div",13),l["\u0275\u0275elementStart"](27,"mat-form-field",14),l["\u0275\u0275elementStart"](28,"mat-label"),l["\u0275\u0275text"](29,"Time"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](30,"input",15,16),l["\u0275\u0275listener"]("ngModelChange",function(e){return t.generationTime.value=e}),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](32,"mat-card-actions",9),l["\u0275\u0275elementStart"](33,"button",10),l["\u0275\u0275listener"]("click",function(){return t.updateTime()}),l["\u0275\u0275text"](34,"Update Time"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"]()),2&e&&(l["\u0275\u0275advance"](16),l["\u0275\u0275property"]("ngForOf",t.templates),l["\u0275\u0275advance"](14),l["\u0275\u0275property"]("ngModel",t.generationTime.value))},directives:[I.xw,I.yH,W.a8,W.dn,W.n5,W.$j,r.sg,W.hq,T.lW,z.KE,z.hX,G.Nt,V.DefaultValueAccessor,V.RequiredValidator,V.NgControlStatus,V.NgModel,j.gM,N.Hw,r.O5],styles:['.table[_ngcontent-%COMP%]{width:100%;border:0 solid #eee;margin-bottom:20px}.table-header[_ngcontent-%COMP%]{padding:10px 0;font-size:12px}.table-header[_ngcontent-%COMP%], .table-row[_ngcontent-%COMP%]{display:flex;width:100%;border-bottom:1px solid #eee}.table-row[_ngcontent-%COMP%]{padding-left:10px 0;transition:all .2s ease-in-out}.table-row[_ngcontent-%COMP%]:hover{background-color:rgba(97,97,97,.068)}.table-row.status_breaker[_ngcontent-%COMP%]{background-color:rgba(127,255,212,.2)}.table-row[_ngcontent-%COMP%]:hover.status_breaker{background-color:rgba(127,255,212,.7)}.table-row.status_0[_ngcontent-%COMP%]{background-color:rgba(255,127,159,.1)}.table-row[_ngcontent-%COMP%]:hover.status_0{background-color:rgba(255,127,159,.4)}.header__item[_ngcontent-%COMP%], .table-data[_ngcontent-%COMP%]{flex:1 1 20%;text-align:center;padding:5px}.header__item[_ngcontent-%COMP%]{text-transform:uppercase;font-family:Verdana,Geneva,Tahoma,sans-serif;font-size:12px}.filter__link[_ngcontent-%COMP%]{color:#fff;text-decoration:none;position:relative;display:inline-block;padding-left:24px;padding-right:24px}.filter__link[_ngcontent-%COMP%]:after{content:"";position:absolute;right:-18px;color:#fff;font-size:12px;top:50%;transform:translateY(-50%)}.filter__link.desc[_ngcontent-%COMP%]:after{content:"(desc)"}.filter__link.asc[_ngcontent-%COMP%]:after{content:"(asc)"}.column-name[_ngcontent-%COMP%]{flex:0 0 85%;font-size:12px;font-family:Verdana,Geneva,Tahoma,sans-serif;text-align:left}.column-actions[_ngcontent-%COMP%]{flex:0 0 15%}']}),t}(),Oe=i(64587),Me=function(){var t=function(){function t(n,a,i,r,o){e(this,t),this.dialogRef=n,this.data=a,this.store=i,this.userService=r,this.updates$=o,this.onAdd=new l.EventEmitter,this.breaker=new Oe.Sq}return n(t,[{key:"ngOnInit",value:function(){}},{key:"addBreaker",value:function(){this.onAdd.emit(this.breaker),this.dialogRef.close(!0),console.log(JSON.stringify(this.breaker))}},{key:"closeDialog",value:function(e){this.dialogRef.close(e)}}]),t}();return t.\u0275fac=function(e){return new(e||t)(l["\u0275\u0275directiveInject"](k.so),l["\u0275\u0275directiveInject"](k.WI),l["\u0275\u0275directiveInject"](A.yh),l["\u0275\u0275directiveInject"](P),l["\u0275\u0275directiveInject"](d.eX))},t.\u0275cmp=l["\u0275\u0275defineComponent"]({type:t,selectors:[["add-news-breaker-dialog"]],decls:16,vars:2,consts:[["mat-dialog-title",""],[1,"basic-form"],["userForm","ngForm"],["mat-dialog-content",""],["fxLayout","row","fxLayoutWrap","wrap",2,"margin-top","20px"],["fxFlex.gt-sm","100","fxFlex","100"],["appearance","outline"],["matInput","","mat-autosize","","required","","name","templateName",3,"ngModel","ngModelChange"],["mat-dialog-actions","","align","end"],["mat-button","","color","basic",3,"click"],["mat-raised-button","","color","primary",3,"disabled","click"]],template:function(e,t){if(1&e&&(l["\u0275\u0275elementStart"](0,"h3",0),l["\u0275\u0275text"](1,"Add News Breaker"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](2,"form",1,2),l["\u0275\u0275elementStart"](4,"div",3),l["\u0275\u0275elementStart"](5,"div",4),l["\u0275\u0275elementStart"](6,"div",5),l["\u0275\u0275elementStart"](7,"mat-form-field",6),l["\u0275\u0275elementStart"](8,"mat-label"),l["\u0275\u0275text"](9,"Breaker Name"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](10,"input",7),l["\u0275\u0275listener"]("ngModelChange",function(e){return t.breaker.news_name=e}),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](11,"div",8),l["\u0275\u0275elementStart"](12,"button",9),l["\u0275\u0275listener"]("click",function(){return t.closeDialog(!0)}),l["\u0275\u0275text"](13,"Cancel"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](14,"button",10),l["\u0275\u0275listener"]("click",function(){return t.addBreaker()}),l["\u0275\u0275text"](15,"Add Breaker"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"]()),2&e){var n=l["\u0275\u0275reference"](3);l["\u0275\u0275advance"](10),l["\u0275\u0275property"]("ngModel",t.breaker.news_name),l["\u0275\u0275advance"](4),l["\u0275\u0275property"]("disabled",!n.form.valid)}},directives:[k.uh,V["\u0275NgNoValidate"],V.NgControlStatusGroup,V.NgForm,k.xY,I.xw,I.yH,z.KE,z.hX,G.Nt,V.DefaultValueAccessor,V.RequiredValidator,V.NgControlStatus,V.NgModel,k.H8,T.lW],styles:['.table[_ngcontent-%COMP%]{width:100%;border:0 solid #eee}.table-header[_ngcontent-%COMP%]{padding:10px 0;font-size:12px}.table-header[_ngcontent-%COMP%], .table-row[_ngcontent-%COMP%]{display:flex;width:100%;border-bottom:1px solid #eee}.table-row[_ngcontent-%COMP%]{padding-left:10px 0;transition:all .2s ease-in-out}.table-row[_ngcontent-%COMP%]:hover{background-color:rgba(97,97,97,.068)}.table-row.role_assigned[_ngcontent-%COMP%]{background-color:rgba(127,255,212,.2)}.table-row[_ngcontent-%COMP%]:hover.role_assigned{background-color:rgba(127,255,212,.7)}.header__item[_ngcontent-%COMP%], .table-data[_ngcontent-%COMP%]{flex:1 1 20%;text-align:center;padding:5px}.header__item[_ngcontent-%COMP%]{text-transform:uppercase;font-family:Verdana,Geneva,Tahoma,sans-serif;font-size:12px}.filter__link[_ngcontent-%COMP%]{color:#fff;text-decoration:none;position:relative;display:inline-block;padding-left:24px;padding-right:24px}.filter__link[_ngcontent-%COMP%]:after{content:"";position:absolute;right:-18px;color:#fff;font-size:12px;top:50%;transform:translateY(-50%)}.filter__link.desc[_ngcontent-%COMP%]:after{content:"(desc)"}.filter__link.asc[_ngcontent-%COMP%]:after{content:"(asc)"}.column-name[_ngcontent-%COMP%], .column-role[_ngcontent-%COMP%]{flex:0 0 20%;font-size:12px;text-align:left;font-family:Verdana,Geneva,Tahoma,sans-serif}.column-detail[_ngcontent-%COMP%]{flex:0 0 40%;font-size:12px}.column-actions[_ngcontent-%COMP%]{flex:0 0 20%}']}),t}();function Pe(e,t){if(1&e){var n=l["\u0275\u0275getCurrentView"]();l["\u0275\u0275elementStart"](0,"div",11),l["\u0275\u0275elementStart"](1,"div",12),l["\u0275\u0275text"](2),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](3,"div",13),l["\u0275\u0275elementStart"](4,"button",14),l["\u0275\u0275listener"]("click",function(){var e=l["\u0275\u0275restoreView"](n).$implicit;return l["\u0275\u0275nextContext"]().onDeleteBreaker(e.id)}),l["\u0275\u0275elementStart"](5,"mat-icon",15),l["\u0275\u0275text"](6,"clear"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"]()}if(2&e){var a=t.$implicit;l["\u0275\u0275advance"](2),l["\u0275\u0275textInterpolate"](a.news_name)}}var Re,Ue=[{path:"",children:[{path:"admin-dashboard",component:s,data:{role:"admin"}},{path:"user-console",component:be,data:{role:"admin"}},{path:"news-settings/list",component:ke,data:{role:"admin"}},{path:"news-settings/breakers",component:(Re=function(){function t(n,a,i){e(this,t),this.adminNewsService=n,this.dialog=a,this.snackBar=i,this.destroySubject$=new R.xQ}return n(t,[{key:"ngOnInit",value:function(){var e=this;this.adminNewsService.getBreakers().subscribe(function(t){e.breakers=t})}},{key:"onAddBreaker",value:function(){var e=this;this.dialog.open(Me,{width:"40%",height:"auto",maxHeight:"95%"}).componentInstance.onAdd.pipe((0,U.R)(this.destroySubject$)).subscribe(function(t){e.adminNewsService.createBreaker(t).subscribe(function(t){e.breakers=t})})}},{key:"onDeleteBreaker",value:function(e){var t=this,n=this.dialog.open(Ee.$,{width:"350px",data:{title:"Delete News Breaker",message:"Are you sure you want to delete this Breaker?"}});n.afterClosed().pipe((0,U.R)(this.destroySubject$)).subscribe(function(a){n=null,a&&t.adminNewsService.deleteBreakers(e).subscribe(function(e){t.breakers=e})})}},{key:"ngOnDestroy",value:function(){this.destroySubject$.next()}}]),t}(),Re.\u0275fac=function(e){return new(e||Re)(l["\u0275\u0275directiveInject"](ve),l["\u0275\u0275directiveInject"](k.uw),l["\u0275\u0275directiveInject"](H.ux))},Re.\u0275cmp=l["\u0275\u0275defineComponent"]({type:Re,selectors:[["app-news-breakers"]],decls:18,vars:1,consts:[["fxLayout","row","fxLayoutWrap","wrap"],["fxFlex.gt-lg","85","fxFlex.gt-md","75","fxFlex.gt-xs","100","fxFlex","100"],[1,"table-rasponsive"],[1,"table"],[1,"table-header"],[1,"header__item","column-name"],[1,"header__item","column-actions"],[1,"table-content"],["class","table-row",4,"ngFor","ngForOf"],["align","end"],["mat-raised-button","","color","accent",3,"click"],[1,"table-row"],[1,"table-data","column-name"],[1,"table-data","column-actions"],["mat-icon-button","","color","warn","matTooltip","Remove Template","matTooltipPosition","below",3,"click"],["aria-label","Edit"]],template:function(e,t){1&e&&(l["\u0275\u0275elementStart"](0,"div",0),l["\u0275\u0275elementStart"](1,"div",1),l["\u0275\u0275elementStart"](2,"mat-card"),l["\u0275\u0275elementStart"](3,"mat-card-content"),l["\u0275\u0275elementStart"](4,"mat-card-title"),l["\u0275\u0275text"](5,"News Breakers"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](6,"div",2),l["\u0275\u0275elementStart"](7,"div",3),l["\u0275\u0275elementStart"](8,"div",4),l["\u0275\u0275elementStart"](9,"div",5),l["\u0275\u0275text"](10,"Breaker Name"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](11,"div",6),l["\u0275\u0275text"](12,"Actions"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](13,"div",7),l["\u0275\u0275template"](14,Pe,7,1,"div",8),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementStart"](15,"mat-card-actions",9),l["\u0275\u0275elementStart"](16,"button",10),l["\u0275\u0275listener"]("click",function(){return t.onAddBreaker()}),l["\u0275\u0275text"](17,"Add Breaker"),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"](),l["\u0275\u0275elementEnd"]()),2&e&&(l["\u0275\u0275advance"](14),l["\u0275\u0275property"]("ngForOf",t.breakers))},directives:[I.xw,I.yH,W.a8,W.dn,W.n5,r.sg,W.hq,T.lW,j.gM,N.Hw],styles:['.table[_ngcontent-%COMP%]{width:100%;border:0 solid #eee;margin-bottom:20px}.table-header[_ngcontent-%COMP%]{padding:10px 0;font-size:12px}.table-header[_ngcontent-%COMP%], .table-row[_ngcontent-%COMP%]{display:flex;width:100%;border-bottom:1px solid #eee}.table-row[_ngcontent-%COMP%]{padding-left:10px 0;transition:all .2s ease-in-out}.table-row[_ngcontent-%COMP%]:hover{background-color:rgba(97,97,97,.068)}.table-row.status_breaker[_ngcontent-%COMP%]{background-color:rgba(127,255,212,.2)}.table-row[_ngcontent-%COMP%]:hover.status_breaker{background-color:rgba(127,255,212,.7)}.table-row.status_0[_ngcontent-%COMP%]{background-color:rgba(255,127,159,.1)}.table-row[_ngcontent-%COMP%]:hover.status_0{background-color:rgba(255,127,159,.4)}.header__item[_ngcontent-%COMP%], .table-data[_ngcontent-%COMP%]{flex:1 1 20%;text-align:center;padding:5px}.header__item[_ngcontent-%COMP%]{text-transform:uppercase;font-family:Verdana,Geneva,Tahoma,sans-serif;font-size:12px}.filter__link[_ngcontent-%COMP%]{color:#fff;text-decoration:none;position:relative;display:inline-block;padding-left:24px;padding-right:24px}.filter__link[_ngcontent-%COMP%]:after{content:"";position:absolute;right:-18px;color:#fff;font-size:12px;top:50%;transform:translateY(-50%)}.filter__link.desc[_ngcontent-%COMP%]:after{content:"(desc)"}.filter__link.asc[_ngcontent-%COMP%]:after{content:"(asc)"}.column-name[_ngcontent-%COMP%]{flex:0 0 85%;font-size:12px;font-family:Verdana,Geneva,Tahoma,sans-serif;text-align:left}.column-actions[_ngcontent-%COMP%]{flex:0 0 15%}']}),Re),data:{role:"admin"}}]}],Ae=i(75425),Ie=i(48333),Te=i(77154),je=i(87038),Ne=i(63564),Le=i(37703),$e={isLoaded:!1,users:[]};function Fe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$e,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"[Admin] GET_USERS":return Object.assign(Object.assign({},e),{isLoaded:!1});case"[Admin] GET_USERS_SUCCESS":return Object.assign(Object.assign({},e),{users:t.payload,isLoaded:!0});case"[Admin] ASSIGN_ROLE":return Object.assign(Object.assign({},e),{isLoaded:!1});case"[Admin] ASSIGN_ROLE_SUCCESS":return Object.assign(Object.assign({},e),{users:t.payload,isLoaded:!0});case"[Admin] REMOVE_ROLE":return Object.assign(Object.assign({},e),{isLoaded:!1});case"[Admin] REMOVE_ROLE_SUCCESS":return Object.assign(Object.assign({},e),{users:t.payload,isLoaded:!0});case"[Admin] CREATE_USER":return Object.assign(Object.assign({},e),{isLoaded:!1});case"[Admin] CREATE_USER_SUCCESS":return Object.assign(Object.assign({},e),{users:t.payload,isLoaded:!0});case"[Admin] UPDATE_USER":return Object.assign(Object.assign({},e),{isLoaded:!1});case"[Admin] UPDATE_USER_SUCCESS":return Object.assign(Object.assign({},e),{users:t.payload,isLoaded:!0});case"[Admin] GET_USERS_ERROR":return Object.assign(Object.assign({},e),{isLoaded:!0});default:return e}}(0,A.ZF)("Admin");var Ve,ze=i(73982),Ge=i(79996),De=i(47727),Be=i(40878),He=i(48318),We=function(e,t,n,a){var i,r=arguments.length,o=r<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,a);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(o=(r<3?i(o):r>3?i(t,n,o):i(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o},qe=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Xe=function(){var t=function t(n,a){var i=this;e(this,t),this.actions$=n,this.userService=a,this.GetMyNews$=this.actions$.pipe((0,d.l4)("[Admin] GET_USERS"),(0,ze.zg)(function(e){return i.userService.getUsers().pipe((0,Ge.U)(function(e){return new u(e)}),(0,De.K)(function(){return(0,Be.of)(new p)}))})),this.AssignRole$=this.actions$.pipe((0,d.l4)("[Admin] ASSIGN_ROLE"),(0,ze.zg)(function(e){return i.userService.assignRole({user_id:e.payload.user_id,role_id:e.payload.role_id}).pipe((0,Ge.U)(function(e){return console.log(e),new g(e)}),(0,De.K)(function(){return(0,Be.of)(new h)}))})),this.RemoveRole$=this.actions$.pipe((0,d.l4)("[Admin] REMOVE_ROLE"),(0,ze.zg)(function(e){return i.userService.removeRole({user_id:e.payload.user_id,role_id:e.payload.role_id}).pipe((0,Ge.U)(function(e){return console.log(e),new v(e)}),(0,De.K)(function(){return(0,Be.of)(new x)}))})),this.CreateUser$=this.actions$.pipe((0,d.l4)("[Admin] CREATE_USER"),(0,ze.zg)(function(e){return i.userService.createUser(e.payload).pipe((0,Ge.U)(function(e){return console.log(e),new S(e)}),(0,De.K)(function(){return(0,Be.of)(new E)}))})),this.UpdateUser$=this.actions$.pipe((0,d.l4)("[Admin] UPDATE_USER"),(0,ze.zg)(function(e){return i.userService.updateUser(e.payload).pipe((0,Ge.U)(function(e){return console.log(e),new w(e)}),(0,De.K)(function(){return(0,Be.of)(new C)}))}))};return t.\u0275fac=function(e){return new(e||t)(l["\u0275\u0275inject"](d.eX),l["\u0275\u0275inject"](P))},t.\u0275prov=l["\u0275\u0275defineInjectable"]({token:t,factory:t.\u0275fac}),We([(0,d.Qm)(),qe("design:type",He.y)],t.prototype,"GetMyNews$",void 0),We([(0,d.Qm)(),qe("design:type",He.y)],t.prototype,"AssignRole$",void 0),We([(0,d.Qm)(),qe("design:type",He.y)],t.prototype,"RemoveRole$",void 0),We([(0,d.Qm)(),qe("design:type",He.y)],t.prototype,"CreateUser$",void 0),We([(0,d.Qm)(),qe("design:type",He.y)],t.prototype,"UpdateUser$",void 0),t}(),Ye=((Ve=function t(){e(this,t)}).\u0275fac=function(e){return new(e||Ve)},Ve.\u0275mod=l["\u0275\u0275defineNgModule"]({type:Ve}),Ve.\u0275inj=l["\u0275\u0275defineInjector"]({imports:[[r.ez,o.Bz.forChild(Ue),V.FormsModule,Ie.O,Te.o9,je.Xd,Ne.qE,Ae.m,Le.xD,A.Aw.forFeature("Admin",Fe),d.sQ.forFeature([Xe])]]}),Ve)},64587:function(t,a,i){"use strict";i.d(a,{Sq:function(){return r},l$:function(){return o},t7:function(){return l},SQ:function(){return s},pY:function(){return c},Dp:function(){return m},vB:function(){return u},lm:function(){return p},Ln:function(){return f}});var r=function(){function t(){e(this,t),this.news_name="",this.heading="",this.body="",this.newsstatus_id=0,this.user_id=0,this.language=new s("",""),this.newsbar=[new o("","")],this.draft=!1}return n(t,null,[{key:"generateMockNews",value:function(){return new t}}]),t}(),o=function t(n,a,i,r,o,l){e(this,t),this.title=n,this.detail=a,this.id=i,this.news_id=r,this.created_at=o,this.updated_a=l},l=function t(n){e(this,t),this.news=n},s=function t(n,a,i){e(this,t),this.language_code=n,this.language=a,this.id=i},c=function t(){e(this,t),this.id=null,this.name="",this.created_at="",this.updated_at="",this.list_news=[new d]},d=function t(){e(this,t),this.id=null,this.news_list_id=null,this.news_id=null,this.created_at=null,this.updated_at=null,this.news=new r},m=function t(n,a,i){e(this,t),this.list_id=n,this.news_id=a,this.order=i},u=function t(){e(this,t),this.name=""},p=function t(){e(this,t),this.news="",this.language=new s("","")},f=function t(){e(this,t),this.news_numbers=new g,this.lists=[]},g=function t(){e(this,t),this.my=0,this.reject=0,this.approved=0,this.in_review=0}}}])}();