@burdenoff/microfe-assethandler 2026.820.2 → 2026.820.4

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 (91) hide show
  1. package/dist/assethandler/components/AssetTag.d.ts +20 -0
  2. package/dist/assethandler/components/AssetTag.d.ts.map +1 -0
  3. package/dist/assethandler/components/AssetTag.js +8 -0
  4. package/dist/assethandler/components/AssetTag.js.map +1 -0
  5. package/dist/assethandler/components/index.d.ts +2 -0
  6. package/dist/assethandler/components/index.d.ts.map +1 -1
  7. package/dist/assethandler/components/index.js +1 -0
  8. package/dist/assethandler/pages/AssetsAssetCheckInOutPage.d.ts.map +1 -1
  9. package/dist/assethandler/pages/AssetsAssetCheckInOutPage.js +344 -181
  10. package/dist/assethandler/pages/AssetsAssetCheckInOutPage.js.map +1 -1
  11. package/dist/assethandler/pages/AssetsAssetDetailPage.d.ts.map +1 -1
  12. package/dist/assethandler/pages/AssetsAssetDetailPage.js +338 -325
  13. package/dist/assethandler/pages/AssetsAssetDetailPage.js.map +1 -1
  14. package/dist/assethandler/pages/AssetsAssetListPage.d.ts.map +1 -1
  15. package/dist/assethandler/pages/AssetsAssetListPage.js +177 -163
  16. package/dist/assethandler/pages/AssetsAssetListPage.js.map +1 -1
  17. package/dist/assethandler/pages/KnowledgeBasePage.d.ts.map +1 -1
  18. package/dist/assethandler/pages/KnowledgeBasePage.js +394 -287
  19. package/dist/assethandler/pages/KnowledgeBasePage.js.map +1 -1
  20. package/dist/assethandler/providers/AssetHandlerProvider.d.ts.map +1 -1
  21. package/dist/assethandler/providers/AssetHandlerProvider.js +1 -0
  22. package/dist/assethandler/providers/AssetHandlerProvider.js.map +1 -1
  23. package/dist/assethandler/store/assethandlerStore.d.ts +2 -0
  24. package/dist/assethandler/store/assethandlerStore.d.ts.map +1 -1
  25. package/dist/assethandler/store/assethandlerStore.js +1 -0
  26. package/dist/assethandler/store/assethandlerStore.js.map +1 -1
  27. package/dist/assethandler/utils/knowledgeBase.d.ts +17 -0
  28. package/dist/assethandler/utils/knowledgeBase.d.ts.map +1 -0
  29. package/dist/assethandler/utils/knowledgeBase.js +17 -0
  30. package/dist/assethandler/utils/knowledgeBase.js.map +1 -0
  31. package/dist/assethandler/utils/printAssetTag.d.ts +24 -0
  32. package/dist/assethandler/utils/printAssetTag.d.ts.map +1 -0
  33. package/dist/assethandler/utils/printAssetTag.js +124 -0
  34. package/dist/assethandler/utils/printAssetTag.js.map +1 -0
  35. package/dist/node_modules/dijkstrajs/dijkstra.js +61 -0
  36. package/dist/node_modules/dijkstrajs/dijkstra.js.map +1 -0
  37. package/dist/node_modules/qrcode/lib/browser.js +40 -0
  38. package/dist/node_modules/qrcode/lib/browser.js.map +1 -0
  39. package/dist/node_modules/qrcode/lib/can-promise.js +12 -0
  40. package/dist/node_modules/qrcode/lib/can-promise.js.map +1 -0
  41. package/dist/node_modules/qrcode/lib/core/alignment-pattern.js +21 -0
  42. package/dist/node_modules/qrcode/lib/core/alignment-pattern.js.map +1 -0
  43. package/dist/node_modules/qrcode/lib/core/alphanumeric-data.js +28 -0
  44. package/dist/node_modules/qrcode/lib/core/alphanumeric-data.js.map +1 -0
  45. package/dist/node_modules/qrcode/lib/core/bit-buffer.js +28 -0
  46. package/dist/node_modules/qrcode/lib/core/bit-buffer.js.map +1 -0
  47. package/dist/node_modules/qrcode/lib/core/bit-matrix.js +23 -0
  48. package/dist/node_modules/qrcode/lib/core/bit-matrix.js.map +1 -0
  49. package/dist/node_modules/qrcode/lib/core/byte-data.js +23 -0
  50. package/dist/node_modules/qrcode/lib/core/byte-data.js.map +1 -0
  51. package/dist/node_modules/qrcode/lib/core/error-correction-code.js +350 -0
  52. package/dist/node_modules/qrcode/lib/core/error-correction-code.js.map +1 -0
  53. package/dist/node_modules/qrcode/lib/core/error-correction-level.js +34 -0
  54. package/dist/node_modules/qrcode/lib/core/error-correction-level.js.map +1 -0
  55. package/dist/node_modules/qrcode/lib/core/finder-pattern.js +19 -0
  56. package/dist/node_modules/qrcode/lib/core/finder-pattern.js.map +1 -0
  57. package/dist/node_modules/qrcode/lib/core/format-info.js +16 -0
  58. package/dist/node_modules/qrcode/lib/core/format-info.js.map +1 -0
  59. package/dist/node_modules/qrcode/lib/core/galois-field.js +22 -0
  60. package/dist/node_modules/qrcode/lib/core/galois-field.js.map +1 -0
  61. package/dist/node_modules/qrcode/lib/core/kanji-data.js +31 -0
  62. package/dist/node_modules/qrcode/lib/core/kanji-data.js.map +1 -0
  63. package/dist/node_modules/qrcode/lib/core/mask-pattern.js +84 -0
  64. package/dist/node_modules/qrcode/lib/core/mask-pattern.js.map +1 -0
  65. package/dist/node_modules/qrcode/lib/core/mode.js +74 -0
  66. package/dist/node_modules/qrcode/lib/core/mode.js.map +1 -0
  67. package/dist/node_modules/qrcode/lib/core/numeric-data.js +26 -0
  68. package/dist/node_modules/qrcode/lib/core/numeric-data.js.map +1 -0
  69. package/dist/node_modules/qrcode/lib/core/polynomial.js +30 -0
  70. package/dist/node_modules/qrcode/lib/core/polynomial.js.map +1 -0
  71. package/dist/node_modules/qrcode/lib/core/qrcode.js +117 -0
  72. package/dist/node_modules/qrcode/lib/core/qrcode.js.map +1 -0
  73. package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.js +27 -0
  74. package/dist/node_modules/qrcode/lib/core/reed-solomon-encoder.js.map +1 -0
  75. package/dist/node_modules/qrcode/lib/core/regex.js +21 -0
  76. package/dist/node_modules/qrcode/lib/core/regex.js.map +1 -0
  77. package/dist/node_modules/qrcode/lib/core/segments.js +144 -0
  78. package/dist/node_modules/qrcode/lib/core/segments.js.map +1 -0
  79. package/dist/node_modules/qrcode/lib/core/utils.js +70 -0
  80. package/dist/node_modules/qrcode/lib/core/utils.js.map +1 -0
  81. package/dist/node_modules/qrcode/lib/core/version-check.js +12 -0
  82. package/dist/node_modules/qrcode/lib/core/version-check.js.map +1 -0
  83. package/dist/node_modules/qrcode/lib/core/version.js +60 -0
  84. package/dist/node_modules/qrcode/lib/core/version.js.map +1 -0
  85. package/dist/node_modules/qrcode/lib/renderer/canvas.js +32 -0
  86. package/dist/node_modules/qrcode/lib/renderer/canvas.js.map +1 -0
  87. package/dist/node_modules/qrcode/lib/renderer/svg-tag.js +31 -0
  88. package/dist/node_modules/qrcode/lib/renderer/svg-tag.js.map +1 -0
  89. package/dist/node_modules/qrcode/lib/renderer/utils.js +55 -0
  90. package/dist/node_modules/qrcode/lib/renderer/utils.js.map +1 -0
  91. package/package.json +3 -1
@@ -1,21 +1,23 @@
1
- import { seriesColor as e } from "../components/charts/chartTheme.js";
2
- import { useAssetHandlerNavigate as t } from "../hooks/useAssetHandlerNavigate.js";
3
- import { cn as n } from "../utils/cn.js";
4
- import { notify as r } from "../utils/toast.js";
5
- import { BarsChart as i } from "../components/charts/BarsChart.js";
6
- import { DonutChart as a } from "../components/charts/DonutChart.js";
7
- import { Pagination as o, usePagination as s } from "../components/Pagination.js";
8
- import { ChartCard as c } from "../components/ChartCard.js";
9
- import { SectionHeader as l } from "../components/SectionHeader.js";
1
+ import { useAssetHandlerStore as e } from "../store/assethandlerStore.js";
2
+ import { seriesColor as t } from "../components/charts/chartTheme.js";
3
+ import { useAssetHandlerNavigate as n } from "../hooks/useAssetHandlerNavigate.js";
4
+ import { cn as r } from "../utils/cn.js";
5
+ import { notify as i } from "../utils/toast.js";
6
+ import { BarsChart as a } from "../components/charts/BarsChart.js";
7
+ import { DonutChart as o } from "../components/charts/DonutChart.js";
8
+ import { Pagination as s, usePagination as c } from "../components/Pagination.js";
9
+ import { ChartCard as l } from "../components/ChartCard.js";
10
+ import { SectionHeader as u } from "../components/SectionHeader.js";
10
11
  import "../components/index.js";
11
- import { useMemo as u, useState as d } from "react";
12
- import { BookOpen as f, ExternalLink as p, Eye as m, Link2 as h, Plus as g, Search as _, User as v } from "lucide-react";
13
- import { gql as y } from "@apollo/client";
14
- import { useMutation as b, useQuery as x } from "@apollo/client/react";
15
- import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
16
- import { Button as T, GlassCard as E, IllustratedEmptyState as D, Input as O, Label as k, PagePurpose as ee, ResponsiveDialog as A, ResponsiveDialogContent as j, ResponsiveDialogDescription as M, ResponsiveDialogFooter as N, ResponsiveDialogHeader as P, ResponsiveDialogTitle as F, Select as I, SelectContent as L, SelectItem as R, SelectTrigger as z, SelectValue as B, Textarea as V } from "@burdenoff/fe-libs/ui";
12
+ import { formatAssetOption as d, formatIncidentOption as f, parseTagsInput as ee } from "../utils/knowledgeBase.js";
13
+ import { useMemo as p, useState as m } from "react";
14
+ import { BookOpen as h, ExternalLink as g, Eye as _, Link2 as v, Pencil as y, Plus as b, Search as x, User as S, X as C } from "lucide-react";
15
+ import { gql as w } from "@apollo/client";
16
+ import { useMutation as T, useQuery as E } from "@apollo/client/react";
17
+ import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
18
+ import { Button as A, GlassCard as j, IllustratedEmptyState as M, Input as N, Label as P, PagePurpose as F, ResponsiveDialog as I, ResponsiveDialogContent as L, ResponsiveDialogDescription as R, ResponsiveDialogFooter as te, ResponsiveDialogHeader as z, ResponsiveDialogTitle as B, Select as V, SelectContent as H, SelectItem as U, SelectTrigger as W, SelectValue as G, Textarea as K } from "@burdenoff/fe-libs/ui";
17
19
  //#region src/assethandler/pages/KnowledgeBasePage.tsx
18
- var H = y`
20
+ var ne = w`
19
21
  query AssetHandlerKnowledgeArticles {
20
22
  knowledgeArticles {
21
23
  id
@@ -35,18 +37,25 @@ var H = y`
35
37
  relatedIncidentId
36
38
  }
37
39
  }
38
- `, U = y`
40
+ `, q = w`
39
41
  mutation AssetHandlerCreateKnowledgeArticle($input: CreateKnowledgeArticleInput!) {
40
42
  createKnowledgeArticle(input: $input) {
41
43
  id
42
44
  title
43
45
  }
44
46
  }
45
- `, W = [
47
+ `, J = w`
48
+ mutation AssetHandlerUpdateKnowledgeArticle($id: ID!, $input: UpdateKnowledgeArticleInput!) {
49
+ updateKnowledgeArticle(id: $id, input: $input) {
50
+ id
51
+ title
52
+ }
53
+ }
54
+ `, re = [
46
55
  "DRAFT",
47
56
  "PUBLISHED",
48
57
  "ARCHIVED"
49
- ], G = {
58
+ ], Y = {
50
59
  PUBLISHED: {
51
60
  label: "Published",
52
61
  className: "bg-status-success-bg-subtle text-status-success-text"
@@ -59,193 +68,285 @@ var H = y`
59
68
  label: "Archived",
60
69
  className: "bg-status-warning-bg-subtle text-status-warning-text"
61
70
  }
62
- }, K = (e) => e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, ""), q = (e) => e ? new Date(e).toLocaleDateString(void 0, {
71
+ }, X = (e) => e.toLowerCase().trim().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, ""), Z = (e) => e ? new Date(e).toLocaleDateString(void 0, {
63
72
  year: "numeric",
64
73
  month: "short",
65
74
  day: "numeric"
66
75
  }) : "—";
67
- function te(e) {
76
+ function ie(e) {
68
77
  if (e.summary && e.summary.trim()) return e.summary.trim();
69
78
  let t = e.content.replace(/\s+/g, " ").trim();
70
79
  return t.length > 160 ? `${t.slice(0, 160)}…` : t;
71
80
  }
72
- function ne(e) {
81
+ function Q(e) {
73
82
  return (e.replace(/[^a-zA-Z0-9]/g, "").slice(0, 2) || "?").toUpperCase();
74
83
  }
75
- function J({ status: e }) {
76
- let t = G[e] ?? {
84
+ function $({ status: e }) {
85
+ let t = Y[e] ?? {
77
86
  label: e,
78
87
  className: "bg-bg-sunken text-text-secondary"
79
88
  };
80
- return /* @__PURE__ */ C("span", {
81
- className: n("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium", t.className),
89
+ return /* @__PURE__ */ O("span", {
90
+ className: r("inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium", t.className),
82
91
  children: t.label
83
92
  });
84
93
  }
85
- function re({ open: e, onOpenChange: t, onPublished: n }) {
86
- let [i, a] = d(""), [o, s] = d(""), [c, l] = d(!1), [u, f] = d(""), [p, m] = d(""), [h, g] = d(""), [_, v] = d("PUBLISHED"), y = () => {
87
- a(""), s(""), l(!1), f(""), m(""), g(""), v("PUBLISHED");
88
- }, [x, { loading: S }] = b(U, {
89
- onCompleted: (e) => {
90
- r.success("Article published", `${e.createKnowledgeArticle.title} is now available.`), y(), t(!1), n();
91
- },
92
- onError: (e) => r.error("Could not publish article", e.message)
93
- }), E = (e) => {
94
- a(e), c || s(K(e));
95
- };
96
- return /* @__PURE__ */ C(A, {
94
+ function ae({ open: e, onOpenChange: t, article: n, onSaved: r }) {
95
+ return /* @__PURE__ */ O(I, {
97
96
  open: e,
98
97
  onOpenChange: t,
99
- children: /* @__PURE__ */ w(j, {
98
+ children: /* @__PURE__ */ O(L, {
100
99
  className: "max-h-[85vh] overflow-y-auto sm:max-w-2xl",
100
+ children: e && /* @__PURE__ */ O(oe, {
101
+ article: n,
102
+ onOpenChange: t,
103
+ onSaved: r
104
+ }, n?.id ?? "new")
105
+ })
106
+ });
107
+ }
108
+ function oe({ article: t, onOpenChange: n, onSaved: r }) {
109
+ let a = !!t, { assets: o, incidents: s } = e(), [c, l] = m(t?.title ?? ""), [u, h] = m(t?.slug ?? ""), [g, _] = m(a), [v, y] = m(t?.summary ?? ""), [b, x] = m(t?.content ?? ""), [S, w] = m(t ? t.tags.join(", ") : ""), [E, j] = m(t?.status ?? "PUBLISHED"), [M, F] = m(t?.relatedAssetId ?? ""), [I, L] = m(t?.relatedIncidentId ?? ""), ne = () => {
110
+ l(""), h(""), _(!1), y(""), x(""), w(""), j("PUBLISHED"), F(""), L("");
111
+ }, [Y, { loading: Z }] = T(q, {
112
+ onCompleted: (e) => {
113
+ i.success("Article published", `${e.createKnowledgeArticle.title} is now available.`), ne(), n(!1), r();
114
+ },
115
+ onError: (e) => i.error("Could not publish article", e.message)
116
+ }), [ie, { loading: Q }] = T(J, {
117
+ refetchQueries: ["AssetHandlerKnowledgeArticles"],
118
+ onCompleted: (e) => {
119
+ i.success("Article updated", `${e.updateKnowledgeArticle.title} has been saved.`), n(!1), r();
120
+ },
121
+ onError: (e) => i.error("Could not update article", e.message)
122
+ }), $ = p(() => o.find((e) => e.id === M), [o, M]), ae = p(() => s.find((e) => e.id === I), [s, I]), oe = (e) => {
123
+ l(e), g || h(X(e));
124
+ };
125
+ return /* @__PURE__ */ k(D, { children: [
126
+ /* @__PURE__ */ k(z, { children: [/* @__PURE__ */ O(B, { children: a ? "Edit article" : "New Article" }), /* @__PURE__ */ O(R, { children: a ? "Update the runbook or fix so the team has the latest guidance." : "Capture a runbook or fix so your team can find it later." })] }),
127
+ /* @__PURE__ */ k("div", {
128
+ className: "space-y-4",
101
129
  children: [
102
- /* @__PURE__ */ w(P, { children: [/* @__PURE__ */ C(F, { children: "New Article" }), /* @__PURE__ */ C(M, { children: "Capture a runbook or fix so your team can find it later." })] }),
103
- /* @__PURE__ */ w("div", {
104
- className: "space-y-4",
105
- children: [
106
- /* @__PURE__ */ w("div", {
107
- className: "grid gap-4 md:grid-cols-2",
108
- children: [/* @__PURE__ */ w("div", {
109
- className: "space-y-2",
110
- children: [/* @__PURE__ */ C(k, { children: "Title *" }), /* @__PURE__ */ C(O, {
111
- value: i,
112
- onChange: (e) => E(e.target.value)
113
- })]
114
- }), /* @__PURE__ */ w("div", {
115
- className: "space-y-2",
116
- children: [/* @__PURE__ */ C(k, { children: "Slug *" }), /* @__PURE__ */ C(O, {
117
- value: o,
118
- onChange: (e) => {
119
- l(!0), s(e.target.value);
120
- }
121
- })]
122
- })]
123
- }),
124
- /* @__PURE__ */ w("div", {
125
- className: "space-y-2",
126
- children: [/* @__PURE__ */ C(k, { children: "Summary" }), /* @__PURE__ */ C(O, {
127
- placeholder: "One-line description",
128
- value: u,
129
- onChange: (e) => f(e.target.value)
130
- })]
131
- }),
132
- /* @__PURE__ */ w("div", {
133
- className: "space-y-2",
134
- children: [/* @__PURE__ */ C(k, { children: "Body *" }), /* @__PURE__ */ C(V, {
135
- placeholder: "Write the full article body — steps, context, links…",
136
- value: p,
137
- onChange: (e) => m(e.target.value),
138
- rows: 8
139
- })]
140
- }),
141
- /* @__PURE__ */ w("div", {
142
- className: "grid gap-4 md:grid-cols-2",
143
- children: [/* @__PURE__ */ w("div", {
144
- className: "space-y-2",
145
- children: [/* @__PURE__ */ C(k, { children: "Category tags" }), /* @__PURE__ */ C(O, {
146
- placeholder: "Runbooks, Fixes, Procedures…",
147
- value: h,
148
- onChange: (e) => g(e.target.value)
149
- })]
150
- }), /* @__PURE__ */ w("div", {
151
- className: "space-y-2",
152
- children: [/* @__PURE__ */ C(k, { children: "Status" }), /* @__PURE__ */ w(I, {
153
- value: _,
154
- onValueChange: (e) => v(e),
155
- children: [/* @__PURE__ */ C(z, { children: /* @__PURE__ */ C(B, {}) }), /* @__PURE__ */ C(L, { children: W.map((e) => /* @__PURE__ */ C(R, {
156
- value: e,
157
- children: e
158
- }, e)) })]
159
- })]
160
- })]
161
- })
162
- ]
130
+ /* @__PURE__ */ k("div", {
131
+ className: "grid gap-4 md:grid-cols-2",
132
+ children: [/* @__PURE__ */ k("div", {
133
+ className: "space-y-2",
134
+ children: [/* @__PURE__ */ O(P, { children: "Title *" }), /* @__PURE__ */ O(N, {
135
+ value: c,
136
+ onChange: (e) => oe(e.target.value)
137
+ })]
138
+ }), /* @__PURE__ */ k("div", {
139
+ className: "space-y-2",
140
+ children: [/* @__PURE__ */ O(P, { children: "Slug *" }), /* @__PURE__ */ O(N, {
141
+ value: u,
142
+ disabled: a,
143
+ onChange: (e) => {
144
+ _(!0), h(e.target.value);
145
+ }
146
+ })]
147
+ })]
163
148
  }),
164
- /* @__PURE__ */ w(N, { children: [/* @__PURE__ */ C(T, {
165
- variant: "outline",
166
- onClick: () => t(!1),
167
- disabled: S,
168
- children: "Cancel"
169
- }), /* @__PURE__ */ C(T, {
170
- onClick: () => {
171
- if (!i.trim() || !o.trim()) {
172
- r.warning("Missing details", "Title and slug are required.");
173
- return;
174
- }
175
- if (!p.trim()) {
176
- r.warning("Body required", "Write the article body before publishing.");
177
- return;
178
- }
179
- let e = h.split(",").map((e) => e.trim()).filter((e) => e.length > 0);
180
- x({ variables: { input: {
181
- title: i.trim(),
182
- slug: o.trim(),
183
- summary: u.trim() || null,
184
- content: p.trim(),
185
- tags: e,
186
- status: _
187
- } } });
188
- },
189
- disabled: S,
190
- children: S ? "Publishing…" : "Publish article"
191
- })] })
149
+ /* @__PURE__ */ k("div", {
150
+ className: "space-y-2",
151
+ children: [/* @__PURE__ */ O(P, { children: "Summary" }), /* @__PURE__ */ O(N, {
152
+ placeholder: "One-line description",
153
+ value: v,
154
+ onChange: (e) => y(e.target.value)
155
+ })]
156
+ }),
157
+ /* @__PURE__ */ k("div", {
158
+ className: "space-y-2",
159
+ children: [/* @__PURE__ */ O(P, { children: "Body *" }), /* @__PURE__ */ O(K, {
160
+ placeholder: "Write the full article body — steps, context, links…",
161
+ value: b,
162
+ onChange: (e) => x(e.target.value),
163
+ rows: 8
164
+ })]
165
+ }),
166
+ /* @__PURE__ */ k("div", {
167
+ className: "grid gap-4 md:grid-cols-2",
168
+ children: [/* @__PURE__ */ k("div", {
169
+ className: "space-y-2",
170
+ children: [/* @__PURE__ */ O(P, { children: "Category tags" }), /* @__PURE__ */ O(N, {
171
+ placeholder: "Runbooks, Fixes, Procedures…",
172
+ value: S,
173
+ onChange: (e) => w(e.target.value)
174
+ })]
175
+ }), /* @__PURE__ */ k("div", {
176
+ className: "space-y-2",
177
+ children: [/* @__PURE__ */ O(P, { children: "Status" }), /* @__PURE__ */ k(V, {
178
+ value: E,
179
+ onValueChange: j,
180
+ children: [/* @__PURE__ */ O(W, { children: /* @__PURE__ */ O(G, {}) }), /* @__PURE__ */ O(H, { children: re.map((e) => /* @__PURE__ */ O(U, {
181
+ value: e,
182
+ children: e
183
+ }, e)) })]
184
+ })]
185
+ })]
186
+ }),
187
+ /* @__PURE__ */ k("div", {
188
+ className: "grid gap-4 md:grid-cols-2",
189
+ children: [/* @__PURE__ */ k("div", {
190
+ className: "space-y-2",
191
+ children: [
192
+ /* @__PURE__ */ O(P, { children: "Related asset" }),
193
+ /* @__PURE__ */ k(V, {
194
+ value: M,
195
+ onValueChange: F,
196
+ children: [/* @__PURE__ */ O(W, { children: /* @__PURE__ */ O(G, { placeholder: "Select an asset" }) }), /* @__PURE__ */ k(H, { children: [/* @__PURE__ */ O(U, {
197
+ value: "",
198
+ children: "None"
199
+ }), o.map((e) => /* @__PURE__ */ O(U, {
200
+ value: e.id,
201
+ children: d(e)
202
+ }, e.id))] })]
203
+ }),
204
+ $ ? /* @__PURE__ */ O("div", {
205
+ className: "flex flex-wrap gap-2",
206
+ children: /* @__PURE__ */ k("span", {
207
+ className: "inline-flex items-center gap-1 rounded-full bg-action-primary-bg/10 px-2 py-0.5 text-xs font-medium text-primary",
208
+ children: [d($), /* @__PURE__ */ O("button", {
209
+ type: "button",
210
+ onClick: () => F(""),
211
+ className: "rounded-full p-0.5 hover:bg-action-primary-bg/20",
212
+ "aria-label": "Clear related asset",
213
+ children: /* @__PURE__ */ O(C, { className: "h-3 w-3" })
214
+ })]
215
+ })
216
+ }) : null
217
+ ]
218
+ }), /* @__PURE__ */ k("div", {
219
+ className: "space-y-2",
220
+ children: [
221
+ /* @__PURE__ */ O(P, { children: "Related incident" }),
222
+ /* @__PURE__ */ k(V, {
223
+ value: I,
224
+ onValueChange: L,
225
+ children: [/* @__PURE__ */ O(W, { children: /* @__PURE__ */ O(G, { placeholder: "Select an incident" }) }), /* @__PURE__ */ k(H, { children: [/* @__PURE__ */ O(U, {
226
+ value: "",
227
+ children: "None"
228
+ }), s.map((e) => /* @__PURE__ */ O(U, {
229
+ value: e.id,
230
+ children: f(e)
231
+ }, e.id))] })]
232
+ }),
233
+ ae ? /* @__PURE__ */ O("div", {
234
+ className: "flex flex-wrap gap-2",
235
+ children: /* @__PURE__ */ k("span", {
236
+ className: "inline-flex items-center gap-1 rounded-full bg-action-primary-bg/10 px-2 py-0.5 text-xs font-medium text-primary",
237
+ children: [f(ae), /* @__PURE__ */ O("button", {
238
+ type: "button",
239
+ onClick: () => L(""),
240
+ className: "rounded-full p-0.5 hover:bg-action-primary-bg/20",
241
+ "aria-label": "Clear related incident",
242
+ children: /* @__PURE__ */ O(C, { className: "h-3 w-3" })
243
+ })]
244
+ })
245
+ }) : null
246
+ ]
247
+ })]
248
+ })
192
249
  ]
193
- })
194
- });
250
+ }),
251
+ /* @__PURE__ */ k(te, { children: [/* @__PURE__ */ O(A, {
252
+ variant: "outline",
253
+ onClick: () => n(!1),
254
+ disabled: Z || Q,
255
+ children: "Cancel"
256
+ }), /* @__PURE__ */ O(A, {
257
+ onClick: () => {
258
+ if (!c.trim() || !u.trim()) {
259
+ i.warning("Missing details", "Title and slug are required.");
260
+ return;
261
+ }
262
+ if (!b.trim()) {
263
+ i.warning("Body required", "Write the article body before publishing.");
264
+ return;
265
+ }
266
+ let e = ee(S), n = {
267
+ title: c.trim(),
268
+ summary: v.trim() || null,
269
+ content: b.trim(),
270
+ tags: e,
271
+ status: E,
272
+ relatedAssetId: M || null,
273
+ relatedIncidentId: I || null
274
+ };
275
+ a && t ? ie({ variables: {
276
+ id: t.id,
277
+ input: n
278
+ } }) : Y({ variables: { input: {
279
+ ...n,
280
+ slug: u.trim()
281
+ } } });
282
+ },
283
+ disabled: Z || Q,
284
+ children: a ? Q ? "Saving…" : "Save changes" : Z ? "Publishing…" : "Publish article"
285
+ })] })
286
+ ] });
195
287
  }
196
- function ie({ article: e, onOpenChange: n }) {
197
- let r = t();
198
- return /* @__PURE__ */ C(A, {
288
+ function se({ article: e, onOpenChange: t, onEdit: r }) {
289
+ let i = n();
290
+ return /* @__PURE__ */ O(I, {
199
291
  open: !!e,
200
- onOpenChange: n,
201
- children: /* @__PURE__ */ C(j, {
292
+ onOpenChange: t,
293
+ children: /* @__PURE__ */ O(L, {
202
294
  className: "max-h-[85vh] overflow-y-auto sm:max-w-2xl",
203
- children: e ? /* @__PURE__ */ w(S, { children: [
204
- /* @__PURE__ */ w(P, { children: [
205
- /* @__PURE__ */ w("div", {
206
- className: "flex flex-wrap items-center gap-2",
207
- children: [/* @__PURE__ */ C(J, { status: e.status }), e.tags.map((e) => /* @__PURE__ */ C("span", {
208
- className: "rounded-full bg-action-primary-bg/10 px-2 py-0.5 text-xs font-medium text-primary",
209
- children: e
210
- }, e))]
211
- }),
212
- /* @__PURE__ */ C(F, {
213
- className: "mt-1",
214
- children: e.title
215
- }),
216
- /* @__PURE__ */ w(M, { children: [
217
- "Updated ",
218
- q(e.updatedAt),
219
- " · ",
220
- e.views.toLocaleString(),
221
- " views"
222
- ] })
223
- ] }),
224
- /* @__PURE__ */ C("div", {
295
+ children: e ? /* @__PURE__ */ k(D, { children: [
296
+ /* @__PURE__ */ k(z, { children: [/* @__PURE__ */ k("div", {
297
+ className: "flex flex-wrap items-center gap-2",
298
+ children: [/* @__PURE__ */ O($, { status: e.status }), e.tags.map((e) => /* @__PURE__ */ O("span", {
299
+ className: "rounded-full bg-action-primary-bg/10 px-2 py-0.5 text-xs font-medium text-primary",
300
+ children: e
301
+ }, e))]
302
+ }), /* @__PURE__ */ k("div", {
303
+ className: "flex items-start justify-between gap-4",
304
+ children: [/* @__PURE__ */ k("div", {
305
+ className: "min-w-0 flex-1",
306
+ children: [/* @__PURE__ */ O(B, {
307
+ className: "mt-1",
308
+ children: e.title
309
+ }), /* @__PURE__ */ k(R, { children: [
310
+ "Updated ",
311
+ Z(e.updatedAt),
312
+ " · ",
313
+ e.views.toLocaleString(),
314
+ " views"
315
+ ] })]
316
+ }), /* @__PURE__ */ k(A, {
317
+ variant: "outline",
318
+ size: "sm",
319
+ onClick: () => {
320
+ t(!1), r(e);
321
+ },
322
+ children: [/* @__PURE__ */ O(y, { className: "mr-1.5 h-3.5 w-3.5" }), "Edit"]
323
+ })]
324
+ })] }),
325
+ /* @__PURE__ */ O("div", {
225
326
  className: "whitespace-pre-wrap text-sm leading-relaxed text-text-primary",
226
327
  children: e.content
227
328
  }),
228
- e.relatedAssetId || e.relatedIncidentId ? /* @__PURE__ */ w("div", {
329
+ e.relatedAssetId || e.relatedIncidentId ? /* @__PURE__ */ k("div", {
229
330
  className: "mt-4 space-y-2 border-t border-border-seam pt-4",
230
- children: [/* @__PURE__ */ w("h4", {
331
+ children: [/* @__PURE__ */ k("h4", {
231
332
  className: "flex items-center gap-1.5 text-xs font-semibold uppercase tracking-wide text-text-secondary",
232
- children: [/* @__PURE__ */ C(h, { className: "h-3.5 w-3.5" }), "Linked records"]
233
- }), /* @__PURE__ */ w("div", {
333
+ children: [/* @__PURE__ */ O(v, { className: "h-3.5 w-3.5" }), "Linked records"]
334
+ }), /* @__PURE__ */ k("div", {
234
335
  className: "flex flex-wrap gap-2",
235
- children: [e.relatedAssetId ? /* @__PURE__ */ w(T, {
336
+ children: [e.relatedAssetId ? /* @__PURE__ */ k(A, {
236
337
  variant: "outline",
237
338
  size: "sm",
238
339
  onClick: () => {
239
- n(!1), r(`/assets/${e.relatedAssetId}`);
340
+ t(!1), i(`/assets/${e.relatedAssetId}`);
240
341
  },
241
- children: ["View linked asset", /* @__PURE__ */ C(p, { className: "ml-1.5 h-3.5 w-3.5" })]
242
- }) : null, e.relatedIncidentId ? /* @__PURE__ */ w(T, {
342
+ children: ["View linked asset", /* @__PURE__ */ O(g, { className: "ml-1.5 h-3.5 w-3.5" })]
343
+ }) : null, e.relatedIncidentId ? /* @__PURE__ */ k(A, {
243
344
  variant: "outline",
244
345
  size: "sm",
245
346
  onClick: () => {
246
- n(!1), r(`/itil/incidents/${e.relatedIncidentId}`);
347
+ t(!1), i(`/itil/incidents/${e.relatedIncidentId}`);
247
348
  },
248
- children: ["View linked incident", /* @__PURE__ */ C(p, { className: "ml-1.5 h-3.5 w-3.5" })]
349
+ children: ["View linked incident", /* @__PURE__ */ O(g, { className: "ml-1.5 h-3.5 w-3.5" })]
249
350
  }) : null]
250
351
  })]
251
352
  }) : null
@@ -253,90 +354,96 @@ function ie({ article: e, onOpenChange: n }) {
253
354
  })
254
355
  });
255
356
  }
256
- function Y() {
257
- let [t, r] = d(!1), [p, h] = d(""), [y, b] = d("ALL"), [S, A] = d("ALL"), [j, M] = d("recent"), [N, P] = d(null), { data: F, loading: V, refetch: U } = x(H, { fetchPolicy: "cache-and-network" }), K = u(() => F?.knowledgeArticles ?? [], [F?.knowledgeArticles]), Y = u(() => {
357
+ function ce() {
358
+ let [e, n] = m(!1), [i, d] = m(null), [f, ee] = m(""), [g, v] = m("ALL"), [y, C] = m("ALL"), [w, T] = m("recent"), [D, I] = m(null), { data: L, loading: R, refetch: te } = E(ne, { fetchPolicy: "cache-and-network" }), z = p(() => L?.knowledgeArticles ?? [], [L?.knowledgeArticles]), B = p(() => {
258
359
  let e = /* @__PURE__ */ new Map();
259
- for (let t of K) for (let n of t.tags) e.set(n, (e.get(n) ?? 0) + 1);
360
+ for (let t of z) for (let n of t.tags) e.set(n, (e.get(n) ?? 0) + 1);
260
361
  return [...e.entries()].sort((e, t) => t[1] - e[1]);
261
- }, [K]), X = u(() => {
262
- let e = p.trim().toLowerCase();
263
- return [...K.filter((t) => y !== "ALL" && !t.tags.includes(y) || S !== "ALL" && t.status !== S ? !1 : e ? [
362
+ }, [z]), K = p(() => {
363
+ let e = f.trim().toLowerCase();
364
+ return [...z.filter((t) => g !== "ALL" && !t.tags.includes(g) || y !== "ALL" && t.status !== y ? !1 : e ? [
264
365
  t.title,
265
366
  t.summary ?? "",
266
367
  t.content,
267
368
  t.tags.join(" ")
268
- ].join(" ").toLowerCase().includes(e) : !0)].sort((e, t) => j === "views" ? t.views - e.views : new Date(t.updatedAt).getTime() - new Date(e.updatedAt).getTime());
369
+ ].join(" ").toLowerCase().includes(e) : !0)].sort((e, t) => w === "views" ? t.views - e.views : new Date(t.updatedAt).getTime() - new Date(e.updatedAt).getTime());
269
370
  }, [
270
- K,
271
- p,
371
+ z,
372
+ f,
373
+ g,
272
374
  y,
273
- S,
274
- j
275
- ]), Z = u(() => {
276
- let t = K.reduce((e, t) => (e[t.status] = (e[t.status] ?? 0) + 1, e), {});
277
- return Object.entries(t).map(([t, n], r) => ({
278
- name: G[t]?.label ?? t,
375
+ w
376
+ ]), q = p(() => {
377
+ let e = z.reduce((e, t) => (e[t.status] = (e[t.status] ?? 0) + 1, e), {});
378
+ return Object.entries(e).map(([e, n], r) => ({
379
+ name: Y[e]?.label ?? e,
279
380
  value: n,
280
- color: e(r)
381
+ color: t(r)
281
382
  }));
282
- }, [K]), Q = u(() => [...K].filter((e) => e.views > 0).sort((e, t) => t.views - e.views).slice(0, 6).map((e) => ({
383
+ }, [z]), J = p(() => [...z].filter((e) => e.views > 0).sort((e, t) => t.views - e.views).slice(0, 6).map((e) => ({
283
384
  name: e.title,
284
385
  views: e.views
285
- })), [K]), $ = s(X, {
386
+ })), [z]), X = c(K, {
286
387
  pageSize: 9,
287
- resetKey: `${p}|${y}|${S}|${j}`
388
+ resetKey: `${f}|${g}|${y}|${w}`
288
389
  });
289
- return /* @__PURE__ */ w("div", {
390
+ return /* @__PURE__ */ k("div", {
290
391
  className: "space-y-5 p-4 sm:p-6",
291
392
  children: [
292
- /* @__PURE__ */ C(l, {
393
+ /* @__PURE__ */ O(u, {
293
394
  hero: !0,
294
- icon: f,
395
+ icon: h,
295
396
  title: "Knowledge Base",
296
397
  description: "Turn one-off fixes and runbooks into repeatable, searchable operational knowledge.",
297
- actions: /* @__PURE__ */ w(T, {
398
+ actions: /* @__PURE__ */ k(A, {
298
399
  className: "w-full sm:w-auto",
299
- onClick: () => r(!0),
300
- children: [/* @__PURE__ */ C(g, { className: "mr-2 h-4 w-4" }), "New Article"]
400
+ onClick: () => {
401
+ d(null), n(!0);
402
+ },
403
+ children: [/* @__PURE__ */ O(b, { className: "mr-2 h-4 w-4" }), "New Article"]
301
404
  })
302
405
  }),
303
- /* @__PURE__ */ C(ee, { children: "Capture the fixes and runbooks your team relies on so the next person doesn't start from scratch. Link articles to incidents and assets, then search them when troubleshooting." }),
304
- /* @__PURE__ */ C(re, {
305
- open: t,
306
- onOpenChange: r,
307
- onPublished: () => void U()
406
+ /* @__PURE__ */ O(F, { children: "Capture the fixes and runbooks your team relies on so the next person doesn't start from scratch. Link articles to incidents and assets, then search them when troubleshooting." }),
407
+ /* @__PURE__ */ O(ae, {
408
+ open: e,
409
+ onOpenChange: n,
410
+ article: i,
411
+ onSaved: () => void te()
308
412
  }),
309
- /* @__PURE__ */ C(ie, {
310
- article: N,
311
- onOpenChange: (e) => !e && P(null)
413
+ /* @__PURE__ */ O(se, {
414
+ article: D,
415
+ onOpenChange: (e) => !e && I(null),
416
+ onEdit: (e) => {
417
+ I(null), d(e), n(!0);
418
+ }
312
419
  }),
313
- /* @__PURE__ */ w("div", {
420
+ /* @__PURE__ */ k("div", {
314
421
  className: "relative",
315
- children: [/* @__PURE__ */ C(_, { className: "absolute left-3.5 top-1/2 h-4.5 w-4.5 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ C(O, {
422
+ children: [/* @__PURE__ */ O(x, { className: "absolute left-3.5 top-1/2 h-4.5 w-4.5 -translate-y-1/2 text-text-secondary" }), /* @__PURE__ */ O(N, {
316
423
  className: "h-12 pl-11 text-base",
317
424
  placeholder: "Search runbooks, fixes and procedures…",
318
- value: p,
319
- onChange: (e) => h(e.target.value),
425
+ value: f,
426
+ onChange: (e) => ee(e.target.value),
320
427
  "aria-label": "Search knowledge articles"
321
428
  })]
322
429
  }),
323
- K.length > 0 && (Z.length > 0 || Q.length > 0) ? /* @__PURE__ */ w("div", {
430
+ z.length > 0 && (q.length > 0 || J.length > 0) ? /* @__PURE__ */ k("div", {
324
431
  className: "grid gap-4 lg:grid-cols-2",
325
- children: [/* @__PURE__ */ C(c, {
432
+ children: [/* @__PURE__ */ O(l, {
326
433
  title: "Publishing status",
327
434
  subtitle: "Articles by status",
328
- children: /* @__PURE__ */ C(a, {
329
- data: Z,
435
+ children: /* @__PURE__ */ O(o, {
436
+ data: q,
330
437
  height: 200,
331
438
  centerLabel: "Articles",
332
- centerValue: K.length,
439
+ centerValue: z.length,
333
440
  ariaLabel: "Articles by status"
334
441
  })
335
- }), /* @__PURE__ */ C(c, {
442
+ }), /* @__PURE__ */ O(l, {
336
443
  title: "Most consulted",
337
444
  subtitle: "Top articles by views",
338
- children: /* @__PURE__ */ C(i, {
339
- data: Q,
445
+ children: /* @__PURE__ */ O(a, {
446
+ data: J,
340
447
  xKey: "name",
341
448
  series: [{
342
449
  key: "views",
@@ -350,89 +457,89 @@ function Y() {
350
457
  })
351
458
  })]
352
459
  }) : null,
353
- /* @__PURE__ */ w("div", {
460
+ /* @__PURE__ */ k("div", {
354
461
  className: "grid gap-5 lg:grid-cols-[200px_1fr]",
355
- children: [/* @__PURE__ */ w("aside", {
462
+ children: [/* @__PURE__ */ k("aside", {
356
463
  className: "space-y-3",
357
464
  children: [
358
- /* @__PURE__ */ w("div", {
465
+ /* @__PURE__ */ k("div", {
359
466
  className: "flex items-center justify-between gap-2",
360
- children: [/* @__PURE__ */ C("h3", {
467
+ children: [/* @__PURE__ */ O("h3", {
361
468
  className: "text-sm font-semibold text-text-primary",
362
469
  children: "Category"
363
- }), /* @__PURE__ */ w(I, {
364
- value: j,
365
- onValueChange: (e) => M(e),
366
- children: [/* @__PURE__ */ C(z, {
470
+ }), /* @__PURE__ */ k(V, {
471
+ value: w,
472
+ onValueChange: (e) => T(e),
473
+ children: [/* @__PURE__ */ O(W, {
367
474
  className: "h-8 w-[130px] text-xs lg:hidden",
368
- children: /* @__PURE__ */ C(B, {})
369
- }), /* @__PURE__ */ w(L, { children: [/* @__PURE__ */ C(R, {
475
+ children: /* @__PURE__ */ O(G, {})
476
+ }), /* @__PURE__ */ k(H, { children: [/* @__PURE__ */ O(U, {
370
477
  value: "recent",
371
478
  children: "Recently updated"
372
- }), /* @__PURE__ */ C(R, {
479
+ }), /* @__PURE__ */ O(U, {
373
480
  value: "views",
374
481
  children: "Most viewed"
375
482
  })] })]
376
483
  })]
377
484
  }),
378
- /* @__PURE__ */ w("div", {
485
+ /* @__PURE__ */ k("div", {
379
486
  className: "flex gap-2 overflow-x-auto pb-1 lg:flex-col lg:overflow-visible lg:pb-0",
380
- children: [/* @__PURE__ */ w("button", {
487
+ children: [/* @__PURE__ */ k("button", {
381
488
  type: "button",
382
- onClick: () => b("ALL"),
383
- className: n("shrink-0 rounded-md px-3 py-1.5 text-left text-sm font-medium transition-colors lg:w-full", y === "ALL" ? "bg-action-primary-bg/10 text-primary" : "text-text-secondary hover:text-text-primary"),
384
- children: ["All articles", /* @__PURE__ */ C("span", {
489
+ onClick: () => v("ALL"),
490
+ className: r("shrink-0 rounded-md px-3 py-1.5 text-left text-sm font-medium transition-colors lg:w-full", g === "ALL" ? "bg-action-primary-bg/10 text-primary" : "text-text-secondary hover:text-text-primary"),
491
+ children: ["All articles", /* @__PURE__ */ O("span", {
385
492
  className: "ml-1.5 text-xs text-text-muted tabular-nums",
386
- children: K.length
493
+ children: z.length
387
494
  })]
388
- }), Y.map(([e, t]) => /* @__PURE__ */ w("button", {
495
+ }), B.map(([e, t]) => /* @__PURE__ */ k("button", {
389
496
  type: "button",
390
- onClick: () => b(e),
391
- className: n("flex shrink-0 items-center justify-between gap-2 rounded-md px-3 py-1.5 text-left text-sm font-medium transition-colors lg:w-full", y === e ? "bg-action-primary-bg/10 text-primary" : "text-text-secondary hover:text-text-primary"),
392
- children: [/* @__PURE__ */ C("span", {
497
+ onClick: () => v(e),
498
+ className: r("flex shrink-0 items-center justify-between gap-2 rounded-md px-3 py-1.5 text-left text-sm font-medium transition-colors lg:w-full", g === e ? "bg-action-primary-bg/10 text-primary" : "text-text-secondary hover:text-text-primary"),
499
+ children: [/* @__PURE__ */ O("span", {
393
500
  className: "truncate",
394
501
  children: e
395
- }), /* @__PURE__ */ C("span", {
502
+ }), /* @__PURE__ */ O("span", {
396
503
  className: "text-xs text-text-muted tabular-nums",
397
504
  children: t
398
505
  })]
399
506
  }, e))]
400
507
  }),
401
- /* @__PURE__ */ w("div", {
508
+ /* @__PURE__ */ k("div", {
402
509
  className: "hidden space-y-1.5 border-t border-border-seam pt-3 lg:block",
403
510
  children: [
404
- /* @__PURE__ */ C(k, {
511
+ /* @__PURE__ */ O(P, {
405
512
  className: "text-xs",
406
513
  children: "Status"
407
514
  }),
408
- /* @__PURE__ */ w(I, {
409
- value: S,
410
- onValueChange: A,
411
- children: [/* @__PURE__ */ C(z, {
515
+ /* @__PURE__ */ k(V, {
516
+ value: y,
517
+ onValueChange: C,
518
+ children: [/* @__PURE__ */ O(W, {
412
519
  className: "h-9",
413
- children: /* @__PURE__ */ C(B, {})
414
- }), /* @__PURE__ */ w(L, { children: [/* @__PURE__ */ C(R, {
520
+ children: /* @__PURE__ */ O(G, {})
521
+ }), /* @__PURE__ */ k(H, { children: [/* @__PURE__ */ O(U, {
415
522
  value: "ALL",
416
523
  children: "All statuses"
417
- }), W.map((e) => /* @__PURE__ */ C(R, {
524
+ }), re.map((e) => /* @__PURE__ */ O(U, {
418
525
  value: e,
419
526
  children: e
420
527
  }, e))] })]
421
528
  }),
422
- /* @__PURE__ */ C(k, {
529
+ /* @__PURE__ */ O(P, {
423
530
  className: "text-xs",
424
531
  children: "Sort"
425
532
  }),
426
- /* @__PURE__ */ w(I, {
427
- value: j,
428
- onValueChange: (e) => M(e),
429
- children: [/* @__PURE__ */ C(z, {
533
+ /* @__PURE__ */ k(V, {
534
+ value: w,
535
+ onValueChange: (e) => T(e),
536
+ children: [/* @__PURE__ */ O(W, {
430
537
  className: "h-9",
431
- children: /* @__PURE__ */ C(B, {})
432
- }), /* @__PURE__ */ w(L, { children: [/* @__PURE__ */ C(R, {
538
+ children: /* @__PURE__ */ O(G, {})
539
+ }), /* @__PURE__ */ k(H, { children: [/* @__PURE__ */ O(U, {
433
540
  value: "recent",
434
541
  children: "Recently updated"
435
- }), /* @__PURE__ */ C(R, {
542
+ }), /* @__PURE__ */ O(U, {
436
543
  value: "views",
437
544
  children: "Most viewed"
438
545
  })] })]
@@ -440,73 +547,73 @@ function Y() {
440
547
  ]
441
548
  })
442
549
  ]
443
- }), /* @__PURE__ */ w("div", { children: [
444
- V && K.length === 0 ? /* @__PURE__ */ C("div", {
550
+ }), /* @__PURE__ */ k("div", { children: [
551
+ R && z.length === 0 ? /* @__PURE__ */ O("div", {
445
552
  className: "grid gap-4 sm:grid-cols-2 xl:grid-cols-3",
446
- children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ C("div", { className: "h-40 rounded-xl bg-bg-sunken motion-safe:animate-vc-shimmer" }, t))
553
+ children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ O("div", { className: "h-40 rounded-xl bg-bg-sunken motion-safe:animate-vc-shimmer" }, t))
447
554
  }) : null,
448
- !V && X.length === 0 ? /* @__PURE__ */ C(D, {
449
- illustration: p || y !== "ALL" || S !== "ALL" ? "empty-search" : "empty-data",
450
- title: p || y !== "ALL" || S !== "ALL" ? "No articles match your filters" : "No knowledge articles found",
451
- description: p || y !== "ALL" || S !== "ALL" ? "Try a different term, category or status." : "Publish an article to start building your knowledge base."
555
+ !R && K.length === 0 ? /* @__PURE__ */ O(M, {
556
+ illustration: f || g !== "ALL" || y !== "ALL" ? "empty-search" : "empty-data",
557
+ title: f || g !== "ALL" || y !== "ALL" ? "No articles match your filters" : "No knowledge articles found",
558
+ description: f || g !== "ALL" || y !== "ALL" ? "Try a different term, category or status." : "Publish an article to start building your knowledge base."
452
559
  }) : null,
453
- /* @__PURE__ */ C("div", {
560
+ /* @__PURE__ */ O("div", {
454
561
  className: "grid gap-4 sm:grid-cols-2 xl:grid-cols-3",
455
- children: $.pageItems.map((e) => /* @__PURE__ */ C(E, {
562
+ children: X.pageItems.map((e) => /* @__PURE__ */ O(j, {
456
563
  treatment: "glass",
457
564
  className: "border-border-seam",
458
- children: /* @__PURE__ */ w("button", {
565
+ children: /* @__PURE__ */ k("button", {
459
566
  type: "button",
460
- onClick: () => P(e),
567
+ onClick: () => I(e),
461
568
  className: "flex h-full w-full flex-col gap-3 p-4 text-left",
462
569
  children: [
463
- /* @__PURE__ */ w("div", {
570
+ /* @__PURE__ */ k("div", {
464
571
  className: "flex flex-wrap items-center gap-1.5",
465
- children: [/* @__PURE__ */ C(J, { status: e.status }), e.tags.slice(0, 1).map((e) => /* @__PURE__ */ C("span", {
572
+ children: [/* @__PURE__ */ O($, { status: e.status }), e.tags.slice(0, 1).map((e) => /* @__PURE__ */ O("span", {
466
573
  className: "rounded-full bg-action-primary-bg/10 px-2 py-0.5 text-xs font-medium text-primary",
467
574
  children: e
468
575
  }, e))]
469
576
  }),
470
- /* @__PURE__ */ C("h2", {
577
+ /* @__PURE__ */ O("h2", {
471
578
  className: "line-clamp-2 text-base font-semibold text-text-primary",
472
579
  children: e.title
473
580
  }),
474
- /* @__PURE__ */ C("p", {
581
+ /* @__PURE__ */ O("p", {
475
582
  className: "line-clamp-2 flex-1 text-sm text-text-secondary",
476
- children: te(e)
583
+ children: ie(e)
477
584
  }),
478
- /* @__PURE__ */ w("div", {
585
+ /* @__PURE__ */ k("div", {
479
586
  className: "flex items-center justify-between gap-2 border-t border-border-seam/60 pt-3",
480
- children: [/* @__PURE__ */ w("div", {
587
+ children: [/* @__PURE__ */ k("div", {
481
588
  className: "flex min-w-0 items-center gap-2",
482
- children: [/* @__PURE__ */ C("span", {
589
+ children: [/* @__PURE__ */ O("span", {
483
590
  className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-bg-sunken text-[10px] font-semibold text-text-secondary",
484
- children: e.updatedBy ? ne(e.updatedBy) : /* @__PURE__ */ C(v, { className: "h-3 w-3" })
485
- }), /* @__PURE__ */ w("span", {
591
+ children: e.updatedBy ? Q(e.updatedBy) : /* @__PURE__ */ O(S, { className: "h-3 w-3" })
592
+ }), /* @__PURE__ */ k("span", {
486
593
  className: "truncate text-xs text-text-secondary",
487
- children: ["Updated ", q(e.updatedAt)]
594
+ children: ["Updated ", Z(e.updatedAt)]
488
595
  })]
489
- }), /* @__PURE__ */ w("span", {
596
+ }), /* @__PURE__ */ k("span", {
490
597
  className: "flex shrink-0 items-center gap-1 text-xs text-text-muted tabular-nums",
491
- children: [/* @__PURE__ */ C(m, { className: "h-3.5 w-3.5" }), e.views.toLocaleString()]
598
+ children: [/* @__PURE__ */ O(_, { className: "h-3.5 w-3.5" }), e.views.toLocaleString()]
492
599
  })]
493
600
  })
494
601
  ]
495
602
  })
496
603
  }, e.id))
497
604
  }),
498
- /* @__PURE__ */ C("div", {
605
+ /* @__PURE__ */ O("div", {
499
606
  className: "mt-4",
500
- children: /* @__PURE__ */ C(o, {
501
- page: $.page,
502
- pageCount: $.pageCount,
503
- rangeStart: $.rangeStart,
504
- rangeEnd: $.rangeEnd,
505
- totalItems: $.totalItems,
506
- canPrev: $.canPrev,
507
- canNext: $.canNext,
508
- onPrev: $.prevPage,
509
- onNext: $.nextPage,
607
+ children: /* @__PURE__ */ O(s, {
608
+ page: X.page,
609
+ pageCount: X.pageCount,
610
+ rangeStart: X.rangeStart,
611
+ rangeEnd: X.rangeEnd,
612
+ totalItems: X.totalItems,
613
+ canPrev: X.canPrev,
614
+ canNext: X.canNext,
615
+ onPrev: X.prevPage,
616
+ onNext: X.nextPage,
510
617
  itemLabel: "articles"
511
618
  })
512
619
  })
@@ -516,6 +623,6 @@ function Y() {
516
623
  });
517
624
  }
518
625
  //#endregion
519
- export { Y as KnowledgeBasePage };
626
+ export { ce as KnowledgeBasePage };
520
627
 
521
628
  //# sourceMappingURL=KnowledgeBasePage.js.map