UNPKG

iobroker.lovelace

Version:

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

11 lines 153 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["90296"],{72344:function(e,t,i){i.d(t,{p:()=>a});i(19083),i(61006);const a=(e,t)=>e&&e.config.components.includes(t)},17803:function(e,t,i){i.d(t,{I:()=>a,_:()=>s});i(19083),i(71695),i(61006),i(47021);const a=(e,t,i,a)=>{const[s,n,o]=e.split(".",3);return Number(s)>t||Number(s)===t&&(void 0===a?Number(n)>=i:Number(n)>i)||void 0!==a&&Number(s)===t&&Number(n)===i&&Number(o)>=a},s=e=>e.includes("dev")},73358:function(e,t,i){i.d(t,{AF:()=>o,Kk:()=>c,PS:()=>a,a5:()=>n,gD:()=>p,iY:()=>u,lC:()=>d,ot:()=>h,tj:()=>l,uo:()=>r,zF:()=>s});i(71695),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(47021);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"],l=["closed","locked","off"],r="on",d="off",c=new Set(["fan","input_boolean","light","switch","group","automation","humidifier","valve"]),u=new Set(["camera","image","media_player"]),h="°C",p="°F"},19631:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{Bt:()=>d,T8:()=>c});i(19083);var s=i(16485),n=i(88977),o=i(20382),l=e([s]);s=(l.then?(await l)():l)[0];const r=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],d=e=>e.first_weekday===o.FS.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(e.language).weekInfo.firstDay%7:(0,n.L)(e.language)%7:r.includes(e.first_weekday)?r.indexOf(e.first_weekday):1,c=e=>{const t=d(e);return r[t]};a()}catch(r){a(r)}}))},94947:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{G:()=>d});var s=i(16485),n=i(27486),o=i(27046),l=e([s,o]);[s,o]=l.then?(await l)():l;const r=(0,n.Z)((e=>new Intl.RelativeTimeFormat(e.language,{numeric:"auto"}))),d=(e,t,i,a=!0)=>{const s=(0,o.W)(e,i,t);return a?r(t).format(s.value,s.unit):Intl.NumberFormat(t.language,{style:"unit",unit:s.unit,unitDisplay:"long"}).format(Math.abs(s.value))};a()}catch(r){a(r)}}))},49976:function(e,t,i){i.d(t,{U:()=>a});const a=e=>e.stopPropagation()},90122:function(e,t,i){i.d(t,{X:()=>a});const a=(e,t,i)=>(void 0!==i&&(i=!!i),e.hasAttribute(t)?!!i||(e.removeAttribute(t),!1):!1!==i&&(e.setAttribute(t,""),!0))},31064:function(e,t,i){i.d(t,{T:()=>s});i(19134),i(5740);const a=/^(\w+)\.(\w+)$/,s=e=>a.test(e)},94369:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{u:()=>l});var s=i(16485),n=i(27486),o=e([s]);s=(o.then?(await o)():o)[0];const l=(e,t)=>{try{var i,a;return null!==(i=null===(a=r(t))||void 0===a?void 0:a.of(e))&&void 0!==i?i:e}catch(s){return e}},r=(0,n.Z)((e=>new Intl.DisplayNames(e.language,{type:"language",fallback:"code"})));a()}catch(l){a(l)}}))},50602:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{SL:()=>r,l4:()=>h,sJ:()=>d,uf:()=>u});var s=i(16485),n=(i(19083),i(19423),i(11740),i(61006),i(20382)),o=i(34618),l=e([s]);s=(l.then?(await l)():l)[0];const r=e=>d(e.attributes),d=(e,t)=>!!e.unit_of_measurement||!!e.state_class||(t||[]).includes(e.device_class||""),c=e=>{switch(e.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 e.language}},u=(e,t,i)=>{const a=t?c(t):void 0;return Number.isNaN=Number.isNaN||function e(t){return"number"==typeof t&&e(t)},(null==t?void 0:t.number_format)===n.y4.none||Number.isNaN(Number(e))?Number.isNaN(Number(e))||""===e||(null==t?void 0:t.number_format)!==n.y4.none?"string"==typeof e?e:`${(0,o.N)(e,null==i?void 0:i.maximumFractionDigits).toString()}${"currency"===(null==i?void 0:i.style)?` ${i.currency}`:""}`:new Intl.NumberFormat("en-US",p(e,Object.assign(Object.assign({},i),{},{useGrouping:!1}))).format(Number(e)):new Intl.NumberFormat(a,p(e,i)).format(Number(e))},h=(e,t)=>{var i;const a=null==t?void 0:t.display_precision;return null!=a?{maximumFractionDigits:a,minimumFractionDigits:a}:Number.isInteger(Number(null==e||null===(i=e.attributes)||void 0===i?void 0:i.step))&&Number.isInteger(Number(null==e?void 0:e.state))?{maximumFractionDigits:0}:void 0},p=(e,t)=>{const i=Object.assign({maximumFractionDigits:2},t);if("string"!=typeof e)return i;if(!t||void 0===t.minimumFractionDigits&&void 0===t.maximumFractionDigits){const t=e.indexOf(".")>-1?e.split(".")[1].length:0;i.minimumFractionDigits=t,i.maximumFractionDigits=t}return i};a()}catch(r){a(r)}}))},34618:function(e,t,i){i.d(t,{N:()=>a});const a=(e,t=2)=>Math.round(e*10**t)/10**t},87733:function(e,t,i){i.d(t,{f:()=>a});const a=e=>e.charAt(0).toUpperCase()+e.slice(1)},48045:function(e,t,i){i.d(t,{v:()=>a});i(71695),i(69235),i(12385),i(19134),i(32517),i(11740),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(47021);const a=(e,t)=>{if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;let i,s;if(Array.isArray(e)){if(s=e.length,s!==t.length)return!1;for(i=s;0!=i--;)if(!a(e[i],t[i]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i of e.entries())if(!t.has(i[0]))return!1;for(i of e.entries())if(!a(i[1],t.get(i[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i of e.entries())if(!t.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(s=e.length,s!==t.length)return!1;for(i=s;0!=i--;)if(e[i]!==t[i])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e);if(s=n.length,s!==Object.keys(t).length)return!1;for(i=s;0!=i--;)if(!Object.prototype.hasOwnProperty.call(t,n[i]))return!1;for(i=s;0!=i--;){const s=n[i];if(!a(e[s],t[s]))return!1}return!0}return e!=e&&t!=t}},37394:function(e,t,i){i.d(t,{n:()=>s});i(52247),i(71695),i(40251),i(47021);class a extends Error{constructor(e,...t){super(...t),this.timeout=void 0,Error.captureStackTrace&&Error.captureStackTrace(this,a),this.name="TimeoutError",this.timeout=e,this.message=`Timed out in ${e} ms.`}}const s=(e,t)=>{const i=new Promise(((t,i)=>{setTimeout((()=>{i(new a(e))}),e)}));return Promise.race([t,i])}},27046:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{W:()=>p});i(19423);var s=i(13809),n=i(29558),o=i(94763),l=i(19631),r=e([l]);l=(r.then?(await r)():r)[0];const c=1e3,u=60,h=60*u;function p(e,t=Date.now(),i,a={}){const r=Object.assign(Object.assign({},v),a||{}),d=(+e-+t)/c;if(Math.abs(d)<r.second)return{value:Math.round(d),unit:"second"};const p=d/u;if(Math.abs(p)<r.minute)return{value:Math.round(p),unit:"minute"};const f=d/h;if(Math.abs(f)<r.hour)return{value:Math.round(f),unit:"hour"};const g=new Date(e),_=new Date(t);g.setHours(0,0,0,0),_.setHours(0,0,0,0);const y=(0,s.j)(g,_);if(0===y)return{value:Math.round(f),unit:"hour"};if(Math.abs(y)<r.day)return{value:y,unit:"day"};const m=(0,l.Bt)(i),k=(0,n.z)(g,{weekStartsOn:m}),b=(0,n.z)(_,{weekStartsOn:m}),w=(0,o.p)(k,b);if(0===w)return{value:y,unit:"day"};if(Math.abs(w)<r.week)return{value:w,unit:"week"};const $=g.getFullYear()-_.getFullYear(),x=12*$+g.getMonth()-_.getMonth();return 0===x?{value:w,unit:"week"}:Math.abs(x)<r.month||0===$?{value:x,unit:"month"}:{value:Math.round($),unit:"year"}}const v={second:45,minute:45,hour:22,day:5,week:4,month:11};a()}catch(d){a(d)}}))},60370:function(e,t,i){var a=i(61701),s=i(72621),n=(i(71695),i(19423),i(47021),i(10445)),o=i(57243),l=i(50778);let r,d,c,u,h=e=>e;(0,a.Z)([(0,l.Mo)("ha-assist-chip")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)({type:Boolean,reflect:!0})],key:"filled",value(){return!1}},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"active",value(){return!1}},{kind:"field",static:!0,key:"styles",value(){return[...(0,s.Z)(i,"styles",this),(0,o.iv)(r||(r=h`:host{--md-sys-color-primary:var(--primary-text-color);--md-sys-color-on-surface:var(--primary-text-color);--md-assist-chip-container-shape:var(
          --ha-assist-chip-container-shape,
          16px
        );--md-assist-chip-outline-color:var(--outline-color);--md-assist-chip-label-text-weight:400}.filled{display:flex;pointer-events:none;border-radius:inherit;inset:0;position:absolute;background-color:var(--ha-assist-chip-filled-container-color)}::slotted([slot=icon]),::slotted([slot=trailing-icon]){display:flex;--mdc-icon-size:var(--md-input-chip-icon-size, 18px);font-size:var(--_label-text-size)!important}.trailing.icon ::slotted(*),.trailing.icon svg{margin-inline-end:unset;margin-inline-start:var(--_icon-label-space)}::before{background:var(--ha-assist-chip-container-color,transparent);opacity:var(--ha-assist-chip-container-opacity, 1)}:where(.active)::before{background:var(--ha-assist-chip-active-container-color);opacity:var(--ha-assist-chip-active-container-opacity)}.label{font-family:Roboto,sans-serif}`))]}},{kind:"method",key:"renderOutline",value:function(){return this.filled?(0,o.dy)(d||(d=h`<span class="filled"></span>`)):(0,s.Z)(i,"renderOutline",this,3)([])}},{kind:"method",key:"getContainerClasses",value:function(){return Object.assign(Object.assign({},(0,s.Z)(i,"getContainerClasses",this,3)([])),{},{active:this.active})}},{kind:"method",key:"renderPrimaryContent",value:function(){return(0,o.dy)(c||(c=h` <span class="leading icon" aria-hidden="true"> ${0} </span> <span class="label">${0}</span> <span class="touch"></span> <span class="trailing leading icon" aria-hidden="true"> ${0} </span> `),this.renderLeadingIcon(),this.label,this.renderTrailingIcon())}},{kind:"method",key:"renderTrailingIcon",value:function(){return(0,o.dy)(u||(u=h`<slot name="trailing-icon"></slot>`))}}]}}),n.X)},81282:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=(i(19083),i(71695),i(9359),i(68107),i(56475),i(70104),i(52924),i(19423),i(40251),i(61006),i(47021),i(57243)),n=i(50778),o=i(35359),l=i(27486),r=i(36522),d=i(73850),c=i(24360),u=i(82100),h=i(71857),p=i(76131),v=i(61107),f=i(94279),g=(i(23334),i(7285),i(37583),e([f]));f=(g.then?(await g)():g)[0];let _,y,m,k,b=e=>e;const w="M20 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V4C22 2.9 21.11 2 20 2M4 6L6 4H10.9L4 10.9V6M4 13.7L13.7 4H18.6L4 18.6V13.7M20 18L18 20H13.1L20 13.1V18M20 10.3L10.3 20H5.4L20 5.4V10.3Z",$=e=>(0,s.dy)(_||(_=b`<ha-list-item graphic="icon" class="${0}"> ${0} ${0} </ha-list-item>`),(0,o.$)({"add-new":e.area_id===x}),e.icon?(0,s.dy)(y||(y=b`<ha-icon slot="graphic" .icon="${0}"></ha-icon>`),e.icon):(0,s.dy)(m||(m=b`<ha-svg-icon slot="graphic" .path="${0}"></ha-svg-icon>`),w),e.name),x="___ADD_NEW___",C="___NO_ITEMS___",S="___ADD_NEW_SUGGESTION___";(0,a.Z)([(0,n.Mo)("ha-area-picker")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"placeholder",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"no-add"})],key:"noAdd",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Array,attribute:"include-domains"})],key:"includeDomains",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Array,attribute:"exclude-domains"})],key:"excludeDomains",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Array,attribute:"include-device-classes"})],key:"includeDeviceClasses",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Array,attribute:"exclude-areas"})],key:"excludeAreas",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"deviceFilter",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"entityFilter",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,n.SB)()],key:"_opened",value:void 0},{kind:"field",decorators:[(0,n.IO)("ha-combo-box",!0)],key:"comboBox",value:void 0},{kind:"field",key:"_suggestion",value:void 0},{kind:"field",key:"_init",value(){return!1}},{kind:"method",key:"open",value:async function(){var e;await this.updateComplete,await(null===(e=this.comboBox)||void 0===e?void 0:e.open())}},{kind:"method",key:"focus",value:async function(){var e;await this.updateComplete,await(null===(e=this.comboBox)||void 0===e?void 0:e.focus())}},{kind:"field",key:"_getAreas",value(){return(0,l.Z)(((e,t,i,a,s,n,o,l,r,c)=>{let u,p,v={};(a||s||n||o||l)&&(v=(0,h.R6)(i),u=t,p=i.filter((e=>e.area_id)),a&&(u=u.filter((e=>{const t=v[e.id];return!(!t||!t.length)&&v[e.id].some((e=>a.includes((0,d.M)(e.entity_id))))})),p=p.filter((e=>a.includes((0,d.M)(e.entity_id))))),s&&(u=u.filter((e=>{const t=v[e.id];return!t||!t.length||i.every((e=>!s.includes((0,d.M)(e.entity_id))))})),p=p.filter((e=>!s.includes((0,d.M)(e.entity_id))))),n&&(u=u.filter((e=>{const t=v[e.id];return!(!t||!t.length)&&v[e.id].some((e=>{const t=this.hass.states[e.entity_id];return!!t&&(t.attributes.device_class&&n.includes(t.attributes.device_class))}))})),p=p.filter((e=>{const t=this.hass.states[e.entity_id];return t.attributes.device_class&&n.includes(t.attributes.device_class)}))),o&&(u=u.filter((e=>o(e)))),l&&(u=u.filter((e=>{const t=v[e.id];return!(!t||!t.length)&&v[e.id].some((e=>{const t=this.hass.states[e.entity_id];return!!t&&l(t)}))})),p=p.filter((e=>{const t=this.hass.states[e.entity_id];return!!t&&l(t)}))));let f,g=e;return u&&(f=u.filter((e=>e.area_id)).map((e=>e.area_id))),p&&(f=(null!=f?f:[]).concat(p.filter((e=>e.area_id)).map((e=>e.area_id)))),f&&(g=g.filter((e=>f.includes(e.area_id)))),c&&(g=g.filter((e=>!c.includes(e.area_id)))),g.length||(g=[{area_id:C,floor_id:null,name:this.hass.localize("ui.components.area-picker.no_areas"),picture:null,icon:null,aliases:[],labels:[],temperature_entity_id:null,humidity_entity_id:null,created_at:0,modified_at:0}]),r?g:[...g,{area_id:x,floor_id:null,name:this.hass.localize("ui.components.area-picker.add_new"),picture:null,icon:"mdi:plus",aliases:[],labels:[],temperature_entity_id:null,humidity_entity_id:null,created_at:0,modified_at:0}]}))}},{kind:"method",key:"updated",value:function(e){if(!this._init&&this.hass||this._init&&e.has("_opened")&&this._opened){this._init=!0;const e=this._getAreas(Object.values(this.hass.areas),Object.values(this.hass.devices),Object.values(this.hass.entities),this.includeDomains,this.excludeDomains,this.includeDeviceClasses,this.deviceFilter,this.entityFilter,this.noAdd,this.excludeAreas).map((e=>Object.assign(Object.assign({},e),{},{strings:[e.area_id,...e.aliases,e.name]})));this.comboBox.items=e,this.comboBox.filteredItems=e}}},{kind:"method",key:"render",value:function(){var e;return(0,s.dy)(k||(k=b` <ha-combo-box .hass="${0}" .helper="${0}" item-value-path="area_id" item-id-path="area_id" item-label-path="name" .value="${0}" .disabled="${0}" .required="${0}" .label="${0}" .placeholder="${0}" .renderer="${0}" @filter-changed="${0}" @opened-changed="${0}" @value-changed="${0}"> </ha-combo-box> `),this.hass,this.helper,this._value,this.disabled,this.required,void 0===this.label&&this.hass?this.hass.localize("ui.components.area-picker.area"):this.label,this.placeholder?null===(e=this.hass.areas[this.placeholder])||void 0===e?void 0:e.name:void 0,$,this._filterChanged,this._openedChanged,this._areaChanged)}},{kind:"method",key:"_filterChanged",value:function(e){var t;const i=e.target,a=e.detail.value;if(!a)return void(this.comboBox.filteredItems=this.comboBox.items);const s=(0,c.q)(a,(null===(t=i.items)||void 0===t?void 0:t.filter((e=>![C,x].includes(e.label_id))))||[]);0===s.length?this.noAdd?(this._suggestion=a,this.comboBox.filteredItems=[{area_id:S,floor_id:null,name:this.hass.localize("ui.components.area-picker.add_new_sugestion",{name:this._suggestion}),icon:"mdi:plus",picture:null,labels:[],aliases:[],temperature_entity_id:null,humidity_entity_id:null,created_at:0,modified_at:0}]):this.comboBox.filteredItems=[{area_id:C,floor_id:null,name:this.hass.localize("ui.components.area-picker.no_match"),icon:null,picture:null,labels:[],aliases:[],temperature_entity_id:null,humidity_entity_id:null,created_at:0,modified_at:0}]:this.comboBox.filteredItems=s}},{kind:"get",key:"_value",value:function(){return this.value||""}},{kind:"method",key:"_openedChanged",value:function(e){this._opened=e.detail.value}},{kind:"method",key:"_areaChanged",value:function(e){e.stopPropagation();let t=e.detail.value;if(t===C)return t="",void this.comboBox.setInputValue("");[S,x].includes(t)?(e.target.value=this._value,this.hass.loadFragmentTranslation("config"),(0,v.E)(this,{suggestedName:t===S?this._suggestion:"",createEntry:async e=>{try{const t=await(0,u.Lo)(this.hass,e),i=[...Object.values(this.hass.areas),t];this.comboBox.filteredItems=this._getAreas(i,Object.values(this.hass.devices),Object.values(this.hass.entities),this.includeDomains,this.excludeDomains,this.includeDeviceClasses,this.deviceFilter,this.entityFilter,this.noAdd,this.excludeAreas),await this.updateComplete,await this.comboBox.updateComplete,this._setValue(t.area_id)}catch(t){(0,p.showAlertDialog)(this,{title:this.hass.localize("ui.components.area-picker.failed_create_area"),text:t.message})}}}),this._suggestion=void 0,this.comboBox.setInputValue("")):t!==this._value&&this._setValue(t)}},{kind:"method",key:"_setValue",value:function(e){this.value=e,setTimeout((()=>{(0,r.B)(this,"value-changed",{value:e}),(0,r.B)(this,"change")}),0)}}]}}),s.oi);t()}catch(_){t(_)}}))},59826:function(e,t,i){var a=i(61701),s=(i(71695),i(47021),i(31622)),n=i(57243),o=i(50778),l=i(22344);let r,d=e=>e;(0,a.Z)([(0,o.Mo)("ha-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value(){return[l.W,(0,n.iv)(r||(r=d`::slotted([slot=icon]){margin-inline-start:0px;margin-inline-end:8px;direction:var(--direction);display:block}.mdc-button{height:var(--button-height,36px)}.trailing-icon{display:flex}.slot-container{overflow:var(--button-slot-container-overflow,visible)}:host([destructive]){--mdc-theme-primary:var(--error-color)}`))]}}]}}),s.Button)},94279:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=i(72621),n=(i(71695),i(9359),i(31526),i(40251),i(47021),i(2394)),o=i(28737),l=i(43631),r=i(57243),d=i(50778),c=i(20552),u=i(36522),h=(i(23334),i(7285),i(83166),e([o]));o=(h.then?(await h)():h)[0];let p,v,f,g,_,y,m=e=>e;const k="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",b="M7,10L12,15L17,10H7Z",w="M7,15L12,10L17,15H7Z";(0,l.hC)("vaadin-combo-box-item",(0,r.iv)(p||(p=m`:host{padding:0!important}:host([focused]:not([disabled])){background-color:rgba(var(--rgb-primary-text-color,0,0,0),.12)}:host([selected]:not([disabled])){background-color:transparent;color:var(--mdc-theme-primary);--mdc-ripple-color:var(--mdc-theme-primary);--mdc-theme-text-primary-on-background:var(--mdc-theme-primary)}:host([selected]:not([disabled])):before{background-color:var(--mdc-theme-primary);opacity:.12;content:"";position:absolute;top:0;left:0;width:100%;height:100%}:host([selected][focused]:not([disabled])):before{opacity:.24}:host(:hover:not([disabled])){background-color:transparent}[part=content]{width:100%}[part=checkmark]{display:none}`)));(0,a.Z)([(0,d.Mo)("ha-combo-box")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"placeholder",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"validationMessage",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"invalid",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"icon",value(){return!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(){return!1}},{kind:"field",decorators:[(0,d.Cb)({attribute:"item-value-path"})],key:"itemValuePath",value(){return"value"}},{kind:"field",decorators:[(0,d.Cb)({attribute:"item-label-path"})],key:"itemLabelPath",value(){return"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(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"opened",value(){return!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(){var e;await this.updateComplete,null===(e=this._comboBox)||void 0===e||e.open()}},{kind:"method",key:"focus",value:async function(){var e,t;await this.updateComplete,await(null===(e=this._inputElement)||void 0===e?void 0:e.updateComplete),null===(t=this._inputElement)||void 0===t||t.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(e){this._comboBox.value=e}},{kind:"method",key:"render",value:function(){var e;return(0,r.dy)(v||(v=m` <vaadin-combo-box-light .itemValuePath="${0}" .itemIdPath="${0}" .itemLabelPath="${0}" .items="${0}" .value="${0}" .filteredItems="${0}" .dataProvider="${0}" .allowCustomValue="${0}" .disabled="${0}" .required="${0}" ${0} @opened-changed="${0}" @filter-changed="${0}" @value-changed="${0}" attr-for-value="value"> <ha-textfield label="${0}" placeholder="${0}" ?disabled="${0}" ?required="${0}" validationMessage="${0}" .errorMessage="${0}" class="input" autocapitalize="none" autocomplete="off" autocorrect="off" input-spellcheck="false" .suffix="${0}" .icon="${0}" .invalid="${0}" .helper="${0}" helperPersistent> <slot name="icon" slot="leadingIcon"></slot> </ha-textfield> ${0} <ha-svg-icon role="button" tabindex="-1" aria-label="${0}" aria-expanded="${0}" class="toggle-button" .path="${0}" @click="${0}"></ha-svg-icon> </vaadin-combo-box-light> `),this.itemValuePath,this.itemIdPath,this.itemLabelPath,this.items,this.value||"",this.filteredItems,this.dataProvider,this.allowCustomValue,this.disabled,this.required,(0,n.t)(this.renderer||this._defaultRowRenderer),this._openedChanged,this._filterChanged,this._valueChanged,(0,c.o)(this.label),(0,c.o)(this.placeholder),this.disabled,this.required,(0,c.o)(this.validationMessage),this.errorMessage,(0,r.dy)(f||(f=m`<div style="width:28px" role="none presentation"></div>`)),this.icon,this.invalid,this.helper,this.value?(0,r.dy)(g||(g=m`<ha-svg-icon role="button" tabindex="-1" aria-label="${0}" class="clear-button" .path="${0}" @click="${0}"></ha-svg-icon>`),(0,c.o)(null===(e=this.hass)||void 0===e?void 0:e.localize("ui.common.clear")),k,this._clearValue):"",(0,c.o)(this.label),this.opened?"true":"false",this.opened?w:b,this._toggleOpen)}},{kind:"field",key:"_defaultRowRenderer",value(){return e=>(0,r.dy)(_||(_=m`<ha-list-item> ${0} </ha-list-item>`),this.itemLabelPath?e[this.itemLabelPath]:e)}},{kind:"method",key:"_clearValue",value:function(e){e.stopPropagation(),(0,u.B)(this,"value-changed",{value:void 0})}},{kind:"method",key:"_toggleOpen",value:function(e){var t,i;this.opened?(null===(t=this._comboBox)||void 0===t||t.close(),e.stopPropagation()):null===(i=this._comboBox)||void 0===i||i.inputElement.focus()}},{kind:"method",key:"_openedChanged",value:function(e){e.stopPropagation();const t=e.detail.value;if(setTimeout((()=>{this.opened=t}),0),(0,u.B)(this,"opened-changed",{value:e.detail.value}),t){const e=document.querySelector("vaadin-combo-box-overlay");e&&this._removeInert(e),this._observeBody()}else{var i;null===(i=this._bodyMutationObserver)||void 0===i||i.disconnect(),this._bodyMutationObserver=void 0}}},{kind:"method",key:"_observeBody",value:function(){"MutationObserver"in window&&!this._bodyMutationObserver&&(this._bodyMutationObserver=new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{"VAADIN-COMBO-BOX-OVERLAY"===e.nodeName&&this._removeInert(e)})),e.removedNodes.forEach((e=>{var t;"VAADIN-COMBO-BOX-OVERLAY"===e.nodeName&&(null===(t=this._overlayMutationObserver)||void 0===t||t.disconnect(),this._overlayMutationObserver=void 0)}))}))})),this._bodyMutationObserver.observe(document.body,{childList:!0}))}},{kind:"method",key:"_removeInert",value:function(e){var t;if(e.inert)return e.inert=!1,null===(t=this._overlayMutationObserver)||void 0===t||t.disconnect(),void(this._overlayMutationObserver=void 0);"MutationObserver"in window&&!this._overlayMutationObserver&&(this._overlayMutationObserver=new MutationObserver((e=>{e.forEach((e=>{if("inert"===e.attributeName){const i=e.target;var t;if(i.inert)null===(t=this._overlayMutationObserver)||void 0===t||t.disconnect(),this._overlayMutationObserver=void 0,i.inert=!1}}))})),this._overlayMutationObserver.observe(e,{attributes:!0}))}},{kind:"method",key:"_filterChanged",value:function(e){e.stopPropagation(),(0,u.B)(this,"filter-changed",{value:e.detail.value})}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation(),this.allowCustomValue||(this._comboBox._closeOnBlurIsPrevented=!0);const t=e.detail.value;t!==this.value&&(0,u.B)(this,"value-changed",{value:t||void 0})}},{kind:"field",static:!0,key:"styles",value(){return(0,r.iv)(y||(y=m`: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);t()}catch(p){t(p)}}))},95198:function(e,t,i){var a=i(61701),s=(i(71695),i(47021),i(57243)),n=i(50778);let o,l,r=e=>e;(0,a.Z)([(0,n.Mo)("ha-dialog-header")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"method",key:"render",value:function(){return(0,s.dy)(o||(o=r` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> <div class="header-title"> <slot name="title"></slot> </div> <div class="header-subtitle"> <slot name="subtitle"></slot> </div> </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `))}},{kind:"get",static:!0,key:"styles",value:function(){return[(0,s.iv)(l||(l=r`: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:flex-start;padding:4px;box-sizing:border-box}.header-content{flex:1;padding:10px 4px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{font-size:22px;line-height:28px;font-weight:400}.header-subtitle{font-size:14px;line-height:20px;color:var(--secondary-text-color)}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:12px}}.header-navigation-icon{flex:none;min-width:8px;height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:8px;height:100%;display:flex;flex-direction:row}`))]}}]}}),s.oi)},65981:function(e,t,i){i.r(t),i.d(t,{HaIcon:()=>C});var a=i(61701),s=i(72621),n=(i(19083),i(71695),i(40251),i(61006),i(47021),i(57243)),o=i(50778),l=i(36522),r=i(22381),d=i(80654),c=(i(92745),i(9359),i(31526),i(27608)),u=i(27486),h=i(37394);const p=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"}]}'),v=(0,u.Z)((async()=>{const e=(0,c.MT)("hass-icon-db","mdi-icon-store");{const t=await(0,c.U2)("_version",e);t?t!==p.version&&(await(0,c.ZH)(e),(0,c.t8)("_version",p.version,e)):(0,c.t8)("_version",p.version,e)}return e})),f=["mdi","hass","hassio","hademo"];let g=[];i(37583);let _,y,m,k=e=>e;const b={},w={},$=(0,r.D)((()=>(async e=>{const t=Object.keys(e),i=await Promise.all(Object.values(e));(await v())("readwrite",(a=>{i.forEach(((i,s)=>{Object.entries(i).forEach((([e,t])=>{a.put(t,e)})),delete e[t[s]]}))}))})(w)),2e3),x={};let C=(0,a.Z)([(0,o.Mo)("ha-icon")],(function(e,t){class a extends t{constructor(...t){super(...t),e(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(){return!1}},{kind:"method",key:"willUpdate",value:function(e){(0,s.Z)(a,"willUpdate",this,3)([e]),e.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?(0,n.dy)(_||(_=k` <iron-icon .icon="${0}"></iron-icon>`),this.icon):(0,n.dy)(y||(y=k`<ha-svg-icon .path="${0}" .secondaryPath="${0}" .viewBox="${0}"></ha-svg-icon>`),this._path,this._secondaryPath,this._viewBox):n.Ld}},{kind:"method",key:"_loadIcon",value:async function(){if(!this.icon)return;const e=this.icon,[t,a]=this.icon.split(":",2);let s,n=a;if(!t||!n)return;if(!f.includes(t)){const i=d.g[t];return i?void(i&&"function"==typeof i.getIcon&&this._setCustomPath(i.getIcon(n),e)):void(this._legacy=!0)}if(this._legacy=!1,n in b){const e=b[n];let i;e.newName?(i=`Icon ${t}:${n} was renamed to ${t}:${e.newName}, please change your config, it will be removed in version ${e.removeIn}.`,n=e.newName):i=`Icon ${t}:${n} was removed from MDI, please replace this icon with an other icon in your config, it will be removed in version ${e.removeIn}.`,console.warn(i),(0,l.B)(this,"write_log",{level:"warning",message:i})}if(n in x)return void(this._path=x[n]);if("home-assistant"===n){const t=(await i.e("48348").then(i.bind(i,30511))).mdiHomeAssistant;return this.icon===e&&(this._path=t),void(x[n]=t)}try{s=await(e=>new Promise(((t,i)=>{if(g.push([e,t,i]),g.length>1)return;const a=v();(0,h.n)(1e3,(async()=>{(await a)("readonly",(e=>{for(const[t,i,a]of g)(0,c.RV)(e.get(t)).then((e=>i(e))).catch((e=>a(e)));g=[]}))})()).catch((e=>{for(const[,,t]of g)t(e);g=[]}))})))(n)}catch(u){s=void 0}if(s)return this.icon===e&&(this._path=s),void(x[n]=s);const o=(e=>{let t;for(const i of p.parts){if(void 0!==i.start&&e<i.start)break;t=i}return t.file})(n);if(o in w)return void this._setPath(w[o],n,e);const r=fetch(`/static/mdi/${o}.json`).then((e=>e.json()));w[o]=r,this._setPath(r,n,e),$()}},{kind:"method",key:"_setCustomPath",value:async function(e,t){const i=await e;this.icon===t&&(this._path=i.path,this._secondaryPath=i.secondaryPath,this._viewBox=i.viewBox)}},{kind:"method",key:"_setPath",value:async function(e,t,i){const a=await e;this.icon===i&&(this._path=a[t]),x[t]=a[t]}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(m||(m=k`:host{fill:currentcolor}`))}}]}}),n.oi)},2790:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HaLanguagePicker:()=>w,getLanguageOptions:()=>b});var s=i(61701),n=i(72621),o=i(16485),l=(i(71695),i(61893),i(9359),i(70104),i(47021),i(57243)),r=i(50778),d=i(27486),c=i(36522),u=i(49976),h=i(94369),p=i(1416),v=i(67862),f=(i(7285),i(92824),e([o,h]));[o,h]=f.then?(await f)():f;let g,_,y,m,k=e=>e;const b=(e,t,i,a)=>{let s=[];if(t){const t=v.o.translations;s=e.map((e=>{var i;let a=null===(i=t[e])||void 0===i?void 0:i.nativeName;if(!a)try{a=new Intl.DisplayNames(e,{type:"language",fallback:"code"}).of(e)}catch(s){a=e}return{value:e,label:a}}))}else a&&(s=e.map((e=>({value:e,label:(0,h.u)(e,a)}))));return!i&&a&&s.sort(((e,t)=>(0,p.fe)(e.label,t.label,a.language))),s};let w=(0,s.Z)([(0,r.Mo)("ha-language-picker")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Array})],key:"languages",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,reflect:!0})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({attribute:"native-name",type:Boolean})],key:"nativeName",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({attribute:"no-sort",type:Boolean})],key:"noSort",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({attribute:"inline-arrow",type:Boolean})],key:"inlineArrow",value(){return!1}},{kind:"field",decorators:[(0,r.SB)()],key:"_defaultLanguages",value(){return[]}},{kind:"field",decorators:[(0,r.IO)("ha-select")],key:"_select",value:void 0},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(i,"firstUpdated",this,3)([e]),this._computeDefaultLanguageOptions()}},{kind:"method",key:"updated",value:function(e){(0,n.Z)(i,"updated",this,3)([e]);const t=e.has("hass")&&this.hass&&e.get("hass")&&e.get("hass").locale.language!==this.hass.locale.language;if(e.has("languages")||e.has("value")||t){var a,s;if(this._select.layoutOptions(),this._select.value!==this.value&&(0,c.B)(this,"value-changed",{value:this._select.value}),!this.value)return;const e=this._getLanguagesOptions(null!==(a=this.languages)&&void 0!==a?a:this._defaultLanguages,this.nativeName,this.noSort,null===(s=this.hass)||void 0===s?void 0:s.locale).findIndex((e=>e.value===this.value));-1===e&&(this.value=void 0),t&&this._select.select(e)}}},{kind:"field",key:"_getLanguagesOptions",value(){return(0,d.Z)(b)}},{kind:"method",key:"_computeDefaultLanguageOptions",value:function(){this._defaultLanguages=Object.keys(v.o.translations)}},{kind:"method",key:"render",value:function(){var e,t,i,a,s,n,o;const r=this._getLanguagesOptions(null!==(e=this.languages)&&void 0!==e?e:this._defaultLanguages,this.nativeName,this.noSort,null===(t=this.hass)||void 0===t?void 0:t.locale),d=null!==(i=this.value)&&void 0!==i?i:this.required?null===(a=r[0])||void 0===a?void 0:a.value:this.value;return(0,l.dy)(g||(g=k` <ha-select .label="${0}" .value="${0}" .required="${0}" .disabled="${0}" @selected="${0}" @closed="${0}" fixedMenuPosition naturalMenuWidth .inlineArrow="${0}"> ${0} </ha-select> `),null!==(s=this.label)&&void 0!==s?s:(null===(n=this.hass)||void 0===n?void 0:n.localize("ui.components.language-picker.language"))||"Language",d||"",this.required,this.disabled,this._changed,u.U,this.inlineArrow,0===r.length?(0,l.dy)(_||(_=k`<ha-list-item value="">${0}</ha-list-item>`),(null===(o=this.hass)||void 0===o?void 0:o.localize("ui.components.language-picker.no_languages"))||"No languages"):r.map((e=>(0,l.dy)(y||(y=k` <ha-list-item .value="${0}">${0}</ha-list-item> `),e.value,e.label))))}},{kind:"field",static:!0,key:"styles",value(){return(0,l.iv)(m||(m=k`ha-select{width:100%}`))}},{kind:"method",key:"_changed",value:function(e){const t=e.target;""!==t.value&&t.value!==this.value&&(this.value=t.value,(0,c.B)(this,"value-changed",{value:this.value}))}}]}}),l.oi);a()}catch(g){a(g)}}))},64780:function(e,t,i){var a=i(61701),s=(i(71695),i(47021),i(57243)),n=i(50778),o=i(76525),l=i(36522);i(96090);let r,d,c=e=>e;(0,a.Z)([(0,n.Mo)("ha-md-button-menu")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",key:o.gA,value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)()],key:"positioning",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"has-overflow"})],key:"hasOverflow",value(){return!1}},{kind:"field",decorators:[(0,n.IO)("ha-menu",!0)],key:"_menu",value:void 0},{kind:"get",key:"items",value:function(){return this._menu.items}},{kind:"method",key:"focus",value:function(){var e;this._menu.open?this._menu.focus():null===(e=this._triggerButton)||void 0===e||e.focus()}},{kind:"method",key:"render",value:function(){return(0,s.dy)(r||(r=c` <div @click="${0}"> <slot name="trigger" @slotchange="${0}"></slot> </div> <ha-menu .positioning="${0}" .hasOverflow="${0}" @opening="${0}" @closing="${0}"> <slot></slot> </ha-menu> `),this._handleClick,this._setTriggerAria,this.positioning,this.hasOverflow,this._handleOpening,this._handleClosing)}},{kind:"method",key:"_handleOpening",value:function(){(0,l.B)(this,"opening",void 0,{composed:!1})}},{kind:"method",key:"_handleClosing",value:function(){(0,l.B)(this,"closing",void 0,{composed:!1})}},{kind:"method",key:"_handleClick",value:function(){this.disabled||(this._menu.anchorElement=this,this._menu.open?this._menu.close():this._menu.show())}},{kind:"get",key:"_triggerButton",value:function(){return this.querySelector('ha-icon-button[slot="trigger"], mwc-button[slot="trigger"], ha-assist-chip[slot="trigger"]')}},{kind:"method",key:"_setTriggerAria",value:function(){this._triggerButton&&(this._triggerButton.ariaHasPopup="menu")}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(d||(d=c`:host{display:inline-block;position:relative}::slotted([disabled]){color:var(--disabled-text-color)}`))}}]}}),s.oi)},74633:function(e,t,i){var a=i(61701),s=i(72621),n=(i(71695),i(47021),i(78755)),o=i(57243),l=i(50778);let r,d=e=>e;(0,a.Z)([(0,l.Mo)("ha-md-list-item")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",static:!0,key:"styles",value(){return[...(0,s.Z)(i,"styles",this),(0,o.iv)(r||(r=d`:host{--ha-icon-display:block;--md-sys-color-primary:var(--primary-text-color);--md-sys-color-secondary:var(--secondary-text-color);--md-sys-color-surface:var(--card-background-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--secondary-text-color)}md-item{overflow:var(--md-item-overflow,hidden);align-items:var(--md-item-align-items,center)}`))]}}]}}),n.g)},19993:function(e,t,i){var a=i(61701),s=i(72621),n=(i(71695),i(47021),i(623)),o=i(57243),l=i(50778);let r,d=e=>e;(0,a.Z)([(0,l.Mo)("ha-md-list")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",static:!0,key:"styles",value(){return[...(0,s.Z)(i,"styles",this),(0,o.iv)(r||(r=d`:host{--md-sys-color-surface:var(--card-background-color)}`))]}}]}}),n.j)},96090:function(e,t,i){var a=i(61701),s=i(72621),n=(i(71695),i(47021),i(53336)),o=i(7162),l=i(57243),r=i(50778);let d,c=e=>e;(0,a.Z)([(0,r.Mo)("ha-menu")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"method",key:"connectedCallback",value:function(){(0,s.Z)(i,"connectedCallback",this,3)([]),this.addEventListener("close-menu",this._handleCloseMenu)}},{kind:"method",key:"_handleCloseMenu",value:function(e){var t,i;e.detail.reason.kind===o.GB.KEYDOWN&&e.detail.reason.key===o.KC.ESCAPE||null===(t=(i=e.detail.initiator).clickAction)||void 0===t||t.call(i,e.detail.initiator)}},{kind:"field",static:!0,key:"styles",value(){return[...(0,s.Z)(i,"styles",this),(0,l.iv)(d||(d=c`:host{--md-sys-color-surface-container:var(--card-background-color)}`))]}}]}}),n.xX)},34326:function(e,t,i){var a=i(61701),s=(i(71695),i(47021),i(57243)),n=i(50778);i(23334),i(83166);let o,l,r,d=e=>e;(0,a.Z)([(0,n.Mo)("ha-password-field")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"icon",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"iconTrailing",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"value",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"placeholder",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"label",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Number})],key:"minLength",value(){return-1}},{kind:"field",decorators:[(0,n.Cb)({type:Number})],key:"maxLength",value(){return-1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"outlined",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"helper",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"validateOnInitialRender",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"validationMessage",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"autoValidate",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"pattern",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:Number})],key:"size",value(){return null}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"helperPersistent",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"charCounter",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"endAligned",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"prefix",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"suffix",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"name",value(){return""}},{kind:"field",decorators:[(0,n.Cb)({type:String,attribute:"input-mode"})],key:"inputMode",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"readOnly",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({attribute:!1,type:String})],key:"autocapitalize",value(){return""}},{kind:"field",decorators:[(0,n.SB)()],key:"_unmaskedPassword",value(){return!1}},{kind:"field",decorators:[(0,n.IO)("ha-textfield")],key:"_textField",value:void 0},{kind:"method",key:"render",value:function(){var e;return(0,s.dy)(o||(o=d`<ha-textfield .invalid="${0}" .errorMessage="${0}" .icon="${0}" .iconTrailing="${0}" .autocomplete="${0}" .autocorrect="${0}" .inputSpellcheck="${0}" .value="${0}" .placeholder="${0}" .label="${0}" .disabled="${0}" .required="${0}" .minLength="${0}" .maxLength="${0}" .outlined="${0}" .helper="${0}" .validateOnInitialRender="${0}" .validationMessage="${0}" .autoValidate="${0}" .pattern="${0}" .size="${0}" .helperPersistent="${0}" .charCounter="${0}" .endAligned="${0}" .prefix="${0}" .name="${0}" .inputMode="${0}" .readOnly="${0}" .autocapitalize="${0}" .type="${0}" .suffix="${0}" @input="${0}" @change="${0}"></ha-textfield> <ha-icon-button .label="${0}" @click="${0}" .path="${0}"></ha-icon-button>`),this.invalid,this.errorMessage,this.icon,this.iconTrailing,this.autocomplete,this.autocorrect,this.inputSpellcheck,this.value,this.placeholder,this.label,this.disabled,this.required,this.minLength,this.maxLength,this.outlined,this.helper,this.validateOnInitialRender,this.validationMessage,this.autoValidate,this.pattern,this.size,this.helperPersistent,this.charCounter,this.endAligned,this.prefix,this.name,this.inputMode,this.readOnly,this.autocapitalize,this._unmaskedPassword?"text":"password",(0,s.dy)(l||(l=d`<div style="width:24px"></div>`)),this._handleInputEvent,this._handleChangeEvent,(null===(e=this.hass)||void 0===e?void 0:e.localize(this._unmaskedPassword?"ui.components.selectors.text.hide_password":"ui.components.selectors.text.show_password"))||(this._unmaskedPassword?"Hide password":"Show password"),this._toggleUnmaskedPassword,this._unmaskedPassword?"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z":"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z")}},{kind:"method",key:"focus",value:function(){this._textField.focus()}},{kind:"method",key:"checkValidity",value:function(){return this._textField.checkValidity()}},{kind:"method",key:"reportValidity",value:function(){return this._textField.reportValidity()}},{kind:"method",key:"setCustomValidity",value:function(e){return this._textField.setCustomValidity(e)}},{kind:"method",key:"layout",value:function(){return this._textField.layout()}},{kind:"method",key:"_toggleUnmaskedPassword",value:function(){this._unmaskedPassword=!this._unmaskedPassword}},{kind:"method",decorators:[(0,n.hO)({passive:!0})],key:"_handleInputEvent",value:function(e){this.value=e.target.value}},{kind:"method",decorators:[(0,n.hO)({passive:!0})],key:"_handleChangeEvent",value:function(e){this.value=e.target.value,this._reDispatchEvent(e)}},{kind:"method",key:"_reDispatchEvent",value:function(e){const t=new Event(e.type,e);this.dispatchEvent(t)}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(r||(r=d`:host{display:block;position:relative}ha-textfield{width:100%}ha-icon-button{position:absolute;top:8px;right:8px;inset-inline-start:initial;inset-inline-end:8px;--mdc-icon-button-size:40px;--mdc-icon-size:20px;color:var(--secondary-text-color);direction:var(--direction)}`))}}]}}),s.oi)},23243:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=i(72621),n=(i(71695),i(47021),i(26749)),o=i(77118),l=i(57243),r=i(50778),d=e([n]);n=(d.then?(await d)():d)[0];let c,u=e=>e;(0,a.Z)([(0,r.Mo)("ha-progress-ring")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,s.Z)(i,"updated",this,3)([e]),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-progress-ring-size","16px");break;case"small":this.style.setProperty("--ha-progress-ring-size","28px");break;case"medium":this.style.setProperty("--ha-progress-ring-size","48px");break;case"large":this.style.setProperty("--ha-progress-ring-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}},{kind:"field",static:!0,key:"styles",value(){return[o.Z,(0,l.iv)(c||(c=u`:host{--indicator-color:var(
          --ha-progress-ring-indicator-color,
          var(--primary-color)
        );--track-color:var(
          --ha-progress-ring-divider-color,
          var(--divider-color)
        );--track-width:4px;--speed:3.5s;--size:var(--ha-progress-ring-size, 48px)}`))]}}]}}),n.Z);t()}catch(c){t(c)}}))},72781:function(e,t,i){var a=i(61701),s=(i(71695),i(47021),i(47711)),n=i(81577),o=i(57243),l=i(50778);let r,d=e=>e;(0,a.Z)([(0,l.Mo)("ha-radio")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value(){return[n.W,(0,o.iv)(r||(r=d`:host{--mdc-theme-secondary:var(--primary-color)}`))]}}]}}),s.J)},7291:function(e,t,i){var a=i(61701),s=(i(63721),i(71695),i(9359),i(70104),i(47021),i(50778)),n=i(57243),o=(i(72781),i(35359)),l=i(69634),r=i(36522),d=i(20172),c=i(49976);let u,h,p,v,f,g=e=>e;(0,a.Z)([(0,s.Mo)("ha-select-box")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"options",value(){return[]}},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"value",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Number,attribute:"max_columns"})],key:"maxColumns",value:void 0},{kind:"method",key:"render",value:function(){var e;const t=null!==(e=this.maxColumns)&&void 0!==e?e:3,i=Math.min(t,this.options.length);return(0,n.dy)(u||(u=g` <div class="list" style="${0}"> ${0} </div> `),(0,l.V)({"--columns":i}),this.options.map((e=>this._renderOption(e))))}},{kind:"method",key:"_renderOption",value:function(e){var t;const i=1===this.maxColumns,a=e.disabled||this.disabled||!1,s=e.value===this.value,l=(null===(t=this.hass)||void 0===t?void 0:t.themes.darkMode)||!1,r=!!this.hass&&(0,d.HE)(this.hass),u="object"==typeof e.image?l&&e.image.src_dark||e.image.src:e.image,f="object"==typeof e.image&&(r&&e.image.flip_rtl);return(0,n.dy)(h||(h=g` <label class="option ${0}" ?disabled="${0}" @click="${0}"> <div class="content"> <ha-radio .checked="${0}" .value="${0}" .disabled="${0}" @change="${0}" @click="${0}"></ha-radio> <div class="text"> <span class="label">${0}</span> ${0} </div> </div> ${0} </label> `),(0,o.$)({horizontal:i,selected:s}),a,this._labelClick,e.value===this.value,e.value,a,this._radioChanged,c.U,e.label,e.description?(0,n.dy)(p||(p=g`<span class="description">${0}</span>`),e.description):n.Ld,u?(0,n.dy)(v||(v=g` <img class="${0}" alt="" src="${0}"> `),f?"flipped":"",u):n.Ld)}},{kind:"method",key:"_labelClick",value:function(e){var t;e.stopPropagation(),null===(t=e.currentTarget.querySelector("ha-radio"))||void 0===t||t.click()}},{kind:"method",key:"_radioChanged",value:function(e){var t;e.stopPropagation();const i=e.currentTarget.value;this.disabled||void 0===i||i===(null!==(t=this.value)&&void 0!==t?t:"")||(0,r.B)(this,"value-changed",{value:i})}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(f||(f=g`.list{display:grid;grid-template-columns:repeat(var(--columns,1),minmax(0,1fr));gap:12px}.option{position:relative;display:block;border:1px solid var(--divider-color);border-radius:var(--ha-card-border-radius,12px);display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:12px;gap:8px;overflow:hidden;cursor:pointer}.option .content{position:relative;display:flex;flex-direction:row;gap:8px;min-width:0;width:100%}.option .content ha-radio{margin:-12px;flex:none}.option .content .text{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}.option .content .text .label{color:var(--primary-text-color);font-size:14px;font-weight:400;line-height:20px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.option .content .text .description{color:var(--secondary-text-color);font-size:13px;font-weight:400;line-height:16px}img{position:relative;max-width:var(--ha-select-box-image-size,96px);max-height:var(--ha-select-box-image-size,96px);margin:auto}.flipped{transform:scaleX(-1)}.option.horizontal{flex-direction:row;align-items:flex-start}.option.horizontal img{margin:0}.option:before{content:"";display:block;inset:0;position:absolute;background-color:transparent;pointer-events:none;opacity:.2;transition:background-color 180ms ease-in-out,opacity 180ms ease-in-out}.option:hover:before{background-color:var(--divider-color)}.option.selected:before{background-color:var(--primary-color)}.option[disabled]{cursor:not-allowed}.option[disabled] .content,.option[disabled] img{opacity:.5}.option[disabled]:before{background-color:var(--disabled-color);opacity:.05}`))}}]}}),n.oi)},92824:function(e,t,i){var a=i(61701),s=i(72621),n=(i(71695),i(40251),i(47021),i(60930)),o=i(9714),l=i(57243),r=i(50778),d=i(22381),c=i(76320);i(23334);let u,h,p,v,f=e=>e;(0,a.Z)([(0,r.Mo)("ha-select")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"icon",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,reflect:!0})],key:"clearable",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({attribute:"inline-arrow",type:Boolean})],key:"inlineArrow",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)()],key:"options",value:void 0},{kind:"method",key:"render",value:function(){return(0,l.dy)(u||(u=f` ${0} ${0} `),(0,s.Z)(i,"render",this,3)([]),this.clearable&&!this.required&&!this.disabled&&this.value?(0,l.dy)(h||(h=f`<ha-icon-button label="clear" @click="${0}" .path="${0}"></ha-icon-button>`),this._clearValue,"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"):l.Ld)}},{kind:"method",key:"renderLeadingIcon",value:function(){return this.icon?(0,l.dy)(p||(p=f`<span class="mdc-select__icon"><slot name="icon"></slot></span>`)):l.Ld}},{kind:"method",key:"connectedCallback",value:function(){(0,s.Z)(i,"connectedCallback",this,3)([]),window.addEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"firstUpdated",value:async function(){var e;((0,s.Z)(i,"firstUpdated",this,3)([]),this.inlineArrow)&&(null===(e=this.shadowRoot)||void 0===e||null===(e=e.querySelector(".mdc-select__selected-text-container"))||void 0===e||e.classList.add("inline-arrow"))}},{kind:"method",key:"updated",value:function(e){if((0,s.Z)(i,"updated",this,3)([e]),e.has("inlineArrow")){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector(".mdc-select__selected-text-container");this.inlineArrow?null==e||e.classList.add("inline-arrow"):null==e||e.classList.remove("inline-arrow")}e.get("options")&&(this.layoutOptions(),this.selectByValue(this.value))}},{kind:"method",key:"disconnectedCallback",value:function(){(0,s.Z)(i,"disconnectedCallback",this,3)([]),window.removeEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"_clearValue",value:function(){!this.disabled&&this.value&&(this.valueSetDirectly=!0,this.select(-1),this.mdcFoundation.handleChange())}},{kind:"field",key:"_translationsUpdated",value(){return(0,d.D)((async()=>{await(0,c.y)(),this.layoutOptions()}),500)}},{kind:"field",static:!0,key:"styles",value(){return[o.W,(0,l.iv)(v||(v=f`:host([clearable]){position:relative}.mdc-select:not(.mdc-select--disabled) .mdc-select__icon{color:var(--secondary-text-color)}.mdc-select__anchor{width:var(--ha-select-min-width,200px)}.mdc-select--filled .mdc-select__anchor{height:var(--ha-select-height,56px)}.mdc-select--filled .mdc-floating-label{inset-inline-start:12px;inset-inline-end:initial;direction:var(--direction)}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label{inset-inline-start:48px;inset-inline-end:initial;direction:var(--direction)}.mdc-select .mdc-select__anchor{padding-inline-start:12px;padding-inline-end:0px;direction:var(--direction)}.mdc-select__anchor .mdc-floating-label--float-above{transform-origin:var(--float-start)}.mdc-select__selected-text-container{padding-inline-end:var(--select-selected-text-padding-end,0px)}:host([clearable]) .mdc-select__selected-text-container{padding-inline-end:var(--select-selected-text-padding-end,12px)}ha-icon-button{position:absolute;top:10px;right:28px;--mdc-icon-button-size:36px;--mdc-icon-size:20px;color:var(--secondary-text-color);inset-inline-start:initial;inset-inline-end:28px;direction:var(--direction)}.inline-arrow{flex-grow:0}`))]}}]}}),n.K)},51223:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=(i(71695),i(47021),i(57243)),n=i(50778),o=i(94571),l=i(59847),r=i(45729),d=(i(65981),i(37583),e([r]));r=(d.then?(await d)():d)[0];let c,u,h,p,v=e=>e;(0,a.Z)([(0,n.Mo)("ha-state-icon")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"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(){var e,t;const i=this.icon||this.stateObj&&(null===(e=this.hass)||void 0===e||null===(e=e.entities[this.stateObj.entity_id])||void 0===e?void 0:e.icon)||(null===(t=this.stateObj)||void 0===t?void 0:t.attributes.icon);if(i)return(0,s.dy)(c||(c=v`<ha-icon .icon="${0}"></ha-icon>`),i);if(!this.stateObj)return s.Ld;if(!this.hass)return this._renderFallback();const a=(0,r.gD)(this.hass,this.stateObj,this.stateValue).then((e=>e?(0,s.dy)(u||(u=v`<ha-icon .icon="${0}"></ha-icon>`),e):this._renderFallback()));return(0,s.dy)(h||(h=v`${0}`),(0,o.C)(a))}},{kind:"method",key:"_renderFallback",value:function(){const e=(0,l.N)(this.stateObj);return(0,s.dy)(p||(p=v` <ha-svg-icon .path="${0}"></ha-svg-icon> `),r.Ls[e]||r.Rb)}}]}}),s.oi);t()}catch(c){t(c)}}))},20901:function(e,t,i){var a=i(61701),s=i(72621),n=(i(71695),i(9359),i(1331),i(70104),i(40251),i(47021),i(57243)),o=i(50778),l=i(36522),r=i(49976),d=i(22381),c=i(58968);i(7285),i(92824);let u,h,p,v,f=e=>e;const g="__NONE_OPTION__";(0,a.Z)([(0,o.Mo)("ha-tts-voice-picker")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{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)({attribute:!1})],key:"engineId",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"language",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,o.SB)()],key:"_voices",value:void 0},{kind:"field",decorators:[(0,o.IO)("ha-select")],key:"_select",value:void 0},{kind:"method",key:"render",value:function(){var e,t;if(!this._voices)return n.Ld;const i=null!==(e=this.value)&&void 0!==e?e:this.required?null===(t=this._voices[0])||void 0===t?void 0:t.voice_id:g;return(0,n.dy)(u||(u=f` <ha-select .label="${0}" .value="${0}" .required="${0}" .disabled="${0}" @selected="${0}" @closed="${0}" fixedMenuPosition naturalMenuWidth> ${0} ${0} </ha-select> `),this.label||this.hass.localize("ui.components.tts-voice-picker.voice"),i,this.required,this.disabled,this._changed,r.U,this.required?n.Ld:(0,n.dy)(h||(h=f`<ha-list-item .value="${0}"> ${0} </ha-list-item>`),g,this.hass.localize("ui.components.tts-voice-picker.none")),this._voices.map((e=>(0,n.dy)(p||(p=f`<ha-list-item .value="${0}"> ${0} </ha-list-item>`),e.voice_id,e.name))))}},{kind:"method",key:"willUpdate",value:function(e){(0,s.Z)(i,"willUpdate",this,3)([e]),this.hasUpdated?(e.has("language")||e.has("engineId"))&&this._debouncedUpdateVoices():this._updateVoices()}},{kind:"field",key:"_debouncedUpdateVoices",value(){return(0,d.D)((()=>this._updateVoices()),500)}},{kind:"method",key:"_updateVoices",value:async function(){this.engineId&&this.language?(this._voices=(await(0,c.MV)(this.hass,this.engineId,this.language)).voices,this.value&&(this._voices&&this._voices.find((e=>e.voice_id===this.value))||(this.value=void 0,(0,l.B)(this,"value-changed",{value:this.value})))):this._voices=void 0}},{kind:"method",key:"updated",value:function(e){var t,a,n;((0,s.Z)(i,"updated",this,3)([e]),e.has("_voices")&&(null===(t=this._select)||void 0===t?void 0:t.value)!==this.value)&&(null===(a=this._select)||void 0===a||a.layoutOptions(),(0,l.B)(this,"value-changed",{value:null===(n=this._select)||void 0===n?void 0:n.value}))}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(v||(v=f`ha-select{width:100%}`))}},{kind:"method",key:"_changed",value:function(e){const t=e.target;!this.hass||""===t.value||t.value===this.value||void 0===this.value&&t.value===g||(this.value=t.value===g?void 0:t.value,(0,l.B)(this,"value-changed",{value:this.value}))}}]}}),n.oi)},38495:function(e,t,i){i.d(t,{AI:()=>o,Dy:()=>v,GV:()=>h,I2:()=>s,PA:()=>d,SC:()=>r,Vg:()=>f,XT:()=>p,Xp:()=>n,_v:()=>l,af:()=>u,eP:()=>a,jZ:()=>c});i(71695),i(19423),i(47021);const a=(e,t,i)=>"run-start"===t.type?e={init_options:i,stage:"ready",run:t.data,events:[t]}:e?((e="wake_word-start"===t.type?Object.assign(Object.assign({},e),{},{stage:"wake_word",wake_word:Object.assign(Object.assign({},t.data),{},{done:!1})}):"wake_word-end"===t.type?Object.assign(Object.assign({},e),{},{wake_word:Object.assign(Object.assign(Object.assign({},e.wake_word),t.data),{},{done:!0})}):"stt-start"===t.type?Object.assign(Object.assign({},e),{},{stage:"stt",stt:Object.assign(Object.assign({},t.data),{},{done:!1})}):"stt-end"===t.type?Object.assign(Object.assign({},e),{},{stt:Object.assign(Object.assign(Object.assign({},e.stt),t.data),{},{done:!0})}):"intent-start"===t.type?Object.assign(Object.assign({},e),{},{stage:"intent",intent:Object.assign(Object.assign({},t.data),{},{done:!1})}):"intent-end"===t.type?Object.assign(Object.assign({},e),{},{intent:Object.assign(Object.assign(Object.assign({},e.intent),t.data),{},{done:!0})}):"tts-start"===t.type?Object.assign(Object.assign({},e),{},{stage:"tts",tts:Object.assign(Object.assign({},t.data),{},{done:!1})}):"tts-end"===t.type?Object.assign(Object.assign({},e),{},{tts:Object.assign(Object.assign(Object.assign({},e.tts),t.data),{},{done:!0})}):"run-end"===t.type?Object.assign(Object.assign({},e),{},{stage:"done"}):"error"===t.type?Object.assign(Object.assign({},e),{},{stage:"error",error:t.data}):Object.assign({},e)).events=[...e.events,t],e):void console.warn("Received unexpected event before receiving session",t),s=(e,t,i)=>{let s;const o=n(e,(e=>{s=a(s,e,i),"run-end"!==e.type&&"error"!==e.type||o.then((e=>e())),s&&t(s)}),i);return o},n=(e,t,i)=>e.connection.subscribeMessage(t,Object.assign(Object.assign({},i),{},{type:"assist_pipeline/run"})),o=(e,t)=>e.callWS({type:"assist_pipeline/pipeline_debug/list",pipeline_id:t}),l=(e,t,i)=>e.callWS({type:"assist_pipeline/pipeline_debug/get",pipeline_id:t,pipeline_run_id:i}),r=e=>e.callWS({type:"assist_pipeline/pipeline/list"}),d=(e,t)=>e.callWS({type:"assist_pipeline/pipeline/get",pipeline_id:t}),c=(e,t)=>e.callWS(Object.assign({type:"assist_pipeline/pipeline/create"},t)),u=(e,t,i)=>e.callWS(Object.assign({type:"assist_pipeline/pipeline/update",pipeline_id:t},i)),h=(e,t)=>e.callWS({type:"assist_pipeline/pipeline/set_preferred",pipeline_id:t}),p=(e,t)=>e.callWS({type:"assist_pipeline/pipeline/delete",pipeline_id:t}),v=e=>e.callWS({type:"assist_pipeline/language/list"}),f=e=>e.callWS({type:"assist_pipeline/device/list"})},47844:function(e,t,i){i.d(t,{T9:()=>p,kU:()=>o,i4:()=>c,sF:()=>s,z9:()=>b,nk:()=>d,Mw:()=>g,Ch:()=>r,Lr:()=>h,jU:()=>l,Xn:()=>f,r:()=>v,B:()=>y,ou:()=>k,zj:()=>m,qW:()=>n});i(19423),i(40251),i(88044),i(71695),i(47021);var a=i(43546);const s=66977!=i.j?[1,2,3,4,6,8]:null,n=2,o="hls",l="web_rtc",r=(e,t,i)=>`${e}&width=${t}&height=${i}`,d=e=>`/api/camera_proxy_stream/${e.entity_id}?token=${e.attributes.access_token}`,c=async(e,t,i,a)=>{const s=await(async(e,t,i,a,s,...n)=>{let o=a[e];o||(o=a[e]={});const l=o[s];if(l)return l;const r=i(a,s,...n);return o[s]=r,r.then((()=>setTimeout((()=>{o[s]=void 0}),t)),(()=>{o[s]=void 0})),r})("_cameraTmbUrl",9e3,u,e,t);return r(s,i,a)},u=async(e,t)=>{const i=await(0,a.iI)(e,`/api/camera_proxy/${t}`);return e.hassUrl(i.path)},h=async(e,t,i)=>{const a={type:"camera/stream",entity_id:t};i&&(a.format=i);const s=await e.callWS(a);return s.url=e.hassUrl(s.url),s},p=(e,t,i,a)=>e.connection.subscribeMessage(a,{type:"camera/webrtc/offer",entity_id:t,offer:i}),v=(e,t,i,a)=>e.callWS({type:"camera/webrtc/candidate",entity_id:t,session_id:i,candidate:a}),f=(e,t)=>e.callWS({type:"camera/get_prefs",entity_id:t}),g=(e,t,i)=>e.callWS(Object.assign({type:"camera/update_prefs",entity_id:t},i)),_="media-source://camera/",y=e=>e.startsWith(_),m=e=>e.substring(22),k=async(e,t)=>e.callWS({type:"camera/capabilities",entity_id:t}),b=async(e,t)=>e.callWS({type:"camera/webrtc/get_client_config",entity_id:t})},94616:function(e,t,i){i.d(t,{AC:()=>m,AV:()=>u,De:()=>f,H9:()=>v,LI:()=>c,LV:()=>g,Mc:()=>h,QD:()=>y,VU:()=>o,_Y:()=>n,_t:()=>d,bi:()=>r,dV:()=>_,dn:()=>p,u_:()=>l});var a=i(58814);i(19423);const s=["hass"],n=e=>{let{hass:t}=e,i=(0,a.Z)(e,s);return t.callApi("POST","cloud/login",i)},o=e=>e.callApi("POST","cloud/logout"),l=(e,t)=>e.callApi("POST","cloud/forgot_password",{email:t}),r=(e,t,i)=>e.callApi("POST","cloud/register",{email:t,password:i}),d=(e,t)=>e.callApi("POST","cloud/resend_confirm",{email:t}),c=e=>e.callWS({type:"cloud/status"}),u=(e,t)=>e.callWS({type:"cloud/cloudhook/create",webhook_id:t}),h=(e,t)=>e.callWS({type:"cloud/cloudhook/delete",webhook_id:t}),p=e=>e.callWS({type:"cloud/remote/connect"}),v=e=>e.callWS({type:"cloud/remote/disconnect"}),f=e=>e.callWS({type:"cloud/subscription"}),g=(e,t)=>e.callWS(Object.assign({type:"cloud/update_prefs"},t)),_=e=>e.callWS({type:"cloud/remove_data"}),y=(e,t,i)=>e.callWS({type:"cloud/google_assistant/entities/update",entity_id:t,disable_2fa:i}),m=e=>e.callApi("GET","cloud/support_package")},42740:function(e,t,i){if(i.d(t,{KH:()=>l,T1:()=>o,rM:()=>n,zt:()=>s}),99387==i.j)var a=i(95262);let s=function(e){return e[e.CONTROL=1]="CONTROL",e}({});const n=(e,t,i)=>e.callWS({type:"conversation/agent/list",language:t,country:i}),o=(e,t,i,s)=>e.callWS({type:"conversation/agent/homeassistant/debug",sentences:(0,a.r)(t),language:i,device_id:s}),l=(e,t,i)=>e.callWS({type:"conversation/agent/homeassistant/language_scores",language:t,country:i})},80654:function(e,t,i){i.d(t,{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:(e,t)=>{var i;return null!==(i=e[t])&&void 0!==i?i:s[t]?{getIcon:s[t]}:void 0}})},63318:function(e,t,i){i.d(t,{Iq:()=>v,L3:()=>p,LM:()=>k,Mw:()=>$,Nv:()=>f,_V:()=>b,eD:()=>c,tf:()=>y,vA:()=>h,w1:()=>w,wX:()=>u,z3:()=>g});i(19083),i(71695),i(61893),i(9359),i(56475),i(1331),i(19423),i(47021);if(66977!=i.j)var a=i(62212);var s=i(27486),n=i(47194),o=i(1416),l=i(22381);if(66977!=i.j)var r=i(73850);const d=66977!=i.j?["sensor","binary_sensor"]:null,c=(e,t)=>{const i=t.filter((t=>e.states[t.entity_id]&&"battery"===e.states[t.entity_id].attributes.device_class&&d.includes((0,r.M)(t.entity_id)))).sort(((e,t)=>d.indexOf((0,r.M)(e.entity_id))-d.indexOf((0,r.M)(t.entity_id))));if(i.length>0)return i[0]},u=(e,t)=>t.find((t=>e.states[t.entity_id]&&"battery_charging"===e.states[t.entity_id].attributes.device_class)),h=(e,t)=>{if(t.name)return t.name;const i=e.states[t.entity_id];return i?(0,n.C)(i):t.original_name?t.original_name:t.entity_id},p=(e,t)=>e.callWS({type:"config/entity_registry/get",entity_id:t}),v=(e,t)=>e.callWS({type:"config/entity_registry/get_entries",entity_ids:t}),f=(e,t,i)=>e.callWS(Object.assign({type:"config/entity_registry/update",entity_id:t},i)),g=(e,t)=>e.callWS({type:"config/entity_registry/remove",entity_id:t}),_=e=>e.sendMessagePromise({type:"config/entity_registry/list"}),y=e=>e.sendMessagePromise({type:"config/entity_registry/list_for_display"}),m=(e,t)=>e.subscribeEvents((0,l.D)((()=>_(e).then((e=>t.setState(e,!0)))),500,!0),"entity_registry_updated"),k=(e,t)=>(0,a.B)("_entityRegistry",_,m,e,t),b=(e,t)=>e.sort(((e,i)=>(0,o.fe)(e.name||"",i.name||"",t))),w=(0,s.Z)((e=>{const t={};for(const i of e)t[i.entity_id]=i;return t})),$=(0,s.Z)((e=>{const t={};for(const i of e)t[i.id]=i;return t}))},13560:function(e,t,i){i.d(t,{j:()=>s});var a=i(36522);const s=e=>{(0,a.B)(window,"haptic",e)}},33544:function(e,t,i){i.d(t,{yt:()=>n,fU:()=>l,kP:()=>o});i(52247),i(9359),i(1331),i(40251);var a=i(17803),s=i(56785);const n=async e=>(0,a.I)(e.config.version,2021,2,4)?e.callWS({type:"supervisor/api",endpoint:"/addons",method:"get"}):(0,s.rY)(await e.callApi("GET","hassio/addons")),o=async(e,t)=>(0,a.I)(e.config.version,2021,2,4)?e.callWS({type:"supervisor/api",endpoint:`/addons/${t}/start`,method:"post",timeout:null}):e.callApi("POST",`hassio/addons/${t}/start`),l=async(e,t)=>{(0,a.I)(e.config.version,2021,2,4)?await e.callWS({type:"supervisor/api",endpoint:`/addons/${t}/install`,method:"post",timeout:null}):await e.callApi("POST",`hassio/addons/${t}/install`)}},56785:function(e,t,i){i.d(t,{js:()=>n,rY:()=>s,yd:()=>r,yz:()=>l});i(19083),i(71695),i(40251),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(61006),i(47021);var a=i(17803);const s=e=>e.data,n=e=>"object"==typeof e?"object"==typeof e.body?e.body.message||"Unknown error, see supervisor logs":e.body||e.message||"Unknown error, see supervisor logs":e,o=new Set([502,503,504]),l=e=>!!(e&&e.status_code&&o.has(e.status_code))||!(!e||!e.message||!e.message.includes("ERR_CONNECTION_CLOSED")&&!e.message.includes("ERR_CONNECTION_RESET")),r=async(e,t)=>(0,a.I)(e.config.version,2021,2,4)?e.callWS({type:"supervisor/api",endpoint:`/${t}/stats`,method:"get"}):s(await e.callApi("GET",`hassio/${t}/stats`))},51143:function(e,t,i){i.d(t,{n:()=>a});const a=(e,t,i)=>e.callService("select","select_option",{option:i},{entity_id:t})},57627:function(e,t,i){i.d(t,{m:()=>a});const a=(e,t,i)=>e.callWS({type:"stt/engine/list",language:t,country:i})},58968:function(e,t,i){i.d(t,{MV:()=>d,Wg:()=>l,Xk:()=>o,aT:()=>a,b_:()=>n,yP:()=>r});i(88044);const a=(e,t)=>e.callApi("POST","tts_get_url",t),s="media-source://tts/",n=e=>e.startsWith(s),o=e=>e.substring(19),l=(e,t,i)=>e.callWS({type:"tts/engine/list",language:t,country:i}),r=(e,t)=>e.callWS({type:"tts/engine/get",engine_id:t}),d=(e,t,i)=>e.callWS({type:"tts/engine/voices",engine_id:t,language:i})},69919:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{EX:()=>p,Fj:()=>w,M$:()=>$,SO:()=>v,Sk:()=>g,TN:()=>C,UJ:()=>_,Ym:()=>x,hF:()=>f});i(19083),i(61893),i(9359),i(56475),i(70104),i(40251);var s=i(73358);if(99387==i.j)var n=i(73850);if(99387==i.j)var o=i(59847);var l=i(75278),r=i(50602),d=i(1416),c=i(76131);if(99387==i.j)var u=i(72473);var h=e([r]);r=(h.then?(await h)():h)[0];let p=function(e){return e[e.INSTALL=1]="INSTALL",e[e.SPECIFIC_VERSION=2]="SPECIFIC_VERSION",e[e.PROGRESS=4]="PROGRESS",e[e.BACKUP=8]="BACKUP",e[e.RELEASE_NOTES=16]="RELEASE_NOTES",e}({});const v=e=>(0,l.e)(e,p.PROGRESS)&&null!==e.attributes.update_percentage,f=(e,t=!1)=>(e.state===s.uo||t&&Boolean(e.attributes.skipped_version))&&(0,l.e)(e,p.INSTALL),g=e=>!!e.attributes.in_progress,_=(e,t)=>e.callWS({type:"update/release_notes",entity_id:t}),y="ioBroker Core",m="ioBroker Supervisor",k="ioBroker Operating System",b=(e,t)=>Object.values(e).filter((e=>"update"===(0,o.N)(e))).sort(((e,i)=>e.attributes.title===y?-3:i.attributes.title===y?3:e.attributes.title===k?-2:i.attributes.title===k?2:e.attributes.title===m?-1:i.attributes.title===m?1:(0,d.fe)(e.attributes.title||e.attributes.friendly_name||"",i.attributes.title||i.attributes.friendly_name||"",t))),w=(e,t=!1)=>b(e).filter((e=>f(e,t))),$=async(e,t)=>{const i=b(t.states,t.locale.language).map((e=>e.entity_id));if(!i.length)return void(0,c.showAlertDialog)(e,{title:t.localize("ui.panel.config.updates.no_update_entities.title"),text:t.localize("ui.panel.config.updates.no_update_entities.description"),warning:!0});(0,u.C)(e,{message:t.localize("ui.panel.config.updates.checking_updates")});let a=0;const s=await t.connection.subscribeEvents((i=>{"update"===(0,n.M)(i.data.entity_id)&&(a++,(0,u.C)(e,{message:t.localize("ui.panel.config.updates.updates_refreshed",{count:a})}))}),"state_changed");await t.callService("homeassistant","update_entity",{entity_id:i}),await new Promise((e=>{setTimeout(e,15e3)})),s(),0===a&&(0,u.C)(e,{message:t.localize("ui.panel.config.updates.no_new_updates")})},x=(e,t)=>{const i=e.state,a=e.attributes;if("off"===i){return a.latest_version&&a.skipped_version===a.latest_version?a.latest_version:t.formatEntityState(e)}if("on"===i&&g(e)){return(0,l.e)(e,p.PROGRESS)&&null!==a.update_percentage?t.localize("ui.card.update.installing_with_progress",{progress:(0,r.uf)(a.update_percentage,t.locale,{maximumFractionDigits:a.display_precision,minimumFractionDigits:a.display_precision})}):t.localize("ui.card.update.installing")}return t.formatEntityState(e)},C=(e,t)=>{var i;if("hassio"!==(null===(i=t[e.entity_id])||void 0===i?void 0:i.domain))return"generic";const a=e.attributes.title||"";return a===y?"home_assistant":[y,m,k].includes(a)?"generic":"addon"};a()}catch(p){a(p)}}))},55644:function(e,t,i){i.d(t,{w:()=>a});const a=e=>e.callWS({type:"wyoming/info"})},41948:function(e,t,i){var a=i(61701),s=(i(71695),i(47021),i(57243)),n=i(50778),o=i(36522),l=(i(59826),i(37583),i(88238)),r=i(46993);let d,c,u=e=>e;(0,a.Z)([(0,n.Mo)("cloud-step-intro")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"method",key:"render",value:function(){var e,t,i;return(0,s.dy)(d||(d=u`<div class="content"> <img src="${0}" alt="Nabu Casa logo"> <h1> ${0} </h1> <div class="features"> <div class="feature speech"> <div class="logos"> <div class="round-icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div> </div> <h2> ${0} <span class="no-wrap"></span> </h2> <p> ${0} </p> </div> <div class="feature access"> <div class="logos"> <div class="round-icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div> </div> <h2> ${0} <span class="no-wrap"></span> </h2> <p> ${0} </p> </div> <div class="feature"> <div class="logos"> <img alt="Google Assistant" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer"> <img alt="Amazon Alexa" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer"> </div> <h2> ${0} </h2> <p> ${0} </p> </div> </div> </div> <div class="footer side-by-side"> <a href="https://www.nabucasa.com" target="_blank" rel="noreferrer noopener"> <ha-button> <ha-svg-icon .path="${0}" slot="icon"></ha-svg-icon> nabucasa.com </ha-button> </a> <ha-button unelevated @click="${0}">${0}</ha-button> </div>`),`/static/images/logo_nabu_casa${null!==(e=this.hass.themes)&&void 0!==e&&e.darkMode?"_dark":""}.png`,this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.cloud.title"),"M8,7A2,2 0 0,1 10,9V14A2,2 0 0,1 8,16A2,2 0 0,1 6,14V9A2,2 0 0,1 8,7M14,14C14,16.97 11.84,19.44 9,19.92V22H7V19.92C4.16,19.44 2,16.97 2,14H4A4,4 0 0,0 8,18A4,4 0 0,0 12,14H14M21.41,9.41L17.17,13.66L18.18,10H14A2,2 0 0,1 12,8V4A2,2 0 0,1 14,2H20A2,2 0 0,1 22,4V8C22,8.55 21.78,9.05 21.41,9.41Z",this.hass.localize("ui.panel.config.voice_assistants.assistants.cloud.features.speech.title"),this.hass.localize("ui.panel.config.voice_assistants.assistants.cloud.features.speech.text"),"M17.9,17.39C17.64,16.59 16.89,16 16,16H15V13A1,1 0 0,0 14,12H8V10H10A1,1 0 0,0 11,9V7H13A2,2 0 0,0 15,5V4.59C17.93,5.77 20,8.64 20,12C20,14.08 19.2,15.97 17.9,17.39M11,19.93C7.05,19.44 4,16.08 4,12C4,11.38 4.08,10.78 4.21,10.21L9,15V16A2,2 0 0,0 11,18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",this.hass.localize("ui.panel.config.voice_assistants.assistants.cloud.features.remote_access.title"),this.hass.localize("ui.panel.config.voice_assistants.assistants.cloud.features.remote_access.text"),(0,l.X1)({domain:"google_assistant",type:"icon",darkOptimized:null===(t=this.hass.themes)||void 0===t?void 0:t.darkMode}),(0,l.X1)({domain:"alexa",type:"icon",darkOptimized:null===(i=this.hass.themes)||void 0===i?void 0:i.darkMode}),this.hass.localize("ui.panel.config.voice_assistants.assistants.cloud.features.assistants.title"),this.hass.localize("ui.panel.config.voice_assistants.assistants.cloud.features.assistants.text"),"M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z",this._signUp,this.hass.localize("ui.panel.config.cloud.register.headline"))}},{kind:"method",key:"_signUp",value:function(){(0,o.B)(this,"cloud-step",{step:"SIGNUP"})}},{kind:"field",static:!0,key:"styles",value(){return[r._,(0,s.iv)(c||(c=u`:host{display:flex}.features{display:flex;flex-direction:column;grid-gap:16px;padding:16px}.feature{display:flex;flex-direction:column;align-items:center;text-align:center;margin-bottom:16px}.feature .logos{margin-bottom:16px}.feature .logos>*{width:40px;height:40px;margin:0 4px}.round-icon{border-radius:50%;color:#6e41ab;background-color:#e8dcf7;display:flex;align-items:center;justify-content:center;font-size:24px}.access .round-icon{color:#00aef8;background-color:#cceffe}.feature h2{font-weight:500;font-size:16px;line-height:24px;margin-top:0;margin-bottom:8px}.feature p{font-weight:400;font-size:14px;line-height:20px;margin:0}`))]}}]}}),s.oi)},19627:function(e,t,i){var a=i(61701),s=(i(71695),i(19423),i(40251),i(88972),i(47021),i(57243)),n=i(50778),o=i(36522),l=i(83523),r=(i(99426),i(59826),i(34326),i(37583),i(83166),i(94616)),d=i(47873),c=i(76131),u=i(46993);let h,p,v,f=e=>e;(0,a.Z)([(0,n.Mo)("cloud-step-signin")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_requestInProgress",value(){return!1}},{kind:"field",decorators:[(0,n.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_checkConnection",value(){return!0}},{kind:"field",decorators:[(0,n.IO)("#email",!0)],key:"_emailField",value:void 0},{kind:"field",decorators:[(0,n.IO)("#password",!0)],key:"_passwordField",value:void 0},{kind:"method",key:"render",value:function(){var e;return(0,s.dy)(h||(h=f`<div class="content"> <img src="${0}" alt="Nabu Casa logo"> <h1>${0}</h1> ${0} <ha-textfield autofocus id="email" name="email" .label="${0}" .disabled="${0}" type="email" autocomplete="email" required @keydown="${0}" validationMessage="${0}"></ha-textfield> <ha-password-field id="password" name="password" .label="${0}" .disabled="${0}" autocomplete="new-password" minlength="8" required @keydown="${0}" validationMessage="${0}"></ha-password-field> </div> <div class="footer"> <ha-button unelevated @click="${0}" .disabled="${0}">${0}</ha-button> </div>`),`/static/images/logo_nabu_casa${null!==(e=this.hass.themes)&&void 0!==e&&e.darkMode?"_dark":""}.png`,this.hass.localize("ui.panel.config.cloud.login.sign_in"),this._error?(0,s.dy)(p||(p=f`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):"",this.hass.localize("ui.panel.config.cloud.register.email_address"),this._requestInProgress,this._keyDown,this.hass.localize("ui.panel.config.cloud.register.email_error_msg"),this.hass.localize("ui.panel.config.cloud.register.password"),this._requestInProgress,this._keyDown,this.hass.localize("ui.panel.config.cloud.register.password_error_msg"),this._handleLogin,this._requestInProgress,this.hass.localize("ui.panel.config.cloud.login.sign_in"))}},{kind:"method",key:"_keyDown",value:function(e){"Enter"===e.key&&this._handleLogin()}},{kind:"method",key:"_handleLogin",value:async function(){const e=this._emailField,t=this._passwordField,i=e.value,a=t.value;if(!e.reportValidity())return t.reportValidity(),void e.focus();if(!t.reportValidity())return void t.focus();this._requestInProgress=!0;const s=async(t,i)=>{try{await(0,r._Y)(Object.assign(Object.assign({hass:this.hass,email:t},i?{code:i}:{password:a}),{},{check_connection:this._checkConnection}))}catch(n){const i=n&&n.body&&n.body.code;if("mfarequired"===i){const e=await(0,c.showPromptDialog)(this,{title:this.hass.localize("ui.panel.config.cloud.login.totp_code_prompt_title"),inputLabel:this.hass.localize("ui.panel.config.cloud.login.totp_code"),inputType:"text",defaultValue:"",confirmText:this.hass.localize("ui.panel.config.cloud.login.submit")});if(null!==e&&""!==e)return void(await s(t,e))}if("alreadyconnectederror"===i)return void(0,d.F)(this,{details:JSON.parse(n.body.message),logInHereAction:()=>{this._checkConnection=!1,s(t)},closeDialog:()=>{this._requestInProgress=!1}});if("usernotfound"===i&&t!==t.toLowerCase())return void(await s(t.toLowerCase()));if("PasswordChangeRequired"===i)return(0,c.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.cloud.login.alert_password_change_required")}),(0,l.c)("/config/cloud/forgot-password"),void(0,o.B)(this,"closed");switch(this._requestInProgress=!1,i){case"UserNotConfirmed":this._error=this.hass.localize("ui.panel.config.cloud.login.alert_email_confirm_necessary");break;case"mfarequired":this._error=this.hass.localize("ui.panel.config.cloud.login.alert_mfa_code_required");break;case"mfaexpiredornotstarted":this._error=this.hass.localize("ui.panel.config.cloud.login.alert_mfa_expired_or_not_started");break;case"invalidtotpcode":this._error=this.hass.localize("ui.panel.config.cloud.login.alert_totp_code_invalid");break;default:this._error=n&&n.body&&n.body.message?n.body.message:"Unknown error"}e.focus()}};await s(i)}},{kind:"field",static:!0,key:"styles",value(){return[u._,(0,s.iv)(v||(v=f`:host{display:block}ha-password-field,ha-textfield{display:block}`))]}}]}}),s.oi)},73883:function(e,t,i){var a=i(61701),s=(i(71695),i(40251),i(47021),i(57243)),n=i(50778),o=i(36522),l=(i(99426),i(59826),i(34326),i(37583),i(83166),i(94616)),r=i(46993);let d,c,u,h,p,v,f,g=e=>e;(0,a.Z)([(0,n.Mo)("cloud-step-signup")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_requestInProgress",value(){return!1}},{kind:"field",decorators:[(0,n.SB)()],key:"_email",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_password",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_state",value:void 0},{kind:"field",decorators:[(0,n.IO)("#email",!0)],key:"_emailField",value:void 0},{kind:"field",decorators:[(0,n.IO)("#password",!0)],key:"_passwordField",value:void 0},{kind:"method",key:"render",value:function(){var e;return(0,s.dy)(d||(d=g`<div class="content"> <img src="${0}" alt="Nabu Casa logo"> <h1> ${0} </h1> ${0} ${0} </div> <div class="footer side-by-side"> ${0} </div>`),`/static/images/logo_nabu_casa${null!==(e=this.hass.themes)&&void 0!==e&&e.darkMode?"_dark":""}.png`,this.hass.localize("ui.panel.config.cloud.register.create_account"),this._error?(0,s.dy)(c||(c=g`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):"","VERIFY"===this._state?(0,s.dy)(u||(u=g`<p> ${0} </p>`),this.hass.localize("ui.panel.config.cloud.register.confirm_email",{email:this._email})):(0,s.dy)(h||(h=g`<ha-textfield autofocus id="email" name="email" .label="${0}" .disabled="${0}" type="email" autocomplete="email" required @keydown="${0}" validationMessage="${0}"></ha-textfield> <ha-password-field id="password" name="password" .label="${0}" .disabled="${0}" autocomplete="new-password" minlength="8" required @keydown="${0}" validationMessage="${0}"></ha-password-field>`),this.hass.localize("ui.panel.config.cloud.register.email_address"),this._requestInProgress,this._keyDown,this.hass.localize("ui.panel.config.cloud.register.email_error_msg"),this.hass.localize("ui.panel.config.cloud.register.password"),this._requestInProgress,this._keyDown,this.hass.localize("ui.panel.config.cloud.register.password_error_msg")),"VERIFY"===this._state?(0,s.dy)(p||(p=g`<ha-button @click="${0}" .disabled="${0}">${0}</ha-button><ha-button unelevated @click="${0}" .disabled="${0}">${0}</ha-button>`),this._handleResendVerifyEmail,this._requestInProgress,this.hass.localize("ui.panel.config.cloud.register.resend_confirm_email"),this._login,this._requestInProgress,this.hass.localize("ui.panel.config.cloud.register.clicked_confirm")):(0,s.dy)(v||(v=g`<ha-button @click="${0}" .disabled="${0}">${0}</ha-button> <ha-button unelevated @click="${0}" .disabled="${0}">${0}</ha-button>`),this._signIn,this._requestInProgress,this.hass.localize("ui.panel.config.cloud.login.sign_in"),this._handleRegister,this._requestInProgress,this.hass.localize("ui.common.next")))}},{kind:"method",key:"_signIn",value:function(){(0,o.B)(this,"cloud-step",{step:"SIGNIN"})}},{kind:"method",key:"_keyDown",value:function(e){"Enter"===e.key&&this._handleRegister()}},{kind:"method",key:"_handleRegister",value:async function(){const e=this._emailField,t=this._passwordField;if(!e.reportValidity())return t.reportValidity(),void e.focus();if(!t.reportValidity())return void t.focus();const i=e.value.toLowerCase(),a=t.value;this._requestInProgress=!0;try{await(0,l.bi)(this.hass,i,a),this._email=i,this._password=a,this._verificationEmailSent()}catch(s){this._password="",this._error=s&&s.body&&s.body.message?s.body.message:"Unknown error"}finally{this._requestInProgress=!1}}},{kind:"method",key:"_handleResendVerifyEmail",value:async function(){if(this._email)try{await(0,l._t)(this.hass,this._email),this._verificationEmailSent()}catch(e){this._error=e&&e.body&&e.body.message?e.body.message:"Unknown error"}}},{kind:"method",key:"_verificationEmailSent",value:function(){this._state="VERIFY",setTimeout((()=>this._login()),5e3)}},{kind:"method",key:"_login",value:async function(){if(this._email&&this._password)try{await(0,l._Y)({hass:this.hass,email:this._email,password:this._password}),(0,o.B)(this,"cloud-step",{step:"DONE"})}catch(t){var e;"usernotconfirmed"===(null==t||null===(e=t.body)||void 0===e?void 0:e.code)?this._verificationEmailSent():this._error="Something went wrong. Please try again."}}},{kind:"field",static:!0,key:"styles",value(){return[r._,(0,s.iv)(f||(f=g`.content{width:100%}ha-password-field,ha-textfield{display:block}`))]}}]}}),s.oi)},46993:function(e,t,i){i.d(t,{_:()=>n});var a=i(57243);let s;const n=[i(28008).Qx,(0,a.iv)(s||(s=(e=>e)`:host{align-items:center;text-align:center;min-height:400px;display:flex;flex-direction:column;justify-content:space-between;height:100%;padding:24px;box-sizing:border-box}.content{flex:1}.content img{width:120px}@media all and (max-width:450px),all and (max-height:500px){:host{min-height:100%;height:auto}.content img{margin-top:68px;margin-bottom:68px}}.footer{display:flex;width:100%;flex-direction:row;justify-content:flex-end}.footer.full-width{flex-direction:column}.footer.full-width ha-button{width:100%}.footer.centered{justify-content:center}.footer.side-by-side{justify-content:space-between}`))]},42474:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HaVoiceAssistantSetupDialog:()=>K,STEP:()=>G});var s=i(61701),n=(i(19083),i(71695),i(92745),i(9359),i(56475),i(1331),i(70104),i(40251),i(61006),i(47021),i(31622),i(57243)),o=i(50778),l=i(27486),r=i(36522),d=i(73850),c=i(94369),u=(i(60370),i(73729),i(2790)),h=(i(64780),i(41927)),p=i(42740),v=i(96194),f=i(28008),g=i(6089),_=i(46645),y=i(54596),m=i(34559),k=i(74472),b=i(48788),w=i(32853),$=i(76392),x=i(33106),C=e([g,_,y,m,k,b,w,$,x,c,u]);[g,_,y,m,k,b,w,$,x,c,u]=C.then?(await C)():C;let S,O,z,L,I,E,P,A,M,B,N,j,T,W,V,D,Z,F,U=e=>e;const H="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",R="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",q="M7,10L12,15L17,10H7Z";let G=function(e){return e[e.INIT=0]="INIT",e[e.UPDATE=1]="UPDATE",e[e.CHECK=2]="CHECK",e[e.WAKEWORD=3]="WAKEWORD",e[e.AREA=4]="AREA",e[e.PIPELINE=5]="PIPELINE",e[e.SUCCESS=6]="SUCCESS",e[e.CLOUD=7]="CLOUD",e[e.LOCAL=8]="LOCAL",e[e.CHANGE_WAKEWORD=9]="CHANGE_WAKEWORD",e}({}),K=(0,s.Z)([(0,o.Mo)("ha-voice-assistant-setup-dialog")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_step",value(){return G.INIT}},{kind:"field",decorators:[(0,o.SB)()],key:"_assistConfiguration",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_language",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_languages",value(){return[]}},{kind:"field",decorators:[(0,o.SB)()],key:"_localOption",value:void 0},{kind:"field",key:"_previousSteps",value(){return[]}},{kind:"field",key:"_nextStep",value:void 0},{kind:"method",key:"showDialog",value:async function(e){this._params=e,await this._fetchAssistConfiguration(),this._step=G.UPDATE}},{kind:"method",key:"closeDialog",value:async function(){var e;null===(e=this.renderRoot.querySelector("ha-dialog"))||void 0===e||e.close()}},{kind:"method",key:"willUpdate",value:function(e){e.has("_step")&&this._step===G.PIPELINE&&this._getLanguages()}},{kind:"method",key:"_dialogClosed",value:function(){this._params=void 0,this._assistConfiguration=void 0,this._previousSteps=[],this._nextStep=void 0,this._step=G.INIT,(0,r.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"field",key:"_deviceEntities",value(){return(0,l.Z)(((e,t)=>Object.values(t).filter((t=>t.device_id===e))))}},{kind:"field",key:"_findDomainEntityId",value(){return(0,l.Z)(((e,t,i)=>{var a;return null===(a=this._deviceEntities(e,t).find((e=>(0,d.M)(e.entity_id)===i)))||void 0===a?void 0:a.entity_id}))}},{kind:"method",key:"render",value:function(){var e,t;if(!this._params)return n.Ld;const i=this._findDomainEntityId(this._params.deviceId,this.hass.entities,"assist_satellite"),a=i?this.hass.states[i]:void 0;return(0,n.dy)(S||(S=U` <ha-dialog open @closed="${0}" .heading="${0}" hideActions escapeKeyAction scrimClickAction> <ha-dialog-header slot="heading"> ${0} ${0} </ha-dialog-header> <div class="content" @next-step="${0}" @prev-step="${0}"> ${0} </div> </ha-dialog> `),this._dialogClosed,"Voice Satellite setup",this._step===G.LOCAL?n.Ld:this._previousSteps.length?(0,n.dy)(O||(O=U`<ha-icon-button slot="navigationIcon" .label="${0}" .path="${0}" @click="${0}"></ha-icon-button>`),null!==(e=this.hass.localize("ui.common.back"))&&void 0!==e?e:"Back",H,this._goToPreviousStep):this._step!==G.UPDATE?(0,n.dy)(z||(z=U`<ha-icon-button slot="navigationIcon" .label="${0}" .path="${0}" @click="${0}"></ha-icon-button>`),null!==(t=this.hass.localize("ui.common.close"))&&void 0!==t?t:"Close",R,this.closeDialog):n.Ld,this._step===G.WAKEWORD||this._step===G.AREA?(0,n.dy)(L||(L=U`<ha-button @click="${0}" class="skip-btn" slot="actionItems">${0}</ha-button>`),this._goToNextStep,this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.skip")):this._step===G.PIPELINE&&this._language?(0,n.dy)(I||(I=U`<ha-md-button-menu slot="actionItems" positioning="fixed"> <ha-assist-chip .label="${0}" slot="trigger"> <ha-svg-icon slot="trailing-icon" .path="${0}"></ha-svg-icon></ha-assist-chip> ${0} </ha-md-button-menu>`),(0,c.u)(this._language,this.hass.locale),q,(0,u.getLanguageOptions)(this._languages,!1,!1,this.hass.locale).map((e=>(0,n.dy)(E||(E=U`<ha-md-menu-item .value="${0}" @click="${0}" @keydown="${0}" .selected="${0}"> ${0} </ha-md-menu-item>`),e.value,this._handlePickLanguage,this._handlePickLanguage,this._language===e.value,e.label)))):n.Ld,this._goToNextStep,this._goToPreviousStep,this._step===G.UPDATE?(0,n.dy)(P||(P=U`<ha-voice-assistant-setup-step-update .hass="${0}" .updateEntityId="${0}"></ha-voice-assistant-setup-step-update>`),this.hass,this._findDomainEntityId(this._params.deviceId,this.hass.entities,"update")):this._error?(0,n.dy)(A||(A=U`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):(null==a?void 0:a.state)===v.nZ?(0,n.dy)(M||(M=U`<ha-alert alert-type="error">${0}</ha-alert>`),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.not_available")):this._step===G.CHECK?(0,n.dy)(B||(B=U`<ha-voice-assistant-setup-step-check .hass="${0}" .assistEntityId="${0}"></ha-voice-assistant-setup-step-check>`),this.hass,i):this._step===G.WAKEWORD?(0,n.dy)(N||(N=U`<ha-voice-assistant-setup-step-wake-word .hass="${0}" .assistConfiguration="${0}" .assistEntityId="${0}" .deviceEntities="${0}"></ha-voice-assistant-setup-step-wake-word>`),this.hass,this._assistConfiguration,i,this._deviceEntities(this._params.deviceId,this.hass.entities)):this._step===G.CHANGE_WAKEWORD?(0,n.dy)(j||(j=U` <ha-voice-assistant-setup-step-change-wake-word .hass="${0}" .assistConfiguration="${0}" .assistEntityId="${0}"></ha-voice-assistant-setup-step-change-wake-word> `),this.hass,this._assistConfiguration,i):this._step===G.AREA?(0,n.dy)(T||(T=U` <ha-voice-assistant-setup-step-area .hass="${0}" .deviceId="${0}"></ha-voice-assistant-setup-step-area> `),this.hass,this._params.deviceId):this._step===G.PIPELINE?(0,n.dy)(W||(W=U`<ha-voice-assistant-setup-step-pipeline .hass="${0}" .languages="${0}" .language="${0}" .assistConfiguration="${0}" .assistEntityId="${0}" @language-changed="${0}"></ha-voice-assistant-setup-step-pipeline>`),this.hass,this._languages,this._language,this._assistConfiguration,i,this._languageChanged):this._step===G.CLOUD?(0,n.dy)(V||(V=U`<ha-voice-assistant-setup-step-cloud .hass="${0}"></ha-voice-assistant-setup-step-cloud>`),this.hass):this._step===G.LOCAL?(0,n.dy)(D||(D=U`<ha-voice-assistant-setup-step-local .hass="${0}" .language="${0}" .localOption="${0}" .assistConfiguration="${0}"></ha-voice-assistant-setup-step-local>`),this.hass,this._language,this._localOption,this._assistConfiguration):this._step===G.SUCCESS?(0,n.dy)(Z||(Z=U`<ha-voice-assistant-setup-step-success .hass="${0}" .assistConfiguration="${0}" .assistEntityId="${0}"></ha-voice-assistant-setup-step-success>`),this.hass,this._assistConfiguration,i):n.Ld)}},{kind:"method",key:"_getLanguages",value:async function(){if(this._languages.length)return;const e=await(0,p.KH)(this.hass);this._languages=Object.entries(e.languages).filter((([e,t])=>t.cloud>0||t.full_local>0||t.focused_local>0)).map((([e,t])=>e)),this._language=e.preferred_language&&this._languages.includes(e.preferred_language)?e.preferred_language:void 0}},{kind:"method",key:"_fetchAssistConfiguration",value:async function(){try{this._assistConfiguration=await(0,h.ko)(this.hass,this._findDomainEntityId(this._params.deviceId,this.hass.entities,"assist_satellite"))}catch(e){this._error=e.message}}},{kind:"method",key:"_handlePickLanguage",value:function(e){"keydown"===e.type&&"Enter"!==e.key&&" "!==e.key||(this._language=e.target.value)}},{kind:"method",key:"_languageChanged",value:function(e){e.detail.value&&(this._language=e.detail.value)}},{kind:"method",key:"_goToPreviousStep",value:function(){this._previousSteps.length&&(this._step=this._previousSteps.pop())}},{kind:"method",key:"_goToNextStep",value:function(e){var t,i,a,s;null!=e&&null!==(t=e.detail)&&void 0!==t&&t.updateConfig&&this._fetchAssistConfiguration(),null!=e&&null!==(i=e.detail)&&void 0!==i&&i.nextStep&&(this._nextStep=e.detail.nextStep),null!=e&&null!==(a=e.detail)&&void 0!==a&&a.noPrevious||this._previousSteps.push(this._step),null!=e&&null!==(s=e.detail)&&void 0!==s&&s.step?(this._step=e.detail.step,e.detail.step===G.LOCAL&&(this._localOption=e.detail.option)):this._nextStep?(this._step=this._nextStep,this._nextStep=void 0):this._step+=1}},{kind:"get",static:!0,key:"styles",value:function(){return[f.yu,(0,n.iv)(F||(F=U`ha-dialog{--dialog-content-padding:0}@media all and (min-width:450px) and (min-height:500px){ha-dialog{--mdc-dialog-min-width:560px;--mdc-dialog-max-width:560px;--mdc-dialog-min-width:min(560px, 95vw);--mdc-dialog-max-width:min(560px, 95vw)}}ha-dialog-header{height:56px}@media all and (max-width:450px),all and (max-height:500px){.content{height:calc(100vh - 56px)}}.skip-btn{margin-top:6px}ha-alert{margin:24px;display:block}ha-md-button-menu{height:48px;display:flex;align-items:center;margin-right:12px;margin-inline-end:12px}`))]}}]}}),n.oi);a()}catch(S){a(S)}}))},6089:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=(i(71695),i(40251),i(47021),i(57243)),n=i(50778),o=i(36522),l=i(71857),r=i(76131),d=i(46993),c=i(81282),u=e([c]);c=(u.then?(await u)():u)[0];let h,p,v=e=>e;(0,a.Z)([(0,n.Mo)("ha-voice-assistant-setup-step-area")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"deviceId",value:void 0},{kind:"method",key:"render",value:function(){const e=this.hass.devices[this.deviceId];return(0,s.dy)(h||(h=v`<div class="content"> <img src="/static/images/voice-assistant/area.png" alt="Casita ioBroker logo"> <h1> ${0} </h1> <p class="secondary"> ${0} </p> <ha-area-picker .hass="${0}" .value="${0}"></ha-area-picker> </div> <div class="footer"> <ha-button @click="${0}" unelevated>${0}</ha-button> </div>`),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.area.title"),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.area.secondary"),this.hass,e.area_id,this._setArea,this.hass.localize("ui.common.next"))}},{kind:"method",key:"_setArea",value:async function(){const e=this.shadowRoot.querySelector("ha-area-picker").value;e?(await(0,l.t1)(this.hass,this.deviceId,{area_id:e}),this._nextStep()):(0,r.showAlertDialog)(this,{text:this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.area.no_selection")})}},{kind:"method",key:"_nextStep",value:function(){(0,o.B)(this,"next-step")}},{kind:"field",static:!0,key:"styles",value(){return[d._,(0,s.iv)(p||(p=v`ha-area-picker{display:block;width:100%;margin-bottom:24px}`))]}}]}}),s.oi);t()}catch(h){t(h)}}))},46645:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=(i(71695),i(9359),i(70104),i(40251),i(47021),i(57243)),n=i(50778),o=i(36522),l=(i(19993),i(74633),i(41927)),r=i(46993),d=i(42474),c=e([d]);d=(c.then?(await c)():c)[0];let u,h,p,v=e=>e;(0,a.Z)([(0,n.Mo)("ha-voice-assistant-setup-step-change-wake-word")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"assistConfiguration",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"assistEntityId",value:void 0},{kind:"method",key:"render",value:function(){return(0,s.dy)(u||(u=v`<div class="padding content"> <img src="/static/images/voice-assistant/change-wake-word.png" alt="Casita ioBroker logo"> <h1> ${0} </h1> <p class="secondary"> ${0} </p> </div> <ha-md-list> ${0} </ha-md-list>`),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.change_wake_word.title"),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.change_wake_word.secondary"),this.assistConfiguration.available_wake_words.map((e=>(0,s.dy)(h||(h=v`<ha-md-list-item interactive type="button" @click="${0}" .value="${0}"> ${0} <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item>`),this._wakeWordPicked,e.id,e.wake_word))))}},{kind:"method",key:"_wakeWordPicked",value:async function(e){if(!this.assistEntityId)return;const t=e.currentTarget.value;await(0,l.DT)(this.hass,this.assistEntityId,[t]),this._nextStep()}},{kind:"method",key:"_nextStep",value:function(){(0,o.B)(this,"next-step",{step:d.STEP.WAKEWORD,updateConfig:!0})}},{kind:"field",static:!0,key:"styles",value(){return[r._,(0,s.iv)(p||(p=v`:host{padding:0}.padding{padding:24px}ha-md-list{width:100%;text-align:initial;margin-bottom:24px}`))]}}]}}),s.oi);t()}catch(u){t(u)}}))},54596:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=i(72621),n=(i(71695),i(40251),i(47021),i(57243)),o=i(50778),l=i(36522),r=(i(59826),i(17170)),d=i(41927),c=i(46993),u=i(73192),h=e([r]);r=(h.then?(await h)():h)[0];let p,v,f,g,_=e=>e;(0,a.Z)([(0,o.Mo)("ha-voice-assistant-setup-step-check")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"assistEntityId",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_status",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_showLoader",value(){return!1}},{kind:"method",key:"willUpdate",value:function(e){var t;(0,s.Z)(i,"willUpdate",this,3)([e]),this.hasUpdated?"success"===this._status&&e.has("hass")&&"idle"===(null===(t=this.hass.states[this.assistEntityId])||void 0===t?void 0:t.state)&&this._nextStep():this._testConnection()}},{kind:"method",key:"render",value:function(){return(0,n.dy)(p||(p=_`<div class="content"> ${0} </div>`),"timeout"===this._status?(0,n.dy)(v||(v=_`<img src="/static/images/voice-assistant/error.png" alt="Casita ioBroker error logo"> <h1> ${0} </h1> <p class="secondary"> ${0} </p> <div class="footer"> <a href="${0}"><ha-button>${0}</ha-button></a> <ha-button @click="${0}">${0}</ha-button> </div>`),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.check.failed_title"),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.check.failed_secondary"),(0,u.R)(this.hass,"/voice_control/troubleshooting/#i-dont-get-a-voice-response"),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.check.help"),this._testConnection,this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.check.retry")):(0,n.dy)(f||(f=_`<img src="/static/images/voice-assistant/hi.png" alt="Casita ioBroker hi logo"> <h1> ${0} </h1> <p class="secondary"> ${0} </p> ${0}`),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.check.title"),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.check.secondary"),this._showLoader?(0,n.dy)(g||(g=_`<ha-spinner></ha-spinner>`)):n.Ld))}},{kind:"method",key:"_testConnection",value:async function(){this._status=void 0,this._showLoader=!1;const e=setTimeout((()=>{this._showLoader=!0}),3e3),t=await(0,d.cz)(this.hass,this.assistEntityId);clearTimeout(e),this._showLoader=!1,this._status=t.status}},{kind:"method",key:"_nextStep",value:function(){(0,l.B)(this,"next-step",{noPrevious:!0})}},{kind:"field",static:!0,key:"styles",value(){return c._}}]}}),n.oi);t()}catch(p){t(p)}}))},34559:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=(i(71695),i(47021),i(57243)),n=i(50778),o=(i(41948),i(19627),i(73883),i(36522)),l=i(42474),r=e([l]);l=(r.then?(await r)():r)[0];let d,c,u,h=e=>e;(0,a.Z)([(0,n.Mo)("ha-voice-assistant-setup-step-cloud")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_state",value(){return"INTRO"}},{kind:"method",key:"render",value:function(){return"SIGNUP"===this._state?(0,s.dy)(d||(d=h`<cloud-step-signup .hass="${0}" @cloud-step="${0}"></cloud-step-signup>`),this.hass,this._cloudStep):"SIGNIN"===this._state?(0,s.dy)(c||(c=h`<cloud-step-signin .hass="${0}" @cloud-step="${0}"></cloud-step-signin>`),this.hass,this._cloudStep):(0,s.dy)(u||(u=h`<cloud-step-intro .hass="${0}" @cloud-step="${0}"></cloud-step-intro>`),this.hass,this._cloudStep)}},{kind:"method",key:"_cloudStep",value:function(e){"DONE"!==e.detail.step?this._state=e.detail.step:(0,o.B)(this,"next-step",{step:l.STEP.PIPELINE,noPrevious:!0})}}]}}),s.oi);t()}catch(d){t(d)}}))},74472:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=i(72621),n=(i(52247),i(19083),i(71695),i(61893),i(9359),i(56475),i(1331),i(70104),i(52924),i(40251),i(61006),i(47021),i(57243)),o=i(50778),l=i(72344),r=i(36522),d=i(73850),c=i(17170),u=i(38495),h=i(15681),p=i(63318),v=i(33544),f=i(57627),g=i(58968),_=i(55644),y=i(73192),m=i(46993),k=i(42474),b=i(42740),w=e([c,k]);[c,k]=w.then?(await w)():w;let $,x,C,S,O,z=e=>e;const L="M14,3V5H17.59L7.76,14.83L9.17,16.24L19,6.41V10H21V3M19,19H5V5H12V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V12H19V19Z";(0,a.Z)([(0,o.Mo)("ha-voice-assistant-setup-step-local")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"assistConfiguration",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"localOption",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"language",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_state",value(){return"INTRO"}},{kind:"field",decorators:[(0,o.SB)()],key:"_detailState",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_localTts",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_localStt",value:void 0},{kind:"method",key:"render",value:function(){return(0,n.dy)($||($=z`<div class="content"> ${0} </div>`),"INSTALLING"===this._state?(0,n.dy)(x||(x=z`<img src="/static/images/voice-assistant/update.png" alt="Casita ioBroker loading logo"> <h1> ${0} </h1> <p> ${0} </p> <ha-spinner></ha-spinner> <p> ${0} </p>`),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.local.title"),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.local.secondary"),this._detailState||"Installation can take several minutes"):"ERROR"===this._state?(0,n.dy)(C||(C=z` <img src="/static/images/voice-assistant/error.png" alt="Casita ioBroker error logo"> <h1> ${0} </h1> <p>${0}</p> <p> ${0} </p> <ha-button @click="${0}">${0}</ha-button> <a href="${0}" target="_blank" rel="noreferrer noopener"> <ha-button> <ha-svg-icon .path="${0}" slot="icon"></ha-svg-icon> ${0}</ha-button> </a>`),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.local.failed_title"),this._error,this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.local.failed_secondary"),this._prevStep,this.hass.localize("ui.common.back"),(0,y.R)(this.hass,"/voice_control/voice_remote_local_assistant/"),L,this.hass.localize("ui.panel.config.common.learn_more")):"NOT_SUPPORTED"===this._state?(0,n.dy)(S||(S=z`<img src="/static/images/voice-assistant/error.png" alt="Casita ioBroker error logo"> <h1> ${0} </h1> <p> ${0} </p> <ha-button @click="${0}">${0}</ha-button> <a href="${0}" target="_blank" rel="noreferrer noopener"> <ha-button> <ha-svg-icon .path="${0}" slot="icon"></ha-svg-icon> ${0}</ha-button> </a>`),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.local.not_supported_title"),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.local.not_supported_secondary"),this._prevStep,this.hass.localize("ui.common.back"),(0,y.R)(this.hass,"/voice_control/voice_remote_local_assistant/"),L,this.hass.localize("ui.panel.config.common.learn_more")):n.Ld)}},{kind:"method",key:"willUpdate",value:function(e){(0,s.Z)(i,"willUpdate",this,3)([e]),this.hasUpdated||this._checkLocal()}},{kind:"method",key:"_prevStep",value:function(){(0,r.B)(this,"prev-step")}},{kind:"method",key:"_nextStep",value:function(){(0,r.B)(this,"next-step",{step:k.STEP.SUCCESS,noPrevious:!0})}},{kind:"method",key:"_checkLocal",value:async function(){if(await this._findLocalEntities(),this._localTts&&this._localStt)try{if(this._localTts.length&&this._localStt.length)return void(await this._pickOrCreatePipelineExists());if(!(0,l.p)(this.hass,"hassio"))return void(this._state="NOT_SUPPORTED");this._state="INSTALLING";const{addons:e}=await(0,v.yt)(this.hass),t=e.find((e=>e.slug===this._ttsAddonName)),i=e.find((e=>e.slug===this._sttAddonName));this._localTts.length||(t||(this._detailState=this.hass.localize(`ui.panel.config.voice_assistants.satellite_wizard.local.state.installing_${this._ttsProviderName}`),await(0,v.fU)(this.hass,this._ttsAddonName)),t&&"started"===t.state||(this._detailState=this.hass.localize(`ui.panel.config.voice_assistants.satellite_wizard.local.state.starting_${this._ttsProviderName}`),await(0,v.kP)(this.hass,this._ttsAddonName)),this._detailState=this.hass.localize(`ui.panel.config.voice_assistants.satellite_wizard.local.state.setup_${this._ttsProviderName}`),await this._setupConfigEntry("tts")),this._localStt.length||(i||(this._detailState=this.hass.localize(`ui.panel.config.voice_assistants.satellite_wizard.local.state.installing_${this._sttProviderName}`),await(0,v.fU)(this.hass,this._sttAddonName)),i&&"started"===i.state||(this._detailState=this.hass.localize(`ui.panel.config.voice_assistants.satellite_wizard.local.state.starting_${this._sttProviderName}`),await(0,v.kP)(this.hass,this._sttAddonName)),this._detailState=this.hass.localize(`ui.panel.config.voice_assistants.satellite_wizard.local.state.setup_${this._sttProviderName}`),await this._setupConfigEntry("stt")),this._detailState=this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.local.state.creating_pipeline"),await this._findEntitiesAndCreatePipeline()}catch(e){this._state="ERROR",this._error=e.message}}},{kind:"field",key:"_ttsProviderName",value(){return"piper"}},{kind:"field",key:"_ttsAddonName",value(){return"core_piper"}},{kind:"field",key:"_ttsHostName",value(){return"core-piper"}},{kind:"field",key:"_ttsPort",value(){return 10200}},{kind:"get",key:"_sttProviderName",value:function(){return"focused_local"===this.localOption?"speech-to-phrase":"faster-whisper"}},{kind:"get",key:"_sttAddonName",value:function(){return"focused_local"===this.localOption?"core_speech-to-phrase":"core_whisper"}},{kind:"get",key:"_sttHostName",value:function(){return"focused_local"===this.localOption?"core-speech-to-phrase":"core-whisper"}},{kind:"field",key:"_sttPort",value(){return 10300}},{kind:"method",key:"_findLocalEntities",value:async function(){const e=Object.values(this.hass.entities).filter((e=>"wyoming"===e.platform));if(!e.length)return this._localStt=[],void(this._localTts=[]);const t=await(0,_.w)(this.hass),i=Object.values(await(0,p.Iq)(this.hass,e.map((e=>e.entity_id))));this._localTts=i.filter((e=>{var i;return"tts"===(0,d.M)(e.entity_id)&&e.config_entry_id&&(null===(i=t.info[e.config_entry_id])||void 0===i?void 0:i.tts.some((e=>e.name===this._ttsProviderName)))})),this._localStt=i.filter((e=>{var i;return"stt"===(0,d.M)(e.entity_id)&&e.config_entry_id&&(null===(i=t.info[e.config_entry_id])||void 0===i?void 0:i.asr.some((e=>e.name===this._sttProviderName)))}))}},{kind:"method",key:"_setupConfigEntry",value:async function(e){const t=await this._findConfigFlowInProgress(e);if(t){if("create_entry"===(await(0,h.XO)(this.hass,t.flow_id,{})).type)return}return this._createConfigEntry(e)}},{kind:"method",key:"_findConfigFlowInProgress",value:async function(e){return(await(0,h.D7)(this.hass.connection)).find((t=>"wyoming"===t.handler&&"hassio"===t.context.source&&(t.context.configuration_url&&t.context.configuration_url.includes("tts"===e?this._ttsAddonName:this._sttAddonName)||t.context.title_placeholders.name&&t.context.title_placeholders.name.toLowerCase().includes("tts"===e?this._ttsProviderName:this._sttProviderName))))}},{kind:"method",key:"_createConfigEntry",value:async function(e){const t=await(0,h.Ky)(this.hass,"wyoming"),i=await(0,h.XO)(this.hass,t.flow_id,{host:"tts"===e?this._ttsHostName:this._sttHostName,port:"tts"===e?this._ttsPort:this._sttPort});if("create_entry"!==i.type)throw new Error(`${this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.local.errors.failed_create_entry",{addon:"tts"===e?this._ttsProviderName:this._sttProviderName})}${"errors"in i?`: ${i.errors.base}`:""}`)}},{kind:"method",key:"_pickOrCreatePipelineExists",value:async function(){var e,t,i;if(null===(e=this._localStt)||void 0===e||!e.length||null===(t=this._localTts)||void 0===t||!t.length)return;const a=await(0,u.SC)(this.hass);a.preferred_pipeline&&a.pipelines.sort((e=>e.id===a.preferred_pipeline?-1:0));const s=this._localTts.map((e=>e.entity_id)),n=this._localStt.map((e=>e.entity_id));let o=a.pipelines.find((e=>"conversation.home_assistant"===e.conversation_engine&&e.tts_engine&&s.includes(e.tts_engine)&&e.stt_engine&&n.includes(e.stt_engine)&&e.language.split("-")[0]===this.language.split("-")[0]));o||(o=await this._createPipeline(this._localTts[0].entity_id,this._localStt[0].entity_id)),await this.hass.callService("select","select_option",{option:o.name},{entity_id:null===(i=this.assistConfiguration)||void 0===i?void 0:i.pipeline_entity_id}),this._nextStep()}},{kind:"method",key:"_createPipeline",value:async function(e,t){var i,a,s;const n=await(0,u.SC)(this.hass),o=(await(0,b.rM)(this.hass,this.language||this.hass.config.language,this.hass.config.country||void 0)).agents.find((e=>"conversation.home_assistant"===e.id));if(null==o||!o.supported_languages.length)throw new Error("Conversation agent does not support requested language.");const l=(await(0,g.Wg)(this.hass,this.language,this.hass.config.country||void 0)).providers.find((t=>t.engine_id===e));if(null==l||null===(i=l.supported_languages)||void 0===i||!i.length)throw new Error("TTS engine does not support requested language.");const r=await(0,g.MV)(this.hass,e,l.supported_languages[0]);if(null===(a=r.voices)||void 0===a||!a.length)throw new Error("No voice available for requested language.");const d=(await(0,f.m)(this.hass,this.language,this.hass.config.country||void 0)).providers.find((e=>e.engine_id===t));if(null==d||null===(s=d.supported_languages)||void 0===s||!s.length)throw new Error("STT engine does not support requested language.");let c=this.hass.localize(`ui.panel.config.voice_assistants.satellite_wizard.local.${this.localOption}_pipeline`),h=1;for(;n.pipelines.find((e=>e.name===c));)c=`${this.hass.localize(`ui.panel.config.voice_assistants.satellite_wizard.local.${this.localOption}_pipeline`)} ${h}`,h++;return(0,u.jZ)(this.hass,{name:c,language:this.language.split("-")[0],conversation_engine:"conversation.home_assistant",conversation_language:o.supported_languages[0],stt_engine:t,stt_language:d.supported_languages[0],tts_engine:e,tts_language:l.supported_languages[0],tts_voice:r.voices[0].voice_id,wake_word_entity:null,wake_word_id:null})}},{kind:"method",key:"_findEntitiesAndCreatePipeline",value:async function(e=0){var t,i,a;if(await this._findLocalEntities(),null===(t=this._localTts)||void 0===t||!t.length||null===(i=this._localStt)||void 0===i||!i.length){if(e>3)throw new Error(this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.local.errors.could_not_find_entities"));return await new Promise((e=>{setTimeout(e,2e3)})),this._findEntitiesAndCreatePipeline(e+1)}const s=await this._createPipeline(this._localTts[0].entity_id,this._localStt[0].entity_id);await this.hass.callService("select","select_option",{option:s.name},{entity_id:null===(a=this.assistConfiguration)||void 0===a?void 0:a.pipeline_entity_id}),this._nextStep()}},{kind:"field",static:!0,key:"styles",value(){return[m._,(0,n.iv)(O||(O=z`ha-spinner{margin-top:24px;margin-bottom:24px}`))]}}]}}),n.oi);t()}catch($){t($)}}))},48788:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=i(72621),n=(i(71695),i(92745),i(61893),i(9359),i(1331),i(40251),i(47021),i(57243)),o=i(50778),l=i(27486),r=i(72344),d=i(36522),c=i(73850),u=i(94369),h=(i(7291),i(38495)),p=i(94616),v=i(42740),f=i(57627),g=i(58968),_=i(46993),y=i(42474),m=i(73192),k=e([u,y]);[u,y]=k.then?(await k)():k;let b,w,$,x,C=e=>e;const S=["cloud","focused_local","full_local"],O={cloud:0,focused_local:0,full_local:0};(0,a.Z)([(0,o.Mo)("ha-voice-assistant-setup-step-pipeline")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"assistConfiguration",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"deviceId",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"assistEntityId",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"language",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"languages",value(){return[]}},{kind:"field",decorators:[(0,o.SB)()],key:"_cloudChecked",value(){return!1}},{kind:"field",decorators:[(0,o.SB)()],key:"_value",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_languageScores",value:void 0},{kind:"method",key:"willUpdate",value:function(e){if((0,s.Z)(i,"willUpdate",this,3)([e]),this.hasUpdated||this._fetchData(),(e.has("language")||e.has("_languageScores"))&&this.language&&this._languageScores){var t;const e=this.language;var a;if(this._value&&0===(null===(t=this._languageScores[e])||void 0===t?void 0:t[this._value])&&(this._value=void 0),!this._value)this._value=null===(a=this._getOptions(this._languageScores[e]||O,this.hass.localize).supportedOptions[0])||void 0===a?void 0:a.value}}},{kind:"field",key:"_getOptions",value(){return(0,l.Z)(((e,t)=>{const i=[],a=[];return S.forEach((s=>{e[s]>0?i.push({label:t(`ui.panel.config.voice_assistants.satellite_wizard.pipeline.options.${s}.label`),description:t(`ui.panel.config.voice_assistants.satellite_wizard.pipeline.options.${s}.description`),value:s}):a.push({label:t(`ui.panel.config.voice_assistants.satellite_wizard.pipeline.options.${s}.label`),value:s})})),{supportedOptions:i,unsupportedOptions:a}}))}},{kind:"method",key:"render",value:function(){if(!this._cloudChecked||!this._languageScores)return n.Ld;if(!this.language){const e=(0,u.u)(this.hass.config.language,this.hass.locale);return(0,n.dy)(b||(b=C`<div class="content"> <h1> ${0} </h1> ${0} <ha-language-picker .hass="${0}" .label="${0}" .languages="${0}" @value-changed="${0}"></ha-language-picker> <a href="${0}">${0}</a> </div>`),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.pipeline.unsupported_language.header"),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.pipeline.unsupported_language.secondary",{language:e}),this.hass,this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.pipeline.unsupported_language.language_picker"),this.languages,this._languageChanged,(0,m.R)(this.hass,"/voice_control/contribute-voice/"),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.pipeline.unsupported_language.contribute",{language:e}))}const e=this._languageScores[this.language]||O,t=this._getOptions(e,this.hass.localize),i=this._value?"full_local"===this._value?"low":"high":"",a=this._value?e[this._value]>2?"high":e[this._value]>1?"ready":e[this._value]>0?"low":"":"";return(0,n.dy)(w||(w=C`<div class="content"> <h1> ${0} </h1> <div class="bar-header"> <span>${0}</span><span>${0}</span> </div> <div class="perf-bar ${0}"> <div class="segment"></div> <div class="segment"></div> <div class="segment"></div> </div> <div class="bar-header"> <span>${0}</span><span>${0}</span> </div> <div class="perf-bar ${0}"> <div class="segment"></div> <div class="segment"></div> <div class="segment"></div> </div> <ha-select-box max_columns="1" .options="${0}" .value="${0}" @value-changed="${0}"></ha-select-box> ${0} </div> <div class="footer"> <ha-button @click="${0}" unelevated .disabled="${0}">${0}</ha-button> </div>`),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.pipeline.title"),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.pipeline.performance.header"),i?this.hass.localize(`ui.panel.config.voice_assistants.satellite_wizard.pipeline.performance.${i}`):"",i,this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.pipeline.commands.header"),a?this.hass.localize(`ui.panel.config.voice_assistants.satellite_wizard.pipeline.commands.${a}`):"",a,t.supportedOptions,this._value,this._valueChanged,t.unsupportedOptions.length?(0,n.dy)($||($=C`<h3> ${0} </h3> <ha-select-box max_columns="1" .options="${0}" disabled="disabled"></ha-select-box>`),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.pipeline.unsupported"),t.unsupportedOptions):n.Ld,this._createPipeline,!this._value,this.hass.localize("ui.common.next"))}},{kind:"method",key:"_fetchData",value:async function(){await this._hasCloud()&&await this._createCloudPipeline(!1)||(this._cloudChecked=!0,this._languageScores=(await(0,v.KH)(this.hass)).languages)}},{kind:"method",key:"_hasCloud",value:async function(){if(!(0,r.p)(this.hass,"cloud"))return!1;const e=await(0,p.LI)(this.hass);return!(!e.logged_in||!e.active_subscription)}},{kind:"method",key:"_createCloudPipeline",value:async function(e){let t,i;for(const l of Object.values(this.hass.entities))if("cloud"===l.platform){const e=(0,c.M)(l.entity_id);if("tts"===e)t=l.entity_id;else{if("stt"!==e)continue;i=l.entity_id}if(t&&i)break}try{var a;const o=await(0,h.SC)(this.hass);o.preferred_pipeline&&o.pipelines.sort((e=>e.id===o.preferred_pipeline?-1:0));let l=o.pipelines.find((a=>"conversation.home_assistant"===a.conversation_engine&&a.tts_engine===t&&a.stt_engine===i&&(!e||a.language.split("-")[0]===this.language.split("-")[0])));if(!l){var s,n;const e=(await(0,v.rM)(this.hass,this.language||this.hass.config.language,this.hass.config.country||void 0)).agents.find((e=>"conversation.home_assistant"===e.id));if(null==e||!e.supported_languages.length)return!1;const a=(await(0,g.Wg)(this.hass,this.language||this.hass.config.language,this.hass.config.country||void 0)).providers.find((e=>e.engine_id===t));if(null==a||null===(s=a.supported_languages)||void 0===s||!s.length)return!1;const r=await(0,g.MV)(this.hass,t,a.supported_languages[0]),d=(await(0,f.m)(this.hass,this.language||this.hass.config.language,this.hass.config.country||void 0)).providers.find((e=>e.engine_id===i));if(null==d||null===(n=d.supported_languages)||void 0===n||!n.length)return!1;let c="ioBroker Cloud",u=1;for(;o.pipelines.find((e=>e.name===c));)c=`ioBroker Cloud ${u}`,u++;l=await(0,h.jZ)(this.hass,{name:c,language:(this.language||this.hass.config.language).split("-")[0],conversation_engine:"conversation.home_assistant",conversation_language:e.supported_languages[0],stt_engine:i,stt_language:d.supported_languages[0],tts_engine:t,tts_language:a.supported_languages[0],tts_voice:r.voices[0].voice_id,wake_word_entity:null,wake_word_id:null})}return await this.hass.callService("select","select_option",{option:l.name},{entity_id:null===(a=this.assistConfiguration)||void 0===a?void 0:a.pipeline_entity_id}),(0,d.B)(this,"next-step",{step:y.STEP.SUCCESS,noPrevious:!0}),!0}catch(o){return!1}}},{kind:"method",key:"_valueChanged",value:function(e){this._value=e.detail.value}},{kind:"method",key:"_setupCloud",value:async function(){await this._hasCloud()?this._createCloudPipeline(!0):(0,d.B)(this,"next-step",{step:y.STEP.CLOUD})}},{kind:"method",key:"_createPipeline",value:function(){"cloud"===this._value?this._setupCloud():"focused_local"===this._value?this._setupLocalFocused():this._setupLocalFull()}},{kind:"method",key:"_setupLocalFocused",value:function(){(0,d.B)(this,"next-step",{step:y.STEP.LOCAL,option:this._value})}},{kind:"method",key:"_setupLocalFull",value:function(){(0,d.B)(this,"next-step",{step:y.STEP.LOCAL,option:this._value})}},{kind:"method",key:"_languageChanged",value:function(e){e.detail.value&&(0,d.B)(this,"language-changed",{value:e.detail.value})}},{kind:"field",static:!0,key:"styles",value(){return[_._,(0,n.iv)(x||(x=C`:host{text-align:left}.perf-bar{width:100%;height:10px;display:flex;gap:4px;margin:8px 0}.segment{flex-grow:1;background-color:var(--disabled-color);transition:background-color .3s}.segment:first-child{border-radius:4px 0 0 4px}.segment:last-child{border-radius:0 4px 4px 0}.perf-bar.high .segment{background-color:var(--success-color)}.perf-bar.ready .segment:nth-child(-n+2){background-color:var(--warning-color)}.perf-bar.low .segment:first-child{background-color:var(--error-color)}.bar-header{display:flex;justify-content:space-between;margin:8px 0;margin-top:16px}ha-select-box{display:block}ha-select-box:first-of-type{margin-top:32px}.footer{margin-top:16px}ha-language-picker{display:block;margin-top:16px;margin-bottom:16px}`))]}}]}}),n.oi);t()}catch(b){t(b)}}))},32853:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=i(72621),n=(i(19083),i(71695),i(9359),i(1331),i(70104),i(19423),i(40251),i(61006),i(47021),i(57243)),o=i(50778),l=i(36522),r=i(49976),d=(i(92824),i(20901),i(38495)),c=i(41927),u=i(94616),h=i(51143),p=i(77834),v=i(64827),f=i(46993),g=i(42474),_=i(44180),y=e([v,g]);[v,g]=y.then?(await y)():y;let m,k,b,w,$,x,C,S=e=>e;const O="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",z="M12,2A3,3 0 0,1 15,5V11A3,3 0 0,1 12,14A3,3 0 0,1 9,11V5A3,3 0 0,1 12,2M19,11C19,14.53 16.39,17.44 13,17.93V21H11V17.93C7.61,17.44 5,14.53 5,11H7A5,5 0 0,0 12,16A5,5 0 0,0 17,11H19Z",L="M8,5.14V19.14L19,12.14L8,5.14Z";(0,a.Z)([(0,o.Mo)("ha-voice-assistant-setup-step-success")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"assistConfiguration",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"deviceId",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"assistEntityId",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_ttsSettings",value:void 0},{kind:"method",key:"willUpdate",value:function(e){if((0,s.Z)(i,"willUpdate",this,3)([e]),e.has("assistConfiguration"))this._setTtsSettings();else if(e.has("hass")&&this.assistConfiguration){const t=e.get("hass");if(t){const e=t.states[this.assistConfiguration.pipeline_entity_id],i=this.hass.states[this.assistConfiguration.pipeline_entity_id];e.state!==i.state&&this._setTtsSettings()}}}},{kind:"method",key:"render",value:function(){const e=this.assistConfiguration?this.hass.states[this.assistConfiguration.pipeline_entity_id]:void 0;return(0,n.dy)(m||(m=S`<div class="content"> <img src="/static/images/voice-assistant/heart.png" alt="Casita ioBroker logo"> <h1> ${0} </h1> <p class="secondary"> ${0} </p> <div class="rows"> ${0} ${0} ${0} </div> </div> <div class="footer"> <ha-button @click="${0}" unelevated>Done</ha-button> </div>`),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.success.title"),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.success.secondary"),this.assistConfiguration&&this.assistConfiguration.available_wake_words.length>1?(0,n.dy)(k||(k=S`<div class="row"> <ha-select .label="${0}" @closed="${0}" fixedMenuPosition naturalMenuWidth .value="${0}" @selected="${0}"> ${0} </ha-select> <ha-button @click="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> Test </ha-button> </div>`),"Wake word",r.U,this.assistConfiguration.active_wake_words[0],this._wakeWordPicked,this.assistConfiguration.available_wake_words.map((e=>(0,n.dy)(b||(b=S`<ha-list-item .value="${0}"> ${0} </ha-list-item>`),e.id,e.wake_word))),this._testWakeWord,z):n.Ld,e?(0,n.dy)(w||(w=S`<div class="row"> <ha-select .label="${0}" @closed="${0}" .value="${0}" fixedMenuPosition naturalMenuWidth @selected="${0}"> ${0} </ha-select> <ha-button @click="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> Edit </ha-button> </div>`),"Assistant",r.U,null==e?void 0:e.state,this._pipelinePicked,null==e?void 0:e.attributes.options.map((t=>(0,n.dy)($||($=S`<ha-list-item .value="${0}"> ${0} </ha-list-item>`),t,this.hass.formatEntityState(e,t)))),this._openPipeline,O):n.Ld,this._ttsSettings?(0,n.dy)(x||(x=S`<div class="row"> <ha-tts-voice-picker .hass="${0}" .engineId="${0}" .language="${0}" .value="${0}" @value-changed="${0}" @closed="${0}"></ha-tts-voice-picker> <ha-button @click="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> Try </ha-button> </div>`),this.hass,this._ttsSettings.engine,this._ttsSettings.language,this._ttsSettings.voice,this._voicePicked,r.U,this._testTts,L):n.Ld,this._close)}},{kind:"method",key:"_getPipeline",value:async function(){var e,t;if(null===(e=this.assistConfiguration)||void 0===e||!e.pipeline_entity_id)return[void 0,void 0];const i=this.hass.states[null===(t=this.assistConfiguration)||void 0===t?void 0:t.pipeline_entity_id].state,a=await(0,d.SC)(this.hass);let s;return s="preferred"===i?a.pipelines.find((e=>e.id===a.preferred_pipeline)):a.pipelines.find((e=>e.name===i)),[s,a.preferred_pipeline]}},{kind:"method",key:"_wakeWordPicked",value:async function(e){const t=e.target.value;await(0,c.DT)(this.hass,this.assistEntityId,[t])}},{kind:"method",key:"_pipelinePicked",value:function(e){const t=this.hass.states[this.assistConfiguration.pipeline_entity_id],i=e.target.value;i!==t.state&&t.attributes.options.includes(i)&&(0,h.n)(this.hass,t.entity_id,i)}},{kind:"method",key:"_setTtsSettings",value:async function(){const[e]=await this._getPipeline();this._ttsSettings=e?{engine:e.tts_engine,voice:e.tts_voice,language:e.tts_language}:void 0}},{kind:"method",key:"_voicePicked",value:async function(e){const[t]=await this._getPipeline();t&&await(0,d.af)(this.hass,t.id,Object.assign(Object.assign({},t),{},{tts_voice:e.detail.value}))}},{kind:"method",key:"_testTts",value:async function(){const[e]=await this._getPipeline();if(e){if(e.language!==this.hass.locale.language)try{const t=await(0,_.i0)(null,e.language,!1);return void this._announce(t.data["ui.dialogs.tts-try.message_example"])}catch(t){}this._announce(this.hass.localize("ui.dialogs.tts-try.message_example"))}}},{kind:"method",key:"_announce",value:async function(e){this.assistEntityId&&await(0,c.SY)(this.hass,this.assistEntityId,{message:e,preannounce_media_id:null})}},{kind:"method",key:"_testWakeWord",value:function(){(0,l.B)(this,"next-step",{step:g.STEP.WAKEWORD,nextStep:g.STEP.SUCCESS,updateConfig:!0})}},{kind:"method",key:"_openPipeline",value:async function(){const[e]=await this._getPipeline();if(!e)return;const t=await(0,u.LI)(this.hass);(0,p.t)(this,{cloudActiveSubscription:t.logged_in&&t.active_subscription,pipeline:e,updatePipeline:async t=>{await(0,d.af)(this.hass,e.id,t)},hideWakeWord:!0})}},{kind:"method",key:"_close",value:function(){(0,l.B)(this,"closed")}},{kind:"field",static:!0,key:"styles",value(){return[f._,(0,n.iv)(C||(C=S`ha-md-list-item{text-align:initial}ha-tts-voice-picker{display:block}.footer{margin-top:24px}.rows{gap:16px;display:flex;flex-direction:column}.row{display:flex;justify-content:space-between;align-items:center}.row>:first-child{flex:1;margin-right:4px}.row ha-button{width:82px}`))]}}]}}),n.oi);t()}catch(m){t(m)}}))},76392:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=i(72621),n=(i(71695),i(40251),i(47021),i(57243)),o=i(50778),l=i(36522),r=i(23243),d=i(17170),c=i(96194),u=i(69919),h=i(46993),p=e([r,d,u]);[r,d,u]=p.then?(await p)():p;let v,f,g,_,y=e=>e;(0,a.Z)([(0,o.Mo)("ha-voice-assistant-setup-step-update")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"updateEntityId",value:void 0},{kind:"field",key:"_updated",value(){return!1}},{kind:"field",key:"_refreshTimeout",value:void 0},{kind:"method",key:"willUpdate",value:function(e){if((0,s.Z)(i,"willUpdate",this,3)([e]),this.updateEntityId){if(e.has("hass")&&this.updateEntityId){const t=e.get("hass");if(t){const e=t.states[this.updateEntityId],i=this.hass.states[this.updateEntityId];if((null==e?void 0:e.state)===c.nZ&&(null==i?void 0:i.state)!==c.nZ||(null==e?void 0:e.state)!==c.ON&&(null==i?void 0:i.state)===c.ON)return void this._tryUpdate(!1)}}e.has("updateEntityId")&&this._tryUpdate(!0)}else this._nextStep()}},{kind:"method",key:"render",value:function(){if(!this.updateEntityId||!(this.updateEntityId in this.hass.states))return n.Ld;const e=this.hass.states[this.updateEntityId],t=e&&(0,u.SO)(e);return(0,n.dy)(v||(v=y`<div class="content"> <img src="/static/images/voice-assistant/update.png" alt="Casita ioBroker loading logo"> <h1> ${0} </h1> <p class="secondary"> ${0} </p> ${0} <p> ${0} </p> </div>`),e&&("unavailable"===e.state||(0,u.Sk)(e))?this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.update.title"):this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.update.checking"),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.update.secondary"),t?(0,n.dy)(f||(f=y` <ha-progress-ring .value="${0}"></ha-progress-ring> `),e.attributes.update_percentage):(0,n.dy)(g||(g=y`<ha-spinner></ha-spinner>`)),(null==e?void 0:e.state)===c.nZ?"Restarting voice assistant":t?`Installing ${e.attributes.update_percentage}%`:"")}},{kind:"method",key:"_tryUpdate",value:async function(e){if(clearTimeout(this._refreshTimeout),!this.updateEntityId)return;const t=this.hass.states[this.updateEntityId];t&&this.hass.states[t.entity_id].state===c.ON&&(0,u.hF)(t)?(this._updated=!0,await this.hass.callService("update","install",{},{entity_id:t.entity_id})):e?(await this.hass.callService("homeassistant","update_entity",{},{entity_id:this.updateEntityId}),this._refreshTimeout=window.setTimeout((()=>{this._nextStep()}),5e3)):this._nextStep()}},{kind:"method",key:"_nextStep",value:function(){(0,l.B)(this,"next-step",{noPrevious:!0,updateConfig:this._updated})}},{kind:"field",static:!0,key:"styles",value(){return[h._,(0,n.iv)(_||(_=y`ha-progress-ring,ha-spinner{margin-top:24px;margin-bottom:24px}`))]}}]}}),n.oi);t()}catch(v){t(v)}}))},33106:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),s=i(72621),n=(i(19083),i(71695),i(9359),i(1331),i(40251),i(61006),i(47021),i(57243)),o=i(50778),l=i(27486),r=i(36522),d=(i(59826),i(17170)),c=(i(95198),i(41927)),u=i(46993),h=i(42474),p=i(73850),v=e([d,h]);[d,h]=v.then?(await v)():v;let f,g,_,y,m,k,b,w=e=>e;(0,a.Z)([(0,o.Mo)("ha-voice-assistant-setup-step-wake-word")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"assistConfiguration",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"assistEntityId",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"deviceEntities",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_muteSwitchEntity",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_detected",value(){return!1}},{kind:"field",decorators:[(0,o.SB)()],key:"_timedout",value(){return!1}},{kind:"field",key:"_sub",value:void 0},{kind:"field",key:"_timeout",value:void 0},{kind:"method",key:"disconnectedCallback",value:function(){(0,s.Z)(i,"disconnectedCallback",this,3)([]),this._stopListeningWakeWord()}},{kind:"method",key:"willUpdate",value:function(e){var t;((0,s.Z)(i,"willUpdate",this,3)([e]),e.has("assistConfiguration")&&this.assistConfiguration&&!this.assistConfiguration.available_wake_words.length&&this._nextStep(),e.has("assistEntityId"))&&(this._detected=!1,this._muteSwitchEntity=null===(t=this.deviceEntities)||void 0===t||null===(t=t.find((e=>"switch"===(0,p.M)(e.entity_id)&&e.entity_id.includes("mute"))))||void 0===t?void 0:t.entity_id,this._muteSwitchEntity||this._startTimeOut(),this._listenWakeWord())}},{kind:"method",key:"_startTimeOut",value:function(){this._timeout=window.setTimeout((()=>{this._timeout=void 0,this._timedout=!0}),15e3)}},{kind:"field",key:"_activeWakeWord",value(){return(0,l.Z)((e=>{var t;if(!e)return"";const i=e.active_wake_words[0];return null===(t=e.available_wake_words.find((e=>e.id===i)))||void 0===t?void 0:t.wake_word}))}},{kind:"method",key:"render",value:function(){if(!this.assistEntityId)return n.Ld;return"idle"!==this.hass.states[this.assistEntityId].state?(0,n.dy)(f||(f=w`<ha-spinner></ha-spinner>`)):(0,n.dy)(g||(g=w`<div class="content"> ${0} ${0} </div> ${0}`),this._detected?(0,n.dy)(y||(y=w`<img src="/static/images/voice-assistant/ok-nabu.png" alt="Casita ioBroker logo"> <h1> ${0} </h1> <p class="secondary"> ${0} </p>`),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.wake_word.title_2",{wakeword:this._activeWakeWord(this.assistConfiguration)}),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.wake_word.secondary_2")):(0,n.dy)(_||(_=w` <img src="/static/images/voice-assistant/sleep.png" alt="Casita ioBroker logo"> <h1> ${0} </h1> <p class="secondary">${0}</p> `),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.wake_word.title",{wakeword:this._activeWakeWord(this.assistConfiguration)}),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.wake_word.secondary")),this._timedout?(0,n.dy)(m||(m=w`<ha-alert alert-type="warning">${0}</ha-alert>`),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.wake_word.time_out")):this._muteSwitchEntity&&"on"===this.hass.states[this._muteSwitchEntity].state?(0,n.dy)(k||(k=w`<ha-alert alert-type="warning" .title="${0}">${0}</ha-alert>`),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.wake_word.muted"),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.wake_word.muted_description")):n.Ld,this.assistConfiguration&&this.assistConfiguration.available_wake_words.length>1?(0,n.dy)(b||(b=w`<div class="footer centered"> <ha-button @click="${0}">${0}</ha-button> </div>`),this._changeWakeWord,this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.wake_word.change_wake_word")):n.Ld)}},{kind:"method",key:"_listenWakeWord",value:async function(){const e=this.assistEntityId;e&&(await this._stopListeningWakeWord(),this._sub=(0,c.aJ)(this.hass,e,(()=>{this._timedout=!1,clearTimeout(this._timeout),this._stopListeningWakeWord(),this._detected?this._nextStep():(this._detected=!0,this._listenWakeWord())})))}},{kind:"method",key:"_stopListeningWakeWord",value:async function(){try{var e;null===(e=await this._sub)||void 0===e||e()}catch(t){}this._sub=void 0}},{kind:"method",key:"_nextStep",value:function(){(0,r.B)(this,"next-step")}},{kind:"method",key:"_changeWakeWord",value:function(){(0,r.B)(this,"next-step",{step:h.STEP.CHANGE_WAKEWORD})}},{kind:"field",static:!0,key:"styles",value(){return u._}}]}}),n.oi);t()}catch(f){t(f)}}))},91163:function(e,t,i){i.d(t,{_:()=>n});i(71695),i(40251),i(47021);var a=i(36522);const s=()=>Promise.all([i.e("46379"),i.e("66031"),i.e("72206"),i.e("91552"),i.e("97983"),i.e("25618"),i.e("78456"),i.e("56898"),i.e("2142"),i.e("58640"),i.e("898"),i.e("51229"),i.e("56332")]).then(i.bind(i,55546)),n=(e,t,i)=>{var n,o,l;null!==(n=t.auth.external)&&void 0!==n&&n.config.hasAssist?t.auth.external.fireMessage({type:"assist/show",payload:{pipeline_id:i.pipeline_id,start_listening:null===(l=i.start_listening)||void 0===l||l}}):(0,a.B)(e,"show-dialog",{dialogTag:"ha-voice-command-dialog",dialogImport:s,dialogParams:{pipeline_id:i.pipeline_id,start_listening:null!==(o=i.start_listening)&&void 0!==o&&o}})}},47873:function(e,t,i){i.d(t,{F:()=>s});i(71695),i(19423),i(40251),i(47021);var a=i(36522);const s=(e,t)=>new Promise((s=>{const n=t.closeDialog,o=t.logInHereAction;(0,a.B)(e,"show-dialog",{dialogTag:"dialog-cloud-already-connected",dialogImport:()=>Promise.all([i.e("97983"),i.e("58640"),i.e("39027")]).then(i.bind(i,94223)),dialogParams:Object.assign(Object.assign({},t),{},{closeDialog:()=>{null==n||n(),s(!1)},logInHereAction:()=>{null==o||o(),s(!0)}})})}))},77834:function(e,t,i){i.d(t,{t:()=>n});i(71695),i(40251),i(47021);var a=i(36522);const s=()=>Promise.all([i.e("2142"),i.e("8795"),i.e("37040"),i.e("70147"),i.e("26719"),i.e("44523")]).then(i.bind(i,55221)),n=(e,t)=>{(0,a.B)(e,"show-dialog",{dialogTag:"dialog-voice-assistant-pipeline-detail",dialogImport:s,dialogParams:t})}},9859:function(e,t,i){i.d(t,{S:()=>s});var a=i(73850);const s=(e,t,i=!0)=>{const s=(0,a.M)(t),n="group"===s?"homeassistant":s;let o;switch(s){case"lock":o=i?"unlock":"lock";break;case"cover":o=i?"open_cover":"close_cover";break;case"button":case"input_button":o="press";break;case"scene":o="turn_on";break;case"valve":o=i?"open_valve":"close_valve";break;default:o=i?"turn_on":"turn_off"}return e.callService(n,o,{entity_id:t})}},1617:function(e,t,i){i.d(t,{G:()=>h});i(71695),i(9359),i(52924),i(40251),i(47021);var a=i(36522),s=i(83523),n=i(13560),o=i(57816),l=i(76131),r=i(91163),d=i(72473),c=(i(19083),i(61006),i(73358)),u=i(9859);const h=async(e,t,i,h)=>{let p;if("double_tap"===h&&i.double_tap_action?p=i.double_tap_action:"hold"===h&&i.hold_action?p=i.hold_action:"tap"===h&&i.tap_action&&(p=i.tap_action),p||(p={action:"more-info"}),p.confirmation&&(!p.confirmation.exemptions||!p.confirmation.exemptions.some((e=>{var i;return e.user===(null===(i=t.user)||void 0===i?void 0:i.id)})))){let i;if((0,n.j)("warning"),"call-service"===p.action||"perform-action"===p.action){const[e,a]=(p.perform_action||p.service).split(".",2),s=t.services;if(e in s&&a in s[e]){await t.loadBackendTranslation("title");const n=await t.loadBackendTranslation("services");i=`${(0,o.Lh)(n,e)}: ${n(`component.${e}.services.${i}.name`)||s[e][a].name||a}`}}if(!(await(0,l.showConfirmationDialog)(e,{text:p.confirmation.text||t.localize("ui.panel.lovelace.cards.actions.action_confirmation",{action:i||t.localize(`ui.panel.lovelace.editor.action-editor.actions.${p.action}`)||p.action})})))return}switch(p.action){case"more-info":{const s=p.entity||i.entity||i.camera_image||i.image_entity;s?(0,a.B)(e,"hass-more-info",{entityId:s}):((0,d.C)(e,{message:t.localize("ui.panel.lovelace.cards.actions.no_entity_more_info")}),(0,n.j)("failure"));break}case"navigate":p.navigation_path?(0,s.c)(p.navigation_path,{replace:p.navigation_replace}):((0,d.C)(e,{message:t.localize("ui.panel.lovelace.cards.actions.no_navigation_path")}),(0,n.j)("failure"));break;case"url":p.url_path?window.open(p.url_path):((0,d.C)(e,{message:t.localize("ui.panel.lovelace.cards.actions.no_url")}),(0,n.j)("failure"));break;case"toggle":i.entity?(((e,t)=>{const i=c.tj.includes(e.states[t].state);(0,u.S)(e,t,i)})(t,i.entity),(0,n.j)("light")):((0,d.C)(e,{message:t.localize("ui.panel.lovelace.cards.actions.no_entity_toggle")}),(0,n.j)("failure"));break;case"perform-action":case"call-service":{var v;if(!p.perform_action&&!p.service)return(0,d.C)(e,{message:t.localize("ui.panel.lovelace.cards.actions.no_action")}),void(0,n.j)("failure");const[i,a]=(p.perform_action||p.service).split(".",2);t.callService(i,a,null!==(v=p.data)&&void 0!==v?v:p.service_data,p.target),(0,n.j)("light");break}case"assist":var f,g;(0,r._)(e,t,{start_listening:null!==(f=p.start_listening)&&void 0!==f&&f,pipeline_id:null!==(g=p.pipeline_id)&&void 0!==g?g:"last_used"});break;case"fire-dom-event":(0,a.B)(e,"ll-custom",p)}}},29401:function(e,t,i){i.d(t,{A:()=>s});i(52247),i(9359),i(70104);var a=i(31064);const s=(e,t=!0)=>{if(!e||!Array.isArray(e))throw new Error("Entities need to be an array");return e.map(((e,i)=>{if("object"==typeof e&&!Array.isArray(e)&&e.type)return e;let s;if("string"==typeof e)s={entity:e};else{if("object"!=typeof e||Array.isArray(e))throw new Error(`Invalid entity ID at position ${i}`);if(!("entity"in e))throw new Error(`Object at position ${i} is missing entity field`);s=e}if(t&&!(0,a.T)(s.entity))throw new Error(`Invalid entity ID at position ${i}: ${s.entity}`);return s}))}},64827:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t);var s=i(61701),n=(i(52247),i(19083),i(71695),i(9359),i(70104),i(61006),i(47021),i(87319),i(57243)),o=i(50778),l=i(49976),r=i(47194),d=(i(92824),i(96194)),c=i(13560),u=i(51143),h=i(93331),p=i(8069),v=i(62577),f=e([p]);p=(f.then?(await f)():f)[0];let g,_,y,m,k=e=>e;(0,s.Z)([(0,o.Mo)("hui-select-entity-row")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_config",value:void 0},{kind:"method",key:"setConfig",value:function(e){if(!e||!e.entity)throw new Error("Entity must be specified");this._config=e}},{kind:"method",key:"shouldUpdate",value:function(e){return(0,h.G2)(this,e)}},{kind:"method",key:"render",value:function(){if(!this.hass||!this._config)return n.Ld;const e=this.hass.states[this._config.entity];return e?(0,n.dy)(_||(_=k` <hui-generic-entity-row .hass="${0}" .config="${0}" hide-name> <ha-select .label="${0}" .value="${0}" .options="${0}" .disabled="${0}" naturalMenuWidth @action="${0}" @click="${0}" @closed="${0}"> ${0} </ha-select> </hui-generic-entity-row> `),this.hass,this._config,this._config.name||(0,r.C)(e),e.state,e.attributes.options,e.state===d.nZ,this._handleAction,l.U,l.U,e.attributes.options?e.attributes.options.map((t=>(0,n.dy)(y||(y=k` <mwc-list-item .value="${0}"> ${0} </mwc-list-item> `),t,this.hass.formatEntityState(e,t)))):""):(0,n.dy)(g||(g=k` <hui-warning> ${0} </hui-warning> `),(0,v.i)(this.hass,this._config.entity))}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(m||(m=k`hui-generic-entity-row{display:flex;align-items:center}ha-select{width:100%;--ha-select-min-width:0}`))}},{kind:"method",key:"_handleAction",value:function(e){const t=this.hass.states[this._config.entity],i=e.target.value;i!==t.state&&t.attributes.options.includes(i)&&((0,c.j)("light"),(0,u.n)(this.hass,t.entity_id,i))}}]}}),n.oi);a()}catch(g){a(g)}}))},30511:function(e,t,i){i.r(t),i.d(t,{mdiHomeAssistant:()=>a});const a="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"},88238:function(e,t,i){i.d(t,{RU:()=>s,X1:()=>a,u4:()=>n,zC:()=>o});i(88044);const a=e=>`https://brands.home-assistant.io/${e.brand?"brands/":""}${e.useFallback?"_/":""}${e.domain}/${e.darkOptimized?"dark_":""}${e.type}.png`,s=e=>`https://brands.home-assistant.io/hardware/${e.category}/${e.darkOptimized?"dark_":""}${e.manufacturer}${e.model?`_${e.model}`:""}.png`,n=e=>e.split("/")[4],o=e=>e.startsWith("https://brands.home-assistant.io/")}}]);
//# sourceMappingURL=90296.6845607bc045cccb.js.map