iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 37.2 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[64392],{80785:function(t,e,a){function i(t){return!!t&&(t instanceof Date&&!isNaN(t.valueOf()))}a.d(e,{A:function(){return i}})},380:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{D:function(){return h},P:function(){return c}});a(74423);var n=a(74487),o=a(27734),s=a(46927),r=a(96029),l=t([n]);n=(l.then?(await l)():l)[0];const c=t=>t.first_weekday===s.zt.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(t.language).weekInfo.firstDay%7:(0,o.S)(t.language)%7:r.Z.includes(t.first_weekday)?r.Z.indexOf(t.first_weekday):1,h=t=>{const e=c(t);return r.Z[e]};i()}catch(c){i(c)}})},95747:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{CL:function(){return y},GH:function(){return w},Rl:function(){return p},ZS:function(){return v},aQ:function(){return g},r6:function(){return d},yg:function(){return _}});var n=a(74487),o=a(22786),s=a(72487),r=a(30162),l=a(8480),c=a(69543),h=t([n,l,s,r]);[n,l,s,r]=h.then?(await h)():h;const d=(t,e,a)=>u(e,a.time_zone).format(t),u=(0,o.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,c.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,c.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),p=t=>f().format(t),f=(0,o.A)(()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})),g=(t,e,a)=>m(e,a.time_zone).format(t),m=(0,o.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"short",day:"numeric",hour:(0,c.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,c.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),v=(t,e,a)=>b(e,a.time_zone).format(t),b=(0,o.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"short",day:"numeric",hour:(0,c.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,c.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),y=(t,e,a)=>(new Date).getFullYear()===t.getFullYear()?v(t,e,a):g(t,e,a),_=(t,e,a)=>x(e,a.time_zone).format(t),x=(0,o.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,c.J)(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,c.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),w=(t,e,a)=>`${(0,s.zB)(t,e,a)}, ${(0,r.fU)(t,e,a)}`;i()}catch(d){i(d)}})},98975:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{K:function(){return c}});var n=a(74487),o=a(22786),s=a(63927),r=t([n,s]);[n,s]=r.then?(await r)():r;const l=(0,o.A)(t=>new Intl.RelativeTimeFormat(t.language,{numeric:"auto"})),c=(t,e,a,i=!0)=>{const n=(0,s.x)(t,a,e);return i?l(e).format(n.value,n.unit):Intl.NumberFormat(e.language,{style:"unit",unit:n.unit,unitDisplay:"long"}).format(Math.abs(n.value))};i()}catch(l){i(l)}})},96029:function(t,e,a){a.d(e,{Tq:function(){return s},Z:function(){return n},ZV:function(){return i},sj:function(){return o}});const i=["sun","mon","tue","wed","thu","fri","sat"],n=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],o={0:"sun",1:"mon",2:"tue",3:"wed",4:"thu",5:"fri",6:"sat"},s={sun:"sunday",mon:"monday",tue:"tuesday",wed:"wednesday",thu:"thursday",fri:"friday",sat:"saturday"}},63927:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{x:function(){return p}});var n=a(6946),o=a(52640),s=a(38684),r=a(380),l=t([r]);r=(l.then?(await l)():l)[0];const h=1e3,d=60,u=60*d;function p(t,e=Date.now(),a,i={}){const l=Object.assign(Object.assign({},f),i||{}),c=(+t-+e)/h;if(Math.abs(c)<l.second)return{value:Math.round(c),unit:"second"};const p=c/d;if(Math.abs(p)<l.minute)return{value:Math.round(p),unit:"minute"};const g=c/u;if(Math.abs(g)<l.hour)return{value:Math.round(g),unit:"hour"};const m=new Date(t),v=new Date(e);m.setHours(0,0,0,0),v.setHours(0,0,0,0);const b=(0,n.c)(m,v);if(0===b)return{value:Math.round(g),unit:"hour"};if(Math.abs(b)<l.day)return{value:b,unit:"day"};const y=(0,r.P)(a),_=(0,o.k)(m,{weekStartsOn:y}),x=(0,o.k)(v,{weekStartsOn:y}),w=(0,s.I)(_,x);if(0===w)return{value:b,unit:"day"};if(Math.abs(w)<l.week)return{value:w,unit:"week"};const k=m.getFullYear()-v.getFullYear(),I=12*k+m.getMonth()-v.getMonth();return 0===I?{value:w,unit:"week"}:Math.abs(I)<l.month||0===k?{value:I,unit:"month"}:{value:Math.round(k),unit:"year"}}const f={second:59,minute:59,hour:22,day:5,week:4,month:11};i()}catch(c){i(c)}})},28170:function(t,e,a){a.d(e,{o:function(){return c}});a(62953);var i=a(40445),n=a(5124),o=a(67576),s=a(1087),r=a(83892);let l;class c extends r.x{connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role",this.defaultRole),(0,s.r)(this,"ha-list-item-register",{item:this})}disconnectedCallback(){super.disconnectedCallback(),(0,s.r)(this,"ha-list-item-unregister",{item:this})}activate(){this.click()}constructor(...t){super(...t),this.interactive=!1,this.defaultRole="listitem"}}c.styles=[r.x.styles,(0,n.AH)(l||(l=(t=>t)`:host{--ha-list-item-focus-radius:var(--ha-border-radius-sm);--ha-list-item-focus-width:2px;--ha-list-item-focus-width-start:var(--ha-space-2);--ha-list-item-focus-offset:-2px;--ha-list-item-focus-background:var(--ha-color-fill-neutral-quiet-hover)}:host(:focus){outline:0}.base{border-radius:var(--ha-list-item-focus-radius);outline:var(--ha-list-item-focus-width) solid transparent;outline-offset:var(--ha-list-item-focus-offset);transition:outline-color var(--ha-animation-duration-fast) ease-out,background-color var(--ha-animation-duration-fast) ease-out} ha-list-item-focus-in{from{outline-width:var(--ha-list-item-focus-width-start);outline-offset:calc(-1 * var(--ha-list-item-focus-width-start))}to{outline-width:var(--ha-list-item-focus-width);outline-offset:var(--ha-list-item-focus-offset)}}:host(:focus-visible) .base{outline-color:var(--ha-color-focus);background-color:var(--ha-list-item-focus-background);animation:ha-list-item-focus-in var(--ha-animation-duration-normal) ease-in}`))],(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],c.prototype,"interactive",void 0),c=(0,i.Cg)([(0,o.EM)("ha-list-item-base")],c)},1671:function(t,e,a){a(62953);var i=a(40445),n=a(5124),o=a(67576),s=a(63672),r=(a(54276),a(28170));let l,c,h,d,u=t=>t;class p extends r.o{activate(){var t;null===(t=this._item)||void 0===t||t.click()}_renderBase(t){return void 0!==this.href?(0,n.qy)(l||(l=u`<a part="base" class="base interactive" id="item" href="${0}" target="${0}" rel="${0}" download="${0}" tabindex="-1" aria-disabled="${0}"> ${0}${0} </a>`),(0,s.J)(this.disabled?void 0:this.href),(0,s.J)(this.target),(0,s.J)(this.rel),(0,s.J)(this.download),this.disabled?"true":"false",this._renderRipple(),t):(0,n.qy)(c||(c=u`<button part="base" class="base interactive" id="item" type="button" ?disabled="${0}" tabindex="-1"> ${0}${0} </button>`),this.disabled,this._renderRipple(),t)}_renderRipple(){return(0,n.qy)(h||(h=u`<ha-ripple part="ripple" for="item" ?disabled="${0}"></ha-ripple>`),this.disabled)}constructor(...t){super(...t),this.interactive=!0}}p.styles=[r.o.styles,(0,n.AH)(d||(d=u`:host{cursor:pointer;--ha-ripple-color:var(--primary-text-color)}:host([disabled]){cursor:default}.base.interactive{width:100%;border:none;background:0 0;color:inherit;font:inherit;text-align:inherit;text-decoration:none;appearance:none;cursor:inherit}:host([disabled]) .base.interactive{color:var(--disabled-text-color)}`))],(0,i.Cg)([(0,o.MZ)({type:String})],p.prototype,"href",void 0),(0,i.Cg)([(0,o.MZ)({type:String})],p.prototype,"target",void 0),(0,i.Cg)([(0,o.MZ)({type:String})],p.prototype,"rel",void 0),(0,i.Cg)([(0,o.MZ)({type:String})],p.prototype,"download",void 0),(0,i.Cg)([(0,o.P)("#item")],p.prototype,"_item",void 0),p=(0,i.Cg)([(0,o.EM)("ha-list-item-button")],p)},83892:function(t,e,a){a.d(e,{x:function(){return g}});a(18111),a(13579),a(27495),a(42762),a(62953);var i=a(40445),n=a(92070),o=a(5124),s=a(67576);let r,l,c,h,d,u,p,f=t=>t;class g extends o.WF{_onSlotChange(t){return e=>{const a=e.target.assignedNodes({flatten:!0}).some(t=>{var e;return t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&""!==(null===(e=t.textContent)||void 0===e?void 0:e.trim())});"start"===t?this._hasStart=a:this._hasEnd=a}}render(){return this._renderBase(this._renderInner())}_renderBase(t){return(0,o.qy)(r||(r=f`<div part="base" class="base" id="item">${0}</div>`),t)}_renderInner(){const t=this._slotController.test("content");return(0,o.qy)(l||(l=f` <div part="start" class="start" ?hidden="${0}"> <slot name="start" ="${0}"></slot> </div> <div part="content" class="content"> ${0} </div> <div part="end" class="end" ?hidden="${0}"> <slot name="end" ="${0}"></slot> </div> `),!this._hasStart,this._onSlotChange("start"),t?(0,o.qy)(c||(c=f`<slot name="content"></slot>`)):this._renderDefaultContent(),!this._hasEnd,this._onSlotChange("end"))}_renderDefaultContent(){var t,e;const a=this._slotController.test("headline"),i=this._slotController.test("supporting-text"),n=a||void 0!==this.headline,s=i||void 0!==this.supportingText;return(0,o.qy)(h||(h=f` ${0} ${0} `),n?(0,o.qy)(d||(d=f`<div part="headline" class="headline"> <slot name="headline">${0}</slot> </div>`),null!==(t=this.headline)&&void 0!==t?t:o.s6):o.s6,s?(0,o.qy)(u||(u=f`<div part="supporting-text" class="supporting"> <slot name="supporting-text">${0}</slot> </div>`),null!==(e=this.supportingText)&&void 0!==e?e:o.s6):o.s6)}constructor(...t){super(...t),this.disabled=!1,this._slotController=new n.X(this,"headline","supporting-text","content"),this._hasStart=!1,this._hasEnd=!1}}g.styles=(0,o.AH)(p||(p=f`:host{display:block;color:var(--primary-text-color);font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal)}:host([disabled]){color:var(--disabled-text-color);pointer-events:none}.base{position:relative;display:flex;flex-direction:row;align-items:center;gap:var(--ha-row-item-gap,var(--ha-space-4));padding-block:var(--ha-row-item-padding-block,var(--ha-space-3));padding-inline:var(--ha-row-item-padding-inline,var(--ha-space-4));min-height:var(--ha-row-item-min-height,48px);box-sizing:border-box}.content{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;justify-content:center}.end,.start{display:flex;align-items:center;flex:0 0 auto}.end[hidden],.start[hidden]{display:none}.headline{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.supporting{color:var(--secondary-text-color);font-size:var(--ha-font-size-s);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}`)),(0,i.Cg)([(0,s.MZ)({type:String})],g.prototype,"headline",void 0),(0,i.Cg)([(0,s.MZ)({type:String,attribute:"supporting-text"})],g.prototype,"supportingText",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],g.prototype,"disabled",void 0),(0,i.Cg)([(0,s.wk)()],g.prototype,"_hasStart",void 0),(0,i.Cg)([(0,s.wk)()],g.prototype,"_hasEnd",void 0),g=(0,i.Cg)([(0,s.EM)("ha-row-item")],g)},50723:function(t,e,a){a.d(e,{N:function(){return p}});a(74423),a(26910),a(18111),a(22489),a(7588),a(62953);var i=a(40445),n=a(5124),o=a(67576),s=a(91335);a(44114),a(94490);const r=t=>{const e=[];let a=t;for(;a;){e.push(a);const t=a.parentNode;if(t instanceof ShadowRoot)a=t.host;else if(t)a=t;else{const t=a.getRootNode();a=t instanceof ShadowRoot?t.host:null}}return e.reverse()},l=(t,e)=>{if(t===e)return 0;const a=r(t),i=r(e);let n=0;for(;n<a.length&&n<i.length&&a[n]===i[n];)n++;return 0===n?0:n===a.length?-1:n===i.length?1:a[n].compareDocumentPosition(i[n])&Node.DOCUMENT_POSITION_FOLLOWING?-1:1};var c=a(1087);let h,d,u=t=>t;class p extends n.WF{connectedCallback(){super.connectedCallback(),this.hasAttribute("ha-list")||this.setAttribute("ha-list",""),!this.hasAttribute("role")&&this.hostRole&&this.setAttribute("role",this.hostRole),this._unbindKeys=(0,s.Tc)(this,{ArrowDown:this._onForward,ArrowUp:this._onBack,Home:this._onHome,End:this._onEnd,Enter:this._onActivate,Space:this._onActivate}),this.addEventListener("focusin",this._onFocusIn),this.addEventListener("ha-list-item-register",this._onItemRegister),this.addEventListener("ha-list-item-unregister",this._onItemUnregister)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._unbindKeys)||void 0===t||t.call(this),this._unbindKeys=void 0,this.removeEventListener("focusin",this._onFocusIn),this.removeEventListener("ha-list-item-register",this._onItemRegister),this.removeEventListener("ha-list-item-unregister",this._onItemUnregister)}focus(t){this.items.length?this.focusItemAtIndex(this._activeItemIndex>=0?this._activeItemIndex:0):super.focus(t)}focusItemAtIndex(t){t<0||this.setActiveItemIndex(t,!0)}getActiveItemIndex(){return this._activeItemIndex}setActiveItemIndex(t,e=!1){this._hasFocusableItem?(this._activeItemIndex=Math.max(0,Math.min(this.items.length-1,t)),this._isFocusable(this._activeItemIndex)||(this._activeItemIndex=this._firstFocusableIndex),this._applyActive(e)):this._activeItemIndex=-1}updateListItems(){this._recomputeFocusableIndexes(),(this._activeItemIndex>=this.items.length||!this._hasFocusableItem||this._activeItemIndex<0)&&(this._activeItemIndex=this._firstFocusableIndex),this._applyActive(!1)}_recomputeFocusableIndexes(){let t=-1,e=-1;for(let a=0;a<this.items.length;a++)this._isFocusable(a)&&(-1===t&&(t=a),e=a);this._firstFocusableIndex=t,this._lastFocusableIndex=e,this._hasFocusableItem=-1!==t}render(){return(0,n.qy)(h||(h=u`<div part="base" class="base"> <slot></slot> </div>`))}_isFocusable(t){const e=this.items[t];return!!e&&e.interactive&&!e.disabled}_applyActive(t){var e;(this.items.forEach((t,e)=>{t.interactive&&!t.disabled?t.tabIndex=e===this._activeItemIndex?0:-1:t.removeAttribute("tabindex")}),t&&this._activeItemIndex>=0)&&(null===(e=this.items[this._activeItemIndex])||void 0===e||e.focus())}_moveFocus(t,e){!this._hasFocusableItem||e<0||e===this._activeItemIndex||(t.preventDefault(),this._activeItemIndex=e,this._applyActive(!0))}_stepIndex(t,e){const a=this.items.length;if(!a||!this._hasFocusableItem)return t;let i=t;for(let n=0;n<a;n++){if(i+=e,i<0||i>=a){if(!this.wrapFocus)return t;i=(i+a)%a}if(this._isFocusable(i))return i}return t}constructor(...t){super(...t),this.wrapFocus=!1,this.ariaLabel=null,this.items=[],this.hostRole="list",this._activeItemIndex=-1,this._firstFocusableIndex=-1,this._lastFocusableIndex=-1,this._hasFocusableItem=!1,this._onItemRegister=t=>{t.stopPropagation();const e=t.detail.item;if(this.items.includes(e))return;const a=[...this.items,e];a.sort(l),this.items=a,this.updateListItems()},this._onItemUnregister=t=>{t.stopPropagation();const e=t.detail.item;this.items.includes(e)&&(this.items=this.items.filter(t=>t!==e),this.updateListItems())},this._onFocusIn=t=>{const e=t.composedPath();for(let a=0;a<this.items.length;a++)if(e.includes(this.items[a]))return void(a!==this._activeItemIndex&&(this._activeItemIndex=a,this._applyActive(!1)))},this._onForward=t=>{this._moveFocus(t,this._stepIndex(this._activeItemIndex,1))},this._onBack=t=>{this._moveFocus(t,this._stepIndex(this._activeItemIndex,-1))},this._onHome=t=>{this._moveFocus(t,this._firstFocusableIndex)},this._onEnd=t=>{this._moveFocus(t,this._lastFocusableIndex)},this._onActivate=t=>{if(!this._isFocusable(this._activeItemIndex))return;t.preventDefault();const e=this.items[this._activeItemIndex];e.activate(),(0,c.r)(this,"ha-list-activated",{index:this._activeItemIndex,item:e})}}}p.styles=(0,n.AH)(d||(d=u`:host{display:block}.base{display:flex;flex-direction:column;gap:var(--ha-list-gap,0);padding:var(--ha-list-padding,0);margin:0;list-style:none}`)),(0,i.Cg)([(0,o.MZ)({type:Boolean,attribute:"wrap-focus"})],p.prototype,"wrapFocus",void 0),(0,i.Cg)([(0,o.MZ)({type:String,attribute:"aria-label",reflect:!0})],p.prototype,"ariaLabel",void 0),p=(0,i.Cg)([(0,o.EM)("ha-list-base")],p)},47819:function(t,e,a){a(62953);var i=a(40445),n=a(5124),o=a(67576),s=a(63672),r=a(50723);let l,c=t=>t;class h extends r.N{render(){var t;return(0,n.qy)(l||(l=c`<nav part="nav" aria-label="${0}"> <div part="base" class="base" role="list"> <slot></slot> </div> </nav>`),(0,s.J)(null!==(t=this.ariaLabel)&&void 0!==t?t:void 0))}constructor(...t){super(...t),this.hostRole="",this.ariaLabel=null}}(0,i.Cg)([(0,o.MZ)({type:String,attribute:"aria-label",reflect:!1})],h.prototype,"ariaLabel",void 0),h=(0,i.Cg)([(0,o.EM)("ha-list-nav")],h)},31420:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{Bi:function(){return L},Dt:function(){return X},EB:function(){return z},IW:function(){return F},P_:function(){return $},SG:function(){return M},Sx:function(){return J},T2:function(){return v},Xm:function(){return y},Ye:function(){return b},Zm:function(){return E},cq:function(){return T},dH:function(){return S},en:function(){return Y},gF:function(){return x},gb:function(){return _},gv:function(){return Z},jU:function(){return B},kI:function(){return A},mF:function(){return D},mu:function(){return C},oJ:function(){return W},pI:function(){return k},pL:function(){return V},q5:function(){return q},q7:function(){return R},qk:function(){return m},sp:function(){return P},uM:function(){return K},v3:function(){return N},xN:function(){return G},yL:function(){return w},yj:function(){return H},zZ:function(){return I}});a(74423),a(26910),a(54743),a(11745),a(16573),a(78100),a(77936),a(18111),a(22489),a(20116),a(7588),a(61701),a(3362),a(27495),a(25440),a(21489),a(48140),a(75044),a(21903),a(91134),a(28845),a(373),a(37467),a(44732),a(79577),a(16632),a(34226),a(9486),a(20456),a(62953),a(48408),a(14603),a(47566),a(98721);var n=a(22711),o=a(97732),s=a(6226),r=a(22786),l=a(80785),c=a(95747),h=a(30162),d=a(36918),u=a(30039),p=a(39889),f=a(95350),g=t([n,c,h]);[n,c,h]=g.then?(await g)():g;var m=function(t){return t.NEVER="never",t.DAILY="daily",t.CUSTOM_DAYS="custom_days",t}({});const v=["mon","tue","wed","thu","fri","sat","sun"],b=t=>t.sort((t,e)=>v.indexOf(t)-v.indexOf(e)),y=t=>t.callWS({type:"backup/config/info"}),_=(t,e)=>t.callWS(Object.assign({type:"backup/config/update"},e)),x=(t,e)=>{var a,i;return _(t,{create_backup:{agent_ids:e.create_backup.agent_ids,include_folders:null!==(a=e.create_backup.include_folders)&&void 0!==a?a:[],include_database:e.create_backup.include_database,include_addons:null!==(i=e.create_backup.include_addons)&&void 0!==i?i:[],include_all_addons:e.create_backup.include_all_addons,password:e.create_backup.password},retention:e.retention,schedule:e.schedule})},w=(t,e,a)=>`/api/backup/download/${t}?agent_id=${e}${a?`&password=${a}`:""}`,k=t=>t.callWS({type:"backup/info"}),I=(t,e)=>t.callWS({type:"backup/details",backup_id:e}),$=t=>t.callWS({type:"backup/agents/info"}),C=(t,e)=>t.callWS({type:"backup/delete",backup_id:e}),M=(t,e)=>t.callWS(Object.assign({type:"backup/generate"},e)),F=t=>t.callWS({type:"backup/generate_with_automatic_settings"}),S=(t,e)=>t.callWS(Object.assign({type:"backup/restore"},e)),A=async(t,e,a)=>{const i=new FormData;i.append("file",e);const n=new URLSearchParams;return a.forEach(t=>{n.append("agent_id",t)}),(0,p.QE)(t.fetchWithAuth(`/api/backup/upload?${n.toString()}`,{method:"POST",body:i}))},z=t=>{const e=t.find(L);if(e)return e;const a=t.find(B);return a||t[0]},E=(t,e,a,i)=>t.callWS({type:"backup/can_decrypt_on_download",backup_id:e,agent_id:a,password:i}),Z="backup.local",D="hassio.local",W="cloud.cloud",L=t=>[Z,D].includes(t),B=t=>{const[e,a]=t.split(".");return"hassio"===e&&"local"!==a},R=(t,e,a)=>{if(L(e))return t("ui.panel.config.backup.agents.local_agent");const i=a.find(t=>t.agent_id===e),n=e.split(".")[0],o=i?i.name:e.split(".")[1];if(B(e))return o;const s=(0,f.p$)(t,n);return a.filter(t=>t.agent_id.split(".")[0]===n).length>1?`${s}: ${o}`:s},N=t=>Math.max(...Object.values(t.agents).map(t=>t.size)),O=["automatic","app_update","manual"],q=(0,n.z)(t=>t?O:O.filter(t=>"app_update"!==t)),P=(t,e)=>{var a,i;return t.with_automatic_settings?"automatic":!e||null==(null===(a=t.extra_metadata)||void 0===a?void 0:a["supervisor.addon_update"])&&null==(null===(i=t.extra_metadata)||void 0===i?void 0:i["supervisor.app_update"])?"manual":"app_update"},H=(t,e)=>{const a=L(t),i=L(e),n=B(t),o=B(e),s=(t,e)=>t?1:e?2:3,r=s(a,n),l=s(i,o);return r!==l?r-l:t.localeCompare(e)},T=()=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",e="xxxx-xxxx-xxxx-xxxx-xxxx-xxxx-xxxx";let a="";const i=new Uint8Array(34);return crypto.getRandomValues(i),i.forEach((i,n)=>{a+="-"===e[n]?"-":t[i%36]}),a},U=(t,e)=>"data:text/plain;charset=utf-8,"+encodeURIComponent(`${t.localize("ui.panel.config.backup.emergency_kit_file.title")}\n\n${t.localize("ui.panel.config.backup.emergency_kit_file.description")}\n\n${t.localize("ui.panel.config.backup.emergency_kit_file.date")} ${(0,c.r6)(new Date,t.locale,t.config)}\n\n${t.localize("ui.panel.config.backup.emergency_kit_file.instance")}\n${t.config.location_name}\n\n${t.localize("ui.panel.config.backup.emergency_kit_file.url")}\n${t.auth.data.hassUrl}\n\n${t.localize("ui.panel.config.backup.emergency_kit_file.encryption_key")}\n${e}\n\n${t.localize("ui.panel.config.backup.emergency_kit_file.more_info",{link:(0,d.o)(t,"/more-info/backup-emergency-kit")})}`),j=(t,e)=>`home_assistant_backup_emergency_kit_${e?`${e}_`:""}${(0,c.GH)(new Date,t.locale,t.config).replace(",","").replace(" ","_")}.txt`,J=(t,e,a)=>(0,u.R)(U(t,e),j(t,a)),K=(0,o.g)((0,s.a)(new Date,4),45),V=(0,o.g)((0,s.a)(new Date,5),45),Y=(0,r.A)((t,e,a)=>{if((0,l.A)(a))return(0,h.fU)(a,t,e);if("string"==typeof a&&a){const i=a.split(":"),n=(0,o.g)((0,s.a)(new Date,parseInt(i[0])),parseInt(i[1]));return(0,h.fU)(n,t,e)}return`${(0,h.fU)(K,t,e)} - ${(0,h.fU)(V,t,e)}`}),G="application/x-tar",X={file:void 0};i()}catch(v){i(v)}})},16869:function(t,e,a){a.d(e,{B:function(){return o},g:function(){return n}});var i;a(74423),a(27495);const n=window.externalAppV2||window.externalApp||(null===(i=window.webkit)||void 0===i||null===(i=i.messageHandlers)||void 0===i?void 0:i.getExternalAuth)||location.search.includes("external_auth=1"),o=window.externalApp||window.externalAppV2},93758:function(t,e,a){a.d(e,{CO:function(){return h},NS:function(){return c},f$:function(){return o},ok:function(){return s}});a(3362);var i=a(90889),n=a(9899);const o=async t=>(await t.callWS({type:"labs/list"})).features,s=(t,e,a,i,n)=>t.callWS(Object.assign({type:"labs/update",domain:e,preview_feature:a,enabled:i},void 0!==n&&{create_backup:n})),r=t=>t.sendMessagePromise({type:"labs/list"}).then(t=>t.features),l=(t,e)=>t.subscribeEvents((0,n.s)(()=>r(t).then(t=>e.setState(t,!0)),500,!0),"labs_updated"),c=(t,e)=>(0,i.N)("_labFeatures",r,l,t,e),h=(t,e,a,i)=>t.subscribeMessage(i,{type:"labs/subscribe",domain:e,preview_feature:a})},81310:function(t,e,a){a.a(t,async function(t,e){try{a(62953);var i=a(40445),n=a(5124),o=a(67576),s=a(6412),r=a(26218),l=a(91926),c=a(90248),h=a(2054),d=a(14503),u=t([c,h]);[c,h]=u.then?(await u)():u;let p,f,g,m,v,b=t=>t;class y extends n.WF{render(){var t;return(0,n.qy)(p||(p=b` <div class="toolbar ${0}"> <div class="toolbar-content"> ${0} <div class="main-title"> <slot name="header">${0}</slot> </div> <slot name="toolbar-icon"></slot> </div> </div> <div class="${0}" ="${0}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `),(0,s.H)({narrow:this.narrow}),this.mainPage||null!==(t=history.state)&&void 0!==t&&t.root?(0,n.qy)(f||(f=b` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):this.backPath?(0,n.qy)(g||(g=b` <ha-icon-button-arrow-prev href="${0}" .hass="${0}"></ha-icon-button-arrow-prev> `),this.backPath,this.hass):(0,n.qy)(m||(m=b` <ha-icon-button-arrow-prev .hass="${0}" ="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._backTapped),this.header,(0,s.H)({content:!0,"ha-scrollbar":this.scrollable,"not-scrollable":!this.scrollable}),this._saveScrollPos)}_saveScrollPos(t){this._savedScrollPos=t.target.scrollTop}_backTapped(){this.backCallback?this.backCallback():(0,l.OE)()}static get styles(){return[d.dp,(0,n.AH)(v||(v=b`:host{display:block;height:100%;background-color:var(--primary-background-color);overflow:hidden;position:relative}:host([narrow]){width:100%;position:fixed}.toolbar{background-color:var(--app-header-background-color);padding-top:var(--safe-area-inset-top);padding-right:var(--safe-area-inset-right)}:host([narrow]) .toolbar{padding-left:var(--safe-area-inset-left)}.toolbar-content{display:flex;align-items:center;font-size:var(--ha-font-size-xl);height:var(--header-height);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box;padding:8px 12px}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{display:flex;align-items:center;pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{margin-inline-start:var(--ha-space-6);line-height:var(--ha-line-height-normal);min-width:0;flex-grow:1;overflow-wrap:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.narrow .main-title{margin-inline-start:var(--ha-space-2)}.content{position:relative;width:calc(100% - var(--safe-area-inset-right,0px));height:calc(100% - 1px - var(--header-height,0px) - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));padding-bottom:var(--safe-area-inset-bottom,0px);margin-right:var(--safe-area-inset-right);overflow-y:auto;overflow:auto;-webkit-overflow-scrolling:touch}.content.not-scrollable{overflow:hidden;display:flex;flex-direction:column}:host([narrow]) .content{width:calc(100% - var(--safe-area-inset-left,0px) - var(--safe-area-inset-right,0px));margin-left:var(--safe-area-inset-left)}#fab{position:absolute;right:calc(16px + var(--safe-area-inset-right,0px));inset-inline-end:calc(16px + var(--safe-area-inset-right,0px));inset-inline-start:initial;bottom:calc(16px + var(--safe-area-inset-bottom,0px));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--ha-space-2);--ha-button-box-shadow:var(--ha-box-shadow-l)}:host([narrow]) #fab.tabs{bottom:calc(84px + var(--safe-area-inset-bottom,0px))}#fab[is-wide]{bottom:calc(24px + var(--safe-area-inset-bottom,0px));right:calc(24px + var(--safe-area-inset-right,0px));inset-inline-end:calc(24px + var(--safe-area-inset-right,0px));inset-inline-start:initial}`))]}constructor(...t){super(...t),this.mainPage=!1,this.narrow=!1,this.scrollable=!0}}(0,i.Cg)([(0,o.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)()],y.prototype,"header",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,attribute:"main-page"})],y.prototype,"mainPage",void 0),(0,i.Cg)([(0,o.MZ)({type:String,attribute:"back-path"})],y.prototype,"backPath",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],y.prototype,"backCallback",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],y.prototype,"narrow",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],y.prototype,"scrollable",void 0),(0,i.Cg)([(0,r.a)(".content")],y.prototype,"_savedScrollPos",void 0),(0,i.Cg)([(0,o.Ls)({passive:!0})],y.prototype,"_saveScrollPos",null),y=(0,i.Cg)([(0,o.EM)("hass-subpage")],y),e()}catch(p){e(p)}})},22823:function(t,e,a){a(89463),a(18111),a(61701),a(62953);var i=a(40445),n=a(5124),o=a(67576);a(43661),a(67094),a(1671),a(47819);let s,r,l,c,h,d=t=>t;class u extends n.WF{render(){return(0,n.qy)(s||(s=d` <ha-list-nav .ariaLabel="${0}"> ${0} </ha-list-nav> `),this.label,this.pages.map(t=>{const e=t.path.endsWith("#external-app-configuration");return(0,n.qy)(r||(r=d` <ha-list-item-button .href="${0}" ="${0}"> <div slot="start" class="${0}" .style="background-color: ${0}"> <ha-svg-icon .path="${0}" .secondaryPath="${0}" .viewBox="${0}"></ha-svg-icon> </div> <span slot="headline">${0}</span> ${0} ${0} </ha-list-item-button> `),e?void 0:t.path,e?this._handleExternalApp:void 0,t.iconColor?"icon-background":"",t.iconColor||"undefined",t.iconPath,t.iconSecondaryPath,t.iconViewBox,t.name,this.hasSecondary?(0,n.qy)(l||(l=d`<span slot="supporting-text">${0}</span>`),t.description):"",this.narrow?"":(0,n.qy)(c||(c=d`<ha-icon-next slot="end"></ha-icon-next>`)))}))}_handleExternalApp(){this.hass.auth.external.fireMessage({type:"config_screen/show"})}constructor(...t){super(...t),this.narrow=!1,this.hasSecondary=!1}}u.styles=(0,n.AH)(h||(h=d`ha-icon-next,ha-svg-icon{color:var(--secondary-text-color);height:24px;width:24px;display:block}ha-svg-icon{padding:8px}.icon-background{border-radius:var(--ha-border-radius-circle)}.icon-background ha-svg-icon{color:#fff}`)),(0,i.Cg)([(0,o.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],u.prototype,"narrow",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],u.prototype,"pages",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"has-secondary",type:Boolean})],u.prototype,"hasSecondary",void 0),(0,i.Cg)([(0,o.MZ)()],u.prototype,"label",void 0),u=(0,i.Cg)([(0,o.EM)("ha-config-navigation-list")],u)},22235:function(t,e,a){a.a(t,async function(t,i){try{a.r(e);a(72712),a(18111),a(22489),a(20116),a(61701),a(18237),a(13579),a(3362),a(62953);var n=a(40445),o=a(5124),s=a(67576),r=a(63708),l=a(36312),c=a(98975),h=a(67258),d=(a(76776),a(26300)),u=a(31420),p=a(71117),f=a(31462),g=a(15336),m=a(93758),v=a(9835),b=a(81310),y=a(14503),_=(a(22823),a(20820),a(25635)),x=t([d,b,c,u]);[d,b,c,u]=x.then?(await x)():x;let w,k,I=t=>t;const $="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";class C extends o.WF{render(){const t=_.configSections.general.filter(t=>(0,r.fW)(this.hass,t)).map(t=>{let e;switch(t.translationKey){case"backup":e=this._latestBackupDate?this.hass.localize("ui.panel.config.backup.description",{relative_time:(0,c.K)(this._latestBackupDate,this.hass.locale)}):this.hass.localize("ui.panel.config.backup.description_no_backup");break;case"network":e=this.hass.localize("ui.panel.config.network.description",{state:this._externalAccess?this.hass.localize("ui.panel.config.network.enabled"):this.hass.localize("ui.panel.config.network.disabled")});break;case"storage":e=this._storageInfo?this.hass.localize("ui.panel.config.storage.description",{percent_used:`${Math.round((this._storageInfo.total-this._storageInfo.free)/this._storageInfo.total*100)}${(0,h.d)(this.hass.locale)}%`,free_space:`${this._storageInfo.free} GB`}):"";break;case"hardware":e=this._boardName||this.hass.localize("ui.panel.config.hardware.description");break;case"labs":e=this._labFeatures&&this._labFeatures.some(t=>t.enabled)?this.hass.localize("ui.panel.config.labs.description_enabled"):this.hass.localize("ui.panel.config.labs.description");break;default:e=this.hass.localize(`ui.panel.config.${t.translationKey}.description`)}return Object.assign(Object.assign({},t),{},{name:t.translationKey?this.hass.localize(`ui.panel.config.${t.translationKey}.caption`):t.name,description:e})});return(0,o.qy)(w||(w=I` <hass-subpage .hass="${0}" back-path="/config" .header="${0}" .narrow="${0}"> <ha-icon-button slot="toolbar-icon" .path="${0}" .label="${0}" ="${0}"></ha-icon-button> <ha-config-section .narrow="${0}" .isWide="${0}" full-width> <ha-card outlined> <ha-config-navigation-list .hass="${0}" .narrow="${0}" .pages="${0}" has-secondary .label="${0}"></ha-config-navigation-list> </ha-card> </ha-config-section> </hass-subpage> `),this.hass,this.hass.localize("ui.panel.config.dashboard.system.main"),this.narrow,$,this.hass.localize("ui.panel.config.system_dashboard.restart_homeassistant"),this._showRestartDialog,this.narrow,this.isWide,this.hass,this.narrow,t,this.hass.localize("ui.panel.config.dashboard.system.main"))}firstUpdated(t){super.firstUpdated(t),this._fetchNetworkStatus();const e=(0,l.x)(this.hass.config,"hassio");this._fetchBackupInfo(),this._fetchHardwareInfo(e),this._fetchLabFeatures(),e&&this._fetchStorageInfo()}async _fetchBackupInfo(){const t=(0,l.x)(this.hass.config,"backup")?await(0,u.pI)(this.hass).then(t=>t.backups):[];t.length>0&&(this._latestBackupDate=t.map(t=>new Date(t.date)).reduce((t,e)=>t>e?t:e))}async _fetchHardwareInfo(t){if((0,l.x)(this.hass.config,"hardware")){var e;const t=await this.hass.callWS({type:"hardware/info"});this._boardName=null==t||null===(e=t.hardware.find(t=>null!==t.board))||void 0===e?void 0:e.name}else if(t){const t=await(0,g.PB)(this.hass);t.board&&(this._boardName=f.S[t.board])}}async _fetchStorageInfo(){const t=await(0,g.Ku)(this.hass);this._storageInfo={used:t.disk_used,free:t.disk_free,total:t.disk_total}}async _fetchNetworkStatus(){if((0,l.x)(this.hass.config,"cloud")){if((await(0,p.eN)(this.hass)).logged_in)return void(this._externalAccess=!0)}this._externalAccess=null!=this.hass.config.external_url}async _fetchLabFeatures(){(0,l.x)(this.hass.config,"labs")&&(this._labFeatures=await(0,m.f$)(this.hass))}async _showRestartDialog(){(0,v.lD)(this)}static get styles(){return[y.RF,(0,o.AH)(k||(k=I`:host(:not([narrow])) ha-card{margin-bottom:max(24px,var(--safe-area-inset-bottom))}ha-config-section{margin:auto;margin-top:-32px;max-width:600px}ha-card{overflow:hidden;margin-bottom:24px;margin-bottom:max(24px,var(--safe-area-inset-bottom))}ha-card a{text-decoration:none;color:var(--primary-text-color)}.title{font-size:var(--ha-font-size-l);padding:16px;padding-bottom:0}.restart-section{display:flex;align-items:center;flex-direction:column;justify-content:center;margin-bottom:24px} all and (max-width:600px){ha-card{border-width:1px 0;border-radius:var(--ha-border-radius-square);box-shadow:unset}ha-config-section{margin-top:-42px}}`))]}constructor(...t){super(...t),this.narrow=!1,this.isWide=!1,this._externalAccess=!1}}(0,n.Cg)([(0,s.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,n.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],C.prototype,"narrow",void 0),(0,n.Cg)([(0,s.MZ)({attribute:"is-wide",type:Boolean})],C.prototype,"isWide",void 0),(0,n.Cg)([(0,s.MZ)({attribute:!1})],C.prototype,"cloudStatus",void 0),(0,n.Cg)([(0,s.wk)()],C.prototype,"_latestBackupDate",void 0),(0,n.Cg)([(0,s.wk)()],C.prototype,"_boardName",void 0),(0,n.Cg)([(0,s.wk)()],C.prototype,"_storageInfo",void 0),(0,n.Cg)([(0,s.wk)()],C.prototype,"_externalAccess",void 0),(0,n.Cg)([(0,s.wk)()],C.prototype,"_labFeatures",void 0),C=(0,n.Cg)([(0,s.EM)("ha-config-system-navigation")],C),i()}catch(w){i(w)}})},20820:function(t,e,a){a(62953);var i=a(40445),n=a(5124),o=a(67576),s=a(6412);let r,l,c=t=>t;class h extends n.WF{render(){return(0,n.qy)(r||(r=c` <div class="content ${0}"> <div class="header"><slot name="header"></slot></div> <div class="together layout ${0}"> <div class="intro"><slot name="introduction"></slot></div> <div class="panel flex-auto"><slot></slot></div> </div> </div> `),(0,s.H)({narrow:!this.isWide,"full-width":this.fullWidth}),(0,s.H)({narrow:!this.isWide,vertical:this.vertical||!this.isWide,horizontal:!this.vertical&&this.isWide}))}constructor(...t){super(...t),this.isWide=!1,this.vertical=!1,this.fullWidth=!1}}h.styles=(0,n.AH)(l||(l=c`:host{display:block}.content{padding:28px 20px 0;max-width:1040px;margin:0 auto}.layout{display:flex}.horizontal{flex-direction:row}.vertical{flex-direction:column}.flex-auto{flex:1 1 auto}.header{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed);opacity:var(--dark-primary-opacity)}.together{margin-top:var(--config-section-content-together-margin-top,32px)}.intro{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal);width:100%;opacity:var(--dark-primary-opacity);font-size:var(--ha-font-size-m);padding-bottom:20px}.horizontal .intro{max-width:400px;margin-right:40px;margin-inline-end:40px;margin-inline-start:initial}.panel{margin-top:-24px}.panel ::slotted(*){margin-top:24px;display:block}.narrow.content{max-width:640px}.narrow .together{margin-top:var(--config-section-narrow-content-together-margin-top,var(--config-section-content-together-margin-top,20px))}.narrow .intro{padding-bottom:20px;margin-right:0;margin-inline-end:0;margin-inline-start:initial;max-width:500px}.full-width{padding:0}.full-width .layout{flex-direction:column}`)),(0,i.Cg)([(0,o.MZ)({attribute:"is-wide",type:Boolean})],h.prototype,"isWide",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],h.prototype,"vertical",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,attribute:"full-width"})],h.prototype,"fullWidth",void 0),h=(0,i.Cg)([(0,o.EM)("ha-config-section")],h)},36918:function(t,e,a){a.d(e,{o:function(){return i}});const i=(t,e)=>`https://www.iobroker.net/#${t.language&&t.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},30039:function(t,e,a){a.d(e,{R:function(){return n}});a(62953),a(3296),a(27208),a(48408),a(14603),a(47566),a(98721);var i=a(16869);const n=(t,e="")=>{const a=document.createElement("a");a.target="_blank",a.href=t,a.download=e,a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),document.body.removeChild(a),t.startsWith("blob:")&&(i.B?setTimeout(()=>URL.revokeObjectURL(t),1e4):URL.revokeObjectURL(t))}}}]);