/*! maintenance_supporter frontend 2.103.0 */ var v="2.103.0";var y="maintenance-supporter",L=`ll-strategy-dashboard-${y}`,C="hui-maintenance-supporter-strategy-editor",M=["maintenance-supporter-section","maintenance-supporter-vacation","maintenance-supporter-budget","maintenance-supporter-groups"],D=`/maintenance_supporter_strategy/maintenance-dashboard-strategy.js?v=${v}`,w=null;function h(){return w||(w=import(D)),w}async function I(){let t=await h();if(!t.MaintenanceDashboardStrategy)throw new Error("[maintenance-supporter] strategy bundle loaded but did not export MaintenanceDashboardStrategy");return t.MaintenanceDashboardStrategy}async function P(t){let i=(await h()).SECTION_STRATEGIES?.[t];if(!i)throw new Error(`[maintenance-supporter] strategy bundle loaded but has no section strategy "${t}"`);return i}function B(t){return class extends HTMLElement{static async generate(i,d){return(await P(t)).generate(i,d)}}}var f=class extends HTMLElement{static getCreateSuggestions(s){return{title:"Maintenance Supporter",icon:"mdi:wrench-clock"}}static async getConfigElement(){return await h(),document.createElement(C)}static async generate(s,i){return(await I()).generate(s,i)}};function O(){try{customElements.define(L,f)}catch{}for(let t of M)try{customElements.define(`ll-strategy-section-${t}`,B(t))}catch{}}O();var g=window;g.customStrategies=g.customStrategies||[];var U=[{type:y,strategyType:"dashboard",name:"Maintenance Supporter",description:"Auto-generated dashboard. Group views by area, status, floor, or due date \u2014 picked from the strategy editor or YAML.",documentationURL:"https://github.com/iluebbe/maintenance_supporter/blob/master/docs/EXAMPLES.md#dashboard-strategy"},{type:"maintenance-supporter-section",strategyType:"section",name:"Maintenance Supporter \u2014 Section",description:"Embed maintenance tasks (filterable by area, status, due date) as a section in any dashboard view.",documentationURL:"https://github.com/iluebbe/maintenance_supporter/blob/master/docs/EXAMPLES.md#section-strategy"},{type:"maintenance-supporter-vacation",strategyType:"section",name:"Maintenance Supporter \u2014 Vacation Status",description:"Compact vacation-mode status banner. Tap to open settings in the panel."},{type:"maintenance-supporter-budget",strategyType:"section",name:"Maintenance Supporter \u2014 Budget Status",description:"Monthly + yearly maintenance budget overview. Tap for details."},{type:"maintenance-supporter-groups",strategyType:"section",name:"Maintenance Supporter \u2014 Groups",description:"List of configured task groups with member counts."}];for(let t of U)g.customStrategies.some(s=>s.type===t.type&&s.strategyType===t.strategyType)||g.customStrategies.push(t);(()=>{let t=window;if(t.__msStrategyHealActive)return;t.__msStrategyHealActive=!0;let s=/^\/(auth|config|developer-tools|profile|hassio|history|logbook|map|media-browser|energy|todo|calendar)\b/,i=/Timeout waiting for strategy element ll-strategy-(dashboard-)?maintenance-supporter/i,d=`custom:${y}`;function S(r){let e=[document.documentElement],o=0;for(;e.length&&o<9e3;){let a=e.pop();if(o++,!a)continue;let n=a;if(n.nodeType===1&&n.tagName&&n.tagName.toLowerCase()===r)return n;n.shadowRoot&&e.push(n.shadowRoot);let u=a.children;if(u)for(let p of Array.from(u))e.push(p)}return null}function R(r){let e=r?.views;if(!Array.isArray(e)||!e.length)return null;let o=window.location.pathname.split("/").filter(Boolean).pop()||"",a=e.find(u=>u?.path===o);if(a)return a;let n=Number(o);return Number.isInteger(n)&&e[n]?e[n]:e[0]}function k(){try{let e=S("ha-panel-lovelace")?.lovelace;if(!e)return!1;let o=a=>a?.type;for(let a of[e.config,e.rawConfig]){if(!a)continue;if(o(a.strategy)===d)return!0;let n=R(a);if(n&&o(n.strategy)===d)return!0}return!1}catch{return!1}}function T(){let r=!1,e=0,o=!1,a=!1,n=[document.documentElement],u=0;for(;n.length&&u<9e3;){let p=n.pop();if(u++,!p)continue;let l=p;if(l.nodeType===1&&l.tagName){let c=l.tagName.toLowerCase();(c==="hui-view"||c==="hui-sections-view")&&(r=!0),(c==="ha-card"||c==="hui-card")&&e++,c==="hui-empty-state-card"&&(a=!0),c==="hui-error-card"&&i.test(l.textContent||"")&&(o=!0)}l.shadowRoot&&n.push(l.shadowRoot);let _=p.children;if(_)for(let c of Array.from(_))n.push(c)}return o?!0:a?!1:r&&e<3&&k()}let N="/maintenance_supporter_strategy_shim.js",E=0,b=0;function A(){let r=Date.now();r-b<5e3||E>=3||(b=r,E+=1,import(`${N}?heal=${r}`).catch(()=>{}).finally(()=>{let e=window.location.pathname+window.location.search;history.pushState(null,"","/lovelace"),window.dispatchEvent(new CustomEvent("location-changed")),window.setTimeout(()=>{history.pushState(null,"",e),window.dispatchEvent(new CustomEvent("location-changed"))},200)}))}function m(){if(s.test(window.location.pathname))return;let r=0,e=Date.now(),o=window.setInterval(()=>{r++;try{if(Date.now()-e<6e3)return;if(s.test(window.location.pathname)){window.clearInterval(o);return}T()?A():window.clearInterval(o),r>=30&&window.clearInterval(o)}catch{window.clearInterval(o)}},500)}try{document.readyState==="loading"?window.addEventListener("DOMContentLoaded",m):m(),window.addEventListener("location-changed",()=>{s.test(window.location.pathname)||m()})}catch{}})();