UNPKG

iobroker.lovelace

Version:

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

12 lines 38.4 kB
export const __webpack_ids__=["99230"];export const __webpack_modules__={95262:function(e,t,i){function a(e){return null==e||Array.isArray(e)?e:[e]}i.d(t,{r:()=>a})},91610:function(e,t,i){i.d(t,{jn:()=>o});i(9359),i(52924);var a=i(95262),n=i(72344);const o=(e,t)=>(l(t)||r(e,t))&&!d(e,t)&&s(e,t),r=(e,t)=>!t.component||(0,a.r)(t.component).some((t=>(0,n.p)(e,t))),s=(e,t)=>!t.not_component||!(0,a.r)(t.not_component).some((t=>(0,n.p)(e,t))),l=e=>e.core,d=(e,t)=>(e=>e.advancedOnly)(t)&&!(e=>e.userData?.showAdvanced)(e)},83998:function(e,t,i){i.d(t,{v:()=>a});i(9359),i(56475);const a=(e,t)=>e&&Object.keys(e.services).filter((i=>t in e.services[i]))},17803:function(e,t,i){i.d(t,{I:()=>a,_:()=>n});const a=(e,t,i,a)=>{const[n,o,r]=e.split(".",3);return Number(n)>t||Number(n)===t&&(void 0===a?Number(o)>=i:Number(o)>i)||void 0!==a&&Number(n)===t&&Number(o)===i&&Number(r)>=a},n=e=>e.includes("dev")},86431:function(e,t,i){i.d(t,{jL:()=>n,wZ:()=>o});var a=i(47194);const n=e=>(e.name_by_user||e.name)?.trim(),o=(e,t,i)=>n(e)||i&&r(t,i)||t.localize("ui.panel.config.devices.unnamed_device",{type:t.localize(`ui.panel.config.devices.type.${e.entry_type||"device"}`)}),r=(e,t)=>{for(const i of t||[]){const t="string"==typeof i?i:i.entity_id,n=e.states[t];if(n)return(0,a.C)(n)}}},23334:function(e,t,i){i.r(t),i.d(t,{HaIconButton:()=>s});var a=i(44249),n=(i(74269),i(57243)),o=i(15093),r=i(20552);i(37583);let s=(0,a.Z)([(0,o.Mo)("ha-icon-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,o.Cb)({type:String})],key:"path",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:String})],key:"label",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:String,attribute:"aria-haspopup"})],key:"ariaHasPopup",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:"hide-title",type:Boolean})],key:"hideTitle",value:()=>!1},{kind:"field",decorators:[(0,o.IO)("mwc-icon-button",!0)],key:"_button",value:void 0},{kind:"method",key:"focus",value:function(){this._button?.focus()}},{kind:"field",static:!0,key:"shadowRootOptions",value:()=>({mode:"open",delegatesFocus:!0})},{kind:"method",key:"render",value:function(){return n.dy` <mwc-icon-button aria-label="${(0,r.o)(this.label)}" title="${(0,r.o)(this.hideTitle?void 0:this.label)}" aria-haspopup="${(0,r.o)(this.ariaHasPopup)}" .disabled="${this.disabled}"> ${this.path?n.dy`<ha-svg-icon .path="${this.path}"></ha-svg-icon>`:n.dy`<slot></slot>`} </mwc-icon-button> `}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`: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)},2914:function(e,t,i){var a=i(44249),n=i(57243),o=i(15093);(0,a.Z)([(0,o.Mo)("ha-label")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"dense",value:()=>!1},{kind:"method",key:"render",value:function(){return n.dy` <span class="content"> <slot name="icon"></slot> <slot></slot> </span> `}},{kind:"get",static:!0,key:"styles",value:function(){return[n.iv`:host{--ha-label-text-color:var(--primary-text-color);--ha-label-icon-color:var(--primary-text-color);--ha-label-background-color:rgba( var(--rgb-primary-text-color), 0.15 );--ha-label-background-opacity:1;border:1px solid var(--outline-color);position:relative;box-sizing:border-box;display:inline-flex;flex-direction:row;align-items:center;font-size:12px;font-weight:500;line-height:16px;letter-spacing:.1px;vertical-align:middle;height:32px;padding:0 16px;border-radius:18px;color:var(--ha-label-text-color);--mdc-icon-size:12px;text-wrap:nowrap}.content>*{position:relative;display:inline-flex;flex-direction:row;align-items:center}:host:before{position:absolute;content:"";inset:0;border-radius:inherit;background-color:var(--ha-label-background-color);opacity:var(--ha-label-background-opacity)}::slotted([slot=icon]){margin-right:8px;margin-left:-8px;margin-inline-start:-8px;margin-inline-end:8px;display:flex}span{display:inline-flex}:host([dense]){height:20px;padding:0 12px;border-radius:10px}:host([dense]) ::slotted([slot=icon]){margin-right:4px;margin-left:-4px;margin-inline-start:-4px;margin-inline-end:4px}`]}}]}}),n.oi)},7285:function(e,t,i){i.d(t,{M:()=>d});var a=i(44249),n=i(72621),o=i(65703),r=i(46289),s=i(57243),l=i(15093);let d=(0,a.Z)([(0,l.Mo)("ha-list-item")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,n.Z)(i,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[r.W,s.iv`: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?s.iv`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:s.iv``]}}]}}),o.K)},17170:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HaSpinner:()=>h});var n=i(44249),o=i(72621),r=i(97677),s=i(43580),l=i(57243),d=i(15093),c=e([r]);r=(c.then?(await c)():c)[0];let h=(0,n.Z)([(0,d.Mo)("ha-spinner")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,o.Z)(i,"updated",this,3)([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")}}},{kind:"field",static:!0,key:"styles",value:()=>[s.Z,l.iv`: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)}`]}]}}),r.Z);a()}catch(e){a(e)}}))},37583:function(e,t,i){i.r(t),i.d(t,{HaSvgIcon:()=>r});var a=i(44249),n=i(57243),o=i(15093);let r=(0,a.Z)([(0,o.Mo)("ha-svg-icon")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)()],key:"path",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"secondaryPath",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"viewBox",value:void 0},{kind:"method",key:"render",value:function(){return n.YP` <svg viewBox="${this.viewBox||"0 0 24 24"}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${this.path?n.YP`<path class="primary-path" d="${this.path}"></path>`:n.Ld} ${this.secondaryPath?n.YP`<path class="secondary-path" d="${this.secondaryPath}"></path>`:n.Ld} </g> </svg>`}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`: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(44249),n=i(72621),o=i(1105),r=i(33990),s=i(57243),l=i(15093),d=i(5111);(0,a.Z)([(0,l.Mo)("ha-textfield")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"iconTrailing",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,l.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 s.dy` <span class="mdc-text-field__icon mdc-text-field__icon--${i}" tabindex="${t?1:-1}"> <slot name="${i}Icon"></slot> </span> `}},{kind:"field",static:!0,key:"styles",value:()=>[r.W,s.iv`.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"===d.E.document.dir?s.iv`.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}`:s.iv``]}]}}),o.P)},33544:function(e,t,i){i.d(t,{yt:()=>o,fU:()=>s,kP:()=>r});i(9359),i(1331);var a=i(17803),n=i(56785);const o=async e=>(0,a.I)(e.config.version,2021,2,4)?e.callWS({type:"supervisor/api",endpoint:"/addons",method:"get"}):(0,n.rY)(await e.callApi("GET","hassio/addons")),r=async(e,t)=>(0,a.I)(e.config.version,2021,2,4)?e.callWS({type:"supervisor/api",endpoint:`/addons/${t}/start`,method:"post",timeout:null}):e.callApi("POST",`hassio/addons/${t}/start`),s=async(e,t)=>{(0,a.I)(e.config.version,2021,2,4)?await e.callWS({type:"supervisor/api",endpoint:`/addons/${t}/install`,method:"post",timeout:null}):await e.callApi("POST",`hassio/addons/${t}/install`)}},56785:function(e,t,i){i.d(t,{js:()=>o,rY:()=>n,yd:()=>l,yz:()=>s});i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814);var a=i(17803);const n=e=>e.data,o=e=>"object"==typeof e?"object"==typeof e.body?e.body.message||"Unknown error, see supervisor logs":e.body||e.message||"Unknown error, see supervisor logs":e,r=new Set([502,503,504]),s=e=>!!(e&&e.status_code&&r.has(e.status_code))||!(!e||!e.message||!e.message.includes("ERR_CONNECTION_CLOSED")&&!e.message.includes("ERR_CONNECTION_RESET")),l=async(e,t)=>(0,a.I)(e.config.version,2021,2,4)?e.callWS({type:"supervisor/api",endpoint:`/${t}/stats`,method:"get"}):n(await e.callApi("GET",`hassio/${t}/stats`))},40500:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{QuickBar:()=>B});var n=i(44249),o=(i(92745),i(9359),i(56475),i(70104),i(2060),i(57243)),r=i(15093),s=i(20552),l=i(69634),d=i(27486),c=i(91610),h=i(83998),p=i(72344),m=i(36522),u=i(86431),f=i(47194),g=i(83523),v=i(1416),y=i(24360),x=i(22381),_=(i(23334),i(2914),i(7285),i(17170)),b=(i(83166),i(33544)),k=i(57816),w=i(62162),I=i(82967),$=i(28008),C=i(47641),z=i(76131),S=i(85026),T=e([_]);_=(T.then?(await T)():T)[0];const A="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",H="M13,19V16H21V19H13M8.5,13L2.47,7H6.71L11.67,11.95C12.25,12.54 12.25,13.5 11.67,14.07L6.74,19H2.5L8.5,13Z",L="M3 6H21V4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H7V18H3V6M13 12H9V13.78C8.39 14.33 8 15.11 8 16C8 16.89 8.39 17.67 9 18.22V20H13V18.22C13.61 17.67 14 16.88 14 16S13.61 14.33 13 13.78V12M11 17.5C10.17 17.5 9.5 16.83 9.5 16S10.17 14.5 11 14.5 12.5 15.17 12.5 16 11.83 17.5 11 17.5M22 8H16C15.5 8 15 8.5 15 9V19C15 19.5 15.5 20 16 20H22C22.5 20 23 19.5 23 19V9C23 8.5 22.5 8 22 8M21 18H17V10H21V18Z",P="M17.9,17.39C17.64,16.59 16.89,16 16,16H15V13A1,1 0 0,0 14,12H8V10H10A1,1 0 0,0 11,9V7H13A2,2 0 0,0 15,5V4.59C17.93,5.77 20,8.64 20,12C20,14.08 19.2,15.97 17.9,17.39M11,19.93C7.05,19.44 4,16.08 4,12C4,11.38 4.08,10.78 4.21,10.21L9,15V16A2,2 0 0,0 11,18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",V="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z",M="M2 12C2 16.97 6.03 21 11 21C13.39 21 15.68 20.06 17.4 18.4L15.9 16.9C14.63 18.25 12.86 19 11 19C4.76 19 1.64 11.46 6.05 7.05C10.46 2.64 18 5.77 18 12H15L19 16H19.1L23 12H20C20 7.03 15.97 3 11 3C6.03 3 2 7.03 2 12Z",E="M13,19H14A1,1 0 0,1 15,20H22V22H15A1,1 0 0,1 14,23H10A1,1 0 0,1 9,22H2V20H9A1,1 0 0,1 10,19H11V17H4A1,1 0 0,1 3,16V12A1,1 0 0,1 4,11H20A1,1 0 0,1 21,12V16A1,1 0 0,1 20,17H13V19M4,3H20A1,1 0 0,1 21,4V8A1,1 0 0,1 20,9H4A1,1 0 0,1 3,8V4A1,1 0 0,1 4,3M9,7H10V5H9V7M9,15H10V13H9V15M5,5V7H7V5H5M5,13V15H7V13H5Z",N=e=>void 0!==e.categoryKey,D=e=>void 0!==e.deviceId;let B=(0,n.Z)([(0,r.Mo)("ha-quick-bar")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_commandItems",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_entityItems",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_deviceItems",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_filter",value:()=>""},{kind:"field",decorators:[(0,r.SB)()],key:"_search",value:()=>""},{kind:"field",decorators:[(0,r.SB)()],key:"_open",value:()=>!1},{kind:"field",decorators:[(0,r.SB)()],key:"_opened",value:()=>!1},{kind:"field",decorators:[(0,r.SB)()],key:"_narrow",value:()=>!1},{kind:"field",decorators:[(0,r.SB)()],key:"_hint",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_mode",value:()=>S.Ie.Entity},{kind:"field",decorators:[(0,r.IO)("ha-textfield",!1)],key:"_filterInputField",value:void 0},{kind:"field",key:"_focusSet",value:()=>!1},{kind:"field",key:"_focusListElement",value:void 0},{kind:"method",key:"showDialog",value:async function(e){this._mode=e.mode||S.Ie.Entity,this._hint=e.hint,this._narrow=matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches,this._initializeItemsIfNeeded(),this._open=!0}},{kind:"method",key:"closeDialog",value:function(){this._open=!1,this._opened=!1,this._focusSet=!1,this._filter="",this._search="",this._entityItems=void 0,this._commandItems=void 0,(0,m.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"willUpdate",value:function(){this.hasUpdated||(0,C.o)()}},{kind:"field",key:"_getItems",value(){return(0,d.Z)(((e,t,i,a,n)=>{let o=i;return e===S.Ie.Command?o=t:e===S.Ie.Device&&(o=a),o&&n&&" "!==n?this._filterItems(o,n):o}))}},{kind:"method",key:"render",value:function(){if(!this._open)return o.Ld;const e=this._getItems(this._mode,this._commandItems,this._entityItems,this._deviceItems,this._filter),t=this._mode===S.Ie.Device?"filter_placeholder_devices":"filter_placeholder",i=this.hass.localize(`ui.dialogs.quick-bar.${t}`),a=this._mode===S.Ie.Command,n=this._mode===S.Ie.Device,r=a?H:n?L:V,s=a?">":n?"#":"";return o.dy` <ha-dialog .heading="${this.hass.localize("ui.dialogs.quick-bar.title")}" open @opened="${this._handleOpened}" @closed="${this.closeDialog}" hideActions> <div slot="heading" class="heading"> <ha-textfield dialogInitialFocus .placeholder="${i}" aria-label="${i}" .value="${s}${this._search}" icon .iconTrailing="${void 0!==this._search||this._narrow}" @input="${this._handleSearchChange}" @keydown="${this._handleInputKeyDown}" @focus="${this._setFocusFirstListItem}"> <ha-svg-icon slot="leadingIcon" class="prefix" .path="${r}"></ha-svg-icon> ${this._search||this._narrow?o.dy` <div slot="trailingIcon"> ${this._search&&o.dy`<ha-icon-button @click="${this._clearSearch}" .label="${this.hass.localize("ui.common.clear")}" .path="${A}"></ha-icon-button>`} ${this._narrow?o.dy` <mwc-button .label="${this.hass.localize("ui.common.close")}" @click="${this.closeDialog}"></mwc-button> `:""} </div> `:""} </ha-textfield> </div> ${e?0===e.length?o.dy` <div class="nothing-found"> ${this.hass.localize("ui.dialogs.quick-bar.nothing_found")} </div> `:o.dy` <mwc-list> ${this._opened?o.dy`<lit-virtualizer tabindex="-1" scroller @keydown="${this._handleListItemKeyDown}" @rangechange="${this._handleRangeChanged}" @click="${this._handleItemClick}" class="ha-scrollbar" style="${(0,l.V)({height:this._narrow?"calc(100vh - 56px)":`${Math.min(e.length*(a?56:72)+26,500)}px`})}" .items="${e}" .renderItem="${this._renderItem}"> </lit-virtualizer>`:""} </mwc-list> `:o.dy`<ha-spinner size="small"></ha-spinner>`} ${this._hint?o.dy`<ha-tip .hass="${this.hass}">${this._hint}</ha-tip>`:""} </ha-dialog> `}},{kind:"method",key:"_initializeItemsIfNeeded",value:async function(){this._mode===S.Ie.Command?this._commandItems=this._commandItems||await this._generateCommandItems():this._mode===S.Ie.Device?this._deviceItems=this._deviceItems||this._generateDeviceItems():this._entityItems=this._entityItems||this._generateEntityItems()}},{kind:"method",key:"_handleOpened",value:function(){this._opened=!0}},{kind:"method",key:"_handleRangeChanged",value:async function(e){this._focusSet||e.firstVisible>-1&&(this._focusSet=!0,await this.updateComplete,this._setFocusFirstListItem())}},{kind:"field",key:"_renderItem",value(){return(e,t)=>e?D(e)?this._renderDeviceItem(e,t):N(e)?this._renderCommandItem(e,t):this._renderEntityItem(e,t):o.Ld}},{kind:"method",key:"_renderDeviceItem",value:function(e,t){return o.dy` <ha-list-item .twoline="${Boolean(e.area)}" .item="${e}" index="${(0,s.o)(t)}" tabindex="0"> <span>${e.primaryText}</span> ${e.area?o.dy` <span slot="secondary" class="item-text secondary">${e.area}</span> `:o.Ld} </ha-list-item> `}},{kind:"method",key:"_renderEntityItem",value:function(e,t){return o.dy` <ha-list-item .twoline="${Boolean(e.altText)}" .item="${e}" index="${(0,s.o)(t)}" graphic="icon" tabindex="0"> ${e.iconPath?o.dy` <ha-svg-icon .path="${e.iconPath}" class="entity" slot="graphic"></ha-svg-icon> `:o.dy`<span slot="graphic">${e.icon}</span>`} <span>${e.primaryText}</span> ${e.altText?o.dy` <span slot="secondary" class="item-text secondary">${e.altText}</span> `:o.Ld} </ha-list-item> `}},{kind:"method",key:"_renderCommandItem",value:function(e,t){return o.dy` <ha-list-item .item="${e}" index="${(0,s.o)(t)}" hasMeta tabindex="0"> <span> <ha-label .label="${e.categoryText}" class="command-category ${e.categoryKey}"> ${e.iconPath?o.dy` <ha-svg-icon .path="${e.iconPath}" slot="icon"></ha-svg-icon> `:o.Ld} ${e.categoryText} </ha-label> </span> <span class="command-text">${e.primaryText}</span> </ha-list-item> `}},{kind:"method",key:"_processItemAndCloseDialog",value:async function(e,t){this._addSpinnerToCommandItem(t),await e.action(),this.closeDialog()}},{kind:"method",key:"_handleInputKeyDown",value:function(e){if("Enter"===e.code){const e=this._getItemAtIndex(0);if(!e||"none"===e.style.display)return;this._processItemAndCloseDialog(e.item,0)}else"ArrowDown"===e.code&&(e.preventDefault(),this._getItemAtIndex(0)?.focus(),this._focusSet=!0,this._focusListElement=this._getItemAtIndex(0))}},{kind:"method",key:"_getItemAtIndex",value:function(e){return this.renderRoot.querySelector(`ha-list-item[index="${e}"]`)}},{kind:"method",key:"_addSpinnerToCommandItem",value:function(e){const t=document.createElement("ha-spinner");t.size="small",t.slot="meta",this._getItemAtIndex(e)?.appendChild(t)}},{kind:"method",key:"_handleSearchChange",value:function(e){const t=e.currentTarget.value,i=this._mode,a=this._search;let n,o;t.startsWith(">")?(n=S.Ie.Command,o=t.substring(1)):t.startsWith("#")?(n=S.Ie.Device,o=t.substring(1)):(n=S.Ie.Entity,o=t),i===n&&a===o||(this._mode=n,this._search=o,this._hint&&(this._hint=void 0),i!==this._mode?(this._focusSet=!1,this._initializeItemsIfNeeded(),this._filter=this._search):(this._focusSet&&this._focusListElement&&(this._focusSet=!1,this._focusListElement.rippleHandlers.endFocus()),this._debouncedSetFilter(this._search)))}},{kind:"method",key:"_clearSearch",value:function(){this._search="",this._filter=""}},{kind:"field",key:"_debouncedSetFilter",value(){return(0,x.D)((e=>{this._filter=e}),100)}},{kind:"method",key:"_setFocusFirstListItem",value:function(){this._getItemAtIndex(0)?.rippleHandlers.startFocus(),this._focusListElement=this._getItemAtIndex(0)}},{kind:"method",key:"_handleListItemKeyDown",value:function(e){const t=1===e.key.length,i=e.target.getAttribute("index"),a="0"===i;this._focusListElement=e.target,"ArrowDown"===e.key&&this._getItemAtIndex(Number(i)+1)?.focus(),"ArrowUp"===e.key&&(a?this._filterInputField?.focus():this._getItemAtIndex(Number(i)-1)?.focus()),"Enter"!==e.key&&" "!==e.key||this._processItemAndCloseDialog(e.target.item,Number(e.target.getAttribute("index"))),("Backspace"===e.key||t)&&(e.currentTarget.scrollTop=0,this._filterInputField?.focus())}},{kind:"method",key:"_handleItemClick",value:function(e){const t=e.target.closest("ha-list-item");this._processItemAndCloseDialog(t.item,Number(t.getAttribute("index")))}},{kind:"method",key:"_generateDeviceItems",value:function(){return Object.values(this.hass.devices).filter((e=>!e.disabled_by)).map((e=>{const t=e.area_id?this.hass.areas[e.area_id]:void 0,i={primaryText:(0,u.wZ)(e,this.hass),deviceId:e.id,area:t?.name,action:()=>(0,g.c)(`/config/devices/device/${e.id}`)};return{...i,strings:[i.primaryText]}})).sort(((e,t)=>(0,v.fe)(e.primaryText,t.primaryText,this.hass.locale.language)))}},{kind:"method",key:"_generateEntityItems",value:function(){return Object.keys(this.hass.states).map((e=>{const t=this.hass.states[e],i={primaryText:(0,f.C)(t),altText:e,icon:o.dy` <ha-state-icon .hass="${this.hass}" .stateObj="${t}"></ha-state-icon> `,action:()=>(0,m.B)(this,"hass-more-info",{entityId:e})};return{...i,strings:[i.primaryText,i.altText]}})).sort(((e,t)=>(0,v.fe)(e.primaryText,t.primaryText,this.hass.locale.language)))}},{kind:"method",key:"_generateCommandItems",value:async function(){return[...await this._generateReloadCommands(),...this._generateServerControlCommands(),...await this._generateNavigationCommands()].sort(((e,t)=>(0,v.fe)(e.strings.join(" "),t.strings.join(" "),this.hass.locale.language)))}},{kind:"method",key:"_generateReloadCommands",value:async function(){const e=(0,h.v)(this.hass,"reload"),t=await this.hass.loadBackendTranslation("title",e),i=e.map((e=>({primaryText:this.hass.localize(`ui.dialogs.quick-bar.commands.reload.${e}`)||this.hass.localize("ui.dialogs.quick-bar.commands.reload.reload",{domain:(0,k.Lh)(t,e)}),action:()=>this.hass.callService(e,"reload"),iconPath:M,categoryText:this.hass.localize("ui.dialogs.quick-bar.commands.types.reload")})));return i.push({primaryText:this.hass.localize("ui.dialogs.quick-bar.commands.reload.themes"),action:()=>this.hass.callService("frontend","reload_themes"),iconPath:M,categoryText:this.hass.localize("ui.dialogs.quick-bar.commands.types.reload")}),i.push({primaryText:this.hass.localize("ui.dialogs.quick-bar.commands.reload.core"),action:()=>this.hass.callService("homeassistant","reload_core_config"),iconPath:M,categoryText:this.hass.localize("ui.dialogs.quick-bar.commands.types.reload")}),i.push({primaryText:this.hass.localize("ui.dialogs.quick-bar.commands.reload.all"),action:()=>this.hass.callService("homeassistant","reload_all"),iconPath:M,categoryText:this.hass.localize("ui.dialogs.quick-bar.commands.types.reload")}),i.map((e=>({...e,categoryKey:"reload",strings:[`${e.categoryText} ${e.primaryText}`]})))}},{kind:"method",key:"_generateServerControlCommands",value:function(){return["restart","stop"].map((e=>{const t="server_control",i={primaryText:this.hass.localize("ui.dialogs.quick-bar.commands.server_control.perform_action",{action:this.hass.localize(`ui.dialogs.quick-bar.commands.server_control.${e}`)}),iconPath:E,categoryText:this.hass.localize(`ui.dialogs.quick-bar.commands.types.${t}`),categoryKey:t,action:async()=>{await(0,z.showConfirmationDialog)(this,{title:this.hass.localize(`ui.dialogs.restart.${e}.confirm_title`),text:this.hass.localize(`ui.dialogs.restart.${e}.confirm_description`),confirmText:this.hass.localize(`ui.dialogs.restart.${e}.confirm_action`),destructive:!0})&&this.hass.callService("homeassistant",e)}};return{...i,strings:[`${i.categoryText} ${i.primaryText}`]}}))}},{kind:"method",key:"_generateNavigationCommands",value:async function(){const e=this._generateNavigationPanelCommands(),t=this._generateNavigationConfigSectionCommands(),i=[];if((0,p.p)(this.hass,"hassio")){const e=await(0,b.yt)(this.hass);i.push({path:"/hassio/store",primaryText:this.hass.localize("ui.dialogs.quick-bar.commands.navigation.addon_store")}),i.push({path:"/hassio/dashboard",primaryText:this.hass.localize("ui.dialogs.quick-bar.commands.navigation.addon_dashboard")});for(const t of e.addons.filter((e=>e.version)))i.push({path:`/hassio/addon/${t.slug}`,primaryText:this.hass.localize("ui.dialogs.quick-bar.commands.navigation.addon_info",{addon:t.name})})}return this._finalizeNavigationCommands([...e,...t,...i])}},{kind:"method",key:"_generateNavigationPanelCommands",value:function(){return Object.keys(this.hass.panels).filter((e=>"_my_redirect"!==e)).map((e=>{const t=this.hass.panels[e],i=(0,w.ct)(t);return{primaryText:this.hass.localize(i)||t.title||t.url_path,path:`/${t.url_path}`}}))}},{kind:"method",key:"_generateNavigationConfigSectionCommands",value:function(){const e=[];for(const t of Object.keys(I.configSections))for(const i of I.configSections[t]){if(!(0,c.jn)(this.hass,i))continue;const t=this._getNavigationInfoFromConfig(i);t&&(e.some((e=>e.path===t.path))||e.push(t))}return e}},{kind:"method",key:"_getNavigationInfoFromConfig",value:function(e){const t=e.path.substring(1);let i=t.substring(t.indexOf("/")+1);i=i.indexOf("/")>-1?i.substring(0,i.indexOf("/")):i;const a=i&&this.hass.localize(`ui.dialogs.quick-bar.commands.navigation.${i}`)||e.translationKey&&this.hass.localize(e.translationKey);if(a)return{...e,primaryText:a}}},{kind:"method",key:"_finalizeNavigationCommands",value:function(e){return e.map((e=>{const t="navigation",i={...e,iconPath:P,categoryText:this.hass.localize(`ui.dialogs.quick-bar.commands.types.${t}`),action:()=>(0,g.c)(e.path)};return{...i,strings:[`${i.categoryText} ${i.primaryText}`],categoryKey:t}}))}},{kind:"field",key:"_filterItems",value:()=>(0,d.Z)(((e,t)=>(0,y.q)(t.trimLeft(),e)))},{kind:"get",static:!0,key:"styles",value:function(){return[$.$c,$.yu,o.iv`mwc-list{position:relative;--mdc-list-vertical-padding:0}.heading{display:flex;align-items:center;--mdc-theme-primary:var(--primary-text-color)}.heading ha-textfield{flex-grow:1}ha-dialog{--dialog-z-index:9;--dialog-content-padding:0}@media (min-width:800px){ha-dialog{--mdc-dialog-max-width:800px;--mdc-dialog-min-width:500px;--dialog-surface-position:fixed;--dialog-surface-top:40px;--mdc-dialog-max-height:calc(100% - 72px)}}@media all and (max-width:450px),all and (max-height:500px){ha-textfield{--mdc-shape-small:0}}@media all and (max-width:450px),all and (max-height:690px){.hint{display:none}}ha-svg-icon.prefix{color:var(--primary-text-color)}ha-textfield ha-icon-button{--mdc-icon-button-size:24px;color:var(--primary-text-color)}.command-category{--ha-label-icon-color:#585858;--ha-label-text-color:#212121}.command-category.reload{--ha-label-background-color:#cddc39}.command-category.navigation{--ha-label-background-color:var(--light-primary-color)}.command-category.server_control{--ha-label-background-color:var(--warning-color)}span.command-text{margin-left:8px;margin-inline-start:8px;margin-inline-end:initial;direction:var(--direction)}ha-list-item{width:100%;--mdc-list-item-graphic-margin:20px}ha-tip{padding:20px}.nothing-found{padding:16px 0px;text-align:center}div[slot=trailingIcon]{display:flex;align-items:center}lit-virtualizer{contain:size layout!important}`]}}]}}),o.oi);a()}catch(e){a(e)}}))},16485:function(e,t,i){i.a(e,(async function(e,t){try{i(92745);var a=i(61449),n=i(40574),o=i(30532),r=i(41674),s=i(49722),l=i(76632),d=i(7884),c=i(35185),h=i(60933),p=i(44180),m=i(49447);const e=async()=>{const e=(0,p.sS)(),t=[];(0,o.shouldPolyfill)()&&await Promise.all([i.e("80210"),i.e("74055")]).then(i.bind(i,98133)),(0,s.shouldPolyfill)()&&await Promise.all([i.e("83895"),i.e("75297"),i.e("80210"),i.e("60251")]).then(i.bind(i,59095)),(0,a.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("68250")]).then(i.bind(i,80561)).then((()=>(0,m.H)()))),(0,h.shouldPolyfill)()&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("65578")]).then(i.bind(i,97995))),(0,n.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("59826")]).then(i.bind(i,31514))),(0,r.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("23649")]).then(i.bind(i,93840))),(0,l.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("42831")]).then(i.bind(i,29559))),(0,d.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("57377")]).then(i.bind(i,39030)).then((()=>i.e("61236").then(i.t.bind(i,4121,23))))),(0,c.shouldPolyfill)(e)&&t.push(Promise.all([i.e("83895"),i.e("75297"),i.e("13870")]).then(i.bind(i,74546))),0!==t.length&&await Promise.all(t).then((()=>(0,m.n)(e)))};await e(),t()}catch(e){t(e)}}),1)},28008:function(e,t,i){i.d(t,{$c:()=>s,Qx:()=>o,k1:()=>n,yu:()=>r});var a=i(57243);const n=a.iv`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`,o=a.iv`:host{font-family:var(--paper-font-body1_-_font-family);-webkit-font-smoothing:var(--paper-font-body1_-_-webkit-font-smoothing);font-size:var(--paper-font-body1_-_font-size);font-weight:var(--paper-font-body1_-_font-weight);line-height:var(--paper-font-body1_-_line-height)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}h1{font-family:var(--paper-font-headline_-_font-family);-webkit-font-smoothing:var(--paper-font-headline_-_-webkit-font-smoothing);white-space:var(--paper-font-headline_-_white-space);overflow:var(--paper-font-headline_-_overflow);text-overflow:var(--paper-font-headline_-_text-overflow);font-size:var(--paper-font-headline_-_font-size);font-weight:var(--paper-font-headline_-_font-weight);line-height:var(--paper-font-headline_-_line-height)}h2{font-family:var(--paper-font-title_-_font-family);-webkit-font-smoothing:var(--paper-font-title_-_-webkit-font-smoothing);white-space:var(--paper-font-title_-_white-space);overflow:var(--paper-font-title_-_overflow);text-overflow:var(--paper-font-title_-_text-overflow);font-size:var(--paper-font-title_-_font-size);font-weight:var(--paper-font-title_-_font-weight);line-height:var(--paper-font-title_-_line-height)}h3{font-family:var(--paper-font-subhead_-_font-family);-webkit-font-smoothing:var(--paper-font-subhead_-_-webkit-font-smoothing);white-space:var(--paper-font-subhead_-_white-space);overflow:var(--paper-font-subhead_-_overflow);text-overflow:var(--paper-font-subhead_-_text-overflow);font-size:var(--paper-font-subhead_-_font-size);font-weight:var(--paper-font-subhead_-_font-weight);line-height:var(--paper-font-subhead_-_line-height)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}ha-button.warning,mwc-button.warning{--mdc-theme-primary:var(--error-color)}${n} .card-actions a{text-decoration:none}.card-actions .warning{--mdc-theme-primary:var(--error-color)}.layout.horizontal,.layout.vertical{display:flex}.layout.inline{display:inline-flex}.layout.horizontal{flex-direction:row}.layout.vertical{flex-direction:column}.layout.wrap{flex-wrap:wrap}.layout.no-wrap{flex-wrap:nowrap}.layout.center,.layout.center-center{align-items:center}.layout.bottom{align-items:flex-end}.layout.center-center,.layout.center-justified{justify-content:center}.flex{flex:1;flex-basis:0.000000001px}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.layout.justified{justify-content:space-between}`,r=a.iv`ha-dialog{--mdc-dialog-min-width:400px;--mdc-dialog-max-width:600px;--mdc-dialog-max-width:min(600px, 95vw);--justify-action-buttons:space-between}ha-dialog .form{color:var(--primary-text-color)}a{color:var(--primary-color)}@media all and (max-width:450px),all and (max-height:500px){ha-dialog{--mdc-dialog-min-width:calc( 100vw - env(safe-area-inset-right) - env(safe-area-inset-left) );--mdc-dialog-max-width:calc( 100vw - env(safe-area-inset-right) - env(safe-area-inset-left) );--mdc-dialog-min-height:100%;--mdc-dialog-max-height:100%;--vertical-align-dialog:flex-end;--ha-dialog-border-radius:0}}ha-button.warning,mwc-button.warning{--mdc-theme-primary:var(--error-color)}.error{color:var(--error-color)}`,s=a.iv`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{-webkit-border-radius:4px;border-radius:4px;background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`;a.iv`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`},47641:function(e,t,i){i.d(t,{o:()=>a});const a=async()=>{await i.e("31026").then(i.bind(i,35714))}}}; //# sourceMappingURL=99230.9310431f399fa40c.js.map