export const __rspack_esm_id=31265;export const __rspack_esm_ids=[31265];export const __webpack_modules__={28383(t,e,s){s.d(e,{},{BJ:(t,e,s)=>t.callWS({type:"input_text/update",input_text_id:e,...s}),KY:(t,e,s)=>t.callService(e.split(".",1)[0],"set_value",{value:s,entity_id:e}),MG:t=>t.callWS({type:"input_text/list"}),d_:(t,e)=>t.callWS({type:"input_text/delete",input_text_id:e}),m4:(t,e)=>t.callWS({type:"input_text/create",...e})})},93752(t,e,s){s.a(t,async function(t,i){try{s.r(e);var a=s(15697),n=s(57527),r=s(79224),h=s(57230),d=s(8382),l=s(57406),c=s(96682),u=s(28383),o=s(72441),_=s(59366),p=s(58178),b=t([d,l,_,p]);[d,l,_,p]=b.then?(await b)():b;class m extends n.WF{setConfig(t){if(!t)throw new Error("Invalid configuration");this._config=t}connectedCallback(){super.connectedCallback(),this._updated&&!this._loaded&&this._initialLoad(),this._attachObserver()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect()}firstUpdated(){this._updated=!0,this.isConnected&&!this._loaded&&this._initialLoad(),this._attachObserver()}shouldUpdate(t){return(0,o.LX)(this,t)}render(){if(!this._config||!this.hass)return n.s6;const t=this.hass.states[this._config.entity];return t?n.qy` <hui-generic-entity-row .hass=${this.hass} .config=${this._config}> ${"slider"===t.attributes.mode?n.qy` <div class="flex"> <ha-slider labeled .disabled=${t.state===c.Hh} .step=${Number(t.attributes.step)} .min=${Number(t.attributes.min)} .max=${Number(t.attributes.max)} .value=${t.state} @change=${this._selectedValueChanged}></ha-slider> <span class="state"> ${this.hass.formatEntityState(t)} </span> </div> `:n.qy` <div class="flex state"> <ha-input .disabled=${t.state===c.Hh} pattern="[0-9]+([\\.][0-9]+)?" .step=${Number(t.attributes.step)} .min=${Number(t.attributes.min)} .max=${Number(t.attributes.max)} .value=${Number(t.state).toString()} type="number" @change=${this._selectedValueChanged}> <span slot="end">${t.attributes.unit_of_measurement||""}</span> </ha-input> </div> `} </hui-generic-entity-row> `:n.qy` <hui-warning .hass=${this.hass}> ${(0,p.j)(this.hass,this._config.entity)} </hui-warning> `}async _initialLoad(){this._loaded=!0,await this.updateComplete,this._measureCard()}_measureCard(){if(!this.isConnected)return;const t=this.shadowRoot.querySelector(".state");t&&(t.hidden=this.clientWidth<=300)}async _attachObserver(){this._resizeObserver||(this._resizeObserver=new ResizeObserver((0,h.s)(()=>this._measureCard(),250,!1))),this.isConnected&&this._resizeObserver.observe(this)}_selectedValueChanged(t){const e=this.hass.states[this._config.entity];t.target.value!==e.state&&(0,u.KY)(this.hass,e.entity_id,t.target.value)}}m.styles=n.AH`:host{display:block}.flex{flex-grow:2;justify-content:flex-end;align-items:center;display:flex}.state{text-align:end;min-width:45px}ha-input{width:100%}ha-input::part(wa-input){text-align:end}ha-slider{width:100%;max-width:200px}`,(0,a.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,a.Cg)([(0,r.wk)()],m.prototype,"_config",void 0),m=(0,a.Cg)([(0,r.EM)("hui-input-number-entity-row")],m),i()}catch(t){i(t)}})}};
//# sourceMappingURL=31265.58514aa69fb01878.js.map