From 9186cfe85b9a9335d480ad9cac08ba3d0dc1b148 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 6 May 2026 12:21:15 -0400 Subject: [PATCH 1/7] Register strategy as custom dashboard --- src/mushroom-strategy.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mushroom-strategy.ts b/src/mushroom-strategy.ts index ba90ac6c..dfe2dea5 100644 --- a/src/mushroom-strategy.ts +++ b/src/mushroom-strategy.ts @@ -302,3 +302,12 @@ console.info( 'color: white; background: coral; font-weight: 700;', 'color: coral; background: white; font-weight: 700;' ); + +window.customStrategies = window.customStrategies || []; +window.customStrategies.push({ + type: "ll-strategy-mushroom-strategy", + strategyType: "dashboard", + name: "Mushroom Strategy", + description: `Auto-generate a dashboard with Mushroom cards (${STRATEGY_VERSION}).`, + documentationURL: "https://github.com/DigiLive/mushroom-strategy", +}); From 1785e09d7c1d8d6cf178a4938e0279829b955109 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Wed, 6 May 2026 12:33:22 -0400 Subject: [PATCH 2/7] Fix type --- src/mushroom-strategy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mushroom-strategy.ts b/src/mushroom-strategy.ts index dfe2dea5..83dbd53b 100644 --- a/src/mushroom-strategy.ts +++ b/src/mushroom-strategy.ts @@ -305,7 +305,7 @@ console.info( window.customStrategies = window.customStrategies || []; window.customStrategies.push({ - type: "ll-strategy-mushroom-strategy", + type: "mushroom-strategy", strategyType: "dashboard", name: "Mushroom Strategy", description: `Auto-generate a dashboard with Mushroom cards (${STRATEGY_VERSION}).`, From d85085654bfe9484a1085e09e6f92f4b4531628e Mon Sep 17 00:00:00 2001 From: Claude <242468646+Claude@users.noreply.github.com> Date: Sun, 10 May 2026 21:40:51 -0400 Subject: [PATCH 3/7] Address PR #323 comments: Add Window type declaration and refine registration (#1) * Address PR comments: update registration and add getCreateSuggestions Agent-Logs-Url: https://github.com/balloob/mushroom-strategy/sessions/14d9436e-b60e-49fc-a266-0fcc30e46b63 Co-authored-by: balloob <1444314+balloob@users.noreply.github.com> * Add Window interface type declaration for customStrategies Co-authored-by: balloob <1444314+balloob@users.noreply.github.com> --------- Co-authored-by: anthropic-code-agent[bot] <242468646+Claude@users.noreply.github.com> Co-authored-by: balloob <1444314+balloob@users.noreply.github.com> --- dist/mushroom-strategy.js | 2 +- src/mushroom-strategy.ts | 38 +++++++++++++++++++++++++++++++++----- 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/dist/mushroom-strategy.js b/dist/mushroom-strategy.js index dc8cc652..35e8265d 100644 --- a/dist/mushroom-strategy.js +++ b/dist/mushroom-strategy.js @@ -1 +1 @@ -(()=>{var e,t,r={4744(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 s(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function i(e,t,r){return e.concat(t).map(function(e){return s(e,r)})}function n(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 o(e,t){try{return t in e}catch(e){return!1}}function a(e,r,c){(c=c||{}).arrayMerge=c.arrayMerge||i,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=s;var l=Array.isArray(r);return l===Array.isArray(e)?l?c.arrayMerge(e,r,c):function(e,t,r){var i={};return r.isMergeableObject(e)&&n(e).forEach(function(t){i[t]=s(e[t],r)}),n(t).forEach(function(n){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,n)||(o(e,n)&&r.isMergeableObject(t[n])?i[n]=function(e,t){if(!t.customMerge)return a;var r=t.customMerge(e);return"function"==typeof r?r:a}(n,r)(e[n],t[n],r):i[n]=s(t[n],r))}),i}(e,r,c):s(r,c)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,r){return a(e,r,t)},{})};var c=a;e.exports=c},3904(e,t,r){"use strict";const s=Symbol("SemVer ANY");class i{static get ANY(){return s}constructor(e,t){if(t=n(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),l("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===s?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(e){const t=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=s}toString(){return this.value}test(e){if(l("Comparator.test",e,this.options.loose),this.semver===s||e===s)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=n(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(c(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(c(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=i;const n=r(8587),{safeRe:o,t:a}=r(9718),c=r(2111),l=r(7272),u=r(3908),d=r(8311)},8311(e,t,r){"use strict";const s=/\s+/g;class i{constructor(e,t){if(t=o(t),e instanceof i)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new i(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(s," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!v(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&_(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&g)|(this.options.loose&&m))+":"+e,r=n.get(t);if(r)return r;const s=this.options.loose,i=s?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];e=e.replace(i,N(this.options.includePrerelease)),c("hyphen replace",e),e=e.replace(u[d.COMPARATORTRIM],h),c("comparator trim",e),e=e.replace(u[d.TILDETRIM],f),c("tilde trim",e),e=e.replace(u[d.CARETTRIM],p),c("caret trim",e);let o=e.split(" ").map(e=>w(e,this.options)).join(" ").split(/\s+/).map(e=>I(e,this.options));s&&(o=o.filter(e=>(c("loose invalid filter",e,this.options),!!e.match(u[d.COMPARATORLOOSE])))),c("range list",o);const l=new Map,_=o.map(e=>new a(e,this.options));for(const e of _){if(v(e))return[e];l.set(e.value,e)}l.size>1&&l.has("")&&l.delete("");const y=[...l.values()];return n.set(t,y),y}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Range is required");return this.set.some(r=>y(r,t)&&e.set.some(e=>y(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t"<0.0.0-0"===e.value,_=e=>""===e.value,y=(e,t)=>{let r=!0;const s=e.slice();let i=s.pop();for(;r&&s.length;)r=s.every(e=>i.intersects(e,t)),i=s.pop();return r},w=(e,t)=>(e=e.replace(u[d.BUILD],""),c("comp",e,t),e=b(e,t),c("caret",e),e=E(e,t),c("tildes",e),e=S(e,t),c("xrange",e),e=A(e,t),c("stars",e),e),O=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(" "),C=(e,t)=>{const r=t.loose?u[d.TILDELOOSE]:u[d.TILDE];return e.replace(r,(t,r,s,i,n)=>{let o;return c("tilde",e,t,r,s,i,n),O(r)?o="":O(s)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:O(i)?o=`>=${r}.${s}.0 <${r}.${+s+1}.0-0`:n?(c("replaceTilde pr",n),o=`>=${r}.${s}.${i}-${n} <${r}.${+s+1}.0-0`):o=`>=${r}.${s}.${i} <${r}.${+s+1}.0-0`,c("tilde return",o),o})},b=(e,t)=>e.trim().split(/\s+/).map(e=>$(e,t)).join(" "),$=(e,t)=>{c("caret",e,t);const r=t.loose?u[d.CARETLOOSE]:u[d.CARET],s=t.includePrerelease?"-0":"";return e.replace(r,(t,r,i,n,o)=>{let a;return c("caret",e,t,r,i,n,o),O(r)?a="":O(i)?a=`>=${r}.0.0${s} <${+r+1}.0.0-0`:O(n)?a="0"===r?`>=${r}.${i}.0${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${s} <${+r+1}.0.0-0`:o?(c("replaceCaret pr",o),a="0"===r?"0"===i?`>=${r}.${i}.${n}-${o} <${r}.${i}.${+n+1}-0`:`>=${r}.${i}.${n}-${o} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${n}-${o} <${+r+1}.0.0-0`):(c("no pr"),a="0"===r?"0"===i?`>=${r}.${i}.${n}${s} <${r}.${i}.${+n+1}-0`:`>=${r}.${i}.${n}${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${n} <${+r+1}.0.0-0`),c("caret return",a),a})},S=(e,t)=>(c("replaceXRanges",e,t),e.split(/\s+/).map(e=>k(e,t)).join(" ")),k=(e,t)=>{e=e.trim();const r=t.loose?u[d.XRANGELOOSE]:u[d.XRANGE];return e.replace(r,(r,s,i,n,o,a)=>{c("xRange",e,r,s,i,n,o,a);const l=O(i),u=l||O(n),d=u||O(o),h=d;return"="===s&&h&&(s=""),a=t.includePrerelease?"-0":"",l?r=">"===s||"<"===s?"<0.0.0-0":"*":s&&h?(u&&(n=0),o=0,">"===s?(s=">=",u?(i=+i+1,n=0,o=0):(n=+n+1,o=0)):"<="===s&&(s="<",u?i=+i+1:n=+n+1),"<"===s&&(a="-0"),r=`${s+i}.${n}.${o}${a}`):u?r=`>=${i}.0.0${a} <${+i+1}.0.0-0`:d&&(r=`>=${i}.${n}.0${a} <${i}.${+n+1}.0-0`),c("xRange return",r),r})},A=(e,t)=>(c("replaceStars",e,t),e.trim().replace(u[d.STAR],"")),I=(e,t)=>(c("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),N=e=>(t,r,s,i,n,o,a,c,l,u,d,h)=>`${r=O(s)?"":O(i)?`>=${s}.0.0${e?"-0":""}`:O(n)?`>=${s}.${i}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=O(l)?"":O(u)?`<${+l+1}.0.0-0`:O(d)?`<${l}.${+u+1}.0-0`:h?`<=${l}.${u}.${d}-${h}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`}`.trim(),R=(e,t,r)=>{for(let r=0;r0){const s=e[r].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0}},3908(e,t,r){"use strict";const s=r(7272),{MAX_LENGTH:i,MAX_SAFE_INTEGER:n}=r(6874),{safeRe:o,t:a}=r(9718),c=r(8587),{compareIdentifiers:l}=r(1123);class u{constructor(e,t){if(t=c(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);s("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?o[a.LOOSE]:o[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&te.major?1:this.minore.minor?1:this.patche.patch?1:0}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],i=e.prerelease[t];if(s("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return l(r,i)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const r=this.build[t],i=e.build[t];if(s("build compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return l(r,i)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?o[a.PRERELEASELOOSE]:o[a.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let s=this.prerelease.length;for(;--s>=0;)"number"==typeof this.prerelease[s]&&(this.prerelease[s]++,s=-2);if(-1===s){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let s=[t,e];!1===r&&(s=[t]),0===l(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},7414(e,t,r){"use strict";const s=r(144);e.exports=(e,t)=>{const r=s(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},2111(e,t,r){"use strict";const s=r(4641),i=r(3999),n=r(5580),o=r(4089),a=r(7059),c=r(5200);e.exports=(e,t,r,l)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return s(e,r,l);case"!=":return i(e,r,l);case">":return n(e,r,l);case">=":return o(e,r,l);case"<":return a(e,r,l);case"<=":return c(e,r,l);default:throw new TypeError(`Invalid operator: ${t}`)}}},6170(e,t,r){"use strict";const s=r(3908),i=r(144),{safeRe:n,t:o}=r(9718);e.exports=(e,t)=>{if(e instanceof s)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){const s=t.includePrerelease?n[o.COERCERTLFULL]:n[o.COERCERTL];let i;for(;(i=s.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&i.index+i[0].length===r.index+r[0].length||(r=i),s.lastIndex=i.index+i[1].length+i[2].length;s.lastIndex=-1}else r=e.match(t.includePrerelease?n[o.COERCEFULL]:n[o.COERCE]);if(null===r)return null;const a=r[2],c=r[3]||"0",l=r[4]||"0",u=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return i(`${a}.${c}.${l}${u}${d}`,t)}},909(e,t,r){"use strict";const s=r(3908);e.exports=(e,t,r)=>{const i=new s(e,r),n=new s(t,r);return i.compare(n)||i.compareBuild(n)}},1763(e,t,r){"use strict";const s=r(560);e.exports=(e,t)=>s(e,t,!0)},560(e,t,r){"use strict";const s=r(3908);e.exports=(e,t,r)=>new s(e,r).compare(new s(t,r))},1832(e,t,r){"use strict";const s=r(144);e.exports=(e,t)=>{const r=s(e,null,!0),i=s(t,null,!0),n=r.compare(i);if(0===n)return null;const o=n>0,a=o?r:i,c=o?i:r,l=!!a.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return"major";if(0===c.compareMain(a))return c.minor&&!c.patch?"minor":"patch"}const u=l?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"}},4641(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>0===s(e,t,r)},5580(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(e,t,r)>0},4089(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(e,t,r)>=0},5388(e,t,r){"use strict";const s=r(3908);e.exports=(e,t,r,i,n)=>{"string"==typeof r&&(n=i,i=r,r=void 0);try{return new s(e instanceof s?e.version:e,r).inc(t,i,n).version}catch(e){return null}}},7059(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(e,t,r)<0},5200(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(e,t,r)<=0},2938(e,t,r){"use strict";const s=r(3908);e.exports=(e,t)=>new s(e,t).major},6254(e,t,r){"use strict";const s=r(3908);e.exports=(e,t)=>new s(e,t).minor},3999(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>0!==s(e,t,r)},144(e,t,r){"use strict";const s=r(3908);e.exports=(e,t,r=!1)=>{if(e instanceof s)return e;try{return new s(e,t)}catch(e){if(!r)return null;throw e}}},4493(e,t,r){"use strict";const s=r(3908);e.exports=(e,t)=>new s(e,t).patch},1729(e,t,r){"use strict";const s=r(144);e.exports=(e,t)=>{const r=s(e,t);return r&&r.prerelease.length?r.prerelease:null}},9970(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(t,e,r)},4277(e,t,r){"use strict";const s=r(909);e.exports=(e,t)=>e.sort((e,r)=>s(r,e,t))},7638(e,t,r){"use strict";const s=r(8311);e.exports=(e,t,r)=>{try{t=new s(t,r)}catch(e){return!1}return t.test(e)}},3927(e,t,r){"use strict";const s=r(909);e.exports=(e,t)=>e.sort((e,r)=>s(e,r,t))},6953(e,t,r){"use strict";const s=r(144);e.exports=(e,t)=>{const r=s(e,t);return r?r.version:null}},9589(e,t,r){"use strict";const s=r(9718),i=r(6874),n=r(3908),o=r(1123),a=r(144),c=r(6953),l=r(7414),u=r(5388),d=r(1832),h=r(2938),f=r(6254),p=r(4493),g=r(1729),m=r(560),v=r(9970),_=r(1763),y=r(909),w=r(3927),O=r(4277),E=r(5580),C=r(7059),b=r(4641),$=r(3999),S=r(4089),k=r(5200),A=r(2111),I=r(6170),N=r(3904),R=r(8311),L=r(7638),T=r(7631),D=r(9628),x=r(270),P=r(1261),V=r(3874),G=r(7075),M=r(5571),j=r(5342),B=r(6780),F=r(2525),z=r(5032);e.exports={parse:a,valid:c,clean:l,inc:u,diff:d,major:h,minor:f,patch:p,prerelease:g,compare:m,rcompare:v,compareLoose:_,compareBuild:y,sort:w,rsort:O,gt:E,lt:C,eq:b,neq:$,gte:S,lte:k,cmp:A,coerce:I,Comparator:N,Range:R,satisfies:L,toComparators:T,maxSatisfying:D,minSatisfying:x,minVersion:P,validRange:V,outside:G,gtr:M,ltr:j,intersects:B,simplifyRange:F,subset:z,SemVer:n,re:s.re,src:s.src,tokens:s.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers}},6874(e){"use strict";const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},7272(e){"use strict";const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},1123(e){"use strict";const t=/^[0-9]+$/,r=(e,r)=>{if("number"==typeof e&&"number"==typeof r)return e===r?0:er(t,e)}},8794(e){"use strict";e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},8587(e){"use strict";const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},9718(e,t,r){"use strict";const{MAX_SAFE_COMPONENT_LENGTH:s,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:n}=r(6874),o=r(7272),a=(t=e.exports={}).re=[],c=t.safeRe=[],l=t.src=[],u=t.safeSrc=[],d=t.t={};let h=0;const f="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",n],[f,i]],g=(e,t,r)=>{const s=(e=>{for(const[t,r]of p)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=h++;o(e,i,t),d[e]=i,l[i]=t,u[i]=s,a[i]=new RegExp(t,r?"g":void 0),c[i]=new RegExp(s,r?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),g("MAINVERSION",`(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${l[d.NONNUMERICIDENTIFIER]}|${l[d.NUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${l[d.NONNUMERICIDENTIFIER]}|${l[d.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASE",`(?:-(${l[d.PRERELEASEIDENTIFIER]}(?:\\.${l[d.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${l[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[d.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${f}+`),g("BUILD",`(?:\\+(${l[d.BUILDIDENTIFIER]}(?:\\.${l[d.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${l[d.MAINVERSION]}${l[d.PRERELEASE]}?${l[d.BUILD]}?`),g("FULL",`^${l[d.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${l[d.MAINVERSIONLOOSE]}${l[d.PRERELEASELOOSE]}?${l[d.BUILD]}?`),g("LOOSE",`^${l[d.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${l[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${l[d.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:${l[d.PRERELEASE]})?${l[d.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:${l[d.PRERELEASELOOSE]})?${l[d.BUILD]}?)?)?`),g("XRANGE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${s}})(?:\\.(\\d{1,${s}}))?(?:\\.(\\d{1,${s}}))?`),g("COERCE",`${l[d.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",l[d.COERCEPLAIN]+`(?:${l[d.PRERELEASE]})?`+`(?:${l[d.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",l[d.COERCE],!0),g("COERCERTLFULL",l[d.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${l[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${l[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${l[d.LONECARET]}${l[d.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${l[d.LONECARET]}${l[d.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${l[d.GTLT]}\\s*(${l[d.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]}|${l[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${l[d.XRANGEPLAIN]})\\s+-\\s+(${l[d.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${l[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[d.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},7716(e,t,r){"use strict";e.exports=r(9589)},5571(e,t,r){"use strict";const s=r(7075);e.exports=(e,t,r)=>s(e,t,">",r)},6780(e,t,r){"use strict";const s=r(8311);e.exports=(e,t,r)=>(e=new s(e,r),t=new s(t,r),e.intersects(t,r))},5342(e,t,r){"use strict";const s=r(7075);e.exports=(e,t,r)=>s(e,t,"<",r)},9628(e,t,r){"use strict";const s=r(3908),i=r(8311);e.exports=(e,t,r)=>{let n=null,o=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(n&&-1!==o.compare(e)||(n=e,o=new s(n,r)))}),n}},270(e,t,r){"use strict";const s=r(3908),i=r(8311);e.exports=(e,t,r)=>{let n=null,o=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(n&&1!==o.compare(e)||(n=e,o=new s(n,r)))}),n}},1261(e,t,r){"use strict";const s=r(3908),i=r(8311),n=r(5580);e.exports=(e,t)=>{e=new i(e,t);let r=new s("0.0.0");if(e.test(r))return r;if(r=new s("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t{const t=new s(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":o&&!n(t,o)||(o=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}}),!o||r&&!n(r,o)||(r=o)}return r&&e.test(r)?r:null}},7075(e,t,r){"use strict";const s=r(3908),i=r(3904),{ANY:n}=i,o=r(8311),a=r(7638),c=r(5580),l=r(7059),u=r(5200),d=r(4089);e.exports=(e,t,r,h)=>{let f,p,g,m,v;switch(e=new s(e,h),t=new o(t,h),r){case">":f=c,p=u,g=l,m=">",v=">=";break;case"<":f=l,p=d,g=c,m="<",v="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,h))return!1;for(let r=0;r{e.semver===n&&(e=new i(">=0.0.0")),o=o||e,a=a||e,f(e.semver,o.semver,h)?o=e:g(e.semver,a.semver,h)&&(a=e)}),o.operator===m||o.operator===v)return!1;if((!a.operator||a.operator===m)&&p(e,a.semver))return!1;if(a.operator===v&&g(e,a.semver))return!1}return!0}},2525(e,t,r){"use strict";const s=r(7638),i=r(560);e.exports=(e,t,r)=>{const n=[];let o=null,a=null;const c=e.sort((e,t)=>i(e,t,r));for(const e of c)s(e,t,r)?(a=e,o||(o=e)):(a&&n.push([o,a]),a=null,o=null);o&&n.push([o,null]);const l=[];for(const[e,t]of n)e===t?l.push(e):t||e!==c[0]?t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`):l.push("*");const u=l.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return u.length=0.0.0-0")],l=[new i(">=0.0.0")],u=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===n){if(1===t.length&&t[0].semver===n)return!0;e=r.includePrerelease?c:l}if(1===t.length&&t[0].semver===n){if(r.includePrerelease)return!0;t=l}const s=new Set;let i,u,f,p,g,m,v;for(const t of e)">"===t.operator||">="===t.operator?i=d(i,t,r):"<"===t.operator||"<="===t.operator?u=h(u,t,r):s.add(t.semver);if(s.size>1)return null;if(i&&u){if(f=a(i.semver,u.semver,r),f>0)return null;if(0===f&&(">="!==i.operator||"<="!==u.operator))return null}for(const e of s){if(i&&!o(e,String(i),r))return null;if(u&&!o(e,String(u),r))return null;for(const s of t)if(!o(e,String(s),r))return!1;return!0}let _=!(!u||r.includePrerelease||!u.semver.prerelease.length)&&u.semver,y=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver;_&&1===_.prerelease.length&&"<"===u.operator&&0===_.prerelease[0]&&(_=!1);for(const e of t){if(v=v||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,i)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(p=d(i,e,r),p===e&&p!==i)return!1}else if(">="===i.operator&&!o(i.semver,String(e),r))return!1;if(u)if(_&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===_.major&&e.semver.minor===_.minor&&e.semver.patch===_.patch&&(_=!1),"<"===e.operator||"<="===e.operator){if(g=h(u,e,r),g===e&&g!==u)return!1}else if("<="===u.operator&&!o(u.semver,String(e),r))return!1;if(!e.operator&&(u||i)&&0!==f)return!1}return!(i&&m&&!u&&0!==f||u&&v&&!i&&0!==f||y||_)},d=(e,t,r)=>{if(!e)return t;const s=a(e.semver,t.semver,r);return s>0?e:s<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,r)=>{if(!e)return t;const s=a(e.semver,t.semver,r);return s<0?e:s>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new s(e,r),t=new s(t,r);let i=!1;e:for(const s of e.set){for(const e of t.set){const t=u(s,e,r);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},7631(e,t,r){"use strict";const s=r(8311);e.exports=(e,t)=>new s(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},3874(e,t,r){"use strict";const s=r(8311);e.exports=(e,t)=>{try{return new s(e,t).range||"*"}catch(e){return null}}},1241(e,t,r){"use strict";r.d(t,{O:()=>c});var s=r(4744),i=r.n(s),n=r(6964),o=r(2816),a=r(2682);class c{constructor(){}static get devices(){return c._devices}static get hassStates(){return c._hassStates}static get initialized(){return c._initialized}static get entities(){return c._entities}static get areas(){return c._areas}static get strategyOptions(){return c._strategyOptions}static async initialize(e){(0,o.A)(e.hass),c._hassStates=e.hass.states;const{ConfigurationDefaults:t}=await Promise.resolve().then(r.bind(r,7688));try{c._strategyOptions=i()(t,e.config.strategy.options??{})}catch(e){(0,n.OG)(n.ZY,"Error importing strategy options!",e),c._strategyOptions=t}(0,n.Ux)(c.strategyOptions.debug?n.ZY:n.QC),await this.fetchRegistry(e),c._strategyOptions.extra_views=c._strategyOptions.extra_views.map(e=>({...e,subview:!1})),c._entities=new a.A(c.entities).isNotHidden().whereDisabledBy(null).toList().map(e=>({...e,area_id:e.area_id??"undisclosed"})),c._entities=c._entities.sort((e,t)=>{const r=c.getDisplayName(e),s=c.getDisplayName(t);return r.localeCompare(s,void 0,{numeric:!0,sensitivity:"base"})}),c._devices=new a.A(c.devices).isNotHidden().whereDisabledBy(null).orderBy(["name_by_user","name"],"asc").toList().map(e=>({...e,area_id:e.area_id??"undisclosed"})),c._areas.push(t.areas.undisclosed);const s=new a.A(c._areas).isNotHidden().orderBy(["name"],"asc").toList();c._areas=s.map((e,t)=>{const r="undisclosed"===e.area_id;return{...e,order:10*(t+1),...c.strategyOptions.areas._,...c.strategyOptions.areas[e.area_id],...r?{area_id:"undisclosed",type:"default"}:{}}}),c._areas=new a.A(c._areas).orderBy(["order","name"],"asc").toList(),c.strategyOptions.views=c.sortConfigByOrder(c.strategyOptions.views),c.strategyOptions.domains=c.sortConfigByOrder(c.strategyOptions.domains),c._initialized=!0}static getCountTemplate(e,t,r){return c.initialized?`{% set entities = [${new a.A(c.entities).whereDomain(e).where(e=>!e.entity_id.endsWith("_stateful_scene")&&"group"!==e.platform).toList().map(e=>`states['${e.entity_id}']`)}] %}\n {{ entities\n | selectattr('state','${t}','${r}')\n | selectattr('state','ne','unavailable')\n | selectattr('state','ne','unknown')\n | list\n | count\n }}`:((0,n.OG)(n.br,"Registry is not initialized!"),"?")}static getExposedNames(e){if("badge"===e)return Object.entries(c.strategyOptions.badges).filter(([e,t])=>!0===t).map(([e])=>e.split("_")[0]);const t=c.strategyOptions[`${e}s`];return Object.keys(t).filter(e=>"_"!==e&&"default"!==e&&!t[e].hidden)}static async fetchRegistry(e){try{[c._entities,c._devices,c._areas]=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){(0,n.OG)(n.ZY,"Error importing Home Assistant registries!",e)}}static sortConfigByOrder(e){return Object.fromEntries(Object.entries(e).sort(([,e],[,t])=>(e.order??1/0)-(t.order??1/0)||(e.title??"").localeCompare(t.title??"",void 0,{numeric:!0,sensitivity:"base"})))}}c._initialized=!1,c._areas=[],c.getDisplayName=e=>{if(e.name)return e.name;if(e.has_entity_name&&e.device_id){const t=c.devices.find(t=>t.id===e.device_id),r=t?.name_by_user??t?.name;if(r)return e.original_name?`${r} ${e.original_name}`:r}return e.original_name?e.original_name:(e.entity_id.split(".")[1]||e.entity_id).replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}},5548(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(1241),i=r(6964);const n=class{constructor(){this.configuration={type:"template"},s.O.initialized||(0,i.OG)(i.ZY,"Registry is not initialized!")}getConfiguration(){return this.configuration}}},2543(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(5548),i=r(1241);class n extends s.default{constructor(e){super(),this.configuration={...this.configuration,...n.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:thermostat",color:"orange",content:i.O.getCountTemplate("climate","ne","off"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"climates"}}}}const o=n},2299(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(1241),i=r(5548);class n extends i.default{constructor(e){super(),this.configuration={...this.configuration,...n.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:window-open",color:"cyan",content:s.O.getCountTemplate("cover","search","(open|opening|closing)"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"covers"}}}}const o=n},6305(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2682),n=r(5548);class o extends n.default{constructor(e){super(),this.configuration={...this.configuration,...o.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:fan",color:"green",content:s.O.getCountTemplate("fan","eq","on"),tap_action:{action:"perform-action",perform_action:"fan.turn_off",target:{entity_id:new i.A(s.O.entities).whereDomain("fan").getValuesByProperty("entity_id")}},hold_action:{action:"navigate",navigation_path:"fans"}}}}const a=o},1806(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2682),n=r(5548);class o extends n.default{constructor(e){super(),this.configuration={...this.configuration,...o.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:lightbulb-group",color:"amber",content:s.O.getCountTemplate("light","eq","on"),tap_action:{action:"perform-action",perform_action:"light.turn_off",target:{entity_id:new i.A(s.O.entities).whereDomain("light").getValuesByProperty("entity_id")}},hold_action:{action:"navigate",navigation_path:"lights"}}}}const a=o},4710(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(1241),i=r(2682),n=r(5548),o=r(2816);class a extends n.default{constructor(e){super(),this.configuration={...this.configuration,...a.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:dip-switch",color:"blue",content:s.O.getCountTemplate("switch","eq","on"),tap_action:{action:"perform-action",confirmation:{text:(0,o.k)("switch.badge_confirmation")},perform_action:"switch.turn_off",target:{entity_id:new i.A(s.O.entities).whereDomain("switch").getValuesByProperty("entity_id")}},hold_action:{action:"navigate",navigation_path:"switches"}}}}const c=a},7558(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(5548);class i extends s.default{constructor(e,t){super(),this.configuration={...this.configuration,...i.getDefaultConfig(e),...t}}static getDefaultConfig(e){return{type:"entity",entity:e,state_content:["state","temperature"]}}}const n=i},4818(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(1241),i=r(6964);const n=class{constructor(e){this.configuration={type:"custom:mushroom-entity-card",icon:"mdi:help-circle"},s.O.initialized||(0,i.OG)(i.ZY,"Registry is not initialized!"),this.entity=e}getCard(){return{...this.configuration,entity:"entity_id"in this.entity?this.entity.entity_id:void 0}}}},4301(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(4818),i=r(1241),n=r(2816);class o extends s.default{static getDefaultConfig(){return{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"}}}constructor(e,t){super(e);const r=o.getDefaultConfig();let s=t;r.primary=e.name,r.icon=e.icon||r.icon,i.O.strategyOptions.show_positions&&(r.secondary=`${(0,n.k)("generic.ordering_position")}: ${e.order}`),r.tap_action&&"navigation_path"in r.tap_action&&(r.tap_action.navigation_path=e.area_id),s&&(s={...s,type:r.type}),this.configuration={...this.configuration,...r,...s}}}const a=o},1151(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(5982);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-entity-card",icon:"mdi:power-cycle",icon_color:"green"}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},2723(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{entity:"",type:"picture-entity",show_name:!1,show_state:!1,camera_view:"live"}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},8721(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-climate-card",icon:void 0,hvac_modes:["off","cool","heat","fan_only"],show_temperature_control:!0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},8033(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-cover-card",icon:void 0,show_buttons_control:!0,show_position_control:!0,show_tilt_position_control:!0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},2667(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-fan-card",icon:void 0,show_percentage_control:!0,show_oscillate_control:!0,icon_animation:!0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},9440(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>i});var s=r(2816);const i=class{constructor(e){this.configuration={type:"custom:mushroom-template-card",primary:`{% set time = now().hour %}\n {% if (time >= 18) %}\n ${(0,s.k)("generic.good_evening")}, {{user}}!\n {% elif (time >= 12) %}\n ${(0,s.k)("generic.good_afternoon")}, {{user}}!\n {% elif (time >= 6) %}\n ${(0,s.k)("generic.good_morning")}, {{user}}!\n {% else %}\n ${(0,s.k)("generic.hello")}, {{user}}! {% endif %}`,icon:"mdi:hand-wave",icon_color:"orange",tap_action:{action:"none"},double_tap_action:{action:"none"},hold_action:{action:"none"}},this.configuration={...this.configuration,...e}}getCard(){return this.configuration}}},9042(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(4818),i=r(1241),n=r(2816);class o extends s.default{static getDefaultConfig(){return{type:"area",area:""}}constructor(e,t){super(e);const r=o.getDefaultConfig();r.area=e.area_id,r.navigation_path=r.area,i.O.strategyOptions.show_positions&&(r.name=`${e.name} - ${(0,n.k)("generic.ordering_position")}: ${e.order}`),this.configuration={...this.configuration,...r,...t,type:r.type}}}const a=o},4137(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>i});class s{static getDefaultConfig(){return{type:"custom:mushroom-title-card",iconOn:"mdi:power-on",iconOff:"mdi:power-off",onService:"none",offService:"none"}}constructor(e,t){this.target=e,this.configuration={...s.getDefaultConfig(),...t}}createCard(){const e=[{type:"custom:mushroom-title-card",title:this.configuration.title,subtitle:this.configuration.subtitle}];return this.configuration.show_controls&&e.push({type:"horizontal-stack",cards:[{type:"custom:mushroom-template-card",icon:this.configuration.iconOff,layout:"vertical",icon_color:"red",tap_action:{action:"call-service",service:this.configuration.offService,target:this.target,data:{}}},{type:"custom:mushroom-template-card",icon:this.configuration.iconOn,layout:"vertical",icon_color:"amber",tap_action:{action:"call-service",service:this.configuration.onService,target:this.target,data:{}}}]}),{type:"horizontal-stack",cards:e}}}const i=s},1810(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(7212);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-select-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},8254(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(2700),i=r(4818);class n extends i.default{static getDefaultConfig(){return{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",perform_action:"light.turn_on",target:{entity_id:void 0},data:{rgb_color:[255,255,255]}}}}constructor(e,t){super(e);const r=n.getDefaultConfig();(0,s.eq)(r.double_tap_action)&&(r.double_tap_action.target={entity_id:e.entity_id}),this.configuration={...this.configuration,...r,...t}}}const o=n},6555(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-lock-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},9879(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{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"]}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},4486(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-entity-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},2137(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-number-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},845(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-person-card",layout:"vertical",primary_info:"none",secondary_info:"none",icon_type:"entity-picture"}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},2858(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(1241),i=r(4818),n=r(3708),o=r(2700);class a extends i.default{static getDefaultConfig(){return{type:"custom:mushroom-entity-card",tap_action:{action:"perform-action",perform_action:"scene.turn_on",target:{}}}}constructor(e,t){const r=e.entity_id.split(".").pop(),i=s.O.entities.find(e=>e.entity_id===`switch.${r}_stateful_scene`);if(super(i??e),i)return void(this.configuration=new n.default(i).getCard());const c=a.getDefaultConfig();(0,o.eq)(c.tap_action)&&(c.tap_action.target={entity_id:e.entity_id}),c.icon=s.O.hassStates[e.entity_id]?.attributes.icon??c.icon,this.configuration={...this.configuration,...c,...t}}}const c=a},7212(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-select-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},5982(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mini-graph-card",animate:!0,icon:"mdi:information",line_color:"green"}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},3708(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-entity-card",icon:void 0,tap_action:{action:"toggle"}}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},7430(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});const s=["on_off","start_pause","stop","locate","clean_spot","return_home"];var i=r(4818);class n extends i.default{static getDefaultConfig(){return{type:"custom:mushroom-vacuum-card",icon:void 0,icon_animation:!0,commands:[...s],tap_action:{action:"more-info"}}}constructor(e,t){super(e),this.configuration={...this.configuration,...n.getDefaultConfig(),...t}}}const o=n},8868(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(2816),i=r(4818);class n extends i.default{static getDefaultConfig(){return{type:"custom:mushroom-template-card",icon:"mdi:valve",icon_color:"blue",double_tap_action:{action:"toggle"}}}constructor(e,t){super(e);const r=n.getDefaultConfig();r.entity=e.entity_id,r.icon=e.icon??r.icon,r.primary=e.name??e.original_name??"?",r.secondary=`{% \n set mapping = {\n 'open': '${(0,s.k)("valve.open")}',\n 'opening': '${(0,s.k)("valve.opening")}',\n 'closed': '${(0,s.k)("valve.closed")}',\n 'closing': '${(0,s.k)("valve.closing")}',\n 'stopped': '${(0,s.k)("valve.stopped")}',\n 'unavailable': '${(0,s.k)("generic.unavailable")}'\n }\n %}\n {{ mapping.get(states('${e.entity_id}'), '${(0,s.k)("generic.unknown")}') }}`,this.configuration={...this.configuration,...r,...t}}}const o=n},7688(e,t,r){"use strict";r.d(t,{ConfigurationDefaults:()=>i});var s=r(2816);const i={areas:{_:{type:"AreaCard"},undisclosed:{aliases:[],area_id:"undisclosed",created_at:0,floor_id:null,hidden:!1,humidity_entity_id:null,icon:"mdi:floor-plan",labels:[],modified_at:0,name:(0,s.k)("generic.undisclosed"),picture:null,temperature_entity_id:null,order:1/0}},card_options:{},badges:{weather_entity:"auto",light_count:!0,fan_count:!0,cover_count:!0,switch_count:!0,climate_count:!0,extra_badges:[]},debug:!1,domains:{_:{hide_config_entities:!0,hide_diagnostic_entities:!0,show_controls:!0,stack_count:1},lock:{order:10,title:(0,s.k)("lock.locks"),show_controls:!1,hidden:!1},binary_sensor:{order:20,title:(0,s.k)("sensor.binary_sensors"),show_controls:!1,hidden:!1,stack_count:2},camera:{order:30,title:(0,s.k)("camera.cameras"),show_controls:!1,hidden:!1},light:{order:40,title:(0,s.k)("light.lights"),iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off",hidden:!1},scene:{order:50,title:(0,s.k)("scene.scenes"),show_controls:!1,onService:"scene.turn_on",hidden:!1},climate:{order:60,title:(0,s.k)("climate.climates"),show_controls:!1,hidden:!1},fan:{order:70,title:(0,s.k)("fan.fans"),iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off",hidden:!1},cover:{order:80,title:(0,s.k)("cover.covers"),iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover",hidden:!1},media_player:{order:90,title:(0,s.k)("media_player.media_players"),show_controls:!1,hidden:!1},switch:{order:100,title:(0,s.k)("switch.switches"),iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off",hidden:!1},vacuum:{order:110,title:(0,s.k)("vacuum.vacuums"),iconOn:"mdi:robot-vacuum",iconOff:"mdi:robot-vacuum-off",onService:"vacuum.start",offService:"vacuum.stop",hidden:!1},valve:{order:120,title:(0,s.k)("valve.valves"),iconOn:"mdi:valve-open",iconOff:"mdi:valve-closed",onService:"valve.open_valve",offService:"valve.close_valve",hidden:!1},select:{order:130,title:(0,s.k)("select.selects"),show_controls:!1,hidden:!1},input_select:{order:140,title:(0,s.k)("input_select.input_selects"),show_controls:!1,hidden:!1},number:{order:150,title:(0,s.k)("generic.numbers"),show_controls:!1,hidden:!1},sensor:{order:160,title:(0,s.k)("sensor.sensors"),show_controls:!1,hidden:!1},default:{order:170,title:(0,s.k)("generic.miscellaneous"),show_controls:!1,hidden:!1}},extra_cards:[],extra_views:[],home_view:{hidden:{areas:!1,areas_title:!1,badges:!1,greeting:!0,persons:!1},stack_count:{_:2}},show_positions:!1,views:{camera:{order:60,hidden:!1},climate:{order:50,hidden:!1},cover:{order:30,hidden:!1},fan:{order:20,hidden:!1},home:{order:-1/0,hidden:!1},light:{order:10,hidden:!1},lock:{order:90,hidden:!1},scene:{order:80,hidden:!1},switch:{order:40,hidden:!1},vacuum:{order:70,hidden:!1},valve:{order:100,hidden:!1}},quick_access_cards:[]}},2700(e,t,r){"use strict";r.d(t,{dQ:()=>l,eq:()=>o,uS:()=>c,yI:()=>u});const s=["_","binary_sensor","camera","climate","cover","default","fan","input_select","light","lock","media_player","number","scene","select","sensor","switch","vacuum","valve"],i=["camera","climate","cover","fan","home","light","lock","scene","switch","vacuum","valve"],n=["light","fan","cover","switch","climate","weather"];function o(e){return!!e&&("perform-action"===e.action||"call-service"===e.action)&&"perform_action"in e}function a(e,t){return t.includes(e)}function c(e){return a(e,i)}function l(e){return a(e,s)}function u(e){return a(e,n)}},2682(e,t,r){"use strict";r.d(t,{A:()=>a});var s=r(1241),i=r(6964),n=r(3007);class o{constructor(e){this.filters=[],this.invertNext=!1,this.entries=e,this.entryIdentifier=0===e.length||"entity_id"in e[0]?"entity_id":"floor_id"in e[0]?"area_id":"id"}not(){return this.invertNext=!this.invertNext,this}resetFilters(){return this.filters=[],this.invertNext=!1,this}where(e){return this.filters.push(this.checkInversion(e)),this}when(e,t){return e?t(this):this}whereAreaId(e,t=!0){return this.filters.push(this.checkInversion(r=>{const i=r;let n;if(t&&i.device_id&&(n=s.O.devices.find(e=>e.id===i.device_id)?.area_id),!e)return r.area_id===e&&n===e;if("undisclosed"===e){const e="undisclosed"===n||null==n;return"undisclosed"===r.area_id&&e}return r.area_id===e||"undisclosed"===r.area_id&&n===e})),this}whereNameContains(e){const t=e.toLowerCase();return this.filters.push(this.checkInversion(e=>{const r=e;return[r.name,r.original_name,r.name_by_user].filter(e=>"string"==typeof e).some(e=>e.toLowerCase().includes(t))})),this}whereDomain(e){const t=e+".";return this.filters.push(this.checkInversion(e=>"entity_id"in e&&e.entity_id.startsWith(t))),this}whereFloorId(e){return this.filters.push(this.checkInversion(t=>{const r="floor_id"in t;return void 0===e?!r:r&&t.floor_id===e})),this}whereDeviceId(e){return this.filters.push(this.checkInversion(t=>{const r="id"in t,s="device_id"in t;return void 0===e?!r&&!s:r&&t.id===e||s&&t.device_id===e})),this}whereEntityId(e){return this.filters.push(this.checkInversion(t=>void 0===e?!("entity_id"in t):"entity_id"in t&&t.entity_id===e)),this}whereDisabledBy(e){return this.filters.push(this.checkInversion(t=>{const r="disabled_by"in t;return void 0===e?!r:r&&t.disabled_by===e})),this}whereHiddenBy(e){return this.filters.push(this.checkInversion(t=>{const r="hidden_by"in t;return void 0===e?!r:r&&t.hidden_by===e})),this}isNotHidden(e=!0){return this.filters.push(this.checkInversion(t=>{const r="hidden_by"in t&&t.hidden_by;if(!e)return!r;const i=t[this.entryIdentifier],n="area_id"===this.entryIdentifier?{...s.O.strategyOptions.areas._,...s.O.strategyOptions.areas[i]}:s.O.strategyOptions.card_options?.[i];return!(r||!0===n?.hidden)})),this}whereEntityCategory(e){const t=this.invertNext;return this.invertNext=!1,this.filters.push(r=>{const s="entity_category"in r?r.entity_category:void 0;return t?s!==e:s===e}),this}orderBy(e,t="asc"){const r="asc"===t?1:-1,s=[...this.entries].sort((s,i)=>{for(const o of e){const e=s[o],a=i[o];if(e===a)continue;const[c,l]=(0,n.B3)(e),[u,d]=(0,n.B3)(a);if(c!==u)return(c-u)*r;const h=(0,n.ck)(l,d,t);if(0!==h)return h}return 0}),i=new o(s);return i.filters=[...this.filters],i}take(e){const t=Math.max(0,e);return this.filters.push((e,r)=>rr>=t),this}toList(){const e=new o(this.entries);return e.filters=[...this.filters],e.entries.filter((t,r)=>e.filters.every(e=>e(t,r)))}getValuesByProperty(e){return this.toList().map(t=>t[e]).filter(e=>void 0!==e)}first(){const e=new o(this.entries);return e.filters=[...this.filters],e.entries.find((t,r)=>e.filters.every(e=>e(t,r)))}single(){const e=new o(this.entries);e.filters=[...this.filters];const t=e.entries.filter((t,r)=>e.filters.every(e=>e(t,r)));if(1===t.length)return t[0];(0,i.OG)(i.br,`Expected a single element, but found ${t.length}.`)}count(){const e=new o(this.entries);return e.filters=[...this.filters],e.entries.filter((t,r)=>e.filters.every(e=>e(t,r))).length}checkInversion(e){return this.invertNext?(this.invertNext=!1,t=>!e(t)):e}}const a=o},3007(e,t,r){"use strict";function s(e){return e.replace(/^([a-z])|([-_][a-z])/g,e=>e.toUpperCase().replace(/[-_]/g,""))}function i(e){if("function"==typeof structuredClone)try{return structuredClone(e)}catch{}try{return JSON.parse(JSON.stringify(e))}catch{return e}}function n(e,t,r="asc"){if(e===t)return 0;const s="asc"===r?1:-1;if(null==e||null==t)return(null==e?-1:1)*s;if("string"==typeof e&&"string"==typeof t)return e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})*s;const i=e=>"number"==typeof e||"boolean"==typeof e;return i(e)&&i(t)?(+e-+t)*s:0}function o(e){return e===-1/0?[0,0]:null==e?[2,0]:e===1/0?[3,0]:[1,e]}r.d(t,{B3:()=>o,Go:()=>i,ck:()=>n,ps:()=>s})},2737(e,t,r){"use strict";function s(e,t=2,r){if(e.length<=1)return e;const s=(e,t)=>{if(e.length<=1)return e;const r=[];for(let s=0;ss})},6964(e,t,r){"use strict";r.d(t,{OG:()=>p,QC:()=>n,Ux:()=>f,WU:()=>o,ZY:()=>u,br:()=>c,nR:()=>l,tm:()=>a});var s,i=r(3007);!function(e){e[e.Off=0]="Off",e[e.Debug=1]="Debug",e[e.Info=2]="Info",e[e.Warn=3]="Warn",e[e.Error=4]="Error",e[e.Fatal=5]="Fatal"}(s||(s={}));const{Off:n,Debug:o,Info:a,Warn:c,Error:l,Fatal:u}=s;let d=s.Fatal;function h(e){if(e.includes("@"))return e.split("@")[0]||"anonymous";const t=e.match(/at ([^( ]+)/);return t?t[1]:null}function f(e){d=e}function p(e,t,...r){if(d===s.Off||e>d)return;const n="Mushroom Strategy - An error occurred. Check the console (F12) for details.",o=`[${s[e].toUpperCase()}]`,a=r.map(i.Go),c=`[at ${function(e){if(!e)return"unknown function";const t=e.split("\n");for(const e of t){if(!e)continue;const t=h(e);if(t&&"logMessage"!==t)return t}return"unknown function"}((new Error).stack)}]`;switch(e){case s.Debug:console.debug(`${o}${c} ${t}`,...a);break;case s.Info:console.info(`${o}${c} ${t}`,...a);break;case s.Warn:console.warn(`${o}${c} ${t}`,...a);break;case s.Error:throw console.error(`${o}${c} ${t}`,...a),n;case s.Fatal:throw console.error(`${o}${c} ${t}`,...a),alert?.(`${o} ${t}`),n}}},2816(e,t,r){"use strict";r.d(t,{A:()=>O,k:()=>E});const s=JSON.parse('{"camera":{"all_cameras":"Alle Kameras","cameras":"Kameras"},"climate":{"all_climates":"Alle Klimaanlagen","climates":"Klimaanlagen"},"cover":{"all_covers":"Alle Abdeckungen","covers":"Abdeckungen"},"fan":{"all_fans":"Alle Ventilatoren","fans":"Ventilatoren"},"generic":{"all":"Alle","areas":"Bereiche","busy":"Beschäftigt","good_afternoon":"Guten Nachmittag","good_evening":"Guten Abend","good_morning":"Guten Morgen","hello":"Hallo","home":"Start","miscellaneous":"Sonstiges","numbers":"Zahlen","off":"Aus","on":"Ein","open":"Offen","ordering_position":"Sortierposition","unavailable":"Nicht verfügbar","unclosed":"Nicht Geschlossen","undisclosed":"Sonstiges","unknown":"Unbekannt"},"input_select":{"input_selects":"Auswahl-Eingaben"},"light":{"all_lights":"Alle Leuchten","lights":"Leuchten"},"lock":{"locked":"Gesperrt","all_locks":"Alle Schlösser","locks":"Schlösser","unlocked":"Entsperrt"},"media_player":{"media_players":"Wiedergabegeräte"},"scene":{"scenes":"Szenen"},"select":{"selects":"Auswahlen"},"sensor":{"binary_sensors":"Binäre Sensoren","sensors":"Sensoren"},"switch":{"all_switches":"Alle Schalter","badge_confirmation":"Warnung: Diese Aktion wird alle Schalter ausschalten. Sind Sie sicher, dass Sie fortfahren möchten?","switches":"Schalter"},"vacuum":{"all_vacuums":"Alle Staubsauger","vacuums":"Staubsauger"},"valve":{"all_valves":"Alle Ventile","valves":"Ventile","open":"Offen","opening":"Öffnet","closed":"Geschlossen","closing":"Schließt","stopped":"Gestoppt","unclosed":"Nicht geschlossen"}}');var i=r.t(s,2);const n=JSON.parse('{"camera":{"all_cameras":"All Cameras","cameras":"Cameras"},"climate":{"all_climates":"All Climates","climates":"Climates"},"cover":{"all_covers":"All Covers","covers":"Covers"},"fan":{"all_fans":"All Fans","fans":"Fans"},"generic":{"all":"All","areas":"Areas","busy":"Busy","good_afternoon":"Good afternoon","good_evening":"Good evening","good_morning":"Good morning","hello":"Hello","home":"Home","miscellaneous":"Miscellaneous","numbers":"Numbers","off":"Off","on":"On","open":"Open","ordering_position":"Ordering position","unavailable":"Unavailable","unclosed":"Unclosed","undisclosed":"Other","unknown":"Unknown"},"input_select":{"input_selects":"Input Selects"},"light":{"all_lights":"All Lights","lights":"Lights"},"lock":{"all_locks":"All Locks","locked":"Locked","locks":"Locks","unlocked":"Unlocked"},"media_player":{"media_players":"Media Players"},"scene":{"scenes":"Scenes"},"select":{"selects":"Selects"},"sensor":{"binary_sensors":"Binary Sensors","sensors":"Sensors"},"switch":{"all_switches":"All Switches","badge_confirmation":"Warning: This action will turn off all switches. Are you sure you want to continue?","switches":"Switches"},"vacuum":{"all_vacuums":"All Vacuums","vacuums":"Vacuums"},"valve":{"all_valves":"All Valves","valves":"Valves","open":"Open","opening":"Opening","closed":"Closed","closing":"Closing","stopped":"Stopped","unclosed":"Unclosed"}}');var o=r.t(n,2);const a=JSON.parse('{"camera":{"all_cameras":"Todas las Cámaras","cameras":"Cámaras"},"climate":{"all_climates":"Todos los Termostatos","climates":"Termostatos"},"cover":{"all_covers":"Todas las Cubiertas","covers":"Cubiertas"},"fan":{"all_fans":"Todos los Ventiladores","fans":"Ventiladores"},"generic":{"all":"Todo","areas":"Áreas","busy":"Ocupado","good_afternoon":"Buenas tardes","good_evening":"Buenas noches","good_morning":"Buenos días","hello":"Hola","home":"Inicio","miscellaneous":"Varios","numbers":"Números","off":"Apagado","on":"Encendido","open":"Abierto","ordering_position":"Posición de orden","unavailable":"No Disponible","unclosed":"Sin Cerrar","undisclosed":"Varios","unknown":"Desconocido"},"input_select":{"input_selects":"Selecciones de Entrada"},"light":{"all_lights":"Todas las Luces","lights":"Luces"},"lock":{"all_locks":"Todas las Candados","locked":"Locked","locks":"Candados","unlocked":"Desbloqueado"},"media_player":{"media_players":"Reproductores Multimedia"},"scene":{"scenes":"Scenas"},"select":{"selects":"Seleccionar"},"sensor":{"binary_sensors":"Binario Sensores","sensors":"Sensores"},"switch":{"all_switches":"Todos los Apagadores","badge_confirmation":"Advertencia: Esta acción apagará todos los interruptores. ¿Está seguro de que desea continuar?","switches":"Apagadores"},"vacuum":{"all_vacuums":"Todas las Aspiradoras","vacuums":"Aspiradoras"},"valve":{"all_valves":"Todas las válvulas","valves":"Válvulas","open":"Abierta","opening":"Abriendo","closed":"Cerrada","closing":"Cerrando","stopped":"Detenida","unclosed":"No Cerrada"}}');var c=r.t(a,2);const l=JSON.parse('{"camera":{"all_cameras":"Összes kamera","cameras":"Kamerák"},"climate":{"all_climates":"Összes klíma","climates":"Klímák"},"cover":{"all_covers":"Összes redőny","covers":"Redőnyök"},"fan":{"all_fans":"Összes ventilátor","fans":"Ventilátorok"},"generic":{"all":"Összes","areas":"Területek","busy":"Foglalt","good_afternoon":"Jó napot","good_evening":"Jó estét","good_morning":"Jó reggelt","hello":"Hello","home":"Otthon","miscellaneous":"Egyéb","numbers":"Számok","off":"Ki","on":"Be","open":"Nyitva","ordering_position":"Rendezési pozíció","unavailable":"Nem áll rendelkezésre","unclosed":"Nincs bezárva","undisclosed":"Egyéb","unknown":"Ismeretlen"},"input_select":{"input_selects":"Bemenetválasztók"},"light":{"all_lights":"Összes világítás","lights":"Lámpák"},"lock":{"all_locks":"Összes zár","locked":"Zárva","locks":"Zárak","unlocked":"Nyitott"},"media_player":{"media_players":"Médialejátszók"},"scene":{"scenes":"Jelenetek"},"select":{"selects":"Kiválasztások"},"sensor":{"binary_sensors":"Kétállapotú Szenzorok","sensors":"Szenzorok"},"switch":{"all_switches":"Összes kapcsoló","chip_confirmation":"Figyelem: Ez a művelet az összes kapcsolót lekapcsolja. Biztosan folytatja?","switches":"Kapcsolók"},"vacuum":{"all_vacuums":"Összes porszívó","vacuums":"Porszívók"},"valve":{"all_valves":"Összes szelep","valves":"Szelepek","open":"Nyitva","opening":"Nyitás","closed":"Zárva","closing":"Zárás","stopped":"Megállt","unclosed":"Nincs zárva"}}');var u=r.t(l,2);const d=JSON.parse('{"camera":{"all_cameras":"Toutes les caméras","cameras":"Caméras"},"climate":{"all_climates":"Tous les thermostats","climates":"Thermostats"},"cover":{"all_covers":"Tous les volets","covers":"Volets"},"fan":{"all_fans":"Tous les ventilateurs","fans":"Ventilateurs"},"generic":{"all":"Tout","areas":"Pièces","busy":"Occupé(e)","good_afternoon":"Bon après-midi","good_evening":"Bonsoir","good_morning":"Bonjour","hello":"Bonjour","home":"Accueil","miscellaneous":"Divers","numbers":"Nombres","off":"Éteint(e)","on":"Allumé(e)","open":"Ouvert(e)","ordering_position":"Position de tri","unavailable":"Indisponible","unclosed":"Non fermé(e)","undisclosed":"Non divulgué","unknown":"Inconnu"},"input_select":{"input_selects":"Sélecteurs d’options"},"light":{"all_lights":"Toutes les lumières","lights":"Lumières"},"lock":{"all_locks":"Tous les verrous","locked":"Verrouillé","locks":"Verrous","unlocked":"Déverrouillé"},"media_player":{"media_players":"Lecteurs multimédias"},"scene":{"scenes":"Scènes"},"select":{"selects":"Sélecteurs"},"sensor":{"binary_sensors":"Capteurs Binaires","sensors":"Capteurs"},"switch":{"all_switches":"Tous les interrupteurs","badge_confirmation":"Attention : cette action éteindra tous les interrupteurs. Êtes-vous sûr de vouloir continuer ?","switches":"Interrupteurs"},"vacuum":{"all_vacuums":"Tous les aspirateurs","vacuums":"Aspirateurs"},"valve":{"all_valves":"Toutes les vannes","valves":"Vannes","open":"Ouverte","opening":"Ouverture","closed":"Fermée","closing":"Fermeture","stopped":"Arrêtée","unclosed":"Non fermée"}}');var h=r.t(d,2);const f=JSON.parse('{"camera":{"all_cameras":"Alle Cameras","cameras":"Cameras"},"climate":{"all_climates":"Alle Klimaatregelingen","climates":"Klimaatregelingen"},"cover":{"all_covers":"Alle Bedekkingen","covers":"Bedekkingen"},"fan":{"all_fans":"Alle Ventilatoren","fans":"Ventilatoren"},"generic":{"all":"Alle","areas":"Ruimtes","busy":"Bezig","good_afternoon":"Goedemiddag","good_evening":"Goedeavond","good_morning":"Goedemorgen","hello":"Hallo","home":"Start","miscellaneous":"Overige","numbers":"Nummers","off":"Uit","on":"Aan","open":"Open","ordering_position":"Sorteer Positie","unavailable":"Onbeschikbaar","unclosed":"Niet Gesloten","undisclosed":"Overige","unknown":"Onbekend"},"input_select":{"input_selects":"Lijsten"},"light":{"all_lights":"Alle Lampen","lights":"Lampen"},"lock":{"all_locks":"Alle Sloten","locked":"Vergrendeld","locks":"Sloten","unlocked":"Ontgrendeld"},"media_player":{"media_players":"Mediaspelers"},"scene":{"scenes":"Scenes"},"select":{"selects":"Statuslijsten"},"sensor":{"binary_sensors":"Binaire Sensoren","sensors":"Sensoren"},"switch":{"all_switches":"Alle Schakelaars","badge_confirmation":"Waarschuwing: Deze actie zal alle schakelaars uitzetten. Weet u zeker dat u door wilt gaan?","switches":"Schakelaars"},"vacuum":{"all_vacuums":"Alle Afzuiging","vacuums":"Afzuiging"},"valve":{"all_valves":"Alle kleppen","valves":"Kleppen","open":"Open","opening":"Openen","closed":"Gesloten","closing":"Sluiten","stopped":"Gestopt","unclosed":"Niet gesloten"}}');var p=r.t(f,2);const g=JSON.parse('{"camera":{"all_cameras":"Todas as câmeras","cameras":"Câmeras"},"climate":{"all_climates":"Todos os climatizadores","climates":"Climatizadores"},"cover":{"all_covers":"Todas as persianas","covers":"Persianas"},"fan":{"all_fans":"Todos os ventiladores","fans":"Ventiladores"},"generic":{"all":"Todos","areas":"Áreas","busy":"Ocupado","good_afternoon":"Boa tarde","good_evening":"Boa noite","good_morning":"Bom dia","hello":"Olá","home":"Início","miscellaneous":"Variados","numbers":"Números","off":"Desligado","on":"Ligado","open":"Aberto","ordering_position":"Posição de ordenação","unavailable":"Indisponível","unclosed":"Não fechado","undisclosed":"Outro","unknown":"Desconhecido"},"input_select":{"input_selects":"Seleção de entrada"},"light":{"all_lights":"Todas as luzes","lights":"Luzes"},"lock":{"all_locks":"Todas as fechaduras","locked":"Travado","locks":"Fechaduras","unlocked":"Destravado"},"media_player":{"media_players":"Reprodutores de mídia"},"scene":{"scenes":"Cenas"},"select":{"selects":"Seleção"},"sensor":{"binary_sensors":"Binário Sensores","sensors":"Sensores"},"switch":{"all_switches":"Todos os interruptores","badge_confirmation":"Atenção: Essa ação irá desligar todos os interruptores. Tem certeza que deseja continuar?","switches":"Interruptores"},"vacuum":{"all_vacuums":"Todos os aspiradores","vacuums":"Aspiradores"},"valve":{"all_valves":"Todas as válvulas","valves":"Válvulas","open":"Aberto","opening":"Abrindo","closed":"Fechado","closing":"Fechando","stopped":"Parado","unclosed":"Nao fechado"}}');var m=r.t(g,2),v=r(6964);const _={de:i,en:o,es:c,fr:h,hu:u,nl:p,"pt-BR":m};function y(e,t){try{return e.split(".").reduce((e,t)=>e[t],_[t])}catch{return}}let w;function O(e){const t=e?.locale.language??"en";w=e=>y(e,t)??y(e,"en")??e}function E(e){return w?w(e):((0,v.OG)(v.br,"localize is not initialized! Call setupCustomLocalize first."),e)}},1122(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>u});var s=r(4137),i=r(1241),n=r(3007),o=r(6964),a=r(2682),c=r(2737),l=r(2816);const u=class{constructor(){this.baseConfiguration={icon:"mdi:view-dashboard",subview:!1},this.viewHeaderCardConfiguration={cards:[],type:""},i.O.initialized||(0,o.OG)(o.ZY,"Registry is not initialized!")}get domain(){return this.constructor.domain}async getView(){const e=await this.createSections();return!!e.length&&("home"===this.domain?{...this.baseConfiguration,sections:e}:{...this.baseConfiguration,cards:e})}async createSections(){const e=[],t=(0,n.ps)(this.domain+"Card"),o=(await r(2560)(`./${t}`)).default,u=new a.A(i.O.entities).whereDomain(this.domain).where(e=>!e.entity_id.endsWith("_stateful_scene")).toList();for(const t of i.O.areas){const r=new a.A(u).whereAreaId(t.area_id).toList();let n=[],d={area_id:[t.area_id]};if("undisclosed"===t.area_id&&(d={entity_id:r.map(e=>e.entity_id)}),n.push(...r.map(e=>new o(e,i.O.strategyOptions.card_options?.[e.entity_id]).getCard())),n.length){n=(0,c.P)(n,i.O.strategyOptions.domains[this.domain].stack_count??i.O.strategyOptions.domains._.stack_count);const r="headerCardConfiguration"in this.baseConfiguration?this.baseConfiguration.headerCardConfiguration:{};n.unshift(new s.default(d,{title:t.name,...r,subtitle:i.O.strategyOptions.show_positions?`${(0,l.k)("generic.ordering_position")}: ${t.order}`:void 0}).createCard()),e.push({type:"vertical-stack",cards:n})}}return this.viewHeaderCardConfiguration.cards.length&&e.length&&e.unshift(this.viewHeaderCardConfiguration),e}initializeViewConfig(e,t={},r){this.baseConfiguration={...this.baseConfiguration,...e,...t},this.baseConfiguration.headerCardConfiguration={...this.baseConfiguration.headerCardConfiguration,show_controls:i.O.strategyOptions.domains[this.domain].show_controls??i.O.strategyOptions.domains._.show_controls},this.viewHeaderCardConfiguration=new s.default(this.getDomainTargets(),{...this.baseConfiguration.headerCardConfiguration,...r}).createCard()}getDomainTargets(){return{entity_id:i.O.entities.filter(e=>e.entity_id.startsWith(this.domain+".")).map(e=>e.entity_id)}}}},1255(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("camera.cameras"),path:"cameras",icon:"mdi:cctv",subview:!1,headerCardConfiguration:{show_controls:!1}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("camera.all_cameras"),subtitle:`${s.O.getCountTemplate(o.domain,"ne","off")} ${(0,i.k)("camera.cameras")} `+(0,i.k)("generic.busy")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="camera";const a=o},6559(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("climate.climates"),path:"climates",icon:"mdi:thermostat",subview:!1,headerCardConfiguration:{show_controls:!1}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("climate.all_climates"),subtitle:`${s.O.getCountTemplate(o.domain,"ne","off")} ${(0,i.k)("climate.climates")} `+(0,i.k)("generic.busy")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="climate";const a=o},7547(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("cover.covers"),path:"covers",icon:"mdi:window-open",subview:!1,headerCardConfiguration:{iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("cover.all_covers"),subtitle:`${s.O.getCountTemplate(o.domain,"search","(open|opening|closing)")} ${(0,i.k)("cover.covers")} ${(0,i.k)("generic.unclosed")}`}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="cover";const a=o},245(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("fan.fans"),path:"fans",icon:"mdi:fan",subview:!1,headerCardConfiguration:{iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("fan.all_fans"),subtitle:`${s.O.getCountTemplate(o.domain,"eq","on")} ${(0,i.k)("fan.fans")} `+(0,i.k)("generic.on")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="fan";const a=o},9031(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>p});var s=r(1241),i=r(2700),n=r(3007),o=r(6964),a=r(2816),c=r(1122),l=r(2682),u=r(4137),d=r(2737),h=r(9440);class f extends c.default{constructor(e){super(),this.baseConfiguration={...this.baseConfiguration,...f.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"sections",max_columns:3,header:{badges_position:"top",layout:"center"},title:(0,a.k)("generic.home"),icon:"mdi:home-assistant",path:"home",subview:!1}}async getView(){return{...this.baseConfiguration,badges:await this.createBadgeSection(),sections:await this.createSections()}}async createSections(){const e="(max-width: 1343px)",t="(min-width: 1344px)",r=[];try{const[i,n]=await Promise.all([this.createPersonCards(),this.createAreaCards()]);[["Persons",[i],e,!!i],["Quick Access Wide",s.O.strategyOptions.quick_access_cards,t,!0],["Persons and Areas",[i,n].filter(Boolean),t,!!(i??n)],["Quick Access Narrow",s.O.strategyOptions.quick_access_cards,e,!0],["Areas",[n],e,!!n],["Extra",s.O.strategyOptions.extra_cards,void 0,!0]].forEach(([e,t,s,i])=>{i&&t.length?((e,t,s)=>{const i={type:"grid",cards:t};s&&(i.visibility=[{condition:"screen",media_query:s}]),r.push(i)})(0,t,s):(0,o.OG)(o.tm,`Section ${e} has no entities available.`)})}catch(e){(0,o.OG)(o.nR,"Error importing section cards!",e)}return r}async createBadgeSection(){if(s.O.strategyOptions.home_view.hidden.badges)return void(0,o.OG)(o.tm,"Badges are hidden.");const e=[],t=s.O.getExposedNames("badge");let a;const c="auto"===s.O.strategyOptions.badges.weather_entity?s.O.entities.find(e=>e.entity_id.startsWith("weather."))?.entity_id:s.O.strategyOptions.badges.weather_entity;if(c)try{a=(await Promise.resolve().then(r.bind(r,7558))).default;const t=new a(c);e.push(t.getConfiguration())}catch(e){(0,o.OG)(o.nR,"Error importing badge weather!",e)}else(0,o.OG)(o.tm,"Weather badge has no entities available.");for(const c of t){if(!(0,i.yI)(c)||!new l.A(s.O.entities).whereDomain(c).count()){(0,o.OG)(o.tm,`Badge for domain ${c} is unsupported or has no entities available.`);continue}const t=(0,n.ps)(c+"Badge");try{a=(await r(7315)(`./${t}`)).default;const s=new a;e.push(s.getConfiguration())}catch(e){(0,o.OG)(o.nR,`Error importing badge ${c}!`,e)}}return s.O.strategyOptions.badges?.extra_badges&&e.push(...s.O.strategyOptions.badges.extra_badges),e}async createPersonCards(){if(s.O.strategyOptions.home_view.hidden.persons)return void(0,o.OG)(o.tm,"Persons section is hidden.");const e=s.O.strategyOptions.home_view.hidden.greeting;e&&(0,o.OG)(o.tm,"Greeting card is hidden.");const t=e?void 0:(new h.default).getCard(),i=[],n=(await Promise.resolve().then(r.bind(r,845))).default;return i.push(...s.O.entities.filter(e=>e.entity_id.startsWith("person.")).map(e=>new n(e).getCard())),{type:"vertical-stack",grid_options:{columns:"full"},cards:(0,d.P)(t?[t,...i]:i,s.O.strategyOptions.home_view.stack_count.persons??s.O.strategyOptions.home_view.stack_count._)}}async createAreaCards(){if(s.O.strategyOptions.home_view.hidden.areas)return void(0,o.OG)(o.tm,"Areas section is hidden.");const e=s.O.strategyOptions.home_view.hidden.areas_title;e&&(0,o.OG)(o.tm,"Greeting titleHidden is hidden.");const t=e?void 0:new u.default({},{title:(0,a.k)("generic.areas")}).createCard(),i=[];for(const e of s.O.areas){const t=s.O.strategyOptions.areas[e.area_id]?.type??s.O.strategyOptions.areas._?.type??"default";let n;try{n=(await r(2560)(`./${t}`)).default}catch(e){n=(await Promise.resolve().then(r.bind(r,4301))).default,s.O.strategyOptions.debug&&"default"!==t&&(0,o.OG)(o.nR,`Error importing ${t}: card!`,e)}i.push(new n(e,{...s.O.strategyOptions.areas._,...s.O.strategyOptions.areas[e.area_id]}).getCard())}return{type:"vertical-stack",grid_options:{columns:"full"},cards:(0,d.P)(t?[t,...i]:i,s.O.strategyOptions.home_view.stack_count._,{"custom:mushroom-template-card":s.O.strategyOptions.home_view.stack_count.areas?.[0],area:s.O.strategyOptions.home_view.stack_count.areas?.[1]})}}}f.domain="home";const p=f},9304(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("light.lights"),path:"lights",icon:"mdi:lightbulb-group",subview:!1,headerCardConfiguration:{iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("light.all_lights"),subtitle:`${s.O.getCountTemplate(o.domain,"eq","on")} ${(0,i.k)("light.lights")} `+(0,i.k)("generic.on")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="light";const a=o},7935(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("lock.locks"),path:"locks",icon:"mdi:lock-open",subview:!1,headerCardConfiguration:{iconOn:"mdi:lock-open",iconOff:"mdi:lock",onService:"lock.lock",offService:"lock.unlock"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("lock.all_locks"),subtitle:`${s.O.getCountTemplate(o.domain,"ne","locked")} ${(0,i.k)("lock.locks")} `+(0,i.k)("lock.unlocked")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="lock";const a=o},7204(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(2816),i=r(1122);class n extends i.default{static getDefaultConfig(){return{title:(0,s.k)("scene.scenes"),path:"scenes",icon:"mdi:palette",subview:!1,headerCardConfiguration:{show_controls:!1}}}static getViewHeaderCardConfig(){return{}}constructor(e){super(),this.initializeViewConfig(n.getDefaultConfig(),e,n.getViewHeaderCardConfig())}}n.domain="scene";const o=n},2464(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("switch.switches"),path:"switches",icon:"mdi:dip-switch",subview:!1,headerCardConfiguration:{iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("switch.all_switches"),subtitle:`${s.O.getCountTemplate(o.domain,"eq","on")} ${(0,i.k)("switch.switches")} `+(0,i.k)("generic.on")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="switch";const a=o},8499(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("vacuum.vacuums"),path:"vacuums",icon:"mdi:robot-vacuum",subview:!1,headerCardConfiguration:{iconOn:"mdi:robot-vacuum",iconOff:"mdi:robot-vacuum-off",onService:"vacuum.start",offService:"vacuum.stop"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("vacuum.all_vacuums"),subtitle:s.O.getCountTemplate(o.domain,"in","[cleaning, returning]")+` ${(0,i.k)("vacuum.vacuums")} ${(0,i.k)("generic.busy")}`}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="vacuum";const a=o},9798(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}static getDefaultConfig(){return{title:(0,i.k)("valve.valves"),path:"valves",icon:"mdi:valve",subview:!1,headerCardConfiguration:{iconOn:"mdi:valve-open",iconOff:"mdi:valve-closed",onService:"valve.open_valve",offService:"valve.close_valve"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("valve.all_valves"),subtitle:s.O.getCountTemplate(o.domain,"in","[closed]")+` ${(0,i.k)("valve.valves")} ${(0,i.k)("valve.unclosed")}`}}}o.domain="valve";const a=o},7315(e,t,r){var s={"./AbstractBadge":[5548,[792]],"./AbstractBadge.ts":[5548,[792]],"./ClimateBadge":[2543,[792]],"./ClimateBadge.ts":[2543,[792]],"./CoverBadge":[2299,[792]],"./CoverBadge.ts":[2299,[792]],"./FanBadge":[6305,[792]],"./FanBadge.ts":[6305,[792]],"./LightBadge":[1806,[792]],"./LightBadge.ts":[1806,[792]],"./SwitchBadge":[4710,[792]],"./SwitchBadge.ts":[4710,[792]],"./WeatherBadge":[7558,[792]],"./WeatherBadge.ts":[7558,[792]]};function i(e){try{if(!r.o(s,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}catch(e){return Promise.reject(e)}var t=s[e],i=t[0];return r.e(t[1][0]).then(()=>r(i))}i.keys=()=>Object.keys(s),i.id=7315,e.exports=i},2560(e,t,r){var s={"./AbstractCard":[4818,[]],"./AbstractCard.ts":[4818,[]],"./AreaCard":[4301,[792]],"./AreaCard.ts":[4301,[792]],"./BinarySensorCard":[1151,[792]],"./BinarySensorCard.ts":[1151,[792]],"./CameraCard":[2723,[792]],"./CameraCard.ts":[2723,[792]],"./ClimateCard":[8721,[792]],"./ClimateCard.ts":[8721,[792]],"./CoverCard":[8033,[792]],"./CoverCard.ts":[8033,[792]],"./FanCard":[2667,[792]],"./FanCard.ts":[2667,[792]],"./GreetingCard":[9440,[792]],"./GreetingCard.ts":[9440,[792]],"./HaAreaCard":[9042,[792]],"./HaAreaCard.ts":[9042,[792]],"./HeaderCard":[4137,[]],"./HeaderCard.ts":[4137,[]],"./InputSelectCard":[1810,[792]],"./InputSelectCard.ts":[1810,[792]],"./LightCard":[8254,[792]],"./LightCard.ts":[8254,[792]],"./LockCard":[6555,[792]],"./LockCard.ts":[6555,[792]],"./MediaPlayerCard":[9879,[792]],"./MediaPlayerCard.ts":[9879,[792]],"./MiscellaneousCard":[4486,[]],"./MiscellaneousCard.ts":[4486,[]],"./NumberCard":[2137,[792]],"./NumberCard.ts":[2137,[792]],"./PersonCard":[845,[792]],"./PersonCard.ts":[845,[792]],"./SceneCard":[2858,[792]],"./SceneCard.ts":[2858,[792]],"./SelectCard":[7212,[792]],"./SelectCard.ts":[7212,[792]],"./SensorCard":[5982,[]],"./SensorCard.ts":[5982,[]],"./SwitchCard":[3708,[792]],"./SwitchCard.ts":[3708,[792]],"./VacuumCard":[7430,[792]],"./VacuumCard.ts":[7430,[792]],"./ValveCard":[8868,[792]],"./ValveCard.ts":[8868,[792]]};function i(e){try{if(!r.o(s,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}catch(e){return Promise.reject(e)}var t=s[e],i=t[0];return Promise.all(t[1].map(r.e)).then(()=>r(i))}i.keys=()=>Object.keys(s),i.id=2560,e.exports=i},9555(e,t,r){var s={"./AbstractView":[1122,[792]],"./AbstractView.ts":[1122,[792]],"./CameraView":[1255,[792]],"./CameraView.ts":[1255,[792]],"./ClimateView":[6559,[792]],"./ClimateView.ts":[6559,[792]],"./CoverView":[7547,[792]],"./CoverView.ts":[7547,[792]],"./FanView":[245,[792]],"./FanView.ts":[245,[792]],"./HomeView":[9031,[792]],"./HomeView.ts":[9031,[792]],"./LightView":[9304,[792]],"./LightView.ts":[9304,[792]],"./LockView":[7935,[792]],"./LockView.ts":[7935,[792]],"./SceneView":[7204,[792]],"./SceneView.ts":[7204,[792]],"./SwitchView":[2464,[792]],"./SwitchView.ts":[2464,[792]],"./VacuumView":[8499,[792]],"./VacuumView.ts":[8499,[792]],"./ValveView":[9798,[792]],"./ValveView.ts":[9798,[792]]};function i(e){try{if(!r.o(s,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}catch(e){return Promise.reject(e)}var t=s[e],i=t[0];return r.e(t[1][0]).then(()=>r(i))}i.keys=()=>Object.keys(s),i.id=9555,e.exports=i}},s={};function i(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return r[e](n,n.exports,i),n.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(r,s){if(1&s&&(r=this(r)),8&s)return r;if("object"==typeof r&&r){if(4&s&&r.__esModule)return r;if(16&s&&"function"==typeof r.then)return r}var n=Object.create(null);i.r(n);var o={};e=e||[null,t({}),t([]),t(t)];for(var a=2&s&&r;("object"==typeof a||"function"==typeof a)&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach(e=>o[e]=()=>r[e]);return o.default=()=>r,i.d(n,o),n},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.e=()=>Promise.resolve(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e=i(4137),t=i(5982),r=i(1241),s=i(2700),n=i(3007),o=i(6964),a=i(2682),c=i(2737);class l{constructor(e,t=l.DEFAULT_NAMESPACE){this.hass=e,this.namespace=t}async showNotification(e,t,r={}){if(this.hasBeenShown(e))return;const s=this.compileStorageKey(e,r.storageKey),i=r.hassId||s,n=r.title||l.DEFAULT_TITLE;try{await this.hass.callService("persistent_notification","create",{title:n,message:t,notification_id:i}),this.markAsShown(e,r.version||"1.0.0",i)}catch(r){(0,o.OG)(o.nR,`Failed to show notification '${e}'!`,r),(0,o.OG)(o.tm,`[${n}] ${t}`)}}async dismissNotification(e,t){const r=this.compileStorageKey(e,t);try{const e=localStorage.getItem(r),t=e?JSON.parse(e):null;if(localStorage.removeItem(r),t?.hassId)return void await this.hass.callService("persistent_notification","dismiss",{notification_id:t.hassId});(0,o.OG)(o.WU,`Notification '${r}' cleared from storage!`)}catch(e){(0,o.OG)(o.nR,`Failed to clear notification '${r}'!`,e)}}hasBeenShown(e,t){const r=this.compileStorageKey(e,t);try{const e=localStorage.getItem(r);return!!e&&JSON.parse(e).shown}catch{return!1}}compileStorageKey(e,t){return t||`${this.namespace||l.DEFAULT_NAMESPACE}_${e}`}markAsShown(e,t,r){const s=this.compileStorageKey(e),i={shown:!0,timestamp:(new Date).toISOString(),version:t,hassId:r};try{localStorage.setItem(s,JSON.stringify(i))}catch(e){(0,o.OG)(o.nR,"Failed to save the notification state!",e)}}}l.DEFAULT_NAMESPACE="mushroom_strategy",l.DEFAULT_TITLE="Mushroom Strategy Notification";var u=i(7716),d=i.n(u);const h=[];var f=i(4486),p=i(2816);class g extends HTMLTemplateElement{static async generateDashboard(e){await r.O.initialize(e),await g.handleNotifications(e.hass);const t=r.O.getExposedNames("view").filter(s.uS).map(async e=>{try{const t=(0,n.ps)(`${e}View`),s=new(0,(await i(9555)(`./${t}`)).default)(r.O.strategyOptions.views[e]);return await s.getView()}catch(t){(0,o.OG)(o.nR,`Error importing ${e} view!`,t)}return null});let a=(await Promise.all(t)).filter(Boolean);return a.push(...r.O.strategyOptions.extra_views),a.sort((e,t)=>{const r=e.order??1/0,s=t.order??1/0;return r!==s?r-s:(e.title??"").localeCompare(t.title??"",void 0,{numeric:!0,sensitivity:"base"})}),r.O.strategyOptions.show_positions&&(a=a.map(e=>({...e,title:`${e.title}: ${e.order}`,show_icon_and_title:!0}))),a.push(...r.O.areas.map(e=>({title:e.name,path:e.area_id,subview:!0,hidden:e.hidden??!1,order:e.order??1/0,strategy:{type:"custom:mushroom-strategy",options:{area:e}}}))),{views:a}}static async generateView(l){const u=r.O.getExposedNames("domain"),d=l.view.strategy?.options?.area??{},h=new a.A(r.O.entities).whereAreaId(d.area_id).toList(),g=[...d.extra_cards??[]],m={area_id:[d.area_id]},v=u.filter(s.dQ).map(async s=>{const l=(0,n.ps)(s+"Card"),u={...r.O.strategyOptions.domains._,...r.O.strategyOptions.domains[s]};r.O.strategyOptions.show_positions&&"_"!==s&&(u.subtitle=`${(0,p.k)("generic.ordering_position")}: ${r.O.strategyOptions.domains[s].order}`);const d=new a.A(h).whereDomain(s).when(u.hide_config_entities,e=>e.not().whereEntityCategory("config")).when(u.hide_diagnostic_entities,e=>e.not().whereEntityCategory("diagnostic")).where(e=>!("switch"===s&&e.entity_id.endsWith("_stateful_scene"))).toList();if(!d.length)return null;const g=new e.default({entity_id:d.map(e=>e.entity_id)},u).createCard();try{const e=(await i(2560)(`./${l}`)).default;if("sensor"===s){let e=d.map(e=>{const s=r.O.hassStates[e.entity_id]?.attributes.unit_of_measurement,i={...e.device_id&&r.O.strategyOptions.card_options?.[e.device_id],...r.O.strategyOptions.card_options?.[e.entity_id],entities:[e.entity_id]};return s?new t.default(e,i).getCard():new f.default(e,i).getCard()});return e.length?(e=(0,c.P)(e,r.O.strategyOptions.domains[s].stack_count??r.O.strategyOptions.domains._.stack_count),{type:"vertical-stack",cards:[g,...e]}):null}let n=d.map(t=>{const s={...t.device_id&&r.O.strategyOptions.card_options?.[t.device_id],...r.O.strategyOptions.card_options?.[t.entity_id]};return new e(t,s).getCard()});return n=(0,c.P)(n,r.O.strategyOptions.domains[s].stack_count??r.O.strategyOptions.domains._.stack_count),n.length?{type:"vertical-stack",cards:[g,...n]}:null}catch(e){return(0,o.OG)(o.nR,`Error creating card configurations for domain ${s}`,e),null}}),_=(await Promise.all(v)).filter(Boolean);if(g.push(..._),!r.O.strategyOptions.domains.default.hidden){const t=new a.A(h).not().where(e=>(0,s.dQ)(e.entity_id.split(".",1)[0])).toList();if(t.length)try{const s=(await Promise.resolve().then(i.bind(i,4486))).default;let n=t.map(e=>new s(e,r.O.strategyOptions.card_options?.[e.entity_id]).getCard());const o=new e.default(m,{...r.O.strategyOptions.domains._,...r.O.strategyOptions.domains.default}).createCard();n.length&&(n=(0,c.P)(n,r.O.strategyOptions.domains.default.stack_count??r.O.strategyOptions.domains._.stack_count),g.push({type:"vertical-stack",cards:[o,...n]}))}catch(e){(0,o.OG)(o.nR,"Error creating card configurations for domain `miscellaneous`",e)}}return{cards:g}}static async handleNotifications(e){if(0===h.length)return;const t=new l(e,"mushroom_strategy"),r=m.replace(/^v/,""),s=d().coerce(r)||"0.0.0";try{await Promise.all(h.map(async e=>d().gte(s,e.fromVersion)&&d().lte(s,e.toVersion)?t.showNotification(e.storageKey,e.message,{title:e.title,version:r}):t.dismissNotification(e.storageKey)))}catch(e){(0,o.OG)(o.nR,"Error while handling persistent notifications for Mushroom Strategy",e)}}}customElements.define("ll-strategy-mushroom-strategy",g);const m="v3.1.0";console.info("%c Mushroom Strategy %c ".concat(m," "),"color: white; background: coral; font-weight: 700;","color: coral; background: white; font-weight: 700;")})()})(); \ No newline at end of file +(()=>{var e,t,r={4744(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 s(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function i(e,t,r){return e.concat(t).map(function(e){return s(e,r)})}function n(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 o(e,t){try{return t in e}catch(e){return!1}}function a(e,r,c){(c=c||{}).arrayMerge=c.arrayMerge||i,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=s;var l=Array.isArray(r);return l===Array.isArray(e)?l?c.arrayMerge(e,r,c):function(e,t,r){var i={};return r.isMergeableObject(e)&&n(e).forEach(function(t){i[t]=s(e[t],r)}),n(t).forEach(function(n){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,n)||(o(e,n)&&r.isMergeableObject(t[n])?i[n]=function(e,t){if(!t.customMerge)return a;var r=t.customMerge(e);return"function"==typeof r?r:a}(n,r)(e[n],t[n],r):i[n]=s(t[n],r))}),i}(e,r,c):s(r,c)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,r){return a(e,r,t)},{})};var c=a;e.exports=c},3904(e,t,r){"use strict";const s=Symbol("SemVer ANY");class i{static get ANY(){return s}constructor(e,t){if(t=n(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),l("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===s?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(e){const t=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=s}toString(){return this.value}test(e){if(l("Comparator.test",e,this.options.loose),this.semver===s||e===s)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=n(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(c(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(c(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=i;const n=r(8587),{safeRe:o,t:a}=r(9718),c=r(2111),l=r(7272),u=r(3908),d=r(8311)},8311(e,t,r){"use strict";const s=/\s+/g;class i{constructor(e,t){if(t=o(t),e instanceof i)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new i(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(s," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!v(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&_(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&g)|(this.options.loose&&m))+":"+e,r=n.get(t);if(r)return r;const s=this.options.loose,i=s?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];e=e.replace(i,N(this.options.includePrerelease)),c("hyphen replace",e),e=e.replace(u[d.COMPARATORTRIM],h),c("comparator trim",e),e=e.replace(u[d.TILDETRIM],f),c("tilde trim",e),e=e.replace(u[d.CARETTRIM],p),c("caret trim",e);let o=e.split(" ").map(e=>w(e,this.options)).join(" ").split(/\s+/).map(e=>I(e,this.options));s&&(o=o.filter(e=>(c("loose invalid filter",e,this.options),!!e.match(u[d.COMPARATORLOOSE])))),c("range list",o);const l=new Map,_=o.map(e=>new a(e,this.options));for(const e of _){if(v(e))return[e];l.set(e.value,e)}l.size>1&&l.has("")&&l.delete("");const y=[...l.values()];return n.set(t,y),y}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Range is required");return this.set.some(r=>y(r,t)&&e.set.some(e=>y(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t"<0.0.0-0"===e.value,_=e=>""===e.value,y=(e,t)=>{let r=!0;const s=e.slice();let i=s.pop();for(;r&&s.length;)r=s.every(e=>i.intersects(e,t)),i=s.pop();return r},w=(e,t)=>(e=e.replace(u[d.BUILD],""),c("comp",e,t),e=b(e,t),c("caret",e),e=E(e,t),c("tildes",e),e=S(e,t),c("xrange",e),e=A(e,t),c("stars",e),e),O=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(" "),C=(e,t)=>{const r=t.loose?u[d.TILDELOOSE]:u[d.TILDE];return e.replace(r,(t,r,s,i,n)=>{let o;return c("tilde",e,t,r,s,i,n),O(r)?o="":O(s)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:O(i)?o=`>=${r}.${s}.0 <${r}.${+s+1}.0-0`:n?(c("replaceTilde pr",n),o=`>=${r}.${s}.${i}-${n} <${r}.${+s+1}.0-0`):o=`>=${r}.${s}.${i} <${r}.${+s+1}.0-0`,c("tilde return",o),o})},b=(e,t)=>e.trim().split(/\s+/).map(e=>$(e,t)).join(" "),$=(e,t)=>{c("caret",e,t);const r=t.loose?u[d.CARETLOOSE]:u[d.CARET],s=t.includePrerelease?"-0":"";return e.replace(r,(t,r,i,n,o)=>{let a;return c("caret",e,t,r,i,n,o),O(r)?a="":O(i)?a=`>=${r}.0.0${s} <${+r+1}.0.0-0`:O(n)?a="0"===r?`>=${r}.${i}.0${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${s} <${+r+1}.0.0-0`:o?(c("replaceCaret pr",o),a="0"===r?"0"===i?`>=${r}.${i}.${n}-${o} <${r}.${i}.${+n+1}-0`:`>=${r}.${i}.${n}-${o} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${n}-${o} <${+r+1}.0.0-0`):(c("no pr"),a="0"===r?"0"===i?`>=${r}.${i}.${n}${s} <${r}.${i}.${+n+1}-0`:`>=${r}.${i}.${n}${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${n} <${+r+1}.0.0-0`),c("caret return",a),a})},S=(e,t)=>(c("replaceXRanges",e,t),e.split(/\s+/).map(e=>k(e,t)).join(" ")),k=(e,t)=>{e=e.trim();const r=t.loose?u[d.XRANGELOOSE]:u[d.XRANGE];return e.replace(r,(r,s,i,n,o,a)=>{c("xRange",e,r,s,i,n,o,a);const l=O(i),u=l||O(n),d=u||O(o),h=d;return"="===s&&h&&(s=""),a=t.includePrerelease?"-0":"",l?r=">"===s||"<"===s?"<0.0.0-0":"*":s&&h?(u&&(n=0),o=0,">"===s?(s=">=",u?(i=+i+1,n=0,o=0):(n=+n+1,o=0)):"<="===s&&(s="<",u?i=+i+1:n=+n+1),"<"===s&&(a="-0"),r=`${s+i}.${n}.${o}${a}`):u?r=`>=${i}.0.0${a} <${+i+1}.0.0-0`:d&&(r=`>=${i}.${n}.0${a} <${i}.${+n+1}.0-0`),c("xRange return",r),r})},A=(e,t)=>(c("replaceStars",e,t),e.trim().replace(u[d.STAR],"")),I=(e,t)=>(c("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),N=e=>(t,r,s,i,n,o,a,c,l,u,d,h)=>`${r=O(s)?"":O(i)?`>=${s}.0.0${e?"-0":""}`:O(n)?`>=${s}.${i}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=O(l)?"":O(u)?`<${+l+1}.0.0-0`:O(d)?`<${l}.${+u+1}.0-0`:h?`<=${l}.${u}.${d}-${h}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`}`.trim(),R=(e,t,r)=>{for(let r=0;r0){const s=e[r].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0}},3908(e,t,r){"use strict";const s=r(7272),{MAX_LENGTH:i,MAX_SAFE_INTEGER:n}=r(6874),{safeRe:o,t:a}=r(9718),c=r(8587),{compareIdentifiers:l}=r(1123);class u{constructor(e,t){if(t=c(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);s("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?o[a.LOOSE]:o[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&te.major?1:this.minore.minor?1:this.patche.patch?1:0}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],i=e.prerelease[t];if(s("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return l(r,i)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const r=this.build[t],i=e.build[t];if(s("build compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return l(r,i)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?o[a.PRERELEASELOOSE]:o[a.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let s=this.prerelease.length;for(;--s>=0;)"number"==typeof this.prerelease[s]&&(this.prerelease[s]++,s=-2);if(-1===s){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let s=[t,e];!1===r&&(s=[t]),0===l(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},7414(e,t,r){"use strict";const s=r(144);e.exports=(e,t)=>{const r=s(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},2111(e,t,r){"use strict";const s=r(4641),i=r(3999),n=r(5580),o=r(4089),a=r(7059),c=r(5200);e.exports=(e,t,r,l)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return s(e,r,l);case"!=":return i(e,r,l);case">":return n(e,r,l);case">=":return o(e,r,l);case"<":return a(e,r,l);case"<=":return c(e,r,l);default:throw new TypeError(`Invalid operator: ${t}`)}}},6170(e,t,r){"use strict";const s=r(3908),i=r(144),{safeRe:n,t:o}=r(9718);e.exports=(e,t)=>{if(e instanceof s)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){const s=t.includePrerelease?n[o.COERCERTLFULL]:n[o.COERCERTL];let i;for(;(i=s.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&i.index+i[0].length===r.index+r[0].length||(r=i),s.lastIndex=i.index+i[1].length+i[2].length;s.lastIndex=-1}else r=e.match(t.includePrerelease?n[o.COERCEFULL]:n[o.COERCE]);if(null===r)return null;const a=r[2],c=r[3]||"0",l=r[4]||"0",u=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return i(`${a}.${c}.${l}${u}${d}`,t)}},909(e,t,r){"use strict";const s=r(3908);e.exports=(e,t,r)=>{const i=new s(e,r),n=new s(t,r);return i.compare(n)||i.compareBuild(n)}},1763(e,t,r){"use strict";const s=r(560);e.exports=(e,t)=>s(e,t,!0)},560(e,t,r){"use strict";const s=r(3908);e.exports=(e,t,r)=>new s(e,r).compare(new s(t,r))},1832(e,t,r){"use strict";const s=r(144);e.exports=(e,t)=>{const r=s(e,null,!0),i=s(t,null,!0),n=r.compare(i);if(0===n)return null;const o=n>0,a=o?r:i,c=o?i:r,l=!!a.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return"major";if(0===c.compareMain(a))return c.minor&&!c.patch?"minor":"patch"}const u=l?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"}},4641(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>0===s(e,t,r)},5580(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(e,t,r)>0},4089(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(e,t,r)>=0},5388(e,t,r){"use strict";const s=r(3908);e.exports=(e,t,r,i,n)=>{"string"==typeof r&&(n=i,i=r,r=void 0);try{return new s(e instanceof s?e.version:e,r).inc(t,i,n).version}catch(e){return null}}},7059(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(e,t,r)<0},5200(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(e,t,r)<=0},2938(e,t,r){"use strict";const s=r(3908);e.exports=(e,t)=>new s(e,t).major},6254(e,t,r){"use strict";const s=r(3908);e.exports=(e,t)=>new s(e,t).minor},3999(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>0!==s(e,t,r)},144(e,t,r){"use strict";const s=r(3908);e.exports=(e,t,r=!1)=>{if(e instanceof s)return e;try{return new s(e,t)}catch(e){if(!r)return null;throw e}}},4493(e,t,r){"use strict";const s=r(3908);e.exports=(e,t)=>new s(e,t).patch},1729(e,t,r){"use strict";const s=r(144);e.exports=(e,t)=>{const r=s(e,t);return r&&r.prerelease.length?r.prerelease:null}},9970(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(t,e,r)},4277(e,t,r){"use strict";const s=r(909);e.exports=(e,t)=>e.sort((e,r)=>s(r,e,t))},7638(e,t,r){"use strict";const s=r(8311);e.exports=(e,t,r)=>{try{t=new s(t,r)}catch(e){return!1}return t.test(e)}},3927(e,t,r){"use strict";const s=r(909);e.exports=(e,t)=>e.sort((e,r)=>s(e,r,t))},6953(e,t,r){"use strict";const s=r(144);e.exports=(e,t)=>{const r=s(e,t);return r?r.version:null}},9589(e,t,r){"use strict";const s=r(9718),i=r(6874),n=r(3908),o=r(1123),a=r(144),c=r(6953),l=r(7414),u=r(5388),d=r(1832),h=r(2938),f=r(6254),p=r(4493),g=r(1729),m=r(560),v=r(9970),_=r(1763),y=r(909),w=r(3927),O=r(4277),E=r(5580),C=r(7059),b=r(4641),$=r(3999),S=r(4089),k=r(5200),A=r(2111),I=r(6170),N=r(3904),R=r(8311),L=r(7638),T=r(7631),D=r(9628),x=r(270),P=r(1261),V=r(3874),G=r(7075),M=r(5571),j=r(5342),B=r(6780),F=r(2525),z=r(5032);e.exports={parse:a,valid:c,clean:l,inc:u,diff:d,major:h,minor:f,patch:p,prerelease:g,compare:m,rcompare:v,compareLoose:_,compareBuild:y,sort:w,rsort:O,gt:E,lt:C,eq:b,neq:$,gte:S,lte:k,cmp:A,coerce:I,Comparator:N,Range:R,satisfies:L,toComparators:T,maxSatisfying:D,minSatisfying:x,minVersion:P,validRange:V,outside:G,gtr:M,ltr:j,intersects:B,simplifyRange:F,subset:z,SemVer:n,re:s.re,src:s.src,tokens:s.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers}},6874(e){"use strict";const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},7272(e){"use strict";const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},1123(e){"use strict";const t=/^[0-9]+$/,r=(e,r)=>{if("number"==typeof e&&"number"==typeof r)return e===r?0:er(t,e)}},8794(e){"use strict";e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},8587(e){"use strict";const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},9718(e,t,r){"use strict";const{MAX_SAFE_COMPONENT_LENGTH:s,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:n}=r(6874),o=r(7272),a=(t=e.exports={}).re=[],c=t.safeRe=[],l=t.src=[],u=t.safeSrc=[],d=t.t={};let h=0;const f="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",n],[f,i]],g=(e,t,r)=>{const s=(e=>{for(const[t,r]of p)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=h++;o(e,i,t),d[e]=i,l[i]=t,u[i]=s,a[i]=new RegExp(t,r?"g":void 0),c[i]=new RegExp(s,r?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),g("MAINVERSION",`(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${l[d.NONNUMERICIDENTIFIER]}|${l[d.NUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${l[d.NONNUMERICIDENTIFIER]}|${l[d.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASE",`(?:-(${l[d.PRERELEASEIDENTIFIER]}(?:\\.${l[d.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${l[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[d.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${f}+`),g("BUILD",`(?:\\+(${l[d.BUILDIDENTIFIER]}(?:\\.${l[d.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${l[d.MAINVERSION]}${l[d.PRERELEASE]}?${l[d.BUILD]}?`),g("FULL",`^${l[d.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${l[d.MAINVERSIONLOOSE]}${l[d.PRERELEASELOOSE]}?${l[d.BUILD]}?`),g("LOOSE",`^${l[d.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${l[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${l[d.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:${l[d.PRERELEASE]})?${l[d.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:${l[d.PRERELEASELOOSE]})?${l[d.BUILD]}?)?)?`),g("XRANGE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${s}})(?:\\.(\\d{1,${s}}))?(?:\\.(\\d{1,${s}}))?`),g("COERCE",`${l[d.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",l[d.COERCEPLAIN]+`(?:${l[d.PRERELEASE]})?`+`(?:${l[d.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",l[d.COERCE],!0),g("COERCERTLFULL",l[d.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${l[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${l[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${l[d.LONECARET]}${l[d.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${l[d.LONECARET]}${l[d.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${l[d.GTLT]}\\s*(${l[d.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]}|${l[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${l[d.XRANGEPLAIN]})\\s+-\\s+(${l[d.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${l[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[d.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},7716(e,t,r){"use strict";e.exports=r(9589)},5571(e,t,r){"use strict";const s=r(7075);e.exports=(e,t,r)=>s(e,t,">",r)},6780(e,t,r){"use strict";const s=r(8311);e.exports=(e,t,r)=>(e=new s(e,r),t=new s(t,r),e.intersects(t,r))},5342(e,t,r){"use strict";const s=r(7075);e.exports=(e,t,r)=>s(e,t,"<",r)},9628(e,t,r){"use strict";const s=r(3908),i=r(8311);e.exports=(e,t,r)=>{let n=null,o=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(n&&-1!==o.compare(e)||(n=e,o=new s(n,r)))}),n}},270(e,t,r){"use strict";const s=r(3908),i=r(8311);e.exports=(e,t,r)=>{let n=null,o=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(n&&1!==o.compare(e)||(n=e,o=new s(n,r)))}),n}},1261(e,t,r){"use strict";const s=r(3908),i=r(8311),n=r(5580);e.exports=(e,t)=>{e=new i(e,t);let r=new s("0.0.0");if(e.test(r))return r;if(r=new s("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t{const t=new s(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":o&&!n(t,o)||(o=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}}),!o||r&&!n(r,o)||(r=o)}return r&&e.test(r)?r:null}},7075(e,t,r){"use strict";const s=r(3908),i=r(3904),{ANY:n}=i,o=r(8311),a=r(7638),c=r(5580),l=r(7059),u=r(5200),d=r(4089);e.exports=(e,t,r,h)=>{let f,p,g,m,v;switch(e=new s(e,h),t=new o(t,h),r){case">":f=c,p=u,g=l,m=">",v=">=";break;case"<":f=l,p=d,g=c,m="<",v="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,h))return!1;for(let r=0;r{e.semver===n&&(e=new i(">=0.0.0")),o=o||e,a=a||e,f(e.semver,o.semver,h)?o=e:g(e.semver,a.semver,h)&&(a=e)}),o.operator===m||o.operator===v)return!1;if((!a.operator||a.operator===m)&&p(e,a.semver))return!1;if(a.operator===v&&g(e,a.semver))return!1}return!0}},2525(e,t,r){"use strict";const s=r(7638),i=r(560);e.exports=(e,t,r)=>{const n=[];let o=null,a=null;const c=e.sort((e,t)=>i(e,t,r));for(const e of c)s(e,t,r)?(a=e,o||(o=e)):(a&&n.push([o,a]),a=null,o=null);o&&n.push([o,null]);const l=[];for(const[e,t]of n)e===t?l.push(e):t||e!==c[0]?t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`):l.push("*");const u=l.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return u.length=0.0.0-0")],l=[new i(">=0.0.0")],u=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===n){if(1===t.length&&t[0].semver===n)return!0;e=r.includePrerelease?c:l}if(1===t.length&&t[0].semver===n){if(r.includePrerelease)return!0;t=l}const s=new Set;let i,u,f,p,g,m,v;for(const t of e)">"===t.operator||">="===t.operator?i=d(i,t,r):"<"===t.operator||"<="===t.operator?u=h(u,t,r):s.add(t.semver);if(s.size>1)return null;if(i&&u){if(f=a(i.semver,u.semver,r),f>0)return null;if(0===f&&(">="!==i.operator||"<="!==u.operator))return null}for(const e of s){if(i&&!o(e,String(i),r))return null;if(u&&!o(e,String(u),r))return null;for(const s of t)if(!o(e,String(s),r))return!1;return!0}let _=!(!u||r.includePrerelease||!u.semver.prerelease.length)&&u.semver,y=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver;_&&1===_.prerelease.length&&"<"===u.operator&&0===_.prerelease[0]&&(_=!1);for(const e of t){if(v=v||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,i)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(p=d(i,e,r),p===e&&p!==i)return!1}else if(">="===i.operator&&!o(i.semver,String(e),r))return!1;if(u)if(_&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===_.major&&e.semver.minor===_.minor&&e.semver.patch===_.patch&&(_=!1),"<"===e.operator||"<="===e.operator){if(g=h(u,e,r),g===e&&g!==u)return!1}else if("<="===u.operator&&!o(u.semver,String(e),r))return!1;if(!e.operator&&(u||i)&&0!==f)return!1}return!(i&&m&&!u&&0!==f||u&&v&&!i&&0!==f||y||_)},d=(e,t,r)=>{if(!e)return t;const s=a(e.semver,t.semver,r);return s>0?e:s<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,r)=>{if(!e)return t;const s=a(e.semver,t.semver,r);return s<0?e:s>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new s(e,r),t=new s(t,r);let i=!1;e:for(const s of e.set){for(const e of t.set){const t=u(s,e,r);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},7631(e,t,r){"use strict";const s=r(8311);e.exports=(e,t)=>new s(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},3874(e,t,r){"use strict";const s=r(8311);e.exports=(e,t)=>{try{return new s(e,t).range||"*"}catch(e){return null}}},1241(e,t,r){"use strict";r.d(t,{O:()=>c});var s=r(4744),i=r.n(s),n=r(6964),o=r(2816),a=r(2682);class c{constructor(){}static get devices(){return c._devices}static get hassStates(){return c._hassStates}static get initialized(){return c._initialized}static get entities(){return c._entities}static get areas(){return c._areas}static get strategyOptions(){return c._strategyOptions}static async initialize(e){(0,o.A)(e.hass),c._hassStates=e.hass.states;const{ConfigurationDefaults:t}=await Promise.resolve().then(r.bind(r,7688));try{c._strategyOptions=i()(t,e.config.strategy.options??{})}catch(e){(0,n.OG)(n.ZY,"Error importing strategy options!",e),c._strategyOptions=t}(0,n.Ux)(c.strategyOptions.debug?n.ZY:n.QC),await this.fetchRegistry(e),c._strategyOptions.extra_views=c._strategyOptions.extra_views.map(e=>({...e,subview:!1})),c._entities=new a.A(c.entities).isNotHidden().whereDisabledBy(null).toList().map(e=>({...e,area_id:e.area_id??"undisclosed"})),c._entities=c._entities.sort((e,t)=>{const r=c.getDisplayName(e),s=c.getDisplayName(t);return r.localeCompare(s,void 0,{numeric:!0,sensitivity:"base"})}),c._devices=new a.A(c.devices).isNotHidden().whereDisabledBy(null).orderBy(["name_by_user","name"],"asc").toList().map(e=>({...e,area_id:e.area_id??"undisclosed"})),c._areas.push(t.areas.undisclosed);const s=new a.A(c._areas).isNotHidden().orderBy(["name"],"asc").toList();c._areas=s.map((e,t)=>{const r="undisclosed"===e.area_id;return{...e,order:10*(t+1),...c.strategyOptions.areas._,...c.strategyOptions.areas[e.area_id],...r?{area_id:"undisclosed",type:"default"}:{}}}),c._areas=new a.A(c._areas).orderBy(["order","name"],"asc").toList(),c.strategyOptions.views=c.sortConfigByOrder(c.strategyOptions.views),c.strategyOptions.domains=c.sortConfigByOrder(c.strategyOptions.domains),c._initialized=!0}static getCountTemplate(e,t,r){return c.initialized?`{% set entities = [${new a.A(c.entities).whereDomain(e).where(e=>!e.entity_id.endsWith("_stateful_scene")&&"group"!==e.platform).toList().map(e=>`states['${e.entity_id}']`)}] %}\n {{ entities\n | selectattr('state','${t}','${r}')\n | selectattr('state','ne','unavailable')\n | selectattr('state','ne','unknown')\n | list\n | count\n }}`:((0,n.OG)(n.br,"Registry is not initialized!"),"?")}static getExposedNames(e){if("badge"===e)return Object.entries(c.strategyOptions.badges).filter(([e,t])=>!0===t).map(([e])=>e.split("_")[0]);const t=c.strategyOptions[`${e}s`];return Object.keys(t).filter(e=>"_"!==e&&"default"!==e&&!t[e].hidden)}static async fetchRegistry(e){try{[c._entities,c._devices,c._areas]=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){(0,n.OG)(n.ZY,"Error importing Home Assistant registries!",e)}}static sortConfigByOrder(e){return Object.fromEntries(Object.entries(e).sort(([,e],[,t])=>(e.order??1/0)-(t.order??1/0)||(e.title??"").localeCompare(t.title??"",void 0,{numeric:!0,sensitivity:"base"})))}}c._initialized=!1,c._areas=[],c.getDisplayName=e=>{if(e.name)return e.name;if(e.has_entity_name&&e.device_id){const t=c.devices.find(t=>t.id===e.device_id),r=t?.name_by_user??t?.name;if(r)return e.original_name?`${r} ${e.original_name}`:r}return e.original_name?e.original_name:(e.entity_id.split(".")[1]||e.entity_id).replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}},5548(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(1241),i=r(6964);const n=class{constructor(){this.configuration={type:"template"},s.O.initialized||(0,i.OG)(i.ZY,"Registry is not initialized!")}getConfiguration(){return this.configuration}}},2543(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(5548),i=r(1241);class n extends s.default{constructor(e){super(),this.configuration={...this.configuration,...n.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:thermostat",color:"orange",content:i.O.getCountTemplate("climate","ne","off"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"climates"}}}}const o=n},2299(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(1241),i=r(5548);class n extends i.default{constructor(e){super(),this.configuration={...this.configuration,...n.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:window-open",color:"cyan",content:s.O.getCountTemplate("cover","search","(open|opening|closing)"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"covers"}}}}const o=n},6305(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2682),n=r(5548);class o extends n.default{constructor(e){super(),this.configuration={...this.configuration,...o.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:fan",color:"green",content:s.O.getCountTemplate("fan","eq","on"),tap_action:{action:"perform-action",perform_action:"fan.turn_off",target:{entity_id:new i.A(s.O.entities).whereDomain("fan").getValuesByProperty("entity_id")}},hold_action:{action:"navigate",navigation_path:"fans"}}}}const a=o},1806(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2682),n=r(5548);class o extends n.default{constructor(e){super(),this.configuration={...this.configuration,...o.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:lightbulb-group",color:"amber",content:s.O.getCountTemplate("light","eq","on"),tap_action:{action:"perform-action",perform_action:"light.turn_off",target:{entity_id:new i.A(s.O.entities).whereDomain("light").getValuesByProperty("entity_id")}},hold_action:{action:"navigate",navigation_path:"lights"}}}}const a=o},4710(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(1241),i=r(2682),n=r(5548),o=r(2816);class a extends n.default{constructor(e){super(),this.configuration={...this.configuration,...a.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:dip-switch",color:"blue",content:s.O.getCountTemplate("switch","eq","on"),tap_action:{action:"perform-action",confirmation:{text:(0,o.k)("switch.badge_confirmation")},perform_action:"switch.turn_off",target:{entity_id:new i.A(s.O.entities).whereDomain("switch").getValuesByProperty("entity_id")}},hold_action:{action:"navigate",navigation_path:"switches"}}}}const c=a},7558(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(5548);class i extends s.default{constructor(e,t){super(),this.configuration={...this.configuration,...i.getDefaultConfig(e),...t}}static getDefaultConfig(e){return{type:"entity",entity:e,state_content:["state","temperature"]}}}const n=i},4818(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(1241),i=r(6964);const n=class{constructor(e){this.configuration={type:"custom:mushroom-entity-card",icon:"mdi:help-circle"},s.O.initialized||(0,i.OG)(i.ZY,"Registry is not initialized!"),this.entity=e}getCard(){return{...this.configuration,entity:"entity_id"in this.entity?this.entity.entity_id:void 0}}}},4301(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(4818),i=r(1241),n=r(2816);class o extends s.default{static getDefaultConfig(){return{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"}}}constructor(e,t){super(e);const r=o.getDefaultConfig();let s=t;r.primary=e.name,r.icon=e.icon||r.icon,i.O.strategyOptions.show_positions&&(r.secondary=`${(0,n.k)("generic.ordering_position")}: ${e.order}`),r.tap_action&&"navigation_path"in r.tap_action&&(r.tap_action.navigation_path=e.area_id),s&&(s={...s,type:r.type}),this.configuration={...this.configuration,...r,...s}}}const a=o},1151(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(5982);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-entity-card",icon:"mdi:power-cycle",icon_color:"green"}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},2723(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{entity:"",type:"picture-entity",show_name:!1,show_state:!1,camera_view:"live"}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},8721(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-climate-card",icon:void 0,hvac_modes:["off","cool","heat","fan_only"],show_temperature_control:!0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},8033(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-cover-card",icon:void 0,show_buttons_control:!0,show_position_control:!0,show_tilt_position_control:!0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},2667(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-fan-card",icon:void 0,show_percentage_control:!0,show_oscillate_control:!0,icon_animation:!0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},9440(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>i});var s=r(2816);const i=class{constructor(e){this.configuration={type:"custom:mushroom-template-card",primary:`{% set time = now().hour %}\n {% if (time >= 18) %}\n ${(0,s.k)("generic.good_evening")}, {{user}}!\n {% elif (time >= 12) %}\n ${(0,s.k)("generic.good_afternoon")}, {{user}}!\n {% elif (time >= 6) %}\n ${(0,s.k)("generic.good_morning")}, {{user}}!\n {% else %}\n ${(0,s.k)("generic.hello")}, {{user}}! {% endif %}`,icon:"mdi:hand-wave",icon_color:"orange",tap_action:{action:"none"},double_tap_action:{action:"none"},hold_action:{action:"none"}},this.configuration={...this.configuration,...e}}getCard(){return this.configuration}}},9042(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(4818),i=r(1241),n=r(2816);class o extends s.default{static getDefaultConfig(){return{type:"area",area:""}}constructor(e,t){super(e);const r=o.getDefaultConfig();r.area=e.area_id,r.navigation_path=r.area,i.O.strategyOptions.show_positions&&(r.name=`${e.name} - ${(0,n.k)("generic.ordering_position")}: ${e.order}`),this.configuration={...this.configuration,...r,...t,type:r.type}}}const a=o},4137(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>i});class s{static getDefaultConfig(){return{type:"custom:mushroom-title-card",iconOn:"mdi:power-on",iconOff:"mdi:power-off",onService:"none",offService:"none"}}constructor(e,t){this.target=e,this.configuration={...s.getDefaultConfig(),...t}}createCard(){const e=[{type:"custom:mushroom-title-card",title:this.configuration.title,subtitle:this.configuration.subtitle}];return this.configuration.show_controls&&e.push({type:"horizontal-stack",cards:[{type:"custom:mushroom-template-card",icon:this.configuration.iconOff,layout:"vertical",icon_color:"red",tap_action:{action:"call-service",service:this.configuration.offService,target:this.target,data:{}}},{type:"custom:mushroom-template-card",icon:this.configuration.iconOn,layout:"vertical",icon_color:"amber",tap_action:{action:"call-service",service:this.configuration.onService,target:this.target,data:{}}}]}),{type:"horizontal-stack",cards:e}}}const i=s},1810(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(7212);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-select-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},8254(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(2700),i=r(4818);class n extends i.default{static getDefaultConfig(){return{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",perform_action:"light.turn_on",target:{entity_id:void 0},data:{rgb_color:[255,255,255]}}}}constructor(e,t){super(e);const r=n.getDefaultConfig();(0,s.eq)(r.double_tap_action)&&(r.double_tap_action.target={entity_id:e.entity_id}),this.configuration={...this.configuration,...r,...t}}}const o=n},6555(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-lock-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},9879(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{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"]}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},4486(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-entity-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},2137(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-number-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},845(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-person-card",layout:"vertical",primary_info:"none",secondary_info:"none",icon_type:"entity-picture"}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},2858(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(1241),i=r(4818),n=r(3708),o=r(2700);class a extends i.default{static getDefaultConfig(){return{type:"custom:mushroom-entity-card",tap_action:{action:"perform-action",perform_action:"scene.turn_on",target:{}}}}constructor(e,t){const r=e.entity_id.split(".").pop(),i=s.O.entities.find(e=>e.entity_id===`switch.${r}_stateful_scene`);if(super(i??e),i)return void(this.configuration=new n.default(i).getCard());const c=a.getDefaultConfig();(0,o.eq)(c.tap_action)&&(c.tap_action.target={entity_id:e.entity_id}),c.icon=s.O.hassStates[e.entity_id]?.attributes.icon??c.icon,this.configuration={...this.configuration,...c,...t}}}const c=a},7212(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-select-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},5982(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mini-graph-card",animate:!0,icon:"mdi:information",line_color:"green"}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},3708(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-entity-card",icon:void 0,tap_action:{action:"toggle"}}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},7430(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});const s=["on_off","start_pause","stop","locate","clean_spot","return_home"];var i=r(4818);class n extends i.default{static getDefaultConfig(){return{type:"custom:mushroom-vacuum-card",icon:void 0,icon_animation:!0,commands:[...s],tap_action:{action:"more-info"}}}constructor(e,t){super(e),this.configuration={...this.configuration,...n.getDefaultConfig(),...t}}}const o=n},8868(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(2816),i=r(4818);class n extends i.default{static getDefaultConfig(){return{type:"custom:mushroom-template-card",icon:"mdi:valve",icon_color:"blue",double_tap_action:{action:"toggle"}}}constructor(e,t){super(e);const r=n.getDefaultConfig();r.entity=e.entity_id,r.icon=e.icon??r.icon,r.primary=e.name??e.original_name??"?",r.secondary=`{% \n set mapping = {\n 'open': '${(0,s.k)("valve.open")}',\n 'opening': '${(0,s.k)("valve.opening")}',\n 'closed': '${(0,s.k)("valve.closed")}',\n 'closing': '${(0,s.k)("valve.closing")}',\n 'stopped': '${(0,s.k)("valve.stopped")}',\n 'unavailable': '${(0,s.k)("generic.unavailable")}'\n }\n %}\n {{ mapping.get(states('${e.entity_id}'), '${(0,s.k)("generic.unknown")}') }}`,this.configuration={...this.configuration,...r,...t}}}const o=n},7688(e,t,r){"use strict";r.d(t,{ConfigurationDefaults:()=>i});var s=r(2816);const i={areas:{_:{type:"AreaCard"},undisclosed:{aliases:[],area_id:"undisclosed",created_at:0,floor_id:null,hidden:!1,humidity_entity_id:null,icon:"mdi:floor-plan",labels:[],modified_at:0,name:(0,s.k)("generic.undisclosed"),picture:null,temperature_entity_id:null,order:1/0}},card_options:{},badges:{weather_entity:"auto",light_count:!0,fan_count:!0,cover_count:!0,switch_count:!0,climate_count:!0,extra_badges:[]},debug:!1,domains:{_:{hide_config_entities:!0,hide_diagnostic_entities:!0,show_controls:!0,stack_count:1},lock:{order:10,title:(0,s.k)("lock.locks"),show_controls:!1,hidden:!1},binary_sensor:{order:20,title:(0,s.k)("sensor.binary_sensors"),show_controls:!1,hidden:!1,stack_count:2},camera:{order:30,title:(0,s.k)("camera.cameras"),show_controls:!1,hidden:!1},light:{order:40,title:(0,s.k)("light.lights"),iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off",hidden:!1},scene:{order:50,title:(0,s.k)("scene.scenes"),show_controls:!1,onService:"scene.turn_on",hidden:!1},climate:{order:60,title:(0,s.k)("climate.climates"),show_controls:!1,hidden:!1},fan:{order:70,title:(0,s.k)("fan.fans"),iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off",hidden:!1},cover:{order:80,title:(0,s.k)("cover.covers"),iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover",hidden:!1},media_player:{order:90,title:(0,s.k)("media_player.media_players"),show_controls:!1,hidden:!1},switch:{order:100,title:(0,s.k)("switch.switches"),iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off",hidden:!1},vacuum:{order:110,title:(0,s.k)("vacuum.vacuums"),iconOn:"mdi:robot-vacuum",iconOff:"mdi:robot-vacuum-off",onService:"vacuum.start",offService:"vacuum.stop",hidden:!1},valve:{order:120,title:(0,s.k)("valve.valves"),iconOn:"mdi:valve-open",iconOff:"mdi:valve-closed",onService:"valve.open_valve",offService:"valve.close_valve",hidden:!1},select:{order:130,title:(0,s.k)("select.selects"),show_controls:!1,hidden:!1},input_select:{order:140,title:(0,s.k)("input_select.input_selects"),show_controls:!1,hidden:!1},number:{order:150,title:(0,s.k)("generic.numbers"),show_controls:!1,hidden:!1},sensor:{order:160,title:(0,s.k)("sensor.sensors"),show_controls:!1,hidden:!1},default:{order:170,title:(0,s.k)("generic.miscellaneous"),show_controls:!1,hidden:!1}},extra_cards:[],extra_views:[],home_view:{hidden:{areas:!1,areas_title:!1,badges:!1,greeting:!0,persons:!1},stack_count:{_:2}},show_positions:!1,views:{camera:{order:60,hidden:!1},climate:{order:50,hidden:!1},cover:{order:30,hidden:!1},fan:{order:20,hidden:!1},home:{order:-1/0,hidden:!1},light:{order:10,hidden:!1},lock:{order:90,hidden:!1},scene:{order:80,hidden:!1},switch:{order:40,hidden:!1},vacuum:{order:70,hidden:!1},valve:{order:100,hidden:!1}},quick_access_cards:[]}},2700(e,t,r){"use strict";r.d(t,{dQ:()=>l,eq:()=>o,uS:()=>c,yI:()=>u});const s=["_","binary_sensor","camera","climate","cover","default","fan","input_select","light","lock","media_player","number","scene","select","sensor","switch","vacuum","valve"],i=["camera","climate","cover","fan","home","light","lock","scene","switch","vacuum","valve"],n=["light","fan","cover","switch","climate","weather"];function o(e){return!!e&&("perform-action"===e.action||"call-service"===e.action)&&"perform_action"in e}function a(e,t){return t.includes(e)}function c(e){return a(e,i)}function l(e){return a(e,s)}function u(e){return a(e,n)}},2682(e,t,r){"use strict";r.d(t,{A:()=>a});var s=r(1241),i=r(6964),n=r(3007);class o{constructor(e){this.filters=[],this.invertNext=!1,this.entries=e,this.entryIdentifier=0===e.length||"entity_id"in e[0]?"entity_id":"floor_id"in e[0]?"area_id":"id"}not(){return this.invertNext=!this.invertNext,this}resetFilters(){return this.filters=[],this.invertNext=!1,this}where(e){return this.filters.push(this.checkInversion(e)),this}when(e,t){return e?t(this):this}whereAreaId(e,t=!0){return this.filters.push(this.checkInversion(r=>{const i=r;let n;if(t&&i.device_id&&(n=s.O.devices.find(e=>e.id===i.device_id)?.area_id),!e)return r.area_id===e&&n===e;if("undisclosed"===e){const e="undisclosed"===n||null==n;return"undisclosed"===r.area_id&&e}return r.area_id===e||"undisclosed"===r.area_id&&n===e})),this}whereNameContains(e){const t=e.toLowerCase();return this.filters.push(this.checkInversion(e=>{const r=e;return[r.name,r.original_name,r.name_by_user].filter(e=>"string"==typeof e).some(e=>e.toLowerCase().includes(t))})),this}whereDomain(e){const t=e+".";return this.filters.push(this.checkInversion(e=>"entity_id"in e&&e.entity_id.startsWith(t))),this}whereFloorId(e){return this.filters.push(this.checkInversion(t=>{const r="floor_id"in t;return void 0===e?!r:r&&t.floor_id===e})),this}whereDeviceId(e){return this.filters.push(this.checkInversion(t=>{const r="id"in t,s="device_id"in t;return void 0===e?!r&&!s:r&&t.id===e||s&&t.device_id===e})),this}whereEntityId(e){return this.filters.push(this.checkInversion(t=>void 0===e?!("entity_id"in t):"entity_id"in t&&t.entity_id===e)),this}whereDisabledBy(e){return this.filters.push(this.checkInversion(t=>{const r="disabled_by"in t;return void 0===e?!r:r&&t.disabled_by===e})),this}whereHiddenBy(e){return this.filters.push(this.checkInversion(t=>{const r="hidden_by"in t;return void 0===e?!r:r&&t.hidden_by===e})),this}isNotHidden(e=!0){return this.filters.push(this.checkInversion(t=>{const r="hidden_by"in t&&t.hidden_by;if(!e)return!r;const i=t[this.entryIdentifier],n="area_id"===this.entryIdentifier?{...s.O.strategyOptions.areas._,...s.O.strategyOptions.areas[i]}:s.O.strategyOptions.card_options?.[i];return!(r||!0===n?.hidden)})),this}whereEntityCategory(e){const t=this.invertNext;return this.invertNext=!1,this.filters.push(r=>{const s="entity_category"in r?r.entity_category:void 0;return t?s!==e:s===e}),this}orderBy(e,t="asc"){const r="asc"===t?1:-1,s=[...this.entries].sort((s,i)=>{for(const o of e){const e=s[o],a=i[o];if(e===a)continue;const[c,l]=(0,n.B3)(e),[u,d]=(0,n.B3)(a);if(c!==u)return(c-u)*r;const h=(0,n.ck)(l,d,t);if(0!==h)return h}return 0}),i=new o(s);return i.filters=[...this.filters],i}take(e){const t=Math.max(0,e);return this.filters.push((e,r)=>rr>=t),this}toList(){const e=new o(this.entries);return e.filters=[...this.filters],e.entries.filter((t,r)=>e.filters.every(e=>e(t,r)))}getValuesByProperty(e){return this.toList().map(t=>t[e]).filter(e=>void 0!==e)}first(){const e=new o(this.entries);return e.filters=[...this.filters],e.entries.find((t,r)=>e.filters.every(e=>e(t,r)))}single(){const e=new o(this.entries);e.filters=[...this.filters];const t=e.entries.filter((t,r)=>e.filters.every(e=>e(t,r)));if(1===t.length)return t[0];(0,i.OG)(i.br,`Expected a single element, but found ${t.length}.`)}count(){const e=new o(this.entries);return e.filters=[...this.filters],e.entries.filter((t,r)=>e.filters.every(e=>e(t,r))).length}checkInversion(e){return this.invertNext?(this.invertNext=!1,t=>!e(t)):e}}const a=o},3007(e,t,r){"use strict";function s(e){return e.replace(/^([a-z])|([-_][a-z])/g,e=>e.toUpperCase().replace(/[-_]/g,""))}function i(e){if("function"==typeof structuredClone)try{return structuredClone(e)}catch{}try{return JSON.parse(JSON.stringify(e))}catch{return e}}function n(e,t,r="asc"){if(e===t)return 0;const s="asc"===r?1:-1;if(null==e||null==t)return(null==e?-1:1)*s;if("string"==typeof e&&"string"==typeof t)return e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})*s;const i=e=>"number"==typeof e||"boolean"==typeof e;return i(e)&&i(t)?(+e-+t)*s:0}function o(e){return e===-1/0?[0,0]:null==e?[2,0]:e===1/0?[3,0]:[1,e]}r.d(t,{B3:()=>o,Go:()=>i,ck:()=>n,ps:()=>s})},2737(e,t,r){"use strict";function s(e,t=2,r){if(e.length<=1)return e;const s=(e,t)=>{if(e.length<=1)return e;const r=[];for(let s=0;ss})},6964(e,t,r){"use strict";r.d(t,{OG:()=>p,QC:()=>n,Ux:()=>f,WU:()=>o,ZY:()=>u,br:()=>c,nR:()=>l,tm:()=>a});var s,i=r(3007);!function(e){e[e.Off=0]="Off",e[e.Debug=1]="Debug",e[e.Info=2]="Info",e[e.Warn=3]="Warn",e[e.Error=4]="Error",e[e.Fatal=5]="Fatal"}(s||(s={}));const{Off:n,Debug:o,Info:a,Warn:c,Error:l,Fatal:u}=s;let d=s.Fatal;function h(e){if(e.includes("@"))return e.split("@")[0]||"anonymous";const t=e.match(/at ([^( ]+)/);return t?t[1]:null}function f(e){d=e}function p(e,t,...r){if(d===s.Off||e>d)return;const n="Mushroom Strategy - An error occurred. Check the console (F12) for details.",o=`[${s[e].toUpperCase()}]`,a=r.map(i.Go),c=`[at ${function(e){if(!e)return"unknown function";const t=e.split("\n");for(const e of t){if(!e)continue;const t=h(e);if(t&&"logMessage"!==t)return t}return"unknown function"}((new Error).stack)}]`;switch(e){case s.Debug:console.debug(`${o}${c} ${t}`,...a);break;case s.Info:console.info(`${o}${c} ${t}`,...a);break;case s.Warn:console.warn(`${o}${c} ${t}`,...a);break;case s.Error:throw console.error(`${o}${c} ${t}`,...a),n;case s.Fatal:throw console.error(`${o}${c} ${t}`,...a),alert?.(`${o} ${t}`),n}}},2816(e,t,r){"use strict";r.d(t,{A:()=>O,k:()=>E});const s=JSON.parse('{"camera":{"all_cameras":"Alle Kameras","cameras":"Kameras"},"climate":{"all_climates":"Alle Klimaanlagen","climates":"Klimaanlagen"},"cover":{"all_covers":"Alle Abdeckungen","covers":"Abdeckungen"},"fan":{"all_fans":"Alle Ventilatoren","fans":"Ventilatoren"},"generic":{"all":"Alle","areas":"Bereiche","busy":"Beschäftigt","good_afternoon":"Guten Nachmittag","good_evening":"Guten Abend","good_morning":"Guten Morgen","hello":"Hallo","home":"Start","miscellaneous":"Sonstiges","numbers":"Zahlen","off":"Aus","on":"Ein","open":"Offen","ordering_position":"Sortierposition","unavailable":"Nicht verfügbar","unclosed":"Nicht Geschlossen","undisclosed":"Sonstiges","unknown":"Unbekannt"},"input_select":{"input_selects":"Auswahl-Eingaben"},"light":{"all_lights":"Alle Leuchten","lights":"Leuchten"},"lock":{"locked":"Gesperrt","all_locks":"Alle Schlösser","locks":"Schlösser","unlocked":"Entsperrt"},"media_player":{"media_players":"Wiedergabegeräte"},"scene":{"scenes":"Szenen"},"select":{"selects":"Auswahlen"},"sensor":{"binary_sensors":"Binäre Sensoren","sensors":"Sensoren"},"switch":{"all_switches":"Alle Schalter","badge_confirmation":"Warnung: Diese Aktion wird alle Schalter ausschalten. Sind Sie sicher, dass Sie fortfahren möchten?","switches":"Schalter"},"vacuum":{"all_vacuums":"Alle Staubsauger","vacuums":"Staubsauger"},"valve":{"all_valves":"Alle Ventile","valves":"Ventile","open":"Offen","opening":"Öffnet","closed":"Geschlossen","closing":"Schließt","stopped":"Gestoppt","unclosed":"Nicht geschlossen"}}');var i=r.t(s,2);const n=JSON.parse('{"camera":{"all_cameras":"All Cameras","cameras":"Cameras"},"climate":{"all_climates":"All Climates","climates":"Climates"},"cover":{"all_covers":"All Covers","covers":"Covers"},"fan":{"all_fans":"All Fans","fans":"Fans"},"generic":{"all":"All","areas":"Areas","busy":"Busy","good_afternoon":"Good afternoon","good_evening":"Good evening","good_morning":"Good morning","hello":"Hello","home":"Home","miscellaneous":"Miscellaneous","numbers":"Numbers","off":"Off","on":"On","open":"Open","ordering_position":"Ordering position","unavailable":"Unavailable","unclosed":"Unclosed","undisclosed":"Other","unknown":"Unknown"},"input_select":{"input_selects":"Input Selects"},"light":{"all_lights":"All Lights","lights":"Lights"},"lock":{"all_locks":"All Locks","locked":"Locked","locks":"Locks","unlocked":"Unlocked"},"media_player":{"media_players":"Media Players"},"scene":{"scenes":"Scenes"},"select":{"selects":"Selects"},"sensor":{"binary_sensors":"Binary Sensors","sensors":"Sensors"},"switch":{"all_switches":"All Switches","badge_confirmation":"Warning: This action will turn off all switches. Are you sure you want to continue?","switches":"Switches"},"vacuum":{"all_vacuums":"All Vacuums","vacuums":"Vacuums"},"valve":{"all_valves":"All Valves","valves":"Valves","open":"Open","opening":"Opening","closed":"Closed","closing":"Closing","stopped":"Stopped","unclosed":"Unclosed"}}');var o=r.t(n,2);const a=JSON.parse('{"camera":{"all_cameras":"Todas las Cámaras","cameras":"Cámaras"},"climate":{"all_climates":"Todos los Termostatos","climates":"Termostatos"},"cover":{"all_covers":"Todas las Cubiertas","covers":"Cubiertas"},"fan":{"all_fans":"Todos los Ventiladores","fans":"Ventiladores"},"generic":{"all":"Todo","areas":"Áreas","busy":"Ocupado","good_afternoon":"Buenas tardes","good_evening":"Buenas noches","good_morning":"Buenos días","hello":"Hola","home":"Inicio","miscellaneous":"Varios","numbers":"Números","off":"Apagado","on":"Encendido","open":"Abierto","ordering_position":"Posición de orden","unavailable":"No Disponible","unclosed":"Sin Cerrar","undisclosed":"Varios","unknown":"Desconocido"},"input_select":{"input_selects":"Selecciones de Entrada"},"light":{"all_lights":"Todas las Luces","lights":"Luces"},"lock":{"all_locks":"Todas las Candados","locked":"Locked","locks":"Candados","unlocked":"Desbloqueado"},"media_player":{"media_players":"Reproductores Multimedia"},"scene":{"scenes":"Scenas"},"select":{"selects":"Seleccionar"},"sensor":{"binary_sensors":"Binario Sensores","sensors":"Sensores"},"switch":{"all_switches":"Todos los Apagadores","badge_confirmation":"Advertencia: Esta acción apagará todos los interruptores. ¿Está seguro de que desea continuar?","switches":"Apagadores"},"vacuum":{"all_vacuums":"Todas las Aspiradoras","vacuums":"Aspiradoras"},"valve":{"all_valves":"Todas las válvulas","valves":"Válvulas","open":"Abierta","opening":"Abriendo","closed":"Cerrada","closing":"Cerrando","stopped":"Detenida","unclosed":"No Cerrada"}}');var c=r.t(a,2);const l=JSON.parse('{"camera":{"all_cameras":"Összes kamera","cameras":"Kamerák"},"climate":{"all_climates":"Összes klíma","climates":"Klímák"},"cover":{"all_covers":"Összes redőny","covers":"Redőnyök"},"fan":{"all_fans":"Összes ventilátor","fans":"Ventilátorok"},"generic":{"all":"Összes","areas":"Területek","busy":"Foglalt","good_afternoon":"Jó napot","good_evening":"Jó estét","good_morning":"Jó reggelt","hello":"Hello","home":"Otthon","miscellaneous":"Egyéb","numbers":"Számok","off":"Ki","on":"Be","open":"Nyitva","ordering_position":"Rendezési pozíció","unavailable":"Nem áll rendelkezésre","unclosed":"Nincs bezárva","undisclosed":"Egyéb","unknown":"Ismeretlen"},"input_select":{"input_selects":"Bemenetválasztók"},"light":{"all_lights":"Összes világítás","lights":"Lámpák"},"lock":{"all_locks":"Összes zár","locked":"Zárva","locks":"Zárak","unlocked":"Nyitott"},"media_player":{"media_players":"Médialejátszók"},"scene":{"scenes":"Jelenetek"},"select":{"selects":"Kiválasztások"},"sensor":{"binary_sensors":"Kétállapotú Szenzorok","sensors":"Szenzorok"},"switch":{"all_switches":"Összes kapcsoló","chip_confirmation":"Figyelem: Ez a művelet az összes kapcsolót lekapcsolja. Biztosan folytatja?","switches":"Kapcsolók"},"vacuum":{"all_vacuums":"Összes porszívó","vacuums":"Porszívók"},"valve":{"all_valves":"Összes szelep","valves":"Szelepek","open":"Nyitva","opening":"Nyitás","closed":"Zárva","closing":"Zárás","stopped":"Megállt","unclosed":"Nincs zárva"}}');var u=r.t(l,2);const d=JSON.parse('{"camera":{"all_cameras":"Toutes les caméras","cameras":"Caméras"},"climate":{"all_climates":"Tous les thermostats","climates":"Thermostats"},"cover":{"all_covers":"Tous les volets","covers":"Volets"},"fan":{"all_fans":"Tous les ventilateurs","fans":"Ventilateurs"},"generic":{"all":"Tout","areas":"Pièces","busy":"Occupé(e)","good_afternoon":"Bon après-midi","good_evening":"Bonsoir","good_morning":"Bonjour","hello":"Bonjour","home":"Accueil","miscellaneous":"Divers","numbers":"Nombres","off":"Éteint(e)","on":"Allumé(e)","open":"Ouvert(e)","ordering_position":"Position de tri","unavailable":"Indisponible","unclosed":"Non fermé(e)","undisclosed":"Non divulgué","unknown":"Inconnu"},"input_select":{"input_selects":"Sélecteurs d’options"},"light":{"all_lights":"Toutes les lumières","lights":"Lumières"},"lock":{"all_locks":"Tous les verrous","locked":"Verrouillé","locks":"Verrous","unlocked":"Déverrouillé"},"media_player":{"media_players":"Lecteurs multimédias"},"scene":{"scenes":"Scènes"},"select":{"selects":"Sélecteurs"},"sensor":{"binary_sensors":"Capteurs Binaires","sensors":"Capteurs"},"switch":{"all_switches":"Tous les interrupteurs","badge_confirmation":"Attention : cette action éteindra tous les interrupteurs. Êtes-vous sûr de vouloir continuer ?","switches":"Interrupteurs"},"vacuum":{"all_vacuums":"Tous les aspirateurs","vacuums":"Aspirateurs"},"valve":{"all_valves":"Toutes les vannes","valves":"Vannes","open":"Ouverte","opening":"Ouverture","closed":"Fermée","closing":"Fermeture","stopped":"Arrêtée","unclosed":"Non fermée"}}');var h=r.t(d,2);const f=JSON.parse('{"camera":{"all_cameras":"Alle Cameras","cameras":"Cameras"},"climate":{"all_climates":"Alle Klimaatregelingen","climates":"Klimaatregelingen"},"cover":{"all_covers":"Alle Bedekkingen","covers":"Bedekkingen"},"fan":{"all_fans":"Alle Ventilatoren","fans":"Ventilatoren"},"generic":{"all":"Alle","areas":"Ruimtes","busy":"Bezig","good_afternoon":"Goedemiddag","good_evening":"Goedeavond","good_morning":"Goedemorgen","hello":"Hallo","home":"Start","miscellaneous":"Overige","numbers":"Nummers","off":"Uit","on":"Aan","open":"Open","ordering_position":"Sorteer Positie","unavailable":"Onbeschikbaar","unclosed":"Niet Gesloten","undisclosed":"Overige","unknown":"Onbekend"},"input_select":{"input_selects":"Lijsten"},"light":{"all_lights":"Alle Lampen","lights":"Lampen"},"lock":{"all_locks":"Alle Sloten","locked":"Vergrendeld","locks":"Sloten","unlocked":"Ontgrendeld"},"media_player":{"media_players":"Mediaspelers"},"scene":{"scenes":"Scenes"},"select":{"selects":"Statuslijsten"},"sensor":{"binary_sensors":"Binaire Sensoren","sensors":"Sensoren"},"switch":{"all_switches":"Alle Schakelaars","badge_confirmation":"Waarschuwing: Deze actie zal alle schakelaars uitzetten. Weet u zeker dat u door wilt gaan?","switches":"Schakelaars"},"vacuum":{"all_vacuums":"Alle Afzuiging","vacuums":"Afzuiging"},"valve":{"all_valves":"Alle kleppen","valves":"Kleppen","open":"Open","opening":"Openen","closed":"Gesloten","closing":"Sluiten","stopped":"Gestopt","unclosed":"Niet gesloten"}}');var p=r.t(f,2);const g=JSON.parse('{"camera":{"all_cameras":"Todas as câmeras","cameras":"Câmeras"},"climate":{"all_climates":"Todos os climatizadores","climates":"Climatizadores"},"cover":{"all_covers":"Todas as persianas","covers":"Persianas"},"fan":{"all_fans":"Todos os ventiladores","fans":"Ventiladores"},"generic":{"all":"Todos","areas":"Áreas","busy":"Ocupado","good_afternoon":"Boa tarde","good_evening":"Boa noite","good_morning":"Bom dia","hello":"Olá","home":"Início","miscellaneous":"Variados","numbers":"Números","off":"Desligado","on":"Ligado","open":"Aberto","ordering_position":"Posição de ordenação","unavailable":"Indisponível","unclosed":"Não fechado","undisclosed":"Outro","unknown":"Desconhecido"},"input_select":{"input_selects":"Seleção de entrada"},"light":{"all_lights":"Todas as luzes","lights":"Luzes"},"lock":{"all_locks":"Todas as fechaduras","locked":"Travado","locks":"Fechaduras","unlocked":"Destravado"},"media_player":{"media_players":"Reprodutores de mídia"},"scene":{"scenes":"Cenas"},"select":{"selects":"Seleção"},"sensor":{"binary_sensors":"Binário Sensores","sensors":"Sensores"},"switch":{"all_switches":"Todos os interruptores","badge_confirmation":"Atenção: Essa ação irá desligar todos os interruptores. Tem certeza que deseja continuar?","switches":"Interruptores"},"vacuum":{"all_vacuums":"Todos os aspiradores","vacuums":"Aspiradores"},"valve":{"all_valves":"Todas as válvulas","valves":"Válvulas","open":"Aberto","opening":"Abrindo","closed":"Fechado","closing":"Fechando","stopped":"Parado","unclosed":"Nao fechado"}}');var m=r.t(g,2),v=r(6964);const _={de:i,en:o,es:c,fr:h,hu:u,nl:p,"pt-BR":m};function y(e,t){try{return e.split(".").reduce((e,t)=>e[t],_[t])}catch{return}}let w;function O(e){const t=e?.locale.language??"en";w=e=>y(e,t)??y(e,"en")??e}function E(e){return w?w(e):((0,v.OG)(v.br,"localize is not initialized! Call setupCustomLocalize first."),e)}},1122(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>u});var s=r(4137),i=r(1241),n=r(3007),o=r(6964),a=r(2682),c=r(2737),l=r(2816);const u=class{constructor(){this.baseConfiguration={icon:"mdi:view-dashboard",subview:!1},this.viewHeaderCardConfiguration={cards:[],type:""},i.O.initialized||(0,o.OG)(o.ZY,"Registry is not initialized!")}get domain(){return this.constructor.domain}async getView(){const e=await this.createSections();return!!e.length&&("home"===this.domain?{...this.baseConfiguration,sections:e}:{...this.baseConfiguration,cards:e})}async createSections(){const e=[],t=(0,n.ps)(this.domain+"Card"),o=(await r(2560)(`./${t}`)).default,u=new a.A(i.O.entities).whereDomain(this.domain).where(e=>!e.entity_id.endsWith("_stateful_scene")).toList();for(const t of i.O.areas){const r=new a.A(u).whereAreaId(t.area_id).toList();let n=[],d={area_id:[t.area_id]};if("undisclosed"===t.area_id&&(d={entity_id:r.map(e=>e.entity_id)}),n.push(...r.map(e=>new o(e,i.O.strategyOptions.card_options?.[e.entity_id]).getCard())),n.length){n=(0,c.P)(n,i.O.strategyOptions.domains[this.domain].stack_count??i.O.strategyOptions.domains._.stack_count);const r="headerCardConfiguration"in this.baseConfiguration?this.baseConfiguration.headerCardConfiguration:{};n.unshift(new s.default(d,{title:t.name,...r,subtitle:i.O.strategyOptions.show_positions?`${(0,l.k)("generic.ordering_position")}: ${t.order}`:void 0}).createCard()),e.push({type:"vertical-stack",cards:n})}}return this.viewHeaderCardConfiguration.cards.length&&e.length&&e.unshift(this.viewHeaderCardConfiguration),e}initializeViewConfig(e,t={},r){this.baseConfiguration={...this.baseConfiguration,...e,...t},this.baseConfiguration.headerCardConfiguration={...this.baseConfiguration.headerCardConfiguration,show_controls:i.O.strategyOptions.domains[this.domain].show_controls??i.O.strategyOptions.domains._.show_controls},this.viewHeaderCardConfiguration=new s.default(this.getDomainTargets(),{...this.baseConfiguration.headerCardConfiguration,...r}).createCard()}getDomainTargets(){return{entity_id:i.O.entities.filter(e=>e.entity_id.startsWith(this.domain+".")).map(e=>e.entity_id)}}}},1255(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("camera.cameras"),path:"cameras",icon:"mdi:cctv",subview:!1,headerCardConfiguration:{show_controls:!1}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("camera.all_cameras"),subtitle:`${s.O.getCountTemplate(o.domain,"ne","off")} ${(0,i.k)("camera.cameras")} `+(0,i.k)("generic.busy")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="camera";const a=o},6559(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("climate.climates"),path:"climates",icon:"mdi:thermostat",subview:!1,headerCardConfiguration:{show_controls:!1}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("climate.all_climates"),subtitle:`${s.O.getCountTemplate(o.domain,"ne","off")} ${(0,i.k)("climate.climates")} `+(0,i.k)("generic.busy")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="climate";const a=o},7547(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("cover.covers"),path:"covers",icon:"mdi:window-open",subview:!1,headerCardConfiguration:{iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("cover.all_covers"),subtitle:`${s.O.getCountTemplate(o.domain,"search","(open|opening|closing)")} ${(0,i.k)("cover.covers")} ${(0,i.k)("generic.unclosed")}`}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="cover";const a=o},245(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("fan.fans"),path:"fans",icon:"mdi:fan",subview:!1,headerCardConfiguration:{iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("fan.all_fans"),subtitle:`${s.O.getCountTemplate(o.domain,"eq","on")} ${(0,i.k)("fan.fans")} `+(0,i.k)("generic.on")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="fan";const a=o},9031(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>p});var s=r(1241),i=r(2700),n=r(3007),o=r(6964),a=r(2816),c=r(1122),l=r(2682),u=r(4137),d=r(2737),h=r(9440);class f extends c.default{constructor(e){super(),this.baseConfiguration={...this.baseConfiguration,...f.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"sections",max_columns:3,header:{badges_position:"top",layout:"center"},title:(0,a.k)("generic.home"),icon:"mdi:home-assistant",path:"home",subview:!1}}async getView(){return{...this.baseConfiguration,badges:await this.createBadgeSection(),sections:await this.createSections()}}async createSections(){const e="(max-width: 1343px)",t="(min-width: 1344px)",r=[];try{const[i,n]=await Promise.all([this.createPersonCards(),this.createAreaCards()]);[["Persons",[i],e,!!i],["Quick Access Wide",s.O.strategyOptions.quick_access_cards,t,!0],["Persons and Areas",[i,n].filter(Boolean),t,!!(i??n)],["Quick Access Narrow",s.O.strategyOptions.quick_access_cards,e,!0],["Areas",[n],e,!!n],["Extra",s.O.strategyOptions.extra_cards,void 0,!0]].forEach(([e,t,s,i])=>{i&&t.length?((e,t,s)=>{const i={type:"grid",cards:t};s&&(i.visibility=[{condition:"screen",media_query:s}]),r.push(i)})(0,t,s):(0,o.OG)(o.tm,`Section ${e} has no entities available.`)})}catch(e){(0,o.OG)(o.nR,"Error importing section cards!",e)}return r}async createBadgeSection(){if(s.O.strategyOptions.home_view.hidden.badges)return void(0,o.OG)(o.tm,"Badges are hidden.");const e=[],t=s.O.getExposedNames("badge");let a;const c="auto"===s.O.strategyOptions.badges.weather_entity?s.O.entities.find(e=>e.entity_id.startsWith("weather."))?.entity_id:s.O.strategyOptions.badges.weather_entity;if(c)try{a=(await Promise.resolve().then(r.bind(r,7558))).default;const t=new a(c);e.push(t.getConfiguration())}catch(e){(0,o.OG)(o.nR,"Error importing badge weather!",e)}else(0,o.OG)(o.tm,"Weather badge has no entities available.");for(const c of t){if(!(0,i.yI)(c)||!new l.A(s.O.entities).whereDomain(c).count()){(0,o.OG)(o.tm,`Badge for domain ${c} is unsupported or has no entities available.`);continue}const t=(0,n.ps)(c+"Badge");try{a=(await r(7315)(`./${t}`)).default;const s=new a;e.push(s.getConfiguration())}catch(e){(0,o.OG)(o.nR,`Error importing badge ${c}!`,e)}}return s.O.strategyOptions.badges?.extra_badges&&e.push(...s.O.strategyOptions.badges.extra_badges),e}async createPersonCards(){if(s.O.strategyOptions.home_view.hidden.persons)return void(0,o.OG)(o.tm,"Persons section is hidden.");const e=s.O.strategyOptions.home_view.hidden.greeting;e&&(0,o.OG)(o.tm,"Greeting card is hidden.");const t=e?void 0:(new h.default).getCard(),i=[],n=(await Promise.resolve().then(r.bind(r,845))).default;return i.push(...s.O.entities.filter(e=>e.entity_id.startsWith("person.")).map(e=>new n(e).getCard())),{type:"vertical-stack",grid_options:{columns:"full"},cards:(0,d.P)(t?[t,...i]:i,s.O.strategyOptions.home_view.stack_count.persons??s.O.strategyOptions.home_view.stack_count._)}}async createAreaCards(){if(s.O.strategyOptions.home_view.hidden.areas)return void(0,o.OG)(o.tm,"Areas section is hidden.");const e=s.O.strategyOptions.home_view.hidden.areas_title;e&&(0,o.OG)(o.tm,"Greeting titleHidden is hidden.");const t=e?void 0:new u.default({},{title:(0,a.k)("generic.areas")}).createCard(),i=[];for(const e of s.O.areas){const t=s.O.strategyOptions.areas[e.area_id]?.type??s.O.strategyOptions.areas._?.type??"default";let n;try{n=(await r(2560)(`./${t}`)).default}catch(e){n=(await Promise.resolve().then(r.bind(r,4301))).default,s.O.strategyOptions.debug&&"default"!==t&&(0,o.OG)(o.nR,`Error importing ${t}: card!`,e)}i.push(new n(e,{...s.O.strategyOptions.areas._,...s.O.strategyOptions.areas[e.area_id]}).getCard())}return{type:"vertical-stack",grid_options:{columns:"full"},cards:(0,d.P)(t?[t,...i]:i,s.O.strategyOptions.home_view.stack_count._,{"custom:mushroom-template-card":s.O.strategyOptions.home_view.stack_count.areas?.[0],area:s.O.strategyOptions.home_view.stack_count.areas?.[1]})}}}f.domain="home";const p=f},9304(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("light.lights"),path:"lights",icon:"mdi:lightbulb-group",subview:!1,headerCardConfiguration:{iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("light.all_lights"),subtitle:`${s.O.getCountTemplate(o.domain,"eq","on")} ${(0,i.k)("light.lights")} `+(0,i.k)("generic.on")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="light";const a=o},7935(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("lock.locks"),path:"locks",icon:"mdi:lock-open",subview:!1,headerCardConfiguration:{iconOn:"mdi:lock-open",iconOff:"mdi:lock",onService:"lock.lock",offService:"lock.unlock"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("lock.all_locks"),subtitle:`${s.O.getCountTemplate(o.domain,"ne","locked")} ${(0,i.k)("lock.locks")} `+(0,i.k)("lock.unlocked")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="lock";const a=o},7204(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(2816),i=r(1122);class n extends i.default{static getDefaultConfig(){return{title:(0,s.k)("scene.scenes"),path:"scenes",icon:"mdi:palette",subview:!1,headerCardConfiguration:{show_controls:!1}}}static getViewHeaderCardConfig(){return{}}constructor(e){super(),this.initializeViewConfig(n.getDefaultConfig(),e,n.getViewHeaderCardConfig())}}n.domain="scene";const o=n},2464(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("switch.switches"),path:"switches",icon:"mdi:dip-switch",subview:!1,headerCardConfiguration:{iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("switch.all_switches"),subtitle:`${s.O.getCountTemplate(o.domain,"eq","on")} ${(0,i.k)("switch.switches")} `+(0,i.k)("generic.on")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="switch";const a=o},8499(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("vacuum.vacuums"),path:"vacuums",icon:"mdi:robot-vacuum",subview:!1,headerCardConfiguration:{iconOn:"mdi:robot-vacuum",iconOff:"mdi:robot-vacuum-off",onService:"vacuum.start",offService:"vacuum.stop"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("vacuum.all_vacuums"),subtitle:s.O.getCountTemplate(o.domain,"in","[cleaning, returning]")+` ${(0,i.k)("vacuum.vacuums")} ${(0,i.k)("generic.busy")}`}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="vacuum";const a=o},9798(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}static getDefaultConfig(){return{title:(0,i.k)("valve.valves"),path:"valves",icon:"mdi:valve",subview:!1,headerCardConfiguration:{iconOn:"mdi:valve-open",iconOff:"mdi:valve-closed",onService:"valve.open_valve",offService:"valve.close_valve"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("valve.all_valves"),subtitle:s.O.getCountTemplate(o.domain,"in","[closed]")+` ${(0,i.k)("valve.valves")} ${(0,i.k)("valve.unclosed")}`}}}o.domain="valve";const a=o},7315(e,t,r){var s={"./AbstractBadge":[5548,[792]],"./AbstractBadge.ts":[5548,[792]],"./ClimateBadge":[2543,[792]],"./ClimateBadge.ts":[2543,[792]],"./CoverBadge":[2299,[792]],"./CoverBadge.ts":[2299,[792]],"./FanBadge":[6305,[792]],"./FanBadge.ts":[6305,[792]],"./LightBadge":[1806,[792]],"./LightBadge.ts":[1806,[792]],"./SwitchBadge":[4710,[792]],"./SwitchBadge.ts":[4710,[792]],"./WeatherBadge":[7558,[792]],"./WeatherBadge.ts":[7558,[792]]};function i(e){try{if(!r.o(s,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}catch(e){return Promise.reject(e)}var t=s[e],i=t[0];return r.e(t[1][0]).then(()=>r(i))}i.keys=()=>Object.keys(s),i.id=7315,e.exports=i},2560(e,t,r){var s={"./AbstractCard":[4818,[]],"./AbstractCard.ts":[4818,[]],"./AreaCard":[4301,[792]],"./AreaCard.ts":[4301,[792]],"./BinarySensorCard":[1151,[792]],"./BinarySensorCard.ts":[1151,[792]],"./CameraCard":[2723,[792]],"./CameraCard.ts":[2723,[792]],"./ClimateCard":[8721,[792]],"./ClimateCard.ts":[8721,[792]],"./CoverCard":[8033,[792]],"./CoverCard.ts":[8033,[792]],"./FanCard":[2667,[792]],"./FanCard.ts":[2667,[792]],"./GreetingCard":[9440,[792]],"./GreetingCard.ts":[9440,[792]],"./HaAreaCard":[9042,[792]],"./HaAreaCard.ts":[9042,[792]],"./HeaderCard":[4137,[]],"./HeaderCard.ts":[4137,[]],"./InputSelectCard":[1810,[792]],"./InputSelectCard.ts":[1810,[792]],"./LightCard":[8254,[792]],"./LightCard.ts":[8254,[792]],"./LockCard":[6555,[792]],"./LockCard.ts":[6555,[792]],"./MediaPlayerCard":[9879,[792]],"./MediaPlayerCard.ts":[9879,[792]],"./MiscellaneousCard":[4486,[]],"./MiscellaneousCard.ts":[4486,[]],"./NumberCard":[2137,[792]],"./NumberCard.ts":[2137,[792]],"./PersonCard":[845,[792]],"./PersonCard.ts":[845,[792]],"./SceneCard":[2858,[792]],"./SceneCard.ts":[2858,[792]],"./SelectCard":[7212,[792]],"./SelectCard.ts":[7212,[792]],"./SensorCard":[5982,[]],"./SensorCard.ts":[5982,[]],"./SwitchCard":[3708,[792]],"./SwitchCard.ts":[3708,[792]],"./VacuumCard":[7430,[792]],"./VacuumCard.ts":[7430,[792]],"./ValveCard":[8868,[792]],"./ValveCard.ts":[8868,[792]]};function i(e){try{if(!r.o(s,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}catch(e){return Promise.reject(e)}var t=s[e],i=t[0];return Promise.all(t[1].map(r.e)).then(()=>r(i))}i.keys=()=>Object.keys(s),i.id=2560,e.exports=i},9555(e,t,r){var s={"./AbstractView":[1122,[792]],"./AbstractView.ts":[1122,[792]],"./CameraView":[1255,[792]],"./CameraView.ts":[1255,[792]],"./ClimateView":[6559,[792]],"./ClimateView.ts":[6559,[792]],"./CoverView":[7547,[792]],"./CoverView.ts":[7547,[792]],"./FanView":[245,[792]],"./FanView.ts":[245,[792]],"./HomeView":[9031,[792]],"./HomeView.ts":[9031,[792]],"./LightView":[9304,[792]],"./LightView.ts":[9304,[792]],"./LockView":[7935,[792]],"./LockView.ts":[7935,[792]],"./SceneView":[7204,[792]],"./SceneView.ts":[7204,[792]],"./SwitchView":[2464,[792]],"./SwitchView.ts":[2464,[792]],"./VacuumView":[8499,[792]],"./VacuumView.ts":[8499,[792]],"./ValveView":[9798,[792]],"./ValveView.ts":[9798,[792]]};function i(e){try{if(!r.o(s,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}catch(e){return Promise.reject(e)}var t=s[e],i=t[0];return r.e(t[1][0]).then(()=>r(i))}i.keys=()=>Object.keys(s),i.id=9555,e.exports=i}},s={};function i(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return r[e](n,n.exports,i),n.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(r,s){if(1&s&&(r=this(r)),8&s)return r;if("object"==typeof r&&r){if(4&s&&r.__esModule)return r;if(16&s&&"function"==typeof r.then)return r}var n=Object.create(null);i.r(n);var o={};e=e||[null,t({}),t([]),t(t)];for(var a=2&s&&r;("object"==typeof a||"function"==typeof a)&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach(e=>o[e]=()=>r[e]);return o.default=()=>r,i.d(n,o),n},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.e=()=>Promise.resolve(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e=i(4137),t=i(5982),r=i(1241),s=i(2700),n=i(3007),o=i(6964),a=i(2682),c=i(2737);class l{constructor(e,t=l.DEFAULT_NAMESPACE){this.hass=e,this.namespace=t}async showNotification(e,t,r={}){if(this.hasBeenShown(e))return;const s=this.compileStorageKey(e,r.storageKey),i=r.hassId||s,n=r.title||l.DEFAULT_TITLE;try{await this.hass.callService("persistent_notification","create",{title:n,message:t,notification_id:i}),this.markAsShown(e,r.version||"1.0.0",i)}catch(r){(0,o.OG)(o.nR,`Failed to show notification '${e}'!`,r),(0,o.OG)(o.tm,`[${n}] ${t}`)}}async dismissNotification(e,t){const r=this.compileStorageKey(e,t);try{const e=localStorage.getItem(r),t=e?JSON.parse(e):null;if(localStorage.removeItem(r),t?.hassId)return void await this.hass.callService("persistent_notification","dismiss",{notification_id:t.hassId});(0,o.OG)(o.WU,`Notification '${r}' cleared from storage!`)}catch(e){(0,o.OG)(o.nR,`Failed to clear notification '${r}'!`,e)}}hasBeenShown(e,t){const r=this.compileStorageKey(e,t);try{const e=localStorage.getItem(r);return!!e&&JSON.parse(e).shown}catch{return!1}}compileStorageKey(e,t){return t||`${this.namespace||l.DEFAULT_NAMESPACE}_${e}`}markAsShown(e,t,r){const s=this.compileStorageKey(e),i={shown:!0,timestamp:(new Date).toISOString(),version:t,hassId:r};try{localStorage.setItem(s,JSON.stringify(i))}catch(e){(0,o.OG)(o.nR,"Failed to save the notification state!",e)}}}l.DEFAULT_NAMESPACE="mushroom_strategy",l.DEFAULT_TITLE="Mushroom Strategy Notification";var u=i(7716),d=i.n(u);const h=[];var f=i(4486),p=i(2816);class g extends HTMLTemplateElement{static async generateDashboard(e){await r.O.initialize(e),await g.handleNotifications(e.hass);const t=r.O.getExposedNames("view").filter(s.uS).map(async e=>{try{const t=(0,n.ps)(`${e}View`),s=new(0,(await i(9555)(`./${t}`)).default)(r.O.strategyOptions.views[e]);return await s.getView()}catch(t){(0,o.OG)(o.nR,`Error importing ${e} view!`,t)}return null});let a=(await Promise.all(t)).filter(Boolean);return a.push(...r.O.strategyOptions.extra_views),a.sort((e,t)=>{const r=e.order??1/0,s=t.order??1/0;return r!==s?r-s:(e.title??"").localeCompare(t.title??"",void 0,{numeric:!0,sensitivity:"base"})}),r.O.strategyOptions.show_positions&&(a=a.map(e=>({...e,title:`${e.title}: ${e.order}`,show_icon_and_title:!0}))),a.push(...r.O.areas.map(e=>({title:e.name,path:e.area_id,subview:!0,hidden:e.hidden??!1,order:e.order??1/0,strategy:{type:"custom:mushroom-strategy",options:{area:e}}}))),{views:a}}static async generateView(l){const u=r.O.getExposedNames("domain"),d=l.view.strategy?.options?.area??{},h=new a.A(r.O.entities).whereAreaId(d.area_id).toList(),g=[...d.extra_cards??[]],m={area_id:[d.area_id]},v=u.filter(s.dQ).map(async s=>{const l=(0,n.ps)(s+"Card"),u={...r.O.strategyOptions.domains._,...r.O.strategyOptions.domains[s]};r.O.strategyOptions.show_positions&&"_"!==s&&(u.subtitle=`${(0,p.k)("generic.ordering_position")}: ${r.O.strategyOptions.domains[s].order}`);const d=new a.A(h).whereDomain(s).when(u.hide_config_entities,e=>e.not().whereEntityCategory("config")).when(u.hide_diagnostic_entities,e=>e.not().whereEntityCategory("diagnostic")).where(e=>!("switch"===s&&e.entity_id.endsWith("_stateful_scene"))).toList();if(!d.length)return null;const g=new e.default({entity_id:d.map(e=>e.entity_id)},u).createCard();try{const e=(await i(2560)(`./${l}`)).default;if("sensor"===s){let e=d.map(e=>{const s=r.O.hassStates[e.entity_id]?.attributes.unit_of_measurement,i={...e.device_id&&r.O.strategyOptions.card_options?.[e.device_id],...r.O.strategyOptions.card_options?.[e.entity_id],entities:[e.entity_id]};return s?new t.default(e,i).getCard():new f.default(e,i).getCard()});return e.length?(e=(0,c.P)(e,r.O.strategyOptions.domains[s].stack_count??r.O.strategyOptions.domains._.stack_count),{type:"vertical-stack",cards:[g,...e]}):null}let n=d.map(t=>{const s={...t.device_id&&r.O.strategyOptions.card_options?.[t.device_id],...r.O.strategyOptions.card_options?.[t.entity_id]};return new e(t,s).getCard()});return n=(0,c.P)(n,r.O.strategyOptions.domains[s].stack_count??r.O.strategyOptions.domains._.stack_count),n.length?{type:"vertical-stack",cards:[g,...n]}:null}catch(e){return(0,o.OG)(o.nR,`Error creating card configurations for domain ${s}`,e),null}}),_=(await Promise.all(v)).filter(Boolean);if(g.push(..._),!r.O.strategyOptions.domains.default.hidden){const t=new a.A(h).not().where(e=>(0,s.dQ)(e.entity_id.split(".",1)[0])).toList();if(t.length)try{const s=(await Promise.resolve().then(i.bind(i,4486))).default;let n=t.map(e=>new s(e,r.O.strategyOptions.card_options?.[e.entity_id]).getCard());const o=new e.default(m,{...r.O.strategyOptions.domains._,...r.O.strategyOptions.domains.default}).createCard();n.length&&(n=(0,c.P)(n,r.O.strategyOptions.domains.default.stack_count??r.O.strategyOptions.domains._.stack_count),g.push({type:"vertical-stack",cards:[o,...n]}))}catch(e){(0,o.OG)(o.nR,"Error creating card configurations for domain `miscellaneous`",e)}}return{cards:g}}static async handleNotifications(e){if(0===h.length)return;const t=new l(e,"mushroom_strategy"),r=m.replace(/^v/,""),s=d().coerce(r)||"0.0.0";try{await Promise.all(h.map(async e=>d().gte(s,e.fromVersion)&&d().lte(s,e.toVersion)?t.showNotification(e.storageKey,e.message,{title:e.title,version:r}):t.dismissNotification(e.storageKey)))}catch(e){(0,o.OG)(o.nR,"Error while handling persistent notifications for Mushroom Strategy",e)}}static getCreateSuggestions(){return{title:"Mushroom Dashboard",icon:"mdi:mushroom"}}}customElements.define("ll-strategy-mushroom-strategy",g);const m="v3.1.0";console.info("%c Mushroom Strategy %c ".concat(m," "),"color: white; background: coral; font-weight: 700;","color: coral; background: white; font-weight: 700;"),window.customStrategies=window.customStrategies||[],window.customStrategies.push({type:"mushroom-strategy",strategyType:"dashboard",name:`Mushroom Dashboard Strategy ${m}`,description:"A strategy to automatically generate a dashboard using mushroom cards.",documentationURL:`https://digilive.github.io/mushroom-strategy/${m}/`})})()})(); \ No newline at end of file diff --git a/src/mushroom-strategy.ts b/src/mushroom-strategy.ts index 83dbd53b..fda63d7b 100644 --- a/src/mushroom-strategy.ts +++ b/src/mushroom-strategy.ts @@ -25,6 +25,18 @@ import { NOTIFICATIONS } from './notifications'; import MiscellaneousCard from './cards/MiscellaneousCard'; import { localize } from './utilities/localize'; +declare global { + interface Window { + customStrategies?: Array<{ + type: string; + strategyType: string; + name: string; + description: string; + documentationURL: string; + }>; + } +} + /** * Mushroom Dashboard Strategy. * @@ -292,6 +304,21 @@ class MushroomStrategy extends HTMLTemplateElement { logMessage(lvlError, 'Error while handling persistent notifications for Mushroom Strategy', e); } } + + /** + * Returns suggestions for creating a new dashboard with this strategy. + * + * @returns An object containing the title and icon for the dashboard creation suggestion. + * + * @remarks + * This method is used by Home Assistant to display a suggestion when the user opts to create a new dashboard. + */ + static getCreateSuggestions() { + return { + title: 'Mushroom Dashboard', + icon: 'mdi:mushroom', + }; + } } customElements.define('ll-strategy-mushroom-strategy', MushroomStrategy); @@ -303,11 +330,12 @@ console.info( 'color: coral; background: white; font-weight: 700;' ); +// Register the strategy as a custom HASS dashboard. window.customStrategies = window.customStrategies || []; window.customStrategies.push({ - type: "mushroom-strategy", - strategyType: "dashboard", - name: "Mushroom Strategy", - description: `Auto-generate a dashboard with Mushroom cards (${STRATEGY_VERSION}).`, - documentationURL: "https://github.com/DigiLive/mushroom-strategy", + type: 'mushroom-strategy', + strategyType: 'dashboard', + name: `Mushroom Dashboard Strategy ${STRATEGY_VERSION}`, + description: `A strategy to automatically generate a dashboard using mushroom cards.`, + documentationURL: `https://digilive.github.io/mushroom-strategy/${STRATEGY_VERSION}/`, }); From 232b5dd9bff3f1d1164a06b93de317bc60e4becf Mon Sep 17 00:00:00 2001 From: Ferry Cools Date: Mon, 11 May 2026 12:57:01 +0200 Subject: [PATCH 4/7] Cut dist/mushroom-strategy.js Build artifacts should not be committed. --- dist/mushroom-strategy.js | 1 - 1 file changed, 1 deletion(-) delete mode 100644 dist/mushroom-strategy.js diff --git a/dist/mushroom-strategy.js b/dist/mushroom-strategy.js deleted file mode 100644 index 35e8265d..00000000 --- a/dist/mushroom-strategy.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{var e,t,r={4744(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 s(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function i(e,t,r){return e.concat(t).map(function(e){return s(e,r)})}function n(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 o(e,t){try{return t in e}catch(e){return!1}}function a(e,r,c){(c=c||{}).arrayMerge=c.arrayMerge||i,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=s;var l=Array.isArray(r);return l===Array.isArray(e)?l?c.arrayMerge(e,r,c):function(e,t,r){var i={};return r.isMergeableObject(e)&&n(e).forEach(function(t){i[t]=s(e[t],r)}),n(t).forEach(function(n){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,n)||(o(e,n)&&r.isMergeableObject(t[n])?i[n]=function(e,t){if(!t.customMerge)return a;var r=t.customMerge(e);return"function"==typeof r?r:a}(n,r)(e[n],t[n],r):i[n]=s(t[n],r))}),i}(e,r,c):s(r,c)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,r){return a(e,r,t)},{})};var c=a;e.exports=c},3904(e,t,r){"use strict";const s=Symbol("SemVer ANY");class i{static get ANY(){return s}constructor(e,t){if(t=n(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),l("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===s?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(e){const t=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=s}toString(){return this.value}test(e){if(l("Comparator.test",e,this.options.loose),this.semver===s||e===s)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=n(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(c(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(c(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=i;const n=r(8587),{safeRe:o,t:a}=r(9718),c=r(2111),l=r(7272),u=r(3908),d=r(8311)},8311(e,t,r){"use strict";const s=/\s+/g;class i{constructor(e,t){if(t=o(t),e instanceof i)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new i(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(s," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!v(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&_(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&g)|(this.options.loose&&m))+":"+e,r=n.get(t);if(r)return r;const s=this.options.loose,i=s?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];e=e.replace(i,N(this.options.includePrerelease)),c("hyphen replace",e),e=e.replace(u[d.COMPARATORTRIM],h),c("comparator trim",e),e=e.replace(u[d.TILDETRIM],f),c("tilde trim",e),e=e.replace(u[d.CARETTRIM],p),c("caret trim",e);let o=e.split(" ").map(e=>w(e,this.options)).join(" ").split(/\s+/).map(e=>I(e,this.options));s&&(o=o.filter(e=>(c("loose invalid filter",e,this.options),!!e.match(u[d.COMPARATORLOOSE])))),c("range list",o);const l=new Map,_=o.map(e=>new a(e,this.options));for(const e of _){if(v(e))return[e];l.set(e.value,e)}l.size>1&&l.has("")&&l.delete("");const y=[...l.values()];return n.set(t,y),y}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Range is required");return this.set.some(r=>y(r,t)&&e.set.some(e=>y(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t"<0.0.0-0"===e.value,_=e=>""===e.value,y=(e,t)=>{let r=!0;const s=e.slice();let i=s.pop();for(;r&&s.length;)r=s.every(e=>i.intersects(e,t)),i=s.pop();return r},w=(e,t)=>(e=e.replace(u[d.BUILD],""),c("comp",e,t),e=b(e,t),c("caret",e),e=E(e,t),c("tildes",e),e=S(e,t),c("xrange",e),e=A(e,t),c("stars",e),e),O=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(" "),C=(e,t)=>{const r=t.loose?u[d.TILDELOOSE]:u[d.TILDE];return e.replace(r,(t,r,s,i,n)=>{let o;return c("tilde",e,t,r,s,i,n),O(r)?o="":O(s)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:O(i)?o=`>=${r}.${s}.0 <${r}.${+s+1}.0-0`:n?(c("replaceTilde pr",n),o=`>=${r}.${s}.${i}-${n} <${r}.${+s+1}.0-0`):o=`>=${r}.${s}.${i} <${r}.${+s+1}.0-0`,c("tilde return",o),o})},b=(e,t)=>e.trim().split(/\s+/).map(e=>$(e,t)).join(" "),$=(e,t)=>{c("caret",e,t);const r=t.loose?u[d.CARETLOOSE]:u[d.CARET],s=t.includePrerelease?"-0":"";return e.replace(r,(t,r,i,n,o)=>{let a;return c("caret",e,t,r,i,n,o),O(r)?a="":O(i)?a=`>=${r}.0.0${s} <${+r+1}.0.0-0`:O(n)?a="0"===r?`>=${r}.${i}.0${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${s} <${+r+1}.0.0-0`:o?(c("replaceCaret pr",o),a="0"===r?"0"===i?`>=${r}.${i}.${n}-${o} <${r}.${i}.${+n+1}-0`:`>=${r}.${i}.${n}-${o} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${n}-${o} <${+r+1}.0.0-0`):(c("no pr"),a="0"===r?"0"===i?`>=${r}.${i}.${n}${s} <${r}.${i}.${+n+1}-0`:`>=${r}.${i}.${n}${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${n} <${+r+1}.0.0-0`),c("caret return",a),a})},S=(e,t)=>(c("replaceXRanges",e,t),e.split(/\s+/).map(e=>k(e,t)).join(" ")),k=(e,t)=>{e=e.trim();const r=t.loose?u[d.XRANGELOOSE]:u[d.XRANGE];return e.replace(r,(r,s,i,n,o,a)=>{c("xRange",e,r,s,i,n,o,a);const l=O(i),u=l||O(n),d=u||O(o),h=d;return"="===s&&h&&(s=""),a=t.includePrerelease?"-0":"",l?r=">"===s||"<"===s?"<0.0.0-0":"*":s&&h?(u&&(n=0),o=0,">"===s?(s=">=",u?(i=+i+1,n=0,o=0):(n=+n+1,o=0)):"<="===s&&(s="<",u?i=+i+1:n=+n+1),"<"===s&&(a="-0"),r=`${s+i}.${n}.${o}${a}`):u?r=`>=${i}.0.0${a} <${+i+1}.0.0-0`:d&&(r=`>=${i}.${n}.0${a} <${i}.${+n+1}.0-0`),c("xRange return",r),r})},A=(e,t)=>(c("replaceStars",e,t),e.trim().replace(u[d.STAR],"")),I=(e,t)=>(c("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),N=e=>(t,r,s,i,n,o,a,c,l,u,d,h)=>`${r=O(s)?"":O(i)?`>=${s}.0.0${e?"-0":""}`:O(n)?`>=${s}.${i}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=O(l)?"":O(u)?`<${+l+1}.0.0-0`:O(d)?`<${l}.${+u+1}.0-0`:h?`<=${l}.${u}.${d}-${h}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`}`.trim(),R=(e,t,r)=>{for(let r=0;r0){const s=e[r].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0}},3908(e,t,r){"use strict";const s=r(7272),{MAX_LENGTH:i,MAX_SAFE_INTEGER:n}=r(6874),{safeRe:o,t:a}=r(9718),c=r(8587),{compareIdentifiers:l}=r(1123);class u{constructor(e,t){if(t=c(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);s("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?o[a.LOOSE]:o[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&te.major?1:this.minore.minor?1:this.patche.patch?1:0}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],i=e.prerelease[t];if(s("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return l(r,i)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const r=this.build[t],i=e.build[t];if(s("build compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return l(r,i)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?o[a.PRERELEASELOOSE]:o[a.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let s=this.prerelease.length;for(;--s>=0;)"number"==typeof this.prerelease[s]&&(this.prerelease[s]++,s=-2);if(-1===s){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let s=[t,e];!1===r&&(s=[t]),0===l(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},7414(e,t,r){"use strict";const s=r(144);e.exports=(e,t)=>{const r=s(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},2111(e,t,r){"use strict";const s=r(4641),i=r(3999),n=r(5580),o=r(4089),a=r(7059),c=r(5200);e.exports=(e,t,r,l)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return s(e,r,l);case"!=":return i(e,r,l);case">":return n(e,r,l);case">=":return o(e,r,l);case"<":return a(e,r,l);case"<=":return c(e,r,l);default:throw new TypeError(`Invalid operator: ${t}`)}}},6170(e,t,r){"use strict";const s=r(3908),i=r(144),{safeRe:n,t:o}=r(9718);e.exports=(e,t)=>{if(e instanceof s)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){const s=t.includePrerelease?n[o.COERCERTLFULL]:n[o.COERCERTL];let i;for(;(i=s.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&i.index+i[0].length===r.index+r[0].length||(r=i),s.lastIndex=i.index+i[1].length+i[2].length;s.lastIndex=-1}else r=e.match(t.includePrerelease?n[o.COERCEFULL]:n[o.COERCE]);if(null===r)return null;const a=r[2],c=r[3]||"0",l=r[4]||"0",u=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return i(`${a}.${c}.${l}${u}${d}`,t)}},909(e,t,r){"use strict";const s=r(3908);e.exports=(e,t,r)=>{const i=new s(e,r),n=new s(t,r);return i.compare(n)||i.compareBuild(n)}},1763(e,t,r){"use strict";const s=r(560);e.exports=(e,t)=>s(e,t,!0)},560(e,t,r){"use strict";const s=r(3908);e.exports=(e,t,r)=>new s(e,r).compare(new s(t,r))},1832(e,t,r){"use strict";const s=r(144);e.exports=(e,t)=>{const r=s(e,null,!0),i=s(t,null,!0),n=r.compare(i);if(0===n)return null;const o=n>0,a=o?r:i,c=o?i:r,l=!!a.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return"major";if(0===c.compareMain(a))return c.minor&&!c.patch?"minor":"patch"}const u=l?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"}},4641(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>0===s(e,t,r)},5580(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(e,t,r)>0},4089(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(e,t,r)>=0},5388(e,t,r){"use strict";const s=r(3908);e.exports=(e,t,r,i,n)=>{"string"==typeof r&&(n=i,i=r,r=void 0);try{return new s(e instanceof s?e.version:e,r).inc(t,i,n).version}catch(e){return null}}},7059(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(e,t,r)<0},5200(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(e,t,r)<=0},2938(e,t,r){"use strict";const s=r(3908);e.exports=(e,t)=>new s(e,t).major},6254(e,t,r){"use strict";const s=r(3908);e.exports=(e,t)=>new s(e,t).minor},3999(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>0!==s(e,t,r)},144(e,t,r){"use strict";const s=r(3908);e.exports=(e,t,r=!1)=>{if(e instanceof s)return e;try{return new s(e,t)}catch(e){if(!r)return null;throw e}}},4493(e,t,r){"use strict";const s=r(3908);e.exports=(e,t)=>new s(e,t).patch},1729(e,t,r){"use strict";const s=r(144);e.exports=(e,t)=>{const r=s(e,t);return r&&r.prerelease.length?r.prerelease:null}},9970(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(t,e,r)},4277(e,t,r){"use strict";const s=r(909);e.exports=(e,t)=>e.sort((e,r)=>s(r,e,t))},7638(e,t,r){"use strict";const s=r(8311);e.exports=(e,t,r)=>{try{t=new s(t,r)}catch(e){return!1}return t.test(e)}},3927(e,t,r){"use strict";const s=r(909);e.exports=(e,t)=>e.sort((e,r)=>s(e,r,t))},6953(e,t,r){"use strict";const s=r(144);e.exports=(e,t)=>{const r=s(e,t);return r?r.version:null}},9589(e,t,r){"use strict";const s=r(9718),i=r(6874),n=r(3908),o=r(1123),a=r(144),c=r(6953),l=r(7414),u=r(5388),d=r(1832),h=r(2938),f=r(6254),p=r(4493),g=r(1729),m=r(560),v=r(9970),_=r(1763),y=r(909),w=r(3927),O=r(4277),E=r(5580),C=r(7059),b=r(4641),$=r(3999),S=r(4089),k=r(5200),A=r(2111),I=r(6170),N=r(3904),R=r(8311),L=r(7638),T=r(7631),D=r(9628),x=r(270),P=r(1261),V=r(3874),G=r(7075),M=r(5571),j=r(5342),B=r(6780),F=r(2525),z=r(5032);e.exports={parse:a,valid:c,clean:l,inc:u,diff:d,major:h,minor:f,patch:p,prerelease:g,compare:m,rcompare:v,compareLoose:_,compareBuild:y,sort:w,rsort:O,gt:E,lt:C,eq:b,neq:$,gte:S,lte:k,cmp:A,coerce:I,Comparator:N,Range:R,satisfies:L,toComparators:T,maxSatisfying:D,minSatisfying:x,minVersion:P,validRange:V,outside:G,gtr:M,ltr:j,intersects:B,simplifyRange:F,subset:z,SemVer:n,re:s.re,src:s.src,tokens:s.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers}},6874(e){"use strict";const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},7272(e){"use strict";const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},1123(e){"use strict";const t=/^[0-9]+$/,r=(e,r)=>{if("number"==typeof e&&"number"==typeof r)return e===r?0:er(t,e)}},8794(e){"use strict";e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},8587(e){"use strict";const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},9718(e,t,r){"use strict";const{MAX_SAFE_COMPONENT_LENGTH:s,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:n}=r(6874),o=r(7272),a=(t=e.exports={}).re=[],c=t.safeRe=[],l=t.src=[],u=t.safeSrc=[],d=t.t={};let h=0;const f="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",n],[f,i]],g=(e,t,r)=>{const s=(e=>{for(const[t,r]of p)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=h++;o(e,i,t),d[e]=i,l[i]=t,u[i]=s,a[i]=new RegExp(t,r?"g":void 0),c[i]=new RegExp(s,r?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),g("MAINVERSION",`(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${l[d.NONNUMERICIDENTIFIER]}|${l[d.NUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${l[d.NONNUMERICIDENTIFIER]}|${l[d.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASE",`(?:-(${l[d.PRERELEASEIDENTIFIER]}(?:\\.${l[d.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${l[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[d.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${f}+`),g("BUILD",`(?:\\+(${l[d.BUILDIDENTIFIER]}(?:\\.${l[d.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${l[d.MAINVERSION]}${l[d.PRERELEASE]}?${l[d.BUILD]}?`),g("FULL",`^${l[d.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${l[d.MAINVERSIONLOOSE]}${l[d.PRERELEASELOOSE]}?${l[d.BUILD]}?`),g("LOOSE",`^${l[d.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${l[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${l[d.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:${l[d.PRERELEASE]})?${l[d.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:${l[d.PRERELEASELOOSE]})?${l[d.BUILD]}?)?)?`),g("XRANGE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${s}})(?:\\.(\\d{1,${s}}))?(?:\\.(\\d{1,${s}}))?`),g("COERCE",`${l[d.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",l[d.COERCEPLAIN]+`(?:${l[d.PRERELEASE]})?`+`(?:${l[d.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",l[d.COERCE],!0),g("COERCERTLFULL",l[d.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${l[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${l[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${l[d.LONECARET]}${l[d.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${l[d.LONECARET]}${l[d.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${l[d.GTLT]}\\s*(${l[d.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]}|${l[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${l[d.XRANGEPLAIN]})\\s+-\\s+(${l[d.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${l[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[d.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},7716(e,t,r){"use strict";e.exports=r(9589)},5571(e,t,r){"use strict";const s=r(7075);e.exports=(e,t,r)=>s(e,t,">",r)},6780(e,t,r){"use strict";const s=r(8311);e.exports=(e,t,r)=>(e=new s(e,r),t=new s(t,r),e.intersects(t,r))},5342(e,t,r){"use strict";const s=r(7075);e.exports=(e,t,r)=>s(e,t,"<",r)},9628(e,t,r){"use strict";const s=r(3908),i=r(8311);e.exports=(e,t,r)=>{let n=null,o=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(n&&-1!==o.compare(e)||(n=e,o=new s(n,r)))}),n}},270(e,t,r){"use strict";const s=r(3908),i=r(8311);e.exports=(e,t,r)=>{let n=null,o=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(n&&1!==o.compare(e)||(n=e,o=new s(n,r)))}),n}},1261(e,t,r){"use strict";const s=r(3908),i=r(8311),n=r(5580);e.exports=(e,t)=>{e=new i(e,t);let r=new s("0.0.0");if(e.test(r))return r;if(r=new s("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t{const t=new s(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":o&&!n(t,o)||(o=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}}),!o||r&&!n(r,o)||(r=o)}return r&&e.test(r)?r:null}},7075(e,t,r){"use strict";const s=r(3908),i=r(3904),{ANY:n}=i,o=r(8311),a=r(7638),c=r(5580),l=r(7059),u=r(5200),d=r(4089);e.exports=(e,t,r,h)=>{let f,p,g,m,v;switch(e=new s(e,h),t=new o(t,h),r){case">":f=c,p=u,g=l,m=">",v=">=";break;case"<":f=l,p=d,g=c,m="<",v="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,h))return!1;for(let r=0;r{e.semver===n&&(e=new i(">=0.0.0")),o=o||e,a=a||e,f(e.semver,o.semver,h)?o=e:g(e.semver,a.semver,h)&&(a=e)}),o.operator===m||o.operator===v)return!1;if((!a.operator||a.operator===m)&&p(e,a.semver))return!1;if(a.operator===v&&g(e,a.semver))return!1}return!0}},2525(e,t,r){"use strict";const s=r(7638),i=r(560);e.exports=(e,t,r)=>{const n=[];let o=null,a=null;const c=e.sort((e,t)=>i(e,t,r));for(const e of c)s(e,t,r)?(a=e,o||(o=e)):(a&&n.push([o,a]),a=null,o=null);o&&n.push([o,null]);const l=[];for(const[e,t]of n)e===t?l.push(e):t||e!==c[0]?t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`):l.push("*");const u=l.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return u.length=0.0.0-0")],l=[new i(">=0.0.0")],u=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===n){if(1===t.length&&t[0].semver===n)return!0;e=r.includePrerelease?c:l}if(1===t.length&&t[0].semver===n){if(r.includePrerelease)return!0;t=l}const s=new Set;let i,u,f,p,g,m,v;for(const t of e)">"===t.operator||">="===t.operator?i=d(i,t,r):"<"===t.operator||"<="===t.operator?u=h(u,t,r):s.add(t.semver);if(s.size>1)return null;if(i&&u){if(f=a(i.semver,u.semver,r),f>0)return null;if(0===f&&(">="!==i.operator||"<="!==u.operator))return null}for(const e of s){if(i&&!o(e,String(i),r))return null;if(u&&!o(e,String(u),r))return null;for(const s of t)if(!o(e,String(s),r))return!1;return!0}let _=!(!u||r.includePrerelease||!u.semver.prerelease.length)&&u.semver,y=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver;_&&1===_.prerelease.length&&"<"===u.operator&&0===_.prerelease[0]&&(_=!1);for(const e of t){if(v=v||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,i)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(p=d(i,e,r),p===e&&p!==i)return!1}else if(">="===i.operator&&!o(i.semver,String(e),r))return!1;if(u)if(_&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===_.major&&e.semver.minor===_.minor&&e.semver.patch===_.patch&&(_=!1),"<"===e.operator||"<="===e.operator){if(g=h(u,e,r),g===e&&g!==u)return!1}else if("<="===u.operator&&!o(u.semver,String(e),r))return!1;if(!e.operator&&(u||i)&&0!==f)return!1}return!(i&&m&&!u&&0!==f||u&&v&&!i&&0!==f||y||_)},d=(e,t,r)=>{if(!e)return t;const s=a(e.semver,t.semver,r);return s>0?e:s<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,r)=>{if(!e)return t;const s=a(e.semver,t.semver,r);return s<0?e:s>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new s(e,r),t=new s(t,r);let i=!1;e:for(const s of e.set){for(const e of t.set){const t=u(s,e,r);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},7631(e,t,r){"use strict";const s=r(8311);e.exports=(e,t)=>new s(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},3874(e,t,r){"use strict";const s=r(8311);e.exports=(e,t)=>{try{return new s(e,t).range||"*"}catch(e){return null}}},1241(e,t,r){"use strict";r.d(t,{O:()=>c});var s=r(4744),i=r.n(s),n=r(6964),o=r(2816),a=r(2682);class c{constructor(){}static get devices(){return c._devices}static get hassStates(){return c._hassStates}static get initialized(){return c._initialized}static get entities(){return c._entities}static get areas(){return c._areas}static get strategyOptions(){return c._strategyOptions}static async initialize(e){(0,o.A)(e.hass),c._hassStates=e.hass.states;const{ConfigurationDefaults:t}=await Promise.resolve().then(r.bind(r,7688));try{c._strategyOptions=i()(t,e.config.strategy.options??{})}catch(e){(0,n.OG)(n.ZY,"Error importing strategy options!",e),c._strategyOptions=t}(0,n.Ux)(c.strategyOptions.debug?n.ZY:n.QC),await this.fetchRegistry(e),c._strategyOptions.extra_views=c._strategyOptions.extra_views.map(e=>({...e,subview:!1})),c._entities=new a.A(c.entities).isNotHidden().whereDisabledBy(null).toList().map(e=>({...e,area_id:e.area_id??"undisclosed"})),c._entities=c._entities.sort((e,t)=>{const r=c.getDisplayName(e),s=c.getDisplayName(t);return r.localeCompare(s,void 0,{numeric:!0,sensitivity:"base"})}),c._devices=new a.A(c.devices).isNotHidden().whereDisabledBy(null).orderBy(["name_by_user","name"],"asc").toList().map(e=>({...e,area_id:e.area_id??"undisclosed"})),c._areas.push(t.areas.undisclosed);const s=new a.A(c._areas).isNotHidden().orderBy(["name"],"asc").toList();c._areas=s.map((e,t)=>{const r="undisclosed"===e.area_id;return{...e,order:10*(t+1),...c.strategyOptions.areas._,...c.strategyOptions.areas[e.area_id],...r?{area_id:"undisclosed",type:"default"}:{}}}),c._areas=new a.A(c._areas).orderBy(["order","name"],"asc").toList(),c.strategyOptions.views=c.sortConfigByOrder(c.strategyOptions.views),c.strategyOptions.domains=c.sortConfigByOrder(c.strategyOptions.domains),c._initialized=!0}static getCountTemplate(e,t,r){return c.initialized?`{% set entities = [${new a.A(c.entities).whereDomain(e).where(e=>!e.entity_id.endsWith("_stateful_scene")&&"group"!==e.platform).toList().map(e=>`states['${e.entity_id}']`)}] %}\n {{ entities\n | selectattr('state','${t}','${r}')\n | selectattr('state','ne','unavailable')\n | selectattr('state','ne','unknown')\n | list\n | count\n }}`:((0,n.OG)(n.br,"Registry is not initialized!"),"?")}static getExposedNames(e){if("badge"===e)return Object.entries(c.strategyOptions.badges).filter(([e,t])=>!0===t).map(([e])=>e.split("_")[0]);const t=c.strategyOptions[`${e}s`];return Object.keys(t).filter(e=>"_"!==e&&"default"!==e&&!t[e].hidden)}static async fetchRegistry(e){try{[c._entities,c._devices,c._areas]=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){(0,n.OG)(n.ZY,"Error importing Home Assistant registries!",e)}}static sortConfigByOrder(e){return Object.fromEntries(Object.entries(e).sort(([,e],[,t])=>(e.order??1/0)-(t.order??1/0)||(e.title??"").localeCompare(t.title??"",void 0,{numeric:!0,sensitivity:"base"})))}}c._initialized=!1,c._areas=[],c.getDisplayName=e=>{if(e.name)return e.name;if(e.has_entity_name&&e.device_id){const t=c.devices.find(t=>t.id===e.device_id),r=t?.name_by_user??t?.name;if(r)return e.original_name?`${r} ${e.original_name}`:r}return e.original_name?e.original_name:(e.entity_id.split(".")[1]||e.entity_id).replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}},5548(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(1241),i=r(6964);const n=class{constructor(){this.configuration={type:"template"},s.O.initialized||(0,i.OG)(i.ZY,"Registry is not initialized!")}getConfiguration(){return this.configuration}}},2543(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(5548),i=r(1241);class n extends s.default{constructor(e){super(),this.configuration={...this.configuration,...n.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:thermostat",color:"orange",content:i.O.getCountTemplate("climate","ne","off"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"climates"}}}}const o=n},2299(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(1241),i=r(5548);class n extends i.default{constructor(e){super(),this.configuration={...this.configuration,...n.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:window-open",color:"cyan",content:s.O.getCountTemplate("cover","search","(open|opening|closing)"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"covers"}}}}const o=n},6305(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2682),n=r(5548);class o extends n.default{constructor(e){super(),this.configuration={...this.configuration,...o.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:fan",color:"green",content:s.O.getCountTemplate("fan","eq","on"),tap_action:{action:"perform-action",perform_action:"fan.turn_off",target:{entity_id:new i.A(s.O.entities).whereDomain("fan").getValuesByProperty("entity_id")}},hold_action:{action:"navigate",navigation_path:"fans"}}}}const a=o},1806(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2682),n=r(5548);class o extends n.default{constructor(e){super(),this.configuration={...this.configuration,...o.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:lightbulb-group",color:"amber",content:s.O.getCountTemplate("light","eq","on"),tap_action:{action:"perform-action",perform_action:"light.turn_off",target:{entity_id:new i.A(s.O.entities).whereDomain("light").getValuesByProperty("entity_id")}},hold_action:{action:"navigate",navigation_path:"lights"}}}}const a=o},4710(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(1241),i=r(2682),n=r(5548),o=r(2816);class a extends n.default{constructor(e){super(),this.configuration={...this.configuration,...a.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:dip-switch",color:"blue",content:s.O.getCountTemplate("switch","eq","on"),tap_action:{action:"perform-action",confirmation:{text:(0,o.k)("switch.badge_confirmation")},perform_action:"switch.turn_off",target:{entity_id:new i.A(s.O.entities).whereDomain("switch").getValuesByProperty("entity_id")}},hold_action:{action:"navigate",navigation_path:"switches"}}}}const c=a},7558(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(5548);class i extends s.default{constructor(e,t){super(),this.configuration={...this.configuration,...i.getDefaultConfig(e),...t}}static getDefaultConfig(e){return{type:"entity",entity:e,state_content:["state","temperature"]}}}const n=i},4818(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(1241),i=r(6964);const n=class{constructor(e){this.configuration={type:"custom:mushroom-entity-card",icon:"mdi:help-circle"},s.O.initialized||(0,i.OG)(i.ZY,"Registry is not initialized!"),this.entity=e}getCard(){return{...this.configuration,entity:"entity_id"in this.entity?this.entity.entity_id:void 0}}}},4301(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(4818),i=r(1241),n=r(2816);class o extends s.default{static getDefaultConfig(){return{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"}}}constructor(e,t){super(e);const r=o.getDefaultConfig();let s=t;r.primary=e.name,r.icon=e.icon||r.icon,i.O.strategyOptions.show_positions&&(r.secondary=`${(0,n.k)("generic.ordering_position")}: ${e.order}`),r.tap_action&&"navigation_path"in r.tap_action&&(r.tap_action.navigation_path=e.area_id),s&&(s={...s,type:r.type}),this.configuration={...this.configuration,...r,...s}}}const a=o},1151(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(5982);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-entity-card",icon:"mdi:power-cycle",icon_color:"green"}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},2723(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{entity:"",type:"picture-entity",show_name:!1,show_state:!1,camera_view:"live"}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},8721(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-climate-card",icon:void 0,hvac_modes:["off","cool","heat","fan_only"],show_temperature_control:!0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},8033(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-cover-card",icon:void 0,show_buttons_control:!0,show_position_control:!0,show_tilt_position_control:!0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},2667(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-fan-card",icon:void 0,show_percentage_control:!0,show_oscillate_control:!0,icon_animation:!0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},9440(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>i});var s=r(2816);const i=class{constructor(e){this.configuration={type:"custom:mushroom-template-card",primary:`{% set time = now().hour %}\n {% if (time >= 18) %}\n ${(0,s.k)("generic.good_evening")}, {{user}}!\n {% elif (time >= 12) %}\n ${(0,s.k)("generic.good_afternoon")}, {{user}}!\n {% elif (time >= 6) %}\n ${(0,s.k)("generic.good_morning")}, {{user}}!\n {% else %}\n ${(0,s.k)("generic.hello")}, {{user}}! {% endif %}`,icon:"mdi:hand-wave",icon_color:"orange",tap_action:{action:"none"},double_tap_action:{action:"none"},hold_action:{action:"none"}},this.configuration={...this.configuration,...e}}getCard(){return this.configuration}}},9042(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(4818),i=r(1241),n=r(2816);class o extends s.default{static getDefaultConfig(){return{type:"area",area:""}}constructor(e,t){super(e);const r=o.getDefaultConfig();r.area=e.area_id,r.navigation_path=r.area,i.O.strategyOptions.show_positions&&(r.name=`${e.name} - ${(0,n.k)("generic.ordering_position")}: ${e.order}`),this.configuration={...this.configuration,...r,...t,type:r.type}}}const a=o},4137(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>i});class s{static getDefaultConfig(){return{type:"custom:mushroom-title-card",iconOn:"mdi:power-on",iconOff:"mdi:power-off",onService:"none",offService:"none"}}constructor(e,t){this.target=e,this.configuration={...s.getDefaultConfig(),...t}}createCard(){const e=[{type:"custom:mushroom-title-card",title:this.configuration.title,subtitle:this.configuration.subtitle}];return this.configuration.show_controls&&e.push({type:"horizontal-stack",cards:[{type:"custom:mushroom-template-card",icon:this.configuration.iconOff,layout:"vertical",icon_color:"red",tap_action:{action:"call-service",service:this.configuration.offService,target:this.target,data:{}}},{type:"custom:mushroom-template-card",icon:this.configuration.iconOn,layout:"vertical",icon_color:"amber",tap_action:{action:"call-service",service:this.configuration.onService,target:this.target,data:{}}}]}),{type:"horizontal-stack",cards:e}}}const i=s},1810(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(7212);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-select-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},8254(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(2700),i=r(4818);class n extends i.default{static getDefaultConfig(){return{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",perform_action:"light.turn_on",target:{entity_id:void 0},data:{rgb_color:[255,255,255]}}}}constructor(e,t){super(e);const r=n.getDefaultConfig();(0,s.eq)(r.double_tap_action)&&(r.double_tap_action.target={entity_id:e.entity_id}),this.configuration={...this.configuration,...r,...t}}}const o=n},6555(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-lock-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},9879(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{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"]}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},4486(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-entity-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},2137(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-number-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},845(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-person-card",layout:"vertical",primary_info:"none",secondary_info:"none",icon_type:"entity-picture"}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},2858(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(1241),i=r(4818),n=r(3708),o=r(2700);class a extends i.default{static getDefaultConfig(){return{type:"custom:mushroom-entity-card",tap_action:{action:"perform-action",perform_action:"scene.turn_on",target:{}}}}constructor(e,t){const r=e.entity_id.split(".").pop(),i=s.O.entities.find(e=>e.entity_id===`switch.${r}_stateful_scene`);if(super(i??e),i)return void(this.configuration=new n.default(i).getCard());const c=a.getDefaultConfig();(0,o.eq)(c.tap_action)&&(c.tap_action.target={entity_id:e.entity_id}),c.icon=s.O.hassStates[e.entity_id]?.attributes.icon??c.icon,this.configuration={...this.configuration,...c,...t}}}const c=a},7212(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-select-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},5982(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mini-graph-card",animate:!0,icon:"mdi:information",line_color:"green"}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},3708(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-entity-card",icon:void 0,tap_action:{action:"toggle"}}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},7430(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});const s=["on_off","start_pause","stop","locate","clean_spot","return_home"];var i=r(4818);class n extends i.default{static getDefaultConfig(){return{type:"custom:mushroom-vacuum-card",icon:void 0,icon_animation:!0,commands:[...s],tap_action:{action:"more-info"}}}constructor(e,t){super(e),this.configuration={...this.configuration,...n.getDefaultConfig(),...t}}}const o=n},8868(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(2816),i=r(4818);class n extends i.default{static getDefaultConfig(){return{type:"custom:mushroom-template-card",icon:"mdi:valve",icon_color:"blue",double_tap_action:{action:"toggle"}}}constructor(e,t){super(e);const r=n.getDefaultConfig();r.entity=e.entity_id,r.icon=e.icon??r.icon,r.primary=e.name??e.original_name??"?",r.secondary=`{% \n set mapping = {\n 'open': '${(0,s.k)("valve.open")}',\n 'opening': '${(0,s.k)("valve.opening")}',\n 'closed': '${(0,s.k)("valve.closed")}',\n 'closing': '${(0,s.k)("valve.closing")}',\n 'stopped': '${(0,s.k)("valve.stopped")}',\n 'unavailable': '${(0,s.k)("generic.unavailable")}'\n }\n %}\n {{ mapping.get(states('${e.entity_id}'), '${(0,s.k)("generic.unknown")}') }}`,this.configuration={...this.configuration,...r,...t}}}const o=n},7688(e,t,r){"use strict";r.d(t,{ConfigurationDefaults:()=>i});var s=r(2816);const i={areas:{_:{type:"AreaCard"},undisclosed:{aliases:[],area_id:"undisclosed",created_at:0,floor_id:null,hidden:!1,humidity_entity_id:null,icon:"mdi:floor-plan",labels:[],modified_at:0,name:(0,s.k)("generic.undisclosed"),picture:null,temperature_entity_id:null,order:1/0}},card_options:{},badges:{weather_entity:"auto",light_count:!0,fan_count:!0,cover_count:!0,switch_count:!0,climate_count:!0,extra_badges:[]},debug:!1,domains:{_:{hide_config_entities:!0,hide_diagnostic_entities:!0,show_controls:!0,stack_count:1},lock:{order:10,title:(0,s.k)("lock.locks"),show_controls:!1,hidden:!1},binary_sensor:{order:20,title:(0,s.k)("sensor.binary_sensors"),show_controls:!1,hidden:!1,stack_count:2},camera:{order:30,title:(0,s.k)("camera.cameras"),show_controls:!1,hidden:!1},light:{order:40,title:(0,s.k)("light.lights"),iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off",hidden:!1},scene:{order:50,title:(0,s.k)("scene.scenes"),show_controls:!1,onService:"scene.turn_on",hidden:!1},climate:{order:60,title:(0,s.k)("climate.climates"),show_controls:!1,hidden:!1},fan:{order:70,title:(0,s.k)("fan.fans"),iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off",hidden:!1},cover:{order:80,title:(0,s.k)("cover.covers"),iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover",hidden:!1},media_player:{order:90,title:(0,s.k)("media_player.media_players"),show_controls:!1,hidden:!1},switch:{order:100,title:(0,s.k)("switch.switches"),iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off",hidden:!1},vacuum:{order:110,title:(0,s.k)("vacuum.vacuums"),iconOn:"mdi:robot-vacuum",iconOff:"mdi:robot-vacuum-off",onService:"vacuum.start",offService:"vacuum.stop",hidden:!1},valve:{order:120,title:(0,s.k)("valve.valves"),iconOn:"mdi:valve-open",iconOff:"mdi:valve-closed",onService:"valve.open_valve",offService:"valve.close_valve",hidden:!1},select:{order:130,title:(0,s.k)("select.selects"),show_controls:!1,hidden:!1},input_select:{order:140,title:(0,s.k)("input_select.input_selects"),show_controls:!1,hidden:!1},number:{order:150,title:(0,s.k)("generic.numbers"),show_controls:!1,hidden:!1},sensor:{order:160,title:(0,s.k)("sensor.sensors"),show_controls:!1,hidden:!1},default:{order:170,title:(0,s.k)("generic.miscellaneous"),show_controls:!1,hidden:!1}},extra_cards:[],extra_views:[],home_view:{hidden:{areas:!1,areas_title:!1,badges:!1,greeting:!0,persons:!1},stack_count:{_:2}},show_positions:!1,views:{camera:{order:60,hidden:!1},climate:{order:50,hidden:!1},cover:{order:30,hidden:!1},fan:{order:20,hidden:!1},home:{order:-1/0,hidden:!1},light:{order:10,hidden:!1},lock:{order:90,hidden:!1},scene:{order:80,hidden:!1},switch:{order:40,hidden:!1},vacuum:{order:70,hidden:!1},valve:{order:100,hidden:!1}},quick_access_cards:[]}},2700(e,t,r){"use strict";r.d(t,{dQ:()=>l,eq:()=>o,uS:()=>c,yI:()=>u});const s=["_","binary_sensor","camera","climate","cover","default","fan","input_select","light","lock","media_player","number","scene","select","sensor","switch","vacuum","valve"],i=["camera","climate","cover","fan","home","light","lock","scene","switch","vacuum","valve"],n=["light","fan","cover","switch","climate","weather"];function o(e){return!!e&&("perform-action"===e.action||"call-service"===e.action)&&"perform_action"in e}function a(e,t){return t.includes(e)}function c(e){return a(e,i)}function l(e){return a(e,s)}function u(e){return a(e,n)}},2682(e,t,r){"use strict";r.d(t,{A:()=>a});var s=r(1241),i=r(6964),n=r(3007);class o{constructor(e){this.filters=[],this.invertNext=!1,this.entries=e,this.entryIdentifier=0===e.length||"entity_id"in e[0]?"entity_id":"floor_id"in e[0]?"area_id":"id"}not(){return this.invertNext=!this.invertNext,this}resetFilters(){return this.filters=[],this.invertNext=!1,this}where(e){return this.filters.push(this.checkInversion(e)),this}when(e,t){return e?t(this):this}whereAreaId(e,t=!0){return this.filters.push(this.checkInversion(r=>{const i=r;let n;if(t&&i.device_id&&(n=s.O.devices.find(e=>e.id===i.device_id)?.area_id),!e)return r.area_id===e&&n===e;if("undisclosed"===e){const e="undisclosed"===n||null==n;return"undisclosed"===r.area_id&&e}return r.area_id===e||"undisclosed"===r.area_id&&n===e})),this}whereNameContains(e){const t=e.toLowerCase();return this.filters.push(this.checkInversion(e=>{const r=e;return[r.name,r.original_name,r.name_by_user].filter(e=>"string"==typeof e).some(e=>e.toLowerCase().includes(t))})),this}whereDomain(e){const t=e+".";return this.filters.push(this.checkInversion(e=>"entity_id"in e&&e.entity_id.startsWith(t))),this}whereFloorId(e){return this.filters.push(this.checkInversion(t=>{const r="floor_id"in t;return void 0===e?!r:r&&t.floor_id===e})),this}whereDeviceId(e){return this.filters.push(this.checkInversion(t=>{const r="id"in t,s="device_id"in t;return void 0===e?!r&&!s:r&&t.id===e||s&&t.device_id===e})),this}whereEntityId(e){return this.filters.push(this.checkInversion(t=>void 0===e?!("entity_id"in t):"entity_id"in t&&t.entity_id===e)),this}whereDisabledBy(e){return this.filters.push(this.checkInversion(t=>{const r="disabled_by"in t;return void 0===e?!r:r&&t.disabled_by===e})),this}whereHiddenBy(e){return this.filters.push(this.checkInversion(t=>{const r="hidden_by"in t;return void 0===e?!r:r&&t.hidden_by===e})),this}isNotHidden(e=!0){return this.filters.push(this.checkInversion(t=>{const r="hidden_by"in t&&t.hidden_by;if(!e)return!r;const i=t[this.entryIdentifier],n="area_id"===this.entryIdentifier?{...s.O.strategyOptions.areas._,...s.O.strategyOptions.areas[i]}:s.O.strategyOptions.card_options?.[i];return!(r||!0===n?.hidden)})),this}whereEntityCategory(e){const t=this.invertNext;return this.invertNext=!1,this.filters.push(r=>{const s="entity_category"in r?r.entity_category:void 0;return t?s!==e:s===e}),this}orderBy(e,t="asc"){const r="asc"===t?1:-1,s=[...this.entries].sort((s,i)=>{for(const o of e){const e=s[o],a=i[o];if(e===a)continue;const[c,l]=(0,n.B3)(e),[u,d]=(0,n.B3)(a);if(c!==u)return(c-u)*r;const h=(0,n.ck)(l,d,t);if(0!==h)return h}return 0}),i=new o(s);return i.filters=[...this.filters],i}take(e){const t=Math.max(0,e);return this.filters.push((e,r)=>rr>=t),this}toList(){const e=new o(this.entries);return e.filters=[...this.filters],e.entries.filter((t,r)=>e.filters.every(e=>e(t,r)))}getValuesByProperty(e){return this.toList().map(t=>t[e]).filter(e=>void 0!==e)}first(){const e=new o(this.entries);return e.filters=[...this.filters],e.entries.find((t,r)=>e.filters.every(e=>e(t,r)))}single(){const e=new o(this.entries);e.filters=[...this.filters];const t=e.entries.filter((t,r)=>e.filters.every(e=>e(t,r)));if(1===t.length)return t[0];(0,i.OG)(i.br,`Expected a single element, but found ${t.length}.`)}count(){const e=new o(this.entries);return e.filters=[...this.filters],e.entries.filter((t,r)=>e.filters.every(e=>e(t,r))).length}checkInversion(e){return this.invertNext?(this.invertNext=!1,t=>!e(t)):e}}const a=o},3007(e,t,r){"use strict";function s(e){return e.replace(/^([a-z])|([-_][a-z])/g,e=>e.toUpperCase().replace(/[-_]/g,""))}function i(e){if("function"==typeof structuredClone)try{return structuredClone(e)}catch{}try{return JSON.parse(JSON.stringify(e))}catch{return e}}function n(e,t,r="asc"){if(e===t)return 0;const s="asc"===r?1:-1;if(null==e||null==t)return(null==e?-1:1)*s;if("string"==typeof e&&"string"==typeof t)return e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})*s;const i=e=>"number"==typeof e||"boolean"==typeof e;return i(e)&&i(t)?(+e-+t)*s:0}function o(e){return e===-1/0?[0,0]:null==e?[2,0]:e===1/0?[3,0]:[1,e]}r.d(t,{B3:()=>o,Go:()=>i,ck:()=>n,ps:()=>s})},2737(e,t,r){"use strict";function s(e,t=2,r){if(e.length<=1)return e;const s=(e,t)=>{if(e.length<=1)return e;const r=[];for(let s=0;ss})},6964(e,t,r){"use strict";r.d(t,{OG:()=>p,QC:()=>n,Ux:()=>f,WU:()=>o,ZY:()=>u,br:()=>c,nR:()=>l,tm:()=>a});var s,i=r(3007);!function(e){e[e.Off=0]="Off",e[e.Debug=1]="Debug",e[e.Info=2]="Info",e[e.Warn=3]="Warn",e[e.Error=4]="Error",e[e.Fatal=5]="Fatal"}(s||(s={}));const{Off:n,Debug:o,Info:a,Warn:c,Error:l,Fatal:u}=s;let d=s.Fatal;function h(e){if(e.includes("@"))return e.split("@")[0]||"anonymous";const t=e.match(/at ([^( ]+)/);return t?t[1]:null}function f(e){d=e}function p(e,t,...r){if(d===s.Off||e>d)return;const n="Mushroom Strategy - An error occurred. Check the console (F12) for details.",o=`[${s[e].toUpperCase()}]`,a=r.map(i.Go),c=`[at ${function(e){if(!e)return"unknown function";const t=e.split("\n");for(const e of t){if(!e)continue;const t=h(e);if(t&&"logMessage"!==t)return t}return"unknown function"}((new Error).stack)}]`;switch(e){case s.Debug:console.debug(`${o}${c} ${t}`,...a);break;case s.Info:console.info(`${o}${c} ${t}`,...a);break;case s.Warn:console.warn(`${o}${c} ${t}`,...a);break;case s.Error:throw console.error(`${o}${c} ${t}`,...a),n;case s.Fatal:throw console.error(`${o}${c} ${t}`,...a),alert?.(`${o} ${t}`),n}}},2816(e,t,r){"use strict";r.d(t,{A:()=>O,k:()=>E});const s=JSON.parse('{"camera":{"all_cameras":"Alle Kameras","cameras":"Kameras"},"climate":{"all_climates":"Alle Klimaanlagen","climates":"Klimaanlagen"},"cover":{"all_covers":"Alle Abdeckungen","covers":"Abdeckungen"},"fan":{"all_fans":"Alle Ventilatoren","fans":"Ventilatoren"},"generic":{"all":"Alle","areas":"Bereiche","busy":"Beschäftigt","good_afternoon":"Guten Nachmittag","good_evening":"Guten Abend","good_morning":"Guten Morgen","hello":"Hallo","home":"Start","miscellaneous":"Sonstiges","numbers":"Zahlen","off":"Aus","on":"Ein","open":"Offen","ordering_position":"Sortierposition","unavailable":"Nicht verfügbar","unclosed":"Nicht Geschlossen","undisclosed":"Sonstiges","unknown":"Unbekannt"},"input_select":{"input_selects":"Auswahl-Eingaben"},"light":{"all_lights":"Alle Leuchten","lights":"Leuchten"},"lock":{"locked":"Gesperrt","all_locks":"Alle Schlösser","locks":"Schlösser","unlocked":"Entsperrt"},"media_player":{"media_players":"Wiedergabegeräte"},"scene":{"scenes":"Szenen"},"select":{"selects":"Auswahlen"},"sensor":{"binary_sensors":"Binäre Sensoren","sensors":"Sensoren"},"switch":{"all_switches":"Alle Schalter","badge_confirmation":"Warnung: Diese Aktion wird alle Schalter ausschalten. Sind Sie sicher, dass Sie fortfahren möchten?","switches":"Schalter"},"vacuum":{"all_vacuums":"Alle Staubsauger","vacuums":"Staubsauger"},"valve":{"all_valves":"Alle Ventile","valves":"Ventile","open":"Offen","opening":"Öffnet","closed":"Geschlossen","closing":"Schließt","stopped":"Gestoppt","unclosed":"Nicht geschlossen"}}');var i=r.t(s,2);const n=JSON.parse('{"camera":{"all_cameras":"All Cameras","cameras":"Cameras"},"climate":{"all_climates":"All Climates","climates":"Climates"},"cover":{"all_covers":"All Covers","covers":"Covers"},"fan":{"all_fans":"All Fans","fans":"Fans"},"generic":{"all":"All","areas":"Areas","busy":"Busy","good_afternoon":"Good afternoon","good_evening":"Good evening","good_morning":"Good morning","hello":"Hello","home":"Home","miscellaneous":"Miscellaneous","numbers":"Numbers","off":"Off","on":"On","open":"Open","ordering_position":"Ordering position","unavailable":"Unavailable","unclosed":"Unclosed","undisclosed":"Other","unknown":"Unknown"},"input_select":{"input_selects":"Input Selects"},"light":{"all_lights":"All Lights","lights":"Lights"},"lock":{"all_locks":"All Locks","locked":"Locked","locks":"Locks","unlocked":"Unlocked"},"media_player":{"media_players":"Media Players"},"scene":{"scenes":"Scenes"},"select":{"selects":"Selects"},"sensor":{"binary_sensors":"Binary Sensors","sensors":"Sensors"},"switch":{"all_switches":"All Switches","badge_confirmation":"Warning: This action will turn off all switches. Are you sure you want to continue?","switches":"Switches"},"vacuum":{"all_vacuums":"All Vacuums","vacuums":"Vacuums"},"valve":{"all_valves":"All Valves","valves":"Valves","open":"Open","opening":"Opening","closed":"Closed","closing":"Closing","stopped":"Stopped","unclosed":"Unclosed"}}');var o=r.t(n,2);const a=JSON.parse('{"camera":{"all_cameras":"Todas las Cámaras","cameras":"Cámaras"},"climate":{"all_climates":"Todos los Termostatos","climates":"Termostatos"},"cover":{"all_covers":"Todas las Cubiertas","covers":"Cubiertas"},"fan":{"all_fans":"Todos los Ventiladores","fans":"Ventiladores"},"generic":{"all":"Todo","areas":"Áreas","busy":"Ocupado","good_afternoon":"Buenas tardes","good_evening":"Buenas noches","good_morning":"Buenos días","hello":"Hola","home":"Inicio","miscellaneous":"Varios","numbers":"Números","off":"Apagado","on":"Encendido","open":"Abierto","ordering_position":"Posición de orden","unavailable":"No Disponible","unclosed":"Sin Cerrar","undisclosed":"Varios","unknown":"Desconocido"},"input_select":{"input_selects":"Selecciones de Entrada"},"light":{"all_lights":"Todas las Luces","lights":"Luces"},"lock":{"all_locks":"Todas las Candados","locked":"Locked","locks":"Candados","unlocked":"Desbloqueado"},"media_player":{"media_players":"Reproductores Multimedia"},"scene":{"scenes":"Scenas"},"select":{"selects":"Seleccionar"},"sensor":{"binary_sensors":"Binario Sensores","sensors":"Sensores"},"switch":{"all_switches":"Todos los Apagadores","badge_confirmation":"Advertencia: Esta acción apagará todos los interruptores. ¿Está seguro de que desea continuar?","switches":"Apagadores"},"vacuum":{"all_vacuums":"Todas las Aspiradoras","vacuums":"Aspiradoras"},"valve":{"all_valves":"Todas las válvulas","valves":"Válvulas","open":"Abierta","opening":"Abriendo","closed":"Cerrada","closing":"Cerrando","stopped":"Detenida","unclosed":"No Cerrada"}}');var c=r.t(a,2);const l=JSON.parse('{"camera":{"all_cameras":"Összes kamera","cameras":"Kamerák"},"climate":{"all_climates":"Összes klíma","climates":"Klímák"},"cover":{"all_covers":"Összes redőny","covers":"Redőnyök"},"fan":{"all_fans":"Összes ventilátor","fans":"Ventilátorok"},"generic":{"all":"Összes","areas":"Területek","busy":"Foglalt","good_afternoon":"Jó napot","good_evening":"Jó estét","good_morning":"Jó reggelt","hello":"Hello","home":"Otthon","miscellaneous":"Egyéb","numbers":"Számok","off":"Ki","on":"Be","open":"Nyitva","ordering_position":"Rendezési pozíció","unavailable":"Nem áll rendelkezésre","unclosed":"Nincs bezárva","undisclosed":"Egyéb","unknown":"Ismeretlen"},"input_select":{"input_selects":"Bemenetválasztók"},"light":{"all_lights":"Összes világítás","lights":"Lámpák"},"lock":{"all_locks":"Összes zár","locked":"Zárva","locks":"Zárak","unlocked":"Nyitott"},"media_player":{"media_players":"Médialejátszók"},"scene":{"scenes":"Jelenetek"},"select":{"selects":"Kiválasztások"},"sensor":{"binary_sensors":"Kétállapotú Szenzorok","sensors":"Szenzorok"},"switch":{"all_switches":"Összes kapcsoló","chip_confirmation":"Figyelem: Ez a művelet az összes kapcsolót lekapcsolja. Biztosan folytatja?","switches":"Kapcsolók"},"vacuum":{"all_vacuums":"Összes porszívó","vacuums":"Porszívók"},"valve":{"all_valves":"Összes szelep","valves":"Szelepek","open":"Nyitva","opening":"Nyitás","closed":"Zárva","closing":"Zárás","stopped":"Megállt","unclosed":"Nincs zárva"}}');var u=r.t(l,2);const d=JSON.parse('{"camera":{"all_cameras":"Toutes les caméras","cameras":"Caméras"},"climate":{"all_climates":"Tous les thermostats","climates":"Thermostats"},"cover":{"all_covers":"Tous les volets","covers":"Volets"},"fan":{"all_fans":"Tous les ventilateurs","fans":"Ventilateurs"},"generic":{"all":"Tout","areas":"Pièces","busy":"Occupé(e)","good_afternoon":"Bon après-midi","good_evening":"Bonsoir","good_morning":"Bonjour","hello":"Bonjour","home":"Accueil","miscellaneous":"Divers","numbers":"Nombres","off":"Éteint(e)","on":"Allumé(e)","open":"Ouvert(e)","ordering_position":"Position de tri","unavailable":"Indisponible","unclosed":"Non fermé(e)","undisclosed":"Non divulgué","unknown":"Inconnu"},"input_select":{"input_selects":"Sélecteurs d’options"},"light":{"all_lights":"Toutes les lumières","lights":"Lumières"},"lock":{"all_locks":"Tous les verrous","locked":"Verrouillé","locks":"Verrous","unlocked":"Déverrouillé"},"media_player":{"media_players":"Lecteurs multimédias"},"scene":{"scenes":"Scènes"},"select":{"selects":"Sélecteurs"},"sensor":{"binary_sensors":"Capteurs Binaires","sensors":"Capteurs"},"switch":{"all_switches":"Tous les interrupteurs","badge_confirmation":"Attention : cette action éteindra tous les interrupteurs. Êtes-vous sûr de vouloir continuer ?","switches":"Interrupteurs"},"vacuum":{"all_vacuums":"Tous les aspirateurs","vacuums":"Aspirateurs"},"valve":{"all_valves":"Toutes les vannes","valves":"Vannes","open":"Ouverte","opening":"Ouverture","closed":"Fermée","closing":"Fermeture","stopped":"Arrêtée","unclosed":"Non fermée"}}');var h=r.t(d,2);const f=JSON.parse('{"camera":{"all_cameras":"Alle Cameras","cameras":"Cameras"},"climate":{"all_climates":"Alle Klimaatregelingen","climates":"Klimaatregelingen"},"cover":{"all_covers":"Alle Bedekkingen","covers":"Bedekkingen"},"fan":{"all_fans":"Alle Ventilatoren","fans":"Ventilatoren"},"generic":{"all":"Alle","areas":"Ruimtes","busy":"Bezig","good_afternoon":"Goedemiddag","good_evening":"Goedeavond","good_morning":"Goedemorgen","hello":"Hallo","home":"Start","miscellaneous":"Overige","numbers":"Nummers","off":"Uit","on":"Aan","open":"Open","ordering_position":"Sorteer Positie","unavailable":"Onbeschikbaar","unclosed":"Niet Gesloten","undisclosed":"Overige","unknown":"Onbekend"},"input_select":{"input_selects":"Lijsten"},"light":{"all_lights":"Alle Lampen","lights":"Lampen"},"lock":{"all_locks":"Alle Sloten","locked":"Vergrendeld","locks":"Sloten","unlocked":"Ontgrendeld"},"media_player":{"media_players":"Mediaspelers"},"scene":{"scenes":"Scenes"},"select":{"selects":"Statuslijsten"},"sensor":{"binary_sensors":"Binaire Sensoren","sensors":"Sensoren"},"switch":{"all_switches":"Alle Schakelaars","badge_confirmation":"Waarschuwing: Deze actie zal alle schakelaars uitzetten. Weet u zeker dat u door wilt gaan?","switches":"Schakelaars"},"vacuum":{"all_vacuums":"Alle Afzuiging","vacuums":"Afzuiging"},"valve":{"all_valves":"Alle kleppen","valves":"Kleppen","open":"Open","opening":"Openen","closed":"Gesloten","closing":"Sluiten","stopped":"Gestopt","unclosed":"Niet gesloten"}}');var p=r.t(f,2);const g=JSON.parse('{"camera":{"all_cameras":"Todas as câmeras","cameras":"Câmeras"},"climate":{"all_climates":"Todos os climatizadores","climates":"Climatizadores"},"cover":{"all_covers":"Todas as persianas","covers":"Persianas"},"fan":{"all_fans":"Todos os ventiladores","fans":"Ventiladores"},"generic":{"all":"Todos","areas":"Áreas","busy":"Ocupado","good_afternoon":"Boa tarde","good_evening":"Boa noite","good_morning":"Bom dia","hello":"Olá","home":"Início","miscellaneous":"Variados","numbers":"Números","off":"Desligado","on":"Ligado","open":"Aberto","ordering_position":"Posição de ordenação","unavailable":"Indisponível","unclosed":"Não fechado","undisclosed":"Outro","unknown":"Desconhecido"},"input_select":{"input_selects":"Seleção de entrada"},"light":{"all_lights":"Todas as luzes","lights":"Luzes"},"lock":{"all_locks":"Todas as fechaduras","locked":"Travado","locks":"Fechaduras","unlocked":"Destravado"},"media_player":{"media_players":"Reprodutores de mídia"},"scene":{"scenes":"Cenas"},"select":{"selects":"Seleção"},"sensor":{"binary_sensors":"Binário Sensores","sensors":"Sensores"},"switch":{"all_switches":"Todos os interruptores","badge_confirmation":"Atenção: Essa ação irá desligar todos os interruptores. Tem certeza que deseja continuar?","switches":"Interruptores"},"vacuum":{"all_vacuums":"Todos os aspiradores","vacuums":"Aspiradores"},"valve":{"all_valves":"Todas as válvulas","valves":"Válvulas","open":"Aberto","opening":"Abrindo","closed":"Fechado","closing":"Fechando","stopped":"Parado","unclosed":"Nao fechado"}}');var m=r.t(g,2),v=r(6964);const _={de:i,en:o,es:c,fr:h,hu:u,nl:p,"pt-BR":m};function y(e,t){try{return e.split(".").reduce((e,t)=>e[t],_[t])}catch{return}}let w;function O(e){const t=e?.locale.language??"en";w=e=>y(e,t)??y(e,"en")??e}function E(e){return w?w(e):((0,v.OG)(v.br,"localize is not initialized! Call setupCustomLocalize first."),e)}},1122(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>u});var s=r(4137),i=r(1241),n=r(3007),o=r(6964),a=r(2682),c=r(2737),l=r(2816);const u=class{constructor(){this.baseConfiguration={icon:"mdi:view-dashboard",subview:!1},this.viewHeaderCardConfiguration={cards:[],type:""},i.O.initialized||(0,o.OG)(o.ZY,"Registry is not initialized!")}get domain(){return this.constructor.domain}async getView(){const e=await this.createSections();return!!e.length&&("home"===this.domain?{...this.baseConfiguration,sections:e}:{...this.baseConfiguration,cards:e})}async createSections(){const e=[],t=(0,n.ps)(this.domain+"Card"),o=(await r(2560)(`./${t}`)).default,u=new a.A(i.O.entities).whereDomain(this.domain).where(e=>!e.entity_id.endsWith("_stateful_scene")).toList();for(const t of i.O.areas){const r=new a.A(u).whereAreaId(t.area_id).toList();let n=[],d={area_id:[t.area_id]};if("undisclosed"===t.area_id&&(d={entity_id:r.map(e=>e.entity_id)}),n.push(...r.map(e=>new o(e,i.O.strategyOptions.card_options?.[e.entity_id]).getCard())),n.length){n=(0,c.P)(n,i.O.strategyOptions.domains[this.domain].stack_count??i.O.strategyOptions.domains._.stack_count);const r="headerCardConfiguration"in this.baseConfiguration?this.baseConfiguration.headerCardConfiguration:{};n.unshift(new s.default(d,{title:t.name,...r,subtitle:i.O.strategyOptions.show_positions?`${(0,l.k)("generic.ordering_position")}: ${t.order}`:void 0}).createCard()),e.push({type:"vertical-stack",cards:n})}}return this.viewHeaderCardConfiguration.cards.length&&e.length&&e.unshift(this.viewHeaderCardConfiguration),e}initializeViewConfig(e,t={},r){this.baseConfiguration={...this.baseConfiguration,...e,...t},this.baseConfiguration.headerCardConfiguration={...this.baseConfiguration.headerCardConfiguration,show_controls:i.O.strategyOptions.domains[this.domain].show_controls??i.O.strategyOptions.domains._.show_controls},this.viewHeaderCardConfiguration=new s.default(this.getDomainTargets(),{...this.baseConfiguration.headerCardConfiguration,...r}).createCard()}getDomainTargets(){return{entity_id:i.O.entities.filter(e=>e.entity_id.startsWith(this.domain+".")).map(e=>e.entity_id)}}}},1255(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("camera.cameras"),path:"cameras",icon:"mdi:cctv",subview:!1,headerCardConfiguration:{show_controls:!1}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("camera.all_cameras"),subtitle:`${s.O.getCountTemplate(o.domain,"ne","off")} ${(0,i.k)("camera.cameras")} `+(0,i.k)("generic.busy")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="camera";const a=o},6559(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("climate.climates"),path:"climates",icon:"mdi:thermostat",subview:!1,headerCardConfiguration:{show_controls:!1}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("climate.all_climates"),subtitle:`${s.O.getCountTemplate(o.domain,"ne","off")} ${(0,i.k)("climate.climates")} `+(0,i.k)("generic.busy")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="climate";const a=o},7547(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("cover.covers"),path:"covers",icon:"mdi:window-open",subview:!1,headerCardConfiguration:{iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("cover.all_covers"),subtitle:`${s.O.getCountTemplate(o.domain,"search","(open|opening|closing)")} ${(0,i.k)("cover.covers")} ${(0,i.k)("generic.unclosed")}`}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="cover";const a=o},245(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("fan.fans"),path:"fans",icon:"mdi:fan",subview:!1,headerCardConfiguration:{iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("fan.all_fans"),subtitle:`${s.O.getCountTemplate(o.domain,"eq","on")} ${(0,i.k)("fan.fans")} `+(0,i.k)("generic.on")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="fan";const a=o},9031(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>p});var s=r(1241),i=r(2700),n=r(3007),o=r(6964),a=r(2816),c=r(1122),l=r(2682),u=r(4137),d=r(2737),h=r(9440);class f extends c.default{constructor(e){super(),this.baseConfiguration={...this.baseConfiguration,...f.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"sections",max_columns:3,header:{badges_position:"top",layout:"center"},title:(0,a.k)("generic.home"),icon:"mdi:home-assistant",path:"home",subview:!1}}async getView(){return{...this.baseConfiguration,badges:await this.createBadgeSection(),sections:await this.createSections()}}async createSections(){const e="(max-width: 1343px)",t="(min-width: 1344px)",r=[];try{const[i,n]=await Promise.all([this.createPersonCards(),this.createAreaCards()]);[["Persons",[i],e,!!i],["Quick Access Wide",s.O.strategyOptions.quick_access_cards,t,!0],["Persons and Areas",[i,n].filter(Boolean),t,!!(i??n)],["Quick Access Narrow",s.O.strategyOptions.quick_access_cards,e,!0],["Areas",[n],e,!!n],["Extra",s.O.strategyOptions.extra_cards,void 0,!0]].forEach(([e,t,s,i])=>{i&&t.length?((e,t,s)=>{const i={type:"grid",cards:t};s&&(i.visibility=[{condition:"screen",media_query:s}]),r.push(i)})(0,t,s):(0,o.OG)(o.tm,`Section ${e} has no entities available.`)})}catch(e){(0,o.OG)(o.nR,"Error importing section cards!",e)}return r}async createBadgeSection(){if(s.O.strategyOptions.home_view.hidden.badges)return void(0,o.OG)(o.tm,"Badges are hidden.");const e=[],t=s.O.getExposedNames("badge");let a;const c="auto"===s.O.strategyOptions.badges.weather_entity?s.O.entities.find(e=>e.entity_id.startsWith("weather."))?.entity_id:s.O.strategyOptions.badges.weather_entity;if(c)try{a=(await Promise.resolve().then(r.bind(r,7558))).default;const t=new a(c);e.push(t.getConfiguration())}catch(e){(0,o.OG)(o.nR,"Error importing badge weather!",e)}else(0,o.OG)(o.tm,"Weather badge has no entities available.");for(const c of t){if(!(0,i.yI)(c)||!new l.A(s.O.entities).whereDomain(c).count()){(0,o.OG)(o.tm,`Badge for domain ${c} is unsupported or has no entities available.`);continue}const t=(0,n.ps)(c+"Badge");try{a=(await r(7315)(`./${t}`)).default;const s=new a;e.push(s.getConfiguration())}catch(e){(0,o.OG)(o.nR,`Error importing badge ${c}!`,e)}}return s.O.strategyOptions.badges?.extra_badges&&e.push(...s.O.strategyOptions.badges.extra_badges),e}async createPersonCards(){if(s.O.strategyOptions.home_view.hidden.persons)return void(0,o.OG)(o.tm,"Persons section is hidden.");const e=s.O.strategyOptions.home_view.hidden.greeting;e&&(0,o.OG)(o.tm,"Greeting card is hidden.");const t=e?void 0:(new h.default).getCard(),i=[],n=(await Promise.resolve().then(r.bind(r,845))).default;return i.push(...s.O.entities.filter(e=>e.entity_id.startsWith("person.")).map(e=>new n(e).getCard())),{type:"vertical-stack",grid_options:{columns:"full"},cards:(0,d.P)(t?[t,...i]:i,s.O.strategyOptions.home_view.stack_count.persons??s.O.strategyOptions.home_view.stack_count._)}}async createAreaCards(){if(s.O.strategyOptions.home_view.hidden.areas)return void(0,o.OG)(o.tm,"Areas section is hidden.");const e=s.O.strategyOptions.home_view.hidden.areas_title;e&&(0,o.OG)(o.tm,"Greeting titleHidden is hidden.");const t=e?void 0:new u.default({},{title:(0,a.k)("generic.areas")}).createCard(),i=[];for(const e of s.O.areas){const t=s.O.strategyOptions.areas[e.area_id]?.type??s.O.strategyOptions.areas._?.type??"default";let n;try{n=(await r(2560)(`./${t}`)).default}catch(e){n=(await Promise.resolve().then(r.bind(r,4301))).default,s.O.strategyOptions.debug&&"default"!==t&&(0,o.OG)(o.nR,`Error importing ${t}: card!`,e)}i.push(new n(e,{...s.O.strategyOptions.areas._,...s.O.strategyOptions.areas[e.area_id]}).getCard())}return{type:"vertical-stack",grid_options:{columns:"full"},cards:(0,d.P)(t?[t,...i]:i,s.O.strategyOptions.home_view.stack_count._,{"custom:mushroom-template-card":s.O.strategyOptions.home_view.stack_count.areas?.[0],area:s.O.strategyOptions.home_view.stack_count.areas?.[1]})}}}f.domain="home";const p=f},9304(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("light.lights"),path:"lights",icon:"mdi:lightbulb-group",subview:!1,headerCardConfiguration:{iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("light.all_lights"),subtitle:`${s.O.getCountTemplate(o.domain,"eq","on")} ${(0,i.k)("light.lights")} `+(0,i.k)("generic.on")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="light";const a=o},7935(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("lock.locks"),path:"locks",icon:"mdi:lock-open",subview:!1,headerCardConfiguration:{iconOn:"mdi:lock-open",iconOff:"mdi:lock",onService:"lock.lock",offService:"lock.unlock"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("lock.all_locks"),subtitle:`${s.O.getCountTemplate(o.domain,"ne","locked")} ${(0,i.k)("lock.locks")} `+(0,i.k)("lock.unlocked")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="lock";const a=o},7204(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(2816),i=r(1122);class n extends i.default{static getDefaultConfig(){return{title:(0,s.k)("scene.scenes"),path:"scenes",icon:"mdi:palette",subview:!1,headerCardConfiguration:{show_controls:!1}}}static getViewHeaderCardConfig(){return{}}constructor(e){super(),this.initializeViewConfig(n.getDefaultConfig(),e,n.getViewHeaderCardConfig())}}n.domain="scene";const o=n},2464(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("switch.switches"),path:"switches",icon:"mdi:dip-switch",subview:!1,headerCardConfiguration:{iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("switch.all_switches"),subtitle:`${s.O.getCountTemplate(o.domain,"eq","on")} ${(0,i.k)("switch.switches")} `+(0,i.k)("generic.on")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="switch";const a=o},8499(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("vacuum.vacuums"),path:"vacuums",icon:"mdi:robot-vacuum",subview:!1,headerCardConfiguration:{iconOn:"mdi:robot-vacuum",iconOff:"mdi:robot-vacuum-off",onService:"vacuum.start",offService:"vacuum.stop"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("vacuum.all_vacuums"),subtitle:s.O.getCountTemplate(o.domain,"in","[cleaning, returning]")+` ${(0,i.k)("vacuum.vacuums")} ${(0,i.k)("generic.busy")}`}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="vacuum";const a=o},9798(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}static getDefaultConfig(){return{title:(0,i.k)("valve.valves"),path:"valves",icon:"mdi:valve",subview:!1,headerCardConfiguration:{iconOn:"mdi:valve-open",iconOff:"mdi:valve-closed",onService:"valve.open_valve",offService:"valve.close_valve"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("valve.all_valves"),subtitle:s.O.getCountTemplate(o.domain,"in","[closed]")+` ${(0,i.k)("valve.valves")} ${(0,i.k)("valve.unclosed")}`}}}o.domain="valve";const a=o},7315(e,t,r){var s={"./AbstractBadge":[5548,[792]],"./AbstractBadge.ts":[5548,[792]],"./ClimateBadge":[2543,[792]],"./ClimateBadge.ts":[2543,[792]],"./CoverBadge":[2299,[792]],"./CoverBadge.ts":[2299,[792]],"./FanBadge":[6305,[792]],"./FanBadge.ts":[6305,[792]],"./LightBadge":[1806,[792]],"./LightBadge.ts":[1806,[792]],"./SwitchBadge":[4710,[792]],"./SwitchBadge.ts":[4710,[792]],"./WeatherBadge":[7558,[792]],"./WeatherBadge.ts":[7558,[792]]};function i(e){try{if(!r.o(s,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}catch(e){return Promise.reject(e)}var t=s[e],i=t[0];return r.e(t[1][0]).then(()=>r(i))}i.keys=()=>Object.keys(s),i.id=7315,e.exports=i},2560(e,t,r){var s={"./AbstractCard":[4818,[]],"./AbstractCard.ts":[4818,[]],"./AreaCard":[4301,[792]],"./AreaCard.ts":[4301,[792]],"./BinarySensorCard":[1151,[792]],"./BinarySensorCard.ts":[1151,[792]],"./CameraCard":[2723,[792]],"./CameraCard.ts":[2723,[792]],"./ClimateCard":[8721,[792]],"./ClimateCard.ts":[8721,[792]],"./CoverCard":[8033,[792]],"./CoverCard.ts":[8033,[792]],"./FanCard":[2667,[792]],"./FanCard.ts":[2667,[792]],"./GreetingCard":[9440,[792]],"./GreetingCard.ts":[9440,[792]],"./HaAreaCard":[9042,[792]],"./HaAreaCard.ts":[9042,[792]],"./HeaderCard":[4137,[]],"./HeaderCard.ts":[4137,[]],"./InputSelectCard":[1810,[792]],"./InputSelectCard.ts":[1810,[792]],"./LightCard":[8254,[792]],"./LightCard.ts":[8254,[792]],"./LockCard":[6555,[792]],"./LockCard.ts":[6555,[792]],"./MediaPlayerCard":[9879,[792]],"./MediaPlayerCard.ts":[9879,[792]],"./MiscellaneousCard":[4486,[]],"./MiscellaneousCard.ts":[4486,[]],"./NumberCard":[2137,[792]],"./NumberCard.ts":[2137,[792]],"./PersonCard":[845,[792]],"./PersonCard.ts":[845,[792]],"./SceneCard":[2858,[792]],"./SceneCard.ts":[2858,[792]],"./SelectCard":[7212,[792]],"./SelectCard.ts":[7212,[792]],"./SensorCard":[5982,[]],"./SensorCard.ts":[5982,[]],"./SwitchCard":[3708,[792]],"./SwitchCard.ts":[3708,[792]],"./VacuumCard":[7430,[792]],"./VacuumCard.ts":[7430,[792]],"./ValveCard":[8868,[792]],"./ValveCard.ts":[8868,[792]]};function i(e){try{if(!r.o(s,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}catch(e){return Promise.reject(e)}var t=s[e],i=t[0];return Promise.all(t[1].map(r.e)).then(()=>r(i))}i.keys=()=>Object.keys(s),i.id=2560,e.exports=i},9555(e,t,r){var s={"./AbstractView":[1122,[792]],"./AbstractView.ts":[1122,[792]],"./CameraView":[1255,[792]],"./CameraView.ts":[1255,[792]],"./ClimateView":[6559,[792]],"./ClimateView.ts":[6559,[792]],"./CoverView":[7547,[792]],"./CoverView.ts":[7547,[792]],"./FanView":[245,[792]],"./FanView.ts":[245,[792]],"./HomeView":[9031,[792]],"./HomeView.ts":[9031,[792]],"./LightView":[9304,[792]],"./LightView.ts":[9304,[792]],"./LockView":[7935,[792]],"./LockView.ts":[7935,[792]],"./SceneView":[7204,[792]],"./SceneView.ts":[7204,[792]],"./SwitchView":[2464,[792]],"./SwitchView.ts":[2464,[792]],"./VacuumView":[8499,[792]],"./VacuumView.ts":[8499,[792]],"./ValveView":[9798,[792]],"./ValveView.ts":[9798,[792]]};function i(e){try{if(!r.o(s,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}catch(e){return Promise.reject(e)}var t=s[e],i=t[0];return r.e(t[1][0]).then(()=>r(i))}i.keys=()=>Object.keys(s),i.id=9555,e.exports=i}},s={};function i(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return r[e](n,n.exports,i),n.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(r,s){if(1&s&&(r=this(r)),8&s)return r;if("object"==typeof r&&r){if(4&s&&r.__esModule)return r;if(16&s&&"function"==typeof r.then)return r}var n=Object.create(null);i.r(n);var o={};e=e||[null,t({}),t([]),t(t)];for(var a=2&s&&r;("object"==typeof a||"function"==typeof a)&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach(e=>o[e]=()=>r[e]);return o.default=()=>r,i.d(n,o),n},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.e=()=>Promise.resolve(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e=i(4137),t=i(5982),r=i(1241),s=i(2700),n=i(3007),o=i(6964),a=i(2682),c=i(2737);class l{constructor(e,t=l.DEFAULT_NAMESPACE){this.hass=e,this.namespace=t}async showNotification(e,t,r={}){if(this.hasBeenShown(e))return;const s=this.compileStorageKey(e,r.storageKey),i=r.hassId||s,n=r.title||l.DEFAULT_TITLE;try{await this.hass.callService("persistent_notification","create",{title:n,message:t,notification_id:i}),this.markAsShown(e,r.version||"1.0.0",i)}catch(r){(0,o.OG)(o.nR,`Failed to show notification '${e}'!`,r),(0,o.OG)(o.tm,`[${n}] ${t}`)}}async dismissNotification(e,t){const r=this.compileStorageKey(e,t);try{const e=localStorage.getItem(r),t=e?JSON.parse(e):null;if(localStorage.removeItem(r),t?.hassId)return void await this.hass.callService("persistent_notification","dismiss",{notification_id:t.hassId});(0,o.OG)(o.WU,`Notification '${r}' cleared from storage!`)}catch(e){(0,o.OG)(o.nR,`Failed to clear notification '${r}'!`,e)}}hasBeenShown(e,t){const r=this.compileStorageKey(e,t);try{const e=localStorage.getItem(r);return!!e&&JSON.parse(e).shown}catch{return!1}}compileStorageKey(e,t){return t||`${this.namespace||l.DEFAULT_NAMESPACE}_${e}`}markAsShown(e,t,r){const s=this.compileStorageKey(e),i={shown:!0,timestamp:(new Date).toISOString(),version:t,hassId:r};try{localStorage.setItem(s,JSON.stringify(i))}catch(e){(0,o.OG)(o.nR,"Failed to save the notification state!",e)}}}l.DEFAULT_NAMESPACE="mushroom_strategy",l.DEFAULT_TITLE="Mushroom Strategy Notification";var u=i(7716),d=i.n(u);const h=[];var f=i(4486),p=i(2816);class g extends HTMLTemplateElement{static async generateDashboard(e){await r.O.initialize(e),await g.handleNotifications(e.hass);const t=r.O.getExposedNames("view").filter(s.uS).map(async e=>{try{const t=(0,n.ps)(`${e}View`),s=new(0,(await i(9555)(`./${t}`)).default)(r.O.strategyOptions.views[e]);return await s.getView()}catch(t){(0,o.OG)(o.nR,`Error importing ${e} view!`,t)}return null});let a=(await Promise.all(t)).filter(Boolean);return a.push(...r.O.strategyOptions.extra_views),a.sort((e,t)=>{const r=e.order??1/0,s=t.order??1/0;return r!==s?r-s:(e.title??"").localeCompare(t.title??"",void 0,{numeric:!0,sensitivity:"base"})}),r.O.strategyOptions.show_positions&&(a=a.map(e=>({...e,title:`${e.title}: ${e.order}`,show_icon_and_title:!0}))),a.push(...r.O.areas.map(e=>({title:e.name,path:e.area_id,subview:!0,hidden:e.hidden??!1,order:e.order??1/0,strategy:{type:"custom:mushroom-strategy",options:{area:e}}}))),{views:a}}static async generateView(l){const u=r.O.getExposedNames("domain"),d=l.view.strategy?.options?.area??{},h=new a.A(r.O.entities).whereAreaId(d.area_id).toList(),g=[...d.extra_cards??[]],m={area_id:[d.area_id]},v=u.filter(s.dQ).map(async s=>{const l=(0,n.ps)(s+"Card"),u={...r.O.strategyOptions.domains._,...r.O.strategyOptions.domains[s]};r.O.strategyOptions.show_positions&&"_"!==s&&(u.subtitle=`${(0,p.k)("generic.ordering_position")}: ${r.O.strategyOptions.domains[s].order}`);const d=new a.A(h).whereDomain(s).when(u.hide_config_entities,e=>e.not().whereEntityCategory("config")).when(u.hide_diagnostic_entities,e=>e.not().whereEntityCategory("diagnostic")).where(e=>!("switch"===s&&e.entity_id.endsWith("_stateful_scene"))).toList();if(!d.length)return null;const g=new e.default({entity_id:d.map(e=>e.entity_id)},u).createCard();try{const e=(await i(2560)(`./${l}`)).default;if("sensor"===s){let e=d.map(e=>{const s=r.O.hassStates[e.entity_id]?.attributes.unit_of_measurement,i={...e.device_id&&r.O.strategyOptions.card_options?.[e.device_id],...r.O.strategyOptions.card_options?.[e.entity_id],entities:[e.entity_id]};return s?new t.default(e,i).getCard():new f.default(e,i).getCard()});return e.length?(e=(0,c.P)(e,r.O.strategyOptions.domains[s].stack_count??r.O.strategyOptions.domains._.stack_count),{type:"vertical-stack",cards:[g,...e]}):null}let n=d.map(t=>{const s={...t.device_id&&r.O.strategyOptions.card_options?.[t.device_id],...r.O.strategyOptions.card_options?.[t.entity_id]};return new e(t,s).getCard()});return n=(0,c.P)(n,r.O.strategyOptions.domains[s].stack_count??r.O.strategyOptions.domains._.stack_count),n.length?{type:"vertical-stack",cards:[g,...n]}:null}catch(e){return(0,o.OG)(o.nR,`Error creating card configurations for domain ${s}`,e),null}}),_=(await Promise.all(v)).filter(Boolean);if(g.push(..._),!r.O.strategyOptions.domains.default.hidden){const t=new a.A(h).not().where(e=>(0,s.dQ)(e.entity_id.split(".",1)[0])).toList();if(t.length)try{const s=(await Promise.resolve().then(i.bind(i,4486))).default;let n=t.map(e=>new s(e,r.O.strategyOptions.card_options?.[e.entity_id]).getCard());const o=new e.default(m,{...r.O.strategyOptions.domains._,...r.O.strategyOptions.domains.default}).createCard();n.length&&(n=(0,c.P)(n,r.O.strategyOptions.domains.default.stack_count??r.O.strategyOptions.domains._.stack_count),g.push({type:"vertical-stack",cards:[o,...n]}))}catch(e){(0,o.OG)(o.nR,"Error creating card configurations for domain `miscellaneous`",e)}}return{cards:g}}static async handleNotifications(e){if(0===h.length)return;const t=new l(e,"mushroom_strategy"),r=m.replace(/^v/,""),s=d().coerce(r)||"0.0.0";try{await Promise.all(h.map(async e=>d().gte(s,e.fromVersion)&&d().lte(s,e.toVersion)?t.showNotification(e.storageKey,e.message,{title:e.title,version:r}):t.dismissNotification(e.storageKey)))}catch(e){(0,o.OG)(o.nR,"Error while handling persistent notifications for Mushroom Strategy",e)}}static getCreateSuggestions(){return{title:"Mushroom Dashboard",icon:"mdi:mushroom"}}}customElements.define("ll-strategy-mushroom-strategy",g);const m="v3.1.0";console.info("%c Mushroom Strategy %c ".concat(m," "),"color: white; background: coral; font-weight: 700;","color: coral; background: white; font-weight: 700;"),window.customStrategies=window.customStrategies||[],window.customStrategies.push({type:"mushroom-strategy",strategyType:"dashboard",name:`Mushroom Dashboard Strategy ${m}`,description:"A strategy to automatically generate a dashboard using mushroom cards.",documentationURL:`https://digilive.github.io/mushroom-strategy/${m}/`})})()})(); \ No newline at end of file From f7e787cb72d88c1d58a428f6f0910bb8ef47bd51 Mon Sep 17 00:00:00 2001 From: DigiLive Date: Fri, 15 May 2026 16:20:08 +0200 Subject: [PATCH 5/7] Add custom Lovelace strategy interface - Introduce the CustomStrategyEntry interface to represent entries in the custom Lovelace strategy registry. - Extend the global Window interface to include a property for these registered custom strategies, enhancing the integration with Home Assistant's dashboard capabilities. --- .../lovelace/lovelace_custom_strategies.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/types/homeassistant/data/lovelace/lovelace_custom_strategies.ts diff --git a/src/types/homeassistant/data/lovelace/lovelace_custom_strategies.ts b/src/types/homeassistant/data/lovelace/lovelace_custom_strategies.ts new file mode 100644 index 00000000..1672bc00 --- /dev/null +++ b/src/types/homeassistant/data/lovelace/lovelace_custom_strategies.ts @@ -0,0 +1,28 @@ +/** + * Represents an entry in the custom Lovelace strategy registry in Home Assistant. + * + * @property {string} type - The unique strategy type identifier. + * @property {string} [name] - The display name of the strategy. + * @property {string} [description] - The description of the strategy. + * @property {string} [documentationURL] - The URL to the strategy documentation. + * @property {'dashboard'} strategyType - The strategy type. + */ +export interface CustomStrategyEntry { + type: string; + name?: string; + description?: string; + documentationURL?: string; + strategyType: 'dashboard'; +} + +declare global { + //noinspection JSUnusedGlobalSymbols This extends global Window and is used in mushroom-strategy.ts + /** + * Represents the browser window object for custom Lovelace strategy registration. + * + * @property {CustomStrategyEntry[]} [customStrategies] - The registered custom Lovelace strategies. + */ + interface Window { + customStrategies?: CustomStrategyEntry[]; + } +} From 1414b0917870863109f74dd89ac790f454e4b08b Mon Sep 17 00:00:00 2001 From: DigiLive Date: Fri, 15 May 2026 16:21:27 +0200 Subject: [PATCH 6/7] Cut global Window type declaration Remove the global Window type declaration for custom strategies as it's declared in another file already. --- src/mushroom-strategy.ts | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/mushroom-strategy.ts b/src/mushroom-strategy.ts index fda63d7b..7981e2bd 100644 --- a/src/mushroom-strategy.ts +++ b/src/mushroom-strategy.ts @@ -25,18 +25,6 @@ import { NOTIFICATIONS } from './notifications'; import MiscellaneousCard from './cards/MiscellaneousCard'; import { localize } from './utilities/localize'; -declare global { - interface Window { - customStrategies?: Array<{ - type: string; - strategyType: string; - name: string; - description: string; - documentationURL: string; - }>; - } -} - /** * Mushroom Dashboard Strategy. * @@ -321,15 +309,16 @@ class MushroomStrategy extends HTMLTemplateElement { } } -customElements.define('ll-strategy-mushroom-strategy', MushroomStrategy); - const STRATEGY_VERSION = 'v3.1.0'; + console.info( '%c Mushroom Strategy %c '.concat(STRATEGY_VERSION, ' '), 'color: white; background: coral; font-weight: 700;', 'color: coral; background: white; font-weight: 700;' ); +customElements.define('ll-strategy-mushroom-strategy', MushroomStrategy); + // Register the strategy as a custom HASS dashboard. window.customStrategies = window.customStrategies || []; window.customStrategies.push({ From 85fee56eabeb600a148dc3a0b54e8a08f900536e Mon Sep 17 00:00:00 2001 From: DigiLive Date: Fri, 15 May 2026 17:05:02 +0200 Subject: [PATCH 7/7] Add latest build from `main` --- dist/mushroom-strategy.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 dist/mushroom-strategy.js diff --git a/dist/mushroom-strategy.js b/dist/mushroom-strategy.js new file mode 100644 index 00000000..cdb23aa0 --- /dev/null +++ b/dist/mushroom-strategy.js @@ -0,0 +1 @@ +(()=>{var e,t,r={4744(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 s(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a((r=e,Array.isArray(r)?[]:{}),e,t):e;var r}function i(e,t,r){return e.concat(t).map(function(e){return s(e,r)})}function n(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 o(e,t){try{return t in e}catch(e){return!1}}function a(e,r,c){(c=c||{}).arrayMerge=c.arrayMerge||i,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=s;var l=Array.isArray(r);return l===Array.isArray(e)?l?c.arrayMerge(e,r,c):function(e,t,r){var i={};return r.isMergeableObject(e)&&n(e).forEach(function(t){i[t]=s(e[t],r)}),n(t).forEach(function(n){(function(e,t){return o(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,n)||(o(e,n)&&r.isMergeableObject(t[n])?i[n]=function(e,t){if(!t.customMerge)return a;var r=t.customMerge(e);return"function"==typeof r?r:a}(n,r)(e[n],t[n],r):i[n]=s(t[n],r))}),i}(e,r,c):s(r,c)}a.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,r){return a(e,r,t)},{})};var c=a;e.exports=c},3904(e,t,r){"use strict";const s=Symbol("SemVer ANY");class i{static get ANY(){return s}constructor(e,t){if(t=n(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),l("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===s?this.value="":this.value=this.operator+this.semver.version,l("comp",this)}parse(e){const t=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new u(r[2],this.options.loose):this.semver=s}toString(){return this.value}test(e){if(l("Comparator.test",e,this.options.loose),this.semver===s||e===s)return!0;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=n(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))||(!this.operator.startsWith(">")||!e.operator.startsWith(">"))&&(!this.operator.startsWith("<")||!e.operator.startsWith("<"))&&(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))&&!(c(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))&&!(c(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}}e.exports=i;const n=r(8587),{safeRe:o,t:a}=r(9718),c=r(2111),l=r(7272),u=r(3908),d=r(8311)},8311(e,t,r){"use strict";const s=/\s+/g;class i{constructor(e,t){if(t=o(t),e instanceof i)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new i(e.raw,t);if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(s," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter(e=>!v(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&_(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&g)|(this.options.loose&&m))+":"+e,r=n.get(t);if(r)return r;const s=this.options.loose,i=s?u[d.HYPHENRANGELOOSE]:u[d.HYPHENRANGE];e=e.replace(i,N(this.options.includePrerelease)),c("hyphen replace",e),e=e.replace(u[d.COMPARATORTRIM],h),c("comparator trim",e),e=e.replace(u[d.TILDETRIM],f),c("tilde trim",e),e=e.replace(u[d.CARETTRIM],p),c("caret trim",e);let o=e.split(" ").map(e=>w(e,this.options)).join(" ").split(/\s+/).map(e=>I(e,this.options));s&&(o=o.filter(e=>(c("loose invalid filter",e,this.options),!!e.match(u[d.COMPARATORLOOSE])))),c("range list",o);const l=new Map,_=o.map(e=>new a(e,this.options));for(const e of _){if(v(e))return[e];l.set(e.value,e)}l.size>1&&l.has("")&&l.delete("");const y=[...l.values()];return n.set(t,y),y}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Range is required");return this.set.some(r=>y(r,t)&&e.set.some(e=>y(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}for(let t=0;t"<0.0.0-0"===e.value,_=e=>""===e.value,y=(e,t)=>{let r=!0;const s=e.slice();let i=s.pop();for(;r&&s.length;)r=s.every(e=>i.intersects(e,t)),i=s.pop();return r},w=(e,t)=>(e=e.replace(u[d.BUILD],""),c("comp",e,t),e=b(e,t),c("caret",e),e=E(e,t),c("tildes",e),e=S(e,t),c("xrange",e),e=A(e,t),c("stars",e),e),O=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map(e=>C(e,t)).join(" "),C=(e,t)=>{const r=t.loose?u[d.TILDELOOSE]:u[d.TILDE];return e.replace(r,(t,r,s,i,n)=>{let o;return c("tilde",e,t,r,s,i,n),O(r)?o="":O(s)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:O(i)?o=`>=${r}.${s}.0 <${r}.${+s+1}.0-0`:n?(c("replaceTilde pr",n),o=`>=${r}.${s}.${i}-${n} <${r}.${+s+1}.0-0`):o=`>=${r}.${s}.${i} <${r}.${+s+1}.0-0`,c("tilde return",o),o})},b=(e,t)=>e.trim().split(/\s+/).map(e=>$(e,t)).join(" "),$=(e,t)=>{c("caret",e,t);const r=t.loose?u[d.CARETLOOSE]:u[d.CARET],s=t.includePrerelease?"-0":"";return e.replace(r,(t,r,i,n,o)=>{let a;return c("caret",e,t,r,i,n,o),O(r)?a="":O(i)?a=`>=${r}.0.0${s} <${+r+1}.0.0-0`:O(n)?a="0"===r?`>=${r}.${i}.0${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${s} <${+r+1}.0.0-0`:o?(c("replaceCaret pr",o),a="0"===r?"0"===i?`>=${r}.${i}.${n}-${o} <${r}.${i}.${+n+1}-0`:`>=${r}.${i}.${n}-${o} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${n}-${o} <${+r+1}.0.0-0`):(c("no pr"),a="0"===r?"0"===i?`>=${r}.${i}.${n}${s} <${r}.${i}.${+n+1}-0`:`>=${r}.${i}.${n}${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${n} <${+r+1}.0.0-0`),c("caret return",a),a})},S=(e,t)=>(c("replaceXRanges",e,t),e.split(/\s+/).map(e=>k(e,t)).join(" ")),k=(e,t)=>{e=e.trim();const r=t.loose?u[d.XRANGELOOSE]:u[d.XRANGE];return e.replace(r,(r,s,i,n,o,a)=>{c("xRange",e,r,s,i,n,o,a);const l=O(i),u=l||O(n),d=u||O(o),h=d;return"="===s&&h&&(s=""),a=t.includePrerelease?"-0":"",l?r=">"===s||"<"===s?"<0.0.0-0":"*":s&&h?(u&&(n=0),o=0,">"===s?(s=">=",u?(i=+i+1,n=0,o=0):(n=+n+1,o=0)):"<="===s&&(s="<",u?i=+i+1:n=+n+1),"<"===s&&(a="-0"),r=`${s+i}.${n}.${o}${a}`):u?r=`>=${i}.0.0${a} <${+i+1}.0.0-0`:d&&(r=`>=${i}.${n}.0${a} <${i}.${+n+1}.0-0`),c("xRange return",r),r})},A=(e,t)=>(c("replaceStars",e,t),e.trim().replace(u[d.STAR],"")),I=(e,t)=>(c("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),N=e=>(t,r,s,i,n,o,a,c,l,u,d,h)=>`${r=O(s)?"":O(i)?`>=${s}.0.0${e?"-0":""}`:O(n)?`>=${s}.${i}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=O(l)?"":O(u)?`<${+l+1}.0.0-0`:O(d)?`<${l}.${+u+1}.0-0`:h?`<=${l}.${u}.${d}-${h}`:e?`<${l}.${u}.${+d+1}-0`:`<=${c}`}`.trim(),R=(e,t,r)=>{for(let r=0;r0){const s=e[r].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch)return!0}return!1}return!0}},3908(e,t,r){"use strict";const s=r(7272),{MAX_LENGTH:i,MAX_SAFE_INTEGER:n}=r(6874),{safeRe:o,t:a}=r(9718),c=r(8587),{compareIdentifiers:l}=r(1123);class u{constructor(e,t){if(t=c(t),e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);s("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?o[a.LOOSE]:o[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&te.major?1:this.minore.minor?1:this.patche.patch?1:0}comparePre(e){if(e instanceof u||(e=new u(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],i=e.prerelease[t];if(s("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return l(r,i)}while(++t)}compareBuild(e){e instanceof u||(e=new u(e,this.options));let t=0;do{const r=this.build[t],i=e.build[t];if(s("build compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return l(r,i)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?o[a.PRERELEASELOOSE]:o[a.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let s=this.prerelease.length;for(;--s>=0;)"number"==typeof this.prerelease[s]&&(this.prerelease[s]++,s=-2);if(-1===s){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let s=[t,e];!1===r&&(s=[t]),0===l(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=u},7414(e,t,r){"use strict";const s=r(144);e.exports=(e,t)=>{const r=s(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},2111(e,t,r){"use strict";const s=r(4641),i=r(3999),n=r(5580),o=r(4089),a=r(7059),c=r(5200);e.exports=(e,t,r,l)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return s(e,r,l);case"!=":return i(e,r,l);case">":return n(e,r,l);case">=":return o(e,r,l);case"<":return a(e,r,l);case"<=":return c(e,r,l);default:throw new TypeError(`Invalid operator: ${t}`)}}},6170(e,t,r){"use strict";const s=r(3908),i=r(144),{safeRe:n,t:o}=r(9718);e.exports=(e,t)=>{if(e instanceof s)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){const s=t.includePrerelease?n[o.COERCERTLFULL]:n[o.COERCERTL];let i;for(;(i=s.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&i.index+i[0].length===r.index+r[0].length||(r=i),s.lastIndex=i.index+i[1].length+i[2].length;s.lastIndex=-1}else r=e.match(t.includePrerelease?n[o.COERCEFULL]:n[o.COERCE]);if(null===r)return null;const a=r[2],c=r[3]||"0",l=r[4]||"0",u=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return i(`${a}.${c}.${l}${u}${d}`,t)}},909(e,t,r){"use strict";const s=r(3908);e.exports=(e,t,r)=>{const i=new s(e,r),n=new s(t,r);return i.compare(n)||i.compareBuild(n)}},1763(e,t,r){"use strict";const s=r(560);e.exports=(e,t)=>s(e,t,!0)},560(e,t,r){"use strict";const s=r(3908);e.exports=(e,t,r)=>new s(e,r).compare(new s(t,r))},1832(e,t,r){"use strict";const s=r(144);e.exports=(e,t)=>{const r=s(e,null,!0),i=s(t,null,!0),n=r.compare(i);if(0===n)return null;const o=n>0,a=o?r:i,c=o?i:r,l=!!a.prerelease.length;if(c.prerelease.length&&!l){if(!c.patch&&!c.minor)return"major";if(0===c.compareMain(a))return c.minor&&!c.patch?"minor":"patch"}const u=l?"pre":"";return r.major!==i.major?u+"major":r.minor!==i.minor?u+"minor":r.patch!==i.patch?u+"patch":"prerelease"}},4641(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>0===s(e,t,r)},5580(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(e,t,r)>0},4089(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(e,t,r)>=0},5388(e,t,r){"use strict";const s=r(3908);e.exports=(e,t,r,i,n)=>{"string"==typeof r&&(n=i,i=r,r=void 0);try{return new s(e instanceof s?e.version:e,r).inc(t,i,n).version}catch(e){return null}}},7059(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(e,t,r)<0},5200(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(e,t,r)<=0},2938(e,t,r){"use strict";const s=r(3908);e.exports=(e,t)=>new s(e,t).major},6254(e,t,r){"use strict";const s=r(3908);e.exports=(e,t)=>new s(e,t).minor},3999(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>0!==s(e,t,r)},144(e,t,r){"use strict";const s=r(3908);e.exports=(e,t,r=!1)=>{if(e instanceof s)return e;try{return new s(e,t)}catch(e){if(!r)return null;throw e}}},4493(e,t,r){"use strict";const s=r(3908);e.exports=(e,t)=>new s(e,t).patch},1729(e,t,r){"use strict";const s=r(144);e.exports=(e,t)=>{const r=s(e,t);return r&&r.prerelease.length?r.prerelease:null}},9970(e,t,r){"use strict";const s=r(560);e.exports=(e,t,r)=>s(t,e,r)},4277(e,t,r){"use strict";const s=r(909);e.exports=(e,t)=>e.sort((e,r)=>s(r,e,t))},7638(e,t,r){"use strict";const s=r(8311);e.exports=(e,t,r)=>{try{t=new s(t,r)}catch(e){return!1}return t.test(e)}},3927(e,t,r){"use strict";const s=r(909);e.exports=(e,t)=>e.sort((e,r)=>s(e,r,t))},417(e,t,r){"use strict";const s=r(144),i=r(6874),n=r(3908),o=e=>e.startsWith("pre");e.exports=(e,t,r)=>{if(!i.RELEASE_TYPES.includes(t))return null;const a=((e,t)=>{const r=e instanceof n?e.version:e;return s(r,t)})(e,r);return a&&((e,t)=>{if(o(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0}return e.format()})(a,t)}},6953(e,t,r){"use strict";const s=r(144);e.exports=(e,t)=>{const r=s(e,t);return r?r.version:null}},9589(e,t,r){"use strict";const s=r(9718),i=r(6874),n=r(3908),o=r(1123),a=r(144),c=r(6953),l=r(7414),u=r(5388),d=r(1832),h=r(2938),f=r(6254),p=r(4493),g=r(1729),m=r(560),v=r(9970),_=r(1763),y=r(909),w=r(3927),O=r(4277),E=r(5580),C=r(7059),b=r(4641),$=r(3999),S=r(4089),k=r(5200),A=r(2111),I=r(6170),N=r(417),R=r(3904),L=r(8311),T=r(7638),D=r(7631),x=r(9628),P=r(270),V=r(1261),G=r(3874),M=r(7075),j=r(5571),B=r(5342),F=r(6780),z=r(2525),U=r(5032);e.exports={parse:a,valid:c,clean:l,inc:u,diff:d,major:h,minor:f,patch:p,prerelease:g,compare:m,rcompare:v,compareLoose:_,compareBuild:y,sort:w,rsort:O,gt:E,lt:C,eq:b,neq:$,gte:S,lte:k,cmp:A,coerce:I,truncate:N,Comparator:R,Range:L,satisfies:T,toComparators:D,maxSatisfying:x,minSatisfying:P,minVersion:V,validRange:G,outside:M,gtr:j,ltr:B,intersects:F,simplifyRange:z,subset:U,SemVer:n,re:s.re,src:s.src,tokens:s.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers}},6874(e){"use strict";const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},7272(e){"use strict";const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},1123(e){"use strict";const t=/^[0-9]+$/,r=(e,r)=>{if("number"==typeof e&&"number"==typeof r)return e===r?0:er(t,e)}},8794(e){"use strict";e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},8587(e){"use strict";const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},9718(e,t,r){"use strict";const{MAX_SAFE_COMPONENT_LENGTH:s,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:n}=r(6874),o=r(7272),a=(t=e.exports={}).re=[],c=t.safeRe=[],l=t.src=[],u=t.safeSrc=[],d=t.t={};let h=0;const f="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",n],[f,i]],g=(e,t,r)=>{const s=(e=>{for(const[t,r]of p)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=h++;o(e,i,t),d[e]=i,l[i]=t,u[i]=s,a[i]=new RegExp(t,r?"g":void 0),c[i]=new RegExp(s,r?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),g("MAINVERSION",`(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})\\.(${l[d.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})\\.(${l[d.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${l[d.NONNUMERICIDENTIFIER]}|${l[d.NUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${l[d.NONNUMERICIDENTIFIER]}|${l[d.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASE",`(?:-(${l[d.PRERELEASEIDENTIFIER]}(?:\\.${l[d.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${l[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[d.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${f}+`),g("BUILD",`(?:\\+(${l[d.BUILDIDENTIFIER]}(?:\\.${l[d.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${l[d.MAINVERSION]}${l[d.PRERELEASE]}?${l[d.BUILD]}?`),g("FULL",`^${l[d.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${l[d.MAINVERSIONLOOSE]}${l[d.PRERELEASELOOSE]}?${l[d.BUILD]}?`),g("LOOSE",`^${l[d.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${l[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${l[d.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:\\.(${l[d.XRANGEIDENTIFIER]})(?:${l[d.PRERELEASE]})?${l[d.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[d.XRANGEIDENTIFIERLOOSE]})(?:${l[d.PRERELEASELOOSE]})?${l[d.BUILD]}?)?)?`),g("XRANGE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${l[d.GTLT]}\\s*${l[d.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${s}})(?:\\.(\\d{1,${s}}))?(?:\\.(\\d{1,${s}}))?`),g("COERCE",`${l[d.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",l[d.COERCEPLAIN]+`(?:${l[d.PRERELEASE]})?`+`(?:${l[d.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",l[d.COERCE],!0),g("COERCERTLFULL",l[d.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${l[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${l[d.LONETILDE]}${l[d.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${l[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${l[d.LONECARET]}${l[d.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${l[d.LONECARET]}${l[d.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${l[d.GTLT]}\\s*(${l[d.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${l[d.GTLT]}\\s*(${l[d.LOOSEPLAIN]}|${l[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${l[d.XRANGEPLAIN]})\\s+-\\s+(${l[d.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${l[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[d.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},7716(e,t,r){"use strict";e.exports=r(9589)},5571(e,t,r){"use strict";const s=r(7075);e.exports=(e,t,r)=>s(e,t,">",r)},6780(e,t,r){"use strict";const s=r(8311);e.exports=(e,t,r)=>(e=new s(e,r),t=new s(t,r),e.intersects(t,r))},5342(e,t,r){"use strict";const s=r(7075);e.exports=(e,t,r)=>s(e,t,"<",r)},9628(e,t,r){"use strict";const s=r(3908),i=r(8311);e.exports=(e,t,r)=>{let n=null,o=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(n&&-1!==o.compare(e)||(n=e,o=new s(n,r)))}),n}},270(e,t,r){"use strict";const s=r(3908),i=r(8311);e.exports=(e,t,r)=>{let n=null,o=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(n&&1!==o.compare(e)||(n=e,o=new s(n,r)))}),n}},1261(e,t,r){"use strict";const s=r(3908),i=r(8311),n=r(5580);e.exports=(e,t)=>{e=new i(e,t);let r=new s("0.0.0");if(e.test(r))return r;if(r=new s("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t{const t=new s(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":o&&!n(t,o)||(o=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}}),!o||r&&!n(r,o)||(r=o)}return r&&e.test(r)?r:null}},7075(e,t,r){"use strict";const s=r(3908),i=r(3904),{ANY:n}=i,o=r(8311),a=r(7638),c=r(5580),l=r(7059),u=r(5200),d=r(4089);e.exports=(e,t,r,h)=>{let f,p,g,m,v;switch(e=new s(e,h),t=new o(t,h),r){case">":f=c,p=u,g=l,m=">",v=">=";break;case"<":f=l,p=d,g=c,m="<",v="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,h))return!1;for(let r=0;r{e.semver===n&&(e=new i(">=0.0.0")),o=o||e,a=a||e,f(e.semver,o.semver,h)?o=e:g(e.semver,a.semver,h)&&(a=e)}),o.operator===m||o.operator===v)return!1;if((!a.operator||a.operator===m)&&p(e,a.semver))return!1;if(a.operator===v&&g(e,a.semver))return!1}return!0}},2525(e,t,r){"use strict";const s=r(7638),i=r(560);e.exports=(e,t,r)=>{const n=[];let o=null,a=null;const c=e.sort((e,t)=>i(e,t,r));for(const e of c)s(e,t,r)?(a=e,o||(o=e)):(a&&n.push([o,a]),a=null,o=null);o&&n.push([o,null]);const l=[];for(const[e,t]of n)e===t?l.push(e):t||e!==c[0]?t?e===c[0]?l.push(`<=${t}`):l.push(`${e} - ${t}`):l.push(`>=${e}`):l.push("*");const u=l.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return u.length=0.0.0-0")],l=[new i(">=0.0.0")],u=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===n){if(1===t.length&&t[0].semver===n)return!0;e=r.includePrerelease?c:l}if(1===t.length&&t[0].semver===n){if(r.includePrerelease)return!0;t=l}const s=new Set;let i,u,f,p,g,m,v;for(const t of e)">"===t.operator||">="===t.operator?i=d(i,t,r):"<"===t.operator||"<="===t.operator?u=h(u,t,r):s.add(t.semver);if(s.size>1)return null;if(i&&u){if(f=a(i.semver,u.semver,r),f>0)return null;if(0===f&&(">="!==i.operator||"<="!==u.operator))return null}for(const e of s){if(i&&!o(e,String(i),r))return null;if(u&&!o(e,String(u),r))return null;for(const s of t)if(!o(e,String(s),r))return!1;return!0}let _=!(!u||r.includePrerelease||!u.semver.prerelease.length)&&u.semver,y=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver;_&&1===_.prerelease.length&&"<"===u.operator&&0===_.prerelease[0]&&(_=!1);for(const e of t){if(v=v||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,i)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),">"===e.operator||">="===e.operator){if(p=d(i,e,r),p===e&&p!==i)return!1}else if(">="===i.operator&&!o(i.semver,String(e),r))return!1;if(u)if(_&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===_.major&&e.semver.minor===_.minor&&e.semver.patch===_.patch&&(_=!1),"<"===e.operator||"<="===e.operator){if(g=h(u,e,r),g===e&&g!==u)return!1}else if("<="===u.operator&&!o(u.semver,String(e),r))return!1;if(!e.operator&&(u||i)&&0!==f)return!1}return!(i&&m&&!u&&0!==f||u&&v&&!i&&0!==f||y||_)},d=(e,t,r)=>{if(!e)return t;const s=a(e.semver,t.semver,r);return s>0?e:s<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,r)=>{if(!e)return t;const s=a(e.semver,t.semver,r);return s<0?e:s>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new s(e,r),t=new s(t,r);let i=!1;e:for(const s of e.set){for(const e of t.set){const t=u(s,e,r);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},7631(e,t,r){"use strict";const s=r(8311);e.exports=(e,t)=>new s(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "))},3874(e,t,r){"use strict";const s=r(8311);e.exports=(e,t)=>{try{return new s(e,t).range||"*"}catch(e){return null}}},1241(e,t,r){"use strict";r.d(t,{O:()=>c});var s=r(4744),i=r.n(s),n=r(6964),o=r(2816),a=r(2682);class c{constructor(){}static get devices(){return c._devices}static get hassStates(){return c._hassStates}static get initialized(){return c._initialized}static get entities(){return c._entities}static get areas(){return c._areas}static get strategyOptions(){return c._strategyOptions}static async initialize(e){(0,o.A)(e.hass),c._hassStates=e.hass.states;const{ConfigurationDefaults:t}=await Promise.resolve().then(r.bind(r,7688));try{c._strategyOptions=i()(t,e.config.strategy.options??{})}catch(e){(0,n.OG)(n.ZY,"Error importing strategy options!",e),c._strategyOptions=t}(0,n.Ux)(c.strategyOptions.debug?n.ZY:n.QC),await this.fetchRegistry(e),c._strategyOptions.extra_views=c._strategyOptions.extra_views.map(e=>({...e,subview:!1})),c._entities=new a.A(c.entities).isNotHidden().whereDisabledBy(null).toList().map(e=>({...e,area_id:e.area_id??"undisclosed"})),c._entities=c._entities.sort((e,t)=>{const r=c.getDisplayName(e),s=c.getDisplayName(t);return r.localeCompare(s,void 0,{numeric:!0,sensitivity:"base"})}),c._devices=new a.A(c.devices).isNotHidden().whereDisabledBy(null).orderBy(["name_by_user","name"],"asc").toList().map(e=>({...e,area_id:e.area_id??"undisclosed"})),c._areas.push({aliases:[],area_id:"undisclosed",created_at:0,floor_id:null,hidden:!1,humidity_entity_id:null,icon:"mdi:floor-plan",labels:[],modified_at:0,name:(0,o.k)("generic.undisclosed"),order:1/0,picture:null,temperature_entity_id:null});const s=new a.A(c._areas).isNotHidden().orderBy(["name"],"asc").toList();c._areas=s.map((e,t)=>{const r="undisclosed"===e.area_id;return{...e,order:10*(t+1),...c.strategyOptions.areas._,...c.strategyOptions.areas[e.area_id],...r?{area_id:"undisclosed",type:"default"}:{}}}),c._areas=new a.A(c._areas).orderBy(["order","name"],"asc").toList(),c.strategyOptions.views=c.sortConfigByOrder(c.strategyOptions.views),c.strategyOptions.domains=c.sortConfigByOrder(c.strategyOptions.domains),c._initialized=!0}static getCountTemplate(e,t,r){return c.initialized?`{% set entities = [${new a.A(c.entities).whereDomain(e).where(e=>!e.entity_id.endsWith("_stateful_scene")&&"group"!==e.platform).toList().map(e=>`states['${e.entity_id}']`).toString()}] %}\n {{ entities\n | selectattr('state','${t}','${r}')\n | selectattr('state','ne','unavailable')\n | selectattr('state','ne','unknown')\n | list\n | count\n }}`:((0,n.OG)(n.br,"Registry is not initialized!"),"?")}static getExposedNames(e){if("badge"===e)return Object.entries(c.strategyOptions.badges).filter(([e,t])=>!0===t).map(([e])=>e.split("_")[0]);const t=c.strategyOptions[`${e}s`];return Object.keys(t).filter(e=>"_"!==e&&"default"!==e&&!t[e].hidden)}static async fetchRegistry(e){try{[c._entities,c._devices,c._areas]=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){(0,n.OG)(n.ZY,"Error importing Home Assistant registries!",e)}}static sortConfigByOrder(e){return Object.fromEntries(Object.entries(e).sort(([,e],[,t])=>(e.order??1/0)-(t.order??1/0)||(e.title??"").localeCompare(t.title??"",void 0,{numeric:!0,sensitivity:"base"})))}}c._initialized=!1,c._areas=[],c.getDisplayName=e=>{if(e.name)return e.name;if(e.has_entity_name&&e.device_id){const t=c.devices.find(t=>t.id===e.device_id),r=t?.name_by_user??t?.name;if(r)return e.original_name?`${r} ${e.original_name}`:r}return e.original_name?e.original_name:(e.entity_id.split(".")[1]||e.entity_id).replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}},5548(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(1241),i=r(6964);const n=class{constructor(){this.configuration={type:"template"},s.O.initialized||(0,i.OG)(i.ZY,"Registry is not initialized!")}getConfiguration(){return this.configuration}}},2543(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(5548),i=r(1241);class n extends s.default{constructor(e){super(),this.configuration={...this.configuration,...n.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:thermostat",color:"orange",content:i.O.getCountTemplate("climate","ne","off"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"climates"}}}}const o=n},2299(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(1241),i=r(5548);class n extends i.default{constructor(e){super(),this.configuration={...this.configuration,...n.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:window-open",color:"cyan",content:s.O.getCountTemplate("cover","search","(open|opening|closing)"),tap_action:{action:"none"},hold_action:{action:"navigate",navigation_path:"covers"}}}}const o=n},6305(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2682),n=r(5548);class o extends n.default{constructor(e){super(),this.configuration={...this.configuration,...o.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:fan",color:"green",content:s.O.getCountTemplate("fan","eq","on"),tap_action:{action:"perform-action",perform_action:"fan.turn_off",target:{entity_id:new i.A(s.O.entities).whereDomain("fan").getValuesByProperty("entity_id")}},hold_action:{action:"navigate",navigation_path:"fans"}}}}const a=o},1806(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2682),n=r(5548);class o extends n.default{constructor(e){super(),this.configuration={...this.configuration,...o.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:lightbulb-group",color:"amber",content:s.O.getCountTemplate("light","eq","on"),tap_action:{action:"perform-action",perform_action:"light.turn_off",target:{entity_id:new i.A(s.O.entities).whereDomain("light").getValuesByProperty("entity_id")}},hold_action:{action:"navigate",navigation_path:"lights"}}}}const a=o},4710(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(1241),i=r(2682),n=r(5548),o=r(2816);class a extends n.default{constructor(e){super(),this.configuration={...this.configuration,...a.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"custom:mushroom-template-badge",icon:"mdi:dip-switch",color:"blue",content:s.O.getCountTemplate("switch","eq","on"),tap_action:{action:"perform-action",confirmation:{text:(0,o.k)("switch.badge_confirmation")},perform_action:"switch.turn_off",target:{entity_id:new i.A(s.O.entities).whereDomain("switch").getValuesByProperty("entity_id")}},hold_action:{action:"navigate",navigation_path:"switches"}}}}const c=a},7558(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(5548);class i extends s.default{constructor(e,t){super(),this.configuration={...this.configuration,...i.getDefaultConfig(e),...t}}static getDefaultConfig(e){return{type:"entity",entity:e,state_content:["state","temperature"]}}}const n=i},4818(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(1241),i=r(6964);const n=class{constructor(e){this.configuration={type:"custom:mushroom-entity-card",icon:"mdi:help-circle"},s.O.initialized||(0,i.OG)(i.ZY,"Registry is not initialized!"),this.entity=e}getCard(){return{...this.configuration,entity:"entity_id"in this.entity?this.entity.entity_id:void 0}}}},4301(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(4818),i=r(1241),n=r(2816);class o extends s.default{static getDefaultConfig(){return{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"}}}constructor(e,t){super(e);const r=o.getDefaultConfig();let s=t;r.primary=e.name,r.icon=e.icon??r.icon,i.O.strategyOptions.show_positions&&(r.secondary=`${(0,n.k)("generic.ordering_position")}: ${e.order}`),r.tap_action&&"navigation_path"in r.tap_action&&(r.tap_action.navigation_path=e.area_id),s&&(s={...s,type:r.type}),this.configuration={...this.configuration,...r,...s}}}const a=o},1151(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(5982);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-entity-card",icon:"mdi:power-cycle",icon_color:"green"}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},2723(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{entity:"",type:"picture-entity",show_name:!1,show_state:!1,camera_view:"live"}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},8721(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-climate-card",icon:void 0,hvac_modes:["off","cool","heat","fan_only"],show_temperature_control:!0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},8033(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-cover-card",icon:void 0,show_buttons_control:!0,show_position_control:!0,show_tilt_position_control:!0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},2667(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-fan-card",icon:void 0,show_percentage_control:!0,show_oscillate_control:!0,icon_animation:!0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},9440(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>i});var s=r(2816);const i=class{constructor(e){this.configuration={type:"custom:mushroom-template-card",primary:`{% set time = now().hour %}\n {% if (time >= 18) %}\n ${(0,s.k)("generic.good_evening")}, {{user}}!\n {% elif (time >= 12) %}\n ${(0,s.k)("generic.good_afternoon")}, {{user}}!\n {% elif (time >= 6) %}\n ${(0,s.k)("generic.good_morning")}, {{user}}!\n {% else %}\n ${(0,s.k)("generic.hello")}, {{user}}! {% endif %}`,icon:"mdi:hand-wave",icon_color:"orange",tap_action:{action:"none"},double_tap_action:{action:"none"},hold_action:{action:"none"}},this.configuration={...this.configuration,...e}}getCard(){return this.configuration}}},9042(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(4818),i=r(1241),n=r(2816);class o extends s.default{static getDefaultConfig(){return{type:"area",area:""}}constructor(e,t){super(e);const r=o.getDefaultConfig();r.area=e.area_id,r.navigation_path=r.area,i.O.strategyOptions.show_positions&&(r.name=`${e.name} - ${(0,n.k)("generic.ordering_position")}: ${e.order}`),this.configuration={...this.configuration,...r,...t,type:r.type}}}const a=o},4137(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>i});class s{static getDefaultConfig(){return{type:"custom:mushroom-title-card",iconOn:"mdi:power-on",iconOff:"mdi:power-off",onService:"none",offService:"none"}}constructor(e,t){this.target=e,this.configuration={...s.getDefaultConfig(),...t}}createCard(){const e=[{type:"custom:mushroom-title-card",title:this.configuration.title,subtitle:this.configuration.subtitle}];return this.configuration.show_controls&&e.push({type:"horizontal-stack",cards:[{type:"custom:mushroom-template-card",icon:this.configuration.iconOff,layout:"vertical",icon_color:"red",tap_action:{action:"call-service",service:this.configuration.offService,target:this.target,data:{}}},{type:"custom:mushroom-template-card",icon:this.configuration.iconOn,layout:"vertical",icon_color:"amber",tap_action:{action:"call-service",service:this.configuration.onService,target:this.target,data:{}}}]}),{type:"horizontal-stack",cards:e}}}const i=s},1810(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(7212);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-select-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},8254(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(2700),i=r(4818);class n extends i.default{static getDefaultConfig(){return{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",perform_action:"light.turn_on",target:{entity_id:void 0},data:{rgb_color:[255,255,255]}}}}constructor(e,t){super(e);const r=n.getDefaultConfig();(0,s.eq)(r.double_tap_action)&&(r.double_tap_action.target={entity_id:e.entity_id}),this.configuration={...this.configuration,...r,...t}}}const o=n},6555(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-lock-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},9879(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{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"]}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},4486(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-entity-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},2137(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-number-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},845(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-person-card",layout:"vertical",primary_info:"none",secondary_info:"none",icon_type:"entity-picture"}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},2858(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(1241),i=r(4818),n=r(3708),o=r(2700);class a extends i.default{static getDefaultConfig(){return{type:"custom:mushroom-entity-card",tap_action:{action:"perform-action",perform_action:"scene.turn_on",target:{}}}}constructor(e,t){const r=e.entity_id.split(".").pop(),i=s.O.entities.find(e=>e.entity_id===`switch.${r}_stateful_scene`);if(super(i??e),i)return void(this.configuration=new n.default(i).getCard());const c=a.getDefaultConfig();(0,o.eq)(c.tap_action)&&(c.tap_action.target={entity_id:e.entity_id}),c.icon=s.O.hassStates[e.entity_id]?.attributes.icon??c.icon,this.configuration={...this.configuration,...c,...t}}}const c=a},7212(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-select-card",icon:void 0}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},5982(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mini-graph-card",animate:!0,icon:"mdi:information",line_color:"green"}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},3708(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(4818);class i extends s.default{static getDefaultConfig(){return{type:"custom:mushroom-entity-card",icon:void 0,tap_action:{action:"toggle"}}}constructor(e,t){super(e),this.configuration={...this.configuration,...i.getDefaultConfig(),...t}}}const n=i},7430(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});const s=["on_off","start_pause","stop","locate","clean_spot","return_home"];var i=r(4818);class n extends i.default{static getDefaultConfig(){return{type:"custom:mushroom-vacuum-card",icon:void 0,icon_animation:!0,commands:[...s],tap_action:{action:"more-info"}}}constructor(e,t){super(e),this.configuration={...this.configuration,...n.getDefaultConfig(),...t}}}const o=n},8868(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(2816),i=r(4818);class n extends i.default{static getDefaultConfig(){return{type:"custom:mushroom-template-card",icon:"mdi:valve",icon_color:"blue",double_tap_action:{action:"toggle"}}}constructor(e,t){super(e);const r=n.getDefaultConfig();r.entity=e.entity_id,r.icon=e.icon??r.icon,r.primary=e.name??e.original_name??"?",r.secondary=`{% \n set mapping = {\n 'open': '${(0,s.k)("valve.open")}',\n 'opening': '${(0,s.k)("valve.opening")}',\n 'closed': '${(0,s.k)("valve.closed")}',\n 'closing': '${(0,s.k)("valve.closing")}',\n 'stopped': '${(0,s.k)("valve.stopped")}',\n 'unavailable': '${(0,s.k)("generic.unavailable")}'\n }\n %}\n {{ mapping.get(states('${e.entity_id}'), '${(0,s.k)("generic.unknown")}') }}`,this.configuration={...this.configuration,...r,...t}}}const o=n},7688(e,t,r){"use strict";r.d(t,{ConfigurationDefaults:()=>i});var s=r(2816);const i={areas:{_:{hidden:!1,type:"AreaCard"},undisclosed:{area_id:"undisclosed",hidden:!1,icon:"mdi:floor-plan",name:(0,s.k)("generic.undisclosed"),order:1/0,type:"AreaCard"}},card_options:{},badges:{weather_entity:"auto",light_count:!0,fan_count:!0,cover_count:!0,switch_count:!0,climate_count:!0,extra_badges:[]},debug:!1,domains:{_:{hide_config_entities:!0,hide_diagnostic_entities:!0,show_controls:!0,stack_count:1},lock:{order:10,title:(0,s.k)("lock.locks"),show_controls:!1,hidden:!1},binary_sensor:{order:20,title:(0,s.k)("sensor.binary_sensors"),show_controls:!1,hidden:!1,stack_count:2},camera:{order:30,title:(0,s.k)("camera.cameras"),show_controls:!1,hidden:!1},light:{order:40,title:(0,s.k)("light.lights"),iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off",hidden:!1},scene:{order:50,title:(0,s.k)("scene.scenes"),show_controls:!1,onService:"scene.turn_on",hidden:!1},climate:{order:60,title:(0,s.k)("climate.climates"),show_controls:!1,hidden:!1},fan:{order:70,title:(0,s.k)("fan.fans"),iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off",hidden:!1},cover:{order:80,title:(0,s.k)("cover.covers"),iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover",hidden:!1},media_player:{order:90,title:(0,s.k)("media_player.media_players"),show_controls:!1,hidden:!1},switch:{order:100,title:(0,s.k)("switch.switches"),iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off",hidden:!1},vacuum:{order:110,title:(0,s.k)("vacuum.vacuums"),iconOn:"mdi:robot-vacuum",iconOff:"mdi:robot-vacuum-off",onService:"vacuum.start",offService:"vacuum.stop",hidden:!1},valve:{order:120,title:(0,s.k)("valve.valves"),iconOn:"mdi:valve-open",iconOff:"mdi:valve-closed",onService:"valve.open_valve",offService:"valve.close_valve",hidden:!1},select:{order:130,title:(0,s.k)("select.selects"),show_controls:!1,hidden:!1},input_select:{order:140,title:(0,s.k)("input_select.input_selects"),show_controls:!1,hidden:!1},number:{order:150,title:(0,s.k)("generic.numbers"),show_controls:!1,hidden:!1},sensor:{order:160,title:(0,s.k)("sensor.sensors"),show_controls:!1,hidden:!1},default:{order:170,title:(0,s.k)("generic.miscellaneous"),show_controls:!1,hidden:!1}},extra_cards:[],extra_views:[],home_view:{hidden:{areas:!1,areas_title:!1,badges:!1,greeting:!0,persons:!1},stack_count:{_:2}},show_positions:!1,views:{camera:{order:60,hidden:!1},climate:{order:50,hidden:!1},cover:{order:30,hidden:!1},fan:{order:20,hidden:!1},home:{order:-1/0,hidden:!1},light:{order:10,hidden:!1},lock:{order:90,hidden:!1},scene:{order:80,hidden:!1},switch:{order:40,hidden:!1},vacuum:{order:70,hidden:!1},valve:{order:100,hidden:!1}},quick_access_cards:[]}},2700(e,t,r){"use strict";r.d(t,{dQ:()=>l,eq:()=>o,uS:()=>c,yI:()=>u});const s=["_","binary_sensor","camera","climate","cover","default","fan","input_select","light","lock","media_player","number","scene","select","sensor","switch","vacuum","valve"],i=["camera","climate","cover","fan","home","light","lock","scene","switch","vacuum","valve"],n=["light","fan","cover","switch","climate","weather"];function o(e){return!!e&&("perform-action"===e.action||"call-service"===e.action)&&"perform_action"in e}function a(e,t){return t.includes(e)}function c(e){return a(e,i)}function l(e){return a(e,s)}function u(e){return a(e,n)}},2682(e,t,r){"use strict";r.d(t,{A:()=>a});var s=r(1241),i=r(6964),n=r(3007);class o{constructor(e){this.filters=[],this.invertNext=!1,this.entries=e,this.entryIdentifier=0===e.length||"entity_id"in e[0]?"entity_id":"floor_id"in e[0]?"area_id":"id"}not(){return this.invertNext=!this.invertNext,this}resetFilters(){return this.filters=[],this.invertNext=!1,this}where(e){return this.filters.push(this.checkInversion(e)),this}when(e,t){return e?t(this):this}whereAreaId(e,t=!0){return this.filters.push(this.checkInversion(r=>{const i=r;let n;if(t&&i.device_id&&(n=s.O.devices.find(e=>e.id===i.device_id)?.area_id),!e)return r.area_id===e&&n===e;if("undisclosed"===e){const e="undisclosed"===n||null==n;return"undisclosed"===r.area_id&&e}return r.area_id===e||"undisclosed"===r.area_id&&n===e})),this}whereNameContains(e){const t=e.toLowerCase();return this.filters.push(this.checkInversion(e=>{const r=e;return[r.name,r.original_name,r.name_by_user].filter(e=>"string"==typeof e).some(e=>e.toLowerCase().includes(t))})),this}whereDomain(e){const t=e+".";return this.filters.push(this.checkInversion(e=>"entity_id"in e&&e.entity_id.startsWith(t))),this}whereFloorId(e){return this.filters.push(this.checkInversion(t=>{const r="floor_id"in t;return void 0===e?!r:r&&t.floor_id===e})),this}whereDeviceId(e){return this.filters.push(this.checkInversion(t=>{const r="id"in t,s="device_id"in t;return void 0===e?!r&&!s:r&&t.id===e||s&&t.device_id===e})),this}whereEntityId(e){return this.filters.push(this.checkInversion(t=>void 0===e?!("entity_id"in t):"entity_id"in t&&t.entity_id===e)),this}whereDisabledBy(e){return this.filters.push(this.checkInversion(t=>{const r="disabled_by"in t;return void 0===e?!r:r&&t.disabled_by===e})),this}whereHiddenBy(e){return this.filters.push(this.checkInversion(t=>{const r="hidden_by"in t;return void 0===e?!r:r&&t.hidden_by===e})),this}isNotHidden(e=!0){return this.filters.push(this.checkInversion(t=>{const r="hidden_by"in t&&t.hidden_by;if(!e)return!r;const i=t[this.entryIdentifier],n="area_id"===this.entryIdentifier?{...s.O.strategyOptions.areas._,...s.O.strategyOptions.areas[i]}:s.O.strategyOptions.card_options?.[i];return!(r||!0===n?.hidden)})),this}whereEntityCategory(e){const t=this.invertNext;return this.invertNext=!1,this.filters.push(r=>{const s="entity_category"in r?r.entity_category:void 0;return t?s!==e:s===e}),this}orderBy(e,t="asc"){const r="asc"===t?1:-1,s=[...this.entries].sort((s,i)=>{for(const o of e){const e=s[o],a=i[o];if(e===a)continue;const[c,l]=(0,n.B3)(e),[u,d]=(0,n.B3)(a);if(c!==u)return(c-u)*r;const h=(0,n.ck)(l,d,t);if(0!==h)return h}return 0}),i=new o(s);return i.filters=[...this.filters],i}take(e){const t=Math.max(0,e);return this.filters.push((e,r)=>rr>=t),this}toList(){const e=new o(this.entries);return e.filters=[...this.filters],e.entries.filter((t,r)=>e.filters.every(e=>e(t,r)))}getValuesByProperty(e){return this.toList().map(t=>t[e]).filter(e=>void 0!==e)}first(){const e=new o(this.entries);return e.filters=[...this.filters],e.entries.find((t,r)=>e.filters.every(e=>e(t,r)))}single(){const e=new o(this.entries);e.filters=[...this.filters];const t=e.entries.filter((t,r)=>e.filters.every(e=>e(t,r)));if(1===t.length)return t[0];(0,i.OG)(i.br,`Expected a single element, but found ${t.length}.`)}count(){const e=new o(this.entries);return e.filters=[...this.filters],e.entries.filter((t,r)=>e.filters.every(e=>e(t,r))).length}checkInversion(e){return this.invertNext?(this.invertNext=!1,t=>!e(t)):e}}const a=o},3007(e,t,r){"use strict";function s(e){return e.replace(/^([a-z])|([-_][a-z])/g,e=>e.toUpperCase().replace(/[-_]/g,""))}function i(e){if("function"==typeof structuredClone)try{return structuredClone(e)}catch{}try{return JSON.parse(JSON.stringify(e))}catch{return e}}function n(e,t,r="asc"){if(e===t)return 0;const s="asc"===r?1:-1;if(null==e||null==t)return(null==e?-1:1)*s;if("string"==typeof e&&"string"==typeof t)return e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})*s;const i=e=>"number"==typeof e||"boolean"==typeof e;return i(e)&&i(t)?(+e-+t)*s:0}function o(e){return e===-1/0?[0,0]:null==e?[2,0]:e===1/0?[3,0]:[1,e]}r.d(t,{B3:()=>o,Go:()=>i,ck:()=>n,ps:()=>s})},2737(e,t,r){"use strict";function s(e,t=2,r){if(e.length<=1)return e;const s=(e,t)=>{if(e.length<=1)return e;const r=[];for(let s=0;ss})},6964(e,t,r){"use strict";r.d(t,{OG:()=>p,QC:()=>n,Ux:()=>f,WU:()=>o,ZY:()=>u,br:()=>c,nR:()=>l,tm:()=>a});var s,i=r(3007);!function(e){e[e.Off=0]="Off",e[e.Debug=1]="Debug",e[e.Info=2]="Info",e[e.Warn=3]="Warn",e[e.Error=4]="Error",e[e.Fatal=5]="Fatal"}(s||(s={}));const{Off:n,Debug:o,Info:a,Warn:c,Error:l,Fatal:u}=s;let d=s.Fatal;function h(e){if(e.includes("@"))return e.split("@")[0]||"anonymous";const t=e.match(/at ([^( ]+)/);return t?t[1]:null}function f(e){d=e}function p(e,t,...r){if(d===s.Off||e>d)return;const n="Mushroom Strategy - An error occurred. Check the console (F12) for details.",o=`[${s[e].toUpperCase()}]`,a=r.map(i.Go),c=`[at ${function(e){if(!e)return"unknown function";const t=e.split("\n");for(const e of t){if(!e)continue;const t=h(e);if(t&&"logMessage"!==t)return t}return"unknown function"}((new Error).stack)}]`;switch(e){case s.Debug:console.debug(`${o}${c} ${t}`,...a);break;case s.Info:console.info(`${o}${c} ${t}`,...a);break;case s.Warn:console.warn(`${o}${c} ${t}`,...a);break;case s.Error:throw console.error(`${o}${c} ${t}`,...a),new Error(n);case s.Fatal:throw console.error(`${o}${c} ${t}`,...a),alert?.(`${o} ${t}`),new Error(n)}}},2816(e,t,r){"use strict";r.d(t,{A:()=>O,k:()=>E});const s=JSON.parse('{"camera":{"all_cameras":"Alle Kameras","cameras":"Kameras"},"climate":{"all_climates":"Alle Klimaanlagen","climates":"Klimaanlagen"},"cover":{"all_covers":"Alle Abdeckungen","covers":"Abdeckungen"},"fan":{"all_fans":"Alle Ventilatoren","fans":"Ventilatoren"},"generic":{"all":"Alle","areas":"Bereiche","busy":"Beschäftigt","good_afternoon":"Guten Nachmittag","good_evening":"Guten Abend","good_morning":"Guten Morgen","hello":"Hallo","home":"Start","miscellaneous":"Sonstiges","numbers":"Zahlen","off":"Aus","on":"Ein","open":"Offen","ordering_position":"Sortierposition","unavailable":"Nicht verfügbar","unclosed":"Nicht Geschlossen","undisclosed":"Sonstiges","unknown":"Unbekannt"},"input_select":{"input_selects":"Auswahl-Eingaben"},"light":{"all_lights":"Alle Leuchten","lights":"Leuchten"},"lock":{"locked":"Gesperrt","all_locks":"Alle Schlösser","locks":"Schlösser","unlocked":"Entsperrt"},"media_player":{"media_players":"Wiedergabegeräte"},"scene":{"scenes":"Szenen"},"select":{"selects":"Auswahlen"},"sensor":{"binary_sensors":"Binäre Sensoren","sensors":"Sensoren"},"switch":{"all_switches":"Alle Schalter","badge_confirmation":"Warnung: Diese Aktion wird alle Schalter ausschalten. Sind Sie sicher, dass Sie fortfahren möchten?","switches":"Schalter"},"vacuum":{"all_vacuums":"Alle Staubsauger","vacuums":"Staubsauger"},"valve":{"all_valves":"Alle Ventile","valves":"Ventile","open":"Offen","opening":"Öffnet","closed":"Geschlossen","closing":"Schließt","stopped":"Gestoppt","unclosed":"Nicht geschlossen"}}');var i=r.t(s,2);const n=JSON.parse('{"camera":{"all_cameras":"All Cameras","cameras":"Cameras"},"climate":{"all_climates":"All Climates","climates":"Climates"},"cover":{"all_covers":"All Covers","covers":"Covers"},"fan":{"all_fans":"All Fans","fans":"Fans"},"generic":{"all":"All","areas":"Areas","busy":"Busy","good_afternoon":"Good afternoon","good_evening":"Good evening","good_morning":"Good morning","hello":"Hello","home":"Home","miscellaneous":"Miscellaneous","numbers":"Numbers","off":"Off","on":"On","open":"Open","ordering_position":"Ordering position","unavailable":"Unavailable","unclosed":"Unclosed","undisclosed":"Other","unknown":"Unknown"},"input_select":{"input_selects":"Input Selects"},"light":{"all_lights":"All Lights","lights":"Lights"},"lock":{"all_locks":"All Locks","locked":"Locked","locks":"Locks","unlocked":"Unlocked"},"media_player":{"media_players":"Media Players"},"scene":{"scenes":"Scenes"},"select":{"selects":"Selects"},"sensor":{"binary_sensors":"Binary Sensors","sensors":"Sensors"},"switch":{"all_switches":"All Switches","badge_confirmation":"Warning: This action will turn off all switches. Are you sure you want to continue?","switches":"Switches"},"vacuum":{"all_vacuums":"All Vacuums","vacuums":"Vacuums"},"valve":{"all_valves":"All Valves","valves":"Valves","open":"Open","opening":"Opening","closed":"Closed","closing":"Closing","stopped":"Stopped","unclosed":"Unclosed"}}');var o=r.t(n,2);const a=JSON.parse('{"camera":{"all_cameras":"Todas las Cámaras","cameras":"Cámaras"},"climate":{"all_climates":"Todos los Termostatos","climates":"Termostatos"},"cover":{"all_covers":"Todas las Cubiertas","covers":"Cubiertas"},"fan":{"all_fans":"Todos los Ventiladores","fans":"Ventiladores"},"generic":{"all":"Todo","areas":"Áreas","busy":"Ocupado","good_afternoon":"Buenas tardes","good_evening":"Buenas noches","good_morning":"Buenos días","hello":"Hola","home":"Inicio","miscellaneous":"Varios","numbers":"Números","off":"Apagado","on":"Encendido","open":"Abierto","ordering_position":"Posición de orden","unavailable":"No Disponible","unclosed":"Sin Cerrar","undisclosed":"Varios","unknown":"Desconocido"},"input_select":{"input_selects":"Selecciones de Entrada"},"light":{"all_lights":"Todas las Luces","lights":"Luces"},"lock":{"all_locks":"Todas las Candados","locked":"Locked","locks":"Candados","unlocked":"Desbloqueado"},"media_player":{"media_players":"Reproductores Multimedia"},"scene":{"scenes":"Scenas"},"select":{"selects":"Seleccionar"},"sensor":{"binary_sensors":"Binario Sensores","sensors":"Sensores"},"switch":{"all_switches":"Todos los Apagadores","badge_confirmation":"Advertencia: Esta acción apagará todos los interruptores. ¿Está seguro de que desea continuar?","switches":"Apagadores"},"vacuum":{"all_vacuums":"Todas las Aspiradoras","vacuums":"Aspiradoras"},"valve":{"all_valves":"Todas las válvulas","valves":"Válvulas","open":"Abierta","opening":"Abriendo","closed":"Cerrada","closing":"Cerrando","stopped":"Detenida","unclosed":"No Cerrada"}}');var c=r.t(a,2);const l=JSON.parse('{"camera":{"all_cameras":"Összes kamera","cameras":"Kamerák"},"climate":{"all_climates":"Összes klíma","climates":"Klímák"},"cover":{"all_covers":"Összes redőny","covers":"Redőnyök"},"fan":{"all_fans":"Összes ventilátor","fans":"Ventilátorok"},"generic":{"all":"Összes","areas":"Területek","busy":"Foglalt","good_afternoon":"Jó napot","good_evening":"Jó estét","good_morning":"Jó reggelt","hello":"Hello","home":"Otthon","miscellaneous":"Egyéb","numbers":"Számok","off":"Ki","on":"Be","open":"Nyitva","ordering_position":"Rendezési pozíció","unavailable":"Nem áll rendelkezésre","unclosed":"Nincs bezárva","undisclosed":"Egyéb","unknown":"Ismeretlen"},"input_select":{"input_selects":"Bemenetválasztók"},"light":{"all_lights":"Összes világítás","lights":"Lámpák"},"lock":{"all_locks":"Összes zár","locked":"Zárva","locks":"Zárak","unlocked":"Nyitott"},"media_player":{"media_players":"Médialejátszók"},"scene":{"scenes":"Jelenetek"},"select":{"selects":"Kiválasztások"},"sensor":{"binary_sensors":"Kétállapotú Szenzorok","sensors":"Szenzorok"},"switch":{"all_switches":"Összes kapcsoló","chip_confirmation":"Figyelem: Ez a művelet az összes kapcsolót lekapcsolja. Biztosan folytatja?","switches":"Kapcsolók"},"vacuum":{"all_vacuums":"Összes porszívó","vacuums":"Porszívók"},"valve":{"all_valves":"Összes szelep","valves":"Szelepek","open":"Nyitva","opening":"Nyitás","closed":"Zárva","closing":"Zárás","stopped":"Megállt","unclosed":"Nincs zárva"}}');var u=r.t(l,2);const d=JSON.parse('{"camera":{"all_cameras":"Toutes les caméras","cameras":"Caméras"},"climate":{"all_climates":"Tous les thermostats","climates":"Thermostats"},"cover":{"all_covers":"Tous les volets","covers":"Volets"},"fan":{"all_fans":"Tous les ventilateurs","fans":"Ventilateurs"},"generic":{"all":"Tout","areas":"Pièces","busy":"Occupé(e)","good_afternoon":"Bon après-midi","good_evening":"Bonsoir","good_morning":"Bonjour","hello":"Bonjour","home":"Accueil","miscellaneous":"Divers","numbers":"Nombres","off":"Éteint(e)","on":"Allumé(e)","open":"Ouvert(e)","ordering_position":"Position de tri","unavailable":"Indisponible","unclosed":"Non fermé(e)","undisclosed":"Non divulgué","unknown":"Inconnu"},"input_select":{"input_selects":"Sélecteurs d’options"},"light":{"all_lights":"Toutes les lumières","lights":"Lumières"},"lock":{"all_locks":"Tous les verrous","locked":"Verrouillé","locks":"Verrous","unlocked":"Déverrouillé"},"media_player":{"media_players":"Lecteurs multimédias"},"scene":{"scenes":"Scènes"},"select":{"selects":"Sélecteurs"},"sensor":{"binary_sensors":"Capteurs Binaires","sensors":"Capteurs"},"switch":{"all_switches":"Tous les interrupteurs","badge_confirmation":"Attention : cette action éteindra tous les interrupteurs. Êtes-vous sûr de vouloir continuer ?","switches":"Interrupteurs"},"vacuum":{"all_vacuums":"Tous les aspirateurs","vacuums":"Aspirateurs"},"valve":{"all_valves":"Toutes les vannes","valves":"Vannes","open":"Ouverte","opening":"Ouverture","closed":"Fermée","closing":"Fermeture","stopped":"Arrêtée","unclosed":"Non fermée"}}');var h=r.t(d,2);const f=JSON.parse('{"camera":{"all_cameras":"Alle Cameras","cameras":"Cameras"},"climate":{"all_climates":"Alle Klimaatregelingen","climates":"Klimaatregelingen"},"cover":{"all_covers":"Alle Bedekkingen","covers":"Bedekkingen"},"fan":{"all_fans":"Alle Ventilatoren","fans":"Ventilatoren"},"generic":{"all":"Alle","areas":"Ruimtes","busy":"Bezig","good_afternoon":"Goedemiddag","good_evening":"Goedeavond","good_morning":"Goedemorgen","hello":"Hallo","home":"Start","miscellaneous":"Overige","numbers":"Nummers","off":"Uit","on":"Aan","open":"Open","ordering_position":"Sorteer Positie","unavailable":"Onbeschikbaar","unclosed":"Niet Gesloten","undisclosed":"Overige","unknown":"Onbekend"},"input_select":{"input_selects":"Lijsten"},"light":{"all_lights":"Alle Lampen","lights":"Lampen"},"lock":{"all_locks":"Alle Sloten","locked":"Vergrendeld","locks":"Sloten","unlocked":"Ontgrendeld"},"media_player":{"media_players":"Mediaspelers"},"scene":{"scenes":"Scenes"},"select":{"selects":"Statuslijsten"},"sensor":{"binary_sensors":"Binaire Sensoren","sensors":"Sensoren"},"switch":{"all_switches":"Alle Schakelaars","badge_confirmation":"Waarschuwing: Deze actie zal alle schakelaars uitzetten. Weet u zeker dat u door wilt gaan?","switches":"Schakelaars"},"vacuum":{"all_vacuums":"Alle Afzuiging","vacuums":"Afzuiging"},"valve":{"all_valves":"Alle kleppen","valves":"Kleppen","open":"Open","opening":"Openen","closed":"Gesloten","closing":"Sluiten","stopped":"Gestopt","unclosed":"Niet gesloten"}}');var p=r.t(f,2);const g=JSON.parse('{"camera":{"all_cameras":"Todas as câmeras","cameras":"Câmeras"},"climate":{"all_climates":"Todos os climatizadores","climates":"Climatizadores"},"cover":{"all_covers":"Todas as persianas","covers":"Persianas"},"fan":{"all_fans":"Todos os ventiladores","fans":"Ventiladores"},"generic":{"all":"Todos","areas":"Áreas","busy":"Ocupado","good_afternoon":"Boa tarde","good_evening":"Boa noite","good_morning":"Bom dia","hello":"Olá","home":"Início","miscellaneous":"Variados","numbers":"Números","off":"Desligado","on":"Ligado","open":"Aberto","ordering_position":"Posição de ordenação","unavailable":"Indisponível","unclosed":"Não fechado","undisclosed":"Outro","unknown":"Desconhecido"},"input_select":{"input_selects":"Seleção de entrada"},"light":{"all_lights":"Todas as luzes","lights":"Luzes"},"lock":{"all_locks":"Todas as fechaduras","locked":"Travado","locks":"Fechaduras","unlocked":"Destravado"},"media_player":{"media_players":"Reprodutores de mídia"},"scene":{"scenes":"Cenas"},"select":{"selects":"Seleção"},"sensor":{"binary_sensors":"Binário Sensores","sensors":"Sensores"},"switch":{"all_switches":"Todos os interruptores","badge_confirmation":"Atenção: Essa ação irá desligar todos os interruptores. Tem certeza que deseja continuar?","switches":"Interruptores"},"vacuum":{"all_vacuums":"Todos os aspiradores","vacuums":"Aspiradores"},"valve":{"all_valves":"Todas as válvulas","valves":"Válvulas","open":"Aberto","opening":"Abrindo","closed":"Fechado","closing":"Fechando","stopped":"Parado","unclosed":"Nao fechado"}}');var m=r.t(g,2),v=r(6964);const _={de:i,en:o,es:c,fr:h,hu:u,nl:p,"pt-BR":m};function y(e,t){try{return e.split(".").reduce((e,t)=>e[t],_[t])}catch{return}}let w;function O(e){const t=e?.locale.language??"en";w=e=>y(e,t)??y(e,"en")??e}function E(e){return w?w(e):((0,v.OG)(v.br,"localize is not initialized! Call setupCustomLocalize first."),e)}},1122(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>u});var s=r(4137),i=r(1241),n=r(3007),o=r(6964),a=r(2682),c=r(2737),l=r(2816);const u=class{constructor(){this.baseConfiguration={icon:"mdi:view-dashboard",subview:!1},this.viewHeaderCardConfiguration={cards:[],type:""},i.O.initialized||(0,o.OG)(o.ZY,"Registry is not initialized!")}get domain(){return this.constructor.domain}async getView(){const e=await this.createSections();return!!e.length&&("home"===this.domain?{...this.baseConfiguration,sections:e}:{...this.baseConfiguration,cards:e})}async createSections(){const e=[],t=(0,n.ps)(this.domain+"Card"),o=(await r(2560)(`./${t}`)).default,u=new a.A(i.O.entities).whereDomain(this.domain).where(e=>!e.entity_id.endsWith("_stateful_scene")).toList();for(const t of i.O.areas){const r=new a.A(u).whereAreaId(t.area_id).toList();let n=[],d={area_id:[t.area_id]};if("undisclosed"===t.area_id&&(d={entity_id:r.map(e=>e.entity_id)}),n.push(...r.map(e=>new o(e,i.O.strategyOptions.card_options?.[e.entity_id]).getCard())),n.length){n=(0,c.P)(n,i.O.strategyOptions.domains[this.domain].stack_count??i.O.strategyOptions.domains._.stack_count);const r="headerCardConfiguration"in this.baseConfiguration?this.baseConfiguration.headerCardConfiguration:{};n.unshift(new s.default(d,{title:t.name,...r,subtitle:i.O.strategyOptions.show_positions?`${(0,l.k)("generic.ordering_position")}: ${t.order}`:void 0}).createCard()),e.push({type:"vertical-stack",cards:n})}}return this.viewHeaderCardConfiguration.cards.length&&e.length&&e.unshift(this.viewHeaderCardConfiguration),e}initializeViewConfig(e,t={},r){this.baseConfiguration={...this.baseConfiguration,...e,...t},this.baseConfiguration.headerCardConfiguration={...this.baseConfiguration.headerCardConfiguration,show_controls:i.O.strategyOptions.domains[this.domain].show_controls??i.O.strategyOptions.domains._.show_controls},this.viewHeaderCardConfiguration=new s.default(this.getDomainTargets(),{...this.baseConfiguration.headerCardConfiguration,...r}).createCard()}getDomainTargets(){return{entity_id:i.O.entities.filter(e=>e.entity_id.startsWith(this.domain+".")).map(e=>e.entity_id)}}}},1255(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("camera.cameras"),path:"cameras",icon:"mdi:cctv",subview:!1,headerCardConfiguration:{show_controls:!1}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("camera.all_cameras"),subtitle:`${s.O.getCountTemplate(o.domain,"ne","off")} ${(0,i.k)("camera.cameras")} `+(0,i.k)("generic.busy")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="camera";const a=o},6559(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("climate.climates"),path:"climates",icon:"mdi:thermostat",subview:!1,headerCardConfiguration:{show_controls:!1}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("climate.all_climates"),subtitle:`${s.O.getCountTemplate(o.domain,"ne","off")} ${(0,i.k)("climate.climates")} `+(0,i.k)("generic.busy")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="climate";const a=o},7547(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("cover.covers"),path:"covers",icon:"mdi:window-open",subview:!1,headerCardConfiguration:{iconOn:"mdi:arrow-up",iconOff:"mdi:arrow-down",onService:"cover.open_cover",offService:"cover.close_cover"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("cover.all_covers"),subtitle:`${s.O.getCountTemplate(o.domain,"search","(open|opening|closing)")} ${(0,i.k)("cover.covers")} ${(0,i.k)("generic.unclosed")}`}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="cover";const a=o},245(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("fan.fans"),path:"fans",icon:"mdi:fan",subview:!1,headerCardConfiguration:{iconOn:"mdi:fan",iconOff:"mdi:fan-off",onService:"fan.turn_on",offService:"fan.turn_off"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("fan.all_fans"),subtitle:`${s.O.getCountTemplate(o.domain,"eq","on")} ${(0,i.k)("fan.fans")} `+(0,i.k)("generic.on")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="fan";const a=o},9031(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>p});var s=r(1241),i=r(2700),n=r(3007),o=r(6964),a=r(2816),c=r(1122),l=r(2682),u=r(4137),d=r(2737),h=r(9440);class f extends c.default{constructor(e){super(),this.baseConfiguration={...this.baseConfiguration,...f.getDefaultConfig(),...e}}static getDefaultConfig(){return{type:"sections",max_columns:3,header:{badges_position:"top",layout:"center"},title:(0,a.k)("generic.home"),icon:"mdi:home-assistant",path:"home",subview:!1}}async getView(){return{...this.baseConfiguration,badges:await this.createBadgeSection(),sections:await this.createSections()}}async createSections(){const e="(max-width: 1343px)",t="(min-width: 1344px)",r=[];try{const[i,n]=await Promise.all([this.createPersonCards(),this.createAreaCards()]);[["Persons",[i],e,!!i],["Quick Access Wide",s.O.strategyOptions.quick_access_cards,t,!0],["Persons and Areas",[i,n].filter(Boolean),t,!!(i??n)],["Quick Access Narrow",s.O.strategyOptions.quick_access_cards,e,!0],["Areas",[n],e,!!n],["Extra",s.O.strategyOptions.extra_cards,void 0,!0]].forEach(([e,t,s,i])=>{i&&t.length?((e,t,s)=>{const i={type:"grid",cards:t};s&&(i.visibility=[{condition:"screen",media_query:s}]),r.push(i)})(0,t,s):(0,o.OG)(o.tm,`Section ${e} has no entities available.`)})}catch(e){(0,o.OG)(o.nR,"Error importing section cards!",e)}return r}async createBadgeSection(){if(s.O.strategyOptions.home_view.hidden.badges)return void(0,o.OG)(o.tm,"Badges are hidden.");const e=[],t=s.O.getExposedNames("badge");let a;const c="auto"===s.O.strategyOptions.badges.weather_entity?s.O.entities.find(e=>e.entity_id.startsWith("weather."))?.entity_id:s.O.strategyOptions.badges.weather_entity;if(c)try{a=(await Promise.resolve().then(r.bind(r,7558))).default;const t=new a(c);e.push(t.getConfiguration())}catch(e){(0,o.OG)(o.nR,"Error importing badge weather!",e)}else(0,o.OG)(o.tm,"Weather badge has no entities available.");for(const c of t){if(!(0,i.yI)(c)||!new l.A(s.O.entities).whereDomain(c).count()){(0,o.OG)(o.tm,`Badge for domain ${c} is unsupported or has no entities available.`);continue}const t=(0,n.ps)(c+"Badge");try{a=(await r(7315)(`./${t}`)).default;const s=new a;e.push(s.getConfiguration())}catch(e){(0,o.OG)(o.nR,`Error importing badge ${c}!`,e)}}return s.O.strategyOptions.badges?.extra_badges&&e.push(...s.O.strategyOptions.badges.extra_badges),e}async createPersonCards(){if(s.O.strategyOptions.home_view.hidden.persons)return void(0,o.OG)(o.tm,"Persons section is hidden.");const e=s.O.strategyOptions.home_view.hidden.greeting;e&&(0,o.OG)(o.tm,"Greeting card is hidden.");const t=e?void 0:(new h.default).getCard(),i=[],n=(await Promise.resolve().then(r.bind(r,845))).default;return i.push(...s.O.entities.filter(e=>e.entity_id.startsWith("person.")).map(e=>new n(e).getCard())),{type:"vertical-stack",grid_options:{columns:"full"},cards:(0,d.P)(t?[t,...i]:i,s.O.strategyOptions.home_view.stack_count.persons??s.O.strategyOptions.home_view.stack_count._)}}async createAreaCards(){if(s.O.strategyOptions.home_view.hidden.areas)return void(0,o.OG)(o.tm,"Areas section is hidden.");const e=s.O.strategyOptions.home_view.hidden.areas_title;e&&(0,o.OG)(o.tm,"Greeting titleHidden is hidden.");const t=e?void 0:new u.default({},{title:(0,a.k)("generic.areas")}).createCard(),i=[];for(const e of s.O.areas){const t=s.O.strategyOptions.areas[e.area_id]?.type??s.O.strategyOptions.areas._?.type??"default";let n;try{n=(await r(2560)(`./${t}`)).default}catch(e){n=(await Promise.resolve().then(r.bind(r,4301))).default,s.O.strategyOptions.debug&&"default"!==t&&(0,o.OG)(o.nR,`Error importing ${t}: card!`,e)}i.push(new n(e,{...s.O.strategyOptions.areas._,...s.O.strategyOptions.areas[e.area_id]}).getCard())}return{type:"vertical-stack",grid_options:{columns:"full"},cards:(0,d.P)(t?[t,...i]:i,s.O.strategyOptions.home_view.stack_count._,{"custom:mushroom-template-card":s.O.strategyOptions.home_view.stack_count.areas?.[0],area:s.O.strategyOptions.home_view.stack_count.areas?.[1]})}}}f.domain="home";const p=f},9304(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("light.lights"),path:"lights",icon:"mdi:lightbulb-group",subview:!1,headerCardConfiguration:{iconOn:"mdi:lightbulb",iconOff:"mdi:lightbulb-off",onService:"light.turn_on",offService:"light.turn_off"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("light.all_lights"),subtitle:`${s.O.getCountTemplate(o.domain,"eq","on")} ${(0,i.k)("light.lights")} `+(0,i.k)("generic.on")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="light";const a=o},7935(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("lock.locks"),path:"locks",icon:"mdi:lock-open",subview:!1,headerCardConfiguration:{iconOn:"mdi:lock-open",iconOff:"mdi:lock",onService:"lock.lock",offService:"lock.unlock"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("lock.all_locks"),subtitle:`${s.O.getCountTemplate(o.domain,"ne","locked")} ${(0,i.k)("lock.locks")} `+(0,i.k)("lock.unlocked")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="lock";const a=o},7204(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(2816),i=r(1122);class n extends i.default{static getDefaultConfig(){return{title:(0,s.k)("scene.scenes"),path:"scenes",icon:"mdi:palette",subview:!1,headerCardConfiguration:{show_controls:!1}}}static getViewHeaderCardConfig(){return{}}constructor(e){super(),this.initializeViewConfig(n.getDefaultConfig(),e,n.getViewHeaderCardConfig())}}n.domain="scene";const o=n},2464(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("switch.switches"),path:"switches",icon:"mdi:dip-switch",subview:!1,headerCardConfiguration:{iconOn:"mdi:power-plug",iconOff:"mdi:power-plug-off",onService:"switch.turn_on",offService:"switch.turn_off"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("switch.all_switches"),subtitle:`${s.O.getCountTemplate(o.domain,"eq","on")} ${(0,i.k)("switch.switches")} `+(0,i.k)("generic.on")}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="switch";const a=o},8499(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{static getDefaultConfig(){return{title:(0,i.k)("vacuum.vacuums"),path:"vacuums",icon:"mdi:robot-vacuum",subview:!1,headerCardConfiguration:{iconOn:"mdi:robot-vacuum",iconOff:"mdi:robot-vacuum-off",onService:"vacuum.start",offService:"vacuum.stop"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("vacuum.all_vacuums"),subtitle:s.O.getCountTemplate(o.domain,"in","[cleaning, returning]")+` ${(0,i.k)("vacuum.vacuums")} ${(0,i.k)("generic.busy")}`}}constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}}o.domain="vacuum";const a=o},9798(e,t,r){"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(1241),i=r(2816),n=r(1122);class o extends n.default{constructor(e){super(),this.initializeViewConfig(o.getDefaultConfig(),e,o.getViewHeaderCardConfig())}static getDefaultConfig(){return{title:(0,i.k)("valve.valves"),path:"valves",icon:"mdi:valve",subview:!1,headerCardConfiguration:{iconOn:"mdi:valve-open",iconOff:"mdi:valve-closed",onService:"valve.open_valve",offService:"valve.close_valve"}}}static getViewHeaderCardConfig(){return{title:(0,i.k)("valve.all_valves"),subtitle:s.O.getCountTemplate(o.domain,"in","[closed]")+` ${(0,i.k)("valve.valves")} ${(0,i.k)("valve.unclosed")}`}}}o.domain="valve";const a=o},7315(e,t,r){var s={"./AbstractBadge":[5548,[792]],"./AbstractBadge.ts":[5548,[792]],"./ClimateBadge":[2543,[792]],"./ClimateBadge.ts":[2543,[792]],"./CoverBadge":[2299,[792]],"./CoverBadge.ts":[2299,[792]],"./FanBadge":[6305,[792]],"./FanBadge.ts":[6305,[792]],"./LightBadge":[1806,[792]],"./LightBadge.ts":[1806,[792]],"./SwitchBadge":[4710,[792]],"./SwitchBadge.ts":[4710,[792]],"./WeatherBadge":[7558,[792]],"./WeatherBadge.ts":[7558,[792]]};function i(e){try{if(!r.o(s,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}catch(e){return Promise.reject(e)}var t=s[e],i=t[0];return r.e(t[1][0]).then(()=>r(i))}i.keys=()=>Object.keys(s),i.id=7315,e.exports=i},2560(e,t,r){var s={"./AbstractCard":[4818,[]],"./AbstractCard.ts":[4818,[]],"./AreaCard":[4301,[792]],"./AreaCard.ts":[4301,[792]],"./BinarySensorCard":[1151,[792]],"./BinarySensorCard.ts":[1151,[792]],"./CameraCard":[2723,[792]],"./CameraCard.ts":[2723,[792]],"./ClimateCard":[8721,[792]],"./ClimateCard.ts":[8721,[792]],"./CoverCard":[8033,[792]],"./CoverCard.ts":[8033,[792]],"./FanCard":[2667,[792]],"./FanCard.ts":[2667,[792]],"./GreetingCard":[9440,[792]],"./GreetingCard.ts":[9440,[792]],"./HaAreaCard":[9042,[792]],"./HaAreaCard.ts":[9042,[792]],"./HeaderCard":[4137,[]],"./HeaderCard.ts":[4137,[]],"./InputSelectCard":[1810,[792]],"./InputSelectCard.ts":[1810,[792]],"./LightCard":[8254,[792]],"./LightCard.ts":[8254,[792]],"./LockCard":[6555,[792]],"./LockCard.ts":[6555,[792]],"./MediaPlayerCard":[9879,[792]],"./MediaPlayerCard.ts":[9879,[792]],"./MiscellaneousCard":[4486,[]],"./MiscellaneousCard.ts":[4486,[]],"./NumberCard":[2137,[792]],"./NumberCard.ts":[2137,[792]],"./PersonCard":[845,[792]],"./PersonCard.ts":[845,[792]],"./SceneCard":[2858,[792]],"./SceneCard.ts":[2858,[792]],"./SelectCard":[7212,[792]],"./SelectCard.ts":[7212,[792]],"./SensorCard":[5982,[]],"./SensorCard.ts":[5982,[]],"./SwitchCard":[3708,[792]],"./SwitchCard.ts":[3708,[792]],"./VacuumCard":[7430,[792]],"./VacuumCard.ts":[7430,[792]],"./ValveCard":[8868,[792]],"./ValveCard.ts":[8868,[792]]};function i(e){try{if(!r.o(s,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}catch(e){return Promise.reject(e)}var t=s[e],i=t[0];return Promise.all(t[1].map(r.e)).then(()=>r(i))}i.keys=()=>Object.keys(s),i.id=2560,e.exports=i},9555(e,t,r){var s={"./AbstractView":[1122,[792]],"./AbstractView.ts":[1122,[792]],"./CameraView":[1255,[792]],"./CameraView.ts":[1255,[792]],"./ClimateView":[6559,[792]],"./ClimateView.ts":[6559,[792]],"./CoverView":[7547,[792]],"./CoverView.ts":[7547,[792]],"./FanView":[245,[792]],"./FanView.ts":[245,[792]],"./HomeView":[9031,[792]],"./HomeView.ts":[9031,[792]],"./LightView":[9304,[792]],"./LightView.ts":[9304,[792]],"./LockView":[7935,[792]],"./LockView.ts":[7935,[792]],"./SceneView":[7204,[792]],"./SceneView.ts":[7204,[792]],"./SwitchView":[2464,[792]],"./SwitchView.ts":[2464,[792]],"./VacuumView":[8499,[792]],"./VacuumView.ts":[8499,[792]],"./ValveView":[9798,[792]],"./ValveView.ts":[9798,[792]]};function i(e){try{if(!r.o(s,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}catch(e){return Promise.reject(e)}var t=s[e],i=t[0];return r.e(t[1][0]).then(()=>r(i))}i.keys=()=>Object.keys(s),i.id=9555,e.exports=i}},s={};function i(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return r[e](n,n.exports,i),n.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(r,s){if(1&s&&(r=this(r)),8&s)return r;if("object"==typeof r&&r){if(4&s&&r.__esModule)return r;if(16&s&&"function"==typeof r.then)return r}var n=Object.create(null);i.r(n);var o={};e=e||[null,t({}),t([]),t(t)];for(var a=2&s&&r;("object"==typeof a||"function"==typeof a)&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach(e=>o[e]=()=>r[e]);return o.default=()=>r,i.d(n,o),n},i.d=(e,t)=>{for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.e=()=>Promise.resolve(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{"use strict";var e=i(4137),t=i(5982),r=i(1241),s=i(2700),n=i(3007),o=i(6964),a=i(2682),c=i(2737);class l{constructor(e,t=l.DEFAULT_NAMESPACE){this.hass=e,this.namespace=t}async showNotification(e,t,r={}){if(this.hasBeenShown(e))return;const s=this.compileStorageKey(e,r.storageKey),i=r.hassId||s,n=r.title||l.DEFAULT_TITLE;try{await this.hass.callService("persistent_notification","create",{title:n,message:t,notification_id:i}),this.markAsShown(e,r.version||"1.0.0",i)}catch(r){(0,o.OG)(o.nR,`Failed to show notification '${e}'!`,r),(0,o.OG)(o.tm,`[${n}] ${t}`)}}async dismissNotification(e,t){const r=this.compileStorageKey(e,t);try{const e=localStorage.getItem(r),t=e?JSON.parse(e):null;if(localStorage.removeItem(r),t?.hassId)return void await this.hass.callService("persistent_notification","dismiss",{notification_id:t.hassId});(0,o.OG)(o.WU,`Notification '${r}' cleared from storage!`)}catch(e){(0,o.OG)(o.nR,`Failed to clear notification '${r}'!`,e)}}hasBeenShown(e,t){const r=this.compileStorageKey(e,t);try{const e=localStorage.getItem(r);return!!e&&JSON.parse(e).shown}catch{return!1}}compileStorageKey(e,t){return t||`${this.namespace||l.DEFAULT_NAMESPACE}_${e}`}markAsShown(e,t,r){const s=this.compileStorageKey(e),i={shown:!0,timestamp:(new Date).toISOString(),version:t,hassId:r};try{localStorage.setItem(s,JSON.stringify(i))}catch(e){(0,o.OG)(o.nR,"Failed to save the notification state!",e)}}}l.DEFAULT_NAMESPACE="mushroom_strategy",l.DEFAULT_TITLE="Mushroom Strategy Notification";var u=i(7716),d=i.n(u);const h=[];var f=i(4486),p=i(2816);class g extends HTMLTemplateElement{static async generateDashboard(e){await r.O.initialize(e),await g.handleNotifications(e.hass);const t=r.O.getExposedNames("view").filter(s.uS).map(async e=>{try{const t=(0,n.ps)(`${e}View`),s=new(0,(await i(9555)(`./${t}`)).default)(r.O.strategyOptions.views[e]);return await s.getView()}catch(t){(0,o.OG)(o.nR,`Error importing ${e} view!`,t)}return null});let a=(await Promise.all(t)).filter(Boolean);return a.push(...r.O.strategyOptions.extra_views),a.sort((e,t)=>{const r=e.order??1/0,s=t.order??1/0;return r!==s?r-s:(e.title??"").localeCompare(t.title??"",void 0,{numeric:!0,sensitivity:"base"})}),r.O.strategyOptions.show_positions&&(a=a.map(e=>({...e,title:`${e.title}: ${e.order}`,show_icon_and_title:!0}))),a.push(...r.O.areas.map(e=>({title:e.name,path:e.area_id,subview:!0,hidden:e.hidden??!1,order:e.order??1/0,strategy:{type:"custom:mushroom-strategy",options:{area:e}}}))),{views:a}}static async generateView(l){const u=r.O.getExposedNames("domain"),d=l.view.strategy.options.area,h=new a.A(r.O.entities).whereAreaId(d.area_id).toList(),g=r.O.strategyOptions.areas[d.area_id]?.extra_cards??[],m={area_id:[d.area_id]},v=u.filter(s.dQ).map(async s=>{const l=(0,n.ps)(s+"Card"),u={...r.O.strategyOptions.domains._,...r.O.strategyOptions.domains[s]};r.O.strategyOptions.show_positions&&"_"!==s&&(u.subtitle=`${(0,p.k)("generic.ordering_position")}: ${r.O.strategyOptions.domains[s].order}`);const d=new a.A(h).whereDomain(s).when(u.hide_config_entities,e=>e.not().whereEntityCategory("config")).when(u.hide_diagnostic_entities,e=>e.not().whereEntityCategory("diagnostic")).where(e=>!("switch"===s&&e.entity_id.endsWith("_stateful_scene"))).toList();if(!d.length)return null;const g=new e.default({entity_id:d.map(e=>e.entity_id)},u).createCard();try{const e=(await i(2560)(`./${l}`)).default;if("sensor"===s){let e=d.map(e=>{const s=r.O.hassStates[e.entity_id]?.attributes.unit_of_measurement,i={...e.device_id&&r.O.strategyOptions.card_options?.[e.device_id],...r.O.strategyOptions.card_options?.[e.entity_id],entities:[e.entity_id]};return s?new t.default(e,i).getCard():new f.default(e,i).getCard()});return e.length?(e=(0,c.P)(e,r.O.strategyOptions.domains[s].stack_count??r.O.strategyOptions.domains._.stack_count),{type:"vertical-stack",cards:[g,...e]}):null}let n=d.map(t=>{const s={...t.device_id&&r.O.strategyOptions.card_options?.[t.device_id],...r.O.strategyOptions.card_options?.[t.entity_id]};return new e(t,s).getCard()});return n=(0,c.P)(n,r.O.strategyOptions.domains[s].stack_count??r.O.strategyOptions.domains._.stack_count),n.length?{type:"vertical-stack",cards:[g,...n]}:null}catch(e){return(0,o.OG)(o.nR,`Error creating card configurations for domain ${s}`,e),null}}),_=(await Promise.all(v)).filter(Boolean);if(g.push(..._),!r.O.strategyOptions.domains.default.hidden){const t=new a.A(h).not().where(e=>(0,s.dQ)(e.entity_id.split(".",1)[0])).toList();if(t.length)try{const s=(await Promise.resolve().then(i.bind(i,4486))).default;let n=t.map(e=>new s(e,r.O.strategyOptions.card_options?.[e.entity_id]).getCard());const o=new e.default(m,{...r.O.strategyOptions.domains._,...r.O.strategyOptions.domains.default}).createCard();n.length&&(n=(0,c.P)(n,r.O.strategyOptions.domains.default.stack_count??r.O.strategyOptions.domains._.stack_count),g.push({type:"vertical-stack",cards:[o,...n]}))}catch(e){(0,o.OG)(o.nR,"Error creating card configurations for domain `miscellaneous`",e)}}return{cards:g}}static async handleNotifications(e){if(0===h.length)return;const t=new l(e,"mushroom_strategy"),r=m.replace(/^v/,""),s=d().coerce(r)||"0.0.0";try{await Promise.all(h.map(async e=>d().gte(s,e.fromVersion)&&d().lte(s,e.toVersion)?t.showNotification(e.storageKey,e.message,{title:e.title,version:r}):t.dismissNotification(e.storageKey)))}catch(e){(0,o.OG)(o.nR,"Error while handling persistent notifications for Mushroom Strategy",e)}}}customElements.define("ll-strategy-mushroom-strategy",g);const m="v3.1.0";console.info("%c Mushroom Strategy %c ".concat(m," "),"color: white; background: coral; font-weight: 700;","color: coral; background: white; font-weight: 700;")})()})(); \ No newline at end of file