iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
5 lines • 25.6 kB
JavaScript
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["9524"],{83456:function(e,t,a){"use strict";var i=a(61701),n=(a(71695),a(47021),a(92444)),o=a(76688),s=a(57243),r=a(50778);let c,l=e=>e;(0,i.Z)([(0,r.Mo)("ha-checkbox")],(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)(c||(c=l`:host{--mdc-theme-secondary:var(--primary-color)}`))]}}]}}),n.A)},45708:function(e,t,a){"use strict";var i=a(61701),n=a(72621),o=(a(71695),a(52805),a(9359),a(48136),a(47021),a(57243)),s=a(50778),r=a(35359);let c,l,d=e=>e;(0,i.Z)([(0,s.Mo)("ha-faded")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,s.Cb)({type:Number,attribute:"faded-height"})],key:"fadedHeight",value(){return 102}},{kind:"field",decorators:[(0,s.SB)()],key:"_contentShown",value(){return!1}},{kind:"method",key:"render",value:function(){return(0,o.dy)(c||(c=d` <div class="container ${0}" style="${0}" ="${0}"> <slot -resize="${0}"></slot> </div> `),(0,r.$)({faded:!this._contentShown}),this._contentShown?"":`max-height: ${this.fadedHeight}px`,this._showContent,this._setShowContent)}},{kind:"get",key:"_slottedHeight",value:function(){var e;return(null===(e=this.shadowRoot.querySelector(".container"))||void 0===e?void 0:e.firstElementChild).assignedElements().reduce(((e,t)=>e+t.offsetHeight),0)||0}},{kind:"method",key:"_setShowContent",value:function(){const e=this._slottedHeight;this._contentShown=0!==e&&e<=this.fadedHeight+50}},{kind:"method",key:"firstUpdated",value:function(e){(0,n.Z)(a,"firstUpdated",this,3)([e]),this._setShowContent()}},{kind:"method",key:"_showContent",value:function(){this._contentShown=!0}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(l||(l=d`.container{display:block;height:auto;cursor:default}.faded{cursor:pointer;-webkit-mask-image:linear-gradient(to bottom,black 25%,transparent 100%);mask-image:linear-gradient(to bottom,black 25%,transparent 100%);overflow-y:hidden}`))}}]}}),o.oi)},53013:function(e,t,a){"use strict";var i=a(61701),n=a(72621),o=a(91179),s=(a(19083),a(71695),a(52805),a(9359),a(56475),a(70104),a(48136),a(40251),a(19134),a(61006),a(47021),a(57243)),r=a(50778),c=a(94886),l=a.n(c),d=a(36522),u=(a(72700),a(8038),a(71513),a(75656),a(50100),a(18084),a(75351));let h;const p=new(a(80262).L)(1e3),m={reType:(0,o.Z)(/((\[!(caution|important|note|tip|warning)\])(?:\s|\\n)?)/i,{input:1,type:3}),typeToHaAlert:{caution:"error",important:"info",note:"info",tip:"success",warning:"warning"}};(0,i.Z)([(0,r.Mo)("ha-markdown-element")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)()],key:"content",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:"allow-svg",type:Boolean})],key:"allowSvg",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"breaks",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,attribute:"lazy-images"})],key:"lazyImages",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"cache",value(){return!1}},{kind:"method",key:"disconnectedCallback",value:function(){if((0,n.Z)(i,"disconnectedCallback",this,3)([]),this.cache){const e=this._computeCacheKey();p.set(e,this.innerHTML)}}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"update",value:function(e){(0,n.Z)(i,"update",this,3)([e]),void 0!==this.content&&this._render()}},{kind:"method",key:"willUpdate",value:function(e){if(!this.innerHTML&&this.cache){const e=this._computeCacheKey();p.has(e)&&(this.innerHTML=p.get(e),this._resize())}}},{kind:"method",key:"_computeCacheKey",value:function(){return l()({content:this.content,allowSvg:this.allowSvg,breaks:this.breaks})}},{kind:"method",key:"_render",value:async function(){this.innerHTML=await(async(e,t,i)=>(h||(h=(0,u.Ud)(new Worker(new URL(a.p+a.u("45845"),a.b)))),h.renderMarkdown(e,t,i)))(String(this.content),{breaks:this.breaks,gfm:!0},{allowSvg:this.allowSvg}),this._resize();const e=document.createTreeWalker(this,NodeFilter.SHOW_ELEMENT,null);for(;e.nextNode();){const i=e.currentNode;if(i instanceof HTMLAnchorElement&&i.host!==document.location.host)i.target="_blank",i.rel="noreferrer noopener";else if(i instanceof HTMLImageElement)this.lazyImages&&(i.loading="lazy"),i.addEventListener("load",this._resize);else if(i instanceof HTMLQuoteElement){var t;const a=(null===(t=i.firstElementChild)||void 0===t||null===(t=t.firstChild)||void 0===t?void 0:t.textContent)&&m.reType.exec(i.firstElementChild.firstChild.textContent);if(a){const{type:t}=a.groups,n=document.createElement("ha-alert");n.alertType=m.typeToHaAlert[t.toLowerCase()],n.append(...Array.from(i.childNodes).map((e=>{const t=Array.from(e.childNodes);if(!this.breaks&&t.length){var i;const e=t[0];e.nodeType===Node.TEXT_NODE&&e.textContent===a.input&&null!==(i=e.textContent)&&void 0!==i&&i.includes("\n")&&(e.textContent=e.textContent.split("\n").slice(1).join("\n"))}return t})).reduce(((e,t)=>e.concat(t)),[]).filter((e=>e.textContent&&e.textContent!==a.input))),e.parentNode().replaceChild(n,i)}}else i instanceof HTMLElement&&["ha-alert","ha-qr-code","ha-icon","ha-svg-icon"].includes(i.localName)&&a(23265)(`./${i.localName}`)}}},{kind:"field",key:"_resize",value(){return()=>(0,d.B)(this,"content-resize")}}]}}),s.fl)},99254:function(e,t,a){"use strict";var i=a(61701),n=(a(71695),a(47021),a(57243)),o=a(50778);a(53013);let s,r,c=e=>e;(0,i.Z)([(0,o.Mo)("ha-markdown")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)()],key:"content",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:"allow-svg",type:Boolean})],key:"allowSvg",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"breaks",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,attribute:"lazy-images"})],key:"lazyImages",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"cache",value(){return!1}},{kind:"method",key:"render",value:function(){return this.content?(0,n.dy)(s||(s=c`<ha-markdown-element .content="${0}" .allowSvg="${0}" .breaks="${0}" .lazyImages="${0}" .cache="${0}"></ha-markdown-element>`),this.content,this.allowSvg,this.breaks,this.lazyImages,this.cache):n.Ld}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(r||(r=c`:host{display:block}ha-markdown-element{-ms-user-select:text;-webkit-user-select:text;-moz-user-select:text}ha-markdown-element>:first-child{margin-top:0}ha-markdown-element>:last-child{margin-bottom:0}ha-alert{display:block;margin:4px 0}a{color:var(--primary-color)}img{max-width:100%}code,pre{background-color:var(--markdown-code-background-color,none);border-radius:3px}svg{background-color:var(--markdown-svg-background-color,none);color:var(--markdown-svg-color,none)}code{font-size:85%;padding:.2em .4em}pre code{padding:0}pre{padding:16px;overflow:auto;line-height:1.45;font-family:var(--code-font-family, monospace)}h1,h2,h3,h4,h5,h6{line-height:initial}h2{font-size:1.5em;font-weight:700}hr{border-color:var(--divider-color);border-bottom:none;margin:16px 0}`))}}]}}),n.oi)},74633:function(e,t,a){"use strict";var i=a(61701),n=a(72621),o=(a(71695),a(47021),a(78755)),s=a(57243),r=a(50778);let c,l=e=>e;(0,i.Z)([(0,r.Mo)("ha-md-list-item")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",static:!0,key:"styles",value(){return[...(0,n.Z)(a,"styles",this),(0,s.iv)(c||(c=l`: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)}`))]}}]}}),o.g)},19993:function(e,t,a){"use strict";var i=a(61701),n=a(72621),o=(a(71695),a(47021),a(623)),s=a(57243),r=a(50778);let c,l=e=>e;(0,i.Z)([(0,r.Mo)("ha-md-list")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",static:!0,key:"styles",value(){return[...(0,n.Z)(a,"styles",this),(0,s.iv)(c||(c=l`:host{--md-sys-color-surface:var(--card-background-color)}`))]}}]}}),o.j)},26779:function(e,t,a){"use strict";a.a(e,(async function(e,i){try{a.d(t,{$u:()=>T,AG:()=>k,BR:()=>M,Ef:()=>Z,En:()=>H,I0:()=>y,KE:()=>G,Kn:()=>N,LG:()=>_,OT:()=>E,Sw:()=>A,Ty:()=>W,U0:()=>V,UR:()=>z,Ug:()=>$,V1:()=>B,VY:()=>K,Vn:()=>R,Y6:()=>X,Ye:()=>w,ZE:()=>g,Zk:()=>C,_r:()=>v,aq:()=>S,cF:()=>P,fi:()=>L,mu:()=>I,n:()=>Y,p_:()=>j,pi:()=>O,rI:()=>b,wy:()=>f,xc:()=>x});a(19083),a(71695),a(61893),a(55751),a(26200),a(25754),a(22246),a(9359),a(56475),a(1331),a(31526),a(70104),a(19423),a(23669),a(40251),a(19134),a(11740),a(97003),a(92789),a(36810),a(14953),a(58402),a(31503),a(16440),a(2213),a(57385),a(71375),a(15524),a(20267),a(21917),a(56193),a(25020),a(86913),a(47021),a(71513),a(75656),a(50100),a(18084);var n=a(66952),o=a(55116),s=a(5423),r=a(27486),c=a(64214),l=a(33570),d=a(58014),u=a(57816),h=a(92091),p=a(11257),m=e([n,c,l]);[n,c,l]=m.then?(await m)():m;let f=99387==a.j?function(e){return e.NEVER="never",e.DAILY="daily",e.CUSTOM_DAYS="custom_days",e}({}):null;const k=99387==a.j?["mon","tue","wed","thu","fri","sat","sun"]:null,b=e=>e.sort(((e,t)=>k.indexOf(e)-k.indexOf(t))),_=e=>e.callWS({type:"backup/config/info"}),v=(e,t)=>e.callWS(Object.assign({type:"backup/config/update"},t)),y=(e,t,a)=>`/api/backup/download/${e}?agent_id=${t}${a?`&password=${a}`:""}`,g=e=>e.callWS({type:"backup/info"}),w=(e,t)=>e.callWS({type:"backup/details",backup_id:t}),x=e=>e.callWS({type:"backup/agents/info"}),$=(e,t)=>e.callWS({type:"backup/delete",backup_id:t}),C=(e,t)=>e.callWS(Object.assign({type:"backup/generate"},t)),S=e=>e.callWS({type:"backup/generate_with_automatic_settings"}),O=(e,t)=>e.callWS(Object.assign({type:"backup/restore"},t)),j=async(e,t,a)=>{const i=new FormData;i.append("file",t);const n=new URLSearchParams;return a.forEach((e=>{n.append("agent_id",e)})),(0,p.h9)(e.fetchWithAuth(`/api/backup/upload?${n.toString()}`,{method:"POST",body:i}))},E=e=>{const t=e.find(B);if(t)return t;const a=e.find(M);return a||e[0]},L=(e,t,a,i)=>e.callWS({type:"backup/can_decrypt_on_download",backup_id:t,agent_id:a,password:i}),z="backup.local",N="hassio.local",T="cloud.cloud",B=e=>[z,N].includes(e),M=e=>{const[t,a]=e.split(".");return"hassio"===t&&"local"!==a},A=(e,t,a)=>{if(B(t))return e("ui.panel.config.backup.agents.local_agent");const i=a.find((e=>e.agent_id===t)),n=t.split(".")[0],o=i?i.name:t.split(".")[1];if(M(t))return o;const s=(0,u.Lh)(e,n);return a.filter((e=>e.agent_id.split(".")[0]===n)).length>1?`${s}: ${o}`:s},H=e=>Math.max(...Object.values(e.agents).map((e=>e.size))),U=["automatic","manual","addon_update"],I=(0,n.z)((e=>e?U:U.filter((e=>"addon_update"!==e)))),R=(e,t)=>{var a;return e.with_automatic_settings?"automatic":t&&null!=(null===(a=e.extra_metadata)||void 0===a?void 0:a["supervisor.addon_update"])?"addon_update":"manual"},Z=(e,t)=>{const a=B(e),i=B(t),n=M(e),o=M(t),s=(e,t)=>e?1:t?2:3,r=s(a,n),c=s(i,o);return r!==c?r-c:e.localeCompare(t)},W=()=>{const e="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",t="xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx";let a="";const i=new Uint8Array(34);return crypto.getRandomValues(i),i.forEach(((i,n)=>{a+="-"===t[n]?"-":e[i%36]})),a},D=(e,t)=>"data:text/plain;charset=utf-8,"+encodeURIComponent(`${e.localize("ui.panel.config.backup.emergency_kit_file.title")}\n\n${e.localize("ui.panel.config.backup.emergency_kit_file.description")}\n\n${e.localize("ui.panel.config.backup.emergency_kit_file.date")} ${(0,c.o0)(new Date,e.locale,e.config)}\n\n${e.localize("ui.panel.config.backup.emergency_kit_file.instance")}\n${e.config.location_name}\n\n${e.localize("ui.panel.config.backup.emergency_kit_file.url")}\n${e.auth.data.hassUrl}\n\n${e.localize("ui.panel.config.backup.emergency_kit_file.encryption_key")}\n${t}\n\n${e.localize("ui.panel.config.backup.emergency_kit_file.more_info",{link:"https://www.home-assistant.io/more-info/backup-emergency-kit"})}`),F=(e,t)=>`home_assistant_backup_emergency_kit_${t?`${t}_`:""}${(0,c.NR)(new Date,e.locale,e.config).replace(",","").replace(" ","_")}.txt`,K=(e,t,a)=>(0,d.N)(D(e,t),F(e,a)),P=(0,o.H)((0,s.B)(new Date,4),45),X=(0,o.H)((0,s.B)(new Date,5),45),G=(0,r.Z)(((e,t,a)=>{if((0,h.Z)(a))return(0,l.mr)(a,e,t);if("string"==typeof a&&a){const i=a.split(":"),n=(0,o.H)((0,s.B)(new Date,parseInt(i[0])),parseInt(i[1]));return(0,l.mr)(n,e,t)}return`${(0,l.mr)(P,e,t)} - ${(0,l.mr)(X,e,t)}`})),V="application/x-tar",Y=99387==a.j?{file:void 0}:null;i()}catch(f){i(f)}}))},62992:function(e,t,a){"use strict";a.d(t,{m:()=>o});a(71695),a(40251),a(47021);const i=async(e,t,a,n,o,...s)=>{const r=o,c=r[e],l=c=>n&&n(o,c.result)!==c.cacheKey?(r[e]=void 0,i(e,t,a,n,o,...s)):c.result;if(c)return c instanceof Promise?c.then(l):l(c);const d=a(o,...s);return r[e]=d,d.then((a=>{r[e]={result:a,cacheKey:null==n?void 0:n(o,a)},setTimeout((()=>{r[e]=void 0}),t)}),(()=>{r[e]=void 0})),d},n=e=>e.callWS({type:"entity/source"}),o=e=>i("_entitySources",3e4,n,(e=>Object.keys(e.states).length),e)},51077:function(e,t,a){"use strict";a.a(e,(async function(e,i){try{a.r(t);var n=a(61701),o=(a(63721),a(71695),a(40251),a(47021),a(87515)),s=a(57243),r=a(50778),c=a(73358),l=a(94947),d=a(75278),u=(a(99426),a(59826),a(83456),a(17170)),h=(a(45708),a(55486),a(99254),a(19993),a(74633),a(1888),a(26779)),p=a(96194),m=a(62992),f=a(69919),k=a(76131),b=e([o,u,h,l,f]);[o,u,h,l,f]=b.then?(await b)():b;let _,v,y,g,w,x,$,C,S,O,j,E,L,z,N,T=e=>e;(0,n.Z)([(0,r.Mo)("more-info-update")],(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.Cb)({attribute:!1})],key:"stateObj",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_releaseNotes",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_markdownLoading",value(){return!0}},{kind:"field",decorators:[(0,r.SB)()],key:"_backupConfig",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_entitySources",value:void 0},{kind:"method",key:"_fetchBackupConfig",value:async function(){const{config:e}=await(0,h.LG)(this.hass);this._backupConfig=e}},{kind:"method",key:"_fetchEntitySources",value:async function(){this._entitySources=await(0,m.m)(this.hass)}},{kind:"method",key:"_computeCreateBackupTexts",value:function(){if(!this.stateObj||!(0,d.e)(this.stateObj,f.EX.BACKUP))return;const e=this._entitySources?(0,f.TN)(this.stateObj,this._entitySources):"generic";if("home_assistant"===e){var t,a;if(!(!!this._backupConfig&&!!this._backupConfig.automatic_backups_configured&&!!this._backupConfig.create_backup.password&&this._backupConfig.create_backup.agent_ids.length>0))return{title:this.hass.localize("ui.dialogs.more_info_control.update.create_backup.manual"),description:this.hass.localize("ui.dialogs.more_info_control.update.create_backup.manual_description")};const e=null!==(t=this._backupConfig)&&void 0!==t&&t.last_completed_automatic_backup?new Date(null===(a=this._backupConfig)||void 0===a?void 0:a.last_completed_automatic_backup):null,i=new Date;return{title:this.hass.localize("ui.dialogs.more_info_control.update.create_backup.automatic"),description:e?this.hass.localize("ui.dialogs.more_info_control.update.create_backup.automatic_description_last",{relative_time:(0,l.G)(e,this.hass.locale,i,!0)}):this.hass.localize("ui.dialogs.more_info_control.update.create_backup.automatic_description_none")}}if("addon"===e){const e=this.stateObj.attributes.installed_version;return{title:this.hass.localize("ui.dialogs.more_info_control.update.create_backup.addon"),description:e?this.hass.localize("ui.dialogs.more_info_control.update.create_backup.addon_description",{version:e}):void 0}}return{title:this.hass.localize("ui.dialogs.more_info_control.update.create_backup.generic")}}},{kind:"method",key:"render",value:function(){var e,t;if(!this.hass||!this.stateObj||(0,p.rk)(this.stateObj.state))return s.Ld;const a=this.stateObj.attributes.latest_version&&this.stateObj.attributes.skipped_version===this.stateObj.attributes.latest_version,i=this._computeCreateBackupTexts();return(0,s.dy)(_||(_=T` <div class="content"> <div class="summary"> ${0} <h3>${0}</h3> ${0} <div class="row"> <div class="key"> ${0} </div> <div class="value"> ${0} </div> </div> <div class="row"> <div class="key"> ${0} </div> <div class="value"> ${0} </div> </div> ${0} </div> ${0} </div> <div class="footer"> ${0} <div class="actions"> ${0} ${0} </div> </div> `),this.stateObj.attributes.in_progress?(0,d.e)(this.stateObj,f.EX.PROGRESS)&&null!==this.stateObj.attributes.update_percentage?(0,s.dy)(v||(v=T`<mwc-linear-progress .progress="${0}" buffer=""></mwc-linear-progress>`),this.stateObj.attributes.update_percentage/100):(0,s.dy)(y||(y=T`<mwc-linear-progress indeterminate></mwc-linear-progress>`)):s.Ld,this.stateObj.attributes.title,this._error?(0,s.dy)(g||(g=T`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):s.Ld,this.hass.formatEntityAttributeName(this.stateObj,"installed_version"),null!==(e=this.stateObj.attributes.installed_version)&&void 0!==e?e:this.hass.localize("state.default.unavailable"),this.hass.formatEntityAttributeName(this.stateObj,"latest_version"),null!==(t=this.stateObj.attributes.latest_version)&&void 0!==t?t:this.hass.localize("state.default.unavailable"),this.stateObj.attributes.release_url?(0,s.dy)(w||(w=T`<div class="row"> <div class="key"> <a href="${0}" target="_blank" rel="noreferrer"> ${0} </a> </div> </div>`),this.stateObj.attributes.release_url,this.hass.localize("ui.dialogs.more_info_control.update.release_announcement")):s.Ld,(0,d.e)(this.stateObj,f.EX.RELEASE_NOTES)&&!this._error?void 0===this._releaseNotes?(0,s.dy)(x||(x=T` <hr> ${0} `),this._markdownLoading?this._renderLoader():s.Ld):(0,s.dy)($||($=T` <hr> <ha-markdown -resize="${0}" .content="${0}" class="${0}"></ha-markdown> ${0} `),this._markdownLoaded,this._releaseNotes,this._markdownLoading?"hidden":"",this._markdownLoading?this._renderLoader():s.Ld):this.stateObj.attributes.release_summary?(0,s.dy)(C||(C=T` <hr> <ha-markdown -resize="${0}" .content="${0}" class="${0}"></ha-markdown> ${0} `),this._markdownLoaded,this.stateObj.attributes.release_summary,this._markdownLoading?"hidden":"",this._markdownLoading?this._renderLoader():s.Ld):s.Ld,i?(0,s.dy)(S||(S=T` <ha-md-list> <ha-md-list-item> <span slot="headline">${0}</span> ${0} <ha-switch slot="end" id="create-backup" .disabled="${0}"></ha-switch> </ha-md-list-item> </ha-md-list> `),i.title,i.description?(0,s.dy)(O||(O=T` <span slot="supporting-text"> ${0} </span> `),i.description):s.Ld,(0,f.Sk)(this.stateObj)):s.Ld,this.stateObj.state===c.lC&&this.stateObj.attributes.skipped_version?(0,s.dy)(j||(j=T` <ha-button ="${0}"> ${0} </ha-button> `),this._handleClearSkipped,this.hass.localize("ui.dialogs.more_info_control.update.clear_skipped")):(0,s.dy)(E||(E=T` <ha-button ="${0}" .disabled="${0}"> ${0} </ha-button> `),this._handleSkip,a||this.stateObj.state===c.lC||(0,f.Sk)(this.stateObj),this.hass.localize("ui.dialogs.more_info_control.update.skip")),(0,d.e)(this.stateObj,f.EX.INSTALL)?(0,s.dy)(L||(L=T` <ha-button ="${0}" .disabled="${0}"> ${0} </ha-button> `),this._handleInstall,this.stateObj.state===c.lC&&!a||(0,f.Sk)(this.stateObj),this.hass.localize("ui.dialogs.more_info_control.update.update")):s.Ld)}},{kind:"method",key:"_renderLoader",value:function(){return(0,s.dy)(z||(z=T` <div class="flex center loader"> <ha-spinner></ha-spinner> </div> `))}},{kind:"method",key:"firstUpdated",value:function(){(0,d.e)(this.stateObj,f.EX.RELEASE_NOTES)&&this._fetchReleaseNotes(),(0,d.e)(this.stateObj,f.EX.BACKUP)&&this._fetchEntitySources().then((()=>{"home_assistant"===(0,f.TN)(this.stateObj,this._entitySources)&&this._fetchBackupConfig()}))}},{kind:"method",key:"_markdownLoaded",value:async function(){this._markdownLoading&&(this._markdownLoading=!1)}},{kind:"method",key:"_fetchReleaseNotes",value:async function(){try{this._releaseNotes=await(0,f.UJ)(this.hass,this.stateObj.entity_id)}catch(e){this._error=e.message}}},{kind:"get",key:"_shouldCreateBackup",value:function(){var e;if(!(0,d.e)(this.stateObj,f.EX.BACKUP))return!1;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("create-backup");return!!t&&t.checked}},{kind:"method",key:"_handleInstall",value:function(){const e={entity_id:this.stateObj.entity_id};this._shouldCreateBackup&&(e.backup=!0),(0,d.e)(this.stateObj,f.EX.SPECIFIC_VERSION)&&this.stateObj.attributes.latest_version&&(e.version=this.stateObj.attributes.latest_version),this.hass.callService("update","install",e)}},{kind:"method",key:"_handleSkip",value:function(){this.stateObj.attributes.auto_update?(0,k.showAlertDialog)(this,{title:this.hass.localize("ui.dialogs.more_info_control.update.auto_update_enabled_title"),text:this.hass.localize("ui.dialogs.more_info_control.update.auto_update_enabled_text")}):this.hass.callService("update","skip",{entity_id:this.stateObj.entity_id})}},{kind:"method",key:"_handleClearSkipped",value:function(){this.hass.callService("update","clear_skipped",{entity_id:this.stateObj.entity_id})}},{kind:"field",static:!0,key:"styles",value(){return(0,s.iv)(N||(N=T`:host{display:flex;flex-direction:column;flex:1;justify-content:space-between}hr{border-color:var(--divider-color);border-bottom:none;margin:16px 0}ha-expansion-panel{margin:16px 0}.summary{margin-bottom:16px}.row{margin:0;display:flex;flex-direction:row;justify-content:space-between}.footer{border-top:1px solid var(--divider-color);background:var(--ha-dialog-surface-background,var(--mdc-theme-surface,#fff));position:sticky;bottom:0;margin:0 -24px 0 -24px;margin-bottom:calc(-1 * max(env(safe-area-inset-bottom),24px));padding-bottom:env(safe-area-inset-bottom);box-sizing:border-box;display:flex;flex-direction:column;align-items:center;overflow:hidden;z-index:10}ha-md-list{width:100%;box-sizing:border-box;margin-bottom:-16px;margin-top:-4px;--md-sys-color-surface:var(
--ha-dialog-surface-background,
var(--mdc-theme-surface, #fff)
)}ha-md-list-item{--md-list-item-leading-space:24px;--md-list-item-trailing-space:24px}.actions{width:100%;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-end;box-sizing:border-box;padding:12px;z-index:1;gap:8px}a{color:var(--primary-color)}.flex.center{display:flex;justify-content:center;align-items:center}mwc-linear-progress{margin-bottom:-8px;margin-top:4px}ha-markdown{direction:ltr;padding-bottom:16px;box-sizing:border-box}ha-markdown.hidden{display:none}.loader{height:80px;box-sizing:border-box;padding-bottom:16px}`))}}]}}),s.oi);i()}catch(_){i(_)}}))},80262:function(e,t,a){"use strict";a.d(t,{L:()=>i});a(71695),a(47021);class i{constructor(e){this._expiration=void 0,this._cache=new Map,this._expiration=e}get(e){return this._cache.get(e)}set(e,t){this._cache.set(e,t),this._expiration&&window.setTimeout((()=>this._cache.delete(e)),this._expiration)}has(e){return this._cache.has(e)}}},58014:function(e,t,a){"use strict";a.d(t,{N:()=>n,G:()=>o});var i=a(18117);const n=(e,t="")=>{const a=document.createElement("a");a.target="_blank",a.href=e,a.download=t,a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),document.body.removeChild(a)},o=e=>{var t;return!(e=>!!e.auth.external&&i.G)(e)||!(null===(t=e.auth.external)||void 0===t||!t.config.downloadFileSupported)}},18117:function(e,t,a){"use strict";a.d(t,{G:()=>i});a(19134),a(5740);const i=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)},23265:function(e,t,a){var i={"./ha-icon":["65981","97406"],"./ha-icon-button-toggle":["79505","80175"],"./ha-svg-icon":["37583"],"./ha-icon-button-group":["45747","97792"],"./ha-svg-icon.ts":["37583"],"./ha-icon.ts":["65981","97406"],"./ha-icon-overflow-menu":["59959","91552","78456","56898","99287","14932"],"./ha-icon-next":["13928","99172"],"./ha-icon-picker":["21393","46379","66031","24199","78943","45760"],"./ha-qr-code.ts":["50634","53750","70472"],"./ha-icon-button-arrow-prev.ts":["54202","41069"],"./ha-icon-button-arrow-prev":["54202","41069"],"./ha-icon-overflow-menu.ts":["59959","91552","78456","56898","99287","14932"],"./ha-alert":["99426","4809"],"./ha-icon-button-next":["4635","51577"],"./ha-icon-button":["23334"],"./ha-icon-button-next.ts":["4635","51577"],"./ha-icon-picker.ts":["21393","46379","66031","24199","78943","45760"],"./ha-icon-button-group.ts":["45747","97792"],"./ha-icon-button-toggle.ts":["79505","80175"],"./ha-icon-button-arrow-next.ts":["54237","21559"],"./ha-icon-button-prev.ts":["5828","43537"],"./ha-icon-prev":["95499","87557"],"./ha-icon-prev.ts":["95499","87557"],"./ha-icon-button.ts":["23334"],"./ha-alert.ts":["99426","4809"],"./ha-icon-button-prev":["5828","43537"],"./ha-qr-code":["50634","53750","70472"],"./ha-icon-next.ts":["13928","99172"],"./ha-icon-button-arrow-next":["54237","21559"]};function n(e){if(!a.o(i,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=i[e],n=t[0];return Promise.all(t.slice(1).map(a.e)).then((function(){return a(n)}))}n.keys=()=>Object.keys(i),n.id=23265,e.exports=n}}]);
//# sourceMappingURL=9524.71989fb9c8afb0ac.js.map