1export const __rspack_esm_id=98992;export const __rspack_esm_ids=[98992];export const __webpack_modules__={63746(t,e,s){var a=s(90789),r=s(96917);function i(t,e){const s=t%54+1;return e.getPropertyValue(`--color-${s}`)}function o(t,e){const s=e.getPropertyValue(`--graph-color-${t+1}`)||i(t,e);return(0,r.RQ)(s)}const n=(0,a.A)(t=>Array.from({length:54},(e,s)=>o(s,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"));s.d(e,{Vy:()=>i,fI:()=>o},{ux:n})},56425(t,e,s){function a(t,e){const s=e-t;return!Number.isFinite(s)||s<=0?1:Math.max(0,Math.ceil(-Math.log10(s/10)))}s.d(e,{G:()=>a})},39559(t,e,s){s(74423),s(18111),s(13579);var a=s(15697),r=s(79224);s.d(e,{},{E: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,a.Cg)([(0,r.MZ)({attribute:!1})],e.prototype,"hass",void 0),e}})},60372(t,e,s){var a=s(96917),r=s(49395);function i(t,e,s,i,o,n){const c=t.getPropertyValue(o+"-"+n).trim(),h=c.length>0?c:t.getPropertyValue(o).trim();let d=(0,a.RQ)(h);return 0===c.length&&n&&(d=(0,a.v2)((0,a.BE)(e?(0,r.T)((0,a.Nc)((0,a.xp)(d)),n):(0,r.d)((0,a.Nc)((0,a.xp)(d)),n)))),i?d+=s?"32":"7F":s&&(d+="7F"),d}s.d(e,{g:()=>i})},59630(t,e,s){s.a(t,async function(t,e){try{var a=s(15697),r=s(57527),i=s(79224),o=s(70392),n=t([o]);o=(n.then?(await n)():n)[0];class c extends r.WF{render(){const t=`energy-graph-chip-${Date.now()}`;return r.qy` <div class="chip" id=${t}> <slot></slot> </div> <ha-tooltip for=${t} placement="top">${this.tooltip}</ha-tooltip> `}}c.styles=r.AH`.chip{font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-medium);padding:var(--ha-space-1) var(--ha-space-2);border-radius:var(--ha-border-radius-md);border:1px solid var(--divider-color)}`,(0,a.Cg)([(0,i.MZ)({type:String})],c.prototype,"tooltip",void 0),c=(0,a.Cg)([(0,i.EM)("hui-energy-graph-chip")],c),e()}catch(t){e(t)}})},2466(t,e,s){s.a(t,async function(t,a){try{s.r(e);s(44114),s(18111),s(22489),s(7588),s(18237);var r=s(15697),i=s(71127),o=s(66357),n=s(32070),c=s(57527),h=s(79224),d=s(97901),p=s(90789),l=s(60372),u=s(40550),_=s(56425),g=(s(75041),s(94465)),y=s(69851),f=s(39559),b=s(72441),m=s(357),v=s(92365),w=s(59630),k=s(70392),C=t([u,w,k,g,v,m]);[u,w,k,g,v,m]=C.then?(await C)():C;class x extends((0,f.E)(c.WF)){static async getConfigElement(){return await s.e(54843).then(s.bind(s,69878)),document.createElement("hui-energy-graph-card-editor")}static getStubConfig(t,e,s){return{type:"energy-water-graph"}}hassSubscribe(){return[(0,g.tb)(this.hass,{key:this._config?.collection_key}).subscribe(t=>this._getStatistics(t))]}getCardSize(){return 3}setConfig(t){t.collection_key&&(0,g.s8)(t.collection_key),this._config=t}shouldUpdate(t){return(0,b.xP)(this,t)||t.size>1||!t.has("hass")}render(){return this.hass&&this._config?c.qy` <ha-card> ${this._config.title?c.qy` <div class="card-header"> <span>${this._config.title?this._config.title:c.s6}</span> ${this._total?c.qy`<hui-energy-graph-chip .tooltip=${this._formatTotal(this._total)}> ${(0,v.ZV)(this._total,this.hass.locale)} ${this._unit} </hui-energy-graph-chip>`:c.s6} </div>`:c.s6} <div class="content ${(0,d.H)({"has-header":!!this._config.title})}"> <ha-chart-base .hass=${this.hass} .data=${this._chartData} .options=${this._createOptions(this._start,this._end,this.hass.locale,this.hass.config,this._unit,this._compareStart,this._compareEnd,this._yAxisFractionDigits)} chart-type="bar"></ha-chart-base> ${this._chartData.length?"":c.qy`<div class="no-data"> ${(0,i.c)(this._start)?this.hass.localize("ui.panel.lovelace.cards.energy.no_data"):this.hass.localize("ui.panel.lovelace.cards.energy.no_data_period")} </div>`} </div> </ha-card> `:c.s6}async _getStatistics(t){this._start=t.start,this._end=t.end||(0,o.o)(),this._compareStart=t.startCompare,this._compareEnd=t.endCompare;const e=t.prefs.energy_sources.filter(t=>"water"===t.type);this._unit=t.waterUnit;const s=[],a=getComputedStyle(this);let r=1/0,i=-1/0;const n=t=>{t<r&&(r=t),t>i&&(i=t)};if(t.statsCompare)s.push(...this._processDataSet(t.statsCompare,t.statsMetadata,e,a,n,!0));else{const t=e[0]?.stat_energy_from??"placeholder";s.push({id:"compare-"+t,type:"bar",stack:"water",data:[]})}s.push(...this._processDataSet(t.stats,t.statsMetadata,e,a,n)),(0,m.RR)(s),this._yAxisFractionDigits=(0,_.G)(r,i),this._chartData=s,this._total=this._processTotal(t.stats,e)}_processTotal(t,e){return e.reduce((e,s)=>e+(s.stat_energy_from in t?t[s.stat_energy_from].reduce((t,e)=>t+(e.change||0),0):0),0)}_processDataSet(t,e,s,a,r,i=!1){const o=[],n=(0,m.ok)(this._start,this._compareStart),c=(0,g.TI)(this._start,this._end);
1return s.forEach((s,h)=>{let d=null;const p=[];if(s.stat_energy_from in t){const e=t[s.stat_energy_from];for(const t of e){if(null===t.change||void 0===t.change||0===t.change)continue;if(d===t.start)continue;const e=[(0,m.IJ)(t.start,t.end,c,i?n:void 0),t.change,t.start];p.push(e),r(t.change),d=t.start}}o.push({type:"bar",cursor:"default",id:i?"compare-"+s.stat_energy_from:s.stat_energy_from,name:s.name||(0,y.$O)(this.hass,s.stat_energy_from,e[s.stat_energy_from]),barMaxWidth:50,itemStyle:{borderColor:(0,l.g)(a,this.hass.themes.darkMode,!1,i,"--energy-water-color",h)},color:(0,l.g)(a,this.hass.themes.darkMode,!0,i,"--energy-water-color",h),data:p,stack:i?"compare":"water"})}),o}constructor(...t){super(...t),this._chartData=[],this._yAxisFractionDigits=1,this._start=(0,n.R)(),this._end=(0,o.o)(),this.hassSubscribeRequiredHostProps=["_config"],this._formatTotal=t=>this.hass.localize("ui.panel.lovelace.cards.energy.energy_water_graph.total_consumed",{num:(0,v.ZV)(t,this.hass.locale),unit:this._unit}),this._createOptions=(0,p.A)((t,e,s,a,r,i,o,n)=>(0,m.od)(t,e,s,a,r,i,o,this._formatTotal,!1,n))}}x.styles=c.AH`ha-card{height:100%}.card-header{justify-content:space-between;align-items:center;padding-bottom:0;display:flex}.content{padding:16px}.has-header{padding-top:0}.no-data{margin-left:32px;height:100%;box-sizing:border-box;justify-content:center;align-items:center;margin-inline-start:32px;margin-inline-end:initial;padding:20%;display:flex;position:absolute;top:0;left:0;right:0}`,(0,r.Cg)([(0,h.MZ)({attribute:!1})],x.prototype,"hass",void 0),(0,r.Cg)([(0,h.wk)()],x.prototype,"_config",void 0),(0,r.Cg)([(0,h.wk)()],x.prototype,"_chartData",void 0),(0,r.Cg)([(0,h.wk)()],x.prototype,"_yAxisFractionDigits",void 0),(0,r.Cg)([(0,h.wk)()],x.prototype,"_start",void 0),(0,r.Cg)([(0,h.wk)()],x.prototype,"_end",void 0),(0,r.Cg)([(0,h.wk)()],x.prototype,"_compareStart",void 0),(0,r.Cg)([(0,h.wk)()],x.prototype,"_compareEnd",void 0),(0,r.Cg)([(0,h.wk)()],x.prototype,"_unit",void 0),(0,r.Cg)([(0,h.wk)()],x.prototype,"_total",void 0),x=(0,r.Cg)([(0,h.EM)("hui-energy-water-graph-card")],x),s.d(e,{HuiEnergyWaterGraphCard:()=>x}),a()}catch(t){a(t)}})},41155(t,e,s){var a=s(35835);function r(t){return(0,a.w)(t,Date.now())}s.d(e,{A:()=>r})},87167(t,e,s){var a=s(29146),r=s(45854);function i(t,e,s){const i=(0,r.b)(t,e)/6e4;return(0,a.u)(s?.roundingMethod)(i)}s.d(e,{o:()=>i})},66357(t,e,s){var a=s(70378);function r(t){return(0,a.D)(Date.now(),t)}s.d(e,{o:()=>r})},14410(t,e,s){var a=s(36655),r=s(35385);function i(t,e,s){const[i,o]=(0,a.x)(s?.in,t,e);return+(0,r.o)(i)===+(0,r.o)(o)}s.d(e,{r:()=>i})},71127(t,e,s){var a=s(35835),r=s(41155),i=s(14410);function o(t,e){return(0,i.r)((0,a.w)(e?.in||t,t),(0,r.A)(e?.in||t))}s.d(e,{c:()=>o})},32070(t,e,s){var a=s(35385);function r(t){return(0,a.o)(Date.now(),t)}s.d(e,{R:()=>r})}}; 2//# sourceMappingURL=98992.74a71fc6d6c4c509.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.