@nivaro/react 0.3.111 → 0.3.112

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 (75) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +170 -2
  4. package/dist/index.js +745 -728
  5. package/dist/shared/components/CollectionBrowserView.js +3097 -2972
  6. package/dist/shared/components/CollectionImportBanner.js +135 -0
  7. package/dist/shared/components/ItemEditForm.js +2235 -2218
  8. package/dist/shared/components/JobsTray.js +54 -47
  9. package/dist/shared/components/ViewAsPersonButton.js +109 -0
  10. package/dist/shared/components/bulk/BulkFieldUpdate.js +228 -150
  11. package/dist/shared/components/bulk/BulkFieldUpdateButton.js +35 -41
  12. package/dist/shared/components/bulk/BulkLinksValue.js +91 -0
  13. package/dist/shared/components/bulk/bulk-field-options.js +20 -19
  14. package/dist/shared/components/bulk/bulk-update-preview.js +39 -0
  15. package/dist/shared/components/cbv/ColumnHeaderMenu.js +113 -0
  16. package/dist/shared/components/cbv/column-totals.js +66 -0
  17. package/dist/shared/components/collections-directory/CollectionHoverCard.js +108 -81
  18. package/dist/shared/components/collections-directory/CollectionRow.js +164 -148
  19. package/dist/shared/components/collections-directory/CollectionsDirectory.js +167 -166
  20. package/dist/shared/components/collections-directory/directory-data.js +70 -58
  21. package/dist/shared/components/imports/CollectionImportPanel.js +120 -118
  22. package/dist/shared/components/imports/DefinitionsPanel.js +24 -24
  23. package/dist/shared/components/imports/ImportDuplicatesNotice.js +65 -0
  24. package/dist/shared/components/item-edit/CatalogPickerField.js +631 -639
  25. package/dist/shared/components/item-edit/DuplicateNotice.js +168 -0
  26. package/dist/shared/components/item-edit/FieldRow.js +248 -246
  27. package/dist/shared/components/item-edit/InlineGridField.js +34 -33
  28. package/dist/shared/components/item-edit/InlineTableField.js +3064 -2882
  29. package/dist/shared/components/item-edit/MembershipSetField.js +165 -169
  30. package/dist/shared/components/item-edit/NestedRelationEditor.js +184 -189
  31. package/dist/shared/components/item-edit/PlanGrid.js +2 -1
  32. package/dist/shared/components/item-edit/QuickPickerDialog.js +35 -34
  33. package/dist/shared/components/item-edit/RecordLiveSync.js +32 -30
  34. package/dist/shared/components/item-edit/RelationCombobox.js +101 -100
  35. package/dist/shared/components/item-edit/RowHistorySheet.js +28 -27
  36. package/dist/shared/components/item-edit/SummaryPanel.js +133 -135
  37. package/dist/shared/components/item-edit/ViewAsRole.js +129 -52
  38. package/dist/shared/components/item-edit/grid-search.js +345 -0
  39. package/dist/shared/components/item-edit/render-stability.js +61 -54
  40. package/dist/shared/components/notifications/NotificationRulesEditor.js +25 -20
  41. package/dist/shared/components/ops-report/DigestSections.js +163 -144
  42. package/dist/shared/components/ops-report/drill.js +97 -97
  43. package/dist/shared/components/panels/AddendumLinesDiff.js +52 -51
  44. package/dist/shared/components/panels/AddendumPanel.js +92 -91
  45. package/dist/shared/components/panels/AsyncUserPicker.js +108 -0
  46. package/dist/shared/components/panels/CommentPanel.js +265 -252
  47. package/dist/shared/components/panels/OwnersSlot.js +47 -35
  48. package/dist/shared/components/panels/PipelineInsight.js +186 -0
  49. package/dist/shared/components/panels/PipelinePanel.js +1529 -1492
  50. package/dist/shared/components/panels/RecordIntegrityBanner.js +39 -38
  51. package/dist/shared/components/panels/RevisionsPanel.js +261 -260
  52. package/dist/shared/components/pipeline/FieldPicker.js +41 -40
  53. package/dist/shared/components/pipeline/OwnerMatrix.js +829 -700
  54. package/dist/shared/components/pipeline/OwnerRecordTrial.js +362 -0
  55. package/dist/shared/components/pipeline/PipelineEditorView.js +483 -467
  56. package/dist/shared/components/pipeline/PipelineStateOwners.js +65 -64
  57. package/dist/shared/components/pipeline/owner-matrix-draft.js +178 -0
  58. package/dist/shared/components/profile/MyDefaultsCard.js +36 -35
  59. package/dist/shared/components/profile/PersonHeader.js +29 -29
  60. package/dist/shared/components/profile/PersonProfile.js +30 -28
  61. package/dist/shared/components/profile/SlowScreensCard.js +286 -0
  62. package/dist/shared/components/queue/QueueWorklist.js +1090 -1071
  63. package/dist/shared/components/quick-filters/useQuickFilterEditing.js +45 -44
  64. package/dist/shared/components/support/TicketDetailSheet.js +25 -16
  65. package/dist/shared/components/support/TicketSlowScreens.js +32 -0
  66. package/dist/shared/lib/activity-sentence.js +224 -178
  67. package/dist/shared/lib/collection-import-banner.js +27 -0
  68. package/dist/shared/lib/crash-report.js +112 -0
  69. package/dist/shared/lib/export-runs.js +99 -0
  70. package/dist/shared/lib/jobs-tray.js +89 -67
  71. package/dist/shared/lib/list-link.js +76 -69
  72. package/dist/shared/lib/nav-trail.js +180 -76
  73. package/dist/shared/lib/query-keys.js +26 -0
  74. package/dist/shared/lib/view-as.js +16 -11
  75. package/package.json +1 -1
@@ -1,31 +1,32 @@
1
1
  import { jsxs as r, jsx as t } from "react/jsx-runtime";
2
- import { useQuery as N } from "@tanstack/react-query";
3
- import { Loader2 as f, AlertCircle as v, CircleSlash as k, Check as g, ChevronDown as w, ChevronUp as C, Timer as _, Download as q, X as J } from "lucide-react";
4
- import { useState as b, useEffect as D } from "react";
5
- import { createPortal as F } from "react-dom";
6
- import { useOptionalNivaroClient as T, useNavigation as $ } from "../context.js";
2
+ import { useQuery as C } from "@tanstack/react-query";
3
+ import { Loader2 as v, AlertCircle as k, CircleSlash as g, Check as b, ChevronDown as _, ChevronUp as $, Timer as q, Download as J, X as F } from "lucide-react";
4
+ import { useState as N, useEffect as D } from "react";
5
+ import { createPortal as L } from "react-dom";
6
+ import { useOptionalNivaroClient as S, useNavigation as T } from "../context.js";
7
7
  import { clock as E } from "../lib/background-runs.js";
8
8
  import { get as M, post as O } from "../lib/commands.js";
9
- import { jobFailureText as S } from "../lib/job-failure-text.js";
10
- import { useTrayJobs as U, seedJobs as H, trayHeadline as L, dismissFinishedJobs as R, dismissJob as z, applyJobUpdate as A } from "../lib/jobs-tray.js";
11
- import { useLiveEvent as B } from "../lib/live.js";
12
- import { cn as I } from "../lib/utils.js";
13
- import { queueStanding as K } from "./imports/run-parts.js";
14
- function re() {
15
- const e = T(), o = $(), s = U(), [l, d] = b(!0);
16
- B("job:progress", (a) => A(a), { includeOwn: !0 });
17
- const m = s.some((a) => a.status === "running" || a.status === "queued"), { data: i } = N({
9
+ import { withoutFileRef as P } from "../lib/export-runs.js";
10
+ import { jobFailureText as R } from "../lib/job-failure-text.js";
11
+ import { useTrayJobs as U, seedJobs as H, trayHeadline as z, dismissFinishedJobs as A, cancelLocalJob as B, dismissJob as I, applyJobUpdate as K } from "../lib/jobs-tray.js";
12
+ import { useLiveEvent as Q } from "../lib/live.js";
13
+ import { cn as X } from "../lib/utils.js";
14
+ import { queueStanding as G } from "./imports/run-parts.js";
15
+ function ce() {
16
+ const e = S(), i = T(), s = U(), [l, d] = N(!0);
17
+ Q("job:progress", (a) => K(a), { includeOwn: !0 });
18
+ const h = s.some((a) => a.status === "running" || a.status === "queued"), { data: o } = C({
18
19
  queryKey: ["jobs-tray-seed"],
19
20
  enabled: !!e,
20
21
  staleTime: 0,
21
- refetchInterval: m ? 2e4 : !1,
22
+ refetchInterval: h ? 2e4 : !1,
22
23
  queryFn: () => e.request(M("/my-jobs")).then((a) => a.data ?? []).catch(() => [])
23
24
  });
24
25
  if (D(() => {
25
- i && H(i);
26
- }, [i]), s.length === 0 || typeof document > "u") return null;
27
- const c = s.filter((a) => a.status === "running" || a.status === "queued").length, p = s.length - c, n = L(s), u = (a) => o.navigate ? o.navigate(a) : window.location.assign(a);
28
- return F(
26
+ o && H(o);
27
+ }, [o]), s.length === 0 || typeof document > "u") return null;
28
+ const c = s.filter((a) => a.status === "running" || a.status === "queued").length, p = s.length - c, n = z(s), u = (a) => i.navigate ? i.navigate(a) : window.location.assign(a);
29
+ return L(
29
30
  /* @__PURE__ */ r(
30
31
  "div",
31
32
  {
@@ -36,7 +37,7 @@ function re() {
36
37
  className: "fixed bottom-4 left-1/2 z-[110] w-[min(420px,calc(100vw-2rem))] -translate-x-1/2 overflow-hidden rounded-xl border border-slate-200 bg-white text-slate-700 shadow-xl dark:border-[#334155] dark:bg-[#1e293b] dark:text-slate-200",
37
38
  children: [
38
39
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2 px-3 py-2", children: [
39
- n.tone === "running" ? /* @__PURE__ */ t(f, { className: "h-3.5 w-3.5 shrink-0 animate-spin text-nvr-cyan" }) : n.tone === "failed" ? /* @__PURE__ */ t(v, { className: "h-3.5 w-3.5 shrink-0 text-rose-500" }) : n.tone === "cancelled" ? /* @__PURE__ */ t(k, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }) : /* @__PURE__ */ t(g, { className: "h-3.5 w-3.5 shrink-0 text-emerald-600 dark:text-emerald-400" }),
40
+ n.tone === "running" ? /* @__PURE__ */ t(v, { className: "h-3.5 w-3.5 shrink-0 animate-spin text-nvr-cyan" }) : n.tone === "failed" ? /* @__PURE__ */ t(k, { className: "h-3.5 w-3.5 shrink-0 text-rose-500" }) : n.tone === "cancelled" ? /* @__PURE__ */ t(g, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }) : /* @__PURE__ */ t(b, { className: "h-3.5 w-3.5 shrink-0 text-emerald-600 dark:text-emerald-400" }),
40
41
  /* @__PURE__ */ r(
41
42
  "button",
42
43
  {
@@ -58,7 +59,7 @@ function re() {
58
59
  "button",
59
60
  {
60
61
  type: "button",
61
- onClick: R,
62
+ onClick: A,
62
63
  "data-jobs-tray-clear": !0,
63
64
  className: "text-[11px] text-slate-500 hover:text-slate-800 dark:text-slate-400 dark:hover:text-slate-100",
64
65
  children: c > 0 ? "Clear finished" : "Clear"
@@ -71,17 +72,20 @@ function re() {
71
72
  onClick: () => d((a) => !a),
72
73
  "aria-label": l ? "Collapse" : "Expand",
73
74
  className: "flex h-6 w-6 items-center justify-center rounded hover:bg-black/5 dark:hover:bg-white/10",
74
- children: l ? /* @__PURE__ */ t(w, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(C, { className: "h-3.5 w-3.5" })
75
+ children: l ? /* @__PURE__ */ t(_, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t($, { className: "h-3.5 w-3.5" })
75
76
  }
76
77
  )
77
78
  ] }),
78
79
  l && /* @__PURE__ */ t("ul", { className: "max-h-[40vh] divide-y divide-slate-100 overflow-y-auto border-t border-slate-100 dark:divide-[#334155] dark:border-[#334155]", children: s.map((a) => /* @__PURE__ */ t(
79
- P,
80
+ V,
80
81
  {
81
82
  job: a,
82
83
  onOpen: u,
83
- onCancel: e && a.cancel_path ? (h) => e.request(O(h)).then(() => {
84
- }) : void 0
84
+ onCancel: a.cancel_path ? (m) => (
85
+ // An export this tab builds itself stops here; anything else asks the server.
86
+ B(m) ? Promise.resolve() : e ? e.request(O(m)).then(() => {
87
+ }) : Promise.reject(new Error("Not connected"))
88
+ ) : void 0
85
89
  },
86
90
  a.key
87
91
  )) })
@@ -91,23 +95,26 @@ function re() {
91
95
  document.body
92
96
  );
93
97
  }
94
- function P({
98
+ function V({
95
99
  job: e,
96
- onOpen: o,
100
+ onOpen: i,
97
101
  onCancel: s
98
102
  }) {
99
- const [l, d] = b("idle"), m = e.status === "completed", i = e.status === "error", c = e.status === "queued", p = e.status === "canceled", n = e.progress ?? {}, u = Number(n.total), a = Number(n.done), h = Number.isFinite(u) && u > 0 && Number.isFinite(a) ? Math.max(0, Math.min(100, Math.round(a / u * 100))) : null, y = typeof n.phase == "string" ? n.phase : null, x = c ? K(
103
+ const [l, d] = N("idle"), h = e.status === "completed", o = e.status === "error", c = e.status === "queued", p = e.status === "canceled", n = e.progress ?? {}, u = Number(n.total), a = Number(n.done), m = Number.isFinite(u) && u > 0 && Number.isFinite(a) ? Math.max(0, Math.min(100, Math.round(a / u * 100))) : null, y = typeof n.phase == "string" ? n.phase : null, x = typeof n.unit == "string" ? ` ${n.unit}` : "", w = m != null ? `${a.toLocaleString()} of ${u.toLocaleString()}${x}` : x && Number.isFinite(a) && a > 0 ? `${a.toLocaleString()}${x}` : null, f = c ? G(
100
104
  e.position != null ? { position: e.position, eta_seconds: e.eta_seconds ?? null } : void 0
101
- ) : i ? (
105
+ ) : o ? (
102
106
  // Read, never shown as stored: a job's error is written for the log (lib/job-failure-text).
103
- S(e.error)
104
- ) : m ? e.outcome : p ? (
107
+ R(e.error)
108
+ ) : h ? (
109
+ // The file reference ("→ file <id>") is what the Download chip reads, not words.
110
+ P(e.outcome) || null
111
+ ) : p ? (
105
112
  // An import's cancel sends no outcome: the row still says what happened.
106
113
  e.outcome || "Cancelled"
107
114
  ) : e.kind === "background-run" ? (
108
115
  // #2759 — a slow read the server is finishing: say how long it usually takes.
109
116
  Number(n.expected_ms) >= 1e3 ? `Usually takes about ${E(Number(n.expected_ms))}` : "Running on the server"
110
- ) : [y, h != null ? `${a} of ${u}` : null].filter(Boolean).join(" · ") || null;
117
+ ) : [y, w].filter(Boolean).join(" · ") || null;
111
118
  return /* @__PURE__ */ r(
112
119
  "li",
113
120
  {
@@ -115,35 +122,35 @@ function P({
115
122
  "data-job-status": e.status,
116
123
  className: "flex items-start gap-2.5 px-3 py-2",
117
124
  children: [
118
- /* @__PURE__ */ t("span", { className: "mt-0.5 shrink-0", children: i ? /* @__PURE__ */ t(v, { className: "h-3.5 w-3.5 text-rose-500" }) : m ? /* @__PURE__ */ t(g, { className: "h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400" }) : p ? /* @__PURE__ */ t(k, { className: "h-3.5 w-3.5 text-slate-400" }) : c ? /* @__PURE__ */ t(_, { className: "h-3.5 w-3.5 text-slate-400" }) : /* @__PURE__ */ t(f, { className: "h-3.5 w-3.5 animate-spin text-nvr-cyan" }) }),
125
+ /* @__PURE__ */ t("span", { className: "mt-0.5 shrink-0", children: o ? /* @__PURE__ */ t(k, { className: "h-3.5 w-3.5 text-rose-500" }) : h ? /* @__PURE__ */ t(b, { className: "h-3.5 w-3.5 text-emerald-600 dark:text-emerald-400" }) : p ? /* @__PURE__ */ t(g, { className: "h-3.5 w-3.5 text-slate-400" }) : c ? /* @__PURE__ */ t(q, { className: "h-3.5 w-3.5 text-slate-400" }) : /* @__PURE__ */ t(v, { className: "h-3.5 w-3.5 animate-spin text-nvr-cyan" }) }),
119
126
  /* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
120
127
  /* @__PURE__ */ t("p", { className: "truncate text-[12.5px] font-medium", children: e.label }),
121
- x && /* @__PURE__ */ t(
128
+ f && /* @__PURE__ */ t(
122
129
  "p",
123
130
  {
124
- className: I(
131
+ className: X(
125
132
  "line-clamp-2 text-[11px]",
126
- i ? "text-rose-600 dark:text-rose-300" : "text-slate-500 dark:text-slate-400"
133
+ o ? "text-rose-600 dark:text-rose-300" : "text-slate-500 dark:text-slate-400"
127
134
  ),
128
- children: x
135
+ children: f
129
136
  }
130
137
  ),
131
- e.status === "running" && h != null && /* @__PURE__ */ t("div", { className: "mt-1 h-1 overflow-hidden rounded-full bg-slate-100 dark:bg-[#334155]", children: /* @__PURE__ */ t(
138
+ e.status === "running" && m != null && /* @__PURE__ */ t("div", { className: "mt-1 h-1 overflow-hidden rounded-full bg-slate-100 dark:bg-[#334155]", children: /* @__PURE__ */ t(
132
139
  "div",
133
140
  {
134
141
  className: "h-full rounded-full bg-nvr-cyan transition-all",
135
- style: { width: `${h}%` }
142
+ style: { width: `${m}%` }
136
143
  }
137
144
  ) }),
138
145
  (e.file_id || e.href) && (e.status === "completed" || e.status === "error") && /* @__PURE__ */ r("div", { className: "mt-1 flex items-center gap-2", children: [
139
- e.file_id && m && /* @__PURE__ */ r(
146
+ e.file_id && h && /* @__PURE__ */ r(
140
147
  "a",
141
148
  {
142
149
  href: `/api/files/${e.file_id}?download=1`,
143
150
  "data-job-download": !0,
144
151
  className: "inline-flex items-center gap-1 rounded-full border border-nvr-cyan/50 bg-nvr-cyan/10 px-2 py-0.5 text-[11px] font-medium text-[#0e7490] hover:bg-nvr-cyan/20 dark:text-[#67e8f9]",
145
152
  children: [
146
- /* @__PURE__ */ t(q, { className: "h-3 w-3" }),
153
+ /* @__PURE__ */ t(J, { className: "h-3 w-3" }),
147
154
  "Download"
148
155
  ]
149
156
  }
@@ -152,7 +159,7 @@ function P({
152
159
  "button",
153
160
  {
154
161
  type: "button",
155
- onClick: () => o(e.href),
162
+ onClick: () => i(e.href),
156
163
  className: "text-[11px] text-slate-500 underline-offset-2 hover:underline dark:text-slate-400",
157
164
  children: "Details"
158
165
  }
@@ -163,7 +170,7 @@ function P({
163
170
  "button",
164
171
  {
165
172
  type: "button",
166
- onClick: () => o(e.href),
173
+ onClick: () => i(e.href),
167
174
  className: "text-[11px] text-slate-500 underline-offset-2 hover:underline dark:text-slate-400",
168
175
  children: "Open"
169
176
  }
@@ -190,7 +197,7 @@ function P({
190
197
  "button",
191
198
  {
192
199
  type: "button",
193
- onClick: () => o(e.href),
200
+ onClick: () => i(e.href),
194
201
  className: "mt-0.5 text-[11px] text-slate-500 underline-offset-2 hover:underline dark:text-slate-400",
195
202
  children: "Details"
196
203
  }
@@ -200,11 +207,11 @@ function P({
200
207
  "button",
201
208
  {
202
209
  type: "button",
203
- onClick: () => z(e.key),
210
+ onClick: () => I(e.key),
204
211
  "aria-label": "Dismiss",
205
212
  "data-job-dismiss": !0,
206
213
  className: "flex h-6 w-6 shrink-0 items-center justify-center rounded hover:bg-black/5 dark:hover:bg-white/10",
207
- children: /* @__PURE__ */ t(J, { className: "h-3 w-3" })
214
+ children: /* @__PURE__ */ t(F, { className: "h-3 w-3" })
208
215
  }
209
216
  )
210
217
  ]
@@ -212,5 +219,5 @@ function P({
212
219
  );
213
220
  }
214
221
  export {
215
- re as JobsTray
222
+ ce as JobsTray
216
223
  };
@@ -0,0 +1,109 @@
1
+ import { jsxs as a, jsx as r } from "react/jsx-runtime";
2
+ import { Eye as s } from "lucide-react";
3
+ import { useState as d } from "react";
4
+ import { useItemEditAuth as v } from "../context.js";
5
+ import { toastError as g } from "../lib/error-toast.js";
6
+ import { cn as m } from "../lib/utils.js";
7
+ import { canViewAs as y, viewAs as w, viewAsPath as k } from "../lib/view-as.js";
8
+ import { Popover as N, PopoverTrigger as A, PopoverContent as C } from "./ui/popover.js";
9
+ function I({
10
+ person: e,
11
+ path: l,
12
+ variant: c = "icon",
13
+ className: n
14
+ }) {
15
+ const { isAdmin: b } = v(), [u, i] = d(!1), [h, o] = d(!1);
16
+ if (!b || !y() || !e.id) return null;
17
+ const t = (e.firstName || e.name.split(" ")[0] || e.name).trim(), f = `View as ${e.name}`, p = async () => {
18
+ o(!0);
19
+ try {
20
+ await w({ id: e.id, name: e.name, path: k(l) ?? void 0 }), i(!1);
21
+ } catch (x) {
22
+ g(x, `Could not open this record as ${t}`);
23
+ } finally {
24
+ o(!1);
25
+ }
26
+ };
27
+ return /* @__PURE__ */ a(N, { open: u, onOpenChange: i, children: [
28
+ /* @__PURE__ */ r(A, { asChild: !0, children: c === "icon" ? /* @__PURE__ */ r(
29
+ "button",
30
+ {
31
+ type: "button",
32
+ "data-view-as-person": e.id,
33
+ "aria-label": `See this record as ${e.name}`,
34
+ "data-tip": `See this record as ${e.name}`,
35
+ className: m(
36
+ "flex h-6 w-6 shrink-0 items-center justify-center rounded text-slate-400 transition-colors hover:bg-amber-50 hover:text-amber-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan dark:hover:bg-amber-500/10 dark:hover:text-amber-300",
37
+ n
38
+ ),
39
+ children: /* @__PURE__ */ r(s, { className: "h-3.5 w-3.5" })
40
+ }
41
+ ) : /* @__PURE__ */ a(
42
+ "button",
43
+ {
44
+ type: "button",
45
+ "data-view-as-person": e.id,
46
+ className: m(
47
+ "inline-flex h-6 shrink-0 items-center gap-1 rounded-md border border-amber-300 px-2 text-[11.5px] font-medium text-amber-800 transition-colors hover:bg-amber-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan dark:border-amber-500/40 dark:text-amber-200 dark:hover:bg-amber-500/10",
48
+ n
49
+ ),
50
+ children: [
51
+ /* @__PURE__ */ r(s, { className: "h-3.5 w-3.5" }),
52
+ "Open as ",
53
+ t,
54
+ "…"
55
+ ]
56
+ }
57
+ ) }),
58
+ /* @__PURE__ */ a(
59
+ C,
60
+ {
61
+ align: "end",
62
+ sideOffset: 6,
63
+ className: "w-72 p-3",
64
+ "data-view-as-person-confirm": e.id,
65
+ children: [
66
+ /* @__PURE__ */ r("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-foreground", children: f }),
67
+ /* @__PURE__ */ a("p", { className: "mt-1 text-[12px] leading-snug text-slate-600 dark:text-muted-foreground", children: [
68
+ "Opens this page as ",
69
+ t,
70
+ ", exactly as ",
71
+ t,
72
+ " sees it. Anything you change is done as",
73
+ " ",
74
+ t,
75
+ "; admins can see it was you."
76
+ ] }),
77
+ /* @__PURE__ */ a("div", { className: "mt-3 flex justify-end gap-2", children: [
78
+ /* @__PURE__ */ r(
79
+ "button",
80
+ {
81
+ type: "button",
82
+ onClick: () => i(!1),
83
+ className: "h-7 rounded-md px-2.5 text-[12px] font-medium text-slate-600 transition-colors hover:bg-muted dark:text-slate-300",
84
+ children: "Cancel"
85
+ }
86
+ ),
87
+ /* @__PURE__ */ a(
88
+ "button",
89
+ {
90
+ type: "button",
91
+ disabled: h,
92
+ onClick: () => void p(),
93
+ "data-view-as-person-open": !0,
94
+ className: "h-7 rounded-md bg-amber-700 px-2.5 text-[12px] font-semibold text-white transition-colors hover:bg-amber-800 disabled:opacity-60 dark:bg-amber-400 dark:text-amber-950 dark:hover:bg-amber-300",
95
+ children: [
96
+ "Open as ",
97
+ t
98
+ ]
99
+ }
100
+ )
101
+ ] })
102
+ ]
103
+ }
104
+ )
105
+ ] });
106
+ }
107
+ export {
108
+ I as ViewAsPersonButton
109
+ };