UNPKG

iobroker.lovelace

Version:

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

19 lines 144 kB
/*! For license information please see 5725.39b630f88b6a241c.js.LICENSE.txt */
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[5725],{80785:function(e,t,i){function a(e){return!!e&&(e instanceof Date&&!isNaN(e.valueOf()))}i.d(t,{A:function(){return a}})},82591:function(e,t,i){i.a(e,async function(e,a){try{i.d(t,{E2:function(){return p},Z8:function(){return g},a3:function(){return _},i:function(){return h},nR:function(){return c}});i(16280);var s=i(74487),n=i(22786),o=i(79791),r=e([s]);s=(r.then?(await r)():r)[0];const l=e=>e<10?`0${e}`:e,c=(e,t)=>{const i=t.days||0,a=t.hours||0,s=t.minutes||0,n=t.seconds||0,o=t.milliseconds||0;return i>0?`${Intl.NumberFormat(e.language,{style:"unit",unit:"day",unitDisplay:"long"}).format(i)} ${a}:${l(s)}:${l(n)}`:a>0?`${a}:${l(s)}:${l(n)}`:s>0?`${s}:${l(n)}`:n>0?Intl.NumberFormat(e.language,{style:"unit",unit:"second",unitDisplay:"long"}).format(n):o>0?Intl.NumberFormat(e.language,{style:"unit",unit:"millisecond",unitDisplay:"long"}).format(o):null},d=(0,n.A)(e=>new Intl.DurationFormat(e.language,{style:"long"})),h=(e,t)=>d(e).format(t),u=(0,n.A)(e=>new Intl.DurationFormat(e.language,{style:"digital",hoursDisplay:"auto"})),p=(e,t)=>u(e).format(t),g=["min","h","d"],v=(0,n.A)(e=>new Intl.DurationFormat(e.language,{style:"narrow",daysDisplay:"always"})),m=(0,n.A)(e=>new Intl.DurationFormat(e.language,{style:"narrow",hoursDisplay:"always"})),f=(0,n.A)(e=>new Intl.DurationFormat(e.language,{style:"narrow",minutesDisplay:"always"})),_=(e,t,i,a)=>{const s=void 0!==a?(0,o.L)(parseFloat(t),a):parseFloat(t);switch(i){case"d":{const t=Math.floor(s),i={days:t,hours:Math.floor(24*(s-t))};return v(e).format(i)}case"h":{const t=Math.floor(s),i={hours:t,minutes:Math.floor(60*(s-t))};return m(e).format(i)}case"min":{const t=Math.floor(s),i={minutes:t,seconds:Math.floor(60*(s-t))};return f(e).format(i)}default:throw new Error("Invalid duration unit")}};a()}catch(l){a(l)}})},17451:function(e,t,i){i.d(t,{j:function(){return a}});const a=(e,t,i)=>(void 0!==i&&(i=!!i),e.hasAttribute(t)?!!i||(e.removeAttribute(t),!1):!1!==i&&(e.setAttribute(t,""),!0))},96986:function(e,t,i){i.d(t,{LR:function(){return o},m9:function(){return r}});const a={10:"mdi:battery-10",20:"mdi:battery-20",30:"mdi:battery-30",40:"mdi:battery-40",50:"mdi:battery-50",60:"mdi:battery-60",70:"mdi:battery-70",80:"mdi:battery-80",90:"mdi:battery-90",100:"mdi:battery"},s={10:"M16,18H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",20:"M16,17H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",30:"M16,15H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",40:"M16,14H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",50:"M16,13H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",60:"M16,12H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",70:"M16,10H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",80:"M16,9H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",90:"M16,8H8V6H16M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z",100:"M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.67C6,21.4 6.6,22 7.33,22H16.67A1.33,1.33 0 0,0 18,20.67V5.33C18,4.6 17.4,4 16.67,4Z"},n={10:"mdi:battery-charging-10",20:"mdi:battery-charging-20",30:"mdi:battery-charging-30",40:"mdi:battery-charging-40",50:"mdi:battery-charging-50",60:"mdi:battery-charging-60",70:"mdi:battery-charging-70",80:"mdi:battery-charging-80",90:"mdi:battery-charging-90",100:"mdi:battery-charging"},o=(e,t)=>{const i=Number(e);if(isNaN(i))return"off"===e?"mdi:battery":"on"===e?"mdi:battery-alert":"mdi:battery-unknown";const s=10*Math.round(i/10);return t&&i>=10?n[s]:t?"mdi:battery-charging-outline":i<=5?"mdi:battery-alert-variant-outline":a[s]},r=e=>{const t=Number(e);if(isNaN(t))return"M15.07,12.25L14.17,13.17C13.63,13.71 13.25,14.18 13.09,15H11.05C11.16,14.1 11.56,13.28 12.17,12.67L13.41,11.41C13.78,11.05 14,10.55 14,10C14,8.89 13.1,8 12,8A2,2 0 0,0 10,10H8A4,4 0 0,1 12,6A4,4 0 0,1 16,10C16,10.88 15.64,11.68 15.07,12.25M13,19H11V17H13M16.67,4H15V2H9V4H7.33A1.33,1.33 0 0,0 6,5.33V20.66C6,21.4 6.6,22 7.33,22H16.67C17.4,22 18,21.4 18,20.66V5.33C18,4.59 17.4,4 16.67,4Z";if(t<=5)return"M14 20H6V6H14M14.67 4H13V2H7V4H5.33C4.6 4 4 4.6 4 5.33V20.67C4 21.4 4.6 22 5.33 22H14.67C15.4 22 16 21.4 16 20.67V5.33C16 4.6 15.4 4 14.67 4M21 7H19V13H21V8M21 15H19V17H21V15Z";const i=10*Math.round(t/10);return s[i]}},76774:function(e,t,i){i.d(t,{q:function(){return a}});const a=(e,t)=>{const i=e.area_id;return i?t[i]:void 0}},15090:function(e,t,i){i.d(t,{nP:function(){return c},vB:function(){return r}});i(44114),i(26910),i(18111),i(22489),i(61701),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var a=i(22675),s=i(52220),n=i(71727),o=i(69093);const r={alarm_control_panel:["armed_away","armed_custom_bypass","armed_home","armed_night","armed_vacation","arming","disarmed","disarming","pending","triggered"],alert:["on","off","idle"],assist_satellite:["idle","listening","responding","processing"],automation:["on","off"],binary_sensor:["on","off"],button:[],calendar:["on","off"],camera:["idle","recording","streaming"],cover:["closed","closing","open","opening"],device_tracker:["home","not_home"],fan:["on","off"],humidifier:["on","off"],infrared:[],input_boolean:["on","off"],input_button:[],lawn_mower:["error","paused","mowing","returning","docked"],light:["on","off"],lock:["jammed","locked","locking","unlocked","unlocking","opening","open"],media_player:["off","on","idle","playing","paused","standby","buffering"],person:["home","not_home"],plant:["ok","problem"],radio_frequency:[],remote:["on","off"],scene:[],schedule:["on","off"],script:["on","off"],siren:["on","off"],sun:["above_horizon","below_horizon"],switch:["on","off"],timer:["active","idle","paused"],update:["on","off"],vacuum:["cleaning","docked","error","idle","paused","returning"],valve:["closed","closing","open","opening"],weather:["clear-night","cloudy","exceptional","fog","hail","lightning-rainy","lightning","partlycloudy","pouring","rainy","snowy-rainy","snowy","sunny","windy-variant","windy"]},l={alarm_control_panel:{code_format:["number","text"]},binary_sensor:{device_class:["battery","battery_charging","co","cold","connectivity","door","garage_door","gas","heat","light","lock","moisture","motion","moving","occupancy","opening","plug","power","presence","problem","running","safety","smoke","sound","tamper","update","vibration","window"]},button:{device_class:["restart","update"]},camera:{frontend_stream_type:["hls","web_rtc"]},climate:{hvac_action:["off","idle","preheating","defrosting","heating","cooling","drying","fan"]},cover:{device_class:["awning","blind","curtain","damper","door","garage","gate","shade","shutter","window"]},device_tracker:{source_type:["bluetooth","bluetooth_le","gps","router"]},fan:{direction:["forward","reverse"]},humidifier:{device_class:["humidifier","dehumidifier"],action:["off","idle","humidifying","drying"]},media_player:{device_class:["tv","speaker","receiver"],media_content_type:["album","app","artist","channel","channels","composer","contributing_artist","episode","game","genre","image","movie","music","playlist","podcast","season","track","tvshow","url","video"],repeat:["off","one","all"]},number:{device_class:["temperature"]},sensor:{device_class:["apparent_power","aqi","battery","carbon_dioxide","carbon_monoxide","current","date","duration","energy","frequency","gas","humidity","illuminance","monetary","nitrogen_dioxide","nitrogen_monoxide","nitrous_oxide","ozone","ph","pm1","pm10","pm25","pm4","power_factor","power","pressure","reactive_power","signal_strength","sulphur_dioxide","temperature","timestamp","uptime","volatile_organic_compounds","volatile_organic_compounds_parts","voltage","volume_flow_rate"],state_class:["measurement","total","total_increasing"]},switch:{device_class:["outlet","switch"]},update:{device_class:["firmware"]},water_heater:{away_mode:["on","off"]}},c=(e,t,i=void 0)=>{const c=(0,o.t)(t),d=[];switch(d.push(...((e,t,i)=>{const o=[];switch(i||o.push(a.Hh,a.HV),!i&&t in r?o.push(...r[t]):i&&t in l&&i in l[t]&&o.push(...l[t][i]),t){case"device_tracker":case"person":i||o.push(...Object.entries(e.states).filter(([e,t])=>"zone"===(0,n.m)(e)&&"zone.home"!==e&&t.attributes.friendly_name).map(([e,t])=>t.attributes.friendly_name).sort((t,i)=>(0,s.xL)(t,i,e.locale.language)))}return o})(e,c,i)),c){case"climate":i?"fan_mode"===i?d.push(...t.attributes.fan_modes):"preset_mode"===i?d.push(...t.attributes.preset_modes):"swing_mode"===i?d.push(...t.attributes.swing_modes):"swing_horizontal_mode"===i&&d.push(...t.attributes.swing_horizontal_modes):d.push(...t.attributes.hvac_modes);break;case"event":"event_type"===i&&d.push(...t.attributes.event_types);break;case"fan":"preset_mode"===i&&d.push(...t.attributes.preset_modes);break;case"humidifier":"mode"===i&&d.push(...t.attributes.available_modes);break;case"input_select":case"select":i||d.push(...t.attributes.options);break;case"light":"effect"===i&&t.attributes.effect_list?d.push(...t.attributes.effect_list):"color_mode"===i&&t.attributes.supported_color_modes&&d.push(...t.attributes.supported_color_modes);break;case"media_player":"sound_mode"===i?d.push(...t.attributes.sound_mode_list):"source"===i&&d.push(...t.attributes.source_list);break;case"remote":"current_activity"===i&&d.push(...t.attributes.activity_list);break;case"sensor":i||"enum"!==t.attributes.device_class||d.push(...t.attributes.options);break;case"vacuum":"fan_speed"===i&&d.push(...t.attributes.fan_speed_list);break;case"water_heater":i&&"operation_mode"!==i||d.push(...t.attributes.operation_list)}return[...new Set(d)]}},79791:function(e,t,i){i.d(t,{L:function(){return a}});const a=(e,t=2)=>Math.round(e*10**t)/10**t},31290:function(e,t,i){i.d(t,{n:function(){return a}});i(27495),i(25440);const a=e=>e.replace(/^_*(.)|_+(.)/g,(e,t,i)=>t?t.toUpperCase():" "+i.toUpperCase())},22533:function(e,t,i){i.d(t,{i:function(){return s}});var a=i(52943);const s=(e,t)=>(e=>{switch(e){case"de":case"lb":return!0;default:return!1}})(t)?(0,a.Z)(e):e.toLocaleLowerCase(t)},67258:function(e,t,i){i.d(t,{d:function(){return a}});const a=e=>{switch(e.language){case"cs":case"de":case"fi":case"fr":case"sk":case"sv":return" ";default:return""}}},8549:function(e,t,i){i.d(t,{A:function(){return s}});var a=i(67258);const s=(e,t)=>"°"===e?"":t&&"%"===e?(0,a.d)(t):" "},72945:function(e,t,i){var a=i(40445),s=i(5124),n=i(67576),o=i(96986);i(47680);let r,l=e=>e;class c extends s.WF{render(){var e;return this.batteryStateObj?(0,s.qy)(r||(r=l` <ha-icon .icon="${0}"></ha-icon> `),(0,o.LR)(this.batteryStateObj.state,"on"===(null===(e=this.batteryChargingStateObj)||void 0===e?void 0:e.state))):s.s6}}(0,a.Cg)([(0,n.MZ)({attribute:!1})],c.prototype,"batteryStateObj",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],c.prototype,"batteryChargingStateObj",void 0),c=(0,a.Cg)([(0,n.EM)("ha-battery-icon")],c)},76776:function(e,t,i){i(62953);var a=i(40445),s=i(5124),n=i(67576);let o,r,l,c=e=>e;class d extends s.WF{render(){return(0,s.qy)(o||(o=c` ${0} <slot></slot> `),this.header?(0,s.qy)(r||(r=c`<h1 class="card-header">${0}</h1>`),this.header):s.s6)}constructor(...e){super(...e),this.raised=!1}}d.styles=(0,s.AH)(l||(l=c`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, var(--ha-font-size-2xl));letter-spacing:-.012em;line-height:var(--ha-line-height-expanded);padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4);display:block;margin-block-start:0;margin-block-end:0;font-weight:var(--ha-font-weight-normal)}
    :host
      ::slotted(
        .card-content:not(:nth-child(1 of .card-content, .card-header))
      ),
    slot:not(:first-child)::slotted(.card-content) {
      padding-top: 0;
      margin-top: calc(var(--ha-space-2) * -1);
    }
    :host ::slotted(.card-content){padding:var(--ha-space-4)}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:var(--ha-space-2)}`)),(0,a.Cg)([(0,n.MZ)()],d.prototype,"header",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],d.prototype,"raised",void 0),d=(0,a.Cg)([(0,n.EM)("ha-card")],d)},43661:function(e,t,i){i.r(t),i.d(t,{HaIconNext:function(){return r}});i(62953);var a=i(40445),s=i(67576),n=i(63091),o=i(67094);class r extends o.HaSvgIcon{constructor(...e){super(...e),this.path="rtl"===n.G.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}}(0,a.Cg)([(0,s.MZ)()],r.prototype,"path",void 0),r=(0,a.Cg)([(0,s.EM)("ha-icon-next")],r)},59646:function(e,t,i){i.a(e,async function(e,t){try{i(62953);var a=i(40445),s=i(29344),n=i(5124),o=i(67576),r=i(88360),l=e([s]);s=(l.then?(await l)():l)[0];let c,d=e=>e;class h extends s.A{updated(e){super.updated(e),e.has("haptic")&&(this.haptic?this.addEventListener("change",this._forwardHaptic):this.removeEventListener("change",this._forwardHaptic))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",this._forwardHaptic)}static get styles(){return[s.A.styles,(0,n.AH)(c||(c=d`:host{--wa-form-control-toggle-size:var(--ha-switch-size, 24px);--wa-form-control-required-content:var(
            --ha-switch-required-marker,
            var(--ha-input-required-marker, "*")
          );--wa-form-control-required-content-offset:var(
            --ha-switch-required-marker-offset,
            0.1rem
          );--thumb-size:var(--ha-switch-thumb-size, 18px);--width:var(--ha-switch-width, 48px)}label{position:relative;height:max(var(--thumb-size),var(--wa-form-control-toggle-size))}label::before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;min-width:var(--ha-switch-min-touch-size,40px);min-height:var(--ha-switch-min-touch-size,40px)}label.disabled::before{pointer-events:none}.switch{background-color:var(--ha-switch-background-color,var(--ha-color-fill-disabled-quiet-resting));border-color:var(--ha-switch-border-color,var(--ha-color-border-neutral-normal))}label:not(.disabled) .input:focus-visible~.switch,label:not(.disabled):hover .switch{background-color:var(--ha-switch-background-color-hover,var(--ha-switch-background-color,var(--ha-color-fill-disabled-quiet-hover)))}.checked .switch{background-color:var(--ha-switch-checked-background-color,var(--ha-color-fill-primary-normal-resting));border-color:var(--ha-switch-checked-border-color,var(--ha-color-border-primary-loud))}label:not(.disabled).checked .input:focus-visible~.switch,label:not(.disabled).checked:hover .switch{background-color:var(--ha-switch-checked-background-color-hover,var(--ha-switch-checked-background-color,var(--ha-color-fill-primary-normal-hover)));border-color:var(--ha-switch-checked-border-color-hover,var(--ha-switch-checked-border-color,var(--ha-color-border-primary-loud)))}.switch .thumb{background-color:var(--ha-switch-thumb-background-color,var(--ha-color-on-neutral-normal));border-color:var(--ha-switch-thumb-border-color,var(--ha-color-on-neutral-normal));border-style:var(--wa-form-control-border-style);border-width:var(--wa-form-control-border-width);box-shadow:var(--ha-switch-thumb-box-shadow,var(--ha-box-shadow-s))}label:not(.disabled) .input:focus-visible~.switch .thumb,label:not(.disabled):hover .switch .thumb{background-color:var(--ha-switch-thumb-background-color-hover,var(--ha-switch-thumb-background-color,var(--ha-color-on-neutral-normal)));border-color:var(--ha-switch-thumb-border-color-hover,var(--ha-switch-thumb-border-color,var(--ha-color-on-neutral-normal)))}.checked .switch .thumb{background-color:var(--ha-switch-checked-thumb-background-color,var(--ha-color-on-primary-normal));border-color:var(--ha-switch-checked-thumb-border-color,var(--ha-color-on-primary-normal))}label:not(.disabled).checked .input:focus-visible~.switch .thumb,label:not(.disabled).checked:hover .switch .thumb{background-color:var(--ha-switch-checked-thumb-background-color-hover,var(--ha-switch-checked-thumb-background-color,var(--ha-color-on-primary-normal)));border-color:var(--ha-switch-checked-thumb-border-color-hover,var(--ha-switch-checked-thumb-border-color,var(--ha-color-on-primary-normal)))}label.disabled{opacity:var(--ha-switch-disabled-opacity, .3);cursor:not-allowed}label:not(.disabled) .input:focus-visible~.switch .thumb{outline:0;outline-offset:none}label:not(.disabled) .input:focus-visible~.switch{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}:host(:empty) slot.label{display:none}`))]}constructor(...e){super(...e),this.haptic=!1,this._forwardHaptic=()=>{(0,r.j)(this,"light")}}}(0,a.Cg)([(0,o.MZ)({type:Boolean})],h.prototype,"haptic",void 0),h=(0,a.Cg)([(0,o.EM)("ha-switch")],h),t()}catch(c){t(c)}})},1671:function(e,t,i){i(62953);var a=i(40445),s=i(5124),n=i(67576),o=i(63672),r=(i(54276),i(28170));let l,c,d,h,u=e=>e;class p extends r.o{activate(){var e;null===(e=this._item)||void 0===e||e.click()}_renderBase(e){return void 0!==this.href?(0,s.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(),e):(0,s.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(),e)}_renderRipple(){return(0,s.qy)(d||(d=u`<ha-ripple part="ripple" for="item" ?disabled="${0}"></ha-ripple>`),this.disabled)}constructor(...e){super(...e),this.interactive=!0}}p.styles=[r.o.styles,(0,s.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,a.Cg)([(0,n.MZ)({type:String})],p.prototype,"href",void 0),(0,a.Cg)([(0,n.MZ)({type:String})],p.prototype,"target",void 0),(0,a.Cg)([(0,n.MZ)({type:String})],p.prototype,"rel",void 0),(0,a.Cg)([(0,n.MZ)({type:String})],p.prototype,"download",void 0),(0,a.Cg)([(0,n.P)("#item")],p.prototype,"_item",void 0),p=(0,a.Cg)([(0,n.EM)("ha-list-item-button")],p)},47819:function(e,t,i){i(62953);var a=i(40445),s=i(5124),n=i(67576),o=i(63672),r=i(50723);let l,c=e=>e;class d extends r.N{render(){var e;return(0,s.qy)(l||(l=c`<nav part="nav" aria-label="${0}"> <div part="base" class="base" role="list"> <slot></slot> </div> </nav>`),(0,o.J)(null!==(e=this.ariaLabel)&&void 0!==e?e:void 0))}constructor(...e){super(...e),this.hostRole="",this.ariaLabel=null}}(0,a.Cg)([(0,n.MZ)({type:String,attribute:"aria-label",reflect:!1})],d.prototype,"ariaLabel",void 0),d=(0,a.Cg)([(0,n.EM)("ha-list-nav")],d)},62351:function(e,t,i){i.d(t,{KC:function(){return d},Vy:function(){return l},ds:function(){return n},ew:function(){return r},g5:function(){return c},tl:function(){return o}});var a=i(82286),s=i(22675);const n=(e,t,i)=>e.connection.subscribeMessage(i,{type:"assist_satellite/intercept_wake_word",entity_id:t}),o=(e,t)=>e.callWS({type:"assist_satellite/test_connection",entity_id:t}),r=(e,t,i)=>e.callService("assist_satellite","announce",i,{entity_id:t}),l=(e,t)=>e.callWS({type:"assist_satellite/get_configuration",entity_id:t}),c=(e,t,i)=>e.callWS({type:"assist_satellite/set_wake_words",entity_id:t,wake_word_ids:i}),d=e=>e&&e.state!==s.Hh&&(0,a.$)(e,1)},10897:function(e,t,i){i.d(t,{C4:function(){return c},CK:function(){return l},FX:function(){return v},UC:function(){return p},_Z:function(){return b},bT:function(){return y},j4:function(){return f},sd:function(){return n},su:function(){return r},vc:function(){return _},w8:function(){return u},wv:function(){return h},y3:function(){return g},zS:function(){return o}});i(3362);var a=i(3931),s=i(82e3);const n=[1,2,3,4,6,8],o="web_rtc",r=(e,t,i)=>`${e}&width=${t}&height=${i}`,l=e=>e.attributes.access_token?`/api/camera_proxy_stream/${e.entity_id}?token=${e.attributes.access_token}`:void 0,c=async(e,t,i,s)=>{const n=await(0,a.U)("_cameraTmbUrl",9e3,d,e,t);return r(n,i,s)},d=async(e,t)=>{const i=await(0,s.e0)(e,`/api/camera_proxy/${t}`);return e.hassUrl(i.path)},h=async(e,t,i)=>{const a={type:"camera/stream",entity_id:t};i&&(a.format=i);const s=await e.callWS(a);return s.url=e.hassUrl(s.url),s},u=(e,t,i,a)=>e.connection.subscribeMessage(a,{type:"camera/webrtc/offer",entity_id:t,offer:i}),p=(e,t,i,a)=>e.callWS({type:"camera/webrtc/candidate",entity_id:t,session_id:i,candidate:a}),g=(e,t)=>e.callWS({type:"camera/get_prefs",entity_id:t}),v=(e,t,i)=>e.callWS(Object.assign({type:"camera/update_prefs",entity_id:t},i)),m="media-source://camera/",f=e=>e.startsWith(m),_=e=>e.substring(22),b=async(e,t)=>e.callWS({type:"camera/capabilities",entity_id:t}),y=async(e,t)=>e.callWS({type:"camera/webrtc/get_client_config",entity_id:t})},77001:function(e,t,i){i.d(t,{Dc:function(){return s},_H:function(){return n},fq:function(){return o},iS:function(){return a}});i(74423),i(18111),i(7588),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);const a=e=>{const t={};return Object.entries(e).forEach(([e,i])=>{t[e]={value:i.value,items:i.items instanceof Set?Array.from(i.items):i.items}}),t},s=e=>{const t={};return Object.entries(e).forEach(([e,i])=>{t[e]={value:i.value,items:Array.isArray(i.items)?new Set(i.items):i.items}}),t},n=(e,t,i)=>e===i&&Array.isArray(t.value)&&t.value.length,o=(e,t,i)=>(e===i||i.includes(e))&&t.items},31422:function(e,t,i){i.d(t,{_o:function(){return h},oG:function(){return u},pq:function(){return d}});i(74423),i(18111),i(81148),i(22489),i(61701),i(13579);var a=i(65522),s=i(37981),n=i(71727),o=i(76774),r=i(15638),l=i(95350),c=i(58594);const d=(e,t,i,n,l,c,d,h)=>{const u=(0,o.q)(e,t),p=e.via_device_id?i[e.via_device_id]:void 0,g=p?(0,s.T)(p,l,n,h):void 0,v=p?(0,o.q)(p,t):void 0,m=v?(0,a.A)(v):void 0,f=(0,r.qC)(c,d.translations);return{areaName:u?(0,a.A)(u):m?`${m}${f?" ◂ ":" ▸ "}${g}`:g||void 0,viaDeviceName:g,viaDeviceAreaName:m}},h=[{name:"search_labels.deviceName",weight:10},{name:"search_labels.areaName",weight:8},{name:"search_labels.domainName",weight:4},{name:"search_labels.domain",weight:4},{name:"search_labels.viaDeviceName",weight:3},{name:"search_labels.viaDeviceArea",weight:3}],u=(e,t,i,a,o,r,h,u,p,g="")=>{const v=Object.values(e.devices),m=Object.values(e.entities);let f={};(i||a||o||h)&&(f=(0,c.g2)(m));let _=v.filter(e=>e.id===p||!e.disabled_by);i&&(_=_.filter(e=>{const t=f[e.id];return!(!t||!t.length)&&f[e.id].some(e=>i.includes((0,n.m)(e.entity_id)))})),a&&(_=_.filter(e=>{const t=f[e.id];return!t||!t.length||m.every(e=>!a.includes((0,n.m)(e.entity_id)))})),u&&(_=_.filter(e=>!u.includes(e.id))),o&&(_=_.filter(t=>{const i=f[t.id];return!(!i||!i.length)&&f[t.id].some(t=>{const i=e.states[t.entity_id];return!!i&&(i.attributes.device_class&&o.includes(i.attributes.device_class))})})),h&&(_=_.filter(t=>{const i=f[t.id];return!(!i||!i.length)&&i.some(t=>{const i=e.states[t.entity_id];return!!i&&h(i)})})),r&&(_=_.filter(e=>e.id===p||r(e)));return _.map(i=>{const a=(0,s.T)(i,e.localize,e.states,f[i.id]),{areaName:n,viaDeviceName:o,viaDeviceAreaName:r}=d(i,e.areas,e.devices,e.states,e.localize,e.language,e.translationMetadata,i.via_device_id?f[i.via_device_id]:void 0),c=i.primary_config_entry?null==t?void 0:t[i.primary_config_entry]:void 0,h=null==c?void 0:c.domain,u=h?(0,l.p$)(e.localize,h):void 0,p=a||e.localize("ui.components.device-picker.unnamed_device");return{id:`${g}${i.id}`,label:"",primary:p,secondary:n,domain:null==c?void 0:c.domain,domain_name:u,search_labels:{deviceName:a,areaName:n||null,domain:h||null,domainName:u||null,viaDeviceName:o||null,viaDeviceArea:r||null},sorting_label:[p,n,u].filter(Boolean).join("_")}})}},96204:function(e,t,i){i.d(t,{Dh:function(){return a},It:function(){return o},WV:function(){return n},g9:function(){return s}});const a=e=>e.callWS({type:"diagnostics/list"}),s=(e,t)=>e.callWS({type:"diagnostics/get",domain:t}),n=e=>`/api/diagnostics/config_entry/${e}`,o=(e,t)=>`/api/diagnostics/config_entry/${e}/device/${t}`},16869:function(e,t,i){i.d(t,{B:function(){return n},g:function(){return s}});var a;i(74423),i(27495);const s=window.externalAppV2||window.externalApp||(null===(a=window.webkit)||void 0===a||null===(a=a.messageHandlers)||void 0===a?void 0:a.getExternalAuth)||location.search.includes("external_auth=1"),n=window.externalApp||window.externalAppV2},86531:function(e,t,i){i.a(e,async function(e,a){try{i.d(t,{$O:function(){return _},a$:function(){return w},cj:function(){return u},dG:function(){return f},gM:function(){return m},gd:function(){return g},k$:function(){return y},rc:function(){return $}});i(74423),i(3362),i(27495),i(25440),i(62953);var s=i(46190),n=i(71727),o=i(69093),r=i(22533),l=i(22675),c=i(25064),d=e([c]);c=(d.then?(await d)():d)[0];const h="ui.components.logbook.messages",u=["counter","proximity"],p={triggered_by_numeric_state_of:"numeric state of",triggered_by_state_of:"state of",triggered_by_event:"event",triggered_by_time_pattern:"time pattern",triggered_by_time:"time",triggered_by_homeassistant_stopping:"ioBroker stopping",triggered_by_homeassistant_starting:"ioBroker starting"},g=async(e,t,i)=>v(e,t,void 0,void 0,i),v=(e,t,i,a,s,n)=>{if((a||n)&&(!a||0===a.length)&&(!n||0===n.length))return Promise.resolve([]);const o={type:"logbook/get_events",start_time:t};return i&&(o.end_time=i),null!=a&&a.length&&(o.entity_ids=a),null!=n&&n.length&&(o.device_ids=n),s&&(o.context_id=s),e.callWS(o)},m=(e,t,i,a,s,n,o)=>{if((n||o)&&(!n||0===n.length)&&(!o||0===o.length))return Promise.reject("No entities or devices");const r={type:"logbook/event_stream",start_time:i,end_time:a};return null!=n&&n.length&&(r.entity_ids=n),null!=o&&o.length&&(r.device_ids=o),e.connection.subscribeMessage(e=>t(e,s),r)},f=(e,t)=>({entity_id:e.entity_id,state:t,attributes:{device_class:null==e?void 0:e.attributes.device_class,source_type:null==e?void 0:e.attributes.source_type,has_date:null==e?void 0:e.attributes.has_date,has_time:null==e?void 0:e.attributes.has_time,entity_picture_local:s.oL.has((0,n.m)(e.entity_id))||null==e?void 0:e.attributes.entity_picture_local,entity_picture:s.oL.has((0,n.m)(e.entity_id))||null==e?void 0:e.attributes.entity_picture}}),_=(e,t)=>{for(const i of Object.keys(p)){const a=p[i];if(t.startsWith(a))return t.replace(a,`${e(`ui.components.logbook.${i}`)}`)}return t},b={triggered_by_numeric_state_of:"numeric_state_of",triggered_by_state_of:"state_of",triggered_by_event:"event",triggered_by_time_pattern:"time_pattern",triggered_by_time:"time",triggered_by_homeassistant_stopping:"homeassistant_stopping",triggered_by_homeassistant_starting:"homeassistant_starting"},y=(e,t)=>{for(const i of Object.keys(p)){const a=p[i];if(t.startsWith(a)){const s=b[i];return t.replace(a,`${e(`ui.components.logbook.${s}`)}`)}}return t},w=(e,t,i,a,s)=>{switch(s){case"device_tracker":case"person":return"not_home"===i?t(`${h}.was_away`):"home"===i?t(`${h}.was_at_home`):t(`${h}.was_at_state`,{state:i});case"sun":return t("above_horizon"===i?`${h}.rose`:`${h}.set`);case"binary_sensor":{const s="on"===i,n="off"===i,o=a.attributes.device_class;if(o&&(s||n))return t(`${h}.${s?"detected_device_classes":"cleared_device_classes"}.${o}`,{device_class:(0,r.i)(t(`component.binary_sensor.entity_component.${o}.name`)||o,e.language)})||t(`${h}.${s?"detected_device_class":"cleared_device_class"}`,{device_class:(0,r.i)(t(`component.binary_sensor.entity_component.${o}.name`)||o,e.language)});break}case"cover":switch(i){case"open":return t(`${h}.was_opened`);case"opening":return t(`${h}.is_opening`);case"closing":return t(`${h}.is_closing`);case"closed":return t(`${h}.was_closed`)}break;case"event":return t(`${h}.detected_event_no_type`);case"lock":switch(i){case"unlocked":return t(`${h}.was_unlocked`);case"locking":return t(`${h}.is_locking`);case"unlocking":return t(`${h}.is_unlocking`);case"opening":return t(`${h}.is_opening`);case"open":return t(`${h}.is_opened`);case"locked":return t(`${h}.was_locked`);case"jammed":return t(`${h}.is_jammed`)}}return"on"===i?t(`${h}.turned_on`):"off"===i?t(`${h}.turned_off`):i===l.HV?t(`${h}.became_unknown`):i===l.Hh?t(`${h}.became_unavailable`):e.localize(`${h}.changed_to_state`,{state:a?e.formatEntityState(a,i):i})},$=(e,t=[])=>{const i=(0,o.t)(e);return!(u.includes(i)||"sensor"===i&&(0,c.Fp)(i,e,void 0,t))};a()}catch(h){a(h)}})},35952:function(e,t,i){function a(e){return"strategy"in e}i.d(t,{Dz:function(){return s},Wu:function(){return a},ql:function(){return n}});const s=(e,t,i)=>e.sendMessagePromise({type:"lovelace/config",url_path:t,force:i}),n=(e,t,i)=>e.callWS({type:"lovelace/config/save",url_path:t,config:i})},71730:function(e,t,i){i.d(t,{A_:function(){return o},SJ:function(){return a},mQ:function(){return n},n6:function(){return s}});const a=e=>e.callWS({type:"lovelace/dashboards/list"}),s=(e,t)=>e.callWS(Object.assign({type:"lovelace/dashboards/create"},t)),n=(e,t,i)=>e.callWS(Object.assign({type:"lovelace/dashboards/update",dashboard_id:t},i)),o=(e,t)=>e.callWS({type:"lovelace/dashboards/delete",dashboard_id:t})},45291:function(e,t,i){i.d(t,{IP:function(){return a},Iu:function(){return h},J_:function(){return n},O9:function(){return r},b$:function(){return c},bH:function(){return o},c8:function(){return d},wi:function(){return l}});i(18111),i(20116),i(62953);const a="custom:",s=window;"customCards"in s||(s.customCards=[]),"customCardFeatures"in s||(s.customCardFeatures=[]),"customBadges"in s||(s.customBadges=[]),"customTileFeatures"in s||(s.customTileFeatures=[]);const n=s.customCards,o=()=>[...s.customCardFeatures,...s.customTileFeatures],r=s.customBadges,l=e=>n.find(t=>t.type===e),c=e=>r.find(t=>t.type===e),d=e=>e.startsWith(a),h=e=>e.slice(a.length)},53072:function(e,t,i){i.d(t,{$6:function(){return f},EC:function(){return v},ET:function(){return m},H1:function(){return g},HN:function(){return w},Im:function(){return k},QI:function(){return $},Un:function(){return b},Xm:function(){return y},ce:function(){return C},fh:function(){return x},ie:function(){return A},mm:function(){return _},vj:function(){return p}});i(44114);var a=i(47129),s=i(82286),n=i(22675),o=i(52069);const r="M11,14C12,14 13.05,14.16 14.2,14.44C13.39,15.31 13,16.33 13,17.5C13,18.39 13.25,19.23 13.78,20H3V18C3,16.81 3.91,15.85 5.74,15.12C7.57,14.38 9.33,14 11,14M11,12C9.92,12 9,11.61 8.18,10.83C7.38,10.05 7,9.11 7,8C7,6.92 7.38,6 8.18,5.18C9,4.38 9.92,4 11,4C12.11,4 13.05,4.38 13.83,5.18C14.61,6 15,6.92 15,8C15,9.11 14.61,10.05 13.83,10.83C13.05,11.61 12.11,12 11,12M18.5,10H20L22,10V12H20V17.5A2.5,2.5 0 0,1 17.5,20A2.5,2.5 0 0,1 15,17.5A2.5,2.5 0 0,1 17.5,15C17.86,15 18.19,15.07 18.5,15.21V10Z",l="M14,19H18V5H14M6,19H10V5H6V19Z",c="M8,5.14V19.14L19,12.14L8,5.14Z",d="M13,3H11V13H13V3M17.83,5.17L16.41,6.59C18.05,7.91 19,9.9 19,12A7,7 0 0,1 12,19C8.14,19 5,15.88 5,12C5,9.91 5.95,7.91 7.58,6.58L6.17,5.17C2.38,8.39 1.92,14.07 5.14,17.86C8.36,21.64 14.04,22.1 17.83,18.88C19.85,17.17 21,14.65 21,12C21,9.37 19.84,6.87 17.83,5.17Z",h="M18,18H6V6H18V18Z",u="M8.16,3L6.75,4.41L9.34,7H4C2.89,7 2,7.89 2,9V19C2,20.11 2.89,21 4,21H20C21.11,21 22,20.11 22,19V9C22,7.89 21.11,7 20,7H14.66L17.25,4.41L15.84,3L12,6.84L8.16,3M4,9H17V19H4V9M19.5,9A1,1 0 0,1 20.5,10A1,1 0 0,1 19.5,11A1,1 0 0,1 18.5,10A1,1 0 0,1 19.5,9M19.5,12A1,1 0 0,1 20.5,13A1,1 0 0,1 19.5,14A1,1 0 0,1 18.5,13A1,1 0 0,1 19.5,12Z";var p=function(e){return e[e.PAUSE=1]="PAUSE",e[e.SEEK=2]="SEEK",e[e.VOLUME_SET=4]="VOLUME_SET",e[e.VOLUME_MUTE=8]="VOLUME_MUTE",e[e.PREVIOUS_TRACK=16]="PREVIOUS_TRACK",e[e.NEXT_TRACK=32]="NEXT_TRACK",e[e.TURN_ON=128]="TURN_ON",e[e.TURN_OFF=256]="TURN_OFF",e[e.PLAY_MEDIA=512]="PLAY_MEDIA",e[e.VOLUME_STEP=1024]="VOLUME_STEP",e[e.SELECT_SOURCE=2048]="SELECT_SOURCE",e[e.STOP=4096]="STOP",e[e.CLEAR_PLAYLIST=8192]="CLEAR_PLAYLIST",e[e.PLAY=16384]="PLAY",e[e.SHUFFLE_SET=32768]="SHUFFLE_SET",e[e.SELECT_SOUND_MODE=65536]="SELECT_SOUND_MODE",e[e.BROWSE_MEDIA=131072]="BROWSE_MEDIA",e[e.REPEAT_SET=262144]="REPEAT_SET",e[e.GROUPING=524288]="GROUPING",e}({});const g="browser",v={album:{icon:"M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12,16.5C9.5,16.5 7.5,14.5 7.5,12C7.5,9.5 9.5,7.5 12,7.5C14.5,7.5 16.5,9.5 16.5,12C16.5,14.5 14.5,16.5 12,16.5M12,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",layout:"grid"},app:{icon:"M21 2H3C1.9 2 1 2.9 1 4V20C1 21.1 1.9 22 3 22H21C22.1 22 23 21.1 23 20V4C23 2.9 22.1 2 21 2M21 7H3V4H21V7Z",layout:"grid",show_list_images:!0},artist:{icon:r,layout:"grid",show_list_images:!0},channel:{icon:u,thumbnail_ratio:"portrait",layout:"grid",show_list_images:!0},composer:{icon:"M11,4A4,4 0 0,1 15,8A4,4 0 0,1 11,12A4,4 0 0,1 7,8A4,4 0 0,1 11,4M11,6A2,2 0 0,0 9,8A2,2 0 0,0 11,10A2,2 0 0,0 13,8A2,2 0 0,0 11,6M11,13C12.1,13 13.66,13.23 15.11,13.69C14.5,14.07 14,14.6 13.61,15.23C12.79,15.03 11.89,14.9 11,14.9C8.03,14.9 4.9,16.36 4.9,17V18.1H13.04C13.13,18.8 13.38,19.44 13.76,20H3V17C3,14.34 8.33,13 11,13M18.5,10H20L22,10V12H20V17.5A2.5,2.5 0 0,1 17.5,20A2.5,2.5 0 0,1 15,17.5A2.5,2.5 0 0,1 17.5,15C17.86,15 18.19,15.07 18.5,15.21V10Z",layout:"grid",show_list_images:!0},contributing_artist:{icon:r,layout:"grid",show_list_images:!0},directory:{icon:"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",layout:"grid",show_list_images:!0},episode:{icon:u,layout:"grid",thumbnail_ratio:"portrait",show_list_images:!0},game:{icon:"M7,6H17A6,6 0 0,1 23,12A6,6 0 0,1 17,18C15.22,18 13.63,17.23 12.53,16H11.47C10.37,17.23 8.78,18 7,18A6,6 0 0,1 1,12A6,6 0 0,1 7,6M6,9V11H4V13H6V15H8V13H10V11H8V9H6M15.5,12A1.5,1.5 0 0,0 14,13.5A1.5,1.5 0 0,0 15.5,15A1.5,1.5 0 0,0 17,13.5A1.5,1.5 0 0,0 15.5,12M18.5,9A1.5,1.5 0 0,0 17,10.5A1.5,1.5 0 0,0 18.5,12A1.5,1.5 0 0,0 20,10.5A1.5,1.5 0 0,0 18.5,9Z",layout:"grid",thumbnail_ratio:"portrait"},genre:{icon:"M8.11,19.45C5.94,18.65 4.22,16.78 3.71,14.35L2.05,6.54C1.81,5.46 2.5,4.4 3.58,4.17L13.35,2.1L13.38,2.09C14.45,1.88 15.5,2.57 15.72,3.63L16.07,5.3L20.42,6.23H20.45C21.5,6.47 22.18,7.53 21.96,8.59L20.3,16.41C19.5,20.18 15.78,22.6 12,21.79C10.42,21.46 9.08,20.61 8.11,19.45V19.45M20,8.18L10.23,6.1L8.57,13.92V13.95C8,16.63 9.73,19.27 12.42,19.84C15.11,20.41 17.77,18.69 18.34,16L20,8.18M16,16.5C15.37,17.57 14.11,18.16 12.83,17.89C11.56,17.62 10.65,16.57 10.5,15.34L16,16.5M8.47,5.17L4,6.13L5.66,13.94L5.67,13.97C5.82,14.68 6.12,15.32 6.53,15.87C6.43,15.1 6.45,14.3 6.62,13.5L7.05,11.5C6.6,11.42 6.21,11.17 6,10.81C6.06,10.2 6.56,9.66 7.25,9.5C7.33,9.5 7.4,9.5 7.5,9.5L8.28,5.69C8.32,5.5 8.38,5.33 8.47,5.17M15.03,12.23C15.35,11.7 16.03,11.42 16.72,11.57C17.41,11.71 17.91,12.24 18,12.86C17.67,13.38 17,13.66 16.3,13.5C15.61,13.37 15.11,12.84 15.03,12.23M10.15,11.19C10.47,10.66 11.14,10.38 11.83,10.53C12.5,10.67 13.03,11.21 13.11,11.82C12.78,12.34 12.11,12.63 11.42,12.5C10.73,12.33 10.23,11.8 10.15,11.19M11.97,4.43L13.93,4.85L13.77,4.05L11.97,4.43Z",layout:"grid",show_list_images:!0},image:{icon:"M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z",layout:"grid",show_list_images:!0},movie:{icon:"M18,4L20,8H17L15,4H13L15,8H12L10,4H8L10,8H7L5,4H4A2,2 0 0,0 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V4H18Z",thumbnail_ratio:"portrait",layout:"grid",show_list_images:!0},music:{icon:"M21,3V15.5A3.5,3.5 0 0,1 17.5,19A3.5,3.5 0 0,1 14,15.5A3.5,3.5 0 0,1 17.5,12C18.04,12 18.55,12.12 19,12.34V6.47L9,8.6V17.5A3.5,3.5 0 0,1 5.5,21A3.5,3.5 0 0,1 2,17.5A3.5,3.5 0 0,1 5.5,14C6.04,14 6.55,14.12 7,14.34V6L21,3Z",show_list_images:!0},playlist:{icon:"M15,6H3V8H15V6M15,10H3V12H15V10M3,16H11V14H3V16M17,6V14.18C16.69,14.07 16.35,14 16,14A3,3 0 0,0 13,17A3,3 0 0,0 16,20A3,3 0 0,0 19,17V8H22V6H17Z",layout:"grid",show_list_images:!0},podcast:{icon:"M17,18.25V21.5H7V18.25C7,16.87 9.24,15.75 12,15.75C14.76,15.75 17,16.87 17,18.25M12,5.5A6.5,6.5 0 0,1 18.5,12C18.5,13.25 18.15,14.42 17.54,15.41L16,14.04C16.32,13.43 16.5,12.73 16.5,12C16.5,9.5 14.5,7.5 12,7.5C9.5,7.5 7.5,9.5 7.5,12C7.5,12.73 7.68,13.43 8,14.04L6.46,15.41C5.85,14.42 5.5,13.25 5.5,12A6.5,6.5 0 0,1 12,5.5M12,1.5A10.5,10.5 0 0,1 22.5,12C22.5,14.28 21.77,16.39 20.54,18.11L19.04,16.76C19.96,15.4 20.5,13.76 20.5,12A8.5,8.5 0 0,0 12,3.5A8.5,8.5 0 0,0 3.5,12C3.5,13.76 4.04,15.4 4.96,16.76L3.46,18.11C2.23,16.39 1.5,14.28 1.5,12A10.5,10.5 0 0,1 12,1.5M12,9.5A2.5,2.5 0 0,1 14.5,12A2.5,2.5 0 0,1 12,14.5A2.5,2.5 0 0,1 9.5,12A2.5,2.5 0 0,1 12,9.5Z",layout:"grid"},season:{icon:u,layout:"grid",thumbnail_ratio:"portrait",show_list_images:!0},track:{icon:"M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M13,13H11V18A2,2 0 0,1 9,20A2,2 0 0,1 7,18A2,2 0 0,1 9,16C9.4,16 9.7,16.1 10,16.3V11H13V13M13,9V3.5L18.5,9H13Z"},tv_show:{icon:u,layout:"grid",thumbnail_ratio:"portrait"},url:{icon:"M16.36,14C16.44,13.34 16.5,12.68 16.5,12C16.5,11.32 16.44,10.66 16.36,10H19.74C19.9,10.64 20,11.31 20,12C20,12.69 19.9,13.36 19.74,14M14.59,19.56C15.19,18.45 15.65,17.25 15.97,16H18.92C17.96,17.65 16.43,18.93 14.59,19.56M14.34,14H9.66C9.56,13.34 9.5,12.68 9.5,12C9.5,11.32 9.56,10.65 9.66,10H14.34C14.43,10.65 14.5,11.32 14.5,12C14.5,12.68 14.43,13.34 14.34,14M12,19.96C11.17,18.76 10.5,17.43 10.09,16H13.91C13.5,17.43 12.83,18.76 12,19.96M8,8H5.08C6.03,6.34 7.57,5.06 9.4,4.44C8.8,5.55 8.35,6.75 8,8M5.08,16H8C8.35,17.25 8.8,18.45 9.4,19.56C7.57,18.93 6.03,17.65 5.08,16M4.26,14C4.1,13.36 4,12.69 4,12C4,11.31 4.1,10.64 4.26,10H7.64C7.56,10.66 7.5,11.32 7.5,12C7.5,12.68 7.56,13.34 7.64,14M12,4.03C12.83,5.23 13.5,6.57 13.91,8H10.09C10.5,6.57 11.17,5.23 12,4.03M18.92,8H15.97C15.65,6.75 15.19,5.55 14.59,4.44C16.43,5.07 17.96,6.34 18.92,8M12,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,2Z"},video:{icon:"M17,10.5V7A1,1 0 0,0 16,6H4A1,1 0 0,0 3,7V17A1,1 0 0,0 4,18H16A1,1 0 0,0 17,17V13.5L21,17.5V6.5L17,10.5Z",layout:"grid",show_list_images:!0}},m=(e,t,i,a)=>e.callWS({type:"media_player/browse_media",entity_id:t,media_content_id:i,media_content_type:a}),f=e=>{let t=e.attributes.media_position;return"playing"!==e.state?t:(t+=(Date.now()-new Date(e.attributes.media_position_updated_at).getTime())/1e3,t<0?0:t)},_=e=>{let t;switch(e.attributes.media_content_type){case"music":case"image":t=e.attributes.media_artist;break;case"playlist":t=e.attributes.media_playlist||e.attributes.media_artist;break;case"tvshow":t=e.attributes.media_series_title,e.attributes.media_season&&(t+=" S"+e.attributes.media_season,e.attributes.media_episode&&(t+="E"+e.attributes.media_episode));break;case"channel":t=e.attributes.media_channel;break;default:t=e.attributes.app_name||""}return t},b=(e,t=!1)=>{if(!e)return;const i=e.state;if(i===n.Hh)return;const o=!0===e.attributes.assumed_state;if(!(0,a.a)(e)&&!o)return(0,s.$)(e,128)?[{icon:d,action:"turn_on"}]:void 0;const r=[];o&&(0,s.$)(e,128)&&r.push({icon:"M11,3H13V21H11V3Z",action:"turn_on"}),(0,s.$)(e,256)&&r.push({icon:o?"M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M12,19A7,7 0 0,1 5,12A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19Z":d,action:"turn_off"});const u=e.attributes;return("playing"===i||"paused"===i||o)&&(0,s.$)(e,32768)&&t&&r.push({icon:!0===u.shuffle?"M14.83,13.41L13.42,14.82L16.55,17.95L14.5,20H20V14.5L17.96,16.54L14.83,13.41M14.5,4L16.54,6.04L4,18.59L5.41,20L17.96,7.46L20,9.5V4M10.59,9.17L5.41,4L4,5.41L9.17,10.58L10.59,9.17Z":"M16,4.5V7H5V9H16V11.5L19.5,8M16,12.5V15H5V17H16V19.5L19.5,16",action:"shuffle_set"}),("playing"===i||"paused"===i||o)&&(0,s.$)(e,16)&&r.push({icon:"M6,18V6H8V18H6M9.5,12L18,6V18L9.5,12Z",action:"media_previous_track"}),!o&&("playing"===i&&((0,s.$)(e,1)||(0,s.$)(e,4096))||("paused"===i||"idle"===i)&&(0,s.$)(e,16384)||"on"===i&&((0,s.$)(e,16384)||(0,s.$)(e,1)))&&r.push({icon:"on"===i?"M3,5V19L11,12M13,19H16V5H13M18,5V19H21V5":"playing"!==i?c:(0,s.$)(e,1)?l:h,action:"playing"!==i?"media_play":(0,s.$)(e,1)?"media_pause":"media_stop"}),o&&(0,s.$)(e,16384)&&r.push({icon:c,action:"media_play"}),o&&(0,s.$)(e,1)&&r.push({icon:l,action:"media_pause"}),o&&(0,s.$)(e,4096)&&r.push({icon:h,action:"media_stop"}),("playing"===i||"paused"===i||o)&&(0,s.$)(e,32)&&r.push({icon:"M16,18H18V6H16M6,18L14.5,12L6,6V18Z",action:"media_next_track"}),("playing"===i||"paused"===i||o)&&(0,s.$)(e,262144)&&t&&r.push({icon:"all"===u.repeat?"M17,17H7V14L3,18L7,22V19H19V13H17M7,7H17V10L21,6L17,2V5H5V11H7V7Z":"one"===u.repeat?"M13,15V9H12L10,10V11H11.5V15M17,17H7V14L3,18L7,22V19H19V13H17M7,7H17V10L21,6L17,2V5H5V11H7V7Z":"M2,5.27L3.28,4L20,20.72L18.73,22L15.73,19H7V22L3,18L7,14V17H13.73L7,10.27V11H5V8.27L2,5.27M17,13H19V17.18L17,15.18V13M17,5V2L21,6L17,10V7H8.82L6.82,5H17Z",action:"repeat_set"}),r.length>0?r:void 0},y=e=>{if(void 0===e||e===1/0)return"";const t=Math.max(0,Math.floor(e)),i=Math.floor(t/3600),a=Math.floor(t%3600/60),s=t%60,n=e=>e.toString().padStart(2,"0");return i>0?`${n(i)}:${n(a)}:${n(s)}`:`${n(a)}:${n(s)}`},w=e=>{if(!e)return;const t=e.indexOf("?authSig=");let i=t>0?e.slice(0,t):e;return i.startsWith("http")&&(i=decodeURIComponent(i.split("/").pop())),i},$=(e,t,i)=>e.callService("media_player","volume_set",{entity_id:t,volume_level:i}),C=(e,t,i)=>e.callService("media_player",i,"shuffle_set"===i?{entity_id:t.entity_id,shuffle:!t.attributes.shuffle}:"repeat_set"===i?{entity_id:t.entity_id,repeat:"all"===t.attributes.repeat?"one":"off"===t.attributes.repeat?"all":"off"}:{entity_id:t.entity_id}),A=(e,t,i,a,s={})=>(!s.enqueue&&void 0===s.announce&&(0,o.ni)(i)&&(s.announce=!0),e.callService("media_player","play_media",Object.assign({entity_id:t,media_content_id:i,media_content_type:a},s))),k=(e,t,i)=>e.callService("media_player","join",{group_members:i},{entity_id:t}),x=(e,t)=>e.callService("media_player","unjoin",{},{entity_id:t})},81023:function(e,t,i){i.d(t,{L:function(){return n}});i(3362),i(62953);var a=i(1087);const s=()=>Promise.all([i.e(92769),i.e(34995),i.e(3283),i.e(81034),i.e(42635),i.e(94956),i.e(61339),i.e(26092),i.e(39005),i.e(8851),i.e(55076),i.e(92363),i.e(71493)]).then(i.bind(i,85027)),n=(e,t)=>{(0,a.r)(e,"show-dialog",{dialogTag:"ha-voice-assistant-setup-dialog",dialogImport:s,dialogParams:t})}},81310:function(e,t,i){i.a(e,async function(e,t){try{i(62953);var a=i(40445),s=i(5124),n=i(67576),o=i(6412),r=i(26218),l=i(91926),c=i(90248),d=i(2054),h=i(14503),u=e([c,d]);[c,d]=u.then?(await u)():u;let p,g,v,m,f,_=e=>e;class b extends s.WF{render(){var e;return(0,s.qy)(p||(p=_` <div class="toolbar ${0}"> <div class="toolbar-content"> ${0} <div class="main-title"> <slot name="header">${0}</slot> </div> <slot name="toolbar-icon"></slot> </div> </div> <div class="${0}" @scroll="${0}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `),(0,o.H)({narrow:this.narrow}),this.mainPage||null!==(e=history.state)&&void 0!==e&&e.root?(0,s.qy)(g||(g=_` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):this.backPath?(0,s.qy)(v||(v=_` <ha-icon-button-arrow-prev href="${0}" .hass="${0}"></ha-icon-button-arrow-prev> `),this.backPath,this.hass):(0,s.qy)(m||(m=_` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._backTapped),this.header,(0,o.H)({content:!0,"ha-scrollbar":this.scrollable,"not-scrollable":!this.scrollable}),this._saveScrollPos)}_saveScrollPos(e){this._savedScrollPos=e.target.scrollTop}_backTapped(){this.backCallback?this.backCallback():(0,l.OE)()}static get styles(){return[h.dp,(0,s.AH)(f||(f=_`:host{display:block;height:100%;background-color:var(--primary-background-color);overflow:hidden;position:relative}:host([narrow]){width:100%;position:fixed}.toolbar{background-color:var(--app-header-background-color);padding-top:var(--safe-area-inset-top);padding-right:var(--safe-area-inset-right)}:host([narrow]) .toolbar{padding-left:var(--safe-area-inset-left)}.toolbar-content{display:flex;align-items:center;font-size:var(--ha-font-size-xl);height:var(--header-height);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box;padding:8px 12px}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{display:flex;align-items:center;pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{margin-inline-start:var(--ha-space-6);line-height:var(--ha-line-height-normal);min-width:0;flex-grow:1;overflow-wrap:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.narrow .main-title{margin-inline-start:var(--ha-space-2)}.content{position:relative;width:calc(100% - var(--safe-area-inset-right,0px));height:calc(100% - 1px - var(--header-height,0px) - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));padding-bottom:var(--safe-area-inset-bottom,0px);margin-right:var(--safe-area-inset-right);overflow-y:auto;overflow:auto;-webkit-overflow-scrolling:touch}.content.not-scrollable{overflow:hidden;display:flex;flex-direction:column}:host([narrow]) .content{width:calc(100% - var(--safe-area-inset-left,0px) - var(--safe-area-inset-right,0px));margin-left:var(--safe-area-inset-left)}#fab{position:absolute;right:calc(16px + var(--safe-area-inset-right,0px));inset-inline-end:calc(16px + var(--safe-area-inset-right,0px));inset-inline-start:initial;bottom:calc(16px + var(--safe-area-inset-bottom,0px));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--ha-space-2);--ha-button-box-shadow:var(--ha-box-shadow-l)}:host([narrow]) #fab.tabs{bottom:calc(84px + var(--safe-area-inset-bottom,0px))}#fab[is-wide]{bottom:calc(24px + var(--safe-area-inset-bottom,0px));right:calc(24px + var(--safe-area-inset-right,0px));inset-inline-end:calc(24px + var(--safe-area-inset-right,0px));inset-inline-start:initial}`))]}constructor(...e){super(...e),this.mainPage=!1,this.narrow=!1,this.scrollable=!0}}(0,a.Cg)([(0,n.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)()],b.prototype,"header",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,attribute:"main-page"})],b.prototype,"mainPage",void 0),(0,a.Cg)([(0,n.MZ)({type:String,attribute:"back-path"})],b.prototype,"backPath",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],b.prototype,"backCallback",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],b.prototype,"narrow",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],b.prototype,"scrollable",void 0),(0,a.Cg)([(0,r.a)(".content")],b.prototype,"_savedScrollPos",void 0),(0,a.Cg)([(0,n.Ls)({passive:!0})],b.prototype,"_saveScrollPos",null),b=(0,a.Cg)([(0,n.EM)("hass-subpage")],b),t()}catch(p){t(p)}})},85728:function(e,t,i){i.a(e,async function(e,t){try{i(44114),i(18111),i(22489),i(7588),i(61701),i(62953);var a=i(40445),s=i(5124),n=i(67576),o=i(6412),r=i(75751),l=i(91450),c=i(18350),d=(i(76776),i(47680),i(8630),i(28732),i(85694)),h=i(42269),u=i(40747),p=i(12496),g=i(70384),v=e([c,g,d]);[c,g,d]=v.then?(await v)():v;let m,f,_,b,y,w,$,C,A,k=e=>e;class x extends s.WF{render(){if(!this.entities.length)return(0,s.qy)(m||(m=k` <ha-card outlined .header="${0}"> <div class="empty card-content"> ${0} </div> </ha-card> `),this.header,this.hass.localize("ui.panel.config.devices.entities.none"));const e=[],t=[];return this.entities.forEach(i=>{i.disabled_by?t.push(i):e.push(i)}),(0,s.qy)(f||(f=k` <ha-card outlined .header="${0}"> ${0} ${0} <div class="card-actions"> <ha-button appearance="plain" @click="${0}"> ${0} </ha-button> </div> </ha-card> `),this.header,e.length?(0,s.qy)(_||(_=k` <div id="entities" class="move-up"> <ha-list> ${0} </ha-list> </div> `),(0,r.u)(e,e=>e.entity_id,e=>this.hass.states[e.entity_id]?this._renderEntity(e):this._renderUnavailableEntity(e))):s.s6,t.length?(0,s.qy)(b||(b=k`<div class="${0}"> ${0} </div>`),(0,o.H)({"move-up":!e.length}),this.showHidden?(0,s.qy)(w||(w=k` <ha-list> ${0} </ha-list> <button class="show-more" @click="${0}"> ${0} </button> `),t.map(e=>this._renderUnavailableEntity(e)),this._toggleShowHidden,this.hass.localize("ui.panel.config.devices.entities.show_less")):(0,s.qy)(y||(y=k` <button class="show-more" @click="${0}"> ${0} </button> `),this._toggleShowHidden,this.hass.localize("ui.panel.config.devices.entities.disabled_entities",{count:t.length}))):s.s6,this._addToLovelaceView,this.hass.localize("ui.panel.config.devices.entities.add_entities_lovelace"))}_toggleShowHidden(){this.showHidden=!this.showHidden}_renderEntity(e){let t=e.stateName||this.deviceName;return e.hidden_by&&(t+=` (${this.hass.localize("ui.panel.config.devices.entities.hidden")})`),(0,s.qy)($||($=k`<div> ${0} </div>`),(0,g.g)(e.entity_id,t,this.hass))}_renderUnavailableEntity(e){const t=e.stateName||this.deviceName,i=(0,l.T)((0,d.u7)(this.hass,e));return(0,s.qy)(C||(C=k` <ha-list-item graphic="icon" class="disabled-entry" .entry="${0}" @click="${0}"> <ha-icon slot="graphic" .icon="${0}"></ha-icon> <div class="name">${0}</div> </ha-list-item> `),e,this._openEditEntry,i,t)}_openEditEntry(e){const t=e.currentTarget.entry;(0,h.p)(this,{entityId:t.entity_id})}_addToLovelaceView(){const e=this.entities.filter(e=>!e.disabled_by).map(e=>e.entity_id);(0,p.Q)(this,this.hass,(0,u.Bi)(this.hass,e,{title:this.deviceName}),(0,u.ZI)(e,{title:this.deviceName}),e)}constructor(...e){super(...e),this.showHidden=!1}}x.styles=(0,s.AH)(A||(A=k`:host{display:block}ha-icon{margin-left:-8px}.entity-id{color:var(--secondary-text-color)}.buttons{text-align:right;margin:0 0 0 8px}.disabled-entry{color:var(--secondary-text-color)}.move-up{margin-top:-13px}.move-up:has(> ha-list){margin-top:-24px}:not(.move-up)>ha-list{margin-top:-24px}.move-up+:not(:has(ha-list))>button.show-more,ha-list+button.show-more{margin-top:-12px}#entities>ha-list{margin:0 16px 0 8px}#entities>ha-list>ha-list-item{padding:0 16px 0 12px}.name{font-size:var(--ha-font-size-m)}.name:dir(rtl){margin-inline-start:8px}.empty{text-align:center}button.show-more{color:var(--primary-color);text-align:left;cursor:pointer;background:0 0;border-width:initial;border-style:none;border-color:initial;border-image:initial;padding:16px;font:inherit}button.show-more:focus{outline:0;text-decoration:underline}ha-list>*{margin:8px 0px}ha-list-item{height:40px;--mdc-ripple-color:transparent}.card-actions{padding:4px 16px 4px 4px}`)),(0,a.Cg)([(0,n.MZ)()],x.prototype,"header",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],x.prototype,"deviceName",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],x.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],x.prototype,"entities",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"show-hidden",type:Boolean})],x.prototype,"showHidden",void 0),x=(0,a.Cg)([(0,n.EM)("ha-device-entities-card")],x),t()}catch(m){t(m)}})},31005:function(e,t,i){i.a(e,async function(e,t){try{i(89463),i(74423),i(26910),i(18111),i(22489),i(61701),i(45367),i(92731),i(62953);var a=i(40445),s=i(35211),n=i(5124),o=i(67576),r=i(22786),l=i(36312),c=i(37981),d=i(52220),h=i(31290),u=i(6030),p=(i(76776),i(47680),i(23430)),g=i(22792),v=i(14503),m=e([p]);p=(m.then?(await m)():m)[0];let f,_,b,y,w,$,C,A,k,x,H,L,M,V,E,z,S,q=e=>e;class I extends n.WF{render(){const{map:e,ids:t}=this._labelsData(this._labelRegistry,this.device.labels,this.hass.locale.language);return(0,n.qy)(f||(f=q` <ha-card outlined .header="${0}"> <div class="card-content"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} <slot></slot> </div> <slot name="actions"></slot> </ha-card> `),this.hass.localize("ui.panel.config.devices.device_info",{type:this.hass.localize(`ui.panel.config.devices.type.${this.device.entry_type||"device"}_heading`)}),this.device.model?(0,n.qy)(_||(_=q`<div class="model"> ${0} ${0} </div>`),this.device.model,this.device.model_id?(0,n.qy)(b||(b=q`(${0})`),this.device.model_id):""):this.device.model_id?(0,n.qy)(y||(y=q`<div class="model">${0}</div>`),this.device.model_id):"",this.device.manufacturer?(0,n.qy)(w||(w=q` <div class="manuf"> ${0} </div> `),this.hass.localize("ui.panel.config.integrations.config_entry.manuf",{manufacturer:this.device.manufacturer})):"",this.device.via_device_id?(0,n.qy)($||($=q` <div class="extra-info"> ${0} <span class="hub"><a href="/config/devices/device/${0}">${0}</a></span> </div> `),this.hass.localize("ui.panel.config.integrations.config_entry.via"),this.device.via_device_id,this._computeDeviceNameDisplay(this.device.via_device_id)):"",this.device.sw_version?(0,n.qy)(C||(C=q` <div class="extra-info"> ${0} </div> `),this.hass.localize("ui.panel.config.integrations.config_entry."+("service"!==this.device.entry_type||this.device.hw_version?"firmware":"version"),{version:this.device.sw_version})):"",this.device.hw_version?(0,n.qy)(A||(A=q` <div class="extra-info"> ${0} </div> `),this.hass.localize("ui.panel.config.integrations.config_entry.hardware",{version:this.device.hw_version})):"",this.device.serial_number?(0,n.qy)(k||(k=q` <div class="extra-info"> ${0} </div> `),this.hass.localize("ui.panel.config.integrations.config_entry.serial_number",{serial_number:this.device.serial_number})):"",this._getAddresses().map(([e,t])=>(0,n.qy)(x||(x=q` <div class="extra-info"> ${0} </div> `),"bluetooth"===e&&(0,l.x)(this.hass.config,"bluetooth")?(0,n.qy)(H||(H=q`${0}: <a href="/config/bluetooth/advertisement-monitor?${0}">${0}</a>`),(0,h.n)(e),(0,u.KH)({address:t}),t.toUpperCase()):"mac"===e&&(0,l.x)(this.hass.config,"dhcp")?(0,n.qy)(L||(L=q`MAC: <a href="/config/dhcp?${0}">${0}</a>`),(0,u.KH)({mac_address:t}),t.toUpperCase()):(0,n.qy)(M||(M=q`${0}: ${0}`),"mac"===e?"MAC":(0,h.n)(e),t.toUpperCase()))),t.length>0?(0,n.qy)(V||(V=q` <div class="extra-info labels"> ${0} </div> `),t.map(t=>{const i=e.get(t);return(0,n.qy)(E||(E=q` <ha-label .color="${0}" .description="${0}"> ${0} ${0} </ha-label> `),null==i?void 0:i.color,null==i?void 0:i.description,null!=i&&i.icon?(0,n.qy)(z||(z=q`<ha-icon slot="icon" .icon="${0}"></ha-icon>`),i.icon):n.s6,(null==i?void 0:i.name)||t)})):n.s6)}_getAddresses(){return this.device.connections.filter(e=>["mac","bluetooth","zigbee"].includes(e[0]))}_computeDeviceNameDisplay(e){const t=this.hass.devices[e];return t?(0,c.T)(t,this.hass.localize,this.hass.states):`<${this.hass.localize("ui.panel.config.integrations.config_entry.unknown_via_device")}>`}static get styles(){return[v.RF,(0,n.AH)(S||(S=q`:host{display:block}ha-card{flex:1 0 100%;min-width:0}.device{width:30%}.labels{display:flex;flex-wrap:wrap;gap:var(--ha-space-1);width:100%;max-width:100%}.labels ha-label{min-width:0;max-width:100%;flex:0 1 auto}.extra-info{margin-top:var(--ha-space-2);word-wrap:break-word}.manuf,.model{color:var(--secondary-text-color);word-wrap:break-word}`))]}constructor(...e){super(...e),this.narrow=!1,this._labelsData=(0,r.A)((e,t,i)=>{const a=e?new Map(e.map(e=>[e.label_id,e])):new Map,s=[...t].sort((e,t)=>{var s,n;return(0,d.xL)((null===(s=a.get(e))||void 0===s?void 0:s.name)||e,(null===(n=a.get(t))||void 0===n?void 0:n.name)||t,i)});return{map:a,ids:s}})}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],I.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],I.prototype,"device",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],I.prototype,"narrow",void 0),(0,a.Cg)([(0,s.Fg)({context:g.HD,subscribe:!0}),(0,o.wk)()],I.prototype,"_labelRegistry",void 0),I=(0,a.Cg)([(0,o.EM)("ha-device-info-card")],I),t()}catch(f){t(f)}})},97605:function(e,t,i){i(26910),i(18111),i(22489),i(61701),i(62953);var a=i(40445),s=i(5124),n=i(67576),o=i(22786),r=i(37981),l=i(52220);i(76776),i(43661),i(28732);let c,d,h,u,p=e=>e;class g extends s.WF{render(){const e=this._viaDevices(this.deviceId,this.hass.devices);return 0===e.length?s.s6:(0,s.qy)(c||(c=p` <ha-card> <h1 class="card-header"> ${0} </h1> ${0} ${0} </ha-card> `),this.hass.localize("ui.panel.config.devices.connected_devices.heading"),(this._showAll?e:e.slice(0,10)).map(e=>(0,s.qy)(d||(d=p` <a href="${0}"> <ha-list-item hasMeta> ${0} <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> </a> `),`/config/devices/device/${e.id}`,(0,r.T)(e,this.hass.localize,this.hass.states))),!this._showAll&&e.length>10?(0,s.qy)(h||(h=p` <button class="show-more" @click="${0}"> ${0} </button> `),this._toggleShowAll,this.hass.localize("ui.panel.config.devices.connected_devices.show_more",{count:e.length-10})):"")}_toggleShowAll(){this._showAll=!this._showAll}constructor(...e){super(...e),this._showAll=!1,this._viaDevices=(0,o.A)((e,t)=>Object.values(t).filter(t=>t.via_device_id===e).sort((e,t)=>(0,l.SH)((0,r.T)(e,this.hass.localize,this.hass.states),(0,r.T)(t,this.hass.localize,this.hass.states),this.hass.locale.language)))}}g.styles=(0,s.AH)(u||(u=p`:host{display:block}.card-header{padding-bottom:0}a{text-decoration:none;color:var(--primary-text-color)}button.show-more{color:var(--primary-color);text-align:left;cursor:pointer;background:0 0;border-width:initial;border-style:none;border-color:initial;border-image:initial;padding:16px;font:inherit}button.show-more:focus{outline:0;text-decoration:underline}`)),(0,a.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"deviceId",void 0),(0,a.Cg)([(0,n.wk)()],g.prototype,"_showAll",void 0),g=(0,a.Cg)([(0,n.EM)("ha-device-via-devices-card")],g)},71762:function(e,t,i){i.d(t,{i:function(){return n}});i(3362),i(62953);var a=i(1087);const s=()=>i.e(15175).then(i.bind(i,71706)),n=(e,t)=>{(0,a.r)(e,"show-dialog",{dialogTag:"dialog-device-add-to",dialogImport:s,dialogParams:t})}},8872:function(e,t,i){i.d(t,{F:function(){return s},_:function(){return n}});i(3362),i(62953);var a=i(1087);const s=()=>Promise.all([i.e(92769),i.e(3283),i.e(33192),i.e(26092),i.e(39005),i.e(66201),i.e(90108)]).then(i.bind(i,22756)),n=(e,t)=>{(0,a.r)(e,"show-dialog",{dialogTag:"dialog-device-registry-detail",dialogImport:s,dialogParams:t})}},98129:function(e,t,i){i.a(e,async function(e,t){try{i(16280),i(74423),i(44114),i(26910),i(18111),i(22489),i(20116),i(7588),i(61701),i(13579),i(3362),i(27495),i(25440),i(62953);var a=i(40445),s=(i(68825),i(35211)),n=i(5124),o=i(67576),r=i(63672),l=i(22786),c=i(36312),d=i(46190),h=i(1087),u=i(37981),p=i(71727),g=i(81816),v=i(69093),m=i(28978),f=i(91926),_=i(52220),b=i(80880),y=i(15638),w=i(5911),$=(i(72945),i(38962)),C=i(18350),A=i(29823),k=(i(70947),i(26300)),x=(i(43661),i(28170),i(1671),i(47819),i(65829)),H=(i(67094),i(34127)),L=i(62351),M=i(82e3),V=i(77423),E=i(22792),z=i(58594),S=i(93758),q=i(96204),I=i(59241),Z=i(95350),D=i(86973),O=i(71606),T=i(41250),P=i(65063),j=i(81023),F=i(28794),N=i(81310),U=i(14503),R=i(24367),W=i(44144),B=i(30039),J=i(89434),K=i(85728),G=i(31005),Q=(i(97605),i(71762)),X=i(8872),Y=e([$,C,A,k,x,H,F,N,J,K,G]);[$,C,A,k,x,H,F,N,J,K,G]=Y.then?(await Y)():Y;let ee,te,ie,ae,se,ne,oe,re,le,ce,de,he,ue,pe,ge,ve,me,fe,_e,be,ye,we,$e,Ce,Ae,ke,xe,He,Le,Me,Ve,Ee,ze,Se,qe,Ie,Ze,De,Oe,Te,Pe=e=>e;const je="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",Fe="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",Ne="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",Ue="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z",Re="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",We="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",Be="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",Je="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",Ke="M13,3A9,9 0 0,0 4,12H1L4.89,15.89L4.96,16.03L9,12H6A7,7 0 0,1 13,5A7,7 0 0,1 20,12A7,7 0 0,1 13,19C11.07,19 9.32,18.21 8.06,16.94L6.64,18.36C8.27,20 10.5,21 13,21A9,9 0 0,0 22,12A9,9 0 0,0 13,3Z",Ge=[{value:"navigate-entities",path:"/config/entities",icon:"M11,13.5V21.5H3V13.5H11M9,15.5H5V19.5H9V15.5M12,2L17.5,11H6.5L12,2M12,5.86L10.08,9H13.92L12,5.86M17.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,13M17.5,15A2.5,2.5 0 0,0 15,17.5A2.5,2.5 0 0,0 17.5,20A2.5,2.5 0 0,0 20,17.5A2.5,2.5 0 0,0 17.5,15Z",countKey:"entities"},{value:"navigate-helpers",path:"/config/helpers",icon:"M21.71 20.29L20.29 21.71A1 1 0 0 1 18.88 21.71L7 9.85A3.81 3.81 0 0 1 6 10A4 4 0 0 1 2.22 4.7L4.76 7.24L5.29 6.71L6.71 5.29L7.24 4.76L4.7 2.22A4 4 0 0 1 10 6A3.81 3.81 0 0 1 9.85 7L21.71 18.88A1 1 0 0 1 21.71 20.29M2.29 18.88A1 1 0 0 0 2.29 20.29L3.71 21.71A1 1 0 0 0 5.12 21.71L10.59 16.25L7.76 13.42M20 2L16 4V6L13.83 8.17L15.83 10.17L18 8H20L22 4Z",countKey:"helpers"},{value:"navigate-automations",path:"/config/automation/dashboard",icon:"M12,2A2,2 0 0,1 14,4C14,4.74 13.6,5.39 13,5.73V7H14A7,7 0 0,1 21,14H22A1,1 0 0,1 23,15V18A1,1 0 0,1 22,19H21V20A2,2 0 0,1 19,22H5A2,2 0 0,1 3,20V19H2A1,1 0 0,1 1,18V15A1,1 0 0,1 2,14H3A7,7 0 0,1 10,7H11V5.73C10.4,5.39 10,4.74 10,4A2,2 0 0,1 12,2M7.5,13A2.5,2.5 0 0,0 5,15.5A2.5,2.5 0 0,0 7.5,18A2.5,2.5 0 0,0 10,15.5A2.5,2.5 0 0,0 7.5,13M16.5,13A2.5,2.5 0 0,0 14,15.5A2.5,2.5 0 0,0 16.5,18A2.5,2.5 0 0,0 19,15.5A2.5,2.5 0 0,0 16.5,13Z",countKey:"automations"},{value:"navigate-scenes",path:"/config/scene/dashboard",icon:"M17.5,12A1.5,1.5 0 0,1 16,10.5A1.5,1.5 0 0,1 17.5,9A1.5,1.5 0 0,1 19,10.5A1.5,1.5 0 0,1 17.5,12M14.5,8A1.5,1.5 0 0,1 13,6.5A1.5,1.5 0 0,1 14.5,5A1.5,1.5 0 0,1 16,6.5A1.5,1.5 0 0,1 14.5,8M9.5,8A1.5,1.5 0 0,1 8,6.5A1.5,1.5 0 0,1 9.5,5A1.5,1.5 0 0,1 11,6.5A1.5,1.5 0 0,1 9.5,8M6.5,12A1.5,1.5 0 0,1 5,10.5A1.5,1.5 0 0,1 6.5,9A1.5,1.5 0 0,1 8,10.5A1.5,1.5 0 0,1 6.5,12M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A1.5,1.5 0 0,0 13.5,19.5C13.5,19.11 13.35,18.76 13.11,18.5C12.88,18.23 12.73,17.88 12.73,17.5A1.5,1.5 0 0,1 14.23,16H16A5,5 0 0,0 21,11C21,6.58 16.97,3 12,3Z",countKey:"scenes"},{value:"navigate-scripts",path:"/config/script/dashboard",icon:"M17.8,20C17.4,21.2 16.3,22 15,22H5C3.3,22 2,20.7 2,19V18H5L14.2,18C14.6,19.2 15.7,20 17,20H17.8M19,2C20.7,2 22,3.3 22,5V6H20V5C20,4.4 19.6,4 19,4C18.4,4 18,4.4 18,5V18H17C16.4,18 16,17.6 16,17V16H5V5C5,3.3 6.3,2 8,2H19M8,6V8H15V6H8M8,10V12H14V10H8Z",countKey:"scripts"}],Qe=3e4;class Xe extends n.WF{willUpdate(e){super.willUpdate(e),e.has("deviceId")&&(this._related=void 0,this._deviceActions=[],this._deviceAlerts=[],this._deleteButtons=[],this._diagnosticDownloadLinks=[]),(e.has("deviceId")||e.has("entries"))&&this._fetchData()}firstUpdated(e){super.firstUpdated(e),(0,X.F)(),this._subscribeLabFeature()}updated(e){super.updated(e),e.has("deviceId")&&(this._findRelated(),(0,h.r)(this,"hass-quick-bar-context",{itemType:"device",itemId:this.deviceId}))}disconnectedCallback(){var e;super.disconnectedCallback(),clearTimeout(this._deviceAlertsActionsTimeout),null===(e=this._unsubLabFeature)||void 0===e||e.call(this)}render(){var e,t,i,a,s,o,l,d,h;if(!this.hass||!this.deviceId)return n.s6;const p=this.hass.devices[this.deviceId];if(!p)return(0,n.qy)(ee||(ee=Pe` <hass-error-screen .hass="${0}" .error="${0}"></hass-error-screen> `),this.hass,this.hass.localize("ui.panel.config.devices.device_not_found"));const g=(0,u.T)(p,this.hass.localize,this.hass.states),f=this._integrations(p,this.entries,this.manifests),_=this._entities(this.deviceId,this._entityReg,this.hass.devices),w=(0,T.cJ)(this._entityIds(_),this._entityReg,this.hass.states),$=this._entitiesByCategory(_),C=this._getQuickLinkCounts(_,this._related),A=this._batteryEntity(_),k=this._batteryChargingEntity(_),x=A?this.hass.states[A.entity_id]:void 0,H=x?(0,v.t)(x):void 0,L=k?this.hass.states[k.entity_id]:void 0,M=p.area_id?this.hass.areas[p.area_id]:void 0,V=f.length?[(0,n.qy)(te||(te=Pe`<ha-list-nav slot="actions"> ${0} </ha-list-nav>`),f.map(e=>{var t;return(0,n.qy)(ie||(ie=Pe`<ha-list-item-button href="${0}" .headline="${0}"> <img slot="start" alt="${0}" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer" width="24" height="24" @error="${0}" @load="${0}"> <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-button>`),`/config/integrations/integration/${e.domain}#config_entry=${e.entry_id}`,(0,Z.p$)(this.hass.localize,e.domain),(0,Z.p$)(this.hass.localize,e.domain),(0,W.MR)({domain:e.domain,type:"icon",darkOptimized:null===(t=this.hass.themes)||void 0===t?void 0:t.darkMode},this.hass.auth.data.hassUrl),this._onImageError,this._onImageLoad)}))]:[],E=[...this._deviceActions||[]];Array.isArray(this._diagnosticDownloadLinks)&&E.push(...this._diagnosticDownloadLinks),this._deleteButtons&&E.push(...this._deleteButtons),E.sort((e,t)=>"warning"===e.classes&&"warning"!==t.classes?1:"warning"!==e.classes&&"warning"===t.classes?-1:0);const z=E.shift();p.disabled_by&&V.push((0,n.qy)(ae||(ae=Pe` <ha-alert alert-type="warning"> ${0} </ha-alert> ${0} `),this.hass.localize("ui.panel.config.devices.enabled_cause",{type:this.hass.localize(`ui.panel.config.devices.type.${p.entry_type||"device"}`),cause:this.hass.localize(`ui.panel.config.devices.disabled_by.${p.disabled_by}`)}),"user"===p.disabled_by?(0,n.qy)(se||(se=Pe` <div class="card-actions" slot="actions"> <ha-button variant="warning" size="small" @click="${0}"> ${0} </ha-button> </div> `),this._enableDevice,this.hass.localize("ui.common.enable")):"")),this._renderIntegrationInfo(p,f,V);const S=p.disabled_by?this.hass.localize("ui.panel.config.devices.add_prompt_disabled"):this.hass.localize("ui.panel.config.devices.add_prompt_enabled"),q=(0,c.x)(this.hass.config,"scene")&&w.length,I=(0,c.x)(this.hass.config,"automation")||(0,c.x)(this.hass.config,"script")||q?(0,n.qy)(ne||(ne=Pe` <ha-card outlined> <h1 class="card-header"> ${0} <ha-button appearance="filled" variant="brand" @click="${0}" .disabled="${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> ${0} </ha-button> </h1> ${0} </ha-card> `),this.hass.localize("ui.panel.config.devices.automation.related_heading"),this._showAddToDialog,p.disabled_by,Je,this.hass.localize("ui.dialogs.more_info_control.add_to.item"),this._related?null!==(e=this._related.automation)&&void 0!==e&&e.length||null!==(t=this._related.script)&&void 0!==t&&t.length||null!==(i=this._related.scene)&&void 0!==i&&i.length?(0,n.qy)(re||(re=Pe` ${0} ${0} ${0} `),(0,c.x)(this.hass.config,"automation")?(0,n.qy)(le||(le=Pe` <h3 class="section-header"> ${0} </h3> <ha-list-nav .ariaLabel="${0}"> ${0} </ha-list-nav> `),this.hass.localize("ui.panel.config.devices.automation.automations_heading"),this.hass.localize("ui.panel.config.devices.automation.automations_heading"),null!==(a=this._related.automation)&&void 0!==a&&a.length?this._getRelated(this._related).automation.map(e=>e?(0,n.qy)(ce||(ce=Pe`<ha-list-item-button .headline="${0}" .href="${0}"> <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-button>`),(0,m.u)(e),e.attributes.id?`/config/automation/edit/${encodeURIComponent(e.attributes.id)}`:`/config/automation/show/${e.entity_id}`):n.s6):(0,n.qy)(de||(de=Pe`<ha-list-item-base .headline="${0}"></ha-list-item-base>`),this.hass.localize("ui.panel.config.devices.automation.no_automations"))):n.s6,(0,c.x)(this.hass.config,"script")?(0,n.qy)(he||(he=Pe` <h3 class="section-header"> ${0} </h3> <ha-list-nav .ariaLabel="${0}"> ${0} </ha-list-nav> `),this.hass.localize("ui.panel.config.devices.script.scripts_heading"),this.hass.localize("ui.panel.config.devices.script.scripts_heading"),null!==(s=this._related.script)&&void 0!==s&&s.length?this._getRelated(this._related).script.map(e=>{if(!e)return n.s6;const t=this._entityReg.find(t=>t.entity_id===e.entity_id),i=t?`/config/script/edit/${t.unique_id}`:`/config/script/show/${e.entity_id}`;return(0,n.qy)(ue||(ue=Pe` <ha-list-item-button .headline="${0}" .href="${0}"> <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-button> `),(0,m.u)(e),i)}):(0,n.qy)(pe||(pe=Pe`<ha-list-item-base .headline="${0}"></ha-list-item-base>`),this.hass.localize("ui.panel.config.devices.script.no_scripts"))):n.s6,q?(0,n.qy)(ge||(ge=Pe` <h3 class="section-header"> ${0} </h3> <ha-list-nav .ariaLabel="${0}"> ${0} </ha-list-nav> `),this.hass.localize("ui.panel.config.devices.scene.scenes_heading"),this.hass.localize("ui.panel.config.devices.scene.scenes_heading"),null!==(o=this._related.scene)&&void 0!==o&&o.length?this._getRelated(this._related).scene.map(e=>{if(!e)return n.s6;const t=`scene-${(0,b.Y)(e.entity_id)}`;return e.attributes.id?(0,n.qy)(ve||(ve=Pe` <ha-list-item-button .headline="${0}" .href="${0}"> <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-button> `),(0,m.u)(e),`/config/scene/edit/${e.attributes.id}`):(0,n.qy)(me||(me=Pe` <ha-list-item-base id="${0}" .headline="${0}"> <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-base> <ha-tooltip .for="${0}" placement="${0}"> ${0} </ha-tooltip> `),t,(0,m.u)(e),t,(0,y.qC)(this.hass.language,this.hass.translationMetadata.translations)?"left":"right",this.hass.localize("ui.panel.config.devices.cant_edit"))}):(0,n.qy)(fe||(fe=Pe`<ha-list-item-base .headline="${0}"></ha-list-item-base>`),this.hass.localize("ui.panel.config.devices.scene.no_scenes"))):n.s6):(0,n.qy)(_e||(_e=Pe` <div class="card-content"> ${0} ${0} </div> `),this.hass.localize("ui.panel.config.devices.add_prompt",{name:this.hass.localize("ui.panel.config.devices.automation.automations_scripts_or_scenes"),type:this.hass.localize(`ui.panel.config.devices.type.${p.entry_type||"device"}`)}),S):(0,n.qy)(oe||(oe=Pe` <div class="card-content loading"> <ha-spinner></ha-spinner> </div> `))):"";return(0,n.qy)(be||(be=Pe`<hass-subpage .hass="${0}" .narrow="${0}" .header="${0}"> <ha-tooltip for="edit-settings-button" slot="toolbar-icon"> ${0} </ha-tooltip> <ha-icon-button id="edit-settings-button" slot="toolbar-icon" .path="${0}" @click="${0}" hide-title .label="${0}"></ha-icon-button> <ha-dropdown slot="toolbar-icon" @wa-select="${0}"> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"></ha-icon-button> ${0} <wa-divider></wa-divider> <ha-dropdown-item value="reset_entity_ids"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> </ha-dropdown> <div class="container"> <div class="header fullwidth"> ${0} <div class="header-right"> ${0} ${0} </div> </div> <div class="column"> ${0} <ha-device-info-card .hass="${0}" .device="${0}"> ${0} ${0} </ha-device-info-card> ${0} </div> <div class="column"> ${0} <ha-device-via-devices-card .hass="${0}" .deviceId="${0}"></ha-device-via-devices-card> </div> <div class="column"> ${0} ${0} </div> </div> </hass-subpage>`),this.hass,this.narrow,g,this.hass.localize("ui.panel.config.devices.edit_settings"),Be,this._showSettings,this.hass.localize("ui.panel.config.devices.edit_settings"),this._handleToolbarMenuAction,this.hass.localize("ui.common.menu"),Ne,Ge.map(e=>(0,n.qy)(ye||(ye=Pe` <ha-dropdown-item value="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} <ha-icon-next slot="details"></ha-icon-next> </ha-dropdown-item> `),e.value,e.icon,this.hass.localize(`ui.panel.config.devices.quick_links.${e.countKey}`,{count:C[e.countKey]}))),Ke,this.hass.localize("ui.panel.config.devices.restore_entity_ids"),M?(0,n.qy)(we||(we=Pe`<div class="header-name"> <a href="/config/areas/area/${0}">${0}</a> </div>`),M.area_id,this.hass.localize("ui.panel.config.integrations.config_entry.area",{area:M.name||"Unnamed Area"})):"",!x||"binary_sensor"!==H&&Number.isNaN(Number(x.state))?"":(0,n.qy)($e||($e=Pe` <div class="battery"> ${0} <ha-battery-icon .hass="${0}" .batteryStateObj="${0}" .batteryChargingStateObj="${0}"></ha-battery-icon> </div> `),"sensor"===H?this.hass.formatEntityState(x):n.s6,this.hass,x,L),f.length?(0,n.qy)(Ce||(Ce=Pe` <img alt="${0}" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer" @load="${0}" @error="${0}"> `),(0,Z.p$)(this.hass.localize,f[0].domain),(0,W.MR)({domain:f[0].domain,type:"logo",darkOptimized:null===(l=this.hass.themes)||void 0===l?void 0:l.darkMode},this.hass.auth.data.hassUrl),this._onImageLoad,this._onImageError):"",null!==(d=this._deviceAlerts)&&void 0!==d&&d.length?(0,n.qy)(Ae||(Ae=Pe` <div> ${0} </div> `),this._deviceAlerts.map(e=>(0,n.qy)(ke||(ke=Pe` <ha-alert .alertType="${0}"> ${0} </ha-alert> `),e.level,e.text))):"",this.hass,p,V,z||E.length?(0,n.qy)(xe||(xe=Pe` <div class="card-actions" slot="actions"> <ha-button href="${0}" rel="${0}" appearance="plain" target="${0}" class="${0}" .variant="${0}" .action="${0}" @click="${0}"> ${0} ${0} ${0} </ha-button> ${0} </div> `),(0,r.J)(z.href),(0,r.J)(z.target?"noreferrer":void 0),(0,r.J)(z.target),(0,r.J)(z.classes),null!==(h=z.classes)&&void 0!==h&&h.includes("warning")?"danger":"brand",z.action,this._deviceActionClicked,z.label,z.icon?(0,n.qy)(He||(He=Pe` <ha-svg-icon class="${0}" .path="${0}" slot="start"></ha-svg-icon> `),(0,r.J)(z.classes),z.icon):n.s6,z.trailingIcon?(0,n.qy)(Le||(Le=Pe` <ha-svg-icon .path="${0}" slot="end"></ha-svg-icon> `),z.trailingIcon):n.s6,E.length?(0,n.qy)(Me||(Me=Pe` <ha-dropdown @wa-select="${0}" placement="bottom-end"> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"></ha-icon-button> ${0} </ha-dropdown> `),this._deviceActionSelected,this.hass.localize("ui.common.menu"),Ne,E.map((e,t)=>{var i;const a=(0,n.qy)(Ve||(Ve=Pe`<ha-dropdown-item .value="${0}" .data="${0}" .variant="${0}"> ${0} ${0} ${0} </ha-dropdown-item>`),t,e,null!==(i=e.classes)&&void 0!==i&&i.includes("warning")?"danger":"default",e.icon?(0,n.qy)(Ee||(Ee=Pe` <ha-svg-icon .path="${0}" slot="icon"></ha-svg-icon> `),e.icon):"",e.label,e.trailingIcon?(0,n.qy)(ze||(ze=Pe` <ha-svg-icon slot="details" .path="${0}"></ha-svg-icon> `),e.trailingIcon):"");return e.href?(0,n.qy)(Se||(Se=Pe`<a href="${0}" target="${0}" rel="${0}">${0} </a>`),e.href,(0,r.J)(e.target),(0,r.J)(e.target?"noreferrer":void 0),a):a})):""):"",this.narrow?"":I,["control","sensor","notify","event","assist","config","diagnostic"].map(e=>$[e].length>0||0===_.length&&"control"===e?(0,n.qy)(qe||(qe=Pe` <ha-device-entities-card .hass="${0}" .header="${0}" .deviceName="${0}" .entities="${0}" .showHidden="${0}"> </ha-device-entities-card> `),this.hass,this.hass.localize(`ui.panel.config.devices.entities.${e}`),g,$[e],null!==p.disabled_by):""),this.hass,this.deviceId,this.narrow?I:"",(0,c.x)(this.hass.config,"logbook")?(0,n.qy)(Ie||(Ie=Pe` <ha-card outlined> <h1 class="card-header"> ${0} </h1> <ha-logbook .hass="${0}" .time="${0}" .entityIds="${0}" .deviceIds="${0}" virtualize narrow no-icon></ha-logbook> </ha-card> `),this.hass.localize("panel.logbook"),this.hass,this._logbookTime,this._entityIds(_),this._deviceIdInList(this.deviceId)):"")}_fetchData(){this.deviceId&&this.entries.length&&(this._getDiagnosticButtons(),this._getDeleteActions(),clearTimeout(this._deviceAlertsActionsTimeout),this._getDeviceActions(),this._getDeviceAlerts())}async _getDiagnosticButtons(){const e=this.deviceId;if(!(0,c.x)(this.hass.config,"diagnostics"))return;const t=this.hass.devices[this.deviceId];if(!t)return;let i=await Promise.all(this._integrations(t,this.entries,this.manifests).map(async e=>{if("loaded"!==e.state)return!1;let t;try{t=await(0,q.g9)(this.hass,e.domain)}catch(i){if(i instanceof Error&&i.message.includes("not_found"))return!1;throw i}return!(!t.handlers.device&&!t.handlers.config_entry)&&{link:t.handlers.device?(0,q.It)(e.entry_id,this.deviceId):(0,q.WV)(e.entry_id),domain:e.domain}}));i=i.filter(Boolean),this.deviceId===e&&i.length>0&&(this._diagnosticDownloadLinks=i.map(e=>({icon:Ue,action:()=>this._signUrl(e.link),label:i.length>1?this.hass.localize("ui.panel.config.devices.download_diagnostics_integration",{integration:(0,Z.p$)(this.hass.localize,e.domain)}):this.hass.localize("ui.panel.config.devices.download_diagnostics")})))}_getDeleteActions(){const e=this.deviceId,t=this.hass.devices[this.deviceId];if(!t)return;const i=[];this._integrations(t,this.entries,this.manifests).forEach(e=>{"loaded"===e.state&&e.supports_remove_device&&i.push({action:async()=>{if(await(0,P.dk)(this,{text:this._integrations(t,this.entries,this.manifests).length>1?this.hass.localize("ui.panel.config.devices.confirm_delete_integration",{integration:(0,Z.p$)(this.hass.localize,e.domain)}):this.hass.localize("ui.panel.config.devices.confirm_delete"),confirmText:this.hass.localize("ui.common.delete"),dismissText:this.hass.localize("ui.common.cancel"),destructive:!0}))try{await(0,z.nO)(this.hass,this.deviceId,e.entry_id)}catch(i){(0,P.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.devices.error_delete"),text:i instanceof Error?i.message:String(i)})}},classes:"warning",icon:Fe,label:this._integrations(t,this.entries,this.manifests).length>1?this.hass.localize("ui.panel.config.devices.delete_device_integration",{integration:(0,Z.p$)(this.hass.localize,e.domain)}):this.hass.localize("ui.panel.config.devices.delete_device")})}),this.deviceId===e&&i.length>0&&(this._deleteButtons=i)}async _getDeviceActions(){var e,t;const a=this.deviceId,s=this.hass.devices[this.deviceId];if(!s)return;const n=[],o=(null===(e=s.configuration_url)||void 0===e?void 0:e.startsWith("homeassistant://"))||!1,r=o?null===(t=s.configuration_url)||void 0===t?void 0:t.replace("homeassistant://","/"):s.configuration_url;r&&n.push({href:r,target:o?void 0:"_blank",icon:je,label:this.hass.localize("ui.panel.config.devices.open_configuration_url"),trailingIcon:We});const l=this._entities(this.deviceId,this._entityReg,this.hass.devices).find(e=>"assist_satellite"===(0,p.m)(e.entity_id)),c=this._integrations(s,this.entries,this.manifests).map(e=>e.domain);if(!c.includes("voip")&&l&&(0,L.KC)(this.hass.states[l.entity_id])&&n.push({action:this._voiceAssistantSetup,label:this.hass.localize("ui.panel.config.devices.set_up_voice_assistant"),icon:Re}),c.includes("mqtt")){const e=(await i.e(3114).then(i.bind(i,62129))).getMQTTDeviceActions(this,s);n.push(...e)}if(c.includes("zha")){const e=await i.e(29478).then(i.bind(i,19525)),t=await e.getZHADeviceActions(this,this.hass,s);n.push(...t)}if(c.includes("zwave_js")){const e=await i.e(63597).then(i.bind(i,74524)),t=await e.getZwaveDeviceActions(this,this.hass,s);n.push(...t)}if(c.includes("esphome")){const e=await i.e(81748).then(i.bind(i,46463)),t=await e.getESPHomeDeviceActions(this,this.hass,s);n.push(...t)}if(c.includes("matter")){const e=await i.e(77589).then(i.bind(i,47988)),t=e.getMatterDeviceDefaultActions(this,this.hass,s);n.push(...t),e.getMatterDeviceActions(this,this.hass,s).then(e=>{this.deviceId===a&&(this._deviceActions=[...e,...this._deviceActions||[]])})}this.deviceId===a&&(this._deviceActions=n)}async _getDeviceAlerts(){const e=this.deviceId,t=this.hass.devices[this.deviceId];if(!t)return;const a=[];if(this._integrations(t,this.entries,this.manifests).map(e=>e.domain).includes("zwave_js")){const e=await i.e(19203).then(i.bind(i,10958)),s=await e.getZwaveDeviceAlerts(this.hass,t);a.push(...s)}this.deviceId===e&&(this._deviceAlerts=a,a.length&&(this._deviceAlertsActionsTimeout=window.setTimeout(()=>{this._getDeviceAlerts(),this._getDeviceActions()},Qe)))}_computeEntityName(e,t){const i=t[this.deviceId];return(0,g.cx)(e,t)||(0,u.T)(i,this.hass.localize,this.hass.states)}_onImageLoad(e){e.target.style.display="inline-block"}_onImageError(e){e.target.style.display="none"}async _findRelated(){this._related=await(0,O.f)(this.hass,"device",this.deviceId)}_showAddToDialog(){const e=this.hass.devices[this.deviceId];if(!e)return;const t=this._entities(this.deviceId,this._entityReg,this.hass.devices).map(e=>e.entity_id),i=(0,T.cJ)(t,this._entityReg,this.hass.states);(0,Q.i)(this,{device:e,newTriggersConditions:this._newTriggersConditions,entityIds:i,canCreateScene:(0,c.x)(this.hass.config,"scene")&&i.length>0})}_subscribeLabFeature(){(0,c.x)(this.hass.config,"automation")&&(0,S.CO)(this.hass.connection,"automation","new_triggers_conditions",e=>{this._newTriggersConditions=e.enabled}).then(e=>{this._unsubLabFeature=e})}_renderIntegrationInfo(e,t,a){const s=t.map(e=>e.domain);s.includes("zha")&&(i.e(88330).then(i.bind(i,39057)),a.push((0,n.qy)(Ze||(Ze=Pe` <ha-device-info-zha .hass="${0}" .device="${0}"></ha-device-info-zha> `),this.hass,e))),s.includes("zwave_js")&&(i.e(314).then(i.bind(i,13153)),a.push((0,n.qy)(De||(De=Pe` <ha-device-info-zwave_js .hass="${0}" .device="${0}"></ha-device-info-zwave_js> `),this.hass,e))),s.includes("matter")&&(i.e(62568).then(i.bind(i,20187)),a.push((0,n.qy)(Oe||(Oe=Pe` <ha-device-info-matter .hass="${0}" .device="${0}"></ha-device-info-matter> `),this.hass,e)))}_handleToolbarMenuAction(e){var t;const i=null===(t=e.detail)||void 0===t||null===(t=t.item)||void 0===t?void 0:t.value,a=Ge.find(e=>e.value===i);a?(0,f.oo)(`${a.path}?historyBack=1&device=${this.deviceId}`):"reset_entity_ids"===i&&this._resetEntityIds()}async _enableDevice(){await(0,z.FB)(this.hass,this.deviceId,{disabled_by:null})}async _signUrl(e){const t=await(0,M.e0)(this.hass,e);(0,B.R)(t.path)}_deviceActionSelected(e){var t;const i=null===(t=e.detail)||void 0===t||null===(t=t.item)||void 0===t?void 0:t.data;null!=i&&i.action&&i.action(e)}_deviceActionClicked(e){e.currentTarget.action&&(e.preventDefault(),e.currentTarget.action(e))}static get styles(){return[U.RF,(0,n.AH)(Te||(Te=Pe`.container{display:flex;flex-wrap:wrap;margin:auto;max-width:1000px;margin-top:var(--ha-space-8);margin-bottom:var(--ha-space-8)}:host([narrow]) .container{margin-top:0}.card-header{display:flex;align-items:center;justify-content:space-between;padding-bottom:var(--ha-space-3)}.card-header ha-button{margin-right:calc(var(--ha-space-2) * -1);margin-inline-end:calc(var(--ha-space-2) * -1);margin-inline-start:initial;direction:var(--direction)}.section-header{font-size:var(--ha-font-size-s);font-weight:500;color:var(--secondary-text-color);margin:0;padding:var(--ha-space-2) var(--ha-space-4) 0}.device-info{padding:var(--ha-space-4)}h1{margin:0;font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed);opacity:var(--dark-primary-opacity)}.header{display:flex;justify-content:space-between}.header-name{display:flex;align-items:center;padding-left:var(--ha-space-2);padding-inline-start:var(--ha-space-2);padding-inline-end:initial;direction:var(--direction)}.column,.fullwidth{padding:var(--ha-space-2);box-sizing:border-box}.column{width:33%;flex-grow:1}.fullwidth{width:100%;flex-grow:1}.header-right{align-self:center}.header-right img{height:30px}.header-right{display:flex}.header-right:first-child{width:100%;justify-content:flex-end}.header-right>:not(:first-child){margin-left:var(--ha-space-4);margin-inline-start:var(--ha-space-4);margin-inline-end:initial;direction:var(--direction)}.battery{align-self:center;align-items:center;display:flex;white-space:nowrap}.column>:not(:first-child){margin-top:var(--ha-space-4)}:host([narrow]) .column{width:100%}a{text-decoration:none;color:var(--primary-color)}ha-card a{color:var(--primary-text-color)}ha-svg-icon[slot=trailingIcon]{display:block;width:18px;height:18px;margin-inline-start:var(--ha-space-2);margin-inline-end:initial}ha-svg-icon[slot=meta]{width:18px;height:18px}ha-list-item-base ha-icon-next,ha-list-item-button ha-icon-next{color:var(--secondary-text-color);--mdc-icon-size:24px;display:block}ha-card:has(ha-logbook){padding-bottom:var(--ha-card-border-radius,var(--ha-border-radius-lg))}ha-logbook{height:400px}:host([narrow]) ha-logbook{height:235px}.card-content{padding-top:var(--ha-space-2)}.card-content.loading{display:flex;justify-content:center}.card-actions{display:flex;justify-content:space-between;align-items:center;padding:var(--ha-space-1) var(--ha-space-4) var(--ha-space-1) var(--ha-space-1)}`))]}constructor(...e){super(...e),this.narrow=!1,this.isWide=!1,this._diagnosticDownloadLinks=[],this._deleteButtons=[],this._deviceActions=[],this._deviceAlerts=[],this._newTriggersConditions=!1,this._entityReg=[],this._logbookTime={recent:86400},this._integrations=(0,l.A)((e,t,i)=>{const a={};for(const o of t)a[o.entry_id]=o;const s={};for(const o of i)s[o.domain]=o;const n=e.config_entries.filter(e=>e in a).map(e=>a[e]);return(0,V.JW)(n,e.primary_config_entry)}),this._entities=(0,l.A)((e,t,i)=>t.filter(t=>t.device_id===e).map(e=>Object.assign(Object.assign({},e),{},{stateName:this._computeEntityName(e,i)})).sort((e,t)=>(0,_.xL)(e.stateName||`zzz${e.entity_id}`,t.stateName||`zzz${t.entity_id}`,this.hass.locale.language))),this._getEntitiesSorted=e=>e.sort((e,t)=>(0,_.xL)(e.attributes.friendly_name||`zzz${e.entity_id}`,t.attributes.friendly_name||`zzz${t.entity_id}`,this.hass.locale.language)),this._getRelated=(0,l.A)(e=>{var t,i,a;return{automation:this._getEntitiesSorted((null!==(t=null==e?void 0:e.automation)&&void 0!==t?t:[]).map(e=>this.hass.states[e])),scene:this._getEntitiesSorted((null!==(i=null==e?void 0:e.scene)&&void 0!==i?i:[]).map(e=>this.hass.states[e])),script:this._getEntitiesSorted((null!==(a=null==e?void 0:e.script)&&void 0!==a?a:[]).map(e=>this.hass.states[e]))}}),this._getQuickLinkCounts=(0,l.A)((e,t)=>{var i,a,s,n,o,r;return{entities:e.length,helpers:e.filter(e=>(0,R.z)((0,p.m)(e.entity_id))).length,automations:null!==(i=null==t||null===(a=t.automation)||void 0===a?void 0:a.length)&&void 0!==i?i:0,scenes:null!==(s=null==t||null===(n=t.scene)||void 0===n?void 0:n.length)&&void 0!==s?s:0,scripts:null!==(o=null==t||null===(r=t.script)||void 0===r?void 0:r.length)&&void 0!==o?o:0}}),this._deviceIdInList=(0,l.A)(e=>[e]),this._entityIds=(0,l.A)(e=>e.map(e=>e.entity_id)),this._entitiesByCategory=(0,l.A)(e=>{const t=(0,w.$)(e,e=>{const t=(0,p.m)(e.entity_id);return d.gt.includes(t)?"assist":"event"===t||"notify"===t?t:e.entity_category?e.entity_category:d.JF.includes(t)?"sensor":"control"});for(const i of["assist","config","control","diagnostic","event","notify","sensor"])i in t||(t[i]=[]);return t}),this._batteryEntity=(0,l.A)(e=>(0,I.Er)(this.hass,e)),this._batteryChargingEntity=(0,l.A)(e=>(0,I.DW)(this.hass,e)),this._resetEntityIds=()=>{const e=this._entities(this.deviceId,this._entityReg,this.hass.devices).map(e=>e.entity_id);(0,D._)(this,this.hass,e)},this._showSettings=async()=>{const e=this.hass.devices[this.deviceId];(0,X._)(this,{device:e,updateEntry:async t=>{const i=e.name_by_user||e.name,a=t.name_by_user;if("user"===t.disabled_by&&"user"!==e.disabled_by){for(const o of e.config_entries)if(!Object.values(this.hass.devices).some(t=>t.id!==e.id&&t.config_entries.includes(o))){const e=this.entries.find(e=>e.entry_id===o);if(e&&!e.disabled_by&&await(0,P.dk)(this,{title:this.hass.localize("ui.panel.config.devices.confirm_disable_config_entry_title"),text:this.hass.localize("ui.panel.config.devices.confirm_disable_config_entry_message",{name:e.title}),destructive:!0,confirmText:this.hass.localize("ui.common.yes"),dismissText:this.hass.localize("ui.common.no")})){let e;try{e=await(0,V.XQ)(this.hass,o)}catch(n){return void(0,P.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.integrations.config_entry.disable_error"),text:n instanceof Error?n.message:String(n)})}e.require_restart&&(0,P.showAlertDialog)(this,{text:this.hass.localize("ui.panel.config.integrations.config_entry.disable_restart_confirm")}),delete t.disabled_by}}}else null!==t.disabled_by&&"user"!==t.disabled_by&&delete t.disabled_by;try{await(0,z.FB)(this.hass,this.deviceId,t)}catch(n){return void(0,P.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.devices.update_device_error"),text:n instanceof Error?n.message:String(n)})}if(!i||!a||i===a)return;const s=this._entities(this.deviceId,this._entityReg,this.hass.devices).map(e=>{const t=e.name||e.stateName;let s;if(!e.has_entity_name||e.name){if(!e.has_entity_name||e.name!==i&&e.name!==a){if(null==t||!t.includes(i))return;s=t.replace(i,a)}else s=null;return(0,I.G_)(this.hass,e.entity_id,{name:s})}});await Promise.all(s)}})},this._voiceAssistantSetup=()=>{(0,j.L)(this,{deviceId:this.deviceId})}}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],Xe.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],Xe.prototype,"entries",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],Xe.prototype,"manifests",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],Xe.prototype,"deviceId",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],Xe.prototype,"narrow",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"is-wide",type:Boolean})],Xe.prototype,"isWide",void 0),(0,a.Cg)([(0,o.wk)()],Xe.prototype,"_related",void 0),(0,a.Cg)([(0,o.wk)()],Xe.prototype,"_diagnosticDownloadLinks",void 0),(0,a.Cg)([(0,o.wk)()],Xe.prototype,"_deleteButtons",void 0),(0,a.Cg)([(0,o.wk)()],Xe.prototype,"_deviceActions",void 0),(0,a.Cg)([(0,o.wk)()],Xe.prototype,"_deviceAlerts",void 0),(0,a.Cg)([(0,o.wk)()],Xe.prototype,"_newTriggersConditions",void 0),(0,a.Cg)([(0,o.wk)(),(0,s.Fg)({context:E.ih,subscribe:!0})],Xe.prototype,"_entityReg",void 0),Xe=(0,a.Cg)([(0,o.EM)("ha-config-device-page")],Xe),t()}catch(ee){t(ee)}})},99949:function(e,t,i){i.a(e,async function(e,t){try{i(89463),i(74423),i(44114),i(18111),i(81148),i(22489),i(20116),i(7588),i(61701),i(13579),i(3362),i(96167),i(27495),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953),i(48408),i(14603),i(47566),i(98721);var a=i(40445),s=(i(68825),i(88696)),n=i(35211),o=i(5124),r=i(67576),l=i(22786),c=i(93905),d=i(37981),h=i(55931),u=i(69093),p=i(76774),g=i(89020),v=i(91926),m=i(87710),f=i(86171),_=(i(72945),i(38962)),b=i(18350),y=(i(30716),i(29823)),w=(i(70947),i(52190)),$=i(72644),C=i(63817),A=i(138),k=i(64263),x=i(26300),H=(i(82988),i(53641)),L=i(77423),M=i(22792),V=i(77001),E=i(31422),z=i(58594),S=i(59241),q=i(92557),I=i(65063),Z=i(72553),D=i(14503),O=i(44144),T=i(34023),P=i(29303),j=i(25635),F=i(5317),N=i(76559),U=i(69569),R=e([f,_,b,y,w,$,C,A,k,x,Z,F,s,P]);[f,_,b,y,w,$,C,A,k,x,Z,F,s,P]=R.then?(await R)():R;let W,B,J,K,G,Q,X,Y,ee,te,ie,ae,se,ne,oe,re,le,ce,de,he,ue,pe,ge,ve,me=e=>e;const fe="M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",_e="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",be="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",ye="M7,10L12,15L17,10H7Z",we="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",$e="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";class Ce extends o.WF{connectedCallback(){super.connectedCallback(),window.addEventListener("location-changed",this._locationChanged),window.addEventListener("popstate",this._popState)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("location-changed",this._locationChanged),window.removeEventListener("popstate",this._popState)}willUpdate(e){super.willUpdate(e),this.hasUpdated||(this._filters=this._storageFilters,this._setFiltersFromUrl()),e.has("_selected")&&(this._selectedCanDelete=this._selected.filter(e=>this.hass.devices[e].config_entries.some(e=>{var t;return null===(t=this.entries.find(t=>t.entry_id===e))||void 0===t?void 0:t.supports_remove_device})))}_setFiltersFromUrl(){var e,t;const i=this._searchParms.get("area"),a=this._searchParms.get("domain"),s=this._searchParms.get("config_entry"),n=this._searchParms.get("sub_entry"),o=this._searchParms.has("label");(i||a||s||o)&&(this._fromUrl=!0,this._filter=(null===(e=history.state)||void 0===e?void 0:e.filter)||"",this._filters={"ha-filter-states":{value:[...(null===(t=this._filters["ha-filter-states"])||void 0===t?void 0:t.value)||[],"disabled"],items:void 0},"ha-filter-floor-areas":{value:i?{areas:[i]}:void 0,items:void 0},"ha-filter-integrations":{value:a?[a]:[],items:void 0},config_entry:{value:s?[s]:[],items:void 0},sub_entry:{value:n?[n]:[],items:void 0}},this._filterLabel())}_filterLabel(){const e=this._searchParms.get("label");e&&(this._filters=Object.assign(Object.assign({},this._filters),{},{"ha-filter-labels":{value:[e],items:void 0}}))}_clearFilter(){this._filters={},this._fromUrl||(this._storageFilters={})}render(){var e,t,i,a,s,n,r,l,c;const{devicesOutput:d}=this._devicesAndFilterDomains(this.hass.devices,this.entries,this.entities,this.hass.areas,this.manifests,this._filters,this.hass.localize,this._labels),h=this._sizeController.value&&this._sizeController.value<700||!this._sizeController.value&&"docked"===this.hass.dockedSidebar;return(0,o.qy)(W||(W=me` <hass-tabs-subpage-data-table .hass="${0}" .narrow="${0}" .backPath="${0}" .tabs="${0}" .route="${0}" .searchLabel="${0}" .columns="${0}" .data="${0}" selectable .selected="${0}" @selection-changed="${0}" .filter="${0}" has-filters .filters="${0}" .initialGroupColumn="${0}" .initialCollapsedGroups="${0}" .initialSorting="${0}" .columnOrder="${0}" .hiddenColumns="${0}" @columns-changed="${0}" @clear-filter="${0}" @search-changed="${0}" @sorting-changed="${0}" @grouping-changed="${0}" @collapsed-changed="${0}" @row-click="${0}" clickable has-fab class="${0}"> <ha-integration-overflow-menu .hass="${0}" slot="toolbar-icon"></ha-integration-overflow-menu> <ha-button slot="fab" size="large" @click="${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> ${0} </ha-button> ${0} <ha-filter-floor-areas .hass="${0}" type="device" .value="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-floor-areas> <ha-filter-integrations .hass="${0}" .value="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-integrations> <ha-filter-states .hass="${0}" .value="${0}" .states="${0}" .label="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-states> <ha-filter-labels .hass="${0}" .value="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-labels> ${0} <ha-dropdown slot="selection-bar" @wa-select="${0}"> ${0} ${0} ${0} <ha-dropdown-item value="delete_selected" .disabled="${0}" variant="danger"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> </ha-dropdown> </hass-tabs-subpage-data-table> `),this.hass,this.narrow,this._searchParms.has("historyBack")?void 0:"/config",j.configSections.devices,this.route,this.hass.localize("ui.panel.config.devices.picker.search",{number:d.length}),this._columns(this.hass.localize),d,this._selected.length,this._handleSelectionChanged,this._filter,Object.values(this._filters).filter(e=>Array.isArray(e.value)?e.value.length:e.value&&Object.values(e.value).some(e=>Array.isArray(e)?e.length:e)).length,this._activeGrouping,this._activeCollapsed,this._activeSorting,this._activeColumnOrder,this._activeHiddenColumns,this._handleColumnsChanged,this._clearFilter,this._handleSearchChange,this._handleSortingChanged,this._handleGroupingChanged,this._handleCollapseChanged,this._handleRowClicked,this.narrow?"narrow":"",this.hass,this._addDevice,we,this.hass.localize("ui.panel.config.devices.add_device"),Array.isArray(null===(e=this._filters.config_entry)||void 0===e?void 0:e.value)&&null!==(t=this._filters.config_entry)&&void 0!==t&&t.value.length?(0,o.qy)(B||(B=me`<ha-alert slot="filter-pane"> ${0} ${0}${0} </ha-alert>`),this.hass.localize("ui.panel.config.devices.filtering_by_config_entry"),(null===(i=this.entries)||void 0===i||null===(i=i.find(e=>e.entry_id===this._filters.config_entry.value[0]))||void 0===i?void 0:i.title)||this._filters.config_entry.value[0],1===this._filters.config_entry.value.length&&Array.isArray(null===(a=this._filters.sub_entry)||void 0===a?void 0:a.value)&&this._filters.sub_entry.value.length?(0,o.qy)(J||(J=me` (${0})`),(null===(s=this._subEntries)||void 0===s||null===(s=s.find(e=>e.subentry_id===this._filters.sub_entry.value[0]))||void 0===s?void 0:s.title)||this._filters.sub_entry.value[0]):o.s6):o.s6,this.hass,null===(n=this._filters["ha-filter-floor-areas"])||void 0===n?void 0:n.value,this._filterChanged,"ha-filter-floor-areas"===this._expandedFilter,this.narrow,this._filterExpanded,this.hass,null===(r=this._filters["ha-filter-integrations"])||void 0===r?void 0:r.value,this._filterChanged,"ha-filter-integrations"===this._expandedFilter,this.narrow,this._filterExpanded,this.hass,null===(l=this._filters["ha-filter-states"])||void 0===l?void 0:l.value,this._states(this.hass.localize),this.hass.localize("ui.panel.config.devices.picker.state"),this._filterChanged,"ha-filter-states"===this._expandedFilter,this.narrow,this._filterExpanded,this.hass,null===(c=this._filters["ha-filter-labels"])||void 0===c?void 0:c.value,this._filterChanged,"ha-filter-labels"===this._expandedFilter,this.narrow,this._filterExpanded,this.narrow?o.s6:(0,o.qy)(K||(K=me`<ha-dropdown slot="selection-bar" @wa-select="${0}"> <ha-assist-chip slot="trigger" .label="${0}"> <ha-svg-icon slot="trailing-icon" .path="${0}"></ha-svg-icon> </ha-assist-chip> ${0} </ha-dropdown> ${0}`),this._handleBulkLabel,this.hass.localize("ui.panel.config.automation.picker.bulk_actions.add_label"),ye,this._renderLabelItems(),h?o.s6:(0,o.qy)(G||(G=me`<ha-dropdown slot="selection-bar" @wa-select="${0}"> <ha-assist-chip slot="trigger" .label="${0}"> <ha-svg-icon slot="trailing-icon" .path="${0}"></ha-svg-icon> </ha-assist-chip> ${0} </ha-dropdown>`),this._handleBulkArea,this.hass.localize("ui.panel.config.devices.picker.bulk_actions.move_area"),ye,this._renderAreaItems())),this._handleBulkAction,this.narrow?(0,o.qy)(Q||(Q=me`<ha-assist-chip .label="${0}" slot="trigger"> <ha-svg-icon slot="trailing-icon" .path="${0}"></ha-svg-icon> </ha-assist-chip>`),this.hass.localize("ui.panel.config.automation.picker.bulk_action"),ye):(0,o.qy)(X||(X=me`<ha-icon-button .path="${0}" .label="${0}" slot="trigger"></ha-icon-button>`),be,this.hass.localize("ui.panel.config.automation.picker.bulk_action")),this.narrow?(0,o.qy)(Y||(Y=me`<ha-dropdown-item> ${0} ${0} </ha-dropdown-item>`),this.hass.localize("ui.panel.config.automation.picker.bulk_actions.add_label"),this._renderLabelItems("submenu")):o.s6,h?(0,o.qy)(ee||(ee=me`<ha-dropdown-item> ${0} ${0} </ha-dropdown-item> <wa-divider></wa-divider>`),this.hass.localize("ui.panel.config.devices.picker.bulk_actions.move_area"),this._renderAreaItems("submenu")):o.s6,!this._selectedCanDelete.length,_e,this.hass.localize("ui.panel.config.devices.picker.bulk_actions.delete_selected.button"))}async _loadSubEntries(e){this._subEntries=await(0,L.t0)(this.hass,e)}_filterExpanded(e){e.detail.expanded?this._expandedFilter=e.target.localName:this._expandedFilter===e.target.localName&&(this._expandedFilter=void 0)}_filterChanged(e){const t=e.target.localName;this._filters=Object.assign(Object.assign({},this._filters),{},{[t]:e.detail}),this._fromUrl||(this._storageFilters=this._filters)}_batteryEntity(e,t){const i=(0,S.Er)(this.hass,t[e]||[]);return i?i.entity_id:void 0}_batteryChargingEntity(e,t){const i=(0,S.DW)(this.hass,t[e]||[]);return i?i.entity_id:void 0}_handleRowClicked(e){const t=e.detail.id;this._ignoreLocationChange=!0,(0,v.oo)(`/config/devices/device/${t}`)}_handleSearchChange(e){this._filter=e.detail.value,history.replaceState({filter:this._filter},"")}_addDevice(){const{filteredConfigEntry:e,filteredDomains:t}=this._devicesAndFilterDomains(this.hass.devices,this.entries,this.entities,this.hass.areas,this.manifests,this._filters,this.hass.localize,this._labels);1===t.size&&g.x.includes([...t][0])?(0,g.P)(this,this.hass,[...t][0],{config_entry:null==e?void 0:e.entry_id}):(0,N.X)(this,{domain:this._searchParms.get("domain")||void 0,navigateToResult:!0})}_handleSelectionChanged(e){this._selected=e.detail.value}_handleBulkArea(e){const t=e.detail.item.value;"area_create"!==t?"area_no"!==t?this._bulkAddArea(t.substring(5)):this._bulkAddArea(null):this._bulkCreateArea()}async _bulkAddArea(e){const t=[];this._selected.forEach(i=>{t.push((0,z.FB)(this.hass,i,{area_id:e}))});const i=await Promise.allSettled(t);if((0,m.$)(i)){const e=(0,m.N)(i);(0,I.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.common.multiselect.failed",{number:e.length}),text:(0,o.qy)(te||(te=me`<pre>
${0}</pre>`),e.map(e=>e.reason.message||e.reason.code||e.reason).join("\r\n"))})}}async _handleBulkLabel(e){const t=e.detail.item.value;if("label_create"===t)return void this._bulkCreateLabel();if(!t)return;const i=e.detail.item.action;this._bulkLabel(t.substring(6),i)}async _bulkLabel(e,t){const i=[];this._selected.forEach(a=>{i.push((0,z.FB)(this.hass,a,{labels:"add"===t?this.hass.devices[a].labels.concat(e):this.hass.devices[a].labels.filter(t=>t!==e)}))});const a=await Promise.allSettled(i);if((0,m.$)(a)){const e=(0,m.N)(a);(0,I.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.common.multiselect.failed",{number:e.length}),text:(0,o.qy)(ie||(ie=me`<pre>
${0}</pre>`),e.map(e=>e.reason.message||e.reason.code||e.reason).join("\r\n"))})}}_clearSelection(){this._dataTable.clearSelection()}_handleSortingChanged(e){this._activeSorting=e.detail}_handleGroupingChanged(e){this._activeGrouping=e.detail.value}_handleCollapseChanged(e){this._activeCollapsed=e.detail.value}_handleColumnsChanged(e){this._activeColumnOrder=e.detail.columnOrder,this._activeHiddenColumns=e.detail.hiddenColumns}_handleBulkAction(e){const t=e.detail.item.value;t&&("delete_selected"===t&&this._deleteSelected(),t.startsWith("label_")?this._handleBulkLabel(e):t.startsWith("area_")&&this._handleBulkArea(e))}static get styles(){return[(0,o.AH)(ae||(ae=me`:host{display:block}hass-tabs-subpage-data-table{--data-table-row-height:60px}hass-tabs-subpage-data-table.narrow{--data-table-row-height:72px}.clear{color:var(--primary-color);padding-left:8px;padding-inline-start:8px;text-transform:uppercase;direction:var(--direction)}ha-assist-chip{--ha-assist-chip-container-shape:10px}ha-dropdown::part(menu),ha-dropdown::part(submenu){--auto-size-available-width:calc(50vw - var(--ha-space-4))}ha-dropdown ha-assist-chip{--md-assist-chip-trailing-space:8px}`)),D.RF]}constructor(...e){var t;super(...e),this.narrow=!1,this.isWide=!1,this.entities=[],this._searchParms=new URLSearchParams(window.location.search),this._selected=[],this._selectedCanDelete=[],this._filter=(null===(t=history.state)||void 0===t?void 0:t.filter)||"",this._filters={},this._storageFilters={},this._sizeController=new s.P(this,{callback:e=>{var t;return null===(t=e[0])||void 0===t?void 0:t.contentRect.width}}),this._ignoreLocationChange=!1,this._fromUrl=!1,this._locationChanged=()=>{this._ignoreLocationChange?this._ignoreLocationChange=!1:window.location.search.substring(1)!==this._searchParms.toString()&&(this._searchParms=new URLSearchParams(window.location.search),this._setFiltersFromUrl())},this._popState=()=>{window.location.search.substring(1)!==this._searchParms.toString()&&(this._searchParms=new URLSearchParams(window.location.search),this._setFiltersFromUrl())},this._states=(0,l.A)(e=>[{value:"disabled",label:e("ui.panel.config.devices.data_table.disabled_by")}]),this._devicesAndFilterDomains=(0,l.A)((e,t,i,a,s,n,o,r)=>{var l;let c=Object.values(e).map(e=>Object.assign(Object.assign({},e),{},{label_entries:[]}));const u={};for(const d of i)d.device_id&&(d.device_id in u||(u[d.device_id]=[]),u[d.device_id].push(d));const g={};for(const d of t)g[d.entry_id]=d;const v={};for(const d of s)v[d.domain]=d;let m;const f=new Set;Object.entries(n).forEach(([e,i])=>{if("config_entry"===e&&Array.isArray(i.value)&&i.value.length){c=c.filter(e=>e.config_entries.some(e=>i.value.includes(e)));const e=t.filter(e=>e.entry_id&&i.value.includes(e.entry_id));e.forEach(e=>{f.add(e.domain)}),1===e.length&&(m=e[0])}else if("sub_entry"===e&&Array.isArray(i.value)&&i.value.length){var a;if(!Array.isArray(null===(a=this._filters.config_entry)||void 0===a?void 0:a.value)||1!==this._filters.config_entry.value.length)return;const e=this._filters.config_entry.value[0];c=c.filter(t=>t.config_entries_subentries[e]&&i.value.some(i=>t.config_entries_subentries[e].includes(i))),this._subEntries||this._loadSubEntries(e)}else if("ha-filter-integrations"===e&&Array.isArray(i.value)&&i.value.length){const e=t.filter(e=>i.value.includes(e.domain)).map(e=>e.entry_id);c=c.filter(t=>t.config_entries.some(t=>e.includes(t))),i.value.forEach(e=>f.add(e))}else"ha-filter-labels"===e&&Array.isArray(i.value)&&i.value.length?c=c.filter(e=>e.labels.some(e=>i.value.includes(e))):i.items&&(c=c.filter(e=>i.items.has(e.id)))});const _=null===(l=n["ha-filter-states"])||void 0===l?void 0:l.value;(null==_?void 0:_.length)&&_.includes("disabled")||(c=c.filter(e=>!e.disabled_by));return{devicesOutput:c.map(e=>{var t,i,s;const n=(0,L.JW)(e.config_entries.filter(e=>e in g).map(e=>g[e]),e.primary_config_entry),l=(r&&(null==e?void 0:e.labels)||[]).map(e=>r.find(t=>t.label_id===e)).filter(e=>void 0!==e),{areaName:c}=(0,E.pq)(e,this.hass.areas,this.hass.devices,this.hass.states,this.hass.localize,this.hass.language,this.hass.translationMetadata,e.via_device_id?u[e.via_device_id]:void 0),v=null!==(t=(0,p.q)(e,a))&&void 0!==t?t:e.via_device_id&&this.hass.devices[e.via_device_id]?(0,p.q)(this.hass.devices[e.via_device_id],a):void 0,m=null==v?void 0:v.floor_id,f=m&&null!==(i=this.hass.floors)&&void 0!==i&&i[m]?(0,h.X)(this.hass.floors[m]):void 0;return Object.assign(Object.assign({},e),{},{name:(0,d.T)(e,this.hass.localize,this.hass.states,u[e.id]),model:e.model||`<${o("ui.panel.config.devices.data_table.unknown")}>`,manufacturer:e.manufacturer||`<${o("ui.panel.config.devices.data_table.unknown")}>`,area:c,floor:f,integration:n.length?n.map(e=>o(`component.${e.domain}.title`)||e.domain).join(", "):this.hass.localize("ui.panel.config.devices.data_table.no_integration"),domains:n.map(e=>e.domain),firmware_version:e.sw_version||void 0,battery_entity:[this._batteryEntity(e.id,u),this._batteryChargingEntity(e.id,u)],battery_level:null===(s=this.hass.states[this._batteryEntity(e.id,u)||""])||void 0===s?void 0:s.state,label_entries:l})}),filteredConfigEntry:m,filteredDomains:f}}),this._columns=(0,l.A)(e=>({icon:{title:"",label:e("ui.panel.config.devices.data_table.icon"),type:"icon",moveable:!1,showNarrow:!0,template:e=>{var t;return e.domains.length?(0,o.qy)(se||(se=me`<img alt="" crossorigin="anonymous" referrerpolicy="no-referrer" src="${0}">`),(0,O.MR)({domain:e.domains[0],type:"icon",darkOptimized:null===(t=this.hass.themes)||void 0===t?void 0:t.darkMode},this.hass.auth.data.hassUrl)):""}},name:{title:e("ui.panel.config.devices.data_table.device"),main:!0,sortable:!0,filterable:!0,direction:"asc",grows:!0,flex:2,minWidth:"150px",extraTemplate:e=>(0,o.qy)(ne||(ne=me` ${0} `),e.label_entries.length?(0,o.qy)(oe||(oe=me` <ha-data-table-labels .labels="${0}"></ha-data-table-labels> `),e.label_entries):o.s6)},area:(0,P.A7)(e),floor:(0,P.f8)(e),integration:{title:e("ui.panel.config.devices.data_table.integration"),sortable:!0,filterable:!0,groupable:!0,minWidth:"120px"},manufacturer:{title:e("ui.panel.config.devices.data_table.manufacturer"),sortable:!0,filterable:!0,groupable:!0,minWidth:"120px"},model:{title:e("ui.panel.config.devices.data_table.model"),sortable:!0,filterable:!0,minWidth:"120px"},firmware_version:{title:e("ui.panel.config.devices.data_table.firmware_version"),sortable:!0,filterable:!0,defaultHidden:!0,minWidth:"120px"},battery_entity:{title:e("ui.panel.config.devices.data_table.battery"),showNarrow:!0,sortable:!0,type:"numeric",maxWidth:"101px",minWidth:"101px",valueColumn:"battery_level",template:e=>{const t=e.battery_entity,i=t&&t[0]?this.hass.states[t[0]]:void 0,a=i?(0,u.t)(i):void 0,s=t&&t[1]?this.hass.states[t[1]]:void 0;return!i||"binary_sensor"!==a&&isNaN(i.state)?"—":(0,o.qy)(re||(re=me` ${0} <ha-battery-icon .hass="${0}" .batteryStateObj="${0}" .batteryChargingStateObj="${0}"></ha-battery-icon> `),"sensor"===a?this.hass.formatEntityState(i):o.s6,this.hass,i,s)}},created_at:(0,P.oO)(e,this.hass),modified_at:(0,P.Tr)(e,this.hass),disabled_by:{title:e("ui.panel.config.devices.picker.state"),type:"icon",defaultHidden:!0,sortable:!0,filterable:!0,minWidth:"80px",maxWidth:"80px",template:e=>e.disabled_by?(0,o.qy)(le||(le=me` <div tabindex="0" style="display:inline-block;position:relative"> <ha-svg-icon .id="svg-icon-${0}" .path="${0}"></ha-svg-icon> <ha-tooltip .for="svg-icon-${0}" placement="left"> ${0} </ha-tooltip> </div> `),e.id,fe,e.id,this.hass.localize("ui.panel.config.entities.picker.status.disabled")):"—"},labels:(0,P.AI)()})),this._renderAreaItems=(e="")=>(0,o.qy)(ce||(ce=me`${0} <ha-dropdown-item value="area_no" .slot="${0}"> ${0} </ha-dropdown-item> <wa-divider .slot="${0}"></wa-divider> <ha-dropdown-item value="area_create" .slot="${0}"> ${0} </ha-dropdown-item>`),Object.values(this.hass.areas).map(t=>(0,o.qy)(de||(de=me`<ha-dropdown-item .value="${0}" .slot="${0}"> ${0} ${0} </ha-dropdown-item>`),`area_${t.area_id}`,e,t.icon?(0,o.qy)(he||(he=me`<ha-icon slot="icon" .icon="${0}"></ha-icon>`),t.icon):(0,o.qy)(ue||(ue=me`<ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>`),$e),t.name)),e,this.hass.localize("ui.panel.config.devices.picker.bulk_actions.no_area"),e,e,this.hass.localize("ui.panel.config.devices.picker.bulk_actions.add_area")),this._renderLabelItems=(e="")=>{var t;return(0,o.qy)(pe||(pe=me`${0} <wa-divider .slot="${0}"></wa-divider> <ha-dropdown-item value="label_create" .slot="${0}"> ${0} </ha-dropdown-item>`),null===(t=this._labels)||void 0===t?void 0:t.map(t=>{const i=this._selected.every(e=>{var i;return null===(i=this.hass.devices[e])||void 0===i?void 0:i.labels.includes(t.label_id)}),a=!i&&this._selected.some(e=>{var i;return null===(i=this.hass.devices[e])||void 0===i?void 0:i.labels.includes(t.label_id)});return(0,o.qy)(ge||(ge=me`<ha-dropdown-item .slot="${0}" .value="${0}" .action="${0}" keep-open> <ha-checkbox slot="icon" .checked="${0}" .indeterminate="${0}"></ha-checkbox> <ha-label .color="${0}" .description="${0}"> ${0} ${0} </ha-label> </ha-dropdown-item>`),e,`label_${t.label_id}`,i?"remove":"add",i,a,t.color,t.description||void 0,t.icon?(0,o.qy)(ve||(ve=me`<ha-icon slot="icon" .icon="${0}"></ha-icon>`),t.icon):o.s6,t.name)}),e,e,this.hass.localize("ui.panel.config.labels.add_label"))},this._bulkCreateArea=()=>{(0,T.J)(this,{createEntry:async e=>{const t=await(0,H.L3)(this.hass,e);return this._bulkAddArea(t.area_id),t}})},this._bulkCreateLabel=()=>{(0,U.f)(this,{createEntry:async e=>{const t=await(0,q._9)(this.hass,e);this._bulkLabel(t.label_id,"add")}})},this._deleteSelected=()=>{(0,I.dk)(this,{title:this.hass.localize("ui.panel.config.devices.picker.bulk_actions.delete_selected.confirm_title"),text:this._selectedCanDelete.length===this._selected.length?this.hass.localize("ui.panel.config.devices.picker.bulk_actions.delete_selected.confirm_text"):this.hass.localize("ui.panel.config.devices.picker.bulk_actions.delete_selected.confirm_partly_text",{deletable:this._selectedCanDelete.length,selected:this._selected.length}),confirmText:this.hass.localize("ui.common.delete"),dismissText:this.hass.localize("ui.common.cancel"),destructive:!0,confirm:async()=>{const e=[];this._selectedCanDelete.forEach(t=>{var i;(null===(i=this.hass.devices[t])||void 0===i?void 0:i.config_entries).forEach(i=>{var a;null!==(a=this.entries.find(e=>e.entry_id===i))&&void 0!==a&&a.supports_remove_device&&e.push((0,z.nO)(this.hass,t,i))})});const t=await Promise.allSettled(e);(0,m.$)(t)&&(0,I.showAlertDialog)(this,{text:this.hass.localize("ui.panel.config.devices.picker.bulk_actions.delete_selected.partial_failure"),title:this.hass.localize("ui.panel.config.devices.picker.bulk_actions.delete_selected.partial_failure_title")}),this._clearSelection()}})}}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],Ce.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],Ce.prototype,"narrow",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"is-wide",type:Boolean})],Ce.prototype,"isWide",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],Ce.prototype,"entries",void 0),(0,a.Cg)([(0,r.wk)()],Ce.prototype,"_subEntries",void 0),(0,a.Cg)([(0,r.wk)(),(0,n.Fg)({context:M.ih,subscribe:!0})],Ce.prototype,"entities",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],Ce.prototype,"manifests",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],Ce.prototype,"route",void 0),(0,a.Cg)([(0,r.wk)()],Ce.prototype,"_searchParms",void 0),(0,a.Cg)([(0,r.wk)()],Ce.prototype,"_selected",void 0),(0,a.Cg)([(0,r.P)("hass-tabs-subpage-data-table",!0)],Ce.prototype,"_dataTable",void 0),(0,a.Cg)([(0,r.wk)(),(0,c.I)({storage:"sessionStorage",key:"devices-table-search",state:!0,subscribe:!1})],Ce.prototype,"_filter",void 0),(0,a.Cg)([(0,r.wk)()],Ce.prototype,"_filters",void 0),(0,a.Cg)([(0,c.I)({storage:"sessionStorage",key:"devices-table-filters-full",state:!1,subscribe:!1,serializer:V.iS,deserializer:V.Dc})],Ce.prototype,"_storageFilters",void 0),(0,a.Cg)([(0,r.wk)()],Ce.prototype,"_expandedFilter",void 0),(0,a.Cg)([(0,n.Fg)({context:M.HD,subscribe:!0}),(0,r.wk)()],Ce.prototype,"_labels",void 0),(0,a.Cg)([(0,c.I)({key:"devices-table-sort",state:!1,subscribe:!1})],Ce.prototype,"_activeSorting",void 0),(0,a.Cg)([(0,c.I)({key:"devices-table-grouping",state:!1,subscribe:!1})],Ce.prototype,"_activeGrouping",void 0),(0,a.Cg)([(0,c.I)({key:"devices-table-collapsed",state:!1,subscribe:!1})],Ce.prototype,"_activeCollapsed",void 0),(0,a.Cg)([(0,c.I)({key:"devices-table-column-order",state:!1,subscribe:!1})],Ce.prototype,"_activeColumnOrder",void 0),(0,a.Cg)([(0,c.I)({key:"devices-table-hidden-columns",state:!1,subscribe:!1})],Ce.prototype,"_activeHiddenColumns",void 0),Ce=(0,a.Cg)([(0,r.EM)("ha-config-devices-dashboard")],Ce),t()}catch(W){t(W)}})},73692:function(e,t,i){i.a(e,async function(e,a){try{i.r(t);i(3362),i(62953);var s=i(40445),n=i(67576),o=i(77423),r=i(95350),l=i(324),c=i(98129),d=i(99949),h=e([c,d]);[c,d]=h.then?(await h)():h;class u extends l.a{firstUpdated(e){super.firstUpdated(e),this._loadData()}updatePageEl(e){e.hass=this.hass,"device"===this._currentPage&&(e.deviceId=this.routeTail.path.substr(1)),e.entries=this._configEntries,e.manifests=this._manifests,e.narrow=this.narrow,e.isWide=this.isWide,e.route=this.routeTail}async _loadData(){this._configEntries=await(0,o.VN)(this.hass),this._manifests=await(0,r.fK)(this.hass)}constructor(...e){super(...e),this.narrow=!1,this.isWide=!1,this.routerOptions={defaultPage:"dashboard",routes:{dashboard:{tag:"ha-config-devices-dashboard",cache:!0},device:{tag:"ha-config-device-page"}}},this._configEntries=[],this._manifests=[]}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],u.prototype,"narrow",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"is-wide",type:Boolean})],u.prototype,"isWide",void 0),(0,s.Cg)([(0,n.wk)()],u.prototype,"_configEntries",void 0),(0,s.Cg)([(0,n.wk)()],u.prototype,"_manifests",void 0),u=(0,s.Cg)([(0,n.EM)("ha-config-devices")],u),a()}catch(u){a(u)}})},40747:function(e,t,i){i.d(t,{KT:function(){return m},Bi:function(){return v},ZI:function(){return g},Yp:function(){return f}});i(74423),i(44114),i(26910),i(13609),i(18111),i(22489),i(20116),i(7588),i(61701),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(42762),i(62953);var a=i(46190),s=i(71727),n=i(69093),o=i(28978);var r=i(79461),l=i(52220),c=i(95350),d=i(28669),h=i(24367);const u=new Set(["ai_task","automation","configurator","device_tracker","event","geo_location","notify","persistent_notification","script","sun","tag","todo","zone",...a.gt]),p=new Set(["backup","mobile_app"]),g=(e,t)=>Object.assign({type:"grid",cards:e.map(e=>({type:"tile",entity:e,show_entity_picture:["camera","image","person"].includes((0,s.m)(e))||void 0}))},t),v=(e,t,i,n=!0)=>{const c=[],d=e.states,h=[],u=i.title?i.title.toLowerCase():void 0,p=[];for(const a of t){const e=d[a],t=(0,s.m)(a);if("alarm_control_panel"===t){const e={type:"alarm-panel",entity:a};c.push(e)}else if("camera"===t){const e={type:"picture-entity",entity:a};c.push(e)}else if("image"===t){const e={type:"picture",image_entity:a};c.push(e)}else if("climate"===t){var g,m,f;const e={type:"thermostat",entity:a,features:(null!==(g=null===(m=d[a])||void 0===m||null===(m=m.attributes)||void 0===m||null===(m=m.hvac_modes)||void 0===m?void 0:m.length)&&void 0!==g?g:0)>1?[{type:"climate-hvac-modes",hvac_modes:null===(f=d[a])||void 0===f||null===(f=f.attributes)||void 0===f?void 0:f.hvac_modes}]:void 0};c.push(e)}else if("humidifier"===t){const e={type:"humidifier",entity:a,features:[{type:"humidifier-toggle"}]};c.push(e)}else if("media_player"===t){const e={type:"media-control",entity:a};c.push(e)}else if("plant"===t){const e={type:"plant-status",entity:a};c.push(e)}else if("weather"===t){const e={type:"weather-forecast",entity:a,show_forecast:!1};c.push(e)}else if(!n||"scene"!==t&&"script"!==t){let t;const i=u&&e&&(t=(0,r.p)((0,o.u)(e),u))?{entity:a,name:t}:a;h.push(i)}else{const t={entity:a,show_icon:!0,show_name:!0};let i;u&&e&&(i=(0,r.p)((0,o.u)(e),u))&&(t.name=i),p.push(t)}}if(h.sort((t,i)=>{const n="string"==typeof t?t:t.entity,r="string"==typeof i?i:i.entity,c=a.JF.includes((0,s.m)(n))?"sensor":"control";return c!==(a.JF.includes((0,s.m)(r))?"sensor":"control")?"sensor"===c?1:-1:(0,l.xL)("string"==typeof t?d[t]?(0,o.u)(d[t]):"":d[t.entity]?e.formatEntityName(d[t.entity],t.name):"","string"==typeof i?d[i]?(0,o.u)(d[i]):"":d[i.entity]?e.formatEntityName(d[i.entity],i.name):"")}),0===h.length&&p.length>0)return v(e,t,i,!1);if(h.length>0||p.length>0){const e=Object.assign({type:"entities",entities:h},i);p.length>0&&(e.footer={type:"buttons",entities:p}),c.unshift(e)}return c.length<2?c:[{type:"grid",square:!1,columns:1,cards:c}]},m=(e,t)=>{const i=[];for(const a of t){const e={type:"entity",entity:a};i.push(e)}return i},f=(e,t,i,a,r,g)=>{const m=e.states,f=e.areas,_=e.devices,b=e.entities,y=((e,t)=>{const i={},a=new Set(Object.values(t).filter(e=>e.entity_category||e.platform&&p.has(e.platform)||e.hidden).map(e=>e.entity_id));for(const s of Object.keys(e)){const t=e[s];u.has((0,n.t)(t))||a.has(t.entity_id)||(i[s]=e[s])}return i})(m,b),w={};for(const s of Object.keys(y)){const e=y[s];e.attributes.order&&(w[s]=e.attributes.order)}const $=((e,t,i,a)=>{const s=Object.assign({},a),n={},o={};for(const l of Object.values(i)){var r;const i=l.area_id||l.device_id&&(null===(r=t[l.device_id])||void 0===r?void 0:r.area_id);i&&i in e&&l.entity_id in s?(i in n||(n[i]=[]),n[i].push(s[l.entity_id]),delete s[l.entity_id]):l.device_id&&l.device_id in t&&l.entity_id in s&&(l.device_id in o||(o[l.device_id]=[]),o[l.device_id].push(s[l.entity_id]),delete s[l.entity_id])}for(const[l,c]of Object.entries(o))1===c.length&&(s[c[0].entity_id]=c[0],delete o[l]);return{areasWithEntities:n,devicesWithEntities:o,otherEntities:s}})(f,_,b,y);if(null!=a&&a.hidden)for(const s of a.hidden)delete $.areasWithEntities[s];r&&($.devicesWithEntities={},$.otherEntities={});const C=(e=>{const t=[],i={};return Object.keys(e).forEach(a=>{const n=e[a];"group"===(0,s.m)(a)?t.push(n):i[a]=n}),t.forEach(e=>e.attributes.entity_id.forEach(e=>{delete i[e]})),{groups:t,ungrouped:i}})($.otherEntities);C.groups.sort((e,t)=>w[e.entity_id]-w[t.entity_id]);const A=[];for(const s of C.groups)A.push(...v(e,s.attributes.entity_id,{title:(0,o.u)(s),show_header_toggle:"hidden"!==s.attributes.control}));const k=((e,t,i,a,s,r)=>{const u={},{localize:p}=e;for(const o of Object.keys(r)){const e=r[o],t=(0,n.t)(e);t in u||(u[t]=[]),u[t].push(e.entity_id)}const g=[];if("person"in u){const e=[];if(1===u.person.length)g.push({type:"entities",entities:u.person});else{let t,i="";for(const a of u.person){const s=r[a];let n=s.attributes.entity_picture;if(!n){if(void 0===t){const e=getComputedStyle(document.body);t=encodeURIComponent(e.getPropertyValue("--light-primary-color").trim()),i=encodeURIComponent((e.getPropertyValue("--text-light-primary-color")||e.getPropertyValue("--primary-text-color")).trim())}n=`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50' width='50' height='50' style='background-color:${t}'%3E%3Cg%3E%3Ctext font-family='roboto' x='50%25' y='50%25' text-anchor='middle' stroke='${i}' font-size='1.3em' dy='.3em'%3E${(0,d._2)(s.attributes.friendly_name||"")}%3C/text%3E%3C/g%3E%3C/svg%3E`}e.push({type:"picture-entity",entity:a,aspect_ratio:"1",show_name:!1,image:n})}g.push({type:"grid",square:!0,columns:3,cards:e})}delete u.person}const m=[];for(const n of h.L)n in u&&(m.push(...u[n]),delete u[n]);const f={};for(const n of Object.keys(u))f[n]=(0,c.p$)(p,n);m.length&&(u._helpers=m,f._helpers=p("ui.panel.lovelace.strategy.original-states.helpers")),Object.keys(u).sort((e,t)=>(0,l.xL)(f[e],f[t])).forEach(t=>{g.push(...v(e,u[t].sort((e,t)=>(0,l.xL)((0,o.u)(r[e]),(0,o.u)(r[t]))),{title:f[t]}))});const _={path:t,title:i,cards:g};return a&&(_.icon=a),s&&(_.show_icon_and_title=s),_})(e,"default_view","Home",void 0,void 0,C.ungrouped),x=[],H=Object.keys(f);if(null!=a&&a.order){const e=a.order;H.sort((0,l.u1)(e))}for(const s of H){if(!(s in $.areasWithEntities))continue;const t=$.areasWithEntities[s],i=f[s];x.push(...v(e,t.map(e=>e.entity_id),{title:i.name}))}const L=[],M=Object.entries($.devicesWithEntities).sort((e,t)=>{const i=_[e[0]],a=_[t[0]];return(0,l.xL)(i.name_by_user||i.name||"",a.name_by_user||a.name||"")});for(const[s,n]of M){const i=_[s];L.push(...v(e,n.map(e=>e.entity_id),{title:i.name_by_user||i.name||t("ui.panel.config.devices.unnamed_device",{type:t(`ui.panel.config.devices.type.${i.entry_type||"device"}`)})}))}let V;if(i&&!g){const e=i.energy_sources.find(e=>"grid"===e.type);e&&e.stat_energy_from&&(V={title:t("ui.panel.lovelace.cards.energy.energy_distribution.title_today"),type:"energy-distribution",link_dashboard:!0})}return k.cards.unshift(...x,...A,...V?[V]:[]),k.cards.push(...L),k}},20939:function(e,t,i){i.d(t,{L:function(){return s}});i(16280),i(18111),i(61701);var a=i(78649);const s=(e,t=!0)=>{if(!e||!Array.isArray(e))throw new Error("Entities need to be an array");return e.map((e,i)=>{if("object"==typeof e&&!Array.isArray(e)&&e.type)return e;let s;if("string"==typeof e)s={entity:e};else{if("object"!=typeof e||Array.isArray(e))throw new Error(`Invalid entity ID at position ${i}`);if(!("entity"in e))throw new Error(`Object at position ${i} is missing entity field`);s=e}if(t&&!(0,a.n)(s.entity))throw new Error(`Invalid entity ID at position ${i}: ${s.entity}`);return s})}},34128:function(e,t,i){i.d(t,{G9:function(){return o},Ni:function(){return n},Ue:function(){return d},Vd:function(){return h},gh:function(){return u}});i(16280),i(74423),i(3362),i(62953);var a=i(1087),s=i(45291);const n=e=>{const t=document.createElement("hui-error-card");return customElements.get("hui-error-card")?t.setConfig(e):(Promise.resolve().then(i.bind(i,4397)),customElements.whenDefined("hui-error-card").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t},o=(e,t)=>({type:"error",error:e,origConfig:t}),r=(e,t)=>{const i=document.createElement(e);return i.setConfig(t),i},l=(e,t,a)=>"badge"===e?(e=>{const t=document.createElement("hui-error-badge");return customElements.get("hui-error-badge")?t.setConfig(e):(Promise.all([i.e(92769),i.e(3283),i.e(72130),i.e(85010),i.e(67218),i.e(98470),i.e(99788),i.e(66283),i.e(82134),i.e(45981),i.e(26092),i.e(39005),i.e(34310),i.e(59704),i.e(25322),i.e(55392),i.e(89747),i.e(71572),i.e(36332),i.e(77563),i.e(15862),i.e(99143),i.e(41344),i.e(12009),i.e(66990),i.e(3025),i.e(38108),i.e(57693),i.e(38260)]).then(i.bind(i,50655)),customElements.whenDefined("hui-error-badge").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t})(o(t,a)):"heading-badge"===e?(e=>{const t=document.createElement("hui-error-heading-badge");return customElements.get("hui-error-heading-badge")?t.setConfig(e):(Promise.all([i.e(92769),i.e(3283),i.e(72130),i.e(85010),i.e(67218),i.e(98470),i.e(99788),i.e(66283),i.e(82134),i.e(45981),i.e(26092),i.e(39005),i.e(34310),i.e(59704),i.e(25322),i.e(55392),i.e(89747),i.e(71572),i.e(36332),i.e(77563),i.e(15862),i.e(99143),i.e(41344),i.e(12009),i.e(66990),i.e(3025),i.e(38108),i.e(57693),i.e(21614)]).then(i.bind(i,13469)),customElements.whenDefined("hui-error-heading-badge").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t})(((e,t)=>({type:"error",error:e,origConfig:t}))(t,a)):n({type:"error",message:t}),c=e=>(0,s.c8)(e)?(0,s.Iu)(e):void 0,d=(e,t,i,a,s,n)=>{try{return h(e,t,i,a,s,n)}catch(o){return console.error(e,t.type,o),l(e,o.message,t)}},h=(e,t,i,s,n,o)=>{if(!t||"object"!=typeof t)throw new Error("Config is not an object");if(!(t.type||o||n&&"entity"in t))throw new Error("No card type configured");const d=t.type?c(t.type):void 0;if(d)return((e,t,i)=>{if(customElements.get(t))return r(t,i);const s=l(e,`Custom element doesn't exist: ${t}.`,i);if(!t.includes("-"))return s;s.style.display="None";const n=window.setTimeout(()=>{s.style.display=""},2e3);return customElements.whenDefined(t).then(()=>{clearTimeout(n),(0,a.r)(s,"ll-rebuild")}),s})(e,d,t);let h;if(n&&!t.type&&t.entity){h=`${n[t.entity.split(".",1)[0]]||n._domain_not_found}-entity`}else h=t.type||o;if(void 0===h)throw new Error("No type specified");const u=`hui-${h}-${e}`;if(s&&h in s)return s[h](),((e,t)=>{if(customElements.get(e))return r(e,t);const i=document.createElement(e);return customElements.whenDefined(e).then(()=>{try{customElements.upgrade(i),(0,a.r)(i,"ll-upgrade"),i.setConfig(t)}catch(e){(0,a.r)(i,"ll-rebuild")}}),i})(u,t);if(i&&i.has(h))return r(u,t);throw new Error(`Unknown type encountered: ${h}`)},u=async(e,t,i,a)=>{const s=c(e);if(s){const e=customElements.get(s);if(e)return e;if(!s.includes("-"))throw new Error(`Custom element not found: ${s}`);return new Promise((e,t)=>{setTimeout(()=>t(new Error(`Custom element not found: ${s}`)),2e3),customElements.whenDefined(s).then(()=>e(customElements.get(s)))})}const n=`hui-${e}-${t}`,o=customElements.get(n);if(i&&i.has(e))return o;if(a&&e in a)return o||a[e]().then(()=>customElements.get(n));throw new Error(`Unknown type: ${e}`)}},94225:function(e,t,i){i.a(e,async function(e,a){try{i.d(t,{T:function(){return b},t:function(){return y}});i(3362),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var s=i(99799),n=i(29003),o=i(92055),r=i(19396),l=i(74323),c=i(51199),d=i(43721),h=i(65509),u=i(21659),p=i(82525),g=i(34128),v=e([s,n,o,r,l,c,d,h,u,p]);[s,n,o,r,l,c,d,h,u,p]=v.then?(await v)():v;const m=new Set(["media-player-entity","scene-entity","script-entity","sensor-entity","simple-entity","toggle-entity","button","call-service"]),f={"button-entity":()=>i.e(26846).then(i.bind(i,21869)),"climate-entity":()=>i.e(56995).then(i.bind(i,2798)),"cover-entity":()=>i.e(41243).then(i.bind(i,79734)),"date-entity":()=>i.e(17418).then(i.bind(i,75473)),"datetime-entity":()=>Promise.all([i.e(99194),i.e(24617),i.e(55328)]).then(i.bind(i,69690)),"event-entity":()=>Promise.resolve().then(i.bind(i,99799)),"group-entity":()=>i.e(68827).then(i.bind(i,53110)),"input-button-entity":()=>i.e(19825).then(i.bind(i,46472)),"humidifier-entity":()=>i.e(378).then(i.bind(i,53537)),"input-datetime-entity":()=>i.e(71748).then(i.bind(i,1391)),"input-number-entity":()=>i.e(17600).then(i.bind(i,58723)),"input-select-entity":()=>i.e(44325).then(i.bind(i,54596)),"input-text-entity":()=>i.e(8086).then(i.bind(i,51765)),"lock-entity":()=>i.e(28245).then(i.bind(i,49748)),"number-entity":()=>i.e(71523).then(i.bind(i,57198)),"select-entity":()=>i.e(9374).then(i.bind(i,78157)),"text-entity":()=>i.e(67973).then(i.bind(i,58212)),"time-entity":()=>Promise.all([i.e(21209),i.e(7004)]).then(i.bind(i,87550)),"timer-entity":()=>i.e(94097).then(i.bind(i,6344)),"update-entity":()=>i.e(80275).then(i.bind(i,38238)),"valve-entity":()=>i.e(96654).then(i.bind(i,46493)),conditional:()=>Promise.all([i.e(67218),i.e(77563),i.e(78490)]).then(i.bind(i,80725)),"weather-entity":()=>Promise.all([i.e(12009),i.e(77547)]).then(i.bind(i,80395)),divider:()=>i.e(45249).then(i.bind(i,38584)),section:()=>i.e(51255).then(i.bind(i,39082)),weblink:()=>i.e(69148).then(i.bind(i,65751)),cast:()=>i.e(10405).then(i.bind(i,96612)),buttons:()=>i.e(50777).then(i.bind(i,65728)),attribute:()=>Promise.resolve().then(i.bind(i,65509)),text:()=>i.e(95421).then(i.bind(i,3980))},_={_domain_not_found:"simple",alert:"toggle",automation:"toggle",button:"button",climate:"climate",cover:"cover",date:"date",datetime:"datetime",event:"event",fan:"toggle",group:"group",humidifier:"humidifier",input_boolean:"toggle",input_button:"input-button",input_datetime:"input-datetime",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",number:"number",remote:"toggle",scene:"scene",script:"script",select:"select",sensor:"sensor",siren:"toggle",switch:"toggle",text:"text",time:"time",timer:"timer",update:"update",vacuum:"toggle",valve:"valve",water_heater:"climate",weather:"weather"},b=e=>(0,g.Ue)("row",e,m,f,_,void 0),y=e=>(0,g.gh)(e,"row",m,f);a()}catch(m){a(m)}})},12496:function(e,t,i){i.d(t,{Q:function(){return l}});i(18111),i(22489),i(3362),i(62953);var a=i(35952),s=i(71730),n=i(65063),o=i(57150),r=i(85633);const l=async(e,t,i,l,c)=>{var d,h;t.loadFragmentTranslation("lovelace");const u=await(0,s.SJ)(t),p=u.filter(e=>"storage"===e.mode),g=null===(d=t.panels.lovelace)||void 0===d||null===(d=d.config)||void 0===d?void 0:d.mode;if("storage"!==g&&!p.length)return void(0,o.Q)(e,{cardConfig:i,entities:c,yaml:!0});let v,m=null;if("storage"===g)try{v=await(0,a.Dz)(t.connection,null,!1)}catch(f){}if(!v&&p.length)for(const s of p)try{v=await(0,a.Dz)(t.connection,s.url_path,!1),m=s.url_path;break}catch(f){}v?p.length||null!==(h=v.views)&&void 0!==h&&h.length?p.length||1!==v.views.length?(0,r.X)(e,{lovelaceConfig:v,urlPath:m,allowDashboardChange:!0,actionLabel:t.localize("ui.common.next"),dashboards:u,viewSelectedCallback:(s,n,r)=>{(0,o.Q)(e,{cardConfig:i,sectionConfig:l,lovelaceConfig:n,saveConfig:async e=>{try{await(0,a.ql)(t,s,e)}catch(i){alert(t.localize("ui.panel.lovelace.add_entities.saving_failed"))}},path:[r],entities:c})}}):(0,o.Q)(e,{cardConfig:i,sectionConfig:l,lovelaceConfig:v,saveConfig:async e=>{try{await(0,a.ql)(t,null,e)}catch(f){alert(t.localize("ui.panel.lovelace.add_entities.saving_failed"))}},path:[0],entities:c}):(0,n.showAlertDialog)(e,{text:"You don't have any Lovelace views, first create a view in Lovelace."}):u.length>p.length?(0,o.Q)(e,{cardConfig:i,sectionConfig:l,entities:c,yaml:!0}):(0,n.showAlertDialog)(e,{text:"You don't seem to be in control of any dashboard, please take control first."})}},57150:function(e,t,i){i.d(t,{Q:function(){return n}});i(3362),i(62953);var a=i(1087);const s=()=>Promise.all([i.e(92769),i.e(3283),i.e(72130),i.e(85010),i.e(83113),i.e(67218),i.e(98470),i.e(99788),i.e(58303),i.e(21543),i.e(66283),i.e(82134),i.e(46601),i.e(63746),i.e(26092),i.e(39005),i.e(19112),i.e(34310),i.e(30002),i.e(59704),i.e(25322),i.e(53480),i.e(55392),i.e(89747),i.e(71572),i.e(55076),i.e(72453),i.e(36332),i.e(77563),i.e(15862),i.e(41344),i.e(97500),i.e(49625),i.e(40449)]).then(i.bind(i,78305)),n=(e,t)=>{(0,a.r)(e,"show-dialog",{dialogTag:"hui-dialog-suggest-card",dialogImport:s,dialogParams:t})}},85633:function(e,t,i){i.d(t,{X:function(){return s}});i(3362),i(62953);var a=i(1087);const s=(e,t)=>{(0,a.r)(e,"show-dialog",{dialogTag:"hui-dialog-select-view",dialogImport:()=>Promise.all([i.e(44335),i.e(40901)]).then(i.bind(i,54564)),dialogParams:t})}},70384:function(e,t,i){i.a(e,async function(e,a){try{i.d(t,{g:function(){return c}});var s=i(54495),n=i(71727),o=i(94225),r=e([o]);o=(r.then?(await r)():r)[0];class l extends s.WL{render(e,t,i){if(!this._element||this._entityId!==e&&(0,n.m)(e)!==(0,n.m)(this._entityId))this._element=(0,o.T)({entity:e,name:t});else if(this._entityId!==e||this._name!==t){var a,s;null===(a=(s=this._element).setConfig)||void 0===a||a.call(s,{entity:e,name:t})}return this._entityId=e,this._name=t,this._element.hass=i,this._element}}const c=(0,s.u$)(l);a()}catch(l){a(l)}})},30039:function(e,t,i){i.d(t,{R:function(){return s}});i(62953),i(3296),i(27208),i(48408),i(14603),i(47566),i(98721);var a=i(16869);const s=(e,t="")=>{const i=document.createElement("a");i.target="_blank",i.href=e,i.download=t,i.style.display="none",document.body.appendChild(i),i.dispatchEvent(new MouseEvent("click")),document.body.removeChild(i),e.startsWith("blob:")&&(a.B?setTimeout(()=>URL.revokeObjectURL(e),1e4):URL.revokeObjectURL(e))}},35370:function(e,t,i){var a=i(26198);e.exports=function(e,t,i){for(var s=0,n=arguments.length>2?i:a(t),o=new e(n);n>s;)o[s]=t[s++];return o}},29344:function(e,t,i){i.a(e,async function(e,a){try{i.d(t,{A:function(){return x}});i(27495),i(62953);var s=i(5124),n=i(67576),o=i(6412),r=i(63672),l=i(34514),c=i(40991),d=i(92070),h=i(41268),u=i(9395),p=i(62676),g=i(15477),v=i(31896),m=i(17060),f=i(19978),_=e([m]);m=(_.then?(await _)():_)[0];let $,C,A,k=e=>e;var b=Object.defineProperty,y=Object.getOwnPropertyDescriptor,w=(e,t,i,a)=>{for(var s,n=a>1?void 0:a?y(t,i):t,o=e.length-1;o>=0;o--)(s=e[o])&&(n=(a?s(t,i,n):s(n))||n);return a&&n&&b(t,i,n),n};let x=class extends p.q{static get validators(){return[...super.validators,(0,h.i)()]}get value(){var e;return null!==(e=this._value)&&void 0!==e?e:"on"}set value(e){this._value=e}handleSizeChange(){(0,c.b)(this.localName,this.size)}get checked(){var e;return this.valueHasChanged?Boolean(this._checked):null!==(e=this._checked)&&void 0!==e?e:this.defaultChecked}set checked(e){this._checked=Boolean(e),this.valueHasChanged=!0}handleClick(){this.hasInteracted=!0,this.checked=!this.checked,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}handleKeyDown(e){const t="rtl"===this.localize.dir();"ArrowLeft"===e.key&&(e.preventDefault(),this.checked=t,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))})),"ArrowRight"===e.key&&(e.preventDefault(),this.checked=!t,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}))}willUpdate(e){super.willUpdate(e),(e.has("value")||e.has("checked")||e.has("defaultChecked"))&&this.handleValueOrCheckedChange()}handleValueOrCheckedChange(){this.setValue(this.checked?this.value:null,this._value),this.updateValidity()}handleStateChange(){this.hasUpdated&&(this.input.checked=this.checked),this.customStates.set("checked",this.checked),this.updateValidity()}handleDisabledChange(){this.updateValidity()}click(){this.input.click()}focus(e){this.input.focus(e)}blur(){this.input.blur()}setValue(e,t){this.checked?this.internals.setFormValue(null!=e?e:"on",t):this.internals.setFormValue(null,null)}formResetCallback(){this._checked=null,super.formResetCallback(),this.handleValueOrCheckedChange()}render(){const e=this.hasUpdated?this.hasSlotController.test("hint"):this.withHint,t=!!this.hint||!!e;return(0,s.qy)($||($=k` <label part="base" class="${0}"> <input class="input" type="checkbox" title="${0}" name="${0}" value="${0}" .checked="${0}" .disabled="${0}" .required="${0}" role="switch" aria-checked="${0}" aria-describedby="hint" @click="${0}" @keydown="${0}"> <span part="control" class="switch"> <span part="thumb" class="thumb"></span> </span> <slot part="label" class="label"></slot> </label> <slot id="hint" name="hint" part="hint" class="${0}" aria-hidden="${0}">${0}</slot> `),(0,o.H)({checked:this.checked,disabled:this.disabled}),this.title,(0,r.J)(this.name),(0,r.J)(this.value),(0,l.V)(this.checked),this.disabled,this.required,this.checked?"true":"false",this.handleClick,this.handleKeyDown,(0,o.H)({"has-slotted":t}),t?"false":"true",this.hint)}constructor(){var e;super(...arguments),this.hasSlotController=new d.X(this,"hint"),this.localize=new m.c(this),this.title="",this.name=null,this._value=null!==(e=this.getAttribute("value"))&&void 0!==e?e:null,this.size="m",this.disabled=!1,this._checked=null,this.defaultChecked=this.hasAttribute("checked"),this.required=!1,this.hint="",this.withHint=!1}};x.shadowRootOptions=Object.assign(Object.assign({},p.q.shadowRootOptions),{},{delegatesFocus:!0}),x.css=[g.A,v.A,f.A],w([(0,n.P)('input[type="checkbox"]')],x.prototype,"input",2),w([(0,n.MZ)()],x.prototype,"title",2),w([(0,n.MZ)({reflect:!0})],x.prototype,"name",2),w([(0,n.MZ)({reflect:!0})],x.prototype,"value",1),w([(0,n.MZ)({reflect:!0})],x.prototype,"size",2),w([(0,u.w)("size")],x.prototype,"handleSizeChange",1),w([(0,n.MZ)({type:Boolean})],x.prototype,"disabled",2),w([(0,n.MZ)({type:Boolean,attribute:!1})],x.prototype,"checked",1),w([(0,n.MZ)({type:Boolean,attribute:"checked",reflect:!0})],x.prototype,"defaultChecked",2),w([(0,n.MZ)({type:Boolean,reflect:!0})],x.prototype,"required",2),w([(0,n.MZ)({attribute:"hint"})],x.prototype,"hint",2),w([(0,n.MZ)({attribute:"with-hint",type:Boolean})],x.prototype,"withHint",2),w([(0,u.w)(["checked","defaultChecked"])],x.prototype,"handleStateChange",1),w([(0,u.w)("disabled",{waitUntilFirstUpdate:!0})],x.prototype,"handleDisabledChange",1),x=w([(0,n.EM)("wa-switch")],x),null===(C=(A=x).disableWarning)||void 0===C||C.call(A,"change-in-update"),a()}catch($){a($)}})},19978:function(e,t,i){i.d(t,{A:function(){return s}});let a;var s=(0,i(5124).AH)(a||(a=(e=>e)`:host{--height:var(--wa-form-control-toggle-size);--width:calc(var(--height) * 1.75);--thumb-size:0.75em;display:inline-flex;line-height:var(--wa-form-control-value-line-height)}label{position:relative;display:flex;align-items:center;font:inherit;color:var(--wa-form-control-value-color);vertical-align:middle;cursor:pointer}.switch{flex:0 0 auto;position:relative;display:flex;align-items:center;justify-content:center;width:var(--width);height:var(--height);background-color:var(--wa-form-control-background-color);border-color:var(--wa-form-control-border-color);border-radius:var(--height);border-style:var(--wa-form-control-border-style);border-width:var(--wa-form-control-border-width);transition-property:translate,background,border-color,box-shadow;transition-duration:var(--wa-transition-normal);transition-timing-function:var(--wa-transition-easing)}.switch .thumb{aspect-ratio:1/1;width:var(--thumb-size);height:var(--thumb-size);background-color:var(--wa-form-control-border-color);border-radius:50%;translate:calc((var(--width) - var(--height))/ -2);transition:inherit}.switch .thumb:dir(rtl){translate:calc((var(--width) - var(--height))/ 2)}.input{position:absolute;opacity:0;padding:0;margin:0;pointer-events:none}label:not(.disabled) .input:focus-visible~.switch .thumb{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}.checked .switch{background-color:var(--wa-form-control-activated-color);border-color:var(--wa-form-control-activated-color)}.checked .switch .thumb{background-color:var(--wa-color-surface-default);translate:calc((var(--width) - var(--height))/ 2)}.checked .switch .thumb:dir(rtl){translate:calc((var(--width) - var(--height))/ -2)}label:has(> :disabled){opacity:.5;cursor:not-allowed}[part~=label]{display:inline-block;line-height:var(--height);margin-inline-start:.5em;user-select:none;-webkit-user-select:none}:host([required]) [part~=label]::after{content:var(--wa-form-control-required-content);color:var(--wa-form-control-required-content-color);margin-inline-start:var(--wa-form-control-required-content-offset)}@media (forced-colors:active){:checked+.switch .thumb,:checked:enabled+.switch:hover .thumb{background-color:ButtonText}}`))},95010:function(e,t,i){i.d(t,{q:function(){return s},N:function(){return n}});i(54743),i(11745),i(16573),i(78100),i(77936),i(21489),i(48140),i(75044),i(21903),i(91134),i(28845),i(373),i(37467),i(44732),i(79577),i(16632),i(34226),i(9486),i(20456);let a=(e=21)=>{let t="",i=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&i[e]];return t};function s(e,t,i){const a=e=>Object.is(e,-0)?0:e;return a(e<t?t:e>i?i:e)}function n(e=""){return`${e}${a()}`}},4444:function(e,t,i){i.d(t,{JG:function(){return s},Rt:function(){return o},I7:function(){return n}});i(27495),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(25440),i(62953);const a=new Set;function s(e){if(a.add(e),!document.documentElement.classList.contains("wa-scroll-lock")){const e=function(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}()+function(){const e=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));return isNaN(e)||!e?0:e}();let t=getComputedStyle(document.documentElement).scrollbarGutter;t&&"auto"!==t||(t="stable"),e<2&&(t=""),document.documentElement.style.setProperty("--wa-scroll-lock-gutter",t),document.documentElement.classList.add("wa-scroll-lock"),document.documentElement.style.setProperty("--wa-scroll-lock-size",`${e}px`)}}function n(e){a.delete(e),0===a.size&&(document.documentElement.classList.remove("wa-scroll-lock"),document.documentElement.style.removeProperty("--wa-scroll-lock-size"))}function o(e,t,i="vertical",a="smooth"){const s=function(e,t){return{top:Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top),left:Math.round(e.getBoundingClientRect().left-t.getBoundingClientRect().left)}}(e,t),n=s.top+t.scrollTop,o=s.left+t.scrollLeft,r=t.scrollLeft,l=t.scrollLeft+t.offsetWidth,c=t.scrollTop,d=t.scrollTop+t.offsetHeight;"horizontal"!==i&&"both"!==i||(o<r?t.scrollTo({left:o,behavior:a}):o+e.clientWidth>l&&t.scrollTo({left:o-t.offsetWidth+e.clientWidth,behavior:a})),"vertical"!==i&&"both"!==i||(n<c?t.scrollTo({top:n,behavior:a}):n+e.clientHeight>d&&t.scrollTo({top:n-t.offsetHeight+e.clientHeight,behavior:a}))}},54495:function(e,t,i){i.d(t,{OA:function(){return a.OA},WL:function(){return a.WL},u$:function(){return a.u$}});var a=i(42017)}}]);