iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
10 lines • 52.7 kB
JavaScript
export const __webpack_ids__=["37133"];export const __webpack_modules__={84200:function(e,t,i){i.d(t,{r:()=>o});i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814);const a=(e,t,i=true)=>{if(!e||e===document.body)return null;if((e=e.assignedSlot??e).parentElement)e=e.parentElement;else{const t=e.getRootNode();e=t instanceof ShadowRoot?t.host:null}return(i?Object.prototype.hasOwnProperty.call(e,t):e&&t in e)?e:a(e,t,i)},o=(e,t,i=true)=>{const o=new Set;for(;e;)o.add(e),e=a(e,t,i);return o}},81165:function(e,t,i){i.d(t,{j:()=>a});const a=(e=document)=>e.activeElement?.shadowRoot?.activeElement?a(e.activeElement.shadowRoot):e.activeElement},45061:function(e,t,i){i.d(t,{K:()=>a});const a=e=>{switch(e.language){case"cs":case"de":case"fi":case"fr":case"sk":case"sv":return" ";default:return""}}},76320:function(e,t,i){i.d(t,{T:()=>a,y:()=>o});const a=e=>{requestAnimationFrame((()=>setTimeout(e,0)))},o=()=>new Promise((e=>{a(e)}))},74666:function(e,t,i){var a=i(44249),o=i(74763),n=i(15093);(0,a.Z)([(0,n.Mo)("ha-chip-set")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[]}}),o.l)},18756:function(e,t,i){var a=i(44249),o=i(72621),n=i(74514),r=i(57243),l=i(15093);(0,a.Z)([(0,l.Mo)("ha-input-chip")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",static:!0,key:"styles",value(){return[...(0,o.Z)(i,"styles",this),r.iv`:host{--md-sys-color-primary:var(--primary-text-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--primary-text-color);--md-sys-color-on-secondary-container:var(--primary-text-color);--md-input-chip-container-shape:16px;--md-input-chip-outline-color:var(--outline-color);--md-input-chip-selected-container-color:rgba(
var(--rgb-primary-text-color),
0.15
);--ha-input-chip-selected-container-opacity:1;--md-input-chip-label-text-font:Roboto,sans-serif}::slotted([slot=icon]){display:flex;--mdc-icon-size:var(--md-input-chip-icon-size, 18px)}.selected::before{opacity:var(--ha-input-chip-selected-container-opacity)}`]}}]}}),n.W)},91665:function(e,t,i){var a=i(44249),o=i(57243),n=i(15093),r=i(36522);i(78860);(0,a.Z)([(0,n.Mo)("ha-aliases-editor")],(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)({type:Array})],key:"aliases",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"method",key:"render",value:function(){return this.aliases?o.dy` <ha-multi-textfield .hass="${this.hass}" .value="${this.aliases}" .disabled="${this.disabled}" .label="${this.hass.localize("ui.dialogs.aliases.label")}" .removeLabel="${this.hass.localize("ui.dialogs.aliases.remove")}" .addLabel="${this.hass.localize("ui.dialogs.aliases.add")}" item-index @value-changed="${this._aliasesChanged}"> </ha-multi-textfield> `:o.Ld}},{kind:"method",key:"_aliasesChanged",value:function(e){(0,r.B)(this,"value-changed",{value:e})}}]}}),o.oi)},81282:function(e,t,i){var a=i(44249),o=(i(9359),i(68107),i(56475),i(70104),i(52924),i(57243)),n=i(15093),r=i(35359),l=i(27486),d=i(36522),s=i(73850),c=i(24360),h=i(82100),u=i(46329),p=i(76131),v=i(61107);i(94279),i(23334),i(7285),i(37583);const f=e=>o.dy`<ha-list-item graphic="icon" class="${(0,r.$)({"add-new":e.area_id===m})}"> ${e.icon?o.dy`<ha-icon slot="graphic" .icon="${e.icon}"></ha-icon>`:o.dy`<ha-svg-icon slot="graphic" .path="${"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"}"></ha-svg-icon>`} ${e.name} </ha-list-item>`,m="___ADD_NEW___",g="___NO_ITEMS___",y="___ADD_NEW_SUGGESTION___";(0,a.Z)([(0,n.Mo)("ha-area-picker")],(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)()],key:"label",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"placeholder",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"no-add"})],key:"noAdd",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Array,attribute:"include-domains"})],key:"includeDomains",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Array,attribute:"exclude-domains"})],key:"excludeDomains",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Array,attribute:"include-device-classes"})],key:"includeDeviceClasses",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Array,attribute:"exclude-areas"})],key:"excludeAreas",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"deviceFilter",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"entityFilter",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[(0,n.SB)()],key:"_opened",value:void 0},{kind:"field",decorators:[(0,n.IO)("ha-combo-box",!0)],key:"comboBox",value:void 0},{kind:"field",key:"_suggestion",value:void 0},{kind:"field",key:"_init",value:()=>!1},{kind:"method",key:"open",value:async function(){await this.updateComplete,await(this.comboBox?.open())}},{kind:"method",key:"focus",value:async function(){await this.updateComplete,await(this.comboBox?.focus())}},{kind:"field",key:"_getAreas",value(){return(0,l.Z)(((e,t,i,a,o,n,r,l,d,c)=>{let h,p,v={};(a||o||n||r||l)&&(v=(0,u.R6)(i),h=t,p=i.filter((e=>e.area_id)),a&&(h=h.filter((e=>{const t=v[e.id];return!(!t||!t.length)&&v[e.id].some((e=>a.includes((0,s.M)(e.entity_id))))})),p=p.filter((e=>a.includes((0,s.M)(e.entity_id))))),o&&(h=h.filter((e=>{const t=v[e.id];return!t||!t.length||i.every((e=>!o.includes((0,s.M)(e.entity_id))))})),p=p.filter((e=>!o.includes((0,s.M)(e.entity_id))))),n&&(h=h.filter((e=>{const t=v[e.id];return!(!t||!t.length)&&v[e.id].some((e=>{const t=this.hass.states[e.entity_id];return!!t&&(t.attributes.device_class&&n.includes(t.attributes.device_class))}))})),p=p.filter((e=>{const t=this.hass.states[e.entity_id];return t.attributes.device_class&&n.includes(t.attributes.device_class)}))),r&&(h=h.filter((e=>r(e)))),l&&(h=h.filter((e=>{const t=v[e.id];return!(!t||!t.length)&&v[e.id].some((e=>{const t=this.hass.states[e.entity_id];return!!t&&l(t)}))})),p=p.filter((e=>{const t=this.hass.states[e.entity_id];return!!t&&l(t)}))));let f,y=e;return h&&(f=h.filter((e=>e.area_id)).map((e=>e.area_id))),p&&(f=(f??[]).concat(p.filter((e=>e.area_id)).map((e=>e.area_id)))),f&&(y=y.filter((e=>f.includes(e.area_id)))),c&&(y=y.filter((e=>!c.includes(e.area_id)))),y.length||(y=[{area_id:g,floor_id:null,name:this.hass.localize("ui.components.area-picker.no_areas"),picture:null,icon:null,aliases:[],labels:[],temperature_entity_id:null,humidity_entity_id:null,created_at:0,modified_at:0}]),d?y:[...y,{area_id:m,floor_id:null,name:this.hass.localize("ui.components.area-picker.add_new"),picture:null,icon:"mdi:plus",aliases:[],labels:[],temperature_entity_id:null,humidity_entity_id:null,created_at:0,modified_at:0}]}))}},{kind:"method",key:"updated",value:function(e){if(!this._init&&this.hass||this._init&&e.has("_opened")&&this._opened){this._init=!0;const e=this._getAreas(Object.values(this.hass.areas),Object.values(this.hass.devices),Object.values(this.hass.entities),this.includeDomains,this.excludeDomains,this.includeDeviceClasses,this.deviceFilter,this.entityFilter,this.noAdd,this.excludeAreas).map((e=>({...e,strings:[e.area_id,...e.aliases,e.name]})));this.comboBox.items=e,this.comboBox.filteredItems=e}}},{kind:"method",key:"render",value:function(){return o.dy` <ha-combo-box .hass="${this.hass}" .helper="${this.helper}" item-value-path="area_id" item-id-path="area_id" item-label-path="name" .value="${this._value}" .disabled="${this.disabled}" .required="${this.required}" .label="${void 0===this.label&&this.hass?this.hass.localize("ui.components.area-picker.area"):this.label}" .placeholder="${this.placeholder?this.hass.areas[this.placeholder]?.name:void 0}" .renderer="${f}" @filter-changed="${this._filterChanged}" @opened-changed="${this._openedChanged}" @value-changed="${this._areaChanged}"> </ha-combo-box> `}},{kind:"method",key:"_filterChanged",value:function(e){const t=e.target,i=e.detail.value;if(!i)return void(this.comboBox.filteredItems=this.comboBox.items);const a=(0,c.q)(i,t.items?.filter((e=>![g,m].includes(e.label_id)))||[]);0===a.length?this.noAdd?(this._suggestion=i,this.comboBox.filteredItems=[{area_id:y,floor_id:null,name:this.hass.localize("ui.components.area-picker.add_new_sugestion",{name:this._suggestion}),icon:"mdi:plus",picture:null,labels:[],aliases:[],temperature_entity_id:null,humidity_entity_id:null,created_at:0,modified_at:0}]):this.comboBox.filteredItems=[{area_id:g,floor_id:null,name:this.hass.localize("ui.components.area-picker.no_match"),icon:null,picture:null,labels:[],aliases:[],temperature_entity_id:null,humidity_entity_id:null,created_at:0,modified_at:0}]:this.comboBox.filteredItems=a}},{kind:"get",key:"_value",value:function(){return this.value||""}},{kind:"method",key:"_openedChanged",value:function(e){this._opened=e.detail.value}},{kind:"method",key:"_areaChanged",value:function(e){e.stopPropagation();let t=e.detail.value;if(t===g)return t="",void this.comboBox.setInputValue("");[y,m].includes(t)?(e.target.value=this._value,this.hass.loadFragmentTranslation("config"),(0,v.E)(this,{suggestedName:t===y?this._suggestion:"",createEntry:async e=>{try{const t=await(0,h.Lo)(this.hass,e),i=[...Object.values(this.hass.areas),t];this.comboBox.filteredItems=this._getAreas(i,Object.values(this.hass.devices),Object.values(this.hass.entities),this.includeDomains,this.excludeDomains,this.includeDeviceClasses,this.deviceFilter,this.entityFilter,this.noAdd,this.excludeAreas),await this.updateComplete,await this.comboBox.updateComplete,this._setValue(t.area_id)}catch(e){(0,p.showAlertDialog)(this,{title:this.hass.localize("ui.components.area-picker.failed_create_area"),text:e.message})}}}),this._suggestion=void 0,this.comboBox.setInputValue("")):t!==this._value&&this._setValue(t)}},{kind:"method",key:"_setValue",value:function(e){this.value=e,setTimeout((()=>{(0,d.B)(this,"value-changed",{value:e}),(0,d.B)(this,"change")}),0)}}]}}),o.oi)},59826:function(e,t,i){var a=i(44249),o=i(31622),n=i(57243),r=i(15093),l=i(22344);(0,a.Z)([(0,r.Mo)("ha-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[l.W,n.iv`::slotted([slot=icon]){margin-inline-start:0px;margin-inline-end:8px;direction:var(--direction);display:block}.mdc-button{height:var(--button-height,36px)}.trailing-icon{display:flex}.slot-container{overflow:var(--button-slot-container-overflow,visible)}:host([destructive]){--mdc-theme-primary:var(--error-color)}`]}]}}),o.Button)},94279:function(e,t,i){var a=i(44249),o=i(72621),n=(i(9359),i(31526),i(2394)),r=(i(30080),i(43631)),l=i(57243),d=i(15093),s=i(20552),c=i(36522);i(23334),i(7285),i(83166);(0,r.hC)("vaadin-combo-box-item",l.iv`:host{padding:0!important}:host([focused]:not([disabled])){background-color:rgba(var(--rgb-primary-text-color,0,0,0),.12)}:host([selected]:not([disabled])){background-color:transparent;color:var(--mdc-theme-primary);--mdc-ripple-color:var(--mdc-theme-primary);--mdc-theme-text-primary-on-background:var(--mdc-theme-primary)}:host([selected]:not([disabled])):before{background-color:var(--mdc-theme-primary);opacity:.12;content:"";position:absolute;top:0;left:0;width:100%;height:100%}:host([selected][focused]:not([disabled])):before{opacity:.24}:host(:hover:not([disabled])){background-color:transparent}[part=content]{width:100%}[part=checkmark]{display:none}`);(0,a.Z)([(0,d.Mo)("ha-combo-box")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"placeholder",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"validationMessage",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"invalid",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"items",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"filteredItems",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"dataProvider",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"allow-custom-value",type:Boolean})],key:"allowCustomValue",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:"item-value-path"})],key:"itemValuePath",value:()=>"value"},{kind:"field",decorators:[(0,d.Cb)({attribute:"item-label-path"})],key:"itemLabelPath",value:()=>"label"},{kind:"field",decorators:[(0,d.Cb)({attribute:"item-id-path"})],key:"itemIdPath",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"renderer",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"opened",value:()=>!1},{kind:"field",decorators:[(0,d.IO)("vaadin-combo-box-light",!0)],key:"_comboBox",value:void 0},{kind:"field",decorators:[(0,d.IO)("ha-textfield",!0)],key:"_inputElement",value:void 0},{kind:"field",key:"_overlayMutationObserver",value:void 0},{kind:"field",key:"_bodyMutationObserver",value:void 0},{kind:"method",key:"open",value:async function(){await this.updateComplete,this._comboBox?.open()}},{kind:"method",key:"focus",value:async function(){await this.updateComplete,await(this._inputElement?.updateComplete),this._inputElement?.focus()}},{kind:"method",key:"disconnectedCallback",value:function(){(0,o.Z)(i,"disconnectedCallback",this,3)([]),this._overlayMutationObserver&&(this._overlayMutationObserver.disconnect(),this._overlayMutationObserver=void 0),this._bodyMutationObserver&&(this._bodyMutationObserver.disconnect(),this._bodyMutationObserver=void 0)}},{kind:"get",key:"selectedItem",value:function(){return this._comboBox.selectedItem}},{kind:"method",key:"setInputValue",value:function(e){this._comboBox.value=e}},{kind:"method",key:"render",value:function(){return l.dy` <vaadin-combo-box-light .itemValuePath="${this.itemValuePath}" .itemIdPath="${this.itemIdPath}" .itemLabelPath="${this.itemLabelPath}" .items="${this.items}" .value="${this.value||""}" .filteredItems="${this.filteredItems}" .dataProvider="${this.dataProvider}" .allowCustomValue="${this.allowCustomValue}" .disabled="${this.disabled}" .required="${this.required}" ${(0,n.t)(this.renderer||this._defaultRowRenderer)} @opened-changed="${this._openedChanged}" @filter-changed="${this._filterChanged}" @value-changed="${this._valueChanged}" attr-for-value="value"> <ha-textfield label="${(0,s.o)(this.label)}" placeholder="${(0,s.o)(this.placeholder)}" ?disabled="${this.disabled}" ?required="${this.required}" validationMessage="${(0,s.o)(this.validationMessage)}" .errorMessage="${this.errorMessage}" class="input" autocapitalize="none" autocomplete="off" autocorrect="off" input-spellcheck="false" .suffix="${l.dy`<div style="width:28px" role="none presentation"></div>`}" .icon="${this.icon}" .invalid="${this.invalid}" .helper="${this.helper}" helperPersistent> <slot name="icon" slot="leadingIcon"></slot> </ha-textfield> ${this.value?l.dy`<ha-svg-icon role="button" tabindex="-1" aria-label="${(0,s.o)(this.hass?.localize("ui.common.clear"))}" class="clear-button" .path="${"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"}" @click="${this._clearValue}"></ha-svg-icon>`:""} <ha-svg-icon role="button" tabindex="-1" aria-label="${(0,s.o)(this.label)}" aria-expanded="${this.opened?"true":"false"}" class="toggle-button" .path="${this.opened?"M7,15L12,10L17,15H7Z":"M7,10L12,15L17,10H7Z"}" @click="${this._toggleOpen}"></ha-svg-icon> </vaadin-combo-box-light> `}},{kind:"field",key:"_defaultRowRenderer",value(){return e=>l.dy`<ha-list-item> ${this.itemLabelPath?e[this.itemLabelPath]:e} </ha-list-item>`}},{kind:"method",key:"_clearValue",value:function(e){e.stopPropagation(),(0,c.B)(this,"value-changed",{value:void 0})}},{kind:"method",key:"_toggleOpen",value:function(e){this.opened?(this._comboBox?.close(),e.stopPropagation()):this._comboBox?.inputElement.focus()}},{kind:"method",key:"_openedChanged",value:function(e){e.stopPropagation();const t=e.detail.value;if(setTimeout((()=>{this.opened=t}),0),(0,c.B)(this,"opened-changed",{value:e.detail.value}),t){const e=document.querySelector("vaadin-combo-box-overlay");e&&this._removeInert(e),this._observeBody()}else this._bodyMutationObserver?.disconnect(),this._bodyMutationObserver=void 0}},{kind:"method",key:"_observeBody",value:function(){"MutationObserver"in window&&!this._bodyMutationObserver&&(this._bodyMutationObserver=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{"VAADIN-COMBO-BOX-OVERLAY"===e.nodeName&&this._removeInert(e)})),e.removedNodes.forEach((e=>{"VAADIN-COMBO-BOX-OVERLAY"===e.nodeName&&(this._overlayMutationObserver?.disconnect(),this._overlayMutationObserver=void 0)}))}))})),this._bodyMutationObserver.observe(document.body,{childList:!0}))}},{kind:"method",key:"_removeInert",value:function(e){if(e.inert)return e.inert=!1,this._overlayMutationObserver?.disconnect(),void(this._overlayMutationObserver=void 0);"MutationObserver"in window&&!this._overlayMutationObserver&&(this._overlayMutationObserver=new MutationObserver((e=>{e.forEach((e=>{if("inert"===e.attributeName){const t=e.target;t.inert&&(this._overlayMutationObserver?.disconnect(),this._overlayMutationObserver=void 0,t.inert=!1)}}))})),this._overlayMutationObserver.observe(e,{attributes:!0}))}},{kind:"method",key:"_filterChanged",value:function(e){e.stopPropagation(),(0,c.B)(this,"filter-changed",{value:e.detail.value})}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation(),this.allowCustomValue||(this._comboBox._closeOnBlurIsPrevented=!0);const t=e.detail.value;t!==this.value&&(0,c.B)(this,"value-changed",{value:t||void 0})}},{kind:"field",static:!0,key:"styles",value:()=>l.iv`:host{display:block;width:100%}vaadin-combo-box-light{position:relative;--vaadin-combo-box-overlay-max-height:calc(45vh - 56px)}ha-textfield{width:100%}ha-textfield>ha-icon-button{--mdc-icon-button-size:24px;padding:2px;color:var(--secondary-text-color)}ha-svg-icon{color:var(--input-dropdown-icon-color);position:absolute;cursor:pointer}.toggle-button{right:12px;top:-10px;inset-inline-start:initial;inset-inline-end:12px;direction:var(--direction)}:host([opened]) .toggle-button{color:var(--primary-color)}.clear-button{--mdc-icon-size:20px;top:-7px;right:36px;inset-inline-start:initial;inset-inline-end:36px;direction:var(--direction)}`}]}}),l.oi)},73729:function(e,t,i){i.d(t,{i:()=>h});var a=i(44249),o=i(72621),n=i(74966),r=i(51408),l=i(57243),d=i(15093),s=i(76525);i(23334);const c=["button","ha-list-item"],h=(e,t)=>l.dy` <div class="header_title"> <ha-icon-button .label="${e?.localize("ui.common.close")??"Close"}" .path="${"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"}" dialogAction="close" class="header_button"></ha-icon-button> <span>${t}</span> </div> `;(0,a.Z)([(0,d.Mo)("ha-dialog")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",key:s.gA,value:void 0},{kind:"method",key:"scrollToPos",value:function(e,t){this.contentElement?.scrollTo(e,t)}},{kind:"method",key:"renderHeading",value:function(){return l.dy`<slot name="heading"> ${(0,o.Z)(i,"renderHeading",this,3)([])} </slot>`}},{kind:"method",key:"firstUpdated",value:function(){(0,o.Z)(i,"firstUpdated",this,3)([]),this.suppressDefaultPressSelector=[this.suppressDefaultPressSelector,c].join(", "),this._updateScrolledAttribute(),this.contentElement?.addEventListener("scroll",this._onScroll,{passive:!0})}},{kind:"method",key:"disconnectedCallback",value:function(){(0,o.Z)(i,"disconnectedCallback",this,3)([]),this.contentElement.removeEventListener("scroll",this._onScroll)}},{kind:"field",key:"_onScroll",value(){return()=>{this._updateScrolledAttribute()}}},{kind:"method",key:"_updateScrolledAttribute",value:function(){this.contentElement&&this.toggleAttribute("scrolled",0!==this.contentElement.scrollTop)}},{kind:"field",static:!0,key:"styles",value:()=>[r.W,l.iv`:host([scrolled]) ::slotted(ha-dialog-header){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.mdc-dialog{--mdc-dialog-scroll-divider-color:var(
--dialog-scroll-divider-color,
var(--divider-color)
);z-index:var(--dialog-z-index,8);-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));--mdc-dialog-box-shadow:var(--dialog-box-shadow, none);--mdc-typography-headline6-font-weight:400;--mdc-typography-headline6-font-size:1.574rem}.mdc-dialog__actions{justify-content:var(--justify-action-buttons,flex-end);padding-bottom:max(env(safe-area-inset-bottom),24px)}.mdc-dialog__actions span:first-child{flex:var(--secondary-action-button-flex,unset)}.mdc-dialog__actions span:nth-child(2){flex:var(--primary-action-button-flex,unset)}.mdc-dialog__container{align-items:var(--vertical-align-dialog,center)}.mdc-dialog__title{padding:24px 24px 0 24px}.mdc-dialog__title:has(span){padding:12px 12px 0}.mdc-dialog__actions{padding:12px 24px 12px 24px}.mdc-dialog__title::before{content:unset}.mdc-dialog .mdc-dialog__content{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,24px)}:host([hideactions]) .mdc-dialog .mdc-dialog__content{padding-bottom:max(var(--dialog-content-padding,24px),env(safe-area-inset-bottom))}.mdc-dialog .mdc-dialog__surface{position:var(--dialog-surface-position,relative);top:var(--dialog-surface-top);margin-top:var(--dialog-surface-margin-top);min-height:var(--mdc-dialog-min-height,auto);border-radius:var(--ha-dialog-border-radius,28px);-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);background:var(--ha-dialog-surface-background,var(--mdc-theme-surface,#fff))}:host([flexContent]) .mdc-dialog .mdc-dialog__content{display:flex;flex-direction:column}.header_title{display:flex;align-items:center;direction:var(--direction)}.header_title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;padding-left:4px}.header_button{text-decoration:none;color:inherit;inset-inline-start:initial;inset-inline-end:-12px;direction:var(--direction)}.dialog-actions{inset-inline-start:initial!important;inset-inline-end:0px!important;direction:var(--direction)}`]}]}}),n.M)},21393:function(e,t,i){i.r(t),i.d(t,{HaIconPicker:()=>p});var a=i(44249),o=(i(92745),i(9359),i(56475),i(31526),i(70104),i(52924),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(57243)),n=i(15093),r=i(27486),l=i(36522),d=i(80654);i(94279),i(7285),i(65981);let s=[],c=!1;const h=async e=>{try{const t=d.g[e].getIconList;if("function"!=typeof t)return[];const i=await t();return i.map((t=>({icon:`${e}:${t.name}`,parts:new Set(t.name.split("-")),keywords:t.keywords??[]})))}catch(t){return console.warn(`Unable to load icon list for ${e} iconset`),[]}},u=e=>o.dy`<ha-list-item graphic="avatar"> <ha-icon .icon="${e.icon}" slot="graphic"></ha-icon> ${e.icon} </ha-list-item>`;let p=(0,a.Z)([(0,n.Mo)("ha-icon-picker")],(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)()],key:"value",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"placeholder",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"invalid",value:()=>!1},{kind:"method",key:"render",value:function(){return o.dy` <ha-combo-box .hass="${this.hass}" item-value-path="icon" item-label-path="icon" .value="${this._value}" allow-custom-value .dataProvider="${c?this._iconProvider:void 0}" .label="${this.label}" .helper="${this.helper}" .disabled="${this.disabled}" .required="${this.required}" .placeholder="${this.placeholder}" .errorMessage="${this.errorMessage}" .invalid="${this.invalid}" .renderer="${u}" icon @opened-changed="${this._openedChanged}" @value-changed="${this._valueChanged}"> ${this._value||this.placeholder?o.dy` <ha-icon .icon="${this._value||this.placeholder}" slot="icon"> </ha-icon> `:o.dy`<slot slot="icon" name="fallback"></slot>`} </ha-combo-box> `}},{kind:"field",key:"_filterIcons",value:()=>(0,r.Z)(((e,t=s)=>{if(!e)return t;const i=[],a=(e,t)=>i.push({icon:e,rank:t});for(const i of t)i.parts.has(e)?a(i.icon,1):i.keywords.includes(e)?a(i.icon,2):i.icon.includes(e)?a(i.icon,3):i.keywords.some((t=>t.includes(e)))&&a(i.icon,4);return 0===i.length&&a(e,0),i.sort(((e,t)=>e.rank-t.rank))}))},{kind:"field",key:"_iconProvider",value(){return(e,t)=>{const i=this._filterIcons(e.filter.toLowerCase(),s),a=e.page*e.pageSize,o=a+e.pageSize;t(i.slice(a,o),i.length)}}},{kind:"method",key:"_openedChanged",value:async function(e){e.detail.value&&!c&&(await(async()=>{c=!0;const e=await i.e("25016").then(i.t.bind(i,58134,19));s=e.default.map((e=>({icon:`mdi:${e.name}`,parts:new Set(e.name.split("-")),keywords:e.keywords})));const t=[];Object.keys(d.g).forEach((e=>{t.push(h(e))})),(await Promise.all(t)).forEach((e=>{s.push(...e)}))})(),this.requestUpdate())}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation(),this._setValue(e.detail.value)}},{kind:"method",key:"_setValue",value:function(e){this.value=e,(0,l.B)(this,"value-changed",{value:this._value},{bubbles:!1,composed:!1})}},{kind:"get",key:"_value",value:function(){return this.value||""}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`[slot=icon]{color:var(--primary-text-color);position:relative;bottom:2px}[slot=prefix]{margin-right:8px;margin-inline-end:8px;margin-inline-start:initial}`}]}}),o.oi)},34363:function(e,t,i){var a=i(44249),o=i(57243),n=i(15093);(0,a.Z)([(0,n.Mo)("ha-input-helper-text")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"method",key:"render",value:function(){return o.dy`<slot></slot>`}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`:host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:.75rem;padding-left:16px;padding-right:16px;padding-inline-start:16px;padding-inline-end:16px}`}]}}),o.oi)},78860:function(e,t,i){var a=i(44249),o=(i(9359),i(70104),i(57243)),n=i(15093),r=i(36522),l=i(28008);i(59826),i(23334),i(83166),i(34363);(0,a.Z)([(0,n.Mo)("ha-multi-textfield")],(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:"value",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"helper",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"inputType",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"inputSuffix",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"inputPrefix",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"addLabel",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"removeLabel",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"item-index",type:Boolean})],key:"itemIndex",value:()=>!1},{kind:"method",key:"render",value:function(){return o.dy` ${this._items.map(((e,t)=>{const i=""+(this.itemIndex?` ${t+1}`:"");return o.dy` <div class="layout horizontal center-center row"> <ha-textfield .suffix="${this.inputSuffix}" .prefix="${this.inputPrefix}" .type="${this.inputType}" .autocomplete="${this.autocomplete}" .disabled="${this.disabled}" dialogInitialFocus="${t}" .index="${t}" class="flex-auto" .label="${""+(this.label?`${this.label}${i}`:"")}" .value="${e}" ?data-last="${t===this._items.length-1}" @input="${this._editItem}" @keydown="${this._keyDown}"></ha-textfield> <ha-icon-button .disabled="${this.disabled}" .index="${t}" slot="navigationIcon" .label="${this.removeLabel??this.hass?.localize("ui.common.remove")??"Remove"}" @click="${this._removeItem}" .path="${"M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z"}"></ha-icon-button> </div> `}))} <div class="layout horizontal"> <ha-button @click="${this._addItem}" .disabled="${this.disabled}"> ${this.addLabel??(this.label?this.hass?.localize("ui.components.multi-textfield.add_item",{item:this.label}):this.hass?.localize("ui.common.add"))??"Add"} <ha-svg-icon slot="icon" .path="${"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"}"></ha-svg-icon> </ha-button> </div> ${this.helper?o.dy`<ha-input-helper-text>${this.helper}</ha-input-helper-text>`:o.Ld} `}},{kind:"get",key:"_items",value:function(){return this.value??[]}},{kind:"method",key:"_addItem",value:async function(){const e=[...this._items,""];this._fireChanged(e),await this.updateComplete;const t=this.shadowRoot?.querySelector("ha-textfield[data-last]");t?.focus()}},{kind:"method",key:"_editItem",value:async function(e){const t=e.target.index,i=[...this._items];i[t]=e.target.value,this._fireChanged(i)}},{kind:"method",key:"_keyDown",value:async function(e){"Enter"===e.key&&(e.stopPropagation(),this._addItem())}},{kind:"method",key:"_removeItem",value:async function(e){const t=e.target.index,i=[...this._items];i.splice(t,1),this._fireChanged(i)}},{kind:"method",key:"_fireChanged",value:function(e){this.value=e,(0,r.B)(this,"value-changed",{value:e})}},{kind:"get",static:!0,key:"styles",value:function(){return[l.Qx,o.iv`.row{margin-bottom:8px}ha-textfield{display:block}ha-icon-button{display:block}ha-button{margin-left:8px;margin-inline-start:8px;margin-inline-end:initial}`]}}]}}),o.oi)},30509:function(e,t,i){var a=i(44249),o=i(57243),n=i(15093);(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:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"slim",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"three-line"})],key:"threeLine",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"wrap-heading",reflect:!0})],key:"wrapHeading",value:()=>!1},{kind:"method",key:"render",value:function(){return o.dy` <div class="prefix-wrap"> <slot name="prefix"></slot> <div class="body" ?two-line="${!this.threeLine}" ?three-line="${this.threeLine}"> <slot name="heading"></slot> <div class="secondary"><slot name="description"></slot></div> </div> </div> <div class="content"><slot></slot></div> `}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`: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}`}]}}),o.oi)},83166:function(e,t,i){i.d(t,{f:()=>c});var a=i(44249),o=i(72621),n=i(1105),r=i(33990),l=i(57243),d=i(15093),s=i(5111);let c=(0,a.Z)([(0,d.Mo)("ha-textfield")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"iconTrailing",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,d.IO)("input")],key:"formElement",value:void 0},{kind:"method",key:"updated",value:function(e){(0,o.Z)(i,"updated",this,3)([e]),(e.has("invalid")||e.has("errorMessage"))&&(this.setCustomValidity(this.invalid?this.errorMessage||this.validationMessage||"Invalid":""),(this.invalid||this.validateOnInitialRender||e.has("invalid")&&void 0!==e.get("invalid"))&&this.reportValidity()),e.has("autocomplete")&&(this.autocomplete?this.formElement.setAttribute("autocomplete",this.autocomplete):this.formElement.removeAttribute("autocomplete")),e.has("autocorrect")&&(this.autocorrect?this.formElement.setAttribute("autocorrect",this.autocorrect):this.formElement.removeAttribute("autocorrect")),e.has("inputSpellcheck")&&(this.inputSpellcheck?this.formElement.setAttribute("spellcheck",this.inputSpellcheck):this.formElement.removeAttribute("spellcheck"))}},{kind:"method",key:"renderIcon",value:function(e,t=!1){const i=t?"trailing":"leading";return l.dy` <span class="mdc-text-field__icon mdc-text-field__icon--${i}" tabindex="${t?1:-1}"> <slot name="${i}Icon"></slot> </span> `}},{kind:"field",static:!0,key:"styles",value:()=>[r.W,l.iv`.mdc-text-field__input{width:var(--ha-textfield-input-width,100%)}.mdc-text-field:not(.mdc-text-field--with-leading-icon){padding:var(--text-field-padding,0px 16px)}.mdc-text-field__affix--suffix{padding-left:var(--text-field-suffix-padding-left,12px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,12px);padding-inline-end:var(--text-field-suffix-padding-right,0px);direction:ltr}.mdc-text-field--with-leading-icon{padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,16px);direction:var(--direction)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:var(--text-field-suffix-padding-left,0px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,0px)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--suffix{color:var(--secondary-text-color)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__icon{color:var(--secondary-text-color)}.mdc-text-field__icon--leading{margin-inline-start:16px;margin-inline-end:8px;direction:var(--direction)}.mdc-text-field__icon--trailing{padding:var(--textfield-icon-trailing-padding,12px)}.mdc-floating-label:not(.mdc-floating-label--float-above){text-overflow:ellipsis;width:inherit;padding-right:30px;padding-inline-end:30px;padding-inline-start:initial;box-sizing:border-box;direction:var(--direction)}input{text-align:var(--text-field-text-align,start)}input[type=color]{height:20px}::-ms-reveal{display:none}:host([no-spinner]) input::-webkit-inner-spin-button,:host([no-spinner]) input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=color]::-webkit-color-swatch-wrapper{padding:0}:host([no-spinner]) input[type=number]{-moz-appearance:textfield}.mdc-text-field__ripple{overflow:hidden}.mdc-text-field{overflow:var(--text-field-overflow)}.mdc-floating-label{inset-inline-start:16px!important;inset-inline-end:initial!important;transform-origin:var(--float-start);direction:var(--direction);text-align:var(--float-start)}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 48px - var(--text-field-suffix-padding-left,0px));inset-inline-start:calc(48px + var(--text-field-suffix-padding-left,0px))!important;inset-inline-end:initial!important;direction:var(--direction)}.mdc-text-field__input[type=number]{direction:var(--direction)}.mdc-text-field__affix--prefix{padding-right:var(--text-field-prefix-padding-right,2px);padding-inline-end:var(--text-field-prefix-padding-right,2px);padding-inline-start:initial}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--prefix{color:var(--mdc-text-field-label-ink-color)}#helper-text ha-markdown{display:inline-block}`,"rtl"===s.E.document.dir?l.iv`.mdc-floating-label,.mdc-text-field--with-leading-icon,.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label,.mdc-text-field__icon--leading,.mdc-text-field__input[type=number]{direction:rtl;--direction:rtl}`:l.iv``]}]}}),n.P)},76525:function(e,t,i){i.d(t,{L$:()=>u,gA:()=>s,lD:()=>f,ts:()=>p,vC:()=>c});i(92745);var a=i(5111),o=i(84200);if(66977!=i.j)var n=i(81165);if(66977!=i.j)var r=i(76320);const l={},d=[],s=Symbol.for("HA focus target"),c=async(e,t,i,r,h,u=!0)=>{if(!(i in l)){if(!h)return!1;l[i]={element:h().then((()=>{const t=document.createElement(i);return e.provideHass(t),t.addEventListener("dialog-closed",v),t.addEventListener("dialog-closed",m),t}))}}if(u){const{history:o}=a.E;if(o.state?.dialog&&!d.length)return await new Promise((e=>{setTimeout(e)})),c(e,t,i,r,h,u);const n=d.findIndex((e=>e.dialogTag===i));-1!==n&&d.splice(n,1),d.push({element:e,root:t,dialogTag:i,dialogParams:r,dialogImport:h,addHistory:u});const l={dialog:i};o.state?.dialog?o.replaceState(l,""):(o.replaceState({...o.state,opensDialog:!0},""),o.pushState(l,""))}l[i].closedFocusTargets=(0,o.r)((0,n.j)(),s);const p=await l[i].element;return t.appendChild(p),p.showDialog(r),!0},h=async e=>{if(!(e in l))return!0;const t=await l[e].element;return!t.closeDialog||!1!==t.closeDialog()},u=async()=>{if(d.length){const e=d.pop(),t=await h(e.dialogTag);return t||d.push(e),d.length&&a.E.history.state?.opensDialog&&a.E.history.pushState({dialog:d[d.length-1].dialogTag},""),t}return!0},p=async()=>{for(let e=d.length-1;e>=0;e--){if(!(!d[e]||await h(d[e].dialogTag)))return!1}return!0},v=e=>{const t=d.findIndex((t=>t.dialogTag===e.detail.dialog));-1!==t&&d.splice(t,1),a.E.history.state?.dialog===e.detail.dialog&&(d.length?a.E.history.replaceState({dialog:d[d.length-1].dialogTag},""):-1!==t&&a.E.history.back())},f=(e,t)=>{e.addEventListener("show-dialog",(i=>{const{dialogTag:a,dialogImport:o,dialogParams:n,addHistory:r}=i.detail;c(e,t,a,n,o,r)}))},m=async e=>{if(!l[e.detail.dialog])return;const t=l[e.detail.dialog].closedFocusTargets;if(delete l[e.detail.dialog].closedFocusTargets,!t)return;let i=(0,n.j)();i instanceof HTMLElement&&i.blur(),await(0,r.y)();for(const e of t)if(e instanceof HTMLElement&&(e.focus(),i=(0,n.j)(),i&&i!==document.body))return}},43604:function(e,t,i){i.r(t);var a=i(44249),o=(i(9359),i(56475),i(70104),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(31622),i(2060),i(57243)),n=i(15093),r=i(91583),l=i(27486),d=i(36522),s=(i(74666),i(18756),i(99426),i(91665),i(73729)),c=(i(21393),i(56002),i(30509),i(37583),i(83166),i(81282),i(28008)),h=i(61107),u=i(82100);let p=(0,a.Z)(null,(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.SB)()],key:"_name",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_aliases",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_icon",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_level",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_submitting",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_addedAreas",value:()=>new Set},{kind:"field",decorators:[(0,n.SB)()],key:"_removedAreas",value:()=>new Set},{kind:"method",key:"showDialog",value:function(e){this._params=e,this._error=void 0,this._name=this._params.entry?this._params.entry.name:this._params.suggestedName||"",this._aliases=this._params.entry?.aliases||[],this._icon=this._params.entry?.icon||null,this._level=this._params.entry?.level??null,this._addedAreas.clear(),this._removedAreas.clear()}},{kind:"method",key:"closeDialog",value:function(){this._error="",this._params=void 0,this._addedAreas.clear(),this._removedAreas.clear(),(0,d.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"field",key:"_floorAreas",value:()=>(0,l.Z)(((e,t,i,a)=>Object.values(t).filter((t=>(t.floor_id===e?.floor_id||i.has(t.area_id))&&!a.has(t.area_id)))))},{kind:"method",key:"render",value:function(){const e=this._floorAreas(this._params?.entry,this.hass.areas,this._addedAreas,this._removedAreas);if(!this._params)return o.Ld;const t=this._params.entry,i=!this._isNameValid();return o.dy` <ha-dialog open @closed="${this.closeDialog}" .heading="${(0,s.i)(this.hass,t?this.hass.localize("ui.panel.config.floors.editor.update_floor"):this.hass.localize("ui.panel.config.floors.editor.create_floor"))}"> <div> ${this._error?o.dy`<ha-alert alert-type="error">${this._error}</ha-alert>`:""} <div class="form"> ${t?o.dy` <ha-settings-row> <span slot="heading"> ${this.hass.localize("ui.panel.config.floors.editor.floor_id")} </span> <span slot="description">${t.floor_id}</span> </ha-settings-row> `:o.Ld} <ha-textfield .value="${this._name}" @input="${this._nameChanged}" .label="${this.hass.localize("ui.panel.config.floors.editor.name")}" .validationMessage="${this.hass.localize("ui.panel.config.floors.editor.name_required")}" required dialogInitialFocus></ha-textfield> <ha-textfield .value="${this._level}" @input="${this._levelChanged}" .label="${this.hass.localize("ui.panel.config.floors.editor.level")}" type="number"></ha-textfield> <ha-icon-picker .hass="${this.hass}" .value="${this._icon}" @value-changed="${this._iconChanged}" .label="${this.hass.localize("ui.panel.config.areas.editor.icon")}"> ${this._icon?o.Ld:o.dy` <ha-floor-icon slot="fallback" .floor="${{level:this._level}}"></ha-floor-icon> `} </ha-icon-picker> <h3 class="header"> ${this.hass.localize("ui.panel.config.floors.editor.areas_section")} </h3> <p class="description"> ${this.hass.localize("ui.panel.config.floors.editor.areas_description")} </p> ${e.length?o.dy`<ha-chip-set> ${(0,r.r)(e,(e=>e.area_id),(e=>o.dy`<ha-input-chip .area="${e}" @click="${this._openArea}" @remove="${this._removeArea}" .label="${e?.name}"> ${e.icon?o.dy`<ha-icon slot="icon" .icon="${e.icon}"></ha-icon>`:o.dy`<ha-svg-icon slot="icon" .path="${"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"}"></ha-svg-icon>`} </ha-input-chip>`))} </ha-chip-set>`:o.Ld} <ha-area-picker no-add .hass="${this.hass}" @value-changed="${this._addArea}" .excludeAreas="${e.map((e=>e.area_id))}" .label="${this.hass.localize("ui.panel.config.floors.editor.add_area")}"></ha-area-picker> <h3 class="header"> ${this.hass.localize("ui.panel.config.floors.editor.aliases_section")} </h3> <p class="description"> ${this.hass.localize("ui.panel.config.floors.editor.aliases_description")} </p> <ha-aliases-editor .hass="${this.hass}" .aliases="${this._aliases}" @value-changed="${this._aliasesChanged}"></ha-aliases-editor> </div> </div> <mwc-button slot="secondaryAction" @click="${this.closeDialog}"> ${this.hass.localize("ui.common.cancel")} </mwc-button> <mwc-button slot="primaryAction" @click="${this._updateEntry}" .disabled="${i||this._submitting}"> ${t?this.hass.localize("ui.common.save"):this.hass.localize("ui.common.create")} </mwc-button> </ha-dialog> `}},{kind:"method",key:"_openArea",value:function(e){const t=e.target.area;(0,h.E)(this,{entry:t,updateEntry:e=>(0,u.IO)(this.hass,t.area_id,e)})}},{kind:"method",key:"_removeArea",value:function(e){const t=e.target.area.area_id;if(this._addedAreas.has(t))return this._addedAreas.delete(t),void(this._addedAreas=new Set(this._addedAreas));this._removedAreas.add(t),this._removedAreas=new Set(this._removedAreas)}},{kind:"method",key:"_addArea",value:function(e){const t=e.detail.value;if(t){if(e.target.value="",this._removedAreas.has(t))return this._removedAreas.delete(t),void(this._removedAreas=new Set(this._removedAreas));this._addedAreas.add(t),this._addedAreas=new Set(this._addedAreas)}}},{kind:"method",key:"_isNameValid",value:function(){return""!==this._name.trim()}},{kind:"method",key:"_nameChanged",value:function(e){this._error=void 0,this._name=e.target.value}},{kind:"method",key:"_levelChanged",value:function(e){this._error=void 0,this._level=""===e.target.value?null:Number(e.target.value)}},{kind:"method",key:"_iconChanged",value:function(e){this._error=void 0,this._icon=e.detail.value}},{kind:"method",key:"_updateEntry",value:async function(){this._submitting=!0;const e=!this._params.entry;try{const t={name:this._name.trim(),icon:this._icon||(e?void 0:null),level:this._level,aliases:this._aliases};e?await this._params.createEntry(t,this._addedAreas):await this._params.updateEntry(t,this._addedAreas,this._removedAreas),this.closeDialog()}catch(e){this._error=e.message||this.hass.localize("ui.panel.config.floors.editor.unknown_error")}finally{this._submitting=!1}}},{kind:"method",key:"_aliasesChanged",value:function(e){this._aliases=e.detail.value}},{kind:"get",static:!0,key:"styles",value:function(){return[c.Qx,c.yu,o.iv`ha-textfield{display:block;margin-bottom:16px}ha-floor-icon{color:var(--secondary-text-color)}ha-chip-set{margin-bottom:8px}`]}}]}}),o.oi);customElements.define("dialog-floor-registry-detail",p)},61107:function(e,t,i){i.d(t,{E:()=>n,O:()=>o});var a=i(36522);const o=()=>Promise.all([i.e("46379"),i.e("66031"),i.e("72206"),i.e("97983"),i.e("24199"),i.e("27506"),i.e("42950"),i.e("65505"),i.e("58640"),i.e("83423"),i.e("18865"),i.e("27090"),i.e("88975"),i.e("3049"),i.e("21876"),i.e("89790"),i.e("61843"),i.e("15626")]).then(i.bind(i,2711)),n=(e,t)=>{(0,a.B)(e,"show-dialog",{dialogTag:"dialog-area-registry-detail",dialogImport:o,dialogParams:t})}},28008:function(e,t,i){i.d(t,{$c:()=>l,Qx:()=>n,k1:()=>o,yu:()=>r});var a=i(57243);const o=a.iv`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`,n=a.iv`:host{font-family:var(--paper-font-body1_-_font-family);-webkit-font-smoothing:var(--paper-font-body1_-_-webkit-font-smoothing);font-size:var(--paper-font-body1_-_font-size);font-weight:var(--paper-font-body1_-_font-weight);line-height:var(--paper-font-body1_-_line-height)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}h1{font-family:var(--paper-font-headline_-_font-family);-webkit-font-smoothing:var(--paper-font-headline_-_-webkit-font-smoothing);white-space:var(--paper-font-headline_-_white-space);overflow:var(--paper-font-headline_-_overflow);text-overflow:var(--paper-font-headline_-_text-overflow);font-size:var(--paper-font-headline_-_font-size);font-weight:var(--paper-font-headline_-_font-weight);line-height:var(--paper-font-headline_-_line-height)}h2{font-family:var(--paper-font-title_-_font-family);-webkit-font-smoothing:var(--paper-font-title_-_-webkit-font-smoothing);white-space:var(--paper-font-title_-_white-space);overf