import{D as h,E as C}from"./chunk-I7GW4F3B.js";import{wb as m,zb as d}from"./chunk-V2ECYACM.js";import{b as p,c as b}from"./chunk-YBNTOQCK.js";import{Sa as v,T as o,be as S,d as s,na as u,ta as l,xa as a}from"./chunk-WL5U2YIT.js";import{e as f}from"./chunk-ADEKKGI2.js";var x,j=f(()=>{v();u();S();d();b();C();x=(()=>{let r=class r{constructor(e,t,i){this.dvlConfirmationService=e,this.translatorService=t,this.currentUser=i}canDeactivate(e,t){if(e.isDirty&&this.currentUser.isLogged()){let i=t.data.editPermission;return i&&!this.currentUser.hasPermission(i)?new s(n=>this.processReturnType(e.rejectChange(),n)):new s(n=>{this.dvlConfirmationService.confirm({intent:"default",actionMode:"yes-no-cancel",title:this.translatorService.translate("lblConfirmation"),message:this.translatorService.translate("lblSaveChanges"),acceptLabel:this.translatorService.translate("lblYes"),rejectLabel:this.translatorService.translate("lblNo"),cancelLabel:this.translatorService.translate("lblCancel"),accept:()=>this.processReturnType(e.validateChange(),n),reject:()=>this.processReturnType(e.rejectChange(),n),cancel:()=>this.processReturnType(e.cancelChange(),n)})})}return!0}processReturnType(e,t){if(e instanceof s){e.pipe(o(1)).subscribe(i=>{t.next(i),t.complete()});return}t.next(e),t.complete()}};r.\u0275fac=function(t){return new(t||r)(a(m),a(p),a(h))},r.\u0275prov=l({token:r,factory:r.\u0275fac,providedIn:"root"});let c=r;return c})()});export{x as a,j as b};
