import{b as P}from"./chunk-IOKWCZEB.js";import{a as _}from"./chunk-BLIS2XXD.js";import{a as S,b as N}from"./chunk-5TTXT2K2.js";import{E as D,a as w,h as x,o as y}from"./chunk-MDIMQ3H3.js";import{Ad as T,Bc as b,Dc as v,Fa as r,Ib as l,Jb as s,Kb as d,Lb as m,Sa as p,Uc as C,Xb as c,Yc as n,Za as a,ib as u,ma as g,mc as f,nc as h,nd as M}from"./chunk-GJDGQISV.js";var E=i=>({warning:i}),O=class i{label=n("");disabled=n(!1);description=n("");defaultConfig=n();customTooltip=n([]);disabledSignal=C(()=>this.disabled());value=r(!1);onChange=()=>{};onTouched=()=>{};writeValue(e){this.value.set(!!e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.disabledSignal.set(e)}onInternalChange(e){this.value.set(e),this.onChange(e),this.onTouched()}get isValueMatchDefaultConfig(){return this.defaultConfig()!==void 0&&this.value()===this.defaultConfig()}get tooltip(){if(this.customTooltip().length>0){let e=this.customTooltip().find(o=>o.value===this.value());if(e)return e.tooltip}return this.value()?"Yes":"No"}static \u0275fac=function(o){return new(o||i)};static \u0275cmp=u({type:i,selectors:[["POS-input-toggle"]],inputs:{label:[1,"label"],disabled:[1,"disabled"],description:[1,"description"],defaultConfig:[1,"defaultConfig"],customTooltip:[1,"customTooltip"]},features:[b([{provide:w,useExisting:g(()=>i),multi:!0}])],decls:7,vars:9,consts:[[1,"mb-6","d-flex","justify-content-between","wrapper","align-items-center",3,"ngClass"],[1,"d-flex","flex-column"],[1,"mb-2","h5"],[3,"innerHTML"],[1,"text-end","d-flex","align-items-center","justify-content-end",2,"min-width","60px"],[3,"ngModelChange","ngModel","matTooltipPosition","matTooltip","disabled"]],template:function(o,t){o&1&&(s(0,"div",0)(1,"div",1)(2,"label",2),f(3),d(),m(4,"div",3),d(),s(5,"div",4)(6,"p-toggleswitch",5),c("ngModelChange",function(I){return t.onInternalChange(I)}),d()()()),o&2&&(l("ngClass",v(7,E,!t.isValueMatchDefaultConfig)),a(3),h(t.label()),a(),l("innerHTML",t.description(),p),a(2),l("ngModel",t.value())("matTooltipPosition","above")("matTooltip",t.tooltip)("disabled",t.disabledSignal()))},dependencies:[P,_,D,x,y,T,M,N,S],styles:[".warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}[_nghost-%COMP%]     p-toggleswitch.warning .p-toggleswitch-slider{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important;border:1px solid #d8d8d8!important}[_nghost-%COMP%]     p-toggleswitch.warning.p-toggleswitch .p-toggleswitch-slider .p-toggleswitch-handle{box-shadow:0 0 2px #000}.wrapper[_ngcontent-%COMP%]{padding:4px;border-radius:8px}","label[_ngcontent-%COMP%]{font-weight:600}.form-control[_ngcontent-%COMP%]{padding:12px;border-radius:8px;color:#000}"],changeDetection:0})};export{O as a};
