UNPKG

iobroker.lovelace

Version:

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

40 lines 90 kB
(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[74194],{65522:function(t,e,a){"use strict";a.d(e,{A:function(){return i}});a(42762);const i=t=>{var e;return null===(e=t.name)||void 0===e?void 0:e.trim()}},55931:function(t,e,a){"use strict";a.d(e,{X:function(){return i}});a(42762);const i=t=>{var e;return null===(e=t.name)||void 0===e?void 0:e.trim()}},69093:function(t,e,a){"use strict";a.d(e,{t:function(){return o}});var i=a(71727);const o=t=>(0,i.m)(t.entity_id)},47129:function(t,e,a){"use strict";a.d(e,{a:function(){return r}});a(74423);var i=a(22675),o=a(71727);function r(t,e){const a=(0,o.m)(t.entity_id),r=void 0!==e?e:null==t?void 0:t.state;if(["button","event","infrared","input_button","radio_frequency","scene"].includes(a))return r!==i.Hh;if(r===i.Hh||r===i.HV)return!1;if("off"===r&&"alert"!==a)return!1;switch(a){case"alarm_control_panel":return"disarmed"!==r;case"alert":return"idle"!==r;case"cover":case"valve":return"closed"!==r;case"device_tracker":case"person":return"not_home"!==r;case"lawn_mower":return!["docked","paused"].includes(r);case"lock":return"locked"!==r;case"media_player":return"standby"!==r;case"vacuum":return!["idle","docked","paused"].includes(r);case"plant":return"problem"===r;case"group":return["on","home","open","locked","problem"].includes(r);case"timer":return"active"===r;case"camera":return"streaming"===r}return!0}},52658:function(t,e,a){"use strict";a.d(e,{ZK:function(){return u},gf:function(){return h},mT:function(){return g},Se:function(){return d},mg:function(){return p}});a(44114),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);var i=a(22675),o=a(68287),r=a(86030),s=a(80880);var n=a(71727),l=a(47129);const c=new Set(["alarm_control_panel","alert","automation","binary_sensor","calendar","camera","climate","cover","device_tracker","fan","group","humidifier","input_boolean","lawn_mower","light","lock","media_player","person","plant","remote","schedule","script","siren","sun","switch","timer","update","vacuum","valve","water_heater","weather"]),d=(t,e)=>{if((void 0!==e?e:null==t?void 0:t.state)===i.Hh)return"var(--state-unavailable-color)";const a=p(t,e);return a?(0,r.B)(a):void 0},h=(t,e,a)=>{const i=void 0!==a?a:e.state,o=(0,l.a)(e,a);return u(t,e.attributes.device_class,i,o)},u=(t,e,a,i)=>{const o=[],r=(0,s.Y)(a,"_"),n=i?"active":"inactive";return e&&o.push(`--state-${t}-${e}-${r}-color`),o.push(`--state-${t}-${r}-color`,`--state-${t}-${n}-color`,`--state-${n}-color`),o},p=(t,e)=>{const a=void 0!==e?e:null==t?void 0:t.state,i=(0,n.m)(t.entity_id),r=t.attributes.device_class;if("sensor"===i&&"battery"===r){const t=(t=>{const e=Number(t);if(!isNaN(e))return e>=70?"--state-sensor-battery-high-color":e>=30?"--state-sensor-battery-medium-color":"--state-sensor-battery-low-color"})(a);if(t)return[t]}if("group"===i){const a=(0,o.z)(t);if(a&&c.has(a))return h(a,t,e)}if(c.has(i))return h(i,t,e)},g=t=>{if(t.attributes.brightness&&"plant"!==(0,n.m)(t.entity_id)){return`brightness(${(t.attributes.brightness+245)/5}%)`}return""}},82286:function(t,e,a){"use strict";a.d(e,{$:function(){return i}});const i=(t,e)=>o(t.attributes,e),o=(t,e)=>0!==(t.supported_features&e)},78649:function(t,e,a){"use strict";a.d(e,{n:function(){return o}});a(27495);const i=/^(\w+)\.(\w+)$/,o=t=>i.test(t)},80880:function(t,e,a){"use strict";a.d(e,{Y:function(){return i}});a(84864),a(57465),a(27495),a(25440);const i=(t,e="_")=>{const a="àáâäæãåāăąабçćčđďдèéêëēėęěеёэфğǵгḧхîïíīįìıİийкłлḿмñńǹňнôöòóœøōõőоṕпŕřрßśšşșсťțтûüùúūǘůűųувẃẍÿýыžźżз·",i=`aaaaaaaaaaabcccdddeeeeeeeeeeefggghhiiiiiiiiijkllmmnnnnnoooooooooopprrrsssssstttuuuuuuuuuuvwxyyyzzzz${e}`,o=new RegExp(a.split("").join("|"),"g"),r={"ж":"zh","х":"kh","ц":"ts","ч":"ch","ш":"sh","щ":"shch","ю":"iu","я":"ia"};let s;return""===t?s="":(s=t.toString().toLowerCase().replace(o,t=>i.charAt(a.indexOf(t))).replace(/[а-я]/g,t=>r[t]||"").replace(/(\d),(?=\d)/g,"$1").replace(/[^a-z0-9]+/g,e).replace(new RegExp(`(${e})\\1+`,"g"),"$1").replace(new RegExp(`^${e}+`),"").replace(new RegExp(`${e}+$`),""),""===s&&(s="unknown")),s}},34470:function(t,e,a){"use strict";a.d(e,{E:function(){return o}});let i;const o=(0,a(5124).AH)(i||(i=(t=>t)`ha-state-icon[data-domain=alarm_control_panel][data-state=arming],ha-state-icon[data-domain=alarm_control_panel][data-state=pending],ha-state-icon[data-domain=alarm_control_panel][data-state=triggered],ha-state-icon[data-domain=lock][data-state=jammed]{animation:pulse 1s infinite}@keyframes pulse{0%{opacity:1}50%{opacity:0}100%{opacity:1}}ha-state-icon[data-state=unavailable]{color:var(--state-unavailable-color)}`))},60353:function(t,e,a){"use strict";a.d(e,{u:function(){return i}});class i{start(t){const e=Date.now();this._startY=t,this._startTime=e,this._lastY=t,this._lastTime=e,this._delta=0}move(t){const e=Date.now();return this._delta=this._startY-t,this._lastY=t,this._lastTime=e,this._delta}end(){const t=this.getVelocity(),e=Math.abs(t)>this._velocityThreshold;return{velocity:t,delta:this._delta,isSwipe:e,isDownwardSwipe:t>0}}getDelta(){return this._delta}getVelocity(){if(Date.now()-this._lastTime>=this._movementTimeThreshold)return 0;const t=this._lastTime-this._startTime;return t>0?(this._lastY-this._startY)/t:0}reset(){this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0}constructor(t={}){var e,a;this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0,this._velocityThreshold=null!==(e=t.velocitySwipeThreshold)&&void 0!==e?e:.5,this._movementTimeThreshold=null!==(a=t.movementTimeThreshold)&&void 0!==a?a:100}}},3931:function(t,e,a){"use strict";a.d(e,{U:function(){return i}});a(3362),a(62953);const i=async(t,e,a,i,o,...r)=>{let s=i[t];s||(s=i[t]={});const n=s[o];if(n)return n;const l=a(i,o,...r);return s[o]=l,l.then(()=>setTimeout(()=>{s[o]=void 0},e),()=>{s[o]=void 0}),l}},64481:function(t,e,a){"use strict";a.d(e,{D:function(){return o},J:function(){return s}});a(16280),a(3362),a(55815),a(64979),a(79739);let i=!1;try{i="true"===window.localStorage.getItem("disableViewTransition")}catch(n){}const o=t=>{i=t},r=t=>{if(!(t=>(t instanceof DOMException||t instanceof Error)&&"AbortError"===t.name)(t))throw t},s=t=>{if(!document.startViewTransition||i)return t(!1),Promise.resolve();let e=!1;try{const a=document.startViewTransition(()=>{e=!0,t(!0)});return a.ready.catch(r),a.finished.catch(r)}catch(a){return console.warn("View transition failed, falling back to direct execution.",a),e?Promise.reject(a):(t(!1),Promise.resolve())}}},5745:function(t,e,a){"use strict";var i=a(40445),o=a(99731),r=a(67576);class s extends o.Y{}s=(0,i.Cg)([(0,r.EM)("ha-chip-set")],s)},82474:function(t,e,a){"use strict";a.a(t,async function(t,e){try{a(13609),a(18111),a(20116),a(61701),a(3362),a(62953);var i=a(40445),o=a(5124),r=a(67576),s=a(22786),n=a(1087),l=a(74705),c=a(78649),d=a(53756),h=a(95350),u=a(24367),p=a(19711),g=(a(75064),a(38508)),f=(a(47680),a(67094),a(74281)),v=t([g,f]);[g,f]=v.then?(await v)():v;let b,m,_,y,w,C,k,x,$,L,E,M,S,T,A,O=t=>t;const I="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",j="M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z",z="___create-new-entity___";class H extends o.WF{willUpdate(t){var e;this._pendingEntityId&&t.has("hass")&&this.hass.states!==(null===(e=t.get("hass"))||void 0===e?void 0:e.states)&&this.hass.states[this._pendingEntityId]&&(this._setValue(this._pendingEntityId),this._pendingEntityId=void 0)}firstUpdated(t){super.firstUpdated(t),this.hass.loadBackendTranslation("title")}_findExtraOption(t){var e;return t?null===(e=this.extraOptions)||void 0===e?void 0:e.find(e=>e.id===t):void 0}_renderExtraOptionStart(t){const e=t.entity_id?this.hass.states[t.entity_id]:void 0;return e?(0,o.qy)(b||(b=O` <state-badge slot="start" .stateObj="${0}" .hass="${0}"></state-badge> `),e,this.hass):t.icon_path?(0,o.qy)(m||(m=O` <ha-svg-icon slot="start" .path="${0}" style="margin:0 4px"></ha-svg-icon> `),t.icon_path):t.icon?(0,o.qy)(_||(_=O`<ha-icon slot="start" .icon="${0}"></ha-icon>`),t.icon):o.s6}get _showEntityId(){var t;return this.showEntityId||(null===(t=this.hass.userData)||void 0===t?void 0:t.showEntityIdPicker)}_shouldHideClearIcon(){var t;return!(null===(t=this._findExtraOption(this.value))||void 0===t||!t.hide_clear)}render(){var t,e;const a=null!==(t=this.placeholder)&&void 0!==t?t:this.hass.localize("ui.components.entity.entity-picker.placeholder");return(0,o.qy)(y||(y=O` <ha-generic-picker .hass="${0}" .disabled="${0}" .autofocus="${0}" .allowCustomValue="${0}" .required="${0}" .label="${0}" .placeholder="${0}" .helper="${0}" .value="${0}" .searchLabel="${0}" .notFoundLabel="${0}" .rowRenderer="${0}" .getItems="${0}" .getAdditionalItems="${0}" .hideClearIcon="${0}" .searchFn="${0}" .valueRenderer="${0}" .searchKeys="${0}" use-top-label .addButtonLabel="${0}" .unknownItemText="${0}" @value-changed="${0}"> </ha-generic-picker> `),this.hass,this.disabled,this.autofocus,this.allowCustomEntity,this.required,this.label,a,this.helper,this.addButton?void 0:this.value,this.searchLabel,this._notFoundLabel,this._rowRenderer,this._getItems,this._getAdditionalItems,this.hideClearIcon||this._shouldHideClearIcon(),this._searchFn,this._valueRenderer,d.t,this.addButton?null!==(e=this.addButtonLabel)&&void 0!==e?e:this.hass.localize("ui.components.entity.entity-picker.add"):void 0,this.hass.localize("ui.components.entity.entity-picker.unknown"),this._valueChanged)}async open(){var t;await this.updateComplete,await(null===(t=this._picker)||void 0===t?void 0:t.open())}_valueChanged(t){t.stopPropagation();const e=t.detail.value;if(e){if(e.startsWith(z)){const t=e.substring(z.length);return void(0,p.$)(this,{domain:t,dialogClosedCallback:t=>{t.entityId&&(this.hass.states[t.entityId]?this._setValue(t.entityId):this._pendingEntityId=t.entityId)}})}((0,c.n)(e)||this._findExtraOption(e))&&this._setValue(e)}else this._setValue(void 0)}_setValue(t){this.value=t,(0,n.r)(this,"value-changed",{value:t}),(0,n.r)(this,"change")}constructor(...t){super(...t),this.autofocus=!1,this.disabled=!1,this.required=!1,this.showEntityId=!1,this.hideClearIcon=!1,this.addButton=!1,this._valueRenderer=t=>{const e=t||"",a=this._findExtraOption(e);if(a)return(0,o.qy)(w||(w=O` ${0} <span slot="headline">${0}</span> ${0} `),this._renderExtraOptionStart(a),a.primary,a.secondary?(0,o.qy)(C||(C=O`<span slot="supporting-text">${0}</span>`),a.secondary):o.s6);const i=this.hass.states[e];if(!i)return(0,o.qy)(k||(k=O` <ha-svg-icon slot="start" .path="${0}" style="margin:0 4px"></ha-svg-icon> <span slot="headline">${0}</span> `),j,e);const{primary:r,secondary:s}=(0,l.Bj)(this.hass,i);return(0,o.qy)(x||(x=O` <state-badge .hass="${0}" .stateObj="${0}" slot="start"></state-badge> <span slot="headline">${0}</span> <span slot="supporting-text">${0}</span> `),this.hass,i,r,s)},this._rowRenderer=(t,e)=>{const a=this._showEntityId;return(0,o.qy)($||($=O` <ha-combo-box-item type="button" compact="compact" .borderTop="${0}"> ${0} <span slot="headline">${0}</span> ${0} ${0} ${0} </ha-combo-box-item> `),0!==e,t.icon_path?(0,o.qy)(L||(L=O` <ha-svg-icon slot="start" style="margin:0 4px" .path="${0}"></ha-svg-icon> `),t.icon_path):(0,o.qy)(E||(E=O` <state-badge slot="start" .stateObj="${0}" .hass="${0}"></state-badge> `),t.stateObj,this.hass),t.primary,t.secondary?(0,o.qy)(M||(M=O`<span slot="supporting-text">${0}</span>`),t.secondary):o.s6,t.stateObj&&a?(0,o.qy)(S||(S=O` <span slot="supporting-text" class="code"> ${0} </span> `),t.stateObj.entity_id):o.s6,t.domain_name&&!a?(0,o.qy)(T||(T=O` <div slot="trailing-supporting-text" class="domain"> ${0} </div> `),t.domain_name):o.s6)},this._getAdditionalItems=()=>this._getCreateItems(this.hass.localize,this.createDomains),this._getCreateItems=(0,s.A)((t,e)=>null!=e&&e.length?(this.hass.loadFragmentTranslation("config"),e.map(e=>{const a=t("ui.components.entity.entity-picker.create_helper",{domain:(0,u.z)(e)?t(`ui.panel.config.helpers.types.${e}`)||e:(0,h.p$)(t,e)});return{id:z+e,primary:a,secondary:t("ui.components.entity.entity-picker.new_entity"),icon_path:I}})):[]),this._getEntitiesMemoized=(0,s.A)(d.w),this._getItems=()=>{var t;const e=this._getEntitiesMemoized(this.hass,this.includeDomains,this.excludeDomains,this.entityFilter,this.includeDeviceClasses,this.includeUnitOfMeasurement,this.includeEntities,this.excludeEntities,this.value);if(null!==(t=this.extraOptions)&&void 0!==t&&t.length){return[...this.extraOptions.map(t=>Object.assign(Object.assign({},t),{},{stateObj:t.entity_id?this.hass.states[t.entity_id]:void 0})),...e]}return e},this._searchFn=(t,e)=>{const a=e.findIndex(e=>{var a;return(null===(a=e.stateObj)||void 0===a?void 0:a.entity_id)===t});if(-1===a)return e;const[i]=e.splice(a,1);return e.unshift(i),e},this._notFoundLabel=t=>this.hass.localize("ui.components.entity.entity-picker.no_match",{term:(0,o.qy)(A||(A=O`<b>‘${0}’</b>`),t)})}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],H.prototype,"hass",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],H.prototype,"autofocus",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],H.prototype,"disabled",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],H.prototype,"required",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"allow-custom-entity"})],H.prototype,"allowCustomEntity",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"show-entity-id"})],H.prototype,"showEntityId",void 0),(0,i.Cg)([(0,r.MZ)()],H.prototype,"label",void 0),(0,i.Cg)([(0,r.MZ)()],H.prototype,"value",void 0),(0,i.Cg)([(0,r.MZ)()],H.prototype,"helper",void 0),(0,i.Cg)([(0,r.MZ)()],H.prototype,"placeholder",void 0),(0,i.Cg)([(0,r.MZ)({type:String,attribute:"search-label"})],H.prototype,"searchLabel",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],H.prototype,"createDomains",void 0),(0,i.Cg)([(0,r.MZ)({type:Array,attribute:"include-domains"})],H.prototype,"includeDomains",void 0),(0,i.Cg)([(0,r.MZ)({type:Array,attribute:"exclude-domains"})],H.prototype,"excludeDomains",void 0),(0,i.Cg)([(0,r.MZ)({type:Array,attribute:"include-device-classes"})],H.prototype,"includeDeviceClasses",void 0),(0,i.Cg)([(0,r.MZ)({type:Array,attribute:"include-unit-of-measurement"})],H.prototype,"includeUnitOfMeasurement",void 0),(0,i.Cg)([(0,r.MZ)({type:Array,attribute:"include-entities"})],H.prototype,"includeEntities",void 0),(0,i.Cg)([(0,r.MZ)({type:Array,attribute:"exclude-entities"})],H.prototype,"excludeEntities",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],H.prototype,"entityFilter",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],H.prototype,"extraOptions",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"hide-clear-icon",type:Boolean})],H.prototype,"hideClearIcon",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"add-button",type:Boolean})],H.prototype,"addButton",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"add-button-label"})],H.prototype,"addButtonLabel",void 0),(0,i.Cg)([(0,r.P)("ha-generic-picker")],H.prototype,"_picker",void 0),(0,i.Cg)([(0,r.wk)()],H.prototype,"_pendingEntityId",void 0),H=(0,i.Cg)([(0,r.EM)("ha-entity-picker")],H),e()}catch(b){e(b)}})},74281:function(t,e,a){"use strict";a.a(t,async function(t,e){try{a(18111),a(7588),a(45367),a(92731),a(62953);var i=a(40445),o=a(5124),r=a(67576),s=a(63672),n=a(89784),l=a(71727),c=a(69093),d=a(52658),h=a(34470),u=a(10897),p=a(38279),g=a(93367),f=t([g]);g=(f.then?(await f)():f)[0];let v,b,m,_=t=>t;const y="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z";class w extends o.WF{connectedCallback(){var t,e;super.connectedCallback(),this.hasUpdated&&void 0===this.overrideImage&&(null!==(t=this.stateObj)&&void 0!==t&&t.attributes.entity_picture||null!==(e=this.stateObj)&&void 0!==e&&e.attributes.entity_picture_local)&&this.requestUpdate("stateObj")}disconnectedCallback(){var t,e;super.disconnectedCallback(),void 0===this.overrideImage&&(null!==(t=this.stateObj)&&void 0!==t&&t.attributes.entity_picture||null!==(e=this.stateObj)&&void 0!==e&&e.attributes.entity_picture_local)&&(this.style.backgroundImage="")}get _stateColor(){var t;const e=this.stateObj?(0,c.t)(this.stateObj):void 0;return null!==(t=this.stateColor)&&void 0!==t?t:"light"===e}render(){const t=this.stateObj;if(!t&&!this.overrideIcon&&!this.overrideImage)return(0,o.qy)(v||(v=_`<div class="missing"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div>`),y);const e=this.getClass();if(e&&e.forEach((t,e)=>{t?this.classList.add(e):this.classList.remove(e)}),!this.icon)return o.s6;const a=t?(0,c.t)(t):void 0;return(0,o.qy)(b||(b=_`<ha-state-icon style="${0}" data-domain="${0}" data-state="${0}" .icon="${0}" .stateObj="${0}"></ha-state-icon>`),(0,n.W)(this._iconStyle),(0,s.J)(a),(0,s.J)(null==t?void 0:t.state),this.overrideIcon,t)}willUpdate(t){if(super.willUpdate(t),!(t.has("stateObj")||t.has("overrideImage")||t.has("overrideIcon")||t.has("stateColor")||t.has("color")))return;const e=this.stateObj,a={};let i="";if(this.icon=!0,e){const t=(0,l.m)(e.entity_id);if(void 0===this.overrideImage)if(!e.attributes.entity_picture_local&&!e.attributes.entity_picture||this.overrideIcon){if(this.color)a.color=this.color;else if(this._stateColor){const t=(0,d.Se)(e);if(t&&(a.color=t),e.attributes.rgb_color&&(a.color=`rgb(${e.attributes.rgb_color.join(",")})`),e.attributes.brightness){const t=e.attributes.brightness;if("number"!=typeof t){const a=`Type error: state-badge expected number, but type of ${e.entity_id}.attributes.brightness is ${typeof t} (${t})`;console.warn(a)}a.filter=(0,d.mT)(e)}if(e.attributes.hvac_action){const t=e.attributes.hvac_action;t in p.sx?a.color=(0,d.Se)(e,p.sx[t]):delete a.color}}}else{let a=e.attributes.entity_picture_local||e.attributes.entity_picture;this.hass&&(a=this.hass.hassUrl(a)),"camera"===t&&(a=(0,u.su)(a,80,80)),i=`url(${a})`,this.icon=!1}else if(this.overrideImage){let t=this.overrideImage;this.hass&&(t=this.hass.hassUrl(t)),i=`url(${t})`,this.icon=!1}}this._iconStyle=a,this.style.backgroundImage=i}getClass(){const t=new Map(["has-no-radius","has-media-image","has-image"].map(t=>[t,!1]));if(this.stateObj){const e=(0,l.m)(this.stateObj.entity_id);"update"===e?t.set("has-no-radius",!0):"media_player"===e||"camera"===e?t.set("has-media-image",!0):""!==this.style.backgroundImage&&t.set("has-image",!0)}return t}static get styles(){return[h.E,(0,o.AH)(m||(m=_`:host{position:relative;display:inline-flex;width:40px;color:var(--state-icon-color);border-radius:var(--state-badge-border-radius,50%);height:40px;background-size:cover;box-sizing:border-box;--state-inactive-color:initial;align-items:center;justify-content:center}:host(.has-image){border-radius:var(--state-badge-with-image-border-radius,50%)}:host(.has-media-image){border-radius:var(--state-badge-with-media-image-border-radius,8%)}:host(.has-no-radius){border-radius:var(--ha-border-radius-square)}:host(:focus){outline:0}:host(:not([icon]):focus){border:2px solid var(--divider-color)}:host([icon]:focus){background:var(--divider-color)}ha-state-icon{transition:color .3s ease-in-out,filter .3s ease-in-out}.missing{color:#fce588}`))]}constructor(...t){super(...t),this.icon=!0,this._iconStyle={}}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"stateObj",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"overrideIcon",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"overrideImage",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],w.prototype,"stateColor",void 0),(0,i.Cg)([(0,r.MZ)()],w.prototype,"color",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],w.prototype,"icon",void 0),(0,i.Cg)([(0,r.wk)()],w.prototype,"_iconStyle",void 0),w=(0,i.Cg)([(0,r.EM)("state-badge")],w),e()}catch(v){e(v)}})},99611:function(t,e,a){"use strict";a.a(t,async function(t,e){try{a(18111),a(13579),a(3362),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);var i=a(40445),o=a(1126),r=a(35211),s=a(5124),n=a(67576),l=a(1087),c=a(60353),d=a(22792),h=a(59992),u=a(14503),p=a(22348),g=t([o,h]);[o,h]=g.then?(await g)():g;let f,v,b=t=>t;const m=300,_=new Set(["ha-control-slider","ha-slider","ha-control-switch","ha-control-circular-slider","ha-hs-color-picker","ha-map","ha-more-info-control-select-container","ha-filter-chip"]),y=new Set(["volume-slider-container","forecast"]);class w extends((0,h.V)(s.WF)){get scrollableElement(){return this._bodyElement}connectedCallback(){super.connectedCallback(),this.addEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.addEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0})}updated(t){super.updated(t),t.has("open")&&(this._drawerOpen=this.open)}render(){return(0,s.qy)(f||(f=b` <wa-drawer id="drawer" placement="bottom" .open="${0}" .lightDismiss="${0}" .ariaLabelledby="${0}" .ariaDescribedby="${0}" @keydown="${0}" @wa-show="${0}" @wa-after-show="${0}" @wa-hide="${0}" @wa-after-hide="${0}" @click="${0}" without-header @touchstart="${0}"> <div class="handle-wrapper" aria-hidden="true"> <div class="handle"></div> </div> <slot name="header"></slot> <div class="content-wrapper"> <div id="body" class="body ha-scrollbar"> <slot></slot> </div> ${0} </div> <slot name="footer"></slot> </wa-drawer> `),this._drawerOpen,!this.preventScrimClose,this.ariaLabelledBy,this.ariaDescribedBy,this._handleKeyDown,this._handleShow,this._handleAfterShow,this._handleHide,this._handleAfterHide,this._handleCloseAction,this._handleTouchStart,this.renderScrollableFades())}_startResizing(t){document.addEventListener("touchmove",this._handleTouchMove,{passive:!1}),document.addEventListener("touchend",this._handleTouchEnd),document.addEventListener("touchcancel",this._handleTouchEnd),this._gestureRecognizer.start(t)}_animateSnapBack(){this.style.setProperty("--dialog-transition",`transform ${m}ms ease-out`),this.style.removeProperty("--dialog-transform"),setTimeout(()=>{this.style.removeProperty("--dialog-transition")},m)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.removeEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0}),this._unregisterResizeHandlers(),this._isDragging=!1}static get styles(){return[...super.styles,u.dp,(0,s.AH)(v||(v=b`wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:${0}ms;--hide-duration:${0}ms}wa-drawer::part(dialog){max-height:min(var(--ha-bottom-sheet-max-height,90vh),calc(100vh - max(var(--safe-area-inset-top),48px)));max-height:min(var(--ha-bottom-sheet-max-height,90dvh),calc(100dvh - max(var(--safe-area-inset-top),48px)));align-items:center;transform:var(--dialog-transform);transition:var(--dialog-transition)}@media (prefers-reduced-motion:reduce){wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:1ms;--hide-duration:1ms}wa-drawer::part(dialog){transition:1ms}}wa-drawer::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));background-color:var(--ha-bottom-sheet-scrim-color,var(--mdc-dialog-scrim-color,none))}wa-drawer::part(body){max-width:var(--ha-bottom-sheet-max-width);width:100%;position:relative;border-top-left-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));border-top-right-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));background-color:var(--ha-bottom-sheet-surface-background,var(--ha-dialog-surface-background,var(--card-background-color,var(--ha-color-surface-default))));-webkit-backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));padding:var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left))}:host([flexcontent]) wa-drawer::part(body){display:flex;flex-direction:column}:host([prevent-scrim-close]) .handle-wrapper{display:none}.handle-wrapper{position:absolute;top:0;inset-inline-start:0;width:100%;padding-bottom:2px;display:flex;justify-content:center;align-items:center;pointer-events:none;z-index:1}.handle-wrapper .handle{height:16px;width:200px;display:flex;justify-content:center;align-items:center}.handle-wrapper .handle::after{content:"";border-radius:var(--ha-border-radius-md);height:4px;background:var(--ha-bottom-sheet-handle-color,var(--divider-color));width:40px}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{padding:var(--ha-bottom-sheet-content-padding,0);box-sizing:border-box}:host([flexcontent]) .body{flex:1;max-width:100%;display:flex;flex-direction:column;padding:var(--ha-bottom-sheet-content-padding,var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left)));box-sizing:border-box}slot[name=footer]{display:block;padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%;box-sizing:border-box}:host([flexcontent]) slot[name=footer]{flex-shrink:0}`),m,m)]}constructor(...t){super(...t),this.open=!1,this.flexContent=!1,this.preventScrimClose=!1,this._drawerOpen=!1,this._sliderInteractionActive=!1,this._gestureRecognizer=new c.u,this._isDragging=!1,this._escapePressed=!1,this._handleShow=async()=>{this._drawerOpen=!0,this.open=!0,(0,l.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{var t;const e=this._autofocusElement;null!==(t=this._hassConfig)&&void 0!==t&&t.auth.external&&(0,p.V)(this._hassConfig.auth.external)?e&&(e.id||(e.id="ha-bottom-sheet-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})):null==e||e.focus()})},this._handleAfterShow=()=>{(0,l.r)(this,"after-show")},this._handleSliderInteractionStart=()=>{this._sliderInteractionActive=!0},this._handleSliderInteractionStop=()=>{this._sliderInteractionActive=!1},this._handleAfterHide=t=>{if(this._sliderInteractionActive)return this._drawerOpen=!0,void(this.open=!0);t.eventPhase===Event.AT_TARGET&&(this.open=!1,this._drawerOpen=!1,(0,l.r)(this,"closed"))},this._handleHide=t=>{if(t.eventPhase!==Event.AT_TARGET)return;const e=t.detail.source===t.target.drawer;if(this._sliderInteractionActive)return t.preventDefault(),this._drawerOpen=!0,this.open=!0,void(this._escapePressed=!1);this.preventScrimClose&&this._escapePressed&&e&&t.preventDefault(),this._escapePressed=!1},this._handleKeyDown=t=>{"Escape"===t.key&&(this._escapePressed=!0,this.preventScrimClose&&t.preventDefault(),t.stopPropagation(),t.currentTarget.open=!1)},this._handleCloseAction=t=>{t.composedPath().some(t=>t instanceof HTMLElement&&("close"===t.getAttribute("data-dialog")||"close"===t.getAttribute("data-drawer")))&&(this._drawerOpen=!1)},this._handleTouchStart=t=>{if(this.preventScrimClose)return;const e=t.composedPath();for(const a of e){if(a===this._drawer)break;if(a instanceof HTMLElement&&(a.scrollTop>0||_.has(a.localName)||Array.from(a.classList).some(t=>y.has(t))))return}t.stopPropagation(),this._startResizing(t.touches[0].clientY)},this._handleTouchMove=t=>{const e=t.touches[0].clientY,a=this._gestureRecognizer.move(e);a<0&&(t.preventDefault(),this._isDragging=!0,requestAnimationFrame(()=>{this._isDragging&&this.style.setProperty("--dialog-transform",`translateY(${-1*a}px)`)}))},this._handleTouchEnd=()=>{var t;this._unregisterResizeHandlers(),this._isDragging=!1;const e=this._gestureRecognizer.end();if(e.isSwipe)return void(e.isDownwardSwipe?this._drawerOpen=!1:this._animateSnapBack());const a=null===(t=this._drawer.shadowRoot)||void 0===t?void 0:t.querySelector('[part="body"]'),i=(null==a?void 0:a.offsetHeight)||0;i>0&&e.delta<0&&Math.abs(e.delta)>.5*i?this._drawerOpen=!1:this._animateSnapBack()},this._unregisterResizeHandlers=()=>{document.removeEventListener("touchmove",this._handleTouchMove),document.removeEventListener("touchend",this._handleTouchEnd),document.removeEventListener("touchcancel",this._handleTouchEnd)}}}(0,i.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],w.prototype,"ariaLabelledBy",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],w.prototype,"ariaDescribedBy",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],w.prototype,"open",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],w.prototype,"flexContent",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],w.prototype,"preventScrimClose",void 0),(0,i.Cg)([(0,n.wk)()],w.prototype,"_drawerOpen",void 0),(0,i.Cg)([(0,n.wk)()],w.prototype,"_sliderInteractionActive",void 0),(0,i.Cg)([(0,n.wk)(),(0,r.Fg)({context:d.WF,subscribe:!0})],w.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,n.P)("#drawer")],w.prototype,"_drawer",void 0),(0,i.Cg)([(0,n.P)("#body")],w.prototype,"_bodyElement",void 0),(0,i.Cg)([(0,n.P)("[autofocus]")],w.prototype,"_autofocusElement",void 0),w=(0,i.Cg)([(0,n.EM)("ha-bottom-sheet")],w),e()}catch(f){e(f)}})},93444:function(t,e,a){"use strict";var i=a(40445),o=a(5124),r=a(67576);let s,n,l=t=>t;class c extends o.WF{render(){return(0,o.qy)(s||(s=l` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `))}static get styles(){return[(0,o.AH)(n||(n=l`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`))]}}c=(0,i.Cg)([(0,r.EM)("ha-dialog-footer")],c)},76538:function(t,e,a){"use strict";a(62953);var i=a(40445),o=a(5124),r=a(67576);let s,n,l,c,d,h,u=t=>t;class p extends o.WF{render(){const t=(0,o.qy)(s||(s=u`<div class="header-title"> <slot name="title"></slot> </div>`)),e=(0,o.qy)(n||(n=u`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`));return(0,o.qy)(l||(l=u` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${0} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `),"above"===this.subtitlePosition?(0,o.qy)(c||(c=u`${0}${0}`),e,t):(0,o.qy)(d||(d=u`${0}${0}`),t,e))}static get styles(){return[(0,o.AH)(h||(h=u`:host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:center;padding:0 var(--ha-space-1);box-sizing:border-box}.header-content{flex:1;padding:10px var(--ha-space-1);display:flex;flex-direction:column;justify-content:center;min-height:var(--ha-space-12);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{height:var(--ha-dialog-header-title-height,calc(var(--ha-font-size-xl) + var(--ha-space-1)));font-size:var(--ha-font-size-xl);line-height:var(--ha-line-height-condensed);font-weight:var(--ha-font-weight-medium);color:var(--ha-dialog-header-title-color,var(--primary-text-color))}.header-subtitle{font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal);color:var(--ha-dialog-header-subtitle-color,var(--secondary-text-color))}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:0 var(--ha-space-2)}}.header-navigation-icon{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}`))]}constructor(...t){super(...t),this.subtitlePosition="below",this.showBorder=!1}}(0,i.Cg)([(0,r.MZ)({type:String,attribute:"subtitle-position"})],p.prototype,"subtitlePosition",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],p.prototype,"showBorder",void 0),p=(0,i.Cg)([(0,r.EM)("ha-dialog-header")],p)},72554:function(t,e,a){"use strict";a.a(t,async function(t,e){try{a(3362),a(62953),a(49255);var i=a(40445),o=a(93900),r=a(35211),s=a(5124),n=a(67576),l=a(63672),c=a(1087),d=a(64481),h=a(22792),u=a(59992),p=a(14503),g=a(22348),f=(a(76538),a(26300)),v=t([o,f,u]);[o,f,u]=v.then?(await v)():v;let b,m,_,y,w,C,k,x=t=>t;const $="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z";class L extends((0,u.V)(s.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(t){super.updated(t),t.has("open")&&(this._open=this.open)}render(){var t,e,a;return(0,s.qy)(b||(b=x` <wa-dialog .open="${0}" .lightDismiss="${0}" without-header aria-labelledby="${0}" aria-describedby="${0}" @keydown="${0}" @wa-hide="${0}" @wa-show="${0}" @wa-after-show="${0}" @wa-after-hide="${0}"> ${0} <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${0}"> <slot></slot> </div> ${0} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `),this._open,!this.preventScrimClose,(0,l.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0)),(0,l.J)(this.ariaDescribedBy),this._handleKeyDown,this._handleHide,this._handleShow,this._handleAfterShow,this._handleAfterHide,this.withoutHeader?s.s6:(0,s.qy)(m||(m=x`<slot name="header"> <ha-dialog-header .subtitlePosition="${0}" .showBorder="${0}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${0}" .path="${0}"></ha-icon-button> </slot> ${0} ${0} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`),this.headerSubtitlePosition,this._bodyScrolled,null!==(t=null===(e=this._i18n)||void 0===e||null===(a=e.localize)||void 0===a?void 0:a.call(e,"ui.common.close"))&&void 0!==t?t:"Close",$,void 0!==this.headerTitle?(0,s.qy)(_||(_=x`<span slot="title" class="title" id="ha-dialog-title"> ${0} </span>`),this.headerTitle):(0,s.qy)(y||(y=x`<slot name="headerTitle" slot="title"></slot>`)),void 0!==this.headerSubtitle?(0,s.qy)(w||(w=x`<span slot="subtitle">${0}</span>`),this.headerSubtitle):(0,s.qy)(C||(C=x`<slot name="headerSubtitle" slot="subtitle"></slot>`))),this._handleBodyScroll,this.renderScrollableFades())}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(t){this._open?(0,d.J)(()=>{this._setFullscreen(t.detail)}):this._setFullscreen(t.detail)}_setFullscreen(t){this.toggleAttribute("fullscreen",t)}_handleBodyScroll(t){this._bodyScrolled=t.target.scrollTop>0}_handleKeyDown(t){"Escape"===t.key&&(this._escapePressed=!0,this.preventScrimClose&&t.preventDefault(),t.stopPropagation(),t.currentTarget.open=!1)}_handleHide(t){var e;const a=(null===(e=t.detail)||void 0===e?void 0:e.source)===t.target.dialog;this.preventScrimClose&&this._escapePressed&&a&&t.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,p.dp,(0,s.AH)(k||(k=x`wa-dialog{--full-width:var(
            --ha-dialog-width-full,
            min(95vw, var(--safe-width))
          );--width:min(var(--ha-dialog-width-md, 580px), var(--full-width));--spacing:var(--dialog-content-padding, var(--ha-space-6));--show-duration:var(--ha-dialog-show-duration, 200ms);--hide-duration:var(--ha-dialog-hide-duration, 200ms);--wa-color-surface-raised:var(
            --ha-dialog-surface-background,
            var(--card-background-color, var(--ha-color-surface-default))
          );--wa-panel-border-radius:var(
            --ha-dialog-border-radius,
            var(--ha-border-radius-3xl)
          );max-width:var(--ha-dialog-max-width,var(--safe-width))}@media (prefers-reduced-motion:reduce){wa-dialog{--show-duration:0ms;--hide-duration:0ms}}:host([width=small]) wa-dialog{--width:min(var(--ha-dialog-width-sm, 320px), var(--full-width))}:host([width=large]) wa-dialog{--width:min(var(--ha-dialog-width-lg, 1024px), var(--full-width))}:host([fullscreen]) wa-dialog,:host([width=full]) wa-dialog{--width:var(--full-width)}:host([fullscreen]) wa-dialog::part(dialog){min-height:var(--safe-height);max-height:var(--safe-height);margin-top:0;transform:none}:host([fullscreen]) .content-wrapper{overflow:hidden}:host([fullscreen]) .body{overflow:hidden;padding:0}wa-dialog::part(dialog){-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);box-shadow:var(--dialog-box-shadow,var(--wa-shadow-l));color:var(--primary-text-color);min-width:var(--width,var(--full-width));max-width:var(--width,var(--full-width));max-height:var(--ha-dialog-max-height,calc(var(--safe-height) - var(--ha-space-20)));min-height:var(--ha-dialog-min-height);margin-top:var(--dialog-surface-margin-top,auto);transform:translate(calc(var(--safe-area-offset-left,0px) - var(--safe-area-offset-right,0px)),calc(var(--safe-area-offset-top,0px) - var(--safe-area-offset-bottom,0px)));display:flex;flex-direction:column;overflow:hidden}wa-dialog::part(dialog)::backdrop{-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));background-color:var(--mdc-dialog-scrim-color,none)}@media all and (max-width:450px),all and (max-height:500px){:host([type=standard]){--ha-dialog-border-radius:0}:host([type=standard]) wa-dialog{--full-width:var(--ha-dialog-width-full, 100vw);--width:var(--full-width)}:host([type=standard]) wa-dialog::part(dialog){min-height:var(--ha-dialog-min-height,100vh);min-height:var(--ha-dialog-min-height,100dvh);max-height:var(--ha-dialog-max-height,100vh);max-height:var(--ha-dialog-max-height,100dvh);margin-top:0;margin-bottom:0;padding-top:var(--safe-area-inset-top);padding-bottom:var(--safe-area-inset-bottom);padding-left:var(--safe-area-inset-left);padding-right:var(--safe-area-inset-right);transform:none}}.header-title-container{display:flex;align-items:center}.header-title{margin:0;margin-bottom:0;color:var(--ha-dialog-header-title-color,var(--primary-text-color));font-size:var(
            --ha-dialog-header-title-font-size,
            var(--ha-font-size-2xl)
          );line-height:var(
            --ha-dialog-header-title-line-height,
            var(--ha-line-height-condensed)
          );font-weight:var(--ha-dialog-header-title-font-weight,var(--ha-font-weight-normal));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:var(--ha-space-3)}wa-dialog::part(body){padding:0;display:flex;flex-direction:column;max-width:100%;overflow:hidden}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6));overflow:auto;flex-grow:1}:host([flexcontent]) .body{max-width:100%;flex:1;display:flex;flex-direction:column}wa-dialog::part(footer){padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`))]}constructor(...t){super(...t),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.flexContent=!1,this.withoutHeader=!1,this._open=!1,this._bodyScrolled=!1,this._escapePressed=!1,this._handleShow=async t=>{t.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,c.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{var t,e;if(null!==(t=this._hassConfig)&&void 0!==t&&t.auth.external&&(0,g.V)(this._hassConfig.auth.external)){const t=this.querySelector("[autofocus]");return void(null!==t&&(t.id||(t.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:t.id}})))}null===(e=this.querySelector("[autofocus]"))||void 0===e||e.focus()}))},this._handleAfterShow=t=>{t.eventPhase===Event.AT_TARGET&&(0,c.r)(this,"after-show")},this._handleAfterHide=t=>{t.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,c.r)(this,"closed"))}}}(0,i.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],L.prototype,"ariaLabelledBy",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],L.prototype,"ariaDescribedBy",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],L.prototype,"open",void 0),(0,i.Cg)([(0,n.MZ)({reflect:!0})],L.prototype,"type",void 0),(0,i.Cg)([(0,n.MZ)({type:String,reflect:!0,attribute:"width"})],L.prototype,"width",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],L.prototype,"preventScrimClose",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"header-title"})],L.prototype,"headerTitle",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"header-subtitle"})],L.prototype,"headerSubtitle",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"header-subtitle-position"})],L.prototype,"headerSubtitlePosition",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],L.prototype,"flexContent",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"without-header"})],L.prototype,"withoutHeader",void 0),(0,i.Cg)([(0,n.wk)()],L.prototype,"_open",void 0),(0,i.Cg)([(0,n.P)(".body")],L.prototype,"bodyContainer",void 0),(0,i.Cg)([(0,n.wk)(),(0,r.Fg)({context:h.D5,subscribe:!0})],L.prototype,"_i18n",void 0),(0,i.Cg)([(0,n.wk)(),(0,r.Fg)({context:h.WF,subscribe:!0})],L.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,n.wk)()],L.prototype,"_bodyScrolled",void 0),(0,i.Cg)([(0,n.Ls)({passive:!0})],L.prototype,"_handleBodyScroll",null),L=(0,i.Cg)([(0,n.EM)("ha-dialog")],L),e()}catch(b){e(b)}})},47680:function(t,e,a){"use strict";a.r(e),a.d(e,{HaIcon:function(){return L}});a(74423),a(3362),a(62953);var i=a(40445),o=a(5124),r=a(67576),s=a(1087),n=a(9899),l=a(700),c=(a(44114),a(18111),a(7588),a(96167),a(95192)),d=a(7553);const h=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"}]}');let u;const p=()=>(u||(u=g().catch(t=>{throw u=void 0,t})),u),g=async()=>{const t=(0,c.y$)("hass-icon-db","mdi-icon-store"),e=await(0,c.Jt)("_version",t);return e?e!==h.version&&(await(0,c.IU)(t),(0,c.hZ)("_version",h.version,t)):(0,c.hZ)("_version",h.version,t),t},f=["mdi","hass","hassio","hademo"];let v=[];a(67094);let b,m,_,y=t=>t;const w={},C={},k=(0,n.s)(()=>(async t=>{const e=Object.keys(t),a=await Promise.allSettled(Object.values(t));(await p())("readwrite",i=>{a.forEach((a,o)=>{"fulfilled"===a.status&&Object.entries(a.value).forEach(([t,e])=>{i.put(e,t)}),delete t[e[o]]})})})(C),2e3),x={},$={"home-assistant":()=>a.e(58781).then(a.bind(a,53580)).then(t=>t.mdiHomeAssistant),"music-assistant":()=>a.e(56009).then(a.bind(a,10576)).then(t=>t.mdiMusicAssistant),esphome:()=>a.e(88800).then(a.bind(a,45091)).then(t=>t.mdiEsphomeLogo)};class L extends o.WF{willUpdate(t){super.willUpdate(t),t.has("icon")&&(this._path=void 0,this._secondaryPath=void 0,this._viewBox=void 0,this._loadIcon())}render(){return this.icon?this._legacy?(0,o.qy)(b||(b=y` <iron-icon .icon="${0}"></iron-icon>`),this.icon):(0,o.qy)(m||(m=y`<ha-svg-icon .path="${0}" .secondaryPath="${0}" .viewBox="${0}"></ha-svg-icon>`),this._path,this._secondaryPath,this._viewBox):o.s6}async _loadIcon(){if(!this.icon)return;const t=this.icon,[e,a]=this.icon.split(":",2);let i,o=a;if(!e||!o)return;if(!f.includes(e)){const a=l.y[e];return a?void(a&&"function"==typeof a.getIcon&&this._setCustomPath(a.getIcon(o),t)):void(this._legacy=!0)}if(this._legacy=!1,o in w){const t=w[o];let a;t.newName?(a=`Icon ${e}:${o} was renamed to ${e}:${t.newName}, please change your config, it will be removed in version ${t.removeIn}.`,o=t.newName):a=`Icon ${e}:${o} 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(a),(0,s.r)(this,"write_log",{level:"warning",message:a})}if(o in x)return void(this._path=x[o]);if(o in $){const e=await $[o]();return this.icon===t&&(this._path=e),void(x[o]=e)}try{i=await(t=>new Promise((e,a)=>{if(v.push([t,e,a]),v.length>1)return;const i=p();(0,d.h)(1e3,(async()=>{(await i)("readonly",t=>{for(const[e,a,i]of v)(0,c.Yd)(t.get(e)).then(t=>a(t)).catch(t=>i(t));v=[]})})()).catch(t=>{for(const[,,e]of v)e(t);v=[]})}))(o)}catch(u){i=void 0}if(i)return this.icon===t&&(this._path=i),void(x[o]=i);const r=(t=>{let e;for(const a of h.parts){if(void 0!==a.start&&t<a.start)break;e=a}return e.file})(o);if(r in C)return void this._setPath(C[r],o,t);const n=fetch(`/static/mdi/${r}.json`).then(t=>t.json());C[r]=n,this._setPath(n,o,t),n.catch(()=>{delete C[r]}),k()}async _setCustomPath(t,e){const a=await t;this.icon===e&&(this._path=a.path,this._secondaryPath=a.secondaryPath,this._viewBox=a.viewBox)}async _setPath(t,e,a){try{const i=await t;this.icon===a&&(this._path=i[e]),x[e]=i[e]}catch(i){}}constructor(...t){super(...t),this._legacy=!1}}L.styles=(0,o.AH)(_||(_=y`:host{fill:currentcolor}`)),(0,i.Cg)([(0,r.MZ)()],L.prototype,"icon",void 0),(0,i.Cg)([(0,r.wk)()],L.prototype,"_path",void 0),(0,i.Cg)([(0,r.wk)()],L.prototype,"_secondaryPath",void 0),(0,i.Cg)([(0,r.wk)()],L.prototype,"_viewBox",void 0),(0,i.Cg)([(0,r.wk)()],L.prototype,"_legacy",void 0),L=(0,i.Cg)([(0,r.EM)("ha-icon")],L)},38377:function(t,e,a){"use strict";var i=a(59787),o=(a(74423),a(72712),a(18111),a(22489),a(61701),a(18237),a(3362),a(27495),a(62953),a(40445)),r=a(5124),s=a(67576),n=a(20889),l=a(30015),c=a.n(l),d=a(1087),h=(a(3296),a(27208),a(48408),a(14603),a(47566),a(98721),a(2209));let u;var p=a(996);let g,f=t=>t;const v=t=>(0,r.qy)(g||(g=f`${0}`),t),b=new p.G(1e3),m={reType:(0,i.A)(/((\[!(caution|important|note|tip|warning)\])(?:\s|\\n)?)/i,{input:1,type:3}),typeToHaAlert:{caution:"error",important:"info",note:"info",tip:"success",warning:"warning"}};class _ extends r.mN{disconnectedCallback(){if(super.disconnectedCallback(),this.cache){const t=this._computeCacheKey();b.set(t,this.innerHTML)}}createRenderRoot(){return this}update(t){super.update(t),void 0!==this.content&&(this._renderPromise=this._render())}async getUpdateComplete(){return await super.getUpdateComplete(),await this._renderPromise,!0}willUpdate(t){if(!this.innerHTML&&this.cache){const t=this._computeCacheKey();b.has(t)&&((0,r.XX)(v((0,n._)(b.get(t))),this.renderRoot),this._resize())}}_computeCacheKey(){return c()({content:this.content,allowSvg:this.allowSvg,allowDataUrl:this.allowDataUrl,breaks:this.breaks})}async _render(){const t=await(async(t,e,i)=>(u||(u=(0,h.LV)(new Worker(new URL(a.p+a.u(55640),a.b)))),u.renderMarkdown(t,e,i)))(String(this.content),{breaks:this.breaks,gfm:!0},{allowSvg:this.allowSvg,allowDataUrl:this.allowDataUrl});(0,r.XX)(v((0,n._)(t.join(""))),this.renderRoot),this._resize();const e=document.createTreeWalker(this,NodeFilter.SHOW_ELEMENT,null);for(;e.nextNode();){const t=e.currentNode;if(t instanceof HTMLAnchorElement&&t.host!==document.location.host)t.target="_blank",t.rel="noreferrer noopener";else if(t instanceof HTMLImageElement)this.lazyImages&&(t.loading="lazy"),t.addEventListener("load",this._resize);else if(t instanceof HTMLQuoteElement){var i;const a=(null===(i=t.firstElementChild)||void 0===i||null===(i=i.firstChild)||void 0===i?void 0:i.textContent)&&m.reType.exec(t.firstElementChild.firstChild.textContent);if(a){const{type:i}=a.groups,o=document.createElement("ha-alert");o.alertType=m.typeToHaAlert[i.toLowerCase()],o.append(...Array.from(t.childNodes).map(t=>{const e=Array.from(t.childNodes);if(!this.breaks&&e.length){var i;const t=e[0];t.nodeType===Node.TEXT_NODE&&t.textContent===a.input&&null!==(i=t.textContent)&&void 0!==i&&i.includes("\n")&&(t.textContent=t.textContent.split("\n").slice(1).join("\n"))}return e}).reduce((t,e)=>t.concat(e),[]).filter(t=>t.textContent&&t.textContent!==a.input)),e.parentNode().replaceChild(o,t)}}else t instanceof HTMLElement&&["ha-alert","ha-qr-code","ha-icon","ha-svg-icon"].includes(t.localName)&&a(62003)(`./${t.localName}`)}}constructor(...t){super(...t),this.allowSvg=!1,this.allowDataUrl=!1,this.breaks=!1,this.lazyImages=!1,this.cache=!1,this._renderPromise=Promise.resolve(),this._resize=()=>(0,d.r)(this,"content-resize")}}(0,o.Cg)([(0,s.MZ)()],_.prototype,"content",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"allow-svg",type:Boolean})],_.prototype,"allowSvg",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"allow-data-url",type:Boolean})],_.prototype,"allowDataUrl",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],_.prototype,"breaks",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean,attribute:"lazy-images"})],_.prototype,"lazyImages",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],_.prototype,"cache",void 0),_=(0,o.Cg)([(0,s.EM)("ha-markdown-element")],_)},3587:function(t,e,a){"use strict";a(3362),a(62953);var i=a(40445),o=a(5124),r=a(67576);a(38377);let s,n,l=t=>t;class c extends o.WF{async getUpdateComplete(){var t;const e=await super.getUpdateComplete();return await(null===(t=this._markdownElement)||void 0===t?void 0:t.updateComplete),e}render(){return this.content?(0,o.qy)(s||(s=l`<ha-markdown-element .content="${0}" .allowSvg="${0}" .allowDataUrl="${0}" .breaks="${0}" .lazyImages="${0}" .cache="${0}"></ha-markdown-element>`),this.content,this.allowSvg,this.allowDataUrl,this.breaks,this.lazyImages,this.cache):o.s6}constructor(...t){super(...t),this.allowSvg=!1,this.allowDataUrl=!1,this.breaks=!1,this.lazyImages=!1,this.cache=!1}}c.styles=(0,o.AH)(n||(n=l`:host{display:block}ha-markdown-element{-ms-user-select:text;-webkit-user-select:text;-moz-user-select:text}ha-markdown-element>:first-child{margin-top:0}ha-markdown-element>:last-child{margin-bottom:0}ha-alert{display:block;margin:var(--ha-space-1) 0}a{color:var(--markdown-link-color,var(--primary-color))}img{background-color:var(--markdown-image-background-color);border-radius:var(--markdown-image-border-radius);max-width:100%}p:first-child>img:first-child{vertical-align:top}p:first-child>img:last-child{vertical-align:top}ha-markdown-element>:is(ol,ul){padding-inline-start:var(--markdown-list-indent,revert)}li:has(input[type=checkbox]){list-style:none}li:has(input[type=checkbox])>input[type=checkbox]{margin-left:0}svg{background-color:var(--markdown-svg-background-color,none);color:var(--markdown-svg-color,none)}code,pre{background-color:var(--markdown-code-background-color,none);border-radius:var(--ha-border-radius-sm);color:var(--markdown-code-text-color,inherit)}code{font-size:var(--ha-font-size-s);padding:.2em .4em}pre code{padding:0}pre{padding:var(--ha-space-4);overflow:auto;line-height:var(--ha-line-height-condensed);font-family:var(--ha-font-family-code)}h1,h2,h3,h4,h5,h6{line-height:initial}h2{font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-bold)}hr{border-color:var(--divider-color);border-bottom:none;margin:var(--ha-space-4) 0}table[role=presentation]{--markdown-table-border-collapse:separate;--markdown-table-border-width:0;--markdown-table-padding-inline:0;--markdown-table-padding-block:0}table[role=presentation] td,table[role=presentation] th{vertical-align:middle}table[role=presentation] td[valign=top],table[role=presentation] th[valign=top]{vertical-align:top}table[role=presentation] td[valign=middle],table[role=presentation] th[valign=middle]{vertical-align:middle}table[role=presentation] td[valign=bottom],table[role=presentation] th[valign=bottom]{vertical-align:bottom}table[role=presentation] td[valign=baseline],table[role=presentation] th[valign=baseline]{vertical-align:baseline}@supports (border-width:attr(border px,0)){table[role=presentation]{--markdown-table-border-width:attr(border px, 0)}table[role=presentation] td,table[role=presentation] th{vertical-align:attr(valign,middle)}}table[role=presentation][border="0"]{--markdown-table-border-width:0}table[role=presentation][border="1"]{--markdown-table-border-width:1px}table[role=presentation][border="2"]{--markdown-table-border-width:2px}table[role=presentation][border="3"]{--markdown-table-border-width:3px}table{border-collapse:var(--markdown-table-border-collapse,collapse)}div:has(> table){overflow:auto}th{text-align:var(--markdown-table-text-align,start)}td,th{border-width:var(--markdown-table-border-width,1px);border-style:var(--markdown-table-border-style,solid);border-color:var(--markdown-table-border-color,var(--divider-color));padding-inline:var(--markdown-table-padding-inline,0.5em);padding-block:var(--markdown-table-padding-block,0.25em)}blockquote{border-left:4px solid var(--divider-color);margin-inline:0;padding-inline:1em}`)),(0,i.Cg)([(0,r.MZ)()],c.prototype,"content",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"allow-svg",type:Boolean})],c.prototype,"allowSvg",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"allow-data-url",type:Boolean})],c.prototype,"allowDataUrl",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],c.prototype,"breaks",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"lazy-images"})],c.prototype,"lazyImages",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],c.prototype,"cache",void 0),(0,i.Cg)([(0,r.P)("ha-markdown-element")],c.prototype,"_markdownElement",void 0),c=(0,i.Cg)([(0,r.EM)("ha-markdown")],c)},93367:function(t,e,a){"use strict";a.a(t,async function(t,e){try{var i=a(40445),o=a(35211),r=a(5124),s=a(67576),n=a(91450),l=a(69093),c=a(22792),d=a(85694),h=(a(47680),a(67094),t([d]));d=(h.then?(await h)():h)[0];let u,p,g,f,v=t=>t;class b extends r.WF{render(){var t,e;const a=this.icon||this.stateObj&&(null===(t=this._entities)||void 0===t||null===(t=t[this.stateObj.entity_id])||void 0===t?void 0:t.icon)||(null===(e=this.stateObj)||void 0===e?void 0:e.attributes.icon);if(a)return(0,r.qy)(u||(u=v`<ha-icon .icon="${0}"></ha-icon>`),a);if(!this.stateObj)return r.s6;if(!this._config||!this._connection||!this._entities)return this._renderFallback();const i=(0,d.fq)(this._entities,this._config.config,this._connection.connection,this.stateObj,this.stateValue).then(t=>t?(0,r.qy)(p||(p=v`<ha-icon .icon="${0}"></ha-icon>`),t):this._renderFallback());return(0,r.qy)(g||(g=v`${0}`),(0,n.T)(i))}_renderFallback(){const t=(0,l.t)(this.stateObj);return(0,r.qy)(f||(f=v` <ha-svg-icon .path="${0}"></ha-svg-icon> `),d.l[t]||d.lW)}}(0,i.Cg)([(0,s.MZ)({attribute:!1})],b.prototype,"stateObj",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],b.prototype,"stateValue",void 0),(0,i.Cg)([(0,s.MZ)()],b.prototype,"icon",void 0),(0,i.Cg)([(0,s.wk)(),(0,o.Fg)({context:c.WF,subscribe:!0})],b.prototype,"_config",void 0),(0,i.Cg)([(0,s.wk)(),(0,o.Fg)({context:c.Wq,subscribe:!0})],b.prototype,"_connection",void 0),(0,i.Cg)([(0,s.wk)(),(0,o.Fg)({context:c.X1,subscribe:!0})],b.prototype,"_entities",void 0),b=(0,i.Cg)([(0,s.EM)("ha-state-icon")],b),e()}catch(u){e(u)}})},36866:function(t,e,a){"use strict";a.a(t,async function(t,e){try{a(62953);var i=a(40445),o=a(5124),r=a(67576),s=a(91485),n=t([s]);s=(n.then?(await n)():n)[0];let l,c,d=t=>t;const h="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z";class u extends s.U{willUpdate(t){var e,a;(super.willUpdate(t),this.label||this.placeholder||this.hasUpdated&&!t.has("_i18n"))||(this.placeholder=(null===(e=this.i18n)||void 0===e||null===(a=e.localize)||void 0===a?void 0:a.call(e,"ui.common.search"))||"Search")}renderStartDefault(){return(0,o.qy)(l||(l=d`<ha-svg-icon slot="start" .path="${0}"></ha-svg-icon>`),h)}constructor(){super(),this.withClear=!0,this.autocomplete=this.autocomplete||"off"}}u.styles=[...s.U.styles,(0,o.AH)(c||(c=d`:host([appearance=outlined]) wa-input.no-label::part(base){height:40px}`))],u=(0,i.Cg)([(0,r.EM)("ha-input-search")],u),e()}catch(l){e(l)}})},64013:function(t,e,a){"use strict";var i=a(40445),o=a(97086),r=a(5124),s=a(67576);let n,l=t=>t;class c extends o.A{static get styles(){return[o.A.styles,(0,r.AH)(n||(n=l`:host{--wa-form-control-required-content:var(
            --ha-radio-group-required-marker,
            var(--ha-input-required-marker, "*")
          );--wa-form-control-required-content-offset:var(
            --ha-radio-group-required-marker-offset,
            0.1rem
          )}`))]}constructor(){super(),this.radioTag="ha-radio-option"}}c=(0,i.Cg)([(0,s.EM)("ha-radio-group")],c)},92677:function(t,e,a){"use strict";var i=a(40445),o=a(17010),r=a(5124),s=a(67576);let n,l=t=>t;class c extends o.A{static get styles(){return[o.A.styles,(0,r.AH)(n||(n=l`:host{--wa-form-control-activated-color:var(
            --ha-radio-option-active-color,
            var(--ha-color-fill-primary-loud-resting)
          );--wa-form-control-height:var(--ha-radio-option-height, 40px);--wa-form-control-toggle-size:var(
            --ha-radio-option-toggle-size,
            20px
          );--wa-form-control-border-width:var(
            --ha-radio-option-border-width,
            var(--ha-border-width-md)
          );--wa-form-control-border-color:var(
            --ha-radio-option-border-color,
            var(--ha-color-border-neutral-normal)
          );--wa-form-control-background-color:var(
            --ha-radio-option-background-color,
            var(--wa-form-control-background-color)
          );--checked-icon-color:var(
            --ha-radio-option-checked-icon-color,
            var(--wa-form-control-activated-color)
          );--checked-icon-scale:var(--ha-radio-option-checked-icon-scale, 0.7)}:host([appearance=default]) .control{margin:var(--ha-radio-option-control-margin,var(--ha-space-3) var(--ha-space-2) var(--ha-space-3) var(--ha-space-3))}:host(:not([aria-checked=true],[aria-disabled=true]):hover) .control{border-color:var(--ha-radio-option-border-color-hover,var(--ha-radio-option-border-color,var(--ha-color-border-neutral-loud)));background-color:var(--ha-radio-option-background-color-hover,var(--ha-color-fill-neutral-quiet-hover))}:host([aria-checked=true]) .control{background-color:var(--ha-radio-option-checked-background-color,var(--ha-color-fill-primary-normal-resting));color:var(--checked-icon-color);border-color:var(--checked-icon-color)}[part~=label]{display:inline-flex;align-items:center;cursor:pointer}:host([disabled]) [part~=label]{cursor:not-allowed}`))]}}c=(0,i.Cg)([(0,s.EM)("ha-radio-option")],c)},82e3:function(t,e,a){"use strict";a.d(e,{D5:function(){return i},Fy:function(){return h},Gk:function(){return g},Hg:function(){return o},TJ:function(){return s},UQ:function(){return d},Y_:function(){return f},ds:function(){return p},e0:function(){return r},ec:function(){return u},go:function(){return l},n2:function(){return c},sq:function(){return n}});a(74423),a(18111),a(61701),a(33110),a(3362);const i=14881==a.j?`${location.protocol}//${location.host}`:null,o=t=>t.map(t=>{if("string"!==t.type)return t;switch(t.name){case"username":return Object.assign(Object.assign({},t),{},{autocomplete:"username",autofocus:!0});case"password":return Object.assign(Object.assign({},t),{},{autocomplete:"current-password"});case"code":return Object.assign(Object.assign({},t),{},{autocomplete:"one-time-code",autofocus:!0});default:return t}}),r=(t,e)=>t.callWS({type:"auth/sign_path",path:e}),s=()=>fetch("/auth/providers",{credentials:"same-origin"}),n=(t,e,a)=>fetch("/auth/login_flow",{method:"POST",credentials:"same-origin",body:JSON.stringify({client_id:t,handler:a,redirect_uri:e})}),l=(t,e)=>fetch(`/auth/login_flow/${t}`,{method:"POST",credentials:"same-origin",body:JSON.stringify(e)}),c=t=>fetch(`/auth/login_flow/${t}`,{method:"DELETE",credentials:"same-origin"}),d=(t,e,a,i)=>{t.includes("?")?t.endsWith("&")||(t+="&"):t+="?",t+=`code=${encodeURIComponent(e)}`,a&&(t+=`&state=${encodeURIComponent(a)}`),i&&(t+="&storeToken=true"),document.location.assign(t)},h=async(t,e,a,i)=>t.callWS({type:"config/auth_provider/homeassistant/create",user_id:e,username:a,password:i}),u=(t,e,a)=>t.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:e,new_password:a}),p=(t,e,a)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:e,password:a}),g=(t,e,a)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:e,username:a}),f=(t,e,a)=>t.callWS({type:"auth/delete_all_refresh_tokens",token_type:e,delete_current_token:a})},10897:function(t,e,a){"use strict";a.d(e,{C4:function(){return c},CK:function(){return l},FX:function(){return f},UC:function(){return p},_Z:function(){return _},bT:function(){return y},j4:function(){return b},sd:function(){return r},su:function(){return n},vc:function(){return m},w8:function(){return u},wv:function(){return h},y3:function(){return g},zS:function(){return s}});a(3362);var i=a(3931),o=a(82e3);const r=[1,2,3,4,6,8],s="web_rtc",n=(t,e,a)=>`${t}&width=${e}&height=${a}`,l=t=>t.attributes.access_token?`/api/camera_proxy_stream/${t.entity_id}?token=${t.attributes.access_token}`:void 0,c=async(t,e,a,o)=>{const r=await(0,i.U)("_cameraTmbUrl",9e3,d,t,e);return n(r,a,o)},d=async(t,e)=>{const a=await(0,o.e0)(t,`/api/camera_proxy/${e}`);return t.hassUrl(a.path)},h=async(t,e,a)=>{const i={type:"camera/stream",entity_id:e};a&&(i.format=a);const o=await t.callWS(i);return o.url=t.hassUrl(o.url),o},u=(t,e,a,i)=>t.connection.subscribeMessage(i,{type:"camera/webrtc/offer",entity_id:e,offer:a}),p=(t,e,a,i)=>t.callWS({type:"camera/webrtc/candidate",entity_id:e,session_id:a,candidate:i}),g=(t,e)=>t.callWS({type:"camera/get_prefs",entity_id:e}),f=(t,e,a)=>t.callWS(Object.assign({type:"camera/update_prefs",entity_id:e},a)),v="media-source://camera/",b=t=>t.startsWith(v),m=t=>t.substring(22),_=async(t,e)=>t.callWS({type:"camera/capabilities",entity_id:e}),y=async(t,e)=>t.callWS({type:"camera/webrtc/get_client_config",entity_id:e})},38279:function(t,e,a){"use strict";a.d(e,{$2:function(){return i},VV:function(){return r},on:function(){return l},sx:function(){return s}});a(72712);var i=function(t){return t[t.TARGET_TEMPERATURE=1]="TARGET_TEMPERATURE",t[t.TARGET_TEMPERATURE_RANGE=2]="TARGET_TEMPERATURE_RANGE",t[t.TARGET_HUMIDITY=4]="TARGET_HUMIDITY",t[t.FAN_MODE=8]="FAN_MODE",t[t.PRESET_MODE=16]="PRESET_MODE",t[t.SWING_MODE=32]="SWING_MODE",t[t.AUX_HEAT=64]="AUX_HEAT",t[t.TURN_OFF=128]="TURN_OFF",t[t.TURN_ON=256]="TURN_ON",t[t.SWING_HORIZONTAL_MODE=512]="SWING_HORIZONTAL_MODE",t}({});const o=["auto","heat_cool","heat","cool","dry","fan_only","off"].reduce((t,e,a)=>(t[e]=a,t),{}),r=(t,e)=>o[t]-o[e],s={cooling:"cool",defrosting:"heat",drying:"dry",fan:"fan_only",heating:"heat",idle:"off",off:"off",preheating:"heat"},n={cool:"M20.79,13.95L18.46,14.57L16.46,13.44V10.56L18.46,9.43L20.79,10.05L21.31,8.12L19.54,7.65L20,5.88L18.07,5.36L17.45,7.69L15.45,8.82L13,7.38V5.12L14.71,3.41L13.29,2L12,3.29L10.71,2L9.29,3.41L11,5.12V7.38L8.5,8.82L6.5,7.69L5.92,5.36L4,5.88L4.47,7.65L2.7,8.12L3.22,10.05L5.55,9.43L7.55,10.56V13.45L5.55,14.58L3.22,13.96L2.7,15.89L4.47,16.36L4,18.12L5.93,18.64L6.55,16.31L8.55,15.18L11,16.62V18.88L9.29,20.59L10.71,22L12,20.71L13.29,22L14.7,20.59L13,18.88V16.62L15.5,15.17L17.5,16.3L18.12,18.63L20,18.12L19.53,16.35L21.3,15.88L20.79,13.95M9.5,10.56L12,9.11L14.5,10.56V13.44L12,14.89L9.5,13.44V10.56Z",dry:"M12,3.25C12,3.25 6,10 6,14C6,17.32 8.69,20 12,20A6,6 0 0,0 18,14C18,10 12,3.25 12,3.25M14.47,9.97L15.53,11.03L9.53,17.03L8.47,15.97M9.75,10A1.25,1.25 0 0,1 11,11.25A1.25,1.25 0 0,1 9.75,12.5A1.25,1.25 0 0,1 8.5,11.25A1.25,1.25 0 0,1 9.75,10M14.25,14.5A1.25,1.25 0 0,1 15.5,15.75A1.25,1.25 0 0,1 14.25,17A1.25,1.25 0 0,1 13,15.75A1.25,1.25 0 0,1 14.25,14.5Z",fan_only:"M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12.5,2C17,2 17.11,5.57 14.75,6.75C13.76,7.24 13.32,8.29 13.13,9.22C13.61,9.42 14.03,9.73 14.35,10.13C18.05,8.13 22.03,8.92 22.03,12.5C22.03,17 18.46,17.1 17.28,14.73C16.78,13.74 15.72,13.3 14.79,13.11C14.59,13.59 14.28,14 13.88,14.34C15.87,18.03 15.08,22 11.5,22C7,22 6.91,18.42 9.27,17.24C10.25,16.75 10.69,15.71 10.89,14.79C10.4,14.59 9.97,14.27 9.65,13.87C5.96,15.85 2,15.07 2,11.5C2,7 5.56,6.89 6.74,9.26C7.24,10.25 8.29,10.68 9.22,10.87C9.41,10.39 9.73,9.97 10.14,9.65C8.15,5.96 8.94,2 12.5,2Z",auto:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22C12.4 22 12.7 22 13.1 21.9L15.4 15.3L14.8 14.7C15.5 14 16 13 16 11.9C16 11.2 15.8 10.5 15.4 9.9L17.6 7.7C18.5 9 19 10.4 19 12H20C20.3 12 20.6 12.1 20.8 12.2C20.8 12.2 20.9 12.2 20.9 12.3C21.3 12.5 21.7 12.9 21.9 13.4C22 12.9 22 12.5 22 12C22 6.5 17.5 2 12 2M14 8.6C13.4 8.2 12.7 8 12 8C9.8 8 8 9.8 8 12C8 13.1 8.4 14.1 9.2 14.8L7.1 16.9C5.8 15.7 5 13.9 5 12C5 8.1 8.1 5 12 5C13.6 5 15 5.5 16.2 6.4L14 8.6M20 14H18L14.8 23H16.7L17.4 21H20.6L21.3 23H23.2L20 14M17.8 19.7L19 16L20.2 19.7H17.8Z",heat:"M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z",off:"M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13",heat_cool:"M12.92 1.58L11.18 2.58L12.39 4.67L11.8 6.85L9 7.6L7.38 6L7.42 3.59L5.43 3.59L5.43 5.42L3.59 5.42L3.6 7.42L6 7.42L7.65 9.03L6.9 11.82L4.68 12.4L2.59 11.2L1.59 12.93L3.17 13.84L2.26 15.42L4 16.42L5.19 14.33L7.42 13.75L7.92 14.26L9.32 12.86L8.78 12.32L9.53 9.54L12.32 8.78L12.85 9.32L14.26 7.91L13.73 7.37L14.32 5.19L16.41 4L15.41 2.25L13.83 3.16L12.92 1.58M20.72 4L4 20.72L5.27 22L10.16 17.11C10.63 17.43 11.15 17.68 11.71 17.83C14.38 18.55 17.12 16.96 17.83 14.29C18.22 12.86 17.93 11.36 17.11 10.16L22 5.27L20.72 4M18.74 9C19.18 9.63 19.53 10.38 19.75 11.19C19.97 12 20.03 12.81 19.96 13.61L22.65 10.41L18.74 9M19.32 15.95C19 16.67 18.5 17.35 17.93 17.94C17.34 18.53 16.66 19 15.96 19.34L20.05 20.06L19.32 15.95M9 18.71L10.41 22.66L13.59 19.95C12.81 20 12 19.97 11.19 19.76C10.36 19.54 9.62 19.17 9 18.71Z"},l=t=>n[t]||"M16.95,16.95L14.83,14.83C15.55,14.1 16,13.1 16,12C16,11.26 15.79,10.57 15.43,10L17.6,7.81C18.5,9 19,10.43 19,12C19,13.93 18.22,15.68 16.95,16.95M12,5C13.57,5 15,5.5 16.19,6.4L14,8.56C13.43,8.21 12.74,8 12,8A4,4 0 0,0 8,12C8,13.1 8.45,14.1 9.17,14.83L7.05,16.95C5.78,15.68 5,13.93 5,12A7,7 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"},700:function(t,e,a){"use strict";a.d(e,{y:function(){return s}});const i=window;"customIconsets"in i||(i.customIconsets={});const o=i.customIconsets,r=window;"customIcons"in r||(r.customIcons={});const s=new Proxy(r.customIcons,{get:(t,e)=>{var a;return null!==(a=t[e])&&void 0!==a?a:o[e]?{getIcon:o[e]}:void 0}})},22675:function(t,e,a){"use strict";a.d(e,{HV:function(){return r},Hh:function(){return o}});var i=a(23832);const o="unavailable",r="unknown",s=[o,r,"off"];(0,i.g)(s)},53756:function(t,e,a){"use strict";a.d(e,{t:function(){return l},w:function(){return c}});a(74423),a(18111),a(22489),a(61701),a(62953);var i=a(71727),o=a(74705),r=a(28978),s=a(15638),n=a(95350);const l=[{name:"search_labels.entityName",weight:10},{name:"search_labels.friendlyName",weight:8},{name:"search_labels.deviceName",weight:7},{name:"search_labels.areaName",weight:6},{name:"search_labels.domainName",weight:6},{name:"search_labels.entityId",weight:3}],c=(t,e,a,l,c,d,h,u,p,g="")=>{let f,v=Object.keys(t.states);return h&&(v=v.filter(t=>h.includes(t))),u&&(v=v.filter(t=>!u.includes(t))),e&&(v=v.filter(t=>e.includes((0,i.m)(t)))),a&&(v=v.filter(t=>!a.includes((0,i.m)(t)))),f=v.map(e=>{const a=t.states[e],l=(0,r.u)(a),[c,d,h]=(0,o.Cf)(a,[{type:"entity"},{type:"device"},{type:"area"}],t.entities,t.devices,t.areas,t.floors),u=(0,n.p$)(t.localize,(0,i.m)(e)),p=(0,s.qC)(t.language,t.translationMetadata.translations),f=c||d||e,v=[h,c?d:void 0].filter(Boolean).join(p?" ◂ ":" ▸ ");return{id:`${g}${e}`,primary:f,secondary:v,domain_name:u,sorting_label:[f,v].filter(Boolean).join("_"),search_labels:{entityName:c||null,deviceName:d||null,areaName:h||null,domainName:u||null,friendlyName:l||null,entityId:e},stateObj:a}}),c&&(f=f.filter(t=>{var e;return t.id===p||(null===(e=t.stateObj)||void 0===e?void 0:e.attributes.device_class)&&c.includes(t.stateObj.attributes.device_class)})),d&&(f=f.filter(t=>{var e;return t.id===p||(null===(e=t.stateObj)||void 0===e?void 0:e.attributes.unit_of_measurement)&&d.includes(t.stateObj.attributes.unit_of_measurement)})),l&&(f=f.filter(t=>t.id===p||t.stateObj&&l(t.stateObj))),f}},68287:function(t,e,a){"use strict";a.d(e,{z:function(){return o}});a(18111),a(61701),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);var i=a(71727);const o=t=>{const e=t.attributes.entity_id||[],a=[...new Set(e.map(t=>(0,i.m)(t)))];return 1===a.length?a[0]:void 0}},64808:function(t,e,a){"use strict";a.d(e,{G6:function(){return s},KL:function(){return c},Sn:function(){return i},j4:function(){return n},q2:function(){return o},tb:function(){return r}});a(3362);const i="timestamp",o="temperature",r="humidity",s=["timestamp","uptime"],n=(t,e)=>t.callWS({type:"sensor/device_class_convertible_units",device_class:e});let l;const c=async t=>l||(l=t.callWS({type:"sensor/numeric_device_classes"}).catch(t=>{throw l=void 0,t}),l)},59992:function(t,e,a){"use strict";a.a(t,async function(t,i){try{a.d(e,{V:function(){return g}});a(62953);var o=a(40445),r=a(88696),s=a(5124),n=a(6412),l=a(67576),c=t([r]);r=(c.then?(await c)():c)[0];let d,h,u=t=>t;const p=t=>void 0===t?[]:Array.isArray(t)?t:[t],g=t=>{class e extends t{get scrollableElement(){return e.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(t){var e;null===(e=super.firstUpdated)||void 0===e||e.call(this,t),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(t){var e;null===(e=super.updated)||void 0===e||e.call(this,t),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(t=!1){return(0,s.qy)(d||(d=u` <div class="${0}"></div> <div class="${0}"></div> `),(0,n.H)({"fade-top":!0,rounded:t,visible:this._contentScrolled}),(0,n.H)({"fade-bottom":!0,rounded:t,visible:this._contentScrollable}))}static get styles(){var t;const e=Object.getPrototypeOf(this);return[...p(null!==(t=null==e?void 0:e.styles)&&void 0!==t?t:[]),(0,s.AH)(h||(h=u`.fade-bottom,.fade-top{position:absolute;left:0;right:0;height:var(--ha-space-2);pointer-events:none;transition:opacity 180ms ease-in-out;border-radius:var(--ha-border-radius-square);opacity:0;background:linear-gradient(to bottom,var(--ha-color-shadow-scrollable-fade),transparent)}.fade-top{top:0}.fade-bottom{bottom:0;transform:rotate(180deg)}.fade-bottom.visible,.fade-top.visible{opacity:1}.fade-bottom.rounded,.fade-top.rounded{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}.fade-top.rounded{border-top-left-radius:var(--ha-border-radius-square);border-top-right-radius:var(--ha-border-radius-square)}.fade-bottom.rounded{border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}`))]}_attachScrollableElement(){const t=this.scrollableElement;t!==this._scrollTarget&&(this._detachScrollableElement(),t&&(this._scrollTarget=t,t.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(t),this._updateScrollableState(t)))}_detachScrollableElement(){var t,e;this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),null===(t=(e=this._resize).unobserve)||void 0===t||t.call(e,this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(t){const e=parseFloat(getComputedStyle(t).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:a=0,clientHeight:i=0,scrollTop:o=0}=t;this._contentScrollable=a-i>o+e+this.scrollFadeSafeAreaPadding}constructor(...t){super(...t),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=t=>{var e;const a=t.currentTarget;this._contentScrolled=(null!==(e=a.scrollTop)&&void 0!==e?e:0)>this.scrollFadeThreshold,this._updateScrollableState(a)},this._resize=new r.P(this,{target:null,callback:t=>{var e;const a=null===(e=t[0])||void 0===e?void 0:e.target;a&&this._updateScrollableState(a)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return e.DEFAULT_SCROLLABLE_ELEMENT=null,(0,o.Cg)([(0,l.wk)()],e.prototype,"_contentScrolled",void 0),(0,o.Cg)([(0,l.wk)()],e.prototype,"_contentScrollable",void 0),e};i()}catch(d){i(d)}})},86240:function(t,e,a){"use strict";a.a(t,async function(t,i){try{a.r(e),a.d(e,{DialogEnergyWaterSettings:function(){return E}});a(18111),a(22489),a(61701),a(3362),a(62953);var o=a(40445),r=a(5124),s=a(67576),n=a(1087),l=a(82474),c=a(81423),d=a(18350),h=(a(93444),a(3587),a(72554)),u=(a(64013),a(92677),a(91485)),p=a(38114),g=a(23528),f=a(64808),v=a(14503),b=t([l,c,d,h,u,p,g]);[l,c,d,h,u,p,g]=b.then?(await b)():b;let m,_,y,w,C,k,x,$=t=>t;const L=["volume_flow_rate"];class E extends r.WF{async showDialog(t){this._params=t,this._source=t.source?Object.assign({},t.source):(0,p.GW)(),this._costs=this._source.entity_energy_price?"entity":this._source.number_energy_price?"number":this._source.stat_cost?"statistic":"no-costs",this._water_units=(await(0,f.j4)(this.hass,"water")).units,this._flow_rate_units=(await(0,f.j4)(this.hass,"volume_flow_rate")).units,this._excludeList=this._params.water_sources.map(t=>t.stat_energy_from).filter(t=>{var e;return t!==(null===(e=this._source)||void 0===e?void 0:e.stat_energy_from)}),this._excludeListFlowRate=this._params.water_sources.map(t=>t.stat_rate).filter(t=>{var e;return t&&t!==(null===(e=this._source)||void 0===e?void 0:e.stat_rate)}),this._open=!0}closeDialog(){return this._open=!1,!0}_dialogClosed(){this._params=void 0,this._source=void 0,this._error=void 0,this._excludeList=void 0,this._excludeListFlowRate=void 0,(0,n.r)(this,"dialog-closed",{dialog:this.localName})}render(){var t,e,a,i,o,s;if(!this._params||!this._source)return r.s6;const n=(null===(t=this._water_units)||void 0===t?void 0:t.join(", "))||"",l=`${this.hass.config.currency}/${"gal"===this.hass.config.unit_system.volume?"gal":"m³"}`,c=this._source.stat_energy_from&&(0,g.OQ)(this._source.stat_energy_from);return(0,r.qy)(m||(m=$` <ha-dialog .open="${0}" header-title="${0}" prevent-scrim-close @closed="${0}"> ${0} <ha-statistic-picker .hass="${0}" .helpMissingEntityUrl="${0}" include-unit-class="volume" include-device-class="water" .value="${0}" .label="${0}" .excludeStatistics="${0}" @value-changed="${0}" .helper="${0}" autofocus></ha-statistic-picker> <ha-statistic-picker .hass="${0}" .includeUnitClass="${0}" .value="${0}" .label="${0}" .excludeStatistics="${0}" @value-changed="${0}" .helper="${0}"></ha-statistic-picker> <ha-input .label="${0}" type="text" .disabled="${0}" .value="${0}" .placeholder="${0}" @input="${0}"> </ha-input> <ha-radio-group .label="${0}" .value="${0}" name="costs" @change="${0}"> <ha-radio-option value="no-costs"> ${0} </ha-radio-option> <ha-radio-option value="statistic"> ${0} </ha-radio-option> <ha-radio-option value="entity" .disabled="${0}"> ${0} </ha-radio-option> <ha-radio-option value="number" .disabled="${0}"> ${0} </ha-radio-option> </ha-radio-group> ${0} <ha-dialog-footer slot="footer"> <ha-button appearance="plain" @click="${0}" slot="secondaryAction"> ${0} </ha-button> <ha-button @click="${0}" .disabled="${0}" slot="primaryAction"> ${0} </ha-button> </ha-dialog-footer> </ha-dialog> `),this._open,this.hass.localize("ui.panel.config.energy.water.dialog.header"),this._dialogClosed,this._error?(0,r.qy)(_||(_=$`<p class="error">${0}</p>`),this._error):"",this.hass,p.X4,this._source.stat_energy_from,this.hass.localize("ui.panel.config.energy.water.dialog.water_usage"),this._excludeList,this._statisticChanged,this.hass.localize("ui.panel.config.energy.water.dialog.entity_para",{unit:n}),this.hass,L,this._source.stat_rate,this.hass.localize("ui.panel.config.energy.water.dialog.water_flow_rate"),this._excludeListFlowRate,this._flowRateStatisticChanged,this.hass.localize("ui.panel.config.energy.water.dialog.flow_rate_para",{unit:(null===(e=this._flow_rate_units)||void 0===e?void 0:e.join(", "))||""}),this.hass.localize("ui.panel.config.energy.water.dialog.display_name"),!(null!==(a=this._source)&&void 0!==a&&a.stat_energy_from),(null===(i=this._source)||void 0===i?void 0:i.name)||"",null!==(o=this._source)&&void 0!==o&&o.stat_energy_from?(0,g.$O)(this.hass,this._source.stat_energy_from,null===(s=this._params)||void 0===s||null===(s=s.statsMetadata)||void 0===s?void 0:s[this._source.stat_energy_from]):"",this._nameChanged,this.hass.localize("ui.panel.config.energy.water.dialog.cost_para"),this._costs,this._handleCostChanged,this.hass.localize("ui.panel.config.energy.water.dialog.no_cost"),this.hass.localize("ui.panel.config.energy.water.dialog.cost_stat"),c,this.hass.localize("ui.panel.config.energy.water.dialog.cost_entity"),c,this.hass.localize("ui.panel.config.energy.water.dialog.cost_number"),"statistic"===this._costs?(0,r.qy)(y||(y=$`<ha-statistic-picker class="price-options" .hass="${0}" statistic-types="sum" .value="${0}" .label="${0}" @value-changed="${0}"></ha-statistic-picker>`),this.hass,this._source.stat_cost,`${this.hass.localize("ui.panel.config.energy.water.dialog.cost_stat_input")} (${this.hass.config.currency})`,this._priceStatChanged):"entity"===this._costs?(0,r.qy)(w||(w=$`<ha-entity-picker class="price-options" .hass="${0}" include-domains='["sensor", "input_number"]' .value="${0}" .label="${0}" .helper="${0}" @value-changed="${0}"></ha-entity-picker>`),this.hass,this._source.entity_energy_price,this.hass.localize("ui.panel.config.energy.water.dialog.cost_entity_input"),(0,r.qy)(C||(C=$`<ha-markdown .content="${0}"></ha-markdown>`),this.hass.localize("ui.panel.config.energy.water.dialog.cost_entity_helper",{currency:this.hass.config.currency})),this._priceEntityChanged):"number"===this._costs?(0,r.qy)(k||(k=$`<ha-input .label="${0}" class="price-options" step="any" type="number" .value="${0}" @change="${0}"> <span slot="end">${0}</span> </ha-input>`),`${this.hass.localize("ui.panel.config.energy.water.dialog.cost_number_input")} (${l})`,null!==this._source.number_energy_price?String(this._source.number_energy_price):"",this._numberPriceChanged,l):r.s6,this.closeDialog,this.hass.localize("ui.common.cancel"),this._save,!this._source.stat_energy_from,this.hass.localize("ui.common.save"))}_handleCostChanged(t){this._costs=t.currentTarget.value}_numberPriceChanged(t){this._source=Object.assign(Object.assign({},this._source),{},{number_energy_price:Number(t.target.value),entity_energy_price:null,stat_cost:null})}_priceStatChanged(t){this._source=Object.assign(Object.assign({},this._source),{},{entity_energy_price:null,number_energy_price:null,stat_cost:t.detail.value})}_priceEntityChanged(t){this._source=Object.assign(Object.assign({},this._source),{},{entity_energy_price:t.detail.value,number_energy_price:null,stat_cost:null})}_flowRateStatisticChanged(t){this._source=Object.assign(Object.assign({},this._source),{},{stat_rate:t.detail.value||void 0})}async _statisticChanged(t){var e;if(t.detail.value&&(0,g.OQ)(t.detail.value)&&"statistic"!==this._costs&&(this._costs="no-costs"),this._source=Object.assign(Object.assign({},this._source),{},{stat_energy_from:t.detail.value}),t.detail.value&&(0,g.OQ)(t.detail.value)&&null!==(e=this._params)&&void 0!==e&&e.statsMetadata&&!(t.detail.value in this._params.statsMetadata)){const[e]=await(0,g.Wr)(this.hass,[t.detail.value]);e&&(this._params.statsMetadata[t.detail.value]=e,this.requestUpdate("_params"))}}_nameChanged(t){this._source=Object.assign(Object.assign({},this._source),{},{name:t.target.value}),this._source.name||delete this._source.name}async _save(){try{"no-costs"===this._costs&&(this._source.entity_energy_price=null,this._source.number_energy_price=null,this._source.stat_cost=null),await this._params.saveCallback(this._source),this.closeDialog()}catch(t){this._error=t.message}}static get styles(){return[v.RF,v.nA,(0,r.AH)(x||(x=$`ha-statistic-picker{display:block;margin-bottom:var(--ha-space-4)}ha-radio-group{margin-top:var(--ha-space-4)}.price-options{display:block;margin-top:var(--ha-space-3)}`))]}constructor(...t){super(...t),this._open=!1}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],E.prototype,"hass",void 0),(0,o.Cg)([(0,s.wk)()],E.prototype,"_params",void 0),(0,o.Cg)([(0,s.wk)()],E.prototype,"_open",void 0),(0,o.Cg)([(0,s.wk)()],E.prototype,"_source",void 0),(0,o.Cg)([(0,s.wk)()],E.prototype,"_costs",void 0),(0,o.Cg)([(0,s.wk)()],E.prototype,"_water_units",void 0),(0,o.Cg)([(0,s.wk)()],E.prototype,"_flow_rate_units",void 0),(0,o.Cg)([(0,s.wk)()],E.prototype,"_error",void 0),E=(0,o.Cg)([(0,s.EM)("dialog-energy-water-settings")],E),i()}catch(m){i(m)}})},24367:function(t,e,a){"use strict";a.d(e,{L:function(){return o},z:function(){return r}});var i=a(23832);const o=["input_boolean","input_button","input_text","input_number","input_datetime","input_select","counter","timer","schedule"],r=(0,i.g)(o)},19711:function(t,e,a){"use strict";a.d(e,{$:function(){return r}});a(3362),a(62953);var i=a(1087);const o=()=>Promise.all([a.e(80131),a.e(70183),a.e(47677)]).then(a.bind(a,79029)),r=(t,e)=>{(0,i.r)(t,"show-dialog",{dialogTag:"dialog-helper-detail",dialogImport:o,dialogParams:e})}},86030:function(t,e,a){"use strict";a.d(e,{B:function(){return i},a:function(){return o}});a(72712),a(94490),a(18111),a(18237),a(42762),a(62953);function i(t){return Array.isArray(t)?t.reverse().reduce((t,e)=>`var(${e}${t?`, ${t}`:""})`,void 0):`var(${t})`}function o(t,e){if(Array.isArray(t))for(const a of t){const t=o(a,e);if(t)return t}else if(t.endsWith("-color"))return e.getPropertyValue(t).trim()||void 0}},53580:function(t,e,a){"use strict";a.d(e,{mdiHomeAssistant:function(){return i}});const i="m12.151 1.5882c-.3262 0-.6523.1291-.8996.3867l-8.3848 8.7354c-.0619.0644-.1223.1368-.1807.2154-.0588.0789-.1151.1638-.1688.2534-.2593.4325-.4552.9749-.5232 1.4555-.0026.018-.0076.0369-.0094.0548-.0121.0987-.0184.1944-.0184.2857v8.0124a1.2731 1.2731 0 001.2731 1.2731h7.8313l-3.4484-3.593a1.7399 1.7399 0 111.0803-1.125l2.6847 2.7972v-10.248a1.7399 1.7399 0 111.5276-0v7.187l2.6702-2.782a1.7399 1.7399 0 111.0566 1.1505l-3.7269 3.8831v2.7299h8.174a1.2471 1.2471 0 001.2471-1.2471v-8.0375c0-.0912-.0059-.1868-.0184-.2855-.0603-.4935-.2636-1.0617-.5326-1.5105-.0537-.0896-.1101-.1745-.1684-.253-.0588-.079-.1191-.1513-.181-.2158l-8.3848-8.7363c-.2473-.2577-.5735-.3866-.8995-.3864"},85614:function(t,e,a){"use strict";a.d(e,{i:function(){return i}});a(3362),a(62953);const i=async()=>{await Promise.all([a.e(38085),a.e(22309)]).then(a.bind(a,40772))}},996:function(t,e,a){"use strict";a.d(e,{G:function(){return i}});a(45367),a(92731),a(62953);class i{get(t){return this._cache.get(t)}set(t,e){this._cache.set(t,e),this._expiration&&window.setTimeout(()=>this._cache.delete(t),this._expiration)}has(t){return this._cache.has(t)}constructor(t){this._cache=new Map,this._expiration=t}}},22348:function(t,e,a){"use strict";a.d(e,{V:function(){return o}});var i=a(37177);const o=t=>!!t&&i.n},37177:function(t,e,a){"use strict";a.d(e,{n:function(){return i}});a(27495);const i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},88438:function(t,e,a){"use strict";a.d(e,{C:function(){return i}});const i="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0},46571:function(t){function e(t){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}e.keys=function(){return[]},e.resolve=e,e.id=46571,t.exports=e},62003:function(t,e,a){var i={"./ha-icon-prev":["89133",[61982]],"./ha-icon-button-toolbar":["9882",[39763,41983]],"./ha-alert":["38962",[19695]],"./ha-icon-button-toggle":["62501",[77254]],"./ha-svg-icon.ts":["67094",[]],"./ha-alert.ts":["38962",[19695]],"./ha-icon":["47680",[44889]],"./ha-icon-next.ts":["43661",[63902]],"./ha-qr-code.ts":["60543",[51343,62740]],"./ha-icon-overflow-menu.ts":["75248",[39763,34995,78097]],"./ha-icon-button-toggle.ts":["62501",[77254]],"./ha-icon-button-group":["39826",[13647]],"./ha-svg-icon":["67094",[]],"./ha-icon-button-prev":["45100",[99197]],"./ha-icon-button.ts":["26300",[]],"./ha-icon-overflow-menu":["75248",[39763,34995,78097]],"./ha-icon-button-arrow-next":["99028",[54101]],"./ha-icon-button-prev.ts":["45100",[99197]],"./ha-icon-picker":["64138",[39763,32450,46095,7305,92769,3283,62574,26092,39005,32301]],"./ha-icon-button-toolbar.ts":["9882",[39763,41983]],"./ha-icon-button-arrow-prev.ts":["90248",[17041]],"./ha-icon-button-next":["3059",[81049]],"./ha-icon-next":["43661",[63902]],"./ha-icon-picker.ts":["64138",[39763,32450,46095,7305,92769,3283,62574,26092,39005,32301]],"./ha-icon-prev.ts":["89133",[61982]],"./ha-icon-button-arrow-prev":["90248",[17041]],"./ha-icon-button-next.ts":["3059",[81049]],"./ha-icon.ts":["47680",[44889]],"./ha-qr-code":["60543",[51343,62740]],"./ha-icon-button":["26300",[]],"./ha-icon-button-group.ts":["39826",[13647]],"./ha-icon-button-arrow-next.ts":["99028",[54101]]};function o(t){if(!a.o(i,t))return Promise.resolve().then(function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e});var e=i[t],o=e[0];return Promise.all(e[1].map(a.e)).then(function(){return a(o)})}o.keys=function(){return Object.keys(i)},o.id=62003,t.exports=o}}]);