"use strict";(self.webpackChunkmlflow_oidc_auth_front=self.webpackChunkmlflow_oidc_auth_front||[]).push([["src_app_features_home-page_home-page_module_ts"],{1447:(G,u,a)=>{a.r(u),a.d(u,{HomePageModule:()=>k});var d=a(177),m=a(8498),h=a(8250);const g=[{title:"Experiment Name",key:"name"},{title:"Permission",key:"permission"},{title:"Type",key:"type"}],C=[{title:"Model name",key:"name"},{title:"Permissions",key:"permission"},{title:"Type",key:"type"}];var e=a(4438),b=a(5351),I=a(2940),v=a(7875),x=a(5417),y=a(8834),p=a(6850);const M=["userInfoTabs"];function E(t,c){if(1&t&&e.nrm(0,"ml-table",11),2&t){const n=e.XpG();e.Y8G("columnConfig",n.experimentsColumnConfig)("data",n.experimentsDataSource)}}function T(t,c){if(1&t&&e.nrm(0,"ml-table",11),2&t){const n=e.XpG();e.Y8G("columnConfig",n.modelsColumnConfig)("data",n.modelsDataSource)}}function D(t,c){1&t&&(e.j41(0,"div",12)(1,"span"),e.EFF(2,"You have no experiments"),e.k0s()())}function j(t,c){1&t&&(e.j41(0,"div",12)(1,"span"),e.EFF(2,"You have no models"),e.k0s()())}let f=(()=>{class t{constructor(n,o,i,s,l){this.dialog=n,this.authService=o,this.userDataService=i,this.router=s,this.route=l,this.currentUserInfo=null,this.experimentsColumnConfig=g,this.modelsColumnConfig=C,this.experimentsDataSource=[],this.modelsDataSource=[],this.tabIndexMapping=[r.Experiments,r.Models]}ngOnInit(){if(this.currentUserInfo=this.authService.getUserInfo(),this.currentUserInfo){const{experiments:n,models:o}=this.currentUserInfo;this.modelsDataSource=o,this.experimentsDataSource=n}}ngAfterViewInit(){this.userInfoTabs.selectedIndex=this.tabIndexMapping.indexOf(this.route.snapshot.url[0].path)}showAccessKeyModal(){this.userDataService.getAccessKey().subscribe(({token:n})=>{this.dialog.open(h.ad,{data:{token:n}})})}redirectToMLFlow(){window.location.href="/"}handleTabSelection(n){this.router.navigate([`../${this.tabIndexMapping[n]}`],{relativeTo:this.route})}static{this.\u0275fac=function(o){return new(o||t)(e.rXU(b.bZ),e.rXU(I.uR),e.rXU(v.J),e.rXU(m.Ix),e.rXU(m.nX))}}static{this.\u0275cmp=e.VBU({type:t,selectors:[["ml-home-page"]],viewQuery:function(o,i){if(1&o&&e.GBs(M,5),2&o){let s;e.mGM(s=e.lsd())&&(i.userInfoTabs=s.first)}},standalone:!1,decls:20,vars:4,consts:[["userInfoTabs",""],["noExperimentData",""],["noModelData",""],[1,"controls-container","pb-3"],["mat-flat-button","","aria-label","login","color","primary",1,"me-2",3,"click"],["mat-flat-button","","aria-label","login","color","primary",3,"click"],[3,"selectedIndexChange"],["label","Experiments"],[1,"my-3"],[3,"columnConfig","data",4,"ngIf","ngIfElse"],["label","Models"],[3,"columnConfig","data"],[1,"d-flex","w-100","justify-content-center","py-5"]],template:function(o,i){if(1&o){const s=e.RV6();e.j41(0,"div",3)(1,"button",4),e.bIt("click",function(){return e.eBV(s),e.Njj(i.redirectToMLFlow())}),e.j41(2,"span"),e.EFF(3,"Login to MLFlow"),e.k0s()(),e.j41(4,"button",5),e.bIt("click",function(){return e.eBV(s),e.Njj(i.showAccessKeyModal())}),e.j41(5,"span"),e.EFF(6,"Create access key"),e.k0s()()(),e.j41(7,"div")(8,"mat-tab-group",6,0),e.bIt("selectedIndexChange",function(w){return e.eBV(s),e.Njj(i.handleTabSelection(w))}),e.j41(10,"mat-tab",7)(11,"div",8),e.DNE(12,E,1,2,"ml-table",9),e.k0s()(),e.j41(13,"mat-tab",10)(14,"div",8),e.DNE(15,T,1,2,"ml-table",9),e.k0s()()()(),e.DNE(16,D,3,0,"ng-template",null,1,e.C5r)(18,j,3,0,"ng-template",null,2,e.C5r)}if(2&o){const s=e.sdS(17),l=e.sdS(19);e.R7$(12),e.Y8G("ngIf",i.experimentsDataSource.length)("ngIfElse",s),e.R7$(3),e.Y8G("ngIf",i.modelsDataSource.length)("ngIfElse",l)}},dependencies:[d.bT,x.O,y.$z,p.mq,p.T8],styles:[".mat-column-experiment_id[_ngcontent-%COMP%], .mat-column-name[_ngcontent-%COMP%]{white-space:unset!important;width:50%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;hyphens:auto}"]})}}return t})();var r=function(t){return t.Experiments="experiments",t.Models="models",t}(r||{});const S=[{path:r.Experiments,component:f,data:{breadcrumb:"Experiments"}},{path:r.Models,component:f,data:{breadcrumb:"Models"}},{path:"**",redirectTo:r.Experiments}];let P=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e.$C({type:t})}static{this.\u0275inj=e.G2t({imports:[m.iI.forChild(S),m.iI]})}}return t})();var F=a(300);let k=(()=>{class t{static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275mod=e.$C({type:t})}static{this.\u0275inj=e.G2t({imports:[d.MD,F.G,P]})}}return t})()}}]);