@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
@@ -14,14 +14,14 @@ import { StatTile as s } from "../components/StatTile.js";
14
14
  import { ChartCard as c } from "../components/ChartCard.js";
15
15
  import "../components/index.js";
16
16
  import { useState as l } from "react";
17
- import { Archive as u, ArrowLeft as ae, Building2 as oe, Calendar as se, DollarSign as d, Hash as ce, Layers as le, MapPin as ue, Pencil as de, ShieldCheck as fe, Tag as pe, Trash2 as me, TrendingDown as he, Truck as ge, User as _e, Wrench as f } from "lucide-react";
18
- import { useParams as ve } from "react-router-dom";
19
- import { gql as p } from "@apollo/client";
20
- import { useMutation as m, useQuery as ye } from "@apollo/client/react";
21
- import { Fragment as be, jsx as h, jsxs as g } from "react/jsx-runtime";
22
- import { Badge as xe, Button as _, Card as Se, CardContent as Ce, CardDescription as we, CardHeader as Te, CardTitle as Ee, EmphasisPanel as De, GlassCard as Oe, GradientText as ke, Input as v, Label as y, PagePurpose as Ae, ResponsiveDialog as b, ResponsiveDialogContent as x, ResponsiveDialogDescription as S, ResponsiveDialogFooter as C, ResponsiveDialogHeader as w, ResponsiveDialogTitle as T, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A, Tabs as je, TabsContent as j, TabsList as Me, TabsTrigger as M, Textarea as Ne } from "@burdenoff/fe-libs/ui";
17
+ import { Archive as ae, ArrowLeft as oe, Building2 as se, Calendar as ce, DollarSign as le, Hash as ue, Layers as de, MapPin as fe, Pencil as pe, ShieldCheck as me, Tag as he, Trash2 as ge, TrendingDown as _e, Truck as ve, User as ye, Wrench as u } from "lucide-react";
18
+ import { useParams as be } from "react-router-dom";
19
+ import { gql as d } from "@apollo/client";
20
+ import { useMutation as f, useQuery as xe } from "@apollo/client/react";
21
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
22
+ import { Badge as Se, Button as g, Card as Ce, CardContent as we, CardDescription as Te, CardHeader as Ee, CardTitle as De, EmphasisPanel as Oe, GlassCard as ke, GradientText as Ae, Input as _, Label as v, PagePurpose as je, ResponsiveDialog as y, ResponsiveDialogContent as b, ResponsiveDialogDescription as x, ResponsiveDialogFooter as S, ResponsiveDialogHeader as C, ResponsiveDialogTitle as w, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k, Tabs as Me, TabsContent as A, TabsList as Ne, TabsTrigger as j, Textarea as Pe } from "@burdenoff/fe-libs/ui";
23
23
  //#region src/assethandler/pages/AssetsAssetDetailPage.tsx
24
- var Pe = p`
24
+ var Fe = d`
25
25
  query AssetHandlerAsset($id: ID!) {
26
26
  asset(id: $id) {
27
27
  id
@@ -42,6 +42,8 @@ var Pe = p`
42
42
  usefulLifeMonths
43
43
  salvageValue
44
44
  depreciationMethod
45
+ unitsOfProductionCapacity
46
+ unitsProduced
45
47
  department
46
48
  warrantyExpiry
47
49
  supplier
@@ -53,54 +55,76 @@ var Pe = p`
53
55
  totalCostOfOwnership
54
56
  }
55
57
  }
56
- `, Fe = p`
58
+ `, Ie = d`
57
59
  mutation AssetHandlerUpdateAsset($id: ID!, $input: UpdateAssetInput!) {
58
60
  updateAsset(id: $id, input: $input) {
59
61
  id
60
62
  }
61
63
  }
62
- `, Ie = p`
64
+ `, Le = d`
63
65
  mutation AssetHandlerDisposeAsset($id: ID!, $input: DisposeAssetInput!) {
64
66
  disposeAsset(id: $id, input: $input) {
65
67
  id
66
68
  status
67
69
  }
68
70
  }
69
- `, Le = p`
71
+ `, Re = d`
70
72
  mutation AssetHandlerDeleteAsset($id: ID!) {
71
73
  deleteAsset(id: $id)
72
74
  }
73
- `, Re = {
75
+ `, ze = {
74
76
  excellent: "text-status-success-text bg-status-success-bg-subtle",
75
77
  good: "text-status-info-text bg-status-info-bg-subtle",
76
78
  fair: "text-status-warning-text bg-status-warning-bg-subtle",
77
79
  poor: "text-status-warning-text bg-status-warning-bg-subtle",
78
80
  damaged: "text-status-error-text bg-status-error-bg-subtle"
79
- }, N = (e) => e == null ? "—" : `$${Number(e).toLocaleString(void 0, { maximumFractionDigits: 2 })}`;
80
- function ze(e) {
81
+ }, M = (e) => e == null ? "—" : `$${Number(e).toLocaleString(void 0, { maximumFractionDigits: 2 })}`;
82
+ function Be(e) {
81
83
  let t = Date.now();
82
84
  return e.map((e) => e.scheduledDate).filter((e) => e != null && new Date(e).getTime() >= t).sort((e, t) => new Date(e).getTime() - new Date(t).getTime())[0];
83
85
  }
84
- var Be = {
86
+ var Ve = {
85
87
  STRAIGHT_LINE: "Straight line",
86
- REDUCING_BALANCE: "Reducing balance",
88
+ REDUCING_BALANCE: "Reducing balance (200%)",
89
+ DECLINING_BALANCE: "Declining balance (150%)",
90
+ SUM_OF_YEARS_DIGITS: "Sum of years' digits",
91
+ UNITS_OF_PRODUCTION: "Units of production",
87
92
  NONE: "None"
88
- }, Ve = {
93
+ }, He = {
89
94
  active: "bg-status-success-bg-subtle text-status-success-text",
90
95
  maintenance: "bg-status-warning-bg-subtle text-status-warning-text",
91
96
  inactive: "bg-bg-sunken text-text-secondary",
92
97
  retired: "bg-bg-sunken text-text-secondary",
93
98
  disposed: "bg-status-error-bg-subtle text-status-error-text"
94
99
  };
95
- function He(e) {
100
+ function Ue(e) {
96
101
  let t = e.purchaseValue, n = e.usefulLifeMonths;
97
102
  if (!t || t <= 0 || !n || n <= 0) return [];
98
- let r = Math.max(0, Math.min(e.salvageValue ?? 0, t)), i = (e.method ?? "straight_line").toLowerCase(), a = Math.max(1, Math.round(n / 12)), o = [];
103
+ let r = Math.max(0, Math.min(e.salvageValue ?? 0, t)), i = (e.method ?? "straight_line").toLowerCase(), a = Math.max(1, Math.round(n / 12));
104
+ if (i === "units_of_production") {
105
+ let n = e.unitsOfProductionCapacity, i = Math.max(0, e.unitsProduced ?? 0);
106
+ if (!n || n <= 0) return [];
107
+ let o = Math.max(t - (t - r) * (Math.min(i, n) / n), r);
108
+ return [{
109
+ year: 0,
110
+ bookValue: Math.round(t)
111
+ }, {
112
+ year: a,
113
+ bookValue: Math.round(o)
114
+ }];
115
+ }
116
+ let o = [];
99
117
  for (let e = 0; e <= a; e += 1) {
100
118
  let n;
101
119
  if (i === "reducing_balance") {
102
120
  let i = r > 0 ? 1 - (r / t) ** (1 / a) : Math.min(.9, 2 / a);
103
121
  n = Math.max(t * (1 - i) ** e, r);
122
+ } else if (i === "declining_balance") {
123
+ let i = r > 0 ? 1 - (r / t) ** (1 / a) : Math.min(.75, 1.5 / a);
124
+ n = Math.max(t * (1 - i) ** e, r);
125
+ } else if (i === "sum_of_years_digits") {
126
+ let i = a * (a + 1) / 2, o = i > 0 ? (t - r) * ((e * a - e * (e - 1) / 2) / i) : 0;
127
+ n = Math.max(t - o, r);
104
128
  } else n = i === "none" ? t : Math.max(t - (t - r) * (e / a), r);
105
129
  o.push({
106
130
  year: e,
@@ -109,7 +133,7 @@ function He(e) {
109
133
  }
110
134
  return o;
111
135
  }
112
- function Ue(e) {
136
+ function We(e) {
113
137
  return {
114
138
  name: e.name,
115
139
  description: e.description ?? "",
@@ -124,58 +148,62 @@ function Ue(e) {
124
148
  purchaseValue: e.purchaseValue == null ? "" : String(e.purchaseValue),
125
149
  salvageValue: e.salvageValue == null ? "" : String(e.salvageValue),
126
150
  usefulLifeMonths: e.usefulLifeMonths == null ? "" : String(e.usefulLifeMonths),
127
- depreciationMethod: (e.depreciationMethod ?? "STRAIGHT_LINE").toUpperCase()
151
+ depreciationMethod: (e.depreciationMethod ?? "STRAIGHT_LINE").toUpperCase(),
152
+ unitsOfProductionCapacity: e.unitsOfProductionCapacity == null ? "" : String(e.unitsOfProductionCapacity),
153
+ unitsProduced: e.unitsProduced == null ? "" : String(e.unitsProduced)
128
154
  };
129
155
  }
130
- function P() {
131
- let p = t(), { assetId: P } = ve(), { maintenanceRecords: We } = e(), Ge = n(), { data: Ke, loading: qe, refetch: Je } = ye(Pe, {
132
- variables: { id: P ?? "" },
133
- skip: !P,
156
+ function N() {
157
+ let d = t(), { assetId: N } = be(), { maintenanceRecords: Ge } = e(), Ke = n(), { data: qe, loading: Je, refetch: I } = xe(Fe, {
158
+ variables: { id: N ?? "" },
159
+ skip: !N,
134
160
  fetchPolicy: "cache-and-network"
135
161
  }), [Ye, L] = l(!1), [Xe, R] = l(!1), [Ze, z] = l(!1), [B, Qe] = l(null), [V, H] = l({
136
162
  disposalDate: "",
137
163
  method: "",
138
164
  notes: ""
139
- }), [$e, { loading: U }] = m(Fe, {
165
+ }), [$e, { loading: U }] = f(Ie, {
140
166
  refetchQueries: ["AssetHandlerBootstrap"],
141
167
  onCompleted: () => {
142
- r.success("Asset updated", "Your changes have been saved."), L(!1), Je();
168
+ r.success("Asset updated", "Your changes have been saved."), L(!1), I();
143
169
  },
144
170
  onError: (e) => r.error("Could not update asset", e.message)
145
- }), [et, { loading: W }] = m(Ie, {
171
+ }), [et, { loading: W }] = f(Le, {
146
172
  refetchQueries: ["AssetHandlerBootstrap"],
147
173
  onCompleted: () => {
148
- r.success("Asset disposed", "The asset has been marked as disposed."), R(!1), Je();
174
+ r.success("Asset disposed", "The asset has been marked as disposed."), R(!1), I();
149
175
  },
150
176
  onError: (e) => r.error("Could not dispose asset", e.message)
151
- }), [tt, { loading: G }] = m(Le, {
177
+ }), [tt, { loading: G }] = f(Re, {
152
178
  refetchQueries: ["AssetHandlerBootstrap"],
153
179
  onCompleted: () => {
154
- r.success("Asset deleted", "The asset has been removed from the inventory."), p("/assets/asset-list");
180
+ r.success("Asset deleted", "The asset has been removed from the inventory."), d("/assets/asset-list");
155
181
  },
156
182
  onError: (e) => r.error("Could not delete asset", e.message)
157
183
  });
158
- if (qe && !Ke) return /* @__PURE__ */ h("div", {
184
+ if (Je && !qe) return /* @__PURE__ */ m("div", {
159
185
  className: "space-y-3 p-6",
160
- children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ h("div", { className: "h-10 rounded-md bg-bg-sunken motion-safe:animate-vc-shimmer" }, t))
186
+ children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ m("div", { className: "h-10 rounded-md bg-bg-sunken motion-safe:animate-vc-shimmer" }, t))
161
187
  });
162
- let K = Ke?.asset;
163
- if (!K) return /* @__PURE__ */ h(ie, {
188
+ let K = qe?.asset;
189
+ if (!K) return /* @__PURE__ */ m(ie, {
164
190
  entityLabel: "Asset",
165
191
  description: "This asset may have been disposed or removed. Return to the inventory to find it.",
166
192
  backLabel: "Back to inventory",
167
- onBack: () => p("/assets/asset-list")
193
+ onBack: () => d("/assets/asset-list")
168
194
  });
169
195
  let q = {
170
196
  ...K,
171
197
  status: K.status.toLowerCase(),
172
198
  condition: K.condition.toLowerCase(),
173
199
  category: K.category.toLowerCase()
174
- }, J = We.filter((e) => e.assetId === q.id), Y = J.filter((e) => e.status !== "completed" && e.status !== "cancelled"), nt = ze(Y), X = q.status === "disposed", Z = He({
200
+ }, J = Ge.filter((e) => e.assetId === q.id), Y = J.filter((e) => e.status !== "completed" && e.status !== "cancelled"), X = Be(Y), nt = q.status === "disposed", Z = Ue({
175
201
  purchaseValue: q.purchaseValue,
176
202
  salvageValue: q.salvageValue,
177
203
  usefulLifeMonths: q.usefulLifeMonths,
178
- method: q.depreciationMethod
204
+ method: q.depreciationMethod,
205
+ unitsOfProductionCapacity: q.unitsOfProductionCapacity,
206
+ unitsProduced: q.unitsProduced
179
207
  }), rt = Z.map((e) => e.bookValue), it = J.filter((e) => (e.actualCost ?? e.estimatedCost) != null).map((e) => ({
180
208
  label: e.scheduledDate ? new Date(e.scheduledDate).toLocaleDateString(void 0, {
181
209
  month: "short",
@@ -191,7 +219,7 @@ function P() {
191
219
  value: at,
192
220
  color: "var(--color-status-info-bg)"
193
221
  }] : [], ot = () => {
194
- Qe(Ue(K)), L(!0);
222
+ Qe(We(K)), L(!0);
195
223
  }, st = (e) => {
196
224
  if (e.preventDefault(), !B) return;
197
225
  if (!B.name.trim()) {
@@ -220,7 +248,9 @@ function P() {
220
248
  purchaseValue: t(B.purchaseValue),
221
249
  salvageValue: t(B.salvageValue),
222
250
  usefulLifeMonths: t(B.usefulLifeMonths),
223
- depreciationMethod: B.depreciationMethod
251
+ depreciationMethod: B.depreciationMethod,
252
+ unitsOfProductionCapacity: t(B.unitsOfProductionCapacity),
253
+ unitsProduced: t(B.unitsProduced)
224
254
  }
225
255
  } });
226
256
  }, ct = (e) => {
@@ -236,252 +266,252 @@ function P() {
236
266
  ...n,
237
267
  [e]: t
238
268
  });
239
- return /* @__PURE__ */ g("div", {
269
+ return /* @__PURE__ */ h("div", {
240
270
  className: "space-y-6 p-6",
241
271
  children: [
242
- /* @__PURE__ */ g("div", {
272
+ /* @__PURE__ */ h("div", {
243
273
  className: "flex flex-wrap items-center justify-between gap-3",
244
- children: [/* @__PURE__ */ g("div", {
274
+ children: [/* @__PURE__ */ h("div", {
245
275
  className: "flex items-center gap-4",
246
- children: [/* @__PURE__ */ h(_, {
276
+ children: [/* @__PURE__ */ m(g, {
247
277
  variant: "ghost",
248
278
  size: "icon",
249
279
  "aria-label": "Go back",
250
- onClick: () => p("/assets/asset-list"),
251
- children: /* @__PURE__ */ h(ae, { className: "h-4 w-4" })
252
- }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ g("div", {
280
+ onClick: () => d("/assets/asset-list"),
281
+ children: /* @__PURE__ */ m(oe, { className: "h-4 w-4" })
282
+ }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("div", {
253
283
  className: "flex items-center gap-3",
254
284
  children: [
255
- /* @__PURE__ */ h("h1", {
285
+ /* @__PURE__ */ m("h1", {
256
286
  className: "text-2xl font-bold",
257
- children: /* @__PURE__ */ h(ke, { children: q.name })
287
+ children: /* @__PURE__ */ m(Ae, { children: q.name })
258
288
  }),
259
- /* @__PURE__ */ h("span", {
260
- className: `rounded-full px-2.5 py-0.5 text-xs font-medium capitalize ${Ve[q.status] ?? "bg-bg-sunken text-text-secondary"}`,
289
+ /* @__PURE__ */ m("span", {
290
+ className: `rounded-full px-2.5 py-0.5 text-xs font-medium capitalize ${He[q.status] ?? "bg-bg-sunken text-text-secondary"}`,
261
291
  children: q.status.replace(/_/g, " ")
262
292
  }),
263
- /* @__PURE__ */ h("span", {
264
- className: `rounded-full px-2.5 py-0.5 text-xs font-medium capitalize ${Re[q.condition] ?? ""}`,
293
+ /* @__PURE__ */ m("span", {
294
+ className: `rounded-full px-2.5 py-0.5 text-xs font-medium capitalize ${ze[q.condition] ?? ""}`,
265
295
  children: q.condition
266
296
  })
267
297
  ]
268
- }), /* @__PURE__ */ g("p", {
298
+ }), /* @__PURE__ */ h("p", {
269
299
  className: "text-sm text-text-secondary mt-1",
270
- children: [q.assetNumber, q.serialNumber ? /* @__PURE__ */ g(be, { children: [" · SN: ", q.serialNumber] }) : null]
300
+ children: [q.assetNumber, q.serialNumber ? /* @__PURE__ */ h(p, { children: [" · SN: ", q.serialNumber] }) : null]
271
301
  })] })]
272
- }), /* @__PURE__ */ g("div", {
302
+ }), /* @__PURE__ */ h("div", {
273
303
  className: "flex items-center gap-2",
274
304
  children: [
275
- /* @__PURE__ */ g(_, {
305
+ /* @__PURE__ */ h(g, {
276
306
  size: "sm",
277
307
  variant: "outline",
278
308
  onClick: ot,
279
- children: [/* @__PURE__ */ h(de, { className: "mr-2 h-4 w-4" }), "Edit"]
309
+ children: [/* @__PURE__ */ m(pe, { className: "mr-2 h-4 w-4" }), "Edit"]
280
310
  }),
281
- X ? null : /* @__PURE__ */ g(_, {
311
+ nt ? null : /* @__PURE__ */ h(g, {
282
312
  size: "sm",
283
313
  variant: "outline",
284
314
  onClick: () => R(!0),
285
- children: [/* @__PURE__ */ h(u, { className: "mr-2 h-4 w-4" }), "Dispose"]
315
+ children: [/* @__PURE__ */ m(ae, { className: "mr-2 h-4 w-4" }), "Dispose"]
286
316
  }),
287
- /* @__PURE__ */ g(_, {
317
+ /* @__PURE__ */ h(g, {
288
318
  size: "sm",
289
319
  variant: "outline",
290
320
  className: "text-status-error-text",
291
321
  onClick: () => z(!0),
292
- children: [/* @__PURE__ */ h(me, { className: "mr-2 h-4 w-4" }), "Delete"]
322
+ children: [/* @__PURE__ */ m(ge, { className: "mr-2 h-4 w-4" }), "Delete"]
293
323
  })
294
324
  ]
295
325
  })]
296
326
  }),
297
- /* @__PURE__ */ h(Ae, { children: "The complete profile of a single asset — its identity, condition, location, assignment, financials and maintenance history. Use this page as the asset's home base: edit its details, track its book value, and dispose of it when it reaches end of life." }),
298
- X ? /* @__PURE__ */ g(De, { children: [
299
- /* @__PURE__ */ g("div", {
327
+ /* @__PURE__ */ m(je, { children: "The complete profile of a single asset — its identity, condition, location, assignment, financials and maintenance history. Use this page as the asset's home base: edit its details, track its book value, and dispose of it when it reaches end of life." }),
328
+ nt ? /* @__PURE__ */ h(Oe, { children: [
329
+ /* @__PURE__ */ h("div", {
300
330
  className: "flex items-center gap-2 text-sm font-medium",
301
331
  children: [
302
- /* @__PURE__ */ h(u, { className: "h-4 w-4" }),
332
+ /* @__PURE__ */ m(ae, { className: "h-4 w-4" }),
303
333
  "This asset was disposed",
304
334
  q.disposalDate ? ` on ${new Date(q.disposalDate).toLocaleDateString()}` : ""
305
335
  ]
306
336
  }),
307
- q.disposalMethod ? /* @__PURE__ */ g("p", {
337
+ q.disposalMethod ? /* @__PURE__ */ h("p", {
308
338
  className: "mt-1 text-sm text-text-secondary",
309
339
  children: ["Method: ", q.disposalMethod]
310
340
  }) : null,
311
- q.disposalNotes ? /* @__PURE__ */ h("p", {
341
+ q.disposalNotes ? /* @__PURE__ */ m("p", {
312
342
  className: "mt-1 text-sm text-text-secondary",
313
343
  children: q.disposalNotes
314
344
  }) : null
315
345
  ] }) : null,
316
- /* @__PURE__ */ g("div", {
346
+ /* @__PURE__ */ h("div", {
317
347
  className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-4",
318
348
  children: [
319
- /* @__PURE__ */ h(s, {
349
+ /* @__PURE__ */ m(s, {
320
350
  hero: !0,
321
351
  label: "Current value",
322
- value: N(q.currentValue),
323
- delta: q.purchaseValue == null ? void 0 : `of ${N(q.purchaseValue)}`,
352
+ value: M(q.currentValue),
353
+ delta: q.purchaseValue == null ? void 0 : `of ${M(q.purchaseValue)}`,
324
354
  deltaDirection: "neutral",
325
355
  spark: rt.length > 1 ? rt : void 0,
326
- icon: d
356
+ icon: le
327
357
  }),
328
- /* @__PURE__ */ h(s, {
358
+ /* @__PURE__ */ m(s, {
329
359
  label: "Maintenance records",
330
360
  value: J.length,
331
361
  delta: Y.length > 0 ? `${Y.length} open` : void 0,
332
362
  deltaTone: "neutral",
333
363
  deltaDirection: "neutral",
334
- icon: f
364
+ icon: u
335
365
  }),
336
- /* @__PURE__ */ h(s, {
366
+ /* @__PURE__ */ m(s, {
337
367
  label: "Registered",
338
368
  value: q.createdAt ? new Date(q.createdAt).toLocaleDateString() : "—",
339
- icon: se
369
+ icon: ce
340
370
  }),
341
- /* @__PURE__ */ h(s, {
371
+ /* @__PURE__ */ m(s, {
342
372
  label: "Location",
343
373
  value: q.locationName || "—",
344
- icon: ue
374
+ icon: fe
345
375
  })
346
376
  ]
347
377
  }),
348
- /* @__PURE__ */ g("div", {
378
+ /* @__PURE__ */ h("div", {
349
379
  className: "grid gap-6 lg:grid-cols-3",
350
- children: [/* @__PURE__ */ h("div", {
380
+ children: [/* @__PURE__ */ m("div", {
351
381
  className: "min-w-0 lg:col-span-2",
352
- children: /* @__PURE__ */ g(je, {
382
+ children: /* @__PURE__ */ h(Me, {
353
383
  defaultValue: "details",
354
384
  children: [
355
- /* @__PURE__ */ g(Me, {
385
+ /* @__PURE__ */ h(Ne, {
356
386
  className: "max-w-full justify-start overflow-x-auto",
357
387
  children: [
358
- /* @__PURE__ */ h(M, {
388
+ /* @__PURE__ */ m(j, {
359
389
  value: "details",
360
390
  children: "Details"
361
391
  }),
362
- /* @__PURE__ */ h(M, {
392
+ /* @__PURE__ */ m(j, {
363
393
  value: "financial",
364
394
  children: "Financial"
365
395
  }),
366
- /* @__PURE__ */ h(M, {
396
+ /* @__PURE__ */ m(j, {
367
397
  value: "maintenance",
368
398
  children: "Maintenance"
369
399
  }),
370
- /* @__PURE__ */ h(M, {
400
+ /* @__PURE__ */ m(j, {
371
401
  value: "discussion",
372
402
  children: "Discussion"
373
403
  })
374
404
  ]
375
405
  }),
376
- /* @__PURE__ */ g(j, {
406
+ /* @__PURE__ */ h(A, {
377
407
  value: "details",
378
408
  className: "mt-4 space-y-4",
379
409
  children: [
380
- q.description ? /* @__PURE__ */ h(F, {
410
+ q.description ? /* @__PURE__ */ m(P, {
381
411
  label: "Description",
382
412
  value: q.description,
383
413
  full: !0
384
414
  }) : null,
385
- /* @__PURE__ */ g("div", {
415
+ /* @__PURE__ */ h("div", {
386
416
  className: "grid gap-3 sm:grid-cols-2 xl:grid-cols-3",
387
417
  children: [
388
- /* @__PURE__ */ h(F, {
418
+ /* @__PURE__ */ m(P, {
389
419
  label: "Asset Tag",
390
420
  value: q.assetNumber,
391
- icon: ce,
421
+ icon: ue,
392
422
  mono: !0
393
423
  }),
394
- /* @__PURE__ */ h(F, {
424
+ /* @__PURE__ */ m(P, {
395
425
  label: "Serial Number",
396
426
  value: q.serialNumber || "—",
397
- icon: ce,
427
+ icon: ue,
398
428
  mono: !0
399
429
  }),
400
- /* @__PURE__ */ h(F, {
430
+ /* @__PURE__ */ m(P, {
401
431
  label: "Category",
402
432
  value: q.category.replace(/_/g, " "),
403
- icon: le,
433
+ icon: de,
404
434
  capitalize: !0
405
435
  }),
406
- /* @__PURE__ */ h(F, {
436
+ /* @__PURE__ */ m(P, {
407
437
  label: "Condition",
408
- icon: fe,
409
- children: /* @__PURE__ */ h("span", {
410
- className: `inline-flex rounded-full px-2.5 py-0.5 text-xs font-medium capitalize ${Re[q.condition] ?? ""}`,
438
+ icon: me,
439
+ children: /* @__PURE__ */ m("span", {
440
+ className: `inline-flex rounded-full px-2.5 py-0.5 text-xs font-medium capitalize ${ze[q.condition] ?? ""}`,
411
441
  children: q.condition
412
442
  })
413
443
  }),
414
- /* @__PURE__ */ h(F, {
444
+ /* @__PURE__ */ m(P, {
415
445
  label: "Assigned To",
416
446
  value: q.assignedTo || "—",
417
- icon: _e
447
+ icon: ye
418
448
  }),
419
- /* @__PURE__ */ h(F, {
420
- label: Ge("assethandler.asset.detail.nextService", "Next Service"),
421
- value: nt ? new Date(nt).toLocaleDateString() : "—",
422
- icon: f
449
+ /* @__PURE__ */ m(P, {
450
+ label: Ke("assethandler.asset.detail.nextService", "Next Service"),
451
+ value: X ? new Date(X).toLocaleDateString() : "—",
452
+ icon: u
423
453
  }),
424
- /* @__PURE__ */ h(F, {
454
+ /* @__PURE__ */ m(P, {
425
455
  label: "Department",
426
456
  value: q.department || "—",
427
- icon: oe
457
+ icon: se
428
458
  }),
429
- /* @__PURE__ */ h(F, {
459
+ /* @__PURE__ */ m(P, {
430
460
  label: "Location",
431
461
  value: q.locationName || "—",
432
- icon: ue
462
+ icon: fe
433
463
  }),
434
- /* @__PURE__ */ h(F, {
464
+ /* @__PURE__ */ m(P, {
435
465
  label: "Supplier",
436
466
  value: q.supplier || "—",
437
- icon: ge
467
+ icon: ve
438
468
  }),
439
- /* @__PURE__ */ h(F, {
469
+ /* @__PURE__ */ m(P, {
440
470
  label: "Warranty Expiry",
441
471
  value: q.warrantyExpiry ? new Date(q.warrantyExpiry).toLocaleDateString() : "—",
442
- icon: se
472
+ icon: ce
443
473
  })
444
474
  ]
445
475
  }),
446
- /* @__PURE__ */ h(i, {
476
+ /* @__PURE__ */ m(i, {
447
477
  entityType: "assethandler-asset",
448
478
  entityId: q.id
449
479
  })
450
480
  ]
451
481
  }),
452
- /* @__PURE__ */ g(j, {
482
+ /* @__PURE__ */ h(A, {
453
483
  value: "financial",
454
484
  className: "mt-4 space-y-6",
455
485
  children: [
456
- /* @__PURE__ */ g("div", {
486
+ /* @__PURE__ */ h("div", {
457
487
  className: "grid gap-4 sm:grid-cols-2 xl:grid-cols-4",
458
488
  children: [
459
- /* @__PURE__ */ h(s, {
489
+ /* @__PURE__ */ m(s, {
460
490
  label: "Purchase Value",
461
- value: N(q.purchaseValue)
491
+ value: M(q.purchaseValue)
462
492
  }),
463
- /* @__PURE__ */ h(s, {
493
+ /* @__PURE__ */ m(s, {
464
494
  hero: !0,
465
495
  label: "Current Book Value",
466
- value: N(q.currentValue)
496
+ value: M(q.currentValue)
467
497
  }),
468
- /* @__PURE__ */ h(s, {
498
+ /* @__PURE__ */ m(s, {
469
499
  label: "Accum. Depreciation",
470
- value: N(q.accumulatedDepreciation)
500
+ value: M(q.accumulatedDepreciation)
471
501
  }),
472
- /* @__PURE__ */ h(s, {
502
+ /* @__PURE__ */ m(s, {
473
503
  label: "Total Cost of Ownership",
474
- value: N(q.totalCostOfOwnership)
504
+ value: M(q.totalCostOfOwnership)
475
505
  })
476
506
  ]
477
507
  }),
478
- /* @__PURE__ */ g("div", {
508
+ /* @__PURE__ */ h("div", {
479
509
  className: "grid gap-4 lg:grid-cols-2",
480
- children: [/* @__PURE__ */ h(c, {
510
+ children: [/* @__PURE__ */ m(c, {
481
511
  title: "Depreciation & book value",
482
512
  subtitle: "Projected book value over the useful life",
483
- icon: he,
484
- children: Z.length > 0 ? /* @__PURE__ */ h(ee, {
513
+ icon: _e,
514
+ children: Z.length > 0 ? /* @__PURE__ */ m(ee, {
485
515
  data: Z,
486
516
  xKey: "year",
487
517
  height: 260,
@@ -491,40 +521,40 @@ function P() {
491
521
  key: "bookValue",
492
522
  label: "Book value"
493
523
  }]
494
- }) : /* @__PURE__ */ h("div", {
524
+ }) : /* @__PURE__ */ m("div", {
495
525
  className: "py-12 text-center text-sm text-text-secondary",
496
526
  children: "Add purchase value, useful life and salvage value to see the depreciation schedule."
497
527
  })
498
- }), /* @__PURE__ */ h(c, {
528
+ }), /* @__PURE__ */ m(c, {
499
529
  title: "Key facts",
500
530
  subtitle: "Purchase & depreciation terms",
501
- children: /* @__PURE__ */ g("dl", {
531
+ children: /* @__PURE__ */ h("dl", {
502
532
  className: "overflow-hidden rounded-lg border border-border-seam text-sm",
503
533
  children: [
504
- /* @__PURE__ */ h(I, {
534
+ /* @__PURE__ */ m(F, {
505
535
  label: "Purchase Date",
506
536
  value: q.purchaseDate ? new Date(q.purchaseDate).toLocaleDateString() : "—",
507
537
  striped: !0
508
538
  }),
509
- /* @__PURE__ */ h(I, {
539
+ /* @__PURE__ */ m(F, {
510
540
  label: "Useful Life",
511
541
  value: q.usefulLifeMonths ? `${q.usefulLifeMonths} months` : "—"
512
542
  }),
513
- /* @__PURE__ */ h(I, {
543
+ /* @__PURE__ */ m(F, {
514
544
  label: "Salvage Value",
515
- value: N(q.salvageValue),
545
+ value: M(q.salvageValue),
516
546
  striped: !0
517
547
  }),
518
- /* @__PURE__ */ h(I, {
548
+ /* @__PURE__ */ m(F, {
519
549
  label: "Depreciation Method",
520
- value: q.depreciationMethod ? Be[q.depreciationMethod.toUpperCase()] ?? q.depreciationMethod : "—"
550
+ value: q.depreciationMethod ? Ve[q.depreciationMethod.toUpperCase()] ?? q.depreciationMethod : "—"
521
551
  }),
522
- /* @__PURE__ */ h(I, {
552
+ /* @__PURE__ */ m(F, {
523
553
  label: "Supplier",
524
554
  value: q.supplier || "—",
525
555
  striped: !0
526
556
  }),
527
- /* @__PURE__ */ h(I, {
557
+ /* @__PURE__ */ m(F, {
528
558
  label: "Warranty Expiry",
529
559
  value: q.warrantyExpiry ? new Date(q.warrantyExpiry).toLocaleDateString() : "—"
530
560
  })
@@ -532,11 +562,11 @@ function P() {
532
562
  })
533
563
  })]
534
564
  }),
535
- Q.length > 0 ? /* @__PURE__ */ h(c, {
565
+ Q.length > 0 ? /* @__PURE__ */ m(c, {
536
566
  title: "Total cost of ownership",
537
567
  subtitle: "What drives lifetime cost",
538
- icon: d,
539
- children: /* @__PURE__ */ h(ne, {
568
+ icon: le,
569
+ children: /* @__PURE__ */ m(ne, {
540
570
  data: Q,
541
571
  centerLabel: "TCO",
542
572
  centerValue: Q.reduce((e, t) => e + t.value, 0),
@@ -546,14 +576,14 @@ function P() {
546
576
  }) : null
547
577
  ]
548
578
  }),
549
- /* @__PURE__ */ g(j, {
579
+ /* @__PURE__ */ h(A, {
550
580
  value: "maintenance",
551
581
  className: "mt-4 space-y-4",
552
- children: [it.length > 0 ? /* @__PURE__ */ h(c, {
582
+ children: [it.length > 0 ? /* @__PURE__ */ m(c, {
553
583
  title: "Maintenance cost history",
554
584
  subtitle: "Recorded cost per maintenance event",
555
- icon: f,
556
- children: /* @__PURE__ */ h(te, {
585
+ icon: u,
586
+ children: /* @__PURE__ */ m(te, {
557
587
  data: it,
558
588
  xKey: "label",
559
589
  height: 220,
@@ -563,223 +593,223 @@ function P() {
563
593
  label: "Cost"
564
594
  }]
565
595
  })
566
- }) : null, /* @__PURE__ */ g(Se, { children: [/* @__PURE__ */ g(Te, { children: [/* @__PURE__ */ g(Ee, {
596
+ }) : null, /* @__PURE__ */ h(Ce, { children: [/* @__PURE__ */ h(Ee, { children: [/* @__PURE__ */ h(De, {
567
597
  className: "flex items-center gap-2",
568
- children: [/* @__PURE__ */ h(f, { className: "h-4 w-4" }), "Maintenance History"]
569
- }), /* @__PURE__ */ g(we, { children: [J.length, " records found"] })] }), /* @__PURE__ */ h(Ce, { children: J.length === 0 ? /* @__PURE__ */ h("p", {
598
+ children: [/* @__PURE__ */ m(u, { className: "h-4 w-4" }), "Maintenance History"]
599
+ }), /* @__PURE__ */ h(Te, { children: [J.length, " records found"] })] }), /* @__PURE__ */ m(we, { children: J.length === 0 ? /* @__PURE__ */ m("p", {
570
600
  className: "py-8 text-center text-text-secondary",
571
601
  children: "No maintenance records for this asset."
572
- }) : /* @__PURE__ */ h("div", {
602
+ }) : /* @__PURE__ */ m("div", {
573
603
  className: "space-y-3",
574
- children: J.map((e) => /* @__PURE__ */ h("div", {
604
+ children: J.map((e) => /* @__PURE__ */ m("div", {
575
605
  className: "flex items-start gap-4 rounded-lg border p-4",
576
- children: /* @__PURE__ */ g("div", {
606
+ children: /* @__PURE__ */ h("div", {
577
607
  className: "flex-1",
578
608
  children: [
579
- /* @__PURE__ */ g("div", {
609
+ /* @__PURE__ */ h("div", {
580
610
  className: "flex items-center gap-2",
581
- children: [/* @__PURE__ */ h(xe, {
611
+ children: [/* @__PURE__ */ m(Se, {
582
612
  variant: "outline",
583
613
  className: "capitalize",
584
614
  children: e.type
585
- }), /* @__PURE__ */ h("span", {
615
+ }), /* @__PURE__ */ m("span", {
586
616
  className: `rounded-full px-2.5 py-0.5 text-xs font-medium capitalize ${e.status === "completed" ? "bg-status-success-bg-subtle text-status-success-text" : "bg-status-warning-bg-subtle text-status-warning-text"}`,
587
617
  children: e.status.replace(/_/g, " ")
588
618
  })]
589
619
  }),
590
- /* @__PURE__ */ h("p", {
620
+ /* @__PURE__ */ m("p", {
591
621
  className: "mt-1 font-medium",
592
622
  children: e.title
593
623
  }),
594
- /* @__PURE__ */ h("p", {
624
+ /* @__PURE__ */ m("p", {
595
625
  className: "text-sm text-text-secondary",
596
626
  children: e.description
597
627
  }),
598
- /* @__PURE__ */ g("div", {
628
+ /* @__PURE__ */ h("div", {
599
629
  className: "mt-2 flex gap-4 text-xs text-text-secondary",
600
- children: [/* @__PURE__ */ g("span", { children: [
630
+ children: [/* @__PURE__ */ h("span", { children: [
601
631
  "Scheduled:",
602
632
  " ",
603
633
  e.scheduledDate ? new Date(e.scheduledDate).toLocaleDateString() : "—"
604
- ] }), e.actualCost != null || e.estimatedCost != null ? /* @__PURE__ */ g("span", { children: ["Cost: ", N(e.actualCost ?? e.estimatedCost)] }) : null]
634
+ ] }), e.actualCost != null || e.estimatedCost != null ? /* @__PURE__ */ h("span", { children: ["Cost: ", M(e.actualCost ?? e.estimatedCost)] }) : null]
605
635
  })
606
636
  ]
607
637
  })
608
638
  }, e.id))
609
639
  }) })] })]
610
640
  }),
611
- /* @__PURE__ */ h(j, {
641
+ /* @__PURE__ */ m(A, {
612
642
  value: "discussion",
613
643
  className: "mt-4",
614
- children: /* @__PURE__ */ h(a, {
644
+ children: /* @__PURE__ */ m(a, {
615
645
  entityType: "assethandler-asset",
616
646
  entityId: q.id
617
647
  })
618
648
  })
619
649
  ]
620
650
  })
621
- }), /* @__PURE__ */ g("aside", {
651
+ }), /* @__PURE__ */ h("aside", {
622
652
  className: "space-y-6",
623
- children: [/* @__PURE__ */ h(Oe, {
653
+ children: [/* @__PURE__ */ m(ke, {
624
654
  treatment: "glass",
625
655
  className: "border-border-seam",
626
- children: /* @__PURE__ */ g("div", {
656
+ children: /* @__PURE__ */ h("div", {
627
657
  className: "space-y-3 p-5",
628
- children: [/* @__PURE__ */ g("h3", {
658
+ children: [/* @__PURE__ */ h("h3", {
629
659
  className: "flex items-center gap-2 text-sm font-semibold",
630
- children: [/* @__PURE__ */ h(pe, { className: "h-4 w-4 text-text-secondary" }), "Tags"]
631
- }), q.tags.length === 0 ? /* @__PURE__ */ h("p", {
660
+ children: [/* @__PURE__ */ m(he, { className: "h-4 w-4 text-text-secondary" }), "Tags"]
661
+ }), q.tags.length === 0 ? /* @__PURE__ */ m("p", {
632
662
  className: "text-xs text-text-secondary",
633
663
  children: "No tags yet"
634
- }) : /* @__PURE__ */ h("div", {
664
+ }) : /* @__PURE__ */ m("div", {
635
665
  className: "flex flex-wrap gap-1.5",
636
- children: q.tags.map((e) => /* @__PURE__ */ h("span", {
666
+ children: q.tags.map((e) => /* @__PURE__ */ m("span", {
637
667
  className: "rounded-full bg-action-primary-bg/10 px-2.5 py-0.5 text-xs font-medium text-action-primary-bg",
638
668
  children: e
639
669
  }, e))
640
670
  })]
641
671
  })
642
- }), /* @__PURE__ */ h(re, { resourceId: q.id })]
672
+ }), /* @__PURE__ */ m(re, { resourceId: q.id })]
643
673
  })]
644
674
  }),
645
- /* @__PURE__ */ h(b, {
675
+ /* @__PURE__ */ m(y, {
646
676
  open: Ye,
647
677
  onOpenChange: L,
648
- children: /* @__PURE__ */ g(x, {
678
+ children: /* @__PURE__ */ h(b, {
649
679
  className: "max-h-[85vh] overflow-y-auto sm:max-w-2xl",
650
- children: [/* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, { children: "Edit asset" }), /* @__PURE__ */ h(S, { children: "Update this asset's details and financials." })] }), B ? /* @__PURE__ */ g("form", {
680
+ children: [/* @__PURE__ */ h(C, { children: [/* @__PURE__ */ m(w, { children: "Edit asset" }), /* @__PURE__ */ m(x, { children: "Update this asset's details and financials." })] }), B ? /* @__PURE__ */ h("form", {
651
681
  className: "space-y-4",
652
682
  onSubmit: st,
653
683
  children: [
654
- /* @__PURE__ */ g("div", {
684
+ /* @__PURE__ */ h("div", {
655
685
  className: "grid gap-4 md:grid-cols-2",
656
- children: [/* @__PURE__ */ g("div", {
686
+ children: [/* @__PURE__ */ h("div", {
657
687
  className: "space-y-2",
658
- children: [/* @__PURE__ */ h(y, { children: "Name" }), /* @__PURE__ */ h(v, {
688
+ children: [/* @__PURE__ */ m(v, { children: "Name" }), /* @__PURE__ */ m(_, {
659
689
  value: B.name,
660
690
  onChange: (e) => $("name", e.target.value)
661
691
  })]
662
- }), /* @__PURE__ */ g("div", {
692
+ }), /* @__PURE__ */ h("div", {
663
693
  className: "space-y-2",
664
- children: [/* @__PURE__ */ h(y, { children: "Category" }), /* @__PURE__ */ h(v, {
694
+ children: [/* @__PURE__ */ m(v, { children: "Category" }), /* @__PURE__ */ m(_, {
665
695
  value: B.category,
666
696
  onChange: (e) => $("category", e.target.value)
667
697
  })]
668
698
  })]
669
699
  }),
670
- /* @__PURE__ */ g("div", {
700
+ /* @__PURE__ */ h("div", {
671
701
  className: "space-y-2",
672
- children: [/* @__PURE__ */ h(y, { children: "Description" }), /* @__PURE__ */ h(Ne, {
702
+ children: [/* @__PURE__ */ m(v, { children: "Description" }), /* @__PURE__ */ m(Pe, {
673
703
  value: B.description,
674
704
  onChange: (e) => $("description", e.target.value),
675
705
  rows: 2
676
706
  })]
677
707
  }),
678
- /* @__PURE__ */ g("div", {
708
+ /* @__PURE__ */ h("div", {
679
709
  className: "grid gap-4 md:grid-cols-3",
680
710
  children: [
681
- /* @__PURE__ */ g("div", {
711
+ /* @__PURE__ */ h("div", {
682
712
  className: "space-y-2",
683
- children: [/* @__PURE__ */ h(y, { children: "Status" }), /* @__PURE__ */ g(E, {
713
+ children: [/* @__PURE__ */ m(v, { children: "Status" }), /* @__PURE__ */ h(T, {
684
714
  value: B.status,
685
715
  onValueChange: (e) => $("status", e),
686
- children: [/* @__PURE__ */ h(k, { children: /* @__PURE__ */ h(A, {}) }), /* @__PURE__ */ g(D, { children: [
687
- /* @__PURE__ */ h(O, {
716
+ children: [/* @__PURE__ */ m(O, { children: /* @__PURE__ */ m(k, {}) }), /* @__PURE__ */ h(E, { children: [
717
+ /* @__PURE__ */ m(D, {
688
718
  value: "ACTIVE",
689
719
  children: "Active"
690
720
  }),
691
- /* @__PURE__ */ h(O, {
721
+ /* @__PURE__ */ m(D, {
692
722
  value: "INACTIVE",
693
723
  children: "Inactive"
694
724
  }),
695
- /* @__PURE__ */ h(O, {
725
+ /* @__PURE__ */ m(D, {
696
726
  value: "MAINTENANCE",
697
727
  children: "Maintenance"
698
728
  }),
699
- /* @__PURE__ */ h(O, {
729
+ /* @__PURE__ */ m(D, {
700
730
  value: "RETIRED",
701
731
  children: "Retired"
702
732
  })
703
733
  ] })]
704
734
  })]
705
735
  }),
706
- /* @__PURE__ */ g("div", {
736
+ /* @__PURE__ */ h("div", {
707
737
  className: "space-y-2",
708
- children: [/* @__PURE__ */ h(y, { children: "Condition" }), /* @__PURE__ */ g(E, {
738
+ children: [/* @__PURE__ */ m(v, { children: "Condition" }), /* @__PURE__ */ h(T, {
709
739
  value: B.condition,
710
740
  onValueChange: (e) => $("condition", e),
711
- children: [/* @__PURE__ */ h(k, { children: /* @__PURE__ */ h(A, {}) }), /* @__PURE__ */ g(D, { children: [
712
- /* @__PURE__ */ h(O, {
741
+ children: [/* @__PURE__ */ m(O, { children: /* @__PURE__ */ m(k, {}) }), /* @__PURE__ */ h(E, { children: [
742
+ /* @__PURE__ */ m(D, {
713
743
  value: "EXCELLENT",
714
744
  children: "Excellent"
715
745
  }),
716
- /* @__PURE__ */ h(O, {
746
+ /* @__PURE__ */ m(D, {
717
747
  value: "GOOD",
718
748
  children: "Good"
719
749
  }),
720
- /* @__PURE__ */ h(O, {
750
+ /* @__PURE__ */ m(D, {
721
751
  value: "FAIR",
722
752
  children: "Fair"
723
753
  }),
724
- /* @__PURE__ */ h(O, {
754
+ /* @__PURE__ */ m(D, {
725
755
  value: "POOR",
726
756
  children: "Poor"
727
757
  }),
728
- /* @__PURE__ */ h(O, {
758
+ /* @__PURE__ */ m(D, {
729
759
  value: "DAMAGED",
730
760
  children: "Damaged"
731
761
  })
732
762
  ] })]
733
763
  })]
734
764
  }),
735
- /* @__PURE__ */ g("div", {
765
+ /* @__PURE__ */ h("div", {
736
766
  className: "space-y-2",
737
- children: [/* @__PURE__ */ h(y, { children: "Department" }), /* @__PURE__ */ h(v, {
767
+ children: [/* @__PURE__ */ m(v, { children: "Department" }), /* @__PURE__ */ m(_, {
738
768
  value: B.department,
739
769
  onChange: (e) => $("department", e.target.value)
740
770
  })]
741
771
  })
742
772
  ]
743
773
  }),
744
- /* @__PURE__ */ g("div", {
774
+ /* @__PURE__ */ h("div", {
745
775
  className: "grid gap-4 md:grid-cols-2",
746
776
  children: [
747
- /* @__PURE__ */ g("div", {
777
+ /* @__PURE__ */ h("div", {
748
778
  className: "space-y-2",
749
- children: [/* @__PURE__ */ h(y, { children: "Serial Number" }), /* @__PURE__ */ h(v, {
779
+ children: [/* @__PURE__ */ m(v, { children: "Serial Number" }), /* @__PURE__ */ m(_, {
750
780
  value: B.serialNumber,
751
781
  onChange: (e) => $("serialNumber", e.target.value)
752
782
  })]
753
783
  }),
754
- /* @__PURE__ */ g("div", {
784
+ /* @__PURE__ */ h("div", {
755
785
  className: "space-y-2",
756
- children: [/* @__PURE__ */ h(y, { children: "Assigned To" }), /* @__PURE__ */ h(v, {
786
+ children: [/* @__PURE__ */ m(v, { children: "Assigned To" }), /* @__PURE__ */ m(_, {
757
787
  value: B.assignedTo,
758
788
  onChange: (e) => $("assignedTo", e.target.value)
759
789
  })]
760
790
  }),
761
- /* @__PURE__ */ g("div", {
791
+ /* @__PURE__ */ h("div", {
762
792
  className: "space-y-2",
763
- children: [/* @__PURE__ */ h(y, { children: "Location" }), /* @__PURE__ */ h(v, {
793
+ children: [/* @__PURE__ */ m(v, { children: "Location" }), /* @__PURE__ */ m(_, {
764
794
  value: B.locationName,
765
795
  onChange: (e) => $("locationName", e.target.value)
766
796
  })]
767
797
  }),
768
- /* @__PURE__ */ g("div", {
798
+ /* @__PURE__ */ h("div", {
769
799
  className: "space-y-2",
770
- children: [/* @__PURE__ */ h(y, { children: "Supplier" }), /* @__PURE__ */ h(v, {
800
+ children: [/* @__PURE__ */ m(v, { children: "Supplier" }), /* @__PURE__ */ m(_, {
771
801
  value: B.supplier,
772
802
  onChange: (e) => $("supplier", e.target.value)
773
803
  })]
774
804
  })
775
805
  ]
776
806
  }),
777
- /* @__PURE__ */ g("div", {
807
+ /* @__PURE__ */ h("div", {
778
808
  className: "grid gap-4 md:grid-cols-4",
779
809
  children: [
780
- /* @__PURE__ */ g("div", {
810
+ /* @__PURE__ */ h("div", {
781
811
  className: "space-y-2",
782
- children: [/* @__PURE__ */ h(y, { children: "Purchase Value" }), /* @__PURE__ */ h(v, {
812
+ children: [/* @__PURE__ */ m(v, { children: "Purchase Value" }), /* @__PURE__ */ m(_, {
783
813
  type: "number",
784
814
  min: "0",
785
815
  step: "0.01",
@@ -787,9 +817,9 @@ function P() {
787
817
  onChange: (e) => $("purchaseValue", e.target.value)
788
818
  })]
789
819
  }),
790
- /* @__PURE__ */ g("div", {
820
+ /* @__PURE__ */ h("div", {
791
821
  className: "space-y-2",
792
- children: [/* @__PURE__ */ h(y, { children: "Salvage Value" }), /* @__PURE__ */ h(v, {
822
+ children: [/* @__PURE__ */ m(v, { children: "Salvage Value" }), /* @__PURE__ */ m(_, {
793
823
  type: "number",
794
824
  min: "0",
795
825
  step: "0.01",
@@ -797,9 +827,9 @@ function P() {
797
827
  onChange: (e) => $("salvageValue", e.target.value)
798
828
  })]
799
829
  }),
800
- /* @__PURE__ */ g("div", {
830
+ /* @__PURE__ */ h("div", {
801
831
  className: "space-y-2",
802
- children: [/* @__PURE__ */ h(y, { children: "Useful Life (mo)" }), /* @__PURE__ */ h(v, {
832
+ children: [/* @__PURE__ */ m(v, { children: "Useful Life (mo)" }), /* @__PURE__ */ m(_, {
803
833
  type: "number",
804
834
  min: "0",
805
835
  step: "1",
@@ -807,36 +837,67 @@ function P() {
807
837
  onChange: (e) => $("usefulLifeMonths", e.target.value)
808
838
  })]
809
839
  }),
810
- /* @__PURE__ */ g("div", {
840
+ /* @__PURE__ */ h("div", {
811
841
  className: "space-y-2",
812
- children: [/* @__PURE__ */ h(y, { children: "Depreciation" }), /* @__PURE__ */ g(E, {
842
+ children: [/* @__PURE__ */ m(v, { children: "Depreciation" }), /* @__PURE__ */ h(T, {
813
843
  value: B.depreciationMethod,
814
844
  onValueChange: (e) => $("depreciationMethod", e),
815
- children: [/* @__PURE__ */ h(k, { children: /* @__PURE__ */ h(A, {}) }), /* @__PURE__ */ g(D, { children: [
816
- /* @__PURE__ */ h(O, {
845
+ children: [/* @__PURE__ */ m(O, { children: /* @__PURE__ */ m(k, {}) }), /* @__PURE__ */ h(E, { children: [
846
+ /* @__PURE__ */ m(D, {
817
847
  value: "STRAIGHT_LINE",
818
848
  children: "Straight line"
819
849
  }),
820
- /* @__PURE__ */ h(O, {
850
+ /* @__PURE__ */ m(D, {
821
851
  value: "REDUCING_BALANCE",
822
- children: "Reducing balance"
852
+ children: "Reducing balance (200%)"
853
+ }),
854
+ /* @__PURE__ */ m(D, {
855
+ value: "DECLINING_BALANCE",
856
+ children: "Declining balance (150%)"
823
857
  }),
824
- /* @__PURE__ */ h(O, {
858
+ /* @__PURE__ */ m(D, {
859
+ value: "SUM_OF_YEARS_DIGITS",
860
+ children: "Sum of years' digits"
861
+ }),
862
+ /* @__PURE__ */ m(D, {
863
+ value: "UNITS_OF_PRODUCTION",
864
+ children: "Units of production"
865
+ }),
866
+ /* @__PURE__ */ m(D, {
825
867
  value: "NONE",
826
868
  children: "None"
827
869
  })
828
870
  ] })]
829
871
  })]
830
- })
872
+ }),
873
+ B.depreciationMethod === "UNITS_OF_PRODUCTION" ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ h("div", {
874
+ className: "space-y-2",
875
+ children: [/* @__PURE__ */ m(v, { children: "Lifetime Capacity (units)" }), /* @__PURE__ */ m(_, {
876
+ type: "number",
877
+ min: "0",
878
+ step: "1",
879
+ value: B.unitsOfProductionCapacity,
880
+ onChange: (e) => $("unitsOfProductionCapacity", e.target.value)
881
+ })]
882
+ }), /* @__PURE__ */ h("div", {
883
+ className: "space-y-2",
884
+ children: [/* @__PURE__ */ m(v, { children: "Units Produced To Date" }), /* @__PURE__ */ m(_, {
885
+ type: "number",
886
+ min: "0",
887
+ step: "1",
888
+ value: B.unitsProduced,
889
+ onChange: (e) => $("unitsProduced", e.target.value)
890
+ })]
891
+ })] }) : null
831
892
  ]
832
893
  }),
833
- /* @__PURE__ */ g(C, { children: [/* @__PURE__ */ h(_, {
894
+ /* @__PURE__ */ h(S, { children: [/* @__PURE__ */ m(g, {
834
895
  type: "button",
835
896
  variant: "outline",
836
897
  onClick: () => L(!1),
837
898
  disabled: U,
838
899
  children: "Cancel"
839
- }), /* @__PURE__ */ h(_, {
900
+ }), /* @__PURE__ */ m(g, {
840
901
  type: "submit",
841
902
  disabled: U,
842
903
  children: U ? "Saving…" : "Save changes"
@@ -845,16 +906,16 @@ function P() {
845
906
  }) : null]
846
907
  })
847
908
  }),
848
- /* @__PURE__ */ h(b, {
909
+ /* @__PURE__ */ m(y, {
849
910
  open: Xe,
850
911
  onOpenChange: R,
851
- children: /* @__PURE__ */ g(x, { children: [/* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, { children: "Dispose asset" }), /* @__PURE__ */ h(S, { children: "Record the disposal of this asset. It will be marked as disposed and removed from active inventory." })] }), /* @__PURE__ */ g("form", {
912
+ children: /* @__PURE__ */ h(b, { children: [/* @__PURE__ */ h(C, { children: [/* @__PURE__ */ m(w, { children: "Dispose asset" }), /* @__PURE__ */ m(x, { children: "Record the disposal of this asset. It will be marked as disposed and removed from active inventory." })] }), /* @__PURE__ */ h("form", {
852
913
  className: "space-y-4",
853
914
  onSubmit: ct,
854
915
  children: [
855
- /* @__PURE__ */ g("div", {
916
+ /* @__PURE__ */ h("div", {
856
917
  className: "space-y-2",
857
- children: [/* @__PURE__ */ h(y, { children: "Disposal Date" }), /* @__PURE__ */ h(v, {
918
+ children: [/* @__PURE__ */ m(v, { children: "Disposal Date" }), /* @__PURE__ */ m(_, {
858
919
  type: "date",
859
920
  value: V.disposalDate,
860
921
  onChange: (e) => H((t) => ({
@@ -863,9 +924,9 @@ function P() {
863
924
  }))
864
925
  })]
865
926
  }),
866
- /* @__PURE__ */ g("div", {
927
+ /* @__PURE__ */ h("div", {
867
928
  className: "space-y-2",
868
- children: [/* @__PURE__ */ h(y, { children: "Method" }), /* @__PURE__ */ h(v, {
929
+ children: [/* @__PURE__ */ m(v, { children: "Method" }), /* @__PURE__ */ m(_, {
869
930
  placeholder: "e.g., Sold, Recycled, Scrapped",
870
931
  value: V.method,
871
932
  onChange: (e) => H((t) => ({
@@ -874,9 +935,9 @@ function P() {
874
935
  }))
875
936
  })]
876
937
  }),
877
- /* @__PURE__ */ g("div", {
938
+ /* @__PURE__ */ h("div", {
878
939
  className: "space-y-2",
879
- children: [/* @__PURE__ */ h(y, { children: "Notes" }), /* @__PURE__ */ h(Ne, {
940
+ children: [/* @__PURE__ */ m(v, { children: "Notes" }), /* @__PURE__ */ m(Pe, {
880
941
  placeholder: "Optional details about the disposal",
881
942
  value: V.notes,
882
943
  onChange: (e) => H((t) => ({
@@ -886,13 +947,13 @@ function P() {
886
947
  rows: 2
887
948
  })]
888
949
  }),
889
- /* @__PURE__ */ g(C, { children: [/* @__PURE__ */ h(_, {
950
+ /* @__PURE__ */ h(S, { children: [/* @__PURE__ */ m(g, {
890
951
  type: "button",
891
952
  variant: "outline",
892
953
  onClick: () => R(!1),
893
954
  disabled: W,
894
955
  children: "Cancel"
895
- }), /* @__PURE__ */ h(_, {
956
+ }), /* @__PURE__ */ m(g, {
896
957
  type: "submit",
897
958
  disabled: W,
898
959
  children: W ? "Disposing…" : "Confirm disposal"
@@ -900,22 +961,22 @@ function P() {
900
961
  ]
901
962
  })] })
902
963
  }),
903
- /* @__PURE__ */ h(b, {
964
+ /* @__PURE__ */ m(y, {
904
965
  open: Ze,
905
966
  onOpenChange: z,
906
- children: /* @__PURE__ */ g(x, { children: [/* @__PURE__ */ g(w, { children: [/* @__PURE__ */ h(T, { children: "Delete asset" }), /* @__PURE__ */ g(S, { children: [
967
+ children: /* @__PURE__ */ h(b, { children: [/* @__PURE__ */ h(C, { children: [/* @__PURE__ */ m(w, { children: "Delete asset" }), /* @__PURE__ */ h(x, { children: [
907
968
  "This removes ",
908
- /* @__PURE__ */ h("span", {
969
+ /* @__PURE__ */ m("span", {
909
970
  className: "font-medium",
910
971
  children: q.name
911
972
  }),
912
973
  " from the inventory. This action cannot be undone."
913
- ] })] }), /* @__PURE__ */ g(C, { children: [/* @__PURE__ */ h(_, {
974
+ ] })] }), /* @__PURE__ */ h(S, { children: [/* @__PURE__ */ m(g, {
914
975
  variant: "outline",
915
976
  onClick: () => z(!1),
916
977
  disabled: G,
917
978
  children: "Cancel"
918
- }), /* @__PURE__ */ h(_, {
979
+ }), /* @__PURE__ */ m(g, {
919
980
  variant: "destructive",
920
981
  onClick: () => void tt({ variables: { id: q.id } }),
921
982
  disabled: G,
@@ -925,34 +986,34 @@ function P() {
925
986
  ]
926
987
  });
927
988
  }
928
- function F({ label: e, value: t, icon: n, mono: r, capitalize: i, full: a, children: o }) {
929
- return /* @__PURE__ */ g("div", {
989
+ function P({ label: e, value: t, icon: n, mono: r, capitalize: i, full: a, children: o }) {
990
+ return /* @__PURE__ */ h("div", {
930
991
  className: `rounded-lg border border-border-seam bg-bg-surface p-3.5 ${a ? "sm:col-span-2 xl:col-span-3" : ""}`,
931
- children: [/* @__PURE__ */ g("p", {
992
+ children: [/* @__PURE__ */ h("p", {
932
993
  className: "flex items-center gap-1.5 text-xs text-text-secondary",
933
- children: [n ? /* @__PURE__ */ h(n, { className: "h-3.5 w-3.5" }) : null, e]
934
- }), o ? /* @__PURE__ */ h("div", {
994
+ children: [n ? /* @__PURE__ */ m(n, { className: "h-3.5 w-3.5" }) : null, e]
995
+ }), o ? /* @__PURE__ */ m("div", {
935
996
  className: "mt-1.5",
936
997
  children: o
937
- }) : /* @__PURE__ */ h("p", {
998
+ }) : /* @__PURE__ */ m("p", {
938
999
  className: `mt-1 break-words font-medium ${r ? "font-mono text-sm" : ""} ${i ? "capitalize" : ""}`,
939
1000
  children: t
940
1001
  })]
941
1002
  });
942
1003
  }
943
- function I({ label: e, value: t, striped: n }) {
944
- return /* @__PURE__ */ g("div", {
1004
+ function F({ label: e, value: t, striped: n }) {
1005
+ return /* @__PURE__ */ h("div", {
945
1006
  className: `flex items-center justify-between gap-4 px-3.5 py-2.5 ${n ? "bg-bg-sunken/40" : ""}`,
946
- children: [/* @__PURE__ */ h("dt", {
1007
+ children: [/* @__PURE__ */ m("dt", {
947
1008
  className: "shrink-0 text-text-secondary",
948
1009
  children: e
949
- }), /* @__PURE__ */ h("dd", {
1010
+ }), /* @__PURE__ */ m("dd", {
950
1011
  className: "truncate text-right font-medium",
951
1012
  children: t
952
1013
  })]
953
1014
  });
954
1015
  }
955
1016
  //#endregion
956
- export { P as AssetsAssetDetailPage };
1017
+ export { N as AssetsAssetDetailPage };
957
1018
 
958
1019
  //# sourceMappingURL=AssetsAssetDetailPage.js.map