export const __rspack_esm_id=3398;export const __rspack_esm_ids=[3398];export const __webpack_modules__={35140(e,t,a){var n=a(49588);const i=["relative","total","date","time","datetime"],s=(0,n.lq)((0,n.KC)([(0,n.vP)(i),(0,n.Ik)({type:(0,n.vP)(i),style:(0,n.lq)((0,n.vP)(["short","long"]))})]));a.d(t,{},{W:s,j:i})},82437(e,t,a){a.a(e,async function(e,n){try{a.r(t);a(74423),a(44114);var i=a(15697),s=a(57527),o=a(79224),l=a(90789),c=a(49588),_=a(148),r=a(55682),d=a(29433),m=a(87226),h=a(26041),p=a(93566),u=a(24652),y=a(13263),f=a(7651),g=a(35170),b=a(35140),v=e([r,g,d,f,m]);[r,g,d,f,m]=v.then?(await v)():v;const q="M10,9A1,1 0 0,1 11,8A1,1 0 0,1 12,9V13.47L13.21,13.6L18.15,15.79C18.68,16.03 19,16.56 19,17.14V21.5C18.97,22.32 18.32,22.97 17.5,23H11C10.62,23 10.26,22.85 10,22.57L5.1,18.37L5.84,17.6C6.03,17.39 6.3,17.28 6.58,17.28H6.8L10,19V9M11,5A4,4 0 0,1 15,9C15,10.5 14.2,11.77 13,12.46V11.24C13.61,10.69 14,9.89 14,9A3,3 0 0,0 11,6A3,3 0 0,0 8,9C8,9.89 8.39,10.69 9,11.24V12.46C7.8,11.77 7,10.5 7,9A4,4 0 0,1 11,5Z",C="M4,9H20V11H4V9M4,13H14V15H4V13Z",w=(0,c.kp)(p.y,(0,c.Ik)({entity:(0,c.lq)((0,c.Yj)()),display_type:(0,c.lq)((0,c.vP)(d.rU)),name:(0,c.lq)(u.q),icon:(0,c.lq)((0,c.Yj)()),state_content:(0,c.lq)((0,c.KC)([(0,c.Yj)(),(0,c.YO)((0,c.Yj)())])),color:(0,c.lq)((0,c.Yj)()),show_name:(0,c.lq)((0,c.zM)()),show_state:(0,c.lq)((0,c.zM)()),show_icon:(0,c.lq)((0,c.zM)()),show_entity_picture:(0,c.lq)((0,c.zM)()),tap_action:(0,c.lq)(h.kn),hold_action:(0,c.lq)(h.kn),double_tap_action:(0,c.lq)(h.kn),time_format:(0,c.lq)(b.W),image:(0,c.lq)((0,c.Yj)())}));class k extends s.WF{setConfig(e){(0,c.vA)(e,w),this._config={...d.PV,...(0,d.P8)(e)}}render(){if(!this.hass||!this._config)return s.s6;const e=this._config.entity,t=!!e&&(0,f.Rf)(e,this.hass.states[e],this._config.state_content),a=this._schema(this.hass.localize,t),n={...this._config,displayed_elements:this._displayedElements(this._config)};return s.qy` <ha-form .hass=${this.hass} .data=${n} .schema=${a} .computeLabel=${this._computeLabelCallback} .computeHelper=${this._computeHelperCallback} @value-changed=${this._valueChanged}></ha-form> `}_valueChanged(e){if(e.stopPropagation(),!this._config||!this.hass)return;const t={...e.detail.value};t.state_content||delete t.state_content,t.displayed_elements&&(t.show_name=t.displayed_elements.includes("name"),t.show_state=t.displayed_elements.includes("state"),t.show_icon=t.displayed_elements.includes("icon"),delete t.displayed_elements),(0,_.r)(this,"config-changed",{config:t})}static get styles(){return[y.U,s.AH`.container{flex-direction:column;display:flex}ha-form{margin-bottom:24px;display:block}`]}constructor(...e){super(...e),this._schema=(0,l.A)((e,t)=>[{name:"entity",selector:{entity:{}}},{name:"content",type:"expandable",flatten:!0,iconPath:C,schema:[{name:"name",selector:{entity_name:{}},context:{entity:"entity"}},{name:"",type:"grid",schema:[{name:"color",selector:{ui_color:{default_color:"state",include_state:!0}}},{name:"icon",selector:{icon:{}},context:{icon_entity:"entity"}},{name:"show_entity_picture",selector:{boolean:{}}}]},{name:"displayed_elements",selector:{select:{mode:"list",multiple:!0,options:[{value:"name",label:e("ui.panel.lovelace.editor.badge.entity.displayed_elements_options.name")},{value:"state",label:e("ui.panel.lovelace.editor.badge.entity.displayed_elements_options.state")},{value:"icon",label:e("ui.panel.lovelace.editor.badge.entity.displayed_elements_options.icon")}]}}},{name:"state_content",selector:{ui_state_content:{allow_name:!0}},context:{filter_entity:"entity"}},...t?[{name:"time_format",selector:{ui_time_format:{}}}]:[]]},{name:"interactions",type:"expandable",flatten:!0,iconPath:q,schema:[{name:"tap_action",selector:{ui_action:{default_action:"more-info"}},context:m.Tq},{name:"",type:"optional_actions",flatten:!0,schema:["hold_action","double_tap_action"].map(e=>({name:e,selector:{ui_action:{default_action:"none"}},context:m.Tq}))}]}]),this._displayedElements=(0,l.A)(e=>{const t=[];return e.show_name&&t.push("name"),e.show_state&&t.push("state"),e.show_icon&&t.push("icon"),t}),this._computeLabelCallback=e=>{switch(e.name){case"color":case"state_content":case"show_entity_picture":case"displayed_elements":return this.hass.localize(`ui.panel.lovelace.editor.badge.entity.${e.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}},this._computeHelperCallback=e=>{if("color"===e.name)return this.hass.localize(`ui.panel.lovelace.editor.badge.entity.${e.name}_helper`)}}}(0,i.Cg)([(0,o.MZ)({attribute:!1})],k.prototype,"hass",void 0),(0,i.Cg)([(0,o.wk)()],k.prototype,"_config",void 0),k=(0,i.Cg)([(0,o.EM)("hui-entity-badge-editor")],k),a.d(t,{HuiEntityBadgeEditor:()=>k}),n()}catch(e){n(e)}})},93566(e,t,a){var n=a(49588);const i=(0,n.Ik)({type:(0,n.Yj)(),visibility:(0,n.bz)(),disabled:(0,n.lq)((0,n.zM)())});a.d(t,{},{y:i})}};
//# sourceMappingURL=3398.cf83b84578c6c3ab.js.map