@ganeshdole/brainbox-widget 0.0.0-stage → 0.1.0

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.
package/dist/index.js ADDED
@@ -0,0 +1,1315 @@
1
+ import { memo as e, useCallback as t, useEffect as n, useMemo as r, useRef as i, useState as a, useSyncExternalStore as o } from "react";
2
+ import { createPortal as s } from "react-dom";
3
+ import { BrainboxProvider as c, useBrainbox as l, useDraft as u } from "@ganeshdole/brainbox-react";
4
+ import { DEFAULT_COLOR as d, FONT_STACK as f, MARK_COLORS as p, STROKE_WIDTH as m, TEXT_HALO as h, TEXT_HALO_WIDTH as g, TEXT_SIZE as _, arrowHead as v, boundsOf as y, canSessionRecord as b, createBrainbox as x, hitTest as S, isDegenerate as C, nextColor as w, normalizeBox as T, penPath as E, preloadCapture as D, shouldKeepPoint as O, startAudioRecording as k } from "@ganeshdole/brainbox-core";
5
+ import { ArrowUpRight as A, Camera as j, Check as M, ImageOff as N, Loader2 as P, MessageSquarePlus as ee, Mic as F, MicOff as te, MousePointer2 as I, Pause as L, Pencil as R, Play as ne, Send as re, Square as z, Trash2 as B, Type as V, Undo2 as ie, Video as ae, X as H } from "lucide-react";
6
+ import { Fragment as U, jsx as W, jsxs as G } from "react/jsx-runtime";
7
+ import { createRoot as oe } from "react-dom/client";
8
+ //#region src/lib/widget-store.ts
9
+ function se() {
10
+ let e = !1, t = /* @__PURE__ */ new Set(), n = (n) => {
11
+ if (n !== e) {
12
+ e = n;
13
+ for (let e of t) e();
14
+ }
15
+ };
16
+ return {
17
+ isOpen: () => e,
18
+ subscribe(e) {
19
+ return t.add(e), () => t.delete(e);
20
+ },
21
+ open: () => n(!0),
22
+ close: () => n(!1)
23
+ };
24
+ }
25
+ var ce = /* @__PURE__ */ new WeakMap();
26
+ function K(e) {
27
+ let t = ce.get(e);
28
+ return t || (t = se(), ce.set(e, t)), t;
29
+ }
30
+ var le = {
31
+ isOpen: () => !1,
32
+ subscribe: () => () => {},
33
+ open: () => {},
34
+ close: () => {}
35
+ };
36
+ //#endregion
37
+ //#region src/lib/position.ts
38
+ function q(e) {
39
+ switch (e) {
40
+ case "bottom-left": return "bottom-5 left-5";
41
+ case "top-right": return "top-5 right-5";
42
+ case "top-left": return "top-5 left-5";
43
+ default: return "bottom-5 right-5";
44
+ }
45
+ }
46
+ //#endregion
47
+ //#region src/components/Launcher.tsx
48
+ function ue({ position: e, onClick: t }) {
49
+ return /* @__PURE__ */ W("button", {
50
+ onClick: t,
51
+ "aria-label": "Send feedback",
52
+ className: `fixed ${q(e)} z-[2147483647] flex h-12 w-12 items-center justify-center rounded-full bg-brand text-on-brand shadow-button transition hover:bg-brand-hover`,
53
+ children: /* @__PURE__ */ W(ee, { className: "h-5 w-5" })
54
+ });
55
+ }
56
+ //#endregion
57
+ //#region src/components/Chooser.tsx
58
+ function de({ position: e, canRecord: t, onScreenshot: n, onRecord: r, onCancel: i }) {
59
+ return /* @__PURE__ */ G("div", {
60
+ className: `fixed ${q(e)} z-[2147483647] w-72 rounded-2xl border border-default bg-elevated p-4 shadow-3xl`,
61
+ children: [
62
+ /* @__PURE__ */ G("div", {
63
+ className: "mb-3 flex items-center justify-between",
64
+ children: [/* @__PURE__ */ W("span", {
65
+ className: "text-sm font-medium text-emphasis",
66
+ children: "Send feedback"
67
+ }), /* @__PURE__ */ W("button", {
68
+ onClick: i,
69
+ "aria-label": "Close",
70
+ className: "text-muted hover:text-emphasis",
71
+ children: /* @__PURE__ */ W(H, { className: "h-4 w-4" })
72
+ })]
73
+ }),
74
+ /* @__PURE__ */ G("button", {
75
+ onClick: n,
76
+ className: "mb-2 flex w-full items-center gap-3 rounded-xl border border-default bg-interactive p-3 text-left hover:bg-interactive-hover",
77
+ children: [/* @__PURE__ */ W(j, { className: "h-5 w-5 shrink-0 text-emphasis" }), /* @__PURE__ */ G("span", { children: [/* @__PURE__ */ W("span", {
78
+ className: "block text-sm font-medium text-emphasis",
79
+ children: "Screenshot"
80
+ }), /* @__PURE__ */ W("span", {
81
+ className: "block text-xs text-muted",
82
+ children: "Mark up the page, then talk it through"
83
+ })] })]
84
+ }),
85
+ t && /* @__PURE__ */ G("button", {
86
+ onClick: r,
87
+ className: "flex w-full items-center gap-3 rounded-xl border border-default bg-interactive p-3 text-left hover:bg-interactive-hover",
88
+ children: [/* @__PURE__ */ W(ae, { className: "h-5 w-5 shrink-0 text-emphasis" }), /* @__PURE__ */ G("span", { children: [/* @__PURE__ */ W("span", {
89
+ className: "block text-sm font-medium text-emphasis",
90
+ children: "Record"
91
+ }), /* @__PURE__ */ W("span", {
92
+ className: "block text-xs text-muted",
93
+ children: "Capture your actions · voice optional"
94
+ })] })]
95
+ }),
96
+ /* @__PURE__ */ G("a", {
97
+ href: "https://www.brainbox.sh?ref=widget",
98
+ target: "_blank",
99
+ rel: "noopener noreferrer",
100
+ className: "mt-3 block text-center text-xs text-muted hover:text-emphasis",
101
+ children: ["Powered by ", /* @__PURE__ */ W("span", {
102
+ className: "font-medium",
103
+ children: "Brainbox"
104
+ })]
105
+ })
106
+ ]
107
+ });
108
+ }
109
+ //#endregion
110
+ //#region src/lib/scroll-lock.ts
111
+ var fe = /* @__PURE__ */ new Set([
112
+ " ",
113
+ "PageUp",
114
+ "PageDown",
115
+ "Home",
116
+ "End",
117
+ "ArrowUp",
118
+ "ArrowDown",
119
+ "ArrowLeft",
120
+ "ArrowRight"
121
+ ]);
122
+ function pe(e, t) {
123
+ return fe.has(e) ? t instanceof HTMLElement ? e === " " && (t instanceof HTMLButtonElement || t.getAttribute("role") === "button") ? !1 : !(t.isContentEditable || t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement) : !0 : !1;
124
+ }
125
+ function me(e = window) {
126
+ let t = e.scrollX, n = e.scrollY, r = (e) => {
127
+ e.cancelable && e.preventDefault();
128
+ }, i = (e) => {
129
+ pe(e.key, e.composedPath()[0] ?? null) && e.preventDefault();
130
+ }, a = () => {
131
+ (e.scrollX !== t || e.scrollY !== n) && e.scrollTo(t, n);
132
+ }, o = {
133
+ capture: !0,
134
+ passive: !1
135
+ };
136
+ return e.addEventListener("wheel", r, o), e.addEventListener("touchmove", r, o), e.addEventListener("keydown", i, !0), e.addEventListener("scroll", a), () => {
137
+ e.removeEventListener("wheel", r, o), e.removeEventListener("touchmove", r, o), e.removeEventListener("keydown", i, !0), e.removeEventListener("scroll", a);
138
+ };
139
+ }
140
+ //#endregion
141
+ //#region src/lib/use-drawing.ts
142
+ function he(e) {
143
+ return e === "box" || e === "arrow" || e === "pen";
144
+ }
145
+ var ge = 0, J = () => `m${++ge}`;
146
+ function _e({ color: e, onCommit: r }) {
147
+ let [o, s] = a(null), c = i(null), l = i(null), u = i(0), d = t(() => {
148
+ u.current ||= requestAnimationFrame(() => {
149
+ u.current = 0, s(c.current ? { ...c.current } : null);
150
+ });
151
+ }, []);
152
+ return n(() => () => cancelAnimationFrame(u.current), []), {
153
+ draft: o,
154
+ begin: t((t, n) => {
155
+ let r = {
156
+ x: n.clientX,
157
+ y: n.clientY
158
+ };
159
+ try {
160
+ n.currentTarget.setPointerCapture(n.pointerId);
161
+ } catch {}
162
+ l.current = r, c.current = t === "box" ? {
163
+ kind: "box",
164
+ id: J(),
165
+ color: e,
166
+ ...T(r, r)
167
+ } : t === "arrow" ? {
168
+ kind: "arrow",
169
+ id: J(),
170
+ color: e,
171
+ x1: r.x,
172
+ y1: r.y,
173
+ x2: r.x,
174
+ y2: r.y
175
+ } : {
176
+ kind: "pen",
177
+ id: J(),
178
+ color: e,
179
+ points: [r]
180
+ }, d();
181
+ }, [e, d]),
182
+ extend: t((e) => {
183
+ let t = l.current, n = c.current;
184
+ if (!(!t || !n)) {
185
+ if (n.kind === "pen") {
186
+ let t = e.nativeEvent.getCoalescedEvents?.() ?? [e.nativeEvent];
187
+ for (let e of t) {
188
+ let t = {
189
+ x: e.clientX,
190
+ y: e.clientY
191
+ };
192
+ O(n.points[n.points.length - 1], t) && n.points.push(t);
193
+ }
194
+ } else {
195
+ let r = {
196
+ x: e.clientX,
197
+ y: e.clientY
198
+ };
199
+ n.kind === "box" ? Object.assign(n, T(t, r)) : n.kind === "arrow" && Object.assign(n, {
200
+ x2: r.x,
201
+ y2: r.y
202
+ });
203
+ }
204
+ d();
205
+ }
206
+ }, [d]),
207
+ finish: t(() => {
208
+ l.current = null, cancelAnimationFrame(u.current), u.current = 0;
209
+ let e = c.current;
210
+ c.current = null, s(null), e && !C(e) && r(e);
211
+ }, [r])
212
+ };
213
+ }
214
+ //#endregion
215
+ //#region src/components/MarkShape.tsx
216
+ var Y = e(function({ mark: e }) {
217
+ switch (e.kind) {
218
+ case "box": return /* @__PURE__ */ W("rect", {
219
+ x: e.x,
220
+ y: e.y,
221
+ width: e.width,
222
+ height: e.height,
223
+ fill: "none",
224
+ stroke: e.color,
225
+ strokeWidth: m
226
+ });
227
+ case "arrow": {
228
+ let [t, n, r] = v(e);
229
+ return /* @__PURE__ */ G("g", { children: [/* @__PURE__ */ W("line", {
230
+ x1: e.x1,
231
+ y1: e.y1,
232
+ x2: e.x2,
233
+ y2: e.y2,
234
+ stroke: e.color,
235
+ strokeWidth: m,
236
+ strokeLinecap: "round"
237
+ }), /* @__PURE__ */ W("polygon", {
238
+ points: `${t.x},${t.y} ${n.x},${n.y} ${r.x},${r.y}`,
239
+ fill: e.color
240
+ })] });
241
+ }
242
+ case "pen": return /* @__PURE__ */ W("path", {
243
+ d: E(e),
244
+ fill: "none",
245
+ stroke: e.color,
246
+ strokeWidth: m,
247
+ strokeLinecap: "round",
248
+ strokeLinejoin: "round"
249
+ });
250
+ case "text": return /* @__PURE__ */ W("text", {
251
+ x: e.x,
252
+ y: e.y,
253
+ fill: e.color,
254
+ stroke: h,
255
+ strokeWidth: g,
256
+ paintOrder: "stroke",
257
+ fontFamily: f,
258
+ fontSize: _,
259
+ fontWeight: 700,
260
+ children: e.text
261
+ });
262
+ }
263
+ });
264
+ function ve({ at: e, color: t, onChange: r, onCommit: a, onCancel: o }) {
265
+ let s = i(null);
266
+ return n(() => {
267
+ let e = requestAnimationFrame(() => s.current?.focus());
268
+ return () => cancelAnimationFrame(e);
269
+ }, []), /* @__PURE__ */ W("input", {
270
+ ref: s,
271
+ autoFocus: !0,
272
+ value: e.value,
273
+ onChange: (e) => r(e.target.value),
274
+ onPointerDown: (e) => e.stopPropagation(),
275
+ onKeyDown: (e) => {
276
+ e.key === "Enter" && (e.preventDefault(), a()), e.key === "Escape" && (e.preventDefault(), o());
277
+ },
278
+ placeholder: "Type a note",
279
+ className: "absolute bg-transparent font-bold outline-none placeholder:font-normal placeholder:opacity-60",
280
+ style: {
281
+ left: e.x,
282
+ top: e.y - _,
283
+ color: t,
284
+ fontFamily: f,
285
+ fontSize: _,
286
+ textShadow: `0 0 3px ${h}, 0 0 3px ${h}`,
287
+ minWidth: 160
288
+ }
289
+ });
290
+ }
291
+ //#endregion
292
+ //#region src/components/MarkupToolbar.tsx
293
+ var ye = [
294
+ {
295
+ tool: "select",
296
+ label: "Select",
297
+ key: "v",
298
+ Icon: I
299
+ },
300
+ {
301
+ tool: "box",
302
+ label: "Box",
303
+ key: "r",
304
+ Icon: z
305
+ },
306
+ {
307
+ tool: "arrow",
308
+ label: "Arrow",
309
+ key: "a",
310
+ Icon: A
311
+ },
312
+ {
313
+ tool: "pen",
314
+ label: "Draw",
315
+ key: "p",
316
+ Icon: R
317
+ },
318
+ {
319
+ tool: "text",
320
+ label: "Text",
321
+ key: "t",
322
+ Icon: V
323
+ }
324
+ ];
325
+ function be({ tool: e, color: t, canUndo: r, canDelete: o, onTool: s, onColor: c, onUndo: l, onDelete: u, onCancel: d, onDone: f }) {
326
+ let [m, h] = a(!1), g = i(null);
327
+ return n(() => {
328
+ if (!m) return;
329
+ let e = (e) => {
330
+ g.current?.contains(e.target) || h(!1);
331
+ };
332
+ return window.addEventListener("pointerdown", e, !0), () => window.removeEventListener("pointerdown", e, !0);
333
+ }, [m]), /* @__PURE__ */ W("div", {
334
+ className: "pointer-events-none absolute inset-x-0 bottom-6 flex justify-center",
335
+ children: /* @__PURE__ */ G("div", {
336
+ onPointerDown: (e) => e.stopPropagation(),
337
+ className: "pointer-events-auto flex items-center gap-1 rounded-2xl border border-default bg-elevated p-1.5 shadow-3xl",
338
+ children: [
339
+ /* @__PURE__ */ W(Z, {
340
+ label: "Cancel (Esc)",
341
+ onClick: d,
342
+ children: /* @__PURE__ */ W(H, { className: "h-4 w-4" })
343
+ }),
344
+ /* @__PURE__ */ W(X, {}),
345
+ ye.map(({ tool: t, label: n, key: r, Icon: i }) => /* @__PURE__ */ W("button", {
346
+ type: "button",
347
+ title: `${n} (${r})`,
348
+ "aria-label": n,
349
+ "aria-pressed": t === e,
350
+ onClick: () => s(t),
351
+ className: `flex h-9 w-9 items-center justify-center rounded-xl transition-colors ${t === e ? "bg-brand text-on-brand" : "text-default hover:bg-interactive-hover hover:text-emphasis"}`,
352
+ children: /* @__PURE__ */ W(i, { className: "h-4 w-4" })
353
+ }, t)),
354
+ /* @__PURE__ */ W(X, {}),
355
+ /* @__PURE__ */ G("div", {
356
+ ref: g,
357
+ className: "relative",
358
+ children: [/* @__PURE__ */ W("button", {
359
+ type: "button",
360
+ title: "Colour (c)",
361
+ "aria-label": "Colour",
362
+ "aria-expanded": m,
363
+ onClick: () => h((e) => !e),
364
+ className: "flex h-9 w-9 items-center justify-center rounded-xl hover:bg-interactive-hover",
365
+ children: /* @__PURE__ */ W("span", {
366
+ className: "h-5 w-5 rounded-full border border-default",
367
+ style: { background: t }
368
+ })
369
+ }), m && /* @__PURE__ */ W("div", {
370
+ className: "absolute bottom-11 right-0 flex items-center gap-1 rounded-xl border border-default bg-elevated p-1.5 shadow-3xl",
371
+ children: p.map((e) => /* @__PURE__ */ W("button", {
372
+ type: "button",
373
+ title: e,
374
+ "aria-label": `Colour ${e}`,
375
+ "aria-pressed": e === t,
376
+ onClick: () => {
377
+ c(e), h(!1);
378
+ },
379
+ className: `flex h-7 w-7 items-center justify-center rounded-lg hover:bg-interactive-hover ${e === t ? "bg-interactive" : ""}`,
380
+ children: /* @__PURE__ */ W("span", {
381
+ className: "h-5 w-5 rounded-full border border-default",
382
+ style: { background: e }
383
+ })
384
+ }, e))
385
+ })]
386
+ }),
387
+ /* @__PURE__ */ W(Z, {
388
+ label: "Undo (⌘Z)",
389
+ disabled: !r,
390
+ onClick: l,
391
+ children: /* @__PURE__ */ W(ie, { className: "h-4 w-4" })
392
+ }),
393
+ /* @__PURE__ */ W(Z, {
394
+ label: "Delete (⌫)",
395
+ disabled: !o,
396
+ onClick: u,
397
+ children: /* @__PURE__ */ W(B, { className: "h-4 w-4" })
398
+ }),
399
+ /* @__PURE__ */ W(X, {}),
400
+ /* @__PURE__ */ W("button", {
401
+ type: "button",
402
+ onClick: f,
403
+ className: "flex h-9 items-center gap-1.5 rounded-xl bg-brand px-4 text-sm font-medium text-on-brand shadow-button hover:bg-brand-hover",
404
+ children: "Next"
405
+ })
406
+ ]
407
+ })
408
+ });
409
+ }
410
+ var X = () => /* @__PURE__ */ W("span", { className: "mx-1 h-6 w-px shrink-0 bg-subtle" });
411
+ function Z({ label: e, disabled: t, onClick: n, children: r }) {
412
+ return /* @__PURE__ */ W("button", {
413
+ type: "button",
414
+ title: e,
415
+ "aria-label": e,
416
+ disabled: t,
417
+ onClick: n,
418
+ className: "flex h-9 w-9 items-center justify-center rounded-xl text-default hover:bg-interactive-hover hover:text-emphasis disabled:opacity-30 disabled:hover:bg-transparent",
419
+ children: r
420
+ });
421
+ }
422
+ //#endregion
423
+ //#region src/components/MarkupOverlay.tsx
424
+ var xe = {
425
+ v: "select",
426
+ r: "box",
427
+ a: "arrow",
428
+ p: "pen",
429
+ t: "text"
430
+ };
431
+ function Se({ frozenUrl: e, pending: i, failed: o, onDone: s, onCancel: c }) {
432
+ let [l, u] = a("box"), [f, p] = a(d), [m, h] = a([]), [g, _] = a([]), [v, b] = a(null), [x, T] = a(null), E = t((e) => {
433
+ _((e) => [...e, m]), h(e);
434
+ }, [m]), D = t(() => {
435
+ let e = g[g.length - 1];
436
+ e && (_(g.slice(0, -1)), h(e), b(null));
437
+ }, [g]), O = t(() => {
438
+ v && (E(m.filter((e) => e.id !== v)), b(null));
439
+ }, [
440
+ E,
441
+ m,
442
+ v
443
+ ]), k = t(() => {
444
+ if (!x) return null;
445
+ let e = {
446
+ kind: "text",
447
+ id: J(),
448
+ color: f,
449
+ x: x.x,
450
+ y: x.y,
451
+ text: x.value
452
+ };
453
+ return C(e) ? null : e;
454
+ }, [f, x]), A = t(() => {
455
+ let e = k();
456
+ T(null), e && E([...m, e]);
457
+ }, [
458
+ E,
459
+ m,
460
+ k
461
+ ]);
462
+ n(() => me(), []), n(() => {
463
+ let e = (e) => {
464
+ if (x) {
465
+ e.key === "Escape" && (e.preventDefault(), T(null));
466
+ return;
467
+ }
468
+ if (e.key === "Escape") {
469
+ e.preventDefault(), c();
470
+ return;
471
+ }
472
+ if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "z") {
473
+ e.preventDefault(), D();
474
+ return;
475
+ }
476
+ if (e.key === "Backspace" || e.key === "Delete") {
477
+ e.preventDefault(), O();
478
+ return;
479
+ }
480
+ if (e.metaKey || e.ctrlKey || e.altKey) return;
481
+ if (e.key.toLowerCase() === "c") {
482
+ e.preventDefault(), p(w);
483
+ return;
484
+ }
485
+ let t = xe[e.key.toLowerCase()];
486
+ t && (e.preventDefault(), u(t));
487
+ };
488
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
489
+ }, [
490
+ c,
491
+ O,
492
+ x,
493
+ D
494
+ ]);
495
+ let { draft: j, begin: M, extend: ee, finish: F } = _e({
496
+ color: f,
497
+ onCommit: t((e) => E([...m, e]), [E, m])
498
+ }), te = (e) => {
499
+ if (x) {
500
+ A();
501
+ return;
502
+ }
503
+ if (l === "select") {
504
+ b(S(m, {
505
+ x: e.clientX,
506
+ y: e.clientY
507
+ }));
508
+ return;
509
+ }
510
+ if (l === "text") {
511
+ T({
512
+ x: e.clientX,
513
+ y: e.clientY,
514
+ value: ""
515
+ });
516
+ return;
517
+ }
518
+ he(l) && (b(null), M(l, e));
519
+ }, I = r(() => m.map((e) => /* @__PURE__ */ W(Y, { mark: e }, e.id)), [m]), L = r(() => {
520
+ let e = m.find((e) => e.id === v);
521
+ return e ? y(e) : null;
522
+ }, [m, v]);
523
+ return /* @__PURE__ */ G("div", {
524
+ className: `fixed inset-0 z-[2147483647] touch-none select-none overflow-hidden ${l === "select" ? "cursor-default" : l === "text" ? "cursor-text" : "cursor-crosshair"}`,
525
+ onPointerDown: te,
526
+ onPointerMove: ee,
527
+ onPointerUp: F,
528
+ onPointerCancel: F,
529
+ children: [
530
+ e ? /* @__PURE__ */ W("img", {
531
+ src: e,
532
+ alt: "",
533
+ "aria-hidden": "true",
534
+ draggable: !1,
535
+ className: "absolute inset-0 h-full w-full"
536
+ }) : /* @__PURE__ */ W("div", { className: "absolute inset-0 bg-black/30" }),
537
+ /* @__PURE__ */ G("svg", {
538
+ className: "pointer-events-none absolute inset-0 h-full w-full",
539
+ "aria-hidden": "true",
540
+ children: [
541
+ I,
542
+ j && /* @__PURE__ */ W(Y, { mark: j }),
543
+ L && /* @__PURE__ */ W("rect", {
544
+ x: L.x - 4,
545
+ y: L.y - 4,
546
+ width: L.width + 8,
547
+ height: L.height + 8,
548
+ fill: "none",
549
+ stroke: "#ffffff",
550
+ strokeWidth: 1,
551
+ strokeDasharray: "4 3"
552
+ })
553
+ ]
554
+ }),
555
+ x && /* @__PURE__ */ W(ve, {
556
+ at: x,
557
+ color: f,
558
+ onChange: (e) => T({
559
+ ...x,
560
+ value: e
561
+ }),
562
+ onCommit: A,
563
+ onCancel: () => T(null)
564
+ }),
565
+ /* @__PURE__ */ W("div", {
566
+ className: "pointer-events-none absolute inset-x-0 bottom-24 flex justify-center",
567
+ children: i ? /* @__PURE__ */ G("span", {
568
+ className: "flex items-center gap-2 rounded-full bg-elevated px-3 py-1 text-xs text-default",
569
+ children: [/* @__PURE__ */ W(P, { className: "h-3.5 w-3.5 animate-spin" }), " Freezing the page"]
570
+ }) : o ? /* @__PURE__ */ G("span", {
571
+ className: "flex items-center gap-2 rounded-full bg-warning px-3 py-1 text-xs text-warning",
572
+ children: [/* @__PURE__ */ W(N, { className: "h-3.5 w-3.5" }), " Couldn't grab the screenshot - your note still sends"]
573
+ }) : /* @__PURE__ */ W("span", {
574
+ className: "rounded-full bg-elevated px-3 py-1 text-xs text-muted",
575
+ children: "Mark up what's wrong - or just hit Next to describe it"
576
+ })
577
+ }),
578
+ /* @__PURE__ */ W(be, {
579
+ tool: l,
580
+ color: f,
581
+ canUndo: g.length > 0,
582
+ canDelete: !!v,
583
+ onTool: (e) => {
584
+ A(), u(e), b(null);
585
+ },
586
+ onColor: p,
587
+ onUndo: D,
588
+ onDelete: O,
589
+ onCancel: c,
590
+ onDone: () => {
591
+ let e = k();
592
+ T(null), s(e ? [...m, e] : m);
593
+ }
594
+ })
595
+ ]
596
+ });
597
+ }
598
+ //#endregion
599
+ //#region src/lib/time.ts
600
+ function Ce(e) {
601
+ let t = Number.isFinite(e) ? Math.max(0, Math.floor(e)) : 0;
602
+ return `${Math.floor(t / 60)}:${(t % 60).toString().padStart(2, "0")}`;
603
+ }
604
+ //#endregion
605
+ //#region src/components/RecordOverlay.tsx
606
+ var we = [
607
+ {
608
+ tool: "box",
609
+ label: "Box",
610
+ Icon: z
611
+ },
612
+ {
613
+ tool: "arrow",
614
+ label: "Arrow",
615
+ Icon: A
616
+ },
617
+ {
618
+ tool: "pen",
619
+ label: "Draw",
620
+ Icon: R
621
+ },
622
+ {
623
+ tool: "text",
624
+ label: "Text",
625
+ Icon: V
626
+ }
627
+ ];
628
+ function Te({ annotations: e, onStop: r, micActive: o, onMuteChange: s }) {
629
+ let [c, l] = a(0), [u, f] = a(null), [p, m] = a(d), [h, g] = a(null), [_, v] = a(!1), [y, b] = a(!1), [x, S] = a(0), C = i(o);
630
+ n(() => {
631
+ C.current = o;
632
+ }, [o]);
633
+ let T = i(s);
634
+ n(() => {
635
+ T.current = s;
636
+ }, [s]), n(() => {
637
+ v(C.current());
638
+ let e = setInterval(() => {
639
+ l((e) => e + 1), v(C.current());
640
+ }, 1e3);
641
+ return () => clearInterval(e);
642
+ }, []), n(() => {
643
+ T.current(y);
644
+ }, [y]);
645
+ let E = t((t) => {
646
+ e.show(t), S(e.count());
647
+ }, [e]), D = t(() => {
648
+ e.undo(), S(e.count());
649
+ }, [e]), O = t(() => {
650
+ e.clear(), S(e.count());
651
+ }, [e]), { draft: k, begin: A, extend: j, finish: M } = _e({
652
+ color: p,
653
+ onCommit: E
654
+ }), N = t(() => {
655
+ if (!h) return;
656
+ let t = h.value.trim();
657
+ g(null), t && (e.show({
658
+ kind: "text",
659
+ id: J(),
660
+ color: p,
661
+ x: h.x,
662
+ y: h.y,
663
+ text: t
664
+ }), S(e.count()));
665
+ }, [
666
+ e,
667
+ p,
668
+ h
669
+ ]);
670
+ return n(() => {
671
+ if (!u) return;
672
+ let e = (e) => {
673
+ e.key === "Escape" && (e.preventDefault(), h ? g(null) : f(null));
674
+ };
675
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
676
+ }, [u, h]), /* @__PURE__ */ G(U, { children: [u && /* @__PURE__ */ G("div", {
677
+ className: `fixed inset-0 z-[2147483646] touch-none select-none ${u === "text" ? "cursor-text" : "cursor-crosshair"}`,
678
+ onPointerDown: (e) => {
679
+ if (h) {
680
+ N();
681
+ return;
682
+ }
683
+ if (u === "text") {
684
+ g({
685
+ x: e.clientX,
686
+ y: e.clientY,
687
+ value: ""
688
+ });
689
+ return;
690
+ }
691
+ he(u) && A(u, e);
692
+ },
693
+ onPointerMove: j,
694
+ onPointerUp: M,
695
+ onPointerCancel: M,
696
+ children: [/* @__PURE__ */ W("svg", {
697
+ className: "pointer-events-none absolute inset-0 h-full w-full",
698
+ "aria-hidden": "true",
699
+ children: k && /* @__PURE__ */ W(Y, { mark: k })
700
+ }), h && /* @__PURE__ */ W(ve, {
701
+ at: h,
702
+ color: p,
703
+ onChange: (e) => g({
704
+ ...h,
705
+ value: e
706
+ }),
707
+ onCommit: N,
708
+ onCancel: () => g(null)
709
+ })]
710
+ }), /* @__PURE__ */ W("div", {
711
+ className: "pointer-events-none fixed inset-x-0 bottom-6 z-[2147483647] flex justify-center",
712
+ children: /* @__PURE__ */ G("div", {
713
+ className: "pointer-events-auto flex items-center gap-1 rounded-full border border-default bg-elevated px-3 py-2 shadow-3xl",
714
+ children: [
715
+ /* @__PURE__ */ G("span", {
716
+ className: "ml-1 flex items-center gap-2 text-sm text-emphasis",
717
+ children: [/* @__PURE__ */ W("span", {
718
+ className: "h-2.5 w-2.5 animate-pulse rounded-full",
719
+ style: { background: "#ef4444" }
720
+ }), /* @__PURE__ */ W("span", {
721
+ className: "font-mono",
722
+ children: Ce(c)
723
+ })]
724
+ }),
725
+ /* @__PURE__ */ G("button", {
726
+ type: "button",
727
+ onClick: () => b((e) => !e),
728
+ disabled: !_,
729
+ title: _ ? y ? "Voice off - click to record narration again" : "Voice on - click to mute" : "No mic - the recording has no voice",
730
+ "aria-pressed": !y && _,
731
+ className: `flex h-8 items-center gap-1.5 rounded-full px-2.5 text-xs transition-colors disabled:opacity-40 ${_ && !y ? "bg-interactive text-emphasis" : "text-muted hover:bg-interactive-hover hover:text-emphasis"}`,
732
+ children: [W(_ && !y ? F : te, { className: "h-3.5 w-3.5" }), _ && !y ? "Voice on" : "Voice off"]
733
+ }),
734
+ /* @__PURE__ */ W("span", { className: "mx-1 h-5 w-px bg-subtle" }),
735
+ /* @__PURE__ */ W(Ee, {
736
+ label: "Use the page",
737
+ active: u === null,
738
+ onClick: () => {
739
+ N(), f(null);
740
+ },
741
+ children: /* @__PURE__ */ W(I, { className: "h-4 w-4" })
742
+ }),
743
+ we.map(({ tool: e, label: t, Icon: n }) => /* @__PURE__ */ W(Ee, {
744
+ label: t,
745
+ active: u === e,
746
+ onClick: () => {
747
+ N(), f(e);
748
+ },
749
+ children: /* @__PURE__ */ W(n, { className: "h-4 w-4" })
750
+ }, e)),
751
+ /* @__PURE__ */ W("button", {
752
+ type: "button",
753
+ title: "Colour",
754
+ "aria-label": "Colour",
755
+ onClick: () => m(w),
756
+ className: "flex h-8 w-8 items-center justify-center rounded-full hover:bg-interactive-hover",
757
+ children: /* @__PURE__ */ W("span", {
758
+ className: "h-4 w-4 rounded-full border border-default",
759
+ style: { background: p }
760
+ })
761
+ }),
762
+ /* @__PURE__ */ W(De, {
763
+ label: "Undo last mark",
764
+ disabled: x === 0,
765
+ onClick: D,
766
+ children: /* @__PURE__ */ W(ie, { className: "h-4 w-4" })
767
+ }),
768
+ /* @__PURE__ */ W(De, {
769
+ label: "Clear all marks",
770
+ disabled: x === 0,
771
+ onClick: O,
772
+ children: /* @__PURE__ */ W(B, { className: "h-4 w-4" })
773
+ }),
774
+ /* @__PURE__ */ W("span", { className: "mx-1 h-5 w-px bg-subtle" }),
775
+ /* @__PURE__ */ G("button", {
776
+ onClick: r,
777
+ className: "ml-1 flex items-center gap-1.5 rounded-full bg-brand px-3 py-1 text-xs font-medium text-on-brand hover:bg-brand-hover",
778
+ children: [/* @__PURE__ */ W(z, { className: "h-3 w-3" }), " Stop"]
779
+ })
780
+ ]
781
+ })
782
+ })] });
783
+ }
784
+ function Ee({ label: e, active: t, onClick: n, children: r }) {
785
+ return /* @__PURE__ */ W("button", {
786
+ type: "button",
787
+ title: e,
788
+ "aria-label": e,
789
+ "aria-pressed": t,
790
+ onClick: n,
791
+ className: `flex h-8 w-8 items-center justify-center rounded-full transition-colors ${t ? "bg-brand text-on-brand" : "text-default hover:bg-interactive-hover hover:text-emphasis"}`,
792
+ children: r
793
+ });
794
+ }
795
+ function De({ label: e, disabled: t, onClick: n, children: r }) {
796
+ return /* @__PURE__ */ W("button", {
797
+ type: "button",
798
+ title: e,
799
+ "aria-label": e,
800
+ disabled: t,
801
+ onClick: n,
802
+ className: "flex h-8 w-8 items-center justify-center rounded-full text-default hover:bg-interactive-hover hover:text-emphasis disabled:opacity-30 disabled:hover:bg-transparent",
803
+ children: r
804
+ });
805
+ }
806
+ //#endregion
807
+ //#region src/lib/multiband.ts
808
+ var Oe = -100, ke = -10;
809
+ function Ae(e) {
810
+ return Number.isFinite(e) ? Math.sqrt(1 - Math.max(Oe, Math.min(ke, e)) * -1 / 100) : 0;
811
+ }
812
+ function je(e, t, n, r) {
813
+ if (t <= 0) return [];
814
+ let i = Math.max(0, Math.min(n, e.length)), a = Math.max(i, Math.min(r, e.length));
815
+ if (a === i) return Array.from({ length: t }, () => 0);
816
+ let o = Math.max(1, Math.ceil((a - i) / t));
817
+ return Array.from({ length: t }, (t, n) => {
818
+ let r = i + n * o, s = Math.min(r + o, a), c = 0, l = 0;
819
+ for (let t = r; t < s; t += 1) {
820
+ let n = e[t];
821
+ n !== void 0 && (c += Ae(n), l += 1);
822
+ }
823
+ return l === 0 ? 0 : c / l;
824
+ });
825
+ }
826
+ function Me(e, t, n = .01) {
827
+ return e.length === t.length ? e.some((e, r) => Math.abs(e - (t[r] ?? 0)) > n) : !0;
828
+ }
829
+ var Ne = 5;
830
+ function Pe(e) {
831
+ return Ne + Math.min(1, Math.max(0, e)) * (100 - Ne);
832
+ }
833
+ function Fe(e) {
834
+ let t = 0;
835
+ for (let n of e) n > t && (t = n);
836
+ return t;
837
+ }
838
+ function Ie(e, t) {
839
+ return t <= 0 ? [] : e.length === 0 ? Array.from({ length: t }, () => 0) : Array.from({ length: t }, (n, r) => {
840
+ let i = Math.floor(r * e.length / t), a = Math.max(i + 1, Math.floor((r + 1) * e.length / t)), o = 0, s = 0;
841
+ for (let t = i; t < a && t < e.length; t += 1) {
842
+ let n = e[t];
843
+ n !== void 0 && (o += n, s += 1);
844
+ }
845
+ return s === 0 ? 0 : o / s;
846
+ });
847
+ }
848
+ //#endregion
849
+ //#region src/lib/use-multiband.ts
850
+ var Le = {
851
+ bands: 24,
852
+ loPass: 2,
853
+ hiPass: 110,
854
+ updateInterval: 32,
855
+ fftSize: 2048
856
+ };
857
+ function Re(e, t = {}) {
858
+ let { bands: o, loPass: s, hiPass: c, updateInterval: l, fftSize: u } = {
859
+ ...Le,
860
+ ...t
861
+ }, d = r(() => Array.from({ length: o }, () => 0), [o]), [f, p] = a(d), m = i(d);
862
+ return n(() => {
863
+ if (m.current = d, !e || typeof AudioContext > "u") return;
864
+ let t, n;
865
+ try {
866
+ t = new AudioContext(), n = t.createAnalyser(), n.fftSize = u, t.createMediaStreamSource(e).connect(n);
867
+ } catch {
868
+ return;
869
+ }
870
+ let r = new Float32Array(n.frequencyBinCount), i = 0, a = 0, f = (e) => {
871
+ if (i = requestAnimationFrame(f), e - a < l) return;
872
+ a = e, n.getFloatFrequencyData(r);
873
+ let t = je(r, o, s, c);
874
+ Me(t, m.current) && (m.current = t, p(t));
875
+ };
876
+ return i = requestAnimationFrame(f), () => {
877
+ cancelAnimationFrame(i), n.disconnect(), t.close().catch(() => {});
878
+ };
879
+ }, [
880
+ e,
881
+ o,
882
+ s,
883
+ c,
884
+ l,
885
+ u,
886
+ d
887
+ ]), e ? f : d;
888
+ }
889
+ //#endregion
890
+ //#region src/components/BarVisualizer.tsx
891
+ var ze = e(function({ levels: e, dimFrom: t }) {
892
+ return /* @__PURE__ */ W("span", {
893
+ className: "flex h-8 flex-1 items-center justify-center gap-[2px] overflow-hidden",
894
+ "aria-hidden": "true",
895
+ children: e.map((e, n) => /* @__PURE__ */ W(Be, {
896
+ height: Pe(e),
897
+ dim: t !== void 0 && n >= t
898
+ }, n))
899
+ });
900
+ }), Be = e(function({ height: e, dim: t }) {
901
+ return /* @__PURE__ */ W("span", {
902
+ className: "w-[2px] shrink-0 rounded-[1px] transition-[height,opacity] duration-75",
903
+ style: {
904
+ height: `${e}%`,
905
+ background: "var(--text-emphasis)",
906
+ opacity: t ? .25 : 1
907
+ }
908
+ });
909
+ }), Q = 32, Ve = 120;
910
+ function He({ onChange: e }) {
911
+ let [r, o] = a("idle"), [s, c] = a(null), [l, u] = a([]), [d, f] = a(0), [p, m] = a(""), [h, g] = a(""), [_, v] = a(!1), [y, b] = a(0), x = i(null), S = i(null), C = i([]), w = Re(r === "recording" ? s : null, { bands: Q }), T = t(async () => {
912
+ let t = x.current;
913
+ if (t) {
914
+ x.current = null, c(null);
915
+ try {
916
+ let n = await t.stop();
917
+ u(C.current), g(URL.createObjectURL(n)), o("recorded"), e(n);
918
+ } catch {
919
+ m("Recording failed - try again"), o("idle");
920
+ }
921
+ }
922
+ }, [e]), E = async () => {
923
+ m("");
924
+ try {
925
+ let e = await k();
926
+ x.current = e, C.current = [], c(e.stream), u([]), f(0), b(0), o("recording");
927
+ } catch {
928
+ m("Mic blocked - allow microphone access, or type instead");
929
+ }
930
+ }, D = () => {
931
+ S.current?.pause(), v(!1), b(0), g(""), C.current = [], u([]), f(0), o("idle"), e(null);
932
+ }, O = () => {
933
+ let e = S.current;
934
+ e && (e.paused ? e.play().catch(() => m("Playback unavailable")) : e.pause());
935
+ };
936
+ n(() => {
937
+ r === "recording" && C.current.push(Fe(w));
938
+ }, [w, r]), n(() => {
939
+ if (r !== "recording") return;
940
+ let e = Date.now(), t = setInterval(() => {
941
+ let t = Math.floor((Date.now() - e) / 1e3);
942
+ f(t), t >= Ve && T();
943
+ }, 250);
944
+ return () => clearInterval(t);
945
+ }, [r, T]), n(() => {
946
+ if (h) return () => URL.revokeObjectURL(h);
947
+ }, [h]), n(() => () => {
948
+ let e = x.current;
949
+ x.current = null, e && e.stop().catch(() => {});
950
+ }, []);
951
+ let A = r === "recorded";
952
+ return /* @__PURE__ */ G("div", {
953
+ className: "flex items-center gap-3 px-3 py-2.5",
954
+ children: [
955
+ /* @__PURE__ */ W("button", {
956
+ onClick: r === "recording" ? () => void T() : A ? O : E,
957
+ "aria-label": r === "recording" ? "Stop recording" : A ? _ ? "Pause" : "Play voice note" : "Record a voice note",
958
+ className: `flex h-9 w-9 shrink-0 items-center justify-center rounded-full transition-colors ${r === "recording" ? "bg-error text-error ring-2 ring-error" : "bg-brand text-on-brand shadow-button hover:bg-brand-hover"}`,
959
+ children: r === "recording" ? /* @__PURE__ */ W(z, { className: "h-3.5 w-3.5 fill-current" }) : A ? W(_ ? L : ne, { className: "h-3.5 w-3.5 fill-current" }) : /* @__PURE__ */ W(F, { className: "h-4 w-4" })
960
+ }),
961
+ r === "idle" ? /* @__PURE__ */ W("span", {
962
+ className: "min-w-0 flex-1 truncate text-left text-sm",
963
+ children: p ? /* @__PURE__ */ W("span", {
964
+ className: "text-error",
965
+ children: p
966
+ }) : /* @__PURE__ */ W("span", {
967
+ className: "text-emphasis",
968
+ children: "Say what went wrong"
969
+ })
970
+ }) : /* @__PURE__ */ G(U, { children: [/* @__PURE__ */ W(ze, {
971
+ levels: A ? Ie(l, Q) : w,
972
+ dimFrom: A && _ ? Math.round(y * Q) : void 0
973
+ }), /* @__PURE__ */ W("span", {
974
+ className: "shrink-0 font-mono text-xs text-default",
975
+ children: Ce(d)
976
+ })] }),
977
+ A && /* @__PURE__ */ W("button", {
978
+ onClick: D,
979
+ "aria-label": "Delete voice note",
980
+ className: "shrink-0 text-muted hover:text-error",
981
+ children: /* @__PURE__ */ W(B, { className: "h-4 w-4" })
982
+ }),
983
+ r !== "idle" && p && /* @__PURE__ */ W("span", {
984
+ className: "shrink-0 text-xs text-error",
985
+ children: p
986
+ }),
987
+ h && /* @__PURE__ */ W("audio", {
988
+ ref: S,
989
+ src: h,
990
+ className: "hidden",
991
+ onPlay: () => v(!0),
992
+ onPause: () => v(!1),
993
+ onEnded: () => {
994
+ v(!1), b(0);
995
+ },
996
+ onTimeUpdate: (e) => {
997
+ let t = e.currentTarget;
998
+ d > 0 && b(Math.min(1, t.currentTime / d));
999
+ }
1000
+ })
1001
+ ]
1002
+ });
1003
+ }
1004
+ //#endregion
1005
+ //#region src/components/Composer.tsx
1006
+ function Ue({ screenshotUrl: e, videoUrl: t, sessionReady: n, voiceCaptured: r, capturePending: i, captureFailed: o, position: s, onCancel: c, onSubmit: l }) {
1007
+ let [u, d] = a(""), [f, p] = a(null), m = !!t || !!r, [h, g] = a(m), _ = !o || !!u.trim() || !!f || m || !!n;
1008
+ return /* @__PURE__ */ G("div", {
1009
+ className: `fixed ${q(s)} z-[2147483647] w-96 rounded-2xl border border-default bg-elevated p-4 shadow-3xl`,
1010
+ children: [
1011
+ /* @__PURE__ */ G("div", {
1012
+ className: "mb-3 flex items-center justify-between",
1013
+ children: [/* @__PURE__ */ W("span", {
1014
+ className: "text-sm font-medium text-emphasis",
1015
+ children: "Send feedback"
1016
+ }), /* @__PURE__ */ W("button", {
1017
+ onClick: c,
1018
+ "aria-label": "Close",
1019
+ className: "text-muted hover:text-emphasis",
1020
+ children: /* @__PURE__ */ W(H, { className: "h-4 w-4" })
1021
+ })]
1022
+ }),
1023
+ i ? /* @__PURE__ */ W("div", {
1024
+ className: "mb-3 flex h-40 items-center justify-center rounded-lg border border-default bg-interactive",
1025
+ children: /* @__PURE__ */ G("span", {
1026
+ className: "flex items-center gap-2 text-xs text-muted",
1027
+ children: [/* @__PURE__ */ W(P, { className: "h-3.5 w-3.5 animate-spin" }), " Grabbing the screenshot"]
1028
+ })
1029
+ }) : o ? /* @__PURE__ */ G("p", {
1030
+ className: "mb-3 flex items-center gap-2 rounded-lg border border-warning-subtle bg-warning p-3 text-xs text-warning",
1031
+ children: [/* @__PURE__ */ W(N, { className: "h-3.5 w-3.5 shrink-0" }), " Couldn't grab the screenshot - your note still gets through."]
1032
+ }) : t ? /* @__PURE__ */ W("video", {
1033
+ controls: !0,
1034
+ src: t,
1035
+ className: "mb-3 max-h-48 w-full rounded-lg border border-default"
1036
+ }) : n && e ? /* @__PURE__ */ G("div", {
1037
+ className: "relative mb-3 overflow-hidden rounded-lg border border-default",
1038
+ children: [
1039
+ /* @__PURE__ */ W("img", {
1040
+ src: e,
1041
+ alt: "Recording preview",
1042
+ className: "max-h-44 w-full bg-canvas object-contain"
1043
+ }),
1044
+ /* @__PURE__ */ W("span", {
1045
+ className: "absolute inset-0 flex items-center justify-center",
1046
+ children: /* @__PURE__ */ W("span", {
1047
+ className: "flex h-10 w-10 items-center justify-center rounded-full bg-black/60 backdrop-blur-sm",
1048
+ children: /* @__PURE__ */ W(ne, { className: "h-4 w-4 text-white" })
1049
+ })
1050
+ }),
1051
+ /* @__PURE__ */ G("span", {
1052
+ className: "absolute bottom-1.5 left-1.5 rounded-full bg-black/60 px-2 py-0.5 text-[10px] text-white backdrop-blur-sm",
1053
+ children: [
1054
+ "Recording",
1055
+ r ? " · voice" : "",
1056
+ " - replays in the dashboard"
1057
+ ]
1058
+ })
1059
+ ]
1060
+ }) : e ? /* @__PURE__ */ W("img", {
1061
+ src: e,
1062
+ alt: "Captured screenshot",
1063
+ className: "mb-3 max-h-44 w-full rounded-lg border border-default bg-canvas object-contain"
1064
+ }) : n ? /* @__PURE__ */ G("p", {
1065
+ className: "mb-3 rounded-lg border border-default bg-interactive p-3 text-xs text-default",
1066
+ children: [
1067
+ "✓ Session recorded",
1068
+ r ? " with voice" : "",
1069
+ " - it will replay in the dashboard."
1070
+ ]
1071
+ }) : null,
1072
+ /* @__PURE__ */ G("div", {
1073
+ className: "overflow-hidden rounded-xl border border-default bg-background focus-within:border-interactive",
1074
+ children: [!m && /* @__PURE__ */ W(He, { onChange: p }), h && /* @__PURE__ */ W("div", {
1075
+ className: m ? "" : "border-t border-subtle",
1076
+ children: /* @__PURE__ */ W("textarea", {
1077
+ value: u,
1078
+ maxLength: 1e4,
1079
+ autoFocus: !0,
1080
+ onChange: (e) => d(e.target.value),
1081
+ placeholder: m ? "Anything to add?" : "Describe what went wrong",
1082
+ className: "h-20 w-full resize-none bg-transparent p-3 text-sm text-default outline-none placeholder:text-placeholder"
1083
+ })
1084
+ })]
1085
+ }),
1086
+ !h && /* @__PURE__ */ G("button", {
1087
+ onClick: () => g(!0),
1088
+ className: "mt-2 flex items-center gap-1.5 text-xs text-default hover:text-emphasis",
1089
+ children: [/* @__PURE__ */ W(R, { className: "h-3 w-3" }), " Prefer to type?"]
1090
+ }),
1091
+ /* @__PURE__ */ G("button", {
1092
+ onClick: () => l(u, f),
1093
+ disabled: !_,
1094
+ className: "mt-3 flex w-full items-center justify-center gap-2 rounded-xl bg-brand py-2 text-sm font-medium text-on-brand shadow-button hover:bg-brand-hover disabled:opacity-40",
1095
+ children: [/* @__PURE__ */ W(re, { className: "h-4 w-4" }), " Send"]
1096
+ })
1097
+ ]
1098
+ });
1099
+ }
1100
+ //#endregion
1101
+ //#region src/components/Result.tsx
1102
+ var We = 3e3;
1103
+ function $({ kind: e, id: t, message: r, position: i, onClose: a }) {
1104
+ return n(() => {
1105
+ if (e !== "success" || !a) return;
1106
+ let t = setTimeout(a, We);
1107
+ return () => clearTimeout(t);
1108
+ }, [e, a]), /* @__PURE__ */ G("div", {
1109
+ className: `fixed ${q(i)} z-[2147483647] w-72 rounded-2xl border border-default bg-elevated p-4 shadow-3xl`,
1110
+ children: [
1111
+ e === "loading" && /* @__PURE__ */ G("p", {
1112
+ className: "flex items-center gap-2 text-sm text-default",
1113
+ children: [/* @__PURE__ */ W(P, { className: "h-4 w-4 animate-spin" }), " Sending…"]
1114
+ }),
1115
+ e === "success" && /* @__PURE__ */ G("div", { children: [
1116
+ /* @__PURE__ */ G("p", {
1117
+ className: "flex items-center gap-2 text-sm text-success",
1118
+ children: [/* @__PURE__ */ W(M, { className: "h-4 w-4" }), " Thanks! Feedback sent."]
1119
+ }),
1120
+ t && /* @__PURE__ */ G("p", {
1121
+ className: "mt-1 font-mono text-xs text-muted",
1122
+ children: ["#", t.slice(0, 8)]
1123
+ }),
1124
+ /* @__PURE__ */ W("button", {
1125
+ onClick: a,
1126
+ className: "mt-3 text-xs text-muted hover:text-emphasis",
1127
+ children: "Close"
1128
+ })
1129
+ ] }),
1130
+ e === "error" && /* @__PURE__ */ G("div", { children: [/* @__PURE__ */ G("p", {
1131
+ className: "flex items-center gap-2 text-sm text-error",
1132
+ children: [
1133
+ /* @__PURE__ */ W(H, { className: "h-4 w-4" }),
1134
+ " ",
1135
+ r ?? "Something went wrong"
1136
+ ]
1137
+ }), /* @__PURE__ */ W("button", {
1138
+ onClick: a,
1139
+ className: "mt-3 text-xs text-muted hover:text-emphasis",
1140
+ children: "Dismiss"
1141
+ })] })
1142
+ ]
1143
+ });
1144
+ }
1145
+ //#endregion
1146
+ //#region src/App.tsx
1147
+ function Ge({ brainbox: e, hostEl: i, trigger: o, position: s }) {
1148
+ let c = r(() => K(e), [e]), [l, d] = a(() => c.isOpen() ? "choosing" : "idle"), [f, p] = a(null), [m, h] = a(""), [g, _] = a(""), v = r(() => e.draft({ exclude: i }), [e, i]), y = u(v), x = t(() => {
1149
+ v.cancel(), p(null), d("idle"), h(""), _(""), c.close();
1150
+ }, [v, c]);
1151
+ n(() => c.subscribe(() => {
1152
+ c.isOpen() ? d((e) => e === "idle" ? "choosing" : e) : x();
1153
+ }), [c, x]);
1154
+ let S = l !== "idle";
1155
+ n(() => {
1156
+ S && D();
1157
+ }, [S]);
1158
+ let C = t(() => {
1159
+ v.captureScreenshot(), d("marking");
1160
+ }, [v]), w = t((e) => {
1161
+ v.markUp(e), d("composing");
1162
+ }, [v]), T = t(async (e) => {
1163
+ p(null);
1164
+ try {
1165
+ await e.stop(), d("composing");
1166
+ } catch (e) {
1167
+ h(e instanceof Error ? e.message : "Recording failed"), d("error");
1168
+ }
1169
+ }, []), E = t(() => {
1170
+ try {
1171
+ let e = v.startRecording({ onAutoStop: () => void T(e) });
1172
+ p(e), d("recording");
1173
+ } catch {
1174
+ d("choosing");
1175
+ }
1176
+ }, [v, T]), O = t(async (e, t) => {
1177
+ d("submitting");
1178
+ try {
1179
+ let { id: n } = await v.submit({
1180
+ text: e,
1181
+ audio: t
1182
+ });
1183
+ _(n ?? ""), d("done");
1184
+ } catch (e) {
1185
+ h(e instanceof Error ? e.message : "Upload failed"), d("error");
1186
+ }
1187
+ }, [v]);
1188
+ return /* @__PURE__ */ G(U, { children: [
1189
+ o === "floating" && l === "idle" && /* @__PURE__ */ W(ue, {
1190
+ position: s,
1191
+ onClick: c.open
1192
+ }),
1193
+ l === "choosing" && /* @__PURE__ */ W(de, {
1194
+ position: s,
1195
+ canRecord: b(),
1196
+ onScreenshot: C,
1197
+ onRecord: E,
1198
+ onCancel: x
1199
+ }),
1200
+ l === "marking" && /* @__PURE__ */ W(Se, {
1201
+ frozenUrl: y.screenshotUrl ?? void 0,
1202
+ pending: y.screenshotPending,
1203
+ failed: y.screenshotFailed,
1204
+ onDone: w,
1205
+ onCancel: x
1206
+ }),
1207
+ l === "recording" && f && /* @__PURE__ */ W(Te, {
1208
+ annotations: f.annotations,
1209
+ onStop: () => void T(f),
1210
+ micActive: f.micActive,
1211
+ onMuteChange: f.setMicMuted
1212
+ }),
1213
+ l === "composing" && /* @__PURE__ */ W(Ue, {
1214
+ screenshotUrl: y.screenshotUrl ?? void 0,
1215
+ sessionReady: y.hasSession,
1216
+ voiceCaptured: y.hasVoice,
1217
+ capturePending: y.screenshotPending,
1218
+ captureFailed: y.screenshotFailed,
1219
+ position: s,
1220
+ onCancel: x,
1221
+ onSubmit: O
1222
+ }),
1223
+ l === "submitting" && /* @__PURE__ */ W($, {
1224
+ kind: "loading",
1225
+ position: s
1226
+ }),
1227
+ l === "done" && /* @__PURE__ */ W($, {
1228
+ kind: "success",
1229
+ id: g,
1230
+ position: s,
1231
+ onClose: x
1232
+ }),
1233
+ l === "error" && /* @__PURE__ */ W($, {
1234
+ kind: "error",
1235
+ message: m,
1236
+ position: s,
1237
+ onClose: x
1238
+ })
1239
+ ] });
1240
+ }
1241
+ //#endregion
1242
+ //#region src/lib/shadow-css.ts
1243
+ function Ke(e) {
1244
+ let t = [];
1245
+ for (let n of e.matchAll(/@property\s+(--[\w-]+)\s*\{([^}]*)\}/g)) {
1246
+ let e = n[1];
1247
+ if (!e) continue;
1248
+ let r = /initial-value:\s*([^;}]+)/.exec(n[2] ?? "");
1249
+ t.push(`${e}:${r?.[1]?.trim() ?? "initial"}`);
1250
+ }
1251
+ let n = e.replaceAll(":root", ":host");
1252
+ return t.length === 0 ? n : `${n}\n@layer properties{*,::before,::after,::backdrop{${t.join(";")}}}`;
1253
+ }
1254
+ //#endregion
1255
+ //#region src/lib/shadow-host.ts
1256
+ function qe(e) {
1257
+ let t = document.createElement("div");
1258
+ t.id = "brainbox-widget", t.classList.add("rr-block"), t.style.position = "relative", t.style.zIndex = "2147483647";
1259
+ let n = t.attachShadow({ mode: "open" }), r = document.createElement("style");
1260
+ r.textContent = Ke(e), n.appendChild(r);
1261
+ let i = document.createElement("div");
1262
+ return i.className = "dark", n.appendChild(i), {
1263
+ element: t,
1264
+ container: i
1265
+ };
1266
+ }
1267
+ //#endregion
1268
+ //#region src/index.css?inline
1269
+ var Je = "/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:\"Inter\", ui-sans-serif, system-ui, -apple-system, sans-serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-bold:700;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:\"Inter\", ui-sans-serif, system-ui, -apple-system, sans-serif;--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:host{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}.dark{color:var(--text-emphasis);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;letter-spacing:-.011em}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:0}.inset-x-0{inset-inline:0}.top-5{top:calc(var(--spacing) * 5)}.right-0{right:0}.right-5{right:calc(var(--spacing) * 5)}.bottom-1\\.5{bottom:calc(var(--spacing) * 1.5)}.bottom-5{bottom:calc(var(--spacing) * 5)}.bottom-6{bottom:calc(var(--spacing) * 6)}.bottom-11{bottom:calc(var(--spacing) * 11)}.bottom-24{bottom:calc(var(--spacing) * 24)}.left-1\\.5{left:calc(var(--spacing) * 1.5)}.left-1\\/2{left:50%}.left-5{left:calc(var(--spacing) * 5)}.z-\\[2147483646\\]{z-index:2147483646}.z-\\[2147483647\\]{z-index:2147483647}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.mx-1{margin-inline:var(--spacing)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.ml-1{margin-left:var(--spacing)}.block{display:block}.flex{display:flex}.hidden{display:none}.inline{display:inline}.h-2\\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-20{height:calc(var(--spacing) * 20)}.h-40{height:calc(var(--spacing) * 40)}.h-full{height:100%}.max-h-44{max-height:calc(var(--spacing) * 44)}.max-h-48{max-height:calc(var(--spacing) * 48)}.w-2\\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-72{width:calc(var(--spacing) * 72)}.w-96{width:calc(var(--spacing) * 96)}.w-\\[2px\\]{width:2px}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0}.flex-1{flex:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-crosshair{cursor:crosshair}.cursor-default{cursor:default}.cursor-text{cursor:text}.touch-none{touch-action:none}.resize-none{resize:none}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-\\[2px\\]{gap:2px}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\\[1px\\]{border-radius:1px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-xl{border-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-default{border-color:var(--border-default)}.border-subtle{border-color:var(--border-subtle)}.border-warning-subtle{border-color:var(--border-warning-subtle)}.bg-background{background-color:var(--bg-background)}.bg-black\\/30{background-color:#0000004d}@supports (color:color-mix(in lab, red, red)){.bg-black\\/30{background-color:color-mix(in oklab, var(--color-black) 30%, transparent)}}.bg-black\\/60{background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\\/60{background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-brand{background-color:var(--bg-brand)}.bg-canvas{background-color:var(--bg-canvas)}.bg-elevated{background-color:var(--bg-elevated)}.bg-error{background-color:var(--bg-error)}.bg-interactive{background-color:var(--bg-interactive)}.bg-subtle{background-color:var(--bg-subtle)}.bg-transparent{background-color:#0000}.bg-warning{background-color:var(--bg-warning)}.fill-current{fill:currentColor}.object-contain{object-fit:contain}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[10px\\]{font-size:10px}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-default{color:var(--text-default)}.text-emphasis{color:var(--text-emphasis)}.text-error{color:var(--text-error)}.text-muted{color:var(--text-muted)}.text-on-brand{color:var(--text-on-brand)}.text-success{color:var(--text-success)}.text-warning{color:var(--text-warning)}.text-white{color:var(--color-white)}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-3xl{--tw-shadow:0 16px 48px -12px var(--tw-shadow-color,#0009);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-button{--tw-shadow:inset 0 1px 0 var(--tw-shadow-color,#ffffff1f), 0 1px 2px var(--tw-shadow-color,#0009);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-error{--tw-ring-color:var(--ring-error)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[height\\,opacity\\]{transition-property:height,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-75{--tw-duration:75ms;transition-duration:75ms}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.placeholder\\:font-normal::placeholder{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.placeholder\\:text-placeholder::placeholder{color:var(--text-placeholder)}.placeholder\\:opacity-60::placeholder{opacity:.6}.focus-within\\:border-interactive:focus-within{border-color:var(--border-interactive)}@media (hover:hover){.hover\\:bg-brand-hover:hover{background-color:var(--bg-brand-hover)}.hover\\:bg-interactive-hover:hover{background-color:var(--bg-interactive-hover)}.hover\\:text-emphasis:hover{color:var(--text-emphasis)}.hover\\:text-error:hover{color:var(--text-error)}}.disabled\\:opacity-30:disabled{opacity:.3}.disabled\\:opacity-40:disabled{opacity:.4}@media (hover:hover){.disabled\\:hover\\:bg-transparent:disabled:hover{background-color:#0000}}}:root,.light,.light-theme{--gray-1:#fcfcfc;--gray-2:#f9f9f9;--gray-3:#f0f0f0;--gray-4:#e8e8e8;--gray-5:#e0e0e0;--gray-6:#d9d9d9;--gray-7:#cecece;--gray-8:#bbb;--gray-9:#8d8d8d;--gray-10:#838383;--gray-11:#646464;--gray-12:#202020}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--gray-1:color(display-p3 .988 .988 .988);--gray-2:color(display-p3 .975 .975 .975);--gray-3:color(display-p3 .939 .939 .939);--gray-4:color(display-p3 .908 .908 .908);--gray-5:color(display-p3 .88 .88 .88);--gray-6:color(display-p3 .849 .849 .849);--gray-7:color(display-p3 .807 .807 .807);--gray-8:color(display-p3 .732 .732 .732);--gray-9:color(display-p3 .553 .553 .553);--gray-10:color(display-p3 .512 .512 .512);--gray-11:color(display-p3 .392 .392 .392);--gray-12:color(display-p3 .125 .125 .125)}}}.dark,.dark-theme{--gray-1:#111;--gray-2:#191919;--gray-3:#222;--gray-4:#2a2a2a;--gray-5:#313131;--gray-6:#3a3a3a;--gray-7:#484848;--gray-8:#606060;--gray-9:#6e6e6e;--gray-10:#7b7b7b;--gray-11:#b4b4b4;--gray-12:#eee}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--gray-1:color(display-p3 .067 .067 .067);--gray-2:color(display-p3 .098 .098 .098);--gray-3:color(display-p3 .135 .135 .135);--gray-4:color(display-p3 .163 .163 .163);--gray-5:color(display-p3 .192 .192 .192);--gray-6:color(display-p3 .228 .228 .228);--gray-7:color(display-p3 .283 .283 .283);--gray-8:color(display-p3 .375 .375 .375);--gray-9:color(display-p3 .431 .431 .431);--gray-10:color(display-p3 .484 .484 .484);--gray-11:color(display-p3 .706 .706 .706);--gray-12:color(display-p3 .933 .933 .933)}}}:root,.light,.light-theme{--gray-a1:#00000003;--gray-a2:#00000006;--gray-a3:#0000000f;--gray-a4:#00000017;--gray-a5:#0000001f;--gray-a6:#00000026;--gray-a7:#00000031;--gray-a8:#0004;--gray-a9:#00000072;--gray-a10:#0000007c;--gray-a11:#0000009b;--gray-a12:#000000df}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--gray-a1:color(display-p3 0 0 0/.012);--gray-a2:color(display-p3 0 0 0/.024);--gray-a3:color(display-p3 0 0 0/.063);--gray-a4:color(display-p3 0 0 0/.09);--gray-a5:color(display-p3 0 0 0/.122);--gray-a6:color(display-p3 0 0 0/.153);--gray-a7:color(display-p3 0 0 0/.192);--gray-a8:color(display-p3 0 0 0/.267);--gray-a9:color(display-p3 0 0 0/.447);--gray-a10:color(display-p3 0 0 0/.486);--gray-a11:color(display-p3 0 0 0/.608);--gray-a12:color(display-p3 0 0 0/.875)}}}.dark,.dark-theme{--gray-a1:#0000;--gray-a2:#ffffff09;--gray-a3:#ffffff12;--gray-a4:#ffffff1b;--gray-a5:#fff2;--gray-a6:#ffffff2c;--gray-a7:#ffffff3b;--gray-a8:#fff5;--gray-a9:#ffffff64;--gray-a10:#ffffff72;--gray-a11:#ffffffaf;--gray-a12:#ffffffed}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--gray-a1:color(display-p3 0 0 0/0);--gray-a2:color(display-p3 1 1 1/.034);--gray-a3:color(display-p3 1 1 1/.071);--gray-a4:color(display-p3 1 1 1/.105);--gray-a5:color(display-p3 1 1 1/.134);--gray-a6:color(display-p3 1 1 1/.172);--gray-a7:color(display-p3 1 1 1/.231);--gray-a8:color(display-p3 1 1 1/.332);--gray-a9:color(display-p3 1 1 1/.391);--gray-a10:color(display-p3 1 1 1/.445);--gray-a11:color(display-p3 1 1 1/.685);--gray-a12:color(display-p3 1 1 1/.929)}}}:root,.light,.light-theme{--red-1:#fffcfc;--red-2:#fff7f7;--red-3:#feebec;--red-4:#ffdbdc;--red-5:#ffcdce;--red-6:#fdbdbe;--red-7:#f4a9aa;--red-8:#eb8e90;--red-9:#e5484d;--red-10:#dc3e42;--red-11:#ce2c31;--red-12:#641723}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--red-1:color(display-p3 .998 .989 .988);--red-2:color(display-p3 .995 .971 .971);--red-3:color(display-p3 .985 .925 .925);--red-4:color(display-p3 .999 .866 .866);--red-5:color(display-p3 .984 .812 .811);--red-6:color(display-p3 .955 .751 .749);--red-7:color(display-p3 .915 .675 .672);--red-8:color(display-p3 .872 .575 .572);--red-9:color(display-p3 .83 .329 .324);--red-10:color(display-p3 .798 .294 .285);--red-11:color(display-p3 .744 .234 .222);--red-12:color(display-p3 .36 .115 .143)}}}.dark,.dark-theme{--red-1:#191111;--red-2:#201314;--red-3:#3b1219;--red-4:#500f1c;--red-5:#611623;--red-6:#72232d;--red-7:#8c333a;--red-8:#b54548;--red-9:#e5484d;--red-10:#ec5d5e;--red-11:#ff9592;--red-12:#ffd1d9}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--red-1:color(display-p3 .093 .068 .067);--red-2:color(display-p3 .118 .077 .079);--red-3:color(display-p3 .211 .081 .099);--red-4:color(display-p3 .287 .079 .113);--red-5:color(display-p3 .348 .11 .142);--red-6:color(display-p3 .414 .16 .183);--red-7:color(display-p3 .508 .224 .236);--red-8:color(display-p3 .659 .298 .297);--red-9:color(display-p3 .83 .329 .324);--red-10:color(display-p3 .861 .403 .387);--red-11:color(display-p3 1 .57 .55);--red-12:color(display-p3 .971 .826 .852)}}}:root,.light,.light-theme{--red-a1:#ff000003;--red-a2:#ff000008;--red-a3:#f3000d14;--red-a4:#ff000824;--red-a5:#ff000632;--red-a6:#f8000442;--red-a7:#df000356;--red-a8:#d2000571;--red-a9:#db0007b7;--red-a10:#d10005c1;--red-a11:#c40006d3;--red-a12:#55000de8}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--red-a1:color(display-p3 .675 .024 .024/.012);--red-a2:color(display-p3 .863 .024 .024/.028);--red-a3:color(display-p3 .792 .008 .008/.075);--red-a4:color(display-p3 1 .008 .008/.134);--red-a5:color(display-p3 .918 .008 .008/.189);--red-a6:color(display-p3 .831 .02 .004/.251);--red-a7:color(display-p3 .741 .016 .004/.33);--red-a8:color(display-p3 .698 .012 .004/.428);--red-a9:color(display-p3 .749 .008 0/.675);--red-a10:color(display-p3 .714 .012 0/.714);--red-a11:color(display-p3 .744 .234 .222);--red-a12:color(display-p3 .36 .115 .143)}}}.dark,.dark-theme{--red-a1:#f4121209;--red-a2:#f22f3e11;--red-a3:#ff173f2d;--red-a4:#fe0a3b44;--red-a5:#ff204756;--red-a6:#ff3e5668;--red-a7:#ff536184;--red-a8:#ff5d61b0;--red-a9:#fe4e54e4;--red-a10:#ff6465eb;--red-a11:#ff9592;--red-a12:#ffd1d9}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--red-a1:color(display-p3 .984 .071 .071/.03);--red-a2:color(display-p3 .996 .282 .282/.055);--red-a3:color(display-p3 1 .169 .271/.156);--red-a4:color(display-p3 1 .118 .267/.236);--red-a5:color(display-p3 1 .212 .314/.303);--red-a6:color(display-p3 1 .318 .38/.374);--red-a7:color(display-p3 1 .4 .424/.475);--red-a8:color(display-p3 1 .431 .431/.635);--red-a9:color(display-p3 1 .388 .384/.82);--red-a10:color(display-p3 1 .463 .447/.853);--red-a11:color(display-p3 1 .57 .55);--red-a12:color(display-p3 .971 .826 .852)}}}:root,.light,.light-theme{--green-1:#fbfefc;--green-2:#f4fbf6;--green-3:#e6f6eb;--green-4:#d6f1df;--green-5:#c4e8d1;--green-6:#adddc0;--green-7:#8eceaa;--green-8:#5bb98b;--green-9:#30a46c;--green-10:#2b9a66;--green-11:#218358;--green-12:#193b2d}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--green-1:color(display-p3 .986 .996 .989);--green-2:color(display-p3 .963 .983 .967);--green-3:color(display-p3 .913 .964 .925);--green-4:color(display-p3 .859 .94 .879);--green-5:color(display-p3 .796 .907 .826);--green-6:color(display-p3 .718 .863 .761);--green-7:color(display-p3 .61 .801 .675);--green-8:color(display-p3 .451 .715 .559);--green-9:color(display-p3 .332 .634 .442);--green-10:color(display-p3 .308 .595 .417);--green-11:color(display-p3 .19 .5 .32);--green-12:color(display-p3 .132 .228 .18)}}}.dark,.dark-theme{--green-1:#0e1512;--green-2:#121b17;--green-3:#132d21;--green-4:#113b29;--green-5:#174933;--green-6:#20573e;--green-7:#28684a;--green-8:#2f7c57;--green-9:#30a46c;--green-10:#33b074;--green-11:#3dd68c;--green-12:#b1f1cb}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--green-1:color(display-p3 .062 .083 .071);--green-2:color(display-p3 .079 .106 .09);--green-3:color(display-p3 .1 .173 .133);--green-4:color(display-p3 .115 .229 .166);--green-5:color(display-p3 .147 .282 .206);--green-6:color(display-p3 .185 .338 .25);--green-7:color(display-p3 .227 .403 .298);--green-8:color(display-p3 .27 .479 .351);--green-9:color(display-p3 .332 .634 .442);--green-10:color(display-p3 .357 .682 .474);--green-11:color(display-p3 .434 .828 .573);--green-12:color(display-p3 .747 .938 .807)}}}:root,.light,.light-theme{--green-a1:#00c04004;--green-a2:#00a32f0b;--green-a3:#00a43319;--green-a4:#00a83829;--green-a5:#019c393b;--green-a6:#00963c52;--green-a7:#00914071;--green-a8:#00924ba4;--green-a9:#008f4acf;--green-a10:#008647d4;--green-a11:#00713fde;--green-a12:#002616e6}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--green-a1:color(display-p3 .024 .757 .267/.016);--green-a2:color(display-p3 .024 .565 .129/.036);--green-a3:color(display-p3 .012 .596 .145/.087);--green-a4:color(display-p3 .008 .588 .145/.142);--green-a5:color(display-p3 .004 .541 .157/.204);--green-a6:color(display-p3 .004 .518 .157/.283);--green-a7:color(display-p3 .004 .486 .165/.389);--green-a8:color(display-p3 0 .478 .2/.55);--green-a9:color(display-p3 0 .455 .165/.667);--green-a10:color(display-p3 0 .416 .153/.691);--green-a11:color(display-p3 .19 .5 .32);--green-a12:color(display-p3 .132 .228 .18)}}}.dark,.dark-theme{--green-a1:#00de4505;--green-a2:#29f99d0b;--green-a3:#22ff991e;--green-a4:#11ff992d;--green-a5:#2bffa23c;--green-a6:#44ffaa4b;--green-a7:#50fdac5e;--green-a8:#54ffad73;--green-a9:#44ffa49e;--green-a10:#43fea4ab;--green-a11:#46fea5d4;--green-a12:#bbffd7f0}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--green-a1:color(display-p3 0 .992 .298/.017);--green-a2:color(display-p3 .341 .98 .616/.043);--green-a3:color(display-p3 .376 .996 .655/.114);--green-a4:color(display-p3 .341 .996 .635/.173);--green-a5:color(display-p3 .408 1 .678/.232);--green-a6:color(display-p3 .475 1 .706/.29);--green-a7:color(display-p3 .514 1 .706/.362);--green-a8:color(display-p3 .529 1 .718/.442);--green-a9:color(display-p3 .502 .996 .682/.61);--green-a10:color(display-p3 .506 1 .682/.66);--green-a11:color(display-p3 .434 .828 .573);--green-a12:color(display-p3 .747 .938 .807)}}}:root,.light,.light-theme{--blue-1:#fbfdff;--blue-2:#f4faff;--blue-3:#e6f4fe;--blue-4:#d5efff;--blue-5:#c2e5ff;--blue-6:#acd8fc;--blue-7:#8ec8f6;--blue-8:#5eb1ef;--blue-9:#0090ff;--blue-10:#0588f0;--blue-11:#0d74ce;--blue-12:#113264}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--blue-1:color(display-p3 .986 .992 .999);--blue-2:color(display-p3 .96 .979 .998);--blue-3:color(display-p3 .912 .956 .991);--blue-4:color(display-p3 .853 .932 1);--blue-5:color(display-p3 .788 .894 .998);--blue-6:color(display-p3 .709 .843 .976);--blue-7:color(display-p3 .606 .777 .947);--blue-8:color(display-p3 .451 .688 .917);--blue-9:color(display-p3 .247 .556 .969);--blue-10:color(display-p3 .234 .523 .912);--blue-11:color(display-p3 .15 .44 .84);--blue-12:color(display-p3 .102 .193 .379)}}}.dark,.dark-theme{--blue-1:#0d1520;--blue-2:#111927;--blue-3:#0d2847;--blue-4:#003362;--blue-5:#004074;--blue-6:#104d87;--blue-7:#205d9e;--blue-8:#2870bd;--blue-9:#0090ff;--blue-10:#3b9eff;--blue-11:#70b8ff;--blue-12:#c2e6ff}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--blue-1:color(display-p3 .057 .081 .122);--blue-2:color(display-p3 .072 .098 .147);--blue-3:color(display-p3 .078 .154 .27);--blue-4:color(display-p3 .033 .197 .37);--blue-5:color(display-p3 .08 .245 .441);--blue-6:color(display-p3 .14 .298 .511);--blue-7:color(display-p3 .195 .361 .6);--blue-8:color(display-p3 .239 .434 .72);--blue-9:color(display-p3 .247 .556 .969);--blue-10:color(display-p3 .344 .612 .973);--blue-11:color(display-p3 .49 .72 1);--blue-12:color(display-p3 .788 .898 .99)}}}:root,.light,.light-theme{--blue-a1:#0080ff04;--blue-a2:#008cff0b;--blue-a3:#008ff519;--blue-a4:#009eff2a;--blue-a5:#0093ff3d;--blue-a6:#0088f653;--blue-a7:#0083eb71;--blue-a8:#0084e6a1;--blue-a9:#0090ff;--blue-a10:#0086f0fa;--blue-a11:#006dcbf2;--blue-a12:#002359ee}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--blue-a1:color(display-p3 .024 .514 1/.016);--blue-a2:color(display-p3 .024 .514 .906/.04);--blue-a3:color(display-p3 .012 .506 .914/.087);--blue-a4:color(display-p3 .008 .545 1/.146);--blue-a5:color(display-p3 .004 .502 .984/.212);--blue-a6:color(display-p3 .004 .463 .922/.291);--blue-a7:color(display-p3 .004 .431 .863/.393);--blue-a8:color(display-p3 0 .427 .851/.55);--blue-a9:color(display-p3 0 .412 .961/.753);--blue-a10:color(display-p3 0 .376 .886/.765);--blue-a11:color(display-p3 .15 .44 .84);--blue-a12:color(display-p3 .102 .193 .379)}}}.dark,.dark-theme{--blue-a1:#004df211;--blue-a2:#1166fb18;--blue-a3:#0077ff3a;--blue-a4:#0075ff57;--blue-a5:#0081fd6b;--blue-a6:#0f89fd7f;--blue-a7:#2a91fe98;--blue-a8:#3094feb9;--blue-a9:#0090ff;--blue-a10:#3b9eff;--blue-a11:#70b8ff;--blue-a12:#c2e6ff}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--blue-a1:color(display-p3 0 .333 1/.059);--blue-a2:color(display-p3 .114 .435 .988/.085);--blue-a3:color(display-p3 .122 .463 1/.219);--blue-a4:color(display-p3 0 .467 1/.324);--blue-a5:color(display-p3 .098 .51 1/.4);--blue-a6:color(display-p3 .224 .557 1/.475);--blue-a7:color(display-p3 .294 .584 1/.572);--blue-a8:color(display-p3 .314 .592 1/.702);--blue-a9:color(display-p3 .251 .573 .996/.967);--blue-a10:color(display-p3 .357 .631 1/.971);--blue-a11:color(display-p3 .49 .72 1);--blue-a12:color(display-p3 .788 .898 .99)}}}:root,.light,.light-theme{--amber-1:#fefdfb;--amber-2:#fefbe9;--amber-3:#fff7c2;--amber-4:#ffee9c;--amber-5:#fbe577;--amber-6:#f3d673;--amber-7:#e9c162;--amber-8:#e2a336;--amber-9:#ffc53d;--amber-10:#ffba18;--amber-11:#ab6400;--amber-12:#4f3422}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--amber-1:color(display-p3 .995 .992 .985);--amber-2:color(display-p3 .994 .986 .921);--amber-3:color(display-p3 .994 .969 .782);--amber-4:color(display-p3 .989 .937 .65);--amber-5:color(display-p3 .97 .902 .527);--amber-6:color(display-p3 .936 .844 .506);--amber-7:color(display-p3 .89 .762 .443);--amber-8:color(display-p3 .85 .65 .3);--amber-9:color(display-p3 1 .77 .26);--amber-10:color(display-p3 .959 .741 .274);--amber-11:color(display-p3 .64 .4 0);--amber-12:color(display-p3 .294 .208 .145)}}}.dark,.dark-theme{--amber-1:#16120c;--amber-2:#1d180f;--amber-3:#302008;--amber-4:#3f2700;--amber-5:#4d3000;--amber-6:#5c3d05;--amber-7:#714f19;--amber-8:#8f6424;--amber-9:#ffc53d;--amber-10:#ffd60a;--amber-11:#ffca16;--amber-12:#ffe7b3}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--amber-1:color(display-p3 .082 .07 .05);--amber-2:color(display-p3 .111 .094 .064);--amber-3:color(display-p3 .178 .128 .049);--amber-4:color(display-p3 .239 .156 0);--amber-5:color(display-p3 .29 .193 0);--amber-6:color(display-p3 .344 .245 .076);--amber-7:color(display-p3 .422 .314 .141);--amber-8:color(display-p3 .535 .399 .189);--amber-9:color(display-p3 1 .77 .26);--amber-10:color(display-p3 1 .87 .15);--amber-11:color(display-p3 1 .8 .29);--amber-12:color(display-p3 .984 .909 .726)}}}:root,.light,.light-theme{--amber-a1:#c0800004;--amber-a2:#f4d10016;--amber-a3:#ffde003d;--amber-a4:#ffd40063;--amber-a5:#f8cf0088;--amber-a6:#eab5008c;--amber-a7:#dc9b009d;--amber-a8:#da8a00c9;--amber-a9:#ffb300c2;--amber-a10:#ffb300e7;--amber-a11:#ab6400;--amber-a12:#341500dd}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root,.light,.light-theme{--amber-a1:color(display-p3 .757 .514 .024/.016);--amber-a2:color(display-p3 .902 .804 .008/.079);--amber-a3:color(display-p3 .965 .859 .004/.22);--amber-a4:color(display-p3 .969 .82 .004/.35);--amber-a5:color(display-p3 .933 .796 .004/.475);--amber-a6:color(display-p3 .875 .682 .004/.495);--amber-a7:color(display-p3 .804 .573 0/.557);--amber-a8:color(display-p3 .788 .502 0/.699);--amber-a9:color(display-p3 1 .686 0/.742);--amber-a10:color(display-p3 .945 .643 0/.726);--amber-a11:color(display-p3 .64 .4 0);--amber-a12:color(display-p3 .294 .208 .145)}}}.dark,.dark-theme{--amber-a1:#e63c0006;--amber-a2:#fd9b000d;--amber-a3:#fa820022;--amber-a4:#fc820032;--amber-a5:#fd8b0041;--amber-a6:#fd9b0051;--amber-a7:#ffab2567;--amber-a8:#ffae3587;--amber-a9:#ffc53d;--amber-a10:#ffd60a;--amber-a11:#ffca16;--amber-a12:#ffe7b3}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){.dark,.dark-theme{--amber-a1:color(display-p3 .992 .298 0/.017);--amber-a2:color(display-p3 .988 .651 0/.047);--amber-a3:color(display-p3 1 .6 0/.118);--amber-a4:color(display-p3 1 .557 0/.185);--amber-a5:color(display-p3 1 .592 0/.24);--amber-a6:color(display-p3 1 .659 .094/.299);--amber-a7:color(display-p3 1 .714 .263/.383);--amber-a8:color(display-p3 .996 .729 .306/.5);--amber-a9:color(display-p3 1 .769 .259);--amber-a10:color(display-p3 1 .871 .149);--amber-a11:color(display-p3 1 .8 .29);--amber-a12:color(display-p3 .984 .909 .726)}}}:root{--black-a1:#0000000d;--black-a2:#0000001a;--black-a3:#00000026;--black-a4:#0003;--black-a5:#0000004d;--black-a6:#0006;--black-a7:#00000080;--black-a8:#0009;--black-a9:#000000b3;--black-a10:#000c;--black-a11:#000000e6;--black-a12:#000000f2}@supports (color:color(display-p3 1 1 1)){@media (color-gamut:p3){:root{--black-a1:color(display-p3 0 0 0/.05);--black-a2:color(display-p3 0 0 0/.1);--black-a3:color(display-p3 0 0 0/.15);--black-a4:color(display-p3 0 0 0/.2);--black-a5:color(display-p3 0 0 0/.3);--black-a6:color(display-p3 0 0 0/.4);--black-a7:color(display-p3 0 0 0/.5);--black-a8:color(display-p3 0 0 0/.6);--black-a9:color(display-p3 0 0 0/.7);--black-a10:color(display-p3 0 0 0/.8);--black-a11:color(display-p3 0 0 0/.9);--black-a12:color(display-p3 0 0 0/.95)}}}:root,.dark{--bg-background:#fdfdfd;--bg-canvas:var(--gray-1);--bg-subtle:var(--gray-1);--bg-elevated:var(--gray-2);--text-emphasis:var(--gray-12);--text-default:var(--gray-11);--text-muted:var(--gray-8);--text-placeholder:var(--gray-5);--text-on-brand:#fff;--border-default:var(--gray-3);--border-subtle:var(--gray-2);--border-interactive:var(--gray-a3);--bg-interactive:var(--gray-a2);--bg-interactive-hover:var(--gray-a3);--ring-focus:var(--gray-a3);--bg-brand:#000;--bg-brand-hover:var(--black-a11);--ring-brand:var(--black-a4);--bg-error:var(--red-a3);--bg-error-hover:var(--red-a5);--border-error:var(--red-a6);--border-error-subtle:var(--red-a4);--text-error:var(--red-a11);--ring-error:var(--red-a7);--bg-warning:var(--amber-a3);--border-warning:var(--amber-a6);--border-warning-subtle:var(--amber-a4);--text-warning:var(--amber-a11);--bg-success:var(--green-a3);--border-success:var(--green-a6);--border-success-subtle:var(--green-a4);--text-success:var(--green-a11);--bg-info:var(--blue-a3);--border-info-subtle:var(--blue-a4);--text-info:var(--blue-a11);--text-link:var(--blue-a9);--border-link:var(--blue-a9);--ring-link:var(--blue-a7)}.dark{--bg-background:#000;--text-placeholder:var(--gray-8);--text-on-brand:#000;--bg-brand:#fff;--bg-brand-hover:var(--gray-12);--ring-brand:var(--gray-a4)}@property --tw-translate-x{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-y{syntax:\"*\";inherits:false;initial-value:0}@property --tw-translate-z{syntax:\"*\";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:\"*\";inherits:false}@property --tw-rotate-y{syntax:\"*\";inherits:false}@property --tw-rotate-z{syntax:\"*\";inherits:false}@property --tw-skew-x{syntax:\"*\";inherits:false}@property --tw-skew-y{syntax:\"*\";inherits:false}@property --tw-border-style{syntax:\"*\";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:\"*\";inherits:false}@property --tw-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:\"*\";inherits:false}@property --tw-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:\"*\";inherits:false}@property --tw-inset-shadow-alpha{syntax:\"<percentage>\";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:\"*\";inherits:false}@property --tw-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:\"*\";inherits:false}@property --tw-inset-ring-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:\"*\";inherits:false}@property --tw-ring-offset-width{syntax:\"<length>\";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:\"*\";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:\"*\";inherits:false;initial-value:0 0 #0000}@property --tw-backdrop-blur{syntax:\"*\";inherits:false}@property --tw-backdrop-brightness{syntax:\"*\";inherits:false}@property --tw-backdrop-contrast{syntax:\"*\";inherits:false}@property --tw-backdrop-grayscale{syntax:\"*\";inherits:false}@property --tw-backdrop-hue-rotate{syntax:\"*\";inherits:false}@property --tw-backdrop-invert{syntax:\"*\";inherits:false}@property --tw-backdrop-opacity{syntax:\"*\";inherits:false}@property --tw-backdrop-saturate{syntax:\"*\";inherits:false}@property --tw-backdrop-sepia{syntax:\"*\";inherits:false}@property --tw-duration{syntax:\"*\";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}}";
1270
+ //#endregion
1271
+ //#region src/widget.tsx
1272
+ function Ye({ trigger: e = "floating", position: t = "bottom-right" }) {
1273
+ let r = l(), [i] = a(() => typeof document > "u" ? null : qe(Je));
1274
+ return n(() => {
1275
+ if (i) return document.body.appendChild(i.element), () => i.element.remove();
1276
+ }, [i]), !r || !i ? null : s(/* @__PURE__ */ W(Ge, {
1277
+ brainbox: r,
1278
+ hostEl: i.element,
1279
+ trigger: e,
1280
+ position: t
1281
+ }), i.container);
1282
+ }
1283
+ //#endregion
1284
+ //#region src/use-brainbox-widget.ts
1285
+ function Xe() {
1286
+ let e = l(), t = e ? K(e) : le;
1287
+ return {
1288
+ isOpen: o(t.subscribe, t.isOpen, t.isOpen),
1289
+ open: t.open,
1290
+ close: t.close
1291
+ };
1292
+ }
1293
+ //#endregion
1294
+ //#region src/mount.tsx
1295
+ function Ze({ trigger: e, position: t, ...n }) {
1296
+ let r = x(n), i = K(r), a = document.createElement("div");
1297
+ a.setAttribute("data-brainbox-root", ""), document.body.appendChild(a);
1298
+ let o = oe(a);
1299
+ return o.render(/* @__PURE__ */ W(c, {
1300
+ brainbox: r,
1301
+ children: /* @__PURE__ */ W(Ye, {
1302
+ trigger: e,
1303
+ position: t
1304
+ })
1305
+ })), {
1306
+ open: i.open,
1307
+ close: i.close,
1308
+ identify: r.identify,
1309
+ destroy() {
1310
+ o.unmount(), a.remove(), r.destroy();
1311
+ }
1312
+ };
1313
+ }
1314
+ //#endregion
1315
+ export { Ye as BrainboxWidget, Ze as mount, Xe as useBrainboxWidget };