UNPKG

iobroker.lovelace

Version:

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

1 lines 52.4 kB
export const __webpack_ids__=["65658"];export const __webpack_modules__={72344:function(t,e,i){i.d(e,{p:()=>a});const a=(t,e)=>t&&t.config.components.includes(e)},17803:function(t,e,i){i.d(e,{I:()=>a,_:()=>s});const a=(t,e,i,a)=>{const[s,n,o]=t.split(".",3);return Number(s)>e||Number(s)===e&&(void 0===a?Number(n)>=i:Number(n)>i)||void 0!==a&&Number(s)===e&&Number(n)===i&&Number(o)>=a},s=t=>t.includes("dev")},73358:function(t,e,i){i.d(e,{AF:()=>o,Kk:()=>c,PS:()=>a,a5:()=>n,gD:()=>f,iY:()=>u,lC:()=>l,ot:()=>h,tj:()=>r,uo:()=>d,zF:()=>s});i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814);const a=66977!=i.j?["alert","button","climate","cover","configurator","event","input_button","input_select","input_number","input_text","humidifier","lawn_mower","lock","media_player","number","scene","script","select","timer","text","update","vacuum","water_heater"]:null,s=99387==i.j?["sensor","binary_sensor","calendar","camera","device_tracker","image","weather"]:null,n=99387==i.j?["assist_satellite","conversation","stt","tts"]:null,o=["automation","button","cover","date","datetime","fan","group","humidifier","input_boolean","input_button","input_datetime","input_number","input_select","input_text","light","lock","media_player","number","scene","script","select","switch","text","time","vacuum","valve"],r=["closed","locked","off"],d="on",l="off",c=new Set(["fan","input_boolean","light","switch","group","automation","humidifier","valve"]),u=new Set(["camera","image","media_player"]),h="°C",f="°F"},97969:function(t,e,i){i.d(e,{p:()=>a});const a=t=>t.substr(t.indexOf(".")+1)},47194:function(t,e,i){i.d(e,{C:()=>n,a:()=>s});var a=i(97969);const s=(t,e)=>void 0===e.friendly_name?(0,a.p)(t).replace(/_/g," "):(e.friendly_name??"").toString(),n=t=>s(t.entity_id,t.attributes)},50602:function(t,e,i){i.a(t,(async function(t,a){try{i.d(e,{SL:()=>d,l4:()=>h,sJ:()=>l,uf:()=>u});var s=i(16485),n=i(20382),o=i(34618),r=t([s]);s=(r.then?(await r)():r)[0];const d=t=>l(t.attributes),l=(t,e)=>!!t.unit_of_measurement||!!t.state_class||(e||[]).includes(t.device_class||""),c=t=>{switch(t.number_format){case n.y4.comma_decimal:return["en-US","en"];case n.y4.decimal_comma:return["de","es","it"];case n.y4.space_comma:return["fr","sv","cs"];case n.y4.system:return;default:return t.language}},u=(t,e,i)=>{const a=e?c(e):void 0;return Number.isNaN=Number.isNaN||function t(e){return"number"==typeof e&&t(e)},e?.number_format===n.y4.none||Number.isNaN(Number(t))?Number.isNaN(Number(t))||""===t||e?.number_format!==n.y4.none?"string"==typeof t?t:`${(0,o.N)(t,i?.maximumFractionDigits).toString()}${"currency"===i?.style?` ${i.currency}`:""}`:new Intl.NumberFormat("en-US",f(t,{...i,useGrouping:!1})).format(Number(t)):new Intl.NumberFormat(a,f(t,i)).format(Number(t))},h=(t,e)=>{const i=e?.display_precision;return null!=i?{maximumFractionDigits:i,minimumFractionDigits:i}:Number.isInteger(Number(t?.attributes?.step))&&Number.isInteger(Number(t?.state))?{maximumFractionDigits:0}:void 0},f=(t,e)=>{const i={maximumFractionDigits:2,...e};if("string"!=typeof t)return i;if(!e||void 0===e.minimumFractionDigits&&void 0===e.maximumFractionDigits){const e=t.indexOf(".")>-1?t.split(".")[1].length:0;i.minimumFractionDigits=e,i.maximumFractionDigits=e}return i};a()}catch(t){a(t)}}))},34618:function(t,e,i){i.d(e,{N:()=>a});const a=(t,e=2)=>Math.round(t*10**e)/10**e},22381:function(t,e,i){i.d(e,{D:()=>a});const a=(t,e,i=!1)=>{let a;const s=(...s)=>{const n=i&&!a;clearTimeout(a),a=window.setTimeout((()=>{a=void 0,t(...s)}),e),n&&t(...s)};return s.cancel=()=>{clearTimeout(a)},s}},37394:function(t,e,i){i.d(e,{n:()=>s});class a extends Error{constructor(t,...e){super(...e),this.timeout=void 0,Error.captureStackTrace&&Error.captureStackTrace(this,a),this.name="TimeoutError",this.timeout=t,this.message=`Timed out in ${t} ms.`}}const s=(t,e)=>{const i=new Promise(((e,i)=>{setTimeout((()=>{i(new a(t))}),t)}));return Promise.race([e,i])}},42983:function(t,e,i){i.a(t,(async function(t,e){try{var a=i(44249),s=(i(92745),i(9359),i(56475),i(31526),i(87319),i(57243)),n=i(15093),o=i(27486),r=i(95262),d=i(36522),l=i(1416),c=i(17705),u=i(73192),h=(i(94279),i(37583),i(5460)),f=i(24360),m=t([h]);h=(m.then?(await m)():m)[0];(0,a.Z)([(0,n.Mo)("ha-statistic-picker")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(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)({attribute:"statistic-types"})],key:"statisticTypes",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"allow-custom-entity"})],key:"allowCustomEntity",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1,type:Array})],key:"statisticIds",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Array,attribute:"include-statistics-unit-of-measurement"})],key:"includeStatisticsUnitOfMeasurement",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"include-unit-class"})],key:"includeUnitClass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"include-device-class"})],key:"includeDeviceClass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"entities-only"})],key:"entitiesOnly",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Array,attribute:"exclude-statistics"})],key:"excludeStatistics",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"helpMissingEntityUrl",value:()=>"/more-info/statistics/"},{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:"_init",value:()=>!1},{kind:"field",key:"_statistics",value:()=>[]},{kind:"field",decorators:[(0,n.SB)()],key:"_filteredItems",value(){}},{kind:"field",key:"_rowRenderer",value(){return t=>s.dy`<mwc-list-item graphic="avatar" twoline> ${t.state?s.dy`<state-badge slot="graphic" .stateObj="${t.state}" .hass="${this.hass}"></state-badge>`:""} <span>${t.name}</span> <span slot="secondary">${""===t.id||"__missing"===t.id?s.dy`<a target="_blank" rel="noopener noreferrer" href="${(0,u.R)(this.hass,this.helpMissingEntityUrl)}">${this.hass.localize("ui.components.statistic-picker.learn_more")}</a>`:t.id}</span> </mwc-list-item>`}},{kind:"field",key:"_getStatistics",value(){return(0,o.Z)(((t,e,i,a,s,n,o)=>{if(!t.length)return[{id:"",name:this.hass.localize("ui.components.statistic-picker.no_statistics"),strings:[]}];if(e){const i=(0,r.r)(e);t=t.filter((t=>i.includes(t.statistics_unit_of_measurement)))}if(i){const e=(0,r.r)(i);t=t.filter((t=>e.includes(t.unit_class)))}if(a){const e=(0,r.r)(a);t=t.filter((t=>{const i=this.hass.states[t.statistic_id];return!i||e.includes(i.attributes.device_class||"")}))}const d=[];return t.forEach((t=>{if(n&&t.statistic_id!==o&&n.includes(t.statistic_id))return;const e=this.hass.states[t.statistic_id];if(!e){if(!s){const e=t.statistic_id,i=(0,c.Kd)(this.hass,t.statistic_id,t);d.push({id:e,name:i,strings:[e,i]})}return}const i=t.statistic_id,a=(0,c.Kd)(this.hass,t.statistic_id,t);d.push({id:i,name:a,state:e,strings:[i,a]})})),d.length?(d.length>1&&d.sort(((t,e)=>(0,l.$K)(t.name||"",e.name||"",this.hass.locale.language))),d.push({id:"__missing",name:this.hass.localize("ui.components.statistic-picker.missing_entity"),strings:[]}),d):[{id:"",name:this.hass.localize("ui.components.statistic-picker.no_match"),strings:[]}]}))}},{kind:"method",key:"open",value:function(){this.comboBox?.open()}},{kind:"method",key:"focus",value:function(){this.comboBox?.focus()}},{kind:"method",key:"willUpdate",value:function(t){(!this.hasUpdated&&!this.statisticIds||t.has("statisticTypes"))&&this._getStatisticIds(),(!this._init&&this.statisticIds||t.has("_opened")&&this._opened)&&(this._init=!0,this.hasUpdated?this._statistics=this._getStatistics(this.statisticIds,this.includeStatisticsUnitOfMeasurement,this.includeUnitClass,this.includeDeviceClass,this.entitiesOnly,this.excludeStatistics,this.value):this.updateComplete.then((()=>{this._statistics=this._getStatistics(this.statisticIds,this.includeStatisticsUnitOfMeasurement,this.includeUnitClass,this.includeDeviceClass,this.entitiesOnly,this.excludeStatistics,this.value)})))}},{kind:"method",key:"render",value:function(){return 0===this._statistics.length?s.Ld:s.dy` <ha-combo-box .hass="${this.hass}" .label="${void 0===this.label&&this.hass?this.hass.localize("ui.components.statistic-picker.statistic"):this.label}" .value="${this._value}" .renderer="${this._rowRenderer}" .disabled="${this.disabled}" .allowCustomValue="${this.allowCustomEntity}" .items="${this._statistics}" .filteredItems="${this._filteredItems??this._statistics}" item-value-path="id" item-id-path="id" item-label-path="name" @opened-changed="${this._openedChanged}" @value-changed="${this._statisticChanged}" @filter-changed="${this._filterChanged}"></ha-combo-box> `}},{kind:"method",key:"_getStatisticIds",value:async function(){this.statisticIds=await(0,c.uR)(this.hass,this.statisticTypes)}},{kind:"get",key:"_value",value:function(){return this.value||""}},{kind:"method",key:"_statisticChanged",value:function(t){t.stopPropagation();let e=t.detail.value;"__missing"===e&&(e=""),e!==this._value&&this._setValue(e)}},{kind:"method",key:"_openedChanged",value:function(t){this._opened=t.detail.value}},{kind:"method",key:"_filterChanged",value:function(t){const e=t.detail.value.toLowerCase();this._filteredItems=e.length?(0,f.q)(e,this._statistics):void 0}},{kind:"method",key:"_setValue",value:function(t){this.value=t,setTimeout((()=>{(0,d.B)(this,"value-changed",{value:t}),(0,d.B)(this,"change")}),0)}}]}}),s.oi);e()}catch(t){e(t)}}))},52131:function(t,e,i){i.a(t,(async function(t,e){try{var a=i(44249),s=(i(9359),i(56475),i(70104),i(57243)),n=i(15093),o=i(91583),r=i(36522),d=i(42983),l=t([d]);d=(l.then?(await l)():l)[0];(0,a.Z)([(0,n.Mo)("ha-statistics-picker")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Array})],key:"value",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1,type:Array})],key:"statisticIds",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"statistic-types"})],key:"statisticTypes",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"picked-statistic-label"})],key:"pickedStatisticLabel",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"pick-statistic-label"})],key:"pickStatisticLabel",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"allow-custom-entity"})],key:"allowCustomEntity",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"include-statistics-unit-of-measurement"})],key:"includeStatisticsUnitOfMeasurement",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"include-unit-class"})],key:"includeUnitClass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"include-device-class"})],key:"includeDeviceClass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"ignore-restrictions-on-first-statistic"})],key:"ignoreRestrictionsOnFirstStatistic",value:()=>!1},{kind:"method",key:"render",value:function(){if(!this.hass)return s.Ld;const t=this.ignoreRestrictionsOnFirstStatistic&&this._currentStatistics.length<=1,e=t?void 0:this.includeStatisticsUnitOfMeasurement,i=t?void 0:this.includeUnitClass,a=t?void 0:this.includeDeviceClass,n=t?void 0:this.statisticTypes;return s.dy` ${(0,o.r)(this._currentStatistics,(t=>t),(t=>s.dy` <div> <ha-statistic-picker .curValue="${t}" .hass="${this.hass}" .includeStatisticsUnitOfMeasurement="${e}" .includeUnitClass="${i}" .includeDeviceClass="${a}" .value="${t}" .statisticTypes="${n}" .statisticIds="${this.statisticIds}" .label="${this.pickedStatisticLabel}" .excludeStatistics="${this.value}" .allowCustomEntity="${this.allowCustomEntity}" @value-changed="${this._statisticChanged}"></ha-statistic-picker> </div> `))} <div> <ha-statistic-picker .hass="${this.hass}" .includeStatisticsUnitOfMeasurement="${this.includeStatisticsUnitOfMeasurement}" .includeUnitClass="${this.includeUnitClass}" .includeDeviceClass="${this.includeDeviceClass}" .statisticTypes="${this.statisticTypes}" .statisticIds="${this.statisticIds}" .label="${this.pickStatisticLabel}" .excludeStatistics="${this.value}" .allowCustomEntity="${this.allowCustomEntity}" @value-changed="${this._addStatistic}"></ha-statistic-picker> </div> `}},{kind:"get",key:"_currentStatistics",value:function(){return this.value||[]}},{kind:"method",key:"_updateStatistics",value:async function(t){this.value=t,(0,r.B)(this,"value-changed",{value:t})}},{kind:"method",key:"_statisticChanged",value:function(t){t.stopPropagation();const e=t.currentTarget.curValue,i=t.detail.value;if(i===e)return;const a=this._currentStatistics;i&&!a.includes(i)?this._updateStatistics(a.map((t=>t===e?i:t))):this._updateStatistics(a.filter((t=>t!==e)))}},{kind:"method",key:"_addStatistic",value:async function(t){t.stopPropagation();const e=t.detail.value;if(!e)return;if(t.currentTarget.value="",!e)return;const i=this._currentStatistics;i.includes(e)||this._updateStatistics([...i,e])}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`:host{width:200px;display:block}ha-statistic-picker{display:block;width:100%;margin-top:8px}`}]}}),s.oi);e()}catch(t){e(t)}}))},94279:function(t,e,i){var a=i(44249),s=i(72621),n=(i(9359),i(31526),i(2394)),o=(i(30080),i(43631)),r=i(57243),d=i(15093),l=i(20552),c=i(36522);i(23334),i(7285),i(83166);(0,o.hC)("vaadin-combo-box-item",r.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(t,e){class i extends e{constructor(...e){super(...e),t(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,s.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(t){this._comboBox.value=t}},{kind:"method",key:"render",value:function(){return r.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,l.o)(this.label)}" placeholder="${(0,l.o)(this.placeholder)}" ?disabled="${this.disabled}" ?required="${this.required}" validationMessage="${(0,l.o)(this.validationMessage)}" .errorMessage="${this.errorMessage}" class="input" autocapitalize="none" autocomplete="off" autocorrect="off" input-spellcheck="false" .suffix="${r.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?r.dy`<ha-svg-icon role="button" tabindex="-1" aria-label="${(0,l.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,l.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 t=>r.dy`<ha-list-item> ${this.itemLabelPath?t[this.itemLabelPath]:t} </ha-list-item>`}},{kind:"method",key:"_clearValue",value:function(t){t.stopPropagation(),(0,c.B)(this,"value-changed",{value:void 0})}},{kind:"method",key:"_toggleOpen",value:function(t){this.opened?(this._comboBox?.close(),t.stopPropagation()):this._comboBox?.inputElement.focus()}},{kind:"method",key:"_openedChanged",value:function(t){t.stopPropagation();const e=t.detail.value;if(setTimeout((()=>{this.opened=e}),0),(0,c.B)(this,"opened-changed",{value:t.detail.value}),e){const t=document.querySelector("vaadin-combo-box-overlay");t&&this._removeInert(t),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((t=>{t.forEach((t=>{t.addedNodes.forEach((t=>{"VAADIN-COMBO-BOX-OVERLAY"===t.nodeName&&this._removeInert(t)})),t.removedNodes.forEach((t=>{"VAADIN-COMBO-BOX-OVERLAY"===t.nodeName&&(this._overlayMutationObserver?.disconnect(),this._overlayMutationObserver=void 0)}))}))})),this._bodyMutationObserver.observe(document.body,{childList:!0}))}},{kind:"method",key:"_removeInert",value:function(t){if(t.inert)return t.inert=!1,this._overlayMutationObserver?.disconnect(),void(this._overlayMutationObserver=void 0);"MutationObserver"in window&&!this._overlayMutationObserver&&(this._overlayMutationObserver=new MutationObserver((t=>{t.forEach((t=>{if("inert"===t.attributeName){const e=t.target;e.inert&&(this._overlayMutationObserver?.disconnect(),this._overlayMutationObserver=void 0,e.inert=!1)}}))})),this._overlayMutationObserver.observe(t,{attributes:!0}))}},{kind:"method",key:"_filterChanged",value:function(t){t.stopPropagation(),(0,c.B)(this,"filter-changed",{value:t.detail.value})}},{kind:"method",key:"_valueChanged",value:function(t){t.stopPropagation(),this.allowCustomValue||(this._comboBox._closeOnBlurIsPrevented=!0);const e=t.detail.value;e!==this.value&&(0,c.B)(this,"value-changed",{value:e||void 0})}},{kind:"field",static:!0,key:"styles",value:()=>r.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)}`}]}}),r.oi)},65981:function(t,e,i){i.r(e),i.d(e,{HaIcon:()=>k});var a=i(44249),s=i(72621),n=i(57243),o=i(15093),r=i(36522),d=i(22381),l=i(80654),c=(i(92745),i(9359),i(31526),i(27608)),u=i(27486),h=i(37394);const f=JSON.parse('{"version":"7.4.47","parts":[{"file":"7a7139d465f1f41cb26ab851a17caa21a9331234"},{"start":"account-supervisor-circle-","file":"9561286c4c1021d46b9006596812178190a7cc1c"},{"start":"alpha-r-c","file":"eb466b7087fb2b4d23376ea9bc86693c45c500fa"},{"start":"arrow-decision-o","file":"4b3c01b7e0723b702940c5ac46fb9e555646972b"},{"start":"baby-f","file":"2611401d85450b95ab448ad1d02c1a432b409ed2"},{"start":"battery-hi","file":"89bcd31855b34cd9d31ac693fb073277e74f1f6a"},{"start":"blur-r","file":"373709cd5d7e688c2addc9a6c5d26c2d57c02c48"},{"start":"briefcase-account-","file":"a75956cf812ee90ee4f656274426aafac81e1053"},{"start":"calendar-question-","file":"3253f2529b5ebdd110b411917bacfacb5b7063e6"},{"start":"car-lig","file":"74566af3501ad6ae58ad13a8b6921b3cc2ef879d"},{"start":"cellphone-co","file":"7677f1cfb2dd4f5562a2aa6d3ae43a2e6997b21a"},{"start":"circle-slice-2","file":"70d08c50ec4522dd75d11338db57846588263ee2"},{"start":"cloud-co","file":"141d2bfa55ca4c83f4bae2812a5da59a84fec4ff"},{"start":"cog-s","file":"5a640365f8e47c609005d5e098e0e8104286d120"},{"start":"cookie-l","file":"dd85b8eb8581b176d3acf75d1bd82e61ca1ba2fc"},{"start":"currency-eur-","file":"15362279f4ebfc3620ae55f79d2830ad86d5213e"},{"start":"delete-o","file":"239434ab8df61237277d7599ebe066c55806c274"},{"start":"draw-","file":"5605918a592070803ba2ad05a5aba06263da0d70"},{"start":"emoticon-po","file":"a838cfcec34323946237a9f18e66945f55260f78"},{"start":"fan","file":"effd56103b37a8c7f332e22de8e4d67a69b70db7"},{"start":"file-question-","file":"b2424b50bd465ae192593f1c3d086c5eec893af8"},{"start":"flask-off-","file":"3b76295cde006a18f0301dd98eed8c57e1d5a425"},{"start":"food-s","file":"1c6941474cbeb1755faaaf5771440577f4f1f9c6"},{"start":"gamepad-u","file":"c6efe18db6bc9654ae3540c7dee83218a5450263"},{"start":"google-f","file":"df341afe6ad4437457cf188499cb8d2df8ac7b9e"},{"start":"head-c","file":"282121c9e45ed67f033edcc1eafd279334c00f46"},{"start":"home-pl","file":"27e8e38fc7adcacf2a210802f27d841b49c8c508"},{"start":"inbox-","file":"0f0316ec7b1b7f7ce3eaabce26c9ef619b5a1694"},{"start":"key-v","file":"ea33462be7b953ff1eafc5dac2d166b210685a60"},{"start":"leaf-circle-","file":"33db9bbd66ce48a2db3e987fdbd37fb0482145a4"},{"start":"lock-p","file":"b89e27ed39e9d10c44259362a4b57f3c579d3ec8"},{"start":"message-s","file":"7b5ab5a5cadbe06e3113ec148f044aa701eac53a"},{"start":"moti","file":"01024d78c248d36805b565e343dd98033cc3bcaf"},{"start":"newspaper-variant-o","file":"22a6ec4a4fdd0a7c0acaf805f6127b38723c9189"},{"start":"on","file":"c73d55b412f394e64632e2011a59aa05e5a1f50d"},{"start":"paw-ou","file":"3f669bf26d16752dc4a9ea349492df93a13dcfbf"},{"start":"pigg","file":"0c24edb27eb1c90b6e33fc05f34ef3118fa94256"},{"start":"printer-pos-sy","file":"41a55cda866f90b99a64395c3bb18c14983dcf0a"},{"start":"read","file":"c7ed91552a3a64c9be88c85e807404cf705b7edf"},{"start":"robot-vacuum-variant-o","file":"917d2a35d7268c0ea9ad9ecab2778060e19d90e0"},{"start":"sees","file":"6e82d9861d8fac30102bafa212021b819f303bdb"},{"start":"shoe-f","file":"e2fe7ce02b5472301418cc90a0e631f187b9f238"},{"start":"snowflake-m","file":"a28ba9f5309090c8b49a27ca20ff582a944f6e71"},{"start":"st","file":"7e92d03f095ec27e137b708b879dfd273bd735ab"},{"start":"su","file":"61c74913720f9de59a379bdca37f1d2f0dc1f9db"},{"start":"tag-plus-","file":"8f3184156a4f38549cf4c4fffba73a6a941166ae"},{"start":"timer-a","file":"baab470d11cfb3a3cd3b063ee6503a77d12a80d0"},{"start":"transit-d","file":"8561c0d9b1ac03fab360fd8fe9729c96e8693239"},{"start":"vector-arrange-b","file":"c9a3439257d4bab33d3355f1f2e11842e8171141"},{"start":"water-ou","file":"02dbccfb8ca35f39b99f5a085b095fc1275005a0"},{"start":"webc","file":"57bafd4b97341f4f2ac20a609d023719f23a619c"},{"start":"zip","file":"65ae094e8263236fa50486584a08c03497a38d93"}]}'),m=(0,u.Z)((async()=>{const t=(0,c.MT)("hass-icon-db","mdi-icon-store");{const e=await(0,c.U2)("_version",t);e?e!==f.version&&(await(0,c.ZH)(t),(0,c.t8)("_version",f.version,t)):(0,c.t8)("_version",f.version,t)}return t})),p=["mdi","hass","hassio","hademo"];let v=[];i(37583);const b={},y={},g=(0,d.D)((()=>(async t=>{const e=Object.keys(t),i=await Promise.all(Object.values(t));(await m())("readwrite",(a=>{i.forEach(((i,s)=>{Object.entries(i).forEach((([t,e])=>{a.put(e,t)})),delete t[e[s]]}))}))})(y)),2e3),_={};let k=(0,a.Z)([(0,o.Mo)("ha-icon")],(function(t,e){class a extends e{constructor(...e){super(...e),t(this)}}return{F:a,d:[{kind:"field",decorators:[(0,o.Cb)()],key:"icon",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_path",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_secondaryPath",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_viewBox",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_legacy",value:()=>!1},{kind:"method",key:"willUpdate",value:function(t){(0,s.Z)(a,"willUpdate",this,3)([t]),t.has("icon")&&(this._path=void 0,this._secondaryPath=void 0,this._viewBox=void 0,this._loadIcon())}},{kind:"method",key:"render",value:function(){return this.icon?this._legacy?n.dy` <iron-icon .icon="${this.icon}"></iron-icon>`:n.dy`<ha-svg-icon .path="${this._path}" .secondaryPath="${this._secondaryPath}" .viewBox="${this._viewBox}"></ha-svg-icon>`:n.Ld}},{kind:"method",key:"_loadIcon",value:async function(){if(!this.icon)return;const t=this.icon,[e,a]=this.icon.split(":",2);let s,n=a;if(!e||!n)return;if(!p.includes(e)){const i=l.g[e];return i?void(i&&"function"==typeof i.getIcon&&this._setCustomPath(i.getIcon(n),t)):void(this._legacy=!0)}if(this._legacy=!1,n in b){const t=b[n];let i;t.newName?(i=`Icon ${e}:${n} was renamed to ${e}:${t.newName}, please change your config, it will be removed in version ${t.removeIn}.`,n=t.newName):i=`Icon ${e}:${n} was removed from MDI, please replace this icon with an other icon in your config, it will be removed in version ${t.removeIn}.`,console.warn(i),(0,r.B)(this,"write_log",{level:"warning",message:i})}if(n in _)return void(this._path=_[n]);if("home-assistant"===n){const e=(await i.e("48348").then(i.bind(i,30511))).mdiHomeAssistant;return this.icon===t&&(this._path=e),void(_[n]=e)}try{s=await(t=>new Promise(((e,i)=>{if(v.push([t,e,i]),v.length>1)return;const a=m();(0,h.n)(1e3,(async()=>{(await a)("readonly",(t=>{for(const[e,i,a]of v)(0,c.RV)(t.get(e)).then((t=>i(t))).catch((t=>a(t)));v=[]}))})()).catch((t=>{for(const[,,e]of v)e(t);v=[]}))})))(n)}catch(t){s=void 0}if(s)return this.icon===t&&(this._path=s),void(_[n]=s);const o=(t=>{let e;for(const i of f.parts){if(void 0!==i.start&&t<i.start)break;e=i}return e.file})(n);if(o in y)return void this._setPath(y[o],n,t);const d=fetch(`/static/mdi/${o}.json`).then((t=>t.json()));y[o]=d,this._setPath(d,n,t),g()}},{kind:"method",key:"_setCustomPath",value:async function(t,e){const i=await t;this.icon===e&&(this._path=i.path,this._secondaryPath=i.secondaryPath,this._viewBox=i.viewBox)}},{kind:"method",key:"_setPath",value:async function(t,e,i){const a=await t;this.icon===i&&(this._path=a[e]),_[e]=a[e]}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`:host{fill:currentcolor}`}]}}),n.oi)},7285:function(t,e,i){i.d(e,{M:()=>l});var a=i(44249),s=i(72621),n=i(65703),o=i(46289),r=i(57243),d=i(15093);let l=(0,a.Z)([(0,d.Mo)("ha-list-item")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,s.Z)(i,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[o.W,r.iv`: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?r.iv`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:r.iv``]}}]}}),n.K)},30490:function(t,e,i){i.a(t,(async function(t,a){try{i.r(e),i.d(e,{HaStatisticSelector:()=>l});var s=i(44249),n=i(57243),o=i(15093),r=i(52131),d=t([r]);r=(d.then?(await d)():d)[0];let l=(0,s.Z)([(0,o.Mo)("ha-selector-statistic")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"required",value:()=>!0},{kind:"method",key:"render",value:function(){return this.selector.statistic.multiple?n.dy` ${this.label?n.dy`<label>${this.label}</label>`:""} <ha-statistics-picker .hass="${this.hass}" .value="${this.value}" .helper="${this.helper}" .disabled="${this.disabled}" .required="${this.required}"></ha-statistics-picker> `:n.dy`<ha-statistic-picker .hass="${this.hass}" .value="${this.value}" .label="${this.label}" .helper="${this.helper}" .disabled="${this.disabled}" .required="${this.required}" allow-custom-entity></ha-statistic-picker>`}}]}}),n.oi);a()}catch(t){a(t)}}))},51223:function(t,e,i){i.a(t,(async function(t,e){try{var a=i(44249),s=i(57243),n=i(15093),o=i(94571),r=i(59847),d=i(45729),l=(i(65981),i(37583),t([d]));d=(l.then?(await l)():l)[0];(0,a.Z)([(0,n.Mo)("ha-state-icon")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"stateObj",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"stateValue",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"icon",value:void 0},{kind:"method",key:"render",value:function(){const t=this.icon||this.stateObj&&this.hass?.entities[this.stateObj.entity_id]?.icon||this.stateObj?.attributes.icon;if(t)return s.dy`<ha-icon .icon="${t}"></ha-icon>`;if(!this.stateObj)return s.Ld;if(!this.hass)return this._renderFallback();const e=(0,d.gD)(this.hass,this.stateObj,this.stateValue).then((t=>t?s.dy`<ha-icon .icon="${t}"></ha-icon>`:this._renderFallback()));return s.dy`${(0,o.C)(e)}`}},{kind:"method",key:"_renderFallback",value:function(){const t=(0,r.N)(this.stateObj);return s.dy` <ha-svg-icon .path="${d.Ls[t]||d.Rb}"></ha-svg-icon> `}}]}}),s.oi);e()}catch(t){e(t)}}))},83166:function(t,e,i){i.d(e,{f:()=>c});var a=i(44249),s=i(72621),n=i(1105),o=i(33990),r=i(57243),d=i(15093),l=i(5111);let c=(0,a.Z)([(0,d.Mo)("ha-textfield")],(function(t,e){class i extends e{constructor(...e){super(...e),t(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(t){(0,s.Z)(i,"updated",this,3)([t]),(t.has("invalid")||t.has("errorMessage"))&&(this.setCustomValidity(this.invalid?this.errorMessage||this.validationMessage||"Invalid":""),(this.invalid||this.validateOnInitialRender||t.has("invalid")&&void 0!==t.get("invalid"))&&this.reportValidity()),t.has("autocomplete")&&(this.autocomplete?this.formElement.setAttribute("autocomplete",this.autocomplete):this.formElement.removeAttribute("autocomplete")),t.has("autocorrect")&&(this.autocorrect?this.formElement.setAttribute("autocorrect",this.autocorrect):this.formElement.removeAttribute("autocorrect")),t.has("inputSpellcheck")&&(this.inputSpellcheck?this.formElement.setAttribute("spellcheck",this.inputSpellcheck):this.formElement.removeAttribute("spellcheck"))}},{kind:"method",key:"renderIcon",value:function(t,e=!1){const i=e?"trailing":"leading";return r.dy` <span class="mdc-text-field__icon mdc-text-field__icon--${i}" tabindex="${e?1:-1}"> <slot name="${i}Icon"></slot> </span> `}},{kind:"field",static:!0,key:"styles",value:()=>[o.W,r.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"===l.E.document.dir?r.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}`:r.iv``]}]}}),n.P)},43546:function(t,e,i){i.d(e,{Cp:()=>h,GX:()=>l,PC:()=>r,TZ:()=>f,W2:()=>u,WD:()=>o,YY:()=>p,et:()=>d,iI:()=>n,j2:()=>m,lU:()=>c,oT:()=>s,uw:()=>a});i(9359),i(70104);const a=28639==i.j?`${location.protocol}//${location.host}`:null,s=t=>t.map((t=>{if("string"!==t.type)return t;switch(t.name){case"username":return{...t,autocomplete:"username",autofocus:!0};case"password":return{...t,autocomplete:"current-password"};case"code":return{...t,autocomplete:"one-time-code",autofocus:!0};default:return t}})),n=(t,e)=>t.callWS({type:"auth/sign_path",path:e}),o=()=>fetch("/auth/providers",{credentials:"same-origin"}),r=(t,e,i)=>fetch("/auth/login_flow",{method:"POST",credentials:"same-origin",body:JSON.stringify({client_id:t,handler:i,redirect_uri:e})}),d=(t,e)=>fetch(`/auth/login_flow/${t}`,{method:"POST",credentials:"same-origin",body:JSON.stringify(e)}),l=t=>fetch(`/auth/login_flow/${t}`,{method:"DELETE",credentials:"same-origin"}),c=(t,e,i,a)=>{t.includes("?")?t.endsWith("&")||(t+="&"):t+="?",t+=`code=${encodeURIComponent(e)}`,i&&(t+=`&state=${encodeURIComponent(i)}`),a&&(t+="&storeToken=true"),document.location.assign(t)},u=async(t,e,i,a)=>t.callWS({type:"config/auth_provider/homeassistant/create",user_id:e,username:i,password:a}),h=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:e,new_password:i}),f=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:e,password:i}),m=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:e,username:i}),p=(t,e,i)=>t.callWS({type:"auth/delete_all_refresh_tokens",token_type:e,delete_current_token:i})},99650:function(t,e,i){if(i.d(e,{B:()=>g,Ch:()=>l,Lr:()=>f,Mw:()=>b,T9:()=>m,Xn:()=>v,i4:()=>u,jU:()=>d,kU:()=>r,nk:()=>c,ou:()=>k,qW:()=>o,r:()=>p,sF:()=>n,z9:()=>x,zj:()=>_}),66977!=i.j)var a=i(86190);var s=i(43546);const n=66977!=i.j?[1,2,3,4,6,8]:null,o=2,r="hls",d="web_rtc",l=(t,e,i)=>`${t}&width=${e}&height=${i}`,c=t=>`/api/camera_proxy_stream/${t.entity_id}?token=${t.attributes.access_token}`,u=async(t,e,i,s)=>{const n=await(0,a.U)("_cameraTmbUrl",9e3,h,t,e);return l(n,i,s)},h=async(t,e)=>{const i=await(0,s.iI)(t,`/api/camera_proxy/${e}`);return t.hassUrl(i.path)},f=async(t,e,i)=>{const a={type:"camera/stream",entity_id:e};i&&(a.format=i);const s=await t.callWS(a);return s.url=t.hassUrl(s.url),s},m=(t,e,i,a)=>t.connection.subscribeMessage(a,{type:"camera/webrtc/offer",entity_id:e,offer:i}),p=(t,e,i,a)=>t.callWS({type:"camera/webrtc/candidate",entity_id:e,session_id:i,candidate:a}),v=(t,e)=>t.callWS({type:"camera/get_prefs",entity_id:e}),b=(t,e,i)=>t.callWS({type:"camera/update_prefs",entity_id:e,...i}),y="media-source://camera/",g=t=>t.startsWith(y),_=t=>t.substring(22),k=async(t,e)=>t.callWS({type:"camera/capabilities",entity_id:e}),x=async(t,e)=>t.callWS({type:"camera/webrtc/get_client_config",entity_id:e})},38042:function(t,e,i){if(i.d(e,{n:()=>s}),66977!=i.j)var a=i(62212);const s=(t,e,i,s,n)=>{const o=`${i}-optimistic`;return{...(0,a._)(e,i,s,(async(t,i)=>{const a=n?n(e,i):void 0;return e[o]=i,()=>{a&&a.then((t=>t())),e[o]=void 0}})),async save(i){const a=e[o];let s;a&&(s=a.state,a.setState(i,!0));try{return await t(e,i)}catch(t){throw a&&a.setState(s,!0),t}}}}},80654:function(t,e,i){i.d(e,{g:()=>o});const a=window;"customIconsets"in a||(a.customIconsets={});const s=a.customIconsets,n=window;"customIcons"in n||(n.customIcons={});const o=new Proxy(n.customIcons,{get:(t,e)=>t[e]??(s[e]?{getIcon:s[e]}:void 0)})},96194:function(t,e,i){i.d(e,{ON:()=>o,PX:()=>r,V_:()=>d,lz:()=>n,nZ:()=>s,rk:()=>c});var a=i(92636);const s="unavailable",n="unknown",o="on",r="off",d=[s,n],l=[s,n,r],c=(0,a.z)(d);(0,a.z)(l)},80027:function(t,e,i){if(i.d(e,{DS:()=>n,Fl:()=>s,rP:()=>o,tp:()=>r}),66977!=i.j)var a=i(38042);const s=async(t,e)=>(await t.sendMessagePromise({type:"frontend/get_user_data",key:e})).value,n=async(t,e,i)=>t.sendMessagePromise({type:"frontend/set_user_data",key:e,value:i}),o=(t,e)=>(0,a.n)(((i,a)=>n(t,e,a)),t,`_frontendUserData-${e}`,(()=>s(t,e))),r=(t,e,i)=>o(t,e).subscribe(i)},17705:function(t,e,i){i.d(e,{Cj:()=>h,F7:()=>s,Hs:()=>w,Kd:()=>k,Kj:()=>m,Nw:()=>v,PA:()=>n,Py:()=>d,Qm:()=>C,Z0:()=>g,_Y:()=>c,_m:()=>o,dL:()=>l,dO:()=>x,hN:()=>f,h_:()=>u,j2:()=>_,q6:()=>p,uR:()=>r});i(9359),i(52924);var a=i(47194);let s=66977!=i.j?function(t){return t[t.NONE=0]="NONE",t[t.ARITHMETIC=1]="ARITHMETIC",t[t.CIRCULAR=2]="CIRCULAR",t}({}):null;const n=99387==i.j?["entity_not_recorded","entity_no_longer_recorded","state_class_removed","units_changed","mean_type_changed","no_state"]:null,o=t=>t.sendMessagePromise({type:"recorder/info"}),r=(t,e)=>t.callWS({type:"recorder/list_statistic_ids",statistic_type:e}),d=(t,e)=>t.callWS({type:"recorder/get_statistics_metadata",statistic_ids:e}),l=(t,e,i,a,s="hour",n,o)=>t.callWS({type:"recorder/statistics_during_period",start_time:e.toISOString(),end_time:i?.toISOString(),statistic_ids:a,period:s,units:n,types:o}),c=(t,e,i,a)=>t.callWS({type:"recorder/statistic_during_period",statistic_id:e,units:a,fixed_period:i.fixed_period?{start_time:i.fixed_period.start instanceof Date?i.fixed_period.start.toISOString():i.fixed_period.start,end_time:i.fixed_period.end instanceof Date?i.fixed_period.end.toISOString():i.fixed_period.end}:void 0,calendar:i.calendar,rolling_window:i.rolling_window}),u=t=>t.callWS({type:"recorder/validate_statistics"}),h=(t,e,i)=>t.callWS({type:"recorder/update_statistics_metadata",statistic_id:e,unit_of_measurement:i}),f=(t,e)=>t.callWS({type:"recorder/clear_statistics",statistic_ids:e}),m=t=>{let e=null;if(!t)return null;for(const i of t)null!==i.change&&void 0!==i.change&&(null===e?e=i.change:e+=i.change);return e},p=(t,e)=>{let i=null;for(const a of e){if(!(a in t))continue;const e=m(t[a]);null!==e&&(null===i?i=e:i+=e)}return i},v=(t,e)=>t.some((t=>void 0!==t[e]&&null!==t[e])),b=66977!=i.j?["mean","min","max"]:null,y=66977!=i.j?["sum","state","change"]:null,g=(t,e)=>!(!b.includes(e)||t.mean_type===s.NONE)||!(!y.includes(e)||!t.has_sum),_=(t,e,i,a,s)=>{const n=new Date(i).toISOString();return t.callWS({type:"recorder/adjust_sum_statistics",statistic_id:e,start_time:n,adjustment:a,adjustment_unit_of_measurement:s})},k=(t,e,i)=>{const s=t.states[e];return s?(0,a.C)(s):i?.name||e},x=(t,e,i)=>{let a;return e&&(a=t.states[e]?.attributes.unit_of_measurement),void 0===a?i?.statistics_unit_of_measurement:a},w=t=>t.includes(":"),C=t=>t.callWS({type:"recorder/update_statistics_issues"})},20382:function(t,e,i){if(i.d(e,{FS:()=>d,Jb:()=>c,Tt:()=>l,c_:()=>o,oJ:()=>u,t6:()=>r,y4:()=>s,zt:()=>n}),66977!=i.j)var a=i(80027);let s=function(t){return t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none",t}({}),n=function(t){return t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24",t}({}),o=function(t){return t.local="local",t.server="server",t}({}),r=function(t){return t.language="language",t.system="system",t.DMY="DMY",t.MDY="MDY",t.YMD="YMD",t}({}),d=function(t){return t.language="language",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday",t.sunday="sunday",t}({});const l=t=>(0,a.Fl)(t.connection,"language"),c=(t,e)=>(0,a.DS)(t.connection,"language",e),u=async(t,e,i,a,s)=>(await t.callWS({type:"frontend/get_translations",language:e,category:i,integration:a,config_flow:s})).resources},69919:function(t,e,i){i.a(t,(async function(t,a){try{i.d(e,{EX:()=>f,Fj:()=>x,M$:()=>w,SO:()=>m,Sk:()=>v,TN:()=>S,UJ:()=>b,Ym:()=>C,hF:()=>p});i(9359),i(56475),i(70104);var s=i(73358);if(99387==i.j)var n=i(73850);if(99387==i.j)var o=i(59847);var r=i(75278),d=i(50602),l=i(1416);if(99387==i.j)var c=i(76131);if(99387==i.j)var u=i(72473);var h=t([d]);d=(h.then?(await h)():h)[0];let f=function(t){return t[t.INSTALL=1]="INSTALL",t[t.SPECIFIC_VERSION=2]="SPECIFIC_VERSION",t[t.PROGRESS=4]="PROGRESS",t[t.BACKUP=8]="BACKUP",t[t.RELEASE_NOTES=16]="RELEASE_NOTES",t}({});const m=t=>(0,r.e)(t,f.PROGRESS)&&null!==t.attributes.update_percentage,p=(t,e=!1)=>(t.state===s.uo||e&&Boolean(t.attributes.skipped_version))&&(0,r.e)(t,f.INSTALL),v=t=>!!t.attributes.in_progress,b=(t,e)=>t.callWS({type:"update/release_notes",entity_id:e}),y="ioBroker Core",g="ioBroker Supervisor",_="ioBroker Operating System",k=(t,e)=>Object.values(t).filter((t=>"update"===(0,o.N)(t))).sort(((t,i)=>t.attributes.title===y?-3:i.attributes.title===y?3:t.attributes.title===_?-2:i.attributes.title===_?2:t.attributes.title===g?-1:i.attributes.title===g?1:(0,l.fe)(t.attributes.title||t.attributes.friendly_name||"",i.attributes.title||i.attributes.friendly_name||"",e))),x=(t,e=!1)=>k(t).filter((t=>p(t,e))),w=async(t,e)=>{const i=k(e.states,e.locale.language).map((t=>t.entity_id));if(!i.length)return void(0,c.showAlertDialog)(t,{title:e.localize("ui.panel.config.updates.no_update_entities.title"),text:e.localize("ui.panel.config.updates.no_update_entities.description"),warning:!0});(0,u.C)(t,{message:e.localize("ui.panel.config.updates.checking_updates")});let a=0;const s=await e.connection.subscribeEvents((i=>{"update"===(0,n.M)(i.data.entity_id)&&(a++,(0,u.C)(t,{message:e.localize("ui.panel.config.updates.updates_refreshed",{count:a})}))}),"state_changed");await e.callService("homeassistant","update_entity",{entity_id:i}),await new Promise((t=>{setTimeout(t,15e3)})),s(),0===a&&(0,u.C)(t,{message:e.localize("ui.panel.config.updates.no_new_updates")})},C=(t,e)=>{const i=t.state,a=t.attributes;if("off"===i){return a.latest_version&&a.skipped_version===a.latest_version?a.latest_version:e.formatEntityState(t)}if("on"===i&&v(t)){return(0,r.e)(t,f.PROGRESS)&&null!==a.update_percentage?e.localize("ui.card.update.installing_with_progress",{progress:(0,d.uf)(a.update_percentage,e.locale,{maximumFractionDigits:a.display_precision,minimumFractionDigits:a.display_precision})}):e.localize("ui.card.update.installing")}return e.formatEntityState(t)},S=(t,e)=>{const i=t.entity_id,a=e[i]?.domain;if("hassio"!==a)return"generic";const s=t.attributes.title||"";return s===y?"home_assistant":[y,g,_].includes(s)?"generic":"addon"};a()}catch(t){a(t)}}))},76131:function(t,e,i){i.r(e),i.d(e,{loadGenericDialog:()=>s,showAlertDialog:()=>o,showConfirmationDialog:()=>r,showPromptDialog:()=>d});var a=i(36522);const s=()=>Promise.all([i.e("46379"),i.e("66031"),i.e("25618"),i.e("7442"),i.e("73201"),i.e("19145")]).then(i.bind(i,79740)),n=(t,e,i)=>new Promise((n=>{const o=e.cancel,r=e.confirm;(0,a.B)(t,"show-dialog",{dialogTag:"dialog-box",dialogImport:s,dialogParams:{...e,...i,cancel:()=>{n(!!i?.prompt&&null),o&&o()},confirm:t=>{n(!i?.prompt||t),r&&r(t)}}})})),o=(t,e)=>n(t,e),r=(t,e)=>n(t,e,{confirmation:!0}),d=(t,e)=>n(t,e,