import{_ as e,j as i,e as t,y as l,k as d,O as o,d as n,n as r}from"./main-85e087f9.js";import"./c.fea0de05.js";import"./c.388f6c87.js";import"./c.eab7754a.js";import"./c.8e28b461.js";import"./c.7398f5d5.js";let s=e([r("ha-selector-number")],(function(e,i){return{F:class extends i{constructor(...i){super(...i),e(this)}},d:[{kind:"field",decorators:[t()],key:"hass",value:void 0},{kind:"field",decorators:[t()],key:"selector",value:void 0},{kind:"field",decorators:[t()],key:"value",value:void 0},{kind:"field",decorators:[t()],key:"placeholder",value:void 0},{kind:"field",decorators:[t()],key:"label",value:void 0},{kind:"field",decorators:[t()],key:"helper",value:void 0},{kind:"field",decorators:[t({type:Boolean})],key:"required",value:()=>!0},{kind:"field",decorators:[t({type:Boolean})],key:"disabled",value:()=>!1},{kind:"method",key:"render",value:function(){var e,i,t,o,n,r,s,a,u,h,v,c,m,p,b;const f="box"===(null===(e=this.selector.number)||void 0===e?void 0:e.mode);return l`
${f?"":l` ${this.label?l`${this.label}${this.required?" *":""}`:""} `}
${!f&&this.helper?l`${this.helper}`:""} `}},{kind:"get",key:"_value",value:function(){var e,i;return null!==(e=this.value)&&void 0!==e?e:(null===(i=this.selector.number)||void 0===i?void 0:i.min)||0}},{kind:"method",key:"_handleInputChange",value:function(e){var i;e.stopPropagation();const t=""===e.target.value||isNaN(e.target.value)?this.required?(null===(i=this.selector.number)||void 0===i?void 0:i.min)||0:void 0:Number(e.target.value);this.value!==t&&o(this,"value-changed",{value:t})}},{kind:"method",key:"_handleSliderChange",value:function(e){e.stopPropagation();const i=Number(e.target.value);this.value!==i&&o(this,"value-changed",{value:i})}},{kind:"get",static:!0,key:"styles",value:function(){return n` .input { display: flex; justify-content: space-between; align-items: center; direction: ltr; } ha-slider { flex: 1; } ha-textfield { --ha-textfield-input-width: 40px; } .single { --ha-textfield-input-width: unset; flex: 1; } `}}]}}),i);export{s as HaNumberSelector};