diff --git a/dist/mushroom-strategy.js b/dist/mushroom-strategy.js index d66857b..0d61fc0 100644 --- a/dist/mushroom-strategy.js +++ b/dist/mushroom-strategy.js @@ -1 +1 @@ -(()=>{var e={744:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===r}(e)}(e)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?n((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function a(e,t,r){return e.concat(t).map((function(e){return i(e,r)}))}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function s(e,t){try{return t in e}catch(e){return!1}}function n(e,r,c){(c=c||{}).arrayMerge=c.arrayMerge||a,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=i;var d=Array.isArray(r);return d===Array.isArray(e)?d?c.arrayMerge(e,r,c):function(e,t,r){var a={};return r.isMergeableObject(e)&&o(e).forEach((function(t){a[t]=i(e[t],r)})),o(t).forEach((function(o){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(s(e,o)&&r.isMergeableObject(t[o])?a[o]=function(e,t){if(!t.customMerge)return n;var r=t.customMerge(e);return"function"==typeof r?r:n}(o,r)(e[o],t[o],r):a[o]=i(t[o],r))})),a}(e,r,c):i(r,c)}n.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return n(e,r,t)}),{})};var c=n;e.exports=c},183:(e,t,r)=>{"use strict";r.d(t,{H:()=>v});const i={areas:{undisclosed:{aliases:[],area_id:"undisclosed",name:"Undisclosed",picture:null,hidden:!1}},debug:!1,domains:{_:{hide_config_entities:!1},default:{title:"Miscellaneous",showControls:!1,hidden:!1},light:{title:"Lights",showControls:!0,iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off",hidden:!1},fan:{title:"Fans",showControls:!0,iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off",hidden:!1},cover:{title:"Covers",showControls:!0,iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover",hidden:!1},switch:{title:"Switches",showControls:!0,iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off",hidden:!1},camera:{title:"Cameras",showControls:!1,hidden:!1},lock:{title:"Locks",showControls:!1,hidden:!1},climate:{title:"Climates",showControls:!1,hidden:!1},media_player:{title:"Media Players",showControls:!1,hidden:!1},sensor:{title:"Sensors",showControls:!1,hidden:!1},binary_sensor:{title:"Binary Sensors",showControls:!1,hidden:!1},number:{title:"Numbers",showControls:!1,hidden:!1},vacuum:{title:"Vacuums",showControls:!0,hidden:!1},select:{title:"Selects",showControls:!1,hidden:!1},input_select:{title:"Input Selects",showControls:!1,hidden:!1}},home_view:{hidden:[]},views:{home:{order:1,hidden:!1},light:{order:2,hidden:!1},fan:{order:3,hidden:!1},cover:{order:4,hidden:!1},switch:{order:5,hidden:!1},climate:{order:6,hidden:!1},camera:{order:7,hidden:!1},vacuum:{order:8,hidden:!1}}};var a,o,s,n,c,d,l,h,f,u,p=r(744),w=r.n(p),m=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},g=function(e,t,r,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,r):a?a.value=r:t.set(e,r),r};class v{constructor(){throw new Error("This class should be invoked with method initialize() instead of using the keyword new!")}static get strategyOptions(){return m(this,a,"f",l)}static get areas(){return m(this,a,"f",n)}static get devices(){return m(this,a,"f",s)}static get entities(){return m(this,a,"f",o)}static get debug(){return m(this,a,"f",h)}static async initialize(e){g(this,a,e.hass.states,"f",c),g(this,a,w()(i,e.config?.strategy?.options??{}),"f",l),g(this,a,m(this,a,"f",l).debug,"f",h);try{[{set value(e){g(a,a,e,"f",o)}}.value,{set value(e){g(a,a,e,"f",s)}}.value,{set value(e){g(a,a,e,"f",n)}}.value]=await Promise.all([e.hass.callWS({type:"config/entity_registry/list"}),e.hass.callWS({type:"config/device_registry/list"}),e.hass.callWS({type:"config/area_registry/list"})])}catch(e){throw a.logError("An error occurred while querying Home assistant's registries!",e),"Check the console for details"}m(this,a,"f",l).areas.undisclosed?.hidden||(m(this,a,"f",l).areas.undisclosed={...i.areas.undisclosed,...m(this,a,"f",l).areas.undisclosed},m(this,a,"f",l).areas.undisclosed.area_id="undisclosed",m(this,a,"f",n).push(m(this,a,"f",l).areas.undisclosed)),g(this,a,a.areas.map((e=>({...e,...m(this,a,"f",l).areas?.[e.area_id]}))),"f",n),m(this,a,"f",n).sort(((e,t)=>(e.order??1/0)-(t.order??1/0)||e.name.localeCompare(t.name))),m(this,a,"f",l).views=Object.fromEntries(Object.entries(m(this,a,"f",l).views).sort((([,e],[,t])=>(e.order??1/0)-(t.order??1/0)||(e.title??"undefined").localeCompare(t.title??"undefined")))),m(this,a,"f",l).domains=Object.fromEntries(Object.entries(m(this,a,"f",l).domains).sort((([,e],[,t])=>(e.order??1/0)-(t.order??1/0)||(e.title??"undefined").localeCompare(t.title??"undefined")))),g(this,a,!0,"f",d)}static isInitialized(){return m(this,a,"f",d)}static getCountTemplate(e,t,r){const i=[];this.isInitialized()||console.warn("Helper class should be initialized before calling this method!");for(const t of m(this,a,"f",n)){const r=m(this,a,"f",s).filter((e=>e.area_id===t.area_id)).map((e=>e.id)),n=m(this,a,"f",o).filter(m(this,a,"m",f),{area:t,domain:e,areaDeviceIds:r}).map((e=>`states['${e.entity_id}']`));i.push(...n)}return`{% set entities = [${i}] %} {{ entities | selectattr('state','${t}','${r}') | list | count }}`}static getDeviceEntities(e,t){this.isInitialized()||console.warn("Helper class should be initialized before calling this method!");const r=m(this,a,"f",s).filter((t=>(t.area_id??"undisclosed")===e.area_id)).map((e=>e.id));return m(this,a,"f",o).filter(m(this,a,"m",f),{area:e,domain:t,areaDeviceIds:r}).sort(((e,t)=>(e.original_name??"undefined").localeCompare(t.original_name??"undefined")))}static getStateEntities(e,t){this.isInitialized()||console.warn("Helper class should be initialized before calling this method!");const r=[],i=Object.fromEntries(m(this,a,"f",o).map((e=>[e.entity_id,e]))),n=Object.fromEntries(m(this,a,"f",s).map((e=>[e.id,e]))),d=Object.values(m(this,a,"f",c)).filter((e=>e.entity_id.startsWith(`${t}.`)));for(const t of d){const a=i[t.entity_id],o=n[a?.device_id??""];(a?.area_id===e.area_id||o&&o.area_id===e.area_id)&&r.push(t)}return r}static sanitizeClassName(e){return(e=e.charAt(0).toUpperCase()+e.slice(1)).replace(/([-_][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_","")))}static getExposedViewIds(){return this.isInitialized()||console.warn("Helper class should be initialized before calling this method!"),m(this,a,"m",u).call(this,m(this,a,"f",l).views,"hidden",!1)}static getExposedDomainIds(){return this.isInitialized()||console.warn("Helper class should be initialized before calling this method!"),m(this,a,"m",u).call(this,m(this,a,"f",l).domains,"hidden",!1)}static logError(e,t){a.debug?console.error(e,t):console.error(e)}}a=v,f=function(e){const t=null===e.hidden_by&&null===e.disabled_by,r=e.entity_id.startsWith(`${this.domain}.`),i="undisclosed"===this.area.area_id?!e.area_id&&(this.areaDeviceIds.includes(e.device_id??"")||!e.device_id):e.area_id===this.area.area_id||!e.area_id&&this.areaDeviceIds.includes(e.device_id??"");return t&&r&&i},u=function(e,t,r){const i=[];for(const a of Object.keys(e))e[a][t]===r&&i.push(a);return i},o={value:void 0},s={value:void 0},n={value:[]},c={value:void 0},d={value:!1},l={value:void 0},h={value:void 0}},818:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbstractCard:()=>a});var i=r(183);class a{constructor(e){if(this.config={type:"custom:mushroom-entity-card",icon:"mdi:help-circle"},!i.H.isInitialized())throw new Error("The Helper module must be initialized before using this one.");this.entity=e}getCard(){return{...this.config,entity:"entity_id"in this.entity?this.entity.entity_id:void 0}}}},301:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AreaCard:()=>s});var i,a=r(818),o=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class s extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-template-card",primary:void 0,icon:"mdi:texture-box",icon_color:"blue",tap_action:{action:"navigate",navigation_path:""},hold_action:{action:"none"}}),"default"===t.type&&delete t.type,o(this,i,"f").primary=e.name,o(this,i,"f").tap_action&&"navigation_path"in o(this,i,"f").tap_action&&(o(this,i,"f").tap_action.navigation_path=e.area_id),this.config=Object.assign(this.config,o(this,i,"f"),t)}}i=new WeakMap},151:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BinarySensorCard:()=>o});var i,a=r(982);class o extends a.SensorCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-entity-card",icon:"mdi:power-cycle",icon_color:"green"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},723:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CameraCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{entity:"",type:"picture-entity",show_name:!1,show_state:!1,camera_view:"live"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},721:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ClimateCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-climate-card",icon:void 0,hvac_modes:["off","cool","heat","fan_only"],show_temperature_control:!0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},896:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ControllerCard:()=>n});var i,a,o=function(e,t,r,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,r):a?a.value=r:t.set(e,r),r},s=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class n{constructor(e,t={}){i.set(this,void 0),a.set(this,{type:"mushroom-title-card",showControls:!0,iconOn:"mdi:power-on",iconOff:"mdi:power-off",onService:"none",offService:"none"}),o(this,i,e,"f"),o(this,a,{...s(this,a,"f"),...t},"f")}createCard(){const e=[{type:"custom:mushroom-title-card",title:s(this,a,"f").title,subtitle:s(this,a,"f").subtitle}];return s(this,a,"f").showControls&&e.push({type:"horizontal-stack",cards:[{type:"custom:mushroom-template-card",icon:s(this,a,"f").iconOff,layout:"vertical",icon_color:"red",tap_action:{action:"call-service",service:s(this,a,"f").offService,target:s(this,i,"f"),data:{}}},{type:"custom:mushroom-template-card",icon:s(this,a,"f").iconOn,layout:"vertical",icon_color:"amber",tap_action:{action:"call-service",service:s(this,a,"f").onService,target:s(this,i,"f"),data:{}}}]}),{type:"horizontal-stack",cards:e}}}i=new WeakMap,a=new WeakMap},33:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CoverCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-cover-card",icon:void 0,show_buttons_control:!0,show_position_control:!0,show_tilt_position_control:!0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},667:(e,t,r)=>{"use strict";r.r(t),r.d(t,{FanCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-fan-card",icon:void 0,show_percentage_control:!0,show_oscillate_control:!0,icon_animation:!0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},42:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AreaCard:()=>s});var i,a=r(818),o=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class s extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"area",area:""}),o(this,i,"f").area=e.area_id,o(this,i,"f").navigation_path=o(this,i,"f").area,delete t.type,this.config=Object.assign(this.config,o(this,i,"f"),t)}}i=new WeakMap},810:(e,t,r)=>{"use strict";r.r(t),r.d(t,{InputSelectCard:()=>o});var i,a=r(212);class o extends a.SelectCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-select-card",icon:void 0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},254:(e,t,r)=>{"use strict";r.r(t),r.d(t,{LightCard:()=>d});var i,a=r(818),o=r(843),s=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},n=o.M.isCallServiceActionConfig,c=o.M.isCallServiceActionTarget;class d extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-light-card",icon:void 0,show_brightness_control:!0,show_color_control:!0,show_color_temp_control:!0,use_light_color:!0,double_tap_action:{action:"call-service",service:"light.turn_on",target:{entity_id:void 0},data:{rgb_color:[255,255,255]}}}),n(s(this,i,"f").double_tap_action)&&c(s(this,i,"f").double_tap_action.target)&&(s(this,i,"f").double_tap_action.target.entity_id=e.entity_id),this.config=Object.assign(this.config,s(this,i,"f"),t)}}i=new WeakMap},936:(e,t,r)=>{"use strict";r.r(t),r.d(t,{LockCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-lock-card",icon:void 0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},879:(e,t,r)=>{"use strict";r.r(t),r.d(t,{MediaPlayerCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-media-player-card",use_media_info:!0,media_controls:["on_off","play_pause_stop"],show_volume_level:!0,volume_controls:["volume_mute","volume_set","volume_buttons"]}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},486:(e,t,r)=>{"use strict";r.r(t),r.d(t,{MiscellaneousCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-entity-card",icon_color:"blue-grey"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},137:(e,t,r)=>{"use strict";r.r(t),r.d(t,{NumberCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-number-card",icon:void 0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},845:(e,t,r)=>{"use strict";r.r(t),r.d(t,{PersonCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-person-card",layout:"vertical",primary_info:"none",secondary_info:"none",icon_type:"entity-picture"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},212:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SelectCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-select-card",icon:void 0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},982:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SensorCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-entity-card",icon:"mdi:information",animate:!0,line_color:"green"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},708:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SwitchCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-entity-card",icon:void 0,tap_action:{action:"toggle"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},430:(e,t,r)=>{"use strict";r.r(t),r.d(t,{VacuumCard:()=>s});var i=r(818);const a=["on_off","start_pause","stop","locate","clean_spot","return_home"];var o;class s extends i.AbstractCard{constructor(e,t={}){super(e),o.set(this,{type:"custom:mushroom-vacuum-card",icon:void 0,icon_animation:!0,commands:[...a],tap_action:{action:"more-info"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,o,"f"),t)}}o=new WeakMap},222:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbstractChip:()=>o});var i=r(183),a=r(843).M.isCallServiceActionConfig;class o{constructor(){if(this.config={type:"template"},!i.H.isInitialized())throw new Error("The Helper module must be initialized before using this one.")}getChip(){return this.config}setTapActionTarget(e){"tap_action"in this.config&&a(this.config.tap_action)?this.config.tap_action.target=e:i.H.debug&&console.warn(this.constructor.name+" - Target not set: Invalid target or tap action.")}}},757:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ClimateChip:()=>s});var i,a=r(183),o=r(222);class s extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:thermostat",icon_color:"orange",content:a.H.getCountTemplate("climate","ne","off"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"climates"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},589:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CoverChip:()=>s});var i,a=r(183),o=r(222);class s extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:window-open",icon_color:"cyan",content:a.H.getCountTemplate("cover","eq","open"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"covers"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},867:(e,t,r)=>{"use strict";r.r(t),r.d(t,{FanChip:()=>s});var i,a=r(183),o=r(222);class s extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:fan",icon_color:"green",content:a.H.getCountTemplate("fan","eq","on"),tap_action:{action:"call-service",service:"fan.turn_off"},hold_action:{action:"navigate",navigation_path:"fans"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},741:(e,t,r)=>{"use strict";r.r(t),r.d(t,{LightChip:()=>s});var i,a=r(183),o=r(222);class s extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:lightbulb-group",icon_color:"amber",content:a.H.getCountTemplate("light","eq","on"),tap_action:{action:"call-service",service:"light.turn_off"},hold_action:{action:"navigate",navigation_path:"lights"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},908:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SwitchChip:()=>s});var i,a=r(183),o=r(222);class s extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:dip-switch",icon_color:"blue",content:a.H.getCountTemplate("switch","eq","on"),tap_action:{action:"call-service",service:"switch.turn_off"},hold_action:{action:"navigate",navigation_path:"switches"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},778:(e,t,r)=>{"use strict";r.r(t),r.d(t,{WeatherChip:()=>s});var i,a=r(222),o=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class s extends a.AbstractChip{constructor(e,t={}){super(),i.set(this,{type:"weather",show_temperature:!0,show_conditions:!0}),function(e,t,r,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===i?a.call(e,r):a?a.value=r:t.set(e,r)}(this,i,{...o(this,i,"f"),entity:e,...t},"f"),this.config=Object.assign(this.config,o(this,i,"f"),t)}}i=new WeakMap},843:(e,t,r)=>{"use strict";var i;r.d(t,{M:()=>i}),function(e){e.isCallServiceActionConfig=function(e){return e&&"call-service"===e.action&&["action","service"].every((t=>t in e))},e.isCallServiceActionTarget=function(e){return e&&["entity_id","device_id","area_id"].some((t=>t in e))}}(i||(i={}))},122:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbstractView:()=>n});var i,a=r(183),o=r(896),s=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class n{constructor(e=""){if(this.config={icon:"mdi:view-dashboard",subview:!1},this.viewControllerCard={cards:[],type:""},i.set(this,void 0),!a.H.isInitialized())throw new Error("The Helper module must be initialized before using this one.");e&&function(e,t,r,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===i?a.call(e,r):a?a.value=r:t.set(e,r)}(this,i,e,"f")}async createViewCards(){const e=[],t=a.H.strategyOptions.domains[s(this,i,"f")??"_"].hide_config_entities||a.H.strategyOptions.domains._.hide_config_entities;for(const n of a.H.areas){const c=[],d=a.H.getDeviceEntities(n,s(this,i,"f")??""),l=a.H.sanitizeClassName(s(this,i,"f")+"Card"),h=await r(560)(`./${l}`);let f={area_id:[n.area_id]};"undisclosed"===n.area_id&&(f={entity_id:d.map((e=>e.entity_id))});for(const e of d){let r=a.H.strategyOptions.card_options?.[e.entity_id],i=a.H.strategyOptions.card_options?.[e.device_id??"null"];r?.hidden||i?.hidden||"config"===e.entity_category&&t||c.push(new h[l](e,r).getCard())}if(c.length){const t="controllerCardOptions"in this.config?this.config.controllerCardOptions:{};c.unshift(new o.ControllerCard(f,Object.assign({title:n.name},t)).createCard()),e.push({type:"vertical-stack",cards:c})}}return e.length&&e.unshift(this.viewControllerCard),e}async getView(){return{...this.config,cards:await this.createViewCards()}}targetDomain(e){return{entity_id:a.H.entities.filter((t=>t.entity_id.startsWith(e+".")&&!t.hidden_by&&!a.H.strategyOptions.card_options?.[t.entity_id]?.hidden)).map((e=>e.entity_id))}}}i=new WeakMap},255:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CameraView:()=>h});var i,a,o,s,n=r(896),c=r(122),d=r(183),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends c.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Cameras",path:"cameras",icon:"mdi:cctv",subview:!1,controllerCardOptions:{showControls:!1}}),s.set(this,{title:"All Cameras",subtitle:d.H.getCountTemplate(l(i,i,"f",a),"ne","off")+" cameras on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new n.ControllerCard({},{...l(this,s,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,s=new WeakMap,a={value:"camera"}},559:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ClimateView:()=>h});var i,a,o,s,n=r(183),c=r(896),d=r(122),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Climates",path:"climates",icon:"mdi:thermostat",subview:!1,controllerCardOptions:{showControls:!1}}),s.set(this,{title:"All Climates",subtitle:n.H.getCountTemplate(l(i,i,"f",a),"ne","off")+" climates on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,s,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,s=new WeakMap,a={value:"climate"}},547:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CoverView:()=>h});var i,a,o,s,n=r(183),c=r(896),d=r(122),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Covers",path:"covers",icon:"mdi:window-open",subview:!1,controllerCardOptions:{iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover"}}),s.set(this,{title:"All Covers",subtitle:n.H.getCountTemplate(l(i,i,"f",a),"eq","open")+" covers open"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,s,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,s=new WeakMap,a={value:"cover"}},245:(e,t,r)=>{"use strict";r.r(t),r.d(t,{FanView:()=>h});var i,a,o,s,n=r(183),c=r(896),d=r(122),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Fans",path:"fans",icon:"mdi:fan",subview:!1,controllerCardOptions:{iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off"}}),s.set(this,{title:"All Fans",subtitle:n.H.getCountTemplate(l(i,i,"f",a),"eq","on")+" fans on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,s,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,s=new WeakMap,a={value:"fan"}},31:(e,t,r)=>{"use strict";r.r(t),r.d(t,{HomeView:()=>h});var i,a,o,s,n,c=r(183),d=r(122),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(),i.add(this),a.set(this,{title:"Home",icon:"mdi:home-assistant",path:"home",subview:!1}),this.config=Object.assign(this.config,l(this,a,"f"),e)}async createViewCards(){return await Promise.all([l(this,i,"m",o).call(this),l(this,i,"m",s).call(this),l(this,i,"m",n).call(this)]).then((([e,t,r])=>{const i=c.H.strategyOptions,a=[];return e.length&&a.push({type:"custom:mushroom-chips-card",alignment:"center",chips:e}),t.length&&a.push({type:"horizontal-stack",cards:t}),c.H.strategyOptions.home_view.hidden.includes("greeting")||a.push({type:"custom:mushroom-template-card",primary:"{% set time = now().hour %} {% if (time >= 18) %} Good Evening, {{user}}! {% elif (time >= 12) %} Good Afternoon, {{user}}! {% elif (time >= 5) %} Good Morning, {{user}}! {% else %} Hello, {{user}}! {% endif %}",icon:"mdi:hand-wave",icon_color:"orange",tap_action:{action:"none"},double_tap_action:{action:"none"},hold_action:{action:"none"}}),i.quick_access_cards&&a.push(...i.quick_access_cards),a.push({type:"vertical-stack",cards:r}),i.extra_cards&&a.push(...i.extra_cards),a}))}}a=new WeakMap,i=new WeakSet,o=async function(){if(c.H.strategyOptions.home_view.hidden.includes("chips"))return[];const e=[],t=c.H.strategyOptions.chips,i=["light","fan","cover","switch","climate"],a=c.H.areas.map((e=>e.area_id??""));let o;const s=t?.weather_entity??c.H.entities.find((e=>e.entity_id.startsWith("weather.")&&null===e.disabled_by&&null===e.hidden_by))?.entity_id;if(s)try{o=await Promise.resolve().then(r.bind(r,778));const t=new o.WeatherChip(s);e.push(t.getChip())}catch(e){c.H.logError("An error occurred while creating the weather chip!",e)}for(let s of i)if(t?.[`${s}_count`]??1){const t=c.H.sanitizeClassName(s+"Chip");try{o=await r(216)(`./${t}`);const i=new o[t];i.setTapActionTarget({area_id:a}),e.push(i.getChip())}catch(e){c.H.logError(`An error occurred while creating the ${s} chip!`,e)}}return t?.extra_chips&&e.push(...t.extra_chips),e},s=function(){if(c.H.strategyOptions.home_view.hidden.includes("persons"))return[];const e=[];return Promise.resolve().then(r.bind(r,845)).then((t=>{for(const r of c.H.entities.filter((e=>e.entity_id.startsWith("person.")&&null==e.hidden_by&&null==e.disabled_by)))e.push(new t.PersonCard(r).getCard())})),e},n=async function(){if(c.H.strategyOptions.home_view.hidden.includes("areas"))return[];const e=[];let t=[];c.H.strategyOptions.home_view.hidden.includes("areasTitle")||e.push({type:"custom:mushroom-title-card",title:"Areas"});for(const[i,a]of c.H.areas.entries()){let o,s=c.H.strategyOptions.areas[a.area_id]?.type??c.H.strategyOptions.areas._?.type??"default";try{o=await r(560)(`./${s}`)}catch(e){o=await Promise.resolve().then(r.bind(r,301)),c.H.strategyOptions.debug&&"default"!==s&&console.error(e)}if(!c.H.strategyOptions.areas[a.area_id]?.hidden){let e={...c.H.strategyOptions.areas._,...c.H.strategyOptions.areas[a.area_id]};t.push(new o.AreaCard(a,e).getCard())}if(i===c.H.areas.length-1)for(let r=0;r{"use strict";r.r(t),r.d(t,{LightView:()=>h});var i,a,o,s,n=r(183),c=r(896),d=r(122),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Lights",path:"lights",icon:"mdi:lightbulb-group",subview:!1,controllerCardOptions:{iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off"}}),s.set(this,{title:"All Lights",subtitle:n.H.getCountTemplate(l(i,i,"f",a),"eq","on")+" lights on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,s,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,s=new WeakMap,a={value:"light"}},464:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SwitchView:()=>h});var i,a,o,s,n=r(183),c=r(896),d=r(122),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Switches",path:"switches",icon:"mdi:dip-switch",subview:!1,controllerCardOptions:{iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off"}}),s.set(this,{title:"All Switches",subtitle:n.H.getCountTemplate(l(i,i,"f",a),"eq","on")+" switches on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,s,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,s=new WeakMap,a={value:"switch"}},499:(e,t,r)=>{"use strict";r.r(t),r.d(t,{VacuumView:()=>h});var i,a,o,s,n=r(183),c=r(896),d=r(122),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Vacuums",path:"vacuums",icon:"mdi:robot-vacuum",subview:!1,controllerCardOptions:{iconOn:"mdi:robot-vacuum",iconOff:"mdi:robot-vacuum-off",onService:"vacuum.start",offService:"vacuum.stop"}}),s.set(this,{title:"All Vacuums",subtitle:n.H.getCountTemplate(l(i,i,"f",a),"ne","off")+" vacuums on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,s,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,s=new WeakMap,a={value:"vacuum"}},560:(e,t,r)=>{var i={"./AbstractCard":[818],"./AbstractCard.ts":[818],"./AreaCard":[301,792],"./AreaCard.ts":[301,792],"./BinarySensorCard":[151,792],"./BinarySensorCard.ts":[151,792],"./CameraCard":[723,792],"./CameraCard.ts":[723,792],"./ClimateCard":[721,792],"./ClimateCard.ts":[721,792],"./ControllerCard":[896],"./ControllerCard.ts":[896],"./CoverCard":[33,792],"./CoverCard.ts":[33,792],"./FanCard":[667,792],"./FanCard.ts":[667,792],"./HaAreaCard":[42,792],"./HaAreaCard.ts":[42,792],"./InputSelectCard":[810,792],"./InputSelectCard.ts":[810,792],"./LightCard":[254,792],"./LightCard.ts":[254,792],"./LockCard":[936,792],"./LockCard.ts":[936,792],"./MediaPlayerCard":[879,792],"./MediaPlayerCard.ts":[879,792],"./MiscellaneousCard":[486,792],"./MiscellaneousCard.ts":[486,792],"./NumberCard":[137,792],"./NumberCard.ts":[137,792],"./PersonCard":[845,792],"./PersonCard.ts":[845,792],"./SelectCard":[212,792],"./SelectCard.ts":[212,792],"./SensorCard":[982],"./SensorCard.ts":[982],"./SwitchCard":[708,792],"./SwitchCard.ts":[708,792],"./VacuumCard":[430,792],"./VacuumCard.ts":[430,792]};function a(e){if(!r.o(i,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=i[e],a=t[0];return Promise.all(t.slice(1).map(r.e)).then((()=>r(a)))}a.keys=()=>Object.keys(i),a.id=560,e.exports=a},216:(e,t,r)=>{var i={"./AbstractChip":[222,792],"./AbstractChip.ts":[222,792],"./ClimateChip":[757,792],"./ClimateChip.ts":[757,792],"./CoverChip":[589,792],"./CoverChip.ts":[589,792],"./FanChip":[867,792],"./FanChip.ts":[867,792],"./LightChip":[741,792],"./LightChip.ts":[741,792],"./SwitchChip":[908,792],"./SwitchChip.ts":[908,792],"./WeatherChip":[778,792],"./WeatherChip.ts":[778,792]};function a(e){if(!r.o(i,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=i[e],a=t[0];return r.e(t[1]).then((()=>r(a)))}a.keys=()=>Object.keys(i),a.id=216,e.exports=a},555:(e,t,r)=>{var i={"./AbstractView":[122,792],"./AbstractView.ts":[122,792],"./CameraView":[255,792],"./CameraView.ts":[255,792],"./ClimateView":[559,792],"./ClimateView.ts":[559,792],"./CoverView":[547,792],"./CoverView.ts":[547,792],"./FanView":[245,792],"./FanView.ts":[245,792],"./HomeView":[31,792],"./HomeView.ts":[31,792],"./LightView":[304,792],"./LightView.ts":[304,792],"./SwitchView":[464,792],"./SwitchView.ts":[464,792],"./VacuumView":[499,792],"./VacuumView.ts":[499,792]};function a(e){if(!r.o(i,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=i[e],a=t[0];return r.e(t[1]).then((()=>r(a)))}a.keys=()=>Object.keys(i),a.id=555,e.exports=a}},t={};function r(i){var a=t[i];if(void 0!==a)return a.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.e=()=>Promise.resolve(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e=r(183),t=r(982),i=r(896);class a extends HTMLTemplateElement{static async generateDashboard(t){await e.H.initialize(t);const i=t.config?.views??[];let a;for(let t of e.H.getExposedViewIds())try{const o=e.H.sanitizeClassName(t+"View");a=await r(555)(`./${o}`);const s=await new a[o](e.H.strategyOptions.views[t]).getView();s.cards?.length&&i.push(s)}catch(r){e.H.logError(`View '${t}' couldn't be loaded!`,r)}for(let t of e.H.areas)t.hidden||i.push({title:t.name,path:t.area_id??t.name,subview:!0,strategy:{type:"custom:mushroom-strategy",options:{area:t}}});return e.H.strategyOptions.extra_views&&i.push(...e.H.strategyOptions.extra_views),{views:i}}static async generateView(a){const o=e.H.getExposedDomainIds(),s=a.view.strategy?.options?.area??{},n=[...s.extra_cards??[]];let c={area_id:[s.area_id]};for(const a of o){if("default"===a)continue;const o=e.H.sanitizeClassName(a+"Card");let d=[];try{d=await r(560)(`./${o}`).then((r=>{let n=[];const d=e.H.getDeviceEntities(s,a);let l=e.H.strategyOptions.domains[a??"_"].hide_config_entities||e.H.strategyOptions.domains._.hide_config_entities;if("undisclosed"===s.area_id&&(c={entity_id:d.map((e=>e.entity_id))}),d.length){const h=new i.ControllerCard(c,e.H.strategyOptions.domains[a]).createCard();if("sensor"===a){const r=e.H.getStateEntities(s,"sensor"),i=[];for(const a of d){const o=r.find((e=>e.entity_id===a.entity_id));let s=e.H.strategyOptions.card_options?.[a.entity_id],n=e.H.strategyOptions.card_options?.[a.device_id??"null"];s?.hidden||n?.hidden||(o?.attributes.unit_of_measurement&&(s={type:"custom:mini-graph-card",entities:[a.entity_id],...s}),i.push(new t.SensorCard(a,s).getCard()))}return i.length&&(n.push({type:"vertical-stack",cards:i}),n.unshift(h)),n}for(const t of d){let i,a=e.H.strategyOptions.card_options?.[t.entity_id];t.device_id&&(i=e.H.strategyOptions.card_options?.[t.device_id]),a?.hidden||i?.hidden||"config"===t.entity_category&&l||n.push(new r[o](t,a).getCard())}if("binary_sensor"===a){const e=[];for(let t=0;te.area_id===s.area_id)).map((e=>e.id)),a=e.H.entities.filter((e=>{const r=t.includes(e.device_id??"null")||e.area_id===s.area_id,i=null===e.hidden_by&&null===e.disabled_by,a=o.includes(e.entity_id.split(".",1)[0]);return i&&!a&&r}));if(a.length){let t=[];try{t=await Promise.resolve().then(r.bind(r,486)).then((t=>{const r=[new i.ControllerCard(c,e.H.strategyOptions.domains.default).createCard()];for(const i of a){let a=e.H.strategyOptions.card_options?.[i.entity_id],o=e.H.strategyOptions.card_options?.[i.device_id??"null"];a?.hidden||o?.hidden||"config"===i.entity_category&&e.H.strategyOptions.domains._.hide_config_entities||r.push(new t.MiscellaneousCard(i,a).getCard())}return r}))}catch(t){e.H.logError("An error occurred while creating the domain cards!",t)}n.push({type:"vertical-stack",cards:t})}}return{cards:n}}}customElements.define("ll-strategy-mushroom-strategy",a),console.info("%c Mushroom Strategy %c ".concat("v2.2.0"," "),"color: white; background: coral; font-weight: 700;","color: coral; background: white; font-weight: 700;")})()})(); \ No newline at end of file +(()=>{var e={744:e=>{"use strict";var t=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===r}(e)}(e)},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?s((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function a(e,t,r){return e.concat(t).map((function(e){return i(e,r)}))}function o(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function n(e,t){try{return t in e}catch(e){return!1}}function s(e,r,c){(c=c||{}).arrayMerge=c.arrayMerge||a,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=i;var d=Array.isArray(r);return d===Array.isArray(e)?d?c.arrayMerge(e,r,c):function(e,t,r){var a={};return r.isMergeableObject(e)&&o(e).forEach((function(t){a[t]=i(e[t],r)})),o(t).forEach((function(o){(function(e,t){return n(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(n(e,o)&&r.isMergeableObject(t[o])?a[o]=function(e,t){if(!t.customMerge)return s;var r=t.customMerge(e);return"function"==typeof r?r:s}(o,r)(e[o],t[o],r):a[o]=i(t[o],r))})),a}(e,r,c):i(r,c)}s.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,r){return s(e,r,t)}),{})};var c=s;e.exports=c},183:(e,t,r)=>{"use strict";r.d(t,{H:()=>v});const i={areas:{undisclosed:{area_id:"undisclosed",floor_id:null,name:"Undisclosed",picture:null,icon:"mdi:floor-plan",labels:[],aliases:[],hidden:!1}},debug:!1,domains:{_:{hide_config_entities:!1},default:{title:"Miscellaneous",showControls:!1,hidden:!1},light:{title:"Lights",showControls:!0,iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off",hidden:!1},fan:{title:"Fans",showControls:!0,iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off",hidden:!1},cover:{title:"Covers",showControls:!0,iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover",hidden:!1},switch:{title:"Switches",showControls:!0,iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off",hidden:!1},camera:{title:"Cameras",showControls:!1,hidden:!1},lock:{title:"Locks",showControls:!1,hidden:!1},climate:{title:"Climates",showControls:!1,hidden:!1},media_player:{title:"Media Players",showControls:!1,hidden:!1},sensor:{title:"Sensors",showControls:!1,hidden:!1},binary_sensor:{title:"Binary Sensors",showControls:!1,hidden:!1},number:{title:"Numbers",showControls:!1,hidden:!1},vacuum:{title:"Vacuums",showControls:!0,hidden:!1},select:{title:"Selects",showControls:!1,hidden:!1},input_select:{title:"Input Selects",showControls:!1,hidden:!1}},home_view:{hidden:[]},views:{home:{order:1,hidden:!1},light:{order:2,hidden:!1},fan:{order:3,hidden:!1},cover:{order:4,hidden:!1},switch:{order:5,hidden:!1},climate:{order:6,hidden:!1},camera:{order:7,hidden:!1},vacuum:{order:8,hidden:!1}}};var a,o,n,s,c,d,l,h,f,u,p=r(744),w=r.n(p),m=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},g=function(e,t,r,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,r):a?a.value=r:t.set(e,r),r};class v{constructor(){throw new Error("This class should be invoked with method initialize() instead of using the keyword new!")}static get strategyOptions(){return m(this,a,"f",l)}static get areas(){return m(this,a,"f",s)}static get devices(){return m(this,a,"f",n)}static get entities(){return m(this,a,"f",o)}static get debug(){return m(this,a,"f",h)}static async initialize(e){g(this,a,e.hass.states,"f",c),g(this,a,w()(i,e.config?.strategy?.options??{}),"f",l),g(this,a,m(this,a,"f",l).debug,"f",h);try{[{set value(e){g(a,a,e,"f",o)}}.value,{set value(e){g(a,a,e,"f",n)}}.value,{set value(e){g(a,a,e,"f",s)}}.value]=await Promise.all([e.hass.callWS({type:"config/entity_registry/list"}),e.hass.callWS({type:"config/device_registry/list"}),e.hass.callWS({type:"config/area_registry/list"})])}catch(e){throw a.logError("An error occurred while querying Home assistant's registries!",e),"Check the console for details"}m(this,a,"f",l).areas.undisclosed?.hidden||(m(this,a,"f",l).areas.undisclosed={...i.areas.undisclosed,...m(this,a,"f",l).areas.undisclosed},m(this,a,"f",l).areas.undisclosed.area_id="undisclosed",m(this,a,"f",s).push(m(this,a,"f",l).areas.undisclosed)),g(this,a,a.areas.map((e=>({...e,...m(this,a,"f",l).areas?.[e.area_id]}))),"f",s),m(this,a,"f",s).sort(((e,t)=>(e.order??1/0)-(t.order??1/0)||e.name.localeCompare(t.name))),m(this,a,"f",l).views=Object.fromEntries(Object.entries(m(this,a,"f",l).views).sort((([,e],[,t])=>(e.order??1/0)-(t.order??1/0)||(e.title??"undefined").localeCompare(t.title??"undefined")))),m(this,a,"f",l).domains=Object.fromEntries(Object.entries(m(this,a,"f",l).domains).sort((([,e],[,t])=>(e.order??1/0)-(t.order??1/0)||(e.title??"undefined").localeCompare(t.title??"undefined")))),g(this,a,!0,"f",d)}static isInitialized(){return m(this,a,"f",d)}static getCountTemplate(e,t,r){const i=[];this.isInitialized()||console.warn("Helper class should be initialized before calling this method!");for(const t of m(this,a,"f",s)){const r=m(this,a,"f",n).filter((e=>e.area_id===t.area_id)).map((e=>e.id)),s=m(this,a,"f",o).filter(m(this,a,"m",f),{area:t,domain:e,areaDeviceIds:r}).map((e=>`states['${e.entity_id}']`));i.push(...s)}return`{% set entities = [${i}] %} {{ entities | selectattr('state','${t}','${r}') | list | count }}`}static getDeviceEntities(e,t){this.isInitialized()||console.warn("Helper class should be initialized before calling this method!");const r=m(this,a,"f",n).filter((t=>(t.area_id??"undisclosed")===e.area_id)).map((e=>e.id));return m(this,a,"f",o).filter(m(this,a,"m",f),{area:e,domain:t,areaDeviceIds:r}).sort(((e,t)=>(e.original_name??"undefined").localeCompare(t.original_name??"undefined")))}static getStateEntities(e,t){this.isInitialized()||console.warn("Helper class should be initialized before calling this method!");const r=[],i=Object.fromEntries(m(this,a,"f",o).map((e=>[e.entity_id,e]))),s=Object.fromEntries(m(this,a,"f",n).map((e=>[e.id,e]))),d=Object.values(m(this,a,"f",c)).filter((e=>e.entity_id.startsWith(`${t}.`)));for(const t of d){const a=i[t.entity_id],o=s[a?.device_id??""];(a?.area_id===e.area_id||o&&o.area_id===e.area_id)&&r.push(t)}return r}static sanitizeClassName(e){return(e=e.charAt(0).toUpperCase()+e.slice(1)).replace(/([-_][a-z])/g,(e=>e.toUpperCase().replace("-","").replace("_","")))}static getExposedViewIds(){return this.isInitialized()||console.warn("Helper class should be initialized before calling this method!"),m(this,a,"m",u).call(this,m(this,a,"f",l).views,"hidden",!1)}static getExposedDomainIds(){return this.isInitialized()||console.warn("Helper class should be initialized before calling this method!"),m(this,a,"m",u).call(this,m(this,a,"f",l).domains,"hidden",!1)}static logError(e,t){a.debug?console.error(e,t):console.error(e)}}a=v,f=function(e){const t=null===e.hidden_by&&null===e.disabled_by,r=e.entity_id.startsWith(`${this.domain}.`),i="undisclosed"===this.area.area_id?!e.area_id&&(this.areaDeviceIds.includes(e.device_id??"")||!e.device_id):e.area_id===this.area.area_id||!e.area_id&&this.areaDeviceIds.includes(e.device_id??"");return t&&r&&i},u=function(e,t,r){const i=[];for(const a of Object.keys(e))e[a][t]===r&&i.push(a);return i},o={value:void 0},n={value:void 0},s={value:[]},c={value:void 0},d={value:!1},l={value:void 0},h={value:void 0}},818:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbstractCard:()=>a});var i=r(183);class a{constructor(e){if(this.config={type:"custom:mushroom-entity-card",icon:"mdi:help-circle"},!i.H.isInitialized())throw new Error("The Helper module must be initialized before using this one.");this.entity=e}getCard(){return{...this.config,entity:"entity_id"in this.entity?this.entity.entity_id:void 0}}}},301:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AreaCard:()=>n});var i,a=r(818),o=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class n extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-template-card",primary:void 0,icon:"mdi:floor-plan",icon_color:"blue",tap_action:{action:"navigate",navigation_path:""},hold_action:{action:"none"}}),"default"===t.type&&delete t.type,o(this,i,"f").primary=e.name,o(this,i,"f").tap_action&&"navigation_path"in o(this,i,"f").tap_action&&(o(this,i,"f").tap_action.navigation_path=e.area_id),e.icon&&(o(this,i,"f").icon=e.icon),this.config=Object.assign(this.config,o(this,i,"f"),t)}}i=new WeakMap},151:(e,t,r)=>{"use strict";r.r(t),r.d(t,{BinarySensorCard:()=>o});var i,a=r(982);class o extends a.SensorCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-entity-card",icon:"mdi:power-cycle",icon_color:"green"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},723:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CameraCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{entity:"",type:"picture-entity",show_name:!1,show_state:!1,camera_view:"live"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},721:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ClimateCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-climate-card",icon:void 0,hvac_modes:["off","cool","heat","fan_only"],show_temperature_control:!0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},896:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ControllerCard:()=>s});var i,a,o=function(e,t,r,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,r):a?a.value=r:t.set(e,r),r},n=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class s{constructor(e,t={}){i.set(this,void 0),a.set(this,{type:"mushroom-title-card",showControls:!0,iconOn:"mdi:power-on",iconOff:"mdi:power-off",onService:"none",offService:"none"}),o(this,i,e,"f"),o(this,a,{...n(this,a,"f"),...t},"f")}createCard(){const e=[{type:"custom:mushroom-title-card",title:n(this,a,"f").title,subtitle:n(this,a,"f").subtitle}];return n(this,a,"f").showControls&&e.push({type:"horizontal-stack",cards:[{type:"custom:mushroom-template-card",icon:n(this,a,"f").iconOff,layout:"vertical",icon_color:"red",tap_action:{action:"call-service",service:n(this,a,"f").offService,target:n(this,i,"f"),data:{}}},{type:"custom:mushroom-template-card",icon:n(this,a,"f").iconOn,layout:"vertical",icon_color:"amber",tap_action:{action:"call-service",service:n(this,a,"f").onService,target:n(this,i,"f"),data:{}}}]}),{type:"horizontal-stack",cards:e}}}i=new WeakMap,a=new WeakMap},33:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CoverCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-cover-card",icon:void 0,show_buttons_control:!0,show_position_control:!0,show_tilt_position_control:!0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},667:(e,t,r)=>{"use strict";r.r(t),r.d(t,{FanCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-fan-card",icon:void 0,show_percentage_control:!0,show_oscillate_control:!0,icon_animation:!0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},42:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AreaCard:()=>n});var i,a=r(818),o=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class n extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"area",area:""}),o(this,i,"f").area=e.area_id,o(this,i,"f").navigation_path=o(this,i,"f").area,delete t.type,this.config=Object.assign(this.config,o(this,i,"f"),t)}}i=new WeakMap},810:(e,t,r)=>{"use strict";r.r(t),r.d(t,{InputSelectCard:()=>o});var i,a=r(212);class o extends a.SelectCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-select-card",icon:void 0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},254:(e,t,r)=>{"use strict";r.r(t),r.d(t,{LightCard:()=>d});var i,a=r(818),o=r(843),n=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},s=o.M.isCallServiceActionConfig,c=o.M.isCallServiceActionTarget;class d extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-light-card",icon:void 0,show_brightness_control:!0,show_color_control:!0,show_color_temp_control:!0,use_light_color:!0,double_tap_action:{action:"call-service",service:"light.turn_on",target:{entity_id:void 0},data:{rgb_color:[255,255,255]}}}),s(n(this,i,"f").double_tap_action)&&c(n(this,i,"f").double_tap_action.target)&&(n(this,i,"f").double_tap_action.target.entity_id=e.entity_id),this.config=Object.assign(this.config,n(this,i,"f"),t)}}i=new WeakMap},936:(e,t,r)=>{"use strict";r.r(t),r.d(t,{LockCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-lock-card",icon:void 0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},879:(e,t,r)=>{"use strict";r.r(t),r.d(t,{MediaPlayerCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-media-player-card",use_media_info:!0,media_controls:["on_off","play_pause_stop"],show_volume_level:!0,volume_controls:["volume_mute","volume_set","volume_buttons"]}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},486:(e,t,r)=>{"use strict";r.r(t),r.d(t,{MiscellaneousCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-entity-card",icon_color:"blue-grey"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},137:(e,t,r)=>{"use strict";r.r(t),r.d(t,{NumberCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-number-card",icon:void 0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},845:(e,t,r)=>{"use strict";r.r(t),r.d(t,{PersonCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-person-card",layout:"vertical",primary_info:"none",secondary_info:"none",icon_type:"entity-picture"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},212:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SelectCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-select-card",icon:void 0}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},982:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SensorCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-entity-card",icon:"mdi:information",animate:!0,line_color:"green"}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},708:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SwitchCard:()=>o});var i,a=r(818);class o extends a.AbstractCard{constructor(e,t={}){super(e),i.set(this,{type:"custom:mushroom-entity-card",icon:void 0,tap_action:{action:"toggle"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),t)}}i=new WeakMap},430:(e,t,r)=>{"use strict";r.r(t),r.d(t,{VacuumCard:()=>n});var i=r(818);const a=["on_off","start_pause","stop","locate","clean_spot","return_home"];var o;class n extends i.AbstractCard{constructor(e,t={}){super(e),o.set(this,{type:"custom:mushroom-vacuum-card",icon:void 0,icon_animation:!0,commands:[...a],tap_action:{action:"more-info"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,o,"f"),t)}}o=new WeakMap},222:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbstractChip:()=>o});var i=r(183),a=r(843).M.isCallServiceActionConfig;class o{constructor(){if(this.config={type:"template"},!i.H.isInitialized())throw new Error("The Helper module must be initialized before using this one.")}getChip(){return this.config}setTapActionTarget(e){"tap_action"in this.config&&a(this.config.tap_action)?this.config.tap_action.target=e:i.H.debug&&console.warn(this.constructor.name+" - Target not set: Invalid target or tap action.")}}},757:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ClimateChip:()=>n});var i,a=r(183),o=r(222);class n extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:thermostat",icon_color:"orange",content:a.H.getCountTemplate("climate","ne","off"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"climates"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},589:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CoverChip:()=>n});var i,a=r(183),o=r(222);class n extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:window-open",icon_color:"cyan",content:a.H.getCountTemplate("cover","eq","open"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"covers"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},867:(e,t,r)=>{"use strict";r.r(t),r.d(t,{FanChip:()=>n});var i,a=r(183),o=r(222);class n extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:fan",icon_color:"green",content:a.H.getCountTemplate("fan","eq","on"),tap_action:{action:"call-service",service:"fan.turn_off"},hold_action:{action:"navigate",navigation_path:"fans"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},741:(e,t,r)=>{"use strict";r.r(t),r.d(t,{LightChip:()=>n});var i,a=r(183),o=r(222);class n extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:lightbulb-group",icon_color:"amber",content:a.H.getCountTemplate("light","eq","on"),tap_action:{action:"call-service",service:"light.turn_off"},hold_action:{action:"navigate",navigation_path:"lights"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},908:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SwitchChip:()=>n});var i,a=r(183),o=r(222);class n extends o.AbstractChip{constructor(e={}){super(),i.set(this,{type:"template",icon:"mdi:dip-switch",icon_color:"blue",content:a.H.getCountTemplate("switch","eq","on"),tap_action:{action:"call-service",service:"switch.turn_off"},hold_action:{action:"navigate",navigation_path:"switches"}}),this.config=Object.assign(this.config,function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)}(this,i,"f"),e)}}i=new WeakMap},778:(e,t,r)=>{"use strict";r.r(t),r.d(t,{WeatherChip:()=>n});var i,a=r(222),o=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class n extends a.AbstractChip{constructor(e,t={}){super(),i.set(this,{type:"weather",show_temperature:!0,show_conditions:!0}),function(e,t,r,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===i?a.call(e,r):a?a.value=r:t.set(e,r)}(this,i,{...o(this,i,"f"),entity:e,...t},"f"),this.config=Object.assign(this.config,o(this,i,"f"),t)}}i=new WeakMap},843:(e,t,r)=>{"use strict";var i;r.d(t,{M:()=>i}),function(e){e.isCallServiceActionConfig=function(e){return e&&"call-service"===e.action&&["action","service"].every((t=>t in e))},e.isCallServiceActionTarget=function(e){return e&&["entity_id","device_id","area_id"].some((t=>t in e))}}(i||(i={}))},122:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbstractView:()=>s});var i,a=r(183),o=r(896),n=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class s{constructor(e=""){if(this.config={icon:"mdi:view-dashboard",subview:!1},this.viewControllerCard={cards:[],type:""},i.set(this,void 0),!a.H.isInitialized())throw new Error("The Helper module must be initialized before using this one.");e&&function(e,t,r,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===i?a.call(e,r):a?a.value=r:t.set(e,r)}(this,i,e,"f")}async createViewCards(){const e=[],t=a.H.strategyOptions.domains[n(this,i,"f")??"_"].hide_config_entities||a.H.strategyOptions.domains._.hide_config_entities;for(const s of a.H.areas){const c=[],d=a.H.getDeviceEntities(s,n(this,i,"f")??""),l=a.H.sanitizeClassName(n(this,i,"f")+"Card"),h=await r(560)(`./${l}`);let f={area_id:[s.area_id]};"undisclosed"===s.area_id&&(f={entity_id:d.map((e=>e.entity_id))});for(const e of d){let r=a.H.strategyOptions.card_options?.[e.entity_id],i=a.H.strategyOptions.card_options?.[e.device_id??"null"];r?.hidden||i?.hidden||"config"===e.entity_category&&t||c.push(new h[l](e,r).getCard())}if(c.length){const t="controllerCardOptions"in this.config?this.config.controllerCardOptions:{};c.unshift(new o.ControllerCard(f,Object.assign({title:s.name},t)).createCard()),e.push({type:"vertical-stack",cards:c})}}return e.length&&e.unshift(this.viewControllerCard),e}async getView(){return{...this.config,cards:await this.createViewCards()}}targetDomain(e){return{entity_id:a.H.entities.filter((t=>t.entity_id.startsWith(e+".")&&!t.hidden_by&&!a.H.strategyOptions.card_options?.[t.entity_id]?.hidden)).map((e=>e.entity_id))}}}i=new WeakMap},255:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CameraView:()=>h});var i,a,o,n,s=r(896),c=r(122),d=r(183),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends c.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Cameras",path:"cameras",icon:"mdi:cctv",subview:!1,controllerCardOptions:{showControls:!1}}),n.set(this,{title:"All Cameras",subtitle:d.H.getCountTemplate(l(i,i,"f",a),"ne","off")+" cameras on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new s.ControllerCard({},{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"camera"}},559:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ClimateView:()=>h});var i,a,o,n,s=r(183),c=r(896),d=r(122),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Climates",path:"climates",icon:"mdi:thermostat",subview:!1,controllerCardOptions:{showControls:!1}}),n.set(this,{title:"All Climates",subtitle:s.H.getCountTemplate(l(i,i,"f",a),"ne","off")+" climates on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"climate"}},547:(e,t,r)=>{"use strict";r.r(t),r.d(t,{CoverView:()=>h});var i,a,o,n,s=r(183),c=r(896),d=r(122),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Covers",path:"covers",icon:"mdi:window-open",subview:!1,controllerCardOptions:{iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover"}}),n.set(this,{title:"All Covers",subtitle:s.H.getCountTemplate(l(i,i,"f",a),"eq","open")+" covers open"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"cover"}},245:(e,t,r)=>{"use strict";r.r(t),r.d(t,{FanView:()=>h});var i,a,o,n,s=r(183),c=r(896),d=r(122),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Fans",path:"fans",icon:"mdi:fan",subview:!1,controllerCardOptions:{iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off"}}),n.set(this,{title:"All Fans",subtitle:s.H.getCountTemplate(l(i,i,"f",a),"eq","on")+" fans on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"fan"}},31:(e,t,r)=>{"use strict";r.r(t),r.d(t,{HomeView:()=>h});var i,a,o,n,s,c=r(183),d=r(122),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(),i.add(this),a.set(this,{title:"Home",icon:"mdi:home-assistant",path:"home",subview:!1}),this.config=Object.assign(this.config,l(this,a,"f"),e)}async createViewCards(){return await Promise.all([l(this,i,"m",o).call(this),l(this,i,"m",n).call(this),l(this,i,"m",s).call(this)]).then((([e,t,r])=>{const i=c.H.strategyOptions,a=[];return e.length&&a.push({type:"custom:mushroom-chips-card",alignment:"center",chips:e}),t.length&&a.push({type:"horizontal-stack",cards:t}),c.H.strategyOptions.home_view.hidden.includes("greeting")||a.push({type:"custom:mushroom-template-card",primary:"{% set time = now().hour %} {% if (time >= 18) %} Good Evening, {{user}}! {% elif (time >= 12) %} Good Afternoon, {{user}}! {% elif (time >= 5) %} Good Morning, {{user}}! {% else %} Hello, {{user}}! {% endif %}",icon:"mdi:hand-wave",icon_color:"orange",tap_action:{action:"none"},double_tap_action:{action:"none"},hold_action:{action:"none"}}),i.quick_access_cards&&a.push(...i.quick_access_cards),a.push({type:"vertical-stack",cards:r}),i.extra_cards&&a.push(...i.extra_cards),a}))}}a=new WeakMap,i=new WeakSet,o=async function(){if(c.H.strategyOptions.home_view.hidden.includes("chips"))return[];const e=[],t=c.H.strategyOptions.chips,i=["light","fan","cover","switch","climate"],a=c.H.areas.map((e=>e.area_id??""));let o;const n=t?.weather_entity??c.H.entities.find((e=>e.entity_id.startsWith("weather.")&&null===e.disabled_by&&null===e.hidden_by))?.entity_id;if(n)try{o=await Promise.resolve().then(r.bind(r,778));const t=new o.WeatherChip(n);e.push(t.getChip())}catch(e){c.H.logError("An error occurred while creating the weather chip!",e)}for(let n of i)if(t?.[`${n}_count`]??1){const t=c.H.sanitizeClassName(n+"Chip");try{o=await r(216)(`./${t}`);const i=new o[t];i.setTapActionTarget({area_id:a}),e.push(i.getChip())}catch(e){c.H.logError(`An error occurred while creating the ${n} chip!`,e)}}return t?.extra_chips&&e.push(...t.extra_chips),e},n=function(){if(c.H.strategyOptions.home_view.hidden.includes("persons"))return[];const e=[];return Promise.resolve().then(r.bind(r,845)).then((t=>{for(const r of c.H.entities.filter((e=>e.entity_id.startsWith("person.")&&null==e.hidden_by&&null==e.disabled_by)))e.push(new t.PersonCard(r).getCard())})),e},s=async function(){if(c.H.strategyOptions.home_view.hidden.includes("areas"))return[];const e=[];let t=[];c.H.strategyOptions.home_view.hidden.includes("areasTitle")||e.push({type:"custom:mushroom-title-card",title:"Areas"});for(const[i,a]of c.H.areas.entries()){let o,n=c.H.strategyOptions.areas[a.area_id]?.type??c.H.strategyOptions.areas._?.type??"default";try{o=await r(560)(`./${n}`)}catch(e){o=await Promise.resolve().then(r.bind(r,301)),c.H.strategyOptions.debug&&"default"!==n&&console.error(e)}if(!c.H.strategyOptions.areas[a.area_id]?.hidden){let e={...c.H.strategyOptions.areas._,...c.H.strategyOptions.areas[a.area_id]};t.push(new o.AreaCard(a,e).getCard())}if(i===c.H.areas.length-1)for(let r=0;r{"use strict";r.r(t),r.d(t,{LightView:()=>h});var i,a,o,n,s=r(183),c=r(896),d=r(122),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Lights",path:"lights",icon:"mdi:lightbulb-group",subview:!1,controllerCardOptions:{iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off"}}),n.set(this,{title:"All Lights",subtitle:s.H.getCountTemplate(l(i,i,"f",a),"eq","on")+" lights on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"light"}},464:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SwitchView:()=>h});var i,a,o,n,s=r(183),c=r(896),d=r(122),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Switches",path:"switches",icon:"mdi:dip-switch",subview:!1,controllerCardOptions:{iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off"}}),n.set(this,{title:"All Switches",subtitle:s.H.getCountTemplate(l(i,i,"f",a),"eq","on")+" switches on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"switch"}},499:(e,t,r)=>{"use strict";r.r(t),r.d(t,{VacuumView:()=>h});var i,a,o,n,s=r(183),c=r(896),d=r(122),l=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)};class h extends d.AbstractView{constructor(e={}){super(l(i,i,"f",a)),o.set(this,{title:"Vacuums",path:"vacuums",icon:"mdi:robot-vacuum",subview:!1,controllerCardOptions:{iconOn:"mdi:robot-vacuum",iconOff:"mdi:robot-vacuum-off",onService:"vacuum.start",offService:"vacuum.stop"}}),n.set(this,{title:"All Vacuums",subtitle:s.H.getCountTemplate(l(i,i,"f",a),"ne","off")+" vacuums on"}),this.config=Object.assign(this.config,l(this,o,"f"),e),this.viewControllerCard=new c.ControllerCard(this.targetDomain(l(i,i,"f",a)),{...l(this,n,"f"),..."controllerCardOptions"in this.config?this.config.controllerCardOptions:{}}).createCard()}}i=h,o=new WeakMap,n=new WeakMap,a={value:"vacuum"}},560:(e,t,r)=>{var i={"./AbstractCard":[818],"./AbstractCard.ts":[818],"./AreaCard":[301,792],"./AreaCard.ts":[301,792],"./BinarySensorCard":[151,792],"./BinarySensorCard.ts":[151,792],"./CameraCard":[723,792],"./CameraCard.ts":[723,792],"./ClimateCard":[721,792],"./ClimateCard.ts":[721,792],"./ControllerCard":[896],"./ControllerCard.ts":[896],"./CoverCard":[33,792],"./CoverCard.ts":[33,792],"./FanCard":[667,792],"./FanCard.ts":[667,792],"./HaAreaCard":[42,792],"./HaAreaCard.ts":[42,792],"./InputSelectCard":[810,792],"./InputSelectCard.ts":[810,792],"./LightCard":[254,792],"./LightCard.ts":[254,792],"./LockCard":[936,792],"./LockCard.ts":[936,792],"./MediaPlayerCard":[879,792],"./MediaPlayerCard.ts":[879,792],"./MiscellaneousCard":[486,792],"./MiscellaneousCard.ts":[486,792],"./NumberCard":[137,792],"./NumberCard.ts":[137,792],"./PersonCard":[845,792],"./PersonCard.ts":[845,792],"./SelectCard":[212,792],"./SelectCard.ts":[212,792],"./SensorCard":[982],"./SensorCard.ts":[982],"./SwitchCard":[708,792],"./SwitchCard.ts":[708,792],"./VacuumCard":[430,792],"./VacuumCard.ts":[430,792]};function a(e){if(!r.o(i,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=i[e],a=t[0];return Promise.all(t.slice(1).map(r.e)).then((()=>r(a)))}a.keys=()=>Object.keys(i),a.id=560,e.exports=a},216:(e,t,r)=>{var i={"./AbstractChip":[222,792],"./AbstractChip.ts":[222,792],"./ClimateChip":[757,792],"./ClimateChip.ts":[757,792],"./CoverChip":[589,792],"./CoverChip.ts":[589,792],"./FanChip":[867,792],"./FanChip.ts":[867,792],"./LightChip":[741,792],"./LightChip.ts":[741,792],"./SwitchChip":[908,792],"./SwitchChip.ts":[908,792],"./WeatherChip":[778,792],"./WeatherChip.ts":[778,792]};function a(e){if(!r.o(i,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=i[e],a=t[0];return r.e(t[1]).then((()=>r(a)))}a.keys=()=>Object.keys(i),a.id=216,e.exports=a},555:(e,t,r)=>{var i={"./AbstractView":[122,792],"./AbstractView.ts":[122,792],"./CameraView":[255,792],"./CameraView.ts":[255,792],"./ClimateView":[559,792],"./ClimateView.ts":[559,792],"./CoverView":[547,792],"./CoverView.ts":[547,792],"./FanView":[245,792],"./FanView.ts":[245,792],"./HomeView":[31,792],"./HomeView.ts":[31,792],"./LightView":[304,792],"./LightView.ts":[304,792],"./SwitchView":[464,792],"./SwitchView.ts":[464,792],"./VacuumView":[499,792],"./VacuumView.ts":[499,792]};function a(e){if(!r.o(i,e))return Promise.resolve().then((()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=i[e],a=t[0];return r.e(t[1]).then((()=>r(a)))}a.keys=()=>Object.keys(i),a.id=555,e.exports=a}},t={};function r(i){var a=t[i];if(void 0!==a)return a.exports;var o=t[i]={exports:{}};return e[i](o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.e=()=>Promise.resolve(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e=r(183),t=r(982),i=r(896);class a extends HTMLTemplateElement{static async generateDashboard(t){await e.H.initialize(t);const i=t.config?.views??[];let a;for(let t of e.H.getExposedViewIds())try{const o=e.H.sanitizeClassName(t+"View");a=await r(555)(`./${o}`);const n=await new a[o](e.H.strategyOptions.views[t]).getView();n.cards?.length&&i.push(n)}catch(r){e.H.logError(`View '${t}' couldn't be loaded!`,r)}for(let t of e.H.areas)t.hidden||i.push({title:t.name,path:t.area_id??t.name,subview:!0,strategy:{type:"custom:mushroom-strategy",options:{area:t}}});return e.H.strategyOptions.extra_views&&i.push(...e.H.strategyOptions.extra_views),{views:i}}static async generateView(a){const o=e.H.getExposedDomainIds(),n=a.view.strategy?.options?.area??{},s=[...n.extra_cards??[]];let c={area_id:[n.area_id]};for(const a of o){if("default"===a)continue;const o=e.H.sanitizeClassName(a+"Card");let d=[];try{d=await r(560)(`./${o}`).then((r=>{let s=[];const d=e.H.getDeviceEntities(n,a);let l=e.H.strategyOptions.domains[a??"_"].hide_config_entities||e.H.strategyOptions.domains._.hide_config_entities;if("undisclosed"===n.area_id&&(c={entity_id:d.map((e=>e.entity_id))}),d.length){const h=new i.ControllerCard(c,e.H.strategyOptions.domains[a]).createCard();if("sensor"===a){const r=e.H.getStateEntities(n,"sensor"),i=[];for(const a of d){const o=r.find((e=>e.entity_id===a.entity_id));let n=e.H.strategyOptions.card_options?.[a.entity_id],s=e.H.strategyOptions.card_options?.[a.device_id??"null"];n?.hidden||s?.hidden||(o?.attributes.unit_of_measurement&&(n={type:"custom:mini-graph-card",entities:[a.entity_id],...n}),i.push(new t.SensorCard(a,n).getCard()))}return i.length&&(s.push({type:"vertical-stack",cards:i}),s.unshift(h)),s}for(const t of d){let i,a=e.H.strategyOptions.card_options?.[t.entity_id];t.device_id&&(i=e.H.strategyOptions.card_options?.[t.device_id]),a?.hidden||i?.hidden||"config"===t.entity_category&&l||s.push(new r[o](t,a).getCard())}if("binary_sensor"===a){const e=[];for(let t=0;te.area_id===n.area_id)).map((e=>e.id)),a=e.H.entities.filter((e=>{const r=t.includes(e.device_id??"null")||e.area_id===n.area_id,i=null===e.hidden_by&&null===e.disabled_by,a=o.includes(e.entity_id.split(".",1)[0]);return i&&!a&&r}));if(a.length){let t=[];try{t=await Promise.resolve().then(r.bind(r,486)).then((t=>{const r=[new i.ControllerCard(c,e.H.strategyOptions.domains.default).createCard()];for(const i of a){let a=e.H.strategyOptions.card_options?.[i.entity_id],o=e.H.strategyOptions.card_options?.[i.device_id??"null"];a?.hidden||o?.hidden||"config"===i.entity_category&&e.H.strategyOptions.domains._.hide_config_entities||r.push(new t.MiscellaneousCard(i,a).getCard())}return r}))}catch(t){e.H.logError("An error occurred while creating the domain cards!",t)}s.push({type:"vertical-stack",cards:t})}}return{cards:s}}}customElements.define("ll-strategy-mushroom-strategy",a),console.info("%c Mushroom Strategy %c ".concat("v2.2.0"," "),"color: white; background: coral; font-weight: 700;","color: coral; background: white; font-weight: 700;")})()})(); \ No newline at end of file