iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
35 lines • 108 kB
JavaScript
/*! For license information please see 53897.58b842543611dc35.js.LICENSE.txt */
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[53897],{72487:function(e,t,i){i.a(e,async function(e,a){try{i.d(t,{CA:function(){return x},Mi:function(){return H},Pm:function(){return $},Wq:function(){return b},Yq:function(){return c},bl:function(){return S},c2:function(){return w},fr:function(){return m},gu:function(){return M},kz:function(){return h},m9:function(){return V},sl:function(){return v},ur:function(){return E},zB:function(){return p}});i(18111),i(20116);var s=i(74487),o=i(22786),n=i(46927),r=i(8480),l=e([s,r]);[s,r]=l.then?(await l)():l;(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",month:"long",day:"numeric",timeZone:(0,r.wj)(e.time_zone,t)}));const c=(e,t,i)=>d(t,i.time_zone).format(e),d=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",timeZone:(0,r.wj)(e.time_zone,t)})),h=(e,t,i)=>u(t,i.time_zone).format(e),u=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",timeZone:(0,r.wj)(e.time_zone,t)})),p=(e,t,i)=>{var a,s,o,r;const l=g(t,i.time_zone);if(t.date_format===n.ow.language||t.date_format===n.ow.system)return l.format(e);const c=l.formatToParts(e),d=null===(a=c.find(e=>"literal"===e.type))||void 0===a?void 0:a.value,h=null===(s=c.find(e=>"day"===e.type))||void 0===s?void 0:s.value,u=null===(o=c.find(e=>"month"===e.type))||void 0===o?void 0:o.value,p=null===(r=c.find(e=>"year"===e.type))||void 0===r?void 0:r.value,v=c[c.length-1];let _="literal"===(null==v?void 0:v.type)?null==v?void 0:v.value:"";"bg"===t.language&&t.date_format===n.ow.YMD&&(_="");return{[n.ow.DMY]:`${h}${d}${u}${d}${p}${_}`,[n.ow.MDY]:`${u}${d}${h}${d}${p}${_}`,[n.ow.YMD]:`${p}${d}${u}${d}${h}${_}`}[t.date_format]},g=(0,o.A)((e,t)=>{const i=e.date_format===n.ow.system?void 0:e.language;return e.date_format===n.ow.language||(e.date_format,n.ow.system),new Intl.DateTimeFormat(i,{year:"numeric",month:"numeric",day:"numeric",timeZone:(0,r.wj)(e.time_zone,t)})}),v=(e,t,i)=>_(t,i.time_zone).format(e),_=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{day:"numeric",month:"short",timeZone:(0,r.wj)(e.time_zone,t)})),m=(e,t,i)=>f(t,i.time_zone).format(e),f=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",year:"numeric",timeZone:(0,r.wj)(e.time_zone,t)})),b=(e,t,i)=>y(t,i.time_zone).format(e),y=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",timeZone:(0,r.wj)(e.time_zone,t)})),w=(e,t,i)=>C(t,i.time_zone).format(e),C=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"short",timeZone:(0,r.wj)(e.time_zone,t)})),$=(e,t,i)=>k(t,i.time_zone).format(e),k=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",timeZone:(0,r.wj)(e.time_zone,t)})),x=(e,t,i)=>A(t,i.time_zone).format(e),A=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",timeZone:(0,r.wj)(e.time_zone,t)})),M=(e,t,i)=>z(t,i.time_zone).format(e),z=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",timeZone:(0,r.wj)(e.time_zone,t)})),H=(e,t,i)=>L(t,i.time_zone).format(e),L=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",month:"short",day:"numeric",timeZone:(0,r.wj)(e.time_zone,t)})),E=(e,t,i)=>I(t,i.time_zone).format(e),I=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",month:"short",day:"numeric",year:"numeric",timeZone:(0,r.wj)(e.time_zone,t)})),S=(e,t,i)=>{const a=(0,r.wj)(t.time_zone,i.time_zone);return new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",timeZone:a}).format(e)},V=(e,t,i,a)=>`${S(e,i,a)}/${S(t,i,a)}`;a()}catch(c){a(c)}})},30162:function(e,t,i){i.a(e,async function(e,a){try{i.d(t,{LW:function(){return v},Xs:function(){return p},fU:function(){return c},ie:function(){return h}});var s=i(74487),o=i(22786),n=i(8480),r=i(69543),l=e([s,n]);[s,n]=l.then?(await l)():l;const c=(e,t,i)=>d(t,i.time_zone).format(e),d=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,r.J)(e)?"h12":"h23",timeZone:(0,n.wj)(e.time_zone,t)})),h=(e,t,i)=>u(t,i.time_zone).format(e),u=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{hour:(0,r.J)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,r.J)(e)?"h12":"h23",timeZone:(0,n.wj)(e.time_zone,t)})),p=(e,t,i)=>g(t,i.time_zone).format(e),g=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",hour:(0,r.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,r.J)(e)?"h12":"h23",timeZone:(0,n.wj)(e.time_zone,t)})),v=(e,t,i)=>_(t,i.time_zone).format(e),_=(0,o.A)((e,t)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,n.wj)(e.time_zone,t)}));a()}catch(c){a(c)}})},69543:function(e,t,i){i.d(t,{J:function(){return o}});i(74423);var a=i(22786),s=i(46927);const o=(0,a.A)(e=>{if(e.time_format===s.Hg.language||e.time_format===s.Hg.system){const t=e.time_format===s.Hg.language?e.language:void 0;return new Date("January 1, 2023 22:00:00").toLocaleString(t).includes("10")}return e.time_format===s.Hg.am_pm})},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}},34470:function(e,t,i){i.d(t,{E:function(){return s}});let a;const s=(0,i(5124).AH)(a||(a=(e=>e)`ha-state-icon[data-domain=alarm_control_panel][data-state=arming],ha-state-icon[data-domain=alarm_control_panel][data-state=pending],ha-state-icon[data-domain=alarm_control_panel][data-state=triggered],ha-state-icon[data-domain=lock][data-state=jammed]{animation:pulse 1s infinite}@keyframes pulse{0%{opacity:1}50%{opacity:0}100%{opacity:1}}ha-state-icon[data-state=unavailable]{color:var(--state-unavailable-color)}`))},3931:function(e,t,i){i.d(t,{U:function(){return a}});i(3362),i(62953);const a=async(e,t,i,a,s,...o)=>{let n=a[e];n||(n=a[e]={});const r=n[s];if(r)return r;const l=i(a,s,...o);return n[s]=l,l.then(()=>setTimeout(()=>{n[s]=void 0},t),()=>{n[s]=void 0}),l}},1798:function(e,t,i){i.a(e,async function(e,t){try{i(18111),i(61701),i(53921),i(3362),i(62953);var a=i(40445),s=i(5124),o=i(67576),n=i(22786),r=i(1087),l=i(65522),c=i(37981),d=i(76774),h=i(77423),u=i(31422),p=i(44144),g=i(38508),v=e([g]);g=(v.then?(await v)():v)[0];let _,m,f,b,y,w,C,$,k,x=e=>e;class A extends s.WF{firstUpdated(e){super.firstUpdated(e),this._loadConfigEntries()}async _loadConfigEntries(){const e=await(0,h.VN)(this.hass);this._configEntryLookup=Object.fromEntries(e.map(e=>[e.entry_id,e]))}render(){var e;const t=null!==(e=this.placeholder)&&void 0!==e?e:this.hass.localize("ui.components.device-picker.placeholder"),i=this._valueRenderer(this._configEntryLookup);return(0,s.qy)(_||(_=x` <ha-generic-picker .hass="${0}" .autofocus="${0}" .disabled="${0}" .helper="${0}" .label="${0}" .searchLabel="${0}" .notFoundLabel="${0}" .emptyLabel="${0}" .placeholder="${0}" .value="${0}" .rowRenderer="${0}" .getItems="${0}" .hideClearIcon="${0}" .valueRenderer="${0}" .searchKeys="${0}" .unknownItemText="${0}" @value-changed="${0}"> </ha-generic-picker> `),this.hass,this.autofocus,this.disabled,this.helper,this.label,this.searchLabel,this._notFoundLabel,this.hass.localize("ui.components.device-picker.no_devices"),t,this.value,this._rowRenderer,this._getItems,this.hideClearIcon,i,u._o,this.hass.localize("ui.components.device-picker.unknown"),this._valueChanged)}async open(){var e;await this.updateComplete,await(null===(e=this._picker)||void 0===e?void 0:e.open())}_valueChanged(e){e.stopPropagation();const t=e.detail.value;this.value=t,(0,r.r)(this,"value-changed",{value:t})}constructor(...e){super(...e),this.autofocus=!1,this.disabled=!1,this.required=!1,this.hideClearIcon=!1,this._configEntryLookup={},this._getDevicesMemoized=(0,n.A)((e,t,i,a,s,o,n,r,l)=>(0,u.oG)(this.hass,t,i,a,s,o,n,r,l)),this._getItems=()=>this._getDevicesMemoized(this.hass.devices,this._configEntryLookup,this.includeDomains,this.excludeDomains,this.includeDeviceClasses,this.deviceFilter,this.entityFilter,this.excludeDevices,this.value),this._valueRenderer=(0,n.A)(e=>t=>{var i;const a=t,o=this.hass.devices[a];if(!o)return(0,s.qy)(m||(m=x`<span slot="headline">${0}</span>`),a);const n=(0,d.q)(o,this.hass.areas),r=o?(0,c.xn)(o):void 0,h=n?(0,l.A)(n):void 0,u=o.primary_config_entry?e[o.primary_config_entry]:void 0;return(0,s.qy)(f||(f=x` ${0} <span slot="headline">${0}</span> <span slot="supporting-text">${0}</span> `),u?(0,s.qy)(b||(b=x`<img slot="start" alt="" crossorigin="anonymous" referrerpolicy="no-referrer" src="${0}">`),(0,p.MR)({domain:u.domain,type:"icon",darkOptimized:null===(i=this.hass.themes)||void 0===i?void 0:i.darkMode},this.hass.auth.data.hassUrl)):s.s6,r,h)}),this._rowRenderer=e=>(0,s.qy)(y||(y=x` <ha-combo-box-item type="button"> ${0} <span slot="headline">${0}</span> ${0} ${0} </ha-combo-box-item> `),e.domain?(0,s.qy)(w||(w=x` <img slot="start" alt="" crossorigin="anonymous" referrerpolicy="no-referrer" src="${0}"> `),(0,p.MR)({domain:e.domain,type:"icon",darkOptimized:this.hass.themes.darkMode},this.hass.auth.data.hassUrl)):s.s6,e.primary,e.secondary?(0,s.qy)(C||(C=x`<span slot="supporting-text">${0}</span>`),e.secondary):s.s6,e.domain_name?(0,s.qy)($||($=x` <div slot="trailing-supporting-text" class="domain"> ${0} </div> `),e.domain_name):s.s6),this._notFoundLabel=e=>this.hass.localize("ui.components.device-picker.no_match",{term:(0,s.qy)(k||(k=x`<b>‘${0}’</b>`),e)})}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],A.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],A.prototype,"autofocus",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],A.prototype,"disabled",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],A.prototype,"required",void 0),(0,a.Cg)([(0,o.MZ)()],A.prototype,"label",void 0),(0,a.Cg)([(0,o.MZ)()],A.prototype,"value",void 0),(0,a.Cg)([(0,o.MZ)()],A.prototype,"helper",void 0),(0,a.Cg)([(0,o.MZ)()],A.prototype,"placeholder",void 0),(0,a.Cg)([(0,o.MZ)({type:String,attribute:"search-label"})],A.prototype,"searchLabel",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],A.prototype,"createDomains",void 0),(0,a.Cg)([(0,o.MZ)({type:Array,attribute:"include-domains"})],A.prototype,"includeDomains",void 0),(0,a.Cg)([(0,o.MZ)({type:Array,attribute:"exclude-domains"})],A.prototype,"excludeDomains",void 0),(0,a.Cg)([(0,o.MZ)({type:Array,attribute:"include-device-classes"})],A.prototype,"includeDeviceClasses",void 0),(0,a.Cg)([(0,o.MZ)({type:Array,attribute:"exclude-devices"})],A.prototype,"excludeDevices",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],A.prototype,"deviceFilter",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],A.prototype,"entityFilter",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"hide-clear-icon",type:Boolean})],A.prototype,"hideClearIcon",void 0),(0,a.Cg)([(0,o.P)("ha-generic-picker")],A.prototype,"_picker",void 0),(0,a.Cg)([(0,o.wk)()],A.prototype,"_configEntryLookup",void 0),A=(0,a.Cg)([(0,o.EM)("ha-device-picker")],A),t()}catch(_){t(_)}})},74281:function(e,t,i){i.a(e,async function(e,t){try{i(18111),i(7588),i(45367),i(92731),i(62953);var a=i(40445),s=i(5124),o=i(67576),n=i(63672),r=i(89784),l=i(71727),c=i(69093),d=i(52658),h=i(34470),u=i(10897),p=i(38279),g=i(93367),v=e([g]);g=(v.then?(await v)():v)[0];let _,m,f,b=e=>e;const y="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z";class w extends s.WF{connectedCallback(){var e,t;super.connectedCallback(),this.hasUpdated&&void 0===this.overrideImage&&(null!==(e=this.stateObj)&&void 0!==e&&e.attributes.entity_picture||null!==(t=this.stateObj)&&void 0!==t&&t.attributes.entity_picture_local)&&this.requestUpdate("stateObj")}disconnectedCallback(){var e,t;super.disconnectedCallback(),void 0===this.overrideImage&&(null!==(e=this.stateObj)&&void 0!==e&&e.attributes.entity_picture||null!==(t=this.stateObj)&&void 0!==t&&t.attributes.entity_picture_local)&&(this.style.backgroundImage="")}get _stateColor(){var e;const t=this.stateObj?(0,c.t)(this.stateObj):void 0;return null!==(e=this.stateColor)&&void 0!==e?e:"light"===t}render(){const e=this.stateObj;if(!e&&!this.overrideIcon&&!this.overrideImage)return(0,s.qy)(_||(_=b`<div class="missing"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div>`),y);const t=this.getClass();if(t&&t.forEach((e,t)=>{e?this.classList.add(t):this.classList.remove(t)}),!this.icon)return s.s6;const i=e?(0,c.t)(e):void 0;return(0,s.qy)(m||(m=b`<ha-state-icon style="${0}" data-domain="${0}" data-state="${0}" .icon="${0}" .stateObj="${0}"></ha-state-icon>`),(0,r.W)(this._iconStyle),(0,n.J)(i),(0,n.J)(null==e?void 0:e.state),this.overrideIcon,e)}willUpdate(e){if(super.willUpdate(e),!(e.has("stateObj")||e.has("overrideImage")||e.has("overrideIcon")||e.has("stateColor")||e.has("color")))return;const t=this.stateObj,i={};let a="";if(this.icon=!0,t){const e=(0,l.m)(t.entity_id);if(void 0===this.overrideImage)if(!t.attributes.entity_picture_local&&!t.attributes.entity_picture||this.overrideIcon){if(this.color)i.color=this.color;else if(this._stateColor){const e=(0,d.Se)(t);if(e&&(i.color=e),t.attributes.rgb_color&&(i.color=`rgb(${t.attributes.rgb_color.join(",")})`),t.attributes.brightness){const e=t.attributes.brightness;if("number"!=typeof e){const i=`Type error: state-badge expected number, but type of ${t.entity_id}.attributes.brightness is ${typeof e} (${e})`;console.warn(i)}i.filter=(0,d.mT)(t)}if(t.attributes.hvac_action){const e=t.attributes.hvac_action;e in p.sx?i.color=(0,d.Se)(t,p.sx[e]):delete i.color}}}else{let i=t.attributes.entity_picture_local||t.attributes.entity_picture;this.hass&&(i=this.hass.hassUrl(i)),"camera"===e&&(i=(0,u.su)(i,80,80)),a=`url(${i})`,this.icon=!1}else if(this.overrideImage){let e=this.overrideImage;this.hass&&(e=this.hass.hassUrl(e)),a=`url(${e})`,this.icon=!1}}this._iconStyle=i,this.style.backgroundImage=a}getClass(){const e=new Map(["has-no-radius","has-media-image","has-image"].map(e=>[e,!1]));if(this.stateObj){const t=(0,l.m)(this.stateObj.entity_id);"update"===t?e.set("has-no-radius",!0):"media_player"===t||"camera"===t?e.set("has-media-image",!0):""!==this.style.backgroundImage&&e.set("has-image",!0)}return e}static get styles(){return[h.E,(0,s.AH)(f||(f=b`:host{position:relative;display:inline-flex;width:40px;color:var(--state-icon-color);border-radius:var(--state-badge-border-radius,50%);height:40px;background-size:cover;box-sizing:border-box;--state-inactive-color:initial;align-items:center;justify-content:center}:host(.has-image){border-radius:var(--state-badge-with-image-border-radius,50%)}:host(.has-media-image){border-radius:var(--state-badge-with-media-image-border-radius,8%)}:host(.has-no-radius){border-radius:var(--ha-border-radius-square)}:host(:focus){outline:0}:host(:not([icon]):focus){border:2px solid var(--divider-color)}:host([icon]:focus){background:var(--divider-color)}ha-state-icon{transition:color .3s ease-in-out,filter .3s ease-in-out}.missing{color:#fce588}`))]}constructor(...e){super(...e),this.icon=!0,this._iconStyle={}}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],w.prototype,"stateObj",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],w.prototype,"overrideIcon",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],w.prototype,"overrideImage",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],w.prototype,"stateColor",void 0),(0,a.Cg)([(0,o.MZ)()],w.prototype,"color",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],w.prototype,"icon",void 0),(0,a.Cg)([(0,o.wk)()],w.prototype,"_iconStyle",void 0),w=(0,a.Cg)([(0,o.EM)("state-badge")],w),t()}catch(_){t(_)}})},99611:function(e,t,i){i.a(e,async function(e,t){try{i(18111),i(13579),i(3362),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var a=i(40445),s=i(1126),o=i(35211),n=i(5124),r=i(67576),l=i(1087),c=i(60353),d=i(22792),h=i(59992),u=i(14503),p=i(22348),g=e([s,h]);[s,h]=g.then?(await g)():g;let v,_,m=e=>e;const f=300,b=new Set(["ha-control-slider","ha-slider","ha-control-switch","ha-control-circular-slider","ha-hs-color-picker","ha-map","ha-more-info-control-select-container","ha-filter-chip"]),y=new Set(["volume-slider-container","forecast"]);class w extends((0,h.V)(n.WF)){get scrollableElement(){return this._bodyElement}connectedCallback(){super.connectedCallback(),this.addEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.addEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0})}updated(e){super.updated(e),e.has("open")&&(this._drawerOpen=this.open)}render(){return(0,n.qy)(v||(v=m` <wa-drawer id="drawer" placement="bottom" .open="${0}" .lightDismiss="${0}" .ariaLabelledby="${0}" .ariaDescribedby="${0}" @keydown="${0}" @wa-show="${0}" @wa-after-show="${0}" @wa-hide="${0}" @wa-after-hide="${0}" @click="${0}" without-header @touchstart="${0}"> <div class="handle-wrapper" aria-hidden="true"> <div class="handle"></div> </div> <slot name="header"></slot> <div class="content-wrapper"> <div id="body" class="body ha-scrollbar"> <slot></slot> </div> ${0} </div> <slot name="footer"></slot> </wa-drawer> `),this._drawerOpen,!this.preventScrimClose,this.ariaLabelledBy,this.ariaDescribedBy,this._handleKeyDown,this._handleShow,this._handleAfterShow,this._handleHide,this._handleAfterHide,this._handleCloseAction,this._handleTouchStart,this.renderScrollableFades())}_startResizing(e){document.addEventListener("touchmove",this._handleTouchMove,{passive:!1}),document.addEventListener("touchend",this._handleTouchEnd),document.addEventListener("touchcancel",this._handleTouchEnd),this._gestureRecognizer.start(e)}_animateSnapBack(){this.style.setProperty("--dialog-transition",`transform ${f}ms ease-out`),this.style.removeProperty("--dialog-transform"),setTimeout(()=>{this.style.removeProperty("--dialog-transition")},f)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.removeEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0}),this._unregisterResizeHandlers(),this._isDragging=!1}static get styles(){return[...super.styles,u.dp,(0,n.AH)(_||(_=m`wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:${0}ms;--hide-duration:${0}ms}wa-drawer::part(dialog){max-height:min(var(--ha-bottom-sheet-max-height,90vh),calc(100vh - max(var(--safe-area-inset-top),48px)));max-height:min(var(--ha-bottom-sheet-max-height,90dvh),calc(100dvh - max(var(--safe-area-inset-top),48px)));align-items:center;transform:var(--dialog-transform);transition:var(--dialog-transition)}@media (prefers-reduced-motion:reduce){wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:1ms;--hide-duration:1ms}wa-drawer::part(dialog){transition:1ms}}wa-drawer::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));background-color:var(--ha-bottom-sheet-scrim-color,var(--mdc-dialog-scrim-color,none))}wa-drawer::part(body){max-width:var(--ha-bottom-sheet-max-width);width:100%;position:relative;border-top-left-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));border-top-right-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));background-color:var(--ha-bottom-sheet-surface-background,var(--ha-dialog-surface-background,var(--card-background-color,var(--ha-color-surface-default))));-webkit-backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));padding:var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left))}:host([flexcontent]) wa-drawer::part(body){display:flex;flex-direction:column}:host([prevent-scrim-close]) .handle-wrapper{display:none}.handle-wrapper{position:absolute;top:0;inset-inline-start:0;width:100%;padding-bottom:2px;display:flex;justify-content:center;align-items:center;pointer-events:none;z-index:1}.handle-wrapper .handle{height:16px;width:200px;display:flex;justify-content:center;align-items:center}.handle-wrapper .handle::after{content:"";border-radius:var(--ha-border-radius-md);height:4px;background:var(--ha-bottom-sheet-handle-color,var(--divider-color));width:40px}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{padding:var(--ha-bottom-sheet-content-padding,0);box-sizing:border-box}:host([flexcontent]) .body{flex:1;max-width:100%;display:flex;flex-direction:column;padding:var(--ha-bottom-sheet-content-padding,var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left)));box-sizing:border-box}slot[name=footer]{display:block;padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%;box-sizing:border-box}:host([flexcontent]) slot[name=footer]{flex-shrink:0}`),f,f)]}constructor(...e){super(...e),this.open=!1,this.flexContent=!1,this.preventScrimClose=!1,this._drawerOpen=!1,this._sliderInteractionActive=!1,this._gestureRecognizer=new c.u,this._isDragging=!1,this._escapePressed=!1,this._handleShow=async()=>{this._drawerOpen=!0,this.open=!0,(0,l.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{var e;const t=this._autofocusElement;null!==(e=this._hassConfig)&&void 0!==e&&e.auth.external&&(0,p.V)(this._hassConfig.auth.external)?t&&(t.id||(t.id="ha-bottom-sheet-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:t.id}})):null==t||t.focus()})},this._handleAfterShow=()=>{(0,l.r)(this,"after-show")},this._handleSliderInteractionStart=()=>{this._sliderInteractionActive=!0},this._handleSliderInteractionStop=()=>{this._sliderInteractionActive=!1},this._handleAfterHide=e=>{if(this._sliderInteractionActive)return this._drawerOpen=!0,void(this.open=!0);e.eventPhase===Event.AT_TARGET&&(this.open=!1,this._drawerOpen=!1,(0,l.r)(this,"closed"))},this._handleHide=e=>{if(e.eventPhase!==Event.AT_TARGET)return;const t=e.detail.source===e.target.drawer;if(this._sliderInteractionActive)return e.preventDefault(),this._drawerOpen=!0,this.open=!0,void(this._escapePressed=!1);this.preventScrimClose&&this._escapePressed&&t&&e.preventDefault(),this._escapePressed=!1},this._handleKeyDown=e=>{"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)},this._handleCloseAction=e=>{e.composedPath().some(e=>e instanceof HTMLElement&&("close"===e.getAttribute("data-dialog")||"close"===e.getAttribute("data-drawer")))&&(this._drawerOpen=!1)},this._handleTouchStart=e=>{if(this.preventScrimClose)return;const t=e.composedPath();for(const i of t){if(i===this._drawer)break;if(i instanceof HTMLElement&&(i.scrollTop>0||b.has(i.localName)||Array.from(i.classList).some(e=>y.has(e))))return}e.stopPropagation(),this._startResizing(e.touches[0].clientY)},this._handleTouchMove=e=>{const t=e.touches[0].clientY,i=this._gestureRecognizer.move(t);i<0&&(e.preventDefault(),this._isDragging=!0,requestAnimationFrame(()=>{this._isDragging&&this.style.setProperty("--dialog-transform",`translateY(${-1*i}px)`)}))},this._handleTouchEnd=()=>{var e;this._unregisterResizeHandlers(),this._isDragging=!1;const t=this._gestureRecognizer.end();if(t.isSwipe)return void(t.isDownwardSwipe?this._drawerOpen=!1:this._animateSnapBack());const i=null===(e=this._drawer.shadowRoot)||void 0===e?void 0:e.querySelector('[part="body"]'),a=(null==i?void 0:i.offsetHeight)||0;a>0&&t.delta<0&&Math.abs(t.delta)>.5*a?this._drawerOpen=!1:this._animateSnapBack()},this._unregisterResizeHandlers=()=>{document.removeEventListener("touchmove",this._handleTouchMove),document.removeEventListener("touchend",this._handleTouchEnd),document.removeEventListener("touchcancel",this._handleTouchEnd)}}}(0,a.Cg)([(0,r.MZ)({attribute:"aria-labelledby"})],w.prototype,"ariaLabelledBy",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"aria-describedby"})],w.prototype,"ariaDescribedBy",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],w.prototype,"open",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],w.prototype,"flexContent",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],w.prototype,"preventScrimClose",void 0),(0,a.Cg)([(0,r.wk)()],w.prototype,"_drawerOpen",void 0),(0,a.Cg)([(0,r.wk)()],w.prototype,"_sliderInteractionActive",void 0),(0,a.Cg)([(0,r.wk)(),(0,o.Fg)({context:d.WF,subscribe:!0})],w.prototype,"_hassConfig",void 0),(0,a.Cg)([(0,r.P)("#drawer")],w.prototype,"_drawer",void 0),(0,a.Cg)([(0,r.P)("#body")],w.prototype,"_bodyElement",void 0),(0,a.Cg)([(0,r.P)("[autofocus]")],w.prototype,"_autofocusElement",void 0),w=(0,a.Cg)([(0,r.EM)("ha-bottom-sheet")],w),t()}catch(v){t(v)}})},76776:function(e,t,i){i(62953);var a=i(40445),s=i(5124),o=i(67576);let n,r,l,c=e=>e;class d extends s.WF{render(){return(0,s.qy)(n||(n=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,o.MZ)()],d.prototype,"header",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],d.prototype,"raised",void 0),d=(0,a.Cg)([(0,o.EM)("ha-card")],d)},30716:function(e,t,i){i(3362),i(62953);var a=i(40445),s=i(72274),o=i(34875),n=i(7731),r=i(5124),l=i(67576),c=i(1087);const d=e=>e.preventDefault();var h=i(57237);i(9503);let u,p,g=e=>e;class v extends s.h{async onChange(e){e.stopPropagation(),super.onChange(e),(0,c.r)(this,e.type)}render(){const e=this.renderText(),t=this.graphic&&"control"!==this.graphic&&!this.left?this.renderGraphic():r.s6,i=this.hasMeta&&this.left?this.renderMeta():r.s6,a=this.renderRipple();return(0,r.qy)(u||(u=g` ${0} ${0} ${0} <ha-checkbox tabindex="${0}" .checked="${0}" .indeterminate="${0}" ?disabled="${0}" @change="${0}" @click="${0}" class="${0}"> </ha-checkbox> ${0} ${0}`),a,t,this.left?"":e,this.separateCheckboxClick?this.tabindex:-1,this.selected,this.indeterminate,this.disabled||this.checkboxDisabled,this.onChange,this.separateCheckboxClick?h.d:d,this.left?"left":"",this.left?e:"",i)}constructor(...e){super(...e),this.checkboxDisabled=!1,this.indeterminate=!1,this.separateCheckboxClick=!1}}v.styles=[n.R,o.R,(0,r.AH)(p||(p=g`:host{--mdc-theme-secondary:var(--primary-color)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic,:host([graphic=control]) .mdc-deprecated-list-item__graphic,:host([graphic=large]) .mdc-deprecated-list-item__graphic,:host([graphic=medium]) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,16px);margin-inline-start:0px;direction:var(--direction)}ha-checkbox{flex-shrink:0;direction:var(--direction);margin-inline-start:auto;margin-inline-end:0;height:100%;justify-content:center}ha-checkbox.left{margin-inline-start:0}.mdc-deprecated-list-item__graphic{margin-top:var(--check-list-item-graphic-margin-top)}:host([graphic=icon]) .mdc-deprecated-list-item__graphic{margin-inline-start:0;margin-inline-end:var(--mdc-list-item-graphic-margin,32px)}`))],(0,a.Cg)([(0,l.MZ)({type:Boolean,attribute:"checkbox-disabled"})],v.prototype,"checkboxDisabled",void 0),(0,a.Cg)([(0,l.MZ)({type:Boolean})],v.prototype,"indeterminate",void 0),(0,a.Cg)([(0,l.MZ)({type:Boolean,attribute:"separate-checkbox-click"})],v.prototype,"separateCheckboxClick",void 0),v=(0,a.Cg)([(0,l.EM)("ha-check-list-item")],v)},9503:function(e,t,i){var a=i(40445),s=i(97577),o=i(5124),n=i(67576);let r,l=e=>e;class c extends s.A{get value(){var e;return null!==(e=this._value)&&void 0!==e?e:null}set value(e){this._value=e}static get styles(){return[s.A.styles,(0,o.AH)(r||(r=l`:host{--wa-form-control-toggle-size:var(--ha-checkbox-size, 20px);--wa-form-control-border-color:var(
--ha-checkbox-border-color,
var(--ha-color-border-neutral-normal)
);--wa-form-control-background-color:var(
--ha-checkbox-background-color,
var(--wa-form-control-background-color)
);--checked-icon-color:var(
--ha-checkbox-checked-icon-color,
var(--wa-color-brand-on-loud)
);--wa-form-control-activated-color:var(
--ha-checkbox-checked-background-color,
var(--ha-color-fill-primary-loud-resting)
);-webkit-tap-highlight-color:transparent;--checked-icon-scale:var(--ha-checkbox-checked-icon-scale, 0.9);--wa-form-control-required-content:var(
--ha-checkbox-required-marker,
var(--ha-input-required-marker, "*")
);--wa-form-control-required-content-offset:var(
--ha-checkbox-required-marker-offset,
0.1rem
)}[part~=base]{align-items:center;gap:var(--ha-space-2)}[part~=control]{border-radius:var(--ha-checkbox-border-radius,var(--ha-border-radius-sm));border-width:var(--ha-checkbox-border-width,var(--ha-border-width-md));margin-inline-end:0}[part~=label]{line-height:1}#hint{font-size:var(--ha-font-size-xs);color:var(--ha-color-text-secondary)}label:has(input:not(:disabled)):hover{--wa-form-control-border-color:var(
--ha-checkbox-border-color-hover,
var(--ha-checkbox-border-color, var(--ha-color-border-neutral-loud))
)}label:has(input:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-background-color-hover,var(--ha-color-form-background-hover))}label:has(input:checked:not(:disabled)):hover [part~=control],label:has(input:indeterminate:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover));border-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover))}`))]}}c=(0,a.Cg)([(0,n.EM)("ha-checkbox")],c)},11382:function(e,t,i){i(3362),i(62953);var a=i(40445),s=i(5124),o=i(67576),n=i(6412),r=i(1087),l=i(12587);i(67094);let c,d,h,u,p=e=>e;class g extends s.WF{render(){const e=this.noCollapse?s.s6:(0,s.qy)(c||(c=p` <ha-svg-icon .path="${0}" class="summary-icon ${0}"></ha-svg-icon> `),"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",(0,n.H)({expanded:this.expanded}));return(0,s.qy)(d||(d=p` <div class="top ${0}"> <div id="summary" class="${0}" @click="${0}" @keydown="${0}" @focus="${0}" @blur="${0}" role="button" tabindex="${0}" aria-expanded="${0}" aria-controls="sect1" part="summary"> ${0} <slot name="leading-icon"></slot> <slot name="header"> <div class="header"> ${0} <slot class="secondary" name="secondary">${0}</slot> </div> </slot> <slot name="event"></slot> ${0} <slot name="icons"></slot> </div> </div> <div class="container ${0}" @transitionend="${0}" role="region" aria-labelledby="summary" aria-hidden="${0}" tabindex="-1"> ${0} </div> `),(0,n.H)({expanded:this.expanded}),(0,n.H)({noCollapse:this.noCollapse}),this._toggleContainer,this._toggleContainer,this._focusChanged,this._focusChanged,this.noCollapse?-1:0,this.expanded,this.leftChevron?e:s.s6,this.header,this.secondary,this.leftChevron?s.s6:e,(0,n.H)({expanded:this.expanded}),this._handleTransitionEnd,!this.expanded,this._showContent?(0,s.qy)(h||(h=p`<slot></slot>`)):"")}willUpdate(e){super.willUpdate(e),e.has("expanded")&&(this._showContent=this.expanded,setTimeout(()=>{this._container.style.overflow=this.expanded?"initial":"hidden"},300))}_handleTransitionEnd(){this._container.style.removeProperty("height"),this._container.style.overflow=this.expanded?"initial":"hidden",this._showContent=this.expanded}async _toggleContainer(e){if(e.defaultPrevented)return;if("keydown"===e.type&&"Enter"!==e.key&&" "!==e.key)return;if(e.preventDefault(),this.noCollapse)return;const t=!this.expanded;(0,r.r)(this,"expanded-will-change",{expanded:t}),this._container.style.overflow="hidden",t&&(this._showContent=!0,await(0,l.E)());const i=this._container.scrollHeight;this._container.style.height=`${i}px`,t||setTimeout(()=>{this._container.style.height="0px"},0),this.expanded=t,(0,r.r)(this,"expanded-changed",{expanded:this.expanded})}_focusChanged(e){this.noCollapse||this.shadowRoot.querySelector(".top").classList.toggle("focused","focus"===e.type)}constructor(...e){super(...e),this.expanded=!1,this.outlined=!1,this.leftChevron=!1,this.noCollapse=!1,this._showContent=this.expanded}}g.styles=(0,s.AH)(u||(u=p`:host{display:block}.top{display:flex;align-items:center;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg))}.top.expanded{border-bottom-left-radius:0px;border-bottom-right-radius:0px}.top.focused{background:var(--input-fill-color)}:host([outlined]){box-shadow:none;border-width:1px;border-style:solid;border-color:var(--outline-color);border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg))}.summary-icon{transition:transform 150ms cubic-bezier(.4, 0, .2, 1);direction:var(--direction);margin-left:8px;margin-inline-start:8px;margin-inline-end:initial;border-radius:var(--ha-border-radius-circle)}#summary:focus-visible ha-svg-icon.summary-icon{background-color:var(--ha-color-fill-neutral-normal-active)}::slotted([slot=leading-icon]),:host([left-chevron]) .summary-icon{margin-left:0;margin-right:8px;margin-inline-start:0;margin-inline-end:8px}#summary{flex:1;display:flex;padding:var(--expansion-panel-summary-padding,0 8px);min-height:48px;align-items:center;cursor:pointer;overflow:hidden;font-weight:var(--ha-font-weight-medium);outline:0}#summary.noCollapse{cursor:default}.summary-icon.expanded{transform:rotate(180deg)}.header,::slotted([slot=header]){flex:1;overflow-wrap:anywhere;color:var(--primary-text-color)}.container{padding:var(--expansion-panel-content-padding,0 8px);overflow:hidden;transition:height .3s cubic-bezier(.4, 0, .2, 1);height:0px}.container.expanded{height:auto}.secondary{display:block;color:var(--secondary-text-color);font-size:var(--ha-font-size-s)}`)),(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],g.prototype,"expanded",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],g.prototype,"outlined",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"left-chevron",type:Boolean,reflect:!0})],g.prototype,"leftChevron",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"no-collapse",type:Boolean,reflect:!0})],g.prototype,"noCollapse",void 0),(0,a.Cg)([(0,o.MZ)()],g.prototype,"header",void 0),(0,a.Cg)([(0,o.MZ)()],g.prototype,"secondary",void 0),(0,a.Cg)([(0,o.wk)()],g.prototype,"_showContent",void 0),(0,a.Cg)([(0,o.P)(".container")],g.prototype,"_container",void 0),g=(0,a.Cg)([(0,o.EM)("ha-expansion-panel")],g)},18198:function(e,t,i){i.d(t,{Dc:function(){return d},Si:function(){return c}});var a=i(40445),s=i(5124),o=i(67576);i(47680),i(67094);let n,r,l=e=>e;const c=e=>{switch(e.level){case 0:return"M11,10H13V16H11V10M22,12H19V20H5V12H2L12,3L22,12M15,10A2,2 0 0,0 13,8H11A2,2 0 0,0 9,10V16A2,2 0 0,0 11,18H13A2,2 0 0,0 15,16V10Z";case 1:return"M12,3L2,12H5V20H19V12H22L12,3M10,8H14V18H12V10H10V8Z";case 2:return"M12,3L2,12H5V20H19V12H22L12,3M9,8H13A2,2 0 0,1 15,10V12A2,2 0 0,1 13,14H11V16H15V18H9V14A2,2 0 0,1 11,12H13V10H9V8Z";case 3:return"M12,3L22,12H19V20H5V12H2L12,3M15,11.5V10C15,8.89 14.1,8 13,8H9V10H13V12H11V14H13V16H9V18H13A2,2 0 0,0 15,16V14.5A1.5,1.5 0 0,0 13.5,13A1.5,1.5 0 0,0 15,11.5Z";case-1:return"M12,3L2,12H5V20H19V12H22L12,3M11,15H7V13H11V15M15,18H13V10H11V8H15V18Z"}return"M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z"},d=e=>{switch(e.level){case 0:return"mdi:home-floor-0";case 1:return"mdi:home-floor-1";case 2:return"mdi:home-floor-2";case 3:return"mdi:home-floor-3";case-1:return"mdi:home-floor-negative-1"}return"mdi:home"};class h extends s.WF{render(){if(!this.floor)return s.s6;if(this.floor.icon)return(0,s.qy)(n||(n=l`<ha-icon .icon="${0}"></ha-icon>`),this.floor.icon);const e=c(this.floor);return(0,s.qy)(r||(r=l`<ha-svg-icon .path="${0}"></ha-svg-icon>`),e)}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],h.prototype,"floor",void 0),(0,a.Cg)([(0,o.MZ)()],h.prototype,"icon",void 0),h=(0,a.Cg)([(0,o.EM)("ha-floor-icon")],h)},75248:function(e,t,i){i.a(e,async function(e,a){try{i.r(t),i.d(t,{HaIconOverflowMenu:function(){return k}});i(18111),i(61701),i(62953);var s=i(40445),o=(i(68825),i(5124)),n=i(67576),r=i(93421),l=i(57237),c=i(14503),d=i(29823),h=(i(70947),i(26300)),u=(i(67094),i(34127)),p=e([d,h,u]);[d,h,u]=p.then?(await p)():p;let g,v,_,m,f,b,y,w,C=e=>e;const $="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";class k extends o.WF{render(){return 0===this.items.length?o.s6:(0,o.qy)(g||(g=C` ${0} `),this.narrow?(0,o.qy)(v||(v=C` <ha-dropdown @wa-show="${0}" @click="${0}"> <ha-icon-button .label="${0}" .path="${0}" slot="trigger"></ha-icon-button> ${0} </ha-dropdown>`),this._handleIconOverflowMenuOpened,l.d,this._localize("ui.common.overflow_menu"),$,this.items.map(e=>e.divider?(0,o.qy)(_||(_=C`<wa-divider></wa-divider>`)):(0,o.qy)(m||(m=C`<ha-dropdown-item ?disabled="${0}" @click="${0}" variant="${0}"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item>`),e.disabled,e.action,e.warning?"danger":"default",e.path,e.label))):(0,o.qy)(f||(f=C` ${0} `),this.items.map(e=>{var t;return e.narrowOnly?o.s6:e.divider?(0,o.qy)(b||(b=C`<div role="separator"></div>`)):(0,o.qy)(y||(y=C`<ha-tooltip .disabled="${0}" .for="icon-button-${0}">${0} </ha-tooltip><ha-icon-button .id="icon-button-${0}" @click="${0}" .label="${0}" .path="${0}" ?disabled="${0}"></ha-icon-button> `),!e.tooltip,e.label,null!==(t=e.tooltip)&&void 0!==t?t:"",e.label,e.action,e.label,e.path,e.disabled)})))}_handleIconOverflowMenuOpened(e){e.stopPropagation()}static get styles(){return[c.RF,(0,o.AH)(w||(w=C`:host{display:flex;justify-content:flex-end;cursor:initial}div[role=separator]{border-right:1px solid var(--divider-color);width:1px}`))]}constructor(...e){super(...e),this.items=[],this.narrow=!1}}(0,s.Cg)([(0,n.wk)(),(0,r.IW)()],k.prototype,"_localize",void 0),(0,s.Cg)([(0,n.MZ)({type:Array})],k.prototype,"items",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],k.prototype,"narrow",void 0),k=(0,s.Cg)([(0,n.EM)("ha-icon-overflow-menu")],k),a()}catch(g){a(g)}})},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 m},sd:function(){return o},su:function(){return r},vc:function(){return f},w8:function(){return u},wv:function(){return h},y3:function(){return g},zS:function(){return n}});i(3362);var a=i(3931),s=i(82e3);const o=[1,2,3,4,6,8],n="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 o=await(0,a.U)("_cameraTmbUrl",9e3,d,e,t);return r(o,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)),_="media-source://camera/",m=e=>e.startsWith(_),f=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})},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),o=i(71727),n=i(76774),r=i(15638),l=i(95350),c=i(58594);const d=(e,t,i,o,l,c,d,h)=>{const u=(0,n.q)(e,t),p=e.via_device_id?i[e.via_device_id]:void 0,g=p?(0,s.T)(p,l,o,h):void 0,v=p?(0,n.q)(p,t):void 0,_=v?(0,a.A)(v):void 0,m=(0,r.qC)(c,d.translations);return{areaName:u?(0,a.A)(u):_?`${_}${m?" ◂ ":" ▸ "}${g}`:g||void 0,viaDeviceName:g,viaDeviceAreaName:_}},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,n,r,h,u,p,g="")=>{const v=Object.values(e.devices),_=Object.values(e.entities);let m={};(i||a||n||h)&&(m=(0,c.g2)(_));let f=v.filter(e=>e.id===p||!e.disabled_by);i&&(f=f.filter(e=>{const t=m[e.id];return!(!t||!t.length)&&m[e.id].some(e=>i.includes((0,o.m)(e.entity_id)))})),a&&(f=f.filter(e=>{const t=m[e.id];return!t||!t.length||_.every(e=>!a.includes((0,o.m)(e.entity_id)))})),u&&(f=f.filter(e=>!u.includes(e.id))),n&&(f=f.filter(t=>{const i=m[t.id];return!(!i||!i.length)&&m[t.id].some(t=>{const i=e.states[t.entity_id];return!!i&&(i.attributes.device_class&&n.includes(i.attributes.device_class))})})),h&&(f=f.filter(t=>{const i=m[t.id];return!(!i||!i.length)&&i.some(t=>{const i=e.states[t.entity_id];return!!i&&h(i)})})),r&&(f=f.filter(e=>e.id===p||r(e)));return f.map(i=>{const a=(0,s.T)(i,e.localize,e.states,m[i.id]),{areaName:o,viaDeviceName:n,viaDeviceAreaName:r}=d(i,e.areas,e.devices,e.states,e.localize,e.language,e.translationMetadata,i.via_device_id?m[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:o,domain:null==c?void 0:c.domain,domain_name:u,search_labels:{deviceName:a,areaName:o||null,domain:h||null,domainName:u||null,viaDeviceName:n||null,viaDeviceArea:r||null},sorting_label:[p,o,u].filter(Boolean).join("_")}})}},53756:function(e,t,i){i.d(t,{t:function(){return l},w:function(){return c}});i(74423),i(18111),i(22489),i(61701),i(62953);var a=i(71727),s=i(74705),o=i(28978),n=i(15638),r=i(95350);const l=[{name:"search_labels.entityName",weight:10},{name:"search_labels.friendlyName",weight:8},{name:"search_labels.deviceName",weight:7},{name:"search_labels.areaName",weight:6},{name:"search_labels.domainName",weight:6},{name:"search_labels.entityId",weight:3}],c=(e,t,i,l,c,d,h,u,p,g="")=>{let v,_=Object.keys(e.states);return h&&(_=_.filter(e=>h.includes(e))),u&&(_=_.filter(e=>!u.includes(e))),t&&(_=_.filter(e=>t.includes((0,a.m)(e)))),i&&(_=_.filter(e=>!i.includes((0,a.m)(e)))),v=_.map(t=>{const i=e.states[t],l=(0,o.u)(i),[c,d,h]=(0,s.Cf)(i,[{type:"entity"},{type:"device"},{type:"area"}],e.entities,e.devices,e.areas,e.floors),u=(0,r.p$)(e.localize,(0,a.m)(t)),p=(0,n.qC)(e.language,e.translationMetadata.translations),v=c||d||t,_=[h,c?d:void 0].filter(Boolean).join(p?" ◂ ":" ▸ ");return{id:`${g}${t}`,primary:v,secondary:_,domain_name:u,sorting_label:[v,_].filter(Boolean).join("_"),search_labels:{entityName:c||null,deviceName:d||null,areaName:h||null,domainName:u||null,friendlyName:l||null,entityId:t},stateObj:i}}),c&&(v=v.filter(e=>{var t;return e.id===p||(null===(t=e.stateObj)||void 0===t?void 0:t.attributes.device_class)&&c.includes(e.stateObj.attributes.device_class)})),d&&(v=v.filter(e=>{var t;return e.id===p||(null===(t=e.stateObj)||void 0===t?void 0:t.attributes.unit_of_measurement)&&d.includes(e.stateObj.attributes.unit_of_measurement)})),l&&(v=v.filter(e=>e.id===p||e.stateObj&&l(e.stateObj))),v}},34884:function(e,t,i){i.d(t,{$4:function(){return d},C6:function(){return l},CB:function(){return r},Tx:function(){return n},ac:function(){return s},qL:function(){return u},tK:function(){return c},w$:function(){return h}});var a=i(91926);const s=["binary_sensor","button","configuration","device_tracker","event","image_processing","infrared","input_button","persistent_notification","person","radio_frequency","scene","schedule","script","sensor","sun","update","weather","zone"];let o;const n=(e,t)=>{o={config:e,areaId:t},(0,a.oo)("/config/scene/edit/new")},r=()=>{const e=o;return o=void 0,e},l=(e,t)=>e.callService("scene","turn_on",{entity_id:t}),c=(e,t)=>e.callService("scene","apply",{entities:t}),d=(e,t)=>e.callApi("GET",`config/scene/config/${t}`),h=(e,t,i)=>e.callApi("POST",`config/scene/config/${t}`,i),u=(e,t)=>e.callApi("DELETE",`config/scene/config/${t}`)},42269:function(e,t,i){i.d(t,{p:function(){return s}});var a=i(1087);const s=(e,t)=>(0,a.r)(e,"hass-more-info",t)},54706:function(e,t,i){i.d(t,{E:function(){return o}});i(74423),i(18111),i(13579),i(3362),i(62953);var a=i(40445),s=i(67576);const o=e=>{class t extends e{connectedCallback(){super.connectedCallback(),this._checkSubscribed()}disconnectedCallback(){if(super.disconnectedCallback(),this.__unsubs){for(;this.__unsubs.length;){const e=this.__unsubs.pop();e instanceof Promise?e.then(e=>e()):e()}this.__unsubs=void 0}}updated(e){if(super.updated(e),e.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const t of e.keys())if(this.hassSubscribeRequiredHostProps.includes(t))return void this._checkSubscribed()}hassSubscribe(){return[]}_checkSubscribed(){var e;void 0!==this.__unsubs||!this.isConnected||void 0===this.hass||null!==(e=this.hassSubscribeRequiredHostProps)&&void 0!==e&&e.some(e=>void 0===this[e])||(this.__unsubs=this.hassSubscribe())}}return(0,a.Cg)([(0,s.MZ)({attribute:!1})],t.prototype,"hass",void 0),t}},20820:function(e,t,i){i(62953);var a=i(40445),s=i(5124),o=i(67576),n=i(6412);let r,l,c=e=>e;class d extends s.WF{render(){return(0,s.qy)(r||(r=c` <div class="content ${0}"> <div class="header"><slot name="header"></slot></div> <div class="together layout ${0}"> <div class="intro"><slot name="introduction"></slot></div> <div class="panel flex-auto"><slot></slot></div> </div> </div> `),(0,n.H)({narrow:!this.isWide,"full-width":this.fullWidth}),(0,n.H)({narrow:!this.isWide,vertical:this.vertical||!this.isWide,horizontal:!this.vertical&&this.isWide}))}constructor(...e){super(...e),this.isWide=!1,this.vertical=!1,this.fullWidth=!1}}d.styles=(0,s.AH)(l||(l=c`:host{display:block}.content{padding:28px 20px 0;max-width:1040px;margin:0 auto}.layout{display:flex}.horizontal{flex-direction:row}.vertical{flex-direction:column}.flex-auto{flex:1 1 auto}.header{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)}.together{margin-top:var(--config-section-content-together-margin-top,32px)}.intro{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-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal);width:100%;opacity:var(--dark-primary-opacity);font-size:var(--ha-font-size-m);padding-bottom:20px}.horizontal .intro{max-width:400px;margin-right:40px;margin-inline-end:40px;margin-inline-start:initial}.panel{margin-top:-24px}.panel ::slotted(*){margin-top:24px;display:block}.narrow.content{max-width:640px}.narrow .together{margin-top:var(--config-section-narrow-content-together-margin-top,var(--config-section-content-together-margin-top,20px))}.narrow .intro{padding-bottom:20px;margin-right:0;margin-inline-end:0;margin-inline-start:initial;max-width:500px}.full-width{padding:0}.full-width .layout{flex-direction:column}`)),(0,a.Cg)([(0,o.MZ)({attribute:"is-wide",type:Boolean})],d.prototype,"isWide",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],d.prototype,"vertical",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,attribute:"full-width"})],d.prototype,"fullWidth",void 0),d=(0,a.Cg)([(0,o.EM)("ha-config-section")],d)},19711:function(e,t,i){i.d(t,{$:function(){return o}});i(3362),i(62953);var a=i(1087);const s=()=>Promise.all([i.e(80131),i.e(70183),i.e(47677)]).then(i.bind(i,79029)),o=(e,t)=>{(0,a.r)(e,"show-dialog",{dialogTag:"dialog-helper-detail",dialogImport:s,dialogParams:t})}},75912:function(e,t,i){i.a(e,async function(e,a){try{i.r(t);i(18111),i(81148),i(22489),i(62953);var s=i(40445),o=i(67576),n=i(22786),r=i(69093),l=i(9899),c=i(324),d=i(21258),h=i(10705),u=e([d,h]);[d,h]=u.then?(await u)():u;const p=(e,t)=>e.length===t.length&&e.every((e,i)=>e===t[i]);class g extends c.a{updatePageEl(e,t){if(e.hass=this.hass,e.narrow=this.narrow,e.isWide=this.isWide,e.route=this.routeTail,e.cloudStatus=this.cloudStatus,this.hass&&(e.scenes&&t?t.has("hass")&&this._debouncedUpdateScenes(e):e.scenes=this._getScenes(this.hass.states)),(!t||t.has("route"))&&"edit"===this._currentPage){e.creatingNew=void 0;const t=this.routeTail.path.slice(1);e.sceneId="new"===t?null:t}}constructor(...e){super(...e),this.narrow=!1,this.isWide=!1,this.scenes=[],this.routerOptions={defaultPage:"dashboard",routes:{dashboard:{tag:"ha-scene-dashboard",cache:!0},edit:{tag:"ha-scene-editor"}}},this._debouncedUpdateScenes=(0,l.s)(e=>{const t=this._getScenes(this.hass.states);p(t,e.scenes)||(e.scenes=t)},10),this._getScenes=(0,n.A)(e=>Object.values(e).filter(e=>"scene"===(0,r.t)(e)))}}(0,s.Cg)([(0,o.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean})],g.prototype,"narrow",void 0),(0,s.Cg)([(0,o.MZ)({attribute:"is-wide",type:Boolean})],g.prototype,"isWide",void 0),(0,s.Cg)([(0,o.MZ)({attribute:!1})],g.prototype,"cloudStatus",void 0),(0,s.Cg)([(0,o.MZ)({attribute:!1})],g.prototype,"scenes",void 0),g=(0,s.Cg)([(0,o.EM)("ha-config-scene")],g),a()}catch(p){a(p)}})},21258: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(62953),i(48408),i(14603),i(47566),i(98721);var a=i(40445),s=(i(68825),i(88696)),o=i(35211),n=i(5124),r=i(67576),l=i(22786),c=i(93905),d=i(1087),h=i(28978),u=i(91926),p=i(87710),g=i(86171),v=i(18350),_=i(29823),m=(i(70947),i(41113)),f=i(52190),b=i(66702),y=i(72644),w=i(138),C=i(2617),$=i(26300),k=i(75248),x=i(93367),A=(i(82988),i(67094),i(34127)),M=i(53641),z=i(76570),H=i(22792),L=i(77001),E=i(59241),I=i(14782),S=i(88360),V=i(92557),Z=i(34884),q=i(65063),D=i(42269),j=i(72553),O=i(54706),T=i(14503),F=i(36918),R=i(81619),P=i(34023),B=i(55270),U=i(90986),W=i(29303),N=i(25635),G=i(69569),Y=i(94017),K=i(19661),J=i(46738),X=e([g,v,_,m,f,b,y,w,C,$,k,x,A,j,s,W,Y]);[g,v,_,m,f,b,y,w,C,$,k,x,A,j,s,W,Y]=X.then?(await X)():X;let Q,ee,te,ie,ae,se,oe,ne,re,le,ce,de,he,ue,pe,ge,ve,_e,me,fe,be,ye,we,Ce,$e,ke,xe,Ae,Me,ze,He=e=>e;const Le="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",Ee="M11,17H4A2,2 0 0,1 2,15V3A2,2 0 0,1 4,1H16V3H4V15H11V13L15,16L11,19V17M19,21V7H8V13H6V7A2,2 0 0,1 8,5H19A2,2 0 0,1 21,7V21A2,2 0 0,1 19,23H8A2,2 0 0,1 6,21V19H8V21H19Z",Ie="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",Se="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",Ve="M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z",Ze="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",qe="M7,10L12,15L17,10H7Z",De="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",je="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",Oe="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",Te="M8,5.14V19.14L19,12.14L8,5.14Z",Fe="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",Re="M5.5,7A1.5,1.5 0 0,1 4,5.5A1.5,1.5 0 0,1 5.5,4A1.5,1.5 0 0,1 7,5.5A1.5,1.5 0 0,1 5.5,7M21.41,11.58L12.41,2.58C12.05,2.22 11.55,2 11,2H4C2.89,2 2,2.89 2,4V11C2,11.55 2.22,12.05 2.59,12.41L11.58,21.41C11.95,21.77 12.45,22 13,22C13.55,22 14.05,21.77 14.41,21.41L21.41,14.41C21.78,14.05 22,13.55 22,13C22,12.44 21.77,11.94 21.41,11.58Z",Pe="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 Be extends((0,O.E)(n.WF)){get _availableAssistants(){return(0,K.V)(this.cloudStatus,this.hass)}willUpdate(e){super.willUpdate(e),this.hasUpdated||(this._searchParms.has("area")||this._searchParms.has("device")||this._searchParms.has("label")||(this._filters=this._storageFilters),this._filterArea(),this._filterDevice(),this._filterLabel())}updated(e){super.updated(e),e.has("_entityReg")&&this._applyFilters()}hassSubscribe(){return[(0,z.Ar)(this.hass.connection,"scene",e=>{this._categories=e})]}render(){var e,t,i,a,s,o,r;const l=this._sizeController.value&&this._sizeController.value<900||!this._sizeController.value&&"docked"===this.hass.dockedSidebar,c=l&&(!this._sizeController.value||this._sizeController.value<700),d=this._scenes(this.scenes,this._entityReg,this.hass.areas,this._categories,this._labels,this._filteredSceneEntityIds);return(0,n.qy)(Q||(Q=He` <hass-tabs-subpage-data-table .hass="${0}" .narrow="${0}" .backPath="${0}" .route="${0}" .tabs="${0}" .searchLabel="${0}" selectable .selected="${0}" @selection-changed="${0}" has-filters .filters="${0}" .columns="${0}" id="entity_id" .initialGroupColumn="${0}" .initialCollapsedGroups="${0}" .initialSorting="${0}" .columnOrder="${0}" .hiddenColumns="${0}" @columns-changed="${0}" @sorting-changed="${0}" @grouping-changed="${0}" @collapsed-changed="${0}" .data="${0}" .empty="${0}" .activeFilters="${0}" .noDataText="${0}" @clear-filter="${0}" .filter="${0}" @search-changed="${0}" has-fab clickable @row-click="${0}"> <ha-icon-button slot="toolbar-icon" @click="${0}" .label="${0}" .path="${0}"></ha-icon-button> <ha-filter-floor-areas .hass="${0}" .type="${0}" .value="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-floor-areas> <ha-filter-devices .hass="${0}" .type="${0}" .value="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-devices> <ha-filter-entities .hass="${0}" .type="${0}" .value="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-entities> <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> <ha-filter-categories .hass="${0}" scope="scene" .value="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-categories> <ha-filter-voice-assistants .hass="${0}" .value="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .expanded="${0}" .narrow="${0}" @expanded-changed="${0}"></ha-filter-voice-assistants> ${0} ${0} ${0} <ha-button href="/config/scene/edit/new" size="large" slot="fab"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> ${0} </ha-button> </hass-tabs-subpage-data-table> `),this.hass,this.narrow,this._searchParms.has("historyBack")?void 0:"/config",this.route,N.configSections.automations,this.hass.localize("ui.panel.config.scene.picker.search",{number:d.length}),this._selected.length,this._handleSelectionChanged,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._columns(this.hass.localize,d),null!==(e=this._activeGrouping)&&void 0!==e?e:"category",this._activeCollapsed,this._activeSorting,this._activeColumnOrder,this._activeHiddenColumns,this._handleColumnsChanged,this._handleSortingChanged,this._handleGroupingChanged,this._handleCollapseChanged,d,!this.scenes.length,this._activeFilters,this.hass.localize("ui.panel.config.scene.picker.no_scenes"),this._clearFilter,this._filter,this._handleSearchChange,this._handleRowClicked,this._showHelp,this.hass.localize("ui.common.help"),Ve,this.hass,"scene",null===(t=this._filters["ha-filter-floor-areas"])||void 0===t?void 0:t.value,this._filterChanged,"ha-filter-floor-areas"===this._expandedFilter,this.narrow,this._filterExpanded,this.hass,"scene",null===(i=this._filters["ha-filter-devices"])||void 0===i?void 0:i.value,this._filterChanged,"ha-filter-devices"===this._expandedFilter,this.narrow,this._filterExpanded,this.hass,"scene",null===(a=this._filters["ha-filter-entities"])||void 0===a?void 0:a.value,this._filterChanged,"ha-filter-entities"===this._expandedFilter,this.narrow,this._filterExpanded,this.hass,null===(s=this._filters["ha-filter-labels"])||void 0===s?void 0:s.value,this._filterChanged,"ha-filter-labels"===this._expandedFilter,this.narrow,this._filterExpanded,this.hass,null===(o=this._filters["ha-filter-categories"])||void 0===o?void 0:o.value,this._filterChanged,"ha-filter-categories"===this._expandedFilter,this.narrow,this._filterExpanded,this.hass,null===(r=this._filters["ha-filter-voice-assistants"])||void 0===r?void 0:r.value,this._filterChanged,"ha-filter-voice-assistants"===this._expandedFilter,this.narrow,this._filterExpanded,this.narrow?n.s6:(0,n.qy)(ee||(ee=He`<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} ${0}`),this._handleBulkCategory,this.hass.localize("ui.panel.config.automation.picker.bulk_actions.move_category"),qe,this._renderCategoryItems(),c?n.s6:(0,n.qy)(te||(te=He`<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._handleBulkLabel,this.hass.localize("ui.panel.config.automation.picker.bulk_actions.add_label"),qe,this._renderLabelItems()),l?n.s6:(0,n.qy)(ie||(ie=He`<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"),qe,this._renderAreaItems())),this.narrow||l?(0,n.qy)(ae||(ae=He` <ha-dropdown slot="selection-bar" @wa-select="${0}"> ${0} ${0} ${0} ${0} </ha-dropdown>`),this._handleBulkAction,this.narrow?(0,n.qy)(se||(se=He`<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"),qe):(0,n.qy)(oe||(oe=He`<ha-icon-button .path="${0}" .label="${0}" slot="trigger"></ha-icon-button>`),Se,this.hass.localize("ui.panel.config.automation.picker.bulk_action")),this.narrow?(0,n.qy)(ne||(ne=He`<ha-dropdown-item> ${0} ${0} </ha-dropdown-item>`),this.hass.localize("ui.panel.config.automation.picker.bulk_actions.move_category"),this._renderCategoryItems("submenu")):n.s6,this.narrow||c?(0,n.qy)(re||(re=He`<ha-dropdown-item> ${0} ${0} </ha-dropdown-item>`),this.hass.localize("ui.panel.config.automation.picker.bulk_actions.add_label"),this._renderLabelItems("submenu")):n.s6,this.narrow||l?(0,n.qy)(le||(le=He`<ha-dropdown-item> ${0} ${0} </ha-dropdown-item>`),this.hass.localize("ui.panel.config.devices.picker.bulk_actions.move_area"),this._renderAreaItems("submenu")):n.s6):n.s6,this.scenes.length?n.s6:(0,n.qy)(ce||(ce=He`<div class="empty" slot="empty"> <ha-svg-icon .path="${0}"></ha-svg-icon> <h1> ${0} </h1> <p> ${0} </p> <ha-button appearance="plain" href="${0}" target="_blank" rel="noreferrer" size="small"> ${0} <ha-svg-icon slot="end" .path="${0}"></ha-svg-icon> </ha-button> </div>`),je,this.hass.localize("ui.panel.config.scene.picker.empty_header"),this.hass.localize("ui.panel.config.scene.picker.empty_text"),(0,F.o)(this.hass,"/docs/scene/editor/"),this.hass.localize("ui.panel.config.common.learn_more"),De),Fe,this.hass.localize("ui.panel.config.scene.picker.add_scene"))}_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),this._applyFilters()}_applyFilters(){const e=Object.entries(this._filters);let t=this.scenes.map(e=>e.entity_id);for(const[i,a]of e)(0,L.fq)(i,a,["ha-filter-floor-areas","ha-filter-devices","ha-filter-entities"])?t=t.filter(e=>a.items.has(e)):(0,L._H)(i,a,"ha-filter-categories")?t=t.filter(e=>{var t;return a.value[0]===(null===(t=this._entityReg.find(t=>t.entity_id===e))||void 0===t?void 0:t.categories.scene)}):(0,L._H)(i,a,"ha-filter-labels")?t=t.filter(e=>{var t;return null===(t=this._entityReg.find(t=>t.entity_id===e))||void 0===t?void 0:t.labels.some(e=>a.value.includes(e))}):(0,L._H)(i,a,"ha-filter-voice-assistants")&&(t=t.filter(e=>(0,I.hB)(this._entityReg,e).some(e=>a.value.includes(e))));this._filteredSceneEntityIds=t}_clearFilter(){this._filters={},this._fromUrl||(this._storageFilters={}),this._applyFilters()}_filterArea(){const e=this._searchParms.get("area");e&&(this._fromUrl=!0,this._filters=Object.assign(Object.assign({},this._filters),{},{"ha-filter-floor-areas":{value:{areas:[e]},items:void 0}}),this._applyFilters())}_filterDevice(){const e=this._searchParms.get("device");e&&(this._fromUrl=!0,this._filters=Object.assign(Object.assign({},this._filters),{},{"ha-filter-devices":{value:[e],items:void 0}}),this._applyFilters())}_filterLabel(){const e=this._searchParms.get("label");e&&(this._fromUrl=!0,this._filters=Object.assign(Object.assign({},this._filters),{},{"ha-filter-labels":{value:[e],items:void 0}}),this._applyFilters())}_handleSelectionChanged(e){this._selected=e.detail.value}_handleRowClicked(e){const t=this.scenes.find(t=>t.entity_id===e.detail.id);null!=t&&t.attributes.id&&(0,u.oo)(`/config/scene/edit/${null==t?void 0:t.attributes.id}`)}async _bulkAddCategory(e){const t=[];this._selected.forEach(i=>{t.push((0,E.G_)(this.hass,i,{categories:{scene:e}}))});const i=await Promise.allSettled(t);if((0,p.$)(i)){const e=(0,p.N)(i);(0,q.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.common.multiselect.failed",{number:e.length}),text:(0,n.qy)(de||(de=He`<pre>
${0}</pre>`),e.map(e=>e.reason.message||e.reason.code||e.reason).join("\r\n"))})}}async _bulkLabel(e,t){const i=[];this._selected.forEach(a=>{i.push((0,E.G_)(this.hass,a,{labels:"add"===t?this.hass.entities[a].labels.concat(e):this.hass.entities[a].labels.filter(t=>t!==e)}))});const a=await Promise.allSettled(i);if((0,p.$)(a)){const e=(0,p.N)(a);(0,q.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.common.multiselect.failed",{number:e.length}),text:(0,n.qy)(he||(he=He`<pre>
${0}</pre>`),e.map(e=>e.reason.message||e.reason.code||e.reason).join("\r\n"))})}}async _bulkAddArea(e){const t=[];this._selected.forEach(i=>{t.push((0,E.G_)(this.hass,i,{area_id:e}))});const i=await Promise.allSettled(t);if((0,p.$)(i)){const e=(0,p.N)(i);(0,q.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.common.multiselect.failed",{number:e.length}),text:(0,n.qy)(ue||(ue=He`<pre>
${0}</pre>`),e.map(e=>e.reason.message||e.reason.code||e.reason).join("\r\n"))})}}_editCategory(e){const t=this._entityReg.find(t=>t.entity_id===e.entity_id);t?(0,B.j)(this,{scope:"scene",entityReg:t}):(0,q.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.scene.picker.no_category_support"),text:this.hass.localize("ui.panel.config.scene.picker.no_category_entity_reg")})}_showInfo(e){(0,d.r)(this,"hass-more-info",{entityId:e.entity_id})}_openSettings(e){(0,D.p)(this,{entityId:e.entity_id,view:"settings"})}_deleteConfirm(e){(0,q.dk)(this,{title:this.hass.localize("ui.panel.config.scene.picker.delete_confirm_title"),text:this.hass.localize("ui.panel.config.scene.picker.delete_confirm_text",{name:(0,h.u)(e)}),confirmText:this.hass.localize("ui.common.delete"),dismissText:this.hass.localize("ui.common.cancel"),confirm:()=>this._delete(e),destructive:!0})}async _delete(e){e.attributes.id&&(await(0,Z.qL)(this.hass,e.attributes.id),this._selected=this._selected.filter(t=>t!==e.entity_id))}async _duplicate(e){if(e.attributes.id){const t=await(0,Z.$4)(this.hass,e.attributes.id),i=this._entityReg.find(t=>t.entity_id===e.entity_id);(0,Z.Tx)(Object.assign(Object.assign({},t),{},{id:void 0,name:`${null==t?void 0:t.name} (${this.hass.localize("ui.panel.config.scene.picker.duplicate")})`}),(null==i?void 0:i.area_id)||void 0)}}async _rename(e){if(!e.attributes.id)return;const t=await(0,Z.$4)(this.hass,e.attributes.id),i=this._entityReg.find(t=>t.entity_id===e.entity_id);(0,J.P)(this,{config:t,domain:"scene",entityRegistryEntry:i,updateConfig:async(t,a)=>{await(0,Z.w$)(this.hass,e.attributes.id,t),i&&await(0,E.G_)(this.hass,e.entity_id,{area_id:a.area||null,labels:a.labels,categories:{scene:a.category||null}})}})}_showHelp(){(0,q.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.scene.picker.header"),text:(0,n.qy)(pe||(pe=He` ${0} <p> <a href="${0}" target="_blank" rel="noreferrer"> ${0} </a> </p> `),this.hass.localize("ui.panel.config.scene.picker.introduction"),(0,F.o)(this.hass,"/docs/scene/editor/"),this.hass.localize("ui.panel.config.scene.picker.learn_more"))})}_handleSortingChanged(e){this._activeSorting=e.detail}_handleGroupingChanged(e){var t;this._activeGrouping=null!==(t=e.detail.value)&&void 0!==t?t:""}_handleCollapseChanged(e){this._activeCollapsed=e.detail.value}_handleSearchChange(e){this._filter=e.detail.value}_handleColumnsChanged(e){this._activeColumnOrder=e.detail.columnOrder,this._activeHiddenColumns=e.detail.hiddenColumns}static get styles(){return[T.RF,(0,n.AH)(ge||(ge=He`:host{display:block;height:100%}hass-tabs-subpage-data-table{--data-table-row-height:60px}a{text-decoration:none}.empty{--mdc-icon-size:80px;max-width:500px}.empty ha-button{--mdc-icon-size:24px}.empty h1{font-size:var(--ha-font-size-3xl)}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}`))]}constructor(...e){super(...e),this.narrow=!1,this.isWide=!1,this._searchParms=new URLSearchParams(window.location.search),this._selected=[],this._filter="",this._filters={},this._storageFilters={},this._fromUrl=!1,this._entityReg=[],this._sizeController=new s.P(this,{callback:e=>{var t;return null===(t=e[0])||void 0===t?void 0:t.contentRect.width}}),this._scenes=(0,l.A)((e,t,i,a,s,o)=>null===o?[]:(o?e.filter(e=>o.includes(e.entity_id)):e).map(e=>{var o,n;const r=t.find(t=>t.entity_id===e.entity_id),l=null==r?void 0:r.categories.scene,c=(s&&(null==r?void 0:r.labels)||[]).map(e=>s.find(t=>t.label_id===e)).filter(e=>void 0!==e),d=(0,I.hB)(t,e.entity_id);return Object.assign(Object.assign({},e),{},{name:(0,h.u)(e),area:null!=r&&r.area_id?null===(o=i[null==r?void 0:r.area_id])||void 0===o?void 0:o.name:void 0,category:l?null==a||null===(n=a.find(e=>e.category_id===l))||void 0===n?void 0:n.name:void 0,label_entries:c,labels:c.map(e=>e.name),assistants:d,assistants_sortable_key:(0,Y.HX)(d),selectable:void 0!==r,editable:Boolean(e.attributes.id)})})),this._columns=(0,l.A)((e,t)=>({icon:{title:"",label:e("ui.panel.config.scene.picker.headers.icon"),moveable:!1,showNarrow:!0,type:"icon",template:e=>(0,n.qy)(ve||(ve=He` <ha-state-icon .stateObj="${0}"></ha-state-icon> `),e)},name:{title:e("ui.panel.config.scene.picker.headers.name"),main:!0,sortable:!0,filterable:!0,direction:"asc",flex:2,extraTemplate:e=>e.label_entries.length?(0,n.qy)(_e||(_e=He`<ha-data-table-labels @label-clicked="${0}" .labels="${0}"></ha-data-table-labels>`),this._labelClicked,e.label_entries):n.s6},area:(0,W.A7)(e),category:(0,W.Bl)(e),labels:(0,W.AI)(),state:{title:e("ui.panel.config.scene.picker.headers.last_activated"),sortable:!0,template:t=>(0,W.yx)(t.state,"last-activated",t.entity_id,e,this.hass)},only_editable:(0,W.tH)(e,e("ui.panel.config.scene.picker.only_editable")),actions:{lastFixed:!0,title:"",label:this.hass.localize("ui.panel.config.generic.headers.actions"),type:"overflow-menu",showNarrow:!0,template:e=>(0,n.qy)(me||(me=He` <ha-icon-overflow-menu narrow .items="${0}"> </ha-icon-overflow-menu> `),[{path:Te,label:this.hass.localize("ui.panel.config.scene.picker.apply"),action:()=>this._activateScene(e)},{path:Ze,label:this.hass.localize("ui.panel.config.scene.picker.show_info"),action:()=>this._showInfo(e)},{path:Le,label:this.hass.localize("ui.panel.config.automation.picker.show_settings"),action:()=>this._openSettings(e)},{path:Re,label:this.hass.localize("ui.panel.config.scene.picker."+(e.category?"edit_category":"assign_category")),action:()=>this._editCategory(e)},{path:Oe,label:this.hass.localize("ui.panel.config.scene.editor.rename"),action:()=>this._rename(e),disabled:!e.editable},{divider:!0},{path:Ee,label:this.hass.localize("ui.panel.config.scene.picker.duplicate"),action:()=>this._duplicate(e),disabled:!e.editable},{label:this.hass.localize("ui.panel.config.scene.picker.delete"),path:Ie,action:()=>this._deleteConfirm(e),warning:e.editable,disabled:!e.editable}])},assistants:(0,Y.MD)(e,this.hass,this._availableAssistants,t)})),this._labelClicked=e=>{const t=e.detail.label;this._filters=Object.assign(Object.assign({},this._filters),{},{"ha-filter-labels":{value:[t.label_id],items:void 0}}),this._fromUrl||(this._storageFilters=this._filters),this._applyFilters()},this._handleBulkCategory=e=>{const t=e.detail.item.value;"category_create"!==t?"category_none"!==t?null!=t&&t.startsWith("category_")&&this._bulkAddCategory(t.substring(9)):this._bulkAddCategory(null):this._bulkCreateCategory()},this._handleBulkLabel=e=>{e.preventDefault();const t=e.detail.item.value;if("label_create"!==t){if(null!=t&&t.startsWith("label_")){const i=e.detail.item.action;this._bulkLabel(t.substring(6),i)}}else this._bulkCreateLabel()},this._handleBulkArea=e=>{const t=e.detail.item.value;"area_create"!==t?"area_none"!==t?null!=t&&t.startsWith("area_")&&this._bulkAddArea(t.substring(5)):this._bulkAddArea(null):this._bulkCreateArea()},this._bulkCreateArea=()=>{(0,P.J)(this,{createEntry:async e=>{const t=await(0,M.L3)(this.hass,e);return this._bulkAddArea(t.area_id),t}})},this._activateScene=async e=>{await(0,Z.C6)(this.hass,e.entity_id),(0,R.P)(this,{message:this.hass.localize("ui.panel.config.scene.activated",{name:(0,h.u)(e)})}),(0,S.j)(this,"light")},this._bulkCreateCategory=()=>{(0,U.S)(this,{scope:"scene",createEntry:async e=>{const t=await(0,z.s_)(this.hass,"scene",e);return this._bulkAddCategory(t.category_id),t}})},this._bulkCreateLabel=()=>{(0,G.f)(this,{createEntry:async e=>{const t=await(0,V._9)(this.hass,e);this._bulkLabel(t.label_id,"add")}})},this._renderCategoryItems=(e="")=>{var t;return(0,n.qy)(fe||(fe=He`${0} <ha-dropdown-item .slot="${0}" value="category_none"> ${0} </ha-dropdown-item> <wa-divider .slot="${0}"></wa-divider> <ha-dropdown-item .slot="${0}" value="category_create"> ${0} </ha-dropdown-item>`),null===(t=this._categories)||void 0===t?void 0:t.map(t=>(0,n.qy)(be||(be=He`<ha-dropdown-item .slot="${0}" .value="${0}"> ${0} ${0} </ha-dropdown-item>`),e,`category_${t.category_id}`,t.icon?(0,n.qy)(ye||(ye=He`<ha-icon slot="icon" .icon="${0}"></ha-icon>`),t.icon):(0,n.qy)(we||(we=He`<ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>`),Re),t.name)),e,this.hass.localize("ui.panel.config.automation.picker.bulk_actions.no_category"),e,e,this.hass.localize("ui.panel.config.category.editor.add"))},this._renderLabelItems=(e="")=>{var t;return(0,n.qy)(Ce||(Ce=He`${0} <wa-divider .slot="${0}"></wa-divider> <ha-dropdown-item .slot="${0}" value="label_create"> ${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.entities[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.entities[e])||void 0===i?void 0:i.labels.includes(t.label_id)});return(0,n.qy)($e||($e=He`<ha-dropdown-item .slot="${0}" .value="${0}" .action="${0}"> <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,t.icon?(0,n.qy)(ke||(ke=He`<ha-icon slot="icon" .icon="${0}"></ha-icon>`),t.icon):n.s6,t.name)}),e,e,this.hass.localize("ui.panel.config.labels.add_label"))},this._renderAreaItems=(e="")=>(0,n.qy)(xe||(xe=He`${0} <ha-dropdown-item .slot="${0}" value="area_none"> ${0} </ha-dropdown-item> <wa-divider .slot="${0}"></wa-divider> <ha-dropdown-item .slot="${0}" value="area_create"> ${0} </ha-dropdown-item>`),Object.values(this.hass.areas).map(t=>(0,n.qy)(Ae||(Ae=He`<ha-dropdown-item .slot="${0}" .value="${0}"> ${0} ${0} </ha-dropdown-item>`),e,`area_${t.area_id}`,t.icon?(0,n.qy)(Me||(Me=He`<ha-icon slot="icon" .icon="${0}"></ha-icon>`),t.icon):(0,n.qy)(ze||(ze=He`<ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>`),Pe),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._handleBulkAction=e=>{const t=e.detail.item,i=t.value;if(i)if(i.startsWith("category_"))"category_create"===i?this._bulkCreateCategory():"category_none"===i?this._bulkAddCategory(null):this._bulkAddCategory(i.substring(9));else if(i.startsWith("label_"))if("label_create"===i)this._bulkCreateLabel();else{const e=t.action;this._bulkLabel(i.substring(6),e)}else i.startsWith("area_")&&("area_create"===i?this._bulkCreateArea():"area_none"===i?this._bulkAddArea(null):this._bulkAddArea(i.substring(5)))}}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],Be.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],Be.prototype,"narrow",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"is-wide",type:Boolean})],Be.prototype,"isWide",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],Be.prototype,"route",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],Be.prototype,"cloudStatus",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],Be.prototype,"scenes",void 0),(0,a.Cg)([(0,r.wk)()],Be.prototype,"_searchParms",void 0),(0,a.Cg)([(0,r.wk)()],Be.prototype,"_selected",void 0),(0,a.Cg)([(0,r.wk)()],Be.prototype,"_activeFilters",void 0),(0,a.Cg)([(0,r.wk)()],Be.prototype,"_filteredSceneEntityIds",void 0),(0,a.Cg)([(0,r.wk)(),(0,c.I)({storage:"sessionStorage",key:"scene-table-search",state:!0,subscribe:!1})],Be.prototype,"_filter",void 0),(0,a.Cg)([(0,r.wk)()],Be.prototype,"_filters",void 0),(0,a.Cg)([(0,c.I)({storage:"sessionStorage",key:"scene-table-filters-full",state:!1,subscribe:!1,serializer:L.iS,deserializer:L.Dc})],Be.prototype,"_storageFilters",void 0),(0,a.Cg)([(0,r.wk)()],Be.prototype,"_expandedFilter",void 0),(0,a.Cg)([(0,r.wk)()],Be.prototype,"_categories",void 0),(0,a.Cg)([(0,o.Fg)({context:H.HD,subscribe:!0}),(0,r.wk)()],Be.prototype,"_labels",void 0),(0,a.Cg)([(0,r.wk)(),(0,o.Fg)({context:H.ih,subscribe:!0})],Be.prototype,"_entityReg",void 0),(0,a.Cg)([(0,c.I)({key:"scene-table-sort",state:!1,subscribe:!1})],Be.prototype,"_activeSorting",void 0),(0,a.Cg)([(0,c.I)({key:"scene-table-grouping",state:!1,subscribe:!1})],Be.prototype,"_activeGrouping",void 0),(0,a.Cg)([(0,c.I)({key:"scene-table-collapsed",state:!1,subscribe:!1})],Be.prototype,"_activeCollapsed",void 0),(0,a.Cg)([(0,c.I)({key:"scene-table-column-order",state:!1,subscribe:!1})],Be.prototype,"_activeColumnOrder",void 0),(0,a.Cg)([(0,c.I)({key:"scene-table-hidden-columns",state:!1,subscribe:!1})],Be.prototype,"_activeHiddenColumns",void 0),Be=(0,a.Cg)([(0,r.EM)("ha-scene-dashboard")],Be),t()}catch(Q){t(Q)}})},10705:function(e,t,i){i.a(e,async function(e,t){try{i(16280),i(74423),i(44114),i(18111),i(22489),i(20116),i(7588),i(61701),i(3362),i(62953);var a=i(40445),s=(i(68825),i(35211)),o=i(5124),n=i(67576),r=i(6412),l=i(22786),c=i(32172),d=i(1087),h=i(37981),u=i(71727),p=i(28978),g=i(91926),v=i(15638),_=i(7553),m=i(12587),f=i(1798),b=i(77122),y=i(38962),w=i(18350),C=(i(76776),i(29823)),$=(i(70947),i(26300)),k=(i(8630),i(67094),i(22792)),x=i(59241),A=i(34884),M=i(65063),z=i(42269),H=i(81310),L=i(79172),E=i(39359),I=i(14503),S=i(81619),V=i(60109),Z=i(55270),q=(i(20820),i(46738)),D=e([f,b,y,w,C,$,H]);[f,b,y,w,C,$,H]=D.then?(await D)():D;let j,O,T,F,R,P,B,U,W,N,G,Y,K,J,X,Q,ee,te=e=>e;const ie="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",ae="M11,17H4A2,2 0 0,1 2,15V3A2,2 0 0,1 4,1H16V3H4V15H11V13L15,16L11,19V17M19,21V7H8V13H6V7A2,2 0 0,1 8,5H19A2,2 0 0,1 21,7V21A2,2 0 0,1 19,23H8A2,2 0 0,1 6,21V19H8V21H19Z",se="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z",oe="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",re="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",le="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",ce="M10 16.5L16 12L10 7.5M22 12C22 6.46 17.54 2 12 2C10.83 2 9.7 2.19 8.62 2.56L9.32 4.5C10.17 4.16 11.06 3.97 12 3.97C16.41 3.97 20.03 7.59 20.03 12C20.03 16.41 16.41 20.03 12 20.03C7.59 20.03 3.97 16.41 3.97 12C3.97 11.06 4.16 10.12 4.5 9.28L2.56 8.62C2.19 9.7 2 10.83 2 12C2 17.54 6.46 22 12 22C17.54 22 22 17.54 22 12M5.47 3.97C6.32 3.97 7 4.68 7 5.47C7 6.32 6.32 7 5.47 7C4.68 7 3.97 6.32 3.97 5.47C3.97 4.68 4.68 3.97 5.47 3.97Z",de="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",he="M8,5.14V19.14L19,12.14L8,5.14Z",ue="M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z",pe="M5.5,7A1.5,1.5 0 0,1 4,5.5A1.5,1.5 0 0,1 5.5,4A1.5,1.5 0 0,1 7,5.5A1.5,1.5 0 0,1 5.5,7M21.41,11.58L12.41,2.58C12.05,2.22 11.55,2 11,2H4C2.89,2 2,2.89 2,4V11C2,11.55 2.22,12.05 2.59,12.41L11.58,21.41C11.95,21.77 12.45,22 13,22C13.55,22 14.05,21.77 14.41,21.41L21.41,14.41C21.78,14.05 22,13.55 22,13C22,12.44 21.77,11.94 21.41,11.58Z";class ge extends((0,E._)((0,L.b)(o.WF))){connectedCallback(){super.connectedCallback(),this.sceneId||(this._mode="live",this._subscribeEvents())}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribeEvents&&(this._unsubscribeEvents(),this._unsubscribeEvents=void 0)}render(){var e,t;return this.hass?(0,o.qy)(j||(j=te` <hass-subpage .hass="${0}" .narrow="${0}" .route="${0}" .backCallback="${0}" .header="${0}"> <ha-dropdown slot="toolbar-icon" @wa-select="${0}" activatable> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"></ha-icon-button> <ha-dropdown-item value="apply" .disabled="${0}"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-dropdown-item> <ha-dropdown-item value="show-info" .disabled="${0}"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-dropdown-item> <ha-dropdown-item value="show-settings" .disabled="${0}"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-dropdown-item> <ha-dropdown-item value="edit-category" .disabled="${0}"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-dropdown-item> <ha-dropdown-item value="rename" .disabled="${0}"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-dropdown-item> <ha-dropdown-item value="toggle-yaml"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-dropdown-item> <wa-divider></wa-divider> <ha-dropdown-item value="duplicate" .disabled="${0}"> ${0} <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> </ha-dropdown-item> <ha-dropdown-item value="delete" .disabled="${0}" class="${0}"> ${0} <ha-svg-icon class="${0}" slot="icon" .path="${0}"> </ha-svg-icon> </ha-dropdown-item> </ha-dropdown> ${0} ${0} <ha-button slot="fab" size="large" .disabled="${0}" @click="${0}" class="${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> ${0} </ha-button> </hass-subpage> `),this.hass,this.narrow,this.route,this._backTapped,(null===(e=this._config)||void 0===e?void 0:e.name)||this.hass.localize("ui.panel.config.scene.editor.default_name"),this._handleMenuAction,this.hass.localize("ui.common.menu"),ne,!this.sceneId||"live"===this._mode,this.hass.localize("ui.panel.config.scene.picker.apply"),he,!this.sceneId,this.hass.localize("ui.panel.config.scene.picker.show_info"),le,!this.sceneId,this.hass.localize("ui.panel.config.automation.picker.show_settings"),ie,!this.sceneId,this.hass.localize("ui.panel.config.scene.picker."+(null!==(t=this._registryEntry)&&void 0!==t&&null!==(t=t.categories)&&void 0!==t&&t.scene?"edit_category":"assign_category")),pe,!this.sceneId,this.hass.localize("ui.panel.config.scene.editor.rename"),de,this.hass.localize("ui.panel.config.automation.editor.edit_"+("yaml"!==this._mode?"yaml":"ui")),ue,!this.sceneId,this.hass.localize("ui.panel.config.scene.picker.duplicate_scene"),ae,!this.sceneId,(0,r.H)({warning:Boolean(this.sceneId)}),this.hass.localize("ui.panel.config.scene.picker.delete_scene"),(0,r.H)({warning:Boolean(this.sceneId)}),oe,this._errors?(0,o.qy)(O||(O=te` <div class="errors">${0}</div> `),this._errors):"","yaml"===this._mode?this._renderYamlMode():this._renderUiMode(),this._saving,this._saveScene,(0,r.H)({dirty:this._dirty||!this.sceneId,saving:this._saving}),se,this.hass.localize("ui.panel.config.scene.editor.save")):o.s6}_renderYamlMode(){return(0,o.qy)(T||(T=te` <ha-yaml-editor .defaultValue="${0}" @value-changed="${0}" @editor-save="${0}" disable-fullscreen></ha-yaml-editor>`),this._config,this._yamlChanged,this._saveScene)}_renderUiMode(){const{devices:e,entities:t}=this._getEntitiesDevices(this._entities,this._devices,this._deviceEntityLookup,Object.values(this.hass.devices));return(0,o.qy)(F||(F=te` <div id="root" class="${0}"> ${0} </div>`),(0,r.H)({rtl:(0,v.qC)(this.hass.language,this.hass.translationMetadata.translations)}),this._config?(0,o.qy)(R||(R=te` <div class="${0}"> <ha-alert alert-type="info" .narrow="${0}" .title="${0}"> ${0} <span slot="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </span> <ha-button size="small" slot="action" @click="${0}"> ${0} </ha-button> </ha-alert> </div> <ha-config-section vertical .isWide="${0}"> <div slot="header"> ${0} </div> ${0} ${0} ${0} </ha-config-section> <ha-config-section vertical .isWide="${0}"> <div slot="header"> ${0} </div> ${0} ${0} ${0} </ha-config-section> `),(0,r.H)({container:!0,narrow:!this.isWide}),this.narrow,this.hass.localize("ui.panel.config.scene.editor."+("live"===this._mode?"live_edit":"review_mode")),this.hass.localize("ui.panel.config.scene.editor."+("live"===this._mode?"live_edit_detail":"review_mode_detail")),"live"===this._mode?ce:re,this._toggleLiveMode,this.hass.localize("ui.panel.config.scene.editor."+("live"===this._mode?"switch_to_review_mode":"live_edit")),this.isWide,this.hass.localize("ui.panel.config.scene.editor.devices.header"),"live"===this._mode||0===e.length?(0,o.qy)(P||(P=te`<div slot="introduction"> ${0} </div>`),this.hass.localize("ui.panel.config.scene.editor.devices.introduction"+("review"===this._mode?"_review":""))):o.s6,e.map(e=>(0,o.qy)(B||(B=te` <ha-card outlined> <h1 class="card-header"> ${0} <ha-icon-button .path="${0}" .label="${0}" .device="${0}" @click="${0}"></ha-icon-button> </h1> <ha-list> ${0} </ha-list> </ha-card> `),e.name,oe,this.hass.localize("ui.panel.config.scene.editor.devices.delete"),e.id,this._deleteDevice,e.entities.map(e=>{const t=this.hass.states[e];return t?(0,o.qy)(U||(U=te` <ha-list-item hasMeta .graphic="${0}" .entityId="${0}" @click="${0}" .noninteractive="${0}"> ${0} ${0} </ha-list-item> `),"live"===this._mode?"icon":void 0,e,"live"===this._mode?this._showMoreInfo:void 0,"review"===this._mode,"live"===this._mode?(0,o.qy)(W||(W=te` <state-badge .hass="${0}" .stateObj="${0}" slot="graphic"></state-badge> `),this.hass,t):o.s6,(0,p.u)(t)):o.s6}))),"live"===this._mode?(0,o.qy)(N||(N=te` <ha-card outlined .header="${0}"> <div class="card-content"> <ha-device-picker @value-changed="${0}" .hass="${0}" .label="${0}"></ha-device-picker> </div> </ha-card> `),this.hass.localize("ui.panel.config.scene.editor.devices.add"),this._devicePicked,this.hass,this.hass.localize("ui.panel.config.scene.editor.devices.add")):o.s6,this.isWide,this.hass.localize("ui.panel.config.scene.editor.entities.header"),"live"===this._mode||0===t.length?(0,o.qy)(G||(G=te`<div slot="introduction"> ${0} </div>`),this.hass.localize("ui.panel.config.scene.editor.entities.introduction"+("review"===this._mode?"_review":""))):o.s6,t.length?(0,o.qy)(Y||(Y=te` <ha-card outlined class="entities"> <ha-list> ${0} </ha-list> </ha-card> `),t.map(e=>{const t=this.hass.states[e];return t?(0,o.qy)(K||(K=te` <ha-list-item class="entity" hasMeta .graphic="${0}" .entityId="${0}" @click="${0}" .noninteractive="${0}"> ${0} ${0} <div slot="meta"> <ha-icon-button .path="${0}" .entityId="${0}" .label="${0}" @click="${0}"></ha-icon-button> </div> </ha-list-item> `),"live"===this._mode?"icon":void 0,e,"live"===this._mode?this._showMoreInfo:void 0,"review"===this._mode,"live"===this._mode?(0,o.qy)(J||(J=te` <state-badge .hass="${0}" .stateObj="${0}" slot="graphic"></state-badge>`),this.hass,t):o.s6,(0,p.u)(t),oe,e,this.hass.localize("ui.panel.config.scene.editor.entities.delete"),this._deleteEntity):o.s6})):"","live"===this._mode?(0,o.qy)(X||(X=te` <ha-card outlined header="${0}"> <div class="card-content"> <ha-entity-picker @value-changed="${0}" .excludeDomains="${0}" .hass="${0}" label="${0}"></ha-entity-picker> </div> </ha-card>`),this.hass.localize("ui.panel.config.scene.editor.entities.add"),this._entityPicked,A.ac,this.hass,this.hass.localize("ui.panel.config.scene.editor.entities.add")):o.s6):o.s6)}willUpdate(e){if(super.willUpdate(e),this._entityRegCreated&&this._newSceneId&&(e.has("scenes")||e.has("_entityRegistryEntries"))){const e=this.scenes.find(e=>e.attributes.id===this._newSceneId);if(e){const t=this._entityRegistryEntries.find(t=>t.entity_id===e.entity_id);t&&(this._entityRegCreated(t),this._entityRegCreated=void 0)}}}updated(e){super.updated(e);const t=e.get("sceneId");if(e.has("sceneId")&&this.sceneId&&this.hass&&(!t||t!==this.sceneId)&&this._loadConfig(),e.has("sceneId")&&!this.sceneId&&this.hass){this._dirty=!1;const e=(0,A.CB)();this._config=Object.assign({name:this.hass.localize("ui.panel.config.scene.editor.default_name"),entities:{}},null==e?void 0:e.config),this._initEntities(this._config),void 0!==(null==e?void 0:e.areaId)&&(this._entityRegistryUpdate={area:e.areaId||"",labels:[],category:""}),this._dirty=void 0!==e&&(void 0!==e.areaId||void 0!==e.config)}if(e.has("_entityRegistryEntries")){this._deviceEntityLookup={};for(const e of this._entityRegistryEntries)!e.device_id||e.entity_category||e.hidden_by||A.ac.includes((0,u.m)(e.entity_id))||(e.device_id in this._deviceEntityLookup||(this._deviceEntityLookup[e.device_id]=[]),this._deviceEntityLookup[e.device_id].push(e.entity_id),!this._entities.includes(e.entity_id)||this._single_entities.includes(e.entity_id)||this._devices.includes(e.device_id)||(this._devices=[...this._devices,e.device_id]))}e.has("hass")&&(this._scene?this.hass.states[this._scene.entity_id]!==this._scene&&(this._scene=this.hass.states[this._scene.entity_id]):this.sceneId&&(this._scene=Object.values(this.hass.states).find(e=>{var t;return e.entity_id.startsWith("scene")&&(null===(t=e.attributes)||void 0===t?void 0:t.id)===this.sceneId})))}_handleMenuAction(e){var t;const i=null===(t=e.detail)||void 0===t||null===(t=t.item)||void 0===t?void 0:t.value;if(i)switch(i){case"apply":(0,A.C6)(this.hass,this._scene.entity_id);break;case"show-info":(0,d.r)(this,"hass-more-info",{entityId:this._scene.entity_id});break;case"show-settings":(0,z.p)(this,{entityId:this._scene.entity_id,view:"settings"});break;case"edit-category":this._editCategory();break;case"rename":this._promptSceneRename();break;case"toggle-yaml":"yaml"===this._mode?(this._initEntities(this._config),this._exitYamlMode()):this._enterYamlMode();break;case"duplicate":this._duplicate();break;case"delete":this._deleteTapped()}}async _exitYamlMode(){if(this._yamlErrors){if(!(await(0,M.dk)(this,{text:(0,o.qy)(Q||(Q=te`${0}<br><br>${0}`),this.hass.localize("ui.panel.config.automation.editor.switch_ui_yaml_error"),this._yamlErrors),confirmText:this.hass.localize("ui.common.continue"),destructive:!0,dismissText:this.hass.localize("ui.common.cancel")})))return}this._yamlErrors=void 0,this._mode="review"}_enterYamlMode(){"live"===this._mode&&(this._generateConfigFromLive(),this._unsubscribeEvents&&(this._unsubscribeEvents(),this._unsubscribeEvents=void 0),(0,A.tK)(this.hass,this._storedStates)),this._mode="yaml"}async _toggleLiveMode(){"live"===this._mode?this._exitLiveMode():await this._enterLiveMode()}async _enterLiveMode(){if(this._dirty){if(!(await(0,M.dk)(this,{text:this.hass.localize("ui.panel.config.scene.editor.enter_live_mode_unsaved"),confirmText:this.hass.localize("ui.panel.config.scene.editor.save_before_live"),dismissText:this.hass.localize("ui.common.cancel")})))return;await this._saveScene()}this._entities.forEach(e=>this._storeState(e)),this._mode="live",await this._setScene(),this._subscribeEvents()}_exitLiveMode(){this._generateConfigFromLive(),this._unsubscribeEvents&&(this._unsubscribeEvents(),this._unsubscribeEvents=void 0),(0,A.tK)(this.hass,this._storedStates),this._mode="review"}_yamlChanged(e){e.stopPropagation(),this._dirty=!0,e.detail.isValid?(this._yamlErrors=void 0,this._config=e.detail.value,this._errors=void 0):this._yamlErrors=e.detail.errorMsg}async _setScene(){if(!this._scene)return;const{context:e}=await(0,A.C6)(this.hass,this._scene.entity_id);this._activateContextId=e.id}async _subscribeEvents(){this._unsubscribeEvents=await this.hass.connection.subscribeEvents(e=>this._stateChanged(e),"state_changed")}_showMoreInfo(e){const t=e.currentTarget.entityId;(0,d.r)(this,"hass-more-info",{entityId:t})}async _loadConfig(){let e;try{e=await(0,A.$4)(this.hass,this.sceneId)}catch(t){return await(0,M.showAlertDialog)(this,{text:404===t.status_code?this.hass.localize("ui.panel.config.scene.editor.load_error_not_editable"):this.hass.localize("ui.panel.config.scene.editor.load_error_unknown",{err_no:t.status_code})}),void(0,g.OE)("/config")}e.entities||(e.entities={}),this._initEntities(e),this._scene=this.scenes.find(e=>e.attributes.id===this.sceneId),this._dirty=!1,this._config=e}_initEntities(e){this._entities=Object.keys(e.entities),this._single_entities=[];const t=this._entityRegistryEntries.filter(e=>this._entities.includes(e.entity_id)),i=[];e.metadata&&Object.keys(e.entities).forEach(t=>{var i;!this._single_entities.includes(t)&&null!==(i=e.metadata[t])&&void 0!==i&&i.entity_only&&this._single_entities.push(t)});for(const s of t){var a;if(!s.device_id)continue;const t=null===(a=e.metadata)||void 0===a?void 0:a[s.entity_id];i.includes(s.device_id)||null!=t&&t.entity_only||i.push(s.device_id)}this._devices=i}_entityPicked(e){const t=e.detail.value;e.target.value="",this._entities.includes(t)||(this._entities=[...this._entities,t],this._single_entities.push(t),this._storeState(t),this._dirty=!0)}_deleteEntity(e){e.stopPropagation();const t=e.target.entityId;this._entities=this._entities.filter(e=>e!==t),this._single_entities=this._single_entities.filter(e=>e!==t),this._config.entities&&delete this._config.entities[t],this._config.metadata&&delete this._config.metadata[t],this._dirty=!0}_pickDevice(e){if(this._devices.includes(e))return;this._devices=[...this._devices,e];const t=this._deviceEntityLookup[e];t&&(this._entities=[...this._entities,...t],t.forEach(e=>{this._storeState(e)}),this._dirty=!0)}_devicePicked(e){const t=e.detail.value;e.target.value="",this._pickDevice(t)}_deleteDevice(e){const t=e.target.device;this._devices=this._devices.filter(e=>e!==t);const i=this._deviceEntityLookup[t];i&&(this._entities=this._entities.filter(e=>!i.includes(e)),this._config.entities&&i.forEach(e=>{delete this._config.entities[e]}),this._dirty=!0)}_stateChanged(e){e.context.id!==this._activateContextId&&this._entities.includes(e.data.entity_id)&&(this._dirty=!0)}_goBack(){"live"===this._mode&&(0,A.tK)(this.hass,this._storedStates),(0,m.m)(()=>(0,g.OE)("/config"))}_deleteTapped(){var e;(0,M.dk)(this,{title:this.hass.localize("ui.panel.config.scene.picker.delete_confirm_title"),text:this.hass.localize("ui.panel.config.scene.picker.delete_confirm_text",{name:null===(e=this._config)||void 0===e?void 0:e.name}),confirmText:this.hass.localize("ui.common.delete"),dismissText:this.hass.localize("ui.common.cancel"),confirm:()=>this._delete(),destructive:!0})}async _delete(){this.sceneId&&(await(0,A.qL)(this.hass,this.sceneId),"live"===this._mode&&(0,A.tK)(this.hass,this._storedStates),(0,g.OE)("/config"))}async _confirmUnsavedChanged(){return!this._dirty||(0,M.dk)(this,{title:this.hass.localize("ui.panel.config.scene.editor.unsaved_confirm_title"),text:this.hass.localize("ui.panel.config.scene.editor.unsaved_confirm_text"),confirmText:this.hass.localize("ui.common.leave"),dismissText:this.hass.localize("ui.common.stay"),destructive:!0})}async _duplicate(){var e;await this._confirmUnsavedChanged()&&(0,A.Tx)(Object.assign(Object.assign({},this._config),{},{id:void 0,name:`${null===(e=this._config)||void 0===e?void 0:e.name} (${this.hass.localize("ui.panel.config.scene.picker.duplicate")})`}),this._sceneAreaIdCurrent||void 0)}_calculateMetaData(){const e={};for(const t of this._single_entities){this._getCurrentState(t)&&(e[t]={entity_only:!0})}return e}_calculateStates(){const e={};return this._entities.forEach(t=>{const i=this._getCurrentState(t);i&&(e[t]=i)}),e}_storeState(e){if(e in this._storedStates)return;const t=this._getCurrentState(e);t&&(this._storedStates[e]=t)}_getCurrentState(e){const t=this.hass.states[e];if(t)return Object.assign(Object.assign({},t.attributes),{},{state:t.state})}_generateConfigFromLive(){this._config=Object.assign(Object.assign({},this._config),{},{entities:this._calculateStates(),metadata:this._calculateMetaData()})}async _saveScene(){if(this._yamlErrors)return void(0,S.P)(this,{message:this._yamlErrors});"live"===this._mode&&this._generateConfigFromLive();const e=!this.sceneId;if(e){if(!(await this._promptSceneSave()))return}const t=this.sceneId||String(Date.now());let i;this._saving=!0,void 0===this._entityRegistryUpdate||this.sceneId||(this._newSceneId=t,i=new Promise(e=>{this._entityRegCreated=e}));try{if(await(0,A.w$)(this.hass,t,this._config),this._errors=void 0,void 0!==this._entityRegistryUpdate){var a;let e=null===(a=this._scene)||void 0===a?void 0:a.entity_id;if(i)try{e=(await(0,_.h)(5e3,i)).entity_id}catch(n){if(!(n instanceof Error&&"TimeoutError"===n.name))throw n;await(0,V.j)(this,{savedPromise:i,type:"scene"});try{e=(await(0,_.h)(0,i)).entity_id}catch(r){if(!(r instanceof Error&&"TimeoutError"===r.name))throw r}}e&&await(0,x.G_)(this.hass,e,{area_id:this._entityRegistryUpdate.area||null,labels:this._entityRegistryUpdate.labels||[],categories:{scene:this._entityRegistryUpdate.category||null}})}this._dirty=!1,e&&(0,g.oo)(`/config/scene/edit/${t}`,{replace:!0})}catch(l){var s,o;throw this._errors=(null===(s=l.body)||void 0===s?void 0:s.message)||l.message||l.body,(0,S.P)(this,{message:(null===(o=l.body)||void 0===o?void 0:o.message)||l.message||l.body}),l}finally{this._saving=!1,this._entityRegCreated=void 0,this._newSceneId=void 0}}supportedShortcuts(){return{s:()=>this._saveScene()}}get _sceneAreaIdCurrent(){var e;return(null===(e=this._registryEntry)||void 0===e?void 0:e.area_id)||void 0}_editCategory(){this._registryEntry?(0,Z.j)(this,{scope:"scene",entityReg:this._registryEntry}):(0,M.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.scene.picker.no_category_support"),text:this.hass.localize("ui.panel.config.scene.picker.no_category_entity_reg")})}async _promptSceneSave(){return new Promise(e=>{(0,q.P)(this,{config:this._config,domain:"scene",entityRegistryEntry:this._registryEntry,entityRegistryUpdate:this._entityRegistryUpdate,updateConfig:async(t,i)=>{this._config=t,this._entityRegistryUpdate=i,this._dirty=!0,this.requestUpdate(),e(!0)},onClose:()=>e(!1)})})}async _promptSceneRename(){return new Promise(e=>{(0,q.P)(this,{config:this._config,domain:"scene",entityRegistryEntry:this._registryEntry,entityRegistryUpdate:this._entityRegistryUpdate,updateConfig:async(t,i)=>{this._config=t,this._entityRegistryUpdate=i,this._dirty=!0,this.requestUpdate(),e(!0)},onClose:()=>e(!1)})})}get isDirty(){return this._dirty}async promptDiscardChanges(){return this._confirmUnsavedChanged()}static get styles(){return[I.RF,(0,o.AH)(ee||(ee=te`ha-card{overflow:hidden;margin-top:8px}.container{padding:28px 20px 0;max-width:1040px;margin:0 auto}.narrow.container{max-width:640px}.errors{padding:20px;font-weight:var(--ha-font-weight-bold);color:var(--error-color)}ha-config-section{--config-section-content-together-margin-top:8px}ha-config-section:last-child{padding-bottom:20px}ha-card ha-icon-button{color:var(--secondary-text-color)}.card-header>ha-icon-button{float:right;position:relative;top:-8px}span[slot=introduction] a{color:var(--primary-color)}ha-button[slot=fab]{position:relative;bottom:calc(-80px - var(--safe-area-inset-bottom));transition:bottom .3s;--ha-button-box-shadow:var(--ha-box-shadow-l)}ha-alert{display:block;margin-bottom:24px}ha-alert ha-button[slot=action]{width:max-content;white-space:nowrap}ha-button[slot=fab].dirty{bottom:0}ha-button[slot=fab].saving{opacity:var(--light-disabled-opacity)}ha-entity-picker{display:block;margin-top:8px}div[slot=meta]{display:flex;justify-content:center;align-items:center}ha-list-item.entity{padding-right:28px}`))]}constructor(...e){super(...e),this.narrow=!1,this.isWide=!1,this.sceneId=null,this._dirty=!1,this._entities=[],this._single_entities=[],this._devices=[],this._entityRegistryEntries=[],this._mode="review",this._storedStates={},this._deviceEntityLookup={},this._saving=!1,this._getEntitiesDevices=(0,l.A)((e,t,i,a)=>{const s=[];if(t.length){const e={};for(const t of a)e[t.id]=t;t.forEach(t=>{const a=e[t],o=i[t]||[];s.push({name:(0,h.T)(a,this.hass.localize,this.hass.states,this._deviceEntityLookup[a.id]),id:a.id,entities:o})})}const o=[];return e.forEach(e=>{s.find(t=>t.entities.includes(e))||o.push(e)}),{devices:s,entities:o}}),this._backTapped=async()=>{await this._confirmUnsavedChanged()&&this._goBack()}}}(0,a.Cg)([(0,n.MZ)({attribute:!1})],ge.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],ge.prototype,"narrow",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"is-wide",type:Boolean})],ge.prototype,"isWide",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],ge.prototype,"route",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],ge.prototype,"sceneId",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],ge.prototype,"scenes",void 0),(0,a.Cg)([(0,n.wk)()],ge.prototype,"_dirty",void 0),(0,a.Cg)([(0,n.wk)()],ge.prototype,"_errors",void 0),(0,a.Cg)([(0,n.wk)()],ge.prototype,"_yamlErrors",void 0),(0,a.Cg)([(0,n.wk)()],ge.prototype,"_config",void 0),(0,a.Cg)([(0,n.wk)()],ge.prototype,"_entities",void 0),(0,a.Cg)([(0,n.wk)()],ge.prototype,"_devices",void 0),(0,a.Cg)([(0,n.wk)(),(0,s.Fg)({context:k.ih,subscribe:!0}),(0,c.p)({transformer:function(e){return null==e?void 0:e.find(({entity_id:e})=>{var t;return e===(null===(t=this._scene)||void 0===t?void 0:t.entity_id)})},watch:["_scene"]})],ge.prototype,"_registryEntry",void 0),(0,a.Cg)([(0,n.wk)(),(0,s.Fg)({context:k.ih,subscribe:!0})],ge.prototype,"_entityRegistryEntries",void 0),(0,a.Cg)([(0,n.wk)()],ge.prototype,"_scene",void 0),(0,a.Cg)([(0,n.wk)()],ge.prototype,"_mode",void 0),(0,a.Cg)([(0,n.wk)()],ge.prototype,"_saving",void 0),ge=(0,a.Cg)([(0,n.EM)("ha-scene-editor")],ge),t()}catch(j){t(j)}})},46738:function(e,t,i){i.d(t,{P:function(){return o}});i(3362),i(62953);var a=i(1087);const s=()=>Promise.all([i.e(85010),i.e(66201),i.e(52808),i.e(10509)]).then(i.bind(i,63254)),o=(e,t)=>{(0,a.r)(e,"show-dialog",{dialogTag:"ha-dialog-scene-save",dialogImport:s,dialogParams:t})}},53580:function(e,t,i){i.d(t,{mdiHomeAssistant:function(){return a}});const a="m12.151 1.5882c-.3262 0-.6523.1291-.8996.3867l-8.3848 8.7354c-.0619.0644-.1223.1368-.1807.2154-.0588.0789-.1151.1638-.1688.2534-.2593.4325-.4552.9749-.5232 1.4555-.0026.018-.0076.0369-.0094.0548-.0121.0987-.0184.1944-.0184.2857v8.0124a1.2731 1.2731 0 001.2731 1.2731h7.8313l-3.4484-3.593a1.7399 1.7399 0 111.0803-1.125l2.6847 2.7972v-10.248a1.7399 1.7399 0 111.5276-0v7.187l2.6702-2.782a1.7399 1.7399 0 111.0566 1.1505l-3.7269 3.8831v2.7299h8.174a1.2471 1.2471 0 001.2471-1.2471v-8.0375c0-.0912-.0059-.1868-.0184-.2855-.0603-.4935-.2636-1.0617-.5326-1.5105-.0537-.0896-.1101-.1745-.1684-.253-.0588-.079-.1191-.1513-.181-.2158l-8.3848-8.7363c-.2473-.2577-.5735-.3866-.8995-.3864"},36918:function(e,t,i){i.d(t,{o:function(){return a}});const a=(e,t)=>`https://www.iobroker.net/#${e.language&&e.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},75751:function(e,t,i){i.d(t,{u:function(){return r}});i(16280),i(45367),i(92731),i(62953);var a=i(5055),s=i(42017),o=i(63937);const n=(e,t,i)=>{const a=new Map;for(let s=t;s<=i;s++)a.set(e[s],s);return a},r=(0,s.u$)(class extends s.WL{dt(e,t,i){let a;void 0===i?i=t:void 0!==t&&(a=t);const s=[],o=[];let n=0;for(const r of e)s[n]=a?a(r,n):n,o[n]=i(r,n),n++;return{values:o,keys:s}}render(e,t,i){return this.dt(e,t,i).values}update(e,[t,i,s]){var r;const l=(0,o.cN)(e),{values:c,keys:d}=this.dt(t,i,s);if(!Array.isArray(l))return this.ut=d,c;const h=null!==(r=this.ut)&&void 0!==r?r:this.ut=[],u=[];let p,g,v=0,_=l.length-1,m=0,f=c.length-1;for(;v<=_&&m<=f;)if(null===l[v])v++;else if(null===l[_])_--;else if(h[v]===d[m])u[m]=(0,o.lx)(l[v],c[m]),v++,m++;else if(h[_]===d[f])u[f]=(0,o.lx)(l[_],c[f]),_--,f--;else if(h[v]===d[f])u[f]=(0,o.lx)(l[v],c[f]),(0,o.Dx)(e,u[f+1],l[v]),v++,f--;else if(h[_]===d[m])u[m]=(0,o.lx)(l[_],c[m]),(0,o.Dx)(e,l[v],l[_]),_--,m++;else if(void 0===p&&(p=n(d,m,f),g=n(h,v,_)),p.has(h[v]))if(p.has(h[_])){const t=g.get(d[m]),i=void 0!==t?l[t]:null;if(null===i){const t=(0,o.Dx)(e,l[v]);(0,o.lx)(t,c[m]),u[m]=t}else u[m]=(0,o.lx)(i,c[m]),(0,o.Dx)(e,l[v],i),l[t]=null;m++}else(0,o.KO)(l[_]),_--;else(0,o.KO)(l[v]),v++;for(;m<=f;){const t=(0,o.Dx)(e,u[f+1]);(0,o.lx)(t,c[m]),u[m++]=t}for(;v<=_;){const e=l[v++];null!==e&&(0,o.KO)(e)}return this.ut=d,(0,o.mY)(e,u),a.c0}constructor(e){if(super(e),e.type!==s.OA.CHILD)throw Error("repeat() can only be used in text expressions")}})}}]);