Updated apps

This commit is contained in:
francop committed 2026-07-09 13:30:12 -04:00
1 parent 0f7585754d
commit 6cc7212cef
262 files changed
+16124 -107

No files matched your search

@@ -1,4 +1,4 @@
import"./chunks/chunk-LO2NM3CE.js";var A="maintenance-supporter",I=`ll-strategy-dashboard-${A}`,L="hui-maintenance-supporter-strategy-editor",P="NOT_RUNNING",G=[{status:"overdue",title:"Overdue",icon:"mdi:alert-circle",path:"overdue"},{status:"triggered",title:"Triggered",icon:"mdi:flash",path:"triggered"},{status:"due_soon",title:"Due Soon",icon:"mdi:clock-alert-outline",path:"due-soon"},{status:"ok",title:"OK",icon:"mdi:check-circle-outline",path:"ok"}],C=[{title:"Overdue",icon:"mdi:alert-circle",path:"overdue",filter:{filter_due_max_days:-1},matches:i=>i<=-1},{title:"Today",icon:"mdi:calendar-today",path:"today",filter:{filter_due_min_days:0,filter_due_max_days:0},matches:i=>i===0},{title:"This Week",icon:"mdi:calendar-week",path:"this-week",filter:{filter_due_min_days:1,filter_due_max_days:7},matches:i=>i>=1&&i<=7},{title:"This Month",icon:"mdi:calendar-month",path:"this-month",filter:{filter_due_min_days:8,filter_due_max_days:30},matches:i=>i>=8&&i<=30},{title:"Later",icon:"mdi:calendar-clock",path:"later",filter:{filter_due_min_days:31},matches:i=>i>=31}];function u(i){return{type:"grid",cards:[i]}}var H={condition:"view_columns",min:2};function V(i={}){let n=e=>i[e]||`sensor.maintenance_supporter_${e}`;return{type:"markdown",text_only:!0,content:[`\u{1F534} **{{ states('${n("overdue")}') }}** overdue`,`\u26A1 **{{ states('${n("triggered")}') }}** triggered`,`\u{1F7E1} **{{ states('${n("due_soon")}') }}** due soon`,`\u{1F7E2} **{{ states('${n("ok")}') }}** ok`].join(" \xB7 ")}}function N(){return{title:"Maintenance",type:"panel",cards:[{type:"empty-state",icon:"mdi:wrench-clock",icon_color:"primary",content_only:!0,title:"No maintenance objects yet",content:"Open the Maintenance panel to add your first object \u2014 pool pump, HVAC filter, vehicle, anything that needs scheduled care.",buttons:[{icon:"mdi:wrench",text:"Open Maintenance panel",appearance:"filled",variant:"brand",tap_action:{action:"navigate",navigation_path:"/maintenance-supporter"}},{icon:"mdi:plus",text:"Add object",appearance:"outlined",variant:"brand",tap_action:{action:"fire-dom-event",ll_custom:{type:"maintenance-supporter:add-object"}}}]}]}}function B(i={}){let n=V(i);return{title:"Overview",icon:"mdi:wrench-clock",path:"overview",type:"sections",header:{layout:"responsive",card:n},sidebar:{sections:[{type:"grid",cards:[{type:"heading",heading:"Status",heading_style:"title"},n]}],visibility:[H],content_label:"Tasks",sidebar_label:"Status"},sections:[u({type:"custom:maintenance-supporter-card",show_header:!1,filter_status:["overdue","triggered","due_soon"]})]}}function $(i,n){let e=new Map;for(let r of i){let a=r.object.area_id||null;e.has(a)||e.set(a,[]),e.get(a).push(r)}let s=Array.from(e.keys()).filter(r=>r!==null);s.sort((r,a)=>{let c=n[r]?.name||r,d=n[a]?.name||a;return c.localeCompare(d)});let t=[];for(let r of s){let a=e.get(r);if(a.length===0)continue;let c=n[r];t.push({title:c?.name||r,icon:c?.icon||"mdi:floor-plan",path:`area-${r}`,type:"sections",sections:[u({type:"custom:maintenance-supporter-card",show_header:!1,filter_objects:a.map(d=>d.object.name)})]})}let o=e.get(null);return o&&o.length>0&&t.push({title:"Unassigned",icon:"mdi:help-circle-outline",path:"unassigned",type:"sections",sections:[u({type:"custom:maintenance-supporter-card",show_header:!1,filter_objects:o.map(r=>r.object.name)})]}),t}function U(i){let n=new Set;for(let s of i)for(let t of s.tasks||[])t.status&&n.add(t.status);let e=[];for(let s of G)n.has(s.status)&&e.push({title:s.title,icon:s.icon,path:s.path,type:"sections",sections:[u({type:"custom:maintenance-supporter-card",show_header:!1,filter_status:[s.status]})]});return e}function W(i,n,e){let s=new Map;for(let a of i){let c=a.object.area_id,d=c&&n[c]?.floor_id||null;s.has(d)||s.set(d,[]),s.get(d).push(a)}let t=Array.from(s.keys()).filter(a=>a!==null);t.sort((a,c)=>{let d=e[a],g=e[c],l=d?.level??0,p=g?.level??0;return l!==p?l-p:(d?.name||a).localeCompare(g?.name||c)});let o=[];for(let a of t){let c=s.get(a);if(c.length===0)continue;let d=e[a];o.push({title:d?.name||a,icon:d?.icon||"mdi:home-floor-1",path:`floor-${a}`,type:"sections",sections:[u({type:"custom:maintenance-supporter-card",show_header:!1,filter_objects:c.map(g=>g.object.name)})]})}let r=s.get(null);return r&&r.length>0&&o.push({title:"Other",icon:"mdi:help-circle-outline",path:"other",type:"sections",sections:[u({type:"custom:maintenance-supporter-card",show_header:!1,filter_objects:r.map(a=>a.object.name)})]}),o}function Y(i){return[{title:"Week",icon:"mdi:calendar-week",path:"cal-7",window_days:7},{title:"Fortnight",icon:"mdi:calendar-week-begin",path:"cal-14",window_days:14},{title:"Month",icon:"mdi:calendar-month",path:"cal-30",window_days:30},{title:"Year",icon:"mdi:calendar-clock",path:"cal-365",window_days:365}].map(e=>({title:e.title,icon:e.icon,path:e.path,type:"panel",cards:[{type:"custom:maintenance-supporter-calendar-card",window_days:e.window_days,show_window_chips:!1,show_user_filter:!0}]}))}function F(i){let n=new Line truncated
import"./chunks/chunk-LO2NM3CE.js";var L="maintenance-supporter",P=`ll-strategy-dashboard-${L}`,O="hui-maintenance-supporter-strategy-editor",G="NOT_RUNNING",V=[{status:"overdue",title:"Overdue",icon:"mdi:alert-circle",path:"overdue"},{status:"triggered",title:"Triggered",icon:"mdi:flash",path:"triggered"},{status:"due_soon",title:"Due Soon",icon:"mdi:clock-alert-outline",path:"due-soon"},{status:"ok",title:"OK",icon:"mdi:check-circle-outline",path:"ok"}],S=[{title:"Overdue",icon:"mdi:alert-circle",path:"overdue",filter:{filter_due_max_days:-1},matches:n=>n<=-1},{title:"Today",icon:"mdi:calendar-today",path:"today",filter:{filter_due_min_days:0,filter_due_max_days:0},matches:n=>n===0},{title:"This Week",icon:"mdi:calendar-week",path:"this-week",filter:{filter_due_min_days:1,filter_due_max_days:7},matches:n=>n>=1&&n<=7},{title:"This Month",icon:"mdi:calendar-month",path:"this-month",filter:{filter_due_min_days:8,filter_due_max_days:30},matches:n=>n>=8&&n<=30},{title:"Later",icon:"mdi:calendar-clock",path:"later",filter:{filter_due_min_days:31},matches:n=>n>=31}];function u(n){return{type:"grid",cards:[n]}}var H={condition:"view_columns",min:2};function f(n,i,e){let s=i[n];if(s)return`{{ states('${s}') }}`;let t=e[n];return t==null?"\u2014":String(t)}function N(n={},i={}){return{type:"markdown",text_only:!0,content:[`\u{1F534} **${f("overdue",n,i)}** overdue`,`\u26A1 **${f("triggered",n,i)}** triggered`,`\u{1F7E1} **${f("due_soon",n,i)}** due soon`,`\u{1F7E2} **${f("ok",n,i)}** ok`].join(" \xB7 ")}}function B(){return{title:"Maintenance",type:"panel",cards:[{type:"empty-state",icon:"mdi:wrench-clock",icon_color:"primary",content_only:!0,title:"No maintenance objects yet",content:"Open the Maintenance panel to add your first object \u2014 pool pump, HVAC filter, vehicle, anything that needs scheduled care.",buttons:[{icon:"mdi:wrench",text:"Open Maintenance panel",appearance:"filled",variant:"brand",tap_action:{action:"navigate",navigation_path:"/maintenance-supporter"}},{icon:"mdi:plus",text:"Add object",appearance:"outlined",variant:"brand",tap_action:{action:"fire-dom-event",ll_custom:{type:"maintenance-supporter:add-object"}}}]}]}}function $(n={},i={}){let e=N(n,i);return{title:"Overview",icon:"mdi:wrench-clock",path:"overview",type:"sections",header:{layout:"responsive",card:e},sidebar:{sections:[{type:"grid",cards:[{type:"heading",heading:"Status",heading_style:"title"},e]}],visibility:[H],content_label:"Tasks",sidebar_label:"Status"},sections:[u({type:"custom:maintenance-supporter-card",show_header:!1,filter_status:["overdue","triggered","due_soon"]})]}}function U(n,i){let e=new Map;for(let a of n){let r=a.object.area_id||null;e.has(r)||e.set(r,[]),e.get(r).push(a)}let s=Array.from(e.keys()).filter(a=>a!==null);s.sort((a,r)=>{let d=i[a]?.name||a,c=i[r]?.name||r;return d.localeCompare(c)});let t=[];for(let a of s){let r=e.get(a);if(r.length===0)continue;let d=i[a];t.push({title:d?.name||a,icon:d?.icon||"mdi:floor-plan",path:`area-${a}`,type:"sections",sections:[u({type:"custom:maintenance-supporter-card",show_header:!1,filter_objects:r.map(c=>c.object.name)})]})}let o=e.get(null);return o&&o.length>0&&t.push({title:"Unassigned",icon:"mdi:help-circle-outline",path:"unassigned",type:"sections",sections:[u({type:"custom:maintenance-supporter-card",show_header:!1,filter_objects:o.map(a=>a.object.name)})]}),t}function W(n){let i=new Set;for(let s of n)for(let t of s.tasks||[])t.status&&i.add(t.status);let e=[];for(let s of V)i.has(s.status)&&e.push({title:s.title,icon:s.icon,path:s.path,type:"sections",sections:[u({type:"custom:maintenance-supporter-card",show_header:!1,filter_status:[s.status]})]});return e}function Y(n,i,e){let s=new Map;for(let r of n){let d=r.object.area_id,c=d&&i[d]?.floor_id||null;s.has(c)||s.set(c,[]),s.get(c).push(r)}let t=Array.from(s.keys()).filter(r=>r!==null);t.sort((r,d)=>{let c=e[r],g=e[d],l=c?.level??0,p=g?.level??0;return l!==p?l-p:(c?.name||r).localeCompare(g?.name||d)});let o=[];for(let r of t){let d=s.get(r);if(d.length===0)continue;let c=e[r];o.push({title:c?.name||r,icon:c?.icon||"mdi:home-floor-1",path:`floor-${r}`,type:"sections",sections:[u({type:"custom:maintenance-supporter-card",show_header:!1,filter_objects:d.map(g=>g.object.name)})]})}let a=s.get(null);return a&&a.length>0&&o.push({title:"Other",icon:"mdi:help-circle-outline",path:"other",type:"sections",sections:[u({type:"custom:maintenance-supporter-card",show_header:!1,filter_objects:a.map(r=>r.object.name)})]}),o}function F(n){return[{title:"Week",icon:"mdi:calendar-week",path:"cal-7",window_days:7},{title:"Fortnight",icon:"mdi:calendar-week-begin",path:"cal-14",window_days:14},{title:"Month",icon:"mdi:calendar-month",path:"cal-30",window_days:30},{title:"Year",icon:"mdi:calendar-clock",path:"cal-365",window_days:365}].map(e=>({title:e.title,icon:e.icon,path:e.path,type:"panel",cards:[{type:"custom:maintenance-supporter-calendar-card",window_days:e.window_days,show_window_chips:!1,show_user_filter:!0}]}))}funLine truncated
<style>
:host, .editor { display: block; padding: 16px 0; }
label { display: block; font-weight: 500; margin-bottom: 8px; }
@@ -21,4 +21,4 @@ import"./chunks/chunk-LO2NM3CE.js";var A="maintenance-supporter",I=`ll-strategy-
The "Overview" view is always first. Empty groups are skipped.
</div>
</div>
`;let t=this.querySelector("#group-by");t?.addEventListener("change",()=>{let o={...this._config,group_by:t.value};this._config=o,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:o},bubbles:!0,composed:!0}))})}},O="maintenance-supporter-section",z=`ll-strategy-section-${O}`,b=class extends HTMLElement{static async generate(n,e){let s={type:"custom:maintenance-supporter-card",show_header:!1};n?.filter_status?.length&&(s.filter_status=n.filter_status),n?.max_items&&(s.max_items=n.max_items),n?.filter_due_min_days!==void 0&&(s.filter_due_min_days=n.filter_due_min_days),n?.filter_due_max_days!==void 0&&(s.filter_due_max_days=n.filter_due_max_days);let t=n?.filter_objects;if(n?.area_id&&!t)try{t=((await e.connection.sendMessagePromise({type:"maintenance_supporter/objects"})).objects||[]).filter(a=>a.object.area_id===n.area_id).map(a=>a.object.name)}catch{}t&&t.length>0&&(s.filter_objects=t);let o=[];return n?.title&&o.push({type:"heading",heading:n.title,heading_style:"title"}),o.push(s),{type:"grid",cards:o}}},x="2.3.6",K="[maintenance-supporter]";function S(i,n){try{return customElements.get(i)?"skipped":(customElements.define(i,n),"ok")}catch(e){return`ERROR: ${String(e)}`}}var D={editor:S(L,h),section:S(z,b)};console.log(`${K} strategy bundle v${x} loaded \u2014 registrations:`,D,"\u2014 run maintenanceSupporterDiagnose() in console for full state");window.maintenanceSupporterDiagnose=async()=>{let i=I,n=[];try{let e=document.querySelector("home-assistant");e?.hass&&(n=(await e.hass.connection.sendMessagePromise({type:"lovelace/resources"})).resources||[])}catch(e){n=[{url:`<error: ${String(e)}>`}]}return{version:x,el_registered:!!customElements.get(i),el_class_excerpt:customElements.get(i)?.toString().slice(0,100)||null,customStrategies_dashboard:window.customStrategies?.filter(e=>e.strategyType==="dashboard").map(e=>e.type)||[],scriptTagsInPage:Array.from(document.querySelectorAll("script[type=module]")).map(e=>e.src).filter(e=>/maint|strateg/i.test(e)),lovelaceResources_matching:n.filter(e=>/maint|strateg/i.test(e.url||"")).map(e=>e.url),registrations:D}};var w=class extends HTMLElement{static async generate(n,e){return await import("./chunks/vacation-section-card-2434QSQ7.js"),{type:"grid",cards:[{type:"custom:maintenance-vacation-section-card",title:n?.title}]}}},v=class extends HTMLElement{static async generate(n,e){return await import("./chunks/budget-section-card-PVK5ECID.js"),{type:"grid",cards:[{type:"custom:maintenance-budget-section-card",title:n?.title}]}}},k=class extends HTMLElement{static async generate(n,e){return await import("./chunks/groups-section-card-VAKKX3RY.js"),{type:"grid",cards:[{type:"custom:maintenance-groups-section-card",title:n?.title}]}}},T="ll-strategy-section-maintenance-supporter-vacation",M="ll-strategy-section-maintenance-supporter-budget",j="ll-strategy-section-maintenance-supporter-groups";customElements.get(T)||customElements.define(T,w);customElements.get(M)||customElements.define(M,v);customElements.get(j)||customElements.define(j,k);var f=null;function Q(){return f||(f=import("./chunks/dialog-mount-3CFCNZ5R.js").catch(i=>{throw f=null,i})),f}var R="_msSupporterLlCustomBound";function m(i){history.pushState(null,"",i),window.dispatchEvent(new CustomEvent("location-changed"))}function X(){let i=window;i[R]||(i[R]=!0,document.addEventListener("ll-custom",n=>{let e=n.detail;if(!e||typeof e!="object")return;let s=e.ll_custom,t=s&&typeof s=="object"?s:e;if(!t||typeof t.type!="string"||!t.type.startsWith("maintenance-supporter:"))return;let o=t.type.slice(22);if(o==="deep-link"&&typeof t.path=="string"){m(t.path);return}(async()=>{let r;try{r=await Q()}catch{m("/maintenance-supporter");return}if(o==="add-object"){if(r.openCreateObjectDialog())return;m("/maintenance-supporter?ms_action=add_object");return}if(o==="open-task"&&typeof t.entry_id=="string"&&typeof t.task_id=="string"){if(r.openTaskQuickActions(t.entry_id,t.task_id)||r.openEditTaskDialog(t.entry_id,t.task_id))return;m(`/maintenance-supporter?entry_id=${encodeURIComponent(t.entry_id)}&task_id=${encodeURIComponent(t.task_id)}`);return}if(o==="open-object"&&typeof t.entry_id=="string"){if(r.openObjectQuickActions(t.entry_id))return;m(`/maintenance-supporter?entry_id=${encodeURIComponent(t.entry_id)}`);return}if(o==="edit-history"&&typeof t.entry_id=="string"&&typeof t.task_id=="string"&&typeof t.original_timestamp=="string"){let c=document.querySelector("home-assistant")?.hass;if(!c)return;try{let l=(await c.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:t.entry_id})).tasks?.find(p=>p.id===t.task_id)?.history?.find(p=>p.timestamp===t.original_timestamp);if(!l)return;r.openHistoryEditDialog({entry_id:t.entry_id,task_id:t.task_id,original_timestamp:t.original_timestamp,type:l.type||"completed",timestamp:l.timestamp||t.original_timestamp,notes:l.notes??null,cost:l.cost??null,duration:l.duration??null,completed_by:l.completed_by??null})}catch{m("/maintenance-suppor Line truncated
`;let t=this.querySelector("#group-by");t?.addEventListener("change",()=>{let o={...this._config,group_by:t.value};this._config=o,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:o},bubbles:!0,composed:!0}))})}},x="maintenance-supporter-section",z=`ll-strategy-section-${x}`,w=class extends HTMLElement{static async generate(i,e){let s={type:"custom:maintenance-supporter-card",show_header:!1};i?.filter_status?.length&&(s.filter_status=i.filter_status),i?.max_items&&(s.max_items=i.max_items),i?.filter_due_min_days!==void 0&&(s.filter_due_min_days=i.filter_due_min_days),i?.filter_due_max_days!==void 0&&(s.filter_due_max_days=i.filter_due_max_days);let t=i?.filter_objects;if(i?.area_id&&!t)try{t=((await e.connection.sendMessagePromise({type:"maintenance_supporter/objects"})).objects||[]).filter(r=>r.object.area_id===i.area_id).map(r=>r.object.name)}catch{}t&&t.length>0&&(s.filter_objects=t);let o=[];return i?.title&&o.push({type:"heading",heading:i.title,heading_style:"title"}),o.push(s),{type:"grid",cards:o}}},D="2.3.6",Q="[maintenance-supporter]";function T(n,i){try{return customElements.get(n)?"skipped":(customElements.define(n,i),"ok")}catch(e){return`ERROR: ${String(e)}`}}var I={editor:T(O,b),section:T(z,w)};console.log(`${Q} strategy bundle v${D} loaded \u2014 registrations:`,I,"\u2014 run maintenanceSupporterDiagnose() in console for full state");window.maintenanceSupporterDiagnose=async()=>{let n=P,i=[];try{let e=document.querySelector("home-assistant");e?.hass&&(i=(await e.hass.connection.sendMessagePromise({type:"lovelace/resources"})).resources||[])}catch(e){i=[{url:`<error: ${String(e)}>`}]}return{version:D,el_registered:!!customElements.get(n),el_class_excerpt:customElements.get(n)?.toString().slice(0,100)||null,customStrategies_dashboard:window.customStrategies?.filter(e=>e.strategyType==="dashboard").map(e=>e.type)||[],scriptTagsInPage:Array.from(document.querySelectorAll("script[type=module]")).map(e=>e.src).filter(e=>/maint|strateg/i.test(e)),lovelaceResources_matching:i.filter(e=>/maint|strateg/i.test(e.url||"")).map(e=>e.url),registrations:I}};var v=class extends HTMLElement{static async generate(i,e){return await import("./chunks/vacation-section-card-2434QSQ7.js"),{type:"grid",cards:[{type:"custom:maintenance-vacation-section-card",title:i?.title}]}}},k=class extends HTMLElement{static async generate(i,e){return await import("./chunks/budget-section-card-PVK5ECID.js"),{type:"grid",cards:[{type:"custom:maintenance-budget-section-card",title:i?.title}]}}},C=class extends HTMLElement{static async generate(i,e){return await import("./chunks/groups-section-card-VAKKX3RY.js"),{type:"grid",cards:[{type:"custom:maintenance-groups-section-card",title:i?.title}]}}},M="ll-strategy-section-maintenance-supporter-vacation",j="ll-strategy-section-maintenance-supporter-budget",R="ll-strategy-section-maintenance-supporter-groups";customElements.get(M)||customElements.define(M,v);customElements.get(j)||customElements.define(j,k);customElements.get(R)||customElements.define(R,C);var _=null;function X(){return _||(_=import("./chunks/dialog-mount-3CFCNZ5R.js").catch(n=>{throw _=null,n})),_}var A="_msSupporterLlCustomBound";function m(n){history.pushState(null,"",n),window.dispatchEvent(new CustomEvent("location-changed"))}function J(){let n=window;n[A]||(n[A]=!0,document.addEventListener("ll-custom",i=>{let e=i.detail;if(!e||typeof e!="object")return;let s=e.ll_custom,t=s&&typeof s=="object"?s:e;if(!t||typeof t.type!="string"||!t.type.startsWith("maintenance-supporter:"))return;let o=t.type.slice(22);if(o==="deep-link"&&typeof t.path=="string"){m(t.path);return}(async()=>{let a;try{a=await X()}catch{m("/maintenance-supporter");return}if(o==="add-object"){if(a.openCreateObjectDialog())return;m("/maintenance-supporter?ms_action=add_object");return}if(o==="open-task"&&typeof t.entry_id=="string"&&typeof t.task_id=="string"){if(a.openTaskQuickActions(t.entry_id,t.task_id)||a.openEditTaskDialog(t.entry_id,t.task_id))return;m(`/maintenance-supporter?entry_id=${encodeURIComponent(t.entry_id)}&task_id=${encodeURIComponent(t.task_id)}`);return}if(o==="open-object"&&typeof t.entry_id=="string"){if(a.openObjectQuickActions(t.entry_id))return;m(`/maintenance-supporter?entry_id=${encodeURIComponent(t.entry_id)}`);return}if(o==="edit-history"&&typeof t.entry_id=="string"&&typeof t.task_id=="string"&&typeof t.original_timestamp=="string"){let d=document.querySelector("home-assistant")?.hass;if(!d)return;try{let l=(await d.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:t.entry_id})).tasks?.find(p=>p.id===t.task_id)?.history?.find(p=>p.timestamp===t.original_timestamp);if(!l)return;a.openHistoryEditDialog({entry_id:t.entry_id,task_id:t.task_id,original_timestamp:t.original_timestamp,type:l.type||"completed",timestamp:l.timestamp||t.original_timestamp,notes:l.notes??null,cost:l.cost??null,duration:l.duration??null,completed_by:l.completed_by??null})}catch{m("/maintenance-suppor Line truncated