UNPKG

iobroker.lovelace

Version:

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

66 lines 152 kB
export const __rspack_esm_id=23624;export const __rspack_esm_ids=[23624];export const __webpack_modules__={36356(t,e,a){a.d(e,{q:()=>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(){this._scrollContainer=this._host.renderRoot?.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=a??!0,t.addController(this)}}},380(t,e,a){a.d(e,{D:()=>r,P:()=>n});a(74423);var i=a(67932),s=a(46927),o=a(96029);const n=t=>t.first_weekday===s.zt.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(t.language).weekInfo.firstDay%7:(0,i.S)(t.language)%7:o.Z.includes(t.first_weekday)?o.Z.indexOf(t.first_weekday):1,r=t=>{const e=n(t);return o.Z[e]}},95747(t,e,a){a.a(t,async function(t,i){try{a.d(e,{CL:()=>_,GH:()=>k,Rl:()=>u,ZS:()=>m,aQ:()=>v,r6:()=>d,yg:()=>y});var s=a(74487),o=a(22786),n=a(72487),r=a(30162),l=a(8480),c=a(69543),h=t([s,l,n,r]);[s,l,n,r]=h.then?(await h)():h;const d=(t,e,a)=>p(e,a.time_zone).format(t),p=(0,o.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,c.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,c.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),u=t=>g().format(t),g=(0,o.A)(()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})),v=(t,e,a)=>b(e,a.time_zone).format(t),b=(0,o.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"short",day:"numeric",hour:(0,c.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,c.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),m=(t,e,a)=>f(e,a.time_zone).format(t),f=(0,o.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"short",day:"numeric",hour:(0,c.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,c.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),_=(t,e,a)=>(new Date).getFullYear()===t.getFullYear()?m(t,e,a):v(t,e,a),y=(t,e,a)=>w(e,a.time_zone).format(t),w=(0,o.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,c.J)(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,c.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),k=(t,e,a)=>`${(0,n.zB)(t,e,a)}, ${(0,r.fU)(t,e,a)}`;i()}catch(t){i(t)}})},98975(t,e,a){a.a(t,async function(t,i){try{a.d(e,{K:()=>c});var s=a(74487),o=a(22786),n=a(63927),r=t([s,n]);[s,n]=r.then?(await r)():r;const l=(0,o.A)(t=>new Intl.RelativeTimeFormat(t.language,{numeric:"auto"})),c=(t,e,a,i=!0)=>{const s=(0,n.x)(t,a,e);return i?l(e).format(s.value,s.unit):Intl.NumberFormat(e.language,{style:"unit",unit:s.unit,unitDisplay:"long"}).format(Math.abs(s.value))};i()}catch(t){i(t)}})},8480(t,e,a){a.a(t,async function(t,i){try{a.d(e,{fL:()=>h,n2:()=>d,wj:()=>p});var s=a(74487),o=a(29079),n=a(46927),r=t([s]);s=(r.then?(await r)():r)[0];const l=Intl.DateTimeFormat?.().resolvedOptions?.().timeZone,c=l&&("UTC"===l||"Etc/UTC"===l||l in o)?l:void 0,h=14881==a.j?void 0!==c:null,d=c??"UTC",p=(t,e)=>t===n.Wj.local&&c?d:e;i()}catch(t){i(t)}})},96029(t,e,a){a.d(e,{Tq:()=>n,Z:()=>s,ZV:()=>i,sj:()=>o});const i=["sun","mon","tue","wed","thu","fri","sat"],s=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],o={0:"sun",1:"mon",2:"tue",3:"wed",4:"thu",5:"fri",6:"sat"},n={sun:"sunday",mon:"monday",tue:"tuesday",wed:"wednesday",thu:"thursday",fri:"friday",sat:"saturday"}},93421(t,e,a){a.d(e,{IW:()=>h,dH:()=>c,fI:()=>l});a(44114);var i=a(35211),s=a(22792),o=a(32172);const n=(t,e)=>{let a=t;for(const t of e){if(null==a)return;a=a[t]}return a},r=(t,e,a)=>{const s=(0,o.p)({transformer:function(t){return a.call(this,t)},watch:e?[e]:[]}),n=(0,i.Fg)({context:t,subscribe:!0});return(t,e)=>{s(t,e),n(t,e)}},l=t=>r(s.iN,t.entityIdPath[0],function(e){const a=n(this,t.entityIdPath);return"string"==typeof a?e?.[a]:void 0}),c=t=>r(s.X1,t.entityIdPath[0],function(e){const a=n(this,t.entityIdPath);return"string"==typeof a?e?.[a]:void 0}),h=()=>r(s.D5,void 0,({localize:t})=>t)},93905(t,e,a){a.d(e,{I:()=>o});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(t){}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 o(t){return(e,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const o=t.storage||"localStorage";let n;o&&o in s?n=s[o]:(n=new i(window[o]),s[o]=n);const r=t.key||String(a);n.addFromStorage(r);const l=!1!==t.subscribe?t=>n.subscribeChanges(r,(e,i)=>{t.requestUpdate(a,e)}):void 0,c=()=>n.hasKey(r)?t.deserializer?t.deserializer(n.getValue(r)):n.getValue(r):void 0,h=(e,i)=>{let s;t.state&&(s=c()),n.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=l?.(this))},e.disconnectedCallback=function(){a.call(this);this.__unbsubLocalStorage?.(),this.__unbsubLocalStorage=void 0}}const p=Object.getOwnPropertyDescriptor(e,a);let u;if(void 0===p)u={get:()=>c(),set(t){(this.__initialized||void 0===c())&&h(this,t)},configurable:!0,enumerable:!0};else{const t=p.set;u={...p,get:()=>c(),set(e){(this.__initialized||void 0===c())&&h(this,e),t?.call(this,e)}}}Object.defineProperty(e,a,u)}}},32172(t,e,a){a.d(e,{p:()=>i});a(18111),a(7588),a(45367),a(92731),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);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 o=Object.getOwnPropertyDescriptor(e,a);let n;if(void 0===o)n={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=o.set;n={...o,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),t?.call(this,e)}}}Object.defineProperty(e,a,n)}}},68348(t,e,a){a.d(e,{u:()=>i});a(18111),a(13579);const i=t=>{if(t.some(t=>"tagName"in t&&("HA-MENU"===t.tagName||"HA-CODE-EDITOR"===t.tagName)))return!1;const e=t[0];if("TEXTAREA"===e.tagName||"HA-SELECT"===e.parentElement?.tagName||"HA-DROPDOWN"===e.parentElement?.tagName)return!1;if("INPUT"!==e.tagName)return!0;switch(e.type){case"button":case"checkbox":case"hidden":case"radio":case"range":return!0;default:return!1}}},76830(t,e,a){a.d(e,{d:()=>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,o=s.origin||s.protocol+"//"+s.host;return i.startsWith(o)&&(i=i.slice(o.length),"#"!==i)?(e&&t.preventDefault(),i):void 0}},57237(t,e,a){a.d(e,{d:()=>i});const i=t=>t.stopPropagation()},17451(t,e,a){a.d(e,{j:()=>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(t,e,a){a.d(e,{Z:()=>i});const i=t=>t.charAt(0).toUpperCase()+t.slice(1)},19459(t,e,a){a.d(e,{b:()=>i});a(45367),a(92731),a(69479),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);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,o;if(Array.isArray(t)){if(o=t.length,o!==e.length)return!1;for(s=o;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(o=t.length,o!==e.length)return!1;for(s=o;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 n=Object.keys(t);if(o=n.length,o!==Object.keys(e).length)return!1;for(s=o;0!==s--;)if(!Object.prototype.hasOwnProperty.call(e,n[s]))return!1;for(s=o;0!==s--;){const o=n[s];if(!i(t[o],e[o],a))return!1}if(a?.compareSymbols){const s=Object.getOwnPropertySymbols(t),o=Object.getOwnPropertySymbols(e);if(s.length!==o.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(t,e,a){a.a(t,async function(t,i){try{a.d(e,{x:()=>d});var s=a(6946),o=a(52640),n=a(38684),r=a(380);const l=1e3,c=60,h=60*c;function d(t,e=Date.now(),a,i={}){const d={...p,...i||{}},u=(+t-+e)/l;if(Math.abs(u)<d.second)return{value:Math.round(u),unit:"second"};const g=u/c;if(Math.abs(g)<d.minute)return{value:Math.round(g),unit:"minute"};const v=u/h;if(Math.abs(v)<d.hour)return{value:Math.round(v),unit:"hour"};const b=new Date(t),m=new Date(e);b.setHours(0,0,0,0),m.setHours(0,0,0,0);const f=(0,s.c)(b,m);if(0===f)return{value:Math.round(v),unit:"hour"};if(Math.abs(f)<d.day)return{value:f,unit:"day"};const _=(0,r.P)(a),y=(0,o.k)(b,{weekStartsOn:_}),w=(0,o.k)(m,{weekStartsOn:_}),k=(0,n.I)(y,w);if(0===k)return{value:f,unit:"day"};if(Math.abs(k)<d.week)return{value:k,unit:"week"};const x=b.getFullYear()-m.getFullYear(),C=12*x+b.getMonth()-m.getMonth();return 0===C?{value:k,unit:"week"}:Math.abs(C)<d.month||0===x?{value:C,unit:"month"}:{value:Math.round(x),unit:"year"}}const p={second:59,minute:59,hour:22,day:5,week:4,month:11};i()}catch(u){i(u)}})},64481(t,e,a){a.d(e,{D:()=>s,J:()=>n});a(64979);let i=!1;try{i="true"===window.localStorage.getItem("disableViewTransition")}catch{}const s=t=>{i=t},o=t=>{if(!(t=>(t instanceof DOMException||t instanceof Error)&&"AbortError"===t.name)(t))throw t},n=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(o),a.finished.catch(o)}catch(a){return console.warn("View transition failed, falling back to direct execution.",a),e?Promise.reject(a):(t(!1),Promise.resolve())}}},38962(t,e,a){a.a(t,async function(t,i){try{a.r(e);var s=a(62826),o=a(5124),n=a(22441),r=a(6412),l=a(93421),c=a(1087),h=a(26300),d=(a(67094),t([h]));h=(d.then?(await d)():d)[0];const p="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",u={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 g extends o.WF{render(){return o.qy` <div class="issue-type ${(0,r.H)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${u[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,r.H)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?o.qy`<div class="title">${this.title}</div>`:o.s6} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?o.qy`<ha-icon-button @click="${this._dismissClicked}" .label="${this._localize?.("ui.common.dismiss_alert")}" .path="${p}"></ha-icon-button>`:o.s6} </slot> </div> </div> </div> `}_dismissClicked(){(0,c.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}g.styles=o.AH`.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,n.MZ)()],g.prototype,"title",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"alert-type"})],g.prototype,"alertType",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],g.prototype,"dismissable",void 0),(0,s.Cg)([(0,n.wk)(),(0,l.IW)()],g.prototype,"_localize",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],g.prototype,"narrow",void 0),g=(0,s.Cg)([(0,n.EM)("ha-alert")],g),i()}catch(t){i(t)}})},76776(t,e,a){var i=a(62826),s=a(5124),o=a(22441);class n extends s.WF{render(){return s.qy` ${this.header?s.qy`<h1 class="card-header">${this.header}</h1>`:s.s6} <slot></slot> `}constructor(...t){super(...t),this.raised=!1}}n.styles=s.AH`: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,o.MZ)()],n.prototype,"header",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],n.prototype,"raised",void 0),n=(0,i.Cg)([(0,o.EM)("ha-card")],n)},70947(t,e,a){var i=a(62826),s=a(50759),o=(a(38625),a(5124)),n=a(22441);a(67094);class r extends s.A{renderCheckboxIcon(){return o.qy` <ha-svg-icon id="check" part="checkmark" .path="${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"}"></ha-svg-icon> `}static get styles(){return[s.A.styles,o.AH`: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,n.MZ)({type:Boolean,reflect:!0})],r.prototype,"selected",void 0),r=(0,i.Cg)([(0,n.EM)("ha-dropdown-item")],r)},29823(t,e,a){a.a(t,async function(t,e){try{var i=a(62826),s=a(52254),o=a(5124),n=a(22441),r=t([s]);s=(r.then?(await r)():r)[0];class l extends s.A{get anchorElement(){return this.popup?.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,o.AH`: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,n.MZ)({attribute:!1})],l.prototype,"dropdownTag",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],l.prototype,"dropdownItemTag",void 0),l=(0,i.Cg)([(0,n.EM)("ha-dropdown")],l),e()}catch(t){e(t)}})},64263(t,e,a){a.a(t,async function(t,e){try{a(74423),a(44114),a(18111),a(20116),a(61701);var i=a(62826),s=a(5124),o=a(22441),n=a(1087),r=a(14503),l=(a(30716),a(11382),a(47680),a(26300)),c=(a(8630),t([l]));l=(c.then?(await c)():c)[0];const h="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 d extends s.WF{render(){if(!this.states)return s.s6;const t=this.states.find(t=>t.icon);return s.qy` <ha-expansion-panel left-chevron .expanded="${this.expanded}" @expanded-will-change="${this._expandedWillChange}" @expanded-changed="${this._expandedChanged}"> <div slot="header" class="header"> ${this.label} ${this.value?.length?s.qy`<div class="badge">${this.value?.length}</div> <ha-icon-button .path="${h}" @click="${this._clearFilter}"></ha-icon-button>`:s.s6} </div> ${this._shouldRender?s.qy` <ha-list @selected="${this._statesSelected}" multi class="ha-scrollbar"> ${this.states.map(e=>s.qy`<ha-check-list-item .value="${e.value}" .selected="${this.value?.includes(e.value)??!1}" .graphic="${t?"icon":null}"> ${e.icon?s.qy`<ha-icon slot="graphic" .icon="${e.icon}"></ha-icon>`:s.s6} ${e.label} </ha-check-list-item>`)} </ha-list> `:s.s6} </ha-expansion-panel> `}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,n.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,n.r)(this,"data-table-filter-changed",{value:e,items:void 0})}_clearFilter(t){t.preventDefault(),this.value=void 0,(0,n.r)(this,"data-table-filter-changed",{value:void 0,items:void 0})}static get styles(){return[r.dp,s.AH`: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,o.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)()],d.prototype,"label",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],d.prototype,"value",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],d.prototype,"states",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],d.prototype,"narrow",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],d.prototype,"expanded",void 0),(0,i.Cg)([(0,o.wk)()],d.prototype,"_shouldRender",void 0),(0,i.Cg)([(0,o.P)("ha-list")],d.prototype,"_list",void 0),d=(0,i.Cg)([(0,o.EM)("ha-filter-states")],d),e()}catch(t){e(t)}})},90248(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaIconButtonArrowPrev:()=>p});var s=a(62826),o=a(5124),n=a(22441),r=a(63091),l=a(26300),c=t([l]);l=(c.then?(await c)():c)[0];const h="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",d="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class p extends o.WF{render(){return o.qy` <ha-icon-button .disabled="${this.disabled}" .label="${this.label||this.hass?.localize("ui.common.back")||"Back"}" .path="${this._icon}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"></ha-icon-button> `}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===r.G.document.dir?d:h}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],p.prototype,"disabled",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"label",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"href",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"target",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"rel",void 0),(0,s.Cg)([(0,n.MZ)()],p.prototype,"download",void 0),(0,s.Cg)([(0,n.wk)()],p.prototype,"_icon",void 0),p=(0,s.Cg)([(0,n.EM)("ha-icon-button-arrow-prev")],p),i()}catch(t){i(t)}})},26300(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaIconButton:()=>h});var s=a(62826),o=a(5124),n=a(22441),r=a(63672),l=a(18350),c=(a(67094),t([l]));l=(c.then?(await c)():c)[0];class h extends o.WF{render(){return o.qy` <ha-button appearance="plain" variant="neutral" aria-label="${(0,r.J)(this.label)}" title="${(0,r.J)(this.hideTitle?void 0:this.label)}" aria-haspopup="${(0,r.J)(this.ariaHasPopup)}" .disabled="${this.disabled}" .iconTag="${this.path?"ha-svg-icon":"span"}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"> ${this.path?o.qy`<ha-svg-icon aria-hidden="true" .path="${this.path}"></ha-svg-icon>`:o.qy`<span><slot></slot></span>`} </ha-button> `}constructor(...t){super(...t),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}h.shadowRootOptions={mode:"open",delegatesFocus:!0},h.styles=o.AH`: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,n.MZ)({type:Boolean,reflect:!0})],h.prototype,"disabled",void 0),(0,s.Cg)([(0,n.MZ)({type:String})],h.prototype,"path",void 0),(0,s.Cg)([(0,n.MZ)({type:String})],h.prototype,"label",void 0),(0,s.Cg)([(0,n.MZ)({type:String,attribute:"aria-haspopup"})],h.prototype,"ariaHasPopup",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"hide-title",type:Boolean})],h.prototype,"hideTitle",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],h.prototype,"selected",void 0),(0,s.Cg)([(0,n.MZ)()],h.prototype,"href",void 0),(0,s.Cg)([(0,n.MZ)()],h.prototype,"target",void 0),(0,s.Cg)([(0,n.MZ)()],h.prototype,"rel",void 0),(0,s.Cg)([(0,n.MZ)()],h.prototype,"download",void 0),h=(0,s.Cg)([(0,n.EM)("ha-icon-button")],h),i()}catch(t){i(t)}})},2054(t,e,a){a.a(t,async function(t,e){try{var i=a(62826),s=a(5124),o=a(22441),n=a(1087),r=a(44249),l=a(26300),c=t([l]);l=(c.then?(await c)():c)[0];const h="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class d 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 s.qy` <ha-icon-button .label="${this.hass.localize("ui.sidebar.sidebar_toggle")}" .path="${h}" @click="${this._toggleMenu}"></ha-icon-button> ${t?s.qy`<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===e?.kioskMode&&(a||"always_hidden"===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,n.r)(this,"hass-toggle-menu")}constructor(...t){super(...t),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}d.styles=s.AH`: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,o.MZ)({type:Boolean})],d.prototype,"narrow",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,i.Cg)([(0,o.wk)()],d.prototype,"_hasNotifications",void 0),(0,i.Cg)([(0,o.wk)()],d.prototype,"_show",void 0),d=(0,i.Cg)([(0,o.EM)("ha-menu-button")],d),e()}catch(t){e(t)}})},54276(t,e,a){var i=a(62826),s=a(76482),o=a(91382),n=a(96245),r=a(5124),l=a(22441);class c extends o.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){t?.removeEventListener("touchend",this._handleTouchEnd),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()}}}c.styles=[n.R,r.AH`: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))
        )}`],c=(0,i.Cg)([(0,l.EM)("ha-ripple")],c)},65829(t,e,a){a.a(t,async function(t,i){try{a.r(e),a.d(e,{HaSpinner:()=>c});var s=a(62826),o=a(55262),n=a(5124),r=a(22441),l=t([o]);o=(l.then?(await l)():l)[0];class c extends o.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[o.A.styles,n.AH`: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)()],c.prototype,"size",void 0),c=(0,s.Cg)([(0,r.EM)("ha-spinner")],c),i()}catch(t){i(t)}})},67094(t,e,a){a.r(e),a.d(e,{HaSvgIcon:()=>n});var i=a(62826),s=a(5124),o=a(22441);class n extends s.WF{render(){return s.JW` <svg viewBox="${this.viewBox||"0 0 24 24"}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${this.path?s.JW`<path class="primary-path" d="${this.path}"></path>`:s.s6} ${this.secondaryPath?s.JW`<path class="secondary-path" d="${this.secondaryPath}"></path>`:s.s6} </g> </svg>`}}n.styles=s.AH`: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,o.MZ)()],n.prototype,"path",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],n.prototype,"secondaryPath",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],n.prototype,"viewBox",void 0),n=(0,i.Cg)([(0,o.EM)("ha-svg-icon")],n)},34127(t,e,a){a.a(t,async function(t,e){try{var i=a(62826),s=a(52630),o=a(5124),n=a(22441),r=t([s]);s=(r.then?(await r)():r)[0];class l extends s.A{static get styles(){return[s.A.styles,o.AH`:host{--wa-tooltip-background-color:var(
            --ha-tooltip-background-color,
            var(--ha-color-surface-default)
          );--wa-tooltip-content-color:var(
            --ha-tooltip-text-color,
            var(--primary-text-color)
          );--wa-tooltip-font-family:var(
            --ha-tooltip-font-family,
            var(--ha-font-family-body)
          );--wa-tooltip-font-size:var(
            --ha-tooltip-font-size,
            var(--ha-font-size-m)
          );--wa-tooltip-font-weight:var(
            --ha-tooltip-font-weight,
            var(--ha-font-weight-medium)
          );--wa-tooltip-line-height:var(
            --ha-tooltip-line-height,
            var(--ha-line-height-condensed)
          );--wa-tooltip-padding:var(--ha-tooltip-padding, var(--ha-space-2));--wa-tooltip-border-radius:var(
            --ha-tooltip-border-radius,
            var(--ha-border-radius-md)
          );--wa-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 0px);--wa-tooltip-border-width:0px;--wa-z-index-tooltip:1000}.tooltip::part(popup){animation-duration:var(--ha-tooltip-animation-duration, 0)}.body{box-shadow:var(--ha-tooltip-box-shadow,var(--ha-box-shadow-m))}`]}constructor(...t){super(...t),this.showDelay=350,this.hideDelay=150}}(0,i.Cg)([(0,n.MZ)({attribute:"show-delay",type:Number})],l.prototype,"showDelay",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"hide-delay",type:Number})],l.prototype,"hideDelay",void 0),l=(0,i.Cg)([(0,n.EM)("ha-tooltip")],l),e()}catch(t){e(t)}})},91485(t,e,a){a.a(t,async function(t,i){try{a.d(e,{U:()=>w});var s=a(62826),o=(a(86137),a(30006)),n=a(92070),r=a(35211),l=a(5124),c=a(22441),h=a(6412),d=a(63672),p=a(57237),u=a(22792),g=a(26300),v=(a(67094),a(34127)),b=a(53305),m=t([o,g,v]);[o,g,v]=m.then?(await m)():m;const f="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",_="M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",y="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z";class w extends((0,b.w)(l.WF)){get _formControl(){return this._input}showPicker(){this._input?.showPicker()}stepUp(){this._input?.stepUp()}stepDown(){this._input?.stepDown()}async firstUpdated(t){super.firstUpdated(t),this.insetLabel||(await(this._input?.updateComplete),this._syncStartSlotWidth())}render(){const t=!this.label&&this._hasSlotController.test("label"),e=!this.hint&&this._hasSlotController.test("hint"),a=this._hasSlotController.test("start");return l.qy` <wa-input .type="${this.type}" .value="${this.value??null}" .withClear="${this.withClear}" .placeholder="${this.placeholder}" .readonly="${this.readonly}" .passwordToggle="${this.passwordToggle}" .passwordVisible="${this.passwordVisible}" .withoutSpinButtons="${this.withoutSpinButtons}" .required="${this.required}" .pattern="${this.pattern}" .minlength="${this.minlength}" .maxlength="${this.maxlength}" .min="${this.min}" .max="${this.max}" .step="${this.step}" .autocapitalize="${this.autocapitalize||void 0}" .autocorrect="${this.autocorrect?"on":"off"}" .autocomplete="${this.autocomplete}" .autofocus="${this.autofocus}" .enterkeyhint="${this.enterkeyhint||void 0}" .spellcheck="${this.spellcheck}" .inputmode="${this.inputmode||void 0}" .name="${this.name}" .disabled="${this.disabled}" class="${(0,h.H)({input:!0,invalid:this.invalid||this._invalid,"label-raised":void 0!==this.value&&""!==this.value||this.label&&this.placeholder||a&&this.insetLabel,"no-label":!this.label,"hint-hidden":!(this.hint||e||this.required||this._invalid||this.invalid)})}" @input="${this._handleInput}" @change="${this._handleChange}" @blur="${this._handleBlur}" @wa-invalid="${this._handleInvalid}" exportparts="base:wa-base, hint:wa-hint, input:wa-input"> ${this.label||t?l.qy`<slot name="label" slot="label">${this.label?this._renderLabel(this.label,this.required):l.s6}</slot>`:l.s6} <slot name="start" slot="start" @slotchange="${this._syncStartSlotWidth}"> ${this.renderStartDefault()} </slot> <slot name="end" slot="end"> ${this.renderEndDefault()} </slot> <slot name="clear-button" slot="clear-button"> <ha-icon-button @click="${this._handleClearClick}" .label="${this.i18n?.localize?.("ui.components.input.clear")||"Clear"}" .path="${f}"></ha-icon-button> </slot> <slot name="password-toggle-button" slot="password-toggle-button"> <ha-icon-button @keydown="${p.d}" @click="${this._handlePasswordToggle}" .label="${this.i18n?.localize?.("ui.components.input."+(this.passwordVisible?"hide_password":"show_password"))||(this.passwordVisible?"Hide password":"Show password")}" .path="${this.passwordVisible?y:_}"></ha-icon-button> </slot> <div slot="hint" class="${(0,h.H)({error:this.invalid||this._invalid})}" role="${(0,d.J)(this.invalid||this._invalid?"alert":void 0)}" aria-live="polite"> ${this._invalid||this.invalid?this.validationMessage||this._input?.validationMessage:this.hint||(e?l.qy`<slot name="hint"></slot>`:l.s6)} </div> </wa-input> `}renderStartDefault(){return l.s6}renderEndDefault(){return l.s6}_handleClearClick(){this._input?.clear()}_handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}constructor(...t){super(...t),this.appearance="material",this.type="text",this.withClear=!1,this.passwordToggle=!1,this.passwordVisible=!1,this.withoutSpinButtons=!1,this.autocorrect=!1,this.insetLabel=!1,this._hasSlotController=new n.X(this,"label","hint","input","start"),this._syncStartSlotWidth=()=>{const t=this._input?.shadowRoot?.querySelector('[part~="start"]'),e=t?.offsetWidth??0;e>0&&!this.insetLabel?(this.style.setProperty("--start-slot-width",`calc(${e}px + var(--ha-space-1))`),this.style.setProperty("--input-padding-inline-start","var(--ha-space-1)")):(this.style.removeProperty("--start-slot-width"),this.style.removeProperty("--input-padding-inline-start"))}}}w.styles=[b.N,l.AH`:host{display:flex;align-items:flex-start;padding-top:var(--ha-input-padding-top);padding-bottom:var(--ha-input-padding-bottom,var(--ha-space-2));text-align:var(--ha-input-text-align,start)}:host([appearance=outlined]){padding-bottom:var(--ha-input-padding-bottom)}wa-input::part(label){padding-inline-start:calc(var(--start-slot-width,0px) + var(--ha-space-4));padding-inline-end:var(--ha-space-4);padding-top:var(--ha-space-5)}:host([appearance=material]:focus-within) wa-input::part(label){color:var(--primary-color)}:host(:focus-within) wa-input::part(label),:host([type=date]) wa-input::part(label),wa-input.label-raised::part(label){padding-top:var(--ha-space-3);font-size:var(--ha-font-size-xs)}wa-input::part(base){height:56px;padding:0 var(--ha-space-4)}:host([appearance=outlined]) wa-input.no-label::part(base){height:32px;padding:0 var(--ha-space-2)}:host([appearance=outlined]) wa-input::part(base){border:1px solid var(--ha-color-border-neutral-quiet);background-color:var(--card-background-color);border-radius:var(--ha-border-radius-md);transition:border-color var(--wa-transition-normal) ease-in-out}:host([appearance=material]) ::part(base)::after{content:"";position:absolute;bottom:0;left:0;right:0;height:1px;background-color:var(--ha-color-border-neutral-loud);transition:height var(--wa-transition-normal) ease-in-out,background-color var(--wa-transition-normal) ease-in-out}:host([appearance=material]:focus-within) wa-input::part(base)::after{height:2px;background-color:var(--primary-color)}:host([appearance=material]) wa-input.invalid:not([disabled])::part(base)::after,:host([appearance=material]:focus-within) wa-input.invalid::part(base)::after{background-color:var(--ha-color-border-danger-normal)}wa-input::part(input){padding-top:var(--ha-space-3);padding-inline-start:var(--input-padding-inline-start,0)}wa-input.no-label::part(input){padding-top:0}:host([type=color]) wa-input::part(input){padding-top:var(--ha-space-6);padding-bottom:2px;cursor:pointer}:host([type=color]) wa-input.no-label::part(input){padding:var(--ha-space-2)}:host([type=color]) wa-input.no-label::part(base){padding:0}wa-input::part(input)::placeholder{color:var(--ha-color-neutral-60)}wa-input::part(base):hover{background-color:var(--ha-color-form-background-hover)}:host([appearance=outlined]) wa-input::part(base):hover{border-color:var(--ha-color-border-neutral-normal)}:host([appearance=outlined]:focus-within) wa-input::part(base){border-color:var(--primary-color)}wa-input:disabled::part(base){background-color:var(--ha-color-form-background-disabled)}wa-input:disabled::part(label){opacity:.5}wa-input::part(end){color:var(--ha-color-text-secondary)}ha-icon-button{display:flex;align-items:center;color:var(--ha-color-text-secondary)}:host([appearance=outlined]) wa-input.no-label{--ha-icon-button-size:24px;--mdc-icon-size:18px}`],(0,s.Cg)([(0,c.MZ)({reflect:!0})],w.prototype,"appearance",void 0),(0,s.Cg)([(0,c.MZ)({reflect:!0})],w.prototype,"type",void 0),(0,s.Cg)([(0,c.MZ)({type:Boolean,attribute:"with-clear"})],w.prototype,"withClear",void 0),(0,s.Cg)([(0,c.MZ)({type:Boolean,attribute:"password-toggle"})],w.prototype,"passwordToggle",void 0),(0,s.Cg)([(0,c.MZ)({type:Boolean,attribute:"password-visible"})],w.prototype,"passwordVisible",void 0),(0,s.Cg)([(0,c.MZ)({type:Boolean,attribute:"without-spin-buttons"})],w.prototype,"withoutSpinButtons",void 0),(0,s.Cg)([(0,c.MZ)()],w.prototype,"pattern",void 0),(0,s.Cg)([(0,c.MZ)()],w.prototype,"min",void 0),(0,s.Cg)([(0,c.MZ)()],w.prototype,"max",void 0),(0,s.Cg)([(0,c.MZ)()],w.prototype,"step",void 0),(0,s.Cg)([(0,c.MZ)({type:Boolean})],w.prototype,"autocorrect",void 0),(0,s.Cg)([(0,c.MZ)({type:Boolean,attribute:"inset-label"})],w.prototype,"insetLabel",void 0),(0,s.Cg)([(0,c.P)("wa-input")],w.prototype,"_input",void 0),(0,s.Cg)([(0,c.wk)(),(0,r.Fg)({context:u.D5,subscribe:!0})],w.prototype,"i18n",void 0),w=(0,s.Cg)([(0,c.EM)("ha-input")],w),i()}catch(t){i(t)}})},53305(t,e,a){a.d(e,{w:()=>l,N:()=>c});var i=a(62826),s=a(5124),o=a(22441),n=a(22786);a(74423);const r=Boolean(globalThis.ElementInternals)&&globalThis.HTMLElement?.prototype.attachInternals?.toString().includes("[native code]"),l=t=>{class e extends t{get _formControl(){throw new Error("_formControl getter must be implemented by subclass")}select(){this._formControl?.select()}setSelectionRange(t,e,a){this._formControl?.setSelectionRange(t,e,a)}setRangeText(t,e,a,i){this._formControl?.setRangeText(t,e,a,i)}checkValidity(){return!r||(this._formControl?.checkValidity()??!0)}reportValidity(){const t=this.checkValidity();return this._invalid=!t,t}_handleInput(){this.value=this._formControl?.value??void 0,this._invalid&&this._formControl?.checkValidity()&&(this._invalid=!1)}_handleChange(){this.value=this._formControl?.value??void 0}_handleBlur(){this.autoValidate&&(this._invalid=!this._formControl?.checkValidity())}_handleInvalid(){this._invalid=!0}constructor(...t){super(...t),this.label="",this.hint="",this.placeholder="",this.readonly=!1,this.required=!1,this.autocapitalize="",this.autofocus=!1,this.spellcheck=!0,this.inputmode="",this.enterkeyhint="",this.disabled=!1,this.validationMessage="",this.autoValidate=!1,this.invalid=!1,this._invalid=!1,this._requiredMarkerCSSVar="--ha-input-required-marker",this._renderLabel=(0,n.A)((t,e)=>{if(!e)return t;let a=getComputedStyle(this).getPropertyValue(this._requiredMarkerCSSVar);return a||(a="*"),a.startsWith('"')&&a.endsWith('"')&&(a=a.slice(1,-1)),a?`${t}${a}`:t})}}return e.shadowRootOptions={mode:"open",delegatesFocus:!0},(0,i.Cg)([(0,o.MZ)()],e.prototype,"value",void 0),(0,i.Cg)([(0,o.MZ)()],e.prototype,"label",void 0),(0,i.Cg)([(0,o.MZ)()],e.prototype,"hint",void 0),(0,i.Cg)([(0,o.MZ)()],e.prototype,"placeholder",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],e.prototype,"readonly",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],e.prototype,"required",void 0),(0,i.Cg)([(0,o.MZ)({type:Number})],e.prototype,"minlength",void 0),(0,i.Cg)([(0,o.MZ)({type:Number})],e.prototype,"maxlength",void 0),(0,i.Cg)([(0,o.MZ)()],e.prototype,"autocapitalize",void 0),(0,i.Cg)([(0,o.MZ)()],e.prototype,"autocomplete",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],e.prototype,"autofocus",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],e.prototype,"spellcheck",void 0),(0,i.Cg)([(0,o.MZ)()],e.prototype,"inputmode",void 0),(0,i.Cg)([(0,o.MZ)()],e.prototype,"enterkeyhint",void 0),(0,i.Cg)([(0,o.MZ)()],e.prototype,"name",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],e.prototype,"disabled",void 0),(0,i.Cg)([(0,o.MZ)({attribute:"validation-message"})],e.prototype,"validationMessage",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,attribute:"auto-validate"})],e.prototype,"autoValidate",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],e.prototype,"invalid",void 0),(0,i.Cg)([(0,o.wk)()],e.prototype,"_invalid",void 0),e},c=s.AH`.input{flex:1;min-width:0;--wa-transition-fast:var(--wa-transition-normal);position:relative}.input::part(label){position:absolute;top:0;font-weight:var(--ha-font-weight-normal);font-family:var(--ha-font-family-body);transition:all var(--wa-transition-normal) ease-in-out;color:var(--secondary-text-color);line-height:var(--ha-line-height-condensed);z-index:1;pointer-events:none;font-size:var(--ha-font-size-m)}.input.invalid:not([disabled])::part(label),:host(:focus-within) .input.invalid::part(label){color:var(--ha-color-fill-danger-loud-resting)}.input::part(base){background-color:var(--ha-color-form-background);border-top-left-radius:var(--ha-border-radius-sm);border-top-right-radius:var(--ha-border-radius-sm);border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square);border:none;position:relative;transition:background-color var(--wa-transition-normal) ease-in-out}:host(:focus-within) .input::part(base){outline:0}.input::part(hint){min-height:var(--ha-space-5);margin-block-start:0;margin-inline-start:var(--ha-space-3);font-size:var(--ha-font-size-s);display:flex;align-items:center;color:var(--ha-color-text-secondary)}.input.hint-hidden::part(hint){height:0;min-height:0}.error{color:var(--ha-color-on-danger-quiet)}`},28170(t,e,a){a.d(e,{o:()=>l});var i=a(62826),s=a(5124),o=a(22441),n=a(1087),r=a(83892);class l extends r.x{connectedCallback(){super.connectedCallback(),this.hasAttribute("role")||this.setAttribute("role",this.defaultRole),(0,n.r)(this,"ha-list-item-register",{item:this})}disconnectedCallback(){super.disconnectedCallback(),(0,n.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,s.AH`: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,o.MZ)({type:Boolean,reflect:!0})],l.prototype,"interactive",void 0),l=(0,i.Cg)([(0,o.EM)("ha-list-item-base")],l)},1671(t,e,a){var i=a(62826),s=a(5124),o=a(22441),n=a(63672),r=(a(54276),a(28170));class l extends r.o{activate(){this._item?.click()}_renderBase(t){return void 0!==this.href?s.qy`<a part="base" class="base interactive" id="item" href="${(0,n.J)(this.disabled?void 0:this.href)}" target="${(0,n.J)(this.target)}" rel="${(0,n.J)(this.rel)}" download="${(0,n.J)(this.download)}" tabindex="-1" aria-disabled="${this.disabled?"true":"false"}"> ${this._renderRipple()}${t} </a>`:s.qy`<button part="base" class="base interactive" id="item" type="button" ?disabled="${this.disabled}" tabindex="-1"> ${this._renderRipple()}${t} </button>`}_renderRipple(){return s.qy`<ha-ripple part="ripple" for="item" ?disabled="${this.disabled}"></ha-ripple>`}constructor(...t){super(...t),this.interactive=!0}}l.styles=[r.o.styles,s.AH`:host{cursor:pointer;--ha-ripple-color:var(--primary-text-color)}:host([disabled]){cursor:default}.base.interactive{width:100%;border:none;background:0 0;color:inherit;font:inherit;text-align:inherit;text-decoration:none;appearance:none;cursor:inherit}:host([disabled]) .base.interactive{color:var(--disabled-text-color)}`],(0,i.Cg)([(0,o.MZ)({type:String})],l.prototype,"href",void 0),(0,i.Cg)([(0,o.MZ)({type:String})],l.prototype,"target",void 0),(0,i.Cg)([(0,o.MZ)({type:String})],l.prototype,"rel",void 0),(0,i.Cg)([(0,o.MZ)({type:String})],l.prototype,"download",void 0),(0,i.Cg)([(0,o.P)("#item")],l.prototype,"_item",void 0),l=(0,i.Cg)([(0,o.EM)("ha-list-item-button")],l)},83892(t,e,a){a.d(e,{x:()=>r});a(18111),a(13579);var i=a(62826),s=a(92070),o=a(5124),n=a(22441);class r extends o.WF{_onSlotChange(t){return e=>{const a=e.target.assignedNodes({flatten:!0}).some(t=>t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&""!==t.textContent?.trim());"start"===t?this._hasStart=a:this._hasEnd=a}}render(){return this._renderBase(this._renderInner())}_renderBase(t){return o.qy`<div part="base" class="base" id="item">${t}</div>`}_renderInner(){const t=this._slotController.test("content");return o.qy` <div part="start" class="start" ?hidden="${!this._hasStart}"> <slot name="start" @slotchange="${this._onSlotChange("start")}"></slot> </div> <div part="content" class="content"> ${t?o.qy`<slot name="content"></slot>`:this._renderDefaultContent()} </div> <div part="end" class="end" ?hidden="${!this._hasEnd}"> <slot name="end" @slotchange="${this._onSlotChange("end")}"></slot> </div> `}_renderDefaultContent(){const t=this._slotController.test("headline"),e=this._slotController.test("supporting-text"),a=t||void 0!==this.headline,i=e||void 0!==this.supportingText;return o.qy` ${a?o.qy`<div part="headline" class="headline"> <slot name="headline">${this.headline??o.s6}</slot> </div>`:o.s6} ${i?o.qy`<div part="supporting-text" class="supporting"> <slot name="supporting-text">${this.supportingText??o.s6}</slot> </div>`:o.s6} `}constructor(...t){super(...t),this.disabled=!1,this._slotController=new s.X(this,"headline","supporting-text","content"),this._hasStart=!1,this._hasEnd=!1}}r.styles=o.AH`: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,n.MZ)({type:String})],r.prototype,"headline",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"supporting-text"})],r.prototype,"supportingText",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],r.prototype,"disabled",void 0),(0,i.Cg)([(0,n.wk)()],r.prototype,"_hasStart",void 0),(0,i.Cg)([(0,n.wk)()],r.prototype,"_hasEnd",void 0),r=(0,i.Cg)([(0,n.EM)("ha-row-item")],r)},50723(t,e,a){a.d(e,{N:()=>h});a(74423),a(18111),a(22489),a(7588);var i=a(62826),s=a(5124),o=a(22441),n=a(91335);a(44114);const r=t=>{const e=[];let a=t;for(;a;){e.push(a);const t=a.parentNode;if(t instanceof ShadowRoot)a=t.host;else if(t)a=t;else{const t=a.getRootNode();a=t instanceof ShadowRoot?t.host:null}}return e.reverse()},l=(t,e)=>{if(t===e)return 0;const a=r(t),i=r(e);let 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 c=a(1087);class h 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,n.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(){super.disconnectedCallback(),this._unbindKeys?.(),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 s.qy`<div part="base" class="base"> <slot></slot> </div>`}_isFocusable(t){const e=this.items[t];return!!e&&e.interactive&&!e.disabled}_applyActive(t){this.items.forEach((t,e)=>{t.interactive&&!t.disabled?t.tabIndex=e===this._activeItemIndex?0:-1:t.removeAttribute("tabindex")}),t&&this._activeItemIndex>=0&&this.items[this._activeItemIndex]?.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(l),this.items=a,this.updateListItems()},this._onItemUnregister=t=>{t.stopPropagation();const e=t.detail.item;this.items.includes(e)&&(this.items=this.items.filter(t=>t!==e),this.updateListItems())},this._onFocusIn=t=>{const e=t.composedPath();for(let t=0;t<this.items.length;t++)if(e.includes(this.items[t]))return void(t!==this._activeItemIndex&&(this._activeItemIndex=t,this._applyActive(!1)))},this._onForward=t=>{this._moveFocus(t,this._stepIndex(this._activeItemIndex,1))},this._onBack=t=>{this._moveFocus(t,this._stepIndex(this._activeItemIndex,-1))},this._onHome=t=>{this._moveFocus(t,this._firstFocusableIndex)},this._onEnd=t=>{this._moveFocus(t,this._lastFocusableIndex)},this._onActivate=t=>{if(!this._isFocusable(this._activeItemIndex))return;t.preventDefault();const e=this.items[this._activeItemIndex];e.activate(),(0,c.r)(this,"ha-list-activated",{index:this._activeItemIndex,item:e})}}}h.styles=s.AH`:host{display:block}.base{display:flex;flex-direction:column;gap:var(--ha-list-gap,0);padding:var(--ha-list-padding,0);margin:0;list-style:none}`,(0,i.Cg)([(0,o.MZ)({type:Boolean,attribute:"wrap-focus"})],h.prototype,"wrapFocus",void 0),(0,i.Cg)([(0,o.MZ)({type:String,attribute:"aria-label",reflect:!0})],h.prototype,"ariaLabel",void 0),h=(0,i.Cg)([(0,o.EM)("ha-list-base")],h)},47819(t,e,a){var i=a(62826),s=a(5124),o=a(22441),n=a(63672),r=a(50723);class l extends r.N{render(){return s.qy`<nav part="nav" aria-label="${(0,n.J)(this.ariaLabel??void 0)}"> <div part="base" class="base" role="list"> <slot></slot> </div> </nav>`}constructor(...t){super(...t),this.hostRole="",this.ariaLabel=null}}(0,i.Cg)([(0,o.MZ)({type:String,attribute:"aria-label",reflect:!1})],l.prototype,"ariaLabel",void 0),l=(0,i.Cg)([(0,o.EM)("ha-list-nav")],l)},82e3(t,e,a){a.d(e,{D5:()=>i,Fy:()=>n,Gk:()=>c,Hg:()=>s,Y_:()=>h,ds:()=>l,e0:()=>o,ec:()=>r});a(74423),a(18111),a(61701),a(33110);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{...t,autocomplete:"username",autofocus:!0};case"password":return{...t,autocomplete:"current-password"};case"code":return{...t,autocomplete:"one-time-code",autofocus:!0};default:return t}}),o=(t,e)=>t.callWS({type:"auth/sign_path",path:e}),n=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}),l=(t,e,a)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:e,password:a}),c=(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(t,e,a){a.a(t,async function(t,i){try{a.d(e,{Bi:()=>q,Dt:()=>X,EB:()=>V,IW:()=>z,P_:()=>$,SG:()=>A,Sx:()=>R,T2:()=>m,Xm:()=>_,Ye:()=>f,Zm:()=>L,cq:()=>j,dH:()=>H,en:()=>G,gF:()=>w,gb:()=>y,gv:()=>Z,jU:()=>P,kI:()=>S,mF:()=>I,mu:()=>M,oJ:()=>E,pI:()=>x,pL:()=>K,q5:()=>F,q7:()=>B,qk:()=>b,sp:()=>T,uM:()=>J,v3:()=>D,xN:()=>Y,yL:()=>k,yj:()=>U,zZ:()=>C});a(74423),a(16573),a(78100),a(77936),a(18111),a(22489),a(20116),a(7588),a(61701),a(37467),a(44732),a(79577),a(16632),a(34226),a(9486),a(20456),a(14603),a(47566),a(98721);var s=a(22711),o=a(97732),n=a(6226),r=a(22786),l=a(80785),c=a(95747),h=a(30162),d=a(36918),p=a(30039),u=a(39889),g=a(95350),v=t([s,c,h]);[s,c,h]=v.then?(await v)():v;var b=function(t){return t.NEVER="never",t.DAILY="daily",t.CUSTOM_DAYS="custom_days",t}({});const m=["mon","tue","wed","thu","fri","sat","sun"],f=t=>t.sort((t,e)=>m.indexOf(t)-m.indexOf(e)),_=t=>t.callWS({type:"backup/config/info"}),y=(t,e)=>t.callWS({type:"backup/config/update",...e}),w=(t,e)=>y(t,{create_backup:{agent_ids:e.create_backup.agent_ids,include_folders:e.create_backup.include_folders??[],include_database:e.create_backup.include_database,include_addons:e.create_backup.include_addons??[],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({type:"backup/generate",...e}),z=t=>t.callWS({type:"backup/generate_with_automatic_settings"}),H=(t,e)=>t.callWS({type:"backup/restore",...e}),S=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,u.QE)(t.fetchWithAuth(`/api/backup/upload?${s.toString()}`,{method:"POST",body:i}))},V=t=>{const e=t.find(q);if(e)return e;const a=t.find(P);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}),Z="backup.local",I="hassio.local",E="cloud.cloud",q=t=>[Z,I].includes(t),P=t=>{const[e,a]=t.split(".");return"hassio"===e&&"local"!==a},B=(t,e,a)=>{if(q(e))return t("ui.panel.config.backup.agents.local_agent");const i=a.find(t=>t.agent_id===e),s=e.split(".")[0],o=i?i.name:e.split(".")[1];if(P(e))return o;const n=(0,g.p$)(t,s);return a.filter(t=>t.agent_id.split(".")[0]===s).length>1?`${n}: ${o}`:n},D=t=>Math.max(...Object.values(t.agents).map(t=>t.size)),O=["automatic","app_update","manual"],F=(0,s.z)(t=>t?O:O.filter(t=>"app_update"!==t)),T=(t,e)=>t.with_automatic_settings?"automatic":!e||null==t.extra_metadata?.["supervisor.addon_update"]&&null==t.extra_metadata?.["supervisor.app_update"]?"manual":"app_update",U=(t,e)=>{const a=q(t),i=q(e),s=P(t),o=P(e),n=(t,e)=>t?1:e?2:3,r=n(a,s),l=n(i,o);return r!==l?r-l:t.localeCompare(e)},j=()=>{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,c.r6)(new Date,t.locale,t.config)}\n\n${t.localize("ui.panel.config.backup.emergency_kit_file.instance")}\n${t.config.location_name}\n\n${t.localize("ui.panel.config.backup.emergency_kit_file.url")}\n${t.auth.data.hassUrl}\n\n${t.localize("ui.panel.config.backup.emergency_kit_file.encryption_key")}\n${e}\n\n${t.localize("ui.panel.config.backup.emergency_kit_file.more_info",{link:(0,d.o)(t,"/more-info/backup-emergency-kit")})}`),W=(t,e)=>`home_assistant_backup_emergency_kit_${e?`${e}_`:""}${(0,c.GH)(new Date,t.locale,t.config).replace(",","").replace(" ","_")}.txt`,R=(t,e,a)=>(0,p.R)(N(t,e),W(t,a)),J=(0,o.g)((0,n.a)(new Date,4),45),K=(0,o.g)((0,n.a)(new Date,5),45),G=(0,r.A)((t,e,a)=>{if((0,l.A)(a))return(0,h.fU)(a,t,e);if("string"==typeof a&&a){const i=a.split(":"),s=(0,o.g)((0,n.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(t){i(t)}})},30884(t,e,a){a.d(e,{A:()=>i,K:()=>s});const i=(t,e,a)=>t.connection.subscribeMessage(e,{type:"backup/subscribe_events"},{preCheck:a}),s={manager_state:"idle"}},16869(t,e,a){a.d(e,{B:()=>s,g:()=>i});a(74423);const i=window.externalAppV2||window.externalApp||window.webkit?.messageHandlers?.getExternalAuth||location.search.includes("external_auth=1"),s=window.externalApp||window.externalAppV2},47351(t,e,a){a.d(e,{PS:()=>i,Tv:()=>n,VR:()=>s,lE:()=>r});a(74423),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);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,o=new Set([502,503,504]),n=t=>!!(t&&t.status_code&&o.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(t,e,a){a.d(e,{V:()=>i});const i=(t,e)=>{const a=new s,i=t.subscribeMessage(t=>e(a.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{i.then(t=>t?.())}};class s{processMessage(t){if("removed"===t.type)for(const e of Object.keys(t.notifications))delete this.notifications[e];else this.notifications={...this.notifications,...t.notifications};return Object.values(this.notifications)}constructor(){this.notifications={}}}},23528(t,e,a){a.d(e,{$3:()=>v,$O:()=>x,$j:()=>b,ED:()=>o,JE:()=>C,OQ:()=>$,PU:()=>M,Ph:()=>u,Uf:()=>k,W1:()=>g,Wr:()=>h,Z:()=>l,gF:()=>m,iY:()=>f,jU:()=>n,nN:()=>w,p3:()=>c,pJ:()=>p,r_:()=>r,sz:()=>d});a(74423),a(18111),a(13579);var i=a(28978),s=a(380),o=function(t){return t[t.NONE=0]="NONE",t[t.ARITHMETIC=1]="ARITHMETIC",t[t.CIRCULAR=2]="CIRCULAR",t}({});const n=["entity_not_recorded","entity_no_longer_recorded","state_class_removed","units_changed","mean_type_changed","no_state"],r=["L","gal","ft³","m³","CCF","MCF"],l=t=>t.sendMessagePromise({type:"recorder/info"}),c=(t,e)=>t.callWS({type:"recorder/list_statistic_ids",statistic_type:e}),h=(t,e)=>t.callWS({type:"recorder/get_statistics_metadata",statistic_ids:e}),d=(t,e,a,i,s="hour",o,n)=>t.callWS({type:"recorder/statistics_during_period",start_time:e.toISOString(),end_time:a?.toISOString(),statistic_ids:i,period:s,units:o,types:n}),p=(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?{..."week"===a.calendar.period?{first_weekday:(0,s.D)(t.locale).substring(0,3)}:{},...a.calendar}:void 0,rolling_window:a.rolling_window}),u=t=>t.callWS({type:"recorder/validate_statistics"}),g=(t,e,a,i)=>t.callWS({type:"recorder/update_statistics_metadata",statistic_id:e,unit_of_measurement:a,unit_class:i}),v=(t,e)=>t.callWS({type:"recorder/clear_statistics",statistic_ids:e}),b=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},m=(t,e)=>{let a=null;for(const i of e){if(!(i in t))continue;const e=b(t[i]);null!==e&&(null===a?a=e:a+=e)}return a},f=(t,e)=>t.some(t=>void 0!==t[e]&&null!==t[e]),_=["mean","min","max"],y=["sum","state","change"],w=(t,e)=>!(!_.includes(e)||0===t.mean_type)||!(!y.includes(e)||!t.has_sum),k=(t,e,a,i,s)=>{const o=new Date(a).toISOString();return t.callWS({type:"recorder/adjust_sum_statistics",statistic_id:e,start_time:o,adjustment:i,adjustment_unit_of_measurement:s})},x=(t,e,a)=>{const s=t.states[e];return s?(0,i.u)(s):a?.name||e},C=(t,e,a)=>{let i;return e&&(i=t.states[e]?.attributes.unit_of_measurement),void 0===i?a?.statistics_unit_of_measurement:i},$=t=>t.includes(":"),M=t=>t.callWS({type:"recorder/update_statistics_issues"})},71606(t,e,a){a.d(e,{f:()=>s,o:()=>i});a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);const i=new Set(["automation","script","scene","group"]),s=(t,e,a)=>t.callWS({type:"search/related",item_type:e,item_id:a})},26581(t,e,a){a.d(e,{r:()=>s,y:()=>i});const i=async t=>t.callWS({type:"hassio/update/config/info"}),s=async(t,e)=>t.callWS({type:"hassio/update/config/update",...e})},28669(t,e,a){a.d(e,{TK:()=>r,_2:()=>c,eR:()=>s,hG:()=>l,hU:()=>o,kg:()=>n,wj:()=>i,xg:()=>h});a(44114),a(18111),a(61701);const i="system-admin",s="system-users",o=async t=>t.callWS({type:"config/auth/list"}),n=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({...a,type:"config/auth/update",user_id:e}),l=async(t,e)=>t.callWS({type:"config/auth/delete",user_id:e}),c=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(t,e,a){a.a(t,async function(t,e){try{var i=a(62826),s=a(5124),o=a(22441),n=a(6412),r=a(26218),l=a(91926),c=a(90248),h=a(2054),d=a(14503),p=t([c,h]);[c,h]=p.then?(await p)():p;class u extends s.WF{render(){return s.qy` <div class="toolbar ${(0,n.H)({narrow:this.narrow})}"> <div class="toolbar-content"> ${this.mainPage||history.state?.root?s.qy` <ha-menu-button .hass="${this.hass}" .narrow="${this.narrow}"></ha-menu-button> `:this.backPath?s.qy` <ha-icon-button-arrow-prev href="${this.backPath}" .hass="${this.hass}"></ha-icon-button-arrow-prev> `:s.qy` <ha-icon-button-arrow-prev .hass="${this.hass}" @click="${this._backTapped}"></ha-icon-button-arrow-prev> `} <div class="main-title"> <slot name="header">${this.header}</slot> </div> <slot name="toolbar-icon"></slot> </div> </div> <div class="${(0,n.H)({content:!0,"ha-scrollbar":this.scrollable,"not-scrollable":!this.scrollable})}" @scroll="${this._saveScrollPos}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `}_saveScrollPos(t){this._savedScrollPos=t.target.scrollTop}_backTapped(){this.backCallback?this.backCallback():(0,l.OE)()}static get styles(){return[d.dp,s.AH`:host{display:block;height:100%;background-color:var(--primary-background-color);overflow:hidden;position:relative}:host([narrow]){width:100%;position:fixed}.toolbar{background-color:var(--app-header-background-color);padding-top:var(--safe-area-inset-top);padding-right:var(--safe-area-inset-right)}:host([narrow]) .toolbar{padding-left:var(--safe-area-inset-left)}.toolbar-content{display:flex;align-items:center;font-size:var(--ha-font-size-xl);height:var(--header-height);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box;padding:8px 12px}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{display:flex;align-items:center;pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{margin-inline-start:var(--ha-space-6);line-height:var(--ha-line-height-normal);min-width:0;flex-grow:1;overflow-wrap:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.narrow .main-title{margin-inline-start:var(--ha-space-2)}.content{position:relative;width:calc(100% - var(--safe-area-inset-right,0px));height:calc(100% - 1px - var(--header-height,0px) - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));padding-bottom:var(--safe-area-inset-bottom,0px);margin-right:var(--safe-area-inset-right);overflow-y:auto;overflow:auto;-webkit-overflow-scrolling:touch}.content.not-scrollable{overflow:hidden;display:flex;flex-direction:column}:host([narrow]) .content{width:calc(100% - var(--safe-area-inset-left,0px) - var(--safe-area-inset-right,0px));margin-left:var(--safe-area-inset-left)}#fab{position:absolute;right:calc(16px + var(--safe-area-inset-right,0px));inset-inline-end:calc(16px + var(--safe-area-inset-right,0px));inset-inline-start:initial;bottom:calc(16px + var(--safe-area-inset-bottom,0px));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--ha-space-2);--ha-button-box-shadow:var(--ha-box-shadow-l)}:host([narrow]) #fab.tabs{bottom:calc(84px + var(--safe-area-inset-bottom,0px))}#fab[is-wide]{bottom:calc(24px + var(--safe-area-inset-bottom,0px));right:calc(24px + var(--safe-area-inset-right,0px));inset-inline-end:calc(24px + var(--safe-area-inset-right,0px));inset-inline-start:initial}`]}constructor(...t){super(...t),this.mainPage=!1,this.narrow=!1,this.scrollable=!0}}(0,i.Cg)([(0,o.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)()],u.prototype,"header",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,attribute:"main-page"})],u.prototype,"mainPage",void 0),(0,i.Cg)([(0,o.MZ)({type:String,attribute:"back-path"})],u.prototype,"backPath",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],u.prototype,"backCallback",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],u.prototype,"narrow",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],u.prototype,"scrollable",void 0),(0,i.Cg)([(0,r.a)(".content")],u.prototype,"_savedScrollPos",void 0),(0,i.Cg)([(0,o.Ls)({passive:!0})],u.prototype,"_saveScrollPos",null),u=(0,i.Cg)([(0,o.EM)("hass-subpage")],u),e()}catch(t){e(t)}})},54706(t,e,a){a.d(e,{E:()=>o});a(74423),a(18111),a(13579);var i=a(62826),s=a(22441);const o=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(){void 0===this.__unsubs&&this.isConnected&&void 0!==this.hass&&!this.hassSubscribeRequiredHostProps?.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(t,e,a){a.a(t,async function(t,e){try{var i=a(62826),s=a(5124),o=a(22441),n=a(1087),r=(a(28170),a(50723),a(13407)),l=a(17393),c=a(31420),h=a(86801),d=t([c]);c=(d.then?(await d)():d)[0];const p="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z";class u extends s.WF{get _value(){return this.value??""}render(){return this._value?s.qy` <ha-list-base> <ha-list-item-base> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.encryption_key.download_emergency_kit")} </span> <span slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.encryption_key.download_emergency_kit_description")} </span> <ha-button appearance="plain" slot="end" @click="${this._download}" size="small"> <ha-svg-icon .path="${p}" slot="start"></ha-svg-icon> ${this.hass.localize("ui.panel.config.backup.encryption_key.download_emergency_kit_action")} </ha-button> </ha-list-item-base> <ha-list-item-base> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.encryption_key.show_encryption_key")} </span> <span slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.encryption_key.show_encryption_key_description")} </span> <ha-button appearance="plain" slot="end" @click="${this._show}" size="small"> ${this.hass.localize("ui.panel.config.backup.encryption_key.show_encryption_key_action")} </ha-button> </ha-list-item-base> <ha-list-item-base> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.encryption_key.change_encryption_key")} </span> <span slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.encryption_key.change_encryption_key_description")} </span> <ha-button appearance="plain" variant="danger" size="small" slot="end" @click="${this._change}"> ${this.hass.localize("ui.panel.config.backup.encryption_key.change_encryption_key_action")} </ha-button> </ha-list-item-base> </ha-list-base> `:s.qy` <ha-list-base> <ha-list-item-base> <span slot="headline"> ${this.hass.localize("ui.panel.config.backup.encryption_key.set_encryption_key")}</span> <span slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.encryption_key.set_encryption_key_description")} </span> <ha-button slot="end" @click="${this._set}"> ${this.hass.localize("ui.panel.config.backup.encryption_key.set_encryption_key_action")}</ha-button> </ha-list-item-base> </ha-list-base> `}_download(){this._value&&(0,c.Sx)(this.hass,this._value)}_show(){(0,h.H)(this,{currentKey:this._value})}_change(){(0,r.m)(this,{currentKey:this._value,saveKey:t=>{(0,n.r)(this,"value-changed",{value:t})}})}_set(){(0,l.Q)(this,{saveKey:t=>{(0,n.r)(this,"value-changed",{value:t})}})}}u.styles=s.AH`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,o.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,i.Cg)([(0,o.wk)()],u.prototype,"value",void 0),u=(0,i.Cg)([(0,o.EM)("ha-backup-config-encryption-key")],u),e()}catch(t){e(t)}})},19006(t,e,a){a.a(t,async function(t,e){try{var i=a(62826),s=a(5124),o=a(22441),n=a(18350),r=(a(76776),a(47680),a(65829)),l=t([n,r]);[n,r]=l.then?(await l)():l;const c={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 h extends s.WF{render(){return s.qy` <ha-card outlined> <div class="summary"> ${"loading"===this.status?s.qy`<ha-spinner></ha-spinner>`:"none"===this.status?s.s6:s.qy` <div class="icon ${this.status}"> <ha-svg-icon .path="${c[this.status]}"></ha-svg-icon> </div> `} <div class="content"> <p class="heading">${this.heading}</p> <p class="description">${this.description}</p> </div> ${this.hasAction?s.qy` <div class="action"> <slot name="action"></slot> </div> `:s.s6} </div> <div class="content"> <slot></slot> </div> </ha-card> `}constructor(...t){super(...t),this.hasAction=!1,this.status="info"}}h.styles=s.AH`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,o.MZ)()],h.prototype,"heading",void 0),(0,i.Cg)([(0,o.MZ)()],h.prototype,"description",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean,attribute:"has-action"})],h.prototype,"hasAction",void 0),(0,i.Cg)([(0,o.MZ)()],h.prototype,"status",void 0),h=(0,i.Cg)([(0,o.EM)("ha-backup-summary-card")],h),e()}catch(t){e(t)}})},80931(t,e,a){var i=a(62826),s=a(5124),o=a(22441),n=(a(76776),a(43661),a(67094),a(1671),a(47819),a(26581)),r=a(14503);class l extends s.WF{firstUpdated(){this._fetchSupervisorUpdateConfig()}connectedCallback(){super.connectedCallback(),this.hasUpdated&&this._fetchSupervisorUpdateConfig()}async _fetchSupervisorUpdateConfig(){try{this._supervisorUpdateConfig=await(0,n.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 s.qy` <ha-card> <div class="card-header"> ${this.hass.localize("ui.panel.config.backup.overview.app_update_backup.title")} </div> <div class="card-content"> <ha-list-nav> <ha-list-item-button href="/config/backup/app-update-backups"> <ha-svg-icon slot="start" .path="${"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"}"></ha-svg-icon> <div slot="headline">${this._appUpdateBackupDescription()}</div> <div slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.overview.app_update_backup.description")} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-button> </ha-list-nav> </div> </ha-card> `}static get styles(){return[r.RF,s.AH`.card-header{padding-bottom:8px}.card-content{padding-left:0;padding-right:0;padding-top:0}`]}}(0,i.Cg)([(0,o.MZ)({attribute:!1})],l.prototype,"hass",void 0),(0,i.Cg)([(0,o.wk)()],l.prototype,"_supervisorUpdateConfig",void 0),l=(0,i.Cg)([(0,o.EM)("ha-backup-overview-app-update-backup")],l)},37536(t,e,a){a.a(t,async function(t,e){try{a(18111),a(22489),a(61701),a(18237);var i=a(62826),s=a(5124),o=a(22441),n=a(22786),r=a(36312),l=a(18350),c=(a(76776),a(43661),a(1671),a(47819),a(31420)),h=a(14503),d=a(46187),p=t([l,c]);[l,c]=p.then?(await p)():p;const u={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"},g=t=>t.reduce((t,e)=>(t.count++,t.size+=(0,c.v3)(e),t),{count:0,size:0});class v extends s.WF{render(){const t=(0,r.x)(this.hass.config,"hassio"),e=this._stats(this.backups,t);return s.qy` <ha-card class="my-backups"> <div class="card-header"> ${this.hass.localize("ui.panel.config.backup.overview.backups.title")} </div> <div class="card-content"> <ha-list-nav> ${e.map(([t,{count:e,size:a}])=>s.qy` <ha-list-item-button href="/config/backup/backups?type=${t}"> <ha-svg-icon slot="start" .path="${u[t]}"></ha-svg-icon> <div slot="headline"> ${this.hass.localize(`ui.panel.config.backup.overview.backups.${t}`,{count:e})} </div> <div slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.overview.backups.total_size",{size:(0,d.A)(a)})} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-button> `)} </ha-list-nav> </div> <div class="card-actions"> <ha-button appearance="filled" href="/config/backup/backups?type=all"> ${this.hass.localize("ui.panel.config.backup.overview.backups.show_all")} </ha-button> </div> </ha-card> `}static get styles(){return[h.RF,s.AH`.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,n.A)((t,e)=>(0,c.q5)(e).map(a=>{const i=t.filter(t=>(0,c.sp)(t,e)===a);return[a,g(i)]}))}}(0,i.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"backups",void 0),v=(0,i.Cg)([(0,o.EM)("ha-backup-overview-backups")],v),e()}catch(t){e(t)}})},4570(t,e,a){a.a(t,async function(t,e){try{var i=a(62826),s=a(5124),o=a(22441),n=a(1087),r=a(18350),l=(a(76776),a(67094),a(14503)),c=t([r]);r=(c.then?(await c)():c)[0];const h="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 d extends s.WF{async _setup(){(0,n.r)(this,"button-click")}render(){return s.qy` <ha-card> <div class="card-header"> <div class="icon"> <ha-svg-icon .path="${h}"></ha-svg-icon> </div> ${this.hass.localize("ui.panel.config.backup.overview.onboarding.title")} </div> <div class="card-content"> <p> ${this.hass.localize("ui.panel.config.backup.overview.onboarding.description")} </p> </div> <div class="card-actions"> <ha-button @click="${this._setup}">${this.hass.localize("ui.panel.config.backup.overview.onboarding.setup")}</ha-button> </div> </ha-card> `}static get styles(){return[l.RF,s.AH`.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,o.MZ)({attribute:!1})],d.prototype,"hass",void 0),d=(0,i.Cg)([(0,o.EM)("ha-backup-overview-onboarding")],d),e()}catch(t){e(t)}})},41264(t,e,a){a.a(t,async function(t,e){try{a(74423),a(18111),a(61701);var i=a(62826),s=a(5124),o=a(22441),n=a(6412),r=a(36312),l=a(71727),c=a(65829),h=(a(67094),a(28170),a(50723),a(31420)),d=a(44144),p=a(19006),u=t([c,p,h]);[c,p,h]=u.then?(await u)():u;const g="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",v="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",b="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",m=[["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 f 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 m.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){if((0,h.Bi)(t))return s.qy`<ha-svg-icon slot="start" .path="${v}"></ha-svg-icon>`;if((0,h.jU)(t))return s.qy`<ha-svg-icon slot="start" .path="${b}"></ha-svg-icon>`;const e=(0,l.m)(t);return s.qy` <img slot="start" .src="${(0,d.MR)({domain:e,type:"icon",darkOptimized:this.hass.themes?.darkMode})}" crossorigin="anonymous" referrerpolicy="no-referrer" alt=""> `}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(),s.qy` <div class="segmented-progress"> ${t.map(t=>s.qy` <div class="segment" style="flex:${t.flex}"> <div class="segment-bar ${(0,n.H)({active:"active"===t.state,completed:"completed"===t.state,pending:"pending"===t.state})}"></div> <span class="segment-label">${t.label}</span> </div> `)} </div> `)}_renderAgentProgress(){if(!(this._isUploadStage||this._delayingCollapse||this._collapsingAgents)||0===this.agents.length)return s.s6;return Object.keys(this.uploadProgress).length>0?s.qy` <div class="agent-list-wrapper ${this._collapsingAgents?"collapsing":""}" @animationend="${this._collapsingAgents?this._handleAgentCollapseEnd:void 0}"> <ha-list-base class="agent-list"> ${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?s.qy` <ha-list-item-base> ${this._renderAgentIcon(t.agent_id)} <div slot="headline">${e}</div> <div slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.overview.progress.agent_status.uploaded")} </div> <ha-svg-icon slot="end" class="agent-complete" .path="${g}"></ha-svg-icon> </ha-list-item-base> `:s.qy` <ha-list-item-base> ${this._renderAgentIcon(t.agent_id)} <div slot="headline">${e}</div> <div slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.overview.progress.agent_status.uploading")} </div> <span slot="end" class="progress-percentage"> ${a}% </span> <ha-spinner slot="end" size="tiny"></ha-spinner> </ha-list-item-base> `:s.qy` <ha-list-item-base> ${this._renderAgentIcon(t.agent_id)} <div slot="headline">${e}</div> <div slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.overview.progress.agent_status.uploading")} </div> <ha-spinner slot="end" size="tiny"></ha-spinner> </ha-list-item-base> `})} </ha-list-base> </div> `:s.s6}render(){const t=this._renderSegmentedProgress(),e=this._renderAgentProgress(),a=t!==s.s6||e!==s.s6;return s.qy` <ha-backup-summary-card .hass="${this.hass}" .heading="${this._heading}" .description="${this._description}" status="none"> ${a?s.qy` <div class="progress-content"> ${t} ${e} </div> `:s.s6} </ha-backup-summary-card> `}static get styles(){return[s.AH`.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,o.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],f.prototype,"manager",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],f.prototype,"agents",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],f.prototype,"uploadProgress",void 0),(0,i.Cg)([(0,o.wk)()],f.prototype,"_collapsingAgents",void 0),(0,i.Cg)([(0,o.wk)()],f.prototype,"_wasUploadStage",void 0),(0,i.Cg)([(0,o.wk)()],f.prototype,"_delayingCollapse",void 0),f=(0,i.Cg)([(0,o.EM)("ha-backup-overview-progress")],f),e()}catch(t){e(t)}})},77994(t,e,a){a.a(t,async function(t,e){try{a(74423),a(18111),a(22489),a(61701),a(13579);var i=a(62826),s=a(5124),o=a(22441),n=a(36312),r=a(91926),l=a(18350),c=(a(76776),a(43661),a(67094),a(1671),a(47819),a(31420)),h=a(23528),d=a(14503),p=t([l,c]);[l,c]=p.then?(await p)():p;const u="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",g="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",v="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",b="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z";class m extends s.WF{firstUpdated(t){super.firstUpdated(t),this._checkDbOption()}_configure(){(0,r.oo)("/config/backup/settings")}async _checkDbOption(){if((0,n.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===c.qk.NEVER)return this.hass.localize("ui.panel.config.backup.overview.settings.schedule_never");const s=this.config.schedule.time&&(0,c.en)(this.hass.locale,this.hass.config,this.config.schedule.time);let o=this.hass.localize("ui.panel.config.backup.overview.settings.schedule_never");const n=this.config.schedule.days;this.config.schedule.recurrence===c.qk.DAILY||this.config.schedule.recurrence===c.qk.CUSTOM_DAYS&&7===n.length?o=this.hass.localize(`ui.panel.config.backup.overview.settings.schedule_${this.config.schedule.time?"":"optimized_"}daily`,{time:s}):this.config.schedule.recurrence===c.qk.CUSTOM_DAYS&&0!==n.length&&(o=2===n.length&&n.includes("sat")&&n.includes("sun")?this.hass.localize(`ui.panel.config.backup.overview.settings.schedule_${this.config.schedule.time?"":"optimized_"}weekend`,{time:s}):5!==n.length||n.includes("sat")||n.includes("sun")?this.hass.localize(`ui.panel.config.backup.overview.settings.schedule_${this.config.schedule.time?"":"optimized_"}days`,{count:n.length,days:n.map(t=>this.hass.localize(`ui.panel.config.backup.overview.settings.${n.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})),o+" "+r}_addonsDescription(t){if(t.create_backup.include_all_addons)return this.hass.localize("ui.panel.config.backup.overview.settings.apps_all");const e=t.create_backup.include_addons?.length;return e?this.hass.localize("ui.panel.config.backup.overview.settings.apps_many",{count:e}):this.hass.localize("ui.panel.config.backup.overview.settings.apps_none")}_locationsDescription(t){const e=t.create_backup.agent_ids.some(t=>(0,c.Bi)(t)),a=t.create_backup.agent_ids.filter(t=>!(0,c.Bi)(t));if(a.length){if(1===a.length){const t=(0,c.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 s.qy` <ha-card class="my-backups"> <div class="card-header"> ${this.hass.localize("ui.panel.config.backup.overview.settings.title")} </div> <div class="card-content"> <ha-list-nav> <ha-list-item-button href="/config/backup/settings#schedule"> <ha-svg-icon slot="start" .path="${u}"></ha-svg-icon> <div slot="headline"> ${this._scheduleDescription(this.config)} </div> <div slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.overview.settings.schedule")} </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="${g}"></ha-svg-icon> <div slot="headline"> ${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")} </div> <div slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.overview.settings.data")} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-button> ${t?s.qy` <ha-list-item-button href="/config/backup/settings#data"> <ha-svg-icon slot="start" .path="${v}"></ha-svg-icon> <div slot="headline"> ${this._addonsDescription(this.config)} </div> <div slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.overview.settings.apps")} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-button> `:s.s6} <ha-list-item-button href="/config/backup/settings#locations"> <ha-svg-icon slot="start" .path="${b}"></ha-svg-icon> <div slot="headline"> ${this._locationsDescription(this.config)} </div> <div slot="supporting-text"> ${this.hass.localize("ui.panel.config.backup.overview.settings.locations")} </div> <ha-icon-next slot="end"></ha-icon-next> </ha-list-item-button> </ha-list-nav> </div> <div class="card-actions"> <ha-button @click="${this._configure}" appearance="filled"> ${this.hass.localize("ui.panel.config.backup.overview.settings.configure")} </ha-button> </div> </ha-card> `}static get styles(){return[d.RF,s.AH`.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,o.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],m.prototype,"config",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],m.prototype,"agents",void 0),(0,i.Cg)([(0,o.wk)()],m.prototype,"_showDbOption",void 0),m=(0,i.Cg)([(0,o.EM)("ha-backup-overview-settings")],m),e()}catch(t){e(t)}})},46971(t,e,a){a.a(t,async function(t,e){try{a(44114),a(18111),a(22489),a(20116);var i=a(62826),s=a(73214),o=a(73684),n=a(6946),r=a(57279),l=a(5124),c=a(22441),h=a(22786),d=a(72487),p=a(98975),u=a(18350),g=(a(76776),a(26300)),v=(a(67094),a(28170),a(50723),a(31420)),b=a(14503),m=a(33963),f=a(19006),_=t([u,g,f,p,v,m,d]);[u,g,f,p,v,m,d]=_.then?(await _)():_;const y="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",w="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",k="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",x=3;class C extends l.WF{_renderSummaryCard(t,e,a,i,s){return l.qy` <ha-backup-summary-card .heading="${t}" .status="${e}"> <ha-list-base> <ha-list-item-base> <ha-svg-icon slot="start" .path="${y}"></ha-svg-icon> <span slot="headline" class="${null===a?"skeleton":""}">${a}</span> </ha-list-item-base> ${i||null===i?l.qy`<ha-list-item-base> <ha-svg-icon slot="start" .path="${w}"></ha-svg-icon> <span slot="headline" class="${null===i?"skeleton":""}">${i}</span> ${s?l.qy` <ha-icon-button slot="end" @click="${this._createAdditionalBackupDescription(s)}" .path="${k}"></ha-icon-button>`:l.s6} </ha-list-item-base>`:l.s6} </ha-list-base> </ha-backup-summary-card> `}render(){const t=new Date;if(this.fetching)return this._renderSummaryCard(this.hass.localize("ui.panel.config.backup.overview.summary.loading"),"none",null,null);const e=this._lastBackup(this.backups),a=this.config.last_attempted_automatic_backup?new Date(this.config.last_attempted_automatic_backup):new Date(0),i=this.config.last_completed_automatic_backup?new Date(this.config.last_completed_automatic_backup):new Date(0),l=this.config.next_automatic_backup?new Date(this.config.next_automatic_backup):void 0,c=(0,v.en)(this.hass.locale,this.hass.config,l||this.config.schedule.time),h=this.config.next_automatic_backup_additional,u=this.config.schedule.recurrence===v.qk.NEVER||this.config.schedule.recurrence===v.qk.CUSTOM_DAYS&&0===this.config.schedule.days.length?this.hass.localize("ui.panel.config.backup.overview.summary.no_automatic_backup"):l?this.hass.localize("ui.panel.config.backup.overview.summary.next_automatic_backup",{day:(0,s.e)(l)?this.hass.localize("ui.panel.config.backup.overview.summary.tomorrow"):(0,o.c)(l)?this.hass.localize("ui.panel.config.backup.overview.summary.today"):(0,d.CA)(l,this.hass.locale,this.hass.config),time:c}):"";if(a>i){const e=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,p.K)(a,this.hass.locale,t,!0)}),e||u?e?this.hass.localize("ui.panel.config.backup.overview.summary.last_successful_backup_description",{relative_time:(0,p.K)(new Date(e.date),this.hass.locale,t,!0),count:Object.keys(e.agents).length}):u:void 0)}if(!e)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"),u,h?i:void 0);const g=new Date(e.date);if(e.failed_agent_ids?.length||e.failed_addons?.length||e.failed_folders?.length){const s=this._lastUploadedBackup(this.backups),o=[];e.failed_agent_ids?.length&&o.push("locations"),e.failed_addons?.length&&o.push("addons"),e.failed_folders?.length&&o.push("folders");const n=o.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_${n}_description`,{relative_time:(0,p.K)(a,this.hass.locale,t,!0)}),s?this.hass.localize("ui.panel.config.backup.overview.summary.last_successful_backup_description",{relative_time:(0,p.K)(new Date(s.date),this.hass.locale,t,!0),count:Object.keys(s.agents).length}):u,h?i:void 0)}const b=this.hass.localize("ui.panel.config.backup.overview.summary.last_successful_backup_description",{relative_time:(0,p.K)(new Date(e.date),this.hass.locale,t,!0),count:Object.keys(e.agents).length}),m=(0,n.c)((0,r.L)(t,-x),g),f=m>=1&&this.config.schedule.recurrence===v.qk.DAILY||m>=7;return this._renderSummaryCard(this.hass.localize("ui.panel.config.backup.overview.summary."+(f?"backup_too_old_heading":"backup_success_heading"),{count:m}),f?"warning":"success",b,u,h?i:void 0)}static get styles(){return[b.RF,l.AH`.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=>0===t.failed_agent_ids?.length)),this._createAdditionalBackupDescription=t=>()=>{(0,m.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,c.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,i.Cg)([(0,c.MZ)({attribute:!1})],C.prototype,"backups",void 0),(0,i.Cg)([(0,c.MZ)({attribute:!1})],C.prototype,"config",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean})],C.prototype,"fetching",void 0),C=(0,i.Cg)([(0,c.EM)("ha-backup-overview-summary")],C),e()}catch(t){e(t)}})},39592(t,e,a){a.d(e,{D:()=>o});var i=a(1087);const s=()=>Promise.all([a.e(7014),a.e(67723),a.e(59067)]).then(a.bind(a,8022)),o=(t,e)=>new Promise(a=>{const o=e?.cancel,n=e?.submit;(0,i.r)(t,"show-dialog",{dialogTag:"ha-dialog-backup-onboarding",dialogImport:s,dialogParams:{...e,cancel:()=>{a(!1),o&&o()},submit:t=>{a(t),n&&n(t)}}})})},13407(t,e,a){a.d(e,{m:()=>o});var i=a(1087);const s=()=>a.e(87448).then(a.bind(a,6891)),o=(t,e)=>new Promise(a=>{const o=e?.cancel,n=e?.submit;(0,i.r)(t,"show-dialog",{dialogTag:"ha-dialog-change-backup-encryption-key",dialogImport:s,dialogParams:{...e,cancel:()=>{a(!1),o&&o()},submit:t=>{a(t),n&&n(t)}}})})},81440(t,e,a){a.d(e,{M:()=>o});var i=a(1087);const s=()=>a.e(81493).then(a.bind(a,44244)),o=(t,e)=>{(0,i.r)(t,"show-dialog",{dialogTag:"ha-dialog-download-decrypted-backup",dialogImport:s,dialogParams:e})}},20142(t,e,a){a.d(e,{f:()=>o});var i=a(1087);const s=()=>Promise.all([a.e(7014),a.e(6839)]).then(a.bind(a,60490)),o=(t,e)=>new Promise(a=>{const o=e.cancel,n=e.submit;(0,i.r)(t,"show-dialog",{dialogTag:"ha-dialog-generate-backup",dialogImport:s,dialogParams:{...e,cancel:()=>{a(null),o&&o()},submit:t=>{a(t),n&&n(t)}}})})},83907(t,e,a){a.d(e,{s:()=>o});var i=a(1087);const s=()=>a.e(23060).then(a.bind(a,35167)),o=(t,e)=>new Promise(a=>{const o=e.cancel,n=e.submit;(0,i.r)(t,"show-dialog",{dialogTag:"ha-dialog-new-backup",dialogImport:s,dialogParams:{...e,cancel:()=>{a(null),o&&o()},submit:t=>{a(t),n&&n(t)}}})})},17393(t,e,a){a.d(e,{Q:()=>o});var i=a(1087);const s=()=>a.e(11966).then(a.bind(a,50157)),o=(t,e)=>new Promise(a=>{const o=e?.cancel,n=e?.submit;(0,i.r)(t,"show-dialog",{dialogTag:"ha-dialog-set-backup-encryption-key",dialogImport:s,dialogParams:{...e,cancel:()=>{a(!1),o&&o()},submit:t=>{a(t),n&&n(t)}}})})},86801(t,e,a){a.d(e,{H:()=>o});var i=a(1087);const s=()=>a.e(84175).then(a.bind(a,55218)),o=(t,e)=>(0,i.r)(t,"show-dialog",{dialogTag:"ha-dialog-show-backup-encryption-key",dialogImport:s,dialogParams:e})},67320(t,e,a){a.d(e,{p:()=>o});var i=a(1087);const s=()=>a.e(24901).then(a.bind(a,62468)),o=(t,e)=>new Promise(a=>{const o=e.cancel,n=e.submit;(0,i.r)(t,"show-dialog",{dialogTag:"ha-dialog-upload-backup",dialogImport:s,dialogParams:{...e,cancel:()=>{a(null),o&&o()},submit:()=>{a(void 0),n&&n()}}})})},12510(t,e,a){a.a(t,async function(t,e){try{a(74423),a(18111),a(22489),a(7588),a(61701),a(13579),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(14603),a(47566),a(98721);var i=a(62826),s=a(5124),o=a(22441),n=a(22786),r=a(36312),l=a(98975),c=a(93905),h=a(1087),d=a(71727),p=a(91926),u=a(18350),g=a(29823),v=(a(70947),a(64263)),b=(a(47680),a(43661),a(75248)),m=a(65829),f=(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),z=a(67320),H=a(63993),S=t([u,g,v,b,m,w,l,H,f]);[u,g,v,b,m,w,l,H,f]=S.then?(await S)():S;const V="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",L="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",Z="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z",I="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",E="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",q="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",P="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z",B="ha-filter-states",D="backup-locations";class O 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 s.qy` <hass-tabs-subpage-data-table has-fab .tabs="${[{name:this.hass.localize("ui.panel.config.backup.backups.header"),path:"/config/backup/list"}]}" .hass="${this.hass}" .narrow="${this.narrow}" back-path="/config/backup/overview" clickable id="backup_id" has-filters .filters="${Object.values(this._filters).filter(t=>Array.isArray(t)?t.length:t&&Object.values(t).some(t=>Array.isArray(t)?t.length:t)).length}" selectable .selected="${this._selected.length}" .initialGroupColumn="${this._activeGrouping}" .initialCollapsedGroups="${this._activeCollapsed}" .groupOrder="${this._groupOrder(this._activeGrouping,this.hass.localize,e)}" @grouping-changed="${this._handleGroupingChanged}" @collapsed-changed="${this._handleCollapseChanged}" @selection-changed="${this._handleSelectionChanged}" @clear-filter="${this._clearFilter}" .route="${this.route}" @row-click="${this._showBackupDetails}" .columns="${this._columns(this.hass.localize,i)}" .data="${a}" .noDataText="${this.hass.localize("ui.panel.config.backup.no_backups")}" .searchLabel="${this.hass.localize("ui.panel.config.backup.picker.search")}"> <div slot="toolbar-icon"> <ha-dropdown @wa-select="${this._handleDropdownSelect}" placement="bottom-end"> <ha-icon-button slot="trigger" .label="${this.hass.localize("ui.common.menu")}" .path="${L}"></ha-icon-button> <ha-dropdown-item value="upload_backup"> <ha-svg-icon slot="icon" .path="${P}"></ha-svg-icon> ${this.hass.localize("ui.panel.config.backup.backups.menu.upload_backup")} </ha-dropdown-item> </ha-dropdown> </div> <div slot="selection-bar"> ${this.narrow?s.qy` <ha-icon-button .label="${this.hass.localize("ui.panel.config.backup.backups.delete_selected")}" .path="${V}" class="warning" @click="${this._deleteSelected}"></ha-icon-button> `:s.qy` <ha-button appearance="plain" @click="${this._deleteSelected}" variant="danger"> ${this.hass.localize("ui.panel.config.backup.backups.delete_selected")} </ha-button> `} </div> <ha-filter-states .hass="${this.hass}" .label="${this.hass.localize("ui.panel.config.backup.backup_type")}" .value="${this._filters[B]}" .states="${this._states(this.hass.localize,e)}" @data-table-filter-changed="${this._typeFilterChanged}" slot="filter-pane" .narrow="${this.narrow}"></ha-filter-states> <ha-filter-states .hass="${this.hass}" .label="${this.hass.localize("ui.panel.config.backup.locations")}" .value="${this._filters[D]}" .states="${this._locations(this.hass.localize,this.agents,this.backups)}" @data-table-filter-changed="${this._locationsFilterChanged}" slot="filter-pane" .narrow="${this.narrow}"></ha-filter-states> ${this._needsOnboarding?s.s6:s.qy` <ha-button slot="fab" size="large" ?disabled="${t}" @click="${this._newBackup}"> ${t?s.qy`<div slot="start" class="loading"> <ha-spinner .size="${"small"}"></ha-spinner> </div>`:s.qy`<ha-svg-icon slot="start" .path="${q}"></ha-svg-icon>`} ${this.hass.localize("ui.panel.config.backup.backups.new_backup")} </ha-button> `} </hass-tabs-subpage-data-table> <ha-dropdown id="overflow-menu" @wa-select="${this._handleOverflowAction}" @wa-after-show="${this._overflowMenuOpened}" @wa-after-hide="${this._overflowMenuClosed}"> <ha-dropdown-item value="download"> <ha-svg-icon slot="icon" .path="${Z}"></ha-svg-icon> ${this.hass.localize("ui.common.download")} </ha-dropdown-item> <ha-dropdown-item variant="danger" value="delete"> <ha-svg-icon slot="icon" .path="${V}"></ha-svg-icon> ${this.hass.localize("ui.common.delete")} </ha-dropdown-item> </ha-dropdown> `}_typeFilterChanged(t){this._filters={...this._filters,[B]:t.detail.value},this._fromUrl||(this._storageFilters=this._filters)}_locationsFilterChanged(t){this._filters={...this._filters,[D]: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={[B]:"all"===t?[]:[t]})}get _needsOnboarding(){return!this.config?.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,f.SG)(this.hass,t),void(0,h.r)(this,"ha-refresh-backup-info")}"automatic"===e&&(await(0,f.IW)(this.hass),(0,h.r)(this,"ha-refresh-backup-info"))}}_showBackupDetails(t){const e=t.detail.id;(0,p.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,f.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){const e=t.detail?.item.value;"upload_backup"===e&&this._uploadBackup()}static get styles(){return[x.RF,s.AH`.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,n.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,l.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,o=Math.max(a.length-i.length,0);return s.qy` <div style="display:flex;gap:var(--ha-space-1)"> ${i.map(t=>{const e=(0,f.q7)(this.hass.localize,t,this.agents);if((0,f.Bi)(t))return s.qy` <ha-svg-icon .path="${I}" title="${e}" style="flex-shrink:0"></ha-svg-icon> `;if((0,f.jU)(t))return s.qy` <ha-svg-icon .path="${E}" title="${e}" style="flex-shrink:0"></ha-svg-icon> `;const a=(0,d.m)(t);return s.qy` <img title="${e}" .src="${(0,C.MR)({domain:a,type:"icon",darkOptimized:this.hass.themes?.darkMode},this.hass.auth.data.hassUrl)}" height="24" crossorigin="anonymous" referrerpolicy="no-referrer" alt="${e}" slot="graphic" style="flex-shrink:0"> `})} ${o?s.qy` <span style="display:flex;align-items:center;font-size:var(--ha-font-size-m)"> +${o} </span> `:s.s6} </div> `}},actions:{lastFixed:!0,title:"",label:t("ui.panel.config.generic.headers.actions"),showNarrow:!0,type:"overflow-menu",template:t=>s.qy` <ha-icon-button .backup="${t}" .label="${this.hass.localize("ui.common.overflow_menu")}" .path="${L}" @click="${this._toggleOverflowMenu}"></ha-icon-button> `}})),this._groupOrder=(0,n.A)((t,e,a)=>"formatted_type"===t?(0,f.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,n.A)((t,e,a,i)=>{const s=e[B],o=e[D];let n=t;return s?.length&&(n=n.filter(t=>{const e=(0,f.sp)(t,i);return s.includes(e)})),o?.length&&(n=n.filter(t=>Object.keys(t.agents).some(t=>o.includes(t)))),n.map(t=>{const e=(0,f.sp)(t,i),s=Object.keys(t.agents);return{...t,size:(0,f.v3)(t),agent_ids:s.sort(f.yj),formatted_type:a(`ui.panel.config.backup.type.${e}`)}})}),this._maxAgents=(0,n.A)(t=>Math.max(1,...t.map(t=>t.agent_ids.length))),this._locations=(0,n.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(f.yj).map(a=>({value:a,label:(0,f.q7)(t,a,e)}))}),this._states=(0,n.A)((t,e)=>(0,f.q5)(e).map(e=>({value:e,label:t(`ui.panel.config.backup.type.${e}`)}))),this._uploadBackup=async()=>{await(0,z.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,H.$)(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,f.mu)(this.hass,t.backup_id),this._selected.includes(t.backup_id)&&(this._selected=this._selected.filter(e=>e!==t.backup_id))}catch(t){return void(0,y.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.backup.dialogs.delete.failed"),text:(0,_.VR)(t)})}(0,h.r)(this,"ha-refresh-backup-info")}}}}(0,i.Cg)([(0,o.MZ)({attribute:!1})],O.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],O.prototype,"cloudStatus",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],O.prototype,"narrow",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],O.prototype,"route",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],O.prototype,"manager",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],O.prototype,"backups",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],O.prototype,"config",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],O.prototype,"agents",void 0),(0,i.Cg)([(0,o.wk)()],O.prototype,"_selected",void 0),(0,i.Cg)([(0,o.wk)()],O.prototype,"_filters",void 0),(0,i.Cg)([(0,c.I)({storage:"sessionStorage",key:"backups-table-filters",state:!1,subscribe:!1})],O.prototype,"_storageFilters",void 0),(0,i.Cg)([(0,c.I)({key:"backups-table-grouping",state:!1,subscribe:!1})],O.prototype,"_activeGrouping",void 0),(0,i.Cg)([(0,c.I)({key:"backups-table-collapsed",state:!1,subscribe:!1})],O.prototype,"_activeCollapsed",void 0),(0,i.Cg)([(0,o.P)("hass-tabs-subpage-data-table",!0)],O.prototype,"_dataTable",void 0),(0,i.Cg)([(0,o.P)("#overflow-menu")],O.prototype,"_overflowMenu",void 0),O=(0,i.Cg)([(0,o.EM)("ha-config-backup-backups")],O),e()}catch(t){e(t)}})},64202(t,e,a){a.a(t,async function(t,e){try{a(74423),a(18111),a(61701);var i=a(62826),s=a(5124),o=a(22441),n=a(1087),r=a(9899),l=a(18350),c=(a(76776),a(29823)),h=(a(70947),a(47680),a(43661),a(75248)),d=a(65829),p=(a(67094),a(31420)),u=a(81310),g=a(72553),v=a(14503),b=a(33963),m=a(37536),f=(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([l,c,h,d,u,g,m,f,_,y,w,k,b,p]);[l,c,h,d,u,g,m,f,_,y,w,k,b,p]=A.then?(await A)():A;const z="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",H="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",S="M9,16V10H5L12,3L19,10H15V16H9M5,20V18H19V20H5Z";class V 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={...this._config,create_backup:{...this._config.create_backup,password:e}},this._debounceSaveConfig()}async _saveConfig(){this._config&&(await(0,p.gF)(this.hass,this._config),(0,n.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,n.r)(this,"ha-refresh-backup-config");try{await(0,p.IW)(this.hass)}catch(t){return void(0,b.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.backup.overview.create_backup_failed"),text:t.message})}(0,n.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,p.SG)(this.hass,t)}else"automatic"===e&&await(0,p.IW)(this.hass)}catch(t){return void(0,b.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.backup.overview.create_backup_failed"),text:t.message})}(0,n.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 s.qy` <hass-subpage back-path="/config/system" .hass="${this.hass}" .narrow="${this.narrow}" .header="${this.hass.localize("ui.panel.config.backup.overview.header")}"> <ha-dropdown slot="toolbar-icon" placement="bottom-end" @wa-select="${this._handleDropdownSelect}"> <ha-icon-button slot="trigger" .label="${this.hass.localize("ui.common.menu")}" .path="${z}"></ha-icon-button> <ha-dropdown-item value="upload_backup"> <ha-svg-icon slot="icon" .path="${S}"></ha-svg-icon> ${this.hass.localize("ui.panel.config.backup.overview.menu.upload_backup")} </ha-dropdown-item> </ha-dropdown> <div class="content"> ${this.info&&Object.keys(this.info.agent_errors).length?s.qy`${Object.entries(this.info.agent_errors).map(([t,e])=>s.qy`<ha-alert alert-type="error" .title="${this.hass.localize("ui.panel.config.backup.overview.agent_error",{name:(0,p.q7)(this.hass.localize,t,this.agents)})}"> ${e} </ha-alert>`)}`:s.s6} ${t?s.qy` <ha-backup-overview-progress .hass="${this.hass}" .manager="${this.manager}" .agents="${this.agents}" .uploadProgress="${this.uploadProgress}"> </ha-backup-overview-progress> `:this._needsOnboarding?s.qy` <ha-backup-overview-onboarding .hass="${this.hass}" @button-click="${this._handleOnboardingButtonClick}"> </ha-backup-overview-onboarding> `:this.config?s.qy` <ha-backup-overview-summary .hass="${this.hass}" .backups="${this.backups}" .config="${this.config}" .fetching="${this.fetching}"> </ha-backup-overview-summary> `:s.s6} <ha-backup-overview-backups .hass="${this.hass}" .backups="${this.backups}"></ha-backup-overview-backups> ${!this._needsOnboarding&&this._config?s.qy` <ha-card> <div class="card-header"> ${this.hass.localize("ui.panel.config.backup.settings.encryption_key.title")} </div> <div class="card-content"> <p> ${this.hass.localize("ui.panel.config.backup.settings.encryption_key.description")} </p> <ha-backup-config-encryption-key .hass="${this.hass}" .value="${this._config.create_backup.password}" @value-changed="${this._encryptionKeyChanged}"></ha-backup-config-encryption-key> </div> </ha-card> <ha-backup-overview-settings .hass="${this.hass}" .config="${this._config}" .agents="${this.agents}"></ha-backup-overview-settings> ${this.hass.config.components.includes("hassio")?s.qy` <ha-backup-overview-app-update-backup .hass="${this.hass}"></ha-backup-overview-app-update-backup> `:s.s6} `:s.s6} </div> <ha-button slot="fab" size="large" .loading="${t}" @click="${this._newBackup}"> <ha-svg-icon slot="start" .path="${H}"></ha-svg-icon> ${this.hass.localize("ui.panel.config.backup.overview.new_backup")} </ha-button> </hass-subpage> `}_handleDropdownSelect(t){const e=t.detail?.item.value;"upload_backup"===e&&this._uploadBackup()}static get styles(){return[v.RF,s.AH`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,o.MZ)({attribute:!1})],V.prototype,"hass",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],V.prototype,"cloudStatus",void 0),(0,i.Cg)([(0,o.MZ)({type:Boolean})],V.prototype,"narrow",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],V.prototype,"route",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],V.prototype,"manager",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],V.prototype,"info",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],V.prototype,"backups",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],V.prototype,"fetching",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],V.prototype,"config",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],V.prototype,"agents",void 0),(0,i.Cg)([(0,o.MZ)({attribute:!1})],V.prototype,"uploadProgress",void 0),(0,i.Cg)([(0,o.wk)()],V.prototype,"_config",void 0),V=(0,i.Cg)([(0,o.EM)("ha-config-backup-overview")],V),e()}catch(t){e(t)}})},51348(t,e,a){a.a(t,async function(t,i){try{a.r(e);a(18111),a(13579);var s=a(62826),o=a(22441),n=a(9899),r=a(31420),l=a(30884),c=a(77423),h=a(324),d=a(72553),p=a(54706),u=a(81619),g=a(12510),v=a(64202),b=t([d,g,v,r]);[d,g,v,r]=b.then?(await b)():b;class m extends((0,p.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){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=this._info?.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,c.TC)(this.hass,t=>{t.some(t=>null!==t.type)&&this._debouncedFetchBackupAgents()},{type:["service"]}),(0,l.A)(this.hass,t=>{if("agent_id"in t)return void(this._uploadProgress={...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,u.P)(this,{message:t})}})]}constructor(...t){super(...t),this.narrow=!1,this._manager=l.K,this._agents=[],this._fetching=!1,this._uploadProgress={},this._debouncedFetchBackupAgents=(0,n.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,o.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,s.Cg)([(0,o.MZ)({attribute:!1})],m.prototype,"cloudStatus",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean})],m.prototype,"narrow",void 0),(0,s.Cg)([(0,o.wk)()],m.prototype,"_manager",void 0),(0,s.Cg)([(0,o.wk)()],m.prototype,"_info",void 0),(0,s.Cg)([(0,o.wk)()],m.prototype,"_agents",void 0),(0,s.Cg)([(0,o.wk)()],m.prototype,"_fetching",void 0),(0,s.Cg)([(0,o.wk)()],m.prototype,"_config",void 0),(0,s.Cg)([(0,o.wk)()],m.prototype,"_uploadProgress",void 0),m=(0,s.Cg)([(0,o.EM)("ha-config-backup")],m),i()}catch(t){i(t)}})},63993(t,e,a){a.a(t,async function(t,i){try{a.d(e,{$:()=>d,s:()=>h});var s=a(82e3),o=a(31420),n=a(30039),r=a(33963),l=a(81440),c=t([o,r]);[o,r]=c.then?(await c)():c;const h=async(t,e,a,i)=>{const r=await(0,s.e0)(t,(0,o.yL)(e,a,i));(0,n.R)(r.path)},d=async(t,e,a,i,s)=>{const n=Object.keys(a.agents),c=s??(0,o.EB)(n),d=a.agents[c]?.protected;if(!d)return void h(t,a.backup_id,c);const p=i?.create_backup?.password;if(p)try{await(0,o.Zm)(t,a.backup_id,c,p),h(t,a.backup_id,c,p)}catch(i){if("password_incorrect"===i?.code)return void(0,l.M)(e,{backup:a,agentId:c});if("decrypt_not_supported"===i?.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,c)}});(0,r.showAlertDialog)(e,{title:t.localize("ui.panel.config.backup.dialogs.download.error_check_title",{error:i.message}),text:t.localize("ui.panel.config.backup.dialogs.download.error_check_description",{error:i.message})})}else(0,l.M)(e,{backup:a,agentId:c})};i()}catch(t){i(t)}})},34128(t,e,a){a.d(e,{G9:()=>n,Ni:()=>o,Ue:()=>h,Vd:()=>d,gh:()=>p});a(74423);var i=a(1087),s=a(45291);const o=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},n=(t,e)=>({type:"error",error:t,origConfig:e}),r=(t,e)=>{const a=document.createElement(t);return a.setConfig(e),a},l=(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(58416),a.e(99788),a.e(22398),a.e(82134),a.e(26092),a.e(34310),a.e(59704),a.e(25322),a.e(90790),a.e(89747),a.e(59532),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(66006),a.e(38260)]).then(a.bind(a,50655)),customElements.whenDefined("hui-error-badge").then(()=>{customElements.upgrade(e),e.setConfig(t)})),e})(n(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(58416),a.e(99788),a.e(22398),a.e(82134),a.e(26092),a.e(34310),a.e(59704),a.e(25322),a.e(90790),a.e(89747),a.e(59532),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(66006),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)):o({type:"error",message:e}),c=t=>(0,s.c8)(t)?(0,s.Iu)(t):void 0,h=(t,e,a,i,s,o)=>{try{return d(t,e,a,i,s,o)}catch(a){return console.error(t,e.type,a),l(t,a.message,e)}},d=(t,e,a,s,o,n)=>{if(!e||"object"!=typeof e)throw new Error("Config is not an object");if(!(e.type||n||o&&"entity"in e))throw new Error("No card type configured");const h=e.type?c(e.type):void 0;if(h)return((t,e,a)=>{if(customElements.get(e))return r(e,a);const s=l(t,`Custom element doesn't exist: ${e}.`,a);if(!e.includes("-"))return s;s.style.display="None";const o=window.setTimeout(()=>{s.style.display=""},2e3);return customElements.whenDefined(e).then(()=>{clearTimeout(o),(0,i.r)(s,"ll-rebuild")}),s})(t,h,e);let d;if(o&&!e.type&&e.entity){d=`${o[e.entity.split(".",1)[0]]||o._domain_not_found}-entity`}else d=e.type||n;if(void 0===d)throw new Error("No type specified");const p=`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})(p,e);if(a&&a.has(d))return r(p,e);throw new Error(`Unknown type encountered: ${d}`)},p=async(t,e,a,i)=>{const s=c(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 o=`hui-${t}-${e}`,n=customElements.get(o);if(a&&a.has(t))return n;if(i&&t in i)return n||i[t]().then(()=>customElements.get(o));throw new Error(`Unknown type: ${t}`)}},94225(t,e,a){a.a(t,async function(t,i){try{a.d(e,{T:()=>_,t:()=>y});a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698);var s=a(99799),o=a(29003),n=a(92055),r=a(19396),l=a(74323),c=a(51199),h=a(43721),d=a(65509),p=a(21659),u=a(82525),g=a(34128),v=t([s,o,n,r,l,c,h,d,p,u]);[s,o,n,r,l,c,h,d,p,u]=v.then?(await v)():v;const b=new Set(["media-player-entity","scene-entity","script-entity","sensor-entity","simple-entity","toggle-entity","button","call-service"]),m={"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(81767)]).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":()=>a.e(61331).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))},f={_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,b,m,f,void 0),y=t=>(0,g.gh)(t,"row",b,m);i()}catch(t){i(t)}})},14503(t,e,a){a.d(e,{RF:()=>o,dp:()=>l,kO:()=>r,nA:()=>n,og:()=>s});var i=a(5124);const s=i.AH`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`,o=i.AH`: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)}${s} .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}`,n=i.AH`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)}`,r=i.AH`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}}`,l=i.AH`.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}`;i.AH`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`},46187(t,e,a){a.d(e,{A:()=>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(t,e,a){a.d(e,{R:()=>s});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))}},89429(t){t.exports=function(){}}};