UNPKG

iobroker.lovelace

Version:

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

4 lines 33.7 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[13132],{19459:function(e,t,i){i.d(t,{b:function(){return a}});i(45367),i(92731),i(84864),i(57465),i(27495),i(69479),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);const a=(e,t,i)=>{if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;let r,n;if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!a(e[r],t[r],i))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;for(r of e.entries())if(!a(r[1],t.get(r[0]),i))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(r of e.entries())if(!t.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const o=Object.keys(e);if(n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!Object.prototype.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(!a(e[n],t[n],i))return!1}if(null!=i&&i.compareSymbols){const r=Object.getOwnPropertySymbols(e),n=Object.getOwnPropertySymbols(t);if(r.length!==n.length)return!1;for(const o of r){if(!Object.prototype.hasOwnProperty.call(t,o))return!1;if(!a(e[o],t[o],i))return!1}}return!0}return e!=e&&t!=t}},87710:function(e,t,i){i.d(t,{$:function(){return a},N:function(){return r}});i(18111),i(22489),i(13579);const a=e=>e.some(e=>"rejected"===e.status),r=e=>e.filter(e=>"rejected"===e.status)},86171:function(e,t,i){i.a(e,async function(e,t){try{i(89463),i(26910),i(18111),i(61701),i(3362),i(62953);var a=i(40445),r=i(5124),n=i(67576),o=i(75751),s=i(88696),l=i(1087),d=i(57237),h=i(52220),c=(i(5745),i(29823)),p=(i(70947),i(47680),i(23430)),u=e([c,p,s]);[c,p,s]=u.then?(await u)():u;let v,g,f,m,b,y,x,_=e=>e;class w extends r.WF{willUpdate(e){e.has("labels")&&(this._sortedLabels=[...this.labels].sort((e,t)=>(0,h.xL)(e.name,t.name)))}render(){const e=this._sortedLabels,t=e.slice(0,this._visibleCount),i=e.length-this._visibleCount;return(0,r.qy)(v||(v=_` <div class="viewport"> <ha-chip-set> ${0} ${0} </ha-chip-set> </div> <div class="measure" aria-hidden="true"> <ha-chip-set> ${0} <div class="measure-chip" data-plus> <ha-label class="plus" dense>+99</ha-label> </div> </ha-chip-set> </div> `),(0,o.u)(t,e=>e.label_id,e=>this._renderLabel(e,!0)),i>0?(0,r.qy)(g||(g=_` <ha-dropdown role="button" tabindex="0" @click="${0}" @wa-select="${0}"> <ha-label slot="trigger" class="plus" dense> +${0} </ha-label> ${0} </ha-dropdown> `),d.d,this._handleDropdownSelect,i,(0,o.u)(e.slice(this._visibleCount),e=>e.label_id,e=>(0,r.qy)(f||(f=_` <ha-dropdown-item .value="${0}" .item="${0}"> ${0} </ha-dropdown-item> `),e.label_id,e,this._renderLabel(e,!1)))):r.s6,(0,o.u)(e,e=>e.label_id,e=>(0,r.qy)(m||(m=_` <div class="measure-chip" data-chip> ${0} </div> `),this._renderLabel(e,!1))))}async firstUpdated(){var e,t;await this.updateComplete,this._viewport&&this._resizeController.observe(this._viewport),await this._measureWidths(),this._recomputeVisibleCount(null!==(e=null===(t=this._viewport)||void 0===t?void 0:t.clientWidth)&&void 0!==e?e:0)}async updated(e){var t,i;e.has("labels")&&(await this.updateComplete,await this._measureWidths(),this._recomputeVisibleCount(null!==(t=null===(i=this._viewport)||void 0===i?void 0:i.clientWidth)&&void 0!==t?t:0))}async _measureWidths(){var e;await this.updateComplete;const t=this._measure;if(!t)return;const i=t.querySelector("ha-chip-set");if(i){const e=getComputedStyle(i),t=e.columnGap||e.gap;this._gap=t?parseFloat(t):0}const a=Array.from(t.querySelectorAll("[data-chip]")),r=t.querySelector("[data-plus]");this._chipWidths=a.map(e=>e.offsetWidth),this._plusWidth=null!==(e=null==r?void 0:r.offsetWidth)&&void 0!==e?e:0}_recomputeVisibleCount(e){var t;if(!e||null===(t=this.labels)||void 0===t||!t.length)return void(this._visibleCount=0);const i=this._sortedLabels.length;let a=0,r=0;for(let o=0;o<i;o++){var n;const t=null!==(n=this._chipWidths[o])&&void 0!==n?n:0,s=0===r?t:a+this._gap+t;if(!(s+(i-(o+1)>0?this._gap+this._plusWidth:0)<=e))break;a=s,r++}this._visibleCount=r}_renderLabel(e,t){return(0,r.qy)(b||(b=_` <ha-label dense role="button" tabindex="0" .color="${0}" .item="${0}" @click="${0}" @keydown="${0}" .description="${0}"> ${0} ${0} </ha-label> `),e.color,e,t?this._labelClicked:void 0,t?this._labelClicked:void 0,e.description,null!=e&&e.icon?(0,r.qy)(y||(y=_`<ha-icon slot="icon" .icon="${0}"></ha-icon>`),e.icon):r.s6,e.name)}_labelClicked(e){if(e.stopPropagation(),"keydown"===e.type&&"Enter"!==e.key&&" "!==e.key)return;const t=e.currentTarget.item;(0,l.r)(this,"label-clicked",{label:t})}_handleDropdownSelect(e){var t;const i=null===(t=e.detail)||void 0===t||null===(t=t.item)||void 0===t?void 0:t.item;i&&(0,l.r)(this,"label-clicked",{label:i})}constructor(...e){super(...e),this._visibleCount=0,this._sortedLabels=[],this._chipWidths=[],this._plusWidth=0,this._gap=8,this._resizeController=new s.P(this,{target:null,skipInitial:!0,callback:e=>{var t;const i=e[0],a=null!==(t=null==i?void 0:i.contentRect.width)&&void 0!==t?t:0;return this._recomputeVisibleCount(a),a}})}}w.styles=(0,r.AH)(x||(x=_`:host{display:block;flex-grow:1;min-width:0;margin-top:4px;height:22px;position:relative}.viewport{min-width:0;width:100%;overflow:hidden}ha-chip-set{display:flex;flex-wrap:nowrap;align-items:center;overflow:hidden;min-width:0}.measure{position:absolute;inset:0 auto auto 0;visibility:hidden;pointer-events:none;white-space:nowrap}.measure ha-chip-set{width:max-content;overflow:visible}.measure-chip{display:inline-flex}.plus{--ha-label-background-color:transparent;border:1px solid var(--divider-color)}`)),(0,a.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"labels",void 0),(0,a.Cg)([(0,n.wk)()],w.prototype,"_visibleCount",void 0),(0,a.Cg)([(0,n.P)(".viewport")],w.prototype,"_viewport",void 0),(0,a.Cg)([(0,n.P)(".measure")],w.prototype,"_measure",void 0),w=(0,a.Cg)([(0,n.EM)("ha-data-table-labels")],w),t()}catch(v){t(v)}})},70947:function(e,t,i){i(62953);var a=i(40445),r=i(50759),n=(i(38625),i(5124)),o=i(67576);i(67094);let s,l,d=e=>e;class h extends r.A{renderCheckboxIcon(){return(0,n.qy)(s||(s=d` <ha-svg-icon id="check" part="checkmark" .path="${0}"></ha-svg-icon> `),this.checked?"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z")}static get styles(){return[r.A.styles,(0,n.AH)(l||(l=d`:host{min-height:var(--ha-space-10)}#check{visibility:visible;flex-shrink:0}#icon ::slotted(*){color:var(--ha-color-on-neutral-normal)}:host([variant=danger]) #icon ::slotted(*){color:var(--ha-color-on-danger-quiet)}:host([selected]){font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}:host([selected]:hover){background-color:var(--ha-color-fill-primary-quiet-hover)}`))]}constructor(...e){super(...e),this.selected=!1}}(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],h.prototype,"selected",void 0),h=(0,a.Cg)([(0,o.EM)("ha-dropdown-item")],h)},29823:function(e,t,i){i.a(e,async function(e,t){try{i(3362),i(62953);var a=i(40445),r=i(52254),n=i(5124),o=i(67576),s=e([r]);r=(s.then?(await s)():s)[0];let l,d=e=>e;class h extends r.A{get anchorElement(){var e;return null===(e=this.popup)||void 0===e?void 0:e.anchor}set anchorElement(e){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=e)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const e=this.getTrigger();e&&"ha-icon-button"===e.localName&&(e.selected=!0)}async hideMenu(){const e=this.getTrigger();e&&"ha-icon-button"===e.localName&&(e.selected=!1),await super.hideMenu()}static get styles(){return[r.A.styles,(0,n.AH)(l||(l=d`:host{font-size:var(--ha-dropdown-font-size, var(--ha-font-size-m));--wa-color-surface-raised:var( --card-background-color, var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)), )}#menu{padding:var(--ha-space-1)}wa-popup::part(popup){z-index:200}`))]}constructor(...e){super(...e),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],h.prototype,"dropdownTag",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],h.prototype,"dropdownItemTag",void 0),h=(0,a.Cg)([(0,o.EM)("ha-dropdown")],h),t()}catch(l){t(l)}})},52190:function(e,t,i){i.a(e,async function(e,t){try{i(74423),i(44114),i(26910),i(18111),i(22489),i(7588),i(3362),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var a=i(40445),r=i(5124),n=i(67576),o=i(22786),s=i(1087),l=i(37981),d=i(52220),h=i(19459),c=i(71606),p=i(14503),u=i(85614),v=(i(30716),i(11382),i(8630),i(36866)),g=e([v]);v=(g.then?(await g)():g)[0];let f,m,b,y,x,_=e=>e;const w="M21 8H3V6H21V8M13.81 16H10V18H13.09C13.21 17.28 13.46 16.61 13.81 16M18 11H6V13H18V11M21.12 15.46L19 17.59L16.88 15.46L15.47 16.88L17.59 19L15.47 21.12L16.88 22.54L19 20.41L21.12 22.54L22.54 21.12L20.41 19L22.54 16.88L21.12 15.46Z";class C extends r.WF{willUpdate(e){super.willUpdate(e),this.hasUpdated||(0,u.i)(),e.has("value")&&!(0,h.b)(this.value,e.get("value"))&&this._findRelated()}render(){var e,t;return(0,r.qy)(f||(f=_` <ha-expansion-panel left-chevron .expanded="${0}" @expanded-will-change="${0}" @expanded-changed="${0}"> <div slot="header" class="header"> ${0} ${0} </div> ${0} </ha-expansion-panel> `),this.expanded,this._expandedWillChange,this._expandedChanged,this.hass.localize("ui.panel.config.devices.caption"),null!==(e=this.value)&&void 0!==e&&e.length?(0,r.qy)(m||(m=_`<div class="badge">${0}</div> <ha-icon-button .path="${0}" @click="${0}"></ha-icon-button>`),null===(t=this.value)||void 0===t?void 0:t.length,w,this._clearFilter):r.s6,this._shouldRender?(0,r.qy)(b||(b=_`<ha-input-search appearance="outlined" .value="${0}" @input="${0}"> </ha-input-search> <ha-list class="ha-scrollbar" multi> <lit-virtualizer .items="${0}" .keyFunction="${0}" .renderItem="${0}" @click="${0}" @keydown="${0}"> </lit-virtualizer> </ha-list>`),this._filter,this._handleSearchChange,this._devices(this.hass.devices,this._filter||"",this.value),this._keyFunction,this._renderItem,this._handleItemClick,this._handleItemKeydown):r.s6)}_handleItemKeydown(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this._handleItemClick(e))}_handleItemClick(e){var t,i;const a=e.target.closest("ha-check-list-item"),r=null==a?void 0:a.value;if(r){var n;if(null!==(t=this.value)&&void 0!==t&&t.includes(r))this.value=null===(n=this.value)||void 0===n?void 0:n.filter(e=>e!==r);else this.value=[...this.value||[],r];a.selected=null===(i=this.value)||void 0===i?void 0:i.includes(r)}}updated(e){e.has("expanded")&&this.expanded&&setTimeout(()=>{this.expanded&&(this._list.style.height=this.clientHeight-49-4-32+"px")},300)}_expandedWillChange(e){this._shouldRender=e.detail.expanded}_expandedChanged(e){this.expanded=e.detail.expanded}_handleSearchChange(e){var t;const i=e.target;this._filter=(null!==(t=i.value)&&void 0!==t?t:"").toLowerCase()}async _findRelated(){var e;const t=[];if(null===(e=this.value)||void 0===e||!e.length)return this.value=[],void(0,s.r)(this,"data-table-filter-changed",{value:[],items:void 0});const i=[];for(const n of this.value)i.push(n),this.type&&t.push((0,c.f)(this.hass,"device",n));const a=await Promise.all(t),r=new Set;for(const n of a)n[this.type]&&n[this.type].forEach(e=>r.add(e));(0,s.r)(this,"data-table-filter-changed",{value:i,items:this.type?r:void 0})}_clearFilter(e){e.preventDefault(),this.value=void 0,(0,s.r)(this,"data-table-filter-changed",{value:void 0,items:void 0})}static get styles(){return[p.dp,(0,r.AH)(y||(y=_`:host{border-bottom:1px solid var(--divider-color)}:host([expanded]){flex:1;height:0}ha-expansion-panel{--ha-card-border-radius:var(--ha-border-radius-square);--expansion-panel-content-padding:0}.header{display:flex;align-items:center}.header ha-icon-button{margin-inline-start:auto;margin-inline-end:8px}.badge{display:inline-block;margin-left:8px;margin-inline-start:8px;margin-inline-end:0;min-width:16px;box-sizing:border-box;border-radius:var(--ha-border-radius-circle);font-size:var(--ha-font-size-xs);font-weight:var(--ha-font-weight-normal);background-color:var(--primary-color);line-height:var(--ha-line-height-normal);text-align:center;padding:0px 2px;color:var(--text-primary-color)}ha-check-list-item{width:100%}ha-input-search{display:block;padding:var(--ha-space-1) var(--ha-space-2) 0}`))]}constructor(...e){super(...e),this.expanded=!1,this.narrow=!1,this._shouldRender=!1,this._keyFunction=e=>null==e?void 0:e.id,this._renderItem=e=>{var t,i;return e?(0,r.qy)(x||(x=_`<ha-check-list-item tabindex="0" .value="${0}" .selected="${0}"> ${0} </ha-check-list-item>`),e.id,null!==(t=null===(i=this.value)||void 0===i?void 0:i.includes(e.id))&&void 0!==t&&t,(0,l.T)(e,this.hass.localize,this.hass.states)):r.s6},this._devices=(0,o.A)((e,t,i)=>Object.values(e).filter(e=>!t||(0,l.T)(e,this.hass.localize,this.hass.states).toLowerCase().includes(t)).sort((e,t)=>(0,d.xL)((0,l.T)(e,this.hass.localize,this.hass.states),(0,l.T)(t,this.hass.localize,this.hass.states),this.hass.locale.language)))}}(0,a.Cg)([(0,n.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],C.prototype,"value",void 0),(0,a.Cg)([(0,n.MZ)()],C.prototype,"type",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],C.prototype,"expanded",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],C.prototype,"narrow",void 0),(0,a.Cg)([(0,n.wk)()],C.prototype,"_shouldRender",void 0),(0,a.Cg)([(0,n.wk)()],C.prototype,"_filter",void 0),(0,a.Cg)([(0,n.P)("ha-list")],C.prototype,"_list",void 0),C=(0,a.Cg)([(0,n.EM)("ha-filter-devices")],C),t()}catch(f){t(f)}})},72644:function(e,t,i){i.a(e,async function(e,t){try{i(74423),i(44114),i(18111),i(22489),i(7588),i(61701),i(3362),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var a=i(40445),r=i(5124),n=i(67576),o=i(6412),s=i(75751),l=i(22786),d=i(1087),h=i(15638),c=i(19459),p=i(32250),u=i(71606),v=i(14503),g=(i(11382),i(18198),i(47680),i(26300)),f=(i(67094),i(73150),i(86698),i(83492),e([g]));g=(f.then?(await f)():f)[0];let m,b,y,x,_,w,C,$,L,k=e=>e;const M="M21 8H3V6H21V8M13.81 16H10V18H13.09C13.21 17.28 13.46 16.61 13.81 16M18 11H6V13H18V11M21.12 15.46L19 17.59L16.88 15.46L15.47 16.88L17.59 19L15.47 21.12L16.88 22.54L19 20.41L21.12 22.54L22.54 21.12L20.41 19L22.54 16.88L21.12 15.46Z",H="M20 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V4C22 2.9 21.11 2 20 2M4 6L6 4H10.9L4 10.9V6M4 13.7L13.7 4H18.6L4 18.6V13.7M20 18L18 20H13.1L20 13.1V18M20 10.3L10.3 20H5.4L20 5.4V10.3Z";class q extends r.WF{willUpdate(e){super.willUpdate(e),e.has("value")&&!(0,c.b)(this.value,e.get("value"))&&this._findRelated()}render(){var e,t,i,a;const n=this._areas(this.hass.areas,this.hass.floors);return(0,r.qy)(m||(m=k` <ha-expansion-panel left-chevron .expanded="${0}" @expanded-will-change="${0}" @expanded-changed="${0}"> <div slot="header" class="header"> ${0} ${0} </div> ${0} </ha-expansion-panel> `),this.expanded,this._expandedWillChange,this._expandedChanged,this.hass.localize("ui.panel.config.areas.caption"),null!==(e=this.value)&&void 0!==e&&null!==(e=e.areas)&&void 0!==e&&e.length||null!==(t=this.value)&&void 0!==t&&null!==(t=t.floors)&&void 0!==t&&t.length?(0,r.qy)(b||(b=k`<div class="badge"> ${0} </div> <ha-icon-button .path="${0}" @click="${0}"></ha-icon-button>`),((null===(i=this.value)||void 0===i||null===(i=i.areas)||void 0===i?void 0:i.length)||0)+((null===(a=this.value)||void 0===a||null===(a=a.floors)||void 0===a?void 0:a.length)||0),M,this._clearFilter):r.s6,this._shouldRender?(0,r.qy)(y||(y=k` <ha-list-selectable class="ha-scrollbar" multi @ha-list-selected="${0}" aria-label="${0}"> ${0} ${0} </ha-list-selectable> `),this._handleListChanged,this.hass.localize("ui.panel.config.areas.caption"),(0,s.u)((null==n?void 0:n.floors)||[],e=>e.floor_id,e=>{var t;return(0,r.qy)(x||(x=k` <ha-list-item-option appearance="checkbox" selection-position="end" .value="${0}" .type="${0}" .selected="${0}"> <ha-floor-icon slot="start" .floor="${0}"></ha-floor-icon> <span slot="headline">${0} </span> </ha-list-item-option> ${0} `),e.floor_id,"floors",(null===(t=this.value)||void 0===t||null===(t=t.floors)||void 0===t?void 0:t.includes(e.floor_id))||!1,e,e.name,(0,s.u)(e.areas,(t,i)=>`${t.area_id}${i===e.areas.length-1?"___last":""}`,(t,i)=>this._renderArea(t,i===e.areas.length-1)))}),(0,s.u)(null==n?void 0:n.unassisgnedAreas,e=>e.area_id,e=>this._renderArea(e))):r.s6)}_renderArea(e,t=!1){var i;const a=!!e.floor_id;return(0,r.qy)(_||(_=k` <ha-list-item-option appearance="checkbox" selection-position="end" .value="${0}" .selected="${0}" .type="${0}" class="${0}"> ${0} ${0} <span slot="headline">${0}</span> </ha-list-item-option> `),e.area_id,(null===(i=this.value)||void 0===i||null===(i=i.areas)||void 0===i?void 0:i.includes(e.area_id))||!1,"areas",(0,o.H)({rtl:(0,h.qC)(this.hass.language,this.hass.translationMetadata.translations),floor:a}),a?(0,r.qy)(w||(w=k`<ha-tree-indicator slot="start" .end="${0}"></ha-tree-indicator>`),t):r.s6,e.icon?(0,r.qy)(C||(C=k`<ha-icon slot="start" .icon="${0}"></ha-icon>`),e.icon):(0,r.qy)($||($=k`<ha-svg-icon slot="start" .path="${0}"></ha-svg-icon>`),H),e.name)}_handleListChanged(e){var t,i,a;if(null!==(t=e.detail.diff)&&void 0!==t&&t.added.size||null!==(i=e.detail.diff)&&void 0!==i&&i.removed.size)if(null!==(a=e.detail.diff)&&void 0!==a&&a.added.size){const t=e.detail.diff.added.values().next().value;if(void 0===t)return;const i=e.currentTarget.items[t];this.value||(this.value={}),this.value=Object.assign(Object.assign({},this.value),{},{[i.type]:[...this.value[i.type]||[],i.value]})}else{var r;const t=null===(r=e.detail.diff)||void 0===r?void 0:r.removed.values().next().value;if(void 0===t)return;const i=e.currentTarget.items[t];this.value=Object.assign(Object.assign({},this.value),{},{[i.type]:this.value[i.type].filter(e=>e!==i.value)})}}updated(e){e.has("expanded")&&this.expanded&&setTimeout(()=>{this.expanded&&(this._list.style.height=this.clientHeight-49+"px")},300)}_expandedWillChange(e){this._shouldRender=e.detail.expanded}_expandedChanged(e){this.expanded=e.detail.expanded}async _findRelated(){var e,t;const i=[];if(!(this.value&&(null!==(e=this.value.areas)&&void 0!==e&&e.length||null!==(t=this.value.floors)&&void 0!==t&&t.length)))return this.value={},void(0,d.r)(this,"data-table-filter-changed",{value:{},items:void 0});if(this.value.areas)for(const n of this.value.areas)this.type&&i.push((0,u.f)(this.hass,"area",n));if(this.value.floors)for(const n of this.value.floors)this.type&&i.push((0,u.f)(this.hass,"floor",n));const a=await Promise.all(i),r=new Set;for(const n of a)n[this.type]&&n[this.type].forEach(e=>r.add(e));(0,d.r)(this,"data-table-filter-changed",{value:this.value,items:this.type?r:void 0})}_clearFilter(e){e.preventDefault(),this.value=void 0,(0,d.r)(this,"data-table-filter-changed",{value:void 0,items:void 0})}static get styles(){return[v.dp,(0,r.AH)(L||(L=k`:host{border-bottom:1px solid var(--divider-color)}:host([expanded]){flex:1;height:0}ha-expansion-panel{--ha-card-border-radius:var(--ha-border-radius-square);--expansion-panel-content-padding:0}.header{display:flex;align-items:center}.header ha-icon-button{margin-inline-start:auto;margin-inline-end:8px}.badge{display:inline-block;margin-left:8px;margin-inline-start:8px;margin-inline-end:0;min-width:16px;box-sizing:border-box;border-radius:var(--ha-border-radius-circle);font-size:var(--ha-font-size-xs);font-weight:var(--ha-font-weight-normal);background-color:var(--primary-color);line-height:var(--ha-line-height-normal);text-align:center;padding:0px 2px;color:var(--text-primary-color)}.floor::part(base){padding-inline-start:48px;padding-inline-end:16px}ha-tree-indicator{width:56px;position:absolute;top:0px;left:0px}.rtl ha-tree-indicator{right:0px;left:initial;transform:scaleX(-1)}.subdir{margin-inline-end:8px;opacity:.6}`))]}constructor(...e){super(...e),this.narrow=!1,this.expanded=!1,this._shouldRender=!1,this._areas=(0,l.A)((e,t)=>{const i=Object.values(e),a=Object.values(t),r=(0,p._o)(i),n=i.filter(e=>!e.floor_id||!r[e.floor_id]);return{floors:null==a?void 0:a.map(e=>Object.assign(Object.assign({},e),{},{areas:r[e.floor_id]||[]})),unassisgnedAreas:n}})}}(0,a.Cg)([(0,n.MZ)({attribute:!1})],q.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],q.prototype,"value",void 0),(0,a.Cg)([(0,n.MZ)()],q.prototype,"type",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],q.prototype,"narrow",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],q.prototype,"expanded",void 0),(0,a.Cg)([(0,n.wk)()],q.prototype,"_shouldRender",void 0),(0,a.Cg)([(0,n.P)("ha-list-selectable")],q.prototype,"_list",void 0),q=(0,a.Cg)([(0,n.EM)("ha-filter-floor-areas")],q),t()}catch(m){t(m)}})},138:function(e,t,i){i.a(e,async function(e,t){try{i(89463),i(74423),i(44114),i(26910),i(18111),i(22489),i(61701),i(3362),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var a=i(40445),r=i(35211),n=i(5124),o=i(67576),s=i(75751),l=i(22786),d=i(1087),h=i(91926),c=i(52220),p=i(22792),u=i(14503),v=(i(30716),i(11382),i(47680),i(26300)),g=i(23430),f=(i(8630),i(28732),i(36866)),m=e([v,g,f]);[v,g,f]=m.then?(await m)():m;let b,y,x,_,w,C,$,L=e=>e;const k="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",M="M21 8H3V6H21V8M13.81 16H10V18H13.09C13.21 17.28 13.46 16.61 13.81 16M18 11H6V13H18V11M21.12 15.46L19 17.59L16.88 15.46L15.47 16.88L17.59 19L15.47 21.12L16.88 22.54L19 20.41L21.12 22.54L22.54 21.12L20.41 19L22.54 16.88L21.12 15.46Z";class H extends n.WF{render(){var e,t;return(0,n.qy)(b||(b=L` <ha-expansion-panel left-chevron .expanded="${0}" @expanded-will-change="${0}" @expanded-changed="${0}"> <div slot="header" class="header"> ${0} ${0} </div> ${0} </ha-expansion-panel> ${0} `),this.expanded,this._expandedWillChange,this._expandedChanged,this.hass.localize("ui.panel.config.labels.caption"),null!==(e=this.value)&&void 0!==e&&e.length?(0,n.qy)(y||(y=L`<div class="badge">${0}</div> <ha-icon-button .path="${0}" @click="${0}"></ha-icon-button>`),null===(t=this.value)||void 0===t?void 0:t.length,M,this._clearFilter):n.s6,this._shouldRender?(0,n.qy)(x||(x=L`<ha-input-search appearance="outlined" .value="${0}" @input="${0}"> </ha-input-search> <ha-list @selected="${0}" class="ha-scrollbar" multi> ${0} </ha-list> `),this._filter,this._handleSearchChange,this._labelSelected,(0,s.u)(this._filteredLabels(this._labels||[],this._filter,this.value),e=>e.label_id,e=>(0,n.qy)(_||(_=L`<ha-check-list-item .value="${0}" .selected="${0}" hasMeta> <ha-label .color="${0}" .description="${0}"> ${0} ${0} </ha-label> </ha-check-list-item>`),e.label_id,(this.value||[]).includes(e.label_id),e.color,e.description,e.icon?(0,n.qy)(w||(w=L`<ha-icon slot="icon" .icon="${0}"></ha-icon>`),e.icon):n.s6,e.name))):n.s6,this.expanded?(0,n.qy)(C||(C=L`<ha-list-item graphic="icon" @click="${0}" class="add"> <ha-svg-icon slot="graphic" .path="${0}"></ha-svg-icon> ${0} </ha-list-item>`),this._manageLabels,k,this.hass.localize("ui.panel.config.labels.manage_labels")):n.s6)}updated(e){e.has("expanded")&&this.expanded&&setTimeout(()=>{this.expanded&&(this._list.style.height=this.clientHeight-133+"px")},300)}_manageLabels(){(0,h.oo)("/config/labels")}_expandedWillChange(e){this._shouldRender=e.detail.expanded}_expandedChanged(e){this.expanded=e.detail.expanded}_handleSearchChange(e){var t;const i=null!==(t=e.target.value)&&void 0!==t?t:"";this._filter=i.toLowerCase()}async _labelSelected(e){const t=this._filteredLabels(this._labels||[],this._filter,this.value),i=new Set(t.map(e=>e.label_id)),a=(this.value||[]).filter(e=>!i.has(e)),r=[];for(const s of e.detail.index){var n;const e=null===(n=t[s])||void 0===n?void 0:n.label_id;e&&r.push(e)}const o=[...a,...r];this.value=o.length?o:[],(0,d.r)(this,"data-table-filter-changed",{value:o.length?o:void 0,items:void 0})}_clearFilter(e){e.preventDefault(),this.value=void 0,(0,d.r)(this,"data-table-filter-changed",{value:void 0,items:void 0})}static get styles(){return[u.dp,(0,n.AH)($||($=L`:host{position:relative;border-bottom:1px solid var(--divider-color)}:host([expanded]){flex:1;height:0}ha-expansion-panel{--ha-card-border-radius:var(--ha-border-radius-square);--expansion-panel-content-padding:0}.header{display:flex;align-items:center}.header ha-icon-button{margin-inline-start:auto;margin-inline-end:8px}.badge{display:inline-block;margin-left:8px;margin-inline-start:8px;margin-inline-end:0;min-width:16px;box-sizing:border-box;border-radius:var(--ha-border-radius-circle);font-size:var(--ha-font-size-xs);font-weight:var(--ha-font-weight-normal);background-color:var(--primary-color);line-height:var(--ha-line-height-normal);text-align:center;padding:0px 2px;color:var(--text-primary-color)}.warning{color:var(--error-color)}.add{position:absolute;bottom:0;right:0;left:0}ha-input-search{display:block;padding:var(--ha-space-1) var(--ha-space-2) 0}`))]}constructor(...e){super(...e),this.narrow=!1,this.expanded=!1,this._shouldRender=!1,this._filteredLabels=(0,l.A)((e,t,i)=>e.filter(e=>!t||e.name.toLowerCase().includes(t)||e.label_id.toLowerCase().includes(t)).sort((e,t)=>(0,c.xL)(e.name||e.label_id,t.name||t.label_id,this.hass.locale.language)))}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],H.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],H.prototype,"value",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],H.prototype,"narrow",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],H.prototype,"expanded",void 0),(0,a.Cg)([(0,r.Fg)({context:p.HD,subscribe:!0}),(0,o.wk)()],H.prototype,"_labels",void 0),(0,a.Cg)([(0,o.wk)()],H.prototype,"_shouldRender",void 0),(0,a.Cg)([(0,o.wk)()],H.prototype,"_filter",void 0),(0,a.Cg)([(0,o.P)("ha-list")],H.prototype,"_list",void 0),H=(0,a.Cg)([(0,o.EM)("ha-filter-labels")],H),t()}catch(b){t(b)}})},23430:function(e,t,i){i.a(e,async function(e,a){try{i.d(t,{l:function(){return g}});i(89463),i(42762),i(62953);var r=i(40445),n=i(5124),o=i(67576),s=i(78870),l=i(79622),d=i(86836),h=i(34127),c=e([h]);h=(c.then?(await c)():c)[0];let p,u,v=e=>e;const g=e=>{const t=e?(0,s.MP)(e):void 0;return t?`--ha-label-background-color: ${t};\n --primary-text-color: ${(0,l.gJ)(e)};`:"--ha-label-background-color: rgba(var(--rgb-primary-text-color), 0.15);"};class f extends n.WF{willUpdate(e){super.willUpdate(e),e.has("color")&&(this.style.cssText=g(this.color))}render(){var e;return(0,n.qy)(p||(p=v` <ha-tooltip .for="${0}" .disabled="${0}"> ${0} </ha-tooltip> <div class="container" .id="${0}"> <span class="content"> <slot name="icon"></slot> <slot></slot> </span> </div> `),this._elementId,!(null!==(e=this.description)&&void 0!==e&&e.trim()),this.description,this._elementId)}static get styles(){return[(0,n.AH)(u||(u=v`:host{--ha-label-text-color:var(--primary-text-color);--ha-label-icon-color:var(--primary-text-color);--ha-label-background-opacity:1;border:1px solid var(--outline-color);position:relative;box-sizing:border-box;display:inline-flex;flex-direction:row;align-items:center;font-size:var(--ha-font-size-s);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-condensed);letter-spacing:.1px;height:32px;border-radius:var(--ha-border-radius-xl);color:var(--ha-label-text-color);--mdc-icon-size:12px;text-wrap:nowrap}.content>*{position:relative;display:inline-flex;flex-direction:row;align-items:center}:host:before{position:absolute;content:"";inset:0;border-radius:inherit;background-color:var(--ha-label-background-color);opacity:var(--ha-label-background-opacity)}::slotted([slot=icon]){margin-right:8px;margin-left:-8px;margin-inline-start:-8px;margin-inline-end:8px;display:flex}.container{display:flex;align-items:center;position:relative;height:100%;padding:0 16px}span{display:inline-flex}:host([dense]){height:20px;border-radius:var(--ha-border-radius-md)}:host([dense]) .container{padding:0 12px}:host([dense]) ::slotted([slot=icon]){margin-right:4px;margin-left:-4px;margin-inline-start:-4px;margin-inline-end:4px}`))]}constructor(...e){super(...e),this.dense=!1,this._elementId="label-"+(0,d.L)()}}(0,r.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],f.prototype,"dense",void 0),(0,r.Cg)([(0,o.MZ)()],f.prototype,"color",void 0),(0,r.Cg)([(0,o.MZ)({attribute:"description"})],f.prototype,"description",void 0),f=(0,r.Cg)([(0,o.EM)("ha-label")],f),a()}catch(p){a(p)}})},28732:function(e,t,i){var a=i(40445),r=i(27686),n=i(7731),o=i(5124),s=i(67576);let l,d,h,c=e=>e;class p extends r.J{renderRipple(){return this.noninteractive?"":super.renderRipple()}static get styles(){return[n.R,(0,o.AH)(l||(l=c`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`)),"rtl"===document.dir?(0,o.AH)(d||(d=c`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`)):(0,o.AH)(h||(h=c``))]}}p=(0,a.Cg)([(0,s.EM)("ha-list-item")],p)},73150:function(e,t,i){i(62953);var a=i(40445),r=i(5124),n=i(67576);let o,s,l=e=>e;class d extends r.WF{render(){return(0,r.qy)(o||(o=l` <svg width="100%" height="100%" viewBox="0 0 48 48"> <line x1="24" y1="0" x2="24" y2="${0}"></line> <line x1="24" y1="24" x2="36" y2="24"></line> </svg> `),this.end?"24":"48")}constructor(...e){super(...e),this.end=!1}}d.styles=(0,r.AH)(s||(s=l`:host{display:block;width:48px;height:48px}line{stroke:var(--divider-color);stroke-width:2;stroke-dasharray:2}`)),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],d.prototype,"end",void 0),d=(0,a.Cg)([(0,n.EM)("ha-tree-indicator")],d)},32250:function(e,t,i){i.d(t,{KD:function(){return a},NL:function(){return r},Rj:function(){return o},_o:function(){return s},ls:function(){return n}});i(44114),i(62953),i(29908);const a=(e,t)=>e.callWS(Object.assign({type:"config/floor_registry/create"},t)),r=(e,t,i)=>e.callWS(Object.assign({type:"config/floor_registry/update",floor_id:t},i)),n=(e,t)=>e.callWS({type:"config/floor_registry/delete",floor_id:t}),o=(e,t)=>e.callWS({type:"config/floor_registry/reorder",floor_ids:t}),s=e=>{const t={};for(const i of e)i.floor_id&&(i.floor_id in t||(t[i.floor_id]=[]),t[i.floor_id].push(i));return t}},71606:function(e,t,i){i.d(t,{f:function(){return r},o:function(){return a}});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);const a=new Set(["automation","script","scene","group"]),r=(e,t,i)=>e.callWS({type:"search/related",item_type:t,item_id:i})},69569:function(e,t,i){i.d(t,{f:function(){return n}});i(3362),i(62953);var a=i(1087);const r=()=>Promise.all([i.e(92769),i.e(3283),i.e(37941),i.e(26092),i.e(39005),i.e(13231)]).then(i.bind(i,427)),n=(e,t)=>{(0,a.r)(e,"show-dialog",{dialogTag:"dialog-label-detail",dialogImport:r,dialogParams:t})}}}]);