1export const __webpack_ids__=["25864"];export const __webpack_modules__={97297:function(t,e,i){i.a(t,async function(t,e){try{i(81738),i(6989);var s=i(73742),a=i(59048),o=i(26292),n=i(20480),r=i(28598),l=i(24481),c=i(65863),h=i(83533),d=t([r]);r=(d.then?(await d)():d)[0];const u=(t,e,i)=>180*(0,h.Ff)((0,h.Fv)(t,e,i),e,i)/100;class _ extends a.oi{firstUpdated(t){super.firstUpdated(t),(0,c.T)(()=>{this._updated=!0,this._angle=u(this.value,this.min,this.max),this._segment_label=this._getSegmentLabel(),this._rescaleSvg()})}updated(t){super.updated(t),this._updated&&(t.has("value")||t.has("valueText")||t.has("label")||t.has("_segment_label"))&&(this._angle=u(this.value,this.min,this.max),this._segment_label=this._getSegmentLabel(),this._rescaleSvg())}render(){return a.YP` <svg viewBox="-50 -50 100 50" class="gauge"> ${this.needle&&this.levels?"":a.YP`<path class="dial" d="M -40 0 A 40 40 0 0 1 40 0"></path>`} ${this.levels?this.levels.sort((t,e)=>t.level-e.level).map((t,e)=>{let i;if(0===e&&t.level!==this.min){const t=u(this.min,this.min,this.max);i=a.YP`<path stroke="var(--info-color)" class="level" d="M 2 ${0-40*Math.cos(t*Math.PI/180)} 3 ${0-40*Math.sin(t*Math.PI/180)} 4 A 40 40 0 0 1 40 0 5 "></path>`}const s=u(t.level,this.min,this.max);return a.YP`${i}<path stroke="${t.stroke}" class="level" d="M 6 ${0-40*Math.cos(s*Math.PI/180)} 7 ${0-40*Math.sin(s*Math.PI/180)} 8 A 40 40 0 0 1 40 0 9 "></path>`}):""} ${this.needle?a.YP`<path class="needle" d="M -25 -2.5 L -47.5 0 L -25 2.5 z" style="${(0,n.V)({transform:`rotate(${this._angle}deg)`})}"> </path>`:a.YP`<path class="value" d="M -40 0 A 40 40 0 1 0 40 0" style="${(0,n.V)({transform:`rotate(${this._angle}deg)`})}"></path>`} </svg> <svg class="text"> <text class="value-text"> ${this._segment_label?this._segment_label:this.valueText||(0,r.uf)(this.value,this.locale,this.formatOptions)}${this._segment_label?"":"%"===this.label?(0,l.K)(this.locale)+"%":` ${this.label}`} </text> </svg>`}_rescaleSvg(){const t=this.shadowRoot.querySelector(".text"),e=t.querySelector("text").getBBox();t.setAttribute("viewBox",`${e.x} ${e.y} ${e.width} ${e.height}`)}_getSegmentLabel(){if(this.levels){this.levels.sort((t,e)=>t.level-e.level);for(let t=this.levels.length-1;t>=0;t--)if(this.value>=this.levels[t].level)return this.levels[t].label}return""}constructor(...t){super(...t),this.min=0,this.max=100,this.value=0,this.needle=!1,this.label="",this._angle=0,this._updated=!1,this._segment_label=""}}_.styles=a.iv`:host{position:relative}.dial{fill:none;stroke:var(--primary-background-color);stroke-width:15}.value{fill:none;stroke-width:15;stroke:var(--gauge-color);transition:all 1s ease 0s}.needle{fill:var(--primary-text-color);transition:all 1s ease 0s}.level{fill:none;stroke-width:15}.gauge{display:block}.text{position:absolute;max-height:40%;max-width:55%;left:50%;bottom:-6%;transform:translate(-50%,0%)}.value-text{font-size:50px;fill:var(--primary-text-color);text-anchor:middle;direction:ltr}`,(0,s.__decorate)([(0,o.Cb)({type:Number})],_.prototype,"min",void 0),(0,s.__decorate)([(0,o.Cb)({type:Number})],_.prototype,"max",void 0),(0,s.__decorate)([(0,o.Cb)({type:Number})],_.prototype,"value",void 0),(0,s.__decorate)([(0,o.Cb)({attribute:!1})],_.prototype,"formatOptions",void 0),(0,s.__decorate)([(0,o.Cb)({attribute:!1,type:String})],_.prototype,"valueText",void 0),(0,s.__decorate)([(0,o.Cb)({attribute:!1})],_.prototype,"locale",void 0),(0,s.__decorate)([(0,o.Cb)({type:Boolean})],_.prototype,"needle",void 0),(0,s.__decorate)([(0,o.Cb)({type:Array})],_.prototype,"levels",void 0),(0,s.__decorate)([(0,o.Cb)()],_.prototype,"label",void 0),(0,s.__decorate)([(0,o.SB)()],_.prototype,"_angle",void 0),(0,s.__decorate)([(0,o.SB)()],_.prototype,"_updated",void 0),(0,s.__decorate)([(0,o.SB)()],_.prototype,"_segment_label",void 0),_=(0,s.__decorate)([(0,o.Mo)("ha-gauge")],_),e()}catch(t){e(t)}})},80298:function(t,e,i){i.a(t,async function(t,e){try{var s=i(73742),a=i(52634),o=i(62685),n=i(59048),r=i(26292),l=i(75535),c=t([a]);
9a=(c.then?(await c)():c)[0],(0,l.jx)("tooltip.show",{keyframes:[{opacity:0},{opacity:1}],options:{duration:150,easing:"ease"}}),(0,l.jx)("tooltip.hide",{keyframes:[{opacity:1},{opacity:0}],options:{duration:400,easing:"ease"}});class h extends a.Z{}h.styles=[o.Z,n.iv`:host{--sl-tooltip-background-color:var(--secondary-background-color);--sl-tooltip-color:var(--primary-text-color);--sl-tooltip-font-family:var( 10 --ha-tooltip-font-family, 11 var(--ha-font-family-body) 12 );--sl-tooltip-font-size:var( 13 --ha-tooltip-font-size, 14 var(--ha-font-size-s) 15 );--sl-tooltip-font-weight:var( 16 --ha-tooltip-font-weight, 17 var(--ha-font-weight-normal) 18 );--sl-tooltip-line-height:var( 19 --ha-tooltip-line-height, 20 var(--ha-line-height-condensed) 21 );--sl-tooltip-padding:8px;--sl-tooltip-border-radius:var(--ha-tooltip-border-radius, 4px);--sl-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 8px);--sl-z-index-tooltip:var(--ha-tooltip-z-index, 1000)}`],h=(0,s.__decorate)([(0,r.Mo)("ha-tooltip")],h),e()}catch(t){e(t)}})},7214:function(t,e,i){i.d(e,{Cj:()=>u,F7:()=>a,Hs:()=>w,Kd:()=>x,Kj:()=>p,Nw:()=>f,PA:()=>o,Py:()=>l,Qm:()=>$,Z0:()=>y,_Y:()=>h,_m:()=>n,dL:()=>c,dO:()=>S,hN:()=>_,h_:()=>d,j2:()=>b,q6:()=>g,uR:()=>r});i(81738),i(72489);var s=i(15459),a=function(t){return t[t.NONE=0]="NONE",t[t.ARITHMETIC=1]="ARITHMETIC",t[t.CIRCULAR=2]="CIRCULAR",t}({});const o=99387==i.j?["entity_not_recorded","entity_no_longer_recorded","state_class_removed","units_changed","mean_type_changed","no_state"]:null,n=t=>t.sendMessagePromise({type:"recorder/info"}),r=(t,e)=>t.callWS({type:"recorder/list_statistic_ids",statistic_type:e}),l=(t,e)=>t.callWS({type:"recorder/get_statistics_metadata",statistic_ids:e}),c=(t,e,i,s,a="hour",o,n)=>t.callWS({type:"recorder/statistics_during_period",start_time:e.toISOString(),end_time:i?.toISOString(),statistic_ids:s,period:a,units:o,types:n}),h=(t,e,i,s)=>t.callWS({type:"recorder/statistic_during_period",statistic_id:e,units:s,fixed_period:i.fixed_period?{start_time:i.fixed_period.start instanceof Date?i.fixed_period.start.toISOString():i.fixed_period.start,end_time:i.fixed_period.end instanceof Date?i.fixed_period.end.toISOString():i.fixed_period.end}:void 0,calendar:i.calendar,rolling_window:i.rolling_window}),d=t=>t.callWS({type:"recorder/validate_statistics"}),u=(t,e,i)=>t.callWS({type:"recorder/update_statistics_metadata",statistic_id:e,unit_of_measurement:i}),_=(t,e)=>t.callWS({type:"recorder/clear_statistics",statistic_ids:e}),p=t=>{let e=null;if(!t)return null;for(const i of t)null!==i.change&&void 0!==i.change&&(null===e?e=i.change:e+=i.change);return e},g=(t,e)=>{let i=null;for(const s of e){if(!(s in t))continue;const e=p(t[s]);null!==e&&(null===i?i=e:i+=e)}return i},f=(t,e)=>t.some(t=>void 0!==t[e]&&null!==t[e]),m=["mean","min","max"],v=["sum","state","change"],y=(t,e)=>!(!m.includes(e)||0===t.mean_type)||!(!v.includes(e)||!t.has_sum),b=(t,e,i,s,a)=>{const o=new Date(i).toISOString();return t.callWS({type:"recorder/adjust_sum_statistics",statistic_id:e,start_time:o,adjustment:s,adjustment_unit_of_measurement:a})},x=(t,e,i)=>{const a=t.states[e];return a?(0,s.C)(a):i?.name||e},S=(t,e,i)=>{let s;return e&&(s=t.states[e]?.attributes.unit_of_measurement),void 0===s?i?.statistics_unit_of_measurement:s},w=t=>t.includes(":"),$=t=>t.callWS({type:"recorder/update_statistics_issues"})},6291:function(t,e,i){i.d(e,{f:()=>o});i(81738),i(72489);var s=i(73742),a=i(26292);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,s.__decorate)([(0,a.Cb)({attribute:!1})],e.prototype,"hass",void 0),e}}
21,89078:function(t,e,i){i.a(t,async function(t,s){try{i.r(e);i(81738),i(93190);var a=i(73742),o=i(59048),n=i(26292),r=i(20480),l=i(98249),c=(i(31138),i(97297)),h=(i(993),i(80298)),d=i(6640),u=i(6291),_=i(99389),p=i(43309),g=i(93647),f=t([c,h,d,p]);[c,h,d,p]=f.then?(await f)():f;const m="M13,9H11V7H13M13,17H11V11H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",v={maximumFractionDigits:0};class y extends((0,u.f)(o.oi)){getCardSize(){return 4}setConfig(t){this._config=t}hassSubscribe(){return[(0,d.UB)(this.hass,{key:this._config?.collection_key}).subscribe(t=>{this._data=t})]}shouldUpdate(t){return(0,g.SN)(this,t)||t.size>1||!t.has("hass")||!!this._data?.co2SignalEntity&&this.hass.states[this._data.co2SignalEntity]!==t.get("hass").states[this._data.co2SignalEntity]}render(){if(!this._config||!this.hass)return o.Ld;if(!this._data)return o.dy`${this.hass.localize("ui.panel.lovelace.cards.energy.loading")}`;if(!this._data.co2SignalEntity)return o.Ld;if(!this.hass.states[this._data.co2SignalEntity])return o.dy`<hui-warning .hass="${this.hass}"> ${(0,_.i)(this.hass,this._data.co2SignalEntity)} </hui-warning>`;const{summedData:t,compareSummedData:e}=(0,d.EH)(this._data),i=t.total.from_grid??0;let s;if(this._data.fossilEnergyConsumption){const e=this._data.fossilEnergyConsumption?Object.values(this._data.fossilEnergyConsumption).reduce((t,e)=>t+e,0):0,a=t.total.solar??0,o=t.total.to_grid??0,n=i+Math.max(0,a-o);n&&(s=(0,l.N)(100*(1-e/n)))}return o.dy` <ha-card> ${void 0!==s?o.dy` <ha-gauge min="0" max="100" .value="${s}" .formatOptions="${v}" .locale="${this.hass.locale}" label="%" style="${(0,r.V)({"--gauge-color":this._computeSeverity(s)})}"></ha-gauge> <ha-tooltip .content="${this.hass.localize("ui.panel.lovelace.cards.energy.carbon_consumed_gauge.card_indicates_energy_used")}" placement="left" hoist> <ha-svg-icon .path="${m}"></ha-svg-icon> </ha-tooltip> <div class="name"> ${this.hass.localize("ui.panel.lovelace.cards.energy.carbon_consumed_gauge.low_carbon_energy_consumed")} </div> `:o.dy`${this.hass.localize("ui.panel.lovelace.cards.energy.carbon_consumed_gauge.low_carbon_energy_not_calculated")}`} </ha-card> `}_computeSeverity(t){return t<10?p.severityMap.red:t<30?p.severityMap.yellow:t>75?p.severityMap.green:p.severityMap.normal}constructor(...t){super(...t),this.hassSubscribeRequiredHostProps=["_config"]}}y.styles=o.iv`ha-card{height:100%;overflow:hidden;padding:16px;display:flex;align-items:center;justify-content:center;flex-direction:column;box-sizing:border-box}ha-gauge{width:100%;max-width:250px}.name{text-align:center;line-height:initial;color:var(--primary-text-color);width:100%;font-size:var(--ha-font-size-m);margin-top:8px}ha-svg-icon{position:absolute;right:4px;inset-inline-end:4px;inset-inline-start:initial;top:4px;color:var(--secondary-text-color)}ha-tooltip::part(base__popup){margin-top:4px}`,(0,a.__decorate)([(0,n.Cb)({attribute:!1})],y.prototype,"hass",void 0),(0,a.__decorate)([(0,n.SB)()],y.prototype,"_config",void 0),(0,a.__decorate)([(0,n.SB)()],y.prototype,"_data",void 0),y=(0,a.__decorate)([(0,n.Mo)("hui-energy-carbon-consumed-gauge-card")],y),s()}catch(t){s(t)}})},43309:function(t,e,i){i.a(t,async function(t,s){try{i.r(e),i.d(e,{DEFAULT_MAX:()=>$,DEFAULT_MIN:()=>w,severityMap:()=>C});i(81738),i(6989);var a=i(73742),o=i(59048),n=i(26292),r=i(25191),l=i(31733),c=i(20480),h=i(4427),d=i(15459),u=i(7334),_=i(28598),p=(i(31138),i(97297)),g=i(16230),f=i(76815),m=i(45063),v=i(88887),y=i(37807),b=i(93647),x=i(99389),S=t([p,_]);[p,_]=S.then?(await S)():S;const w=0,$=100,C={red:"var(--error-color)",green:"var(--success-color)",yellow:"var(--warning-color)",normal:"var(--info-color)"};class k extends o.oi{static async getConfigElement(){return await i.e("67852").then(i.bind(i,42137)),document.createElement("hui-gauge-card-editor")}static getStubConfig(t,e,i){return{type:"gauge",entity:(0,m.j)(t,1,e,i,["counter","input_number","number","sensor"],t=>!isNaN(Number(t.state)))[0]||""}}getCardSize(){return 4}setConfig(t){if(!t.entity)throw new Error("Entity must be specified");if(!(0,u.T)(t.entity))throw new Error("Invalid entity");this._config={min:w,max:$,...t}}
21render(){if(!this._config||!this.hass)return o.Ld;const t=this.hass.states[this._config.entity];if(!t)return o.dy` <hui-warning .hass="${this.hass}"> ${(0,x.i)(this.hass,this._config.entity)} </hui-warning> `;const e=Number(t.state);if(t.state===g.nZ)return o.dy` <hui-warning>${this.hass.localize("ui.panel.lovelace.warning.entity_unavailable",{entity:this._config.entity})}</hui-warning> `;const i=this._config.attribute?t.attributes[this._config.attribute]:t.state;if(isNaN(i))return o.dy` <hui-warning>${this.hass.localize(this._config.attribute?"ui.panel.lovelace.warning.attribute_not_numeric":"ui.panel.lovelace.warning.entity_non_numeric",{entity:this._config.entity,attribute:this._config.attribute})}</hui-warning> `;const s=this._config.name??(0,d.C)(t);return o.dy` <ha-card class="${(0,l.$)({action:(0,y.q)(this._config)})}" @action="${this._handleAction}" .actionHandler="${(0,f.K)({hasHold:(0,y._)(this._config.hold_action),hasDoubleClick:(0,y._)(this._config.double_tap_action)})}" tabindex="${(0,r.o)(!this._config.tap_action||(0,y._)(this._config.tap_action)?"0":void 0)}"> <ha-gauge .min="${this._config.min}" .max="${this._config.max}" .value="${i}" .formatOptions="${(0,_.l4)(t,this.hass.entities[t.entity_id])}" .locale="${this.hass.locale}" .label="${this._config.unit||this.hass?.states[this._config.entity].attributes.unit_of_measurement||""}" style="${(0,c.V)({"--gauge-color":this._computeSeverity(e)})}" .needle="${this._config.needle}" .levels="${this._config.needle?this._severityLevels():void 0}"></ha-gauge> <div class="name" .title="${s}">${s}</div> </ha-card> `}
21shouldUpdate(t){return(0,b.G2)(this,t)}updated(t){if(super.updated(t),!this._config||!this.hass)return;const e=t.get("hass"),i=t.get("_config");e&&i&&e.themes===this.hass.themes&&i.theme===this._config.theme||(0,h.R)(this,this.hass.themes,this._config.theme)}_computeSeverity(t){if(this._config.needle)return;let e=this._config.segments;if(e){e=[...e].sort((t,e)=>t.from-e.from);for(let i=0;i<e.length;i++){const s=e[i];if(s&&t>=s.from&&(i+1===e.length||t<e[i+1]?.from))return s.color}return C.normal}const i=this._config.severity;if(!i)return C.normal;const s=Object.keys(i).map(t=>[t,i[t]]);for(const t of s)if(null==C[t[0]]||isNaN(t[1]))return C.normal;return s.sort((t,e)=>t[1]-e[1]),t>=s[0][1]&&t<s[1][1]?C[s[0][0]]:t>=s[1][1]&&t<s[2][1]?C[s[1][0]]:t>=s[2][1]?C[s[2][0]]:C.normal}_severityLevels(){const t=this._config.segments;if(t)return t.map(t=>({level:t?.from,stroke:t?.color,label:t?.label}));const e=this._config.severity;if(!e)return[{level:0,stroke:C.normal}];return Object.keys(e).map(t=>({level:e[t],stroke:C[t]}))}_handleAction(t){(0,v.G)(this,this.hass,this._config,t.detail.action)}}k.styles=o.iv`ha-card{height:100%;overflow:hidden;padding:16px;display:flex;align-items:center;justify-content:center;flex-direction:column;box-sizing:border-box}ha-card.action{cursor:pointer}ha-card:focus{outline:0}ha-gauge{width:100%;max-width:250px}.name{text-align:center;line-height:initial;color:var(--primary-text-color);width:100%;font-size:var(--ha-font-size-m);margin-top:8px}`,(0,a.__decorate)([(0,n.Cb)({attribute:!1})],k.prototype,"hass",void 0),(0,a.__decorate)([(0,n.SB)()],k.prototype,"_config",void 0),k=(0,a.__decorate)([(0,n.Mo)("hui-gauge-card")],k),s()}catch(t){s(t)}})},83533:function(t,e,i){i.d(e,{Ff:()=>a,Fv:()=>s,IU:()=>o});const s=(t,e,i)=>isNaN(t)||isNaN(e)||isNaN(i)?0:t>i?i:t<e?e:t,a=(t,e,i)=>100*(t-e)/(i-e),o=t=>Math.round(10*t)/10}}; 22//# sourceMappingURL=25864.a16c9149171db47a.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.