iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
14 lines • 50.5 kB
JavaScript
/*! For license information please see 41194.c5a62a04040ba903.js.LICENSE.txt */
export const __rspack_esm_id=41194;export const __rspack_esm_ids=[41194];export const __webpack_modules__={93421(e,t,i){i.d(t,{IW:()=>d,dH:()=>c,fI:()=>l});i(44114);var a=i(35211),s=i(22792),o=i(32172);const r=(e,t)=>{let i=e;for(const e of t){if(null==i)return;i=i[e]}return i},n=(e,t,i)=>{const s=(0,o.p)({transformer:function(e){return i.call(this,e)},watch:t?[t]:[]}),r=(0,a.Fg)({context:e,subscribe:!0});return(e,t)=>{s(e,t),r(e,t)}},l=e=>n(s.iN,e.entityIdPath[0],function(t){const i=r(this,e.entityIdPath);return"string"==typeof i?t?.[i]:void 0}),c=e=>n(s.X1,e.entityIdPath[0],function(t){const i=r(this,e.entityIdPath);return"string"==typeof i?t?.[i]:void 0}),d=()=>n(s.D5,void 0,({localize:e})=>e)},32172(e,t,i){i.d(t,{p:()=>a});i(18111),i(7588),i(45367),i(92731),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);function a(e){return(t,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const a=String(i),s=t;if(s._transformers){if(!s.hasOwnProperty("_transformers")){const e=s._transformers;s._transformers=new Map,e.forEach((e,t)=>s._transformers.set(t,e))}}else{s._transformers=new Map,s._watching=new Map;const e=s.willUpdate;s.willUpdate=function(t){e.call(this,t);const i=new Set;t.forEach((e,t)=>{const a=this._watching.get(t);void 0!==a&&a.forEach(e=>i.add(e))}),i.forEach(e=>{this[e]=this[`__original_${String(e)}`]})}}s._transformers.set(i,e.transformer),e.watch&&e.watch.forEach(e=>{let t=s._watching.get(e);t||(t=new Set,s._watching.set(e,t)),t.add(i)});const o=Object.getOwnPropertyDescriptor(t,i);let r;if(void 0===o)r={get(){return this[`__transform_${a}`]},set(e){const t=this[`__transform_${a}`],i=this._transformers.get(a);this[`__transform_${a}`]=i?i.call(this,e):e,this[`__original_${a}`]=e,this.requestUpdate(a,t)},configurable:!0,enumerable:!0};else{const e=o.set;r={...o,set(t){const i=this[`__transform_${a}`],s=this._transformers.get(a);this[`__transform_${a}`]=s?s.call(this,t):t,this[`__original_${a}`]=t,this.requestUpdate(a,i),e?.call(this,t)}}}Object.defineProperty(t,i,r)}}},17451(e,t,i){i.d(t,{j:()=>a});const a=(e,t,i)=>(void 0!==i&&(i=!!i),e.hasAttribute(t)?!!i||(e.removeAttribute(t),!1):!1!==i&&(e.setAttribute(t,""),!0))},52943(e,t,i){i.d(t,{Z:()=>a});const a=e=>e.charAt(0).toUpperCase()+e.slice(1)},19459(e,t,i){i.d(t,{b:()=>a});i(45367),i(92731),i(69479),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);const a=(e,t,i)=>{if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;let s,o;if(Array.isArray(e)){if(o=e.length,o!==t.length)return!1;for(s=o;0!==s--;)if(!a(e[s],t[s],i))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(s of e.entries())if(!t.has(s[0]))return!1;for(s of e.entries())if(!a(s[1],t.get(s[0]),i))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(s of e.entries())if(!t.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(o=e.length,o!==t.length)return!1;for(s=o;0!==s--;)if(e[s]!==t[s])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const r=Object.keys(e);if(o=r.length,o!==Object.keys(t).length)return!1;for(s=o;0!==s--;)if(!Object.prototype.hasOwnProperty.call(t,r[s]))return!1;for(s=o;0!==s--;){const o=r[s];if(!a(e[o],t[o],i))return!1}if(i?.compareSymbols){const s=Object.getOwnPropertySymbols(e),o=Object.getOwnPropertySymbols(t);if(s.length!==o.length)return!1;for(const o of s){if(!Object.prototype.hasOwnProperty.call(t,o))return!1;if(!a(e[o],t[o],i))return!1}}return!0}return e!=e&&t!=t}},38962(e,t,i){i.a(e,async function(e,a){try{i.r(t);var s=i(62826),o=i(5124),r=i(22441),n=i(6412),l=i(93421),c=i(1087),d=i(26300),h=(i(67094),e([d]));d=(h.then?(await h)():h)[0];const p="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",u={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class m extends o.WF{render(){return o.qy` <div class="issue-type ${(0,n.H)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${u[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,n.H)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?o.qy`<div class="title">${this.title}</div>`:o.s6} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?o.qy`<ha-icon-button @click="${this._dismissClicked}" .label="${this._localize?.("ui.common.dismiss_alert")}" .path="${p}"></ha-icon-button>`:o.s6} </slot> </div> </div> </div> `}_dismissClicked(){(0,c.r)(this,"alert-dismissed-clicked")}constructor(...e){super(...e),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}m.styles=o.AH`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`,(0,s.Cg)([(0,r.MZ)()],m.prototype,"title",void 0),(0,s.Cg)([(0,r.MZ)({attribute:"alert-type"})],m.prototype,"alertType",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],m.prototype,"dismissable",void 0),(0,s.Cg)([(0,r.wk)(),(0,l.IW)()],m.prototype,"_localize",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],m.prototype,"narrow",void 0),m=(0,s.Cg)([(0,r.EM)("ha-alert")],m),a()}catch(e){a(e)}})},76776(e,t,i){var a=i(62826),s=i(5124),o=i(22441);class r extends s.WF{render(){return s.qy` ${this.header?s.qy`<h1 class="card-header">${this.header}</h1>`:s.s6} <slot></slot> `}constructor(...e){super(...e),this.raised=!1}}r.styles=s.AH`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, var(--ha-font-size-2xl));letter-spacing:-.012em;line-height:var(--ha-line-height-expanded);padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4);display:block;margin-block-start:0;margin-block-end:0;font-weight:var(--ha-font-weight-normal)}
:host
::slotted(
.card-content:not(:nth-child(1 of .card-content, .card-header))
),
slot:not(:first-child)::slotted(.card-content) {
padding-top: 0;
margin-top: calc(var(--ha-space-2) * -1);
}
:host ::slotted(.card-content){padding:var(--ha-space-4)}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:var(--ha-space-2)}`,(0,a.Cg)([(0,o.MZ)()],r.prototype,"header",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],r.prototype,"raised",void 0),r=(0,a.Cg)([(0,o.EM)("ha-card")],r)},65829(e,t,i){i.a(e,async function(e,a){try{i.r(t),i.d(t,{HaSpinner:()=>c});var s=i(62826),o=i(55262),r=i(5124),n=i(22441),l=e([o]);o=(l.then?(await l)():l)[0];class c extends o.A{updated(e){if(super.updated(e),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}static get styles(){return[o.A.styles,r.AH`:host{--indicator-color:var(
--ha-spinner-indicator-color,
var(--primary-color)
);--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`]}}(0,s.Cg)([(0,n.MZ)()],c.prototype,"size",void 0),c=(0,s.Cg)([(0,n.EM)("ha-spinner")],c),a()}catch(e){a(e)}})},82e3(e,t,i){i.d(t,{D5:()=>a,Fy:()=>r,Gk:()=>c,Hg:()=>s,Y_:()=>d,ds:()=>l,e0:()=>o,ec:()=>n});i(74423),i(18111),i(61701),i(33110);const a=14881==i.j?`${location.protocol}//${location.host}`:null,s=e=>e.map(e=>{if("string"!==e.type)return e;switch(e.name){case"username":return{...e,autocomplete:"username",autofocus:!0};case"password":return{...e,autocomplete:"current-password"};case"code":return{...e,autocomplete:"one-time-code",autofocus:!0};default:return e}}),o=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),r=async(e,t,i,a)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:i,password:a}),n=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:i}),l=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:i}),c=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:t,username:i}),d=(e,t,i)=>e.callWS({type:"auth/delete_all_refresh_tokens",token_type:t,delete_current_token:i})},23528(e,t,i){i.d(t,{$3:()=>g,$O:()=>x,$j:()=>f,ED:()=>o,JE:()=>$,OQ:()=>k,PU:()=>L,Ph:()=>u,Uf:()=>C,W1:()=>m,Wr:()=>d,Z:()=>l,gF:()=>b,iY:()=>_,jU:()=>r,nN:()=>v,p3:()=>c,pJ:()=>p,r_:()=>n,sz:()=>h});i(74423),i(18111),i(13579);var a=i(28978),s=i(380),o=function(e){return e[e.NONE=0]="NONE",e[e.ARITHMETIC=1]="ARITHMETIC",e[e.CIRCULAR=2]="CIRCULAR",e}({});const r=["entity_not_recorded","entity_no_longer_recorded","state_class_removed","units_changed","mean_type_changed","no_state"],n=["L","gal","ft³","m³","CCF","MCF"],l=e=>e.sendMessagePromise({type:"recorder/info"}),c=(e,t)=>e.callWS({type:"recorder/list_statistic_ids",statistic_type:t}),d=(e,t)=>e.callWS({type:"recorder/get_statistics_metadata",statistic_ids:t}),h=(e,t,i,a,s="hour",o,r)=>e.callWS({type:"recorder/statistics_during_period",start_time:t.toISOString(),end_time:i?.toISOString(),statistic_ids:a,period:s,units:o,types:r}),p=(e,t,i,a)=>e.callWS({type:"recorder/statistic_during_period",statistic_id:t,units:a,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?{..."week"===i.calendar.period?{first_weekday:(0,s.D)(e.locale).substring(0,3)}:{},...i.calendar}:void 0,rolling_window:i.rolling_window}),u=e=>e.callWS({type:"recorder/validate_statistics"}),m=(e,t,i,a)=>e.callWS({type:"recorder/update_statistics_metadata",statistic_id:t,unit_of_measurement:i,unit_class:a}),g=(e,t)=>e.callWS({type:"recorder/clear_statistics",statistic_ids:t}),f=e=>{let t=null;if(!e)return null;for(const i of e)null!==i.change&&void 0!==i.change&&(null===t?t=i.change:t+=i.change);return t},b=(e,t)=>{let i=null;for(const a of t){if(!(a in e))continue;const t=f(e[a]);null!==t&&(null===i?i=t:i+=t)}return i},_=(e,t)=>e.some(e=>void 0!==e[t]&&null!==e[t]),w=["mean","min","max"],y=["sum","state","change"],v=(e,t)=>!(!w.includes(t)||0===e.mean_type)||!(!y.includes(t)||!e.has_sum),C=(e,t,i,a,s)=>{const o=new Date(i).toISOString();return e.callWS({type:"recorder/adjust_sum_statistics",statistic_id:t,start_time:o,adjustment:a,adjustment_unit_of_measurement:s})},x=(e,t,i)=>{const s=e.states[t];return s?(0,a.u)(s):i?.name||t},$=(e,t,i)=>{let a;return t&&(a=e.states[t]?.attributes.unit_of_measurement),void 0===a?i?.statistics_unit_of_measurement:a},k=e=>e.includes(":"),L=e=>e.callWS({type:"recorder/update_statistics_issues"})},71606(e,t,i){i.d(t,{f:()=>s,o:()=>a});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);const a=new Set(["automation","script","scene","group"]),s=(e,t,i)=>e.callWS({type:"search/related",item_type:t,item_id:i})},28669(e,t,i){i.d(t,{TK:()=>n,_2:()=>c,eR:()=>s,hG:()=>l,hU:()=>o,kg:()=>r,wj:()=>a,xg:()=>d});i(44114),i(18111),i(61701);const a="system-admin",s="system-users",o=async e=>e.callWS({type:"config/auth/list"}),r=async(e,t,i,a)=>e.callWS({type:"config/auth/create",name:t,group_ids:i,local_only:a}),n=async(e,t,i)=>e.callWS({...i,type:"config/auth/update",user_id:t}),l=async(e,t)=>e.callWS({type:"config/auth/delete",user_id:t}),c=e=>e?e.trim().split(" ").slice(0,3).map(e=>e.substring(0,1)).join(""):"?",d=(e,t,i)=>{const a=[],s=t=>e.localize(`ui.panel.config.users.${t}`);return t.is_owner&&a.push(["M12 2C6.47 2 2 6.5 2 12C2 17.5 6.5 22 12 22S22 17.5 22 12 17.5 2 12 2M12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4S20 7.58 20 12C20 16.42 16.42 20 12 20M8 14L7 8L10 10L12 7L14 10L17 8L16 14H8M8.56 16C8.22 16 8 15.78 8 15.44V15H16V15.44C16 15.78 15.78 16 15.44 16H8.56Z",s("is_owner")]),i&&t.system_generated&&a.push(["M11,7H15V9H11V11H13A2,2 0 0,1 15,13V15A2,2 0 0,1 13,17H9V15H13V13H11A2,2 0 0,1 9,11V9A2,2 0 0,1 11,7M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4Z",s("is_system")]),t.local_only&&a.push(["M12 20C7.6 20 4 16.4 4 12S7.6 4 12 4 20 7.6 20 12 16.4 20 12 20M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M11 14H13V17H16V12H18L12 7L6 12H8V17H11V14",s("is_local")]),t.is_active||a.push(["M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",s("is_not_active")]),a}},71341(e,t,i){i.a(e,async function(e,a){try{i.r(t);i(74423),i(44114),i(18111),i(22489),i(20116),i(7588),i(61701),i(13579),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var s=i(62826),o=(i(68825),i(35211)),r=i(5124),n=i(22441),l=i(22786),c=i(1087),d=i(65522),h=i(37981),p=i(81816),u=i(28978),m=(i(34296),i(48091)),g=i(86368),f=i(18350),b=i(29823),_=(i(70947),i(36866)),w=i(23528),y=i(22792),v=i(29303),C=i(79172),x=i(14503),$=i(33963),k=i(5936),L=i(36959),M=e([m,f,b,_,v,$]);[m,f,b,_,v,$]=M.then?(await M)():M;const S="M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z",A="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z",H="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",E="M3,5H9V11H3V5M5,7V9H7V7H5M11,7H21V9H11V7M11,15H21V17H11V15M5,20L1.5,16.5L2.91,15.09L5,17.17L9.59,12.59L11,14L5,20Z",z="M7,10L12,15L17,10H7Z",O="M22,13V22H2V19L22,13M21.68,7.06L16.86,4.46L17.7,7.24L7.58,10.24C6.63,8.95 4.82,8.67 3.53,9.62C2.24,10.57 1.96,12.38 2.91,13.67C3.85,14.97 5.67,15.24 6.96,14.29C7.67,13.78 8.1,12.97 8.14,12.09L18.26,9.09L19.1,11.87L21.68,7.06Z",D="M3 3H17C18.11 3 19 3.9 19 5V12.08C17.45 11.82 15.92 12.18 14.68 13H11V17H12.08C11.97 17.68 11.97 18.35 12.08 19H3C1.9 19 1 18.11 1 17V5C1 3.9 1.9 3 3 3M3 7V11H9V7H3M11 7V11H17V7H11M3 13V17H9V13H3M22.78 19.32L21.71 18.5C21.73 18.33 21.75 18.17 21.75 18S21.74 17.67 21.71 17.5L22.77 16.68C22.86 16.6 22.89 16.47 22.83 16.36L21.83 14.63C21.77 14.5 21.64 14.5 21.5 14.5L20.28 15C20 14.82 19.74 14.65 19.43 14.53L19.24 13.21C19.23 13.09 19.12 13 19 13H17C16.88 13 16.77 13.09 16.75 13.21L16.56 14.53C16.26 14.66 15.97 14.82 15.71 15L14.47 14.5C14.36 14.5 14.23 14.5 14.16 14.63L13.16 16.36C13.1 16.47 13.12 16.6 13.22 16.68L14.28 17.5C14.26 17.67 14.25 17.83 14.25 18S14.26 18.33 14.28 18.5L13.22 19.32C13.13 19.4 13.1 19.53 13.16 19.64L14.16 21.37C14.22 21.5 14.35 21.5 14.47 21.5L15.71 21C15.97 21.18 16.25 21.35 16.56 21.47L16.75 22.79C16.77 22.91 16.87 23 17 23H19C19.12 23 19.23 22.91 19.25 22.79L19.44 21.47C19.74 21.34 20 21.18 20.28 21L21.5 21.5C21.64 21.5 21.77 21.5 21.84 21.37L22.84 19.64C22.9 19.53 22.87 19.4 22.78 19.32M18 19.5C17.17 19.5 16.5 18.83 16.5 18S17.18 16.5 18 16.5 19.5 17.17 19.5 18 18.84 19.5 18 19.5Z",P="M16.59,5.41L15.17,4L12,7.17L8.83,4L7.41,5.41L12,10M7.41,18.59L8.83,20L12,16.83L15.17,20L16.58,18.59L12,14L7.41,18.59Z",V="M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z",j={no_state:0,entity_no_longer_recorded:1,entity_not_recorded:1,state_class_removed:2,units_changed:3,mean_type_changed:4},q=["no_state","entity_no_longer_recorded","state_class_removed","units_changed","mean_type_changed"];class I extends((0,C.b)(r.WF)){firstUpdated(){this._validateStatistics()}render(){const e=this._columns(this._i18n.localize),t=this._selectMode?r.s6:r.qy`<ha-assist-chip class="has-dropdown select-mode-chip" .active="${this._selectMode}" @click="${this._enableSelectMode}" .title="${this._i18n.localize("ui.components.subpage-data-table.enter_selection_mode")}"> <ha-svg-icon slot="icon" .path="${E}"></ha-svg-icon> </ha-assist-chip> `,i=r.qy`<ha-input-search appearance="outlined" .value="${this.filter}" @input="${this._handleSearchChange}"> </ha-input-search>`,a=Object.values(e).find(e=>e.sortable)?r.qy` <ha-dropdown @wa-select="${this._handleSortBy}"> <ha-assist-chip slot="trigger" .label="${this._i18n.localize("ui.components.subpage-data-table.sort_by",{sortColumn:this._sortColumn?` ${e[this._sortColumn]?.title||e[this._sortColumn]?.label}`:""})}"> <ha-svg-icon slot="trailing-icon" .path="${z}"></ha-svg-icon> </ha-assist-chip> ${Object.entries(e).map(([e,t])=>t.sortable?r.qy` <ha-dropdown-item .value="${e}" .selected="${e===this._sortColumn}"> ${this._sortColumn===e?r.qy` <ha-svg-icon slot="details" .path="${"desc"===this._sortDirection?S:A}"></ha-svg-icon> `:r.s6} ${t.title||t.label} </ha-dropdown-item> `:r.s6)} </ha-dropdown> `:r.s6,s=Object.values(e).find(e=>e.groupable)?r.qy` <ha-dropdown @wa-select="${this._handleOverflowGroupBy}"> <ha-assist-chip slot="trigger" .label="${this._i18n.localize("ui.components.subpage-data-table.group_by",{groupColumn:this._groupColumn?` ${e[this._groupColumn].title||e[this._groupColumn].label}`:""})}"> <ha-svg-icon slot="trailing-icon" .path="${z}"></ha-svg-icon></ha-assist-chip> ${Object.entries(e).map(([e,t])=>t.groupable?r.qy` <ha-dropdown-item .value="${e}" .selected="${e===this._groupColumn}"> ${t.title||t.label} </ha-dropdown-item> `:r.s6)} <ha-dropdown-item value="none" .selected="${void 0===this._groupColumn}"> ${this._i18n.localize("ui.components.subpage-data-table.dont_group_by")} </ha-dropdown-item> <wa-divider></wa-divider> <ha-dropdown-item value="collapse_all" @click="${this._collapseAllGroups}" .disabled="${void 0===this._groupColumn}"> <ha-svg-icon slot="icon" .path="${P}"></ha-svg-icon> ${this._i18n.localize("ui.components.subpage-data-table.collapse_all_groups")} </ha-dropdown-item> <ha-dropdown-item @click="${this._expandAllGroups}" .disabled="${void 0===this._groupColumn}"> <ha-svg-icon slot="icon" .path="${V}"></ha-svg-icon> ${this._i18n.localize("ui.components.subpage-data-table.expand_all_groups")} </ha-dropdown-item> </ha-dropdown> `:r.s6,o=r.qy`<ha-assist-chip class="has-dropdown select-mode-chip" @click="${this._openSettings}" .title="${this._i18n.localize("ui.components.subpage-data-table.settings")}"> <ha-svg-icon slot="icon" .path="${D}"></ha-svg-icon> </ha-assist-chip>`;return r.qy` <div class="table-with-toolbars"> ${this._selectMode?r.qy`<div class="selection-bar"> <div class="selection-controls"> <ha-icon-button .path="${H}" @click="${this._disableSelectMode}" .label="${this._i18n.localize("ui.components.subpage-data-table.exit_selection_mode")}"></ha-icon-button> <ha-dropdown> <ha-assist-chip .label="${this._i18n.localize("ui.components.subpage-data-table.select")}" slot="trigger"> <ha-svg-icon slot="icon" .path="${E}"></ha-svg-icon> <ha-svg-icon slot="trailing-icon" .path="${z}"></ha-svg-icon></ha-assist-chip> <ha-dropdown-item @click="${this._selectAll}"> ${this._i18n.localize("ui.components.subpage-data-table.select_all")} </ha-dropdown-item> <ha-dropdown-item @click="${this._selectAllIssues}"> ${this._i18n.localize("ui.panel.config.developer-tools.tabs.statistics.data_table.select_all_issues")} </ha-dropdown-item> <ha-dropdown-item @click="${this._selectNone}"> ${this._i18n.localize("ui.components.subpage-data-table.select_none")} </ha-dropdown-item> <wa-divider></wa-divider> <ha-dropdown-item @click="${this._disableSelectMode}"> ${this._i18n.localize("ui.components.subpage-data-table.exit_selection_mode")} </ha-dropdown-item> </ha-dropdown> <p> ${this._i18n.localize("ui.components.subpage-data-table.selected",{selected:this._selected.length})} </p> </div> <div class="center-vertical"> <slot name="selection-bar"></slot> </div> <ha-assist-chip .label="${this._i18n.localize("ui.panel.config.developer-tools.tabs.statistics.delete_selected")}" .disabled="${!this._selected.length}" @click="${this._clearSelected}"> </ha-assist-chip> </div>`:r.s6} <div slot="toolbar-icon"> <slot name="toolbar-icon"></slot> </div> ${this.narrow?r.qy` <div slot="header"> <slot name="header"> <div class="search-toolbar">${i}</div> </slot> </div> `:r.s6} <ha-data-table .narrow="${this.narrow}" .columns="${e}" .data="${this._displayData(this._data,this._i18n.localize,this._registries.entities,this._registries.devices,this._registries.areas)}" .noDataText="${this._i18n.localize("ui.panel.config.developer-tools.tabs.statistics.data_table.no_statistics")}" .filter="${this.filter}" .selectable="${this._selectMode}" id="statistic_id" clickable .sortColumn="${this._sortColumn}" .sortDirection="${this._sortDirection}" .groupColumn="${this._groupColumn}" .groupOrder="${this.groupOrder}" .columnOrder="${this.columnOrder}" .hiddenColumns="${this.hiddenColumns}" @row-click="${this._rowClicked}" @selection-changed="${this._handleSelectionChanged}" @sorting-changed="${this._handleTableSortingChanged}"> ${this.narrow?r.qy`<div slot="header"></div> <div slot="header-row" class="narrow-header-row"> ${t}${s}${a}${o} </div>`:r.qy` <div slot="header"> <slot name="header"> <div class="table-header"> ${t}${i}${s}${a}${o} </div> </slot> </div> `} </ha-data-table> </div> `}_handleSearchChange(e){this.filter!==e.target.value&&(this.filter=e.target.value??"")}_handleSelectionChanged(e){this._selected=e.detail.value}_handleTableSortingChanged(e){const{column:t,direction:i}=e.detail;this._sortColumn=t,this._sortDirection=i}_handleSortBy(e){e.preventDefault();const t=e.detail.item.value;this._sortDirection&&this._sortColumn===t&&"asc"===this._sortDirection?this._sortDirection="desc":this._sortDirection="asc",this._sortColumn=t}_setGroupColumn(e){this._groupColumn=e}_openSettings(){(0,g.n)(this,{columns:this._columns(this._i18n.localize),hiddenColumns:this.hiddenColumns,columnOrder:this.columnOrder,onUpdate:(e,t)=>{this.columnOrder=e,this.hiddenColumns=t},localizeFunc:this._i18n.localize})}_collapseAllGroups(){this._dataTable.collapseAllGroups()}_expandAllGroups(){this._dataTable.expandAllGroups()}_enableSelectMode(){this._selectMode=!0}_disableSelectMode(){this._selectMode=!1,this._dataTable.clearSelection()}_selectAll(){this._dataTable.selectAll()}_selectNone(){this._dataTable.clearSelection()}_selectAllIssues(){this._dataTable.select(this._data.filter(e=>e.issues).map(e=>e.statistic_id),!0)}_showStatisticsAdjustSumDialog(e){e.stopPropagation(),(0,L.D)(this,{statistic:e.currentTarget.statistic})}_rowClicked(e){const t=e.detail.id;t in this._states&&(0,c.r)(this,"hass-more-info",{entityId:t})}async _validateStatistics(){const[e,t]=await Promise.all([(0,w.p3)(this._api),(0,w.Ph)(this._api)]);(0,w.PU)(this._api);const i=new Set;this._data=e.map(e=>(i.add(e.statistic_id),{...e,state:this._states[e.statistic_id],issues:t[e.statistic_id]})),Object.keys(t).forEach(e=>{i.has(e)||this._data.push({statistic_id:e,statistics_unit_of_measurement:"",source:"",state:this._states[e],issues:t[e],mean_type:w.ED.NONE,has_sum:!1,unit_class:null})})}supportedShortcuts(){return{f:()=>this._searchInput.focus()}}static get styles(){return[x.RF,r.AH`:host{display:block;height:100%}.table-with-toolbars{height:100%;display:flex;flex-direction:column;gap:var(--ha-space-2)}ha-data-table{width:100%;flex-grow:1;--data-table-border-width:0}:host([narrow]){--expansion-panel-summary-padding:0 16px}.table-header{display:flex;align-items:center;--mdc-shape-small:0;height:56px;width:100%;justify-content:space-between;padding:0 var(--ha-space-4);gap:var(--ha-space-4);box-sizing:border-box;background:var(--primary-background-color);border-bottom:1px solid var(--divider-color)}ha-input-search{flex:1}.search-toolbar{display:flex;align-items:center;color:var(--secondary-text-color)}.narrow-header-row{display:flex;align-items:center;gap:var(--ha-space-4);padding:0 var(--ha-space-4);overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none}.selection-bar{background:rgba(var(--rgb-primary-color),.1);width:100%;display:flex;align-items:center;justify-content:space-between;padding:var(--ha-space-2) var(--ha-space-3);box-sizing:border-box;font-size:var(--ha-font-size-m);--ha-assist-chip-container-color:var(--card-background-color)}.selection-controls{display:flex;align-items:center;gap:var(--ha-space-2)}.selection-controls p{margin-left:var(--ha-space-2);margin-inline-start:var(--ha-space-2);margin-inline-end:initial}.center-vertical{display:flex;align-items:center;gap:var(--ha-space-2)}.relative{position:relative}ha-assist-chip{--ha-assist-chip-container-shape:10px;--ha-assist-chip-container-color:var(--card-background-color)}.select-mode-chip{--md-assist-chip-icon-label-space:0;--md-assist-chip-trailing-space:8px}ha-dialog{--mdc-dialog-min-width:100vw;--mdc-dialog-max-width:100vw;--mdc-dialog-min-height:100%;--mdc-dialog-max-height:100%;--vertical-align-dialog:flex-end;--ha-dialog-border-radius:var(--ha-border-radius-square);--dialog-content-padding:0}ha-dropdown ha-assist-chip{--md-assist-chip-trailing-space:8px}`]}constructor(...e){super(...e),this.narrow=!1,this._data=[],this.filter="",this._selected=[],this._sortDirection=null,this._selectMode=!1,this._displayData=(0,l.A)((e,t,i,a,s)=>{const o=(0,h.Kh)(a);return e.map(e=>{const r=i[e.statistic_id],n=r?.device_id?a[r.device_id]:void 0,l=r?.area_id||n?.area_id,c=l?s[l]:void 0,m=r?(0,p.cx)(r,a,e.state):void 0,g=n?(0,h.xn)(n):void 0,f=c?(0,d.A)(c):void 0,b=g?o.has(g)&&f?`${g} (${f})`:g:void 0;return{...e,displayName:m||g||(e.state?(0,u.u)(e.state):void 0)||e.name||e.statistic_id,device:g,device_full:b,area:f,issues_string:e.issues?.map(e=>t(`ui.panel.config.developer-tools.tabs.statistics.issues.${e.type}`,e.data)||e.type).join(" ")}})}),this._columns=(0,l.A)(e=>({displayName:{title:e("ui.panel.config.developer-tools.tabs.statistics.data_table.name"),main:!0,sortable:!0,filterable:!0,flex:2},device:{title:e("ui.panel.config.entities.picker.headers.device"),sortable:!0,template:e=>e.device||""},device_full:{title:e("ui.panel.config.entities.picker.headers.device"),filterable:!0,groupable:!0,hidden:!0},area:(0,v.A7)(e),statistic_id:{title:e("ui.panel.config.developer-tools.tabs.statistics.data_table.statistic_id"),sortable:!0,filterable:!0,hidden:this.narrow},statistics_unit_of_measurement:{title:e("ui.panel.config.developer-tools.tabs.statistics.data_table.statistics_unit"),sortable:!0,filterable:!0,forceLTR:!0},source:{title:e("ui.panel.config.developer-tools.tabs.statistics.data_table.source"),sortable:!0,filterable:!0,groupable:!0},issues_string:{title:e("ui.panel.config.developer-tools.tabs.statistics.data_table.issue"),sortable:!0,filterable:!0,groupable:!0,direction:"asc",flex:2,template:t=>r.qy`${t.issues_string??e("ui.panel.config.developer-tools.tabs.statistics.no_issue")}`},fix:{title:"",label:e("ui.panel.config.developer-tools.tabs.statistics.fix_issue.fix"),type:"icon",template:t=>r.qy`${t.issues?r.qy`<ha-button @click="${this._fixIssue}" .data="${t.issues}" appearance="plain" size="small"> ${e(t.issues.some(e=>q.includes(e.type))?"ui.panel.config.developer-tools.tabs.statistics.fix_issue.fix":"ui.panel.config.developer-tools.tabs.statistics.fix_issue.info")} </ha-button>`:"—"}`,minWidth:"113px",maxWidth:"113px",showNarrow:!0},actions:{title:"",label:e("ui.panel.config.developer-tools.tabs.statistics.adjust_sum"),type:"icon-button",showNarrow:!0,template:t=>t.has_sum?r.qy` <ha-icon-button .label="${e("ui.panel.config.developer-tools.tabs.statistics.adjust_sum")}" .path="${O}" .statistic="${t}" @click="${this._showStatisticsAdjustSumDialog}"></ha-icon-button> `:r.s6}})),this._handleOverflowGroupBy=e=>{const t=e.detail.item.value;if(t)switch(t){case"collapse_all":return void this._collapseAllGroups();case"expand_all":return void this._expandAllGroups();case"none":return void this._setGroupColumn();default:this._setGroupColumn(t)}},this._clearSelected=async()=>{if(!this._selected.length)return;const e=this._selected;await(0,$.showConfirmationDialog)(this,{title:this._i18n.localize("ui.panel.config.developer-tools.tabs.statistics.multi_delete.title"),text:r.qy`${this._i18n.localize("ui.panel.config.developer-tools.tabs.statistics.multi_delete.info_text",{statistic_count:e.length})}`,confirmText:this._i18n.localize("ui.common.delete"),destructive:!0,confirm:async()=>{await(0,w.$3)(this._api,e),this._validateStatistics(),this._dataTable.clearSelection()}})},this._fixIssue=async e=>{const t=e.currentTarget.data.sort((e,t)=>(j[e.type]??99)-(j[t.type]??99))[0];await(0,k.c)(this,t),this._validateStatistics()}}}(0,s.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],I.prototype,"narrow",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"_data",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"filter",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"_selected",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"groupOrder",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"columnOrder",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"hiddenColumns",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"_sortColumn",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"_sortDirection",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"_groupColumn",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"_selectMode",void 0),(0,s.Cg)([(0,n.wk)(),(0,o.Fg)({context:y.Ie,subscribe:!0})],I.prototype,"_api",void 0),(0,s.Cg)([(0,n.wk)(),(0,o.Fg)({context:y.D5,subscribe:!0})],I.prototype,"_i18n",void 0),(0,s.Cg)([(0,n.wk)(),(0,o.Fg)({context:y.Hd,subscribe:!0})],I.prototype,"_registries",void 0),(0,s.Cg)([(0,n.wk)(),(0,o.Fg)({context:y.iN,subscribe:!0})],I.prototype,"_states",void 0),(0,s.Cg)([(0,n.P)("ha-data-table",!0)],I.prototype,"_dataTable",void 0),(0,s.Cg)([(0,n.P)("ha-input-search")],I.prototype,"_searchInput",void 0),I=(0,s.Cg)([(0,n.EM)("developer-tools-statistics")],I),a()}catch(e){a(e)}})},5936(e,t,i){i.d(t,{c:()=>r});var a=i(1087);const s=()=>Promise.all([i.e(32450),i.e(7305),i.e(92769),i.e(3283),i.e(80131),i.e(70183),i.e(72130),i.e(85010),i.e(83113),i.e(67218),i.e(58416),i.e(99788),i.e(58303),i.e(21543),i.e(66716),i.e(22398),i.e(82134),i.e(46601),i.e(47757),i.e(90600),i.e(26092),i.e(8851),i.e(19112),i.e(34310),i.e(30002),i.e(59704),i.e(25322),i.e(53480),i.e(90790),i.e(89747),i.e(59532),i.e(52487),i.e(55076),i.e(87692),i.e(36332),i.e(77563),i.e(15862),i.e(99143),i.e(41344),i.e(97500),i.e(66990),i.e(3025),i.e(87857),i.e(7421),i.e(38108),i.e(3361)]).then(i.bind(i,15251)),o=()=>Promise.all([i.e(81034),i.e(147),i.e(56121)]).then(i.bind(i,51744)),r=async(e,t)=>"units_changed"===t.type?((e,t)=>new Promise(i=>{const s=t.fixedCallback;(0,a.r)(e,"show-dialog",{dialogTag:"dialog-statistics-fix-units-changed",dialogImport:o,dialogParams:{...t,cancelCallback:()=>{i(!1)},fixedCallback:()=>{i(!0),s?.()}}})}))(e,{issue:t}):((e,t)=>new Promise(i=>{const o=t.fixedCallback;(0,a.r)(e,"show-dialog",{dialogTag:"dialog-statistics-fix",dialogImport:s,dialogParams:{...t,cancelCallback:()=>{i(!1)},fixedCallback:()=>{i(!0),o?.()}}})}))(e,{issue:t})},36959(e,t,i){i.d(t,{D:()=>o});var a=i(1087);const s=()=>Promise.all([i.e(95366),i.e(51448)]).then(i.bind(i,19691)),o=(e,t)=>{(0,a.r)(e,"show-dialog",{dialogTag:"dialog-statistics-adjust-sum",dialogImport:s,dialogParams:t})}},34128(e,t,i){i.d(t,{G9:()=>r,Ni:()=>o,Ue:()=>d,Vd:()=>h,gh:()=>p});i(74423);var a=i(1087),s=i(45291);const o=e=>{const t=document.createElement("hui-error-card");return customElements.get("hui-error-card")?t.setConfig(e):(Promise.resolve().then(i.bind(i,4397)),customElements.whenDefined("hui-error-card").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t},r=(e,t)=>({type:"error",error:e,origConfig:t}),n=(e,t)=>{const i=document.createElement(e);return i.setConfig(t),i},l=(e,t,a)=>"badge"===e?(e=>{const t=document.createElement("hui-error-badge");return customElements.get("hui-error-badge")?t.setConfig(e):(Promise.all([i.e(92769),i.e(3283),i.e(72130),i.e(85010),i.e(67218),i.e(58416),i.e(99788),i.e(22398),i.e(82134),i.e(26092),i.e(34310),i.e(59704),i.e(25322),i.e(90790),i.e(89747),i.e(59532),i.e(36332),i.e(77563),i.e(15862),i.e(99143),i.e(41344),i.e(12009),i.e(66990),i.e(3025),i.e(38108),i.e(66006),i.e(38260)]).then(i.bind(i,50655)),customElements.whenDefined("hui-error-badge").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t})(r(t,a)):"heading-badge"===e?(e=>{const t=document.createElement("hui-error-heading-badge");return customElements.get("hui-error-heading-badge")?t.setConfig(e):(Promise.all([i.e(92769),i.e(3283),i.e(72130),i.e(85010),i.e(67218),i.e(58416),i.e(99788),i.e(22398),i.e(82134),i.e(26092),i.e(34310),i.e(59704),i.e(25322),i.e(90790),i.e(89747),i.e(59532),i.e(36332),i.e(77563),i.e(15862),i.e(99143),i.e(41344),i.e(12009),i.e(66990),i.e(3025),i.e(38108),i.e(66006),i.e(21614)]).then(i.bind(i,13469)),customElements.whenDefined("hui-error-heading-badge").then(()=>{customElements.upgrade(t),t.setConfig(e)})),t})(((e,t)=>({type:"error",error:e,origConfig:t}))(t,a)):o({type:"error",message:t}),c=e=>(0,s.c8)(e)?(0,s.Iu)(e):void 0,d=(e,t,i,a,s,o)=>{try{return h(e,t,i,a,s,o)}catch(i){return console.error(e,t.type,i),l(e,i.message,t)}},h=(e,t,i,s,o,r)=>{if(!t||"object"!=typeof t)throw new Error("Config is not an object");if(!(t.type||r||o&&"entity"in t))throw new Error("No card type configured");const d=t.type?c(t.type):void 0;if(d)return((e,t,i)=>{if(customElements.get(t))return n(t,i);const s=l(e,`Custom element doesn't exist: ${t}.`,i);if(!t.includes("-"))return s;s.style.display="None";const o=window.setTimeout(()=>{s.style.display=""},2e3);return customElements.whenDefined(t).then(()=>{clearTimeout(o),(0,a.r)(s,"ll-rebuild")}),s})(e,d,t);let h;if(o&&!t.type&&t.entity){h=`${o[t.entity.split(".",1)[0]]||o._domain_not_found}-entity`}else h=t.type||r;if(void 0===h)throw new Error("No type specified");const p=`hui-${h}-${e}`;if(s&&h in s)return s[h](),((e,t)=>{if(customElements.get(e))return n(e,t);const i=document.createElement(e);return customElements.whenDefined(e).then(()=>{try{customElements.upgrade(i),(0,a.r)(i,"ll-upgrade"),i.setConfig(t)}catch(e){(0,a.r)(i,"ll-rebuild")}}),i})(p,t);if(i&&i.has(h))return n(p,t);throw new Error(`Unknown type encountered: ${h}`)},p=async(e,t,i,a)=>{const s=c(e);if(s){const e=customElements.get(s);if(e)return e;if(!s.includes("-"))throw new Error(`Custom element not found: ${s}`);return new Promise((e,t)=>{setTimeout(()=>t(new Error(`Custom element not found: ${s}`)),2e3),customElements.whenDefined(s).then(()=>e(customElements.get(s)))})}const o=`hui-${e}-${t}`,r=customElements.get(o);if(i&&i.has(e))return r;if(a&&e in a)return r||a[e]().then(()=>customElements.get(o));throw new Error(`Unknown type: ${e}`)}},94225(e,t,i){i.a(e,async function(e,a){try{i.d(t,{T:()=>w,t:()=>y});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var s=i(99799),o=i(29003),r=i(92055),n=i(19396),l=i(74323),c=i(51199),d=i(43721),h=i(65509),p=i(21659),u=i(82525),m=i(34128),g=e([s,o,r,n,l,c,d,h,p,u]);[s,o,r,n,l,c,d,h,p,u]=g.then?(await g)():g;const f=new Set(["media-player-entity","scene-entity","script-entity","sensor-entity","simple-entity","toggle-entity","button","call-service"]),b={"button-entity":()=>i.e(26846).then(i.bind(i,21869)),"climate-entity":()=>i.e(56995).then(i.bind(i,2798)),"cover-entity":()=>i.e(41243).then(i.bind(i,79734)),"date-entity":()=>i.e(17418).then(i.bind(i,75473)),"datetime-entity":()=>Promise.all([i.e(99194),i.e(81767)]).then(i.bind(i,69690)),"event-entity":()=>Promise.resolve().then(i.bind(i,99799)),"group-entity":()=>i.e(68827).then(i.bind(i,53110)),"input-button-entity":()=>i.e(19825).then(i.bind(i,46472)),"humidifier-entity":()=>i.e(378).then(i.bind(i,53537)),"input-datetime-entity":()=>i.e(71748).then(i.bind(i,1391)),"input-number-entity":()=>i.e(17600).then(i.bind(i,58723)),"input-select-entity":()=>i.e(44325).then(i.bind(i,54596)),"input-text-entity":()=>i.e(8086).then(i.bind(i,51765)),"lock-entity":()=>i.e(28245).then(i.bind(i,49748)),"number-entity":()=>i.e(71523).then(i.bind(i,57198)),"select-entity":()=>i.e(9374).then(i.bind(i,78157)),"text-entity":()=>i.e(67973).then(i.bind(i,58212)),"time-entity":()=>i.e(61331).then(i.bind(i,87550)),"timer-entity":()=>i.e(94097).then(i.bind(i,6344)),"update-entity":()=>i.e(80275).then(i.bind(i,38238)),"valve-entity":()=>i.e(96654).then(i.bind(i,46493)),conditional:()=>Promise.all([i.e(67218),i.e(77563),i.e(78490)]).then(i.bind(i,80725)),"weather-entity":()=>Promise.all([i.e(12009),i.e(77547)]).then(i.bind(i,80395)),divider:()=>i.e(45249).then(i.bind(i,38584)),section:()=>i.e(51255).then(i.bind(i,39082)),weblink:()=>i.e(69148).then(i.bind(i,65751)),cast:()=>i.e(10405).then(i.bind(i,96612)),buttons:()=>i.e(50777).then(i.bind(i,65728)),attribute:()=>Promise.resolve().then(i.bind(i,65509)),text:()=>i.e(95421).then(i.bind(i,3980))},_={_domain_not_found:"simple",alert:"toggle",automation:"toggle",button:"button",climate:"climate",cover:"cover",date:"date",datetime:"datetime",event:"event",fan:"toggle",group:"group",humidifier:"humidifier",input_boolean:"toggle",input_button:"input-button",input_datetime:"input-datetime",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",number:"number",remote:"toggle",scene:"scene",script:"script",select:"select",sensor:"sensor",siren:"toggle",switch:"toggle",text:"text",time:"time",timer:"timer",update:"update",vacuum:"toggle",valve:"valve",water_heater:"climate",weather:"weather"},w=e=>(0,m.Ue)("row",e,f,b,_,void 0),y=e=>(0,m.gh)(e,"row",f,b);a()}catch(e){a(e)}})},65213(e,t,i){var a=i(44576),s=i(79039),o=a.RegExp,r=!s(function(){var e=!0;try{o(".","d")}catch(t){e=!1}var t={},i="",a=e?"dgimsy":"gimsy",s=function(e,a){Object.defineProperty(t,e,{get:function(){return i+=a,!0}})},r={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var n in e&&(r.hasIndices="d"),r)s(n,r[n]);return Object.getOwnPropertyDescriptor(o.prototype,"flags").get.call(t)!==a||i!==a});e.exports={correct:r}},67979(e,t,i){var a=i(28551);e.exports=function(){var e=a(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},69479(e,t,i){var a=i(43724),s=i(62106),o=i(65213),r=i(67979);a&&!o.correct&&(s(RegExp.prototype,"flags",{configurable:!0,get:r}),o.correct=!0)},31886(e,t,i){i.a(e,async function(e,a){try{i.d(t,{BB:()=>s.B});i(38744);var s=i(88775),o=i(49232),r=i(78713),n=i(53834),l=i(35204),c=i(5806),d=e([s,o,r,n,l,c]);[s,o,r,n,l,c]=d.then?(await d)():d,a()}catch(e){a(e)}})},1126(e,t,i){i.a(e,async function(e,t){try{var a=i(5124),s=i(22441),o=i(6412),r=i(63672),n=i(17051),l=i(42462),c=i(28438),d=i(98779),h=i(27259),p=i(25877),u=i(31247),m=i(4444),g=i(92070),f=i(9395),b=i(717),_=i(17060),w=i(88496),y=i(57024),v=e([w,_]);[w,_]=v.then?(await v)():v;var C=Object.defineProperty,x=Object.getOwnPropertyDescriptor,$=(e,t,i,a)=>{for(var s,o=a>1?void 0:a?x(t,i):t,r=e.length-1;r>=0;r--)(s=e[r])&&(o=(a?s(t,i,o):s(o))||o);return a&&o&&C(t,i,o),o};let k=class extends b.A{firstUpdated(){a.S$||this.open&&(this.addOpenListeners(),this.drawer.showModal(),(0,m.JG)(this))}disconnectedCallback(){super.disconnectedCallback(),(0,m.I7)(this),this.removeOpenListeners()}async requestClose(e){const t=new c.L({source:e});if(this.dispatchEvent(t),t.defaultPrevented)return this.open=!0,void(0,h.Ud)(this.drawer,"pulse");this.removeOpenListeners(),await(0,h.Ud)(this.drawer,"hide"),this.open=!1,this.drawer.close(),(0,m.I7)(this);const i=this.originalTrigger;"function"==typeof i?.focus&&setTimeout(()=>i.focus()),this.dispatchEvent(new n.Z)}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown),(0,p.AZ)(this)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,p.Fw)(this)}handleDialogCancel(e){e.preventDefault(),!this.drawer.classList.contains("hide")&&e.target===this.drawer&&(0,p.a0)(this)&&this.requestClose(this.drawer)}handleDialogClick(e){const t=e.target.closest('[data-drawer="close"]');t&&(e.stopPropagation(),this.requestClose(t))}async handleDialogPointerDown(e){e.target===this.drawer&&(this.lightDismiss?this.requestClose(this.drawer):await(0,h.Ud)(this.drawer,"pulse"))}handleOpenChange(){this.open&&!this.drawer.open?this.show():this.drawer.open&&(this.open=!0,this.requestClose(this.drawer))}async show(){const e=new d.k;this.dispatchEvent(e),e.defaultPrevented?this.open=!1:(this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.drawer.showModal(),(0,m.JG)(this),requestAnimationFrame(()=>{const e=this.querySelector("[autofocus]");e&&"function"==typeof e.focus?e.focus():this.drawer.focus()}),await(0,h.Ud)(this.drawer,"show"),this.dispatchEvent(new l.q))}render(){const e=!this.withoutHeader,t=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return a.qy` <dialog aria-labelledby="${this.ariaLabelledby??"title"}" aria-describedby="${(0,r.J)(this.ariaDescribedby)}" part="dialog" class="${(0,o.H)({drawer:!0,open:this.open,top:"top"===this.placement,end:"end"===this.placement,bottom:"bottom"===this.placement,start:"start"===this.placement})}" @cancel="${this.handleDialogCancel}" @click="${this.handleDialogClick}" @pointerdown="${this.handleDialogPointerDown}"> ${e?a.qy` <header part="header" class="header"> <h2 part="title" class="title" id="title"> <slot name="label"> ${this.label.length>0?this.label:String.fromCharCode(8203)} </slot> </h2> <div part="header-actions" class="header-actions"> <slot name="header-actions"></slot> <wa-button part="close-button" exportparts="base:close-button__base" class="close" appearance="plain" @click="${e=>this.requestClose(e.target)}"> <wa-icon name="xmark" label="${this.localize.term("close")}" library="system" variant="solid"></wa-icon> </wa-button> </div> </header> `:""} <div part="body" class="body"><slot></slot></div> ${t?a.qy` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `:""} </dialog> `}constructor(){super(...arguments),this.localize=new _.c(this),this.hasSlotController=new g.X(this,"footer","header-actions","label"),this.open=!1,this.label="",this.placement="end",this.withoutHeader=!1,this.lightDismiss=!0,this.withFooter=!1,this.handleDocumentKeyDown=e=>{"Escape"===e.key&&this.open&&(0,p.a0)(this)&&(e.preventDefault(),e.stopPropagation(),this.requestClose(this.drawer))}}};k.css=y.A,$([(0,s.P)(".drawer")],k.prototype,"drawer",2),$([(0,s.MZ)({type:Boolean,reflect:!0})],k.prototype,"open",2),$([(0,s.MZ)({reflect:!0})],k.prototype,"label",2),$([(0,s.MZ)({reflect:!0})],k.prototype,"placement",2),$([(0,s.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],k.prototype,"withoutHeader",2),$([(0,s.MZ)({attribute:"light-dismiss",type:Boolean})],k.prototype,"lightDismiss",2),$([(0,s.MZ)({attribute:"aria-labelledby"})],k.prototype,"ariaLabelledby",2),$([(0,s.MZ)({attribute:"aria-describedby"})],k.prototype,"ariaDescribedby",2),$([(0,s.MZ)({attribute:"with-footer",type:Boolean})],k.prototype,"withFooter",2),$([(0,f.w)("open",{waitUntilFirstUpdate:!0})],k.prototype,"handleOpenChange",1),k=$([(0,s.EM)("wa-drawer")],k),a.S$||(document.addEventListener("click",e=>{const t=e.target.closest("[data-drawer]");if(t instanceof Element){const[e,i]=(0,u.v)(t.getAttribute("data-drawer")||"");if("open"===e&&i?.length){const e=t.getRootNode().getElementById(i);"wa-drawer"===e?.localName?e.open=!0:console.warn(`A drawer with an ID of "${i}" could not be found in this document.`)}}}),document.addEventListener("pointerdown",()=>{})),t()}catch(e){t(e)}})},57024(e,t,i){i.d(t,{A:()=>a});var a=i(5124).AH`:host{--size:25rem;--spacing:var(--wa-space-l);--backdrop-filter:none;--show-duration:200ms;--hide-duration:200ms;display:none}:host([open]){display:block}.drawer{display:flex;flex-direction:column;top:0;inset-inline-start:0;width:100%;height:100%;max-width:100%;max-height:100%;overflow:hidden;color:inherit;background-color:var(--wa-color-surface-raised);border:none;box-shadow:var(--wa-shadow-l);overflow:auto;padding:0;margin:0;animation-duration:var(--show-duration);animation-timing-function:ease}.drawer.show::backdrop{animation:show-backdrop var(--show-duration,200ms) ease}.drawer.hide::backdrop{animation:show-backdrop var(--hide-duration,200ms) ease reverse}.drawer.show.top{animation:show-drawer-from-top var(--show-duration) ease}.drawer.hide.top{animation:show-drawer-from-top var(--hide-duration) ease reverse}.drawer.show.end{animation:show-drawer-from-end var(--show-duration) ease}.drawer.show.end:dir(rtl){animation-name:show-drawer-from-start}.drawer.hide.end{animation:show-drawer-from-end var(--hide-duration) ease reverse}.drawer.hide.end:dir(rtl){animation-name:show-drawer-from-start}.drawer.show.bottom{animation:show-drawer-from-bottom var(--show-duration) ease}.drawer.hide.bottom{animation:show-drawer-from-bottom var(--hide-duration) ease reverse}.drawer.show.start{animation:show-drawer-from-start var(--show-duration) ease}.drawer.show.start:dir(rtl){animation-name:show-drawer-from-end}.drawer.hide.start{animation:show-drawer-from-start var(--hide-duration) ease reverse}.drawer.hide.start:dir(rtl){animation-name:show-drawer-from-end}.drawer.pulse{animation:pulse 250ms ease}.drawer:focus{outline:0}.top{top:0;inset-inline-end:auto;bottom:auto;inset-inline-start:0;width:100%;height:var(--size)}.end{top:0;inset-inline-end:0;bottom:auto;inset-inline-start:auto;width:var(--size);height:100%}.bottom{top:auto;inset-inline-end:auto;bottom:0;inset-inline-start:0;width:100%;height:var(--size)}.start{top:0;inset-inline-end:auto;bottom:auto;inset-inline-start:0;width:var(--size);height:100%}.header{display:flex;flex-wrap:nowrap;padding-inline-start:var(--spacing);padding-block-end:0;padding-inline-end:calc(var(--spacing) - var(--wa-form-control-padding-block));padding-block-start:calc(var(--spacing) - var(--wa-form-control-padding-block))}.title{align-self:center;flex:1 1 auto;font:inherit;font-size:var(--wa-font-size-l);font-weight:var(--wa-font-weight-heading);line-height:var(--wa-line-height-condensed);margin:0}.header-actions{align-self:start;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:end;gap:var(--wa-space-2xs);padding-inline-start:var(--spacing)}.header-actions ::slotted(wa-button),.header-actions wa-button{flex:0 0 auto;display:flex;align-items:center}.body{flex:1 1 auto;display:block;padding:var(--spacing);overflow:auto;-webkit-overflow-scrolling:touch}.body:focus{outline:0}.body:focus-visible{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}.footer{display:flex;flex-wrap:wrap;gap:var(--wa-space-xs);justify-content:end;padding:var(--spacing);padding-block-start:0}.footer ::slotted(wa-button:not(:last-of-type)){margin-inline-end:var(--wa-spacing-xs)}.drawer::backdrop{background-color:var(--wa-color-overlay-modal,rgb(0 0 0 / .25));-webkit-backdrop-filter:var(--backdrop-filter);backdrop-filter:var(--backdrop-filter)}@keyframes pulse{0%{scale:1}50%{scale:1.01}100%{scale:1}}@keyframes show-drawer{from{opacity:0;scale:0.8}to{opacity:1;scale:1}}@keyframes show-drawer-from-top{from{opacity:0;translate:0 -100%}to{opacity:1;translate:0 0}}@keyframes show-drawer-from-end{from{opacity:0;translate:100%}to{opacity:1;translate:0 0}}@keyframes show-drawer-from-bottom{from{opacity:0;translate:0 100%}to{opacity:1;translate:0 0}}@keyframes show-drawer-from-start{from{opacity:0;translate:-100% 0}to{opacity:1;translate:0 0}}@keyframes show-backdrop{from{opacity:0}to{opacity:1}}@media (forced-colors:active){.drawer{border:solid 1px #fff}}`}};