UNPKG

iobroker.lovelace

Version:

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

10 lines 32.8 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[67723],{32656:function(e,t,a){a.a(e,async function(e,t){try{a(74423),a(62953);var i=a(40445),s=a(5124),n=a(67576),o=a(63672),l=a(1087),r=a(57237),h=a(26300),d=(a(3449),a(606)),p=a(91485),c=e([h,d,p]);[h,d,p]=c.then?(await c)():c;let u,g,b,m,v,y,_,f,$,x,C,w=e=>e;const M="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";class k extends s.WF{reportValidity(){const e=this._inputs;return!e||[...e].every(e=>e.reportValidity())}render(){return(0,s.qy)(u||(u=w` ${0} <div class="time-input-wrap-wrap"> <div class="time-input-wrap"> ${0} <ha-input id="hour" type="number" inputmode="numeric" .value="${0}" .label="${0}" .placeholder="${0}" name="hours" @change="${0}" @focusin="${0}" without-spin-buttons .required="${0}" .autoValidate="${0}" maxlength="2" max="${0}" min="0" .disabled="${0}"> </ha-input> <div class="time-separator">:</div> <ha-input id="min" type="number" inputmode="numeric" .value="${0}" .label="${0}" .placeholder="${0}" @change="${0}" @focusin="${0}" name="minutes" without-spin-buttons .required="${0}" .autoValidate="${0}" maxlength="2" max="59" min="0" .disabled="${0}"> </ha-input> ${0} ${0} ${0} ${0} ${0} </div> </div> ${0} `),this.label?(0,s.qy)(g||(g=w`<label>${0}${0}</label>`),this.label,this.required?" *":""):s.s6,this.enableDay?(0,s.qy)(b||(b=w` <ha-input id="day" type="number" inputmode="numeric" .value="${0}" .label="${0}" .placeholder="${0}" name="days" @change="${0}" @focusin="${0}" without-spin-buttons .required="${0}" .autoValidate="${0}" min="0" .disabled="${0}"> </ha-input> <div class="time-separator">:</div> `),this.days.toFixed(),this.placeholderLabels?"":this.dayLabel,this.placeholderLabels?this.dayLabel:"",this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled):s.s6,this.hours.toFixed(),this.placeholderLabels?"":this.hourLabel,this.placeholderLabels?this.hourLabel:"",this._valueChanged,this._onFocus,this.required,this.autoValidate,(0,o.J)(this._hourMax),this.disabled,this._formatValue(this.minutes),this.placeholderLabels?"":this.minLabel,this.placeholderLabels?this.minLabel:"",this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled,this.enableSecond?(0,s.qy)(m||(m=w`<div class="time-separator">:</div>`)):s.s6,this.enableSecond?(0,s.qy)(v||(v=w`<ha-input id="sec" type="number" inputmode="decimal" step="any" .value="${0}" .label="${0}" .placeholder="${0}" @change="${0}" @focusin="${0}" name="seconds" without-spin-buttons .required="${0}" .autoValidate="${0}" max="59" min="0" .disabled="${0}"> </ha-input> ${0}`),this._formatValue(this.seconds),this.placeholderLabels?"":this.secLabel,this.placeholderLabels?this.secLabel:"",this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled,this.enableMillisecond?(0,s.qy)(y||(y=w`<div class="time-separator">:</div>`)):s.s6):s.s6,this.enableMillisecond?(0,s.qy)(_||(_=w`<ha-input id="millisec" type="number" .value="${0}" .label="${0}" .placeholder="${0}" @change="${0}" @focusin="${0}" name="milliseconds" without-spin-buttons .required="${0}" .autoValidate="${0}" maxlength="3" max="999" min="0" .disabled="${0}"> </ha-input>`),this._formatValue(this.milliseconds,3),this.placeholderLabels?"":this.millisecLabel,this.placeholderLabels?this.millisecLabel:"",this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled):s.s6,24===this.format?s.s6:(0,s.qy)(f||(f=w`<ha-select .required="${0}" .value="${0}" .disabled="${0}" .name="${0}" @selected="${0}" @wa-after-hide="${0}" @wa-hide="${0}" .options="${0}"> </ha-select>`),this.required,this.amPm,this.disabled,"amPm",this._valueChanged,r.d,r.d,["AM","PM"]),!this.clearable||this.required||this.disabled?s.s6:(0,s.qy)($||($=w`<ha-icon-button label="clear" @click="${0}" .path="${0}"></ha-icon-button>`),this._clearValue,M),this.helper?(0,s.qy)(x||(x=w`<ha-input-helper-text .disabled="${0}">${0}</ha-input-helper-text>`),this.disabled,this.helper):s.s6)}_clearValue(){(0,l.r)(this,"value-changed")}_valueChanged(e){const t=e.currentTarget;this[t.name||""]="amPm"===t.name?e.detail.value:Number(t.value);const a={hours:this.hours,minutes:this.minutes,seconds:this.seconds,milliseconds:this.milliseconds};this.enableDay&&(a.days=this.days),12===this.format&&(a.amPm=this.amPm),(0,l.r)(this,"value-changed",{value:a})}_onFocus(e){e.currentTarget.select()}_formatValue(e,t=2){const a=e.toString();return a.includes(".")?a:a.padStart(t,"0")}get _hourMax(){if(!this.noHoursLimit)return 12===this.format?12:23}constructor(...e){super(...e),this.autoValidate=!1,this.required=!1,this.format=12,this.disabled=!1,this.days=0,this.hours=0,this.minutes=0,this.seconds=0,this.milliseconds=0,this.dayLabel="",this.hourLabel="",this.minLabel="",this.secLabel="",this.millisecLabel="",this.enableSecond=!1,this.enableMillisecond=!1,this.enableDay=!1,this.noHoursLimit=!1,this.amPm="AM",this.placeholderLabels=!1}}k.shadowRootOptions=Object.assign(Object.assign({},s.WF.shadowRootOptions),{},{delegatesFocus:!0}),k.styles=(0,s.AH)(C||(C=w`:host([clearable]){position:relative}.time-input-wrap-wrap{display:flex}.time-input-wrap{display:flex;flex:var(--time-input-flex,unset);border-radius:var(--mdc-shape-small,var(--ha-border-radius-sm)) var(--mdc-shape-small,var(--ha-border-radius-sm)) var(--ha-border-radius-square) var(--ha-border-radius-square);overflow:hidden;position:relative;direction:ltr;padding-right:3px}ha-input{height:56px;padding:0;width:60px;flex-grow:1}ha-input:first-child{--text-field-border-top-left-radius:var(--mdc-shape-medium)}ha-input:last-child{--text-field-border-top-right-radius:var(--mdc-shape-medium)}ha-input::part(wa-base){padding:var(--ha-space-1)}ha-input:first-child::part(wa-base){padding-inline-start:var(--ha-space-4)}ha-input:last-child::part(wa-base){padding-inline-end:var(--ha-space-4)}ha-input::part(wa-hint){height:0}ha-input::part(wa-input){text-align:center}.time-separator,ha-icon-button{background-color:var(--ha-color-form-background);color:var(--ha-color-text-secondary);border-bottom:1px solid var(--ha-color-border-neutral-loud);box-sizing:border-box;height:56px;margin-inline-start:calc(var(--ha-space-1) * -1)}.time-separator{width:12px;margin-inline-end:calc(var(--ha-space-1) * -1);display:flex;align-items:center;justify-content:center}:host([clearable]) .mdc-select__anchor{padding-inline-end:var(--select-selected-text-padding-end,12px)}ha-icon-button{position:relative;--ha-icon-button-size:36px;border-start-end-radius:var(--ha-border-radius-sm);--mdc-icon-size:20px;direction:var(--direction);display:flex;align-items:center}ha-select{margin-inline:calc(var(--ha-space-1) * -1)}label{-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);-webkit-font-smoothing:var(--ha-font-smoothing);font-family:var( --mdc-typography-body2-font-family, var(--mdc-typography-font-family, var(--ha-font-family-body)) );font-size:var(--mdc-typography-body2-font-size, var(--ha-font-size-s));line-height:var( --mdc-typography-body2-line-height, var(--ha-line-height-condensed) );font-weight:var(--mdc-typography-body2-font-weight,var(--ha-font-weight-normal));letter-spacing:var( --mdc-typography-body2-letter-spacing, .0178571429em );text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:var(--mdc-typography-body2-text-transform,inherit);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));padding-left:4px;padding-inline-start:4px;padding-inline-end:initial}ha-input-helper-text{padding-top:8px;line-height:var(--ha-line-height-condensed)}`)),(0,i.Cg)([(0,n.MZ)()],k.prototype,"label",void 0),(0,i.Cg)([(0,n.MZ)()],k.prototype,"helper",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"auto-validate",type:Boolean})],k.prototype,"autoValidate",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],k.prototype,"required",void 0),(0,i.Cg)([(0,n.MZ)({type:Number})],k.prototype,"format",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],k.prototype,"disabled",void 0),(0,i.Cg)([(0,n.MZ)({type:Number})],k.prototype,"days",void 0),(0,i.Cg)([(0,n.MZ)({type:Number})],k.prototype,"hours",void 0),(0,i.Cg)([(0,n.MZ)({type:Number})],k.prototype,"minutes",void 0),(0,i.Cg)([(0,n.MZ)({type:Number})],k.prototype,"seconds",void 0),(0,i.Cg)([(0,n.MZ)({type:Number})],k.prototype,"milliseconds",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"day-label"})],k.prototype,"dayLabel",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"hour-label"})],k.prototype,"hourLabel",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"min-label"})],k.prototype,"minLabel",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"sec-label"})],k.prototype,"secLabel",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"ms-label"})],k.prototype,"millisecLabel",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"enable-second",type:Boolean})],k.prototype,"enableSecond",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"enable-millisecond",type:Boolean})],k.prototype,"enableMillisecond",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"enable-day",type:Boolean})],k.prototype,"enableDay",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"no-hours-limit",type:Boolean})],k.prototype,"noHoursLimit",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],k.prototype,"amPm",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],k.prototype,"clearable",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"placeholder-labels",type:Boolean})],k.prototype,"placeholderLabels",void 0),(0,i.Cg)([(0,n.YG)("ha-input")],k.prototype,"_inputs",void 0),k=(0,i.Cg)([(0,n.EM)("ha-base-time-input")],k),t()}catch(u){t(u)}})},50286:function(e,t,a){a.a(e,async function(e,t){try{a(62953);var i=a(40445),s=a(5124),n=a(67576),o=a(69543),l=a(1087),r=a(32656),h=e([r]);r=(h.then?(await h)():h)[0];let d,p=e=>e;class c extends s.WF{reportValidity(){var e,t;return null===(e=null===(t=this._input)||void 0===t?void 0:t.reportValidity())||void 0===e||e}render(){const e=(0,o.J)(this.locale);let t=NaN,a=NaN,i=NaN,n=0;if(this.value){var l;const s=(null===(l=this.value)||void 0===l?void 0:l.split(":"))||[];a=s[1]?Number(s[1]):0,i=s[2]?Number(s[2]):0,t=s[0]?Number(s[0]):0,n=t,n&&e&&n>12&&n<24&&(t=n-12),e&&0===n&&(t=12)}return(0,s.qy)(d||(d=p` <ha-base-time-input .label="${0}" .hours="${0}" .minutes="${0}" .seconds="${0}" .format="${0}" .amPm="${0}" .disabled="${0}" @value-changed="${0}" .enableSecond="${0}" .required="${0}" .clearable="${0}" .helper="${0}" .placeholderLabels="${0}" .autoValidate="${0}" day-label="dd" hour-label="hh" min-label="mm" sec-label="ss" ms-label="ms"></ha-base-time-input> `),this.label,t,a,i,e?12:24,e&&n>=12?"PM":"AM",this.disabled,this._timeChanged,this.enableSecond,this.required,this.clearable&&void 0!==this.value,this.helper,this.placeholderLabels,this.autoValidate)}_timeChanged(e){e.stopPropagation();const t=e.detail.value,a=(0,o.J)(this.locale);let i,s=0;if(!(void 0===t||isNaN(t.hours)&&isNaN(t.minutes)&&isNaN(t.seconds))){let e=t.hours||0;t&&a&&(s=e>=12&&e<24?e-12:0===e?12:0,"PM"===t.amPm&&e<12&&(e+=12),"AM"===t.amPm&&12===e&&(e=0)),i=`${e.toString().padStart(2,"0")}:${t.minutes?t.minutes.toString().padStart(2,"0"):"00"}:${t.seconds?t.seconds.toString().padStart(2,"0"):"00"}`}s&&this.updateComplete.then(()=>{const e=this._input;e&&(e.hours=s)}),i!==this.value&&(this.value=i,(0,l.r)(this,"change"),(0,l.r)(this,"value-changed",{value:i}))}constructor(...e){super(...e),this.disabled=!1,this.required=!1,this.autoValidate=!1,this.enableSecond=!1,this.placeholderLabels=!1}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],c.prototype,"locale",void 0),(0,i.Cg)([(0,n.MZ)()],c.prototype,"value",void 0),(0,i.Cg)([(0,n.MZ)()],c.prototype,"label",void 0),(0,i.Cg)([(0,n.MZ)()],c.prototype,"helper",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],c.prototype,"disabled",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],c.prototype,"required",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"auto-validate",type:Boolean})],c.prototype,"autoValidate",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"enable-second"})],c.prototype,"enableSecond",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],c.prototype,"clearable",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"placeholder-labels",type:Boolean})],c.prototype,"placeholderLabels",void 0),(0,i.Cg)([(0,n.P)("ha-base-time-input")],c.prototype,"_input",void 0),c=(0,i.Cg)([(0,n.EM)("ha-time-input")],c),t()}catch(d){t(d)}})},67505:function(e,t,a){var i=a(40445),s=a(5124),n=a(67576),o=a(93421);a(67094);let l,r,h=e=>e;class d extends s.WF{render(){return this._localize?(0,s.qy)(l||(l=h` <ha-svg-icon .path="${0}"></ha-svg-icon> <span class="prefix">${0}</span> <span class="text"><slot></slot></span> `),"M12,2A7,7 0 0,1 19,9C19,11.38 17.81,13.47 16,14.74V17A1,1 0 0,1 15,18H9A1,1 0 0,1 8,17V14.74C6.19,13.47 5,11.38 5,9A7,7 0 0,1 12,2M9,21V20H15V21A1,1 0 0,1 14,22H10A1,1 0 0,1 9,21M12,4A5,5 0 0,0 7,9C7,11.05 8.23,12.81 10,13.58V16H14V13.58C15.77,12.81 17,11.05 17,9A5,5 0 0,0 12,4Z",this._localize("ui.panel.config.tips.tip")):s.s6}}d.styles=(0,s.AH)(r||(r=h`:host{display:block;text-align:center}.text{direction:var(--direction);margin-left:2px;margin-inline-start:2px;margin-inline-end:initial;color:var(--secondary-text-color)}.prefix{font-weight:var(--ha-font-weight-medium)}`)),(0,i.Cg)([(0,n.wk)(),(0,o.IW)()],d.prototype,"_localize",void 0),d=(0,i.Cg)([(0,n.EM)("ha-tip")],d)},30619:function(e,t,a){a.a(e,async function(e,t){try{a(74423),a(44114),a(18111),a(22489),a(61701),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);var i=a(40445),s=a(5124),n=a(67576),o=a(20202),l=a(22786),r=a(1087),h=a(71727),d=a(91926),p=a(26300),c=(a(67094),a(59646)),u=(a(28170),a(50723),a(31420)),g=a(44144),b=e([p,c,u]);[p,c,u]=b.then?(await b)():b;let m,v,y,_,f,$,x,C,w,M,k,L,q,A,V=e=>e;const S="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",Z="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",z="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",H="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",O=[];class P extends s.WF{get _value(){var e;return null!==(e=this.value)&&void 0!==e?e:O}_description(e){var t,a,i;if(e===u.oJ)return null!==(i=this.cloudStatus)&&void 0!==i&&i.logged_in&&!this.cloudStatus.active_subscription?this.hass.localize("ui.panel.config.backup.agents.cloud_agent_no_subcription"):this.hass.localize("ui.panel.config.backup.agents.cloud_agent_description");const n=[];(0,u.jU)(e)&&n.push(this.hass.localize("ui.panel.config.backup.agents.network_mount_agent_description"));!1===(null===(t=this.agentsConfig)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.protected)&&n.push((0,s.qy)(m||(m=V`<div class="unencrypted-warning"> <span class="dot warning"></span> <span> ${0} </span> </div>`),this.hass.localize("ui.panel.config.backup.agents.encryption_turned_off")));const l=null===(a=this.agentsConfig)||void 0===a||null===(a=a[e])||void 0===a?void 0:a.retention;return l&&(null===l.copies&&null===l.days?n.push(this.hass.localize("ui.panel.config.backup.agents.retention_all")):n.push(this.hass.localize("ui.panel.config.backup.agents.retention_"+(l.copies?"backups":"days"),{count:l.copies||l.days}))),(0,o.f)(n,(0,s.qy)(v||(v=V`<span class="separator"> · </span>`)))}_renderAgentIcon(e){var t;if((0,u.Bi)(e))return(0,s.qy)(y||(y=V` <ha-svg-icon .path="${0}" slot="start"></ha-svg-icon> `),z);if((0,u.jU)(e))return(0,s.qy)(_||(_=V`<ha-svg-icon .path="${0}" slot="start"></ha-svg-icon>`),H);const a=(0,h.m)(e);return(0,s.qy)(f||(f=V` <img .src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer" alt="" slot="start"> `),(0,g.MR)({domain:a,type:"icon",darkOptimized:null===(t=this.hass.themes)||void 0===t?void 0:t.darkMode},this.hass.auth.data.hassUrl))}render(){const e=this._availableAgents(this.agents,this.cloudStatus),t=this._unavailableAgents(this.agents,this._value,this.cloudStatus),a=[...e,...t];return(0,s.qy)($||($=V` ${0} `),a.length>0?(0,s.qy)(x||(x=V` <ha-list-base> ${0} ${0} </ha-list-base> `),e.map(e=>{var t;const i=e.agent_id,n=(0,u.q7)(this.hass.localize,i,a),o=this._description(i),l=i===u.oJ&&(null===(t=this.cloudStatus)||void 0===t?void 0:t.logged_in)&&!this.cloudStatus.active_subscription;return(0,s.qy)(C||(C=V` <ha-list-item-base> ${0} <div slot="headline" class="name">${0}</div> ${0} ${0} <ha-switch slot="end" id="${0}" .checked="${0}" .disabled="${0}" @change="${0}"></ha-switch> </ha-list-item-base> `),this._renderAgentIcon(i),n,o?(0,s.qy)(w||(w=V`<div slot="supporting-text">${0}</div>`),o):s.s6,this.showSettings?(0,s.qy)(M||(M=V` <ha-icon-button id="${0}" slot="end" path="${0}" @click="${0}"></ha-icon-button> `),i,S,this._showAgentSettings):s.s6,i,this._value.includes(i),l&&!this._value.includes(i),this._agentToggled)}),t.length>0&&this.showSettings?(0,s.qy)(k||(k=V` <p class="heading"> ${0} </p> ${0} `),this.hass.localize("ui.panel.config.backup.agents.unavailable_agents"),t.map(e=>{const t=e.agent_id,i=(0,u.q7)(this.hass.localize,t,a);return(0,s.qy)(L||(L=V` <ha-list-item-base> ${0} <div slot="headline" class="name">${0}</div> <ha-icon-button id="${0}" slot="end" path="${0}" @click="${0}"></ha-icon-button> </ha-list-item-base> `),this._renderAgentIcon(t),i,t,Z,this._deleteAgent)})):s.s6):(0,s.qy)(q||(q=V` <p> ${0} </p> `),this.hass.localize("ui.panel.config.backup.agents.no_agents")))}_showAgentSettings(e){const t=e.currentTarget.id;(0,d.oo)(`/config/backup/location/${t}`)}_deleteAgent(e){e.stopPropagation();const t=e.currentTarget.id;this.value=this._value.filter(e=>e!==t),(0,r.r)(this,"value-changed",{value:this.value})}_agentToggled(e){e.stopPropagation();const t=e.currentTarget.checked,a=e.currentTarget.id;this.value=t?[...this._value,a]:this._value.filter(e=>e!==a),this.value=[...new Set(this.value)],(0,r.r)(this,"value-changed",{value:this.value})}constructor(...e){super(...e),this.agents=[],this.showSettings=!1,this._availableAgents=(0,l.A)((e,t)=>e.filter(e=>e.agent_id!==u.oJ||(null==t?void 0:t.logged_in))),this._unavailableAgents=(0,l.A)((e,t,a)=>{const i=this._availableAgents(e,a).map(e=>e.agent_id);return t.filter(e=>!i.includes(e)).map(e=>({agent_id:e,name:e.split(".")[1]||e}))})}}P.styles=(0,s.AH)(A||(A=V`ha-list-base{--ha-row-item-padding-inline:0}ha-list-item-base .name{word-break:break-word}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)}ha-list-item-base::part(headline),ha-list-item-base::part(supporting-text){white-space:wrap}ha-list-item-base::part(end){gap:var(--ha-space-2)}.unencrypted-warning{display:flex;align-items:center;gap:var(--ha-space-1)}.dot{display:block;position:relative;width:8px;height:8px;background-color:var(--disabled-color);border-radius:var(--ha-border-radius-circle)}.dot.warning{background-color:var(--warning-color)}@media all and (max-width:500px){.separator{display:none}ha-list-item-base [slot=supporting-text]{display:flex;align-items:flex-start;flex-direction:column;justify-content:flex-start;gap:var(--ha-space-1)}}`)),(0,i.Cg)([(0,n.MZ)({attribute:!1})],P.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],P.prototype,"cloudStatus",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],P.prototype,"agents",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],P.prototype,"agentsConfig",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"show-settings"})],P.prototype,"showSettings",void 0),(0,i.Cg)([(0,n.wk)()],P.prototype,"value",void 0),P=(0,i.Cg)([(0,n.EM)("ha-backup-config-agents")],P),t()}catch(m){t(m)}})},78391:function(e,t,a){a.a(e,async function(e,t){try{a(18111),a(61701),a(62953);var i=a(40445),s=a(5124),n=a(67576),o=a(1087),l=a(63004),r=(a(11382),a(606)),h=a(91485),d=(a(28170),a(83892),e([r,h]));[r,h]=d.then?(await d)():d;let p,c,u,g=e=>e;const b=1,m=9999;const v={copies_3:{copies:3,days:null},forever:{copies:null,days:null},global:null};class y extends s.WF{willUpdate(){if(!this._configLoaded&&void 0!==this.retention){var e,t;if(this._configLoaded=!0,this.retention)if(null===(null===(e=this.retention)||void 0===e?void 0:e.days)&&null===(null===(t=this.retention)||void 0===t?void 0:t.copies))this._preset="forever";else{var a;if(this._value=this.retention.copies||this.retention.days||3,this.retention.days||this.locationSpecific||3!==this.retention.copies)this._preset="custom",this._type=null!==(a=this.retention)&&void 0!==a&&a.copies?"copies":"days"}else this._preset="global";this.locationSpecific&&(this.presetOptions=["global","forever","custom"])}}render(){var e;return this._configLoaded?(0,s.qy)(p||(p=g` <ha-list-item-base> <span slot="headline"> ${0} </span> <span slot="supporting-text"> ${0} </span> <ha-select slot="end" @selected="${0}" .value="${0}" .options="${0}"></ha-select> </ha-list-item-base> ${0} `),null!==(e=this.headline)&&void 0!==e?e:this.hass.localize("ui.panel.config.backup.schedule.retention"),this.hass.localize("ui.panel.config.backup.schedule.retention_description"),this._retentionPresetChanged,this._preset,this.presetOptions.map(e=>({value:e,label:this.hass.localize(`ui.panel.config.backup.schedule.retention_presets.${e}`)})),"custom"===this._preset?(0,s.qy)(c||(c=g`<ha-expansion-panel expanded .header="${0}" outlined> <ha-row-item> <span slot="headline"> ${0} </span> <ha-input slot="end" @change="${0}" .value="${0}" id="value" type="number" .min="${0}" .max="${0}" step="1"> </ha-input> <ha-select slot="end" @selected="${0}" .value="${0}" id="type" .options="${0}"></ha-select></ha-row-item></ha-expansion-panel> `),this.hass.localize("ui.panel.config.backup.schedule.custom_retention"),this.hass.localize("ui.panel.config.backup.schedule.custom_retention_label"),this._retentionValueChanged,this._value.toString(),b.toString(),m.toString(),this._retentionTypeChanged,this._type,[{value:"days",label:this.hass.localize("ui.panel.config.backup.schedule.retention_units.days")},{value:"copies",label:this.hass.localize("ui.panel.config.backup.schedule.retention_units.copies")}]):s.s6):s.s6}_retentionPresetChanged(e){let t=e.detail.value;if(t&&("custom"!==t||!this.locationSpecific&&"forever"!==this._preset?this._preset=t:(this._preset=t,t="copies_3"),this.locationSpecific||"custom"!==t)){const e=v[t];(0,o.r)(this,"value-changed",{value:e})}}_retentionValueChanged(e){var t,a;e.stopPropagation();const i=e.currentTarget,s=parseInt(null!==(t=i.value)&&void 0!==t?t:""),n=(0,l.q)(s,b,m);i.value=n.toString();const r=null===(a=this._customTypeField)||void 0===a?void 0:a.value;(0,o.r)(this,"value-changed",{value:{copies:"copies"===r?n:null,days:"days"===r?n:null}})}_retentionTypeChanged(e){var t;const a=e.detail.value;if(!a)return;this._type=a;const i=null===(t=this._customValueField)||void 0===t?void 0:t.value;(0,o.r)(this,"value-changed",{value:{copies:"copies"===a?Number(i):null,days:"days"===a?Number(i):null}})}constructor(...e){super(...e),this.locationSpecific=!1,this._preset="copies_3",this._type="copies",this._value=3,this._configLoaded=!1,this.presetOptions=["copies_3","forever","custom"]}}y.styles=(0,s.AH)(u||(u=g`ha-list-item-base,ha-row-item{--ha-row-item-padding-inline:0}ha-row-item::part(end){align-items:flex-start}ha-list-item-base::part(headline),ha-list-item-base::part(supporting-text){white-space:wrap}ha-select{min-width:210px}@media all and (max-width:450px){ha-select{min-width:160px;width:160px}}ha-input#value{min-width:70px}ha-select#type{min-width:100px}@media all and (max-width:450px){ha-input#value{min-width:60px;margin:0 -8px}ha-select#type{min-width:120px;width:120px}}ha-expansion-panel{--expansion-panel-summary-padding:0 16px;--expansion-panel-content-padding:0 16px;margin-bottom:16px}`)),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"retention",void 0),(0,i.Cg)([(0,n.MZ)()],y.prototype,"headline",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"location-specific"})],y.prototype,"locationSpecific",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_preset",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_type",void 0),(0,i.Cg)([(0,n.wk)()],y.prototype,"_value",void 0),(0,i.Cg)([(0,n.P)("#value")],y.prototype,"_customValueField",void 0),(0,i.Cg)([(0,n.P)("#type")],y.prototype,"_customTypeField",void 0),y=(0,i.Cg)([(0,n.EM)("ha-backup-config-retention")],y),t()}catch(p){t(p)}})},40840:function(e,t,a){a.a(e,async function(e,t){try{a(74423),a(44114),a(18111),a(61701),a(62953);var i=a(40445),s=a(5124),n=a(67576),o=a(22786),l=a(30162),r=a(1087),h=(a(9503),a(11382),a(606)),d=a(50286),p=(a(67505),a(28170),a(83892),a(50723),a(31420)),c=a(36918),u=a(78391),g=e([h,d,u,l,p]);[h,d,u,l,p]=g.then?(await g)():g;let b,m,v,y,_,f,$,x,C=e=>e;const w=[p.qk.NEVER,p.qk.DAILY,p.qk.CUSTOM_DAYS],M=["default","custom"],k={recurrence:p.qk.NEVER,time_option:"default",days:[],retention:{copies:3}};class L extends s.WF{_setData(e){this.value=Object.assign(Object.assign({},this.value),{},{schedule:{recurrence:e.recurrence,time:"custom"===e.time_option?e.time:null,days:e.recurrence===p.qk.CUSTOM_DAYS?e.days:[]},retention:e.retention}),(0,r.r)(this,"value-changed",{value:this.value})}render(){var e,t;const a=this._getData(this.value);return(0,s.qy)(b||(b=C` <ha-list-base> <ha-list-item-base> <span slot="headline"> ${0}</span> <span slot="supporting-text"> ${0} </span> <ha-select slot="end" @selected="${0}" .value="${0}" .options="${0}"></ha-select> </ha-list-item-base> ${0} ${0} ${0} <ha-backup-config-retention .hass="${0}" .retention="${0}" @value-changed="${0}"></ha-backup-config-retention> <ha-tip>${0}</ha-tip> </ha-list-base> `),this.hass.localize("ui.panel.config.backup.schedule.schedule"),this.hass.localize("ui.panel.config.backup.schedule.schedule_description"),this._scheduleChanged,a.recurrence,w.map(e=>({value:e,label:this.hass.localize(`ui.panel.config.backup.schedule.schedule_options.${e}`)})),a.recurrence===p.qk.CUSTOM_DAYS?(0,s.qy)(m||(m=C`<ha-expansion-panel expanded .header="${0}" outlined> <ha-row-item class="days"> <span slot="headline"> ${0} </span> <div slot="end"> ${0} </div> </ha-row-item> </ha-expansion-panel>`),this.hass.localize("ui.panel.config.backup.schedule.custom_schedule"),this.hass.localize("ui.panel.config.backup.schedule.backup_every"),p.T2.map(e=>(0,s.qy)(v||(v=C` <div> <ha-checkbox @change="${0}" .checked="${0}" .value="${0}"> ${0} </ha-checkbox> </div> `),this._daysChanged,a.days.includes(e),e,this.hass.localize(`ui.panel.config.backup.overview.settings.weekdays.${e}`)))):s.s6,a.recurrence===p.qk.DAILY||a.recurrence===p.qk.CUSTOM_DAYS&&a.days.length>0?(0,s.qy)(y||(y=C` <ha-list-item-base> <span slot="headline"> ${0}</span> <span slot="supporting-text"> ${0} </span> <ha-select slot="end" @selected="${0}" .value="${0}" .options="${0}"></ha-select> </ha-list-item-base> ${0} `),this.hass.localize("ui.panel.config.backup.schedule.time"),this.hass.localize("ui.panel.config.backup.schedule.schedule_time_description",{time_range_start:(0,l.fU)(p.uM,this.hass.locale,this.hass.config),time_range_end:(0,l.fU)(p.pL,this.hass.locale,this.hass.config)}),this._scheduleTimeChanged,a.time_option,M.map(e=>({value:e,label:this.hass.localize(`ui.panel.config.backup.schedule.time_options.${e}`)})),"custom"===a.time_option?(0,s.qy)(_||(_=C`<ha-expansion-panel expanded .header="${0}" outlined> <ha-row-item> <span slot="headline"> ${0} </span> <span slot="supporting-text"> ${0} </span> <ha-time-input slot="end" @value-changed="${0}" .value="${0}" .locale="${0}"> </ha-time-input> </ha-row-item> </ha-expansion-panel>`),this.hass.localize("ui.panel.config.backup.schedule.custom_time"),this.hass.localize("ui.panel.config.backup.schedule.custom_time_label"),this.hass.localize("ui.panel.config.backup.schedule.custom_time_description",{time:(0,l.fU)(p.uM,this.hass.locale,this.hass.config)}),this._timeChanged,null!==(e=a.time)&&void 0!==e?e:void 0,this.hass.locale):s.s6):s.s6,this.supervisor?(0,s.qy)(f||(f=C` <ha-list-item-base> <span slot="headline"> ${0} </span> <span slot="supporting-text"> ${0} </span> <ha-select slot="end" @selected="${0}" .value="${0}" .options="${0}"></ha-select> </ha-list-item-base> `),this.hass.localize("ui.panel.config.backup.schedule.update_preference.label"),this.hass.localize("ui.panel.config.backup.schedule.update_preference.supporting_text"),this._updatePreferenceChanged,(null===(t=this.supervisorUpdateConfig)||void 0===t||null===(t=t.core_backup_before_update)||void 0===t?void 0:t.toString())||"false",[{value:"false",label:this.hass.localize("ui.panel.config.backup.schedule.update_preference.skip_backups")},{value:"true",label:this.hass.localize("ui.panel.config.backup.schedule.update_preference.backup_before_update")}]):s.s6,this.hass,a.retention,this._retentionChanged,this.hass.localize("ui.panel.config.backup.schedule.tip",{backup_create:(0,s.qy)($||($=C`<a href="${0}" target="_blank" rel="noopener noreferrer">backup.create_automatic</a>`),(0,c.o)(this.hass,"/integrations/backup/#action-backupcreate_automatic"))}))}_scheduleChanged(e){const t=e.detail.value,a=this._getData(this.value);let i=[...a.days];t===p.qk.CUSTOM_DAYS&&0===a.days.length&&(i=[...p.T2]),this._setData(Object.assign(Object.assign({},a),{},{recurrence:t,days:i}))}_scheduleTimeChanged(e){const t=e.detail.value,a=this._getData(this.value);this._setData(Object.assign(Object.assign({},a),{},{time_option:t,time:"custom"===t?"04:45:00":void 0}))}_timeChanged(e){e.stopPropagation();const t=this._getData(this.value);this._setData(Object.assign(Object.assign({},t),{},{time:e.detail.value}))}_daysChanged(e){e.stopPropagation();const t=e.currentTarget,a=t.value,i=this._getData(this.value),s=[...i.days];t.checked&&!i.days.includes(a)?s.push(a):!t.checked&&i.days.includes(a)&&s.splice(s.indexOf(a),1),(0,p.Ye)(s),this._setData(Object.assign(Object.assign({},i),{},{days:s}))}_updatePreferenceChanged(e){const t="true"===e.detail.value;(0,r.r)(this,"update-config-changed",{value:{core_backup_before_update:t}})}_retentionChanged(e){e.stopPropagation();const t=e.detail.value,a=this._getData(this.value),i=Object.assign(Object.assign({},a),{},{retention:t});this._setData(i)}constructor(...e){super(...e),this.supervisor=!1,this._getData=(0,o.A)(e=>{if(!e)return k;const t=e;return{recurrence:t.schedule.recurrence,time_option:t.schedule.time?"custom":"default",time:t.schedule.time,days:t.schedule.recurrence===p.qk.CUSTOM_DAYS?t.schedule.days:[],retention:t.retention}})}}L.styles=(0,s.AH)(x||(x=C`ha-list-base{--ha-row-item-padding-inline:0}ha-list-item-base::part(headline),ha-list-item-base::part(supporting-text),ha-row-item::part(headline),ha-row-item::part(supporting-text){white-space:wrap}ha-select{min-width:210px}ha-time-input{min-width:194px;--time-input-flex:1}@media all and (max-width:450px){ha-select{min-width:160px;width:160px}ha-time-input{min-width:145px;width:145px}}ha-expansion-panel{margin-bottom:16px}ha-tip{text-align:unset;margin:16px 0}ha-row-item-base.days::part(end){align-items:flex-start}a{color:var(--primary-color)}ha-checkbox{min-height:40px;justify-content:center;padding-right:var(--ha-space-2)}`)),(0,i.Cg)([(0,n.MZ)({attribute:!1})],L.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],L.prototype,"value",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],L.prototype,"supervisor",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],L.prototype,"supervisorUpdateConfig",void 0),L=(0,i.Cg)([(0,n.EM)("ha-backup-config-schedule")],L),t()}catch(b){t(b)}})}}]);