export const __rspack_esm_id="90742";export const __rspack_esm_ids=["90742"];export const __webpack_modules__={4757(e,t,a){a.a(e,async function(e,s){try{a.r(t),a.d(t,{HuiMarkdownCardEditor:()=>p});var o=a(62826),i=a(96196),l=a(97735),n=a(22786),r=a(63533),c=a(1087),d=a(52763),_=a(84698),h=e([d]);d=(h.then?(await h)():h)[0];const m=(0,r.kp)(_.H,(0,r.Ik)({text_only:(0,r.lq)((0,r.zM)()),title:(0,r.lq)((0,r.Yj)()),content:(0,r.Yj)()}));class p extends i.WF{setConfig(e){(0,r.vA)(e,m),this._config=e}render(){if(!this.hass||!this._config)return i.s6;const e={...this._config,style:this._config.text_only?"text-only":"card"},t=this._schema(this.hass.localize,this._config.text_only||!1);return i.qy` <ha-form .hass="${this.hass}" .data="${e}" .schema="${t}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}_valueChanged(e){const t={...e.detail.value};"text-only"===t.style?t.text_only=!0:delete t.text_only,delete t.style,(0,c.r)(this,"config-changed",{config:t})}constructor(...e){super(...e),this._schema=(0,n.A)((e,t)=>[{name:"style",required:!0,selector:{select:{mode:"box",options:["card","text-only"].map(t=>({label:e(`ui.panel.lovelace.editor.card.markdown.style_options.${t}`),image:{src:`/static/images/form/markdown_${t.replace("-","_")}.svg`,src_dark:`/static/images/form/markdown_${t.replace("-","_")}_dark.svg`,flip_rtl:!0},value:t}))}}},...t?[]:[{name:"title",selector:{text:{}}}],{name:"content",required:!0,selector:{template:{preview:!1}}}]),this._computeLabelCallback=e=>{switch(e.name){case"style":case"content":return this.hass.localize(`ui.panel.lovelace.editor.card.markdown.${e.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}}}}(0,o.Cg)([(0,l.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,o.Cg)([(0,l.wk)()],p.prototype,"_config",void 0),p=(0,o.Cg)([(0,l.EM)("hui-markdown-card-editor")],p),s()}catch(e){s(e)}})},84698(e,t,a){a.d(t,{H:()=>o});var s=a(63533);const o=(0,s.Ik)({type:(0,s.Yj)(),view_layout:(0,s.bz)(),layout_options:(0,s.bz)(),grid_options:(0,s.bz)(),visibility:(0,s.bz)(),disabled:(0,s.lq)((0,s.zM)())})}};
//# sourceMappingURL=90742.9776774ff5f2bc9e.js.map