import{a as N,q as O,r as R}from"./chunk-MP3M4BNU.js";import{$a as d,Ba as C,Gb as E,Ka as r,La as g,Lb as F,Va as V,_a as s,aa as m,ac as T,ca as b,cc as u,db as _,dc as A,ib as c,jb as p,ka as y,kb as k,la as w,ob as v,pb as h,qc as L,ta as o,ua as l,uc as D,vb as S,wb as I,xb as M,yc as B}from"./chunk-QBQIXSUA.js";var U=["input"],P=(i,Q,t)=>({"p-inputswitch p-component":!0,"p-inputswitch-checked":i,"p-disabled":Q,"p-focus":t}),W={provide:N,useExisting:m(()=>q),multi:!0},q=(()=>{class i{cd;style;styleClass;tabindex;inputId;name;disabled;readonly;trueValue=!0;falseValue=!1;ariaLabel;ariaLabelledBy;autofocus;onChange=new C;input;modelValue=!1;focused=!1;onModelChange=()=>{};onModelTouched=()=>{};constructor(t){this.cd=t}onClick(t){!this.disabled&&!this.readonly&&(this.modelValue=this.checked()?this.falseValue:this.trueValue,this.onModelChange(this.modelValue),this.onChange.emit({originalEvent:t,checked:this.modelValue}),this.input.nativeElement.focus())}onFocus(){this.focused=!0}onBlur(){this.focused=!1,this.onModelTouched()}writeValue(t){this.modelValue=t,this.cd.markForCheck()}registerOnChange(t){this.onModelChange=t}registerOnTouched(t){this.onModelTouched=t}setDisabledState(t){this.disabled=t,this.cd.markForCheck()}checked(){return this.modelValue===this.trueValue}static \u0275fac=function(n){return new(n||i)(g(T))};static \u0275cmp=y({type:i,selectors:[["p-inputSwitch"]],viewQuery:function(n,e){if(n&1&&S(U,5),n&2){let a;I(a=M())&&(e.input=a.first)}},hostAttrs:[1,"p-element"],inputs:{style:"style",styleClass:"styleClass",tabindex:[2,"tabindex","tabindex",A],inputId:"inputId",name:"name",disabled:[2,"disabled","disabled",u],readonly:[2,"readonly","readonly",u],trueValue:"trueValue",falseValue:"falseValue",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",autofocus:[2,"autofocus","autofocus",u]},outputs:{onChange:"onChange"},features:[E([W]),V],decls:5,vars:23,consts:[["input",""],[3,"click","ngClass","ngStyle"],[1,"p-hidden-accessible"],["type","checkbox","role","switch","pAutoFocus","",3,"focus","blur","checked","disabled","autofocus"],[1,"p-inputswitch-slider"]],template:function(n,e){if(n&1){let a=v();c(0,"div",1),h("click",function(j){return o(a),l(e.onClick(j))}),c(1,"div",2)(2,"input",3,0),h("focus",function(){return o(a),l(e.onFocus())})("blur",function(){return o(a),l(e.onBlur())}),p()(),k(4,"span",4),p()}n&2&&(_(e.styleClass),d("ngClass",F(19,P,e.checked(),e.disabled,e.focused))("ngStyle",e.style),s("data-pc-name","inputswitch")("data-pc-section","root"),r(),s("data-pc-section","hiddenInputWrapper")("data-p-hidden-accessible",!0),r(),d("checked",e.checked())("disabled",e.disabled)("autofocus",e.autofocus),s("id",e.inputId)("aria-checked",e.checked())("aria-labelledby",e.ariaLabelledBy)("aria-label",e.ariaLabel)("name",e.name)("tabindex",e.tabindex)("data-pc-section","hiddenInput"),r(2),s("data-pc-section","slider"))},dependencies:[L,D,O],styles:[`@layer primeng{.p-inputswitch{position:relative;display:inline-block;-webkit-user-select:none;user-select:none}.p-inputswitch-slider{position:absolute;cursor:pointer;inset:0;border:1px solid transparent}.p-inputswitch-slider:before{position:absolute;content:"";top:50%}}
`],encapsulation:2,changeDetection:0})}return i})(),ae=(()=>{class i{static \u0275fac=function(n){return new(n||i)};static \u0275mod=w({type:i});static \u0275inj=b({imports:[B,R]})}return i})();export{q as a,ae as b};
