iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
20 lines • 35.7 kB
JavaScript
/*! For license information please see 56740.f8a51ec9b7af6be2.js.LICENSE.txt */
export const __rspack_esm_id=56740;export const __rspack_esm_ids=[56740];export const __webpack_modules__={64481(e,t,i){i.d(t,{D:()=>o,J:()=>r});i(64979);let a=!1;try{a="true"===window.localStorage.getItem("disableViewTransition")}catch{}const o=e=>{a=e},s=e=>{if(!(e=>(e instanceof DOMException||e instanceof Error)&&"AbortError"===e.name)(e))throw e},r=e=>{if(!document.startViewTransition||a)return e(!1),Promise.resolve();let t=!1;try{const i=document.startViewTransition(()=>{t=!0,e(!0)});return i.ready.catch(s),i.finished.catch(s)}catch(i){return console.warn("View transition failed, falling back to direct execution.",i),t?Promise.reject(i):(e(!1),Promise.resolve())}}},93444(e,t,i){var a=i(62826),o=i(5124),s=i(22441);class r extends o.WF{render(){return o.qy` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `}static get styles(){return[o.AH`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}}r=(0,a.Cg)([(0,s.EM)("ha-dialog-footer")],r)},76538(e,t,i){var a=i(62826),o=i(5124),s=i(22441);class r extends o.WF{render(){const e=o.qy`<div class="header-title"> <slot name="title"></slot> </div>`,t=o.qy`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`;return o.qy` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${"above"===this.subtitlePosition?o.qy`${t}${e}`:o.qy`${e}${t}`} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `}static get styles(){return[o.AH`:host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:center;padding:0 var(--ha-space-1);box-sizing:border-box}.header-content{flex:1;padding:10px var(--ha-space-1);display:flex;flex-direction:column;justify-content:center;min-height:var(--ha-space-12);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{height:var(--ha-dialog-header-title-height,calc(var(--ha-font-size-xl) + var(--ha-space-1)));font-size:var(--ha-font-size-xl);line-height:var(--ha-line-height-condensed);font-weight:var(--ha-font-weight-medium);color:var(--ha-dialog-header-title-color,var(--primary-text-color))}.header-subtitle{font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal);color:var(--ha-dialog-header-subtitle-color,var(--secondary-text-color))} all and (min-width:450px) and (min-height:500px){.header-bar{padding:0 var(--ha-space-2)}}.header-navigation-icon{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}`]}constructor(...e){super(...e),this.subtitlePosition="below",this.showBorder=!1}}(0,a.Cg)([(0,s.MZ)({type:String,attribute:"subtitle-position"})],r.prototype,"subtitlePosition",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],r.prototype,"showBorder",void 0),r=(0,a.Cg)([(0,s.EM)("ha-dialog-header")],r)},72554(e,t,i){i.a(e,async function(e,t){try{var a=i(62826),o=i(93900),s=i(35211),r=i(5124),l=i(22441),n=i(63672),d=i(1087),h=i(64481),c=i(22792),p=i(59992),g=i(14503),u=i(22348),v=(i(76538),i(26300)),f=e([o,v]);[o,v]=f.then?(await f)():f;const b="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z";class m extends((0,p.V)(r.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(e){super.updated(e),e.has("open")&&(this._open=this.open)}render(){return r.qy` <wa-dialog .open="${this._open}" .lightDismiss="${!this.preventScrimClose}" without-header aria-labelledby="${(0,n.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0))}" aria-describedby="${(0,n.J)(this.ariaDescribedBy)}" ="${this._handleKeyDown}" -hide="${this._handleHide}" -show="${this._handleShow}" -after-show="${this._handleAfterShow}" -after-hide="${this._handleAfterHide}"> ${this.withoutHeader?r.s6:r.qy`<slot name="header"> <ha-dialog-header .subtitlePosition="${this.headerSubtitlePosition}" .showBorder="${this._bodyScrolled}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${this._i18n?.localize?.("ui.common.close")??"Close"}" .path="${b}"></ha-icon-button> </slot> ${void 0!==this.headerTitle?r.qy`<span slot="title" class="title" id="ha-dialog-title"> ${this.headerTitle} </span>`:r.qy`<slot name="headerTitle" slot="title"></slot>`} ${void 0!==this.headerSubtitle?r.qy`<span slot="subtitle">${this.headerSubtitle}</span>`:r.qy`<slot name="headerSubtitle" slot="subtitle"></slot>`} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`} <div class="content-wrapper"> <div class="body ha-scrollbar" ="${this._handleBodyScroll}"> <slot></slot> </div> ${this.renderScrollableFades()} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(e){this._open?(0,h.J)(()=>{this._setFullscreen(e.detail)}):this._setFullscreen(e.detail)}_setFullscreen(e){this.toggleAttribute("fullscreen",e)}_handleBodyScroll(e){this._bodyScrolled=e.target.scrollTop>0}_handleKeyDown(e){"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)}_handleHide(e){const t=e.detail?.source===e.target.dialog;this.preventScrimClose&&this._escapePressed&&t&&e.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,g.dp,r.AH`wa-dialog{--full-width:var(
--ha-dialog-width-full,
min(95vw, var(--safe-width))
);--width:min(var(--ha-dialog-width-md, 580px), var(--full-width));--spacing:var(--dialog-content-padding, var(--ha-space-6));--show-duration:var(--ha-dialog-show-duration, 200ms);--hide-duration:var(--ha-dialog-hide-duration, 200ms);--wa-color-surface-raised:var(
--ha-dialog-surface-background,
var(--card-background-color, var(--ha-color-surface-default))
);--wa-panel-border-radius:var(
--ha-dialog-border-radius,
var(--ha-border-radius-3xl)
);max-width:var(--ha-dialog-max-width,var(--safe-width))} (prefers-reduced-motion:reduce){wa-dialog{--show-duration:0ms;--hide-duration:0ms}}:host([width=small]) wa-dialog{--width:min(var(--ha-dialog-width-sm, 320px), var(--full-width))}:host([width=large]) wa-dialog{--width:min(var(--ha-dialog-width-lg, 1024px), var(--full-width))}:host([fullscreen]) wa-dialog,:host([width=full]) wa-dialog{--width:var(--full-width)}:host([fullscreen]) wa-dialog::part(dialog){min-height:var(--safe-height);max-height:var(--safe-height);margin-top:0;transform:none}:host([fullscreen]) .content-wrapper{overflow:hidden}:host([fullscreen]) .body{overflow:hidden;padding:0}wa-dialog::part(dialog){-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);box-shadow:var(--dialog-box-shadow,var(--wa-shadow-l));color:var(--primary-text-color);min-width:var(--width,var(--full-width));max-width:var(--width,var(--full-width));max-height:var(--ha-dialog-max-height,calc(var(--safe-height) - var(--ha-space-20)));min-height:var(--ha-dialog-min-height);margin-top:var(--dialog-surface-margin-top,auto);transform:translate(calc(var(--safe-area-offset-left,0px) - var(--safe-area-offset-right,0px)),calc(var(--safe-area-offset-top,0px) - var(--safe-area-offset-bottom,0px)));display:flex;flex-direction:column;overflow:hidden}wa-dialog::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));background-color:var(--mdc-dialog-scrim-color,none)} all and (max-width:450px),all and (max-height:500px){:host([type=standard]){--ha-dialog-border-radius:0}:host([type=standard]) wa-dialog{--full-width:var(--ha-dialog-width-full, 100vw);--width:var(--full-width)}:host([type=standard]) wa-dialog::part(dialog){min-height:var(--ha-dialog-min-height,100vh);min-height:var(--ha-dialog-min-height,100dvh);max-height:var(--ha-dialog-max-height,100vh);max-height:var(--ha-dialog-max-height,100dvh);margin-top:0;margin-bottom:0;padding-top:var(--safe-area-inset-top);padding-bottom:var(--safe-area-inset-bottom);padding-left:var(--safe-area-inset-left);padding-right:var(--safe-area-inset-right);transform:none}}.header-title-container{display:flex;align-items:center}.header-title{margin:0;margin-bottom:0;color:var(--ha-dialog-header-title-color,var(--primary-text-color));font-size:var(
--ha-dialog-header-title-font-size,
var(--ha-font-size-2xl)
);line-height:var(
--ha-dialog-header-title-line-height,
var(--ha-line-height-condensed)
);font-weight:var(--ha-dialog-header-title-font-weight,var(--ha-font-weight-normal));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:var(--ha-space-3)}wa-dialog::part(body){padding:0;display:flex;flex-direction:column;max-width:100%;overflow:hidden}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6));overflow:auto;flex-grow:1}:host([flexcontent]) .body{max-width:100%;flex:1;display:flex;flex-direction:column}wa-dialog::part(footer){padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}constructor(...e){super(...e),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.flexContent=!1,this.withoutHeader=!1,this._open=!1,this._bodyScrolled=!1,this._escapePressed=!1,this._handleShow=async e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,d.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{if(this._hassConfig?.auth.external&&(0,u.V)(this._hassConfig.auth.external)){const e=this.querySelector("[autofocus]");return void(null!==e&&(e.id||(e.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})))}this.querySelector("[autofocus]")?.focus()}))},this._handleAfterShow=e=>{e.eventPhase===Event.AT_TARGET&&(0,d.r)(this,"after-show")},this._handleAfterHide=e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,d.r)(this,"closed"))}}}(0,a.Cg)([(0,l.MZ)({attribute:"aria-labelledby"})],m.prototype,"ariaLabelledBy",void 0),(0,a.Cg)([(0,l.MZ)({attribute:"aria-describedby"})],m.prototype,"ariaDescribedBy",void 0),(0,a.Cg)([(0,l.MZ)({type:Boolean,reflect:!0})],m.prototype,"open",void 0),(0,a.Cg)([(0,l.MZ)({reflect:!0})],m.prototype,"type",void 0),(0,a.Cg)([(0,l.MZ)({type:String,reflect:!0,attribute:"width"})],m.prototype,"width",void 0),(0,a.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],m.prototype,"preventScrimClose",void 0),(0,a.Cg)([(0,l.MZ)({attribute:"header-title"})],m.prototype,"headerTitle",void 0),(0,a.Cg)([(0,l.MZ)({attribute:"header-subtitle"})],m.prototype,"headerSubtitle",void 0),(0,a.Cg)([(0,l.MZ)({type:String,attribute:"header-subtitle-position"})],m.prototype,"headerSubtitlePosition",void 0),(0,a.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],m.prototype,"flexContent",void 0),(0,a.Cg)([(0,l.MZ)({type:Boolean,attribute:"without-header"})],m.prototype,"withoutHeader",void 0),(0,a.Cg)([(0,l.wk)()],m.prototype,"_open",void 0),(0,a.Cg)([(0,l.P)(".body")],m.prototype,"bodyContainer",void 0),(0,a.Cg)([(0,l.wk)(),(0,s.Fg)({context:c.D5,subscribe:!0})],m.prototype,"_i18n",void 0),(0,a.Cg)([(0,l.wk)(),(0,s.Fg)({context:c.WF,subscribe:!0})],m.prototype,"_hassConfig",void 0),(0,a.Cg)([(0,l.wk)()],m.prototype,"_bodyScrolled",void 0),(0,a.Cg)([(0,l.Ls)({passive:!0})],m.prototype,"_handleBodyScroll",null),m=(0,a.Cg)([(0,l.EM)("ha-dialog")],m),t()}catch(e){t(e)}})},65829(e,t,i){i.a(e,async function(e,a){try{i.r(t),i.d(t,{HaSpinner:()=>d});var o=i(62826),s=i(55262),r=i(5124),l=i(22441),n=e([s]);s=(n.then?(await n)():n)[0];class d extends s.A{updated(e){if(super.updated(e),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}static get styles(){return[s.A.styles,r.AH`:host{--indicator-color:var(
--ha-spinner-indicator-color,
var(--primary-color)
);--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`]}}(0,o.Cg)([(0,l.MZ)()],d.prototype,"size",void 0),d=(0,o.Cg)([(0,l.EM)("ha-spinner")],d),a()}catch(e){a(e)}})},59992(e,t,i){i.d(t,{V:()=>n});var a=i(62826),o=i(88696),s=i(5124),r=i(6412),l=i(22441);const n=e=>{class t extends e{get scrollableElement(){return t.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(e){super.firstUpdated?.(e),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(e){super.updated?.(e),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(e=!1){return s.qy` <div class="${(0,r.H)({"fade-top":!0,rounded:e,visible:this._contentScrolled})}"></div> <div class="${(0,r.H)({"fade-bottom":!0,rounded:e,visible:this._contentScrollable})}"></div> `}static get styles(){const e=Object.getPrototypeOf(this);var t;return[...void 0===(t=e?.styles??[])?[]:Array.isArray(t)?t:[t],s.AH`.fade-bottom,.fade-top{position:absolute;left:0;right:0;height:var(--ha-space-2);pointer-events:none;transition:opacity 180ms ease-in-out;border-radius:var(--ha-border-radius-square);opacity:0;background:linear-gradient(to bottom,var(--ha-color-shadow-scrollable-fade),transparent)}.fade-top{top:0}.fade-bottom{bottom:0;transform:rotate(180deg)}.fade-bottom.visible,.fade-top.visible{opacity:1}.fade-bottom.rounded,.fade-top.rounded{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}.fade-top.rounded{border-top-left-radius:var(--ha-border-radius-square);border-top-right-radius:var(--ha-border-radius-square)}.fade-bottom.rounded{border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}`]}_attachScrollableElement(){const e=this.scrollableElement;e!==this._scrollTarget&&(this._detachScrollableElement(),e&&(this._scrollTarget=e,e.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(e),this._updateScrollableState(e)))}_detachScrollableElement(){this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),this._resize.unobserve?.(this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(e){const t=parseFloat(getComputedStyle(e).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:i=0,clientHeight:a=0,scrollTop:o=0}=e;this._contentScrollable=i-a>o+t+this.scrollFadeSafeAreaPadding}constructor(...e){super(...e),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=e=>{const t=e.currentTarget;this._contentScrolled=(t.scrollTop??0)>this.scrollFadeThreshold,this._updateScrollableState(t)},this._resize=new o.P(this,{target:null,callback:e=>{const t=e[0]?.target;t&&this._updateScrollableState(t)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return t.DEFAULT_SCROLLABLE_ELEMENT=null,(0,a.Cg)([(0,l.wk)()],t.prototype,"_contentScrolled",void 0),(0,a.Cg)([(0,l.wk)()],t.prototype,"_contentScrollable",void 0),t}},81199(e,t,i){i.a(e,async function(e,a){try{i.r(t);i(74423),i(18111),i(22489),i(7588),i(61701),i(13579);var o=i(62826),s=i(5124),r=i(22441),l=i(1087),n=i(18350),d=i(72554),h=(i(93444),i(26300)),c=i(36866),p=(i(86698),i(83492),i(65829)),g=i(84621),u=i(14503),v=i(85614),f=e([n,d,h,c,p]);[n,d,h,c,p]=f.then?(await f)():f;const b="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z";class m extends s.WF{showDialog(e){this._params=e,this._deviceEndpoints=[],this._filter="",this._group=void 0,this._selectedDevicesToAdd=[],this._open=!0,this._fetchData()}closeDialog(){return!this._processingAdd&&(this._open=!1,!0)}_dialogClosed(){this._params=void 0,this._deviceEndpoints=[],this._filter="",this._group=void 0,this._loading=!1,this._processingAdd=!1,this._selectedDevicesToAdd=[],this._virtualizerReady=!1,(0,l.r)(this,"dialog-closed",{dialog:this.localName})}render(){if(!this._params)return s.s6;const e=this._filteredDeviceEndpoints,t=this._availableDeviceEndpoints.length>5||this._filter;return s.qy` <ha-dialog .open="${this._open}" header-title="${this.hass.localize("ui.panel.config.zha.groups.add_members")}" ?prevent-scrim-close="${this._selectedDevicesToAdd.length>0}" -show="${this._loadVirtualizer}" ="${this._dialogClosed}"> <ha-icon-button slot="headerNavigationIcon" .label="${this.hass.localize("ui.common.close")}" .path="${b}" .disabled="${this._processingAdd}" ="${this.closeDialog}"></ha-icon-button> <div class="content"> ${this._loading?this._renderLoadingSpinner():s.qy` ${t?s.qy` <ha-input-search appearance="outlined" .value="${this._filter}" ="${this._handleFilterChanged}"></ha-input-search> `:s.s6} <div class="list-container"> ${e.length?s.qy` ${this._virtualizerReady?s.qy` <ha-list-selectable multi -list-selected="${this._handleSelected}"> <lit-virtualizer scroller class="ha-scrollbar" .items="${e}" .renderItem="${this._renderDeviceEndpoint}" .keyFunction="${this._keyFunction}"></lit-virtualizer> </ha-list-selectable> `:this._renderLoadingSpinner()} `:s.qy` <div class="empty-list"> ${this._filter?this.hass.localize("ui.panel.config.zha.groups.no_devices_found"):this.hass.localize("ui.panel.config.zha.groups.no_devices_to_add")} </div> `} </div> `} </div> <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" appearance="plain" ="${this.closeDialog}" .disabled="${this._processingAdd}"> ${this.hass.localize("ui.common.cancel")} </ha-button> <ha-button slot="primaryAction" .disabled="${this._loading||!this._selectedDevicesToAdd.length||this._processingAdd}" .loading="${this._processingAdd}" ="${this._addMembersToGroup}"> ${this.hass.localize("ui.panel.config.zha.groups.add_members")} </ha-button> </ha-dialog-footer> </ha-dialog> `}_renderLoadingSpinner(){return s.qy` <div class="spinner-container"> <ha-spinner size="medium"></ha-spinner> </div> `}get _availableDeviceEndpoints(){return this._group?this._deviceEndpoints.filter(e=>!this._group.members.some(t=>t.device.ieee===e.device.ieee&&t.endpoint_id===e.endpoint_id)):[]}get _filteredDeviceEndpoints(){const e=this._filter.trim().toLowerCase(),t=this._availableDeviceEndpoints;return e?t.filter(t=>[this._deviceEndpointName(t),this._deviceEndpointDetails(t),t.device.ieee,t.device.manufacturer,t.device.model].filter(Boolean).some(t=>t.toLowerCase().includes(e))):t}async _loadVirtualizer(){await(0,v.i)(),this._virtualizerReady=!0}_deviceEndpointId(e){return`${e.device.ieee}_${e.endpoint_id}`}_deviceEndpointName(e){return e.device.user_given_name||e.device.name}_deviceEndpointDetails(e){const t=e.entities.map(e=>e.name||e.original_name||e.entity_id),i=t.length?t.length>2?`${t.slice(0,2).join(", ")} +${t.length-2}`:t.join(", "):this.hass.localize("ui.panel.config.zha.groups.no_entities");return[e.device.area_id?this.hass.areas[e.device.area_id]?.name:void 0,`${this.hass.localize("ui.panel.config.zha.groups.endpoint")} ${e.endpoint_id}`,i].filter(Boolean).join(" · ")}async _fetchData(){const e=++this._fetchDataToken;this._loading=!0;const[t,i]=await Promise.all([(0,g.Ui)(this.hass,this._params.groupId),(0,g.zt)(this.hass)]);e===this._fetchDataToken&&this._params&&(this._group=t,this._deviceEndpoints=i,this._loading=!1)}_handleFilterChanged(e){this._filter=e.currentTarget.value}_handleSelected(e){const t=e.currentTarget;let i=this._selectedDevicesToAdd;e.detail.diff?.added.forEach(e=>{const a=t.items[e];a?.value&&!i.includes(a.value)&&(i=[...i,a.value])}),e.detail.diff?.removed.forEach(e=>{const a=t.items[e];a?.value&&(i=i.filter(e=>e!==a.value))}),this._selectedDevicesToAdd=i}async _addMembersToGroup(){this._processingAdd=!0;try{const e=this._selectedDevicesToAdd.map(e=>{const t=e.split("_");return{ieee:t[0],endpoint_id:t[1]}}),t=await(0,g.hi)(this.hass,this._params.groupId,e);this._params.devicesAddedCallback(t),this._processingAdd=!1,this.closeDialog()}finally{this._processingAdd=!1}}static get styles(){return[u.dp,s.AH`ha-dialog{--dialog-content-padding:0}.content{display:flex;flex-direction:column;height:min(520px,calc(100vh - 240px))}ha-input-search{display:block;margin:0 var(--ha-space-4) var(--ha-space-2)}ha-list-selectable{display:block;width:100%;height:100%}ha-list-selectable::part(base){width:100%;height:100%}.list-container{flex:1 1 auto;width:100%;min-height:0;overflow:hidden}lit-virtualizer{display:block;width:100%;height:100%;contain:size layout!important}ha-list-item-option{display:block;width:100%;height:64px;box-sizing:border-box;--ha-row-item-min-height:64px}.spinner-container{display:flex;flex:1 1 auto;align-items:center;justify-content:center;min-height:160px}ha-spinner{display:block}.empty-list{padding:var(--ha-space-6);color:var(--secondary-text-color);text-align:center}`]}constructor(...e){super(...e),this._deviceEndpoints=[],this._filter="",this._loading=!1,this._open=!1,this._processingAdd=!1,this._selectedDevicesToAdd=[],this._virtualizerReady=!1,this._fetchDataToken=0,this._keyFunction=e=>this._deviceEndpointId(e),this._renderDeviceEndpoint=e=>{const t=this._deviceEndpointId(e);return s.qy` <ha-list-item-option appearance="checkbox" .value="${t}" .selected="${this._selectedDevicesToAdd.includes(t)}"> <span slot="headline">${this._deviceEndpointName(e)}</span> <span slot="supporting-text"> ${this._deviceEndpointDetails(e)} </span> </ha-list-item-option> `}}}(0,o.Cg)([(0,r.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,o.Cg)([(0,r.wk)()],m.prototype,"_deviceEndpoints",void 0),(0,o.Cg)([(0,r.wk)()],m.prototype,"_filter",void 0),(0,o.Cg)([(0,r.wk)()],m.prototype,"_group",void 0),(0,o.Cg)([(0,r.wk)()],m.prototype,"_loading",void 0),(0,o.Cg)([(0,r.wk)()],m.prototype,"_open",void 0),(0,o.Cg)([(0,r.wk)()],m.prototype,"_params",void 0),(0,o.Cg)([(0,r.wk)()],m.prototype,"_processingAdd",void 0),(0,o.Cg)([(0,r.wk)()],m.prototype,"_selectedDevicesToAdd",void 0),(0,o.Cg)([(0,r.wk)()],m.prototype,"_virtualizerReady",void 0),m=(0,o.Cg)([(0,r.EM)("dialog-zha-add-group-members")],m),a()}catch(e){a(e)}})},85614(e,t,i){i.d(t,{i:()=>a});const a=async()=>{await Promise.all([i.e(69139),i.e(22309)]).then(i.bind(i,46974))}},22348(e,t,i){i.d(t,{V:()=>o});var a=i(37177);const o=e=>!!e&&a.n},37177(e,t,i){i.d(t,{n:()=>a});const a=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},93900(e,t,i){i.a(e,async function(e,t){try{var a=i(5124),o=i(22441),s=i(6412),r=i(63672),l=i(17051),n=i(42462),d=i(28438),h=i(98779),c=i(27259),p=i(25877),g=i(31247),u=i(4444),v=i(92070),f=i(9395),b=i(717),m=i(17060),w=i(88496),y=i(91470),_=e([w,m]);[w,m]=_.then?(await _)():_;var x=Object.defineProperty,k=Object.getOwnPropertyDescriptor,C=(e,t,i,a)=>{for(var o,s=a>1?void 0:a?k(t,i):t,r=e.length-1;r>=0;r--)(o=e[r])&&(s=(a?o(t,i,s):o(s))||s);return a&&s&&x(t,i,s),s};let $=class extends b.A{firstUpdated(){this.open&&(this.addOpenListeners(),this.dialog.showModal(),(0,u.JG)(this))}disconnectedCallback(){super.disconnectedCallback(),(0,u.I7)(this),this.removeOpenListeners()}async requestClose(e){const t=new d.L({source:e});if(this.dispatchEvent(t),t.defaultPrevented)return this.open=!0,void(0,c.Ud)(this.dialog,"pulse");this.removeOpenListeners(),await(0,c.Ud)(this.dialog,"hide"),this.open=!1,this.dialog.close(),(0,u.I7)(this);const i=this.originalTrigger;"function"==typeof i?.focus&&setTimeout(()=>i.focus()),this.dispatchEvent(new l.Z)}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown),(0,p.AZ)(this)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,p.Fw)(this)}handleDialogCancel(e){e.preventDefault(),!this.dialog.classList.contains("hide")&&e.target===this.dialog&&(0,p.a0)(this)&&this.requestClose(this.dialog)}handleDialogClick(e){const t=e.target.closest('[data-dialog="close"]');t&&(e.stopPropagation(),this.requestClose(t))}async handleDialogPointerDown(e){e.target===this.dialog&&(this.lightDismiss?this.requestClose(this.dialog):await(0,c.Ud)(this.dialog,"pulse"))}handleOpenChange(){this.open&&!this.dialog.open?this.show():!this.open&&this.dialog.open&&(this.open=!0,this.requestClose(this.dialog))}async show(){const e=new h.k;this.dispatchEvent(e),e.defaultPrevented?this.open=!1:(this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.dialog.showModal(),(0,u.JG)(this),requestAnimationFrame(()=>{const e=this.querySelector("[autofocus]");e&&"function"==typeof e.focus?e.focus():this.dialog.focus()}),await(0,c.Ud)(this.dialog,"show"),this.dispatchEvent(new n.q))}render(){const e=!this.withoutHeader,t=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return a.qy` <dialog aria-labelledby="${this.ariaLabelledby??"title"}" aria-describedby="${(0,r.J)(this.ariaDescribedby)}" part="dialog" class="${(0,s.H)({dialog:!0,open:this.open})}" ="${this.handleDialogCancel}" ="${this.handleDialogClick}" ="${this.handleDialogPointerDown}"> ${e?a.qy` <header part="header" class="header"> <h2 part="title" class="title" id="title"> <slot name="label"> ${this.label.length>0?this.label:String.fromCharCode(8203)} </slot> </h2> <div part="header-actions" class="header-actions"> <slot name="header-actions"></slot> <wa-button part="close-button" exportparts="base:close-button__base" class="close" appearance="plain" ="${e=>this.requestClose(e.target)}"> <wa-icon name="xmark" label="${this.localize.term("close")}" library="system" variant="solid"></wa-icon> </wa-button> </div> </header> `:""} <div part="body" class="body"><slot></slot></div> ${t?a.qy` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `:""} </dialog> `}constructor(){super(...arguments),this.localize=new m.c(this),this.hasSlotController=new v.X(this,"footer","header-actions","label"),this.open=!1,this.label="",this.withoutHeader=!1,this.lightDismiss=!1,this.withFooter=!1,this.handleDocumentKeyDown=e=>{"Escape"===e.key&&this.open&&(0,p.a0)(this)&&(e.preventDefault(),e.stopPropagation(),this.requestClose(this.dialog))}}};$.css=y.A,C([(0,o.P)(".dialog")],$.prototype,"dialog",2),C([(0,o.MZ)({type:Boolean,reflect:!0})],$.prototype,"open",2),C([(0,o.MZ)({reflect:!0})],$.prototype,"label",2),C([(0,o.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],$.prototype,"withoutHeader",2),C([(0,o.MZ)({attribute:"light-dismiss",type:Boolean})],$.prototype,"lightDismiss",2),C([(0,o.MZ)({attribute:"aria-labelledby"})],$.prototype,"ariaLabelledby",2),C([(0,o.MZ)({attribute:"aria-describedby"})],$.prototype,"ariaDescribedby",2),C([(0,o.MZ)({attribute:"with-footer",type:Boolean})],$.prototype,"withFooter",2),C([(0,f.w)("open",{waitUntilFirstUpdate:!0})],$.prototype,"handleOpenChange",1),$=C([(0,o.EM)("wa-dialog")],$),a.S$||(document.addEventListener("click",e=>{const t=e.target.closest("[data-dialog]");if(t instanceof Element){const[e,i]=(0,g.v)(t.getAttribute("data-dialog")||"");if("open"===e&&i?.length){const e=t.getRootNode().getElementById(i);"wa-dialog"===e?.localName?e.open=!0:console.warn(`A dialog with an ID of "${i}" could not be found in this document.`)}}}),document.addEventListener("pointerdown",()=>{})),t()}catch(e){t(e)}})},91470(e,t,i){i.d(t,{A:()=>a});var a=i(5124).AH`:host{--width:31rem;--spacing:var(--wa-space-l);--backdrop-filter:none;--show-duration:200ms;--hide-duration:200ms;display:none}:host([open]){display:block}.dialog{display:flex;flex-direction:column;top:0;right:0;bottom:0;left:0;width:var(--width);max-width:calc(100% - var(--wa-space-2xl));max-height:calc(100% - var(--wa-space-2xl));color:inherit;background-color:var(--wa-color-surface-raised);border-radius:var(--wa-panel-border-radius);border:none;box-shadow:var(--wa-shadow-l);padding:0;margin:auto}.dialog.show{animation:show-dialog var(--show-duration) ease}.dialog.show::backdrop{animation:show-backdrop var(--show-duration,200ms) ease}.dialog.hide{animation:show-dialog var(--hide-duration) ease reverse}.dialog.hide::backdrop{animation:show-backdrop var(--hide-duration,200ms) ease reverse}.dialog.pulse{animation:pulse 250ms ease}.dialog:focus{outline:0} screen and (max-width:420px){.dialog{max-height:80vh}}.open{display:flex;opacity:1}.header{flex:0 0 auto;display:flex;flex-wrap:nowrap;padding-inline-start:var(--spacing);padding-block-end:0;padding-inline-end:calc(var(--spacing) - var(--wa-form-control-padding-block));padding-block-start:calc(var(--spacing) - var(--wa-form-control-padding-block))}.title{align-self:center;flex:1 1 auto;font-family:inherit;font-size:var(--wa-font-size-l);font-weight:var(--wa-font-weight-heading);line-height:var(--wa-line-height-condensed);margin:0}.header-actions{align-self:start;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:end;gap:var(--wa-space-2xs);padding-inline-start:var(--spacing)}.header-actions ::slotted(wa-button),.header-actions wa-button{flex:0 0 auto;display:flex;align-items:center}.body{flex:1 1 auto;display:block;padding:var(--spacing);overflow:auto;-webkit-overflow-scrolling:touch}.body:focus{outline:0}.body:focus-visible{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}.footer{flex:0 0 auto;display:flex;flex-wrap:wrap;gap:var(--wa-space-xs);justify-content:end;padding:var(--spacing);padding-block-start:0}.footer ::slotted(wa-button:not(:first-of-type)){margin-inline-start:var(--wa-spacing-xs)}.dialog::backdrop{background-color:var(--wa-color-overlay-modal,rgb(0 0 0 / .25));-webkit-backdrop-filter:var(--backdrop-filter);backdrop-filter:var(--backdrop-filter)} pulse{0%{scale:1}50%{scale:1.02}100%{scale:1}} show-dialog{from{opacity:0;scale:0.8}to{opacity:1;scale:1}} show-backdrop{from{opacity:0}to{opacity:1}} (forced-colors:active){.dialog{border:solid 1px #fff}}`},31247(e,t,i){i.d(t,{v:()=>a});i(18111),i(22489),i(61701);function a(e){return e.split(" ").map(e=>e.trim()).filter(e=>""!==e)}},4444(e,t,i){i.d(t,{JG:()=>o,Rt:()=>r,I7:()=>s});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);const a=new Set;function o(e){if(a.add(e),!document.documentElement.classList.contains("wa-scroll-lock")){const e=function(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}()+function(){const e=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));return isNaN(e)||!e?0:e}();let t=getComputedStyle(document.documentElement).scrollbarGutter;t&&"auto"!==t||(t="stable"),e<2&&(t=""),document.documentElement.style.setProperty("--wa-scroll-lock-gutter",t),document.documentElement.classList.add("wa-scroll-lock"),document.documentElement.style.setProperty("--wa-scroll-lock-size",`${e}px`)}}function s(e){a.delete(e),0===a.size&&(document.documentElement.classList.remove("wa-scroll-lock"),document.documentElement.style.removeProperty("--wa-scroll-lock-size"))}function r(e,t,i="vertical",a="smooth"){const o=function(e,t){return{top:Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top),left:Math.round(e.getBoundingClientRect().left-t.getBoundingClientRect().left)}}(e,t),s=o.top+t.scrollTop,r=o.left+t.scrollLeft,l=t.scrollLeft,n=t.scrollLeft+t.offsetWidth,d=t.scrollTop,h=t.scrollTop+t.offsetHeight;"horizontal"!==i&&"both"!==i||(r<l?t.scrollTo({left:r,behavior:a}):r+e.clientWidth>n&&t.scrollTo({left:r-t.offsetWidth+e.clientWidth,behavior:a})),"vertical"!==i&&"both"!==i||(s<d?t.scrollTo({top:s,behavior:a}):s+e.clientHeight>h&&t.scrollTo({top:s-t.offsetHeight+e.clientHeight,behavior:a}))}},88696(e,t,i){i.d(t,{P:()=>s});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var a=i(37540),o=i(42017);class s{handleChanges(e){this.value=this.callback?.(e,this.u)}hostConnected(){for(const e of this.t)this.observe(e)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.o&&this.i&&this.handleChanges([]),this.i=!1}observe(e){this.t.add(e),this.u.observe(e,this.l),this.i=!0,this.h.requestUpdate()}unobserve(e){this.t.delete(e),this.u.unobserve(e)}disconnect(){this.u.disconnect()}target(e){return r(this,e)}constructor(e,{target:t,config:i,callback:a,skipInitial:o}){this.t=new Set,this.o=!1,this.i=!1,this.h=e,null!==t&&this.t.add(t??e),this.l=i,this.o=o??this.o,this.callback=a,window.ResizeObserver?(this.u=new ResizeObserver(e=>{this.handleChanges(e),this.h.requestUpdate()}),e.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.")}}const r=(0,o.u$)(class extends a.Kq{render(e,t){}update(e,[t,i]){this.controller=t,this.part=e,this.observe=i,!1===i?(t.unobserve(e.element),this.observing=!1):!1===this.observing&&(t.observe(e.element),this.observing=!0)}disconnected(){this.controller?.unobserve(this.part.element),this.observing=!1}reconnected(){!1!==this.observe&&!1===this.observing&&(this.controller?.observe(this.part.element),this.observing=!0)}constructor(){super(...arguments),this.observing=!1}})},37540(e,t,i){i.d(t,{Kq:()=>c});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var a=i(63937),o=i(42017);const s=(e,t)=>{const i=e._$AN;if(void 0===i)return!1;for(const e of i)e._$AO?.(t,!1),s(e,t);return!0},r=e=>{let t,i;do{if(void 0===(t=e._$AM))break;i=t._$AN,i.delete(e),e=t}while(0===i?.size)},l=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(void 0===i)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),h(t)}};function n(e){void 0!==this._$AN?(r(this),this._$AM=e,l(this)):this._$AM=e}function d(e,t=!1,i=0){const a=this._$AH,o=this._$AN;if(void 0!==o&&0!==o.size)if(t)if(Array.isArray(a))for(let e=i;e<a.length;e++)s(a[e],!1),r(a[e]);else null!=a&&(s(a,!1),r(a));else s(this,e)}const h=e=>{e.type==o.OA.CHILD&&(e._$AP??=d,e._$AQ??=n)};class c extends o.WL{_$AT(e,t,i){super._$AT(e,t,i),l(this),this.isConnected=e._$AU}_$AO(e,t=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),t&&(s(this,e),r(this))}setValue(e){if((0,a.Rt)(this._$Ct))this._$Ct._$AI(e,this);else{const t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}constructor(){super(...arguments),this._$AN=void 0}}}};