import{d as O,e as E}from"./chunk-EFYIWIC7.js";import{e as f,f as m,h as _,l as y,r as V,z as q}from"./chunk-AUG6ZMIQ.js";import{c as G}from"./chunk-JQJV7TYV.js";import{Aa as F,Ac as b,Cb as r,Fd as N,Hb as d,Jc as s,Kc as p,Tb as l,Ub as a,cc as S,kb as n,ma as u,qa as h,qc as c,rc as g,vd as T,xd as I,zc as v}from"./chunk-NW2U37DI.js";function L(t,C){t&1&&(l(0,"div"),c(1),s(2,"translate"),a()),t&2&&(n(),g(p(2,1,"No items")))}function M(t,C){t&1&&(l(0,"span",5),c(1),s(2,"translate"),a()),t&2&&(n(),g(p(2,1,"This field is required")))}function R(t,C){if(t&1&&(l(0,"div",3),r(1,M,3,3,"span",4),a()),t&2){let i=S();n(),d("ngIf",i.formControl.hasError("required"))}}var K=(()=>{class t{constructor(){this.parentContainer=u(m)}get parentFormGroup(){return this.parentContainer.control}get formControl(){return this.parentFormGroup.get(this.nameField)}ngOnInit(){this.parentFormGroup.addControl(this.nameField,new y(this.initailSelect??"",this.isRequired?f.required:null))}addTagFn(i){return i}ngOnChanges(i){i.initailSelect&&this.updateFormControl()}updateFormControl(){if(this.parentFormGroup){let i=this.parentFormGroup.get(this.nameField);i&&(i.setValue(this.initailSelect??""),i.setValidators(this.isRequired?f.required:null),i.updateValueAndValidity())}}ngOnDestroy(){this.parentFormGroup.removeControl(this.nameField)}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=h({type:t,selectors:[["app-ng-select-input"]],inputs:{nameField:"nameField",tagslist:"tagslist",idField:"idField",classText:"classText",initailSelect:"initailSelect",placeholder:"placeholder",bindValue:"bindValue",bindLabel:"bindLabel",isRequired:"isRequired",isOpen:"isOpen",multiple:"multiple",addTag:"addTag",hideSelected:"hideSelected"},standalone:!0,features:[v([],[{provide:m,useFactory:()=>u(m,{skipSelf:!0})}]),F,b],decls:4,vars:16,consts:[[3,"formControlName","items","loading","ngClass","id","placeholder","addTag","hideSelected","multiple","bindLabel","bindValue","clearable","maxSelectedItems"],["ng-select-empty-list",""],["class","error-invalid",4,"ngIf"],[1,"error-invalid"],["class","text-danger",4,"ngIf"],[1,"text-danger"]],template:function(o,e){o&1&&(l(0,"ng-select",0),s(1,"translate"),r(2,L,3,3,"ng-template",1),a(),r(3,R,2,1,"div",2)),o&2&&(d("formControlName",e.nameField)("items",e.tagslist)("loading",!e.tagslist)("ngClass",e.classText)("id",e.idField?e.idField:e.nameField)("placeholder",p(1,14,"Tags"))("addTag",e.addTag?e.addTagFn:!1)("hideSelected",e.hideSelected)("multiple",e.multiple)("bindLabel",e.bindLabel)("bindValue",e.bindValue)("clearable",!1)("maxSelectedItems",10),n(3),d("ngIf",(e.formControl==null?null:e.formControl.invalid)&&(e.formControl==null?null:e.formControl.touched)))},dependencies:[q,_,V,N,T,I,G,E,O],encapsulation:2})}}return t})();export{K as a};
