UNPKG

iobroker.lovelace

Version:

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

20 lines 48.9 kB
/*! For license information please see 47677.84af2710524caa04.js.LICENSE.txt */ "use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[47677],{12451:function(e,t,i){i.d(t,{O:function(){return n},i:function(){return o.is}});var a=i(5124),o=i(12130);class n extends a.WF{click(){if(this.mdcRoot)return this.mdcRoot.focus(),void this.mdcRoot.click();super.click()}createFoundation(){void 0!==this.mdcFoundation&&this.mdcFoundation.destroy(),this.mdcFoundationClass&&(this.mdcFoundation=new this.mdcFoundationClass(this.createAdapter()),this.mdcFoundation.init())}firstUpdated(){this.createFoundation()}}},12130:function(e,t,i){i.d(t,{SE:function(){return d},U9:function(){return l},hP:function(){return a},is:function(){return o}});i(44114);const a=e=>e.nodeType===Node.ELEMENT_NODE;function o(e){return{addClass:t=>{e.classList.add(t)},removeClass:t=>{e.classList.remove(t)},hasClass:t=>e.classList.contains(t)}}let n=!1;const r=()=>{},s={get passive(){return n=!0,!1}};document.addEventListener("x",r,s),document.removeEventListener("x",r);const l=(e=window.document)=>{let t=e.activeElement;const i=[];if(!t)return i;for(;t&&(i.push(t),t.shadowRoot);)t=t.shadowRoot.activeElement;return i},d=e=>{const t=l();if(!t.length)return!1;const i=t[t.length-1],a=new Event("check-if-focused",{bubbles:!0,composed:!0});let o=[];const n=e=>{o=e.composedPath()};return document.body.addEventListener("check-if-focused",n),i.dispatchEvent(a),document.body.removeEventListener("check-if-focused",n),-1!==o.indexOf(e)}},90409:function(e,t,i){i.d(t,{A:function(){return a}});i(18111),i(61701);function a(e){const t=e.split(":").map(Number);return 3600*t[0]+60*t[1]+t[2]}},27167:function(e,t,i){i.d(t,{A:function(){return o}});const a=e=>e<10?`0${e}`:e;function o(e){const t=Math.floor(e/3600),i=Math.floor(e%3600/60),o=Math.floor(e%3600%60);return t>0?`${t}:${a(i)}:${a(o)}`:i>0?`${i}:${a(o)}`:o>0?""+o:null}},69558:function(e,t,i){i.d(t,{_:function(){return n}});i(16280),i(18111),i(7588),i(62953);var a=i(5124),o=i(54495);const n=(0,o.u$)(class extends o.WL{update(e,[t,i]){return this._element&&this._element.localName===t?(i&&Object.entries(i).forEach(([e,t])=>{this._element[e]=t}),a.c0):this.render(t,i)}render(e,t){return this._element=document.createElement(e),t&&Object.entries(t).forEach(([e,t])=>{this._element[e]=t}),this._element}constructor(e){if(super(e),e.type!==o.OA.CHILD)throw new Error("dynamicElementDirective can only be used in content bindings")}})},64481:function(e,t,i){i.d(t,{D:function(){return o},J:function(){return r}});i(16280),i(3362),i(55815),i(64979),i(79739);let a=!1;try{a="true"===window.localStorage.getItem("disableViewTransition")}catch(s){}const o=e=>{a=e},n=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(n),i.finished.catch(n)}catch(i){return console.warn("View transition failed, falling back to direct execution.",i),t?Promise.reject(i):(e(!1),Promise.resolve())}}},8129:function(e,t,i){i.d(t,{l:function(){return a}});i(3362);const a=e=>new Promise(t=>{setTimeout(t,e)})},93444:function(e,t,i){var a=i(40445),o=i(5124),n=i(67576);let r,s,l=e=>e;class d extends o.WF{render(){return(0,o.qy)(r||(r=l` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `))}static get styles(){return[(0,o.AH)(s||(s=l`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`))]}}d=(0,a.Cg)([(0,n.EM)("ha-dialog-footer")],d)},76538:function(e,t,i){i(62953);var a=i(40445),o=i(5124),n=i(67576);let r,s,l,d,c,h,p=e=>e;class u extends o.WF{render(){const e=(0,o.qy)(r||(r=p`<div class="header-title"> <slot name="title"></slot> </div>`)),t=(0,o.qy)(s||(s=p`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`));return(0,o.qy)(l||(l=p` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${0} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `),"above"===this.subtitlePosition?(0,o.qy)(d||(d=p`${0}${0}`),t,e):(0,o.qy)(c||(c=p`${0}${0}`),e,t))}static get styles(){return[(0,o.AH)(h||(h=p`: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))}@media 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,n.MZ)({type:String,attribute:"subtitle-position"})],u.prototype,"subtitlePosition",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],u.prototype,"showBorder",void 0),u=(0,a.Cg)([(0,n.EM)("ha-dialog-header")],u)},72554:function(e,t,i){i.a(e,async function(e,t){try{i(3362),i(62953),i(49255);var a=i(40445),o=i(93900),n=i(35211),r=i(5124),s=i(67576),l=i(63672),d=i(1087),c=i(64481),h=i(22792),p=i(59992),u=i(14503),g=i(22348),f=(i(76538),i(26300)),m=e([o,f,p]);[o,f,p]=m.then?(await m)():m;let v,w,y,b,_,x,$,k=e=>e;const C="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 S 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(){var e,t,i;return(0,r.qy)(v||(v=k` <wa-dialog .open="${0}" .lightDismiss="${0}" without-header aria-labelledby="${0}" aria-describedby="${0}" @keydown="${0}" @wa-hide="${0}" @wa-show="${0}" @wa-after-show="${0}" @wa-after-hide="${0}"> ${0} <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${0}"> <slot></slot> </div> ${0} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `),this._open,!this.preventScrimClose,(0,l.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0)),(0,l.J)(this.ariaDescribedBy),this._handleKeyDown,this._handleHide,this._handleShow,this._handleAfterShow,this._handleAfterHide,this.withoutHeader?r.s6:(0,r.qy)(w||(w=k`<slot name="header"> <ha-dialog-header .subtitlePosition="${0}" .showBorder="${0}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${0}" .path="${0}"></ha-icon-button> </slot> ${0} ${0} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`),this.headerSubtitlePosition,this._bodyScrolled,null!==(e=null===(t=this._i18n)||void 0===t||null===(i=t.localize)||void 0===i?void 0:i.call(t,"ui.common.close"))&&void 0!==e?e:"Close",C,void 0!==this.headerTitle?(0,r.qy)(y||(y=k`<span slot="title" class="title" id="ha-dialog-title"> ${0} </span>`),this.headerTitle):(0,r.qy)(b||(b=k`<slot name="headerTitle" slot="title"></slot>`)),void 0!==this.headerSubtitle?(0,r.qy)(_||(_=k`<span slot="subtitle">${0}</span>`),this.headerSubtitle):(0,r.qy)(x||(x=k`<slot name="headerSubtitle" slot="subtitle"></slot>`))),this._handleBodyScroll,this.renderScrollableFades())}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(e){this._open?(0,c.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){var t;const i=(null===(t=e.detail)||void 0===t?void 0:t.source)===e.target.dialog;this.preventScrimClose&&this._escapePressed&&i&&e.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,u.dp,(0,r.AH)($||($=k`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))}@media (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)}@media 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(()=>{var e,t;if(null!==(e=this._hassConfig)&&void 0!==e&&e.auth.external&&(0,g.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}})))}null===(t=this.querySelector("[autofocus]"))||void 0===t||t.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,s.MZ)({attribute:"aria-labelledby"})],S.prototype,"ariaLabelledBy",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"aria-describedby"})],S.prototype,"ariaDescribedBy",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],S.prototype,"open",void 0),(0,a.Cg)([(0,s.MZ)({reflect:!0})],S.prototype,"type",void 0),(0,a.Cg)([(0,s.MZ)({type:String,reflect:!0,attribute:"width"})],S.prototype,"width",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],S.prototype,"preventScrimClose",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"header-title"})],S.prototype,"headerTitle",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"header-subtitle"})],S.prototype,"headerSubtitle",void 0),(0,a.Cg)([(0,s.MZ)({type:String,attribute:"header-subtitle-position"})],S.prototype,"headerSubtitlePosition",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],S.prototype,"flexContent",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"without-header"})],S.prototype,"withoutHeader",void 0),(0,a.Cg)([(0,s.wk)()],S.prototype,"_open",void 0),(0,a.Cg)([(0,s.P)(".body")],S.prototype,"bodyContainer",void 0),(0,a.Cg)([(0,s.wk)(),(0,n.Fg)({context:h.D5,subscribe:!0})],S.prototype,"_i18n",void 0),(0,a.Cg)([(0,s.wk)(),(0,n.Fg)({context:h.WF,subscribe:!0})],S.prototype,"_hassConfig",void 0),(0,a.Cg)([(0,s.wk)()],S.prototype,"_bodyScrolled",void 0),(0,a.Cg)([(0,s.Ls)({passive:!0})],S.prototype,"_handleBodyScroll",null),S=(0,a.Cg)([(0,s.EM)("ha-dialog")],S),t()}catch(v){t(v)}})},28732:function(e,t,i){var a=i(40445),o=i(27686),n=i(7731),r=i(5124),s=i(67576);let l,d,c,h=e=>e;class p extends o.J{renderRipple(){return this.noninteractive?"":super.renderRipple()}static get styles(){return[n.R,(0,r.AH)(l||(l=h`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`)),"rtl"===document.dir?(0,r.AH)(d||(d=h`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`)):(0,r.AH)(c||(c=h``))]}}p=(0,a.Cg)([(0,s.EM)("ha-list-item")],p)},8630:function(e,t,i){var a=i(40445),o=i(68618),n=i(11081),r=i(67576);class s extends o.iY{}s.styles=n.R,s=(0,a.Cg)([(0,r.EM)("ha-list")],s)},65829:function(e,t,i){i.a(e,async function(e,a){try{i.r(t),i.d(t,{HaSpinner:function(){return h}});var o=i(40445),n=i(55262),r=i(5124),s=i(67576),l=e([n]);n=(l.then?(await l)():l)[0];let d,c=e=>e;class h extends n.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[n.A.styles,(0,r.AH)(d||(d=c`: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,s.MZ)()],h.prototype,"size",void 0),h=(0,o.Cg)([(0,s.EM)("ha-spinner")],h),a()}catch(d){a(d)}})},26571:function(e,t,i){i.d(t,{Al:function(){return n},KY:function(){return o},PN:function(){return l},dG:function(){return c},jm:function(){return d},m7:function(){return f},sR:function(){return h},t1:function(){return s},t2:function(){return u},x:function(){return g},yu:function(){return p}});var a=i(95350);const o=["bluetooth","dhcp","discovery","esphome","hardware","hassio","homekit","integration_discovery","mqtt","ssdp","unignore","usb","zeroconf"],n=66649!=i.j?["reauth"]:null,r={"HA-Frontend-Base":`${location.protocol}//${location.host}`},s=(e,t,i)=>e.callApi("POST","config/config_entries/flow",{handler:t,entry_id:i},r),l=(e,t)=>e.callApi("GET",`config/config_entries/flow/${t}`,void 0,r),d=(e,t,i)=>e.callApi("POST",`config/config_entries/flow/${t}`,i,r),c=(e,t,i)=>e.callWS({type:"config_entries/ignore_flow",flow_id:t,title:i}),h=(e,t)=>e.callApi("DELETE",`config/config_entries/flow/${t}`),p=(e,t)=>e.callApi("GET","config/config_entries/flow_handlers"+(t?`?type=${t}`:"")),u=e=>e.sendMessagePromise({type:"config_entries/flow/progress"}),g=(e,t)=>e.connection.subscribeMessage(e=>t(e),{type:"config_entries/flow/subscribe"}),f=(e,t)=>t.context.title_placeholders&&0!==Object.keys(t.context.title_placeholders).length?e(`component.${t.handler}.config.flow_title`,t.context.title_placeholders)||("name"in t.context.title_placeholders?t.context.title_placeholders.name:(0,a.p$)(e,t.handler)):(0,a.p$)(e,t.handler)},21016:function(e,t,i){i.d(t,{Pu:function(){return o},SB:function(){return r},mk:function(){return n},r1:function(){return a}});const a=e=>e.callWS({type:"counter/list"}),o=(e,t)=>e.callWS(Object.assign({type:"counter/create"},t)),n=(e,t,i)=>e.callWS(Object.assign({type:"counter/update",counter_id:t},i)),r=(e,t)=>e.callWS({type:"counter/delete",counter_id:t})},2279:function(e,t,i){i.d(t,{e1:function(){return r},iE:function(){return n},nr:function(){return o},tT:function(){return a}});const a=e=>e.callWS({type:"input_boolean/list"}),o=(e,t)=>e.callWS(Object.assign({type:"input_boolean/create"},t)),n=(e,t,i)=>e.callWS(Object.assign({type:"input_boolean/update",input_boolean_id:t},i)),r=(e,t)=>e.callWS({type:"input_boolean/delete",input_boolean_id:t})},42575:function(e,t,i){i.d(t,{C1:function(){return r},L6:function(){return o},mC:function(){return n},vF:function(){return a}});const a=e=>e.callWS({type:"input_button/list"}),o=(e,t)=>e.callWS(Object.assign({type:"input_button/create"},t)),n=(e,t,i)=>e.callWS(Object.assign({type:"input_button/update",input_button_id:t},i)),r=(e,t)=>e.callWS({type:"input_button/delete",input_button_id:t})},77738:function(e,t,i){i.d(t,{Bj:function(){return l},TB:function(){return o},a2:function(){return n},fJ:function(){return s},ke:function(){return r},rv:function(){return a}});const a=e=>`${e.attributes.year||"1970"}-${String(e.attributes.month||"01").padStart(2,"0")}-${String(e.attributes.day||"01").padStart(2,"0")}T${String(e.attributes.hour||"00").padStart(2,"0")}:${String(e.attributes.minute||"00").padStart(2,"0")}:${String(e.attributes.second||"00").padStart(2,"0")}`,o=(e,t,i=void 0,a=void 0)=>{const o={entity_id:t,time:i,date:a};e.callService("input_datetime","set_datetime",o)},n=e=>e.callWS({type:"input_datetime/list"}),r=(e,t)=>e.callWS(Object.assign({type:"input_datetime/create"},t)),s=(e,t,i)=>e.callWS(Object.assign({type:"input_datetime/update",input_datetime_id:t},i)),l=(e,t)=>e.callWS({type:"input_datetime/delete",input_datetime_id:t})},6922:function(e,t,i){i.d(t,{$I:function(){return r},Tv:function(){return n},gO:function(){return o},kF:function(){return a}});const a=e=>e.callWS({type:"input_number/list"}),o=(e,t)=>e.callWS(Object.assign({type:"input_number/create"},t)),n=(e,t,i)=>e.callWS(Object.assign({type:"input_number/update",input_number_id:t},i)),r=(e,t)=>e.callWS({type:"input_number/delete",input_number_id:t})},33687:function(e,t,i){i.d(t,{BT:function(){return n},EJ:function(){return r},HV:function(){return o},MZ:function(){return a},O3:function(){return s}});const a=(e,t,i)=>e.callService("input_select","select_option",{option:i,entity_id:t}),o=e=>e.callWS({type:"input_select/list"}),n=(e,t)=>e.callWS(Object.assign({type:"input_select/create"},t)),r=(e,t,i)=>e.callWS(Object.assign({type:"input_select/update",input_select_id:t},i)),s=(e,t)=>e.callWS({type:"input_select/delete",input_select_id:t})},12284:function(e,t,i){i.d(t,{BJ:function(){return r},KY:function(){return a},MG:function(){return o},d_:function(){return s},m4:function(){return n}});const a=(e,t,i)=>e.callService(t.split(".",1)[0],"set_value",{value:i,entity_id:t}),o=e=>e.callWS({type:"input_text/list"}),n=(e,t)=>e.callWS(Object.assign({type:"input_text/create"},t)),r=(e,t,i)=>e.callWS(Object.assign({type:"input_text/update",input_text_id:t},i)),s=(e,t)=>e.callWS({type:"input_text/delete",input_text_id:t})},2247:function(e,t,i){i.d(t,{Fs:function(){return r},VD:function(){return s},YA:function(){return o},mx:function(){return a},sF:function(){return n}});const a=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],o=e=>e.callWS({type:"schedule/list"}),n=(e,t)=>e.callWS(Object.assign({type:"schedule/create"},t)),r=(e,t,i)=>e.callWS(Object.assign({type:"schedule/update",schedule_id:t},i)),s=(e,t)=>e.callWS({type:"schedule/delete",schedule_id:t})},49141:function(e,t,i){i.d(t,{CR:function(){return r},PF:function(){return c},kL:function(){return n},ls:function(){return d},pZ:function(){return l},r9:function(){return s}});var a=i(90409),o=i(27167);const n=e=>e.callWS({type:"timer/list"}),r=(e,t)=>e.callWS(Object.assign({type:"timer/create"},t)),s=(e,t,i)=>e.callWS(Object.assign({type:"timer/update",timer_id:t},i)),l=(e,t)=>e.callWS({type:"timer/delete",timer_id:t}),d=e=>{if(!e.attributes.remaining)return;let t=(0,a.A)(e.attributes.remaining);if("active"===e.state){const i=(new Date).getTime(),a=new Date(e.attributes.finishes_at).getTime();t=Math.max((a-i)/1e3,0)}return t},c=(e,t,i)=>{if(!t)return null;if("idle"===t.state||0===i)return e.formatEntityState(t);let a=(0,o.A)(i||0)||"0";return"paused"===t.state&&(a=`${a} (${e.formatEntityState(t)})`),a}},77763:function(e,t,i){i.d(t,{W:function(){return v}});i(89463),i(3362),i(62953);var a=i(5124),o=i(26571),n=i(95350),r=i(29094);let s,l,d,c,h,p,u,g,f,m=e=>e;const v=(e,t)=>(0,r.g)(e,t,{flowType:"config_flow",showDevices:!0,createFlow:async(e,i)=>{const[a]=await Promise.all([(0,o.t1)(e,i,t.entryId),e.loadFragmentTranslation("config"),e.loadBackendTranslation("config",i),e.loadBackendTranslation("selector",i),e.loadBackendTranslation("title",i)]);return a},fetchFlow:async(e,t)=>{const[i]=await Promise.all([(0,o.PN)(e,t),e.loadFragmentTranslation("config")]);return await Promise.all([e.loadBackendTranslation("config",i.handler),e.loadBackendTranslation("selector",i.handler),e.loadBackendTranslation("title",i.handler)]),i},handleFlowStep:o.jm,deleteFlow:o.sR,renderAbortDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.abort.${t.reason}`,t.description_placeholders);return i?(0,a.qy)(s||(s=m` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):t.reason},renderShowFormStepHeader(e,t){return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.title`,t.description_placeholders)||e.localize(`component.${t.handler}.title`)},renderShowFormStepDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.description`,t.description_placeholders);return i?(0,a.qy)(l||(l=m` <ha-markdown .allowDataUrl="${0}" allow-svg breaks .content="${0}"></ha-markdown> `),"zwave_js"===t.handler,i):""},renderShowFormStepFieldLabel(e,t,i,a){var o;if("expandable"===i.type)return e.localize(`component.${t.handler}.config.step.${t.step_id}.sections.${i.name}.name`,t.description_placeholders)||i.name;const n=null!=a&&null!==(o=a.path)&&void 0!==o&&o[0]?`sections.${a.path[0]}.`:"";return e.localize(`component.${t.handler}.config.step.${t.step_id}.${n}data.${i.name}`,t.description_placeholders)||i.name},renderShowFormStepFieldHelper(e,t,i,o){var n;if("expandable"===i.type)return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.sections.${i.name}.description`,t.description_placeholders);const r=null!=o&&null!==(n=o.path)&&void 0!==n&&n[0]?`sections.${o.path[0]}.`:"",s=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.${r}data_description.${i.name}`,t.description_placeholders);return s?(0,a.qy)(d||(d=m`<ha-markdown breaks .content="${0}"></ha-markdown>`),s):""},renderShowFormStepFieldError(e,t,i){return e.localize(`component.${t.translation_domain||t.translation_domain||t.handler}.config.error.${i}`,t.description_placeholders)||i},renderShowFormStepFieldLocalizeValue(e,t,i){return e.localize(`component.${t.handler}.selector.${i}`)},renderShowFormStepSubmitButton(e,t){return e.localize(`component.${t.handler}.config.step.${t.step_id}.submit`)||e.localize("ui.panel.config.integrations.config_flow."+(!1===t.last_step?"next":"submit"))},renderExternalStepHeader(e,t){return e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize("ui.panel.config.integrations.config_flow.external_step.open_site")},renderExternalStepDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.${t.step_id}.description`,t.description_placeholders);return(0,a.qy)(c||(c=m` <p> ${0} </p> ${0} `),e.localize("ui.panel.config.integrations.config_flow.external_step.description"),i?(0,a.qy)(h||(h=m` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):"")},renderCreateEntryDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.create_entry.${t.description||"default"}`,t.description_placeholders);return(0,a.qy)(p||(p=m` ${0} `),i?(0,a.qy)(u||(u=m` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):a.s6)},renderShowFormProgressHeader(e,t){return e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize(`component.${t.handler}.title`)},renderShowFormProgressDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.progress.${t.progress_action}`,t.description_placeholders);return i?(0,a.qy)(g||(g=m` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):""},renderMenuHeader(e,t){return e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize(`component.${t.handler}.title`)},renderMenuDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.description`,t.description_placeholders);return i?(0,a.qy)(f||(f=m` <ha-markdown allow-svg breaks .content="${0}"></ha-markdown> `),i):""},renderMenuOption(e,t,i){return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.menu_options.${i}`,t.description_placeholders)},renderMenuOptionDescription(e,t,i){return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.menu_option_descriptions.${i}`,t.description_placeholders)},renderLoadingDescription(e,t,i,a){if("loading_flow"!==t&&"loading_step"!==t)return"";const o=(null==a?void 0:a.handler)||i;return e.localize(`ui.panel.config.integrations.config_flow.loading.${t}`,{integration:o?(0,n.p$)(e.localize,o):e.localize("ui.panel.config.integrations.config_flow.loading.fallback_title")})}})},29094:function(e,t,i){i.d(t,{g:function(){return n}});i(3362),i(62953);var a=i(1087);const o=()=>Promise.all([i.e(72850),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(80131),i.e(98470),i.e(54066),i.e(84038),i.e(62364),i.e(62574),i.e(26092),i.e(39005),i.e(28501),i.e(29792)]).then(i.bind(i,78314)),n=(e,t,i)=>{(0,a.r)(e,"show-dialog",{dialogTag:"dialog-data-entry-flow",dialogImport:o,dialogParams:Object.assign(Object.assign({},t),{},{flowConfig:i,dialogParentElement:e})})}},79029:function(e,t,i){i.a(e,async function(e,a){try{i.r(t),i.d(t,{DialogHelperDetail:function(){return G}});i(74423),i(44114),i(26910),i(18111),i(61701),i(13579),i(3362),i(62953);var o=i(40445),n=i(5124),r=i(67576),s=i(22786),l=i(36312),d=i(69558),c=i(1087),h=i(57237),p=i(52220),u=i(18350),g=i(72554),f=(i(93444),i(8630),i(28732),i(65829)),m=(i(67094),i(34127)),v=i(36866),w=i(26571),y=i(21016),b=i(2279),_=i(42575),x=i(77738),$=i(6922),k=i(33687),C=i(12284),S=i(95350),z=i(2247),F=i(49141),E=i(77763),L=i(65063),P=i(14503),A=i(44144),D=i(24367),M=e([u,g,f,m,v]);[u,g,f,m,v]=M.then?(await M)():M;let O,W,T,q,j,H,B,R,Z,I,U,V=e=>e;const J="M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",N={input_boolean:{create:b.nr,import:()=>i.e(59263).then(i.bind(i,89269)),alias:["switch","toggle"]},input_button:{create:_.L6,import:()=>i.e(116).then(i.bind(i,37018))},input_text:{create:C.m4,import:()=>Promise.all([i.e(81034),i.e(49469)]).then(i.bind(i,8431))},input_number:{create:$.gO,import:()=>Promise.all([i.e(34995),i.e(81034),i.e(35873),i.e(17349)]).then(i.bind(i,76901))},input_datetime:{create:x.ke,import:()=>Promise.all([i.e(81034),i.e(45771)]).then(i.bind(i,837))},input_select:{create:k.BT,import:()=>i.e(79151).then(i.bind(i,22514)),alias:["select","dropdown"]},counter:{create:y.Pu,import:()=>i.e(58224).then(i.bind(i,46963))},timer:{create:F.CR,import:()=>Promise.all([i.e(34995),i.e(16508),i.e(73476)]).then(i.bind(i,14872)),alias:["countdown"]},schedule:{create:z.sF,import:()=>Promise.all([i.e(79996),i.e(10147),i.e(17362),i.e(47852)]).then(i.bind(i,84226))}};class G extends n.WF{async showDialog(e){this._params=e,this._domain=e.domain,this._item=void 0,this._domain&&this._domain in N&&await N[this._domain].import(),this._open=!0,await this.updateComplete,this.hass.loadFragmentTranslation("config");const t=await(0,w.yu)(this.hass,["helper"]);await this.hass.loadBackendTranslation("title",t,!0),this._helperFlows=t,await this.updateComplete,await this._focusSearchInput()}closeDialog(){this._open=!1}_dialogClosed(){if(this._open=!1,this._error=void 0,this._domain=void 0,this._params=void 0,this._filter=void 0,(0,c.r)(this,"dialog-closed",{dialog:this.localName}),this._pendingConfigFlow){const e=this._pendingConfigFlow;this._pendingConfigFlow=void 0,(0,E.W)(this,{startFlowHandler:e.startFlowHandler,manifest:e.manifest,dialogClosedCallback:e.dialogClosedCallback})}}render(){if(!this._params)return n.s6;let e,t=n.s6;var i;if(this._domain)e=(0,n.qy)(O||(O=V` <div class="form" @value-changed="${0}"> ${0} ${0} </div> `),this._valueChanged,this._error?(0,n.qy)(W||(W=V`<div class="error">${0}</div>`),this._error):"",(0,d._)(`ha-${this._domain}-form`,{hass:this.hass,item:this._item,new:!0,autofocus:!0})),t=(0,n.qy)(T||(T=V` <ha-dialog-footer slot="footer"> ${0} <ha-button slot="primaryAction" @click="${0}" .disabled="${0}"> ${0} </ha-button> </ha-dialog-footer> `),null!==(i=this._params)&&void 0!==i&&i.domain?n.s6:(0,n.qy)(q||(q=V`<ha-button slot="secondaryAction" appearance="plain" @click="${0}" .disabled="${0}"> ${0} </ha-button>`),this._goBack,this._submitting,this.hass.localize("ui.common.back")),this._createItem,this._submitting,this.hass.localize("ui.panel.config.helpers.dialog.create"));else if(this._loading||void 0===this._helperFlows)e=(0,n.qy)(j||(j=V`<ha-spinner></ha-spinner>`));else{const t=this._filterHelpers(N,this._helperFlows,this._filter);e=(0,n.qy)(H||(H=V` <ha-input-search appearance="outlined" autofocus .value="${0}" @input="${0}" .placeholder="${0}"></ha-input-search> <ha-list class="ha-scrollbar" innerRole="listbox" itemRoles="option" innerAriaLabel="${0}" rootTabbable> ${0} </ha-list> `),this._filter,this._filterChanged,this.hass.localize("ui.panel.config.integrations.search_helper"),this.hass.localize("ui.panel.config.helpers.dialog.create_helper"),t.map(([e,t])=>{var i;const a=!(e in N)||(0,l.x)(this.hass.config,e);return(0,n.qy)(B||(B=V` <ha-list-item hasmeta .domain="${0}" @request-selected="${0}" graphic="icon"> <img slot="graphic" loading="lazy" alt="" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer"> <span class="item-text"> ${0} </span> ${0} </ha-list-item> `),e,this._domainPicked,(0,A.MR)({domain:e,type:"icon",darkOptimized:null===(i=this.hass.themes)||void 0===i?void 0:i.darkMode},this.hass.auth.data.hassUrl),t,a?(0,n.qy)(R||(R=V`<ha-icon-next slot="meta"></ha-icon-next>`)):(0,n.qy)(Z||(Z=V`<ha-svg-icon slot="meta" .id="icon-${0}" path="${0}" @click="${0}"></ha-svg-icon> <ha-tooltip .for="icon-${0}"> ${0} </ha-tooltip>`),e,J,h.d,e,this.hass.localize("ui.dialogs.helper_settings.platform_not_loaded",{platform:e})))}))}return(0,n.qy)(I||(I=V` <ha-dialog .open="${0}" header-title="${0}" @closed="${0}"> ${0} ${0} </ha-dialog> `),this._open,this._domain?this.hass.localize("ui.panel.config.helpers.dialog.create_platform",{platform:(0,D.z)(this._domain)&&this.hass.localize(`ui.panel.config.helpers.types.${this._domain}`)||this._domain}):this.hass.localize("ui.panel.config.helpers.dialog.create_helper"),this._dialogClosed,e,t)}async _filterChanged(e){const t=e.target;this._filter=t.value}_valueChanged(e){this._item=e.detail.value}async _createItem(){if(this._domain&&this._item){this._submitting=!0,this._error="";try{var e;const t=await N[this._domain].create(this.hass,this._item);null!==(e=this._params)&&void 0!==e&&e.dialogClosedCallback&&t.id&&this._params.dialogClosedCallback({flowFinished:!0,entityId:`${this._domain}.${t.id}`}),this.closeDialog()}catch(t){this._error=t.message||"Unknown error"}finally{this._submitting=!1}}}async _domainPicked(e){const t=e.target.closest("ha-list-item").domain;if(!(t in N)||(0,l.x)(this.hass.config,t))if(t in N){this._loading=!0;try{await N[t].import(),this._domain=t}finally{this._loading=!1}}else{var i;this._pendingConfigFlow={startFlowHandler:t,manifest:await(0,S.QC)(this.hass,t),dialogClosedCallback:null===(i=this._params)||void 0===i?void 0:i.dialogClosedCallback},this.closeDialog()}else(0,L.showAlertDialog)(this,{text:this.hass.localize("ui.dialogs.helper_settings.platform_not_loaded",{platform:t})})}async _goBack(){this._domain=void 0,this._item=void 0,this._error=void 0,await this.updateComplete,await this._focusSearchInput()}async _focusSearchInput(){const e=this._searchInput;e&&(await e.updateComplete,e.focus())}static get styles(){return[P.dp,P.nA,(0,n.AH)(U||(U=V`ha-dialog{--dialog-content-padding:0}ha-icon-next{width:var(--ha-space-6)}ha-tooltip{pointer-events:auto}.form{padding:var(--ha-space-6)}ha-input-search{margin:0 var(--ha-space-4) var(--ha-space-3)}ha-list{height:calc(60vh - 184px)}@media all and (max-width:450px),all and (max-height:500px){ha-list{height:calc(100vh - 184px - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px))}}`))]}constructor(...e){super(...e),this._open=!1,this._submitting=!1,this._loading=!1,this._filterHelpers=(0,s.A)((e,t,i)=>{const a=[];for(const o of Object.keys(e))a.push([o,this.hass.localize(`ui.panel.config.helpers.types.${o}`)||o]);if(t)for(const o of t)a.push([o,(0,S.p$)(this.hass.localize,o)]);return a.filter(([t,a])=>{if(i){var o;const n=i.toLowerCase();return a.toLowerCase().includes(n)||t.toLowerCase().includes(n)||((null===(o=e[t])||void 0===o?void 0:o.alias)||[]).some(e=>e.toLowerCase().includes(n))}return!0}).sort((e,t)=>(0,p.xL)(e[1],t[1],this.hass.locale.language))})}}(0,o.Cg)([(0,r.MZ)({attribute:!1})],G.prototype,"hass",void 0),(0,o.Cg)([(0,r.wk)()],G.prototype,"_item",void 0),(0,o.Cg)([(0,r.wk)()],G.prototype,"_open",void 0),(0,o.Cg)([(0,r.wk)()],G.prototype,"_domain",void 0),(0,o.Cg)([(0,r.wk)()],G.prototype,"_error",void 0),(0,o.Cg)([(0,r.wk)()],G.prototype,"_submitting",void 0),(0,o.Cg)([(0,r.wk)()],G.prototype,"_helperFlows",void 0),(0,o.Cg)([(0,r.wk)()],G.prototype,"_loading",void 0),(0,o.Cg)([(0,r.wk)()],G.prototype,"_filter",void 0),(0,o.Cg)([(0,r.P)("ha-input-search")],G.prototype,"_searchInput",void 0),G=(0,o.Cg)([(0,r.EM)("dialog-helper-detail")],G),a()}catch(O){a(O)}})},44144:function(e,t,i){i.d(t,{Cv:function(){return l},MR:function(){return p},QR:function(){return u},_c:function(){return h},a_:function(){return f},bg:function(){return m},yM:function(){return g}});i(18111),i(22489),i(3362),i(62953),i(3296),i(27208),i(48408),i(14603),i(47566),i(98721);var a=i(8129);let o,n;const r=66649!=i.j?18e5:null,s=66649!=i.j?[0,500,1e3,2e3,5e3,1e4,15e3]:null,l=async e=>{const t=o;for(const n of s){n&&await(0,a.l)(n);try{return await d(e),c(e),o!==t}catch(i){}}return!1},d=async e=>{const t=await e.callWS({type:"brands/access_token"});o=t.token},c=e=>{h(),n=setInterval(()=>{d(e).catch(()=>{})},r)},h=()=>{n&&(clearInterval(n),n=void 0)},p=(e,t)=>{if(!o)return"";t=null!=t?t:location.origin;const i=`/api/brands/integration/${e.domain}/${e.darkOptimized?"dark_":""}${e.type}.png`,a=new URL(i,t);return a.searchParams.set("token",o),a.toString()},u=(e,t)=>{if(!o)return"";t=null!=t?t:location.origin;const i=`/api/brands/hardware/${e.category}/${e.darkOptimized?"dark_":""}${e.manufacturer}${e.model?`_${e.model}`:""}.png`,a=new URL(i,t);return a.searchParams.set("token",o),a.toString()},g=(e,t)=>{let i;t=null!=t?t:location.origin;try{i=new URL(e,t)}catch(a){return e}return i.pathname.startsWith("/api/brands/")?o?(i.searchParams.set("token",o),i.toString()):"":e},f=e=>{var t;const i=new URL(e,location.origin);if(i.pathname.startsWith("/api/brands/"))return i.pathname.split("/")[4];const a=i.pathname.split("/").filter(e=>e.length>0),o=a.indexOf("_");return-1!==o&&o+1<a.length?a[o+1]:null!==(t=a[1])&&void 0!==t?t:""},m=e=>{try{return new URL(e,location.origin).pathname.startsWith("/api/brands/")||e.startsWith("https://brands.home-assistant.io/")}catch(t){return!1}}},77957:function(e,t,i){var a=i(76080),o=i(79504),n=i(47055),r=i(48981),s=i(56969),l=i(26198),d=i(2360),c=i(35370),h=Array,p=o([].push);e.exports=function(e,t,i,o){for(var u,g,f,m=r(e),v=n(m),w=a(t,i),y=d(null),b=l(v),_=0;b>_;_++)f=v[_],(g=s(w(f,_,m)))in y?p(y[g],f):y[g]=[f];if(o&&(u=o(m))!==h)for(g in y)y[g]=c(u,y[g]);return y}},46058:function(e,t,i){var a=i(46518),o=i(77957),n=i(6469);a({target:"Array",proto:!0},{group:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),n("group")},93900:function(e,t,i){i.a(e,async function(e,t){try{i(3362),i(27495),i(62953);var a=i(5124),o=i(67576),n=i(6412),r=i(63672),s=i(17051),l=i(42462),d=i(28438),c=i(98779),h=i(27259),p=i(25877),u=i(31247),g=i(4444),f=i(92070),m=i(9395),v=i(717),w=i(17060),y=i(88496),b=i(91470),_=e([y,w]);[y,w]=_.then?(await _)():_;let C,S,z,F=e=>e;var x=Object.defineProperty,$=Object.getOwnPropertyDescriptor,k=(e,t,i,a)=>{for(var o,n=a>1?void 0:a?$(t,i):t,r=e.length-1;r>=0;r--)(o=e[r])&&(n=(a?o(t,i,n):o(n))||n);return a&&n&&x(t,i,n),n};let E=class extends v.A{firstUpdated(){this.open&&(this.addOpenListeners(),this.dialog.showModal(),(0,g.JG)(this))}disconnectedCallback(){super.disconnectedCallback(),(0,g.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,h.Ud)(this.dialog,"pulse");this.removeOpenListeners(),await(0,h.Ud)(this.dialog,"hide"),this.open=!1,this.dialog.close(),(0,g.I7)(this);const i=this.originalTrigger;"function"==typeof(null==i?void 0:i.focus)&&setTimeout(()=>i.focus()),this.dispatchEvent(new s.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,h.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 c.k;this.dispatchEvent(e),e.defaultPrevented?this.open=!1:(this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.dialog.showModal(),(0,g.JG)(this),requestAnimationFrame(()=>{const e=this.querySelector("[autofocus]");e&&"function"==typeof e.focus?e.focus():this.dialog.focus()}),await(0,h.Ud)(this.dialog,"show"),this.dispatchEvent(new l.q))}render(){var e;const t=!this.withoutHeader,i=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return(0,a.qy)(C||(C=F` <dialog aria-labelledby="${0}" aria-describedby="${0}" part="dialog" class="${0}" @cancel="${0}" @click="${0}" @pointerdown="${0}"> ${0} <div part="body" class="body"><slot></slot></div> ${0} </dialog> `),null!==(e=this.ariaLabelledby)&&void 0!==e?e:"title",(0,r.J)(this.ariaDescribedby),(0,n.H)({dialog:!0,open:this.open}),this.handleDialogCancel,this.handleDialogClick,this.handleDialogPointerDown,t?(0,a.qy)(S||(S=F` <header part="header" class="header"> <h2 part="title" class="title" id="title"> <slot name="label"> ${0} </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" @click="${0}"> <wa-icon name="xmark" label="${0}" library="system" variant="solid"></wa-icon> </wa-button> </div> </header> `),this.label.length>0?this.label:String.fromCharCode(8203),e=>this.requestClose(e.target),this.localize.term("close")):"",i?(0,a.qy)(z||(z=F` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `)):"")}constructor(){super(...arguments),this.localize=new w.c(this),this.hasSlotController=new f.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))}}};E.css=b.A,k([(0,o.P)(".dialog")],E.prototype,"dialog",2),k([(0,o.MZ)({type:Boolean,reflect:!0})],E.prototype,"open",2),k([(0,o.MZ)({reflect:!0})],E.prototype,"label",2),k([(0,o.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],E.prototype,"withoutHeader",2),k([(0,o.MZ)({attribute:"light-dismiss",type:Boolean})],E.prototype,"lightDismiss",2),k([(0,o.MZ)({attribute:"aria-labelledby"})],E.prototype,"ariaLabelledby",2),k([(0,o.MZ)({attribute:"aria-describedby"})],E.prototype,"ariaDescribedby",2),k([(0,o.MZ)({attribute:"with-footer",type:Boolean})],E.prototype,"withFooter",2),k([(0,m.w)("open",{waitUntilFirstUpdate:!0})],E.prototype,"handleOpenChange",1),E=k([(0,o.EM)("wa-dialog")],E),a.S$||(document.addEventListener("click",e=>{const t=e.target.closest("[data-dialog]");if(t instanceof Element){const[e,i]=(0,u.v)(t.getAttribute("data-dialog")||"");if("open"===e&&null!=i&&i.length){const e=t.getRootNode().getElementById(i);"wa-dialog"===(null==e?void 0: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(C){t(C)}})},91470:function(e,t,i){i.d(t,{A:function(){return o}});let a;var o=(0,i(5124).AH)(a||(a=(e=>e)`: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}@media 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)}@keyframes pulse{0%{scale:1}50%{scale:1.02}100%{scale:1}}@keyframes show-dialog{from{opacity:0;scale:0.8}to{opacity:1;scale:1}}@keyframes show-backdrop{from{opacity:0}to{opacity:1}}@media (forced-colors:active){.dialog{border:solid 1px #fff}}`))},54495:function(e,t,i){i.d(t,{OA:function(){return a.OA},WL:function(){return a.WL},u$:function(){return a.u$}});var a=i(42017)}}]);