import{a as s,b as V}from"./chunk-LBARZOQF.js";import{a as S,b as _}from"./chunk-BXBF54ET.js";import{a as i,b as w}from"./chunk-EXSN6QWV.js";import{e as F,g as C}from"./chunk-HW6LKGMV.js";import{a as y,b as I}from"./chunk-UIVS6623.js";import{b as g,c as E}from"./chunk-YTY7HHO3.js";import{Qb as l,Rc as p,Rd as T,Sc as d,Tc as v,Ub as f,d as m,ia as h,ka as c,ma as M,na as P,o as u,p as A}from"./chunk-4HFZZ7HS.js";import{e as b}from"./chunk-SZAW6ZBW.js";var D,o,Q=b(()=>{A();P();M();V();w();C();I();E();_();T();D=["currentForm"],o=class n extends y{constructor(){super(),this.errorSummaryMessages=[],this.tabTitle="",this.BASE_TITLE="Devolutions Server - ",this.titleService=i.injector.get(F),this.translatorService=i.injector.get(g)}get isDirty(){return this.currentForm?this.currentForm.dirty:this.reactiveForm?this.reactiveForm.dirty:!1}get isValid(){return this.currentForm?this.currentForm.valid:this.reactiveForm?this.reactiveForm.valid:!1}ngOnInit(){this.titleService.setTitle(this.BASE_TITLE+this.translatorService.translate(this.tabTitle)),this.setFormPristineAfterInit()}setFormPristineAfterInit(){this.setFormPristine()}submitForm(){this.errorSummaryMessages=[],this.save().pipe(h(this.destroyed$)).subscribe(e=>{e?this.setFormPristine():this.errorSummaryMessages.length===0&&this.errorSummaryMessages.push(s.setMessageSummary("Unable to save"))})}showError(e){this.errorSummaryMessages.push(s.setMessageSummary(e))}cancelChange(){return!1}rejectChange(){return this.setFormPristine(),!0}validateChange(){return this.save().pipe(c(e=>e?this.setFormPristine():void 0))}save(){return new m}hasErrors(e,r,t=!0){return r.errors&&((t?r.dirty:!1)||r.touched||e.submitted)}setFormPristine(){this.currentForm&&(this.currentForm.form.markAsPristine(),this.currentForm.form.updateValueAndValidity()),this.reactiveForm&&(this.reactiveForm.markAsPristine(),this.reactiveForm.updateValueAndValidity())}static{this.\u0275fac=function(r){return new(r||n)}}static{this.\u0275cmp=l({type:n,selectors:[["dvl-inline-editable-form"]],viewQuery:function(r,t){if(r&1&&p(D,5),r&2){let a;d(a=v())&&(t.currentForm=a.first)}},features:[f],decls:0,vars:0,template:function(r,t){},encapsulation:2})}};u([S(350)],o.prototype,"setFormPristineAfterInit",null)});export{o as a,Q as b};
