UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

4 lines 62 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["41608"],{99426:function(e,t,i){i.r(t);var a=i(61701),s=(i(71695),i(47021),i(57243)),n=i(50778),o=i(35359),r=i(36522);i(23334),i(37583);let c,l,d,h,u=e=>e;const g={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};(0,a.Z)([(0,n.Mo)("ha-alert")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)()],key:"title",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({attribute:"alert-type"})],key:"alertType",value(){return"info"}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"dismissable",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,s.dy)(c||(c=u` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,o.$)({[this.alertType]:!0}),this.title?"":"no-title",g[this.alertType],(0,o.$)({content:!0,narrow:this.narrow}),this.title?(0,s.dy)(l||(l=u`<div class="title">${0}</div>`),this.title):s.Ld,this.dismissable?(0,s.dy)(d||(d=u`<ha-icon-button @click="${0}" label="Dismiss alert" .path="${0}"></ha-icon-button>`),this._dismissClicked,"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"):s.Ld)}},{kind:"method",key:"_dismissClicked",value:function(){(0,r.B)(this,"alert-dismissed-clicked")}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(h||(h=u`.issue-type{position:relative;padding:8px;display:flex}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:4px}.icon{z-index:1}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:0}.title{margin-top:2px;font-weight:700}.action ha-icon-button,.action mwc-button{--mdc-theme-primary:var(--primary-text-color);--mdc-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`))}}]}}),s.oi)},54977:function(e,t,i){var a=i(61701),s=(i(71695),i(47021),i(57243)),n=i(50778);let o,r,c,l=e=>e;(0,a.Z)([(0,n.Mo)("ha-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"raised",value(){return!1}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(o||(o=l`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,12px);border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, 24px);letter-spacing:-.012em;line-height:48px;padding:12px 16px 16px;display:block;margin-block-start:0px;margin-block-end:0px;font-weight:400}:host ::slotted(.card-content:not(:first-child)),slot:not(:first-child)::slotted(.card-content){padding-top:0px;margin-top:-8px}:host ::slotted(.card-content){padding:16px}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:5px 16px}`))}},{kind:"method",key:"render",value:function(){return(0,s.dy)(r||(r=l` ${0} <slot></slot> `),this.header?(0,s.dy)(c||(c=l`<h1 class="card-header">${0}</h1>`),this.header):s.Ld)}}]}}),s.oi)},30509:function(e,t,i){var a=i(61701),s=(i(71695),i(47021),i(57243)),n=i(50778);let o,r,c=e=>e;(0,a.Z)([(0,n.Mo)("ha-settings-row")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"slim",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"three-line"})],key:"threeLine",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"wrap-heading",reflect:!0})],key:"wrapHeading",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,s.dy)(o||(o=c` <div class="prefix-wrap"> <slot name="prefix"></slot> <div class="body" ?two-line="${0}" ?three-line="${0}"> <slot name="heading"></slot> <div class="secondary"><slot name="description"></slot></div> </div> </div> <div class="content"><slot></slot></div> `),!this.threeLine,this.threeLine)}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(r||(r=c`:host{display:flex;padding:0 16px;align-content:normal;align-self:auto;align-items:center}.body{padding-top:8px;padding-bottom:8px;padding-left:0;padding-inline-start:0;padding-right:16px;padding-inline-end:16px;overflow:hidden;display:var(--layout-vertical_-_display,flex);flex-direction:var(--layout-vertical_-_flex-direction,column);justify-content:var(--layout-center-justified_-_justify-content,center);flex:var(--layout-flex_-_flex,1);flex-basis:var(--layout-flex_-_flex-basis,0.000000001px)}.body[three-line]{min-height:var(--paper-item-body-three-line-min-height,88px)}:host(:not([wrap-heading])) body>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.body>.secondary{display:block;padding-top:4px;font-family:var( --mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif) );-webkit-font-smoothing:antialiased;font-size:var(--mdc-typography-body2-font-size, .875rem);font-weight:var(--mdc-typography-body2-font-weight,400);line-height:normal;color:var(--secondary-text-color)}.body[two-line]{min-height:calc(var(--paper-item-body-two-line-min-height,72px) - 16px);flex:1}.content{display:contents}:host(:not([narrow])) .content{display:var(--settings-row-content-display,flex);justify-content:flex-end;flex:1;padding:16px 0}.content ::slotted(*){width:var(--settings-row-content-width)}:host([narrow]){align-items:normal;flex-direction:column;border-top:1px solid var(--divider-color);padding-bottom:8px}::slotted(ha-switch){padding:16px 0}.secondary{white-space:normal}.prefix-wrap{display:var(--settings-row-prefix-display)}:host([narrow]) .prefix-wrap{display:flex;align-items:center}:host([slim]),:host([slim]) .content,:host([slim]) ::slotted(ha-switch){padding:0}:host([slim]) .body{min-height:0}`))}}]}}),s.oi)},62801:function(e,t,i){var a=i(61701),s=i(72621),n=(i(71695),i(9359),i(56475),i(19423),i(40251),i(22139),i(47021),i(57243)),o=i(50778),r=i(36522);let c,l=e=>e;(0,a.Z)([(0,o.Mo)("ha-sortable")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",key:"_sortable",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,attribute:"no-style"})],key:"noStyle",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:String,attribute:"draggable-selector"})],key:"draggableSelector",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:String,attribute:"handle-selector"})],key:"handleSelector",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:String,attribute:"filter"})],key:"filter",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:String})],key:"group",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,attribute:"invert-swap"})],key:"invertSwap",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"options",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"rollback",value(){return!0}},{kind:"method",key:"updated",value:function(e){e.has("disabled")&&(this.disabled?this._destroySortable():this._createSortable())}},{kind:"field",key:"_shouldBeDestroy",value(){return!1}},{kind:"method",key:"disconnectedCallback",value:function(){(0,s.Z)(a,"disconnectedCallback",this,3)([]),this._shouldBeDestroy=!0,setTimeout((()=>{this._shouldBeDestroy&&(this._destroySortable(),this._shouldBeDestroy=!1)}),1)}},{kind:"method",key:"connectedCallback",value:function(){(0,s.Z)(a,"connectedCallback",this,3)([]),this._shouldBeDestroy=!1,this.hasUpdated&&!this.disabled&&this._createSortable()}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"render",value:function(){return this.noStyle?n.Ld:(0,n.dy)(c||(c=l` <style>.sortable-fallback{display:none!important}.sortable-ghost{box-shadow:0 0 0 2px var(--primary-color);background:rgba(var(--rgb-primary-color),.25);border-radius:4px;opacity:.4}.sortable-drag{border-radius:4px;opacity:1;background:var(--card-background-color);box-shadow:0px 4px 8px 3px #00000026;cursor:grabbing}</style> `))}},{kind:"method",key:"_createSortable",value:async function(){if(this._sortable)return;const e=this.children[0];if(!e)return;const t=(await Promise.all([i.e("34153"),i.e("467")]).then(i.bind(i,59807))).default,a=Object.assign(Object.assign({scroll:!0,forceAutoScrollFallback:!0,scrollSpeed:20,animation:150},this.options),{},{onChoose:this._handleChoose,onStart:this._handleStart,onEnd:this._handleEnd,onUpdate:this._handleUpdate,onAdd:this._handleAdd,onRemove:this._handleRemove});this.draggableSelector&&(a.draggable=this.draggableSelector),this.handleSelector&&(a.handle=this.handleSelector),void 0!==this.invertSwap&&(a.invertSwap=this.invertSwap),this.group&&(a.group=this.group),this.filter&&(a.filter=this.filter),this._sortable=new t(e,a)}},{kind:"field",key:"_handleUpdate",value(){return e=>{(0,r.B)(this,"item-moved",{newIndex:e.newIndex,oldIndex:e.oldIndex})}}},{kind:"field",key:"_handleAdd",value(){return e=>{(0,r.B)(this,"item-added",{index:e.newIndex,data:e.item.sortableData})}}},{kind:"field",key:"_handleRemove",value(){return e=>{(0,r.B)(this,"item-removed",{index:e.oldIndex})}}},{kind:"field",key:"_handleEnd",value(){return async e=>{(0,r.B)(this,"drag-end"),this.rollback&&e.item.placeholder&&(e.item.placeholder.replaceWith(e.item),delete e.item.placeholder)}}},{kind:"field",key:"_handleStart",value(){return()=>{(0,r.B)(this,"drag-start")}}},{kind:"field",key:"_handleChoose",value(){return e=>{this.rollback&&(e.item.placeholder=document.createComment("sort-placeholder"),e.item.after(e.item.placeholder))}}},{kind:"method",key:"_destroySortable",value:function(){this._sortable&&(this._sortable.destroy(),this._sortable=void 0)}}]}}),n.oi)},75101:function(e,t,i){i.d(t,{$H:()=>a,DJ:()=>r,LZ:()=>n,Nn:()=>u,Ny:()=>g,Pk:()=>f,Q4:()=>o,RQ:()=>l,SO:()=>d,T0:()=>p,aR:()=>s,iJ:()=>h,pB:()=>c});i(71695),i(9359),i(56475),i(1331),i(19423),i(47021);const a=(e,t)=>e.callWS({type:"config_entries/subentries/list",entry_id:t}),s=(e,t,i)=>e.callWS({type:"config_entries/subentries/delete",entry_id:t,subentry_id:i}),n=["migration_error","setup_error","setup_retry"],o=["not_loaded","loaded","setup_error","setup_retry"],r=(e,t,i)=>{const a={type:"config_entries/subscribe"};return i&&i.type&&(a.type_filter=i.type),e.connection.subscribeMessage((e=>t(e)),a)},c=(e,t)=>{const i={};return t&&(t.type&&(i.type_filter=t.type),t.domain&&(i.domain=t.domain)),e.callWS(Object.assign({type:"config_entries/get"},i))},l=(e,t)=>e.callWS({type:"config_entries/get_single",entry_id:t}),d=(e,t,i)=>e.callWS(Object.assign({type:"config_entries/update",entry_id:t},i)),h=(e,t)=>e.callApi("DELETE",`config/config_entries/entry/${t}`),u=(e,t)=>e.callApi("POST",`config/config_entries/entry/${t}/reload`),g=(e,t)=>e.callWS({type:"config_entries/disable",entry_id:t,disabled_by:"user"}),p=(e,t)=>e.callWS({type:"config_entries/disable",entry_id:t,disabled_by:null}),f=(e,t)=>{if(!t)return e;const i=e.find((e=>e.entry_id===t));if(!i)return e;return[i,...e.filter((e=>e.entry_id!==t))]}},15681:function(e,t,i){i.d(t,{D4:()=>d,D7:()=>f,Ky:()=>l,P3:()=>r,V3:()=>_,WW:()=>b,XO:()=>h,ZJ:()=>v,d4:()=>p,oi:()=>g,pV:()=>o,zO:()=>u});var a=i(62212),s=i(22381),n=i(57816);const o=["bluetooth","dhcp","discovery","hardware","hassio","homekit","integration_discovery","mqtt","ssdp","unignore","usb","zeroconf"],r=["reauth"],c={"HA-Frontend-Base":`${location.protocol}//${location.host}`},l=(e,t,i)=>{var a;return e.callApi("POST","config/config_entries/flow",{handler:t,show_advanced_options:Boolean(null===(a=e.userData)||void 0===a?void 0:a.showAdvanced),entry_id:i},c)},d=(e,t)=>e.callApi("GET",`config/config_entries/flow/${t}`,void 0,c),h=(e,t,i)=>e.callApi("POST",`config/config_entries/flow/${t}`,i,c),u=(e,t,i)=>e.callWS({type:"config_entries/ignore_flow",flow_id:t,title:i}),g=(e,t)=>e.callApi("DELETE",`config/config_entries/flow/${t}`),p=(e,t)=>e.callApi("GET","config/config_entries/flow_handlers"+(t?`?type=${t}`:"")),f=e=>e.sendMessagePromise({type:"config_entries/flow/progress"}),y=(e,t)=>e.subscribeEvents((0,s.D)((()=>f(e).then((e=>t.setState(e,!0)))),500,!0),"config_entry_discovered"),v=e=>(0,a._)(e,"_configFlowProgress",f,y),_=(e,t)=>v(e.connection).subscribe(t),b=(e,t)=>t.context.title_placeholders&&0!==Object.keys(t.context.title_placeholders).length?e(`component.${t.handler}.config.flow_title`,t.context.title_placeholders)||("name"in t.context.title_placeholders?t.context.title_placeholders.name:(0,n.Lh)(e,t.handler)):(0,n.Lh)(e,t.handler)},38572:function(e,t,i){i.d(t,{t:()=>v});i(63721),i(71695),i(40251),i(47021);var a=i(57243),s=i(15681),n=i(57816),o=i(7956);let r,c,l,d,h,u,g,p,f,y=e=>e;const v=(e,t)=>(0,o.w)(e,t,{flowType:"config_flow",showDevices:!0,createFlow:async(e,i)=>{const[a]=await Promise.all([(0,s.Ky)(e,i,t.entryId),e.loadFragmentTranslation("config"),e.loadBackendTranslation("config",i),e.loadBackendTranslation("selector",i),e.loadBackendTranslation("title",i)]);return a},fetchFlow:async(e,t)=>{const i=await(0,s.D4)(e,t);return await e.loadFragmentTranslation("config"),await e.loadBackendTranslation("config",i.handler),await e.loadBackendTranslation("selector",i.handler),i},handleFlowStep:s.XO,deleteFlow:s.oi,renderAbortDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.abort.${t.reason}`,t.description_placeholders);return i?(0,a.dy)(r||(r=y` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):t.reason},renderShowFormStepHeader(e,t){return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.title`,t.description_placeholders)||e.localize(`component.${t.handler}.title`)},renderShowFormStepDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.description`,t.description_placeholders);return i?(0,a.dy)(c||(c=y` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):""},renderShowFormStepFieldLabel(e,t,i,a){var s;if("expandable"===i.type)return e.localize(`component.${t.handler}.config.step.${t.step_id}.sections.${i.name}.name`);const n=null!=a&&null!==(s=a.path)&&void 0!==s&&s[0]?`sections.${a.path[0]}.`:"";return e.localize(`component.${t.handler}.config.step.${t.step_id}.${n}data.${i.name}`)||i.name},renderShowFormStepFieldHelper(e,t,i,s){var n;if("expandable"===i.type)return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.sections.${i.name}.description`);const o=null!=s&&null!==(n=s.path)&&void 0!==n&&n[0]?`sections.${s.path[0]}.`:"",r=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.${o}data_description.${i.name}`,t.description_placeholders);return r?(0,a.dy)(l||(l=y`<ha-markdown breaks .content="${0}"></ha-markdown>`),r):""},renderShowFormStepFieldError(e,t,i){return e.localize(`component.${t.translation_domain||t.translation_domain||t.handler}.config.error.${i}`,t.description_placeholders)||i},renderShowFormStepFieldLocalizeValue(e,t,i){return e.localize(`component.${t.handler}.selector.${i}`)},renderShowFormStepSubmitButton(e,t){return e.localize(`component.${t.handler}.config.step.${t.step_id}.submit`)||e.localize("ui.panel.config.integrations.config_flow."+(!1===t.last_step?"next":"submit"))},renderExternalStepHeader(e,t){return e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize("ui.panel.config.integrations.config_flow.external_step.open_site")},renderExternalStepDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.${t.step_id}.description`,t.description_placeholders);return(0,a.dy)(d||(d=y` <p> ${0} </p> ${0} `),e.localize("ui.panel.config.integrations.config_flow.external_step.description"),i?(0,a.dy)(h||(h=y` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):"")},renderCreateEntryDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.create_entry.${t.description||"default"}`,t.description_placeholders);return(0,a.dy)(u||(u=y` ${0} <p> ${0} </p> `),i?(0,a.dy)(g||(g=y` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):"",e.localize("ui.panel.config.integrations.config_flow.created_config",{name:t.title}))},renderShowFormProgressHeader(e,t){return e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize(`component.${t.handler}.title`)},renderShowFormProgressDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.progress.${t.progress_action}`,t.description_placeholders);return i?(0,a.dy)(p||(p=y` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):""},renderMenuHeader(e,t){return e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize(`component.${t.handler}.title`)},renderMenuDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.description`,t.description_placeholders);return i?(0,a.dy)(f||(f=y` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):""},renderMenuOption(e,t,i){return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.menu_options.${i}`,t.description_placeholders)},renderLoadingDescription(e,t,i,a){if("loading_flow"!==t&&"loading_step"!==t)return"";const s=(null==a?void 0:a.handler)||i;return e.localize(`ui.panel.config.integrations.config_flow.loading.${t}`,{integration:s?(0,n.Lh)(e.localize,s):e.localize("ui.panel.config.integrations.config_flow.loading.fallback_title")})}})},7956:function(e,t,i){i.d(t,{w:()=>n});i(71695),i(19423),i(40251),i(47021);var a=i(36522);const s=()=>Promise.all([i.e("46379"),i.e("66031"),i.e("72206"),i.e("97983"),i.e("24199"),i.e("78943"),i.e("2142"),i.e("58640"),i.e("52430"),i.e("4697"),i.e("43429"),i.e("27090"),i.e("8949")]).then(i.bind(i,12656)),n=(e,t,i)=>{(0,a.B)(e,"show-dialog",{dialogTag:"dialog-data-entry-flow",dialogImport:s,dialogParams:Object.assign(Object.assign({},t),{},{flowConfig:i,dialogParentElement:e})})}},3409:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=(i(71695),i(92745),i(9359),i(56475),i(31526),i(70104),i(19423),i(40251),i(47021),i(31622),i(57243)),n=i(50778),o=i(36522),r=(i(54977),i(23334),i(30509),i(1118)),c=i(17705),l=i(76131),d=i(28008),h=i(73192),u=i(58605),g=(i(34234),i(39418)),p=e([r]);r=(p.then?(await p)():p)[0];let f,y,v,_,b,m,k=e=>e;const w="M16 20H8V6H16M16.67 4H15V2H9V4H7.33C6.6 4 6 4.6 6 5.33V20.67C6 21.4 6.6 22 7.33 22H16.67C17.41 22 18 21.41 18 20.67V5.33C18 4.6 17.4 4 16.67 4M15 16H9V19H15V16M15 7H9V10H15V7M15 11.5H9V14.5H15V11.5Z",$="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",C="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z";(0,a.Z)([(0,n.Mo)("ha-energy-battery-settings")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"preferences",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"statsMetadata",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"validationResult",value:void 0},{kind:"method",key:"render",value:function(){const e=[],t=[];return this.preferences.energy_sources.forEach(((i,a)=>{"battery"===i.type&&(e.push(i),this.validationResult&&t.push(this.validationResult.energy_sources[a]))})),(0,s.dy)(f||(f=k` <ha-card outlined> <h1 class="card-header"> <ha-svg-icon .path="${0}"></ha-svg-icon> ${0} </h1> <div class="card-content"> <p> ${0} <a target="_blank" rel="noopener noreferrer" href="${0}">${0}</a> </p> ${0} <h3> ${0} </h3> ${0} <div class="row border-bottom"> <ha-svg-icon .path="${0}"></ha-svg-icon> <mwc-button @click="${0}">${0}</mwc-button> </div> </div> </ha-card> `),w,this.hass.localize("ui.panel.config.energy.battery.title"),this.hass.localize("ui.panel.config.energy.battery.sub"),(0,h.R)(this.hass,"/docs/energy/battery/"),this.hass.localize("ui.panel.config.energy.battery.learn_more"),t.map((e=>(0,s.dy)(y||(y=k` <ha-energy-validation-result .hass="${0}" .issues="${0}"></ha-energy-validation-result> `),this.hass,e))),this.hass.localize("ui.panel.config.energy.battery.battery_systems"),e.map((e=>{var t,i;const a=this.hass.states[e.stat_energy_to];return(0,s.dy)(v||(v=k` <div class="row" .source="${0}"> ${0} <div class="content"> <span class="label">${0}</span> <span class="label">${0}</span> </div> <ha-icon-button .label="${0}" @click="${0}" .path="${0}"></ha-icon-button> <ha-icon-button .label="${0}" @click="${0}" .path="${0}"></ha-icon-button> </div> `),e,null!=a&&a.attributes.icon?(0,s.dy)(_||(_=k`<ha-icon .icon="${0}"></ha-icon>`),a.attributes.icon):(0,s.dy)(b||(b=k`<ha-svg-icon .path="${0}"></ha-svg-icon>`),w),(0,c.Kd)(this.hass,e.stat_energy_from,null===(t=this.statsMetadata)||void 0===t?void 0:t[e.stat_energy_from]),(0,c.Kd)(this.hass,e.stat_energy_to,null===(i=this.statsMetadata)||void 0===i?void 0:i[e.stat_energy_to]),this.hass.localize("ui.panel.config.energy.battery.edit_battery_system"),this._editSource,C,this.hass.localize("ui.panel.config.energy.battery.delete_battery_system"),this._deleteSource,$)})),w,this._addSource,this.hass.localize("ui.panel.config.energy.battery.add_battery_system"))}},{kind:"method",key:"_addSource",value:function(){(0,u.Q6)(this,{battery_sources:this.preferences.energy_sources.filter((e=>"battery"===e.type)),saveCallback:async e=>{await this._savePreferences(Object.assign(Object.assign({},this.preferences),{},{energy_sources:this.preferences.energy_sources.concat(e)}))}})}},{kind:"method",key:"_editSource",value:function(e){const t=e.currentTarget.closest(".row").source;(0,u.Q6)(this,{source:Object.assign({},t),battery_sources:this.preferences.energy_sources.filter((e=>"battery"===e.type)),saveCallback:async e=>{await this._savePreferences(Object.assign(Object.assign({},this.preferences),{},{energy_sources:this.preferences.energy_sources.map((i=>i===t?e:i))}))}})}},{kind:"method",key:"_deleteSource",value:async function(e){const t=e.currentTarget.closest(".row").source;if(await(0,l.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.energy.delete_source")}))try{await this._savePreferences(Object.assign(Object.assign({},this.preferences),{},{energy_sources:this.preferences.energy_sources.filter((e=>e!==t))}))}catch(i){(0,l.showAlertDialog)(this,{title:`Failed to save config: ${i.message}`})}}},{kind:"method",key:"_savePreferences",value:async function(e){const t=await(0,r._Z)(this.hass,e);(0,o.B)(this,"value-changed",{value:t})}},{kind:"get",static:!0,key:"styles",value:function(){return[d.Qx,g.L,(0,s.iv)(m||(m=k`.row{height:58px}.content{display:flex;flex-direction:column}.label{overflow:hidden;text-overflow:ellipsis}`))]}}]}}),s.oi);t()}catch(f){t(f)}}))},98445:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=(i(19083),i(71695),i(9359),i(56475),i(31526),i(70104),i(19423),i(40251),i(61006),i(47021),i(31622),i(57243)),n=i(91583),o=i(50778),r=i(36522),c=(i(54977),i(23334),i(62801),i(37583),i(1118)),l=i(17705),d=i(76131),h=i(28008),u=i(73192),g=i(58605),p=(i(34234),i(39418)),f=e([c]);c=(f.then?(await f)():f)[0];let y,v,_,b,m=e=>e;const k="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",w="M3 6H21V4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H7V18H3V6M13 12H9V13.78C8.39 14.33 8 15.11 8 16C8 16.89 8.39 17.67 9 18.22V20H13V18.22C13.61 17.67 14 16.88 14 16S13.61 14.33 13 13.78V12M11 17.5C10.17 17.5 9.5 16.83 9.5 16S10.17 14.5 11 14.5 12.5 15.17 12.5 16 11.83 17.5 11 17.5M22 8H16C15.5 8 15 8.5 15 9V19C15 19.5 15.5 20 16 20H22C22.5 20 23 19.5 23 19V9C23 8.5 22.5 8 22 8M21 18H17V10H21V18Z",$="M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z",C="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z";(0,a.Z)([(0,o.Mo)("ha-energy-device-settings")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"preferences",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"statsMetadata",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"validationResult",value:void 0},{kind:"method",key:"render",value:function(){var e;return(0,s.dy)(y||(y=m` <ha-card outlined> <h1 class="card-header"> <ha-svg-icon .path="${0}"></ha-svg-icon> ${0} </h1> <div class="card-content"> <p> ${0} <a target="_blank" rel="noopener noreferrer" href="${0}">${0}</a> </p> ${0} <h3> ${0} </h3> <ha-sortable handle-selector=".handle" @item-moved="${0}"> <div class="devices"> ${0} </div> </ha-sortable> <div class="row"> <ha-svg-icon .path="${0}"></ha-svg-icon> <mwc-button @click="${0}">${0}</mwc-button> </div> </div> </ha-card> `),w,this.hass.localize("ui.panel.config.energy.device_consumption.title"),this.hass.localize("ui.panel.config.energy.device_consumption.sub"),(0,u.R)(this.hass,"/docs/energy/individual-devices/"),this.hass.localize("ui.panel.config.energy.device_consumption.learn_more"),null===(e=this.validationResult)||void 0===e?void 0:e.device_consumption.map((e=>(0,s.dy)(v||(v=m` <ha-energy-validation-result .hass="${0}" .issues="${0}"></ha-energy-validation-result> `),this.hass,e))),this.hass.localize("ui.panel.config.energy.device_consumption.devices"),this._itemMoved,(0,n.r)(this.preferences.device_consumption,(e=>e.stat_consumption),(e=>{var t;return(0,s.dy)(_||(_=m` <div class="row" .device="${0}"> <div class="handle"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div> <span class="content">${0}</span> <ha-icon-button .label="${0}" @click="${0}" .path="${0}"></ha-icon-button> <ha-icon-button .label="${0}" @click="${0}" .device="${0}" .path="${0}"></ha-icon-button> </div> `),e,$,e.name||(0,l.Kd)(this.hass,e.stat_consumption,null===(t=this.statsMetadata)||void 0===t?void 0:t[e.stat_consumption]),this.hass.localize("ui.common.edit"),this._editDevice,C,this.hass.localize("ui.common.delete"),this._deleteDevice,e,k)})),w,this._addDevice,this.hass.localize("ui.panel.config.energy.device_consumption.add_device"))}},{kind:"method",key:"_itemMoved",value:function(e){e.stopPropagation();const{oldIndex:t,newIndex:i}=e.detail,a=this.preferences.device_consumption.concat(),s=a.splice(t,1)[0];a.splice(i,0,s);const n=Object.assign(Object.assign({},this.preferences),{},{device_consumption:a});(0,r.B)(this,"value-changed",{value:n}),this._savePreferences(n)}},{kind:"method",key:"_editDevice",value:function(e){const t=e.currentTarget.closest(".row").device;(0,g.Qh)(this,{statsMetadata:this.statsMetadata,device:Object.assign({},t),device_consumptions:this.preferences.device_consumption,saveCallback:async e=>{const i=Object.assign(Object.assign({},this.preferences),{},{device_consumption:this.preferences.device_consumption.map((i=>i===t?e:i))});this._sanitizeParents(i),await this._savePreferences(i)}})}},{kind:"method",key:"_addDevice",value:function(){(0,g.Qh)(this,{statsMetadata:this.statsMetadata,device_consumptions:this.preferences.device_consumption,saveCallback:async e=>{await this._savePreferences(Object.assign(Object.assign({},this.preferences),{},{device_consumption:this.preferences.device_consumption.concat(e)}))}})}},{kind:"method",key:"_sanitizeParents",value:function(e){const t=e.device_consumption.map((e=>e.stat_consumption));e.device_consumption.forEach((e=>{e.included_in_stat&&!t.includes(e.included_in_stat)&&delete e.included_in_stat}))}},{kind:"method",key:"_deleteDevice",value:async function(e){const t=e.currentTarget.device;if(await(0,d.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.energy.delete_source")}))try{const e=Object.assign(Object.assign({},this.preferences),{},{device_consumption:this.preferences.device_consumption.filter((e=>e!==t))});this._sanitizeParents(e),await this._savePreferences(e)}catch(i){(0,d.showAlertDialog)(this,{title:`Failed to save config: ${i.message}`})}}},{kind:"method",key:"_savePreferences",value:async function(e){const t=await(0,c._Z)(this.hass,e);(0,r.B)(this,"value-changed",{value:t})}},{kind:"get",static:!0,key:"styles",value:function(){return[h.Qx,p.L,(0,s.iv)(b||(b=m`.handle{cursor:move;cursor:grab}`))]}}]}}),s.oi);t()}catch(y){t(y)}}))},68646:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=(i(71695),i(92745),i(9359),i(56475),i(31526),i(70104),i(19423),i(40251),i(47021),i(31622),i(57243)),n=i(50778),o=i(36522),r=(i(54977),i(23334),i(1118)),c=i(17705),l=i(76131),d=i(28008),h=i(73192),u=i(58605),g=(i(34234),i(39418)),p=e([r]);r=(p.then?(await p)():p)[0];let f,y,v,_,b,m=e=>e;const k="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",w="M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z",$="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z";(0,a.Z)([(0,n.Mo)("ha-energy-gas-settings")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"preferences",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"statsMetadata",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"validationResult",value:void 0},{kind:"method",key:"render",value:function(){const e=[],t=[];return this.preferences.energy_sources.forEach(((i,a)=>{"gas"===i.type&&(e.push(i),this.validationResult&&t.push(this.validationResult.energy_sources[a]))})),(0,s.dy)(f||(f=m` <ha-card outlined> <h1 class="card-header"> <ha-svg-icon .path="${0}"></ha-svg-icon> ${0} </h1> <div class="card-content"> <p> ${0} <a target="_blank" rel="noopener noreferrer" href="${0}">${0}</a> </p> ${0} <h3> ${0} </h3> ${0} <div class="row border-bottom"> <ha-svg-icon .path="${0}"></ha-svg-icon> <mwc-button @click="${0}">${0}</mwc-button> </div> </div> </ha-card> `),w,this.hass.localize("ui.panel.config.energy.gas.title"),this.hass.localize("ui.panel.config.energy.gas.sub"),(0,h.R)(this.hass,"/docs/energy/gas/"),this.hass.localize("ui.panel.config.energy.gas.learn_more"),t.map((e=>(0,s.dy)(y||(y=m` <ha-energy-validation-result .hass="${0}" .issues="${0}"></ha-energy-validation-result> `),this.hass,e))),this.hass.localize("ui.panel.config.energy.gas.gas_consumption"),e.map((e=>{var t;const i=this.hass.states[e.stat_energy_from];return(0,s.dy)(v||(v=m` <div class="row" .source="${0}"> ${0} <span class="content">${0}</span> <ha-icon-button .label="${0}" @click="${0}" .path="${0}"></ha-icon-button> <ha-icon-button .label="${0}" @click="${0}" .path="${0}"></ha-icon-button> </div> `),e,null!=i&&i.attributes.icon?(0,s.dy)(_||(_=m`<ha-icon .icon="${0}"></ha-icon>`),i.attributes.icon):(0,s.dy)(b||(b=m`<ha-svg-icon .path="${0}"></ha-svg-icon>`),w),(0,c.Kd)(this.hass,e.stat_energy_from,null===(t=this.statsMetadata)||void 0===t?void 0:t[e.stat_energy_from]),this.hass.localize("ui.panel.config.energy.gas.edit_gas_source"),this._editSource,$,this.hass.localize("ui.panel.config.energy.gas.delete_gas_source"),this._deleteSource,k)})),w,this._addSource,this.hass.localize("ui.panel.config.energy.gas.add_gas_source"))}},{kind:"method",key:"_addSource",value:function(){(0,u.vp)(this,{allowedGasUnitClass:(0,r.G9)(this.preferences,void 0,this.statsMetadata),gas_sources:this.preferences.energy_sources.filter((e=>"gas"===e.type)),saveCallback:async e=>{delete e.unit_of_measurement,await this._savePreferences(Object.assign(Object.assign({},this.preferences),{},{energy_sources:this.preferences.energy_sources.concat(e)}))}})}},{kind:"method",key:"_editSource",value:function(e){var t;const i=e.currentTarget.closest(".row").source;(0,u.vp)(this,{source:Object.assign({},i),allowedGasUnitClass:(0,r.G9)(this.preferences,i.stat_energy_from,this.statsMetadata),metadata:null===(t=this.statsMetadata)||void 0===t?void 0:t[i.stat_energy_from],gas_sources:this.preferences.energy_sources.filter((e=>"gas"===e.type)),saveCallback:async e=>{await this._savePreferences(Object.assign(Object.assign({},this.preferences),{},{energy_sources:this.preferences.energy_sources.map((t=>t===i?e:t))}))}})}},{kind:"method",key:"_deleteSource",value:async function(e){const t=e.currentTarget.closest(".row").source;if(await(0,l.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.energy.delete_source")}))try{await this._savePreferences(Object.assign(Object.assign({},this.preferences),{},{energy_sources:this.preferences.energy_sources.filter((e=>e!==t))}))}catch(i){(0,l.showAlertDialog)(this,{title:`Failed to save config: ${i.message}`})}}},{kind:"method",key:"_savePreferences",value:async function(e){const t=await(0,r._Z)(this.hass,e);(0,o.B)(this,"value-changed",{value:t})}},{kind:"get",static:!0,key:"styles",value:function(){return[d.Qx,g.L]}}]}}),s.oi);t()}catch(f){t(f)}}))},98237:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=(i(71695),i(92745),i(52805),i(9359),i(56475),i(1331),i(70104),i(48136),i(19423),i(40251),i(47021),i(31622),i(57243)),n=i(50778),o=i(36522),r=(i(54977),i(23334),i(75101)),c=i(1118),l=i(17705),d=i(38572),h=i(76131),u=i(28008),g=i(88238),p=i(73192),f=i(58605),y=(i(34234),i(39418)),v=e([c]);c=(v.then?(await v)():v)[0];let _,b,m,k,w,$,C,x,L,H,M=e=>e;const S="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",z="M24 13L20 17V14H11V12H20V9L24 13M4 20V12H1L11 3L18 9.3V10H15.79L11 5.69L6 10.19V18H16V16H18V20H4Z",V="M15 13L11 17V14H2V12H11V9L15 13M5 20V16H7V18H17V10.19L12 5.69L7.21 10H4.22L12 3L22 12H19V20H5Z",O="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",j="M8.28,5.45L6.5,4.55L7.76,2H16.23L17.5,4.55L15.72,5.44L15,4H9L8.28,5.45M18.62,8H14.09L13.3,5H10.7L9.91,8H5.38L4.1,10.55L5.89,11.44L6.62,10H17.38L18.1,11.45L19.89,10.56L18.62,8M17.77,22H15.7L15.46,21.1L12,15.9L8.53,21.1L8.3,22H6.23L9.12,11H11.19L10.83,12.35L12,14.1L13.16,12.35L12.81,11H14.88L17.77,22M11.4,15L10.5,13.65L9.32,18.13L11.4,15M14.68,18.12L13.5,13.64L12.6,15L14.68,18.12Z";(0,a.Z)([(0,n.Mo)("ha-energy-grid-settings")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"preferences",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"statsMetadata",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"validationResult",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_co2ConfigEntry",value:void 0},{kind:"method",key:"firstUpdated",value:function(){this._fetchCO2SignalConfigEntries()}},{kind:"method",key:"render",value:function(){var e,t,i;const a=this.preferences.energy_sources.findIndex((e=>"grid"===e.type));let n,o;return-1===a?n=(0,c.iK)():(n=this.preferences.energy_sources[a],this.validationResult&&(o=this.validationResult.energy_sources[a])),(0,s.dy)(_||(_=M` <ha-card outlined> <h1 class="card-header"> <ha-svg-icon .path="${0}"></ha-svg-icon> ${0} </h1> <div class="card-content"> <p> ${0} <a target="_blank" rel="noopener noreferrer" href="${0}">${0}</a> </p> ${0} <h3> ${0} </h3> ${0} <div class="row border-bottom"> <ha-svg-icon .path="${0}"></ha-svg-icon> <mwc-button @click="${0}">${0}</mwc-button> </div> <h3> ${0} </h3> ${0} <div class="row border-bottom"> <ha-svg-icon .path="${0}"></ha-svg-icon> <mwc-button @click="${0}">${0}</mwc-button> </div> <h3> ${0} </h3> ${0} </div> </ha-card> `),j,this.hass.localize("ui.panel.config.energy.grid.title"),this.hass.localize("ui.panel.config.energy.grid.sub"),(0,p.R)(this.hass,"/docs/energy/electricity-grid/"),this.hass.localize("ui.panel.config.energy.grid.learn_more"),o?(0,s.dy)(b||(b=M` <ha-energy-validation-result .hass="${0}" .issues="${0}"></ha-energy-validation-result> `),this.hass,o):"",this.hass.localize("ui.panel.config.energy.grid.grid_consumption"),n.flow_from.map((e=>{var t;const i=this.hass.states[e.stat_energy_from];return(0,s.dy)(m||(m=M` <div class="row" .source="${0}"> ${0} <span class="content">${0}</span> <ha-icon-button .label="${0}" @click="${0}" .path="${0}"></ha-icon-button> <ha-icon-button .label="${0}" @click="${0}" .path="${0}"></ha-icon-button> </div> `),e,null!=i&&i.attributes.icon?(0,s.dy)(k||(k=M`<ha-icon .icon="${0}"></ha-icon>`),null==i?void 0:i.attributes.icon):(0,s.dy)(w||(w=M`<ha-svg-icon .path="${0}"></ha-svg-icon>`),V),(0,l.Kd)(this.hass,e.stat_energy_from,null===(t=this.statsMetadata)||void 0===t?void 0:t[e.stat_energy_from]),this.hass.localize("ui.panel.config.energy.grid.edit_consumption"),this._editFromSource,O,this.hass.localize("ui.panel.config.energy.grid.delete_consumption"),this._deleteFromSource,S)})),V,this._addFromSource,this.hass.localize("ui.panel.config.energy.grid.add_consumption"),this.hass.localize("ui.panel.config.energy.grid.return_to_grid"),n.flow_to.map((e=>{var t;const i=this.hass.states[e.stat_energy_to];return(0,s.dy)($||($=M` <div class="row" .source="${0}"> ${0} <span class="content">${0}</span> <ha-icon-button .label="${0}" @click="${0}" .path="${0}"></ha-icon-button> <ha-icon-button .label="${0}" @click="${0}" .path="${0}"></ha-icon-button> </div> `),e,null!=i&&i.attributes.icon?(0,s.dy)(C||(C=M`<ha-icon .icon="${0}"></ha-icon>`),i.attributes.icon):(0,s.dy)(x||(x=M`<ha-svg-icon .path="${0}"></ha-svg-icon>`),z),(0,l.Kd)(this.hass,e.stat_energy_to,null===(t=this.statsMetadata)||void 0===t?void 0:t[e.stat_energy_to]),this.hass.localize("ui.panel.config.energy.grid.edit_return"),this._editToSource,O,this.hass.localize("ui.panel.config.energy.grid.delete_return"),this._deleteToSource,S)})),z,this._addToSource,this.hass.localize("ui.panel.config.energy.grid.add_return"),this.hass.localize("ui.panel.config.energy.grid.grid_carbon_footprint"),this._co2ConfigEntry?(0,s.dy)(L||(L=M`<div class="row" .entry="${0}"> <img alt="" crossorigin="anonymous" referrerpolicy="no-referrer" src="${0}"> <span class="content">${0}</span> <a href="${0}"> <ha-icon-button .path="${0}"></ha-icon-button> </a> <ha-icon-button .label="${0}" @click="${0}" .path="${0}"></ha-icon-button> </div>`),this._co2ConfigEntry,(0,g.X1)({domain:"co2signal",type:"icon",darkOptimized:null===(e=this.hass.themes)||void 0===e?void 0:e.darkMode}),this._co2ConfigEntry.title,`/config/integrations/integration/${null===(t=this._co2ConfigEntry)||void 0===t?void 0:t.domain}`,O,this.hass.localize("ui.panel.config.energy.grid.remove_co2_signal"),this._removeCO2Sensor,S):(0,s.dy)(H||(H=M` <div class="row border-bottom"> <img alt="" crossorigin="anonymous" referrerpolicy="no-referrer" src="${0}"> <mwc-button @click="${0}"> ${0} </mwc-button> </div> `),(0,g.X1)({domain:"co2signal",type:"icon",darkOptimized:null===(i=this.hass.themes)||void 0===i?void 0:i.darkMode}),this._addCO2Sensor,this.hass.localize("ui.panel.config.energy.grid.add_co2_signal")))}},{kind:"method",key:"_fetchCO2SignalConfigEntries",value:async function(){const e=await(0,r.pB)(this.hass,{domain:"co2signal"});this._co2ConfigEntry=e.length?e[0]:void 0}},{kind:"method",key:"_addCO2Sensor",value:function(){(0,d.t)(this,{startFlowHandler:"co2signal",dialogClosedCallback:()=>{this._fetchCO2SignalConfigEntries()}})}},{kind:"method",key:"_removeCO2Sensor",value:async function(e){const t=e.currentTarget.closest(".row").entry.entry_id;await(0,h.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.energy.delete_integration")})&&(await(0,r.iJ)(this.hass,t),this._fetchCO2SignalConfigEntries())}},{kind:"method",key:"_addFromSource",value:function(){const e=this.preferences.energy_sources.find((e=>"grid"===e.type));(0,f.a0)(this,{grid_source:e,saveCallback:async t=>{let i;i=e?Object.assign(Object.assign({},this.preferences),{},{energy_sources:this.preferences.energy_sources.map((i=>"grid"===i.type?Object.assign(Object.assign({},i),{},{flow_from:[...e.flow_from,t]}):i))}):Object.assign(Object.assign({},this.preferences),{},{energy_sources:[...this.preferences.energy_sources,Object.assign(Object.assign({},(0,c.iK)()),{},{flow_from:[t]})]}),await this._savePreferences(i)}})}},{kind:"method",key:"_addToSource",value:function(){const e=this.preferences.energy_sources.find((e=>"grid"===e.type));(0,f.u_)(this,{grid_source:e,saveCallback:async t=>{let i;i=e?Object.assign(Object.assign({},this.preferences),{},{energy_sources:this.preferences.energy_sources.map((i=>"grid"===i.type?Object.assign(Object.assign({},i),{},{flow_to:[...e.flow_to,t]}):i))}):Object.assign(Object.assign({},this.preferences),{},{energy_sources:[...this.preferences.energy_sources,Object.assign(Object.assign({},(0,c.iK)()),{},{flow_to:[t]})]}),await this._savePreferences(i)}})}},{kind:"method",key:"_editFromSource",value:function(e){var t;const i=e.currentTarget.closest(".row").source,a=this.preferences.energy_sources.find((e=>"grid"===e.type));(0,f.a0)(this,{source:Object.assign({},i),grid_source:a,metadata:null===(t=this.statsMetadata)||void 0===t?void 0:t[i.stat_energy_from],saveCallback:async e=>{const t=(0,c.Jj)(this.preferences).grid[0].flow_from,a=Object.assign(Object.assign({},this.preferences),{},{energy_sources:this.preferences.energy_sources.map((a=>"grid"===a.type?Object.assign(Object.assign({},a),{},{flow_from:t.map((t=>t===i?e:t))}):a))});await this._savePreferences(a)}})}},{kind:"method",key:"_editToSource",value:function(e){var t;const i=e.currentTarget.closest(".row").source,a=this.preferences.energy_sources.find((e=>"grid"===e.type));(0,f.u_)(this,{source:Object.assign({},i),grid_source:a,metadata:null===(t=this.statsMetadata)||void 0===t?void 0:t[i.stat_energy_to],saveCallback:async e=>{const t=(0,c.Jj)(this.preferences).grid[0].flow_to,a=Object.assign(Object.assign({},this.preferences),{},{energy_sources:this.preferences.energy_sources.map((a=>"grid"===a.type?Object.assign(Object.assign({},a),{},{flow_to:t.map((t=>t===i?e:t))}):a))});await this._savePreferences(a)}})}},{kind:"method",key:"_deleteFromSource",value:async function(e){const t=e.currentTarget.closest(".row").source;if(!(await(0,h.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.energy.delete_source")})))return;const i=(0,c.Jj)(this.preferences).grid[0].flow_from.filter((e=>e!==t)),a=Object.assign(Object.assign({},this.preferences),{},{energy_sources:this.preferences.energy_sources.map((e=>"grid"===e.type?Object.assign(Object.assign({},e),{},{flow_from:i}):e))}),s=this._removeEmptySources(a);await this._savePreferences(s)}},{kind:"method",key:"_deleteToSource",value:async function(e){const t=e.currentTarget.closest(".row").source;if(!(await(0,h.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.energy.delete_source")})))return;const i=(0,c.Jj)(this.preferences).grid[0].flow_to.filter((e=>e!==t)),a=Object.assign(Object.assign({},this.preferences),{},{energy_sources:this.preferences.energy_sources.map((e=>"grid"===e.type?Object.assign(Object.assign({},e),{},{flow_to:i}):e))}),s=this._removeEmptySources(a);await this._savePreferences(s)}},{kind:"method",key:"_removeEmptySources",value:function(e){return e.energy_sources=e.energy_sources.reduce(((e,t)=>(("grid"!==t.type||t.flow_from.length>0||t.flow_to.length>0)&&e.push(t),e)),[]),e}},{kind:"method",key:"_savePreferences",value:async function(e){try{const t=await(0,c._Z)(this.hass,e);(0,o.B)(this,"value-changed",{value:t})}catch(t){(0,h.showAlertDialog)(this,{title:`Failed to save config: ${t.message}`})}}},{kind:"get",static:!0,key:"styles",value:function(){return[u.Qx,y.L]}}]}}),s.oi);t()}catch(_){t(_)}}))},76539:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=(i(71695),i(92745),i(9359),i(56475),i(31526),i(70104),i(19423),i(40251),i(47021),i(31622),i(57243)),n=i(50778),o=i(36522),r=(i(54977),i(23334),i(1118)),c=i(17705),l=i(76131),d=i(28008),h=i(73192),u=i(58605),g=(i(34234),i(39418)),p=e([r]);r=(p.then?(await p)():p)[0];let f,y,v,_,b,m,k,w=e=>e;const $="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",C="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",x="M11.45,2V5.55L15,3.77L11.45,2M10.45,8L8,10.46L11.75,11.71L10.45,8M2,11.45L3.77,15L5.55,11.45H2M10,2H2V10C2.57,10.17 3.17,10.25 3.77,10.25C7.35,10.26 10.26,7.35 10.27,3.75C10.26,3.16 10.17,2.57 10,2M17,22V16H14L19,7V13H22L17,22Z";(0,a.Z)([(0,n.Mo)("ha-energy-solar-settings")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"preferences",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"statsMetadata",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"validationResult",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"info",value:void 0},{kind:"method",key:"render",value:function(){const e=[],t=[];return this.preferences.energy_sources.forEach(((i,a)=>{"solar"===i.type&&(e.push(i),this.validationResult&&t.push(this.validationResult.energy_sources[a]))})),(0,s.dy)(f||(f=w` <ha-card outlined> <h1 class="card-header"> <ha-svg-icon .path="${0}"></ha-svg-icon> ${0} </h1> <div class="card-content"> <p> ${0} <a target="_blank" rel="noopener noreferrer" href="${0}">${0}</a> </p> ${0} <h3> ${0} </h3> ${0} ${0} </div> </ha-card> `),x,this.hass.localize("ui.panel.config.energy.solar.title"),this.hass.localize("ui.panel.config.energy.solar.sub"),(0,h.R)(this.hass,"/docs/energy/solar-panels/"),this.hass.localize("ui.panel.config.energy.solar.learn_more"),t.map((e=>(0,s.dy)(y||(y=w` <ha-energy-validation-result .hass="${0}" .issues="${0}"></ha-energy-validation-result> `),this.hass,e))),this.hass.localize("ui.panel.config.energy.solar.solar_production"),e.map((e=>{var t;const i=this.hass.states[e.stat_energy_from];return(0,s.dy)(v||(v=w` <div class="row" .source="${0}"> ${0} <span class="content">${0}</span> ${0} <ha-icon-b