import{a as u}from"./chunk-PAPGVZ7T.js";import{Fa as p,L as s}from"./chunk-GJDGQISV.js";import{a as o,b as a}from"./chunk-SNAKHGZS.js";var n=class extends u{constructor(t,e,r,d){super(t);this.httpService=e;this.formDataAPI=r;this.route=d;let m=this.route.snapshot.queryParams;this.menuData$.pipe(s(()=>this.httpService.post(`/api/${this.formDataAPI}`,m))).subscribe(i=>{this.data.set(i),this.postBindForm(i)})}data=p(null);get formData(){return this.data()?.Form}set formData(t){this.data.update(e=>a(o({},e||{}),{Form:t}))}get options(){return this.data()?.Options?this.data().Options:{}}get Roles(){return this.data()?.Roles?this.data().Roles:{}}postBindForm(t){}onSubmit(t,e=!1){this.preSubmitForm(),this.httpService.post(`/api/${t}`,this.formData).subscribe({next:r=>{this.onSubmitSuccess(r)},error:r=>{this.onSubmitError(r)}})}compare(t,e,r){return(t<e?-1:1)*(r?1:-1)}preSubmitForm(){}onSubmitSuccess(t){}onSubmitError(t){}};export{n as a};
