iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 43.8 kB
JavaScript
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["82044"],{92636:function(e,t,i){i.d(t,{z:()=>a});i(19083),i(61006);const a=e=>(t,i)=>e.includes(t,i)},59847:function(e,t,i){i.d(t,{N:()=>n});var a=i(73850);const n=e=>(0,a.M)(e.entity_id)},75278:function(e,t,i){i.d(t,{e:()=>a});const a=(e,t)=>n(e.attributes,t),n=(e,t)=>!!(e.supported_features&t)},59826:function(e,t,i){var a=i(61701),n=(i(71695),i(47021),i(31622)),s=i(57243),r=i(50778),o=i(22344);let d,l=e=>e;(0,a.Z)([(0,r.Mo)("ha-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value(){return[o.W,(0,s.iv)(d||(d=l`::slotted([slot=icon]){margin-inline-start:0px;margin-inline-end:8px;direction:var(--direction);display:block}.mdc-button{height:var(--button-height,36px)}.trailing-icon{display:flex}.slot-container{overflow:var(--button-slot-container-overflow,visible)}:host([destructive]){--mdc-theme-primary:var(--error-color)}`))]}}]}}),n.Button)},33067:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),n=(i(71695),i(47021),i(57243)),s=i(50778),r=i(94571),o=i(45729),d=i(88238),l=(i(65981),e([o]));o=(l.then?(await l)():l)[0];let c,h,u,p,m,f,v,y=e=>e;(0,a.Z)([(0,s.Mo)("ha-domain-icon")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"domain",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"deviceClass",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"icon",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"brand-fallback",type:Boolean})],key:"brandFallback",value:void 0},{kind:"method",key:"render",value:function(){if(this.icon)return(0,n.dy)(c||(c=y`<ha-icon .icon="${0}"></ha-icon>`),this.icon);if(!this.domain)return n.Ld;if(!this.hass)return this._renderFallback();const e=(0,o.KS)(this.hass,this.domain,this.deviceClass).then((e=>e?(0,n.dy)(h||(h=y`<ha-icon .icon="${0}"></ha-icon>`),e):this._renderFallback()));return(0,n.dy)(u||(u=y`${0}`),(0,r.C)(e))}},{kind:"method",key:"_renderFallback",value:function(){if(this.domain&&this.domain in o.Ls)return(0,n.dy)(p||(p=y` <ha-svg-icon .path="${0}"></ha-svg-icon> `),o.Ls[this.domain]);if(this.brandFallback){var e;const t=(0,d.X1)({domain:this.domain,type:"icon",darkOptimized:null===(e=this.hass.themes)||void 0===e?void 0:e.darkMode});return(0,n.dy)(m||(m=y` <img alt="" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer"> `),t)}return(0,n.dy)(f||(f=y`<ha-svg-icon .path="${0}"></ha-svg-icon>`),o.Rb)}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(v||(v=y`img{width:var(--mdc-icon-size,24px)}`))}}]}}),n.oi);t()}catch(c){t(c)}}))},54202:function(e,t,i){i.r(t),i.d(t,{HaIconButtonArrowPrev:()=>l});var a=i(61701),n=(i(71695),i(47021),i(57243)),s=i(50778),r=i(5111);i(23334);let o,d=e=>e;let l=(0,a.Z)([(0,s.Mo)("ha-icon-button-arrow-prev")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_icon",value(){return"rtl"===r.E.document.dir?"M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z":"M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"}},{kind:"method",key:"render",value:function(){var e;return(0,n.dy)(o||(o=d` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(e=this.hass)||void 0===e?void 0:e.localize("ui.common.back"))||"Back",this._icon)}}]}}),n.oi)},23334:function(e,t,i){i.r(t),i.d(t,{HaIconButton:()=>u});var a=i(61701),n=(i(71695),i(47021),i(74269),i(57243)),s=i(50778),r=i(20552);i(37583);let o,d,l,c,h=e=>e,u=(0,a.Z)([(0,s.Mo)("ha-icon-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:String})],key:"path",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:String})],key:"label",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:String,attribute:"aria-haspopup"})],key:"ariaHasPopup",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"hide-title",type:Boolean})],key:"hideTitle",value(){return!1}},{kind:"field",decorators:[(0,s.IO)("mwc-icon-button",!0)],key:"_button",value:void 0},{kind:"method",key:"focus",value:function(){var e;null===(e=this._button)||void 0===e||e.focus()}},{kind:"field",static:!0,key:"shadowRootOptions",value(){return{mode:"open",delegatesFocus:!0}}},{kind:"method",key:"render",value:function(){return(0,n.dy)(o||(o=h` <mwc-icon-button aria-label="${0}" title="${0}" aria-haspopup="${0}" .disabled="${0}"> ${0} </mwc-icon-button> `),(0,r.o)(this.label),(0,r.o)(this.hideTitle?void 0:this.label),(0,r.o)(this.ariaHasPopup),this.disabled,this.path?(0,n.dy)(d||(d=h`<ha-svg-icon .path="${0}"></ha-svg-icon>`),this.path):(0,n.dy)(l||(l=h`<slot></slot>`)))}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(c||(c=h`:host{display:inline-block;outline:0}:host([disabled]){pointer-events:none}mwc-icon-button{--mdc-theme-on-primary:currentColor;--mdc-theme-text-disabled-on-light:var(--disabled-text-color)}`))}}]}}),n.oi)},43344:function(e,t,i){var a=i(61701),n=i(72621),s=(i(52247),i(71695),i(47021),i(57243)),r=i(50778),o=i(36522),d=i(83716);i(23334);let l,c,h,u=e=>e;(0,a.Z)([(0,r.Mo)("ha-menu-button")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"hassio",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_hasNotifications",value(){return!1}},{kind:"field",decorators:[(0,r.SB)()],key:"_show",value(){return!1}},{kind:"field",key:"_alwaysVisible",value(){return!1}},{kind:"field",key:"_attachNotifOnConnect",value(){return!1}},{kind:"field",key:"_unsubNotifications",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}},{kind:"method",key:"render",value:function(){if(!this._show)return s.Ld;const e=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return(0,s.dy)(l||(l=u` <ha-icon-button .label="${0}" .path="${0}" ="${0}"></ha-icon-button> ${0} `),this.hass.localize("ui.sidebar.sidebar_toggle"),"M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z",this._toggleMenu,e?(0,s.dy)(c||(c=u`<div class="dot"></div>`)):"")}},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(i,"firstUpdated",this,3)([e]),this.hassio&&(this._alwaysVisible=(Number(window.parent.frontendVersion)||0)<20190710)}},{kind:"method",key:"willUpdate",value:function(e){if((0,n.Z)(i,"willUpdate",this,3)([e]),!e.has("narrow")&&!e.has("hass"))return;const t=e.has("hass")?e.get("hass"):this.hass,a=(e.has("narrow")?e.get("narrow"):this.narrow)||"always_hidden"===(null==t?void 0:t.dockedSidebar),s=this.narrow||"always_hidden"===this.hass.dockedSidebar;this.hasUpdated&&a===s||(this._show=s||this._alwaysVisible,s?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}},{kind:"method",key:"_subscribeNotifications",value:function(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,d.r)(this.hass.connection,(e=>{this._hasNotifications=e.length>0}))}},{kind:"method",key:"_toggleMenu",value:function(){(0,o.B)(this,"hass-toggle-menu")}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(h||(h=u`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:50%;border:2px solid var(--app-header-background-color)}`))}}]}}),s.oi)},74421:function(e,t,i){var a=i(61701),n=i(72621),s=(i(71695),i(47021),i(31875)),r=i(57243),o=i(50778),d=i(5111);let l,c=e=>e;(0,a.Z)([(0,o.Mo)("ha-slider")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this.dir=d.E.document.dir}},{kind:"field",static:!0,key:"styles",value(){return[...(0,n.Z)(i,"styles",this),(0,r.iv)(l||(l=c`:host{--md-sys-color-primary:var(--primary-color);--md-sys-color-on-primary:var(--text-primary-color);--md-sys-color-outline:var(--outline-color);--md-sys-color-on-surface:var(--primary-text-color);--md-slider-handle-width:14px;--md-slider-handle-height:14px;--md-slider-state-layer-size:24px;min-width:100px;min-inline-size:100px;width:200px}`))]}}]}}),s.$)},37583:function(e,t,i){i.r(t),i.d(t,{HaSvgIcon:()=>h});var a=i(61701),n=(i(71695),i(47021),i(57243)),s=i(50778);let r,o,d,l,c=e=>e,h=(0,a.Z)([(0,s.Mo)("ha-svg-icon")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)()],key:"path",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"secondaryPath",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"viewBox",value:void 0},{kind:"method",key:"render",value:function(){return(0,n.YP)(r||(r=c` <svg viewBox="${0}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${0} ${0} </g> </svg>`),this.viewBox||"0 0 24 24",this.path?(0,n.YP)(o||(o=c`<path class="primary-path" d="${0}"></path>`),this.path):n.Ld,this.secondaryPath?(0,n.YP)(d||(d=c`<path class="secondary-path" d="${0}"></path>`),this.secondaryPath):n.Ld)}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(l||(l=c`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`))}}]}}),n.oi)},83166:function(e,t,i){var a=i(61701),n=i(72621),s=(i(71695),i(47021),i(1105)),r=i(33990),o=i(57243),d=i(50778),l=i(5111);let c,h,u,p,m=e=>e;(0,a.Z)([(0,d.Mo)("ha-textfield")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"icon",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"iconTrailing",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,d.IO)("input")],key:"formElement",value:void 0},{kind:"method",key:"updated",value:function(e){(0,n.Z)(i,"updated",this,3)([e]),(e.has("invalid")||e.has("errorMessage"))&&(this.setCustomValidity(this.invalid?this.errorMessage||this.validationMessage||"Invalid":""),(this.invalid||this.validateOnInitialRender||e.has("invalid")&&void 0!==e.get("invalid"))&&this.reportValidity()),e.has("autocomplete")&&(this.autocomplete?this.formElement.setAttribute("autocomplete",this.autocomplete):this.formElement.removeAttribute("autocomplete")),e.has("autocorrect")&&(this.autocorrect?this.formElement.setAttribute("autocorrect",this.autocorrect):this.formElement.removeAttribute("autocorrect")),e.has("inputSpellcheck")&&(this.inputSpellcheck?this.formElement.setAttribute("spellcheck",this.inputSpellcheck):this.formElement.removeAttribute("spellcheck"))}},{kind:"method",key:"renderIcon",value:function(e,t=!1){const i=t?"trailing":"leading";return(0,o.dy)(c||(c=m` <span class="mdc-text-field__icon mdc-text-field__icon--${0}" tabindex="${0}"> <slot name="${0}Icon"></slot> </span> `),i,t?1:-1,i)}},{kind:"field",static:!0,key:"styles",value(){return[r.W,(0,o.iv)(h||(h=m`.mdc-text-field__input{width:var(--ha-textfield-input-width,100%)}.mdc-text-field:not(.mdc-text-field--with-leading-icon){padding:var(--text-field-padding,0px 16px)}.mdc-text-field__affix--suffix{padding-left:var(--text-field-suffix-padding-left,12px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,12px);padding-inline-end:var(--text-field-suffix-padding-right,0px);direction:ltr}.mdc-text-field--with-leading-icon{padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,16px);direction:var(--direction)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:var(--text-field-suffix-padding-left,0px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,0px)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--suffix{color:var(--secondary-text-color)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__icon{color:var(--secondary-text-color)}.mdc-text-field__icon--leading{margin-inline-start:16px;margin-inline-end:8px;direction:var(--direction)}.mdc-text-field__icon--trailing{padding:var(--textfield-icon-trailing-padding,12px)}.mdc-floating-label:not(.mdc-floating-label--float-above){text-overflow:ellipsis;width:inherit;padding-right:30px;padding-inline-end:30px;padding-inline-start:initial;box-sizing:border-box;direction:var(--direction)}input{text-align:var(--text-field-text-align,start)}input[type=color]{height:20px}::-ms-reveal{display:none}:host([no-spinner]) input::-webkit-inner-spin-button,:host([no-spinner]) input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=color]::-webkit-color-swatch-wrapper{padding:0}:host([no-spinner]) input[type=number]{-moz-appearance:textfield}.mdc-text-field__ripple{overflow:hidden}.mdc-text-field{overflow:var(--text-field-overflow)}.mdc-floating-label{inset-inline-start:16px!important;inset-inline-end:initial!important;transform-origin:var(--float-start);direction:var(--direction);text-align:var(--float-start)}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 48px - var(--text-field-suffix-padding-left,0px));inset-inline-start:calc(48px + var(--text-field-suffix-padding-left,0px))!important;inset-inline-end:initial!important;direction:var(--direction)}.mdc-text-field__input[type=number]{direction:var(--direction)}.mdc-text-field__affix--prefix{padding-right:var(--text-field-prefix-padding-right,2px);padding-inline-end:var(--text-field-prefix-padding-right,2px);padding-inline-start:initial}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--prefix{color:var(--mdc-text-field-label-ink-color)}#helper-text ha-markdown{display:inline-block}`)),"rtl"===l.E.document.dir?(0,o.iv)(u||(u=m`.mdc-floating-label,.mdc-text-field--with-leading-icon,.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label,.mdc-text-field__icon--leading,.mdc-text-field__input[type=number]{direction:rtl;--direction:rtl}`)):(0,o.iv)(p||(p=m``))]}}]}}),s.P)},85366:function(e,t,i){var a=i(61701),n=(i(71695),i(47021),i(82238)),s=i(66575),r=i(57243),o=i(50778);let d,l=e=>e;(0,a.Z)([(0,o.Mo)("ha-top-app-bar-fixed")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value(){return[s.W,(0,r.iv)(d||(d=l`.mdc-top-app-bar__row{height:var(--header-height);border-bottom:var(--app-header-border-bottom)}.mdc-top-app-bar--fixed-adjust{padding-top:var(--header-height)}.mdc-top-app-bar{--mdc-typography-headline6-font-weight:400;color:var(--app-header-text-color,var(--mdc-theme-on-primary,#fff));background-color:var(--app-header-background-color,var(--mdc-theme-primary))}.mdc-top-app-bar__title{font-size:20px;padding-inline-start:24px;padding-inline-end:initial}`))]}}]}}),n.s)},43546:function(e,t,i){i.d(t,{Cp:()=>r,TZ:()=>o,W2:()=>s,YY:()=>l,iI:()=>n,j2:()=>d,oT:()=>a});i(19083),i(9359),i(70104),i(77439),i(19423),i(40251),i(97499),i(61006);const a=e=>e.map((e=>{if("string"!==e.type)return e;switch(e.name){case"username":return Object.assign(Object.assign({},e),{},{autocomplete:"username",autofocus:!0});case"password":return Object.assign(Object.assign({},e),{},{autocomplete:"current-password"});case"code":return Object.assign(Object.assign({},e),{},{autocomplete:"one-time-code",autofocus:!0});default:return e}})),n=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),s=async(e,t,i,a)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:i,password:a}),r=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:i}),o=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:i}),d=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:t,username:i}),l=(e,t,i)=>e.callWS({type:"auth/delete_all_refresh_tokens",token_type:t,delete_current_token:i})},83716:function(e,t,i){i.d(t,{r:()=>a});i(71695),i(19423),i(47021);const a=(e,t)=>{const i=new n,a=e.subscribeMessage((e=>t(i.processMessage(e))),{type:"persistent_notification/subscribe"});return()=>{a.then((e=>null==e?void 0:e()))}};class n{constructor(){this.notifications=void 0,this.notifications={}}processMessage(e){if("removed"===e.type)for(const t of Object.keys(e.notifications))delete this.notifications[t];else this.notifications=Object.assign(Object.assign({},this.notifications),e.notifications);return Object.values(this.notifications)}}},6736:function(e,t,i){i.d(t,{f:()=>r});var a=i(61701),n=i(72621),s=(i(19083),i(71695),i(9359),i(52924),i(40251),i(61006),i(47021),i(50778));const r=e=>(0,a.Z)(null,(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",key:"hassSubscribeRequiredHostProps",value:void 0},{kind:"field",key:"__unsubs",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this._checkSubscribed()}},{kind:"method",key:"disconnectedCallback",value:function(){if((0,n.Z)(i,"disconnectedCallback",this,3)([]),this.__unsubs){for(;this.__unsubs.length;){const e=this.__unsubs.pop();e instanceof Promise?e.then((e=>e())):e()}this.__unsubs=void 0}}},{kind:"method",key:"updated",value:function(e){if((0,n.Z)(i,"updated",this,3)([e]),e.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const t of e.keys())if(this.hassSubscribeRequiredHostProps.includes(t))return void this._checkSubscribed()}},{kind:"method",key:"hassSubscribe",value:function(){return[]}},{kind:"method",key:"_checkSubscribed",value:function(){var e;void 0!==this.__unsubs||!this.isConnected||void 0===this.hass||null!==(e=this.hassSubscribeRequiredHostProps)&&void 0!==e&&e.some((e=>void 0===this[e]))||(this.__unsubs=this.hassSubscribe())}}]}}),e)},1490:function(e,t,i){var a=i(61701),n=i(72621),s=(i(71695),i(47021),i(57243)),r=i(50778);let o,d,l,c=e=>e;(0,a.Z)([(0,r.Mo)("hui-marquee")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)()],key:"text",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"active",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({reflect:!0,type:Boolean})],key:"animating",value(){return!1}},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(i,"firstUpdated",this,3)([e]),this.addEventListener("mouseover",(()=>this.classList.add("hovering")),{capture:!0}),this.addEventListener("mouseout",(()=>this.classList.remove("hovering")))}},{kind:"method",key:"updated",value:function(e){(0,n.Z)(i,"updated",this,3)([e]),e.has("text")&&this.animating&&(this.animating=!1),e.has("active")&&this.active&&this.offsetWidth<this.scrollWidth&&(this.animating=!0)}},{kind:"method",key:"render",value:function(){return this.text?(0,s.dy)(o||(o=c` <div class="marquee-inner" ="${0}"> <span>${0}</span> ${0} </div> `),this._onIteration,this.text,this.animating?(0,s.dy)(d||(d=c` <span>${0}</span> `),this.text):""):s.Ld}},{kind:"method",key:"_onIteration",value:function(){this.active||(this.animating=!1)}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(l||(l=c`:host{display:flex;position:relative;align-items:center;height:1.2em;contain:strict}.marquee-inner{position:absolute;left:0;right:0;text-overflow:ellipsis;overflow:hidden}:host(.hovering) .marquee-inner{text-overflow:initial;overflow:initial}:host([animating]) .marquee-inner{left:initial;right:initial;animation:marquee 10s linear infinite}:host([animating]) .marquee-inner span{padding-right:16px;padding-inline-end:16px;padding-inline-start:initial} marquee{0%{transform:translateX(0%)}100%{transform:translateX(-50%)}}`))}}]}}),s.oi)},9694:function(e,t,i){i.d(t,{B:()=>n,V:()=>s});i(52247);var a=i(89890);const n="Unsupported Media";class s{constructor(e,t,i,a,s){this.hass=e,this.item=t,this.resolved=i,this.onChange=s,this.player=void 0,this.buffering=!0,this._removed=!1,this._handleChange=()=>{this._removed||this.onChange()};const r=new Audio(this.resolved.url);if(""===r.canPlayType(i.mime_type))throw new Error(n);r.autoplay=!0,r.volume=a,r.addEventListener("play",this._handleChange),r.addEventListener("playing",(()=>{this.buffering=!1,this._handleChange()})),r.addEventListener("pause",this._handleChange),r.addEventListener("ended",this._handleChange),r.addEventListener("canplaythrough",this._handleChange),this.player=r}pause(){this.buffering=!1,this.player.pause()}play(){this.player.play()}setVolume(e){this.player.volume=e,this.onChange()}remove(){this._removed=!0,this.onChange=void 0,this.player&&this.player.pause()}static idleStateObj(){const e=(new Date).toISOString();return{state:"idle",entity_id:a.N8,last_changed:e,last_updated:e,attributes:{},context:{id:"",user_id:null,parent_id:null}}}toStateObj(){const e=s.idleStateObj();return e.state=this.buffering?"buffering":this.player.paused||this.player.ended?"paused":"playing",e.attributes={media_title:this.item.title,entity_picture:this.item.thumbnail,volume_level:this.player.volume,supported_features:a.yZ.PLAY|a.yZ.PAUSE|a.yZ.VOLUME_SET},this.player.duration&&(e.attributes.media_duration=this.player.duration,e.attributes.media_position=this.player.currentTime,e.attributes.media_position_updated_at=e.last_updated),e}}},12494:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(61701),n=i(72621),s=(i(52247),i(71695),i(9359),i(56475),i(70104),i(40251),i(47021),i(87515)),r=i(57243),o=i(50778),d=i(35359),l=i(94571),c=i(36522),h=i(73850),u=i(59847),p=i(47194),m=i(75278),f=i(22381),v=(i(74421),i(59826),i(34273),i(17170)),y=i(33067),g=(i(23334),i(7285),i(51223)),b=(i(37583),i(96194)),_=i(89890),k=i(76131),w=i(6736),x=(i(1490),i(9694)),$=e([s,v,y,g]);[s,v,y,g]=$.then?(await $)():$;let C,I,M,V,H,P,L,B,Z,A,S,O,E,N,j,z,q,U,R=e=>e;const F="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",T="M21,16H3V4H21M21,2H3C1.89,2 1,2.89 1,4V16A2,2 0 0,0 3,18H10V20H8V22H16V20H14V18H21A2,2 0 0,0 23,16V4C23,2.89 22.1,2 21,2Z",W="M14,19H18V5H14M6,19H10V5H6V19Z",D="M8,5.14V19.14L19,12.14L8,5.14Z",Y="M3,5V19L11,12M13,19H16V5H13M18,5V19H21V5",Q="M18,18H6V6H18V18Z",X="M14,3.23V5.29C16.89,6.15 19,8.83 19,12C19,15.17 16.89,17.84 14,18.7V20.77C18,19.86 21,16.28 21,12C21,7.72 18,4.14 14,3.23M16.5,12C16.5,10.23 15.5,8.71 14,7.97V16C15.5,15.29 16.5,13.76 16.5,12M3,9V15H7L12,20V4L7,9H3Z";(0,a.Z)([(0,o.Mo)("ha-bar-media-player")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"entityId",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,o.IO)("mwc-linear-progress")],key:"_progressBar",value:void 0},{kind:"field",decorators:[(0,o.IO)("#CurrentProgress")],key:"_currentProgress",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_marqueeActive",value(){return!1}},{kind:"field",decorators:[(0,o.SB)()],key:"_newMediaExpected",value(){return!1}},{kind:"field",decorators:[(0,o.SB)()],key:"_browserPlayer",value:void 0},{kind:"field",key:"_progressInterval",value:void 0},{kind:"field",key:"_browserPlayerVolume",value(){return.8}},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]);const e=this._stateObj;e&&!this._progressInterval&&this._showProgressBar&&"playing"===e.state&&(this._progressInterval=window.setInterval((()=>this._updateProgressBar()),1e3))}},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(i,"disconnectedCallback",this,3)([]),this._progressInterval&&(clearInterval(this._progressInterval),this._progressInterval=void 0),this._tearDownBrowserPlayer()}},{kind:"method",key:"showResolvingNewMediaPicked",value:function(){this._tearDownBrowserPlayer(),this._newMediaExpected=!0,this._debouncedResetMediaExpected()}},{kind:"field",key:"_debouncedResetMediaExpected",value(){return(0,f.D)((()=>{this._newMediaExpected=!1}),2e3)}},{kind:"method",key:"hideResolvingNewMediaPicked",value:function(){this._newMediaExpected=!1}},{kind:"method",key:"playItem",value:function(e,t){if(this.entityId!==_.N8)throw Error("Only browser supported");this._tearDownBrowserPlayer();try{this._browserPlayer=new x.V(this.hass,e,t,this._browserPlayerVolume,(()=>this.requestUpdate("_browserPlayer")))}catch(i){if(i.message!==x.B)throw i;(0,k.showAlertDialog)(this,{text:this.hass.localize("ui.components.media-browser.media_not_supported")})}this._newMediaExpected=!1}},{kind:"method",key:"render",value:function(){var e;if(this._newMediaExpected)return(0,r.dy)(C||(C=R` <div class="controls-progress buffering"> ${0} </div> `),(0,l.C)(new Promise((e=>{setTimeout(e,500)})).then((()=>(0,r.dy)(I||(I=R`<ha-spinner></ha-spinner>`))))));const t=this.entityId===_.N8,i=this._stateObj;if(!i)return this._renderChoosePlayer(i);const a=this.narrow?"playing"===i.state&&((0,m.e)(i,_.yZ.PAUSE)||(0,m.e)(i,_.yZ.STOP))||("paused"===i.state||"idle"===i.state)&&(0,m.e)(i,_.yZ.PLAY)||"on"===i.state&&((0,m.e)(i,_.yZ.PLAY)||(0,m.e)(i,_.yZ.PAUSE))?[{icon:"on"===i.state?Y:"playing"!==i.state?D:(0,m.e)(i,_.yZ.PAUSE)?W:Q,action:"playing"!==i.state?"media_play":(0,m.e)(i,_.yZ.PAUSE)?"media_pause":"media_stop"}]:void 0:(0,_.xt)(i,!0),n=(0,_.Mj)(i),s=(0,_.DQ)(i.attributes.media_duration),o=(0,_.WL)(i.attributes.media_title||i.attributes.media_content_id),c=i.attributes.entity_picture_local||i.attributes.entity_picture;return(0,r.dy)(M||(M=R` <div class="${0}" ="${0}"> ${0} <div class="media-info"> <hui-marquee .text="${0}" .active="${0}" ="${0}" ="${0}"></hui-marquee> <span class="secondary"> ${0} </span> </div> </div> <div class="controls-progress ${0}"> ${0} </div> ${0} `),(0,d.$)({info:!0,pointer:!t,app:"app"===(null===(e=this._browserPlayer)||void 0===e?void 0:e.item.media_class)}),this._openMoreInfo,c?(0,r.dy)(V||(V=R`<img alt="" src="${0}">`),this.hass.hassUrl(c)):"",o||n||("playing"!==i.state&&"on"!==i.state?this.hass.localize("ui.card.media_player.nothing_playing"):""),this._marqueeActive,this._marqueeMouseOver,this._marqueeMouseLeave,o?n:"","buffering"===i.state?"buffering":"","buffering"===i.state?(0,r.dy)(H||(H=R`<ha-spinner></ha-spinner> `)):(0,r.dy)(P||(P=R` <div class="controls"> ${0} </div> ${0} `),void 0===a?"":a.map((e=>(0,r.dy)(L||(L=R` <ha-icon-button .label="${0}" .path="${0}" action="${0}" ="${0}"> </ha-icon-button> `),this.hass.localize(`ui.card.media_player.${e.action}`),e.icon,e.action,this._handleControlClick))),i.attributes.media_duration===1/0?r.Ld:this.narrow?(0,r.dy)(B||(B=R`<mwc-linear-progress></mwc-linear-progress>`)):(0,r.dy)(Z||(Z=R` <div class="progress"> <div id="CurrentProgress"></div> <mwc-linear-progress wide></mwc-linear-progress> <div>${0}</div> </div> `),s)),this._renderChoosePlayer(i))}},{kind:"method",key:"_renderChoosePlayer",value:function(e){const t=this.entityId===_.N8;return(0,r.dy)(A||(A=R` <div class="choose-player ${0}"> ${0} <ha-button-menu> ${0} <ha-list-item .player="${0}" ?selected="${0}" ="${0}"> ${0} </ha-list-item> ${0} </ha-button-menu> </div> `),t?"browser":"",!this.narrow&&e&&(0,m.e)(e,_.yZ.VOLUME_SET)?(0,r.dy)(S||(S=R` <ha-button-menu y="0" x="76"> <ha-icon-button slot="trigger" .path="${0}"></ha-icon-button> <ha-slider labeled min="0" max="100" step="1" .value="${0}" ="${0}"> </ha-slider> </ha-button-menu> `),X,100*e.attributes.volume_level,this._handleVolumeChange):"",this.narrow?(0,r.dy)(O||(O=R` <ha-icon-button slot="trigger"> ${0} </ha-icon-button> `),this._renderIcon(t,e)):(0,r.dy)(E||(E=R` <ha-button slot="trigger" .label="${0}"> <span slot="icon"> ${0} </span> <ha-svg-icon slot="trailingIcon" .path="${0}"></ha-svg-icon> </ha-button> `),this.narrow?r.Ld:`${e?(0,p.C)(e):this.entityId}\n `,this._renderIcon(t,e),F),_.N8,t,this._selectPlayer,this.hass.localize("ui.components.media-browser.web-browser"),this._mediaPlayerEntities.map((e=>(0,r.dy)(N||(N=R` <ha-list-item ?selected="${0}" .disabled="${0}" .player="${0}" ="${0}"> ${0} </ha-list-item> `),e.entity_id===this.entityId,e.state===b.nZ,e.entity_id,this._selectPlayer,(0,p.C)(e)))))}},{kind:"method",key:"_renderIcon",value:function(e,t){return e?(0,r.dy)(j||(j=R`<ha-svg-icon .path="${0}"></ha-svg-icon>`),T):t?(0,r.dy)(z||(z=R` <ha-state-icon .hass="${0}" .stateObj="${0}"></ha-state-icon> `),this.hass,t):(0,r.dy)(q||(q=R` <ha-domain-icon .hass="${0}" .domain="${0}"></ha-domain-icon> `),this.hass,(0,h.M)(this.entityId))}},{kind:"method",key:"willUpdate",value:function(e){if((0,n.Z)(i,"willUpdate",this,3)([e]),e.has("entityId")&&this._tearDownBrowserPlayer(),!e.has("hass")||this.entityId===_.N8)return;const t=e.get("hass");t&&t.states[this.entityId]===this.hass.states[this.entityId]||(this._newMediaExpected=!1)}},{kind:"method",key:"updated",value:function(e){if((0,n.Z)(i,"updated",this,3)([e]),this.entityId===_.N8){if(!e.has("_browserPlayer"))return}else{const t=e.get("hass");if(t&&t.states[this.entityId]===this._stateObj)return}const t=this._stateObj;this._updateProgressBar(),!this._progressInterval&&this._showProgressBar&&"playing"===(null==t?void 0:t.state)?this._progressInterval=window.setInterval((()=>this._updateProgressBar()),1e3):!this._progressInterval||this._showProgressBar&&"playing"===(null==t?void 0:t.state)||(clearInterval(this._progressInterval),this._progressInterval=void 0)}},{kind:"get",key:"_stateObj",value:function(){return this.entityId===_.N8?this._browserPlayer?this._browserPlayer.toStateObj():x.V.idleStateObj():this.hass.states[this.entityId]}},{kind:"method",key:"_tearDownBrowserPlayer",value:function(){this._browserPlayer&&(this._browserPlayer.remove(),this._browserPlayer=void 0)}},{kind:"method",key:"_openMoreInfo",value:function(){this.entityId!==_.N8&&(0,c.B)(this,"hass-more-info",{entityId:this.entityId})}},{kind:"get",key:"_showProgressBar",value:function(){if(!this.hass)return!1;const e=this._stateObj;return e&&("playing"===e.state||"paused"===e.state)&&"media_duration"in e.attributes&&"media_position"in e.attributes}},{kind:"get",key:"_mediaPlayerEntities",value:function(){return Object.values(this.hass.states).filter((e=>{var t;return"media_player"===(0,u.N)(e)&&(0,m.e)(e,_.yZ.BROWSE_MEDIA)&&!(null!==(t=this.hass.entities[e.entity_id])&&void 0!==t&&t.hidden)}))}},{kind:"method",key:"_updateProgressBar",value:function(){const e=this._stateObj;if(!this._progressBar||!this._currentProgress||!e)return;if(!e.attributes.media_duration)return this._progressBar.progress=0,void(this._currentProgress.innerHTML="");const t=(0,_.rs)(e);this._progressBar.progress=t/e.attributes.media_duration,this._currentProgress&&(this._currentProgress.innerHTML=(0,_.DQ)(t))}},{kind:"method",key:"_handleControlClick",value:function(e){const t=e.currentTarget.getAttribute("action");this._browserPlayer?"media_pause"===t?this._browserPlayer.pause():"media_play"===t&&this._browserPlayer.play():(0,_.kr)(this.hass,this._stateObj,e.currentTarget.getAttribute("action"))}},{kind:"method",key:"_marqueeMouseOver",value:function(){this._marqueeActive||(this._marqueeActive=!0)}},{kind:"method",key:"_marqueeMouseLeave",value:function(){this._marqueeActive&&(this._marqueeActive=!1)}},{kind:"method",key:"_selectPlayer",value:function(e){const t=e.currentTarget.player;(0,c.B)(this,"player-picked",{entityId:t})}},{kind:"method",key:"_handleVolumeChange",value:async function(e){e.stopPropagation();const t=Number(e.target.value)/100;this._browserPlayer?(this._browserPlayerVolume=t,this._browserPlayer.setVolume(t)):await(0,_.fI)(this.hass,this.entityId,t)}},{kind:"field",static:!0,key:"styles",value(){return(0,r.iv)(U||(U=R`:host{display:flex;height:100px;box-sizing:border-box;background:var(--ha-card-background,var(--card-background-color,#fff));border-top:1px solid var(--divider-color);padding-bottom:env(safe-area-inset-bottom)}mwc-linear-progress{width:100%;padding:0 4px;--mdc-theme-primary:var(--secondary-text-color)}ha-button-menu ha-button[slot=trigger]{line-height:1;--mdc-theme-primary:var(--primary-text-color);--mdc-icon-size:16px}.info{flex:1;display:flex;align-items:center;width:100%;margin-right:16px;margin-inline-end:16px;margin-inline-start:initial;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.pointer{cursor:pointer}.progress,.secondary{color:var(--secondary-text-color)}.choose-player{flex:1;display:flex;justify-content:flex-end;align-items:center;padding:16px}.controls{height:48px;padding-bottom:4px}.controls-progress{flex:2;display:flex;align-items:center;justify-content:center;flex-direction:column;direction:ltr}.progress{display:flex;width:100%;align-items:center}mwc-linear-progress[wide]{margin:0 4px}.media-info{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:16px;padding-inline-start:16px;padding-inline-end:initial;width:100%}hui-marquee{font-size:1.2em;margin:0px 0 4px}img{height:100%}.app img{height:68px;margin:16px 0 16px 16px}:host([narrow]){height:57px}:host([narrow]) .controls-progress{flex:unset;min-width:48px}:host([narrow]) .controls-progress.buffering{flex:1}:host([narrow]) .media-info{padding-left:8px;padding-inline-start:8px;padding-inline-end:initial}:host([narrow]) .controls{display:flex;padding-bottom:0;--mdc-icon-size:30px}:host([narrow]) .choose-player{padding-left:0;padding-right:8px;padding-inline-start:0;padding-inline-end:8px;min-width:48px;flex:unset;justify-content:center}:host([narrow]) .choose-player.browser{justify-content:flex-end}:host([narrow]) mwc-linear-progress{padding:0;position:absolute;top:-4px;left:0}ha-list-item[selected]{font-weight:700}span[slot=icon]{display:flex;align-items:center}ha-svg-icon[slot=trailingIcon]{margin-inline-start:8px!important;margin-inline-end:0px!important;direction:var(--direction)}`))}}]}}),(0,w.f)(r.oi));t()}catch(C){t(C)}}))},3880:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t);var n=i(61701),s=i(72621),r=(i(71695),i(9359),i(70104),i(40251),i(19134),i(97003),i(88044),i(47021),i(31622),i(57243)),o=i(50778),d=i(68958),l=i(36522),c=i(83523),h=(i(43344),i(23334),i(54202),i(10177)),u=(i(32101),i(89890)),p=i(1079),m=i(28008),f=i(12494),v=i(70217),y=i(76131),g=i(47844),b=(i(85366),e([h,f]));[h,f]=b.then?(await b)():b;let _,k,w,x,$=e=>e;const C="M10,4V8H14V4H10M16,4V8H20V4H16M16,10V14H20V10H16M16,16V20H20V16H16M14,20V16H10V20H14M8,20V16H4V20H8M8,14V10H4V14H8M8,8V4H4V8H8M10,14H14V10H10V14M4,2H20A2,2 0 0,1 22,4V20A2,2 0 0,1 20,22H4C2.92,22 2,21.1 2,20V4A2,2 0 0,1 4,2Z",I="M11 15H17V17H11V15M9 7H7V9H9V7M11 13H17V11H11V13M11 9H17V7H11V9M9 11H7V13H9V11M21 5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V5C3 3.9 3.9 3 5 3H19C20.1 3 21 3.9 21 5M19 5H5V19H19V5M9 15H7V17H9V15Z",M="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",V="M3,5A2,2 0 0,1 5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5C3.89,21 3,20.1 3,19V5M5,5V19H19V5H5M11,7H13A2,2 0 0,1 15,9V17H13V13H11V17H9V9A2,2 0 0,1 11,7M11,9V11H13V9H11Z",H="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",P=(e,t)=>{let i=`/media-browser/${e}`;for(const a of t.slice(1))i+="/"+encodeURIComponent(`${a.media_content_type},${a.media_content_id}`);return i};(0,n.Z)([(0,o.Mo)("ha-panel-media-browser")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"route",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_currentItem",value:void 0},{kind:"field",decorators:[(0,d.t)({key:"mediaBrowserPreferredLayout",state:!0,subscribe:!1})],key:"_preferredLayout",value(){return"auto"}},{kind:"field",key:"_navigateIds",value(){return[{media_content_id:void 0,media_content_type:void 0}]}},{kind:"field",decorators:[(0,d.t)({key:"mediaBrowseEntityId",state:!0,subscribe:!1})],key:"_entityId",value(){return u.N8}},{kind:"field",decorators:[(0,o.IO)("ha-media-player-browse")],key:"_browser",value:void 0},{kind:"field",decorators:[(0,o.IO)("ha-bar-media-player")],key:"_player",value:void 0},{kind:"method",key:"render",value:function(){return(0,r.dy)(_||(_=$` <ha-top-app-bar-fixed> ${0} <div slot="title"> ${0} </div> <ha-media-manage-button slot="actionItems" .hass="${0}" .currentItem="${0}" -refresh="${0}"></ha-media-manage-button> <ha-button-menu slot="actionItems" ="${0}"> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"></ha-icon-button> <mwc-list-item graphic="icon"> ${0} <ha-svg-icon class="${0}" slot="graphic" .path="${0}"></ha-svg-icon> </mwc-list-item> <mwc-list-item graphic="icon"> ${0} <ha-svg-icon class="${0}" slot="graphic" .path="${0}"></ha-svg-icon> </mwc-list-item> <mwc-list-item graphic="icon"> ${0} <ha-svg-icon slot="graphic" class="${0}" .path="${0}"></ha-svg-icon> </mwc-list-item> </ha-button-menu> <ha-media-player-browse .hass="${0}" .entityId="${0}" .navigateIds="${0}" .preferredLayout="${0}" -picked="${0}" -browsed="${0}"></ha-media-player-browse> </ha-top-app-bar-fixed> <ha-bar-media-player .hass="${0}" .entityId="${0}" .narrow="${0}" -picked="${0}"></ha-bar-media-player> `),this._navigateIds.length>1?(0,r.dy)(k||(k=$` <ha-icon-button-arrow-prev slot="navigationIcon" .path="${0}" ="${0}"></ha-icon-button-arrow-prev> `),M,this._goBack):(0,r.dy)(w||(w=$` <ha-menu-button slot="navigationIcon" .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow),this._currentItem?this._currentItem.title:this.hass.localize("ui.components.media-browser.media-player-browser"),this.hass,this._currentItem,this._refreshMedia,this._handleMenuAction,this.hass.localize("ui.common.menu"),H,this.hass.localize("ui.components.media-browser.auto"),"auto"===this._preferredLayout?"selected_menu_item":"",V,this.hass.localize("ui.components.media-browser.grid"),"grid"===this._preferredLayout?"selected_menu_item":"",C,this.hass.localize("ui.components.media-browser.list"),"list"===this._preferredLayout?"selected_menu_item":"",I,this.hass,this._entityId,this._navigateIds,this._preferredLayout,this._mediaPicked,this._mediaBrowsed,this.hass,this._entityId,this.narrow,this._playerPicked)}},{kind:"method",key:"_handleMenuAction",value:async function(e){switch(e.detail.index){case 0:this._preferredLayout="auto";break;case 1:this._preferredLayout="grid";break;case 2:this._preferredLayout="list"}}},{kind:"method",key:"willUpdate",value:function(e){if((0,s.Z)(i,"willUpdate",this,3)([e]),!e.has("route"))return;if(""===this.route.path)return void(0,c.c)(`/media-browser/${this._entityId}`,{replace:!0});const[t,...a]=this.route.path.substring(1).split("/");if(t!==this._entityId){if(t!==u.N8&&void 0===this.hass.states[t])return(0,c.c)(`/media-browser/${u.N8}`,{replace:!0}),void(0,y.showAlertDialog)(this,{text:this.hass.localize("ui.panel.media-browser.error.player_not_exist",{name:t})});this._entityId=t}this._navigateIds=[{media_content_type:void 0,media_content_id:void 0},...a.map((e=>{const t=decodeURIComponent(e),i=t.indexOf(",");return{media_content_type:t.substring(0,i),media_content_id:t.substring(i+1)}}))],this._currentItem=void 0}},{kind:"method",key:"_goBack",value:function(){(0,c.c)(P(this._entityId,this._navigateIds.slice(0,-1)))}},{kind:"method",key:"_mediaBrowsed",value:function(e){e.detail.ids!==this._navigateIds?(0,c.c)(P(this._entityId,e.detail.ids),{replace:e.detail.replace}):this._currentItem=e.detail.current}},{kind:"method",key:"_mediaPicked",value:async function(e){const t=e.detail.item;if(this._entityId!==u.N8){this._player.showResolvingNewMediaPicked();try{await(0,u.qV)(this.hass,this._entityId,t.media_content_id,t.media_content_type)}catch(a){this._player.hideResolvingNewMediaPicked()}return}if((0,g.B)(t.media_content_id))return void(0,l.B)(this,"hass-more-info",{entityId:(0,g.zj)(t.media_content_id)});let i;this._player.showResolvingNewMediaPicked();try{i=await(0,p.uy)(this.hass,t.media_content_id)}catch(n){return(0,y.showAlertDialog)(this,{title:this.hass.localize("ui.components.media-browser.media_browsing_error"),text:n.message}),void this._player.hideResolvingNewMediaPicked()}i.mime_type.startsWith("audio/")?this._player.playItem(t,i):((0,v.I)(this,{sourceUrl:i.url,sourceType:i.mime_type,title:t.title,can_play:t.can_play}),this._player.hideResolvingNewMediaPicked())}},{kind:"method",key:"_playerPicked",value:function(e){const t=e.detail.entityId;t!==this._entityId&&(0,c.c)(P(t,this._navigateIds))}},{kind:"method",key:"_refreshMedia",value:function(){this._browser.refresh()}},{kind:"get",static:!0,key:"styles",value:function(){return[m.Qx,(0,r.iv)(x||(x=$`ha-media-manage-button{--mdc-theme-primary:var(--app-header-text-color)}ha-media-player-browse{height:calc(100vh - (100px + var(--header-height)))}:host([narrow]) ha-media-player-browse{height:calc(100vh - (57px + var(--header-height)))}.selected_menu_item{color:var(--primary-color)}ha-bar-media-player{position:fixed;width:var(--mdc-top-app-bar-width,100%)}`))]}}]}}),r.oi);a()}catch(_){a(_)}}))},70217:function(e,t,i){i.d(t,{I:()=>n});i(71695),i(40251),i(47021);var a=i(36522);const n=(e,t)=>{(0,a.B)(e,"show-dialog",{dialogTag:"hui-dialog-web-browser-play-media",dialogImport:()=>Promise.all([i.e("97983"),i.e("55964")]).then(i.bind(i,5486)),dialogParams:t})}}}]);
//# sourceMappingURL=82044.59ed7bb25f17328f.js.map