iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
4 lines • 22.2 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[88013],{93421:function(t,e,i){i.d(e,{IW:function(){return h},dH:function(){return l},fI:function(){return c}});i(44114),i(62953);var o=i(35211),s=i(22792),a=i(32172);const n=(t,e)=>{let i=t;for(const o of e){if(null==i)return;i=i[o]}return i},r=(t,e,i)=>{const s=(0,a.p)({transformer:function(t){return i.call(this,t)},watch:e?[e]:[]}),n=(0,o.Fg)({context:t,subscribe:!0});return(t,e)=>{s(t,e),n(t,e)}},c=t=>r(s.iN,t.entityIdPath[0],function(e){const i=n(this,t.entityIdPath);return"string"==typeof i?null==e?void 0:e[i]:void 0}),l=t=>r(s.X1,t.entityIdPath[0],function(e){const i=n(this,t.entityIdPath);return"string"==typeof i?null==e?void 0:e[i]:void 0}),h=()=>r(s.D5,void 0,({localize:t})=>t)},32172:function(t,e,i){i.d(e,{p:function(){return o}});i(16280),i(18111),i(7588),i(45367),i(92731),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);function o(t){return(e,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const o=String(i),s=e;if(s._transformers){if(!s.hasOwnProperty("_transformers")){const t=s._transformers;s._transformers=new Map,t.forEach((t,e)=>s._transformers.set(e,t))}}else{s._transformers=new Map,s._watching=new Map;const t=s.willUpdate;s.willUpdate=function(e){t.call(this,e);const i=new Set;e.forEach((t,e)=>{const o=this._watching.get(e);void 0!==o&&o.forEach(t=>i.add(t))}),i.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}s._transformers.set(i,t.transformer),t.watch&&t.watch.forEach(t=>{let e=s._watching.get(t);e||(e=new Set,s._watching.set(t,e)),e.add(i)});const a=Object.getOwnPropertyDescriptor(e,i);let n;if(void 0===a)n={get(){return this[`__transform_${o}`]},set(t){const e=this[`__transform_${o}`],i=this._transformers.get(o);this[`__transform_${o}`]=i?i.call(this,t):t,this[`__original_${o}`]=t,this.requestUpdate(o,e)},configurable:!0,enumerable:!0};else{const t=a.set;n=Object.assign(Object.assign({},a),{},{set(e){const i=this[`__transform_${o}`],s=this._transformers.get(o);this[`__transform_${o}`]=s?s.call(this,e):e,this[`__original_${o}`]=e,this.requestUpdate(o,i),null==t||t.call(this,e)}})}Object.defineProperty(e,i,n)}}},38962:function(t,e,i){i.a(t,async function(t,o){try{i.r(e);i(62953);var s=i(40445),a=i(5124),n=i(67576),r=i(6412),c=i(93421),l=i(1087),h=i(26300),d=(i(67094),t([h]));h=(d.then?(await d)():d)[0];let p,u,g,v,f=t=>t;const _="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",y={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"};class b extends a.WF{render(){var t;return(0,a.qy)(p||(p=f` <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,r.H)({[this.alertType]:!0}),this.title?"":"no-title",y[this.alertType],(0,r.H)({content:!0,narrow:this.narrow}),this.title?(0,a.qy)(u||(u=f`<div class="title">${0}</div>`),this.title):a.s6,this.dismissable?(0,a.qy)(g||(g=f`<ha-icon-button ="${0}" .label="${0}" .path="${0}"></ha-icon-button>`),this._dismissClicked,null===(t=this._localize)||void 0===t?void 0:t.call(this,"ui.common.dismiss_alert"),_):a.s6)}_dismissClicked(){(0,l.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}b.styles=(0,a.AH)(v||(v=f`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.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;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-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}`)),(0,s.Cg)([(0,n.MZ)()],b.prototype,"title",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"alert-type"})],b.prototype,"alertType",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],b.prototype,"dismissable",void 0),(0,s.Cg)([(0,n.wk)(),(0,c.IW)()],b.prototype,"_localize",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],b.prototype,"narrow",void 0),b=(0,s.Cg)([(0,n.EM)("ha-alert")],b),o()}catch(p){o(p)}})},90248:function(t,e,i){i.a(t,async function(t,o){try{i.r(e),i.d(e,{HaIconButtonArrowPrev:function(){return g}});i(62953);var s=i(40445),a=i(5124),n=i(67576),r=i(63091),c=i(26300),l=t([c]);c=(l.then?(await l)():l)[0];let h,d=t=>t;const p="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",u="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class g extends a.WF{render(){var t;return(0,a.qy)(h||(h=d` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(t=this.hass)||void 0===t?void 0:t.localize("ui.common.back"))||"Back",this._icon,this.href,this.target,this.rel,this.download)}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===r.G.document.dir?u:p}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],g.prototype,"disabled",void 0),(0,s.Cg)([(0,n.MZ)()],g.prototype,"label",void 0),(0,s.Cg)([(0,n.MZ)()],g.prototype,"href",void 0),(0,s.Cg)([(0,n.MZ)()],g.prototype,"target",void 0),(0,s.Cg)([(0,n.MZ)()],g.prototype,"rel",void 0),(0,s.Cg)([(0,n.MZ)()],g.prototype,"download",void 0),(0,s.Cg)([(0,n.wk)()],g.prototype,"_icon",void 0),g=(0,s.Cg)([(0,n.EM)("ha-icon-button-arrow-prev")],g),o()}catch(h){o(h)}})},26300:function(t,e,i){i.a(t,async function(t,o){try{i.r(e),i.d(e,{HaIconButton:function(){return v}});i(62953);var s=i(40445),a=i(5124),n=i(67576),r=i(63672),c=i(18350),l=(i(67094),t([c]));c=(l.then?(await l)():l)[0];let h,d,p,u,g=t=>t;class v extends a.WF{render(){return(0,a.qy)(h||(h=g` <ha-button appearance="plain" variant="neutral" aria-label="${0}" title="${0}" aria-haspopup="${0}" .disabled="${0}" .iconTag="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"> ${0} </ha-button> `),(0,r.J)(this.label),(0,r.J)(this.hideTitle?void 0:this.label),(0,r.J)(this.ariaHasPopup),this.disabled,this.path?"ha-svg-icon":"span",this.href,this.target,this.rel,this.download,this.path?(0,a.qy)(d||(d=g`<ha-svg-icon aria-hidden="true" .path="${0}"></ha-svg-icon>`),this.path):(0,a.qy)(p||(p=g`<span><slot></slot></span>`)))}constructor(...t){super(...t),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}v.shadowRootOptions={mode:"open",delegatesFocus:!0},v.styles=(0,a.AH)(u||(u=g`:host{display:inline-block;outline:0;--ha-button-height:var(--ha-icon-button-size, 48px)}ha-button{position:relative;isolation:isolate;--wa-form-control-padding-inline:var(
--ha-icon-button-padding-inline,
--ha-space-2
);--wa-color-on-normal:currentColor;--wa-color-fill-quiet:transparent;--ha-button-label-overflow:visible}ha-button::after{content:"";position:absolute;inset:0;z-index:-1;border-radius:50%;background-color:currentColor;opacity:0;pointer-events:none}ha-button::part(base){width:var(--wa-form-control-height);aspect-ratio:1;outline-offset:-4px}ha-button::part(label){display:flex}:host([selected]) ha-button::after{opacity:.1} (hover:hover){:host(:hover:not([disabled])) ha-button::after{opacity:.1}}`)),(0,s.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],v.prototype,"disabled",void 0),(0,s.Cg)([(0,n.MZ)({type:String})],v.prototype,"path",void 0),(0,s.Cg)([(0,n.MZ)({type:String})],v.prototype,"label",void 0),(0,s.Cg)([(0,n.MZ)({type:String,attribute:"aria-haspopup"})],v.prototype,"ariaHasPopup",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"hide-title",type:Boolean})],v.prototype,"hideTitle",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],v.prototype,"selected",void 0),(0,s.Cg)([(0,n.MZ)()],v.prototype,"href",void 0),(0,s.Cg)([(0,n.MZ)()],v.prototype,"target",void 0),(0,s.Cg)([(0,n.MZ)()],v.prototype,"rel",void 0),(0,s.Cg)([(0,n.MZ)()],v.prototype,"download",void 0),v=(0,s.Cg)([(0,n.EM)("ha-icon-button")],v),o()}catch(h){o(h)}})},2054:function(t,e,i){i.a(t,async function(t,e){try{i(16280),i(62953);var o=i(40445),s=i(5124),a=i(67576),n=i(1087),r=i(44249),c=i(26300),l=t([c]);c=(l.then?(await l)():l)[0];let h,d,p,u=t=>t;const g="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class v extends s.WF{connectedCallback(){super.connectedCallback(),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}disconnectedCallback(){super.disconnectedCallback(),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}render(){if(!this._show)return s.s6;const t=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return(0,s.qy)(h||(h=u` <ha-icon-button .label="${0}" .path="${0}" ="${0}"></ha-icon-button> ${0} `),this.hass.localize("ui.sidebar.sidebar_toggle"),g,this._toggleMenu,t?(0,s.qy)(d||(d=u`<div class="dot"></div>`)):"")}willUpdate(t){if(super.willUpdate(t),!t.has("narrow")&&!t.has("hass"))return;const e=t.has("hass")?t.get("hass"):this.hass,i=t.has("narrow")?t.get("narrow"):this.narrow,o=!1===(null==e?void 0:e.kioskMode)&&(i||"always_hidden"===(null==e?void 0:e.dockedSidebar)),s=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&o===s||(this._show=s||this._alwaysVisible,s?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}_subscribeNotifications(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,r.V)(this.hass.connection,t=>{this._hasNotifications=t.length>0})}_toggleMenu(){(0,n.r)(this,"hass-toggle-menu")}constructor(...t){super(...t),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}v.styles=(0,s.AH)(p||(p=u`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:var(--ha-border-radius-circle);border:2px solid var(--app-header-background-color)}`)),(0,o.Cg)([(0,a.MZ)({type:Boolean})],v.prototype,"narrow",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,o.Cg)([(0,a.wk)()],v.prototype,"_hasNotifications",void 0),(0,o.Cg)([(0,a.wk)()],v.prototype,"_show",void 0),v=(0,o.Cg)([(0,a.EM)("ha-menu-button")],v),e()}catch(h){e(h)}})},67094:function(t,e,i){i.r(e),i.d(e,{HaSvgIcon:function(){return d}});var o=i(40445),s=i(5124),a=i(67576);let n,r,c,l,h=t=>t;class d extends s.WF{render(){return(0,s.JW)(n||(n=h` <svg viewBox="${0}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${0} ${0} </g> </svg>`),this.viewBox||"0 0 24 24",this.path?(0,s.JW)(r||(r=h`<path class="primary-path" d="${0}"></path>`),this.path):s.s6,this.secondaryPath?(0,s.JW)(c||(c=h`<path class="secondary-path" d="${0}"></path>`),this.secondaryPath):s.s6)}}d.styles=(0,s.AH)(l||(l=h`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`)),(0,o.Cg)([(0,a.MZ)()],d.prototype,"path",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],d.prototype,"secondaryPath",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],d.prototype,"viewBox",void 0),d=(0,o.Cg)([(0,a.EM)("ha-svg-icon")],d)},44249:function(t,e,i){i.d(e,{V:function(){return o}});i(62953);const o=(t,e)=>{const i=new s,o=t.subscribeMessage(t=>e(i.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{o.then(t=>null==t?void 0:t())}};class s{processMessage(t){if("removed"===t.type)for(const e of Object.keys(t.notifications))delete this.notifications[e];else this.notifications=Object.assign(Object.assign({},this.notifications),t.notifications);return Object.values(this.notifications)}constructor(){this.notifications={}}}},8872:function(t,e,i){i.d(e,{F:function(){return s},_:function(){return a}});i(3362),i(62953);var o=i(1087);const s=()=>Promise.all([i.e(92769),i.e(3283),i.e(33192),i.e(26092),i.e(39005),i.e(66201),i.e(90108)]).then(i.bind(i,22756)),a=(t,e)=>{(0,o.r)(t,"show-dialog",{dialogTag:"dialog-device-registry-detail",dialogImport:s,dialogParams:e})}},74699:function(t,e,i){i.d(e,{X:function(){return a}});i(3362),i(62953);var o=i(1087);const s=()=>Promise.all([i.e(3650),i.e(95309)]).then(i.bind(i,284)),a=(t,e)=>{(0,o.r)(t,"show-dialog",{dialogTag:"dialog-edit-home",dialogImport:s,dialogParams:e})}},75480:function(t,e,i){i.d(e,{x:function(){return a}});i(3362),i(62953);var o=i(1087);const s=()=>i.e(31581).then(i.bind(i,31756)),a=(t,e)=>{(0,o.r)(t,"show-dialog",{dialogTag:"dialog-new-overview",dialogImport:s,dialogParams:e})}},50647:function(t,e,i){i.a(t,async function(t,o){try{i.r(e);i(3362),i(27495),i(25440),i(62953);var s=i(40445),a=i(88696),n=i(5124),r=i(67576),c=i(89784),l=i(62384),h=i(91926),d=i(9899),p=i(19459),u=i(18350),g=(i(67094),i(53641)),v=i(58594),f=i(48250),_=i(53580),y=i(81619),b=i(34023),m=i(8872),w=i(76559),C=i(29994),M=i(15656),x=i(74699),$=i(75480),L=i(99774),k=t([u,C,a]);[u,C,a]=k.then?(await k)():k;let H,A,Z,N=t=>t;const P="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";class I extends n.WF{get _showBanner(){var t;if(this._config.welcome_banner_dismissed)return!1;if("RUNNING"!==this.hass.config.state)return!1;const e=null===(t=this.hass.systemData)||void 0===t?void 0:t.onboarded_version,i=e&&(0,l.v)(e,2026,2),o=(0,L.Dq)(this.hass);return!i&&!o}willUpdate(t){if(super.willUpdate(t),!this.hasUpdated)return void this._setup();if(t.has("route")&&this._updateExtraActionItems(),!t.has("hass"))return;const e=t.get("hass");if(e&&e.localize!==this.hass.localize)this._setLovelace();else if(e&&this.hass){if((e.entities!==this.hass.entities||e.devices!==this.hass.devices||e.areas!==this.hass.areas||e.floors!==this.hass.floors||e.panels!==this.hass.panels)&&"RUNNING"===this.hass.config.state)return void this._debounceRegistriesChanged();"RUNNING"===this.hass.config.state&&"RUNNING"!==e.config.state&&this._setup()}}async _setup(){this._updateExtraActionItems(),this._loadConfigPromise=this._loadConfig(),await this._loadConfigPromise,this._setLovelace()}async _loadConfig(){try{const[t,e]=await Promise.all([this.hass.loadFragmentTranslation("lovelace"),(0,f.wE)(this.hass.connection,"home")]);this._config=e||{}}catch(t){console.error("Failed to load favorites:",t),this._config={}}}_updateExtraActionItems(){var t;const e=null===(t=this.route)||void 0===t||null===(t=t.path)||void 0===t?void 0:t.split("/")[1];null!=e&&e.startsWith("areas-")?this._extraActionItems=[{icon:P,labelKey:"ui.panel.lovelace.menu.edit_area",action:this._editArea}]:this._extraActionItems=e&&"overview"!==e?void 0:[{icon:P,labelKey:"ui.panel.lovelace.menu.edit_overview",action:this._editHome}]}async _showAddIntegrationDialog(){await this.hass.loadFragmentTranslation("config"),(0,w.X)(this,{navigateToResult:!1})}_showAssignAreaDialog(t){const e=this.hass.devices[t];e&&(0,m._)(this,{device:e,updateEntry:async e=>{await(0,v.FB)(this.hass,t,e)}})}render(){if(!this._lovelace)return n.s6;const t=(0,c.W)({"--view-container-padding-top":this._bannerHeight.value?`${this._bannerHeight.value}px`:void 0});return(0,n.qy)(H||(H=N` ${0} <hui-root .hass="${0}" .narrow="${0}" .lovelace="${0}" .route="${0}" .panel="${0}" no-edit .extraActionItems="${0}" -custom="${0}" style="${0}"></hui-root> `),this._renderBanner(),this.hass,this.narrow,this._lovelace,this.route,this.panel,this._extraActionItems,this._handleLLCustomEvent,t)}_renderBanner(){return this._showBanner?(0,n.qy)(A||(A=N` <div class="banner"> <div class="banner-content"> <ha-svg-icon .path="${0}"></ha-svg-icon> <span class="banner-text"> ${0} </span> </div> <div class="banner-actions"> <ha-button size="small" appearance="filled" ="${0}"> ${0} </ha-button> </div> </div> `),_.mdiHomeAssistant,this.hass.localize("ui.panel.home.banner.welcome_message"),this._learnMore,this.hass.localize("ui.panel.home.banner.learn_more")):n.s6}updated(t){super.updated(t),(t.has("_showBanner")||t.has("_lovelace"))&&this._banner&&this._bannerHeight.observe(this._banner)}_learnMore(){(0,$.x)(this,{dismiss:async()=>{const t=Object.assign(Object.assign({},this._config),{},{welcome_banner_dismissed:!0});this._config=t,await(0,f.x0)(this.hass.connection,"home",t)}})}async _setLovelace(){var t;this._loadConfigPromise&&await this._loadConfigPromise;const e={strategy:{type:"home",favorite_entities:this._config.favorite_entities,home_panel:!0,hide_welcome_message:this._config.hide_welcome_message,hide_suggested_entities:this._config.hide_suggested_entities,shortcuts:this._config.shortcuts}},i=await(0,M.d4)(e,this.hass);(0,p.b)(i,null===(t=this._lovelace)||void 0===t?void 0:t.config)||(this._lovelace={config:i,rawConfig:i,editMode:!1,urlPath:"home",mode:"generated",locale:this.hass.locale,enableFullEditMode:()=>{},saveConfig:async()=>{},deleteConfig:async()=>{},setEditMode:()=>{},showToast:()=>{}})}async _saveConfig(t){try{await(0,f.x0)(this.hass.connection,"home",t),this._config=t||{}}catch(e){return console.error("Failed to save home configuration:",e),void(0,y.P)(this,{message:this.hass.localize("ui.panel.home.editor.save_failed"),duration:0,dismissable:!0})}(0,y.P)(this,{message:this.hass.localize("ui.common.successfully_saved")}),this._setLovelace()}constructor(...t){super(...t),this.narrow=!1,this._config={},this._bannerHeight=new a.P(this,{target:null,callback:t=>{var e,i;return null!==(e=null===(i=t[0])||void 0===i||null===(i=i.target)||void 0===i?void 0:i.offsetHeight)&&void 0!==e?e:0}}),this._debounceRegistriesChanged=(0,d.s)(()=>this._registriesChanged(),200),this._registriesChanged=async()=>{var t;const e=null===(t=this.route)||void 0===t||null===(t=t.path)||void 0===t?void 0:t.split("/")[1];if(null!=e&&e.startsWith("areas-")){const t=e.replace("areas-","");if(!this.hass.areas[t])return void(0,h.oo)("/home")}this._setLovelace()},this._editHome=()=>{(0,x.X)(this,{config:this._config,saveConfig:async t=>{await this._saveConfig(t)}})},this._editArea=async()=>{var t;const e=null===(t=this.route)||void 0===t||null===(t=t.path)||void 0===t?void 0:t.split("/")[1];if(null==e||!e.startsWith("areas-"))return;const i=e.replace("areas-",""),o=this.hass.areas[i];o&&(await this.hass.loadFragmentTranslation("config"),(0,b.J)(this,{entry:o,updateEntry:t=>(0,g.gs)(this.hass,i,t)}))},this._handleLLCustomEvent=t=>{const e=t.detail;if(e.home_panel){const{type:t}=e.home_panel;switch(t){case"assign_area":{const{device_id:t}=e.home_panel;this._showAssignAreaDialog(t);break}case"add_integration":this._showAddIntegrationDialog()}}}}}I.styles=(0,n.AH)(Z||(Z=N`:host{display:block}.banner{display:flex;align-items:center;flex-wrap:wrap;padding:var(--ha-space-2) var(--ha-space-4);background-color:var(--primary-color);color:var(--text-primary-color);gap:var(--ha-space-2);position:fixed;top:var(--header-height,56px);left:var(--ha-sidebar-width,0px);right:0;z-index:5}.banner-content{display:flex;align-items:center;gap:var(--ha-space-2);flex:1;min-width:200px}.banner ha-svg-icon{--mdc-icon-size:24px;flex-shrink:0}.banner-text{font-size:14px;font-weight:500}.banner-actions{display:flex;flex:none;gap:var(--ha-space-2);align-items:center;margin-inline-start:auto}.banner-actions ha-button::part(base){text-wrap:nowrap}`)),(0,s.Cg)([(0,r.MZ)({attribute:!1})],I.prototype,"hass",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],I.prototype,"narrow",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],I.prototype,"route",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],I.prototype,"panel",void 0),(0,s.Cg)([(0,r.wk)()],I.prototype,"_lovelace",void 0),(0,s.Cg)([(0,r.wk)()],I.prototype,"_config",void 0),(0,s.Cg)([(0,r.wk)()],I.prototype,"_extraActionItems",void 0),(0,s.Cg)([(0,r.P)(".banner")],I.prototype,"_banner",void 0),I=(0,s.Cg)([(0,r.EM)("ha-panel-home")],I),o()}catch(H){o(H)}})}}]);