@burdenoff/microfe-assethandler 2026.714.2 → 2026.719.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/assethandler/AssetHandlerRoutes.d.ts.map +1 -1
  2. package/dist/assethandler/AssetHandlerRoutes.js +9 -17
  3. package/dist/assethandler/AssetHandlerRoutes.js.map +1 -1
  4. package/dist/assethandler/ops/NewWorkOrderDialog.d.ts.map +1 -1
  5. package/dist/assethandler/ops/NewWorkOrderDialog.js +110 -74
  6. package/dist/assethandler/ops/NewWorkOrderDialog.js.map +1 -1
  7. package/dist/assethandler/pages/AssetsAssetCreatePage.d.ts.map +1 -1
  8. package/dist/assethandler/pages/AssetsAssetCreatePage.js +189 -126
  9. package/dist/assethandler/pages/AssetsAssetCreatePage.js.map +1 -1
  10. package/dist/assethandler/pages/AssetsAssetDetailPage.d.ts.map +1 -1
  11. package/dist/assethandler/pages/AssetsAssetDetailPage.js +312 -251
  12. package/dist/assethandler/pages/AssetsAssetDetailPage.js.map +1 -1
  13. package/dist/assethandler/pages/OperationsWorkOrderDetailPage.d.ts.map +1 -1
  14. package/dist/assethandler/pages/OperationsWorkOrderDetailPage.js +286 -222
  15. package/dist/assethandler/pages/OperationsWorkOrderDetailPage.js.map +1 -1
  16. package/dist/stories/ListEmptyState.stories.d.ts +10 -0
  17. package/dist/stories/ListEmptyState.stories.d.ts.map +1 -0
  18. package/dist/stories/SectionHeader.stories.d.ts +10 -0
  19. package/dist/stories/SectionHeader.stories.d.ts.map +1 -0
  20. package/dist/stories/StatTile.stories.d.ts +10 -0
  21. package/dist/stories/StatTile.stories.d.ts.map +1 -0
  22. package/dist/utils/pageContext.d.ts.map +1 -1
  23. package/dist/utils/pageContext.js +26 -18
  24. package/dist/utils/pageContext.js.map +1 -1
  25. package/package.json +16 -3
  26. package/dist/assethandler/pages/EsgDashboardPage.js +0 -423
  27. package/dist/assethandler/pages/EsgDashboardPage.js.map +0 -1
  28. package/dist/assethandler/pages/KnowledgeBasePage.js +0 -521
  29. package/dist/assethandler/pages/KnowledgeBasePage.js.map +0 -1
@@ -9,14 +9,14 @@ import { NotFoundState as ee } from "../components/NotFoundState.js";
9
9
  import { ChartCard as s } from "../components/ChartCard.js";
10
10
  import "../components/index.js";
11
11
  import { useMemo as te, useState as c } from "react";
12
- import { ArrowLeft as ne, CheckCircle as l, Loader2 as u, Package as re, Pencil as ie, User as d, Wrench as f } from "lucide-react";
13
- import { useParams as ae } from "react-router-dom";
14
- import { gql as p } from "@apollo/client";
15
- import { useMutation as m, useQuery as h } from "@apollo/client/react";
16
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
17
- import { Button as v, GradientText as oe, Input as y, Label as b, PagePurpose as x, ResponsiveDialog as S, ResponsiveDialogContent as C, ResponsiveDialogDescription as w, ResponsiveDialogFooter as T, ResponsiveDialogHeader as E, ResponsiveDialogTitle as D, Select as O, SelectContent as k, SelectItem as A, SelectTrigger as j, SelectValue as M, Textarea as N } from "@burdenoff/fe-libs/ui";
12
+ import { ArrowLeft as ne, CheckCircle as l, Loader2 as u, Package as re, Pencil as ie, User as ae, Wrench as oe } from "lucide-react";
13
+ import { useParams as se } from "react-router-dom";
14
+ import { gql as d } from "@apollo/client";
15
+ import { useMutation as f, useQuery as ce } from "@apollo/client/react";
16
+ import { Fragment as le, jsx as p, jsxs as m } from "react/jsx-runtime";
17
+ import { Button as h, GradientText as ue, Input as g, Label as _, PagePurpose as de, ResponsiveDialog as v, ResponsiveDialogContent as y, ResponsiveDialogDescription as b, ResponsiveDialogFooter as x, ResponsiveDialogHeader as S, ResponsiveDialogTitle as C, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O, Textarea as k } from "@burdenoff/fe-libs/ui";
18
18
  //#region src/assethandler/pages/OperationsWorkOrderDetailPage.tsx
19
- var se = p`
19
+ var fe = d`
20
20
  query AssetHandlerWorkOrder($id: ID!) {
21
21
  workOrder(id: $id) {
22
22
  id
@@ -30,9 +30,10 @@ var se = p`
30
30
  createdAt
31
31
  updatedAt
32
32
  completedAt
33
+ checklist
33
34
  }
34
35
  }
35
- `, ce = p`
36
+ `, pe = d`
36
37
  mutation AssetHandlerCompleteWorkOrder($id: ID!, $input: CompleteWorkOrderInput!) {
37
38
  completeWorkOrder(id: $id, input: $input) {
38
39
  id
@@ -40,41 +41,52 @@ var se = p`
40
41
  completedAt
41
42
  }
42
43
  }
43
- `, le = p`
44
+ `, me = d`
44
45
  mutation AssetHandlerUpdateWorkOrder($id: ID!, $input: UpdateWorkOrderInput!) {
45
46
  updateWorkOrder(id: $id, input: $input) {
46
47
  id
47
48
  }
48
49
  }
49
- `, ue = [
50
+ `, he = d`
51
+ mutation AssetHandlerSetWorkOrderChecklistItem(
52
+ $workOrderId: ID!
53
+ $index: Int!
54
+ $completed: Boolean!
55
+ ) {
56
+ setWorkOrderChecklistItem(workOrderId: $workOrderId, index: $index, completed: $completed) {
57
+ id
58
+ checklist
59
+ }
60
+ }
61
+ `, ge = [
50
62
  "CORRECTIVE",
51
63
  "PREVENTIVE",
52
64
  "PREDICTIVE",
53
65
  "EMERGENCY"
54
- ], de = [
66
+ ], _e = [
55
67
  "DRAFT",
56
68
  "SCHEDULED",
57
69
  "APPROVED",
58
70
  "IN_PROGRESS",
59
71
  "COMPLETED",
60
72
  "CANCELLED"
61
- ], fe = [
73
+ ], ve = [
62
74
  "CRITICAL",
63
75
  "HIGH",
64
76
  "MEDIUM",
65
77
  "LOW"
66
- ], P = {
78
+ ], A = {
67
79
  neutral: "bg-bg-sunken text-text-secondary",
68
80
  info: "bg-status-info-subtle text-status-info-text",
69
81
  warning: "bg-status-warning-subtle text-status-warning-text",
70
82
  success: "bg-status-success-subtle text-status-success-text",
71
83
  error: "bg-status-error-subtle text-status-error-text"
72
- }, pe = {
84
+ }, ye = {
73
85
  critical: "error",
74
86
  high: "warning",
75
87
  medium: "info",
76
88
  low: "success"
77
- }, F = {
89
+ }, be = {
78
90
  draft: "neutral",
79
91
  scheduled: "neutral",
80
92
  approved: "info",
@@ -82,328 +94,380 @@ var se = p`
82
94
  completed: "success",
83
95
  cancelled: "error"
84
96
  };
85
- function I({ tone: e, children: t }) {
86
- return /* @__PURE__ */ g("span", {
87
- className: n("inline-flex items-center whitespace-nowrap rounded-full px-2.5 py-0.5 text-xs font-medium capitalize", P[e]),
97
+ function j({ tone: e, children: t }) {
98
+ return /* @__PURE__ */ p("span", {
99
+ className: n("inline-flex items-center whitespace-nowrap rounded-full px-2.5 py-0.5 text-xs font-medium capitalize", A[e]),
88
100
  children: t
89
101
  });
90
102
  }
91
- var L = [
103
+ var M = [
92
104
  "draft",
93
105
  "scheduled",
94
106
  "approved",
95
107
  "in_progress",
96
108
  "completed"
97
109
  ];
98
- function R({ status: e }) {
99
- let t = e === "cancelled", r = L.indexOf(e);
100
- return /* @__PURE__ */ _("div", {
110
+ function xe({ status: e }) {
111
+ let t = e === "cancelled", r = M.indexOf(e);
112
+ return /* @__PURE__ */ m("div", {
101
113
  className: "flex items-center gap-1 overflow-x-auto pb-1",
102
- children: [L.map((e, i) => {
114
+ children: [M.map((e, i) => {
103
115
  let a = !t && r >= 0 && i < r, o = !t && i === r;
104
- return /* @__PURE__ */ _("div", {
116
+ return /* @__PURE__ */ m("div", {
105
117
  className: "flex min-w-0 flex-1 items-center gap-1",
106
- children: [/* @__PURE__ */ _("div", {
118
+ children: [/* @__PURE__ */ m("div", {
107
119
  className: "flex min-w-0 flex-col items-center gap-1.5",
108
- children: [/* @__PURE__ */ g("span", {
120
+ children: [/* @__PURE__ */ p("span", {
109
121
  className: n("flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-[10px] font-bold", a && "bg-status-success-bg text-status-success-text", o && "bg-action-primary-bg text-action-primary-text", !a && !o && "bg-bg-sunken text-text-muted"),
110
- children: a ? /* @__PURE__ */ g(l, { className: "h-3.5 w-3.5" }) : i + 1
111
- }), /* @__PURE__ */ g("span", {
122
+ children: a ? /* @__PURE__ */ p(l, { className: "h-3.5 w-3.5" }) : i + 1
123
+ }), /* @__PURE__ */ p("span", {
112
124
  className: n("whitespace-nowrap text-[11px] capitalize", o ? "font-semibold text-text-primary" : "text-text-secondary"),
113
125
  children: e.replace(/_/g, " ")
114
126
  })]
115
- }), i < L.length - 1 ? /* @__PURE__ */ g("span", { className: n("mb-5 h-0.5 flex-1 rounded-full", a ? "bg-status-success-bg" : "bg-border-seam") }) : null]
127
+ }), i < M.length - 1 ? /* @__PURE__ */ p("span", { className: n("mb-5 h-0.5 flex-1 rounded-full", a ? "bg-status-success-bg" : "bg-border-seam") }) : null]
116
128
  }, e);
117
- }), t ? /* @__PURE__ */ g("span", {
129
+ }), t ? /* @__PURE__ */ p("span", {
118
130
  className: "ml-3 shrink-0 rounded-full bg-status-error-subtle px-2.5 py-0.5 text-xs font-medium text-status-error-text",
119
131
  children: "Cancelled"
120
132
  }) : null]
121
133
  });
122
134
  }
123
- var z = (e) => e.toLowerCase().replace(/_/g, " ").replace(/^\w/, (e) => e.toUpperCase());
124
- function B() {
125
- let n = t(), { workOrderId: p } = ae(), { assets: P } = e(), { data: L, loading: B, refetch: V } = h(se, {
126
- variables: { id: p ?? "" },
127
- skip: !p,
135
+ var N = (e) => e.toLowerCase().replace(/_/g, " ").replace(/^\w/, (e) => e.toUpperCase());
136
+ function P() {
137
+ let d = t(), { workOrderId: A } = se(), { assets: M, refetchBootstrap: P } = e(), { data: F, loading: I, refetch: L } = ce(fe, {
138
+ variables: { id: A ?? "" },
139
+ skip: !A,
128
140
  fetchPolicy: "cache-and-network"
129
- }), [me, H] = c(!1), [he, U] = c(!1), [W, G] = c({
141
+ }), [Se, R] = c(!1), [Ce, z] = c(!1), [B, V] = c({
130
142
  actualCost: "",
131
143
  notes: ""
132
- }), [K, q] = c(null), ge = te(() => {
133
- let e = new Map(P.map((e) => [e.id, e.name]));
144
+ }), [H, U] = c(null), [W, G] = c(null), we = te(() => {
145
+ let e = new Map(M.map((e) => [e.id, e.name]));
134
146
  return (t) => t ? e.get(t) ?? t : null;
135
- }, [P]), [_e, { loading: J }] = m(ce, {
147
+ }, [M]), [Te, { loading: K }] = f(pe, {
136
148
  refetchQueries: ["AssetHandlerBootstrap"],
137
149
  onCompleted: () => {
138
- r.success("Work order completed", "The job has been signed off."), H(!1), V();
150
+ r.success("Work order completed", "The job has been signed off."), R(!1), L();
139
151
  },
140
152
  onError: (e) => r.error("Could not complete work order", e.message)
141
- }), [ve, { loading: Y }] = m(le, {
153
+ }), [Ee, { loading: q }] = f(me, {
142
154
  refetchQueries: ["AssetHandlerBootstrap"],
143
155
  onCompleted: () => {
144
- r.success("Work order updated", "Your changes have been saved."), U(!1), V();
156
+ r.success("Work order updated", "Your changes have been saved."), z(!1), L();
145
157
  },
146
158
  onError: (e) => r.error("Could not update work order", e.message)
159
+ }), [De] = f(he, {
160
+ onCompleted: () => {
161
+ G(null), L(), P();
162
+ },
163
+ onError: (e) => {
164
+ G(null), r.error("Could not update checklist", e.message);
165
+ }
147
166
  });
148
- if (B && !L) return /* @__PURE__ */ g("div", {
167
+ if (I && !F) return /* @__PURE__ */ p("div", {
149
168
  className: "space-y-3 p-6",
150
- children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ g("div", { className: "h-10 rounded-md bg-bg-sunken motion-safe:animate-vc-shimmer" }, t))
169
+ children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ p("div", { className: "h-10 rounded-md bg-bg-sunken motion-safe:animate-vc-shimmer" }, t))
151
170
  });
152
- let X = L?.workOrder;
153
- if (!X) return /* @__PURE__ */ g(ee, {
171
+ let J = F?.workOrder;
172
+ if (!J) return /* @__PURE__ */ p(ee, {
154
173
  entityLabel: "Work order",
155
174
  description: "This work order may have been completed or removed. Return to the operations hub to find it.",
156
175
  backLabel: "Back to operations",
157
- onBack: () => n("/operations/operations-hub")
176
+ onBack: () => d("/operations/operations-hub")
158
177
  });
159
- let Z = {
160
- ...X,
161
- status: X.status.toLowerCase(),
162
- priority: X.priority.toLowerCase(),
163
- type: X.type.toLowerCase()
164
- }, ye = Z.status === "completed" || Z.status === "cancelled", Q = ge(Z.assetId), be = () => {
165
- q({
166
- title: X.title,
167
- description: X.description ?? "",
168
- type: X.type.toUpperCase(),
169
- priority: X.priority.toUpperCase(),
170
- status: X.status.toUpperCase(),
171
- assignedTo: X.assignedTo ?? ""
172
- }), U(!0);
173
- }, $ = (e, t) => q((n) => n && {
178
+ let Y = {
179
+ ...J,
180
+ status: J.status.toLowerCase(),
181
+ priority: J.priority.toLowerCase(),
182
+ type: J.type.toLowerCase(),
183
+ checklist: (J.checklist ?? []).map((e) => ({
184
+ task: String(e.task ?? "Task"),
185
+ completed: !!e.completed
186
+ }))
187
+ }, Oe = Y.status === "completed" || Y.status === "cancelled", X = we(Y.assetId), Z = Y.checklist.filter((e) => e.completed).length, Q = Y.checklist.length, ke = Q === 0 ? 0 : Math.round(Z / Q * 100), Ae = (e, t) => {
188
+ G(e), De({ variables: {
189
+ workOrderId: Y.id,
190
+ index: e,
191
+ completed: t
192
+ } });
193
+ }, je = () => {
194
+ U({
195
+ title: J.title,
196
+ description: J.description ?? "",
197
+ type: J.type.toUpperCase(),
198
+ priority: J.priority.toUpperCase(),
199
+ status: J.status.toUpperCase(),
200
+ assignedTo: J.assignedTo ?? ""
201
+ }), z(!0);
202
+ }, $ = (e, t) => U((n) => n && {
174
203
  ...n,
175
204
  [e]: t
176
- }), xe = () => {
177
- let e = Number(W.actualCost);
178
- _e({ variables: {
179
- id: Z.id,
205
+ }), Me = () => {
206
+ let e = Number(B.actualCost);
207
+ Te({ variables: {
208
+ id: Y.id,
180
209
  input: {
181
- actualCost: W.actualCost.trim() !== "" && Number.isFinite(e) ? e : null,
182
- notes: W.notes.trim() || null
210
+ actualCost: B.actualCost.trim() !== "" && Number.isFinite(e) ? e : null,
211
+ notes: B.notes.trim() || null
183
212
  }
184
213
  } });
185
- }, Se = () => {
186
- if (K) {
187
- if (!K.title.trim()) {
214
+ }, Ne = () => {
215
+ if (H) {
216
+ if (!H.title.trim()) {
188
217
  r.warning("Title required", "A work order must have a title.");
189
218
  return;
190
219
  }
191
- ve({ variables: {
192
- id: Z.id,
220
+ Ee({ variables: {
221
+ id: Y.id,
193
222
  input: {
194
- title: K.title.trim(),
195
- description: K.description.trim() || null,
196
- type: K.type,
197
- priority: K.priority,
198
- status: K.status,
199
- assignedTo: K.assignedTo.trim() || null
223
+ title: H.title.trim(),
224
+ description: H.description.trim() || null,
225
+ type: H.type,
226
+ priority: H.priority,
227
+ status: H.status,
228
+ assignedTo: H.assignedTo.trim() || null
200
229
  }
201
230
  } });
202
231
  }
203
- }, Ce = [
232
+ }, Pe = [
204
233
  {
205
234
  label: "Asset",
206
- value: Q ? /* @__PURE__ */ g("button", {
235
+ value: X ? /* @__PURE__ */ p("button", {
207
236
  type: "button",
208
237
  className: "font-medium text-action-primary-text hover:underline",
209
- onClick: () => n("/assets/" + Z.assetId),
210
- children: Q
211
- }) : /* @__PURE__ */ g("span", {
238
+ onClick: () => d("/assets/" + Y.assetId),
239
+ children: X
240
+ }) : /* @__PURE__ */ p("span", {
212
241
  className: "text-text-secondary",
213
242
  children: "Unassigned"
214
243
  })
215
244
  },
216
245
  {
217
246
  label: "Type",
218
- value: /* @__PURE__ */ g("span", {
247
+ value: /* @__PURE__ */ p("span", {
219
248
  className: "capitalize",
220
- children: z(Z.type)
249
+ children: N(Y.type)
221
250
  })
222
251
  },
223
252
  {
224
253
  label: "Assigned technician",
225
- value: Z.assignedTo || /* @__PURE__ */ g("span", {
254
+ value: Y.assignedTo || /* @__PURE__ */ p("span", {
226
255
  className: "text-text-secondary",
227
256
  children: "Unassigned"
228
257
  })
229
258
  },
230
259
  {
231
260
  label: "Created",
232
- value: Z.createdAt ? new Date(Z.createdAt).toLocaleDateString() : "—"
261
+ value: Y.createdAt ? new Date(Y.createdAt).toLocaleDateString() : "—"
233
262
  },
234
263
  {
235
264
  label: "Completed",
236
- value: Z.completedAt ? new Date(Z.completedAt).toLocaleDateString() : "—"
265
+ value: Y.completedAt ? new Date(Y.completedAt).toLocaleDateString() : "—"
237
266
  }
238
267
  ];
239
- return /* @__PURE__ */ _("div", {
268
+ return /* @__PURE__ */ m("div", {
240
269
  className: "space-y-6 p-4 sm:p-6",
241
270
  children: [
242
- /* @__PURE__ */ _("div", {
271
+ /* @__PURE__ */ m("div", {
243
272
  className: "flex flex-wrap items-start justify-between gap-3",
244
- children: [/* @__PURE__ */ _("div", {
273
+ children: [/* @__PURE__ */ m("div", {
245
274
  className: "flex min-w-0 items-start gap-3",
246
- children: [/* @__PURE__ */ g(v, {
275
+ children: [/* @__PURE__ */ p(h, {
247
276
  variant: "ghost",
248
277
  size: "icon",
249
278
  "aria-label": "Go back",
250
279
  className: "shrink-0",
251
- onClick: () => n("/operations/operations-hub"),
252
- children: /* @__PURE__ */ g(ne, { className: "h-4 w-4" })
253
- }), /* @__PURE__ */ _("div", {
280
+ onClick: () => d("/operations/operations-hub"),
281
+ children: /* @__PURE__ */ p(ne, { className: "h-4 w-4" })
282
+ }), /* @__PURE__ */ m("div", {
254
283
  className: "min-w-0",
255
284
  children: [
256
- /* @__PURE__ */ g("p", {
285
+ /* @__PURE__ */ p("p", {
257
286
  className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
258
287
  children: "Maintenance / Work Order Detail"
259
288
  }),
260
- /* @__PURE__ */ g("h1", {
289
+ /* @__PURE__ */ p("h1", {
261
290
  className: "truncate text-2xl font-bold",
262
- children: /* @__PURE__ */ g(oe, { children: Z.title })
291
+ children: /* @__PURE__ */ p(ue, { children: Y.title })
263
292
  }),
264
- /* @__PURE__ */ g("p", {
293
+ /* @__PURE__ */ p("p", {
265
294
  className: "mt-0.5 font-mono text-xs text-text-secondary",
266
- children: Z.id
295
+ children: Y.id
267
296
  })
268
297
  ]
269
298
  })]
270
- }), /* @__PURE__ */ _("div", {
299
+ }), /* @__PURE__ */ m("div", {
271
300
  className: "flex w-full items-center gap-2 sm:w-auto",
272
- children: [/* @__PURE__ */ _(v, {
301
+ children: [/* @__PURE__ */ m(h, {
273
302
  size: "sm",
274
303
  variant: "outline",
275
304
  className: "flex-1 sm:flex-none",
276
- onClick: be,
277
- children: [/* @__PURE__ */ g(ie, { className: "mr-2 h-4 w-4" }), "Edit"]
278
- }), ye ? null : /* @__PURE__ */ _(v, {
305
+ onClick: je,
306
+ children: [/* @__PURE__ */ p(ie, { className: "mr-2 h-4 w-4" }), "Edit"]
307
+ }), Oe ? null : /* @__PURE__ */ m(h, {
279
308
  size: "sm",
280
309
  className: "flex-1 sm:flex-none",
281
- onClick: () => H(!0),
282
- children: [/* @__PURE__ */ g(l, { className: "mr-2 h-4 w-4" }), "Complete"]
310
+ onClick: () => R(!0),
311
+ children: [/* @__PURE__ */ p(l, { className: "mr-2 h-4 w-4" }), "Complete"]
283
312
  })]
284
313
  })]
285
314
  }),
286
- /* @__PURE__ */ _(s, {
315
+ /* @__PURE__ */ m(s, {
287
316
  title: "Status",
288
- children: [/* @__PURE__ */ _("div", {
317
+ children: [/* @__PURE__ */ m("div", {
289
318
  className: "flex flex-wrap items-center gap-x-8 gap-y-4",
290
319
  children: [
291
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
320
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
292
321
  className: "text-xs uppercase tracking-wide text-text-secondary",
293
322
  children: "Priority"
294
- }), /* @__PURE__ */ g("div", {
323
+ }), /* @__PURE__ */ p("div", {
295
324
  className: "mt-1",
296
- children: /* @__PURE__ */ g(I, {
297
- tone: pe[Z.priority] ?? "neutral",
298
- children: Z.priority
325
+ children: /* @__PURE__ */ p(j, {
326
+ tone: ye[Y.priority] ?? "neutral",
327
+ children: Y.priority
299
328
  })
300
329
  })] }),
301
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
330
+ /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
302
331
  className: "text-xs uppercase tracking-wide text-text-secondary",
303
332
  children: "Status"
304
- }), /* @__PURE__ */ g("div", {
333
+ }), /* @__PURE__ */ p("div", {
305
334
  className: "mt-1",
306
- children: /* @__PURE__ */ g(I, {
307
- tone: F[Z.status] ?? "neutral",
308
- children: Z.status.replace(/_/g, " ")
335
+ children: /* @__PURE__ */ p(j, {
336
+ tone: be[Y.status] ?? "neutral",
337
+ children: Y.status.replace(/_/g, " ")
309
338
  })
310
339
  })] }),
311
- /* @__PURE__ */ _("div", {
340
+ /* @__PURE__ */ m("div", {
312
341
  className: "flex items-center gap-2",
313
- children: [/* @__PURE__ */ g(d, { className: "h-4 w-4 text-text-muted" }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
342
+ children: [/* @__PURE__ */ p(ae, { className: "h-4 w-4 text-text-muted" }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
314
343
  className: "text-xs uppercase tracking-wide text-text-secondary",
315
344
  children: "Technician"
316
- }), /* @__PURE__ */ g("p", {
345
+ }), /* @__PURE__ */ p("p", {
317
346
  className: "mt-0.5 text-sm font-medium text-text-primary",
318
- children: Z.assignedTo || "Unassigned"
347
+ children: Y.assignedTo || "Unassigned"
319
348
  })] })]
320
349
  }),
321
- Q ? /* @__PURE__ */ _("div", {
350
+ X ? /* @__PURE__ */ m("div", {
322
351
  className: "flex items-center gap-2",
323
- children: [/* @__PURE__ */ g(re, { className: "h-4 w-4 text-text-muted" }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
352
+ children: [/* @__PURE__ */ p(re, { className: "h-4 w-4 text-text-muted" }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
324
353
  className: "text-xs uppercase tracking-wide text-text-secondary",
325
354
  children: "Asset"
326
- }), /* @__PURE__ */ g("button", {
355
+ }), /* @__PURE__ */ p("button", {
327
356
  type: "button",
328
357
  className: "mt-0.5 text-sm font-medium text-action-primary-text hover:underline",
329
- onClick: () => n("/assets/" + Z.assetId),
330
- children: Q
358
+ onClick: () => d("/assets/" + Y.assetId),
359
+ children: X
331
360
  })] })]
332
361
  }) : null
333
362
  ]
334
- }), /* @__PURE__ */ g("div", {
363
+ }), /* @__PURE__ */ p("div", {
335
364
  className: "mt-5 border-t border-border-seam pt-4",
336
- children: /* @__PURE__ */ g(R, { status: Z.status })
365
+ children: /* @__PURE__ */ p(xe, { status: Y.status })
337
366
  })]
338
367
  }),
339
- /* @__PURE__ */ _("div", {
368
+ /* @__PURE__ */ m("div", {
340
369
  className: "grid gap-6 lg:grid-cols-3",
341
- children: [/* @__PURE__ */ _("div", {
370
+ children: [/* @__PURE__ */ m("div", {
342
371
  className: "space-y-6 lg:col-span-2",
343
- children: [/* @__PURE__ */ _(s, {
344
- title: "Details",
345
- icon: f,
346
- children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h4", {
347
- className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
348
- children: "Description"
349
- }), /* @__PURE__ */ g("p", {
350
- className: "mt-1 text-sm text-text-primary",
351
- children: Z.description || "—"
352
- })] }), /* @__PURE__ */ g("dl", {
353
- className: "mt-4 divide-y divide-border-seam text-sm",
354
- children: Ce.map((e) => /* @__PURE__ */ _("div", {
355
- className: "flex flex-col gap-0.5 py-2.5 sm:flex-row sm:items-center sm:justify-between",
356
- children: [/* @__PURE__ */ g("dt", {
357
- className: "text-text-secondary",
358
- children: e.label
359
- }), /* @__PURE__ */ g("dd", {
360
- className: "font-medium text-text-primary sm:text-right",
361
- children: e.value
362
- })]
363
- }, e.label))
364
- })]
365
- }), /* @__PURE__ */ g(x, { children: "The full brief for a single work order: what needs doing, on which asset and by whom. Track the job from open to complete and keep the asset's maintenance history accurate." })]
366
- }), /* @__PURE__ */ _("div", {
372
+ children: [
373
+ /* @__PURE__ */ m(s, {
374
+ title: "Details",
375
+ icon: oe,
376
+ children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h4", {
377
+ className: "text-xs font-semibold uppercase tracking-wide text-text-secondary",
378
+ children: "Description"
379
+ }), /* @__PURE__ */ p("p", {
380
+ className: "mt-1 text-sm text-text-primary",
381
+ children: Y.description || "—"
382
+ })] }), /* @__PURE__ */ p("dl", {
383
+ className: "mt-4 divide-y divide-border-seam text-sm",
384
+ children: Pe.map((e) => /* @__PURE__ */ m("div", {
385
+ className: "flex flex-col gap-0.5 py-2.5 sm:flex-row sm:items-center sm:justify-between",
386
+ children: [/* @__PURE__ */ p("dt", {
387
+ className: "text-text-secondary",
388
+ children: e.label
389
+ }), /* @__PURE__ */ p("dd", {
390
+ className: "font-medium text-text-primary sm:text-right",
391
+ children: e.value
392
+ })]
393
+ }, e.label))
394
+ })]
395
+ }),
396
+ /* @__PURE__ */ p(s, {
397
+ title: `Checklist (${Z}/${Q})`,
398
+ children: Q === 0 ? /* @__PURE__ */ p("p", {
399
+ className: "text-sm text-text-secondary",
400
+ children: "No checklist items for this job."
401
+ }) : /* @__PURE__ */ m(le, { children: [/* @__PURE__ */ p("div", {
402
+ className: "mb-3 h-2 overflow-hidden rounded-full bg-bg-sunken",
403
+ children: /* @__PURE__ */ p("div", {
404
+ className: "h-full rounded-full bg-action-primary-bg transition-all",
405
+ style: { width: `${ke}%` }
406
+ })
407
+ }), /* @__PURE__ */ p("div", {
408
+ className: "space-y-2",
409
+ children: Y.checklist.map((e, t) => /* @__PURE__ */ m("label", {
410
+ className: "flex cursor-pointer items-center gap-3 rounded border border-border-seam p-2.5",
411
+ children: [
412
+ /* @__PURE__ */ p("input", {
413
+ type: "checkbox",
414
+ className: "h-4 w-4 accent-action-primary-bg",
415
+ checked: e.completed,
416
+ disabled: W === t,
417
+ onChange: (e) => Ae(t, e.target.checked)
418
+ }),
419
+ /* @__PURE__ */ p("span", {
420
+ className: n("text-sm", e.completed && "text-text-secondary line-through"),
421
+ children: e.task
422
+ }),
423
+ W === t ? /* @__PURE__ */ p(u, { className: "ml-auto h-3.5 w-3.5 animate-spin text-text-secondary" }) : null
424
+ ]
425
+ }, t))
426
+ })] })
427
+ }),
428
+ /* @__PURE__ */ p(de, { children: "The full brief for a single work order: what needs doing, on which asset and by whom. Track the job from open to complete and keep the asset's maintenance history accurate." })
429
+ ]
430
+ }), /* @__PURE__ */ m("div", {
367
431
  className: "space-y-6",
368
432
  children: [
369
- /* @__PURE__ */ g(i, {
433
+ /* @__PURE__ */ p(i, {
370
434
  entityType: "assethandler-work-order",
371
- entityId: Z.id
435
+ entityId: Y.id
372
436
  }),
373
- /* @__PURE__ */ g(a, {
437
+ /* @__PURE__ */ p(a, {
374
438
  entityType: "assethandler-work-order",
375
- entityId: Z.id
439
+ entityId: Y.id
376
440
  }),
377
- /* @__PURE__ */ g(o, { resourceId: Z.id })
441
+ /* @__PURE__ */ p(o, { resourceId: Y.id })
378
442
  ]
379
443
  })]
380
444
  }),
381
- /* @__PURE__ */ g(S, {
382
- open: me,
383
- onOpenChange: H,
384
- children: /* @__PURE__ */ _(C, { children: [
385
- /* @__PURE__ */ _(E, { children: [/* @__PURE__ */ g(D, { children: "Complete work order" }), /* @__PURE__ */ g(w, { children: "Record the final cost and any closing notes. This marks the work order as completed." })] }),
386
- /* @__PURE__ */ _("div", {
445
+ /* @__PURE__ */ p(v, {
446
+ open: Se,
447
+ onOpenChange: R,
448
+ children: /* @__PURE__ */ m(y, { children: [
449
+ /* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(C, { children: "Complete work order" }), /* @__PURE__ */ p(b, { children: "Record the final cost and any closing notes. This marks the work order as completed." })] }),
450
+ /* @__PURE__ */ m("div", {
387
451
  className: "space-y-4",
388
- children: [/* @__PURE__ */ _("div", {
452
+ children: [/* @__PURE__ */ m("div", {
389
453
  className: "space-y-2",
390
- children: [/* @__PURE__ */ g(b, { children: "Actual Cost" }), /* @__PURE__ */ g(y, {
454
+ children: [/* @__PURE__ */ p(_, { children: "Actual Cost" }), /* @__PURE__ */ p(g, {
391
455
  type: "number",
392
456
  min: "0",
393
457
  step: "0.01",
394
458
  placeholder: "e.g., 750",
395
- value: W.actualCost,
396
- onChange: (e) => G((t) => ({
459
+ value: B.actualCost,
460
+ onChange: (e) => V((t) => ({
397
461
  ...t,
398
462
  actualCost: e.target.value
399
463
  }))
400
464
  })]
401
- }), /* @__PURE__ */ _("div", {
465
+ }), /* @__PURE__ */ m("div", {
402
466
  className: "space-y-2",
403
- children: [/* @__PURE__ */ g(b, { children: "Notes" }), /* @__PURE__ */ g(N, {
467
+ children: [/* @__PURE__ */ p(_, { children: "Notes" }), /* @__PURE__ */ p(k, {
404
468
  placeholder: "What was done to close this out?",
405
- value: W.notes,
406
- onChange: (e) => G((t) => ({
469
+ value: B.notes,
470
+ onChange: (e) => V((t) => ({
407
471
  ...t,
408
472
  notes: e.target.value
409
473
  })),
@@ -411,99 +475,99 @@ function B() {
411
475
  })]
412
476
  })]
413
477
  }),
414
- /* @__PURE__ */ _(T, { children: [/* @__PURE__ */ g(v, {
478
+ /* @__PURE__ */ m(x, { children: [/* @__PURE__ */ p(h, {
415
479
  variant: "outline",
416
- onClick: () => H(!1),
417
- disabled: J,
480
+ onClick: () => R(!1),
481
+ disabled: K,
418
482
  children: "Cancel"
419
- }), /* @__PURE__ */ _(v, {
420
- onClick: xe,
421
- disabled: J,
422
- children: [J ? /* @__PURE__ */ g(u, { className: "mr-2 h-4 w-4 animate-spin" }) : null, J ? "Completing…" : "Complete work order"]
483
+ }), /* @__PURE__ */ m(h, {
484
+ onClick: Me,
485
+ disabled: K,
486
+ children: [K ? /* @__PURE__ */ p(u, { className: "mr-2 h-4 w-4 animate-spin" }) : null, K ? "Completing…" : "Complete work order"]
423
487
  })] })
424
488
  ] })
425
489
  }),
426
- /* @__PURE__ */ g(S, {
427
- open: he,
428
- onOpenChange: U,
429
- children: /* @__PURE__ */ _(C, {
490
+ /* @__PURE__ */ p(v, {
491
+ open: Ce,
492
+ onOpenChange: z,
493
+ children: /* @__PURE__ */ m(y, {
430
494
  className: "max-h-[85vh] overflow-y-auto sm:max-w-xl",
431
495
  children: [
432
- /* @__PURE__ */ _(E, { children: [/* @__PURE__ */ g(D, { children: "Edit work order" }), /* @__PURE__ */ g(w, { children: "Update the work order's details and status." })] }),
433
- K ? /* @__PURE__ */ _("div", {
496
+ /* @__PURE__ */ m(S, { children: [/* @__PURE__ */ p(C, { children: "Edit work order" }), /* @__PURE__ */ p(b, { children: "Update the work order's details and status." })] }),
497
+ H ? /* @__PURE__ */ m("div", {
434
498
  className: "space-y-4",
435
499
  children: [
436
- /* @__PURE__ */ _("div", {
500
+ /* @__PURE__ */ m("div", {
437
501
  className: "space-y-2",
438
- children: [/* @__PURE__ */ g(b, { children: "Title" }), /* @__PURE__ */ g(y, {
439
- value: K.title,
502
+ children: [/* @__PURE__ */ p(_, { children: "Title" }), /* @__PURE__ */ p(g, {
503
+ value: H.title,
440
504
  onChange: (e) => $("title", e.target.value)
441
505
  })]
442
506
  }),
443
- /* @__PURE__ */ _("div", {
507
+ /* @__PURE__ */ m("div", {
444
508
  className: "space-y-2",
445
- children: [/* @__PURE__ */ g(b, { children: "Description" }), /* @__PURE__ */ g(N, {
446
- value: K.description,
509
+ children: [/* @__PURE__ */ p(_, { children: "Description" }), /* @__PURE__ */ p(k, {
510
+ value: H.description,
447
511
  onChange: (e) => $("description", e.target.value),
448
512
  rows: 2
449
513
  })]
450
514
  }),
451
- /* @__PURE__ */ _("div", {
515
+ /* @__PURE__ */ m("div", {
452
516
  className: "grid gap-4 md:grid-cols-3",
453
517
  children: [
454
- /* @__PURE__ */ _("div", {
518
+ /* @__PURE__ */ m("div", {
455
519
  className: "space-y-2",
456
- children: [/* @__PURE__ */ g(b, { children: "Type" }), /* @__PURE__ */ _(O, {
457
- value: K.type,
520
+ children: [/* @__PURE__ */ p(_, { children: "Type" }), /* @__PURE__ */ m(w, {
521
+ value: H.type,
458
522
  onValueChange: (e) => $("type", e),
459
- children: [/* @__PURE__ */ g(j, { children: /* @__PURE__ */ g(M, {}) }), /* @__PURE__ */ g(k, { children: ue.map((e) => /* @__PURE__ */ g(A, {
523
+ children: [/* @__PURE__ */ p(D, { children: /* @__PURE__ */ p(O, {}) }), /* @__PURE__ */ p(T, { children: ge.map((e) => /* @__PURE__ */ p(E, {
460
524
  value: e,
461
- children: z(e)
525
+ children: N(e)
462
526
  }, e)) })]
463
527
  })]
464
528
  }),
465
- /* @__PURE__ */ _("div", {
529
+ /* @__PURE__ */ m("div", {
466
530
  className: "space-y-2",
467
- children: [/* @__PURE__ */ g(b, { children: "Priority" }), /* @__PURE__ */ _(O, {
468
- value: K.priority,
531
+ children: [/* @__PURE__ */ p(_, { children: "Priority" }), /* @__PURE__ */ m(w, {
532
+ value: H.priority,
469
533
  onValueChange: (e) => $("priority", e),
470
- children: [/* @__PURE__ */ g(j, { children: /* @__PURE__ */ g(M, {}) }), /* @__PURE__ */ g(k, { children: fe.map((e) => /* @__PURE__ */ g(A, {
534
+ children: [/* @__PURE__ */ p(D, { children: /* @__PURE__ */ p(O, {}) }), /* @__PURE__ */ p(T, { children: ve.map((e) => /* @__PURE__ */ p(E, {
471
535
  value: e,
472
- children: z(e)
536
+ children: N(e)
473
537
  }, e)) })]
474
538
  })]
475
539
  }),
476
- /* @__PURE__ */ _("div", {
540
+ /* @__PURE__ */ m("div", {
477
541
  className: "space-y-2",
478
- children: [/* @__PURE__ */ g(b, { children: "Status" }), /* @__PURE__ */ _(O, {
479
- value: K.status,
542
+ children: [/* @__PURE__ */ p(_, { children: "Status" }), /* @__PURE__ */ m(w, {
543
+ value: H.status,
480
544
  onValueChange: (e) => $("status", e),
481
- children: [/* @__PURE__ */ g(j, { children: /* @__PURE__ */ g(M, {}) }), /* @__PURE__ */ g(k, { children: de.map((e) => /* @__PURE__ */ g(A, {
545
+ children: [/* @__PURE__ */ p(D, { children: /* @__PURE__ */ p(O, {}) }), /* @__PURE__ */ p(T, { children: _e.map((e) => /* @__PURE__ */ p(E, {
482
546
  value: e,
483
- children: z(e)
547
+ children: N(e)
484
548
  }, e)) })]
485
549
  })]
486
550
  })
487
551
  ]
488
552
  }),
489
- /* @__PURE__ */ _("div", {
553
+ /* @__PURE__ */ m("div", {
490
554
  className: "space-y-2",
491
- children: [/* @__PURE__ */ g(b, { children: "Assigned To" }), /* @__PURE__ */ g(y, {
492
- value: K.assignedTo,
555
+ children: [/* @__PURE__ */ p(_, { children: "Assigned To" }), /* @__PURE__ */ p(g, {
556
+ value: H.assignedTo,
493
557
  onChange: (e) => $("assignedTo", e.target.value)
494
558
  })]
495
559
  })
496
560
  ]
497
561
  }) : null,
498
- /* @__PURE__ */ _(T, { children: [/* @__PURE__ */ g(v, {
562
+ /* @__PURE__ */ m(x, { children: [/* @__PURE__ */ p(h, {
499
563
  variant: "outline",
500
- onClick: () => U(!1),
501
- disabled: Y,
564
+ onClick: () => z(!1),
565
+ disabled: q,
502
566
  children: "Cancel"
503
- }), /* @__PURE__ */ _(v, {
504
- onClick: Se,
505
- disabled: Y,
506
- children: [Y ? /* @__PURE__ */ g(u, { className: "mr-2 h-4 w-4 animate-spin" }) : null, Y ? "Saving…" : "Save changes"]
567
+ }), /* @__PURE__ */ m(h, {
568
+ onClick: Ne,
569
+ disabled: q,
570
+ children: [q ? /* @__PURE__ */ p(u, { className: "mr-2 h-4 w-4 animate-spin" }) : null, q ? "Saving…" : "Save changes"]
507
571
  })] })
508
572
  ]
509
573
  })
@@ -512,6 +576,6 @@ function B() {
512
576
  });
513
577
  }
514
578
  //#endregion
515
- export { B as OperationsWorkOrderDetailPage };
579
+ export { P as OperationsWorkOrderDetailPage };
516
580
 
517
581
  //# sourceMappingURL=OperationsWorkOrderDetailPage.js.map