iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
37 lines • 145 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[71493],{36312:function(t,e,i){i.d(e,{x:function(){return s}});i(74423);const s=(t,e)=>t&&t.components.includes(e)},62384:function(t,e,i){i.d(e,{v:function(){return s}});i(74423),i(62953);const s=(t,e,i,s)=>{const[a,n,o]=t.split(".",3);return Number(a)>e||Number(a)===e&&(void 0===s?Number(n)>=i:Number(n)>i)||void 0!==s&&Number(a)===e&&Number(n)===i&&Number(o)>=s}},46190:function(t,e,i){i.d(e,{FD:function(){return l},Is:function(){return s},JF:function(){return a},gt:function(){return n},jj:function(){return r},oL:function(){return c},yd:function(){return o}});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);const s=["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"],a=["sensor","binary_sensor","calendar","camera","device_tracker","image","weather"],n=["assist_satellite","conversation","stt","tts"],o=["automation","button","cover","date","datetime","fan","group","humidifier","input_boolean","input_button","input_datetime","input_number","input_select","input_text","light","lock","media_player","number","scene","script","select","switch","text","time","vacuum","valve"],r=["closed","locked","off"],l=new Set(["fan","input_boolean","light","switch","group","automation","humidifier","valve"]),c=new Set(["camera","image","media_player"])},66033:function(t,e,i){i.d(e,{L:function(){return s}});const s=(t,e)=>{const i=t.floor_id;return{area:t,floor:(i?e[i]:void 0)||null}}},28455:function(t,e,i){i.d(e,{EX:function(){return a},jI:function(){return n},ln:function(){return s}});const s=(t,e,i,s,a)=>{const o=e[t.entity_id];return o?n(o,e,i,s,a):{entity:null,device:null,area:null,floor:null}},a=(t,e,i)=>{const s=e[t];if(!s)return;const a=s.device_id,n=a?i[a]:void 0;return s.area_id||(null==n?void 0:n.area_id)||void 0},n=(t,e,i,s,a)=>{const n=e[t.entity_id],o=null==t?void 0:t.device_id,r=o?i[o]:void 0,l=(null==t?void 0:t.area_id)||(null==r?void 0:r.area_id),c=l?s[l]:void 0,d=null==c?void 0:c.floor_id;return{entity:n,device:r||null,area:c||null,floor:(d?a[d]:void 0)||null}}},47129:function(t,e,i){i.d(e,{a:function(){return n}});i(74423);var s=i(22675),a=i(71727);function n(t,e){const i=(0,a.m)(t.entity_id),n=void 0!==e?e:null==t?void 0:t.state;if(["button","event","infrared","input_button","radio_frequency","scene"].includes(i))return n!==s.Hh;if(n===s.Hh||n===s.HV)return!1;if("off"===n&&"alert"!==i)return!1;switch(i){case"alarm_control_panel":return"disarmed"!==n;case"alert":return"idle"!==n;case"cover":case"valve":return"closed"!==n;case"device_tracker":case"person":return"not_home"!==n;case"lawn_mower":return!["docked","paused"].includes(n);case"lock":return"locked"!==n;case"media_player":return"standby"!==n;case"vacuum":return!["idle","docked","paused"].includes(n);case"plant":return"problem"===n;case"group":return["on","home","open","locked","problem"].includes(n);case"timer":return"active"===n;case"camera":return"streaming"===n}return!0}},52658:function(t,e,i){i.d(e,{ZK:function(){return u},gf:function(){return h},mT:function(){return g},Se:function(){return d},mg:function(){return p}});i(44114),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var s=i(22675),a=i(68287),n=i(86030),o=i(80880);var r=i(71727),l=i(47129);const c=new Set(["alarm_control_panel","alert","automation","binary_sensor","calendar","camera","climate","cover","device_tracker","fan","group","humidifier","input_boolean","lawn_mower","light","lock","media_player","person","plant","remote","schedule","script","siren","sun","switch","timer","update","vacuum","valve","water_heater","weather"]),d=(t,e)=>{if((void 0!==e?e:null==t?void 0:t.state)===s.Hh)return"var(--state-unavailable-color)";const i=p(t,e);return i?(0,n.B)(i):void 0},h=(t,e,i)=>{const s=void 0!==i?i:e.state,a=(0,l.a)(e,i);return u(t,e.attributes.device_class,s,a)},u=(t,e,i,s)=>{const a=[],n=(0,o.Y)(i,"_"),r=s?"active":"inactive";return e&&a.push(`--state-${t}-${e}-${n}-color`),a.push(`--state-${t}-${n}-color`,`--state-${t}-${r}-color`,`--state-${r}-color`),a},p=(t,e)=>{const i=void 0!==e?e:null==t?void 0:t.state,s=(0,r.m)(t.entity_id),n=t.attributes.device_class;if("sensor"===s&&"battery"===n){const t=(t=>{const e=Number(t);if(!isNaN(e))return e>=70?"--state-sensor-battery-high-color":e>=30?"--state-sensor-battery-medium-color":"--state-sensor-battery-low-color"})(i);if(t)return[t]}if("group"===s){const i=(0,a.z)(t);if(i&&c.has(i))return h(i,t,e)}if(c.has(s))return h(s,t,e)},g=t=>{if(t.attributes.brightness&&"plant"!==(0,r.m)(t.entity_id)){return`brightness(${(t.attributes.brightness+245)/5}%)`}return""}},86198:function(t,e,i){i.a(t,async function(t,s){try{i.d(e,{T:function(){return r}});var a=i(74487),n=i(22786),o=t([a]);a=(o.then?(await o)():o)[0];const r=(t,e)=>{try{var i,s;return null!==(i=null===(s=l(e))||void 0===s?void 0:s.of(t))&&void 0!==i?i:t}catch(a){return t}},l=(0,n.A)(t=>new Intl.DisplayNames(t.language,{type:"language",fallback:"code"}));s()}catch(r){s(r)}})},20058:function(t,e,i){i.a(t,async function(t,s){try{i.d(e,{QL:function(){return h},ZQ:function(){return u},ZV:function(){return d},ty:function(){return l},x:function(){return r}});var a=i(74487),n=(i(74423),i(18111),i(61701),i(46927)),o=t([a]);a=(o.then?(await o)():o)[0];const r=t=>l(t.attributes),l=(t,e)=>!!t.unit_of_measurement||!!t.state_class||(e||[]).includes(t.device_class||""),c=t=>{switch(t.number_format){case n.jG.comma_decimal:return["en-US","en"];case n.jG.decimal_comma:return["de","es","it"];case n.jG.space_comma:return["fr","sv","cs"];case n.jG.quote_decimal:return["de-CH"];case n.jG.system:return;default:return t.language}},d=(t,e,i)=>h(t,e,i).map(t=>t.value).join(""),h=(t,e,i)=>{const s=e?c(e):void 0;return(null==e?void 0:e.number_format)===n.jG.none||Number.isNaN(Number(t))?Number.isNaN(Number(t))||""===t||(null==e?void 0:e.number_format)!==n.jG.none?[{type:"literal",value:t}]:new Intl.NumberFormat("en-US",p(t,Object.assign(Object.assign({},i),{},{useGrouping:!1}))).formatToParts(Number(t)):new Intl.NumberFormat(s,p(t,i)).formatToParts(Number(t))},u=(t,e)=>{var i;const s=null==e?void 0:e.display_precision;return null!=s?{maximumFractionDigits:s,minimumFractionDigits:s}:Number.isInteger(Number(null==t||null===(i=t.attributes)||void 0===i?void 0:i.step))&&Number.isInteger(Number(null==t?void 0:t.state))?{maximumFractionDigits:0}:void 0},p=(t,e)=>{const i=Object.assign({maximumFractionDigits:2},e);if("string"!=typeof t)return i;if(!e||void 0===e.minimumFractionDigits&&void 0===e.maximumFractionDigits){const e=t.indexOf(".")>-1?t.split(".")[1].length:0;i.minimumFractionDigits=e,i.maximumFractionDigits=e}return i};s()}catch(r){s(r)}})},80880:function(t,e,i){i.d(e,{Y:function(){return s}});i(84864),i(57465),i(27495),i(25440);const s=(t,e="_")=>{const i="àáâäæãåāăąабçćčđďдèéêëēėęěеёэфğǵгḧхîïíīįìıİийкłлḿмñńǹňнôöòóœøōõőоṕпŕřрßśšşșсťțтûüùúūǘůűųувẃẍÿýыžźżз·",s=`aaaaaaaaaaabcccdddeeeeeeeeeeefggghhiiiiiiiiijkllmmnnnnnoooooooooopprrrsssssstttuuuuuuuuuuvwxyyyzzzz${e}`,a=new RegExp(i.split("").join("|"),"g"),n={"ж":"zh","х":"kh","ц":"ts","ч":"ch","ш":"sh","щ":"shch","ю":"iu","я":"ia"};let o;return""===t?o="":(o=t.toString().toLowerCase().replace(a,t=>s.charAt(i.indexOf(t))).replace(/[а-я]/g,t=>n[t]||"").replace(/(\d),(?=\d)/g,"$1").replace(/[^a-z0-9]+/g,e).replace(new RegExp(`(${e})\\1+`,"g"),"$1").replace(new RegExp(`^${e}+`),"").replace(new RegExp(`${e}+$`),""),""===o&&(o="unknown")),o}},19459:function(t,e,i){i.d(e,{b:function(){return s}});i(45367),i(92731),i(84864),i(57465),i(27495),i(69479),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);const s=(t,e,i)=>{if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;let a,n;if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(a=n;0!==a--;)if(!s(t[a],e[a],i))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(a of t.entries())if(!e.has(a[0]))return!1;for(a of t.entries())if(!s(a[1],e.get(a[0]),i))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(a of t.entries())if(!e.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!==e.length)return!1;for(a=n;0!==a--;)if(t[a]!==e[a])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const o=Object.keys(t);if(n=o.length,n!==Object.keys(e).length)return!1;for(a=n;0!==a--;)if(!Object.prototype.hasOwnProperty.call(e,o[a]))return!1;for(a=n;0!==a--;){const n=o[a];if(!s(t[n],e[n],i))return!1}if(null!=i&&i.compareSymbols){const a=Object.getOwnPropertySymbols(t),n=Object.getOwnPropertySymbols(e);if(a.length!==n.length)return!1;for(const o of a){if(!Object.prototype.hasOwnProperty.call(e,o))return!1;if(!s(t[o],e[o],i))return!1}}return!0}return t!=t&&e!=e}},34296:function(t,e,i){i(62953);var s=i(40445),a=i(96229),n=i(26069),o=i(91735),r=i(42034),l=i(5124),c=i(67576);let d,h,u,p,g=t=>t;class v extends a.k{renderOutline(){return this.filled?(0,l.qy)(d||(d=g`<span class="filled"></span>`)):super.renderOutline()}getContainerClasses(){return Object.assign(Object.assign({},super.getContainerClasses()),{},{active:this.active})}renderPrimaryContent(){return(0,l.qy)(h||(h=g` <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())}renderTrailingIcon(){return(0,l.qy)(u||(u=g`<slot name="trailing-icon"></slot>`))}constructor(...t){super(...t),this.filled=!1,this.active=!1}}v.styles=[o.R,r.R,n.R,(0,l.AH)(p||(p=g`: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:var(--ha-font-family-body)}`))],(0,s.Cg)([(0,c.MZ)({type:Boolean,reflect:!0})],v.prototype,"filled",void 0),(0,s.Cg)([(0,c.MZ)({type:Boolean})],v.prototype,"active",void 0),v=(0,s.Cg)([(0,c.EM)("ha-assist-chip")],v)},66086:function(t,e,i){i.a(t,async function(t,e){try{i(74423),i(18111),i(22489),i(61701),i(3362),i(62953);var s=i(40445),a=i(5124),n=i(67576),o=i(22786),r=i(1087),l=i(65522),c=i(55931),d=i(66033),h=i(49852),u=i(53641),p=i(65063),g=i(34023),v=(i(75064),i(38508)),_=i(26300),f=(i(67094),t([v,_]));[v,_]=f.then?(await f)():f;let m,y,b,w,C,$,x,k=t=>t;const A="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",S="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",z="___ADD_NEW___";class I extends a.WF{willUpdate(t){var e;this._pendingAreaId&&t.has("hass")&&this.hass.areas!==(null===(e=t.get("hass"))||void 0===e?void 0:e.areas)&&this.hass.areas[this._pendingAreaId]&&(this._setValue(this._pendingAreaId),this._pendingAreaId=void 0)}async open(){var t;await this.updateComplete,await(null===(t=this._picker)||void 0===t?void 0:t.open())}render(){var t;const e=null!==(t=this.label)&&void 0!==t?t:this.hass.localize("ui.components.area-picker.area"),i=this._computeValueRenderer(this.hass.areas);let s=e;if(this.value&&e){const t=this.hass.areas[this.value];if(t){const{floor:e}=(0,d.L)(t,this.hass.floors);e&&(s=void 0)}}return(0,a.qy)(m||(m=k` <ha-generic-picker .hass="${0}" .autofocus="${0}" .label="${0}" .helper="${0}" .notFoundLabel="${0}" .emptyLabel="${0}" .disabled="${0}" .required="${0}" .value="${0}" .getItems="${0}" .getAdditionalItems="${0}" .valueRenderer="${0}" .addButtonLabel="${0}" .searchKeys="${0}" .unknownItemText="${0}" @value-changed="${0}"> </ha-generic-picker> `),this.hass,this.autofocus,s,this.helper,this._notFoundLabel,this.hass.localize("ui.components.area-picker.no_areas"),this.disabled,this.required,this.value,this._getItems,this._getAdditionalItems,i,this.addButtonLabel,h.P,this.hass.localize("ui.components.area-picker.unknown"),this._valueChanged)}_valueChanged(t){t.stopPropagation();const e=t.detail.value;if(e){if(e.startsWith(z)){this.hass.loadFragmentTranslation("config");const t=e.substring(z.length);return void(0,g.J)(this,{suggestedName:t,createEntry:async t=>{try{const e=await(0,u.L3)(this.hass,t);this.hass.areas[e.area_id]?this._setValue(e.area_id):this._pendingAreaId=e.area_id}catch(e){(0,p.showAlertDialog)(this,{title:this.hass.localize("ui.components.area-picker.failed_create_area"),text:e.message})}}})}this._setValue(e)}else this._setValue(void 0)}_setValue(t){this.value=t,(0,r.r)(this,"value-changed",{value:t}),(0,r.r)(this,"change")}constructor(...t){super(...t),this.noAdd=!1,this.disabled=!1,this.required=!1,this._getAreasMemoized=(0,o.A)(h.j),this._computeValueRenderer=(0,o.A)(t=>t=>{const e=this.hass.areas[t];if(!e)return(0,a.qy)(y||(y=k` <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <span slot="headline">${0}</span> `),S,e);const{floor:i}=(0,d.L)(e,this.hass.floors),s=e?(0,l.A)(e):void 0,n=i?(0,c.X)(i):void 0,o=e.icon;return(0,a.qy)(b||(b=k` ${0} <span slot="headline">${0}</span> ${0} `),o?(0,a.qy)(w||(w=k`<ha-icon slot="start" .icon="${0}"></ha-icon>`),o):(0,a.qy)(C||(C=k`<ha-svg-icon slot="start" .path="${0}"></ha-svg-icon>`),S),s,n?(0,a.qy)($||($=k`<span slot="supporting-text">${0}</span>`),n):a.s6)}),this._getItems=()=>this._getAreasMemoized(this.hass.areas,this.hass.floors,this.hass.devices,this.hass.entities,this.hass.states,this.includeDomains,this.excludeDomains,this.includeDeviceClasses,this.deviceFilter,this.entityFilter,this.excludeAreas),this._allAreaNames=(0,o.A)(t=>Object.values(t).map(t=>{var e;return null===(e=(0,l.A)(t))||void 0===e?void 0:e.toLowerCase()}).filter(Boolean)),this._getAdditionalItems=t=>{if(this.noAdd)return[];const e=this._allAreaNames(this.hass.areas);return t&&!e.includes(t.toLowerCase())?[{id:z+t,primary:this.hass.localize("ui.components.area-picker.add_new_suggestion",{name:t}),icon_path:A}]:[{id:z,primary:this.hass.localize("ui.components.area-picker.add_new"),icon_path:A}]},this._notFoundLabel=t=>this.hass.localize("ui.components.area-picker.no_match",{term:(0,a.qy)(x||(x=k`<b>‘${0}’</b>`),t)})}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],I.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)()],I.prototype,"label",void 0),(0,s.Cg)([(0,n.MZ)()],I.prototype,"value",void 0),(0,s.Cg)([(0,n.MZ)()],I.prototype,"helper",void 0),(0,s.Cg)([(0,n.MZ)()],I.prototype,"placeholder",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean,attribute:"no-add"})],I.prototype,"noAdd",void 0),(0,s.Cg)([(0,n.MZ)({type:Array,attribute:"include-domains"})],I.prototype,"includeDomains",void 0),(0,s.Cg)([(0,n.MZ)({type:Array,attribute:"exclude-domains"})],I.prototype,"excludeDomains",void 0),(0,s.Cg)([(0,n.MZ)({type:Array,attribute:"include-device-classes"})],I.prototype,"includeDeviceClasses",void 0),(0,s.Cg)([(0,n.MZ)({type:Array,attribute:"exclude-areas"})],I.prototype,"excludeAreas",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],I.prototype,"deviceFilter",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],I.prototype,"entityFilter",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],I.prototype,"disabled",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],I.prototype,"required",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"add-button-label"})],I.prototype,"addButtonLabel",void 0),(0,s.Cg)([(0,n.P)("ha-generic-picker")],I.prototype,"_picker",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"_pendingAreaId",void 0),I=(0,s.Cg)([(0,n.EM)("ha-area-picker")],I),e()}catch(m){e(m)}})},99611:function(t,e,i){i.a(t,async function(t,e){try{i(18111),i(13579),i(3362),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var s=i(40445),a=i(1126),n=i(35211),o=i(5124),r=i(67576),l=i(1087),c=i(60353),d=i(22792),h=i(59992),u=i(14503),p=i(22348),g=t([a,h]);[a,h]=g.then?(await g)():g;let v,_,f=t=>t;const m=300,y=new Set(["ha-control-slider","ha-slider","ha-control-switch","ha-control-circular-slider","ha-hs-color-picker","ha-map","ha-more-info-control-select-container","ha-filter-chip"]),b=new Set(["volume-slider-container","forecast"]);class w extends((0,h.V)(o.WF)){get scrollableElement(){return this._bodyElement}connectedCallback(){super.connectedCallback(),this.addEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.addEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0})}updated(t){super.updated(t),t.has("open")&&(this._drawerOpen=this.open)}render(){return(0,o.qy)(v||(v=f` <wa-drawer id="drawer" placement="bottom" .open="${0}" .lightDismiss="${0}" .ariaLabelledby="${0}" .ariaDescribedby="${0}" @keydown="${0}" @wa-show="${0}" @wa-after-show="${0}" @wa-hide="${0}" @wa-after-hide="${0}" @click="${0}" without-header @touchstart="${0}"> <div class="handle-wrapper" aria-hidden="true"> <div class="handle"></div> </div> <slot name="header"></slot> <div class="content-wrapper"> <div id="body" class="body ha-scrollbar"> <slot></slot> </div> ${0} </div> <slot name="footer"></slot> </wa-drawer> `),this._drawerOpen,!this.preventScrimClose,this.ariaLabelledBy,this.ariaDescribedBy,this._handleKeyDown,this._handleShow,this._handleAfterShow,this._handleHide,this._handleAfterHide,this._handleCloseAction,this._handleTouchStart,this.renderScrollableFades())}_startResizing(t){document.addEventListener("touchmove",this._handleTouchMove,{passive:!1}),document.addEventListener("touchend",this._handleTouchEnd),document.addEventListener("touchcancel",this._handleTouchEnd),this._gestureRecognizer.start(t)}_animateSnapBack(){this.style.setProperty("--dialog-transition",`transform ${m}ms ease-out`),this.style.removeProperty("--dialog-transform"),setTimeout(()=>{this.style.removeProperty("--dialog-transition")},m)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.removeEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0}),this._unregisterResizeHandlers(),this._isDragging=!1}static get styles(){return[...super.styles,u.dp,(0,o.AH)(_||(_=f`wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:${0}ms;--hide-duration:${0}ms}wa-drawer::part(dialog){max-height:min(var(--ha-bottom-sheet-max-height,90vh),calc(100vh - max(var(--safe-area-inset-top),48px)));max-height:min(var(--ha-bottom-sheet-max-height,90dvh),calc(100dvh - max(var(--safe-area-inset-top),48px)));align-items:center;transform:var(--dialog-transform);transition:var(--dialog-transition)}@media (prefers-reduced-motion:reduce){wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:1ms;--hide-duration:1ms}wa-drawer::part(dialog){transition:1ms}}wa-drawer::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));background-color:var(--ha-bottom-sheet-scrim-color,var(--mdc-dialog-scrim-color,none))}wa-drawer::part(body){max-width:var(--ha-bottom-sheet-max-width);width:100%;position:relative;border-top-left-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));border-top-right-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));background-color:var(--ha-bottom-sheet-surface-background,var(--ha-dialog-surface-background,var(--card-background-color,var(--ha-color-surface-default))));-webkit-backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));padding:var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left))}:host([flexcontent]) wa-drawer::part(body){display:flex;flex-direction:column}:host([prevent-scrim-close]) .handle-wrapper{display:none}.handle-wrapper{position:absolute;top:0;inset-inline-start:0;width:100%;padding-bottom:2px;display:flex;justify-content:center;align-items:center;pointer-events:none;z-index:1}.handle-wrapper .handle{height:16px;width:200px;display:flex;justify-content:center;align-items:center}.handle-wrapper .handle::after{content:"";border-radius:var(--ha-border-radius-md);height:4px;background:var(--ha-bottom-sheet-handle-color,var(--divider-color));width:40px}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{padding:var(--ha-bottom-sheet-content-padding,0);box-sizing:border-box}:host([flexcontent]) .body{flex:1;max-width:100%;display:flex;flex-direction:column;padding:var(--ha-bottom-sheet-content-padding,var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left)));box-sizing:border-box}slot[name=footer]{display:block;padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%;box-sizing:border-box}:host([flexcontent]) slot[name=footer]{flex-shrink:0}`),m,m)]}constructor(...t){super(...t),this.open=!1,this.flexContent=!1,this.preventScrimClose=!1,this._drawerOpen=!1,this._sliderInteractionActive=!1,this._gestureRecognizer=new c.u,this._isDragging=!1,this._escapePressed=!1,this._handleShow=async()=>{this._drawerOpen=!0,this.open=!0,(0,l.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{var t;const e=this._autofocusElement;null!==(t=this._hassConfig)&&void 0!==t&&t.auth.external&&(0,p.V)(this._hassConfig.auth.external)?e&&(e.id||(e.id="ha-bottom-sheet-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})):null==e||e.focus()})},this._handleAfterShow=()=>{(0,l.r)(this,"after-show")},this._handleSliderInteractionStart=()=>{this._sliderInteractionActive=!0},this._handleSliderInteractionStop=()=>{this._sliderInteractionActive=!1},this._handleAfterHide=t=>{if(this._sliderInteractionActive)return this._drawerOpen=!0,void(this.open=!0);t.eventPhase===Event.AT_TARGET&&(this.open=!1,this._drawerOpen=!1,(0,l.r)(this,"closed"))},this._handleHide=t=>{if(t.eventPhase!==Event.AT_TARGET)return;const e=t.detail.source===t.target.drawer;if(this._sliderInteractionActive)return t.preventDefault(),this._drawerOpen=!0,this.open=!0,void(this._escapePressed=!1);this.preventScrimClose&&this._escapePressed&&e&&t.preventDefault(),this._escapePressed=!1},this._handleKeyDown=t=>{"Escape"===t.key&&(this._escapePressed=!0,this.preventScrimClose&&t.preventDefault(),t.stopPropagation(),t.currentTarget.open=!1)},this._handleCloseAction=t=>{t.composedPath().some(t=>t instanceof HTMLElement&&("close"===t.getAttribute("data-dialog")||"close"===t.getAttribute("data-drawer")))&&(this._drawerOpen=!1)},this._handleTouchStart=t=>{if(this.preventScrimClose)return;const e=t.composedPath();for(const i of e){if(i===this._drawer)break;if(i instanceof HTMLElement&&(i.scrollTop>0||y.has(i.localName)||Array.from(i.classList).some(t=>b.has(t))))return}t.stopPropagation(),this._startResizing(t.touches[0].clientY)},this._handleTouchMove=t=>{const e=t.touches[0].clientY,i=this._gestureRecognizer.move(e);i<0&&(t.preventDefault(),this._isDragging=!0,requestAnimationFrame(()=>{this._isDragging&&this.style.setProperty("--dialog-transform",`translateY(${-1*i}px)`)}))},this._handleTouchEnd=()=>{var t;this._unregisterResizeHandlers(),this._isDragging=!1;const e=this._gestureRecognizer.end();if(e.isSwipe)return void(e.isDownwardSwipe?this._drawerOpen=!1:this._animateSnapBack());const i=null===(t=this._drawer.shadowRoot)||void 0===t?void 0:t.querySelector('[part="body"]'),s=(null==i?void 0:i.offsetHeight)||0;s>0&&e.delta<0&&Math.abs(e.delta)>.5*s?this._drawerOpen=!1:this._animateSnapBack()},this._unregisterResizeHandlers=()=>{document.removeEventListener("touchmove",this._handleTouchMove),document.removeEventListener("touchend",this._handleTouchEnd),document.removeEventListener("touchcancel",this._handleTouchEnd)}}}(0,s.Cg)([(0,r.MZ)({attribute:"aria-labelledby"})],w.prototype,"ariaLabelledBy",void 0),(0,s.Cg)([(0,r.MZ)({attribute:"aria-describedby"})],w.prototype,"ariaDescribedBy",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],w.prototype,"open",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],w.prototype,"flexContent",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],w.prototype,"preventScrimClose",void 0),(0,s.Cg)([(0,r.wk)()],w.prototype,"_drawerOpen",void 0),(0,s.Cg)([(0,r.wk)()],w.prototype,"_sliderInteractionActive",void 0),(0,s.Cg)([(0,r.wk)(),(0,n.Fg)({context:d.WF,subscribe:!0})],w.prototype,"_hassConfig",void 0),(0,s.Cg)([(0,r.P)("#drawer")],w.prototype,"_drawer",void 0),(0,s.Cg)([(0,r.P)("#body")],w.prototype,"_bodyElement",void 0),(0,s.Cg)([(0,r.P)("[autofocus]")],w.prototype,"_autofocusElement",void 0),w=(0,s.Cg)([(0,r.EM)("ha-bottom-sheet")],w),e()}catch(v){e(v)}})},70947:function(t,e,i){i(62953);var s=i(40445),a=i(50759),n=(i(38625),i(5124)),o=i(67576);i(67094);let r,l,c=t=>t;class d extends a.A{renderCheckboxIcon(){return(0,n.qy)(r||(r=c` <ha-svg-icon id="check" part="checkmark" .path="${0}"></ha-svg-icon> `),this.checked?"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z")}static get styles(){return[a.A.styles,(0,n.AH)(l||(l=c`:host{min-height:var(--ha-space-10)}#check{visibility:visible;flex-shrink:0}#icon ::slotted(*){color:var(--ha-color-on-neutral-normal)}:host([variant=danger]) #icon ::slotted(*){color:var(--ha-color-on-danger-quiet)}:host([selected]){font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}:host([selected]:hover){background-color:var(--ha-color-fill-primary-quiet-hover)}`))]}constructor(...t){super(...t),this.selected=!1}}(0,s.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],d.prototype,"selected",void 0),d=(0,s.Cg)([(0,o.EM)("ha-dropdown-item")],d)},29823:function(t,e,i){i.a(t,async function(t,e){try{i(3362),i(62953);var s=i(40445),a=i(52254),n=i(5124),o=i(67576),r=t([a]);a=(r.then?(await r)():r)[0];let l,c=t=>t;class d extends a.A{get anchorElement(){var t;return null===(t=this.popup)||void 0===t?void 0:t.anchor}set anchorElement(t){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=t)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!0)}async hideMenu(){const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!1),await super.hideMenu()}static get styles(){return[a.A.styles,(0,n.AH)(l||(l=c`:host{font-size:var(--ha-dropdown-font-size, var(--ha-font-size-m));--wa-color-surface-raised:var(
--card-background-color,
var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)),
)}#menu{padding:var(--ha-space-1)}wa-popup::part(popup){z-index:200}`))]}constructor(...t){super(...t),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,s.Cg)([(0,o.MZ)({attribute:!1})],d.prototype,"dropdownTag",void 0),(0,s.Cg)([(0,o.MZ)({attribute:!1})],d.prototype,"dropdownItemTag",void 0),d=(0,s.Cg)([(0,o.EM)("ha-dropdown")],d),e()}catch(l){e(l)}})},14927:function(t,e,i){i.a(t,async function(t,s){try{i.r(e),i.d(e,{HaLanguagePicker:function(){return A},getLanguageOptions:function(){return k}});var a=i(74487),n=(i(26910),i(18111),i(20116),i(61701),i(62953),i(40445)),o=i(5124),r=i(67576),l=i(22786),c=i(1087),d=i(86198),h=i(52220),u=i(28684),p=i(18350),g=i(38508),v=t([a,p,g,d]);[a,p,g,d]=v.then?(await v)():v;let _,f,m,y,b,w,C=t=>t;const $="M7,10L12,15L17,10H7Z",x=[{name:"primary",weight:10},{name:"secondary",weight:8},{name:"search_labels.english",weight:5}],k=(t,e,i,s)=>{let a=[];const n={language:"en"};if(e){const e=u.P.translations;a=t.map(t=>{var i;let a=null===(i=e[t])||void 0===i?void 0:i.nativeName;if(!a)try{a=new Intl.DisplayNames(t,{type:"language",fallback:"code"}).of(t)}catch(l){a=t}const o=(0,d.T)(t,s||{language:navigator.language}),r=(0,d.T)(t,n);return{id:t,primary:a,secondary:o!==a?o:void 0,search_labels:{english:r!==a?r:null}}})}else s&&(a=t.map(t=>{const e=(0,d.T)(t,s),i=(0,d.T)(t,n);return{id:t,primary:e,search_labels:{english:i!==e?i:null}}}));return!i&&s&&a.sort((t,e)=>(0,h.SH)(t.primary,e.primary,s.language)),a};class A extends o.WF{firstUpdated(t){super.firstUpdated(t),this._computeDefaultLanguageOptions()}_computeDefaultLanguageOptions(){this._defaultLanguages=Object.keys(u.P.translations)}render(){var t,e,i,s;const a=null!==(t=this.label)&&void 0!==t?t:(null===(e=this.hass)||void 0===e?void 0:e.localize("ui.components.language-picker.language"))||"Language",n=null!==(i=this.value)&&void 0!==i?i:this.required&&!this.disabled?this._getItems()[0].id:this.value;return(0,o.qy)(_||(_=C` <ha-generic-picker .hass="${0}" .autofocus="${0}" .notFoundLabel="${0}" .emptyLabel="${0}" .label="${0}" .value="${0}" .valueRenderer="${0}" .disabled="${0}" .helper="${0}" .getItems="${0}" .searchKeys="${0}" @value-changed="${0}" hide-clear-icon> ${0} </ha-generic-picker> `),this.hass,this.autofocus,this._notFoundLabel,(null===(s=this.hass)||void 0===s?void 0:s.localize("ui.components.language-picker.no_languages"))||"No languages available",a,n,this._valueRenderer,this.disabled,this.helper,this._getItems,x,this._changed,this.buttonStyle?(0,o.qy)(f||(f=C`<ha-button slot="field" .disabled="${0}" @click="${0}" appearance="plain" variant="neutral"> ${0} <ha-svg-icon slot="end" .path="${0}"></ha-svg-icon> </ha-button>`),this.disabled,this._openPicker,this._getLanguageName(n),$):o.s6)}_openPicker(t){t.stopPropagation(),this.genericPicker.open()}_changed(t){t.stopPropagation(),this.value=t.detail.value,(0,c.r)(this,"value-changed",{value:this.value})}constructor(...t){super(...t),this.disabled=!1,this.required=!1,this.nativeName=!1,this.buttonStyle=!1,this.noSort=!1,this._defaultLanguages=[],this._getLanguagesOptions=(0,l.A)(k),this._getItems=()=>{var t,e;return this._getLanguagesOptions(null!==(t=this.languages)&&void 0!==t?t:this._defaultLanguages,this.nativeName,this.noSort,null===(e=this.hass)||void 0===e?void 0:e.locale)},this._getLanguageName=t=>{var e;return null===(e=this._getItems().find(e=>e.id===t))||void 0===e?void 0:e.primary},this._valueRenderer=t=>{var e;return(0,o.qy)(m||(m=C`<span slot="headline">${0}</span> `),null!==(e=this._getLanguageName(t))&&void 0!==e?e:t)},this._notFoundLabel=t=>{const e=(0,o.qy)(y||(y=C`<b>‘${0}’</b>`),t);return this.hass?this.hass.localize("ui.components.language-picker.no_match",{term:e}):(0,o.qy)(b||(b=C`No languages found for ${0}`),e)}}}A.styles=(0,o.AH)(w||(w=C`ha-generic-picker{width:100%;display:block}`)),(0,n.Cg)([(0,r.MZ)()],A.prototype,"value",void 0),(0,n.Cg)([(0,r.MZ)()],A.prototype,"label",void 0),(0,n.Cg)([(0,r.MZ)({type:Array})],A.prototype,"languages",void 0),(0,n.Cg)([(0,r.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,n.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],A.prototype,"disabled",void 0),(0,n.Cg)([(0,r.MZ)({type:Boolean})],A.prototype,"required",void 0),(0,n.Cg)([(0,r.MZ)()],A.prototype,"helper",void 0),(0,n.Cg)([(0,r.MZ)({attribute:"native-name",type:Boolean})],A.prototype,"nativeName",void 0),(0,n.Cg)([(0,r.MZ)({type:Boolean,attribute:"button-style"})],A.prototype,"buttonStyle",void 0),(0,n.Cg)([(0,r.MZ)({attribute:"no-sort",type:Boolean})],A.prototype,"noSort",void 0),(0,n.Cg)([(0,r.wk)()],A.prototype,"_defaultLanguages",void 0),(0,n.Cg)([(0,r.P)("ha-generic-picker",!0)],A.prototype,"genericPicker",void 0),A=(0,n.Cg)([(0,r.EM)("ha-language-picker")],A),s()}catch(_){s(_)}})},2226:function(t,e,i){i(89463),i(18111),i(61701),i(62953);var s=i(40445),a=i(35211),n=i(5124),o=i(67576),r=i(6412),l=i(63672),c=i(89784),d=i(1087),h=i(15638),u=i(22792);i(64013),i(92677);let p,g,v,_,f,m=t=>t;class y extends n.WF{render(){var t;const e=null!==(t=this.maxColumns)&&void 0!==t?t:3,i=Math.min(e,this.options.length);return(0,n.qy)(p||(p=m` <ha-radio-group class="list" style="${0}" .value="${0}" @change="${0}"> ${0} </ha-radio-group> `),(0,c.W)({"--columns":i}),this.value,this._radioChanged,this.options.map(t=>this._renderOption(t)))}_renderOption(t){var e;const i=1===this.maxColumns&&!this.stackedImage,s=1===this.maxColumns&&this.stackedImage,a=t.disabled||this.disabled||!1,o=t.value===this.value,c=(null===(e=this._ui)||void 0===e?void 0:e.themes.darkMode)||!1,d=!!this._i18n&&(0,h.qC)(this._i18n.language,this._i18n.translationMetadata.translations),u="object"==typeof t.image?c&&t.image.src_dark||t.image.src:t.image,p="object"==typeof t.image&&(d&&t.image.flip_rtl);return(0,n.qy)(g||(g=m` <label class="option ${0}" ?disabled="${0}"> <div class="content"> <ha-radio-option aria-describedby="${0}" aria-labelledby="${0}" .value="${0}" .disabled="${0}"></ha-radio-option> <div class="text"> <span id="${0}" class="label">${0}</span> ${0} </div> </div> ${0} </label> `),(0,r.H)({horizontal:i,stacked:s,selected:o}),a,(0,l.J)(t.description?`desc-${t.value}`:void 0),`label-${t.value}`,t.value,a,`label-${t.value}`,t.label,t.description?(0,n.qy)(v||(v=m`<span class="description" id="desc-${0}">${0}</span>`),t.value,t.description):n.s6,u?(0,n.qy)(_||(_=m` <img class="${0}" alt="" src="${0}"> `),p?"flipped":"",u):n.s6)}_radioChanged(t){var e;t.stopPropagation();const i=t.currentTarget.value;this.disabled||void 0===i||i===(null!==(e=this.value)&&void 0!==e?e:"")||(0,d.r)(this,"value-changed",{value:i})}constructor(...t){super(...t),this.options=[],this.stackedImage=!1}}y.styles=(0,n.AH)(f||(f=m`.list::part(form-control-input){display:grid;grid-template-columns:repeat(var(--columns,1),minmax(0,1fr));gap:var(--ha-space-3)}.option{position:relative;display:block;border:1px solid var(--divider-color);border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:12px;gap:var(--ha-space-2);overflow:hidden;cursor:pointer}.option .content{position:relative;display:flex;flex-direction:row;gap:var(--ha-space-2);min-width:0;width:100%}.option .content ha-radio-option{--ha-radio-option-control-margin:0;margin:0;flex:none}.option .content .text{display:flex;flex-direction:column;gap:var(--ha-space-1);min-width:0;flex:1;justify-content:center}.option .content .text .label{color:var(--primary-text-color);font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed);overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.option .content .text .description{color:var(--secondary-text-color);font-size:var(--ha-font-size-s);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed)}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.stacked{align-items:stretch}.option.stacked img{max-width:100%;max-height:var(--ha-select-box-image-size,96px);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}`)),(0,s.Cg)([(0,o.MZ)({attribute:!1})],y.prototype,"options",void 0),(0,s.Cg)([(0,o.MZ)({attribute:!1})],y.prototype,"value",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean})],y.prototype,"disabled",void 0),(0,s.Cg)([(0,o.MZ)({type:Number,attribute:"max_columns"})],y.prototype,"maxColumns",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean,attribute:"stacked_image"})],y.prototype,"stackedImage",void 0),(0,s.Cg)([(0,o.wk)(),(0,a.Fg)({context:u.D5,subscribe:!0})],y.prototype,"_i18n",void 0),(0,s.Cg)([(0,o.wk)(),(0,a.Fg)({context:u.EK,subscribe:!0})],y.prototype,"_ui",void 0),y=(0,s.Cg)([(0,o.EM)("ha-select-box")],y)},606:function(t,e,i){i.a(t,async function(t,e){try{i(74423),i(18111),i(61701),i(62953);var s=i(40445),a=i(5124),n=i(67576),o=i(63672),r=i(22786),l=i(1087),c=i(29823),d=(i(70947),i(3449),i(88285)),h=(i(67094),t([c,d]));[c,d]=h.then?(await h)():h;let u,p,g,v,_,f,m,y,b,w=t=>t;class C extends a.WF{render(){return this.disabled?(0,a.qy)(u||(u=w`${0}${0}`),this._renderField(),this._renderHelper()):(0,a.qy)(p||(p=w` <ha-dropdown placement="bottom" @wa-select="${0}" @wa-show="${0}" @wa-hide="${0}"> ${0} ${0} </ha-dropdown> ${0} `),this._handleSelect,this._handleShow,this._handleHide,this._renderField(),this.options?this.options.map(t=>{var e;const i=["string","number"].includes(typeof t);return(0,a.qy)(g||(g=w` <ha-dropdown-item .value="${0}" .disabled="${0}" .selected="${0}"> ${0} <div class="content"> ${0} ${0} </div> </ha-dropdown-item> `),i?t:t.value,!i&&(null!==(e=t.disabled)&&void 0!==e&&e),this.value===(i?t:t.value),t.iconPath?(0,a.qy)(v||(v=w`<ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>`),t.iconPath):a.s6,i?t:t.label||t.value,t.secondary?(0,a.qy)(_||(_=w`<div class="secondary">${0}</div>`),t.secondary):a.s6)}):(0,a.qy)(f||(f=w`<slot></slot>`)),this._renderHelper())}_renderField(){const t=this._getValueLabel(this.options,this.value);return(0,a.qy)(m||(m=w` <ha-picker-field slot="trigger" type="button" class="${0}" compact="compact" aria-label="${0}" @clear="${0}" .label="${0}" .value="${0}" .required="${0}" .disabled="${0}" .hideClearIcon="${0}"> </ha-picker-field> `),this._opened?"opened":"",(0,o.J)(this.label),this._clearValue,this.label,t,this.required,this.disabled,!this.clearable||this.required||this.disabled||!String(this.value))}_renderHelper(){return this.helper?(0,a.qy)(y||(y=w`<ha-input-helper-text .disabled="${0}">${0}</ha-input-helper-text>`),this.disabled,this.helper):a.s6}_handleSelect(t){t.stopPropagation();const e=t.detail.item.value;e!==this.value&&(0,l.r)(this,"selected",{value:e})}_clearValue(){!this.disabled&&this.value&&(0,l.r)(this,"selected",{value:void 0})}_handleShow(){this.style.setProperty("--select-menu-width",`${this._triggerField.offsetWidth}px`),this._opened=!0}_handleHide(){this._opened=!1}constructor(...t){super(...t),this.clearable=!1,this.required=!1,this.disabled=!1,this._opened=!1,this._getValueLabel=(0,r.A)((t,e)=>{const i=void 0!==e?String(e):void 0;if(!t||!i)return i;for(const s of t){const t=["string","number"].includes(typeof s);if(t&&s===i||!t&&String(s.value)===i)return t?s:s.label||s.value}return i})}}C.styles=(0,a.AH)(b||(b=w`:host{position:relative}ha-picker-field.opened{--mdc-text-field-idle-line-color:var(--primary-color)}ha-dropdown-item .content{display:flex;gap:var(--ha-space-1);flex-direction:column}ha-dropdown-item .secondary{font-size:var(--ha-font-size-s);color:var(--ha-color-text-secondary)}ha-dropdown::part(menu){min-width:var(--select-menu-width)}ha-input-helper-text{display:block;margin:var(--ha-space-2) 0 0}`)),(0,s.Cg)([(0,n.MZ)({type:Boolean})],C.prototype,"clearable",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],C.prototype,"options",void 0),(0,s.Cg)([(0,n.MZ)()],C.prototype,"label",void 0),(0,s.Cg)([(0,n.MZ)()],C.prototype,"helper",void 0),(0,s.Cg)([(0,n.MZ)()],C.prototype,"value",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],C.prototype,"required",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],C.prototype,"disabled",void 0),(0,s.Cg)([(0,n.wk)()],C.prototype,"_opened",void 0),(0,s.Cg)([(0,n.P)("ha-picker-field")],C.prototype,"_triggerField",void 0),C=(0,s.Cg)([(0,n.EM)("ha-select")],C),e()}catch(u){e(u)}})},58933:function(t,e,i){i.a(t,async function(t,e){try{i(13609),i(18111),i(61701),i(13579),i(3362),i(62953);var s=i(40445),a=i(5124),n=i(67576),o=i(1087),r=i(9899),l=i(52069),c=i(606),d=t([c]);c=(d.then?(await d)():d)[0];let h,u,p=t=>t;const g="__NONE_OPTION__";class v extends a.WF{render(){var t,e;if(!this._voices)return a.s6;const i=null!==(t=this.value)&&void 0!==t?t:this.required?null===(e=this._voices[0])||void 0===e?void 0:e.voice_id:g,s=(this._voices||[]).map(t=>({value:t.voice_id,label:t.name}));return this.required&&this.value||s.unshift({value:g,label:this.hass.localize("ui.components.tts-voice-picker.none")}),(0,a.qy)(h||(h=p` <ha-select .label="${0}" .value="${0}" .required="${0}" .disabled="${0}" @selected="${0}" .options="${0}"> </ha-select> `),this.label||this.hass.localize("ui.components.tts-voice-picker.voice"),i,this.required,this.disabled,this._changed,s)}willUpdate(t){super.willUpdate(t),this.hasUpdated?(t.has("language")||t.has("engineId"))&&this._debouncedUpdateVoices():this._updateVoices()}async _updateVoices(){var t,e;if(!this.engineId||!this.language)return void(this._voices=void 0);this._voices=(await(0,l.z3)(this.hass,this.engineId,this.language)).voices;if(this.value&&(null===(t=this._voices)||void 0===t?void 0:t.some(t=>t.voice_id===this.value)))return;const i=this.required&&null!==(e=this._voices)&&void 0!==e&&e.length?this._voices[0].voice_id:void 0;i!==this.value&&(this.value=i,(0,o.r)(this,"value-changed",{value:this.value}))}_changed(t){const e=t.detail.value;!this.hass||""===e||e===this.value||void 0===this.value&&e===g||(this.value=e===g?void 0:e,(0,o.r)(this,"value-changed",{value:this.value}))}constructor(...t){super(...t),this.disabled=!1,this.required=!1,this._debouncedUpdateVoices=(0,r.s)(()=>this._updateVoices(),500)}}v.styles=(0,a.AH)(u||(u=p`ha-select{width:100%;text-align:start;display:block}`)),(0,s.Cg)([(0,n.MZ)()],v.prototype,"value",void 0),(0,s.Cg)([(0,n.MZ)()],v.prototype,"label",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"engineId",void 0),(0,s.Cg)([(0,n.MZ)()],v.prototype,"language",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],v.prototype,"disabled",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],v.prototype,"required",void 0),(0,s.Cg)([(0,n.wk)()],v.prototype,"_voices",void 0),v=(0,s.Cg)([(0,n.EM)("ha-tts-voice-picker")],v),e()}catch(h){e(h)}})},28170:function(t,e,i){i.d(e,{o:function(){return c}});i(62953);var s=i(40445),a=i(5124),n=i(67576),o=i(1087),r=i(83892);let l;class c extends r.x{connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role",this.defaultRole),(0,o.r)(this,"ha-list-item-register",{item:this})}disconnectedCallback(){super.disconnectedCallback(),(0,o.r)(this,"ha-list-item-unregister",{item:this})}activate(){this.click()}constructor(...t){super(...t),this.interactive=!1,this.defaultRole="listitem"}}c.styles=[r.x.styles,(0,a.AH)(l||(l=(t=>t)`:host{--ha-list-item-focus-radius:var(--ha-border-radius-sm);--ha-list-item-focus-width:2px;--ha-list-item-focus-width-start:var(--ha-space-2);--ha-list-item-focus-offset:-2px;--ha-list-item-focus-background:var(--ha-color-fill-neutral-quiet-hover)}:host(:focus){outline:0}.base{border-radius:var(--ha-list-item-focus-radius);outline:var(--ha-list-item-focus-width) solid transparent;outline-offset:var(--ha-list-item-focus-offset);transition:outline-color var(--ha-animation-duration-fast) ease-out,background-color var(--ha-animation-duration-fast) ease-out}@keyframes ha-list-item-focus-in{from{outline-width:var(--ha-list-item-focus-width-start);outline-offset:calc(-1 * var(--ha-list-item-focus-width-start))}to{outline-width:var(--ha-list-item-focus-width);outline-offset:var(--ha-list-item-focus-offset)}}:host(:focus-visible) .base{outline-color:var(--ha-color-focus);background-color:var(--ha-list-item-focus-background);animation:ha-list-item-focus-in var(--ha-animation-duration-normal) ease-in}`))],(0,s.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],c.prototype,"interactive",void 0),c=(0,s.Cg)([(0,n.EM)("ha-list-item-base")],c)},1671:function(t,e,i){i(62953);var s=i(40445),a=i(5124),n=i(67576),o=i(63672),r=(i(54276),i(28170));let l,c,d,h,u=t=>t;class p extends r.o{activate(){var t;null===(t=this._item)||void 0===t||t.click()}_renderBase(t){return void 0!==this.href?(0,a.qy)(l||(l=u`<a part="base" class="base interactive" id="item" href="${0}" target="${0}" rel="${0}" download="${0}" tabindex="-1" aria-disabled="${0}"> ${0}${0} </a>`),(0,o.J)(this.disabled?void 0:this.href),(0,o.J)(this.target),(0,o.J)(this.rel),(0,o.J)(this.download),this.disabled?"true":"false",this._renderRipple(),t):(0,a.qy)(c||(c=u`<button part="base" class="base interactive" id="item" type="button" ?disabled="${0}" tabindex="-1"> ${0}${0} </button>`),this.disabled,this._renderRipple(),t)}_renderRipple(){return(0,a.qy)(d||(d=u`<ha-ripple part="ripple" for="item" ?disabled="${0}"></ha-ripple>`),this.disabled)}constructor(...t){super(...t),this.interactive=!0}}p.styles=[r.o.styles,(0,a.AH)(h||(h=u`:host{cursor:pointer;--ha-ripple-color:var(--primary-text-color)}:host([disabled]){cursor:default}.base.interactive{width:100%;border:none;background:0 0;color:inherit;font:inherit;text-align:inherit;text-decoration:none;appearance:none;cursor:inherit}:host([disabled]) .base.interactive{color:var(--disabled-text-color)}`))],(0,s.Cg)([(0,n.MZ)({type:String})],p.prototype,"href",void 0),(0,s.Cg)([(0,n.MZ)({type:String})],p.prototype,"target",void 0),(0,s.Cg)([(0,n.MZ)({type:String})],p.prototype,"rel",void 0),(0,s.Cg)([(0,n.MZ)({type:String})],p.prototype,"download",void 0),(0,s.Cg)([(0,n.P)("#item")],p.prototype,"_item",void 0),p=(0,s.Cg)([(0,n.EM)("ha-list-item-button")],p)},83892:function(t,e,i){i.d(e,{x:function(){return v}});i(18111),i(13579),i(27495),i(42762),i(62953);var s=i(40445),a=i(92070),n=i(5124),o=i(67576);let r,l,c,d,h,u,p,g=t=>t;class v extends n.WF{_onSlotChange(t){return e=>{const i=e.target.assignedNodes({flatten:!0}).some(t=>{var e;return t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&""!==(null===(e=t.textContent)||void 0===e?void 0:e.trim())});"start"===t?this._hasStart=i:this._hasEnd=i}}render(){return this._renderBase(this._renderInner())}_renderBase(t){return(0,n.qy)(r||(r=g`<div part="base" class="base" id="item">${0}</div>`),t)}_renderInner(){const t=this._slotController.test("content");return(0,n.qy)(l||(l=g` <div part="start" class="start" ?hidden="${0}"> <slot name="start" @slotchange="${0}"></slot> </div> <div part="content" class="content"> ${0} </div> <div part="end" class="end" ?hidden="${0}"> <slot name="end" @slotchange="${0}"></slot> </div> `),!this._hasStart,this._onSlotChange("start"),t?(0,n.qy)(c||(c=g`<slot name="content"></slot>`)):this._renderDefaultContent(),!this._hasEnd,this._onSlotChange("end"))}_renderDefaultContent(){var t,e;const i=this._slotController.test("headline"),s=this._slotController.test("supporting-text"),a=i||void 0!==this.headline,o=s||void 0!==this.supportingText;return(0,n.qy)(d||(d=g` ${0} ${0} `),a?(0,n.qy)(h||(h=g`<div part="headline" class="headline"> <slot name="headline">${0}</slot> </div>`),null!==(t=this.headline)&&void 0!==t?t:n.s6):n.s6,o?(0,n.qy)(u||(u=g`<div part="supporting-text" class="supporting"> <slot name="supporting-text">${0}</slot> </div>`),null!==(e=this.supportingText)&&void 0!==e?e:n.s6):n.s6)}constructor(...t){super(...t),this.disabled=!1,this._slotController=new a.X(this,"headline","supporting-text","content"),this._hasStart=!1,this._hasEnd=!1}}v.styles=(0,n.AH)(p||(p=g`:host{display:block;color:var(--primary-text-color);font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal)}:host([disabled]){color:var(--disabled-text-color);pointer-events:none}.base{position:relative;display:flex;flex-direction:row;align-items:center;gap:var(--ha-row-item-gap,var(--ha-space-4));padding-block:var(--ha-row-item-padding-block,var(--ha-space-3));padding-inline:var(--ha-row-item-padding-inline,var(--ha-space-4));min-height:var(--ha-row-item-min-height,48px);box-sizing:border-box}.content{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;justify-content:center}.end,.start{display:flex;align-items:center;flex:0 0 auto}.end[hidden],.start[hidden]{display:none}.headline{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.supporting{color:var(--secondary-text-color);font-size:var(--ha-font-size-s);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}`)),(0,s.Cg)([(0,o.MZ)({type:String})],v.prototype,"headline",void 0),(0,s.Cg)([(0,o.MZ)({type:String,attribute:"supporting-text"})],v.prototype,"supportingText",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],v.prototype,"disabled",void 0),(0,s.Cg)([(0,o.wk)()],v.prototype,"_hasStart",void 0),(0,s.Cg)([(0,o.wk)()],v.prototype,"_hasEnd",void 0),v=(0,s.Cg)([(0,o.EM)("ha-row-item")],v)},50723:function(t,e,i){i.d(e,{N:function(){return p}});i(74423),i(26910),i(18111),i(22489),i(7588),i(62953);var s=i(40445),a=i(5124),n=i(67576),o=i(91335);i(44114),i(94490);const r=t=>{const e=[];let i=t;for(;i;){e.push(i);const t=i.parentNode;if(t instanceof ShadowRoot)i=t.host;else if(t)i=t;else{const t=i.getRootNode();i=t instanceof ShadowRoot?t.host:null}}return e.reverse()},l=(t,e)=>{if(t===e)return 0;const i=r(t),s=r(e);let a=0;for(;a<i.length&&a<s.length&&i[a]===s[a];)a++;return 0===a?0:a===i.length?-1:a===s.length?1:i[a].compareDocumentPosition(s[a])&Node.DOCUMENT_POSITION_FOLLOWING?-1:1};var c=i(1087);let d,h,u=t=>t;class p extends a.WF{connectedCallback(){super.connectedCallback(),this.hasAttribute("ha-list")||this.setAttribute("ha-list",""),!this.hasAttribute("role")&&this.hostRole&&this.setAttribute("role",this.hostRole),this._unbindKeys=(0,o.Tc)(this,{ArrowDown:this._onForward,ArrowUp:this._onBack,Home:this._onHome,End:this._onEnd,Enter:this._onActivate,Space:this._onActivate}),this.addEventListener("focusin",this._onFocusIn),this.addEventListener("ha-list-item-register",this._onItemRegister),this.addEventListener("ha-list-item-unregister",this._onItemUnregister)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._unbindKeys)||void 0===t||t.call(this),this._unbindKeys=void 0,this.removeEventListener("focusin",this._onFocusIn),this.removeEventListener("ha-list-item-register",this._onItemRegister),this.removeEventListener("ha-list-item-unregister",this._onItemUnregister)}focus(t){this.items.length?this.focusItemAtIndex(this._activeItemIndex>=0?this._activeItemIndex:0):super.focus(t)}focusItemAtIndex(t){t<0||this.setActiveItemIndex(t,!0)}getActiveItemIndex(){return this._activeItemIndex}setActiveItemIndex(t,e=!1){this._hasFocusableItem?(this._activeItemIndex=Math.max(0,Math.min(this.items.length-1,t)),this._isFocusable(this._activeItemIndex)||(this._activeItemIndex=this._firstFocusableIndex),this._applyActive(e)):this._activeItemIndex=-1}updateListItems(){this._recomputeFocusableIndexes(),(this._activeItemIndex>=this.items.length||!this._hasFocusableItem||this._activeItemIndex<0)&&(this._activeItemIndex=this._firstFocusableIndex),this._applyActive(!1)}_recomputeFocusableIndexes(){let t=-1,e=-1;for(let i=0;i<this.items.length;i++)this._isFocusable(i)&&(-1===t&&(t=i),e=i);this._firstFocusableIndex=t,this._lastFocusableIndex=e,this._hasFocusableItem=-1!==t}render(){return(0,a.qy)(d||(d=u`<div part="base" class="base"> <slot></slot> </div>`))}_isFocusable(t){const e=this.items[t];return!!e&&e.interactive&&!e.disabled}_applyActive(t){var e;(this.items.forEach((t,e)=>{t.interactive&&!t.disabled?t.tabIndex=e===this._activeItemIndex?0:-1:t.removeAttribute("tabindex")}),t&&this._activeItemIndex>=0)&&(null===(e=this.items[this._activeItemIndex])||void 0===e||e.focus())}_moveFocus(t,e){!this._hasFocusableItem||e<0||e===this._activeItemIndex||(t.preventDefault(),this._activeItemIndex=e,this._applyActive(!0))}_stepIndex(t,e){const i=this.items.length;if(!i||!this._hasFocusableItem)return t;let s=t;for(let a=0;a<i;a++){if(s+=e,s<0||s>=i){if(!this.wrapFocus)return t;s=(s+i)%i}if(this._isFocusable(s))return s}return t}constructor(...t){super(...t),this.wrapFocus=!1,this.ariaLabel=null,this.items=[],this.hostRole="list",this._activeItemIndex=-1,this._firstFocusableIndex=-1,this._lastFocusableIndex=-1,this._hasFocusableItem=!1,this._onItemRegister=t=>{t.stopPropagation();const e=t.detail.item;if(this.items.includes(e))return;const i=[...this.items,e];i.sort(l),this.items=i,this.updateListItems()},this._onItemUnregister=t=>{t.stopPropagation();const e=t.detail.item;this.items.includes(e)&&(this.items=this.items.filter(t=>t!==e),this.updateListItems())},this._onFocusIn=t=>{const e=t.composedPath();for(let i=0;i<this.items.length;i++)if(e.includes(this.items[i]))return void(i!==this._activeItemIndex&&(this._activeItemIndex=i,this._applyActive(!1)))},this._onForward=t=>{this._moveFocus(t,this._stepIndex(this._activeItemIndex,1))},this._onBack=t=>{this._moveFocus(t,this._stepIndex(this._activeItemIndex,-1))},this._onHome=t=>{this._moveFocus(t,this._firstFocusableIndex)},this._onEnd=t=>{this._moveFocus(t,this._lastFocusableIndex)},this._onActivate=t=>{if(!this._isFocusable(this._activeItemIndex))return;t.preventDefault();const e=this.items[this._activeItemIndex];e.activate(),(0,c.r)(this,"ha-list-activated",{index:this._activeItemIndex,item:e})}}}p.styles=(0,a.AH)(h||(h=u`:host{display:block}.base{display:flex;flex-direction:column;gap:var(--ha-list-gap,0);padding:var(--ha-list-padding,0);margin:0;list-style:none}`)),(0,s.Cg)([(0,n.MZ)({type:Boolean,attribute:"wrap-focus"})],p.prototype,"wrapFocus",void 0),(0,s.Cg)([(0,n.MZ)({type:String,attribute:"aria-label",reflect:!0})],p.prototype,"ariaLabel",void 0),p=(0,s.Cg)([(0,n.EM)("ha-list-base")],p)},16386:function(t,e,i){i.a(t,async function(t,e){try{var s=i(40445),a=i(65686),n=i(5124),o=i(67576),r=t([a]);a=(r.then?(await r)():r)[0];let l,c=t=>t;class d extends a.A{updated(t){if(super.updated(t),t.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")}}static get styles(){return[a.A.styles,(0,n.AH)(l||(l=c`: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)}`))]}}(0,s.Cg)([(0,o.MZ)()],d.prototype,"size",void 0),d=(0,s.Cg)([(0,o.EM)("ha-progress-ring")],d),e()}catch(l){e(l)}})},64013:function(t,e,i){var s=i(40445),a=i(97086),n=i(5124),o=i(67576);let r,l=t=>t;class c extends a.A{static get styles(){return[a.A.styles,(0,n.AH)(r||(r=l`:host{--wa-form-control-required-content:var(
--ha-radio-group-required-marker,
var(--ha-input-required-marker, "*")
);--wa-form-control-required-content-offset:var(
--ha-radio-group-required-marker-offset,
0.1rem
)}`))]}constructor(){super(),this.radioTag="ha-radio-option"}}c=(0,s.Cg)([(0,o.EM)("ha-radio-group")],c)},92677:function(t,e,i){var s=i(40445),a=i(17010),n=i(5124),o=i(67576);let r,l=t=>t;class c extends a.A{static get styles(){return[a.A.styles,(0,n.AH)(r||(r=l`:host{--wa-form-control-activated-color:var(
--ha-radio-option-active-color,
var(--ha-color-fill-primary-loud-resting)
);--wa-form-control-height:var(--ha-radio-option-height, 40px);--wa-form-control-toggle-size:var(
--ha-radio-option-toggle-size,
20px
);--wa-form-control-border-width:var(
--ha-radio-option-border-width,
var(--ha-border-width-md)
);--wa-form-control-border-color:var(
--ha-radio-option-border-color,
var(--ha-color-border-neutral-normal)
);--wa-form-control-background-color:var(
--ha-radio-option-background-color,
var(--wa-form-control-background-color)
);--checked-icon-color:var(
--ha-radio-option-checked-icon-color,
var(--wa-form-control-activated-color)
);--checked-icon-scale:var(--ha-radio-option-checked-icon-scale, 0.7)}:host([appearance=default]) .control{margin:var(--ha-radio-option-control-margin,var(--ha-space-3) var(--ha-space-2) var(--ha-space-3) var(--ha-space-3))}:host(:not([aria-checked=true],[aria-disabled=true]):hover) .control{border-color:var(--ha-radio-option-border-color-hover,var(--ha-radio-option-border-color,var(--ha-color-border-neutral-loud)));background-color:var(--ha-radio-option-background-color-hover,var(--ha-color-fill-neutral-quiet-hover))}:host([aria-checked=true]) .control{background-color:var(--ha-radio-option-checked-background-color,var(--ha-color-fill-primary-normal-resting));color:var(--checked-icon-color);border-color:var(--checked-icon-color)}[part~=label]{display:inline-flex;align-items:center;cursor:pointer}:host([disabled]) [part~=label]{cursor:not-allowed}`))]}}c=(0,s.Cg)([(0,o.EM)("ha-radio-option")],c)},61037:function(t,e,i){var s=i(40445),a=i(67576),n=i(5124),o=i(14503),r=i(14782),l=i(44144);let c,d,h=t=>t;class u extends n.WF{render(){var t;return(0,n.qy)(c||(c=h` <img class="logo" alt="${0}" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer"> `),r.aK[this.voiceAssistantId].name,(0,l.MR)({domain:r.aK[this.voiceAssistantId].domain,type:"icon",darkOptimized:null===(t=this.hass.themes)||void 0===t?void 0:t.darkMode},this.hass.auth.data.hassUrl))}static get styles(){return[o.RF,(0,n.AH)(d||(d=h`:host{display:inline}.logo{position:relative;vertical-align:middle;height:24px}`))]}}(0,s.Cg)([(0,a.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,s.Cg)([(0,a.MZ)({attribute:!1})],u.prototype,"voiceAssistantId",void 0),u=(0,s.Cg)([(0,a.EM)("voice-assistant-brand-icon")],u)},49852:function(t,e,i){i.d(e,{P:function(){return c},j:function(){return l}});i(74423),i(18111),i(81148),i(22489),i(61701),i(13579);var s=i(65522),a=i(71727),n=i(55931),o=i(66033),r=i(58594);const l=(t,e,i,l,c,d,h,u,p,g,v,_="")=>{let f,m,y={};const b=Object.values(t),w=Object.values(i),C=Object.values(l);(d||h||u||p||g)&&(y=(0,r.g2)(C),f=w,m=C.filter(t=>t.area_id),d&&(f=f.filter(t=>{const e=y[t.id];return!(!e||!e.length)&&y[t.id].some(t=>d.includes((0,a.m)(t.entity_id)))}),m=m.filter(t=>d.includes((0,a.m)(t.entity_id)))),h&&(f=f.filter(t=>{const e=y[t.id];return!e||!e.length||C.every(t=>!h.includes((0,a.m)(t.entity_id)))}),m=m.filter(t=>!h.includes((0,a.m)(t.entity_id)))),u&&(f=f.filter(t=>{const e=y[t.id];return!(!e||!e.length)&&y[t.id].some(t=>{const e=c[t.entity_id];return!!e&&(e.attributes.device_class&&u.includes(e.attributes.device_class))})}),m=m.filter(t=>{const e=c[t.entity_id];return e.attributes.device_class&&u.includes(e.attributes.device_class)})),p&&(f=f.filter(t=>p(t))),g&&(f=f.filter(t=>{const e=y[t.id];return!(!e||!e.length)&&y[t.id].some(t=>{const e=c[t.entity_id];return!!e&&g(e)})}),m=m.filter(t=>{const e=c[t.entity_id];return!!e&&g(e)})));let $,x=b;f&&($=f.filter(t=>t.area_id).map(t=>t.area_id)),m&&($=(null!=$?$:[]).concat(m.filter(t=>t.area_id).map(t=>t.area_id))),$&&(x=x.filter(t=>$.includes(t.area_id))),v&&(x=x.filter(t=>!v.includes(t.area_id)));return x.map(t=>{const{floor:i}=(0,o.L)(t,e),a=i?(0,n.X)(i):void 0,r=(0,s.A)(t);return{id:`${_}${t.area_id}`,primary:r||t.area_id,secondary:a,icon:t.icon||void 0,icon_path:t.icon?void 0:"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",search_labels:{areaId:t.area_id,aliases:t.aliases.join(" ")}}})},c=[{name:"primary",weight:10},{name:"search_labels.aliases",weight:8},{name:"secondary",weight:6},{name:"search_labels.domain",weight:4},{name:"search_labels.areaId",weight:2}]},69150:function(t,e,i){i.d(e,{$$:function(){return v},AH:function(){return a},NH:function(){return u},QC:function(){return s},Uc:function(){return o},Zr:function(){return p},ds:function(){return g},hJ:function(){return r},mp:function(){return c},nx:function(){return l},u6:function(){return d},vU:function(){return n},zn:function(){return h}});i(62953);const s=(t,e,i)=>"run-start"===e.type?t={init_options:i,stage:"ready",run:e.data,events:[e],started:new Date(e.timestamp)}:t?((t="wake_word-start"===e.type?Object.assign(Object.assign({},t),{},{stage:"wake_word",wake_word:Object.assign(Object.assign({},e.data),{},{done:!1})}):"wake_word-end"===e.type?Object.assign(Object.assign({},t),{},{wake_word:Object.assign(Object.assign(Object.assign({},t.wake_word),e.data),{},{done:!0})}):"stt-start"===e.type?Object.assign(Object.assign({},t),{},{stage:"stt",stt:Object.assign(Object.assign({},e.data),{},{done:!1})}):"stt-end"===e.type?Object.assign(Object.assign({},t),{},{stt:Object.assign(Object.assign(Object.assign({},t.stt),e.data),{},{done:!0})}):"intent-start"===e.type?Object.assign(Object.assign({},t),{},{stage:"intent",intent:Object.assign(Object.assign({},e.data),{},{done:!1})}):"intent-end"===e.type?Object.assign(Object.assign({},t),{},{intent:Object.assign(Object.assign(Object.assign({},t.intent),e.data),{},{done:!0})}):"tts-start"===e.type?Object.assign(Object.assign({},t),{},{stage:"tts",tts:Object.assign(Object.assign({},e.data),{},{done:!1})}):"tts-end"===e.type?Object.assign(Object.assign({},t),{},{tts:Object.assign(Object.assign(Object.assign({},t.tts),e.data),{},{done:!0})}):"run-end"===e.type?Object.assign(Object.assign({},t),{},{finished:new Date(e.timestamp),stage:"done"}):"error"===e.type?Object.assign(Object.assign({},t),{},{finished:new Date(e.timestamp),stage:"error",error:e.data}):Object.assign({},t)).events=[...t.events,e],t):void console.warn("Received unexpected event before receiving session",e),a=(t,e,i)=>{let a;const o=n(t,t=>{a=s(a,t,i),"run-end"!==t.type&&"error"!==t.type||o.then(t=>t()),a&&e(a)},i);return o},n=(t,e,i)=>t.connection.subscribeMessage(e,Object.assign(Object.assign({},i),{},{type:"assist_pipeline/run"})),o=(t,e)=>t.callWS({type:"assist_pipeline/pipeline_debug/list",pipeline_id:e}),r=(t,e,i)=>t.callWS({type:"assist_pipeline/pipeline_debug/get",pipeline_id:e,pipeline_run_id:i}),l=t=>t.callWS({type:"assist_pipeline/pipeline/list"}),c=(t,e)=>t.callWS({type:"assist_pipeline/pipeline/get",pipeline_id:e}),d=(t,e)=>t.callWS(Object.assign({type:"assist_pipeline/pipeline/create"},e)),h=(t,e,i)=>t.callWS(Object.assign({type:"assist_pipeline/pipeline/update",pipeline_id:e},i)),u=(t,e)=>t.callWS({type:"assist_pipeline/pipeline/set_preferred",pipeline_id:e}),p=(t,e)=>t.callWS({type:"assist_pipeline/pipeline/delete",pipeline_id:e}),g=t=>t.callWS({type:"assist_pipeline/language/list"}),v=t=>t.callWS({type:"assist_pipeline/device/list"})},71117:function(t,e,i){i.d(e,{Gu:function(){return o},Pd:function(){return v},Sb:function(){return f},Up:function(){return _},Ut:function(){return r},cn:function(){return p},dq:function(){return h},eN:function(){return d},p1:function(){return m},p7:function(){return n},q3:function(){return c},qF:function(){return y},ql:function(){return g},vO:function(){return l},yG:function(){return u}});var s=i(86518);const a=["hass"],n=t=>{let{hass:e}=t,i=(0,s.A)(t,a);return e.callApi("POST","cloud/login",i)},o=t=>t.callApi("POST","cloud/logout"),r=(t,e)=>t.callApi("POST","cloud/forgot_password",{email:e}),l=(t,e,i)=>t.callApi("POST","cloud/register",{email:e,password:i}),c=(t,e)=>t.callApi("POST","cloud/resend_confirm",{email:e}),d=t=>t.callWS({type:"cloud/status"}),h=(t,e)=>t.callWS({type:"cloud/cloudhook/create",webhook_id:e}),u=(t,e)=>t.callWS({type:"cloud/cloudhook/delete",webhook_id:e}),p=t=>t.callWS({type:"cloud/remote/connect"}),g=t=>t.callWS({type:"cloud/remote/disconnect"}),v=t=>t.callWS({type:"cloud/subscription"}),_=(t,e)=>t.callWS(Object.assign({type:"cloud/update_prefs"},e)),f=t=>t.callWS({type:"cloud/remove_data"}),m=(t,e,i)=>t.callWS({type:"cloud/google_assistant/entities/update",entity_id:e,disable_2fa:i}),y=t=>t.callApi("GET","cloud/support_package")},87225:function(t,e,i){i.d(e,{GS:function(){return n},I8:function(){return r},YQ:function(){return h},bn:function(){return c},fg:function(){return l},oW:function(){return o},ob:function(){return d}});i(74423);var s=i(71727),a=i(68246);const n=[{groups:{dynamicGroups:{},time_location:{icon:"M15,12H16.5V16.25L19.36,17.94L18.61,19.16L15,17V12M23,16A7,7 0 0,1 16,23C13,23 10.4,21.08 9.42,18.4L8,17.9L2.66,19.97L2.5,20A0.5,0.5 0 0,1 2,19.5V4.38C2,4.15 2.15,3.97 2.36,3.9L8,2L14,4.1L19.34,2H19.5A0.5,0.5 0 0,1 20,2.5V10.25C21.81,11.5 23,13.62 23,16M9,16C9,12.83 11.11,10.15 14,9.29V6.11L8,4V15.89L9,16.24C9,16.16 9,16.08 9,16M16,11A5,5 0 0,0 11,16A5,5 0 0,0 16,21A5,5 0 0,0 21,16A5,5 0 0,0 16,11Z",members:{sun:{},time:{},zone:{}}},helpers:{},template:{},trigger:{},other:{}}},{titleKey:"ui.panel.config.automation.editor.conditions.groups.generic.label",generic:!0,groups:{device:{},entity:{icon:"M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z",members:{state:{},numeric_state:{}}}}},{titleKey:"ui.panel.config.automation.editor.conditions.groups.custom_integrations.label",groups:{customDynamicGroups:{}}}],o={and:{},or:{},not:{}},r=["and","or","not"],l=["ha-automation-condition-and","ha-automation-condition-not","ha-automation-condition-or"],c=(t,e)=>t.connection.subscribeMessage(e,{type:"condition_platforms/subscribe"}),d=t=>t.includes(".")?(0,s.m)(t):t,h=t=>t.includes(".")?(0,a.Y)(t):"_"},88433:function(t,e,i){if(i.d(e,{RW:function(){return o},ZE:function(){return a},e1:function(){return r},vc:function(){return n}}),66649!=i.j)var s=i(44537);var a=function(t){return t[t.CONTROL=1]="CONTROL",t}({});const n=(t,e,i)=>t.callWS({type:"conversation/agent/list",language:e,country:i}),o=(t,e,i,a)=>t.callWS({type:"conversation/agent/homeassistant/debug",sentences:(0,s.e)(e),language:i,device_id:a}),r=(t,e,i)=>t.callWS({type:"conversation/agent/homeassistant/language_scores",language:e,country:i})},14782:function(t,e,i){i.d(e,{Gw:function(){return o},Ow:function(){return l},YH:function(){return n},aK:function(){return a},hB:function(){return c},ij:function(){return r}});i(18111),i(22489);var s=i(59241);const a={conversation:{domain:"assist_pipeline",name:"Assist"},"cloud.alexa":{domain:"alexa",name:"Amazon Alexa"},"cloud.google_assistant":{domain:"google_assistant",name:"Google Assistant"}},n=(t,e,i)=>t.callWS({type:"homeassistant/expose_new_entities/set",assistant:e,expose_new:i}),o=(t,e)=>t.callWS({type:"homeassistant/expose_new_entities/get",assistant:e}),r=(t,e,i,s)=>t.callWS({type:"homeassistant/expose_entity",assistants:e,entity_ids:i,should_expose:s}),l=t=>t.callWS({type:"homeassistant/expose_entity/list"}),c=(t,e)=>{const i=(0,s.Ox)(t)[e];return Object.keys(a).filter(t=>{var e;return null==i||null===(e=i.options)||void 0===e||null===(e=e[t])||void 0===e?void 0:e.should_expose})}},48250:function(t,e,i){i.d(e,{Bp:function(){return a},aI:function(){return s},gg:function(){return l},oT:function(){return n},wE:function(){return o},x0:function(){return r}});i(3362);const s=async(t,e)=>(await t.sendMessagePromise({type:"frontend/get_user_data",key:e})).value,a=async(t,e,i)=>t.sendMessagePromise({type:"frontend/set_user_data",key:e,value:i}),n=(t,e,i)=>t.subscribeMessage(i,{type:"frontend/subscribe_user_data",key:e}),o=async(t,e)=>(await t.sendMessagePromise({type:"frontend/get_system_data",key:e})).value,r=async(t,e,i)=>t.sendMessagePromise({type:"frontend/set_system_data",key:e,value:i}),l=(t,e,i)=>t.subscribeMessage(i,{type:"frontend/subscribe_system_data",key:e})},68287:function(t,e,i){i.d(e,{z:function(){return a}});i(18111),i(61701),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var s=i(71727);const a=t=>{const e=t.attributes.entity_id||[],i=[...new Set(e.map(t=>(0,s.m)(t)))];return 1===i.length?i[0]:void 0}},88360:function(t,e,i){i.d(e,{j:function(){return a}});var s=i(1087);const a=(t,e)=>{(0,s.r)(t,"haptic",e)}},22130:function(t,e,i){i.r(e),i.d(e,{fetchAddonInfo:function(){return b},fetchHassioAddonChangelog:function(){return l},fetchHassioAddonDocumentation:function(){return d},fetchHassioAddonInfo:function(){return r},fetchHassioAddonLogs:function(){return c},fetchHassioAddonsInfo:function(){return o},installHassioAddon:function(){return _},rebuildLocalAddon:function(){return w},reloadHassioAddons:function(){return n},restartHassioAddon:function(){return m},setHassioAddonOption:function(){return h},setHassioAddonSecurity:function(){return v},startHassioAddon:function(){return p},stopHassioAddon:function(){return g},uninstallHassioAddon:function(){return y},updateHassioAddon:function(){return f},validateHassioAddonOption:function(){return u}});i(16280),i(18111),i(20116),i(3362);var s=i(35541),a=i(47351);const n=async t=>{await t.callWS({type:"supervisor/api",endpoint:"/addons/reload",method:"post"})},o=async t=>t.callWS({type:"supervisor/api",endpoint:"/addons",method:"get"}),r=async(t,e)=>t({type:"supervisor/api",endpoint:`/addons/${e}/info`,method:"get"}),l=async(t,e)=>t.callApi("GET",`hassio/addons/${e}/changelog`),c=async(t,e)=>t.callApi("GET",`hassio/addons/${e}/logs`),d=async(t,e)=>t.callApi("GET",`hassio/addons/${e}/documentation`),h=async(t,e,i)=>{const s=await t({type:"supervisor/api",endpoint:`/addons/${e}/options`,method:"post",data:i});if("error"===s.result)throw Error((0,a.VR)(s));return s},u=async(t,e,i)=>t({type:"supervisor/api",endpoint:`/addons/${e}/options/validate`,method:"post",data:i}),p=async(t,e)=>t({type:"supervisor/api",endpoint:`/addons/${e}/start`,method:"post",timeout:null}),g=async(t,e)=>t({type:"supervisor/api",endpoint:`/addons/${e}/stop`,method:"post",timeout:null}),v=async(t,e,i)=>{await t({type:"supervisor/api",endpoint:`/addons/${e}/security`,method:"post",data:i})},_=async(t,e)=>{await t({type:"supervisor/api",endpoint:`/addons/${e}/install`,method:"post",timeout:null})},f=async(t,e,i)=>{await t.callWS({type:"hassio/update/addon",addon:e,backup:i})},m=async(t,e)=>{await t({type:"supervisor/api",endpoint:`/addons/${e}/restart`,method:"post",timeout:null})},y=async(t,e,i)=>{await t({type:"supervisor/api",endpoint:`/addons/${e}/uninstall`,method:"post",timeout:null,data:{remove_config:i}})},b=(t,e,i)=>{var a;return(0,s.X)(t,null!==(a=e.addon)&&void 0!==a&&a.addons.find(t=>t.slug===i)?`/addons/${i}/info`:`/store/addons/${i}`)},w=async(t,e)=>t({type:"supervisor/api",endpoint:`/addons/${e}/rebuild`,method:"post",timeout:null})},47351:function(t,e,i){i.d(e,{PS:function(){return s},Tv:function(){return o},VR:function(){return a},lE:function(){return r}});i(74423),i(3362),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);const s=t=>t.data,a=t=>"object"==typeof t?"object"==typeof t.body?t.body.message||"Unknown error, see supervisor logs":t.body||t.message||"Unknown error, see supervisor logs":t,n=new Set([502,503,504]),o=t=>!!(t&&t.status_code&&n.has(t.status_code))||!(!t||!t.message||!t.message.includes("ERR_CONNECTION_CLOSED")&&!t.message.includes("ERR_CONNECTION_RESET")),r=async(t,e)=>t({type:"supervisor/api",endpoint:`/${e}/stats`,method:"get"})},97078:function(t,e,i){i.d(e,{w:function(){return s}});const s=(t,e,i)=>t.callService("select","select_option",{option:i},{entity_id:e})},99037:function(t,e,i){i.d(e,{T:function(){return s}});const s=(t,e,i)=>t.callWS({type:"stt/engine/list",language:e,country:i})},35541:function(t,e,i){i.d(e,{X:function(){return n}});i(3362);var s=i(62384),a=i(47351);const n=async(t,e,i)=>{var n;return(0,s.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:e,method:(null==i?void 0:i.method)||"get",timeout:null!==(n=null==i?void 0:i.timeout)&&void 0!==n?n:null,data:null==i?void 0:i.data}):(0,a.PS)(await t.callApi((i.method||"get").toUpperCase(),`hassio${e}`,null==i?void 0:i.data))}},46927:function(t,e,i){i.d(e,{$W:function(){return d},Hg:function(){return n},Wj:function(){return o},Yk:function(){return h},jG:function(){return a},mo:function(){return c},ow:function(){return r},zt:function(){return l}});i(3362);var s=i(48250),a=function(t){return t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.quote_decimal="quote_decimal",t.space_comma="space_comma",t.none="none",t}({}),n=function(t){return t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24",t}({}),o=function(t){return t.local="local",t.server="server",t}({}),r=function(t){return t.language="language",t.system="system",t.DMY="DMY",t.MDY="MDY",t.YMD="YMD",t}({}),l=function(t){return t.language="language",t.monday="monday",t.tuesday="tuesday",t.wednesday="wednesday",t.thursday="thursday",t.friday="friday",t.saturday="saturday",t.sunday="sunday",t}({});const c=(t,e)=>(0,s.oT)(t.connection,"language",e),d=(t,e)=>(0,s.Bp)(t.connection,"language",e),h=async(t,e,i,s,a)=>(await t.callWS({type:"frontend/get_translations",language:e,category:i,integration:s,config_flow:a})).resources},52069:function(t,e,i){i.d(e,{EF:function(){return o},S_:function(){return s},Xv:function(){return r},ni:function(){return n},u1:function(){return l},z3:function(){return c}});const s=(t,e)=>t.callApi("POST","tts_get_url",e),a="media-source://tts/",n=t=>t.startsWith(a),o=t=>t.substring(19),r=(t,e,i)=>t.callWS({type:"tts/engine/list",language:e,country:i}),l=(t,e)=>t.callWS({type:"tts/engine/get",engine_id:e}),c=(t,e,i)=>t.callWS({type:"tts/engine/voices",engine_id:e,language:i})},8164:function(t,e,i){i.d(e,{d:function(){return s}});const s=t=>t.callWS({type:"wyoming/info"})},37046:function(t,e,i){i.a(t,async function(t,e){try{var s=i(40445),a=i(5124),n=i(67576),o=i(1087),r=i(18350),l=(i(67094),i(69075)),c=(i(61037),t([r]));r=(c.then?(await c)():c)[0];let d,h,u=t=>t;const p="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",g="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",v="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";class _ extends a.WF{render(){var t;return(0,a.qy)(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"> <voice-assistant-brand-icon .voiceAssistantId="${0}" .hass="${0}"> </voice-assistant-brand-icon> <voice-assistant-brand-icon .voiceAssistantId="${0}" .hass="${0}"> </voice-assistant-brand-icon> </div> <h2> ${0} </h2> <p> ${0} </p> </div> </div> </div> <div class="footer side-by-side"> <ha-button href="https://www.nabucasa.com" target="_blank" rel="noreferrer noopener" appearance="plain"> <ha-svg-icon .path="${0}" slot="start"></ha-svg-icon> nabucasa.com </ha-button> <ha-button @click="${0}">${0}</ha-button> </div>`),`/static/images/logo_nabu_casa${null!==(t=this.hass.themes)&&void 0!==t&&t.darkMode?"_dark":""}.png`,this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.cloud.title"),g,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"),p,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"),"cloud.google_assistant",this.hass,"cloud.alexa",this.hass,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"),v,this._signUp,this.hass.localize("ui.panel.config.cloud.register.headline"))}_signUp(){(0,o.r)(this,"cloud-step",{step:"SIGNUP"})}}_.styles=[l.s,(0,a.AH)(h||(h=u`:host{display:flex}.features{display:flex;flex-direction:column;grid-gap:var(--ha-space-4);padding:16px}.feature{display:flex;flex-direction:column;align-items:center;text-align:center;margin-bottom:16px}.feature .logos{margin-bottom:16px;display:flex;gap:var(--ha-space-4)}.feature .logos>*{width:40px;height:40px}.round-icon{border-radius:var(--ha-border-radius-circle);color:#6e41ab;background-color:#e8dcf7;display:flex;align-items:center;justify-content:center;font-size:var(--ha-font-size-2xl)}.access .round-icon{color:#00aef8;background-color:#cceffe}.feature h2{font-size:var(--ha-font-size-l);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-normal);margin-top:0;margin-bottom:8px}.feature p{font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed);margin:0}`))],(0,s.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"hass",void 0),_=(0,s.Cg)([(0,n.EM)("cloud-step-intro")],_),e()}catch(d){e(d)}})},87019:function(t,e,i){i.a(t,async function(t,e){try{i(69112),i(3362),i(42762),i(62953);var s=i(40445),a=i(5124),n=i(67576),o=i(1087),r=i(91926),l=i(38962),c=i(18350),d=(i(67094),i(91485)),h=i(71117),u=i(68893),p=i(65063),g=i(69075),v=t([l,c,d]);[l,c,d]=v.then?(await v)():v;let _,f,m,y=t=>t;class b extends a.WF{render(){var t;return(0,a.qy)(_||(_=y`<div class="content"> <img src="${0}" alt="Nabu Casa logo"> <h1>${0}</h1> ${0} <ha-input autofocus id="email" name="email" .label="${0}" .disabled="${0}" type="email" autocomplete="email" required @keydown="${0}" .validationMessage="${0}"></ha-input> <ha-input id="password" type="password" password-toggle name="password" .label="${0}" .disabled="${0}" autocomplete="new-password" minlength="8" required @keydown="${0}" .validationMessage="${0}"></ha-input> </div> <div class="footer"> <ha-button @click="${0}" .disabled="${0}">${0}</ha-button> </div>`),`/static/images/logo_nabu_casa${null!==(t=this.hass.themes)&&void 0!==t&&t.darkMode?"_dark":""}.png`,this.hass.localize("ui.panel.config.cloud.login.sign_in"),this._error?(0,a.qy)(f||(f=y`<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"))}_keyDown(t){"Enter"===t.key&&this._handleLogin()}async _handleLogin(){const t=this._emailField,e=this._passwordField,i=t.value,s=e.value;if(!t.reportValidity())return e.reportValidity(),void t.focus();if(!e.reportValidity())return void e.focus();this._requestInProgress=!0;const a=async(e,i)=>{try{await(0,h.p7)(Object.assign(Object.assign({hass:this.hass,email:e},i?{code:i}:{password:s}),{},{check_connection:this._checkConnection}))}catch(n){const i=n&&n.body&&n.body.code;if("mfarequired"===i){const t=await(0,p.an)(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!==t&&""!==t)return void(await a(e,t.trim()))}if("alreadyconnectederror"===i)return void(0,u.o)(this,{details:JSON.parse(n.body.message),logInHereAction:()=>{this._checkConnection=!1,a(e)},closeDialog:()=>{this._requestInProgress=!1}});if("usernotfound"===i&&e!==e.toLowerCase())return void(await a(e.toLowerCase()));if("PasswordChangeRequired"===i)return(0,p.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.cloud.login.alert_password_change_required")}),(0,r.oo)("/config/cloud/forgot-password"),void(0,o.r)(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"}t.focus()}};await a(i)}constructor(...t){super(...t),this._requestInProgress=!1,this._checkConnection=!0}}b.styles=[g.s,(0,a.AH)(m||(m=y`:host{display:block}`))],(0,s.Cg)([(0,n.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_requestInProgress",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_error",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_checkConnection",void 0),(0,s.Cg)([(0,n.P)("#email",!0)],b.prototype,"_emailField",void 0),(0,s.Cg)([(0,n.P)("#password",!0)],b.prototype,"_passwordField",void 0),b=(0,s.Cg)([(0,n.EM)("cloud-step-signin")],b),e()}catch(_){e(_)}})},47594:function(t,e,i){i.a(t,async function(t,e){try{i(3362),i(62953);var s=i(40445),a=i(5124),n=i(67576),o=i(1087),r=i(38962),l=i(18350),c=(i(67094),i(91485)),d=i(71117),h=i(69075),u=t([r,l,c]);[r,l,c]=u.then?(await u)():u;let p,g,v,_,f,m,y,b=t=>t;class w extends a.WF{render(){var t;return(0,a.qy)(p||(p=b`<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!==(t=this.hass.themes)&&void 0!==t&&t.darkMode?"_dark":""}.png`,this.hass.localize("ui.panel.config.cloud.register.create_account"),this._error?(0,a.qy)(g||(g=b`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):"","VERIFY"===this._state?(0,a.qy)(v||(v=b`<p> ${0} </p>`),this.hass.localize("ui.panel.config.cloud.register.confirm_email",{email:this._email})):(0,a.qy)(_||(_=b`<ha-input autofocus id="email" name="email" .label="${0}" .disabled="${0}" type="email" autocomplete="email" required @keydown="${0}" .validationMessage="${0}"></ha-input> <ha-input id="password" type="password" password-toggle name="password" .label="${0}" .disabled="${0}" autocomplete="new-password" minlength="8" required @keydown="${0}" .validationMessage="${0}"></ha-input>`),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,a.qy)(f||(f=b`<ha-button @click="${0}" .disabled="${0}" appearance="plain">${0}</ha-button><ha-button @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,a.qy)(m||(m=b`<ha-button @click="${0}" .disabled="${0}" appearance="plain">${0}</ha-button> <ha-button @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")))}_signIn(){(0,o.r)(this,"cloud-step",{step:"SIGNIN"})}_keyDown(t){"Enter"===t.key&&this._handleRegister()}async _handleRegister(){const t=this._emailField,e=this._passwordField;let i=!1;if(t.reportValidity()||(i=!0,t.focus()),e.reportValidity()||(i||e.focus(),i=!0),i)return;const s=t.value.toLowerCase(),a=e.value;this._requestInProgress=!0;try{await(0,d.vO)(this.hass,s,a),this._email=s,this._password=a,this._verificationEmailSent()}catch(n){this._password="",this._error=n&&n.body&&n.body.message?n.body.message:"Unknown error"}finally{this._requestInProgress=!1}}async _handleResendVerifyEmail(){if(this._email)try{await(0,d.q3)(this.hass,this._email),this._verificationEmailSent()}catch(t){this._error=t&&t.body&&t.body.message?t.body.message:"Unknown error"}}_verificationEmailSent(){this._state="VERIFY",setTimeout(()=>this._login(),5e3)}async _login(){if(this._email&&this._password)try{await(0,d.p7)({hass:this.hass,email:this._email,password:this._password}),(0,o.r)(this,"cloud-step",{step:"DONE"})}catch(e){var t;"usernotconfirmed"===(null==e||null===(t=e.body)||void 0===t?void 0:t.code)?this._verificationEmailSent():this._error="Something went wrong. Please try again."}}constructor(...t){super(...t),this._requestInProgress=!1}}w.styles=[h.s,(0,a.AH)(y||(y=b`.content{width:100%}`))],(0,s.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,s.Cg)([(0,n.wk)()],w.prototype,"_requestInProgress",void 0),(0,s.Cg)([(0,n.wk)()],w.prototype,"_email",void 0),(0,s.Cg)([(0,n.wk)()],w.prototype,"_password",void 0),(0,s.Cg)([(0,n.wk)()],w.prototype,"_error",void 0),(0,s.Cg)([(0,n.wk)()],w.prototype,"_state",void 0),(0,s.Cg)([(0,n.P)("#email",!0)],w.prototype,"_emailField",void 0),(0,s.Cg)([(0,n.P)("#password",!0)],w.prototype,"_passwordField",void 0),w=(0,s.Cg)([(0,n.EM)("cloud-step-signup")],w),e()}catch(p){e(p)}})},69075:function(t,e,i){i.d(e,{s:function(){return n}});var s=i(5124);let a;const n=[i(14503).RF,(0,s.AH)(a||(a=(t=>t)`: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}`))]},85027:function(t,e,i){i.a(t,async function(t,s){try{i.r(e),i.d(e,{HaVoiceAssistantSetupDialog:function(){return Y},STEP:function(){return z}});i(74423),i(44114),i(18111),i(22489),i(20116),i(61701),i(3362),i(62953);var a=i(40445),n=i(5124),o=i(67576),r=i(22786),l=i(1087),c=i(71727),d=i(86198),h=(i(34296),i(72554)),u=i(29823),p=(i(70947),i(14927)),g=i(62351),v=i(88433),_=i(22675),f=i(14503),m=i(83051),y=i(56396),b=i(11944),w=i(35613),C=i(63095),$=i(37184),x=i(16923),k=i(16487),A=i(62187),S=t([h,u,m,y,b,w,C,$,x,k,A,d,p]);[h,u,m,y,b,w,C,$,x,k,A,d,p]=S.then?(await S)():S;let I,E,M,L,O,P,q,H,N,T,Z,W,j,F,V,D,R,U,B=t=>t;const G="M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z",K="M7,10L12,15L17,10H7Z";var z=function(t){return t[t.INIT=0]="INIT",t[t.UPDATE=1]="UPDATE",t[t.CHECK=2]="CHECK",t[t.WAKEWORD=3]="WAKEWORD",t[t.AREA=4]="AREA",t[t.PIPELINE=5]="PIPELINE",t[t.SUCCESS=6]="SUCCESS",t[t.CLOUD=7]="CLOUD",t[t.LOCAL=8]="LOCAL",t[t.CHANGE_WAKEWORD=9]="CHANGE_WAKEWORD",t}({});class Y extends n.WF{async showDialog(t){this._params=t,this._open=!0,await this._fetchAssistConfiguration(),this._step=1}closeDialog(){this._open=!1}willUpdate(t){t.has("_step")&&5===this._step&&this._getLanguages()}_dialogClosed(){this._open=!1,this._params=void 0,this._assistConfiguration=void 0,this._previousSteps=[],this._nextStep=void 0,this._step=0,this._language=void 0,this._languages=[],this._localOption=void 0,(0,l.r)(this,"dialog-closed",{dialog:this.localName})}render(){var t;if(!this._params)return n.s6;const e=this._findDomainEntityId(this._params.deviceId,this.hass.entities,"assist_satellite"),i=e?this.hass.states[e]:void 0,s=8===this._step||1===this._step&&!this._previousSteps.length;return(0,n.qy)(I||(I=B` <ha-dialog .open="${0}" header-title="Voice Satellite setup" prevent-scrim-close @closed="${0}"> ${0} ${0} <div class="content" @next-step="${0}" @prev-step="${0}"> ${0} </div> </ha-dialog> `),this._open,this._dialogClosed,s?(0,n.qy)(E||(E=B`<span slot="headerNavigationIcon"></span>`)):this._previousSteps.length?(0,n.qy)(M||(M=B`<ha-icon-button slot="headerNavigationIcon" .label="${0}" .path="${0}" @click="${0}"></ha-icon-button>`),null!==(t=this.hass.localize("ui.common.back"))&&void 0!==t?t:"Back",G,this._goToPreviousStep):n.s6,3===this._step||4===this._step?(0,n.qy)(L||(L=B`<ha-button @click="${0}" class="skip-btn" slot="headerActionItems">${0}</ha-button>`),this._goToNextStep,this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.skip")):5===this._step&&this._language?(0,n.qy)(O||(O=B`<ha-dropdown slot="headerActionItems" @wa-select="${0}"> <ha-assist-chip .label="${0}" slot="trigger"> <ha-svg-icon slot="trailing-icon" .path="${0}"></ha-svg-icon></ha-assist-chip> ${0} </ha-dropdown>`),this._handlePickLanguage,(0,d.T)(this._language,this.hass.locale),K,(0,p.getLanguageOptions)(this._languages,!1,!1,this.hass.locale).map(t=>(0,n.qy)(P||(P=B`<ha-dropdown-item .value="${0}" .selected="${0}"> ${0} </ha-dropdown-item>`),t.id,this._language===t.id,t.primary))):n.s6,this._goToNextStep,this._goToPreviousStep,1===this._step?(0,n.qy)(q||(q=B`<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.qy)(H||(H=B`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):(null==i?void 0:i.state)===_.Hh?(0,n.qy)(N||(N=B`<ha-alert alert-type="error">${0}</ha-alert>`),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.not_available")):2===this._step?(0,n.qy)(T||(T=B`<ha-voice-assistant-setup-step-check .hass="${0}" .assistEntityId="${0}"></ha-voice-assistant-setup-step-check>`),this.hass,e):3===this._step?(0,n.qy)(Z||(Z=B`<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,e,this._deviceEntities(this._params.deviceId,this.hass.entities)):9===this._step?(0,n.qy)(W||(W=B` <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,e):4===this._step?(0,n.qy)(j||(j=B` <ha-voice-assistant-setup-step-area .hass="${0}" .deviceId="${0}"></ha-voice-assistant-setup-step-area> `),this.hass,this._params.deviceId):5===this._step?(0,n.qy)(F||(F=B`<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,e,this._languageChanged):7===this._step?(0,n.qy)(V||(V=B`<ha-voice-assistant-setup-step-cloud .hass="${0}"></ha-voice-assistant-setup-step-cloud>`),this.hass):8===this._step?(0,n.qy)(D||(D=B`<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):6===this._step?(0,n.qy)(R||(R=B`<ha-voice-assistant-setup-step-success .hass="${0}" .assistConfiguration="${0}" .assistEntityId="${0}" .deviceId="${0}"></ha-voice-assistant-setup-step-success>`),this.hass,this._assistConfiguration,e,this._params.deviceId):n.s6)}async _getLanguages(){if(this._languages.length)return;const t=await(0,v.e1)(this.hass);this._languages=Object.entries(t.languages).filter(([t,e])=>e.cloud>0||e.full_local>0||e.focused_local>0).map(([t,e])=>t),this._language=t.preferred_language&&this._languages.includes(t.preferred_language)?t.preferred_language:void 0}async _fetchAssistConfiguration(){try{this._assistConfiguration=await(0,g.Vy)(this.hass,this._findDomainEntityId(this._params.deviceId,this.hass.entities,"assist_satellite"))}catch(t){this._error=t.message}}_handlePickLanguage(t){this._language=t.detail.item.value}_languageChanged(t){t.detail.value&&(this._language=t.detail.value)}_goToPreviousStep(){this._previousSteps.length&&(this._step=this._previousSteps.pop())}async _goToNextStep(t){var e,i,s,a;null!=t&&null!==(e=t.detail)&&void 0!==e&&e.updateConfig&&await this._fetchAssistConfiguration(),null!=t&&null!==(i=t.detail)&&void 0!==i&&i.nextStep&&(this._nextStep=t.detail.nextStep),null!=t&&null!==(s=t.detail)&&void 0!==s&&s.noPrevious||this._previousSteps.push(this._step),null!=t&&null!==(a=t.detail)&&void 0!==a&&a.step?(this._step=t.detail.step,8===t.detail.step&&(this._localOption=t.detail.option)):this._nextStep?(this._step=this._nextStep,this._nextStep=void 0):this._step+=1}static get styles(){return[f.nA,(0,n.AH)(U||(U=B`ha-dialog{--dialog-content-padding:0}@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-dropdown{height:48px;display:flex;align-items:center;margin-right:12px;margin-inline-end:12px;margin-inline-start:initial}`))]}constructor(...t){super(...t),this._open=!1,this._step=0,this._languages=[],this._previousSteps=[],this._deviceEntities=(0,r.A)((t,e)=>Object.values(e).filter(e=>e.device_id===t)),this._findDomainEntityId=(0,r.A)((t,e,i)=>{var s;return null===(s=this._deviceEntities(t,e).find(t=>(0,c.m)(t.entity_id)===i))||void 0===s?void 0:s.entity_id})}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],Y.prototype,"hass",void 0),(0,a.Cg)([(0,o.wk)()],Y.prototype,"_params",void 0),(0,a.Cg)([(0,o.wk)()],Y.prototype,"_open",void 0),(0,a.Cg)([(0,o.wk)()],Y.prototype,"_step",void 0),(0,a.Cg)([(0,o.wk)()],Y.prototype,"_assistConfiguration",void 0),(0,a.Cg)([(0,o.wk)()],Y.prototype,"_error",void 0),(0,a.Cg)([(0,o.wk)()],Y.prototype,"_language",void 0),(0,a.Cg)([(0,o.wk)()],Y.prototype,"_languages",void 0),(0,a.Cg)([(0,o.wk)()],Y.prototype,"_localOption",void 0),Y=(0,a.Cg)([(0,o.EM)("ha-voice-assistant-setup-dialog")],Y),s()}catch(I){s(I)}})},83051:function(t,e,i){i.a(t,async function(t,e){try{i(3362);var s=i(40445),a=i(5124),n=i(67576),o=i(1087),r=i(66086),l=i(58594),c=i(65063),d=i(69075),h=t([r]);r=(h.then?(await h)():h)[0];let u,p,g=t=>t;class v extends a.WF{render(){const t=this.hass.devices[this.deviceId];return(0,a.qy)(u||(u=g`<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}">${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,t.area_id,this._setArea,this.hass.localize("ui.common.next"))}async _setArea(){const t=this.shadowRoot.querySelector("ha-area-picker").value;t?(await(0,l.FB)(this.hass,this.deviceId,{area_id:t}),this._nextStep()):(0,c.showAlertDialog)(this,{text:this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.area.no_selection")})}_nextStep(){(0,o.r)(this,"next-step")}}v.styles=[d.s,(0,a.AH)(p||(p=g`ha-area-picker{display:block;width:100%;margin-bottom:24px;text-align:initial}`))],(0,s.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"deviceId",void 0),v=(0,s.Cg)([(0,n.EM)("ha-voice-assistant-setup-step-area")],v),e()}catch(u){e(u)}})},56396:function(t,e,i){i.a(t,async function(t,e){try{i(18111),i(61701),i(3362);var s=i(40445),a=i(5124),n=i(67576),o=i(1087),r=(i(1671),i(50723),i(62351)),l=i(69075),c=i(85027),d=t([c]);c=(d.then?(await d)():d)[0];let h,u,p,g=t=>t;class v extends a.WF{render(){return(0,a.qy)(h||(h=g`<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-list-base> ${0} </ha-list-base>`),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(t=>(0,a.qy)(u||(u=g`<ha-list-item-button @click="${0}" .value="${0}"> ${0} <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-button>`),this._wakeWordPicked,t.id,t.wake_word)))}async _wakeWordPicked(t){if(!this.assistEntityId)return;const e=t.currentTarget.value;await(0,r.g5)(this.hass,this.assistEntityId,[e]),this._nextStep()}_nextStep(){(0,o.r)(this,"next-step",{step:c.STEP.WAKEWORD,updateConfig:!0})}}v.styles=[l.s,(0,a.AH)(p||(p=g`:host{padding:0}.padding{padding:24px}ha-list-base{width:100%;text-align:initial;margin-bottom:24px}`))],(0,s.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"assistConfiguration",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"assistEntityId",void 0),v=(0,s.Cg)([(0,n.EM)("ha-voice-assistant-setup-step-change-wake-word")],v),e()}catch(h){e(h)}})},11944:function(t,e,i){i.a(t,async function(t,e){try{i(3362),i(62953);var s=i(40445),a=i(5124),n=i(67576),o=i(1087),r=i(18350),l=i(65829),c=i(62351),d=i(36918),h=i(69075),u=t([r,l]);[r,l]=u.then?(await u)():u;let p,g,v,_,f=t=>t;class m extends a.WF{willUpdate(t){var e;super.willUpdate(t),this.hasUpdated?"success"===this._status&&t.has("hass")&&"idle"===(null===(e=this.hass.states[this.assistEntityId])||void 0===e?void 0:e.state)&&this._nextStep():this._testConnection()}render(){return(0,a.qy)(p||(p=f`<div class="content"> ${0} </div>`),"timeout"===this._status?(0,a.qy)(g||(g=f`<img src="/static/images/voice-assistant/error.png" alt="Casita ioBroker error logo"> <h1> ${0} </h1> <p class="secondary"> ${0} </p> <div class="footer"> <ha-button appearance="plain" href="${0}"> ${0}</ha-button> <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,d.o)(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,a.qy)(v||(v=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,a.qy)(_||(_=f`<ha-spinner></ha-spinner>`)):a.s6))}async _testConnection(){this._status=void 0,this._showLoader=!1;const t=setTimeout(()=>{this._showLoader=!0},3e3),e=await(0,c.tl)(this.hass,this.assistEntityId);clearTimeout(t),this._showLoader=!1,this._status=e.status}_nextStep(){(0,o.r)(this,"next-step",{noPrevious:!0})}constructor(...t){super(...t),this._showLoader=!1}}m.styles=h.s,(0,s.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"assistEntityId",void 0),(0,s.Cg)([(0,n.wk)()],m.prototype,"_status",void 0),(0,s.Cg)([(0,n.wk)()],m.prototype,"_showLoader",void 0),m=(0,s.Cg)([(0,n.EM)("ha-voice-assistant-setup-step-check")],m),e()}catch(p){e(p)}})},35613:function(t,e,i){i.a(t,async function(t,e){try{i(62953);var s=i(40445),a=i(5124),n=i(67576),o=i(37046),r=i(87019),l=i(47594),c=i(1087),d=i(85027),h=t([o,r,l,d]);[o,r,l,d]=h.then?(await h)():h;let u,p,g,v=t=>t;class _ extends a.WF{render(){return"SIGNUP"===this._state?(0,a.qy)(u||(u=v`<cloud-step-signup .hass="${0}" @cloud-step="${0}"></cloud-step-signup>`),this.hass,this._cloudStep):"SIGNIN"===this._state?(0,a.qy)(p||(p=v`<cloud-step-signin .hass="${0}" @cloud-step="${0}"></cloud-step-signin>`),this.hass,this._cloudStep):(0,a.qy)(g||(g=v`<cloud-step-intro .hass="${0}" @cloud-step="${0}"></cloud-step-intro>`),this.hass,this._cloudStep)}_cloudStep(t){"DONE"!==t.detail.step?this._state=t.detail.step:(0,c.r)(this,"next-step",{step:d.STEP.PIPELINE,noPrevious:!0})}constructor(...t){super(...t),this._state="INTRO"}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,s.Cg)([(0,n.wk)()],_.prototype,"_state",void 0),_=(0,s.Cg)([(0,n.EM)("ha-voice-assistant-setup-step-cloud")],_),e()}catch(u){e(u)}})},63095:function(t,e,i){i.a(t,async function(t,e){try{i(16280),i(74423),i(26910),i(18111),i(22489),i(20116),i(61701),i(13579),i(3362),i(62953);var s=i(40445),a=i(5124),n=i(67576),o=i(36312),r=i(1087),l=i(71727),c=i(65829),d=i(69150),h=i(26571),u=i(88433),p=i(59241),g=i(22130),v=i(99037),_=i(52069),f=i(8164),m=i(36918),y=i(69075),b=i(85027),w=t([c,b]);[c,b]=w.then?(await w)():w;let C,$,x,k,A,S=t=>t;const z="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";class I extends a.WF{render(){return(0,a.qy)(C||(C=S`<div class="content"> ${0} </div>`),"INSTALLING"===this._state?(0,a.qy)($||($=S`<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,a.qy)(x||(x=S`<img src="/static/images/voice-assistant/error.png" alt="Casita ioBroker error logo"> <h1> ${0} </h1> <p>${0}</p> <p> ${0} </p> <ha-button appearance="plain" size="small" @click="${0}">${0}</ha-button> <ha-button href="${0}" target="_blank" rel="noreferrer noopener" size="small" appearance="plain"> <ha-svg-icon .path="${0}" slot="start"></ha-svg-icon> ${0}</ha-button>`),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,m.o)(this.hass,"/voice_control/voice_remote_local_assistant/"),z,this.hass.localize("ui.panel.config.common.learn_more")):"NOT_SUPPORTED"===this._state?(0,a.qy)(k||(k=S`<img src="/static/images/voice-assistant/error.png" alt="Casita ioBroker error logo"> <h1> ${0} </h1> <p> ${0} </p> <ha-button appearance="plain" size="small" @click="${0}">${0}</ha-button> <ha-button href="${0}" target="_blank" rel="noreferrer noopener" appearance="plain" size="small"> <ha-svg-icon .path="${0}" slot="start"></ha-svg-icon> ${0}</ha-button>`),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,m.o)(this.hass,"/voice_control/voice_remote_local_assistant/"),z,this.hass.localize("ui.panel.config.common.learn_more")):a.s6)}willUpdate(t){super.willUpdate(t),this.hasUpdated||this._checkLocal()}_prevStep(){(0,r.r)(this,"prev-step")}_nextStep(){(0,r.r)(this,"next-step",{step:b.STEP.SUCCESS,noPrevious:!0})}async _checkLocal(){if(await this._findLocalEntities(),this._localTts&&this._localStt)try{if(this._localTts.length&&this._localStt.length)return void(await this._pickOrCreatePipelineExists());if(!(0,o.x)(this.hass.config,"hassio"))return void(this._state="NOT_SUPPORTED");this._state="INSTALLING";const{addons:t}=await(0,g.fetchHassioAddonsInfo)(this.hass),e=t.find(t=>t.slug===this._ttsAddonName),i=t.find(t=>t.slug===this._sttAddonName);this._localTts.length||(e||(this._detailState=this.hass.localize(`ui.panel.config.voice_assistants.satellite_wizard.local.state.installing_${this._ttsProviderName}`),await(0,g.installHassioAddon)(this.hass.callWS,this._ttsAddonName)),e&&"started"===e.state||(this._detailState=this.hass.localize(`ui.panel.config.voice_assistants.satellite_wizard.local.state.starting_${this._ttsProviderName}`),await(0,g.startHassioAddon)(this.hass.callWS,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,g.installHassioAddon)(this.hass.callWS,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,g.startHassioAddon)(this.hass.callWS,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(t){this._state="ERROR",this._error=t.message}}get _sttProviderName(){return"focused_local"===this.localOption?"speech-to-phrase":"faster-whisper"}get _sttAddonName(){return"focused_local"===this.localOption?"core_speech-to-phrase":"core_whisper"}get _sttHostName(){return"focused_local"===this.localOption?"core-speech-to-phrase":"core-whisper"}async _findLocalEntities(){const t=Object.values(this.hass.entities).filter(t=>"wyoming"===t.platform);if(!t.length)return this._localStt=[],void(this._localTts=[]);const e=await(0,f.d)(this.hass),i=Object.values(await(0,p.G3)(this.hass,t.map(t=>t.entity_id)));this._localTts=i.filter(t=>{var i;return"tts"===(0,l.m)(t.entity_id)&&t.config_entry_id&&(null===(i=e.info[t.config_entry_id])||void 0===i?void 0:i.tts.some(t=>t.name===this._ttsProviderName))}),this._localStt=i.filter(t=>{var i;return"stt"===(0,l.m)(t.entity_id)&&t.config_entry_id&&(null===(i=e.info[t.config_entry_id])||void 0===i?void 0:i.asr.some(t=>t.name===this._sttProviderName))})}async _setupConfigEntry(t){const e=await this._findConfigFlowInProgress(t);if(e){if("create_entry"===(await(0,h.jm)(this.hass,e.flow_id,{})).type)return}return this._createConfigEntry(t)}async _findConfigFlowInProgress(t){return(await(0,h.t2)(this.hass.connection)).find(e=>"wyoming"===e.handler&&"hassio"===e.context.source&&(e.context.configuration_url&&e.context.configuration_url.includes("tts"===t?this._ttsAddonName:this._sttAddonName)||e.context.title_placeholders.name&&e.context.title_placeholders.name.toLowerCase().includes("tts"===t?this._ttsProviderName:this._sttProviderName)))}async _createConfigEntry(t){const e=await(0,h.t1)(this.hass,"wyoming"),i=await(0,h.jm)(this.hass,e.flow_id,{host:"tts"===t?this._ttsHostName:this._sttHostName,port:"tts"===t?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",{app:"tts"===t?this._ttsProviderName:this._sttProviderName})}${"errors"in i?`: ${i.errors.base}`:""}`)}async _pickOrCreatePipelineExists(){var t,e,i;if(null===(t=this._localStt)||void 0===t||!t.length||null===(e=this._localTts)||void 0===e||!e.length)return;const s=await(0,d.nx)(this.hass);s.preferred_pipeline&&s.pipelines.sort(t=>t.id===s.preferred_pipeline?-1:0);const a=this._localTts.map(t=>t.entity_id),n=this._localStt.map(t=>t.entity_id);let o=s.pipelines.find(t=>"conversation.home_assistant"===t.conversation_engine&&t.tts_engine&&a.includes(t.tts_engine)&&t.stt_engine&&n.includes(t.stt_engine)&&t.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()}async _createPipeline(t,e){var i,s,a;const n=await(0,d.nx)(this.hass),o=(await(0,u.vc)(this.hass,this.language||this.hass.config.language,this.hass.config.country||void 0)).agents.find(t=>"conversation.home_assistant"===t.id);if(null==o||!o.supported_languages.length)throw new Error("Conversation agent does not support requested language.");const r=(await(0,_.Xv)(this.hass,this.language,this.hass.config.country||void 0)).providers.find(e=>e.engine_id===t);if(null==r||null===(i=r.supported_languages)||void 0===i||!i.length)throw new Error("TTS engine does not support requested language.");const l=await(0,_.z3)(this.hass,t,r.supported_languages[0]);if(null===(s=l.voices)||void 0===s||!s.length)throw new Error("No voice available for requested language.");const c=(await(0,v.T)(this.hass,this.language,this.hass.config.country||void 0)).providers.find(t=>t.engine_id===e);if(null==c||null===(a=c.supported_languages)||void 0===a||!a.length)throw new Error("STT engine does not support requested language.");let h=this.hass.localize(`ui.panel.config.voice_assistants.satellite_wizard.local.${this.localOption}_pipeline`),p=1;for(;n.pipelines.find(t=>t.name===h);)h=`${this.hass.localize(`ui.panel.config.voice_assistants.satellite_wizard.local.${this.localOption}_pipeline`)} ${p}`,p++;return(0,d.u6)(this.hass,{name:h,language:this.language.split("-")[0],conversation_engine:"conversation.home_assistant",conversation_language:o.supported_languages[0],stt_engine:e,stt_language:c.supported_languages[0],tts_engine:t,tts_language:r.supported_languages[0],tts_voice:l.voices[0].voice_id,wake_word_entity:null,wake_word_id:null})}async _findEntitiesAndCreatePipeline(t=0){var e,i,s;if(await this._findLocalEntities(),null===(e=this._localTts)||void 0===e||!e.length||null===(i=this._localStt)||void 0===i||!i.length){if(t>3)throw new Error(this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.local.errors.could_not_find_entities"));return await new Promise(t=>{setTimeout(t,2e3)}),this._findEntitiesAndCreatePipeline(t+1)}const a=await this._createPipeline(this._localTts[0].entity_id,this._localStt[0].entity_id);await this.hass.callService("select","select_option",{option:a.name},{entity_id:null===(s=this.assistConfiguration)||void 0===s?void 0:s.pipeline_entity_id}),this._nextStep()}constructor(...t){super(...t),this._state="INTRO",this._ttsProviderName="piper",this._ttsAddonName="core_piper",this._ttsHostName="core-piper",this._ttsPort=10200,this._sttPort=10300}}I.styles=[y.s,(0,a.AH)(A||(A=S`ha-spinner{margin-top:24px;margin-bottom:24px}`))],(0,s.Cg)([(0,n.MZ)({attribute:!1})],I.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],I.prototype,"assistConfiguration",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],I.prototype,"localOption",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],I.prototype,"language",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"_state",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"_detailState",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"_error",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"_localTts",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"_localStt",void 0),I=(0,s.Cg)([(0,n.EM)("ha-voice-assistant-setup-step-local")],I),e()}catch(C){e(C)}})},37184:function(t,e,i){i.a(t,async function(t,e){try{i(44114),i(26910),i(18111),i(20116),i(3362),i(62953);var s=i(40445),a=i(5124),n=i(67576),o=i(22786),r=i(36312),l=i(1087),c=i(71727),d=i(86198),h=(i(2226),i(69150)),u=i(71117),p=i(88433),g=i(99037),v=i(52069),_=i(36918),f=i(69075),m=i(85027),y=t([d,m]);[d,m]=y.then?(await y)():y;let b,w,C,$,x=t=>t;const k=["cloud","focused_local","full_local"],A={cloud:0,focused_local:0,full_local:0};class S extends a.WF{willUpdate(t){if(super.willUpdate(t),this.hasUpdated||this._fetchData(),(t.has("language")||t.has("_languageScores"))&&this.language&&this._languageScores){var e;const t=this.language;var i;if(this._value&&0===(null===(e=this._languageScores[t])||void 0===e?void 0:e[this._value])&&(this._value=void 0),!this._value)this._value=null===(i=this._getOptions(this._languageScores[t]||A,this.hass.localize).supportedOptions[0])||void 0===i?void 0:i.value}}render(){if(!this._cloudChecked||!this._languageScores)return a.s6;if(!this.language){const t=(0,d.T)(this.hass.config.language,this.hass.locale);return(0,a.qy)(b||(b=x`<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:t}),this.hass,this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.pipeline.unsupported_language.language_picker"),this.languages,this._languageChanged,(0,_.o)(this.hass,"/voice_control/contribute-voice/"),this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.pipeline.unsupported_language.contribute",{language:t}))}const t=this._languageScores[this.language]||A,e=this._getOptions(t,this.hass.localize),i=this._value?"full_local"===this._value?"low":"high":"",s=this._value?t[this._value]>2?"high":t[this._value]>1?"ready":t[this._value]>0?"low":"":"";return(0,a.qy)(w||(w=x`<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}" .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"),s?this.hass.localize(`ui.panel.config.voice_assistants.satellite_wizard.pipeline.commands.${s}`):"",s,e.supportedOptions,this._value,this._valueChanged,e.unsupportedOptions.length?(0,a.qy)(C||(C=x`<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"),e.unsupportedOptions):a.s6,this._createPipeline,!this._value,this.hass.localize("ui.common.next"))}async _fetchData(){await this._hasCloud()&&await this._createCloudPipeline(!1)||(this._cloudChecked=!0,this._languageScores=(await(0,p.e1)(this.hass)).languages)}async _hasCloud(){if(!(0,r.x)(this.hass.config,"cloud"))return!1;const t=await(0,u.eN)(this.hass);return!(!t.logged_in||!t.active_subscription)}async _createCloudPipeline(t){let e,i;for(const r of Object.values(this.hass.entities))if("cloud"===r.platform){const t=(0,c.m)(r.entity_id);if("tts"===t)e=r.entity_id;else{if("stt"!==t)continue;i=r.entity_id}if(e&&i)break}try{var s;const o=await(0,h.nx)(this.hass);o.preferred_pipeline&&o.pipelines.sort(t=>t.id===o.preferred_pipeline?-1:0);let r=o.pipelines.find(s=>"conversation.home_assistant"===s.conversation_engine&&s.tts_engine===e&&s.stt_engine===i&&(!t||s.language.split("-")[0]===this.language.split("-")[0]));if(!r){var a,n;const t=(await(0,p.vc)(this.hass,this.language||this.hass.config.language,this.hass.config.country||void 0)).agents.find(t=>"conversation.home_assistant"===t.id);if(null==t||!t.supported_languages.length)return!1;const s=(await(0,v.Xv)(this.hass,this.language||this.hass.config.language,this.hass.config.country||void 0)).providers.find(t=>t.engine_id===e);if(null==s||null===(a=s.supported_languages)||void 0===a||!a.length)return!1;const l=await(0,v.z3)(this.hass,e,s.supported_languages[0]),c=(await(0,g.T)(this.hass,this.language||this.hass.config.language,this.hass.config.country||void 0)).providers.find(t=>t.engine_id===i);if(null==c||null===(n=c.supported_languages)||void 0===n||!n.length)return!1;let d="ioBroker Cloud",u=1;for(;o.pipelines.find(t=>t.name===d);)d=`ioBroker Cloud ${u}`,u++;r=await(0,h.u6)(this.hass,{name:d,language:(this.language||this.hass.config.language).split("-")[0],conversation_engine:"conversation.home_assistant",conversation_language:t.supported_languages[0],stt_engine:i,stt_language:c.supported_languages[0],tts_engine:e,tts_language:s.supported_languages[0],tts_voice:l.voices[0].voice_id,wake_word_entity:null,wake_word_id:null})}return await this.hass.callService("select","select_option",{option:r.name},{entity_id:null===(s=this.assistConfiguration)||void 0===s?void 0:s.pipeline_entity_id}),(0,l.r)(this,"next-step",{step:m.STEP.SUCCESS,noPrevious:!0}),!0}catch(o){return!1}}_valueChanged(t){this._value=t.detail.value}async _setupCloud(){await this._hasCloud()?this._createCloudPipeline(!0):(0,l.r)(this,"next-step",{step:m.STEP.CLOUD})}_createPipeline(){"cloud"===this._value?this._setupCloud():"focused_local"===this._value?this._setupLocalFocused():this._setupLocalFull()}_setupLocalFocused(){(0,l.r)(this,"next-step",{step:m.STEP.LOCAL,option:this._value})}_setupLocalFull(){(0,l.r)(this,"next-step",{step:m.STEP.LOCAL,option:this._value})}_languageChanged(t){t.detail.value&&(0,l.r)(this,"language-changed",{value:t.detail.value})}constructor(...t){super(...t),this.languages=[],this._cloudChecked=!1,this._getOptions=(0,o.A)((t,e)=>{const i=[],s=[];return k.forEach(a=>{t[a]>0?i.push({label:e(`ui.panel.config.voice_assistants.satellite_wizard.pipeline.options.${a}.label`),description:e(`ui.panel.config.voice_assistants.satellite_wizard.pipeline.options.${a}.description`),value:a}):s.push({label:e(`ui.panel.config.voice_assistants.satellite_wizard.pipeline.options.${a}.label`),value:a})}),{supportedOptions:i,unsupportedOptions:s}})}}S.styles=[f.s,(0,a.AH)($||($=x`:host{text-align:left}.perf-bar{width:100%;height:10px;display:flex;gap:var(--ha-space-1);margin:8px 0}.segment{flex-grow:1;background-color:var(--disabled-color);transition:background-color .3s}.segment:first-child{border-radius:var(--ha-border-radius-sm) var(--ha-border-radius-square) var(--ha-border-radius-square) var(--ha-border-radius-sm)}.segment:last-child{border-radius:var(--ha-border-radius-square) var(--ha-border-radius-sm) var(--ha-border-radius-sm) var(--ha-border-radius-square)}.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}`))],(0,s.Cg)([(0,n.MZ)({attribute:!1})],S.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],S.prototype,"assistConfiguration",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],S.prototype,"deviceId",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],S.prototype,"assistEntityId",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],S.prototype,"language",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],S.prototype,"languages",void 0),(0,s.Cg)([(0,n.wk)()],S.prototype,"_cloudChecked",void 0),(0,s.Cg)([(0,n.wk)()],S.prototype,"_value",void 0),(0,s.Cg)([(0,n.wk)()],S.prototype,"_languageScores",void 0),S=(0,s.Cg)([(0,n.EM)("ha-voice-assistant-setup-step-pipeline")],S),e()}catch(b){e(b)}})},16923:function(t,e,i){i.a(t,async function(t,e){try{i(74423),i(18111),i(20116),i(61701),i(3362),i(62953);var s=i(40445),a=i(5124),n=i(67576),o=i(1087),r=i(57237),l=i(37981),c=i(606),d=i(58933),h=i(91485),u=i(69150),p=i(62351),g=i(71117),v=i(58594),_=i(97078),f=i(53732),m=i(78157),y=i(17733),b=i(69075),w=i(85027),C=t([c,d,h,m,w]);[c,d,h,m,w]=C.then?(await C)():C;let $,x,k,A,S,z,I=t=>t;const E="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",M="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";class O extends a.WF{willUpdate(t){if(super.willUpdate(t),t.has("assistConfiguration"))this._setTtsSettings();else if(t.has("hass")&&this.assistConfiguration){const e=t.get("hass");if(e){const t=e.states[this.assistConfiguration.pipeline_entity_id],i=this.hass.states[this.assistConfiguration.pipeline_entity_id];t.state!==i.state&&this._setTtsSettings()}}}render(){var t;const e=this.assistConfiguration?this.hass.states[this.assistConfiguration.pipeline_entity_id]:void 0,i=this.hass.devices[this.deviceId];return(0,a.qy)($||($=I`<div class="content"> <img src="/static/images/voice-assistant/heart.png" alt="Casita ioBroker logo"> <h1> ${0} </h1> <p class="secondary"> ${0} </p> ${0} <div class="rows"> <div class="row"> <ha-input .label="${0}" .placeholder="${0}" .value="${0}" @change="${0}"></ha-input> </div> ${0} ${0} ${0} </div> </div> <div class="footer"> <ha-button @click="${0}">${0}</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._error?(0,a.qy)(x||(x=I`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):a.s6,this.hass.localize("ui.panel.config.integrations.config_flow.device_name"),(0,l.T)(i,this.hass.localize,this.hass.states),null!==(t=this._deviceName)&&void 0!==t?t:(0,l.xn)(i),this._deviceNameChanged,this.assistConfiguration&&this.assistConfiguration.available_wake_words.length>1?(0,a.qy)(k||(k=I`<div class="row"> <ha-select .label="${0}" .value="${0}" @selected="${0}" .options="${0}"></ha-select> <ha-button appearance="plain" size="small" @click="${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> ${0} </ha-button> </div>`),this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.detail.form.wake_word_id"),this.assistConfiguration.active_wake_words[0],this._wakeWordPicked,this.assistConfiguration.available_wake_words.map(t=>({value:t.id,label:t.wake_word})),this._testWakeWord,M,this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.success.test_wakeword")):a.s6,e?(0,a.qy)(A||(A=I`<div class="row"> <ha-select .label="${0}" @closed="${0}" .value="${0}" @selected="${0}" .options="${0}"> </ha-select> <ha-button appearance="plain" size="small" @click="${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> ${0} </ha-button> </div>`),this.hass.localize("ui.panel.config.voice_assistants.assistants.pipeline.devices.pipeline"),r.d,null==e?void 0:e.state,this._pipelinePicked,null==e?void 0:e.attributes.options.map(t=>({value:t,label:this.hass.formatEntityState(e,t)})),this._openPipeline,E,this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.success.edit_pipeline")):a.s6,this._ttsSettings?(0,a.qy)(S||(S=I`<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 appearance="plain" size="small" @click="${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> ${0} </ha-button> </div>`),this.hass,this._ttsSettings.engine,this._ttsSettings.language,this._ttsSettings.voice,this._voicePicked,r.d,this._testTts,L,this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.success.try_tts")):a.s6,this._done,this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.success.done"))}async _getPipeline(){var t,e;if(null===(t=this.assistConfiguration)||void 0===t||!t.pipeline_entity_id)return[void 0,void 0];const i=this.hass.states[null===(e=this.assistConfiguration)||void 0===e?void 0:e.pipeline_entity_id].state,s=await(0,u.nx)(this.hass);let a;return a="preferred"===i?s.pipelines.find(t=>t.id===s.preferred_pipeline):s.pipelines.find(t=>t.name===i),[a,s.preferred_pipeline]}_deviceNameChanged(t){this._deviceName=t.target.value}async _wakeWordPicked(t){const e=t.detail.value;this.assistConfiguration&&(this.assistConfiguration.active_wake_words=[e]),await(0,p.g5)(this.hass,this.assistEntityId,[e])}_pipelinePicked(t){const e=this.hass.states[this.assistConfiguration.pipeline_entity_id],i=t.detail.value;i!==e.state&&e.attributes.options.includes(i)&&(0,_.w)(this.hass,e.entity_id,i)}async _setTtsSettings(){const[t]=await this._getPipeline();this._ttsSettings=t?{engine:t.tts_engine,voice:t.tts_voice,language:t.tts_language}:void 0}async _voicePicked(t){const[e]=await this._getPipeline();e&&await(0,u.zn)(this.hass,e.id,Object.assign(Object.assign({},e),{},{tts_voice:t.detail.value}))}async _testTts(){const[t]=await this._getPipeline();if(t){if(t.language!==this.hass.locale.language)try{const e=await(0,y.sC)(null,t.language,!1);return void this._announce(e.data["ui.dialogs.tts-try.message_example"])}catch(e){}this._announce(this.hass.localize("ui.dialogs.tts-try.message_example"))}}async _announce(t){this.assistEntityId&&await(0,p.ew)(this.hass,this.assistEntityId,{message:t,preannounce:!1})}_testWakeWord(){(0,o.r)(this,"next-step",{step:w.STEP.WAKEWORD,nextStep:w.STEP.SUCCESS,updateConfig:!0})}async _openPipeline(){const[t]=await this._getPipeline();if(!t)return;const e=await(0,g.eN)(this.hass);(0,f.L)(this,{cloudActiveSubscription:e.logged_in&&e.active_subscription,pipeline:t,updatePipeline:async e=>{await(0,u.zn)(this.hass,t.id,e)},hideWakeWord:!0})}async _done(){if(this._deviceName)try{(0,v.FB)(this.hass,this.deviceId,{name_by_user:this._deviceName})}catch(t){return void(this._error=this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.success.failed_rename",{error:t.message||t}))}(0,o.r)(this,"closed")}}O.styles=[b.s,(0,a.AH)(z||(z=I`ha-tts-voice-picker{display:block}.footer{margin-top:24px}.rows{gap:var(--ha-space-4);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}ha-select{display:block;text-align:start}`))],(0,s.Cg)([(0,n.MZ)({attribute:!1})],O.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],O.prototype,"assistConfiguration",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],O.prototype,"deviceId",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],O.prototype,"assistEntityId",void 0),(0,s.Cg)([(0,n.wk)()],O.prototype,"_ttsSettings",void 0),(0,s.Cg)([(0,n.wk)()],O.prototype,"_error",void 0),O=(0,s.Cg)([(0,n.EM)("ha-voice-assistant-setup-step-success")],O),e()}catch($){e($)}})},16487:function(t,e,i){i.a(t,async function(t,e){try{i(3362),i(62953);var s=i(40445),a=i(5124),n=i(67576),o=i(1087),r=i(65829),l=i(16386),c=i(22675),d=i(24247),h=i(69075),u=t([r,l,d]);[r,l,d]=u.then?(await u)():u;let p,g,v,_,f=t=>t;class m extends a.WF{willUpdate(t){if(super.willUpdate(t),this.updateEntityId){if(t.has("hass")&&this.updateEntityId){const e=t.get("hass");if(e){const t=e.states[this.updateEntityId],i=this.hass.states[this.updateEntityId];if((null==t?void 0:t.state)===c.Hh&&(null==i?void 0:i.state)!==c.Hh||"on"!==(null==t?void 0:t.state)&&"on"===(null==i?void 0:i.state))return void this._tryUpdate(!1)}}t.has("updateEntityId")&&this._tryUpdate(!0)}else this._nextStep()}render(){if(!this.updateEntityId||!(this.updateEntityId in this.hass.states))return a.s6;const t=this.hass.states[this.updateEntityId],e=t&&(0,d.RJ)(t);return(0,a.qy)(p||(p=f`<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>`),t&&("unavailable"===t.state||(0,d.Jy)(t))?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"),e?(0,a.qy)(g||(g=f` <ha-progress-ring .value="${0}"></ha-progress-ring> `),t.attributes.update_percentage):(0,a.qy)(v||(v=f`<ha-spinner></ha-spinner>`)),(null==t?void 0:t.state)===c.Hh?"Restarting voice assistant":e?`Installing ${t.attributes.update_percentage}%`:"")}async _tryUpdate(t){if(clearTimeout(this._refreshTimeout),!this.updateEntityId)return;const e=this.hass.states[this.updateEntityId];e&&"on"===this.hass.states[e.entity_id].state&&(0,d.VK)(e)?(this._updated=!0,await this.hass.callService("update","install",{},{entity_id:e.entity_id})):t?(await this.hass.callService("homeassistant","update_entity",{},{entity_id:this.updateEntityId}),this._refreshTimeout=window.setTimeout(()=>{this._nextStep()},1e4)):this._nextStep()}_nextStep(){(0,o.r)(this,"next-step",{noPrevious:!0,updateConfig:this._updated})}constructor(...t){super(...t),this._updated=!1}}m.styles=[h.s,(0,a.AH)(_||(_=f`ha-progress-ring,ha-spinner{margin-top:24px;margin-bottom:24px}`))],(0,s.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"updateEntityId",void 0),m=(0,s.Cg)([(0,n.EM)("ha-voice-assistant-setup-step-update")],m),e()}catch(p){e(p)}})},62187:function(t,e,i){i.a(t,async function(t,e){try{i(74423),i(18111),i(20116),i(3362),i(62953);var s=i(40445),a=i(5124),n=i(67576),o=i(22786),r=i(1087),l=i(71727),c=i(18350),d=(i(76538),i(65829)),h=i(62351),u=i(69075),p=i(85027),g=t([c,d,p]);[c,d,p]=g.then?(await g)():g;let v,_,f,m,y,b,w,C=t=>t;class $ extends a.WF{disconnectedCallback(){super.disconnectedCallback(),this._stopListeningWakeWord()}willUpdate(t){var e;(super.willUpdate(t),t.has("assistConfiguration")&&this.assistConfiguration&&!this.assistConfiguration.available_wake_words.length&&this._nextStep(),t.has("assistEntityId"))&&(this._detected=!1,this._muteSwitchEntity=null===(e=this.deviceEntities)||void 0===e||null===(e=e.find(t=>"switch"===(0,l.m)(t.entity_id)&&t.entity_id.includes("mute")))||void 0===e?void 0:e.entity_id,this._muteSwitchEntity||this._startTimeOut(),this._listenWakeWord())}_startTimeOut(){this._timeout=window.setTimeout(()=>{this._timeout=void 0,this._timedout=!0},15e3)}render(){if(!this.assistEntityId)return a.s6;return"idle"!==this.hass.states[this.assistEntityId].state?(0,a.qy)(v||(v=C`<ha-spinner></ha-spinner>`)):(0,a.qy)(_||(_=C`<div class="content"> ${0} ${0} </div> ${0}`),this._detected?(0,a.qy)(m||(m=C`<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,a.qy)(f||(f=C` <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,a.qy)(y||(y=C`<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,a.qy)(b||(b=C`<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")):a.s6,this.assistConfiguration&&this.assistConfiguration.available_wake_words.length>1?(0,a.qy)(w||(w=C`<div class="footer centered"> <ha-button appearance="plain" size="small" @click="${0}">${0}</ha-button> </div>`),this._changeWakeWord,this.hass.localize("ui.panel.config.voice_assistants.satellite_wizard.wake_word.change_wake_word")):a.s6)}async _listenWakeWord(){const t=this.assistEntityId;t&&(await this._stopListeningWakeWord(),this._sub=(0,h.ds)(this.hass,t,()=>{this._timedout=!1,clearTimeout(this._timeout),this._stopListeningWakeWord(),this._detected?this._nextStep():(this._detected=!0,this._listenWakeWord())}))}async _stopListeningWakeWord(){try{var t;null===(t=await this._sub)||void 0===t||t()}catch(e){}this._sub=void 0}_nextStep(){(0,r.r)(this,"next-step")}_changeWakeWord(){(0,r.r)(this,"next-step",{step:p.STEP.CHANGE_WAKEWORD})}constructor(...t){super(...t),this._detected=!1,this._timedout=!1,this._activeWakeWord=(0,o.A)(t=>{var e;if(!t)return"";const i=t.active_wake_words[0];return null===(e=t.available_wake_words.find(t=>t.id===i))||void 0===e?void 0:e.wake_word})}}$.styles=u.s,(0,s.Cg)([(0,n.MZ)({attribute:!1})],$.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],$.prototype,"assistConfiguration",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],$.prototype,"assistEntityId",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],$.prototype,"deviceEntities",void 0),(0,s.Cg)([(0,n.wk)()],$.prototype,"_muteSwitchEntity",void 0),(0,s.Cg)([(0,n.wk)()],$.prototype,"_detected",void 0),(0,s.Cg)([(0,n.wk)()],$.prototype,"_timedout",void 0),$=(0,s.Cg)([(0,n.EM)("ha-voice-assistant-setup-step-wake-word")],$),e()}catch(v){e(v)}})},68893:function(t,e,i){i.d(e,{o:function(){return a}});i(3362),i(62953);var s=i(1087);const a=(t,e)=>new Promise(a=>{const n=e.closeDialog,o=e.logInHereAction;(0,s.r)(t,"show-dialog",{dialogTag:"dialog-cloud-already-connected",dialogImport:()=>i.e(88028).then(i.bind(i,59959)),dialogParams:Object.assign(Object.assign({},e),{},{closeDialog:()=>{null==n||n(),a(!1)},logInHereAction:()=>{null==o||o(),a(!0)}})})})},53732:function(t,e,i){i.d(e,{L:function(){return n}});i(3362),i(62953);var s=i(1087);const a=()=>Promise.all([i.e(72130),i.e(85010),i.e(29048),i.e(34310),i.e(79662),i.e(81969)]).then(i.bind(i,43528)),n=(t,e)=>{(0,s.r)(t,"show-dialog",{dialogTag:"dialog-voice-assistant-pipeline-detail",dialogImport:a,dialogParams:e})}},4397:function(t,e,i){i.r(e),i.d(e,{HuiErrorCard:function(){return u}});i(62953);var s=i(40445),a=i(5124),n=i(67576);i(76776),i(67094);let o,r,l,c,d=t=>t;const h={warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z"};class u extends a.WF{getCardSize(){return 1}getGridOptions(){return{columns:6,rows:this.preview?"auto":1,min_rows:1,min_columns:6}}setConfig(t){this._config=t,this.severity=t.severity||"error"}render(){var t,e,i,s,n;const c=(null===(t=this._config)||void 0===t?void 0:t.error)||"warning"===this.severity&&(null===(e=this.hass)||void 0===e?void 0:e.localize("ui.errors.config.configuration_warning"))||(null===(i=this.hass)||void 0===i?void 0:i.localize("ui.errors.config.configuration_error")),u=void 0===this.hass||(null===(s=this.hass)||void 0===s||null===(s=s.user)||void 0===s?void 0:s.is_admin)||this.preview,p=this.preview;return(0,a.qy)(o||(o=d` <ha-card class="${0} ${0}"> <div class="header"> <div class="icon"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> ${0} </div> ${0} </ha-card> `),this.severity,u?"":"no-title",h[this.severity],u?(0,a.qy)(r||(r=d`<div class="title"><slot>${0}</slot></div>`),c):a.s6,p&&null!==(n=this._config)&&void 0!==n&&n.message?(0,a.qy)(l||(l=d`<div class="message">${0}</div>`),this._config.message):a.s6)}constructor(...t){super(...t),this.preview=!1,this.severity="error"}}u.styles=(0,a.AH)(c||(c=d`ha-card{height:100%;border-width:0}ha-card::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg))}.header{display:flex;align-items:center;gap:var(--ha-space-2);padding:16px}.message{padding:0 16px 16px 16px}.no-title{justify-content:center}.title{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:var(--ha-font-weight-bold)}ha-card.warning .icon{color:var(--warning-color)}ha-card.warning::after{background-color:var(--warning-color)}ha-card.error .icon{color:var(--error-color)}ha-card.error::after{background-color:var(--error-color)}`)),(0,s.Cg)([(0,n.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],u.prototype,"preview",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"severity"})],u.prototype,"severity",void 0),(0,s.Cg)([(0,n.wk)()],u.prototype,"_config",void 0),u=(0,s.Cg)([(0,n.EM)("hui-error-card")],u)},784:function(t,e,i){i.d(e,{LX:function(){return r},pY:function(){return l},xP:function(){return a}});i(18111),i(13579);var s=i(20939);function a(t,e){if(e.has("_config"))return!0;if(!e.has("hass"))return!1;const i=e.get("hass");return!i||(i.connected!==t.hass.connected||i.themes!==t.hass.themes||i.locale!==t.hass.locale||i.localize!==t.hass.localize||i.formatEntityState!==t.hass.formatEntityState||i.formatEntityAttributeName!==t.hass.formatEntityAttributeName||i.formatEntityAttributeValue!==t.hass.formatEntityAttributeValue||i.config.state!==t.hass.config.state)}function n(t,e,i){return t.states[i]!==e.states[i]}function o(t,e,i){const s=t.entities[i],a=e.entities[i];return(null==s?void 0:s.display_precision)!==(null==a?void 0:a.display_precision)}function r(t,e){if(a(t,e))return!0;if(!e.has("hass"))return!1;const i=e.get("hass"),s=t.hass;return n(i,s,t._config.entity)||o(i,s,t._config.entity)}function l(t,e){if(a(t,e))return!0;if(!e.has("hass"))return!1;const i=e.get("hass"),r=t.hass;return(0,s.L)(t._config.entities,!1).some(t=>"entity"in t&&(n(i,r,t.entity)||o(i,r,t.entity)))}},85979:function(t,e,i){i.a(t,async function(t,s){try{i.d(e,{j:function(){return u}});var a=i(40445),n=i(58888),o=i(5124),r=i(67576),l=i(38962),c=(i(4397),t([l]));l=(c.then?(await c)():c)[0];let d,h=t=>t;const u=(t,e)=>t.config.state!==n.m2?t.localize("ui.card.common.entity_not_found"):t.localize("ui.panel.lovelace.warning.starting");class p extends o.WF{render(){return(0,o.qy)(d||(d=h`<hui-error-card .hass="${0}" severity="warning"><slot></slot></hui-error-card>`),this.hass)}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"hass",void 0),p=(0,a.Cg)([(0,r.EM)("hui-warning")],p),s()}catch(d){s(d)}})},78157:function(t,e,i){i.a(t,async function(t,s){try{i.r(e);i(16280),i(74423),i(18111),i(61701),i(3362),i(9391);var a=i(40445),n=i(5124),o=i(67576),r=i(606),l=i(22675),c=i(88360),d=i(97078),h=i(784),u=i(79757),p=i(85979),g=t([r,u,p]);[r,u,p]=g.then?(await g)():g;let v,_,f,m=t=>t;class y extends n.WF{setConfig(t){if(!t||!t.entity)throw new Error("Entity must be specified");this._config=t}shouldUpdate(t){return(0,h.LX)(this,t)||t.has("_selectedEntityRow")}willUpdate(t){super.willUpdate(t),this.hass&&this._config&&t.get("hass")&&this.hass.states[this._config.entity]!==t.get("hass").states[this._config.entity]&&(this._selectedEntityRow=void 0)}render(){var t;if(!this.hass||!this._config)return n.s6;const e=this.hass.states[this._config.entity];if(!e)return(0,n.qy)(v||(v=m` <hui-warning .hass="${0}"> ${0} </hui-warning> `),this.hass,(0,p.j)(this.hass,this._config.entity));const i=this.hass.formatEntityName(e,this._config.name);return(0,n.qy)(_||(_=m` <hui-generic-entity-row .hass="${0}" .config="${0}" hide-name> <ha-select .label="${0}" .value="${0}" .options="${0}" .disabled="${0}" @selected="${0}"> </ha-select> </hui-generic-entity-row> `),this.hass,this._config,i,this._selectedEntityRow||e.state,null===(t=e.attributes.options)||void 0===t?void 0:t.map(t=>({value:t,label:this.hass.formatEntityState(e,t)})),e.state===l.Hh,this._handleAction)}_handleAction(t){const e=this.hass.states[this._config.entity],i=t.detail.value;i!==e.state&&e.attributes.options.includes(i)&&((0,c.j)(this,"light"),this._selectedEntityRow=i,(0,d.w)(this.hass,e.entity_id,i).catch(t=>{}).finally(()=>setTimeout(()=>{this.hass.states[this._config.entity]===e&&(this._selectedEntityRow=void 0)},2e3)))}}y.styles=(0,n.AH)(f||(f=m`hui-generic-entity-row{display:flex;align-items:center}ha-select{width:100%;--ha-select-min-width:0}`)),(0,a.Cg)([(0,o.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,a.Cg)([(0,o.wk)()],y.prototype,"_config",void 0),(0,a.Cg)([(0,o.wk)()],y.prototype,"_selectedEntityRow",void 0),y=(0,a.Cg)([(0,o.EM)("hui-select-entity-row")],y),s()}catch(v){s(v)}})},86030:function(t,e,i){i.d(e,{B:function(){return s},a:function(){return a}});i(72712),i(94490),i(18111),i(18237),i(42762),i(62953);function s(t){return Array.isArray(t)?t.reverse().reduce((t,e)=>`var(${e}${t?`, ${t}`:""})`,void 0):`var(${t})`}function a(t,e){if(Array.isArray(t))for(const i of t){const t=a(i,e);if(t)return t}else if(t.endsWith("-color"))return e.getPropertyValue(t).trim()||void 0}},37619:function(t,e,i){i.d(e,{X:function(){return n},s:function(){return a}});i(69112),i(33110);let s=!1;const a=t=>{s=t},n=(t,e)=>{const i=t.sendMessagePromise(e);return s&&console.log(`⬆️ Sent #${e.id}`,e),s&&i.then(t=>console.log(`⬇️ Received #${e.id}`,t&&"object"==typeof t?JSON.parse(JSON.stringify(t)):t),t=>console.error(`❌ Error #${e.id}`,t)),i}}}]);