react-devbelt 0.0.0-stage → 0.2.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.
Files changed (56) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +16 -0
  3. package/README.md +324 -2
  4. package/dist/announce-6XECDMRI.js +12 -0
  5. package/dist/announce-6XECDMRI.js.map +1 -0
  6. package/dist/chunk-3SXZJ6OP.js +65 -0
  7. package/dist/chunk-3SXZJ6OP.js.map +1 -0
  8. package/dist/chunk-63DO3YVL.js +330 -0
  9. package/dist/chunk-63DO3YVL.js.map +1 -0
  10. package/dist/chunk-6PAFI4BJ.js +14615 -0
  11. package/dist/chunk-6PAFI4BJ.js.map +1 -0
  12. package/dist/chunk-7JLNVGRQ.js +164 -0
  13. package/dist/chunk-7JLNVGRQ.js.map +1 -0
  14. package/dist/chunk-C7RMX5PF.js +57 -0
  15. package/dist/chunk-C7RMX5PF.js.map +1 -0
  16. package/dist/chunk-GB5T3MS2.js +8030 -0
  17. package/dist/chunk-GB5T3MS2.js.map +1 -0
  18. package/dist/chunk-GNJF3UHO.js +1030 -0
  19. package/dist/chunk-GNJF3UHO.js.map +1 -0
  20. package/dist/chunk-PRTINXUT.js +105 -0
  21. package/dist/chunk-PRTINXUT.js.map +1 -0
  22. package/dist/chunk-QRXHNBFY.js +22 -0
  23. package/dist/chunk-QRXHNBFY.js.map +1 -0
  24. package/dist/chunk-QT3YSHQA.js +18 -0
  25. package/dist/chunk-QT3YSHQA.js.map +1 -0
  26. package/dist/cli.js +2174 -0
  27. package/dist/context-D2euxPc4.d.ts +6 -0
  28. package/dist/core.d.ts +266 -0
  29. package/dist/core.js +1070 -0
  30. package/dist/core.js.map +1 -0
  31. package/dist/findable-rows-UQBKFZ45.js +356 -0
  32. package/dist/findable-rows-UQBKFZ45.js.map +1 -0
  33. package/dist/index.d.ts +57 -0
  34. package/dist/index.js +47 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/install.d.ts +2 -0
  37. package/dist/install.js +21 -0
  38. package/dist/install.js.map +1 -0
  39. package/dist/next.d.ts +18 -0
  40. package/dist/next.js +13 -0
  41. package/dist/next.js.map +1 -0
  42. package/dist/plugin-C8VytW9X.d.ts +162 -0
  43. package/dist/plugins.d.ts +118 -0
  44. package/dist/plugins.js +36 -0
  45. package/dist/plugins.js.map +1 -0
  46. package/dist/sheet-presentation-S6GGOKMB.js +2667 -0
  47. package/dist/sheet-presentation-S6GGOKMB.js.map +1 -0
  48. package/dist/styles.css +2 -0
  49. package/dist/toolbar-entry-QHIQKNOO.js +1687 -0
  50. package/dist/toolbar-entry-QHIQKNOO.js.map +1 -0
  51. package/dist/ui.d.ts +37 -0
  52. package/dist/ui.js +126 -0
  53. package/dist/ui.js.map +1 -0
  54. package/licenses/motion-MIT.txt +21 -0
  55. package/licenses/ui-sdk-APACHE-2.0.txt +202 -0
  56. package/package.json +120 -3
@@ -0,0 +1,1687 @@
1
+ "use client";
2
+ "use client";
3
+ import {
4
+ installPlugins
5
+ } from "./chunk-C7RMX5PF.js";
6
+ import {
7
+ COLLAPSE_EVENT,
8
+ COLLAPSE_SHORTCUT,
9
+ FluidHoverHighlight,
10
+ HIDE_EVENT,
11
+ Menu,
12
+ MenuContent,
13
+ MenuContextTrigger,
14
+ MenuGroup,
15
+ MenuGroupLabel,
16
+ MenuHighlight,
17
+ MenuItem,
18
+ MenuSeparator,
19
+ MoreMenu,
20
+ Toolbar,
21
+ ToolbarButton,
22
+ ToolbarSeparator,
23
+ collapseLabel,
24
+ defaultAiTools,
25
+ defaultPlugins,
26
+ exposedAgentTools,
27
+ forwardToTop,
28
+ hideLabel,
29
+ installToolbarShortcuts,
30
+ menuContentClass,
31
+ menuIconClass,
32
+ menuItemClass,
33
+ menuLabelClass,
34
+ menuSeparatorClass,
35
+ readJson,
36
+ readString,
37
+ registerAgentTools,
38
+ spring,
39
+ writeJson,
40
+ writeString
41
+ } from "./chunk-GB5T3MS2.js";
42
+ import "./chunk-QRXHNBFY.js";
43
+ import {
44
+ Button,
45
+ MorphText,
46
+ Popover,
47
+ PopoverClose,
48
+ PopoverContent,
49
+ PopoverTitle,
50
+ Toggle,
51
+ Tooltip,
52
+ TooltipContent,
53
+ TooltipTrigger,
54
+ ariaKeyshortcuts,
55
+ iconButtonClass,
56
+ kbdClass,
57
+ toolbarItemClass,
58
+ tooltipClass
59
+ } from "./chunk-6PAFI4BJ.js";
60
+ import {
61
+ ToolbarContext
62
+ } from "./chunk-QT3YSHQA.js";
63
+ import "./chunk-3SXZJ6OP.js";
64
+ import "./chunk-GNJF3UHO.js";
65
+ import "./chunk-PRTINXUT.js";
66
+ import {
67
+ bindDrag
68
+ } from "./chunk-63DO3YVL.js";
69
+ import "./chunk-7JLNVGRQ.js";
70
+
71
+ // src/ui/toolbar-entry.tsx
72
+ import { useMemo as useMemo3 } from "react";
73
+
74
+ // src/ui/toolbar.tsx
75
+ import {
76
+ useEffect as useEffect5,
77
+ useMemo as useMemo2,
78
+ useRef as useRef5,
79
+ useState as useState6
80
+ } from "react";
81
+ import { MotionConfig, motion } from "motion/react";
82
+ import { ChevronDownIcon, GripVerticalIcon } from "lucide-react";
83
+
84
+ // src/ui/default-item.tsx
85
+ import { useState } from "react";
86
+ import { jsx, jsxs } from "react/jsx-runtime";
87
+ var FLASH_MS = 1500;
88
+ function DefaultItem({
89
+ plugin,
90
+ open,
91
+ onToggle,
92
+ api
93
+ }) {
94
+ const [flash, setFlash] = useState(null);
95
+ const label = plugin.label ?? plugin.name;
96
+ const { Badge, Hint } = plugin;
97
+ if (plugin.window) {
98
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [
99
+ /* @__PURE__ */ jsxs(
100
+ TooltipTrigger,
101
+ {
102
+ render: /* @__PURE__ */ jsx(
103
+ Toggle,
104
+ {
105
+ "aria-label": label,
106
+ "data-devbelt-item": plugin.id,
107
+ pressed: open,
108
+ onPressedChange: onToggle
109
+ }
110
+ ),
111
+ className: `${toolbarItemClass} data-pressed:bg-pressed`,
112
+ children: [
113
+ plugin.icon,
114
+ Badge ? /* @__PURE__ */ jsx(Badge, {}) : null
115
+ ]
116
+ }
117
+ ),
118
+ /* @__PURE__ */ jsxs(TooltipContent, { side: "top", sideOffset: 8, className: tooltipClass, children: [
119
+ plugin.window.title ?? plugin.name,
120
+ Hint ? /* @__PURE__ */ jsx(Hint, {}) : null
121
+ ] })
122
+ ] });
123
+ }
124
+ if (plugin.run) {
125
+ const run = plugin.run;
126
+ const onClick = async () => {
127
+ let result;
128
+ try {
129
+ result = await run(api);
130
+ } catch {
131
+ result = "Failed";
132
+ }
133
+ if (typeof result === "string") {
134
+ setFlash(result);
135
+ window.setTimeout(() => setFlash(null), FLASH_MS);
136
+ }
137
+ };
138
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [
139
+ /* @__PURE__ */ jsxs(
140
+ TooltipTrigger,
141
+ {
142
+ render: /* @__PURE__ */ jsx(ToolbarButton, { "aria-label": label, onClick }),
143
+ className: toolbarItemClass,
144
+ children: [
145
+ plugin.icon,
146
+ flash ? /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(MorphText, { children: flash }) }) : null,
147
+ Badge ? /* @__PURE__ */ jsx(Badge, {}) : null
148
+ ]
149
+ }
150
+ ),
151
+ /* @__PURE__ */ jsx(TooltipContent, { side: "top", sideOffset: 8, className: tooltipClass, children: plugin.description ?? plugin.name })
152
+ ] });
153
+ }
154
+ return null;
155
+ }
156
+
157
+ // src/ui/floating-window.tsx
158
+ import { XIcon } from "lucide-react";
159
+ import { useEffect, useRef } from "react";
160
+
161
+ // src/ui/use-dev-layout.ts
162
+ import { useState as useState2 } from "react";
163
+ var isPanelMode = (value) => value === "window" || value === "popover";
164
+ var STORAGE_KEY = "layout";
165
+ var MARGIN = 8;
166
+ var KEEP_VISIBLE = 96;
167
+ var CASCADE = 28;
168
+ var DEFAULT_LAYOUT = { pinned: {}, open: [], rects: {} };
169
+ function isRect(value) {
170
+ const r = value;
171
+ return !!r && [r.x, r.y, r.width, r.height].every(
172
+ (n) => typeof n === "number" && Number.isFinite(n)
173
+ );
174
+ }
175
+ function read(windows) {
176
+ const parsed = readJson(STORAGE_KEY, null);
177
+ if (!parsed || typeof parsed !== "object") return DEFAULT_LAYOUT;
178
+ const rects = {};
179
+ for (const [id, rect] of Object.entries(parsed.rects ?? {})) {
180
+ if (windows.has(id) && isRect(rect)) rects[id] = rect;
181
+ }
182
+ const pinned = {};
183
+ for (const [id, value] of Object.entries(parsed.pinned ?? {})) {
184
+ if (typeof value === "boolean") pinned[id] = value;
185
+ }
186
+ return {
187
+ pinned,
188
+ open: Array.isArray(parsed.open) ? parsed.open.filter((id) => windows.has(id)) : [],
189
+ rects,
190
+ ...isPanelMode(parsed.mode) ? { mode: parsed.mode } : {}
191
+ };
192
+ }
193
+ function clampRect(size, rect) {
194
+ const { minWidth, minHeight } = size;
195
+ const width = Math.min(
196
+ Math.max(rect.width, minWidth),
197
+ window.innerWidth - MARGIN * 2
198
+ );
199
+ const height = Math.min(
200
+ Math.max(rect.height, minHeight),
201
+ window.innerHeight - MARGIN * 2
202
+ );
203
+ return {
204
+ width,
205
+ height,
206
+ x: Math.min(
207
+ Math.max(rect.x, KEEP_VISIBLE - width),
208
+ window.innerWidth - KEEP_VISIBLE
209
+ ),
210
+ y: Math.min(Math.max(rect.y, 0), window.innerHeight - 40)
211
+ };
212
+ }
213
+ function defaultRect(size, index) {
214
+ const width = Math.min(size.width, window.innerWidth - MARGIN * 2);
215
+ const height = Math.min(size.height, window.innerHeight - 120);
216
+ return clampRect(size, {
217
+ width,
218
+ height,
219
+ x: (window.innerWidth - width) / 2 + index * CASCADE,
220
+ y: Math.max(
221
+ MARGIN,
222
+ (window.innerHeight - height) / 2 - 40 + index * CASCADE
223
+ )
224
+ });
225
+ }
226
+ function useDevLayout(plugins, defaultMode = "window") {
227
+ const sizes = /* @__PURE__ */ new Map();
228
+ for (const plugin of plugins) {
229
+ if (plugin.window) sizes.set(plugin.id, plugin.window.size);
230
+ }
231
+ const [layout, setLayout] = useState2(
232
+ () => read(new Set(sizes.keys()))
233
+ );
234
+ const update = (change) => setLayout((current) => {
235
+ const next = change(current);
236
+ writeJson(STORAGE_KEY, next);
237
+ return next;
238
+ });
239
+ const sizeOf = (id) => sizes.get(id);
240
+ const open = (id) => {
241
+ const size = sizeOf(id);
242
+ if (!size) return;
243
+ update((current) => {
244
+ if ((current.mode ?? defaultMode) === "popover") {
245
+ return { ...current, open: [id] };
246
+ }
247
+ return {
248
+ ...current,
249
+ open: [...current.open.filter((w) => w !== id), id],
250
+ rects: current.rects[id] ? current.rects : { ...current.rects, [id]: defaultRect(size, current.open.length) }
251
+ };
252
+ });
253
+ };
254
+ const close = (id) => update((current) => ({
255
+ ...current,
256
+ open: current.open.filter((w) => w !== id)
257
+ }));
258
+ return {
259
+ layout,
260
+ mode: layout.mode ?? defaultMode,
261
+ setMode: (mode) => update((current) => ({
262
+ ...current,
263
+ mode,
264
+ // switching to a popover keeps only the tool in front
265
+ open: mode === "popover" ? current.open.slice(-1) : current.open
266
+ })),
267
+ isOpen: (id) => layout.open.includes(id),
268
+ isPinned: (plugin) => layout.pinned[plugin.id] ?? plugin.pinned ?? true,
269
+ open,
270
+ close,
271
+ toggle: (id) => layout.open.includes(id) ? close(id) : open(id),
272
+ focus: (id) => update(
273
+ (current) => current.open[current.open.length - 1] === id ? current : { ...current, open: [...current.open.filter((w) => w !== id), id] }
274
+ ),
275
+ setRect: (id, rect) => {
276
+ const size = sizeOf(id);
277
+ if (!size) return;
278
+ update((current) => ({
279
+ ...current,
280
+ rects: { ...current.rects, [id]: clampRect(size, rect) }
281
+ }));
282
+ },
283
+ setPinned: (id, pinned) => update((current) => ({
284
+ ...current,
285
+ pinned: { ...current.pinned, [id]: pinned }
286
+ })),
287
+ reset: () => update(() => DEFAULT_LAYOUT)
288
+ };
289
+ }
290
+
291
+ // src/ui/floating-window.tsx
292
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
293
+ var DRAG_THRESHOLD = 4;
294
+ var STEP = 8;
295
+ var LARGE_STEP = 40;
296
+ var BASE_Z = 9100;
297
+ function FloatingWindow({
298
+ id,
299
+ size,
300
+ title,
301
+ icon,
302
+ rect,
303
+ stack,
304
+ onFocus,
305
+ onClose,
306
+ onRect,
307
+ children
308
+ }) {
309
+ const ref = useRef(null);
310
+ const current = useRef(rect);
311
+ const stop = useRef(void 0);
312
+ useEffect(() => {
313
+ current.current = rect;
314
+ }, [rect]);
315
+ useEffect(() => () => stop.current?.(), []);
316
+ const paint = (next) => {
317
+ const el = ref.current;
318
+ if (!el) return;
319
+ el.style.setProperty("--x", `${next.x}px`);
320
+ el.style.setProperty("--y", `${next.y}px`);
321
+ el.style.setProperty("--w", `${next.width}px`);
322
+ el.style.setProperty("--h", `${next.height}px`);
323
+ };
324
+ const drag = (event, to) => {
325
+ if (event.button !== 0) return;
326
+ stop.current?.();
327
+ const from = current.current;
328
+ const origin = { x: event.clientX, y: event.clientY };
329
+ let latest = from;
330
+ stop.current = bindDrag(event.currentTarget, event.nativeEvent, {
331
+ threshold: DRAG_THRESHOLD,
332
+ cancelOnEscape: true,
333
+ onMove: ({ x, y }) => {
334
+ latest = clampRect(size, to(from, x - origin.x, y - origin.y));
335
+ paint(latest);
336
+ },
337
+ onEnd: (_event, canceled) => {
338
+ if (canceled) paint(from);
339
+ else onRect(latest);
340
+ }
341
+ });
342
+ };
343
+ const startMove = (event) => {
344
+ const button = event.target.closest("button");
345
+ if (button && !button.hasAttribute("data-drag-handle")) return;
346
+ drag(event, (from, dx, dy) => ({
347
+ ...from,
348
+ x: from.x + dx,
349
+ y: from.y + dy
350
+ }));
351
+ };
352
+ const startResize = (edge) => (event) => drag(event, (from, dx, dy) => ({
353
+ ...from,
354
+ width: edge.includes("e") ? from.width + dx : from.width,
355
+ height: edge.includes("s") ? from.height + dy : from.height
356
+ }));
357
+ const onKeyDown = (event) => {
358
+ if (!event.altKey) return;
359
+ const delta = {
360
+ ArrowLeft: { x: -1, y: 0 },
361
+ ArrowRight: { x: 1, y: 0 },
362
+ ArrowUp: { x: 0, y: -1 },
363
+ ArrowDown: { x: 0, y: 1 }
364
+ }[event.key];
365
+ if (!delta) return;
366
+ event.preventDefault();
367
+ event.stopPropagation();
368
+ const step = event.shiftKey ? LARGE_STEP : STEP;
369
+ const from = current.current;
370
+ onRect(
371
+ event.ctrlKey ? {
372
+ ...from,
373
+ width: from.width + delta.x * step,
374
+ height: from.height + delta.y * step
375
+ } : { ...from, x: from.x + delta.x * step, y: from.y + delta.y * step }
376
+ );
377
+ };
378
+ const { minWidth, minHeight } = size;
379
+ return /* @__PURE__ */ jsxs2(
380
+ "section",
381
+ {
382
+ ref,
383
+ "aria-label": title,
384
+ "data-react-grab-ignore": true,
385
+ "data-devbelt-window": id,
386
+ onPointerDownCapture: onFocus,
387
+ className: "pointer-events-auto fixed top-(--y) left-(--x) flex h-(--h) w-(--w) flex-col overflow-hidden rounded-xl border border-line bg-surface text-xs text-fg shadow-2xl",
388
+ style: {
389
+ "--x": `${rect.x}px`,
390
+ "--y": `${rect.y}px`,
391
+ "--w": `${rect.width}px`,
392
+ "--h": `${rect.height}px`,
393
+ minWidth,
394
+ minHeight,
395
+ zIndex: BASE_Z + stack
396
+ },
397
+ children: [
398
+ /* @__PURE__ */ jsxs2(
399
+ "header",
400
+ {
401
+ onPointerDown: startMove,
402
+ className: "flex shrink-0 cursor-grab touch-none items-center gap-2 border-b border-line bg-surface-header px-2 py-1.5 select-none active:cursor-grabbing",
403
+ children: [
404
+ /* @__PURE__ */ jsx2("span", { className: "text-fg-icon", "aria-hidden": "true", children: icon }),
405
+ /* @__PURE__ */ jsx2("h2", { className: "min-w-0 flex-1 text-xs font-semibold", children: /* @__PURE__ */ jsx2(
406
+ Button,
407
+ {
408
+ "aria-label": `Move ${title}`,
409
+ "data-drag-handle": "",
410
+ title: "Drag the header to move \xB7 Alt+arrows nudge \xB7 add Ctrl to resize",
411
+ onKeyDown,
412
+ className: "block w-full cursor-grab truncate rounded-md px-1 py-0.5 text-start focus-visible:outline-2 focus-visible:outline-focus active:cursor-grabbing",
413
+ children: title
414
+ }
415
+ ) }),
416
+ /* @__PURE__ */ jsx2(
417
+ Button,
418
+ {
419
+ "aria-label": `Close ${title}`,
420
+ onClick: onClose,
421
+ className: `${iconButtonClass} relative after:absolute after:-inset-1 size-6`,
422
+ children: /* @__PURE__ */ jsx2(XIcon, { className: "size-3.5", "aria-hidden": "true" })
423
+ }
424
+ )
425
+ ]
426
+ }
427
+ ),
428
+ /* @__PURE__ */ jsx2("div", { className: "flex min-h-0 flex-1 flex-col", children }),
429
+ /* @__PURE__ */ jsx2(
430
+ "div",
431
+ {
432
+ "aria-hidden": "true",
433
+ onPointerDown: startResize("e"),
434
+ className: "group absolute inset-y-0 right-0 w-3 cursor-ew-resize touch-none",
435
+ children: /* @__PURE__ */ jsx2("span", { className: "pointer-events-none absolute inset-y-3 right-0 w-[3px] rounded-full bg-accent opacity-0 transition-opacity duration-75 group-hover:opacity-100 group-active:opacity-100" })
436
+ }
437
+ ),
438
+ /* @__PURE__ */ jsx2(
439
+ "div",
440
+ {
441
+ "aria-hidden": "true",
442
+ onPointerDown: startResize("s"),
443
+ className: "group absolute inset-x-0 bottom-0 h-3 cursor-ns-resize touch-none",
444
+ children: /* @__PURE__ */ jsx2("span", { className: "pointer-events-none absolute inset-x-3 bottom-0 h-[3px] rounded-full bg-accent opacity-0 transition-opacity duration-75 group-hover:opacity-100 group-active:opacity-100" })
445
+ }
446
+ ),
447
+ /* @__PURE__ */ jsx2(
448
+ "div",
449
+ {
450
+ "aria-hidden": "true",
451
+ onPointerDown: startResize("se"),
452
+ className: "group absolute right-0 bottom-0 size-8 cursor-nwse-resize touch-none",
453
+ children: /* @__PURE__ */ jsx2("span", { className: "pointer-events-none absolute right-0 bottom-0 size-4 rounded-br-xl border-r-[3px] border-b-[3px] border-accent opacity-0 transition-opacity duration-75 group-hover:opacity-100 group-active:opacity-100" })
454
+ }
455
+ )
456
+ ]
457
+ }
458
+ );
459
+ }
460
+
461
+ // src/ui/item-menu.tsx
462
+ import { PinOffIcon, PlayIcon, SquareArrowOutUpRightIcon } from "lucide-react";
463
+ import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
464
+ function ItemMenu({ plugin, onOpen, onUnpin, children }) {
465
+ const Section = plugin.MenuSection;
466
+ return /* @__PURE__ */ jsxs3(Menu, { children: [
467
+ /* @__PURE__ */ jsx3(
468
+ MenuContextTrigger,
469
+ {
470
+ "aria-label": `${plugin.name} options`,
471
+ render: /* @__PURE__ */ jsx3("span", { className: "contents" }),
472
+ children
473
+ }
474
+ ),
475
+ /* @__PURE__ */ jsxs3(
476
+ MenuContent,
477
+ {
478
+ "aria-label": `${plugin.name} options`,
479
+ "data-react-grab-ignore": true,
480
+ className: menuContentClass,
481
+ children: [
482
+ /* @__PURE__ */ jsx3(MenuHighlight, {}),
483
+ /* @__PURE__ */ jsxs3(MenuGroup, { children: [
484
+ /* @__PURE__ */ jsxs3(MenuGroupLabel, { className: `${menuLabelClass} flex items-center gap-1.5`, children: [
485
+ /* @__PURE__ */ jsx3("span", { className: "inline-flex shrink-0 [&_svg]:size-3", "aria-hidden": "true", children: plugin.icon }),
486
+ plugin.name
487
+ ] }),
488
+ plugin.window || plugin.run ? /* @__PURE__ */ jsxs3(MenuItem, { value: "open", className: menuItemClass, onSelect: onOpen, children: [
489
+ plugin.window ? /* @__PURE__ */ jsx3(SquareArrowOutUpRightIcon, { className: menuIconClass, "aria-hidden": "true" }) : /* @__PURE__ */ jsx3(PlayIcon, { className: menuIconClass, "aria-hidden": "true" }),
490
+ plugin.window ? "Open" : "Run"
491
+ ] }) : null
492
+ ] }),
493
+ Section ? /* @__PURE__ */ jsxs3(Fragment, { children: [
494
+ /* @__PURE__ */ jsx3(MenuSeparator, { className: menuSeparatorClass }),
495
+ /* @__PURE__ */ jsx3(Section, {})
496
+ ] }) : null,
497
+ /* @__PURE__ */ jsx3(MenuSeparator, { className: menuSeparatorClass }),
498
+ /* @__PURE__ */ jsxs3(MenuItem, { value: "unpin", className: menuItemClass, onSelect: onUnpin, children: [
499
+ /* @__PURE__ */ jsx3(PinOffIcon, { className: menuIconClass, "aria-hidden": "true" }),
500
+ "Unpin from toolbar"
501
+ ] })
502
+ ]
503
+ }
504
+ )
505
+ ] });
506
+ }
507
+
508
+ // src/ui/toolbar-strip.tsx
509
+ import { useEffect as useEffect3, useRef as useRef3 } from "react";
510
+
511
+ // src/ui/use-fluid-hover.ts
512
+ import {
513
+ useRef as useRef2,
514
+ useState as useState3,
515
+ useCallback,
516
+ useEffect as useEffect2,
517
+ useLayoutEffect,
518
+ useMemo,
519
+ useSyncExternalStore
520
+ } from "react";
521
+ function pickNearest({
522
+ axis,
523
+ point,
524
+ rects,
525
+ containerRect,
526
+ scroll,
527
+ border,
528
+ layoutSize,
529
+ isDisabled
530
+ }) {
531
+ const scaleX = layoutSize.width > 0 ? containerRect.width / layoutSize.width : 1;
532
+ const scaleY = layoutSize.height > 0 ? containerRect.height / layoutSize.height : 1;
533
+ let closestIndex = null;
534
+ let closestDistance = Infinity;
535
+ let containingIndex = null;
536
+ for (let index = 0; index < rects.length; index++) {
537
+ const r = rects[index];
538
+ if (!r) continue;
539
+ if (isDisabled?.(index)) continue;
540
+ if (axis === "xy") {
541
+ const left = containerRect.left + (border.x + r.left - scroll.x) * scaleX;
542
+ const top = containerRect.top + (border.y + r.top - scroll.y) * scaleY;
543
+ const width = r.width * scaleX;
544
+ const height = r.height * scaleY;
545
+ if (point.x >= left && point.x <= left + width && point.y >= top && point.y <= top + height) {
546
+ containingIndex = index;
547
+ }
548
+ const distance2 = Math.hypot(point.x - (left + width / 2), point.y - (top + height / 2));
549
+ if (distance2 < closestDistance) {
550
+ closestDistance = distance2;
551
+ closestIndex = index;
552
+ }
553
+ continue;
554
+ }
555
+ const horizontal = axis === "x";
556
+ const mousePos = horizontal ? point.x : point.y;
557
+ const scale = horizontal ? scaleX : scaleY;
558
+ const itemStart = (horizontal ? containerRect.left : containerRect.top) + ((horizontal ? border.x : border.y) + (horizontal ? r.left : r.top) - (horizontal ? scroll.x : scroll.y)) * scale;
559
+ const itemSize = (horizontal ? r.width : r.height) * scale;
560
+ if (mousePos >= itemStart && mousePos <= itemStart + itemSize) {
561
+ containingIndex = index;
562
+ }
563
+ const distance = Math.abs(mousePos - (itemStart + itemSize / 2));
564
+ if (distance < closestDistance) {
565
+ closestDistance = distance;
566
+ closestIndex = index;
567
+ }
568
+ }
569
+ return containingIndex ?? closestIndex;
570
+ }
571
+ function isOwnEvent(e) {
572
+ const { currentTarget, target } = e;
573
+ if (!(currentTarget instanceof Node) || !(target instanceof Node)) return true;
574
+ return currentTarget.contains(target);
575
+ }
576
+ var ACTIVE_ATTR = "data-fluid-hover-active";
577
+ var ACTIVE_INDEX_ATTR = "data-fluid-hover-active-index";
578
+ var ACTIVATOR_SELECTOR = "a[href], button, [role='menuitem'], [role='menuitemradio'], [role='menuitemcheckbox'], [role='option'], [role='radio'], [role='checkbox'], [role='tab'], [role='link'], [role='button']";
579
+ function resolveActivator(element) {
580
+ if (element.matches(ACTIVATOR_SELECTOR) || element.hasAttribute("tabindex")) {
581
+ return element;
582
+ }
583
+ return element.querySelector(ACTIVATOR_SELECTOR) ?? element;
584
+ }
585
+ var useIsoLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect2;
586
+ var measurementAttempts = 3;
587
+ var SEAM = 4;
588
+ function distanceToRect(r, point) {
589
+ const dx = Math.max(r.left - point.x, 0, point.x - r.right);
590
+ const dy = Math.max(r.top - point.y, 0, point.y - r.bottom);
591
+ return Math.hypot(dx, dy);
592
+ }
593
+ function useFluidHover(containerRef, options = {}) {
594
+ const { axis = "y", isItemDisabled, gapClick = true, nearest = false, followScroll = false } = options;
595
+ const gapClickMaxDistance = typeof gapClick === "object" ? gapClick.maxDistance ?? Infinity : Infinity;
596
+ const itemsRef = useRef2(/* @__PURE__ */ new Map());
597
+ const [activeIndex, setActiveIndex] = useState3(null);
598
+ const activeIndexRef = useRef2(null);
599
+ const listenersRef = useRef2(/* @__PURE__ */ new Set());
600
+ const activeStore = useMemo(
601
+ () => ({
602
+ subscribe: (listener) => {
603
+ listenersRef.current.add(listener);
604
+ return () => {
605
+ listenersRef.current.delete(listener);
606
+ };
607
+ },
608
+ get: () => activeIndexRef.current
609
+ }),
610
+ []
611
+ );
612
+ useIsoLayoutEffect(() => {
613
+ activeIndexRef.current = activeIndex;
614
+ listenersRef.current.forEach((listener) => listener());
615
+ }, [activeIndex]);
616
+ useEffect2(() => {
617
+ const container = containerRef.current;
618
+ const items = itemsRef.current;
619
+ if (activeIndex === null) container?.removeAttribute(ACTIVE_INDEX_ATTR);
620
+ else container?.setAttribute(ACTIVE_INDEX_ATTR, String(activeIndex));
621
+ const active = activeIndex === null ? void 0 : items.get(activeIndex);
622
+ active?.setAttribute(ACTIVE_ATTR, "");
623
+ return () => {
624
+ active?.removeAttribute(ACTIVE_ATTR);
625
+ if (activeIndex !== null) items.get(activeIndex)?.removeAttribute(ACTIVE_ATTR);
626
+ };
627
+ }, [activeIndex, containerRef]);
628
+ const [itemRects, setItemRects] = useState3([]);
629
+ const [isMeasured, setIsMeasured] = useState3(false);
630
+ const itemRectsRef = useRef2([]);
631
+ const [session, setSession] = useState3(0);
632
+ const sessionRef = useRef2(0);
633
+ const sessionPendingRef = useRef2(false);
634
+ const rafIdRef = useRef2(null);
635
+ const remeasureRafIdRef = useRef2(null);
636
+ const runMeasurement = useCallback(() => {
637
+ const container = containerRef.current;
638
+ if (!container) return false;
639
+ const rects = [];
640
+ let everyItemHasLayout = true;
641
+ itemsRef.current.forEach((element, index) => {
642
+ const hasLayoutBox = element.offsetParent !== null || element.offsetWidth > 0 || element.offsetHeight > 0;
643
+ if (!hasLayoutBox) {
644
+ everyItemHasLayout = false;
645
+ return;
646
+ }
647
+ let top = element.offsetTop;
648
+ let left = element.offsetLeft;
649
+ let ancestor = element.offsetParent;
650
+ while (ancestor && ancestor !== container && container.contains(ancestor)) {
651
+ top += ancestor.offsetTop + ancestor.clientTop;
652
+ left += ancestor.offsetLeft + ancestor.clientLeft;
653
+ ancestor = ancestor.offsetParent;
654
+ }
655
+ rects[index] = {
656
+ top,
657
+ height: element.offsetHeight,
658
+ left,
659
+ width: element.offsetWidth
660
+ };
661
+ });
662
+ if (!everyItemHasLayout) return false;
663
+ const prev = itemRectsRef.current;
664
+ let changed = prev.length !== rects.length;
665
+ for (let i = 0; !changed && i < rects.length; i++) {
666
+ const p = prev[i];
667
+ const r = rects[i];
668
+ if (p === r) continue;
669
+ changed = !p || !r || p.top !== r.top || p.left !== r.left || p.width !== r.width || p.height !== r.height;
670
+ }
671
+ if (changed) {
672
+ itemRectsRef.current = rects;
673
+ setItemRects(rects);
674
+ }
675
+ return true;
676
+ }, [containerRef]);
677
+ const measureItems = useCallback(() => {
678
+ runMeasurement();
679
+ }, [runMeasurement]);
680
+ const scheduleMeasurement = useCallback(
681
+ (attempts) => {
682
+ const attempt = (attemptsLeft) => {
683
+ if (remeasureRafIdRef.current !== null) {
684
+ cancelAnimationFrame(remeasureRafIdRef.current);
685
+ }
686
+ remeasureRafIdRef.current = requestAnimationFrame(() => {
687
+ remeasureRafIdRef.current = null;
688
+ if (runMeasurement()) {
689
+ setIsMeasured(true);
690
+ } else if (attemptsLeft > 1) {
691
+ attempt(attemptsLeft - 1);
692
+ }
693
+ });
694
+ };
695
+ attempt(attempts);
696
+ },
697
+ [runMeasurement]
698
+ );
699
+ const remeasure = useCallback(() => {
700
+ setIsMeasured(false);
701
+ scheduleMeasurement(measurementAttempts);
702
+ }, [scheduleMeasurement]);
703
+ const itemRoRef = useRef2(null);
704
+ const getItemRo = useCallback(() => {
705
+ if (itemRoRef.current === null && typeof ResizeObserver !== "undefined") {
706
+ itemRoRef.current = new ResizeObserver(
707
+ () => scheduleMeasurement(measurementAttempts)
708
+ );
709
+ }
710
+ return itemRoRef.current;
711
+ }, [scheduleMeasurement]);
712
+ const registerItem = useCallback(
713
+ (index, element) => {
714
+ if (element) {
715
+ itemsRef.current.set(index, element);
716
+ getItemRo()?.observe(element);
717
+ if (index === activeIndexRef.current) element.setAttribute(ACTIVE_ATTR, "");
718
+ } else {
719
+ const previous = itemsRef.current.get(index);
720
+ if (previous) itemRoRef.current?.unobserve(previous);
721
+ previous?.removeAttribute(ACTIVE_ATTR);
722
+ itemsRef.current.delete(index);
723
+ if (index === activeIndexRef.current) {
724
+ setActiveIndex(
725
+ (current) => current === index && !itemsRef.current.has(index) ? null : current
726
+ );
727
+ }
728
+ }
729
+ remeasure();
730
+ },
731
+ [remeasure, getItemRo]
732
+ );
733
+ const seamHold = useCallback(
734
+ (point) => {
735
+ const active = activeIndexRef.current;
736
+ if (active === null) return null;
737
+ const activeEl = itemsRef.current.get(active);
738
+ if (!activeEl || isItemDisabled?.(activeEl)) return null;
739
+ const activeRect = activeEl.getBoundingClientRect();
740
+ const d = distanceToRect(activeRect, point);
741
+ if (d === 0 || d > SEAM) return null;
742
+ for (const [index, el] of itemsRef.current) {
743
+ if (index === active || el.contains(activeEl) || activeEl.contains(el)) continue;
744
+ if (isItemDisabled?.(el)) continue;
745
+ const r = el.getBoundingClientRect();
746
+ if (distanceToRect(r, point) > 0 && distanceToRect(r, point) <= SEAM) return active;
747
+ }
748
+ return null;
749
+ },
750
+ [isItemDisabled]
751
+ );
752
+ const itemAt = useCallback(
753
+ (container, point, target) => {
754
+ if (nearest)
755
+ return pickNearest({
756
+ axis,
757
+ point,
758
+ rects: itemRectsRef.current,
759
+ containerRect: container.getBoundingClientRect(),
760
+ scroll: { x: container.scrollLeft, y: container.scrollTop },
761
+ border: { x: container.clientLeft, y: container.clientTop },
762
+ layoutSize: { width: container.offsetWidth, height: container.offsetHeight },
763
+ isDisabled: isItemDisabled ? (index) => {
764
+ const el = itemsRef.current.get(index);
765
+ return !!el && isItemDisabled(el);
766
+ } : void 0
767
+ });
768
+ let next = null;
769
+ let hit = null;
770
+ for (const [index, el] of itemsRef.current) {
771
+ if (!el.contains(target) || isItemDisabled?.(el)) continue;
772
+ if (!hit || hit.contains(el)) {
773
+ hit = el;
774
+ next = index;
775
+ }
776
+ }
777
+ const held = seamHold(point);
778
+ if (held !== null && held !== next) {
779
+ const heldEl = itemsRef.current.get(held);
780
+ if (!hit || heldEl && hit.contains(heldEl)) return held;
781
+ }
782
+ return next;
783
+ },
784
+ [axis, isItemDisabled, nearest, seamHold]
785
+ );
786
+ const pointRef = useRef2(null);
787
+ const handleMouseMove = useCallback(
788
+ (e) => {
789
+ if (!isOwnEvent(e)) return;
790
+ const mouseX = e.clientX;
791
+ const mouseY = e.clientY;
792
+ const target = e.target;
793
+ pointRef.current = { x: mouseX, y: mouseY };
794
+ if (rafIdRef.current !== null) {
795
+ cancelAnimationFrame(rafIdRef.current);
796
+ }
797
+ rafIdRef.current = requestAnimationFrame(() => {
798
+ rafIdRef.current = null;
799
+ const container = containerRef.current;
800
+ if (!container) return;
801
+ const next = itemAt(container, { x: mouseX, y: mouseY }, target);
802
+ if (sessionPendingRef.current && next !== activeIndexRef.current) {
803
+ sessionPendingRef.current = false;
804
+ sessionRef.current += 1;
805
+ setSession(sessionRef.current);
806
+ } else if (next !== null && next === activeIndexRef.current) {
807
+ sessionPendingRef.current = false;
808
+ }
809
+ if (next === null) sessionPendingRef.current = true;
810
+ setActiveIndex(next);
811
+ });
812
+ },
813
+ [containerRef, itemAt]
814
+ );
815
+ useEffect2(() => {
816
+ if (!followScroll) return;
817
+ let frame = null;
818
+ const follow = () => {
819
+ frame = null;
820
+ const container = containerRef.current;
821
+ const point = pointRef.current;
822
+ if (!container || !point) return;
823
+ const target = document.elementFromPoint(point.x, point.y);
824
+ if (!target || !container.contains(target)) return;
825
+ const next = itemAt(container, point, target);
826
+ if (next === activeIndexRef.current) return;
827
+ if (sessionPendingRef.current && next !== null) {
828
+ sessionPendingRef.current = false;
829
+ sessionRef.current += 1;
830
+ setSession(sessionRef.current);
831
+ }
832
+ if (next === null) sessionPendingRef.current = true;
833
+ setActiveIndex(next);
834
+ };
835
+ const onScroll = () => {
836
+ if (!pointRef.current || frame !== null || window.matchMedia("(hover: none)").matches) return;
837
+ frame = requestAnimationFrame(follow);
838
+ };
839
+ window.addEventListener("scroll", onScroll, { capture: true, passive: true });
840
+ return () => {
841
+ window.removeEventListener("scroll", onScroll, { capture: true });
842
+ if (frame !== null) cancelAnimationFrame(frame);
843
+ };
844
+ }, [containerRef, itemAt, followScroll]);
845
+ const handleMouseEnter = useCallback(() => {
846
+ sessionPendingRef.current = true;
847
+ }, []);
848
+ const handleMouseLeave = useCallback(() => {
849
+ if (rafIdRef.current !== null) {
850
+ cancelAnimationFrame(rafIdRef.current);
851
+ rafIdRef.current = null;
852
+ }
853
+ pointRef.current = null;
854
+ setActiveIndex(null);
855
+ }, []);
856
+ const setActiveIndexFromOutside = useCallback((value) => {
857
+ pointRef.current = null;
858
+ setActiveIndex(value);
859
+ }, []);
860
+ const handleClick = useCallback(
861
+ (e) => {
862
+ const target = e.target;
863
+ if (!target) return;
864
+ for (const element2 of itemsRef.current.values()) {
865
+ if (element2.contains(target)) return;
866
+ }
867
+ if (!target.isConnected) return;
868
+ if (!isOwnEvent(e)) return;
869
+ const control = target.closest?.(
870
+ "input, textarea, select, button, a, summary, [contenteditable], [role='textbox'], [role='searchbox'], [role='button']"
871
+ );
872
+ if (control) return;
873
+ if (gapClick === false) return;
874
+ const index = nearest ? activeIndexRef.current : seamHold({ x: e.clientX, y: e.clientY });
875
+ if (index === null) return;
876
+ const element = itemsRef.current.get(index);
877
+ if (!element || isItemDisabled?.(element)) return;
878
+ if (gapClickMaxDistance !== Infinity) {
879
+ const r = element.getBoundingClientRect();
880
+ const dx = Math.max(r.left - e.clientX, 0, e.clientX - r.right);
881
+ const dy = Math.max(r.top - e.clientY, 0, e.clientY - r.bottom);
882
+ if (Math.hypot(dx, dy) > gapClickMaxDistance) return;
883
+ }
884
+ resolveActivator(element).click();
885
+ },
886
+ [isItemDisabled, gapClick, gapClickMaxDistance, nearest, seamHold]
887
+ );
888
+ useEffect2(() => {
889
+ const container = containerRef.current;
890
+ if (!container || typeof ResizeObserver === "undefined") return;
891
+ const ro = new ResizeObserver(() => scheduleMeasurement(measurementAttempts));
892
+ ro.observe(container);
893
+ return () => ro.disconnect();
894
+ }, [containerRef, scheduleMeasurement]);
895
+ useEffect2(() => {
896
+ return () => {
897
+ if (rafIdRef.current !== null) {
898
+ cancelAnimationFrame(rafIdRef.current);
899
+ }
900
+ if (remeasureRafIdRef.current !== null) {
901
+ cancelAnimationFrame(remeasureRafIdRef.current);
902
+ }
903
+ itemRoRef.current?.disconnect();
904
+ itemRoRef.current = null;
905
+ };
906
+ }, []);
907
+ return {
908
+ activeIndex,
909
+ setActiveIndex: setActiveIndexFromOutside,
910
+ activeStore,
911
+ itemRects,
912
+ isMeasured,
913
+ session,
914
+ sessionRef,
915
+ handlers: {
916
+ onMouseMove: handleMouseMove,
917
+ onMouseEnter: handleMouseEnter,
918
+ onMouseLeave: handleMouseLeave,
919
+ onClick: handleClick
920
+ },
921
+ registerItem,
922
+ remeasure,
923
+ measureItems
924
+ };
925
+ }
926
+
927
+ // src/ui/toolbar-strip.tsx
928
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
929
+ function ToolbarStrip({
930
+ children,
931
+ ...props
932
+ }) {
933
+ const ref = useRef3(null);
934
+ const hover = useFluidHover(ref, { axis: "x", gapClick: false });
935
+ const { registerItem } = hover;
936
+ useEffect3(() => {
937
+ const strip = ref.current;
938
+ if (!strip) return;
939
+ let known = [];
940
+ const sync = () => {
941
+ const buttons = Array.from(
942
+ strip.querySelectorAll("button:not([disabled])")
943
+ );
944
+ buttons.forEach((button, index) => {
945
+ if (known[index] !== button) registerItem(index, button);
946
+ });
947
+ for (let index = buttons.length; index < known.length; index++) {
948
+ registerItem(index, null);
949
+ }
950
+ known = buttons;
951
+ };
952
+ sync();
953
+ const observer = new MutationObserver(sync);
954
+ observer.observe(strip, { childList: true, subtree: true });
955
+ return () => {
956
+ observer.disconnect();
957
+ known.forEach((_, index) => registerItem(index, null));
958
+ };
959
+ }, [registerItem]);
960
+ return /* @__PURE__ */ jsxs4(Toolbar, { ref, ...hover.handlers, ...props, children: [
961
+ /* @__PURE__ */ jsx4(FluidHoverHighlight, { hover, className: "z-0 rounded-full" }),
962
+ children
963
+ ] });
964
+ }
965
+
966
+ // src/ui/plugin-boundary.tsx
967
+ import { Component } from "react";
968
+ var PluginBoundary = class extends Component {
969
+ state = { failed: false };
970
+ static getDerivedStateFromError() {
971
+ return { failed: true };
972
+ }
973
+ componentDidCatch(error) {
974
+ console.warn(`devbelt: plugin "${this.props.plugin}" crashed`, error);
975
+ }
976
+ render() {
977
+ return this.state.failed ? null : this.props.children;
978
+ }
979
+ };
980
+
981
+ // src/ui/plugin-popover.tsx
982
+ import { XIcon as XIcon2 } from "lucide-react";
983
+ import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
984
+ var MARGIN2 = 8;
985
+ var findAnchor = (root, id) => root.querySelector(`[data-devbelt-item="${id}"]`) ?? root.querySelector('[data-dock="toolbar"]');
986
+ var onToolbar = (event) => event?.composedPath().some((node) => node instanceof Element && node.hasAttribute("data-dock")) ?? false;
987
+ function PluginPopover({
988
+ id,
989
+ title,
990
+ icon,
991
+ size,
992
+ root,
993
+ onClose,
994
+ children
995
+ }) {
996
+ return /* @__PURE__ */ jsx5(
997
+ Popover,
998
+ {
999
+ open: true,
1000
+ modal: false,
1001
+ onOpenChange: (open, details) => {
1002
+ if (open) return;
1003
+ if (details.reason !== "escape-key" && onToolbar(details.event)) {
1004
+ details.cancel();
1005
+ return;
1006
+ }
1007
+ onClose();
1008
+ },
1009
+ children: /* @__PURE__ */ jsxs5(
1010
+ PopoverContent,
1011
+ {
1012
+ anchor: findAnchor(root, id),
1013
+ side: "top",
1014
+ align: "center",
1015
+ sideOffset: 12,
1016
+ initialFocus: "content",
1017
+ "data-react-grab-ignore": true,
1018
+ "data-devbelt-window": id,
1019
+ className: "m-0 flex flex-col overflow-hidden rounded-xl border border-line bg-surface p-0 text-xs text-fg shadow-2xl",
1020
+ style: {
1021
+ width: `min(${size.width}px, calc(100vw - ${MARGIN2 * 2}px))`,
1022
+ height: `min(${size.height}px, var(--available-height, 100vh))`
1023
+ },
1024
+ children: [
1025
+ /* @__PURE__ */ jsxs5("header", { className: "flex shrink-0 items-center gap-2 border-b border-line bg-surface-header px-2 py-1.5", children: [
1026
+ /* @__PURE__ */ jsx5("span", { className: "text-fg-icon", "aria-hidden": "true", children: icon }),
1027
+ /* @__PURE__ */ jsx5(PopoverTitle, { className: "min-w-0 flex-1 truncate text-xs font-semibold", children: title }),
1028
+ /* @__PURE__ */ jsx5(
1029
+ PopoverClose,
1030
+ {
1031
+ "aria-label": `Close ${title}`,
1032
+ className: `${iconButtonClass} relative after:absolute after:-inset-1 size-6`,
1033
+ children: /* @__PURE__ */ jsx5(XIcon2, { className: "size-3.5", "aria-hidden": "true" })
1034
+ }
1035
+ )
1036
+ ] }),
1037
+ /* @__PURE__ */ jsx5("div", { className: "flex min-h-0 flex-1 flex-col", children: /* @__PURE__ */ jsx5(PluginBoundary, { plugin: id, children }) })
1038
+ ]
1039
+ }
1040
+ )
1041
+ }
1042
+ );
1043
+ }
1044
+
1045
+ // src/ui/toolbar-root.tsx
1046
+ import { useLayoutEffect as useLayoutEffect2, useState as useState4 } from "react";
1047
+ import { createPortal } from "react-dom";
1048
+
1049
+ // src/ui/styles.generated.ts
1050
+ var PROPERTY_CSS = '@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{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-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{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-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@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}@property --tw-ease{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}';
1051
+ var TOOLBAR_CSS = '/*! tailwindcss v4.3.5 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:block))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction: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-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--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;--tw-ease:initial;--tw-content:"";--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-500:oklch(68.5% .169 237.323);--color-violet-300:oklch(81.1% .111 293.571);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-neutral-400:oklch(70.8% 0 none);--color-neutral-500:oklch(55.6% 0 none);--color-neutral-900:oklch(20.5% 0 none);--color-neutral-950:oklch(14.5% 0 none);--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);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--tracking-wide:.025em;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-out:cubic-bezier(0, 0, .2, 1);--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-md:12px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--palette-ink:var(--color-neutral-950);--palette-ink-raised:var(--color-neutral-900);--palette-black:var(--color-black);--palette-paper:var(--color-white);--palette-mute:var(--color-neutral-400);--palette-dim:var(--color-neutral-500);--palette-sky:var(--color-sky-400);--palette-sky-strong:var(--color-sky-500);--palette-sky-soft:var(--color-sky-300);--palette-emerald:var(--color-emerald-400);--palette-emerald-strong:var(--color-emerald-500);--palette-emerald-soft:var(--color-emerald-300);--palette-amber:var(--color-amber-400);--palette-amber-soft:var(--color-amber-300);--palette-rose:var(--color-rose-400);--palette-rose-soft:var(--color-rose-300);--palette-violet-soft:var(--color-violet-300);--color-surface:var(--palette-ink);--color-surface-raised:var(--palette-ink-raised);--color-surface-overlay:#0a0a0ad9}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-surface-overlay:color-mix(in oklab, var(--palette-ink) 85%, transparent)}}:root,:host{--color-surface-sticky:#0a0a0acc}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-surface-sticky:color-mix(in oklab, var(--palette-ink) 80%, transparent)}}:root,:host{--color-surface-header:#17171799}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-surface-header:color-mix(in oklab, var(--palette-ink-raised) 60%, transparent)}}:root,:host{--color-scrim:#0009}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-scrim:color-mix(in oklab, var(--palette-black) 60%, transparent)}}:root,:host{--color-page:var(--palette-paper);--color-fg:var(--palette-paper);--color-fg-secondary:#ffffffb3}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-fg-secondary:color-mix(in oklab, var(--palette-paper) 70%, transparent)}}:root,:host{--color-fg-tertiary:#ffffff80}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-fg-tertiary:color-mix(in oklab, var(--palette-paper) 50%, transparent)}}:root,:host{--color-fg-disabled:#fff6}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-fg-disabled:color-mix(in oklab, var(--palette-paper) 40%, transparent)}}:root,:host{--color-fg-icon:var(--palette-mute);--color-fg-inverse:var(--palette-ink);--color-inverse:var(--palette-paper);--color-inverse-hover:#ffffffe6}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-inverse-hover:color-mix(in oklab, var(--palette-paper) 90%, transparent)}}:root,:host{--color-hover:#ffffff1a}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-hover:color-mix(in oklab, var(--palette-paper) 10%, transparent)}}:root,:host{--color-hover-subtle:#ffffff0d}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-hover-subtle:color-mix(in oklab, var(--palette-paper) 5%, transparent)}}:root,:host{--color-pressed:#ffffff26}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-pressed:color-mix(in oklab, var(--palette-paper) 15%, transparent)}}:root,:host{--color-track:#fff3}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-track:color-mix(in oklab, var(--palette-paper) 20%, transparent)}}:root,:host{--color-line:#ffffff1a}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-line:color-mix(in oklab, var(--palette-paper) 10%, transparent)}}:root,:host{--color-line-strong:#ffffff26}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-line-strong:color-mix(in oklab, var(--palette-paper) 15%, transparent)}}:root,:host{--color-line-control:#ffffff4d}@supports (color:color-mix(in lab, red, red)){:root,:host{--color-line-control:color-mix(in oklab, var(--palette-paper) 30%, transparent)}}:root,:host{--color-line-inverse:var(--palette-paper);--color-accent:var(--palette-sky);--color-accent-strong:var(--palette-sky-strong);--color-accent-fg:var(--palette-sky-soft);--color-focus:var(--color-accent);--color-success:var(--palette-emerald);--color-success-strong:var(--palette-emerald-strong);--color-success-fg:var(--palette-emerald-soft);--color-warning:var(--palette-amber);--color-warning-fg:var(--palette-amber-soft);--color-danger:var(--palette-rose);--color-danger-fg:var(--palette-rose-soft);--color-syntax-key:var(--palette-sky-soft);--color-syntax-string:var(--palette-emerald-soft);--color-syntax-number:var(--palette-amber-soft);--color-syntax-literal:var(--palette-violet-soft);--color-syntax-punctuation:var(--palette-dim)}}@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,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, 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;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:where(:not(iframe)){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}[data-devbelt] :where(button,[role=button],[role=tab],[role=switch],[role=checkbox],summary):not(:disabled,[aria-disabled=true]){cursor:pointer}[data-devbelt] [torph-sr]{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:0}.inset-4{inset:calc(var(--spacing) * 4)}.inset-x-0{inset-inline:0}.inset-x-3{inset-inline:calc(var(--spacing) * 3)}.inset-y-0{inset-block:0}.inset-y-0\\.5{inset-block:calc(var(--spacing) * .5)}.inset-y-3{inset-block:calc(var(--spacing) * 3)}.-top-6{top:calc(var(--spacing) * -6)}.top-\\(--y\\){top:var(--y)}.top-0{top:0}.top-1{top:var(--spacing)}.top-4{top:calc(var(--spacing) * 4)}.right-0{right:0}.bottom-0{bottom:0}.bottom-4{bottom:calc(var(--spacing) * 4)}.left-\\(--x\\){left:var(--x)}.left-0{left:0}.isolate{isolation:isolate}.-z-10{z-index:calc(10 * -1)}.z-0{z-index:0}.z-10{z-index:10}.z-\\[9000\\]{z-index:9000}.z-\\[9999\\]{z-index:9999}.z-\\[10000\\]{z-index:10000}.z-\\[10001\\]{z-index:10001}.float-end{float:inline-end}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-1{margin-inline:var(--spacing)}.mx-auto{margin-inline:auto}.my-1{margin-block:var(--spacing)}.ms-2{margin-inline-start:calc(var(--spacing) * 2)}.ms-auto{margin-inline-start:auto}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mb-1{margin-bottom:var(--spacing)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.\\!hidden{display:none!important}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}@supports not selector(::-webkit-scrollbar){.scrollbar-slim{scrollbar-width:thin;scrollbar-color:var(--color-track) transparent}}.scrollbar-slim::-webkit-scrollbar{width:10px;height:10px}.scrollbar-slim::-webkit-scrollbar-track{background:0 0}.scrollbar-slim::-webkit-scrollbar-corner{background:0 0}.scrollbar-slim::-webkit-scrollbar-thumb{background-color:var(--color-track);background-clip:content-box;border:2px solid #0000;border-radius:9999px}.scrollbar-slim::-webkit-scrollbar-thumb:hover{background-color:var(--color-fg-disabled)}.size-2\\.5{width:calc(var(--spacing) * 2.5);height:calc(var(--spacing) * 2.5)}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.size-7{width:calc(var(--spacing) * 7);height:calc(var(--spacing) * 7)}.size-8{width:calc(var(--spacing) * 8);height:calc(var(--spacing) * 8)}.h-\\(--h\\){height:var(--h)}.h-3{height:calc(var(--spacing) * 3)}.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-\\[3px\\]{height:3px}.h-auto{height:auto}.h-px{height:1px}.max-h-\\(--available-height\\){max-height:var(--available-height)}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-\\[40\\%\\]{max-height:40%}.max-h-none{max-height:none}.min-h-0{min-height:0}.min-h-6{min-height:calc(var(--spacing) * 6)}.min-h-16{min-height:calc(var(--spacing) * 16)}.w-\\(--w\\){width:var(--w)}.w-3{width:calc(var(--spacing) * 3)}.w-6{width:calc(var(--spacing) * 6)}.w-9{width:calc(var(--spacing) * 9)}.w-28{width:calc(var(--spacing) * 28)}.w-52{width:calc(var(--spacing) * 52)}.w-56{width:calc(var(--spacing) * 56)}.w-72{width:calc(var(--spacing) * 72)}.w-\\[3px\\]{width:3px}.w-\\[min\\(26rem\\,calc\\(100vw-2rem\\)\\)\\]{width:min(26rem,100vw - 2rem)}.w-\\[min\\(380px\\,calc\\(100vw-32px\\)\\)\\]{width:min(380px,100vw - 32px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-full{max-width:100%}.max-w-none{max-width:none}.min-w-0{min-width:0}.min-w-4{min-width:calc(var(--spacing) * 4)}.min-w-6{min-width:calc(var(--spacing) * 6)}.min-w-10{min-width:calc(var(--spacing) * 10)}.min-w-56{min-width:calc(var(--spacing) * 56)}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.\\[translate\\:var\\(--dock-x\\)_var\\(--dock-y\\)\\]{translate:var(--dock-x) var(--dock-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)}.cursor-crosshair{cursor:crosshair}.cursor-default{cursor:default}.cursor-ew-resize{cursor:ew-resize}.cursor-grab{cursor:grab}.cursor-ns-resize{cursor:ns-resize}.cursor-nwse-resize{cursor:nwse-resize}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.resize{resize:both}.resize-none{resize:none}.grid-cols-\\[3\\.25rem_minmax\\(0\\,1fr\\)_2\\.25rem_3\\.25rem_minmax\\(0\\,1\\.4fr\\)\\]{grid-template-columns:3.25rem minmax(0,1fr) 2.25rem 3.25rem minmax(0,1.4fr)}.grid-cols-\\[3\\.25rem_minmax\\(0\\,1fr\\)_2rem_4\\.5rem\\]{grid-template-columns:3.25rem minmax(0,1fr) 2rem 4.5rem}.grid-cols-\\[max-content_minmax\\(0\\,1fr\\)\\]{grid-template-columns:max-content minmax(0,1fr)}.grid-cols-\\[minmax\\(0\\,12rem\\)_minmax\\(0\\,1fr\\)_auto_auto\\]{grid-template-columns:minmax(0,12rem) minmax(0,1fr) auto auto}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.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)}:where(.space-y-1\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-y-1{row-gap:var(--spacing)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:2147483647px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-br-xl{border-bottom-right-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r-\\[3px\\]{border-right-style:var(--tw-border-style);border-right-width:3px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-\\[3px\\]{border-bottom-style:var(--tw-border-style);border-bottom-width:3px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent{border-color:var(--color-accent)}.border-line{border-color:var(--color-line)}.border-line-control{border-color:var(--color-line-control)}.border-line-strong{border-color:var(--color-line-strong)}.border-success{border-color:var(--color-success)}.bg-accent{background-color:var(--color-accent)}.bg-accent-strong{background-color:var(--color-accent-strong)}.bg-accent\\/5{background-color:#00bcfe0d}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/5{background-color:color-mix(in oklab, var(--color-accent) 5%, transparent)}}.bg-accent\\/10{background-color:#00bcfe1a}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/10{background-color:color-mix(in oklab, var(--color-accent) 10%, transparent)}}.bg-accent\\/15{background-color:#00bcfe26}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/15{background-color:color-mix(in oklab, var(--color-accent) 15%, transparent)}}.bg-accent\\/20{background-color:#00bcfe33}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/20{background-color:color-mix(in oklab, var(--color-accent) 20%, transparent)}}.bg-accent\\/60{background-color:#00bcfe99}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/60{background-color:color-mix(in oklab, var(--color-accent) 60%, transparent)}}.bg-accent\\/70{background-color:#00bcfeb3}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/70{background-color:color-mix(in oklab, var(--color-accent) 70%, transparent)}}.bg-danger{background-color:var(--color-danger)}.bg-hover{background-color:var(--color-hover)}.bg-hover-subtle{background-color:var(--color-hover-subtle)}.bg-inverse{background-color:var(--color-inverse)}.bg-page{background-color:var(--color-page)}.bg-pressed{background-color:var(--color-pressed)}.bg-scrim{background-color:var(--color-scrim)}.bg-success{background-color:var(--color-success)}.bg-success-strong{background-color:var(--color-success-strong)}.bg-success\\/10{background-color:#00d2941a}@supports (color:color-mix(in lab, red, red)){.bg-success\\/10{background-color:color-mix(in oklab, var(--color-success) 10%, transparent)}}.bg-success\\/20{background-color:#00d29433}@supports (color:color-mix(in lab, red, red)){.bg-success\\/20{background-color:color-mix(in oklab, var(--color-success) 20%, transparent)}}.bg-surface{background-color:var(--color-surface)}.bg-surface-header{background-color:var(--color-surface-header)}.bg-surface-overlay{background-color:var(--color-surface-overlay)}.bg-surface-raised{background-color:var(--color-surface-raised)}.bg-surface-sticky{background-color:var(--color-surface-sticky)}.bg-track{background-color:var(--color-track)}.bg-transparent{background-color:#0000}.bg-warning{background-color:var(--color-warning)}@supports (animation-timeline:scroll()){.scroll-fade{animation-name:scroll-fade-start,scroll-fade-end;animation-duration:auto;animation-composition:add;-webkit-mask-composite:source-in;animation-timing-function:linear;animation-fill-mode:both;animation-timeline:scroll(self);animation-range:0 48px,calc(100% - 48px) 100%;-webkit-mask-image:linear-gradient(#0000,#000 48px),linear-gradient(0deg,#0000,#000 48px);mask-image:linear-gradient(#0000,#000 48px),linear-gradient(0deg,#0000,#000 48px);-webkit-mask-position:0 -48px,0 0;mask-position:0 -48px,0 0;-webkit-mask-size:100% calc(100% + 48px),100% calc(100% + 48px);mask-size:100% calc(100% + 48px),100% calc(100% + 48px);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-composite:source-in;mask-composite:intersect}}.fill-current{fill:currentColor}.p-0{padding:0}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.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-3\\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-4{padding-block:calc(var(--spacing) * 4)}.ps-3\\.5{padding-inline-start:calc(var(--spacing) * 3.5)}.ps-6{padding-inline-start:calc(var(--spacing) * 6)}.pe-1{padding-inline-end:var(--spacing)}.pt-1\\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pb-1{padding-bottom:var(--spacing)}.text-end{text-align:end}.text-start{text-align:start}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.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}.text-\\[11px\\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-accent-fg{color:var(--color-accent-fg)}.text-danger-fg{color:var(--color-danger-fg)}.text-fg{color:var(--color-fg)}.text-fg-disabled{color:var(--color-fg-disabled)}.text-fg-icon{color:var(--color-fg-icon)}.text-fg-inverse{color:var(--color-fg-inverse)}.text-fg-secondary{color:var(--color-fg-secondary)}.text-fg-tertiary{color:var(--color-fg-tertiary)}.text-success-fg{color:var(--color-success-fg)}.text-warning-fg{color:var(--color-warning-fg)}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal, ) var(--tw-slashed-zero, ) var(--tw-numeric-figure, ) var(--tw-numeric-spacing, ) var(--tw-numeric-fraction, )}.opacity-0{opacity:0}.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-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px 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-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px 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-sm{--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-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px 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)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset, ) 0 0 0 calc(1px + 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-line{--tw-ring-color:var(--color-line)}.ring-line-strong{--tw-ring-color:var(--color-line-strong)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur, ) var(--tw-brightness, ) var(--tw-contrast, ) var(--tw-grayscale, ) var(--tw-hue-rotate, ) var(--tw-invert, ) var(--tw-saturate, ) var(--tw-sepia, ) var(--tw-drop-shadow, )}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-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-\\[opacity\\,scale\\]{transition-property:opacity,scale;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))}.transition-opacity{transition-property:opacity;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}.duration-\\[240ms\\]{--tw-duration:.24s;transition-duration:.24s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.running{animation-play-state:running}@media (hover:hover){:is(:where(.group):hover .group-hover\\:opacity-100){opacity:1}}:is(:where(.group):active .group-active\\:opacity-100){opacity:1}.placeholder\\:text-fg-disabled::placeholder{color:var(--color-fg-disabled)}.backdrop\\:bg-scrim::backdrop{background-color:var(--color-scrim)}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:-inset-1:after{content:var(--tw-content);inset:calc(var(--spacing) * -1)}.after\\:inset-x-0:after{content:var(--tw-content);inset-inline:0}.after\\:-inset-y-0\\.5:after{content:var(--tw-content);inset-block:calc(var(--spacing) * -.5)}.after\\:-inset-y-1:after{content:var(--tw-content);inset-block:calc(var(--spacing) * -1)}@media (hover:hover){.hover\\:bg-hover:hover{background-color:var(--color-hover)}.hover\\:bg-hover-subtle:hover{background-color:var(--color-hover-subtle)}.hover\\:bg-inverse:hover{background-color:var(--color-inverse)}.hover\\:bg-inverse-hover:hover{background-color:var(--color-inverse-hover)}.hover\\:bg-success:hover{background-color:var(--color-success)}.hover\\:bg-surface-raised:hover{background-color:var(--color-surface-raised)}.hover\\:text-fg:hover{color:var(--color-fg)}}.focus-visible\\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\\:outline-offset-1:focus-visible{outline-offset:1px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-focus:focus-visible{outline-color:var(--color-focus)}.active\\:cursor-grabbing:active{cursor:grabbing}.disabled\\:opacity-40:disabled{opacity:.4}.data-checked\\:border-line-inverse[data-checked]{border-color:var(--color-line-inverse)}.data-checked\\:bg-inverse[data-checked]{background-color:var(--color-inverse)}.data-checked\\:bg-surface[data-checked]{background-color:var(--color-surface)}.data-checked\\:text-fg-inverse[data-checked]{color:var(--color-fg-inverse)}.data-disabled\\:opacity-40[data-disabled]{opacity:.4}.data-ending-style\\:opacity-0[data-ending-style]{opacity:0}.data-ending-style\\:duration-\\[160ms\\][data-ending-style]{--tw-duration:.16s;transition-duration:.16s}.data-highlighted\\:bg-hover-subtle[data-highlighted]{background-color:var(--color-hover-subtle)}.data-pressed\\:border-line-inverse[data-pressed]{border-color:var(--color-line-inverse)}.data-pressed\\:bg-accent\\/20[data-pressed]{background-color:#00bcfe33}@supports (color:color-mix(in lab, red, red)){.data-pressed\\:bg-accent\\/20[data-pressed]{background-color:color-mix(in oklab, var(--color-accent) 20%, transparent)}}.data-pressed\\:bg-inverse[data-pressed]{background-color:var(--color-inverse)}.data-pressed\\:bg-pressed[data-pressed]{background-color:var(--color-pressed)}.data-pressed\\:text-fg-inverse[data-pressed]{color:var(--color-fg-inverse)}@media (hover:hover){.data-pressed\\:hover\\:bg-transparent[data-pressed]:hover{background-color:#0000}}.data-selected\\:bg-accent\\/15[data-selected]{background-color:#00bcfe26}@supports (color:color-mix(in lab, red, red)){.data-selected\\:bg-accent\\/15[data-selected]{background-color:color-mix(in oklab, var(--color-accent) 15%, transparent)}}.data-selected\\:bg-hover[data-selected]{background-color:var(--color-hover)}.data-selected\\:text-fg[data-selected]{color:var(--color-fg)}.data-starting-style\\:scale-\\[0\\.98\\][data-starting-style]{scale:.98}.data-starting-style\\:opacity-0[data-starting-style]{opacity:0}.data-unchecked\\:invisible[data-unchecked]{visibility:hidden}@media (prefers-reduced-motion:reduce){.motion-reduce\\:transition-none{transition-property:none}}.\\[\\&_\\.hljs-attr\\]\\:text-syntax-key .hljs-attr{color:var(--color-syntax-key)}.\\[\\&_\\.hljs-literal\\]\\:text-syntax-literal .hljs-literal{color:var(--color-syntax-literal)}.\\[\\&_\\.hljs-number\\]\\:text-syntax-number .hljs-number{color:var(--color-syntax-number)}.\\[\\&_\\.hljs-punctuation\\]\\:text-syntax-punctuation .hljs-punctuation{color:var(--color-syntax-punctuation)}.\\[\\&_\\.hljs-string\\]\\:text-syntax-string .hljs-string{color:var(--color-syntax-string)}.\\[\\&_pre\\]\\:text-\\[13px\\] pre{font-size:13px}.\\[\\&_svg\\]\\:size-3 svg{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.\\[\\&_svg\\]\\:text-accent-fg svg{color:var(--color-accent-fg)}.\\[\\&_svg\\]\\:text-fg-icon svg{color:var(--color-fg-icon)}.\\[\\&_svg\\]\\:text-fg-inverse svg{color:var(--color-fg-inverse)}.\\[\\&_svg\\]\\:transition-colors svg{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))}.\\[\\&_svg\\]\\:duration-75 svg{--tw-duration:75ms;transition-duration:75ms}.data-pressed\\:\\[\\&_svg\\]\\:text-accent-fg[data-pressed] svg{color:var(--color-accent-fg)}.data-pressed\\:\\[\\&_svg\\]\\:text-fg[data-pressed] svg{color:var(--color-fg)}}@keyframes scroll-fade-start{0%{-webkit-mask-position:0 0,0 0;mask-position:0 0,0 0}to{-webkit-mask-position:0 48px,0 0;mask-position:0 48px,0 0}}@keyframes scroll-fade-end{0%{-webkit-mask-position:0 0,0 -48px;mask-position:0 0,0 -48px}to{-webkit-mask-position:0 0,0 0;mask-position:0 0,0 0}}@keyframes scroll-fade-start-x{0%{-webkit-mask-position:0 0,0 0;mask-position:0 0,0 0}to{-webkit-mask-position:48px 0,0 0;mask-position:48px 0,0 0}}@keyframes scroll-fade-end-x{0%{-webkit-mask-position:0 0,-48px 0;mask-position:0 0,-48px 0}to{-webkit-mask-position:0 0,0 0;mask-position:0 0,0 0}}[data-devbelt-hidden] [data-devbelt-hud]{display:none}@keyframes pulse{50%{opacity:.5}}';
1052
+
1053
+ // src/ui/toolbar-root.tsx
1054
+ var HOST_TAG = "devbelt-root";
1055
+ var PROPERTY_STYLE_ID = "devbelt-properties";
1056
+ var HOST_CSS = `:host{all:initial;display:contents;font:12px/1.5 ui-sans-serif,system-ui,sans-serif;color:var(--color-fg);-webkit-font-smoothing:antialiased}`;
1057
+ function ensurePropertyStyles() {
1058
+ if (document.getElementById(PROPERTY_STYLE_ID)) return;
1059
+ const style = document.createElement("style");
1060
+ style.id = PROPERTY_STYLE_ID;
1061
+ style.textContent = PROPERTY_CSS;
1062
+ document.head.append(style);
1063
+ }
1064
+ function useMount(isolation, pluginCss) {
1065
+ const [mount, setMount] = useState4(null);
1066
+ const cssKey = pluginCss.join("\n");
1067
+ useLayoutEffect2(() => {
1068
+ const host = document.createElement(HOST_TAG);
1069
+ host.setAttribute("data-react-grab-ignore", "");
1070
+ const container = document.createElement("div");
1071
+ container.setAttribute("data-devbelt", "");
1072
+ let root = document;
1073
+ if (isolation === "shadow") {
1074
+ ensurePropertyStyles();
1075
+ const shadow = host.attachShadow({ mode: "open" });
1076
+ const style = document.createElement("style");
1077
+ style.textContent = `${HOST_CSS}${TOOLBAR_CSS}${cssKey}`;
1078
+ shadow.append(style, container);
1079
+ root = shadow;
1080
+ } else {
1081
+ if (cssKey) {
1082
+ const style = document.createElement("style");
1083
+ style.textContent = cssKey;
1084
+ host.append(style);
1085
+ }
1086
+ host.append(container);
1087
+ }
1088
+ document.body.append(host);
1089
+ setMount({ container, root });
1090
+ return () => {
1091
+ host.remove();
1092
+ setMount(null);
1093
+ };
1094
+ }, [isolation, cssKey]);
1095
+ return mount;
1096
+ }
1097
+ function ToolbarPortal({
1098
+ mount,
1099
+ children
1100
+ }) {
1101
+ return mount ? createPortal(children, mount.container) : null;
1102
+ }
1103
+
1104
+ // src/ui/use-dock-position.ts
1105
+ import { useEffect as useEffect4, useRef as useRef4, useState as useState5 } from "react";
1106
+ var STORAGE_KEY2 = "position";
1107
+ var ORIGIN = { x: 0, y: 0 };
1108
+ var MARGIN3 = 8;
1109
+ var STEP2 = 8;
1110
+ var LARGE_STEP2 = 40;
1111
+ var DRAG_THRESHOLD2 = 4;
1112
+ var SNAP_DISTANCE = 12;
1113
+ var SNAP_EDGE_GAP = 16;
1114
+ var NO_GUIDES = { x: null, y: null };
1115
+ function read2() {
1116
+ const parsed = readJson(STORAGE_KEY2, null);
1117
+ return typeof parsed?.x === "number" && typeof parsed.y === "number" ? { x: parsed.x, y: parsed.y } : ORIGIN;
1118
+ }
1119
+ function write(position) {
1120
+ if (position.x === 0 && position.y === 0) writeString(STORAGE_KEY2, null);
1121
+ else writeJson(STORAGE_KEY2, position);
1122
+ }
1123
+ var clamp = (value, min, max) => Math.min(Math.max(value, min), Math.max(min, max));
1124
+ function snapAxis(offset, from, lo, hi, size) {
1125
+ const shift = offset - from;
1126
+ const a = lo + shift;
1127
+ const b = hi + shift;
1128
+ const targets = [
1129
+ { delta: SNAP_EDGE_GAP - a, guide: SNAP_EDGE_GAP },
1130
+ { delta: size - SNAP_EDGE_GAP - b, guide: size - SNAP_EDGE_GAP },
1131
+ { delta: size / 2 - (a + b) / 2, guide: size / 2 }
1132
+ ];
1133
+ const best = targets.filter((t) => Math.abs(t.delta) <= SNAP_DISTANCE).sort((p, q) => Math.abs(p.delta) - Math.abs(q.delta))[0];
1134
+ return best ? { offset: offset + best.delta, guide: best.guide } : { offset, guide: null };
1135
+ }
1136
+ function useDockPosition(collapsed) {
1137
+ const dockRef = useRef4(null);
1138
+ const [position, setPosition] = useState5(read2);
1139
+ const [guides, setGuides] = useState5(NO_GUIDES);
1140
+ const current = useRef4(position);
1141
+ const stopDrag = useRef4(void 0);
1142
+ const paint = (next) => {
1143
+ const dock = dockRef.current;
1144
+ dock?.style.setProperty("--dock-x", `${next.x}px`);
1145
+ dock?.style.setProperty("--dock-y", `${next.y}px`);
1146
+ };
1147
+ const commit = (next) => {
1148
+ current.current = next;
1149
+ setPosition(next);
1150
+ paint(next);
1151
+ write(next);
1152
+ };
1153
+ const bounds = () => {
1154
+ const parts = dockRef.current?.querySelectorAll("[data-dock]");
1155
+ let left = Infinity;
1156
+ let top = Infinity;
1157
+ let right = -Infinity;
1158
+ let bottom = -Infinity;
1159
+ parts?.forEach((part) => {
1160
+ if (collapsed && part.dataset.dock === "toolbar") return;
1161
+ const rect = part.getBoundingClientRect();
1162
+ left = Math.min(left, rect.left);
1163
+ top = Math.min(top, rect.top);
1164
+ right = Math.max(right, rect.right);
1165
+ bottom = Math.max(bottom, rect.bottom);
1166
+ });
1167
+ return Number.isFinite(left) ? { left, top, right, bottom } : null;
1168
+ };
1169
+ const fit = (desired, from) => {
1170
+ const box = bounds();
1171
+ if (!box) return desired;
1172
+ return {
1173
+ x: clamp(
1174
+ desired.x,
1175
+ from.x + MARGIN3 - box.left,
1176
+ from.x + window.innerWidth - MARGIN3 - box.right
1177
+ ),
1178
+ y: clamp(
1179
+ desired.y,
1180
+ from.y + MARGIN3 - box.top,
1181
+ from.y + window.innerHeight - MARGIN3 - box.bottom
1182
+ )
1183
+ };
1184
+ };
1185
+ useEffect4(() => {
1186
+ const onResize = () => {
1187
+ const fitted = fit(current.current, current.current);
1188
+ if (fitted.x !== current.current.x || fitted.y !== current.current.y) {
1189
+ commit(fitted);
1190
+ }
1191
+ };
1192
+ window.addEventListener("resize", onResize);
1193
+ return () => {
1194
+ window.removeEventListener("resize", onResize);
1195
+ stopDrag.current?.();
1196
+ };
1197
+ }, [collapsed]);
1198
+ const startDrag = (event) => {
1199
+ if (event.button !== 0) return;
1200
+ stopDrag.current?.();
1201
+ const from = current.current;
1202
+ const box = bounds();
1203
+ const origin = { x: event.clientX, y: event.clientY };
1204
+ stopDrag.current = bindDrag(event.currentTarget, event.nativeEvent, {
1205
+ threshold: DRAG_THRESHOLD2,
1206
+ cancelOnEscape: true,
1207
+ onMove: ({ x, y, event: move }) => {
1208
+ const desired = {
1209
+ x: from.x + x - origin.x,
1210
+ y: from.y + y - origin.y
1211
+ };
1212
+ if (!box) return paint(desired);
1213
+ const clamped = {
1214
+ x: clamp(
1215
+ desired.x,
1216
+ from.x + MARGIN3 - box.left,
1217
+ from.x + window.innerWidth - MARGIN3 - box.right
1218
+ ),
1219
+ y: clamp(
1220
+ desired.y,
1221
+ from.y + MARGIN3 - box.top,
1222
+ from.y + window.innerHeight - MARGIN3 - box.bottom
1223
+ )
1224
+ };
1225
+ if (move.altKey) {
1226
+ setGuides((g) => g.x === null && g.y === null ? g : NO_GUIDES);
1227
+ return paint(clamped);
1228
+ }
1229
+ const snapX = snapAxis(
1230
+ clamped.x,
1231
+ from.x,
1232
+ box.left,
1233
+ box.right,
1234
+ window.innerWidth
1235
+ );
1236
+ const snapY = snapAxis(
1237
+ clamped.y,
1238
+ from.y,
1239
+ box.top,
1240
+ box.bottom,
1241
+ window.innerHeight
1242
+ );
1243
+ paint({ x: snapX.offset, y: snapY.offset });
1244
+ setGuides(
1245
+ (g) => g.x === snapX.guide && g.y === snapY.guide ? g : { x: snapX.guide, y: snapY.guide }
1246
+ );
1247
+ },
1248
+ onEnd: (_event, canceled) => {
1249
+ setGuides(NO_GUIDES);
1250
+ if (canceled) {
1251
+ paint(from);
1252
+ return;
1253
+ }
1254
+ const x = parseFloat(
1255
+ dockRef.current?.style.getPropertyValue("--dock-x") ?? ""
1256
+ );
1257
+ const y = parseFloat(
1258
+ dockRef.current?.style.getPropertyValue("--dock-y") ?? ""
1259
+ );
1260
+ if (Number.isFinite(x) && Number.isFinite(y)) commit({ x, y });
1261
+ }
1262
+ });
1263
+ };
1264
+ const onKeyDown = (event) => {
1265
+ if (!event.altKey) return;
1266
+ const delta = {
1267
+ ArrowLeft: { x: -1, y: 0 },
1268
+ ArrowRight: { x: 1, y: 0 },
1269
+ ArrowUp: { x: 0, y: -1 },
1270
+ ArrowDown: { x: 0, y: 1 }
1271
+ }[event.key];
1272
+ if (!delta) return;
1273
+ event.preventDefault();
1274
+ event.stopPropagation();
1275
+ const step = event.shiftKey ? LARGE_STEP2 : STEP2;
1276
+ const from = current.current;
1277
+ commit(
1278
+ fit({ x: from.x + delta.x * step, y: from.y + delta.y * step }, from)
1279
+ );
1280
+ };
1281
+ const reset = () => commit(ORIGIN);
1282
+ return { dockRef, position, guides, startDrag, onKeyDown, reset };
1283
+ }
1284
+
1285
+ // src/ui/toolbar.tsx
1286
+ import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
1287
+ var COLLAPSE_KEY = "collapsed";
1288
+ var OPEN_POPUP = '[data-slot$="-content"][data-open]:not([data-slot="tooltip-content"])';
1289
+ function ToolbarImpl({
1290
+ plugins,
1291
+ isolation,
1292
+ panelMode,
1293
+ aiTools
1294
+ }) {
1295
+ const [embedded] = useState6(() => window.self !== window.top);
1296
+ const key = plugins.map((p) => p.id).join("|");
1297
+ useEffect5(() => installPlugins(plugins), [key]);
1298
+ useEffect5(
1299
+ () => embedded ? installToolbarShortcuts({
1300
+ collapse: () => forwardToTop(COLLAPSE_EVENT),
1301
+ hide: () => forwardToTop(HIDE_EVENT)
1302
+ }) : void 0,
1303
+ [embedded]
1304
+ );
1305
+ return embedded ? null : /* @__PURE__ */ jsx6(
1306
+ TopToolbar,
1307
+ {
1308
+ plugins,
1309
+ isolation,
1310
+ panelMode,
1311
+ aiTools
1312
+ }
1313
+ );
1314
+ }
1315
+ function TopToolbar({ plugins, isolation, panelMode, aiTools }) {
1316
+ const pluginCss = useMemo2(
1317
+ () => plugins.flatMap((p) => p.styles ? [p.styles] : []),
1318
+ [plugins]
1319
+ );
1320
+ const mount = useMount(isolation, pluginCss);
1321
+ const [collapsed, setCollapsed] = useState6(
1322
+ () => readString(COLLAPSE_KEY) === "1"
1323
+ );
1324
+ const [hidden, setHidden] = useState6(false);
1325
+ const dock = useDockPosition(collapsed);
1326
+ const layout = useDevLayout(plugins, panelMode);
1327
+ const live = useRef5({ layout, plugins, aiTools, hidden });
1328
+ const escapeHolds = useRef5(0);
1329
+ useEffect5(() => {
1330
+ live.current = { layout, plugins, aiTools, hidden };
1331
+ });
1332
+ const api = useMemo2(
1333
+ () => mount ? {
1334
+ container: mount.container,
1335
+ root: mount.root,
1336
+ openWindow: (id) => live.current.layout.open(id),
1337
+ closeWindow: (id) => live.current.layout.close(id),
1338
+ toggleWindow: (id) => live.current.layout.toggle(id),
1339
+ get aiTools() {
1340
+ return live.current.aiTools ?? defaultAiTools;
1341
+ },
1342
+ debugContext: () => collectDebugContext(live.current.plugins),
1343
+ debugSections: () => live.current.plugins.flatMap((p) => {
1344
+ try {
1345
+ return p.debugSections?.() ?? [];
1346
+ } catch {
1347
+ return [];
1348
+ }
1349
+ }),
1350
+ setHidden: (next) => setHidden(next),
1351
+ isHidden: () => live.current.hidden,
1352
+ holdEscape: () => {
1353
+ escapeHolds.current++;
1354
+ let released = false;
1355
+ return () => {
1356
+ if (!released) {
1357
+ released = true;
1358
+ escapeHolds.current--;
1359
+ }
1360
+ };
1361
+ }
1362
+ } : null,
1363
+ [mount]
1364
+ );
1365
+ const toolKey = plugins.map((p) => `${p.id}:${p.agent?.write === true}`).join("|");
1366
+ const apiRef = useRef5(api);
1367
+ useEffect5(() => {
1368
+ apiRef.current = api;
1369
+ });
1370
+ useEffect5(
1371
+ () => registerAgentTools(
1372
+ exposedAgentTools(plugins),
1373
+ () => apiRef.current
1374
+ ),
1375
+ [toolKey]
1376
+ // eslint-disable-line react-hooks/exhaustive-deps
1377
+ );
1378
+ useEffect5(() => {
1379
+ const onKey = (event) => {
1380
+ if (event.key !== "Escape" || event.defaultPrevented) return;
1381
+ const { layout: current } = live.current;
1382
+ if (live.current.hidden || escapeHolds.current > 0 || current.layout.open.length === 0) {
1383
+ return;
1384
+ }
1385
+ const root = mount?.root ?? document;
1386
+ if (root.querySelector(OPEN_POPUP) || document.querySelector(OPEN_POPUP)) {
1387
+ return;
1388
+ }
1389
+ event.preventDefault();
1390
+ current.close(current.layout.open[current.layout.open.length - 1]);
1391
+ };
1392
+ window.addEventListener("keydown", onKey);
1393
+ return () => window.removeEventListener("keydown", onKey);
1394
+ }, [mount]);
1395
+ const toggleCollapsed = () => setCollapsed((current) => {
1396
+ writeString(COLLAPSE_KEY, current ? "0" : "1");
1397
+ return !current;
1398
+ });
1399
+ const toggleHidden = () => setHidden((current) => !current);
1400
+ useEffect5(() => {
1401
+ mount?.container.toggleAttribute("data-devbelt-hidden", hidden);
1402
+ }, [mount, hidden]);
1403
+ const shortcutActions = useRef5({ collapse: () => {
1404
+ }, hide: () => {
1405
+ } });
1406
+ useEffect5(() => {
1407
+ shortcutActions.current = {
1408
+ collapse: () => live.current.hidden ? setHidden(false) : toggleCollapsed(),
1409
+ hide: toggleHidden
1410
+ };
1411
+ });
1412
+ useEffect5(() => {
1413
+ const collapse = () => shortcutActions.current.collapse();
1414
+ const hide = () => shortcutActions.current.hide();
1415
+ const off = installToolbarShortcuts({ collapse, hide });
1416
+ window.addEventListener(COLLAPSE_EVENT, collapse);
1417
+ window.addEventListener(HIDE_EVENT, hide);
1418
+ return () => {
1419
+ off();
1420
+ window.removeEventListener(COLLAPSE_EVENT, collapse);
1421
+ window.removeEventListener(HIDE_EVENT, hide);
1422
+ };
1423
+ }, []);
1424
+ const run = (plugin) => {
1425
+ if (!api) return;
1426
+ if (plugin.window) layout.open(plugin.id);
1427
+ else void plugin.run?.(api);
1428
+ };
1429
+ if (!api) return null;
1430
+ const pinned = plugins.filter((p) => layout.isPinned(p));
1431
+ const byId = new Map(plugins.map((p) => [p.id, p]));
1432
+ const popoverId = layout.mode === "popover" && !collapsed ? layout.layout.open.at(-1) : void 0;
1433
+ const popover = popoverId ? byId.get(popoverId) : void 0;
1434
+ return /* @__PURE__ */ jsx6(ToolbarContext.Provider, { value: api, children: /* @__PURE__ */ jsx6(MotionConfig, { reducedMotion: "user", children: /* @__PURE__ */ jsxs6(ToolbarPortal, { mount, children: [
1435
+ plugins.map(
1436
+ (plugin) => plugin.Overlay ? /* @__PURE__ */ jsx6(PluginBoundary, { plugin: plugin.id, children: /* @__PURE__ */ jsx6(plugin.Overlay, {}) }, plugin.id) : null
1437
+ ),
1438
+ /* @__PURE__ */ jsxs6("div", { style: { display: hidden ? "none" : "contents" }, children: [
1439
+ popover?.window ? /* @__PURE__ */ jsx6(
1440
+ PluginPopover,
1441
+ {
1442
+ id: popover.id,
1443
+ title: popover.window.title ?? popover.name,
1444
+ icon: popover.icon,
1445
+ size: popover.window.size,
1446
+ root: api.root,
1447
+ onClose: () => layout.close(popover.id),
1448
+ children: /* @__PURE__ */ jsx6(popover.window.Component, {})
1449
+ },
1450
+ popover.id
1451
+ ) : null,
1452
+ layout.mode === "window" ? layout.layout.open.map((id, index) => {
1453
+ const plugin = byId.get(id);
1454
+ if (!plugin?.window) return null;
1455
+ const { Component: Component2, size, title } = plugin.window;
1456
+ return /* @__PURE__ */ jsx6(
1457
+ FloatingWindow,
1458
+ {
1459
+ id,
1460
+ size,
1461
+ title: title ?? plugin.name,
1462
+ icon: plugin.icon,
1463
+ rect: clampRect(
1464
+ size,
1465
+ layout.layout.rects[id] ?? defaultRect(size, index)
1466
+ ),
1467
+ stack: index,
1468
+ onFocus: () => layout.focus(id),
1469
+ onClose: () => layout.close(id),
1470
+ onRect: (rect) => layout.setRect(id, rect),
1471
+ children: /* @__PURE__ */ jsx6(PluginBoundary, { plugin: id, children: /* @__PURE__ */ jsx6(Component2, {}) })
1472
+ },
1473
+ id
1474
+ );
1475
+ }) : null,
1476
+ dock.guides.x !== null ? /* @__PURE__ */ jsx6(
1477
+ "div",
1478
+ {
1479
+ "data-react-grab-ignore": true,
1480
+ "data-dock-guide": "x",
1481
+ "aria-hidden": "true",
1482
+ className: "pointer-events-none fixed inset-y-0 z-[9999] w-px bg-accent/70",
1483
+ style: { left: dock.guides.x }
1484
+ }
1485
+ ) : null,
1486
+ dock.guides.y !== null ? /* @__PURE__ */ jsx6(
1487
+ "div",
1488
+ {
1489
+ "data-react-grab-ignore": true,
1490
+ "data-dock-guide": "y",
1491
+ "aria-hidden": "true",
1492
+ className: "pointer-events-none fixed inset-x-0 z-[9999] h-px bg-accent/70",
1493
+ style: { top: dock.guides.y }
1494
+ }
1495
+ ) : null,
1496
+ /* @__PURE__ */ jsxs6(
1497
+ "div",
1498
+ {
1499
+ ref: dock.dockRef,
1500
+ className: "pointer-events-none fixed inset-0 z-[10000] [translate:var(--dock-x)_var(--dock-y)]",
1501
+ style: {
1502
+ "--dock-x": `${dock.position.x}px`,
1503
+ "--dock-y": `${dock.position.y}px`
1504
+ },
1505
+ children: [
1506
+ /* @__PURE__ */ jsx6(
1507
+ motion.div,
1508
+ {
1509
+ "data-react-grab-ignore": true,
1510
+ "data-dock": "chip",
1511
+ initial: false,
1512
+ animate: { y: collapsed ? 0 : "-3.25rem" },
1513
+ transition: spring.moderate,
1514
+ className: "pointer-events-none fixed inset-x-0 bottom-4 z-[10000] mx-auto flex w-fit",
1515
+ children: /* @__PURE__ */ jsxs6(Tooltip, { children: [
1516
+ /* @__PURE__ */ jsxs6(
1517
+ TooltipTrigger,
1518
+ {
1519
+ render: /* @__PURE__ */ jsx6(
1520
+ Button,
1521
+ {
1522
+ onPointerDown: dock.startDrag,
1523
+ "aria-label": collapsed ? "Show dev tools" : "Hide dev tools",
1524
+ "aria-expanded": !collapsed,
1525
+ "aria-keyshortcuts": ariaKeyshortcuts(COLLAPSE_SHORTCUT),
1526
+ onClick: toggleCollapsed
1527
+ }
1528
+ ),
1529
+ className: "pointer-events-auto flex h-7 w-fit items-center justify-center gap-1.5 rounded-full border border-line bg-surface px-3 text-xs font-medium text-fg shadow-lg hover:bg-surface-raised focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-focus",
1530
+ children: [
1531
+ /* @__PURE__ */ jsx6(
1532
+ motion.span,
1533
+ {
1534
+ initial: false,
1535
+ animate: { rotate: collapsed ? 180 : 0 },
1536
+ transition: spring.fast,
1537
+ className: "inline-flex",
1538
+ children: /* @__PURE__ */ jsx6(ChevronDownIcon, { className: "size-3.5 text-fg-icon", "aria-hidden": "true" })
1539
+ }
1540
+ ),
1541
+ collapsed ? /* @__PURE__ */ jsx6(
1542
+ motion.span,
1543
+ {
1544
+ initial: { opacity: 0, y: 4 },
1545
+ animate: { opacity: 1, y: 0 },
1546
+ transition: spring.fast,
1547
+ className: "inline-flex items-center gap-1.5",
1548
+ children: plugins.map(
1549
+ (plugin) => plugin.ChipStatus ? /* @__PURE__ */ jsx6(PluginBoundary, { plugin: plugin.id, children: /* @__PURE__ */ jsx6(plugin.ChipStatus, {}) }, plugin.id) : null
1550
+ )
1551
+ }
1552
+ ) : null
1553
+ ]
1554
+ }
1555
+ ),
1556
+ /* @__PURE__ */ jsxs6(TooltipContent, { side: "top", sideOffset: 8, className: `${tooltipClass} flex-col items-start`, children: [
1557
+ /* @__PURE__ */ jsxs6("span", { className: "flex items-center gap-2", children: [
1558
+ collapsed ? "Show the toolbar" : "Collapse the toolbar",
1559
+ /* @__PURE__ */ jsx6("kbd", { className: kbdClass, children: collapseLabel() })
1560
+ ] }),
1561
+ /* @__PURE__ */ jsxs6("span", { className: "flex items-center gap-2 text-fg-secondary", children: [
1562
+ "Hide everything",
1563
+ /* @__PURE__ */ jsx6("kbd", { className: kbdClass, children: hideLabel() })
1564
+ ] })
1565
+ ] })
1566
+ ] })
1567
+ }
1568
+ ),
1569
+ /* @__PURE__ */ jsx6(
1570
+ motion.div,
1571
+ {
1572
+ "data-react-grab-ignore": true,
1573
+ "data-dock": "toolbar",
1574
+ initial: false,
1575
+ animate: { y: collapsed ? "calc(100% + 1rem)" : 0 },
1576
+ transition: collapsed ? spring.slow.exit : spring.slow,
1577
+ className: "pointer-events-none fixed inset-x-0 bottom-4 z-[10000] mx-auto w-fit",
1578
+ children: /* @__PURE__ */ jsxs6(
1579
+ ToolbarStrip,
1580
+ {
1581
+ "aria-label": "Dev tools",
1582
+ inert: collapsed,
1583
+ className: "pointer-events-auto relative flex w-fit items-center gap-1 rounded-full border border-line bg-surface p-1 text-xs text-fg shadow-lg",
1584
+ children: [
1585
+ /* @__PURE__ */ jsxs6(Tooltip, { children: [
1586
+ /* @__PURE__ */ jsx6(
1587
+ TooltipTrigger,
1588
+ {
1589
+ render: /* @__PURE__ */ jsx6(
1590
+ ToolbarButton,
1591
+ {
1592
+ "aria-label": "Move dev tools",
1593
+ onPointerDown: dock.startDrag,
1594
+ onKeyDown: dock.onKeyDown,
1595
+ onDoubleClick: dock.reset
1596
+ }
1597
+ ),
1598
+ className: "inline-flex h-8 w-6 cursor-grab touch-none items-center justify-center rounded-full text-fg-icon select-none focus-visible:outline-2 focus-visible:outline-focus active:cursor-grabbing",
1599
+ children: /* @__PURE__ */ jsx6(GripVerticalIcon, { className: "size-4", "aria-hidden": "true" })
1600
+ }
1601
+ ),
1602
+ /* @__PURE__ */ jsx6(
1603
+ TooltipContent,
1604
+ {
1605
+ side: "top",
1606
+ sideOffset: 8,
1607
+ className: tooltipClass,
1608
+ children: "Drag to move \xB7 Alt+arrows nudge \xB7 double-click to reset"
1609
+ }
1610
+ )
1611
+ ] }),
1612
+ pinned.map((plugin, index) => /* @__PURE__ */ jsxs6(PluginBoundary, { plugin: plugin.id, children: [
1613
+ /* @__PURE__ */ jsx6(
1614
+ ItemMenu,
1615
+ {
1616
+ plugin,
1617
+ onOpen: () => run(plugin),
1618
+ onUnpin: () => layout.setPinned(plugin.id, false),
1619
+ children: plugin.Item ? /* @__PURE__ */ jsx6(plugin.Item, {}) : /* @__PURE__ */ jsx6(
1620
+ DefaultItem,
1621
+ {
1622
+ plugin,
1623
+ api,
1624
+ open: layout.isOpen(plugin.id),
1625
+ onToggle: () => layout.toggle(plugin.id)
1626
+ }
1627
+ )
1628
+ }
1629
+ ),
1630
+ index < pinned.length - 1 ? /* @__PURE__ */ jsx6(ToolbarSeparator, { className: "h-4 w-px bg-pressed" }) : null
1631
+ ] }, plugin.id)),
1632
+ /* @__PURE__ */ jsx6(ToolbarSeparator, { className: "mx-1 h-4 w-px bg-pressed" }),
1633
+ /* @__PURE__ */ jsx6(
1634
+ MoreMenu,
1635
+ {
1636
+ plugins,
1637
+ isPinned: layout.isPinned,
1638
+ mode: layout.mode,
1639
+ onMode: layout.setMode,
1640
+ onCollapse: toggleCollapsed,
1641
+ onHide: toggleHidden,
1642
+ onRun: run,
1643
+ onPin: layout.setPinned,
1644
+ onReset: layout.reset
1645
+ }
1646
+ ),
1647
+ plugins.map(
1648
+ (plugin) => plugin.Status ? /* @__PURE__ */ jsx6(PluginBoundary, { plugin: plugin.id, children: /* @__PURE__ */ jsx6(plugin.Status, {}) }, plugin.id) : null
1649
+ )
1650
+ ]
1651
+ }
1652
+ )
1653
+ }
1654
+ )
1655
+ ]
1656
+ }
1657
+ )
1658
+ ] })
1659
+ ] }) }) });
1660
+ }
1661
+ function collectDebugContext(plugins) {
1662
+ const entries = plugins.flatMap((p) => {
1663
+ try {
1664
+ return p.debugContext?.() ?? [];
1665
+ } catch {
1666
+ return [];
1667
+ }
1668
+ });
1669
+ return entries.some((e) => e.label === "Page") ? entries : [{ label: "Page", value: window.location.href }, ...entries];
1670
+ }
1671
+
1672
+ // src/ui/toolbar-entry.tsx
1673
+ import { jsx as jsx7 } from "react/jsx-runtime";
1674
+ var defaults = null;
1675
+ function ToolbarEntry({
1676
+ plugins,
1677
+ isolation,
1678
+ panelMode,
1679
+ aiTools
1680
+ }) {
1681
+ const list = useMemo3(() => plugins ?? (defaults ??= defaultPlugins()), [plugins]);
1682
+ return /* @__PURE__ */ jsx7(ToolbarImpl, { plugins: list, isolation, panelMode, aiTools });
1683
+ }
1684
+ export {
1685
+ ToolbarEntry as default
1686
+ };
1687
+ //# sourceMappingURL=toolbar-entry-QHIQKNOO.js.map