@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,21 +1,22 @@
1
1
  import { jsxs as s, jsx as t } from "react/jsx-runtime";
2
- import { useQueryClient as V, useQuery as j } from "@tanstack/react-query";
3
- import { Plus as G, X as A, GripVertical as I, ArrowUp as W, ArrowDown as O, Trash2 as B } from "lucide-react";
4
- import { useState as b, useId as H } from "react";
2
+ import { useQueryClient as j, useQuery as G } from "@tanstack/react-query";
3
+ import { Plus as I, X as A, GripVertical as W, ArrowUp as O, ArrowDown as B, Trash2 as H } from "lucide-react";
4
+ import { useState as b, useId as X } from "react";
5
5
  import { toast as T } from "sonner";
6
- import { useNivaroClient as K } from "../../../context.js";
7
- import { get as X } from "../../../lib/commands.js";
6
+ import { useNivaroClient as Q } from "../../../context.js";
7
+ import { get as J } from "../../../lib/commands.js";
8
+ import { userErrorMessage as z } from "../../../lib/safe-error.js";
8
9
  import { Button as g } from "../../ui/button.js";
9
- import { Input as J } from "../../ui/input.js";
10
+ import { Input as Y } from "../../ui/input.js";
10
11
  import { Label as C } from "../../ui/label.js";
11
- import { Switch as z } from "../../ui/switch.js";
12
- import { Textarea as Y } from "../../ui/textarea.js";
13
- import { useLearningPaths as Z, learningPathApi as ee, helpVideoKeys as $, useHelpVideoLibrary as te } from "../api.js";
14
- import { PickerCombo as F, RemovableChip as ae } from "../editor/PickerCombo.js";
15
- import { formatDuration as M } from "../viewer/format.js";
12
+ import { Switch as F } from "../../ui/switch.js";
13
+ import { Textarea as Z } from "../../ui/textarea.js";
14
+ import { useLearningPaths as ee, learningPathApi as te, helpVideoKeys as $, useHelpVideoLibrary as ae } from "../api.js";
15
+ import { PickerCombo as M, RemovableChip as re } from "../editor/PickerCombo.js";
16
+ import { formatDuration as K } from "../viewer/format.js";
16
17
  import { moveItem as P } from "../viewer/paths.js";
17
18
  const q = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan motion-reduce:transition-none";
18
- function re(a) {
19
+ function ie(a) {
19
20
  return {
20
21
  title: (a == null ? void 0 : a.title) ?? "",
21
22
  description: (a == null ? void 0 : a.description) ?? "",
@@ -25,14 +26,14 @@ function re(a) {
25
26
  roles: (a == null ? void 0 : a.roles.map((c) => ({ role_id: c.role_id, required: c.required }))) ?? []
26
27
  };
27
28
  }
28
- function Ne() {
29
+ function _e() {
29
30
  var i, w;
30
- const a = K(), c = V(), m = Z(), [d, v] = b(null), u = d && d !== "new" ? ((i = m.data) == null ? void 0 : i.find((o) => o.id === d)) ?? null : null;
31
+ const a = Q(), c = j(), m = ee(), [d, v] = b(null), u = d && d !== "new" ? ((i = m.data) == null ? void 0 : i.find((o) => o.id === d)) ?? null : null;
31
32
  return /* @__PURE__ */ s("div", { className: "space-y-4", "data-hv-paths": !0, children: [
32
33
  /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-3", children: [
33
34
  /* @__PURE__ */ t("p", { className: "text-[13px] text-muted-foreground", children: 'An ordered list of videos for a role — "Getting started as a Workflow Creator". People see it on My Work with their progress and a Continue button; a required path joins their required list until every video in it is watched.' }),
34
35
  /* @__PURE__ */ s(g, { size: "sm", className: "ml-auto", onClick: () => v("new"), "data-hv-path-new": !0, children: [
35
- /* @__PURE__ */ t(G, { className: "h-4 w-4" }),
36
+ /* @__PURE__ */ t(I, { className: "h-4 w-4" }),
36
37
  " New path"
37
38
  ] })
38
39
  ] }),
@@ -73,30 +74,30 @@ function Ne() {
73
74
  o.id
74
75
  )) }),
75
76
  d && /* @__PURE__ */ t(
76
- ie,
77
+ se,
77
78
  {
78
79
  path: u,
79
80
  onClose: () => v(null),
80
81
  onSaved: (o) => {
81
82
  c.invalidateQueries({ queryKey: $.paths }), c.invalidateQueries({ queryKey: $.myPaths }), c.invalidateQueries({ queryKey: $.required }), v(o ? o.id : null);
82
83
  },
83
- api: ee(a)
84
+ api: te(a)
84
85
  },
85
86
  d
86
87
  )
87
88
  ] });
88
89
  }
89
- function ie({
90
+ function se({
90
91
  path: a,
91
92
  onClose: c,
92
93
  onSaved: m,
93
94
  api: d
94
95
  }) {
95
96
  var E, R;
96
- const v = K(), u = H(), [i, w] = b(() => re(a)), [o, N] = b(!1), [D, y] = b(null), [k, L] = b(null), f = j({
97
+ const v = Q(), u = X(), [i, w] = b(() => ie(a)), [o, N] = b(!1), [D, y] = b(null), [k, L] = b(null), f = G({
97
98
  queryKey: ["chat-roles"],
98
- queryFn: async () => (await v.request(X("/chat/roles"))).data
99
- }), h = te({ status: "published" }), x = /* @__PURE__ */ new Map();
99
+ queryFn: async () => (await v.request(J("/chat/roles"))).data
100
+ }), h = ae({ status: "published" }), x = /* @__PURE__ */ new Map();
100
101
  for (const e of ((E = h.data) == null ? void 0 : E.data) ?? []) x.set(e.id.toLowerCase(), e);
101
102
  for (const e of (a == null ? void 0 : a.items) ?? [])
102
103
  x.has(e.video_id.toLowerCase()) || x.set(e.video_id.toLowerCase(), e);
@@ -106,7 +107,7 @@ function ie({
106
107
  }, U = (e) => {
107
108
  var r, n;
108
109
  return ((n = (r = f.data) == null ? void 0 : r.find((p) => p.id.toUpperCase() === e.toUpperCase())) == null ? void 0 : n.name) ?? (f.isLoading ? "Loading…" : "Unknown role");
109
- }, l = (e) => w((r) => ({ ...r, ...e })), Q = async () => {
110
+ }, l = (e) => w((r) => ({ ...r, ...e })), S = async () => {
110
111
  const e = i.title.trim();
111
112
  if (!e) {
112
113
  y("Give the path a title.");
@@ -124,17 +125,17 @@ function ie({
124
125
  const p = await d.setRoles(n.id, i.roles);
125
126
  T.success(a ? `"${e}" saved` : `"${e}" created`), m(p);
126
127
  } catch (r) {
127
- y(`The path could not be saved. ${r.message}`);
128
+ y(`The path could not be saved. ${z(r, "")}`);
128
129
  } finally {
129
130
  N(!1);
130
131
  }
131
- }, S = async () => {
132
+ }, V = async () => {
132
133
  if (a && window.confirm(`Delete "${a.title || "Untitled path"}"? Nobody's progress is lost.`)) {
133
134
  N(!0);
134
135
  try {
135
136
  await d.remove(a.id), T.success(`"${a.title}" deleted`), m(null);
136
137
  } catch (e) {
137
- y(`The path could not be deleted. ${e.message}`), N(!1);
138
+ y(`The path could not be deleted. ${z(e, "")}`), N(!1);
138
139
  }
139
140
  }
140
141
  };
@@ -153,7 +154,7 @@ function ie({
153
154
  /* @__PURE__ */ s("div", { className: "space-y-1", children: [
154
155
  /* @__PURE__ */ t(C, { htmlFor: `${u}-title`, className: "text-[12px]", children: "Title" }),
155
156
  /* @__PURE__ */ t(
156
- J,
157
+ Y,
157
158
  {
158
159
  id: `${u}-title`,
159
160
  value: i.title,
@@ -168,7 +169,7 @@ function ie({
168
169
  /* @__PURE__ */ s("div", { className: "space-y-1", children: [
169
170
  /* @__PURE__ */ t(C, { htmlFor: `${u}-desc`, className: "text-[12px]", children: "Description" }),
170
171
  /* @__PURE__ */ t(
171
- Y,
172
+ Z,
172
173
  {
173
174
  id: `${u}-desc`,
174
175
  value: i.description,
@@ -183,7 +184,7 @@ function ie({
183
184
  /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-5", children: [
184
185
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
185
186
  /* @__PURE__ */ t(
186
- z,
187
+ F,
187
188
  {
188
189
  id: `${u}-published`,
189
190
  checked: i.status === "published",
@@ -195,7 +196,7 @@ function ie({
195
196
  ] }),
196
197
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
197
198
  /* @__PURE__ */ t(
198
- z,
199
+ F,
199
200
  {
200
201
  id: `${u}-new-user`,
201
202
  checked: i.new_user,
@@ -226,7 +227,7 @@ function ie({
226
227
  "data-hv-path-item": e,
227
228
  children: [
228
229
  /* @__PURE__ */ t(
229
- I,
230
+ W,
230
231
  {
231
232
  className: "h-4 w-4 shrink-0 cursor-grab text-muted-foreground",
232
233
  "aria-hidden": !0
@@ -237,7 +238,7 @@ function ie({
237
238
  "."
238
239
  ] }),
239
240
  /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate", children: _(e) }),
240
- /* @__PURE__ */ t("span", { className: "shrink-0 text-[12px] text-muted-foreground", children: M(((n = x.get(e.toLowerCase())) == null ? void 0 : n.duration_ms) ?? null) }),
241
+ /* @__PURE__ */ t("span", { className: "shrink-0 text-[12px] text-muted-foreground", children: K(((n = x.get(e.toLowerCase())) == null ? void 0 : n.duration_ms) ?? null) }),
241
242
  /* @__PURE__ */ t(
242
243
  "button",
243
244
  {
@@ -247,7 +248,7 @@ function ie({
247
248
  disabled: r === 0,
248
249
  "aria-label": `Move ${_(e)} up`,
249
250
  "data-hv-path-up": e,
250
- children: /* @__PURE__ */ t(W, { className: "h-3.5 w-3.5" })
251
+ children: /* @__PURE__ */ t(O, { className: "h-3.5 w-3.5" })
251
252
  }
252
253
  ),
253
254
  /* @__PURE__ */ t(
@@ -259,7 +260,7 @@ function ie({
259
260
  disabled: r === i.video_ids.length - 1,
260
261
  "aria-label": `Move ${_(e)} down`,
261
262
  "data-hv-path-down": e,
262
- children: /* @__PURE__ */ t(O, { className: "h-3.5 w-3.5" })
263
+ children: /* @__PURE__ */ t(B, { className: "h-3.5 w-3.5" })
263
264
  }
264
265
  ),
265
266
  /* @__PURE__ */ t(
@@ -280,7 +281,7 @@ function ie({
280
281
  }) }),
281
282
  /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-2", children: [
282
283
  /* @__PURE__ */ t(
283
- F,
284
+ M,
284
285
  {
285
286
  ariaLabel: "Add a video",
286
287
  placeholder: "Add a video",
@@ -288,7 +289,7 @@ function ie({
288
289
  options: (((R = h.data) == null ? void 0 : R.data) ?? []).filter((e) => !i.video_ids.some((r) => r.toLowerCase() === e.id.toLowerCase())).map((e) => ({
289
290
  value: e.id,
290
291
  label: e.title || "Untitled video",
291
- hint: M(e.duration_ms)
292
+ hint: K(e.duration_ms)
292
293
  })),
293
294
  onPick: (e) => l({ video_ids: [...i.video_ids, e] })
294
295
  }
@@ -310,7 +311,7 @@ function ie({
310
311
  /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "People in these roles get the path on My Work. Required: it joins their required list and they are told when it is published." }),
311
312
  /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-1.5", "data-hv-path-roles": !0, children: [
312
313
  i.roles.map((e) => /* @__PURE__ */ t("span", { className: "inline-flex items-center gap-1", children: /* @__PURE__ */ s(
313
- ae,
314
+ re,
314
315
  {
315
316
  removeLabel: `Remove ${U(e.role_id)}`,
316
317
  onRemove: () => l({ roles: i.roles.filter((r) => r.role_id !== e.role_id) }),
@@ -337,7 +338,7 @@ function ie({
337
338
  }
338
339
  ) }, e.role_id)),
339
340
  /* @__PURE__ */ t(
340
- F,
341
+ M,
341
342
  {
342
343
  ariaLabel: "Add a role",
343
344
  placeholder: "Add a role",
@@ -358,7 +359,7 @@ function ie({
358
359
  }
359
360
  ),
360
361
  /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-2", children: [
361
- /* @__PURE__ */ t(g, { size: "sm", onClick: () => void Q(), disabled: o, "data-hv-path-save": !0, children: o ? "Saving…" : a ? "Save" : "Create path" }),
362
+ /* @__PURE__ */ t(g, { size: "sm", onClick: () => void S(), disabled: o, "data-hv-path-save": !0, children: o ? "Saving…" : a ? "Save" : "Create path" }),
362
363
  /* @__PURE__ */ t(g, { size: "sm", variant: "outline", onClick: c, disabled: o, children: "Cancel" }),
363
364
  a && /* @__PURE__ */ s(
364
365
  g,
@@ -366,11 +367,11 @@ function ie({
366
367
  size: "sm",
367
368
  variant: "ghost",
368
369
  className: "ml-auto text-rose-700 hover:text-rose-800 dark:text-rose-300",
369
- onClick: () => void S(),
370
+ onClick: () => void V(),
370
371
  disabled: o,
371
372
  "data-hv-path-delete": !0,
372
373
  children: [
373
- /* @__PURE__ */ t(B, { className: "h-3.5 w-3.5" }),
374
+ /* @__PURE__ */ t(H, { className: "h-3.5 w-3.5" }),
374
375
  " Delete path"
375
376
  ]
376
377
  }
@@ -381,5 +382,5 @@ function ie({
381
382
  );
382
383
  }
383
384
  export {
384
- Ne as LearningPathsPanel
385
+ _e as LearningPathsPanel
385
386
  };
@@ -3,16 +3,17 @@ import { useQueryClient as R, useQuery as X } from "@tanstack/react-query";
3
3
  import { Palette as J } from "lucide-react";
4
4
  import { useId as v, useState as g, useEffect as K } from "react";
5
5
  import { useItemEditAuth as W, useNivaroClient as Z } from "../../../context.js";
6
+ import { userErrorMessage as Y } from "../../../lib/safe-error.js";
6
7
  import { Button as I } from "../../ui/button.js";
7
- import { Popover as Y, PopoverTrigger as ee, PopoverContent as te } from "../../ui/popover.js";
8
+ import { Popover as ee, PopoverTrigger as te, PopoverContent as ae } from "../../ui/popover.js";
8
9
  import { SimpleSelect as w } from "../../ui/SimpleSelect.js";
9
10
  import { Switch as _ } from "../../ui/switch.js";
10
- import { ANNOTATION_PALETTE as ae } from "../annotationStyles.js";
11
- import { helpVideoError as oe } from "../api.js";
12
- import { OUTRO_DEFAULT_TEXT as se, EDIT_LIMITS as f } from "../edits.js";
13
- import { TONE_NAMES as le, CALLOUT_TEXT_NAMES as re } from "../houseStyle.js";
11
+ import { ANNOTATION_PALETTE as oe } from "../annotationStyles.js";
12
+ import { helpVideoError as se } from "../api.js";
13
+ import { OUTRO_DEFAULT_TEXT as le, EDIT_LIMITS as f } from "../edits.js";
14
+ import { TONE_NAMES as re, CALLOUT_TEXT_NAMES as ne } from "../houseStyle.js";
14
15
  import { helpVideoSettingsKeys as q, helpVideoSettingsApi as D } from "./api.js";
15
- const x = "text-[12px] leading-snug text-muted-foreground", h = "text-[12.5px] font-medium text-foreground", N = "space-y-2 border-t border-border pt-3", ne = "rounded-md border border-amber-300 bg-amber-50 px-2.5 py-1.5 text-[12.5px] text-amber-900 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-200", H = "rounded-md border border-rose-200 bg-rose-50 px-2.5 py-1.5 text-[12.5px] text-rose-800 dark:border-rose-500/30 dark:bg-rose-500/10 dark:text-rose-200", ie = "h-7 min-w-[36px] border-l border-input px-2 text-[12px] transition-colors duration-150 first:border-l-0 focus-visible:relative focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan disabled:opacity-60 motion-reduce:transition-none", de = "bg-nvr-cyan/15 font-semibold text-foreground", ce = "bg-background text-foreground hover:bg-muted", ue = "h-7 w-16 rounded-md border border-border bg-background px-2 text-[12.5px] tabular-nums text-foreground disabled:opacity-60", V = [
16
+ const x = "text-[12px] leading-snug text-muted-foreground", h = "text-[12.5px] font-medium text-foreground", N = "space-y-2 border-t border-border pt-3", ie = "rounded-md border border-amber-300 bg-amber-50 px-2.5 py-1.5 text-[12.5px] text-amber-900 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-200", H = "rounded-md border border-rose-200 bg-rose-50 px-2.5 py-1.5 text-[12.5px] text-rose-800 dark:border-rose-500/30 dark:bg-rose-500/10 dark:text-rose-200", de = "h-7 min-w-[36px] border-l border-input px-2 text-[12px] transition-colors duration-150 first:border-l-0 focus-visible:relative focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-nvr-cyan disabled:opacity-60 motion-reduce:transition-none", ce = "bg-nvr-cyan/15 font-semibold text-foreground", ue = "bg-background text-foreground hover:bg-muted", he = "h-7 w-16 rounded-md border border-border bg-background px-2 text-[12.5px] tabular-nums text-foreground disabled:opacity-60", V = [
16
17
  { value: "none", label: "No motion" },
17
18
  { value: "subtle", label: "Subtle" },
18
19
  { value: "lively", label: "Lively" }
@@ -46,7 +47,7 @@ function c({
46
47
  type: "button",
47
48
  "aria-pressed": p === n.value,
48
49
  onClick: () => u(n.value),
49
- className: `${ie} inline-flex items-center gap-1.5 ${p === n.value ? de : ce}`,
50
+ className: `${de} inline-flex items-center gap-1.5 ${p === n.value ? ce : ue}`,
50
51
  "data-hv-house": `${S}:${n.value}`,
51
52
  children: [
52
53
  n.swatch && /* @__PURE__ */ t(
@@ -66,7 +67,7 @@ function c({
66
67
  )
67
68
  ] });
68
69
  }
69
- function Se() {
70
+ function Ee() {
70
71
  const { isAdmin: m } = W(), p = Z(), C = R(), r = { intro: v(), introMs: v(), outro: v(), outroMs: v(), audio: v() }, [u, S] = g(!1), [n, T] = g(null), [L, A] = g(!1), [O, E] = g(null), [B, y] = g(!1), M = X({
71
72
  queryKey: q.houseStyle,
72
73
  enabled: m && u,
@@ -83,9 +84,9 @@ function Se() {
83
84
  const d = await D(p).saveHouseStyle(e);
84
85
  C.setQueryData(q.houseStyle, d), T(d.house_style), y(!0);
85
86
  } catch (d) {
86
- const b = oe(d);
87
+ const b = se(d);
87
88
  E(
88
- (b == null ? void 0 : b.code) === "HELP_VIDEO_SETTINGS_MIGRATION_PENDING" ? "Not saved: this database needs the update that adds these settings (migration 410)." : `Not saved. ${d.message}`
89
+ (b == null ? void 0 : b.code) === "HELP_VIDEO_SETTINGS_MIGRATION_PENDING" ? "Not saved: this database needs the update that adds these settings (migration 410)." : `Not saved. ${Y(d, "")}`
89
90
  );
90
91
  } finally {
91
92
  A(!1);
@@ -104,24 +105,24 @@ function Se() {
104
105
  const k = Number(G.target.value);
105
106
  !Number.isFinite(k) || k * 1e3 < f.cardMinMs || k * 1e3 > f.cardMaxMs || b(Math.round(k * 10) * 100);
106
107
  },
107
- className: ue,
108
+ className: he,
108
109
  "data-hv-house": U
109
110
  }
110
111
  );
111
112
  return /* @__PURE__ */ o(
112
- Y,
113
+ ee,
113
114
  {
114
115
  open: u,
115
116
  onOpenChange: (e) => {
116
117
  S(e), e || (E(null), y(!1));
117
118
  },
118
119
  children: [
119
- /* @__PURE__ */ t(ee, { asChild: !0, children: /* @__PURE__ */ o(I, { size: "sm", variant: "outline", "data-hv-house-style-button": !0, children: [
120
+ /* @__PURE__ */ t(te, { asChild: !0, children: /* @__PURE__ */ o(I, { size: "sm", variant: "outline", "data-hv-house-style-button": !0, children: [
120
121
  /* @__PURE__ */ t(J, { className: "mr-1 h-4 w-4", "aria-hidden": !0 }),
121
122
  " House style"
122
123
  ] }) }),
123
124
  /* @__PURE__ */ o(
124
- te,
125
+ ae,
125
126
  {
126
127
  align: "end",
127
128
  className: "max-h-[min(640px,calc(100vh-6rem))] w-[min(400px,calc(100vw-2rem))] space-y-3 overflow-y-auto text-[13px]",
@@ -136,7 +137,7 @@ function Se() {
136
137
  " ",
137
138
  /* @__PURE__ */ t("button", { type: "button", className: "underline", onClick: () => void M.refetch(), children: "Try again" })
138
139
  ] }) : !a || !i ? /* @__PURE__ */ t("p", { className: x, role: "status", children: "Loading…" }) : /* @__PURE__ */ o(Q, { children: [
139
- !z && /* @__PURE__ */ t("p", { className: ne, "data-hv-house-migration": !0, children: "The house style needs a database update (migration 410) before it can be saved. New videos use the standard look shown here." }),
140
+ !z && /* @__PURE__ */ t("p", { className: ie, "data-hv-house-migration": !0, children: "The house style needs a database update (migration 410) before it can be saved. New videos use the standard look shown here." }),
140
141
  /* @__PURE__ */ o("div", { className: "space-y-2", children: [
141
142
  /* @__PURE__ */ t("p", { className: h, children: "Callouts" }),
142
143
  /* @__PURE__ */ t(
@@ -149,8 +150,8 @@ function Se() {
149
150
  onChange: (e) => l({ callout_tone: e }),
150
151
  choices: ["accent", "warning", "neutral"].map((e) => ({
151
152
  value: e,
152
- label: le[e],
153
- swatch: ae[e]
153
+ label: re[e],
154
+ swatch: oe[e]
154
155
  }))
155
156
  }
156
157
  ),
@@ -164,7 +165,7 @@ function Se() {
164
165
  onChange: (e) => l({ callout_text: e }),
165
166
  choices: ["small", "medium", "large"].map((e) => ({
166
167
  value: e,
167
- label: re[e]
168
+ label: ne[e]
168
169
  }))
169
170
  }
170
171
  )
@@ -347,7 +348,7 @@ function Se() {
347
348
  type: "text",
348
349
  value: a.outro.text,
349
350
  maxLength: f.outroText,
350
- placeholder: se,
351
+ placeholder: le,
351
352
  "aria-label": "End card text",
352
353
  disabled: s,
353
354
  onChange: (e) => l({ outro: { ...a.outro, text: e.target.value } }),
@@ -444,5 +445,5 @@ function Se() {
444
445
  );
445
446
  }
446
447
  export {
447
- Se as HouseStyleButton
448
+ Ee as HouseStyleButton
448
449
  };
@@ -2,15 +2,16 @@ import { jsxs as a, jsx as t, Fragment as z } from "react/jsx-runtime";
2
2
  import { useQueryClient as H, useQuery as $ } from "@tanstack/react-query";
3
3
  import { SlidersHorizontal as B } from "lucide-react";
4
4
  import { useId as S, useState as u, useEffect as q } from "react";
5
- import { useItemEditAuth as G, useNivaroClient as K } from "../../../context.js";
6
- import { TipLayer as M } from "../../TipLayer.js";
5
+ import { useItemEditAuth as G, useNivaroClient as M } from "../../../context.js";
6
+ import { userErrorMessage as K } from "../../../lib/safe-error.js";
7
+ import { TipLayer as U } from "../../TipLayer.js";
7
8
  import { Button as _ } from "../../ui/button.js";
8
- import { Popover as U, PopoverTrigger as W, PopoverContent as J } from "../../ui/popover.js";
9
- import { SimpleSelect as X } from "../../ui/SimpleSelect.js";
10
- import { Switch as Y } from "../../ui/switch.js";
11
- import { helpVideoError as Z } from "../api.js";
9
+ import { Popover as W, PopoverTrigger as J, PopoverContent as X } from "../../ui/popover.js";
10
+ import { SimpleSelect as Y } from "../../ui/SimpleSelect.js";
11
+ import { Switch as Z } from "../../ui/switch.js";
12
+ import { helpVideoError as ee } from "../api.js";
12
13
  import { helpVideoSettingsKeys as k, helpVideoSettingsApi as C } from "./api.js";
13
- const ee = {
14
+ const te = {
14
15
  ultrafast: "Fastest, largest files",
15
16
  superfast: "Very fast",
16
17
  veryfast: "Fast (default)",
@@ -22,12 +23,12 @@ const ee = {
22
23
  }, j = {
23
24
  videotoolbox: "VideoToolbox",
24
25
  vaapi: "VAAPI"
25
- }, i = "text-[12px] text-muted-foreground", f = "text-[12.5px] font-medium text-foreground", te = "rounded-md border border-amber-300 bg-amber-50 px-2.5 py-1.5 text-[12.5px] text-amber-900 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-200", I = "rounded-md border border-rose-200 bg-rose-50 px-2.5 py-1.5 text-[12.5px] text-rose-800 dark:border-rose-500/30 dark:bg-rose-500/10 dark:text-rose-200", R = "h-8 w-20 rounded-md border border-border bg-background px-2 text-[13px] tabular-nums text-foreground disabled:opacity-60";
26
+ }, i = "text-[12px] text-muted-foreground", f = "text-[12.5px] font-medium text-foreground", se = "rounded-md border border-amber-300 bg-amber-50 px-2.5 py-1.5 text-[12.5px] text-amber-900 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-200", I = "rounded-md border border-rose-200 bg-rose-50 px-2.5 py-1.5 text-[12.5px] text-rose-800 dark:border-rose-500/30 dark:bg-rose-500/10 dark:text-rose-200", R = "h-8 w-20 rounded-md border border-border bg-background px-2 text-[13px] tabular-nums text-foreground disabled:opacity-60";
26
27
  function g({ dto: m, k: o }) {
27
28
  return m.sources[o] !== "env" ? null : /* @__PURE__ */ t("span", { className: "ml-1.5 text-[11px] font-normal text-muted-foreground", "data-tip": m.env[o], children: "from the server environment" });
28
29
  }
29
- function pe() {
30
- const { isAdmin: m } = G(), o = K(), E = H(), d = { crf: S(), twoPass: S(), hw: S() }, [p, L] = u(!1), [O, c] = u(null), [v, T] = u(!1), [F, b] = u(null), [V, x] = u(!1), w = $({
30
+ function ge() {
31
+ const { isAdmin: m } = G(), o = M(), E = H(), d = { crf: S(), twoPass: S(), hw: S() }, [p, L] = u(!1), [O, c] = u(null), [v, T] = u(!1), [F, b] = u(null), [V, x] = u(!1), w = $({
31
32
  queryKey: k.settings,
32
33
  enabled: m && p,
33
34
  queryFn: () => C(o).settings()
@@ -41,9 +42,9 @@ function pe() {
41
42
  const n = await C(o).saveEncoder(e);
42
43
  E.setQueryData(k.settings, n), c(n.encoder), x(!0);
43
44
  } catch (n) {
44
- const y = Z(n);
45
+ const y = ee(n);
45
46
  b(
46
- (y == null ? void 0 : y.code) === "HELP_VIDEO_SETTINGS_MIGRATION_PENDING" ? "Not saved: this database needs the update that adds these settings (migration 410)." : `Not saved. ${n.message}`
47
+ (y == null ? void 0 : y.code) === "HELP_VIDEO_SETTINGS_MIGRATION_PENDING" ? "Not saved: this database needs the update that adds these settings (migration 410)." : `Not saved. ${K(n, "")}`
47
48
  );
48
49
  } finally {
49
50
  T(!1);
@@ -53,25 +54,25 @@ function pe() {
53
54
  e && E.setQueryData(k.settings, e);
54
55
  }, r = O, N = r ? D(r) : [], h = s == null ? void 0 : s.hardware, A = h ? h.available.length ? `This server can use ${h.available.map((e) => j[e] ?? e).join(" and ")}.` : h.failed.length ? `This server has ${h.failed.map((e) => j[e.kind] ?? e.kind).join(" and ")} but it did not work, so renders use software.` : "This server has no hardware encoder, so renders use software." : null;
55
56
  return /* @__PURE__ */ a(
56
- U,
57
+ W,
57
58
  {
58
59
  open: p,
59
60
  onOpenChange: (e) => {
60
61
  L(e), e || (b(null), x(!1));
61
62
  },
62
63
  children: [
63
- /* @__PURE__ */ t(W, { asChild: !0, children: /* @__PURE__ */ a(_, { size: "sm", variant: "outline", "data-hv-render-settings": !0, children: [
64
+ /* @__PURE__ */ t(J, { asChild: !0, children: /* @__PURE__ */ a(_, { size: "sm", variant: "outline", "data-hv-render-settings": !0, children: [
64
65
  /* @__PURE__ */ t(B, { className: "mr-1 h-4 w-4", "aria-hidden": !0 }),
65
66
  " Render settings"
66
67
  ] }) }),
67
68
  /* @__PURE__ */ a(
68
- J,
69
+ X,
69
70
  {
70
71
  align: "end",
71
72
  className: "w-[min(380px,calc(100vw-2rem))] space-y-3 text-[13px]",
72
73
  "data-hv-render-settings-panel": !0,
73
74
  children: [
74
- /* @__PURE__ */ t(M, {}),
75
+ /* @__PURE__ */ t(U, {}),
75
76
  /* @__PURE__ */ a("div", { children: [
76
77
  /* @__PURE__ */ t("p", { className: "text-[13.5px] font-semibold text-foreground", children: "Render settings" }),
77
78
  /* @__PURE__ */ t("p", { className: i, children: "How published videos are encoded. Changes apply to the next render; videos already rendered keep their file." })
@@ -81,7 +82,7 @@ function pe() {
81
82
  " ",
82
83
  /* @__PURE__ */ t("button", { type: "button", className: "underline", onClick: () => void w.refetch(), children: "Try again" })
83
84
  ] }) : !r || !s ? /* @__PURE__ */ t("p", { className: i, role: "status", children: "Loading…" }) : /* @__PURE__ */ a(z, { children: [
84
- !l && /* @__PURE__ */ t("p", { className: te, "data-hv-settings-migration": !0, children: "These settings need a database update (migration 410) before they can be saved. Renders use the values shown." }),
85
+ !l && /* @__PURE__ */ t("p", { className: se, "data-hv-settings-migration": !0, children: "These settings need a database update (migration 410) before they can be saved. Renders use the values shown." }),
85
86
  /* @__PURE__ */ a("div", { className: "space-y-1", children: [
86
87
  /* @__PURE__ */ a("label", { htmlFor: d.crf, className: f, children: [
87
88
  "Quality",
@@ -118,13 +119,13 @@ function pe() {
118
119
  /* @__PURE__ */ t(g, { dto: s, k: "preset" })
119
120
  ] }),
120
121
  /* @__PURE__ */ t(
121
- X,
122
+ Y,
122
123
  {
123
124
  value: r.preset,
124
125
  onChange: (e) => c({ ...r, preset: e }),
125
126
  options: s.limits.presets.map((e) => ({
126
127
  value: e,
127
- label: `${e} · ${ee[e] ?? e}`
128
+ label: `${e} · ${te[e] ?? e}`
128
129
  })),
129
130
  ariaLabel: "Speed",
130
131
  disabled: !l,
@@ -166,7 +167,7 @@ function pe() {
166
167
  /* @__PURE__ */ t(g, { dto: s, k: "hardware" })
167
168
  ] }),
168
169
  /* @__PURE__ */ t(
169
- Y,
170
+ Z,
170
171
  {
171
172
  id: d.hw,
172
173
  checked: r.hardware === "auto",
@@ -239,5 +240,5 @@ function pe() {
239
240
  );
240
241
  }
241
242
  export {
242
- pe as RenderSettingsButton
243
+ ge as RenderSettingsButton
243
244
  };