@burdenoff/microfe-assethandler 2026.710.1 → 2026.713.2

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 (36) hide show
  1. package/dist/assethandler/AssetHandlerRoot.d.ts.map +1 -1
  2. package/dist/assethandler/AssetHandlerRoot.js +16 -8
  3. package/dist/assethandler/AssetHandlerRoot.js.map +1 -1
  4. package/dist/assethandler/components/AttachmentsPanel.d.ts.map +1 -1
  5. package/dist/assethandler/components/AttachmentsPanel.js.map +1 -1
  6. package/dist/assethandler/pages/AssetsAssetCategoriesPage.d.ts.map +1 -1
  7. package/dist/assethandler/pages/AssetsAssetCategoriesPage.js +144 -137
  8. package/dist/assethandler/pages/AssetsAssetCategoriesPage.js.map +1 -1
  9. package/dist/assethandler/pages/AssetsAssetCreatePage.d.ts.map +1 -1
  10. package/dist/assethandler/pages/AssetsAssetCreatePage.js +202 -201
  11. package/dist/assethandler/pages/AssetsAssetCreatePage.js.map +1 -1
  12. package/dist/assethandler/pages/AssetsAssetListPage.d.ts.map +1 -1
  13. package/dist/assethandler/pages/AssetsAssetListPage.js +135 -132
  14. package/dist/assethandler/pages/AssetsAssetListPage.js.map +1 -1
  15. package/dist/assethandler/providers/AssetHandlerProvider.d.ts +14 -0
  16. package/dist/assethandler/providers/AssetHandlerProvider.d.ts.map +1 -1
  17. package/dist/assethandler/providers/AssetHandlerProvider.js +14 -2
  18. package/dist/assethandler/providers/AssetHandlerProvider.js.map +1 -1
  19. package/dist/assethandler/store/assethandlerStore.d.ts.map +1 -1
  20. package/dist/assethandler/store/assethandlerStore.js.map +1 -1
  21. package/dist/assethandler/types/index.d.ts +32 -0
  22. package/dist/assethandler/types/index.d.ts.map +1 -1
  23. package/dist/services/createSandboxAssistantTransport.d.ts +8 -26
  24. package/dist/services/createSandboxAssistantTransport.d.ts.map +1 -1
  25. package/dist/services/createSandboxAssistantTransport.js +8 -114
  26. package/dist/services/createSandboxAssistantTransport.js.map +1 -1
  27. package/dist/types/assistant.d.ts.map +1 -1
  28. package/dist/utils/pageContext.d.ts.map +1 -1
  29. package/dist/utils/pageContext.js.map +1 -1
  30. package/package.json +2 -2
  31. package/dist/generated/wspace-operations.js +0 -255
  32. package/dist/generated/wspace-operations.js.map +0 -1
  33. package/dist/services/assistantApi.d.ts +0 -71
  34. package/dist/services/assistantApi.d.ts.map +0 -1
  35. package/dist/services/assistantApi.js +0 -215
  36. package/dist/services/assistantApi.js.map +0 -1
@@ -1,18 +1,19 @@
1
1
  import { useAssetHandlerStore as e } from "../store/assethandlerStore.js";
2
- import { useAssetHandlerNavigate as t } from "../hooks/useAssetHandlerNavigate.js";
3
- import { notify as n } from "../utils/toast.js";
4
- import { formatCurrencyCompact as r } from "../components/charts/chartTheme.js";
5
- import { TrendChart as i } from "../components/charts/TrendChart.js";
6
- import { ChartCard as a } from "../components/ChartCard.js";
2
+ import { useHiddenCategoryIds as t } from "../providers/AssetHandlerProvider.js";
3
+ import { useAssetHandlerNavigate as n } from "../hooks/useAssetHandlerNavigate.js";
4
+ import { notify as r } from "../utils/toast.js";
5
+ import { formatCurrencyCompact as i } from "../components/charts/chartTheme.js";
6
+ import { TrendChart as a } from "../components/charts/TrendChart.js";
7
+ import { ChartCard as o } from "../components/ChartCard.js";
7
8
  import "../components/index.js";
8
- import { useMemo as o, useRef as s, useState as c } from "react";
9
- import { ArrowLeft as ee, Info as l, Loader2 as u, Save as d, TrendingDown as f, X as p } from "lucide-react";
10
- import { gql as m } from "@apollo/client";
11
- import { useMutation as h } from "@apollo/client/react";
12
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
13
- import { Badge as v, Button as y, GlassCard as b, GradientText as x, Input as S, Label as C, PagePurpose as w, Select as T, SelectContent as E, SelectItem as D, SelectTrigger as O, SelectValue as k, Textarea as A } from "@burdenoff/fe-libs/ui";
9
+ import { useMemo as s, useRef as c, useState as l } from "react";
10
+ import { ArrowLeft as u, Info as d, Loader2 as f, Save as p, TrendingDown as m, X as h } from "lucide-react";
11
+ import { gql as g } from "@apollo/client";
12
+ import { useMutation as ee } from "@apollo/client/react";
13
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
14
+ import { Badge as y, Button as b, GlassCard as x, GradientText as S, Input as C, Label as w, PagePurpose as T, Select as E, SelectContent as D, SelectItem as O, SelectTrigger as k, SelectValue as A, Textarea as j } from "@burdenoff/fe-libs/ui";
14
15
  //#region src/assethandler/pages/AssetsAssetCreatePage.tsx
15
- var j = m`
16
+ var M = g`
16
17
  mutation AssetHandlerCreateAsset($input: CreateAssetInput!) {
17
18
  createAsset(input: $input) {
18
19
  id
@@ -20,7 +21,7 @@ var j = m`
20
21
  name
21
22
  }
22
23
  }
23
- `, M = [
24
+ `, te = [
24
25
  "electronics",
25
26
  "it_hardware",
26
27
  "furniture",
@@ -65,71 +66,71 @@ function P(e) {
65
66
  }
66
67
  return o;
67
68
  }
68
- var F = ({ title: e, description: t, children: n, glow: r }) => /* @__PURE__ */ g(b, {
69
+ var F = ({ title: e, description: t, children: n, glow: r }) => /* @__PURE__ */ _(x, {
69
70
  treatment: "glass",
70
71
  glow: r,
71
72
  className: "border-border-seam",
72
- children: /* @__PURE__ */ _("div", {
73
+ children: /* @__PURE__ */ v("div", {
73
74
  className: "space-y-4 p-5 sm:p-6",
74
- children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h2", {
75
+ children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("h2", {
75
76
  className: "text-lg font-semibold",
76
77
  children: e
77
- }), t ? /* @__PURE__ */ g("p", {
78
+ }), t ? /* @__PURE__ */ _("p", {
78
79
  className: "mt-0.5 text-sm text-text-secondary",
79
80
  children: t
80
81
  }) : null] }), n]
81
82
  })
82
83
  });
83
84
  function I() {
84
- let m = t(), { assets: b } = e(), [I, L] = c(N), [R, z] = c([]), [B, V] = c(""), [H, U] = c({}), [W, G] = c(null), K = s(!1), q = o(() => {
85
- let e = new Set(M);
86
- for (let t of b) t.category && e.add(t.category);
87
- return [...e].sort();
88
- }, [b]), [J, { loading: Y }] = h(j, {
85
+ let g = n(), x = t(), { assets: I } = e(), [L, R] = l(N), [z, B] = l([]), [V, H] = l(""), [U, W] = l({}), [G, K] = l(null), q = c(!1), J = s(() => {
86
+ let e = new Set(te);
87
+ for (let t of I) t.category && e.add(t.category);
88
+ return [...e].filter((e) => !x.has(e)).sort();
89
+ }, [I, x]), [ne, { loading: Y }] = ee(M, {
89
90
  refetchQueries: ["AssetHandlerBootstrap"],
90
91
  onCompleted: (e) => {
91
- n.success("Asset created", `${e.createAsset.name} was registered in the inventory.`), G(null), K.current ? (K.current = !1, L(N), z([]), V(""), U({}), typeof window < "u" && window.scrollTo({
92
+ r.success("Asset created", `${e.createAsset.name} was registered in the inventory.`), K(null), q.current ? (q.current = !1, R(N), B([]), H(""), W({}), typeof window < "u" && window.scrollTo({
92
93
  top: 0,
93
94
  behavior: "smooth"
94
- })) : m(`/assets/${e.createAsset.id}`);
95
+ })) : g(`/assets/${e.createAsset.id}`);
95
96
  },
96
97
  onError: (e) => {
97
- G(null), n.error("Could not create asset", e.message);
98
+ K(null), r.error("Could not create asset", e.message);
98
99
  }
99
100
  }), X = (e, t) => {
100
- L((n) => ({
101
+ R((n) => ({
101
102
  ...n,
102
103
  [e]: t
103
- })), U((t) => {
104
+ })), W((t) => {
104
105
  if (!t[e]) return t;
105
106
  let n = { ...t };
106
107
  return delete n[e], n;
107
108
  });
108
109
  }, Z = () => {
109
- let e = B.trim().replace(/,$/, "").trim();
110
- e && !R.includes(e) && z((t) => [...t, e]), V("");
111
- }, te = (e) => {
112
- e.key === "Enter" || e.key === "," ? (e.preventDefault(), Z()) : e.key === "Backspace" && B === "" && R.length > 0 && z((e) => e.slice(0, -1));
113
- }, Q = o(() => P({
114
- purchaseValue: I.purchaseValue.trim() ? Number(I.purchaseValue) : null,
115
- salvageValue: I.salvageValue.trim() ? Number(I.salvageValue) : null,
116
- usefulLifeMonths: I.usefulLifeMonths.trim() ? Number(I.usefulLifeMonths) : null,
117
- method: I.depreciationMethod
110
+ let e = V.trim().replace(/,$/, "").trim();
111
+ e && !z.includes(e) && B((t) => [...t, e]), H("");
112
+ }, re = (e) => {
113
+ e.key === "Enter" || e.key === "," ? (e.preventDefault(), Z()) : e.key === "Backspace" && V === "" && z.length > 0 && B((e) => e.slice(0, -1));
114
+ }, Q = s(() => P({
115
+ purchaseValue: L.purchaseValue.trim() ? Number(L.purchaseValue) : null,
116
+ salvageValue: L.salvageValue.trim() ? Number(L.salvageValue) : null,
117
+ usefulLifeMonths: L.usefulLifeMonths.trim() ? Number(L.usefulLifeMonths) : null,
118
+ method: L.depreciationMethod
118
119
  }), [
119
- I.purchaseValue,
120
- I.salvageValue,
121
- I.usefulLifeMonths,
122
- I.depreciationMethod
120
+ L.purchaseValue,
121
+ L.salvageValue,
122
+ L.usefulLifeMonths,
123
+ L.depreciationMethod
123
124
  ]), $ = (e) => {
124
125
  let t = {};
125
- I.name.trim() || (t.name = "Asset name is required"), I.assetNumber.trim() || (t.assetNumber = "Asset tag is required"), I.category.trim() || (t.category = "Category is required");
126
- let r = (e, n, r) => {
126
+ L.name.trim() || (t.name = "Asset name is required"), L.assetNumber.trim() || (t.assetNumber = "Asset tag is required"), L.category.trim() || (t.category = "Category is required");
127
+ let n = (e, n, r) => {
127
128
  if (e.trim() === "") return;
128
129
  let i = Number(e);
129
130
  (Number.isNaN(i) || i < 0) && (t[r] = `${n} must be a positive number`);
130
131
  };
131
- if (r(I.purchaseValue, "Purchase value", "purchaseValue"), r(I.salvageValue, "Salvage value", "salvageValue"), r(I.usefulLifeMonths, "Useful life", "usefulLifeMonths"), U(t), Object.keys(t).length > 0) {
132
- n.warning("Missing required fields", "Fill in the highlighted fields and try again.");
132
+ if (n(L.purchaseValue, "Purchase value", "purchaseValue"), n(L.salvageValue, "Salvage value", "salvageValue"), n(L.usefulLifeMonths, "Useful life", "usefulLifeMonths"), W(t), Object.keys(t).length > 0) {
133
+ r.warning("Missing required fields", "Fill in the highlighted fields and try again.");
133
134
  return;
134
135
  }
135
136
  let i = (e) => {
@@ -138,48 +139,48 @@ function I() {
138
139
  let n = Number(t);
139
140
  return Number.isNaN(n) ? null : n;
140
141
  }, a = (e) => e.trim() === "" ? null : new Date(e).toISOString();
141
- K.current = e, G(e ? "add" : "create"), J({ variables: { input: {
142
- name: I.name.trim(),
143
- assetNumber: I.assetNumber.trim(),
144
- category: I.category,
145
- status: I.status,
146
- condition: I.condition,
147
- description: I.description.trim() || null,
148
- serialNumber: I.serialNumber.trim() || null,
149
- locationName: I.locationName.trim() || null,
150
- assignedTo: I.assignedTo.trim() || null,
151
- tags: R,
152
- purchaseValue: i(I.purchaseValue),
153
- purchaseDate: a(I.purchaseDate),
154
- usefulLifeMonths: i(I.usefulLifeMonths),
155
- salvageValue: i(I.salvageValue),
156
- depreciationMethod: I.depreciationMethod,
157
- warrantyExpiry: a(I.warrantyExpiry),
158
- supplier: I.supplier.trim() || null,
159
- department: I.department.trim() || null
142
+ q.current = e, K(e ? "add" : "create"), ne({ variables: { input: {
143
+ name: L.name.trim(),
144
+ assetNumber: L.assetNumber.trim(),
145
+ category: L.category,
146
+ status: L.status,
147
+ condition: L.condition,
148
+ description: L.description.trim() || null,
149
+ serialNumber: L.serialNumber.trim() || null,
150
+ locationName: L.locationName.trim() || null,
151
+ assignedTo: L.assignedTo.trim() || null,
152
+ tags: z,
153
+ purchaseValue: i(L.purchaseValue),
154
+ purchaseDate: a(L.purchaseDate),
155
+ usefulLifeMonths: i(L.usefulLifeMonths),
156
+ salvageValue: i(L.salvageValue),
157
+ depreciationMethod: L.depreciationMethod,
158
+ warrantyExpiry: a(L.warrantyExpiry),
159
+ supplier: L.supplier.trim() || null,
160
+ department: L.department.trim() || null
160
161
  } } });
161
162
  };
162
- return /* @__PURE__ */ _("div", {
163
+ return /* @__PURE__ */ v("div", {
163
164
  className: "mx-auto max-w-4xl space-y-6 p-4 pb-28 sm:p-6 sm:pb-28",
164
165
  children: [
165
- /* @__PURE__ */ _("div", {
166
+ /* @__PURE__ */ v("div", {
166
167
  className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",
167
- children: [/* @__PURE__ */ g(y, {
168
+ children: [/* @__PURE__ */ _(b, {
168
169
  variant: "ghost",
169
170
  size: "icon",
170
171
  "aria-label": "Go back",
171
172
  className: "w-fit",
172
- onClick: () => m("/assets/asset-list"),
173
- children: /* @__PURE__ */ g(ee, { className: "h-4 w-4" })
174
- }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h1", {
173
+ onClick: () => g("/assets/asset-list"),
174
+ children: /* @__PURE__ */ _(u, { className: "h-4 w-4" })
175
+ }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("h1", {
175
176
  className: "text-2xl font-bold",
176
- children: /* @__PURE__ */ g(x, { children: "Create New Asset" })
177
- }), /* @__PURE__ */ _("p", {
177
+ children: /* @__PURE__ */ _(S, { children: "Create New Asset" })
178
+ }), /* @__PURE__ */ v("p", {
178
179
  className: "text-sm text-text-secondary",
179
180
  children: [
180
181
  "Register a new asset in the inventory ·",
181
182
  " ",
182
- /* @__PURE__ */ g("span", {
183
+ /* @__PURE__ */ _("span", {
183
184
  className: "text-status-error-text",
184
185
  children: "*"
185
186
  }),
@@ -187,127 +188,127 @@ function I() {
187
188
  ]
188
189
  })] })]
189
190
  }),
190
- /* @__PURE__ */ g(w, { children: "Register a new asset so it can be tracked, maintained and assigned from day one. Capture its identity, category and condition, then its financials and location — the more you fill in now, the better your reports and audits later." }),
191
- /* @__PURE__ */ _(F, {
191
+ /* @__PURE__ */ _(T, { children: "Register a new asset so it can be tracked, maintained and assigned from day one. Capture its identity, category and condition, then its financials and location — the more you fill in now, the better your reports and audits later." }),
192
+ /* @__PURE__ */ v(F, {
192
193
  title: "General Information",
193
194
  description: "Basic asset details and identification",
194
195
  glow: !0,
195
196
  children: [
196
- /* @__PURE__ */ _("div", {
197
+ /* @__PURE__ */ v("div", {
197
198
  className: "grid gap-4 md:grid-cols-2",
198
- children: [/* @__PURE__ */ _("div", {
199
+ children: [/* @__PURE__ */ v("div", {
199
200
  className: "space-y-2",
200
201
  children: [
201
- /* @__PURE__ */ _(C, { children: ["Asset Name ", /* @__PURE__ */ g("span", {
202
+ /* @__PURE__ */ v(w, { children: ["Asset Name ", /* @__PURE__ */ _("span", {
202
203
  className: "text-status-error-text",
203
204
  children: "*"
204
205
  })] }),
205
- /* @__PURE__ */ g(S, {
206
+ /* @__PURE__ */ _(C, {
206
207
  placeholder: "e.g., Dell OptiPlex 7090",
207
- value: I.name,
208
+ value: L.name,
208
209
  onChange: (e) => X("name", e.target.value),
209
- "aria-invalid": !!H.name
210
+ "aria-invalid": !!U.name
210
211
  }),
211
- H.name ? /* @__PURE__ */ g("p", {
212
+ U.name ? /* @__PURE__ */ _("p", {
212
213
  className: "text-xs text-status-error-text",
213
- children: H.name
214
+ children: U.name
214
215
  }) : null
215
216
  ]
216
- }), /* @__PURE__ */ _("div", {
217
+ }), /* @__PURE__ */ v("div", {
217
218
  className: "space-y-2",
218
219
  children: [
219
- /* @__PURE__ */ _(C, { children: ["Asset Tag ", /* @__PURE__ */ g("span", {
220
+ /* @__PURE__ */ v(w, { children: ["Asset Tag ", /* @__PURE__ */ _("span", {
220
221
  className: "text-status-error-text",
221
222
  children: "*"
222
223
  })] }),
223
- /* @__PURE__ */ g(S, {
224
+ /* @__PURE__ */ _(C, {
224
225
  placeholder: "e.g., IT-HW-001",
225
- value: I.assetNumber,
226
+ value: L.assetNumber,
226
227
  onChange: (e) => X("assetNumber", e.target.value),
227
- "aria-invalid": !!H.assetNumber
228
+ "aria-invalid": !!U.assetNumber
228
229
  }),
229
- H.assetNumber ? /* @__PURE__ */ g("p", {
230
+ U.assetNumber ? /* @__PURE__ */ _("p", {
230
231
  className: "text-xs text-status-error-text",
231
- children: H.assetNumber
232
+ children: U.assetNumber
232
233
  }) : null
233
234
  ]
234
235
  })]
235
236
  }),
236
- /* @__PURE__ */ _("div", {
237
+ /* @__PURE__ */ v("div", {
237
238
  className: "space-y-2",
238
- children: [/* @__PURE__ */ g(C, { children: "Description" }), /* @__PURE__ */ g(A, {
239
+ children: [/* @__PURE__ */ _(w, { children: "Description" }), /* @__PURE__ */ _(j, {
239
240
  placeholder: "Brief description of the asset...",
240
- value: I.description,
241
+ value: L.description,
241
242
  onChange: (e) => X("description", e.target.value),
242
243
  rows: 3
243
244
  })]
244
245
  }),
245
- /* @__PURE__ */ _("div", {
246
+ /* @__PURE__ */ v("div", {
246
247
  className: "grid gap-4 md:grid-cols-3",
247
248
  children: [
248
- /* @__PURE__ */ _("div", {
249
+ /* @__PURE__ */ v("div", {
249
250
  className: "space-y-2",
250
- children: [/* @__PURE__ */ _(C, { children: ["Category ", /* @__PURE__ */ g("span", {
251
+ children: [/* @__PURE__ */ v(w, { children: ["Category ", /* @__PURE__ */ _("span", {
251
252
  className: "text-status-error-text",
252
253
  children: "*"
253
- })] }), /* @__PURE__ */ _(T, {
254
- value: I.category,
254
+ })] }), /* @__PURE__ */ v(E, {
255
+ value: L.category,
255
256
  onValueChange: (e) => X("category", e),
256
- children: [/* @__PURE__ */ g(O, { children: /* @__PURE__ */ g(k, {}) }), /* @__PURE__ */ g(E, { children: q.map((e) => /* @__PURE__ */ g(D, {
257
+ children: [/* @__PURE__ */ _(k, { children: /* @__PURE__ */ _(A, {}) }), /* @__PURE__ */ _(D, { children: J.map((e) => /* @__PURE__ */ _(O, {
257
258
  value: e,
258
259
  className: "capitalize",
259
260
  children: e.replace(/_/g, " ")
260
261
  }, e)) })]
261
262
  })]
262
263
  }),
263
- /* @__PURE__ */ _("div", {
264
+ /* @__PURE__ */ v("div", {
264
265
  className: "space-y-2",
265
- children: [/* @__PURE__ */ g(C, { children: "Status" }), /* @__PURE__ */ _(T, {
266
- value: I.status,
266
+ children: [/* @__PURE__ */ _(w, { children: "Status" }), /* @__PURE__ */ v(E, {
267
+ value: L.status,
267
268
  onValueChange: (e) => X("status", e),
268
- children: [/* @__PURE__ */ g(O, { children: /* @__PURE__ */ g(k, {}) }), /* @__PURE__ */ _(E, { children: [
269
- /* @__PURE__ */ g(D, {
269
+ children: [/* @__PURE__ */ _(k, { children: /* @__PURE__ */ _(A, {}) }), /* @__PURE__ */ v(D, { children: [
270
+ /* @__PURE__ */ _(O, {
270
271
  value: "ACTIVE",
271
272
  children: "Active"
272
273
  }),
273
- /* @__PURE__ */ g(D, {
274
+ /* @__PURE__ */ _(O, {
274
275
  value: "INACTIVE",
275
276
  children: "Inactive"
276
277
  }),
277
- /* @__PURE__ */ g(D, {
278
+ /* @__PURE__ */ _(O, {
278
279
  value: "MAINTENANCE",
279
280
  children: "Maintenance"
280
281
  }),
281
- /* @__PURE__ */ g(D, {
282
+ /* @__PURE__ */ _(O, {
282
283
  value: "RETIRED",
283
284
  children: "Retired"
284
285
  })
285
286
  ] })]
286
287
  })]
287
288
  }),
288
- /* @__PURE__ */ _("div", {
289
+ /* @__PURE__ */ v("div", {
289
290
  className: "space-y-2",
290
- children: [/* @__PURE__ */ g(C, { children: "Condition" }), /* @__PURE__ */ _(T, {
291
- value: I.condition,
291
+ children: [/* @__PURE__ */ _(w, { children: "Condition" }), /* @__PURE__ */ v(E, {
292
+ value: L.condition,
292
293
  onValueChange: (e) => X("condition", e),
293
- children: [/* @__PURE__ */ g(O, { children: /* @__PURE__ */ g(k, {}) }), /* @__PURE__ */ _(E, { children: [
294
- /* @__PURE__ */ g(D, {
294
+ children: [/* @__PURE__ */ _(k, { children: /* @__PURE__ */ _(A, {}) }), /* @__PURE__ */ v(D, { children: [
295
+ /* @__PURE__ */ _(O, {
295
296
  value: "EXCELLENT",
296
297
  children: "Excellent"
297
298
  }),
298
- /* @__PURE__ */ g(D, {
299
+ /* @__PURE__ */ _(O, {
299
300
  value: "GOOD",
300
301
  children: "Good"
301
302
  }),
302
- /* @__PURE__ */ g(D, {
303
+ /* @__PURE__ */ _(O, {
303
304
  value: "FAIR",
304
305
  children: "Fair"
305
306
  }),
306
- /* @__PURE__ */ g(D, {
307
+ /* @__PURE__ */ _(O, {
307
308
  value: "POOR",
308
309
  children: "Poor"
309
310
  }),
310
- /* @__PURE__ */ g(D, {
311
+ /* @__PURE__ */ _(O, {
311
312
  value: "DAMAGED",
312
313
  children: "Damaged"
313
314
  })
@@ -316,137 +317,137 @@ function I() {
316
317
  })
317
318
  ]
318
319
  }),
319
- /* @__PURE__ */ _("div", {
320
+ /* @__PURE__ */ v("div", {
320
321
  className: "space-y-2",
321
- children: [/* @__PURE__ */ g(C, { children: "Serial Number" }), /* @__PURE__ */ g(S, {
322
+ children: [/* @__PURE__ */ _(w, { children: "Serial Number" }), /* @__PURE__ */ _(C, {
322
323
  placeholder: "e.g., DELL-7090-X1A2B3",
323
- value: I.serialNumber,
324
+ value: L.serialNumber,
324
325
  onChange: (e) => X("serialNumber", e.target.value)
325
326
  })]
326
327
  })
327
328
  ]
328
329
  }),
329
- /* @__PURE__ */ _(F, {
330
+ /* @__PURE__ */ v(F, {
330
331
  title: "Financial Details",
331
332
  description: "Purchase and depreciation data powers book value, TCO and finance reports",
332
333
  children: [
333
- /* @__PURE__ */ _("div", {
334
+ /* @__PURE__ */ v("div", {
334
335
  className: "grid gap-4 md:grid-cols-3",
335
336
  children: [
336
- /* @__PURE__ */ _("div", {
337
+ /* @__PURE__ */ v("div", {
337
338
  className: "space-y-2",
338
339
  children: [
339
- /* @__PURE__ */ g(C, { children: "Purchase Value" }),
340
- /* @__PURE__ */ _("div", {
340
+ /* @__PURE__ */ _(w, { children: "Purchase Value" }),
341
+ /* @__PURE__ */ v("div", {
341
342
  className: "relative",
342
- children: [/* @__PURE__ */ g("span", {
343
+ children: [/* @__PURE__ */ _("span", {
343
344
  className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
344
345
  children: "$"
345
- }), /* @__PURE__ */ g(S, {
346
+ }), /* @__PURE__ */ _(C, {
346
347
  type: "number",
347
348
  min: "0",
348
349
  step: "0.01",
349
350
  placeholder: "1200",
350
351
  className: "pl-7",
351
- value: I.purchaseValue,
352
+ value: L.purchaseValue,
352
353
  onChange: (e) => X("purchaseValue", e.target.value),
353
- "aria-invalid": !!H.purchaseValue
354
+ "aria-invalid": !!U.purchaseValue
354
355
  })]
355
356
  }),
356
- H.purchaseValue ? /* @__PURE__ */ g("p", {
357
+ U.purchaseValue ? /* @__PURE__ */ _("p", {
357
358
  className: "text-xs text-status-error-text",
358
- children: H.purchaseValue
359
+ children: U.purchaseValue
359
360
  }) : null
360
361
  ]
361
362
  }),
362
- /* @__PURE__ */ _("div", {
363
+ /* @__PURE__ */ v("div", {
363
364
  className: "space-y-2",
364
- children: [/* @__PURE__ */ g(C, { children: "Purchase Date" }), /* @__PURE__ */ g(S, {
365
+ children: [/* @__PURE__ */ _(w, { children: "Purchase Date" }), /* @__PURE__ */ _(C, {
365
366
  type: "date",
366
- value: I.purchaseDate,
367
+ value: L.purchaseDate,
367
368
  onChange: (e) => X("purchaseDate", e.target.value)
368
369
  })]
369
370
  }),
370
- /* @__PURE__ */ _("div", {
371
+ /* @__PURE__ */ v("div", {
371
372
  className: "space-y-2",
372
- children: [/* @__PURE__ */ g(C, { children: "Supplier" }), /* @__PURE__ */ g(S, {
373
+ children: [/* @__PURE__ */ _(w, { children: "Supplier" }), /* @__PURE__ */ _(C, {
373
374
  placeholder: "e.g., Dell Technologies",
374
- value: I.supplier,
375
+ value: L.supplier,
375
376
  onChange: (e) => X("supplier", e.target.value)
376
377
  })]
377
378
  })
378
379
  ]
379
380
  }),
380
- /* @__PURE__ */ _("div", {
381
+ /* @__PURE__ */ v("div", {
381
382
  className: "grid gap-4 md:grid-cols-3",
382
383
  children: [
383
- /* @__PURE__ */ _("div", {
384
+ /* @__PURE__ */ v("div", {
384
385
  className: "space-y-2",
385
386
  children: [
386
- /* @__PURE__ */ g(C, { children: "Useful Life" }),
387
- /* @__PURE__ */ _("div", {
387
+ /* @__PURE__ */ _(w, { children: "Useful Life" }),
388
+ /* @__PURE__ */ v("div", {
388
389
  className: "relative",
389
- children: [/* @__PURE__ */ g(S, {
390
+ children: [/* @__PURE__ */ _(C, {
390
391
  type: "number",
391
392
  min: "0",
392
393
  step: "1",
393
394
  placeholder: "60",
394
395
  className: "pr-16",
395
- value: I.usefulLifeMonths,
396
+ value: L.usefulLifeMonths,
396
397
  onChange: (e) => X("usefulLifeMonths", e.target.value),
397
- "aria-invalid": !!H.usefulLifeMonths
398
- }), /* @__PURE__ */ g("span", {
398
+ "aria-invalid": !!U.usefulLifeMonths
399
+ }), /* @__PURE__ */ _("span", {
399
400
  className: "pointer-events-none absolute right-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
400
401
  children: "months"
401
402
  })]
402
403
  }),
403
- H.usefulLifeMonths ? /* @__PURE__ */ g("p", {
404
+ U.usefulLifeMonths ? /* @__PURE__ */ _("p", {
404
405
  className: "text-xs text-status-error-text",
405
- children: H.usefulLifeMonths
406
+ children: U.usefulLifeMonths
406
407
  }) : null
407
408
  ]
408
409
  }),
409
- /* @__PURE__ */ _("div", {
410
+ /* @__PURE__ */ v("div", {
410
411
  className: "space-y-2",
411
412
  children: [
412
- /* @__PURE__ */ g(C, { children: "Salvage Value" }),
413
- /* @__PURE__ */ _("div", {
413
+ /* @__PURE__ */ _(w, { children: "Salvage Value" }),
414
+ /* @__PURE__ */ v("div", {
414
415
  className: "relative",
415
- children: [/* @__PURE__ */ g("span", {
416
+ children: [/* @__PURE__ */ _("span", {
416
417
  className: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-secondary",
417
418
  children: "$"
418
- }), /* @__PURE__ */ g(S, {
419
+ }), /* @__PURE__ */ _(C, {
419
420
  type: "number",
420
421
  min: "0",
421
422
  step: "0.01",
422
423
  placeholder: "100",
423
424
  className: "pl-7",
424
- value: I.salvageValue,
425
+ value: L.salvageValue,
425
426
  onChange: (e) => X("salvageValue", e.target.value),
426
- "aria-invalid": !!H.salvageValue
427
+ "aria-invalid": !!U.salvageValue
427
428
  })]
428
429
  }),
429
- H.salvageValue ? /* @__PURE__ */ g("p", {
430
+ U.salvageValue ? /* @__PURE__ */ _("p", {
430
431
  className: "text-xs text-status-error-text",
431
- children: H.salvageValue
432
+ children: U.salvageValue
432
433
  }) : null
433
434
  ]
434
435
  }),
435
- /* @__PURE__ */ _("div", {
436
+ /* @__PURE__ */ v("div", {
436
437
  className: "space-y-2",
437
- children: [/* @__PURE__ */ g(C, { children: "Depreciation Method" }), /* @__PURE__ */ _(T, {
438
- value: I.depreciationMethod,
438
+ children: [/* @__PURE__ */ _(w, { children: "Depreciation Method" }), /* @__PURE__ */ v(E, {
439
+ value: L.depreciationMethod,
439
440
  onValueChange: (e) => X("depreciationMethod", e),
440
- children: [/* @__PURE__ */ g(O, { children: /* @__PURE__ */ g(k, {}) }), /* @__PURE__ */ _(E, { children: [
441
- /* @__PURE__ */ g(D, {
441
+ children: [/* @__PURE__ */ _(k, { children: /* @__PURE__ */ _(A, {}) }), /* @__PURE__ */ v(D, { children: [
442
+ /* @__PURE__ */ _(O, {
442
443
  value: "STRAIGHT_LINE",
443
444
  children: "Straight line"
444
445
  }),
445
- /* @__PURE__ */ g(D, {
446
+ /* @__PURE__ */ _(O, {
446
447
  value: "REDUCING_BALANCE",
447
448
  children: "Reducing balance"
448
449
  }),
449
- /* @__PURE__ */ g(D, {
450
+ /* @__PURE__ */ _(O, {
450
451
  value: "NONE",
451
452
  children: "None"
452
453
  })
@@ -455,85 +456,85 @@ function I() {
455
456
  })
456
457
  ]
457
458
  }),
458
- /* @__PURE__ */ _("div", {
459
+ /* @__PURE__ */ v("div", {
459
460
  className: "space-y-2",
460
- children: [/* @__PURE__ */ g(C, { children: "Warranty Expiry" }), /* @__PURE__ */ g(S, {
461
+ children: [/* @__PURE__ */ _(w, { children: "Warranty Expiry" }), /* @__PURE__ */ _(C, {
461
462
  type: "date",
462
- value: I.warrantyExpiry,
463
+ value: L.warrantyExpiry,
463
464
  onChange: (e) => X("warrantyExpiry", e.target.value)
464
465
  })]
465
466
  }),
466
- /* @__PURE__ */ g(a, {
467
+ /* @__PURE__ */ _(o, {
467
468
  title: "Depreciation preview",
468
469
  subtitle: "Projected book value over the asset's useful life",
469
- icon: f,
470
- children: Q.length > 0 ? /* @__PURE__ */ g(i, {
470
+ icon: m,
471
+ children: Q.length > 0 ? /* @__PURE__ */ _(a, {
471
472
  data: Q,
472
473
  xKey: "year",
473
474
  height: 240,
474
- valueFormat: r("USD"),
475
+ valueFormat: i("USD"),
475
476
  xTickFormat: (e) => `${e}y`,
476
477
  series: [{
477
478
  key: "bookValue",
478
479
  label: "Book value"
479
480
  }]
480
- }) : /* @__PURE__ */ _("div", {
481
+ }) : /* @__PURE__ */ v("div", {
481
482
  className: "flex flex-col items-center gap-2 py-10 text-center text-sm text-text-secondary",
482
- children: [/* @__PURE__ */ g(l, { className: "h-5 w-5 text-text-muted" }), "Enter a purchase value and useful life to preview the depreciation schedule."]
483
+ children: [/* @__PURE__ */ _(d, { className: "h-5 w-5 text-text-muted" }), "Enter a purchase value and useful life to preview the depreciation schedule."]
483
484
  })
484
485
  })
485
486
  ]
486
487
  }),
487
- /* @__PURE__ */ g(F, {
488
+ /* @__PURE__ */ _(F, {
488
489
  title: "Assignment & Location",
489
490
  description: "Who holds it and where it lives",
490
- children: /* @__PURE__ */ _("div", {
491
+ children: /* @__PURE__ */ v("div", {
491
492
  className: "grid gap-4 md:grid-cols-2",
492
493
  children: [
493
- /* @__PURE__ */ _("div", {
494
+ /* @__PURE__ */ v("div", {
494
495
  className: "space-y-2",
495
- children: [/* @__PURE__ */ g(C, { children: "Assigned To" }), /* @__PURE__ */ g(S, {
496
+ children: [/* @__PURE__ */ _(w, { children: "Assigned To" }), /* @__PURE__ */ _(C, {
496
497
  placeholder: "e.g., john.smith@company.com",
497
- value: I.assignedTo,
498
+ value: L.assignedTo,
498
499
  onChange: (e) => X("assignedTo", e.target.value)
499
500
  })]
500
501
  }),
501
- /* @__PURE__ */ _("div", {
502
+ /* @__PURE__ */ v("div", {
502
503
  className: "space-y-2",
503
- children: [/* @__PURE__ */ g(C, { children: "Location" }), /* @__PURE__ */ g(S, {
504
+ children: [/* @__PURE__ */ _(w, { children: "Location" }), /* @__PURE__ */ _(C, {
504
505
  placeholder: "e.g., Building A, Floor 3, Desk 15",
505
- value: I.locationName,
506
+ value: L.locationName,
506
507
  onChange: (e) => X("locationName", e.target.value)
507
508
  })]
508
509
  }),
509
- /* @__PURE__ */ _("div", {
510
+ /* @__PURE__ */ v("div", {
510
511
  className: "space-y-2",
511
- children: [/* @__PURE__ */ g(C, { children: "Department" }), /* @__PURE__ */ g(S, {
512
+ children: [/* @__PURE__ */ _(w, { children: "Department" }), /* @__PURE__ */ _(C, {
512
513
  placeholder: "e.g., Engineering",
513
- value: I.department,
514
+ value: L.department,
514
515
  onChange: (e) => X("department", e.target.value)
515
516
  })]
516
517
  }),
517
- /* @__PURE__ */ _("div", {
518
+ /* @__PURE__ */ v("div", {
518
519
  className: "space-y-2",
519
- children: [/* @__PURE__ */ g(C, { children: "Tags" }), /* @__PURE__ */ _("div", {
520
+ children: [/* @__PURE__ */ _(w, { children: "Tags" }), /* @__PURE__ */ v("div", {
520
521
  className: "flex flex-wrap items-center gap-1.5 rounded-md border border-border-strong bg-bg-surface px-2 py-1.5 focus-within:border-action-primary-bg",
521
- children: [R.map((e) => /* @__PURE__ */ _(v, {
522
+ children: [z.map((e) => /* @__PURE__ */ v(y, {
522
523
  variant: "secondary",
523
524
  className: "gap-1",
524
- children: [e, /* @__PURE__ */ g("button", {
525
+ children: [e, /* @__PURE__ */ _("button", {
525
526
  type: "button",
526
527
  "aria-label": `Remove ${e}`,
527
- onClick: () => z((t) => t.filter((t) => t !== e)),
528
+ onClick: () => B((t) => t.filter((t) => t !== e)),
528
529
  className: "text-text-secondary hover:text-text-primary",
529
- children: /* @__PURE__ */ g(p, { className: "h-3 w-3" })
530
+ children: /* @__PURE__ */ _(h, { className: "h-3 w-3" })
530
531
  })]
531
- }, e)), /* @__PURE__ */ g("input", {
532
- value: B,
533
- onChange: (e) => V(e.target.value),
534
- onKeyDown: te,
532
+ }, e)), /* @__PURE__ */ _("input", {
533
+ value: V,
534
+ onChange: (e) => H(e.target.value),
535
+ onKeyDown: re,
535
536
  onBlur: Z,
536
- placeholder: R.length === 0 ? "Type a tag and press Enter" : "",
537
+ placeholder: z.length === 0 ? "Type a tag and press Enter" : "",
537
538
  className: "min-w-[8rem] flex-1 border-0 bg-transparent text-sm outline-none placeholder:text-text-secondary"
538
539
  })]
539
540
  })]
@@ -541,30 +542,30 @@ function I() {
541
542
  ]
542
543
  })
543
544
  }),
544
- /* @__PURE__ */ g("div", {
545
+ /* @__PURE__ */ _("div", {
545
546
  className: "sticky bottom-0 -mx-4 mt-6 border-t border-border-seam bg-bg-surface/95 px-4 py-3 backdrop-blur sm:-mx-6 sm:px-6",
546
- children: /* @__PURE__ */ _("div", {
547
+ children: /* @__PURE__ */ v("div", {
547
548
  className: "mx-auto flex max-w-4xl flex-col gap-2 sm:flex-row sm:justify-end",
548
549
  children: [
549
- /* @__PURE__ */ _(y, {
550
+ /* @__PURE__ */ v(b, {
550
551
  variant: "outline",
551
552
  className: "w-full sm:w-auto",
552
- onClick: () => m("/assets/asset-list"),
553
+ onClick: () => g("/assets/asset-list"),
553
554
  disabled: Y,
554
- children: [/* @__PURE__ */ g(p, { className: "mr-2 h-4 w-4" }), "Cancel"]
555
+ children: [/* @__PURE__ */ _(h, { className: "mr-2 h-4 w-4" }), "Cancel"]
555
556
  }),
556
- /* @__PURE__ */ _(y, {
557
+ /* @__PURE__ */ v(b, {
557
558
  variant: "outline",
558
559
  className: "w-full sm:w-auto",
559
560
  onClick: () => $(!0),
560
561
  disabled: Y,
561
- children: [Y && W === "add" ? /* @__PURE__ */ g(u, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ g(d, { className: "mr-2 h-4 w-4" }), "Save & add another"]
562
+ children: [Y && G === "add" ? /* @__PURE__ */ _(f, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ _(p, { className: "mr-2 h-4 w-4" }), "Save & add another"]
562
563
  }),
563
- /* @__PURE__ */ _(y, {
564
+ /* @__PURE__ */ v(b, {
564
565
  className: "w-full sm:w-auto",
565
566
  onClick: () => $(!1),
566
567
  disabled: Y,
567
- children: [Y && W === "create" ? /* @__PURE__ */ g(u, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ g(d, { className: "mr-2 h-4 w-4" }), Y ? "Creating..." : "Create Asset"]
568
+ children: [Y && G === "create" ? /* @__PURE__ */ _(f, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ _(p, { className: "mr-2 h-4 w-4" }), Y ? "Creating..." : "Create Asset"]
568
569
  })
569
570
  ]
570
571
  })