import{t as M}from"./chunk-6GMBHO4S.js";import{c as N,e as m,f as a,h as T,l as q,o as b,r as x,s as O,v as w,z as S}from"./chunk-AUG6ZMIQ.js";import{Aa as G,Ac as g,Cb as d,Fd as y,Hb as o,Jc as F,Ka as E,Kc as v,Tb as l,Ub as p,Vb as R,ac as D,cc as c,kb as r,ma as s,qa as u,qc as f,rc as h,vd as I,xd as _,zc as C}from"./chunk-NW2U37DI.js";function P(t,V){t&1&&(l(0,"span",4),f(1),F(2,"translate"),p()),t&2&&(r(),h(v(2,1,"This field is required")))}function L(t,V){if(t&1&&(l(0,"div",2),d(1,P,3,3,"span",3),p()),t&2){let n=c();r(),o("ngIf",n.formControl.hasError("required"))}}var Z=(()=>{class t{constructor(){this.parentContainer=s(a)}get parentFormGroup(){return this.parentContainer.control}get formControl(){return this.parentFormGroup.get(this.nameField)}ngOnInit(){this.parentFormGroup.addControl(this.nameField,new q(this.value??"",this.isRequired?m.required:null))}ngOnChanges(n){n.value&&this.updateFormControl()}updateFormControl(){if(this.parentFormGroup){let n=this.parentFormGroup.get(this.nameField);n&&(n.setValue(this.value??""),n.setValidators(this.isRequired?m.required:null),n.updateValueAndValidity())}}ngOnDestroy(){this.parentFormGroup.removeControl(this.nameField)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=u({type:t,selectors:[["app-number-input"]],inputs:{nameField:"nameField",value:"value",idField:"idField",classText:"classText",maxlength:"maxlength",placeholder:"placeholder",isRequired:"isRequired"},standalone:!0,features:[C([],[{provide:a,useFactory:()=>s(a,{skipSelf:!0})}]),G,g],decls:2,vars:7,consts:[["type","number","min","1",3,"maxlength","ngClass","id","formControlName","value","placeholder"],["class","error-invalid",4,"ngIf"],[1,"error-invalid"],["class","text-danger",4,"ngIf"],[1,"text-danger"]],template:function(i,e){i&1&&(R(0,"input",0),d(1,L,2,1,"div",1)),i&2&&(o("maxlength",e.maxlength?e.maxlength:null)("ngClass",e.classText)("id",e.idField?e.idField:e.nameField)("formControlName",e.nameField)("value",e.value)("placeholder",e.placeholder),r(),o("ngIf",e.formControl.invalid&&e.formControl.touched))},dependencies:[S,N,b,T,w,O,x,y,I,_,M],encapsulation:2})}}return t})();function z(t,V){t&1&&(l(0,"span",4),f(1),F(2,"translate"),p()),t&2&&(r(),h(v(2,1,"This field is required")))}function H(t,V){if(t&1&&(l(0,"div",2),d(1,z,3,3,"span",3),p()),t&2){let n=c();r(),o("ngIf",n.formControl.hasError("required"))}}var le=(()=>{class t{constructor(){this.valueChanged=new E,this.parentContainer=s(a)}get parentFormGroup(){return this.parentContainer.control}get formControl(){return this.parentFormGroup.get(this.nameField)}ngOnInit(){this.parentFormGroup.addControl(this.nameField,new q("",this.isRequired?m.required:null))}onFileChange(n){let i=n.target?.files?.[0];this.parentFormGroup.patchValue({file:i}),this.valueChanged.emit(i)}ngOnDestroy(){this.parentFormGroup.removeControl(this.nameField)}static{this.\u0275fac=function(i){return new(i||t)}}static{this.\u0275cmp=u({type:t,selectors:[["app-file-input"]],inputs:{nameField:"nameField",value:"value",idField:"idField",classText:"classText",accept:"accept",placeholder:"placeholder",isRequired:"isRequired"},outputs:{valueChanged:"valueChanged"},standalone:!0,features:[C([],[{provide:a,useFactory:()=>s(a,{skipSelf:!0})}]),g],decls:2,vars:7,consts:[["type","file","autocomplete","off",3,"change","ngClass","id","formControlName","value","placeholder","accept"],["class","error-invalid",4,"ngIf"],[1,"error-invalid"],["class","text-danger",4,"ngIf"],[1,"text-danger"]],template:function(i,e){i&1&&(l(0,"input",0),D("change",function(A){return e.onFileChange(A)}),p(),d(1,H,2,1,"div",1)),i&2&&(o("ngClass",e.classText)("id",e.idField?e.idField:e.nameField)("formControlName",e.nameField)("value",e.value)("placeholder",e.placeholder)("accept",e.accept),r(),o("ngIf",e.formControl.invalid&&e.formControl.touched))},dependencies:[S,N,T,x,y,I,_,M],encapsulation:2})}}return t})();export{Z as a,le as b};
