export const __rspack_esm_id=5023;export const __rspack_esm_ids=[5023];export const __webpack_modules__={96682(e,t,i){const s="unavailable",o="unknown",a=[s,o,"off"];(0,i(5443).g)(a);i.d(t,{},{HV:o,Hh:s})},31202(e,t,i){var s=i(15697),o=i(79224),a=i(90789),n=(i(44114),i(18111),i(61701),i(13579),i(45367),i(92731),i(87160)),r=i(45602),d=i(13239),c=i(96682);const _=(e,t,i)=>{const s=((e,t,i)=>{const s=[];for(const o of Object.values(e)){if("infrared"!==(0,r.m)(o.entity_id))continue;const a=t[o.entity_id],n=a?.attributes.device_class;if("emitter"!==n&&"receiver"!==n)continue;const _=a.state!==c.Hh;let h;if(a.state!==c.Hh&&a.state!==c.HV){const e=new Date(a.state).getTime();isNaN(e)||(h=a.state)}s.push({entity_id:o.entity_id,device_id:o.device_id??null,name:(0,d.aH)(a,e,i)||o.entity_id,type:n,online:_,last_used:h})}return s})(e,t,i),o=new Map;for(const e of s){const t=e.device_id??`entity:${e.entity_id}`,i=o.get(t);i?i.push(e):o.set(t,[e])}return Array.from(o.values(),e=>{const t=e.some(e=>"emitter"===e.type),s=e.some(e=>"receiver"===e.type),o=t&&s?"both":t?"emitter":"receiver",a=e.some(e=>e.online);let r;for(const t of e)t.last_used&&(!r||new Date(t.last_used).getTime()>new Date(r).getTime())&&(r=t.last_used);const{device_id:d}=e[0],c=d?i[d]:void 0,_=c&&(0,n.xn)(c)||e[0].name;return{id:d??e[0].entity_id,device_id:d,name:_,type:o,online:a,last_used:r,entity_ids:e.map(e=>e.entity_id)}})};var h=i(99061);class l extends h.a{updatePageEl(e){e.route=this.routeTail,e.hass=this.hass,e.isWide=this.isWide,e.narrow=this.narrow,e.devices=this._devices(this.hass.entities,this.hass.states,this.hass.devices)}constructor(...e){super(...e),this.isWide=!1,this.narrow=!1,this.routerOptions={defaultPage:"dashboard",showLoading:!0,routes:{dashboard:{tag:"infrared-config-dashboard",load:()=>Promise.all([i.e(5933),i.e(94251),i.e(38448)]).then(i.bind(i,86899))},devices:{tag:"infrared-devices-page",load:()=>Promise.all([i.e(4801),i.e(98870),i.e(5933),i.e(13049),i.e(10255),i.e(73142),i.e(54600),i.e(35471),i.e(57425),i.e(79337),i.e(69894)]).then(i.bind(i,46017))}}},this._devices=(0,a.A)((e,t,i)=>_(e,t,i))}}(0,s.Cg)([(0,o.MZ)({attribute:!1})],l.prototype,"hass",void 0),(0,s.Cg)([(0,o.MZ)({attribute:"is-wide",type:Boolean})],l.prototype,"isWide",void 0),(0,s.Cg)([(0,o.MZ)({type:Boolean})],l.prototype,"narrow",void 0),l=(0,s.Cg)([(0,o.EM)("infrared-config-dashboard-router")],l)}};
//# sourceMappingURL=5023.246e93d5c18b84b1.js.map