"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["90742"],{4757:function(e,t,a){a.a(e,async function(e,n){try{a.r(t),a.d(t,{HuiMarkdownCardEditor:function(){return v}});a(27495),a(25440),a(62953);var o=a(40445),i=a(96196),s=a(77845),c=a(22786),l=a(63533),r=a(1087),d=a(52763),h=a(91408),_=a(84698),u=a(999),p=e([d,u]);[d,u]=p.then?(await p)():p;let m,g=e=>e;const f="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",y=["navigate","url","perform-action","none"],b=(0,l.kp)(_.H,(0,l.Ik)({text_only:(0,l.lq)((0,l.zM)()),title:(0,l.lq)((0,l.Yj)()),content:(0,l.Yj)(),tap_action:(0,l.lq)((0,u.W0)(h.kn,y)),hold_action:(0,l.lq)((0,u.W0)(h.kn,y)),double_tap_action:(0,l.lq)((0,u.W0)(h.kn,y))}));class v extends i.WF{setConfig(e){(0,l.vA)(e,b),this._config=e}render(){if(!this.hass||!this._config)return i.s6;const e=Object.assign(Object.assign({},this._config),{},{style:this._config.text_only?"text-only":"card"}),t=this._schema(this.hass.localize,this._config.text_only||!1);return(0,i.qy)(m||(m=g` <ha-form .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" @value-changed="${0}"></ha-form> `),this.hass,e,t,this._computeLabelCallback,this._valueChanged)}_valueChanged(e){const t=Object.assign({},e.detail.value);"text-only"===t.style?t.text_only=!0:delete t.text_only,delete t.style,(0,r.r)(this,"config-changed",{config:t})}constructor(...e){super(...e),this._schema=(0,c.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}}},{name:"interactions",type:"expandable",flatten:!0,iconPath:f,schema:[{name:"actions_warning",type:"constant"},{name:"tap_action",selector:{ui_action:{actions:y,default_action:"none"}}},{name:"",type:"optional_actions",flatten:!0,schema:["hold_action","double_tap_action"].map(e=>({name:e,selector:{ui_action:{actions:y,default_action:"none"}}}))}]}]),this._computeLabelCallback=e=>{switch(e.name){case"style":case"content":return this.hass.localize(`ui.panel.lovelace.editor.card.markdown.${e.name}`);case"interactions":return this.hass.localize("ui.panel.lovelace.editor.card.generic.interactions");case"actions_warning":return this.hass.localize("ui.panel.lovelace.editor.card.markdown.actions_warning");case"tap_action":case"hold_action":case"double_tap_action":return`${this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)} (${this.hass.localize("ui.panel.lovelace.editor.card.config.optional")})`;default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${e.name}`)}}}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,o.Cg)([(0,s.wk)()],v.prototype,"_config",void 0),v=(0,o.Cg)([(0,s.EM)("hui-markdown-card-editor")],v),n()}catch(m){n(m)}})},84698:function(e,t,a){a.d(t,{H:function(){return o}});var n=a(63533);const o=(0,n.Ik)({type:(0,n.Yj)(),view_layout:(0,n.bz)(),layout_options:(0,n.bz)(),grid_options:(0,n.bz)(),visibility:(0,n.bz)(),disabled:(0,n.lq)((0,n.zM)())})}}]);
//# sourceMappingURL=90742.bf4ac687dbe623ad.js.map