UNPKG

iobroker.lovelace

Version:

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

4 lines 43.8 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[21679],{90433:function(t,e,n){n.d(e,{Vy:function(){return r},fI:function(){return s},ux:function(){return l}});var i=n(22786),o=n(79468);const a=54;function r(t,e){const n=t%a+1;return e.getPropertyValue(`--color-${n}`)}function s(t,e){const n=e.getPropertyValue(`--graph-color-${t+1}`)||r(t,e);return(0,o.RQ)(n)}const l=(0,i.A)(t=>Array.from({length:a},(e,n)=>s(n,t)),(t,e)=>t[0].getPropertyValue("--graph-color-1")===e[0].getPropertyValue("--graph-color-1")&&t[0].getPropertyValue("--color-1")===e[0].getPropertyValue("--color-1"))},72487:function(t,e,n){n.a(t,async function(t,i){try{n.d(e,{CA:function(){return k},Mi:function(){return z},Pm:function(){return $},Wq:function(){return _},Yq:function(){return c},bl:function(){return L},c2:function(){return w},fr:function(){return y},gu:function(){return A},kz:function(){return u},m9:function(){return Z},sl:function(){return g},ur:function(){return H},zB:function(){return p}});n(18111),n(20116);var o=n(74487),a=n(22786),r=n(46927),s=n(8480),l=t([o,s]);[o,s]=l.then?(await l)():l;(0,a.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",month:"long",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)}));const c=(t,e,n)=>d(e,n.time_zone).format(t),d=(0,a.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),u=(t,e,n)=>h(e,n.time_zone).format(t),h=(0,a.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"short",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),p=(t,e,n)=>{var i,o,a,s;const l=m(e,n.time_zone);if(e.date_format===r.ow.language||e.date_format===r.ow.system)return l.format(t);const c=l.formatToParts(t),d=null===(i=c.find(t=>"literal"===t.type))||void 0===i?void 0:i.value,u=null===(o=c.find(t=>"day"===t.type))||void 0===o?void 0:o.value,h=null===(a=c.find(t=>"month"===t.type))||void 0===a?void 0:a.value,p=null===(s=c.find(t=>"year"===t.type))||void 0===s?void 0:s.value,g=c[c.length-1];let f="literal"===(null==g?void 0:g.type)?null==g?void 0:g.value:"";"bg"===e.language&&e.date_format===r.ow.YMD&&(f="");return{[r.ow.DMY]:`${u}${d}${h}${d}${p}${f}`,[r.ow.MDY]:`${h}${d}${u}${d}${p}${f}`,[r.ow.YMD]:`${p}${d}${h}${d}${u}${f}`}[e.date_format]},m=(0,a.A)((t,e)=>{const n=t.date_format===r.ow.system?void 0:t.language;return t.date_format===r.ow.language||(t.date_format,r.ow.system),new Intl.DateTimeFormat(n,{year:"numeric",month:"numeric",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})}),g=(t,e,n)=>f(e,n.time_zone).format(t),f=(0,a.A)((t,e)=>new Intl.DateTimeFormat(t.language,{day:"numeric",month:"short",timeZone:(0,s.wj)(t.time_zone,e)})),y=(t,e,n)=>v(e,n.time_zone).format(t),v=(0,a.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"long",year:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),_=(t,e,n)=>b(e,n.time_zone).format(t),b=(0,a.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"long",timeZone:(0,s.wj)(t.time_zone,e)})),w=(t,e,n)=>x(e,n.time_zone).format(t),x=(0,a.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"short",timeZone:(0,s.wj)(t.time_zone,e)})),$=(t,e,n)=>C(e,n.time_zone).format(t),C=(0,a.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),k=(t,e,n)=>M(e,n.time_zone).format(t),M=(0,a.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",timeZone:(0,s.wj)(t.time_zone,e)})),A=(t,e,n)=>I(e,n.time_zone).format(t),I=(0,a.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"short",timeZone:(0,s.wj)(t.time_zone,e)})),z=(t,e,n)=>T(e,n.time_zone).format(t),T=(0,a.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"short",month:"short",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),H=(t,e,n)=>S(e,n.time_zone).format(t),S=(0,a.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"short",month:"short",day:"numeric",year:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),L=(t,e,n)=>{const i=(0,s.wj)(e.time_zone,n.time_zone);return new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",timeZone:i}).format(t)},Z=(t,e,n,i)=>`${L(t,n,i)}/${L(e,n,i)}`;i()}catch(c){i(c)}})},30162:function(t,e,n){n.a(t,async function(t,i){try{n.d(e,{LW:function(){return g},Xs:function(){return p},fU:function(){return c},ie:function(){return u}});var o=n(74487),a=n(22786),r=n(8480),s=n(69543),l=t([o,r]);[o,r]=l.then?(await l)():l;const c=(t,e,n)=>d(e,n.time_zone).format(t),d=(0,a.A)((t,e)=>new Intl.DateTimeFormat(t.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,s.J)(t)?"h12":"h23",timeZone:(0,r.wj)(t.time_zone,e)})),u=(t,e,n)=>h(e,n.time_zone).format(t),h=(0,a.A)((t,e)=>new Intl.DateTimeFormat(t.language,{hour:(0,s.J)(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,s.J)(t)?"h12":"h23",timeZone:(0,r.wj)(t.time_zone,e)})),p=(t,e,n)=>m(e,n.time_zone).format(t),m=(0,a.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",hour:(0,s.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,s.J)(t)?"h12":"h23",timeZone:(0,r.wj)(t.time_zone,e)})),g=(t,e,n)=>f(e,n.time_zone).format(t),f=(0,a.A)((t,e)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,r.wj)(t.time_zone,e)}));i()}catch(c){i(c)}})},8480:function(t,e,n){n.a(t,async function(t,i){try{n.d(e,{fL:function(){return p},n2:function(){return m},wj:function(){return g}});var o,a,r,s=n(74487),l=n(29079),c=n(46927),d=t([s]);s=(d.then?(await d)():d)[0];const u=null===(o=Intl.DateTimeFormat)||void 0===o||null===(a=(r=o.call(Intl)).resolvedOptions)||void 0===a?void 0:a.call(r).timeZone,h=u&&("UTC"===u||"Etc/UTC"===u||u in l)?u:void 0,p=14881==n.j?void 0!==h:null,m=null!=h?h:"UTC",g=(t,e)=>t===c.Wj.local&&h?m:e;i()}catch(u){i(u)}})},69543:function(t,e,n){n.d(e,{J:function(){return a}});n(74423);var i=n(22786),o=n(46927);const a=(0,i.A)(t=>{if(t.time_format===o.Hg.language||t.time_format===o.Hg.system){const e=t.time_format===o.Hg.language?t.language:void 0;return new Date("January 1, 2023 22:00:00").toLocaleString(e).includes("10")}return t.time_format===o.Hg.am_pm})},93421:function(t,e,n){n.d(e,{IW:function(){return d},dH:function(){return c},fI:function(){return l}});n(44114),n(62953);var i=n(35211),o=n(22792),a=n(32172);const r=(t,e)=>{let n=t;for(const i of e){if(null==n)return;n=n[i]}return n},s=(t,e,n)=>{const o=(0,a.p)({transformer:function(t){return n.call(this,t)},watch:e?[e]:[]}),r=(0,i.Fg)({context:t,subscribe:!0});return(t,e)=>{o(t,e),r(t,e)}},l=t=>s(o.iN,t.entityIdPath[0],function(e){const n=r(this,t.entityIdPath);return"string"==typeof n?null==e?void 0:e[n]:void 0}),c=t=>s(o.X1,t.entityIdPath[0],function(e){const n=r(this,t.entityIdPath);return"string"==typeof n?null==e?void 0:e[n]:void 0}),d=()=>s(o.D5,void 0,({localize:t})=>t)},32172:function(t,e,n){n.d(e,{p:function(){return i}});n(16280),n(18111),n(7588),n(45367),n(92731),n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698),n(62953);function i(t){return(e,n)=>{if("object"==typeof n)throw new Error("This decorator does not support this compilation type.");const i=String(n),o=e;if(o._transformers){if(!o.hasOwnProperty("_transformers")){const t=o._transformers;o._transformers=new Map,t.forEach((t,e)=>o._transformers.set(e,t))}}else{o._transformers=new Map,o._watching=new Map;const t=o.willUpdate;o.willUpdate=function(e){t.call(this,e);const n=new Set;e.forEach((t,e)=>{const i=this._watching.get(e);void 0!==i&&i.forEach(t=>n.add(t))}),n.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}o._transformers.set(n,t.transformer),t.watch&&t.watch.forEach(t=>{let e=o._watching.get(t);e||(e=new Set,o._watching.set(t,e)),e.add(n)});const a=Object.getOwnPropertyDescriptor(e,n);let r;if(void 0===a)r={get(){return this[`__transform_${i}`]},set(t){const e=this[`__transform_${i}`],n=this._transformers.get(i);this[`__transform_${i}`]=n?n.call(this,t):t,this[`__original_${i}`]=t,this.requestUpdate(i,e)},configurable:!0,enumerable:!0};else{const t=a.set;r=Object.assign(Object.assign({},a),{},{set(e){const n=this[`__transform_${i}`],o=this._transformers.get(i);this[`__transform_${i}`]=o?o.call(this,e):e,this[`__original_${i}`]=e,this.requestUpdate(i,n),null==t||t.call(this,e)}})}Object.defineProperty(e,n,r)}}},67258:function(t,e,n){n.d(e,{d:function(){return i}});const i=t=>{switch(t.language){case"cs":case"de":case"fi":case"fr":case"sk":case"sv":return" ";default:return""}}},29961:function(t,e,n){n.a(t,async function(t,i){try{n.d(e,{d:function(){return l},n:function(){return c}});var o=n(72487),a=n(30162),r=t([o,a]);function l(t,e,n){return"month"===t?{formatter:t=>{const i=new Date(t);return 0===i.getMonth()?`{bold|${(0,o.fr)(i,e,n)}}`:(0,o.Wq)(i,e,n)}}:"year"===t?{formatter:t=>(0,o.Pm)(new Date(t),e,n)}:void 0}function c(t,e,n,i){const r=i/60/24,s=new Date(t);if(r>88)return 0===s.getMonth()?`{bold|${(0,o.fr)(s,e,n)}}`:(0,o.Wq)(s,e,n);if(r>35)return 1===s.getDate()?`{bold|${(0,o.sl)(s,e,n)}}`:(0,o.sl)(s,e,n);if(r>7){const t=(0,o.sl)(s,e,n);return 1===s.getDate()?`{bold|${t}}`:t}return r>2?(0,o.gu)(s,e,n):i&&i<5?(0,a.ie)(s,e,n):0===s.getHours()&&0===s.getMinutes()&&0===s.getSeconds()?`{bold|${(0,o.sl)(s,e,n)}}`:(0,a.fU)(s,e,n)}[o,a]=r.then?(await r)():r,i()}catch(s){i(s)}})},34218:function(t,e,n){n.d(e,{P:function(){return i}});n(44114),n(72712),n(18111),n(18237),n(45367),n(92731),n(62953);function i(t,e,n,i,a=!1){if(!t)return[];if(t.length<=e)return t;const r=null!=n?n:o(t[0])[0],s=null!=i?i:o(t[t.length-1])[0],l=Math.ceil((s-r)/Math.floor(e)),c=new Map;for(const u of t){const t=o(u);if(!Array.isArray(t))continue;const e=Number(t[0]),n=Number(t[1]);if(isNaN(e)||isNaN(n))continue;const i=Math.floor((e-r)/l),a=c.get(i);a?a.push({point:u,x:e,y:n}):c.set(i,[{point:u,x:e,y:n}])}const d=[];if(a)for(const[u,h]of c){const t=h.reduce((t,e)=>t+e.y,0)/h.length,e=h.reduce((t,e)=>t+e.x,0)/h.length,n=o(h[0].point),i=Array.isArray(n)?[e,t]:{value:[e,t]};d.push(i)}else for(const[o,u]of c){let t=u[0],e=u[0];for(const n of u)n.y<t.y&&(t=n),n.y>e.y&&(e=n);t.x>e.x&&d.push(e.point),d.push(t.point),t.x<e.x&&d.push(e.point)}return d}function o(t){return t&&"object"==typeof t&&"value"in t?t.value:t}},33062:function(t,e,n){n(62953);var i=n(40445),o=n(5124),a=n(67576);let r;class s extends o.WF{willUpdate(t){t.has("color")&&(this.style.backgroundColor=this.color)}render(){return o.s6}constructor(...t){super(...t),this.color="",this.rtl=!1}}s.styles=(0,o.AH)(r||(r=(t=>t)`:host{display:inline-block;margin-inline-end:4px;margin-inline-start:initial;border-radius:10px;width:10px;height:10px;vertical-align:middle}:host([rtl]){direction:rtl}`)),(0,i.Cg)([(0,a.MZ)()],s.prototype,"color",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,reflect:!0})],s.prototype,"rtl",void 0),s=(0,i.Cg)([(0,a.EM)("ha-chart-tooltip-marker")],s)},86760:function(t,e,n){n.a(t,async function(t,e){try{n(44114),n(72712),n(18111),n(61701),n(18237),n(3362),n(62953);var i=n(40445),o=n(5124),a=n(67576),r=n(22786),s=n(90433),l=n(44439),c=(n(33062),t([l]));l=(c.then?(await c)():c)[0];let d,u,h,p,m=t=>t;class g extends o.WF{render(){if(!p||!this.data)return o.s6;const t={tooltip:{trigger:"item",formatter:this._renderTooltip,appendTo:document.body}};return(0,o.qy)(d||(d=m`<ha-chart-base .data="${0}" .options="${0}" height="100%" .extraComponents="${0}"></ha-chart-base>`),this._createData(this.data),t,[p])}_getMaxDepth(t,e=0){return t.children&&0!==t.children.length?Math.max(...t.children.map(t=>this._getMaxDepth(t,e+1))):e}_generateLevels(t){const e=[];if(e.push({r0:"0%",r:"15%",itemStyle:{color:"transparent"}}),0===t)return e;const n=Array.from({length:t},(e,n)=>t-n),i=n.reduce((t,e)=>t+e,0);let o=15;for(let a=0;a<t;a++){const t=o,r=o+n[a]/i*80;o=r,e.push(Object.assign({r0:`${t}%`,r:`${r}%`},0===a?{label:{show:!0}}:{}))}return e}constructor(){super(),this._renderTooltip=t=>{var e;const n=t.data,i=this.valueFormatter?this.valueFormatter(n.value):n.value;return(0,o.qy)(u||(u=m`<ha-chart-tooltip-marker .color="${0}"></ha-chart-tooltip-marker> ${0}<br>${0}`),String(null!==(e=t.color)&&void 0!==e?e:""),n.name,i)},this._createData=(0,r.A)(t=>{const e=getComputedStyle(this),n=(t,i,o,a)=>{var r;const l=Object.assign(Object.assign({},t),{},{name:t.name||t.id});return o>0&&(null===(r=t.itemStyle)||void 0===r||!r.color)&&(l.itemStyle={color:null!=a?a:(0,s.fI)(i,e)}),t.children&&t.children.length>0&&(l.children=t.children.map((t,e)=>{var i;return n(t,e,o+1,null===(i=l.itemStyle)||void 0===i?void 0:i.color)})),l},i=n(t,0,0);return{type:"sunburst",data:i.children||[i],radius:[0,"90%"],sort:void 0,label:{show:!1,align:"center",rotate:"radial",minAngle:15,hideOverlap:!0},emphasis:{focus:"ancestor",label:{show:!1}},itemStyle:{borderRadius:2},levels:this._generateLevels(this._getMaxDepth(t))}}),p||Promise.all([n.e(37552),n.e(77072),n.e(34686)]).then(n.bind(n,60686)).then(t=>{p=t,this.requestUpdate()})}}g.styles=(0,o.AH)(h||(h=m`:host{display:block;flex:1}ha-chart-base{width:100%;height:100%}`)),(0,i.Cg)([(0,a.MZ)({attribute:!1})],g.prototype,"data",void 0),(0,i.Cg)([(0,a.MZ)({attribute:!1})],g.prototype,"valueFormatter",void 0),g=(0,i.Cg)([(0,a.EM)("ha-sunburst-chart")],g),e()}catch(d){e(d)}})},34296:function(t,e,n){n(62953);var i=n(40445),o=n(96229),a=n(26069),r=n(91735),s=n(42034),l=n(5124),c=n(67576);let d,u,h,p,m=t=>t;class g extends o.k{renderOutline(){return this.filled?(0,l.qy)(d||(d=m`<span class="filled"></span>`)):super.renderOutline()}getContainerClasses(){return Object.assign(Object.assign({},super.getContainerClasses()),{},{active:this.active})}renderPrimaryContent(){return(0,l.qy)(u||(u=m` <span class="leading icon" aria-hidden="true"> ${0} </span> <span class="label">${0}</span> <span class="touch"></span> <span class="trailing leading icon" aria-hidden="true"> ${0} </span> `),this.renderLeadingIcon(),this.label,this.renderTrailingIcon())}renderTrailingIcon(){return(0,l.qy)(h||(h=m`<slot name="trailing-icon"></slot>`))}constructor(...t){super(...t),this.filled=!1,this.active=!1}}g.styles=[r.R,s.R,a.R,(0,l.AH)(p||(p=m`:host{--md-sys-color-primary:var(--primary-text-color);--md-sys-color-on-surface:var(--primary-text-color);--md-assist-chip-container-shape:var( --ha-assist-chip-container-shape, 16px );--md-assist-chip-outline-color:var(--outline-color);--md-assist-chip-label-text-weight:400}.filled{display:flex;pointer-events:none;border-radius:inherit;inset:0;position:absolute;background-color:var(--ha-assist-chip-filled-container-color)}::slotted([slot=icon]),::slotted([slot=trailing-icon]){display:flex;--mdc-icon-size:var(--md-input-chip-icon-size, 18px);font-size:var(--_label-text-size)!important}.trailing.icon ::slotted(*),.trailing.icon svg{margin-inline-end:unset;margin-inline-start:var(--_icon-label-space)}::before{background:var(--ha-assist-chip-container-color,transparent);opacity:var(--ha-assist-chip-container-opacity, 1)}:where(.active)::before{background:var(--ha-assist-chip-active-container-color);opacity:var(--ha-assist-chip-active-container-opacity)}.label{font-family:var(--ha-font-family-body)}`))],(0,i.Cg)([(0,c.MZ)({type:Boolean,reflect:!0})],g.prototype,"filled",void 0),(0,i.Cg)([(0,c.MZ)({type:Boolean})],g.prototype,"active",void 0),g=(0,i.Cg)([(0,c.EM)("ha-assist-chip")],g)},38962:function(t,e,n){n.a(t,async function(t,i){try{n.r(e);n(62953);var o=n(40445),a=n(5124),r=n(67576),s=n(6412),l=n(93421),c=n(1087),d=n(26300),u=(n(67094),t([d]));d=(u.then?(await u)():u)[0];let h,p,m,g,f=t=>t;const y="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",v={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class _ extends a.WF{render(){var t;return(0,a.qy)(h||(h=f` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,s.H)({[this.alertType]:!0}),this.title?"":"no-title",v[this.alertType],(0,s.H)({content:!0,narrow:this.narrow}),this.title?(0,a.qy)(p||(p=f`<div class="title">${0}</div>`),this.title):a.s6,this.dismissable?(0,a.qy)(m||(m=f`<ha-icon-button @click="${0}" .label="${0}" .path="${0}"></ha-icon-button>`),this._dismissClicked,null===(t=this._localize)||void 0===t?void 0:t.call(this,"ui.common.dismiss_alert"),y):a.s6)}_dismissClicked(){(0,c.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}_.styles=(0,a.AH)(g||(g=f`.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,o.Cg)([(0,r.MZ)()],_.prototype,"title",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"alert-type"})],_.prototype,"alertType",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],_.prototype,"dismissable",void 0),(0,o.Cg)([(0,r.wk)(),(0,l.IW)()],_.prototype,"_localize",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],_.prototype,"narrow",void 0),_=(0,o.Cg)([(0,r.EM)("ha-alert")],_),i()}catch(h){i(h)}})},43661:function(t,e,n){n.r(e),n.d(e,{HaIconNext:function(){return s}});n(62953);var i=n(40445),o=n(67576),a=n(63091),r=n(67094);class s extends r.HaSvgIcon{constructor(...t){super(...t),this.path="rtl"===a.G.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}}(0,i.Cg)([(0,o.MZ)()],s.prototype,"path",void 0),s=(0,i.Cg)([(0,o.EM)("ha-icon-next")],s)},28732:function(t,e,n){var i=n(40445),o=n(27686),a=n(7731),r=n(5124),s=n(67576);let l,c,d,u=t=>t;class h extends o.J{renderRipple(){return this.noninteractive?"":super.renderRipple()}static get styles(){return[a.R,(0,r.AH)(l||(l=u`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`)),"rtl"===document.dir?(0,r.AH)(c||(c=u`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`)):(0,r.AH)(d||(d=u``))]}}h=(0,i.Cg)([(0,s.EM)("ha-list-item")],h)},8630:function(t,e,n){var i=n(40445),o=n(68618),a=n(11081),r=n(67576);class s extends o.iY{}s.styles=a.R,s=(0,i.Cg)([(0,r.EM)("ha-list")],s)},96832:function(t,e,n){n.a(t,async function(t,e){try{n(89463),n(74423),n(72712),n(18111),n(61701),n(18237),n(62953);var i=n(40445),o=n(5124),a=n(67576),r=n(6412),s=n(89784),l=n(1087),c=n(34127),d=t([c]);c=(d.then?(await d)():d)[0];let u,h,p,m,g,f,y,v=t=>t;class _ extends o.WF{render(){const t=this.segments.reduce((t,e,n)=>{var i;return null!==(i=this.hiddenSegments)&&void 0!==i&&i.includes(n)?t:t+e.value},0);return(0,o.qy)(u||(u=v` <div class="container"> ${0} <div class="bar"> ${0} </div> ${0} </div> `),this.heading||this.description?(0,o.qy)(h||(h=v` <div class="heading"> <div class="title"> <span>${0}</span> <span>${0}</span> </div> <slot name="extra"></slot> </div> `),this.heading,this.description):o.s6,this.segments.map((e,n)=>{var i;return(0,o.qy)(p||(p=v` ${0} <div id="segment-${0}" class="${0}" data-index="${0}" @click="${0}" style="${0}"></div> `),this.hideTooltip||!e.label?o.s6:(0,o.qy)(m||(m=v` <ha-tooltip for="segment-${0}" placement="top"> ${0} (${0}%) </ha-tooltip> `),n,e.label,(e.value/t*100).toFixed(1)),n,(0,r.H)({clickable:this.barClickable}),n,this.barClickable?this._handleSegmentClick:o.s6,(0,s.W)({width:e.value/t*100+"%",backgroundColor:e.color,display:null!==(i=this.hiddenSegments)&&void 0!==i&&i.includes(n)?"none":"block"}))}),this.hideLegend?o.s6:(0,o.qy)(g||(g=v` <ul class="legend"> ${0} </ul> `),this.segments.map((t,e)=>{var n;return t.label?(0,o.qy)(f||(f=v` <li class="${0}" data-index="${0}" @click="${0}"> <div class="bullet" style="${0}"></div> <span class="label">${0}</span> </li> `),(0,r.H)({clickable:this.clickable,hidden:null===(n=this.hiddenSegments)||void 0===n?void 0:n.includes(e)}),e,this.clickable?this._handleLegendClick:o.s6,(0,s.W)({backgroundColor:t.color}),t.label):o.s6})))}_handleSegmentClick(t){const e=t.currentTarget,n=Number(e.dataset.index),i=this.segments[n];i&&(0,l.r)(this,"segment-clicked",{index:n,segment:i})}_handleLegendClick(t){const e=t.currentTarget,n=Number(e.dataset.index),i=this.segments[n];i&&(0,l.r)(this,"legend-item-clicked",{index:n,segment:i})}constructor(...t){super(...t),this.hideLegend=!1,this.hideTooltip=!1,this.clickable=!1,this.barClickable=!1}}_.styles=(0,o.AH)(y||(y=v`.container{width:100%}.heading{display:flex;flex-direction:row;gap:var(--ha-space-2)}.heading .title{flex:1}.heading .title span{color:var(--secondary-text-color);line-height:var(--ha-line-height-expanded);margin-right:8px}.heading .title span:first-child{color:var(--primary-text-color)}.bar{display:flex;overflow:hidden;border-radius:var(--ha-bar-border-radius,var(--ha-border-radius-sm));width:100%;height:12px;margin:2px 0;background-color:var(--ha-bar-background-color,var(--secondary-background-color))}.bar div{height:100%}.bar div.clickable{cursor:pointer}.bar div.clickable:hover{opacity:.8}.legend{display:flex;flex-direction:row;flex-wrap:wrap;gap:var(--ha-space-3);margin:12px 0;padding:0;list-style:none}.legend li{display:flex;align-items:center;gap:var(--ha-space-1);font-size:var(--ha-font-size-s)}.legend li .bullet{width:12px;height:12px;border-radius:var(--ha-border-radius-circle)}.spacer{flex:1}.legend li.clickable{cursor:pointer}.legend li.clickable:hover{opacity:.8}.legend li.hidden{opacity:.5}.legend li.hidden .label{text-decoration:line-through}`)),(0,i.Cg)([(0,a.MZ)({attribute:!1})],_.prototype,"segments",void 0),(0,i.Cg)([(0,a.MZ)({type:String})],_.prototype,"heading",void 0),(0,i.Cg)([(0,a.MZ)({type:String})],_.prototype,"description",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,attribute:"hide-legend"})],_.prototype,"hideLegend",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,attribute:"hide-tooltip"})],_.prototype,"hideTooltip",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean})],_.prototype,"clickable",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,attribute:"bar-clickable"})],_.prototype,"barClickable",void 0),(0,i.Cg)([(0,a.MZ)({attribute:!1})],_.prototype,"hiddenSegments",void 0),_=(0,i.Cg)([(0,a.EM)("ha-segmented-bar")],_),e()}catch(u){e(u)}})},47351:function(t,e,n){n.d(e,{PS:function(){return i},Tv:function(){return r},VR:function(){return o},lE:function(){return s}});n(74423),n(3362),n(17642),n(58004),n(33853),n(45876),n(32475),n(15024),n(31698),n(62953);const i=t=>t.data,o=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,a=new Set([502,503,504]),r=t=>!!(t&&t.status_code&&a.has(t.status_code))||!(!t||!t.message||!t.message.includes("ERR_CONNECTION_CLOSED")&&!t.message.includes("ERR_CONNECTION_RESET")),s=async(t,e)=>t({type:"supervisor/api",endpoint:`/${e}/stats`,method:"get"})},15336:function(t,e,n){n.d(e,{He:function(){return c},Ku:function(){return a},PB:function(){return r},Wq:function(){return h},hu:function(){return l},mZ:function(){return s},v9:function(){return d},xY:function(){return u}});n(3362);var i=n(62384),o=n(47351);const a=async t=>{if((0,i.v)(t.config.version,2021,2,4))return t.callWS({type:"supervisor/api",endpoint:"/host/info",method:"get"});const e=await t.callApi("GET","hassio/host/info");return(0,o.PS)(e)},r=async t=>(0,i.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/os/info",method:"get"}):(0,o.PS)(await t.callApi("GET","hassio/os/info")),s=async t=>(0,i.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/host/reboot",method:"post",timeout:null}):t.callApi("POST","hassio/host/reboot"),l=async t=>(0,i.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/host/shutdown",method:"post",timeout:null}):t.callApi("POST","hassio/host/shutdown"),c=async(t,e)=>(0,i.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/host/options",method:"post",data:e}):t.callApi("POST","hassio/host/options",e),d=async(t,e)=>(0,i.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/os/datadisk/move",method:"post",timeout:null,data:{device:e}}):t.callApi("POST","hassio/os/datadisk/move"),u=async t=>(0,i.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/os/datadisk/list",method:"get",timeout:null}):(0,o.PS)(await t.callApi("GET","/os/datadisk/list")),h=async t=>(0,i.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:"/host/disks/default/usage",method:"get",timeout:3600,params:{max_depth:3}}):(0,o.PS)(await t.callApi("GET","hassio/host/disks/default/usage"))},96273:function(t,e,n){n.d(e,{Bt:function(){return l},Qf:function(){return s},Su:function(){return u},Wu:function(){return i},bK:function(){return r},dd:function(){return d},f3:function(){return a},h1:function(){return o},wZ:function(){return c}});n(3362);var i=function(t){return t.BIND="bind",t.CIFS="cifs",t.NFS="nfs",t}({}),o=function(t){return t.BACKUP="backup",t.MEDIA="media",t.SHARE="share",t}({}),a=function(t){return t.ACTIVE="active",t.FAILED="failed",t.UNKNOWN="unknown",t}({});const r=async t=>t.callWS({type:"supervisor/api",endpoint:"/mounts",method:"get",timeout:null}),s=async(t,e)=>t.callWS({type:"supervisor/api",endpoint:"/mounts",method:"post",timeout:null,data:e}),l=async(t,e)=>t.callWS({type:"supervisor/api",endpoint:`/mounts/${e.name}`,method:"put",timeout:null,data:e}),c=async(t,e)=>t.callWS({type:"supervisor/api",endpoint:`/mounts/${e}`,method:"delete",timeout:null}),d=async(t,e)=>t.callWS({type:"supervisor/api",endpoint:`/mounts/${e.name}/reload`,method:"post",timeout:null}),u=async(t,e)=>t.callWS({type:"supervisor/api",endpoint:"/mounts/options",method:"post",timeout:null,data:e})},94406:function(t,e,n){n.a(t,async function(t,i){try{n.r(e);n(74423),n(18111),n(22489),n(61701),n(3362),n(62953);var o=n(40445),a=n(5124),r=n(67576),s=n(36312),l=n(91926),c=n(67258),d=n(38962),u=n(18350),h=n(26300),p=(n(43661),n(8630),n(28732),n(96832)),m=(n(67094),n(47351)),g=n(15336),f=n(96273),y=n(65063),v=n(81310),_=n(13133),b=n(26008),w=n(99012),x=n(83870),$=t([d,u,h,p,v,_,x]);[d,u,h,p,v,_,x]=$.then?(await $)():$;let C,k,M,A,I,z,T,H,S,L,Z,V,D,q,j=t=>t;const B="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",E="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",N="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",F="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",P="M19 3H5C3.89 3 3 3.89 3 5V19C3 20.1 3.9 21 5 21H19C20.1 21 21 20.1 21 19V5C21 3.89 20.1 3 19 3M10 16V8L15 12",W="M2 12C2 16.97 6.03 21 11 21C13.39 21 15.68 20.06 17.4 18.4L15.9 16.9C14.63 18.25 12.86 19 11 19C4.76 19 1.64 11.46 6.05 7.05C10.46 2.64 18 5.77 18 12H15L19 16H19.1L23 12H20C20 7.03 15.97 3 11 3C6.03 3 2 7.03 2 12Z";class O extends a.WF{firstUpdated(t){super.firstUpdated(t),(0,s.x)(this.hass.config,"hassio")&&this._load()}render(){var t,e;if(void 0===this._mountsInfo)return a.s6;const n=null===(t=this._mountsInfo)||void 0===t?void 0:t.mounts.filter(t=>[f.Wu.CIFS,f.Wu.NFS].includes(t.type)),i=null===(e=this._hostInfo)||void 0===e?void 0:e.features.includes("haos");return(0,a.qy)(C||(C=j` <hass-subpage back-path="/config/system" .hass="${0}" .narrow="${0}" .header="${0}"> <div class="content"> ${0} ${0} <ha-card outlined .header="${0}"> ${0} ${0} </ha-card> </div> </hass-subpage> `),this.hass,this.narrow,this.hass.localize("ui.panel.config.storage.caption"),this._error?(0,a.qy)(k||(k=j` <ha-alert alert-type="error">${0}</ha-alert> `),this._error.message||this._error.code):"",this._hostInfo?(0,a.qy)(M||(M=j` <ha-card outlined .header="${0}"> <div class="card-content"> <storage-breakdown-chart .hass="${0}" .hostInfo="${0}" .storageInfo="${0}"></storage-breakdown-chart> ${0} </div> ${0} </ha-card> `),this.hass.localize("ui.panel.config.storage.disk_metrics"),this.hass,this._hostInfo,this._storageInfo,this._renderDiskLifeTime(this._hostInfo.disk_life_time),this._hostInfo?(0,a.qy)(A||(A=j`<div class="card-actions"> <ha-button appearance="plain" @click="${0}"> ${0} </ha-button> </div>`),this._moveDatadisk,this.hass.localize("ui.panel.config.storage.datadisk.title")):a.s6):"",this.hass.localize("ui.panel.config.storage.network_mounts.title"),null===this._mountsInfo?(0,a.qy)(I||(I=j`<ha-alert class="mounts-not-supported" alert-type="warning" .title="${0}"> ${0} </ha-alert>`),this.hass.localize("ui.panel.config.storage.network_mounts.not_supported.title"),i?(0,a.qy)(z||(z=j`${0} <ha-button appearance="plain" slot="action" @click="${0}"> ${0} </ha-button>`),this.hass.localize("ui.panel.config.storage.network_mounts.not_supported.os",{version:"10.2"}),this._navigateToUpdates,this.hass.localize("ui.panel.config.storage.network_mounts.not_supported.navigate_to_updates")):this.hass.localize("ui.panel.config.storage.network_mounts.not_supported.supervised")):null!=n&&n.length?(0,a.qy)(T||(T=j`<ha-list> ${0} </ha-list>`),n.map(t=>(0,a.qy)(H||(H=j` <ha-list-item graphic="avatar" .mount="${0}" twoline hasMeta @click="${0}"> <div slot="graphic"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div> <span class="mount-state-${0}"> ${0} </span> <span slot="secondary"> ${0}${0}${0} </span> ${0} </ha-list-item> `),t,this._changeMount,t.usage===f.h1.MEDIA?P:t.usage===f.h1.SHARE?E:B,t.state||"unknown",t.name,t.server,t.port?`:${t.port}`:a.s6,t.type===f.Wu.NFS?t.path:`:${t.share}`,t.state!==f.f3.ACTIVE?(0,a.qy)(S||(S=j`<ha-icon-button class="reload-btn" slot="meta" .mount="${0}" @click="${0}" .path="${0}"></ha-icon-button>`),t,this._reloadMount,W):(0,a.qy)(L||(L=j`<ha-icon-next slot="meta"></ha-icon-next>`))))):(0,a.qy)(Z||(Z=j`<div class="no-mounts"> <ha-svg-icon .path="${0}"></ha-svg-icon> <p> ${0} </p> </div>`),F,this.hass.localize("ui.panel.config.storage.network_mounts.no_mounts")),null!==this._mountsInfo?(0,a.qy)(V||(V=j`<div class="card-actions"> <ha-button appearance="plain" @click="${0}"> ${0} </ha-button> </div>`),this._addMount,this.hass.localize("ui.panel.config.storage.network_mounts.add_title")):a.s6)}_renderDiskLifeTime(t){if(null===t)return a.s6;const e=[{color:"var(--primary-color)",value:t},{color:"var(--ha-bar-background-color, var(--secondary-background-color))",value:100-t}];return(0,a.qy)(D||(D=j` <ha-segmented-bar .heading="${0}" .description="${0}" .segments="${0}" hide-legend hide-tooltip> <ha-tooltip slot="extra"> <ha-icon-button .path="${0}" class="help-button"></ha-icon-button> <p class="metric-description" slot="content"> ${0} </p> </ha-tooltip> </ha-segmented-bar> `),this.hass.localize("ui.panel.config.storage.lifetime"),this.hass.localize("ui.panel.config.storage.lifetime_description",{lifetime:`${t}${(0,c.d)(this.hass.locale)}%`}),e,N,this.hass.localize("ui.panel.config.storage.lifetime_used_description"))}async _load(){var t;this._loadStorageInfo();try{this._hostInfo=await(0,g.Ku)(this.hass)}catch(e){this._error=e.message||e}null!==(t=this._hostInfo)&&void 0!==t&&t.features.includes("mount")?await this._reloadMounts():this._mountsInfo=null}async _loadStorageInfo(){try{this._storageInfo=await(0,g.Wq)(this.hass)}catch(t){this._error=t.message||t,this._storageInfo=null}}_moveDatadisk(){(0,b.E)(this,{hostInfo:this._hostInfo})}async _navigateToUpdates(){(0,l.oo)("/config/updates")}async _reloadMount(t){t.stopPropagation();const e=t.currentTarget.mount;try{await(0,f.dd)(this.hass,e)}catch(n){return void(0,y.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.storage.network_mounts.errors.reload",{mount:e.name}),text:(0,m.VR)(n)})}await this._reloadMounts()}_addMount(){(0,w.O)(this,{reloadMounts:()=>this._reloadMounts()})}_changeMount(t){t.stopPropagation(),(0,w.O)(this,{mount:t.currentTarget.mount,reloadMounts:()=>this._reloadMounts()})}async _reloadMounts(){try{this._mountsInfo=await(0,f.bK)(this.hass)}catch(t){this._error=t.message||t,this._mountsInfo=null}}constructor(...t){super(...t),this.narrow=!1}}O.styles=(0,a.AH)(q||(q=j`.content{padding:28px 20px 0;max-width:1040px;margin:0 auto}.card-actions{display:flex;justify-content:flex-end}ha-card{max-width:600px;margin:0 auto 12px;justify-content:space-between;flex-direction:column;display:flex}.card-content{display:flex;justify-content:space-between;flex-direction:column}.loading-container{position:relative}.loading-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(var(--rgb-card-background-color),.75);display:flex;justify-content:center;align-items:center}.mount-state-failed{color:var(--error-color)}.mount-state-unknown{color:var(--warning-color)}.mounts-not-supported{padding:0 16px 16px}.reload-btn{float:right;position:relative;top:-10px;right:10px;inset-inline-end:10px;inset-inline-start:initial}.help-button{--ha-icon-button-size:20px;--mdc-icon-size:20px;color:var(--secondary-text-color)}.no-mounts{display:flex;flex-direction:column;align-items:center;text-align:center}.no-mounts ha-svg-icon{background-color:var(--light-primary-color);color:var(--secondary-text-color);padding:16px;border-radius:var(--ha-border-radius-circle);margin-bottom:8px}ha-list-item{--mdc-list-item-meta-size:auto;--mdc-list-item-meta-display:flex}ha-icon-next,ha-svg-icon{width:24px}ha-alert{--ha-alert-icon-size:24px}`)),(0,o.Cg)([(0,r.MZ)({attribute:!1})],O.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],O.prototype,"route",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],O.prototype,"narrow",void 0),(0,o.Cg)([(0,r.wk)()],O.prototype,"_error",void 0),(0,o.Cg)([(0,r.wk)()],O.prototype,"_hostInfo",void 0),(0,o.Cg)([(0,r.wk)()],O.prototype,"_storageInfo",void 0),(0,o.Cg)([(0,r.wk)()],O.prototype,"_mountsInfo",void 0),O=(0,o.Cg)([(0,r.EM)("ha-config-section-storage")],O),i()}catch(C){i(C)}})},26008:function(t,e,n){n.d(e,{E:function(){return o}});n(3362),n(62953);var i=n(1087);const o=(t,e)=>{(0,i.r)(t,"show-dialog",{dialogTag:"dialog-move-datadisk",dialogImport:()=>Promise.all([n.e(34995),n.e(82201),n.e(3383)]).then(n.bind(n,12810)),dialogParams:e})}},99012:function(t,e,n){n.d(e,{O:function(){return o}});n(3362),n(62953);var i=n(1087);const o=(t,e)=>{(0,i.r)(t,"show-dialog",{dialogTag:"dialog-mount-view",dialogImport:()=>Promise.all([n.e(53480),n.e(11009)]).then(n.bind(n,67642)),dialogParams:e})}},83870:function(t,e,n){n.a(t,async function(t,e){try{n(44114),n(18111),n(7588),n(61701),n(62953);var i=n(40445),o=n(5124),a=n(67576),r=n(22786),s=n(90433),l=n(86760),c=n(38962),d=n(26300),u=n(96832),h=n(65829),p=n(36240),m=t([l,c,d,u,h]);[l,c,d,u,h]=m.then?(await m)():m;let g,f,y,v,_,b,w,x,$=t=>t;const C="M13,2.05C18.05,2.55 22,6.82 22,12C22,13.45 21.68,14.83 21.12,16.07L18.5,14.54C18.82,13.75 19,12.9 19,12C19,8.47 16.39,5.57 13,5.08V2.05M12,19C14.21,19 16.17,18 17.45,16.38L20.05,17.91C18.23,20.39 15.3,22 12,22C6.47,22 2,17.5 2,12C2,6.81 5.94,2.55 11,2.05V5.08C7.61,5.57 5,8.47 5,12A7,7 0 0,0 12,19M12,6A6,6 0 0,1 18,12C18,14.97 15.84,17.44 13,17.92V14.83C14.17,14.42 15,13.31 15,12A3,3 0 0,0 12,9L11.45,9.05L9.91,6.38C10.56,6.13 11.26,6 12,6M6,12C6,10.14 6.85,8.5 8.18,7.38L9.72,10.05C9.27,10.57 9,11.26 9,12C9,13.31 9.83,14.42 11,14.83V17.92C8.16,17.44 6,14.97 6,12Z",k="M8,18H17V5H8M18,5V18H21V5M4,18H7V5H4V18Z";class M extends o.WF{render(){var t;if(!this.hostInfo)return o.s6;const{totalSpaceGB:e,usedSpaceGB:n,freeSpaceGB:i}=this._computeSpaceValues(this.hostInfo,this.storageInfo),a=Boolean(null===(t=this.storageInfo)||void 0===t||null===(t=t.children)||void 0===t?void 0:t.length),r=this.hass.localize("ui.panel.config.storage.used_space"),s=this.hass.localize("ui.panel.config.storage.detailed_description",{used:`${(0,p.gN)(n)} GB`,total:`${(0,p.gN)(e)} GB`}),l="bar"===this._chartType||!a;return(0,o.qy)(g||(g=$` <div class="header"> <div class="heading-text"> <span class="heading">${0}</span> <span class="description">${0}</span> </div> <ha-icon-button .path="${0}" .label="${0}" .disabled="${0}" @click="${0}"></ha-icon-button> </div> <div class="chart-container ${0}"> ${0} </div> ${0} `),r,s,"sunburst"===this._chartType?k:C,this.hass.localize("ui.panel.config.storage.change_chart_type"),!a,this._handleChartTypeChange,this._chartType,l?(0,o.qy)(f||(f=$`<ha-segmented-bar .heading="${0}" .segments="${0}"></ha-segmented-bar>`),"",this._computeSegments(this.storageInfo,n,i)):(0,o.qy)(y||(y=$`<ha-sunburst-chart .hass="${0}" .data="${0}" .valueFormatter="${0}"></ha-sunburst-chart>`),this.hass,this._transformToSunburstData(this.storageInfo),this._formatBytes),this.storageInfo&&null!==this.storageInfo?o.s6:(0,o.qy)(v||(v=$`<ha-alert alert-type="info"> <ha-spinner slot="icon"></ha-spinner> ${0}</ha-alert>`),this.hass.localize("ui.panel.config.storage.loading_detailed")))}_handleChartTypeChange(){this._chartType="bar"===this._chartType?"sunburst":"bar"}_bytesToGB(t){return t/1024/1024/1024}_gbToBytes(t){return 1024*t*1024*1024}constructor(...t){super(...t),this._chartType="bar",this._computeSpaceValues=(0,r.A)((t,e)=>{let n=t.disk_total,i=t.disk_free||t.disk_total-t.disk_used,o=n-i;if(e){var a;const r=null!==(a=e.total_bytes)&&void 0!==a?a:this._gbToBytes(t.disk_total);n=this._bytesToGB(r),o=this._bytesToGB(e.used_bytes),i=this._bytesToGB(r-e.used_bytes)}return{totalSpaceGB:n,usedSpaceGB:o,freeSpaceGB:i}}),this._computeSegments=(0,r.A)((t,e,n)=>{const i=getComputedStyle(this),a=[];var r;t?null===(r=t.children)||void 0===r||r.forEach((t,e)=>{if(t.used_bytes>0){const n=this._bytesToGB(t.used_bytes);a.push({value:n,color:(0,s.fI)(e,i),label:(0,o.qy)(_||(_=$`${0} <span style="color:var(--secondary-text-color)">${0} GB</span>`),this.hass.localize(`ui.panel.config.storage.segments.${t.id}`)||t.label||t.id,(0,p.gN)(n))})}}):a.push({value:e,color:"var(--primary-color)",label:(0,o.qy)(b||(b=$`${0} <span style="color:var(--secondary-text-color)">${0} GB</span>`),this.hass.localize("ui.panel.config.storage.segments.used"),(0,p.gN)(e))});return a.push({value:n,color:"var(--ha-bar-background-color, var(--secondary-background-color))",label:(0,o.qy)(w||(w=$`${0} <span style="color:var(--secondary-text-color)">${0} GB</span>`),this.hass.localize("ui.panel.config.storage.segments.free"),(0,p.gN)(n))}),a}),this._transformToSunburstData=(0,r.A)(t=>{const e=(t,n)=>{var i;return{id:n?`${n.id}.${t.id}`:t.id,name:this._formatLabel(t.id)||t.label,value:t.used_bytes,children:null===(i=t.children)||void 0===i?void 0:i.map(n=>e(n,t))}};return e(t)}),this._formatBytes=t=>{const e=this._bytesToGB(t);return`${(0,p.gN)(e)} GB`},this._formatLabel=t=>this.hass.localize(`ui.panel.config.storage.segments.${t}`)||t}}M.styles=(0,o.AH)(x||(x=$`.header{display:flex;align-items:flex-end;gap:var(--ha-space-2)}.heading-text{display:flex;flex:1}.heading{color:var(--primary-text-color);line-height:var(--ha-line-height-expanded);margin-right:var(--ha-space-2)}.description{color:var(--secondary-text-color);line-height:var(--ha-line-height-expanded)}ha-icon-button{--ha-icon-button-size:36px;--mdc-icon-size:20px;color:var(--secondary-text-color)}.chart-container{transition:height var(--ha-animation-duration-slow) ease;overflow:hidden}.chart-container.bar{height:calc-size(auto,size)}.chart-container.sunburst{height:400px}ha-segmented-bar{display:block}ha-sunburst-chart{height:400px}ha-segmented-bar,ha-sunburst-chart{animation:fade-in var(--ha-animation-duration-slow) ease}@keyframes fade-in{from{opacity:0}to{opacity:1}}ha-alert{--ha-alert-icon-size:24px}ha-alert ha-spinner{--ha-spinner-size:24px}`)),(0,i.Cg)([(0,a.MZ)({attribute:!1})],M.prototype,"hass",void 0),(0,i.Cg)([(0,a.MZ)({attribute:!1})],M.prototype,"hostInfo",void 0),(0,i.Cg)([(0,a.MZ)({attribute:!1})],M.prototype,"storageInfo",void 0),(0,i.Cg)([(0,a.wk)()],M.prototype,"_chartType",void 0),M=(0,i.Cg)([(0,a.EM)("storage-breakdown-chart")],M),e()}catch(g){e(g)}})},36240:function(t,e,n){n.d(e,{NN:function(){return o},S8:function(){return i},gN:function(){return a}});const i=(t,e,n)=>isNaN(t)||isNaN(e)||isNaN(n)?0:t>n?n:t<e?e:t,o=(t,e,n)=>100*(t-e)/(n-e),a=t=>Math.round(10*t)/10}}]);