UNPKG

iobroker.lovelace

Version:

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

5 lines 24.3 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["46790"],{41307:function(t,e,i){var a=i(61701),o=i(72621),s=(i(71695),i(40251),i(47021),i(57243)),n=i(50778),r=i(35359),l=i(36522),d=i(76320);i(37583);let c,h,u,p,g=t=>t;(0,a.Z)([(0,n.Mo)("ha-expansion-panel")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"expanded",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"outlined",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({attribute:"left-chevron",type:Boolean,reflect:!0})],key:"leftChevron",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)({attribute:"no-collapse",type:Boolean,reflect:!0})],key:"noCollapse",value(){return!1}},{kind:"field",decorators:[(0,n.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"secondary",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_showContent",value(){return this.expanded}},{kind:"field",decorators:[(0,n.IO)(".container")],key:"_container",value:void 0},{kind:"method",key:"render",value:function(){const t=this.noCollapse?s.Ld:(0,s.dy)(c||(c=g` <ha-svg-icon .path="${0}" class="summary-icon ${0}"></ha-svg-icon> `),"M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",(0,r.$)({expanded:this.expanded}));return(0,s.dy)(h||(h=g` <div class="top ${0}"> <div id="summary" class="${0}" @click="${0}" @keydown="${0}" @focus="${0}" @blur="${0}" role="button" tabindex="${0}" aria-expanded="${0}" aria-controls="sect1"> ${0} <slot name="leading-icon"></slot> <slot name="header"> <div class="header"> ${0} <slot class="secondary" name="secondary">${0}</slot> </div> </slot> ${0} <slot name="icons"></slot> </div> </div> <div class="container ${0}" @transitionend="${0}" role="region" aria-labelledby="summary" aria-hidden="${0}" tabindex="-1"> ${0} </div> `),(0,r.$)({expanded:this.expanded}),(0,r.$)({noCollapse:this.noCollapse}),this._toggleContainer,this._toggleContainer,this._focusChanged,this._focusChanged,this.noCollapse?-1:0,this.expanded,this.leftChevron?t:s.Ld,this.header,this.secondary,this.leftChevron?s.Ld:t,(0,r.$)({expanded:this.expanded}),this._handleTransitionEnd,!this.expanded,this._showContent?(0,s.dy)(u||(u=g`<slot></slot>`)):"")}},{kind:"method",key:"willUpdate",value:function(t){(0,o.Z)(i,"willUpdate",this,3)([t]),t.has("expanded")&&(this._showContent=this.expanded,setTimeout((()=>{this._container.style.overflow=this.expanded?"initial":"hidden"}),300))}},{kind:"method",key:"_handleTransitionEnd",value:function(){this._container.style.removeProperty("height"),this._container.style.overflow=this.expanded?"initial":"hidden",this._showContent=this.expanded}},{kind:"method",key:"_toggleContainer",value:async function(t){if(t.defaultPrevented)return;if("keydown"===t.type&&"Enter"!==t.key&&" "!==t.key)return;if(t.preventDefault(),this.noCollapse)return;const e=!this.expanded;(0,l.B)(this,"expanded-will-change",{expanded:e}),this._container.style.overflow="hidden",e&&(this._showContent=!0,await(0,d.y)());const i=this._container.scrollHeight;this._container.style.height=`${i}px`,e||setTimeout((()=>{this._container.style.height="0px"}),0),this.expanded=e,(0,l.B)(this,"expanded-changed",{expanded:this.expanded})}},{kind:"method",key:"_focusChanged",value:function(t){this.noCollapse||this.shadowRoot.querySelector(".top").classList.toggle("focused","focus"===t.type)}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(p||(p=g`:host{display:block}.top{display:flex;align-items:center;border-radius:var(--ha-card-border-radius,12px)}.top.expanded{border-bottom-left-radius:0px;border-bottom-right-radius:0px}.top.focused{background:var(--input-fill-color)}:host([outlined]){box-shadow:none;border-width:1px;border-style:solid;border-color:var(--outline-color);border-radius:var(--ha-card-border-radius,12px)}.summary-icon{transition:transform 150ms cubic-bezier(.4, 0, .2, 1);direction:var(--direction);margin-left:8px;margin-inline-start:8px;margin-inline-end:initial}::slotted([slot=leading-icon]),:host([left-chevron]) .summary-icon{margin-left:0;margin-right:8px;margin-inline-start:0;margin-inline-end:8px}#summary{flex:1;display:flex;padding:var(--expansion-panel-summary-padding,0 8px);min-height:48px;align-items:center;cursor:pointer;overflow:hidden;font-weight:500;outline:0}#summary.noCollapse{cursor:default}.summary-icon.expanded{transform:rotate(180deg)}.header,::slotted([slot=header]){flex:1}.container{padding:var(--expansion-panel-content-padding,0 8px);overflow:hidden;transition:height .3s cubic-bezier(.4, 0, .2, 1);height:0px}.container.expanded{height:auto}.secondary{display:block;color:var(--secondary-text-color);font-size:12px}`))}}]}}),s.oi)},13928:function(t,e,i){i.r(e),i.d(e,{HaIconNext:()=>r});var a=i(61701),o=(i(71695),i(47021),i(50778)),s=i(5111),n=i(37583);let r=(0,a.Z)([(0,o.Mo)("ha-icon-next")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,o.Cb)()],key:"path",value(){return"rtl"===s.E.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}}]}}),n.HaSvgIcon)},51784:function(t,e,i){i.d(e,{dJ:()=>g,zB:()=>m});var a=i(61701),o=i(72621),s=(i(52247),i(71695),i(19423),i(40251),i(47021),i(67840)),n=i(88854),r=i(57243),l=i(50778);let d,c,h=t=>t;s.A.addInitializer((async t=>{await t.updateComplete;const e=t;e.dialog.prepend(e.scrim),e.scrim.style.inset=0,e.scrim.style.zIndex=0;const{getOpenAnimation:i,getCloseAnimation:a}=e;e.getOpenAnimation=()=>{var t,e;const a=i.call(void 0);return a.container=[...null!==(t=a.container)&&void 0!==t?t:[],...null!==(e=a.dialog)&&void 0!==e?e:[]],a.dialog=[],a},e.getCloseAnimation=()=>{var t,e;const i=a.call(void 0);return i.container=[...null!==(t=i.container)&&void 0!==t?t:[],...null!==(e=i.dialog)&&void 0!==e?e:[]],i.dialog=[],i}}));(0,a.Z)([(0,l.Mo)("ha-md-dialog")],(function(t,e){class a extends e{constructor(){super(),t(this),this.addEventListener("cancel",this._handleCancel),"function"!=typeof HTMLDialogElement&&(this.addEventListener("open",this._handleOpen),c||(c=i.e("73854").then(i.bind(i,85893)))),void 0===this.animate&&(this.quick=!0),void 0===this.animate&&(this.quick=!0)}}return{F:a,d:[{kind:"field",decorators:[(0,l.Cb)({attribute:"disable-cancel-action",type:Boolean})],key:"disableCancelAction",value(){return!1}},{kind:"field",key:"_polyfillDialogRegistered",value(){return!1}},{kind:"method",key:"_handleOpen",value:async function(t){var e;if(t.preventDefault(),this._polyfillDialogRegistered)return;this._polyfillDialogRegistered=!0,this._loadPolyfillStylesheet("/static/polyfills/dialog-polyfill.css");const i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("dialog");(await c).default.registerDialog(i),this.removeEventListener("open",this._handleOpen),this.show()}},{kind:"method",key:"_loadPolyfillStylesheet",value:async function(t){const e=document.createElement("link");return e.rel="stylesheet",e.href=t,new Promise(((i,a)=>{var o;e.onload=()=>i(),e.onerror=()=>a(new Error(`Stylesheet failed to load: ${t}`)),null===(o=this.shadowRoot)||void 0===o||o.appendChild(e)}))}},{kind:"method",key:"_handleCancel",value:function(t){if(this.disableCancelAction){var e;t.preventDefault();const i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("dialog .container");void 0!==this.animate&&(null==i||i.animate([{transform:"rotate(-1deg)","animation-timing-function":"ease-in"},{transform:"rotate(1.5deg)","animation-timing-function":"ease-out"},{transform:"rotate(0deg)","animation-timing-function":"ease-in"}],{duration:200,iterations:2}))}}},{kind:"field",static:!0,key:"styles",value(){return[...(0,o.Z)(a,"styles",this),(0,r.iv)(d||(d=h`:host{--md-dialog-container-color:var(--card-background-color);--md-dialog-headline-color:var(--primary-text-color);--md-dialog-supporting-text-color:var(--primary-text-color);--md-sys-color-scrim:#000000;--md-dialog-headline-weight:400;--md-dialog-headline-size:1.574rem;--md-dialog-supporting-text-size:1rem;--md-dialog-supporting-text-line-height:1.5rem}:host([type=alert]){min-width:320px}@media all and (max-width:450px),all and (max-height:500px){:host(:not([type=alert])){min-width:calc(100vw - env(safe-area-inset-right) - env(safe-area-inset-left));max-width:calc(100vw - env(safe-area-inset-right) - env(safe-area-inset-left));min-height:100%;max-height:100%;--md-dialog-container-shape:0}}::slotted(ha-dialog-header[slot=headline]){display:contents}.scroller{overflow:var(--dialog-content-overflow,auto)}slot[name=content]::slotted(*){padding:var(--dialog-content-padding,24px)}.scrim{z-index:10}`))]}}]}}),s.A);const u=Object.assign(Object.assign({},n.I),{},{dialog:[[[{transform:"translateY(50px)"},{transform:"translateY(0)"}],{duration:500,easing:"cubic-bezier(.3,0,0,1)"}]],container:[[[{opacity:0},{opacity:1}],{duration:50,easing:"linear",pseudoElement:"::before"}]]}),p=Object.assign(Object.assign({},n.G),{},{dialog:[[[{transform:"translateY(0)"},{transform:"translateY(50px)"}],{duration:150,easing:"cubic-bezier(.3,0,0,1)"}]],container:[[[{opacity:"1"},{opacity:"0"}],{delay:100,duration:50,easing:"linear",pseudoElement:"::before"}]]}),g=()=>window.matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches?u:n.I,m=()=>window.matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches?p:n.G},74633:function(t,e,i){var a=i(61701),o=i(72621),s=(i(71695),i(47021),i(78755)),n=i(57243),r=i(50778);let l,d=t=>t;(0,a.Z)([(0,r.Mo)("ha-md-list-item")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",static:!0,key:"styles",value(){return[...(0,o.Z)(i,"styles",this),(0,n.iv)(l||(l=d`: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)}`))]}}]}}),s.g)},19993:function(t,e,i){var a=i(61701),o=i(72621),s=(i(71695),i(47021),i(623)),n=i(57243),r=i(50778);let l,d=t=>t;(0,a.Z)([(0,r.Mo)("ha-md-list")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",static:!0,key:"styles",value(){return[...(0,o.Z)(i,"styles",this),(0,n.iv)(l||(l=d`:host{--md-sys-color-surface:var(--card-background-color)}`))]}}]}}),s.j)},17170:function(t,e,i){i.a(t,(async function(t,a){try{i.r(e),i.d(e,{HaSpinner:()=>p});var o=i(61701),s=i(72621),n=(i(71695),i(47021),i(97677)),r=i(43580),l=i(57243),d=i(50778),c=t([n]);n=(c.then?(await c)():c)[0];let h,u=t=>t,p=(0,o.Z)([(0,d.Mo)("ha-spinner")],(function(t,e){class i extends e{constructor(...e){super(...e),t(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(t){if((0,s.Z)(i,"updated",this,3)([t]),t.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(){return[r.Z,(0,l.iv)(h||(h=u`: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)}`))]}}]}}),n.Z);a()}catch(h){a(h)}}))},56785:function(t,e,i){i.d(e,{js:()=>s,rY:()=>o,yd:()=>l,yz:()=>r});i(19083),i(71695),i(40251),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(61006),i(47021);var a=i(17803);const o=t=>t.data,s=t=>"object"==typeof t?"object"==typeof t.body?t.body.message||"Unknown error, see supervisor logs":t.body||t.message||"Unknown error, see supervisor logs":t,n=new Set([502,503,504]),r=t=>!!(t&&t.status_code&&n.has(t.status_code))||!(!t||!t.message||!t.message.includes("ERR_CONNECTION_CLOSED")&&!t.message.includes("ERR_CONNECTION_RESET")),l=async(t,e)=>(0,a.I)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:`/${e}/stats`,method:"get"}):o(await t.callApi("GET",`hassio/${e}/stats`))},67044:function(t,e,i){i.d(e,{AP:()=>n,MY:()=>r,Or:()=>l,Sj:()=>s,Sx:()=>c,oJ:()=>d,ou:()=>h});i(40251);var a=i(17803),o=i(56785);const s=async t=>{if((0,a.I)(t.config.version,2021,2,4))return t.callWS({type:"supervisor/api",endpoint:"/host/info",method:"get"});const e=await t.callApi("GET","hassio/host/info");return(0,o.rY)(e)},n=async t=>(0,a.I)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/os/info",method:"get"}):(0,o.rY)(await t.callApi("GET","hassio/os/info")),r=async t=>(0,a.I)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/host/reboot",method:"post",timeout:null}):t.callApi("POST","hassio/host/reboot"),l=async t=>(0,a.I)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/host/shutdown",method:"post",timeout:null}):t.callApi("POST","hassio/host/shutdown"),d=async(t,e)=>(0,a.I)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/host/options",method:"post",data:e}):t.callApi("POST","hassio/host/options",e),c=async(t,e)=>(0,a.I)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/os/datadisk/move",method:"post",timeout:null,data:{device:e}}):t.callApi("POST","hassio/os/datadisk/move"),h=async t=>(0,a.I)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/os/datadisk/list",method:"get",timeout:null}):(0,o.rY)(await t.callApi("GET","/os/datadisk/list"))},47364:function(t,e,i){i.a(t,(async function(t,a){try{i.r(e);var o=i(61701),s=(i(71695),i(40251),i(47021),i(57243)),n=i(50778),r=i(72344),l=i(36522),d=i(17170),c=(i(51784),i(19993),i(41307),i(74633),i(23334),i(13928),i(56785)),h=i(67044),u=i(28008),p=i(72473),g=i(76131),m=t([d]);d=(m.then?(await m)():m)[0];let v,f,y,x,k,b,w=t=>t;const L="M7.5,5.6L5,7L6.4,4.5L5,2L7.5,3.4L10,2L8.6,4.5L10,7L7.5,5.6M19.5,15.4L22,14L20.6,16.5L22,19L19.5,17.6L17,19L18.4,16.5L17,14L19.5,15.4M22,2L20.6,4.5L22,7L19.5,5.6L17,7L18.4,4.5L17,2L19.5,3.4L22,2M13.34,12.78L15.78,10.34L13.66,8.22L11.22,10.66L13.34,12.78M14.37,7.29L16.71,9.63C17.1,10 17.1,10.65 16.71,11.04L5.04,22.71C4.65,23.1 4,23.1 3.63,22.71L1.29,20.37C0.9,20 0.9,19.35 1.29,18.96L12.96,7.29C13.35,6.9 14,6.9 14.37,7.29Z",_="M19.79,15.41C20.74,13.24 20.74,10.75 19.79,8.59L17.05,9.83C17.65,11.21 17.65,12.78 17.06,14.17L19.79,15.41M15.42,4.21C13.25,3.26 10.76,3.26 8.59,4.21L9.83,6.94C11.22,6.35 12.79,6.35 14.18,6.95L15.42,4.21M4.21,8.58C3.26,10.76 3.26,13.24 4.21,15.42L6.95,14.17C6.35,12.79 6.35,11.21 6.95,9.82L4.21,8.58M8.59,19.79C10.76,20.74 13.25,20.74 15.42,19.78L14.18,17.05C12.8,17.65 11.22,17.65 9.84,17.06L8.59,19.79M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,8A4,4 0 0,0 8,12A4,4 0 0,0 12,16A4,4 0 0,0 16,12A4,4 0 0,0 12,8Z",C="M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13",z="M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M12,19A7,7 0 0,1 5,12A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19M13,17H11V7H13V17Z",$="M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z",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";(0,o.Z)([(0,n.Mo)("dialog-restart")],(function(t,e){return{F:class extends e{constructor(...e){super(...e),t(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_open",value(){return!1}},{kind:"field",decorators:[(0,n.SB)()],key:"_loadingHostInfo",value(){return!1}},{kind:"field",decorators:[(0,n.SB)()],key:"_hostInfo",value:void 0},{kind:"field",decorators:[(0,n.IO)("ha-md-dialog")],key:"_dialog",value:void 0},{kind:"method",key:"showDialog",value:async function(){const t=(0,r.p)(this.hass,"hassio");if(this._open=!0,t&&!this._hostInfo){this._loadingHostInfo=!0;try{this._hostInfo=await(0,h.Sj)(this.hass)}catch(e){}finally{this._loadingHostInfo=!1}}}},{kind:"method",key:"_dialogClosed",value:function(){this._open=!1,this._loadingHostInfo=!1,(0,l.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"closeDialog",value:function(){var t;null===(t=this._dialog)||void 0===t||t.close()}},{kind:"method",key:"render",value:function(){var t,e;if(!this._open)return s.Ld;const i=null===(t=this.hass.userData)||void 0===t?void 0:t.showAdvanced,a=!!this._hostInfo,o=this.hass.localize("ui.dialogs.restart.heading");return(0,s.dy)(v||(v=w` <ha-md-dialog open @closed="${0}"> <ha-dialog-header slot="headline"> <ha-icon-button slot="navigationIcon" .label="${0}" .path="${0}" @click="${0}"></ha-icon-button> <span slot="title" .title="${0}"> ${0} </span> </ha-dialog-header> <div slot="content" class="content"> ${0} </div> </ha-md-dialog> `),this._dialogClosed,null!==(e=this.hass.localize("ui.common.close"))&&void 0!==e?e:"Close",A,this.closeDialog,o,o,this._loadingHostInfo?(0,s.dy)(f||(f=w` <div class="loader"> <ha-spinner></ha-spinner> </div> `)):(0,s.dy)(y||(y=w` <ha-md-list dialogInitialFocus> ${0} <ha-md-list-item type="button" @click="${0}"> <div slot="start" class="icon-background restart"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div> <div slot="headline"> ${0} </div> <div slot="supporting-text"> ${0} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item> </ha-md-list> <ha-expansion-panel .header="${0}"> <ha-md-list> ${0} <ha-md-list-item type="button" @click="${0}"> <div slot="start" class="icon-background restart-safe-mode"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div> <div slot="headline"> ${0} </div> <div slot="supporting-text"> ${0} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item> </ha-md-list> </ha-expansion-panel> `),i?(0,s.dy)(x||(x=w` <ha-md-list-item type="button" @click="${0}"> <div slot="headline"> ${0} </div> <div slot="supporting-text"> ${0} </div> <div slot="start" class="icon-background reload"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div> <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item> `),this._reload,this.hass.localize("ui.dialogs.restart.reload.title"),this.hass.localize("ui.dialogs.restart.reload.description"),L):s.Ld,this._showRestartDialog,$,this.hass.localize("ui.dialogs.restart.restart.title"),this.hass.localize("ui.dialogs.restart.restart.description"),this.hass.localize("ui.dialogs.restart.advanced_options"),a?(0,s.dy)(k||(k=w` <ha-md-list-item type="button" @click="${0}"> <div slot="start" class="icon-background reboot"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div> <div slot="headline"> ${0} </div> <div slot="supporting-text"> ${0} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item> <ha-md-list-item type="button" @click="${0}"> <div slot="start" class="icon-background shutdown"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div> <div slot="headline"> ${0} </div> <div slot="supporting-text"> ${0} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-md-list-item> `),this._hostReboot,z,this.hass.localize("ui.dialogs.restart.reboot.title"),this.hass.localize("ui.dialogs.restart.reboot.description"),this._hostShutdown,C,this.hass.localize("ui.dialogs.restart.shutdown.title"),this.hass.localize("ui.dialogs.restart.shutdown.description")):s.Ld,this._showRestartSafeModeDialog,_,this.hass.localize("ui.dialogs.restart.restart-safe-mode.title"),this.hass.localize("ui.dialogs.restart.restart-safe-mode.description")))}},{kind:"method",key:"_reload",value:async function(){this.closeDialog(),(0,p.C)(this,{message:this.hass.localize("ui.dialogs.restart.reload.reloading"),duration:1e3});try{await this.hass.callService("homeassistant","reload_all")}catch(t){(0,g.showAlertDialog)(this,{title:this.hass.localize("ui.dialogs.restart.reload.failed"),text:t.message})}}},{kind:"method",key:"_showRestartDialog",value:async function(){if(await(0,g.showConfirmationDialog)(this,{title:this.hass.localize("ui.dialogs.restart.restart.confirm_title"),text:this.hass.localize("ui.dialogs.restart.restart.confirm_description"),confirmText:this.hass.localize("ui.dialogs.restart.restart.confirm_action"),destructive:!0})){this.closeDialog();try{await this.hass.callService("homeassistant","restart")}catch(t){(0,g.showAlertDialog)(this,{title:this.hass.localize("ui.dialogs.restart.restart.failed"),text:t.message})}}}},{kind:"method",key:"_showRestartSafeModeDialog",value:async function(){if(await(0,g.showConfirmationDialog)(this,{title:this.hass.localize("ui.dialogs.restart.restart-safe-mode.confirm_title"),text:this.hass.localize("ui.dialogs.restart.restart-safe-mode.confirm_description"),confirmText:this.hass.localize("ui.dialogs.restart.restart-safe-mode.confirm_action"),destructive:!0})){this.closeDialog();try{await this.hass.callService("homeassistant","restart",{safe_mode:!0})}catch(t){(0,g.showAlertDialog)(this,{title:this.hass.localize("ui.dialogs.restart.restart-safe-mode.failed"),text:t.message})}}}},{kind:"method",key:"_hostReboot",value:async function(){if(await(0,g.showConfirmationDialog)(this,{title:this.hass.localize("ui.dialogs.restart.reboot.confirm_title"),text:this.hass.localize("ui.dialogs.restart.reboot.confirm_description"),confirmText:this.hass.localize("ui.dialogs.restart.reboot.confirm_action"),destructive:!0})){this.closeDialog(),(0,p.C)(this,{message:this.hass.localize("ui.dialogs.restart.reboot.rebooting"),duration:-1});try{await(0,h.MY)(this.hass)}catch(t){this.hass.connection.connected&&!(0,c.yz)(t)&&(0,g.showAlertDialog)(this,{title:this.hass.localize("ui.dialogs.restart.reboot.failed"),text:(0,c.js)(t)})}}}},{kind:"method",key:"_hostShutdown",value:async function(){if(await(0,g.showConfirmationDialog)(this,{title:this.hass.localize("ui.dialogs.restart.shutdown.confirm_title"),text:this.hass.localize("ui.dialogs.restart.shutdown.confirm_description"),confirmText:this.hass.localize("ui.dialogs.restart.shutdown.confirm_action"),destructive:!0})){this.closeDialog(),(0,p.C)(this,{message:this.hass.localize("ui.dialogs.restart.shutdown.shutting_down"),duration:-1});try{await(0,h.Or)(this.hass)}catch(t){this.hass.connection.connected&&!(0,c.yz)(t)&&(0,g.showAlertDialog)(this,{title:this.hass.localize("ui.dialogs.restart.shutdown.failed"),text:(0,c.js)(t)})}}}},{kind:"get",static:!0,key:"styles",value:function(){return[u.Qx,u.yu,(0,s.iv)(b||(b=w`ha-md-dialog{--dialog-content-padding:0}@media all and (min-width:550px){ha-md-dialog{min-width:500px;max-width:500px}}ha-expansion-panel{border-top:1px solid var(--divider-color);margin-bottom:10px;box-shadow:none;--expansion-panel-content-padding:0;--expansion-panel-summary-padding:0 var(--mdc-list-side-padding, 20px);--ha-card-border-radius:0}.icon-background{border-radius:50%;color:#fff;display:flex;width:40px;height:40px;display:flex;align-items:center;justify-content:center}.reload{background-color:#5f8a49}.restart{background-color:#ffd500;color:#650}.reboot{background-color:#ba1b1b;color:#fff}.shutdown{background-color:#0b1d29;color:#fff}.restart-safe-mode{background-color:#e48629;color:#fff}.divider{height:1px;background-color:var(--divider-color)}.section{font-weight:500;font-size:14px;line-height:20px;margin:8px 0 4px 0;padding-left:var(--mdc-list-side-padding,20px);padding-right:var(--mdc-list-side-padding,20px);padding-inline-start:var(--mdc-list-side-padding,20px);padding-inline-end:var(--mdc-list-side-padding,20px)}.loader{display:flex;align-items:center;justify-content:center;padding:24px}`))]}}]}}),s.oi);a()}catch(v){a(v)}}))}}]); //# sourceMappingURL=46790.4f5567c1c6967830.js.map