(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{w7Ho:function(t,e,s){"use strict";s.r(e);var o=s("ofXK"),i=s("3Pt+"),r=s("tyNb"),c=s("mrSG"),a=s("Usal"),n=s("pz8m"),h=s("7NWl"),d=s("zwrK"),b=s("nD3/"),l=s("5zJ1"),u=s("ReVU"),f=s("fXoL"),m=s("LEd3"),p=s("RDfn"),w=s("+kG/");function S(t,e){1&t&&f.Nb(0,"app-loader")}function v(t,e){if(1&t){const t=f.Tb();f.Sb(0,"dynamic-modal-form",8),f.ec("OnSubmit",(function(e){return f.xc(t),f.gc().SubmitForm(e)})),f.Rb()}if(2&t){const t=f.gc();f.nc("controls",t.controls)("showLoader",t.showLoader)("showCancel",!1)("showModal",!1)("submitText",t.submitText)}}let g=(()=>{class t{constructor(t,e,s,o,i){this.dataService=t,this.coreActions=e,this.formService=s,this.router=o,this.coreService=i,this.controls=[],this.showLoader=!0,this.submitText="Save Changes",this.User={},this.uploadedFiles=[]}ngOnInit(){this.auth$.subscribe(t=>{this.LoadInfo(t.User.id)})}LoadInfo(t){this.showLoader=!0,this.dataService.GetInfo(t).subscribe(t=>{"error"===t.status?(this.coreActions.Notify({title:t.message,text:"",css:"bg-success"}),this.router.navigate(["/"])):(this.User=t.post,this.coreService.prepareDynamicControlData(this.User),this.initializeControls(this.User)),this.showLoader=!1})}initializeControls(t){this.controls=this.formService.getControls(t,2,!1)}SubmitForm(t){for(const e of Object.keys(this.User))for(const s of Object.keys(t))e===s&&(this.User[e]=t[s]);this.User.attr_values=this.coreService.processDynamicControlsData(t,this.User),this.User.isadmin=!1,this.User.viewType=2,this.showLoader=!0,this.dataService.AddRecord(this.User).subscribe(t=>{"error"===t.status?this.coreActions.Notify({title:t.message,text:"",css:"bg-danger"}):(this.coreActions.Notify({title:"Profile Updated",text:"",css:"bg-success"}),this.router.navigate(["/"])),this.showLoader=!1},t=>{this.showLoader=!1,this.coreActions.Notify({title:"Error Occured",text:"",css:"bg-danger"})})}}return t.\u0275fac=function(e){return new(e||t)(f.Mb(h.a),f.Mb(m.a),f.Mb(n.a),f.Mb(r.c),f.Mb(b.a))},t.\u0275cmp=f.Gb({type:t,selectors:[["app-profilesetup"]],features:[f.yb([h.a,d.a,l.a,n.a,u.a,b.a])],decls:9,vars:2,consts:[[1,"row"],[1,"col-md-12"],[1,"card"],[1,"card-header"],[1,"m-b-0"],[1,"card-body"],[4,"ngIf"],[3,"controls","showLoader","showCancel","showModal","submitText","OnSubmit",4,"ngIf"],[3,"controls","showLoader","showCancel","showModal","submitText","OnSubmit"]],template:function(t,e){1&t&&(f.Sb(0,"div",0),f.Sb(1,"div",1),f.Sb(2,"div",2),f.Sb(3,"div",3),f.Sb(4,"h4",4),f.Gc(5,"Update Profile"),f.Rb(),f.Rb(),f.Sb(6,"div",5),f.Ec(7,S,1,0,"app-loader",6),f.Ec(8,v,1,5,"dynamic-modal-form",7),f.Rb(),f.Rb(),f.Rb(),f.Rb()),2&t&&(f.zb(7),f.nc("ngIf",e.showLoader),f.zb(1),f.nc("ngIf",!e.showLoader&&e.controls.length>0))},directives:[o.n,p.a,w.a],encapsulation:2}),Object(c.a)([Object(a.e)(["users","auth"])],t.prototype,"auth$",void 0),t})();var y=s("o+qO"),U=s("/4iV");s.d(e,"ProfileSetupModule",(function(){return I}));const L=[{path:"",data:{topmenuIndex:U.c.TOPMENU_SETTINGS_INDEX,leftmenuIndex:U.c.SETTINGS_PROFILE_SETUP_INDEX,title:"My Account",urls:[{title:"My Account",url:"/"},{title:"Profile Setup"}]},component:g}];let I=(()=>{class t{}return t.\u0275mod=f.Kb({type:t}),t.\u0275inj=f.Jb({factory:function(e){return new(e||t)},imports:[[i.i,o.c,y.a,r.f.forChild(L)]]}),t})()}}]);