iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
22 lines • 32.2 kB
JavaScript
export const __rspack_esm_id=40901;export const __rspack_esm_ids=[40901];export const __webpack_modules__={93421(e,t,a){a.d(t,{IW:()=>h,dH:()=>d,fI:()=>n});a(44114);var i=a(35211),o=a(22792),r=a(32172);const s=(e,t)=>{let a=e;for(const e of t){if(null==a)return;a=a[e]}return a},l=(e,t,a)=>{const o=(0,r.p)({transformer:function(e){return a.call(this,e)},watch:t?[t]:[]}),s=(0,i.Fg)({context:e,subscribe:!0});return(e,t)=>{o(e,t),s(e,t)}},n=e=>l(o.iN,e.entityIdPath[0],function(t){const a=s(this,e.entityIdPath);return"string"==typeof a?t?.[a]:void 0}),d=e=>l(o.X1,e.entityIdPath[0],function(t){const a=s(this,e.entityIdPath);return"string"==typeof a?t?.[a]:void 0}),h=()=>l(o.D5,void 0,({localize:e})=>e)},31290(e,t,a){a.d(t,{n:()=>i});const i=e=>e.replace(/^_*(.)|_+(.)/g,(e,t,a)=>t?t.toUpperCase():" "+a.toUpperCase())},38962(e,t,a){a.a(e,async function(e,i){try{a.r(t);var o=a(62826),r=a(5124),s=a(22441),l=a(6412),n=a(93421),d=a(1087),h=a(26300),c=(a(67094),e([h]));h=(c.then?(await c)():c)[0];const p="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",g={info:"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",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class v extends r.WF{render(){return r.qy` <div class="issue-type ${(0,l.H)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${g[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,l.H)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?r.qy`<div class="title">${this.title}</div>`:r.s6} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?r.qy`<ha-icon-button ="${this._dismissClicked}" .label="${this._localize?.("ui.common.dismiss_alert")}" .path="${p}"></ha-icon-button>`:r.s6} </slot> </div> </div> </div> `}_dismissClicked(){(0,d.r)(this,"alert-dismissed-clicked")}constructor(...e){super(...e),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}v.styles=r.AH`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`,(0,o.Cg)([(0,s.MZ)()],v.prototype,"title",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"alert-type"})],v.prototype,"alertType",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],v.prototype,"dismissable",void 0),(0,o.Cg)([(0,s.wk)(),(0,n.IW)()],v.prototype,"_localize",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],v.prototype,"narrow",void 0),v=(0,o.Cg)([(0,s.EM)("ha-alert")],v),i()}catch(e){i(e)}})},75064(e,t,a){var i=a(62826),o=a(5124),r=a(22441),s=a(2846);class l extends s.G{constructor(...e){super(...e),this.borderTop=!1}}l.styles=[...s.J,o.AH`:host{--md-list-item-one-line-container-height:48px;--md-list-item-two-line-container-height:64px}:host([border-top]) md-item{border-top:1px solid var(--divider-color)}[slot=start]{--state-icon-color:var(--secondary-text-color)}[slot=overline]{line-height:1.15rem;font-size:calc(var(--mdc-typography-subtitle1-font-size, 1rem) * .75);font-weight:var(--mdc-typography-subtitle1-font-weight,400);font-family:var(
--mdc-typography-subtitle1-font-family,
var(--mdc-typography-font-family)
);color:var(--mdc-select-label-ink-color,rgba(0,0,0,.6))}[slot=headline]{line-height:var(--ha-line-height-normal);font-size:var(--ha-font-size-m);white-space:nowrap}[slot=supporting-text]{line-height:var(--ha-line-height-normal);font-size:var(--ha-font-size-s);white-space:nowrap}::slotted(img),::slotted(state-badge){width:32px;height:32px}::slotted(.code){font-family:var(--ha-font-family-code);font-size:var(--ha-font-size-xs)}::slotted(.domain){font-size:var(--ha-font-size-s);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal);align-self:flex-end;max-width:30%;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}`],(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"border-top"})],l.prototype,"borderTop",void 0),l=(0,i.Cg)([(0,r.EM)("ha-combo-box-item")],l)},93444(e,t,a){var i=a(62826),o=a(5124),r=a(22441);class s 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%}`]}}s=(0,i.Cg)([(0,r.EM)("ha-dialog-footer")],s)},76538(e,t,a){var i=a(62826),o=a(5124),r=a(22441);class s 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,i.Cg)([(0,r.MZ)({type:String,attribute:"subtitle-position"})],s.prototype,"subtitlePosition",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],s.prototype,"showBorder",void 0),s=(0,i.Cg)([(0,r.EM)("ha-dialog-header")],s)},72554(e,t,a){a.a(e,async function(e,t){try{var i=a(62826),o=a(93900),r=a(35211),s=a(5124),l=a(22441),n=a(63672),d=a(1087),h=a(64481),c=a(22792),p=a(59992),g=a(14503),v=a(22348),u=(a(76538),a(26300)),m=e([o,u]);[o,u]=m.then?(await m)():m;const f="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 y extends((0,p.V)(s.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 s.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?s.s6:s.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="${f}"></ha-icon-button> </slot> ${void 0!==this.headerTitle?s.qy`<span slot="title" class="title" id="ha-dialog-title"> ${this.headerTitle} </span>`:s.qy`<slot name="headerTitle" slot="title"></slot>`} ${void 0!==this.headerSubtitle?s.qy`<span slot="subtitle">${this.headerSubtitle}</span>`:s.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,s.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,v.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,i.Cg)([(0,l.MZ)({attribute:"aria-labelledby"})],y.prototype,"ariaLabelledBy",void 0),(0,i.Cg)([(0,l.MZ)({attribute:"aria-describedby"})],y.prototype,"ariaDescribedBy",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,reflect:!0})],y.prototype,"open",void 0),(0,i.Cg)([(0,l.MZ)({reflect:!0})],y.prototype,"type",void 0),(0,i.Cg)([(0,l.MZ)({type:String,reflect:!0,attribute:"width"})],y.prototype,"width",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],y.prototype,"preventScrimClose",void 0),(0,i.Cg)([(0,l.MZ)({attribute:"header-title"})],y.prototype,"headerTitle",void 0),(0,i.Cg)([(0,l.MZ)({attribute:"header-subtitle"})],y.prototype,"headerSubtitle",void 0),(0,i.Cg)([(0,l.MZ)({type:String,attribute:"header-subtitle-position"})],y.prototype,"headerSubtitlePosition",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],y.prototype,"flexContent",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean,attribute:"without-header"})],y.prototype,"withoutHeader",void 0),(0,i.Cg)([(0,l.wk)()],y.prototype,"_open",void 0),(0,i.Cg)([(0,l.P)(".body")],y.prototype,"bodyContainer",void 0),(0,i.Cg)([(0,l.wk)(),(0,r.Fg)({context:c.D5,subscribe:!0})],y.prototype,"_i18n",void 0),(0,i.Cg)([(0,l.wk)(),(0,r.Fg)({context:c.WF,subscribe:!0})],y.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,l.wk)()],y.prototype,"_bodyScrolled",void 0),(0,i.Cg)([(0,l.Ls)({passive:!0})],y.prototype,"_handleBodyScroll",null),y=(0,i.Cg)([(0,l.EM)("ha-dialog")],y),t()}catch(e){t(e)}})},3449(e,t,a){var i=a(62826),o=a(5124),r=a(22441);class s extends o.WF{render(){return o.qy`<slot></slot>`}constructor(...e){super(...e),this.disabled=!1}}s.styles=o.AH`:host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:var(--ha-font-size-s);padding-left:16px;padding-right:16px;padding-inline-start:16px;padding-inline-end:16px;letter-spacing:var(
--mdc-typography-caption-letter-spacing,
.0333333333em
);line-height:normal}:host([disabled]){color:var(--mdc-text-field-disabled-ink-color,rgba(0,0,0,.6))}`,(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],s.prototype,"disabled",void 0),s=(0,i.Cg)([(0,r.EM)("ha-input-helper-text")],s)},2846(e,t,a){a.d(t,{G:()=>d,J:()=>n});var i=a(62826),o=a(58168),r=a(82553),s=a(5124),l=a(22441);a(54276);const n=[r.R,s.AH`:host{--ha-icon-display:block;--md-sys-color-primary:var(--primary-text-color);--md-sys-color-secondary:var(--secondary-text-color);--md-sys-color-surface:var(--card-background-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--secondary-text-color)}md-item{overflow:var(--md-item-overflow,hidden);align-items:var(--md-item-align-items,center);gap:var(--ha-md-list-item-gap,16px)}`];class d extends o.n{renderRipple(){return"text"===this.type?s.s6:s.qy`<ha-ripple part="ripple" for="item" ?disabled="${this.disabled&&"link"!==this.type}"></ha-ripple>`}}d.styles=n,d=(0,i.Cg)([(0,l.EM)("ha-md-list-item")],d)},88285(e,t,a){a.a(e,async function(e,t){try{var i=a(62826),o=a(35211),r=a(5124),s=a(22441),l=a(63672),n=a(1087),d=a(22792),h=a(17894),c=(a(75064),a(47680),a(26300)),p=e([c]);c=(p.then?(await p)():p)[0];const g="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",v="M7,10L12,15L17,10H7Z";class u extends((0,h.c)(r.WF)){async focus(){await this.updateComplete,await(this.item?.focus())}render(){const e=!!this.value,t=!(!this.value||this.required||this.disabled||this.hideClearIcon),a=this.placeholder??this.label,i=this.label&&e?r.qy`<span slot="overline">${this.label}${this.required?" *":""}</span>`:r.s6,o=e?this.valueRenderer?this.valueRenderer(this.value??""):r.qy`<span slot="headline">${this.value}</span>`:a?r.qy`<span slot="headline" class="placeholder"> ${a}${this.required?" *":""} </span>`:r.s6;return r.qy` <ha-combo-box-item aria-label="${(0,l.J)(this.label||this.placeholder)}" .disabled="${this.disabled}" type="button" compact="compact"> ${this.image?r.qy`<img alt="${this.label??""}" slot="start" .src="${this.image}" crossorigin="anonymous" referrerpolicy="no-referrer">`:this.icon?r.qy`<ha-icon slot="start" .icon="${this.icon}"></ha-icon>`:r.qy`<slot name="start"></slot>`} ${i}${o} ${this.unknown?r.qy`<div slot="supporting-text" class="unknown"> ${this.unknownItemText||this._i18n?.localize("ui.components.combo-box.unknown_item")} </div>`:r.s6} ${t?r.qy` <ha-icon-button class="clear" slot="end" ="${this._clear}" .path="${g}"></ha-icon-button> `:r.s6} <ha-svg-icon class="arrow" slot="end" .path="${v}"></ha-svg-icon> </ha-combo-box-item> `}_clear(e){e.stopPropagation(),(0,n.r)(this,"clear")}static get styles(){return[r.AH`ha-combo-box-item[disabled]{background-color:var(--ha-color-form-background-disabled);--md-list-item-disabled-opacity:0.5;opacity:.5;cursor:not-allowed}ha-combo-box-item{position:relative;background-color:var(--ha-color-form-background);border-radius:var(--ha-border-radius-sm);border-end-end-radius:0;border-end-start-radius:0;--md-list-item-one-line-container-height:56px;--md-list-item-two-line-container-height:56px;--md-list-item-top-space:0px;--md-list-item-bottom-space:0px;--md-list-item-leading-space:var(--ha-space-4);--md-list-item-trailing-space:var(--ha-space-2);--ha-md-list-item-gap:var(--ha-space-2);--md-focus-ring-width:0px;--md-focus-ring-duration:0s}ha-combo-box-item:after{display:block;content:"";position:absolute;pointer-events:none;bottom:0;left:0;right:0;height:1px;width:100%;background-color:var(--ha-color-border-neutral-loud);transform:height 180ms ease-in-out,background-color 180ms ease-in-out}ha-combo-box-item:focus:after{height:2px;background-color:var(--mdc-theme-primary)}:host([unknown]) ha-combo-box-item{background-color:var(--ha-color-fill-warning-quiet-resting)}:host([invalid]) ha-combo-box-item:after{height:2px;background-color:var(--mdc-theme-error,var(--error-color,#b00020))}.clear{margin:0 -8px;--ha-icon-button-size:32px;--ha-icon-button-padding-inline:var(--ha-space-1)}.arrow{--mdc-icon-size:20px;width:32px}.placeholder{color:var(--secondary-text-color)}:host([invalid]) .placeholder{color:var(--mdc-theme-error,var(--error-color,#b00020))}.unknown{color:var(--ha-color-on-warning-normal)}`]}constructor(...e){super(...e),this.invalid=!1}}(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],u.prototype,"invalid",void 0),(0,i.Cg)([(0,s.P)("ha-combo-box-item",!0)],u.prototype,"item",void 0),(0,i.Cg)([(0,s.wk)(),(0,o.Fg)({context:d.D5,subscribe:!0})],u.prototype,"_i18n",void 0),u=(0,i.Cg)([(0,s.EM)("ha-picker-field")],u),t()}catch(e){t(e)}})},5850(e,t,a){var i=a(62826),o=a(5124),r=a(2844),s=a(34875),l=a(7731),n=a(22441),d=a(1087);class h extends r.a{async onChange(e){super.onChange(e),(0,d.r)(this,e.type)}}h.styles=[l.R,s.R,o.AH`: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)}.mdc-deprecated-list-item__meta{flex-shrink:0;direction:var(--direction);margin-inline-start:auto;margin-inline-end:0}.mdc-deprecated-list-item__graphic{margin-top:var(--radio-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)}`],h=(0,i.Cg)([(0,n.EM)("ha-radio-list-item")],h)},606(e,t,a){a.a(e,async function(e,t){try{a(74423),a(18111),a(61701);var i=a(62826),o=a(5124),r=a(22441),s=a(63672),l=a(22786),n=a(1087),d=a(29823),h=(a(70947),a(3449),a(88285)),c=(a(67094),e([d,h]));[d,h]=c.then?(await c)():c;class p extends o.WF{render(){return this.disabled?o.qy`${this._renderField()}${this._renderHelper()}`:o.qy` <ha-dropdown placement="bottom" -select="${this._handleSelect}" -show="${this._handleShow}" -hide="${this._handleHide}"> ${this._renderField()} ${this.options?this.options.map(e=>{const t=["string","number"].includes(typeof e);return o.qy` <ha-dropdown-item .value="${t?e:e.value}" .disabled="${!t&&(e.disabled??!1)}" .selected="${this.value===(t?e:e.value)}"> ${e.iconPath?o.qy`<ha-svg-icon slot="icon" .path="${e.iconPath}"></ha-svg-icon>`:o.s6} <div class="content"> ${t?e:e.label||e.value} ${e.secondary?o.qy`<div class="secondary">${e.secondary}</div>`:o.s6} </div> </ha-dropdown-item> `}):o.qy`<slot></slot>`} </ha-dropdown> ${this._renderHelper()} `}_renderField(){const e=this._getValueLabel(this.options,this.value);return o.qy` <ha-picker-field slot="trigger" type="button" class="${this._opened?"opened":""}" compact="compact" aria-label="${(0,s.J)(this.label)}" ="${this._clearValue}" .label="${this.label}" .value="${e}" .required="${this.required}" .disabled="${this.disabled}" .hideClearIcon="${!this.clearable||this.required||this.disabled||!String(this.value)}"> </ha-picker-field> `}_renderHelper(){return this.helper?o.qy`<ha-input-helper-text .disabled="${this.disabled}">${this.helper}</ha-input-helper-text>`:o.s6}_handleSelect(e){e.stopPropagation();const t=e.detail.item.value;t!==this.value&&(0,n.r)(this,"selected",{value:t})}_clearValue(){!this.disabled&&this.value&&(0,n.r)(this,"selected",{value:void 0})}_handleShow(){this.style.setProperty("--select-menu-width",`${this._triggerField.offsetWidth}px`),this._opened=!0}_handleHide(){this._opened=!1}constructor(...e){super(...e),this.clearable=!1,this.required=!1,this.disabled=!1,this._opened=!1,this._getValueLabel=(0,l.A)((e,t)=>{const a=void 0!==t?String(t):void 0;if(!e||!a)return a;for(const t of e){const e=["string","number"].includes(typeof t);if(e&&t===a||!e&&String(t.value)===a)return e?t:t.label||t.value}return a})}}p.styles=o.AH`:host{position:relative}ha-picker-field.opened{--mdc-text-field-idle-line-color:var(--primary-color)}ha-dropdown-item .content{display:flex;gap:var(--ha-space-1);flex-direction:column}ha-dropdown-item .secondary{font-size:var(--ha-font-size-s);color:var(--ha-color-text-secondary)}ha-dropdown::part(menu){min-width:var(--select-menu-width)}ha-input-helper-text{display:block;margin:var(--ha-space-2) 0 0}`,(0,i.Cg)([(0,r.MZ)({type:Boolean})],p.prototype,"clearable",void 0),(0,i.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"options",void 0),(0,i.Cg)([(0,r.MZ)()],p.prototype,"label",void 0),(0,i.Cg)([(0,r.MZ)()],p.prototype,"helper",void 0),(0,i.Cg)([(0,r.MZ)()],p.prototype,"value",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],p.prototype,"required",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],p.prototype,"disabled",void 0),(0,i.Cg)([(0,r.wk)()],p.prototype,"_opened",void 0),(0,i.Cg)([(0,r.P)("ha-picker-field")],p.prototype,"_triggerField",void 0),p=(0,i.Cg)([(0,r.EM)("ha-select")],p),t()}catch(e){t(e)}})},91984(e,t,a){a.d(t,{R6:()=>o,TQ:()=>r,cg:()=>s});var i=a(31290);function o(e){return"strategy"in e}const r=(e,t)=>e.title??(e.path?(0,i.n)(e.path):String(t)),s=e=>e.icon??"mdi:view-compact"},17894(e,t,a){a.d(t,{c:()=>r});var i=a(62826),o=a(22441);const r=e=>{class t extends e{constructor(...e){super(...e),this.disabled=!1,this.required=!1,this.unknown=!1,this.hideClearIcon=!1}}return(0,i.Cg)([(0,o.MZ)({type:Boolean})],t.prototype,"disabled",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],t.prototype,"required",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"icon",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"image",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"label",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"placeholder",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"helper",void 0),(0,i.Cg)([(0,o.MZ)()],t.prototype,"value",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],t.prototype,"unknown",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"unknown-item-text"})],t.prototype,"unknownItemText",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"hide-clear-icon",type:Boolean})],t.prototype,"hideClearIcon",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],t.prototype,"valueRenderer",void 0),t}},54564(e,t,a){a.a(e,async function(e,i){try{a.r(t),a.d(t,{HuiDialogSelectView:()=>y});a(18111),a(61701),a(13579);var o=a(62826),r=a(5124),s=a(22441),l=a(1087),n=a(38962),d=a(18350),h=(a(47680),a(93444),a(8630),a(5850),a(606)),c=a(72554),p=a(35952),g=a(91984),v=a(71730),u=a(99774),m=a(14503),f=e([n,d,h,c]);[n,d,h,c]=f.then?(await f)():f;class y extends r.WF{showDialog(e){this._config=e.lovelaceConfig,this._urlPath=e.urlPath,this._params=e,this._open=!0,this._params.allowDashboardChange&&this._getDashboards()}closeDialog(){this._open=!1}_dialogClosed(){this._params=void 0,(0,l.r)(this,"dialog-closed",{dialog:this.localName})}render(){if(!this._params)return r.s6;const e=(0,u.EN)(this.hass);return r.qy` <ha-dialog .open="${this._open}" header-title="${this._params.header||this.hass.localize("ui.panel.lovelace.editor.select_view.header")}" ="${this._dialogClosed}"> ${this._params.allowDashboardChange?r.qy`<ha-select .label="${this.hass.localize("ui.panel.lovelace.editor.select_view.dashboard_label")}" .disabled="${!this._dashboards.length}" .value="${this._urlPath||e}" ="${this._dashboardChanged}" autofocus .options="${this._dashboards.map(e=>({value:e.url_path,label:`${e.title}${"lovelace"===e.id?` (${this.hass.localize("ui.common.default")})`:""}`,disabled:"storage"!==e.mode})).sort((e,t)=>"lovelace"===e.value?-1:"lovelace"===t.value?1:e.label.localeCompare(t.label))}"> </ha-select>`:r.s6} ${!this._config||(this._config.views||[]).length<1?r.qy`<ha-alert alert-type="error">${this.hass.localize(this._config?"ui.panel.lovelace.editor.select_view.no_views":"ui.panel.lovelace.editor.select_view.no_config")}</ha-alert>`:this._config.views.length>1?r.qy` <ha-list> ${this._config.views.map((e,t)=>{const a=(0,g.R6)(e);return r.qy` <ha-radio-list-item .graphic="${this._config?.views.some(({icon:e})=>e)?"icon":r.s6}" ="${this._viewChanged}" .value="${t.toString()}" .selected="${this._selectedViewIdx===t}" .disabled="${a&&!this._params?.includeStrategyViews}" ?autofocus="${0===t&&!this._params.allowDashboardChange}"> <span> ${e.title}${a?` (${this.hass.localize("ui.panel.lovelace.editor.select_view.strategy_type")})`:r.s6} </span> <ha-icon .icon="${e.icon}" slot="graphic"></ha-icon> </ha-radio-list-item> `})} </ha-list> `:r.s6} <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" ="${this.closeDialog}" appearance="plain"> ${this.hass.localize("ui.common.cancel")} </ha-button> <ha-button slot="primaryAction" .disabled="${!this._config||(this._config.views||[]).length<1}" ="${this._selectView}"> ${this._params.actionLabel||this.hass.localize("ui.common.move")} </ha-button> </ha-dialog-footer> </ha-dialog> `}async _getDashboards(){this._dashboards=this._params.dashboards||await(0,v.SJ)(this.hass)}async _dashboardChanged(e){let t=e.detail.value;if(t!==this._urlPath){"lovelace"===t&&(t=null),this._urlPath=t,this._selectedViewIdx=0;try{this._config=await(0,p.Dz)(this.hass.connection,t,!1)}catch(e){this._config=void 0}}}_viewChanged(e){const t=Number(e.target.value);isNaN(t)||(this._selectedViewIdx=t)}_selectView(){(0,l.r)(this,"view-selected",{view:this._selectedViewIdx}),this._params.viewSelectedCallback(this._urlPath,this._config,this._selectedViewIdx),this.closeDialog()}static get styles(){return[m.nA,r.AH`ha-select{width:100%}mwc-radio-list-item{direction:ltr}`]}constructor(...e){super(...e),this._dashboards=[],this._selectedViewIdx=0,this._open=!1}}(0,o.Cg)([(0,s.wk)()],y.prototype,"_params",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_dashboards",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_urlPath",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_config",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_selectedViewIdx",void 0),(0,o.Cg)([(0,s.wk)()],y.prototype,"_open",void 0),y=(0,o.Cg)([(0,s.EM)("hui-dialog-select-view")],y),i()}catch(e){i(e)}})}};