@nivaro/react 0.3.46 → 0.3.48

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 (57) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +248 -16
  4. package/dist/index.js +679 -659
  5. package/dist/shared/components/CollectionBrowserView.js +813 -826
  6. package/dist/shared/components/ErrorNotice.js +169 -0
  7. package/dist/shared/components/ErrorSurface.js +23 -17
  8. package/dist/shared/components/ListLoadError.js +8 -29
  9. package/dist/shared/components/LoadErrorNote.js +38 -21
  10. package/dist/shared/components/QueryErrorState.js +8 -11
  11. package/dist/shared/components/ReportView.js +1320 -1291
  12. package/dist/shared/components/chat/ChannelArchive.js +60 -60
  13. package/dist/shared/components/chat/ChannelExtras.js +74 -74
  14. package/dist/shared/components/chat/ChatPanel.js +368 -367
  15. package/dist/shared/components/command-center/PeekPanel.js +33 -32
  16. package/dist/shared/components/command-center/panels/BoardSettings.js +41 -40
  17. package/dist/shared/components/command-center/panels/PeoplePanel.js +32 -31
  18. package/dist/shared/components/help-videos/editor/ClipsPanel.js +49 -48
  19. package/dist/shared/components/help-videos/editor/PublishButton.js +37 -36
  20. package/dist/shared/components/help-videos/editor/StatsTab.js +45 -44
  21. package/dist/shared/components/help-videos/editor/VersionsTab.js +29 -28
  22. package/dist/shared/components/help-videos/library/AuthorRolesButton.js +19 -18
  23. package/dist/shared/components/help-videos/library/HelpVideoLibrary.js +132 -129
  24. package/dist/shared/components/help-videos/library/LearningPathsPanel.js +42 -41
  25. package/dist/shared/components/help-videos/settings/HouseStyleButton.js +21 -20
  26. package/dist/shared/components/help-videos/settings/RenderSettingsButton.js +22 -21
  27. package/dist/shared/components/import/DocumentAutofillButton.js +24 -20
  28. package/dist/shared/components/import/ImportFromFileButton.js +61 -60
  29. package/dist/shared/components/imports/ImportStalenessControl.js +20 -21
  30. package/dist/shared/components/imports/NewImportDialog.js +29 -28
  31. package/dist/shared/components/imports/RunDetailSheet.js +63 -63
  32. package/dist/shared/components/item-edit/FieldRow.js +329 -329
  33. package/dist/shared/components/item-edit/InlineTableField.js +898 -898
  34. package/dist/shared/components/item-edit/PersonalDefaultControl.js +57 -56
  35. package/dist/shared/components/item-edit/PlanGrid.js +220 -221
  36. package/dist/shared/components/item-edit/RecordGrantTools.js +49 -48
  37. package/dist/shared/components/item-edit/placement-behaviour.js +68 -67
  38. package/dist/shared/components/layout-editor/inspector/ColumnFit.js +24 -23
  39. package/dist/shared/components/layout-editor/inspector/PickerPreview.js +17 -16
  40. package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +41 -41
  41. package/dist/shared/components/layout-editor/outputs/output-api.js +33 -31
  42. package/dist/shared/components/layout-editor/overview/overview-api.js +84 -83
  43. package/dist/shared/components/layout-editor/useLayoutDraft.js +47 -42
  44. package/dist/shared/components/monitoring/InactiveUserLinksView.js +10 -9
  45. package/dist/shared/components/panels/SlaClock.js +35 -36
  46. package/dist/shared/components/pipeline/PipelineEditorView.js +311 -312
  47. package/dist/shared/components/pipeline/TeamSuggestions.js +31 -30
  48. package/dist/shared/components/profile/AgentsPanel.js +73 -72
  49. package/dist/shared/components/profile/MailSuppressedPill.js +22 -21
  50. package/dist/shared/components/support/SupportRequestDialog.js +85 -81
  51. package/dist/shared/components/support/SupportView.js +94 -87
  52. package/dist/shared/lib/autofill-poll.js +21 -18
  53. package/dist/shared/lib/error-actions.js +85 -0
  54. package/dist/shared/lib/error-message.js +223 -82
  55. package/dist/shared/lib/error-toast.js +71 -13
  56. package/dist/shared/lib/safe-error.js +136 -38
  57. package/package.json +1 -1
@@ -1,113 +1,116 @@
1
1
  import { jsx as t, jsxs as a } from "react/jsx-runtime";
2
- import { useQueryClient as _e } from "@tanstack/react-query";
3
- import { Search as Pe, Upload as Te, Plus as ne, History as de, Pencil as Ee, EyeOff as Ae, Send as Re, Archive as Ve, Trash2 as Ie } from "lucide-react";
4
- import { useId as Le, useState as c, useRef as k, useEffect as U } from "react";
5
- import { toast as E } from "sonner";
6
- import { useNivaroClient as Oe, useApiFetchConfig as Ue, useItemEditAuth as He } from "../../../context.js";
2
+ import { useQueryClient as Pe } from "@tanstack/react-query";
3
+ import { Search as Ee, Upload as Te, Plus as de, History as ce, Pencil as Ae, EyeOff as Re, Send as Ve, Archive as Ie, Trash2 as Le } from "lucide-react";
4
+ import { useId as Oe, useState as c, useRef as k, useEffect as H } from "react";
5
+ import { toast as T } from "sonner";
6
+ import { useNivaroClient as Ue, useApiFetchConfig as He, useItemEditAuth as qe } from "../../../context.js";
7
+ import { userErrorMessage as A } from "../../../lib/safe-error.js";
7
8
  import { Button as n } from "../../ui/button.js";
8
- import { Input as qe } from "../../ui/input.js";
9
- import { modalHostOf as ze } from "../../ui/popover.js";
10
- import { useHelpVideoLibrary as Be, helpVideoApi as C, helpVideoKeys as y, helpVideoError as ce } from "../api.js";
11
- import { HelpVideoEditor as Fe } from "../editor/HelpVideoEditor.js";
12
- import { canRecord as Ke } from "../recorder/HelpVideoRecorder.js";
13
- import { useHelpVideoRecording as Qe, RECORDING_BUSY as je } from "../recorder/HelpVideoRecordingProvider.js";
9
+ import { Input as ze } from "../../ui/input.js";
10
+ import { modalHostOf as Be } from "../../ui/popover.js";
11
+ import { useHelpVideoLibrary as Fe, helpVideoApi as C, helpVideoKeys as y, helpVideoError as ue } from "../api.js";
12
+ import { HelpVideoEditor as Ke } from "../editor/HelpVideoEditor.js";
13
+ import { canRecord as Qe } from "../recorder/HelpVideoRecorder.js";
14
+ import { useHelpVideoRecording as je, RECORDING_BUSY as Me } from "../recorder/HelpVideoRecordingProvider.js";
14
15
  import { useHelpVideoUpload as Ge } from "../upload/HelpVideoUpload.js";
15
- import { emptyCopy as ue, progressLabel as Me, isGettingReady as Ye, formatDuration as Je, showingLabel as he } from "../viewer/format.js";
16
- import { HelpVideoSheet as Xe } from "../viewer/HelpVideoSheet.js";
17
- import { momentFromParams as Ze } from "../viewer/moments.js";
18
- import { LearningPathsPanel as We } from "./LearningPathsPanel.js";
19
- import { PurgeVideoDialog as et } from "./PurgeVideoDialog.js";
20
- import { RECORD_UNSUPPORTED as tt } from "../recorder/RecorderStatus.js";
21
- const at = {
16
+ import { emptyCopy as he, progressLabel as Ye, isGettingReady as Je, formatDuration as Xe, showingLabel as me } from "../viewer/format.js";
17
+ import { HelpVideoSheet as Ze } from "../viewer/HelpVideoSheet.js";
18
+ import { momentFromParams as We } from "../viewer/moments.js";
19
+ import { LearningPathsPanel as et } from "./LearningPathsPanel.js";
20
+ import { PurgeVideoDialog as tt } from "./PurgeVideoDialog.js";
21
+ import { RECORD_UNSUPPORTED as at } from "../recorder/RecorderStatus.js";
22
+ const rt = {
22
23
  published: "Published",
23
24
  draft: "Drafts",
24
25
  archived: "Archived",
25
26
  paths: "Paths"
26
- }, H = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan motion-reduce:transition-none";
27
- function kt({
28
- watchId: q,
29
- editId: z,
30
- onWatch: B,
27
+ }, q = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan motion-reduce:transition-none";
28
+ function $t({
29
+ watchId: z,
30
+ editId: B,
31
+ onWatch: F,
31
32
  onEdit: f,
32
- headerExtra: me,
33
- watchAt: pe = null,
34
- watchChapter: fe = null
33
+ headerExtra: pe,
34
+ watchAt: fe = null,
35
+ watchChapter: be = null
35
36
  }) {
36
- var te, ae, re, se, ie, le, oe;
37
- const N = Oe(), b = _e(), { apiBase: be } = Ue(), ge = be.replace(/\/api$/, ""), $ = Ke(), F = Ze(pe, fe), K = Le(), [A, xe] = c(""), [S, ye] = c(""), [g, Ne] = c(), [w, we] = c("published"), D = Qe(), R = Ge({ onDone: (e) => f(e.id) }), [ve, Q] = c(!1), [j, h] = c(null), [v, _] = c(() => /* @__PURE__ */ new Set()), { isAdmin: ke } = He(), [V, I] = c(null), [G, M] = c(() => /* @__PURE__ */ new Set()), P = k(null), x = k(null), Y = k(null), J = k(null), m = k(null);
38
- U(() => {
39
- const e = window.setTimeout(() => ye(A.trim()), 300);
37
+ var ae, re, se, ie, oe, le, ne;
38
+ const N = Ue(), b = Pe(), { apiBase: ge } = He(), xe = ge.replace(/\/api$/, ""), $ = Qe(), K = We(fe, be), Q = Oe(), [R, ye] = c(""), [S, Ne] = c(""), [g, we] = c(), [w, ve] = c("published"), D = je(), V = Ge({ onDone: (e) => f(e.id) }), [ke, j] = c(!1), [M, h] = c(null), [v, _] = c(() => /* @__PURE__ */ new Set()), { isAdmin: Ce } = qe(), [I, L] = c(null), [G, Y] = c(() => /* @__PURE__ */ new Set()), P = k(null), x = k(null), J = k(null), X = k(null), m = k(null);
39
+ H(() => {
40
+ const e = window.setTimeout(() => Ne(R.trim()), 300);
40
41
  return () => window.clearTimeout(e);
41
- }, [A]);
42
- const T = w === "paths", L = T ? "published" : w, i = Be({ search: S || void 0, category: g, status: L }), u = !!((te = i.data) != null && te.can_author), X = ((ae = i.data) == null ? void 0 : ae.data.length) ?? 0, Z = ((re = i.data) == null ? void 0 : re.total) ?? 0, Ce = (((se = i.data) == null ? void 0 : se.data) ?? []).map((e) => e.id).join(",");
43
- if (U(() => {
44
- W();
45
- }, [Ce]), U(() => {
42
+ }, [R]);
43
+ const E = w === "paths", O = E ? "published" : w, i = Fe({ search: S || void 0, category: g, status: O }), u = !!((ae = i.data) != null && ae.can_author), Z = ((re = i.data) == null ? void 0 : re.data.length) ?? 0, W = ((se = i.data) == null ? void 0 : se.total) ?? 0, $e = (((ie = i.data) == null ? void 0 : ie.data) ?? []).map((e) => e.id).join(",");
44
+ if (H(() => {
45
+ ee();
46
+ }, [$e]), H(() => {
46
47
  h(null);
47
- }, [S, g, w]), z)
48
- return /* @__PURE__ */ t("div", { className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ t(Fe, { videoId: z, onClose: () => f(null) }) });
49
- function W() {
48
+ }, [S, g, w]), B)
49
+ return /* @__PURE__ */ t("div", { className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ t(Ke, { videoId: B, onClose: () => f(null) }) });
50
+ function ee() {
50
51
  var r;
51
52
  const e = x.current;
52
53
  if (!e || !m.current || m.current.querySelector(`[data-hv-card="${e.gone}"]`)) return;
53
- x.current = null, (r = (e.next ? m.current.querySelector(`[data-hv-purge="${e.next}"]`) : null) ?? Y.current) == null || r.focus();
54
+ x.current = null, (r = (e.next ? m.current.querySelector(`[data-hv-purge="${e.next}"]`) : null) ?? J.current) == null || r.focus();
54
55
  }
55
- const $e = async (e) => {
56
+ const Se = async (e) => {
56
57
  var p;
57
- const s = ((p = i.data) == null ? void 0 : p.data) ?? [], r = s.findIndex((d) => d.id === e.id), l = s[r + 1] ?? s[r - 1];
58
+ const s = ((p = i.data) == null ? void 0 : p.data) ?? [], r = s.findIndex((d) => d.id === e.id), o = s[r + 1] ?? s[r - 1];
58
59
  try {
59
- await C(N).purge(e.id), E.success(`"${e.title}" deleted`);
60
+ await C(N).purge(e.id), T.success(`"${e.title}" deleted`);
60
61
  } catch (d) {
61
- const o = ce(d);
62
- if (!((o == null ? void 0 : o.status) === 404 && o.code === "HELP_VIDEO_NOT_FOUND"))
63
- return (o == null ? void 0 : o.code) === "HELP_VIDEO_NOT_ARCHIVED" && b.invalidateQueries({ queryKey: y.all }), { ok: !1, message: `It could not be deleted. ${d.message}` };
62
+ const l = ue(d);
63
+ if (!((l == null ? void 0 : l.status) === 404 && l.code === "HELP_VIDEO_NOT_FOUND"))
64
+ return (l == null ? void 0 : l.code) === "HELP_VIDEO_NOT_ARCHIVED" && b.invalidateQueries({ queryKey: y.all }), { ok: !1, message: `It could not be deleted. ${A(d, "")}` };
64
65
  }
65
- return x.current = { gone: e.id, next: (l == null ? void 0 : l.id) ?? null }, I(null), b.invalidateQueries({ queryKey: y.all }).then(
66
+ return x.current = { gone: e.id, next: (o == null ? void 0 : o.id) ?? null }, L(null), b.invalidateQueries({ queryKey: y.all }).then(
66
67
  () => window.setTimeout(() => {
67
68
  var d;
68
69
  x.current && (x.current = null, (d = P.current) != null && d.isConnected && P.current.focus());
69
70
  }, 0)
70
71
  ), { ok: !0 };
71
- }, Se = async (e) => {
72
+ }, De = async (e) => {
72
73
  var s;
73
74
  if (!G.has(e.id)) {
74
- h(null), M((r) => new Set(r).add(e.id));
75
+ h(null), Y((r) => new Set(r).add(e.id));
75
76
  try {
76
- await C(N).dismissStale(e.id), E.success(`The note on "${e.title}" was dismissed`), b.invalidateQueries({ queryKey: y.all });
77
+ await C(N).dismissStale(e.id), T.success(`The note on "${e.title}" was dismissed`), b.invalidateQueries({ queryKey: y.all });
77
78
  } catch (r) {
78
- ((s = ce(r)) == null ? void 0 : s.code) === "HELP_VIDEO_NOT_STALE" ? b.invalidateQueries({ queryKey: y.all }) : h(`The note on "${e.title}" could not be dismissed. ${r.message}`);
79
+ ((s = ue(r)) == null ? void 0 : s.code) === "HELP_VIDEO_NOT_STALE" ? b.invalidateQueries({ queryKey: y.all }) : h(
80
+ `The note on "${e.title}" could not be dismissed. ${A(r, "")}`
81
+ );
79
82
  } finally {
80
- M((r) => {
81
- const l = new Set(r);
82
- return l.delete(e.id), l;
83
+ Y((r) => {
84
+ const o = new Set(r);
85
+ return o.delete(e.id), o;
83
86
  });
84
87
  }
85
88
  }
86
- }, ee = async (e, s) => {
89
+ }, te = async (e, s) => {
87
90
  if (v.has(e.id)) return;
88
- h(null), _((l) => new Set(l).add(e.id));
91
+ h(null), _((o) => new Set(o).add(e.id));
89
92
  const r = e.title || "Untitled video";
90
93
  try {
91
- s === "draft" ? await C(N).unpublish(e.id) : await C(N).publish(e.id, !1), E.success(
94
+ s === "draft" ? await C(N).unpublish(e.id) : await C(N).publish(e.id, !1), T.success(
92
95
  s === "draft" ? `"${r}" is back in Drafts — viewers no longer see it` : `"${r}" is published again`
93
96
  ), b.invalidateQueries({ queryKey: y.all });
94
- } catch (l) {
97
+ } catch (o) {
95
98
  h(
96
- `"${r}" could not be ${s === "draft" ? "unpublished" : "published again"}. ${l.message}`
99
+ `"${r}" could not be ${s === "draft" ? "unpublished" : "published again"}. ${A(o, "")}`
97
100
  );
98
101
  } finally {
99
- _((l) => {
100
- const p = new Set(l);
102
+ _((o) => {
103
+ const p = new Set(o);
101
104
  return p.delete(e.id), p;
102
105
  });
103
106
  }
104
- }, De = async (e) => {
107
+ }, _e = async (e) => {
105
108
  if (!v.has(e.id)) {
106
109
  h(null), _((s) => new Set(s).add(e.id));
107
110
  try {
108
- await C(N).archive(e.id), E.success(`"${e.title}" archived`), b.invalidateQueries({ queryKey: y.all });
111
+ await C(N).archive(e.id), T.success(`"${e.title}" archived`), b.invalidateQueries({ queryKey: y.all });
109
112
  } catch (s) {
110
- h(`"${e.title}" could not be archived. ${s.message}`);
113
+ h(`"${e.title}" could not be archived. ${A(s, "")}`);
111
114
  } finally {
112
115
  _((s) => {
113
116
  const r = new Set(s);
@@ -121,18 +124,18 @@ function kt({
121
124
  /* @__PURE__ */ t("h1", { className: "text-[16px] font-semibold", children: "Videos" }),
122
125
  /* @__PURE__ */ a("div", { className: "relative min-w-[180px] flex-1 basis-full sm:basis-auto sm:max-w-[320px]", children: [
123
126
  /* @__PURE__ */ t(
124
- Pe,
127
+ Ee,
125
128
  {
126
129
  "aria-hidden": "true",
127
130
  className: "pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground"
128
131
  }
129
132
  ),
130
133
  /* @__PURE__ */ t(
131
- qe,
134
+ ze,
132
135
  {
133
136
  type: "search",
134
- value: A,
135
- onChange: (e) => xe(e.target.value),
137
+ value: R,
138
+ onChange: (e) => ye(e.target.value),
136
139
  placeholder: "Search videos",
137
140
  "aria-label": "Search videos",
138
141
  className: "h-8 pl-8 text-[13px]",
@@ -147,25 +150,25 @@ function kt({
147
150
  {
148
151
  type: "button",
149
152
  "aria-pressed": w === e,
150
- onClick: () => we(e),
151
- className: `rounded-md px-2.5 py-1 text-[12.5px] transition-colors ${H} ${w === e ? "bg-nvr-cyan/10 font-medium" : "hover:bg-muted"}`,
153
+ onClick: () => ve(e),
154
+ className: `rounded-md px-2.5 py-1 text-[12.5px] transition-colors ${q} ${w === e ? "bg-nvr-cyan/10 font-medium" : "hover:bg-muted"}`,
152
155
  "data-hv-status-tab": e,
153
- children: at[e]
156
+ children: rt[e]
154
157
  },
155
158
  e
156
159
  ))
157
160
  ] }),
158
161
  /* @__PURE__ */ a("div", { className: "ml-auto flex items-center gap-2", children: [
159
- me,
162
+ pe,
160
163
  u && /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
161
- !$ && /* @__PURE__ */ t("p", { id: K, className: "max-w-[260px] text-[12px] text-muted-foreground", children: tt }),
164
+ !$ && /* @__PURE__ */ t("p", { id: Q, className: "max-w-[260px] text-[12px] text-muted-foreground", children: at }),
162
165
  /* @__PURE__ */ a(
163
166
  n,
164
167
  {
165
168
  size: "sm",
166
169
  variant: "outline",
167
- onClick: R.pick,
168
- disabled: R.busy,
170
+ onClick: V.pick,
171
+ disabled: V.busy,
169
172
  "data-hv-upload": !0,
170
173
  children: [
171
174
  /* @__PURE__ */ t(Te, { className: "h-4 w-4" }),
@@ -177,14 +180,14 @@ function kt({
177
180
  n,
178
181
  {
179
182
  size: "sm",
180
- onClick: () => Q(
183
+ onClick: () => j(
181
184
  !D.start({ onDone: (e) => f(e.id), from: m.current })
182
185
  ),
183
186
  disabled: !$,
184
- "aria-describedby": $ ? void 0 : K,
187
+ "aria-describedby": $ ? void 0 : Q,
185
188
  "data-hv-record": !0,
186
189
  children: [
187
- /* @__PURE__ */ t(ne, { className: "h-4 w-4" }),
190
+ /* @__PURE__ */ t(de, { className: "h-4 w-4" }),
188
191
  " Record a video"
189
192
  ]
190
193
  }
@@ -192,61 +195,61 @@ function kt({
192
195
  ] })
193
196
  ] })
194
197
  ] }),
195
- !T && !!((ie = i.data) != null && ie.categories.length) && /* @__PURE__ */ t("div", { className: "flex shrink-0 flex-wrap gap-1 px-5 pt-3", children: [void 0, ...i.data.categories].map((e) => /* @__PURE__ */ t(
198
+ !E && !!((oe = i.data) != null && oe.categories.length) && /* @__PURE__ */ t("div", { className: "flex shrink-0 flex-wrap gap-1 px-5 pt-3", children: [void 0, ...i.data.categories].map((e) => /* @__PURE__ */ t(
196
199
  "button",
197
200
  {
198
201
  type: "button",
199
202
  "aria-pressed": g === e,
200
- onClick: () => Ne(e),
201
- className: `rounded-full border px-2.5 py-0.5 text-[12px] transition-colors ${H} ${g === e ? "border-nvr-cyan bg-nvr-cyan/10" : "border-border hover:bg-muted"}`,
203
+ onClick: () => we(e),
204
+ className: `rounded-full border px-2.5 py-0.5 text-[12px] transition-colors ${q} ${g === e ? "border-nvr-cyan bg-nvr-cyan/10" : "border-border hover:bg-muted"}`,
202
205
  children: e ?? "All"
203
206
  },
204
207
  e ?? "all"
205
208
  )) }),
206
- ve && D.active && /* @__PURE__ */ t("p", { role: "status", className: "mx-5 mt-3 text-[13px] text-rose-700 dark:text-rose-300", children: je }),
207
- j && /* @__PURE__ */ t(
209
+ ke && D.active && /* @__PURE__ */ t("p", { role: "status", className: "mx-5 mt-3 text-[13px] text-rose-700 dark:text-rose-300", children: Me }),
210
+ M && /* @__PURE__ */ t(
208
211
  "p",
209
212
  {
210
213
  role: "alert",
211
214
  className: "mx-5 mt-3 rounded-md border border-rose-200 bg-rose-50 px-3 py-2 text-[13px] text-rose-800 dark:border-rose-500/30 dark:bg-rose-500/10 dark:text-rose-200",
212
215
  "data-hv-archive-error": !0,
213
- children: j
216
+ children: M
214
217
  }
215
218
  ),
216
- T && u && /* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-y-auto p-5", children: /* @__PURE__ */ t(We, {}) }),
219
+ E && u && /* @__PURE__ */ t("div", { className: "min-h-0 flex-1 overflow-y-auto p-5", children: /* @__PURE__ */ t(et, {}) }),
217
220
  /* @__PURE__ */ a(
218
221
  "div",
219
222
  {
220
- ref: Y,
223
+ ref: J,
221
224
  tabIndex: -1,
222
225
  className: "min-h-0 flex-1 overflow-y-auto p-5 focus:outline-none",
223
226
  "data-hv-list": !0,
224
- hidden: T && u,
227
+ hidden: E && u,
225
228
  children: [
226
229
  i.isLoading && /* @__PURE__ */ t("p", { className: "text-[13px] text-muted-foreground", children: "Loading…" }),
227
230
  i.isError && /* @__PURE__ */ t("p", { role: "alert", className: "mb-3 text-[13px] text-rose-700 dark:text-rose-300", children: "Videos could not be loaded. Try again in a moment." }),
228
231
  i.data && !i.data.data.length && !i.isError && /* @__PURE__ */ a("div", { className: "space-y-2", "data-hv-empty": !0, children: [
229
- /* @__PURE__ */ t("p", { className: "text-[13px] text-muted-foreground", children: ue({ search: S, category: g, status: L, canAuthor: u }).text }),
230
- ue({ search: S, category: g, status: L, canAuthor: u }).offerRecord && $ && /* @__PURE__ */ a(
232
+ /* @__PURE__ */ t("p", { className: "text-[13px] text-muted-foreground", children: he({ search: S, category: g, status: O, canAuthor: u }).text }),
233
+ he({ search: S, category: g, status: O, canAuthor: u }).offerRecord && $ && /* @__PURE__ */ a(
231
234
  n,
232
235
  {
233
236
  size: "sm",
234
237
  variant: "outline",
235
- onClick: () => Q(
238
+ onClick: () => j(
236
239
  !D.start({ onDone: (e) => f(e.id), from: m.current })
237
240
  ),
238
241
  children: [
239
- /* @__PURE__ */ t(ne, { className: "h-4 w-4" }),
242
+ /* @__PURE__ */ t(de, { className: "h-4 w-4" }),
240
243
  " Record one"
241
244
  ]
242
245
  }
243
246
  )
244
247
  ] }),
245
248
  /* @__PURE__ */ t("ul", { className: "grid gap-4 [grid-template-columns:repeat(auto-fill,minmax(240px,1fr))]", children: (((le = i.data) == null ? void 0 : le.data) ?? []).map((e) => {
246
- var o;
247
- const s = Me(e), r = Ye(e), l = ((o = e.published) == null ? void 0 : o.edits.chapters.length) ?? 0, p = !!e.published && e.required && !s.done && !r, d = [
249
+ var l;
250
+ const s = Ye(e), r = Je(e), o = ((l = e.published) == null ? void 0 : l.edits.chapters.length) ?? 0, p = !!e.published && e.required && !s.done && !r, d = [
248
251
  e.category,
249
- l > 1 ? `${l} chapters` : null,
252
+ o > 1 ? `${o} chapters` : null,
250
253
  e.published ? e.status === "draft" ? "Unpublished" : r ? "Getting ready" : s.text : "Draft"
251
254
  ].filter(Boolean).join(" · ");
252
255
  return /* @__PURE__ */ a(
@@ -259,22 +262,22 @@ function kt({
259
262
  "button",
260
263
  {
261
264
  type: "button",
262
- className: `block w-full text-left ${H}`,
263
- onClick: (O) => {
264
- J.current = O.currentTarget, e.published ? B(e.id) : f(e.id);
265
+ className: `block w-full text-left ${q}`,
266
+ onClick: (U) => {
267
+ X.current = U.currentTarget, e.published ? F(e.id) : f(e.id);
265
268
  },
266
269
  children: [
267
270
  /* @__PURE__ */ a("div", { className: "relative aspect-video bg-slate-100 dark:bg-slate-800", children: [
268
271
  e.poster_url && /* @__PURE__ */ t(
269
272
  "img",
270
273
  {
271
- src: `${ge}${e.poster_url}`,
274
+ src: `${xe}${e.poster_url}`,
272
275
  alt: "",
273
276
  className: "h-full w-full object-cover",
274
277
  loading: "lazy"
275
278
  }
276
279
  ),
277
- !r && e.published && /* @__PURE__ */ t("span", { className: "absolute bottom-1.5 right-1.5 rounded bg-[#0f172a]/80 px-1.5 py-0.5 text-[11px] tabular-nums text-white", children: Je(e.duration_ms) }),
280
+ !r && e.published && /* @__PURE__ */ t("span", { className: "absolute bottom-1.5 right-1.5 rounded bg-[#0f172a]/80 px-1.5 py-0.5 text-[11px] tabular-nums text-white", children: Xe(e.duration_ms) }),
278
281
  e.my_progress && !s.done && e.my_progress.percent > 0 && /* @__PURE__ */ t("span", { className: "absolute inset-x-0 bottom-0 h-1 bg-black/20", children: /* @__PURE__ */ t(
279
282
  "span",
280
283
  {
@@ -299,7 +302,7 @@ function kt({
299
302
  title: e.stale.detail,
300
303
  "data-hv-stale": e.stale.kind,
301
304
  children: [
302
- /* @__PURE__ */ t(de, { className: "mt-px h-3.5 w-3.5 shrink-0", "aria-hidden": !0 }),
305
+ /* @__PURE__ */ t(ce, { className: "mt-px h-3.5 w-3.5 shrink-0", "aria-hidden": !0 }),
303
306
  /* @__PURE__ */ a("span", { className: "line-clamp-2", children: [
304
307
  "May be out of date",
305
308
  u ? `: ${e.stale.detail}` : ""
@@ -317,12 +320,12 @@ function kt({
317
320
  {
318
321
  size: "sm",
319
322
  variant: "ghost",
320
- onClick: () => void Se(e),
323
+ onClick: () => void De(e),
321
324
  disabled: G.has(e.id),
322
325
  "aria-label": `Dismiss the out-of-date note on ${e.title || "Untitled video"}`,
323
326
  "data-hv-stale-dismiss": e.id,
324
327
  children: [
325
- /* @__PURE__ */ t(de, { className: "h-3.5 w-3.5" }),
328
+ /* @__PURE__ */ t(ce, { className: "h-3.5 w-3.5" }),
326
329
  " Dismiss"
327
330
  ]
328
331
  }
@@ -335,7 +338,7 @@ function kt({
335
338
  onClick: () => f(e.id),
336
339
  "data-hv-edit": e.id,
337
340
  children: [
338
- /* @__PURE__ */ t(Ee, { className: "h-3.5 w-3.5" }),
341
+ /* @__PURE__ */ t(Ae, { className: "h-3.5 w-3.5" }),
339
342
  " Edit"
340
343
  ]
341
344
  }
@@ -345,12 +348,12 @@ function kt({
345
348
  {
346
349
  size: "sm",
347
350
  variant: "ghost",
348
- onClick: () => void ee(e, "draft"),
351
+ onClick: () => void te(e, "draft"),
349
352
  disabled: v.has(e.id),
350
353
  "data-tip": "Back to Drafts: viewers stop seeing it until you publish it again",
351
354
  "data-hv-unpublish": e.id,
352
355
  children: [
353
- /* @__PURE__ */ t(Ae, { className: "h-3.5 w-3.5" }),
356
+ /* @__PURE__ */ t(Re, { className: "h-3.5 w-3.5" }),
354
357
  " Unpublish"
355
358
  ]
356
359
  }
@@ -360,12 +363,12 @@ function kt({
360
363
  {
361
364
  size: "sm",
362
365
  variant: "ghost",
363
- onClick: () => void ee(e, "published"),
366
+ onClick: () => void te(e, "published"),
364
367
  disabled: v.has(e.id),
365
368
  "data-tip": "Put the last published version back for viewers",
366
369
  "data-hv-republish": e.id,
367
370
  children: [
368
- /* @__PURE__ */ t(Re, { className: "h-3.5 w-3.5" }),
371
+ /* @__PURE__ */ t(Ve, { className: "h-3.5 w-3.5" }),
369
372
  " Publish again"
370
373
  ]
371
374
  }
@@ -375,28 +378,28 @@ function kt({
375
378
  {
376
379
  size: "sm",
377
380
  variant: "ghost",
378
- onClick: () => void De(e),
381
+ onClick: () => void _e(e),
379
382
  disabled: v.has(e.id),
380
383
  "data-hv-archive": e.id,
381
384
  children: [
382
- /* @__PURE__ */ t(Ve, { className: "h-3.5 w-3.5" }),
385
+ /* @__PURE__ */ t(Ie, { className: "h-3.5 w-3.5" }),
383
386
  " Archive"
384
387
  ]
385
388
  }
386
389
  ),
387
- ke && e.status === "archived" && /* @__PURE__ */ a(
390
+ Ce && e.status === "archived" && /* @__PURE__ */ a(
388
391
  n,
389
392
  {
390
393
  size: "sm",
391
394
  variant: "ghost",
392
395
  className: "text-rose-700 hover:text-rose-800 dark:text-rose-300 dark:hover:text-rose-200",
393
- onClick: (O) => {
394
- P.current = O.currentTarget, I(e);
396
+ onClick: (U) => {
397
+ P.current = U.currentTarget, L(e);
395
398
  },
396
399
  "aria-label": `Delete permanently: ${e.title || "Untitled video"}`,
397
400
  "data-hv-purge": e.id,
398
401
  children: [
399
- /* @__PURE__ */ t(Ie, { className: "h-3.5 w-3.5" }),
402
+ /* @__PURE__ */ t(Le, { className: "h-3.5 w-3.5" }),
400
403
  " Delete permanently"
401
404
  ]
402
405
  }
@@ -419,39 +422,39 @@ function kt({
419
422
  children: i.isFetchingNextPage ? "Loading…" : "Show more"
420
423
  }
421
424
  ),
422
- he(X, Z) && /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", "aria-live": "polite", children: he(X, Z) })
425
+ me(Z, W) && /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", "aria-live": "polite", children: me(Z, W) })
423
426
  ] })
424
427
  ]
425
428
  }
426
429
  ),
427
- V && /* @__PURE__ */ t(
428
- et,
430
+ I && /* @__PURE__ */ t(
431
+ tt,
429
432
  {
430
- title: V.title || "Untitled video",
431
- container: ze((oe = m.current) == null ? void 0 : oe.firstElementChild),
432
- onConfirm: () => $e(V),
433
- onClose: () => I(null),
433
+ title: I.title || "Untitled video",
434
+ container: Be((ne = m.current) == null ? void 0 : ne.firstElementChild),
435
+ onConfirm: () => Se(I),
436
+ onClose: () => L(null),
434
437
  restoreFocus: () => {
435
438
  var e;
436
- x.current ? W() : (e = P.current) == null || e.focus();
439
+ x.current ? ee() : (e = P.current) == null || e.focus();
437
440
  }
438
441
  }
439
442
  ),
440
443
  /* @__PURE__ */ t(
441
- Xe,
444
+ Ze,
442
445
  {
443
- videoId: q,
444
- open: !!q,
445
- onOpenChange: (e) => !e && B(null),
446
- returnFocusRef: J,
447
- startAtMs: F.atMs,
448
- startChapterId: F.chapterId
446
+ videoId: z,
447
+ open: !!z,
448
+ onOpenChange: (e) => !e && F(null),
449
+ returnFocusRef: X,
450
+ startAtMs: K.atMs,
451
+ startChapterId: K.chapterId
449
452
  }
450
453
  ),
451
454
  D.fallback,
452
- R.ui
455
+ V.ui
453
456
  ] });
454
457
  }
455
458
  export {
456
- kt as HelpVideoLibrary
459
+ $t as HelpVideoLibrary
457
460
  };