/*! maintenance_supporter frontend 2.102.0 */ import{a as _i,b as mi,c as fi,g as xi}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-WGPSXTXD.js";import{a as $}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-GH6PGWHU.js";import{a as Ti,b as Ei,c as Ri,d as gt,e as Oi,f as At}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-7W4GNWDJ.js";import{A as Ki,B as bt,C as Gi,D as Yi,E as Qi,F as Ji,G as Xi,N as Zi,Q as es,a as le,b as ti,c as je,d as Se,e as rt,f as He,g as ht,h as bi,i as yi,j as ut,k as wi,l as $i,m as O,n as Ze,o as ke,p as ze,q as qe,r as Pt,s as ft,t as vt,u as Ni,v as qi,w as Fi,x as Ui,y as Vi,z as Wi}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-ZNX3QIU5.js";import{f as Li,g as Ne,i as Hi,j as mt,k as Bi}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-YAGODM2Y.js";import{a as _t}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-DVPW5S27.js";import{a as gi,b as ct,c as Ee,d as dt,e as Je,f as pt}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-XWO2WENS.js";import{a as at,c as Le}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-ZXKKAVZ3.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-E4FFPJAU.js";import{a as Lt,b as ge}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-EALOT5GP.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-I7RCCBTV.js";import{a as Ii,b as Pi}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-QEWK3JB2.js";import{c as zi}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-LW5W5IM2.js";import{a as A,b as Z,c as V}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-Y6A3V724.js";import{c as ji,d as Si,e as Re}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-7SOUIRZ7.js";import{b as vi,i as ki}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-KPORY5EL.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-OGIYAEPJ.js";import"/maintenance_supporter_panelfiles/panel-chunks/chunk-5FRUENVF.js";import{a as Dt}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-U4NJYI3P.js";import{c as Ci,d as It,e as Mi}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-KFG47RQD.js";import{l as Xe}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-UKOBV3FF.js";import{a as P,b as Di,c as Ai,d as zt}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-RIYW54TU.js";import{$ as Qe,A as fe,B as Mt,D as Te,E as li,F as ot,G as Be,H as K,I as Ke,K as G,L as U,M as Ge,O as q,P as ci,R as xe,S as di,T as pi,U as Ye,X as hi,Y as ui,_ as Ie,a as _,b as B,c as n,ca as lt,d as Y,f as h,h as N,i as Ct,j as ii,k as si,l as R,m as f,n as nt,o as ai,p as Me,s,t as ri,u as re,w as ni,x as oi,y as ye}from"/maintenance_supporter_panelfiles/panel-chunks/chunk-4CECVKQ7.js";var Is=["assignee_pool","required_completion_fields","checklist","labels","mirror_todo_entities","next_event_titles","history","readings"],zs=["checklist_progress"],Ps=["tasks","parts"],Ls=["manual_docs","battery_fleet_excluded"];function Ht(l,d,e=[]){for(let t of d)l[t]===void 0&&(l[t]=[]);for(let t of e)l[t]===void 0&&(l[t]={})}function Hs(l){let d=l;Ht(d,Ps),d.object&&typeof d.object=="object"&&Ht(d.object,Ls);for(let e of d.tasks)Ht(e,Is,zs);return l}function et(l){for(let d of l)Hs(d);return l}function Bs(l,d){if(d.objects)return d.objects;let e=d.delta||[],t=d.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 ts(l,d){return d.objects&&et(d.objects),d.delta&&et(d.delta),Bs(l,d)}var Bt=["today","dashboard","calendar","settings"];var Ns=168*3600*1e3;function is(){try{let l=Z(A.objectsCache);if(!l)return null;let d=JSON.parse(l);return d.v!==Ct||!Number.isFinite(d.at)||Date.now()-d.at>Ns||!Array.isArray(d.objects)||d.objects.length===0?null:{objects:d.objects,stats:d.stats??null}}catch{return null}}function Nt(l,d){if(!(!Array.isArray(l)||l.length===0))try{let e={v:Ct,at:Date.now(),objects:l,stats:d};V(A.objectsCache,JSON.stringify(e))}catch{}}function qt(l){return l.responsible_user_id?[l.responsible_user_id]:[...new Set((l.assignee_pool||[]).filter(d=>typeof d=="string"&&d))]}function tt(l,d){return!!d&&qt(l).includes(d)}var qs={days:1,weeks:7,months:30.4368,years:365.25};function Ft(l,d){return!l||l<=0?0:l*(qs[d||"days"]??1)}function yt(l,d,e){let t=Ft(l,e);if(t<=0||d==null)return{pct:0,overflow:!1};let i=(t-d)/t*100;return{pct:Math.max(0,Math.min(100,i)),overflow:i>100}}function ss(l,d,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),c=d.map(u=>{let p=e.scheduleLabel(u);return`
${$(e.title)} \xB7 ${$(e.generated)}: ${$(t(a))}
${r.length?``:""}| ${$(e.colTask)} | ${$(e.colType)} | ${$(e.colStatus)} | ${$(e.colSchedule)} | ${$(e.colLastDone)} | ${$(e.colNextDue)} | ${$(e.colTimes)} | ${$(e.colCost)} |
|---|---|---|---|---|---|---|---|
| ${$(e.none)} | |||||||
| ${$(e.totalCost)} | ${$(i(o))} | ||||||
| ${L(y)} | ${E} |