@nivaro/react 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +341 -0
  4. package/dist/index.js +764 -723
  5. package/dist/shared/components/ClientChaosToolbar.js +410 -0
  6. package/dist/shared/components/LoadErrorNote.js +49 -0
  7. package/dist/shared/components/PretendDown.js +258 -0
  8. package/dist/shared/components/ProfileView.js +54 -49
  9. package/dist/shared/components/QueryErrorState.js +16 -0
  10. package/dist/shared/components/ReportView.js +1351 -1338
  11. package/dist/shared/components/WidgetSlot.js +438 -418
  12. package/dist/shared/components/chaos/DeclareIncidentButton.js +72 -0
  13. package/dist/shared/components/chaos/DrillBanner.js +119 -0
  14. package/dist/shared/components/chaos/DrillTag.js +62 -0
  15. package/dist/shared/components/chaos/GameDayStrip.js +61 -0
  16. package/dist/shared/components/chat/huddle/HuddleAudioUi.js +95 -92
  17. package/dist/shared/components/chat/huddle/HuddleCallBar.js +69 -64
  18. package/dist/shared/components/chat/huddle/HuddlePeoplePicker.js +40 -39
  19. package/dist/shared/components/chat/huddle/HuddleStageTools.js +30 -27
  20. package/dist/shared/components/chat/huddle/huddle-dismiss.js +12 -0
  21. package/dist/shared/components/chat/huddle/huddle-store.js +25 -20
  22. package/dist/shared/components/client-chaos-gate.js +51 -0
  23. package/dist/shared/components/integrations/console/SignalCard.js +172 -167
  24. package/dist/shared/components/layout-editor/EditorTopBar.js +108 -105
  25. package/dist/shared/components/layout-editor/LayoutEditor.js +514 -508
  26. package/dist/shared/components/notifications/NotificationAnalyticsView.js +18 -10
  27. package/dist/shared/components/pipeline/PipelineEditorView.js +495 -479
  28. package/dist/shared/components/pipeline/TeamsView.js +184 -169
  29. package/dist/shared/lib/client-chaos.js +359 -0
  30. package/dist/shared/lib/load-error.js +26 -0
  31. package/dist/shared/lib/socket-realtime.js +31 -30
  32. package/dist/shared/lib/worker-socket.js +108 -89
  33. package/package.json +1 -1
@@ -0,0 +1,410 @@
1
+ import { jsxs as a, Fragment as M, jsx as e } from "react/jsx-runtime";
2
+ import { Unplug as F, X as T, Shuffle as W, ServerCrash as z, Gauge as B, WifiOff as D, Radio as K } from "lucide-react";
3
+ import { useState as f, useEffect as v, useId as A, useRef as q, useCallback as H } from "react";
4
+ import { createPortal as G } from "react-dom";
5
+ import { stopClientChaos as I, CLIENT_CHAOS_STRENGTH as k, startClientChaos as U, CLIENT_CHAOS_MAX_FAIL_WRITES as E } from "../lib/client-chaos.js";
6
+ import { cn as x } from "../lib/utils.js";
7
+ import { useClientChaosGate as V, useClientChaos as X } from "./client-chaos-gate.js";
8
+ import { Skeleton as y } from "./ui/skeleton.js";
9
+ const N = "nvr:client-chaos-open";
10
+ function me() {
11
+ typeof window < "u" && window.dispatchEvent(new CustomEvent(N));
12
+ }
13
+ const Y = "⌘⇧.", P = [
14
+ {
15
+ id: "flaky",
16
+ label: "Flaky network",
17
+ effect: "Some requests fail, the rest lag",
18
+ icon: /* @__PURE__ */ e(W, { className: "h-3.5 w-3.5" })
19
+ },
20
+ {
21
+ id: "api-down",
22
+ label: "API down",
23
+ effect: "Every API call answers 503",
24
+ icon: /* @__PURE__ */ e(z, { className: "h-3.5 w-3.5" })
25
+ },
26
+ {
27
+ id: "slow",
28
+ label: "Slow API",
29
+ effect: "Every API call waits longer",
30
+ icon: /* @__PURE__ */ e(B, { className: "h-3.5 w-3.5" })
31
+ },
32
+ {
33
+ id: "offline",
34
+ label: "Offline",
35
+ effect: "Requests fail as if the network is gone",
36
+ icon: /* @__PURE__ */ e(D, { className: "h-3.5 w-3.5" })
37
+ },
38
+ {
39
+ id: "socket-gone",
40
+ label: "Socket gone",
41
+ effect: "Live updates stop, then reconnect at the end",
42
+ icon: /* @__PURE__ */ e(K, { className: "h-3.5 w-3.5" })
43
+ }
44
+ ], L = [
45
+ { ms: 6e4, label: "1 min" },
46
+ { ms: 5 * 6e4, label: "5 min" },
47
+ { ms: 15 * 6e4, label: "15 min" },
48
+ { ms: 30 * 6e4, label: "30 min" }
49
+ ], J = Object.fromEntries(
50
+ P.map((t) => [t.id, t.label])
51
+ );
52
+ function O(t, n) {
53
+ return t === "flaky" ? `${n}% of requests fail` : t === "slow" ? `+${(n / 1e3).toFixed(n % 1e3 === 0 ? 0 : 2)} s each` : null;
54
+ }
55
+ function _(t) {
56
+ const n = [];
57
+ return t.preset && n.push(J[t.preset]), t.failWrites > 0 && n.push(`${t.failWrites} save${t.failWrites === 1 ? "" : "s"} to fail`), n.join(" · ") || "Browser chaos";
58
+ }
59
+ function R(t) {
60
+ const n = Math.max(0, Math.ceil(t / 1e3)), s = Math.floor(n / 60), o = n % 60;
61
+ return `${s}:${String(o).padStart(2, "0")}`;
62
+ }
63
+ function Q(t) {
64
+ const [n, s] = f(() => Date.now());
65
+ return v(() => {
66
+ if (!t) return;
67
+ s(Date.now());
68
+ const o = setInterval(() => s(Date.now()), 1e3);
69
+ return () => clearInterval(o);
70
+ }, [t]), n;
71
+ }
72
+ function fe({ user: t, shortcut: n = !0 }) {
73
+ const s = V(t), o = X(), [l, u] = f(!1), d = Q(o !== null);
74
+ return v(() => {
75
+ const c = () => u(!0);
76
+ return window.addEventListener(N, c), () => window.removeEventListener(N, c);
77
+ }, []), v(() => {
78
+ if (!n) return;
79
+ const c = (i) => {
80
+ !(i.metaKey || i.ctrlKey) || !i.shiftKey || i.altKey || i.code !== "Period" || (i.preventDefault(), u((h) => !h));
81
+ };
82
+ return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
83
+ }, [n]), !s.present && !s.loading || typeof document > "u" ? null : G(
84
+ /* @__PURE__ */ a(M, { children: [
85
+ l && /* @__PURE__ */ e(te, { gate: s, chaos: o, now: d, onClose: () => u(!1) }),
86
+ !l && o && s.allowed && /* @__PURE__ */ e(Z, { chaos: o, now: d, onOpen: () => u(!0) })
87
+ ] }),
88
+ document.body
89
+ );
90
+ }
91
+ function Z({
92
+ chaos: t,
93
+ now: n,
94
+ onOpen: s
95
+ }) {
96
+ return /* @__PURE__ */ a(
97
+ "div",
98
+ {
99
+ "data-client-chaos-pill": "",
100
+ style: ee,
101
+ className: "nvr-chaos-enter fixed bottom-4 z-[70] flex items-center rounded-full border border-white/10 bg-[#0f172a] text-[12px] text-slate-100 shadow-lg",
102
+ children: [
103
+ /* @__PURE__ */ e("style", { children: j }),
104
+ /* @__PURE__ */ a(
105
+ "button",
106
+ {
107
+ type: "button",
108
+ onClick: s,
109
+ "data-tip": "Browser chaos is on in this tab — open the controls",
110
+ className: "flex min-w-0 items-center gap-2 rounded-l-full py-1.5 pr-2 pl-3 hover:bg-white/[0.06] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/60",
111
+ children: [
112
+ /* @__PURE__ */ a("span", { className: "relative flex h-2 w-2 shrink-0", children: [
113
+ /* @__PURE__ */ e("span", { className: "absolute inline-flex h-full w-full animate-ping rounded-full bg-amber-400 opacity-60 motion-reduce:animate-none" }),
114
+ /* @__PURE__ */ e("span", { className: "relative inline-flex h-2 w-2 rounded-full bg-amber-400" })
115
+ ] }),
116
+ /* @__PURE__ */ e("span", { className: "truncate font-medium", children: _(t) }),
117
+ /* @__PURE__ */ e("span", { className: "shrink-0 font-mono text-[11.5px] tabular-nums text-slate-400", children: R(t.endsAt - n) })
118
+ ]
119
+ }
120
+ ),
121
+ /* @__PURE__ */ e(
122
+ "button",
123
+ {
124
+ type: "button",
125
+ "aria-label": "Stop browser chaos",
126
+ "data-tip": "Stop now",
127
+ onClick: I,
128
+ className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-r-full border-l border-white/10 text-slate-400 hover:bg-white/[0.06] hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/60",
129
+ children: /* @__PURE__ */ e(T, { className: "h-3.5 w-3.5" })
130
+ }
131
+ )
132
+ ]
133
+ }
134
+ );
135
+ }
136
+ const ee = {
137
+ right: "var(--nvr-chaos-pill-right, 60px)",
138
+ maxWidth: "calc(100vw - var(--nvr-chaos-pill-right, 60px) - 16px)"
139
+ }, j = `
140
+ @keyframes nvr-chaos-in { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
141
+ .nvr-chaos-enter { animation: nvr-chaos-in 180ms cubic-bezier(0.22, 1, 0.36, 1) backwards }
142
+ @media (prefers-reduced-motion: reduce) { .nvr-chaos-enter { animation: none } }
143
+ .nvr-chaos-range { -webkit-appearance: none; appearance: none; height: 16px; background: transparent; cursor: pointer; --nvr-range-track: rgb(226 232 240) }
144
+ .dark .nvr-chaos-range { --nvr-range-track: rgb(255 255 255 / 0.14) }
145
+ .nvr-chaos-range::-webkit-slider-runnable-track { height: 4px; border-radius: 9999px; background: linear-gradient(to right, rgb(var(--nvr-cyan-rgb, 0 206 255)) 0 var(--nvr-range-fill, 0%), var(--nvr-range-track) var(--nvr-range-fill, 0%) 100%) }
146
+ .nvr-chaos-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 9999px; background: #fff; border: 2px solid rgb(var(--nvr-cyan-rgb, 0 206 255)); box-shadow: 0 1px 2px rgb(0 0 0 / 0.15) }
147
+ .nvr-chaos-range::-moz-range-track { height: 4px; border-radius: 9999px; background: var(--nvr-range-track) }
148
+ .nvr-chaos-range::-moz-range-progress { height: 4px; border-radius: 9999px; background: rgb(var(--nvr-cyan-rgb, 0 206 255)) }
149
+ .nvr-chaos-range::-moz-range-thumb { width: 10px; height: 10px; border-radius: 9999px; background: #fff; border: 2px solid rgb(var(--nvr-cyan-rgb, 0 206 255)) }
150
+ .nvr-chaos-range:focus-visible { outline: none }
151
+ .nvr-chaos-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgb(var(--nvr-cyan-rgb, 0 206 255) / 0.35) }
152
+ .nvr-chaos-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px rgb(var(--nvr-cyan-rgb, 0 206 255) / 0.35) }
153
+ `;
154
+ function te({
155
+ gate: t,
156
+ chaos: n,
157
+ now: s,
158
+ onClose: o
159
+ }) {
160
+ const l = A(), u = q(null);
161
+ return v(() => {
162
+ var c, i;
163
+ const d = (h) => {
164
+ h.key === "Escape" && o();
165
+ };
166
+ return window.addEventListener("keydown", d), (i = (c = u.current) == null ? void 0 : c.querySelector("[data-autofocus]")) == null || i.focus(), () => window.removeEventListener("keydown", d);
167
+ }, [o]), /* @__PURE__ */ a(
168
+ "div",
169
+ {
170
+ ref: u,
171
+ role: "dialog",
172
+ "aria-modal": "false",
173
+ "aria-labelledby": l,
174
+ "data-client-chaos-panel": "",
175
+ className: "nvr-chaos-enter fixed right-4 bottom-4 left-4 z-[70] max-h-[calc(100vh-32px)] overflow-y-auto overscroll-contain rounded-lg border border-slate-200 bg-white text-slate-900 shadow-xl sm:left-auto sm:w-[340px] dark:border-border dark:bg-card dark:text-foreground",
176
+ children: [
177
+ /* @__PURE__ */ e("style", { children: j }),
178
+ /* @__PURE__ */ a("div", { className: "flex items-start gap-2.5 border-b border-slate-100 px-4 pt-3.5 pb-3 dark:border-border", children: [
179
+ /* @__PURE__ */ e(F, { className: "mt-0.5 h-4 w-4 shrink-0 text-slate-400" }),
180
+ /* @__PURE__ */ a("div", { className: "min-w-0 flex-1", children: [
181
+ /* @__PURE__ */ e("h2", { id: l, className: "text-[13.5px] font-semibold leading-tight", children: "Browser chaos" }),
182
+ /* @__PURE__ */ e("p", { className: "mt-0.5 text-[12px] leading-snug text-slate-500 dark:text-muted-foreground", children: "Breaks this tab’s own requests on purpose. Nobody else is affected." })
183
+ ] }),
184
+ /* @__PURE__ */ e(
185
+ "button",
186
+ {
187
+ type: "button",
188
+ "aria-label": "Close",
189
+ "data-tip": `Close (${Y})`,
190
+ onClick: o,
191
+ className: "-mt-0.5 -mr-1.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-slate-400 hover:bg-muted hover:text-slate-700 dark:hover:text-foreground",
192
+ children: /* @__PURE__ */ e(T, { className: "h-4 w-4" })
193
+ }
194
+ )
195
+ ] }),
196
+ t.loading ? /* @__PURE__ */ a("div", { className: "space-y-2.5 px-4 py-4", "aria-busy": "true", children: [
197
+ /* @__PURE__ */ e(y, { className: "h-3.5 w-2/3" }),
198
+ /* @__PURE__ */ e(y, { className: "h-3.5 w-1/2" }),
199
+ /* @__PURE__ */ e(y, { className: "h-8 w-full" })
200
+ ] }) : t.allowed ? n ? /* @__PURE__ */ e(ne, { chaos: n, now: s }) : /* @__PURE__ */ e(re, {}) : /* @__PURE__ */ a("div", { className: "px-4 py-4 text-[12.5px]", children: [
201
+ /* @__PURE__ */ e("p", { className: "font-medium", children: "Browser chaos is off here" }),
202
+ /* @__PURE__ */ e("p", { className: "mt-1 text-slate-500 dark:text-muted-foreground", children: t.reason ?? "This server does not allow chaos drills." })
203
+ ] })
204
+ ]
205
+ }
206
+ );
207
+ }
208
+ function ne({ chaos: t, now: n }) {
209
+ const s = t.endsAt - t.startedAt, o = Math.max(0, t.endsAt - n), l = O(t.preset, t.strength);
210
+ return /* @__PURE__ */ a("div", { className: "px-4 py-4", children: [
211
+ /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
212
+ /* @__PURE__ */ a("span", { className: "relative flex h-2 w-2 shrink-0", children: [
213
+ /* @__PURE__ */ e("span", { className: "absolute inline-flex h-full w-full animate-ping rounded-full bg-amber-400 opacity-60 motion-reduce:animate-none" }),
214
+ /* @__PURE__ */ e("span", { className: "relative inline-flex h-2 w-2 rounded-full bg-amber-500" })
215
+ ] }),
216
+ /* @__PURE__ */ e("p", { className: "min-w-0 flex-1 truncate text-[13px] font-medium", children: _(t) }),
217
+ /* @__PURE__ */ a("span", { className: "shrink-0 font-mono text-[13px] tabular-nums text-slate-700 dark:text-foreground", children: [
218
+ /* @__PURE__ */ e("span", { className: "sr-only", children: "Ends in " }),
219
+ R(o)
220
+ ] })
221
+ ] }),
222
+ l && /* @__PURE__ */ e("p", { className: "mt-1 pl-4 text-[12px] text-slate-500 dark:text-muted-foreground", children: l }),
223
+ /* @__PURE__ */ e("div", { className: "mt-3 h-1 overflow-hidden rounded-full bg-slate-100 dark:bg-white/[0.08]", children: /* @__PURE__ */ e(
224
+ "div",
225
+ {
226
+ className: "h-full rounded-full bg-amber-400 transition-[width] duration-1000 ease-linear motion-reduce:transition-none",
227
+ style: { width: `${s > 0 ? o / s * 100 : 0}%` }
228
+ }
229
+ ) }),
230
+ /* @__PURE__ */ e("p", { className: "mt-2.5 text-[12px] leading-snug text-slate-500 dark:text-muted-foreground", children: "Ends on its own when the time runs out, and stays on through a reload. Signing out and this panel keep working throughout." }),
231
+ /* @__PURE__ */ e(
232
+ "button",
233
+ {
234
+ type: "button",
235
+ "data-autofocus": "",
236
+ onClick: I,
237
+ className: "mt-3.5 inline-flex h-8 w-full items-center justify-center rounded-md bg-red-600 text-[12.5px] font-medium text-white hover:bg-red-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-500/50 focus-visible:ring-offset-2 dark:ring-offset-card",
238
+ children: "Stop now"
239
+ }
240
+ )
241
+ ] });
242
+ }
243
+ function re() {
244
+ var S;
245
+ const [t, n] = f("flaky"), [s, o] = f({
246
+ flaky: k.flaky.initial,
247
+ slow: k.slow.initial
248
+ }), [l, u] = f(!1), [d, c] = f(3), [i, h] = f(5 * 6e4), C = A(), m = t === "flaky" || t === "slow" ? k[t] : null, b = t === "flaky" || t === "slow" ? s[t] : 0, g = t !== null || l, $ = H(() => {
249
+ g && U({
250
+ preset: t,
251
+ durationMs: i,
252
+ strength: b,
253
+ failWrites: l ? d : 0
254
+ });
255
+ }, [g, t, i, b, l, d]);
256
+ return /* @__PURE__ */ a("div", { className: "px-4 pt-3 pb-4", children: [
257
+ /* @__PURE__ */ e(
258
+ "p",
259
+ {
260
+ id: C,
261
+ className: "mb-1.5 text-[12px] font-medium text-slate-600 dark:text-slate-300",
262
+ children: "What breaks"
263
+ }
264
+ ),
265
+ /* @__PURE__ */ e("fieldset", { "aria-labelledby": C, className: "-mx-1.5 min-w-0 space-y-px", children: P.map((r, w) => {
266
+ const p = t === r.id;
267
+ return /* @__PURE__ */ a(
268
+ "button",
269
+ {
270
+ type: "button",
271
+ "aria-pressed": p,
272
+ "data-autofocus": w === 0 ? "" : void 0,
273
+ onClick: () => n(p ? null : r.id),
274
+ className: x(
275
+ "flex w-full items-center gap-2.5 rounded-md px-1.5 py-1.5 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50",
276
+ p ? "bg-accent" : "hover:bg-muted"
277
+ ),
278
+ children: [
279
+ /* @__PURE__ */ e(
280
+ "span",
281
+ {
282
+ className: x(
283
+ "flex h-6 w-6 shrink-0 items-center justify-center rounded-md",
284
+ p ? "bg-nvr-cyan/15 text-nvr-cyan" : "bg-slate-100 text-slate-500 dark:bg-white/[0.06] dark:text-muted-foreground"
285
+ ),
286
+ children: r.icon
287
+ }
288
+ ),
289
+ /* @__PURE__ */ a("span", { className: "min-w-0 flex-1", children: [
290
+ /* @__PURE__ */ e("span", { className: "block text-[12.5px] font-medium leading-tight", children: r.label }),
291
+ /* @__PURE__ */ e("span", { className: "block truncate text-[11.5px] leading-snug text-slate-500 dark:text-muted-foreground", children: r.effect })
292
+ ] }),
293
+ /* @__PURE__ */ e(
294
+ "span",
295
+ {
296
+ "aria-hidden": !0,
297
+ className: x(
298
+ "h-3.5 w-3.5 shrink-0 rounded-full border",
299
+ p ? "border-[4px] border-nvr-cyan" : "border-slate-300 dark:border-white/[0.2]"
300
+ )
301
+ }
302
+ )
303
+ ]
304
+ },
305
+ r.id
306
+ );
307
+ }) }),
308
+ m && (t === "flaky" || t === "slow") && /* @__PURE__ */ a("label", { className: "mt-3 block", children: [
309
+ /* @__PURE__ */ a("span", { className: "flex items-baseline justify-between text-[12px]", children: [
310
+ /* @__PURE__ */ e("span", { className: "font-medium text-slate-600 dark:text-slate-300", children: "Strength" }),
311
+ /* @__PURE__ */ e("span", { className: "text-[11.5px] tabular-nums text-slate-500 dark:text-muted-foreground", children: O(t, b) })
312
+ ] }),
313
+ /* @__PURE__ */ e(
314
+ "input",
315
+ {
316
+ type: "range",
317
+ min: m.min,
318
+ max: m.max,
319
+ step: m.step,
320
+ value: b,
321
+ onChange: (r) => o((w) => ({ ...w, [t]: Number(r.target.value) })),
322
+ className: "nvr-chaos-range mt-1 w-full",
323
+ style: {
324
+ "--nvr-range-fill": `${(b - m.min) / (m.max - m.min || 1) * 100}%`
325
+ }
326
+ }
327
+ )
328
+ ] }),
329
+ /* @__PURE__ */ a("div", { className: "mt-3 flex items-center gap-2 border-t border-slate-100 pt-3 dark:border-border", children: [
330
+ /* @__PURE__ */ a("label", { className: "flex min-w-0 flex-1 cursor-pointer items-center gap-2 text-[12.5px]", children: [
331
+ /* @__PURE__ */ e(
332
+ "input",
333
+ {
334
+ type: "checkbox",
335
+ checked: l,
336
+ onChange: (r) => u(r.target.checked),
337
+ className: "h-3.5 w-3.5 accent-nvr-cyan"
338
+ }
339
+ ),
340
+ /* @__PURE__ */ e("span", { className: "truncate", children: "Fail my next saves" })
341
+ ] }),
342
+ /* @__PURE__ */ a(
343
+ "div",
344
+ {
345
+ className: x(
346
+ "flex shrink-0 items-center rounded-md border border-slate-200 dark:border-border",
347
+ !l && "opacity-50"
348
+ ),
349
+ children: [
350
+ /* @__PURE__ */ e(
351
+ "button",
352
+ {
353
+ type: "button",
354
+ "aria-label": "Fewer saves",
355
+ disabled: !l || d <= 1,
356
+ onClick: () => c((r) => Math.max(1, r - 1)),
357
+ className: "h-7 w-7 text-[14px] text-slate-500 hover:bg-muted disabled:pointer-events-none",
358
+ children: "−"
359
+ }
360
+ ),
361
+ /* @__PURE__ */ e("span", { "aria-live": "polite", className: "w-7 text-center font-mono text-[12px] tabular-nums", children: d }),
362
+ /* @__PURE__ */ e(
363
+ "button",
364
+ {
365
+ type: "button",
366
+ "aria-label": "More saves",
367
+ disabled: !l || d >= E,
368
+ onClick: () => c((r) => Math.min(E, r + 1)),
369
+ className: "h-7 w-7 text-[14px] text-slate-500 hover:bg-muted disabled:pointer-events-none",
370
+ children: "+"
371
+ }
372
+ )
373
+ ]
374
+ }
375
+ )
376
+ ] }),
377
+ /* @__PURE__ */ e("p", { className: "mt-1 pl-[22px] text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "Creates, edits and deletes answer 500; reads still work." }),
378
+ /* @__PURE__ */ e("p", { className: "mt-3 mb-1.5 text-[12px] font-medium text-slate-600 dark:text-slate-300", children: "For" }),
379
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-4 gap-px overflow-hidden rounded-md border border-slate-200 bg-slate-200 dark:border-border dark:bg-border", children: L.map((r) => /* @__PURE__ */ e(
380
+ "button",
381
+ {
382
+ type: "button",
383
+ "aria-pressed": i === r.ms,
384
+ onClick: () => h(r.ms),
385
+ className: x(
386
+ "h-7 text-[12px] focus-visible:relative focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50",
387
+ i === r.ms ? "bg-accent font-medium text-slate-900 dark:text-foreground" : "bg-white text-slate-600 hover:bg-muted dark:bg-card dark:text-muted-foreground"
388
+ ),
389
+ children: r.label
390
+ },
391
+ r.ms
392
+ )) }),
393
+ /* @__PURE__ */ e(
394
+ "button",
395
+ {
396
+ type: "button",
397
+ disabled: !g,
398
+ onClick: $,
399
+ className: "mt-4 inline-flex h-8 w-full items-center justify-center rounded-md bg-nvr-cyan text-[12.5px] font-medium text-white hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-40 dark:ring-offset-card",
400
+ children: g ? `Start for ${(S = L.find((r) => r.ms === i)) == null ? void 0 : S.label}` : "Pick what breaks"
401
+ }
402
+ )
403
+ ] });
404
+ }
405
+ export {
406
+ Y as CLIENT_CHAOS_SHORTCUT,
407
+ fe as ClientChaosToolbar,
408
+ _ as clientChaosSummary,
409
+ me as openClientChaosToolbar
410
+ };
@@ -0,0 +1,49 @@
1
+ import { jsxs as t, jsx as r } from "react/jsx-runtime";
2
+ import { AlertTriangle as l, RotateCw as o } from "lucide-react";
3
+ import { cn as a } from "../lib/utils.js";
4
+ function x({
5
+ message: n,
6
+ onRetry: i,
7
+ className: s,
8
+ centered: e = !1
9
+ }) {
10
+ return /* @__PURE__ */ t(
11
+ "div",
12
+ {
13
+ role: "status",
14
+ "data-load-error": "",
15
+ className: a(
16
+ "flex gap-2 text-[12px] text-slate-600 dark:text-muted-foreground",
17
+ e ? "flex-col items-center text-center" : "items-start",
18
+ s
19
+ ),
20
+ children: [
21
+ /* @__PURE__ */ r(
22
+ l,
23
+ {
24
+ className: a("h-3.5 w-3.5 shrink-0 text-amber-500", !e && "mt-px"),
25
+ "aria-hidden": !0
26
+ }
27
+ ),
28
+ /* @__PURE__ */ t("div", { className: a("min-w-0", e && "max-w-[240px]"), children: [
29
+ /* @__PURE__ */ r("p", { className: "leading-snug [text-wrap:balance]", children: n }),
30
+ i && /* @__PURE__ */ t(
31
+ "button",
32
+ {
33
+ type: "button",
34
+ onClick: i,
35
+ className: "mt-1 inline-flex items-center gap-1 rounded text-[12px] font-medium text-sky-700 hover:underline dark:text-nvr-cyan focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/50",
36
+ children: [
37
+ /* @__PURE__ */ r(o, { className: "h-3 w-3", "aria-hidden": !0 }),
38
+ "Try again"
39
+ ]
40
+ }
41
+ )
42
+ ] })
43
+ ]
44
+ }
45
+ );
46
+ }
47
+ export {
48
+ x as LoadErrorNote
49
+ };