iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
45 lines • 147 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[10142],{36356:function(t,e,a){a.d(e,{q:function(){return i}});class i{get enabled(){return this._enabled}set enabled(t){t!==this._enabled&&(this._enabled=t,this._enabled?this._attach():this._detach(),this._host.requestUpdate())}hostUpdated(){this.enabled&&!this._scrollContainer&&this._attach()}hostDisconnected(){this._detach()}_attach(){var t;this._scrollContainer=null===(t=this._host.renderRoot)||void 0===t?void 0:t.querySelector(this._selector),this._scrollContainer&&this._scrollContainer.addEventListener("mousedown",this._mouseDown)}_detach(){window.removeEventListener("mousemove",this._mouseMove),window.removeEventListener("mouseup",this._mouseUp),this._scrollContainer&&(this._scrollContainer.removeEventListener("mousedown",this._mouseDown),this._scrollContainer=void 0),this.scrolled=!1,this.scrolling=!1,this.mouseIsDown=!1,this.scrollStartX=0,this.scrollLeft=0}constructor(t,{selector:e,enabled:a}){this.mouseIsDown=!1,this.scrolled=!1,this.scrolling=!1,this.scrollStartX=0,this.scrollLeft=0,this._enabled=!0,this._mouseDown=t=>{const e=this._scrollContainer;e&&(this.scrollStartX=t.pageX-e.offsetLeft,this.scrollLeft=e.scrollLeft,this.mouseIsDown=!0,this.scrolled=!1,window.addEventListener("mousemove",this._mouseMove),window.addEventListener("mouseup",this._mouseUp,{once:!0}))},this._mouseUp=()=>{this.mouseIsDown=!1,this.scrolling=!1,this._host.requestUpdate(),window.removeEventListener("mousemove",this._mouseMove)},this._mouseMove=t=>{if(!this.mouseIsDown)return;const e=this._scrollContainer;if(!e)return;const a=t.pageX-e.offsetLeft-this.scrollStartX;this.scrolled||(this.scrolled=Math.abs(a)>1,this.scrolling=this.scrolled,this._host.requestUpdate()),e.scrollLeft=this.scrollLeft-a},this._selector=e,this._host=t,this.enabled=null==a||a,t.addController(this)}}},380:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{D:function(){return h},P:function(){return l}});a(74423);var s=a(74487),n=a(27734),o=a(46927),r=a(96029),c=t([s]);s=(c.then?(await c)():c)[0];const l=t=>t.first_weekday===o.zt.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(t.language).weekInfo.firstDay%7:(0,n.S)(t.language)%7:r.Z.includes(t.first_weekday)?r.Z.indexOf(t.first_weekday):1,h=t=>{const e=l(t);return r.Z[e]};i()}catch(l){i(l)}})},95747:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{CL:function(){return _},GH:function(){return k},Rl:function(){return p},ZS:function(){return b},aQ:function(){return f},r6:function(){return d},yg:function(){return y}});var s=a(74487),n=a(22786),o=a(72487),r=a(30162),c=a(8480),l=a(69543),h=t([s,c,o,r]);[s,c,o,r]=h.then?(await h)():h;const d=(t,e,a)=>u(e,a.time_zone).format(t),u=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,l.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.J)(t)?"h12":"h23",timeZone:(0,c.wj)(t.time_zone,e)})),p=t=>g().format(t),g=(0,n.A)(()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})),f=(t,e,a)=>v(e,a.time_zone).format(t),v=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"short",day:"numeric",hour:(0,l.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.J)(t)?"h12":"h23",timeZone:(0,c.wj)(t.time_zone,e)})),b=(t,e,a)=>m(e,a.time_zone).format(t),m=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"short",day:"numeric",hour:(0,l.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.J)(t)?"h12":"h23",timeZone:(0,c.wj)(t.time_zone,e)})),_=(t,e,a)=>(new Date).getFullYear()===t.getFullYear()?b(t,e,a):f(t,e,a),y=(t,e,a)=>w(e,a.time_zone).format(t),w=(0,n.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,l.J)(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,l.J)(t)?"h12":"h23",timeZone:(0,c.wj)(t.time_zone,e)})),k=(t,e,a)=>`${(0,o.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 l}});var s=a(74487),n=a(22786),o=a(63927),r=t([s,o]);[s,o]=r.then?(await r)():r;const c=(0,n.A)(t=>new Intl.RelativeTimeFormat(t.language,{numeric:"auto"})),l=(t,e,a,i=!0)=>{const s=(0,o.x)(t,a,e);return i?c(e).format(s.value,s.unit):Intl.NumberFormat(e.language,{style:"unit",unit:s.unit,unitDisplay:"long"}).format(Math.abs(s.value))};i()}catch(c){i(c)}})},8480:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{fL:function(){return p},n2:function(){return g},wj:function(){return f}});var s,n,o,r=a(74487),c=a(29079),l=a(46927),h=t([r]);r=(h.then?(await h)():h)[0];const d=null===(s=Intl.DateTimeFormat)||void 0===s||null===(n=(o=s.call(Intl)).resolvedOptions)||void 0===n?void 0:n.call(o).timeZone,u=d&&("UTC"===d||"Etc/UTC"===d||d in c)?d:void 0,p=14881==a.j?void 0!==u:null,g=null!=u?u:"UTC",f=(t,e)=>t===l.Wj.local&&u?g:e;i()}catch(d){i(d)}})},96029:function(t,e,a){a.d(e,{Tq:function(){return o},Z:function(){return s},ZV:function(){return i},sj:function(){return n}});const i=["sun","mon","tue","wed","thu","fri","sat"],s=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],n={0:"sun",1:"mon",2:"tue",3:"wed",4:"thu",5:"fri",6:"sat"},o={sun:"sunday",mon:"monday",tue:"tuesday",wed:"wednesday",thu:"thursday",fri:"friday",sat:"saturday"}},93421:function(t,e,a){a.d(e,{IW:function(){return h},dH:function(){return l},fI:function(){return c}});a(44114),a(62953);var i=a(35211),s=a(22792),n=a(32172);const o=(t,e)=>{let a=t;for(const i of e){if(null==a)return;a=a[i]}return a},r=(t,e,a)=>{const s=(0,n.p)({transformer:function(t){return a.call(this,t)},watch:e?[e]:[]}),o=(0,i.Fg)({context:t,subscribe:!0});return(t,e)=>{s(t,e),o(t,e)}},c=t=>r(s.iN,t.entityIdPath[0],function(e){const a=o(this,t.entityIdPath);return"string"==typeof a?null==e?void 0:e[a]:void 0}),l=t=>r(s.X1,t.entityIdPath[0],function(e){const a=o(this,t.entityIdPath);return"string"==typeof a?null==e?void 0:e[a]:void 0}),h=()=>r(s.D5,void 0,({localize:t})=>t)},93905:function(t,e,a){a.d(e,{I:function(){return n}});a(16280),a(44114),a(18111),a(7588),a(69112),a(33110);class i{addFromStorage(t){if(!this._storage[t]){const e=this.storage.getItem(t);e&&(this._storage[t]=JSON.parse(e))}}subscribeChanges(t,e){return this._listeners[t]?this._listeners[t].push(e):this._listeners[t]=[e],()=>{this.unsubscribeChanges(t,e)}}unsubscribeChanges(t,e){if(!(t in this._listeners))return;const a=this._listeners[t].indexOf(e);-1!==a&&this._listeners[t].splice(a,1)}hasKey(t){return t in this._storage}getValue(t){return this._storage[t]}setValue(t,e){const a=this._storage[t];this._storage[t]=e;try{void 0===e?this.storage.removeItem(t):this.storage.setItem(t,JSON.stringify(e))}catch(i){}finally{this._listeners[t]&&this._listeners[t].forEach(t=>t(a,e))}}constructor(t=window.localStorage){this._storage={},this._listeners={},this.storage=t,this.storage===window.localStorage&&window.addEventListener("storage",t=>{t.key&&this.hasKey(t.key)&&(this._storage[t.key]=t.newValue?JSON.parse(t.newValue):t.newValue,this._listeners[t.key]&&this._listeners[t.key].forEach(e=>e(t.oldValue?JSON.parse(t.oldValue):t.oldValue,this._storage[t.key])))})}}const s={};function n(t){return(e,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const n=t.storage||"localStorage";let o;n&&n in s?o=s[n]:(o=new i(window[n]),s[n]=o);const r=t.key||String(a);o.addFromStorage(r);const c=!1!==t.subscribe?t=>o.subscribeChanges(r,(e,i)=>{t.requestUpdate(a,e)}):void 0,l=()=>o.hasKey(r)?t.deserializer?t.deserializer(o.getValue(r)):o.getValue(r):void 0,h=(e,i)=>{let s;t.state&&(s=l()),o.setValue(r,t.serializer?t.serializer(i):i),t.state&&e.requestUpdate(a,s)},d=e.performUpdate;if(e.performUpdate=function(){this.__initialized=!0,d.call(this)},t.subscribe){const t=e.connectedCallback,a=e.disconnectedCallback;e.connectedCallback=function(){t.call(this);const e=this;e.__unbsubLocalStorage||(e.__unbsubLocalStorage=null==c?void 0:c(this))},e.disconnectedCallback=function(){var t;a.call(this);const e=this;null===(t=e.__unbsubLocalStorage)||void 0===t||t.call(e),e.__unbsubLocalStorage=void 0}}const u=Object.getOwnPropertyDescriptor(e,a);let p;if(void 0===u)p={get(){return l()},set(t){(this.__initialized||void 0===l())&&h(this,t)},configurable:!0,enumerable:!0};else{const t=u.set;p=Object.assign(Object.assign({},u),{},{get(){return l()},set(e){(this.__initialized||void 0===l())&&h(this,e),null==t||t.call(this,e)}})}Object.defineProperty(e,a,p)}}},32172:function(t,e,a){a.d(e,{p:function(){return i}});a(16280),a(18111),a(7588),a(45367),a(92731),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);function i(t){return(e,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const i=String(a),s=e;if(s._transformers){if(!s.hasOwnProperty("_transformers")){const t=s._transformers;s._transformers=new Map,t.forEach((t,e)=>s._transformers.set(e,t))}}else{s._transformers=new Map,s._watching=new Map;const t=s.willUpdate;s.willUpdate=function(e){t.call(this,e);const a=new Set;e.forEach((t,e)=>{const i=this._watching.get(e);void 0!==i&&i.forEach(t=>a.add(t))}),a.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}s._transformers.set(a,t.transformer),t.watch&&t.watch.forEach(t=>{let e=s._watching.get(t);e||(e=new Set,s._watching.set(t,e)),e.add(a)});const n=Object.getOwnPropertyDescriptor(e,a);let o;if(void 0===n)o={get(){return this[`__transform_${i}`]},set(t){const e=this[`__transform_${i}`],a=this._transformers.get(i);this[`__transform_${i}`]=a?a.call(this,t):t,this[`__original_${i}`]=t,this.requestUpdate(i,e)},configurable:!0,enumerable:!0};else{const t=n.set;o=Object.assign(Object.assign({},n),{},{set(e){const a=this[`__transform_${i}`],s=this._transformers.get(i);this[`__transform_${i}`]=s?s.call(this,e):e,this[`__original_${i}`]=e,this.requestUpdate(i,a),null==t||t.call(this,e)}})}Object.defineProperty(e,a,o)}}},68348:function(t,e,a){a.d(e,{u:function(){return i}});a(18111),a(13579);const i=t=>{var e,a;if(t.some(t=>"tagName"in t&&("HA-MENU"===t.tagName||"HA-CODE-EDITOR"===t.tagName)))return!1;const i=t[0];if("TEXTAREA"===i.tagName||"HA-SELECT"===(null===(e=i.parentElement)||void 0===e?void 0:e.tagName)||"HA-DROPDOWN"===(null===(a=i.parentElement)||void 0===a?void 0:a.tagName))return!1;if("INPUT"!==i.tagName)return!0;switch(i.type){case"button":case"checkbox":case"hidden":case"radio":case"range":return!0;default:return!1}}},76830:function(t,e,a){a.d(e,{d:function(){return i}});a(18111),a(20116);const i=(t,e=!0)=>{if(t.defaultPrevented||0!==t.button||t.metaKey||t.ctrlKey||t.shiftKey)return;const a=t.composedPath().find(t=>"A"===t.tagName);if(!a||a.target||a.hasAttribute("download")||"external"===a.getAttribute("rel"))return;let i=a.href;if(!i||-1!==i.indexOf("mailto:"))return;const s=window.location,n=s.origin||s.protocol+"//"+s.host;return i.startsWith(n)&&(i=i.slice(n.length),"#"!==i)?(e&&t.preventDefault(),i):void 0}},17451:function(t,e,a){a.d(e,{j:function(){return i}});const i=(t,e,a)=>(void 0!==a&&(a=!!a),t.hasAttribute(e)?!!a||(t.removeAttribute(e),!1):!1!==a&&(t.setAttribute(e,""),!0))},52943:function(t,e,a){a.d(e,{Z:function(){return i}});const i=t=>t.charAt(0).toUpperCase()+t.slice(1)},19459:function(t,e,a){a.d(e,{b:function(){return i}});a(45367),a(92731),a(84864),a(57465),a(27495),a(69479),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);const i=(t,e,a)=>{if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;let s,n;if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(s=n;0!==s--;)if(!i(t[s],e[s],a))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(s of t.entries())if(!e.has(s[0]))return!1;for(s of t.entries())if(!i(s[1],e.get(s[0]),a))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(s of t.entries())if(!e.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!==e.length)return!1;for(s=n;0!==s--;)if(t[s]!==e[s])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();const o=Object.keys(t);if(n=o.length,n!==Object.keys(e).length)return!1;for(s=n;0!==s--;)if(!Object.prototype.hasOwnProperty.call(e,o[s]))return!1;for(s=n;0!==s--;){const n=o[s];if(!i(t[n],e[n],a))return!1}if(null!=a&&a.compareSymbols){const s=Object.getOwnPropertySymbols(t),n=Object.getOwnPropertySymbols(e);if(s.length!==n.length)return!1;for(const o of s){if(!Object.prototype.hasOwnProperty.call(e,o))return!1;if(!i(t[o],e[o],a))return!1}}return!0}return t!=t&&e!=e}},63927:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{x:function(){return p}});var s=a(6946),n=a(52640),o=a(38684),r=a(380),c=t([r]);r=(c.then?(await c)():c)[0];const h=1e3,d=60,u=60*d;function p(t,e=Date.now(),a,i={}){const c=Object.assign(Object.assign({},g),i||{}),l=(+t-+e)/h;if(Math.abs(l)<c.second)return{value:Math.round(l),unit:"second"};const p=l/d;if(Math.abs(p)<c.minute)return{value:Math.round(p),unit:"minute"};const f=l/u;if(Math.abs(f)<c.hour)return{value:Math.round(f),unit:"hour"};const v=new Date(t),b=new Date(e);v.setHours(0,0,0,0),b.setHours(0,0,0,0);const m=(0,s.c)(v,b);if(0===m)return{value:Math.round(f),unit:"hour"};if(Math.abs(m)<c.day)return{value:m,unit:"day"};const _=(0,r.P)(a),y=(0,n.k)(v,{weekStartsOn:_}),w=(0,n.k)(b,{weekStartsOn:_}),k=(0,o.I)(y,w);if(0===k)return{value:m,unit:"day"};if(Math.abs(k)<c.week)return{value:k,unit:"week"};const x=v.getFullYear()-b.getFullYear(),C=12*x+v.getMonth()-b.getMonth();return 0===C?{value:k,unit:"week"}:Math.abs(C)<c.month||0===x?{value:C,unit:"month"}:{value:Math.round(x),unit:"year"}}const g={second:59,minute:59,hour:22,day:5,week:4,month:11};i()}catch(l){i(l)}})},64481:function(t,e,a){a.d(e,{D:function(){return s},J:function(){return o}});a(16280),a(3362),a(55815),a(64979),a(79739);let i=!1;try{i="true"===window.localStorage.getItem("disableViewTransition")}catch(r){}const s=t=>{i=t},n=t=>{if(!(t=>(t instanceof DOMException||t instanceof Error)&&"AbortError"===t.name)(t))throw t},o=t=>{if(!document.startViewTransition||i)return t(!1),Promise.resolve();let e=!1;try{const a=document.startViewTransition(()=>{e=!0,t(!0)});return a.ready.catch(n),a.finished.catch(n)}catch(a){return console.warn("View transition failed, falling back to direct execution.",a),e?Promise.reject(a):(t(!1),Promise.resolve())}}},38962:function(t,e,a){a.a(t,async function(t,i){try{a.r(e);a(62953);var s=a(40445),n=a(5124),o=a(67576),r=a(6412),c=a(93421),l=a(1087),h=a(26300),d=(a(67094),t([h]));h=(d.then?(await d)():d)[0];let u,p,g,f,v=t=>t;const b="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",m={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class _ extends n.WF{render(){var t;return(0,n.qy)(u||(u=v` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,r.H)({[this.alertType]:!0}),this.title?"":"no-title",m[this.alertType],(0,r.H)({content:!0,narrow:this.narrow}),this.title?(0,n.qy)(p||(p=v`<div class="title">${0}</div>`),this.title):n.s6,this.dismissable?(0,n.qy)(g||(g=v`<ha-icon-button @click="${0}" .label="${0}" .path="${0}"></ha-icon-button>`),this._dismissClicked,null===(t=this._localize)||void 0===t?void 0:t.call(this,"ui.common.dismiss_alert"),b):n.s6)}_dismissClicked(){(0,l.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}_.styles=(0,n.AH)(f||(f=v`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`)),(0,s.Cg)([(0,o.MZ)()],_.prototype,"title",void 0),(0,s.Cg)([(0,o.MZ)({attribute:"alert-type"})],_.prototype,"alertType",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean})],_.prototype,"dismissable",void 0),(0,s.Cg)([(0,o.wk)(),(0,c.IW)()],_.prototype,"_localize",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean})],_.prototype,"narrow",void 0),_=(0,s.Cg)([(0,o.EM)("ha-alert")],_),i()}catch(u){i(u)}})},76776:function(t,e,a){a(62953);var i=a(40445),s=a(5124),n=a(67576);let o,r,c,l=t=>t;class h extends s.WF{render(){return(0,s.qy)(o||(o=l` ${0} <slot></slot> `),this.header?(0,s.qy)(r||(r=l`<h1 class="card-header">${0}</h1>`),this.header):s.s6)}constructor(...t){super(...t),this.raised=!1}}h.styles=(0,s.AH)(c||(c=l`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, var(--ha-font-size-2xl));letter-spacing:-.012em;line-height:var(--ha-line-height-expanded);padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4);display:block;margin-block-start:0;margin-block-end:0;font-weight:var(--ha-font-weight-normal)}
:host
::slotted(
.card-content:not(:nth-child(1 of .card-content, .card-header))
),
slot:not(:first-child)::slotted(.card-content) {
padding-top: 0;
margin-top: calc(var(--ha-space-2) * -1);
}
:host ::slotted(.card-content){padding:var(--ha-space-4)}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:var(--ha-space-2)}`)),(0,i.Cg)([(0,n.MZ)()],h.prototype,"header",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],h.prototype,"raised",void 0),h=(0,i.Cg)([(0,n.EM)("ha-card")],h)},70947:function(t,e,a){a(62953);var i=a(40445),s=a(50759),n=(a(38625),a(5124)),o=a(67576);a(67094);let r,c,l=t=>t;class h extends s.A{renderCheckboxIcon(){return(0,n.qy)(r||(r=l` <ha-svg-icon id="check" part="checkmark" .path="${0}"></ha-svg-icon> `),this.checked?"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z")}static get styles(){return[s.A.styles,(0,n.AH)(c||(c=l`:host{min-height:var(--ha-space-10)}#check{visibility:visible;flex-shrink:0}#icon ::slotted(*){color:var(--ha-color-on-neutral-normal)}:host([variant=danger]) #icon ::slotted(*){color:var(--ha-color-on-danger-quiet)}:host([selected]){font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}:host([selected]:hover){background-color:var(--ha-color-fill-primary-quiet-hover)}`))]}constructor(...t){super(...t),this.selected=!1}}(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],h.prototype,"selected",void 0),h=(0,i.Cg)([(0,o.EM)("ha-dropdown-item")],h)},29823:function(t,e,a){a.a(t,async function(t,e){try{a(3362),a(62953);var i=a(40445),s=a(52254),n=a(5124),o=a(67576),r=t([s]);s=(r.then?(await r)():r)[0];let c,l=t=>t;class h extends s.A{get anchorElement(){var t;return null===(t=this.popup)||void 0===t?void 0:t.anchor}set anchorElement(t){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=t)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!0)}async hideMenu(){const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!1),await super.hideMenu()}static get styles(){return[s.A.styles,(0,n.AH)(c||(c=l`:host{font-size:var(--ha-dropdown-font-size, var(--ha-font-size-m));--wa-color-surface-raised:var(
--card-background-color,
var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)),
)}#menu{padding:var(--ha-space-1)}wa-popup::part(popup){z-index:200}`))]}constructor(...t){super(...t),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,i.Cg)([(0,o.MZ)({attribute:!1})],h.prototype,"dropdownTag",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],h.prototype,"dropdownItemTag",void 0),h=(0,i.Cg)([(0,o.EM)("ha-dropdown")],h),e()}catch(c){e(c)}})},64263:function(t,e,a){a.a(t,async function(t,e){try{a(74423),a(44114),a(18111),a(20116),a(61701),a(3362),a(62953);var i=a(40445),s=a(5124),n=a(67576),o=a(1087),r=a(14503),c=(a(30716),a(11382),a(47680),a(26300)),l=(a(8630),t([c]));c=(l.then?(await l)():l)[0];let h,d,u,p,g,f,v=t=>t;const b="M21 8H3V6H21V8M13.81 16H10V18H13.09C13.21 17.28 13.46 16.61 13.81 16M18 11H6V13H18V11M21.12 15.46L19 17.59L16.88 15.46L15.47 16.88L17.59 19L15.47 21.12L16.88 22.54L19 20.41L21.12 22.54L22.54 21.12L20.41 19L22.54 16.88L21.12 15.46Z";class m extends s.WF{render(){var t,e;if(!this.states)return s.s6;const a=this.states.find(t=>t.icon);return(0,s.qy)(h||(h=v` <ha-expansion-panel left-chevron .expanded="${0}" @expanded-will-change="${0}" @expanded-changed="${0}"> <div slot="header" class="header"> ${0} ${0} </div> ${0} </ha-expansion-panel> `),this.expanded,this._expandedWillChange,this._expandedChanged,this.label,null!==(t=this.value)&&void 0!==t&&t.length?(0,s.qy)(d||(d=v`<div class="badge">${0}</div> <ha-icon-button .path="${0}" @click="${0}"></ha-icon-button>`),null===(e=this.value)||void 0===e?void 0:e.length,b,this._clearFilter):s.s6,this._shouldRender?(0,s.qy)(u||(u=v` <ha-list @selected="${0}" multi class="ha-scrollbar"> ${0} </ha-list> `),this._statesSelected,this.states.map(t=>{var e,i;return(0,s.qy)(p||(p=v`<ha-check-list-item .value="${0}" .selected="${0}" .graphic="${0}"> ${0} ${0} </ha-check-list-item>`),t.value,null!==(e=null===(i=this.value)||void 0===i?void 0:i.includes(t.value))&&void 0!==e&&e,a?"icon":null,t.icon?(0,s.qy)(g||(g=v`<ha-icon slot="graphic" .icon="${0}"></ha-icon>`),t.icon):s.s6,t.label)})):s.s6)}willUpdate(t){t.has("expanded")&&this.expanded&&(this._shouldRender=!0)}updated(t){(t.has("expanded")||t.has("states"))&&this.expanded&&setTimeout(async()=>{if(!this.expanded)return;const t=this._list;t&&(t.style.height=this.clientHeight-49+"px")},300)}_expandedWillChange(t){this._shouldRender=t.detail.expanded}_expandedChanged(t){this.expanded=t.detail.expanded}async _statesSelected(t){if(!t.detail.index.size)return(0,o.r)(this,"data-table-filter-changed",{value:[],items:void 0}),void(this.value=[]);const e=[];for(const a of t.detail.index){const t=this.states[a].value;e.push(t)}this.value=e,(0,o.r)(this,"data-table-filter-changed",{value:e,items:void 0})}_clearFilter(t){t.preventDefault(),this.value=void 0,(0,o.r)(this,"data-table-filter-changed",{value:void 0,items:void 0})}static get styles(){return[r.dp,(0,s.AH)(f||(f=v`:host{border-bottom:1px solid var(--divider-color)}:host([expanded]){flex:1;height:0}ha-expansion-panel{--ha-card-border-radius:var(--ha-border-radius-square);--expansion-panel-content-padding:0}.header{display:flex;align-items:center}.header ha-icon-button{margin-inline-start:auto;margin-inline-end:8px}.badge{display:inline-block;margin-left:8px;margin-inline-start:8px;margin-inline-end:0;min-width:16px;box-sizing:border-box;border-radius:var(--ha-border-radius-circle);font-size:var(--ha-font-size-xs);font-weight:var(--ha-font-weight-normal);background-color:var(--primary-color);line-height:var(--ha-line-height-normal);text-align:center;padding:0px 2px;color:var(--text-primary-color)}`))]}constructor(...t){super(...t),this.narrow=!1,this.expanded=!1,this._shouldRender=!1}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)()],m.prototype,"label",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"value",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"states",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],m.prototype,"narrow",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],m.prototype,"expanded",void 0),(0,i.Cg)([(0,n.wk)()],m.prototype,"_shouldRender",void 0),(0,i.Cg)([(0,n.P)("ha-list")],m.prototype,"_list",void 0),m=(0,i.Cg)([(0,n.EM)("ha-filter-states")],m),e()}catch(h){e(h)}})},90248:function(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaIconButtonArrowPrev:function(){return g}});a(62953);var s=a(40445),n=a(5124),o=a(67576),r=a(63091),c=a(26300),l=t([c]);c=(l.then?(await l)():l)[0];let h,d=t=>t;const u="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",p="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class g extends n.WF{render(){var t;return(0,n.qy)(h||(h=d` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(t=this.hass)||void 0===t?void 0:t.localize("ui.common.back"))||"Back",this._icon,this.href,this.target,this.rel,this.download)}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===r.G.document.dir?p:u}}(0,s.Cg)([(0,o.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean})],g.prototype,"disabled",void 0),(0,s.Cg)([(0,o.MZ)()],g.prototype,"label",void 0),(0,s.Cg)([(0,o.MZ)()],g.prototype,"href",void 0),(0,s.Cg)([(0,o.MZ)()],g.prototype,"target",void 0),(0,s.Cg)([(0,o.MZ)()],g.prototype,"rel",void 0),(0,s.Cg)([(0,o.MZ)()],g.prototype,"download",void 0),(0,s.Cg)([(0,o.wk)()],g.prototype,"_icon",void 0),g=(0,s.Cg)([(0,o.EM)("ha-icon-button-arrow-prev")],g),i()}catch(h){i(h)}})},26300:function(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaIconButton:function(){return f}});a(62953);var s=a(40445),n=a(5124),o=a(67576),r=a(63672),c=a(18350),l=(a(67094),t([c]));c=(l.then?(await l)():l)[0];let h,d,u,p,g=t=>t;class f extends n.WF{render(){return(0,n.qy)(h||(h=g` <ha-button appearance="plain" variant="neutral" aria-label="${0}" title="${0}" aria-haspopup="${0}" .disabled="${0}" .iconTag="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"> ${0} </ha-button> `),(0,r.J)(this.label),(0,r.J)(this.hideTitle?void 0:this.label),(0,r.J)(this.ariaHasPopup),this.disabled,this.path?"ha-svg-icon":"span",this.href,this.target,this.rel,this.download,this.path?(0,n.qy)(d||(d=g`<ha-svg-icon aria-hidden="true" .path="${0}"></ha-svg-icon>`),this.path):(0,n.qy)(u||(u=g`<span><slot></slot></span>`)))}constructor(...t){super(...t),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}f.shadowRootOptions={mode:"open",delegatesFocus:!0},f.styles=(0,n.AH)(p||(p=g`:host{display:inline-block;outline:0;--ha-button-height:var(--ha-icon-button-size, 48px)}ha-button{position:relative;isolation:isolate;--wa-form-control-padding-inline:var(
--ha-icon-button-padding-inline,
--ha-space-2
);--wa-color-on-normal:currentColor;--wa-color-fill-quiet:transparent;--ha-button-label-overflow:visible}ha-button::after{content:"";position:absolute;inset:0;z-index:-1;border-radius:50%;background-color:currentColor;opacity:0;pointer-events:none}ha-button::part(base){width:var(--wa-form-control-height);aspect-ratio:1;outline-offset:-4px}ha-button::part(label){display:flex}:host([selected]) ha-button::after{opacity:.1}@media (hover:hover){:host(:hover:not([disabled])) ha-button::after{opacity:.1}}`)),(0,s.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],f.prototype,"disabled",void 0),(0,s.Cg)([(0,o.MZ)({type:String})],f.prototype,"path",void 0),(0,s.Cg)([(0,o.MZ)({type:String})],f.prototype,"label",void 0),(0,s.Cg)([(0,o.MZ)({type:String,attribute:"aria-haspopup"})],f.prototype,"ariaHasPopup",void 0),(0,s.Cg)([(0,o.MZ)({attribute:"hide-title",type:Boolean})],f.prototype,"hideTitle",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],f.prototype,"selected",void 0),(0,s.Cg)([(0,o.MZ)()],f.prototype,"href",void 0),(0,s.Cg)([(0,o.MZ)()],f.prototype,"target",void 0),(0,s.Cg)([(0,o.MZ)()],f.prototype,"rel",void 0),(0,s.Cg)([(0,o.MZ)()],f.prototype,"download",void 0),f=(0,s.Cg)([(0,o.EM)("ha-icon-button")],f),i()}catch(h){i(h)}})},2054:function(t,e,a){a.a(t,async function(t,e){try{a(16280),a(62953);var i=a(40445),s=a(5124),n=a(67576),o=a(1087),r=a(44249),c=a(26300),l=t([c]);c=(l.then?(await l)():l)[0];let h,d,u,p=t=>t;const g="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class f extends s.WF{connectedCallback(){super.connectedCallback(),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}disconnectedCallback(){super.disconnectedCallback(),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}render(){if(!this._show)return s.s6;const t=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return(0,s.qy)(h||(h=p` <ha-icon-button .label="${0}" .path="${0}" @click="${0}"></ha-icon-button> ${0} `),this.hass.localize("ui.sidebar.sidebar_toggle"),g,this._toggleMenu,t?(0,s.qy)(d||(d=p`<div class="dot"></div>`)):"")}willUpdate(t){if(super.willUpdate(t),!t.has("narrow")&&!t.has("hass"))return;const e=t.has("hass")?t.get("hass"):this.hass,a=t.has("narrow")?t.get("narrow"):this.narrow,i=!1===(null==e?void 0:e.kioskMode)&&(a||"always_hidden"===(null==e?void 0:e.dockedSidebar)),s=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&i===s||(this._show=s||this._alwaysVisible,s?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}_subscribeNotifications(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,r.V)(this.hass.connection,t=>{this._hasNotifications=t.length>0})}_toggleMenu(){(0,o.r)(this,"hass-toggle-menu")}constructor(...t){super(...t),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}f.styles=(0,s.AH)(u||(u=p`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:var(--ha-border-radius-circle);border:2px solid var(--app-header-background-color)}`)),(0,i.Cg)([(0,n.MZ)({type:Boolean})],f.prototype,"narrow",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,i.Cg)([(0,n.wk)()],f.prototype,"_hasNotifications",void 0),(0,i.Cg)([(0,n.wk)()],f.prototype,"_show",void 0),f=(0,i.Cg)([(0,n.EM)("ha-menu-button")],f),e()}catch(h){e(h)}})},54276:function(t,e,a){a(62953);var i=a(40445),s=a(76482),n=a(91382),o=a(96245),r=a(5124),c=a(67576);let l;class h extends n.n{attach(t){super.attach(t),this.attachableTouchController.attach(t)}disconnectedCallback(){super.disconnectedCallback(),this.hovered=!1,this.pressed=!1}detach(){super.detach(),this.attachableTouchController.detach()}_onTouchControlChange(t,e){null==t||t.removeEventListener("touchend",this._handleTouchEnd),null==e||e.addEventListener("touchend",this._handleTouchEnd)}constructor(...t){super(...t),this.attachableTouchController=new s.i(this,this._onTouchControlChange.bind(this)),this._handleTouchEnd=()=>{this.disabled||super.endPressAnimation()}}}h.styles=[o.R,(0,r.AH)(l||(l=(t=>t)`:host{--md-ripple-hover-opacity:var(--ha-ripple-hover-opacity, 0.08);--md-ripple-pressed-opacity:var(--ha-ripple-pressed-opacity, 0.12);--md-ripple-hover-color:var(
--ha-ripple-hover-color,
var(--ha-ripple-color, var(--secondary-text-color))
);--md-ripple-pressed-color:var(
--ha-ripple-pressed-color,
var(--ha-ripple-color, var(--secondary-text-color))
)}`))],h=(0,i.Cg)([(0,c.EM)("ha-ripple")],h)},65829:function(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaSpinner:function(){return d}});var s=a(40445),n=a(55262),o=a(5124),r=a(67576),c=t([n]);n=(c.then?(await c)():c)[0];let l,h=t=>t;class d extends n.A{updated(t){if(super.updated(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")}}static get styles(){return[n.A.styles,(0,o.AH)(l||(l=h`: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)}`))]}}(0,s.Cg)([(0,r.MZ)()],d.prototype,"size",void 0),d=(0,s.Cg)([(0,r.EM)("ha-spinner")],d),i()}catch(l){i(l)}})},67094:function(t,e,a){a.r(e),a.d(e,{HaSvgIcon:function(){return d}});var i=a(40445),s=a(5124),n=a(67576);let o,r,c,l,h=t=>t;class d extends s.WF{render(){return(0,s.JW)(o||(o=h` <svg viewBox="${0}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${0} ${0} </g> </svg>`),this.viewBox||"0 0 24 24",this.path?(0,s.JW)(r||(r=h`<path class="primary-path" d="${0}"></path>`),this.path):s.s6,this.secondaryPath?(0,s.JW)(c||(c=h`<path class="secondary-path" d="${0}"></path>`),this.secondaryPath):s.s6)}}d.styles=(0,s.AH)(l||(l=h`: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)}`)),(0,i.Cg)([(0,n.MZ)()],d.prototype,"path",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],d.prototype,"secondaryPath",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],d.prototype,"viewBox",void 0),d=(0,i.Cg)([(0,n.EM)("ha-svg-icon")],d)},28170:function(t,e,a){a.d(e,{o:function(){return l}});a(62953);var i=a(40445),s=a(5124),n=a(67576),o=a(1087),r=a(83892);let c;class l extends r.x{connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role",this.defaultRole),(0,o.r)(this,"ha-list-item-register",{item:this})}disconnectedCallback(){super.disconnectedCallback(),(0,o.r)(this,"ha-list-item-unregister",{item:this})}activate(){this.click()}constructor(...t){super(...t),this.interactive=!1,this.defaultRole="listitem"}}l.styles=[r.x.styles,(0,s.AH)(c||(c=(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}@keyframes 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,n.MZ)({type:Boolean,reflect:!0})],l.prototype,"interactive",void 0),l=(0,i.Cg)([(0,n.EM)("ha-list-item-base")],l)},1671:function(t,e,a){a(62953);var i=a(40445),s=a(5124),n=a(67576),o=a(63672),r=(a(54276),a(28170));let c,l,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,s.qy)(c||(c=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,o.J)(this.disabled?void 0:this.href),(0,o.J)(this.target),(0,o.J)(this.rel),(0,o.J)(this.download),this.disabled?"true":"false",this._renderRipple(),t):(0,s.qy)(l||(l=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,s.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,s.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,n.MZ)({type:String})],p.prototype,"href",void 0),(0,i.Cg)([(0,n.MZ)({type:String})],p.prototype,"target",void 0),(0,i.Cg)([(0,n.MZ)({type:String})],p.prototype,"rel",void 0),(0,i.Cg)([(0,n.MZ)({type:String})],p.prototype,"download",void 0),(0,i.Cg)([(0,n.P)("#item")],p.prototype,"_item",void 0),p=(0,i.Cg)([(0,n.EM)("ha-list-item-button")],p)},83892:function(t,e,a){a.d(e,{x:function(){return f}});a(18111),a(13579),a(27495),a(42762),a(62953);var i=a(40445),s=a(92070),n=a(5124),o=a(67576);let r,c,l,h,d,u,p,g=t=>t;class f extends n.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,n.qy)(r||(r=g`<div part="base" class="base" id="item">${0}</div>`),t)}_renderInner(){const t=this._slotController.test("content");return(0,n.qy)(c||(c=g` <div part="start" class="start" ?hidden="${0}"> <slot name="start" @slotchange="${0}"></slot> </div> <div part="content" class="content"> ${0} </div> <div part="end" class="end" ?hidden="${0}"> <slot name="end" @slotchange="${0}"></slot> </div> `),!this._hasStart,this._onSlotChange("start"),t?(0,n.qy)(l||(l=g`<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"),s=a||void 0!==this.headline,o=i||void 0!==this.supportingText;return(0,n.qy)(h||(h=g` ${0} ${0} `),s?(0,n.qy)(d||(d=g`<div part="headline" class="headline"> <slot name="headline">${0}</slot> </div>`),null!==(t=this.headline)&&void 0!==t?t:n.s6):n.s6,o?(0,n.qy)(u||(u=g`<div part="supporting-text" class="supporting"> <slot name="supporting-text">${0}</slot> </div>`),null!==(e=this.supportingText)&&void 0!==e?e:n.s6):n.s6)}constructor(...t){super(...t),this.disabled=!1,this._slotController=new s.X(this,"headline","supporting-text","content"),this._hasStart=!1,this._hasEnd=!1}}f.styles=(0,n.AH)(p||(p=g`: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,o.MZ)({type:String})],f.prototype,"headline",void 0),(0,i.Cg)([(0,o.MZ)({type:String,attribute:"supporting-text"})],f.prototype,"supportingText",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],f.prototype,"disabled",void 0),(0,i.Cg)([(0,o.wk)()],f.prototype,"_hasStart",void 0),(0,i.Cg)([(0,o.wk)()],f.prototype,"_hasEnd",void 0),f=(0,i.Cg)([(0,o.EM)("ha-row-item")],f)},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),s=a(5124),n=a(67576),o=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()},c=(t,e)=>{if(t===e)return 0;const a=r(t),i=r(e);let s=0;for(;s<a.length&&s<i.length&&a[s]===i[s];)s++;return 0===s?0:s===a.length?-1:s===i.length?1:a[s].compareDocumentPosition(i[s])&Node.DOCUMENT_POSITION_FOLLOWING?-1:1};var l=a(1087);let h,d,u=t=>t;class p extends s.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,o.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,s.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 s=0;s<a;s++){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(c),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,l.r)(this,"ha-list-activated",{index:this._activeItemIndex,item:e})}}}p.styles=(0,s.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,n.MZ)({type:Boolean,attribute:"wrap-focus"})],p.prototype,"wrapFocus",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"aria-label",reflect:!0})],p.prototype,"ariaLabel",void 0),p=(0,i.Cg)([(0,n.EM)("ha-list-base")],p)},47819:function(t,e,a){a(62953);var i=a(40445),s=a(5124),n=a(67576),o=a(63672),r=a(50723);let c,l=t=>t;class h extends r.N{render(){var t;return(0,s.qy)(c||(c=l`<nav part="nav" aria-label="${0}"> <div part="base" class="base" role="list"> <slot></slot> </div> </nav>`),(0,o.J)(null!==(t=this.ariaLabel)&&void 0!==t?t:void 0))}constructor(...t){super(...t),this.hostRole="",this.ariaLabel=null}}(0,i.Cg)([(0,n.MZ)({type:String,attribute:"aria-label",reflect:!1})],h.prototype,"ariaLabel",void 0),h=(0,i.Cg)([(0,n.EM)("ha-list-nav")],h)},82e3:function(t,e,a){a.d(e,{D5:function(){return i},Fy:function(){return o},Gk:function(){return l},Hg:function(){return s},Y_:function(){return h},ds:function(){return c},e0:function(){return n},ec:function(){return r}});a(74423),a(18111),a(61701),a(33110),a(3362);const i=14881==a.j?`${location.protocol}//${location.host}`:null,s=t=>t.map(t=>{if("string"!==t.type)return t;switch(t.name){case"username":return Object.assign(Object.assign({},t),{},{autocomplete:"username",autofocus:!0});case"password":return Object.assign(Object.assign({},t),{},{autocomplete:"current-password"});case"code":return Object.assign(Object.assign({},t),{},{autocomplete:"one-time-code",autofocus:!0});default:return t}}),n=(t,e)=>t.callWS({type:"auth/sign_path",path:e}),o=async(t,e,a,i)=>t.callWS({type:"config/auth_provider/homeassistant/create",user_id:e,username:a,password:i}),r=(t,e,a)=>t.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:e,new_password:a}),c=(t,e,a)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:e,password:a}),l=(t,e,a)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:e,username:a}),h=(t,e,a)=>t.callWS({type:"auth/delete_all_refresh_tokens",token_type:e,delete_current_token:a})},31420:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{Bi:function(){return Z},Dt:function(){return X},EB:function(){return S},IW:function(){return H},P_:function(){return $},SG:function(){return A},Sx:function(){return W},T2:function(){return b},Xm:function(){return _},Ye:function(){return m},Zm:function(){return L},cq:function(){return U},dH:function(){return z},en:function(){return G},gF:function(){return w},gb:function(){return y},gv:function(){return I},jU:function(){return j},kI:function(){return V},mF:function(){return E},mu:function(){return M},oJ:function(){return O},pI:function(){return x},pL:function(){return K},q5:function(){return D},q7:function(){return P},qk:function(){return v},sp:function(){return B},uM:function(){return J},v3:function(){return F},xN:function(){return Y},yL:function(){return k},yj:function(){return T},zZ:function(){return C}});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 s=a(22711),n=a(97732),o=a(6226),r=a(22786),c=a(80785),l=a(95747),h=a(30162),d=a(36918),u=a(30039),p=a(39889),g=a(95350),f=t([s,l,h]);[s,l,h]=f.then?(await f)():f;var v=function(t){return t.NEVER="never",t.DAILY="daily",t.CUSTOM_DAYS="custom_days",t}({});const b=["mon","tue","wed","thu","fri","sat","sun"],m=t=>t.sort((t,e)=>b.indexOf(t)-b.indexOf(e)),_=t=>t.callWS({type:"backup/config/info"}),y=(t,e)=>t.callWS(Object.assign({type:"backup/config/update"},e)),w=(t,e)=>{var a,i;return y(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})},k=(t,e,a)=>`/api/backup/download/${t}?agent_id=${e}${a?`&password=${a}`:""}`,x=t=>t.callWS({type:"backup/info"}),C=(t,e)=>t.callWS({type:"backup/details",backup_id:e}),$=t=>t.callWS({type:"backup/agents/info"}),M=(t,e)=>t.callWS({type:"backup/delete",backup_id:e}),A=(t,e)=>t.callWS(Object.assign({type:"backup/generate"},e)),H=t=>t.callWS({type:"backup/generate_with_automatic_settings"}),z=(t,e)=>t.callWS(Object.assign({type:"backup/restore"},e)),V=async(t,e,a)=>{const i=new FormData;i.append("file",e);const s=new URLSearchParams;return a.forEach(t=>{s.append("agent_id",t)}),(0,p.QE)(t.fetchWithAuth(`/api/backup/upload?${s.toString()}`,{method:"POST",body:i}))},S=t=>{const e=t.find(Z);if(e)return e;const a=t.find(j);return a||t[0]},L=(t,e,a,i)=>t.callWS({type:"backup/can_decrypt_on_download",backup_id:e,agent_id:a,password:i}),I="backup.local",E="hassio.local",O="cloud.cloud",Z=t=>[I,E].includes(t),j=t=>{const[e,a]=t.split(".");return"hassio"===e&&"local"!==a},P=(t,e,a)=>{if(Z(e))return t("ui.panel.config.backup.agents.local_agent");const i=a.find(t=>t.agent_id===e),s=e.split(".")[0],n=i?i.name:e.split(".")[1];if(j(e))return n;const o=(0,g.p$)(t,s);return a.filter(t=>t.agent_id.split(".")[0]===s).length>1?`${o}: ${n}`:o},F=t=>Math.max(...Object.values(t.agents).map(t=>t.size)),q=["automatic","app_update","manual"],D=(0,s.z)(t=>t?q:q.filter(t=>"app_update"!==t)),B=(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"},T=(t,e)=>{const a=Z(t),i=Z(e),s=j(t),n=j(e),o=(t,e)=>t?1:e?2:3,r=o(a,s),c=o(i,n);return r!==c?r-c:t.localeCompare(e)},U=()=>{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,s)=>{a+="-"===e[s]?"-":t[i%36]}),a},N=(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,l.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")})}`),R=(t,e)=>`home_assistant_backup_emergency_kit_${e?`${e}_`:""}${(0,l.GH)(new Date,t.locale,t.config).replace(",","").replace(" ","_")}.txt`,W=(t,e,a)=>(0,u.R)(N(t,e),R(t,a)),J=(0,n.g)((0,o.a)(new Date,4),45),K=(0,n.g)((0,o.a)(new Date,5),45),G=(0,r.A)((t,e,a)=>{if((0,c.A)(a))return(0,h.fU)(a,t,e);if("string"==typeof a&&a){const i=a.split(":"),s=(0,n.g)((0,o.a)(new Date,parseInt(i[0])),parseInt(i[1]));return(0,h.fU)(s,t,e)}return`${(0,h.fU)(J,t,e)} - ${(0,h.fU)(K,t,e)}`}),Y="application/x-tar",X={file:void 0};i()}catch(b){i(b)}})},30884:function(t,e,a){a.d(e,{A:function(){return i},K:function(){return s}});const i=(t,e,a)=>t.connection.subscribeMessage(e,{type:"backup/subscribe_events"},{preCheck:a}),s={manager_state:"idle"}},16869:function(t,e,a){a.d(e,{B:function(){return n},g:function(){return s}});var i;a(74423),a(27495);const s=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"),n=window.externalApp||window.externalAppV2},47351:function(t,e,a){a.d(e,{PS:function(){return i},Tv:function(){return o},VR:function(){return s},lE:function(){return r}});a(74423),a(3362),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);const i=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]),o=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")),r=async(t,e)=>t({type:"supervisor/api",endpoint:`/${e}/stats`,method:"get"})},44249:function(t,e,a){a.d(e,{V:function(){return i}});a(62953);const i=(t,e)=>{const a=new s,i=t.subscribeMessage(t=>e(a.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{i.then(t=>null==t?void 0:t())}};class s{processMessage(t){if("removed"===t.type)for(const e of Object.keys(t.notifications))delete this.notifications[e];else this.notifications=Object.assign(Object.assign({},this.notifications),t.notifications);return Object.values(this.notifications)}constructor(){this.notifications={}}}},23528:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{$3:function(){return b},$O:function(){return $},$j:function(){return m},ED:function(){return r},JE:function(){return M},OQ:function(){return A},PU:function(){return H},Ph:function(){return f},Uf:function(){return C},W1:function(){return v},Wr:function(){return u},Z:function(){return h},gF:function(){return _},iY:function(){return y},jU:function(){return c},nN:function(){return x},p3:function(){return d},pJ:function(){return g},r_:function(){return l},sz:function(){return p}});a(74423),a(18111),a(13579),a(62953);var s=a(28978),n=a(380),o=t([n]);n=(o.then?(await o)():o)[0];var r=function(t){return t[t.NONE=0]="NONE",t[t.ARITHMETIC=1]="ARITHMETIC",t[t.CIRCULAR=2]="CIRCULAR",t}({});const c=["entity_not_recorded","entity_no_longer_recorded","state_class_removed","units_changed","mean_type_changed","no_state"],l=["L","gal","ft³","m³","CCF","MCF"],h=t=>t.sendMessagePromise({type:"recorder/info"}),d=(t,e)=>t.callWS({type:"recorder/list_statistic_ids",statistic_type:e}),u=(t,e)=>t.callWS({type:"recorder/get_statistics_metadata",statistic_ids:e}),p=(t,e,a,i,s="hour",n,o)=>t.callWS({type:"recorder/statistics_during_period",start_time:e.toISOString(),end_time:null==a?void 0:a.toISOString(),statistic_ids:i,period:s,units:n,types:o}),g=(t,e,a,i)=>t.callWS({type:"recorder/statistic_during_period",statistic_id:e,units:i,fixed_period:a.fixed_period?{start_time:a.fixed_period.start instanceof Date?a.fixed_period.start.toISOString():a.fixed_period.start,end_time:a.fixed_period.end instanceof Date?a.fixed_period.end.toISOString():a.fixed_period.end}:void 0,calendar:a.calendar?Object.assign(Object.assign({},"week"===a.calendar.period?{first_weekday:(0,n.D)(t.locale).substring(0,3)}:{}),a.calendar):void 0,rolling_window:a.rolling_window}),f=t=>t.callWS({type:"recorder/validate_statistics"}),v=(t,e,a,i)=>t.callWS({type:"recorder/update_statistics_metadata",statistic_id:e,unit_of_measurement:a,unit_class:i}),b=(t,e)=>t.callWS({type:"recorder/clear_statistics",statistic_ids:e}),m=t=>{let e=null;if(!t)return null;for(const a of t)null!==a.change&&void 0!==a.change&&(null===e?e=a.change:e+=a.change);return e},_=(t,e)=>{let a=null;for(const i of e){if(!(i in t))continue;const e=m(t[i]);null!==e&&(null===a?a=e:a+=e)}return a},y=(t,e)=>t.some(t=>void 0!==t[e]&&null!==t[e]),w=["mean","min","max"],k=["sum","state","change"],x=(t,e)=>!(!w.includes(e)||0===t.mean_type)||!(!k.includes(e)||!t.has_sum),C=(t,e,a,i,s)=>{const n=new Date(a).toISOString();return t.callWS({type:"recorder/adjust_sum_statistics",statistic_id:e,start_time:n,adjustment:i,adjustment_unit_of_measurement:s})},$=(t,e,a)=>{const i=t.states[e];return i?(0,s.u)(i):(null==a?void 0:a.name)||e},M=(t,e,a)=>{let i;var s;e&&(i=null===(s=t.states[e])||void 0===s?void 0:s.attributes.unit_of_measurement);return void 0===i?null==a?void 0:a.statistics_unit_of_measurement:i},A=t=>t.includes(":"),H=t=>t.callWS({type:"recorder/update_statistics_issues"});i()}catch(c){i(c)}})},71606:function(t,e,a){a.d(e,{f:function(){return s},o:function(){return i}});a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);const i=new Set(["automation","script","scene","group"]),s=(t,e,a)=>t.callWS({type:"search/related",item_type:e,item_id:a})},26581:function(t,e,a){a.d(e,{r:function(){return s},y:function(){return i}});a(3362);const i=async t=>t.callWS({type:"hassio/update/config/info"}),s=async(t,e)=>t.callWS(Object.assign({type:"hassio/update/config/update"},e))},28669:function(t,e,a){a.d(e,{TK:function(){return r},_2:function(){return l},eR:function(){return s},hG:function(){return c},hU:function(){return n},kg:function(){return o},wj:function(){return i},xg:function(){return h}});a(44114),a(18111),a(61701),a(3362),a(42762);const i="system-admin",s="system-users",n=async t=>t.callWS({type:"config/auth/list"}),o=async(t,e,a,i)=>t.callWS({type:"config/auth/create",name:e,group_ids:a,local_only:i}),r=async(t,e,a)=>t.callWS(Object.assign(Object.assign({},a),{},{type:"config/auth/update",user_id:e})),c=async(t,e)=>t.callWS({type:"config/auth/delete",user_id:e}),l=t=>t?t.trim().split(" ").slice(0,3).map(t=>t.substring(0,1)).join(""):"?",h=(t,e,a)=>{const i=[],s=e=>t.localize(`ui.panel.config.users.${e}`);return e.is_owner&&i.push(["M12 2C6.47 2 2 6.5 2 12C2 17.5 6.5 22 12 22S22 17.5 22 12 17.5 2 12 2M12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4S20 7.58 20 12C20 16.42 16.42 20 12 20M8 14L7 8L10 10L12 7L14 10L17 8L16 14H8M8.56 16C8.22 16 8 15.78 8 15.44V15H16V15.44C16 15.78 15.78 16 15.44 16H8.56Z",s("is_owner")]),a&&e.system_generated&&i.push(["M11,7H15V9H11V11H13A2,2 0 0,1 15,13V15A2,2 0 0,1 13,17H9V15H13V13H11A2,2 0 0,1 9,11V9A2,2 0 0,1 11,7M12,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,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z",s("is_system")]),e.local_only&&i.push(["M12 20C7.6 20 4 16.4 4 12S7.6 4 12 4 20 7.6 20 12 16.4 20 12 20M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M11 14H13V17H16V12H18L12 7L6 12H8V17H11V14",s("is_local")]),e.is_active||i.push(["M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",s("is_not_active")]),i}},81310:function(t,e,a){a.a(t,async function(t,e){try{a(62953);var i=a(40445),s=a(5124),n=a(67576),o=a(6412),r=a(26218),c=a(91926),l=a(90248),h=a(2054),d=a(14503),u=t([l,h]);[l,h]=u.then?(await u)():u;let p,g,f,v,b,m=t=>t;class _ extends s.WF{render(){var t;return(0,s.qy)(p||(p=m` <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}" @scroll="${0}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `),(0,o.H)({narrow:this.narrow}),this.mainPage||null!==(t=history.state)&&void 0!==t&&t.root?(0,s.qy)(g||(g=m` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):this.backPath?(0,s.qy)(f||(f=m` <ha-icon-button-arrow-prev href="${0}" .hass="${0}"></ha-icon-button-arrow-prev> `),this.backPath,this.hass):(0,s.qy)(v||(v=m` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._backTapped),this.header,(0,o.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,c.OE)()}static get styles(){return[d.dp,(0,s.AH)(b||(b=m`: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,n.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)()],_.prototype,"header",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"main-page"})],_.prototype,"mainPage",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"back-path"})],_.prototype,"backPath",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"backCallback",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],_.prototype,"narrow",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"scrollable",void 0),(0,i.Cg)([(0,r.a)(".content")],_.prototype,"_savedScrollPos",void 0),(0,i.Cg)([(0,n.Ls)({passive:!0})],_.prototype,"_saveScrollPos",null),_=(0,i.Cg)([(0,n.EM)("hass-subpage")],_),e()}catch(p){e(p)}})},54706:function(t,e,a){a.d(e,{E:function(){return n}});a(74423),a(18111),a(13579),a(3362),a(62953);var i=a(40445),s=a(67576);const n=t=>{class e extends t{connectedCallback(){super.connectedCallback(),this._checkSubscribed()}disconnectedCallback(){if(super.disconnectedCallback(),this.__unsubs){for(;this.__unsubs.length;){const t=this.__unsubs.pop();t instanceof Promise?t.then(t=>t()):t()}this.__unsubs=void 0}}updated(t){if(super.updated(t),t.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const e of t.keys())if(this.hassSubscribeRequiredHostProps.includes(e))return void this._checkSubscribed()}hassSubscribe(){return[]}_checkSubscribed(){var t;void 0!==this.__unsubs||!this.isConnected||void 0===this.hass||null!==(t=this.hassSubscribeRequiredHostProps)&&void 0!==t&&t.some(t=>void 0===this[t])||(this.__unsubs=this.hassSubscribe())}}return(0,i.Cg)([(0,s.MZ)({attribute:!1})],e.prototype,"hass",void 0),e}},25654:function(t,e,a){a.a(t,async function(t,e){try{var i=a(40445),s=a(5124),n=a(67576),o=a(1087),r=(a(28170),a(50723),a(13407)),c=a(17393),l=a(31420),h=a(86801),d=t([l]);l=(d.then?(await d)():d)[0];let u,p,g,f=t=>t;const v="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z";class b extends s.WF{get _value(){var t;return null!==(t=this.value)&&void 0!==t?t:""}render(){return this._value?(0,s.qy)(u||(u=f` <ha-list-base> <ha-list-item-base> <span slot="headline"> ${0} </span> <span slot="supporting-text"> ${0} </span> <ha-button appearance="plain" slot="end" @click="${0}" size="small"> <ha-svg-icon .path="${0}" slot="start"></ha-svg-icon> ${0} </ha-button> </ha-list-item-base> <ha-list-item-base> <span slot="headline"> ${0} </span> <span slot="supporting-text"> ${0} </span> <ha-button appearance="plain" slot="end" @click="${0}" size="small"> ${0} </ha-button> </ha-list-item-base> <ha-list-item-base> <span slot="headline"> ${0} </span> <span slot="supporting-text"> ${0} </span> <ha-button appearance="plain" variant="danger" size="small" slot="end" @click="${0}"> ${0} </ha-button> </ha-list-item-base> </ha-list-base> `),this.hass.localize("ui.panel.config.backup.encryption_key.download_emergency_kit"),this.hass.localize("ui.panel.config.backup.encryption_key.download_emergency_kit_description"),this._download,v,this.hass.localize("ui.panel.config.backup.encryption_key.download_emergency_kit_action"),this.hass.localize("ui.panel.config.backup.encryption_key.show_encryption_key"),this.hass.localize("ui.panel.config.backup.encryption_key.show_encryption_key_description"),this._show,this.hass.localize("ui.panel.config.backup.encryption_key.show_encryption_key_action"),this.hass.localize("ui.panel.config.backup.encryption_key.change_encryption_key"),this.hass.localize("ui.panel.config.backup.encryption_key.change_encryption_key_description"),this._change,this.hass.localize("ui.panel.config.backup.encryption_key.change_encryption_key_action")):(0,s.qy)(p||(p=f` <ha-list-base> <ha-list-item-base> <span slot="headline"> ${0}</span> <span slot="supporting-text"> ${0} </span> <ha-button slot="end" @click="${0}"> ${0}</ha-button> </ha-list-item-base> </ha-list-base> `),this.hass.localize("ui.panel.config.backup.encryption_key.set_encryption_key"),this.hass.localize("ui.panel.config.backup.encryption_key.set_encryption_key_description"),this._set,this.hass.localize("ui.panel.config.backup.encryption_key.set_encryption_key_action"))}_download(){this._value&&(0,l.Sx)(this.hass,this._value)}_show(){(0,h.H)(this,{currentKey:this._value})}_change(){(0,r.m)(this,{currentKey:this._value,saveKey:t=>{(0,o.r)(this,"value-changed",{value:t})}})}_set(){(0,c.Q)(this,{saveKey:t=>{(0,o.r)(this,"value-changed",{value:t})}})}}b.styles=(0,s.AH)(g||(g=f`ha-list-base{--ha-row-item-padding-inline:0}ha-list-item-base::part(headline),ha-list-item-base::part(supporting-text){white-space:wrap}ha-button[size=small] ha-svg-icon{--mdc-icon-size:16px}`)),(0,i.Cg)([(0,n.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,i.Cg)([(0,n.wk)()],b.prototype,"value",void 0),b=(0,i.Cg)([(0,n.EM)("ha-backup-config-encryption-key")],b),e()}catch(u){e(u)}})},19006:function(t,e,a){a.a(t,async function(t,e){try{a(89463),a(62953);var i=a(40445),s=a(5124),n=a(67576),o=a(18350),r=(a(76776),a(47680),a(65829)),c=t([o,r]);[o,r]=c.then?(await c)():c;let l,h,d,u,p,g=t=>t;const f={success:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",loading:"M12,18A6,6 0 0,1 6,12C6,11 6.25,10.03 6.7,9.2L5.24,7.74C4.46,8.97 4,10.43 4,12A8,8 0 0,0 12,20V23L16,19L12,15M12,4V1L8,5L12,9V6A6,6 0 0,1 18,12C18,13 17.75,13.97 17.3,14.8L18.76,16.26C19.54,15.03 20,13.57 20,12A8,8 0 0,0 12,4Z"};class v extends s.WF{render(){return(0,s.qy)(l||(l=g` <ha-card outlined> <div class="summary"> ${0} <div class="content"> <p class="heading">${0}</p> <p class="description">${0}</p> </div> ${0} </div> <div class="content"> <slot></slot> </div> </ha-card> `),"loading"===this.status?(0,s.qy)(h||(h=g`<ha-spinner></ha-spinner>`)):"none"===this.status?s.s6:(0,s.qy)(d||(d=g` <div class="icon ${0}"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div> `),this.status,f[this.status]),this.heading,this.description,this.hasAction?(0,s.qy)(u||(u=g` <div class="action"> <slot name="action"></slot> </div> `)):s.s6)}constructor(...t){super(...t),this.hasAction=!1,this.status="info"}}v.styles=(0,s.AH)(p||(p=g`ha-card{min-height:74px}.summary{display:flex;flex-direction:row;column-gap:var(--ha-space-4);row-gap:var(--ha-space-2);align-items:center;padding:16px;padding-bottom:8px;width:100%;box-sizing:border-box}.icon{position:relative;border-radius:var(--ha-border-radius-2xl);width:40px;height:40px;display:flex;align-items:center;justify-content:center;overflow:hidden;--icon-color:var(--primary-color);animation:pop-in var(--ha-animation-duration-normal,250ms) ease-out}.icon.success{--icon-color:var(--success-color)}.icon.warning{--icon-color:var(--warning-color)}.icon.error{--icon-color:var(--error-color)}.icon::before{display:block;content:"";position:absolute;inset:0;background-color:var(--icon-color,var(--primary-color));opacity:.2}.icon ha-svg-icon{color:var(--icon-color,var(--primary-color));width:24px;height:24px}ha-spinner{--ha-spinner-size:40px}.content{display:flex;flex-direction:column;flex:1;min-width:0}.heading{font-size:var(--ha-font-size-xl);font-style:normal;font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed);color:var(--primary-text-color);margin:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.description{font-size:var(--ha-font-size-m);font-style:normal;font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed);letter-spacing:.25px;color:var(--secondary-text-color);margin:0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}@media all and (max-width:550px){.action{width:100%;display:flex;justify-content:flex-end}}@keyframes pop-in{from{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}`)),(0,i.Cg)([(0,n.MZ)()],v.prototype,"heading",void 0),(0,i.Cg)([(0,n.MZ)()],v.prototype,"description",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"has-action"})],v.prototype,"hasAction",void 0),(0,i.Cg)([(0,n.MZ)()],v.prototype,"status",void 0),v=(0,i.Cg)([(0,n.EM)("ha-backup-summary-card")],v),e()}catch(l){e(l)}})},80931:function(t,e,a){a(3362);var i=a(40445),s=a(5124),n=a(67576),o=(a(76776),a(43661),a(67094),a(1671),a(47819),a(26581)),r=a(14503);let c,l,h=t=>t;class d extends s.WF{firstUpdated(){this._fetchSupervisorUpdateConfig()}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this._fetchSupervisorUpdateConfig()}async _fetchSupervisorUpdateConfig(){try{this._supervisorUpdateConfig=await(0,o.y)(this.hass)}catch(t){console.error(t)}}_appUpdateBackupDescription(){if(!this._supervisorUpdateConfig)return this.hass.localize("ui.panel.config.backup.settings.app_update_backup.local_only");if(!this._supervisorUpdateConfig.add_on_backup_before_update)return this.hass.localize("ui.panel.config.backup.schedule.update_preference.skip_backups");const t=this._supervisorUpdateConfig.add_on_backup_retain_copies||1;return`${this.hass.localize("ui.panel.config.backup.schedule.update_preference.backup_before_update")} ${this.hass.localize("ui.panel.config.backup.overview.settings.schedule_copies_backups",{count:t})}`}render(){return(0,s.qy)(c||(c=h` <ha-card> <div class="card-header"> ${0} </div> <div class="card-content"> <ha-list-nav> <ha-list-item-button href="/config/backup/app-update-backups"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <div slot="headline">${0}</div> <div slot="supporting-text"> ${0} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-button> </ha-list-nav> </div> </ha-card> `),this.hass.localize("ui.panel.config.backup.overview.app_update_backup.title"),"M20.5,11H19V7C19,5.89 18.1,5 17,5H13V3.5A2.5,2.5 0 0,0 10.5,1A2.5,2.5 0 0,0 8,3.5V5H4A2,2 0 0,0 2,7V10.8H3.5C5,10.8 6.2,12 6.2,13.5C6.2,15 5,16.2 3.5,16.2H2V20A2,2 0 0,0 4,22H7.8V20.5C7.8,19 9,17.8 10.5,17.8C12,17.8 13.2,19 13.2,20.5V22H17A2,2 0 0,0 19,20V16H20.5A2.5,2.5 0 0,0 23,13.5A2.5,2.5 0 0,0 20.5,11Z",this._appUpdateBackupDescription(),this.hass.localize("ui.panel.config.backup.overview.app_update_backup.description"))}static get styles(){return[r.RF,(0,s.AH)(l||(l=h`.card-header{padding-bottom:8px}.card-content{padding-left:0;padding-right:0;padding-top:0}`))]}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,i.Cg)([(0,n.wk)()],d.prototype,"_supervisorUpdateConfig",void 0),d=(0,i.Cg)([(0,n.EM)("ha-backup-overview-app-update-backup")],d)},37536:function(t,e,a){a.a(t,async function(t,e){try{a(72712),a(18111),a(22489),a(61701),a(18237),a(62953);var i=a(40445),s=a(5124),n=a(67576),o=a(22786),r=a(36312),c=a(18350),l=(a(76776),a(43661),a(1671),a(47819),a(31420)),h=a(14503),d=a(46187),u=t([c,l]);[c,l]=u.then?(await u)():u;let p,g,f,v=t=>t;const b={automatic:"M18,11V12.5C21.19,12.5 23.09,16.05 21.33,18.71L20.24,17.62C21.06,15.96 19.85,14 18,14V15.5L15.75,13.25L18,11M18,22V20.5C14.81,20.5 12.91,16.95 14.67,14.29L15.76,15.38C14.94,17.04 16.15,19 18,19V17.5L20.25,19.75L18,22M19,3H18V1H16V3H8V1H6V3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H14C13.36,20.45 12.86,19.77 12.5,19H5V8H19V10.59C19.71,10.7 20.39,10.94 21,11.31V5A2,2 0 0,0 19,3Z",manual:"M10,9A1,1 0 0,1 11,8A1,1 0 0,1 12,9V13.47L13.21,13.6L18.15,15.79C18.68,16.03 19,16.56 19,17.14V21.5C18.97,22.32 18.32,22.97 17.5,23H11C10.62,23 10.26,22.85 10,22.57L5.1,18.37L5.84,17.6C6.03,17.39 6.3,17.28 6.58,17.28H6.8L10,19V9M11,5A4,4 0 0,1 15,9C15,10.5 14.2,11.77 13,12.46V11.24C13.61,10.69 14,9.89 14,9A3,3 0 0,0 11,6A3,3 0 0,0 8,9C8,9.89 8.39,10.69 9,11.24V12.46C7.8,11.77 7,10.5 7,9A4,4 0 0,1 11,5Z",app_update:"M20.5,11H19V7C19,5.89 18.1,5 17,5H13V3.5A2.5,2.5 0 0,0 10.5,1A2.5,2.5 0 0,0 8,3.5V5H4A2,2 0 0,0 2,7V10.8H3.5C5,10.8 6.2,12 6.2,13.5C6.2,15 5,16.2 3.5,16.2H2V20A2,2 0 0,0 4,22H7.8V20.5C7.8,19 9,17.8 10.5,17.8C12,17.8 13.2,19 13.2,20.5V22H17A2,2 0 0,0 19,20V16H20.5A2.5,2.5 0 0,0 23,13.5A2.5,2.5 0 0,0 20.5,11Z"},m=t=>t.reduce((t,e)=>(t.count++,t.size+=(0,l.v3)(e),t),{count:0,size:0});class _ extends s.WF{render(){const t=(0,r.x)(this.hass.config,"hassio"),e=this._stats(this.backups,t);return(0,s.qy)(p||(p=v` <ha-card class="my-backups"> <div class="card-header"> ${0} </div> <div class="card-content"> <ha-list-nav> ${0} </ha-list-nav> </div> <div class="card-actions"> <ha-button appearance="filled" href="/config/backup/backups?type=all"> ${0} </ha-button> </div> </ha-card> `),this.hass.localize("ui.panel.config.backup.overview.backups.title"),e.map(([t,{count:e,size:a}])=>(0,s.qy)(g||(g=v` <ha-list-item-button href="/config/backup/backups?type=${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <div slot="headline"> ${0} </div> <div slot="supporting-text"> ${0} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-button> `),t,b[t],this.hass.localize(`ui.panel.config.backup.overview.backups.${t}`,{count:e}),this.hass.localize("ui.panel.config.backup.overview.backups.total_size",{size:(0,d.A)(a)}))),this.hass.localize("ui.panel.config.backup.overview.backups.show_all"))}static get styles(){return[h.RF,(0,s.AH)(f||(f=v`.content{padding:28px 20px 0;max-width:690px;margin:0 auto;gap:var(--ha-space-6);display:flex;flex-direction:column;margin-bottom:calc(72px + var(--safe-area-inset-bottom))}.card-actions{display:flex;justify-content:flex-end}.card-header{padding-bottom:8px}.card-content{padding-left:0;padding-right:0;padding-bottom:0}ha-list-item-button::part(start){color:var(--ha-color-text-secondary)}`))]}constructor(...t){super(...t),this.backups=[],this._stats=(0,o.A)((t,e)=>(0,l.q5)(e).map(a=>{const i=t.filter(t=>(0,l.sp)(t,e)===a);return[a,m(i)]}))}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"backups",void 0),_=(0,i.Cg)([(0,n.EM)("ha-backup-overview-backups")],_),e()}catch(p){e(p)}})},4570:function(t,e,a){a.a(t,async function(t,e){try{a(3362);var i=a(40445),s=a(5124),n=a(67576),o=a(1087),r=a(18350),c=(a(76776),a(67094),a(14503)),l=t([r]);r=(l.then?(await l)():l)[0];let h,d,u=t=>t;const p="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z";class g extends s.WF{async _setup(){(0,o.r)(this,"button-click")}render(){return(0,s.qy)(h||(h=u` <ha-card> <div class="card-header"> <div class="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div> ${0} </div> <div class="card-content"> <p> ${0} </p> </div> <div class="card-actions"> <ha-button @click="${0}">${0}</ha-button> </div> </ha-card> `),p,this.hass.localize("ui.panel.config.backup.overview.onboarding.title"),this.hass.localize("ui.panel.config.backup.overview.onboarding.description"),this._setup,this.hass.localize("ui.panel.config.backup.overview.onboarding.setup"))}static get styles(){return[c.RF,(0,s.AH)(d||(d=u`.card-header{display:flex;flex-direction:row;align-items:center;gap:var(--ha-space-4)}.icon{position:relative;border-radius:var(--ha-border-radius-2xl);width:40px;height:40px;display:flex;align-items:center;justify-content:center;overflow:hidden}.icon::before{display:block;content:"";position:absolute;inset:0;background-color:var(--primary-color);opacity:.2}.icon ha-svg-icon{color:var(--primary-color);width:24px;height:24px}p{margin:0}.card-actions{display:flex;justify-content:flex-end;border-top:none}`))]}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"hass",void 0),g=(0,i.Cg)([(0,n.EM)("ha-backup-overview-onboarding")],g),e()}catch(h){e(h)}})},41264:function(t,e,a){a.a(t,async function(t,e){try{a(74423),a(18111),a(61701),a(62953);var i=a(40445),s=a(5124),n=a(67576),o=a(6412),r=a(36312),c=a(71727),l=a(65829),h=(a(67094),a(28170),a(50723),a(31420)),d=a(44144),u=a(19006),p=t([l,u,h]);[l,u,h]=p.then?(await p)():p;let g,f,v,b,m,_,y,w,k,x,C,$,M=t=>t;const A="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",H="M6,2H18A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2M12,4A6,6 0 0,0 6,10C6,13.31 8.69,16 12.1,16L11.22,13.77C10.95,13.29 11.11,12.68 11.59,12.4L12.45,11.9C12.93,11.63 13.54,11.79 13.82,12.27L15.74,14.69C17.12,13.59 18,11.9 18,10A6,6 0 0,0 12,4M12,9A1,1 0 0,1 13,10A1,1 0 0,1 12,11A1,1 0 0,1 11,10A1,1 0 0,1 12,9M7,18A1,1 0 0,0 6,19A1,1 0 0,0 7,20A1,1 0 0,0 8,19A1,1 0 0,0 7,18M12.09,13.27L14.58,19.58L17.17,18.08L12.95,12.77L12.09,13.27Z",z="M4,5C2.89,5 2,5.89 2,7V17C2,18.11 2.89,19 4,19H20C21.11,19 22,18.11 22,17V7C22,5.89 21.11,5 20,5H4M4.5,7A1,1 0 0,1 5.5,8A1,1 0 0,1 4.5,9A1,1 0 0,1 3.5,8A1,1 0 0,1 4.5,7M7,7H20V17H7V7M8,8V16H11V8H8M12,8V16H15V8H12M16,8V16H19V8H16M9,9H10V10H9V9M13,9H14V10H13V9M17,9H18V10H17V9Z",V=[["addons","apps","addon_repositories","app_repositories","docker_config","await_addon_restarts","await_app_restarts"],["folders","finishing_file"],["home_assistant"],["upload_to_agents"],["cleaning_up"]];class S extends s.WF{disconnectedCallback(){super.disconnectedCallback(),this._collapseTimeout&&(clearTimeout(this._collapseTimeout),this._collapseTimeout=void 0)}get _heading(){const t=this.manager.manager_state;return"idle"===t?"":this.hass.localize(`ui.panel.config.backup.overview.progress.heading.${t}`)}get _isUploadStage(){return"idle"!==this.manager.manager_state&&"upload_to_agents"===this.manager.stage}get _description(){switch(this.manager.manager_state){case"create_backup":default:return"";case"restore_backup":return this.manager.stage?this.hass.localize(`ui.panel.config.backup.overview.progress.description.restore_backup.${this.manager.stage}`):"";case"receive_backup":return this.manager.stage?this.hass.localize(`ui.panel.config.backup.overview.progress.description.receive_backup.${this.manager.stage}`):""}}_computeAgentPercent(t){const e=this.uploadProgress[t];if(e&&0!==e.total_bytes)return Math.round(e.uploaded_bytes/e.total_bytes*100)}_getStageGroupIndex(t){return V.findIndex(e=>e.includes(t))}_getSegmentState(t,e){return e>t?"completed":e===t?"active":"pending"}_computeCreateBackupSegments(){const t="create_backup"===this.manager.manager_state?this.manager.stage:null,e=t?this._getStageGroupIndex(t):-1;return(0,r.x)(this.hass.config,"hassio")?[{label:this.hass.localize("ui.panel.config.backup.overview.progress.segments.apps"),state:this._getSegmentState(0,e),flex:2},{label:this.hass.localize("ui.panel.config.backup.overview.progress.segments.media"),state:this._getSegmentState(1,e),flex:2},{label:this.hass.localize("ui.panel.config.backup.overview.progress.segments.home_assistant"),state:this._getSegmentState(2,e),flex:2},{label:this.hass.localize("ui.panel.config.backup.overview.progress.segments.upload"),state:this._getSegmentState(3,e),flex:5},{label:this.hass.localize("ui.panel.config.backup.overview.progress.segments.cleaning_up"),state:this._getSegmentState(4,e),flex:1}]:[{label:this.hass.localize("ui.panel.config.backup.overview.progress.segments.media"),state:this._getSegmentState(1,e),flex:2},{label:this.hass.localize("ui.panel.config.backup.overview.progress.segments.home_assistant"),state:this._getSegmentState(2,e),flex:2},{label:this.hass.localize("ui.panel.config.backup.overview.progress.segments.upload"),state:this._getSegmentState(3,e),flex:5},{label:this.hass.localize("ui.panel.config.backup.overview.progress.segments.cleaning_up"),state:this._getSegmentState(4,e),flex:1}]}_renderAgentIcon(t){var e;if((0,h.Bi)(t))return(0,s.qy)(g||(g=M`<ha-svg-icon slot="start" .path="${0}"></ha-svg-icon>`),H);if((0,h.jU)(t))return(0,s.qy)(f||(f=M`<ha-svg-icon slot="start" .path="${0}"></ha-svg-icon>`),z);const a=(0,c.m)(t);return(0,s.qy)(v||(v=M` <img slot="start" .src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer" alt=""> `),(0,d.MR)({domain:a,type:"icon",darkOptimized:null===(e=this.hass.themes)||void 0===e?void 0:e.darkMode}))}willUpdate(t){if(t.has("manager")){const t=this._isUploadStage;this._wasUploadStage&&!t&&(this._delayingCollapse=!0,this._collapseTimeout=setTimeout(()=>{this._delayingCollapse=!1,this._collapsingAgents=!0,this._collapseTimeout=void 0},300)),this._wasUploadStage=t}}_renderSegmentedProgress(){let t;return"create_backup"!==this.manager.manager_state?s.s6:(t=this._computeCreateBackupSegments(),(0,s.qy)(b||(b=M` <div class="segmented-progress"> ${0} </div> `),t.map(t=>(0,s.qy)(m||(m=M` <div class="segment" style="flex:${0}"> <div class="segment-bar ${0}"></div> <span class="segment-label">${0}</span> </div> `),t.flex,(0,o.H)({active:"active"===t.state,completed:"completed"===t.state,pending:"pending"===t.state}),t.label))))}_renderAgentProgress(){if(!(this._isUploadStage||this._delayingCollapse||this._collapsingAgents)||0===this.agents.length)return s.s6;return Object.keys(this.uploadProgress).length>0?(0,s.qy)(_||(_=M` <div class="agent-list-wrapper ${0}" @animationend="${0}"> <ha-list-base class="agent-list"> ${0} </ha-list-base> </div> `),this._collapsingAgents?"collapsing":"",this._collapsingAgents?this._handleAgentCollapseEnd:void 0,this.agents.map(t=>{const e=(0,h.q7)(this.hass.localize,t.agent_id,this.agents),a=this._computeAgentPercent(t.agent_id);return void 0!==a?a>=100?(0,s.qy)(y||(y=M` <ha-list-item-base> ${0} <div slot="headline">${0}</div> <div slot="supporting-text"> ${0} </div> <ha-svg-icon slot="end" class="agent-complete" .path="${0}"></ha-svg-icon> </ha-list-item-base> `),this._renderAgentIcon(t.agent_id),e,this.hass.localize("ui.panel.config.backup.overview.progress.agent_status.uploaded"),A):(0,s.qy)(w||(w=M` <ha-list-item-base> ${0} <div slot="headline">${0}</div> <div slot="supporting-text"> ${0} </div> <span slot="end" class="progress-percentage"> ${0}% </span> <ha-spinner slot="end" size="tiny"></ha-spinner> </ha-list-item-base> `),this._renderAgentIcon(t.agent_id),e,this.hass.localize("ui.panel.config.backup.overview.progress.agent_status.uploading"),a):(0,s.qy)(k||(k=M` <ha-list-item-base> ${0} <div slot="headline">${0}</div> <div slot="supporting-text"> ${0} </div> <ha-spinner slot="end" size="tiny"></ha-spinner> </ha-list-item-base> `),this._renderAgentIcon(t.agent_id),e,this.hass.localize("ui.panel.config.backup.overview.progress.agent_status.uploading"))})):s.s6}render(){const t=this._renderSegmentedProgress(),e=this._renderAgentProgress(),a=t!==s.s6||e!==s.s6;return(0,s.qy)(x||(x=M` <ha-backup-summary-card .hass="${0}" .heading="${0}" .description="${0}" status="none"> ${0} </ha-backup-summary-card> `),this.hass,this._heading,this._description,a?(0,s.qy)(C||(C=M` <div class="progress-content"> ${0} ${0} </div> `),t,e):s.s6)}static get styles(){return[(0,s.AH)($||($=M`.progress-content{padding:var(--ha-space-2) var(--ha-space-4) var(--ha-space-4)}.segmented-progress{display:flex;gap:var(--ha-space-2)}.segment{display:flex;flex-direction:column;gap:var(--ha-space-1);min-width:0}.segment-bar{height:8px;border-radius:var(--ha-border-radius-pill);transition:background-color .3s ease}.segment-bar.pending{background-color:var(--divider-color)}.segment-bar.active{background-color:var(--primary-color);animation:pulse 1.5s ease-in-out infinite}.segment-bar.completed{background-color:var(--primary-color)}.segment-label{font-size:var(--ha-font-size-xs);color:var(--secondary-text-color);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@keyframes pulse{0%,100%{opacity:1}50%{opacity:.5}}@media (prefers-reduced-motion:reduce){.segment-bar.active{animation:none}}.agent-list-wrapper{display:grid;grid-template-rows:1fr;animation:expand var(--ha-animation-duration-slow,350ms) ease-out}.agent-list-wrapper.collapsing{animation:collapse var(--ha-animation-duration-slow,350ms) ease-out forwards}@keyframes expand{from{grid-template-rows:0fr;opacity:0}to{grid-template-rows:1fr;opacity:1}}@keyframes collapse{from{grid-template-rows:1fr;opacity:1}to{grid-template-rows:0fr;opacity:0}}.agent-list{background:0 0;padding:0;margin-top:var(--ha-space-4);overflow:hidden}ha-list-item-base{--ha-row-item-padding-inline:0}ha-list-item-base img{width:48px}ha-list-item-base ha-svg-icon[slot=start]{--mdc-icon-size:48px;color:var(--primary-text-color)}.progress-percentage{font-size:var(--ha-font-size-s);color:var(--secondary-text-color)}ha-list-item-base::part(supporting-text){display:flex;align-items:center}.agent-complete{color:var(--success-color);--mdc-icon-size:24px;animation:pop-in var(--ha-animation-duration-normal,250ms) ease-out}@keyframes pop-in{from{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}`))]}constructor(...t){super(...t),this.agents=[],this.uploadProgress={},this._collapsingAgents=!1,this._wasUploadStage=!1,this._delayingCollapse=!1,this._handleAgentCollapseEnd=()=>{this._collapsingAgents=!1}}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],S.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],S.prototype,"manager",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],S.prototype,"agents",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],S.prototype,"uploadProgress",void 0),(0,i.Cg)([(0,n.wk)()],S.prototype,"_collapsingAgents",void 0),(0,i.Cg)([(0,n.wk)()],S.prototype,"_wasUploadStage",void 0),(0,i.Cg)([(0,n.wk)()],S.prototype,"_delayingCollapse",void 0),S=(0,i.Cg)([(0,n.EM)("ha-backup-overview-progress")],S),e()}catch(g){e(g)}})},77994:function(t,e,a){a.a(t,async function(t,e){try{a(74423),a(18111),a(22489),a(61701),a(13579),a(3362),a(62953);var i=a(40445),s=a(5124),n=a(67576),o=a(36312),r=a(91926),c=a(18350),l=(a(76776),a(43661),a(67094),a(1671),a(47819),a(31420)),h=a(23528),d=a(14503),u=t([c,h,l]);[c,h,l]=u.then?(await u)():u;let p,g,f,v=t=>t;const b="M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z",m="M12,3C7.58,3 4,4.79 4,7C4,9.21 7.58,11 12,11C16.42,11 20,9.21 20,7C20,4.79 16.42,3 12,3M4,9V12C4,14.21 7.58,16 12,16C16.42,16 20,14.21 20,12V9C20,11.21 16.42,13 12,13C7.58,13 4,11.21 4,9M4,14V17C4,19.21 7.58,21 12,21C16.42,21 20,19.21 20,17V14C20,16.21 16.42,18 12,18C7.58,18 4,16.21 4,14Z",_="M20.5,11H19V7C19,5.89 18.1,5 17,5H13V3.5A2.5,2.5 0 0,0 10.5,1A2.5,2.5 0 0,0 8,3.5V5H4A2,2 0 0,0 2,7V10.8H3.5C5,10.8 6.2,12 6.2,13.5C6.2,15 5,16.2 3.5,16.2H2V20A2,2 0 0,0 4,22H7.8V20.5C7.8,19 9,17.8 10.5,17.8C12,17.8 13.2,19 13.2,20.5V22H17A2,2 0 0,0 19,20V16H20.5A2.5,2.5 0 0,0 23,13.5A2.5,2.5 0 0,0 20.5,11Z",y="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z";class w extends s.WF{firstUpdated(t){super.firstUpdated(t),this._checkDbOption()}_configure(){(0,r.oo)("/config/backup/settings")}async _checkDbOption(){if((0,o.x)(this.hass.config,"recorder")){const t=await(0,h.Z)(this.hass.connection);this._showDbOption=t.db_in_default_location}else this._showDbOption=!1}_scheduleDescription(t){const{copies:e,days:a}=t.retention,{recurrence:i}=t.schedule;if(i===l.qk.NEVER)return this.hass.localize("ui.panel.config.backup.overview.settings.schedule_never");const s=this.config.schedule.time&&(0,l.en)(this.hass.locale,this.hass.config,this.config.schedule.time);let n=this.hass.localize("ui.panel.config.backup.overview.settings.schedule_never");const o=this.config.schedule.days;this.config.schedule.recurrence===l.qk.DAILY||this.config.schedule.recurrence===l.qk.CUSTOM_DAYS&&7===o.length?n=this.hass.localize(`ui.panel.config.backup.overview.settings.schedule_${this.config.schedule.time?"":"optimized_"}daily`,{time:s}):this.config.schedule.recurrence===l.qk.CUSTOM_DAYS&&0!==o.length&&(n=2===o.length&&o.includes("sat")&&o.includes("sun")?this.hass.localize(`ui.panel.config.backup.overview.settings.schedule_${this.config.schedule.time?"":"optimized_"}weekend`,{time:s}):5!==o.length||o.includes("sat")||o.includes("sun")?this.hass.localize(`ui.panel.config.backup.overview.settings.schedule_${this.config.schedule.time?"":"optimized_"}days`,{count:o.length,days:o.map(t=>this.hass.localize(`ui.panel.config.backup.overview.settings.${o.length>2?"short_weekdays":"weekdays"}.${t}`)).join(", "),time:s}):this.hass.localize(`ui.panel.config.backup.overview.settings.schedule_${this.config.schedule.time?"":"optimized_"}weekdays`,{time:s}));let r=this.hass.localize("ui.panel.config.backup.overview.settings.schedule_copies_all");return e?r=this.hass.localize("ui.panel.config.backup.overview.settings.schedule_copies_backups",{count:e}):a&&(r=this.hass.localize("ui.panel.config.backup.overview.settings.schedule_copies_days",{count:a})),n+" "+r}_addonsDescription(t){var e;if(t.create_backup.include_all_addons)return this.hass.localize("ui.panel.config.backup.overview.settings.apps_all");const a=null===(e=t.create_backup.include_addons)||void 0===e?void 0:e.length;return a?this.hass.localize("ui.panel.config.backup.overview.settings.apps_many",{count:a}):this.hass.localize("ui.panel.config.backup.overview.settings.apps_none")}_locationsDescription(t){const e=t.create_backup.agent_ids.some(t=>(0,l.Bi)(t)),a=t.create_backup.agent_ids.filter(t=>!(0,l.Bi)(t));if(a.length){if(1===a.length){const t=(0,l.q7)(this.hass.localize,a[0],this.agents);return this.hass.localize("ui.panel.config.backup.overview.settings.locations_one",{name:t})}return this.hass.localize("ui.panel.config.backup.overview.settings.locations_many",{count:a.length})}return e?this.hass.localize("ui.panel.config.backup.overview.settings.locations_local_only"):this.hass.localize("ui.panel.config.backup.overview.settings.locations_none")}render(){const t=this.hass.config.components.includes("hassio");return(0,s.qy)(p||(p=v` <ha-card class="my-backups"> <div class="card-header"> ${0} </div> <div class="card-content"> <ha-list-nav> <ha-list-item-button href="/config/backup/settings#schedule"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <div slot="headline"> ${0} </div> <div slot="supporting-text"> ${0} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-button> <ha-list-item-button href="/config/backup/settings#data"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <div slot="headline"> ${0} </div> <div slot="supporting-text"> ${0} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-button> ${0} <ha-list-item-button href="/config/backup/settings#locations"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <div slot="headline"> ${0} </div> <div slot="supporting-text"> ${0} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-button> </ha-list-nav> </div> <div class="card-actions"> <ha-button @click="${0}" appearance="filled"> ${0} </ha-button> </div> </ha-card> `),this.hass.localize("ui.panel.config.backup.overview.settings.title"),b,this._scheduleDescription(this.config),this.hass.localize("ui.panel.config.backup.overview.settings.schedule"),m,this._showDbOption&&this.config.create_backup.include_database?this.hass.localize("ui.panel.config.backup.overview.settings.data_settings_history"):this.hass.localize("ui.panel.config.backup.overview.settings.data_settings_only"),this.hass.localize("ui.panel.config.backup.overview.settings.data"),t?(0,s.qy)(g||(g=v` <ha-list-item-button href="/config/backup/settings#data"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <div slot="headline"> ${0} </div> <div slot="supporting-text"> ${0} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-button> `),_,this._addonsDescription(this.config),this.hass.localize("ui.panel.config.backup.overview.settings.apps")):s.s6,y,this._locationsDescription(this.config),this.hass.localize("ui.panel.config.backup.overview.settings.locations"),this._configure,this.hass.localize("ui.panel.config.backup.overview.settings.configure"))}static get styles(){return[d.RF,(0,s.AH)(f||(f=v`.content{padding:28px 20px 0;max-width:690px;margin:0 auto;gap:var(--ha-space-6);display:flex;flex-direction:column;margin-bottom:24px;margin-bottom:72px}.card-actions{display:flex;justify-content:flex-end}.card-header{padding-bottom:8px}.card-content{padding-left:0;padding-right:0;padding-bottom:0}ha-list-item-button::part(start){color:var(--ha-color-text-secondary)}`))]}constructor(...t){super(...t),this._showDbOption=!0}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"config",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"agents",void 0),(0,i.Cg)([(0,n.wk)()],w.prototype,"_showDbOption",void 0),w=(0,i.Cg)([(0,n.EM)("ha-backup-overview-settings")],w),e()}catch(p){e(p)}})},46971:function(t,e,a){a.a(t,async function(t,e){try{a(44114),a(26910),a(18111),a(22489),a(20116),a(62953);var i=a(40445),s=a(73214),n=a(73684),o=a(6946),r=a(57279),c=a(5124),l=a(67576),h=a(22786),d=a(72487),u=a(98975),p=a(18350),g=(a(76776),a(26300)),f=(a(67094),a(28170),a(50723),a(31420)),v=a(14503),b=a(33963),m=a(19006),_=t([p,g,m,u,f,b,d]);[p,g,m,u,f,b,d]=_.then?(await _)():_;let y,w,k,x,C=t=>t;const $="M12,3A9,9 0 0,0 3,12H0L4,16L8,12H5A7,7 0 0,1 12,5A7,7 0 0,1 19,12A7,7 0 0,1 12,19C10.5,19 9.09,18.5 7.94,17.7L6.5,19.14C8.04,20.3 9.94,21 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M14,12A2,2 0 0,0 12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12Z",M="M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z",A="M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",H=3;class z extends c.WF{_renderSummaryCard(t,e,a,i,s){return(0,c.qy)(y||(y=C` <ha-backup-summary-card .heading="${0}" .status="${0}"> <ha-list-base> <ha-list-item-base> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <span slot="headline" class="${0}">${0}</span> </ha-list-item-base> ${0} </ha-list-base> </ha-backup-summary-card> `),t,e,$,null===a?"skeleton":"",a,i||null===i?(0,c.qy)(w||(w=C`<ha-list-item-base> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> <span slot="headline" class="${0}">${0}</span> ${0} </ha-list-item-base>`),M,null===i?"skeleton":"",i,s?(0,c.qy)(k||(k=C` <ha-icon-button slot="end" @click="${0}" .path="${0}"></ha-icon-button>`),this._createAdditionalBackupDescription(s),A):c.s6):c.s6)}render(){var t,e,a;const i=new Date;if(this.fetching)return this._renderSummaryCard(this.hass.localize("ui.panel.config.backup.overview.summary.loading"),"none",null,null);const c=this._lastBackup(this.backups),l=this.config.last_attempted_automatic_backup?new Date(this.config.last_attempted_automatic_backup):new Date(0),h=this.config.last_completed_automatic_backup?new Date(this.config.last_completed_automatic_backup):new Date(0),p=this.config.next_automatic_backup?new Date(this.config.next_automatic_backup):void 0,g=(0,f.en)(this.hass.locale,this.hass.config,p||this.config.schedule.time),v=this.config.next_automatic_backup_additional,b=this.config.schedule.recurrence===f.qk.NEVER||this.config.schedule.recurrence===f.qk.CUSTOM_DAYS&&0===this.config.schedule.days.length?this.hass.localize("ui.panel.config.backup.overview.summary.no_automatic_backup"):p?this.hass.localize("ui.panel.config.backup.overview.summary.next_automatic_backup",{day:(0,s.e)(p)?this.hass.localize("ui.panel.config.backup.overview.summary.tomorrow"):(0,n.c)(p)?this.hass.localize("ui.panel.config.backup.overview.summary.today"):(0,d.CA)(p,this.hass.locale,this.hass.config),time:g}):"";if(l>h){const t=this._lastUploadedBackup(this.backups);return this._renderSummaryCard(this.hass.localize("ui.panel.config.backup.overview.summary.last_backup_failed_heading"),"error",this.hass.localize("ui.panel.config.backup.overview.summary.last_backup_failed_description",{relative_time:(0,u.K)(l,this.hass.locale,i,!0)}),t||b?t?this.hass.localize("ui.panel.config.backup.overview.summary.last_successful_backup_description",{relative_time:(0,u.K)(new Date(t.date),this.hass.locale,i,!0),count:Object.keys(t.agents).length}):b:void 0)}if(!c)return this._renderSummaryCard(this.hass.localize("ui.panel.config.backup.overview.summary.no_backup_heading"),"warning",this.hass.localize("ui.panel.config.backup.overview.summary.no_backup_description"),b,v?h:void 0);const m=new Date(c.date);if(null!==(t=c.failed_agent_ids)&&void 0!==t&&t.length||null!==(e=c.failed_addons)&&void 0!==e&&e.length||null!==(a=c.failed_folders)&&void 0!==a&&a.length){var _,y,w;const t=this._lastUploadedBackup(this.backups),e=[];null!==(_=c.failed_agent_ids)&&void 0!==_&&_.length&&e.push("locations"),null!==(y=c.failed_addons)&&void 0!==y&&y.length&&e.push("addons"),null!==(w=c.failed_folders)&&void 0!==w&&w.length&&e.push("folders");const a=e.join("_");return this._renderSummaryCard(this.hass.localize("ui.panel.config.backup.overview.summary.last_backup_failed_heading"),"error",this.hass.localize(`ui.panel.config.backup.overview.summary.last_backup_failed_${a}_description`,{relative_time:(0,u.K)(l,this.hass.locale,i,!0)}),t?this.hass.localize("ui.panel.config.backup.overview.summary.last_successful_backup_description",{relative_time:(0,u.K)(new Date(t.date),this.hass.locale,i,!0),count:Object.keys(t.agents).length}):b,v?h:void 0)}const k=this.hass.localize("ui.panel.config.backup.overview.summary.last_successful_backup_description",{relative_time:(0,u.K)(new Date(c.date),this.hass.locale,i,!0),count:Object.keys(c.agents).length}),x=(0,o.c)((0,r.L)(i,-H),m),C=x>=1&&this.config.schedule.recurrence===f.qk.DAILY||x>=7;return this._renderSummaryCard(this.hass.localize("ui.panel.config.backup.overview.summary."+(C?"backup_too_old_heading":"backup_success_heading"),{count:x}),C?"warning":"success",k,b,v?h:void 0)}static get styles(){return[v.RF,(0,c.AH)(x||(x=C`.card-header{display:flex;flex-direction:row;align-items:center;gap:var(--ha-space-4)}p{margin:0}ha-svg-icon{flex:none}.card-actions{display:flex;justify-content:flex-end;border-top:none}ha-list-item-base{--ha-row-item-padding-block:var(--ha-space-2);--ha-row-item-min-height:40x}ha-list-item-base::part(start){color:var(--ha-color-text-secondary)}span.skeleton{position:relative;display:block;width:160px;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:loading;animation-timing-function:linear;animation-duration:1.2s;border-radius:var(--ha-border-radius-sm);height:16px;margin:2px 0;background:linear-gradient(to right,var(--card-background-color) 8%,var(--secondary-background-color) 18%,var(--card-background-color) 33%) 0% 0%/936px 104px}@keyframes loading{0%{background-position:-468px 0}100%{background-position:468px 0}}`))]}constructor(...t){super(...t),this.backups=[],this.fetching=!1,this._sortedBackups=(0,h.A)(t=>t.filter(t=>t.with_automatic_settings).sort((t,e)=>new Date(e.date).getTime()-new Date(t.date).getTime())),this._lastBackup=(0,h.A)(t=>this._sortedBackups(t)[0]),this._lastUploadedBackup=(0,h.A)(t=>this._sortedBackups(t).find(t=>{var e;return 0===(null===(e=t.failed_agent_ids)||void 0===e?void 0:e.length)})),this._createAdditionalBackupDescription=t=>()=>{(0,b.showAlertDialog)(this,{text:this.hass.localize("ui.panel.config.backup.overview.summary.additional_backup_description",{date:(0,d.Yq)(t,this.hass.locale,this.hass.config)})})}}}(0,i.Cg)([(0,l.MZ)({attribute:!1})],z.prototype,"hass",void 0),(0,i.Cg)([(0,l.MZ)({attribute:!1})],z.prototype,"backups",void 0),(0,i.Cg)([(0,l.MZ)({attribute:!1})],z.prototype,"config",void 0),(0,i.Cg)([(0,l.MZ)({type:Boolean})],z.prototype,"fetching",void 0),z=(0,i.Cg)([(0,l.EM)("ha-backup-overview-summary")],z),e()}catch(y){e(y)}})},39592:function(t,e,a){a.d(e,{D:function(){return n}});a(3362),a(62953);var i=a(1087);const s=()=>Promise.all([a.e(7014),a.e(67723),a.e(59067)]).then(a.bind(a,8022)),n=(t,e)=>new Promise(a=>{const n=null==e?void 0:e.cancel,o=null==e?void 0:e.submit;(0,i.r)(t,"show-dialog",{dialogTag:"ha-dialog-backup-onboarding",dialogImport:s,dialogParams:Object.assign(Object.assign({},e),{},{cancel:()=>{a(!1),n&&n()},submit:t=>{a(t),o&&o(t)}})})})},13407:function(t,e,a){a.d(e,{m:function(){return n}});a(3362),a(62953);var i=a(1087);const s=()=>a.e(87448).then(a.bind(a,6891)),n=(t,e)=>new Promise(a=>{const n=null==e?void 0:e.cancel,o=null==e?void 0:e.submit;(0,i.r)(t,"show-dialog",{dialogTag:"ha-dialog-change-backup-encryption-key",dialogImport:s,dialogParams:Object.assign(Object.assign({},e),{},{cancel:()=>{a(!1),n&&n()},submit:t=>{a(t),o&&o(t)}})})})},81440:function(t,e,a){a.d(e,{M:function(){return n}});a(3362),a(62953);var i=a(1087);const s=()=>a.e(81493).then(a.bind(a,44244)),n=(t,e)=>{(0,i.r)(t,"show-dialog",{dialogTag:"ha-dialog-download-decrypted-backup",dialogImport:s,dialogParams:e})}},20142:function(t,e,a){a.d(e,{f:function(){return n}});a(3362),a(62953);var i=a(1087);const s=()=>Promise.all([a.e(7014),a.e(6839)]).then(a.bind(a,60490)),n=(t,e)=>new Promise(a=>{const n=e.cancel,o=e.submit;(0,i.r)(t,"show-dialog",{dialogTag:"ha-dialog-generate-backup",dialogImport:s,dialogParams:Object.assign(Object.assign({},e),{},{cancel:()=>{a(null),n&&n()},submit:t=>{a(t),o&&o(t)}})})})},83907:function(t,e,a){a.d(e,{s:function(){return n}});a(3362),a(62953);var i=a(1087);const s=()=>a.e(23060).then(a.bind(a,35167)),n=(t,e)=>new Promise(a=>{const n=e.cancel,o=e.submit;(0,i.r)(t,"show-dialog",{dialogTag:"ha-dialog-new-backup",dialogImport:s,dialogParams:Object.assign(Object.assign({},e),{},{cancel:()=>{a(null),n&&n()},submit:t=>{a(t),o&&o(t)}})})})},17393:function(t,e,a){a.d(e,{Q:function(){return n}});a(3362),a(62953);var i=a(1087);const s=()=>a.e(11966).then(a.bind(a,50157)),n=(t,e)=>new Promise(a=>{const n=null==e?void 0:e.cancel,o=null==e?void 0:e.submit;(0,i.r)(t,"show-dialog",{dialogTag:"ha-dialog-set-backup-encryption-key",dialogImport:s,dialogParams:Object.assign(Object.assign({},e),{},{cancel:()=>{a(!1),n&&n()},submit:t=>{a(t),o&&o(t)}})})})},86801:function(t,e,a){a.d(e,{H:function(){return n}});a(3362),a(62953);var i=a(1087);const s=()=>a.e(84175).then(a.bind(a,55218)),n=(t,e)=>(0,i.r)(t,"show-dialog",{dialogTag:"ha-dialog-show-backup-encryption-key",dialogImport:s,dialogParams:e})},67320:function(t,e,a){a.d(e,{p:function(){return n}});a(3362),a(62953);var i=a(1087);const s=()=>a.e(24901).then(a.bind(a,62468)),n=(t,e)=>new Promise(a=>{const n=e.cancel,o=e.submit;(0,i.r)(t,"show-dialog",{dialogTag:"ha-dialog-upload-backup",dialogImport:s,dialogParams:Object.assign(Object.assign({},e),{},{cancel:()=>{a(null),n&&n()},submit:()=>{a(void 0),o&&o()}})})})},12510:function(t,e,a){a.a(t,async function(t,e){try{a(74423),a(26910),a(18111),a(22489),a(7588),a(61701),a(13579),a(3362),a(27495),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953),a(48408),a(14603),a(47566),a(98721);var i=a(40445),s=a(5124),n=a(67576),o=a(22786),r=a(36312),c=a(98975),l=a(93905),h=a(1087),d=a(71727),u=a(91926),p=a(18350),g=a(29823),f=(a(70947),a(64263)),v=(a(47680),a(43661),a(75248)),b=a(65829),m=(a(67094),a(31420)),_=a(47351),y=a(65063),w=a(72553),k=a(54706),x=a(14503),C=a(44144),$=a(46187),M=a(20142),A=a(83907),H=a(67320),z=a(63993),V=t([p,g,f,v,b,w,c,z,m]);[p,g,f,v,b,w,c,z,m]=V.then?(await V)():V;let S,L,I,E,O,Z,j,P,F,q,D,B,T,U=t=>t;const N="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",R="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",W="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z",J="M6,2H18A2,2 0 0,1 20,4V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2M12,4A6,6 0 0,0 6,10C6,13.31 8.69,16 12.1,16L11.22,13.77C10.95,13.29 11.11,12.68 11.59,12.4L12.45,11.9C12.93,11.63 13.54,11.79 13.82,12.27L15.74,14.69C17.12,13.59 18,11.9 18,10A6,6 0 0,0 12,4M12,9A1,1 0 0,1 13,10A1,1 0 0,1 12,11A1,1 0 0,1 11,10A1,1 0 0,1 12,9M7,18A1,1 0 0,0 6,19A1,1 0 0,0 7,20A1,1 0 0,0 8,19A1,1 0 0,0 7,18M12.09,13.27L14.58,19.58L17.17,18.08L12.95,12.77L12.09,13.27Z",K="M4,5C2.89,5 2,5.89 2,7V17C2,18.11 2.89,19 4,19H20C21.11,19 22,18.11 22,17V7C22,5.89 21.11,5 20,5H4M4.5,7A1,1 0 0,1 5.5,8A1,1 0 0,1 4.5,9A1,1 0 0,1 3.5,8A1,1 0 0,1 4.5,7M7,7H20V17H7V7M8,8V16H11V8H8M12,8V16H15V8H12M16,8V16H19V8H16M9,9H10V10H9V9M13,9H14V10H13V9M17,9H18V10H17V9Z",G="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",Y="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z",X="ha-filter-states",Q="backup-locations";class tt extends((0,k.E)(s.WF)){willUpdate(t){super.willUpdate(t),this.hasUpdated||(this._filters=this._storageFilters,this._setFiltersFromUrl())}connectedCallback(){super.connectedCallback(),window.addEventListener("location-changed",this._locationChanged),window.addEventListener("popstate",this._popState)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("location-changed",this._locationChanged),window.removeEventListener("popstate",this._popState)}_handleGroupingChanged(t){this._activeGrouping=t.detail.value}_handleCollapseChanged(t){this._activeCollapsed=t.detail.value}_handleSelectionChanged(t){this._selected=t.detail.value}render(){const t="state"in this.manager&&"in_progress"===this.manager.state,e=(0,r.x)(this.hass.config,"hassio"),a=this._data(this.backups,this._filters,this.hass.localize,e),i=Math.min(this._maxAgents(a),this.narrow?3:5);return(0,s.qy)(S||(S=U` <hass-tabs-subpage-data-table has-fab .tabs="${0}" .hass="${0}" .narrow="${0}" back-path="/config/backup/overview" clickable id="backup_id" has-filters .filters="${0}" selectable .selected="${0}" .initialGroupColumn="${0}" .initialCollapsedGroups="${0}" .groupOrder="${0}" @grouping-changed="${0}" @collapsed-changed="${0}" @selection-changed="${0}" @clear-filter="${0}" .route="${0}" @row-click="${0}" .columns="${0}" .data="${0}" .noDataText="${0}" .searchLabel="${0}"> <div slot="toolbar-icon"> <ha-dropdown @wa-select="${0}" placement="bottom-end"> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"></ha-icon-button> <ha-dropdown-item value="upload_backup"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> </ha-dropdown> </div> <div slot="selection-bar"> ${0} </div> <ha-filter-states .hass="${0}" .label="${0}" .value="${0}" .states="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .narrow="${0}"></ha-filter-states> <ha-filter-states .hass="${0}" .label="${0}" .value="${0}" .states="${0}" @data-table-filter-changed="${0}" slot="filter-pane" .narrow="${0}"></ha-filter-states> ${0} </hass-tabs-subpage-data-table> <ha-dropdown id="overflow-menu" @wa-select="${0}" @wa-after-show="${0}" @wa-after-hide="${0}"> <ha-dropdown-item value="download"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> <ha-dropdown-item variant="danger" value="delete"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> </ha-dropdown> `),[{name:this.hass.localize("ui.panel.config.backup.backups.header"),path:"/config/backup/list"}],this.hass,this.narrow,Object.values(this._filters).filter(t=>Array.isArray(t)?t.length:t&&Object.values(t).some(t=>Array.isArray(t)?t.length:t)).length,this._selected.length,this._activeGrouping,this._activeCollapsed,this._groupOrder(this._activeGrouping,this.hass.localize,e),this._handleGroupingChanged,this._handleCollapseChanged,this._handleSelectionChanged,this._clearFilter,this.route,this._showBackupDetails,this._columns(this.hass.localize,i),a,this.hass.localize("ui.panel.config.backup.no_backups"),this.hass.localize("ui.panel.config.backup.picker.search"),this._handleDropdownSelect,this.hass.localize("ui.common.menu"),R,Y,this.hass.localize("ui.panel.config.backup.backups.menu.upload_backup"),this.narrow?(0,s.qy)(I||(I=U` <ha-icon-button .label="${0}" .path="${0}" class="warning" @click="${0}"></ha-icon-button> `),this.hass.localize("ui.panel.config.backup.backups.delete_selected"),N,this._deleteSelected):(0,s.qy)(L||(L=U` <ha-button appearance="plain" @click="${0}" variant="danger"> ${0} </ha-button> `),this._deleteSelected,this.hass.localize("ui.panel.config.backup.backups.delete_selected")),this.hass,this.hass.localize("ui.panel.config.backup.backup_type"),this._filters[X],this._states(this.hass.localize,e),this._typeFilterChanged,this.narrow,this.hass,this.hass.localize("ui.panel.config.backup.locations"),this._filters[Q],this._locations(this.hass.localize,this.agents,this.backups),this._locationsFilterChanged,this.narrow,this._needsOnboarding?s.s6:(0,s.qy)(E||(E=U` <ha-button slot="fab" size="large" ?disabled="${0}" @click="${0}"> ${0} ${0} </ha-button> `),t,this._newBackup,t?(0,s.qy)(O||(O=U`<div slot="start" class="loading"> <ha-spinner .size="${0}"></ha-spinner> </div>`),"small"):(0,s.qy)(Z||(Z=U`<ha-svg-icon slot="start" .path="${0}"></ha-svg-icon>`),G),this.hass.localize("ui.panel.config.backup.backups.new_backup")),this._handleOverflowAction,this._overflowMenuOpened,this._overflowMenuClosed,W,this.hass.localize("ui.common.download"),N,this.hass.localize("ui.common.delete"))}_typeFilterChanged(t){this._filters=Object.assign(Object.assign({},this._filters),{},{[X]:t.detail.value}),this._fromUrl||(this._storageFilters=this._filters)}_locationsFilterChanged(t){this._filters=Object.assign(Object.assign({},this._filters),{},{[Q]:t.detail.value}),this._fromUrl||(this._storageFilters=this._filters)}_clearFilter(){this._filters={},this._fromUrl||(this._storageFilters={})}_setFiltersFromUrl(){const t=new URLSearchParams(window.location.search).get("type");t&&(this._fromUrl=!0,this._filters={[X]:"all"===t?[]:[t]})}get _needsOnboarding(){var t;return!(null!==(t=this.config)&&void 0!==t&&t.automatic_backups_configured)}async _newBackup(){const t=this.config,e=await(0,A.s)(this,{config:t});if(e){if("manual"===e){const t=await(0,M.f)(this,{cloudStatus:this.cloudStatus});if(!t)return;return await(0,m.SG)(this.hass,t),void(0,h.r)(this,"ha-refresh-backup-info")}"automatic"===e&&(await(0,m.IW)(this.hass),(0,h.r)(this,"ha-refresh-backup-info"))}}_showBackupDetails(t){const e=t.detail.id;(0,u.oo)(`/config/backup/details/${e}`)}async _deleteSelected(){if(await(0,y.dk)(this,{title:this.hass.localize("ui.panel.config.backup.dialogs.delete_selected.title"),text:this.hass.localize("ui.panel.config.backup.dialogs.delete_selected.text"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0})){try{await Promise.all(this._selected.map(t=>(0,m.mu)(this.hass,t)))}catch(t){return void(0,y.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.backup.dialogs.delete_selected.failed"),text:(0,_.VR)(t)})}(0,h.r)(this,"ha-refresh-backup-info"),this._dataTable.clearSelection()}}_handleDropdownSelect(t){var e;"upload_backup"===(null===(e=t.detail)||void 0===e?void 0:e.item.value)&&this._uploadBackup()}static get styles(){return[x.RF,(0,s.AH)(j||(j=U`.loading{display:flex}ha-spinner{--ha-spinner-indicator-color:var(--mdc-theme-on-secondary)}`))]}constructor(...t){super(...t),this.narrow=!1,this.backups=[],this.agents=[],this._selected=[],this._filters={},this._storageFilters={},this._fromUrl=!1,this._activeGrouping="formatted_type",this._activeCollapsed=[],this._openingOverflow=!1,this._locationChanged=()=>{this._setFiltersFromUrl()},this._popState=()=>{this._setFiltersFromUrl()},this._columns=(0,o.A)((t,e)=>({name:{title:t("ui.panel.config.backup.name"),main:!0,sortable:!0,filterable:!0,flex:3},size:{title:t("ui.panel.config.backup.size"),filterable:!0,sortable:!0,template:t=>(0,$.A)(t.size)},date:{title:t("ui.panel.config.backup.created"),direction:"desc",filterable:!0,sortable:!0,template:t=>(0,c.K)(new Date(t.date),this.hass.locale)},formatted_type:{title:t("ui.panel.config.backup.backup_type"),filterable:!0,sortable:!0,groupable:!0},locations:{title:t("ui.panel.config.backup.locations"),showNarrow:!0,minWidth:24*e+4*(e-1)+32+"px",template:t=>{const a=t.agent_ids,i=a.length>e?[...a].splice(0,e-1):a,n=Math.max(a.length-i.length,0);return(0,s.qy)(P||(P=U` <div style="display:flex;gap:var(--ha-space-1)"> ${0} ${0} </div> `),i.map(t=>{var e;const a=(0,m.q7)(this.hass.localize,t,this.agents);if((0,m.Bi)(t))return(0,s.qy)(F||(F=U` <ha-svg-icon .path="${0}" title="${0}" style="flex-shrink:0"></ha-svg-icon> `),J,a);if((0,m.jU)(t))return(0,s.qy)(q||(q=U` <ha-svg-icon .path="${0}" title="${0}" style="flex-shrink:0"></ha-svg-icon> `),K,a);const i=(0,d.m)(t);return(0,s.qy)(D||(D=U` <img title="${0}" .src="${0}" height="24" crossorigin="anonymous" referrerpolicy="no-referrer" alt="${0}" slot="graphic" style="flex-shrink:0"> `),a,(0,C.MR)({domain:i,type:"icon",darkOptimized:null===(e=this.hass.themes)||void 0===e?void 0:e.darkMode},this.hass.auth.data.hassUrl),a)}),n?(0,s.qy)(B||(B=U` <span style="display:flex;align-items:center;font-size:var(--ha-font-size-m)"> +${0} </span> `),n):s.s6)}},actions:{lastFixed:!0,title:"",label:t("ui.panel.config.generic.headers.actions"),showNarrow:!0,type:"overflow-menu",template:t=>(0,s.qy)(T||(T=U` <ha-icon-button .backup="${0}" .label="${0}" .path="${0}" @click="${0}"></ha-icon-button> `),t,this.hass.localize("ui.common.overflow_menu"),R,this._toggleOverflowMenu)}})),this._groupOrder=(0,o.A)((t,e,a)=>"formatted_type"===t?(0,m.q5)(a).map(t=>e(`ui.panel.config.backup.type.${t}`)):void 0),this._toggleOverflowMenu=t=>{this._overflowMenu&&(this._overflowMenu.anchorElement!==t.target?(this._openingOverflow=!0,this._overflowMenu.anchorElement=t.target,this._overflowBackup=t.target.backup,this._overflowMenu.open=!0):this._overflowMenu.anchorElement=void 0)},this._overflowMenuOpened=()=>{this._openingOverflow=!1},this._overflowMenuClosed=()=>{!this._openingOverflow&&this._overflowMenu&&(this._overflowMenu.anchorElement=void 0)},this._data=(0,o.A)((t,e,a,i)=>{const s=e[X],n=e[Q];let o=t;return null!=s&&s.length&&(o=o.filter(t=>{const e=(0,m.sp)(t,i);return s.includes(e)})),null!=n&&n.length&&(o=o.filter(t=>Object.keys(t.agents).some(t=>n.includes(t)))),o.map(t=>{const e=(0,m.sp)(t,i),s=Object.keys(t.agents);return Object.assign(Object.assign({},t),{},{size:(0,m.v3)(t),agent_ids:s.sort(m.yj),formatted_type:a(`ui.panel.config.backup.type.${e}`)})})}),this._maxAgents=(0,o.A)(t=>Math.max(1,...t.map(t=>t.agent_ids.length))),this._locations=(0,o.A)((t,e,a)=>{const i=new Set(e.map(t=>t.agent_id));return a.forEach(t=>{Object.keys(t.agents).forEach(t=>i.add(t))}),Array.from(i).sort(m.yj).map(a=>({value:a,label:(0,m.q7)(t,a,e)}))}),this._states=(0,o.A)((t,e)=>(0,m.q5)(e).map(e=>({value:e,label:t(`ui.panel.config.backup.type.${e}`)}))),this._uploadBackup=async()=>{await(0,H.p)(this,{})},this._handleOverflowAction=t=>{const e=t.detail.item.value;"download"!==e?"delete"===e&&this._deleteBackup():this._downloadBackup()},this._downloadBackup=async()=>{const t=this._overflowBackup;t&&(0,z.$)(this.hass,this,t,this.config)},this._deleteBackup=async()=>{const t=this._overflowBackup;if(!t)return;if(await(0,y.dk)(this,{title:this.hass.localize("ui.panel.config.backup.dialogs.delete.title"),text:this.hass.localize("ui.panel.config.backup.dialogs.delete.text"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0})){try{await(0,m.mu)(this.hass,t.backup_id),this._selected.includes(t.backup_id)&&(this._selected=this._selected.filter(e=>e!==t.backup_id))}catch(e){return void(0,y.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.backup.dialogs.delete.failed"),text:(0,_.VR)(e)})}(0,h.r)(this,"ha-refresh-backup-info")}}}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],tt.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],tt.prototype,"cloudStatus",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],tt.prototype,"narrow",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],tt.prototype,"route",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],tt.prototype,"manager",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],tt.prototype,"backups",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],tt.prototype,"config",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],tt.prototype,"agents",void 0),(0,i.Cg)([(0,n.wk)()],tt.prototype,"_selected",void 0),(0,i.Cg)([(0,n.wk)()],tt.prototype,"_filters",void 0),(0,i.Cg)([(0,l.I)({storage:"sessionStorage",key:"backups-table-filters",state:!1,subscribe:!1})],tt.prototype,"_storageFilters",void 0),(0,i.Cg)([(0,l.I)({key:"backups-table-grouping",state:!1,subscribe:!1})],tt.prototype,"_activeGrouping",void 0),(0,i.Cg)([(0,l.I)({key:"backups-table-collapsed",state:!1,subscribe:!1})],tt.prototype,"_activeCollapsed",void 0),(0,i.Cg)([(0,n.P)("hass-tabs-subpage-data-table",!0)],tt.prototype,"_dataTable",void 0),(0,i.Cg)([(0,n.P)("#overflow-menu")],tt.prototype,"_overflowMenu",void 0),tt=(0,i.Cg)([(0,n.EM)("ha-config-backup-backups")],tt),e()}catch(S){e(S)}})},64202:function(t,e,a){a.a(t,async function(t,e){try{a(74423),a(18111),a(61701),a(3362),a(62953);var i=a(40445),s=a(5124),n=a(67576),o=a(1087),r=a(9899),c=a(18350),l=(a(76776),a(29823)),h=(a(70947),a(47680),a(43661),a(75248)),d=a(65829),u=(a(67094),a(31420)),p=a(81310),g=a(72553),f=a(14503),v=a(33963),b=a(37536),m=(a(80931),a(4570)),_=a(41264),y=a(77994),w=a(46971),k=a(25654),x=a(39592),C=a(20142),$=a(83907),M=a(67320),A=t([c,l,h,d,p,g,b,m,_,y,w,k,v,u]);[c,l,h,d,p,g,b,m,_,y,w,k,v,u]=A.then?(await A)():A;let H,z,V,S,L,I,E,O,Z,j=t=>t;const P="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",F="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",q="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z";class D extends s.WF{willUpdate(t){super.willUpdate(t),t.has("config")&&!this._config&&(this._config=this.config)}connectedCallback(){super.connectedCallback(),this._config=this.config}_encryptionKeyChanged(t){if(!this._config)return;const e=t.detail.value;this._config=Object.assign(Object.assign({},this._config),{},{create_backup:Object.assign(Object.assign({},this._config.create_backup),{},{password:e})}),this._debounceSaveConfig()}async _saveConfig(){this._config&&(await(0,u.gF)(this.hass,this._config),(0,o.r)(this,"ha-refresh-backup-config"))}_handleOnboardingButtonClick(t){t.stopPropagation(),this._setupAutomaticBackup(!0)}async _setupAutomaticBackup(t=!1){if(await(0,x.D)(this,{config:this.config,cloudStatus:this.cloudStatus,skipWelcome:t})){(0,o.r)(this,"ha-refresh-backup-config");try{await(0,u.IW)(this.hass)}catch(e){return void(0,v.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.backup.overview.create_backup_failed"),text:e.message})}(0,o.r)(this,"ha-refresh-backup-info")}}async _newBackup(){if(this._needsOnboarding)return void this._setupAutomaticBackup();if(!this.config)return;const t=this.config,e=await(0,$.s)(this,{config:t});if(e){try{if("manual"===e){const t=await(0,C.f)(this,{cloudStatus:this.cloudStatus});if(!t)return;await(0,u.SG)(this.hass,t)}else"automatic"===e&&await(0,u.IW)(this.hass)}catch(a){return void(0,v.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.backup.overview.create_backup_failed"),text:a.message})}(0,o.r)(this,"ha-refresh-backup-info")}}get _needsOnboarding(){return this.config&&!this.config.automatic_backups_configured}render(){const t="state"in this.manager&&"in_progress"===this.manager.state;return(0,s.qy)(H||(H=j` <hass-subpage back-path="/config/system" .hass="${0}" .narrow="${0}" .header="${0}"> <ha-dropdown slot="toolbar-icon" placement="bottom-end" @wa-select="${0}"> <ha-icon-button slot="trigger" .label="${0}" .path="${0}"></ha-icon-button> <ha-dropdown-item value="upload_backup"> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-dropdown-item> </ha-dropdown> <div class="content"> ${0} ${0} <ha-backup-overview-backups .hass="${0}" .backups="${0}"></ha-backup-overview-backups> ${0} </div> <ha-button slot="fab" size="large" .loading="${0}" @click="${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> ${0} </ha-button> </hass-subpage> `),this.hass,this.narrow,this.hass.localize("ui.panel.config.backup.overview.header"),this._handleDropdownSelect,this.hass.localize("ui.common.menu"),P,q,this.hass.localize("ui.panel.config.backup.overview.menu.upload_backup"),this.info&&Object.keys(this.info.agent_errors).length?(0,s.qy)(z||(z=j`${0}`),Object.entries(this.info.agent_errors).map(([t,e])=>(0,s.qy)(V||(V=j`<ha-alert alert-type="error" .title="${0}"> ${0} </ha-alert>`),this.hass.localize("ui.panel.config.backup.overview.agent_error",{name:(0,u.q7)(this.hass.localize,t,this.agents)}),e))):s.s6,t?(0,s.qy)(S||(S=j` <ha-backup-overview-progress .hass="${0}" .manager="${0}" .agents="${0}" .uploadProgress="${0}"> </ha-backup-overview-progress> `),this.hass,this.manager,this.agents,this.uploadProgress):this._needsOnboarding?(0,s.qy)(L||(L=j` <ha-backup-overview-onboarding .hass="${0}" @button-click="${0}"> </ha-backup-overview-onboarding> `),this.hass,this._handleOnboardingButtonClick):this.config?(0,s.qy)(I||(I=j` <ha-backup-overview-summary .hass="${0}" .backups="${0}" .config="${0}" .fetching="${0}"> </ha-backup-overview-summary> `),this.hass,this.backups,this.config,this.fetching):s.s6,this.hass,this.backups,!this._needsOnboarding&&this._config?(0,s.qy)(E||(E=j` <ha-card> <div class="card-header"> ${0} </div> <div class="card-content"> <p> ${0} </p> <ha-backup-config-encryption-key .hass="${0}" .value="${0}" @value-changed="${0}"></ha-backup-config-encryption-key> </div> </ha-card> <ha-backup-overview-settings .hass="${0}" .config="${0}" .agents="${0}"></ha-backup-overview-settings> ${0} `),this.hass.localize("ui.panel.config.backup.settings.encryption_key.title"),this.hass.localize("ui.panel.config.backup.settings.encryption_key.description"),this.hass,this._config.create_backup.password,this._encryptionKeyChanged,this.hass,this._config,this.agents,this.hass.config.components.includes("hassio")?(0,s.qy)(O||(O=j` <ha-backup-overview-app-update-backup .hass="${0}"></ha-backup-overview-app-update-backup> `),this.hass):s.s6):s.s6,t,this._newBackup,F,this.hass.localize("ui.panel.config.backup.overview.new_backup"))}_handleDropdownSelect(t){var e;"upload_backup"===(null===(e=t.detail)||void 0===e?void 0:e.item.value)&&this._uploadBackup()}static get styles(){return[f.RF,(0,s.AH)(Z||(Z=j`p{color:var(--secondary-text-color)}.content{padding:28px 20px 0;max-width:690px;margin:0 auto;gap:var(--ha-space-6);display:flex;flex-direction:column;margin-bottom:calc(var(--safe-area-inset-bottom) + 72px)}.card-actions{display:flex;justify-content:flex-end}.loading{display:flex}ha-spinner{--ha-spinner-indicator-color:var(--mdc-theme-on-secondary)}`))]}constructor(...t){super(...t),this.narrow=!1,this.backups=[],this.fetching=!1,this.agents=[],this.uploadProgress={},this._uploadBackup=async()=>{await(0,M.p)(this,{})},this._debounceSaveConfig=(0,r.s)(()=>this._saveConfig(),500)}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],D.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],D.prototype,"cloudStatus",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],D.prototype,"narrow",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],D.prototype,"route",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],D.prototype,"manager",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],D.prototype,"info",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],D.prototype,"backups",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],D.prototype,"fetching",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],D.prototype,"config",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],D.prototype,"agents",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],D.prototype,"uploadProgress",void 0),(0,i.Cg)([(0,n.wk)()],D.prototype,"_config",void 0),D=(0,i.Cg)([(0,n.EM)("ha-config-backup-overview")],D),e()}catch(H){e(H)}})},51348:function(t,e,a){a.a(t,async function(t,i){try{a.r(e);a(26910),a(18111),a(13579),a(3362),a(9391),a(62953);var s=a(40445),n=a(67576),o=a(9899),r=a(31420),c=a(30884),l=a(77423),h=a(324),d=a(72553),u=a(54706),p=a(81619),g=a(12510),f=a(64202),v=t([d,g,f,r]);[d,g,f,r]=v.then?(await v)():v;class b extends((0,u.E)(h.a)){firstUpdated(t){super.firstUpdated(t),this._fetchAll(),this.addEventListener("ha-refresh-backup-info",()=>{this._fetchBackupInfo()}),this.addEventListener("ha-refresh-backup-config",()=>{this._fetchBackupConfig()}),this.addEventListener("ha-refresh-backup-agents",()=>{this._fetchBackupAgents()})}_fetchAll(){this._fetching=!0,Promise.all([this._fetchBackupInfo(),this._fetchBackupConfig(),this._fetchBackupAgents()]).finally(()=>{this._fetching=!1})}connectedCallback(){super.connectedCallback(),this.hasUpdated&&(this._fetchBackupInfo(),this._fetchBackupConfig(),this._fetchBackupAgents())}disconnectedCallback(){this._debouncedFetchBackupAgents.cancel(),super.disconnectedCallback()}async _fetchBackupInfo(){this._info=await(0,r.pI)(this.hass)}async _fetchBackupConfig(){const{config:t}=await(0,r.Xm)(this.hass);this._config=t}async _fetchBackupAgents(){const{agents:t}=await(0,r.P_)(this.hass);this._agents=t.sort((t,e)=>(0,r.yj)(t.agent_id,e.agent_id))}updatePageEl(t,e){var a;if(t.hass=this.hass,t.route=this.routeTail,t.narrow=this.narrow,t.cloudStatus=this.cloudStatus,t.manager=this._manager,t.info=this._info,t.backups=(null===(a=this._info)||void 0===a?void 0:a.backups)||[],t.config=this._config,t.agents=this._agents,t.fetching=this._fetching,t.uploadProgress=this._uploadProgress,!e||e.has("route"))switch(this._currentPage){case"details":t.backupId=this.routeTail.path.substr(1);break;case"location":t.agentId=this.routeTail.path.substr(1)}}hassSubscribe(){return[(0,l.TC)(this.hass,t=>{t.some(t=>null!==t.type)&&this._debouncedFetchBackupAgents()},{type:["service"]}),(0,c.A)(this.hass,t=>{if("agent_id"in t)return void(this._uploadProgress=Object.assign(Object.assign({},this._uploadProgress),{},{[t.agent_id]:{uploaded_bytes:t.uploaded_bytes,total_bytes:t.total_bytes}}));const e=this._manager.manager_state;if(this._manager=t,"idle"===t.manager_state&&t.manager_state!==e&&(this._uploadProgress={},this._fetchAll()),"state"in t&&"failed"===t.state){let t="";switch(this._manager.manager_state){case"create_backup":t="Failed to create backup";break;case"restore_backup":t="Failed to restore backup";break;case"receive_backup":t="Failed to upload backup"}t&&(0,p.P)(this,{message:t})}})]}constructor(...t){super(...t),this.narrow=!1,this._manager=c.K,this._agents=[],this._fetching=!1,this._uploadProgress={},this._debouncedFetchBackupAgents=(0,o.s)(()=>this._fetchBackupAgents(),500,!1),this.routerOptions={defaultPage:"overview",routes:{overview:{tag:"ha-config-backup-overview",cache:!0},backups:{tag:"ha-config-backup-backups",cache:!0},details:{tag:"ha-config-backup-details",load:()=>a.e(39236).then(a.bind(a,96303))},settings:{tag:"ha-config-backup-settings",load:()=>Promise.all([a.e(7014),a.e(67723),a.e(88661)]).then(a.bind(a,12084)),cache:!0},"app-update-backups":{tag:"ha-config-backup-app-update-backups",load:()=>a.e(18893).then(a.bind(a,41596)),cache:!0},location:{tag:"ha-config-backup-location",load:()=>a.e(47987).then(a.bind(a,14878))}}}}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],b.prototype,"cloudStatus",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],b.prototype,"narrow",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_manager",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_info",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_agents",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_fetching",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_config",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_uploadProgress",void 0),b=(0,s.Cg)([(0,n.EM)("ha-config-backup")],b),i()}catch(b){i(b)}})},63993:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{$:function(){return d},s:function(){return h}});a(3362);var s=a(82e3),n=a(31420),o=a(30039),r=a(33963),c=a(81440),l=t([n,r]);[n,r]=l.then?(await l)():l;const h=async(t,e,a,i)=>{const r=await(0,s.e0)(t,(0,n.yL)(e,a,i));(0,o.R)(r.path)},d=async(t,e,a,i,s)=>{var o,l;const d=Object.keys(a.agents),u=null!=s?s:(0,n.EB)(d);if(!(null===(o=a.agents[u])||void 0===o?void 0:o.protected))return void h(t,a.backup_id,u);const p=null==i||null===(l=i.create_backup)||void 0===l?void 0:l.password;if(p)try{await(0,n.Zm)(t,a.backup_id,u,p),h(t,a.backup_id,u,p)}catch(g){if("password_incorrect"===(null==g?void 0:g.code))return void(0,c.M)(e,{backup:a,agentId:u});if("decrypt_not_supported"===(null==g?void 0:g.code))return void(0,r.showAlertDialog)(e,{title:t.localize("ui.panel.config.backup.dialogs.download.decryption_unsupported_title"),text:t.localize("ui.panel.config.backup.dialogs.download.decryption_unsupported"),confirm(){h(t,a.backup_id,u)}});(0,r.showAlertDialog)(e,{title:t.localize("ui.panel.config.backup.dialogs.download.error_check_title",{error:g.message}),text:t.localize("ui.panel.config.backup.dialogs.download.error_check_description",{error:g.message})})}else(0,c.M)(e,{backup:a,agentId:u})};i()}catch(h){i(h)}})},34128:function(t,e,a){a.d(e,{G9:function(){return o},Ni:function(){return n},Ue:function(){return h},Vd:function(){return d},gh:function(){return u}});a(16280),a(74423),a(3362),a(62953);var i=a(1087),s=a(45291);const n=t=>{const e=document.createElement("hui-error-card");return customElements.get("hui-error-card")?e.setConfig(t):(Promise.resolve().then(a.bind(a,4397)),customElements.whenDefined("hui-error-card").then(()=>{customElements.upgrade(e),e.setConfig(t)})),e},o=(t,e)=>({type:"error",error:t,origConfig:e}),r=(t,e)=>{const a=document.createElement(t);return a.setConfig(e),a},c=(t,e,i)=>"badge"===t?(t=>{const e=document.createElement("hui-error-badge");return customElements.get("hui-error-badge")?e.setConfig(t):(Promise.all([a.e(92769),a.e(3283),a.e(72130),a.e(85010),a.e(67218),a.e(98470),a.e(99788),a.e(66283),a.e(82134),a.e(45981),a.e(26092),a.e(39005),a.e(34310),a.e(59704),a.e(25322),a.e(55392),a.e(89747),a.e(71572),a.e(36332),a.e(77563),a.e(15862),a.e(99143),a.e(41344),a.e(12009),a.e(66990),a.e(3025),a.e(38108),a.e(57693),a.e(38260)]).then(a.bind(a,50655)),customElements.whenDefined("hui-error-badge").then(()=>{customElements.upgrade(e),e.setConfig(t)})),e})(o(e,i)):"heading-badge"===t?(t=>{const e=document.createElement("hui-error-heading-badge");return customElements.get("hui-error-heading-badge")?e.setConfig(t):(Promise.all([a.e(92769),a.e(3283),a.e(72130),a.e(85010),a.e(67218),a.e(98470),a.e(99788),a.e(66283),a.e(82134),a.e(45981),a.e(26092),a.e(39005),a.e(34310),a.e(59704),a.e(25322),a.e(55392),a.e(89747),a.e(71572),a.e(36332),a.e(77563),a.e(15862),a.e(99143),a.e(41344),a.e(12009),a.e(66990),a.e(3025),a.e(38108),a.e(57693),a.e(21614)]).then(a.bind(a,13469)),customElements.whenDefined("hui-error-heading-badge").then(()=>{customElements.upgrade(e),e.setConfig(t)})),e})(((t,e)=>({type:"error",error:t,origConfig:e}))(e,i)):n({type:"error",message:e}),l=t=>(0,s.c8)(t)?(0,s.Iu)(t):void 0,h=(t,e,a,i,s,n)=>{try{return d(t,e,a,i,s,n)}catch(o){return console.error(t,e.type,o),c(t,o.message,e)}},d=(t,e,a,s,n,o)=>{if(!e||"object"!=typeof e)throw new Error("Config is not an object");if(!(e.type||o||n&&"entity"in e))throw new Error("No card type configured");const h=e.type?l(e.type):void 0;if(h)return((t,e,a)=>{if(customElements.get(e))return r(e,a);const s=c(t,`Custom element doesn't exist: ${e}.`,a);if(!e.includes("-"))return s;s.style.display="None";const n=window.setTimeout(()=>{s.style.display=""},2e3);return customElements.whenDefined(e).then(()=>{clearTimeout(n),(0,i.r)(s,"ll-rebuild")}),s})(t,h,e);let d;if(n&&!e.type&&e.entity){d=`${n[e.entity.split(".",1)[0]]||n._domain_not_found}-entity`}else d=e.type||o;if(void 0===d)throw new Error("No type specified");const u=`hui-${d}-${t}`;if(s&&d in s)return s[d](),((t,e)=>{if(customElements.get(t))return r(t,e);const a=document.createElement(t);return customElements.whenDefined(t).then(()=>{try{customElements.upgrade(a),(0,i.r)(a,"ll-upgrade"),a.setConfig(e)}catch(t){(0,i.r)(a,"ll-rebuild")}}),a})(u,e);if(a&&a.has(d))return r(u,e);throw new Error(`Unknown type encountered: ${d}`)},u=async(t,e,a,i)=>{const s=l(t);if(s){const t=customElements.get(s);if(t)return t;if(!s.includes("-"))throw new Error(`Custom element not found: ${s}`);return new Promise((t,e)=>{setTimeout(()=>e(new Error(`Custom element not found: ${s}`)),2e3),customElements.whenDefined(s).then(()=>t(customElements.get(s)))})}const n=`hui-${t}-${e}`,o=customElements.get(n);if(a&&a.has(t))return o;if(i&&t in i)return o||i[t]().then(()=>customElements.get(n));throw new Error(`Unknown type: ${t}`)}},94225:function(t,e,a){a.a(t,async function(t,i){try{a.d(e,{T:function(){return _},t:function(){return y}});a(3362),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);var s=a(99799),n=a(29003),o=a(92055),r=a(19396),c=a(74323),l=a(51199),h=a(43721),d=a(65509),u=a(21659),p=a(82525),g=a(34128),f=t([s,n,o,r,c,l,h,d,u,p]);[s,n,o,r,c,l,h,d,u,p]=f.then?(await f)():f;const v=new Set(["media-player-entity","scene-entity","script-entity","sensor-entity","simple-entity","toggle-entity","button","call-service"]),b={"button-entity":()=>a.e(26846).then(a.bind(a,21869)),"climate-entity":()=>a.e(56995).then(a.bind(a,2798)),"cover-entity":()=>a.e(41243).then(a.bind(a,79734)),"date-entity":()=>a.e(17418).then(a.bind(a,75473)),"datetime-entity":()=>Promise.all([a.e(99194),a.e(24617),a.e(55328)]).then(a.bind(a,69690)),"event-entity":()=>Promise.resolve().then(a.bind(a,99799)),"group-entity":()=>a.e(68827).then(a.bind(a,53110)),"input-button-entity":()=>a.e(19825).then(a.bind(a,46472)),"humidifier-entity":()=>a.e(378).then(a.bind(a,53537)),"input-datetime-entity":()=>a.e(71748).then(a.bind(a,1391)),"input-number-entity":()=>a.e(17600).then(a.bind(a,58723)),"input-select-entity":()=>a.e(44325).then(a.bind(a,54596)),"input-text-entity":()=>a.e(8086).then(a.bind(a,51765)),"lock-entity":()=>a.e(28245).then(a.bind(a,49748)),"number-entity":()=>a.e(71523).then(a.bind(a,57198)),"select-entity":()=>a.e(9374).then(a.bind(a,78157)),"text-entity":()=>a.e(67973).then(a.bind(a,58212)),"time-entity":()=>Promise.all([a.e(21209),a.e(7004)]).then(a.bind(a,87550)),"timer-entity":()=>a.e(94097).then(a.bind(a,6344)),"update-entity":()=>a.e(80275).then(a.bind(a,38238)),"valve-entity":()=>a.e(96654).then(a.bind(a,46493)),conditional:()=>Promise.all([a.e(67218),a.e(77563),a.e(78490)]).then(a.bind(a,80725)),"weather-entity":()=>Promise.all([a.e(12009),a.e(77547)]).then(a.bind(a,80395)),divider:()=>a.e(45249).then(a.bind(a,38584)),section:()=>a.e(51255).then(a.bind(a,39082)),weblink:()=>a.e(69148).then(a.bind(a,65751)),cast:()=>a.e(10405).then(a.bind(a,96612)),buttons:()=>a.e(50777).then(a.bind(a,65728)),attribute:()=>Promise.resolve().then(a.bind(a,65509)),text:()=>a.e(95421).then(a.bind(a,3980))},m={_domain_not_found:"simple",alert:"toggle",automation:"toggle",button:"button",climate:"climate",cover:"cover",date:"date",datetime:"datetime",event:"event",fan:"toggle",group:"group",humidifier:"humidifier",input_boolean:"toggle",input_button:"input-button",input_datetime:"input-datetime",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",number:"number",remote:"toggle",scene:"scene",script:"script",select:"select",sensor:"sensor",siren:"toggle",switch:"toggle",text:"text",time:"time",timer:"timer",update:"update",vacuum:"toggle",valve:"valve",water_heater:"climate",weather:"weather"},_=t=>(0,g.Ue)("row",t,v,b,m,void 0),y=t=>(0,g.gh)(t,"row",v,b);i()}catch(v){i(v)}})},69235:function(t,e,a){a.a(t,async function(t,e){try{a(3362),a(62953);"function"!=typeof window.ResizeObserver&&(window.ResizeObserver=(await a.e(71055).then(a.bind(a,52370))).default),e()}catch(i){e(i)}},1)},14503:function(t,e,a){a.d(e,{RF:function(){return u},dp:function(){return f},kO:function(){return g},nA:function(){return p},og:function(){return d}});var i=a(5124);let s,n,o,r,c,l,h=t=>t;const d=(0,i.AH)(s||(s=h`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`)),u=(0,i.AH)(n||(n=h`:host{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-m);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}.header{transition:box-shadow .2s linear,width var(--ha-animation-duration-normal) ease,padding-left var(--ha-animation-duration-normal) ease,padding-right var(--ha-animation-duration-normal) ease}@media (prefers-reduced-motion:reduce){.header{transition:box-shadow .2s linear}}h1{font-family:var(--ha-font-family-heading);-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)}h2{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-normal)}h3{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-l);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}${0} .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}`),d),p=(0,i.AH)(o||(o=h`ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:400px;--mdc-dialog-max-width:600px;--mdc-dialog-max-width:min(600px, 95vw);--justify-action-buttons:space-between;--dialog-container-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--dialog-surface-padding:0px}ha-adaptive-dialog .form,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-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:100vw;--mdc-dialog-max-width:100vw;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--dialog-container-padding:0px;--dialog-surface-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--vertical-align-dialog:flex-end}ha-dialog{--ha-dialog-border-radius:var(--ha-border-radius-square)}}.error{color:var(--error-color)}`)),g=(0,i.AH)(r||(r=h`ha-adaptive-dialog,ha-dialog{--vertical-align-dialog:flex-start;--dialog-surface-margin-top:var(--ha-space-10);--mdc-dialog-max-height:calc(
100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--mdc-dialog-max-height:calc(
100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--ha-dialog-max-height:calc(
100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--ha-dialog-max-height:calc(
100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
)}@media all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--dialog-surface-margin-top:0px;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--ha-dialog-max-height:100vh;--ha-dialog-max-height:100svh}}`)),f=(0,i.AH)(c||(c=h`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{border-radius:var(--ha-border-radius-sm);background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`));(0,i.AH)(l||(l=h`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`))},46187:function(t,e,a){a.d(e,{A:function(){return i}});const i=(t=0,e=2)=>{if(0===t)return"0 Bytes";e=e<0?0:e;const a=Math.floor(Math.log(t)/Math.log(1024));return`${parseFloat((t/1024**a).toFixed(e))} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][a]}`}},30039:function(t,e,a){a.d(e,{R:function(){return s}});a(62953),a(3296),a(27208),a(48408),a(14603),a(47566),a(98721);var i=a(16869);const s=(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))}}}]);