1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/InspectionReportDraft-Bcv9b2UT.js","assets/task-spreadsheet-D5k0iGrQ.js","assets/runtime-UCdpVvNx.js","assets/vendor_exceljs-CaB4LguK.js","assets/vendor_xlsx-DSqvgYLF.js","assets/main-B1e8Vwqe.js","assets/vendor_jspdf-pIh6QOep.js","assets/vendor__syncfusion_ej2_base-jCPBJ8j7.js","assets/main-Cn2nr6Y-.css","assets/Breadcrumb-zu28Z_zw.js","assets/reportNarrativeEditor-zkEcBIgq.js","assets/fullfat_bundler-CIyKZvs_.js","assets/reportNarrativeEditor-D4kApusW.css","assets/Modal-aJIEr64l.js","assets/inspectionReportNdt-CLO9CHqK.js","assets/staged-attachment-uploads-DRinP1Ax.js","assets/blob-download-CfrZE8iZ.js","assets/ReportMemberPicker-DkRuADh3.js","assets/InspectionReportDraft-CWaR0fc7.css"])))=>i.map(i=>d[i]); 2import { j as t, S as s, b as v, B as e, d as w, C as W, M as X, F as ne, J as Me, y as l, t as xe, E as we, n as oe, c as ye, k as Je, D as Xe } from "./task-spreadsheet-D5k0iGrQ.js"; 3import { p as Be, A as ce, b as Se, c as Y, I as Ze, u as et, __tla as __tla_0 } from "./main-B1e8Vwqe.js"; 4import { T as tt } from "./Title-Dh3yyKmZ.js"; 5import { R as nt } from "./ReportMemberPicker-DkRuADh3.js"; 6import { _ as rt, __tla as __tla_1 } from "./vendor_jspdf-pIh6QOep.js"; 7import "./runtime-UCdpVvNx.js"; 8import "./vendor_exceljs-CaB4LguK.js"; 9import "./vendor_xlsx-DSqvgYLF.js"; 10import "./vendor__syncfusion_ej2_base-jCPBJ8j7.js"; 11let Cn; 12let __tla = Promise.all([ 13 (()=>{ 14 try { 15 return __tla_0; 16 } catch {} 17 })(), 18 (()=>{ 19 try { 20 return __tla_1; 21 } catch {} 22 })() 23]).then(async ()=>{ 24 var lt = l('<p class="text-sm text-base-content/65">Report editing is currently unavailable. You can still view saved reports.'), it = l("<p role=alert>"), at = l('<a class="btn btn-outline"target=_blank rel="noopener noreferrer">Open saved PDF'), st = l("<p role=alert>Saved reports could not be loaded. Check your connection and project access."), ot = l("<p role=status>Loading saved reportsâ¦"), ct = l('<section aria-label="Saved inspection reports"class=space-y-4><h2 class="text-xl font-semibold">Saved drafts and issued reports'), dt = l('<div class="overflow-x-auto rounded border border-base-300"><table class="table w-full"><thead><tr><th>Equipment</th><th>Plant / area</th><th>Unit</th><th>Inspection</th><th>Status</th><th>Saved report</th></tr></thead><tbody>'), ut = l('<div class="flex gap-3"><button type=button class="btn btn-outline btn-sm">Newer reports</button><button type=button class="btn btn-outline btn-sm">Older reports'), pt = l("<tr><td colspan=6>No saved inspection reports in this project."), ht = l('<p class="text-xs text-base-content/65">'), bt = l("<tr><td><strong></strong><p></p></td><td></td><td></td><td></td><td></td><td class=space-x-2>"), gt = l('<button type=button class="btn btn-outline btn-sm">'), $t = l("<p>Select a project to view saved inspection reports."); 25 function vt(n) { 26 const o = Se(), [c, S] = v(null), [R, y] = v([]), [b, h] = v(!1), [q, f] = v(""), [V, O] = v(""), C = o.useQuery(Y.inspectionReports.listSaved, ()=>({ 27 projectId: n.projectId, 28 paginationOpts: { 29 numItems: 20, 30 cursor: c() 31 } 32 })), K = o.useAction(Y.inspectionReportPdfActions.getPdfUrl); 33 async function Z(L, j) { 34 h(!0), f(""); 35 try { 36 const E = await K({ 37 candidateId: L, 38 kind: j 39 }); 40 O(E.url); 41 } catch { 42 f("The saved PDF could not be opened. Check your connection and project access, then retry."); 43 } finally{ 44 h(!1); 45 } 46 } 47 return (()=>{ 48 var L = ct(); 49 return L.firstChild, e(L, t(s, { 50 get when () { 51 return n.authoringDisabled; 52 }, 53 get children () { 54 return lt(); 55 } 56 }), null), e(L, t(s, { 57 get when () { 58 return q(); 59 }, 60 get children () { 61 var j = it(); 62 return e(j, q), j; 63 } 64 }), null), e(L, t(s, { 65 get when () { 66 return V(); 67 }, 68 get children () { 69 var j = at(); 70 return w(()=>W(j, "href", V())), j; 71 } 72 }), null), e(L, t(Me, { 73 get children () { 74 return [ 75 t(X, {
76 get when () { 77 return C.error(); 78 }, 79 get children () { 80 return st(); 81 } 82 }), 83 t(X, { 84 get when () { 85 return C.isLoading(); 86 }, 87 get children () { 88 return ot(); 89 } 90 }), 91 t(X, { 92 get when () { 93 return C.data(); 94 }, 95 children: (j)=>[ 96 (()=>{ 97 var E = dt(), M = E.firstChild, T = M.firstChild, k = T.nextSibling; 98 return e(k, t(ne, { 99 get each () { 100 return j().page; 101 }, 102 get fallback () { 103 return pt(); 104 }, 105 children: (m)=>(()=>{ 106 var D = bt(), g = D.firstChild, Q = g.firstChild, ee = Q.nextSibling, re = g.nextSibling, le = re.nextSibling, z = le.nextSibling, ie = z.nextSibling, F = ie.nextSibling; 107 return e(Q, ()=>m.tag), e(ee, ()=>m.description), e(g, t(s, { 108 get when () { 109 return m.sourceIssue; 110 }, 111 get children () { 112 var G = ht(); 113 return e(G, ()=>m.sourceIssue), G; 114 } 115 }), null), e(re, ()=>m.area), e(le, ()=>m.unit), e(z, ()=>m.eventName), e(ie, ()=>m.status === "ISSUED" ? "Issued" : "Draft"), e(F, t(ce, { 116 class: "btn btn-outline btn-sm", 117 get href () { 118 return `/inspection-reports/${m.reportId}`; 119 }, 120 children: "View report" 121 }), null), e(F, t(s, { 122 get when () { 123 return m.pdf; 124 }, 125 children: (G)=>(()=>{ 126 var B = gt(); 127 return B.$$click = ()=>void Z(G().candidateId, G().kind), e(B, ()=>G().kind === "ISSUED" ? "View signed PDF" : "View reviewed PDF"), w(()=>B.disabled = b()), B; 128 })() 129 }), null), D; 130 })() 131 })), E; 132 })(), 133 (()=>{ 134 var E = ut(), M = E.firstChild, T = M.nextSibling; 135 return M.$$click = ()=>{ 136 const k = [ 137 ...R() 138 ]; 139 S(k.pop() ?? null), y(k); 140 }, T.$$click = ()=>{ 141 y([ 142 ...R(), 143 c() 144 ]), S(j().continueCursor); 145 }, w((k)=>{ 146 var m = !R().length || b(), D = j().isDone || b(); 147 return m !== k.e && (M.disabled = k.e = m), D !== k.t && (T.disabled = k.t = D), k; 148 }, { 149 e: void 0, 150 t: void 0 151 }), E; 152 })() 153 ] 154 }) 155 ]; 156 } 157 }), null), L; 158 })(); 159 } 160 function qe(n = {}) { 161 const o = Be((c)=>c.project); 162 return t(s, { 163 get when () { 164 return n.projectId ?? o()?.id; 165 }, 166 keyed: !0, 167 get fallback () { 168 return [ 169 $t(), 170 t(ce, { 171 class: "btn btn-neutral", 172 href: "/projects", 173 children: "Choose project" 174 }) 175 ]; 176 }, 177 children: (c)=>t(vt, { 178 projectId: c, 179 get authoringDisabled () { 180 return n.authoringDisabled; 181 } 182 }) 183 }); 184 } 185 xe([ 186 "click" 187 ]); 188 var ft = l("<p role=status>Opening inspection reportâ¦"), mt = l("<p role=alert>Inspectors could not be loaded. Return to the report list and try again."), _t = l("<p role=status>"), yt = l('<section aria-label="Start inspection report"class="max-w-2xl rounded border border-base-300 p-6 space-y-4"><h2 class="text-xl font-semibold">Choose the lead inspector</h2><p class="text-sm text-base-content/65">The lead inspector coordinates completion. Choose additional inspectors and required signers in Report team.'), xt = l('<button type=button class="btn btn-neutral">Start report'), wt = l("<p>Only the project owner can start a new report."); 189 function St(n) { 190 return t(s, { 191 get when () { 192 return !n.existing; 193 }, 194 get fallback () { 195 return t(Ct, { 196 get open () { 197 return n.open; 198 } 199 }); 200 }, 201 get children () { 202 return t(kt, { 203 get projectId () { 204 return n.projectId; 205 }, 206 get open () { 207 return n.open; 208 } 209 }); 210 } 211 }); 212 } 213 function Ct(n) { 214 let o = !1; 215 return we(()=>{ 216 o || (o = !0, n.open()); 217 }), ft(); 218 } 219 function kt(n) { 220 const o = Se(), c = o.useQuery(Y.inspectionReportLead.getStartChoices, ()=>({ 221 projectId: n.projectId 222 })), [S, R] = v(null), [y, b] = v(!1); 223 let h = !1; 224 we(()=>{ 225 const f = c.data(); 226 c.error() || c.isLoading() || !f?.canStart || !f.defaultLeadAccountKey || h || (h = !0, b(!0), n.open(f.defaultLeadAccountKey).finally(()=>b(!1))); 227 }); 228 async function q() { 229 const f = S(); 230 if (!(y() || !c.data()?.canStart || !f?.accountKey)) { 231 b(!0); 232 try { 233 await n.open(f.accountKey); 234 } finally{ 235 b(!1); 236 } 237 } 238 } 239 return (()=>{ 240 var f = yt(), V = f.firstChild; 241 return V.nextSibling, e(f, t(s, { 242 get when () { 243 return c.error(); 244 }, 245 get children () { 246 return mt(); 247 } 248 }), null), e(f, t(s, { 249 get when () { 250 return c.isLoading() || y(); 251 }, 252 get children () { 253 var O = _t(); 254 return e(O, ()=>y() ? "Opening inspection reportâ¦" : "Loading inspectorsâ¦"), O; 255 } 256 }), null), e(f, t(s, { 257 get when () { 258 return oe(()=>!c.error() && !c.isLoading())() && c.data(); 259 }, 260 children: (O)=>t(s, { 261 get when () { 262 return O().canStart; 263 }, 264 get fallback () { 265 return wt(); 266 }, 267 get children () { 268 return t(s, { 269 get when () { 270 return !O().defaultLeadAccountKey; 271 }, 272 get children () { 273 return [ 274 t(nt, { 275 get projectId () { 276 return n.projectId; 277 }, 278 mode: "lead", 279 label: "Lead inspector", 280 get value () { 281 return S(); 282 }, 283 onChange: R, 284 get disabled () { 285 return y(); 286 } 287 }), 288 (()=>{ 289 var C = xt(); 290 return C.$$click = ()=>void q(), w(()=>C.disabled = y() || !S()?.accountKey), C; 291 })() 292 ]; 293 } 294 }); 295 } 296 }) 297 }), null), f; 298 })(); 299 } 300 xe([ 301 "click" 302 ]); 303 async function It(n, o, c) { 304 await Promise.all([ 305 rt(()=>
305import("./InspectionReportDraft-Bcv9b2UT.js").then(async (m)=>{ 306 await m.__tla; 307 return m; 308 }), __vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18])), 309 ...[ 310 Y.inspectionReports.getDraft, 311 Y.inspectionReportFields.get, 312 Y.inspectionReportReview.getReadiness 313 ].map((S)=>new Promise((R, y)=>{ 314 const b = n.onUpdate(S, { 315 reportId: o 316 }, ()=>R(), y); 317 c(()=>b.unsubscribe()); 318 })) 319 ]); 320 } 321 function be(n) { 322 return !!n.draftId || n.reportCount > 0; 323 } 324 const jt = { 325 all: ()=>!0, 326 reports: be, 327 "not-started": (n)=>!be(n), 328 "source-issues": (n)=>!!n.sourceIssue 329 }; 330 function Oe(n, o) { 331 return n.localeCompare(o, void 0, { 332 numeric: !0, 333 sensitivity: "base" 334 }); 335 } 336 function Rt(n, o) { 337 return +(n > o) - +(n < o); 338 } 339 function Et(n, o, c, S) { 340 const R = S ? -1 : 1; 341 return n.filter(jt[o]).sort((y, b)=>R * (Oe(y[c], b[c]) || Oe(y.tag, b.tag) || Rt(y.key, b.key))); 342 } 343 var Dt = l("<th scope=col><button type=button><span aria-hidden=true>"), Pt = l('<p role=alert class="rounded border border-base-300 p-3 text-sm">'), Lt = l('<button type=button class="link text-xs">Reset filter'), Nt = l('<button type=button class="btn btn-outline btn-sm">Load more equipment <span aria-hidden=true>â'), Ot = l("<p role=status>"), Tt = l('<div class=space-y-4><section class=inspection-directory aria-label="Equipment directory"><div class=inspection-directory-toolbar><div class=inspection-directory-filters role=group aria-label="Filter loaded equipment"></div><p class="text-xs text-base-content/65">Filters and sorting apply to loaded equipment</p></div><div class=inspection-directory-summary aria-live=polite><p><strong></strong> shown <span class=text-base-content/65>/</span> <!> equipment loaded</p></div><div class=inspection-directory-mobile-sort role=group aria-label="Sort loaded equipment"><span>Sort by</span></div><div class=inspection-directory-scroll tabindex=0 role=region aria-label="Equipment list"aria-describedby=inspection-directory-help><table class="table w-full"aria-label="Equipment inspection reports"><thead><tr><th scope=col>Description</th><th scope=col>Report availability</th><th scope=col>Inspection report</th></tr></thead><tbody></tbody></table></div><footer class=inspection-directory-footer><p id=inspection-directory-help class="text-xs text-base-content/65">Search and sort by equipment tag, plant / area or unit.'), _e = l("<button type=button>"), At = l("<span aria-hidden=true> "), Mt = l('<tr><td colspan=6 class=inspection-directory-empty><span class="fa-regular fa-folder-open text-2xl mb-3"aria-hidden=true></span><p></p><p class="mt-2 text-xs text-base-content/65">Try another search or filter, or load more equipment when available.'), Bt = l('<p class=inspection-directory-issue><span class="fa-solid fa-circle-exclamation"aria-hidden=true></span> '), Te = l('<span class="loading loading-spinner loading-xs"aria-hidden=true>'), qt = l('<p class="mt-1 text-xs text-base-content/65">'), Ft = l('<tr><td data-label="Equipment tag"class=inspection-directory-tag></td><td data-label=Description><span></span></td><td data-label="Plant / area"></td><td data-label=Unit><span class=inspection-directory-unit></span></td><td data-label="Report availability"><span class=inspection-directory-status><span aria-hidden=true></span></span></td><td data-label="Inspection report"class=inspection-directory-actions>'), Ut = l('<button type=button class="btn btn-outline btn-sm">'), Vt = l('<button type=button class="btn btn-outline btn-sm">Open report'), Kt = l('<span class="text-sm text-base-content/65">'), Qt = l('<span class="text-xs text-base-content/65">All matching equipment loaded'), Gt = l('<label class="block text-sm"for=inspection-report-event>Inspection event'), Ht = l('<select id=inspection-report-event class="select select-bordered w-full sm:w-96"><option value>Choose an existing event'), Wt = l("<p class=text-sm>Not all inspection events are shown. If yours is missing, contact the project owner."), Yt = l("<p role=alert>Existing inspection events could not be identified. Ask the project owner to review the equipmentâs inspection events."), zt = l('<div class="flex gap-3"><button type=button class="btn btn-neutral">Open inspection report</button><button type=button class="btn btn-outline">Cancel'), Jt = l('<section class="rounded-lg border border-base-300 bg-base-200/30 p-5 space-y-3"aria-label="Cho
343ose inspection event"><h2 class=font-semibold>Which inspection is this report for?</h2><p class="text-sm text-base-content/65">Choose the inspection event for <!> · <!> · <!>.'), Xt = l("<ul class=space-y-2>"), Zt = l("<p class=text-sm>More reports exist for this equipment. Ask a project owner if the report you need is not listed."), en = l('<button type=button class="btn btn-outline">Cancel'), tn = l("<li>"), nn = l("<option>"), rn = l('<div role=alert class="rounded-lg border border-base-300 p-5"><p>Equipment could not be loaded. Check your connection and project access.</p><button type=button class="btn btn-outline btn-sm mt-3">Retry loading equipment'), ln = l("<p>Inspection reports are not enabled."), an = l("<p role=status>Loading equipmentâ¦"), sn = l('<div class=space-y-4><button type=button class="btn btn-ghost">Back to report list'), on = l('<div id=saved-inspection-reports class="rounded-xl border border-base-300 bg-base-100 p-5">'), cn = l('<button type=button class="btn btn-ghost btn-sm">Clear search'), dn = l('<div class=space-y-5><header class=inspection-directory-heading><div class="flex items-center gap-3"><span class="inspection-directory-icon fa-regular fa-file-lines"aria-hidden=true></span><div><h1 class="text-xl font-semibold tracking-tight">Equipment & reports</h1><p class="mt-1 text-sm text-base-content/65"></p></div></div><button type=button class="btn btn-outline btn-sm gap-2"aria-controls=saved-inspection-reports><span class="fa-regular fa-folder-open"aria-hidden=true></span>Saved reports<span aria-hidden=true></span></button></header><div class=inspection-directory-searchbar><div class=inspection-directory-search><label for=inspection-equipment-search class=sr-only>Search equipment</label><span class="fa-solid fa-magnifying-glass"aria-hidden=true></span><input id=inspection-equipment-search type=search placeholder="Search equipment tag, plant / area or unitâ¦"></div><p class="text-sm text-base-content/65">Find equipment to start or continue an inspection report.'), un = l('<main class="inspection-reports-page w-full p-4 sm:p-6 space-y-6">'), pn = l("<p>Select a project to view its inspection reports."); 344 function Ae(n) { 345 if (!(typeof n != "object" || n === null || !("data" in n) || typeof n.data != "object" || n.data === null || !("code" in n.data))) return typeof n.data.code == "string" ? n.data.code : void 0; 346 } 347 function hn(n) { 348 return n === "REPORT_EQUIPMENT_LIMIT" ? "This report could not include all equipment work. Ask the project owner to review the work package." : n === "REPORT_EQUIPMENT_INVALID" ? "The equipment details or work list need correction before starting a report. Ask the project owner to review them." : n === "REPORT_SCOPE_CHANGED" ? "This equipmentâs work is assigned to another inspection. Ask the project owner to review its inspection assignment." : n === "REPORT_UNAVAILABLE" ? "This report is unavailable. Check your project access and try again." : "The report could not be opened. Your inspection work has not been changed. Please try again."; 349 } 350 function bn(n) { 351 const o = Se(), c = et(), [S, R] = v(null), [y, b] = v(0), h = o.useQuery(Y.inspectionReportEquipment.listEquipment, ()=>(y(), { 352 projectId: n.projectId, 353 cursor: S(), 354 limit: 25, 355 ...n.search ? { 356 search: n.search 357 } : {} 358 })), q = o.useMutation(Y.inspectionReportEquipment.startReport), [f, V] = v(new Map), O = new Set, [C, K] = v(), [Z, L] = v(""), [j, E] = v(), [M, T] = v(), [k, m] = v(""), [D, g] = v(); 359 let Q = !0; 360 const ee = new Set; 361 Je(()=>{ 362 Q = !1; 363 for (const i of ee)i(); 364 }); 365 const re = ()=>{ 366 const i = D(); 367 return i && (i.eventId ? i.equipment.reports.some((d)=>d.eventId === i.eventId) : !!(i.equipment.draftId || i.equipment.reportCount > 0)); 368 }; 369 we(()=>{ 370 const i = h.data(); 371 if (!i || h.isLoading() || h.error() || !i.enabled) return; 372 const d = S(); 373 O.add(d), V((p)=>{ 374 const $ = new Map(p); 375 return $.set(d, i.rows), $; 376 }), n.search && i.rows.length === 0 && !i.isDone && i.continueCursor !== null && !O.has(i.continueCursor) && R(i.continueCursor); 377 }); 378 const le = ye(()=>{ 379 const i = new Map; 380 for (const d of f().values())for (const p of d)i.set(p.key, p); 381 return [ 382 ...i.values() 383 ]; 384 }), [z, ie] = v("all"), [F, G] = v("tag"), [B, Fe] = v(!1), Ce = ye(()=>Et(le(), z(), F(), B())), Ue = [ 385 { 386 value: "all", 387 label: "All equipment" 388 }, 389 { 390 value: "reports", 391 label: "With reports" 392 }, 393 { 394 value: "not-started", 395 label: "Not started" 396 }, 397 { 398 value: "source-issues", 399 label: "Needs attention" 400 } 401 ]; 402 function ke(i) { 403 Fe(F() === i ? !B() : !1), G(i); 404 } 405 function ge(i) { 406 return (()=>{ 407 var d = Dt(), p = d.firstChild, $ = p.firstChild; 408 return p.$$click = ()=>ke(i.column), e(p, ()=>i.label, $), e($, (()=>{ 409 var A = oe(()=>F() === i.column); 410 return ()=>A() ? B() ? "â" : "â" : "â"; 411 })()), w(()=>
411W(d, "aria-sort", F() === i.column ? B() ? "descending" : "ascending" : "none")), d; 412 })(); 413 } 414 const J = ()=>!!(C() || h.isLoading() || h.error()); 415 async function Ie(i, d, p) { 416 if (!(J() || !h.data()?.canStart && !i.draftId)) { 417 K(i.key), L(""), E(void 0); 418 try { 419 const $ = d ?? i.eventId, A = !h.data()?.canStart && i.draftId ? { 420 reportId: i.draftId 421 } : await q({ 422 projectId: n.projectId, 423 tag: i.tag, 424 area: i.area, 425 unit: i.unit, 426 ...$ ? { 427 eventId: $ 428 } : {}, 429 ...p ? { 430 leadAccountKey: p 431 } : {} 432 }); 433 if (!Q) return; 434 await It(o.client, A.reportId, ($e)=>ee.add($e)), Q && c(`/inspection-reports/${A.reportId}`); 435 } catch ($) { 436 for (const A of ee)A(); 437 if (ee.clear(), !Q) return; 438 Ae($) === "REPORT_EVENT_AMBIGUOUS" ? (T(i), m("")) : (L(hn(Ae($))), E(i.draftId ?? void 0)); 439 } finally{ 440 Q && (K(void 0), g(void 0)); 441 } 442 } 443 } 444 function Ve() { 445 const i = h.data(); 446 J() || !i || i.isDone || i.continueCursor === null || R(i.continueCursor); 447 } 448 function Ke(i) { 449 const d = i.current; 450 return (()=>{ 451 var p = Tt(), $ = p.firstChild, A = $.firstChild, $e = A.firstChild, ve = A.nextSibling, fe = ve.firstChild, je = fe.firstChild, Qe = je.nextSibling, Ge = Qe.nextSibling, He = Ge.nextSibling, Re = He.nextSibling; 452 Re.nextSibling; 453 var me = ve.nextSibling; 454 me.firstChild; 455 var Ee = me.nextSibling, We = Ee.firstChild, De = We.firstChild, de = De.firstChild, Pe = de.firstChild, Le = Pe.nextSibling, Ye = De.nextSibling, Ne = Ee.nextSibling; 456 return Ne.firstChild, e(p, t(s, { 457 get when () { 458 return Z(); 459 }, 460 get children () { 461 var r = Pt(); 462 return e(r, Z), r; 463 } 464 }), $), e(p, t(s, { 465 get when () { 466 return j(); 467 }, 468 children: (r)=>t(ce, { 469 class: "link text-sm", 470 get href () { 471 return `/inspection-reports/${r()}`; 472 }, 473 children: "View saved report" 474 }) 475 }), $), e($e, t(ne, { 476 each: Ue, 477 children: (r)=>(()=>{ 478 var _ = _e(); 479 return _.$$click = ()=>ie(r.value), e(_, ()=>r.label), w(()=>W(_, "aria-pressed", z() === r.value)), _; 480 })() 481 })), e(je, ()=>Ce().length), e(fe, ()=>le().length, Re), e(fe, t(s, { 482 get when () { 483 return !d().isDone; 484 }, 485 children: " · More available" 486 }), null), e(ve, t(s, { 487 get when () { 488 return z() !== "all"; 489 }, 490 get children () { 491 var r = Lt(); 492 return r.$$click = ()=>ie("all"), r; 493 } 494 }), null), e(me, t(ne, { 495 each: [ 496 { 497 column: "tag", 498 label: "Tag" 499 }, 500 { 501 column: "area", 502 label: "Plant / area" 503 }, 504 { 505 column: "unit", 506 label: "Unit" 507 } 508 ], 509 children: (r)=>(()=>{ 510 var _ = _e(); 511 return _.$$click = ()=>ke(r.column), e(_, ()=>r.label, null), e(_, t(s, { 512 get when () { 513 return F() === r.column; 514 }, 515 get children () { 516 var I = At(); 517 return I.firstChild, e(I, ()=>B() ? "â" : "â", null), I; 518 } 519 }), null), w((I)=>{ 520 var N = `Sort by ${r.label}`, U = F() === r.column; 521 return N !== I.e && W(_, "aria-label", I.e = N), U !== I.t && W(_, "aria-pressed", I.t = U), I; 522 }, { 523 e: void 0, 524 t: void 0 525 }), _; 526 })() 527 }), null), e(de, t(ge, { 528 column: "tag", 529 label: "Equipment tag" 530 }), Pe), e(de, t(ge, { 531 column: "area", 532 label: "Plant / area" 533 }), Le), e(de, t(ge, { 534 column: "unit", 535 label: "Unit" 536 }), Le), e(Ye, t(ne, { 537 get each () { 538 return Ce(); 539 }, 540 get fallback () { 541 return (()=>{ 542 var r = Mt(), _ = r.firstChild, I = _.firstChild, N = I.nextSibling; 543 return e(N, (()=>{ 544 var U = oe(()=>z() !== "all"); 545 return ()=>U() ? "No loaded equipment matches this filter." : oe(()=>!!n.search)() ? d().isDone ? "No equipment matches your search." : "No matches in the equipment loaded so far. Continue loading to search the remaining equipment." : d().isDone ? "No equipment is available for reporting in this project." : "Continue loading to view the remaining equipment."; 546 })()), r; 547 })(); 548 }, 549 children: (r)=>(()=>{ 550 var _ = Ft(), I = _.firstChild, N = I.nextSibling, U = N.firstChild, ae = N.nextSibling, ue = ae.nextSibling, pe = ue.firstChild, he = ue.nextSibling, te = he.firstChild; 551 te.firstChild; 552 var x = he.nextSibling; 553 return e(I, ()=>
553r.tag), e(U, ()=>r.assetDescription || "Not recorded"), e(N, t(s, { 554 get when () { 555 return r.sourceIssue; 556 }, 557 get children () { 558 var a = Bt(), u = a.firstChild; 559 return u.nextSibling, e(a, ()=>r.sourceIssue, null), a; 560 } 561 }), null), e(ae, ()=>r.area), e(pe, ()=>r.unit), e(te, ()=>be(r) ? "Report available" : "Not started", null), e(x, t(s, { 562 get when () { 563 return d().canStart; 564 }, 565 get fallback () { 566 return t(s, { 567 get when () { 568 return r.draftId; 569 }, 570 get fallback () { 571 return t(s, { 572 get when () { 573 return r.reports.length > 0; 574 }, 575 get fallback () { 576 return (()=>{ 577 var a = Kt(); 578 return e(a, ()=>r.reportCount > 0 ? "Report list unavailable" : "No report started"), a; 579 })(); 580 }, 581 get children () { 582 var a = Vt(); 583 return a.$$click = ()=>T(r), a; 584 } 585 }); 586 }, 587 get children () { 588 var a = Ut(); 589 return a.$$click = ()=>void Ie(r), e(a, t(s, { 590 get when () { 591 return C() === r.key; 592 }, 593 fallback: "Open report", 594 get children () { 595 return [ 596 Te(), 597 "Opening reportâ¦" 598 ]; 599 } 600 })), w((u)=>{ 601 var P = J(), H = C() === r.key; 602 return P !== u.e && (a.disabled = u.e = P), H !== u.t && W(a, "aria-busy", u.t = H), u; 603 }, { 604 e: void 0, 605 t: void 0 606 }), a; 607 } 608 }); 609 }, 610 get children () { 611 var a = _e(); 612 return a.$$click = ()=>g({ 613 equipment: r 614 }), e(a, t(s, { 615 get when () { 616 return D()?.equipment.key === r.key || C() === r.key; 617 }, 618 get fallback () { 619 return r.draftId || r.reportCount > 0 ? "Open report" : "Start report"; 620 }, 621 get children () { 622 return [ 623 Te(), 624 "Opening reportâ¦" 625 ]; 626 } 627 })), w((u)=>{ 628 var P = `btn btn-sm ${r.draftId || r.reportCount > 0 ? "btn-outline" : "btn-neutral"}`, H = J() || !!D(), se = D()?.equipment.key === r.key || C() === r.key; 629 return P !== u.e && Xe(a, u.e = P), H !== u.t && (a.disabled = u.t = H), se !== u.a && W(a, "aria-busy", u.a = se), u; 630 }, { 631 e: void 0, 632 t: void 0, 633 a: void 0 634 }), a; 635 } 636 }), null), e(x, t(s, { 637 get when () { 638 return r.eventName; 639 }, 640 get children () { 641 var a = qt(); 642 return e(a, ()=>r.eventName), a; 643 } 644 }), null), w((a)=>{ 645 var u = !r.assetDescription, P = !!be(r); 646 return u !== a.e && U.classList.toggle("text-base-content/65", a.e = u), P !== a.t && te.classList.toggle("inspection-directory-status-available", a.t = P), a; 647 }, { 648 e: void 0, 649 t: void 0 650 }), _; 651 })() 652 })), e(Ne, t(s, { 653 get when () { 654 return !d().isDone; 655 }, 656 get fallback () { 657 return Qt(); 658 }, 659 get children () { 660 var r = Nt(); 661 return r.$$click = Ve, w(()=>r.disabled = J()), r; 662 } 663 }), null), e(p, t(s, { 664 get when () { 665 return h.isLoading(); 666 }, 667 get children () { 668 var r = Ot(); 669 return e(r, ()=>n.search ? "Searching equipmentâ¦" : "Loading more equipmentâ¦"), r; 670 } 671 }), null), e(p, t(s, { 672 get when () { 673 return M(); 674 }, 675 children: (r)=>(()=>{ 676 var _ = Jt(), I = _.firstChild, N = I.nextSibling, U = N.firstChild, ae = U.nextSibling, ue = ae.nextSibling, pe = ue.nextSibling, he = pe.nextSibling, te = he.nextSibling;
677 return te.nextSibling, e(N, ()=>r().tag, ae), e(N, ()=>r().area, pe), e(N, ()=>r().unit, te), e(_, t(s, { 678 get when () { 679 return d().canStart; 680 }, 681 get fallback () { 682 return [ 683 (()=>{ 684 var x = Xt(); 685 return e(x, t(ne, { 686 get each () { 687 return r().reports; 688 }, 689 children: (a)=>(()=>{ 690 var u = tn(); 691 return e(u, t(ce, { 692 class: "link", 693 get href () { 694 return `/inspection-reports/${a.reportId}`; 695 }, 696 get children () { 697 return a.eventName; 698 } 699 })), u; 700 })() 701 })), x; 702 })(), 703 t(s, { 704 get when () { 705 return r().hasMoreReports; 706 }, 707 get children () { 708 return Zt(); 709 } 710 }), 711 (()=>{ 712 var x = en(); 713 return x.$$click = ()=>T(void 0), x; 714 })() 715 ]; 716 }, 717 get children () { 718 return [ 719 Gt(), 720 (()=>{ 721 var x = Ht(); 722 return x.firstChild, x.addEventListener("change", (a)=>m(a.currentTarget.value)), e(x, t(ne, { 723 get each () { 724 return d().eventChoices; 725 }, 726 children: (a)=>(()=>{ 727 var u = nn(); 728 return e(u, ()=>a.name), w(()=>u.value = a.eventId), u; 729 })() 730 }), null), w(()=>x.disabled = J()), w(()=>x.value = k()), x; 731 })(), 732 t(s, { 733 get when () { 734 return d().eventChoicesHasMore; 735 }, 736 get children () { 737 return Wt(); 738 } 739 }), 740 t(s, { 741 get when () { 742 return d().eventChoices.length === 0; 743 }, 744 get children () { 745 return Yt(); 746 } 747 }), 748 (()=>{ 749 var x = zt(), a = x.firstChild, u = a.nextSibling; 750 return a.$$click = ()=>g({ 751 equipment: r(), 752 eventId: k() 753 }), u.$$click = ()=>{ 754 T(void 0), m(""); 755 }, w((P)=>{ 756 var H = J() || !d().eventChoices.some((ze)=>ze.eventId === k()), se = !!C(); 757 return H !== P.e && (a.disabled = P.e = H), se !== P.t && (u.disabled = P.t = se), P; 758 }, { 759 e: void 0, 760 t: void 0 761 }), x; 762 })() 763 ]; 764 } 765 }), null), _; 766 })() 767 }), null), p; 768 })(); 769 } 770 return t(Me, { 771 get children () { 772 return [ 773 t(X, {
774 get when () { 775 return h.error(); 776 }, 777 get children () { 778 var i = rn(), d = i.firstChild, p = d.nextSibling; 779 return p.$$click = ()=>b(($)=>$ + 1), i; 780 } 781 }), 782 t(X, { 783 get when () { 784 return h.data()?.enabled === !1; 785 }, 786 get children () { 787 return ln(); 788 } 789 }), 790 t(X, { 791 get when () { 792 return oe(()=>!!h.isLoading())() && f().size === 0; 793 }, 794 get children () { 795 return an(); 796 } 797 }), 798 t(X, { 799 get when () { 800 return h.data(); 801 }, 802 children: (i)=>[ 803 t(s, { 804 get when () { 805 return !D() || re(); 806 }, 807 get children () { 808 return t(Ke, { 809 current: i 810 }); 811 } 812 }), 813 t(s, { 814 get when () { 815 return D(); 816 }, 817 children: (d)=>(()=>{ 818 var p = sn(), $ = p.firstChild; 819 return e(p, t(St, { 820 get projectId () { 821 return n.projectId; 822 }, 823 get existing () { 824 return !!re(); 825 }, 826 open: (A)=>Ie(d().equipment, d().eventId, A) 827 }), $), $.$$click = ()=>g(void 0), w(()=>$.disabled = !!C()), p; 828 })() 829 }) 830 ] 831 }) 832 ]; 833 } 834 }); 835 } 836 function gn(n) { 837 const [o, c] = v(""), [S, R] = v(!1), y = ye(()=>({ 838 projectId: n.projectId, 839 search: o().trim() 840 })); 841 return (()=>{ 842 var b = dn(), h = b.firstChild, q = h.firstChild, f = q.firstChild, V = f.nextSibling, O = V.firstChild, C = O.nextSibling, K = q.nextSibling, Z = K.firstChild, L = Z.nextSibling, j = L.nextSibling, E = h.nextSibling, M = E.firstChild, T = M.firstChild, k = T.nextSibling, m = k.nextSibling, D = M.nextSibling; 843 return e(C, ()=>n.projectName), K.$$click = ()=>R((g)=>!g), e(j, ()=>S() ? "â" : "+"), e(b, t(s, { 844 get when () { 845 return S(); 846 }, 847 get children () { 848 var g = on(); 849 return e(g, t(qe, { 850 get projectId () { 851 return n.projectId; 852 } 853 })), g; 854 } 855 }
855), E), m.$$input = (g)=>c(g.currentTarget.value), e(E, t(s, { 856 get when () { 857 return o(); 858 }, 859 get children () { 860 var g = cn(); 861 return g.$$click = ()=>c(""), g; 862 } 863 }), D), e(b, t(s, { 864 get when () { 865 return y(); 866 }, 867 keyed: !0, 868 children: (g)=>t(bn, { 869 get projectId () { 870 return g.projectId; 871 }, 872 get search () { 873 return g.search; 874 } 875 }) 876 }), null), w(()=>W(K, "aria-expanded", S())), w(()=>m.value = o()), b; 877 })(); 878 } 879 Cn = function() { 880 const n = Be((o)=>o.project); 881 return (()=>{ 882 var o = un(); 883 return e(o, t(tt, { 884 title: "Inspection reports" 885 }), null), e(o, t(Ze, { 886 get disabledFallback () { 887 return t(qe, { 888 authoringDisabled: !0 889 }); 890 }, 891 get children () { 892 return t(s, { 893 get when () { 894 return n()?.id; 895 }, 896 keyed: !0, 897 get fallback () { 898 return [ 899 pn(), 900 t(ce, { 901 class: "btn btn-neutral", 902 href: "/projects", 903 children: "Choose project" 904 }) 905 ]; 906 }, 907 children: (c)=>t(gn, { 908 projectId: c, 909 get projectName () { 910 return n()?.name; 911 } 912 }) 913 }); 914 } 915 }), null), o; 916 })(); 917 }; 918 xe([ 919 "click", 920 "input" 921 ]); 922}); 923export { Cn as default, __tla };
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.