/*! maintenance_supporter frontend 2.103.0 */ import{a as mi,b as fi,c as vi,g as ki}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-GXB5TPY7.js";import{a as $}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-274MLN75.js";import{a as Ei,b as Ri,c as Oi,d as _t,e as Ci,f as It}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-FH35SLMS.js";import{A as Ji,B as yt,C as Xi,D as Zi,E as es,F as ts,G as is,N as ss,Q as as,a as le,b as ti,c as je,d as Se,e as nt,f as He,g as ut,h as yi,i as xi,j as gt,k as $i,l as ji,m as O,n as Ze,o as ke,p as ze,q as qe,r as Lt,s as vt,t as bt,u as qi,v as Fi,w as Ki,x as Gi,y as Yi,z as Qi}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-L5NQ4343.js";import{f as Hi,g as Ne,i as Bi,j as ft,k as Ni}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-WNGWMATB.js";import{a as mt}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-KZ3OKTLK.js";import{a as _i,b as dt,c as Ee,d as pt,e as Je,f as ht}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-DR2AFVDA.js";import{a as rt,c as Le}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-EOMYEBQ4.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-4DQPCVDN.js";import{a as Ht,b as ge}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-UVFWQWIH.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-5TWB2KD3.js";import{a as zi,b as Li}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-2URORCTE.js";import{c as Pi}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-XDU67K3J.js";import{a as A,b as Z,c as V}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-VZUMUVFP.js";import{c as Si,d as Ti,e as Re}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-MMIPM7EE.js";import{b as bi,i as wi}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-GMGHSBQJ.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-R77C34J4.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-S4GGDFOL.js";import{a as At}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-IRRUA3DS.js";import{c as Mi,d as zt,e as Di}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-DPJSGXJS.js";import{l as Xe}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-2BQZ33DM.js";import{a as Ui,b as Vi,c as Wi}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-QVOLUT24.js";import{a as P,b as Ai,c as Ii,d as Pt}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-3LDXEWBF.js";import{$ as Ie,B as fe,C as Dt,E as Te,F as ci,G as lt,H as Be,I as K,J as Ke,L as G,M as U,N as Ge,P as q,Q as di,S as xe,T as pi,U as hi,V as Ye,Y as ui,Z as gi,a as _,aa as Qe,b as B,c as n,d as Y,da as ct,f as h,h as N,i as Mt,j as ii,k as si,l as ai,m as R,n as f,o as ot,p as ri,q as Me,t as s,u as ni,v as re,x as oi,y as li,z as ye}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-OWNF6K2Z.js";var Hs=["assignee_pool","required_completion_fields","checklist","labels","mirror_todo_entities","next_event_titles","history","readings"],Bs=["checklist_progress"],Ns=["tasks","parts"],qs=["manual_docs","battery_fleet_excluded"];function Bt(l,c,e=[]){for(let t of c)l[t]===void 0&&(l[t]=[]);for(let t of e)l[t]===void 0&&(l[t]={})}function Fs(l){let c=l;Bt(c,Ns),c.object&&typeof c.object=="object"&&Bt(c.object,qs);for(let e of c.tasks)Bt(e,Hs,Bs);return l}function et(l){for(let c of l)Fs(c);return l}function Us(l,c){if(c.objects)return c.objects;let e=c.delta||[],t=c.removed||[];if(!e.length&&!t.length)return null;let i=new Map(l.map(a=>[a.entry_id,a]));for(let a of e)i.set(a.entry_id,a);for(let a of t)i.delete(a);return[...i.values()]}function rs(l,c){return c.objects&&et(c.objects),c.delta&&et(c.delta),Us(l,c)}var Nt=["today","dashboard","calendar","settings"];var Vs=168*3600*1e3;function ns(){try{let l=Z(A.objectsCache);if(!l)return null;let c=JSON.parse(l);return c.v!==Mt||!Number.isFinite(c.at)||Date.now()-c.at>Vs||!Array.isArray(c.objects)||c.objects.length===0?null:{objects:c.objects,stats:c.stats??null}}catch{return null}}function qt(l,c){if(!(!Array.isArray(l)||l.length===0))try{let e={v:Mt,at:Date.now(),objects:l,stats:c};V(A.objectsCache,JSON.stringify(e))}catch{}}function tt(l){return l.responsible_user_id?[l.responsible_user_id]:[...new Set((l.assignee_pool||[]).filter(c=>typeof c=="string"&&c))]}function it(l,c){return!!c&&tt(l).includes(c)}var Ws={days:1,weeks:7,months:30.4368,years:365.25};function Ft(l,c){return!l||l<=0?0:l*(Ws[c||"days"]??1)}function xt(l,c,e){let t=Ft(l,e);if(t<=0||c==null)return{pct:0,overflow:!1};let i=(t-c)/t*100;return{pct:Math.max(0,Math.min(100,i)),overflow:i>100}}function os(l,c,e,t,i,a){let r=[[e.manufacturer,l.manufacturer],[e.model,l.model],[e.serial,l.serial_number],[e.installed,l.installation_date?t(l.installation_date):null],[e.warranty,l.warranty_expiry?t(l.warranty_expiry):null]].filter(([,u])=>!!u),d=c.map(u=>{let p=e.scheduleLabel(u);return` ${$(u.name)} ${$(e.typeLabel(u.type))} ${$(e.statusLabel(u.status))} ${$(p)} ${$(u.last_performed?t(u.last_performed):e.none)} ${$(u.next_due?t(u.next_due):e.none)} ${u.times_performed??0} ${$(i(u.total_cost??0))} `}).join(""),o=c.reduce((u,p)=>u+(p.total_cost??0),0);return` ${$(e.title)} \u2014 ${$(l.name)}

${$(l.name)}

${$(e.title)} \xB7 ${$(e.generated)}: ${$(t(a))}

${r.length?`
${r.map(([u,p])=>`
${$(u)}
${$(p)}
`).join("")}
`:""}

${$(e.tasksHeading)} (${c.length})

${d||``}
${$(e.colTask)}${$(e.colType)}${$(e.colStatus)} ${$(e.colSchedule)}${$(e.colLastDone)}${$(e.colNextDue)} ${$(e.colTimes)}${$(e.colCost)}
${$(e.none)}
${$(e.totalCost)}${$(i(o))}
${l.notes?`
${$(e.notes)}: ${$(l.notes)}
`:""} `}var Ks=60;function Ut(l,c=ye()){if(!l)return{kind:"none",days:null,date:null};let e=ci(c,l);return Number.isFinite(e)?e<0?{kind:"expired",days:e,date:l}:e<=Ks?{kind:"expiring",days:e,date:l}:{kind:"valid",days:e,date:l}:{kind:"none",days:null,date:null}}function Gs(l,c){let e=Date.parse(l);return Number.isNaN(e)?l.slice(0,10):c(li(e,oi()))}var L=l=>String(l??"").replace(/[&<>"']/g,c=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[c]);function ls(l,c,e,t,i,a,r,d,o,u=[],p=null){let m=[[e.object,L(c)],[e.type,L(e.typeLabel(l.type))],[e.interval,L(i(l))],[e.nextDue,l.next_due?L(t(l.next_due)):"\u2014"],[e.lastDone,l.last_performed?L(t(l.last_performed)):L(e.never)]];l.priority&&l.priority!=="normal"&&m.push([e.priority,L(l.priority)]);let g=(l.checklist||[]).map(y=>`
  • ${L(y)}
  • `).join(""),v=(y,T)=>y?`
    ${L(T)}
    `:"";return` ${L(l.name)} \u2014 ${L(e.title)}

    ${L(l.name)}${p?` #${L(p)}`:""}

    ${L(c)}
    ${v(a,e.scanView)} ${v(r,e.scanComplete)}
    ${m.map(([y,T])=>``).join("")}
    ${L(y)}${T}
    ${g?`

    ${L(e.checklist)}

    `:""} ${u.length?`

    ${L(e.parts)}

    `:""} ${l.notes?`

    ${L(e.notes)}

    ${L(l.notes)}
    `:""} ${d?`

    ${L(e.manualExcerpt)}

    ${L(d.title)} \u2014 ${L(e.pages)} ${d.startPage}\u2013${d.endPage}: PDF
    ${d.vendorBase?`