"use strict";(self.webpackChunkwebadmin=self.webpackChunkwebadmin||[]).push([["libs_dialogs_temporary-auth-login_temporary-auth-login_component_ts"],{59334:(T,r,t)=>{t.r(r),t.d(r,{TemporaryAuthLoginComponent:()=>C});var e=t(4020),a=t(60802),_=t(92388),l=t(40221),c=t(60027),m=t(48233),g=t(63965),v=t(62460),h=t(62032),E=t(7363),d=t(47474),O=t(33465),p=t(10391),P=t(82529),M=t(64147);let C=(()=>{class s extends l.f{constructor(n){super(n),this.urlUpdateTimeout=150,this.LANG=m,this.nxSystemAPIService=(0,e.WQX)(d.x),this.loginService=(0,e.WQX)(g.B),this.dialogService=(0,e.WQX)(_.L),this.sessionService=(0,e.WQX)(h.K),this.CONFIG=(0,e.WQX)(v.C).getConfig(),this.environment=c.c,this.images=p.zC}ngOnInit(){this.mediaServerApi=this.nxSystemAPIService.createConnection({version:this.CONFIG.system.version?.major||O.P.VERSION}),this.temporaryUserToken=this.loginService.temporaryUserToken$$();const n=`${this.CONFIG.clientProtocol}://${window.location.host}?tmp_token=${this.temporaryUserToken}`;window.location.href=n}handleLoginToWeb(){this.mediaServerApi.temporaryUserTokenExchange(this.temporaryUserToken).subscribe({next:n=>{this.mediaServerApi.loginTokenUrl(n.token).subscribe(i=>{this.sessionService.loginState=E.m.AUTHORIZED,setTimeout(()=>window.location.reload(),this.urlUpdateTimeout)})},error:n=>{this.dialogService.alert({title:this.LANG.dialogs.titles.error,message:n.error.errorString})}})}static{this.\u0275fac=function(i){return new(i||s)(e.rXU(P.ce))}}static{this.\u0275cmp=e.VBU({type:s,selectors:[["nx-temporary-auth-login"]],features:[e.Vt3],decls:8,vars:1,consts:[[1,"temp-auth-container"],["srcset","static/images/welcome_page_logo.png, static/images/welcome_page_logo@2x.png 2x","src","static/images/welcome_page_logo@2x.png",3,"alt"],["translate","",1,"text-header"],["translate","",1,"anchor","text-link",3,"click"]],template:function(i,o){1&i&&(e.j41(0,"div",0)(1,"div"),e.nrm(2,"img",1),e.k0s(),e.j41(3,"div",2),e.EFF(4," Opened in %VMS_NAME% "),e.k0s(),e.j41(5,"div")(6,"a",3),e.bIt("click",function(){return o.handleLoginToWeb()}),e.EFF(7,"Login to web client instead"),e.k0s()()()),2&i&&(e.R7$(2),e.Y8G("alt",o.environment.isWebadmin?o.CONFIG.vmsName:o.CONFIG.cloudName+" logo"))},dependencies:[a.h,M.M],styles:[".temp-auth-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:16px}.text-header[_ngcontent-%COMP%]{font-family:var(--font-family-medium);font-size:var(--h3-font-size)!important;font-weight:500!important}.text-link[_ngcontent-%COMP%]{font-family:var(--font-family-regular);font-size:var(--h5-font-size)!important;font-weight:400!important;cursor:pointer}"]})}}return s})()}}]);